Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependence of create-svelte build on kit build #1001

Merged
merged 2 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();