@savvy-web/silk-effects 5.1.3 → 5.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 +22 -22
- package/changesets/api/transformer.js +2 -1
- package/changesets/changelog/getReleaseLine.js +7 -4
- package/changesets/changelog/index.js +8 -6
- package/changesets/index.js +6 -11
- package/changesets/services/branch-analyzer.js +20 -19
- package/changesets/services/changelog.js +1 -1
- package/changesets/services/config-inspector.js +17 -17
- package/changesets/services/deps-regen.js +36 -34
- package/changesets/services/github.js +39 -40
- package/changesets/services/release-planner.js +7 -6
- package/changesets/utils/dependency-table.js +2 -1
- package/changesets/utils/jsonpath.js +5 -7
- package/changesets/utils/publishability.js +2 -2
- package/commitlint/detection/dco.js +2 -1
- package/commitlint/index.js +2 -1
- package/index.d.ts +224 -213
- package/index.js +7 -7
- package/lint/handlers/PnpmWorkspace.js +2 -1
- package/lint/handlers/Yaml.js +8 -4
- package/package.json +3 -3
- package/repos/index.js +3 -5
- package/repos/services/config-store.js +68 -67
- package/repos/services/manager.js +259 -258
- package/services/BiomeSchemaSync.js +65 -64
- package/services/ChangesetConfig.js +50 -50
- package/services/ChangesetConfigReader.js +59 -58
- package/services/ConfigDiscovery.js +42 -41
- package/services/SilkPublishability.js +54 -53
- package/services/SilkWorkspaceAnalyzer.js +110 -109
- package/turbo/index.js +2 -3
- package/turbo/services/TurboInspector.js +80 -79
|
@@ -6,21 +6,20 @@ import { Context, Effect, Layer } from "effect";
|
|
|
6
6
|
/**
|
|
7
7
|
* GitHub service for fetching commit metadata.
|
|
8
8
|
*
|
|
9
|
-
* Defines the {@link GitHubService} Effect service tag,
|
|
10
|
-
*
|
|
9
|
+
* Defines the {@link GitHubService} Effect service tag, its
|
|
10
|
+
* `GitHubService.layer` production layer backed by `\@changesets/get-github-info`,
|
|
11
11
|
* and the {@link makeGitHubTest} helper for constructing deterministic test
|
|
12
12
|
* layers.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* The GitHub service is consumed by the changelog formatters to resolve
|
|
16
16
|
* commit hashes into pull-request numbers, author usernames, and link URLs.
|
|
17
|
-
* In production,
|
|
17
|
+
* In production, `GitHubService.layer` calls the GitHub REST API via the
|
|
18
18
|
* vendored `getGitHubInfo` wrapper. In tests, {@link makeGitHubTest}
|
|
19
19
|
* returns canned responses from a `Map` keyed by commit hash.
|
|
20
20
|
*
|
|
21
21
|
* @see {@link GitHubService} for the Effect service tag
|
|
22
22
|
* @see {@link GitHubServiceShape} for the service interface
|
|
23
|
-
* @see {@link GitHubLive} for the production layer
|
|
24
23
|
* @see {@link makeGitHubTest} for constructing test layers
|
|
25
24
|
*/
|
|
26
25
|
/**
|
|
@@ -34,13 +33,13 @@ import { Context, Effect, Layer } from "effect";
|
|
|
34
33
|
* This tag follows the standard Effect `Context.Service` pattern. Two layers
|
|
35
34
|
* are provided out of the box:
|
|
36
35
|
*
|
|
37
|
-
* -
|
|
36
|
+
* - `GitHubService.layer` — production layer backed by the GitHub REST API
|
|
38
37
|
* - {@link makeGitHubTest} — factory for deterministic test layers
|
|
39
38
|
*
|
|
40
39
|
* @example
|
|
41
40
|
* ```typescript
|
|
42
|
-
* import { Effect
|
|
43
|
-
* import { GitHubService
|
|
41
|
+
* import { Effect } from "effect";
|
|
42
|
+
* import { GitHubService } from "\@savvy-web/changesets";
|
|
44
43
|
*
|
|
45
44
|
* const program = Effect.gen(function* () {
|
|
46
45
|
* const github = yield* GitHubService;
|
|
@@ -52,7 +51,7 @@ import { Context, Effect, Layer } from "effect";
|
|
|
52
51
|
* });
|
|
53
52
|
*
|
|
54
53
|
* // Provide the live layer and run
|
|
55
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
54
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubService.layer)));
|
|
56
55
|
* ```
|
|
57
56
|
*
|
|
58
57
|
* @example Creating a test layer with canned responses
|
|
@@ -76,41 +75,41 @@ import { Context, Effect, Layer } from "effect";
|
|
|
76
75
|
* ```
|
|
77
76
|
*
|
|
78
77
|
* @see {@link GitHubServiceShape} for the service interface
|
|
79
|
-
* @see {@link GitHubLive} for the production layer
|
|
80
78
|
* @see {@link makeGitHubTest} for creating test layers
|
|
81
79
|
*
|
|
82
80
|
* @public
|
|
83
81
|
*/
|
|
84
|
-
var GitHubService = class extends Context.Service()("GitHubService") {
|
|
85
|
-
/**
|
|
86
|
-
* Production layer for {@link GitHubService}.
|
|
87
|
-
*
|
|
88
|
-
* Delegates to `\@changesets/get-github-info` to fetch commit metadata
|
|
89
|
-
* from the GitHub REST API. Requires a `GITHUB_TOKEN` environment variable
|
|
90
|
-
* to be set for authenticated requests.
|
|
91
|
-
*
|
|
92
|
-
* @remarks
|
|
93
|
-
* This layer is used by the `\@savvy-web/changesets/changelog` entry point
|
|
94
|
-
* to resolve commit hashes into PR numbers and author attribution. It is
|
|
95
|
-
* used by the changelog formatter's
|
|
96
|
-
* `MainLayer`.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```typescript
|
|
100
|
-
* import { Effect } from "effect";
|
|
101
|
-
* import { GitHubService
|
|
102
|
-
*
|
|
103
|
-
* const program = Effect.gen(function* () {
|
|
104
|
-
* const github = yield* GitHubService;
|
|
105
|
-
* return yield* github.getInfo({ commit: "abc1234", repo: "owner/repo" });
|
|
106
|
-
* });
|
|
107
|
-
*
|
|
108
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
109
|
-
* ```
|
|
110
|
-
*
|
|
111
|
-
* @public
|
|
112
|
-
*/
|
|
113
|
-
|
|
82
|
+
var GitHubService = class extends Context.Service()("GitHubService") {
|
|
83
|
+
/**
|
|
84
|
+
* Production layer for {@link GitHubService}.
|
|
85
|
+
*
|
|
86
|
+
* Delegates to `\@changesets/get-github-info` to fetch commit metadata
|
|
87
|
+
* from the GitHub REST API. Requires a `GITHUB_TOKEN` environment variable
|
|
88
|
+
* to be set for authenticated requests.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* This layer is used by the `\@savvy-web/changesets/changelog` entry point
|
|
92
|
+
* to resolve commit hashes into PR numbers and author attribution. It is
|
|
93
|
+
* used by the changelog formatter's
|
|
94
|
+
* `MainLayer`.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* import { Effect } from "effect";
|
|
99
|
+
* import { GitHubService } from "\@savvy-web/changesets";
|
|
100
|
+
*
|
|
101
|
+
* const program = Effect.gen(function* () {
|
|
102
|
+
* const github = yield* GitHubService;
|
|
103
|
+
* return yield* github.getInfo({ commit: "abc1234", repo: "owner/repo" });
|
|
104
|
+
* });
|
|
105
|
+
*
|
|
106
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubService.layer)));
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
static layer = Layer.succeed(this, { getInfo: getGitHubInfo });
|
|
112
|
+
};
|
|
114
113
|
/**
|
|
115
114
|
* Create a test layer for {@link GitHubService} with pre-configured responses.
|
|
116
115
|
*
|
|
@@ -162,4 +161,4 @@ function makeGitHubTest(responses) {
|
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
//#endregion
|
|
165
|
-
export {
|
|
164
|
+
export { GitHubService, makeGitHubTest };
|
|
@@ -39,7 +39,12 @@ async function loadConfig(root, packages) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
/** Effect service tag for the release planner. @public */
|
|
42
|
-
var ReleasePlanner = class extends Context.Service()("ReleasePlanner") {
|
|
42
|
+
var ReleasePlanner = class extends Context.Service()("ReleasePlanner") {
|
|
43
|
+
/** Production layer. Requires {@link ConfigInspector} (used by `apply`) and `FileSystem`. @public */
|
|
44
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
45
|
+
return makeShape(yield* ConfigInspector, yield* FileSystem.FileSystem);
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
43
48
|
/** Build the service shape over a resolved {@link ConfigInspector} and {@link FileSystem.FileSystem}. */
|
|
44
49
|
function makeShape(inspector, fs) {
|
|
45
50
|
const plan = (root) => Effect.tryPromise({
|
|
@@ -57,10 +62,6 @@ function makeShape(inspector, fs) {
|
|
|
57
62
|
apply
|
|
58
63
|
};
|
|
59
64
|
}
|
|
60
|
-
/** Production layer. Requires {@link ConfigInspector} (used by `apply`) and `FileSystem`. @public */
|
|
61
|
-
const ReleasePlannerLive = Layer.effect(ReleasePlanner, Effect.gen(function* () {
|
|
62
|
-
return makeShape(yield* ConfigInspector, yield* FileSystem.FileSystem);
|
|
63
|
-
}));
|
|
64
65
|
/**
|
|
65
66
|
* Test factory — supply fixed results for any subset of methods. Unsupplied
|
|
66
67
|
* methods fail with a `ReleasePlanError`.
|
|
@@ -355,4 +356,4 @@ function applyEffect(root, dryRun, changelogModules, inspector, fs) {
|
|
|
355
356
|
}
|
|
356
357
|
|
|
357
358
|
//#endregion
|
|
358
|
-
export { ReleasePlanner,
|
|
359
|
+
export { ReleasePlanner, extractVersionBlock, makeReleasePlannerTest, withChangelogModules };
|
|
@@ -189,9 +189,10 @@ function serializeDependencyTable(rows) {
|
|
|
189
189
|
* @internal
|
|
190
190
|
*/
|
|
191
191
|
function serializeDependencyTableToMarkdown(rows) {
|
|
192
|
+
const table = serializeDependencyTable(rows);
|
|
192
193
|
return stringifyMarkdown({
|
|
193
194
|
type: "root",
|
|
194
|
-
children: [
|
|
195
|
+
children: [table]
|
|
195
196
|
}).trim();
|
|
196
197
|
}
|
|
197
198
|
/**
|
|
@@ -102,14 +102,12 @@ function walkJsonPath(obj, path) {
|
|
|
102
102
|
path: [...nodePath, segment.index]
|
|
103
103
|
});
|
|
104
104
|
break;
|
|
105
|
-
case "wildcard":
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
path: [...nodePath, index]
|
|
110
|
-
});
|
|
105
|
+
case "wildcard": if (Array.isArray(node)) node.forEach((element, index) => {
|
|
106
|
+
next.push({
|
|
107
|
+
node: element,
|
|
108
|
+
path: [...nodePath, index]
|
|
111
109
|
});
|
|
112
|
-
|
|
110
|
+
});
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
current = next;
|
|
@@ -7,10 +7,10 @@ import { PublishabilityDetector } from "@effected/workspaces";
|
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
9
|
* Uses the currently-active {@link SilkPublishability} — wire the
|
|
10
|
-
*
|
|
10
|
+
* `SilkPublishability.layer` layer to get silk semantics.
|
|
11
11
|
*
|
|
12
12
|
* The kit's `PublishabilityDetector.detect` contract no longer receives the
|
|
13
|
-
* workspace root — the ignore/mode-aware `
|
|
13
|
+
* workspace root — the ignore/mode-aware `SilkPublishability.layerAdaptive`
|
|
14
14
|
* derives the `.changeset/config.json` root per package from the package's
|
|
15
15
|
* own discovery coordinates (`pkg.path` ascended by `pkg.relativePath`).
|
|
16
16
|
* The `root` parameter is retained for signature stability
|
|
@@ -46,7 +46,8 @@ function findProjectRoot(cwd) {
|
|
|
46
46
|
* @public
|
|
47
47
|
*/
|
|
48
48
|
function detectDCO(cwd = process.cwd()) {
|
|
49
|
-
|
|
49
|
+
const searchDir = findProjectRoot(cwd) ?? cwd;
|
|
50
|
+
return existsSync(join(searchDir, DCO_FILENAME));
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
//#endregion
|
package/commitlint/index.js
CHANGED
|
@@ -133,7 +133,8 @@ var commitlint_exports = /* @__PURE__ */ __exportAll({
|
|
|
133
133
|
*/
|
|
134
134
|
var CommitlintConfig = class {
|
|
135
135
|
static silk(options = {}) {
|
|
136
|
-
|
|
136
|
+
const validated = decodeConfigOptions(options);
|
|
137
|
+
return createConfig(validated);
|
|
137
138
|
}
|
|
138
139
|
/* v8 ignore next 3 -- private constructor prevents direct instantiation */
|
|
139
140
|
constructor() {}
|