@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
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* \@savvy-web/changesets
|
|
3
|
+
*
|
|
4
|
+
* Custom changelog formatter and markdown processing pipeline for the Silk Suite.
|
|
5
|
+
* Provides structured changeset sections, remark-based validation and transformation,
|
|
6
|
+
* and an Effect CLI.
|
|
7
|
+
*
|
|
8
|
+
* This module exposes two API surfaces:
|
|
9
|
+
* - **Effect primitives**: Services, layers, schemas, and tagged errors for Effect-native consumers
|
|
10
|
+
* - **Class-based API**: Static class wrappers for higher-level consumers
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { Context } from 'effect';
|
|
16
|
+
import { Effect } from 'effect';
|
|
17
|
+
import { Equals } from 'effect/Types';
|
|
18
|
+
import { Layer } from 'effect';
|
|
19
|
+
import { ModCompWithPackage } from '@changesets/types';
|
|
20
|
+
import { NewChangesetWithCommit } from '@changesets/types';
|
|
21
|
+
import type { Root } from 'mdast';
|
|
22
|
+
import { Schema } from 'effect';
|
|
23
|
+
import { VersionType as VersionType_2 } from '@changesets/types';
|
|
24
|
+
import { YieldableError } from 'effect/Cause';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Static class wrapper for category operations.
|
|
28
|
+
*
|
|
29
|
+
* Provides methods for resolving conventional commit types to changelog
|
|
30
|
+
* section categories and validating section headings.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import { Categories } from "\@savvy-web/changesets";
|
|
35
|
+
* import type { SectionCategory } from "\@savvy-web/changesets";
|
|
36
|
+
*
|
|
37
|
+
* const cat: SectionCategory = Categories.fromCommitType("feat");
|
|
38
|
+
* console.log(cat.heading); // "Features"
|
|
39
|
+
* console.log(cat.priority); // 2
|
|
40
|
+
*
|
|
41
|
+
* const isValid: boolean = Categories.isValidHeading("Bug Fixes");
|
|
42
|
+
* console.log(isValid); // true
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link SectionCategory} for the category shape
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare class Categories {
|
|
50
|
+
private constructor();
|
|
51
|
+
/** Breaking changes - backward-incompatible changes (priority 1) */
|
|
52
|
+
static readonly BREAKING_CHANGES: SectionCategory;
|
|
53
|
+
/** Features - new functionality (priority 2) */
|
|
54
|
+
static readonly FEATURES: SectionCategory;
|
|
55
|
+
/** Bug Fixes - bug corrections (priority 3) */
|
|
56
|
+
static readonly BUG_FIXES: SectionCategory;
|
|
57
|
+
/** Performance - performance improvements (priority 4) */
|
|
58
|
+
static readonly PERFORMANCE: SectionCategory;
|
|
59
|
+
/** Documentation - documentation changes (priority 5) */
|
|
60
|
+
static readonly DOCUMENTATION: SectionCategory;
|
|
61
|
+
/** Refactoring - code restructuring (priority 6) */
|
|
62
|
+
static readonly REFACTORING: SectionCategory;
|
|
63
|
+
/** Tests - test additions or modifications (priority 7) */
|
|
64
|
+
static readonly TESTS: SectionCategory;
|
|
65
|
+
/** Build System - build configuration changes (priority 8) */
|
|
66
|
+
static readonly BUILD_SYSTEM: SectionCategory;
|
|
67
|
+
/** CI - continuous integration changes (priority 9) */
|
|
68
|
+
static readonly CI: SectionCategory;
|
|
69
|
+
/** Dependencies - dependency updates (priority 10) */
|
|
70
|
+
static readonly DEPENDENCIES: SectionCategory;
|
|
71
|
+
/** Maintenance - general maintenance (priority 11) */
|
|
72
|
+
static readonly MAINTENANCE: SectionCategory;
|
|
73
|
+
/** Reverts - reverted changes (priority 12) */
|
|
74
|
+
static readonly REVERTS: SectionCategory;
|
|
75
|
+
/** Other - uncategorized changes (priority 13) */
|
|
76
|
+
static readonly OTHER: SectionCategory;
|
|
77
|
+
/** All categories ordered by priority (ascending). */
|
|
78
|
+
static readonly ALL: readonly SectionCategory[];
|
|
79
|
+
/**
|
|
80
|
+
* Resolve a conventional commit type to its category.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* The breaking flag takes highest precedence, always returning the
|
|
84
|
+
* "Breaking Changes" category. The special scope `chore(deps)` maps
|
|
85
|
+
* to "Dependencies" rather than "Maintenance". Unknown types fall
|
|
86
|
+
* back to "Other".
|
|
87
|
+
*
|
|
88
|
+
* @param type - The commit type (e.g., "feat", "fix", "chore")
|
|
89
|
+
* @param scope - Optional scope (e.g., "deps" in `chore(deps):`)
|
|
90
|
+
* @param breaking - Whether the commit has a `!` suffix
|
|
91
|
+
* @returns The resolved section category
|
|
92
|
+
*/
|
|
93
|
+
static fromCommitType(type: string, scope?: string, breaking?: boolean): SectionCategory;
|
|
94
|
+
/**
|
|
95
|
+
* Look up a category by its section heading text.
|
|
96
|
+
* Comparison is case-insensitive.
|
|
97
|
+
*
|
|
98
|
+
* @param heading - The heading text (e.g., "Features", "Bug Fixes")
|
|
99
|
+
* @returns The matching category, or `undefined` if not recognized
|
|
100
|
+
*/
|
|
101
|
+
static fromHeading(heading: string): SectionCategory | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Get all valid section heading strings.
|
|
104
|
+
*
|
|
105
|
+
* @returns Array of heading strings in priority order
|
|
106
|
+
*/
|
|
107
|
+
static allHeadings(): readonly string[];
|
|
108
|
+
/**
|
|
109
|
+
* Check whether a heading string matches a known category.
|
|
110
|
+
* Comparison is case-insensitive.
|
|
111
|
+
*
|
|
112
|
+
* @param heading - The heading text to check
|
|
113
|
+
* @returns `true` if the heading matches a known category
|
|
114
|
+
*/
|
|
115
|
+
static isValidHeading(heading: string): boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Static class wrapper for changelog operations.
|
|
120
|
+
*
|
|
121
|
+
* Delegates to the Changesets-compatible `getReleaseLine` and
|
|
122
|
+
* `getDependencyReleaseLine` functions with Effect-based internals.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { Changelog } from "\@savvy-web/changesets";
|
|
127
|
+
*
|
|
128
|
+
* const changeset = {
|
|
129
|
+
* id: "brave-pandas-learn",
|
|
130
|
+
* summary: "feat: add authentication system",
|
|
131
|
+
* releases: [{ name: "\@savvy-web/auth", type: "minor" as const }],
|
|
132
|
+
* commit: "abc1234567890",
|
|
133
|
+
* };
|
|
134
|
+
*
|
|
135
|
+
* const line = await Changelog.formatReleaseLine(changeset, "minor", {
|
|
136
|
+
* repo: "savvy-web/auth",
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @see {@link Categories} for resolving commit types to section categories
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
export declare class Changelog {
|
|
145
|
+
private constructor();
|
|
146
|
+
/**
|
|
147
|
+
* Format a single changeset into a changelog release line.
|
|
148
|
+
*
|
|
149
|
+
* @param changeset - The changeset to format
|
|
150
|
+
* @param versionType - The semantic version bump type
|
|
151
|
+
* @param options - Configuration with `repo` in `owner/repo` format
|
|
152
|
+
* @returns Formatted markdown string
|
|
153
|
+
*/
|
|
154
|
+
static formatReleaseLine(changeset: NewChangesetWithCommit, versionType: VersionType_2, options: Record<string, unknown> | null): Promise<string>;
|
|
155
|
+
/**
|
|
156
|
+
* Format dependency update release lines.
|
|
157
|
+
*
|
|
158
|
+
* @param changesets - Changesets that caused dependency updates
|
|
159
|
+
* @param dependenciesUpdated - Dependencies that were updated
|
|
160
|
+
* @param options - Configuration with `repo` in `owner/repo` format
|
|
161
|
+
* @returns Formatted markdown string
|
|
162
|
+
*/
|
|
163
|
+
static formatDependencyReleaseLine(changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], options: Record<string, unknown> | null): Promise<string>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Service for changelog formatting.
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* This service tag defines the interface. Use the Changesets API entry point
|
|
171
|
+
* (`\@savvy-web/changesets/changelog`) or the {@link Changelog} class for
|
|
172
|
+
* the concrete implementation.
|
|
173
|
+
*
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
export declare class ChangelogService extends ChangelogServiceBase {
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Base class for ChangelogService.
|
|
181
|
+
*
|
|
182
|
+
* @privateRemarks
|
|
183
|
+
* This export is required for api-extractor documentation generation.
|
|
184
|
+
* Effect's Context.Tag creates an anonymous base class that must be
|
|
185
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
186
|
+
*
|
|
187
|
+
* @internal
|
|
188
|
+
*/
|
|
189
|
+
export declare const ChangelogServiceBase: Context.TagClass<ChangelogService, "ChangelogService", ChangelogServiceShape>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Service interface for changelog formatting.
|
|
193
|
+
*
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
export declare interface ChangelogServiceShape {
|
|
197
|
+
/** Format a single changeset release line. */
|
|
198
|
+
readonly formatReleaseLine: (changeset: NewChangesetWithCommit, versionType: VersionType_2, options: ChangesetOptions) => Effect.Effect<string, never, GitHubService | MarkdownService>;
|
|
199
|
+
/** Format dependency update release lines. */
|
|
200
|
+
readonly formatDependencyReleaseLine: (changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[], options: ChangesetOptions) => Effect.Effect<string, never, GitHubService>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Class-based API wrapper for changelog transformation.
|
|
205
|
+
*
|
|
206
|
+
* Provides a static class interface that runs all remark transform
|
|
207
|
+
* plugins against CHANGELOG markdown content.
|
|
208
|
+
*/
|
|
209
|
+
/**
|
|
210
|
+
* Static class for transforming CHANGELOG.md files.
|
|
211
|
+
*
|
|
212
|
+
* Runs all six remark transform plugins in the correct order:
|
|
213
|
+
* merge-sections, reorder-sections, deduplicate-items,
|
|
214
|
+
* contributor-footnotes, issue-link-refs, normalize-format.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* import { ChangelogTransformer } from "\@savvy-web/changesets";
|
|
219
|
+
*
|
|
220
|
+
* // Transform a string
|
|
221
|
+
* const cleaned = ChangelogTransformer.transformContent(rawMarkdown);
|
|
222
|
+
*
|
|
223
|
+
* // Transform a file in-place
|
|
224
|
+
* ChangelogTransformer.transformFile("CHANGELOG.md");
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
export declare class ChangelogTransformer {
|
|
230
|
+
private constructor();
|
|
231
|
+
/**
|
|
232
|
+
* Transform CHANGELOG markdown content by running all transform plugins.
|
|
233
|
+
*
|
|
234
|
+
* @param content - Raw CHANGELOG markdown string
|
|
235
|
+
* @returns The transformed markdown string
|
|
236
|
+
*/
|
|
237
|
+
static transformContent(content: string): string;
|
|
238
|
+
/**
|
|
239
|
+
* Transform a CHANGELOG file in-place.
|
|
240
|
+
*
|
|
241
|
+
* Reads the file, runs all transform plugins, and writes the result back.
|
|
242
|
+
*
|
|
243
|
+
* @param filePath - Path to the CHANGELOG.md file
|
|
244
|
+
*/
|
|
245
|
+
static transformFile(filePath: string): void;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Inferred type for {@link ChangesetSchema}.
|
|
250
|
+
*
|
|
251
|
+
* @public
|
|
252
|
+
*/
|
|
253
|
+
export declare interface Changeset extends Schema.Schema.Type<typeof ChangesetSchema> {
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Static class for linting changeset files.
|
|
258
|
+
*
|
|
259
|
+
* Runs the three remark-lint rules (heading-hierarchy, required-sections,
|
|
260
|
+
* content-structure) against changeset markdown and returns structured
|
|
261
|
+
* diagnostic messages.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* import { ChangesetLinter } from "\@savvy-web/changesets";
|
|
266
|
+
* import type { LintMessage } from "\@savvy-web/changesets";
|
|
267
|
+
*
|
|
268
|
+
* const messages: LintMessage[] = ChangesetLinter.validateFile("path/to/changeset.md");
|
|
269
|
+
* for (const msg of messages) {
|
|
270
|
+
* console.log(`${msg.file}:${msg.line}:${msg.column} ${msg.rule} ${msg.message}`);
|
|
271
|
+
* }
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @public
|
|
275
|
+
*/
|
|
276
|
+
export declare class ChangesetLinter {
|
|
277
|
+
private constructor();
|
|
278
|
+
/**
|
|
279
|
+
* Validate a single changeset file.
|
|
280
|
+
*
|
|
281
|
+
* Reads the file, strips YAML frontmatter, and runs all lint rules.
|
|
282
|
+
*
|
|
283
|
+
* @param filePath - Path to the changeset `.md` file
|
|
284
|
+
* @returns Array of lint messages (empty if valid)
|
|
285
|
+
*/
|
|
286
|
+
static validateFile(filePath: string): LintMessage[];
|
|
287
|
+
/**
|
|
288
|
+
* Validate a markdown string directly.
|
|
289
|
+
*
|
|
290
|
+
* Strips YAML frontmatter and runs all lint rules.
|
|
291
|
+
*
|
|
292
|
+
* @param content - Raw markdown content (may include frontmatter)
|
|
293
|
+
* @param filePath - File path for error reporting (defaults to `"<input>"`)
|
|
294
|
+
* @returns Array of lint messages (empty if valid)
|
|
295
|
+
*/
|
|
296
|
+
static validateContent(content: string, filePath?: string): LintMessage[];
|
|
297
|
+
/**
|
|
298
|
+
* Validate all changeset `.md` files in a directory.
|
|
299
|
+
*
|
|
300
|
+
* Scans for `*.md` files (excluding `README.md`) and runs
|
|
301
|
+
* {@link ChangesetLinter.validateFile} on each.
|
|
302
|
+
*
|
|
303
|
+
* @param dir - Directory path to scan
|
|
304
|
+
* @returns Aggregated lint messages from all files
|
|
305
|
+
*/
|
|
306
|
+
static validate(dir: string): LintMessage[];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Inferred type for {@link ChangesetOptionsSchema}.
|
|
311
|
+
*
|
|
312
|
+
* @public
|
|
313
|
+
*/
|
|
314
|
+
export declare interface ChangesetOptions extends Schema.Schema.Type<typeof ChangesetOptionsSchema> {
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Schema for changeset configuration options.
|
|
319
|
+
*
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
export declare const ChangesetOptionsSchema: Schema.Struct<{
|
|
323
|
+
/** GitHub repository in `owner/repo` format. */
|
|
324
|
+
repo: Schema.filter<typeof Schema.String>;
|
|
325
|
+
/** Whether to include commit hash links in output. */
|
|
326
|
+
commitLinks: Schema.optional<typeof Schema.Boolean>;
|
|
327
|
+
/** Whether to include pull request links in output. */
|
|
328
|
+
prLinks: Schema.optional<typeof Schema.Boolean>;
|
|
329
|
+
/** Whether to include issue reference links in output. */
|
|
330
|
+
issueLinks: Schema.optional<typeof Schema.Boolean>;
|
|
331
|
+
/** Custom issue reference prefixes (e.g., `["#", "GH-"]`). */
|
|
332
|
+
issuePrefixes: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
333
|
+
}>;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Schema for a changeset object.
|
|
337
|
+
*
|
|
338
|
+
* @public
|
|
339
|
+
*/
|
|
340
|
+
export declare const ChangesetSchema: Schema.Struct<{
|
|
341
|
+
/** The changeset summary text. */
|
|
342
|
+
summary: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
343
|
+
/** Unique changeset identifier. */
|
|
344
|
+
id: typeof Schema.String;
|
|
345
|
+
/** Git commit hash associated with this changeset. */
|
|
346
|
+
commit: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
347
|
+
}>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Schema for a changeset summary (1-1000 characters).
|
|
351
|
+
*
|
|
352
|
+
* @public
|
|
353
|
+
*/
|
|
354
|
+
export declare const ChangesetSummarySchema: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Changeset file validation failure.
|
|
358
|
+
*
|
|
359
|
+
* Carries structured issue details with JSON-path and message per issue.
|
|
360
|
+
*
|
|
361
|
+
* @public
|
|
362
|
+
*/
|
|
363
|
+
export declare class ChangesetValidationError extends ChangesetValidationErrorBase<{
|
|
364
|
+
/** File path of the changeset that failed validation. */
|
|
365
|
+
readonly file?: string | undefined;
|
|
366
|
+
/** Individual validation issues found. */
|
|
367
|
+
readonly issues: ReadonlyArray<{
|
|
368
|
+
/** JSON-path to the problematic field. */
|
|
369
|
+
readonly path: string;
|
|
370
|
+
/** Human-readable description of the issue. */
|
|
371
|
+
readonly message: string;
|
|
372
|
+
}>;
|
|
373
|
+
}> {
|
|
374
|
+
get message(): string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Base class for ChangesetValidationError.
|
|
379
|
+
*
|
|
380
|
+
* @privateRemarks
|
|
381
|
+
* This export is required for api-extractor documentation generation.
|
|
382
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
383
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
384
|
+
*
|
|
385
|
+
* @internal
|
|
386
|
+
*/
|
|
387
|
+
export declare const ChangesetValidationErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
388
|
+
readonly _tag: "ChangesetValidationError";
|
|
389
|
+
} & Readonly<A>;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Schema for a git commit hash (at least 7 lowercase hex characters).
|
|
393
|
+
*
|
|
394
|
+
* @public
|
|
395
|
+
*/
|
|
396
|
+
export declare const CommitHashSchema: Schema.filter<typeof Schema.String>;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Invalid or missing configuration.
|
|
400
|
+
*
|
|
401
|
+
* @see {@link ChangesetOptionsSchema} for the expected configuration shape
|
|
402
|
+
*
|
|
403
|
+
* @public
|
|
404
|
+
*/
|
|
405
|
+
export declare class ConfigurationError extends ConfigurationErrorBase<{
|
|
406
|
+
/** Configuration field that is invalid or missing. */
|
|
407
|
+
readonly field: string;
|
|
408
|
+
/** Human-readable failure reason. */
|
|
409
|
+
readonly reason: string;
|
|
410
|
+
}> {
|
|
411
|
+
get message(): string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Base class for ConfigurationError.
|
|
416
|
+
*
|
|
417
|
+
* @privateRemarks
|
|
418
|
+
* This export is required for api-extractor documentation generation.
|
|
419
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
420
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
421
|
+
*
|
|
422
|
+
* @internal
|
|
423
|
+
*/
|
|
424
|
+
export declare const ConfigurationErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
425
|
+
readonly _tag: "ConfigurationError";
|
|
426
|
+
} & Readonly<A>;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Inferred type for {@link DependencyTypeSchema}.
|
|
430
|
+
*
|
|
431
|
+
* @public
|
|
432
|
+
*/
|
|
433
|
+
export declare type DependencyType = typeof DependencyTypeSchema.Type;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Schema for npm dependency types.
|
|
437
|
+
*
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
export declare const DependencyTypeSchema: Schema.Literal<["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]>;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Inferred type for {@link DependencyUpdateSchema}.
|
|
444
|
+
*
|
|
445
|
+
* @public
|
|
446
|
+
*/
|
|
447
|
+
export declare interface DependencyUpdate extends Schema.Schema.Type<typeof DependencyUpdateSchema> {
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Schema for a dependency update entry.
|
|
452
|
+
*
|
|
453
|
+
* @public
|
|
454
|
+
*/
|
|
455
|
+
export declare const DependencyUpdateSchema: Schema.Struct<{
|
|
456
|
+
/** Package name (must be non-empty). */
|
|
457
|
+
name: Schema.refine<string, typeof Schema.String>;
|
|
458
|
+
/** npm dependency type. */
|
|
459
|
+
type: Schema.Literal<["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]>;
|
|
460
|
+
/** Previous version string. */
|
|
461
|
+
oldVersion: typeof Schema.String;
|
|
462
|
+
/** New version string. */
|
|
463
|
+
newVersion: typeof Schema.String;
|
|
464
|
+
}>;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* GitHub API request failure.
|
|
468
|
+
*
|
|
469
|
+
* @remarks
|
|
470
|
+
* Use {@link GitHubApiError.isRetryable} to determine whether a retry
|
|
471
|
+
* strategy should be applied. Rate-limited responses (403/429) and
|
|
472
|
+
* server errors (5xx) are considered retryable.
|
|
473
|
+
*
|
|
474
|
+
* @public
|
|
475
|
+
*/
|
|
476
|
+
export declare class GitHubApiError extends GitHubApiErrorBase<{
|
|
477
|
+
/** The API operation that failed (e.g., "getInfo"). */
|
|
478
|
+
readonly operation: string;
|
|
479
|
+
/** HTTP status code, if available. */
|
|
480
|
+
readonly statusCode?: number | undefined;
|
|
481
|
+
/** Human-readable failure reason. */
|
|
482
|
+
readonly reason: string;
|
|
483
|
+
}> {
|
|
484
|
+
get message(): string;
|
|
485
|
+
/** Whether this error is a rate-limit response (403 or 429). */
|
|
486
|
+
get isRateLimited(): boolean;
|
|
487
|
+
/** Whether this error is eligible for retry (server errors or rate limits). */
|
|
488
|
+
get isRetryable(): boolean;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Base class for GitHubApiError.
|
|
493
|
+
*
|
|
494
|
+
* @privateRemarks
|
|
495
|
+
* This export is required for api-extractor documentation generation.
|
|
496
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
497
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
498
|
+
*
|
|
499
|
+
* @internal
|
|
500
|
+
*/
|
|
501
|
+
export declare const GitHubApiErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
502
|
+
readonly _tag: "GitHubApiError";
|
|
503
|
+
} & Readonly<A>;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Structured result from the GitHub commit info API.
|
|
507
|
+
*
|
|
508
|
+
* @public
|
|
509
|
+
*/
|
|
510
|
+
export declare interface GitHubCommitInfo {
|
|
511
|
+
/** The GitHub username of the commit author (null if unknown). */
|
|
512
|
+
user: string | null;
|
|
513
|
+
/** The pull request number associated with this commit (null if none). */
|
|
514
|
+
pull: number | null;
|
|
515
|
+
/** Markdown-formatted links for the commit, PR, and user. */
|
|
516
|
+
links: {
|
|
517
|
+
/** Link to the commit on GitHub. */
|
|
518
|
+
commit: string;
|
|
519
|
+
/** Link to the associated pull request (null if none). */
|
|
520
|
+
pull: string | null;
|
|
521
|
+
/** Link to the author's GitHub profile (null if unknown). */
|
|
522
|
+
user: string | null;
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Inferred type for {@link GitHubInfoSchema}.
|
|
528
|
+
*
|
|
529
|
+
* @public
|
|
530
|
+
*/
|
|
531
|
+
export declare interface GitHubInfo extends Schema.Schema.Type<typeof GitHubInfoSchema> {
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Schema for a GitHub info response from \@changesets/get-github-info.
|
|
536
|
+
*
|
|
537
|
+
* @public
|
|
538
|
+
*/
|
|
539
|
+
export declare const GitHubInfoSchema: Schema.Struct<{
|
|
540
|
+
/** GitHub username of the commit author. */
|
|
541
|
+
user: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
542
|
+
/** Pull request number associated with the commit. */
|
|
543
|
+
pull: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
|
|
544
|
+
/** Markdown-formatted links. */
|
|
545
|
+
links: Schema.Struct<{
|
|
546
|
+
/** Link to the commit. */
|
|
547
|
+
commit: Schema.filter<typeof Schema.String>;
|
|
548
|
+
/** Link to the associated pull request. */
|
|
549
|
+
pull: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
550
|
+
/** Link to the author's GitHub profile. */
|
|
551
|
+
user: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
552
|
+
}>;
|
|
553
|
+
}>;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Live layer that delegates to \@changesets/get-github-info.
|
|
557
|
+
*
|
|
558
|
+
* @public
|
|
559
|
+
*/
|
|
560
|
+
export declare const GitHubLive: Layer.Layer<GitHubService, never, never>;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Service for GitHub API operations.
|
|
564
|
+
*
|
|
565
|
+
* @see {@link GitHubLive} for the production layer
|
|
566
|
+
* @see {@link makeGitHubTest} for creating test layers
|
|
567
|
+
*
|
|
568
|
+
* @public
|
|
569
|
+
*/
|
|
570
|
+
export declare class GitHubService extends GitHubServiceBase {
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Base class for GitHubService.
|
|
575
|
+
*
|
|
576
|
+
* @privateRemarks
|
|
577
|
+
* This export is required for api-extractor documentation generation.
|
|
578
|
+
* Effect's Context.Tag creates an anonymous base class that must be
|
|
579
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
580
|
+
*
|
|
581
|
+
* @internal
|
|
582
|
+
*/
|
|
583
|
+
export declare const GitHubServiceBase: Context.TagClass<GitHubService, "GitHubService", GitHubServiceShape>;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Service interface for GitHub API operations.
|
|
587
|
+
*
|
|
588
|
+
* @internal
|
|
589
|
+
*/
|
|
590
|
+
export declare interface GitHubServiceShape {
|
|
591
|
+
/** Fetch commit info (author, PR, links) for a given commit. */
|
|
592
|
+
readonly getInfo: (params: {
|
|
593
|
+
commit: string;
|
|
594
|
+
repo: string;
|
|
595
|
+
}) => Effect.Effect<GitHubCommitInfo, GitHubApiError>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Schema for a GitHub issue or PR number (positive integer).
|
|
600
|
+
*
|
|
601
|
+
* @public
|
|
602
|
+
*/
|
|
603
|
+
export declare const IssueNumberSchema: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Class-based API wrapper for changeset linting.
|
|
607
|
+
*
|
|
608
|
+
* Provides a static class interface that runs all remark-lint rules
|
|
609
|
+
* against changeset markdown files.
|
|
610
|
+
*/
|
|
611
|
+
/**
|
|
612
|
+
* A single lint message from validation.
|
|
613
|
+
*
|
|
614
|
+
* @public
|
|
615
|
+
*/
|
|
616
|
+
export declare interface LintMessage {
|
|
617
|
+
/** File path that was validated. */
|
|
618
|
+
file: string;
|
|
619
|
+
/** Rule name that produced the message. */
|
|
620
|
+
rule: string;
|
|
621
|
+
/** Line number (1-based). */
|
|
622
|
+
line: number;
|
|
623
|
+
/** Column number (1-based). */
|
|
624
|
+
column: number;
|
|
625
|
+
/** Human-readable message. */
|
|
626
|
+
message: string;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Create a test layer with pre-configured responses keyed by commit hash.
|
|
631
|
+
*
|
|
632
|
+
* @param responses - A map of commit hash to {@link GitHubCommitInfo}
|
|
633
|
+
* @returns A Layer providing the {@link GitHubService}
|
|
634
|
+
*
|
|
635
|
+
* @public
|
|
636
|
+
*/
|
|
637
|
+
export declare function makeGitHubTest(responses: Map<string, GitHubCommitInfo>): Layer.Layer<GitHubService>;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Live layer wrapping the remark-pipeline functions.
|
|
641
|
+
*
|
|
642
|
+
* @public
|
|
643
|
+
*/
|
|
644
|
+
export declare const MarkdownLive: Layer.Layer<MarkdownService, never, never>;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Markdown parsing failure.
|
|
648
|
+
*
|
|
649
|
+
* @public
|
|
650
|
+
*/
|
|
651
|
+
export declare class MarkdownParseError extends MarkdownParseErrorBase<{
|
|
652
|
+
/** Source file path, if known. */
|
|
653
|
+
readonly source?: string | undefined;
|
|
654
|
+
/** Human-readable failure reason. */
|
|
655
|
+
readonly reason: string;
|
|
656
|
+
/** Line number where the error occurred (1-based). */
|
|
657
|
+
readonly line?: number | undefined;
|
|
658
|
+
/** Column number where the error occurred (1-based). */
|
|
659
|
+
readonly column?: number | undefined;
|
|
660
|
+
}> {
|
|
661
|
+
get message(): string;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Base class for MarkdownParseError.
|
|
666
|
+
*
|
|
667
|
+
* @privateRemarks
|
|
668
|
+
* This export is required for api-extractor documentation generation.
|
|
669
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
670
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
671
|
+
*
|
|
672
|
+
* @internal
|
|
673
|
+
*/
|
|
674
|
+
export declare const MarkdownParseErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
675
|
+
readonly _tag: "MarkdownParseError";
|
|
676
|
+
} & Readonly<A>;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Service for markdown parsing and stringification.
|
|
680
|
+
*
|
|
681
|
+
* @see {@link MarkdownLive} for the production layer
|
|
682
|
+
*
|
|
683
|
+
* @public
|
|
684
|
+
*/
|
|
685
|
+
export declare class MarkdownService extends MarkdownServiceBase {
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Base class for MarkdownService.
|
|
690
|
+
*
|
|
691
|
+
* @privateRemarks
|
|
692
|
+
* This export is required for api-extractor documentation generation.
|
|
693
|
+
* Effect's Context.Tag creates an anonymous base class that must be
|
|
694
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
695
|
+
*
|
|
696
|
+
* @internal
|
|
697
|
+
*/
|
|
698
|
+
export declare const MarkdownServiceBase: Context.TagClass<MarkdownService, "MarkdownService", MarkdownServiceShape>;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Service interface for markdown parsing and stringification.
|
|
702
|
+
*
|
|
703
|
+
* @internal
|
|
704
|
+
*/
|
|
705
|
+
export declare interface MarkdownServiceShape {
|
|
706
|
+
/** Parse a markdown string into an mdast AST. */
|
|
707
|
+
readonly parse: (content: string) => Effect.Effect<Root>;
|
|
708
|
+
/** Stringify an mdast AST back to markdown. */
|
|
709
|
+
readonly stringify: (tree: Root) => Effect.Effect<string>;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* A non-empty string schema.
|
|
714
|
+
*
|
|
715
|
+
* @public
|
|
716
|
+
*/
|
|
717
|
+
export declare const NonEmptyString: Schema.filter<typeof Schema.String>;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* A positive integer schema.
|
|
721
|
+
*
|
|
722
|
+
* @public
|
|
723
|
+
*/
|
|
724
|
+
export declare const PositiveInteger: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Schema for a GitHub repository in `owner/repo` format.
|
|
728
|
+
*
|
|
729
|
+
* @public
|
|
730
|
+
*/
|
|
731
|
+
export declare const RepoSchema: Schema.filter<typeof Schema.String>;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* A section category defines how changes are grouped in release notes.
|
|
735
|
+
* Used across all three processing layers.
|
|
736
|
+
*
|
|
737
|
+
* Inferred from {@link SectionCategorySchema}.
|
|
738
|
+
*
|
|
739
|
+
* @public
|
|
740
|
+
*/
|
|
741
|
+
export declare interface SectionCategory extends Schema.Schema.Type<typeof SectionCategorySchema> {
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Schema for a section category that defines how changes are grouped in release notes.
|
|
746
|
+
* Used across all three processing layers.
|
|
747
|
+
*
|
|
748
|
+
* Provides runtime validation and type inference via Effect Schema.
|
|
749
|
+
*
|
|
750
|
+
* @public
|
|
751
|
+
*/
|
|
752
|
+
export declare const SectionCategorySchema: Schema.Struct<{
|
|
753
|
+
/** Display heading used in CHANGELOG output. */
|
|
754
|
+
heading: typeof Schema.String;
|
|
755
|
+
/** Priority for ordering (lower = higher priority). */
|
|
756
|
+
priority: typeof Schema.Number;
|
|
757
|
+
/** Conventional commit types that map to this category. */
|
|
758
|
+
commitTypes: Schema.Array$<typeof Schema.String>;
|
|
759
|
+
/** Brief description for documentation. */
|
|
760
|
+
description: typeof Schema.String;
|
|
761
|
+
}>;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Schema accepting either a plain URL or a markdown link `[text](url)`.
|
|
765
|
+
*
|
|
766
|
+
* Used for GitHub API responses from \@changesets/get-github-info.
|
|
767
|
+
*
|
|
768
|
+
* @public
|
|
769
|
+
*/
|
|
770
|
+
export declare const UrlOrMarkdownLinkSchema: Schema.filter<typeof Schema.String>;
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Schema for a GitHub username.
|
|
774
|
+
*
|
|
775
|
+
* Rules: alphanumeric and hyphens, cannot start/end with hyphen.
|
|
776
|
+
*
|
|
777
|
+
* @public
|
|
778
|
+
*/
|
|
779
|
+
export declare const UsernameSchema: Schema.filter<typeof Schema.String>;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Inferred type for {@link VersionTypeSchema}.
|
|
783
|
+
*
|
|
784
|
+
* @public
|
|
785
|
+
*/
|
|
786
|
+
export declare type VersionType = typeof VersionTypeSchema.Type;
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Semantic version bump type.
|
|
790
|
+
*
|
|
791
|
+
* @public
|
|
792
|
+
*/
|
|
793
|
+
export declare const VersionTypeSchema: Schema.Literal<["major", "minor", "patch", "none"]>;
|
|
794
|
+
|
|
795
|
+
export { }
|