@lark-apaas/miaoda-cli 0.1.19-alpha.834fd32 → 0.1.19-alpha.f3e8225

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 CHANGED
@@ -88,7 +88,7 @@ miaoda registry add deck-slide --overwrite # 目标已存在时覆盖(
88
88
  ## 环境变量
89
89
 
90
90
  - `MIAODA_APP_ID`:默认应用 ID,等价于 `--app-id`。
91
- - `MIAODA_CANARY_HEADER`:HTTP 请求的 `x-tt-env` 小流量头取值。未设置时默认 `boe_miaoda_doubao`;设为空字符串则不带该头(例:`export MIAODA_CANARY_HEADER=boe_xxx`)。值形如 `ppe_xxx` 时额外带上 `x-use-ppe: 1`。
91
+ - `MIAODA_CANARY_HEADER`:HTTP 请求的 `x-tt-env` 小流量头取值。未设置时默认 `boe_miaoda_ccm`;设为空字符串则不带该头(例:`export MIAODA_CANARY_HEADER=boe_xxx`)。值形如 `ppe_xxx` 时额外带上 `x-use-ppe: 1`。
92
92
 
93
93
  ## 输出契约
94
94
 
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.buildDesignOutput = buildDesignOutput;
7
+ exports.cleanDesignDist = cleanDesignDist;
7
8
  const node_fs_1 = __importDefault(require("node:fs"));
8
9
  const node_path_1 = __importDefault(require("node:path"));
9
10
  const error_1 = require("../../../../utils/error");
@@ -39,3 +40,10 @@ function buildDesignOutput(opts) {
39
40
  throw new error_1.AppError('DEPLOY_BUILD_FAILED', `design build failed: ${err.message}`);
40
41
  }
41
42
  }
43
+ /**
44
+ * 删除 <projectDir>/dist(本地构建产物)。幂等:不存在也不报错(force)。
45
+ * design 部署收尾调用,部署动作结束后不在用户项目里留产物。
46
+ */
47
+ function cleanDesignDist(projectDir) {
48
+ node_fs_1.default.rmSync(node_path_1.default.join(projectDir, constants_1.DIST_DIR), { recursive: true, force: true });
49
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.savePluginInstances = exports.LocalReleaseStatus = exports.finalizeLocalRelease = exports.createLocalRelease = exports.uploadArtifacts = exports.uploadDesignArtifacts = exports.buildDesignOutput = exports.runBuild = exports.preRelease = exports.prepareDeployContext = void 0;
3
+ exports.savePluginInstances = exports.LocalReleaseStatus = exports.finalizeLocalRelease = exports.createLocalRelease = exports.uploadArtifacts = exports.uploadDesignArtifacts = exports.cleanDesignDist = exports.buildDesignOutput = exports.runBuild = exports.preRelease = exports.prepareDeployContext = void 0;
4
4
  var context_1 = require("./context");
5
5
  Object.defineProperty(exports, "prepareDeployContext", { enumerable: true, get: function () { return context_1.prepareDeployContext; } });
6
6
  var pre_release_1 = require("./pre-release");
@@ -9,6 +9,7 @@ var build_1 = require("./build");
9
9
  Object.defineProperty(exports, "runBuild", { enumerable: true, get: function () { return build_1.runBuild; } });
10
10
  var design_build_1 = require("./design-build");
11
11
  Object.defineProperty(exports, "buildDesignOutput", { enumerable: true, get: function () { return design_build_1.buildDesignOutput; } });
12
+ Object.defineProperty(exports, "cleanDesignDist", { enumerable: true, get: function () { return design_build_1.cleanDesignDist; } });
12
13
  var design_upload_1 = require("./design-upload");
13
14
  Object.defineProperty(exports, "uploadDesignArtifacts", { enumerable: true, get: function () { return design_upload_1.uploadDesignArtifacts; } });
14
15
  var upload_1 = require("./upload");
@@ -20,6 +20,8 @@ exports.EXCLUDES = new Set([
20
20
  '.gitignore',
21
21
  '.npmrc',
22
22
  '.agent',
23
+ '.agents',
24
+ 'skills',
23
25
  '.env',
24
26
  '.env.local',
25
27
  'README.md',
@@ -20,28 +20,34 @@ async function designLocalPublishPipeline(opts) {
20
20
  throw new error_1.AppError('DEPLOY_PRE_RELEASE_DATA_MISSING', 'preRelease did not return a `data` map — backend tcc may not be configured for current template_key');
21
21
  }
22
22
  const data = pre.data;
23
- if (!opts.skipBuild) {
24
- (0, index_1.buildDesignOutput)({ projectDir: ctx.projectDir });
25
- }
26
- (0, logger_1.log)('deploy', 'Creating local release...');
27
- const release = await (0, index_1.createLocalRelease)(ctx.appId, pre.version);
23
+ // dist 是本地构建产物,部署动作结束(无论成败)都清掉,不在用户项目里留产物。
28
24
  try {
29
- await (0, index_1.uploadDesignArtifacts)({ projectDir: ctx.projectDir, data });
30
- await (0, index_1.finalizeLocalRelease)(ctx.appId, release.releaseID, index_1.LocalReleaseStatus.Finished);
31
- }
32
- catch (err) {
33
- await (0, index_1.finalizeLocalRelease)(ctx.appId, release.releaseID, index_1.LocalReleaseStatus.Failed);
34
- throw err;
25
+ if (!opts.skipBuild) {
26
+ (0, index_1.buildDesignOutput)({ projectDir: ctx.projectDir });
27
+ }
28
+ (0, logger_1.log)('deploy', 'Creating local release...');
29
+ const release = await (0, index_1.createLocalRelease)(ctx.appId, pre.version);
30
+ try {
31
+ await (0, index_1.uploadDesignArtifacts)({ projectDir: ctx.projectDir, data });
32
+ await (0, index_1.finalizeLocalRelease)(ctx.appId, release.releaseID, index_1.LocalReleaseStatus.Finished);
33
+ }
34
+ catch (err) {
35
+ await (0, index_1.finalizeLocalRelease)(ctx.appId, release.releaseID, index_1.LocalReleaseStatus.Failed);
36
+ throw err;
37
+ }
38
+ if (release.onlineUrl !== undefined && release.onlineUrl !== '') {
39
+ (0, spark_meta_1.writeSparkMeta)(ctx.projectDir, { appUrl: release.onlineUrl });
40
+ }
41
+ (0, logger_1.log)('deploy', 'Deployed successfully');
42
+ return {
43
+ appId: ctx.appId,
44
+ version: pre.version,
45
+ url: release.onlineUrl ?? '',
46
+ releaseID: release.releaseID,
47
+ preReleaseID: pre.preReleaseID,
48
+ };
35
49
  }
36
- if (release.onlineUrl !== undefined && release.onlineUrl !== '') {
37
- (0, spark_meta_1.writeSparkMeta)(ctx.projectDir, { appUrl: release.onlineUrl });
50
+ finally {
51
+ (0, index_1.cleanDesignDist)(ctx.projectDir);
38
52
  }
39
- (0, logger_1.log)('deploy', 'Deployed successfully');
40
- return {
41
- appId: ctx.appId,
42
- version: pre.version,
43
- url: release.onlineUrl ?? '',
44
- releaseID: release.releaseID,
45
- preReleaseID: pre.preReleaseID,
46
- };
47
53
  }
@@ -64,7 +64,7 @@ function createClient(opts) {
64
64
  * 默认灰度泳道。当前 miaoda CLI 接入的新接口(modern deploy 等)只在该泳道生效,
65
65
  * 缺省走这个。MIAODA_CANARY_HEADER 可显式覆盖;设为空字符串则去掉头。
66
66
  */
67
- const DEFAULT_CANARY_HEADER = 'boe_miaoda_doubao';
67
+ const DEFAULT_CANARY_HEADER = 'boe_miaoda_ccm';
68
68
  /**
69
69
  * 注入 x-tt-env 小流量头:env 显式设值 > DEFAULT_CANARY_HEADER。
70
70
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-cli",
3
- "version": "0.1.19-alpha.834fd32",
3
+ "version": "0.1.19-alpha.f3e8225",
4
4
  "description": "Miaoda 平台命令行工具,面向 Agent 调用",
5
5
  "type": "commonjs",
6
6
  "bin": {