Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Replace xo with Biome, and npm with Bun #22

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
name: xo-lint-check
name: biome-lint-check

on: [ push, pull_request ]

jobs:
xo-lint-check:
biome-lint-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: npm install
- name: XO Lint
run: npx xo
run: bun install
- uses: biomejs/setup-biome@v2
- name: Run Biome
run: biome ci .
12 changes: 11 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install dependencies
run: pacman -Syu --noconfirm blueprint-compiler npm typescript gobject-introspection libadwaita zip
run: pacman -Syu --noconfirm blueprint-compiler typescript gobject-introspection libadwaita zip unzip

- uses: oven-sh/setup-bun@v2

- name: Build & Package Noiseclapper
run: make pack
Expand Down
5 changes: 0 additions & 5 deletions .xo-config

This file was deleted.

10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ all: $(JS_FILES)

# Dependencies
node_modules: package.json
npm install
bun install
touch $@

# Check TypeScript files with xo
# Check TypeScript files with biome
check:
npx xo
bunx biome ci .

# Compile TypeScript files
$(DIST_DIR)/%.js: $(SOURCE_FILES) node_modules
Expand All @@ -34,10 +34,6 @@ $(LOCALE_DIR)/$(NAME).pot: $(SOURCE_FILES) $(UI_FILES)
xgettext --from-code=UTF-8 --output=$@ $^ --add-comments --keyword=_ --keyword=C_:1c,2 --language=JavaScript
locale: $(LOCALE_DIR)/$(NAME).pot

# Compile schema files
# $(SCHEMA_DIR)/gschemas.compiled: $(SCHEMA_DIR)/org.gnome.shell.extensions.$(NAME).gschema.xml
# glib-compile-schemas $(SCHEMA_DIR)

# Compile UI files
$(DIST_DIR)/prefs.ui: $(UI_FILES)
blueprint-compiler compile $^ > $@
Expand Down
8 changes: 4 additions & 4 deletions ambient.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-unassigned-import */
import '@girs/gjs';
import '@girs/gjs/dom';
import '@girs/gnome-shell/ambient';
import '@girs/gnome-shell/extensions/global';
import "@girs/gjs";
import "@girs/gjs/dom";
import "@girs/gnome-shell/ambient";
import "@girs/gnome-shell/extensions/global";
23 changes: 23 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["dist/**/*"]
},
"linter": {
"rules": {
"all": true,
"style": {
"noNonNullAssertion": "off",
"noDefaultExport": "off",
"useNamingConvention": "off",
"noNamespaceImport": "off"
},
"suspicious": {
"noConsole": "off"
}
}
},
"javascript": {
"globals": ["logError"]
}
}
Binary file added bun.lockb
Binary file not shown.
68 changes: 34 additions & 34 deletions locale/Noiseclapper.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-20 09:31+0200\n"
"POT-Creation-Date: 2024-10-24 12:50+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -17,139 +17,139 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/extension.ts:98 src/common.ts:129
#: src/extension.ts:100 src/common.ts:130
msgid "Error"
msgstr ""

#: src/extension.ts:99
#: src/extension.ts:101
msgid "No connected compatible devices found."
msgstr ""

#: src/indicator.ts:46
#: src/indicator.ts:42
msgid "Noise Cancelling Mode"
msgstr ""

#: src/indicator.ts:51
#: src/indicator.ts:47
msgid "Equalizer Preset"
msgstr ""

#: src/indicator.ts:59
#: src/indicator.ts:55
msgid "Transport"
msgstr ""

#: src/indicator.ts:62
#: src/indicator.ts:59
msgid "Indoor"
msgstr ""

#: src/indicator.ts:64
#: src/indicator.ts:63
msgid "Outdoor"
msgstr ""

#: src/indicator.ts:69
#: src/indicator.ts:67
msgid "Normal / No ANC"
msgstr ""

#: src/indicator.ts:73
#: src/indicator.ts:71
msgid "Transparency / No NC"
msgstr ""

#: src/indicator.ts:83
#: src/indicator.ts:81
msgid "Soundcore Signature"
msgstr ""

#: src/indicator.ts:87
#: src/indicator.ts:85
msgid "Acoustic"
msgstr ""

#: src/indicator.ts:91
#: src/indicator.ts:89
msgid "Bass Booster"
msgstr ""

#: src/indicator.ts:95
#: src/indicator.ts:93
msgid "Bass Reducer"
msgstr ""

#: src/indicator.ts:99
#: src/indicator.ts:97
msgid "Classical"
msgstr ""

#: src/indicator.ts:103
#: src/indicator.ts:101
msgid "Podcast"
msgstr ""

#: src/indicator.ts:106
#: src/indicator.ts:104
msgid "Dance"
msgstr ""

#: src/indicator.ts:107
#: src/indicator.ts:105
msgid "Deep"
msgstr ""

#: src/indicator.ts:109
#: src/indicator.ts:107
msgid "Electronic"
msgstr ""

#: src/indicator.ts:112
#: src/indicator.ts:110
msgid "Flat"
msgstr ""

#: src/indicator.ts:113
#: src/indicator.ts:112
msgid "Hip-Hop"
msgstr ""

#: src/indicator.ts:114
#: src/indicator.ts:115
msgid "Jazz"
msgstr ""

#: src/indicator.ts:115
#: src/indicator.ts:117
msgid "Latin"
msgstr ""

#: src/indicator.ts:116
#: src/indicator.ts:121
msgid "Lounge"
msgstr ""

#: src/indicator.ts:117
#: src/indicator.ts:124
msgid "Piano"
msgstr ""

#: src/indicator.ts:118
#: src/indicator.ts:125
msgid "Pop"
msgstr ""

#: src/indicator.ts:119
#: src/indicator.ts:126
msgid "RnB"
msgstr ""

#: src/indicator.ts:120
#: src/indicator.ts:127
msgid "Rock"
msgstr ""

#: src/indicator.ts:122
#: src/indicator.ts:129
msgid "Small Speaker(s)"
msgstr ""

#: src/indicator.ts:126
#: src/indicator.ts:133
msgid "Spoken Word"
msgstr ""

#: src/indicator.ts:130
#: src/indicator.ts:137
msgid "Treble Booster"
msgstr ""

#: src/indicator.ts:134
#: src/indicator.ts:141
msgid "Treble Reducer"
msgstr ""

#. Separator
#. @ts-expect-error addMenuItem no longer exists in the type definitions ?
#. eslint-disable-line @typescript-eslint/no-unsafe-call
#. Settings button
#: src/indicator.ts:148 ui/prefs.blp:8
#: src/indicator.ts:155 ui/prefs.blp:8
msgid "Settings"
msgstr ""

#: src/common.ts:130
#: src/common.ts:131
msgid "Close the Soundcore application on your phone and try again."
msgstr ""

Expand Down
8 changes: 2 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"name": "Noiseclapper",
"name": "Noiseclapper",
"description": "Provides control of Soundcore Life Q30 Headphones (and others)",
"url": "https://github.com/JordanViknar/Noiseclapper",
"uuid": "Noiseclapper@JordanViknar",
"gettext-domain": "Noiseclapper",
"settings-schema": "org.gnome.shell.extensions.noiseclapper",
"shell-version": [
"45",
"46",
"47"
]
"shell-version": ["45", "46", "47"]
}
Loading
Loading