create-szyy-app 1.0.0

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 ADDED
@@ -0,0 +1,90 @@
1
+ # create-szyy-app
2
+
3
+ 微前端子应用脚手架 CLI,一键从 `sunyard-szyy-app-template` 生成可开发、可联调基座的新项目。
4
+
5
+ ## 使用
6
+
7
+ ```bash
8
+ # 交互式创建
9
+ npx create-szyy-app my-order-sys
10
+
11
+ # 非交互
12
+ npx create-szyy-app my-order-sys --yes --port 5690
13
+
14
+ # 精简模式(不保留 Demo 页)
15
+ npx create-szyy-app my-order-sys --yes --minimal
16
+ ```
17
+
18
+ ## 选项
19
+
20
+ | 选项 | 说明 |
21
+ | ------------------- | ---------------------------------------------------- |
22
+ | `[project-name]` | 项目名称(kebab-case,小写字母开头) |
23
+ | `-p, --port <port>` | 联调端口,写入 `.env` / `.env.micro` 等(默认 5690) |
24
+ | `--minimal` | 删除 `templateSys` Demo,仅保留首页菜单 |
25
+ | `-y, --yes` | 跳过交互,使用默认值 |
26
+
27
+ > **注意:** `pnpm dev` 独立模式端口固定 **3000**(`.env.development`),不受 `--port` 影响。`pnpm dev:micro` 使用 `--port` 配置的联调端口。
28
+
29
+ ## 生成后
30
+
31
+ ```bash
32
+ cd my-order-sys
33
+ pnpm install
34
+ pnpm dev # 独立模式,端口 3000
35
+ pnpm dev:micro # 基座联调
36
+ pnpm build:prod # 生产构建
37
+ ```
38
+
39
+ ## 环境变量
40
+
41
+ | 变量 | 说明 |
42
+ | -------------------- | --------------------------------------------------------------------------------- |
43
+ | `SZYY_TEMPLATE_REPO` | 覆盖模板 Git 仓库 URL(默认 `http://172.1.1.65/RDKit/sunyard-szyy-app-template`) |
44
+ | `SZYY_TEMPLATE_PATH` | 使用本地目录作为模板(开发/联调 CLI 时使用) |
45
+
46
+ ## 版本锁定
47
+
48
+ 依赖版本由 `templates/versions.json` 统一管理,生成项目的 `package.json` 会写死精确版本号(无 `^`)。
49
+
50
+ ## 开发 CLI
51
+
52
+ ```bash
53
+ pnpm install
54
+ pnpm build
55
+
56
+ # 使用本地模板联调
57
+ SZYY_TEMPLATE_PATH=../sunyard-szyy-app-template node dist/index.js test-app --yes
58
+ ```
59
+
60
+ ## 发布
61
+
62
+ ```bash
63
+ # 日常检查
64
+ pnpm check
65
+
66
+ # 发版(自动生成 CHANGELOG 并 bump 版本)
67
+ pnpm release:patch # 或 release:minor / release:major
68
+
69
+ # 发布前全量门禁
70
+ pnpm check:release
71
+
72
+ # 发布到 npm(默认 registry 可通过 NPM_REGISTRY 覆盖)
73
+ pnpm publish:pkg:dry # 预演
74
+ pnpm publish:pkg # 正式发布
75
+ pnpm publish:pkg --tag=beta
76
+ ```
77
+
78
+ ## 故障排查
79
+
80
+ | 问题 | 处理 |
81
+ | -------------- | ------------------------------------------------------------- |
82
+ | degit 拉取失败 | 检查内网 Git 连通性,或设置 `SZYY_TEMPLATE_PATH` 使用本地模板 |
83
+ | 占位符残留报错 | 确认模板 tag 与 `versions.json` 中 `template` 版本一致 |
84
+ | 联调端口冲突 | 创建时指定 `--port`,或修改生成项目 `.env.micro` |
85
+
86
+ ## 延伸阅读
87
+
88
+ - 模板仓 README:`sunyard-szyy-app-template`(`create-app` 分支)
89
+ - 团队接入指南:platform `docs/guide/create-app.md`
90
+ - SDK / 基座对接:[运营 AI 底座开发平台](http://172.1.4.251:5688/developers/)
package/dist/index.js ADDED
@@ -0,0 +1,432 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import fs3 from "fs";
5
+ import path4 from "path";
6
+ import { Command } from "commander";
7
+ import * as p2 from "@clack/prompts";
8
+ import pc2 from "picocolors";
9
+
10
+ // src/prompts.ts
11
+ import path2 from "path";
12
+ import * as p from "@clack/prompts";
13
+ import pc from "picocolors";
14
+
15
+ // src/replace.ts
16
+ import fs from "fs";
17
+ import path from "path";
18
+ import { fileURLToPath } from "url";
19
+ var __filename = fileURLToPath(import.meta.url);
20
+ var __dirname = path.dirname(__filename);
21
+ function loadVersions() {
22
+ const versionsPath = path.resolve(__dirname, "../templates/versions.json");
23
+ return JSON.parse(fs.readFileSync(versionsPath, "utf-8"));
24
+ }
25
+ function stripRange(version) {
26
+ return version.replace(/^[\^~>=<]+/, "");
27
+ }
28
+ function pinDependencies(targetDir, versions) {
29
+ const pkgPath = path.join(targetDir, "package.json");
30
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
31
+ for (const section of ["dependencies", "devDependencies"]) {
32
+ const deps = pkg[section];
33
+ if (!deps) continue;
34
+ for (const [name, version] of Object.entries(deps)) {
35
+ if (versions.dependencies[name]) {
36
+ deps[name] = versions.dependencies[name];
37
+ } else {
38
+ deps[name] = stripRange(version);
39
+ }
40
+ }
41
+ }
42
+ if (pkg.dependencies) {
43
+ pkg.dependencies = Object.fromEntries(Object.entries(pkg.dependencies).sort(([a], [b]) => a.localeCompare(b)));
44
+ }
45
+ fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}
46
+ `, "utf-8");
47
+ }
48
+ var SKIP_PATTERNS = ["node_modules", ".git", "dist", "dist-prod", "dist-dev", ".cache"];
49
+ var INCLUDE_EXTENSIONS = [
50
+ ".ts",
51
+ ".tsx",
52
+ ".js",
53
+ ".jsx",
54
+ ".vue",
55
+ ".json",
56
+ ".html",
57
+ ".scss",
58
+ ".css",
59
+ ".less",
60
+ ".md",
61
+ ".sh",
62
+ ".yaml",
63
+ ".yml"
64
+ ];
65
+ var INCLUDE_BASENAMES = [".env", ".env.development", ".env.production", ".env.micro", ".env.sit", ".gitignore"];
66
+ var PORT_SKIP_FILES = /* @__PURE__ */ new Set([".env.development"]);
67
+ function shouldSkip(filePath, rootDir) {
68
+ const rel = path.relative(rootDir, filePath);
69
+ return SKIP_PATTERNS.some((p3) => rel === p3 || rel.startsWith(`${p3}${path.sep}`) || rel.startsWith(`${p3}/`));
70
+ }
71
+ function shouldProcess(filePath) {
72
+ const base = path.basename(filePath);
73
+ if (INCLUDE_BASENAMES.includes(base)) return true;
74
+ const ext = path.extname(filePath);
75
+ return !!ext && INCLUDE_EXTENSIONS.includes(ext);
76
+ }
77
+ function replaceInFile(filePath, replacements) {
78
+ let content = fs.readFileSync(filePath, "utf-8");
79
+ let changed = false;
80
+ for (const [from, to] of replacements) {
81
+ if (content.includes(from)) {
82
+ content = content.split(from).join(to);
83
+ changed = true;
84
+ }
85
+ }
86
+ if (changed) fs.writeFileSync(filePath, content, "utf-8");
87
+ return changed;
88
+ }
89
+ function getReplacements(options) {
90
+ const { appName, appNameUpper, appPort, appTitle } = options;
91
+ return [
92
+ ["__APP_NAME_UPPER__", appNameUpper],
93
+ ["__APP_NAME__", appName],
94
+ ["__APP_TITLE__", appTitle],
95
+ ["__APP_PORT__", String(appPort)]
96
+ ];
97
+ }
98
+ function walkReplace(dir, rootDir, options, count) {
99
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
100
+ const fullPath = path.join(dir, entry.name);
101
+ if (shouldSkip(fullPath, rootDir)) continue;
102
+ if (entry.isDirectory()) {
103
+ walkReplace(fullPath, rootDir, options, count);
104
+ continue;
105
+ }
106
+ if (!entry.isFile() || !shouldProcess(fullPath)) continue;
107
+ const fileBase = path.basename(fullPath);
108
+ const fileReplacements = getReplacements(options).filter(([from]) => {
109
+ if (from === "__APP_PORT__" && PORT_SKIP_FILES.has(fileBase)) return false;
110
+ return true;
111
+ });
112
+ if (replaceInFile(fullPath, fileReplacements)) {
113
+ count.files++;
114
+ }
115
+ }
116
+ }
117
+ function validateNoPlaceholders(targetDir) {
118
+ const leftovers = [];
119
+ function scan(dir) {
120
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
121
+ const fullPath = path.join(dir, entry.name);
122
+ if (shouldSkip(fullPath, targetDir)) continue;
123
+ if (entry.isDirectory()) {
124
+ scan(fullPath);
125
+ } else if (entry.isFile() && shouldProcess(fullPath)) {
126
+ const content = fs.readFileSync(fullPath, "utf-8");
127
+ if (content.includes("__APP_NAME__") || content.includes("__APP_NAME_UPPER__") || content.includes("__APP_PORT__") || content.includes("__APP_TITLE__")) {
128
+ leftovers.push(path.relative(targetDir, fullPath));
129
+ }
130
+ }
131
+ }
132
+ }
133
+ scan(targetDir);
134
+ if (leftovers.length > 0) {
135
+ throw new Error(`\u5360\u4F4D\u7B26\u66FF\u6362\u4E0D\u5B8C\u6574\uFF0C\u4EE5\u4E0B\u6587\u4EF6\u4ECD\u6709\u6B8B\u7559:
136
+ ${leftovers.map((f) => ` - ${f}`).join("\n")}`);
137
+ }
138
+ }
139
+ function validateDevelopmentPort(targetDir) {
140
+ const devEnv = path.join(targetDir, ".env.development");
141
+ const content = fs.readFileSync(devEnv, "utf-8");
142
+ const match = content.match(/^\s*VITE_PORT\s*=\s*(\S+)/m);
143
+ if (!match || match[1] !== "3000") {
144
+ throw new Error(".env.development \u4E2D VITE_PORT \u5FC5\u987B\u4E3A 3000");
145
+ }
146
+ }
147
+ function applyReplacements(targetDir, options) {
148
+ const count = { files: 0 };
149
+ walkReplace(targetDir, targetDir, options, count);
150
+ validateNoPlaceholders(targetDir);
151
+ validateDevelopmentPort(targetDir);
152
+ return count.files;
153
+ }
154
+ function applyMinimalMode(targetDir, appName) {
155
+ const templateSysDir = path.join(targetDir, "src/views/templateSys");
156
+ if (fs.existsSync(templateSysDir)) {
157
+ fs.rmSync(templateSysDir, { recursive: true, force: true });
158
+ }
159
+ const menuPath = path.join(targetDir, "mock/authMenuList.ts");
160
+ fs.writeFileSync(
161
+ menuPath,
162
+ `export const authMenuList = [
163
+ {
164
+ id: 'IndexId',
165
+ parentId: 'A0000',
166
+ resourceId: 'IndexId',
167
+ resourcePath: '/index',
168
+ resourceName: '\u9996\u9875',
169
+ resourceIcon: '',
170
+ resourceDesc: '',
171
+ component: '/home/index',
172
+ isLink: 0,
173
+ isHide: 0,
174
+ isFull: 0,
175
+ isKeepAlive: 1,
176
+ sysCode: '${appName}',
177
+ activeResource: '',
178
+ query: ''
179
+ }
180
+ ];
181
+ `,
182
+ "utf-8"
183
+ );
184
+ const homePath = path.join(targetDir, "src/views/home/index.vue");
185
+ fs.writeFileSync(
186
+ homePath,
187
+ `<template>
188
+ <div class="welcome">
189
+ <h1>\u6B22\u8FCE\u4F7F\u7528 ${appName}</h1>
190
+ <p>\u5FAE\u524D\u7AEF\u5B50\u5E94\u7528\u5DF2\u5C31\u7EEA\uFF0C\u8BF7\u5F00\u59CB\u5F00\u53D1\u3002</p>
191
+ </div>
192
+ </template>
193
+
194
+ <script setup lang="ts"></script>
195
+
196
+ <style scoped lang="scss">
197
+ .welcome {
198
+ padding: 24px;
199
+ }
200
+ </style>
201
+ `,
202
+ "utf-8"
203
+ );
204
+ }
205
+ function removeGitDir(targetDir) {
206
+ const gitDir = path.join(targetDir, ".git");
207
+ if (fs.existsSync(gitDir)) {
208
+ fs.rmSync(gitDir, { recursive: true, force: true });
209
+ }
210
+ }
211
+
212
+ // src/validate.ts
213
+ function validateName(name) {
214
+ if (!name) return "\u9879\u76EE\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";
215
+ if (!/^[a-z][a-z0-9-_]*$/.test(name)) {
216
+ return "\u9879\u76EE\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u8FDE\u5B57\u7B26(-)\u6216\u4E0B\u5212\u7EBF(_)\uFF0C\u4E14\u4EE5\u5B57\u6BCD\u5F00\u5934";
217
+ }
218
+ return null;
219
+ }
220
+ function validatePort(port) {
221
+ const n = Number(port);
222
+ if (!port || isNaN(n) || !Number.isInteger(n) || n < 1024 || n > 65535) {
223
+ return "\u7AEF\u53E3\u53F7\u5FC5\u987B\u662F 1024 ~ 65535 \u4E4B\u95F4\u7684\u6574\u6570";
224
+ }
225
+ return null;
226
+ }
227
+ function toAppTitle(name) {
228
+ return name.split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
229
+ }
230
+ function toAppNameUpper(name) {
231
+ return name.replace(/[-_]/g, "").toUpperCase();
232
+ }
233
+
234
+ // src/prompts.ts
235
+ async function collectOptions(projectNameArg, flags) {
236
+ const versions = loadVersions();
237
+ const cwd = process.cwd();
238
+ p.intro(`${pc.bgCyan(pc.black(" create-szyy-app "))} \u5FAE\u524D\u7AEF\u5B50\u5E94\u7528\u811A\u624B\u67B6`);
239
+ let appName = projectNameArg?.trim() || "";
240
+ if (!flags.yes || !appName) {
241
+ const nameResult = await p.text({
242
+ message: "\u9879\u76EE\u540D\u79F0",
243
+ placeholder: "my-order-sys",
244
+ initialValue: appName || void 0,
245
+ validate: (value) => validateName(value?.trim() || "") ?? void 0
246
+ });
247
+ if (p.isCancel(nameResult)) {
248
+ p.cancel("\u5DF2\u53D6\u6D88");
249
+ return null;
250
+ }
251
+ appName = nameResult.trim();
252
+ } else {
253
+ const nameError = validateName(appName);
254
+ if (nameError) {
255
+ p.log.error(nameError);
256
+ return null;
257
+ }
258
+ }
259
+ let appPort = flags.port ?? versions.defaultPort;
260
+ if (!flags.yes || flags.port === void 0) {
261
+ const portResult = await p.text({
262
+ message: "\u672C\u5730\u8054\u8C03\u7AEF\u53E3",
263
+ placeholder: String(versions.defaultPort),
264
+ initialValue: String(appPort),
265
+ validate: (value) => {
266
+ const port = value?.trim() || String(versions.defaultPort);
267
+ return validatePort(port) ?? void 0;
268
+ }
269
+ });
270
+ if (p.isCancel(portResult)) {
271
+ p.cancel("\u5DF2\u53D6\u6D88");
272
+ return null;
273
+ }
274
+ appPort = Number(portResult.trim() || versions.defaultPort);
275
+ } else {
276
+ const portError = validatePort(appPort);
277
+ if (portError) {
278
+ p.log.error(portError);
279
+ return null;
280
+ }
281
+ }
282
+ let keepDemo = !flags.minimal;
283
+ if (!flags.yes && flags.minimal === void 0) {
284
+ const demoResult = await p.confirm({
285
+ message: "\u662F\u5426\u4FDD\u7559 Demo \u9875",
286
+ initialValue: true
287
+ });
288
+ if (p.isCancel(demoResult)) {
289
+ p.cancel("\u5DF2\u53D6\u6D88");
290
+ return null;
291
+ }
292
+ keepDemo = demoResult;
293
+ }
294
+ const defaultTarget = path2.resolve(cwd, appName);
295
+ let targetDir = defaultTarget;
296
+ if (!flags.yes) {
297
+ const dirResult = await p.text({
298
+ message: "\u76EE\u6807\u76EE\u5F55",
299
+ initialValue: defaultTarget,
300
+ validate: (value) => {
301
+ if (!value?.trim()) return "\u76EE\u6807\u76EE\u5F55\u4E0D\u80FD\u4E3A\u7A7A";
302
+ return void 0;
303
+ }
304
+ });
305
+ if (p.isCancel(dirResult)) {
306
+ p.cancel("\u5DF2\u53D6\u6D88");
307
+ return null;
308
+ }
309
+ targetDir = path2.resolve(dirResult.trim());
310
+ }
311
+ return {
312
+ appName,
313
+ appNameUpper: toAppNameUpper(appName),
314
+ appTitle: toAppTitle(appName),
315
+ appPort,
316
+ targetDir,
317
+ keepDemo
318
+ };
319
+ }
320
+
321
+ // src/template.ts
322
+ import fs2 from "fs";
323
+ import path3 from "path";
324
+ import degit from "degit";
325
+ async function fetchTemplate(targetDir, versions) {
326
+ const localPath = process.env.SZYY_TEMPLATE_PATH;
327
+ if (localPath) {
328
+ copyLocalTemplate(localPath, targetDir);
329
+ return;
330
+ }
331
+ const repoOverride = process.env.SZYY_TEMPLATE_REPO;
332
+ const gitBase = repoOverride || `${versions.templateGitBase}/${versions.templateRepo}`;
333
+ const degitSource = `${gitBase}#${versions.template}`;
334
+ const emitter = degit(degitSource, {
335
+ cache: false,
336
+ force: true,
337
+ verbose: false
338
+ });
339
+ await emitter.clone(targetDir);
340
+ }
341
+ function copyLocalTemplate(source, target) {
342
+ if (!fs2.existsSync(source)) {
343
+ throw new Error(`\u672C\u5730\u6A21\u677F\u8DEF\u5F84\u4E0D\u5B58\u5728: ${source}`);
344
+ }
345
+ fs2.mkdirSync(target, { recursive: true });
346
+ copyRecursive(source, target);
347
+ }
348
+ function copyRecursive(source, target) {
349
+ for (const entry of fs2.readdirSync(source, { withFileTypes: true })) {
350
+ if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === ".cursor") continue;
351
+ const srcPath = path3.join(source, entry.name);
352
+ const destPath = path3.join(target, entry.name);
353
+ if (entry.isDirectory()) {
354
+ fs2.mkdirSync(destPath, { recursive: true });
355
+ copyRecursive(srcPath, destPath);
356
+ } else if (entry.isFile()) {
357
+ fs2.copyFileSync(srcPath, destPath);
358
+ }
359
+ }
360
+ }
361
+
362
+ // src/index.ts
363
+ var program = new Command();
364
+ program.name("create-szyy-app").description("\u521B\u5EFA\u5FAE\u524D\u7AEF\u5B50\u5E94\u7528").argument("[project-name]", "\u9879\u76EE\u540D\u79F0\uFF08kebab-case\uFF09").option("-p, --port <port>", "\u672C\u5730\u8054\u8C03\u7AEF\u53E3", (value) => Number(value)).option("--minimal", "\u4E0D\u4FDD\u7559 Demo \u9875").option("-y, --yes", "\u8DF3\u8FC7\u4EA4\u4E92\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u503C").action(async (projectName, options) => {
365
+ try {
366
+ await run(projectName, options);
367
+ } catch (error) {
368
+ p2.log.error(error instanceof Error ? error.message : String(error));
369
+ process.exit(1);
370
+ }
371
+ });
372
+ async function run(projectName, flags) {
373
+ let createOptions;
374
+ if (flags.yes && projectName) {
375
+ const nameError = validateName(projectName);
376
+ if (nameError) throw new Error(nameError);
377
+ const versions2 = loadVersions();
378
+ const port = flags.port ?? versions2.defaultPort;
379
+ const portError = validatePort(port);
380
+ if (portError) throw new Error(portError);
381
+ createOptions = {
382
+ appName: projectName,
383
+ appNameUpper: toAppNameUpper(projectName),
384
+ appTitle: toAppTitle(projectName),
385
+ appPort: port,
386
+ targetDir: path4.resolve(process.cwd(), projectName),
387
+ keepDemo: !flags.minimal
388
+ };
389
+ } else {
390
+ createOptions = await collectOptions(projectName, flags);
391
+ if (!createOptions) {
392
+ process.exit(0);
393
+ }
394
+ }
395
+ if (fs3.existsSync(createOptions.targetDir)) {
396
+ const entries = fs3.readdirSync(createOptions.targetDir);
397
+ if (entries.length > 0) {
398
+ throw new Error(`\u76EE\u6807\u76EE\u5F55\u975E\u7A7A: ${createOptions.targetDir}`);
399
+ }
400
+ } else {
401
+ fs3.mkdirSync(createOptions.targetDir, { recursive: true });
402
+ }
403
+ const versions = loadVersions();
404
+ const spinner2 = p2.spinner();
405
+ spinner2.start(`\u62C9\u53D6\u6A21\u677F ${versions.template}...`);
406
+ await fetchTemplate(createOptions.targetDir, versions);
407
+ spinner2.stop("\u6A21\u677F\u62C9\u53D6\u5B8C\u6210");
408
+ spinner2.start("\u66FF\u6362\u5360\u4F4D\u7B26...");
409
+ const fileCount = applyReplacements(createOptions.targetDir, createOptions);
410
+ spinner2.stop(`\u5360\u4F4D\u7B26\u66FF\u6362\u5B8C\u6210\uFF08${fileCount} \u4E2A\u6587\u4EF6\uFF09`);
411
+ spinner2.start("\u9501\u5B9A\u4F9D\u8D56\u7248\u672C...");
412
+ pinDependencies(createOptions.targetDir, versions);
413
+ spinner2.stop("\u4F9D\u8D56\u7248\u672C\u5DF2\u9501\u5B9A");
414
+ if (!createOptions.keepDemo) {
415
+ spinner2.start("\u7CBE\u7B80 Demo \u9875...");
416
+ applyMinimalMode(createOptions.targetDir, createOptions.appName);
417
+ spinner2.stop("Demo \u9875\u5DF2\u79FB\u9664");
418
+ }
419
+ removeGitDir(createOptions.targetDir);
420
+ p2.outro(
421
+ [
422
+ `${pc2.green("\u2713")} \u9879\u76EE ${pc2.cyan(createOptions.appName)} \u521B\u5EFA\u6210\u529F`,
423
+ "",
424
+ "\u4E0B\u4E00\u6B65:",
425
+ ` cd ${path4.relative(process.cwd(), createOptions.targetDir) || "."}`,
426
+ " pnpm install",
427
+ " pnpm dev # \u72EC\u7ACB\u6A21\u5F0F\uFF0C\u7AEF\u53E3 3000",
428
+ ` pnpm dev:micro # \u57FA\u5EA7\u8054\u8C03\uFF0C\u7AEF\u53E3 ${createOptions.appPort}`
429
+ ].join("\n")
430
+ );
431
+ }
432
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "create-szyy-app",
3
+ "version": "1.0.0",
4
+ "description": "脚手架:一键创建微前端子应用",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-szyy-app": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "templates"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@clack/prompts": "^0.9.1",
18
+ "commander": "^12.1.0",
19
+ "degit": "^2.8.4",
20
+ "picocolors": "^1.1.1"
21
+ },
22
+ "devDependencies": {
23
+ "@commitlint/cli": "20.4.1",
24
+ "@commitlint/config-conventional": "20.4.1",
25
+ "@eslint/js": "9.39.2",
26
+ "@types/node": "^20.10.4",
27
+ "@typescript-eslint/eslint-plugin": "8.53.1",
28
+ "@typescript-eslint/parser": "8.53.1",
29
+ "eslint": "9.39.2",
30
+ "eslint-config-prettier": "10.1.8",
31
+ "eslint-plugin-prettier": "5.5.5",
32
+ "globals": "17.1.0",
33
+ "husky": "9.1.7",
34
+ "lint-staged": "16.2.7",
35
+ "prettier": "3.8.1",
36
+ "standard-version": "^9.5.0",
37
+ "tsup": "^8.3.5",
38
+ "typescript": "^5.5.4"
39
+ },
40
+ "lint-staged": {
41
+ "*.{js,jsx,cjs,mjs,ts,tsx}": [
42
+ "eslint --fix",
43
+ "prettier --write"
44
+ ],
45
+ "*.{json,css,scss}": [
46
+ "prettier --write"
47
+ ],
48
+ "*.md": [
49
+ "prettier --write"
50
+ ],
51
+ "CHANGELOG.md": []
52
+ },
53
+ "scripts": {
54
+ "build": "tsup",
55
+ "dev": "tsup --watch",
56
+ "typecheck": "tsc --noEmit",
57
+ "lint": "eslint .",
58
+ "lint:fix": "eslint . --fix",
59
+ "format": "prettier --write \"**/*.{js,jsx,cjs,mjs,ts,tsx,json,css,scss,md}\"",
60
+ "format:check": "prettier --check \"**/*.{js,jsx,cjs,mjs,ts,tsx,json,css,scss,md}\"",
61
+ "check": "node scripts/check.mjs dev",
62
+ "check:release": "node scripts/check.mjs release",
63
+ "version:set": "node scripts/version-set-custom.mjs",
64
+ "release:patch": "standard-version --release-as patch",
65
+ "release:minor": "standard-version --release-as minor",
66
+ "release:major": "standard-version --release-as major",
67
+ "release:pre-alpha": "standard-version --prerelease alpha",
68
+ "release:pre-beta": "standard-version --prerelease beta",
69
+ "release:dry": "standard-version --dry-run",
70
+ "publish:pkg": "node scripts/publish-package.mjs",
71
+ "publish:pkg:dry": "node scripts/publish-package.mjs --dry-run"
72
+ }
73
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "template": "v1.0.1",
3
+ "templateRepo": "sunyard-szyy-app-template",
4
+ "templateGitBase": "http://172.1.1.65/RDKit",
5
+ "defaultPort": 5690,
6
+ "dependencies": {
7
+ "sunyard-szyy-ui": "0.8.0",
8
+ "@sunyard-szyy/micro-sdk": "1.0.4",
9
+ "@sunyard-szyy/shared": "1.0.4",
10
+ "vue": "3.4.38",
11
+ "vue-router": "4.4.0",
12
+ "element-plus": "2.10.0"
13
+ },
14
+ "preset": "micro",
15
+ "compat": {
16
+ "baseFrontend": ">=1.3.0",
17
+ "platformVersion": "1.0.x"
18
+ }
19
+ }