Skip to content

Commit

Permalink
remove dependence of create-svelte build on kit build (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry authored Apr 13, 2021
1 parent 791b994 commit 3802c64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-shrimps-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Fix build so that the package can be automatically published
3 changes: 0 additions & 3 deletions packages/create-svelte/cli/global.d.ts
Original file line number Diff line number Diff line change
@@ -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';
11 changes: 10 additions & 1 deletion packages/create-svelte/cli/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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();

0 comments on commit 3802c64

Please sign in to comment.