@savvy-web/changesets 0.1.0 → 0.1.1
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 +14 -36
- package/cjs/changelog.cjs +670 -0
- package/cjs/index.cjs +1302 -0
- package/cjs/markdownlint.cjs +312 -0
- package/cjs/remark.cjs +559 -0
- package/{bin → esm/bin}/savvy-changesets.js +143 -17
- package/esm/changelog.d.ts +21 -0
- package/esm/index.d.ts +795 -0
- package/esm/markdownlint.d.ts +61 -0
- package/esm/remark.d.ts +92 -0
- package/package.json +21 -27
- /package/{changelog.d.ts → cjs/changelog.d.cts} +0 -0
- /package/{index.d.ts → cjs/index.d.cts} +0 -0
- /package/{markdownlint.d.ts → cjs/markdownlint.d.cts} +0 -0
- /package/{remark.d.ts → cjs/remark.d.cts} +0 -0
- /package/{160.js → esm/160.js} +0 -0
- /package/{234.js → esm/234.js} +0 -0
- /package/{245.js → esm/245.js} +0 -0
- /package/{273.js → esm/273.js} +0 -0
- /package/{60.js → esm/60.js} +0 -0
- /package/{689.js → esm/689.js} +0 -0
- /package/{changelog.js → esm/changelog.js} +0 -0
- /package/{index.js → esm/index.js} +0 -0
- /package/{markdownlint.js → esm/markdownlint.js} +0 -0
- /package/{remark.js → esm/remark.js} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* markdownlint custom rules for validating changeset file structure.
|
|
3
|
+
*
|
|
4
|
+
* Provides the same validation as the remark-lint rules but using
|
|
5
|
+
* markdownlint's micromark token API for integration with
|
|
6
|
+
* markdownlint-cli2 and the VS Code markdownlint extension.
|
|
7
|
+
*
|
|
8
|
+
* - `changeset-heading-hierarchy` (CSH001): Enforce h2 start, no h1, no depth skips
|
|
9
|
+
* - `changeset-required-sections` (CSH002): Validate section headings match known categories
|
|
10
|
+
* - `changeset-content-structure` (CSH003): Content quality validation
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { Rule } from 'markdownlint';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* markdownlint rule: changeset-content-structure (CSH003)
|
|
19
|
+
*
|
|
20
|
+
* Validates content quality in changeset files:
|
|
21
|
+
* - Sections must not be empty (h2 followed immediately by another h2 or EOF)
|
|
22
|
+
* - Code blocks must have a language identifier
|
|
23
|
+
* - List items should have meaningful content (not empty)
|
|
24
|
+
*/
|
|
25
|
+
export declare const ContentStructureRule: Rule;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* markdownlint rule: changeset-heading-hierarchy (CSH001)
|
|
29
|
+
*
|
|
30
|
+
* Validates heading structure in changeset files:
|
|
31
|
+
* - No h1 headings allowed
|
|
32
|
+
* - Headings must start at h2
|
|
33
|
+
* - No depth skips (e.g., h2 ... h4 is invalid)
|
|
34
|
+
*/
|
|
35
|
+
export declare const HeadingHierarchyRule: Rule;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* markdownlint rule: changeset-required-sections (CSH002)
|
|
39
|
+
*
|
|
40
|
+
* Validates that all h2 headings in changeset files match a known
|
|
41
|
+
* category heading from the category system. Reports unrecognized
|
|
42
|
+
* headings with the list of valid options.
|
|
43
|
+
*/
|
|
44
|
+
export declare const RequiredSectionsRule: Rule;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* All changeset rules as an array for markdownlint-cli2 `customRules` config.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```json
|
|
51
|
+
* {
|
|
52
|
+
* "customRules": ["@savvy-web/changesets/markdownlint"]
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
declare const SilkChangesetsRules: Rule[];
|
|
59
|
+
export default SilkChangesetsRules;
|
|
60
|
+
|
|
61
|
+
export { }
|
package/esm/remark.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated remark plugins for changeset validation and CHANGELOG transformation.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all lint rules and transform plugins from a single entry point.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Plugin } from 'unified';
|
|
10
|
+
import { Plugin as Plugin_2 } from 'unified-lint-rule';
|
|
11
|
+
import { Root } from 'mdast';
|
|
12
|
+
|
|
13
|
+
export declare const ContentStructureRule: Plugin_2<Root, unknown>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Extract inline contributor attributions and aggregate them into
|
|
17
|
+
* a summary paragraph at the end of each version block.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ContributorFootnotesPlugin: Plugin<[], Root>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Remove duplicate list items within each h3 section.
|
|
23
|
+
*
|
|
24
|
+
* Items are compared by their plain text content. If a list becomes
|
|
25
|
+
* empty after deduplication, it is removed from the tree.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DeduplicateItemsPlugin: Plugin<[], Root>;
|
|
28
|
+
|
|
29
|
+
export declare const HeadingHierarchyRule: Plugin_2<Root, unknown>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Convert inline issue links to reference-style links with definitions
|
|
33
|
+
* at the end of each version block.
|
|
34
|
+
*/
|
|
35
|
+
export declare const IssueLinkRefsPlugin: Plugin<[], Root>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Merge duplicate h3 sections within each version block.
|
|
39
|
+
*
|
|
40
|
+
* Groups sections by heading text (case-insensitive via `fromHeading`),
|
|
41
|
+
* keeps the first occurrence, and splices content from duplicates into it.
|
|
42
|
+
*/
|
|
43
|
+
export declare const MergeSectionsPlugin: Plugin<[], Root>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Remove empty sections and empty lists from the document.
|
|
47
|
+
*/
|
|
48
|
+
export declare const NormalizeFormatPlugin: Plugin<[], Root>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Reorder h3 sections within each version block by category priority.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ReorderSectionsPlugin: Plugin<[], Root>;
|
|
54
|
+
|
|
55
|
+
export declare const RequiredSectionsRule: Plugin_2<Root, unknown>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Preset combining all changeset lint rules for convenient consumption.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* import { SilkChangesetPreset } from "\@savvy-web/changesets/remark";
|
|
63
|
+
* import remarkParse from "remark-parse";
|
|
64
|
+
* import { unified } from "unified";
|
|
65
|
+
*
|
|
66
|
+
* const processor = unified().use(remarkParse);
|
|
67
|
+
* for (const rule of SilkChangesetPreset) {
|
|
68
|
+
* processor.use(rule);
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare const SilkChangesetPreset: readonly [Plugin_2<Root, unknown>, Plugin_2<Root, unknown>, Plugin_2<Root, unknown>];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Ordered array of all transform plugins in the correct execution order.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* Plugin ordering is significant:
|
|
81
|
+
* 1. `MergeSectionsPlugin` -- merge duplicate h3 headings (must run before reorder)
|
|
82
|
+
* 2. `ReorderSectionsPlugin` -- sort sections by category priority
|
|
83
|
+
* 3. `DeduplicateItemsPlugin` -- remove duplicate list items
|
|
84
|
+
* 4. `ContributorFootnotesPlugin` -- aggregate contributor attributions
|
|
85
|
+
* 5. `IssueLinkRefsPlugin` -- convert inline issue links to reference-style
|
|
86
|
+
* 6. `NormalizeFormatPlugin` -- final cleanup (remove empty sections/lists)
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export declare const SilkChangesetTransformPreset: readonly [Plugin<[], Root>, Plugin<[], Root>, Plugin<[], Root>, Plugin<[], Root>, Plugin<[], Root>, Plugin<[], Root>];
|
|
91
|
+
|
|
92
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/changesets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Custom changelog formatter and markdown processing pipeline for the Silk Suite. Provides structured changeset sections, remark-based validation and transformation, and an Effect CLI.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,31 +29,35 @@
|
|
|
29
29
|
"type": "module",
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
|
-
"types": "./index.d.ts",
|
|
33
|
-
"import": "./index.js"
|
|
32
|
+
"types": "./esm/index.d.ts",
|
|
33
|
+
"import": "./esm/index.js",
|
|
34
|
+
"require": "./cjs/index.cjs"
|
|
34
35
|
},
|
|
35
36
|
"./changelog": {
|
|
36
|
-
"types": "./changelog.d.ts",
|
|
37
|
-
"import": "./changelog.js"
|
|
37
|
+
"types": "./esm/changelog.d.ts",
|
|
38
|
+
"import": "./esm/changelog.js",
|
|
39
|
+
"require": "./cjs/changelog.cjs"
|
|
38
40
|
},
|
|
39
41
|
"./markdownlint": {
|
|
40
|
-
"types": "./markdownlint.d.ts",
|
|
41
|
-
"import": "./markdownlint.js"
|
|
42
|
+
"types": "./esm/markdownlint.d.ts",
|
|
43
|
+
"import": "./esm/markdownlint.js",
|
|
44
|
+
"require": "./cjs/markdownlint.cjs"
|
|
42
45
|
},
|
|
43
46
|
"./remark": {
|
|
44
|
-
"types": "./remark.d.ts",
|
|
45
|
-
"import": "./remark.js"
|
|
47
|
+
"types": "./esm/remark.d.ts",
|
|
48
|
+
"import": "./esm/remark.js",
|
|
49
|
+
"require": "./cjs/remark.cjs"
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
"bin": {
|
|
49
|
-
"savvy-changesets": "./bin/savvy-changesets.js"
|
|
53
|
+
"savvy-changesets": "./esm/bin/savvy-changesets.js"
|
|
50
54
|
},
|
|
51
55
|
"dependencies": {
|
|
52
56
|
"@changesets/get-github-info": "^0.7.0",
|
|
53
57
|
"@effect/cli": "^0.73.2",
|
|
54
|
-
"@effect/platform": "^0.94.
|
|
58
|
+
"@effect/platform": "^0.94.5",
|
|
55
59
|
"@effect/platform-node": "^0.104.1",
|
|
56
|
-
"effect": "^3.19.
|
|
60
|
+
"effect": "^3.19.17",
|
|
57
61
|
"mdast-util-heading-range": "^4.0.0",
|
|
58
62
|
"mdast-util-to-string": "^4.0.0",
|
|
59
63
|
"remark-gfm": "^4.0.1",
|
|
@@ -72,28 +76,18 @@
|
|
|
72
76
|
"optional": false
|
|
73
77
|
}
|
|
74
78
|
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"postinstall": "savvy-changesets init --check"
|
|
81
|
+
},
|
|
75
82
|
"files": [
|
|
76
83
|
"!changesets.api.json",
|
|
77
84
|
"!tsconfig.json",
|
|
78
85
|
"!tsdoc.json",
|
|
79
|
-
"160.js",
|
|
80
|
-
"234.js",
|
|
81
|
-
"245.js",
|
|
82
|
-
"273.js",
|
|
83
|
-
"60.js",
|
|
84
|
-
"689.js",
|
|
85
86
|
"LICENSE",
|
|
86
87
|
"README.md",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"changelog.js",
|
|
90
|
-
"index.d.ts",
|
|
91
|
-
"index.js",
|
|
92
|
-
"markdownlint.d.ts",
|
|
93
|
-
"markdownlint.js",
|
|
88
|
+
"cjs",
|
|
89
|
+
"esm",
|
|
94
90
|
"package.json",
|
|
95
|
-
"remark.d.ts",
|
|
96
|
-
"remark.js",
|
|
97
91
|
"tsdoc-metadata.json"
|
|
98
92
|
]
|
|
99
93
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{160.js → esm/160.js}
RENAMED
|
File without changes
|
/package/{234.js → esm/234.js}
RENAMED
|
File without changes
|
/package/{245.js → esm/245.js}
RENAMED
|
File without changes
|
/package/{273.js → esm/273.js}
RENAMED
|
File without changes
|
/package/{60.js → esm/60.js}
RENAMED
|
File without changes
|
/package/{689.js → esm/689.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|