@r_masseater/msch 0.42.0 → 0.48.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 (71) hide show
  1. package/README.md +11 -9
  2. package/dist/cargo-inputs.d.mts +1 -0
  3. package/dist/cargo-inputs.mjs +149 -94
  4. package/dist/cargo-inputs.mjs.map +1 -1
  5. package/dist/changed.d.mts +1 -0
  6. package/dist/changed.mjs +178 -0
  7. package/dist/changed.mjs.map +1 -0
  8. package/dist/check-upstream-exits-BJNhgkLI.mjs +499 -0
  9. package/dist/check-upstream-exits-BJNhgkLI.mjs.map +1 -0
  10. package/dist/cli-contract-D7btWrEu.mjs +5 -0
  11. package/dist/cli-contract-D7btWrEu.mjs.map +1 -0
  12. package/dist/cli.mjs +865 -1070
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/{comment-directives-5-f_qs1E.mjs → comment-directives-CRAU6yNZ.mjs} +2 -1
  15. package/dist/comment-directives-CRAU6yNZ.mjs.map +1 -0
  16. package/dist/config.d.mts +3 -1
  17. package/dist/config.mjs +23 -9
  18. package/dist/config.mjs.map +1 -1
  19. package/dist/decision-rules.d.mts +1 -1
  20. package/dist/decision-rules.mjs +1 -1
  21. package/dist/{define-lint-preset-DKJku2ZR.mjs → define-lint-preset-BhT4RpHs.mjs} +16 -25
  22. package/dist/define-lint-preset-BhT4RpHs.mjs.map +1 -0
  23. package/dist/{package-vbK0Qycn.mjs → dependencies-v59cxwTD.mjs} +186 -165
  24. package/dist/dependencies-v59cxwTD.mjs.map +1 -0
  25. package/dist/exits.d.mts +1 -0
  26. package/dist/exits.mjs +58 -0
  27. package/dist/exits.mjs.map +1 -0
  28. package/dist/{ignored-directories-CfACwIvu.mjs → ignored-directories-thSB0IAT.mjs} +13 -6
  29. package/dist/ignored-directories-thSB0IAT.mjs.map +1 -0
  30. package/dist/{index-BwiAHe_u.d.mts → index-DL7PSp7j.d.mts} +3 -3
  31. package/dist/lint.d.mts +1 -1
  32. package/dist/lint.mjs +1 -1
  33. package/dist/locked-closure-paths-Dtqs8uBU.mjs +7 -0
  34. package/dist/locked-closure-paths-Dtqs8uBU.mjs.map +1 -0
  35. package/dist/locked-inputs.d.mts +12 -0
  36. package/dist/locked-inputs.mjs +20 -0
  37. package/dist/locked-inputs.mjs.map +1 -0
  38. package/dist/oxlint.mjs +3 -1
  39. package/dist/oxlint.mjs.map +1 -1
  40. package/dist/package-Bdv6W97F.mjs +144 -0
  41. package/dist/package-Bdv6W97F.mjs.map +1 -0
  42. package/dist/problem-u-p6QglA.mjs +39 -0
  43. package/dist/problem-u-p6QglA.mjs.map +1 -0
  44. package/dist/project-DeQcAglt.mjs +464 -0
  45. package/dist/project-DeQcAglt.mjs.map +1 -0
  46. package/dist/publish.mjs +413 -169
  47. package/dist/publish.mjs.map +1 -1
  48. package/dist/reachable-Cc-255L3.mjs +13 -0
  49. package/dist/reachable-Cc-255L3.mjs.map +1 -0
  50. package/dist/{repository-files-CPfBA4mf.mjs → repository-files-aXwrITdF.mjs} +3 -2
  51. package/dist/repository-files-aXwrITdF.mjs.map +1 -0
  52. package/dist/{runtime-Dc5gCUSF.mjs → runtime-BmlYnI7T.mjs} +3 -3
  53. package/dist/{runtime-Dc5gCUSF.mjs.map → runtime-BmlYnI7T.mjs.map} +1 -1
  54. package/dist/started-once-CkTooI_o.mjs +13 -0
  55. package/dist/started-once-CkTooI_o.mjs.map +1 -0
  56. package/dist/{cli-contract-DdTV5DaG.mjs → syntax-ct2fFLtv.mjs} +9 -45
  57. package/dist/syntax-ct2fFLtv.mjs.map +1 -0
  58. package/dist/workspace-settings.mjs +8 -32
  59. package/dist/workspace-settings.mjs.map +1 -1
  60. package/package.json +43 -34
  61. package/skills/msch-checks/SKILL.md +10 -1
  62. package/skills/publishing/SKILL.md +6 -4
  63. package/skills/repository-config/SKILL.md +14 -9
  64. package/skills/workspace-settings/SKILL.md +33 -3
  65. package/src/app/vite.d.ts +2 -0
  66. package/dist/cli-contract-DdTV5DaG.mjs.map +0 -1
  67. package/dist/comment-directives-5-f_qs1E.mjs.map +0 -1
  68. package/dist/define-lint-preset-DKJku2ZR.mjs.map +0 -1
  69. package/dist/ignored-directories-CfACwIvu.mjs.map +0 -1
  70. package/dist/package-vbK0Qycn.mjs.map +0 -1
  71. package/dist/repository-files-CPfBA4mf.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,18 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import { B as stringsIn, E as hasVerifyTask, F as childrenOf$2, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as definesTask, _ as publishedProjects, a as publicEntriesOf, b as runTasksOf, c as readManifest, d as lockedPackages, f as deployEntries, i as EntryManifestJson, l as workspaceDependencies, m as patternOf$1, o as MANIFEST_FILE$3, p as namedWorkspaces, r as publishedWorkspaces, s as dependencyEntries, u as lockedGraph, v as workspaceDirectories, w as VERIFY_TASK, y as workspaceManifest, z as propertyValue } from "./package-vbK0Qycn.mjs";
3
- import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-CPfBA4mf.mjs";
4
- import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-5-f_qs1E.mjs";
5
- import { $ as isPropertyAccessExpression, A as getLeadingCommentRanges, B as isEnumDeclaration, C as uniqueByReference, D as SignatureKind, E as InternalSymbolName, F as isBinaryExpression, G as isImportDeclaration, H as isFunctionDeclaration, I as isBlock, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isCallExpression, M as getTextOfJSDocComment, N as isArrayLiteralExpression, O as SyntaxKind, P as isArrowFunction, Q as isParenthesizedExpression, R as isClassDeclaration, S as symbolAt, T as IndexKind, U as isFunctionExpression, V as isExportDeclaration, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as lineOf$3, a as problemAt$9, at as isSpreadElement, b as referencedSymbols, c as columnOf, ct as isTypeLiteralNode, d as descendantsOf, dt as isVariableDeclaration, et as isPropertyAssignment, f as importedModulesOf, ft as isVariableDeclarationList, g as isTypeDeclaration, h as isInsideAny, i as formatProblem, it as isSourceFile, j as getNameOfDeclaration, k as getJSDocTags, l as contains, lt as isTypeReferenceNode, m as isGenericDeclaration, n as ProblemList, nt as isSatisfiesExpression, o as sortProblems, ot as isStringLiteral, p as isExternalDeclaration, pt as isVariableStatement, q as isModuleBlock, rt as isSignatureDeclaration, s as childrenOf$3, st as isTypeAliasDeclaration, tt as isReturnStatement, u as declarationsOf, ut as isUnionTypeNode, v as packageOf$1, w as API, x as resolvedSymbol, y as propertyNamesOf, z as isElementAccessExpression } from "./cli-contract-DdTV5DaG.mjs";
6
- import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-Dc5gCUSF.mjs";
2
+ import { B as stringsIn, E as hasVerifyTask, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as definesTask, _ as publishedProjects, a as cratesIn, b as runTasksOf, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, w as VERIFY_TASK, y as workspaceManifest, z as propertyValue } from "./dependencies-v59cxwTD.mjs";
3
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-DeQcAglt.mjs";
4
+ import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-aXwrITdF.mjs";
5
+ import { a as isRecord, c as isScannedText, d as presentFiles, f as scanText, i as collectNodes, l as isToolVersions, n as checkUpstreamExits, o as tomlSourceComments, p as positionOf, s as yamlSourceComments, t as checkScatteredDeviations, u as listedFiles } from "./check-upstream-exits-BJNhgkLI.mjs";
6
+ import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-Bdv6W97F.mjs";
7
+ import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CRAU6yNZ.mjs";
8
+ import { t as startedOnce } from "./started-once-CkTooI_o.mjs";
9
+ import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$2, tt as isTypeAliasDeclaration, u as isTypeDeclaration, x as SignatureKind, z as isImportDeclaration } from "./syntax-ct2fFLtv.mjs";
10
+ import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-u-p6QglA.mjs";
11
+ import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-BmlYnI7T.mjs";
12
+ import "./cli-contract-D7btWrEu.mjs";
7
13
  import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
8
- import { Array, Boolean as Boolean$1, Config, Effect, FileSystem, Function, HashMap, HashSet, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
14
+ import { Array, Config, Effect, FileSystem, HashMap, HashSet, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
9
15
  import { updateWorkspaceManifest } from "@pnpm/workspace.workspace-manifest-writer";
10
16
  import { ChildProcess } from "effect/process";
11
17
  import { parse, resolveConfigFromFile } from "vite-plus";
12
18
  import { parse as parse$1 } from "@pnpm/deps.path";
13
19
  import { fileURLToPath } from "node:url";
14
20
  import treeSitter from "@vscode/tree-sitter-wasm";
15
- import { Parser, isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
21
+ import { isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
16
22
  import semver from "semver";
17
23
  import { diagnosticDetail, lint, markdownPathspecs, y8Section } from "@r_masseater/y8";
18
24
  import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
@@ -49,19 +55,31 @@ const overrideProblem = (located) => (report) => {
49
55
  });
50
56
  return Option.none();
51
57
  };
52
- // src/shared/lib/text-position.ts
53
- const START$16 = 0;
54
- const FIRST_COLUMN$4 = 1;
55
- const positionOf = (source) => (index) => {
56
- const before = pipe(source, String$1.slice(START$16, index), String$1.split("\n"));
57
- return {
58
- line: before.length,
59
- column: pipe(Array.last(before), Option.match({
60
- onNone: () => FIRST_COLUMN$4,
61
- onSome: (last) => last.length + FIRST_COLUMN$4
62
- }))
63
- };
64
- };
58
+ // src/features/check-overrides/model/override-records.ts
59
+ const RECORDS = [
60
+ NODE_MODULES,
61
+ ".cache",
62
+ "msch",
63
+ "overrides"
64
+ ];
65
+ const NO_PROBLEMS$1 = [];
66
+ const keyOf$1 = Effect.fn("keyOf")(function* keyOf(root, inputs) {
67
+ const files = yield* RepositoryFiles;
68
+ const implementation = yield* implementationFingerprint(import.meta.dirname);
69
+ return yield* contentKey([implementation], pipe(inputs, Array.map((file) => [file, files.join(root, file)])));
70
+ });
71
+ const unlessPassed = Effect.fn("unlessPassed")(function* unlessPassed(root, inputs, check) {
72
+ const files = yield* RepositoryFiles;
73
+ const key = yield* keyOf$1(root, inputs);
74
+ const records = yield* recordsIn(files.join(root, ...RECORDS));
75
+ if (Array.contains(records.passed, key)) {
76
+ yield* Effect.annotateCurrentSpan({ "msch.overrides.recorded": true });
77
+ return NO_PROBLEMS$1;
78
+ }
79
+ const problems = yield* check;
80
+ if (Array.isReadonlyArrayEmpty(problems)) yield* keepOnly(records, [key]);
81
+ return problems;
82
+ });
65
83
  // src/features/check-overrides/model/override-resolution.ts
66
84
  const VerdictSchema = Schema.Literals([
67
85
  "unused",
@@ -104,7 +122,7 @@ const AdvisorySchema = Schema.Struct({
104
122
  github_advisory_id: Schema.String
105
123
  });
106
124
  const AuditReport = Schema.fromJsonString(Schema.Struct({ advisories: Schema.Record(Schema.String, AdvisorySchema) }));
107
- const SCOPE_PREFIX$1 = "@";
125
+ const SCOPE_PREFIX = "@";
108
126
  const NAME_START = 0;
109
127
  const SEPARATOR_LENGTH = 1;
110
128
  const PEER_CONTEXT_START = "(";
@@ -128,8 +146,8 @@ const advisoriesIn = (output) => Option.match(Schema.decodeOption(AuditReport)(o
128
146
  onSome: (report) => sorted(pipe(Record.values(report.advisories), Array.map((advisory) => `${advisory.module_name} ${advisory.github_advisory_id}`)))
129
147
  });
130
148
  const separatorOf = (key) => {
131
- if (!String$1.startsWith(SCOPE_PREFIX$1)(key)) return String$1.indexOf(SCOPE_PREFIX$1)(key);
132
- return pipe(String$1.slice(SEPARATOR_LENGTH)(key), String$1.indexOf(SCOPE_PREFIX$1), Option.map((index) => index + SEPARATOR_LENGTH));
149
+ if (!String$1.startsWith(SCOPE_PREFIX)(key)) return String$1.indexOf(SCOPE_PREFIX)(key);
150
+ return pipe(String$1.slice(SEPARATOR_LENGTH)(key), String$1.indexOf(SCOPE_PREFIX), Option.map((index) => index + SEPARATOR_LENGTH));
133
151
  };
134
152
  const withoutPeerContext = (version) => Option.match(String$1.indexOf(PEER_CONTEXT_START)(version), {
135
153
  onNone: () => version,
@@ -198,10 +216,10 @@ const withBaselineProbe = (overrides) => ({
198
216
  [BASELINE_PROBE]: REMOVED_DEPENDENCY
199
217
  });
200
218
  // src/features/check-overrides/model/overrides.ts
201
- const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
219
+ const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
202
220
  const RESOLUTION_FILES = [
203
221
  "*package.json",
204
- WORKSPACE_FILE$5,
222
+ WORKSPACE_FILE$6,
205
223
  "pnpm-lock.yaml",
206
224
  ".npmrc",
207
225
  "patches/*"
@@ -298,16 +316,12 @@ const resolutionWith = Effect.fn("resolutionWith")(function* resolutionWith(work
298
316
  advisories
299
317
  })(depPaths);
300
318
  }, Effect.scoped);
301
- const problemsFor = Effect.fn("problemsFor")(function* problemsFor(root, overrides, keys) {
319
+ const problemsFor$1 = Effect.fn("problemsFor")(function* problemsFor(workspace, keys) {
302
320
  const path = yield* Path.Path;
303
- const workspace = {
304
- root,
305
- files: yield* trackedResolutionFiles(root),
306
- overrides
307
- };
321
+ const { root, overrides } = workspace;
308
322
  const baseline = yield* resolutionWith(workspace, BASELINE_PROBE, withBaselineProbe(overrides));
309
323
  const judgeAgainstBaseline = judge(baseline);
310
- const file = path.join(root, WORKSPACE_FILE$5);
324
+ const file = path.join(root, WORKSPACE_FILE$6);
311
325
  const problemOf = (located) => resolutionWith(workspace, located.key, withoutOverride(located.key)(overrides)).pipe(Effect.map((candidate) => overrideProblem({
312
326
  ...located,
313
327
  file
@@ -319,112 +333,87 @@ const problemsFor = Effect.fn("problemsFor")(function* problemsFor(root, overrid
319
333
  const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root) {
320
334
  const fs = yield* FileSystem.FileSystem;
321
335
  const path = yield* Path.Path;
322
- const source = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$5)).pipe(Effect.option);
336
+ const source = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$6)).pipe(Effect.option);
323
337
  const manifest = yield* workspaceManifest(root);
324
338
  const overrides = pipe(manifest, Option.flatMap((found) => Option.fromUndefinedOr(found.overrides)), Option.getOrElse(() => ({})));
325
339
  const keys = pipe(source, Option.map((text) => overrideKeysOf(text)(overrides)), Option.getOrElse(() => []));
326
340
  if (!Array.isReadonlyArrayNonEmpty(keys)) return [];
327
- return yield* problemsFor(root, overrides, keys);
328
- });
329
- // src/shared/lib/scanned-files.ts
330
- const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
331
- const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
332
- const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
333
- const READ_CONCURRENCY$28 = 64;
334
- const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
335
- const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
336
- /** @internal */
337
- const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
338
- const files = yield* RepositoryFiles;
339
- const names = yield* files.ownedFiles(root);
340
- return pipe(names, Array.map((name) => ({
341
- name,
342
- file: files.join(root, name)
343
- })));
344
- });
345
- /** @internal */
346
- const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
347
- const files = yield* RepositoryFiles;
348
- return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
349
- });
350
- /** @internal */
351
- const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
352
- const files = yield* RepositoryFiles;
353
- const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
354
- onNone: () => [],
355
- onSome: (source) => problemsIn(entry, source)
356
- }))), { concurrency: READ_CONCURRENCY$28 });
357
- return Array.flatten(found);
341
+ const files = yield* trackedResolutionFiles(root);
342
+ return yield* unlessPassed(root, files, problemsFor$1({
343
+ root,
344
+ files,
345
+ overrides
346
+ }, keys));
358
347
  });
359
348
  // src/features/check-overrides/model/git-subpath.ts
360
349
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
361
350
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
362
- const RULE$45 = "git-subpath-dependency";
351
+ const RULE$50 = "git-subpath-dependency";
363
352
  const WHOLE_MATCH$3 = 0;
364
353
  const problemAt$8 = ({ file }, source) => (found) => ({
365
354
  file,
366
355
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
367
- rule: RULE$45,
356
+ rule: RULE$50,
368
357
  message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$3])}\`.`
369
358
  });
370
- const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
359
+ const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
371
360
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
372
361
  /** @internal */
373
362
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
374
363
  const listed = yield* listedFiles(root);
375
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$16);
364
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$17);
376
365
  });
377
366
  // src/features/check-overrides/model/restricted-rules.ts
378
- const RULE$44 = "unnamed-restriction";
367
+ const RULE$49 = "unnamed-restriction";
379
368
  const WHOLE_MATCH$2 = 0;
380
369
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
381
- const problemsIn$15 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
370
+ const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
382
371
  file: entry.file,
383
372
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
384
- rule: RULE$44,
373
+ rule: RULE$49,
385
374
  message: `${found[WHOLE_MATCH$2]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
386
375
  })));
387
376
  /** @internal */
388
377
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
389
378
  const listed = yield* listedFiles(root);
390
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$15);
379
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$16);
391
380
  });
392
381
  // src/features/check-overrides/model/package-registry.ts
393
- const RULE$43 = "package-registry";
382
+ const RULE$48 = "package-registry";
394
383
  const REGISTRY = "https://npm.flatt.tech/";
395
384
  const TRAILING_SLASH = /\/$/u;
396
- const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
385
+ const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
397
386
  const NPMRC = /(?:^|\/)\.npmrc$/u;
398
387
  const WORKSPACE_REGISTRY = /^registry:/mu;
399
388
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
400
- const START$15 = 0;
389
+ const START$19 = 0;
401
390
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
402
391
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
403
392
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
404
393
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
405
394
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
406
- const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$15));
395
+ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$19));
407
396
  const workspaceProblem = (file, source, registry) => ({
408
397
  file,
409
- ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
410
- rule: RULE$43,
398
+ ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
399
+ rule: RULE$48,
411
400
  message: Option.match(registry, {
412
- onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$4}.`,
401
+ onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
413
402
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
414
403
  })
415
404
  });
416
405
  const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf$2("value")(found), isGuarded)), Array.map((found) => ({
417
406
  file: entry.file,
418
- ...positionOf(source)(found.index ?? START$15),
419
- rule: RULE$43,
420
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$15])}\`. Remove the line.`
407
+ ...positionOf(source)(found.index ?? START$19),
408
+ rule: RULE$48,
409
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$19])}\`. Remove the line.`
421
410
  })));
422
411
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
423
412
  const files = yield* RepositoryFiles;
424
413
  const manifest = yield* workspaceManifest(root);
425
414
  if (Option.isNone(manifest) || Option.exists(registryOf(manifest.value), isGuarded)) return [];
426
415
  const registry = registryOf(manifest.value);
427
- const file = files.join(root, WORKSPACE_FILE$4);
416
+ const file = files.join(root, WORKSPACE_FILE$5);
428
417
  const read = yield* files.readFile(file);
429
418
  const source = Option.getOrElse(read, () => "");
430
419
  return [workspaceProblem(file, source, registry)];
@@ -436,7 +425,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
436
425
  return [...yield* checkWorkspace(root), ...overrides];
437
426
  });
438
427
  // src/features/check-placement/model/colocated-git-patterns.ts
439
- const RULE$42 = "colocated-git-patterns";
428
+ const RULE$47 = "colocated-git-patterns";
440
429
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
441
430
  const ROOT$2 = ".";
442
431
  const SEPARATOR$21 = "/";
@@ -447,8 +436,8 @@ const FLOATING_PREFIX = `${ANY_DEPTH}${SEPARATOR$21}`;
447
436
  const LEADING_SLASHES = /^\/+/u;
448
437
  const TRAILING_SLASHES = /\/+$/u;
449
438
  const SPACES = /\s+/u;
450
- const FIRST$22 = 1;
451
- const READ_CONCURRENCY$27 = 16;
439
+ const FIRST$24 = 1;
440
+ const READ_CONCURRENCY$29 = 16;
452
441
  const isInside = (directory) => (inner) => inner !== directory && (directory === ROOT$2 || String$1.startsWith(`${directory}${SEPARATOR$21}`)(inner));
453
442
  const withoutPrefix = (prefix, text) => {
454
443
  if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
@@ -473,7 +462,7 @@ const entryOf$1 = (file, kind, directory) => (line, index) => {
473
462
  file,
474
463
  kind,
475
464
  directory,
476
- line: index + FIRST$22,
465
+ line: index + FIRST$24,
477
466
  pattern,
478
467
  values: Array.join(values, " ")
479
468
  });
@@ -488,12 +477,12 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
488
477
  const problemAt$7 = (entry, message) => ({
489
478
  file: entry.file,
490
479
  line: entry.line,
491
- column: FIRST$22,
492
- rule: RULE$42,
480
+ column: FIRST$24,
481
+ rule: RULE$47,
493
482
  message
494
483
  });
495
484
  const misplacedMessage = (kind, workspaces) => {
496
- if (workspaces.length === FIRST$22) {
485
+ if (workspaces.length === FIRST$24) {
497
486
  const workspace = Array.join(workspaces, "");
498
487
  return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
499
488
  }
@@ -543,17 +532,17 @@ const repeated = (entries) => (entry) => {
543
532
  /** @internal */
544
533
  const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
545
534
  const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
546
- const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$27 });
535
+ const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$29 });
547
536
  const entries = Array.flatten(read);
548
537
  const workspaces = yield* workspaceDirectories(root);
549
- const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$27 });
538
+ const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$29 });
550
539
  const repeatedFound = pipe(entries, Array.map(repeated(entries)));
551
540
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
552
541
  });
553
542
  // src/features/check-placement/model/colocated-tests.ts
554
- const RULE$41 = "colocated-test";
555
- const FIRST$21 = 1;
556
- const READ_CONCURRENCY$26 = 64;
543
+ const RULE$46 = "colocated-test";
544
+ const FIRST$23 = 1;
545
+ const READ_CONCURRENCY$28 = 64;
557
546
  const ROOT_SUBPATH = ".";
558
547
  const NAME_GROUP = "name";
559
548
  const SPECIFIER_GROUP = "specifier";
@@ -566,20 +555,20 @@ const SPEC_FILE = /\.spec\.[cm]?[jt]sx?$/u;
566
555
  const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
567
556
  const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
568
557
  const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
569
- const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
558
+ const EXCLUDED$7 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
570
559
  const DIRECTORY_MESSAGE = "sits in a separate test directory. Put each test next to the module it tests, and test-only helpers next to the tests as <name>.test.support.ts.";
571
560
  const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test next to the module it tests and import that module, or a helper beside it, with ./<name>.";
572
- const Manifest$4 = Schema.Struct({
561
+ const Manifest$5 = Schema.Struct({
573
562
  name: Schema.optional(Schema.String),
574
563
  exports: Schema.optional(Schema.Unknown)
575
564
  });
576
- const decodeManifest$7 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
565
+ const decodeManifest$9 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$5));
577
566
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
578
567
  const problemFor$7 = (test, message) => ({
579
568
  file: test.file,
580
- line: FIRST$21,
581
- column: FIRST$21,
582
- rule: RULE$41,
569
+ line: FIRST$23,
570
+ column: FIRST$23,
571
+ rule: RULE$46,
583
572
  message: `${test.base} ${message}`
584
573
  });
585
574
  const groupsOf$1 = (source, pattern, group) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array.getSomes);
@@ -599,7 +588,7 @@ const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context
599
588
  if (Option.isNone(owner)) return [];
600
589
  const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE$3));
601
590
  const join = (target) => files.join(context.root, owner.value, target);
602
- return pipe(text, Option.flatMap(decodeManifest$7), Option.map(specifiersBeside({
591
+ return pipe(text, Option.flatMap(decodeManifest$9), Option.map(specifiersBeside({
603
592
  join,
604
593
  dirname: files.dirname,
605
594
  directory: test.directory
@@ -627,7 +616,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(context, test) {
627
616
  /** @internal */
628
617
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
629
618
  const files = yield* RepositoryFiles;
630
- const listed = yield* files.matchingFiles(root, EXCLUDED$5);
619
+ const listed = yield* files.matchingFiles(root, EXCLUDED$7);
631
620
  const names = pipe(listed, Array.filter(String$1.isNonEmpty));
632
621
  const context = {
633
622
  root,
@@ -642,12 +631,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
642
631
  directory: files.dirname(file)
643
632
  };
644
633
  }));
645
- const found = yield* Effect.forEach(tests, (test) => problemIn$6(context, test), { concurrency: READ_CONCURRENCY$26 });
634
+ const found = yield* Effect.forEach(tests, (test) => problemIn$6(context, test), { concurrency: READ_CONCURRENCY$28 });
646
635
  return Array.getSomes(found);
647
636
  });
648
637
  // src/shared/lib/agent-docs.ts
649
638
  const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
650
- const READ_CONCURRENCY$25 = 16;
639
+ const READ_CONCURRENCY$27 = 16;
651
640
  const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
652
641
  const files = yield* RepositoryFiles;
653
642
  const listed = yield* files.listedFiles(root);
@@ -656,33 +645,33 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
656
645
  const file = files.join(root, name);
657
646
  const problemOf = Option.flatMap(problemIn(file));
658
647
  return files.readFile(file).pipe(Effect.map(problemOf));
659
- }, { concurrency: READ_CONCURRENCY$25 });
648
+ }, { concurrency: READ_CONCURRENCY$27 });
660
649
  return Array.getSomes(found);
661
650
  });
662
651
  // src/features/check-placement/model/agent-docs-length.ts
663
652
  const RECOMMENDED_LINES = 200;
664
- const FIRST$20 = 1;
665
- const RULE$40 = "agent-docs-length";
653
+ const FIRST$22 = 1;
654
+ const RULE$45 = "agent-docs-length";
666
655
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
667
656
  const problemFor$6 = (file) => (lines) => {
668
657
  if (lines <= RECOMMENDED_LINES) return Option.none();
669
658
  return Option.some({
670
659
  file,
671
660
  line: 201,
672
- column: FIRST$20,
673
- rule: RULE$40,
661
+ column: FIRST$22,
662
+ rule: RULE$45,
674
663
  message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
675
664
  });
676
665
  };
677
666
  /** @internal */
678
667
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$6(file)(lineCount(source)));
679
668
  // src/features/check-placement/model/claude-link.ts
680
- const RULE$39 = "claude-md-link";
669
+ const RULE$44 = "claude-md-link";
681
670
  const CLAUDE = "CLAUDE.md";
682
671
  const AGENTS = "AGENTS.md";
683
- const FIRST$19 = 1;
684
- const READ_CONCURRENCY$24 = 16;
685
- const MESSAGE$14 = "CLAUDE.md must be a symbolic link to AGENTS.md";
672
+ const FIRST$21 = 1;
673
+ const READ_CONCURRENCY$26 = 16;
674
+ const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
686
675
  /** @internal */
687
676
  const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
688
677
  const files = yield* RepositoryFiles;
@@ -694,21 +683,21 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
694
683
  const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
695
684
  return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
696
685
  file: path,
697
- line: FIRST$19,
698
- column: FIRST$19,
699
- rule: RULE$39,
700
- message: MESSAGE$14
686
+ line: FIRST$21,
687
+ column: FIRST$21,
688
+ rule: RULE$44,
689
+ message: MESSAGE$16
701
690
  })));
702
691
  });
703
692
  const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
704
- const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$24 });
693
+ const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$26 });
705
694
  return Array.getSomes(found);
706
695
  });
707
696
  // src/features/check-placement/model/dangling-links.ts
708
- const RULE$38 = "dangling-link";
697
+ const RULE$43 = "dangling-link";
709
698
  const SEPARATOR$20 = "/";
710
- const FIRST$18 = 1;
711
- const READ_CONCURRENCY$23 = 16;
699
+ const FIRST$20 = 1;
700
+ const READ_CONCURRENCY$25 = 16;
712
701
  const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$20}`)(name);
713
702
  /** @internal */
714
703
  const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
@@ -719,21 +708,21 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
719
708
  const link = yield* files.readLink(file);
720
709
  return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array.some(holds(target)))), Option.map((target) => ({
721
710
  file,
722
- line: FIRST$18,
723
- column: FIRST$18,
724
- rule: RULE$38,
711
+ line: FIRST$20,
712
+ column: FIRST$20,
713
+ rule: RULE$43,
725
714
  message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
726
715
  })));
727
716
  });
728
- const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$23 });
717
+ const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$25 });
729
718
  return Array.getSomes(found);
730
719
  });
731
720
  // src/features/check-placement/model/nested-docs.ts
732
- const RULE$37 = "nested-docs";
721
+ const RULE$42 = "nested-docs";
733
722
  const CONFIG_FILE$6 = "vite.config.ts";
734
723
  const SEPARATOR$19 = "/";
735
- const FIRST$17 = 1;
736
- const READ_CONCURRENCY$22 = 64;
724
+ const FIRST$19 = 1;
725
+ const READ_CONCURRENCY$24 = 64;
737
726
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
738
727
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
739
728
  const README = /^README(?:\.[^/]+)?$/iu;
@@ -743,9 +732,9 @@ var RootConfigUnreadable = class extends taggedError$5()("RootConfigUnreadable",
743
732
  const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
744
733
  const problemFor$5 = (file, message) => ({
745
734
  file,
746
- line: FIRST$17,
747
- column: FIRST$17,
748
- rule: RULE$37,
735
+ line: FIRST$19,
736
+ column: FIRST$19,
737
+ rule: RULE$42,
749
738
  message
750
739
  });
751
740
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
@@ -792,25 +781,25 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
792
781
  workspaces: pipe(directories, Array.map((directory) => files.join(root, directory)), HashSet.fromIterable),
793
782
  workspaceAgentDocs
794
783
  };
795
- const found = yield* Effect.forEach(nested, (name) => problemIn$5(root, allowed, name), { concurrency: READ_CONCURRENCY$22 });
784
+ const found = yield* Effect.forEach(nested, (name) => problemIn$5(root, allowed, name), { concurrency: READ_CONCURRENCY$24 });
796
785
  return Array.getSomes(found);
797
786
  });
798
787
  // src/features/check-placement/model/published-readme.ts
799
- const RULE$36 = "published-readme";
788
+ const RULE$41 = "published-readme";
800
789
  const README_FILE = "README.md";
801
- const READ_CONCURRENCY$21 = 16;
802
- const MESSAGE$13 = "contains Japanese. This package is published to npm, so write its README in English.";
790
+ const READ_CONCURRENCY$23 = 16;
791
+ const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
803
792
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
804
- const FILE_START$2 = 1;
793
+ const FILE_START$1 = 1;
805
794
  const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
806
795
  const files = yield* RepositoryFiles;
807
796
  const file = files.join(root, directory, README_FILE);
808
797
  const text = yield* files.readFile(file);
809
798
  if (Option.isNone(text)) return Option.some({
810
799
  file,
811
- line: FILE_START$2,
812
- column: FILE_START$2,
813
- rule: RULE$36,
800
+ line: FILE_START$1,
801
+ column: FILE_START$1,
802
+ rule: RULE$41,
814
803
  message: MISSING_MESSAGE
815
804
  });
816
805
  return pipe(text, Option.flatMap((source) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
@@ -819,23 +808,23 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
819
808
  file,
820
809
  line,
821
810
  column,
822
- rule: RULE$36,
823
- message: MESSAGE$13
811
+ rule: RULE$41,
812
+ message: MESSAGE$15
824
813
  };
825
814
  }))));
826
815
  });
827
816
  /** @internal */
828
817
  const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
829
818
  const projects = yield* publishedProjects(root);
830
- const found = yield* Effect.forEach(projects, (project) => problemIn$4(root, project), { concurrency: READ_CONCURRENCY$21 });
819
+ const found = yield* Effect.forEach(projects, (project) => problemIn$4(root, project), { concurrency: READ_CONCURRENCY$23 });
831
820
  return Array.getSomes(found);
832
821
  });
833
822
  // src/features/check-placement/model/published-tests.ts
834
- const RULE$35 = "published-tests";
823
+ const RULE$40 = "published-tests";
835
824
  const MANIFEST_FILE$2 = "package.json";
836
- const FILE_START$1 = 1;
825
+ const FILE_START = 1;
837
826
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
838
- const MESSAGE$12 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
827
+ const MESSAGE$14 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
839
828
  const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
840
829
  const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
841
830
  const files = yield* RepositoryFiles;
@@ -844,10 +833,10 @@ const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed,
844
833
  if (testedIn(listed)(prefix)) return Option.none();
845
834
  return Option.some({
846
835
  file: files.join(absolute, MANIFEST_FILE$2),
847
- line: FILE_START$1,
848
- column: FILE_START$1,
849
- rule: RULE$35,
850
- message: MESSAGE$12
836
+ line: FILE_START,
837
+ column: FILE_START,
838
+ rule: RULE$40,
839
+ message: MESSAGE$14
851
840
  });
852
841
  });
853
842
  /** @internal */
@@ -860,12 +849,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
860
849
  return Array.getSomes(found);
861
850
  });
862
851
  // src/features/check-placement/model/root-docs.ts
863
- const RULE$34 = "root-docs";
852
+ const RULE$39 = "root-docs";
864
853
  const SEPARATOR$18 = "/";
865
- const FIRST$16 = 1;
854
+ const FIRST$18 = 1;
866
855
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
867
856
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
868
- const MESSAGE$11 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
857
+ const MESSAGE$13 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
869
858
  const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
870
859
  /** @internal */
871
860
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
@@ -873,17 +862,17 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
873
862
  const names = yield* files.listedFiles(root);
874
863
  return pipe(names, Array.filter(isStrayRootDoc), Array.map((name) => ({
875
864
  file: files.join(root, name),
876
- line: FIRST$16,
877
- column: FIRST$16,
878
- rule: RULE$34,
879
- message: `${name} ${MESSAGE$11}`
865
+ line: FIRST$18,
866
+ column: FIRST$18,
867
+ rule: RULE$39,
868
+ message: `${name} ${MESSAGE$13}`
880
869
  })));
881
870
  });
882
871
  // src/features/check-placement/model/root-readme.ts
883
- const RULE$33 = "root-readme";
872
+ const RULE$38 = "root-readme";
884
873
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
885
- const READ_CONCURRENCY$20 = 16;
886
- const START$14 = 0;
874
+ const READ_CONCURRENCY$22 = 16;
875
+ const START$18 = 0;
887
876
  const CHECK_POLICY = "@r_masseater/msch";
888
877
  const MARKETPLACE = ".claude-plugin/marketplace.json";
889
878
  const RELATIVE$1 = /^\.\//u;
@@ -922,14 +911,14 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
922
911
  onNone: () => ownNames(plugins, names),
923
912
  onSome: () => [directory]
924
913
  }));
925
- const problemsIn$14 = (file, source, plugins) => (workspace) => {
914
+ const problemsIn$15 = (file, source, plugins) => (workspace) => {
926
915
  const message = messageFor(workspace.directory);
927
916
  const at = positionOf(source);
928
917
  const pattern = patternFor(plugins)(workspace);
929
918
  return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
930
919
  file,
931
- ...at(found.index ?? START$14),
932
- rule: RULE$33,
920
+ ...at(found.index ?? START$18),
921
+ rule: RULE$38,
933
922
  message
934
923
  })));
935
924
  };
@@ -937,7 +926,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
937
926
  const text = yield* (yield* RepositoryFiles).readFile(file);
938
927
  return pipe(text, Option.match({
939
928
  onNone: () => [],
940
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$14(file, source, plugins)))
929
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$15(file, source, plugins)))
941
930
  }));
942
931
  });
943
932
  /** @internal */
@@ -948,7 +937,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
948
937
  const named = yield* namedWorkspaces(root);
949
938
  const workspaces = pipe(named, Array.filter((workspace) => !isCheckPolicy(workspace)));
950
939
  const plugins = yield* marketplacePlugins(root);
951
- const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$20 });
940
+ const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$22 });
952
941
  return Array.flatten(found);
953
942
  });
954
943
  // src/features/check-placement/model/doc-placement.ts
@@ -967,10 +956,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
967
956
  return Array.flatten(found);
968
957
  });
969
958
  // src/features/check-placement/model/docs-mirror.ts
970
- const RULE$32 = "docs-mirror";
959
+ const RULE$37 = "docs-mirror";
971
960
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
972
961
  const MIRROR_LIMIT = 3;
973
- const READ_CONCURRENCY$19 = 16;
962
+ const READ_CONCURRENCY$21 = 16;
974
963
  const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
975
964
  const BEFORE = String.raw`(?<![\w@/.-])`;
976
965
  const AFTER = String.raw`(?![\w@.-])`;
@@ -992,7 +981,7 @@ const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Opti
992
981
  file,
993
982
  line,
994
983
  column,
995
- rule: RULE$32,
984
+ rule: RULE$37,
996
985
  message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
997
986
  };
998
987
  }), Option.toArray);
@@ -1007,7 +996,7 @@ const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
1007
996
  return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
1008
997
  directory,
1009
998
  names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
1010
- }))), { concurrency: READ_CONCURRENCY$19 });
999
+ }))), { concurrency: READ_CONCURRENCY$21 });
1011
1000
  });
1012
1001
  /** @internal */
1013
1002
  const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
@@ -1020,31 +1009,31 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
1020
1009
  onNone: () => [],
1021
1010
  onSome: (text) => problemIn$3(workspaces)(doc, file, text)
1022
1011
  })));
1023
- }, { concurrency: READ_CONCURRENCY$19 });
1012
+ }, { concurrency: READ_CONCURRENCY$21 });
1024
1013
  return Array.flatten(found);
1025
1014
  });
1026
1015
  // src/features/check-placement/model/ignored-sources.ts
1027
- const RULE$31 = "ignored-sources";
1016
+ const RULE$36 = "ignored-sources";
1028
1017
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
1029
- const FIRST$15 = 1;
1030
- const MESSAGE$10 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1018
+ const FIRST$17 = 1;
1019
+ const MESSAGE$12 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1031
1020
  /** @internal */
1032
1021
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
1033
1022
  const files = yield* RepositoryFiles;
1034
1023
  const ignored = yield* files.ignoredFiles(root, SOURCES);
1035
1024
  return pipe(ignored, Array.map((file) => ({
1036
1025
  file: files.join(root, file),
1037
- line: FIRST$15,
1038
- column: FIRST$15,
1039
- rule: RULE$31,
1040
- message: MESSAGE$10
1026
+ line: FIRST$17,
1027
+ column: FIRST$17,
1028
+ rule: RULE$36,
1029
+ message: MESSAGE$12
1041
1030
  })));
1042
1031
  });
1043
1032
  // src/features/check-placement/model/member-sources.ts
1044
1033
  const ROOT_WORKSPACE$1 = ".";
1045
- const FIRST$14 = 1;
1034
+ const FIRST$16 = 1;
1046
1035
  const SEPARATOR$16 = "/";
1047
- const EXCLUDED$4 = [
1036
+ const EXCLUDED$6 = [
1048
1037
  ":(exclude,attr:linguist-vendored)",
1049
1038
  ":(exclude,attr:linguist-generated)",
1050
1039
  ":(exclude,attr:linguist-documentation)"
@@ -1057,14 +1046,14 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
1057
1046
  const files = yield* RepositoryFiles;
1058
1047
  return {
1059
1048
  workspaces: yield* memberWorkspaces(root),
1060
- listed: yield* files.matchingFiles(root, EXCLUDED$4)
1049
+ listed: yield* files.matchingFiles(root, EXCLUDED$6)
1061
1050
  };
1062
1051
  });
1063
1052
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
1064
1053
  const fileProblem$1 = ({ file, rule, message }) => ({
1065
1054
  file,
1066
- line: FIRST$14,
1067
- column: FIRST$14,
1055
+ line: FIRST$16,
1056
+ column: FIRST$16,
1068
1057
  rule,
1069
1058
  message
1070
1059
  });
@@ -1105,16 +1094,8 @@ var GrammarUnreadable = class extends taggedError$4()("GrammarUnreadable", {
1105
1094
  message: Schema.String
1106
1095
  }) {};
1107
1096
  const PARSER_KEY = "parser";
1108
- const cache = () => {
1109
- const started = /* @__PURE__ */ new Map();
1110
- return (key, start) => Option.getOrElse(Option.fromNullishOr(started.get(key)), () => {
1111
- const promise = start();
1112
- started.set(key, promise);
1113
- return promise;
1114
- });
1115
- };
1116
- const initParser = cache();
1117
- const loadOnce = cache();
1097
+ const initParser = startedOnce();
1098
+ const loadOnce = startedOnce();
1118
1099
  const grammarFile = (grammar) => fileURLToPath(import.meta.resolve(`@vscode/tree-sitter-wasm/wasm/tree-sitter-${grammar}.wasm`));
1119
1100
  const loadLanguage = (grammar) => {
1120
1101
  const unreadable = (cause) => GrammarUnreadable.make({
@@ -9712,8 +9693,8 @@ const LAYER_ITEMS = [
9712
9693
  "attribute_item",
9713
9694
  "inner_attribute_item"
9714
9695
  ];
9715
- const READ_CONCURRENCY$18 = 64;
9716
- const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9696
+ const READ_CONCURRENCY$20 = 64;
9697
+ const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9717
9698
  const NONE$2 = [];
9718
9699
  const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
9719
9700
  const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
@@ -9756,7 +9737,7 @@ const PROBLEMS = {
9756
9737
  skipped: () => NONE$2,
9757
9738
  misplaced: () => NONE$2
9758
9739
  };
9759
- const problemsOf$3 = (read) => PROBLEMS[kindOf$1(read.source.inner)](read);
9740
+ const problemsOf$4 = (read) => PROBLEMS[kindOf$1(read.source.inner)](read);
9760
9741
  const misnamedSlice = ({ crate, inner }, root, join) => {
9761
9742
  const modulePath = modulePathOf(inner);
9762
9743
  return pipe(Option.liftPredicate(modulePath, (path) => path.length >= 2), Option.filter((path) => Option.contains(Array.head(path), FEATURES)), Option.flatMap((path) => Array.last(Array.take(path, 2))), Option.filter((slice) => !isFeatureName(slice)), Option.map((slice) => join(root, crate, "src", FEATURES, slice)));
@@ -9780,7 +9761,7 @@ const isRead = ({ inner }) => {
9780
9761
  };
9781
9762
  const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
9782
9763
  const files = yield* RepositoryFiles;
9783
- const listed = yield* files.matchingFiles(root, EXCLUDED$3);
9764
+ const listed = yield* files.matchingFiles(root, EXCLUDED$5);
9784
9765
  const owner = crateOf(crateDirectories(listed));
9785
9766
  return pipe(listed, Array.filter((name) => RUST_FILE.test(name)), Array.flatMap((name) => Option.toArray(Option.map(owner(name), (owned) => ({
9786
9767
  ...owned,
@@ -9794,22 +9775,43 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
9794
9775
  if (!Array.isReadonlyArrayNonEmpty(sources)) return NONE$2;
9795
9776
  const language = yield* loadLanguage(GRAMMAR).pipe(Effect.orDie);
9796
9777
  const parse = parsedWith(language);
9797
- const read = yield* Effect.forEach(pipe(sources, Array.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$18 });
9798
- return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$3)];
9778
+ const read = yield* Effect.forEach(pipe(sources, Array.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$20 });
9779
+ return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
9780
+ });
9781
+ // src/features/check-placement/model/shadcn-ui-alias.ts
9782
+ const RULE$35 = "shadcn-ui-alias";
9783
+ const FIRST$15 = 1;
9784
+ const problemOf$8 = (directory, { file, alias }) => ({
9785
+ file,
9786
+ line: FIRST$15,
9787
+ column: FIRST$15,
9788
+ rule: RULE$35,
9789
+ message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
9790
+ });
9791
+ /** @internal */
9792
+ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAliasProblems(root, directory) {
9793
+ const files = yield* RepositoryFiles;
9794
+ const found = yield* shadcnUiOf(root, directory);
9795
+ if (Option.isNone(found)) return Array.empty();
9796
+ if (yield* Option.match(found.value.target, {
9797
+ onNone: () => Effect.succeed(false),
9798
+ onSome: (target) => files.isDirectory(files.join(root, directory, target)).pipe(Effect.map(Option.getOrElse(() => false)))
9799
+ })) return Array.empty();
9800
+ return [problemOf$8(directory, found.value)];
9799
9801
  });
9800
9802
  // src/features/check-placement/model/source-aliases.ts
9801
9803
  const ALIAS_RULE = "source-alias";
9802
- const FIRST$13 = 1;
9804
+ const FIRST$14 = 1;
9803
9805
  const SOURCE_ALIAS = "#/*";
9804
9806
  const SOURCE_TARGET = "./src/*";
9805
9807
  const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
9806
9808
  const ALIAS_MESSAGE = `points into src/ under its own name. Import source through "${SOURCE_ALIAS}": "${SOURCE_TARGET}" only, so an import names the layer and slice it uses instead of a folder alias.`;
9807
- const Manifest$3 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9808
- const decodeManifest$6 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$3));
9809
+ const Manifest$4 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9810
+ const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
9809
9811
  const problemAt$6 = (file, rule, message) => ({
9810
9812
  file,
9811
- line: FIRST$13,
9812
- column: FIRST$13,
9813
+ line: FIRST$14,
9814
+ column: FIRST$14,
9813
9815
  rule,
9814
9816
  message
9815
9817
  });
@@ -9823,13 +9825,13 @@ const aliasProblems = Effect.fn("aliasProblems")(function* aliasProblems(root, w
9823
9825
  const files = yield* RepositoryFiles;
9824
9826
  const manifest = files.join(root, workspace, MANIFEST_FILE$3);
9825
9827
  const text = yield* files.readFile(manifest);
9826
- return pipe(text, Option.flatMap(decodeManifest$6), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemAt$6(manifest, ALIAS_RULE, `"${key}" ${ALIAS_MESSAGE}`)));
9828
+ return pipe(text, Option.flatMap(decodeManifest$8), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemAt$6(manifest, ALIAS_RULE, `"${key}" ${ALIAS_MESSAGE}`)));
9827
9829
  });
9828
9830
  /** @internal */
9829
9831
  const checkSourceAliases = Effect.fn("checkSourceAliases")(function* checkSourceAliases(root) {
9830
9832
  const workspaces = yield* memberWorkspaces(root);
9831
- const aliases = yield* Effect.forEach(workspaces, (workspace) => aliasProblems(root, workspace), { concurrency: 1 });
9832
- return Array.flatten(aliases);
9833
+ const found = yield* Effect.forEach(workspaces, (workspace) => Effect.all([aliasProblems(root, workspace), shadcnAliasProblems(root, workspace)], { concurrency: 1 }), { concurrency: 1 });
9834
+ return pipe(found, Array.flatten, Array.flatten);
9833
9835
  });
9834
9836
  // src/features/check-placement/model/placement-checks.ts
9835
9837
  /** @internal */
@@ -9856,18 +9858,18 @@ const SCRIPTS_DIRECTORY = "scripts";
9856
9858
  const WORKFLOW_DIRECTORY$1 = ".github/";
9857
9859
  const SEPARATOR$13 = "/";
9858
9860
  const CURRENT = "./";
9859
- const READ_CONCURRENCY$17 = 8;
9860
- const FIRST$12 = 1;
9861
+ const READ_CONCURRENCY$19 = 8;
9862
+ const FIRST$13 = 1;
9861
9863
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
9862
9864
  const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
9863
9865
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
9864
- const Manifest$2 = Schema.Struct({
9866
+ const Manifest$3 = Schema.Struct({
9865
9867
  bin: Schema.optional(Schema.Unknown),
9866
9868
  main: Schema.optional(Schema.Unknown),
9867
9869
  exports: Schema.optional(Schema.Unknown)
9868
9870
  });
9869
9871
  const TargetMap = Schema.Record(Schema.String, Schema.Unknown);
9870
- const decodeManifest$5 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
9872
+ const decodeManifest$7 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$3));
9871
9873
  const decodeTarget = Schema.decodeUnknownOption(Schema.String);
9872
9874
  const decodeTargetMap = Schema.decodeUnknownOption(TargetMap);
9873
9875
  const NO_ENTRIES = {
@@ -9894,7 +9896,7 @@ const entriesOf$2 = (manifest) => {
9894
9896
  const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
9895
9897
  const files = yield* RepositoryFiles;
9896
9898
  const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE$3));
9897
- return pipe(text, Option.flatMap(decodeManifest$5), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
9899
+ return pipe(text, Option.flatMap(decodeManifest$7), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
9898
9900
  });
9899
9901
  const isCommand$1 = (path) => COMMAND.test(path) && !NOT_COMMAND.test(path);
9900
9902
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
@@ -9906,7 +9908,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
9906
9908
  const files = yield* RepositoryFiles;
9907
9909
  const listed = yield* files.listedFiles(root);
9908
9910
  const workflows = pipe(listed, Array.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
9909
- const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$17 });
9911
+ const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$19 });
9910
9912
  return pipe(Array.getSomes(texts), Array.join("\n"));
9911
9913
  });
9912
9914
  const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$13));
@@ -9917,7 +9919,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
9917
9919
  message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
9918
9920
  })));
9919
9921
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
9920
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9922
+ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9921
9923
  const files = yield* RepositoryFiles;
9922
9924
  const config = yield* workspaceConfigOf(root, directory);
9923
9925
  const entries = yield* declaredEntries(root, directory);
@@ -9933,8 +9935,8 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, directo
9933
9935
  const isRun = (path) => Array.contains(runPaths, path) || Array.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
9934
9936
  const unrun = pipe(commands, Array.filter((path) => !isRun(path)), Array.map((path) => ({
9935
9937
  file: files.join(root, directory, path),
9936
- line: FIRST$12,
9937
- column: FIRST$12,
9938
+ line: FIRST$13,
9939
+ column: FIRST$13,
9938
9940
  rule: UNRUN,
9939
9941
  message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
9940
9942
  })));
@@ -9946,8 +9948,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9946
9948
  const isDirectory = yield* files.isDirectory(file);
9947
9949
  return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
9948
9950
  file,
9949
- line: FIRST$12,
9950
- column: FIRST$12,
9951
+ line: FIRST$13,
9952
+ column: FIRST$13,
9951
9953
  rule: SCRIPTS,
9952
9954
  message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
9953
9955
  })));
@@ -9956,56 +9958,26 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9956
9958
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
9957
9959
  const all = ["", ...yield* workspaceDirectories(root)];
9958
9960
  const workflows = yield* workflowText(root);
9959
- const found = yield* Effect.forEach(all, (directory) => problemsIn$13(root, directory, workflows), { concurrency: READ_CONCURRENCY$17 });
9960
- const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$17 });
9961
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$14(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
9962
+ const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$19 });
9961
9963
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
9962
9964
  });
9963
9965
  // src/features/check-repository-layout/model/crates.ts
9964
- const RULE$30 = "unverified-crate";
9966
+ const RULE$34 = "unverified-crate";
9965
9967
  const VERSION_RULE = "release-version";
9966
9968
  const MANIFEST_FILE$1 = "package.json";
9967
9969
  const APP_DIRECTORIES = ["", "src-tauri"];
9968
- const CARGO_FILE = "Cargo.toml";
9970
+ const CARGO_FILE$1 = "Cargo.toml";
9969
9971
  const CONFIG_FILE$5 = "vite.config.ts";
9970
9972
  const SEPARATOR$12 = "/";
9971
- const FIRST$11 = 1;
9972
- const READ_CONCURRENCY$16 = 8;
9973
- const CrateEntry = Schema.Struct({
9974
- name: Schema.String,
9975
- version: Schema.String,
9976
- manifest_path: Schema.String
9977
- });
9973
+ const FIRST$12 = 1;
9974
+ const READ_CONCURRENCY$18 = 8;
9978
9975
  const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
9979
- const CrateList = Schema.fromJsonString(Schema.Struct({ packages: Schema.Array(CrateEntry) }));
9980
- const decodeCrateList = Schema.decodeUnknownEffect(CrateList);
9981
- const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
9982
- const output = yield* (yield* ChildProcess.make("cargo", [
9983
- "metadata",
9984
- "--no-deps",
9985
- "--format-version",
9986
- "1",
9987
- "--offline"
9988
- ], {
9989
- cwd: root,
9990
- extendEnv: true,
9991
- stdin: "ignore"
9992
- })).stdout.pipe(Stream.decodeText(), Stream.mkString);
9993
- const list = yield* decodeCrateList(output);
9994
- return pipe(list.packages, Array.map((crate) => ({
9995
- name: crate.name,
9996
- version: crate.version,
9997
- manifest: crate.manifest_path
9998
- })));
9999
- }, Effect.scoped);
10000
- const owningWorkspace = (directories) => (directory) => {
10001
- const owners = pipe(directories, Array.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$12}`)(directory)));
10002
- return Array.last(Array.sort(owners, String$1.Order));
10003
- };
10004
9976
  const problemFor$2 = (crate, message) => ({
10005
9977
  file: crate.manifest,
10006
- line: FIRST$11,
10007
- column: FIRST$11,
10008
- rule: RULE$30,
9978
+ line: FIRST$12,
9979
+ column: FIRST$12,
9980
+ rule: RULE$34,
10009
9981
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
10010
9982
  });
10011
9983
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -10025,8 +9997,8 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
10025
9997
  if (Option.isNone(version) || version.value === crate.version) return Option.none();
10026
9998
  return Option.some({
10027
9999
  file: crate.manifest,
10028
- line: FIRST$11,
10029
- column: FIRST$11,
10000
+ line: FIRST$12,
10001
+ column: FIRST$12,
10030
10002
  rule: VERSION_RULE,
10031
10003
  message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${MANIFEST_FILE$1} is ${version.value}. msch-publish releases the version in package.json, so bump both in the same PR.`
10032
10004
  });
@@ -10034,14 +10006,14 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
10034
10006
  /** @internal */
10035
10007
  const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10036
10008
  const files = yield* RepositoryFiles;
10037
- if (!(yield* files.exists(files.join(root, CARGO_FILE)))) return [];
10009
+ if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
10038
10010
  const directories = yield* workspaceDirectories(root);
10039
10011
  const crates = yield* cratesIn(root);
10040
- const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$2(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$16 });
10012
+ const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$2(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$18 });
10041
10013
  return Array.getSomes(Array.flatten(found));
10042
10014
  });
10043
10015
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10044
- const RULE$29 = "deploy-entry-pattern";
10016
+ const RULE$33 = "deploy-entry-pattern";
10045
10017
  const FALLOW_KEYS = [
10046
10018
  "entry",
10047
10019
  "entryPoints",
@@ -10059,8 +10031,8 @@ const NEGATED = "!";
10059
10031
  const ROOT_WORKSPACE = ".";
10060
10032
  const WRAP_OFFSET$1 = 1;
10061
10033
  const NO_OFFSET = 0;
10062
- const READ_CONCURRENCY$15 = 8;
10063
- const MESSAGE$9 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10034
+ const READ_CONCURRENCY$17 = 8;
10035
+ const MESSAGE$11 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10064
10036
  const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
10065
10037
  const FALLOW = {
10066
10038
  keys: FALLOW_KEYS,
@@ -10077,7 +10049,7 @@ const VITE = {
10077
10049
  const isPatternProperty = (keys) => (node) => node["type"] === "Property" && pipe(decodeKey$1(node["key"]), Option.exists((key) => Array.contains(keys, keyName(key))));
10078
10050
  const patternsIn = (keys) => (node) => {
10079
10051
  if (Predicate.isReadonlyObject(node) && isPatternProperty(keys)(node)) return stringsIn(node["value"]);
10080
- return pipe(childrenOf$2(node), Array.flatMap(patternsIn(keys)));
10052
+ return pipe(childrenOf$1(node), Array.flatMap(patternsIn(keys)));
10081
10053
  };
10082
10054
  const choicesOf = ([literal = "", options]) => pipe(Option.fromUndefinedOr(options), Option.map(String$1.split(OPTION_SEPARATOR)), Option.getOrElse(() => [""]), Array.map((option) => `${literal}${option}`));
10083
10055
  const combined = (chunks) => Array.matchLeft(chunks, {
@@ -10096,7 +10068,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10096
10068
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10097
10069
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10098
10070
  });
10099
- const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
10071
+ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
10100
10072
  const { root, file, kind, workspaces, entries } = request;
10101
10073
  const files = yield* RepositoryFiles;
10102
10074
  const path = files.join(root, file);
@@ -10112,8 +10084,8 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
10112
10084
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10113
10085
  file: path,
10114
10086
  ...positionOf(text.value)(start - kind.offset),
10115
- rule: RULE$29,
10116
- message: `${pattern} ${MESSAGE$9}`
10087
+ rule: RULE$33,
10088
+ message: `${pattern} ${MESSAGE$11}`
10117
10089
  })));
10118
10090
  });
10119
10091
  /** @internal */
@@ -10135,17 +10107,17 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10135
10107
  }];
10136
10108
  return [];
10137
10109
  }));
10138
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$12({
10110
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$13({
10139
10111
  root,
10140
10112
  file,
10141
10113
  kind,
10142
10114
  workspaces,
10143
10115
  entries
10144
- }), { concurrency: READ_CONCURRENCY$15 });
10116
+ }), { concurrency: READ_CONCURRENCY$17 });
10145
10117
  return Array.flatten(found);
10146
10118
  });
10147
10119
  // src/features/check-repository-layout/model/fallow-entries.ts
10148
- const RULE$28 = "listed-entry";
10120
+ const RULE$32 = "listed-entry";
10149
10121
  const ENTRY_KEYS = [
10150
10122
  "entry",
10151
10123
  "entryPoints",
@@ -10155,7 +10127,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
10155
10127
  const WILDCARD$3 = /[*?{[]/u;
10156
10128
  const SEPARATOR$11 = "/";
10157
10129
  const WRAP_OFFSET = 1;
10158
- const READ_CONCURRENCY$14 = 8;
10130
+ const READ_CONCURRENCY$16 = 8;
10159
10131
  const decodeKey = Schema.decodeUnknownOption(KeySchema);
10160
10132
  const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array.contains(ENTRY_KEYS, keyName(key))));
10161
10133
  const entryPatternsIn = (node) => {
@@ -10163,10 +10135,10 @@ const entryPatternsIn = (node) => {
10163
10135
  text,
10164
10136
  start: start - WRAP_OFFSET
10165
10137
  })));
10166
- return pipe(childrenOf$2(node), Array.flatMap(entryPatternsIn));
10138
+ return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
10167
10139
  };
10168
10140
  const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$3.test(text);
10169
- const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10141
+ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10170
10142
  const files = yield* RepositoryFiles;
10171
10143
  const path = files.join(root, file);
10172
10144
  const text = yield* files.readFile(path);
@@ -10175,7 +10147,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10175
10147
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10176
10148
  file: path,
10177
10149
  ...positionOf(text.value)(start),
10178
- rule: RULE$28,
10150
+ rule: RULE$32,
10179
10151
  message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
10180
10152
  })));
10181
10153
  });
@@ -10183,70 +10155,70 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10183
10155
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10184
10156
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10185
10157
  const directories = yield* workspaceDirectories(root);
10186
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$11(root, file, directories), { concurrency: READ_CONCURRENCY$14 });
10158
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$12(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
10187
10159
  return Array.flatten(found);
10188
10160
  });
10189
- // src/features/check-repository-layout/model/hidden-verify.ts
10190
- const RULE$27 = "hidden-verify";
10191
- const CONFIG_FILE$4 = "vite.config.ts";
10192
- const FIRST$10 = 1;
10193
- const READ_CONCURRENCY$13 = 8;
10194
- const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory) {
10195
- const config = yield* workspaceConfigOf(root, directory);
10196
- if (Option.isNone(config)) return Option.none();
10197
- const { file, program } = config.value;
10198
- if (definesTask(VERIFY_TASK)(program)) return Option.none();
10199
- const verified = yield* hasVerifyTask(file);
10200
- return Option.some({
10201
- file,
10202
- line: FIRST$10,
10203
- column: FIRST$10,
10204
- rule: RULE$27,
10205
- message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
10206
- }).pipe(Option.filter(() => verified));
10207
- });
10208
- /** @internal */
10209
- const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
10210
- const directories = yield* workspaceDirectories(root);
10211
- const found = yield* Effect.forEach(directories, (directory) => problemIn$1(root, directory), { concurrency: READ_CONCURRENCY$13 });
10212
- return Array.getSomes(found);
10213
- });
10214
10161
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10215
- const RULE$26 = "root-workspace-path";
10216
- const CONFIG_FILE$3 = "vite.config.ts";
10162
+ const RULE$31 = "root-workspace-path";
10163
+ const CONFIG_FILE$4 = "vite.config.ts";
10217
10164
  const PATH_CHARACTER = /[\w.@/-]/u;
10218
10165
  const NAME_CHARACTER = /[\w.@-]/u;
10219
- const FIRST$9 = 0;
10166
+ const FIRST$11 = 0;
10220
10167
  const NEXT$2 = 1;
10221
10168
  const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
10222
- const mentions$1 = (directory) => (text) => {
10169
+ const mentions = (directory) => (text) => {
10223
10170
  const parts = String$1.split(text, directory);
10224
10171
  return pipe(Array.drop(parts, NEXT$2), Array.some((after, index) => {
10225
10172
  const before = parts[index] ?? "";
10226
10173
  const previous = String$1.slice(before.length - NEXT$2)(before);
10227
- const following = String$1.slice(FIRST$9, NEXT$2)(after);
10174
+ const following = String$1.slice(FIRST$11, NEXT$2)(after);
10228
10175
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10229
10176
  }));
10230
10177
  };
10231
- const problemsIn$10 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions$1(directory)(found.text)), Array.map((directory) => ({
10178
+ const problemsIn$11 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10232
10179
  file,
10233
10180
  ...positionOf(source)(found.start),
10234
- rule: RULE$26,
10235
- message: `${directory} is a workspace. The root ${CONFIG_FILE$3} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$3}: msch.lint, msch.devDependencies or its verify task.`
10181
+ rule: RULE$31,
10182
+ message: `${directory} is a workspace. The root ${CONFIG_FILE$4} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$4}: msch.lint, msch.devDependencies or its verify task.`
10236
10183
  })));
10237
10184
  /** @internal */
10238
10185
  const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
10239
10186
  const files = yield* RepositoryFiles;
10240
- const file = files.join(root, CONFIG_FILE$3);
10187
+ const file = files.join(root, CONFIG_FILE$4);
10241
10188
  const source = yield* files.readFile(file);
10242
10189
  if (Option.isNone(source)) return [];
10243
10190
  const directories = yield* workspaceDirectories(root);
10244
10191
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10245
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$10(file, source.value, directories)));
10192
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$11(file, source.value, directories)));
10193
+ });
10194
+ // src/features/check-repository-layout/model/hidden-verify.ts
10195
+ const RULE$30 = "hidden-verify";
10196
+ const CONFIG_FILE$3 = "vite.config.ts";
10197
+ const FIRST$10 = 1;
10198
+ const READ_CONCURRENCY$15 = 8;
10199
+ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory) {
10200
+ const config = yield* workspaceConfigOf(root, directory);
10201
+ if (Option.isNone(config)) return Option.none();
10202
+ const { file, program } = config.value;
10203
+ if (definesTask(VERIFY_TASK)(program)) return Option.none();
10204
+ const verified = yield* hasVerifyTask(file);
10205
+ return Option.some({
10206
+ file,
10207
+ line: FIRST$10,
10208
+ column: FIRST$10,
10209
+ rule: RULE$30,
10210
+ message: `${directory} gets its verify task from code outside ${CONFIG_FILE$3}. The root verify reads ${CONFIG_FILE$3} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$3}.`
10211
+ }).pipe(Option.filter(() => verified));
10212
+ });
10213
+ /** @internal */
10214
+ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
10215
+ const directories = yield* workspaceDirectories(root);
10216
+ const found = yield* Effect.forEach(directories, (directory) => problemIn$1(root, directory), { concurrency: READ_CONCURRENCY$15 });
10217
+ return Array.getSomes(found);
10246
10218
  });
10247
10219
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10248
- const RULE$25 = "shared-uncached-task";
10249
- const READ_CONCURRENCY$12 = 8;
10220
+ const RULE$29 = "shared-uncached-task";
10221
+ const READ_CONCURRENCY$14 = 8;
10250
10222
  const SHARED = 2;
10251
10223
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
10252
10224
  const UncachedTask = Schema.Struct({
@@ -10282,21 +10254,53 @@ const definitionsIn = Effect.fn("definitionsIn")(function* definitionsIn(root, d
10282
10254
  source
10283
10255
  })(task))));
10284
10256
  });
10285
- const problemsOf$2 = (definitions) => {
10257
+ const problemsOf$3 = (definitions) => {
10286
10258
  const directories = pipe(definitions, Array.map(({ directory }) => directory), Array.dedupe);
10287
10259
  if (directories.length < SHARED) return [];
10288
10260
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10289
10261
  file,
10290
10262
  ...position,
10291
- rule: RULE$25,
10263
+ rule: RULE$29,
10292
10264
  message: `The uncached task ${name} (${command}) is written the same way in ${Array.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
10293
10265
  })));
10294
10266
  };
10295
10267
  /** @internal */
10296
10268
  const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
10297
10269
  const directories = yield* workspaceDirectories(root);
10298
- const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$12 });
10299
- return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$2));
10270
+ const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$14 });
10271
+ return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
10272
+ });
10273
+ // src/features/check-repository-layout/model/unlocked-tasks.ts
10274
+ const RULE$28 = "unlocked-task";
10275
+ const READ_CONCURRENCY$13 = 8;
10276
+ const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
10277
+ const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
10278
+ const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array.findFirst(Array.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
10279
+ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Option.flatMap(literalOf), Option.match({
10280
+ onNone: () => Option.isNone(propertyValue("cache")(task.value)),
10281
+ onSome: (cache) => cache !== false
10282
+ }));
10283
+ const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
10284
+ file,
10285
+ ...positionOf(source)(task.start),
10286
+ rule: RULE$28,
10287
+ message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
10288
+ })), Option.toArray)));
10289
+ /** @internal */
10290
+ const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
10291
+ const directories = yield* workspaceDirectories(root);
10292
+ const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$13 });
10293
+ return pipe(Array.getSomes(found), Array.flatMap(problemsOf$2));
10294
+ });
10295
+ // src/features/check-repository-layout/model/task-checks.ts
10296
+ /** @internal */
10297
+ const checkTasks = Effect.fn("checkTasks")(function* checkTasks(root) {
10298
+ const found = yield* Effect.all([
10299
+ checkHiddenVerify(root),
10300
+ checkSharedUncachedTasks(root),
10301
+ checkUnlockedTasks(root)
10302
+ ], { concurrency: "unbounded" });
10303
+ return Array.flatten(found);
10300
10304
  });
10301
10305
  // src/features/check-repository-layout/model/workflow-nodes.ts
10302
10306
  const MISSING_OFFSET = 0;
@@ -10434,13 +10438,13 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
10434
10438
  /** @internal */
10435
10439
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10436
10440
  // src/features/check-repository-layout/model/workflow-paths.ts
10437
- const RULE$24 = "workflow-path";
10441
+ const RULE$27 = "workflow-path";
10438
10442
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10439
10443
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10440
- const READ_CONCURRENCY$11 = 8;
10444
+ const READ_CONCURRENCY$12 = 8;
10441
10445
  const WILDCARD$2 = /[*?[]/u;
10442
10446
  const SEPARATOR$9 = "/";
10443
- const FIRST$8 = 0;
10447
+ const FIRST$9 = 0;
10444
10448
  const EXPECTED = {
10445
10449
  action: "a directory with action.yml",
10446
10450
  directory: "a directory",
@@ -10481,7 +10485,7 @@ const RESOLVERS = {
10481
10485
  };
10482
10486
  const staticPrefix = (path) => {
10483
10487
  const prefix = Array.headNonEmpty(String$1.split(path, WILDCARD$2));
10484
- if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$8, -1)(prefix);
10488
+ if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$9, -1)(prefix);
10485
10489
  return prefix;
10486
10490
  };
10487
10491
  const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
@@ -10500,10 +10504,10 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
10500
10504
  const problemOf$7 = (file, source) => (found) => ({
10501
10505
  file,
10502
10506
  ...positionOf(source)(found.offset),
10503
- rule: RULE$24,
10507
+ rule: RULE$27,
10504
10508
  message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`
10505
10509
  });
10506
- const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10510
+ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10507
10511
  const files = yield* RepositoryFiles;
10508
10512
  const file = files.join(root, workflow);
10509
10513
  const source = yield* files.readFile(file);
@@ -10515,7 +10519,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow
10515
10519
  /** @internal */
10516
10520
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10517
10521
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10518
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$9(root, workflow), { concurrency: READ_CONCURRENCY$11 });
10522
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$10(root, workflow), { concurrency: READ_CONCURRENCY$12 });
10519
10523
  return Array.flatten(found);
10520
10524
  });
10521
10525
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10526,8 +10530,8 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10526
10530
  const FILTER_KEYS = ["paths", "paths-ignore"];
10527
10531
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10528
10532
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10529
- const START$13 = 0;
10530
- const READ_CONCURRENCY$10 = 8;
10533
+ const START$17 = 0;
10534
+ const READ_CONCURRENCY$11 = 8;
10531
10535
  const SEPARATOR$8 = "/";
10532
10536
  const WORD_SEPARATORS = /[-_]/gu;
10533
10537
  const SPACE = " ";
@@ -10557,7 +10561,7 @@ const namesIn = (name, source) => {
10557
10561
  return [
10558
10562
  {
10559
10563
  text: name,
10560
- offset: START$13
10564
+ offset: START$17
10561
10565
  },
10562
10566
  ...Option.toArray(stringOf(childOf("name")(root))),
10563
10567
  ...keysOf$1(childOf("jobs")(root))
@@ -10607,7 +10611,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
10607
10611
  name: stem,
10608
10612
  source: text
10609
10613
  })]), Option.getOrElse(() => []));
10610
- }), { concurrency: READ_CONCURRENCY$10 });
10614
+ }), { concurrency: READ_CONCURRENCY$11 });
10611
10615
  const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf$1(ACTION, name), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
10612
10616
  return [...Array.flatten(found), ...actions];
10613
10617
  });
@@ -10619,21 +10623,20 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
10619
10623
  checkCrates(root),
10620
10624
  checkDeployEntryPatterns(root),
10621
10625
  checkFallowEntries(root),
10622
- checkHiddenVerify(root),
10623
10626
  checkRootWorkspacePaths(root),
10624
- checkSharedUncachedTasks(root),
10627
+ checkTasks(root),
10625
10628
  checkWorkflowPaths(root),
10626
10629
  checkWorkflowScale(root)
10627
10630
  ], { concurrency: "unbounded" });
10628
10631
  return Array.flatten(found);
10629
10632
  });
10630
10633
  // src/features/check-typescript-generation/model/typescript-generation.ts
10631
- const RULE$23 = "legacy-typescript";
10634
+ const RULE$26 = "legacy-typescript";
10632
10635
  const LOCKFILE = "pnpm-lock.yaml";
10633
10636
  const COMPILER = "typescript";
10634
10637
  const CURRENT_MAJOR = 7;
10635
10638
  const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
10636
- const FIRST$7 = 1;
10639
+ const FIRST$8 = 1;
10637
10640
  const legacyOf = (id) => {
10638
10641
  const { name, version } = parse$1(id);
10639
10642
  const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
@@ -10644,8 +10647,8 @@ const legacyOf = (id) => {
10644
10647
  };
10645
10648
  const dependentsOf = (nodes) => (id) => pipe(nodes, Array.filter(({ dependencies }) => Array.contains(dependencies, id)), Array.map((node) => `\`${node.id}\``));
10646
10649
  const lineOf$2 = (source) => (id) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => String$1.replaceAll("'", "")(String$1.trim(line)) === `${id}:`), Option.match({
10647
- onNone: () => FIRST$7,
10648
- onSome: (index) => index + FIRST$7
10650
+ onNone: () => FIRST$8,
10651
+ onSome: (index) => index + FIRST$8
10649
10652
  }));
10650
10653
  const messageOf$2 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
10651
10654
  /** @internal */
@@ -10658,438 +10661,59 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
10658
10661
  return pipe(Option.getOrElse(nodes, () => []), Array.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array.map((legacy) => ({
10659
10662
  file,
10660
10663
  line: lineOf$2(source)(legacy.id),
10661
- column: FIRST$7,
10662
- rule: RULE$23,
10664
+ column: FIRST$8,
10665
+ rule: RULE$26,
10663
10666
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
10664
10667
  })));
10665
10668
  });
10666
- // src/shared/lib/values.ts
10667
- const SCHEMA_TYPE_PROPERTIES = ["Type", "_output"];
10668
- const MINIMUM_SET_SIZE = 2;
10669
- const DATA_FIRST_ARITY = 2;
10670
- const valueKey = (value) => `${typeof value}:${String(value)}`;
10671
- const literalValueOf = (type) => {
10672
- if (type.isStringLiteralType() || type.isNumberLiteralType()) return Option.some(type.value);
10673
- return Option.none();
10669
+ // src/features/measure-install-size/model/import-graph.ts
10670
+ const RELATIVE = /^\.\.?(?:\/|$)/u;
10671
+ const SUBPATH_IMPORT = "#";
10672
+ const WILDCARD$1 = "*";
10673
+ const SCOPE$2 = "@";
10674
+ const SEPARATOR$7 = "/";
10675
+ const SOURCE_SUFFIXES = [
10676
+ "",
10677
+ ".ts",
10678
+ ".tsx",
10679
+ "/index.ts"
10680
+ ];
10681
+ const SCOPED_SEGMENTS = 2;
10682
+ const PLAIN_SEGMENTS = 1;
10683
+ const ImportsField = Schema.Struct({ imports: Schema.optional(Schema.Record(Schema.String, Schema.String)) });
10684
+ const decodeImports = Schema.decodeOption(Schema.fromJsonString(ImportsField));
10685
+ const packageNameOf = (specifier) => {
10686
+ const segments = String$1.split(specifier, SEPARATOR$7);
10687
+ if (String$1.startsWith(SCOPE$2)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$7));
10688
+ return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$7));
10674
10689
  };
10675
- const literalValuesOf = (types) => {
10676
- const values = pipe(types, Array.map((member) => literalValueOf(member)), Array.getSomes, Array.dedupeWith((left, right) => valueKey(left) === valueKey(right)));
10677
- if (values.length !== types.length || values.length < MINIMUM_SET_SIZE) return Option.none();
10678
- return Option.some(values);
10679
- };
10680
- const literalUnionOf = (type) => {
10681
- if (!type.isUnionType()) return Option.none();
10682
- return literalValuesOf(type.getTypes());
10683
- };
10684
- const elementTypeOf = (checker, type) => {
10685
- if (!checker.isArrayLikeType(type)) return Option.none();
10686
- return Option.fromUndefinedOr(checker.getIndexTypeOfType(type, IndexKind.Number));
10687
- };
10688
- const schemaTypeOf = (checker) => (type) => Array.findFirst(SCHEMA_TYPE_PROPERTIES, (name) => Option.fromUndefinedOr(checker.getPropertyOfType(type, name))).pipe(Option.map((property) => checker.getTypeOfSymbol(property)));
10689
- const finiteValuesOf = (checker) => (type) => literalUnionOf(type).pipe(Option.orElse(() => elementTypeOf(checker, type).pipe(Option.flatMap(literalUnionOf))), Option.orElse(() => schemaTypeOf(checker)(type).pipe(Option.flatMap(literalUnionOf))));
10690
- const vocabularyOf = (checker) => (type) => {
10691
- if (!type.isUnionType()) return Option.none();
10692
- const optionalIds = /* @__PURE__ */ new Set([checker.getUndefinedType().id, checker.getNullType().id]);
10693
- const members = pipe(type.getTypes(), Array.filter((member) => !optionalIds.has(member.id)));
10694
- const values = Array.getSomes(pipe(members, Array.map((member) => literalValueOf(member))));
10695
- if (values.length < MINIMUM_SET_SIZE) return Option.none();
10696
- return Option.some({
10697
- values,
10698
- admitsUnnamedValues: values.length !== members.length
10699
- });
10690
+ const literalText = (specifier) => pipe(Option.liftPredicate(specifier, isStringLiteral), Option.map((literal) => literal.text));
10691
+ const runtimeSpecifierOf = (statement) => {
10692
+ if (isImportDeclaration(statement)) {
10693
+ const typeOnly = pipe(Option.fromUndefinedOr(statement.importClause), Option.exists((clause) => clause.phaseModifier === SyntaxKind.TypeKeyword));
10694
+ return Option.filter(literalText(statement.moduleSpecifier), () => !typeOnly);
10695
+ }
10696
+ if (isExportDeclaration(statement) && !statement.isTypeOnly) return Option.flatMap(Option.fromUndefinedOr(statement.moduleSpecifier), literalText);
10697
+ return Option.none();
10700
10698
  };
10701
- const isSubsetOf = Function.dual(DATA_FIRST_ARITY, (subset, superset) => {
10702
- const held = new Set(pipe(superset, Array.map((value) => valueKey(value))));
10703
- return pipe(subset, Array.every((value) => held.has(valueKey(value))));
10704
- });
10705
- const sameValues = Function.dual(DATA_FIRST_ARITY, (left, right) => left.length === right.length && isSubsetOf(left, right));
10706
- const valueText = (value) => {
10707
- if (typeof value === "string") return `"${value}"`;
10708
- return String(value);
10709
- };
10710
- const formatValues = (values) => pipe(values, Array.map(valueText), Array.join(" | "));
10711
- // src/entities/project/model/library.ts
10712
- const NAMESPACE_DEPTH_LIMIT = 8;
10713
- const EMPTY_INDEX = {
10714
- vocabularies: [],
10715
- shapes: []
10716
- };
10717
- const isObjectType = (checker) => (type) => !type.isUnionType() && !type.isLiteralType() && checker.getApparentType(type).id === type.id && Array.isReadonlyArrayNonEmpty(checker.getPropertiesOfType(type));
10718
- const describeLibraryType = (type) => `${type.typeName} from ${type.specifier}`;
10719
- const locationOf = (declaration) => ({
10720
- file: declaration.getSourceFile().fileName,
10721
- pos: declaration.pos,
10722
- kind: declaration.kind
10723
- });
10724
- const declarationKey = (location) => `${location.file}#${String(location.pos)}#${String(location.kind)}`;
10725
- const shapeOf = (checker) => (source, declaration, type) => Array.filter([{
10726
- ...source,
10727
- declaration: locationOf(declaration),
10728
- propertyNames: propertyNamesOf(checker)(type)
10729
- }], () => isObjectType(checker)(type));
10730
- const declaredTypeIndex = (walk, exported) => {
10731
- const declaration = Array.findFirst(declarationsOf(exported.symbol), isTypeDeclaration);
10732
- if (Option.isNone(declaration) || isGenericDeclaration(declaration.value)) return EMPTY_INDEX;
10733
- const located = {
10734
- specifier: walk.entry.specifier,
10735
- typeName: exported.typeName
10736
- };
10737
- const type = walk.checker.getDeclaredTypeOfSymbol(exported.symbol);
10738
- return {
10739
- vocabularies: vocabularyOf(walk.checker)(type).pipe(Option.map((vocabulary) => ({
10740
- ...located,
10741
- vocabulary
10742
- })), Option.toArray),
10743
- shapes: shapeOf(walk.checker)({
10744
- ...located,
10745
- form: "declared"
10746
- }, declaration.value, type)
10747
- };
10699
+ const specifiersIn = (api, file, text) => {
10700
+ const retained = api.createSourceFile(file, text);
10701
+ const found = pipe(retained.sourceFile.statements, Array.fromIterable, Array.map(runtimeSpecifierOf));
10702
+ retained.dispose();
10703
+ return Array.getSomes(found);
10748
10704
  };
10749
- const schemaTypeIndex = (walk, located) => (declaration, schemaType) => ({
10750
- vocabularies: vocabularyOf(walk.checker)(schemaType).pipe(Option.map((vocabulary) => ({
10751
- ...located,
10752
- vocabulary
10753
- })), Option.toArray),
10754
- shapes: shapeOf(walk.checker)({
10755
- ...located,
10756
- form: "schema"
10757
- }, declaration, schemaType)
10758
- });
10759
- const schemaValueIndex = (walk, exported) => {
10760
- const declaration = Array.findFirst(declarationsOf(exported.symbol), isVariableDeclaration);
10761
- if (Option.isNone(declaration)) return EMPTY_INDEX;
10762
- const valueType = walk.checker.getTypeOfSymbolAtLocation(exported.symbol, declaration.value);
10763
- const located = {
10764
- specifier: walk.entry.specifier,
10765
- typeName: `(typeof ${exported.typeName})["Type"]`
10766
- };
10767
- return Option.match(schemaTypeOf(walk.checker)(valueType), {
10768
- onNone: () => EMPTY_INDEX,
10769
- onSome: (schemaType) => schemaTypeIndex(walk, located)(declaration.value, schemaType)
10770
- });
10771
- };
10772
- const mergeIndexes = (indexes) => ({
10773
- vocabularies: pipe(indexes, Array.flatMap((index) => index.vocabularies)),
10774
- shapes: pipe(indexes, Array.flatMap((index) => index.shapes))
10775
- });
10776
- const isNamespace = (symbol) => pipe(declarationsOf(symbol), Array.some((declaration) => isModuleDeclaration(declaration)));
10777
- const indexUnder = (walk, visit) => {
10778
- const symbol = resolvedSymbol(walk.checker)(visit.exported);
10779
- const named = {
10780
- symbol,
10781
- typeName: `${visit.qualifier}${visit.exported.name}`
10782
- };
10783
- const own = mergeIndexes([declaredTypeIndex(walk, named), schemaValueIndex(walk, named)]);
10784
- if (!isNamespace(symbol) || visit.ancestors.length >= NAMESPACE_DEPTH_LIMIT || visit.ancestors.includes(symbol)) return own;
10785
- const nested = pipe(walk.checker.getExportsOfModule(symbol), Array.map((member) => indexUnder(walk, {
10786
- exported: member,
10787
- qualifier: `${named.typeName}.`,
10788
- ancestors: [...visit.ancestors, symbol]
10789
- })));
10790
- return mergeIndexes([own, ...nested]);
10791
- };
10792
- const exportAssignmentOf = (moduleSymbol) => Option.fromUndefinedOr(moduleSymbol.getExports().get(InternalSymbolName.ExportEquals));
10793
- const indexOfEntry = (checker) => (entry) => {
10794
- const moduleSymbol = Option.fromUndefinedOr(checker.getSymbolOfSourceFile(entry.declarationsPath));
10795
- if (Option.isNone(moduleSymbol)) return EMPTY_INDEX;
10796
- const walk = {
10797
- checker,
10798
- entry
10799
- };
10800
- const roots = Option.match(exportAssignmentOf(moduleSymbol.value), {
10801
- onNone: () => checker.getExportsOfModule(moduleSymbol.value),
10802
- onSome: (assigned) => [resolvedSymbol(checker)(assigned)]
10803
- });
10804
- return mergeIndexes(pipe(roots, Array.map((exported) => indexUnder(walk, {
10805
- exported,
10806
- qualifier: "",
10807
- ancestors: []
10808
- }))));
10809
- };
10810
- const libraryCache = () => {
10811
- const indexes = /* @__PURE__ */ new Map();
10812
- return { indexOf: (entry, compute) => Option.match(Option.fromUndefinedOr(indexes.get(entry.declarationsPath)), {
10813
- onSome: (index) => ({
10814
- index,
10815
- cached: true
10816
- }),
10817
- onNone: () => {
10818
- const index = compute();
10819
- indexes.set(entry.declarationsPath, index);
10820
- return {
10821
- index,
10822
- cached: false
10823
- };
10824
- }
10825
- }) };
10826
- };
10827
- const indexEntry = (cache) => (checker) => (entry) => Effect.sync(() => cache.indexOf(entry, () => indexOfEntry(checker)(entry))).pipe(Effect.tap(({ index, cached }) => Effect.annotateCurrentSpan({
10828
- "msch.library.cached": cached,
10829
- "msch.library.vocabularies": index.vocabularies.length,
10830
- "msch.library.shapes": index.shapes.length
10831
- })), Effect.map(({ index }) => index), Effect.withSpan("indexLibraryEntry", { attributes: { "msch.library.specifier": entry.specifier } }));
10832
- const libraryIndex = (cache) => (checker) => (entries) => pipe(entries, (items) => Effect.forEach(items, indexEntry(cache)(checker), { concurrency: 1 }), Effect.map(mergeIndexes), Effect.withSpan("libraryIndex"));
10833
- // src/entities/project/model/telemetry.ts
10834
- const RSS_LINE = /^VmRSS:\s+(?<kib>\d+) kB$/mu;
10835
- const BYTES_PER_KIB = 1024;
10836
- const UNKNOWN_RSS = 0;
10837
- const kibibytesIn = (status) => Option.fromNullishOr(RSS_LINE.exec(status)).pipe(Option.flatMap((match) => Option.fromUndefinedOr(match.groups)), Option.flatMap((groups) => Option.fromUndefinedOr(groups["kib"])));
10838
- const residentBytesOf = (pid) => Effect.gen(function* residentBytes() {
10839
- const status = yield* (yield* RepositoryFiles).readFile(`/proc/${pid}/status`);
10840
- return pipe(status, Option.flatMap(kibibytesIn), Option.flatMap(Number$1.parse), Option.map((kib) => kib * BYTES_PER_KIB), Option.getOrElse(() => UNKNOWN_RSS));
10841
- });
10842
- const childPids = Effect.gen(function* childPids() {
10843
- const files = yield* RepositoryFiles;
10844
- const pid = String(process.pid);
10845
- const children = yield* files.readFile(`/proc/${pid}/task/${pid}/children`);
10846
- return pipe(children, Option.map((text) => pipe(String$1.trim(text), String$1.split(" "), Array.filter(String$1.isNonEmpty))), Option.getOrElse(() => []));
10847
- });
10848
- const annotateMemory = Effect.gen(function* annotateMemory() {
10849
- const own = yield* residentBytesOf(String(process.pid));
10850
- const pids = yield* childPids;
10851
- const children = yield* Effect.forEach(pids, (pid) => residentBytesOf(pid), { concurrency: 1 });
10852
- const { heapUsed } = process.memoryUsage();
10853
- yield* Effect.annotateCurrentSpan({
10854
- "process.memory.rss": own,
10855
- "process.memory.heap_used": heapUsed,
10856
- "msch.compiler.memory.rss": Number$1.sumAll(children)
10857
- });
10858
- });
10859
- const annotateResources = (api) => Effect.gen(function* annotateCompiler() {
10860
- yield* annotateMemory;
10861
- const { totals } = api.getTimingInfo();
10862
- yield* Effect.annotateCurrentSpan({
10863
- "msch.compiler.requests": totals.requestCount,
10864
- "msch.compiler.round_trip_ms": totals.roundTripMs,
10865
- "msch.compiler.server_ms": totals.serverTimeMs
10866
- });
10867
- });
10868
- // src/entities/project/model/project.ts
10869
- const CONFIG_PATHSPEC = `:(glob)**/tsconfig.json`;
10870
- const HIDDEN_PREFIX$1 = ".";
10871
- const SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([
10872
- NODE_MODULES,
10873
- "dist",
10874
- "coverage"
10875
- ]);
10876
- const isVisible = (file) => pipe(String$1.split(file, "/"), Array.every((segment) => !String$1.startsWith(HIDDEN_PREFIX$1)(segment) && !SKIPPED_DIRECTORIES.has(segment)));
10877
- const listConfigFiles = (root) => Effect.gen(function* configFilesUnder() {
10878
- const files = yield* RepositoryFiles;
10879
- const listed = yield* files.matchingFiles(root, [CONFIG_PATHSPEC]);
10880
- const visible = pipe(listed, Array.filter(isVisible), Array.map((file) => files.join(root, file)));
10881
- return Array.sort(visible, Order.String);
10882
- });
10883
- const parseConfig = (api) => (configPath) => Option.some(api.parseConfigFile(configPath)).pipe(Option.filter((parsed) => Array.isReadonlyArrayNonEmpty(parsed.fileNames)));
10884
- const nearestPackageDirectory = (directory, root) => Effect.gen(function* nearestPackage() {
10885
- const files = yield* RepositoryFiles;
10886
- const hasManifest = yield* files.exists(files.join(directory, MANIFEST_FILE$3));
10887
- const parent = files.dirname(directory);
10888
- if (hasManifest || directory === root || parent === directory) return directory;
10889
- return yield* nearestPackageDirectory(parent, root);
10890
- });
10891
- const packageDirectoryOf = (root) => (directory) => nearestPackageDirectory(directory, root);
10892
- const packageInfoOf = Effect.fn("packageInfoOf")(function* packageInfoOf(configPath, root) {
10893
- const files = yield* RepositoryFiles;
10894
- const directory = yield* nearestPackageDirectory(files.dirname(configPath), root);
10895
- const manifest = yield* readManifest(directory);
10896
- return {
10897
- directory,
10898
- name: manifest.pipe(Option.flatMap((found) => Option.fromUndefinedOr(found.name))),
10899
- workspaceDependencies: manifest.pipe(Option.map(workspaceDependencies), Option.getOrElse(() => []))
10900
- };
10901
- });
10902
- const NO_CHECK_PRAGMA = /^\/\/\s*@ts-nocheck/u;
10903
- const FILE_START = 0;
10904
- const skipsTypeChecking = (sourceFile) => pipe(getLeadingCommentRanges(sourceFile.text, FILE_START) ?? [], Array.some((range) => NO_CHECK_PRAGMA.test(String$1.slice(range.pos, range.end)(sourceFile.text))));
10905
- const buildProject = Effect.fn("buildProject")(function* buildProject({ compiler: { api, libraries }, generated }, parsed, info) {
10906
- const entries = yield* dependencyEntries(info.directory);
10907
- const program = yield* Effect.sync(() => api.createProgram([...parsed.fileNames, ...pipe(entries, Array.map((entry) => entry.declarationsPath))], {
10908
- ...parsed.options,
10909
- noEmit: true
10910
- })).pipe(Effect.withSpan("createProgram"));
10911
- const { checker } = program.getProject();
10912
- const library = yield* libraryIndex(libraries)(checker)(entries);
10913
- const projectFiles = new Set(pipe(parsed.fileNames, Array.filter((fileName) => !generated.includes(fileName))));
10914
- return {
10915
- packageName: info.name,
10916
- workspaceDependencies: info.workspaceDependencies,
10917
- program,
10918
- checker,
10919
- sourceFiles: pipe(program.getSourceFileNames(), Array.filter((fileName) => projectFiles.has(fileName)), Array.flatMap((fileName) => Option.toArray(Option.fromUndefinedOr(program.getSourceFile(fileName)))), Array.filter((sourceFile) => !sourceFile.isDeclarationFile && !skipsTypeChecking(sourceFile))),
10920
- library
10921
- };
10922
- });
10923
- const typeScriptCompiler = Effect.acquireRelease(Effect.sync(() => ({
10924
- api: new API({ collectTiming: true }),
10925
- libraries: libraryCache()
10926
- })), ({ api }) => Effect.sync(() => {
10927
- api.close();
10928
- }));
10929
- const loadProject = Effect.fn("loadProject")(function* loadProject(workspace, configPath) {
10930
- const { compiler, root } = workspace;
10931
- const parsed = parseConfig(compiler.api)(configPath);
10932
- if (Option.isNone(parsed)) return Option.none();
10933
- const info = yield* packageInfoOf(configPath, root);
10934
- const project = yield* buildProject(workspace, parsed.value, info);
10935
- yield* Effect.annotateCurrentSpan({
10936
- "msch.project.config": configPath,
10937
- "msch.project.program_files": project.program.getSourceFileNames().length,
10938
- "msch.project.source_files": project.sourceFiles.length
10939
- });
10940
- yield* annotateResources(compiler.api);
10941
- return Option.some(project);
10942
- });
10943
- const releaseProject = (project) => Effect.sync(() => {
10944
- project.program.dispose();
10945
- });
10946
- const withProject = (workspace) => (configPath) => (work) => Effect.acquireUseRelease(loadProject(workspace, configPath), (loaded) => Option.match(loaded, {
10947
- onNone: () => Effect.succeedNone,
10948
- onSome: (project) => work(project).pipe(Effect.asSome)
10949
- }), (loaded) => Option.match(loaded, {
10950
- onNone: () => Effect.void,
10951
- onSome: releaseProject
10952
- }));
10953
- const mentions = (needle) => ({ api }) => (configPath) => Effect.gen(function* mentionsNeedle() {
10954
- const files = yield* RepositoryFiles;
10955
- const fileNames = Option.match(parseConfig(api)(configPath), {
10956
- onNone: () => [],
10957
- onSome: (parsed) => parsed.fileNames
10958
- });
10959
- const texts = yield* Effect.forEach(fileNames, (fileName) => files.readFile(fileName), { concurrency: 1 });
10960
- const includesNeedle = String$1.includes(needle);
10961
- return pipe(texts, Array.some((text) => Option.exists(text, includesNeedle)));
10962
- });
10963
- // src/entities/project/model/inputs.ts
10964
- const SEPARATOR$7 = "/";
10965
- const SCOPE_PREFIX = "@";
10966
- const HIDDEN_PREFIX = ".";
10967
- const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
10968
- const nearestManifestDirectory = Effect.fn("nearestManifestDirectory")(function* nearestManifestDirectory(start) {
10969
- const files = yield* RepositoryFiles;
10970
- let directory = start;
10971
- let parent = files.dirname(directory);
10972
- while (parent !== directory && !(yield* files.exists(files.join(directory, "package.json")))) {
10973
- directory = parent;
10974
- parent = files.dirname(directory);
10975
- }
10976
- return directory;
10977
- });
10978
- const dependenciesOf = Effect.fn("dependenciesOf")(function* dependenciesOf(directory) {
10979
- const files = yield* RepositoryFiles;
10980
- const manifest = yield* readManifest(directory);
10981
- const names = Option.match(manifest, {
10982
- onNone: () => [],
10983
- onSome: workspaceDependencies
10984
- });
10985
- return yield* Effect.forEach(names, (name) => files.realPath(files.join(directory, NODE_MODULES, name)), { concurrency: 1 });
10986
- });
10987
- const workspaceClosure = Effect.fn("workspaceClosure")(function* workspaceClosure(start) {
10988
- const seen = /* @__PURE__ */ new Set([start]);
10989
- const queue = [start];
10990
- for (const directory of queue) {
10991
- const next = yield* dependenciesOf(directory);
10992
- for (const dependency of next) if (!seen.has(dependency)) {
10993
- seen.add(dependency);
10994
- queue.push(dependency);
10995
- }
10996
- }
10997
- return [...seen];
10998
- });
10999
- const isUnder = (prefixes) => (file) => pipe(prefixes, Array.some((prefix) => String$1.startsWith(prefix)(file)));
11000
- const closureOf$1 = Effect.fn("closureOf")(function* closureOf(root, configPath) {
11001
- const files = yield* RepositoryFiles;
11002
- const directory = yield* packageDirectoryOf(root)(files.dirname(configPath));
11003
- const directories = yield* workspaceClosure(directory);
11004
- return {
11005
- directories,
11006
- prefixes: pipe(directories, Array.map((found) => `${files.relative(root, found)}${SEPARATOR$7}`))
11007
- };
11008
- });
11009
- const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
11010
- const files = yield* RepositoryFiles;
11011
- if (!String$1.startsWith(SCOPE_PREFIX)(name)) return [name];
11012
- const scoped = yield* files.readDirectory(files.join(modules, name));
11013
- return pipe(scoped, Array.map((entry) => `${name}${SEPARATOR$7}${entry}`));
11014
- });
11015
- const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
11016
- const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
11017
- const nested = yield* pipe(listed, Array.filter((name) => !String$1.startsWith(HIDDEN_PREFIX)(name)), (items) => Effect.forEach(items, scopedNames(modules), { concurrency: 1 }));
11018
- return Array.flatten(nested);
11019
- });
11020
- const installedPackages = Effect.fn("installedPackages")(function* installedPackages(root, directory) {
11021
- const files = yield* RepositoryFiles;
11022
- const modules = files.join(directory, NODE_MODULES);
11023
- const names = yield* installedNames$1(modules);
11024
- return yield* Effect.forEach(names, (name) => files.realPath(files.join(modules, name)).pipe(Effect.map((found) => files.relative(root, found))), { concurrency: 1 });
11025
- });
11026
- const dependencyVersions = Effect.fn("dependencyVersions")(function* dependencyVersions(root, directories) {
11027
- const installed = yield* Effect.forEach(Array.dedupe([root, ...directories]), (directory) => installedPackages(root, directory), { concurrency: 1 });
11028
- return Array.sort(Array.dedupe(Array.flatten(installed)), Order.String);
11029
- });
11030
- const projectInputs = ({ workspace: { compiler, root }, listed }) => (configPath) => Effect.gen(function* collectInputs() {
11031
- const files = yield* RepositoryFiles;
11032
- const parsed = parseConfig(compiler.api)(configPath);
11033
- if (Option.isNone(parsed)) return Option.none();
11034
- const closure = yield* closureOf$1(root, configPath);
11035
- const dependencies = yield* dependencyVersions(root, closure.directories);
11036
- const options = yield* encodeOptions(parsed.value.options).pipe(Effect.orElseSucceed(() => ""));
11037
- const sources = pipe(parsed.value.fileNames, Array.map((fileName) => files.relative(root, fileName)));
11038
- const shared = pipe(listed, Array.filter(isUnder(closure.prefixes)));
11039
- return Option.some({
11040
- options,
11041
- files: Array.sort(Array.dedupe([...sources, ...shared]), Order.String),
11042
- dependencies
11043
- });
11044
- });
11045
- // src/features/measure-install-size/model/import-graph.ts
11046
- const RELATIVE = /^\.\.?(?:\/|$)/u;
11047
- const SUBPATH_IMPORT = "#";
11048
- const WILDCARD$1 = "*";
11049
- const SCOPE$2 = "@";
11050
- const SEPARATOR$6 = "/";
11051
- const SOURCE_SUFFIXES = [
11052
- "",
11053
- ".ts",
11054
- ".tsx",
11055
- "/index.ts"
11056
- ];
11057
- const SCOPED_SEGMENTS = 2;
11058
- const PLAIN_SEGMENTS = 1;
11059
- const ImportsField = Schema.Struct({ imports: Schema.optional(Schema.Record(Schema.String, Schema.String)) });
11060
- const decodeImports = Schema.decodeOption(Schema.fromJsonString(ImportsField));
11061
- const packageNameOf = (specifier) => {
11062
- const segments = String$1.split(specifier, SEPARATOR$6);
11063
- if (String$1.startsWith(SCOPE$2)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$6));
11064
- return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$6));
11065
- };
11066
- const literalText = (specifier) => pipe(Option.liftPredicate(specifier, isStringLiteral), Option.map((literal) => literal.text));
11067
- const runtimeSpecifierOf = (statement) => {
11068
- if (isImportDeclaration(statement)) {
11069
- const typeOnly = pipe(Option.fromUndefinedOr(statement.importClause), Option.exists((clause) => clause.phaseModifier === SyntaxKind.TypeKeyword));
11070
- return Option.filter(literalText(statement.moduleSpecifier), () => !typeOnly);
11071
- }
11072
- if (isExportDeclaration(statement) && !statement.isTypeOnly) return Option.flatMap(Option.fromUndefinedOr(statement.moduleSpecifier), literalText);
11073
- return Option.none();
11074
- };
11075
- const specifiersIn = (api, file, text) => {
11076
- const retained = api.createSourceFile(file, text);
11077
- const found = pipe(retained.sourceFile.statements, Array.fromIterable, Array.map(runtimeSpecifierOf));
11078
- retained.dispose();
11079
- return Array.getSomes(found);
11080
- };
11081
- const subpathTarget = (imports, specifier) => pipe(Record.toEntries(imports), Array.findFirst(([pattern, target]) => {
11082
- if (!String$1.endsWith(WILDCARD$1)(pattern)) return Option.liftPredicate(target, () => pattern === specifier);
11083
- const prefix = String$1.replace(WILDCARD$1, "")(pattern);
11084
- return Option.liftPredicate(String$1.replace(WILDCARD$1, String$1.replace(prefix, "")(specifier))(target), () => String$1.startsWith(prefix)(specifier));
11085
- }));
11086
- const existingSource = Effect.fn("existingSource")(function* existingSource(base) {
11087
- const files = yield* RepositoryFiles;
11088
- const found = yield* Effect.forEach(SOURCE_SUFFIXES, (suffix) => {
11089
- const candidate = `${base}${suffix}`;
11090
- return files.isDirectory(candidate).pipe(Effect.map((directory) => Option.liftPredicate(candidate, () => Option.exists(directory, (isDirectory) => !isDirectory))));
11091
- }, { concurrency: 1 });
11092
- return Array.head(Array.getSomes(found));
10705
+ const subpathTarget = (imports, specifier) => pipe(Record.toEntries(imports), Array.findFirst(([pattern, target]) => {
10706
+ if (!String$1.endsWith(WILDCARD$1)(pattern)) return Option.liftPredicate(target, () => pattern === specifier);
10707
+ const prefix = String$1.replace(WILDCARD$1, "")(pattern);
10708
+ return Option.liftPredicate(String$1.replace(WILDCARD$1, String$1.replace(prefix, "")(specifier))(target), () => String$1.startsWith(prefix)(specifier));
10709
+ }));
10710
+ const existingSource = Effect.fn("existingSource")(function* existingSource(base) {
10711
+ const files = yield* RepositoryFiles;
10712
+ const found = yield* Effect.forEach(SOURCE_SUFFIXES, (suffix) => {
10713
+ const candidate = `${base}${suffix}`;
10714
+ return files.isDirectory(candidate).pipe(Effect.map((directory) => Option.liftPredicate(candidate, () => Option.exists(directory, (isDirectory) => !isDirectory))));
10715
+ }, { concurrency: 1 });
10716
+ return Array.head(Array.getSomes(found));
11093
10717
  });
11094
10718
  const localFile = Effect.fn("localFile")(function* localFile({ directory, imports }, from, specifier) {
11095
10719
  const files = yield* RepositoryFiles;
@@ -11156,7 +10780,7 @@ const InstalledManifest = Schema.Struct({
11156
10780
  peerDependencies: DependencyMap,
11157
10781
  peerDependenciesMeta: PeerMeta
11158
10782
  });
11159
- const decodeManifest$4 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
10783
+ const decodeManifest$6 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
11160
10784
  const keysOf = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
11161
10785
  const isOptionalPeer = (manifest, name) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(name)), Option.exists((meta) => meta.optional === true));
11162
10786
  const installedNames = (manifest) => [
@@ -11164,10 +10788,10 @@ const installedNames = (manifest) => [
11164
10788
  ...keysOf(manifest.optionalDependencies),
11165
10789
  ...pipe(keysOf(manifest.peerDependencies), Array.filter((name) => !isOptionalPeer(manifest, name)))
11166
10790
  ];
11167
- const childrenOf$1 = Effect.fn("childrenOf")(function* childrenOf(directory) {
10791
+ const childrenOf = Effect.fn("childrenOf")(function* childrenOf(directory) {
11168
10792
  const files = yield* RepositoryFiles;
11169
10793
  const text = yield* files.readFile(files.join(directory, MANIFEST_FILE$3));
11170
- return pipe(text, Option.flatMap(decodeManifest$4), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
10794
+ return pipe(text, Option.flatMap(decodeManifest$6), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
11171
10795
  });
11172
10796
  const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
11173
10797
  const files = yield* RepositoryFiles;
@@ -11193,7 +10817,7 @@ const closureOf = (provided, collect) => Array.match(collect.pending, {
11193
10817
  ...collect,
11194
10818
  pending: rest
11195
10819
  });
11196
- return childrenOf$1(resolved.value).pipe(Effect.flatMap((children) => closureOf(provided, {
10820
+ return childrenOf(resolved.value).pipe(Effect.flatMap((children) => closureOf(provided, {
11197
10821
  pending: [...rest, ...children],
11198
10822
  seen: HashSet.add(collect.seen, resolved.value)
11199
10823
  })));
@@ -11229,11 +10853,11 @@ const LISTED_LARGEST = 5;
11229
10853
  const SIZE_CONCURRENCY = 32;
11230
10854
  const MEGABYTE = 1e6;
11231
10855
  const MEGABYTE_DIGITS = 1;
11232
- const START$12 = 0;
10856
+ const START$16 = 0;
11233
10857
  const SINGLE_ENTRY = 1;
11234
10858
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
11235
10859
  const usageHint = (dependency, entryCount) => {
11236
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$12 && dependency.entries.length < entryCount)) return "";
10860
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$16 && dependency.entries.length < entryCount)) return "";
11237
10861
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
11238
10862
  };
11239
10863
  const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -11242,7 +10866,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
11242
10866
  const { workspace, total } = overrun;
11243
10867
  const config = yield* files.readFile(workspace.configFile);
11244
10868
  const source = Option.getOrElse(config, () => "");
11245
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$12);
10869
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$16);
11246
10870
  return {
11247
10871
  file: workspace.configFile,
11248
10872
  ...positionOf(source)(index),
@@ -11259,7 +10883,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
11259
10883
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
11260
10884
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
11261
10885
  const sizes = HashMap.fromIterable(measured);
11262
- const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$12))));
10886
+ const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$16))));
11263
10887
  return {
11264
10888
  closures,
11265
10889
  sizeOf,
@@ -11292,11 +10916,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
11292
10916
  })];
11293
10917
  });
11294
10918
  const stackProblems = (file, source, dependencies) => {
11295
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$12);
10919
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$16);
11296
10920
  const rest = String$1.slice(section)(source);
11297
10921
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
11298
10922
  file,
11299
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$12)),
10923
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$16)),
11300
10924
  rule: STACK_DEPENDENCY,
11301
10925
  message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
11302
10926
  })));
@@ -11663,7 +11287,7 @@ const derivationScopeOf = (node) => {
11663
11287
  };
11664
11288
  const sourcesOf = (checker) => (node) => pipe(referencedSymbols(checker)(derivationScopeOf(node)), Array.filter((symbol) => Option.isSome(namedValuesOf(checker)(symbol))));
11665
11289
  const sitesUnder = (checker) => (node) => {
11666
- const nested = pipe(childrenOf$3(node), Array.flatMap((child) => sitesUnder(checker)(child)));
11290
+ const nested = pipe(childrenOf$2(node), Array.flatMap((child) => sitesUnder(checker)(child)));
11667
11291
  if (Array.isReadonlyArrayNonEmpty(nested)) return nested;
11668
11292
  return siteValuesOf(checker)(node).pipe(Option.map((values) => ({
11669
11293
  node,
@@ -11806,12 +11430,7 @@ const CACHE_DIRECTORY = [
11806
11430
  "value-owners"
11807
11431
  ];
11808
11432
  const CACHE_SUFFIX = ".json";
11809
- const MANIFEST_ENTRY = "package.json";
11810
- const SOURCE_ENTRY = "src";
11811
- const LOWER_LAYERS = ["entities", "shared"];
11812
- const PATH_SEPARATOR = "/";
11813
11433
  const EMPTY = "";
11814
- const NOT_INSTALLED = [];
11815
11434
  const FIELD_SEPARATOR = "\0";
11816
11435
  const LINE_SEPARATOR = "\n";
11817
11436
  const ValueSchema = Schema.Union([Schema.String, Schema.Finite]);
@@ -11857,55 +11476,10 @@ const fileDigest = (hash) => {
11857
11476
  });
11858
11477
  };
11859
11478
  const digestEntries = (digestFile) => (named) => Effect.forEach(named, ([name, file]) => digestFile(file).pipe(Effect.map((found) => entryOf(name, found))), { concurrency: 1 });
11860
- const walked = (directory) => Effect.gen(function* walkFrom() {
11861
- const files = yield* RepositoryFiles;
11862
- const found = yield* files.walkDirectory(directory);
11863
- return pipe(found, Array.map((file) => files.join(directory, file)));
11864
- });
11865
- const sourceFiles = Effect.fn("sourceFiles")(function* sourceFiles(root, moduleDirectory) {
11866
- const files = yield* RepositoryFiles;
11867
- const source = files.join(root, SOURCE_ENTRY);
11868
- const layers = pipe(LOWER_LAYERS, Array.map((layer) => files.join(source, layer)));
11869
- const nested = yield* Effect.forEach([files.dirname(moduleDirectory), ...layers], walked, { concurrency: 1 });
11870
- return Array.flatten(nested);
11871
- });
11872
- const bundleParts = Effect.fn("bundleParts")(function* bundleParts(root, moduleDirectory) {
11873
- const files = yield* RepositoryFiles;
11874
- const bundled = yield* walked(moduleDirectory);
11875
- return {
11876
- listed: [files.join(root, MANIFEST_ENTRY), ...bundled],
11877
- installed: NOT_INSTALLED
11878
- };
11879
- });
11880
- const sourceParts = Effect.fn("sourceParts")(function* sourceParts(root, moduleDirectory) {
11881
- return {
11882
- listed: yield* sourceFiles(root, moduleDirectory),
11883
- installed: yield* installedPackages(root, root)
11884
- };
11885
- });
11886
- /** @internal */
11887
- const implementationOf = Effect.fn("implementationOf")(function* implementationOf(moduleDirectory) {
11888
- const files = yield* RepositoryFiles;
11889
- const root = yield* nearestManifestDirectory(moduleDirectory);
11890
- const fromSource = String$1.startsWith(`${files.join(root, SOURCE_ENTRY)}${PATH_SEPARATOR}`)(moduleDirectory);
11891
- const parts = yield* Boolean$1.match(fromSource, {
11892
- onFalse: () => bundleParts(root, moduleDirectory),
11893
- onTrue: () => sourceParts(root, moduleDirectory)
11894
- });
11895
- return {
11896
- files: pipe(Array.sort(parts.listed, String$1.Order), Array.map((file) => [files.relative(root, file), file])),
11897
- installed: parts.installed
11898
- };
11899
- });
11900
- const fingerprintOf = Effect.fn("fingerprintOf")(function* fingerprintOf(hash) {
11901
- const implementation = yield* implementationOf(import.meta.dirname);
11902
- const entries = yield* digestEntries(fileDigest(hash))(implementation.files);
11903
- return yield* hash(Array.join([...implementation.installed, ...entries], LINE_SEPARATOR));
11904
- });
11905
11479
  const analysisCache = Effect.fn("analysisCache")(function* analysisCache(root, owners) {
11906
11480
  const files = yield* RepositoryFiles;
11907
11481
  const hash = yield* hasher;
11908
- const fingerprint = yield* fingerprintOf(hash);
11482
+ const fingerprint = yield* implementationFingerprint(import.meta.dirname);
11909
11483
  const salt = yield* hash(Array.join([fingerprint, String$1.replaceAll(root, EMPTY)(owners)], FIELD_SEPARATOR));
11910
11484
  return {
11911
11485
  root,
@@ -12002,7 +11576,7 @@ const duplicateProblems = (relative) => (sites) => {
12002
11576
  }))));
12003
11577
  };
12004
11578
  // src/features/check-value-owners/model/name-lists.ts
12005
- const RULE$22 = "hand-written-names";
11579
+ const RULE$25 = "hand-written-names";
12006
11580
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
12007
11581
  const nameListOf = (site) => {
12008
11582
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -12017,7 +11591,7 @@ const problemOf$6 = ({ list, reason }) => ({
12017
11591
  file: list.site.file,
12018
11592
  line: list.site.line,
12019
11593
  column: list.site.column,
12020
- rule: RULE$22,
11594
+ rule: RULE$25,
12021
11595
  message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
12022
11596
  });
12023
11597
  // src/features/check-value-owners/model/declared-names.ts
@@ -12058,7 +11632,7 @@ const declaredNameProblem = ({ literals, relative }) => {
12058
11632
  const PATH_PREFIX = /^(?:!|\.\/)+/u;
12059
11633
  const GLOB = /[*?{[]/u;
12060
11634
  const EXTENSION$1 = /\.[^./]+$/u;
12061
- const SEPARATOR$5 = "/";
11635
+ const SEPARATOR$6 = "/";
12062
11636
  const ROOT = ".";
12063
11637
  const namedPath = (repository, file) => (name) => {
12064
11638
  const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
@@ -12067,12 +11641,12 @@ const namedPath = (repository, file) => (name) => {
12067
11641
  return pipe([fromFile, bare], Array.findFirst((path) => HashSet.has(repository.paths, path)));
12068
11642
  };
12069
11643
  const kindOf = (repository) => (path) => {
12070
- if (HashSet.has(repository.directories, path)) return SEPARATOR$5;
11644
+ if (HashSet.has(repository.directories, path)) return SEPARATOR$6;
12071
11645
  return pipe(path, String$1.match(EXTENSION$1), Option.flatMap(Array.head), Option.getOrElse(() => path));
12072
11646
  };
12073
11647
  const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
12074
11648
  const coversDirectory = (repository) => (group) => pipe(Array.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
12075
- const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$5}${kindOf(repository)(path)}`), Record.values, Array.findFirst(coversDirectory(repository)), Option.flatMap(Array.head), Option.map(repository.dirname));
11649
+ const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$6}${kindOf(repository)(path)}`), Record.values, Array.findFirst(coversDirectory(repository)), Option.flatMap(Array.head), Option.map(repository.dirname));
12076
11650
  const directoryLabel = (directory) => {
12077
11651
  if (directory === ROOT) return "the repository root";
12078
11652
  return directory;
@@ -12123,16 +11697,16 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
12123
11697
  };
12124
11698
  // src/features/check-value-owners/model/repository-names.ts
12125
11699
  const MANIFEST$2 = "package.json";
12126
- const SEPARATOR$4 = "/";
11700
+ const SEPARATOR$5 = "/";
12127
11701
  const FIRST_SEGMENT = 1;
12128
11702
  const ManifestJson = Schema.fromJsonString(Schema.Struct({ name: Schema.optionalKey(Schema.String) }));
12129
- const decodeManifest$3 = Schema.decodeUnknownOption(ManifestJson);
11703
+ const decodeManifest$5 = Schema.decodeUnknownOption(ManifestJson);
12130
11704
  const prefixesOf = (file) => {
12131
- const segments = pipe(file, String$1.split(SEPARATOR$4));
12132
- return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$4))));
11705
+ const segments = pipe(file, String$1.split(SEPARATOR$5));
11706
+ return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$5))));
12133
11707
  };
12134
11708
  const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array.dropRight(FIRST_SEGMENT));
12135
- const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$3), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
11709
+ const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$5), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
12136
11710
  const repositoryNamesOf = Effect.fn("repositoryNamesOf")(function* repositoryNamesOf(root) {
12137
11711
  const files = yield* RepositoryFiles;
12138
11712
  const listed = yield* files.listedFiles(root);
@@ -12151,7 +11725,7 @@ const repositoryNamesOf = Effect.fn("repositoryNamesOf")(function* repositoryNam
12151
11725
  });
12152
11726
  // src/features/check-value-owners/model/check.ts
12153
11727
  const scanOwners = Effect.fn("scanOwners")(function* scanOwners(workspace, configPaths) {
12154
- const ownerConfigs = yield* pipe(configPaths, Effect.filter(mentions(`@${OWNER_TAG}`)(workspace.compiler)));
11728
+ const ownerConfigs = yield* pipe(configPaths, Effect.filter(mentions$1(`@${OWNER_TAG}`)(workspace.compiler)));
12155
11729
  const scans = yield* Effect.forEach(ownerConfigs, (configPath) => withProject(workspace)(configPath)((project) => Effect.sync(() => ownersIn(project))), { concurrency: 1 });
12156
11730
  return combineOwnerScans(Array.getSomes(scans));
12157
11731
  });
@@ -12244,7 +11818,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
12244
11818
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
12245
11819
  }, Effect.scoped);
12246
11820
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
12247
- const RULE$21 = "namespace-destructuring";
11821
+ const RULE$24 = "namespace-destructuring";
12248
11822
  const LOCAL = /^[.#/]/u;
12249
11823
  const messageOf$1 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
12250
11824
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -12260,7 +11834,7 @@ const destructuredName = (declaration) => {
12260
11834
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
12261
11835
  };
12262
11836
  const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
12263
- rule: RULE$21,
11837
+ rule: RULE$24,
12264
11838
  message: messageOf$1(name)
12265
11839
  })), Option.map((report) => report(declaration)));
12266
11840
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -12268,7 +11842,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
12268
11842
  return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
12269
11843
  };
12270
11844
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
12271
- const RULE$20 = "pass-through-wrapper";
11845
+ const RULE$23 = "pass-through-wrapper";
12272
11846
  const SINGLE_STATEMENT = 1;
12273
11847
  const SINGLE_DECLARATION = 1;
12274
11848
  const THIS_PARAMETER = "this";
@@ -12365,7 +11939,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
12365
11939
  const problemOf$4 = (checker) => (candidate) => {
12366
11940
  if (changesTheCall(candidate.wrapper)) return Option.none();
12367
11941
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
12368
- rule: RULE$20,
11942
+ rule: RULE$23,
12369
11943
  message: messageOf(forward.callee.getText())
12370
11944
  })(candidate.name)));
12371
11945
  };
@@ -12374,20 +11948,20 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
12374
11948
  /** @internal */
12375
11949
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
12376
11950
  // src/features/check-agent-settings/model/missing-hooks.ts
12377
- const RULE$19 = "missing-hook";
11951
+ const RULE$22 = "missing-hook";
12378
11952
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
12379
11953
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
12380
11954
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12381
11955
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12382
11956
  const PLUGIN_ROOT = "..";
12383
- const READ_CONCURRENCY$9 = 16;
12384
- const START$11 = 0;
11957
+ const READ_CONCURRENCY$10 = 16;
11958
+ const START$15 = 0;
12385
11959
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12386
11960
  path,
12387
- index: found.index ?? START$11
11961
+ index: found.index ?? START$15
12388
11962
  })), Option.toArray);
12389
11963
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12390
- const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
11964
+ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12391
11965
  const files = yield* RepositoryFiles;
12392
11966
  const text = yield* files.readFile(file);
12393
11967
  if (Option.isNone(text)) return [];
@@ -12399,7 +11973,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12399
11973
  return pipe(missing, Array.map(({ path, index }) => ({
12400
11974
  file,
12401
11975
  ...positionOf(source)(index),
12402
- rule: RULE$19,
11976
+ rule: RULE$22,
12403
11977
  message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
12404
11978
  })));
12405
11979
  });
@@ -12423,14 +11997,14 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12423
11997
  }];
12424
11998
  return [];
12425
11999
  }));
12426
- const found = yield* Effect.forEach(hookFiles, problemsIn$8, { concurrency: READ_CONCURRENCY$9 });
12000
+ const found = yield* Effect.forEach(hookFiles, problemsIn$9, { concurrency: READ_CONCURRENCY$10 });
12427
12001
  return Array.flatten(found);
12428
12002
  });
12429
12003
  // src/shared/lib/section-check.ts
12430
12004
  const taggedError$3 = Schema.TaggedError;
12431
12005
  var SectionConfigUnreadable = class extends taggedError$3()("SectionConfigUnreadable", { file: Schema.String }) {};
12432
12006
  const CONFIG_FILE$2 = "vite.config.ts";
12433
- const FIRST$6 = 1;
12007
+ const FIRST$7 = 1;
12434
12008
  const sectionAt = (file, pick) => Effect.gen(function* readSection() {
12435
12009
  if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
12436
12010
  const config = yield* Effect.tryPromise({
@@ -12441,8 +12015,8 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
12441
12015
  });
12442
12016
  const failureAt = (file, rule, message) => [{
12443
12017
  file,
12444
- line: FIRST$6,
12445
- column: FIRST$6,
12018
+ line: FIRST$7,
12019
+ column: FIRST$7,
12446
12020
  rule,
12447
12021
  message
12448
12022
  }];
@@ -12464,7 +12038,7 @@ const checkSection = (check) => (root) => Effect.gen(function* runSection() {
12464
12038
  onSuccess: (found) => pipe(found, Array.filter(({ severity }) => severity === "error"), Array.map((diagnostic) => ({
12465
12039
  file: files.join(root, diagnostic.path),
12466
12040
  line: diagnostic.line,
12467
- column: diagnostic.column ?? FIRST$6,
12041
+ column: diagnostic.column ?? FIRST$7,
12468
12042
  rule: check.rule,
12469
12043
  message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
12470
12044
  })))
@@ -12484,10 +12058,10 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
12484
12058
  const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
12485
12059
  const EXTENSION = /\.[^./]+$/u;
12486
12060
  const SETTINGS_FILE = ".claude/settings.json";
12487
- const READ_CONCURRENCY$8 = 64;
12488
- const FIRST$5 = 1;
12489
- const RULE$18 = "shell-script";
12490
- const MESSAGE$8 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
12061
+ const READ_CONCURRENCY$9 = 64;
12062
+ const FIRST$6 = 1;
12063
+ const RULE$21 = "shell-script";
12064
+ const MESSAGE$10 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
12491
12065
  const HookSchema = Schema.Struct({
12492
12066
  command: Schema.optional(Schema.String),
12493
12067
  args: Schema.optional(Schema.Array(Schema.String))
@@ -12507,10 +12081,10 @@ const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.ge
12507
12081
  const hasExtension = (name) => EXTENSION.test(baseName(name));
12508
12082
  const problemFor$1 = (file) => ({
12509
12083
  file,
12510
- line: FIRST$5,
12511
- column: FIRST$5,
12512
- rule: RULE$18,
12513
- message: MESSAGE$8
12084
+ line: FIRST$6,
12085
+ column: FIRST$6,
12086
+ rule: RULE$21,
12087
+ message: MESSAGE$10
12514
12088
  });
12515
12089
  /** @internal */
12516
12090
  const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
@@ -12526,12 +12100,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
12526
12100
  return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
12527
12101
  };
12528
12102
  const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
12529
- const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$8 });
12103
+ const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
12530
12104
  return pipe(shell, Array.map((name) => problemFor$1(files.join(root, name))));
12531
12105
  });
12532
12106
  // src/shared/lib/workflow-files.ts
12533
12107
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
12534
- const READ_CONCURRENCY$7 = 16;
12108
+ const READ_CONCURRENCY$8 = 16;
12535
12109
  const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
12536
12110
  const files = yield* RepositoryFiles;
12537
12111
  const names = yield* files.listedFiles(root);
@@ -12541,13 +12115,13 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
12541
12115
  file,
12542
12116
  source
12543
12117
  }))));
12544
- }, { concurrency: READ_CONCURRENCY$7 });
12118
+ }, { concurrency: READ_CONCURRENCY$8 });
12545
12119
  return Array.getSomes(found);
12546
12120
  });
12547
12121
  // src/shared/lib/workflow-run.ts
12548
12122
  const RUN_KEY = "run";
12549
- const START$10 = 0;
12550
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$10));
12123
+ const START$14 = 0;
12124
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$14));
12551
12125
  const runScriptsOf = (source) => {
12552
12126
  const found = [];
12553
12127
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -12562,28 +12136,28 @@ const runScriptsOf = (source) => {
12562
12136
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
12563
12137
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
12564
12138
  const COMMENT = "#";
12565
- const RULE$17 = "workflow-script";
12139
+ const RULE$20 = "workflow-script";
12566
12140
  const ONE_COMMAND = 1;
12567
- const MESSAGE$7 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
12141
+ const MESSAGE$9 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
12568
12142
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
12569
12143
  const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
12570
12144
  const runsMoreThanOneCommand = ({ text }) => {
12571
12145
  const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
12572
12146
  return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
12573
12147
  };
12574
- const problemsIn$7 = (file) => (source) => {
12148
+ const problemsIn$8 = (file) => (source) => {
12575
12149
  const at = positionOf(source);
12576
12150
  return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
12577
12151
  file,
12578
12152
  ...at(start),
12579
- rule: RULE$17,
12580
- message: MESSAGE$7
12153
+ rule: RULE$20,
12154
+ message: MESSAGE$9
12581
12155
  })));
12582
12156
  };
12583
12157
  /** @internal */
12584
12158
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
12585
12159
  const workflows = yield* readWorkflows(root);
12586
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$7(file)(source)));
12160
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$8(file)(source)));
12587
12161
  });
12588
12162
  // src/features/check-scripts/model/script-checks.ts
12589
12163
  /** @internal */
@@ -12603,12 +12177,12 @@ const checkStructure = checkSection({
12603
12177
  // src/features/check-vite-plus/model/command-words.ts
12604
12178
  const CONTINUATION = /\\\n/gu;
12605
12179
  const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
12606
- const SEPARATOR$3 = /&&|\|\||[;|\n`]|\$\(/u;
12180
+ const SEPARATOR$4 = /&&|\|\||[;|\n`]|\$\(/u;
12607
12181
  const BLANK$1 = /\s+/u;
12608
12182
  const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
12609
12183
  const QUOTE = "\"\"";
12610
12184
  const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array.filter(String$1.isNonEmpty), Array.dropWhile((word) => ASSIGNMENT.test(word)));
12611
- const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$3), Array.map(wordsOf), Array.filter(Array.isReadonlyArrayNonEmpty));
12185
+ const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$4), Array.map(wordsOf), Array.filter(Array.isReadonlyArrayNonEmpty));
12612
12186
  // src/features/check-vite-plus/model/command-problems.ts
12613
12187
  const PACKAGE_MANAGERS = [
12614
12188
  "pnpm",
@@ -12686,28 +12260,28 @@ const docSources = (file) => (source) => {
12686
12260
  })));
12687
12261
  };
12688
12262
  // src/features/check-vite-plus/model/command-sources.ts
12689
- const ROOT_DIRECTORY = ".";
12263
+ const ROOT_DIRECTORY$1 = ".";
12690
12264
  const COMMAND_KEY = "command";
12691
12265
  const ARGUMENTS_KEY = "args";
12692
- const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12693
- const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$2];
12266
+ const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12267
+ const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$4];
12694
12268
  const STEP_FILES = [
12695
12269
  ":(glob).github/workflows/*.yml",
12696
12270
  ":(glob).github/workflows/*.yaml",
12697
12271
  ":(glob)**/action.yml",
12698
12272
  ":(glob)**/action.yaml",
12699
- ...EXCLUDED$2
12273
+ ...EXCLUDED$4
12700
12274
  ];
12701
12275
  const HOOK_FILES = [":(glob).vite-hooks/*"];
12702
12276
  const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
12703
12277
  const AGENT_DOCS = [
12704
12278
  ":(glob)**/AGENTS.md",
12705
12279
  ":(glob)**/CLAUDE.md",
12706
- ...EXCLUDED$2
12280
+ ...EXCLUDED$4
12707
12281
  ];
12708
- const READ_CONCURRENCY$6 = 16;
12709
- const START$9 = 0;
12710
- const FIRST$4 = 1;
12282
+ const READ_CONCURRENCY$7 = 16;
12283
+ const START$13 = 0;
12284
+ const FIRST$5 = 1;
12711
12285
  const LINE = "\n";
12712
12286
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
12713
12287
  const decodeCommandText = Schema.decodeUnknownOption(CommandText);
@@ -12716,7 +12290,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
12716
12290
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
12717
12291
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
12718
12292
  const NO_SOURCES = [];
12719
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$9));
12293
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$13));
12720
12294
  const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
12721
12295
  const offset = offsetOf$2(source, `"${name}"`);
12722
12296
  return {
@@ -12738,8 +12312,8 @@ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE
12738
12312
  kind: "hook",
12739
12313
  file,
12740
12314
  position: {
12741
- line: index + FIRST$4,
12742
- column: FIRST$4
12315
+ line: index + FIRST$5,
12316
+ column: FIRST$5
12743
12317
  },
12744
12318
  name,
12745
12319
  text
@@ -12749,7 +12323,7 @@ const commandIn = (node) => {
12749
12323
  const record = node;
12750
12324
  return pipe(Option.fromUndefinedOr(record[COMMAND_KEY]), Option.filter(Predicate.isString), Option.map((command) => pipe(decodeArguments(record[ARGUMENTS_KEY]), Option.getOrElse(() => []), Array.prepend(command), Array.join(" "))));
12751
12325
  };
12752
- const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$2(node), Array.flatMap(commandsIn))];
12326
+ const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$1(node), Array.flatMap(commandsIn))];
12753
12327
  const agentSources = (file) => (source) => pipe(decodeJson$1(source), Option.map(commandsIn), Option.getOrElse(() => []), Array.map((text) => {
12754
12328
  const program = Array.headNonEmpty(String$1.split(text, " "));
12755
12329
  const offset = offsetOf$2(source, `"${program}"`);
@@ -12776,7 +12350,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
12776
12350
  return pipe(tasks, Array.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
12777
12351
  });
12778
12352
  const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
12779
- const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$6 });
12353
+ const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$7 });
12780
12354
  return Array.flatten(found);
12781
12355
  });
12782
12356
  const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
@@ -12788,7 +12362,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
12788
12362
  onSome: sourcesOf(file, name)
12789
12363
  });
12790
12364
  return files.readFile(file).pipe(Effect.map(sourcesIn));
12791
- }, { concurrency: READ_CONCURRENCY$6 });
12365
+ }, { concurrency: READ_CONCURRENCY$7 });
12792
12366
  return Array.flatten(found);
12793
12367
  });
12794
12368
  /** @internal */
@@ -12807,12 +12381,12 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
12807
12381
  readSources(root, hooks, hookSources),
12808
12382
  readSources(root, AGENT_FILES, agentSources),
12809
12383
  readSources(root, docs, docSources),
12810
- workspaceTasks(root, Array.dedupe([ROOT_DIRECTORY, ...workspaces]))
12384
+ workspaceTasks(root, Array.dedupe([ROOT_DIRECTORY$1, ...workspaces]))
12811
12385
  ], { concurrency: "unbounded" });
12812
12386
  return Array.flatten(found);
12813
12387
  });
12814
12388
  // src/features/check-vite-plus/model/package-scripts.ts
12815
- const RULE$16 = "package-script";
12389
+ const RULE$19 = "package-script";
12816
12390
  const LIFECYCLE = [
12817
12391
  "preinstall",
12818
12392
  "install",
@@ -12835,26 +12409,26 @@ const LIFECYCLE = [
12835
12409
  const problemOf$3 = ({ file, position, name }) => ({
12836
12410
  file,
12837
12411
  ...position,
12838
- rule: RULE$16,
12412
+ rule: RULE$19,
12839
12413
  message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
12840
12414
  });
12841
12415
  const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
12842
12416
  // src/features/check-vite-plus/model/vite-plus-block.ts
12843
- const RULE$15 = "vite-plus-block";
12417
+ const RULE$18 = "vite-plus-block";
12844
12418
  const MARKER = Array.join([
12845
12419
  "<!--",
12846
12420
  "VITE PLUS START",
12847
12421
  "-->"
12848
12422
  ], "");
12849
- const MESSAGE$6 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
12423
+ const MESSAGE$8 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
12850
12424
  const problemIn = (file) => (source) => {
12851
12425
  const index = String$1.indexOf(MARKER)(source);
12852
12426
  if (Option.isNone(index)) return Option.none();
12853
12427
  return Option.some({
12854
12428
  file,
12855
12429
  ...positionOf(source)(index.value),
12856
- rule: RULE$15,
12857
- message: MESSAGE$6
12430
+ rule: RULE$18,
12431
+ message: MESSAGE$8
12858
12432
  });
12859
12433
  };
12860
12434
  /** @internal */
@@ -12909,11 +12483,11 @@ const checkFullHistoryCheckout = workflowCheck({
12909
12483
  })
12910
12484
  });
12911
12485
  // src/features/check-workflows/model/publish-trigger.ts
12912
- const RULE$13 = "publish-trigger";
12486
+ const RULE$16 = "publish-trigger";
12913
12487
  const PUBLISH = /\bmsch-publish\b/u;
12914
12488
  const MANUAL = "workflow_dispatch";
12915
12489
  const TRIGGER_KEY = "on";
12916
- const MESSAGE$4 = "publishes with `msch-publish` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
12490
+ const MESSAGE$6 = "publishes with `msch-publish` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
12917
12491
  const triggersOf = (node) => {
12918
12492
  if (isScalar(node)) return [String(node.value)];
12919
12493
  if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
@@ -12929,19 +12503,19 @@ const publishTriggerOffsetsOf = (source) => {
12929
12503
  };
12930
12504
  /** @internal */
12931
12505
  const checkPublishTrigger = workflowCheck({
12932
- rule: RULE$13,
12933
- message: MESSAGE$4,
12506
+ rule: RULE$16,
12507
+ message: MESSAGE$6,
12934
12508
  offsetsOf: publishTriggerOffsetsOf
12935
12509
  });
12936
12510
  // src/features/check-workflows/model/release-please.ts
12937
- const RULE$12 = "release-please";
12511
+ const RULE$15 = "release-please";
12938
12512
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
12939
12513
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
12940
- const FIRST$3 = 1;
12941
- const MESSAGE$3 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
12514
+ const FIRST$4 = 1;
12515
+ const MESSAGE$5 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
12942
12516
  const checkReleasePleaseSteps = workflowCheck({
12943
- rule: RULE$12,
12944
- message: MESSAGE$3,
12517
+ rule: RULE$15,
12518
+ message: MESSAGE$5,
12945
12519
  offsetsOf: scalarKeyOffsets({
12946
12520
  name: "uses",
12947
12521
  matches: (value) => RELEASE_PLEASE.test(value)
@@ -12952,10 +12526,10 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
12952
12526
  const names = yield* files.listedFiles(root);
12953
12527
  return pipe(names, Array.filter((name) => RELEASE_PLEASE_FILE.test(name)), Array.map((name) => ({
12954
12528
  file: files.join(root, name),
12955
- line: FIRST$3,
12956
- column: FIRST$3,
12957
- rule: RULE$12,
12958
- message: MESSAGE$3
12529
+ line: FIRST$4,
12530
+ column: FIRST$4,
12531
+ rule: RULE$15,
12532
+ message: MESSAGE$5
12959
12533
  })));
12960
12534
  });
12961
12535
  /** @internal */
@@ -12966,26 +12540,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
12966
12540
  // src/features/check-workflows/model/workflow-queue.ts
12967
12541
  const CONCURRENCY_KEY = "concurrency";
12968
12542
  const QUEUE_KEY = "queue";
12969
- const RULE$11 = "workflow-queue";
12970
- const MESSAGE$2 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
12543
+ const RULE$14 = "workflow-queue";
12544
+ const MESSAGE$4 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
12971
12545
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
12972
12546
  /** @internal */
12973
12547
  const checkWorkflowQueues = workflowCheck({
12974
- rule: RULE$11,
12975
- message: MESSAGE$2,
12548
+ rule: RULE$14,
12549
+ message: MESSAGE$4,
12976
12550
  offsetsOf: queueOffsetsOf
12977
12551
  });
12978
12552
  // src/features/check-workflows/model/workflow-commits.ts
12979
- const RULE$10 = "workflow-commit";
12553
+ const RULE$13 = "workflow-commit";
12980
12554
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
12981
12555
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
12982
- const MESSAGE$1 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
12556
+ const MESSAGE$3 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
12983
12557
  const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source), Array.filter(({ value }) => isScalar(value) && typeof value.value === "string" && pattern.test(value.value)), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([start]) => start), Option.toArray)));
12984
12558
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
12985
12559
  /** @internal */
12986
12560
  const checkWorkflowCommits = workflowCheck({
12987
- rule: RULE$10,
12988
- message: MESSAGE$1,
12561
+ rule: RULE$13,
12562
+ message: MESSAGE$3,
12989
12563
  offsetsOf: commitOffsetsOf
12990
12564
  });
12991
12565
  // src/features/check-workflows/model/workflow-lint.ts
@@ -13032,29 +12606,12 @@ const trimmed = ({ index, text }) => ({
13032
12606
  });
13033
12607
  // src/features/ban-comments/model/config-comments.ts
13034
12608
  const NEXT$1 = 1;
13035
- const isRecord = (value) => typeof value === "object" && value !== null;
13036
- const childrenOf = (value) => {
13037
- if (Array.isArray(value)) return value;
13038
- if (isRecord(value)) return Record.values(value);
13039
- return [];
13040
- };
13041
- const collect = (isItem) => (value) => {
13042
- if (isItem(value)) return [value];
13043
- return pipe(childrenOf(value), Array.flatMap(collect(isItem)));
13044
- };
13045
- const isYamlComment = (value) => isRecord(value) && value["type"] === "comment" && typeof value["offset"] === "number" && typeof value["source"] === "string";
13046
12609
  const yamlComments = (source) => Effect.try({
13047
- try: () => pipe(Array.fromIterable(new Parser().parse(source)), Array.flatMap(collect(isYamlComment)), Array.map((token) => trimmed({
13048
- index: token.offset,
13049
- text: token.source
13050
- }))),
12610
+ try: () => pipe(yamlSourceComments(source), Array.map(trimmed)),
13051
12611
  catch: unreadable("yaml")
13052
12612
  });
13053
12613
  const tomlComments = (source) => Effect.try({
13054
- try: () => pipe(parseTOML(source).comments, Array.map(({ range: [start, end] }) => trimmed({
13055
- index: start,
13056
- text: String$1.slice(start, end)(source)
13057
- }))),
12614
+ try: () => pipe(tomlSourceComments(source), Array.map(trimmed)),
13058
12615
  catch: unreadable("toml")
13059
12616
  });
13060
12617
  const isSqlComment = (value) => isRecord(value) && (value["type"] === "line_comment" || value["type"] === "block_comment") && typeof value["text"] === "string" && Array.isArray(value["range"]);
@@ -13066,7 +12623,7 @@ const sqlComments = (source) => Effect.try({
13066
12623
  includeRange: true,
13067
12624
  paramTypes: []
13068
12625
  });
13069
- return pipe(collect(isSqlComment)(program), Array.map(({ range: [start], text }) => trimmed({
12626
+ return pipe(collectNodes(isSqlComment)(program), Array.map(({ range: [start], text }) => trimmed({
13070
12627
  index: start,
13071
12628
  text
13072
12629
  })));
@@ -13106,7 +12663,7 @@ const COMMENT_NODES = [
13106
12663
  "block_comment",
13107
12664
  "multiline_comment"
13108
12665
  ];
13109
- const START$8 = 0;
12666
+ const START$12 = 0;
13110
12667
  const NEXT = 1;
13111
12668
  const NONE$1 = [];
13112
12669
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
@@ -13159,7 +12716,7 @@ const markupComment = (source) => (node) => {
13159
12716
  }];
13160
12717
  };
13161
12718
  const textComments = (grammars, grammar) => (text) => {
13162
- const shift = shifted(text.startIndex ?? START$8);
12719
+ const shift = shifted(text.startIndex ?? START$12);
13163
12720
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
13164
12721
  };
13165
12722
  const embeddedComments = (grammars) => (node) => {
@@ -13195,11 +12752,11 @@ const commentsWith = (grammars) => (reader, source) => {
13195
12752
  }[reader](source);
13196
12753
  };
13197
12754
  // src/features/ban-comments/model/comments.ts
13198
- const RULE$9 = "comment";
12755
+ const RULE$12 = "comment";
13199
12756
  const CONFIG_FILE$1 = "vite.config.ts";
13200
12757
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
13201
- const READ_CONCURRENCY$5 = 64;
13202
- const START$7 = 0;
12758
+ const READ_CONCURRENCY$6 = 64;
12759
+ const START$11 = 0;
13203
12760
  const FIRST_LINE$4 = 1;
13204
12761
  const FIRST_COLUMN$3 = 1;
13205
12762
  const READERS$1 = [
@@ -13233,7 +12790,7 @@ const SHEBANG = "#!";
13233
12790
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
13234
12791
  const VERSION = /^\s?v?\d[\w.+-]*$/u;
13235
12792
  const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
13236
- const MESSAGE = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
12793
+ const MESSAGE$2 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
13237
12794
  const Patterns = Schema.Array(Schema.String);
13238
12795
  const CommentSettings = Schema.Struct({ allow: Patterns });
13239
12796
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
@@ -13256,23 +12813,23 @@ const shebangReader = (source) => {
13256
12813
  const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
13257
12814
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
13258
12815
  const lineBefore = (source, index) => {
13259
- const lines = pipe(source, String$1.slice(START$7, index), String$1.split("\n"));
12816
+ const lines = pipe(source, String$1.slice(START$11, index), String$1.split("\n"));
13260
12817
  return Option.getOrElse(Array.last(lines), () => "");
13261
12818
  };
13262
12819
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
13263
- const isShebang = ({ index, text }) => index === START$7 && String$1.startsWith(SHEBANG)(text);
12820
+ const isShebang = ({ index, text }) => index === START$11 && String$1.startsWith(SHEBANG)(text);
13264
12821
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
13265
12822
  const problemOf$2 = (file, source) => ({ index }) => ({
13266
12823
  file,
13267
12824
  ...positionOf(source)(index),
13268
- rule: RULE$9,
13269
- message: MESSAGE
12825
+ rule: RULE$12,
12826
+ message: MESSAGE$2
13270
12827
  });
13271
12828
  const unreadableProblem = (file, message) => ({
13272
12829
  file,
13273
12830
  line: FIRST_LINE$4,
13274
12831
  column: FIRST_COLUMN$3,
13275
- rule: RULE$9,
12832
+ rule: RULE$12,
13276
12833
  message: `msch could not read the comments in this file: ${message}`
13277
12834
  });
13278
12835
  const settingsOf = ({ msch, lint }) => ({
@@ -13327,10 +12884,14 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
13327
12884
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
13328
12885
  onNone: () => Effect.succeed(NONE),
13329
12886
  onSome: (source) => problemsIn(entry, source)
13330
- }))), { concurrency: READ_CONCURRENCY$5 });
12887
+ }))), { concurrency: READ_CONCURRENCY$6 });
13331
12888
  return Array.flatten(found);
13332
12889
  });
13333
12890
  // src/features/ban-tools/model/banned-tool.ts
12891
+ const PROGRAM_SOURCE = /\.(?:[cm]?[jt]sx?|rs|cs|go)$/u;
12892
+ const CONFIG_SOURCE = /(?:^|\/)[^/]*\.config\.[cm]?[jt]s$/u;
12893
+ const isProgramSource = ({ name }) => PROGRAM_SOURCE.test(name) && !CONFIG_SOURCE.test(name);
12894
+ const spawnPattern = (program) => new RegExp(String.raw`(?:\bcommand["']?\s*[:=]\s*|(?:\bspawn\w*|\bexec\w*|\bexeca|Command::new|ChildProcess\.make)\(\s*|\$\(\s*|\$\s*(?=\x60))["'\x60](?:${program})(?=["'\x60\s])`, "gu");
13334
12895
  const FIRST_LINE$3 = 1;
13335
12896
  const FIRST_COLUMN$2 = 1;
13336
12897
  const WHOLE_MATCH$1 = 0;
@@ -13362,18 +12923,23 @@ const RENAMES = [
13362
12923
  [/(?:^|\/)(?:[^/]+)?\.dockerignore$/u, ".containerignore"],
13363
12924
  [/(?:^|\/)docker-compose(?:\.[^/]+)?\.ya?ml$/u, "compose.yaml"]
13364
12925
  ];
12926
+ const SPAWN_PATTERNS$1 = [spawnPattern("docker(?:-compose)?")];
13365
12927
  const COMMAND_PATTERNS$1 = [
13366
12928
  /(?<![\w./@-])docker[ \t]+(?:build|buildx|compose|run|push|pull|login|logout|exec|tag|image|images|ps|rm|rmi|stop|start|kill|save|load|create|cp|inspect|logs|network|volume|system|manifest|context|container)\b/gu,
13367
12929
  /(?<![\w./@-])docker-compose[ \t]+(?:up|down|build|run|exec|pull|push|ps|logs|stop|start|restart|config)\b/gu,
13368
- /(?:\bcommand["']?\s*[:=]\s*|(?:\bspawn\w*|\bexec\w*|\bexeca|Command::new|ChildProcess\.make|\$)\(\s*)["'`]docker(?:-compose)?["'`]/gu,
12930
+ ...SPAWN_PATTERNS$1,
13369
12931
  /\buses:\s*["']?docker(?:\/[\w.-]+|:\/\/)/gu
13370
12932
  ];
12933
+ const patternsFor$1 = (entry) => {
12934
+ if (isProgramSource(entry)) return SPAWN_PATTERNS$1;
12935
+ return COMMAND_PATTERNS$1;
12936
+ };
13371
12937
  const renameOf = ({ name }) => pipe(RENAMES, Array.findFirst(([pattern]) => pattern.test(name)), Option.map(([, renamed]) => renamed));
13372
12938
  const DOCKER = {
13373
12939
  fileRule: "docker-file",
13374
12940
  commandRule: "docker-command",
13375
12941
  isFile: (entry) => Option.isSome(renameOf(entry)),
13376
- patternsFor: () => COMMAND_PATTERNS$1,
12942
+ patternsFor: patternsFor$1,
13377
12943
  fileMessage: (entry) => `Docker is not used in this repository: podman builds and runs containers. Name this file ${Option.getOrElse(renameOf(entry), () => "for podman")}, the name podman reads.`,
13378
12944
  commandMessage: (command) => `Docker is not used in this repository. Replace \`${command}\` with podman, which takes the same arguments.`
13379
12945
  };
@@ -13381,6 +12947,7 @@ const DOCKER = {
13381
12947
  const checkDocker = (root) => checkBannedTool(root, DOCKER);
13382
12948
  // src/features/ban-tools/model/python.ts
13383
12949
  const PYTHON_FILE = /(?:\.(?:py|pyi|pyw|pyx|ipynb)|(?:^|\/)(?:pyproject\.toml|uv\.lock|uv\.toml|poetry\.lock|Pipfile|Pipfile\.lock|setup\.cfg|tox\.ini|pytest\.ini|\.python-version|requirements[^/]*\.txt))$/u;
12950
+ const SPAWN_PATTERNS = [spawnPattern(String.raw`python[\d.]*|pip3?|pipx|uvx?|poetry`)];
13384
12951
  const COMMAND_PATTERNS = [
13385
12952
  /(?<![\w./@-])python[\d.]*[ \t]+(?:[-"'$./]|\S+\.py\b)/gu,
13386
12953
  /(?<![\w./@-])pip3?[ \t]+(?:install|uninstall|download|freeze|wheel|compile|sync)\b/gu,
@@ -13388,11 +12955,12 @@ const COMMAND_PATTERNS = [
13388
12955
  /(?<![\w./@-])uvx[ \t]+[^\s=:,;)|&]/gu,
13389
12956
  /(?<![\w./@-])uv[ \t]+(?:run|sync|lock|pip|tool|venv|add|remove|python|export|build|publish|init|tree|cache|self)\b/gu,
13390
12957
  /(?<![\w./@-])poetry[ \t]+(?:run|install|add|lock|build|publish|shell|export)\b/gu,
13391
- /(?:\bcommand["']?\s*[:=]\s*|(?:\bspawn\w*|\bexec\w*|\bexeca|Command::new|ChildProcess\.make|\$)\(\s*)["'`](?:python[\d.]*|pip3?|pipx|uvx?|poetry)["'`]/gu,
12958
+ ...SPAWN_PATTERNS,
13392
12959
  /\buses:\s*["']?(?:actions\/setup-python|astral-sh\/setup-uv|astral-sh\/ruff-action|pypa\/[\w.-]+|snok\/install-poetry|abatilo\/actions-poetry|conda-incubator\/setup-miniconda|mamba-org\/setup-micromamba|pdm-project\/setup-pdm)\b/gu
13393
12960
  ];
13394
12961
  const TOOL_PATTERNS$1 = [/^[ \t]*["']?(?:python|uv|pipx|poetry|ruff|pdm|hatch|pipx:[^"'\s=]+)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
13395
12962
  const patternsFor = (entry) => {
12963
+ if (isProgramSource(entry)) return SPAWN_PATTERNS;
13396
12964
  if (isToolVersions(entry)) return [...COMMAND_PATTERNS, ...TOOL_PATTERNS$1];
13397
12965
  return COMMAND_PATTERNS;
13398
12966
  };
@@ -13407,7 +12975,7 @@ const PYTHON = {
13407
12975
  /** @internal */
13408
12976
  const checkPython = (root) => checkBannedTool(root, PYTHON);
13409
12977
  // src/features/check-catalog-entries/model/catalog-entries.ts
13410
- const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
12978
+ const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
13411
12979
  const MANIFEST$1 = /(?:^|\/)package\.json$/u;
13412
12980
  const CATALOG_PROTOCOL = "catalog:";
13413
12981
  const DEFAULT_CATALOG = "default";
@@ -13416,25 +12984,25 @@ const WILDCARD = "*";
13416
12984
  const FIRST_LINE$2 = 1;
13417
12985
  const FIRST_COLUMN$1 = 1;
13418
12986
  const SCOPED_NAME = /^(?<name>@?[^@]+)(?:@(?<versions>.+))?$/u;
13419
- const READ_CONCURRENCY$4 = 16;
12987
+ const READ_CONCURRENCY$5 = 16;
13420
12988
  const STALE_RULE = "stale-release-age-exclude";
13421
12989
  const UNUSED_RULE = "unused-catalog-entry";
13422
12990
  const STALE_MESSAGE = "excludes a version from `minimumReleaseAge` that the lockfile no longer resolves. Remove the entry: it only exempted that one version while it was new.";
13423
12991
  const UNUSED_MESSAGE = "is a catalog entry no package refers to. Remove it, so the catalog holds only versions in use.";
13424
- const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
13425
- const decodeManifest$2 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
13426
- const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
13427
- const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
12992
+ const FieldsSchema$1 = Schema.Record(Schema.String, Schema.Unknown);
12993
+ const decodeManifest$4 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema$1));
12994
+ const decodeFields$2 = Schema.decodeUnknownOption(FieldsSchema$1);
12995
+ const decodeString$2 = Schema.decodeUnknownOption(Schema.String);
13428
12996
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
13429
- const fieldsOf$1 = (value) => Option.getOrElse(decodeFields$1(value), () => ({}));
13430
- const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf$1(held)), Array.map((name) => ({
12997
+ const fieldsOf$2 = (value) => Option.getOrElse(decodeFields$2(value), () => ({}));
12998
+ const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf$2(held)), Array.map((name) => ({
13431
12999
  catalog,
13432
13000
  name
13433
13001
  })));
13434
- const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(Record.toEntries(fieldsOf$1(settings["catalogs"])), Array.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
13002
+ const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(Record.toEntries(fieldsOf$2(settings["catalogs"])), Array.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
13435
13003
  const catalogOf = (specifier) => pipe(Option.liftPredicate(specifier, String$1.startsWith(CATALOG_PROTOCOL)), Option.map(String$1.slice(8)), Option.map((name) => Option.getOrElse(Option.liftPredicate(name, String$1.isNonEmpty), () => DEFAULT_CATALOG)));
13436
- const referenceOf = ([name, specifier]) => pipe(decodeString$1(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
13437
- const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf$1(section), Record.toEntries, Array.flatMap(referenceOf))));
13004
+ const referenceOf = ([name, specifier]) => pipe(decodeString$2(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
13005
+ const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf$2(section), Record.toEntries, Array.flatMap(referenceOf))));
13438
13006
  const versionsOf = (raw) => pipe(Option.fromUndefinedOr(raw), Option.map((listed) => pipe(String$1.split(listed, VERSION_SEPARATOR), Array.map(String$1.trim))), Option.getOrElse(() => []));
13439
13007
  const isLocked = (keys) => (resolved) => pipe(keys, Array.some((key) => key === resolved || String$1.startsWith(`${resolved}(`)(key)));
13440
13008
  const hasPackage = (keys) => (name) => pipe(keys, Array.some(String$1.startsWith(`${name}@`)));
@@ -13450,18 +13018,18 @@ const lockedKeys = (root) => lockedPackages(root).pipe(Effect.orElseSucceed(() =
13450
13018
  const usedReferences = Effect.fn("usedReferences")(function* usedReferences(root, settings) {
13451
13019
  const files = yield* RepositoryFiles;
13452
13020
  const listed = yield* files.listedFiles(root);
13453
- const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$1.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$4 });
13454
- const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$2(text))), Array.flatMap(referencesIn));
13455
- const fromOverrides = pipe(fieldsOf$1(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
13021
+ const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$1.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$5 });
13022
+ const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$4(text))), Array.flatMap(referencesIn));
13023
+ const fromOverrides = pipe(fieldsOf$2(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
13456
13024
  return /* @__PURE__ */ new Set([...fromManifests, ...fromOverrides]);
13457
13025
  });
13458
13026
  const lineOf$1 = (source) => (needle) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => needle.test(line)), Option.match({
13459
13027
  onNone: () => FIRST_LINE$2,
13460
13028
  onSome: (index) => index + FIRST_LINE$2
13461
13029
  }));
13462
- const quoted = (name) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(name);
13463
- const entryLine = (name) => new RegExp(`^\\s+["']?${quoted(name)}["']?:`, "u");
13464
- const excludeLine = (entry) => new RegExp(`^\\s+-\\s+["']?${quoted(entry)}["']?\\s*$`, "u");
13030
+ const quoted$1 = (name) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(name);
13031
+ const entryLine = (name) => new RegExp(`^\\s+["']?${quoted$1(name)}["']?:`, "u");
13032
+ const excludeLine = (entry) => new RegExp(`^\\s+-\\s+["']?${quoted$1(entry)}["']?\\s*$`, "u");
13465
13033
  const problemAt$4 = ({ file, at }, rule, message) => (name, needle) => ({
13466
13034
  file,
13467
13035
  line: at(needle),
@@ -13490,7 +13058,7 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
13490
13058
  const manifest = yield* workspaceManifest(root);
13491
13059
  return yield* Option.match(manifest, {
13492
13060
  onNone: () => Effect.succeed([]),
13493
- onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$3), fieldsOf$1(settings))
13061
+ onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$4), fieldsOf$2(settings))
13494
13062
  });
13495
13063
  });
13496
13064
  // src/features/check-skills/model/skill-entry.ts
@@ -13499,8 +13067,8 @@ const VISIBLE_RULE = "skill-source-visible";
13499
13067
  const CONFIG_FILE = "vite.config.ts";
13500
13068
  const RENOVATE_FILE$1 = "renovate.json";
13501
13069
  const SOURCE = "masseater/skills";
13502
- const PRESET = "github>masseater/masseater.dev//libs/vite-plus-adopt/renovate";
13503
- const START$6 = 0;
13070
+ const PRESET$1 = "github>masseater/masseater.dev//libs/vite-plus-adopt/renovate";
13071
+ const START$10 = 0;
13504
13072
  const LOCAL_PREFIX = "./";
13505
13073
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
13506
13074
  const Source = Schema.Struct({
@@ -13513,7 +13081,7 @@ const taggedError = Schema.TaggedError;
13513
13081
  var SkillsConfigUnreadable = class extends taggedError()("SkillsConfigUnreadable", { file: Schema.String }) {};
13514
13082
  const problemAt$3 = (rule, file, text) => (anchor, message) => ({
13515
13083
  file,
13516
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$6))),
13084
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
13517
13085
  rule,
13518
13086
  message
13519
13087
  });
@@ -13545,8 +13113,8 @@ const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root
13545
13113
  const files = yield* RepositoryFiles;
13546
13114
  const file = files.join(root, RENOVATE_FILE$1);
13547
13115
  const text = yield* files.readFile(file);
13548
- if (pipe(text, Option.exists(String$1.includes(`"${PRESET}"`)))) return [];
13549
- return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE}.`)];
13116
+ if (pipe(text, Option.exists(String$1.includes(`"${PRESET$1}"`)))) return [];
13117
+ return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET$1}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE}.`)];
13550
13118
  });
13551
13119
  /** @internal */
13552
13120
  const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
@@ -13560,20 +13128,20 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
13560
13128
  ];
13561
13129
  });
13562
13130
  // src/features/check-skills/model/published-skills.ts
13563
- const RULE$8 = "published-skills";
13131
+ const RULE$11 = "published-skills";
13564
13132
  const KEYWORD = "tanstack-intent";
13565
13133
  const SKILLS = "skills";
13566
13134
  const MANIFEST_FILE = "package.json";
13567
13135
  const SKILL_FILE$1 = "SKILL.md";
13568
- const FIRST$2 = 1;
13136
+ const FIRST$3 = 1;
13569
13137
  const SUCCEEDED = 0;
13570
13138
  const SYNC = "Run vp exec intent maintainer sync in the repository root.";
13571
13139
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
13572
13140
  const problemAt$2 = (file, message) => ({
13573
13141
  file,
13574
- line: FIRST$2,
13575
- column: FIRST$2,
13576
- rule: RULE$8,
13142
+ line: FIRST$3,
13143
+ column: FIRST$3,
13144
+ rule: RULE$11,
13577
13145
  message
13578
13146
  });
13579
13147
  const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array.filter((file) => files.basename(file) === SKILL_FILE$1), Array.map((file) => files.relative(directory, files.dirname(file))));
@@ -13596,7 +13164,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
13596
13164
  const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
13597
13165
  return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
13598
13166
  }, Effect.scoped);
13599
- const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13167
+ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13600
13168
  const files = yield* RepositoryFiles;
13601
13169
  const directory = files.join(root, project.directory);
13602
13170
  const manifest = files.join(directory, MANIFEST_FILE);
@@ -13608,11 +13176,11 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project)
13608
13176
  /** @internal */
13609
13177
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
13610
13178
  const projects = yield* publishedProjects(root);
13611
- const problems = yield* Effect.forEach(projects, (project) => problemsIn$6(root, project), { concurrency: 1 });
13179
+ const problems = yield* Effect.forEach(projects, (project) => problemsIn$7(root, project), { concurrency: 1 });
13612
13180
  return Array.flatten(problems);
13613
13181
  });
13614
13182
  // src/features/check-skills/model/skill-files.ts
13615
- const RULE$7 = "skill-file";
13183
+ const RULE$10 = "skill-file";
13616
13184
  const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
13617
13185
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
13618
13186
  const MARKDOWN = ".md";
@@ -13628,10 +13196,10 @@ const FRAGMENT = /#.*$/u;
13628
13196
  const GITHUB = "https://github.com/";
13629
13197
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
13630
13198
  const BLANK = /\s+/u;
13631
- const SEPARATOR$2 = "/";
13632
- const START$5 = 0;
13633
- const FIRST$1 = 1;
13634
- const READ_CONCURRENCY$3 = 16;
13199
+ const SEPARATOR$3 = "/";
13200
+ const START$9 = 0;
13201
+ const FIRST$2 = 1;
13202
+ const READ_CONCURRENCY$4 = 16;
13635
13203
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
13636
13204
  const Frontmatter = Schema.Struct({
13637
13205
  name: Schema.optional(Schema.String),
@@ -13639,9 +13207,9 @@ const Frontmatter = Schema.Struct({
13639
13207
  metadata: Schema.optional(Metadata)
13640
13208
  });
13641
13209
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
13642
- const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$5));
13210
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
13643
13211
  const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$2(yaml))));
13644
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$5].length), Option.getOrElse(() => START$5));
13212
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
13645
13213
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
13646
13214
  const nameProblems = ({ source, directory }, name, folder) => {
13647
13215
  const bodyStart = bodyStartOf(source);
@@ -13669,16 +13237,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
13669
13237
  ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
13670
13238
  file: skill.file,
13671
13239
  ...positionOf(skill.source)(index),
13672
- rule: RULE$7,
13240
+ rule: RULE$10,
13673
13241
  message
13674
13242
  })));
13675
13243
  const linkOf = (found) => pipe(groupOf$2("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
13676
13244
  target,
13677
- index: found.index ?? START$5
13245
+ index: found.index ?? START$9
13678
13246
  })), Option.toArray);
13679
13247
  const rangeOf$1 = (found) => {
13680
- const start = found.index ?? START$5;
13681
- return [start, start + found[START$5].length];
13248
+ const start = found.index ?? START$9;
13249
+ return [start, start + found[START$9].length];
13682
13250
  };
13683
13251
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
13684
13252
  const linksIn = (source) => {
@@ -13696,23 +13264,23 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
13696
13264
  return pipe(missing, Array.map(({ target, index }) => ({
13697
13265
  file,
13698
13266
  ...positionOf(source)(index),
13699
- rule: RULE$7,
13267
+ rule: RULE$10,
13700
13268
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
13701
13269
  })));
13702
13270
  });
13703
- const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13271
+ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13704
13272
  const files = yield* RepositoryFiles;
13705
13273
  const file = files.join(root, name);
13706
13274
  const directory = files.dirname(name);
13707
- const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$2}`)));
13275
+ const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$3}`)));
13708
13276
  const text = yield* files.readFile(file);
13709
13277
  const documents = pipe(inside, Array.filter(String$1.endsWith(MARKDOWN)), Array.map((entry) => files.join(root, entry)));
13710
- const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$3 });
13278
+ const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$4 });
13711
13279
  const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
13712
13280
  file: files.join(root, entry),
13713
- line: FIRST$1,
13714
- column: FIRST$1,
13715
- rule: RULE$7,
13281
+ line: FIRST$2,
13282
+ column: FIRST$2,
13283
+ rule: RULE$10,
13716
13284
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
13717
13285
  })));
13718
13286
  return [
@@ -13729,7 +13297,7 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13729
13297
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
13730
13298
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
13731
13299
  const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
13732
- const found = yield* Effect.forEach(skills, (name) => problemsIn$5(root, listed, name), { concurrency: READ_CONCURRENCY$3 });
13300
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$6(root, listed, name), { concurrency: READ_CONCURRENCY$4 });
13733
13301
  return Array.flatten(found);
13734
13302
  });
13735
13303
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -13744,16 +13312,16 @@ const CARGO_SECTIONS = [
13744
13312
  "dev-dependencies",
13745
13313
  "build-dependencies"
13746
13314
  ];
13747
- const decodeFields = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
13315
+ const decodeFields$1 = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
13748
13316
  const decodeJson = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
13749
- const decodeString = Schema.decodeUnknownOption(Schema.String);
13317
+ const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
13750
13318
  const decodeVersioned = Schema.decodeUnknownOption(Schema.Struct({ version: Schema.String }));
13751
- const decodeSpec = (value) => Option.orElse(decodeString(value), () => Option.map(decodeVersioned(value), ({ version }) => version));
13319
+ const decodeSpec = (value) => Option.orElse(decodeString$1(value), () => Option.map(decodeVersioned(value), ({ version }) => version));
13752
13320
  const PackageManager = Schema.String.check(Schema.isPattern(/^[^@]+@[^+]+/u));
13753
13321
  const decodePackageManager = Schema.decodeUnknownOption(PackageManager);
13754
- const fieldsOf = (value) => Option.getOrElse(decodeFields(value), () => ({}));
13755
- const fieldOf = (name) => (value) => fieldsOf(value)[name];
13756
- const entriesIn = (section) => (held) => pipe(Record.toEntries(fieldsOf(held)), Array.flatMap(([name, value]) => pipe(decodeSpec(value), Option.map((spec) => ({
13322
+ const fieldsOf$1 = (value) => Option.getOrElse(decodeFields$1(value), () => ({}));
13323
+ const fieldOf = (name) => (value) => fieldsOf$1(value)[name];
13324
+ const entriesIn = (section) => (held) => pipe(Record.toEntries(fieldsOf$1(held)), Array.flatMap(([name, value]) => pipe(decodeSpec(value), Option.map((spec) => ({
13757
13325
  key: `${section}:${name}`,
13758
13326
  name,
13759
13327
  spec
@@ -13768,15 +13336,15 @@ const packageManagerOf = (value) => pipe(decodePackageManager(value), Option.map
13768
13336
  };
13769
13337
  }), Option.toArray);
13770
13338
  const manifestEntries = (text) => {
13771
- const manifest = fieldsOf(Option.getOrUndefined(decodeJson(text)));
13339
+ const manifest = fieldsOf$1(Option.getOrUndefined(decodeJson(text)));
13772
13340
  return [...sectionsIn(MANIFEST_SECTIONS)(manifest), ...packageManagerOf(manifest["packageManager"])];
13773
13341
  };
13774
- const catalogsIn = (held) => pipe(Record.toEntries(fieldsOf(held)), Array.flatMap(([name, catalog]) => entriesIn(`catalogs.${name}`)(catalog)));
13342
+ const catalogsIn = (held) => pipe(Record.toEntries(fieldsOf$1(held)), Array.flatMap(([name, catalog]) => entriesIn(`catalogs.${name}`)(catalog)));
13775
13343
  const workspaceEntries = (text) => {
13776
- const settings = fieldsOf(Option.getOrUndefined(Option.liftThrowable(() => parse$2(text))()));
13344
+ const settings = fieldsOf$1(Option.getOrUndefined(Option.liftThrowable(() => parse$2(text))()));
13777
13345
  return [...sectionsIn(["catalog", "overrides"])(settings), ...catalogsIn(settings["catalogs"])];
13778
13346
  };
13779
- const parseToml = (text) => pipe(Option.liftThrowable(() => getStaticTOMLValue(parseTOML(text)))(), Option.map(fieldsOf), Option.getOrElse(() => ({})));
13347
+ const parseToml = (text) => pipe(Option.liftThrowable(() => getStaticTOMLValue(parseTOML(text)))(), Option.map(fieldsOf$1), Option.getOrElse(() => ({})));
13780
13348
  const singleEntry = (key, value) => pipe(decodeSpec(value), Option.map((spec) => ({
13781
13349
  key,
13782
13350
  name: key,
@@ -13792,9 +13360,9 @@ const cargoEntries = (text) => {
13792
13360
  };
13793
13361
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
13794
13362
  // src/features/check-version-downgrades/model/version-downgrade.ts
13795
- const RULE$6 = "version-downgrade";
13363
+ const RULE$9 = "version-downgrade";
13796
13364
  const DEFAULT_BASE = "origin/main";
13797
- const READ_CONCURRENCY$2 = 16;
13365
+ const READ_CONCURRENCY$3 = 16;
13798
13366
  const READERS = [
13799
13367
  [/(?:^|\/)package\.json$/u, manifestEntries],
13800
13368
  [/^pnpm-workspace\.yaml$/u, workspaceEntries],
@@ -13818,7 +13386,7 @@ const downgradesIn = ({ file, text, before, after }) => {
13818
13386
  file,
13819
13387
  line: lineOf(text, entry),
13820
13388
  column: FIRST_LINE$1,
13821
- rule: RULE$6,
13389
+ rule: RULE$9,
13822
13390
  message: message(old, entry)
13823
13391
  })), Option.toArray)));
13824
13392
  };
@@ -13844,7 +13412,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
13844
13412
  before: read(before),
13845
13413
  after: read(after)
13846
13414
  })), Option.getOrElse(() => []));
13847
- }), { concurrency: READ_CONCURRENCY$2 });
13415
+ }), { concurrency: READ_CONCURRENCY$3 });
13848
13416
  return Array.flatten(found);
13849
13417
  });
13850
13418
  // src/features/check-version-downgrades/model/renovate-settings.ts
@@ -13853,11 +13421,15 @@ const AUTOMERGE_OFF = /["']?platformAutomerge["']?\s*:\s*false/gu;
13853
13421
  const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)["']/gu;
13854
13422
  const AUTOMERGE_RULE = "renovate-platform-automerge";
13855
13423
  const CAP_RULE = "renovate-version-cap";
13856
- const READ_CONCURRENCY$1 = 16;
13424
+ const PRESET_RULE = "renovate-msch-preset";
13425
+ const PRESET = "github>masseater/masseater.dev//libs/msch/renovate";
13426
+ const START$8 = 0;
13427
+ const READ_CONCURRENCY$2 = 16;
13857
13428
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
13858
13429
  const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
13430
+ const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
13859
13431
  const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
13860
- const problemsIn$4 = (file, source) => {
13432
+ const problemsIn$5 = (file, source) => {
13861
13433
  const at = positionOf(source);
13862
13434
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
13863
13435
  file,
@@ -13865,7 +13437,16 @@ const problemsIn$4 = (file, source) => {
13865
13437
  rule,
13866
13438
  message
13867
13439
  })));
13868
- return [...found(AUTOMERGE_OFF, AUTOMERGE_RULE, AUTOMERGE_MESSAGE), ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE)];
13440
+ return [
13441
+ ...found(AUTOMERGE_OFF, AUTOMERGE_RULE, AUTOMERGE_MESSAGE),
13442
+ ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
13443
+ ...pipe([{
13444
+ file,
13445
+ ...at(START$8),
13446
+ rule: PRESET_RULE,
13447
+ message: PRESET_MESSAGE
13448
+ }], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
13449
+ ];
13869
13450
  };
13870
13451
  /** @internal */
13871
13452
  const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* checkRenovateSettings(root) {
@@ -13875,30 +13456,30 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
13875
13456
  const file = files.join(root, name);
13876
13457
  return files.readFile(file).pipe(Effect.map(Option.match({
13877
13458
  onNone: () => [],
13878
- onSome: (source) => problemsIn$4(file, source)
13459
+ onSome: (source) => problemsIn$5(file, source)
13879
13460
  })));
13880
- }, { concurrency: READ_CONCURRENCY$1 });
13461
+ }, { concurrency: READ_CONCURRENCY$2 });
13881
13462
  return Array.flatten(found);
13882
13463
  });
13883
13464
  // src/features/find-invisible-characters/model/hidden-unicode.ts
13884
13465
  const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
13885
13466
  const NUL = "\0";
13886
- const START$4 = 0;
13467
+ const START$7 = 0;
13887
13468
  const HEX = 16;
13888
13469
  const CODE_POINT_WIDTH = 4;
13889
- const READ_CONCURRENCY = 64;
13890
- const RULE$5 = "hidden-unicode";
13891
- const hexOf = (character) => pipe(String$1.codePointAt(START$4)(character), Option.getOrElse(() => START$4), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13470
+ const READ_CONCURRENCY$1 = 64;
13471
+ const RULE$8 = "hidden-unicode";
13472
+ const hexOf = (character) => pipe(String$1.codePointAt(START$7)(character), Option.getOrElse(() => START$7), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13892
13473
  const problemOf$1 = (file, source) => (found) => {
13893
- const hex = hexOf(found[START$4]);
13474
+ const hex = hexOf(found[START$7]);
13894
13475
  return {
13895
13476
  file,
13896
- ...positionOf(source)(found.index ?? START$4),
13897
- rule: RULE$5,
13477
+ ...positionOf(source)(found.index ?? START$7),
13478
+ rule: RULE$8,
13898
13479
  message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
13899
13480
  };
13900
13481
  };
13901
- const problemsIn$3 = (file, source) => {
13482
+ const problemsIn$4 = (file, source) => {
13902
13483
  if (String$1.includes(NUL)(source)) return [];
13903
13484
  return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
13904
13485
  };
@@ -13910,43 +13491,43 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
13910
13491
  const file = files.join(root, name);
13911
13492
  return files.readFile(file).pipe(Effect.map(Option.match({
13912
13493
  onNone: () => [],
13913
- onSome: (source) => problemsIn$3(file, source)
13494
+ onSome: (source) => problemsIn$4(file, source)
13914
13495
  })));
13915
- }, { concurrency: READ_CONCURRENCY });
13496
+ }, { concurrency: READ_CONCURRENCY$1 });
13916
13497
  return Array.flatten(found);
13917
13498
  });
13918
13499
  // src/features/find-unneeded-files/model/alchemy-patch.ts
13919
- const RULE$4 = "alchemy-patch";
13920
- const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
13500
+ const RULE$7 = "alchemy-patch";
13501
+ const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
13921
13502
  const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
13922
- const START$3 = 0;
13503
+ const START$6 = 0;
13923
13504
  const problemOf = (file, position, name) => ({
13924
13505
  file,
13925
13506
  ...position,
13926
- rule: RULE$4,
13507
+ rule: RULE$7,
13927
13508
  message: `patches ${name}. A patch breaks on every Alchemy release. Define the missing setting as a custom resource in the stack and delete the patch.`
13928
13509
  });
13929
- const problemsIn$2 = (file, patched) => (source) => {
13510
+ const problemsIn$3 = (file, patched) => (source) => {
13930
13511
  const at = positionOf(source);
13931
- const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$3));
13512
+ const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$6));
13932
13513
  return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
13933
13514
  };
13934
13515
  /** @internal */
13935
13516
  const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyPatch(root) {
13936
13517
  const files = yield* RepositoryFiles;
13937
- const file = files.join(root, WORKSPACE_FILE$2);
13518
+ const file = files.join(root, WORKSPACE_FILE$3);
13938
13519
  const text = yield* files.readFile(file);
13939
13520
  const manifest = yield* workspaceManifest(root);
13940
13521
  const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
13941
- return pipe(text, Option.map(problemsIn$2(file, patched)), Option.getOrElse(() => []));
13522
+ return pipe(text, Option.map(problemsIn$3(file, patched)), Option.getOrElse(() => []));
13942
13523
  });
13943
13524
  // src/features/find-unneeded-files/model/applied-packages.ts
13944
13525
  const MSCH = "@r_masseater/msch";
13945
13526
  const SCOPE$1 = "@r_masseater/";
13946
- const RULE$3 = "applied-package";
13947
- const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
13527
+ const RULE$6 = "applied-package";
13528
+ const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
13948
13529
  const NOT_FOUND = -1;
13949
- const SEPARATOR$1 = "/";
13530
+ const SEPARATOR$2 = "/";
13950
13531
  const BY_LENGTH = Order.mapInput(Order.Number, (text) => text.length);
13951
13532
  const BinMap = Schema.Record(Schema.String, Schema.String);
13952
13533
  const BinField = Schema.Struct({ bin: Schema.optional(Schema.Union([Schema.String, BinMap])) });
@@ -13960,7 +13541,7 @@ const declaredNames = (manifest) => pipe([
13960
13541
  const binsIn = (name, text) => pipe(decodeBinField(text), Option.flatMap(({ bin }) => Option.fromUndefinedOr(bin)), Option.match({
13961
13542
  onNone: () => [],
13962
13543
  onSome: (bin) => {
13963
- if (Predicate.isString(bin)) return [pipe(name, String$1.split(SEPARATOR$1), Array.lastNonEmpty)];
13544
+ if (Predicate.isString(bin)) return [pipe(name, String$1.split(SEPARATOR$2), Array.lastNonEmpty)];
13964
13545
  return Record.keys(bin);
13965
13546
  }
13966
13547
  }));
@@ -13988,17 +13569,17 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
13988
13569
  const problemAt$1 = (file, source) => (index, name) => ({
13989
13570
  file,
13990
13571
  ...positionOf(source)(index),
13991
- rule: RULE$3,
13572
+ rule: RULE$6,
13992
13573
  message: `msch applies ${name}. Remove this use and let msch apply it.`
13993
13574
  });
13994
13575
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
13995
13576
  const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
13996
13577
  const usesIn = (applied) => ({ file }, source) => pipe(applied, Array.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array.map(binPattern))], Array.flatMap((pattern) => Array.fromIterable(String$1.matchAll(pattern)(source))), Array.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND, entry.name)))));
13997
- const ownerOf = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$1}`)(name)), Array.match({
13578
+ const ownerOf = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array.match({
13998
13579
  onEmpty: () => "",
13999
13580
  onNonEmpty: Array.max(BY_LENGTH)
14000
13581
  }));
14001
- const isScannedSource = (entry) => isScannedText(entry) && !String$1.endsWith("package.json")(entry.name) && entry.name !== WORKSPACE_FILE$1;
13582
+ const isScannedSource = (entry) => isScannedText(entry) && !String$1.endsWith("package.json")(entry.name) && entry.name !== WORKSPACE_FILE$2;
14002
13583
  const consumersIn = Effect.fn("consumersIn")(function* consumersIn(root, directories) {
14003
13584
  const files = yield* RepositoryFiles;
14004
13585
  return yield* pipe(directories, Effect.filter((directory) => readManifest(files.join(root, directory)).pipe(Effect.map(Option.exists((manifest) => manifest.name !== MSCH && Array.contains(declaredNames(manifest), MSCH))))));
@@ -14043,8 +13624,8 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
14043
13624
  return yield* appliedPackageProblems(root, applied);
14044
13625
  });
14045
13626
  // src/features/find-unneeded-files/model/replaced-tools.ts
14046
- const RULE$2 = "replaced-tool";
14047
- const FIRST = 1;
13627
+ const RULE$5 = "replaced-tool";
13628
+ const FIRST$1 = 1;
14048
13629
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
14049
13630
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
14050
13631
  const ALCHEMY = "the Alchemy stack in alchemy.run.ts";
@@ -14122,9 +13703,9 @@ const REPLACED = [
14122
13703
  ];
14123
13704
  const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
14124
13705
  file,
14125
- line: FIRST,
14126
- column: FIRST,
14127
- rule: RULE$2,
13706
+ line: FIRST$1,
13707
+ column: FIRST$1,
13708
+ rule: RULE$5,
14128
13709
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
14129
13710
  })));
14130
13711
  /** @internal */
@@ -14134,9 +13715,9 @@ const checkReplacedTools = Effect.fn("checkReplacedTools")(function* checkReplac
14134
13715
  return pipe(present, Array.flatMap((entry) => Option.toArray(problemFor(entry))));
14135
13716
  });
14136
13717
  // src/features/find-unneeded-files/model/unneeded-files.ts
14137
- const WORKSPACE_FILE = "pnpm-workspace.yaml";
13718
+ const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
14138
13719
  const PNPM_DIRECTORY = ".pnpm/";
14139
- const SEPARATOR = "/";
13720
+ const SEPARATOR$1 = "/";
14140
13721
  const FOREIGN_LOCKFILE = /(?:^|\/)(?:package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|bun\.lockb?)$/u;
14141
13722
  const CARGO_MANIFEST_FILE = /(?:^|\/)Cargo\.toml$/u;
14142
13723
  const CARGO_LOCK_FILE = /(?:^|\/)Cargo\.lock$/u;
@@ -14153,7 +13734,7 @@ const SETUP_PATTERNS = [
14153
13734
  ];
14154
13735
  const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
14155
13736
  const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
14156
- const START$2 = 0;
13737
+ const START$5 = 0;
14157
13738
  const LAST_SEGMENT = 1;
14158
13739
  const FIRST_LINE = 1;
14159
13740
  const FIRST_COLUMN = 1;
@@ -14182,7 +13763,7 @@ const generatedCargoConfig = (entry, source) => {
14182
13763
  if (String$1.isNonEmpty(String$1.trim(String$1.replaceAll(PNPM_CARGO_BLOCK, "")(source)))) return [];
14183
13764
  return [pnpmCargoConfig(entry)];
14184
13765
  };
14185
- const cargoOutsidePnpm = problemAtStart(CARGO_RULE, `pnpm does not manage these crates. Set \`cargo: { enabled: true }\` in ${WORKSPACE_FILE} so pnpm install fetches the crates and the Rust toolchain.`);
13766
+ const cargoOutsidePnpm = problemAtStart(CARGO_RULE, `pnpm does not manage these crates. Set \`cargo: { enabled: true }\` in ${WORKSPACE_FILE$1} so pnpm install fetches the crates and the Rust toolchain.`);
14186
13767
  const setupProblem = ({ file }, source, advice) => (found) => ({
14187
13768
  file,
14188
13769
  ...positionOf(source)(found.index ?? WHOLE_MATCH),
@@ -14206,10 +13787,10 @@ const isCargoManifest = matches(CARGO_MANIFEST_FILE);
14206
13787
  const isForeignLockfile = matches(FOREIGN_LOCKFILE);
14207
13788
  const isLegacyCargoConfig = matches(LEGACY_CARGO_CONFIG);
14208
13789
  const isPnpmOutput = matches(PNPM_OUTPUT);
14209
- const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR), Array.dropRight(LAST_SEGMENT), Array.join(SEPARATOR));
13790
+ const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$1), Array.dropRight(LAST_SEGMENT), Array.join(SEPARATOR$1));
14210
13791
  const ancestorsOf = (directory) => {
14211
- const parts = String$1.split(directory, SEPARATOR);
14212
- return pipe(Array.makeBy(parts.length, (depth) => Array.join(Array.take(parts, depth), SEPARATOR)), Array.filter((ancestor) => ancestor !== directory));
13792
+ const parts = String$1.split(directory, SEPARATOR$1);
13793
+ return pipe(Array.makeBy(parts.length, (depth) => Array.join(Array.take(parts, depth), SEPARATOR$1)), Array.filter((ancestor) => ancestor !== directory));
14213
13794
  };
14214
13795
  const readsCargoLock = (manifests, workspaces) => ({ name }) => {
14215
13796
  const directory = directoryOf(name);
@@ -14223,7 +13804,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
14223
13804
  const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
14224
13805
  return directoriesOf(roots);
14225
13806
  });
14226
- const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$2), (end) => String$1.slice(START$2, end)(name));
13807
+ const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$5), (end) => String$1.slice(START$5, end)(name));
14227
13808
  const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
14228
13809
  const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
14229
13810
  const cargoProblems = (present, enabled) => {
@@ -14258,24 +13839,118 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
14258
13839
  if (Option.isNone(workspace)) return [];
14259
13840
  return yield* unneededIn(root, cargoEnabled(workspace.value));
14260
13841
  });
13842
+ // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
13843
+ const RULE$4 = "effect-diagnostics-once";
13844
+ const PLUGIN = "@effect/language-service";
13845
+ const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
13846
+ const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13847
+ const START$4 = 0;
13848
+ const Plugin = Schema.Struct({
13849
+ name: Schema.optional(Schema.String),
13850
+ diagnostics: Schema.optional(Schema.Unknown)
13851
+ });
13852
+ const Plugins = Schema.Array(Plugin);
13853
+ const CompilerOptions = Schema.Struct({ plugins: Schema.optional(Plugins) });
13854
+ const Config$1 = Schema.Struct({ compilerOptions: Schema.optional(CompilerOptions) });
13855
+ const decodeConfig = Schema.decodeUnknownOption(Schema.fromJsonString(Config$1));
13856
+ const MESSAGE$1 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics during the type check, and the \`effecttsgo\` lint rules that msch enables report the same ones again. Set \`"diagnostics": false\` on the plugin so that each finding is reported once, by the lint rules, with the severity msch sets.`;
13857
+ const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
13858
+ const problemsIn$2 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array.some(reportsDiagnostics)), Option.map(() => ({
13859
+ file: entry.file,
13860
+ ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$4))),
13861
+ rule: RULE$4,
13862
+ message: MESSAGE$1
13863
+ })), Option.toArray);
13864
+ /** @internal */
13865
+ const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* checkEffectDiagnostics(root) {
13866
+ const files = yield* RepositoryFiles;
13867
+ const configs = yield* files.matchingFiles(root, [CONFIG_PATHSPEC, ...EXCLUDED$3]);
13868
+ return yield* scanText(pipe(configs, Array.map((name) => ({
13869
+ name,
13870
+ file: files.join(root, name)
13871
+ }))), problemsIn$2);
13872
+ });
13873
+ // src/features/check-exact-versions/model/exact-versions.ts
13874
+ const RULE$3 = "version-range";
13875
+ const WORKSPACE_FILE = "pnpm-workspace.yaml";
13876
+ const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
13877
+ const PROTOCOL = /^[a-z+]+:/u;
13878
+ const PATH_LIKE = "/";
13879
+ const START$3 = 0;
13880
+ const SECTIONS = [
13881
+ "dependencies",
13882
+ "devDependencies",
13883
+ "optionalDependencies"
13884
+ ];
13885
+ const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13886
+ const MESSAGE = "is a range. The lockfile decides the version anyway, so a range only lets the next install move it without a diff. Write the exact version the lockfile resolves; `msch-publish` widens `dependencies` and `peerDependencies` to `^` in the published package.";
13887
+ const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
13888
+ const decodeFields = Schema.decodeUnknownOption(FieldsSchema);
13889
+ const decodeManifest$3 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
13890
+ const decodeString = Schema.decodeUnknownOption(Schema.String);
13891
+ const fieldsOf = (value) => Option.getOrElse(decodeFields(value), () => ({}));
13892
+ const versionOf = (specifier) => Option.getOrElse(groupOf$2("version")(ALIAS.exec(specifier)), () => specifier);
13893
+ /** @internal */
13894
+ const isRange = (specifier) => {
13895
+ const version = versionOf(specifier);
13896
+ return !PROTOCOL.test(version) && !String$1.includes(PATH_LIKE)(version) && semver.valid(version) === null;
13897
+ };
13898
+ const specifiedIn = (held) => pipe(fieldsOf(held), Record.toEntries, Array.flatMap(([name, value]) => pipe(decodeString(value), Option.map((specifier) => ({
13899
+ name,
13900
+ specifier
13901
+ })), Option.toArray)));
13902
+ const quoted = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(text);
13903
+ const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$3));
13904
+ const problemsFor = (file, source, pattern) => (found) => pipe(found, Array.filter(({ specifier }) => isRange(specifier)), Array.map((range) => ({
13905
+ file,
13906
+ ...positionOf(source)(offsetIn(source)(pattern(range))),
13907
+ rule: RULE$3,
13908
+ message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE}`
13909
+ })));
13910
+ const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted(name)}"\\s*:\\s*"${quoted(specifier)}"`, "u");
13911
+ const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted(name)}["']?:`, "mu");
13912
+ const manifestProblems$1 = (entry, source) => pipe(decodeManifest$3(source), Option.map((manifest) => pipe(SECTIONS, Array.flatMap((section) => specifiedIn(manifest[section])), problemsFor(entry.file, source, manifestPattern))), Option.getOrElse(() => []));
13913
+ const catalogSpecifiers = (settings) => [...specifiedIn(settings["catalog"]), ...pipe(fieldsOf(settings["catalogs"]), Record.values, Array.flatMap(specifiedIn))];
13914
+ const catalogProblems = Effect.fn("catalogProblems")(function* catalogProblems(root) {
13915
+ const files = yield* RepositoryFiles;
13916
+ const file = files.join(root, WORKSPACE_FILE);
13917
+ const settings = yield* workspaceManifest(root);
13918
+ const source = yield* files.readFile(file);
13919
+ return pipe(Option.all({
13920
+ settings,
13921
+ source
13922
+ }), Option.map(({ settings: held, source: text }) => problemsFor(file, text, catalogPattern)(catalogSpecifiers(fieldsOf(held)))), Option.getOrElse(() => []));
13923
+ });
13924
+ /** @internal */
13925
+ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactVersions(root) {
13926
+ const files = yield* RepositoryFiles;
13927
+ const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$2]);
13928
+ const listed = pipe(manifests, Array.map((name) => ({
13929
+ name,
13930
+ file: files.join(root, name)
13931
+ })));
13932
+ const fromManifests = yield* scanText(listed, manifestProblems$1);
13933
+ const fromCatalogs = yield* catalogProblems(root);
13934
+ return [...fromManifests, ...fromCatalogs];
13935
+ });
14261
13936
  // src/features/check-package-scope/model/package-scope.ts
14262
- const RULE$1 = "package-scope";
13937
+ const RULE$2 = "package-scope";
14263
13938
  const SCOPE = "@r_masseater/";
14264
13939
  const NAME_KEY = "\"name\"";
14265
- const START$1 = 0;
13940
+ const START$2 = 0;
14266
13941
  const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14267
- const Manifest$1 = Schema.Struct({
13942
+ const Manifest$2 = Schema.Struct({
14268
13943
  name: Schema.optional(Schema.String),
14269
13944
  private: Schema.optional(Schema.Boolean),
14270
13945
  publishConfig: Schema.optional(Schema.Unknown)
14271
13946
  });
14272
- const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
13947
+ const decodeManifest$2 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
14273
13948
  const isPublished$1 = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
14274
13949
  const unscopedName = (manifest) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(SCOPE)(name)));
14275
- const problemsIn$1 = (entry, source) => pipe(decodeManifest$1(source), Option.filter(isPublished$1), Option.flatMap(unscopedName), Option.map((name) => ({
13950
+ const problemsIn$1 = (entry, source) => pipe(decodeManifest$2(source), Option.filter(isPublished$1), Option.flatMap(unscopedName), Option.map((name) => ({
14276
13951
  file: entry.file,
14277
- ...positionOf(source)(pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$1))),
14278
- rule: RULE$1,
13952
+ ...positionOf(source)(pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$2))),
13953
+ rule: RULE$2,
14279
13954
  message: `Packages are published only under the ${SCOPE} scope. Rename "${name}" to "${SCOPE}${String$1.replace(/^@[^/]+\//u, "")(name)}".`
14280
13955
  })), Option.toArray);
14281
13956
  /** @internal */
@@ -14288,7 +13963,7 @@ const checkPackageScope = Effect.fn("checkPackageScope")(function* checkPackageS
14288
13963
  }))), problemsIn$1);
14289
13964
  });
14290
13965
  // src/features/check-runtime-version/model/node-version.ts
14291
- const RULE = "node-version";
13966
+ const RULE$1 = "node-version";
14292
13967
  const MINIMUM = 26;
14293
13968
  const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
14294
13969
  const MANIFEST = /(?:^|\/)package\.json$/u;
@@ -14302,15 +13977,15 @@ const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t
14302
13977
  const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
14303
13978
  const ALTERNATIVE = "||";
14304
13979
  const ENGINES_KEY = "\"engines\"";
14305
- const START = 0;
13980
+ const START$1 = 0;
14306
13981
  const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14307
13982
  const Engines = Schema.Struct({ node: Schema.optional(Schema.String) });
14308
- const Manifest = Schema.Struct({
13983
+ const Manifest$1 = Schema.Struct({
14309
13984
  private: Schema.optional(Schema.Boolean),
14310
13985
  publishConfig: Schema.optional(Schema.Unknown),
14311
13986
  engines: Schema.optional(Engines)
14312
13987
  });
14313
- const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
13988
+ const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
14314
13989
  const majorOf = (found) => pipe(groupOf$2("major")(found), Option.map(Number));
14315
13990
  const isOld = (major) => major < MINIMUM;
14316
13991
  const floorOf = (alternative) => majorOf(RANGE_FLOOR.exec(String$1.trim(alternative)));
@@ -14322,14 +13997,14 @@ const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some
14322
13997
  const problemAt = ({ entry, source, index }, message) => ({
14323
13998
  file: entry.file,
14324
13999
  ...positionOf(source)(index),
14325
- rule: RULE,
14000
+ rule: RULE$1,
14326
14001
  message
14327
14002
  });
14328
- const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START));
14003
+ const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$1));
14329
14004
  const unstatedProblem = (entry, source) => problemAt({
14330
14005
  entry,
14331
14006
  source,
14332
- index: START
14007
+ index: START$1
14333
14008
  }, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
14334
14009
  const rangeProblem = (entry, source) => (range) => problemAt({
14335
14010
  entry,
@@ -14339,7 +14014,7 @@ const rangeProblem = (entry, source) => (range) => problemAt({
14339
14014
  const isPublished = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
14340
14015
  const rangeOf = (manifest) => pipe(Option.fromUndefinedOr(manifest.engines), Option.flatMap(({ node }) => Option.fromUndefinedOr(node)));
14341
14016
  const manifestProblems = (entry, source) => {
14342
- const manifest = decodeManifest(source);
14017
+ const manifest = decodeManifest$1(source);
14343
14018
  if (Option.isNone(manifest)) return [];
14344
14019
  const range = rangeOf(manifest.value);
14345
14020
  if (Option.isNone(range) && isPublished(manifest.value)) return [unstatedProblem(entry, source)];
@@ -14348,12 +14023,12 @@ const manifestProblems = (entry, source) => {
14348
14023
  const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt({
14349
14024
  entry,
14350
14025
  source,
14351
- index: found.index ?? START
14352
- }, `${SUPPORTED} \`${String$1.trim(found[START])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
14026
+ index: found.index ?? START$1
14027
+ }, `${SUPPORTED} \`${String$1.trim(found[START$1])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
14353
14028
  const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
14354
14029
  entry,
14355
14030
  source,
14356
- index: START
14031
+ index: START$1
14357
14032
  }, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
14358
14033
  const problemsIn = (entry, source) => {
14359
14034
  if (MANIFEST.test(entry.name)) return manifestProblems(entry, source);
@@ -14374,10 +14049,130 @@ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersio
14374
14049
  })))];
14375
14050
  return yield* scanText(sources, problemsIn);
14376
14051
  });
14052
+ // src/features/check-unused-workspaces/model/unused-workspaces.ts
14053
+ const RULE = "unused-workspace";
14054
+ const CARGO_FILE = "Cargo.toml";
14055
+ const ROOT_DIRECTORY = "";
14056
+ const TASK_SEPARATOR = "#";
14057
+ const SEPARATOR = "/";
14058
+ const START = 0;
14059
+ const FIRST = 1;
14060
+ const READ_CONCURRENCY = 8;
14061
+ const LIBRARY_KINDS = [
14062
+ "lib",
14063
+ "rlib",
14064
+ "proc-macro"
14065
+ ];
14066
+ const PROGRAM_KINDS = [
14067
+ "bin",
14068
+ "cdylib",
14069
+ "staticlib",
14070
+ "dylib"
14071
+ ];
14072
+ const Manifest = Schema.Struct({
14073
+ name: Schema.optional(Schema.String),
14074
+ private: Schema.optional(Schema.Boolean),
14075
+ exports: Schema.optional(Schema.Unknown),
14076
+ main: Schema.optional(Schema.Unknown),
14077
+ bin: Schema.optional(Schema.Unknown)
14078
+ });
14079
+ const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
14080
+ const isDependedOn = (links) => ({ directory }) => pipe(links, Array.some(({ from, to }) => to === directory && from !== directory));
14081
+ const isKind = (kinds) => (kind) => Array.contains(kinds, kind);
14082
+ const isLibraryCrate = ({ kinds }) => pipe(kinds, Array.some(isKind(LIBRARY_KINDS))) && !pipe(kinds, Array.some(isKind(PROGRAM_KINDS)));
14083
+ const NO_CARGO = {
14084
+ libraries: [],
14085
+ links: []
14086
+ };
14087
+ const cargoFacts = Effect.fn("cargoFacts")(function* cargoFacts(root, directories) {
14088
+ const files = yield* RepositoryFiles;
14089
+ if (!(yield* files.exists(files.join(root, CARGO_FILE)))) return NO_CARGO;
14090
+ const crates = yield* cratesIn(root);
14091
+ const ownerOf = (path) => owningWorkspace(directories)(files.relative(root, path));
14092
+ const linksOf = (manifest, paths) => {
14093
+ const owner = ownerOf(files.dirname(manifest));
14094
+ const linkTo = (path) => Option.zipWith(owner, ownerOf(path), (from, to) => ({
14095
+ from,
14096
+ to
14097
+ }));
14098
+ return pipe(paths, Array.flatMap((path) => Option.toArray(linkTo(path))));
14099
+ };
14100
+ return {
14101
+ libraries: pipe(crates, Array.filter(isLibraryCrate), Array.flatMap(({ manifest }) => Option.toArray(ownerOf(files.dirname(manifest))))),
14102
+ links: pipe(crates, Array.flatMap(({ manifest, pathDependencies }) => linksOf(manifest, pathDependencies)))
14103
+ };
14104
+ });
14105
+ const workspaceOfTask = (text) => pipe(String$1.indexOf(TASK_SEPARATOR)(text), Option.map((at) => String$1.slice(START, at)(text)), Option.filter(String$1.isNonEmpty));
14106
+ const taskTargets = Effect.fn("taskTargets")(function* taskTargets(root, directory) {
14107
+ const config = yield* workspaceConfigOf(root, directory);
14108
+ return pipe(config, Option.map(({ program }) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(({ text }) => Option.toArray(workspaceOfTask(text))))), Option.getOrElse(() => []));
14109
+ });
14110
+ const isWithin = (directory) => (file) => String$1.startsWith(`${directory}${SEPARATOR}`)(file);
14111
+ const memberOf = Effect.fn("memberOf")(function* memberOf(request) {
14112
+ const { root, directory, crateLibraries, deployed } = request;
14113
+ const files = yield* RepositoryFiles;
14114
+ const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE$3));
14115
+ return pipe(text, Option.flatMap(decodeManifest), Option.map((manifest) => ({
14116
+ directory,
14117
+ name: Option.fromUndefinedOr(manifest.name),
14118
+ library: Predicate.isNotUndefined(manifest.exports) || Predicate.isNotUndefined(manifest.main) || Array.contains(crateLibraries, directory),
14119
+ entry: manifest.private !== true || Predicate.isNotUndefined(manifest.bin) || pipe(deployed, Array.some(isWithin(directory)))
14120
+ })));
14121
+ });
14122
+ const linksTo = (members, from) => (name) => pipe(members, Array.filter((member) => Option.contains(member.name, name)), Array.map(({ directory }) => ({
14123
+ from,
14124
+ to: directory
14125
+ })));
14126
+ const taskLinks = Effect.fn("taskLinks")(function* taskLinks(root, members) {
14127
+ const sources = [ROOT_DIRECTORY, ...pipe(members, Array.map(({ directory }) => directory))];
14128
+ const found = yield* Effect.forEach(sources, (from) => {
14129
+ const toLinks = Array.flatMap(linksTo(members, from));
14130
+ return taskTargets(root, from).pipe(Effect.map(toLinks));
14131
+ }, { concurrency: READ_CONCURRENCY });
14132
+ return Array.flatten(found);
14133
+ });
14134
+ /** @internal */
14135
+ const checkUnusedWorkspaces = Effect.fn("checkUnusedWorkspaces")(function* checkUnusedWorkspaces(root) {
14136
+ const files = yield* RepositoryFiles;
14137
+ const directories = yield* workspaceDirectories(root);
14138
+ const [cargo, deployed, lockedLinks] = yield* Effect.all([
14139
+ cargoFacts(root, directories),
14140
+ deployEntries(root),
14141
+ workspaceLinks(root)
14142
+ ], { concurrency: "unbounded" });
14143
+ const found = yield* Effect.forEach(directories, (directory) => memberOf({
14144
+ root,
14145
+ directory,
14146
+ crateLibraries: cargo.libraries,
14147
+ deployed
14148
+ }), { concurrency: READ_CONCURRENCY });
14149
+ const members = Array.getSomes(found);
14150
+ const tasks = yield* taskLinks(root, members);
14151
+ const links = [
14152
+ ...lockedLinks,
14153
+ ...cargo.links,
14154
+ ...tasks
14155
+ ];
14156
+ return pipe(members, Array.filter(({ library, entry }) => library && !entry), Array.filter((member) => !isDependedOn(links)(member)), Array.map(({ directory }) => ({
14157
+ file: files.join(root, directory, MANIFEST_FILE$3),
14158
+ line: FIRST,
14159
+ column: FIRST,
14160
+ rule: RULE,
14161
+ message: `${directory} is a private library, and no other workspace depends on it through package.json, a Cargo path dependency or a task. Delete it, or depend on it from the code that uses it.`
14162
+ })));
14163
+ });
14377
14164
  // src/app/manifest-checks.ts
14378
14165
  /** @internal */
14379
14166
  const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root) {
14380
- const found = yield* Effect.all([checkNodeVersion(root), checkPackageScope(root)], { concurrency: "unbounded" });
14167
+ const found = yield* Effect.all([
14168
+ checkNodeVersion(root),
14169
+ checkPackageScope(root),
14170
+ checkUnusedWorkspaces(root),
14171
+ checkExactVersions(root),
14172
+ checkUpstreamExits(root),
14173
+ checkScatteredDeviations(root),
14174
+ checkEffectDiagnostics(root)
14175
+ ], { concurrency: "unbounded" });
14381
14176
  return Array.flatten(found);
14382
14177
  });
14383
14178
  // src/app/tracked-text.ts