@yarn-tool/pkg-entry-util 3.0.5 → 3.0.9
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 +64 -0
- package/lib/preset/scripts/pkg-scripts.js +2 -2
- package/lib/preset/scripts/pkg-scripts.js.map +1 -1
- package/lib/preset/scripts/root-scripts.d.ts +3 -1
- package/lib/preset/scripts/shared-root-scripts.d.ts +9 -0
- package/lib/preset/scripts/shared-root-scripts.js +25 -13
- package/lib/preset/scripts/shared-root-scripts.js.map +1 -1
- package/lib/preset/scripts/ws-root-scripts.d.ts +2 -0
- package/lib/preset/scripts/ws-root-scripts.js +2 -2
- package/lib/preset/scripts/ws-root-scripts.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,70 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.9](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@3.0.8...@yarn-tool/pkg-entry-util@3.0.9) (2026-03-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🐛 Bug Fixes
|
|
11
|
+
|
|
12
|
+
* 更新 `lerna:publish:yes:force` 指令,优化参数传递逻辑并移除冗余代码 ([45148d8](https://github.com/bluelovers/ws-yarn-workspaces/commit/45148d8a93795aed9f01ad9bcbb192832bf6ef33))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.0.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@3.0.6...@yarn-tool/pkg-entry-util@3.0.8) (2026-03-09)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ✨ Features
|
|
21
|
+
|
|
22
|
+
* **scripts:** 重構 `ci:install` 腳本並新增 pnpm 支援 ([547029b](https://github.com/bluelovers/ws-yarn-workspaces/commit/547029b2d83d86b2ef8227d06d95a824e10d0eaf))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ♻️ Chores
|
|
26
|
+
|
|
27
|
+
* **deps:** 更新 ts-type 和 @ts-type/package-dts 依賴版本 ([eb3e3db](https://github.com/bluelovers/ws-yarn-workspaces/commit/eb3e3dbe330398235ea99e64f3561db73d95b7fc))
|
|
28
|
+
* **deps:** 更新 monorepo 依賴版本 ([e44dff2](https://github.com/bluelovers/ws-yarn-workspaces/commit/e44dff29d5d6b7eb7c77acb8414e73f70feff649))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### 🔖 Miscellaneous
|
|
32
|
+
|
|
33
|
+
* . ([cae7515](https://github.com/bluelovers/ws-yarn-workspaces/commit/cae7515d4a8befe93ca0baee8f6aeb9ae7cbad79))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [3.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@3.0.6...@yarn-tool/pkg-entry-util@3.0.7) (2026-03-08)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### ✨ Features
|
|
42
|
+
|
|
43
|
+
* **scripts:** 重構 `ci:install` 腳本並新增 pnpm 支援 ([547029b](https://github.com/bluelovers/ws-yarn-workspaces/commit/547029b2d83d86b2ef8227d06d95a824e10d0eaf))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### ♻️ Chores
|
|
47
|
+
|
|
48
|
+
* **deps:** 更新 ts-type 和 @ts-type/package-dts 依賴版本 ([eb3e3db](https://github.com/bluelovers/ws-yarn-workspaces/commit/eb3e3dbe330398235ea99e64f3561db73d95b7fc))
|
|
49
|
+
* **deps:** 更新 monorepo 依賴版本 ([e44dff2](https://github.com/bluelovers/ws-yarn-workspaces/commit/e44dff29d5d6b7eb7c77acb8414e73f70feff649))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## [3.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@3.0.5...@yarn-tool/pkg-entry-util@3.0.6) (2026-03-04)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### BREAKING CHANGES
|
|
57
|
+
|
|
58
|
+
* 在 test、lint 及 lerna 相關腳本結尾添加 `--` 以確保額外參數能正確傳遞。
|
|
59
|
+
* **fix-all:** 自動移除未指定測試的佔位符腳本
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### 🐛 Bug Fixes
|
|
64
|
+
|
|
65
|
+
* 在 test、lint 及 lerna 相關腳本結尾添加 `--` 以確保額外參數能正確傳遞。 ([88b7b15](https://github.com/bluelovers/ws-yarn-workspaces/commit/88b7b1535bbda94526591cbb4231b6040df11d4e))
|
|
66
|
+
* **fix-all:** 自動移除未指定測試的佔位符腳本 ([fb7f8d9](https://github.com/bluelovers/ws-yarn-workspaces/commit/fb7f8d9cc8e725652b4d81a6087d3b71f8265ed2))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
6
70
|
## [3.0.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@3.0.4...@yarn-tool/pkg-entry-util@3.0.5) (2026-03-04)
|
|
7
71
|
|
|
8
72
|
**Note:** Version bump only for package @yarn-tool/pkg-entry-util
|
|
@@ -28,7 +28,7 @@ exports.defaultPkgNotOldExists = defaultPkgNotOldExists;
|
|
|
28
28
|
*/
|
|
29
29
|
function defaultPkgScripts() {
|
|
30
30
|
return {
|
|
31
|
-
"test": "node --run test:jest",
|
|
31
|
+
"test": "node --run test:jest --",
|
|
32
32
|
"coverage": "yarn run test -- --coverage",
|
|
33
33
|
"test:jest": "jest --passWithNoTests" /* EnumScriptsEntry.JEST_TEST */,
|
|
34
34
|
"test:snapshot": "yarn run test -- -u",
|
|
@@ -75,7 +75,7 @@ function defaultPkgNotOldExists() {
|
|
|
75
75
|
"build:dts:tsc": "node --run build:dts:tsc:emit && node --run build:dts:copy",
|
|
76
76
|
"build:tsdx": "ynpx @bluelovers/tsdx build --target node --name index",
|
|
77
77
|
"build:microbundle": "ynpx microbundle --target node",
|
|
78
|
-
"lint": "node --run lint:eslint",
|
|
78
|
+
"lint": "node --run lint:eslint --",
|
|
79
79
|
"lint:eslint": "ynpx eslint --ext .ts,.tsx,.mts,.cts ./",
|
|
80
80
|
"review": "node --run review:coverage",
|
|
81
81
|
"review:test": "yarn run lint && yarn run test",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkg-scripts.js","sourceRoot":"","sources":["pkg-scripts.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAsBH,8CAYC;AA4BD,wDAqBC;AA/ED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,iBAAiB;IAEhC,OAAO;QACN,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"pkg-scripts.js","sourceRoot":"","sources":["pkg-scripts.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAsBH,8CAYC;AA4BD,wDAqBC;AA/ED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,iBAAiB;IAEhC,OAAO;QACN,MAAM,EAAE,yBAAyB;QACjC,UAAU,EAAE,6BAA6B;QACzC,WAAW,2DAA4B;QACvC,eAAe,EAAE,qBAAqB;QACtC,oBAAoB,EAAE,4BAA4B;QAClD,oBAAoB,EAAE,oCAAoC;QAC1D,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,8BAA8B;KAChD,CAAA;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,sBAAsB;IAErC,OAAO;QACN,GAAG,iBAAiB,EAAE;QACtB,YAAY,EAAE,oHAAoH;QAClI,WAAW,EAAE,8CAA8C;QAC3D,kBAAkB,iLAAmC;QACrD,gBAAgB,EAAE,8DAA8D;QAChF,oBAAoB,EAAE,wDAAwD;QAC9E,eAAe,EAAE,4DAA4D;QAC7E,YAAY,EAAE,wDAAwD;QACtE,mBAAmB,EAAE,gCAAgC;QACrD,MAAM,EAAE,2BAA2B;QACnC,aAAa,EAAE,yCAAyC;QACxD,QAAQ,EAAE,4BAA4B;QACtC,aAAa,EAAE,gCAAgC;QAC/C,iBAAiB,EAAE,oCAAoC;QACvD,mBAAmB,EAAE,gBAAgB;QACrC,aAAa,EAAE,sBAAsB;QACrC,SAAS,EAAE,0BAA0B;KACrC,CAAA;AACF,CAAC","sourcesContent":["/**\n * 套件腳本預設 / Package Scripts Preset\n *\n * 提供標準套件(非根目錄、非工作區根目錄)的預設 npm scripts\n * Provides default npm scripts for standard packages (non-root, non-workspace-root)\n */\n\nimport { EnumScriptsEntry } from '../../field/scripts';\n\n/**\n * 標準套件預設腳本 / Default scripts for standard packages\n *\n * 適用於一般套件專案的常用測試與建構腳本\n * Common test and build scripts for general package projects\n *\n * @returns 包含標準腳本的物件 / Object containing standard scripts\n *\n * 包含腳本 / Includes scripts:\n * - test: 執行 Jest 測試 / Run Jest tests\n * - coverage: 執行測試並產生覆蓋率報告 / Run tests with coverage\n * - test:jest: Jest 測試命令 / Jest test command\n * - test:snapshot: 更新測試快照 / Update test snapshots\n * - test:jest:snapshot: 更新 Jest 快照 / Update Jest snapshots\n * - test:jest:coverage: Jest 測試含覆蓋率 / Jest test with coverage\n * - test:tsd: 執行 TypeScript 型別檢查 / Run TypeScript type checking\n * - tsc:showConfig: 顯示 TypeScript 設定 / Show TypeScript config\n */\nexport function defaultPkgScripts()\n{\n\treturn {\n\t\t\"test\": \"node --run test:jest --\",\n\t\t\"coverage\": \"yarn run test -- --coverage\",\n\t\t\"test:jest\": EnumScriptsEntry.JEST_TEST,\n\t\t\"test:snapshot\": \"yarn run test -- -u\",\n\t\t\"test:jest:snapshot\": \"node --run test:jest -- -u\",\n\t\t\"test:jest:coverage\": \"node --run test:jest -- --coverage\",\n\t\t\"test:tsd\": \"ynpx tsd\",\n\t\t\"tsc:showConfig\": \"ynpx get-current-tsconfig -p\",\n\t}\n}\n\n/**\n * 新套件預設腳本 / Default scripts for new packages\n *\n * 適用於初始化新套件時的完整腳本集合\n * Complete set of scripts for initializing new packages\n *\n * @returns 包含完整開發腳本的物件 / Object containing complete development scripts\n *\n * 額外包含腳本 / Additional scripts:\n * - test:mocha: Mocha 測試執行 / Mocha test execution\n * - test:tsdx: TSDX 測試 / TSDX testing\n * - build:dts:bundle: 建構型別宣告檔 / Build type declaration files\n * - build:dts:copy: 複製型別宣告檔 / Copy type declaration files\n * - build:dts:tsc:emit: TypeScript 型別輸出 / TypeScript type emit\n * - build:dts:tsc: 完整型別建構 / Complete type build\n * - build:tsdx: TSDX 建構 / TSDX build\n * - build:microbundle: Microbundle 建構 / Microbundle build\n * - lint: ESLint 檢查 / ESLint check\n * - lint:eslint: ESLint 執行 / ESLint execution\n * - review: 完整審查流程 / Complete review process\n * - review:test: 測試審查 / Test review\n * - review:coverage: 覆蓋率審查 / Coverage review\n * - sort-package-json: 排序 package.json / Sort package.json\n * - tsc:default: 預設 TypeScript 編譯 / Default TypeScript compilation\n * - tsc:esm: ESM TypeScript 編譯 / ESM TypeScript compilation\n */\nexport function defaultPkgNotOldExists()\n{\n\treturn {\n\t\t...defaultPkgScripts(),\n\t\t\"test:mocha\": \"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \\\"!(node_modules)/**/*.{test,spec}.{ts,tsx}\\\"\",\n\t\t\"test:tsdx\": \"ynpx @bluelovers/tsdx test --passWithNoTests\",\n\t\t\"build:dts:bundle\": EnumScriptsEntry.BUILD_DTS_BUNDLE,\n\t\t\"build:dts:copy\": \"copy .\\\\src\\\\index.d.ts .\\\\dist\\\\index.d.ts & echo build:dts\",\n\t\t\"build:dts:tsc:emit\": \"tsc --emitDeclarationOnly --declaration --noEmit false\",\n\t\t\"build:dts:tsc\": \"node --run build:dts:tsc:emit && node --run build:dts:copy\",\n\t\t\"build:tsdx\": \"ynpx @bluelovers/tsdx build --target node --name index\",\n\t\t\"build:microbundle\": \"ynpx microbundle --target node\",\n\t\t\"lint\": \"node --run lint:eslint --\",\n\t\t\"lint:eslint\": \"ynpx eslint --ext .ts,.tsx,.mts,.cts ./\",\n\t\t\"review\": \"node --run review:coverage\",\n\t\t\"review:test\": \"yarn run lint && yarn run test\",\n\t\t\"review:coverage\": \"yarn run lint && yarn run coverage\",\n\t\t\"sort-package-json\": \"yarn-tool sort\",\n\t\t\"tsc:default\": \"tsc -p tsconfig.json\",\n\t\t\"tsc:esm\": \"tsc -p tsconfig.esm.json\",\n\t}\n}\n"]}
|
|
@@ -48,6 +48,8 @@ export declare function defaultRootScripts(): {
|
|
|
48
48
|
"npm:publish": string;
|
|
49
49
|
"npm:publish:bump": string;
|
|
50
50
|
"ci:install": string;
|
|
51
|
+
"ci:install:yarn": string;
|
|
52
|
+
"ci:install:pnpm": string;
|
|
51
53
|
"test:jest:clearCache": string;
|
|
52
54
|
"install:resetLockfile": string;
|
|
53
55
|
"install:frozenLockfile": string;
|
|
@@ -55,7 +57,7 @@ export declare function defaultRootScripts(): {
|
|
|
55
57
|
"ws:fix-all:resetStaticFiles": string;
|
|
56
58
|
test: string;
|
|
57
59
|
coverage: string;
|
|
58
|
-
"test:jest": import("
|
|
60
|
+
"test:jest": import("../../field/scripts").EnumScriptsEntry;
|
|
59
61
|
"test:snapshot": string;
|
|
60
62
|
"test:jest:snapshot": string;
|
|
61
63
|
"test:jest:coverage": string;
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* 此模組被 root-scripts 和 ws-root-scripts 共用
|
|
8
8
|
* This module is shared by root-scripts and ws-root-scripts
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* CI 環境安裝腳本 / CI environment install script
|
|
12
|
+
*
|
|
13
|
+
* 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm
|
|
14
|
+
* Installs core development tools
|
|
15
|
+
*/
|
|
16
|
+
export declare const _defaultCiInstallDeps: readonly ["yarn-tool", "lerna", "ynpx", "pnpm", "typescript", "ts-node", "tsx", "ts-jest", "jest", "@bluelovers/jest-config", "@bluelovers/tsconfig", "@yarn-tool/require-resolve"];
|
|
10
17
|
/**
|
|
11
18
|
* 共享根目錄預設腳本 / Shared root default scripts
|
|
12
19
|
*
|
|
@@ -31,6 +38,8 @@ export declare function defaultSharedRootScripts(): {
|
|
|
31
38
|
* Installs core development tools
|
|
32
39
|
*/
|
|
33
40
|
"ci:install": string;
|
|
41
|
+
"ci:install:yarn": string;
|
|
42
|
+
"ci:install:pnpm": string;
|
|
34
43
|
/** 清除 Jest 快取 / Clear Jest cache */
|
|
35
44
|
"test:jest:clearCache": string;
|
|
36
45
|
/** 重置鎖定檔安裝 / Install with reset lockfile */
|
|
@@ -9,7 +9,28 @@
|
|
|
9
9
|
* This module is shared by root-scripts and ws-root-scripts
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports._defaultCiInstallDeps = void 0;
|
|
12
13
|
exports.defaultSharedRootScripts = defaultSharedRootScripts;
|
|
14
|
+
/**
|
|
15
|
+
* CI 環境安裝腳本 / CI environment install script
|
|
16
|
+
*
|
|
17
|
+
* 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm
|
|
18
|
+
* Installs core development tools
|
|
19
|
+
*/
|
|
20
|
+
exports._defaultCiInstallDeps = [
|
|
21
|
+
'yarn-tool',
|
|
22
|
+
'lerna',
|
|
23
|
+
'ynpx',
|
|
24
|
+
'pnpm',
|
|
25
|
+
'typescript',
|
|
26
|
+
'ts-node',
|
|
27
|
+
'tsx',
|
|
28
|
+
'ts-jest',
|
|
29
|
+
'jest',
|
|
30
|
+
'@bluelovers/jest-config',
|
|
31
|
+
'@bluelovers/tsconfig',
|
|
32
|
+
'@yarn-tool/require-resolve',
|
|
33
|
+
];
|
|
13
34
|
/**
|
|
14
35
|
* 共享根目錄預設腳本 / Shared root default scripts
|
|
15
36
|
*
|
|
@@ -34,18 +55,9 @@ function defaultSharedRootScripts() {
|
|
|
34
55
|
* 安裝核心開發工具:yarn-tool、lerna、ynpx、ts-node、ts-jest、jest、typescript、jest-config、tsx、pnpm
|
|
35
56
|
* Installs core development tools
|
|
36
57
|
*/
|
|
37
|
-
"ci:install": `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"ynpx",
|
|
41
|
-
"ts-node",
|
|
42
|
-
"ts-jest",
|
|
43
|
-
"jest",
|
|
44
|
-
"typescript@next",
|
|
45
|
-
'@bluelovers/jest-config',
|
|
46
|
-
'tsx',
|
|
47
|
-
'pnpm',
|
|
48
|
-
].join(" ")}`,
|
|
58
|
+
"ci:install": `node --run ci:install:pnpm`,
|
|
59
|
+
"ci:install:yarn": `yarn install --frozen-lockfile && yarn add -W ${exports._defaultCiInstallDeps.join(" ")}`,
|
|
60
|
+
"ci:install:pnpm": `pnpm install --frozen-lockfile && pnpm add --workspace ${exports._defaultCiInstallDeps.join(" ")}`,
|
|
49
61
|
/** 清除 Jest 快取 / Clear Jest cache */
|
|
50
62
|
"test:jest:clearCache": "jest --clearCache",
|
|
51
63
|
/** 重置鎖定檔安裝 / Install with reset lockfile */
|
|
@@ -53,7 +65,7 @@ function defaultSharedRootScripts() {
|
|
|
53
65
|
/** 凍結鎖定檔安裝 / Install with frozen lockfile */
|
|
54
66
|
"install:frozenLockfile": "yarn-tool install --frozen-lockfile",
|
|
55
67
|
/** 修復所有工作區問題 / Fix all workspace issues */
|
|
56
|
-
"ws:fix-all": "yarn-tool fix-all
|
|
68
|
+
"ws:fix-all": "yarn-tool fix-all --overwriteHostedGitInfo",
|
|
57
69
|
/** 修復並重置靜態檔 / Fix and reset static files */
|
|
58
70
|
"ws:fix-all:resetStaticFiles": "node --run ws:fix-all -- --resetStaticFiles",
|
|
59
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG
|
|
1
|
+
{"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA4CH,4DA4BC;AAtED;;;;;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,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/** 修復並重置靜態檔 / Fix and reset static files */\n\t\t\"ws:fix-all:resetStaticFiles\": \"node --run ws:fix-all -- --resetStaticFiles\",\n\t}\n}\n"]}
|
|
@@ -110,6 +110,8 @@ export declare function defaultWorkspaceRootScripts(): {
|
|
|
110
110
|
"test:since": string;
|
|
111
111
|
test: string;
|
|
112
112
|
"ci:install": string;
|
|
113
|
+
"ci:install:yarn": string;
|
|
114
|
+
"ci:install:pnpm": string;
|
|
113
115
|
"test:jest:clearCache": string;
|
|
114
116
|
"install:resetLockfile": string;
|
|
115
117
|
"install:frozenLockfile": string;
|
|
@@ -112,8 +112,8 @@ function defaultWorkspaceRootScripts() {
|
|
|
112
112
|
'major',
|
|
113
113
|
].reduce((a, bump, idx) => {
|
|
114
114
|
if (idx === 0) {
|
|
115
|
-
a[`lerna:publish:yes`] = `node --run lerna:publish:yes:${bump}
|
|
116
|
-
a[`lerna:publish:yes:force`] = `
|
|
115
|
+
a[`lerna:publish:yes`] = `node --run lerna:publish:yes:${bump} --`;
|
|
116
|
+
a[`lerna:publish:yes:force`] = `lerna publish --no-private --yes --bump ${bump} --force-publish`;
|
|
117
117
|
}
|
|
118
118
|
a[`lerna:publish:yes:${bump}`] = bumpVersion(bump);
|
|
119
119
|
return a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-root-scripts.js","sourceRoot":"","sources":["ws-root-scripts.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAqBH,wCAaC;AA2CD,kEAwFC;AAnKD,+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,kBAAk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,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YACnC,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,sCAAsC;QAE9D,iCAAiC;QACjC,uBAAuB,EAAE,4CAA4C;QAErE,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`yarn 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// 動態產生 all/since 腳本對 / Dynamically generate all/since script pairs\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\",\n\n\t\t/** Lerna 發布 / Lerna publish */\n\t\t\"lerna:publish\": bumpVersion(),\n\n\t\t// 動態產生各類版本發布腳本 / Dynamically generate version publish scripts\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\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\": \"ynpx --quiet @yarn-tool/fix-ws-links\",\n\n\t\t/** 發布前更新 / Pre-publish update */\n\t\t\"prepublishOnly:update\": \"yarn run ncu && yarn 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/pkg-entry-util",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
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",
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@ts-type/package-dts": "^
|
|
71
|
-
"@yarn-tool/find-root": "^2.0.
|
|
72
|
-
"@yarn-tool/resolve-package": "^3.0.
|
|
73
|
-
"fs-extra": "^11.3.
|
|
70
|
+
"@ts-type/package-dts": "^3.0.6",
|
|
71
|
+
"@yarn-tool/find-root": "^2.0.20",
|
|
72
|
+
"@yarn-tool/resolve-package": "^3.0.5",
|
|
73
|
+
"fs-extra": "^11.3.4",
|
|
74
74
|
"tslib": ">=2",
|
|
75
75
|
"upath2": "^3.1.23"
|
|
76
76
|
},
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "1baa583ecae8fa5869962494f8df3761bf527cdf"
|
|
81
81
|
}
|