universal-dev-standards 6.14.0-beta.12 → 6.14.0-beta.13
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/bin/uds.js +8 -1
- package/bundled/hooks/validate-commit-msg.mjs +52 -9
- package/bundled/locales/zh-CN/CHANGELOG.md +3 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +1 -1
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +3 -2
- package/bundled/locales/zh-TW/CHANGELOG.md +3 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +1 -1
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +3 -2
- package/package.json +1 -1
- package/src/commands/audit.js +28 -1
- package/src/commands/check.js +72 -3
- package/src/commands/compile.js +37 -4
- package/src/commands/config.js +28 -19
- package/src/commands/init.js +59 -28
- package/src/commands/release-messages.js +228 -0
- package/src/commands/release.js +72 -72
- package/src/commands/update.js +112 -13
- package/src/compilers/claude-code-compiler.js +9 -1
- package/src/i18n/messages.js +84 -0
- package/src/installers/hooks-installer.js +1 -1
- package/src/mcp/server.js +9 -3
- package/src/prompts/init.js +17 -17
- package/src/reconciler/plan-executor.js +34 -4
- package/src/reconciler/recorded-versions.js +18 -0
- package/src/uninstallers/hook-uninstaller.js +9 -1
- package/src/uninstallers/skills-uninstaller.js +10 -3
- package/src/utils/build-manifest.js +1 -1
- package/src/utils/git-hooks.js +106 -4
- package/src/utils/integration-generator.js +75 -49
- package/src/utils/legacy-hook-migration.js +121 -2
- package/src/utils/spinner.js +14 -4
- package/standards-registry.json +7 -7
package/src/commands/init.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
SUPPORTED_CONTENT_MODES
|
|
9
9
|
} from '../core/manifest.js';
|
|
10
10
|
import { t, detectLanguage } from '../i18n/messages.js';
|
|
11
|
+
import { getAllStandards } from '../utils/registry.js';
|
|
11
12
|
import { detectAll } from '../utils/detector.js';
|
|
12
13
|
import { promptConfirm } from '../prompts/init.js';
|
|
13
14
|
import { runInitFlow } from '../flows/init-flow.js';
|
|
@@ -33,10 +34,21 @@ import { readInstallYaml } from '../utils/config-manager.js';
|
|
|
33
34
|
import { resolveIntegrationTargetFile } from '../utils/integration-generator.js';
|
|
34
35
|
import { withFileTransaction } from '../utils/transaction.js';
|
|
35
36
|
import { newRecorder, mkdirTracked, recordFile, persistRecorder, RECORD_KINDS } from '../core/install-records.js';
|
|
36
|
-
import { wireGitHooksPath, getLocalHooksPathConfig, stripLegacyHuskyShLine, ensureShebang, hookRunsUdsCheck, buildPreCommitBlock } from '../utils/git-hooks.js';
|
|
37
|
+
import { wireGitHooksPath, getLocalHooksPathConfig, stripLegacyHuskyShLine, ensureShebang, hookRunsUdsCheck, buildPreCommitBlock, buildNativePreCommitHook } from '../utils/git-hooks.js';
|
|
37
38
|
import { migrateLegacyHuskyHook } from '../utils/legacy-hook-migration.js';
|
|
38
39
|
import { installGateScripts } from '../utils/gate-scripts.js';
|
|
39
40
|
|
|
41
|
+
/**
|
|
42
|
+
* The values `--output-lang` accepts: the ids of the commit-message option files this UDS ships (the registry lists
|
|
43
|
+
* them under the commit-message standard's `output_language` options), so a new option file is accepted without
|
|
44
|
+
* a second list to keep in step.
|
|
45
|
+
* @returns {string[]}
|
|
46
|
+
*/
|
|
47
|
+
export function supportedOutputLanguages() {
|
|
48
|
+
const commitMessage = getAllStandards().find((s) => s.id === 'commit-message');
|
|
49
|
+
return (commitMessage?.options?.output_language?.choices || []).map((c) => c.id);
|
|
50
|
+
}
|
|
51
|
+
|
|
40
52
|
/**
|
|
41
53
|
* Init command - initialize standards in current project
|
|
42
54
|
* @param {Object} options - Command options
|
|
@@ -51,6 +63,18 @@ export async function initCommand(options) {
|
|
|
51
63
|
// running `uds init` here is nonsensical. `--force` bypasses.
|
|
52
64
|
guardAgainstSelfAdoption('init', options, projectPath);
|
|
53
65
|
|
|
66
|
+
// XSPEC-482 R13: `--output-lang` takes the ids of the commit-message option files UDS ships. Anything else
|
|
67
|
+
// (`simplified-chinese`, `klingon`) used to be recorded in the manifest as if it were a choice while no option
|
|
68
|
+
// file was installed for it. Say which values exist, before anything is written.
|
|
69
|
+
if (options.outputLang !== undefined) {
|
|
70
|
+
const valid = supportedOutputLanguages();
|
|
71
|
+
if (!valid.includes(options.outputLang)) { // wire:init-validates-output-lang
|
|
72
|
+
console.error(chalk.red(`Unsupported --output-lang "${options.outputLang}". Supported: ${valid.join(', ')}.`));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
54
78
|
console.log();
|
|
55
79
|
console.log(chalk.bold(msg.title));
|
|
56
80
|
console.log(chalk.gray('─'.repeat(50)));
|
|
@@ -151,7 +175,8 @@ export async function initCommand(options) {
|
|
|
151
175
|
if (config.releaseMode && config.releaseMode !== 'ci-cd') {
|
|
152
176
|
const releaseConfigData = generateReleaseConfig(config.releaseMode);
|
|
153
177
|
const releaseConfigPath = join(projectPath, '.standards', 'release-config.yaml');
|
|
154
|
-
|
|
178
|
+
// js-yaml 5 has no default export: use the namespace (XSPEC-482 R1).
|
|
179
|
+
const yaml = await import('js-yaml'); // wire:init-release-config-yaml
|
|
155
180
|
mkdirSync(join(projectPath, '.standards'), { recursive: true });
|
|
156
181
|
writeFileSync(releaseConfigPath, yaml.dump(releaseConfigData), 'utf-8');
|
|
157
182
|
console.log(chalk.green(` ✓ release-config.yaml (${config.releaseMode})`));
|
|
@@ -367,6 +392,33 @@ export async function initCommand(options) {
|
|
|
367
392
|
}
|
|
368
393
|
persistRecorder(projectPath, installRecorder);
|
|
369
394
|
|
|
395
|
+
// 4.85. XSPEC-482 R6: leave the project in the form `uds update` would leave it in. The init writers and the
|
|
396
|
+
// reconciler are two generators: init wrote the manifest in the 3.3.0 form (standards as file paths) and an
|
|
397
|
+
// integration block whose list of standards is ordered differently from the one `update` writes, so the first
|
|
398
|
+
// `uds update --plan` on a brand new project already showed changes (CLAUDE.md, AGENTS.md "Migrate Block") and the
|
|
399
|
+
// first `--apply` rewrote the manifest and GEMINI.md's whole index. Running the reconciler once, without a backup
|
|
400
|
+
// (there is nothing to go back to yet), makes the two agree by construction instead of by keeping two writers in step.
|
|
401
|
+
// A failure here is reported and does not fail the install: the project is complete without it.
|
|
402
|
+
//
|
|
403
|
+
// Only when the whole difference is integration blocks to rewrite (and the manifest to bring forward). A project whose
|
|
404
|
+
// plan holds anything else is left exactly as init wrote it: `--format both`, for one, installs the human and the AI
|
|
405
|
+
// copy of each standard, and the reconciler's plan for it deletes the AI copies (a separate defect, found while doing this),
|
|
406
|
+
// which an install must never do to what it has just written.
|
|
407
|
+
if (config.contentLayout !== 'layered') {
|
|
408
|
+
try {
|
|
409
|
+
const { reconcile, plan: reconcilerPlan } = await import('../reconciler/index.js');
|
|
410
|
+
const preview = await reconcilerPlan(projectPath);
|
|
411
|
+
if (preview.plan.actions.every((a) => a.type === 'migrate_block')) {
|
|
412
|
+
const converged = await reconcile(projectPath, { backup: false }); // wire:init-converges-to-current-format
|
|
413
|
+
if (!converged.success) {
|
|
414
|
+
console.log(chalk.yellow(` ⚠ Could not bring the new project to the current manifest format: ${converged.errors.join('; ')} (\`uds update --apply\` will finish it)`));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
} catch (e) {
|
|
418
|
+
console.log(chalk.yellow(` ⚠ Could not bring the new project to the current manifest format: ${e.message} (\`uds update --apply\` will finish it)`));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
370
422
|
// 4.9. XSPEC-465 R1: tell the adopter now if a personal skill of theirs has the same name as a UDS skill
|
|
371
423
|
// that was just installed (the personal one wins, with no error). Information only: it does not change
|
|
372
424
|
// what was installed or the exit code.
|
|
@@ -670,35 +722,14 @@ export async function setupHuskyHook(projectPath, { allowInTest = false, platfor
|
|
|
670
722
|
} else {
|
|
671
723
|
// Fail-closed (XSPEC-444 R1 class sweep). This script used to run the linters
|
|
672
724
|
// as `... 2>/dev/null || true` and `uds check 2>/dev/null || true`, then print
|
|
673
|
-
// "Pre-commit checks passed"
|
|
725
|
+
// "Pre-commit checks passed" - it could not block a commit for any reason.
|
|
674
726
|
// Now: a linter that is installed and fails blocks the commit; one that is not
|
|
675
727
|
// installed is skipped. The UDS check is the same block the husky path writes
|
|
676
728
|
// (buildPreCommitBlock): its exit status stops the commit, and a missing CLI
|
|
677
|
-
// says so and blocks rather than being skipped in silence.
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
echo "Running UDS pre-commit checks..."
|
|
683
|
-
|
|
684
|
-
# Lint, when the language's linter is installed. A failing linter blocks the commit.
|
|
685
|
-
if [ -f pyproject.toml ] || [ -f requirements.txt ]; then
|
|
686
|
-
if python -m ruff --version >/dev/null 2>&1; then
|
|
687
|
-
python -m ruff check . || exit $?
|
|
688
|
-
fi
|
|
689
|
-
elif [ -f go.mod ]; then
|
|
690
|
-
if command -v go >/dev/null 2>&1; then
|
|
691
|
-
go vet ./... || exit $?
|
|
692
|
-
fi
|
|
693
|
-
elif [ -f Cargo.toml ]; then
|
|
694
|
-
if command -v cargo >/dev/null 2>&1; then
|
|
695
|
-
cargo clippy || exit $?
|
|
696
|
-
fi
|
|
697
|
-
fi
|
|
698
|
-
|
|
699
|
-
${buildPreCommitBlock({ hookFile: '.git/hooks/pre-commit' })}
|
|
700
|
-
echo "Pre-commit checks passed"
|
|
701
|
-
`;
|
|
729
|
+
// says so and blocks rather than being skipped in silence. It runs `check --ci`,
|
|
730
|
+
// the mode whose exit code says "issues" (XSPEC-482 R3). The text lives in
|
|
731
|
+
// git-hooks.js (buildNativePreCommitHook) so `uds update` can recognise it exactly.
|
|
732
|
+
const hookContent = buildNativePreCommitHook(); // wire:init-native-hook-check-ci
|
|
702
733
|
writeFileSync(hookPath, hookContent, { mode: 0o755 });
|
|
703
734
|
// Created from nothing (the branch above is "file does not exist"), so the
|
|
704
735
|
// whole file is UDS's — record its hash for `uds uninstall`.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text of `uds release`, in the three display languages (XSPEC-482 R14b).
|
|
3
|
+
*
|
|
4
|
+
* The command printed Traditional Chinese whatever the display language was, so `--ui-lang en` and a Simplified
|
|
5
|
+
* Chinese project both got it. The Traditional text below is word for word what the command printed before; the English
|
|
6
|
+
* and Simplified Chinese tables say the same things. A function entry takes the values it puts into the sentence.
|
|
7
|
+
*
|
|
8
|
+
* @module commands/release-messages
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { getLanguage } from '../i18n/messages.js';
|
|
12
|
+
|
|
13
|
+
const zhTw = {
|
|
14
|
+
modeFromConfig: (mode) => `模式 ${mode} 來自 .standards/release-config.yaml。`,
|
|
15
|
+
configMissing: '找不到 .standards/release-config.yaml(或它無法解析)',
|
|
16
|
+
configNoMode: '.standards/release-config.yaml 沒有指定 release.mode',
|
|
17
|
+
modeFromManifest: (why, mode) => `${why};模式 ${mode} 取自 .standards/manifest.json 的 options.release_mode。`,
|
|
18
|
+
modeDefault: (why) => `${why},.standards/manifest.json 也沒有記錄 options.release_mode,所以使用預設的 ci-cd。`,
|
|
19
|
+
configParseFailed: (err) => `⚠ release-config.yaml 解析失敗: ${err}`,
|
|
20
|
+
promoteOnly: 'promote 子命令僅在 manual 或 hybrid 模式下可用。',
|
|
21
|
+
deployOnly: 'deploy 子命令僅在 manual 或 hybrid 模式下可用。',
|
|
22
|
+
manifestOnly: 'manifest 子命令僅在 manual 或 hybrid 模式下可用。',
|
|
23
|
+
verifyOnly: 'verify 子命令僅在 manual 或 hybrid 模式下可用。',
|
|
24
|
+
currentMode: (mode) => ` 目前模式: ${mode}`,
|
|
25
|
+
switchMode: ' 使用 `uds config --type release_mode` 切換模式',
|
|
26
|
+
promoteNeedVersion: '請指定目標 stable 版本號。',
|
|
27
|
+
promoteUsage: ' 用法: uds release promote 1.2.0',
|
|
28
|
+
noPrerelease: '目標版本不應包含 pre-release 後綴。',
|
|
29
|
+
useInstead: (v) => ` 請使用: uds release promote ${v}`,
|
|
30
|
+
badVersion: (v) => `版本格式無效: ${v}`,
|
|
31
|
+
needStable: ' 需為 stable semver(X.Y.Z),例如: uds release promote 1.2.0',
|
|
32
|
+
promoteTitle: 'Release Promote: RC → Stable',
|
|
33
|
+
currentVersion: (v) => ` 目前版本: ${v}`,
|
|
34
|
+
promoteTarget: (v) => ` 晉升目標: ${v}`,
|
|
35
|
+
promotePrintsOnly: '這個指令不會建立晉升紀錄,也不會建立 Git tag;它只列出下一步要執行的事。',
|
|
36
|
+
nextStepsHeader: '下一步(由你執行):',
|
|
37
|
+
step1: (v) => ` 1. 更新版本檔案為 ${v}`,
|
|
38
|
+
step2: (tag) => ` 2. git tag ${tag}`,
|
|
39
|
+
step3: ' 3. 從此 commit 重新打包',
|
|
40
|
+
step4: ' 4. 執行 uds release deploy production 記錄部署',
|
|
41
|
+
deployNeedEnv: '請指定部署環境。',
|
|
42
|
+
deployUsage1: ' 用法: uds release deploy staging',
|
|
43
|
+
deployUsage2: ' 用法: uds release deploy staging --result passed',
|
|
44
|
+
deployUsage3: ' 用法: uds release deploy production',
|
|
45
|
+
unknownEnv: (e) => `未知的部署環境: ${e}`,
|
|
46
|
+
allowedEnvs: (list) => ` 允許的環境: ${list}`,
|
|
47
|
+
customEnvHint: ' 自訂環境請在 .standards/release-config.yaml 設定 release.environments',
|
|
48
|
+
noDeployRecord: (v, e) => `⚠ 找不到 ${v} 在 ${e} 的部署紀錄`,
|
|
49
|
+
resultUpdated: (v, e, r) => `✓ 已更新 ${v} 在 ${e} 的結果: ${r}`,
|
|
50
|
+
warningHeader: '⚠ 警告:',
|
|
51
|
+
deployRecorded: (v, e) => `✓ 已記錄部署: ${v} → ${e}`,
|
|
52
|
+
deployer: (d) => ` 部署者: ${d}`,
|
|
53
|
+
time: (t) => ` 時間: ${t}`,
|
|
54
|
+
followUp: '後續步驟:',
|
|
55
|
+
afterTesting: ' 測試完成後執行:',
|
|
56
|
+
manifestWritten: '✓ build-manifest.json 已產生',
|
|
57
|
+
mVersion: (v) => ` 版本: ${v}`,
|
|
58
|
+
mCommit: (v) => ` Commit: ${v}`,
|
|
59
|
+
mBranch: (v) => ` 分支: ${v}`,
|
|
60
|
+
mBuilder: (v) => ` 建置者: ${v}`,
|
|
61
|
+
mTime: (v) => ` 時間: ${v}`,
|
|
62
|
+
noManifest: '找不到 build-manifest.json',
|
|
63
|
+
runManifestFirst: ' 請先執行 uds release manifest',
|
|
64
|
+
badManifest: 'build-manifest.json 格式不正確',
|
|
65
|
+
noArtifact: (p) => `找不到 artifact:${p}`,
|
|
66
|
+
verifyPassed: '✓ Manifest 驗證通過',
|
|
67
|
+
commitSame: (c) => ` Commit: ${c} (一致)`,
|
|
68
|
+
checksumSame: (c) => ` Checksum: ${c} (一致)`,
|
|
69
|
+
verifyFailed: '✗ Manifest 驗證失敗',
|
|
70
|
+
stagingPassed: ' Staging: 已通過 ✓',
|
|
71
|
+
stagingNone: ' Staging: 未通過或無紀錄',
|
|
72
|
+
helpTitle: 'uds release — 版本發布管理',
|
|
73
|
+
subcommands: ' 可用子命令:',
|
|
74
|
+
helpPromote: ' promote <version> RC → Stable 晉升',
|
|
75
|
+
helpDeploy: ' deploy <env> 記錄部署紀錄',
|
|
76
|
+
helpDeployResult: ' deploy <env> --result 更新測試結果',
|
|
77
|
+
helpManifest: ' manifest 產生 build-manifest.json',
|
|
78
|
+
helpVerify: ' verify [--artifact <path>] 驗證 manifest 一致性(含 checksum 比對)',
|
|
79
|
+
helpCiCd: ' CI/CD 模式下,請使用 /release start 和 /release finish',
|
|
80
|
+
helpSwitch: ' 切換到手動模式: uds config --type release_mode'
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const zhCn = {
|
|
84
|
+
modeFromConfig: (mode) => `模式 ${mode} 来自 .standards/release-config.yaml。`,
|
|
85
|
+
configMissing: '找不到 .standards/release-config.yaml(或它无法解析)',
|
|
86
|
+
configNoMode: '.standards/release-config.yaml 没有指定 release.mode',
|
|
87
|
+
modeFromManifest: (why, mode) => `${why};模式 ${mode} 取自 .standards/manifest.json 的 options.release_mode。`,
|
|
88
|
+
modeDefault: (why) => `${why},.standards/manifest.json 也没有记录 options.release_mode,所以使用默认的 ci-cd。`,
|
|
89
|
+
configParseFailed: (err) => `⚠ release-config.yaml 解析失败: ${err}`,
|
|
90
|
+
promoteOnly: 'promote 子命令仅在 manual 或 hybrid 模式下可用。',
|
|
91
|
+
deployOnly: 'deploy 子命令仅在 manual 或 hybrid 模式下可用。',
|
|
92
|
+
manifestOnly: 'manifest 子命令仅在 manual 或 hybrid 模式下可用。',
|
|
93
|
+
verifyOnly: 'verify 子命令仅在 manual 或 hybrid 模式下可用。',
|
|
94
|
+
currentMode: (mode) => ` 当前模式: ${mode}`,
|
|
95
|
+
switchMode: ' 使用 `uds config --type release_mode` 切换模式',
|
|
96
|
+
promoteNeedVersion: '请指定目标 stable 版本号。',
|
|
97
|
+
promoteUsage: ' 用法: uds release promote 1.2.0',
|
|
98
|
+
noPrerelease: '目标版本不应包含 pre-release 后缀。',
|
|
99
|
+
useInstead: (v) => ` 请使用: uds release promote ${v}`,
|
|
100
|
+
badVersion: (v) => `版本格式无效: ${v}`,
|
|
101
|
+
needStable: ' 需为 stable semver(X.Y.Z),例如: uds release promote 1.2.0',
|
|
102
|
+
promoteTitle: 'Release Promote: RC → Stable',
|
|
103
|
+
currentVersion: (v) => ` 当前版本: ${v}`,
|
|
104
|
+
promoteTarget: (v) => ` 晋升目标: ${v}`,
|
|
105
|
+
promotePrintsOnly: '这个命令不会创建晋升记录,也不会创建 Git tag;它只列出下一步要执行的事。',
|
|
106
|
+
nextStepsHeader: '下一步(由你执行):',
|
|
107
|
+
step1: (v) => ` 1. 把版本文件更新为 ${v}`,
|
|
108
|
+
step2: (tag) => ` 2. git tag ${tag}`,
|
|
109
|
+
step3: ' 3. 从此 commit 重新打包',
|
|
110
|
+
step4: ' 4. 执行 uds release deploy production 记录部署',
|
|
111
|
+
deployNeedEnv: '请指定部署环境。',
|
|
112
|
+
deployUsage1: ' 用法: uds release deploy staging',
|
|
113
|
+
deployUsage2: ' 用法: uds release deploy staging --result passed',
|
|
114
|
+
deployUsage3: ' 用法: uds release deploy production',
|
|
115
|
+
unknownEnv: (e) => `未知的部署环境: ${e}`,
|
|
116
|
+
allowedEnvs: (list) => ` 允许的环境: ${list}`,
|
|
117
|
+
customEnvHint: ' 自定义环境请在 .standards/release-config.yaml 设置 release.environments',
|
|
118
|
+
noDeployRecord: (v, e) => `⚠ 找不到 ${v} 在 ${e} 的部署记录`,
|
|
119
|
+
resultUpdated: (v, e, r) => `✓ 已更新 ${v} 在 ${e} 的结果: ${r}`,
|
|
120
|
+
warningHeader: '⚠ 警告:',
|
|
121
|
+
deployRecorded: (v, e) => `✓ 已记录部署: ${v} → ${e}`,
|
|
122
|
+
deployer: (d) => ` 部署者: ${d}`,
|
|
123
|
+
time: (t) => ` 时间: ${t}`,
|
|
124
|
+
followUp: '后续步骤:',
|
|
125
|
+
afterTesting: ' 测试完成后执行:',
|
|
126
|
+
manifestWritten: '✓ build-manifest.json 已生成',
|
|
127
|
+
mVersion: (v) => ` 版本: ${v}`,
|
|
128
|
+
mCommit: (v) => ` Commit: ${v}`,
|
|
129
|
+
mBranch: (v) => ` 分支: ${v}`,
|
|
130
|
+
mBuilder: (v) => ` 构建者: ${v}`,
|
|
131
|
+
mTime: (v) => ` 时间: ${v}`,
|
|
132
|
+
noManifest: '找不到 build-manifest.json',
|
|
133
|
+
runManifestFirst: ' 请先执行 uds release manifest',
|
|
134
|
+
badManifest: 'build-manifest.json 格式不正确',
|
|
135
|
+
noArtifact: (p) => `找不到 artifact:${p}`,
|
|
136
|
+
verifyPassed: '✓ Manifest 验证通过',
|
|
137
|
+
commitSame: (c) => ` Commit: ${c} (一致)`,
|
|
138
|
+
checksumSame: (c) => ` Checksum: ${c} (一致)`,
|
|
139
|
+
verifyFailed: '✗ Manifest 验证失败',
|
|
140
|
+
stagingPassed: ' Staging: 已通过 ✓',
|
|
141
|
+
stagingNone: ' Staging: 未通过或无记录',
|
|
142
|
+
helpTitle: 'uds release — 版本发布管理',
|
|
143
|
+
subcommands: ' 可用子命令:',
|
|
144
|
+
helpPromote: ' promote <version> RC → Stable 晋升',
|
|
145
|
+
helpDeploy: ' deploy <env> 记录部署记录',
|
|
146
|
+
helpDeployResult: ' deploy <env> --result 更新测试结果',
|
|
147
|
+
helpManifest: ' manifest 生成 build-manifest.json',
|
|
148
|
+
helpVerify: ' verify [--artifact <path>] 验证 manifest 一致性(含 checksum 比对)',
|
|
149
|
+
helpCiCd: ' CI/CD 模式下,请使用 /release start 和 /release finish',
|
|
150
|
+
helpSwitch: ' 切换到手动模式: uds config --type release_mode'
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const en = {
|
|
154
|
+
modeFromConfig: (mode) => `Mode ${mode} comes from .standards/release-config.yaml.`,
|
|
155
|
+
configMissing: '.standards/release-config.yaml was not found (or could not be parsed)',
|
|
156
|
+
configNoMode: '.standards/release-config.yaml does not set release.mode',
|
|
157
|
+
modeFromManifest: (why, mode) => `${why}; mode ${mode} is taken from options.release_mode in .standards/manifest.json.`,
|
|
158
|
+
modeDefault: (why) => `${why}, and .standards/manifest.json records no options.release_mode either, so the default ci-cd applies.`,
|
|
159
|
+
configParseFailed: (err) => `⚠ Could not parse release-config.yaml: ${err}`,
|
|
160
|
+
promoteOnly: 'The promote subcommand is only available in manual or hybrid mode.',
|
|
161
|
+
deployOnly: 'The deploy subcommand is only available in manual or hybrid mode.',
|
|
162
|
+
manifestOnly: 'The manifest subcommand is only available in manual or hybrid mode.',
|
|
163
|
+
verifyOnly: 'The verify subcommand is only available in manual or hybrid mode.',
|
|
164
|
+
currentMode: (mode) => ` Current mode: ${mode}`,
|
|
165
|
+
switchMode: ' Switch modes with `uds config --type release_mode`',
|
|
166
|
+
promoteNeedVersion: 'Give the stable version to promote to.',
|
|
167
|
+
promoteUsage: ' Usage: uds release promote 1.2.0',
|
|
168
|
+
noPrerelease: 'The target version must not carry a pre-release suffix.',
|
|
169
|
+
useInstead: (v) => ` Use: uds release promote ${v}`,
|
|
170
|
+
badVersion: (v) => `Invalid version format: ${v}`,
|
|
171
|
+
needStable: ' Needs a stable semver (X.Y.Z), for example: uds release promote 1.2.0',
|
|
172
|
+
promoteTitle: 'Release Promote: RC → Stable',
|
|
173
|
+
currentVersion: (v) => ` Current version: ${v}`,
|
|
174
|
+
promoteTarget: (v) => ` Promote to: ${v}`,
|
|
175
|
+
promotePrintsOnly: 'This command records no promotion and creates no Git tag; it only lists the next steps.',
|
|
176
|
+
nextStepsHeader: 'Next steps (you run them):',
|
|
177
|
+
step1: (v) => ` 1. Update the version files to ${v}`,
|
|
178
|
+
step2: (tag) => ` 2. git tag ${tag}`,
|
|
179
|
+
step3: ' 3. Package again from that commit',
|
|
180
|
+
step4: ' 4. Run uds release deploy production to record the deployment',
|
|
181
|
+
deployNeedEnv: 'Give the deployment environment.',
|
|
182
|
+
deployUsage1: ' Usage: uds release deploy staging',
|
|
183
|
+
deployUsage2: ' Usage: uds release deploy staging --result passed',
|
|
184
|
+
deployUsage3: ' Usage: uds release deploy production',
|
|
185
|
+
unknownEnv: (e) => `Unknown deployment environment: ${e}`,
|
|
186
|
+
allowedEnvs: (list) => ` Allowed environments: ${list}`,
|
|
187
|
+
customEnvHint: ' For custom environments set release.environments in .standards/release-config.yaml',
|
|
188
|
+
noDeployRecord: (v, e) => `⚠ No deployment record for ${v} in ${e}`,
|
|
189
|
+
resultUpdated: (v, e, r) => `✓ Updated the result of ${v} in ${e}: ${r}`,
|
|
190
|
+
warningHeader: '⚠ Warning:',
|
|
191
|
+
deployRecorded: (v, e) => `✓ Recorded deployment: ${v} → ${e}`,
|
|
192
|
+
deployer: (d) => ` Deployed by: ${d}`,
|
|
193
|
+
time: (t) => ` Time: ${t}`,
|
|
194
|
+
followUp: 'Next:',
|
|
195
|
+
afterTesting: ' When testing is done, run:',
|
|
196
|
+
manifestWritten: '✓ build-manifest.json written',
|
|
197
|
+
mVersion: (v) => ` Version: ${v}`,
|
|
198
|
+
mCommit: (v) => ` Commit: ${v}`,
|
|
199
|
+
mBranch: (v) => ` Branch: ${v}`,
|
|
200
|
+
mBuilder: (v) => ` Built by: ${v}`,
|
|
201
|
+
mTime: (v) => ` Time: ${v}`,
|
|
202
|
+
noManifest: 'build-manifest.json not found',
|
|
203
|
+
runManifestFirst: ' Run uds release manifest first',
|
|
204
|
+
badManifest: 'build-manifest.json is not valid',
|
|
205
|
+
noArtifact: (p) => `Artifact not found: ${p}`,
|
|
206
|
+
verifyPassed: '✓ Manifest verified',
|
|
207
|
+
commitSame: (c) => ` Commit: ${c} (matches)`,
|
|
208
|
+
checksumSame: (c) => ` Checksum: ${c} (matches)`,
|
|
209
|
+
verifyFailed: '✗ Manifest verification failed',
|
|
210
|
+
stagingPassed: ' Staging: passed ✓',
|
|
211
|
+
stagingNone: ' Staging: not passed, or no record',
|
|
212
|
+
helpTitle: 'uds release — release management',
|
|
213
|
+
subcommands: ' Subcommands:',
|
|
214
|
+
helpPromote: ' promote <version> Promote RC to Stable',
|
|
215
|
+
helpDeploy: ' deploy <env> Record a deployment',
|
|
216
|
+
helpDeployResult: ' deploy <env> --result Update the test result',
|
|
217
|
+
helpManifest: ' manifest Write build-manifest.json',
|
|
218
|
+
helpVerify: ' verify [--artifact <path>] Check the manifest against git (and the artifact checksum)',
|
|
219
|
+
helpCiCd: ' In CI/CD mode use /release start and /release finish',
|
|
220
|
+
helpSwitch: ' Switch to manual mode: uds config --type release_mode'
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const TABLES = { en, 'zh-tw': zhTw, 'zh-cn': zhCn };
|
|
224
|
+
|
|
225
|
+
/** The release text table for the current display language (English when the language has none). */
|
|
226
|
+
export function releaseText() {
|
|
227
|
+
return TABLES[getLanguage()] || en;
|
|
228
|
+
}
|