@savvy-web/silk-effects 0.3.0 → 0.4.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 +120 -60
- package/index.d.ts +149 -276
- package/index.js +178 -153
- package/package.json +3 -3
- package/tsdoc-metadata.json +1 -1
package/index.d.ts
CHANGED
|
@@ -21,13 +21,16 @@ import { Layer } from 'effect';
|
|
|
21
21
|
import { Option } from 'effect';
|
|
22
22
|
import { PackageManagerDetector } from 'workspaces-effect';
|
|
23
23
|
import type { PlatformError } from '@effect/platform/Error';
|
|
24
|
+
import { PublishabilityDetector } from 'workspaces-effect';
|
|
24
25
|
import { PublishConfig } from 'workspaces-effect';
|
|
26
|
+
import { PublishTarget } from 'workspaces-effect';
|
|
25
27
|
import { Schema } from 'effect';
|
|
26
28
|
import type { Stream } from 'effect';
|
|
27
29
|
import { TopologicalSorter } from 'workspaces-effect';
|
|
28
30
|
import { Unify } from 'effect/Unify';
|
|
29
31
|
import { VoidIfEmpty } from 'effect/Types';
|
|
30
32
|
import { WorkspaceDiscovery } from 'workspaces-effect';
|
|
33
|
+
import type { WorkspacePackage } from 'workspaces-effect';
|
|
31
34
|
import { WorkspaceRoot } from 'workspaces-effect';
|
|
32
35
|
import { YieldableError } from 'effect/Cause';
|
|
33
36
|
|
|
@@ -45,7 +48,7 @@ export declare class AnalyzedWorkspace extends AnalyzedWorkspace_base {
|
|
|
45
48
|
get isLinked(): boolean;
|
|
46
49
|
publishesTo(registry: string): boolean;
|
|
47
50
|
hasTarget(shorthand: "npm" | "github" | "jsr"): boolean;
|
|
48
|
-
targetFor(registry: string): Option.Option<
|
|
51
|
+
targetFor(registry: string): Option.Option<PublishTarget>;
|
|
49
52
|
[Equal.symbol](that: Equal.Equal): boolean;
|
|
50
53
|
[Hash.symbol](): number;
|
|
51
54
|
toString(): string;
|
|
@@ -71,16 +74,7 @@ declare const AnalyzedWorkspace_base: Schema.TaggedClass<AnalyzedWorkspace, "Ana
|
|
|
71
74
|
root: typeof Schema.Boolean;
|
|
72
75
|
publishConfig: Schema.NullOr<typeof SilkPublishConfig>;
|
|
73
76
|
publishable: typeof Schema.Boolean;
|
|
74
|
-
targets: Schema.Array$<
|
|
75
|
-
protocol: Schema.Literal<["npm", "jsr"]>;
|
|
76
|
-
registry: Schema.NullOr<typeof Schema.String>;
|
|
77
|
-
directory: typeof Schema.String;
|
|
78
|
-
access: Schema.Literal<["public", "restricted"]>;
|
|
79
|
-
provenance: typeof Schema.Boolean;
|
|
80
|
-
tag: typeof Schema.String;
|
|
81
|
-
auth: Schema.Literal<["oidc", "token"]>;
|
|
82
|
-
tokenEnv: Schema.NullOr<typeof Schema.String>;
|
|
83
|
-
}>>;
|
|
77
|
+
targets: Schema.Array$<typeof PublishTarget>;
|
|
84
78
|
versioned: typeof Schema.Boolean;
|
|
85
79
|
tagged: typeof Schema.Boolean;
|
|
86
80
|
released: typeof Schema.Boolean;
|
|
@@ -88,20 +82,6 @@ declare const AnalyzedWorkspace_base: Schema.TaggedClass<AnalyzedWorkspace, "Ana
|
|
|
88
82
|
fixed: Schema.Array$<Schema.suspend<unknown, unknown, unknown>>;
|
|
89
83
|
}>;
|
|
90
84
|
|
|
91
|
-
/**
|
|
92
|
-
* Authentication strategy used to obtain publish credentials.
|
|
93
|
-
*
|
|
94
|
-
* @remarks
|
|
95
|
-
* `"oidc"` relies on GitHub Actions OIDC provenance tokens (no explicit secret needed).
|
|
96
|
-
* `"token"` reads a long-lived token from an environment variable.
|
|
97
|
-
*
|
|
98
|
-
* @since 0.1.0
|
|
99
|
-
*/
|
|
100
|
-
export declare const AuthStrategy: Schema.Literal<["oidc", "token"]>;
|
|
101
|
-
|
|
102
|
-
/** @since 0.1.0 */
|
|
103
|
-
export declare type AuthStrategy = typeof AuthStrategy.Type;
|
|
104
|
-
|
|
105
85
|
/**
|
|
106
86
|
* Service that keeps the `$schema` URL in Biome config files in sync with a target version.
|
|
107
87
|
*
|
|
@@ -238,17 +218,65 @@ export declare type BiomeSyncResult = typeof BiomeSyncResult.Type;
|
|
|
238
218
|
*/
|
|
239
219
|
export declare function buildSchemaUrl(version: string): string;
|
|
240
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Accessor service over a workspace root's `.changeset/config.json`.
|
|
223
|
+
*
|
|
224
|
+
* @remarks
|
|
225
|
+
* Reads through {@link ChangesetConfigReader} (FileSystem-based) with a per-root cache.
|
|
226
|
+
* Every accessor is total (error channel `never`): a missing or unreadable config collapses
|
|
227
|
+
* to `mode: "none"` and empty/false defaults.
|
|
228
|
+
*
|
|
229
|
+
* @since 0.4.0
|
|
230
|
+
*/
|
|
231
|
+
export declare class ChangesetConfig extends ChangesetConfig_base {
|
|
232
|
+
/**
|
|
233
|
+
* The one ignore matcher: exact name match, or `@scope/*` wildcard.
|
|
234
|
+
*
|
|
235
|
+
* `"@scope/*"` matches `"@scope/anything"` (prefix kept includes the trailing slash),
|
|
236
|
+
* but not the bare scope `"@scope"`.
|
|
237
|
+
*/
|
|
238
|
+
static matches(name: string, pattern: string): boolean;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare const ChangesetConfig_base: Context.TagClass<ChangesetConfig, "@savvy-web/silk-effects/ChangesetConfig", {
|
|
242
|
+
readonly mode: (root: string) => Effect.Effect<ChangesetMode>;
|
|
243
|
+
readonly versionPrivate: (root: string) => Effect.Effect<boolean>;
|
|
244
|
+
readonly ignorePatterns: (root: string) => Effect.Effect<ReadonlyArray<string>>;
|
|
245
|
+
readonly isIgnored: (name: string, root: string) => Effect.Effect<boolean>;
|
|
246
|
+
readonly fixed: (root: string) => Effect.Effect<ReadonlyArray<ReadonlyArray<string>>>;
|
|
247
|
+
}>;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Raised when the `.changeset/config.json` file cannot be read or decoded.
|
|
251
|
+
*
|
|
252
|
+
* @remarks
|
|
253
|
+
* Returned by {@link ChangesetConfigReader.read} when the file is missing,
|
|
254
|
+
* contains invalid JSON, or fails Effect Schema validation.
|
|
255
|
+
*
|
|
256
|
+
* @since 0.1.0
|
|
257
|
+
*/
|
|
258
|
+
export declare class ChangesetConfigError extends ChangesetConfigError_base<{
|
|
259
|
+
readonly path: string;
|
|
260
|
+
readonly reason: string;
|
|
261
|
+
}> {
|
|
262
|
+
get message(): string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare const ChangesetConfigError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
266
|
+
readonly _tag: "ChangesetConfigError";
|
|
267
|
+
} & Readonly<A>;
|
|
268
|
+
|
|
241
269
|
/**
|
|
242
270
|
* Standard changesets configuration matching the `@changesets/config@3.1.1` spec.
|
|
243
271
|
*
|
|
244
272
|
* @remarks
|
|
245
273
|
* Represents the parsed `.changeset/config.json` file. All fields are optional
|
|
246
|
-
* to allow partial configs. Use {@link
|
|
274
|
+
* to allow partial configs. Use {@link SilkChangesetConfigFile} when the Silk changelog
|
|
247
275
|
* adapter is detected.
|
|
248
276
|
*
|
|
249
277
|
* @since 0.1.0
|
|
250
278
|
*/
|
|
251
|
-
export declare const
|
|
279
|
+
export declare const ChangesetConfigFile: Schema.Struct<{
|
|
252
280
|
changelog: Schema.optional<Schema.Union<[typeof Schema.String, Schema.Array$<typeof Schema.Unknown>, Schema.Literal<[false]>]>>;
|
|
253
281
|
commit: Schema.optional<Schema.Union<[typeof Schema.Boolean, typeof Schema.String, Schema.Array$<typeof Schema.Unknown>]>>;
|
|
254
282
|
fixed: Schema.optional<Schema.Array$<Schema.Array$<typeof Schema.String>>>;
|
|
@@ -271,35 +299,26 @@ export declare const ChangesetConfig: Schema.Struct<{
|
|
|
271
299
|
}>;
|
|
272
300
|
|
|
273
301
|
/** @since 0.1.0 */
|
|
274
|
-
export declare type
|
|
302
|
+
export declare type ChangesetConfigFile = typeof ChangesetConfigFile.Type;
|
|
275
303
|
|
|
276
304
|
/**
|
|
277
|
-
*
|
|
305
|
+
* Live {@link ChangesetConfig} reading via {@link ChangesetConfigReader}, cached per root.
|
|
278
306
|
*
|
|
279
307
|
* @remarks
|
|
280
|
-
*
|
|
281
|
-
*
|
|
308
|
+
* Requires `ChangesetConfigReader` (which requires `FileSystem`). Provide
|
|
309
|
+
* `ChangesetConfigReaderLive` + a platform layer (`NodeContext.layer`).
|
|
282
310
|
*
|
|
283
|
-
* @since 0.
|
|
311
|
+
* @since 0.4.0
|
|
284
312
|
*/
|
|
285
|
-
export declare
|
|
286
|
-
readonly path: string;
|
|
287
|
-
readonly reason: string;
|
|
288
|
-
}> {
|
|
289
|
-
get message(): string;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
declare const ChangesetConfigError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
293
|
-
readonly _tag: "ChangesetConfigError";
|
|
294
|
-
} & Readonly<A>;
|
|
313
|
+
export declare const ChangesetConfigLive: Layer.Layer<ChangesetConfig, never, ChangesetConfigReader>;
|
|
295
314
|
|
|
296
315
|
/**
|
|
297
316
|
* Service that reads and decodes the `.changeset/config.json` for a given workspace root.
|
|
298
317
|
*
|
|
299
318
|
* @remarks
|
|
300
319
|
* Automatically detects whether the config uses the Silk changelog adapter
|
|
301
|
-
* (`@savvy-web/changesets`) and decodes as {@link
|
|
302
|
-
* standard {@link
|
|
320
|
+
* (`@savvy-web/changesets`) and decodes as {@link SilkChangesetConfigFile} or the
|
|
321
|
+
* standard {@link ChangesetConfigFile} accordingly.
|
|
303
322
|
*
|
|
304
323
|
* @example
|
|
305
324
|
* ```typescript
|
|
@@ -328,7 +347,7 @@ declare const ChangesetConfigReader_base: Context.TagClass<ChangesetConfigReader
|
|
|
328
347
|
*
|
|
329
348
|
* @since 0.1.0
|
|
330
349
|
*/
|
|
331
|
-
readonly read: (root: string) => Effect.Effect<
|
|
350
|
+
readonly read: (root: string) => Effect.Effect<ChangesetConfigFile | SilkChangesetConfigFile, ChangesetConfigError>;
|
|
332
351
|
}>;
|
|
333
352
|
|
|
334
353
|
/**
|
|
@@ -342,6 +361,9 @@ declare const ChangesetConfigReader_base: Context.TagClass<ChangesetConfigReader
|
|
|
342
361
|
*/
|
|
343
362
|
export declare const ChangesetConfigReaderLive: Layer.Layer<ChangesetConfigReader, never, FileSystem.FileSystem>;
|
|
344
363
|
|
|
364
|
+
/** Changeset operating mode for a workspace root. */
|
|
365
|
+
export declare type ChangesetMode = "silk" | "vanilla" | "none";
|
|
366
|
+
|
|
345
367
|
/** @since 0.2.0 */
|
|
346
368
|
export declare type CheckResult = Data.TaggedEnum<CheckResultDefinition>;
|
|
347
369
|
|
|
@@ -618,104 +640,48 @@ declare const ManagedSection_base: Context.TagClass<ManagedSection, "@savvy-web/
|
|
|
618
640
|
export declare const ManagedSectionLive: Layer.Layer<ManagedSection, never, FileSystem.FileSystem>;
|
|
619
641
|
|
|
620
642
|
/**
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
* @
|
|
624
|
-
* Returned by {@link SilkPublishabilityPlugin.detect} when `publishConfig` exists
|
|
625
|
-
* but cannot be mapped to a valid set of publish targets.
|
|
626
|
-
*
|
|
627
|
-
* @since 0.1.0
|
|
628
|
-
*/
|
|
629
|
-
export declare class PublishConfigError extends PublishConfigError_base<{
|
|
630
|
-
readonly packageName: string;
|
|
631
|
-
readonly reason: string;
|
|
632
|
-
}> {
|
|
633
|
-
get message(): string;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
declare const PublishConfigError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
637
|
-
readonly _tag: "PublishConfigError";
|
|
638
|
-
} & Readonly<A>;
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* The publish protocol used when pushing a package to a registry.
|
|
642
|
-
*
|
|
643
|
-
* @remarks
|
|
644
|
-
* `"npm"` covers all npm-compatible registries (npmjs.org, GitHub Packages, custom).
|
|
645
|
-
* `"jsr"` targets the JSR registry via its own publish tool.
|
|
646
|
-
*
|
|
647
|
-
* @since 0.1.0
|
|
648
|
-
*/
|
|
649
|
-
export declare const PublishProtocol: Schema.Literal<["npm", "jsr"]>;
|
|
650
|
-
|
|
651
|
-
/** @since 0.1.0 */
|
|
652
|
-
export declare type PublishProtocol = typeof PublishProtocol.Type;
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Union of all accepted publish-target representations.
|
|
643
|
+
* Ignore-aware override of {@link PublishabilityDetector}. `detect` short-circuits to `[]`
|
|
644
|
+
* for changeset-ignored packages, then dispatches on {@link ChangesetConfig.mode}:
|
|
645
|
+
* `none` → `[]`; `silk` → {@link SilkPublishability.detect}; `vanilla` → the library default.
|
|
656
646
|
*
|
|
657
|
-
* @remarks
|
|
658
|
-
* Accepts a {@link PublishTargetShorthand} string (`"npm"`, `"github"`, `"jsr"`),
|
|
659
|
-
* an `https://` URL pointing to a custom npm-compatible registry, or a full
|
|
660
|
-
* {@link PublishTargetObject} with explicit field overrides.
|
|
647
|
+
* @remarks Requires `FileSystem` + {@link ChangesetConfig} at build.
|
|
661
648
|
*
|
|
662
|
-
* @since 0.
|
|
649
|
+
* @since 0.4.0
|
|
663
650
|
*/
|
|
664
|
-
declare const
|
|
665
|
-
protocol: Schema.optionalWith<Schema.Literal<["npm", "jsr"]>, {
|
|
666
|
-
default: () => "npm";
|
|
667
|
-
}>;
|
|
668
|
-
registry: Schema.optional<typeof Schema.String>;
|
|
669
|
-
directory: Schema.optional<typeof Schema.String>;
|
|
670
|
-
access: Schema.optional<Schema.Literal<["public", "restricted"]>>;
|
|
671
|
-
provenance: Schema.optional<typeof Schema.Boolean>;
|
|
672
|
-
tag: Schema.optional<typeof Schema.String>;
|
|
673
|
-
}>]>;
|
|
674
|
-
|
|
675
|
-
/** @since 0.1.0 */
|
|
676
|
-
declare type PublishTarget = typeof PublishTarget.Type;
|
|
677
|
-
export { PublishTarget }
|
|
678
|
-
export { PublishTarget as PublishTargetSchema }
|
|
651
|
+
export declare const PublishabilityDetectorAdaptiveLive: Layer.Layer<PublishabilityDetector, never, FileSystem.FileSystem | ChangesetConfig>;
|
|
679
652
|
|
|
680
|
-
/**
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
* @since 0.1.0
|
|
688
|
-
*/
|
|
689
|
-
export declare const PublishTargetObject: Schema.Struct<{
|
|
690
|
-
protocol: Schema.optionalWith<Schema.Literal<["npm", "jsr"]>, {
|
|
691
|
-
default: () => "npm";
|
|
692
|
-
}>;
|
|
693
|
-
registry: Schema.optional<typeof Schema.String>;
|
|
694
|
-
directory: Schema.optional<typeof Schema.String>;
|
|
695
|
-
access: Schema.optional<Schema.Literal<["public", "restricted"]>>;
|
|
696
|
-
provenance: Schema.optional<typeof Schema.Boolean>;
|
|
697
|
-
tag: Schema.optional<typeof Schema.String>;
|
|
698
|
-
}>;
|
|
653
|
+
/** A publishable workspace package and the count of its resolved publish targets. */
|
|
654
|
+
export declare interface PublishablePackage {
|
|
655
|
+
readonly name: string;
|
|
656
|
+
readonly version: string;
|
|
657
|
+
readonly path: string;
|
|
658
|
+
readonly targetCount: number;
|
|
659
|
+
}
|
|
699
660
|
|
|
700
|
-
/** @
|
|
701
|
-
export declare
|
|
661
|
+
/** Raw `package.json` shape consumed by {@link SilkPublishability.detect}. */
|
|
662
|
+
export declare interface RawPackageJson {
|
|
663
|
+
readonly name?: string;
|
|
664
|
+
readonly version?: string;
|
|
665
|
+
readonly private?: boolean;
|
|
666
|
+
readonly publishConfig?: RawPublishConfig;
|
|
667
|
+
}
|
|
702
668
|
|
|
703
|
-
/**
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
*
|
|
711
|
-
* @since 0.1.0
|
|
712
|
-
*/
|
|
713
|
-
declare const PublishTargetShorthand: Schema.Literal<["npm", "github", "jsr"]>;
|
|
669
|
+
/** Raw `publishConfig` shape (the unschematized fields silk rules consult). */
|
|
670
|
+
export declare interface RawPublishConfig {
|
|
671
|
+
readonly access?: "public" | "restricted";
|
|
672
|
+
readonly registry?: string;
|
|
673
|
+
readonly directory?: string;
|
|
674
|
+
readonly targets?: ReadonlyArray<RawTargetSpec>;
|
|
675
|
+
}
|
|
714
676
|
|
|
715
|
-
/**
|
|
716
|
-
declare type
|
|
717
|
-
|
|
718
|
-
|
|
677
|
+
/** A single declared publish target in a raw `publishConfig.targets` array. */
|
|
678
|
+
export declare type RawTargetSpec = string | {
|
|
679
|
+
readonly access?: "public" | "restricted";
|
|
680
|
+
readonly protocol?: string;
|
|
681
|
+
readonly registry?: string;
|
|
682
|
+
readonly directory?: string;
|
|
683
|
+
readonly provenance?: boolean;
|
|
684
|
+
};
|
|
719
685
|
|
|
720
686
|
/** @since 0.2.0 */
|
|
721
687
|
export declare type ResolutionPolicy = Data.TaggedEnum<ResolutionPolicyDefinition>;
|
|
@@ -801,32 +767,6 @@ export declare type ResolutionPolicyDefinition = {
|
|
|
801
767
|
readonly RequireMatch: {};
|
|
802
768
|
};
|
|
803
769
|
|
|
804
|
-
/**
|
|
805
|
-
* Fully resolved publish target with all fields populated and defaults applied.
|
|
806
|
-
*
|
|
807
|
-
* @remarks
|
|
808
|
-
* Produced by {@link TargetResolver.resolve} from any {@link PublishTarget} input.
|
|
809
|
-
* All optional fields from {@link PublishTargetObject} become required here,
|
|
810
|
-
* and `auth` / `tokenEnv` are derived from the registry URL.
|
|
811
|
-
*
|
|
812
|
-
* @since 0.1.0
|
|
813
|
-
*/
|
|
814
|
-
declare const ResolvedTarget: Schema.Struct<{
|
|
815
|
-
protocol: Schema.Literal<["npm", "jsr"]>;
|
|
816
|
-
registry: Schema.NullOr<typeof Schema.String>;
|
|
817
|
-
directory: typeof Schema.String;
|
|
818
|
-
access: Schema.Literal<["public", "restricted"]>;
|
|
819
|
-
provenance: typeof Schema.Boolean;
|
|
820
|
-
tag: typeof Schema.String;
|
|
821
|
-
auth: Schema.Literal<["oidc", "token"]>;
|
|
822
|
-
tokenEnv: Schema.NullOr<typeof Schema.String>;
|
|
823
|
-
}>;
|
|
824
|
-
|
|
825
|
-
/** @since 0.1.0 */
|
|
826
|
-
declare type ResolvedTarget = typeof ResolvedTarget.Type;
|
|
827
|
-
export { ResolvedTarget }
|
|
828
|
-
export { ResolvedTarget as ResolvedTargetSchema }
|
|
829
|
-
|
|
830
770
|
/**
|
|
831
771
|
* Result of resolving a {@link ToolDefinition}.
|
|
832
772
|
*
|
|
@@ -1090,13 +1030,13 @@ declare const ShellSectionDefinition_base: Schema.TaggedClass<ShellSectionDefini
|
|
|
1090
1030
|
* Extended changeset config for repos using the `@savvy-web/changesets` changelog adapter.
|
|
1091
1031
|
*
|
|
1092
1032
|
* @remarks
|
|
1093
|
-
* Extends {@link
|
|
1033
|
+
* Extends {@link ChangesetConfigFile} with a `_isSilk` marker flag that is automatically
|
|
1094
1034
|
* set to `true`. Detected by {@link ChangesetConfigReader} when the `changelog` field
|
|
1095
1035
|
* references `@savvy-web/changesets`.
|
|
1096
1036
|
*
|
|
1097
1037
|
* @since 0.1.0
|
|
1098
1038
|
*/
|
|
1099
|
-
export declare const
|
|
1039
|
+
export declare const SilkChangesetConfigFile: Schema.extend<Schema.Struct<{
|
|
1100
1040
|
changelog: Schema.optional<Schema.Union<[typeof Schema.String, Schema.Array$<typeof Schema.Unknown>, Schema.Literal<[false]>]>>;
|
|
1101
1041
|
commit: Schema.optional<Schema.Union<[typeof Schema.Boolean, typeof Schema.String, Schema.Array$<typeof Schema.Unknown>]>>;
|
|
1102
1042
|
fixed: Schema.optional<Schema.Array$<Schema.Array$<typeof Schema.String>>>;
|
|
@@ -1123,59 +1063,59 @@ export declare const SilkChangesetConfig: Schema.extend<Schema.Struct<{
|
|
|
1123
1063
|
}>>;
|
|
1124
1064
|
|
|
1125
1065
|
/** @since 0.1.0 */
|
|
1126
|
-
export declare type
|
|
1066
|
+
export declare type SilkChangesetConfigFile = typeof SilkChangesetConfigFile.Type;
|
|
1127
1067
|
|
|
1128
1068
|
/**
|
|
1129
|
-
*
|
|
1069
|
+
* Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
|
|
1130
1070
|
*
|
|
1131
1071
|
* @remarks
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
* - `publishConfig.targets` (array) → resolved via {@link TargetResolver}.
|
|
1136
|
-
* - `publishConfig.registry` → resolved as a single registry target.
|
|
1137
|
-
* - Default → resolved as `"npm"`.
|
|
1138
|
-
*
|
|
1139
|
-
* @example
|
|
1140
|
-
* ```typescript
|
|
1141
|
-
* const result = await Effect.runPromise(
|
|
1142
|
-
* Effect.gen(function* () {
|
|
1143
|
-
* const plugin = yield* SilkPublishabilityPlugin;
|
|
1144
|
-
* return yield* plugin.detect({ publishConfig: { access: "public" } });
|
|
1145
|
-
* }).pipe(
|
|
1146
|
-
* Effect.provide(SilkPublishabilityPluginLive),
|
|
1147
|
-
* Effect.provide(TargetResolverLive),
|
|
1148
|
-
* )
|
|
1149
|
-
* );
|
|
1150
|
-
* ```
|
|
1072
|
+
* In silk mode `private: true` is the norm on workspace `package.json`; publishability is
|
|
1073
|
+
* derived from `publishConfig`, with the `private` flag consulted only as a last-resort
|
|
1074
|
+
* default. All helpers are static so a consumer sees the full rule surface in one place.
|
|
1151
1075
|
*
|
|
1152
|
-
* @since 0.
|
|
1076
|
+
* @since 0.4.0
|
|
1153
1077
|
*/
|
|
1154
|
-
export declare class
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
declare const SilkPublishabilityPlugin_base: Context.TagClass<SilkPublishabilityPlugin, "@savvy-web/silk-effects/SilkPublishabilityPlugin", {
|
|
1078
|
+
export declare class SilkPublishability {
|
|
1158
1079
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* @param pkgJson - The parsed `package.json` contents.
|
|
1162
|
-
* @returns An `Effect` that succeeds with an array of {@link ResolvedTarget} records
|
|
1163
|
-
* (empty when the package is not publishable), or fails with {@link TargetResolutionError}.
|
|
1164
|
-
*
|
|
1165
|
-
* @since 0.1.0
|
|
1080
|
+
* Resolve the access for one target spec. String targets always inherit the parent
|
|
1081
|
+
* `publishConfig.access`; object targets use their own `.access` else the parent's.
|
|
1166
1082
|
*/
|
|
1167
|
-
|
|
1168
|
-
|
|
1083
|
+
static resolveTargetAccess(target: RawTargetSpec, parentAccess: "public" | "restricted" | undefined): "public" | "restricted" | undefined;
|
|
1084
|
+
/**
|
|
1085
|
+
* Expand a shorthand string target to a registry URL. `"npm"`/`"github"`/`"jsr"` map to
|
|
1086
|
+
* canonical registries; `http(s)://…` is verbatim; anything else falls back to the parent
|
|
1087
|
+
* `publishConfig.registry` (or the npm default).
|
|
1088
|
+
*/
|
|
1089
|
+
static expandShorthand(target: string, parentRegistry: string | undefined): string;
|
|
1090
|
+
/**
|
|
1091
|
+
* Apply silk publishability rules to a raw `package.json`. Targets-first precedence:
|
|
1092
|
+
* `publishConfig.targets` → one PublishTarget per surviving target (regardless of
|
|
1093
|
+
* `private`); else `publishConfig.access` → one target; else `private !== true` → one
|
|
1094
|
+
* default target; else `[]`.
|
|
1095
|
+
*/
|
|
1096
|
+
static detect(pkgName: string, raw: RawPackageJson): ReadonlyArray<PublishTarget>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Resolve a package's publish targets via {@link PublishabilityDetector}, then drop any
|
|
1099
|
+
* whose built `directory` package.json is `private: true`. Returned targets keep the
|
|
1100
|
+
* detector's original (possibly package-relative) `directory`.
|
|
1101
|
+
*/
|
|
1102
|
+
static resolveTargets(pkg: WorkspacePackage, root: string): Effect.Effect<ReadonlyArray<PublishTarget>, never, PublishabilityDetector | FileSystem.FileSystem>;
|
|
1103
|
+
/**
|
|
1104
|
+
* The publishable, non-ignored packages, resolved through the single
|
|
1105
|
+
* {@link PublishabilityDetector} (which already honors changeset ignore in adaptive mode).
|
|
1106
|
+
*/
|
|
1107
|
+
static listPublishable(root: string): Effect.Effect<ReadonlyArray<PublishablePackage>, never, WorkspaceDiscovery | PublishabilityDetector>;
|
|
1108
|
+
}
|
|
1169
1109
|
|
|
1170
1110
|
/**
|
|
1171
|
-
*
|
|
1111
|
+
* Override of `workspaces-effect`'s {@link PublishabilityDetector} Tag with pure silk rules.
|
|
1172
1112
|
*
|
|
1173
|
-
* @remarks
|
|
1174
|
-
*
|
|
1113
|
+
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
1114
|
+
* `package.json` from `pkg.packageJsonPath` and applies {@link SilkPublishability.detect}.
|
|
1175
1115
|
*
|
|
1176
|
-
* @since 0.
|
|
1116
|
+
* @since 0.4.0
|
|
1177
1117
|
*/
|
|
1178
|
-
export declare const
|
|
1118
|
+
export declare const SilkPublishabilityDetectorLive: Layer.Layer<PublishabilityDetector, never, FileSystem.FileSystem>;
|
|
1179
1119
|
|
|
1180
1120
|
/**
|
|
1181
1121
|
* Silk-extended publishConfig schema.
|
|
@@ -1250,9 +1190,9 @@ declare const SilkPublishConfig_base: Schema.Class<SilkPublishConfig, {
|
|
|
1250
1190
|
*
|
|
1251
1191
|
* @remarks
|
|
1252
1192
|
* Orchestrates {@link WorkspaceDiscovery}, {@link PackageManagerDetector},
|
|
1253
|
-
* {@link
|
|
1254
|
-
* {@link
|
|
1255
|
-
*
|
|
1193
|
+
* {@link ChangesetConfigReader}, {@link VersioningStrategy}, and
|
|
1194
|
+
* {@link TagStrategy} to produce a complete {@link WorkspaceAnalysis} for a
|
|
1195
|
+
* given workspace root.
|
|
1256
1196
|
*
|
|
1257
1197
|
* @example
|
|
1258
1198
|
* ```typescript
|
|
@@ -1292,12 +1232,11 @@ declare const SilkWorkspaceAnalyzer_base: Context.TagClass<SilkWorkspaceAnalyzer
|
|
|
1292
1232
|
*
|
|
1293
1233
|
* @remarks
|
|
1294
1234
|
* Requires {@link WorkspaceDiscovery}, {@link PackageManagerDetector},
|
|
1295
|
-
* {@link
|
|
1296
|
-
* {@link VersioningStrategy}, and {@link TagStrategy}.
|
|
1235
|
+
* {@link ChangesetConfigReader}, {@link VersioningStrategy}, and {@link TagStrategy}.
|
|
1297
1236
|
*
|
|
1298
1237
|
* @since 0.2.0
|
|
1299
1238
|
*/
|
|
1300
|
-
export declare const SilkWorkspaceAnalyzerLive: Layer.Layer<SilkWorkspaceAnalyzer, never, FileSystem.FileSystem | WorkspaceDiscovery | TopologicalSorter | PackageManagerDetector |
|
|
1239
|
+
export declare const SilkWorkspaceAnalyzerLive: Layer.Layer<SilkWorkspaceAnalyzer, never, FileSystem.FileSystem | WorkspaceDiscovery | TopologicalSorter | PackageManagerDetector | ChangesetConfigReader | VersioningStrategy | TagStrategy>;
|
|
1301
1240
|
|
|
1302
1241
|
/** @since 0.2.0 */
|
|
1303
1242
|
export declare type SourceRequirement = Data.TaggedEnum<SourceRequirementDefinition>;
|
|
@@ -1559,72 +1498,6 @@ export declare const TagStrategyType: Schema.Literal<["single", "scoped"]>;
|
|
|
1559
1498
|
/** @since 0.1.0 */
|
|
1560
1499
|
export declare type TagStrategyType = typeof TagStrategyType.Type;
|
|
1561
1500
|
|
|
1562
|
-
/**
|
|
1563
|
-
* Raised when a publish target value cannot be resolved into a {@link ResolvedTarget}.
|
|
1564
|
-
*
|
|
1565
|
-
* @remarks
|
|
1566
|
-
* Returned by {@link TargetResolver.resolve} when the input is not a recognised shorthand,
|
|
1567
|
-
* a valid `https://` URL, or a well-formed object target.
|
|
1568
|
-
*
|
|
1569
|
-
* @since 0.1.0
|
|
1570
|
-
*/
|
|
1571
|
-
export declare class TargetResolutionError extends TargetResolutionError_base<{
|
|
1572
|
-
readonly target: unknown;
|
|
1573
|
-
readonly reason: string;
|
|
1574
|
-
}> {
|
|
1575
|
-
get message(): string;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
declare const TargetResolutionError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
1579
|
-
readonly _tag: "TargetResolutionError";
|
|
1580
|
-
} & Readonly<A>;
|
|
1581
|
-
|
|
1582
|
-
/**
|
|
1583
|
-
* Service that resolves raw publish-target values into fully-normalised {@link ResolvedTarget} records.
|
|
1584
|
-
*
|
|
1585
|
-
* @remarks
|
|
1586
|
-
* Accepts a single target or an array of targets. Each item may be a
|
|
1587
|
-
* {@link PublishTargetShorthand} string, an `https://` registry URL, or a
|
|
1588
|
-
* {@link PublishTargetObject}. Unknown values produce a {@link TargetResolutionError}.
|
|
1589
|
-
*
|
|
1590
|
-
* @example
|
|
1591
|
-
* ```typescript
|
|
1592
|
-
* const result = await Effect.runPromise(
|
|
1593
|
-
* Effect.gen(function* () {
|
|
1594
|
-
* const resolver = yield* TargetResolver;
|
|
1595
|
-
* return yield* resolver.resolve("npm");
|
|
1596
|
-
* }).pipe(Effect.provide(TargetResolverLive))
|
|
1597
|
-
* );
|
|
1598
|
-
* ```
|
|
1599
|
-
*
|
|
1600
|
-
* @since 0.1.0
|
|
1601
|
-
*/
|
|
1602
|
-
export declare class TargetResolver extends TargetResolver_base {
|
|
1603
|
-
}
|
|
1604
|
-
|
|
1605
|
-
declare const TargetResolver_base: Context.TagClass<TargetResolver, "@savvy-web/silk-effects/TargetResolver", {
|
|
1606
|
-
/**
|
|
1607
|
-
* Resolve one target (or an array of targets) into an array of {@link ResolvedTarget} records.
|
|
1608
|
-
*
|
|
1609
|
-
* @param target - A single publish-target value or an array of them.
|
|
1610
|
-
* @returns An `Effect` that succeeds with the resolved targets or fails with {@link TargetResolutionError}.
|
|
1611
|
-
*
|
|
1612
|
-
* @since 0.1.0
|
|
1613
|
-
*/
|
|
1614
|
-
readonly resolve: (target: unknown) => Effect.Effect<ReadonlyArray<ResolvedTarget>, TargetResolutionError>;
|
|
1615
|
-
}>;
|
|
1616
|
-
|
|
1617
|
-
/**
|
|
1618
|
-
* Live implementation of {@link TargetResolver} with no external dependencies.
|
|
1619
|
-
*
|
|
1620
|
-
* @remarks
|
|
1621
|
-
* All resolution logic is pure: shorthand strings, `https://` URLs, and object targets
|
|
1622
|
-
* are mapped to {@link ResolvedTarget} records without any I/O.
|
|
1623
|
-
*
|
|
1624
|
-
* @since 0.1.0
|
|
1625
|
-
*/
|
|
1626
|
-
export declare const TargetResolverLive: Layer.Layer<TargetResolver, never, never>;
|
|
1627
|
-
|
|
1628
1501
|
/**
|
|
1629
1502
|
* Wraps `@effect/platform` {@link Command.Command} with instance method ergonomics.
|
|
1630
1503
|
*
|