@savvy-web/silk-effects 1.0.0 → 1.1.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.
@@ -25,8 +25,8 @@ import { MergeSectionsPlugin } from "./remark/plugins/merge-sections.js";
25
25
  import { NormalizeFormatPlugin } from "./remark/plugins/normalize-format.js";
26
26
  import { ReorderSectionsPlugin } from "./remark/plugins/reorder-sections.js";
27
27
  import { ChangelogTransformer } from "./api/transformer.js";
28
- import { ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, makeConfigInspectorTest } from "./services/config-inspector.js";
29
- import { BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, makeBranchAnalyzerTest } from "./services/branch-analyzer.js";
28
+ import { ClassificationReasonSchema, ClassificationSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, InspectedConfigSchema, ResolvedPackageScopeSchema, ResolvedVersionFileSchema, makeConfigInspectorTest } from "./services/config-inspector.js";
29
+ import { BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchFileEntrySchema, FileStatusSchema, makeBranchAnalyzerTest } from "./services/branch-analyzer.js";
30
30
  import { ChangelogService, ChangelogServiceBase } from "./services/changelog.js";
31
31
  import { WorkspaceSnapshotReader, WorkspaceSnapshotReaderBase, WorkspaceSnapshotReaderLive } from "./services/workspace-snapshot.js";
32
32
  import { SectionCategorySchema } from "./categories/types.js";
@@ -49,9 +49,11 @@ import { SilkChangesetPreset, SilkChangesetTransformPreset } from "./remark/pres
49
49
  //#region src/changesets/index.ts
50
50
  var changesets_exports = /* @__PURE__ */ __exportAll({
51
51
  AggregateDependencyTablesPlugin: () => AggregateDependencyTablesPlugin,
52
+ BranchAnalysisSchema: () => BranchAnalysisSchema,
52
53
  BranchAnalyzer: () => BranchAnalyzer,
53
54
  BranchAnalyzerBase: () => BranchAnalyzerBase,
54
55
  BranchAnalyzerLive: () => BranchAnalyzerLive,
56
+ BranchFileEntrySchema: () => BranchFileEntrySchema,
55
57
  Categories: () => Categories,
56
58
  Changelog: () => Changelog,
57
59
  ChangelogService: () => ChangelogService,
@@ -63,6 +65,8 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
63
65
  ChangesetSummarySchema: () => ChangesetSummarySchema,
64
66
  ChangesetValidationError: () => ChangesetValidationError,
65
67
  ChangesetValidationErrorBase: () => ChangesetValidationErrorBase,
68
+ ClassificationReasonSchema: () => ClassificationReasonSchema,
69
+ ClassificationSchema: () => ClassificationSchema,
66
70
  CommitHashSchema: () => CommitHashSchema,
67
71
  ConfigInspector: () => ConfigInspector,
68
72
  ConfigInspectorBase: () => ConfigInspectorBase,
@@ -80,6 +84,7 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
80
84
  DependencyTableTypeSchema: () => DependencyTableTypeSchema,
81
85
  DependencyTypeSchema: () => DependencyTypeSchema,
82
86
  DependencyUpdateSchema: () => DependencyUpdateSchema,
87
+ FileStatusSchema: () => FileStatusSchema,
83
88
  GitError: () => GitError,
84
89
  GitErrorBase: () => GitErrorBase,
85
90
  GitHubApiError: () => GitHubApiError,
@@ -90,6 +95,7 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
90
95
  GitHubServiceBase: () => GitHubServiceBase,
91
96
  GlobSchema: () => GlobSchema,
92
97
  HeadingHierarchyRule: () => HeadingHierarchyRule,
98
+ InspectedConfigSchema: () => InspectedConfigSchema,
93
99
  IssueLinkRefsPlugin: () => IssueLinkRefsPlugin,
94
100
  IssueNumberSchema: () => IssueNumberSchema,
95
101
  JsonPathSchema: () => JsonPathSchema,
@@ -114,6 +120,8 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
114
120
  ReorderSectionsPlugin: () => ReorderSectionsPlugin,
115
121
  RepoSchema: () => RepoSchema,
116
122
  RequiredSectionsRule: () => RequiredSectionsRule,
123
+ ResolvedPackageScopeSchema: () => ResolvedPackageScopeSchema,
124
+ ResolvedVersionFileSchema: () => ResolvedVersionFileSchema,
117
125
  SectionCategorySchema: () => SectionCategorySchema,
118
126
  SilkChangesetPreset: () => SilkChangesetPreset,
119
127
  SilkChangesetTransformPreset: () => SilkChangesetTransformPreset,
@@ -1,6 +1,6 @@
1
1
  import { GitError } from "../errors.js";
2
- import { ConfigInspector } from "./config-inspector.js";
3
- import { Context, Effect, Layer } from "effect";
2
+ import { ClassificationReasonSchema, ConfigInspector } from "./config-inspector.js";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
4
  import { execFileSync } from "node:child_process";
5
5
 
6
6
  //#region src/changesets/services/branch-analyzer.ts
@@ -45,6 +45,23 @@ import { execFileSync } from "node:child_process";
45
45
  *
46
46
  * @packageDocumentation
47
47
  */
48
+ /** Git diff status as reported by `--name-status`. @public */
49
+ const FileStatusSchema = Schema.Literal("added", "modified", "deleted", "renamed", "copied", "typechange", "unmerged", "unknown").annotations({ identifier: "FileStatus" });
50
+ /** One file entry in the branch analysis output. @public */
51
+ const BranchFileEntrySchema = Schema.Struct({
52
+ path: Schema.String.annotations({ description: "Repo-relative path (the new path in the case of renames)." }),
53
+ status: FileStatusSchema,
54
+ package: Schema.NullOr(Schema.String).annotations({ description: "Owning package, or null if outside every known release surface." }),
55
+ reason: ClassificationReasonSchema
56
+ }).annotations({ identifier: "BranchFileEntry" });
57
+ /** Structured result of analyzing the current branch against its base. @public */
58
+ const BranchAnalysisSchema = Schema.Struct({
59
+ baseBranch: Schema.String,
60
+ mergeBaseSha: Schema.String,
61
+ files: Schema.Array(BranchFileEntrySchema),
62
+ packagesAffected: Schema.Array(Schema.String),
63
+ unmappedFiles: Schema.Array(Schema.String).annotations({ description: "Repo-relative paths whose package is null — candidates for an AskUserQuestion." })
64
+ }).annotations({ identifier: "BranchAnalysis" });
48
65
  const _tag = Context.Tag("BranchAnalyzer");
49
66
  /**
50
67
  * Base class for {@link BranchAnalyzer}.
@@ -275,4 +292,4 @@ function makeBranchAnalyzerTest(fixed) {
275
292
  }
276
293
 
277
294
  //#endregion
278
- export { BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, makeBranchAnalyzerTest };
295
+ export { BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchFileEntrySchema, FileStatusSchema, makeBranchAnalyzerTest };
@@ -1,8 +1,10 @@
1
1
  import { ConfigurationError } from "../errors.js";
2
2
  import { ChangesetOptionsSchema } from "../schemas/options.js";
3
3
  import { ChangesetConfigReader } from "../../services/ChangesetConfigReader.js";
4
+ import { SilkPublishability, readTargetsBinding } from "../../services/SilkPublishability.js";
4
5
  import { Context, Effect, Layer, Schema } from "effect";
5
6
  import { isAbsolute, join, relative, resolve } from "node:path";
7
+ import { FileSystem } from "@effect/platform";
6
8
  import { globSync } from "tinyglobby";
7
9
  import { WorkspaceDiscovery } from "workspaces-effect";
8
10
 
@@ -41,6 +43,46 @@ import { WorkspaceDiscovery } from "workspaces-effect";
41
43
  *
42
44
  * @packageDocumentation
43
45
  */
46
+ /** A `versionFiles` entry expanded to its absolute target paths. @public */
47
+ const ResolvedVersionFileSchema = Schema.Struct({
48
+ glob: Schema.String,
49
+ paths: Schema.Array(Schema.String).annotations({ description: "JSONPath expressions to update (defaults to [\"$.version\"])." }),
50
+ matchedFiles: Schema.Array(Schema.String)
51
+ }).annotations({ identifier: "ResolvedVersionFile" });
52
+ /** A package's resolved release surface. @public */
53
+ const ResolvedPackageScopeSchema = Schema.Struct({
54
+ name: Schema.String,
55
+ workspaceDir: Schema.String,
56
+ version: Schema.String,
57
+ additionalScopes: Schema.Array(Schema.String),
58
+ additionalScopeFiles: Schema.Array(Schema.String),
59
+ versionFiles: Schema.Array(ResolvedVersionFileSchema)
60
+ }).annotations({ identifier: "ResolvedPackageScope" });
61
+ /** Structured representation of a resolved `.changeset/config.json`. @public */
62
+ const InspectedConfigSchema = Schema.Struct({
63
+ configPath: Schema.String,
64
+ projectDir: Schema.String.annotations({ description: "Absolute project root (the directory containing .changeset/)." }),
65
+ changelog: Schema.NullOr(Schema.String),
66
+ baseBranch: Schema.String,
67
+ access: Schema.Literal("public", "restricted"),
68
+ ignore: Schema.Array(Schema.String),
69
+ packages: Schema.Array(ResolvedPackageScopeSchema),
70
+ legacyVersionFilesUsed: Schema.Boolean
71
+ }).annotations({ identifier: "InspectedConfig" });
72
+ /** Reason a path was attributed to a package (or left unmapped). @public */
73
+ const ClassificationReasonSchema = Schema.Union(Schema.Literal("workspace"), Schema.Struct({
74
+ kind: Schema.Literal("additionalScope"),
75
+ glob: Schema.String
76
+ }), Schema.Struct({
77
+ kind: Schema.Literal("versionFile"),
78
+ glob: Schema.String
79
+ }), Schema.Null).annotations({ identifier: "ClassificationReason" });
80
+ /** The result of classifying a single path against a resolved config. @public */
81
+ const ClassificationSchema = Schema.Struct({
82
+ path: Schema.String,
83
+ package: Schema.NullOr(Schema.String),
84
+ reason: ClassificationReasonSchema
85
+ }).annotations({ identifier: "Classification" });
44
86
  const _tag = Context.Tag("ConfigInspector");
45
87
  /**
46
88
  * Base class for {@link ConfigInspector}.
@@ -187,6 +229,48 @@ function buildResolvedScopes(params) {
187
229
  return scopes;
188
230
  }
189
231
  /**
232
+ * Read a workspace package's raw package.json. A genuinely missing manifest
233
+ * resolves to `null` so the caller can skip that package — a workspace
234
+ * directory without a `package.json` is not a release surface. Any OTHER
235
+ * failure (unreadable file, malformed JSON) is surfaced as a
236
+ * {@link ConfigurationError} carrying the package path, rather than silently
237
+ * dropping the package, which would cascade into wrong attribution.
238
+ */
239
+ function readRawPackageJson(fs, pkgDir) {
240
+ const pkgJsonPath = join(pkgDir, "package.json");
241
+ return fs.readFileString(pkgJsonPath).pipe(Effect.flatMap((content) => Effect.try(() => JSON.parse(content))), Effect.catchAll((err) => {
242
+ if (err.reason === "NotFound") return Effect.succeed(null);
243
+ return Effect.fail(new ConfigurationError({
244
+ field: "workspace",
245
+ reason: `Failed to read or parse ${pkgJsonPath}: ${err instanceof Error ? err.message : String(err)}`
246
+ }));
247
+ }));
248
+ }
249
+ /**
250
+ * Build resolved scopes from the discovered workspace packages, keeping only
251
+ * those that are a release surface (declare publishConfig that yields at least
252
+ * one publish target). Used when `.changeset/config.json` declares no explicit
253
+ * `packages` record. The changeset `ignore` list is intentionally NOT consulted
254
+ * here — an ignored package still declares publishConfig and remains a valid
255
+ * changeset target.
256
+ */
257
+ function buildFallbackScopes(fs, workspaces) {
258
+ return Effect.forEach(workspaces, (ws) => Effect.gen(function* () {
259
+ const raw = yield* readRawPackageJson(fs, ws.path);
260
+ if (raw === null) return [];
261
+ const binding = yield* readTargetsBinding(fs, ws.path);
262
+ if (SilkPublishability.detect(ws.name, raw, binding).length === 0) return [];
263
+ return [{
264
+ name: ws.name,
265
+ workspaceDir: ws.path,
266
+ version: ws.version,
267
+ additionalScopes: [],
268
+ additionalScopeFiles: [],
269
+ versionFiles: []
270
+ }];
271
+ })).pipe(Effect.map((nested) => nested.flat()));
272
+ }
273
+ /**
190
274
  * Cross-package validation: no overlap in `additionalScopes`, no shadowing
191
275
  * of another workspace package's directory (regardless of whether that
192
276
  * package is itself declared in `config.packages`), and no duplicate
@@ -244,7 +328,7 @@ function configErrorFromParseError(parseError, configPath) {
244
328
  * Each shape carries a private cache keyed by absolute project dir so
245
329
  * repeat `inspect`/`classify` calls reuse the materialized state.
246
330
  */
247
- function makeShape(reader, discovery) {
331
+ function makeShape(reader, discovery, fs) {
248
332
  const cache = /* @__PURE__ */ new Map();
249
333
  const inspect = (cwd) => Effect.gen(function* () {
250
334
  const projectDir = resolve(cwd);
@@ -280,8 +364,9 @@ function makeShape(reader, discovery) {
280
364
  path: w.path,
281
365
  version: w.version
282
366
  }));
367
+ const hasExplicitPackages = Object.keys(decodedOptions.packages ?? {}).length > 0;
283
368
  let scopes;
284
- try {
369
+ if (hasExplicitPackages) try {
285
370
  scopes = buildResolvedScopes({
286
371
  options: decodedOptions,
287
372
  workspaces,
@@ -293,6 +378,7 @@ function makeShape(reader, discovery) {
293
378
  if (e instanceof ConfigurationError) return yield* Effect.fail(e);
294
379
  throw e;
295
380
  }
381
+ else scopes = yield* buildFallbackScopes(fs, workspaces);
296
382
  const inspected = {
297
383
  configPath,
298
384
  projectDir,
@@ -367,7 +453,7 @@ function classifyOne(inspected, path) {
367
453
  * @public
368
454
  */
369
455
  const ConfigInspectorLive = Layer.effect(ConfigInspector, Effect.gen(function* () {
370
- return makeShape(yield* ChangesetConfigReader, yield* WorkspaceDiscovery);
456
+ return makeShape(yield* ChangesetConfigReader, yield* WorkspaceDiscovery, yield* FileSystem.FileSystem);
371
457
  }));
372
458
  /**
373
459
  * Test factory — build a {@link ConfigInspector} that returns a fixed
@@ -387,4 +473,4 @@ function makeConfigInspectorTest(fixed) {
387
473
  }
388
474
 
389
475
  //#endregion
390
- export { ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, makeConfigInspectorTest };
476
+ export { ClassificationReasonSchema, ClassificationSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, InspectedConfigSchema, ResolvedPackageScopeSchema, ResolvedVersionFileSchema, makeConfigInspectorTest };
@@ -26,8 +26,11 @@ const MARKDOWN_PATTERNS = {
26
26
  codeFences: /```/,
27
27
  /** Markdown inline code (`code`) - only flag if excessive */
28
28
  inlineCode: /`[^`]+`/g,
29
- /** Markdown bold (**text** or __text__) */
30
- bold: /(\*\*|__)[^*_]+(\*\*|__)/,
29
+ /** Markdown bold — asterisk form only (**text**). Underscore runs are NOT
30
+ * treated as bold, because __SNAKE_CASE__ identifiers (e.g.
31
+ * __PACKAGE_VERSION__) are legitimate commit-body prose. Agents emit
32
+ * **bold**, not __bold__, so coverage is unchanged. */
33
+ bold: /\*\*[^*]+\*\*/,
31
34
  /** Markdown italic (*text* or _text_) - be careful not to match normal underscores */
32
35
  italic: /(?<!\w)\*[^*]+\*(?!\w)/,
33
36
  /** Markdown links [text](url) */
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, Data, Effect, Equal, Hash, Layer, Option, Schema, Stream } from "effect";
2
- import { PackageManagerDetector, PublishConfig, PublishTarget, PublishabilityDetector, TopologicalSorter, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspacePackage, WorkspaceRoot } from "workspaces-effect";
3
2
  import { Command, CommandExecutor, FileSystem } from "@effect/platform";
3
+ import { PackageManagerDetector, PublishConfig, PublishTarget, PublishabilityDetector, TopologicalSorter, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspacePackage, WorkspaceRoot } from "workspaces-effect";
4
4
  import { Plugin } from "unified";
5
5
  import { PlatformError } from "@effect/platform/Error";
6
6
 
@@ -2652,88 +2652,77 @@ declare class ChangesetConfigReader extends ChangesetConfigReader_base {}
2652
2652
  declare const ChangesetConfigReaderLive: Layer.Layer<ChangesetConfigReader, never, FileSystem.FileSystem>;
2653
2653
  //#endregion
2654
2654
  //#region src/changesets/services/config-inspector.d.ts
2655
- /**
2656
- * A `versionFiles` entry expanded to its absolute target paths.
2657
- *
2658
- * @public
2659
- */
2660
- interface ResolvedVersionFile {
2661
- /** The original glob from the config. */
2662
- readonly glob: string;
2663
- /** JSONPath expressions to update (defaults to `["$.version"]`). */
2664
- readonly paths: ReadonlyArray<string>;
2665
- /** Absolute file paths the glob matched at inspection time. */
2666
- readonly matchedFiles: ReadonlyArray<string>;
2667
- }
2668
- /**
2669
- * A package's release surface after the config has been resolved against the
2670
- * workspace and the globs have been materialized.
2671
- *
2672
- * @public
2673
- */
2674
- interface ResolvedPackageScope {
2675
- /** Package name (matches the workspace package's `package.json#name`). */
2676
- readonly name: string;
2677
- /** Absolute path to the package's workspace directory. */
2678
- readonly workspaceDir: string;
2679
- /** Current version from the workspace package's `package.json`. */
2680
- readonly version: string;
2681
- /** Globs declared in the config's `additionalScopes`. */
2682
- readonly additionalScopes: ReadonlyArray<string>;
2683
- /** Files matched by `additionalScopes` (absolute paths). */
2684
- readonly additionalScopeFiles: ReadonlyArray<string>;
2685
- /** Version-file entries, each with their globs materialized. */
2686
- readonly versionFiles: ReadonlyArray<ResolvedVersionFile>;
2687
- }
2688
- /**
2689
- * Structured representation of a resolved `.changeset/config.json` for
2690
- * consumers (CLI commands, agents, tests).
2691
- *
2692
- * @public
2693
- */
2694
- interface InspectedConfig {
2695
- /** Absolute path of the resolved `.changeset/config.json`. */
2696
- readonly configPath: string;
2697
- /** Absolute path of the project root (the directory containing `.changeset/`). */
2698
- readonly projectDir: string;
2699
- /** The changelog formatter ID (e.g., `"@savvy-web/changesets/changelog"`). */
2700
- readonly changelog: string | null;
2701
- /** The base branch the workflow diffs against. */
2702
- readonly baseBranch: string;
2703
- /** Whether configured packages publish as public or restricted. */
2704
- readonly access: "public" | "restricted";
2705
- /** Package names ignored by the changeset workflow. */
2706
- readonly ignore: ReadonlyArray<string>;
2707
- /** Per-package release surfaces. */
2708
- readonly packages: ReadonlyArray<ResolvedPackageScope>;
2709
- /** True when the inspected config still used the deprecated top-level `versionFiles[]`. */
2710
- readonly legacyVersionFilesUsed: boolean;
2711
- }
2712
- /**
2713
- * Reason a path was attributed to a particular package (or left unmapped).
2714
- *
2715
- * @public
2716
- */
2717
- type ClassificationReason = "workspace" | {
2718
- readonly kind: "additionalScope";
2719
- readonly glob: string;
2720
- } | {
2721
- readonly kind: "versionFile";
2722
- readonly glob: string;
2723
- } | null;
2724
- /**
2725
- * The result of classifying a single path against a resolved config.
2726
- *
2727
- * @public
2728
- */
2729
- interface Classification {
2730
- /** Repo-relative path. */
2731
- readonly path: string;
2732
- /** Owning package name, or `null` if the path is outside every known release surface. */
2733
- readonly package: string | null;
2734
- /** Why this attribution was made. `null` mirrors `package: null`. */
2735
- readonly reason: ClassificationReason;
2736
- }
2655
+ /** A `versionFiles` entry expanded to its absolute target paths. @public */
2656
+ declare const ResolvedVersionFileSchema: Schema.Struct<{
2657
+ glob: typeof Schema.String;
2658
+ paths: Schema.Array$<typeof Schema.String>;
2659
+ matchedFiles: Schema.Array$<typeof Schema.String>;
2660
+ }>;
2661
+ /** A `versionFiles` entry expanded to its absolute target paths. @public */
2662
+ type ResolvedVersionFile = Schema.Schema.Type<typeof ResolvedVersionFileSchema>;
2663
+ /** A package's resolved release surface. @public */
2664
+ declare const ResolvedPackageScopeSchema: Schema.Struct<{
2665
+ name: typeof Schema.String;
2666
+ workspaceDir: typeof Schema.String;
2667
+ version: typeof Schema.String;
2668
+ additionalScopes: Schema.Array$<typeof Schema.String>;
2669
+ additionalScopeFiles: Schema.Array$<typeof Schema.String>;
2670
+ versionFiles: Schema.Array$<Schema.Struct<{
2671
+ glob: typeof Schema.String;
2672
+ paths: Schema.Array$<typeof Schema.String>;
2673
+ matchedFiles: Schema.Array$<typeof Schema.String>;
2674
+ }>>;
2675
+ }>;
2676
+ /** A package's resolved release surface. @public */
2677
+ type ResolvedPackageScope = Schema.Schema.Type<typeof ResolvedPackageScopeSchema>;
2678
+ /** Structured representation of a resolved `.changeset/config.json`. @public */
2679
+ declare const InspectedConfigSchema: Schema.Struct<{
2680
+ configPath: typeof Schema.String;
2681
+ projectDir: Schema.SchemaClass<string, string, never>;
2682
+ changelog: Schema.NullOr<typeof Schema.String>;
2683
+ baseBranch: typeof Schema.String;
2684
+ access: Schema.Literal<["public", "restricted"]>;
2685
+ ignore: Schema.Array$<typeof Schema.String>;
2686
+ packages: Schema.Array$<Schema.Struct<{
2687
+ name: typeof Schema.String;
2688
+ workspaceDir: typeof Schema.String;
2689
+ version: typeof Schema.String;
2690
+ additionalScopes: Schema.Array$<typeof Schema.String>;
2691
+ additionalScopeFiles: Schema.Array$<typeof Schema.String>;
2692
+ versionFiles: Schema.Array$<Schema.Struct<{
2693
+ glob: typeof Schema.String;
2694
+ paths: Schema.Array$<typeof Schema.String>;
2695
+ matchedFiles: Schema.Array$<typeof Schema.String>;
2696
+ }>>;
2697
+ }>>;
2698
+ legacyVersionFilesUsed: typeof Schema.Boolean;
2699
+ }>;
2700
+ /** Structured representation of a resolved `.changeset/config.json`. @public */
2701
+ type InspectedConfig = Schema.Schema.Type<typeof InspectedConfigSchema>;
2702
+ /** Reason a path was attributed to a package (or left unmapped). @public */
2703
+ declare const ClassificationReasonSchema: Schema.Union<[Schema.Literal<["workspace"]>, Schema.Struct<{
2704
+ kind: Schema.Literal<["additionalScope"]>;
2705
+ glob: typeof Schema.String;
2706
+ }>, Schema.Struct<{
2707
+ kind: Schema.Literal<["versionFile"]>;
2708
+ glob: typeof Schema.String;
2709
+ }>, typeof Schema.Null]>;
2710
+ /** Reason a path was attributed to a package (or left unmapped). @public */
2711
+ type ClassificationReason = Schema.Schema.Type<typeof ClassificationReasonSchema>;
2712
+ /** The result of classifying a single path against a resolved config. @public */
2713
+ declare const ClassificationSchema: Schema.Struct<{
2714
+ path: typeof Schema.String;
2715
+ package: Schema.NullOr<typeof Schema.String>;
2716
+ reason: Schema.Union<[Schema.Literal<["workspace"]>, Schema.Struct<{
2717
+ kind: Schema.Literal<["additionalScope"]>;
2718
+ glob: typeof Schema.String;
2719
+ }>, Schema.Struct<{
2720
+ kind: Schema.Literal<["versionFile"]>;
2721
+ glob: typeof Schema.String;
2722
+ }>, typeof Schema.Null]>;
2723
+ }>;
2724
+ /** The result of classifying a single path against a resolved config. @public */
2725
+ type Classification = Schema.Schema.Type<typeof ClassificationSchema>;
2737
2726
  /**
2738
2727
  * Effect service interface for inspecting a project's changeset config.
2739
2728
  *
@@ -2797,7 +2786,7 @@ declare class ConfigInspector extends ConfigInspectorBase {}
2797
2786
  *
2798
2787
  * @public
2799
2788
  */
2800
- declare const ConfigInspectorLive: Layer.Layer<ConfigInspector, never, ChangesetConfigReader | WorkspaceDiscovery>;
2789
+ declare const ConfigInspectorLive: Layer.Layer<ConfigInspector, never, ChangesetConfigReader | WorkspaceDiscovery | FileSystem.FileSystem>;
2801
2790
  /**
2802
2791
  * Test factory — build a {@link ConfigInspector} that returns a fixed
2803
2792
  * {@link InspectedConfig} without touching the filesystem.
@@ -2811,44 +2800,46 @@ declare const ConfigInspectorLive: Layer.Layer<ConfigInspector, never, Changeset
2811
2800
  declare function makeConfigInspectorTest(fixed: InspectedConfig): Layer.Layer<ConfigInspector>;
2812
2801
  //#endregion
2813
2802
  //#region src/changesets/services/branch-analyzer.d.ts
2814
- /**
2815
- * Git diff status as reported by `--name-status`.
2816
- *
2817
- * @public
2818
- */
2819
- type FileStatus = "added" | "modified" | "deleted" | "renamed" | "copied" | "typechange" | "unmerged" | "unknown";
2820
- /**
2821
- * One file entry in the branch analysis output.
2822
- *
2823
- * @public
2824
- */
2825
- interface BranchFileEntry {
2826
- /** Repo-relative path (the new path in the case of renames). */
2827
- readonly path: string;
2828
- /** Git diff status. */
2829
- readonly status: FileStatus;
2830
- /** Owning package, or `null` if the path is outside any known release surface. */
2831
- readonly package: string | null;
2832
- /** Reason for the package attribution; mirrors {@link Classification.reason}. */
2833
- readonly reason: ClassificationReason;
2834
- }
2835
- /**
2836
- * Structured result of analyzing the current branch against its base.
2837
- *
2838
- * @public
2839
- */
2840
- interface BranchAnalysis {
2841
- /** The branch the diff was computed against. */
2842
- readonly baseBranch: string;
2843
- /** The merge-base SHA between `HEAD` and `baseBranch`. */
2844
- readonly mergeBaseSha: string;
2845
- /** Files changed since the merge base, with classification. */
2846
- readonly files: ReadonlyArray<BranchFileEntry>;
2847
- /** Unique package names that own at least one changed file. */
2848
- readonly packagesAffected: ReadonlyArray<string>;
2849
- /** Repo-relative paths whose `package` is `null` — candidates for an `AskUserQuestion`. */
2850
- readonly unmappedFiles: ReadonlyArray<string>;
2851
- }
2803
+ /** Git diff status as reported by `--name-status`. @public */
2804
+ declare const FileStatusSchema: Schema.Literal<["added", "modified", "deleted", "renamed", "copied", "typechange", "unmerged", "unknown"]>;
2805
+ /** Git diff status as reported by `--name-status`. @public */
2806
+ type FileStatus = Schema.Schema.Type<typeof FileStatusSchema>;
2807
+ /** One file entry in the branch analysis output. @public */
2808
+ declare const BranchFileEntrySchema: Schema.Struct<{
2809
+ path: Schema.SchemaClass<string, string, never>;
2810
+ status: Schema.Literal<["added", "modified", "deleted", "renamed", "copied", "typechange", "unmerged", "unknown"]>;
2811
+ package: Schema.NullOr<typeof Schema.String>;
2812
+ reason: Schema.Union<[Schema.Literal<["workspace"]>, Schema.Struct<{
2813
+ kind: Schema.Literal<["additionalScope"]>;
2814
+ glob: typeof Schema.String;
2815
+ }>, Schema.Struct<{
2816
+ kind: Schema.Literal<["versionFile"]>;
2817
+ glob: typeof Schema.String;
2818
+ }>, typeof Schema.Null]>;
2819
+ }>;
2820
+ /** One file entry in the branch analysis output. @public */
2821
+ type BranchFileEntry = Schema.Schema.Type<typeof BranchFileEntrySchema>;
2822
+ /** Structured result of analyzing the current branch against its base. @public */
2823
+ declare const BranchAnalysisSchema: Schema.Struct<{
2824
+ baseBranch: typeof Schema.String;
2825
+ mergeBaseSha: typeof Schema.String;
2826
+ files: Schema.Array$<Schema.Struct<{
2827
+ path: Schema.SchemaClass<string, string, never>;
2828
+ status: Schema.Literal<["added", "modified", "deleted", "renamed", "copied", "typechange", "unmerged", "unknown"]>;
2829
+ package: Schema.NullOr<typeof Schema.String>;
2830
+ reason: Schema.Union<[Schema.Literal<["workspace"]>, Schema.Struct<{
2831
+ kind: Schema.Literal<["additionalScope"]>;
2832
+ glob: typeof Schema.String;
2833
+ }>, Schema.Struct<{
2834
+ kind: Schema.Literal<["versionFile"]>;
2835
+ glob: typeof Schema.String;
2836
+ }>, typeof Schema.Null]>;
2837
+ }>>;
2838
+ packagesAffected: Schema.Array$<typeof Schema.String>;
2839
+ unmappedFiles: Schema.Array$<typeof Schema.String>;
2840
+ }>;
2841
+ /** Structured result of analyzing the current branch against its base. @public */
2842
+ type BranchAnalysis = Schema.Schema.Type<typeof BranchAnalysisSchema>;
2852
2843
  /**
2853
2844
  * Effect service interface for branch analysis.
2854
2845
  *
@@ -5086,7 +5077,7 @@ declare const RequiredSectionsRule: import("unified-lint-rule").Plugin<Root, unk
5086
5077
  //#region src/changesets/remark/rules/uncategorized-content.d.ts
5087
5078
  declare const UncategorizedContentRule: import("unified-lint-rule").Plugin<Root, unknown>;
5088
5079
  declare namespace index_d_exports {
5089
- export { AggregateDependencyTablesPlugin, BranchAnalysis, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchAnalyzerShape, BranchFileEntry, Categories, Changelog, ChangelogService, ChangelogServiceBase, ChangelogServiceShape, ChangelogTransformer, Changeset, ChangesetLinter, ChangesetOptions, ChangesetOptionsSchema, ChangesetSchema, ChangesetSummarySchema, ChangesetValidationError, ChangesetValidationErrorBase, Classification, ClassificationReason, CommitHashSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, ConfigInspectorShape, ConfigurationError, ConfigurationErrorBase, ContentStructureRule, ContributorFootnotesPlugin, DeduplicateItemsPlugin, DependencyAction, DependencyActionSchema, DependencyTable, DependencyTableFormatRule, DependencyTableRow, DependencyTableRowSchema, DependencyTableSchema, DependencyTableType, DependencyTableTypeSchema, DependencyType, DependencyTypeSchema, DependencyUpdate, DependencyUpdateSchema, FileStatus, GitError, GitErrorBase, GitHubApiError, GitHubApiErrorBase, GitHubCommitInfo, GitHubInfo, GitHubInfoSchema, GitHubLive, GitHubService, GitHubServiceBase, GitHubServiceShape, GlobSchema, HeadingHierarchyRule, InspectedConfig, IssueLinkRefsPlugin, IssueNumberSchema, JsonPathSchema, LegacyVersionFileConfig, LegacyVersionFileConfigSchema, LegacyVersionFilesSchema, LintMessage, MarkdownLive, MarkdownParseError, MarkdownParseErrorBase, MarkdownService, MarkdownServiceBase, MarkdownServiceShape, ContentStructureRule$1 as MarkdownlintContentStructureRule, DependencyTableFormatRule$1 as MarkdownlintDependencyTableFormatRule, HeadingHierarchyRule$1 as MarkdownlintHeadingHierarchyRule, RequiredSectionsRule$1 as MarkdownlintRequiredSectionsRule, UncategorizedContentRule$1 as MarkdownlintUncategorizedContentRule, MergeSectionsPlugin, NonEmptyString, NormalizeFormatPlugin, PackageScope, PackageScopeSchema, PackagesRecordSchema, PositiveInteger, ReorderSectionsPlugin, RepoSchema, RequiredSectionsRule, ResolvedPackageScope, ResolvedVersionFile, SectionCategory, SectionCategorySchema, SilkChangesetPreset, SilkChangesetTransformPreset, SilkChangesetsRules, UncategorizedContentRule, UrlOrMarkdownLinkSchema, UsernameSchema, VersionFileConfig, VersionFileConfigSchema, VersionFileError, VersionFileErrorBase, VersionFileUpdate, VersionFiles, VersionFilesSchema, VersionOrEmptySchema, VersionType, VersionTypeSchema, WorkspaceDependencyDiff, WorkspaceSnapshot, WorkspaceSnapshotReader, WorkspaceSnapshotReaderBase, WorkspaceSnapshotReaderLive, WorkspaceSnapshotReaderShape, WorkspaceVersion, changelogFunctions, computeWorkspaceDependencyDiffs, gitMergeBase, listPublishablePackageNames, makeBranchAnalyzerTest, makeConfigInspectorTest, makeGitHubTest, serializeDependencyTableToMarkdown, snapshotFromWorktree };
5080
+ export { AggregateDependencyTablesPlugin, BranchAnalysis, BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchAnalyzerShape, BranchFileEntry, BranchFileEntrySchema, Categories, Changelog, ChangelogService, ChangelogServiceBase, ChangelogServiceShape, ChangelogTransformer, Changeset, ChangesetLinter, ChangesetOptions, ChangesetOptionsSchema, ChangesetSchema, ChangesetSummarySchema, ChangesetValidationError, ChangesetValidationErrorBase, Classification, ClassificationReason, ClassificationReasonSchema, ClassificationSchema, CommitHashSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, ConfigInspectorShape, ConfigurationError, ConfigurationErrorBase, ContentStructureRule, ContributorFootnotesPlugin, DeduplicateItemsPlugin, DependencyAction, DependencyActionSchema, DependencyTable, DependencyTableFormatRule, DependencyTableRow, DependencyTableRowSchema, DependencyTableSchema, DependencyTableType, DependencyTableTypeSchema, DependencyType, DependencyTypeSchema, DependencyUpdate, DependencyUpdateSchema, FileStatus, FileStatusSchema, GitError, GitErrorBase, GitHubApiError, GitHubApiErrorBase, GitHubCommitInfo, GitHubInfo, GitHubInfoSchema, GitHubLive, GitHubService, GitHubServiceBase, GitHubServiceShape, GlobSchema, HeadingHierarchyRule, InspectedConfig, InspectedConfigSchema, IssueLinkRefsPlugin, IssueNumberSchema, JsonPathSchema, LegacyVersionFileConfig, LegacyVersionFileConfigSchema, LegacyVersionFilesSchema, LintMessage, MarkdownLive, MarkdownParseError, MarkdownParseErrorBase, MarkdownService, MarkdownServiceBase, MarkdownServiceShape, ContentStructureRule$1 as MarkdownlintContentStructureRule, DependencyTableFormatRule$1 as MarkdownlintDependencyTableFormatRule, HeadingHierarchyRule$1 as MarkdownlintHeadingHierarchyRule, RequiredSectionsRule$1 as MarkdownlintRequiredSectionsRule, UncategorizedContentRule$1 as MarkdownlintUncategorizedContentRule, MergeSectionsPlugin, NonEmptyString, NormalizeFormatPlugin, PackageScope, PackageScopeSchema, PackagesRecordSchema, PositiveInteger, ReorderSectionsPlugin, RepoSchema, RequiredSectionsRule, ResolvedPackageScope, ResolvedPackageScopeSchema, ResolvedVersionFile, ResolvedVersionFileSchema, SectionCategory, SectionCategorySchema, SilkChangesetPreset, SilkChangesetTransformPreset, SilkChangesetsRules, UncategorizedContentRule, UrlOrMarkdownLinkSchema, UsernameSchema, VersionFileConfig, VersionFileConfigSchema, VersionFileError, VersionFileErrorBase, VersionFileUpdate, VersionFiles, VersionFilesSchema, VersionOrEmptySchema, VersionType, VersionTypeSchema, WorkspaceDependencyDiff, WorkspaceSnapshot, WorkspaceSnapshotReader, WorkspaceSnapshotReaderBase, WorkspaceSnapshotReaderLive, WorkspaceSnapshotReaderShape, WorkspaceVersion, changelogFunctions, computeWorkspaceDependencyDiffs, gitMergeBase, listPublishablePackageNames, makeBranchAnalyzerTest, makeConfigInspectorTest, makeGitHubTest, serializeDependencyTableToMarkdown, snapshotFromWorktree };
5090
5081
  }
5091
5082
  //#endregion
5092
5083
  //#region src/commitlint/config/schema.d.ts
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { ChangesetConfigError } from "./errors/ChangesetConfigError.js";
2
2
  import { ChangesetConfigReader, ChangesetConfigReaderLive } from "./services/ChangesetConfigReader.js";
3
+ import { ChangesetConfig, ChangesetConfigLive } from "./services/ChangesetConfig.js";
4
+ import { PublishabilityDetectorAdaptiveLive, SilkPublishability, SilkPublishabilityDetectorLive, readTargetsBinding } from "./services/SilkPublishability.js";
3
5
  import { changesets_exports } from "./changesets/index.js";
4
6
  import { commitlint_exports } from "./commitlint/index.js";
5
7
  import { BiomeSyncError } from "./errors/BiomeSyncError.js";
@@ -24,10 +26,8 @@ import { ResolvedTool } from "./schemas/ResolvedTool.js";
24
26
  import { ToolDefinition } from "./schemas/ToolDefinition.js";
25
27
  import { AnalyzedWorkspace, SilkPublishConfig, WorkspaceAnalysis } from "./schemas/WorkspaceAnalysisSchemas.js";
26
28
  import { BiomeSchemaSync, BiomeSchemaSyncLive, buildSchemaUrl, extractSemver } from "./services/BiomeSchemaSync.js";
27
- import { ChangesetConfig, ChangesetConfigLive } from "./services/ChangesetConfig.js";
28
29
  import { ConfigDiscovery, ConfigDiscoveryLive } from "./services/ConfigDiscovery.js";
29
30
  import { ManagedSection, ManagedSectionLive } from "./services/ManagedSection.js";
30
- import { PublishabilityDetectorAdaptiveLive, SilkPublishability, SilkPublishabilityDetectorLive, readTargetsBinding } from "./services/SilkPublishability.js";
31
31
  import { TagStrategy, TagStrategyLive } from "./services/TagStrategy.js";
32
32
  import { VersioningStrategy, VersioningStrategyLive } from "./services/VersioningStrategy.js";
33
33
  import { SilkWorkspaceAnalyzer, SilkWorkspaceAnalyzerLive } from "./services/SilkWorkspaceAnalyzer.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/silk-effects",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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",
@@ -24,25 +24,26 @@
24
24
  ".": {
25
25
  "types": "./index.d.ts",
26
26
  "import": "./index.js"
27
- }
27
+ },
28
+ "./package.json": "./package.json"
28
29
  },
29
30
  "dependencies": {
30
31
  "@changesets/get-github-info": "^0.8.0",
31
32
  "jsonc-effect": "^0.2.1",
32
33
  "mdast-util-heading-range": "^4.0.0",
33
34
  "mdast-util-to-string": "^4.0.0",
34
- "prettier": "^3.8.3",
35
+ "prettier": "^3.8.4",
35
36
  "remark-gfm": "^4.0.1",
36
37
  "remark-parse": "^11.0.0",
37
38
  "remark-stringify": "^11.0.0",
38
39
  "semver-effect": "^0.2.1",
39
40
  "shell-quote": "^1.8.4",
40
- "sort-package-json": "^3.6.1",
41
- "tinyglobby": "^0.2.16",
41
+ "sort-package-json": "^4.0.0",
42
+ "tinyglobby": "^0.2.17",
42
43
  "unified": "^11.0.5",
43
44
  "unified-lint-rule": "^3.0.1",
44
45
  "unist-util-visit": "^5.1.0",
45
- "workspaces-effect": "^1.1.0",
46
+ "workspaces-effect": "^1.2.0",
46
47
  "yaml": "^2.9.0",
47
48
  "yaml-effect": "^0.6.0",
48
49
  "yaml-lint": "^1.7.0"
@@ -1,8 +1,8 @@
1
1
  import { ChangesetConfig } from "./ChangesetConfig.js";
2
2
  import { Effect, Layer } from "effect";
3
3
  import { isAbsolute, join } from "node:path";
4
- import { PublishTarget, PublishabilityDetector, PublishabilityDetectorLive, WorkspaceDiscovery } from "workspaces-effect";
5
4
  import { FileSystem } from "@effect/platform";
5
+ import { PublishTarget, PublishabilityDetector, PublishabilityDetectorLive, WorkspaceDiscovery } from "workspaces-effect";
6
6
 
7
7
  //#region src/services/SilkPublishability.ts
8
8
  const NPM_DEFAULT = "https://registry.npmjs.org/";
@@ -1,13 +1,13 @@
1
1
  import { ChangesetConfigReader } from "./ChangesetConfigReader.js";
2
- import { WorkspaceAnalysisError } from "../errors/WorkspaceAnalysisError.js";
3
- import { AnalyzedWorkspace, WorkspaceAnalysis } from "../schemas/WorkspaceAnalysisSchemas.js";
4
2
  import { ChangesetConfig } from "./ChangesetConfig.js";
5
3
  import { SilkPublishability, readTargetsBinding } from "./SilkPublishability.js";
4
+ import { WorkspaceAnalysisError } from "../errors/WorkspaceAnalysisError.js";
5
+ import { AnalyzedWorkspace, WorkspaceAnalysis } from "../schemas/WorkspaceAnalysisSchemas.js";
6
6
  import { TagStrategy } from "./TagStrategy.js";
7
7
  import { VersioningStrategy } from "./VersioningStrategy.js";
8
8
  import { Context, Effect, Layer, Option } from "effect";
9
- import { PackageManagerDetector, TopologicalSorter, WorkspaceDiscovery } from "workspaces-effect";
10
9
  import { FileSystem } from "@effect/platform";
10
+ import { PackageManagerDetector, TopologicalSorter, WorkspaceDiscovery } from "workspaces-effect";
11
11
 
12
12
  //#region src/services/SilkWorkspaceAnalyzer.ts
13
13
  /**
@@ -2,8 +2,8 @@ import { ToolNotFoundError } from "../errors/ToolNotFoundError.js";
2
2
  import { ToolResolutionError } from "../errors/ToolResolutionError.js";
3
3
  import { ResolvedTool } from "../schemas/ResolvedTool.js";
4
4
  import { Context, Effect, Layer, Option, Ref } from "effect";
5
- import { PackageManagerDetector, WorkspaceRoot } from "workspaces-effect";
6
5
  import { Command, CommandExecutor } from "@effect/platform";
6
+ import { PackageManagerDetector, WorkspaceRoot } from "workspaces-effect";
7
7
 
8
8
  //#region src/services/ToolDiscovery.ts
9
9
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.58.7"
8
+ "packageVersion": "7.58.8"
9
9
  }
10
10
  ]
11
11
  }