@savvy-web/silk-effects 9.5.5 → 10.0.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.
Files changed (158) hide show
  1. package/_virtual/_rolldown/runtime.js +1 -2
  2. package/changesets/api/categories.js +1 -2
  3. package/changesets/api/changelog.js +1 -2
  4. package/changesets/api/dependency-table.js +13 -14
  5. package/changesets/api/linter.js +24 -21
  6. package/changesets/api/transformer.js +39 -35
  7. package/changesets/categories/index.js +2 -3
  8. package/changesets/categories/types.js +3 -4
  9. package/changesets/changelog/formatting.js +1 -2
  10. package/changesets/changelog/getDependencyReleaseLine.js +2 -3
  11. package/changesets/changelog/getReleaseLine.js +1 -2
  12. package/changesets/changelog/index.js +3 -4
  13. package/changesets/changelog/vanilla.js +1 -2
  14. package/changesets/constants.js +2 -3
  15. package/changesets/errors.js +2 -3
  16. package/changesets/index.js +12 -42
  17. package/changesets/markdownlint/index.js +1 -2
  18. package/changesets/markdownlint/rules/content-structure.js +3 -4
  19. package/changesets/markdownlint/rules/dependency-table-format.js +1 -2
  20. package/changesets/markdownlint/rules/heading-hierarchy.js +3 -4
  21. package/changesets/markdownlint/rules/required-sections.js +3 -4
  22. package/changesets/markdownlint/rules/uncategorized-content.js +3 -4
  23. package/changesets/markdownlint/rules/utils.js +7 -8
  24. package/changesets/rules/content-structure.js +44 -0
  25. package/changesets/rules/dependency-table-format.js +54 -0
  26. package/changesets/rules/heading-hierarchy.js +37 -0
  27. package/changesets/rules/required-sections.js +34 -0
  28. package/changesets/rules/types.js +20 -0
  29. package/changesets/rules/uncategorized-content.js +30 -0
  30. package/changesets/schemas/changeset.js +2 -3
  31. package/changesets/schemas/dependency-table.js +1 -2
  32. package/changesets/schemas/deps-regen.js +1 -2
  33. package/changesets/schemas/git.js +1 -2
  34. package/changesets/schemas/github.js +1 -2
  35. package/changesets/schemas/options.js +1 -2
  36. package/changesets/schemas/package-scope.js +1 -2
  37. package/changesets/schemas/primitives.js +1 -2
  38. package/changesets/schemas/release-plan.js +1 -2
  39. package/changesets/schemas/version-files.js +1 -2
  40. package/changesets/services/branch-analyzer.js +1 -2
  41. package/changesets/services/changelog.js +1 -2
  42. package/changesets/services/config-inspector.js +1 -2
  43. package/changesets/services/deps-regen.js +1 -2
  44. package/changesets/services/github.js +1 -2
  45. package/changesets/services/maintenance-reason.js +1 -2
  46. package/changesets/services/release-planner.js +1 -2
  47. package/changesets/transforms/aggregate-dependency-tables.js +96 -0
  48. package/changesets/transforms/contributor-footnotes.js +290 -0
  49. package/changesets/transforms/deduplicate-items.js +47 -0
  50. package/changesets/transforms/issue-link-refs.js +47 -0
  51. package/changesets/transforms/maintenance-note.js +65 -0
  52. package/changesets/transforms/merge-sections.js +56 -0
  53. package/changesets/transforms/normalize-format.js +53 -0
  54. package/changesets/transforms/reorder-sections.js +53 -0
  55. package/changesets/utils/blocks.js +67 -0
  56. package/changesets/utils/commit-parser.js +1 -2
  57. package/changesets/utils/dep-diff.js +1 -2
  58. package/changesets/utils/dependency-section.js +1 -2
  59. package/changesets/utils/dependency-table.js +30 -38
  60. package/changesets/utils/git.js +1 -2
  61. package/changesets/utils/issue-refs.js +1 -2
  62. package/changesets/utils/jsonpath.js +1 -2
  63. package/changesets/utils/logger.js +1 -2
  64. package/changesets/utils/markdown-emit.js +12 -38
  65. package/changesets/utils/markdown-link.js +1 -2
  66. package/changesets/utils/publishability.js +1 -2
  67. package/changesets/utils/section-parser.js +1 -2
  68. package/changesets/utils/strip-frontmatter.js +1 -2
  69. package/changesets/utils/version-files.js +1 -2
  70. package/changesets/vendor/github-info.js +1 -2
  71. package/commitlint/config/factory.js +1 -2
  72. package/commitlint/config/plugins.js +1 -2
  73. package/commitlint/config/rules.js +1 -2
  74. package/commitlint/config/schema.js +1 -2
  75. package/commitlint/detection/dco.js +1 -2
  76. package/commitlint/detection/scopes.js +1 -2
  77. package/commitlint/formatter/format.js +1 -2
  78. package/commitlint/formatter/messages.js +1 -2
  79. package/commitlint/hook/diagnostics/branch.js +1 -2
  80. package/commitlint/hook/diagnostics/cache.js +1 -2
  81. package/commitlint/hook/diagnostics/commitlint-config.js +1 -2
  82. package/commitlint/hook/diagnostics/open-issues.js +1 -2
  83. package/commitlint/hook/diagnostics/package-manager.js +1 -2
  84. package/commitlint/hook/diagnostics/signing.js +1 -2
  85. package/commitlint/hook/envelope.js +1 -2
  86. package/commitlint/hook/output.js +1 -2
  87. package/commitlint/hook/parse-bash-command.js +1 -2
  88. package/commitlint/hook/rules/closes-trailer.js +1 -2
  89. package/commitlint/hook/rules/forbidden-content.js +1 -2
  90. package/commitlint/hook/rules/plan-leakage.js +1 -2
  91. package/commitlint/hook/rules/signing-flag-conflict.js +1 -2
  92. package/commitlint/hook/rules/soft-wrap.js +1 -2
  93. package/commitlint/hook/rules/types.js +1 -2
  94. package/commitlint/hook/rules/verbosity.js +1 -2
  95. package/commitlint/hook/silence-logger.js +1 -2
  96. package/commitlint/index.js +1 -2
  97. package/commitlint/prompt/config.js +1 -2
  98. package/commitlint/prompt/emojis.js +1 -2
  99. package/commitlint/prompt/prompter.js +1 -2
  100. package/commitlint/static.js +1 -2
  101. package/index.d.ts +141 -1450
  102. package/index.js +2 -2
  103. package/lint/Handler.js +1 -2
  104. package/lint/cli/sections.js +1 -2
  105. package/lint/cli/templates/markdownlint.gen.js +1 -2
  106. package/lint/config/Preset.js +1 -2
  107. package/lint/config/createConfig.js +1 -2
  108. package/lint/handlers/Biome.js +1 -2
  109. package/lint/handlers/Markdown.js +1 -2
  110. package/lint/handlers/PackageJson.js +1 -2
  111. package/lint/handlers/PnpmWorkspace.js +1 -2
  112. package/lint/handlers/ShellScripts.js +1 -2
  113. package/lint/handlers/TextFiles.js +1 -2
  114. package/lint/handlers/TypeScript.js +1 -2
  115. package/lint/handlers/Yaml.js +1 -2
  116. package/lint/index.js +1 -2
  117. package/lint/utils/Command.js +1 -2
  118. package/lint/utils/Filter.js +1 -2
  119. package/lint/utils/Workspace.js +1 -2
  120. package/package.json +15 -22
  121. package/repos/constants.js +1 -2
  122. package/repos/errors.js +1 -2
  123. package/repos/index.js +1 -2
  124. package/repos/schemas/drift.js +1 -2
  125. package/repos/schemas/manifest.js +1 -2
  126. package/repos/schemas/reports.js +1 -2
  127. package/repos/services/config-store.js +1 -2
  128. package/repos/services/drift.js +1 -2
  129. package/repos/services/lockdown.js +1 -2
  130. package/repos/services/manager.js +1 -2
  131. package/services/BiomeSchemaSync.js +1 -2
  132. package/services/ChangesetConfig.js +1 -2
  133. package/services/ChangesetConfigReader.js +1 -2
  134. package/services/ConfigDiscovery.js +1 -2
  135. package/services/SilkPublishability.js +147 -6
  136. package/services/SilkWorkspaceAnalyzer.js +1 -2
  137. package/turbo/digest.js +1 -2
  138. package/turbo/errors.js +1 -2
  139. package/turbo/index.js +1 -2
  140. package/turbo/schemas/DryRun.js +1 -2
  141. package/turbo/schemas/results.js +1 -2
  142. package/turbo/services/TurboInspector.js +1 -2
  143. package/changesets/remark/plugins/aggregate-dependency-tables.js +0 -99
  144. package/changesets/remark/plugins/contributor-footnotes.js +0 -335
  145. package/changesets/remark/plugins/deduplicate-items.js +0 -32
  146. package/changesets/remark/plugins/issue-link-refs.js +0 -58
  147. package/changesets/remark/plugins/maintenance-note.js +0 -75
  148. package/changesets/remark/plugins/merge-sections.js +0 -43
  149. package/changesets/remark/plugins/normalize-format.js +0 -47
  150. package/changesets/remark/plugins/reorder-sections.js +0 -49
  151. package/changesets/remark/presets.js +0 -119
  152. package/changesets/remark/rules/content-structure.js +0 -22
  153. package/changesets/remark/rules/dependency-table-format.js +0 -38
  154. package/changesets/remark/rules/heading-hierarchy.js +0 -19
  155. package/changesets/remark/rules/required-sections.js +0 -17
  156. package/changesets/remark/rules/uncategorized-content.js +0 -31
  157. package/changesets/utils/remark-pipeline.js +0 -36
  158. package/changesets/utils/version-blocks.js +0 -108
@@ -1,10 +1,10 @@
1
1
  import { ChangesetConfig } from "./ChangesetConfig.js";
2
- import { PublishTargetBindingError, trimTrailingSlashes } from "@savvy-web/silk-core";
2
+ import { PublishTargetBindingError, ReleaseChannelError, trimTrailingSlashes } from "@savvy-web/silk-core";
3
3
  import { Effect, FileSystem, Layer } from "effect";
4
4
  import { isAbsolute, join, relative } from "node:path";
5
5
  import { PublishTarget, PublishabilityDetector, WorkspaceDiscovery } from "@effected/workspaces";
6
6
 
7
- //#region src/services/SilkPublishability.ts
7
+ // src/services/SilkPublishability.ts
8
8
  const NPM_DEFAULT = "https://registry.npmjs.org/";
9
9
  /**
10
10
  * Default registry endpoints for the well-known target keys. Kept in sync with the
@@ -79,17 +79,18 @@ var SilkPublishability = class SilkPublishability {
79
79
  registry: t.registry,
80
80
  directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
81
81
  access,
82
- provenance: provenanceForRegistry(t.registry)
82
+ provenance: t.provenance ?? declaredProvenanceOf(targets, t.id) ?? provenanceForRegistry(t.registry)
83
83
  }));
84
84
  }
85
85
  return Object.entries(targets).map(([id, target]) => {
86
- const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
86
+ const object = typeof target === "object" && target !== null ? target : void 0;
87
+ const registry = typeof object?.registry === "string" ? object.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
87
88
  return new PublishTarget({
88
89
  name: pkgName,
89
90
  registry,
90
91
  directory: `dist/prod/${id}/pkg`,
91
92
  access,
92
- provenance: provenanceForRegistry(registry)
93
+ provenance: typeof object?.provenance === "boolean" ? object.provenance : provenanceForRegistry(registry)
93
94
  });
94
95
  });
95
96
  }
@@ -157,6 +158,81 @@ var SilkPublishability = class SilkPublishability {
157
158
  });
158
159
  }
159
160
  /**
161
+ * True when a version carries a SemVer prerelease suffix (`1.2.0-rc.1`). Build metadata is ignored.
162
+ */
163
+ static isPrerelease(version) {
164
+ return prereleaseOf(version) !== void 0;
165
+ }
166
+ /**
167
+ * The npm dist-tag a version publishes under.
168
+ *
169
+ * @remarks
170
+ * A final version is `latest`. A prerelease takes its first prerelease identifier (`beta` for
171
+ * `2.0.0-beta.3`, `rc` for `2.0.0-rc.1`), or `next` when that identifier is empty or would
172
+ * parse as a SemVer range (`2.0.0-0`, `2.0.0-x.1`, `2.0.0-v2.1`), since npm rejects such a
173
+ * dist-tag. A `latest` identifier (`2.0.0-latest.1`) also takes `next`, so a prerelease never
174
+ * becomes the version a bare install resolves. The range check is `v*` followed by digits or a
175
+ * lone `x`/`X`, matching what `semver.validRange` accepts for a prerelease identifier.
176
+ */
177
+ static distTagFor(version) {
178
+ const prerelease = prereleaseOf(version);
179
+ if (prerelease === void 0) return "latest";
180
+ const first = prerelease.split(".")[0] ?? "";
181
+ return first === "" || first === "latest" || /^v*(?:\d+|[xX])$/.test(first) ? "next" : first;
182
+ }
183
+ /** Whether a target with this {@link ReleaseChannel} receives the given version. */
184
+ static receives(releases, version) {
185
+ if (releases === "all") return true;
186
+ return SilkPublishability.isPrerelease(version) === (releases === "prerelease");
187
+ }
188
+ /**
189
+ * Every resolved publish target judged against a specific version: {@link SilkPublishability.resolveTargets},
190
+ * each paired with its target key, its `releases` filter, whether it `receives` the version, and the dist-tag.
191
+ *
192
+ * @remarks
193
+ * A strict superset of `resolveTargets`, which it calls first, so the private-directory filter
194
+ * and the `PublishTargetBindingError` integrity check apply unchanged. The release filter runs
195
+ * here rather than in the `PublishabilityDetector` layer because the kit's
196
+ * `VersioningStrategy.detect` counts publishable packages through the detector, and a package
197
+ * whose only target skips this version is still a publishable package.
198
+ *
199
+ * Each detected target is joined back to its declaration: through `dist/prod/targets.json` by
200
+ * group directory and registry after the prod build, or by its placeholder directory
201
+ * (`dist/prod/<id>/pkg`) against `publishConfig.targets` before it. A binding entry with no
202
+ * `releases` (written by a bundler older than the field) takes the filter declared on
203
+ * `publishConfig.targets[id]`, so upgrading the publisher before the bundler never widens it. A target with no keyed
204
+ * declaration (the `access`/`private` fallbacks) has no filter and receives every version.
205
+ * Filtered targets are returned with `receives: false`, never dropped, so a publisher reports the
206
+ * skip from the same join it publishes from. A result with no `receives: true` entry means this
207
+ * version publishes nowhere, which is not an error. A declared `releases` that is not a known
208
+ * channel fails with `ReleaseChannelError` rather than defaulting, since both sources are
209
+ * read from disk and may have been edited by hand.
210
+ */
211
+ static resolveReleaseTargets(pkg, version) {
212
+ return Effect.gen(function* () {
213
+ const targets = yield* SilkPublishability.resolveTargets(pkg, pkg.workspaceRoot);
214
+ const fs = yield* FileSystem.FileSystem;
215
+ const binding = yield* readTargetsBinding(fs, pkg.path);
216
+ const declared = (yield* readRaw(fs, pkg.packageJsonPath))?.publishConfig?.targets;
217
+ const join = binding !== null ? joinByBinding(binding) : joinByPlaceholder(declared);
218
+ const distTag = SilkPublishability.distTagFor(version);
219
+ const out = [];
220
+ for (const target of targets) {
221
+ const joined = join(normalizeDir(isAbsolute(target.directory) ? relative(pkg.path, target.directory) : target.directory), target.registry);
222
+ const id = joined.id;
223
+ const releases = yield* releaseChannelOf(pkg.name, id, joined.releases ?? declaredReleasesOf(declared, id));
224
+ out.push({
225
+ target,
226
+ id,
227
+ releases,
228
+ receives: SilkPublishability.receives(releases, version),
229
+ distTag
230
+ });
231
+ }
232
+ return out;
233
+ });
234
+ }
235
+ /**
160
236
  * The publishable, non-ignored packages, resolved through the single
161
237
  * {@link SilkPublishability} (which already honors changeset ignore in adaptive mode).
162
238
  */
@@ -248,6 +324,72 @@ const normalizeDir = (dir) => {
248
324
  const normalized = trimTrailingSlashes(withoutPrefix);
249
325
  return normalized === "" ? "." : normalized;
250
326
  };
327
+ /** The prerelease part of a version (after the first `-`, before any `+build`), or `undefined` for a final version. */
328
+ const prereleaseOf = (version) => {
329
+ const plus = version.indexOf("+");
330
+ const core = plus === -1 ? version : version.slice(0, plus);
331
+ const dash = core.indexOf("-");
332
+ return dash === -1 ? void 0 : core.slice(dash + 1);
333
+ };
334
+ const RELEASE_CHANNELS = [
335
+ "all",
336
+ "stable",
337
+ "prerelease"
338
+ ];
339
+ /** An absent `releases` is `"all"`; a present one must be a known channel. */
340
+ const releaseChannelOf = (pkg, id, releases) => {
341
+ if (releases === void 0) return Effect.succeed("all");
342
+ if (RELEASE_CHANNELS.includes(releases)) return Effect.succeed(releases);
343
+ return Effect.fail(new ReleaseChannelError({
344
+ pkg,
345
+ id: id ?? "(unkeyed)",
346
+ value: JSON.stringify(releases) ?? String(releases)
347
+ }));
348
+ };
349
+ /**
350
+ * Join detected targets to the binding by group directory and registry. Each binding target is
351
+ * consumed once, so two keys sharing a group and a registry still map one-to-one in order.
352
+ */
353
+ const joinByBinding = (binding) => {
354
+ const dirByGroup = new Map(binding.groups.map((g) => [g.id, normalizeDir(g.dir)]));
355
+ const remaining = [...binding.targets];
356
+ return (relativeDir, registry) => {
357
+ const index = remaining.findIndex((t) => t.registry === registry && (dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`) === relativeDir);
358
+ if (index === -1) return {
359
+ id: void 0,
360
+ releases: void 0
361
+ };
362
+ const [match] = remaining.splice(index, 1);
363
+ return {
364
+ id: match?.id,
365
+ releases: match?.releases
366
+ };
367
+ };
368
+ };
369
+ /** Pre-build join: a placeholder target sits at `dist/prod/<id>/pkg`, so read its declaration by key. */
370
+ const joinByPlaceholder = (declared) => (relativeDir) => {
371
+ const id = /^dist\/prod\/([^/]+)\/pkg$/.exec(relativeDir)?.[1];
372
+ if (id === void 0 || declared === void 0 || !Object.hasOwn(declared, id)) return {
373
+ id: void 0,
374
+ releases: void 0
375
+ };
376
+ return {
377
+ id,
378
+ releases: declaredReleasesOf(declared, id)
379
+ };
380
+ };
381
+ /** The `releases` declared on `publishConfig.targets[id]`, or `undefined` when there is none. */
382
+ const declaredReleasesOf = (declared, id) => {
383
+ if (id === void 0 || declared === void 0 || !Object.hasOwn(declared, id)) return void 0;
384
+ const value = declared[id];
385
+ return typeof value === "object" && value !== null ? value.releases : void 0;
386
+ };
387
+ /** The boolean `provenance` declared on `publishConfig.targets[id]`, or `undefined` when there is none. */
388
+ const declaredProvenanceOf = (declared, id) => {
389
+ if (declared === void 0 || !Object.hasOwn(declared, id)) return void 0;
390
+ const value = declared[id];
391
+ return typeof value === "object" && value !== null && typeof value.provenance === "boolean" ? value.provenance : void 0;
392
+ };
251
393
  /** True when a built target directory's package.json is `private: true`. Missing/unreadable/malformed → false. */
252
394
  const isTargetPrivate = (fs, targetDir) => fs.readFileString(join(targetDir, "package.json")).pipe(Effect.flatMap((content) => Effect.try({
253
395
  try: () => JSON.parse(content).private === true,
@@ -276,5 +418,4 @@ const readTargetsBinding = (fs, pkgPath) => fs.readFileString(join(pkgPath, "dis
276
418
  catch: () => /* @__PURE__ */ new Error("invalid targets.json")
277
419
  })), Effect.orElseSucceed(() => null));
278
420
 
279
- //#endregion
280
421
  export { SilkPublishability, readTargetsBinding };
@@ -5,7 +5,7 @@ import { AnalyzedWorkspace, WorkspaceAnalysis, WorkspaceAnalysisError } from "@s
5
5
  import { Context, Effect, FileSystem, Layer, Option } from "effect";
6
6
  import { DependencyGraph, PackageManagerDetector, VersioningStrategy, WorkspaceDiscovery } from "@effected/workspaces";
7
7
 
8
- //#region src/services/SilkWorkspaceAnalyzer.ts
8
+ // src/services/SilkWorkspaceAnalyzer.ts
9
9
  /**
10
10
  * Service that performs a full workspace analysis — discovering packages,
11
11
  * detecting publishability, computing versioning/tag strategies, and
@@ -206,5 +206,4 @@ function computeReleaseStatus(pkgName, isPrivate, isPublishable, config) {
206
206
  };
207
207
  }
208
208
 
209
- //#endregion
210
209
  export { SilkWorkspaceAnalyzer };
package/turbo/digest.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/turbo/digest.ts
1
+ // src/turbo/digest.ts
2
2
  /**
3
3
  * Pure transforms from decoded turbo dry-run JSON to digested result shapes.
4
4
  * No dependency injection — directly unit-testable.
@@ -123,5 +123,4 @@ var TurboDigest = class TurboDigest {
123
123
  }
124
124
  };
125
125
 
126
- //#endregion
127
126
  export { TurboDigest };
package/turbo/errors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Data } from "effect";
2
2
 
3
- //#region src/turbo/errors.ts
3
+ // src/turbo/errors.ts
4
4
  /**
5
5
  * Raised when the turbo CLI cannot be resolved or executed.
6
6
  *
@@ -44,5 +44,4 @@ var TurboExecError = class extends Data.TaggedError("TurboExecError") {
44
44
  }
45
45
  };
46
46
 
47
- //#endregion
48
47
  export { DryRunParseError, NotATurboRepoError, TurboExecError, TurboNotInstalledError };
package/turbo/index.js CHANGED
@@ -5,7 +5,7 @@ import { TurboCache, TurboDryRun, TurboDryTask, TurboEnvVars, TurboGlobalCacheIn
5
5
  import { AffectedResult, CacheDiagnosis, GlobalHashSummary, GraphNode, MissExplanation, PackageCacheStatus, TaskGraphResult } from "./schemas/results.js";
6
6
  import { TurboInspector } from "./services/TurboInspector.js";
7
7
 
8
- //#region src/turbo/index.ts
8
+ // src/turbo/index.ts
9
9
  var turbo_exports = /* @__PURE__ */ __exportAll({
10
10
  AffectedResult: () => AffectedResult,
11
11
  CacheDiagnosis: () => CacheDiagnosis,
@@ -27,5 +27,4 @@ var turbo_exports = /* @__PURE__ */ __exportAll({
27
27
  TurboNotInstalledError: () => TurboNotInstalledError
28
28
  });
29
29
 
30
- //#endregion
31
30
  export { AffectedResult, CacheDiagnosis, DryRunParseError, GlobalHashSummary, GraphNode, MissExplanation, NotATurboRepoError, PackageCacheStatus, TaskGraphResult, TurboCache, TurboDigest, TurboDryRun, TurboDryTask, TurboEnvVars, TurboExecError, TurboGlobalCacheInputs, TurboInspector, TurboNotInstalledError, turbo_exports };
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
- //#region src/turbo/schemas/DryRun.ts
3
+ // src/turbo/schemas/DryRun.ts
4
4
  /** turbo's per-target cache descriptor in `--dry=json`. */
5
5
  const TurboCache = Schema.Struct({
6
6
  local: Schema.Boolean,
@@ -47,5 +47,4 @@ const TurboDryRun = Schema.Struct({
47
47
  tasks: Schema.Array(TurboDryTask)
48
48
  }).annotate({ identifier: "TurboDryRun" });
49
49
 
50
- //#endregion
51
50
  export { TurboCache, TurboDryRun, TurboDryTask, TurboEnvVars, TurboGlobalCacheInputs };
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
- //#region src/turbo/schemas/results.ts
3
+ // src/turbo/schemas/results.ts
4
4
  /** Per-package cache outcome for one task. */
5
5
  const PackageCacheStatus = Schema.Struct({
6
6
  package: Schema.String,
@@ -57,5 +57,4 @@ const AffectedResult = Schema.Struct({
57
57
  dependents: Schema.Array(Schema.String)
58
58
  }).annotate({ identifier: "AffectedResult" });
59
59
 
60
- //#endregion
61
60
  export { AffectedResult, CacheDiagnosis, GlobalHashSummary, GraphNode, MissExplanation, PackageCacheStatus, TaskGraphResult };
@@ -6,7 +6,7 @@ import { Git } from "@effected/git";
6
6
  import { ChildProcess, ChildProcessSpawner } from "effect/process";
7
7
  import { Run, Tool, ToolDiscovery } from "@effected/commands";
8
8
 
9
- //#region src/turbo/services/TurboInspector.ts
9
+ // src/turbo/services/TurboInspector.ts
10
10
  /**
11
11
  * Read-only Turborepo inspector. All operations use `--dry` and never execute tasks.
12
12
  * Surfaced through the MCP `turbo_inspect` tool.
@@ -104,5 +104,4 @@ const DEFAULT_BUILD_TASK = "build:dev";
104
104
  /** Default git ref `affected` compares against — matches Turborepo's own `--affected` default. */
105
105
  const DEFAULT_AFFECTED_BASE = "main";
106
106
 
107
- //#endregion
108
107
  export { TurboInspector };
@@ -1,99 +0,0 @@
1
- import { collapseDependencyRows, parseDependencyTable, serializeDependencyTable, sortDependencyRows } from "../../utils/dependency-table.js";
2
- import { getBlockSections, getHeadingText, getVersionBlocks } from "../../utils/version-blocks.js";
3
-
4
- //#region src/changesets/remark/plugins/aggregate-dependency-tables.ts
5
- /**
6
- * Unwrap dependency tables that an earlier (broken) formatter nested inside
7
- * list items.
8
- *
9
- * @remarks
10
- * Historical CHANGELOG blocks (e.g. silk\@3.10.0) carry an authored
11
- * dependency table bullet-wrapped into a list item, which the aggregation
12
- * pass otherwise cannot recognize. Each list item's tables that parse as
13
- * dependency tables contribute their rows; ONLY those tables leave the
14
- * list. The non-table items (e.g. an explanatory bullet alongside the
15
- * wrapped table) keep their bullet structure: they survive as a List node
16
- * in the legacy content rather than being flattened to bare paragraphs.
17
- * When no table in the list parses, the caller keeps the whole list as
18
- * legacy content untouched.
19
- *
20
- * @param list - A list node found inside a `### Dependencies` section
21
- * @returns Parsed rows plus the remaining non-table content (a pruned copy
22
- * of the list, when any items survive)
23
- *
24
- * @internal
25
- */
26
- function extractTablesFromList(list) {
27
- const rows = [];
28
- const keptItems = [];
29
- for (const item of list.children) {
30
- const keptChildren = [];
31
- for (const child of item.children) {
32
- if (child.type === "table") try {
33
- rows.push(...parseDependencyTable(child));
34
- continue;
35
- } catch {}
36
- keptChildren.push(child);
37
- }
38
- if (keptChildren.length > 0) keptItems.push({
39
- ...item,
40
- children: keptChildren
41
- });
42
- }
43
- return {
44
- rows,
45
- rest: keptItems.length > 0 ? [{
46
- ...list,
47
- children: keptItems
48
- }] : []
49
- };
50
- }
51
- const AggregateDependencyTablesPlugin = () => {
52
- return (tree) => {
53
- const blocks = getVersionBlocks(tree);
54
- for (let b = blocks.length - 1; b >= 0; b--) {
55
- const depSections = getBlockSections(tree, blocks[b]).filter((s) => getHeadingText(s.heading).toLowerCase() === "dependencies");
56
- if (depSections.length === 0) continue;
57
- const allRows = [];
58
- const legacyContent = [];
59
- for (const section of depSections) for (const node of section.contentNodes) if (node.type === "table") try {
60
- const rows = parseDependencyTable(node);
61
- allRows.push(...rows);
62
- } catch {
63
- legacyContent.push(node);
64
- }
65
- else if (node.type === "list") {
66
- const extracted = extractTablesFromList(node);
67
- if (extracted.rows.length > 0) {
68
- allRows.push(...extracted.rows);
69
- legacyContent.push(...extracted.rest);
70
- } else legacyContent.push(node);
71
- } else legacyContent.push(node);
72
- const collapsed = sortDependencyRows(collapseDependencyRows(allRows));
73
- const indicesToRemove = [];
74
- for (const section of depSections) {
75
- indicesToRemove.push(section.headingIndex);
76
- for (let c = 0; c < section.contentNodes.length; c++) indicesToRemove.push(section.headingIndex + 1 + c);
77
- }
78
- indicesToRemove.sort((a, b) => b - a);
79
- for (const idx of indicesToRemove) tree.children.splice(idx, 1);
80
- if (collapsed.length === 0 && legacyContent.length === 0) continue;
81
- const insertAt = depSections[0].headingIndex;
82
- const newNodes = [];
83
- newNodes.push({
84
- type: "heading",
85
- depth: 3,
86
- children: [{
87
- type: "text",
88
- value: "Dependencies"
89
- }]
90
- });
91
- if (collapsed.length > 0) newNodes.push(serializeDependencyTable(collapsed));
92
- newNodes.push(...legacyContent);
93
- tree.children.splice(insertAt, 0, ...newNodes);
94
- }
95
- };
96
- };
97
-
98
- //#endregion
99
- export { AggregateDependencyTablesPlugin };