@hyperfrontend/versioning 0.1.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/ARCHITECTURE.md +593 -0
- package/CHANGELOG.md +35 -0
- package/FUNDING.md +141 -0
- package/LICENSE.md +21 -0
- package/README.md +195 -0
- package/SECURITY.md +82 -0
- package/changelog/compare/diff.d.ts +128 -0
- package/changelog/compare/diff.d.ts.map +1 -0
- package/changelog/compare/index.cjs.js +628 -0
- package/changelog/compare/index.cjs.js.map +1 -0
- package/changelog/compare/index.d.ts +4 -0
- package/changelog/compare/index.d.ts.map +1 -0
- package/changelog/compare/index.esm.js +612 -0
- package/changelog/compare/index.esm.js.map +1 -0
- package/changelog/compare/is-equal.d.ts +114 -0
- package/changelog/compare/is-equal.d.ts.map +1 -0
- package/changelog/index.cjs.js +6448 -0
- package/changelog/index.cjs.js.map +1 -0
- package/changelog/index.d.ts +6 -0
- package/changelog/index.d.ts.map +1 -0
- package/changelog/index.esm.js +6358 -0
- package/changelog/index.esm.js.map +1 -0
- package/changelog/models/changelog.d.ts +86 -0
- package/changelog/models/changelog.d.ts.map +1 -0
- package/changelog/models/commit-ref.d.ts +51 -0
- package/changelog/models/commit-ref.d.ts.map +1 -0
- package/changelog/models/entry.d.ts +84 -0
- package/changelog/models/entry.d.ts.map +1 -0
- package/changelog/models/index.cjs.js +2043 -0
- package/changelog/models/index.cjs.js.map +1 -0
- package/changelog/models/index.d.ts +11 -0
- package/changelog/models/index.d.ts.map +1 -0
- package/changelog/models/index.esm.js +2026 -0
- package/changelog/models/index.esm.js.map +1 -0
- package/changelog/models/schema.d.ts +68 -0
- package/changelog/models/schema.d.ts.map +1 -0
- package/changelog/models/section.d.ts +25 -0
- package/changelog/models/section.d.ts.map +1 -0
- package/changelog/operations/add-entry.d.ts +56 -0
- package/changelog/operations/add-entry.d.ts.map +1 -0
- package/changelog/operations/add-item.d.ts +18 -0
- package/changelog/operations/add-item.d.ts.map +1 -0
- package/changelog/operations/filter-by-predicate.d.ts +81 -0
- package/changelog/operations/filter-by-predicate.d.ts.map +1 -0
- package/changelog/operations/filter-by-range.d.ts +63 -0
- package/changelog/operations/filter-by-range.d.ts.map +1 -0
- package/changelog/operations/filter-entries.d.ts +9 -0
- package/changelog/operations/filter-entries.d.ts.map +1 -0
- package/changelog/operations/index.cjs.js +2455 -0
- package/changelog/operations/index.cjs.js.map +1 -0
- package/changelog/operations/index.d.ts +15 -0
- package/changelog/operations/index.d.ts.map +1 -0
- package/changelog/operations/index.esm.js +2411 -0
- package/changelog/operations/index.esm.js.map +1 -0
- package/changelog/operations/merge.d.ts +88 -0
- package/changelog/operations/merge.d.ts.map +1 -0
- package/changelog/operations/remove-entry.d.ts +45 -0
- package/changelog/operations/remove-entry.d.ts.map +1 -0
- package/changelog/operations/remove-section.d.ts +50 -0
- package/changelog/operations/remove-section.d.ts.map +1 -0
- package/changelog/operations/transform.d.ts +143 -0
- package/changelog/operations/transform.d.ts.map +1 -0
- package/changelog/parse/index.cjs.js +1282 -0
- package/changelog/parse/index.cjs.js.map +1 -0
- package/changelog/parse/index.d.ts +5 -0
- package/changelog/parse/index.d.ts.map +1 -0
- package/changelog/parse/index.esm.js +1275 -0
- package/changelog/parse/index.esm.js.map +1 -0
- package/changelog/parse/line.d.ts +48 -0
- package/changelog/parse/line.d.ts.map +1 -0
- package/changelog/parse/parser.d.ts +16 -0
- package/changelog/parse/parser.d.ts.map +1 -0
- package/changelog/parse/tokenizer.d.ts +49 -0
- package/changelog/parse/tokenizer.d.ts.map +1 -0
- package/changelog/serialize/index.cjs.js +574 -0
- package/changelog/serialize/index.cjs.js.map +1 -0
- package/changelog/serialize/index.d.ts +6 -0
- package/changelog/serialize/index.d.ts.map +1 -0
- package/changelog/serialize/index.esm.js +564 -0
- package/changelog/serialize/index.esm.js.map +1 -0
- package/changelog/serialize/templates.d.ts +81 -0
- package/changelog/serialize/templates.d.ts.map +1 -0
- package/changelog/serialize/to-json.d.ts +57 -0
- package/changelog/serialize/to-json.d.ts.map +1 -0
- package/changelog/serialize/to-string.d.ts +30 -0
- package/changelog/serialize/to-string.d.ts.map +1 -0
- package/commits/index.cjs.js +648 -0
- package/commits/index.cjs.js.map +1 -0
- package/commits/index.d.ts +3 -0
- package/commits/index.d.ts.map +1 -0
- package/commits/index.esm.js +629 -0
- package/commits/index.esm.js.map +1 -0
- package/commits/models/breaking.d.ts +39 -0
- package/commits/models/breaking.d.ts.map +1 -0
- package/commits/models/commit-type.d.ts +32 -0
- package/commits/models/commit-type.d.ts.map +1 -0
- package/commits/models/conventional.d.ts +49 -0
- package/commits/models/conventional.d.ts.map +1 -0
- package/commits/models/index.cjs.js +207 -0
- package/commits/models/index.cjs.js.map +1 -0
- package/commits/models/index.d.ts +7 -0
- package/commits/models/index.d.ts.map +1 -0
- package/commits/models/index.esm.js +193 -0
- package/commits/models/index.esm.js.map +1 -0
- package/commits/parse/body.d.ts +18 -0
- package/commits/parse/body.d.ts.map +1 -0
- package/commits/parse/footer.d.ts +16 -0
- package/commits/parse/footer.d.ts.map +1 -0
- package/commits/parse/header.d.ts +15 -0
- package/commits/parse/header.d.ts.map +1 -0
- package/commits/parse/index.cjs.js +505 -0
- package/commits/parse/index.cjs.js.map +1 -0
- package/commits/parse/index.d.ts +5 -0
- package/commits/parse/index.d.ts.map +1 -0
- package/commits/parse/index.esm.js +499 -0
- package/commits/parse/index.esm.js.map +1 -0
- package/commits/parse/message.d.ts +17 -0
- package/commits/parse/message.d.ts.map +1 -0
- package/commits/utils/replace-char.d.ts +19 -0
- package/commits/utils/replace-char.d.ts.map +1 -0
- package/flow/executor/execute.d.ts +72 -0
- package/flow/executor/execute.d.ts.map +1 -0
- package/flow/executor/index.cjs.js +4402 -0
- package/flow/executor/index.cjs.js.map +1 -0
- package/flow/executor/index.d.ts +3 -0
- package/flow/executor/index.d.ts.map +1 -0
- package/flow/executor/index.esm.js +4398 -0
- package/flow/executor/index.esm.js.map +1 -0
- package/flow/factory.d.ts +58 -0
- package/flow/factory.d.ts.map +1 -0
- package/flow/index.cjs.js +8506 -0
- package/flow/index.cjs.js.map +1 -0
- package/flow/index.d.ts +7 -0
- package/flow/index.d.ts.map +1 -0
- package/flow/index.esm.js +8451 -0
- package/flow/index.esm.js.map +1 -0
- package/flow/models/flow.d.ts +130 -0
- package/flow/models/flow.d.ts.map +1 -0
- package/flow/models/index.cjs.js +285 -0
- package/flow/models/index.cjs.js.map +1 -0
- package/flow/models/index.d.ts +7 -0
- package/flow/models/index.d.ts.map +1 -0
- package/flow/models/index.esm.js +268 -0
- package/flow/models/index.esm.js.map +1 -0
- package/flow/models/step.d.ts +108 -0
- package/flow/models/step.d.ts.map +1 -0
- package/flow/models/types.d.ts +150 -0
- package/flow/models/types.d.ts.map +1 -0
- package/flow/presets/conventional.d.ts +59 -0
- package/flow/presets/conventional.d.ts.map +1 -0
- package/flow/presets/independent.d.ts +61 -0
- package/flow/presets/independent.d.ts.map +1 -0
- package/flow/presets/index.cjs.js +3903 -0
- package/flow/presets/index.cjs.js.map +1 -0
- package/flow/presets/index.d.ts +4 -0
- package/flow/presets/index.d.ts.map +1 -0
- package/flow/presets/index.esm.js +3889 -0
- package/flow/presets/index.esm.js.map +1 -0
- package/flow/presets/synced.d.ts +65 -0
- package/flow/presets/synced.d.ts.map +1 -0
- package/flow/steps/analyze-commits.d.ts +19 -0
- package/flow/steps/analyze-commits.d.ts.map +1 -0
- package/flow/steps/calculate-bump.d.ts +27 -0
- package/flow/steps/calculate-bump.d.ts.map +1 -0
- package/flow/steps/create-commit.d.ts +16 -0
- package/flow/steps/create-commit.d.ts.map +1 -0
- package/flow/steps/create-tag.d.ts +22 -0
- package/flow/steps/create-tag.d.ts.map +1 -0
- package/flow/steps/fetch-registry.d.ts +19 -0
- package/flow/steps/fetch-registry.d.ts.map +1 -0
- package/flow/steps/generate-changelog.d.ts +25 -0
- package/flow/steps/generate-changelog.d.ts.map +1 -0
- package/flow/steps/index.cjs.js +3523 -0
- package/flow/steps/index.cjs.js.map +1 -0
- package/flow/steps/index.d.ts +8 -0
- package/flow/steps/index.d.ts.map +1 -0
- package/flow/steps/index.esm.js +3504 -0
- package/flow/steps/index.esm.js.map +1 -0
- package/flow/steps/update-packages.d.ts +25 -0
- package/flow/steps/update-packages.d.ts.map +1 -0
- package/flow/utils/interpolate.d.ts +11 -0
- package/flow/utils/interpolate.d.ts.map +1 -0
- package/git/factory.d.ts +233 -0
- package/git/factory.d.ts.map +1 -0
- package/git/index.cjs.js +2863 -0
- package/git/index.cjs.js.map +1 -0
- package/git/index.d.ts +5 -0
- package/git/index.d.ts.map +1 -0
- package/git/index.esm.js +2785 -0
- package/git/index.esm.js.map +1 -0
- package/git/models/commit.d.ts +129 -0
- package/git/models/commit.d.ts.map +1 -0
- package/git/models/index.cjs.js +755 -0
- package/git/models/index.cjs.js.map +1 -0
- package/git/models/index.d.ts +7 -0
- package/git/models/index.d.ts.map +1 -0
- package/git/models/index.esm.js +729 -0
- package/git/models/index.esm.js.map +1 -0
- package/git/models/ref.d.ts +120 -0
- package/git/models/ref.d.ts.map +1 -0
- package/git/models/tag.d.ts +141 -0
- package/git/models/tag.d.ts.map +1 -0
- package/git/operations/commit.d.ts +97 -0
- package/git/operations/commit.d.ts.map +1 -0
- package/git/operations/head-info.d.ts +29 -0
- package/git/operations/head-info.d.ts.map +1 -0
- package/git/operations/index.cjs.js +1954 -0
- package/git/operations/index.cjs.js.map +1 -0
- package/git/operations/index.d.ts +14 -0
- package/git/operations/index.d.ts.map +1 -0
- package/git/operations/index.esm.js +1903 -0
- package/git/operations/index.esm.js.map +1 -0
- package/git/operations/log.d.ts +104 -0
- package/git/operations/log.d.ts.map +1 -0
- package/git/operations/manage-tags.d.ts +60 -0
- package/git/operations/manage-tags.d.ts.map +1 -0
- package/git/operations/query-tags.d.ts +88 -0
- package/git/operations/query-tags.d.ts.map +1 -0
- package/git/operations/stage.d.ts +66 -0
- package/git/operations/stage.d.ts.map +1 -0
- package/git/operations/status.d.ts +173 -0
- package/git/operations/status.d.ts.map +1 -0
- package/index.cjs.js +16761 -0
- package/index.cjs.js.map +1 -0
- package/index.d.ts +102 -0
- package/index.d.ts.map +1 -0
- package/index.esm.js +16427 -0
- package/index.esm.js.map +1 -0
- package/package.json +200 -0
- package/registry/factory.d.ts +18 -0
- package/registry/factory.d.ts.map +1 -0
- package/registry/index.cjs.js +543 -0
- package/registry/index.cjs.js.map +1 -0
- package/registry/index.d.ts +5 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.esm.js +535 -0
- package/registry/index.esm.js.map +1 -0
- package/registry/models/index.cjs.js +69 -0
- package/registry/models/index.cjs.js.map +1 -0
- package/registry/models/index.d.ts +6 -0
- package/registry/models/index.d.ts.map +1 -0
- package/registry/models/index.esm.js +66 -0
- package/registry/models/index.esm.js.map +1 -0
- package/registry/models/package-info.d.ts +55 -0
- package/registry/models/package-info.d.ts.map +1 -0
- package/registry/models/registry.d.ts +62 -0
- package/registry/models/registry.d.ts.map +1 -0
- package/registry/models/version-info.d.ts +67 -0
- package/registry/models/version-info.d.ts.map +1 -0
- package/registry/npm/cache.d.ts +50 -0
- package/registry/npm/cache.d.ts.map +1 -0
- package/registry/npm/client.d.ts +30 -0
- package/registry/npm/client.d.ts.map +1 -0
- package/registry/npm/index.cjs.js +456 -0
- package/registry/npm/index.cjs.js.map +1 -0
- package/registry/npm/index.d.ts +4 -0
- package/registry/npm/index.d.ts.map +1 -0
- package/registry/npm/index.esm.js +451 -0
- package/registry/npm/index.esm.js.map +1 -0
- package/semver/compare/compare.d.ts +100 -0
- package/semver/compare/compare.d.ts.map +1 -0
- package/semver/compare/index.cjs.js +386 -0
- package/semver/compare/index.cjs.js.map +1 -0
- package/semver/compare/index.d.ts +3 -0
- package/semver/compare/index.d.ts.map +1 -0
- package/semver/compare/index.esm.js +370 -0
- package/semver/compare/index.esm.js.map +1 -0
- package/semver/compare/sort.d.ts +36 -0
- package/semver/compare/sort.d.ts.map +1 -0
- package/semver/format/index.cjs.js +58 -0
- package/semver/format/index.cjs.js.map +1 -0
- package/semver/format/index.d.ts +2 -0
- package/semver/format/index.d.ts.map +1 -0
- package/semver/format/index.esm.js +53 -0
- package/semver/format/index.esm.js.map +1 -0
- package/semver/format/to-string.d.ts +31 -0
- package/semver/format/to-string.d.ts.map +1 -0
- package/semver/increment/bump.d.ts +37 -0
- package/semver/increment/bump.d.ts.map +1 -0
- package/semver/increment/index.cjs.js +223 -0
- package/semver/increment/index.cjs.js.map +1 -0
- package/semver/increment/index.d.ts +2 -0
- package/semver/increment/index.d.ts.map +1 -0
- package/semver/increment/index.esm.js +219 -0
- package/semver/increment/index.esm.js.map +1 -0
- package/semver/index.cjs.js +1499 -0
- package/semver/index.cjs.js.map +1 -0
- package/semver/index.d.ts +6 -0
- package/semver/index.d.ts.map +1 -0
- package/semver/index.esm.js +1458 -0
- package/semver/index.esm.js.map +1 -0
- package/semver/models/index.cjs.js +153 -0
- package/semver/models/index.cjs.js.map +1 -0
- package/semver/models/index.d.ts +5 -0
- package/semver/models/index.d.ts.map +1 -0
- package/semver/models/index.esm.js +139 -0
- package/semver/models/index.esm.js.map +1 -0
- package/semver/models/range.d.ts +83 -0
- package/semver/models/range.d.ts.map +1 -0
- package/semver/models/version.d.ts +78 -0
- package/semver/models/version.d.ts.map +1 -0
- package/semver/parse/index.cjs.js +799 -0
- package/semver/parse/index.cjs.js.map +1 -0
- package/semver/parse/index.d.ts +5 -0
- package/semver/parse/index.d.ts.map +1 -0
- package/semver/parse/index.esm.js +793 -0
- package/semver/parse/index.esm.js.map +1 -0
- package/semver/parse/range.d.ts +38 -0
- package/semver/parse/range.d.ts.map +1 -0
- package/semver/parse/version.d.ts +49 -0
- package/semver/parse/version.d.ts.map +1 -0
- package/workspace/discovery/changelog-path.d.ts +21 -0
- package/workspace/discovery/changelog-path.d.ts.map +1 -0
- package/workspace/discovery/dependencies.d.ts +145 -0
- package/workspace/discovery/dependencies.d.ts.map +1 -0
- package/workspace/discovery/discover-changelogs.d.ts +76 -0
- package/workspace/discovery/discover-changelogs.d.ts.map +1 -0
- package/workspace/discovery/index.cjs.js +2300 -0
- package/workspace/discovery/index.cjs.js.map +1 -0
- package/workspace/discovery/index.d.ts +13 -0
- package/workspace/discovery/index.d.ts.map +1 -0
- package/workspace/discovery/index.esm.js +2283 -0
- package/workspace/discovery/index.esm.js.map +1 -0
- package/workspace/discovery/packages.d.ts +83 -0
- package/workspace/discovery/packages.d.ts.map +1 -0
- package/workspace/index.cjs.js +4445 -0
- package/workspace/index.cjs.js.map +1 -0
- package/workspace/index.d.ts +52 -0
- package/workspace/index.d.ts.map +1 -0
- package/workspace/index.esm.js +4394 -0
- package/workspace/index.esm.js.map +1 -0
- package/workspace/models/index.cjs.js +284 -0
- package/workspace/models/index.cjs.js.map +1 -0
- package/workspace/models/index.d.ts +10 -0
- package/workspace/models/index.d.ts.map +1 -0
- package/workspace/models/index.esm.js +261 -0
- package/workspace/models/index.esm.js.map +1 -0
- package/workspace/models/project.d.ts +118 -0
- package/workspace/models/project.d.ts.map +1 -0
- package/workspace/models/workspace.d.ts +139 -0
- package/workspace/models/workspace.d.ts.map +1 -0
- package/workspace/operations/batch-update.d.ts +99 -0
- package/workspace/operations/batch-update.d.ts.map +1 -0
- package/workspace/operations/cascade-bump.d.ts +125 -0
- package/workspace/operations/cascade-bump.d.ts.map +1 -0
- package/workspace/operations/index.cjs.js +2675 -0
- package/workspace/operations/index.cjs.js.map +1 -0
- package/workspace/operations/index.d.ts +12 -0
- package/workspace/operations/index.d.ts.map +1 -0
- package/workspace/operations/index.esm.js +2663 -0
- package/workspace/operations/index.esm.js.map +1 -0
- package/workspace/operations/validate.d.ts +85 -0
- package/workspace/operations/validate.d.ts.map +1 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of Error built-ins via factory functions.
|
|
3
|
+
*
|
|
4
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
5
|
+
* provides factory functions that use Reflect.construct internally.
|
|
6
|
+
*
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/error
|
|
11
|
+
*/
|
|
12
|
+
// Capture references at module initialization time
|
|
13
|
+
const _Error = globalThis.Error;
|
|
14
|
+
const _Reflect = globalThis.Reflect;
|
|
15
|
+
/**
|
|
16
|
+
* (Safe copy) Creates a new Error using the captured Error constructor.
|
|
17
|
+
* Use this instead of `new Error()`.
|
|
18
|
+
*
|
|
19
|
+
* @param message - Optional error message.
|
|
20
|
+
* @param options - Optional error options.
|
|
21
|
+
* @returns A new Error instance.
|
|
22
|
+
*/
|
|
23
|
+
const createError = (message, options) => _Reflect.construct(_Error, [message, options]);
|
|
24
|
+
|
|
25
|
+
const COMMIT_TYPES = {
|
|
26
|
+
feat: { description: 'A new feature', semverBump: 'minor' },
|
|
27
|
+
fix: { description: 'A bug fix', semverBump: 'patch' },
|
|
28
|
+
docs: { description: 'Documentation only changes', semverBump: 'none' },
|
|
29
|
+
style: { description: 'Code style changes (formatting, etc.)', semverBump: 'none' },
|
|
30
|
+
refactor: { description: 'Code refactoring without feature or fix', semverBump: 'none' },
|
|
31
|
+
perf: { description: 'Performance improvements', semverBump: 'patch' },
|
|
32
|
+
test: { description: 'Adding or updating tests', semverBump: 'none' },
|
|
33
|
+
build: { description: 'Build system or dependencies', semverBump: 'none' },
|
|
34
|
+
ci: { description: 'CI/CD configuration', semverBump: 'none' },
|
|
35
|
+
chore: { description: 'Other changes', semverBump: 'none' },
|
|
36
|
+
revert: { description: 'Revert a previous commit', semverBump: 'patch' },
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Checks if a commit type is a standard type.
|
|
40
|
+
*
|
|
41
|
+
* @param type - The commit type to check
|
|
42
|
+
* @returns True if the type is a standard conventional commit type
|
|
43
|
+
*/
|
|
44
|
+
function isStandardType(type) {
|
|
45
|
+
return type in COMMIT_TYPES;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Replaces all occurrences of a character in a string.
|
|
50
|
+
* Uses character-by-character iteration to avoid regex (ReDoS-safe).
|
|
51
|
+
*
|
|
52
|
+
* @param input - The input string
|
|
53
|
+
* @param target - The character to replace
|
|
54
|
+
* @param replacement - The replacement character
|
|
55
|
+
* @returns String with all occurrences replaced
|
|
56
|
+
*/
|
|
57
|
+
function replaceChar(input, target, replacement) {
|
|
58
|
+
const result = [];
|
|
59
|
+
for (let i = 0; i < input.length; i++) {
|
|
60
|
+
result.push(input[i] === target ? replacement : input[i]);
|
|
61
|
+
}
|
|
62
|
+
return result.join('');
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Replaces all hyphens with spaces.
|
|
66
|
+
* Convenience wrapper for normalizing footer keys.
|
|
67
|
+
*
|
|
68
|
+
* @param input - The input string
|
|
69
|
+
* @returns String with hyphens replaced by spaces
|
|
70
|
+
*/
|
|
71
|
+
function hyphenToSpace(input) {
|
|
72
|
+
return replaceChar(input, '-', ' ');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Parses the body section of a commit message.
|
|
77
|
+
*
|
|
78
|
+
* The body starts after the first blank line and continues until
|
|
79
|
+
* we encounter a footer (key: value or key #value pattern) or end of message.
|
|
80
|
+
*
|
|
81
|
+
* @param lines - All lines of the commit message
|
|
82
|
+
* @param startIndex - Index to start looking for body (after header)
|
|
83
|
+
* @returns Parsed body or undefined if no body
|
|
84
|
+
*/
|
|
85
|
+
function parseBody(lines, startIndex) {
|
|
86
|
+
// Skip blank lines to find body start
|
|
87
|
+
let pos = startIndex;
|
|
88
|
+
while (pos < lines.length && lines[pos].trim() === '') {
|
|
89
|
+
pos++;
|
|
90
|
+
}
|
|
91
|
+
if (pos >= lines.length) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
// If the first non-blank line is a footer, there's no body
|
|
95
|
+
if (isFooterLine(lines[pos])) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const bodyLines = [];
|
|
99
|
+
// Collect body lines until we hit a footer or end
|
|
100
|
+
while (pos < lines.length) {
|
|
101
|
+
const line = lines[pos];
|
|
102
|
+
// Check if this line looks like a footer
|
|
103
|
+
if (isFooterLine(line)) {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
// Check for blank line followed by a footer
|
|
107
|
+
if (line.trim() === '' && pos + 1 < lines.length && isFooterLine(lines[pos + 1])) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
bodyLines.push(line);
|
|
111
|
+
pos++;
|
|
112
|
+
}
|
|
113
|
+
// Trim trailing blank lines from body
|
|
114
|
+
while (bodyLines.length > 0 && bodyLines[bodyLines.length - 1].trim() === '') {
|
|
115
|
+
bodyLines.pop();
|
|
116
|
+
}
|
|
117
|
+
if (bodyLines.length === 0) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
body: bodyLines.join('\n'),
|
|
122
|
+
endIndex: pos,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Checks if a line looks like a footer.
|
|
127
|
+
*
|
|
128
|
+
* Footer format:
|
|
129
|
+
* - key: value
|
|
130
|
+
* - key #value (for issue references)
|
|
131
|
+
* - BREAKING CHANGE: description
|
|
132
|
+
* - BREAKING-CHANGE: description
|
|
133
|
+
*
|
|
134
|
+
* @param line - The line to check
|
|
135
|
+
* @returns True if the line looks like a footer
|
|
136
|
+
*/
|
|
137
|
+
function isFooterLine(line) {
|
|
138
|
+
if (!line)
|
|
139
|
+
return false;
|
|
140
|
+
const trimmed = line.trim();
|
|
141
|
+
if (trimmed === '')
|
|
142
|
+
return false;
|
|
143
|
+
// Check for BREAKING CHANGE or BREAKING-CHANGE
|
|
144
|
+
if (trimmed.startsWith('BREAKING CHANGE:') || trimmed.startsWith('BREAKING-CHANGE:')) {
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
// Check for token: value or token #value pattern
|
|
148
|
+
let pos = 0;
|
|
149
|
+
// Skip leading whitespace
|
|
150
|
+
while (pos < trimmed.length && trimmed[pos] === ' ') {
|
|
151
|
+
pos++;
|
|
152
|
+
}
|
|
153
|
+
// Read token (alphanumeric and hyphens)
|
|
154
|
+
const tokenStart = pos;
|
|
155
|
+
while (pos < trimmed.length) {
|
|
156
|
+
const char = trimmed[pos];
|
|
157
|
+
const code = char.charCodeAt(0);
|
|
158
|
+
if ((code >= 97 && code <= 122) || // a-z
|
|
159
|
+
(code >= 65 && code <= 90) || // A-Z
|
|
160
|
+
(code >= 48 && code <= 57) || // 0-9
|
|
161
|
+
code === 45 // -
|
|
162
|
+
) {
|
|
163
|
+
pos++;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Must have at least one character in token
|
|
170
|
+
if (pos === tokenStart)
|
|
171
|
+
return false;
|
|
172
|
+
// Must be followed by : or space-#
|
|
173
|
+
if (trimmed[pos] === ':') {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (trimmed[pos] === ' ' && trimmed[pos + 1] === '#') {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Checks if a footer key indicates a breaking change.
|
|
184
|
+
*
|
|
185
|
+
* @param key - The footer key to check
|
|
186
|
+
* @returns True if the key indicates a breaking change
|
|
187
|
+
*/
|
|
188
|
+
function isBreakingFooterKey(key) {
|
|
189
|
+
const normalized = hyphenToSpace(key.toUpperCase());
|
|
190
|
+
return normalized === 'BREAKING CHANGE';
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Parses the footer section of a commit message.
|
|
195
|
+
*
|
|
196
|
+
* @param lines - All lines of the commit message
|
|
197
|
+
* @param startIndex - Index where footers start
|
|
198
|
+
* @returns Parsed footers
|
|
199
|
+
*/
|
|
200
|
+
function parseFooters(lines, startIndex) {
|
|
201
|
+
const footers = [];
|
|
202
|
+
let breakingDescription;
|
|
203
|
+
let pos = startIndex;
|
|
204
|
+
// Skip blank lines
|
|
205
|
+
while (pos < lines.length && lines[pos].trim() === '') {
|
|
206
|
+
pos++;
|
|
207
|
+
}
|
|
208
|
+
while (pos < lines.length) {
|
|
209
|
+
const line = lines[pos];
|
|
210
|
+
const footer = parseFooterLine(line);
|
|
211
|
+
if (footer) {
|
|
212
|
+
footers.push(footer);
|
|
213
|
+
// Check for breaking change
|
|
214
|
+
if (isBreakingFooterKey(footer.key)) {
|
|
215
|
+
breakingDescription = footer.value;
|
|
216
|
+
// Breaking description may span multiple lines
|
|
217
|
+
pos++;
|
|
218
|
+
while (pos < lines.length && !isNewFooter(lines[pos])) {
|
|
219
|
+
const nextLine = lines[pos];
|
|
220
|
+
if (nextLine.trim() !== '') {
|
|
221
|
+
breakingDescription += '\n' + nextLine;
|
|
222
|
+
}
|
|
223
|
+
pos++;
|
|
224
|
+
}
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
pos++;
|
|
229
|
+
}
|
|
230
|
+
return { footers, breakingDescription };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Parses a single footer line.
|
|
234
|
+
*
|
|
235
|
+
* @param line - The line to parse
|
|
236
|
+
* @returns The parsed CommitFooter or null if not a valid footer
|
|
237
|
+
*/
|
|
238
|
+
function parseFooterLine(line) {
|
|
239
|
+
if (!line)
|
|
240
|
+
return null;
|
|
241
|
+
const trimmed = line.trim();
|
|
242
|
+
if (trimmed === '')
|
|
243
|
+
return null;
|
|
244
|
+
// Check for BREAKING CHANGE or BREAKING-CHANGE
|
|
245
|
+
if (trimmed.startsWith('BREAKING CHANGE:')) {
|
|
246
|
+
return {
|
|
247
|
+
key: 'BREAKING CHANGE',
|
|
248
|
+
value: trimmed.slice(16).trim(),
|
|
249
|
+
separator: ':',
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (trimmed.startsWith('BREAKING-CHANGE:')) {
|
|
253
|
+
return {
|
|
254
|
+
key: 'BREAKING-CHANGE',
|
|
255
|
+
value: trimmed.slice(16).trim(),
|
|
256
|
+
separator: ':',
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
// Parse token: value or token #value
|
|
260
|
+
let pos = 0;
|
|
261
|
+
// Read token
|
|
262
|
+
const tokenStart = pos;
|
|
263
|
+
while (pos < trimmed.length) {
|
|
264
|
+
const char = trimmed[pos];
|
|
265
|
+
const code = char.charCodeAt(0);
|
|
266
|
+
if ((code >= 97 && code <= 122) || // a-z
|
|
267
|
+
(code >= 65 && code <= 90) || // A-Z
|
|
268
|
+
(code >= 48 && code <= 57) || // 0-9
|
|
269
|
+
code === 45 // -
|
|
270
|
+
) {
|
|
271
|
+
pos++;
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (pos === tokenStart)
|
|
278
|
+
return null;
|
|
279
|
+
const key = trimmed.slice(tokenStart, pos);
|
|
280
|
+
// Check separator
|
|
281
|
+
let separator;
|
|
282
|
+
let valueStart;
|
|
283
|
+
if (trimmed[pos] === ':') {
|
|
284
|
+
separator = ':';
|
|
285
|
+
valueStart = pos + 1;
|
|
286
|
+
}
|
|
287
|
+
else if (trimmed[pos] === ' ' && trimmed[pos + 1] === '#') {
|
|
288
|
+
separator = ' #';
|
|
289
|
+
valueStart = pos + 2;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
// Skip whitespace after separator (for : case)
|
|
295
|
+
if (separator === ':') {
|
|
296
|
+
while (valueStart < trimmed.length && trimmed[valueStart] === ' ') {
|
|
297
|
+
valueStart++;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const value = trimmed.slice(valueStart);
|
|
301
|
+
return { key, value, separator };
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Checks if a line starts a new footer.
|
|
305
|
+
*
|
|
306
|
+
* @param line - The line to check
|
|
307
|
+
* @returns True if the line starts a new footer
|
|
308
|
+
*/
|
|
309
|
+
function isNewFooter(line) {
|
|
310
|
+
if (!line)
|
|
311
|
+
return false;
|
|
312
|
+
return parseFooterLine(line) !== null;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Parses a conventional commit header line.
|
|
317
|
+
*
|
|
318
|
+
* @param line - The first line of the commit message
|
|
319
|
+
* @returns Parsed header with type, scope, subject, and breaking flag
|
|
320
|
+
*/
|
|
321
|
+
function parseHeader(line) {
|
|
322
|
+
let pos = 0;
|
|
323
|
+
const len = line.length;
|
|
324
|
+
// Extract type (alphanumeric characters until ( or : or !)
|
|
325
|
+
const typeStart = pos;
|
|
326
|
+
while (pos < len) {
|
|
327
|
+
const char = line[pos];
|
|
328
|
+
const code = char.charCodeAt(0);
|
|
329
|
+
// a-z, A-Z, 0-9
|
|
330
|
+
if ((code >= 97 && code <= 122) || (code >= 65 && code <= 90) || (code >= 48 && code <= 57)) {
|
|
331
|
+
pos++;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
const type = line.slice(typeStart, pos).toLowerCase();
|
|
338
|
+
// Check for scope in parentheses
|
|
339
|
+
let scope;
|
|
340
|
+
if (line[pos] === '(') {
|
|
341
|
+
pos++; // skip (
|
|
342
|
+
const scopeStart = pos;
|
|
343
|
+
while (pos < len && line[pos] !== ')') {
|
|
344
|
+
pos++;
|
|
345
|
+
}
|
|
346
|
+
scope = line.slice(scopeStart, pos);
|
|
347
|
+
if (line[pos] === ')') {
|
|
348
|
+
pos++; // skip )
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// Check for breaking change indicator (!)
|
|
352
|
+
const breaking = line[pos] === '!';
|
|
353
|
+
if (breaking) {
|
|
354
|
+
pos++;
|
|
355
|
+
}
|
|
356
|
+
// Expect colon
|
|
357
|
+
if (line[pos] === ':') {
|
|
358
|
+
pos++;
|
|
359
|
+
}
|
|
360
|
+
// Skip whitespace after colon
|
|
361
|
+
while (pos < len && line[pos] === ' ') {
|
|
362
|
+
pos++;
|
|
363
|
+
}
|
|
364
|
+
// Rest is subject
|
|
365
|
+
const subject = line.slice(pos).trim();
|
|
366
|
+
return {
|
|
367
|
+
type,
|
|
368
|
+
scope,
|
|
369
|
+
subject,
|
|
370
|
+
breaking,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Maximum commit message length (10KB)
|
|
376
|
+
*/
|
|
377
|
+
const MAX_MESSAGE_LENGTH = 10 * 1024;
|
|
378
|
+
/**
|
|
379
|
+
* Parses a conventional commit message.
|
|
380
|
+
*
|
|
381
|
+
* @param message - The complete commit message
|
|
382
|
+
* @returns Parsed ConventionalCommit object
|
|
383
|
+
* @throws {Error} If message exceeds maximum length
|
|
384
|
+
*/
|
|
385
|
+
function parseConventionalCommit(message) {
|
|
386
|
+
if (message.length > MAX_MESSAGE_LENGTH) {
|
|
387
|
+
throw createError(`Commit message exceeds maximum length of ${MAX_MESSAGE_LENGTH} characters`);
|
|
388
|
+
}
|
|
389
|
+
const lines = splitLines(message);
|
|
390
|
+
if (lines.length === 0) {
|
|
391
|
+
return {
|
|
392
|
+
type: '',
|
|
393
|
+
subject: '',
|
|
394
|
+
footers: [],
|
|
395
|
+
breaking: false,
|
|
396
|
+
raw: message,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
// Parse header (first line)
|
|
400
|
+
const header = parseHeader(lines[0]);
|
|
401
|
+
// Parse body and footers
|
|
402
|
+
let body;
|
|
403
|
+
let footersStartIndex = 1;
|
|
404
|
+
if (lines.length > 1) {
|
|
405
|
+
const bodyResult = parseBody(lines, 1);
|
|
406
|
+
if (bodyResult) {
|
|
407
|
+
body = bodyResult.body;
|
|
408
|
+
footersStartIndex = bodyResult.endIndex;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
// Parse footers
|
|
412
|
+
const footersResult = parseFooters(lines, footersStartIndex);
|
|
413
|
+
const breakingDescriptionFromFooter = footersResult.breakingDescription;
|
|
414
|
+
// Determine breaking status
|
|
415
|
+
const breaking = header.breaking || footersResult.footers.some((f) => hyphenToSpace(f.key.toUpperCase()) === 'BREAKING CHANGE');
|
|
416
|
+
// Determine breaking description
|
|
417
|
+
let breakingDescription;
|
|
418
|
+
if (header.breaking && header.subject) {
|
|
419
|
+
// If breaking via !, the subject may describe the breaking change
|
|
420
|
+
breakingDescription = header.subject;
|
|
421
|
+
}
|
|
422
|
+
if (breakingDescriptionFromFooter) {
|
|
423
|
+
breakingDescription = breakingDescriptionFromFooter;
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
type: header.type,
|
|
427
|
+
scope: header.scope,
|
|
428
|
+
subject: header.subject,
|
|
429
|
+
body,
|
|
430
|
+
footers: footersResult.footers,
|
|
431
|
+
breaking,
|
|
432
|
+
breakingDescription,
|
|
433
|
+
raw: message,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Splits a message into lines, handling different line endings.
|
|
438
|
+
*
|
|
439
|
+
* @param message - The message to split into lines
|
|
440
|
+
* @returns An array of lines from the message
|
|
441
|
+
*/
|
|
442
|
+
function splitLines(message) {
|
|
443
|
+
const lines = [];
|
|
444
|
+
let currentLine = '';
|
|
445
|
+
let i = 0;
|
|
446
|
+
while (i < message.length) {
|
|
447
|
+
const char = message[i];
|
|
448
|
+
if (char === '\r') {
|
|
449
|
+
lines.push(currentLine);
|
|
450
|
+
currentLine = '';
|
|
451
|
+
// Skip \n if this is \r\n
|
|
452
|
+
if (message[i + 1] === '\n') {
|
|
453
|
+
i++;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
else if (char === '\n') {
|
|
457
|
+
lines.push(currentLine);
|
|
458
|
+
currentLine = '';
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
currentLine += char;
|
|
462
|
+
}
|
|
463
|
+
i++;
|
|
464
|
+
}
|
|
465
|
+
// Add final line if not empty
|
|
466
|
+
if (currentLine || message.endsWith('\n') || message.endsWith('\r')) {
|
|
467
|
+
lines.push(currentLine);
|
|
468
|
+
}
|
|
469
|
+
return lines;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Checks if a commit message follows conventional commit format.
|
|
473
|
+
*
|
|
474
|
+
* @param message - The commit message to check
|
|
475
|
+
* @returns true if the message appears to be a conventional commit
|
|
476
|
+
*/
|
|
477
|
+
function isConventionalCommit(message) {
|
|
478
|
+
if (!message || message.trim() === '') {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
const firstLine = message.split('\n')[0] ?? '';
|
|
482
|
+
const header = parseHeader(firstLine);
|
|
483
|
+
// Must have a type and subject
|
|
484
|
+
if (!header.type || !header.subject) {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
// Type should not be too long (indicates not a type)
|
|
488
|
+
if (header.type.length > 20) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
// Type should be a recognized conventional commit type
|
|
492
|
+
if (!isStandardType(header.type)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export { isConventionalCommit, parseBody, parseConventionalCommit, parseFooters, parseHeader };
|
|
499
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../../../libs/versioning/src/commits/models/commit-type.ts","../../../../../../../../../../libs/versioning/src/commits/utils/replace-char.ts","../../../../../../../../../../libs/versioning/src/commits/parse/body.ts","../../../../../../../../../../libs/versioning/src/commits/models/breaking.ts","../../../../../../../../../../libs/versioning/src/commits/parse/footer.ts","../../../../../../../../../../libs/versioning/src/commits/parse/header.ts","../../../../../../../../../../libs/versioning/src/commits/parse/message.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":[],"mappings":"AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAQ/B,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AAGnC;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,OAAsB,KAAmB,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;;AC9B9H,MAAM,YAAY,GAA8F;IACrH,IAAI,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE;IAC3D,GAAG,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE;IACtD,IAAI,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,UAAU,EAAE,MAAM,EAAE;IACvE,KAAK,EAAE,EAAE,WAAW,EAAE,uCAAuC,EAAE,UAAU,EAAE,MAAM,EAAE;IACnF,QAAQ,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,UAAU,EAAE,MAAM,EAAE;IACxF,IAAI,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,UAAU,EAAE,OAAO,EAAE;IACtE,IAAI,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,EAAE;IACrE,KAAK,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,UAAU,EAAE,MAAM,EAAE;IAC1E,EAAE,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,EAAE;IAC9D,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MA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,CAAC,MAAM,GAAG,EAAE,EAAE;AAC3B,QAAA,OAAO,KAAK;IACd;;IAGA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AAChC,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConventionalCommit } from '../models/conventional';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a conventional commit message.
|
|
4
|
+
*
|
|
5
|
+
* @param message - The complete commit message
|
|
6
|
+
* @returns Parsed ConventionalCommit object
|
|
7
|
+
* @throws {Error} If message exceeds maximum length
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseConventionalCommit(message: string): ConventionalCommit;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a commit message follows conventional commit format.
|
|
12
|
+
*
|
|
13
|
+
* @param message - The commit message to check
|
|
14
|
+
* @returns true if the message appears to be a conventional commit
|
|
15
|
+
*/
|
|
16
|
+
export declare function isConventionalCommit(message: string): boolean;
|
|
17
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/commits/parse/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAahE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CA2D3E;AAyCD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAwB7D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces all occurrences of a character in a string.
|
|
3
|
+
* Uses character-by-character iteration to avoid regex (ReDoS-safe).
|
|
4
|
+
*
|
|
5
|
+
* @param input - The input string
|
|
6
|
+
* @param target - The character to replace
|
|
7
|
+
* @param replacement - The replacement character
|
|
8
|
+
* @returns String with all occurrences replaced
|
|
9
|
+
*/
|
|
10
|
+
export declare function replaceChar(input: string, target: string, replacement: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Replaces all hyphens with spaces.
|
|
13
|
+
* Convenience wrapper for normalizing footer keys.
|
|
14
|
+
*
|
|
15
|
+
* @param input - The input string
|
|
16
|
+
* @returns String with hyphens replaced by spaces
|
|
17
|
+
*/
|
|
18
|
+
export declare function hyphenToSpace(input: string): string;
|
|
19
|
+
//# sourceMappingURL=replace-char.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-char.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/commits/utils/replace-char.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAQtF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Logger } from '@hyperfrontend/logging';
|
|
2
|
+
import type { Tree } from '@hyperfrontend/project-scope';
|
|
3
|
+
import type { GitClient } from '../../git/factory';
|
|
4
|
+
import type { Registry } from '../../registry/models/registry';
|
|
5
|
+
import type { VersionFlow } from '../models/flow';
|
|
6
|
+
import type { FlowResult } from '../models/types';
|
|
7
|
+
/**
|
|
8
|
+
* Options for flow execution.
|
|
9
|
+
*/
|
|
10
|
+
export interface ExecuteOptions {
|
|
11
|
+
/** Dry run - don't commit changes to disk */
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
/** Verbose logging */
|
|
14
|
+
verbose?: boolean;
|
|
15
|
+
/** Custom logger (defaults to console) */
|
|
16
|
+
logger?: Logger;
|
|
17
|
+
/** Custom Tree instance (for testing) */
|
|
18
|
+
tree?: Tree;
|
|
19
|
+
/** Custom Registry instance (for testing) */
|
|
20
|
+
registry?: Registry;
|
|
21
|
+
/** Custom GitClient instance (for testing) */
|
|
22
|
+
git?: GitClient;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Executes a version flow.
|
|
26
|
+
*
|
|
27
|
+
* This is the main entry point for running a versioning workflow.
|
|
28
|
+
* Steps are executed in order, with state accumulated between steps.
|
|
29
|
+
*
|
|
30
|
+
* @param flow - The version flow to execute
|
|
31
|
+
* @param projectName - Name of the project to version (e.g., 'lib-versioning')
|
|
32
|
+
* @param workspaceRoot - Absolute path to workspace root
|
|
33
|
+
* @param options - Execution options
|
|
34
|
+
* @returns Flow execution result
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { createConventionalFlow, executeFlow } from '@hyperfrontend/versioning'
|
|
39
|
+
*
|
|
40
|
+
* const flow = createConventionalFlow({ dryRun: true })
|
|
41
|
+
* const result = await executeFlow(flow, 'lib-utils', '/path/to/workspace')
|
|
42
|
+
*
|
|
43
|
+
* console.log(result.summary)
|
|
44
|
+
* // "Flow success in 234ms: 8 completed, 0 skipped, 0 failed. Version: 1.2.3 → 1.3.0"
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function executeFlow(flow: VersionFlow, projectName: string, workspaceRoot: string, options?: ExecuteOptions): Promise<FlowResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Executes a flow in dry-run mode.
|
|
50
|
+
*
|
|
51
|
+
* Convenience wrapper that sets dryRun: true.
|
|
52
|
+
*
|
|
53
|
+
* @param flow - The version flow to execute
|
|
54
|
+
* @param projectName - Name of the project to version
|
|
55
|
+
* @param workspaceRoot - Absolute path to workspace root
|
|
56
|
+
* @param options - Execution options (dryRun forced to true)
|
|
57
|
+
* @returns Flow execution result (no actual changes made)
|
|
58
|
+
*/
|
|
59
|
+
export declare function dryRun(flow: VersionFlow, projectName: string, workspaceRoot: string, options?: Omit<ExecuteOptions, 'dryRun'>): Promise<FlowResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Validates a flow before execution.
|
|
62
|
+
*
|
|
63
|
+
* Checks for:
|
|
64
|
+
* - Duplicate step IDs
|
|
65
|
+
* - Invalid dependency references
|
|
66
|
+
* - Circular dependencies
|
|
67
|
+
*
|
|
68
|
+
* @param flow - The flow to validate
|
|
69
|
+
* @returns Array of validation errors (empty if valid)
|
|
70
|
+
*/
|
|
71
|
+
export declare function validateFlow(flow: VersionFlow): readonly string[];
|
|
72
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/flow/executor/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAA2B,UAAU,EAA+C,MAAM,iBAAiB,CAAA;AAYvH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,yCAAyC;IACzC,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,SAAS,CAAA;CAChB;AA2FD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAC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