@intra-mart/accel 1.0.0 → 2.0.0-dev.202610210621
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 +93 -6
- package/dist/asset/deployer.js +1 -2
- package/dist/asset/fetch-once.d.ts +2 -0
- package/dist/asset/fetch-once.js +14 -0
- package/dist/asset/mobile-meta.d.ts +15 -0
- package/dist/asset/mobile-meta.js +86 -0
- package/dist/asset/root-selection.d.ts +12 -0
- package/dist/asset/root-selection.js +78 -0
- package/dist/asset/updater.js +1 -1
- package/dist/asset/walker.d.ts +1 -1
- package/dist/asset/walker.js +3 -26
- package/dist/commands/attach-existing-files.d.ts +12 -0
- package/dist/commands/attach-existing-files.js +76 -0
- package/dist/commands/attach.d.ts +20 -0
- package/dist/commands/attach.js +77 -77
- package/dist/commands/deploy.js +16 -13
- package/dist/commands/detach.js +7 -3
- package/dist/commands/init.d.ts +20 -0
- package/dist/commands/init.js +71 -4
- package/dist/commands/login.js +12 -6
- package/dist/commands/mobile/attach.d.ts +7 -0
- package/dist/commands/mobile/attach.js +60 -0
- package/dist/commands/mobile/init.d.ts +4 -0
- package/dist/commands/mobile/init.js +95 -0
- package/dist/commands/mobile/shared.d.ts +65 -0
- package/dist/commands/mobile/shared.js +254 -0
- package/dist/commands/mobile/update.d.ts +8 -0
- package/dist/commands/mobile/update.js +109 -0
- package/dist/commands/mobile-sdk-options.d.ts +10 -0
- package/dist/commands/mobile-sdk-options.js +19 -0
- package/dist/commands/preset.d.ts +1 -1
- package/dist/commands/preset.js +35 -13
- package/dist/commands/project-type-select.d.ts +17 -0
- package/dist/commands/project-type-select.js +26 -0
- package/dist/commands/switch.d.ts +1 -1
- package/dist/commands/switch.js +118 -48
- package/dist/commands/update.d.ts +22 -0
- package/dist/commands/update.js +179 -106
- package/dist/core/condition-evaluator.js +4 -1
- package/dist/core/constants.d.ts +12 -2
- package/dist/core/constants.js +16 -0
- package/dist/core/eval-context.js +27 -0
- package/dist/core/project-type.d.ts +20 -0
- package/dist/core/project-type.js +49 -0
- package/dist/core/types.d.ts +28 -9
- package/dist/core/types.js +2 -0
- package/dist/core/validation.d.ts +2 -2
- package/dist/core/validators.d.ts +7 -0
- package/dist/core/validators.js +38 -1
- package/dist/core/variable-interpolator.js +2 -0
- package/dist/i18n/en.js +59 -0
- package/dist/i18n/ja.js +59 -0
- package/dist/i18n/zh_CN.js +59 -0
- package/dist/interactive/agent-detect.d.ts +1 -1
- package/dist/interactive/agent-detect.js +6 -6
- package/dist/interactive/mobile-prompts.d.ts +15 -0
- package/dist/interactive/mobile-prompts.js +45 -0
- package/dist/interactive/next-steps.d.ts +4 -0
- package/dist/interactive/next-steps.js +11 -0
- package/dist/interactive/prompts.d.ts +5 -2
- package/dist/interactive/prompts.js +23 -19
- package/dist/interactive/summary.d.ts +5 -3
- package/dist/interactive/summary.js +38 -0
- package/dist/lib.d.ts +11 -5
- package/dist/lib.js +6 -3
- package/dist/utils/args.d.ts +1 -0
- package/dist/utils/args.js +16 -0
- package/dist/utils/expo-project.d.ts +8 -0
- package/dist/utils/expo-project.js +54 -0
- package/dist/utils/external-command.d.ts +68 -0
- package/dist/utils/external-command.js +238 -0
- package/dist/utils/preset-io.d.ts +1 -0
- package/dist/utils/preset-io.js +18 -1
- package/dist/utils/settings-io.d.ts +1 -0
- package/dist/utils/settings-io.js +12 -0
- package/package.json +1 -1
|
@@ -15,6 +15,13 @@ export type ReleaseValidators = {
|
|
|
15
15
|
feature: Validator;
|
|
16
16
|
};
|
|
17
17
|
export declare const createValidators: (locale: string) => Validators;
|
|
18
|
+
export type MobileValidators = {
|
|
19
|
+
projectType: Validator;
|
|
20
|
+
mobileName: Validator;
|
|
21
|
+
expoSdk: Validator;
|
|
22
|
+
agent: Validator;
|
|
23
|
+
};
|
|
24
|
+
export declare const createMobileValidators: (locale: string) => MobileValidators;
|
|
18
25
|
export declare const PRESET_NAME_PATTERN: RegExp;
|
|
19
26
|
export declare const createPresetNameValidator: (locale: string) => Validator;
|
|
20
27
|
export declare const createReleaseValidators: (locale: string, release: Release) => ReleaseValidators;
|
package/dist/core/validators.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getMessage } from "../i18n/index.js";
|
|
2
|
-
import { AGENT_OPTIONS, DATABASE_OPTIONS, PACKAGE_MANAGER_OPTIONS, } from "./constants.js";
|
|
2
|
+
import { AGENT_OPTIONS, DATABASE_OPTIONS, MOBILE_AGENT_OPTIONS, PACKAGE_MANAGER_OPTIONS, PROJECT_TYPE_OPTIONS, } from "./constants.js";
|
|
3
3
|
import { findReleaseById } from "./catalog.js";
|
|
4
4
|
const ARTIFACT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
5
5
|
const GROUP_PATTERN = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/;
|
|
@@ -75,6 +75,43 @@ export const createValidators = (locale) => ({
|
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
|
+
const MOBILE_NAME_PATTERN = /^[a-z0-9][a-z0-9@._-]*$/;
|
|
79
|
+
const EXPO_SDK_PATTERN = /^[0-9]+$/;
|
|
80
|
+
export const createMobileValidators = (locale) => ({
|
|
81
|
+
projectType: (value) => {
|
|
82
|
+
const v = value ?? "";
|
|
83
|
+
return PROJECT_TYPE_OPTIONS.includes(v)
|
|
84
|
+
? undefined
|
|
85
|
+
: getMessage("error.invalidProjectType", locale, { value: v });
|
|
86
|
+
},
|
|
87
|
+
mobileName: (value) => {
|
|
88
|
+
const v = value ?? "";
|
|
89
|
+
if (!isValidName(v)) {
|
|
90
|
+
return getMessage("error.invalidName", locale, { value: v });
|
|
91
|
+
}
|
|
92
|
+
return MOBILE_NAME_PATTERN.test(v)
|
|
93
|
+
? undefined
|
|
94
|
+
: getMessage("error.invalidMobileName", locale, { value: v });
|
|
95
|
+
},
|
|
96
|
+
expoSdk: (value) => {
|
|
97
|
+
const v = value ?? "";
|
|
98
|
+
return EXPO_SDK_PATTERN.test(v)
|
|
99
|
+
? undefined
|
|
100
|
+
: getMessage("error.invalidExpoSdk", locale, { value: v });
|
|
101
|
+
},
|
|
102
|
+
agent: (value) => {
|
|
103
|
+
const v = value ?? "";
|
|
104
|
+
if (!isValidAgent(v)) {
|
|
105
|
+
return getMessage("error.invalidAgent", locale, { agent: v });
|
|
106
|
+
}
|
|
107
|
+
return MOBILE_AGENT_OPTIONS.includes(v)
|
|
108
|
+
? undefined
|
|
109
|
+
: getMessage("error.agentNotForMobile", locale, {
|
|
110
|
+
agent: v,
|
|
111
|
+
agents: MOBILE_AGENT_OPTIONS.join(", "),
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
});
|
|
78
115
|
export const PRESET_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
79
116
|
export const createPresetNameValidator = (locale) => (value) => {
|
|
80
117
|
const v = value ?? "";
|
|
@@ -11,6 +11,8 @@ const VARIABLE_RESOLVERS = new Map([
|
|
|
11
11
|
["database", (c) => c.database],
|
|
12
12
|
["projectVersion", (c) => c.projectVersion],
|
|
13
13
|
["packageManager", (c) => c.packageManager],
|
|
14
|
+
["projectType", (c) => c.projectType],
|
|
15
|
+
["expoSdk", (c) => c.expoSdk],
|
|
14
16
|
["ensureCommand", (c) => ensureCommandFor(c.packageManager)],
|
|
15
17
|
["gitignoreEntries", () => GITIGNORE_ENTRIES_VARIABLE_VALUE],
|
|
16
18
|
]);
|
package/dist/i18n/en.js
CHANGED
|
@@ -153,9 +153,17 @@ export const messages = {
|
|
|
153
153
|
"preset.error.parse": "Cannot be parsed as JSON: {message}",
|
|
154
154
|
"preset.error.field": "Field {field} is missing or is not an array of strings",
|
|
155
155
|
"preset.error.nameMismatch": "The name value ({value}) does not match the file name ({name})",
|
|
156
|
+
"preset.error.mobileModules": "modules / features must be empty in presets for mobile projects",
|
|
156
157
|
"preset.error.conflictingFlags": "--preset cannot be combined with --module / --feature / --agent.",
|
|
157
158
|
"error.directoryExists": "Directory already exists: {path}",
|
|
158
159
|
"error.accelExists": ".accel directory already exists",
|
|
160
|
+
"error.unknownProjectType": "This CLI does not support the project type ({value}). Update the CLI to the latest version.",
|
|
161
|
+
"error.invalidProjectType": "The project type must be iap or mobile: {value}",
|
|
162
|
+
"error.optionNotForProjectType.iap": "The following options cannot be used for iAP projects: {options}",
|
|
163
|
+
"error.optionNotForProjectType.mobile": "The following options cannot be used for mobile projects: {options}",
|
|
164
|
+
"error.invalidMobileName": "A mobile project name may contain only lowercase letters, digits, and @ . _ -, and must start with a lowercase letter or a digit: {value}",
|
|
165
|
+
"error.invalidExpoSdk": "Specify the Expo SDK as a major version number (e.g. 56): {value}",
|
|
166
|
+
"deploy.error.mobileProject": "deploy is not available for mobile projects.",
|
|
159
167
|
"error.accelNotFound": ".accel directory not found",
|
|
160
168
|
"error.missingRequiredOptions": "The following required options are missing: {options}",
|
|
161
169
|
"error.initNameArgumentMissing": "Project name is not specified. Provide it as an argument (e.g., accel init my-project)",
|
|
@@ -165,6 +173,7 @@ export const messages = {
|
|
|
165
173
|
"error.jugglingVersionUnknown": "The juggling.im version {version} is not in the catalog.",
|
|
166
174
|
"error.invalidDatabase": "Invalid database: {database}",
|
|
167
175
|
"error.invalidAgent": "Invalid agent: {agent}",
|
|
176
|
+
"error.agentNotForMobile": "{agent} cannot be selected for mobile projects (available agents: {agents})",
|
|
168
177
|
"error.invalidPackageManager": "Invalid package manager (expected one of bun, npm, yarn, pnpm): {packageManager}",
|
|
169
178
|
"error.invalidName": "Project name contains invalid characters for a directory name, or is empty: {value}",
|
|
170
179
|
"error.invalidArtifactId": "Artifact ID violates Maven naming rules (^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
@@ -238,6 +247,11 @@ export const messages = {
|
|
|
238
247
|
"error.dependencies.packageJsonMissing": "The asset dependency directory {dir} has no package.json.",
|
|
239
248
|
"error.dependencies.invalidRenameTarget": "rename.to \"{to}\" in the asset dependency directory {dir} must be package.json or a lockfile name.",
|
|
240
249
|
"error.dependencies.rootNotAllowed": "The asset dependency directory {dir} cannot be deployed to the project root, .accel, or .git. Place it under a skills directory.",
|
|
250
|
+
"error.mobileMeta.invalid": "{field} in _meta.json of the mobile directory {dir} is invalid. The asset repository may be incomplete.",
|
|
251
|
+
"error.mobileMeta.duplicateSdk": "The asset repository has more than one directory for Expo SDK {sdk} ({dirs}). The asset repository may be incomplete.",
|
|
252
|
+
"error.mobileAssetsNotFound": "The asset repository has no assets for mobile projects.",
|
|
253
|
+
"error.mobileAssetsNotForTarget": "No mobile assets are available for the target iAP version {version}.",
|
|
254
|
+
"error.mobileSdkNotAvailable": "No assets are available for Expo SDK {sdk}. Available SDKs: {available}",
|
|
241
255
|
"deploy.intro": "Accel CLI - deploy",
|
|
242
256
|
"deploy.progress.fetchingStagings": "Fetching staging environments...",
|
|
243
257
|
"deploy.progress.deploying": "Deploying...",
|
|
@@ -297,4 +311,49 @@ export const messages = {
|
|
|
297
311
|
"deploy.sampleSetup.aborted": "The remaining setup steps were aborted due to a preprocessing failure.",
|
|
298
312
|
"deploy.sampleSetup.error": "An error occurred during sample data setup: {message}",
|
|
299
313
|
"deploy.sampleSetup.noneFound": "No sample data setup configs were found in the deployed archives. Skipping execution.",
|
|
314
|
+
"intro.common": "Generate a project for iAP (intra-mart Accel Platform) module development, or for a mobile app that works with iAP,\ntogether with assets for Claude Code / Codex / GitHub Copilot.\nFirst, choose the project type.",
|
|
315
|
+
"intro.attachCommon": "Deploy assets for Claude Code / Codex / GitHub Copilot to the current directory.\nFirst, choose the project type.",
|
|
316
|
+
"intro.mobile": "Create a mobile app project (Expo + smartlime) that works with iAP.\ncreate-expo generates the app, then assets for Claude Code / Codex are deployed.\nA few questions follow; everything is then created in one go.",
|
|
317
|
+
"intro.mobileSwitch": "Switch only the agent configuration while keeping the recorded commit.\nNothing is downloaded from the repository, and upstream changes are not applied.\nFiles you have edited are left unchanged.",
|
|
318
|
+
"intro.mobileAttach": "Deploy assets for developing a mobile app that works with iAP\nto the Expo project in the current directory.\nA few questions follow; everything is then deployed in one go.",
|
|
319
|
+
"prompt.projectType": "Select the project type",
|
|
320
|
+
"prompt.projectType.hint": "Choose iAP module development, or development of a mobile app (Expo + smartlime) that works with iAP",
|
|
321
|
+
"prompt.projectType.iap": "iAP project",
|
|
322
|
+
"prompt.projectType.mobile": "Mobile project (Expo + smartlime)",
|
|
323
|
+
"prompt.mobileName": "Enter project name",
|
|
324
|
+
"prompt.mobileName.hint": "Used as the directory name and as the app name (set by create-expo)\nLowercase letters, digits, and @ . _ - are allowed; start with a lowercase letter or a digit (e.g. field-report)",
|
|
325
|
+
"prompt.targetAccelplatformVersion": "Select the iAP version the app works with",
|
|
326
|
+
"prompt.targetAccelplatformVersion.hint": "The iAP version the app works with. The deployed assets change with the APIs available",
|
|
327
|
+
"prompt.mobileAgent": "Select agent",
|
|
328
|
+
"prompt.mobileAgent.hint": "Instructions and skills for the selected agents are deployed\nChoosing Codex also lets you install the official Expo skills",
|
|
329
|
+
"prompt.expoSdk": "Select the Expo SDK",
|
|
330
|
+
"prompt.expoSdk.hint": "The SDK targeted by the create-expo template and the deployed assets. Only SDKs supported by smartlime are listed",
|
|
331
|
+
"prompt.expoSdk.option": "Expo SDK {sdk}",
|
|
332
|
+
"prompt.expoSkills": "Install the official Expo skills?",
|
|
333
|
+
"prompt.expoSkills.hint": "Fetched from github.com/{source} for Codex and placed in .agents/skills\nCommand: {command}",
|
|
334
|
+
"prompt.mobileConfirm.init": "Create the project with these settings?",
|
|
335
|
+
"prompt.mobileConfirm.attach": "Deploy the assets with these settings?",
|
|
336
|
+
"mobile.cancelled": "Cancelled.",
|
|
337
|
+
"summary.label.targetAccelplatformVersion": "Target iAP version",
|
|
338
|
+
"summary.label.expoSdk": "Expo SDK",
|
|
339
|
+
"summary.label.externalCommands": "Commands to run",
|
|
340
|
+
"summary.externalNote": "The commands above fetch external packages from the npm registry and other sources and run them.",
|
|
341
|
+
"progress.createExpo": "Running create-expo...",
|
|
342
|
+
"progress.expoSkills": "Installing the official Expo skills...",
|
|
343
|
+
"error.externalRunnerNotFound": "{command} was not found. Install it and run again.",
|
|
344
|
+
"hint.packageManagerOption": "You can also choose another package manager with --package-manager (e.g. --package-manager npm).",
|
|
345
|
+
"error.createExpoFailed": "create-expo failed: {command}\nIf {dir} was created, check its contents, remove it, and run again.\n{output}",
|
|
346
|
+
"warning.createExpoInstallIncomplete": "Installing dependencies may not have completed. Run {command} in the project.",
|
|
347
|
+
"warning.expoSkillsNotRun": "The official Expo skills could not be installed because {missing} was not found. If needed, run: {command}",
|
|
348
|
+
"warning.expoSkillsFailed": "Failed to install the official Expo skills. If needed, run: {command}\n{output}",
|
|
349
|
+
"error.expoSkillsFlagRequired": "In non-interactive mode, specify --expo-skills or --no-expo-skills (whether to install the official Expo skills for Codex).",
|
|
350
|
+
"attach.error.notExpoProject": "The current directory is not an Expo project (package.json has no expo dependency).",
|
|
351
|
+
"warning.expoSdkNotAvailable": "No assets are available for Expo SDK {sdk} in package.json. Choose from the available SDKs.",
|
|
352
|
+
"nextSteps.mobile.commit": "Review and commit the deployed assets (git add -A && git commit)",
|
|
353
|
+
"nextSteps.mobile.start": "Start the development server with {command}",
|
|
354
|
+
"mobile.expoSkills.hint": "The official Expo skills for Codex can be installed with: {command}",
|
|
355
|
+
"update.prompt.followExpoSdk": "Expo in package.json is SDK {detected} (the previously deployed assets are for SDK {recorded}). Switch the assets to SDK {detected}?",
|
|
356
|
+
"update.warning.expoSdkMismatch": "Expo in package.json is SDK {detected}, but the assets will be updated for the previous SDK {recorded}. To switch, specify --expo-sdk {detected}.",
|
|
357
|
+
"update.warning.expoSdkNoAssets": "No assets are available for Expo SDK {detected} in package.json, so the assets will be updated for the previous SDK {recorded}.",
|
|
358
|
+
"update.hint.expoSdk": "Switch to an available SDK with --expo-sdk, and update the app's Expo SDK as well.",
|
|
300
359
|
};
|
package/dist/i18n/ja.js
CHANGED
|
@@ -153,9 +153,17 @@ export const messages = {
|
|
|
153
153
|
"preset.error.parse": "JSONとして解析できません: {message}",
|
|
154
154
|
"preset.error.field": "フィールド {field} が存在しないか、文字列の配列ではありません",
|
|
155
155
|
"preset.error.nameMismatch": "name の値 ({value}) がファイル名 ({name}) と一致しません",
|
|
156
|
+
"preset.error.mobileModules": "モバイルプロジェクトのプリセットでは modules / features を空にしてください",
|
|
156
157
|
"preset.error.conflictingFlags": "--preset と --module / --feature / --agent は同時に指定できません。",
|
|
157
158
|
"error.directoryExists": "ディレクトリが既に存在します: {path}",
|
|
158
159
|
"error.accelExists": ".accelディレクトリが既に存在します",
|
|
160
|
+
"error.unknownProjectType": "この CLI が対応していないプロジェクト種別です({value})。CLI を最新版に更新してください。",
|
|
161
|
+
"error.invalidProjectType": "プロジェクト種別は iap / mobile のいずれかを指定してください: {value}",
|
|
162
|
+
"error.optionNotForProjectType.iap": "iAP プロジェクトでは次のオプションを指定できません: {options}",
|
|
163
|
+
"error.optionNotForProjectType.mobile": "モバイルプロジェクトでは次のオプションを指定できません: {options}",
|
|
164
|
+
"error.invalidMobileName": "モバイルプロジェクトの名前には英小文字・数字・@ . _ - のみ使用でき、先頭は英小文字か数字にしてください: {value}",
|
|
165
|
+
"error.invalidExpoSdk": "Expo SDK はメジャーバージョンの数字で指定してください(例: 56): {value}",
|
|
166
|
+
"deploy.error.mobileProject": "モバイルプロジェクトでは deploy を利用できません。",
|
|
159
167
|
"error.accelNotFound": ".accelディレクトリが見つかりません",
|
|
160
168
|
"error.missingRequiredOptions": "以下の必須オプションが指定されていません: {options}",
|
|
161
169
|
"error.initNameArgumentMissing": "プロジェクト名が指定されていません。引数で指定してください(例: accel init my-project)",
|
|
@@ -165,6 +173,7 @@ export const messages = {
|
|
|
165
173
|
"error.jugglingVersionUnknown": "juggling.imのバージョン {version} はカタログに存在しません。",
|
|
166
174
|
"error.invalidDatabase": "無効なデータベースです: {database}",
|
|
167
175
|
"error.invalidAgent": "無効なエージェントです: {agent}",
|
|
176
|
+
"error.agentNotForMobile": "モバイルプロジェクトでは {agent} を選べません(選べるエージェント: {agents})",
|
|
168
177
|
"error.invalidPackageManager": "無効なパッケージマネージャです(bun, npm, yarn, pnpm のいずれかを指定してください): {packageManager}",
|
|
169
178
|
"error.invalidName": "プロジェクト名にディレクトリ名として使用できない文字が含まれています、または空です: {value}",
|
|
170
179
|
"error.invalidArtifactId": "アーティファクトIDが Maven の規約に違反しています(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
@@ -238,6 +247,11 @@ export const messages = {
|
|
|
238
247
|
"error.dependencies.packageJsonMissing": "資材の依存ディレクトリ {dir} に package.json がありません。",
|
|
239
248
|
"error.dependencies.invalidRenameTarget": "資材の依存ディレクトリ {dir} の rename.to \"{to}\" は package.json またはロックファイル名でなければなりません。",
|
|
240
249
|
"error.dependencies.rootNotAllowed": "資材の依存ディレクトリ {dir} はプロジェクトルート直下・.accel・.git には配備できません。skills のディレクトリ配下に置いてください。",
|
|
250
|
+
"error.mobileMeta.invalid": "モバイル用ディレクトリ {dir} の _meta.json で {field} が不正です。資材リポジトリの不備の可能性があります。",
|
|
251
|
+
"error.mobileMeta.duplicateSdk": "資材リポジトリに Expo SDK {sdk} 用のディレクトリが複数あります({dirs})。資材リポジトリの不備の可能性があります。",
|
|
252
|
+
"error.mobileAssetsNotFound": "この資材リポジトリにはモバイル用の資材がありません。",
|
|
253
|
+
"error.mobileAssetsNotForTarget": "連携先 iAP バージョン {version} に対応するモバイル用の資材がありません。",
|
|
254
|
+
"error.mobileSdkNotAvailable": "Expo SDK {sdk} 用の資材がありません。配備できる SDK: {available}",
|
|
241
255
|
"deploy.intro": "Accel CLI - deploy",
|
|
242
256
|
"deploy.progress.fetchingStagings": "ステージング環境を取得しています...",
|
|
243
257
|
"deploy.progress.deploying": "デプロイしています...",
|
|
@@ -297,4 +311,49 @@ export const messages = {
|
|
|
297
311
|
"deploy.sampleSetup.aborted": "前処理の失敗により、以降のセットアップ処理は中断されました。",
|
|
298
312
|
"deploy.sampleSetup.error": "サンプルデータセットアップの実行中にエラーが発生しました: {message}",
|
|
299
313
|
"deploy.sampleSetup.noneFound": "サンプルデータセットアップ設定が資材内に見つかりませんでした。実行をスキップします。",
|
|
314
|
+
"intro.common": "iAP(intra-mart Accel Platform)のモジュール開発、または iAP と連携するモバイルアプリ開発のプロジェクトと、\nClaude Code / Codex / GitHub Copilot 向けの資材を生成します。\nはじめにプロジェクトの種別を選んでください。",
|
|
315
|
+
"intro.attachCommon": "カレントディレクトリに Claude Code / Codex / GitHub Copilot 向けの資材を配備します。\nはじめにプロジェクトの種別を選んでください。",
|
|
316
|
+
"intro.mobile": "iAP と連携するモバイルアプリ(Expo + smartlime)のプロジェクトを作成します。\ncreate-expo でアプリの雛形を作り、Claude Code / Codex 向けの資材を配備します。\nいくつか質問した後、最後に一括で作成します。",
|
|
317
|
+
"intro.mobileSwitch": "記録されたコミットを固定したまま、エージェントの構成のみを切り替えます。\nリポジトリからのダウンロードは発生せず、リポジトリ側の更新も取り込みません。\nユーザーが編集したファイルには変更を加えません。",
|
|
318
|
+
"intro.mobileAttach": "カレントディレクトリの Expo プロジェクトに、\niAP と連携するモバイルアプリ開発向けの資材を配備します。\nいくつか質問した後、最後に一括で配備します。",
|
|
319
|
+
"prompt.projectType": "プロジェクトの種別を選択してください",
|
|
320
|
+
"prompt.projectType.hint": "iAP のモジュール開発か、iAP と連携するモバイルアプリ(Expo + smartlime)の開発かを選びます",
|
|
321
|
+
"prompt.projectType.iap": "iAP プロジェクト",
|
|
322
|
+
"prompt.projectType.mobile": "モバイルプロジェクト(Expo + smartlime)",
|
|
323
|
+
"prompt.mobileName": "プロジェクト名を入力してください",
|
|
324
|
+
"prompt.mobileName.hint": "ディレクトリ名と、アプリの名前(create-expo が設定)に使われます\n英小文字・数字・@ . _ - が使え、先頭は英小文字か数字です(例: field-report)",
|
|
325
|
+
"prompt.targetAccelplatformVersion": "連携する iAP のバージョンを選択してください",
|
|
326
|
+
"prompt.targetAccelplatformVersion.hint": "アプリが連携する iAP のバージョン。呼び出せる API に合わせて資材の内容が変わります",
|
|
327
|
+
"prompt.mobileAgent": "エージェントを選択してください",
|
|
328
|
+
"prompt.mobileAgent.hint": "選択したエージェント向けの指示書や skills を配備します\nCodex を選ぶと、Expo 公式 skills も導入できます",
|
|
329
|
+
"prompt.expoSdk": "Expo SDK を選択してください",
|
|
330
|
+
"prompt.expoSdk.hint": "create-expo のテンプレートと、配備する資材が対象とする SDK です。smartlime が対応する SDK だけが選択肢に出ます",
|
|
331
|
+
"prompt.expoSdk.option": "Expo SDK {sdk}",
|
|
332
|
+
"prompt.expoSkills": "Expo 公式 skills を導入しますか?",
|
|
333
|
+
"prompt.expoSkills.hint": "Codex 向けに github.com/{source} から取得し、.agents/skills に配置します\n実行するコマンド: {command}",
|
|
334
|
+
"prompt.mobileConfirm.init": "この内容でプロジェクトを作成しますか?",
|
|
335
|
+
"prompt.mobileConfirm.attach": "この内容で資材を配備しますか?",
|
|
336
|
+
"mobile.cancelled": "キャンセルしました。",
|
|
337
|
+
"summary.label.targetAccelplatformVersion": "連携先 iAP バージョン",
|
|
338
|
+
"summary.label.expoSdk": "Expo SDK",
|
|
339
|
+
"summary.label.externalCommands": "実行するコマンド",
|
|
340
|
+
"summary.externalNote": "上記のコマンドは、外部パッケージを npm レジストリなどから取得して実行します。",
|
|
341
|
+
"progress.createExpo": "create-expo を実行しています...",
|
|
342
|
+
"progress.expoSkills": "Expo 公式 skills を導入しています...",
|
|
343
|
+
"error.externalRunnerNotFound": "{command} が見つかりません。インストールしてから再実行してください。",
|
|
344
|
+
"hint.packageManagerOption": "--package-manager で別のパッケージマネージャを指定することもできます(例: --package-manager npm)。",
|
|
345
|
+
"error.createExpoFailed": "create-expo の実行に失敗しました: {command}\n{dir} が作成されている場合は、内容を確認して削除してから再実行してください。\n{output}",
|
|
346
|
+
"warning.createExpoInstallIncomplete": "依存のインストールが完了していない可能性があります。プロジェクトで {command} を実行してください。",
|
|
347
|
+
"warning.expoSkillsNotRun": "{missing} が見つからないため、Expo 公式 skills を導入できませんでした。必要なら次のコマンドを実行してください: {command}",
|
|
348
|
+
"warning.expoSkillsFailed": "Expo 公式 skills の導入に失敗しました。必要なら次のコマンドを実行してください: {command}\n{output}",
|
|
349
|
+
"error.expoSkillsFlagRequired": "非対話モードでは --expo-skills か --no-expo-skills のどちらかを指定してください(Codex に Expo 公式 skills を導入するか)。",
|
|
350
|
+
"attach.error.notExpoProject": "カレントディレクトリは Expo プロジェクトではありません(package.json に expo の依存がありません)。",
|
|
351
|
+
"warning.expoSdkNotAvailable": "package.json の Expo SDK {sdk} に対応する資材がありません。配備できる SDK から選んでください。",
|
|
352
|
+
"nextSteps.mobile.commit": "配備した資材を確認してコミットしてください(git add -A && git commit)",
|
|
353
|
+
"nextSteps.mobile.start": "{command} で開発サーバーを起動してください",
|
|
354
|
+
"mobile.expoSkills.hint": "Codex 向けの Expo 公式 skills は次のコマンドで導入できます: {command}",
|
|
355
|
+
"update.prompt.followExpoSdk": "package.json の Expo は SDK {detected} です(前回配備した資材は SDK {recorded} 用)。資材を SDK {detected} 用に切り替えますか?",
|
|
356
|
+
"update.warning.expoSdkMismatch": "package.json の Expo は SDK {detected} ですが、前回と同じ SDK {recorded} 用の資材で更新します。切り替えるには --expo-sdk {detected} を指定してください。",
|
|
357
|
+
"update.warning.expoSdkNoAssets": "package.json の Expo SDK {detected} に対応する資材がないため、前回と同じ SDK {recorded} 用の資材で更新します。",
|
|
358
|
+
"update.hint.expoSdk": "配備できる SDK に --expo-sdk で切り替えてください。その際はアプリ側の Expo SDK も合わせて更新してください。",
|
|
300
359
|
};
|
package/dist/i18n/zh_CN.js
CHANGED
|
@@ -153,9 +153,17 @@ export const messages = {
|
|
|
153
153
|
"preset.error.parse": "无法解析为JSON: {message}",
|
|
154
154
|
"preset.error.field": "字段 {field} 不存在或不是字符串数组",
|
|
155
155
|
"preset.error.nameMismatch": "name 的值 ({value}) 与文件名 ({name}) 不一致",
|
|
156
|
+
"preset.error.mobileModules": "移动端项目的预设中 modules / features 必须为空",
|
|
156
157
|
"preset.error.conflictingFlags": "--preset 不能与 --module / --feature / --agent 同时指定。",
|
|
157
158
|
"error.directoryExists": "目录已存在: {path}",
|
|
158
159
|
"error.accelExists": ".accel目录已存在",
|
|
160
|
+
"error.unknownProjectType": "此 CLI 不支持该项目类型({value})。请将 CLI 更新到最新版本。",
|
|
161
|
+
"error.invalidProjectType": "项目类型必须为 iap 或 mobile:{value}",
|
|
162
|
+
"error.optionNotForProjectType.iap": "iAP 项目不能指定以下选项:{options}",
|
|
163
|
+
"error.optionNotForProjectType.mobile": "移动端项目不能指定以下选项:{options}",
|
|
164
|
+
"error.invalidMobileName": "移动端项目名称只能包含小写字母、数字以及 @ . _ -,且必须以小写字母或数字开头:{value}",
|
|
165
|
+
"error.invalidExpoSdk": "请以主版本号指定 Expo SDK(例如 56):{value}",
|
|
166
|
+
"deploy.error.mobileProject": "移动端项目不能使用 deploy。",
|
|
159
167
|
"error.accelNotFound": "未找到.accel目录",
|
|
160
168
|
"error.missingRequiredOptions": "以下必需选项未指定: {options}",
|
|
161
169
|
"error.initNameArgumentMissing": "未指定项目名称。请作为参数指定(例如: accel init my-project)",
|
|
@@ -165,6 +173,7 @@ export const messages = {
|
|
|
165
173
|
"error.jugglingVersionUnknown": "juggling.im 的版本 {version} 不存在于目录中。",
|
|
166
174
|
"error.invalidDatabase": "无效的数据库: {database}",
|
|
167
175
|
"error.invalidAgent": "无效的代理: {agent}",
|
|
176
|
+
"error.agentNotForMobile": "移动端项目中不能选择 {agent}(可选择的代理: {agents})",
|
|
168
177
|
"error.invalidPackageManager": "无效的包管理器(必须是 bun、npm、yarn、pnpm 之一): {packageManager}",
|
|
169
178
|
"error.invalidName": "项目名称包含不能用作目录名的字符或为空: {value}",
|
|
170
179
|
"error.invalidArtifactId": "构件ID违反Maven命名规则(^[A-Za-z0-9][A-Za-z0-9._-]*$): {value}",
|
|
@@ -238,6 +247,11 @@ export const messages = {
|
|
|
238
247
|
"error.dependencies.packageJsonMissing": "资材依赖目录 {dir} 中没有 package.json。",
|
|
239
248
|
"error.dependencies.invalidRenameTarget": "资材依赖目录 {dir} 中的 rename.to \"{to}\" 必须是 package.json 或锁文件名。",
|
|
240
249
|
"error.dependencies.rootNotAllowed": "资材依赖目录 {dir} 不能部署到项目根目录、.accel 或 .git。请放在 skills 目录下。",
|
|
250
|
+
"error.mobileMeta.invalid": "移动端目录 {dir} 的 _meta.json 中 {field} 无效。资源仓库可能不完整。",
|
|
251
|
+
"error.mobileMeta.duplicateSdk": "资源仓库中有多个面向 Expo SDK {sdk} 的目录({dirs})。资源仓库可能不完整。",
|
|
252
|
+
"error.mobileAssetsNotFound": "该资源仓库中没有面向移动端项目的资源。",
|
|
253
|
+
"error.mobileAssetsNotForTarget": "没有面向联动 iAP 版本 {version} 的移动端资源。",
|
|
254
|
+
"error.mobileSdkNotAvailable": "没有面向 Expo SDK {sdk} 的资源。可部署的 SDK:{available}",
|
|
241
255
|
"deploy.intro": "Accel CLI - deploy",
|
|
242
256
|
"deploy.progress.fetchingStagings": "正在获取暂存环境...",
|
|
243
257
|
"deploy.progress.deploying": "正在部署...",
|
|
@@ -297,4 +311,49 @@ export const messages = {
|
|
|
297
311
|
"deploy.sampleSetup.aborted": "由于预处理失败,后续配置处理已中断。",
|
|
298
312
|
"deploy.sampleSetup.error": "执行示例数据配置时发生错误: {message}",
|
|
299
313
|
"deploy.sampleSetup.noneFound": "在部署的资材中未找到示例数据配置。跳过执行。",
|
|
314
|
+
"intro.common": "生成用于 iAP(intra-mart Accel Platform)模块开发或与 iAP 联动的移动端应用开发的项目,\n以及面向 Claude Code / Codex / GitHub Copilot 的资源。\n请先选择项目类型。",
|
|
315
|
+
"intro.attachCommon": "向当前目录部署面向 Claude Code / Codex / GitHub Copilot 的资源。\n请先选择项目类型。",
|
|
316
|
+
"intro.mobile": "创建与 iAP 联动的移动端应用(Expo + smartlime)项目。\n使用 create-expo 生成应用框架,并部署面向 Claude Code / Codex 的资源。\n将提出若干问题,最后统一创建。",
|
|
317
|
+
"intro.mobileSwitch": "在保持所记录提交的同时,仅切换代理的配置。\n不会从仓库下载,也不会引入仓库端的更新。\n不会修改用户编辑过的文件。",
|
|
318
|
+
"intro.mobileAttach": "向当前目录的 Expo 项目部署\n用于开发与 iAP 联动的移动端应用的资源。\n将提出若干问题,最后统一进行部署。",
|
|
319
|
+
"prompt.projectType": "请选择项目类型",
|
|
320
|
+
"prompt.projectType.hint": "选择 iAP 模块开发,或与 iAP 联动的移动端应用(Expo + smartlime)开发",
|
|
321
|
+
"prompt.projectType.iap": "iAP 项目",
|
|
322
|
+
"prompt.projectType.mobile": "移动端项目(Expo + smartlime)",
|
|
323
|
+
"prompt.mobileName": "请输入项目名称",
|
|
324
|
+
"prompt.mobileName.hint": "用作目录名称和应用名称(由 create-expo 设置)\n可使用小写字母、数字以及 @ . _ -,并以小写字母或数字开头(例如 field-report)",
|
|
325
|
+
"prompt.targetAccelplatformVersion": "请选择应用联动的 iAP 版本",
|
|
326
|
+
"prompt.targetAccelplatformVersion.hint": "应用联动的 iAP 版本。部署的资源会根据可调用的 API 而变化",
|
|
327
|
+
"prompt.mobileAgent": "请选择代理",
|
|
328
|
+
"prompt.mobileAgent.hint": "将部署面向所选代理的说明文件和 skills\n选择 Codex 时,还可以安装 Expo 官方 skills",
|
|
329
|
+
"prompt.expoSdk": "请选择 Expo SDK",
|
|
330
|
+
"prompt.expoSdk.hint": "create-expo 模板和所部署资源面向的 SDK。仅列出 smartlime 支持的 SDK",
|
|
331
|
+
"prompt.expoSdk.option": "Expo SDK {sdk}",
|
|
332
|
+
"prompt.expoSkills": "要安装 Expo 官方 skills 吗?",
|
|
333
|
+
"prompt.expoSkills.hint": "为 Codex 从 github.com/{source} 获取,并放置到 .agents/skills\n执行的命令:{command}",
|
|
334
|
+
"prompt.mobileConfirm.init": "按以上内容创建项目吗?",
|
|
335
|
+
"prompt.mobileConfirm.attach": "按以上内容部署资源吗?",
|
|
336
|
+
"mobile.cancelled": "已取消。",
|
|
337
|
+
"summary.label.targetAccelplatformVersion": "联动的 iAP 版本",
|
|
338
|
+
"summary.label.expoSdk": "Expo SDK",
|
|
339
|
+
"summary.label.externalCommands": "将执行的命令",
|
|
340
|
+
"summary.externalNote": "上述命令会从 npm 注册表等获取外部软件包并执行。",
|
|
341
|
+
"progress.createExpo": "正在运行 create-expo...",
|
|
342
|
+
"progress.expoSkills": "正在安装 Expo 官方 skills...",
|
|
343
|
+
"error.externalRunnerNotFound": "未找到 {command}。请安装后重新运行。",
|
|
344
|
+
"hint.packageManagerOption": "也可以使用 --package-manager 指定其他包管理器(例如 --package-manager npm)。",
|
|
345
|
+
"error.createExpoFailed": "create-expo 运行失败:{command}\n如果已创建 {dir},请检查其内容,删除后重新运行。\n{output}",
|
|
346
|
+
"warning.createExpoInstallIncomplete": "依赖安装可能未完成。请在项目中运行 {command}。",
|
|
347
|
+
"warning.expoSkillsNotRun": "由于未找到 {missing},无法安装 Expo 官方 skills。如有需要,请运行:{command}",
|
|
348
|
+
"warning.expoSkillsFailed": "安装 Expo 官方 skills 失败。如有需要,请运行:{command}\n{output}",
|
|
349
|
+
"error.expoSkillsFlagRequired": "在非交互模式下,请指定 --expo-skills 或 --no-expo-skills(是否为 Codex 安装 Expo 官方 skills)。",
|
|
350
|
+
"attach.error.notExpoProject": "当前目录不是 Expo 项目(package.json 中没有 expo 依赖)。",
|
|
351
|
+
"warning.expoSdkNotAvailable": "没有面向 package.json 中 Expo SDK {sdk} 的资源。请从可部署的 SDK 中选择。",
|
|
352
|
+
"nextSteps.mobile.commit": "请检查并提交已部署的资源(git add -A && git commit)",
|
|
353
|
+
"nextSteps.mobile.start": "使用 {command} 启动开发服务器",
|
|
354
|
+
"mobile.expoSkills.hint": "可以使用以下命令为 Codex 安装 Expo 官方 skills:{command}",
|
|
355
|
+
"update.prompt.followExpoSdk": "package.json 中的 Expo 为 SDK {detected}(之前部署的资源面向 SDK {recorded})。要将资源切换为面向 SDK {detected} 吗?",
|
|
356
|
+
"update.warning.expoSdkMismatch": "package.json 中的 Expo 为 SDK {detected},但将按之前的 SDK {recorded} 更新资源。如需切换,请指定 --expo-sdk {detected}。",
|
|
357
|
+
"update.warning.expoSdkNoAssets": "没有面向 package.json 中 Expo SDK {detected} 的资源,因此将按之前的 SDK {recorded} 更新资源。",
|
|
358
|
+
"update.hint.expoSdk": "请使用 --expo-sdk 切换到可部署的 SDK,并同时更新应用的 Expo SDK。",
|
|
300
359
|
};
|
|
@@ -4,5 +4,5 @@ type DetectedAgent = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const detectAgents: () => DetectedAgent[];
|
|
6
6
|
export declare const detectDefaultAgent: () => string;
|
|
7
|
-
export declare const detectDefaultAgents: () => string[];
|
|
7
|
+
export declare const detectDefaultAgents: (candidates?: readonly string[]) => string[];
|
|
8
8
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AGENT_OPTIONS } from "../core/constants.js";
|
|
1
2
|
import { commandExists } from "../utils/command-exists.js";
|
|
2
3
|
const AGENT_COMMANDS = [
|
|
3
4
|
{ name: "claude-code", command: "claude" },
|
|
@@ -13,10 +14,9 @@ export const detectDefaultAgent = () => {
|
|
|
13
14
|
return "github-copilot";
|
|
14
15
|
return detected[0].name;
|
|
15
16
|
};
|
|
16
|
-
export const detectDefaultAgents = () => {
|
|
17
|
-
const detected = detectAgents()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return detected.map((a) => a.name);
|
|
17
|
+
export const detectDefaultAgents = (candidates = AGENT_OPTIONS) => {
|
|
18
|
+
const detected = detectAgents()
|
|
19
|
+
.map((a) => a.name)
|
|
20
|
+
.filter((name) => candidates.includes(name));
|
|
21
|
+
return detected.length > 0 ? detected : [...candidates];
|
|
22
22
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProjectType } from "../core/types.js";
|
|
2
|
+
import type { Validator } from "../core/validators.js";
|
|
3
|
+
export type MobilePrompts = {
|
|
4
|
+
selectProjectType: (initial: ProjectType, locale: string) => Promise<ProjectType>;
|
|
5
|
+
name: (initial: string, locale: string, validate: Validator) => Promise<string>;
|
|
6
|
+
targetAccelplatformVersion: (initial: string, locale: string) => Promise<string>;
|
|
7
|
+
expoSdk: (candidates: readonly string[], initial: string | undefined, locale: string) => Promise<string>;
|
|
8
|
+
agents: (initial: string[] | undefined, locale: string) => Promise<string[]>;
|
|
9
|
+
expoSkills: (info: {
|
|
10
|
+
source: string;
|
|
11
|
+
command: string;
|
|
12
|
+
}, locale: string) => Promise<boolean>;
|
|
13
|
+
confirm: (mode: "init" | "attach", locale: string) => Promise<boolean>;
|
|
14
|
+
};
|
|
15
|
+
export declare const defaultMobilePrompts: MobilePrompts;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import { createCancelledError } from "../core/errors.js";
|
|
3
|
+
import { MOBILE_AGENT_OPTIONS, PROJECT_TYPE_OPTIONS, } from "../core/constants.js";
|
|
4
|
+
import { getMessage } from "../i18n/index.js";
|
|
5
|
+
import { withHint } from "./format.js";
|
|
6
|
+
import { promptAccelplatformVersion, promptAgents } from "./prompts.js";
|
|
7
|
+
const unwrap = (value) => {
|
|
8
|
+
if (p.isCancel(value))
|
|
9
|
+
throw createCancelledError();
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
export const defaultMobilePrompts = {
|
|
13
|
+
selectProjectType: async (initial, locale) => unwrap(await p.select({
|
|
14
|
+
message: withHint("prompt.projectType", locale),
|
|
15
|
+
options: PROJECT_TYPE_OPTIONS.map((t) => ({
|
|
16
|
+
value: t,
|
|
17
|
+
label: getMessage(`prompt.projectType.${t}`, locale),
|
|
18
|
+
})),
|
|
19
|
+
initialValue: initial,
|
|
20
|
+
})),
|
|
21
|
+
name: async (initial, locale, validate) => unwrap(await p.text({
|
|
22
|
+
message: withHint("prompt.mobileName", locale),
|
|
23
|
+
defaultValue: initial,
|
|
24
|
+
initialValue: initial,
|
|
25
|
+
validate,
|
|
26
|
+
})),
|
|
27
|
+
targetAccelplatformVersion: (initial, locale) => promptAccelplatformVersion(initial, locale, "prompt.targetAccelplatformVersion"),
|
|
28
|
+
expoSdk: async (candidates, initial, locale) => unwrap(await p.select({
|
|
29
|
+
message: withHint("prompt.expoSdk", locale),
|
|
30
|
+
options: candidates.map((sdk) => ({
|
|
31
|
+
value: sdk,
|
|
32
|
+
label: getMessage("prompt.expoSdk.option", locale, { sdk }),
|
|
33
|
+
})),
|
|
34
|
+
initialValue: initial,
|
|
35
|
+
})),
|
|
36
|
+
agents: (initial, locale) => promptAgents(initial, locale, "prompt.mobileAgent", MOBILE_AGENT_OPTIONS),
|
|
37
|
+
expoSkills: async (info, locale) => unwrap(await p.confirm({
|
|
38
|
+
message: `${getMessage("prompt.expoSkills", locale)}\n${getMessage("prompt.expoSkills.hint", locale, info)}`,
|
|
39
|
+
initialValue: true,
|
|
40
|
+
})),
|
|
41
|
+
confirm: async (mode, locale) => unwrap(await p.confirm({
|
|
42
|
+
message: getMessage(`prompt.mobileConfirm.${mode}`, locale),
|
|
43
|
+
initialValue: true,
|
|
44
|
+
})),
|
|
45
|
+
};
|
|
@@ -5,6 +5,10 @@ export type NextStepsOptions = {
|
|
|
5
5
|
isInit: boolean;
|
|
6
6
|
locale: string;
|
|
7
7
|
codexHookApproval?: boolean;
|
|
8
|
+
mobile?: {
|
|
9
|
+
packageManager: string;
|
|
10
|
+
expoSkillsCommand?: string;
|
|
11
|
+
};
|
|
8
12
|
};
|
|
9
13
|
export declare const buildNextStepsBody: (opts: NextStepsOptions) => string;
|
|
10
14
|
export declare const printNextSteps: (opts: NextStepsOptions, logger?: Logger) => void;
|
|
@@ -6,6 +6,12 @@ export const buildNextStepsBody = (opts) => {
|
|
|
6
6
|
if (opts.isInit) {
|
|
7
7
|
steps.push(getMessage("nextSteps.cd", opts.locale, { path: basename(opts.projectDir) }));
|
|
8
8
|
}
|
|
9
|
+
if (opts.mobile) {
|
|
10
|
+
steps.push(getMessage("nextSteps.mobile.commit", opts.locale));
|
|
11
|
+
steps.push(getMessage("nextSteps.mobile.start", opts.locale, {
|
|
12
|
+
command: `${opts.mobile.packageManager} run start`,
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
9
15
|
if (opts.agents.includes("claude-code")) {
|
|
10
16
|
steps.push(getMessage("nextSteps.agent.claudeCode", opts.locale));
|
|
11
17
|
}
|
|
@@ -18,6 +24,11 @@ export const buildNextStepsBody = (opts) => {
|
|
|
18
24
|
if (opts.agents.includes("github-copilot")) {
|
|
19
25
|
steps.push(getMessage("nextSteps.agent.githubCopilot", opts.locale));
|
|
20
26
|
}
|
|
27
|
+
if (opts.mobile?.expoSkillsCommand) {
|
|
28
|
+
steps.push(getMessage("mobile.expoSkills.hint", opts.locale, {
|
|
29
|
+
command: opts.mobile.expoSkillsCommand,
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
21
32
|
return steps.map((s, i) => `${i + 1}. ${s}`).join("\n");
|
|
22
33
|
};
|
|
23
34
|
export const printNextSteps = (opts, logger = createClackLogger()) => {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type Release } from "../core/catalog.js";
|
|
2
2
|
import type { Logger } from "../core/logger.js";
|
|
3
3
|
import { type PromptOptions, type ResolvedOptions } from "../core/validation.js";
|
|
4
|
-
export
|
|
4
|
+
export type IntroMode = "init" | "attach" | "update" | "switch" | "preset" | "common" | "attachCommon" | "mobile" | "mobileAttach" | "mobileSwitch";
|
|
5
|
+
export declare const printIntro: (mode: IntroMode, locale: string, logger?: Logger) => void;
|
|
6
|
+
export declare const printIntroNote: (mode: IntroMode, locale: string, logger?: Logger) => void;
|
|
5
7
|
export declare const promptModules: (release: Release, initialValues: string[], locale: string) => Promise<string[]>;
|
|
6
8
|
export declare const promptFeatures: (release: Release, initialValues: string[] | undefined, locale: string) => Promise<string[]>;
|
|
7
|
-
export declare const
|
|
9
|
+
export declare const promptAccelplatformVersion: (initialValue: string, locale: string, messageKey?: string) => Promise<string>;
|
|
10
|
+
export declare const promptAgents: (initialValues: string[] | undefined, locale: string, messageKey?: string, options?: readonly string[]) => Promise<string[]>;
|
|
8
11
|
export declare const runPrompts: (opts: PromptOptions) => Promise<ResolvedOptions>;
|
|
@@ -6,11 +6,14 @@ import { createValidators } from "../core/validators.js";
|
|
|
6
6
|
import { getMessage } from "../i18n/index.js";
|
|
7
7
|
import { withHint } from "./format.js";
|
|
8
8
|
import { createClackLogger } from "./clack-logger.js";
|
|
9
|
-
import {
|
|
9
|
+
import { detectDefaultAgents } from "./agent-detect.js";
|
|
10
10
|
import { validateNonInteractive, validateCliValues, validateCatalogValues, } from "../core/validation.js";
|
|
11
11
|
import { resolveJugglingProject } from "../juggling/resolve.js";
|
|
12
12
|
export const printIntro = (mode, locale, logger = createClackLogger()) => {
|
|
13
13
|
logger.intro("Accel CLI");
|
|
14
|
+
printIntroNote(mode, locale, logger);
|
|
15
|
+
};
|
|
16
|
+
export const printIntroNote = (mode, locale, logger = createClackLogger()) => {
|
|
14
17
|
logger.note(getMessage(`intro.${mode}`, locale));
|
|
15
18
|
};
|
|
16
19
|
export const promptModules = async (release, initialValues, locale) => {
|
|
@@ -46,15 +49,25 @@ export const promptFeatures = async (release, initialValues, locale) => {
|
|
|
46
49
|
throw createCancelledError();
|
|
47
50
|
return selected;
|
|
48
51
|
};
|
|
49
|
-
export const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
:
|
|
52
|
+
export const promptAccelplatformVersion = async (initialValue, locale, messageKey = "prompt.accelplatformVersion") => {
|
|
53
|
+
const id = (await p.select({
|
|
54
|
+
message: withHint(messageKey, locale),
|
|
55
|
+
options: getReleases().map((r) => ({
|
|
56
|
+
value: r.id,
|
|
57
|
+
label: `${r.name} (${r.version})`,
|
|
58
|
+
})),
|
|
59
|
+
initialValue,
|
|
60
|
+
}));
|
|
61
|
+
if (p.isCancel(id))
|
|
62
|
+
throw createCancelledError();
|
|
63
|
+
return id;
|
|
64
|
+
};
|
|
65
|
+
export const promptAgents = async (initialValues, locale, messageKey = "prompt.agent", options = AGENT_OPTIONS) => {
|
|
66
|
+
const defaults = initialValues?.filter((a) => options.includes(a)) ??
|
|
67
|
+
detectDefaultAgents(options);
|
|
55
68
|
const agents = (await p.multiselect({
|
|
56
|
-
message: withHint(
|
|
57
|
-
options:
|
|
69
|
+
message: withHint(messageKey, locale),
|
|
70
|
+
options: options.map((a) => ({ value: a, label: a })),
|
|
58
71
|
initialValues: defaults,
|
|
59
72
|
}));
|
|
60
73
|
if (p.isCancel(agents))
|
|
@@ -176,16 +189,7 @@ export const runPrompts = async (opts) => {
|
|
|
176
189
|
juggling: jugglingRelease.id,
|
|
177
190
|
}));
|
|
178
191
|
}
|
|
179
|
-
const accelplatformVersionId =
|
|
180
|
-
message: withHint("prompt.accelplatformVersion", locale),
|
|
181
|
-
options: getReleases().map((r) => ({
|
|
182
|
-
value: r.id,
|
|
183
|
-
label: `${r.name} (${r.version})`,
|
|
184
|
-
})),
|
|
185
|
-
initialValue: versionDefault,
|
|
186
|
-
}));
|
|
187
|
-
if (p.isCancel(accelplatformVersionId))
|
|
188
|
-
throw createCancelledError();
|
|
192
|
+
const accelplatformVersionId = await promptAccelplatformVersion(versionDefault, locale);
|
|
189
193
|
const release = findReleaseById(accelplatformVersionId);
|
|
190
194
|
if (!release) {
|
|
191
195
|
throw new Error(getMessage("error.invalidVersion", locale, {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IapProjectSettings, MobileProjectSettings } from "../core/types.js";
|
|
2
2
|
import type { Logger } from "../core/logger.js";
|
|
3
|
-
export declare const buildSummaryBody: (settings:
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const buildSummaryBody: (settings: IapProjectSettings, outputDir: string, locale: string) => string;
|
|
4
|
+
export declare const buildMobileSummaryBody: (settings: MobileProjectSettings, outputDir: string, externalCommands: readonly string[], locale: string) => string;
|
|
5
|
+
export declare const printMobileSummary: (settings: MobileProjectSettings, outputDir: string, externalCommands: readonly string[], locale: string, logger?: Logger) => void;
|
|
6
|
+
export declare const printSummary: (settings: IapProjectSettings, outputDir: string, locale: string, logger?: Logger) => void;
|