@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
package/ARCHITECTURE.md
ADDED
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
This document describes the internal architecture of `@hyperfrontend/versioning`. For usage examples and quick start guides, see the main [README.md](./README.md).
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Design Principles](#design-principles)
|
|
8
|
+
- [Module Composition](#module-composition)
|
|
9
|
+
- [Data Flow](#data-flow)
|
|
10
|
+
- [Core Types](#core-types)
|
|
11
|
+
- [Security Architecture](#security-architecture)
|
|
12
|
+
- [Module Details](#module-details)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Design Principles
|
|
17
|
+
|
|
18
|
+
### 1. Purely Functional Architecture
|
|
19
|
+
|
|
20
|
+
All operations are implemented as pure functions. State is never mutated—instead, new objects are returned from each operation.
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
// ✅ Pure function - returns new object
|
|
24
|
+
function incrementVersion(version: ParsedVersion, type: ReleaseType): ParsedVersion
|
|
25
|
+
|
|
26
|
+
// ❌ Never mutate - this pattern does not exist in this library
|
|
27
|
+
function updateVersion(version: ParsedVersion, type: ReleaseType): void
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Factory Functions Over Classes
|
|
31
|
+
|
|
32
|
+
All complex objects are created via factory functions rather than class constructors. This simplifies testing, enables tree-shaking, and avoids `this` binding issues.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Factory function pattern used throughout
|
|
36
|
+
const context = createFlowContext({ workspaceRoot, projectName })
|
|
37
|
+
const client = createGitClient({ tree, workspaceRoot })
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. State Machine Parsing
|
|
41
|
+
|
|
42
|
+
All parsing uses character-by-character state machines with O(n) complexity, ensuring predictable performance regardless of input patterns.
|
|
43
|
+
|
|
44
|
+
```mermaid
|
|
45
|
+
flowchart LR
|
|
46
|
+
Input[Raw Input] --> Tokenizer[State Machine Tokenizer]
|
|
47
|
+
Tokenizer --> Tokens[Token Stream]
|
|
48
|
+
Tokens --> Parser[Token Parser]
|
|
49
|
+
Parser --> AST[Structured Data]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 4. Explicit Error Handling
|
|
53
|
+
|
|
54
|
+
Functions return discriminated unions or throw typed errors. No silent failures.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
type ParseResult<T> = { success: true; value: T } | { success: false; error: ParseError }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 5. Composition Over Configuration
|
|
61
|
+
|
|
62
|
+
Complex operations are built by composing simple functions rather than through configuration objects with many options.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Module Composition
|
|
67
|
+
|
|
68
|
+
The library is organized into seven focused modules that compose together:
|
|
69
|
+
|
|
70
|
+
```mermaid
|
|
71
|
+
graph TB
|
|
72
|
+
subgraph "Orchestration Layer"
|
|
73
|
+
flow[flow/]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
subgraph "Domain Modules"
|
|
77
|
+
changelog[changelog/]
|
|
78
|
+
commits[commits/]
|
|
79
|
+
semver[semver/]
|
|
80
|
+
registry[registry/]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
subgraph "Infrastructure Modules"
|
|
84
|
+
git[git/]
|
|
85
|
+
workspace[workspace/]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
flow --> changelog
|
|
89
|
+
flow --> commits
|
|
90
|
+
flow --> semver
|
|
91
|
+
flow --> registry
|
|
92
|
+
flow --> git
|
|
93
|
+
flow --> workspace
|
|
94
|
+
|
|
95
|
+
changelog --> semver
|
|
96
|
+
commits --> changelog
|
|
97
|
+
registry --> semver
|
|
98
|
+
git --> workspace
|
|
99
|
+
|
|
100
|
+
style flow fill:#e1f5fe
|
|
101
|
+
style changelog fill:#fff3e0
|
|
102
|
+
style commits fill:#fff3e0
|
|
103
|
+
style semver fill:#fff3e0
|
|
104
|
+
style registry fill:#fff3e0
|
|
105
|
+
style git fill:#f3e5f5
|
|
106
|
+
style workspace fill:#f3e5f5
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Module Hierarchy
|
|
110
|
+
|
|
111
|
+
| Layer | Modules | Responsibility |
|
|
112
|
+
| -------------- | ------------------------------------------------ | ---------------------------------- |
|
|
113
|
+
| Orchestration | `flow/` | Version release workflow execution |
|
|
114
|
+
| Domain | `changelog/`, `commits/`, `semver/`, `registry/` | Core versioning logic |
|
|
115
|
+
| Infrastructure | `git/`, `workspace/` | File system and git operations |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Data Flow
|
|
120
|
+
|
|
121
|
+
### Version Release Flow
|
|
122
|
+
|
|
123
|
+
The primary use case—releasing a new version—flows through multiple modules:
|
|
124
|
+
|
|
125
|
+
```mermaid
|
|
126
|
+
sequenceDiagram
|
|
127
|
+
participant User
|
|
128
|
+
participant Flow as flow/
|
|
129
|
+
participant Git as git/
|
|
130
|
+
participant Commits as commits/
|
|
131
|
+
participant Semver as semver/
|
|
132
|
+
participant Changelog as changelog/
|
|
133
|
+
participant Registry as registry/
|
|
134
|
+
participant Workspace as workspace/
|
|
135
|
+
|
|
136
|
+
User->>Flow: executeVersionFlow(context)
|
|
137
|
+
Flow->>Workspace: discoverProjects()
|
|
138
|
+
Workspace-->>Flow: projects[]
|
|
139
|
+
|
|
140
|
+
Flow->>Git: getCommitsSince(lastTag)
|
|
141
|
+
Git-->>Flow: commits[]
|
|
142
|
+
|
|
143
|
+
Flow->>Commits: parseConventionalCommits(commits)
|
|
144
|
+
Commits-->>Flow: parsedCommits[]
|
|
145
|
+
|
|
146
|
+
Flow->>Semver: determineVersionBump(parsedCommits)
|
|
147
|
+
Semver-->>Flow: ReleaseType
|
|
148
|
+
|
|
149
|
+
Flow->>Semver: incrementVersion(current, releaseType)
|
|
150
|
+
Semver-->>Flow: newVersion
|
|
151
|
+
|
|
152
|
+
Flow->>Registry: checkVersionAvailable(newVersion)
|
|
153
|
+
Registry-->>Flow: boolean
|
|
154
|
+
|
|
155
|
+
Flow->>Changelog: generateEntry(parsedCommits, newVersion)
|
|
156
|
+
Changelog-->>Flow: ChangelogEntry
|
|
157
|
+
|
|
158
|
+
Flow->>Workspace: updatePackageJson(newVersion)
|
|
159
|
+
Flow->>Workspace: updateChangelog(entry)
|
|
160
|
+
|
|
161
|
+
Flow->>Git: commitAndTag(newVersion)
|
|
162
|
+
|
|
163
|
+
Flow-->>User: FlowResult
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Changelog Parsing Pipeline
|
|
167
|
+
|
|
168
|
+
```mermaid
|
|
169
|
+
flowchart LR
|
|
170
|
+
MD["CHANGELOG.md"] --> tokenize["tokenize()"]
|
|
171
|
+
tokenize --> tokens["Token[ ]"]
|
|
172
|
+
tokens --> parseTokens["parseTokens()"]
|
|
173
|
+
parseTokens --> ast["Changelog AST"]
|
|
174
|
+
ast --> buildChangelog["buildChangelog()"]
|
|
175
|
+
buildChangelog --> format["Format Detection"]
|
|
176
|
+
format --> changelog["Changelog Object"]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Conventional Commit Parsing
|
|
180
|
+
|
|
181
|
+
```mermaid
|
|
182
|
+
flowchart TD
|
|
183
|
+
input["feat(scope)!: description\n\nBody text\n\nBREAKING CHANGE: details"]
|
|
184
|
+
|
|
185
|
+
subgraph "Header Parsing"
|
|
186
|
+
type[Type: feat]
|
|
187
|
+
scope[Scope: scope]
|
|
188
|
+
breaking1[Breaking: !]
|
|
189
|
+
subject[Subject: description]
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
subgraph "Body Parsing"
|
|
193
|
+
body[Body: Body text]
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
subgraph "Footer Parsing"
|
|
197
|
+
footer[Footer: BREAKING CHANGE]
|
|
198
|
+
breaking2[Breaking Details: details]
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
input --> type
|
|
202
|
+
input --> scope
|
|
203
|
+
input --> breaking1
|
|
204
|
+
input --> subject
|
|
205
|
+
input --> body
|
|
206
|
+
input --> footer
|
|
207
|
+
footer --> breaking2
|
|
208
|
+
|
|
209
|
+
type --> result[ConventionalCommit]
|
|
210
|
+
scope --> result
|
|
211
|
+
breaking1 --> result
|
|
212
|
+
subject --> result
|
|
213
|
+
body --> result
|
|
214
|
+
breaking2 --> result
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Core Types
|
|
220
|
+
|
|
221
|
+
### Central Type Relationships
|
|
222
|
+
|
|
223
|
+
```mermaid
|
|
224
|
+
classDiagram
|
|
225
|
+
class Changelog {
|
|
226
|
+
+title: string
|
|
227
|
+
+description: string
|
|
228
|
+
+entries: ChangelogEntry[]
|
|
229
|
+
+metadata: ChangelogMetadata
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
class ChangelogEntry {
|
|
233
|
+
+version: string
|
|
234
|
+
+date: string
|
|
235
|
+
+sections: ChangelogSection[]
|
|
236
|
+
+yanked: boolean
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
class ChangelogSection {
|
|
240
|
+
+heading: SectionHeading
|
|
241
|
+
+items: ChangelogItem[]
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
class ChangelogItem {
|
|
245
|
+
+content: string
|
|
246
|
+
+scope: string
|
|
247
|
+
+references: Reference[]
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
class ConventionalCommit {
|
|
251
|
+
+type: CommitType
|
|
252
|
+
+scope: string
|
|
253
|
+
+subject: string
|
|
254
|
+
+body: string
|
|
255
|
+
+breaking: boolean
|
|
256
|
+
+footers: CommitFooter[]
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
class ParsedVersion {
|
|
260
|
+
+major: number
|
|
261
|
+
+minor: number
|
|
262
|
+
+patch: number
|
|
263
|
+
+prerelease: string[]
|
|
264
|
+
+build: string[]
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
class FlowContext {
|
|
268
|
+
+workspaceRoot: string
|
|
269
|
+
+projectName: string
|
|
270
|
+
+tree: Tree
|
|
271
|
+
+logger: Logger
|
|
272
|
+
+gitClient: GitClient
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
Changelog "1" *-- "*" ChangelogEntry
|
|
276
|
+
ChangelogEntry "1" *-- "*" ChangelogSection
|
|
277
|
+
ChangelogSection "1" *-- "*" ChangelogItem
|
|
278
|
+
ConventionalCommit ..> ChangelogItem : generates
|
|
279
|
+
ParsedVersion ..> ChangelogEntry : version field
|
|
280
|
+
FlowContext ..> Changelog : orchestrates
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Type Categories
|
|
284
|
+
|
|
285
|
+
| Category | Types | Location |
|
|
286
|
+
| --------- | ------------------------------------------------------------------ | ------------ |
|
|
287
|
+
| Changelog | `Changelog`, `ChangelogEntry`, `ChangelogSection`, `ChangelogItem` | `changelog/` |
|
|
288
|
+
| Commits | `ConventionalCommit`, `CommitType`, `CommitFooter` | `commits/` |
|
|
289
|
+
| Semver | `ParsedVersion`, `ReleaseType`, `PreReleaseType` | `semver/` |
|
|
290
|
+
| Git | `GitClient`, `GitCommit`, `GitTag`, `GitLogEntry` | `git/` |
|
|
291
|
+
| Registry | `RegistryClient`, `PackageInfo`, `VersionInfo` | `registry/` |
|
|
292
|
+
| Workspace | `Project`, `Workspace`, `PackageJson` | `workspace/` |
|
|
293
|
+
| Flow | `FlowContext`, `FlowStep`, `FlowResult`, `FlowError` | `flow/` |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Security Architecture
|
|
298
|
+
|
|
299
|
+
### Input Validation
|
|
300
|
+
|
|
301
|
+
All entry points validate input before processing:
|
|
302
|
+
|
|
303
|
+
```mermaid
|
|
304
|
+
flowchart LR
|
|
305
|
+
input[User Input] --> length{Length Check}
|
|
306
|
+
length -->|>limit| reject[Reject]
|
|
307
|
+
length -->|≤limit| encoding{Encoding Check}
|
|
308
|
+
encoding -->|invalid| reject
|
|
309
|
+
encoding -->|valid| process[Process]
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Input Limits
|
|
313
|
+
|
|
314
|
+
| Input Type | Maximum Length | Rationale |
|
|
315
|
+
| -------------- | -------------- | --------------------------------- |
|
|
316
|
+
| Commit message | 10,000 chars | No legitimate commit exceeds this |
|
|
317
|
+
| Changelog file | 1 MB | Prevents memory exhaustion |
|
|
318
|
+
| Version string | 256 chars | Per semver spec limits |
|
|
319
|
+
| Package name | 214 chars | Per npm spec |
|
|
320
|
+
|
|
321
|
+
State-machine parsing ensures O(n) complexity for all inputs, providing predictable performance regardless of content patterns.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Module Details
|
|
326
|
+
|
|
327
|
+
### changelog/
|
|
328
|
+
|
|
329
|
+
**Purpose:** Parse, manipulate, and serialize CHANGELOG.md files.
|
|
330
|
+
|
|
331
|
+
**Key Components:**
|
|
332
|
+
|
|
333
|
+
- `tokenize/` - Character-by-character markdown tokenizer
|
|
334
|
+
- `parse/` - Token-to-AST parser
|
|
335
|
+
- `format/` - Format detection (Keep a Changelog, Conventional, etc.)
|
|
336
|
+
- `render/` - AST-to-markdown serializer
|
|
337
|
+
|
|
338
|
+
**Architecture:**
|
|
339
|
+
|
|
340
|
+
```mermaid
|
|
341
|
+
flowchart TB
|
|
342
|
+
subgraph Public API
|
|
343
|
+
parseChangelog
|
|
344
|
+
renderChangelog
|
|
345
|
+
createChangelog
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
subgraph Internal
|
|
349
|
+
tokenize
|
|
350
|
+
parseTokens
|
|
351
|
+
detectFormat
|
|
352
|
+
buildAST
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
parseChangelog --> tokenize
|
|
356
|
+
tokenize --> parseTokens
|
|
357
|
+
parseTokens --> detectFormat
|
|
358
|
+
detectFormat --> buildAST
|
|
359
|
+
renderChangelog --> serialize
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
📖 [Full changelog/ documentation](./src/changelog/README.md)
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
### commits/
|
|
367
|
+
|
|
368
|
+
**Purpose:** Parse conventional commit messages into structured data.
|
|
369
|
+
|
|
370
|
+
**Key Components:**
|
|
371
|
+
|
|
372
|
+
- `parse/` - Commit message parser
|
|
373
|
+
- `types/` - Type definitions and constants
|
|
374
|
+
- `validate/` - Commit validation utilities
|
|
375
|
+
|
|
376
|
+
**Architecture:**
|
|
377
|
+
|
|
378
|
+
```mermaid
|
|
379
|
+
flowchart LR
|
|
380
|
+
message[Commit Message] --> header[Parse Header]
|
|
381
|
+
header --> type[Extract Type]
|
|
382
|
+
header --> scope[Extract Scope]
|
|
383
|
+
header --> subject[Extract Subject]
|
|
384
|
+
message --> body[Parse Body]
|
|
385
|
+
message --> footer[Parse Footers]
|
|
386
|
+
footer --> breaking[Detect Breaking Changes]
|
|
387
|
+
|
|
388
|
+
type --> commit[ConventionalCommit]
|
|
389
|
+
scope --> commit
|
|
390
|
+
subject --> commit
|
|
391
|
+
body --> commit
|
|
392
|
+
breaking --> commit
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
📖 [Full commits/ documentation](./src/commits/README.md)
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### semver/
|
|
400
|
+
|
|
401
|
+
**Purpose:** Parse, compare, and manipulate semantic versions.
|
|
402
|
+
|
|
403
|
+
**Key Components:**
|
|
404
|
+
|
|
405
|
+
- `parse/` - Version string parser
|
|
406
|
+
- `compare/` - Version comparison functions
|
|
407
|
+
- `increment/` - Version bumping logic
|
|
408
|
+
- `range/` - Version range utilities
|
|
409
|
+
|
|
410
|
+
**Architecture:**
|
|
411
|
+
|
|
412
|
+
```mermaid
|
|
413
|
+
flowchart TB
|
|
414
|
+
subgraph "Parse"
|
|
415
|
+
parseVersion[parseVersion]
|
|
416
|
+
parseRange[parseRange]
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
subgraph "Compare"
|
|
420
|
+
compareVersions[compareVersions]
|
|
421
|
+
satisfiesRange[satisfiesRange]
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
subgraph "Transform"
|
|
425
|
+
incrementVersion[incrementVersion]
|
|
426
|
+
formatVersion[formatVersion]
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
parseVersion --> compareVersions
|
|
430
|
+
parseRange --> satisfiesRange
|
|
431
|
+
parseVersion --> incrementVersion
|
|
432
|
+
incrementVersion --> formatVersion
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
📖 [Full semver/ documentation](./src/semver/README.md)
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### registry/
|
|
440
|
+
|
|
441
|
+
**Purpose:** Query npm registry for package and version information.
|
|
442
|
+
|
|
443
|
+
**Key Components:**
|
|
444
|
+
|
|
445
|
+
- `client/` - Registry client factory
|
|
446
|
+
- `fetch/` - HTTP fetch utilities
|
|
447
|
+
- `parse/` - Registry response parsers
|
|
448
|
+
|
|
449
|
+
**Architecture:**
|
|
450
|
+
|
|
451
|
+
```mermaid
|
|
452
|
+
flowchart LR
|
|
453
|
+
createRegistryClient --> client[RegistryClient]
|
|
454
|
+
client --> getPackageInfo
|
|
455
|
+
client --> getVersionInfo
|
|
456
|
+
client --> checkVersionExists
|
|
457
|
+
|
|
458
|
+
getPackageInfo --> fetch[HTTP Fetch]
|
|
459
|
+
fetch --> parse[Parse Response]
|
|
460
|
+
parse --> result[PackageInfo]
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
📖 [Full registry/ documentation](./src/registry/README.md)
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
### git/
|
|
468
|
+
|
|
469
|
+
**Purpose:** Git operations abstraction layer.
|
|
470
|
+
|
|
471
|
+
**Key Components:**
|
|
472
|
+
|
|
473
|
+
- `client/` - Git client factory
|
|
474
|
+
- `log/` - Commit history parsing
|
|
475
|
+
- `tag/` - Tag operations
|
|
476
|
+
- `branch/` - Branch operations
|
|
477
|
+
- `diff/` - Diff parsing
|
|
478
|
+
|
|
479
|
+
**Architecture:**
|
|
480
|
+
|
|
481
|
+
```mermaid
|
|
482
|
+
flowchart TB
|
|
483
|
+
createGitClient --> client[GitClient]
|
|
484
|
+
|
|
485
|
+
subgraph "Read Operations"
|
|
486
|
+
client --> getLog
|
|
487
|
+
client --> getTags
|
|
488
|
+
client --> getBranches
|
|
489
|
+
client --> getDiff
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
subgraph "Write Operations"
|
|
493
|
+
client --> commit
|
|
494
|
+
client --> tag
|
|
495
|
+
client --> push
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
subgraph "Query Operations"
|
|
499
|
+
client --> getCommitsSince
|
|
500
|
+
client --> getLatestTag
|
|
501
|
+
client --> isClean
|
|
502
|
+
end
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
📖 [Full git/ documentation](./src/git/README.md)
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
### workspace/
|
|
510
|
+
|
|
511
|
+
**Purpose:** Workspace and project discovery, package.json manipulation.
|
|
512
|
+
|
|
513
|
+
**Key Components:**
|
|
514
|
+
|
|
515
|
+
- `discover/` - Project discovery
|
|
516
|
+
- `package-json/` - Package.json read/write
|
|
517
|
+
- `project/` - Project configuration
|
|
518
|
+
- `nx/` - Nx workspace integration
|
|
519
|
+
|
|
520
|
+
**Architecture:**
|
|
521
|
+
|
|
522
|
+
```mermaid
|
|
523
|
+
flowchart TB
|
|
524
|
+
subgraph "Discovery"
|
|
525
|
+
discoverProjects
|
|
526
|
+
findPackageJson
|
|
527
|
+
detectWorkspaceRoot
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
subgraph "Package Operations"
|
|
531
|
+
readPackageJson
|
|
532
|
+
writePackageJson
|
|
533
|
+
updateVersion
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
subgraph "Project Operations"
|
|
537
|
+
getProjectConfig
|
|
538
|
+
getProjectDependencies
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
discoverProjects --> readPackageJson
|
|
542
|
+
readPackageJson --> getProjectConfig
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
📖 [Full workspace/ documentation](./src/workspace/README.md)
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
### flow/
|
|
550
|
+
|
|
551
|
+
**Purpose:** Orchestrate version release workflows.
|
|
552
|
+
|
|
553
|
+
**Key Components:**
|
|
554
|
+
|
|
555
|
+
- `context/` - Flow context factory
|
|
556
|
+
- `steps/` - Individual flow steps
|
|
557
|
+
- `execute/` - Flow execution engine
|
|
558
|
+
- `validate/` - Pre-flight validation
|
|
559
|
+
|
|
560
|
+
**Architecture:**
|
|
561
|
+
|
|
562
|
+
```mermaid
|
|
563
|
+
flowchart TB
|
|
564
|
+
subgraph "Setup"
|
|
565
|
+
createFlowContext --> context[FlowContext]
|
|
566
|
+
validateContext --> validation[Validation Result]
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
subgraph "Execution"
|
|
570
|
+
executeVersionFlow --> step1[Analyze Commits]
|
|
571
|
+
step1 --> step2[Determine Version]
|
|
572
|
+
step2 --> step3[Validate Registry]
|
|
573
|
+
step3 --> step4[Update Files]
|
|
574
|
+
step4 --> step5[Git Operations]
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
subgraph "Result"
|
|
578
|
+
step5 --> result[FlowResult]
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
context --> executeVersionFlow
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
📖 [Full flow/ documentation](./src/flow/README.md)
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
## Further Reading
|
|
589
|
+
|
|
590
|
+
- [Main README](./README.md) - Installation and quick start
|
|
591
|
+
- [Module Documentation](./src/) - Per-module README files
|
|
592
|
+
- [Contributing Guide](../../CONTRIBUTING.md) - Development setup
|
|
593
|
+
- [Security Policy](../../SECURITY.md) - Vulnerability reporting
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.1.0 - 2026-03-16
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- **lib-versioning:** support commit amend no edit
|
|
10
|
+
- **lib-versioning:** support force bump with release as config
|
|
11
|
+
- **tool-package:** improve memory management and visibility on builder executor
|
|
12
|
+
- **eslint-rules:** lib-ts-config-paths
|
|
13
|
+
- **e2e-lib-versioning:** test cjs and esm builds
|
|
14
|
+
- **eslint-rules:** lib-e2e-project-required
|
|
15
|
+
- **lib-versioning:** implement project versioning
|
|
16
|
+
- **eslint-rules:** ensure publishable libraries accounted for in docs
|
|
17
|
+
- **eslint-rules:** add rule to ensure pipeline is ready for publishable libraries
|
|
18
|
+
- **eslint-rules:** root readme.md rule to ensure packages are listed
|
|
19
|
+
- **eslint-rules:** rules to align readme.md content format
|
|
20
|
+
- **docs-site:** add project-scope
|
|
21
|
+
- **tool-package:** build executor now takes unpkg and jsdelivr configuration
|
|
22
|
+
- **lib-json-utils:** regex pattern safety
|
|
23
|
+
- **eslint-rules:** no-unsafe-regex
|
|
24
|
+
- **eslint-rules:** no-deprecated-tag
|
|
25
|
+
- **lib-project-scope:** complete implementation
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- **lib-versioning:** remove unused %h format causing git log field misalignment
|
|
30
|
+
- **lib-immutable-api-utils:** rename safe object to prevent variable shadowing on cjs module init
|
|
31
|
+
- **@hyperfrontend/workspace:** prevent changelog corruption in pr ci
|
|
32
|
+
|
|
33
|
+
### Other
|
|
34
|
+
|
|
35
|
+
- **eslint-rules:** disable angle bracket typecasting on eslint-rules project
|