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

[feat] extract and export types from create-svelte #7111

Merged
merged 2 commits into from
Oct 2, 2022
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/many-planes-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

[feat] extract and export types from create-svelte
7 changes: 1 addition & 6 deletions packages/create-svelte/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import fs from 'fs';
import path from 'path';
import { mkdirp, copy, dist } from './utils.js';

/**
* Create a new SvelteKit project.
*
* @param {string} cwd - Path to the directory to create
* @param {import('./types/internal').Options} options
*/
/** @type {import('./types/index').create} */
export async function create(cwd, options) {
mkdirp(cwd);

Expand Down
4 changes: 3 additions & 1 deletion packages/create-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"index.js",
"dist",
"bin.js",
"utils.js"
"utils.js",
"types"
],
"types": "types/index.d.ts",
"type": "module"
}
8 changes: 8 additions & 0 deletions packages/create-svelte/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Options } from './internal';

/**
* Create a new SvelteKit project.
* @param {string} cwd - Path to the directory to create
* @param {import('./internal').Options} options
*/
export function create(cwd: string, options: Options): Promise<void>;