@intra-mart/accel 0.1.0-dev.202605201947 → 0.2.0-dev.202605220447
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/asset/deployer.d.ts +8 -0
- package/dist/asset/deployer.js +38 -9
- package/dist/asset/walker.js +1 -0
- package/dist/commands/attach.js +14 -2
- package/dist/commands/init.js +14 -1
- package/dist/core/condition-evaluator.js +4 -1
- package/dist/core/types.d.ts +6 -1
- package/dist/core/types.js +1 -0
- package/dist/core/validators.d.ts +1 -1
- package/dist/core/validators.js +56 -29
- package/dist/i18n/en.js +40 -4
- package/dist/i18n/ja.js +43 -7
- package/dist/i18n/zh_CN.js +43 -7
- package/dist/interactive/format.d.ts +2 -0
- package/dist/interactive/format.js +33 -0
- package/dist/interactive/next-steps.d.ts +8 -0
- package/dist/interactive/next-steps.js +22 -0
- package/dist/interactive/progress.d.ts +2 -0
- package/dist/interactive/progress.js +21 -0
- package/dist/interactive/prompts.js +12 -10
- package/dist/interactive/summary.d.ts +3 -0
- package/dist/interactive/summary.js +50 -0
- package/package.json +2 -2
package/dist/asset/deployer.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { AssetProvider, AccelSettings, HashsumEntry } from "../core/types.js";
|
|
2
2
|
export type OverwriteDecision = "overwrite" | "skip";
|
|
3
3
|
export type ExistingFileHandler = (relativePath: string) => Promise<OverwriteDecision>;
|
|
4
|
+
export type ProgressCallbacks = {
|
|
5
|
+
onFetchStart?: () => void;
|
|
6
|
+
onSectionDeploy?: (section: string, files: string[]) => void;
|
|
7
|
+
onInstallStart?: (command: string) => void;
|
|
8
|
+
onBuildStart?: (command: string) => void;
|
|
9
|
+
};
|
|
4
10
|
export type DeployOptions = {
|
|
5
11
|
projectDir: string;
|
|
6
12
|
settings: AccelSettings;
|
|
@@ -8,6 +14,7 @@ export type DeployOptions = {
|
|
|
8
14
|
noInstall: boolean;
|
|
9
15
|
skipExistingFiles?: boolean;
|
|
10
16
|
onExistingFile?: ExistingFileHandler;
|
|
17
|
+
progress?: ProgressCallbacks;
|
|
11
18
|
};
|
|
12
19
|
export type DeployResult = {
|
|
13
20
|
deployedFiles: string[];
|
|
@@ -16,4 +23,5 @@ export type DeployResult = {
|
|
|
16
23
|
overwrittenFiles: string[];
|
|
17
24
|
};
|
|
18
25
|
export declare const getInstallCmds: (packageManager: string) => string[];
|
|
26
|
+
export declare const ROOT_SECTION = "(root)";
|
|
19
27
|
export declare const deployAssets: (options: DeployOptions) => Promise<DeployResult>;
|
package/dist/asset/deployer.js
CHANGED
|
@@ -42,9 +42,20 @@ const collectReplacements = (entry) => {
|
|
|
42
42
|
return [];
|
|
43
43
|
return entry.meta.replacements;
|
|
44
44
|
};
|
|
45
|
+
export const ROOT_SECTION = "(root)";
|
|
46
|
+
const sectionOf = (relativePath) => {
|
|
47
|
+
const idx = relativePath.indexOf("/");
|
|
48
|
+
return idx === -1 ? ROOT_SECTION : relativePath.slice(0, idx) + "/";
|
|
49
|
+
};
|
|
50
|
+
const fileLabelOf = (relativePath, section) => {
|
|
51
|
+
if (section === ROOT_SECTION)
|
|
52
|
+
return relativePath;
|
|
53
|
+
return relativePath.slice(section.length);
|
|
54
|
+
};
|
|
45
55
|
export const deployAssets = async (options) => {
|
|
46
|
-
const { projectDir, settings, provider, noInstall, skipExistingFiles, onExistingFile, } = options;
|
|
56
|
+
const { projectDir, settings, provider, noInstall, skipExistingFiles, onExistingFile, progress, } = options;
|
|
47
57
|
try {
|
|
58
|
+
progress?.onFetchStart?.();
|
|
48
59
|
const repoDir = await provider.fetch();
|
|
49
60
|
const semver = labelToSemver(settings.accelplatformVersion);
|
|
50
61
|
const context = {
|
|
@@ -60,6 +71,7 @@ export const deployAssets = async (options) => {
|
|
|
60
71
|
database: settings.database,
|
|
61
72
|
projectVersion: settings.projectVersion,
|
|
62
73
|
packageManager: settings.packageManager,
|
|
74
|
+
javascript: settings.javascript,
|
|
63
75
|
};
|
|
64
76
|
const entries = await walkAssetRepo(repoDir, semver, context);
|
|
65
77
|
const deployedFiles = [];
|
|
@@ -67,9 +79,20 @@ export const deployAssets = async (options) => {
|
|
|
67
79
|
const deployedAssets = {};
|
|
68
80
|
const skippedFiles = [];
|
|
69
81
|
const overwrittenFiles = [];
|
|
82
|
+
let currentSection = null;
|
|
70
83
|
for (const entry of entries) {
|
|
71
84
|
const targetPath = entry.relativePath;
|
|
72
85
|
const destPath = join(projectDir, targetPath);
|
|
86
|
+
const section = sectionOf(targetPath);
|
|
87
|
+
if (section !== currentSection) {
|
|
88
|
+
currentSection = section;
|
|
89
|
+
if (progress?.onSectionDeploy) {
|
|
90
|
+
const sectionFiles = entries
|
|
91
|
+
.filter((e) => sectionOf(e.relativePath) === section)
|
|
92
|
+
.map((e) => fileLabelOf(e.relativePath, section));
|
|
93
|
+
progress.onSectionDeploy(section, sectionFiles);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
73
96
|
if (!isWithinDir(projectDir, destPath)) {
|
|
74
97
|
console.warn(`Warning: skipping asset with path escaping project directory: ${targetPath}`);
|
|
75
98
|
continue;
|
|
@@ -121,14 +144,20 @@ export const deployAssets = async (options) => {
|
|
|
121
144
|
await writeSettings(projectDir, updatedSettings);
|
|
122
145
|
await writeHashsum(projectDir, hashEntries);
|
|
123
146
|
if (!noInstall) {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
147
|
+
const [installCmd, buildCmd] = getInstallCmds(settings.packageManager);
|
|
148
|
+
progress?.onInstallStart?.(installCmd);
|
|
149
|
+
try {
|
|
150
|
+
execSync(installCmd, { cwd: projectDir, stdio: "pipe" });
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
console.warn(`Warning: install command failed: ${installCmd} in ${projectDir}`);
|
|
154
|
+
}
|
|
155
|
+
progress?.onBuildStart?.(buildCmd);
|
|
156
|
+
try {
|
|
157
|
+
execSync(buildCmd, { cwd: projectDir, stdio: "pipe" });
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
console.warn(`Warning: build command failed: ${buildCmd} in ${projectDir}`);
|
|
132
161
|
}
|
|
133
162
|
}
|
|
134
163
|
return { deployedFiles, hashEntries, skippedFiles, overwrittenFiles };
|
package/dist/asset/walker.js
CHANGED
package/dist/commands/attach.js
CHANGED
|
@@ -4,12 +4,15 @@ import { stat } from "node:fs/promises";
|
|
|
4
4
|
import { basename, join } from "node:path";
|
|
5
5
|
import { CLI_VERSION } from "../core/constants.js";
|
|
6
6
|
import { runPrompts } from "../interactive/prompts.js";
|
|
7
|
-
import { deployAssets } from "../asset/deployer.js";
|
|
7
|
+
import { deployAssets, } from "../asset/deployer.js";
|
|
8
8
|
import { createLocalAssetProvider } from "../asset/local-provider.js";
|
|
9
9
|
import { createFileAssetProvider } from "../asset/file-provider.js";
|
|
10
10
|
import { defaultAssetSourcePath } from "../asset/default-source.js";
|
|
11
11
|
import { getMessage } from "../i18n/index.js";
|
|
12
12
|
import { detectLocale } from "../utils/locale-detect.js";
|
|
13
|
+
import { printSummary } from "../interactive/summary.js";
|
|
14
|
+
import { printNextSteps } from "../interactive/next-steps.js";
|
|
15
|
+
import { buildProgressCallbacks } from "../interactive/progress.js";
|
|
13
16
|
export const attachCommand = defineCommand({
|
|
14
17
|
meta: {
|
|
15
18
|
name: "attach",
|
|
@@ -157,9 +160,11 @@ export const attachCommand = defineCommand({
|
|
|
157
160
|
const provider = serverUrl
|
|
158
161
|
? createLocalAssetProvider(serverUrl)
|
|
159
162
|
: createFileAssetProvider(assetSource);
|
|
160
|
-
p.log.info(getMessage("progress.deploying", locale));
|
|
161
163
|
const isInteractive = !args["non-interactive"];
|
|
162
164
|
const overwriteFlag = args.overwrite;
|
|
165
|
+
if (isInteractive) {
|
|
166
|
+
printSummary(settings, projectDir, locale);
|
|
167
|
+
}
|
|
163
168
|
let skipAll = false;
|
|
164
169
|
let onExistingFile;
|
|
165
170
|
if (!isInteractive) {
|
|
@@ -214,6 +219,7 @@ export const attachCommand = defineCommand({
|
|
|
214
219
|
noInstall: args["skip-install"],
|
|
215
220
|
skipExistingFiles: skipAll || undefined,
|
|
216
221
|
onExistingFile,
|
|
222
|
+
progress: buildProgressCallbacks(locale),
|
|
217
223
|
});
|
|
218
224
|
for (const path of result.overwrittenFiles) {
|
|
219
225
|
p.log.info(getMessage("attach.overwritten", locale, { path }));
|
|
@@ -232,5 +238,11 @@ export const attachCommand = defineCommand({
|
|
|
232
238
|
}));
|
|
233
239
|
}
|
|
234
240
|
p.log.success(getMessage("progress.complete", locale));
|
|
241
|
+
printNextSteps({
|
|
242
|
+
projectDir,
|
|
243
|
+
agents: resolved.agents,
|
|
244
|
+
isInit: false,
|
|
245
|
+
locale,
|
|
246
|
+
});
|
|
235
247
|
},
|
|
236
248
|
});
|
package/dist/commands/init.js
CHANGED
|
@@ -12,6 +12,9 @@ import { defaultAssetSourcePath } from "../asset/default-source.js";
|
|
|
12
12
|
import { getMessage } from "../i18n/index.js";
|
|
13
13
|
import { detectLocale } from "../utils/locale-detect.js";
|
|
14
14
|
import { commandExists } from "../utils/command-exists.js";
|
|
15
|
+
import { printSummary } from "../interactive/summary.js";
|
|
16
|
+
import { printNextSteps } from "../interactive/next-steps.js";
|
|
17
|
+
import { buildProgressCallbacks } from "../interactive/progress.js";
|
|
15
18
|
export const initCommand = defineCommand({
|
|
16
19
|
meta: {
|
|
17
20
|
name: "init",
|
|
@@ -158,17 +161,21 @@ export const initCommand = defineCommand({
|
|
|
158
161
|
jugglingProject: resolved.jugglingProject,
|
|
159
162
|
deployedAssets: {},
|
|
160
163
|
};
|
|
164
|
+
const isInteractive = !args["non-interactive"];
|
|
165
|
+
if (isInteractive) {
|
|
166
|
+
printSummary(settings, projectDir, locale);
|
|
167
|
+
}
|
|
161
168
|
const serverUrl = args["asset-server-url"];
|
|
162
169
|
const assetSource = args["asset-source"] ?? defaultAssetSourcePath();
|
|
163
170
|
const provider = serverUrl
|
|
164
171
|
? createLocalAssetProvider(serverUrl)
|
|
165
172
|
: createFileAssetProvider(assetSource);
|
|
166
|
-
p.log.info(getMessage("progress.deploying", locale));
|
|
167
173
|
await deployAssets({
|
|
168
174
|
projectDir,
|
|
169
175
|
settings,
|
|
170
176
|
provider,
|
|
171
177
|
noInstall: args["skip-install"],
|
|
178
|
+
progress: buildProgressCallbacks(locale),
|
|
172
179
|
});
|
|
173
180
|
if (resolved.withGit) {
|
|
174
181
|
if (commandExists("git")) {
|
|
@@ -185,5 +192,11 @@ export const initCommand = defineCommand({
|
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
194
|
p.log.success(getMessage("progress.complete", locale));
|
|
195
|
+
printNextSteps({
|
|
196
|
+
projectDir,
|
|
197
|
+
agents: resolved.agents,
|
|
198
|
+
isInit: true,
|
|
199
|
+
locale,
|
|
200
|
+
});
|
|
188
201
|
},
|
|
189
202
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { satisfies } from "semver";
|
|
2
|
-
import { isAndCondition, isOrCondition, isVersionCondition, isModuleCondition, isLocaleCondition, isAgentCondition, isPackageManagerCondition, } from "./types.js";
|
|
2
|
+
import { isAndCondition, isOrCondition, isVersionCondition, isModuleCondition, isLocaleCondition, isAgentCondition, isPackageManagerCondition, isJavascriptCondition, } from "./types.js";
|
|
3
3
|
export const evaluateCondition = (condition, context) => {
|
|
4
4
|
if (condition === undefined) {
|
|
5
5
|
return true;
|
|
@@ -25,5 +25,8 @@ export const evaluateCondition = (condition, context) => {
|
|
|
25
25
|
if (isPackageManagerCondition(condition)) {
|
|
26
26
|
return context.packageManager === condition.packageManager;
|
|
27
27
|
}
|
|
28
|
+
if (isJavascriptCondition(condition)) {
|
|
29
|
+
return context.javascript === condition.javascript;
|
|
30
|
+
}
|
|
28
31
|
return false;
|
|
29
32
|
};
|
package/dist/core/types.d.ts
CHANGED
|
@@ -19,7 +19,10 @@ export type AgentCondition = {
|
|
|
19
19
|
export type PackageManagerCondition = {
|
|
20
20
|
packageManager: string;
|
|
21
21
|
};
|
|
22
|
-
export type
|
|
22
|
+
export type JavascriptCondition = {
|
|
23
|
+
javascript: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type LeafCondition = VersionCondition | ModuleCondition | LocaleCondition | AgentCondition | PackageManagerCondition | JavascriptCondition;
|
|
23
26
|
export type Condition = AndCondition | OrCondition | LeafCondition;
|
|
24
27
|
export type TextReplacement = {
|
|
25
28
|
type: "text";
|
|
@@ -98,6 +101,7 @@ export type EvalContext = {
|
|
|
98
101
|
database: string;
|
|
99
102
|
projectVersion: string;
|
|
100
103
|
packageManager: string;
|
|
104
|
+
javascript: boolean;
|
|
101
105
|
};
|
|
102
106
|
export declare const isAndCondition: (c: Condition) => c is AndCondition;
|
|
103
107
|
export declare const isOrCondition: (c: Condition) => c is OrCondition;
|
|
@@ -106,3 +110,4 @@ export declare const isModuleCondition: (c: Condition) => c is ModuleCondition;
|
|
|
106
110
|
export declare const isLocaleCondition: (c: Condition) => c is LocaleCondition;
|
|
107
111
|
export declare const isAgentCondition: (c: Condition) => c is AgentCondition;
|
|
108
112
|
export declare const isPackageManagerCondition: (c: Condition) => c is PackageManagerCondition;
|
|
113
|
+
export declare const isJavascriptCondition: (c: Condition) => c is JavascriptCondition;
|
package/dist/core/types.js
CHANGED
|
@@ -5,3 +5,4 @@ export const isModuleCondition = (c) => "module" in c;
|
|
|
5
5
|
export const isLocaleCondition = (c) => "locale" in c;
|
|
6
6
|
export const isAgentCondition = (c) => "agent" in c;
|
|
7
7
|
export const isPackageManagerCondition = (c) => "packageManager" in c;
|
|
8
|
+
export const isJavascriptCondition = (c) => "javascript" in c;
|
package/dist/core/validators.js
CHANGED
|
@@ -25,33 +25,60 @@ const isValidDatabase = (value) => DATABASE_OPTIONS.includes(value);
|
|
|
25
25
|
const isValidAgent = (value) => AGENT_OPTIONS.includes(value);
|
|
26
26
|
const isValidPackageManager = (value) => PACKAGE_MANAGER_OPTIONS.includes(value);
|
|
27
27
|
export const createValidators = (locale) => ({
|
|
28
|
-
name: (value) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
28
|
+
name: (value) => {
|
|
29
|
+
const v = value ?? "";
|
|
30
|
+
return isValidName(v)
|
|
31
|
+
? undefined
|
|
32
|
+
: getMessage("error.invalidName", locale, { value: v });
|
|
33
|
+
},
|
|
34
|
+
artifactId: (value) => {
|
|
35
|
+
const v = value ?? "";
|
|
36
|
+
return isValidArtifactId(v)
|
|
37
|
+
? undefined
|
|
38
|
+
: getMessage("error.invalidArtifactId", locale, { value: v });
|
|
39
|
+
},
|
|
40
|
+
group: (value) => {
|
|
41
|
+
const v = value ?? "";
|
|
42
|
+
return isValidGroup(v)
|
|
43
|
+
? undefined
|
|
44
|
+
: getMessage("error.invalidGroup", locale, { value: v });
|
|
45
|
+
},
|
|
46
|
+
projectVersion: (value) => {
|
|
47
|
+
const v = value ?? "";
|
|
48
|
+
return isValidProjectVersion(v)
|
|
49
|
+
? undefined
|
|
50
|
+
: getMessage("error.invalidProjectVersion", locale, { value: v });
|
|
51
|
+
},
|
|
52
|
+
versionLabel: (value) => {
|
|
53
|
+
const v = value ?? "";
|
|
54
|
+
return isValidVersionLabel(v)
|
|
55
|
+
? undefined
|
|
56
|
+
: getMessage("error.invalidVersion", locale, { version: v });
|
|
57
|
+
},
|
|
58
|
+
module: (value) => {
|
|
59
|
+
const v = value ?? "";
|
|
60
|
+
return isValidModule(v)
|
|
61
|
+
? undefined
|
|
62
|
+
: getMessage("error.invalidModule", locale, { module: v });
|
|
63
|
+
},
|
|
64
|
+
database: (value) => {
|
|
65
|
+
const v = value ?? "";
|
|
66
|
+
return isValidDatabase(v)
|
|
67
|
+
? undefined
|
|
68
|
+
: getMessage("error.invalidDatabase", locale, { database: v });
|
|
69
|
+
},
|
|
70
|
+
agent: (value) => {
|
|
71
|
+
const v = value ?? "";
|
|
72
|
+
return isValidAgent(v)
|
|
73
|
+
? undefined
|
|
74
|
+
: getMessage("error.invalidAgent", locale, { agent: v });
|
|
75
|
+
},
|
|
76
|
+
packageManager: (value) => {
|
|
77
|
+
const v = value ?? "";
|
|
78
|
+
return isValidPackageManager(v)
|
|
79
|
+
? undefined
|
|
80
|
+
: getMessage("error.invalidPackageManager", locale, {
|
|
81
|
+
packageManager: v,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
57
84
|
});
|
package/dist/i18n/en.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
export const messages = {
|
|
2
|
+
"intro.init": "Generate an iAP (intra-mart Accel Platform) project and\nassets for Claude Code / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
|
|
3
|
+
"intro.attach": "Mark the current directory as an iAP project and\ndeploy assets for Claude Code / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
|
|
2
4
|
"prompt.name": "Enter project name",
|
|
5
|
+
"prompt.name.hint": "Used as the directory name and recorded in pom.xml <name> and package.json name\nProvide a concise name that represents the system or feature you are creating (e.g. customer-portal, invoice-management)",
|
|
3
6
|
"prompt.artifactId": "Enter artifact ID (Maven artifactId)",
|
|
7
|
+
"prompt.artifactId.hint": "Recorded in pom.xml as the Maven artifactId (the artifact's identifier)\nThe identifier that forms the built artifact's file name (jar/war) and Maven coordinates. Defaults to the project name; change only if you want a different identifier",
|
|
4
8
|
"prompt.jugglingProject": "Enter IM-Juggling project path (optional)",
|
|
9
|
+
"prompt.jugglingProject.hint": "If set, the iAP version and modules are auto-detected from juggling.im\nPath to an existing IM-Juggling project directory you want to link; leave empty to skip (e.g. ../customer-portal-juggling)",
|
|
5
10
|
"prompt.accelplatformVersion": "Select iAP version",
|
|
11
|
+
"prompt.accelplatformVersion.hint": "iAP release version. The deployed assets (CLAUDE.md, etc.) adapt to this version",
|
|
6
12
|
"prompt.modules": "Select modules to use",
|
|
13
|
+
"prompt.modules.hint": "iAP optional product modules. Each selection deploys matching skills, config, and CLAUDE.md sections",
|
|
7
14
|
"prompt.group": "Enter group name",
|
|
15
|
+
"prompt.group.hint": "Recorded in pom.xml as the Maven groupId (dot-separated organization identifier)\nAn identifier for your organization or team; reverse-domain notation reduces collisions (e.g. com.example, jp.co.intramart.app)",
|
|
8
16
|
"prompt.projectVersion": "Enter project version",
|
|
17
|
+
"prompt.projectVersion.hint": "Recorded in pom.xml <version> and package.json version\nThe release version of your project; Semantic Versioning (MAJOR.MINOR.PATCH) is common (e.g. 0.1.0, 1.0.0-SNAPSHOT)",
|
|
9
18
|
"prompt.description": "Enter project description",
|
|
19
|
+
"prompt.description.hint": "Recorded in pom.xml <description> and used in headers of CLAUDE.md and similar files\nA short description of what this system does; being specific helps future readers and search (e.g. Portal to manage customer information)",
|
|
10
20
|
"prompt.database": "Select database",
|
|
21
|
+
"prompt.database.hint": "The DB iAP connects to. Used to generate sample config and example connection strings in assets",
|
|
11
22
|
"prompt.javascript": "Use JavaScript instead of TypeScript?",
|
|
23
|
+
"prompt.javascript.hint": "Affects the whole project setup (presence of tsconfig.json, pom.xml / package.json dependencies and scripts, agent asset language guidance)",
|
|
12
24
|
"prompt.agent": "Select agent",
|
|
25
|
+
"prompt.agent.hint": "claude-code deploys under .claude/, github-copilot deploys under .github/ (instructions, skills, etc.)",
|
|
13
26
|
"prompt.withGit": "Initialize Git repository?",
|
|
27
|
+
"prompt.withGit.hint": "Runs git init inside the created project directory",
|
|
14
28
|
"juggling.detected.version": "Detected version from juggling.im: {version}",
|
|
15
29
|
"juggling.detected.modules": "Detected modules from juggling.im: {modules}",
|
|
16
30
|
"juggling.notFound": "juggling.im not found at specified path: {path}",
|
|
@@ -45,9 +59,31 @@ export const messages = {
|
|
|
45
59
|
"error.invalidArtifactId": "Artifact ID violates Maven naming rules (^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
46
60
|
"error.invalidGroup": "Group name violates Maven groupId naming rules (dot-separated Java identifiers): {value}",
|
|
47
61
|
"error.invalidProjectVersion": "Project version violates Maven version naming rules (^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
62
|
+
"summary.heading": "Deployment settings",
|
|
63
|
+
"summary.label.name": "Project name",
|
|
64
|
+
"summary.label.artifactId": "Artifact ID",
|
|
65
|
+
"summary.label.group": "Group",
|
|
66
|
+
"summary.label.projectVersion": "Project version",
|
|
67
|
+
"summary.label.description": "Description",
|
|
68
|
+
"summary.label.accelplatformVersion": "iAP version",
|
|
69
|
+
"summary.label.modules": "Modules",
|
|
70
|
+
"summary.label.database": "Database",
|
|
71
|
+
"summary.label.javascript": "JavaScript",
|
|
72
|
+
"summary.label.agents": "Agents",
|
|
73
|
+
"summary.label.locale": "Locale",
|
|
74
|
+
"summary.label.packageManager": "Package manager",
|
|
75
|
+
"summary.label.jugglingProject": "IM-Juggling project",
|
|
76
|
+
"summary.outputDir": "Output directory",
|
|
77
|
+
"summary.empty": "(none)",
|
|
78
|
+
"progress.fetching": "Fetching asset repository...",
|
|
79
|
+
"progress.deploying.section": "Deploying under {section} ({files})",
|
|
80
|
+
"progress.deploying.root": "Deploying root-level files ({files})",
|
|
81
|
+
"progress.installing": "Running {command}...",
|
|
82
|
+
"progress.building": "Running {command}...",
|
|
83
|
+
"progress.gitInit": "Running git init...",
|
|
52
84
|
"progress.complete": "Project creation complete.",
|
|
85
|
+
"nextSteps.heading": "Next steps",
|
|
86
|
+
"nextSteps.cd": "cd {path}",
|
|
87
|
+
"nextSteps.agent.claudeCode": "Run claude to start agent-driven development",
|
|
88
|
+
"nextSteps.agent.githubCopilot": "Run gh copilot to start agent-driven development",
|
|
53
89
|
};
|
package/dist/i18n/ja.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
export const messages = {
|
|
2
|
+
"intro.init": "iAP(intra-mart Accel Platform)プロジェクトと、\nClaude Code / GitHub Copilot 向けの資材を生成します。\nいくつか質問した後、最後に一括で配備します。",
|
|
3
|
+
"intro.attach": "カレントディレクトリを iAP プロジェクトとして認識させ、\nClaude Code / GitHub Copilot 向けの資材を配備します。\nいくつか質問した後、最後に一括で配備します。",
|
|
2
4
|
"prompt.name": "プロジェクト名を入力してください",
|
|
5
|
+
"prompt.name.hint": "ディレクトリ名、pom.xml の <name>、package.json の name に反映されます\n作成するシステムや機能を端的に表す名称を指定してください(例: customer-portal, invoice-management)",
|
|
3
6
|
"prompt.artifactId": "アーティファクトID(pomのartifactId)を入力してください",
|
|
7
|
+
"prompt.artifactId.hint": "Maven の artifactId として pom.xml に記録されます(成果物のID)\n成果物 (jar/war 等) のファイル名や、Maven で依存関係を識別するための ID の一部として使われます。デフォルトはプロジェクト名と同じ値で、別の識別子を使いたい場合のみ変更してください",
|
|
4
8
|
"prompt.jugglingProject": "IM-Jugglingプロジェクトのパスを入力してください(省略可)",
|
|
9
|
+
"prompt.jugglingProject.hint": "指定すると juggling.im から iAPバージョンとモジュールを自動検出します\n連携したい既存の IM-Juggling プロジェクトのディレクトリパスを指定してください(例: ../customer-portal-juggling)",
|
|
5
10
|
"prompt.accelplatformVersion": "iAPバージョンを選択してください",
|
|
11
|
+
"prompt.accelplatformVersion.hint": "iAP本体のリリース版。配備される資材(CLAUDE.md 等)の内容がこのバージョンに合わせて変化します",
|
|
6
12
|
"prompt.modules": "利用するモジュールを選択してください",
|
|
13
|
+
"prompt.modules.hint": "iAP のオプション製品群。選択したモジュール向けの Skill や設定ファイル、CLAUDE.md 内のセクションが配備されます",
|
|
7
14
|
"prompt.group": "グループ名を入力してください",
|
|
15
|
+
"prompt.group.hint": "Maven の groupId として pom.xml に記録されます(組織を表すドット区切り名)\n所属する組織やチームを表す識別子。逆ドメイン記法で書くと他者と衝突しにくいです(例: com.example, jp.co.intramart.app)",
|
|
8
16
|
"prompt.projectVersion": "プロジェクトバージョンを入力してください",
|
|
17
|
+
"prompt.projectVersion.hint": "pom.xml の <version> と package.json の version に反映されます\nプロジェクトのリリースバージョン。セマンティックバージョニング(MAJOR.MINOR.PATCH)が一般的です(例: 0.1.0, 1.0.0-SNAPSHOT)",
|
|
9
18
|
"prompt.description": "プロジェクトの説明を入力してください",
|
|
19
|
+
"prompt.description.hint": "pom.xml の <description> や CLAUDE.md 等のヘッダに反映されます\nこのシステムが何をするものかの簡潔な説明。具体的に書くと後で読む人や検索の助けになります(例: 顧客情報を管理するポータルサイト)",
|
|
10
20
|
"prompt.database": "データベースを選択してください",
|
|
21
|
+
"prompt.database.hint": "iAP が接続する DB。資材内のサンプル設定や接続文字列の例の生成に使われます",
|
|
11
22
|
"prompt.javascript": "TypeScriptの代わりにJavaScriptを利用しますか?",
|
|
23
|
+
"prompt.javascript.hint": "プロジェクト全体の構成(tsconfig.json の有無、pom.xml / package.json の依存・スクリプト、エージェント資材内の言語ガイド)に影響します",
|
|
12
24
|
"prompt.agent": "エージェントを選択してください",
|
|
25
|
+
"prompt.agent.hint": "claude-code → .claude/ 配下、github-copilot → .github/ 配下に、指示書や skills などを配備します",
|
|
13
26
|
"prompt.withGit": "Gitリポジトリを初期化しますか?",
|
|
27
|
+
"prompt.withGit.hint": "作成したプロジェクトディレクトリで git init を実行します",
|
|
14
28
|
"juggling.detected.version": "juggling.imからバージョンを検出: {version}",
|
|
15
29
|
"juggling.detected.modules": "juggling.imからモジュールを検出: {modules}",
|
|
16
30
|
"juggling.notFound": "指定されたパスにjuggling.imが見つかりません: {path}",
|
|
@@ -42,12 +56,34 @@ export const messages = {
|
|
|
42
56
|
"error.invalidAgent": "無効なエージェントです: {agent}",
|
|
43
57
|
"error.invalidPackageManager": "無効なパッケージマネージャです(bun, npm, yarn, pnpm のいずれかを指定してください): {packageManager}",
|
|
44
58
|
"error.invalidName": "プロジェクト名にディレクトリ名として使用できない文字が含まれています、または空です: {value}",
|
|
45
|
-
"error.invalidArtifactId": "アーティファクトIDが Maven
|
|
46
|
-
"error.invalidGroup": "グループ名が Maven groupId
|
|
47
|
-
"error.invalidProjectVersion": "プロジェクトバージョンが Maven version
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
59
|
+
"error.invalidArtifactId": "アーティファクトIDが Maven の規約に違反しています(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
60
|
+
"error.invalidGroup": "グループ名が Maven groupId の規約に違反しています(ドット区切りのJava識別子): {value}",
|
|
61
|
+
"error.invalidProjectVersion": "プロジェクトバージョンが Maven version の規約に違反しています(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
62
|
+
"summary.heading": "配備設定",
|
|
63
|
+
"summary.label.name": "プロジェクト名",
|
|
64
|
+
"summary.label.artifactId": "アーティファクトID",
|
|
65
|
+
"summary.label.group": "グループ",
|
|
66
|
+
"summary.label.projectVersion": "プロジェクトバージョン",
|
|
67
|
+
"summary.label.description": "説明",
|
|
68
|
+
"summary.label.accelplatformVersion": "iAPバージョン",
|
|
69
|
+
"summary.label.modules": "モジュール",
|
|
70
|
+
"summary.label.database": "データベース",
|
|
71
|
+
"summary.label.javascript": "JavaScript",
|
|
72
|
+
"summary.label.agents": "エージェント",
|
|
73
|
+
"summary.label.locale": "ロケール",
|
|
74
|
+
"summary.label.packageManager": "パッケージマネージャ",
|
|
75
|
+
"summary.label.jugglingProject": "IM-Jugglingプロジェクト",
|
|
76
|
+
"summary.outputDir": "出力先",
|
|
77
|
+
"summary.empty": "(なし)",
|
|
78
|
+
"progress.fetching": "資材リポジトリを取得しています...",
|
|
79
|
+
"progress.deploying.section": "{section} 配下を配備中 ({files})",
|
|
80
|
+
"progress.deploying.root": "ルート直下を配備中 ({files})",
|
|
81
|
+
"progress.installing": "{command} を実行しています...",
|
|
82
|
+
"progress.building": "{command} を実行しています...",
|
|
83
|
+
"progress.gitInit": "git init を実行しています...",
|
|
52
84
|
"progress.complete": "プロジェクトの作成が完了しました。",
|
|
85
|
+
"nextSteps.heading": "次の手順",
|
|
86
|
+
"nextSteps.cd": "cd {path}",
|
|
87
|
+
"nextSteps.agent.claudeCode": "claude を起動してエージェント開発を始めてください",
|
|
88
|
+
"nextSteps.agent.githubCopilot": "gh copilot を起動してエージェント開発を始めてください",
|
|
53
89
|
};
|
package/dist/i18n/zh_CN.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
export const messages = {
|
|
2
|
+
"intro.init": "生成 iAP(intra-mart Accel Platform)项目,\n以及面向 Claude Code / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
|
|
3
|
+
"intro.attach": "将当前目录识别为 iAP 项目,\n并部署面向 Claude Code / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
|
|
2
4
|
"prompt.name": "请输入项目名称",
|
|
5
|
+
"prompt.name.hint": "用作目录名称,并写入 pom.xml 的 <name> 和 package.json 的 name\n请提供能简洁表达所创建系统或功能的名称(例如: customer-portal, invoice-management)",
|
|
3
6
|
"prompt.artifactId": "请输入构件ID(Maven artifactId)",
|
|
7
|
+
"prompt.artifactId.hint": "作为 Maven artifactId 写入 pom.xml(构件的标识符)\n构成成品 (jar/war 等) 文件名和 Maven 坐标的标识符。默认与项目名称相同;如需使用其他标识符请修改",
|
|
4
8
|
"prompt.jugglingProject": "请输入IM-Juggling项目路径(可选)",
|
|
9
|
+
"prompt.jugglingProject.hint": "若指定,则从 juggling.im 自动检测 iAP 版本和模块\n指定要联动的已有 IM-Juggling 项目目录路径;不需要时留空(例如: ../customer-portal-juggling)",
|
|
5
10
|
"prompt.accelplatformVersion": "请选择iAP版本",
|
|
11
|
+
"prompt.accelplatformVersion.hint": "iAP 本体的发行版。部署的资源(CLAUDE.md 等)会根据该版本变化",
|
|
6
12
|
"prompt.modules": "请选择要使用的模块",
|
|
13
|
+
"prompt.modules.hint": "iAP 的可选产品模块。每选一项会部署对应的 Skill、配置文件以及 CLAUDE.md 中的相应章节",
|
|
7
14
|
"prompt.group": "请输入组名",
|
|
15
|
+
"prompt.group.hint": "作为 Maven groupId 写入 pom.xml(表示组织的点分标识符)\n表示所属组织或团队的标识符;按反向域名记法书写可减少与他人的冲突(例如: com.example, jp.co.intramart.app)",
|
|
8
16
|
"prompt.projectVersion": "请输入项目版本",
|
|
17
|
+
"prompt.projectVersion.hint": "写入 pom.xml 的 <version> 和 package.json 的 version\n项目的发布版本;常用语义化版本(MAJOR.MINOR.PATCH)(例如: 0.1.0, 1.0.0-SNAPSHOT)",
|
|
9
18
|
"prompt.description": "请输入项目描述",
|
|
19
|
+
"prompt.description.hint": "写入 pom.xml 的 <description>,并用于 CLAUDE.md 等文件的标题部分\n对该系统功能的简要说明;写得具体有助于日后阅读和检索(例如: 用于管理客户信息的门户网站)",
|
|
10
20
|
"prompt.database": "请选择数据库",
|
|
21
|
+
"prompt.database.hint": "iAP 连接的数据库。用于生成资源中的示例配置和连接字符串样例",
|
|
11
22
|
"prompt.javascript": "是否使用JavaScript代替TypeScript?",
|
|
23
|
+
"prompt.javascript.hint": "影响整个项目结构(是否存在 tsconfig.json、pom.xml / package.json 的依赖与脚本、代理资源中的语言指引)",
|
|
12
24
|
"prompt.agent": "请选择代理",
|
|
25
|
+
"prompt.agent.hint": "claude-code 部署到 .claude/ 下,github-copilot 部署到 .github/ 下(指令书、skills 等)",
|
|
13
26
|
"prompt.withGit": "是否初始化Git仓库?",
|
|
27
|
+
"prompt.withGit.hint": "在创建的项目目录中执行 git init",
|
|
14
28
|
"juggling.detected.version": "从juggling.im检测到版本: {version}",
|
|
15
29
|
"juggling.detected.modules": "从juggling.im检测到模块: {modules}",
|
|
16
30
|
"juggling.notFound": "在指定路径未找到juggling.im: {path}",
|
|
@@ -42,12 +56,34 @@ export const messages = {
|
|
|
42
56
|
"error.invalidAgent": "无效的代理: {agent}",
|
|
43
57
|
"error.invalidPackageManager": "无效的包管理器(必须是 bun、npm、yarn、pnpm 之一): {packageManager}",
|
|
44
58
|
"error.invalidName": "项目名称包含不能用作目录名的字符或为空: {value}",
|
|
45
|
-
"error.invalidArtifactId": "构件ID违反Maven
|
|
46
|
-
"error.invalidGroup": "组名违反Maven groupId
|
|
47
|
-
"error.invalidProjectVersion": "项目版本违反Maven version
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
59
|
+
"error.invalidArtifactId": "构件ID违反Maven命名规则(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
60
|
+
"error.invalidGroup": "组名违反Maven groupId命名规则(点分隔的Java标识符): {value}",
|
|
61
|
+
"error.invalidProjectVersion": "项目版本违反Maven version命名规则(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
62
|
+
"summary.heading": "部署设置",
|
|
63
|
+
"summary.label.name": "项目名称",
|
|
64
|
+
"summary.label.artifactId": "构件ID",
|
|
65
|
+
"summary.label.group": "组",
|
|
66
|
+
"summary.label.projectVersion": "项目版本",
|
|
67
|
+
"summary.label.description": "描述",
|
|
68
|
+
"summary.label.accelplatformVersion": "iAP版本",
|
|
69
|
+
"summary.label.modules": "模块",
|
|
70
|
+
"summary.label.database": "数据库",
|
|
71
|
+
"summary.label.javascript": "JavaScript",
|
|
72
|
+
"summary.label.agents": "代理",
|
|
73
|
+
"summary.label.locale": "语言",
|
|
74
|
+
"summary.label.packageManager": "包管理器",
|
|
75
|
+
"summary.label.jugglingProject": "IM-Juggling项目",
|
|
76
|
+
"summary.outputDir": "输出目录",
|
|
77
|
+
"summary.empty": "(无)",
|
|
78
|
+
"progress.fetching": "正在获取资源仓库...",
|
|
79
|
+
"progress.deploying.section": "正在部署 {section} 下 ({files})",
|
|
80
|
+
"progress.deploying.root": "正在部署根目录文件 ({files})",
|
|
81
|
+
"progress.installing": "正在执行 {command}...",
|
|
82
|
+
"progress.building": "正在执行 {command}...",
|
|
83
|
+
"progress.gitInit": "正在执行 git init...",
|
|
52
84
|
"progress.complete": "项目创建完成。",
|
|
85
|
+
"nextSteps.heading": "下一步",
|
|
86
|
+
"nextSteps.cd": "cd {path}",
|
|
87
|
+
"nextSteps.agent.claudeCode": "执行 claude 开始基于代理的开发",
|
|
88
|
+
"nextSteps.agent.githubCopilot": "执行 gh copilot 开始基于代理的开发",
|
|
53
89
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getMessage } from "../i18n/index.js";
|
|
2
|
+
export const withHint = (baseKey, locale) => {
|
|
3
|
+
const main = getMessage(baseKey, locale);
|
|
4
|
+
const hintKey = `${baseKey}.hint`;
|
|
5
|
+
const hint = getMessage(hintKey, locale);
|
|
6
|
+
if (hint === hintKey)
|
|
7
|
+
return main;
|
|
8
|
+
return `${main}\n${hint}`;
|
|
9
|
+
};
|
|
10
|
+
const isWide = (ch) => {
|
|
11
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
12
|
+
if (code >= 0x1100 && code <= 0x115f)
|
|
13
|
+
return true;
|
|
14
|
+
if (code >= 0x2e80 && code <= 0x9fff)
|
|
15
|
+
return true;
|
|
16
|
+
if (code >= 0xa000 && code <= 0xa4cf)
|
|
17
|
+
return true;
|
|
18
|
+
if (code >= 0xac00 && code <= 0xd7a3)
|
|
19
|
+
return true;
|
|
20
|
+
if (code >= 0xf900 && code <= 0xfaff)
|
|
21
|
+
return true;
|
|
22
|
+
if (code >= 0xff00 && code <= 0xff60)
|
|
23
|
+
return true;
|
|
24
|
+
if (code >= 0xffe0 && code <= 0xffe6)
|
|
25
|
+
return true;
|
|
26
|
+
return false;
|
|
27
|
+
};
|
|
28
|
+
export const displayWidth = (s) => {
|
|
29
|
+
let w = 0;
|
|
30
|
+
for (const ch of s)
|
|
31
|
+
w += isWide(ch) ? 2 : 1;
|
|
32
|
+
return w;
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type NextStepsOptions = {
|
|
2
|
+
projectDir: string;
|
|
3
|
+
agents: string[];
|
|
4
|
+
isInit: boolean;
|
|
5
|
+
locale: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const buildNextStepsBody: (opts: NextStepsOptions) => string;
|
|
8
|
+
export declare const printNextSteps: (opts: NextStepsOptions) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { getMessage } from "../i18n/index.js";
|
|
4
|
+
export const buildNextStepsBody = (opts) => {
|
|
5
|
+
const steps = [];
|
|
6
|
+
if (opts.isInit) {
|
|
7
|
+
steps.push(getMessage("nextSteps.cd", opts.locale, { path: basename(opts.projectDir) }));
|
|
8
|
+
}
|
|
9
|
+
if (opts.agents.includes("claude-code")) {
|
|
10
|
+
steps.push(getMessage("nextSteps.agent.claudeCode", opts.locale));
|
|
11
|
+
}
|
|
12
|
+
if (opts.agents.includes("github-copilot")) {
|
|
13
|
+
steps.push(getMessage("nextSteps.agent.githubCopilot", opts.locale));
|
|
14
|
+
}
|
|
15
|
+
return steps.map((s, i) => `${i + 1}. ${s}`).join("\n");
|
|
16
|
+
};
|
|
17
|
+
export const printNextSteps = (opts) => {
|
|
18
|
+
const body = buildNextStepsBody(opts);
|
|
19
|
+
if (body.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
p.note(body, getMessage("nextSteps.heading", opts.locale));
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import { ROOT_SECTION } from "../asset/deployer.js";
|
|
3
|
+
import { getMessage } from "../i18n/index.js";
|
|
4
|
+
const MAX_FILES_SHOWN = 3;
|
|
5
|
+
const formatFileList = (files) => {
|
|
6
|
+
if (files.length <= MAX_FILES_SHOWN)
|
|
7
|
+
return files.join(", ");
|
|
8
|
+
return `${files.slice(0, MAX_FILES_SHOWN).join(", ")} +${files.length - MAX_FILES_SHOWN}`;
|
|
9
|
+
};
|
|
10
|
+
export const buildProgressCallbacks = (locale) => ({
|
|
11
|
+
onFetchStart: () => p.log.info(getMessage("progress.fetching", locale)),
|
|
12
|
+
onSectionDeploy: (section, files) => {
|
|
13
|
+
const filesStr = formatFileList(files);
|
|
14
|
+
const key = section === ROOT_SECTION
|
|
15
|
+
? "progress.deploying.root"
|
|
16
|
+
: "progress.deploying.section";
|
|
17
|
+
p.log.info(getMessage(key, locale, { section, files: filesStr }));
|
|
18
|
+
},
|
|
19
|
+
onInstallStart: (command) => p.log.info(getMessage("progress.installing", locale, { command })),
|
|
20
|
+
onBuildStart: (command) => p.log.info(getMessage("progress.building", locale, { command })),
|
|
21
|
+
});
|
|
@@ -2,6 +2,7 @@ import * as p from "@clack/prompts";
|
|
|
2
2
|
import { DATABASE_OPTIONS, AGENT_OPTIONS, DEFAULT_SETTINGS, } from "../core/constants.js";
|
|
3
3
|
import { createValidators } from "../core/validators.js";
|
|
4
4
|
import { getMessage } from "../i18n/index.js";
|
|
5
|
+
import { withHint } from "./format.js";
|
|
5
6
|
import { detectAgents, detectDefaultAgents } from "./agent-detect.js";
|
|
6
7
|
import { parseJugglingFile } from "../juggling/parser.js";
|
|
7
8
|
import { extractVersionLabel, extractModules, } from "../juggling/extractor.js";
|
|
@@ -114,8 +115,9 @@ export const runPrompts = async (opts) => {
|
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
p.intro("Accel CLI");
|
|
118
|
+
p.note(getMessage(opts.isInit ? "intro.init" : "intro.attach", locale));
|
|
117
119
|
const name = (await p.text({
|
|
118
|
-
message:
|
|
120
|
+
message: withHint("prompt.name", locale),
|
|
119
121
|
defaultValue: opts.name ?? DEFAULT_SETTINGS.name,
|
|
120
122
|
initialValue: opts.name ?? DEFAULT_SETTINGS.name,
|
|
121
123
|
validate: validators.name,
|
|
@@ -124,7 +126,7 @@ export const runPrompts = async (opts) => {
|
|
|
124
126
|
process.exit(0);
|
|
125
127
|
const artifactIdInitial = opts.artifactId ?? name;
|
|
126
128
|
const artifactId = (await p.text({
|
|
127
|
-
message:
|
|
129
|
+
message: withHint("prompt.artifactId", locale),
|
|
128
130
|
defaultValue: artifactIdInitial,
|
|
129
131
|
initialValue: artifactIdInitial,
|
|
130
132
|
validate: validators.artifactId,
|
|
@@ -132,7 +134,7 @@ export const runPrompts = async (opts) => {
|
|
|
132
134
|
if (p.isCancel(artifactId))
|
|
133
135
|
process.exit(0);
|
|
134
136
|
const jugglingInput = (await p.text({
|
|
135
|
-
message:
|
|
137
|
+
message: withHint("prompt.jugglingProject", locale),
|
|
136
138
|
defaultValue: opts.jugglingProject ?? "",
|
|
137
139
|
initialValue: opts.jugglingProject ?? "",
|
|
138
140
|
}));
|
|
@@ -157,7 +159,7 @@ export const runPrompts = async (opts) => {
|
|
|
157
159
|
const accelplatformVersion = "2025-Autumn";
|
|
158
160
|
const modules = ["workflow", "bpm"];
|
|
159
161
|
const group = (await p.text({
|
|
160
|
-
message:
|
|
162
|
+
message: withHint("prompt.group", locale),
|
|
161
163
|
defaultValue: opts.group ?? DEFAULT_SETTINGS.group,
|
|
162
164
|
initialValue: opts.group ?? DEFAULT_SETTINGS.group,
|
|
163
165
|
validate: validators.group,
|
|
@@ -165,7 +167,7 @@ export const runPrompts = async (opts) => {
|
|
|
165
167
|
if (p.isCancel(group))
|
|
166
168
|
process.exit(0);
|
|
167
169
|
const projectVersion = (await p.text({
|
|
168
|
-
message:
|
|
170
|
+
message: withHint("prompt.projectVersion", locale),
|
|
169
171
|
defaultValue: opts.projectVersion ?? DEFAULT_SETTINGS.projectVersion,
|
|
170
172
|
initialValue: opts.projectVersion ?? DEFAULT_SETTINGS.projectVersion,
|
|
171
173
|
validate: validators.projectVersion,
|
|
@@ -173,21 +175,21 @@ export const runPrompts = async (opts) => {
|
|
|
173
175
|
if (p.isCancel(projectVersion))
|
|
174
176
|
process.exit(0);
|
|
175
177
|
const description = (await p.text({
|
|
176
|
-
message:
|
|
178
|
+
message: withHint("prompt.description", locale),
|
|
177
179
|
defaultValue: opts.description ?? DEFAULT_SETTINGS.description,
|
|
178
180
|
initialValue: opts.description ?? DEFAULT_SETTINGS.description,
|
|
179
181
|
}));
|
|
180
182
|
if (p.isCancel(description))
|
|
181
183
|
process.exit(0);
|
|
182
184
|
const database = (await p.select({
|
|
183
|
-
message:
|
|
185
|
+
message: withHint("prompt.database", locale),
|
|
184
186
|
options: DATABASE_OPTIONS.map((d) => ({ value: d, label: d })),
|
|
185
187
|
initialValue: opts.database ?? DEFAULT_SETTINGS.database,
|
|
186
188
|
}));
|
|
187
189
|
if (p.isCancel(database))
|
|
188
190
|
process.exit(0);
|
|
189
191
|
const javascript = (await p.confirm({
|
|
190
|
-
message:
|
|
192
|
+
message: withHint("prompt.javascript", locale),
|
|
191
193
|
initialValue: opts.javascript ?? DEFAULT_SETTINGS.javascript,
|
|
192
194
|
}));
|
|
193
195
|
if (p.isCancel(javascript))
|
|
@@ -199,7 +201,7 @@ export const runPrompts = async (opts) => {
|
|
|
199
201
|
? detected.map((a) => a.name)
|
|
200
202
|
: [...AGENT_OPTIONS]);
|
|
201
203
|
const agents = (await p.multiselect({
|
|
202
|
-
message:
|
|
204
|
+
message: withHint("prompt.agent", locale),
|
|
203
205
|
options: agentOptions,
|
|
204
206
|
initialValues: defaultAgents,
|
|
205
207
|
}));
|
|
@@ -208,7 +210,7 @@ export const runPrompts = async (opts) => {
|
|
|
208
210
|
let withGit = opts.withGit ?? true;
|
|
209
211
|
if (opts.isInit) {
|
|
210
212
|
withGit = (await p.confirm({
|
|
211
|
-
message:
|
|
213
|
+
message: withHint("prompt.withGit", locale),
|
|
212
214
|
initialValue: opts.withGit ?? true,
|
|
213
215
|
}));
|
|
214
216
|
if (p.isCancel(withGit))
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import { getMessage } from "../i18n/index.js";
|
|
3
|
+
import { displayWidth } from "./format.js";
|
|
4
|
+
const formatList = (values, emptyLabel) => values.length > 0 ? values.join(", ") : emptyLabel;
|
|
5
|
+
const formatString = (value, emptyLabel) => value.length > 0 ? value : emptyLabel;
|
|
6
|
+
const formatBoolean = (value) => (value ? "true" : "false");
|
|
7
|
+
export const buildSummaryBody = (settings, outputDir, locale) => {
|
|
8
|
+
const empty = getMessage("summary.empty", locale);
|
|
9
|
+
const rows = [
|
|
10
|
+
{ labelKey: "summary.label.name", value: settings.name },
|
|
11
|
+
{ labelKey: "summary.label.artifactId", value: settings.artifactId },
|
|
12
|
+
{ labelKey: "summary.label.group", value: settings.group },
|
|
13
|
+
{ labelKey: "summary.label.projectVersion", value: settings.projectVersion },
|
|
14
|
+
{
|
|
15
|
+
labelKey: "summary.label.description",
|
|
16
|
+
value: formatString(settings.description, empty),
|
|
17
|
+
},
|
|
18
|
+
{ labelKey: "summary.label.database", value: settings.database },
|
|
19
|
+
{
|
|
20
|
+
labelKey: "summary.label.javascript",
|
|
21
|
+
value: formatBoolean(settings.javascript),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
labelKey: "summary.label.agents",
|
|
25
|
+
value: formatList(settings.agents, empty),
|
|
26
|
+
},
|
|
27
|
+
{ labelKey: "summary.label.locale", value: settings.locale },
|
|
28
|
+
{
|
|
29
|
+
labelKey: "summary.label.packageManager",
|
|
30
|
+
value: settings.packageManager,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
labelKey: "summary.label.jugglingProject",
|
|
34
|
+
value: settings.jugglingProject ?? empty,
|
|
35
|
+
},
|
|
36
|
+
{ labelKey: "summary.outputDir", value: outputDir },
|
|
37
|
+
];
|
|
38
|
+
const labels = rows.map((r) => getMessage(r.labelKey, locale));
|
|
39
|
+
const maxLabelWidth = Math.max(...labels.map((l) => displayWidth(l)));
|
|
40
|
+
return rows
|
|
41
|
+
.map((row, i) => {
|
|
42
|
+
const label = labels[i];
|
|
43
|
+
const pad = " ".repeat(Math.max(0, maxLabelWidth - displayWidth(label)));
|
|
44
|
+
return `${label}${pad} : ${row.value}`;
|
|
45
|
+
})
|
|
46
|
+
.join("\n");
|
|
47
|
+
};
|
|
48
|
+
export const printSummary = (settings, outputDir, locale) => {
|
|
49
|
+
p.note(buildSummaryBody(settings, outputDir, locale), getMessage("summary.heading", locale));
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intra-mart/accel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-dev.202605220447",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool for intra-mart Accel Platform development",
|
|
6
6
|
"author": "NTT DATA INTRAMART",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"prepublishOnly": "tsc"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@clack/prompts": "^
|
|
42
|
+
"@clack/prompts": "^1.4.0",
|
|
43
43
|
"citty": "^0.1.6",
|
|
44
44
|
"fast-xml-parser": "^5.2.0",
|
|
45
45
|
"remark": "^15.0.1",
|