@codluv/versionguard 0.4.0 → 0.6.0
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/dist/calver.d.ts +1 -0
- package/dist/calver.d.ts.map +1 -1
- package/dist/changelog.d.ts +52 -0
- package/dist/changelog.d.ts.map +1 -1
- package/dist/chunks/{index-B3R60bYJ.js → index-DeZAx4Le.js} +535 -52
- package/dist/chunks/index-DeZAx4Le.js.map +1 -0
- package/dist/ckm/engine.d.ts +92 -0
- package/dist/ckm/engine.d.ts.map +1 -0
- package/dist/ckm/index.d.ts +32 -0
- package/dist/ckm/index.d.ts.map +1 -0
- package/dist/ckm/types.d.ts +168 -0
- package/dist/ckm/types.d.ts.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +140 -17
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/fix/index.d.ts.map +1 -1
- package/dist/hooks.d.ts +14 -7
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -33
- package/dist/init-wizard.d.ts +25 -0
- package/dist/init-wizard.d.ts.map +1 -1
- package/dist/project-root.d.ts +74 -0
- package/dist/project-root.d.ts.map +1 -0
- package/dist/scheme-rules.d.ts +32 -0
- package/dist/scheme-rules.d.ts.map +1 -0
- package/dist/semver.d.ts +9 -2
- package/dist/semver.d.ts.map +1 -1
- package/dist/tag/index.d.ts +1 -1
- package/dist/tag/index.d.ts.map +1 -1
- package/dist/types.d.ts +58 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/index-B3R60bYJ.js.map +0 -1
package/dist/calver.d.ts
CHANGED
|
@@ -154,6 +154,7 @@ export declare function parse(version: string, calverFormat: CalVerFormat): CalV
|
|
|
154
154
|
* @param version - Version string to validate.
|
|
155
155
|
* @param calverFormat - Format expected for the version string.
|
|
156
156
|
* @param preventFutureDates - Whether future dates should be reported as errors.
|
|
157
|
+
* @param schemeRules - Optional scheme rules for modifier validation and segment count warnings.
|
|
157
158
|
* @returns A validation result containing any discovered errors and the parsed version on success.
|
|
158
159
|
*
|
|
159
160
|
* @example
|
package/dist/calver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calver.d.ts","sourceRoot":"","sources":["../src/calver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"calver.d.ts","sourceRoot":"","sources":["../src/calver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EAEZ,WAAW,EAEX,gBAAgB,EACjB,MAAM,SAAS,CAAC;AA8BjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,YAAY,CAoBhF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;;;OAIG;IACH,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;IAExB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,kBAAkB,CAoB1E;AAyCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAKpE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAqDhF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,YAAY,EAC1B,kBAAkB,GAAE,OAAc,EAClC,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB,CAyGlB;AAgBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB9C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,GAAE,IAAiB,GAAG,MAAM,CAY5F;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,CAiBhF;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,CAqB7E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,EAAE,CAE5F"}
|
package/dist/changelog.d.ts
CHANGED
|
@@ -80,4 +80,56 @@ export declare function getLatestVersion(changelogPath: string): string | null;
|
|
|
80
80
|
* ```
|
|
81
81
|
*/
|
|
82
82
|
export declare function addVersionEntry(changelogPath: string, version: string, date?: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Detects whether a changelog has been mangled by Changesets.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Changesets prepends version content above the Keep a Changelog preamble,
|
|
88
|
+
* producing `## 0.4.0` (no brackets, no date) before the "All notable changes"
|
|
89
|
+
* paragraph. This function detects that pattern.
|
|
90
|
+
*
|
|
91
|
+
* @param changelogPath - Path to the changelog file.
|
|
92
|
+
* @returns `true` when the changelog appears to be mangled by Changesets.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* import { isChangesetMangled } from 'versionguard';
|
|
97
|
+
*
|
|
98
|
+
* if (isChangesetMangled('CHANGELOG.md')) {
|
|
99
|
+
* fixChangesetMangling('CHANGELOG.md');
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @public
|
|
104
|
+
* @since 0.4.0
|
|
105
|
+
*/
|
|
106
|
+
export declare function isChangesetMangled(changelogPath: string): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Fixes a Changesets-mangled changelog into proper Keep a Changelog format.
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* This function:
|
|
112
|
+
* 1. Extracts the version number and content prepended by Changesets
|
|
113
|
+
* 2. Converts Changesets section names (Minor Changes, Patch Changes) to
|
|
114
|
+
* Keep a Changelog names (Added, Fixed)
|
|
115
|
+
* 3. Strips commit hashes from entry lines
|
|
116
|
+
* 4. Adds the date and brackets to the version header
|
|
117
|
+
* 5. Inserts the entry after `## [Unreleased]` in the correct position
|
|
118
|
+
* 6. Restores the preamble to its proper location
|
|
119
|
+
*
|
|
120
|
+
* @param changelogPath - Path to the changelog file to fix.
|
|
121
|
+
* @param date - Release date in `YYYY-MM-DD` format.
|
|
122
|
+
* @returns `true` when the file was modified, `false` when no fix was needed.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { fixChangesetMangling } from 'versionguard';
|
|
127
|
+
*
|
|
128
|
+
* const fixed = fixChangesetMangling('CHANGELOG.md');
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
* @since 0.4.0
|
|
133
|
+
*/
|
|
134
|
+
export declare function fixChangesetMangling(changelogPath: string, date?: string): boolean;
|
|
83
135
|
//# sourceMappingURL=changelog.d.ts.map
|
package/dist/changelog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,OAAc,EACtB,YAAY,GAAE,OAAc,GAC3B,yBAAyB,CAgD3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAA8C,GACnD,IAAI,CAmBN"}
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,OAAc,EACtB,YAAY,GAAE,OAAc,GAC3B,yBAAyB,CAgD3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAA8C,GACnD,IAAI,CAmBN;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAMjE;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE,MAA8C,GACnD,OAAO,CAoET"}
|