Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…etection into use-esbuild
  • Loading branch information
fregante committed Jun 28, 2024
2 parents 319f16b + bd0411a commit 498a9da
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
},
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
9 changes: 2 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ export default defineConfig({
external: ['github-reserved-names/reserved-names.json'],
},
},
define: {
'import.meta.vitest': 'undefined',
},
});

0 comments on commit 498a9da

Please sign in to comment.