@gct-paas/cli 0.1.9 → 0.1.10

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/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.10] - 2026-04-02
11
+
12
+ ### Changed
13
+
14
+ - update-catalog-env 支持传递 tag 标识
15
+ - 新增 catalog 动态更新包 @gct-paas/core-components
16
+
10
17
  ## [0.1.9] - 2026-04-02
11
18
 
12
19
  ### Added
@@ -43,12 +43,16 @@ class NginxStartAction {
43
43
  * Windows 下 nginx 不会自动 daemonize,使用 spawn detached 模式后台启动
44
44
  */
45
45
  startNginx() {
46
- (0, _nodeFs.mkdirSync)((0, _nodePath.resolve)(this.nginxDir, "logs"), {
47
- recursive: true
48
- });
49
- (0, _nodeFs.mkdirSync)((0, _nodePath.resolve)(this.nginxDir, "temp"), {
50
- recursive: true
51
- });
46
+ for (const dir of ["logs", "temp"]) {
47
+ const dirPath = (0, _nodePath.resolve)(this.nginxDir, dir);
48
+ (0, _nodeFs.rmSync)(dirPath, {
49
+ recursive: true,
50
+ force: true
51
+ });
52
+ (0, _nodeFs.mkdirSync)(dirPath, {
53
+ recursive: true
54
+ });
55
+ }
52
56
  const nginxDirNormalized = this.nginxDir.split(_nodePath.sep).join("/");
53
57
  const child = (0, _nodeChild_process.spawn)("nginx", ["-p", nginxDirNormalized, "-c", "nginx.conf"], {
54
58
  cwd: process.cwd(),
@@ -14,13 +14,16 @@ var _path = _interopRequireDefault(require("path"));
14
14
  var _constants = require("../../constants/index.cjs");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  class UpdateCatalogEnvAction {
17
- async run() {
17
+ async run(options) {
18
18
  _consola.consola.start("\u4FEE\u6539 pnpm catalog \u914D\u7F6E...");
19
- const branch = await (0, _utils.getBranchName)();
20
- const tag = _constants.branch_2_tag[branch];
19
+ let tag = options?.tag;
21
20
  if (!tag) {
22
- _consola.consola.info(`\u5F53\u524D\u5206\u652F ${branch} \u4E0D\u5339\u914D\u4EFB\u4F55\u73AF\u5883\u6807\u7B7E\uFF0C\u8DF3\u8FC7 catalog \u8BBE\u7F6E`);
23
- return;
21
+ const branch = await (0, _utils.getBranchName)();
22
+ tag = _constants.branch_2_tag[branch];
23
+ if (!tag) {
24
+ _consola.consola.info(`\u5F53\u524D\u5206\u652F ${branch} \u4E0D\u5339\u914D\u4EFB\u4F55\u73AF\u5883\u6807\u7B7E\uFF0C\u8DF3\u8FC7 catalog \u8BBE\u7F6E`);
25
+ return;
26
+ }
24
27
  }
25
28
  const catalogPath = _path.default.join(process.cwd(), "pnpm-workspace.yaml");
26
29
  const pnpmConfig = _jsYaml.default.load(await _fsExtra.default.readFile(catalogPath, "utf-8"));
@@ -1,3 +1,5 @@
1
1
  export declare class UpdateCatalogEnvAction {
2
- run(): Promise<void>;
2
+ run(options?: {
3
+ tag?: string;
4
+ }): Promise<void>;
3
5
  }
@@ -7,10 +7,10 @@ exports.UpdateCatalogEnvCommand = void 0;
7
7
  var _actions = require("../../actions/index.cjs");
8
8
  class UpdateCatalogEnvCommand {
9
9
  load(program) {
10
- program.command("update-catalog-env").description("\u6839\u636E git \u5206\u652F\uFF0C\u66F4\u65B0\u9879\u76EE pnpm catalog \u914D\u7F6E\u4E3A\u5177\u4F53\u73AF\u5883").action(this.action.bind(this));
10
+ program.command("update-catalog-env").description("\u6839\u636E git \u5206\u652F\uFF0C\u66F4\u65B0\u9879\u76EE pnpm catalog \u914D\u7F6E\u4E3A\u5177\u4F53\u73AF\u5883").option("-t, --tag <tag>", "\u6307\u5B9A\u73AF\u5883\u6807\u7B7E\uFF0C\u4E0D\u6307\u5B9A\u65F6\u6839\u636E git \u5206\u652F\u81EA\u52A8\u63A8\u65AD").action(this.action.bind(this));
11
11
  }
12
- async action() {
13
- await new _actions.UpdateCatalogEnvAction().run();
12
+ async action(options) {
13
+ await new _actions.UpdateCatalogEnvAction().run(options);
14
14
  }
15
15
  }
16
16
  exports.UpdateCatalogEnvCommand = UpdateCatalogEnvCommand;
@@ -2,5 +2,7 @@ import { Command } from 'commander';
2
2
  import { ICommand } from '../../interface';
3
3
  export declare class UpdateCatalogEnvCommand implements ICommand {
4
4
  load(program: Command): void;
5
- action(): Promise<void>;
5
+ action(options: {
6
+ tag?: string;
7
+ }): Promise<void>;
6
8
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.lib_packages = exports.branch_2_tag = void 0;
7
- const lib_packages = exports.lib_packages = ["@gct-paas/api", "@gct-paas/core", "@gct-paas/core-mobile", "@gct-paas/core-pad", "@gct-paas/core-web", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-pad", "@gct-paas/design-web", "@gct-paas/native", "@gct-paas/render", "@gct-paas/render-mobile", "@gct-paas/render-pad", "@gct-paas/render-web", "@gct-paas/schema", "@gct-paas/v-ben"];
7
+ const lib_packages = exports.lib_packages = ["@gct-paas/api", "@gct-paas/core", "@gct-paas/core-components", "@gct-paas/core-mobile", "@gct-paas/core-pad", "@gct-paas/core-web", "@gct-paas/design", "@gct-paas/design-mobile", "@gct-paas/design-pad", "@gct-paas/design-web", "@gct-paas/native", "@gct-paas/render", "@gct-paas/render-mobile", "@gct-paas/render-pad", "@gct-paas/render-web", "@gct-paas/schema", "@gct-paas/scss", "@gct-paas/v-ben"];
8
8
  const branch_2_tag = exports.branch_2_tag = {
9
9
  "paas-dev": "dev",
10
10
  "paas-test": "test"
@@ -1,5 +1,5 @@
1
1
  import { execSync, spawn } from "node:child_process";
2
- import { mkdirSync } from "node:fs";
2
+ import { mkdirSync, rmSync } from "node:fs";
3
3
  import { resolve, sep } from "node:path";
4
4
  import { consola } from "consola";
5
5
  function sleep(ms) {
@@ -33,8 +33,11 @@ export class NginxStartAction {
33
33
  * Windows 下 nginx 不会自动 daemonize,使用 spawn detached 模式后台启动
34
34
  */
35
35
  startNginx() {
36
- mkdirSync(resolve(this.nginxDir, "logs"), { recursive: true });
37
- mkdirSync(resolve(this.nginxDir, "temp"), { recursive: true });
36
+ for (const dir of ["logs", "temp"]) {
37
+ const dirPath = resolve(this.nginxDir, dir);
38
+ rmSync(dirPath, { recursive: true, force: true });
39
+ mkdirSync(dirPath, { recursive: true });
40
+ }
38
41
  const nginxDirNormalized = this.nginxDir.split(sep).join("/");
39
42
  const child = spawn("nginx", ["-p", nginxDirNormalized, "-c", "nginx.conf"], {
40
43
  cwd: process.cwd(),
@@ -1,3 +1,5 @@
1
1
  export declare class UpdateCatalogEnvAction {
2
- run(): Promise<void>;
2
+ run(options?: {
3
+ tag?: string;
4
+ }): Promise<void>;
3
5
  }
@@ -7,13 +7,16 @@ import { getBranchName } from "../../utils/index.mjs";
7
7
  import path from "path";
8
8
  import { branch_2_tag, lib_packages } from "../../constants/index.mjs";
9
9
  export class UpdateCatalogEnvAction {
10
- async run() {
10
+ async run(options) {
11
11
  consola.start("\u4FEE\u6539 pnpm catalog \u914D\u7F6E...");
12
- const branch = await getBranchName();
13
- const tag = branch_2_tag[branch];
12
+ let tag = options?.tag;
14
13
  if (!tag) {
15
- consola.info(`\u5F53\u524D\u5206\u652F ${branch} \u4E0D\u5339\u914D\u4EFB\u4F55\u73AF\u5883\u6807\u7B7E\uFF0C\u8DF3\u8FC7 catalog \u8BBE\u7F6E`);
16
- return;
14
+ const branch = await getBranchName();
15
+ tag = branch_2_tag[branch];
16
+ if (!tag) {
17
+ consola.info(`\u5F53\u524D\u5206\u652F ${branch} \u4E0D\u5339\u914D\u4EFB\u4F55\u73AF\u5883\u6807\u7B7E\uFF0C\u8DF3\u8FC7 catalog \u8BBE\u7F6E`);
18
+ return;
19
+ }
17
20
  }
18
21
  const catalogPath = path.join(process.cwd(), "pnpm-workspace.yaml");
19
22
  const pnpmConfig = jsYaml.load(await fse.readFile(catalogPath, "utf-8"));
@@ -2,5 +2,7 @@ import { Command } from 'commander';
2
2
  import { ICommand } from '../../interface';
3
3
  export declare class UpdateCatalogEnvCommand implements ICommand {
4
4
  load(program: Command): void;
5
- action(): Promise<void>;
5
+ action(options: {
6
+ tag?: string;
7
+ }): Promise<void>;
6
8
  }
@@ -1,9 +1,9 @@
1
1
  import { UpdateCatalogEnvAction } from "../../actions/index.mjs";
2
2
  export class UpdateCatalogEnvCommand {
3
3
  load(program) {
4
- program.command("update-catalog-env").description("\u6839\u636E git \u5206\u652F\uFF0C\u66F4\u65B0\u9879\u76EE pnpm catalog \u914D\u7F6E\u4E3A\u5177\u4F53\u73AF\u5883").action(this.action.bind(this));
4
+ program.command("update-catalog-env").description("\u6839\u636E git \u5206\u652F\uFF0C\u66F4\u65B0\u9879\u76EE pnpm catalog \u914D\u7F6E\u4E3A\u5177\u4F53\u73AF\u5883").option("-t, --tag <tag>", "\u6307\u5B9A\u73AF\u5883\u6807\u7B7E\uFF0C\u4E0D\u6307\u5B9A\u65F6\u6839\u636E git \u5206\u652F\u81EA\u52A8\u63A8\u65AD").action(this.action.bind(this));
5
5
  }
6
- async action() {
7
- await new UpdateCatalogEnvAction().run();
6
+ async action(options) {
7
+ await new UpdateCatalogEnvAction().run(options);
8
8
  }
9
9
  }
@@ -1,6 +1,7 @@
1
1
  export const lib_packages = [
2
2
  "@gct-paas/api",
3
3
  "@gct-paas/core",
4
+ "@gct-paas/core-components",
4
5
  "@gct-paas/core-mobile",
5
6
  "@gct-paas/core-pad",
6
7
  "@gct-paas/core-web",
@@ -14,6 +15,7 @@ export const lib_packages = [
14
15
  "@gct-paas/render-pad",
15
16
  "@gct-paas/render-web",
16
17
  "@gct-paas/schema",
18
+ "@gct-paas/scss",
17
19
  "@gct-paas/v-ben"
18
20
  ];
19
21
  export const branch_2_tag = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "bin": {
@@ -68,7 +68,7 @@
68
68
  "@types/node": "^25.0.10",
69
69
  "@types/pacote": "^11.1.8",
70
70
  "tsx": "^4.21.0",
71
- "typescript": "^5.9.3",
71
+ "typescript": "^6.0.2",
72
72
  "unbuild": "^3.6.1"
73
73
  }
74
74
  }