@4399ywkf/cli 0.0.7 → 0.0.10

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,28 +1,180 @@
1
- # 学习搭建cli脚手架
1
+ # YWKF CLI
2
2
 
3
- ## 安装
3
+ 🚀 运维开发部脚手架工具 - 快速创建现代化前端项目
4
+
5
+ ## ✨ 特性
6
+
7
+ - 🏗️ **多架构支持** - 微前端架构和独立应用架构
8
+ - ⚡ **多种构建工具** - 支持 Webpack 和 Vite
9
+ - 🎯 **智能模板选择** - 根据架构和工具类型智能推荐模板
10
+ - 🛠️ **自动化配置** - Webpack 子应用自动配置环境变量
11
+ - 🎨 **美观界面** - 彩色输出和进度指示器
12
+ - 📦 **开箱即用** - 内置最佳实践和常用配置
13
+
14
+ ## 📦 安装
15
+
16
+ ### 全局安装(推荐)
4
17
 
5
- ### 全局安装
6
18
  ```bash
7
19
  pnpm install -g @4399ywkf/cli
8
20
  ```
9
21
 
10
- ### 使用
11
- 创建模版
22
+ ### 使用 npx(无需安装)
23
+
24
+ ```bash
25
+ npx @4399ywkf/cli create <项目名称>
26
+ ```
27
+
28
+ ## 🎯 使用方法
29
+
30
+ ### 基本用法
31
+
32
+ ```bash
33
+ # 交互式创建项目
34
+ ywkf-cli create my-project
35
+
36
+ # 指定模板创建项目
37
+ ywkf-cli create my-project -t webpack-mainApplicate_demo
38
+ ```
39
+
40
+ ### 命令参数
41
+
42
+ ```bash
43
+ ywkf-cli create [项目名称] [选项]
44
+ ```
45
+
46
+ **选项:**
47
+
48
+ - `-t, --template <模板名称>` - 指定要使用的模板
49
+ - `-h, --help` - 显示帮助信息
50
+ - `-V, --version` - 显示版本号
51
+
52
+ ## 🏗️ 支持的架构
53
+
54
+ ### 微前端架构
55
+
56
+ 适用于大型应用的微前端解决方案,支持主应用和子应用:
57
+
58
+ #### Webpack 模板
59
+
60
+ - **主应用**: `webpack-mainApplicate_demo` - 微前端主应用模板
61
+ - **子应用**: `webpack-subApplicate_demo` - 微前端子应用模板
62
+
63
+ #### Vite 模板
64
+
65
+ - **主应用**: `vite-mainApplicate_demo` - 基于 Vite 的微前端主应用
66
+ - **子应用**: `vite-subApplicate_demo` - 基于 Vite 的微前端子应用
67
+
68
+ ### 独立应用架构
69
+
70
+ 适用于中小型项目的单体应用:
71
+
72
+ #### Next.js 模板
73
+
74
+ - **Next.js**: `next-demo` - React 全栈框架模板
75
+
76
+ ## 📋 使用示例
77
+
78
+ ### 创建微前端主应用
79
+
80
+ ```bash
81
+ # 使用 Webpack
82
+ ywkf-cli create main-app -t webpack-mainApplicate_demo
83
+
84
+ # 使用 Vite
85
+ ywkf-cli create main-app -t vite-mainApplicate_demo
86
+ ```
87
+
88
+ ### 创建微前端子应用
89
+
12
90
  ```bash
13
- @4399ywkf/cli create <name> [-t|--template]
91
+ # 使用 Webpack
92
+ ywkf-cli create sub-app -t webpack-subApplicate_demo
93
+
94
+ # 使用 Vite
95
+ ywkf-cli create sub-app -t vite-subApplicate_demo
14
96
  ```
15
- 示例
97
+
98
+ ### 创建独立应用
99
+
16
100
  ```bash
17
- @4399ywkf/cli create hello-cli -t dumi2-demo
101
+ # Next.js 应用
102
+ ywkf-cli create my-nextjs-app -t next-demo
18
103
  ```
19
104
 
20
- ### 不全局安装,借助npx
21
- 创建模版
105
+ ## ⚙️ 特殊功能
106
+
107
+ ### Webpack 子应用自动配置
108
+
109
+ 当创建 Webpack 子应用时,CLI 会自动帮你配置环境变量:
110
+
111
+ - **应用代码名称** (APP_NAME) - 应用的唯一标识符
112
+ - **应用名称** (APP_CNAME) - 应用的显示名称
113
+ - **Sentry 配置** - 错误监控配置
114
+ - **构建配置** - 输出路径和公共路径
115
+
116
+ ### 交互式选择流程
117
+
118
+ 1. 🏗️ **选择架构类型** - 微前端 or 独立应用
119
+ 2. 🔧 **选择构建工具** - Webpack or Vite
120
+ 3. 🎯 **选择应用类型** - 主应用 or 子应用
121
+ 4. 📋 **选择模板** - 根据前面的选择显示可用模板
122
+ 5. ⚙️ **配置环境** - 自动配置应用参数
123
+
124
+ ## 🚀 快速开始
125
+
126
+ 创建项目后,按照以下步骤启动开发:
127
+
22
128
  ```bash
23
- npx @4399ywkf/cli create <name> [-t|--template]
129
+ # 1. 进入项目目录
130
+ cd your-project-name
131
+
132
+ # 2. 切换到推荐的 Node.js 版本
133
+ nvm use
134
+
135
+ # 3. 安装依赖
136
+ pnpm install
137
+
138
+ # 4. 启动开发服务器
139
+ pnpm start
24
140
  ```
25
- 示例
141
+
142
+ ## 🛠️ 开发调试
143
+
144
+ 对于 CLI 工具的开发和调试,可以使用以下命令:
145
+
26
146
  ```bash
27
- npx @4399ywkf/cli create hello-cli -template dumi2-demo
147
+ # 开发模式运行
148
+ pnpm dev
149
+
150
+ # 调试模式
151
+ pnpm debug
152
+
153
+ # 调试创建命令
154
+ pnpm debug:create
155
+
156
+ # 调试帮助命令
157
+ pnpm debug:help
28
158
  ```
159
+
160
+ ## 📝 版本信息
161
+
162
+ 当前版本: `v0.0.8`
163
+
164
+ 查看版本信息:
165
+
166
+ ```bash
167
+ ywkf-cli --version
168
+ ```
169
+
170
+ ## 🤝 贡献
171
+
172
+ 欢迎提交 Issue 和 Pull Request 来帮助改进这个工具!
173
+
174
+ ## 📄 许可证
175
+
176
+ ISC License
177
+
178
+ ---
179
+
180
+ 🎉 **开始你的开发之旅吧!**
@@ -1,5 +1,13 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('https');
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
1
9
  // bin/api.js
2
- const https = require('https')
10
+ const https = require$$0;
3
11
 
4
12
  /** 获取用户git仓库列表信息 */
5
13
  function getGitReposList(username) {
@@ -9,24 +17,28 @@ function getGitReposList(username) {
9
17
  'User-Agent': username
10
18
  }
11
19
  }, (res) => {
12
- let data = ''
20
+ let data = '';
13
21
  res.on('data', (chunk) => {
14
- data += chunk.toString()
15
- })
22
+ data += chunk.toString();
23
+ });
16
24
  res.on('end', () => {
17
- const list = JSON.parse(data)
25
+ const list = JSON.parse(data);
18
26
  resolve(list.map(item => ({ // 组合成模版所需要的name,value结构
19
27
  name: item.name,
20
28
  value: `https://github.com:${username}/${item.name}`
21
- })))
22
- })
29
+ })));
30
+ });
23
31
  res.on('error', (err) => {
24
- reject(err)
25
- })
26
- }).end()
32
+ reject(err);
33
+ });
34
+ }).end();
27
35
  })
28
36
  }
29
37
 
30
- module.exports = {
38
+ var api = {
31
39
  getGitReposList
32
- }
40
+ };
41
+
42
+ var api$1 = /*@__PURE__*/getDefaultExportFromCjs(api);
43
+
44
+ module.exports = api$1;
@@ -1,19 +1,34 @@
1
1
  #!/usr/bin/env node
2
- const program = require("commander");
3
- const inquirer = require("inquirer");
4
- const path = require("path");
5
- const ora = require("ora");
6
- const fs = require("fs-extra");
7
- const { exec } = require("child_process");
2
+ #!/usr/bin/env node
3
+ 'use strict';
4
+
5
+ var require$$0 = require('commander');
6
+ var require$$1 = require('inquirer');
7
+ var require$$2 = require('path');
8
+ var require$$3 = require('ora');
9
+ var require$$4 = require('fs-extra');
10
+ var require$$5 = require('child_process');
11
+ var require$$7 = require('chalk');
12
+ var require$$8 = require('boxen');
13
+ var require$$9 = require('figlet');
14
+ require('https');
15
+
16
+ var cli = {};
17
+
18
+ const program = require$$0;
19
+ const inquirer = require$$1;
20
+ const path = require$$2;
21
+ const ora = require$$3;
22
+ const fs = require$$4;
23
+ const { exec } = require$$5;
8
24
 
9
25
  // 美化输出相关
10
- const chalk = require("chalk");
11
- const boxen = require("boxen");
12
- const figlet = require("figlet");
13
-
14
- // const templates = require("./templates.js")
15
- const { getGitReposList } = require("./api.js");
16
- const package = require("../package.json");
26
+ const chalk = require$$7;
27
+ const boxen = require$$8;
28
+ const figlet = require$$9;
29
+ const pkgInfo = {
30
+ version: "0.0.10",
31
+ };
17
32
 
18
33
  // 美化输出函数
19
34
  function printBanner() {
@@ -26,7 +41,7 @@ function printBanner() {
26
41
  })
27
42
  )
28
43
  );
29
- console.log(chalk.gray(`版本: ${package.version}\n`));
44
+ console.log(chalk.gray(`版本: ${pkgInfo.version}\n`));
30
45
  }
31
46
 
32
47
  function printSuccess(message) {
@@ -75,10 +90,24 @@ function printFinalInstructions(projectName) {
75
90
 
76
91
  function cloneRepository(repoUrl, destination) {
77
92
  return new Promise((resolve, reject) => {
78
- const command = `git clone ${repoUrl} ${destination}`;
79
- exec(command, (error, stdout, stderr) => {
93
+ // 确保URL格式正确,移除可能的末尾斜杠
94
+ const cleanUrl = repoUrl.replace(/\/$/, "");
95
+ const command = `git clone ${cleanUrl} ${destination}`;
96
+
97
+ // 设置子进程选项
98
+ const options = {
99
+ cwd: process.cwd(),
100
+ env: process.env,
101
+ stdio: "pipe",
102
+ };
103
+
104
+ exec(command, options, (error, stdout, stderr) => {
80
105
  if (error) {
81
- reject(`Error cloning repository: ${stderr}`);
106
+ console.error(`命令执行失败: ${command}`);
107
+ console.error(`错误代码: ${error.code}`);
108
+ console.error(`错误信息: ${error.message}`);
109
+ console.error(`stderr: ${stderr}`);
110
+ reject(`Error cloning repository: ${stderr || error.message}`);
82
111
  } else {
83
112
  resolve(`Repository cloned successfully: ${stdout}`);
84
113
  }
@@ -243,38 +272,7 @@ program
243
272
  getRepoLoading.start();
244
273
 
245
274
  // 模拟异步获取模版数据
246
- const templates = {
247
- webpack: {
248
- main: [
249
- {
250
- value:
251
- "https://ywgit.gz4399.com/ywkf/webpack-mainApplicate_demo.git",
252
- name: "webpack-mainApplicate_demo",
253
- },
254
- ],
255
- sub: [
256
- {
257
- value:
258
- "https://ywgit.gz4399.com/ywkf/webpack-subApplicate_demo.git",
259
- name: "webpack-subApplicate_demo",
260
- },
261
- ],
262
- },
263
- vite: {
264
- main: [
265
- {
266
- value: "https://ywgit.gz4399.com/ywkf/vite-mainApplicate_demo.git",
267
- name: "vite-mainApplicate_demo",
268
- },
269
- ],
270
- sub: [
271
- {
272
- value: "https://ywgit.gz4399.com/ywkf/vite-subApplicate_demo",
273
- name: "vite-subApplicate_demo",
274
- },
275
- ],
276
- },
277
- };
275
+ const templates = templates;
278
276
 
279
277
  getRepoLoading.succeed();
280
278
  printSuccess("模版列表获取成功!");
@@ -297,68 +295,154 @@ program
297
295
  }
298
296
  printInfo(`项目名称:${chalk.bold(projectName)}`);
299
297
 
300
- // 2. 选择工具类型
301
- const { toolType } = await inquirer.prompt({
298
+ // 2. 选择架构类型
299
+ const { architectureType } = await inquirer.prompt({
302
300
  type: "list",
303
- name: "toolType",
304
- message: chalk.cyan("🔧 请选择工具类型:"),
301
+ name: "architectureType",
302
+ message: chalk.cyan("🏗️ 请选择架构类型:"),
305
303
  choices: [
306
304
  {
307
- name: `${chalk.blue("📦 Webpack")} - 成熟稳定的打包工具`,
308
- value: "webpack",
305
+ name: `${chalk.blue("🧩 微前端架构")} - 支持主应用和子应用`,
306
+ value: "microFrontend",
307
+ },
308
+ {
309
+ name: `${chalk.green("📱 独立应用")} - 单体应用架构`,
310
+ value: "standalone",
309
311
  },
310
- { name: `${chalk.green("⚡ Vite")} - 快速的构建工具`, value: "vite" },
311
- ],
312
- });
313
- printInfo(`工具类型:${chalk.bold(toolType)}`);
314
-
315
- // 3. 选择应用方向
316
- const { appDirection } = await inquirer.prompt({
317
- type: "list",
318
- name: "appDirection",
319
- message: chalk.cyan("🎯 请选择应用方向:"),
320
- choices: [
321
- { name: `${chalk.magenta("🏠 主应用")} - 微前端主应用`, value: "main" },
322
- { name: `${chalk.yellow("🧩 子应用")} - 微前端子应用`, value: "sub" },
323
312
  ],
324
313
  });
325
314
  printInfo(
326
- `应用方向:${chalk.bold(appDirection === "main" ? "主应用" : "子应用")}`
315
+ `架构类型:${chalk.bold(
316
+ architectureType === "microFrontend" ? "微前端架构" : "独立应用"
317
+ )}`
327
318
  );
328
319
 
329
- // 4. 选择模版
330
320
  let projectTemplate;
331
-
332
- if (options.template) {
333
- const foundTemplate = templates[toolType][appDirection].find(
334
- (template) => template.name === options.template
321
+ let toolType, appDirection;
322
+
323
+ if (architectureType === "microFrontend") {
324
+ // 微前端架构流程
325
+ // 3. 选择工具类型
326
+ const toolTypeResult = await inquirer.prompt({
327
+ type: "list",
328
+ name: "toolType",
329
+ message: chalk.cyan("🔧 请选择工具类型:"),
330
+ choices: [
331
+ {
332
+ name: `${chalk.blue("📦 Webpack")} - 成熟稳定的打包工具`,
333
+ value: "webpack",
334
+ },
335
+ { name: `${chalk.green("⚡ Vite")} - 快速的构建工具`, value: "vite" },
336
+ ],
337
+ });
338
+ toolType = toolTypeResult.toolType;
339
+ printInfo(`工具类型:${chalk.bold(toolType)}`);
340
+
341
+ // 4. 选择应用方向
342
+ const appDirectionResult = await inquirer.prompt({
343
+ type: "list",
344
+ name: "appDirection",
345
+ message: chalk.cyan("🎯 请选择应用方向:"),
346
+ choices: [
347
+ {
348
+ name: `${chalk.magenta("🏠 主应用")} - 微前端主应用`,
349
+ value: "main",
350
+ },
351
+ { name: `${chalk.yellow("🧩 子应用")} - 微前端子应用`, value: "sub" },
352
+ ],
353
+ });
354
+ appDirection = appDirectionResult.appDirection;
355
+ printInfo(
356
+ `应用方向:${chalk.bold(appDirection === "main" ? "主应用" : "子应用")}`
335
357
  );
336
- if (foundTemplate) {
337
- projectTemplate = foundTemplate.value;
338
- printSuccess(`使用指定模版:${chalk.bold(options.template)}`);
339
- } else {
340
- printWarning(`未找到指定模版 "${options.template}",请重新选择`);
358
+
359
+ // 5. 选择模版
360
+ if (options.template) {
361
+ const foundTemplate = templates.microFrontend[toolType][
362
+ appDirection
363
+ ].find((template) => template.name === options.template);
364
+ if (foundTemplate) {
365
+ projectTemplate = foundTemplate.value;
366
+ printSuccess(`使用指定模版:${chalk.bold(options.template)}`);
367
+ } else {
368
+ printWarning(`未找到指定模版 "${options.template}",请重新选择`);
369
+ }
341
370
  }
342
- }
343
371
 
344
- if (!projectTemplate) {
345
- const availableTemplates = templates[toolType][appDirection];
372
+ if (!projectTemplate) {
373
+ const availableTemplates =
374
+ templates.microFrontend[toolType][appDirection];
375
+
376
+ // 如果只有一个模版,直接使用它
377
+ if (availableTemplates.length === 1) {
378
+ projectTemplate = availableTemplates[0].value;
379
+ } else {
380
+ // 多个模版时让用户选择
381
+ const { template } = await inquirer.prompt({
382
+ type: "list",
383
+ name: "template",
384
+ message: chalk.cyan("📋 请选择模版:"),
385
+ choices: availableTemplates.map((t) => ({
386
+ name: `${chalk.white(t.name)}`,
387
+ value: t.value,
388
+ })),
389
+ });
390
+ projectTemplate = template;
391
+ }
392
+ }
393
+ } else {
394
+ // 独立应用架构流程
395
+ // 3. 选择框架类型
396
+ const { frameworkType } = await inquirer.prompt({
397
+ type: "list",
398
+ name: "frameworkType",
399
+ message: chalk.cyan("⚛️ 请选择框架类型:"),
400
+ default: "nextjs",
401
+ choices: [
402
+ {
403
+ name: `${chalk.black("▲")} ${chalk.white(
404
+ "Next.js"
405
+ )} - React 全栈框架`,
406
+ value: "nextjs",
407
+ },
408
+ // 可以在这里添加更多独立应用框架
409
+ ],
410
+ });
411
+ printInfo(`框架类型:${chalk.bold(frameworkType)}`);
412
+
413
+ // 4. 选择模版
414
+ if (options.template) {
415
+ const foundTemplate = templates.standalone[frameworkType].find(
416
+ (template) => template.name === options.template
417
+ );
418
+ if (foundTemplate) {
419
+ projectTemplate = foundTemplate.value;
420
+ printSuccess(`使用指定模版:${chalk.bold(options.template)}`);
421
+ } else {
422
+ printWarning(`未找到指定模版 "${options.template}",请重新选择`);
423
+ }
424
+ }
346
425
 
347
- // 如果只有一个模版,直接使用它
348
- if (availableTemplates.length === 1) {
349
- projectTemplate = availableTemplates[0].value;
350
- } else {
351
- // 多个模版时让用户选择
352
- const { template } = await inquirer.prompt({
353
- type: "list",
354
- name: "template",
355
- message: chalk.cyan("📋 请选择模版:"),
356
- choices: availableTemplates.map((t) => ({
357
- name: `${chalk.white(t.name)}`,
358
- value: t.value,
359
- })),
360
- });
361
- projectTemplate = template;
426
+ if (!projectTemplate) {
427
+ const availableTemplates = templates.standalone[frameworkType];
428
+
429
+ // 如果只有一个模版,直接使用它
430
+ if (availableTemplates.length === 1) {
431
+ projectTemplate = availableTemplates[0].value;
432
+ printInfo(`使用模版:${chalk.bold(availableTemplates[0].name)}`);
433
+ } else {
434
+ // 多个模版时让用户选择
435
+ const { template } = await inquirer.prompt({
436
+ type: "list",
437
+ name: "template",
438
+ message: chalk.cyan("📋 请选择模版:"),
439
+ choices: availableTemplates.map((t) => ({
440
+ name: `${chalk.white(t.name)}`,
441
+ value: t.value,
442
+ })),
443
+ });
444
+ projectTemplate = template;
445
+ }
362
446
  }
363
447
  }
364
448
 
@@ -391,7 +475,7 @@ program
391
475
  });
392
476
  loading.start();
393
477
 
394
- // 5. 开始下载模版
478
+ // 6. 开始下载模版
395
479
  try {
396
480
  const result = await cloneRepository(projectTemplate, dest);
397
481
  loading.succeed();
@@ -405,7 +489,11 @@ program
405
489
  }
406
490
 
407
491
  // 新添加:如果是 webpack 子应用,进行环境配置
408
- if (toolType === "webpack" && appDirection === "sub") {
492
+ if (
493
+ architectureType === "microFrontend" &&
494
+ toolType === "webpack" &&
495
+ appDirection === "sub"
496
+ ) {
409
497
  console.log(); // 空行
410
498
  await configureWebpackSubApp(dest, projectName);
411
499
  }
@@ -420,7 +508,7 @@ program
420
508
  });
421
509
 
422
510
  // 定义当前版本
423
- program.version(`v${package.version}`);
511
+ program.version(`v${pkgInfo.version}`);
424
512
  program.on("--help", () => {
425
513
  printBanner();
426
514
  console.log(chalk.gray("使用示例:"));
@@ -434,3 +522,5 @@ program.on("--help", () => {
434
522
  });
435
523
 
436
524
  program.parse(process.argv);
525
+
526
+ module.exports = cli;
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./cli.js');
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
7
+ /** 暴露模版代码 */
8
+
9
+ var templates = {
10
+ microFrontend: {
11
+ webpack: {
12
+ main: [
13
+ {
14
+ value: "https://ywgit.gz4399.com/ywkf/webpack-mainApplicate_demo.git",
15
+ name: "webpack-mainApplicate_demo",
16
+ },
17
+ ],
18
+ sub: [
19
+ {
20
+ value: "https://ywgit.gz4399.com/ywkf/webpack-subApplicate_demo.git",
21
+ name: "webpack-subApplicate_demo",
22
+ },
23
+ ],
24
+ },
25
+ vite: {
26
+ main: [
27
+ {
28
+ value: "https://ywgit.gz4399.com/ywkf/vite-mainApplicate_demo.git",
29
+ name: "vite-mainApplicate_demo",
30
+ },
31
+ ],
32
+ sub: [
33
+ {
34
+ value: "https://ywgit.gz4399.com/ywkf/vite-subApplicate_demo.git",
35
+ name: "vite-subApplicate_demo",
36
+ },
37
+ ],
38
+ },
39
+ },
40
+ standalone: {
41
+ nextjs: [
42
+ {
43
+ value: "https://ywgit.gz4399.com/ywkf/next-dome.git",
44
+ name: "next-demo",
45
+ },
46
+ ],
47
+ },
48
+ };
49
+
50
+ var templates$1 = /*@__PURE__*/getDefaultExportFromCjs(templates);
51
+
52
+ module.exports = templates$1;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@4399ywkf/cli",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "description": "运维开发部脚手架",
5
- "main": "index.js",
5
+ "type": "module",
6
+ "main": "dist/index.js",
6
7
  "bin": {
7
- "ywkf-cli": "./bin/cli.js"
8
+ "ywkf-cli": "./dist/cli.js"
8
9
  },
9
10
  "publishConfig": {
10
11
  "access": "public"
@@ -16,18 +17,27 @@
16
17
  "author": "",
17
18
  "license": "ISC",
18
19
  "dependencies": {
20
+ "@changesets/cli": "^2.29.5",
21
+ "boxen": "^5.1.2",
22
+ "chalk": "^4.1.2",
19
23
  "child_process": "^1.0.2",
20
24
  "commander": "^10.0.1",
21
25
  "download-git-repo": "^3.0.2",
26
+ "figlet": "^1.5.2",
22
27
  "fs-extra": "^11.1.1",
23
28
  "inquirer": "^8.2.5",
24
- "ora": "^5.4.1",
25
- "chalk": "^4.1.2",
26
- "boxen": "^5.1.2",
27
- "figlet": "^1.5.2"
29
+ "ora": "^5.4.1"
30
+ },
31
+ "devDependencies": {
32
+ "@rollup/plugin-commonjs": "^25.0.8",
33
+ "@rollup/plugin-json": "^6.1.0",
34
+ "@rollup/plugin-node-resolve": "^15.3.1",
35
+ "@rollup/plugin-replace": "^5.0.7",
36
+ "rollup": "^4.46.3",
37
+ "rollup-plugin-copy": "^3.5.0"
28
38
  },
29
39
  "files": [
30
- "bin"
40
+ "dist"
31
41
  ],
32
42
  "authors": [
33
43
  "ywjszx@4399.com"
@@ -39,7 +49,13 @@
39
49
  "debug:create": "node --inspect-brk bin/cli.js create test-project",
40
50
  "debug:create-with-template": "node --inspect-brk bin/cli.js create test-project -t webpack-mainApplicate_demo",
41
51
  "debug:help": "node --inspect-brk bin/cli.js --help",
52
+ "build": "rollup -c && node scripts/postbuild.js",
53
+ "build:watch": "rollup -c -w",
42
54
  "link": "npm link",
43
- "unlink": "npm unlink -g"
55
+ "unlink": "npm unlink -g",
56
+ "changeset": "changeset",
57
+ "changeset:version": "changeset version",
58
+ "changeset:publish": "changeset publish",
59
+ "release": "pnpm build && pnpm changeset && pnpm changeset:version && pnpm changeset:publish"
44
60
  }
45
61
  }
package/bin/templates.js DELETED
@@ -1,15 +0,0 @@
1
- /** 暴露模版代码 */
2
- module.exports = [
3
- {
4
- name: 'webpack5-react-ts',
5
- value: 'https://github.com:guojiongwei/webpack5-react-ts'
6
- },
7
- {
8
- name: 'react18-vite2-ts',
9
- value: 'https://github.com:guojiongwei/react18-vite2-ts'
10
- },
11
- {
12
- name: 'dumi2-demo',
13
- value: 'https://github.com:guojiongwei/dumi2-demo'
14
- }
15
- ]