@lark-apaas/miaoda-cli 0.1.7-alpha.eb0aa5c → 0.1.7-beta.b160430
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/handlers/app/sync.js +13 -3
- package/package.json +1 -1
- package/upgrade/templates/design-stack/templates/scripts/dev-local.js +2 -1
- package/upgrade/templates/design-stack/templates/scripts/dev.sh +4 -3
- package/upgrade/templates/nestjs-react-fullstack/templates/scripts/dev-local.js +4 -2
- package/upgrade/templates/nestjs-react-fullstack/templates/scripts/dev.sh +4 -3
|
@@ -81,11 +81,21 @@ async function handleAppSync(opts) {
|
|
|
81
81
|
const upgradedPackages = upgradePlatformDeps(targetDir, 'sync');
|
|
82
82
|
// 3. activate git hooks(template 自带 .githooks/pre-commit,core.hooksPath 一次性设置)
|
|
83
83
|
const hookActivation = (0, githooks_1.activateGitHooks)(targetDir);
|
|
84
|
-
// 4. npm install —— 跟 init 一样软失败,install 挂了不该阻断 emit / sync
|
|
85
|
-
|
|
84
|
+
// 4. npm install —— 跟 init 一样软失败,install 挂了不该阻断 emit / sync 总结输出。
|
|
85
|
+
// 把本次实际有 from→to 变化的管控包**显式**作为位置参数传给 npm install,强制 npm 重新
|
|
86
|
+
// resolve lockfile entry。原因:user app 老 lockfile 可能锁着 alpha 版本,纯 `npm install`
|
|
87
|
+
// 看 lockfile 锁定值跟 package.json spec ("latest" range) 兼容会保留 alpha,导致 sync 后
|
|
88
|
+
// package.json 写了 latest 但实际还是装 alpha。显式 `npm install foo@latest bar@latest`
|
|
89
|
+
// 会重新解析这些包,lockfile 跟着更新。没变化的包不动,避免 noisy lockfile diff。
|
|
90
|
+
// --ignore-scripts 绕开 action-plugin postinstall 在缺平台 env 时的 ENOENT。
|
|
91
|
+
const installArgs = ['install', '--no-audit', '--no-fund', '--ignore-scripts'];
|
|
92
|
+
for (const bump of upgradedPackages) {
|
|
93
|
+
installArgs.push(`${bump.name}@${bump.to}`);
|
|
94
|
+
}
|
|
95
|
+
(0, logger_1.log)('sync', `Running npm ${installArgs.join(' ')}...`);
|
|
86
96
|
let installError;
|
|
87
97
|
try {
|
|
88
|
-
(0, node_child_process_1.execFileSync)('npm',
|
|
98
|
+
(0, node_child_process_1.execFileSync)('npm', installArgs, {
|
|
89
99
|
cwd: targetDir,
|
|
90
100
|
stdio: (0, output_1.isJsonMode)() ? ['ignore', 'ignore', 'inherit'] : 'inherit',
|
|
91
101
|
});
|
package/package.json
CHANGED
|
@@ -47,9 +47,10 @@ if (hasLarkCli) {
|
|
|
47
47
|
warn('lark-cli 未安装,跳过 env pull;请确保 .env.local 已就绪');
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// skills sync —— --local 切 flat layout;临时钉 @alpha,等 0.1.7 发到 latest 后切回。
|
|
50
51
|
console.log('[dev-local] (2/4) miaoda skills sync...');
|
|
51
52
|
try {
|
|
52
|
-
execSync('npx -y @lark-apaas/miaoda-cli@
|
|
53
|
+
execSync('npx -y @lark-apaas/miaoda-cli@alpha skills sync --local', { stdio: 'inherit' });
|
|
53
54
|
} catch {
|
|
54
55
|
console.log(' (skills sync 失败,继续启动)');
|
|
55
56
|
}
|
|
@@ -13,13 +13,14 @@ if [ -n "${SANDBOX_ID:-}" ]; then
|
|
|
13
13
|
fi
|
|
14
14
|
|
|
15
15
|
if [ ! -f "$SCRIPT_DIR/dev-local.js" ]; then
|
|
16
|
-
echo "[dev] scripts/dev-local.js 缺失;先跑 \`npx -y @lark-apaas/miaoda-cli@
|
|
16
|
+
echo "[dev] scripts/dev-local.js 缺失;先跑 \`npx -y @lark-apaas/miaoda-cli@alpha app sync\` 同步平台脚本" >&2
|
|
17
17
|
exit 1
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
20
|
# 本地启动前先跑一次 miaoda app sync:同步 platform-controlled 内容 + 升 @lark-apaas/* 到
|
|
21
21
|
# latest + 迁移老 npm scripts。沙箱不走这里(SANDBOX_ID 分支已经 exec return)。
|
|
22
|
-
#
|
|
23
|
-
|
|
22
|
+
# 临时钉 @alpha:latest dist-tag 还停在老版(0.1.6,无 app sync 子命令);等 0.1.7 发到
|
|
23
|
+
# latest 后切回 @latest。
|
|
24
|
+
npx -y @lark-apaas/miaoda-cli@alpha app sync || echo "[dev] miaoda app sync 失败,按现状继续" >&2
|
|
24
25
|
|
|
25
26
|
exec node "$SCRIPT_DIR/dev-local.js" "$@"
|
|
@@ -55,10 +55,12 @@ if (hasLarkCli) {
|
|
|
55
55
|
warn('lark-cli 未安装,跳过 env pull;请确保 .env.local 已就绪');
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
// 2. skills sync
|
|
58
|
+
// 2. skills sync —— --local 切到 flat layout (.agents/skills + .claude/skills 软链),
|
|
59
|
+
// 跟沙箱 nested layout 区分。临时钉 @alpha:latest dist-tag 还停在老版 (0.1.6,无 skills /
|
|
60
|
+
// app sync 子命令);等 0.1.7 发到 latest 后切回 @latest。
|
|
59
61
|
console.log('[dev-local] (2/4) miaoda skills sync...');
|
|
60
62
|
try {
|
|
61
|
-
execSync('npx -y @lark-apaas/miaoda-cli@
|
|
63
|
+
execSync('npx -y @lark-apaas/miaoda-cli@alpha skills sync --local', { stdio: 'inherit' });
|
|
62
64
|
} catch {
|
|
63
65
|
console.log(' (skills sync 失败,继续启动)');
|
|
64
66
|
}
|
|
@@ -13,13 +13,14 @@ if [ -n "${SANDBOX_ID:-}" ]; then
|
|
|
13
13
|
fi
|
|
14
14
|
|
|
15
15
|
if [ ! -f "$SCRIPT_DIR/dev-local.js" ]; then
|
|
16
|
-
echo "[dev] scripts/dev-local.js 缺失;先跑 \`npx -y @lark-apaas/miaoda-cli@
|
|
16
|
+
echo "[dev] scripts/dev-local.js 缺失;先跑 \`npx -y @lark-apaas/miaoda-cli@alpha app sync\` 同步平台脚本" >&2
|
|
17
17
|
exit 1
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
20
|
# 本地启动前先跑一次 miaoda app sync:同步 platform-controlled 内容 + 升 @lark-apaas/* 到
|
|
21
21
|
# latest + 迁移老 npm scripts。沙箱不走这里(SANDBOX_ID 分支已经 exec return)。
|
|
22
|
-
#
|
|
23
|
-
|
|
22
|
+
# 临时钉 @alpha:latest dist-tag 还停在老版(0.1.6,无 app sync 子命令);等 0.1.7 发到
|
|
23
|
+
# latest 后切回 @latest。
|
|
24
|
+
npx -y @lark-apaas/miaoda-cli@alpha app sync || echo "[dev] miaoda app sync 失败,按现状继续" >&2
|
|
24
25
|
|
|
25
26
|
exec node "$SCRIPT_DIR/dev-local.js" "$@"
|