create-tsdown 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# create-tsdown [](https://npmjs.com/package/create-tsdown) [](https://npmjs.com/package/create-tsdown) [](https://npmjs.com/package/create-tsdown) [](https://github.com/gugustinette/create-tsdown/actions/workflows/unit-test.yml) [](https://stackblitz.com/github/rolldown/tsdown-starter-stackblitz)
|
|
2
2
|
|
|
3
3
|
**create-tsdown** is the cli tool to create a new project using [tsdown](https://tsdown.dev). It provides a simple and efficient way to set up a TypeScript project with all the necessary configurations and dependencies.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm create tsdown
|
|
8
|
+
npm create tsdown@latest
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Migrate from tsup
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx create-tsdown migrate
|
|
14
|
+
npx create-tsdown@latest migrate
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Please make sure to commit your changes before migrating. For more details, see the [Migration Guide](https://tsdown.dev/guide/migrate-from-tsup).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/utils/types.d.ts
|
|
2
2
|
type Overwrite<T, U> = Omit<T, keyof U> & U;
|
|
3
|
-
|
|
4
3
|
//#endregion
|
|
5
4
|
//#region src/options/types.d.ts
|
|
6
5
|
/**
|
|
@@ -16,7 +15,7 @@ interface Options {
|
|
|
16
15
|
* The template to use.
|
|
17
16
|
* @default 'default'
|
|
18
17
|
*/
|
|
19
|
-
template?: "default" | "minimal" | "vue" | "react";
|
|
18
|
+
template?: "default" | "minimal" | "vue" | "react" | "solid";
|
|
20
19
|
/** @default false */
|
|
21
20
|
silent?: boolean;
|
|
22
21
|
/** @default false */
|
|
@@ -32,17 +31,17 @@ type ResolvedOptions = Overwrite<Options, {
|
|
|
32
31
|
* The template to use.
|
|
33
32
|
* @default 'default'
|
|
34
33
|
*/
|
|
35
|
-
template: "default" | "minimal" | "vue" | "react";
|
|
34
|
+
template: "default" | "minimal" | "vue" | "react" | "solid";
|
|
36
35
|
/** @default false */
|
|
37
36
|
silent: boolean;
|
|
38
37
|
/** @default false */
|
|
39
38
|
debug: boolean;
|
|
40
|
-
}>;
|
|
39
|
+
}>;
|
|
40
|
+
//#endregion
|
|
41
41
|
//#region src/index.d.ts
|
|
42
42
|
/**
|
|
43
43
|
* Create a tsdown project.
|
|
44
44
|
*/
|
|
45
45
|
declare function create(options: ResolvedOptions): Promise<void>;
|
|
46
|
-
|
|
47
46
|
//#endregion
|
|
48
47
|
export { create };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger } from "./logger-0-2qD2tL.js";
|
|
2
|
-
import { version } from "./package-
|
|
2
|
+
import { version } from "./package-2m3xQSHC.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { readFile, unlink, writeFile } from "node:fs/promises";
|
package/dist/run.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { logger, resolveComma, toArray } from "./logger-0-2qD2tL.js";
|
|
3
|
-
import { version } from "./package-
|
|
3
|
+
import { version } from "./package-2m3xQSHC.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import { green, underline } from "ansis";
|
|
6
6
|
import process$1 from "node:process";
|
|
@@ -35,8 +35,9 @@ async function resolveOptions(options) {
|
|
|
35
35
|
"default",
|
|
36
36
|
"minimal",
|
|
37
37
|
"vue",
|
|
38
|
-
"react"
|
|
39
|
-
|
|
38
|
+
"react",
|
|
39
|
+
"solid"
|
|
40
|
+
].includes(resolvedTemplate)) throw new Error(`Invalid template "${resolvedTemplate}". Available templates: default, vue, react, solid`);
|
|
40
41
|
} else resolvedTemplate = await select({
|
|
41
42
|
message: "Which template do you want to use?",
|
|
42
43
|
options: [
|
|
@@ -55,6 +56,10 @@ async function resolveOptions(options) {
|
|
|
55
56
|
{
|
|
56
57
|
value: "react",
|
|
57
58
|
label: "React"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "solid",
|
|
62
|
+
label: "Solid"
|
|
58
63
|
}
|
|
59
64
|
],
|
|
60
65
|
initialValue: "default"
|
|
@@ -80,7 +85,7 @@ cli.help().version(version);
|
|
|
80
85
|
cli.command("[...files]", "Create a tsdown project", {
|
|
81
86
|
ignoreOptionDefaultValue: true,
|
|
82
87
|
allowUnknownOptions: true
|
|
83
|
-
}).option("-n, --name <name>", "Name of the package to create", { default: "./my-package" }).option("-t, --template <template>", "Available templates: default, vue, react", { default: "default" }).option("--debug", "Show debug logs").option("--silent", "Suppress non-error logs").action(async (input, options) => {
|
|
88
|
+
}).option("-n, --name <name>", "Name of the package to create", { default: "./my-package" }).option("-t, --template <template>", "Available templates: default, vue, react, solid", { default: "default" }).option("--debug", "Show debug logs").option("--silent", "Suppress non-error logs").action(async (input, options) => {
|
|
84
89
|
intro(`tsdown - The Elegant Library Bundler`);
|
|
85
90
|
logger.setSilent(!!options.silent);
|
|
86
91
|
const resolvedOptions = await resolveOptions(options);
|
|
@@ -105,7 +110,7 @@ cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>",
|
|
|
105
110
|
}
|
|
106
111
|
const s = spinner();
|
|
107
112
|
s.start("Migrating from tsup to tsdown...");
|
|
108
|
-
const { migrate } = await import("./migrate-
|
|
113
|
+
const { migrate } = await import("./migrate-PAss8O89.js");
|
|
109
114
|
await migrate({
|
|
110
115
|
cwd: args.cwd,
|
|
111
116
|
dryRun: !!args.dryRun
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-tsdown",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "The Elegant Bundler for Libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://github.com/
|
|
7
|
+
"homepage": "https://github.com/Gugustinette/create-tsdown#readme",
|
|
8
8
|
"bugs": {
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/Gugustinette/create-tsdown/issues"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
13
|
+
"url": "git+https://github.com/Gugustinette/create-tsdown.git"
|
|
14
14
|
},
|
|
15
15
|
"author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>",
|
|
16
16
|
"funding": "https://github.com/sponsors/sxzz",
|