Skip to content

Commit

Permalink
Update dependencies (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jul 1, 2024
1 parent 5615ad1 commit 94ea11d
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 86 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/esm-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
env:
IMPORT_TEXT: import
NPM_MODULE_NAME: webext-inject-on-install
IMPORT_STATEMENT: import "webext-inject-on-install"

# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
Expand All @@ -27,32 +26,36 @@ jobs:
- 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 ./artifact
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- run: npm install --omit=dev ./artifact
- run: echo "$IMPORT_STATEMENT" > index.js
- run: webpack --entry ./index.js
- run: cat dist/main.js
Rollup:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v4
- run: npm install ./artifact rollup@2 @rollup/plugin-node-resolve
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- 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 ./artifact
- run: >-
echo '<script type="module">${{ env.IMPORT_TEXT }} "${{
env.NPM_MODULE_NAME }}"</script>' > index.html
- 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:
Expand All @@ -61,20 +64,22 @@ jobs:
steps:
- 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@v4
- run: npm install ./artifact @sindresorhus/tsconfig
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.ts
- run: |
echo '{"extends":"@sindresorhus/tsconfig","files":["index.ts"]}' > tsconfig.json
- run: tsc
- run: cat index.js
- 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
Expand All @@ -83,6 +88,6 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: artifact/package.json
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mjs
- run: npm install ./artifact
- run: echo "$IMPORT_STATEMENT" > index.mjs
- run: npm install --omit=dev ./artifact
- run: node index.mjs
122 changes: 64 additions & 58 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 @@ -44,18 +44,18 @@
}
},
"dependencies": {
"webext-content-scripts": "^2.6.1",
"webext-detect-page": "^5.0.1",
"webext-events": "^3.0.0",
"webext-content-scripts": "^2.7.0",
"webext-detect": "^5.0.2",
"webext-events": "^3.0.1",
"webext-polyfill-kinda": "^1.0.2"
},
"devDependencies": {
"@parcel/config-webextension": "^2.12.0",
"@sindresorhus/tsconfig": "^5.0.0",
"@sindresorhus/tsconfig": "^6.0.0",
"@types/chrome": "^0.0.268",
"@types/sinon-chrome": "^2.2.15",
"bun": "^1.1.16",
"bun-types": "^1.1.16",
"bun": "^1.1.17",
"bun-types": "^1.1.17",
"parcel": "^2.12.0",
"sinon-chrome": "^3.0.1",
"typescript": "^5.5.2",
Expand Down
2 changes: 1 addition & 1 deletion source/inject.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import chrome from 'sinon-chrome';
import progressivelyInjectScript, {tracked} from './inject.js';

mock.module('webext-detect-page', () => ({isPersistentBackgroundPage: () => true}));
mock.module('webext-detect', () => ({isPersistentBackgroundPage: () => true}));

beforeEach(() => {
chrome.flush();
Expand Down
2 changes: 1 addition & 1 deletion source/inject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {injectContentScript, isScriptableUrl} from 'webext-content-scripts';
import {isPersistentBackgroundPage} from 'webext-detect-page';
import {isPersistentBackgroundPage} from 'webext-detect';
import chromeP from 'webext-polyfill-kinda';

const acceptableInjectionsCount = 10;
Expand Down

0 comments on commit 94ea11d

Please sign in to comment.