@savvy-web/silk 1.1.2 → 1.3.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/_virtual/_rolldown/runtime.js +1 -1
- package/changesets-changelog.cjs +25753 -929
- package/changesets-changelog.d.cts +175 -12
- package/changesets-changelog.d.ts +175 -12
- package/changesets-markdownlint.cjs +25753 -929
- package/changesets-markdownlint.d.cts +175 -12
- package/changesets-markdownlint.d.ts +175 -12
- package/package.json +8 -8
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.cjs +0 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.js +0 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/constants.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/constants.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/errors.cjs +26 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/errors.js +25 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/index.cjs +16 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/index.js +17 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.cjs +2 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.js +2 -2
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.cjs +1 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.js +1 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.cjs +62 -0
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.js +56 -0
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.cjs +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.js +0 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.cjs +2 -3
- package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.js +2 -3
- package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.cjs +254 -0
- package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.js +251 -0
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.cjs +3 -4
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.js +3 -4
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/worktree-snapshot.cjs +1 -1
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/worktree-snapshot.js +1 -1
- package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.cjs +2 -1
- package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.js +2 -1
- package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.cjs +7 -3
- package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.js +7 -3
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.cjs +2 -0
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.js +2 -0
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.cjs +4 -2
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.js +4 -2
- package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.cjs +17 -13
- package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.js +17 -13
|
@@ -5,10 +5,11 @@ import { Data } from "effect";
|
|
|
5
5
|
* Raised when the `.changeset/config.json` file cannot be read or decoded.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Returned by
|
|
8
|
+
* Returned by `ChangesetConfigReader.read` when the file is missing,
|
|
9
9
|
* contains invalid JSON, or fails Effect Schema validation.
|
|
10
10
|
*
|
|
11
11
|
* @since 0.1.0
|
|
12
|
+
* @public
|
|
12
13
|
*/
|
|
13
14
|
var ChangesetConfigError = class extends Data.TaggedError("ChangesetConfigError") {
|
|
14
15
|
get message() {
|
|
@@ -34,11 +34,12 @@ const SnapshotConfig = effect.Schema.Struct({
|
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
36
|
* Represents the parsed `.changeset/config.json` file. All fields are optional
|
|
37
|
-
* to allow partial configs. Use {@link SilkChangesetConfigFile} when the Silk changelog
|
|
37
|
+
* to allow partial configs. Use {@link (SilkChangesetConfigFile:type)} when the Silk changelog
|
|
38
38
|
* adapter is detected.
|
|
39
39
|
*
|
|
40
40
|
* @since 0.1.0
|
|
41
41
|
*/
|
|
42
|
+
/** @public */
|
|
42
43
|
const ChangesetConfigFile = effect.Schema.Struct({
|
|
43
44
|
changelog: effect.Schema.optional(effect.Schema.Union(effect.Schema.String, effect.Schema.Array(effect.Schema.Unknown), effect.Schema.Literal(false))),
|
|
44
45
|
commit: effect.Schema.optional(effect.Schema.Union(effect.Schema.Boolean, effect.Schema.String, effect.Schema.Array(effect.Schema.Unknown))),
|
|
@@ -58,12 +59,13 @@ const ChangesetConfigFile = effect.Schema.Struct({
|
|
|
58
59
|
* Extended changeset config for repos using the `@savvy-web/changesets` changelog adapter.
|
|
59
60
|
*
|
|
60
61
|
* @remarks
|
|
61
|
-
* Extends {@link ChangesetConfigFile} with a `_isSilk` marker flag that is automatically
|
|
62
|
+
* Extends {@link (ChangesetConfigFile:type)} with a `_isSilk` marker flag that is automatically
|
|
62
63
|
* set to `true`. Detected by {@link ChangesetConfigReader} when the `changelog` field
|
|
63
64
|
* references `@savvy-web/changesets`.
|
|
64
65
|
*
|
|
65
66
|
* @since 0.1.0
|
|
66
67
|
*/
|
|
68
|
+
/** @public */
|
|
67
69
|
const SilkChangesetConfigFile = effect.Schema.extend(ChangesetConfigFile, effect.Schema.Struct({ _isSilk: effect.Schema.optionalWith(effect.Schema.Boolean, { default: () => true }) }));
|
|
68
70
|
/**
|
|
69
71
|
* Versioning strategy classification for a workspace.
|
|
@@ -74,16 +76,18 @@ const SilkChangesetConfigFile = effect.Schema.extend(ChangesetConfigFile, effect
|
|
|
74
76
|
* - `"independent"` — multiple publishable packages with independent version bumps.
|
|
75
77
|
*
|
|
76
78
|
* @since 0.1.0
|
|
79
|
+
* @public
|
|
77
80
|
*/
|
|
78
81
|
const VersioningStrategyType = effect.Schema.Literal("single", "fixed-group", "independent");
|
|
79
82
|
/**
|
|
80
83
|
* Output of the versioning strategy detection, combining the strategy type with group metadata.
|
|
81
84
|
*
|
|
82
85
|
* @remarks
|
|
83
|
-
* Produced by
|
|
86
|
+
* Produced by `VersioningStrategy.detect` and consumed by `TagStrategy.determine`
|
|
84
87
|
* to decide on the appropriate git-tag format.
|
|
85
88
|
*
|
|
86
89
|
* @since 0.1.0
|
|
90
|
+
* @public
|
|
87
91
|
*/
|
|
88
92
|
const VersioningStrategyResult = effect.Schema.Struct({
|
|
89
93
|
type: VersioningStrategyType,
|
|
@@ -34,11 +34,12 @@ const SnapshotConfig = Schema.Struct({
|
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
36
|
* Represents the parsed `.changeset/config.json` file. All fields are optional
|
|
37
|
-
* to allow partial configs. Use {@link SilkChangesetConfigFile} when the Silk changelog
|
|
37
|
+
* to allow partial configs. Use {@link (SilkChangesetConfigFile:type)} when the Silk changelog
|
|
38
38
|
* adapter is detected.
|
|
39
39
|
*
|
|
40
40
|
* @since 0.1.0
|
|
41
41
|
*/
|
|
42
|
+
/** @public */
|
|
42
43
|
const ChangesetConfigFile = Schema.Struct({
|
|
43
44
|
changelog: Schema.optional(Schema.Union(Schema.String, Schema.Array(Schema.Unknown), Schema.Literal(false))),
|
|
44
45
|
commit: Schema.optional(Schema.Union(Schema.Boolean, Schema.String, Schema.Array(Schema.Unknown))),
|
|
@@ -58,12 +59,13 @@ const ChangesetConfigFile = Schema.Struct({
|
|
|
58
59
|
* Extended changeset config for repos using the `@savvy-web/changesets` changelog adapter.
|
|
59
60
|
*
|
|
60
61
|
* @remarks
|
|
61
|
-
* Extends {@link ChangesetConfigFile} with a `_isSilk` marker flag that is automatically
|
|
62
|
+
* Extends {@link (ChangesetConfigFile:type)} with a `_isSilk` marker flag that is automatically
|
|
62
63
|
* set to `true`. Detected by {@link ChangesetConfigReader} when the `changelog` field
|
|
63
64
|
* references `@savvy-web/changesets`.
|
|
64
65
|
*
|
|
65
66
|
* @since 0.1.0
|
|
66
67
|
*/
|
|
68
|
+
/** @public */
|
|
67
69
|
const SilkChangesetConfigFile = Schema.extend(ChangesetConfigFile, Schema.Struct({ _isSilk: Schema.optionalWith(Schema.Boolean, { default: () => true }) }));
|
|
68
70
|
/**
|
|
69
71
|
* Versioning strategy classification for a workspace.
|
|
@@ -74,16 +76,18 @@ const SilkChangesetConfigFile = Schema.extend(ChangesetConfigFile, Schema.Struct
|
|
|
74
76
|
* - `"independent"` — multiple publishable packages with independent version bumps.
|
|
75
77
|
*
|
|
76
78
|
* @since 0.1.0
|
|
79
|
+
* @public
|
|
77
80
|
*/
|
|
78
81
|
const VersioningStrategyType = Schema.Literal("single", "fixed-group", "independent");
|
|
79
82
|
/**
|
|
80
83
|
* Output of the versioning strategy detection, combining the strategy type with group metadata.
|
|
81
84
|
*
|
|
82
85
|
* @remarks
|
|
83
|
-
* Produced by
|
|
86
|
+
* Produced by `VersioningStrategy.detect` and consumed by `TagStrategy.determine`
|
|
84
87
|
* to decide on the appropriate git-tag format.
|
|
85
88
|
*
|
|
86
89
|
* @since 0.1.0
|
|
90
|
+
* @public
|
|
87
91
|
*/
|
|
88
92
|
const VersioningStrategyResult = Schema.Struct({
|
|
89
93
|
type: VersioningStrategyType,
|
|
@@ -11,6 +11,7 @@ let effect = require("effect");
|
|
|
11
11
|
* to `mode: "none"` and empty/false defaults.
|
|
12
12
|
*
|
|
13
13
|
* @since 0.4.0
|
|
14
|
+
* @public
|
|
14
15
|
*/
|
|
15
16
|
var ChangesetConfig = class extends effect.Context.Tag("@savvy-web/silk-effects/ChangesetConfig")() {
|
|
16
17
|
/**
|
|
@@ -36,6 +37,7 @@ const isSilk = (cfg) => "_isSilk" in cfg && cfg._isSilk === true;
|
|
|
36
37
|
* `ChangesetConfigReaderLive` + a platform layer (`NodeContext.layer`).
|
|
37
38
|
*
|
|
38
39
|
* @since 0.4.0
|
|
40
|
+
* @public
|
|
39
41
|
*/
|
|
40
42
|
const ChangesetConfigLive = effect.Layer.effect(ChangesetConfig, effect.Effect.gen(function* () {
|
|
41
43
|
const reader = yield* require_ChangesetConfigReader.ChangesetConfigReader;
|
|
@@ -11,6 +11,7 @@ import { Context, Effect, Layer, Option } from "effect";
|
|
|
11
11
|
* to `mode: "none"` and empty/false defaults.
|
|
12
12
|
*
|
|
13
13
|
* @since 0.4.0
|
|
14
|
+
* @public
|
|
14
15
|
*/
|
|
15
16
|
var ChangesetConfig = class extends Context.Tag("@savvy-web/silk-effects/ChangesetConfig")() {
|
|
16
17
|
/**
|
|
@@ -36,6 +37,7 @@ const isSilk = (cfg) => "_isSilk" in cfg && cfg._isSilk === true;
|
|
|
36
37
|
* `ChangesetConfigReaderLive` + a platform layer (`NodeContext.layer`).
|
|
37
38
|
*
|
|
38
39
|
* @since 0.4.0
|
|
40
|
+
* @public
|
|
39
41
|
*/
|
|
40
42
|
const ChangesetConfigLive = Layer.effect(ChangesetConfig, Effect.gen(function* () {
|
|
41
43
|
const reader = yield* ChangesetConfigReader;
|
|
@@ -26,8 +26,8 @@ function isSilkChangelog(changelog) {
|
|
|
26
26
|
*
|
|
27
27
|
* @remarks
|
|
28
28
|
* Automatically detects whether the config uses the Silk changelog adapter
|
|
29
|
-
* (`@savvy-web/changesets`) and decodes as {@link SilkChangesetConfigFile} or the
|
|
30
|
-
* standard {@link ChangesetConfigFile} accordingly.
|
|
29
|
+
* (`@savvy-web/changesets`) and decodes as {@link (SilkChangesetConfigFile:type)} or the
|
|
30
|
+
* standard {@link (ChangesetConfigFile:type)} accordingly.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
@@ -43,6 +43,7 @@ function isSilkChangelog(changelog) {
|
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
45
45
|
* @since 0.1.0
|
|
46
|
+
* @public
|
|
46
47
|
*/
|
|
47
48
|
var ChangesetConfigReader = class extends effect.Context.Tag("@savvy-web/silk-effects/ChangesetConfigReader")() {};
|
|
48
49
|
/**
|
|
@@ -53,6 +54,7 @@ var ChangesetConfigReader = class extends effect.Context.Tag("@savvy-web/silk-ef
|
|
|
53
54
|
* `BunContext.layer` to satisfy this dependency.
|
|
54
55
|
*
|
|
55
56
|
* @since 0.1.0
|
|
57
|
+
* @public
|
|
56
58
|
*/
|
|
57
59
|
const ChangesetConfigReaderLive = effect.Layer.effect(ChangesetConfigReader, effect.Effect.gen(function* () {
|
|
58
60
|
const fs = yield* _effect_platform.FileSystem.FileSystem;
|
|
@@ -26,8 +26,8 @@ function isSilkChangelog(changelog) {
|
|
|
26
26
|
*
|
|
27
27
|
* @remarks
|
|
28
28
|
* Automatically detects whether the config uses the Silk changelog adapter
|
|
29
|
-
* (`@savvy-web/changesets`) and decodes as {@link SilkChangesetConfigFile} or the
|
|
30
|
-
* standard {@link ChangesetConfigFile} accordingly.
|
|
29
|
+
* (`@savvy-web/changesets`) and decodes as {@link (SilkChangesetConfigFile:type)} or the
|
|
30
|
+
* standard {@link (ChangesetConfigFile:type)} accordingly.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
@@ -43,6 +43,7 @@ function isSilkChangelog(changelog) {
|
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
45
45
|
* @since 0.1.0
|
|
46
|
+
* @public
|
|
46
47
|
*/
|
|
47
48
|
var ChangesetConfigReader = class extends Context.Tag("@savvy-web/silk-effects/ChangesetConfigReader")() {};
|
|
48
49
|
/**
|
|
@@ -53,6 +54,7 @@ var ChangesetConfigReader = class extends Context.Tag("@savvy-web/silk-effects/C
|
|
|
53
54
|
* `BunContext.layer` to satisfy this dependency.
|
|
54
55
|
*
|
|
55
56
|
* @since 0.1.0
|
|
57
|
+
* @public
|
|
56
58
|
*/
|
|
57
59
|
const ChangesetConfigReaderLive = Layer.effect(ChangesetConfigReader, Effect.gen(function* () {
|
|
58
60
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_ChangesetConfig = require('./ChangesetConfig.cjs');
|
|
2
|
-
const require_index = require('../../../../../../node_modules/.pnpm/workspaces-effect@1.2.0_@effect_platform@0.96.
|
|
2
|
+
const require_index = require('../../../../../../node_modules/.pnpm/workspaces-effect@1.2.0_@effect_platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/index.cjs');
|
|
3
3
|
let effect = require("effect");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
let _effect_platform = require("@effect/platform");
|
|
@@ -20,7 +20,7 @@ const DEFAULT_REGISTRIES = {
|
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
22
|
* The npm public registry and GitHub Packages both accept provenance attestations through the
|
|
23
|
-
* Sigstore/OIDC trusted-publishing flow, so a
|
|
23
|
+
* Sigstore/OIDC trusted-publishing flow, so a `PublishTarget` bound to either is marked
|
|
24
24
|
* `provenance: true` by default — this is what gates the release action's attestation step. JSR
|
|
25
25
|
* and custom registries do not participate and resolve to `false`. Matching is endpoint-based
|
|
26
26
|
* (not target-key based) so a custom key pointed at one of these registries still opts in.
|
|
@@ -36,7 +36,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
36
36
|
return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
|
-
* Silk publishability rules over `workspaces-effect`'s
|
|
39
|
+
* Silk publishability rules over `workspaces-effect`'s `PublishTarget`.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
42
|
* In silk mode `private: true` is the norm on workspace `package.json`; publishability is
|
|
@@ -44,6 +44,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
44
44
|
* default. All helpers are static so a consumer sees the full rule surface in one place.
|
|
45
45
|
*
|
|
46
46
|
* @since 0.4.0
|
|
47
|
+
* @public
|
|
47
48
|
*/
|
|
48
49
|
var SilkPublishability = class {
|
|
49
50
|
/**
|
|
@@ -52,7 +53,7 @@ var SilkPublishability = class {
|
|
|
52
53
|
*
|
|
53
54
|
* - A non-empty `publishConfig.targets` map (the bundler's Record-map form) makes the
|
|
54
55
|
* package publishable regardless of `private`. With a `binding` (post-prod-build), one
|
|
55
|
-
*
|
|
56
|
+
* `PublishTarget` is emitted per resolved registry target, its `directory` set to
|
|
56
57
|
* the bound group's `dist/prod/<group>/pkg` dir. Without a binding (pre-build), one
|
|
57
58
|
* placeholder target is emitted per declared key so publishability and target counts
|
|
58
59
|
* are correct; the directory is best-effort and unused until the build writes the
|
|
@@ -115,7 +116,7 @@ var SilkPublishability = class {
|
|
|
115
116
|
return [];
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
|
-
* Resolve a package's publish targets via {@link
|
|
119
|
+
* Resolve a package's publish targets via {@link SilkPublishability}, then drop any
|
|
119
120
|
* whose built `directory` package.json is `private: true`. Returned targets keep the
|
|
120
121
|
* detector's original (possibly package-relative) `directory`.
|
|
121
122
|
*/
|
|
@@ -131,7 +132,7 @@ var SilkPublishability = class {
|
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
133
134
|
* The publishable, non-ignored packages, resolved through the single
|
|
134
|
-
* {@link
|
|
135
|
+
* {@link SilkPublishability} (which already honors changeset ignore in adaptive mode).
|
|
135
136
|
*/
|
|
136
137
|
static listPublishable(root) {
|
|
137
138
|
return effect.Effect.gen(function* () {
|
|
@@ -167,24 +168,26 @@ const readRaw = (fs, packageJsonPath) => fs.readFileString(packageJsonPath).pipe
|
|
|
167
168
|
*
|
|
168
169
|
* @remarks
|
|
169
170
|
* Returns `null` when the file is missing/unreadable/malformed — i.e. before the prod build
|
|
170
|
-
* has run.
|
|
171
|
-
* case. Used by the silk {@link
|
|
171
|
+
* has run. `SilkPublishability.detect` falls back to declared-key placeholders in that
|
|
172
|
+
* case. Used by the silk {@link SilkPublishability} layers and the workspace analyzer.
|
|
172
173
|
*
|
|
173
174
|
* @param fs - The FileSystem service.
|
|
174
175
|
* @param pkgPath - Absolute path to the package directory.
|
|
175
176
|
* @since 1.0.0
|
|
177
|
+
* @public
|
|
176
178
|
*/
|
|
177
179
|
const readTargetsBinding = (fs, pkgPath) => fs.readFileString((0, node_path.join)(pkgPath, "dist", "prod", "targets.json")).pipe(effect.Effect.flatMap((content) => effect.Effect.try({
|
|
178
180
|
try: () => JSON.parse(content),
|
|
179
181
|
catch: () => /* @__PURE__ */ new Error("invalid targets.json")
|
|
180
182
|
})), effect.Effect.orElseSucceed(() => null));
|
|
181
183
|
/**
|
|
182
|
-
* Override of `workspaces-effect`'s {@link
|
|
184
|
+
* Override of `workspaces-effect`'s {@link SilkPublishability} Tag with pure silk rules.
|
|
183
185
|
*
|
|
184
186
|
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
185
|
-
* `package.json` from `pkg.packageJsonPath` and applies
|
|
187
|
+
* `package.json` from `pkg.packageJsonPath` and applies `SilkPublishability.detect`.
|
|
186
188
|
*
|
|
187
189
|
* @since 0.4.0
|
|
190
|
+
* @public
|
|
188
191
|
*/
|
|
189
192
|
const SilkPublishabilityDetectorLive = effect.Layer.effect(require_index.PublishabilityDetector, effect.Effect.gen(function* () {
|
|
190
193
|
const fs = yield* _effect_platform.FileSystem.FileSystem;
|
|
@@ -196,13 +199,14 @@ const SilkPublishabilityDetectorLive = effect.Layer.effect(require_index.Publish
|
|
|
196
199
|
}) };
|
|
197
200
|
}));
|
|
198
201
|
/**
|
|
199
|
-
* Ignore-aware override of {@link
|
|
200
|
-
* for changeset-ignored packages, then dispatches on
|
|
201
|
-
* `none` → `[]`; `silk` →
|
|
202
|
+
* Ignore-aware override of {@link SilkPublishability}. `detect` short-circuits to `[]`
|
|
203
|
+
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
204
|
+
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
202
205
|
*
|
|
203
206
|
* @remarks Requires `FileSystem` + {@link ChangesetConfig} at build.
|
|
204
207
|
*
|
|
205
208
|
* @since 0.4.0
|
|
209
|
+
* @public
|
|
206
210
|
*/
|
|
207
211
|
const PublishabilityDetectorAdaptiveLive = effect.Layer.effect(require_index.PublishabilityDetector, effect.Effect.gen(function* () {
|
|
208
212
|
const fs = yield* _effect_platform.FileSystem.FileSystem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangesetConfig } from "./ChangesetConfig.js";
|
|
2
|
-
import { PublishTarget, PublishabilityDetector, PublishabilityDetectorLive, WorkspaceDiscovery } from "../../../../../../node_modules/.pnpm/workspaces-effect@1.2.0_@effect_platform@0.96.
|
|
2
|
+
import { PublishTarget, PublishabilityDetector, PublishabilityDetectorLive, WorkspaceDiscovery } from "../../../../../../node_modules/.pnpm/workspaces-effect@1.2.0_@effect_platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/index.js";
|
|
3
3
|
import { Effect, Layer } from "effect";
|
|
4
4
|
import { isAbsolute, join } from "node:path";
|
|
5
5
|
import { FileSystem } from "@effect/platform";
|
|
@@ -20,7 +20,7 @@ const DEFAULT_REGISTRIES = {
|
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
22
|
* The npm public registry and GitHub Packages both accept provenance attestations through the
|
|
23
|
-
* Sigstore/OIDC trusted-publishing flow, so a
|
|
23
|
+
* Sigstore/OIDC trusted-publishing flow, so a `PublishTarget` bound to either is marked
|
|
24
24
|
* `provenance: true` by default — this is what gates the release action's attestation step. JSR
|
|
25
25
|
* and custom registries do not participate and resolve to `false`. Matching is endpoint-based
|
|
26
26
|
* (not target-key based) so a custom key pointed at one of these registries still opts in.
|
|
@@ -36,7 +36,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
36
36
|
return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
|
-
* Silk publishability rules over `workspaces-effect`'s
|
|
39
|
+
* Silk publishability rules over `workspaces-effect`'s `PublishTarget`.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
42
|
* In silk mode `private: true` is the norm on workspace `package.json`; publishability is
|
|
@@ -44,6 +44,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
44
44
|
* default. All helpers are static so a consumer sees the full rule surface in one place.
|
|
45
45
|
*
|
|
46
46
|
* @since 0.4.0
|
|
47
|
+
* @public
|
|
47
48
|
*/
|
|
48
49
|
var SilkPublishability = class {
|
|
49
50
|
/**
|
|
@@ -52,7 +53,7 @@ var SilkPublishability = class {
|
|
|
52
53
|
*
|
|
53
54
|
* - A non-empty `publishConfig.targets` map (the bundler's Record-map form) makes the
|
|
54
55
|
* package publishable regardless of `private`. With a `binding` (post-prod-build), one
|
|
55
|
-
*
|
|
56
|
+
* `PublishTarget` is emitted per resolved registry target, its `directory` set to
|
|
56
57
|
* the bound group's `dist/prod/<group>/pkg` dir. Without a binding (pre-build), one
|
|
57
58
|
* placeholder target is emitted per declared key so publishability and target counts
|
|
58
59
|
* are correct; the directory is best-effort and unused until the build writes the
|
|
@@ -115,7 +116,7 @@ var SilkPublishability = class {
|
|
|
115
116
|
return [];
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
|
-
* Resolve a package's publish targets via {@link
|
|
119
|
+
* Resolve a package's publish targets via {@link SilkPublishability}, then drop any
|
|
119
120
|
* whose built `directory` package.json is `private: true`. Returned targets keep the
|
|
120
121
|
* detector's original (possibly package-relative) `directory`.
|
|
121
122
|
*/
|
|
@@ -131,7 +132,7 @@ var SilkPublishability = class {
|
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
133
134
|
* The publishable, non-ignored packages, resolved through the single
|
|
134
|
-
* {@link
|
|
135
|
+
* {@link SilkPublishability} (which already honors changeset ignore in adaptive mode).
|
|
135
136
|
*/
|
|
136
137
|
static listPublishable(root) {
|
|
137
138
|
return Effect.gen(function* () {
|
|
@@ -167,24 +168,26 @@ const readRaw = (fs, packageJsonPath) => fs.readFileString(packageJsonPath).pipe
|
|
|
167
168
|
*
|
|
168
169
|
* @remarks
|
|
169
170
|
* Returns `null` when the file is missing/unreadable/malformed — i.e. before the prod build
|
|
170
|
-
* has run.
|
|
171
|
-
* case. Used by the silk {@link
|
|
171
|
+
* has run. `SilkPublishability.detect` falls back to declared-key placeholders in that
|
|
172
|
+
* case. Used by the silk {@link SilkPublishability} layers and the workspace analyzer.
|
|
172
173
|
*
|
|
173
174
|
* @param fs - The FileSystem service.
|
|
174
175
|
* @param pkgPath - Absolute path to the package directory.
|
|
175
176
|
* @since 1.0.0
|
|
177
|
+
* @public
|
|
176
178
|
*/
|
|
177
179
|
const readTargetsBinding = (fs, pkgPath) => fs.readFileString(join(pkgPath, "dist", "prod", "targets.json")).pipe(Effect.flatMap((content) => Effect.try({
|
|
178
180
|
try: () => JSON.parse(content),
|
|
179
181
|
catch: () => /* @__PURE__ */ new Error("invalid targets.json")
|
|
180
182
|
})), Effect.orElseSucceed(() => null));
|
|
181
183
|
/**
|
|
182
|
-
* Override of `workspaces-effect`'s {@link
|
|
184
|
+
* Override of `workspaces-effect`'s {@link SilkPublishability} Tag with pure silk rules.
|
|
183
185
|
*
|
|
184
186
|
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
185
|
-
* `package.json` from `pkg.packageJsonPath` and applies
|
|
187
|
+
* `package.json` from `pkg.packageJsonPath` and applies `SilkPublishability.detect`.
|
|
186
188
|
*
|
|
187
189
|
* @since 0.4.0
|
|
190
|
+
* @public
|
|
188
191
|
*/
|
|
189
192
|
const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
190
193
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -196,13 +199,14 @@ const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effe
|
|
|
196
199
|
}) };
|
|
197
200
|
}));
|
|
198
201
|
/**
|
|
199
|
-
* Ignore-aware override of {@link
|
|
200
|
-
* for changeset-ignored packages, then dispatches on
|
|
201
|
-
* `none` → `[]`; `silk` →
|
|
202
|
+
* Ignore-aware override of {@link SilkPublishability}. `detect` short-circuits to `[]`
|
|
203
|
+
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
204
|
+
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
202
205
|
*
|
|
203
206
|
* @remarks Requires `FileSystem` + {@link ChangesetConfig} at build.
|
|
204
207
|
*
|
|
205
208
|
* @since 0.4.0
|
|
209
|
+
* @public
|
|
206
210
|
*/
|
|
207
211
|
const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
208
212
|
const fs = yield* FileSystem.FileSystem;
|