create-dev-to 1.5.2 → 1.6.1

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
@@ -78,7 +78,7 @@ bunx create-dev-to
78
78
  - **JavaScript** - 使用 JavaScript 的 React 项目
79
79
  - **JavaScript + SWC** - 使用 SWC 编译的 JavaScript React 项目
80
80
 
81
- 创建完成后会自动在 `vite.config.*` 中注入 `@dev-to/react-plugin`(`devToReactPlugin()`)。
81
+ 创建完成后会自动在 `vite.config.*` 中注入 `@dev-to/react-plugin`(`devToReactPlugin()`),并在 `package.json` 中加入 `build:lib`(`dev-to build`,等价于 `vite build --mode lib`)。
82
82
 
83
83
  ## 安装进度展示
84
84
 
package/dist/index.js CHANGED
@@ -14,10 +14,10 @@ import { InstallLogger } from "./installLogger.js";
14
14
  import { displayInstallSummary } from "./visualComponents.js";
15
15
  const PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"];
16
16
  const __BUILD_INFO__ = {
17
- commit: "d6a7395",
17
+ commit: "b15ce4b",
18
18
  branch: "main",
19
- buildTime: "2026-01-16 01:14",
20
- version: "1.5.2"
19
+ buildTime: "2026-01-16 06:56",
20
+ version: "1.6.1"
21
21
  };
22
22
  const FRAMEWORKS = [
23
23
  {
@@ -866,6 +866,10 @@ For now, please use React or stay tuned for updates!`,
866
866
  const pkgPath = path.join(root, "package.json");
867
867
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
868
868
  pkg.name = toValidPackageName(getProjectName());
869
+ pkg.scripts = pkg.scripts ?? {};
870
+ if (!pkg.scripts["build:lib"]) {
871
+ pkg.scripts["build:lib"] = "dev-to build";
872
+ }
869
873
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
870
874
  const isTs = template.includes("ts");
871
875
  if (isReactSwc) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dev-to",
3
- "version": "1.5.2",
3
+ "version": "1.6.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {