@savvy-web/silk-effects 5.1.1 → 5.1.3
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.
|
@@ -78,6 +78,22 @@ function inferDependencyType(dep) {
|
|
|
78
78
|
return "dependency";
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
+
* Narrow a dependency update to one with both version endpoints present.
|
|
82
|
+
*
|
|
83
|
+
* `@changesets/types` only guarantees `oldVersion`/`newVersion` on the
|
|
84
|
+
* `major`/`minor`/`patch` arms of `ComprehensiveRelease`; a `type: "none"`
|
|
85
|
+
* entry may carry neither. The table's `From`/`To` columns are validated
|
|
86
|
+
* version strings, so an entry missing either endpoint has no row to render.
|
|
87
|
+
*
|
|
88
|
+
* @param dep - The dependency update to test
|
|
89
|
+
* @returns `true` when both `oldVersion` and `newVersion` are present
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
function isVersioned(dep) {
|
|
94
|
+
return dep.oldVersion !== void 0 && dep.newVersion !== void 0;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
81
97
|
* Format dependency release lines as a structured markdown table.
|
|
82
98
|
*
|
|
83
99
|
* This is the core Effect program that implements the `getDependencyReleaseLine`
|
|
@@ -88,8 +104,9 @@ function inferDependencyType(dep) {
|
|
|
88
104
|
* The function maps each `ModCompWithPackage` entry to a `DependencyTableRow`,
|
|
89
105
|
* inferring the dependency type from the consuming package's `package.json`,
|
|
90
106
|
* then delegates to `serializeDependencyTableToMarkdown` for GFM table
|
|
91
|
-
* rendering, prefixed with a `### Dependencies` heading.
|
|
92
|
-
*
|
|
107
|
+
* rendering, prefixed with a `### Dependencies` heading. Entries missing
|
|
108
|
+
* either version endpoint are dropped by {@link isVersioned}; the function
|
|
109
|
+
* returns an empty string when no rows survive.
|
|
93
110
|
*
|
|
94
111
|
* The `_changesets` and `_options` parameters are part of the Changesets API
|
|
95
112
|
* contract but are not used in the table format. They are retained for
|
|
@@ -98,19 +115,21 @@ function inferDependencyType(dep) {
|
|
|
98
115
|
* @param _changesets - Changesets that caused the dependency updates (unused in table format)
|
|
99
116
|
* @param dependenciesUpdated - The list of dependencies that were updated, including old/new versions
|
|
100
117
|
* @param _options - Validated configuration options (unused in table format)
|
|
101
|
-
* @returns An `Effect` that resolves to a `### Dependencies` heading followed by a formatted markdown table string, or empty string if no dependencies were updated
|
|
118
|
+
* @returns An `Effect` that resolves to a `### Dependencies` heading followed by a formatted markdown table string, or empty string if no dependencies with both version endpoints were updated
|
|
102
119
|
*/
|
|
103
120
|
function getDependencyReleaseLine(_changesets, dependenciesUpdated, _options) {
|
|
104
121
|
return Effect.gen(function* () {
|
|
105
122
|
if (dependenciesUpdated.length === 0) return "";
|
|
106
123
|
yield* GitHubService;
|
|
107
|
-
|
|
124
|
+
const rows = dependenciesUpdated.filter(isVersioned).map((dep) => ({
|
|
108
125
|
dependency: dep.name,
|
|
109
126
|
type: inferDependencyType(dep),
|
|
110
127
|
action: "updated",
|
|
111
128
|
from: dep.oldVersion,
|
|
112
129
|
to: dep.newVersion
|
|
113
|
-
}))
|
|
130
|
+
}));
|
|
131
|
+
if (rows.length === 0) return "";
|
|
132
|
+
return `### Dependencies\n\n${serializeDependencyTableToMarkdown(rows)}`;
|
|
114
133
|
});
|
|
115
134
|
}
|
|
116
135
|
|
|
@@ -44,6 +44,10 @@ const MaintenanceReasonSchema = Schema.Struct({
|
|
|
44
44
|
* will not match here; the release then degrades gracefully to the
|
|
45
45
|
* `"unspecified"` fallback sentence instead of naming its triggers.
|
|
46
46
|
*
|
|
47
|
+
* Co-members releasing as `type: "none"` are never triggers — they carry no
|
|
48
|
+
* version bump (and, per `@changesets/types`, no guaranteed `newVersion`), so
|
|
49
|
+
* naming one would print an unchanged version as the cause of the release.
|
|
50
|
+
*
|
|
47
51
|
* @public
|
|
48
52
|
*/
|
|
49
53
|
function deriveMaintenanceReason(release, plan, config) {
|
|
@@ -51,7 +55,7 @@ function deriveMaintenanceReason(release, plan, config) {
|
|
|
51
55
|
const groupKinds = [["fixed", config.fixed], ["linked", config.linked]];
|
|
52
56
|
for (const [kind, groups] of groupKinds) for (const group of groups) {
|
|
53
57
|
if (!group.some((pattern) => ChangesetConfig.matches(release.name, pattern))) continue;
|
|
54
|
-
const triggers = plan.releases.filter((r) => r.name !== release.name && r.changesets.length > 0 && group.some((pattern) => ChangesetConfig.matches(r.name, pattern))).map((r) => ({
|
|
58
|
+
const triggers = plan.releases.filter((r) => r.name !== release.name && r.type !== "none" && r.changesets.length > 0 && group.some((pattern) => ChangesetConfig.matches(r.name, pattern))).map((r) => ({
|
|
55
59
|
name: r.name,
|
|
56
60
|
version: r.newVersion
|
|
57
61
|
}));
|
package/index.d.ts
CHANGED
|
@@ -289,7 +289,7 @@ declare class Categories {
|
|
|
289
289
|
static isValidHeading(heading: string): boolean;
|
|
290
290
|
}
|
|
291
291
|
//#endregion
|
|
292
|
-
//#region ../../node_modules/.pnpm/@changesets+types@7.0.0-next.
|
|
292
|
+
//#region ../../node_modules/.pnpm/@changesets+types@7.0.0-next.8/node_modules/@changesets/types/dist/index.d.mts
|
|
293
293
|
//#region src/index.d.ts
|
|
294
294
|
type MaybePromise<T> = T | Promise<T>;
|
|
295
295
|
type VersionType$1 = "major" | "minor" | "patch" | "none";
|
|
@@ -298,13 +298,34 @@ type Release = {
|
|
|
298
298
|
name: string;
|
|
299
299
|
type: VersionType$1;
|
|
300
300
|
};
|
|
301
|
-
|
|
301
|
+
interface ComprehensiveReleaseBase {
|
|
302
302
|
name: string;
|
|
303
|
-
type:
|
|
303
|
+
type: "major" | "minor" | "patch" | "none";
|
|
304
|
+
changesets: string[];
|
|
305
|
+
oldVersion: string | undefined;
|
|
306
|
+
newVersion: string | undefined;
|
|
307
|
+
}
|
|
308
|
+
interface ComprehensiveMajorRelease extends ComprehensiveReleaseBase {
|
|
309
|
+
type: "major";
|
|
304
310
|
oldVersion: string;
|
|
305
311
|
newVersion: string;
|
|
306
|
-
|
|
307
|
-
|
|
312
|
+
}
|
|
313
|
+
interface ComprehensiveMinorRelease extends ComprehensiveReleaseBase {
|
|
314
|
+
type: "minor";
|
|
315
|
+
oldVersion: string;
|
|
316
|
+
newVersion: string;
|
|
317
|
+
}
|
|
318
|
+
interface ComprehensivePatchRelease extends ComprehensiveReleaseBase {
|
|
319
|
+
type: "patch";
|
|
320
|
+
oldVersion: string;
|
|
321
|
+
newVersion: string;
|
|
322
|
+
}
|
|
323
|
+
interface ComprehensiveNoneRelease extends ComprehensiveReleaseBase {
|
|
324
|
+
type: "none";
|
|
325
|
+
oldVersion: string | undefined;
|
|
326
|
+
newVersion: string | undefined;
|
|
327
|
+
}
|
|
328
|
+
type ComprehensiveRelease = ComprehensiveMajorRelease | ComprehensiveMinorRelease | ComprehensivePatchRelease | ComprehensiveNoneRelease;
|
|
308
329
|
type Changeset$1 = {
|
|
309
330
|
summary: string;
|
|
310
331
|
releases: Array<Release>;
|
|
@@ -2163,6 +2184,10 @@ type MaintenanceReason = typeof MaintenanceReasonSchema.Type;
|
|
|
2163
2184
|
* will not match here; the release then degrades gracefully to the
|
|
2164
2185
|
* `"unspecified"` fallback sentence instead of naming its triggers.
|
|
2165
2186
|
*
|
|
2187
|
+
* Co-members releasing as `type: "none"` are never triggers — they carry no
|
|
2188
|
+
* version bump (and, per `@changesets/types`, no guaranteed `newVersion`), so
|
|
2189
|
+
* naming one would print an unchanged version as the cause of the release.
|
|
2190
|
+
*
|
|
2166
2191
|
* @public
|
|
2167
2192
|
*/
|
|
2168
2193
|
declare function deriveMaintenanceReason(release: ComprehensiveRelease, plan: ReleasePlan, config: Config): MaintenanceReason | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/silk-effects",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared Effect library for Silk Suite conventions",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/silk-effects",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"./package.json": "./package.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@changesets/apply-release-plan": "^8.0.0-next.
|
|
32
|
+
"@changesets/apply-release-plan": "^8.0.0-next.9",
|
|
33
33
|
"@changesets/config": "^4.0.0-next.6",
|
|
34
|
-
"@changesets/get-github-info": "^1.0.0-next.
|
|
35
|
-
"@changesets/get-release-plan": "^5.0.0-next.
|
|
36
|
-
"@effected/commands": "^0.
|
|
34
|
+
"@changesets/get-github-info": "^1.0.0-next.4",
|
|
35
|
+
"@changesets/get-release-plan": "^5.0.0-next.9",
|
|
36
|
+
"@effected/commands": "^0.2.0",
|
|
37
37
|
"@effected/git": "^0.5.1",
|
|
38
38
|
"@effected/glob": "^0.2.1",
|
|
39
39
|
"@effected/jsonc": "^0.5.1",
|
|
40
|
-
"@effected/package-json": "^0.6.
|
|
40
|
+
"@effected/package-json": "^0.6.1",
|
|
41
41
|
"@effected/templates": "^0.1.0",
|
|
42
42
|
"@effected/walker": "^0.3.3",
|
|
43
|
-
"@effected/workspaces": "^0.9.
|
|
43
|
+
"@effected/workspaces": "^0.9.1",
|
|
44
44
|
"@effected/yaml": "^0.6.0",
|
|
45
45
|
"@manypkg/get-packages": "^3.1.0",
|
|
46
46
|
"mdast-util-heading-range": "^4.0.0",
|