@yarn-tool/changelog 3.0.14 → 3.0.15

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
@@ -3,6 +3,38 @@
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.15](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/changelog@3.0.14...@yarn-tool/changelog@3.0.15) (2026-10-12)
7
+
8
+
9
+
10
+ ### 📚 Documentation
11
+
12
+ * add jsdoc ([9cb9b13](https://github.com/bluelovers/ws-yarn-workspaces/commit/9cb9b13eda8c357221ad1b754458aa9916eada22))
13
+
14
+
15
+ ### 🚨 Tests
16
+
17
+ * **test:** 將測試框架從 jest 遷移至 node:test ([3af9774](https://github.com/bluelovers/ws-yarn-workspaces/commit/3af9774964abc48083ec60b2021c1cec08874803))
18
+
19
+
20
+ ### 🛠 Build System
21
+
22
+ * update build ([3186340](https://github.com/bluelovers/ws-yarn-workspaces/commit/3186340758172427cb1e9b8955f6fd677abac625))
23
+ * **deps:** 更新測試腳本與依賴以支援 node:test ([f9c71c7](https://github.com/bluelovers/ws-yarn-workspaces/commit/f9c71c795c792c5c7ed9d613ce7e9c3c726c39d5))
24
+
25
+
26
+ ### ♻️ Chores
27
+
28
+ * **deps:** 更新各套件依賴版本 ([569f075](https://github.com/bluelovers/ws-yarn-workspaces/commit/569f0756189cdadf69955d8e388ac0a6a8988056))
29
+ * **workspace:** 更新測試指令路徑與新增工作區搜尋選項 ([a80039d](https://github.com/bluelovers/ws-yarn-workspaces/commit/a80039dd8c691e047466966ffc8f8a4e2e31c03f))
30
+
31
+
32
+ ### 🔖 Miscellaneous
33
+
34
+ * . ([e5788f8](https://github.com/bluelovers/ws-yarn-workspaces/commit/e5788f84551b870490a96d0a5d67d8d542481373))
35
+
36
+
37
+
6
38
  ## [3.0.14](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/changelog@3.0.13...@yarn-tool/changelog@3.0.14) (2026-09-06)
7
39
 
8
40
 
package/README.md CHANGED
@@ -2,46 +2,59 @@
2
2
 
3
3
  Generate and update CHANGELOG.md using conventional commits for monorepo workspaces.
4
4
 
5
- ## Features
5
+ 使用慣例提交 (Conventional Commits) 為 monorepo 工作區產生與更新 CHANGELOG.md。
6
6
 
7
- - **Conventional Commits**: Automatically generate changelogs from conventional commit messages
8
- - **Monorepo Support**: Works seamlessly with Lerna and Yarn workspaces
9
- - **CLI Tool**: Easy-to-use command line interface
10
- - **Version Recommendation**: Analyze commits to recommend next version
11
- - **Independent/Root Modes**: Support both independent and fixed versioning modes
7
+ ## Features / 功能特色
12
8
 
13
- ## Install
9
+ - **Conventional Commits / 慣例提交** - Automatically generate changelogs from conventional commit messages
10
+ - 自動依慣例提交 (Conventional Commit) 訊息產生更新日誌
11
+ - **Monorepo Support / Monorepo 支援** - Works seamlessly with Lerna and Yarn workspaces
12
+ - 可與 Lerna 及 Yarn 工作區 (Workspaces) 搭配運作
13
+ - **CLI Tool / 命令列工具** - Easy-to-use command line interface
14
+ - 提供易用的命令列介面 (CLI)
15
+ - **Version Recommendation / 版本建議** - Analyze commits to recommend next version
16
+ - 分析提交紀錄以建議下一個版本號
17
+ - **Independent/Root Modes / 獨立與根目錄模式** - Support both independent and fixed versioning modes
18
+ - 支援獨立版本 (Independent) 與固定版本 (Root) 兩種模式
19
+
20
+ ## Installation / 安裝
14
21
 
15
22
  ```bash
16
- # Using yarn
23
+ # Using yarn / 使用 yarn
17
24
  yarn add @yarn-tool/changelog
18
25
 
19
- # Using yarn-tool
26
+ # Using yarn-tool / 使用 yarn-tool
20
27
  yarn-tool add @yarn-tool/changelog
21
28
 
22
- # Using yt (alias)
29
+ # Using yt (alias) / 使用 yt 別名
23
30
  yt add @yarn-tool/changelog
31
+
32
+ # Using pnpm / 使用 pnpm
33
+ pnpm add @yarn-tool/changelog
34
+
35
+ # Using npm / 使用 npm
36
+ npm install @yarn-tool/changelog
24
37
  ```
25
38
 
26
- ## CLI Usage
39
+ ## Usage / 使用方式
40
+
41
+ ### CLI Usage / 命令列使用
27
42
 
28
43
  ```bash
29
- # Generate changelog for current package
44
+ # Generate changelog for current package / 為目前的套件產生更新日誌
30
45
  changelog
31
46
 
32
- # Specify preset
47
+ # Specify preset / 指定預設規範 (Preset)
33
48
  changelog --preset conventional-changelog-angular
34
49
 
35
- # Specify tag prefix
50
+ # Specify tag prefix / 指定標籤前綴 (Tag Prefix)
36
51
  changelog --tag-prefix v
37
52
 
38
- # Specify type (independent or root)
53
+ # Specify type (independent or root) / 指定模式(independent 或 root)
39
54
  changelog --type independent
40
55
  ```
41
56
 
42
- ## API Usage
43
-
44
- ### Update Changelog
57
+ ### API Usage / 程式化使用
45
58
 
46
59
  ```typescript
47
60
  import { updateChangelogByCwd } from '@yarn-tool/changelog';
@@ -56,8 +69,6 @@ updateChangelogByCwd(process.cwd(), {
56
69
  });
57
70
  ```
58
71
 
59
- ### Recommend Version
60
-
61
72
  ```typescript
62
73
  import { recommendVersion } from '@yarn-tool/changelog';
63
74
 
@@ -69,16 +80,67 @@ recommendVersion(pkg, {
69
80
  });
70
81
  ```
71
82
 
72
- ## Options
83
+ ## API Documentation / API 文件
84
+
85
+ ### `updateChangelogByCwd(cwd?, options?)`
86
+
87
+ 依工作目錄 (Working Directory) 找到所屬套件並更新其 CHANGELOG.md。
88
+ Locates the package from the working directory and updates its CHANGELOG.md.
89
+
90
+ **Parameters / 參數:**
91
+
92
+ | Parameter | Type | Description |
93
+ |-----------|------|-------------|
94
+ | `cwd` | `string` | 工作目錄,預設 `process.cwd()` / Working directory, defaults to `process.cwd()` |
95
+ | `options` | `Partial<IOptionsWithType<IOptionsUpdateChangelog>>` | 更新選項 / Update options |
96
+
97
+ **Returns / 回傳:** `Promise<IReturnTypeUpdateChangelog & { cwd, rootPath, options, pkg }>`
98
+
99
+ | Property | Type | Description |
100
+ |----------|------|-------------|
101
+ | `logPath` | `string` | 更新後的 CHANGELOG.md 路徑 / Path of the updated CHANGELOG.md |
102
+ | `newEntry` | `string` | 新增的日誌內容 / Newly added changelog entry |
103
+ | `version` | `string` | 更新後的版本號 / Updated version number |
104
+ | `pkg` | `IListableRow` | 套件資訊 / Package information |
73
105
 
74
- | Option | Type | Default | Description |
75
- |--------|------|---------|-------------|
76
- | `preset` | `string` | `@bluelovers/conventional-changelog-bluelovers` | Changelog preset to use |
77
- | `tag-prefix` | `string` | `v` | Tag prefix for version tags |
78
- | `type` | `string` | `independent` | Changelog type: `independent` or `root` |
79
- | `cwd` | `string` | `process.cwd()` | Working directory |
106
+ > ⚠️ 在 workspace 根目錄直接呼叫會拋出錯誤:根目錄本身不會建立 CHANGELOG.md。
107
+ > Calling it on the workspace root throws: the root itself never gets a CHANGELOG.md.
80
108
 
81
- ## Supported Presets
109
+ ### `updateChangelog(pkg, options?)`
110
+
111
+ 只更新指定套件(不進行目錄探索)。
112
+ Updates a single package without directory discovery.
113
+
114
+ ### `recommendVersion(pkg, options?)`
115
+
116
+ 分析 Git 歷史中的慣例提交,回傳建議的版本號。
117
+ Analyses conventional commits in the Git history and returns the recommended version.
118
+
119
+ ## Configuration / 設定方式
120
+
121
+ 命令列選項 (CLI Options) 與 API 選項一一對應,由 `setupToYargs` 建立:
122
+ The CLI options map one-to-one onto the API options and are built by `setupToYargs`:
123
+
124
+ | Option | Alias | Type | Default | Description |
125
+ |--------|-------|------|---------|-------------|
126
+ | `preset` | `-p`, `changelogPreset` | `string` | `@bluelovers/conventional-changelog-bluelovers` | Changelog 預設規範 / Changelog preset |
127
+ | `tag-prefix` | `-t` | `string` | `v` | 讀取 Git 標籤時使用的前綴 / Tag prefix used when reading Git tags |
128
+ | `type` | | `string` | `independent` | 模式:`independent`(各套件獨立版本)或 `root`(共用版本) / Mode: `independent` (per-package version) or `root` (shared version) |
129
+ | `cwd` | | `string` | `process.cwd()` | 工作目錄 / Working directory |
130
+ | `lerna-package` | `-l` | `boolean` | `true` | 為單一 lerna 套件產生日誌 / Generate a changelog for one lerna package |
131
+
132
+ API 額外選項 / Additional API-only options:
133
+
134
+ | Option | Type | Description |
135
+ |--------|------|-------------|
136
+ | `version` | `string` | 指定版本號;未提供時使用套件目前的版本 / Explicit version; falls back to the package's current version |
137
+ | `prereleaseId` | `string` | 預發布識別碼 (Prerelease Identifier),如 `alpha`、`beta`、`rc` / Prerelease identifier such as `alpha`, `beta`, `rc` |
138
+ | `rootPath` | `string` | 工作區根目錄路徑,預設自動偵測 / Workspace root path, auto-detected by default |
139
+
140
+ 選項解析順序 / Option resolution order:`handleOptions` 會先套用預設值 → 清除無效的 `type` / `tagPrefix` / `changelogPreset` → 以 `require-resolve` 解析預設規範路徑 → 仍找不到時後備為 `conventional-changelog-angular`。
141
+ `handleOptions` applies defaults → drops invalid `type` / `tagPrefix` / `changelogPreset` → resolves the default preset path via `require-resolve` → finally falls back to `conventional-changelog-angular`.
142
+
143
+ ## Supported Presets / 支援的預設規範
82
144
 
83
145
  - `@bluelovers/conventional-changelog-bluelovers`
84
146
  - `conventional-changelog-angular`
@@ -86,13 +148,17 @@ recommendVersion(pkg, {
86
148
  - `conventional-changelog-codemirror`
87
149
  - `conventional-changelog-ember`
88
150
  - `conventional-changelog-eslint`
89
- - And more...
151
+ - And more... / 以及其他 conventional-changelog 系列預設
152
+
153
+ ## More Documentation / 更多文件
154
+
155
+ - [Changelog 工具模組](../../../docs/changelog-tools.md) — 各 changelog 相關套件的分工與檔案清單 / Module map of the changelog related packages
90
156
 
91
- ## Related
157
+ ## Related Packages / 相關套件
92
158
 
93
- - [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
94
- - [Lerna](https://lerna.js.org/)
159
+ - [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) — 底層的更新日誌產生器 / The underlying changelog generator
160
+ - [Lerna](https://lerna.js.org/) — 版本建議與發佈流程的來源 / Source of the version recommendation and release flow
95
161
 
96
- ## License
162
+ ## License / 授權
97
163
 
98
164
  ISC
package/index.d.ts CHANGED
@@ -1,8 +1,23 @@
1
1
  /**
2
2
  * Created by user on 2020/6/15.
3
3
  */
4
+ /**
5
+ * @yarn-tool/changelog 模組入口 (Module entry point)
6
+ * 說明:彙整 changelog 相關的類型、更新與版本建議 API,以及 yargs 設定;
7
+ * 預設匯出直接是 `updateChangelogByCwd`,讓 `import changelog from '@yarn-tool/changelog'`
8
+ * 即可完成最常見的「依工作目錄更新日誌」操作。
9
+ * Why: it gathers the changelog types, update/recommend APIs and the yargs setup;
10
+ * the default export is `updateChangelogByCwd` itself so the most common task —
11
+ * updating the changelog from a working directory — is a single default import.
12
+ *
13
+ * @packageDocumentation
14
+ */
4
15
  export * from './lib/types';
5
16
  export * from './lib/lerna';
6
17
  export * from './lib/yargs-setting';
7
18
  import { updateChangelogByCwd } from './lib/lerna';
19
+ /**
20
+ * 預設匯出:依工作目錄更新 CHANGELOG.md 的函式
21
+ * Default export: the function that updates CHANGELOG.md from a working directory
22
+ */
8
23
  export default updateChangelogByCwd;
package/index.js CHANGED
@@ -4,9 +4,24 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const tslib_1 = require("tslib");
7
+ /**
8
+ * @yarn-tool/changelog 模組入口 (Module entry point)
9
+ * 說明:彙整 changelog 相關的類型、更新與版本建議 API,以及 yargs 設定;
10
+ * 預設匯出直接是 `updateChangelogByCwd`,讓 `import changelog from '@yarn-tool/changelog'`
11
+ * 即可完成最常見的「依工作目錄更新日誌」操作。
12
+ * Why: it gathers the changelog types, update/recommend APIs and the yargs setup;
13
+ * the default export is `updateChangelogByCwd` itself so the most common task —
14
+ * updating the changelog from a working directory — is a single default import.
15
+ *
16
+ * @packageDocumentation
17
+ */
7
18
  tslib_1.__exportStar(require("./lib/types"), exports);
8
19
  tslib_1.__exportStar(require("./lib/lerna"), exports);
9
20
  tslib_1.__exportStar(require("./lib/yargs-setting"), exports);
10
21
  const lerna_1 = require("./lib/lerna");
22
+ /**
23
+ * 預設匯出:依工作目錄更新 CHANGELOG.md 的函式
24
+ * Default export: the function that updates CHANGELOG.md from a working directory
25
+ */
11
26
  exports.default = lerna_1.updateChangelogByCwd;
12
27
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sDAA4B;AAC5B,sDAA4B;AAC5B,8DAAoC;AAEpC,uCAAmD;AAEnD,kBAAe,4BAAoB,CAAA","sourcesContent":["/**\n * Created by user on 2020/6/15.\n */\n\nexport * from './lib/types';\nexport * from './lib/lerna';\nexport * from './lib/yargs-setting';\n\nimport { updateChangelogByCwd } from './lib/lerna';\n\nexport default updateChangelogByCwd\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;;;;;;;;;GAUG;AACH,sDAA4B;AAC5B,sDAA4B;AAC5B,8DAAoC;AAEpC,uCAAmD;AAEnD;;;GAGG;AACH,kBAAe,4BAAoB,CAAA","sourcesContent":["/**\n * Created by user on 2020/6/15.\n */\n\n/**\n * @yarn-tool/changelog 模組入口 (Module entry point)\n * 說明:彙整 changelog 相關的類型、更新與版本建議 API,以及 yargs 設定;\n * 預設匯出直接是 `updateChangelogByCwd`,讓 `import changelog from '@yarn-tool/changelog'`\n * 即可完成最常見的「依工作目錄更新日誌」操作。\n * Why: it gathers the changelog types, update/recommend APIs and the yargs setup;\n * the default export is `updateChangelogByCwd` itself so the most common task —\n * updating the changelog from a working directory — is a single default import.\n *\n * @packageDocumentation\n */\nexport * from './lib/types';\nexport * from './lib/lerna';\nexport * from './lib/yargs-setting';\n\nimport { updateChangelogByCwd } from './lib/lerna';\n\n/**\n * 預設匯出:依工作目錄更新 CHANGELOG.md 的函式\n * Default export: the function that updates CHANGELOG.md from a working directory\n */\nexport default updateChangelogByCwd\n"]}
package/lib/lerna.d.ts CHANGED
@@ -1,6 +1,21 @@
1
+ /**
2
+ * Lerna 相關 API 的轉出口 (Re-exports of the Lerna related APIs)
3
+ * 說明:這裡刻意只做彙整轉出,讓 `lib/lerna` 成為一個穩定的匯入面;
4
+ * 同時再次轉出 `./types`,使既有 `import ... from '../types'` 與
5
+ * `import ... from './lerna'` 都能取得同一份型別(避免型別重複定義)。
6
+ * Why: it only aggregates re-exports so `lib/lerna` stays a stable import surface;
7
+ * `./types` is re-exported as well so both `from '../types'` and `from './lerna'`
8
+ * resolve to the same type definitions (no duplicated types).
9
+ *
10
+ * @module lerna
11
+ */
1
12
  export * from './types';
2
13
  export * from './lerna/recommend';
3
14
  export * from './lerna/update';
4
15
  export * from './lerna/from-list';
16
+ /**
17
+ * 模組命名空間預設導出,方便 `import lerna from './lib/lerna'` 取得完整 API
18
+ * Default namespace export, so `import lerna from './lib/lerna'` exposes the full API
19
+ */
5
20
  declare const _default: typeof import("./lerna");
6
21
  export default _default;
package/lib/lerna.js CHANGED
@@ -1,9 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ /**
5
+ * Lerna 相關 API 的轉出口 (Re-exports of the Lerna related APIs)
6
+ * 說明:這裡刻意只做彙整轉出,讓 `lib/lerna` 成為一個穩定的匯入面;
7
+ * 同時再次轉出 `./types`,使既有 `import ... from '../types'` 與
8
+ * `import ... from './lerna'` 都能取得同一份型別(避免型別重複定義)。
9
+ * Why: it only aggregates re-exports so `lib/lerna` stays a stable import surface;
10
+ * `./types` is re-exported as well so both `from '../types'` and `from './lerna'`
11
+ * resolve to the same type definitions (no duplicated types).
12
+ *
13
+ * @module lerna
14
+ */
4
15
  tslib_1.__exportStar(require("./types"), exports);
5
16
  tslib_1.__exportStar(require("./lerna/recommend"), exports);
6
17
  tslib_1.__exportStar(require("./lerna/update"), exports);
7
18
  tslib_1.__exportStar(require("./lerna/from-list"), exports);
19
+ /**
20
+ * 模組命名空間預設導出,方便 `import lerna from './lib/lerna'` 取得完整 API
21
+ * Default namespace export, so `import lerna from './lib/lerna'` exposes the full API
22
+ */
8
23
  exports.default = exports;
9
24
  //# sourceMappingURL=lerna.js.map
package/lib/lerna.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lerna.js","sourceRoot":"","sources":["lerna.ts"],"names":[],"mappings":";;;AACA,kDAAwB;AACxB,4DAAkC;AAClC,yDAA+B;AAC/B,4DAAkC;AAElC,kBAAe,OAAmC,CAAC","sourcesContent":["\nexport * from './types';\nexport * from './lerna/recommend';\nexport * from './lerna/update';\nexport * from './lerna/from-list';\n\nexport default exports as typeof import('./lerna');\n"]}
1
+ {"version":3,"file":"lerna.js","sourceRoot":"","sources":["lerna.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;GAUG;AACH,kDAAwB;AACxB,4DAAkC;AAClC,yDAA+B;AAC/B,4DAAkC;AAElC;;;GAGG;AACH,kBAAe,OAAmC,CAAC","sourcesContent":["\n/**\n * Lerna 相關 API 的轉出口 (Re-exports of the Lerna related APIs)\n * 說明:這裡刻意只做彙整轉出,讓 `lib/lerna` 成為一個穩定的匯入面;\n * 同時再次轉出 `./types`,使既有 `import ... from '../types'` 與\n * `import ... from './lerna'` 都能取得同一份型別(避免型別重複定義)。\n * Why: it only aggregates re-exports so `lib/lerna` stays a stable import surface;\n * `./types` is re-exported as well so both `from '../types'` and `from './lerna'`\n * resolve to the same type definitions (no duplicated types).\n *\n * @module lerna\n */\nexport * from './types';\nexport * from './lerna/recommend';\nexport * from './lerna/update';\nexport * from './lerna/from-list';\n\n/**\n * 模組命名空間預設導出,方便 `import lerna from './lib/lerna'` 取得完整 API\n * Default namespace export, so `import lerna from './lib/lerna'` exposes the full API\n */\nexport default exports as typeof import('./lerna');\n"]}
package/lib/types.d.ts CHANGED
@@ -56,7 +56,7 @@ export interface IOptionsBase extends IOptionsBaseCore {
56
56
  * Input options type
57
57
  *
58
58
  * 至少需要設定 changelogPreset 或 rootPath 其中一個
59
- * At least one of changelogPreset or rootPath must be set
59
+ * At least one of changelogPreset or rootPath must be set
60
60
  */
61
61
  export type IOptionsInput = IOptionsBase & ITSRequireAtLeastOne<IOptionsBaseCore>;
62
62
  /**
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * Changelog 類型定義模組\n * Changelog Type Definitions Module\n *\n * 定義 conventional changelog 相關的介面和類型\n * Defines interfaces and types for conventional changelog\n *\n * Created by user on 2020/6/15.\n */\n\nimport { ITSRequireAtLeastOne } from 'ts-type';\n\n/**\n * 預設的 Changelog 規範類型\n * Changelog preset types\n *\n * 支援的預設規範:angular, atom, codemirror 等\n * Supported presets: angular, atom, codemirror, etc.\n */\nexport type IChangelogPreset = string | \"conventional-changelog-angular\" | \"@bluelovers/conventional-changelog-bluelovers\";\n\n/**\n * Changelog 類型\n * Changelog type\n *\n * - independent: 獨立版本模式 (每個套件有自己的版本)\n * - root: 根目錄模式 (所有套件共用一個版本)\n */\nexport type IType = \"independent\" | \"root\" | string\n\n/**\n * 基礎選項核心介面\n * Base options core interface\n */\nexport interface IOptionsBaseCore\n{\n\t/**\n\t * 使用的 Changelog 預設規範\n\t * Changelog preset to use\n\t */\n\tchangelogPreset?: IChangelogPreset,\n\n\t/**\n\t * 工作區根目錄路徑\n\t * Workspace root path\n\t */\n\trootPath?: string,\n}\n\n/**\n * 基礎選項介面\n * Base options interface\n */\nexport interface IOptionsBase extends IOptionsBaseCore\n{\n\t/**\n\t * 標籤前綴,預設為 'v'\n\t * Tag prefix, default is 'v'\n\t */\n\ttagPrefix?: string | 'v',\n}\n\n/**\n * 輸入選項類型\n * Input options type\n *\n * 至少需要設定 changelogPreset 或 rootPath 其中一個\n\t * At least one of changelogPreset or rootPath must be set\n */\nexport type IOptionsInput = IOptionsBase & ITSRequireAtLeastOne<IOptionsBaseCore>;\n\n/**\n * 更新 Changelog 的選項\n * Options for updating changelog\n */\nexport type IOptionsUpdateChangelog = IOptionsInput & {\n\t/**\n\t * 指定版本號,若未提供則使用套件目前的版本\n\t * Specify version number, uses package current version if not provided\n\t */\n\tversion?: string,\n}\n\n/**\n * 推薦版本的選項\n * Options for recommending version\n */\nexport type IOptionsRecommendVersion = IOptionsInput & {\n\t/**\n\t * 預發布版本識別碼 (如: alpha, beta, rc)\n\t * Prerelease identifier (e.g., alpha, beta, rc)\n\t */\n\tprereleaseId?: string,\n}\n\n/**\n * 帶有類型的選項\n * Options with type\n */\nexport type IOptionsWithType<T extends Record<any, any>> = T & {\n\t/**\n\t * Changelog 類型 (independent | root)\n\t * Changelog type (independent | root)\n\t */\n\ttype?: IType,\n}\n\n/**\n * 更新 Changelog 的返回類型\n * Return type for updating changelog\n */\nexport interface IReturnTypeUpdateChangelog\n{\n\t/**\n\t * Changelog 檔案路徑\n\t * Changelog file path\n\t */\n\tlogPath: string;\n\n\t/**\n\t * 新增的 Changelog 內容\n\t * New changelog entry content\n\t */\n\tnewEntry: string;\n\n\t/**\n\t * 版本號\n\t * Version number\n\t */\n\tversion: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * Changelog 類型定義模組\n * Changelog Type Definitions Module\n *\n * 定義 conventional changelog 相關的介面和類型\n * Defines interfaces and types for conventional changelog\n *\n * Created by user on 2020/6/15.\n */\n\nimport { ITSRequireAtLeastOne } from 'ts-type';\n\n/**\n * 預設的 Changelog 規範類型\n * Changelog preset types\n *\n * 支援的預設規範:angular, atom, codemirror 等\n * Supported presets: angular, atom, codemirror, etc.\n */\nexport type IChangelogPreset = string | \"conventional-changelog-angular\" | \"@bluelovers/conventional-changelog-bluelovers\";\n\n/**\n * Changelog 類型\n * Changelog type\n *\n * - independent: 獨立版本模式 (每個套件有自己的版本)\n * - root: 根目錄模式 (所有套件共用一個版本)\n */\nexport type IType = \"independent\" | \"root\" | string\n\n/**\n * 基礎選項核心介面\n * Base options core interface\n */\nexport interface IOptionsBaseCore\n{\n\t/**\n\t * 使用的 Changelog 預設規範\n\t * Changelog preset to use\n\t */\n\tchangelogPreset?: IChangelogPreset,\n\n\t/**\n\t * 工作區根目錄路徑\n\t * Workspace root path\n\t */\n\trootPath?: string,\n}\n\n/**\n * 基礎選項介面\n * Base options interface\n */\nexport interface IOptionsBase extends IOptionsBaseCore\n{\n\t/**\n\t * 標籤前綴,預設為 'v'\n\t * Tag prefix, default is 'v'\n\t */\n\ttagPrefix?: string | 'v',\n}\n\n/**\n * 輸入選項類型\n * Input options type\n *\n * 至少需要設定 changelogPreset 或 rootPath 其中一個\n * At least one of changelogPreset or rootPath must be set\n */\nexport type IOptionsInput = IOptionsBase & ITSRequireAtLeastOne<IOptionsBaseCore>;\n\n/**\n * 更新 Changelog 的選項\n * Options for updating changelog\n */\nexport type IOptionsUpdateChangelog = IOptionsInput & {\n\t/**\n\t * 指定版本號,若未提供則使用套件目前的版本\n\t * Specify version number, uses package current version if not provided\n\t */\n\tversion?: string,\n}\n\n/**\n * 推薦版本的選項\n * Options for recommending version\n */\nexport type IOptionsRecommendVersion = IOptionsInput & {\n\t/**\n\t * 預發布版本識別碼 (如: alpha, beta, rc)\n\t * Prerelease identifier (e.g., alpha, beta, rc)\n\t */\n\tprereleaseId?: string,\n}\n\n/**\n * 帶有類型的選項\n * Options with type\n */\nexport type IOptionsWithType<T extends Record<any, any>> = T & {\n\t/**\n\t * Changelog 類型 (independent | root)\n\t * Changelog type (independent | root)\n\t */\n\ttype?: IType,\n}\n\n/**\n * 更新 Changelog 的返回類型\n * Return type for updating changelog\n */\nexport interface IReturnTypeUpdateChangelog\n{\n\t/**\n\t * Changelog 檔案路徑\n\t * Changelog file path\n\t */\n\tlogPath: string;\n\n\t/**\n\t * 新增的 Changelog 內容\n\t * New changelog entry content\n\t */\n\tnewEntry: string;\n\n\t/**\n\t * 版本號\n\t * Version number\n\t */\n\tversion: string;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/changelog",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "Generate and update CHANGELOG.md using conventional commits for monorepo workspaces",
5
5
  "keywords": [
6
6
  "changelog",
@@ -37,12 +37,14 @@
37
37
  "scripts": {
38
38
  "coverage": "npx nyc pnpm run test",
39
39
  "lint": "npx eslint **/*.ts",
40
- "test": "node --run test:jest --",
40
+ "test": "node --run test:node",
41
41
  "test:jest": "jest --coverage",
42
42
  "test:jest:coverage": "pnpm run test:jest -- --coverage",
43
43
  "test:jest:snapshot": "pnpm run test:jest -- -u",
44
44
  "test:mocha": "npx mocha --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
45
+ "test:node": "tsx --test --test-update-snapshots **/*.node-spec.ts **/*.node-test.ts **/*.spec.ts **/*.test.ts",
45
46
  "test:snapshot": "pnpm run test -u",
47
+ "test:tsc": "tsc --noEmit & echo typescript check done",
46
48
  "test:tsd": "ynpx tsd",
47
49
  "npm:publish": "npm publish",
48
50
  "npm:publish:lerna": "lerna publish --yes --bump patch",
@@ -59,17 +61,17 @@
59
61
  "dependencies": {
60
62
  "@bluelovers/conventional-changelog-bluelovers": "*",
61
63
  "@lerna/conventional-commits": "^6.4.1",
62
- "@yarn-tool/find-root": "^2.0.25",
63
- "@yarn-tool/require-resolve": "^4.0.9",
64
- "@yarn-tool/semver-diff": "^2.0.21",
65
- "@yarn-tool/table": "^2.0.22",
66
- "@yarn-tool/types": "^1.0.21",
64
+ "@yarn-tool/find-root": "^2.0.26",
65
+ "@yarn-tool/require-resolve": "^4.0.10",
66
+ "@yarn-tool/semver-diff": "^2.0.22",
67
+ "@yarn-tool/table": "^2.0.23",
68
+ "@yarn-tool/types": "^1.0.22",
67
69
  "lodash": "^4.18.1",
68
70
  "path-is-same": "^1.0.29",
69
- "ts-type": "^3.0.13",
71
+ "ts-type": "^3.0.18",
70
72
  "tslib": ">=2.8.1",
71
73
  "upath2": "^3.1.25",
72
- "ws-pkg-list": "^3.0.11",
74
+ "ws-pkg-list": "^3.0.12",
73
75
  "yargs": "<18 >=17.7.2"
74
76
  },
75
77
  "peerDependencies": {
@@ -78,5 +80,5 @@
78
80
  "publishConfig": {
79
81
  "access": "public"
80
82
  },
81
- "gitHead": "008888d233d299e89673cbc45a2712ba9bf825c1"
83
+ "gitHead": "471c63ee11851f0ac3487f23d1c472936f99b460"
82
84
  }