Skip to content

Commit 2f5e371

Browse files
authored
chore: run tsc properly (#8884)
Runs type check as part of the CI. This needs a new path alias in the tsconfig so that TS resolves the svelte import in the ambient file directly to the correct d.ts file and doesn't load Svelte through the node_modules, at which point it would load the generated ambient type definitions and throw a duplicate definitions error. Also removes a tgz that was accidentally added
1 parent d2ff04f commit 2f5e371

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77
contents: read # to fetch code (actions/checkout)
88

99
env:
10-
# We only install Chromium manually
10+
# We only install Chromium manually
1111
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
1212

1313
jobs:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "pnpm -r --filter=./packages/* build",
1010
"build:sites": "pnpm -r --filter=./sites/* build",
1111
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
12-
"lint": "pnpm -r lint",
12+
"lint": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r lint",
1313
"format": "pnpm -r format",
1414
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
1515
"changeset:publish": "changeset publish"

packages/svelte/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@
7474
"types": "types/index.d.ts",
7575
"scripts": {
7676
"format": "prettier . --cache --plugin-search-dir=. --write",
77-
"check": "prettier . --cache --plugin-search-dir=. --check",
77+
"check": "tsc --noEmit",
7878
"test": "vitest run && echo \"manually check that there are no type errors in test/types by opening the files in there\"",
7979
"build": "rollup -c && pnpm types",
8080
"generate:version": "node ./scripts/generate-version.js",
8181
"dev": "rollup -cw",
8282
"posttest": "agadoo src/internal/index.js",
8383
"prepublishOnly": "pnpm build",
8484
"types": "node ./scripts/generate-dts.js",
85-
"lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache"
85+
"lint": "prettier . --cache --plugin-search-dir=. --check && eslint \"{src,test}/**/*.{ts,js}\" --cache"
8686
},
8787
"repository": {
8888
"type": "git",

packages/svelte/svelte-4.0.0.tgz

-586 KB
Binary file not shown.

packages/svelte/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"noImplicitThis": true,
3636
"noUnusedLocals": true,
3737
"noUnusedParameters": true,
38-
"typeRoots": ["./node_modules/@types"]
38+
"typeRoots": ["./node_modules/@types"],
39+
"paths": {
40+
"svelte": ["./src/runtime/public.d.ts"]
41+
}
3942
}
4043
}

0 commit comments

Comments
 (0)