Skip to content

Commit

Permalink
[fix] remove obsolete generated types correctly (#8149)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Dec 14, 2022
1 parent 7468f1a commit 491f665
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-files-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[fix] remove obsolete generated types correctly
2 changes: 1 addition & 1 deletion packages/kit/src/core/sync/write_types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function write_all_types(config, manifest_data) {
for (const file of walk(types_dir)) {
const dir = path.dirname(file);
if (!expected_directories.has(dir)) {
rimraf(file);
rimraf(path.join(types_dir, file));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/kit/src/utils/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export function copy(source, target, opts = {}) {
* Get a list of all files in a directory
* @param {string} cwd - the directory to walk
* @param {boolean} [dirs] - whether to include directories in the result
* @returns {string[]} a list of all found files (and possibly directories) relative to `cwd`
*/
export function walk(cwd, dirs = false) {
/** @type {string[]} */
Expand Down
1 change: 1 addition & 0 deletions packages/kit/test/prerendering/ssr-false/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && tsc && svelte-check",
"test": "svelte-kit sync && pnpm build && uvu test"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const actions = {};
export const actions = {
default: () => {}
};

0 comments on commit 491f665

Please sign in to comment.