Skip to content

Commit

Permalink
Update dependencies (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Jul 1, 2024
1 parent 9f9e40c commit 42f37ee
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 41 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/esm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
env:
IMPORT_STATEMENT: export {default} from 'webext-permission-toggle';

# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates

name: ESM
on:
pull_request:
branches:
- '*'
push:
branches:
- master
- main
jobs:
Pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm run build --if-present
- run: npm pack --dry-run
- run: npm pack | tail -1 | xargs -n1 tar -xzf
- 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@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@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
Rollup:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v4
- run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-node-resolve
- run: echo "$IMPORT_STATEMENT" > index.js
- run: npx rollup -p node-resolve index.js
Vite:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v4
- run: npm install --omit=dev ./artifact
- run: echo '<script type="module">$IMPORT_STATEMENT</script>' > index.html
- run: npx vite build
- run: cat dist/assets/*
esbuild:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v4
- run: echo '{}' > package.json
- 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@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@v4
- uses: actions/setup-node@v4
with:
node-version-file: artifact/package.json
- run: echo "$IMPORT_STATEMENT" > index.mjs
- run: npm install --omit=dev ./artifact
- run: node index.mjs
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chromePromised from 'webext-polyfill-kinda';
import {isBackground, isChrome} from 'webext-detect-page';
import {isBackground, isChrome} from 'webext-detect';
import {isUrlPermittedByManifest} from 'webext-permissions';
import {getTabUrl} from 'webext-tools';
import alert from 'webext-alert';
Expand All @@ -10,7 +10,7 @@ let globalOptions: Options;

const chromeP = isChrome() && globalThis.chrome?.runtime?.getManifest().manifest_version < 3
? chromePromised
: chrome;
: globalThis.chrome;

type Options = {
/**
Expand Down
76 changes: 43 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@
}
},
"dependencies": {
"webext-alert": "^1.0.0",
"webext-content-scripts": "^2.6.1",
"webext-detect-page": "^5.0.1",
"webext-alert": "^1.0.2",
"webext-content-scripts": "^2.7.0",
"webext-detect": "^5.0.2",
"webext-permissions": "^3.1.3",
"webext-polyfill-kinda": "^1.0.2",
"webext-tools": "^1.2.5"
"webext-tools": "^2.0.1"
},
"devDependencies": {
"@parcel/config-webextension": "^2.12.0",
"@parcel/transformer-webextension": "^2.12.0",
"@sindresorhus/tsconfig": "^5.0.0",
"@sindresorhus/tsconfig": "^6.0.0",
"@types/chrome": "^0.0.268",
"parcel": "^2.12.0",
"typescript": "^5.4.5",
"typescript": "^5.5.2",
"xo": "^0.58.0"
},
"engines": {
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"outDir": "."
},
"files": [
"index.ts",
"globals.d.ts"
Expand Down

0 comments on commit 42f37ee

Please sign in to comment.