diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3a2f46f..753252b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3
+ - uses: actions/setup-node@v4
with:
- node-version-file: .nvmrc
+ node-version-file: package.json
- name: install
run: npm ci || npm install
- name: XO
@@ -26,9 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3
+ - uses: actions/setup-node@v4
with:
- node-version-file: .nvmrc
+ node-version-file: package.json
- name: install
run: npm ci || npm install
- name: build
@@ -40,9 +40,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3
+ - uses: actions/setup-node@v4
with:
- node-version-file: .nvmrc
+ node-version-file: package.json
- name: install
run: npm ci || npm install
- name: build
diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml
index 6b81417..6ed44d3 100644
--- a/.github/workflows/esm-lint.yml
+++ b/.github/workflows/esm-lint.yml
@@ -1,6 +1,5 @@
env:
- IMPORT_TEXT: import OptionsSync from
- NPM_MODULE_NAME: webext-options-sync
+ IMPORT_STATEMENT: export OptionsSync from "webext-options-sync"
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
@@ -24,64 +23,75 @@ jobs:
- run: npm run build --if-present
- run: npm pack --dry-run
- run: npm pack | tail -1 | xargs -n1 tar -xzf
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
path: package
+ Publint:
+ runs-on: ubuntu-latest
+ needs: Pack
+ steps:
+ - uses: actions/download-artifact@v4
+ - run: npx publint ./artifact
Webpack:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
- - run: npm install ./artifact
- - run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
+ - uses: actions/download-artifact@v4
+ - run: npm install --omit=dev ./artifact
+ - run: echo "$IMPORT_STATEMENT" > index.js
- run: webpack --entry ./index.js
- run: cat dist/main.js
Parcel:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
- - run: npm install ./artifact
- - run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
+ - uses: actions/download-artifact@v4
+ - run: npm install --omit=dev ./artifact
+ - run: echo "$IMPORT_STATEMENT" > index.js
+ - run: >
+ echo '{"@parcel/resolver-default": {"packageExports": true}}' >
+ package.json
- run: npx parcel@2 build index.js
- run: cat dist/index.js
Vite:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
- - run: npm install ./artifact
- - run: >-
- echo '' > index.html
+ - uses: actions/download-artifact@v4
+ - run: npm install --omit=dev ./artifact
+ - run: echo '' > index.html
- run: npx vite build
- run: cat dist/assets/*
esbuild:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
- run: echo '{}' > package.json
- - run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- - run: npm install ./artifact
+ - run: echo "$IMPORT_STATEMENT" > index.js
+ - run: npm install --omit=dev ./artifact
- run: npx esbuild --bundle index.js
TypeScript:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
- - run: npm install ./artifact && npm install @types/estree
- - run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.ts
- - run: tsc index.ts
- - run: cat index.js
+ - uses: actions/download-artifact@v4
+ - run: echo '{"type":"module"}' > package.json
+ - run: npm install --omit=dev ./artifact @sindresorhus/tsconfig
+ - run: echo "$IMPORT_STATEMENT" > index.ts
+ - run: >
+ echo '{"extends":"@sindresorhus/tsconfig","files":["index.ts"]}' >
+ tsconfig.json
+ - run: npx --package typescript -- tsc
+ - run: cat distribution/index.js
Node:
runs-on: ubuntu-latest
needs: Pack
steps:
- - uses: actions/download-artifact@v3
- - uses: actions/setup-node@v3
+ - uses: actions/download-artifact@v4
+ - uses: actions/setup-node@v4
with:
- node-version: 18
- - run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mjs
- - run: npm install ./artifact
+ node-version-file: artifact/package.json
+ - run: echo "$IMPORT_STATEMENT" > index.mjs
+ - run: npm install --omit=dev ./artifact
- run: node index.mjs
diff --git a/.nvmrc b/.nvmrc
deleted file mode 100644
index 3c03207..0000000
--- a/.nvmrc
+++ /dev/null
@@ -1 +0,0 @@
-18
diff --git a/index.ts b/index.ts
index f3c6fb7..9044a01 100644
--- a/index.ts
+++ b/index.ts
@@ -1,6 +1,6 @@
import {debounce} from 'throttle-debounce';
import chromeP from 'webext-polyfill-kinda';
-import {isBackground} from 'webext-detect-page';
+import {isBackground} from 'webext-detect';
import {serialize, deserialize} from 'dom-form-serializer/dist/dom-form-serializer.mjs';
import LZString from 'lz-string';
import {onContextInvalidated} from 'webext-events';
diff --git a/package.json b/package.json
index 9b54b76..e32b781 100644
--- a/package.json
+++ b/package.json
@@ -51,14 +51,14 @@
"dependencies": {
"dom-form-serializer": "^2.0.0",
"lz-string": "^1.5.0",
- "throttle-debounce": "^5.0.0",
- "uint8array-extras": "^1.1.0",
- "webext-detect-page": "^5.0.1",
- "webext-events": "^3.0.0",
+ "throttle-debounce": "^5.0.2",
+ "uint8array-extras": "^1.2.0",
+ "webext-detect": "^5.0.2",
+ "webext-events": "^3.0.1",
"webext-polyfill-kinda": "^1.0.2"
},
"devDependencies": {
- "@sindresorhus/tsconfig": "^5.0.0",
+ "@sindresorhus/tsconfig": "^6.0.0",
"@types/chrome": "0.0.268",
"@types/lz-string": "^1.3.34",
"@types/throttle-debounce": "^5.0.2",
@@ -67,8 +67,8 @@
"npm-run-all": "^4.1.5",
"sinon": "^18.0.0",
"sinon-chrome": "^3.0.1",
- "type-fest": "^4.20.0",
- "typescript": "^5.4.5",
+ "type-fest": "^4.20.1",
+ "typescript": "^5.5.2",
"xo": "^0.58.0"
},
"engines": {