create-tsdown 0.0.1 → 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 [![npm](https://img.shields.io/npm/v/tsdown.svg)](https://npmjs.com/package/tsdown) [![Unit Test](https://github.com/rolldown/tsdown/actions/workflows/tests.yml/badge.svg)](https://github.com/rolldown/tsdown/actions/workflows/tests.yml) [![JSR](https://jsr.io/badges/@sxzz/tsdown)](https://jsr.io/@sxzz/tsdown) [![tsdown-starter-stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz_small.svg)](https://stackblitz.com/github/rolldown/tsdown-starter-stackblitz)
1
+ # create-tsdown [![npm](https://img.shields.io/npm/v/create-tsdown.svg)](https://npmjs.com/package/create-tsdown) [![downloads](https://img.shields.io/npm/dm/create-tsdown.svg)](https://npmjs.com/package/create-tsdown) [![Unit Test](https://github.com/gugustinette/create-tsdown/actions/workflows/unit-test.yml/badge.svg)](https://github.com/gugustinette/create-tsdown/actions/workflows/unit-test.yml) [![tsdown-starter-stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz_small.svg)](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" | "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" | "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
- }>; //#endregion
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-DN7qLXAi.js";
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";
@@ -0,0 +1,5 @@
1
+ //#region package.json
2
+ var version = "0.0.3";
3
+
4
+ //#endregion
5
+ export { version };
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-DN7qLXAi.js";
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";
@@ -33,9 +33,11 @@ async function resolveOptions(options) {
33
33
  resolvedTemplate = options.template;
34
34
  if (![
35
35
  "default",
36
+ "minimal",
36
37
  "vue",
37
- "react"
38
- ].includes(resolvedTemplate)) throw new Error(`Invalid template "${resolvedTemplate}". Available templates: default, vue, react`);
38
+ "react",
39
+ "solid"
40
+ ].includes(resolvedTemplate)) throw new Error(`Invalid template "${resolvedTemplate}". Available templates: default, vue, react, solid`);
39
41
  } else resolvedTemplate = await select({
40
42
  message: "Which template do you want to use?",
41
43
  options: [
@@ -43,6 +45,10 @@ async function resolveOptions(options) {
43
45
  value: "default",
44
46
  label: "Default"
45
47
  },
48
+ {
49
+ value: "minimal",
50
+ label: "Minimal"
51
+ },
46
52
  {
47
53
  value: "vue",
48
54
  label: "Vue"
@@ -50,6 +56,10 @@ async function resolveOptions(options) {
50
56
  {
51
57
  value: "react",
52
58
  label: "React"
59
+ },
60
+ {
61
+ value: "solid",
62
+ label: "Solid"
53
63
  }
54
64
  ],
55
65
  initialValue: "default"
@@ -75,7 +85,7 @@ cli.help().version(version);
75
85
  cli.command("[...files]", "Create a tsdown project", {
76
86
  ignoreOptionDefaultValue: true,
77
87
  allowUnknownOptions: true
78
- }).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) => {
79
89
  intro(`tsdown - The Elegant Library Bundler`);
80
90
  logger.setSilent(!!options.silent);
81
91
  const resolvedOptions = await resolveOptions(options);
@@ -100,7 +110,7 @@ cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>",
100
110
  }
101
111
  const s = spinner();
102
112
  s.start("Migrating from tsup to tsdown...");
103
- const { migrate } = await import("./migrate-C-3eL652.js");
113
+ const { migrate } = await import("./migrate-PAss8O89.js");
104
114
  await migrate({
105
115
  cwd: args.cwd,
106
116
  dryRun: !!args.dryRun
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "create-tsdown",
3
- "version": "0.0.1",
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/rolldown/tsdown#readme",
7
+ "homepage": "https://github.com/Gugustinette/create-tsdown#readme",
8
8
  "bugs": {
9
- "url": "https://github.com/rolldown/tsdown/issues"
9
+ "url": "https://github.com/Gugustinette/create-tsdown/issues"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/rolldown/tsdown.git"
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",
@@ -1,5 +0,0 @@
1
- //#region package.json
2
- var version = "0.0.1";
3
-
4
- //#endregion
5
- export { version };