Skip to content

Commit

Permalink
Update dependencies (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Jul 1, 2024
1 parent 68df2aa commit f752bf9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 41 deletions.
75 changes: 41 additions & 34 deletions .github/workflows/esm-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
env:
IMPORT_TEXT: import {CachedValue, CachedFunction, globalCache} from
NPM_MODULE_NAME: webext-storage-cache
IMPORT_STATEMENT: export {CachedValue, CachedFunction, globalCache} from "webext-storage-cache"

# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
Expand All @@ -18,80 +17,88 @@ jobs:
Pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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@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:
if: false # https://github.com/parcel-bundler/parcel/issues/4155
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
Rollup:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact rollup@2 @rollup/plugin-node-resolve
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- 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@v3
- run: npm install ./artifact
- run: >-
echo '<script type="module">${{ env.IMPORT_TEXT }} "${{
env.NPM_MODULE_NAME }}"</script>' > index.html
- 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@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:
if: false
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact @sindresorhus/tsconfig
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mts
- run: echo '{"extends":"@sindresorhus/tsconfig","files":["index.mts"]}' > tsconfig.json
- run: tsc
- 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: 14.x
- 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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@
},
"dependencies": {
"@sindresorhus/to-milliseconds": "^2.0.0",
"type-fest": "^4.20.0",
"webext-detect-page": "^5.0.1",
"type-fest": "^4.20.1",
"webext-detect": "^5.0.2",
"webext-polyfill-kinda": "^1.0.2"
},
"devDependencies": {
"@sindresorhus/tsconfig": "^5.0.0",
"@sindresorhus/tsconfig": "^6.0.0",
"@types/chrome": "0.0.268",
"@types/sinon-chrome": "^2.2.15",
"sinon-chrome": "^3.0.1",
"tsd": "^0.31.0",
"typescript": "^5.4.5",
"tsd": "^0.31.1",
"typescript": "^5.5.2",
"vitest": "^1.6.0",
"xo": "^0.58.0"
},
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The documentation for the legacy API can be found on the [v5 version of this rea

## Related

- [webext-detect-page](https://github.com/fregante/webext-detect-page) - Detects where the current browser extension code is being run.
- [webext-detect](https://github.com/fregante/webext-detect) - Detects where the current browser extension code is being run.
- [webext-options-sync](https://github.com/fregante/webext-options-sync) - Helps you manage and autosave your extension's options.
- [webext-base-css](https://github.com/fregante/webext-base-css) - Extremely minimal stylesheet/setup for Web Extensions’ options pages (also dark mode)
- [webext-dynamic-content-scripts](https://github.com/fregante/webext-dynamic-content-scripts) - Automatically registers your content_scripts on domains added via permission.request
Expand Down
2 changes: 1 addition & 1 deletion source/legacy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chromeP from 'webext-polyfill-kinda';
import {isBackgroundPage, isExtensionContext} from 'webext-detect-page';
import {isBackgroundPage, isExtensionContext} from 'webext-detect';
import toMilliseconds, {type TimeDescriptor} from '@sindresorhus/to-milliseconds';

const cacheDefault = {days: 30};
Expand Down

0 comments on commit f752bf9

Please sign in to comment.