diff --git a/.changeset/smooth-shrimps-fly.md b/.changeset/smooth-shrimps-fly.md new file mode 100644 index 000000000000..3045d1d7df39 --- /dev/null +++ b/.changeset/smooth-shrimps-fly.md @@ -0,0 +1,5 @@ +--- +'create-svelte': patch +--- + +Fix build so that the package can be automatically published diff --git a/packages/create-svelte/cli/global.d.ts b/packages/create-svelte/cli/global.d.ts index 271d59added9..68697498c761 100644 --- a/packages/create-svelte/cli/global.d.ts +++ b/packages/create-svelte/cli/global.d.ts @@ -1,6 +1,3 @@ declare module 'prompts/lib/index'; declare module '*.json'; - -// TODO make this depend on the real types from the kit package -declare module '@sveltejs/kit/filesystem'; diff --git a/packages/create-svelte/cli/index.js b/packages/create-svelte/cli/index.js index 34596ca5a53a..2467bdc62ead 100644 --- a/packages/create-svelte/cli/index.js +++ b/packages/create-svelte/cli/index.js @@ -1,7 +1,6 @@ //eslint-disable-next-line import/no-unresolved import fs from 'fs'; import path from 'path'; -import { mkdirp } from '@sveltejs/kit/filesystem'; // eslint-disable-line import { bold, cyan, gray, green, red } from 'kleur/colors'; import prompts from 'prompts/lib/index'; import { fileURLToPath } from 'url'; @@ -219,4 +218,14 @@ function sort_keys(obj) { return sorted; } +/** @param {string} dir */ +function mkdirp(dir) { + try { + fs.mkdirSync(dir, { recursive: true }); + } catch (e) { + if (e.code === 'EEXIST') return; + throw e; + } +} + main();