create-repoctl 1.2.13 → 1.2.15
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/dist/cli.mjs +2 -3
- package/dist/index.d.mts +0 -4
- package/dist/index.mjs +1 -1
- package/dist/{src-D_IqK_Vw.mjs → src-D08qoYHY.mjs} +18 -36
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { t as createCreateRepoctlProgram } from "./src-
|
|
1
|
+
import { t as createCreateRepoctlProgram } from "./src-D08qoYHY.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
|
|
3
|
+
// src/cli.ts
|
|
4
4
|
createCreateRepoctlProgram().parseAsync(process.argv).catch((error) => {
|
|
5
5
|
process.stderr.write(`[create-repoctl] ${error instanceof Error ? error.message : error}\n`);
|
|
6
6
|
process.exitCode = 1;
|
|
7
7
|
});
|
|
8
|
-
//#endregion
|
|
9
8
|
export {};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Command } from "@icebreakers/monorepo-templates";
|
|
2
|
-
//#region src/i18n/index.d.ts
|
|
3
2
|
type CreateRepoctlLocale = 'en' | 'zh-CN';
|
|
4
3
|
export declare function resolveCreateRepoctlLocale(argv?: readonly string[], env?: Record<string, string | undefined>): CreateRepoctlLocale;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/index.d.ts
|
|
7
4
|
export interface CreateRepoctlProgramOptions {
|
|
8
5
|
commandName?: string;
|
|
9
6
|
defaultTarget?: string;
|
|
@@ -12,5 +9,4 @@ export interface CreateRepoctlProgramOptions {
|
|
|
12
9
|
env?: Record<string, string | undefined>;
|
|
13
10
|
}
|
|
14
11
|
export declare function createCreateRepoctlProgram(options?: CreateRepoctlProgramOptions): Command;
|
|
15
|
-
//#endregion
|
|
16
12
|
export type { CreateRepoctlLocale };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createCreateRepoctlProgram, n as resolveCreateRepoctlLocale } from "./src-
|
|
1
|
+
export { t as createCreateRepoctlProgram, n as resolveCreateRepoctlLocale } from "./src-D08qoYHY.mjs";
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { Command, checkbox, getWorkspacePackageManager, input, scaffoldWorkspace, templateChoices } from "@icebreakers/monorepo-templates";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
|
-
|
|
5
|
+
// src/i18n/locales/en/error.ts
|
|
6
6
|
const error$1 = {
|
|
7
7
|
commanderAllowedChoices: "Allowed choices are",
|
|
8
8
|
commanderArgumentMissing: "argument missing",
|
|
@@ -17,8 +17,7 @@ const error$1 = {
|
|
|
17
17
|
commanderUnknownOption: "unknown option",
|
|
18
18
|
invalidLocale: "Unsupported locale: {locale}. Use en or zh-CN."
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region src/i18n/locales/en/help.ts
|
|
20
|
+
// src/i18n/locales/en/help.ts
|
|
22
21
|
const help$1 = {
|
|
23
22
|
argumentsTitle: "Arguments:",
|
|
24
23
|
choicesLabel: "choices:",
|
|
@@ -37,28 +36,24 @@ const help$1 = {
|
|
|
37
36
|
presetLabel: "preset:",
|
|
38
37
|
usageTitle: "Usage:"
|
|
39
38
|
};
|
|
40
|
-
|
|
41
|
-
//#region src/i18n/locales/en/prompt.ts
|
|
39
|
+
// src/i18n/locales/en/prompt.ts
|
|
42
40
|
const prompt$1 = {
|
|
43
41
|
targetPrompt: "Project directory (default: {defaultDir})",
|
|
44
42
|
templatesPrompt: "Select templates to include (none by default)"
|
|
45
43
|
};
|
|
46
|
-
|
|
47
|
-
//#region src/i18n/locales/en/report.ts
|
|
44
|
+
// src/i18n/locales/en/report.ts
|
|
48
45
|
const report$1 = {
|
|
49
46
|
unknownTemplates: "Ignoring unknown templates: {templates}",
|
|
50
47
|
complete: "Workspace created. Next steps:"
|
|
51
48
|
};
|
|
52
|
-
|
|
53
|
-
//#region src/i18n/locales/en/index.ts
|
|
49
|
+
// src/i18n/locales/en/index.ts
|
|
54
50
|
const en = {
|
|
55
51
|
...help$1,
|
|
56
52
|
...prompt$1,
|
|
57
53
|
...report$1,
|
|
58
54
|
...error$1
|
|
59
55
|
};
|
|
60
|
-
|
|
61
|
-
//#region src/i18n/locales/zh-CN/error.ts
|
|
56
|
+
// src/i18n/locales/zh-CN/error.ts
|
|
62
57
|
const error = {
|
|
63
58
|
commanderAllowedChoices: "可选值为",
|
|
64
59
|
commanderArgumentMissing: "缺少参数",
|
|
@@ -73,8 +68,7 @@ const error = {
|
|
|
73
68
|
commanderUnknownOption: "未知选项",
|
|
74
69
|
invalidLocale: "不支持的语言:{locale}。请使用 en 或 zh-CN。"
|
|
75
70
|
};
|
|
76
|
-
|
|
77
|
-
//#region src/i18n/locales/zh-CN/help.ts
|
|
71
|
+
// src/i18n/locales/zh-CN/help.ts
|
|
78
72
|
const help = {
|
|
79
73
|
argumentsTitle: "参数:",
|
|
80
74
|
choicesLabel: "可选值:",
|
|
@@ -93,28 +87,24 @@ const help = {
|
|
|
93
87
|
presetLabel: "预设值:",
|
|
94
88
|
usageTitle: "用法:"
|
|
95
89
|
};
|
|
96
|
-
|
|
97
|
-
//#region src/i18n/locales/zh-CN/prompt.ts
|
|
90
|
+
// src/i18n/locales/zh-CN/prompt.ts
|
|
98
91
|
const prompt = {
|
|
99
92
|
targetPrompt: "项目目录(默认:{defaultDir})",
|
|
100
93
|
templatesPrompt: "选择要包含的模板(默认不选择)"
|
|
101
94
|
};
|
|
102
|
-
|
|
103
|
-
//#region src/i18n/locales/zh-CN/report.ts
|
|
95
|
+
// src/i18n/locales/zh-CN/report.ts
|
|
104
96
|
const report = {
|
|
105
97
|
unknownTemplates: "忽略未知模板:{templates}",
|
|
106
98
|
complete: "工作区创建完成。后续步骤:"
|
|
107
99
|
};
|
|
108
|
-
|
|
109
|
-
//#region src/i18n/locales/zh-CN/index.ts
|
|
100
|
+
// src/i18n/locales/zh-CN/index.ts
|
|
110
101
|
const zhCN = {
|
|
111
102
|
...help,
|
|
112
103
|
...prompt,
|
|
113
104
|
...report,
|
|
114
105
|
...error
|
|
115
106
|
};
|
|
116
|
-
|
|
117
|
-
//#region src/i18n/index.ts
|
|
107
|
+
// src/i18n/index.ts
|
|
118
108
|
const supportedLocales = ["en", "zh-CN"];
|
|
119
109
|
function isCreateRepoctlLocale(value) {
|
|
120
110
|
return supportedLocales.includes(value);
|
|
@@ -137,8 +127,7 @@ function createTranslator(locale) {
|
|
|
137
127
|
return Object.entries(values).reduce((result, [name, value]) => result.replaceAll(`{${name}}`, value), catalog[key]);
|
|
138
128
|
};
|
|
139
129
|
}
|
|
140
|
-
|
|
141
|
-
//#region src/next-steps.ts
|
|
130
|
+
// src/next-steps.ts
|
|
142
131
|
function formatNextSteps(targetDir, cwd = process.cwd(), heading = "Workspace created. Next steps:") {
|
|
143
132
|
return [
|
|
144
133
|
"",
|
|
@@ -152,8 +141,7 @@ function formatNextSteps(targetDir, cwd = process.cwd(), heading = "Workspace cr
|
|
|
152
141
|
""
|
|
153
142
|
].join("\n");
|
|
154
143
|
}
|
|
155
|
-
|
|
156
|
-
//#region src/package-json.ts
|
|
144
|
+
// src/package-json.ts
|
|
157
145
|
const repoctlPackageName = "repoctl";
|
|
158
146
|
const legacyToolPackageName = "@icebreakers/monorepo";
|
|
159
147
|
const publishedRepoctlVersion = "latest";
|
|
@@ -179,8 +167,7 @@ async function updateRootPackageJson(targetDir, projectName) {
|
|
|
179
167
|
}
|
|
180
168
|
await fs.writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
|
|
181
169
|
}
|
|
182
|
-
|
|
183
|
-
//#region src/templates.ts
|
|
170
|
+
// src/templates.ts
|
|
184
171
|
const templateTokenSplitPattern = /[,\s]+/;
|
|
185
172
|
const numericTemplatePattern = /^\d+$/;
|
|
186
173
|
function parseTemplateInput(input) {
|
|
@@ -212,8 +199,7 @@ function resolveTemplateSelections(input) {
|
|
|
212
199
|
};
|
|
213
200
|
return parseTemplateInput(input);
|
|
214
201
|
}
|
|
215
|
-
|
|
216
|
-
//#region src/prompts.ts
|
|
202
|
+
// src/prompts.ts
|
|
217
203
|
async function promptTargetDir(defaultDir, message) {
|
|
218
204
|
return ((await input({
|
|
219
205
|
message,
|
|
@@ -229,8 +215,7 @@ async function promptTemplates(message) {
|
|
|
229
215
|
}))
|
|
230
216
|
});
|
|
231
217
|
}
|
|
232
|
-
|
|
233
|
-
//#region src/source-npm.ts
|
|
218
|
+
// src/source-npm.ts
|
|
234
219
|
async function scaffoldFromNpm(targetDir, selectedTemplates, force = false, afterScaffold) {
|
|
235
220
|
await scaffoldWorkspace({
|
|
236
221
|
targetDir,
|
|
@@ -240,8 +225,7 @@ async function scaffoldFromNpm(targetDir, selectedTemplates, force = false, afte
|
|
|
240
225
|
...afterScaffold ? { afterScaffold } : {}
|
|
241
226
|
});
|
|
242
227
|
}
|
|
243
|
-
|
|
244
|
-
//#region src/tsconfig.ts
|
|
228
|
+
// src/tsconfig.ts
|
|
245
229
|
const workspaceRoots = [
|
|
246
230
|
"apps",
|
|
247
231
|
"packages",
|
|
@@ -278,8 +262,7 @@ async function updateRootTsconfigReferences(targetDir) {
|
|
|
278
262
|
tsconfig.references = references;
|
|
279
263
|
await fs.writeFile(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\n`, "utf8");
|
|
280
264
|
}
|
|
281
|
-
|
|
282
|
-
//#region src/index.ts
|
|
265
|
+
// src/index.ts
|
|
283
266
|
function createCreateRepoctlProgram(options = {}) {
|
|
284
267
|
const commandName = options.commandName ?? "create-repoctl";
|
|
285
268
|
const defaultTarget = options.defaultTarget ?? "repoctl-workspace";
|
|
@@ -321,5 +304,4 @@ function createCreateRepoctlProgram(options = {}) {
|
|
|
321
304
|
});
|
|
322
305
|
return program;
|
|
323
306
|
}
|
|
324
|
-
//#endregion
|
|
325
307
|
export { resolveCreateRepoctlLocale as n, createCreateRepoctlProgram as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-repoctl",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.15",
|
|
5
5
|
"description": "Create a repoctl-managed pnpm and Turborepo workspace. Non-interactive: pnpm create repoctl@latest <dir> -- --yes --templates vue-hono",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@icebreakers/monorepo-templates": "3.2.
|
|
47
|
+
"@icebreakers/monorepo-templates": "3.2.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"tsd": "^0.33.0"
|