@lark-apaas/fullstack-cli 1.1.44-alpha.3 → 1.1.44-beta.0
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/index.js +43 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3115,22 +3115,38 @@ function getGrayscaleConfig(configJson) {
|
|
|
3115
3115
|
if (!configJson) {
|
|
3116
3116
|
return null;
|
|
3117
3117
|
}
|
|
3118
|
+
let parsed;
|
|
3118
3119
|
try {
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3120
|
+
parsed = JSON.parse(configJson);
|
|
3121
|
+
} catch {
|
|
3122
|
+
console.warn("[grayscale] Failed to parse grayscale config");
|
|
3123
|
+
return null;
|
|
3124
|
+
}
|
|
3125
|
+
if (parsed && parsed.target_versions && typeof parsed.target_versions === "object") {
|
|
3126
|
+
const entries = Object.entries(parsed.target_versions).filter(
|
|
3127
|
+
([, v]) => typeof v === "string" && v.length > 0
|
|
3128
|
+
);
|
|
3129
|
+
if (entries.length === 0) {
|
|
3130
|
+
console.log("[grayscale] target_versions present but empty, skip");
|
|
3122
3131
|
return null;
|
|
3123
3132
|
}
|
|
3124
3133
|
return {
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
xTtEnv: parsed.x_tt_env || void 0
|
|
3134
|
+
kind: "resolved",
|
|
3135
|
+
targetVersions: new Map(entries),
|
|
3136
|
+
matchedChannel: typeof parsed.matched_channel === "string" ? parsed.matched_channel : void 0
|
|
3129
3137
|
};
|
|
3130
|
-
}
|
|
3131
|
-
|
|
3138
|
+
}
|
|
3139
|
+
const config = parsed?.config;
|
|
3140
|
+
if (!config || !config.enabled) {
|
|
3132
3141
|
return null;
|
|
3133
3142
|
}
|
|
3143
|
+
return {
|
|
3144
|
+
kind: "legacy",
|
|
3145
|
+
config,
|
|
3146
|
+
tenantId: parsed.tenant_id != null ? String(parsed.tenant_id) : void 0,
|
|
3147
|
+
appId: parsed.app_id || void 0,
|
|
3148
|
+
xTtEnv: parsed.x_tt_env || void 0
|
|
3149
|
+
};
|
|
3134
3150
|
}
|
|
3135
3151
|
|
|
3136
3152
|
// src/utils/grayscale/identity.ts
|
|
@@ -3218,6 +3234,19 @@ function resolveGrayscaleVersions(_cwd, configJson) {
|
|
|
3218
3234
|
console.log("[grayscale] Config not available, skipping grayscale");
|
|
3219
3235
|
return null;
|
|
3220
3236
|
}
|
|
3237
|
+
if (result.kind === "resolved") {
|
|
3238
|
+
console.log(
|
|
3239
|
+
`[grayscale] Using server-resolved versions (matched channel: ${result.matchedChannel || "(stable)"})`
|
|
3240
|
+
);
|
|
3241
|
+
console.log(`[grayscale] Resolved ${result.targetVersions.size} package version(s):`);
|
|
3242
|
+
for (const [pkg2, ver] of result.targetVersions) {
|
|
3243
|
+
console.log(`[grayscale] ${pkg2} -> ${ver}`);
|
|
3244
|
+
}
|
|
3245
|
+
return result.targetVersions;
|
|
3246
|
+
}
|
|
3247
|
+
console.warn(
|
|
3248
|
+
"[grayscale] Received legacy payload (full TCC config). This path is deprecated; sandbox_console should be upgraded to server-side resolution."
|
|
3249
|
+
);
|
|
3221
3250
|
const { config, tenantId: payloadTenantId, appId: payloadAppId, xTtEnv: payloadXTtEnv } = result;
|
|
3222
3251
|
const envIdentity = readProjectIdentity();
|
|
3223
3252
|
const identity = {
|
|
@@ -3444,7 +3473,7 @@ var depsCommand = {
|
|
|
3444
3473
|
}
|
|
3445
3474
|
};
|
|
3446
3475
|
|
|
3447
|
-
// src/commands/upgrade/global/run.handler.ts
|
|
3476
|
+
// src/commands/upgrade/global-deps/run.handler.ts
|
|
3448
3477
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
3449
3478
|
import fs11 from "fs";
|
|
3450
3479
|
import path9 from "path";
|
|
@@ -3534,9 +3563,9 @@ async function run5(options = {}) {
|
|
|
3534
3563
|
console.log("[fullstack-cli] \u2713 Global CLI upgrade completed");
|
|
3535
3564
|
}
|
|
3536
3565
|
|
|
3537
|
-
// src/commands/upgrade/global/index.ts
|
|
3538
|
-
var
|
|
3539
|
-
name: "global",
|
|
3566
|
+
// src/commands/upgrade/global-deps/index.ts
|
|
3567
|
+
var globalDepsCommand = {
|
|
3568
|
+
name: "global-deps",
|
|
3540
3569
|
description: "Upgrade global @lark-apaas CLIs (fullstack-cli, miaoda-cli) per grayscale config",
|
|
3541
3570
|
register(parentCommand) {
|
|
3542
3571
|
parentCommand.command(this.name).description(this.description).option("--grayscale-config <json>", "Grayscale config JSON (injected by sandbox_console)").option("--dry-run", "Show upgrade plan without executing").option(
|
|
@@ -3558,7 +3587,7 @@ var upgradeCommand = {
|
|
|
3558
3587
|
await run3(options);
|
|
3559
3588
|
});
|
|
3560
3589
|
depsCommand.register(upgradeCmd);
|
|
3561
|
-
|
|
3590
|
+
globalDepsCommand.register(upgradeCmd);
|
|
3562
3591
|
}
|
|
3563
3592
|
};
|
|
3564
3593
|
|