Skip to content

Commit

Permalink
chore: run tsc properly (#8884)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dummdidumm authored Jul 3, 2023
1 parent d2ff04f commit 2f5e371
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
contents: read # to fetch code (actions/checkout)

env:
# We only install Chromium manually
# We only install Chromium manually
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "pnpm -r --filter=./packages/* build",
"build:sites": "pnpm -r --filter=./sites/* build",
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"lint": "pnpm -r lint",
"lint": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r lint",
"format": "pnpm -r format",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
"changeset:publish": "changeset publish"
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@
"types": "types/index.d.ts",
"scripts": {
"format": "prettier . --cache --plugin-search-dir=. --write",
"check": "prettier . --cache --plugin-search-dir=. --check",
"check": "tsc --noEmit",
"test": "vitest run && echo \"manually check that there are no type errors in test/types by opening the files in there\"",
"build": "rollup -c && pnpm types",
"generate:version": "node ./scripts/generate-version.js",
"dev": "rollup -cw",
"posttest": "agadoo src/internal/index.js",
"prepublishOnly": "pnpm build",
"types": "node ./scripts/generate-dts.js",
"lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache"
"lint": "prettier . --cache --plugin-search-dir=. --check && eslint \"{src,test}/**/*.{ts,js}\" --cache"
},
"repository": {
"type": "git",
Expand Down
Binary file removed packages/svelte/svelte-4.0.0.tgz
Binary file not shown.
5 changes: 4 additions & 1 deletion packages/svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"typeRoots": ["./node_modules/@types"]
"typeRoots": ["./node_modules/@types"],
"paths": {
"svelte": ["./src/runtime/public.d.ts"]
}
}
}

0 comments on commit 2f5e371

Please sign in to comment.