Skip to content

Commit

Permalink
Fix synthetic types (#7864)
Browse files Browse the repository at this point in the history
* oops

* changeset
  • Loading branch information
Rich-Harris committed Nov 28, 2022
1 parent b20bc4a commit 612e3da
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-spiders-type.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Co-locate synthetic types with other Kit types
4 changes: 1 addition & 3 deletions packages/kit/src/core/sync/write_ambient.js
Expand Up @@ -8,9 +8,7 @@ import { fileURLToPath } from 'url';

// TODO these types should be described in a neutral place, rather than
// inside either `packages/kit` or `kit.svelte.dev`
const descriptions_dir = fileURLToPath(
new URL('../../../../../sites/kit.svelte.dev/scripts/types/special-types', import.meta.url)
);
const descriptions_dir = fileURLToPath(new URL('../../../types/synthetic', import.meta.url));

/** @param {string} filename */
function read_description(filename) {
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion sites/kit.svelte.dev/scripts/types/index.js
Expand Up @@ -229,7 +229,9 @@ function read_d_ts_file(file) {
});
}

const dir = fileURLToPath(new URL('./special-types', import.meta.url).href);
const dir = fileURLToPath(
new URL('../../../../packages/kit/types/synthetic', import.meta.url).href
);
for (const file of fs.readdirSync(dir)) {
if (!file.endsWith('.md')) continue;

Expand Down

0 comments on commit 612e3da

Please sign in to comment.