Skip to content

Commit

Permalink
upgrade to TypeScript 4.5 (#3809)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Feb 10, 2022
1 parent 9dd1793 commit 21bfbc6
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 59 deletions.
6 changes: 6 additions & 0 deletions .changeset/seven-ads-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'create-svelte': patch
'@sveltejs/kit': patch
---

upgrade to TypeScript 4.5
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"playwright-chromium": "^1.17.0",
"prettier": "^2.5.0",
"rollup": "^2.60.2",
"typescript": "~4.4.4"
"typescript": "~4.5.5"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/create-svelte/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@sveltejs/kit": "workspace:*",
"svelte": "^3.44.0",
"svelte-preprocess": "^4.9.8",
"typescript": "^4.4.3"
"typescript": "~4.5.5"
},
"type": "module",
"dependencies": {
Expand Down
18 changes: 10 additions & 8 deletions packages/kit/src/packaging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ export async function make_package(config, cwd = process.cwd()) {
const svelte_ext = config.extensions.find((ext) => file.endsWith(ext)); // unlike `ext`, could be e.g. `.svelte.md`

if (!config.kit.package.files(normalized)) {
const dts_file = (svelte_ext ? file : file.slice(0, -ext.length)) + '.d.ts';
const dts_path = path.join(package_dir, dts_file);
if (fs.existsSync(dts_path)) {
fs.unlinkSync(dts_path);

const dir = path.dirname(dts_path);
if (fs.readdirSync(dir).length === 0) {
fs.rmdirSync(dir);
const base = svelte_ext ? file : file.slice(0, -ext.length);
for (const e of ['.d.ts', '.d.mts', '.d.cts']) {
const dts_path = path.join(package_dir, base + e);
if (fs.existsSync(dts_path)) {
fs.unlinkSync(dts_path);

const dir = path.dirname(dts_path);
if (fs.readdirSync(dir).length === 0) {
fs.rmdirSync(dir);
}
}
}
continue;
Expand Down
111 changes: 63 additions & 48 deletions pnpm-lock.yaml

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

Loading

0 comments on commit 21bfbc6

Please sign in to comment.