diff --git a/.github/workflows/esm-lint.yml b/.github/workflows/esm-lint.yml
index 675353c..5c40273 100644
--- a/.github/workflows/esm-lint.yml
+++ b/.github/workflows/esm-lint.yml
@@ -1,6 +1,5 @@
env:
- IMPORT_TEXT: import * as pageDetect from
- NPM_MODULE_NAME: github-url-detection
+ IMPORT_STATEMENT: import * as pageDetect from "github-url-detection"
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
@@ -19,77 +18,87 @@ 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:
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@2 @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 '' > 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
- - 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: 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
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml
index 8440108..acd82cf 100644
--- a/.github/workflows/npm-publish.yml
+++ b/.github/workflows/npm-publish.yml
@@ -19,10 +19,10 @@ jobs:
NPM:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-node@v3
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version-file: package.json
registry-url: https://registry.npmjs.org
- run: npm ci || npm install
- uses: fregante/setup-git-user@v2