@rheged-studio/changelog-core 1.1.1 → 1.2.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/README.md +4 -4
- package/config.json +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/vendor/issue-keys.d.ts +15 -0
- package/dist/lib/vendor/issue-keys.d.ts.map +1 -1
- package/dist/lib/vendor/issue-keys.js +29 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @rheged-studio/changelog-core
|
|
2
2
|
|
|
3
3
|
Shared **changelog contract** and dual-runtime **CLI** for Rheged Studio —
|
|
4
4
|
validate, enrich, and finalise dated `changelog/` entries from CI **and** local
|
|
@@ -10,7 +10,7 @@ Zero runtime dependencies (Node built-ins only). Node 22+.
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
pnpm add -D @
|
|
13
|
+
pnpm add -D @rheged-studio/changelog-core
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Config
|
|
@@ -58,7 +58,7 @@ pnpm changelog:finalise
|
|
|
58
58
|
|
|
59
59
|
The frontmatter schema and field-ownership rules live in
|
|
60
60
|
[`changelog-contract.md`](changelog-contract.md) (also importable as
|
|
61
|
-
`@
|
|
61
|
+
`@rheged-studio/changelog-core/contract`).
|
|
62
62
|
|
|
63
63
|
`merge_strategy` is **not** part of the contract (A-802). Existing entries that
|
|
64
64
|
still carry the key validate fine — unknown keys are ignored.
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
enrichFrontmatter,
|
|
72
72
|
parseFrontmatter,
|
|
73
73
|
loadConfig,
|
|
74
|
-
} from "@
|
|
74
|
+
} from "@rheged-studio/changelog-core";
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
See `src/index.ts` for the full public surface (frontmatter, config, enrich,
|
package/config.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Bin entry for @
|
|
2
|
+
// Bin entry for @rheged-studio/changelog-core — parse the subcommand and
|
|
3
3
|
// dispatch to the matching command main. Global `--config <path>` (before or
|
|
4
4
|
// after the subcommand) is mapped to CHANGELOG_CONFIG so loadConfig() picks it
|
|
5
5
|
// up without each command re-parsing the flag.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Public API for @
|
|
2
|
+
* Public API for @rheged-studio/changelog-core.
|
|
3
3
|
*
|
|
4
4
|
* Library helpers and command pure functions — the CLI lives in `cli.ts`.
|
|
5
5
|
*/
|
|
@@ -19,5 +19,5 @@ export { derivePackagesFromPaths, type DerivePackagesOptions, } from "./lib/deri
|
|
|
19
19
|
export { enrichFrontmatter, type EnrichInput } from "./lib/enrich.js";
|
|
20
20
|
export { type FrontmatterData, type FrontmatterValue, type ParsedFrontmatter, parseFrontmatter, stringifyFrontmatter, } from "./lib/frontmatter.js";
|
|
21
21
|
export { readPackageVersion, stampVersion } from "./lib/stamp.js";
|
|
22
|
-
export { buildIssueRe, escapeRegex } from "./lib/vendor/issue-keys.js";
|
|
22
|
+
export { buildBranchIssueRe, buildIssueRe, escapeRegex, extractBranchIssueId, } from "./lib/vendor/issue-keys.js";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EACL,q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
|
2
|
-
* Public API for @
|
|
2
|
+
* Public API for @rheged-studio/changelog-core.
|
|
3
3
|
*
|
|
4
4
|
* Library helpers and command pure functions — the CLI lives in `cli.ts`.
|
|
5
5
|
*/
|
|
@@ -21,4 +21,4 @@ export { derivePackagesFromPaths, } from "./lib/derive-packages.js";
|
|
|
21
21
|
export { enrichFrontmatter } from "./lib/enrich.js";
|
|
22
22
|
export { parseFrontmatter, stringifyFrontmatter, } from "./lib/frontmatter.js";
|
|
23
23
|
export { readPackageVersion, stampVersion } from "./lib/stamp.js";
|
|
24
|
-
export { buildIssueRe, escapeRegex } from "./lib/vendor/issue-keys.js";
|
|
24
|
+
export { buildBranchIssueRe, buildIssueRe, escapeRegex, extractBranchIssueId, } from "./lib/vendor/issue-keys.js";
|
|
@@ -13,4 +13,19 @@ export declare function escapeRegex(source: string): string;
|
|
|
13
13
|
* bare `A` and missing `A-7`).
|
|
14
14
|
*/
|
|
15
15
|
export declare function buildIssueRe(keys: string[]): null | RegExp;
|
|
16
|
+
/**
|
|
17
|
+
* Build the anchored `^(?:KEY|…)-\d+\b` matcher (no global flag) for reading a
|
|
18
|
+
* branch name's **leading** issue ID. Branches are named `<id>-<slug>`, so only
|
|
19
|
+
* the leading token is the branch's issue: a slug token such as `-c-2-` or
|
|
20
|
+
* `-r-3-` must never resolve to an issue (A-2682). Same escaping, grouping and
|
|
21
|
+
* empty-key rules as `buildIssueRe`; prose (changelog bodies, commit messages,
|
|
22
|
+
* PR titles) keeps the unanchored `buildIssueRe`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildBranchIssueRe(keys: string[]): null | RegExp;
|
|
25
|
+
/**
|
|
26
|
+
* The branch's issue ID — its leading `<KEY>-<digits>` token, upper-cased — or
|
|
27
|
+
* `null` when the branch doesn't start with a configured key. At most one ID
|
|
28
|
+
* per branch.
|
|
29
|
+
*/
|
|
30
|
+
export declare function extractBranchIssueId(branch: string, keys: string[]): null | string;
|
|
16
31
|
//# sourceMappingURL=issue-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-keys.d.ts","sourceRoot":"","sources":["../../../src/lib/vendor/issue-keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"issue-keys.d.ts","sourceRoot":"","sources":["../../../src/lib/vendor/issue-keys.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,CAQ1D;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE,GACb,IAAI,GAAG,MAAM,CAIf"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Canonical issue-key helpers — the single source of truth for deriving a
|
|
2
2
|
// Linear issue-key regex from a branch name or prose.
|
|
3
3
|
//
|
|
4
|
+
// TypeScript port of agent-skills' `lib/issue-keys.mjs` (vendored per ADR-0004,
|
|
5
|
+
// A-534). Re-sync by hand when upstream changes; last synced at agent-skills
|
|
6
|
+
// `76a032d` (A-2652).
|
|
7
|
+
//
|
|
4
8
|
// Pure and zero-dependency by design: the host loads its own config and
|
|
5
9
|
// passes the configured keys in.
|
|
6
10
|
/**
|
|
@@ -27,3 +31,28 @@ export function buildIssueRe(keys) {
|
|
|
27
31
|
const group = keys.length > 1 ? `(?:${alternation})` : alternation;
|
|
28
32
|
return new RegExp(`\\b${group}-\\d+\\b`, "g");
|
|
29
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Build the anchored `^(?:KEY|…)-\d+\b` matcher (no global flag) for reading a
|
|
36
|
+
* branch name's **leading** issue ID. Branches are named `<id>-<slug>`, so only
|
|
37
|
+
* the leading token is the branch's issue: a slug token such as `-c-2-` or
|
|
38
|
+
* `-r-3-` must never resolve to an issue (A-2682). Same escaping, grouping and
|
|
39
|
+
* empty-key rules as `buildIssueRe`; prose (changelog bodies, commit messages,
|
|
40
|
+
* PR titles) keeps the unanchored `buildIssueRe`.
|
|
41
|
+
*/
|
|
42
|
+
export function buildBranchIssueRe(keys) {
|
|
43
|
+
const prose = buildIssueRe(keys);
|
|
44
|
+
if (!prose) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return new RegExp(prose.source.replace(/^\\b/, "^"));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The branch's issue ID — its leading `<KEY>-<digits>` token, upper-cased — or
|
|
51
|
+
* `null` when the branch doesn't start with a configured key. At most one ID
|
|
52
|
+
* per branch.
|
|
53
|
+
*/
|
|
54
|
+
export function extractBranchIssueId(branch, keys) {
|
|
55
|
+
const re = buildBranchIssueRe(keys);
|
|
56
|
+
const match = re?.exec(branch.toUpperCase());
|
|
57
|
+
return match ? match[0] : null;
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rheged-studio/changelog-core",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Shared changelog contract and dual-runtime CLI for
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Shared changelog contract and dual-runtime CLI for Rheged Studio — validate, enrich, and finalise dated changelog entries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"changelog",
|
|
7
7
|
"release-notes",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
]
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@acme-skunkworks/commitlint-config": "^1.0.1",
|
|
98
|
-
"@acme-skunkworks/eslint-config": "^1.1.3",
|
|
99
|
-
"@acme-skunkworks/markdownlint-config": "^3.0.0",
|
|
100
97
|
"@commitlint/cli": "^21.2.1",
|
|
98
|
+
"@rheged-studio/commitlint-config": "^1.0.1",
|
|
99
|
+
"@rheged-studio/eslint-config": "^1.1.3",
|
|
100
|
+
"@rheged-studio/markdownlint-config": "^3.0.0",
|
|
101
101
|
"@types/node": "^25.6.0",
|
|
102
102
|
"bats": "1.13.0",
|
|
103
103
|
"eslint": "^9.0.0",
|