@yarn-tool/pkg-entry-util 3.0.34 → 3.0.35

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.
@@ -1,21 +1,11 @@
1
1
  "use strict";
2
- /**
3
- * 共享根目錄腳本預設 / Shared Root Scripts Preset
4
- *
5
- * 提供根目錄套件共用的預設 npm scripts
6
- * Provides shared npm scripts for root packages
7
- *
8
- * 此模組被 root-scripts 和 ws-root-scripts 共用
9
- * This module is shared by root-scripts and ws-root-scripts
10
- */
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports._defaultCiInstallDeps = void 0;
13
4
  exports.defaultSharedRootScripts = defaultSharedRootScripts;
14
5
  /**
15
- * CI 環境安裝腳本 / CI environment install script
6
+ * CI environment install script
16
7
  *
17
- * 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm
18
- * Installs core development tools
8
+ * Installs development dependencies
19
9
  */
20
10
  exports._defaultCiInstallDeps = [
21
11
  'yarn-tool',
@@ -32,43 +22,32 @@ exports._defaultCiInstallDeps = [
32
22
  '@yarn-tool/require-resolve',
33
23
  ];
34
24
  /**
35
- * 共享根目錄預設腳本 / Shared root default scripts
25
+ * Shared root default scripts
36
26
  *
37
27
  * 適用於所有根目錄類型的通用管理腳本
38
- * General management scripts for all root package types
39
- *
40
- * @returns 包含共享根目錄腳本的物件 / Object containing shared root scripts
41
- *
42
- * 包含腳本 / Includes scripts:
43
- * - ci:install: CI 環境安裝與依賴設定 / CI environment install and dependency setup
44
- * - test:jest:clearCache: 清除 Jest 快取 / Clear Jest cache
45
- * - install:resetLockfile: 重置鎖定檔安裝 / Install with reset lockfile
46
- * - install:frozenLockfile: 凍結鎖定檔安裝 / Install with frozen lockfile
47
- * - ws:fix-all: 修復所有工作區問題 / Fix all workspace issues
48
- * - ws:fix-all:resetStaticFiles: 修復並重置靜態檔 / Fix and reset static files
49
28
  */
50
29
  function defaultSharedRootScripts() {
51
30
  return {
52
31
  /**
53
- * CI 環境安裝腳本 / CI environment install script
32
+ * CI environment install script
54
33
  *
55
- * 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm
34
+ * 安裝核心開發工具
56
35
  * Installs core development tools
57
36
  */
58
37
  "ci:install": `node --run ci:install:pnpm`,
59
38
  "ci:install:yarn": `yarn install --frozen-lockfile && yarn add -W ${exports._defaultCiInstallDeps.join(" ")}`,
60
39
  "ci:install:pnpm": `pnpm install --frozen-lockfile && pnpm add --workspace ${exports._defaultCiInstallDeps.join(" ")}`,
61
- /** 清除 Jest 快取 / Clear Jest cache */
40
+ /** Clear Jest cache */
62
41
  "test:jest:clearCache": "jest --clearCache",
63
- /** 重置鎖定檔安裝 / Install with reset lockfile */
42
+ /** Install with reset lockfile */
64
43
  "install:resetLockfile": "yarn-tool install --reset-lockfile",
65
- /** 凍結鎖定檔安裝 / Install with frozen lockfile */
44
+ /** Install with frozen lockfile */
66
45
  "install:frozenLockfile": "yarn-tool install --frozen-lockfile",
67
- /** 修復所有工作區問題 / Fix all workspace issues */
46
+ /** 修復並且更新套件資訊 */
68
47
  "ws:fix-all": "yarn-tool fix-all --overwriteHostedGitInfo",
69
- /** 修復時一併補齊靜態檔案 / Also add missing static files while fixing */
48
+ /** 修復時一併補齊靜態檔案 */
70
49
  "ws:fix-all:addStaticFiles": "node --run ws:fix-all -- --addStaticFiles",
71
- /** 修復並重置靜態檔 / Fix and reset static files */
50
+ /** 修復並重置靜態檔 */
72
51
  "ws:fix-all:resetStaticFiles": "node --run ws:fix-all -- --resetStaticFiles",
73
52
  };
74
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA4CH,4DA+BC;AAzED;;;;;GAKG;AACU,QAAA,qBAAqB,GAAG;IACpC,WAAW;IACX,OAAO;IACP,MAAM;IACN,MAAM;IAEN,YAAY;IAEZ,SAAS;IACT,KAAK;IAEL,SAAS;IACT,MAAM;IAEN,yBAAyB;IACzB,sBAAsB;IAEtB,4BAA4B;CACnB,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,wBAAwB;IAEvC,OAAO;QACN;;;;;WAKG;QACH,YAAY,EAAE,4BAA4B;QAC1C,iBAAiB,EAAE,iDAAiD,6BAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACrG,iBAAiB,EAAE,0DAA0D,6BAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAE9G,oCAAoC;QACpC,sBAAsB,EAAE,mBAAmB;QAE3C,4CAA4C;QAC5C,uBAAuB,EAAE,oCAAoC;QAE7D,6CAA6C;QAC7C,wBAAwB,EAAE,qCAAqC;QAE/D,2CAA2C;QAC3C,YAAY,EAAE,4CAA4C;QAE1D,+DAA+D;QAC/D,2BAA2B,EAAE,2CAA2C;QAExE,4CAA4C;QAC5C,6BAA6B,EAAE,6CAA6C;KAC5E,CAAA;AACF,CAAC","sourcesContent":["/**\n * 共享根目錄腳本預設 / Shared Root Scripts Preset\n *\n * 提供根目錄套件共用的預設 npm scripts\n * Provides shared npm scripts for root packages\n *\n * 此模組被 root-scripts 和 ws-root-scripts 共用\n * This module is shared by root-scripts and ws-root-scripts\n */\n\n/**\n * CI 環境安裝腳本 / CI environment install script\n *\n * 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm\n * Installs core development tools\n */\nexport const _defaultCiInstallDeps = [\n\t'yarn-tool',\n\t'lerna',\n\t'ynpx',\n\t'pnpm',\n\n\t'typescript',\n\n\t'ts-node',\n\t'tsx',\n\n\t'ts-jest',\n\t'jest',\n\n\t'@bluelovers/jest-config',\n\t'@bluelovers/tsconfig',\n\n\t'@yarn-tool/require-resolve',\n] as const;\n\n/**\n * 共享根目錄預設腳本 / Shared root default scripts\n *\n * 適用於所有根目錄類型的通用管理腳本\n * General management scripts for all root package types\n *\n * @returns 包含共享根目錄腳本的物件 / Object containing shared root scripts\n *\n * 包含腳本 / Includes scripts:\n * - ci:install: CI 環境安裝與依賴設定 / CI environment install and dependency setup\n * - test:jest:clearCache: 清除 Jest 快取 / Clear Jest cache\n * - install:resetLockfile: 重置鎖定檔安裝 / Install with reset lockfile\n * - install:frozenLockfile: 凍結鎖定檔安裝 / Install with frozen lockfile\n * - ws:fix-all: 修復所有工作區問題 / Fix all workspace issues\n * - ws:fix-all:resetStaticFiles: 修復並重置靜態檔 / Fix and reset static files\n */\nexport function defaultSharedRootScripts()\n{\n\treturn {\n\t\t/**\n\t\t * CI 環境安裝腳本 / CI environment install script\n\t\t *\n\t\t * 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm\n\t\t * Installs core development tools\n\t\t */\n\t\t\"ci:install\": `node --run ci:install:pnpm`,\n\t\t\"ci:install:yarn\": `yarn install --frozen-lockfile && yarn add -W ${_defaultCiInstallDeps.join(\" \")}`,\n\t\t\"ci:install:pnpm\": `pnpm install --frozen-lockfile && pnpm add --workspace ${_defaultCiInstallDeps.join(\" \")}`,\n\n\t\t/** 清除 Jest 快取 / Clear Jest cache */\n\t\t\"test:jest:clearCache\": \"jest --clearCache\",\n\n\t\t/** 重置鎖定檔安裝 / Install with reset lockfile */\n\t\t\"install:resetLockfile\": \"yarn-tool install --reset-lockfile\",\n\n\t\t/** 凍結鎖定檔安裝 / Install with frozen lockfile */\n\t\t\"install:frozenLockfile\": \"yarn-tool install --frozen-lockfile\",\n\n\t\t/** 修復所有工作區問題 / Fix all workspace issues */\n\t\t\"ws:fix-all\": \"yarn-tool fix-all --overwriteHostedGitInfo\",\n\n\t\t/** 修復時一併補齊靜態檔案 / Also add missing static files while fixing */\n\t\t\"ws:fix-all:addStaticFiles\": \"node --run ws:fix-all -- --addStaticFiles\",\n\n\t\t/** 修復並重置靜態檔 / Fix and reset static files */\n\t\t\"ws:fix-all:resetStaticFiles\": \"node --run ws:fix-all -- --resetStaticFiles\",\n\t}\n}\n"]}
1
+ {"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";;;AA8BA,4DA+BC;AA7DD;;;;GAIG;AACU,QAAA,qBAAqB,GAAG;IACpC,WAAW;IACX,OAAO;IACP,MAAM;IACN,MAAM;IAEN,YAAY;IAEZ,SAAS;IACT,KAAK;IAEL,SAAS;IACT,MAAM;IAEN,yBAAyB;IACzB,sBAAsB;IAEtB,4BAA4B;CACnB,CAAC;AAEX;;;;GAIG;AACH,SAAgB,wBAAwB;IAEvC,OAAO;QACN;;;;;WAKG;QACH,YAAY,EAAE,4BAA4B;QAC1C,iBAAiB,EAAE,iDAAiD,6BAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACrG,iBAAiB,EAAE,0DAA0D,6BAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAE9G,uBAAuB;QACvB,sBAAsB,EAAE,mBAAmB;QAE3C,kCAAkC;QAClC,uBAAuB,EAAE,oCAAoC;QAE7D,mCAAmC;QACnC,wBAAwB,EAAE,qCAAqC;QAE/D,iBAAiB;QACjB,YAAY,EAAE,4CAA4C;QAE1D,kBAAkB;QAClB,2BAA2B,EAAE,2CAA2C;QAExE,eAAe;QACf,6BAA6B,EAAE,6CAA6C;KAC5E,CAAA;AACF,CAAC","sourcesContent":["/**\n * CI environment install script\n *\n * Installs development dependencies\n */\nexport const _defaultCiInstallDeps = [\n\t'yarn-tool',\n\t'lerna',\n\t'ynpx',\n\t'pnpm',\n\n\t'typescript',\n\n\t'ts-node',\n\t'tsx',\n\n\t'ts-jest',\n\t'jest',\n\n\t'@bluelovers/jest-config',\n\t'@bluelovers/tsconfig',\n\n\t'@yarn-tool/require-resolve',\n] as const;\n\n/**\n * Shared root default scripts\n *\n * 適用於所有根目錄類型的通用管理腳本\n */\nexport function defaultSharedRootScripts()\n{\n\treturn {\n\t\t/**\n\t\t * CI environment install script\n\t\t *\n\t\t * 安裝核心開發工具\n\t\t * Installs core development tools\n\t\t */\n\t\t\"ci:install\": `node --run ci:install:pnpm`,\n\t\t\"ci:install:yarn\": `yarn install --frozen-lockfile && yarn add -W ${_defaultCiInstallDeps.join(\" \")}`,\n\t\t\"ci:install:pnpm\": `pnpm install --frozen-lockfile && pnpm add --workspace ${_defaultCiInstallDeps.join(\" \")}`,\n\n\t\t/** Clear Jest cache */\n\t\t\"test:jest:clearCache\": \"jest --clearCache\",\n\n\t\t/** Install with reset lockfile */\n\t\t\"install:resetLockfile\": \"yarn-tool install --reset-lockfile\",\n\n\t\t/** Install with frozen lockfile */\n\t\t\"install:frozenLockfile\": \"yarn-tool install --frozen-lockfile\",\n\n\t\t/** 修復並且更新套件資訊 */\n\t\t\"ws:fix-all\": \"yarn-tool fix-all --overwriteHostedGitInfo\",\n\n\t\t/** 修復時一併補齊靜態檔案 */\n\t\t\"ws:fix-all:addStaticFiles\": \"node --run ws:fix-all -- --addStaticFiles\",\n\n\t\t/** 修復並重置靜態檔 */\n\t\t\"ws:fix-all:resetStaticFiles\": \"node --run ws:fix-all -- --resetStaticFiles\",\n\t}\n}\n"]}
@@ -1,19 +1,12 @@
1
- /**
2
- * 工作區根目錄腳本預設 / Workspace Root Scripts Preset
3
- *
4
- * 提供 Yarn/Lerna 工作區根目錄的預設 npm scripts
5
- * Provides default npm scripts for Yarn/Lerna workspace root
6
- */
7
1
  import { EnumScriptsEntry } from '../../field/scripts';
8
2
  /**
9
- * 產生「全部執行」與「僅變更執行」腳本對 / Generate "all" and "since" script pairs
3
+ * 產生「全部執行」與「僅變更執行」腳本對
10
4
  *
11
5
  * 為指定腳本名稱產生對應的 `:all`(全部工作區)與 `:since`(僅變更)版本
12
- * Generates corresponding `:all` (all workspaces) and `:since` (changed only) versions
13
6
  *
14
- * @template T - 基礎腳本名稱 / Base script name
15
- * @param script - 基礎腳本名稱 / Base script name
16
- * @returns 包含 all 與 since 變體的腳本物件 / Object containing all and since variants
7
+ * @template T - 基礎腳本名稱
8
+ * @param script - 基礎腳本名稱
9
+ * @returns 包含 all 與 since 變體的腳本物件
17
10
  *
18
11
  * @example
19
12
  * ```typescript
@@ -23,89 +16,54 @@ import { EnumScriptsEntry } from '../../field/scripts';
23
16
  */
24
17
  export declare function _runAllOrSince<T extends string>(script: T): ({ [x in `${T}:all`]: string; } & { [y in `${T}:since`]: string; });
25
18
  /**
26
- * 工作區根目錄預設腳本 / Default scripts for workspace root
19
+ * 工作區根目錄預設腳本
27
20
  *
28
21
  * 適用於 monorepo 工作區根目錄的完整管理腳本集合
29
- * Complete management script set for monorepo workspace root
30
- *
31
- * @returns 包含工作區管理腳本的物件 / Object containing workspace management scripts
32
22
  *
33
- * 核心功能 / Core features:
34
- * - 跨工作區腳本執行(全部或僅變更)/ Cross-workspace script execution (all or changed only)
35
- * - Lerna 發布流程 / Lerna publishing workflow
36
- * - 發布前檢查與準備 / Pre-publish checks and preparation
37
- * - 相依工作區連結修復 / Dependency workspace links fixing
38
- * - 統一依賴更新 / Unified dependency updates
39
- * - 發布後變更日誌更新 / Post-publish changelog updates
23
+ * @returns 包含工作區管理腳本的物件
40
24
  *
41
- * 包含腳本 / Includes scripts:
42
- * - test: 執行變更工作區測試 / Run changed workspaces tests
43
- * - test:all|test:since: 全部/變更測試 / All/changed tests
44
- * - test:tsd:all|test:tsd:since: 型別檢查 / Type checking
45
- * - test:snapshot:all|test:snapshot:since: 快照更新 / Snapshot updates
46
- * - build:all|build:since: 建構 / Build
47
- * - review:all|review:since: 審查 / Review
48
- * - coverage:all|coverage:since: 覆蓋率 / Coverage
49
- * - lint:all|lint:since: 檢查 / Lint
50
- * - preversion: 版本更新前測試 / Pre-version test
51
- * - postversion: 版本更新後修復 / Post-version fix
52
- * - lerna:publish: Lerna 發布 / Lerna publish
53
- * - lerna:publish:yes|lerna:publish:yes:force: 確認發布 / Confirmed publish
54
- * - lerna:publish:yes:patch|minor|major: 特定版本發布 / Specific version publish
55
- * - prepublishOnly:root: 發布前檢查與修復 / Pre-publish checks and fixes
56
- * - prepublishOnly:lockfile: 鎖定檔同步 / Lockfile sync
57
- * - prepublishOnly:check-bin: 二進位檔檢查 / Binary check
58
- * - prepare:fix-ws-links: 工作區連結修復 / Workspace links fix
59
- * - prepublishOnly:update: 發布前更新 / Pre-publish update
60
- * - ncu:root|ncu:ws: 根目錄/工作區依賴更新 / Root/workspace dependency updates
61
- * - sort-package-json:root|sort-package-json:ws: package.json 排序 / package.json sorting
62
- * - postpublishOnly: 發布後執行 / Post-publish execution
63
- * - postpublishOnly:ws-root-changelog: 根目錄變更日誌更新 / Root changelog update
64
- * - tsc:showConfig: TypeScript 設定顯示 / TypeScript config display
25
+ * 核心功能:
26
+ * - 跨工作區腳本執行(全部或僅變更)
27
+ * - Lerna 發布流程
28
+ * - 發布前檢查與準備
29
+ * - 相依工作區連結修復
30
+ * - 統一依賴更新
31
+ * - 發布後變更日誌更新
65
32
  */
66
33
  export declare function defaultWorkspaceRootScripts(): {
67
- /** 發布前檢查與修復 / Pre-publish checks and fixes */
34
+ /** 發布前檢查與修復 */
68
35
  "prepublishOnly:root": string;
69
- /** 鎖定檔同步 / Lockfile sync */
36
+ /** Lockfile sync */
70
37
  "prepublishOnly:lockfile": string;
71
- /** 二進位檔檢查 / Binary check */
72
- "prepublishOnly:check-bin": string;
73
- /** 工作區連結修復 / Workspace links fix */
38
+ /** pkg bin check */
39
+ "prepublishOnly:check-bin": EnumScriptsEntry;
40
+ /** Workspace links fix */
74
41
  "prepare:fix-ws-links": string;
75
- /** 發布前更新 / Pre-publish update */
42
+ /** Pre-publish update */
76
43
  "prepublishOnly:update": string;
77
- /** 依賴更新 / Dependency updates */
44
+ /** Dependency updates */
78
45
  ncu: string;
79
- "ncu:root": string;
46
+ "ncu:root": EnumScriptsEntry;
80
47
  "ncu:ws": string;
81
- /** package.json 排序 / package.json sorting */
48
+ /** package.json 排序 */
82
49
  "sort-package-json": string;
83
- "sort-package-json:root": string;
50
+ "sort-package-json:root": EnumScriptsEntry;
84
51
  "sort-package-json:ws": string;
85
- /** 發布後執行 / Post-publish execution */
52
+ /** 發布後執行 */
86
53
  postpublishOnly: string;
87
- /** 根目錄變更日誌更新 / Root changelog update */
54
+ /** 根目錄變更日誌更新 */
88
55
  "postpublishOnly:ws-root-changelog": string;
89
- /** TypeScript 設定顯示 / TypeScript config display */
90
- "tsc:showConfig": string;
91
- /** 版本更新前測試 / Test before version bump */
56
+ /** Test before version bump */
92
57
  preversion: EnumScriptsEntry;
93
- /** 版本更新後修復 / Fix after version bump */
58
+ /** Fix after version bump */
94
59
  postversion: string;
95
- /** Lerna 發布 / Lerna publish */
60
+ version: string;
61
+ /** Lerna publish */
96
62
  "lerna:publish": string;
97
- "lint:all": string;
98
- "lint:since": string;
99
- "coverage:all": string;
100
- "coverage:since": string;
101
- "review:all": string;
102
- "review:since": string;
103
63
  "build:all": string;
104
64
  "build:since": string;
105
65
  "test:snapshot:all": string;
106
66
  "test:snapshot:since": string;
107
- "test:tsd:all": string;
108
- "test:tsd:since": string;
109
67
  "test:all": string;
110
68
  "test:since": string;
111
69
  test: string;
@@ -1,23 +1,16 @@
1
1
  "use strict";
2
- /**
3
- * 工作區根目錄腳本預設 / Workspace Root Scripts Preset
4
- *
5
- * 提供 Yarn/Lerna 工作區根目錄的預設 npm scripts
6
- * Provides default npm scripts for Yarn/Lerna workspace root
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports._runAllOrSince = _runAllOrSince;
10
4
  exports.defaultWorkspaceRootScripts = defaultWorkspaceRootScripts;
11
5
  const shared_root_scripts_1 = require("./shared-root-scripts");
12
6
  /**
13
- * 產生「全部執行」與「僅變更執行」腳本對 / Generate "all" and "since" script pairs
7
+ * 產生「全部執行」與「僅變更執行」腳本對
14
8
  *
15
9
  * 為指定腳本名稱產生對應的 `:all`(全部工作區)與 `:since`(僅變更)版本
16
- * Generates corresponding `:all` (all workspaces) and `:since` (changed only) versions
17
10
  *
18
- * @template T - 基礎腳本名稱 / Base script name
19
- * @param script - 基礎腳本名稱 / Base script name
20
- * @returns 包含 all 與 since 變體的腳本物件 / Object containing all and since variants
11
+ * @template T - 基礎腳本名稱
12
+ * @param script - 基礎腳本名稱
13
+ * @returns 包含 all 與 since 變體的腳本物件
21
14
  *
22
15
  * @example
23
16
  * ```typescript
@@ -34,52 +27,26 @@ function _runAllOrSince(script) {
34
27
  };
35
28
  }
36
29
  /**
37
- * 工作區根目錄預設腳本 / Default scripts for workspace root
30
+ * 工作區根目錄預設腳本
38
31
  *
39
32
  * 適用於 monorepo 工作區根目錄的完整管理腳本集合
40
- * Complete management script set for monorepo workspace root
41
- *
42
- * @returns 包含工作區管理腳本的物件 / Object containing workspace management scripts
43
33
  *
44
- * 核心功能 / Core features:
45
- * - 跨工作區腳本執行(全部或僅變更)/ Cross-workspace script execution (all or changed only)
46
- * - Lerna 發布流程 / Lerna publishing workflow
47
- * - 發布前檢查與準備 / Pre-publish checks and preparation
48
- * - 相依工作區連結修復 / Dependency workspace links fixing
49
- * - 統一依賴更新 / Unified dependency updates
50
- * - 發布後變更日誌更新 / Post-publish changelog updates
34
+ * @returns 包含工作區管理腳本的物件
51
35
  *
52
- * 包含腳本 / Includes scripts:
53
- * - test: 執行變更工作區測試 / Run changed workspaces tests
54
- * - test:all|test:since: 全部/變更測試 / All/changed tests
55
- * - test:tsd:all|test:tsd:since: 型別檢查 / Type checking
56
- * - test:snapshot:all|test:snapshot:since: 快照更新 / Snapshot updates
57
- * - build:all|build:since: 建構 / Build
58
- * - review:all|review:since: 審查 / Review
59
- * - coverage:all|coverage:since: 覆蓋率 / Coverage
60
- * - lint:all|lint:since: 檢查 / Lint
61
- * - preversion: 版本更新前測試 / Pre-version test
62
- * - postversion: 版本更新後修復 / Post-version fix
63
- * - lerna:publish: Lerna 發布 / Lerna publish
64
- * - lerna:publish:yes|lerna:publish:yes:force: 確認發布 / Confirmed publish
65
- * - lerna:publish:yes:patch|minor|major: 特定版本發布 / Specific version publish
66
- * - prepublishOnly:root: 發布前檢查與修復 / Pre-publish checks and fixes
67
- * - prepublishOnly:lockfile: 鎖定檔同步 / Lockfile sync
68
- * - prepublishOnly:check-bin: 二進位檔檢查 / Binary check
69
- * - prepare:fix-ws-links: 工作區連結修復 / Workspace links fix
70
- * - prepublishOnly:update: 發布前更新 / Pre-publish update
71
- * - ncu:root|ncu:ws: 根目錄/工作區依賴更新 / Root/workspace dependency updates
72
- * - sort-package-json:root|sort-package-json:ws: package.json 排序 / package.json sorting
73
- * - postpublishOnly: 發布後執行 / Post-publish execution
74
- * - postpublishOnly:ws-root-changelog: 根目錄變更日誌更新 / Root changelog update
75
- * - tsc:showConfig: TypeScript 設定顯示 / TypeScript config display
36
+ * 核心功能:
37
+ * - 跨工作區腳本執行(全部或僅變更)
38
+ * - Lerna 發布流程
39
+ * - 發布前檢查與準備
40
+ * - 相依工作區連結修復
41
+ * - 統一依賴更新
42
+ * - 發布後變更日誌更新
76
43
  */
77
44
  function defaultWorkspaceRootScripts() {
78
45
  /**
79
- * 產生 Lerna 版本遞增與發布命令 / Generate Lerna version bump and publish command
46
+ * 產生 Lerna 版本遞增與發布命令
80
47
  *
81
- * @param bump - 版本遞增類型(patch|minor|major)/ Version bump type
82
- * @returns 組合命令字串 / Combined command string
48
+ * @param bump - 版本遞增類型(patch|minor|major)
49
+ * @returns 組合命令字串
83
50
  */
84
51
  const bumpVersion = (bump) => {
85
52
  return [
@@ -93,24 +60,23 @@ function defaultWorkspaceRootScripts() {
93
60
  "test": "node --run test:since",
94
61
  /**
95
62
  * 動態產生 all/since 腳本對
96
- * Dynamically generate all/since script pairs
97
63
  */
98
64
  ..._runAllOrSince('test'),
99
- ..._runAllOrSince('test:tsd'),
65
+ // ..._runAllOrSince('test:tsd'),
100
66
  ..._runAllOrSince('test:snapshot'),
101
67
  ..._runAllOrSince('build'),
102
- ..._runAllOrSince('review'),
103
- ..._runAllOrSince('coverage'),
104
- ..._runAllOrSince('lint'),
105
- /** 版本更新前測試 / Test before version bump */
68
+ // ..._runAllOrSince('review'),
69
+ // ..._runAllOrSince('coverage'),
70
+ // ..._runAllOrSince('lint'),
71
+ /** Test before version bump */
106
72
  "preversion": "pnpm run test" /* EnumScriptsEntry.preversion */,
107
- /** 版本更新後修復 / Fix after version bump */
73
+ /** Fix after version bump */
108
74
  "postversion": "yarn-tool fix-all --noStaticFiles",
109
- /** Lerna 發布 / Lerna publish */
75
+ 'version': 'node --run prepublishOnly:lerna',
76
+ /** Lerna publish */
110
77
  "lerna:publish": bumpVersion(),
111
78
  /**
112
79
  * 動態產生各類版本發布腳本
113
- * Dynamically generate version publish scripts
114
80
  */
115
81
  ...[
116
82
  'patch',
@@ -120,8 +86,6 @@ function defaultWorkspaceRootScripts() {
120
86
  /**
121
87
  * 只在第一個(patch)迭代建立 `yes` 與 `yes:force` 兩個預設別名,
122
88
  * 讓使用者不必指定版本類型也能一鍵發布
123
- * Create the `yes` and `yes:force` default aliases only on the first
124
- * (patch) iteration, so users can publish without picking a bump type
125
89
  */
126
90
  if (idx === 0) {
127
91
  a[`lerna:publish:yes`] = `node --run lerna:publish:yes:${bump} --`;
@@ -130,30 +94,30 @@ function defaultWorkspaceRootScripts() {
130
94
  a[`lerna:publish:yes:${bump}`] = bumpVersion(bump);
131
95
  return a;
132
96
  }, {}),
133
- /** 發布前檢查與修復 / Pre-publish checks and fixes */
97
+ /** 發布前檢查與修復 */
134
98
  "prepublishOnly:root": "node --run prepublishOnly:check-bin && node --run prepare:fix-ws-links",
135
- /** 鎖定檔同步 / Lockfile sync */
99
+ /** Lockfile sync */
136
100
  "prepublishOnly:lockfile": "ynpx --quiet sync-lockfile",
137
- /** 二進位檔檢查 / Binary check */
138
- "prepublishOnly:check-bin": "ynpx --quiet @yarn-tool/check-pkg-bin",
139
- /** 工作區連結修復 / Workspace links fix */
101
+ /** pkg bin check */
102
+ "prepublishOnly:check-bin": "ynpx --quiet @yarn-tool/check-pkg-bin" /* EnumScriptsEntry.PREPUBLISH_ONLY_CHECK_BIN */,
103
+ /** Workspace links fix */
140
104
  "prepare:fix-ws-links": "echo ynpx --quiet @yarn-tool/fix-ws-links",
141
- /** 發布前更新 / Pre-publish update */
105
+ /** Pre-publish update */
142
106
  "prepublishOnly:update": "pnpm run ncu && node --run sort-package-json",
143
- /** 依賴更新 / Dependency updates */
107
+ /** Dependency updates */
144
108
  "ncu": "node --run ncu:ws",
145
- "ncu:root": "yarn-tool ncu -u",
109
+ "ncu:root": "yarn-tool ncu -u" /* EnumScriptsEntry.NCU */,
146
110
  "ncu:ws": "yarn-tool ncu -u --AA",
147
- /** package.json 排序 / package.json sorting */
111
+ /** package.json 排序 */
148
112
  "sort-package-json": "node --run sort-package-json:root && node --run sort-package-json:ws",
149
- "sort-package-json:root": "yarn-tool sort",
113
+ "sort-package-json:root": "yarn-tool sort" /* EnumScriptsEntry.SORT_PACKAGE_JSON */,
150
114
  "sort-package-json:ws": "yarn-tool ws sort",
151
- /** 發布後執行 / Post-publish execution */
115
+ /** 發布後執行 */
152
116
  "postpublishOnly": "node --run postpublishOnly:ws-root-changelog & echo postpublishOnly",
153
- /** 根目錄變更日誌更新 / Root changelog update */
117
+ /** 根目錄變更日誌更新 */
154
118
  "postpublishOnly:ws-root-changelog": "ynpx ws-root-changelog & git add ./CHANGELOG.md & git commit ./CHANGELOG.md -m \"chore(changelog): update changelog toc in workspaces root\" & echo update changelog toc in workspaces root",
155
- /** TypeScript 設定顯示 / TypeScript config display */
156
- "tsc:showConfig": "ynpx get-current-tsconfig -p",
119
+ /** TypeScript 設定顯示 */
120
+ // "tsc:showConfig": EnumScriptsEntry.TSC_SHOW_CONFIG,
157
121
  };
158
122
  }
159
123
  //# sourceMappingURL=ws-root-scripts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ws-root-scripts.js","sourceRoot":"","sources":["ws-root-scripts.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAqBH,wCAaC;AA2CD,kEAoGC;AA/KD,+DAAiE;AAGjE;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,cAAc,CAAmB,MAAS;IAEzD,MAAM,GAAG,GAAG,GAAG,MAAM,MAAe,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,MAAM,QAAiB,CAAC;IAEzC,OAAO;QACN,CAAC,GAAG,CAAC,EAAE,oBAAoB,MAAM,kBAAkB;QACnD,CAAC,KAAK,CAAC,EAAE,cAAc,MAAM,iBAAiB;KAK7C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,SAAgB,2BAA2B;IAE1C;;;;;OAKG;IACH,MAAM,WAAW,GAAG,CAAC,IAAkC,EAAE,EAAE;QAC1D,OAAO;YACN,gCAAgC;YAChC,4BAA4B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,0BAA0B;SAC1B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACf,CAAC,CAAA;IAED,OAAO;QACN,GAAG,IAAA,8CAAwB,GAAE;QAE7B,MAAM,EAAE,uBAAuB;QAE/B;;;WAGG;QACH,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,cAAc,CAAC,UAAU,CAAC;QAC7B,GAAG,cAAc,CAAC,eAAe,CAAC;QAClC,GAAG,cAAc,CAAC,OAAO,CAAC;QAC1B,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC3B,GAAG,cAAc,CAAC,UAAU,CAAC;QAC7B,GAAG,cAAc,CAAC,MAAM,CAAC;QAEzB,yCAAyC;QACzC,YAAY,mDAA6B;QAEzC,uCAAuC;QACvC,aAAa,EAAE,mCAAmC;QAElD,+BAA+B;QAC/B,eAAe,EAAE,WAAW,EAAE;QAE9B;;;WAGG;QACH,GAAI;YACH,OAAO;YACP,OAAO;YACP,OAAO;SACG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YACnC;;;;;eAKG;YACH,IAAI,GAAG,KAAK,CAAC,EACb,CAAC;gBACA,CAAC,CAAC,mBAAmB,CAAC,GAAG,gCAAgC,IAAI,KAAK,CAAC;gBACnE,CAAC,CAAC,yBAAyB,CAAC,GAAG,2CAA2C,IAAI,kBAAkB,CAAC;YAClG,CAAC;YACD,CAAC,CAAC,qBAAqB,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;YACnD,OAAO,CAAC,CAAA;QACT,CAAC,EAAE,EAA4B,CAAC;QAEhC,8CAA8C;QAC9C,qBAAqB,EAAE,wEAAwE;QAE/F,4BAA4B;QAC5B,yBAAyB,EAAE,4BAA4B;QAEvD,4BAA4B;QAC5B,0BAA0B,EAAE,uCAAuC;QAEnE,oCAAoC;QACpC,sBAAsB,EAAE,2CAA2C;QAEnE,iCAAiC;QACjC,uBAAuB,EAAE,8CAA8C;QAEvE,gCAAgC;QAChC,KAAK,EAAE,mBAAmB;QAC1B,UAAU,EAAE,kBAAkB;QAC9B,QAAQ,EAAE,uBAAuB;QAEjC,6CAA6C;QAC7C,mBAAmB,EAAE,sEAAsE;QAC3F,wBAAwB,EAAE,gBAAgB;QAC1C,sBAAsB,EAAE,mBAAmB;QAE3C,qCAAqC;QACrC,iBAAiB,EAAE,qEAAqE;QAExF,wCAAwC;QACxC,mCAAmC,EAAE,6LAA6L;QAElO,kDAAkD;QAClD,gBAAgB,EAAE,8BAA8B;KAChD,CAAA;AACF,CAAC","sourcesContent":["/**\n * 工作區根目錄腳本預設 / Workspace Root Scripts Preset\n *\n * 提供 Yarn/Lerna 工作區根目錄的預設 npm scripts\n * Provides default npm scripts for Yarn/Lerna workspace root\n */\n\nimport { defaultSharedRootScripts } from './shared-root-scripts';\nimport { EnumScriptsEntry } from '../../field/scripts';\n\n/**\n * 產生「全部執行」與「僅變更執行」腳本對 / Generate \"all\" and \"since\" script pairs\n *\n * 為指定腳本名稱產生對應的 `:all`(全部工作區)與 `:since`(僅變更)版本\n * Generates corresponding `:all` (all workspaces) and `:since` (changed only) versions\n *\n * @template T - 基礎腳本名稱 / Base script name\n * @param script - 基礎腳本名稱 / Base script name\n * @returns 包含 all 與 since 變體的腳本物件 / Object containing all and since variants\n *\n * @example\n * ```typescript\n * _runAllOrSince('test')\n * // 返回: { 'test:all': 'yarn-tool ws run test --concurrency 1', 'test:since': 'node --run test:all -- --since' }\n * ```\n */\nexport function _runAllOrSince<T extends string>(script: T)\n{\n\tconst all = `${script}:all` as const;\n\tconst since = `${script}:since` as const;\n\n\treturn {\n\t\t[all]: `yarn-tool ws run ${script} --concurrency 1`,\n\t\t[since]: `node --run ${script}:all -- --since`,\n\t} as ({\n\t\t[x in `${T}:all`]: string;\n\t} & {\n\t\t[y in `${T}:since`]: string;\n\t})\n}\n\n/**\n * 工作區根目錄預設腳本 / Default scripts for workspace root\n *\n * 適用於 monorepo 工作區根目錄的完整管理腳本集合\n * Complete management script set for monorepo workspace root\n *\n * @returns 包含工作區管理腳本的物件 / Object containing workspace management scripts\n *\n * 核心功能 / Core features:\n * - 跨工作區腳本執行(全部或僅變更)/ Cross-workspace script execution (all or changed only)\n * - Lerna 發布流程 / Lerna publishing workflow\n * - 發布前檢查與準備 / Pre-publish checks and preparation\n * - 相依工作區連結修復 / Dependency workspace links fixing\n * - 統一依賴更新 / Unified dependency updates\n * - 發布後變更日誌更新 / Post-publish changelog updates\n *\n * 包含腳本 / Includes scripts:\n * - test: 執行變更工作區測試 / Run changed workspaces tests\n * - test:all|test:since: 全部/變更測試 / All/changed tests\n * - test:tsd:all|test:tsd:since: 型別檢查 / Type checking\n * - test:snapshot:all|test:snapshot:since: 快照更新 / Snapshot updates\n * - build:all|build:since: 建構 / Build\n * - review:all|review:since: 審查 / Review\n * - coverage:all|coverage:since: 覆蓋率 / Coverage\n * - lint:all|lint:since: 檢查 / Lint\n * - preversion: 版本更新前測試 / Pre-version test\n * - postversion: 版本更新後修復 / Post-version fix\n * - lerna:publish: Lerna 發布 / Lerna publish\n * - lerna:publish:yes|lerna:publish:yes:force: 確認發布 / Confirmed publish\n * - lerna:publish:yes:patch|minor|major: 特定版本發布 / Specific version publish\n * - prepublishOnly:root: 發布前檢查與修復 / Pre-publish checks and fixes\n * - prepublishOnly:lockfile: 鎖定檔同步 / Lockfile sync\n * - prepublishOnly:check-bin: 二進位檔檢查 / Binary check\n * - prepare:fix-ws-links: 工作區連結修復 / Workspace links fix\n * - prepublishOnly:update: 發布前更新 / Pre-publish update\n * - ncu:root|ncu:ws: 根目錄/工作區依賴更新 / Root/workspace dependency updates\n * - sort-package-json:root|sort-package-json:ws: package.json 排序 / package.json sorting\n * - postpublishOnly: 發布後執行 / Post-publish execution\n * - postpublishOnly:ws-root-changelog: 根目錄變更日誌更新 / Root changelog update\n * - tsc:showConfig: TypeScript 設定顯示 / TypeScript config display\n */\nexport function defaultWorkspaceRootScripts()\n{\n\t/**\n\t * 產生 Lerna 版本遞增與發布命令 / Generate Lerna version bump and publish command\n\t *\n\t * @param bump - 版本遞增類型(patch|minor|major)/ Version bump type\n\t * @returns 組合命令字串 / Combined command string\n\t */\n\tconst bumpVersion = (bump?: 'major' | 'minor' | 'patch') => {\n\t\treturn [\n\t\t\t`node --run prepublishOnly:root`,\n\t\t\t`lerna publish --no-private` + (bump ? ` --yes --bump ${bump}` : ''),\n\t\t\t`pnpm run postpublishOnly`,\n\t\t].join(' && ')\n\t}\n\n\treturn {\n\t\t...defaultSharedRootScripts(),\n\n\t\t\"test\": \"node --run test:since\",\n\n\t\t/**\n\t\t * 動態產生 all/since 腳本對\n\t\t * Dynamically generate all/since script pairs\n\t\t */\n\t\t..._runAllOrSince('test'),\n\t\t..._runAllOrSince('test:tsd'),\n\t\t..._runAllOrSince('test:snapshot'),\n\t\t..._runAllOrSince('build'),\n\t\t..._runAllOrSince('review'),\n\t\t..._runAllOrSince('coverage'),\n\t\t..._runAllOrSince('lint'),\n\n\t\t/** 版本更新前測試 / Test before version bump */\n\t\t\"preversion\": EnumScriptsEntry.preversion,\n\n\t\t/** 版本更新後修復 / Fix after version bump */\n\t\t\"postversion\": \"yarn-tool fix-all --noStaticFiles\",\n\n\t\t/** Lerna 發布 / Lerna publish */\n\t\t\"lerna:publish\": bumpVersion(),\n\n\t\t/**\n\t\t * 動態產生各類版本發布腳本\n\t\t * Dynamically generate version publish scripts\n\t\t */\n\t\t...([\n\t\t\t'patch',\n\t\t\t'minor',\n\t\t\t'major',\n\t\t] as const).reduce((a, bump, idx) => {\n\t\t\t/**\n\t\t\t * 只在第一個(patch)迭代建立 `yes` 與 `yes:force` 兩個預設別名,\n\t\t\t * 讓使用者不必指定版本類型也能一鍵發布\n\t\t\t * Create the `yes` and `yes:force` default aliases only on the first\n\t\t\t * (patch) iteration, so users can publish without picking a bump type\n\t\t\t */\n\t\t\tif (idx === 0)\n\t\t\t{\n\t\t\t\ta[`lerna:publish:yes`] = `node --run lerna:publish:yes:${bump} --`;\n\t\t\t\ta[`lerna:publish:yes:force`] = `lerna publish --no-private --yes --bump ${bump} --force-publish`;\n\t\t\t}\n\t\t\ta[`lerna:publish:yes:${bump}`] = bumpVersion(bump);\n\t\t\treturn a\n\t\t}, {} as Record<string, string>),\n\n\t\t/** 發布前檢查與修復 / Pre-publish checks and fixes */\n\t\t\"prepublishOnly:root\": \"node --run prepublishOnly:check-bin && node --run prepare:fix-ws-links\",\n\n\t\t/** 鎖定檔同步 / Lockfile sync */\n\t\t\"prepublishOnly:lockfile\": \"ynpx --quiet sync-lockfile\",\n\n\t\t/** 二進位檔檢查 / Binary check */\n\t\t\"prepublishOnly:check-bin\": \"ynpx --quiet @yarn-tool/check-pkg-bin\",\n\n\t\t/** 工作區連結修復 / Workspace links fix */\n\t\t\"prepare:fix-ws-links\": \"echo ynpx --quiet @yarn-tool/fix-ws-links\",\n\n\t\t/** 發布前更新 / Pre-publish update */\n\t\t\"prepublishOnly:update\": \"pnpm run ncu && node --run sort-package-json\",\n\n\t\t/** 依賴更新 / Dependency updates */\n\t\t\"ncu\": \"node --run ncu:ws\",\n\t\t\"ncu:root\": \"yarn-tool ncu -u\",\n\t\t\"ncu:ws\": \"yarn-tool ncu -u --AA\",\n\n\t\t/** package.json 排序 / package.json sorting */\n\t\t\"sort-package-json\": \"node --run sort-package-json:root && node --run sort-package-json:ws\",\n\t\t\"sort-package-json:root\": \"yarn-tool sort\",\n\t\t\"sort-package-json:ws\": \"yarn-tool ws sort\",\n\n\t\t/** 發布後執行 / Post-publish execution */\n\t\t\"postpublishOnly\": \"node --run postpublishOnly:ws-root-changelog & echo postpublishOnly\",\n\n\t\t/** 根目錄變更日誌更新 / Root changelog update */\n\t\t\"postpublishOnly:ws-root-changelog\": \"ynpx ws-root-changelog & git add ./CHANGELOG.md & git commit ./CHANGELOG.md -m \\\"chore(changelog): update changelog toc in workspaces root\\\" & echo update changelog toc in workspaces root\",\n\n\t\t/** TypeScript 設定顯示 / TypeScript config display */\n\t\t\"tsc:showConfig\": \"ynpx get-current-tsconfig -p\",\n\t}\n}\n"]}
1
+ {"version":3,"file":"ws-root-scripts.js","sourceRoot":"","sources":["ws-root-scripts.ts"],"names":[],"mappings":";;AAkBA,wCAaC;AAiBD,kEAkGC;AAlJD,+DAAiE;AAGjE;;;;;;;;;;;;;;GAcG;AACH,SAAgB,cAAc,CAAmB,MAAS;IAEzD,MAAM,GAAG,GAAG,GAAG,MAAM,MAAe,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,MAAM,QAAiB,CAAC;IAEzC,OAAO;QACN,CAAC,GAAG,CAAC,EAAE,oBAAoB,MAAM,kBAAkB;QACnD,CAAC,KAAK,CAAC,EAAE,cAAc,MAAM,iBAAiB;KAK7C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,2BAA2B;IAE1C;;;;;OAKG;IACH,MAAM,WAAW,GAAG,CAAC,IAAkC,EAAE,EAAE;QAC1D,OAAO;YACN,gCAAgC;YAChC,4BAA4B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,0BAA0B;SAC1B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACf,CAAC,CAAA;IAED,OAAO;QACN,GAAG,IAAA,8CAAwB,GAAE;QAE7B,MAAM,EAAE,uBAAuB;QAE/B;;WAEG;QACH,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,iCAAiC;QACjC,GAAG,cAAc,CAAC,eAAe,CAAC;QAClC,GAAG,cAAc,CAAC,OAAO,CAAC;QAC1B,+BAA+B;QAC/B,iCAAiC;QACjC,6BAA6B;QAE7B,+BAA+B;QAC/B,YAAY,mDAA6B;QAEzC,6BAA6B;QAC7B,aAAa,EAAE,mCAAmC;QAElD,SAAS,EAAE,iCAAiC;QAE5C,oBAAoB;QACpB,eAAe,EAAE,WAAW,EAAE;QAE9B;;WAEG;QACH,GAAI;YACH,OAAO;YACP,OAAO;YACP,OAAO;SACG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YACnC;;;eAGG;YACH,IAAI,GAAG,KAAK,CAAC,EACb,CAAC;gBACA,CAAC,CAAC,mBAAmB,CAAC,GAAG,gCAAgC,IAAI,KAAK,CAAC;gBACnE,CAAC,CAAC,yBAAyB,CAAC,GAAG,2CAA2C,IAAI,kBAAkB,CAAC;YAClG,CAAC;YACD,CAAC,CAAC,qBAAqB,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;YACnD,OAAO,CAAC,CAAA;QACT,CAAC,EAAE,EAA4B,CAAC;QAEhC,eAAe;QACf,qBAAqB,EAAE,wEAAwE;QAE/F,oBAAoB;QACpB,yBAAyB,EAAE,4BAA4B;QAEvD,oBAAoB;QACpB,0BAA0B,0FAA4C;QAEtE,0BAA0B;QAC1B,sBAAsB,EAAE,2CAA2C;QAEnE,yBAAyB;QACzB,uBAAuB,EAAE,8CAA8C;QAEvE,yBAAyB;QACzB,KAAK,EAAE,mBAAmB;QAC1B,UAAU,+CAAsB;QAChC,QAAQ,EAAE,uBAAuB;QAEjC,sBAAsB;QACtB,mBAAmB,EAAE,sEAAsE;QAC3F,wBAAwB,2DAAoC;QAC5D,sBAAsB,EAAE,mBAAmB;QAE3C,YAAY;QACZ,iBAAiB,EAAE,qEAAqE;QAExF,gBAAgB;QAChB,mCAAmC,EAAE,6LAA6L;QAElO,sBAAsB;QACtB,sDAAsD;KACtD,CAAA;AACF,CAAC","sourcesContent":["import { defaultSharedRootScripts } from './shared-root-scripts';\nimport { EnumScriptsEntry } from '../../field/scripts';\n\n/**\n * 產生「全部執行」與「僅變更執行」腳本對\n *\n * 為指定腳本名稱產生對應的 `:all`(全部工作區)與 `:since`(僅變更)版本\n *\n * @template T - 基礎腳本名稱\n * @param script - 基礎腳本名稱\n * @returns 包含 all 與 since 變體的腳本物件\n *\n * @example\n * ```typescript\n * _runAllOrSince('test')\n * // 返回: { 'test:all': 'yarn-tool ws run test --concurrency 1', 'test:since': 'node --run test:all -- --since' }\n * ```\n */\nexport function _runAllOrSince<T extends string>(script: T)\n{\n\tconst all = `${script}:all` as const;\n\tconst since = `${script}:since` as const;\n\n\treturn {\n\t\t[all]: `yarn-tool ws run ${script} --concurrency 1`,\n\t\t[since]: `node --run ${script}:all -- --since`,\n\t} as ({\n\t\t[x in `${T}:all`]: string;\n\t} & {\n\t\t[y in `${T}:since`]: string;\n\t})\n}\n\n/**\n * 工作區根目錄預設腳本\n *\n * 適用於 monorepo 工作區根目錄的完整管理腳本集合\n *\n * @returns 包含工作區管理腳本的物件\n *\n * 核心功能:\n * - 跨工作區腳本執行(全部或僅變更)\n * - Lerna 發布流程\n * - 發布前檢查與準備\n * - 相依工作區連結修復\n * - 統一依賴更新\n * - 發布後變更日誌更新\n */\nexport function defaultWorkspaceRootScripts()\n{\n\t/**\n\t * 產生 Lerna 版本遞增與發布命令\n\t *\n\t * @param bump - 版本遞增類型(patch|minor|major)\n\t * @returns 組合命令字串\n\t */\n\tconst bumpVersion = (bump?: 'major' | 'minor' | 'patch') => {\n\t\treturn [\n\t\t\t`node --run prepublishOnly:root`,\n\t\t\t`lerna publish --no-private` + (bump ? ` --yes --bump ${bump}` : ''),\n\t\t\t`pnpm run postpublishOnly`,\n\t\t].join(' && ')\n\t}\n\n\treturn {\n\t\t...defaultSharedRootScripts(),\n\n\t\t\"test\": \"node --run test:since\",\n\n\t\t/**\n\t\t * 動態產生 all/since 腳本對\n\t\t */\n\t\t..._runAllOrSince('test'),\n\t\t// ..._runAllOrSince('test:tsd'),\n\t\t..._runAllOrSince('test:snapshot'),\n\t\t..._runAllOrSince('build'),\n\t\t// ..._runAllOrSince('review'),\n\t\t// ..._runAllOrSince('coverage'),\n\t\t// ..._runAllOrSince('lint'),\n\n\t\t/** Test before version bump */\n\t\t\"preversion\": EnumScriptsEntry.preversion,\n\n\t\t/** Fix after version bump */\n\t\t\"postversion\": \"yarn-tool fix-all --noStaticFiles\",\n\n\t\t'version': 'node --run prepublishOnly:lerna',\n\n\t\t/** Lerna publish */\n\t\t\"lerna:publish\": bumpVersion(),\n\n\t\t/**\n\t\t * 動態產生各類版本發布腳本\n\t\t */\n\t\t...([\n\t\t\t'patch',\n\t\t\t'minor',\n\t\t\t'major',\n\t\t] as const).reduce((a, bump, idx) => {\n\t\t\t/**\n\t\t\t * 只在第一個(patch)迭代建立 `yes` 與 `yes:force` 兩個預設別名,\n\t\t\t * 讓使用者不必指定版本類型也能一鍵發布\n\t\t\t */\n\t\t\tif (idx === 0)\n\t\t\t{\n\t\t\t\ta[`lerna:publish:yes`] = `node --run lerna:publish:yes:${bump} --`;\n\t\t\t\ta[`lerna:publish:yes:force`] = `lerna publish --no-private --yes --bump ${bump} --force-publish`;\n\t\t\t}\n\t\t\ta[`lerna:publish:yes:${bump}`] = bumpVersion(bump);\n\t\t\treturn a\n\t\t}, {} as Record<string, string>),\n\n\t\t/** 發布前檢查與修復 */\n\t\t\"prepublishOnly:root\": \"node --run prepublishOnly:check-bin && node --run prepare:fix-ws-links\",\n\n\t\t/** Lockfile sync */\n\t\t\"prepublishOnly:lockfile\": \"ynpx --quiet sync-lockfile\",\n\n\t\t/** pkg bin check */\n\t\t\"prepublishOnly:check-bin\": EnumScriptsEntry.PREPUBLISH_ONLY_CHECK_BIN,\n\n\t\t/** Workspace links fix */\n\t\t\"prepare:fix-ws-links\": \"echo ynpx --quiet @yarn-tool/fix-ws-links\",\n\n\t\t/** Pre-publish update */\n\t\t\"prepublishOnly:update\": \"pnpm run ncu && node --run sort-package-json\",\n\n\t\t/** Dependency updates */\n\t\t\"ncu\": \"node --run ncu:ws\",\n\t\t\"ncu:root\": EnumScriptsEntry.NCU,\n\t\t\"ncu:ws\": \"yarn-tool ncu -u --AA\",\n\n\t\t/** package.json 排序 */\n\t\t\"sort-package-json\": \"node --run sort-package-json:root && node --run sort-package-json:ws\",\n\t\t\"sort-package-json:root\": EnumScriptsEntry.SORT_PACKAGE_JSON,\n\t\t\"sort-package-json:ws\": \"yarn-tool ws sort\",\n\n\t\t/** 發布後執行 */\n\t\t\"postpublishOnly\": \"node --run postpublishOnly:ws-root-changelog & echo postpublishOnly\",\n\n\t\t/** 根目錄變更日誌更新 */\n\t\t\"postpublishOnly:ws-root-changelog\": \"ynpx ws-root-changelog & git add ./CHANGELOG.md & git commit ./CHANGELOG.md -m \\\"chore(changelog): update changelog toc in workspaces root\\\" & echo update changelog toc in workspaces root\",\n\n\t\t/** TypeScript 設定顯示 */\n\t\t// \"tsc:showConfig\": EnumScriptsEntry.TSC_SHOW_CONFIG,\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/pkg-entry-util",
3
- "version": "3.0.34",
3
+ "version": "3.0.35",
4
4
  "description": "用於處理 package.json entry 相關欄位的工具庫,包含 bin、exports、publishConfig 欄位的修復與驗證功能,並提供各類套件的預設 npm scripts(工作區根目錄、一般套件、根目錄套件)/ Utility for handling package.json entry fields including bin, exports, publishConfig fix/verification, plus preset npm scripts for workspace root, regular packages, and root packages",
5
5
  "keywords": [
6
6
  "yarn",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@ts-type/package-dts": "^3.0.15",
77
- "@yarn-tool/find-root": "^2.0.35",
77
+ "@yarn-tool/find-root": "^2.0.36",
78
78
  "@yarn-tool/require-resolve": "^4.0.19",
79
79
  "array-hyper-unique": "^2.1.10",
80
80
  "fs-extra": "^11.4.1",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "41f1871da90bdfa9582271c56fe024a94108eda3"
87
+ "gitHead": "0dae1e2d45e30a7aed68787fde91088cc5e48cc9"
88
88
  }