Skip to content

Commit 4818df0

Browse files
authored
Don't bundle github-reserved-names (switch to esbuild) (#196)
1 parent 5debfba commit 4818df0

File tree

8 files changed

+659
-225
lines changed

8 files changed

+659
-225
lines changed

.github/workflows/esm-lint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
env:
2-
IMPORT_STATEMENT: import * as pageDetect from "github-url-detection"
2+
IMPORT_STATEMENT: export * as pageDetect from "github-url-detection"
33

44
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
55
# SOURCE: https://github.com/fregante/ghatemplates
@@ -58,9 +58,9 @@ jobs:
5858
needs: Pack
5959
steps:
6060
- uses: actions/download-artifact@v4
61-
- run: npm install --omit=dev ./artifact rollup@2 @rollup/plugin-node-resolve
61+
- run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-json @rollup/plugin-node-resolve
6262
- run: echo "$IMPORT_STATEMENT" > index.js
63-
- run: npx rollup -p node-resolve index.js
63+
- run: npx rollup -p node-resolve -p @rollup/plugin-json index.js
6464
Vite:
6565
runs-on: ubuntu-latest
6666
needs: Pack
@@ -84,6 +84,7 @@ jobs:
8484
needs: Pack
8585
steps:
8686
- uses: actions/download-artifact@v4
87+
- run: echo '{"type":"module"}' > package.json
8788
- run: npm install --omit=dev ./artifact @sindresorhus/tsconfig
8889
- run: echo "$IMPORT_STATEMENT" > index.ts
8990
- run: >

collector.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
export const testableUrls = new Map<string, string[]>();
44

55
export function addTests(test: string, urls: string[]): void {
6-
if (import.meta.vitest) {
7-
testableUrls.set(test, urls);
8-
}
6+
TEST: testableUrls.set(test, urls);
97
}
108

119
export function getTests(detectName: string): string[] {

demo/vite.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@ export default defineConfig({
1616
},
1717
},
1818
},
19-
define: {
20-
// eslint-disable-next-line @typescript-eslint/naming-convention -- no.
21-
'import.meta.vitest': '"no vitest here, but I need the URLs"',
22-
},
2319
});

global.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* eslint-disable @typescript-eslint/consistent-type-definitions -- Module augmentation */
22

3-
interface ImportMeta {
4-
readonly vitest: unknown;
5-
}
6-
73
// Broaden types because testing against `"undefined"` is fine for our regexes
84
interface RegExp {
95
test(s: string | undefined): boolean;

index.ts

Lines changed: 90 additions & 90 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)