diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index d2aebf6..0c72c66 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -17,8 +17,8 @@ jobs: steps: - uses: actions/checkout@v3 - run: npm ci - - run: npm run demo:build - - run: npm run demo:test + - run: npm run build:demo + - run: npm run test:demo - run: grep -rq "/fregante/" ./demo/dist # https://github.com/refined-github/github-url-detection/pull/161 name: Ensure that the demo is built correctly diff --git a/demo/vite.config.ts b/demo/vite.config.ts index f5192f4..a771c26 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -16,4 +16,8 @@ export default defineConfig({ }, }, }, + define: { + // eslint-disable-next-line @typescript-eslint/naming-convention -- no. + 'import.meta.vitest': '"no vitest here, but I need the URLs"', + }, }); diff --git a/package-lock.json b/package-lock.json index 5850e61..0c11b9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "github-url-detection", - "version": "8.1.1", + "version": "8.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "github-url-detection", - "version": "8.1.1", + "version": "8.2.0", "license": "MIT", "dependencies": { "github-reserved-names": "^2.0.5" diff --git a/package.json b/package.json index 1f29c94..1515b6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-url-detection", - "version": "8.1.1", + "version": "8.2.0", "description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.", "keywords": [ "github", @@ -27,15 +27,15 @@ "build": "run-p build:*", "build:vite": "vite build", "build:typescript": "tsc --declaration --emitDeclarationOnly", - "demo:build": "VITE_KEEP_URLS=1 vite build demo", - "demo:test": "svelte-check", - "demo:watch": "vite preview demo & npm run demo:build -- --watch # vite serve isn't real", + "build:demo": "vite build demo", "prepack": "npm run build", - "test": "run-p build test:unit xo", - "test:unit": "VITE_KEEP_URLS=1 vitest", - "watch": "run-p watch:typescript demo:watch # vite watch doesn’t generate the lib, so just use the demo", - "watch:typescript": "tsc --watch", - "watch:test:unit": "run-p 'test:unit -- --watch' 'watch:typescript -- --watch'", + "test": "run-p build test:* xo", + "test:unit": "vitest", + "test:demo": "svelte-check", + "watch": "run-p watch:*", + "watch:typescript": "tsc --watch --noEmit", + "watch:test:unit": "npm run test:unit -- --watch", + "watch:demo": "vite preview demo & npm run build:demo -- --watch # vite serve isn't real", "xo": "xo" }, "xo": { diff --git a/tsconfig.json b/tsconfig.json index 4c475a7..e78f13f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,10 @@ { "extends": "@sindresorhus/tsconfig", "compilerOptions": { - "outDir": "distribution", "resolveJsonModule": true, - "target": "ES2022", "module": "NodeNext", - "lib": [ - "DOM", - "DOM.Iterable", - "ES2022" - ], + "moduleResolution": "NodeNext", + "outDir": "distribution" }, "include": [ "index.ts", diff --git a/vite.config.ts b/vite.config.ts index 58d0830..22d15c2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,4 +15,7 @@ export default defineConfig({ external: ['github-reserved-names/reserved-names.json'], }, }, + define: { + 'import.meta.vitest': 'undefined', + }, });