@r_masseater/msch 0.48.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +4 -4
- package/dist/{check-upstream-exits-BJNhgkLI.mjs → check-upstream-exits-22kQ5juG.mjs} +2 -2
- package/dist/{check-upstream-exits-BJNhgkLI.mjs.map → check-upstream-exits-22kQ5juG.mjs.map} +1 -1
- package/dist/cli.mjs +395 -206
- package/dist/cli.mjs.map +1 -1
- package/dist/{dependencies-v59cxwTD.mjs → dependencies-Bh625TQu.mjs} +15 -11
- package/dist/dependencies-Bh625TQu.mjs.map +1 -0
- package/dist/exits.mjs +3 -3
- package/dist/{ignored-directories-thSB0IAT.mjs → ignored-directories-BrwYtwZw.mjs} +2 -2
- package/dist/{ignored-directories-thSB0IAT.mjs.map → ignored-directories-BrwYtwZw.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/{package-Bdv6W97F.mjs → package-M3y-ZOGZ.mjs} +3 -3
- package/dist/{package-Bdv6W97F.mjs.map → package-M3y-ZOGZ.mjs.map} +1 -1
- package/dist/{problem-u-p6QglA.mjs → problem-DHWbumiO.mjs} +2 -2
- package/dist/{problem-u-p6QglA.mjs.map → problem-DHWbumiO.mjs.map} +1 -1
- package/dist/{project-DeQcAglt.mjs → project-DmUvZQEd.mjs} +4 -4
- package/dist/{project-DeQcAglt.mjs.map → project-DmUvZQEd.mjs.map} +1 -1
- package/dist/publish.mjs +41 -11
- package/dist/publish.mjs.map +1 -1
- package/dist/{repository-files-aXwrITdF.mjs → repository-files-CEaXCw-J.mjs} +4 -3
- package/dist/repository-files-CEaXCw-J.mjs.map +1 -0
- package/dist/{runtime-BmlYnI7T.mjs → runtime-Calown4W.mjs} +2 -2
- package/dist/{runtime-BmlYnI7T.mjs.map → runtime-Calown4W.mjs.map} +1 -1
- package/dist/{syntax-ct2fFLtv.mjs → syntax-P4jlh7LM.mjs} +2 -2
- package/dist/{syntax-ct2fFLtv.mjs.map → syntax-P4jlh7LM.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +3 -2
- package/dist/dependencies-v59cxwTD.mjs.map +0 -1
- package/dist/repository-files-aXwrITdF.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as
|
|
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-
|
|
4
|
-
import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-
|
|
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-
|
|
6
|
-
import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-
|
|
2
|
+
import { B as propertyValue, C as RUN_TASKS, D as hasVerifyTask, E as definesTask, F as KeySchema, I as childrenOf$1, L as keyName, P as workspaceConfigOf, R as literalOf, T as VERIFY_TASK, V as stringsIn, _ as publishedProjects, a as cratesIn, b as workspaceManifest, 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, x as runTasksOf, y as workspaceProjects, z as nestedValues } from "./dependencies-Bh625TQu.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-DmUvZQEd.mjs";
|
|
4
|
+
import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-CEaXCw-J.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-22kQ5juG.mjs";
|
|
6
|
+
import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-M3y-ZOGZ.mjs";
|
|
7
7
|
import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CRAU6yNZ.mjs";
|
|
8
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-
|
|
10
|
-
import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-
|
|
11
|
-
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-
|
|
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-P4jlh7LM.mjs";
|
|
10
|
+
import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-DHWbumiO.mjs";
|
|
11
|
+
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-Calown4W.mjs";
|
|
12
12
|
import "./cli-contract-D7btWrEu.mjs";
|
|
13
13
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
14
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";
|
|
@@ -348,12 +348,12 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
348
348
|
// src/features/check-overrides/model/git-subpath.ts
|
|
349
349
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
350
350
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
351
|
-
const RULE$
|
|
351
|
+
const RULE$53 = "git-subpath-dependency";
|
|
352
352
|
const WHOLE_MATCH$3 = 0;
|
|
353
353
|
const problemAt$8 = ({ file }, source) => (found) => ({
|
|
354
354
|
file,
|
|
355
355
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
356
|
-
rule: RULE$
|
|
356
|
+
rule: RULE$53,
|
|
357
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])}\`.`
|
|
358
358
|
});
|
|
359
359
|
const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
|
|
@@ -364,13 +364,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
364
364
|
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$17);
|
|
365
365
|
});
|
|
366
366
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
367
|
-
const RULE$
|
|
367
|
+
const RULE$52 = "unnamed-restriction";
|
|
368
368
|
const WHOLE_MATCH$2 = 0;
|
|
369
369
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
370
370
|
const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
|
|
371
371
|
file: entry.file,
|
|
372
372
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
373
|
-
rule: RULE$
|
|
373
|
+
rule: RULE$52,
|
|
374
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.`
|
|
375
375
|
})));
|
|
376
376
|
/** @internal */
|
|
@@ -379,7 +379,7 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
379
379
|
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$16);
|
|
380
380
|
});
|
|
381
381
|
// src/features/check-overrides/model/package-registry.ts
|
|
382
|
-
const RULE$
|
|
382
|
+
const RULE$51 = "package-registry";
|
|
383
383
|
const REGISTRY = "https://npm.flatt.tech/";
|
|
384
384
|
const TRAILING_SLASH = /\/$/u;
|
|
385
385
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
@@ -396,7 +396,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
396
396
|
const workspaceProblem = (file, source, registry) => ({
|
|
397
397
|
file,
|
|
398
398
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
399
|
-
rule: RULE$
|
|
399
|
+
rule: RULE$51,
|
|
400
400
|
message: Option.match(registry, {
|
|
401
401
|
onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
|
|
402
402
|
onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
|
|
@@ -405,7 +405,7 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
405
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) => ({
|
|
406
406
|
file: entry.file,
|
|
407
407
|
...positionOf(source)(found.index ?? START$19),
|
|
408
|
-
rule: RULE$
|
|
408
|
+
rule: RULE$51,
|
|
409
409
|
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$19])}\`. Remove the line.`
|
|
410
410
|
})));
|
|
411
411
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -425,7 +425,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
|
|
|
425
425
|
return [...yield* checkWorkspace(root), ...overrides];
|
|
426
426
|
});
|
|
427
427
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
428
|
-
const RULE$
|
|
428
|
+
const RULE$50 = "colocated-git-patterns";
|
|
429
429
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
430
430
|
const ROOT$2 = ".";
|
|
431
431
|
const SEPARATOR$21 = "/";
|
|
@@ -436,7 +436,7 @@ const FLOATING_PREFIX = `${ANY_DEPTH}${SEPARATOR$21}`;
|
|
|
436
436
|
const LEADING_SLASHES = /^\/+/u;
|
|
437
437
|
const TRAILING_SLASHES = /\/+$/u;
|
|
438
438
|
const SPACES = /\s+/u;
|
|
439
|
-
const FIRST$
|
|
439
|
+
const FIRST$27 = 1;
|
|
440
440
|
const READ_CONCURRENCY$29 = 16;
|
|
441
441
|
const isInside = (directory) => (inner) => inner !== directory && (directory === ROOT$2 || String$1.startsWith(`${directory}${SEPARATOR$21}`)(inner));
|
|
442
442
|
const withoutPrefix = (prefix, text) => {
|
|
@@ -462,7 +462,7 @@ const entryOf$1 = (file, kind, directory) => (line, index) => {
|
|
|
462
462
|
file,
|
|
463
463
|
kind,
|
|
464
464
|
directory,
|
|
465
|
-
line: index + FIRST$
|
|
465
|
+
line: index + FIRST$27,
|
|
466
466
|
pattern,
|
|
467
467
|
values: Array.join(values, " ")
|
|
468
468
|
});
|
|
@@ -477,12 +477,12 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
477
477
|
const problemAt$7 = (entry, message) => ({
|
|
478
478
|
file: entry.file,
|
|
479
479
|
line: entry.line,
|
|
480
|
-
column: FIRST$
|
|
481
|
-
rule: RULE$
|
|
480
|
+
column: FIRST$27,
|
|
481
|
+
rule: RULE$50,
|
|
482
482
|
message
|
|
483
483
|
});
|
|
484
484
|
const misplacedMessage = (kind, workspaces) => {
|
|
485
|
-
if (workspaces.length === FIRST$
|
|
485
|
+
if (workspaces.length === FIRST$27) {
|
|
486
486
|
const workspace = Array.join(workspaces, "");
|
|
487
487
|
return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
|
|
488
488
|
}
|
|
@@ -540,8 +540,8 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
540
540
|
return Array.getSomes([...misplacedFound, ...repeatedFound]);
|
|
541
541
|
});
|
|
542
542
|
// src/features/check-placement/model/colocated-tests.ts
|
|
543
|
-
const RULE$
|
|
544
|
-
const FIRST$
|
|
543
|
+
const RULE$49 = "colocated-test";
|
|
544
|
+
const FIRST$26 = 1;
|
|
545
545
|
const READ_CONCURRENCY$28 = 64;
|
|
546
546
|
const ROOT_SUBPATH = ".";
|
|
547
547
|
const NAME_GROUP = "name";
|
|
@@ -566,14 +566,14 @@ const decodeManifest$9 = Schema.decodeUnknownOption(Schema.fromJsonString(Manife
|
|
|
566
566
|
const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
567
567
|
const problemFor$7 = (test, message) => ({
|
|
568
568
|
file: test.file,
|
|
569
|
-
line: FIRST$
|
|
570
|
-
column: FIRST$
|
|
571
|
-
rule: RULE$
|
|
569
|
+
line: FIRST$26,
|
|
570
|
+
column: FIRST$26,
|
|
571
|
+
rule: RULE$49,
|
|
572
572
|
message: `${test.base} ${message}`
|
|
573
573
|
});
|
|
574
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);
|
|
575
575
|
const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP), ...groupsOf$1(source, DIRNAME_REFERENCE, NAME_GROUP)], Array.some((name) => !TEST_FILE$2.test(name)));
|
|
576
|
-
const ownerOf$
|
|
576
|
+
const ownerOf$5 = (packages, name) => {
|
|
577
577
|
const owners = pipe(packages, Array.filter((directory) => String$1.startsWith(directory)(name)));
|
|
578
578
|
return Array.last(Array.sort(owners, byLength$2));
|
|
579
579
|
};
|
|
@@ -584,7 +584,7 @@ const specifiersBeside = ({ join, dirname, directory }) => (manifest) => pipe(Op
|
|
|
584
584
|
}), Array.filter(({ source }) => dirname(source) === directory), Array.map(({ label }) => String$1.replace(ROOT_SUBPATH, name)(label)))), Option.getOrElse(() => []));
|
|
585
585
|
const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context, test) {
|
|
586
586
|
const files = yield* RepositoryFiles;
|
|
587
|
-
const owner = ownerOf$
|
|
587
|
+
const owner = ownerOf$5(context.packages, test.name);
|
|
588
588
|
if (Option.isNone(owner)) return [];
|
|
589
589
|
const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE$3));
|
|
590
590
|
const join = (target) => files.join(context.root, owner.value, target);
|
|
@@ -650,26 +650,26 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
650
650
|
});
|
|
651
651
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
652
652
|
const RECOMMENDED_LINES = 200;
|
|
653
|
-
const FIRST$
|
|
654
|
-
const RULE$
|
|
653
|
+
const FIRST$25 = 1;
|
|
654
|
+
const RULE$48 = "agent-docs-length";
|
|
655
655
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
656
656
|
const problemFor$6 = (file) => (lines) => {
|
|
657
657
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
658
658
|
return Option.some({
|
|
659
659
|
file,
|
|
660
660
|
line: 201,
|
|
661
|
-
column: FIRST$
|
|
662
|
-
rule: RULE$
|
|
661
|
+
column: FIRST$25,
|
|
662
|
+
rule: RULE$48,
|
|
663
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.`
|
|
664
664
|
});
|
|
665
665
|
};
|
|
666
666
|
/** @internal */
|
|
667
667
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$6(file)(lineCount(source)));
|
|
668
668
|
// src/features/check-placement/model/claude-link.ts
|
|
669
|
-
const RULE$
|
|
669
|
+
const RULE$47 = "claude-md-link";
|
|
670
670
|
const CLAUDE = "CLAUDE.md";
|
|
671
671
|
const AGENTS = "AGENTS.md";
|
|
672
|
-
const FIRST$
|
|
672
|
+
const FIRST$24 = 1;
|
|
673
673
|
const READ_CONCURRENCY$26 = 16;
|
|
674
674
|
const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
675
675
|
/** @internal */
|
|
@@ -683,9 +683,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
683
683
|
const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
|
|
684
684
|
return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
|
|
685
685
|
file: path,
|
|
686
|
-
line: FIRST$
|
|
687
|
-
column: FIRST$
|
|
688
|
-
rule: RULE$
|
|
686
|
+
line: FIRST$24,
|
|
687
|
+
column: FIRST$24,
|
|
688
|
+
rule: RULE$47,
|
|
689
689
|
message: MESSAGE$16
|
|
690
690
|
})));
|
|
691
691
|
});
|
|
@@ -694,9 +694,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
694
694
|
return Array.getSomes(found);
|
|
695
695
|
});
|
|
696
696
|
// src/features/check-placement/model/dangling-links.ts
|
|
697
|
-
const RULE$
|
|
697
|
+
const RULE$46 = "dangling-link";
|
|
698
698
|
const SEPARATOR$20 = "/";
|
|
699
|
-
const FIRST$
|
|
699
|
+
const FIRST$23 = 1;
|
|
700
700
|
const READ_CONCURRENCY$25 = 16;
|
|
701
701
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$20}`)(name);
|
|
702
702
|
/** @internal */
|
|
@@ -708,9 +708,9 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
708
708
|
const link = yield* files.readLink(file);
|
|
709
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) => ({
|
|
710
710
|
file,
|
|
711
|
-
line: FIRST$
|
|
712
|
-
column: FIRST$
|
|
713
|
-
rule: RULE$
|
|
711
|
+
line: FIRST$23,
|
|
712
|
+
column: FIRST$23,
|
|
713
|
+
rule: RULE$46,
|
|
714
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.`
|
|
715
715
|
})));
|
|
716
716
|
});
|
|
@@ -718,10 +718,10 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
718
718
|
return Array.getSomes(found);
|
|
719
719
|
});
|
|
720
720
|
// src/features/check-placement/model/nested-docs.ts
|
|
721
|
-
const RULE$
|
|
721
|
+
const RULE$45 = "nested-docs";
|
|
722
722
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
723
723
|
const SEPARATOR$19 = "/";
|
|
724
|
-
const FIRST$
|
|
724
|
+
const FIRST$22 = 1;
|
|
725
725
|
const READ_CONCURRENCY$24 = 64;
|
|
726
726
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
727
727
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
@@ -732,9 +732,9 @@ var RootConfigUnreadable = class extends taggedError$5()("RootConfigUnreadable",
|
|
|
732
732
|
const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
|
|
733
733
|
const problemFor$5 = (file, message) => ({
|
|
734
734
|
file,
|
|
735
|
-
line: FIRST$
|
|
736
|
-
column: FIRST$
|
|
737
|
-
rule: RULE$
|
|
735
|
+
line: FIRST$22,
|
|
736
|
+
column: FIRST$22,
|
|
737
|
+
rule: RULE$45,
|
|
738
738
|
message
|
|
739
739
|
});
|
|
740
740
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
@@ -785,7 +785,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
785
785
|
return Array.getSomes(found);
|
|
786
786
|
});
|
|
787
787
|
// src/features/check-placement/model/published-readme.ts
|
|
788
|
-
const RULE$
|
|
788
|
+
const RULE$44 = "published-readme";
|
|
789
789
|
const README_FILE = "README.md";
|
|
790
790
|
const READ_CONCURRENCY$23 = 16;
|
|
791
791
|
const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
@@ -799,7 +799,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
799
799
|
file,
|
|
800
800
|
line: FILE_START$1,
|
|
801
801
|
column: FILE_START$1,
|
|
802
|
-
rule: RULE$
|
|
802
|
+
rule: RULE$44,
|
|
803
803
|
message: MISSING_MESSAGE
|
|
804
804
|
});
|
|
805
805
|
return pipe(text, Option.flatMap((source) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
|
|
@@ -808,7 +808,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
808
808
|
file,
|
|
809
809
|
line,
|
|
810
810
|
column,
|
|
811
|
-
rule: RULE$
|
|
811
|
+
rule: RULE$44,
|
|
812
812
|
message: MESSAGE$15
|
|
813
813
|
};
|
|
814
814
|
}))));
|
|
@@ -820,7 +820,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
820
820
|
return Array.getSomes(found);
|
|
821
821
|
});
|
|
822
822
|
// src/features/check-placement/model/published-tests.ts
|
|
823
|
-
const RULE$
|
|
823
|
+
const RULE$43 = "published-tests";
|
|
824
824
|
const MANIFEST_FILE$2 = "package.json";
|
|
825
825
|
const FILE_START = 1;
|
|
826
826
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
@@ -835,7 +835,7 @@ const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
835
835
|
file: files.join(absolute, MANIFEST_FILE$2),
|
|
836
836
|
line: FILE_START,
|
|
837
837
|
column: FILE_START,
|
|
838
|
-
rule: RULE$
|
|
838
|
+
rule: RULE$43,
|
|
839
839
|
message: MESSAGE$14
|
|
840
840
|
});
|
|
841
841
|
});
|
|
@@ -849,9 +849,9 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
849
849
|
return Array.getSomes(found);
|
|
850
850
|
});
|
|
851
851
|
// src/features/check-placement/model/root-docs.ts
|
|
852
|
-
const RULE$
|
|
852
|
+
const RULE$42 = "root-docs";
|
|
853
853
|
const SEPARATOR$18 = "/";
|
|
854
|
-
const FIRST$
|
|
854
|
+
const FIRST$21 = 1;
|
|
855
855
|
const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
|
|
856
856
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
857
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.";
|
|
@@ -862,26 +862,26 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
862
862
|
const names = yield* files.listedFiles(root);
|
|
863
863
|
return pipe(names, Array.filter(isStrayRootDoc), Array.map((name) => ({
|
|
864
864
|
file: files.join(root, name),
|
|
865
|
-
line: FIRST$
|
|
866
|
-
column: FIRST$
|
|
867
|
-
rule: RULE$
|
|
865
|
+
line: FIRST$21,
|
|
866
|
+
column: FIRST$21,
|
|
867
|
+
rule: RULE$42,
|
|
868
868
|
message: `${name} ${MESSAGE$13}`
|
|
869
869
|
})));
|
|
870
870
|
});
|
|
871
871
|
// src/features/check-placement/model/root-readme.ts
|
|
872
|
-
const RULE$
|
|
872
|
+
const RULE$41 = "root-readme";
|
|
873
873
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
874
874
|
const READ_CONCURRENCY$22 = 16;
|
|
875
875
|
const START$18 = 0;
|
|
876
876
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
877
|
-
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
877
|
+
const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
|
|
878
878
|
const RELATIVE$1 = /^\.\//u;
|
|
879
879
|
const SEPARATOR$17 = "/";
|
|
880
880
|
const MarketplacePlugin = Schema.Struct({
|
|
881
881
|
name: Schema.optional(Schema.String),
|
|
882
882
|
source: Schema.Unknown
|
|
883
883
|
});
|
|
884
|
-
const Marketplace = Schema.fromJsonString(Schema.Struct({ plugins: Schema.Array(MarketplacePlugin) }));
|
|
884
|
+
const Marketplace$1 = Schema.fromJsonString(Schema.Struct({ plugins: Schema.Array(MarketplacePlugin) }));
|
|
885
885
|
const NO_PLUGINS = {
|
|
886
886
|
directories: [],
|
|
887
887
|
names: []
|
|
@@ -899,8 +899,8 @@ const pluginsOf = (plugins) => {
|
|
|
899
899
|
};
|
|
900
900
|
const marketplacePlugins = Effect.fn("marketplacePlugins")(function* marketplacePlugins(root) {
|
|
901
901
|
const files = yield* RepositoryFiles;
|
|
902
|
-
const text = yield* files.readFile(files.join(root, MARKETPLACE));
|
|
903
|
-
return pipe(text, Option.flatMap(Schema.decodeOption(Marketplace)), Option.map(({ plugins }) => pluginsOf(plugins)), Option.getOrElse(() => NO_PLUGINS));
|
|
902
|
+
const text = yield* files.readFile(files.join(root, MARKETPLACE$1));
|
|
903
|
+
return pipe(text, Option.flatMap(Schema.decodeOption(Marketplace$1)), Option.map(({ plugins }) => pluginsOf(plugins)), Option.getOrElse(() => NO_PLUGINS));
|
|
904
904
|
});
|
|
905
905
|
const isPluginName = (plugins) => (name) => Array.contains(plugins.names, name);
|
|
906
906
|
const ownNames = (plugins, names) => {
|
|
@@ -918,7 +918,7 @@ const problemsIn$15 = (file, source, plugins) => (workspace) => {
|
|
|
918
918
|
return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
|
|
919
919
|
file,
|
|
920
920
|
...at(found.index ?? START$18),
|
|
921
|
-
rule: RULE$
|
|
921
|
+
rule: RULE$41,
|
|
922
922
|
message
|
|
923
923
|
})));
|
|
924
924
|
};
|
|
@@ -956,7 +956,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
956
956
|
return Array.flatten(found);
|
|
957
957
|
});
|
|
958
958
|
// src/features/check-placement/model/docs-mirror.ts
|
|
959
|
-
const RULE$
|
|
959
|
+
const RULE$40 = "docs-mirror";
|
|
960
960
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
961
961
|
const MIRROR_LIMIT = 3;
|
|
962
962
|
const READ_CONCURRENCY$21 = 16;
|
|
@@ -973,7 +973,7 @@ const firstMention = (source, workspace) => {
|
|
|
973
973
|
const mentions = pipe(workspace.names, Array.flatMap(mentionOf(source, workspace.directory)));
|
|
974
974
|
return Array.head(Array.sort(mentions, byOffset));
|
|
975
975
|
};
|
|
976
|
-
const ownerOf$
|
|
976
|
+
const ownerOf$4 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
|
|
977
977
|
const describe = (mentions) => pipe(mentions, Array.map(({ directory }) => `\`${directory}\``), Array.join(", "));
|
|
978
978
|
const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
|
|
979
979
|
const { line, column } = positionOf(source)(offset);
|
|
@@ -981,11 +981,11 @@ const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Opti
|
|
|
981
981
|
file,
|
|
982
982
|
line,
|
|
983
983
|
column,
|
|
984
|
-
rule: RULE$
|
|
984
|
+
rule: RULE$40,
|
|
985
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.`
|
|
986
986
|
};
|
|
987
987
|
}), Option.toArray);
|
|
988
|
-
const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$
|
|
988
|
+
const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$4(doc)(workspace)));
|
|
989
989
|
const problemIn$3 = (workspaces) => (doc, file, source) => {
|
|
990
990
|
const mentions = pipe(othersIn(doc, workspaces), Array.flatMap((workspace) => Option.toArray(firstMention(source, workspace))));
|
|
991
991
|
return problemFor$3(file, source, Array.sort(mentions, byOffset));
|
|
@@ -1013,9 +1013,9 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
1013
1013
|
return Array.flatten(found);
|
|
1014
1014
|
});
|
|
1015
1015
|
// src/features/check-placement/model/ignored-sources.ts
|
|
1016
|
-
const RULE$
|
|
1016
|
+
const RULE$39 = "ignored-sources";
|
|
1017
1017
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
1018
|
-
const FIRST$
|
|
1018
|
+
const FIRST$20 = 1;
|
|
1019
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.";
|
|
1020
1020
|
/** @internal */
|
|
1021
1021
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
@@ -1023,15 +1023,15 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
1023
1023
|
const ignored = yield* files.ignoredFiles(root, SOURCES);
|
|
1024
1024
|
return pipe(ignored, Array.map((file) => ({
|
|
1025
1025
|
file: files.join(root, file),
|
|
1026
|
-
line: FIRST$
|
|
1027
|
-
column: FIRST$
|
|
1028
|
-
rule: RULE$
|
|
1026
|
+
line: FIRST$20,
|
|
1027
|
+
column: FIRST$20,
|
|
1028
|
+
rule: RULE$39,
|
|
1029
1029
|
message: MESSAGE$12
|
|
1030
1030
|
})));
|
|
1031
1031
|
});
|
|
1032
1032
|
// src/features/check-placement/model/member-sources.ts
|
|
1033
1033
|
const ROOT_WORKSPACE$1 = ".";
|
|
1034
|
-
const FIRST$
|
|
1034
|
+
const FIRST$19 = 1;
|
|
1035
1035
|
const SEPARATOR$16 = "/";
|
|
1036
1036
|
const EXCLUDED$6 = [
|
|
1037
1037
|
":(exclude,attr:linguist-vendored)",
|
|
@@ -1052,12 +1052,12 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
|
|
|
1052
1052
|
const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
1053
1053
|
const fileProblem$1 = ({ file, rule, message }) => ({
|
|
1054
1054
|
file,
|
|
1055
|
-
line: FIRST$
|
|
1056
|
-
column: FIRST$
|
|
1055
|
+
line: FIRST$19,
|
|
1056
|
+
column: FIRST$19,
|
|
1057
1057
|
rule,
|
|
1058
1058
|
message
|
|
1059
1059
|
});
|
|
1060
|
-
const ownerOf$
|
|
1060
|
+
const ownerOf$3 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$16}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
|
|
1061
1061
|
workspace,
|
|
1062
1062
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
1063
1063
|
})));
|
|
@@ -9664,7 +9664,7 @@ const deployNamed = ({ workspace, inner }) => {
|
|
|
9664
9664
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
9665
9665
|
const files = yield* RepositoryFiles;
|
|
9666
9666
|
const { workspaces, listed } = yield* memberSources(root);
|
|
9667
|
-
const owned = pipe(listed, Array.map(ownerOf$
|
|
9667
|
+
const owned = pipe(listed, Array.map(ownerOf$3(workspaces)), Array.getSomes);
|
|
9668
9668
|
const report = (rule, message) => (found) => pipe(Array.dedupe(found), Array.map((name) => fileProblem$1({
|
|
9669
9669
|
file: files.join(root, name),
|
|
9670
9670
|
rule,
|
|
@@ -9779,13 +9779,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
9779
9779
|
return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
|
|
9780
9780
|
});
|
|
9781
9781
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
9782
|
-
const RULE$
|
|
9783
|
-
const FIRST$
|
|
9782
|
+
const RULE$38 = "shadcn-ui-alias";
|
|
9783
|
+
const FIRST$18 = 1;
|
|
9784
9784
|
const problemOf$8 = (directory, { file, alias }) => ({
|
|
9785
9785
|
file,
|
|
9786
|
-
line: FIRST$
|
|
9787
|
-
column: FIRST$
|
|
9788
|
-
rule: RULE$
|
|
9786
|
+
line: FIRST$18,
|
|
9787
|
+
column: FIRST$18,
|
|
9788
|
+
rule: RULE$38,
|
|
9789
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
9790
|
});
|
|
9791
9791
|
/** @internal */
|
|
@@ -9801,7 +9801,7 @@ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAli
|
|
|
9801
9801
|
});
|
|
9802
9802
|
// src/features/check-placement/model/source-aliases.ts
|
|
9803
9803
|
const ALIAS_RULE = "source-alias";
|
|
9804
|
-
const FIRST$
|
|
9804
|
+
const FIRST$17 = 1;
|
|
9805
9805
|
const SOURCE_ALIAS = "#/*";
|
|
9806
9806
|
const SOURCE_TARGET = "./src/*";
|
|
9807
9807
|
const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
|
|
@@ -9810,8 +9810,8 @@ const Manifest$4 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
|
|
|
9810
9810
|
const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
|
|
9811
9811
|
const problemAt$6 = (file, rule, message) => ({
|
|
9812
9812
|
file,
|
|
9813
|
-
line: FIRST$
|
|
9814
|
-
column: FIRST$
|
|
9813
|
+
line: FIRST$17,
|
|
9814
|
+
column: FIRST$17,
|
|
9815
9815
|
rule,
|
|
9816
9816
|
message
|
|
9817
9817
|
});
|
|
@@ -9859,7 +9859,7 @@ const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
|
9859
9859
|
const SEPARATOR$13 = "/";
|
|
9860
9860
|
const CURRENT = "./";
|
|
9861
9861
|
const READ_CONCURRENCY$19 = 8;
|
|
9862
|
-
const FIRST$
|
|
9862
|
+
const FIRST$16 = 1;
|
|
9863
9863
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
9864
9864
|
const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
9865
9865
|
const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
|
|
@@ -9935,8 +9935,8 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
9935
9935
|
const isRun = (path) => Array.contains(runPaths, path) || Array.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
|
|
9936
9936
|
const unrun = pipe(commands, Array.filter((path) => !isRun(path)), Array.map((path) => ({
|
|
9937
9937
|
file: files.join(root, directory, path),
|
|
9938
|
-
line: FIRST$
|
|
9939
|
-
column: FIRST$
|
|
9938
|
+
line: FIRST$16,
|
|
9939
|
+
column: FIRST$16,
|
|
9940
9940
|
rule: UNRUN,
|
|
9941
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.`
|
|
9942
9942
|
})));
|
|
@@ -9948,8 +9948,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
9948
9948
|
const isDirectory = yield* files.isDirectory(file);
|
|
9949
9949
|
return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
|
|
9950
9950
|
file,
|
|
9951
|
-
line: FIRST$
|
|
9952
|
-
column: FIRST$
|
|
9951
|
+
line: FIRST$16,
|
|
9952
|
+
column: FIRST$16,
|
|
9953
9953
|
rule: SCRIPTS,
|
|
9954
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.`
|
|
9955
9955
|
})));
|
|
@@ -9963,21 +9963,21 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
9963
9963
|
return [...Array.flatten(found), ...Array.getSomes(scripts)];
|
|
9964
9964
|
});
|
|
9965
9965
|
// src/features/check-repository-layout/model/crates.ts
|
|
9966
|
-
const RULE$
|
|
9966
|
+
const RULE$37 = "unverified-crate";
|
|
9967
9967
|
const VERSION_RULE = "release-version";
|
|
9968
9968
|
const MANIFEST_FILE$1 = "package.json";
|
|
9969
9969
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
9970
9970
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
9971
9971
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
9972
9972
|
const SEPARATOR$12 = "/";
|
|
9973
|
-
const FIRST$
|
|
9973
|
+
const FIRST$15 = 1;
|
|
9974
9974
|
const READ_CONCURRENCY$18 = 8;
|
|
9975
9975
|
const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
|
|
9976
9976
|
const problemFor$2 = (crate, message) => ({
|
|
9977
9977
|
file: crate.manifest,
|
|
9978
|
-
line: FIRST$
|
|
9979
|
-
column: FIRST$
|
|
9980
|
-
rule: RULE$
|
|
9978
|
+
line: FIRST$15,
|
|
9979
|
+
column: FIRST$15,
|
|
9980
|
+
rule: RULE$37,
|
|
9981
9981
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
9982
9982
|
});
|
|
9983
9983
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -9997,8 +9997,8 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
|
|
|
9997
9997
|
if (Option.isNone(version) || version.value === crate.version) return Option.none();
|
|
9998
9998
|
return Option.some({
|
|
9999
9999
|
file: crate.manifest,
|
|
10000
|
-
line: FIRST$
|
|
10001
|
-
column: FIRST$
|
|
10000
|
+
line: FIRST$15,
|
|
10001
|
+
column: FIRST$15,
|
|
10002
10002
|
rule: VERSION_RULE,
|
|
10003
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.`
|
|
10004
10004
|
});
|
|
@@ -10013,7 +10013,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
10013
10013
|
return Array.getSomes(Array.flatten(found));
|
|
10014
10014
|
});
|
|
10015
10015
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
10016
|
-
const RULE$
|
|
10016
|
+
const RULE$36 = "deploy-entry-pattern";
|
|
10017
10017
|
const FALLOW_KEYS = [
|
|
10018
10018
|
"entry",
|
|
10019
10019
|
"entryPoints",
|
|
@@ -10084,7 +10084,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
10084
10084
|
return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
|
|
10085
10085
|
file: path,
|
|
10086
10086
|
...positionOf(text.value)(start - kind.offset),
|
|
10087
|
-
rule: RULE$
|
|
10087
|
+
rule: RULE$36,
|
|
10088
10088
|
message: `${pattern} ${MESSAGE$11}`
|
|
10089
10089
|
})));
|
|
10090
10090
|
});
|
|
@@ -10117,7 +10117,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10117
10117
|
return Array.flatten(found);
|
|
10118
10118
|
});
|
|
10119
10119
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
10120
|
-
const RULE$
|
|
10120
|
+
const RULE$35 = "listed-entry";
|
|
10121
10121
|
const ENTRY_KEYS = [
|
|
10122
10122
|
"entry",
|
|
10123
10123
|
"entryPoints",
|
|
@@ -10147,7 +10147,7 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10147
10147
|
return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
|
|
10148
10148
|
file: path,
|
|
10149
10149
|
...positionOf(text.value)(start),
|
|
10150
|
-
rule: RULE$
|
|
10150
|
+
rule: RULE$35,
|
|
10151
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.`
|
|
10152
10152
|
})));
|
|
10153
10153
|
});
|
|
@@ -10159,11 +10159,11 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
10159
10159
|
return Array.flatten(found);
|
|
10160
10160
|
});
|
|
10161
10161
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
10162
|
-
const RULE$
|
|
10162
|
+
const RULE$34 = "root-workspace-path";
|
|
10163
10163
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
10164
10164
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
10165
10165
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
10166
|
-
const FIRST$
|
|
10166
|
+
const FIRST$14 = 0;
|
|
10167
10167
|
const NEXT$2 = 1;
|
|
10168
10168
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
10169
10169
|
const mentions = (directory) => (text) => {
|
|
@@ -10171,14 +10171,14 @@ const mentions = (directory) => (text) => {
|
|
|
10171
10171
|
return pipe(Array.drop(parts, NEXT$2), Array.some((after, index) => {
|
|
10172
10172
|
const before = parts[index] ?? "";
|
|
10173
10173
|
const previous = String$1.slice(before.length - NEXT$2)(before);
|
|
10174
|
-
const following = String$1.slice(FIRST$
|
|
10174
|
+
const following = String$1.slice(FIRST$14, NEXT$2)(after);
|
|
10175
10175
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
10176
10176
|
}));
|
|
10177
10177
|
};
|
|
10178
10178
|
const problemsIn$11 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
|
|
10179
10179
|
file,
|
|
10180
10180
|
...positionOf(source)(found.start),
|
|
10181
|
-
rule: RULE$
|
|
10181
|
+
rule: RULE$34,
|
|
10182
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.`
|
|
10183
10183
|
})));
|
|
10184
10184
|
/** @internal */
|
|
@@ -10192,9 +10192,9 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
10192
10192
|
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$11(file, source.value, directories)));
|
|
10193
10193
|
});
|
|
10194
10194
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
10195
|
-
const RULE$
|
|
10195
|
+
const RULE$33 = "hidden-verify";
|
|
10196
10196
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
10197
|
-
const FIRST$
|
|
10197
|
+
const FIRST$13 = 1;
|
|
10198
10198
|
const READ_CONCURRENCY$15 = 8;
|
|
10199
10199
|
const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
10200
10200
|
const config = yield* workspaceConfigOf(root, directory);
|
|
@@ -10204,9 +10204,9 @@ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
10204
10204
|
const verified = yield* hasVerifyTask(file);
|
|
10205
10205
|
return Option.some({
|
|
10206
10206
|
file,
|
|
10207
|
-
line: FIRST$
|
|
10208
|
-
column: FIRST$
|
|
10209
|
-
rule: RULE$
|
|
10207
|
+
line: FIRST$13,
|
|
10208
|
+
column: FIRST$13,
|
|
10209
|
+
rule: RULE$33,
|
|
10210
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
10211
|
}).pipe(Option.filter(() => verified));
|
|
10212
10212
|
});
|
|
@@ -10217,7 +10217,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
10217
10217
|
return Array.getSomes(found);
|
|
10218
10218
|
});
|
|
10219
10219
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
10220
|
-
const RULE$
|
|
10220
|
+
const RULE$32 = "shared-uncached-task";
|
|
10221
10221
|
const READ_CONCURRENCY$14 = 8;
|
|
10222
10222
|
const SHARED = 2;
|
|
10223
10223
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -10260,7 +10260,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
10260
10260
|
return pipe(definitions, Array.map(({ file, position, name, command }) => ({
|
|
10261
10261
|
file,
|
|
10262
10262
|
...position,
|
|
10263
|
-
rule: RULE$
|
|
10263
|
+
rule: RULE$32,
|
|
10264
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.`
|
|
10265
10265
|
})));
|
|
10266
10266
|
};
|
|
@@ -10271,7 +10271,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
10271
10271
|
return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
|
|
10272
10272
|
});
|
|
10273
10273
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
10274
|
-
const RULE$
|
|
10274
|
+
const RULE$31 = "unlocked-task";
|
|
10275
10275
|
const READ_CONCURRENCY$13 = 8;
|
|
10276
10276
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
10277
10277
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -10283,7 +10283,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
10283
10283
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
10284
10284
|
file,
|
|
10285
10285
|
...positionOf(source)(task.start),
|
|
10286
|
-
rule: RULE$
|
|
10286
|
+
rule: RULE$31,
|
|
10287
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
10288
|
})), Option.toArray)));
|
|
10289
10289
|
/** @internal */
|
|
@@ -10438,13 +10438,13 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
10438
10438
|
/** @internal */
|
|
10439
10439
|
const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
|
|
10440
10440
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
10441
|
-
const RULE$
|
|
10441
|
+
const RULE$30 = "workflow-path";
|
|
10442
10442
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
10443
10443
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
10444
10444
|
const READ_CONCURRENCY$12 = 8;
|
|
10445
10445
|
const WILDCARD$2 = /[*?[]/u;
|
|
10446
10446
|
const SEPARATOR$9 = "/";
|
|
10447
|
-
const FIRST$
|
|
10447
|
+
const FIRST$12 = 0;
|
|
10448
10448
|
const EXPECTED = {
|
|
10449
10449
|
action: "a directory with action.yml",
|
|
10450
10450
|
directory: "a directory",
|
|
@@ -10485,7 +10485,7 @@ const RESOLVERS = {
|
|
|
10485
10485
|
};
|
|
10486
10486
|
const staticPrefix = (path) => {
|
|
10487
10487
|
const prefix = Array.headNonEmpty(String$1.split(path, WILDCARD$2));
|
|
10488
|
-
if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$
|
|
10488
|
+
if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$12, -1)(prefix);
|
|
10489
10489
|
return prefix;
|
|
10490
10490
|
};
|
|
10491
10491
|
const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
|
|
@@ -10504,7 +10504,7 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
|
|
|
10504
10504
|
const problemOf$7 = (file, source) => (found) => ({
|
|
10505
10505
|
file,
|
|
10506
10506
|
...positionOf(source)(found.offset),
|
|
10507
|
-
rule: RULE$
|
|
10507
|
+
rule: RULE$30,
|
|
10508
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.`
|
|
10509
10509
|
});
|
|
10510
10510
|
const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
@@ -10631,12 +10631,12 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
10631
10631
|
return Array.flatten(found);
|
|
10632
10632
|
});
|
|
10633
10633
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
10634
|
-
const RULE$
|
|
10634
|
+
const RULE$29 = "legacy-typescript";
|
|
10635
10635
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
10636
10636
|
const COMPILER = "typescript";
|
|
10637
10637
|
const CURRENT_MAJOR = 7;
|
|
10638
10638
|
const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
|
|
10639
|
-
const FIRST$
|
|
10639
|
+
const FIRST$11 = 1;
|
|
10640
10640
|
const legacyOf = (id) => {
|
|
10641
10641
|
const { name, version } = parse$1(id);
|
|
10642
10642
|
const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
|
|
@@ -10647,8 +10647,8 @@ const legacyOf = (id) => {
|
|
|
10647
10647
|
};
|
|
10648
10648
|
const dependentsOf = (nodes) => (id) => pipe(nodes, Array.filter(({ dependencies }) => Array.contains(dependencies, id)), Array.map((node) => `\`${node.id}\``));
|
|
10649
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({
|
|
10650
|
-
onNone: () => FIRST$
|
|
10651
|
-
onSome: (index) => index + FIRST$
|
|
10650
|
+
onNone: () => FIRST$11,
|
|
10651
|
+
onSome: (index) => index + FIRST$11
|
|
10652
10652
|
}));
|
|
10653
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)}.`;
|
|
10654
10654
|
/** @internal */
|
|
@@ -10661,8 +10661,8 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
10661
10661
|
return pipe(Option.getOrElse(nodes, () => []), Array.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array.map((legacy) => ({
|
|
10662
10662
|
file,
|
|
10663
10663
|
line: lineOf$2(source)(legacy.id),
|
|
10664
|
-
column: FIRST$
|
|
10665
|
-
rule: RULE$
|
|
10664
|
+
column: FIRST$11,
|
|
10665
|
+
rule: RULE$29,
|
|
10666
10666
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
10667
10667
|
})));
|
|
10668
10668
|
});
|
|
@@ -11087,7 +11087,7 @@ const scanned = (owners, problems) => ({
|
|
|
11087
11087
|
owners,
|
|
11088
11088
|
problems
|
|
11089
11089
|
});
|
|
11090
|
-
const ownerOf$
|
|
11090
|
+
const ownerOf$2 = (project) => (annotated) => {
|
|
11091
11091
|
const { node, conceptId } = annotated;
|
|
11092
11092
|
if (!isModuleConst(node)) return scanned([], [annotationProblem(`@${OWNER_TAG} registers an owner only on a module-scope const.`)(node)]);
|
|
11093
11093
|
if (conceptId === "") return scanned([], [annotationProblem(`@${OWNER_TAG} needs a concept id.`)(node)]);
|
|
@@ -11121,7 +11121,7 @@ const conflictProblems = (owners) => pipe(owners, Array.flatMap((owner, index) =
|
|
|
11121
11121
|
return [...pipe(Array.take(sameConcept, FIRST_OWNER_COUNT), Array.map(() => ownerProblem(`The concept ${owner.conceptId} already has an owner.`)(owner))), ...pipe(Array.take(sameSet, FIRST_OWNER_COUNT), Array.map((other) => ownerProblem(`The values ${formatValues(owner.values)} are already owned by ${other.conceptId}.`)(owner)))];
|
|
11122
11122
|
}));
|
|
11123
11123
|
const ownersIn = (project) => {
|
|
11124
|
-
const results = pipe(project.sourceFiles, Array.flatMap((sourceFile) => pipe(annotatedIn(sourceFile), Array.map((annotated) => ownerOf$
|
|
11124
|
+
const results = pipe(project.sourceFiles, Array.flatMap((sourceFile) => pipe(annotatedIn(sourceFile), Array.map((annotated) => ownerOf$2(project)(annotated)))));
|
|
11125
11125
|
return scanned(pipe(results, Array.flatMap((result) => result.owners)), pipe(results, Array.flatMap((result) => result.problems)));
|
|
11126
11126
|
};
|
|
11127
11127
|
const combineOwnerScans = (scans) => {
|
|
@@ -11576,7 +11576,7 @@ const duplicateProblems = (relative) => (sites) => {
|
|
|
11576
11576
|
}))));
|
|
11577
11577
|
};
|
|
11578
11578
|
// src/features/check-value-owners/model/name-lists.ts
|
|
11579
|
-
const RULE$
|
|
11579
|
+
const RULE$28 = "hand-written-names";
|
|
11580
11580
|
const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
11581
11581
|
const nameListOf = (site) => {
|
|
11582
11582
|
if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -11591,7 +11591,7 @@ const problemOf$6 = ({ list, reason }) => ({
|
|
|
11591
11591
|
file: list.site.file,
|
|
11592
11592
|
line: list.site.line,
|
|
11593
11593
|
column: list.site.column,
|
|
11594
|
-
rule: RULE$
|
|
11594
|
+
rule: RULE$28,
|
|
11595
11595
|
message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
|
|
11596
11596
|
});
|
|
11597
11597
|
// src/features/check-value-owners/model/declared-names.ts
|
|
@@ -11818,7 +11818,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
11818
11818
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
11819
11819
|
}, Effect.scoped);
|
|
11820
11820
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
11821
|
-
const RULE$
|
|
11821
|
+
const RULE$27 = "namespace-destructuring";
|
|
11822
11822
|
const LOCAL = /^[.#/]/u;
|
|
11823
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.`;
|
|
11824
11824
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -11834,7 +11834,7 @@ const destructuredName = (declaration) => {
|
|
|
11834
11834
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
11835
11835
|
};
|
|
11836
11836
|
const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
|
|
11837
|
-
rule: RULE$
|
|
11837
|
+
rule: RULE$27,
|
|
11838
11838
|
message: messageOf$1(name)
|
|
11839
11839
|
})), Option.map((report) => report(declaration)));
|
|
11840
11840
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -11842,7 +11842,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
11842
11842
|
return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
|
|
11843
11843
|
};
|
|
11844
11844
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
11845
|
-
const RULE$
|
|
11845
|
+
const RULE$26 = "pass-through-wrapper";
|
|
11846
11846
|
const SINGLE_STATEMENT = 1;
|
|
11847
11847
|
const SINGLE_DECLARATION = 1;
|
|
11848
11848
|
const THIS_PARAMETER = "this";
|
|
@@ -11939,7 +11939,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
11939
11939
|
const problemOf$4 = (checker) => (candidate) => {
|
|
11940
11940
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
11941
11941
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
|
|
11942
|
-
rule: RULE$
|
|
11942
|
+
rule: RULE$26,
|
|
11943
11943
|
message: messageOf(forward.callee.getText())
|
|
11944
11944
|
})(candidate.name)));
|
|
11945
11945
|
};
|
|
@@ -11947,8 +11947,79 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
|
|
|
11947
11947
|
// src/app/source-checks.ts
|
|
11948
11948
|
/** @internal */
|
|
11949
11949
|
const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
|
|
11950
|
+
// ../../.claude-plugin/marketplace.json
|
|
11951
|
+
var name = "masseater-dev";
|
|
11952
|
+
var plugins = [{
|
|
11953
|
+
"name": "kogane",
|
|
11954
|
+
"source": {
|
|
11955
|
+
"source": "npm",
|
|
11956
|
+
"package": "@r_masseater/kogane"
|
|
11957
|
+
},
|
|
11958
|
+
"description": "Claude Code plugin that suggests existing workspaces of the current pnpm monorepo for each prompt, ranked with EmbeddingGemma 2 on the user's machine."
|
|
11959
|
+
}, {
|
|
11960
|
+
"name": "watashi",
|
|
11961
|
+
"source": {
|
|
11962
|
+
"source": "npm",
|
|
11963
|
+
"package": "@r_masseater/watashi"
|
|
11964
|
+
},
|
|
11965
|
+
"description": "CLI for watashi (watashi.masseater.dev). Sends Claude Code transcripts from a Stop hook after masking secrets locally with h56m, and manages login and API tokens."
|
|
11966
|
+
}];
|
|
11967
|
+
// package.json
|
|
11968
|
+
var repository = {
|
|
11969
|
+
"type": "git",
|
|
11970
|
+
"url": "git+https://github.com/masseater/masseater.dev.git",
|
|
11971
|
+
"directory": "libs/msch"
|
|
11972
|
+
};
|
|
11973
|
+
// src/features/check-agent-settings/model/known-plugins.ts
|
|
11974
|
+
const RULE$25 = "known-plugins";
|
|
11975
|
+
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
11976
|
+
const FIRST$10 = 1;
|
|
11977
|
+
const GITHUB$2 = "github";
|
|
11978
|
+
const REPOSITORY = /github\.com\/(?<repository>[\w.-]+\/[\w.-]+?)(?:\.git)?$/u;
|
|
11979
|
+
const Source$1 = Schema.Struct({
|
|
11980
|
+
source: Schema.String,
|
|
11981
|
+
repo: Schema.optionalKey(Schema.String)
|
|
11982
|
+
});
|
|
11983
|
+
const KnownMarketplace = Schema.Struct({ source: Source$1 });
|
|
11984
|
+
const Marketplaces = Schema.Record(Schema.String, KnownMarketplace);
|
|
11985
|
+
const Plugins$1 = Schema.Record(Schema.String, Schema.Boolean);
|
|
11986
|
+
const SettingsSchema$1 = Schema.Struct({
|
|
11987
|
+
extraKnownMarketplaces: Schema.optionalKey(Marketplaces),
|
|
11988
|
+
enabledPlugins: Schema.optionalKey(Plugins$1)
|
|
11989
|
+
});
|
|
11990
|
+
const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
|
|
11991
|
+
const repositoryOf = (url) => pipe(String$1.match(REPOSITORY)(url), Option.flatMapNullishOr((found) => found.groups), Option.flatMap(Record.get("repository")), Option.getOrElse(() => url));
|
|
11992
|
+
const REPOSITORY_NAME = repositoryOf(repository.url);
|
|
11993
|
+
const MARKETPLACE = name;
|
|
11994
|
+
const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
|
|
11995
|
+
const problem$1 = (file, message) => ({
|
|
11996
|
+
file,
|
|
11997
|
+
line: FIRST$10,
|
|
11998
|
+
column: FIRST$10,
|
|
11999
|
+
rule: RULE$25,
|
|
12000
|
+
message
|
|
12001
|
+
});
|
|
12002
|
+
const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
|
|
12003
|
+
const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
|
|
12004
|
+
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
12005
|
+
const marketplaceProblems = (file, settings) => {
|
|
12006
|
+
if (marketplaceKnown(settings)) return [];
|
|
12007
|
+
return [problem$1(file, `Agents miss masseater's own tools when the ${MARKETPLACE} marketplace is not known. Add "extraKnownMarketplaces": { "${MARKETPLACE}": { "source": { "source": "${GITHUB$2}", "repo": "${REPOSITORY_NAME}" } } }.`)];
|
|
12008
|
+
};
|
|
12009
|
+
const pluginProblems = (file, settings) => {
|
|
12010
|
+
const enabled = pluginEnabled(settings);
|
|
12011
|
+
return pipe(PLUGINS, Array.filter((plugin) => !enabled(plugin)), Array.map((plugin) => problem$1(file, `Enable "${plugin}" in "enabledPlugins" so every session gets it.`)));
|
|
12012
|
+
};
|
|
12013
|
+
/** @internal */
|
|
12014
|
+
const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlugins(root) {
|
|
12015
|
+
const files = yield* RepositoryFiles;
|
|
12016
|
+
const file = files.join(root, SETTINGS_FILE$2);
|
|
12017
|
+
const text = yield* files.readFile(file);
|
|
12018
|
+
const settings = pipe(text, Option.flatMap(decodeSettings$1), Option.getOrElse(() => ({})));
|
|
12019
|
+
return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
|
|
12020
|
+
});
|
|
11950
12021
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
11951
|
-
const RULE$
|
|
12022
|
+
const RULE$24 = "missing-hook";
|
|
11952
12023
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
11953
12024
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
11954
12025
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
@@ -11973,7 +12044,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
11973
12044
|
return pipe(missing, Array.map(({ path, index }) => ({
|
|
11974
12045
|
file,
|
|
11975
12046
|
...positionOf(source)(index),
|
|
11976
|
-
rule: RULE$
|
|
12047
|
+
rule: RULE$24,
|
|
11977
12048
|
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.`
|
|
11978
12049
|
})));
|
|
11979
12050
|
});
|
|
@@ -12004,7 +12075,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
12004
12075
|
const taggedError$3 = Schema.TaggedError;
|
|
12005
12076
|
var SectionConfigUnreadable = class extends taggedError$3()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
12006
12077
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
12007
|
-
const FIRST$
|
|
12078
|
+
const FIRST$9 = 1;
|
|
12008
12079
|
const sectionAt = (file, pick) => Effect.gen(function* readSection() {
|
|
12009
12080
|
if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
|
|
12010
12081
|
const config = yield* Effect.tryPromise({
|
|
@@ -12015,8 +12086,8 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
|
|
|
12015
12086
|
});
|
|
12016
12087
|
const failureAt = (file, rule, message) => [{
|
|
12017
12088
|
file,
|
|
12018
|
-
line: FIRST$
|
|
12019
|
-
column: FIRST$
|
|
12089
|
+
line: FIRST$9,
|
|
12090
|
+
column: FIRST$9,
|
|
12020
12091
|
rule,
|
|
12021
12092
|
message
|
|
12022
12093
|
}];
|
|
@@ -12038,7 +12109,7 @@ const checkSection = (check) => (root) => Effect.gen(function* runSection() {
|
|
|
12038
12109
|
onSuccess: (found) => pipe(found, Array.filter(({ severity }) => severity === "error"), Array.map((diagnostic) => ({
|
|
12039
12110
|
file: files.join(root, diagnostic.path),
|
|
12040
12111
|
line: diagnostic.line,
|
|
12041
|
-
column: diagnostic.column ?? FIRST$
|
|
12112
|
+
column: diagnostic.column ?? FIRST$9,
|
|
12042
12113
|
rule: check.rule,
|
|
12043
12114
|
message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
|
|
12044
12115
|
})))
|
|
@@ -12059,8 +12130,8 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
|
|
|
12059
12130
|
const EXTENSION = /\.[^./]+$/u;
|
|
12060
12131
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
12061
12132
|
const READ_CONCURRENCY$9 = 64;
|
|
12062
|
-
const FIRST$
|
|
12063
|
-
const RULE$
|
|
12133
|
+
const FIRST$8 = 1;
|
|
12134
|
+
const RULE$23 = "shell-script";
|
|
12064
12135
|
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.";
|
|
12065
12136
|
const HookSchema = Schema.Struct({
|
|
12066
12137
|
command: Schema.optional(Schema.String),
|
|
@@ -12081,9 +12152,9 @@ const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.ge
|
|
|
12081
12152
|
const hasExtension = (name) => EXTENSION.test(baseName(name));
|
|
12082
12153
|
const problemFor$1 = (file) => ({
|
|
12083
12154
|
file,
|
|
12084
|
-
line: FIRST$
|
|
12085
|
-
column: FIRST$
|
|
12086
|
-
rule: RULE$
|
|
12155
|
+
line: FIRST$8,
|
|
12156
|
+
column: FIRST$8,
|
|
12157
|
+
rule: RULE$23,
|
|
12087
12158
|
message: MESSAGE$10
|
|
12088
12159
|
});
|
|
12089
12160
|
/** @internal */
|
|
@@ -12136,7 +12207,7 @@ const runScriptsOf = (source) => {
|
|
|
12136
12207
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
12137
12208
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
12138
12209
|
const COMMENT = "#";
|
|
12139
|
-
const RULE$
|
|
12210
|
+
const RULE$22 = "workflow-script";
|
|
12140
12211
|
const ONE_COMMAND = 1;
|
|
12141
12212
|
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.";
|
|
12142
12213
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
@@ -12150,7 +12221,7 @@ const problemsIn$8 = (file) => (source) => {
|
|
|
12150
12221
|
return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
|
|
12151
12222
|
file,
|
|
12152
12223
|
...at(start),
|
|
12153
|
-
rule: RULE$
|
|
12224
|
+
rule: RULE$22,
|
|
12154
12225
|
message: MESSAGE$9
|
|
12155
12226
|
})));
|
|
12156
12227
|
};
|
|
@@ -12281,7 +12352,7 @@ const AGENT_DOCS = [
|
|
|
12281
12352
|
];
|
|
12282
12353
|
const READ_CONCURRENCY$7 = 16;
|
|
12283
12354
|
const START$13 = 0;
|
|
12284
|
-
const FIRST$
|
|
12355
|
+
const FIRST$7 = 1;
|
|
12285
12356
|
const LINE = "\n";
|
|
12286
12357
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
12287
12358
|
const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
@@ -12312,8 +12383,8 @@ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE
|
|
|
12312
12383
|
kind: "hook",
|
|
12313
12384
|
file,
|
|
12314
12385
|
position: {
|
|
12315
|
-
line: index + FIRST$
|
|
12316
|
-
column: FIRST$
|
|
12386
|
+
line: index + FIRST$7,
|
|
12387
|
+
column: FIRST$7
|
|
12317
12388
|
},
|
|
12318
12389
|
name,
|
|
12319
12390
|
text
|
|
@@ -12386,7 +12457,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
12386
12457
|
return Array.flatten(found);
|
|
12387
12458
|
});
|
|
12388
12459
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
12389
|
-
const RULE$
|
|
12460
|
+
const RULE$21 = "package-script";
|
|
12390
12461
|
const LIFECYCLE = [
|
|
12391
12462
|
"preinstall",
|
|
12392
12463
|
"install",
|
|
@@ -12409,12 +12480,12 @@ const LIFECYCLE = [
|
|
|
12409
12480
|
const problemOf$3 = ({ file, position, name }) => ({
|
|
12410
12481
|
file,
|
|
12411
12482
|
...position,
|
|
12412
|
-
rule: RULE$
|
|
12483
|
+
rule: RULE$21,
|
|
12413
12484
|
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.`
|
|
12414
12485
|
});
|
|
12415
12486
|
const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
|
|
12416
12487
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
12417
|
-
const RULE$
|
|
12488
|
+
const RULE$20 = "vite-plus-block";
|
|
12418
12489
|
const MARKER = Array.join([
|
|
12419
12490
|
"<!--",
|
|
12420
12491
|
"VITE PLUS START",
|
|
@@ -12427,7 +12498,7 @@ const problemIn = (file) => (source) => {
|
|
|
12427
12498
|
return Option.some({
|
|
12428
12499
|
file,
|
|
12429
12500
|
...positionOf(source)(index.value),
|
|
12430
|
-
rule: RULE$
|
|
12501
|
+
rule: RULE$20,
|
|
12431
12502
|
message: MESSAGE$8
|
|
12432
12503
|
});
|
|
12433
12504
|
};
|
|
@@ -12483,7 +12554,7 @@ const checkFullHistoryCheckout = workflowCheck({
|
|
|
12483
12554
|
})
|
|
12484
12555
|
});
|
|
12485
12556
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
12486
|
-
const RULE$
|
|
12557
|
+
const RULE$18 = "publish-trigger";
|
|
12487
12558
|
const PUBLISH = /\bmsch-publish\b/u;
|
|
12488
12559
|
const MANUAL = "workflow_dispatch";
|
|
12489
12560
|
const TRIGGER_KEY = "on";
|
|
@@ -12503,18 +12574,18 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
12503
12574
|
};
|
|
12504
12575
|
/** @internal */
|
|
12505
12576
|
const checkPublishTrigger = workflowCheck({
|
|
12506
|
-
rule: RULE$
|
|
12577
|
+
rule: RULE$18,
|
|
12507
12578
|
message: MESSAGE$6,
|
|
12508
12579
|
offsetsOf: publishTriggerOffsetsOf
|
|
12509
12580
|
});
|
|
12510
12581
|
// src/features/check-workflows/model/release-please.ts
|
|
12511
|
-
const RULE$
|
|
12582
|
+
const RULE$17 = "release-please";
|
|
12512
12583
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
12513
12584
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
12514
|
-
const FIRST$
|
|
12585
|
+
const FIRST$6 = 1;
|
|
12515
12586
|
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.";
|
|
12516
12587
|
const checkReleasePleaseSteps = workflowCheck({
|
|
12517
|
-
rule: RULE$
|
|
12588
|
+
rule: RULE$17,
|
|
12518
12589
|
message: MESSAGE$5,
|
|
12519
12590
|
offsetsOf: scalarKeyOffsets({
|
|
12520
12591
|
name: "uses",
|
|
@@ -12526,9 +12597,9 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
12526
12597
|
const names = yield* files.listedFiles(root);
|
|
12527
12598
|
return pipe(names, Array.filter((name) => RELEASE_PLEASE_FILE.test(name)), Array.map((name) => ({
|
|
12528
12599
|
file: files.join(root, name),
|
|
12529
|
-
line: FIRST$
|
|
12530
|
-
column: FIRST$
|
|
12531
|
-
rule: RULE$
|
|
12600
|
+
line: FIRST$6,
|
|
12601
|
+
column: FIRST$6,
|
|
12602
|
+
rule: RULE$17,
|
|
12532
12603
|
message: MESSAGE$5
|
|
12533
12604
|
})));
|
|
12534
12605
|
});
|
|
@@ -12540,17 +12611,17 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
12540
12611
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
12541
12612
|
const CONCURRENCY_KEY = "concurrency";
|
|
12542
12613
|
const QUEUE_KEY = "queue";
|
|
12543
|
-
const RULE$
|
|
12614
|
+
const RULE$16 = "workflow-queue";
|
|
12544
12615
|
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.";
|
|
12545
12616
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
12546
12617
|
/** @internal */
|
|
12547
12618
|
const checkWorkflowQueues = workflowCheck({
|
|
12548
|
-
rule: RULE$
|
|
12619
|
+
rule: RULE$16,
|
|
12549
12620
|
message: MESSAGE$4,
|
|
12550
12621
|
offsetsOf: queueOffsetsOf
|
|
12551
12622
|
});
|
|
12552
12623
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
12553
|
-
const RULE$
|
|
12624
|
+
const RULE$15 = "workflow-commit";
|
|
12554
12625
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
12555
12626
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
12556
12627
|
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.";
|
|
@@ -12558,7 +12629,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
|
|
|
12558
12629
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
12559
12630
|
/** @internal */
|
|
12560
12631
|
const checkWorkflowCommits = workflowCheck({
|
|
12561
|
-
rule: RULE$
|
|
12632
|
+
rule: RULE$15,
|
|
12562
12633
|
message: MESSAGE$3,
|
|
12563
12634
|
offsetsOf: commitOffsetsOf
|
|
12564
12635
|
});
|
|
@@ -12577,6 +12648,7 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
12577
12648
|
const found = yield* Effect.all([
|
|
12578
12649
|
checkVitePlus(root),
|
|
12579
12650
|
checkMissingHooks(root),
|
|
12651
|
+
checkKnownPlugins(root),
|
|
12580
12652
|
checkScripts(root),
|
|
12581
12653
|
checkWorkflowQueues(root),
|
|
12582
12654
|
checkWorkflowCommits(root),
|
|
@@ -12752,7 +12824,7 @@ const commentsWith = (grammars) => (reader, source) => {
|
|
|
12752
12824
|
}[reader](source);
|
|
12753
12825
|
};
|
|
12754
12826
|
// src/features/ban-comments/model/comments.ts
|
|
12755
|
-
const RULE$
|
|
12827
|
+
const RULE$14 = "comment";
|
|
12756
12828
|
const CONFIG_FILE$1 = "vite.config.ts";
|
|
12757
12829
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
12758
12830
|
const READ_CONCURRENCY$6 = 64;
|
|
@@ -12822,14 +12894,14 @@ const isAllowed = (source, directives) => (comment) => isShebang(comment) || dir
|
|
|
12822
12894
|
const problemOf$2 = (file, source) => ({ index }) => ({
|
|
12823
12895
|
file,
|
|
12824
12896
|
...positionOf(source)(index),
|
|
12825
|
-
rule: RULE$
|
|
12897
|
+
rule: RULE$14,
|
|
12826
12898
|
message: MESSAGE$2
|
|
12827
12899
|
});
|
|
12828
12900
|
const unreadableProblem = (file, message) => ({
|
|
12829
12901
|
file,
|
|
12830
12902
|
line: FIRST_LINE$4,
|
|
12831
12903
|
column: FIRST_COLUMN$3,
|
|
12832
|
-
rule: RULE$
|
|
12904
|
+
rule: RULE$14,
|
|
12833
12905
|
message: `msch could not read the comments in this file: ${message}`
|
|
12834
12906
|
});
|
|
12835
12907
|
const settingsOf = ({ msch, lint }) => ({
|
|
@@ -13128,20 +13200,20 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
13128
13200
|
];
|
|
13129
13201
|
});
|
|
13130
13202
|
// src/features/check-skills/model/published-skills.ts
|
|
13131
|
-
const RULE$
|
|
13203
|
+
const RULE$13 = "published-skills";
|
|
13132
13204
|
const KEYWORD = "tanstack-intent";
|
|
13133
13205
|
const SKILLS = "skills";
|
|
13134
13206
|
const MANIFEST_FILE = "package.json";
|
|
13135
13207
|
const SKILL_FILE$1 = "SKILL.md";
|
|
13136
|
-
const FIRST$
|
|
13208
|
+
const FIRST$5 = 1;
|
|
13137
13209
|
const SUCCEEDED = 0;
|
|
13138
13210
|
const SYNC = "Run vp exec intent maintainer sync in the repository root.";
|
|
13139
13211
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
13140
13212
|
const problemAt$2 = (file, message) => ({
|
|
13141
13213
|
file,
|
|
13142
|
-
line: FIRST$
|
|
13143
|
-
column: FIRST$
|
|
13144
|
-
rule: RULE$
|
|
13214
|
+
line: FIRST$5,
|
|
13215
|
+
column: FIRST$5,
|
|
13216
|
+
rule: RULE$13,
|
|
13145
13217
|
message
|
|
13146
13218
|
});
|
|
13147
13219
|
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))));
|
|
@@ -13180,7 +13252,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
13180
13252
|
return Array.flatten(problems);
|
|
13181
13253
|
});
|
|
13182
13254
|
// src/features/check-skills/model/skill-files.ts
|
|
13183
|
-
const RULE$
|
|
13255
|
+
const RULE$12 = "skill-file";
|
|
13184
13256
|
const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
|
|
13185
13257
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
13186
13258
|
const MARKDOWN = ".md";
|
|
@@ -13198,7 +13270,7 @@ const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
|
13198
13270
|
const BLANK = /\s+/u;
|
|
13199
13271
|
const SEPARATOR$3 = "/";
|
|
13200
13272
|
const START$9 = 0;
|
|
13201
|
-
const FIRST$
|
|
13273
|
+
const FIRST$4 = 1;
|
|
13202
13274
|
const READ_CONCURRENCY$4 = 16;
|
|
13203
13275
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
13204
13276
|
const Frontmatter = Schema.Struct({
|
|
@@ -13237,7 +13309,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
13237
13309
|
]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
|
|
13238
13310
|
file: skill.file,
|
|
13239
13311
|
...positionOf(skill.source)(index),
|
|
13240
|
-
rule: RULE$
|
|
13312
|
+
rule: RULE$12,
|
|
13241
13313
|
message
|
|
13242
13314
|
})));
|
|
13243
13315
|
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) => ({
|
|
@@ -13264,7 +13336,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
13264
13336
|
return pipe(missing, Array.map(({ target, index }) => ({
|
|
13265
13337
|
file,
|
|
13266
13338
|
...positionOf(source)(index),
|
|
13267
|
-
rule: RULE$
|
|
13339
|
+
rule: RULE$12,
|
|
13268
13340
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
13269
13341
|
})));
|
|
13270
13342
|
});
|
|
@@ -13278,9 +13350,9 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
13278
13350
|
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$4 });
|
|
13279
13351
|
const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
|
|
13280
13352
|
file: files.join(root, entry),
|
|
13281
|
-
line: FIRST$
|
|
13282
|
-
column: FIRST$
|
|
13283
|
-
rule: RULE$
|
|
13353
|
+
line: FIRST$4,
|
|
13354
|
+
column: FIRST$4,
|
|
13355
|
+
rule: RULE$12,
|
|
13284
13356
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
13285
13357
|
})));
|
|
13286
13358
|
return [
|
|
@@ -13360,7 +13432,7 @@ const cargoEntries = (text) => {
|
|
|
13360
13432
|
};
|
|
13361
13433
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
13362
13434
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
13363
|
-
const RULE$
|
|
13435
|
+
const RULE$11 = "version-downgrade";
|
|
13364
13436
|
const DEFAULT_BASE = "origin/main";
|
|
13365
13437
|
const READ_CONCURRENCY$3 = 16;
|
|
13366
13438
|
const READERS = [
|
|
@@ -13386,7 +13458,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
13386
13458
|
file,
|
|
13387
13459
|
line: lineOf(text, entry),
|
|
13388
13460
|
column: FIRST_LINE$1,
|
|
13389
|
-
rule: RULE$
|
|
13461
|
+
rule: RULE$11,
|
|
13390
13462
|
message: message(old, entry)
|
|
13391
13463
|
})), Option.toArray)));
|
|
13392
13464
|
};
|
|
@@ -13468,14 +13540,14 @@ const START$7 = 0;
|
|
|
13468
13540
|
const HEX = 16;
|
|
13469
13541
|
const CODE_POINT_WIDTH = 4;
|
|
13470
13542
|
const READ_CONCURRENCY$1 = 64;
|
|
13471
|
-
const RULE$
|
|
13543
|
+
const RULE$10 = "hidden-unicode";
|
|
13472
13544
|
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"));
|
|
13473
13545
|
const problemOf$1 = (file, source) => (found) => {
|
|
13474
13546
|
const hex = hexOf(found[START$7]);
|
|
13475
13547
|
return {
|
|
13476
13548
|
file,
|
|
13477
13549
|
...positionOf(source)(found.index ?? START$7),
|
|
13478
|
-
rule: RULE$
|
|
13550
|
+
rule: RULE$10,
|
|
13479
13551
|
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}.`
|
|
13480
13552
|
};
|
|
13481
13553
|
};
|
|
@@ -13497,14 +13569,14 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
|
|
|
13497
13569
|
return Array.flatten(found);
|
|
13498
13570
|
});
|
|
13499
13571
|
// src/features/find-unneeded-files/model/alchemy-patch.ts
|
|
13500
|
-
const RULE$
|
|
13572
|
+
const RULE$9 = "alchemy-patch";
|
|
13501
13573
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
13502
13574
|
const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
|
|
13503
13575
|
const START$6 = 0;
|
|
13504
13576
|
const problemOf = (file, position, name) => ({
|
|
13505
13577
|
file,
|
|
13506
13578
|
...position,
|
|
13507
|
-
rule: RULE$
|
|
13579
|
+
rule: RULE$9,
|
|
13508
13580
|
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.`
|
|
13509
13581
|
});
|
|
13510
13582
|
const problemsIn$3 = (file, patched) => (source) => {
|
|
@@ -13524,7 +13596,7 @@ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyP
|
|
|
13524
13596
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
13525
13597
|
const MSCH = "@r_masseater/msch";
|
|
13526
13598
|
const SCOPE$1 = "@r_masseater/";
|
|
13527
|
-
const RULE$
|
|
13599
|
+
const RULE$8 = "applied-package";
|
|
13528
13600
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
13529
13601
|
const NOT_FOUND = -1;
|
|
13530
13602
|
const SEPARATOR$2 = "/";
|
|
@@ -13569,13 +13641,13 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
13569
13641
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
13570
13642
|
file,
|
|
13571
13643
|
...positionOf(source)(index),
|
|
13572
|
-
rule: RULE$
|
|
13644
|
+
rule: RULE$8,
|
|
13573
13645
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
13574
13646
|
});
|
|
13575
13647
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
13576
13648
|
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
13577
13649
|
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)))));
|
|
13578
|
-
const ownerOf = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array.match({
|
|
13650
|
+
const ownerOf$1 = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array.match({
|
|
13579
13651
|
onEmpty: () => "",
|
|
13580
13652
|
onNonEmpty: Array.max(BY_LENGTH)
|
|
13581
13653
|
}));
|
|
@@ -13598,7 +13670,7 @@ const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appl
|
|
|
13598
13670
|
}));
|
|
13599
13671
|
});
|
|
13600
13672
|
const sourceUses = Effect.fn("sourceUses")(function* sourceUses({ root, applied, directories, consumers }) {
|
|
13601
|
-
const owner = ownerOf(directories);
|
|
13673
|
+
const owner = ownerOf$1(directories);
|
|
13602
13674
|
const listed = yield* listedFiles(root);
|
|
13603
13675
|
const sources = pipe(listed, Array.filter((entry) => isScannedSource(entry) && Array.contains(consumers, owner(entry.name))));
|
|
13604
13676
|
return yield* scanText(sources, usesIn(applied));
|
|
@@ -13624,8 +13696,8 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
13624
13696
|
return yield* appliedPackageProblems(root, applied);
|
|
13625
13697
|
});
|
|
13626
13698
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
13627
|
-
const RULE$
|
|
13628
|
-
const FIRST$
|
|
13699
|
+
const RULE$7 = "replaced-tool";
|
|
13700
|
+
const FIRST$3 = 1;
|
|
13629
13701
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
13630
13702
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
13631
13703
|
const ALCHEMY = "the Alchemy stack in alchemy.run.ts";
|
|
@@ -13703,9 +13775,9 @@ const REPLACED = [
|
|
|
13703
13775
|
];
|
|
13704
13776
|
const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
|
|
13705
13777
|
file,
|
|
13706
|
-
line: FIRST$
|
|
13707
|
-
column: FIRST$
|
|
13708
|
-
rule: RULE$
|
|
13778
|
+
line: FIRST$3,
|
|
13779
|
+
column: FIRST$3,
|
|
13780
|
+
rule: RULE$7,
|
|
13709
13781
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
13710
13782
|
})));
|
|
13711
13783
|
/** @internal */
|
|
@@ -13840,7 +13912,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
13840
13912
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
13841
13913
|
});
|
|
13842
13914
|
// src/features/check-effect-diagnostics/model/effect-diagnostics.ts
|
|
13843
|
-
const RULE$
|
|
13915
|
+
const RULE$6 = "effect-diagnostics-once";
|
|
13844
13916
|
const PLUGIN = "@effect/language-service";
|
|
13845
13917
|
const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
|
|
13846
13918
|
const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
@@ -13858,7 +13930,7 @@ const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnost
|
|
|
13858
13930
|
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
13931
|
file: entry.file,
|
|
13860
13932
|
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$4))),
|
|
13861
|
-
rule: RULE$
|
|
13933
|
+
rule: RULE$6,
|
|
13862
13934
|
message: MESSAGE$1
|
|
13863
13935
|
})), Option.toArray);
|
|
13864
13936
|
/** @internal */
|
|
@@ -13871,7 +13943,7 @@ const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* che
|
|
|
13871
13943
|
}))), problemsIn$2);
|
|
13872
13944
|
});
|
|
13873
13945
|
// src/features/check-exact-versions/model/exact-versions.ts
|
|
13874
|
-
const RULE$
|
|
13946
|
+
const RULE$5 = "version-range";
|
|
13875
13947
|
const WORKSPACE_FILE = "pnpm-workspace.yaml";
|
|
13876
13948
|
const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
|
|
13877
13949
|
const PROTOCOL = /^[a-z+]+:/u;
|
|
@@ -13904,7 +13976,7 @@ const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec
|
|
|
13904
13976
|
const problemsFor = (file, source, pattern) => (found) => pipe(found, Array.filter(({ specifier }) => isRange(specifier)), Array.map((range) => ({
|
|
13905
13977
|
file,
|
|
13906
13978
|
...positionOf(source)(offsetIn(source)(pattern(range))),
|
|
13907
|
-
rule: RULE$
|
|
13979
|
+
rule: RULE$5,
|
|
13908
13980
|
message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE}`
|
|
13909
13981
|
})));
|
|
13910
13982
|
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted(name)}"\\s*:\\s*"${quoted(specifier)}"`, "u");
|
|
@@ -13934,7 +14006,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
|
|
|
13934
14006
|
return [...fromManifests, ...fromCatalogs];
|
|
13935
14007
|
});
|
|
13936
14008
|
// src/features/check-package-scope/model/package-scope.ts
|
|
13937
|
-
const RULE$
|
|
14009
|
+
const RULE$4 = "package-scope";
|
|
13938
14010
|
const SCOPE = "@r_masseater/";
|
|
13939
14011
|
const NAME_KEY = "\"name\"";
|
|
13940
14012
|
const START$2 = 0;
|
|
@@ -13950,7 +14022,7 @@ const unscopedName = (manifest) => pipe(Option.fromUndefinedOr(manifest.name), O
|
|
|
13950
14022
|
const problemsIn$1 = (entry, source) => pipe(decodeManifest$2(source), Option.filter(isPublished$1), Option.flatMap(unscopedName), Option.map((name) => ({
|
|
13951
14023
|
file: entry.file,
|
|
13952
14024
|
...positionOf(source)(pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$2))),
|
|
13953
|
-
rule: RULE$
|
|
14025
|
+
rule: RULE$4,
|
|
13954
14026
|
message: `Packages are published only under the ${SCOPE} scope. Rename "${name}" to "${SCOPE}${String$1.replace(/^@[^/]+\//u, "")(name)}".`
|
|
13955
14027
|
})), Option.toArray);
|
|
13956
14028
|
/** @internal */
|
|
@@ -13962,8 +14034,108 @@ const checkPackageScope = Effect.fn("checkPackageScope")(function* checkPackageS
|
|
|
13962
14034
|
file: files.join(root, name)
|
|
13963
14035
|
}))), problemsIn$1);
|
|
13964
14036
|
});
|
|
14037
|
+
// src/features/check-plugin-marketplace/model/plugin-marketplace.ts
|
|
14038
|
+
const RULE$3 = "plugin-marketplace";
|
|
14039
|
+
const PLUGIN_DIRECTORY = ".claude-plugin";
|
|
14040
|
+
const PLUGIN_FILE = `${PLUGIN_DIRECTORY}/plugin.json`;
|
|
14041
|
+
const MARKETPLACE_FILE = `${PLUGIN_DIRECTORY}/marketplace.json`;
|
|
14042
|
+
const FIRST$2 = 1;
|
|
14043
|
+
const INDENT = 2;
|
|
14044
|
+
const OwnerSchema = Schema.Struct({
|
|
14045
|
+
name: Schema.String,
|
|
14046
|
+
url: Schema.optionalKey(Schema.String)
|
|
14047
|
+
});
|
|
14048
|
+
const Person = Schema.Union([Schema.String, OwnerSchema]);
|
|
14049
|
+
const RootManifest = Schema.fromJsonString(Schema.Struct({
|
|
14050
|
+
name: Schema.String,
|
|
14051
|
+
author: Schema.optionalKey(Person)
|
|
14052
|
+
}));
|
|
14053
|
+
const PluginManifest = Schema.fromJsonString(Schema.Struct({ name: Schema.String }));
|
|
14054
|
+
const NpmSource = Schema.Struct({
|
|
14055
|
+
source: Schema.Literal("npm"),
|
|
14056
|
+
package: Schema.String
|
|
14057
|
+
});
|
|
14058
|
+
const PluginSchema = Schema.Struct({
|
|
14059
|
+
name: Schema.String,
|
|
14060
|
+
source: Schema.Union([Schema.String, NpmSource]),
|
|
14061
|
+
description: Schema.String
|
|
14062
|
+
});
|
|
14063
|
+
const Marketplace = Schema.fromJsonString(Schema.Struct({
|
|
14064
|
+
name: Schema.String,
|
|
14065
|
+
owner: OwnerSchema,
|
|
14066
|
+
plugins: Schema.Array(PluginSchema)
|
|
14067
|
+
}), { space: INDENT });
|
|
14068
|
+
const decodeRoot = Schema.decodeUnknownOption(RootManifest);
|
|
14069
|
+
const decodePlugin = Schema.decodeUnknownOption(PluginManifest);
|
|
14070
|
+
const encodeMarketplace = Schema.encodeEffect(Marketplace);
|
|
14071
|
+
const marketplaceName = (packageName) => pipe(String$1.toLowerCase(packageName), String$1.replace(/^@/u, ""), String$1.replaceAll(/[^a-z0-9]+/gu, "-"), String$1.replaceAll(/^-+|-+$/gu, ""));
|
|
14072
|
+
const ownerOf = (author) => {
|
|
14073
|
+
if (Predicate.isString(author)) return { name: author };
|
|
14074
|
+
return author;
|
|
14075
|
+
};
|
|
14076
|
+
const sourceOf = (project) => pipe(project.packageName, Option.filter(() => project.published), Option.match({
|
|
14077
|
+
onNone: () => `./${project.directory}`,
|
|
14078
|
+
onSome: (name) => ({
|
|
14079
|
+
source: "npm",
|
|
14080
|
+
package: name
|
|
14081
|
+
})
|
|
14082
|
+
}));
|
|
14083
|
+
const pluginIn = Effect.fn("pluginIn")(function* pluginIn(root, project) {
|
|
14084
|
+
const files = yield* RepositoryFiles;
|
|
14085
|
+
const text = yield* files.readFile(files.join(root, project.directory, PLUGIN_FILE));
|
|
14086
|
+
return pipe(text, Option.flatMap(decodePlugin), Option.map(({ name }) => ({
|
|
14087
|
+
name,
|
|
14088
|
+
source: sourceOf(project),
|
|
14089
|
+
description: Option.getOrElse(project.description, () => "")
|
|
14090
|
+
})));
|
|
14091
|
+
});
|
|
14092
|
+
const problem = (file, message) => ({
|
|
14093
|
+
file,
|
|
14094
|
+
line: FIRST$2,
|
|
14095
|
+
column: FIRST$2,
|
|
14096
|
+
rule: RULE$3,
|
|
14097
|
+
message
|
|
14098
|
+
});
|
|
14099
|
+
const pluginsIn = Effect.fn("pluginsIn")(function* pluginsIn(root) {
|
|
14100
|
+
const projects = yield* workspaceProjects(root);
|
|
14101
|
+
const found = yield* Effect.forEach(projects, (project) => pluginIn(root, project), { concurrency: "unbounded" });
|
|
14102
|
+
return Array.getSomes(found);
|
|
14103
|
+
});
|
|
14104
|
+
const ownerIn = Effect.fn("ownerIn")(function* ownerIn(root) {
|
|
14105
|
+
const files = yield* RepositoryFiles;
|
|
14106
|
+
const text = yield* files.readFile(files.join(root, MANIFEST_FILE$3));
|
|
14107
|
+
return pipe(text, Option.flatMap(decodeRoot), Option.flatMap(({ name, author }) => pipe(Option.fromUndefinedOr(author), Option.map((found) => ({
|
|
14108
|
+
name: marketplaceName(name),
|
|
14109
|
+
owner: ownerOf(found)
|
|
14110
|
+
})))));
|
|
14111
|
+
});
|
|
14112
|
+
const rewrite = Effect.fn("rewrite")(function* rewrite(file, expected) {
|
|
14113
|
+
const files = yield* RepositoryFiles;
|
|
14114
|
+
const written = yield* files.readFile(file);
|
|
14115
|
+
if (Option.exists(written, (text) => text === expected)) return [];
|
|
14116
|
+
yield* files.writeFile(file, expected);
|
|
14117
|
+
return [problem(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE}. msch rewrote it; commit the result.`)];
|
|
14118
|
+
});
|
|
14119
|
+
const withoutPlugins = Effect.fn("withoutPlugins")(function* withoutPlugins(file) {
|
|
14120
|
+
if (!(yield* (yield* RepositoryFiles).exists(file))) return [];
|
|
14121
|
+
return [problem(file, `No workspace has ${PLUGIN_FILE}. Delete ${MARKETPLACE_FILE}.`)];
|
|
14122
|
+
});
|
|
14123
|
+
/** @internal */
|
|
14124
|
+
const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* checkPluginMarketplace(root) {
|
|
14125
|
+
const files = yield* RepositoryFiles;
|
|
14126
|
+
const file = files.join(root, MARKETPLACE_FILE);
|
|
14127
|
+
const plugins = yield* pluginsIn(root);
|
|
14128
|
+
if (!Array.isReadonlyArrayNonEmpty(plugins)) return yield* withoutPlugins(file);
|
|
14129
|
+
const header = yield* ownerIn(root);
|
|
14130
|
+
if (Option.isNone(header)) return [problem(files.join(root, MANIFEST_FILE$3), `Workspaces ship Claude Code plugins, so ${MARKETPLACE_FILE} lists them. Add "author" to the root ${MANIFEST_FILE$3}; it becomes the marketplace owner.`)];
|
|
14131
|
+
const text = yield* encodeMarketplace({
|
|
14132
|
+
...header.value,
|
|
14133
|
+
plugins
|
|
14134
|
+
});
|
|
14135
|
+
return yield* rewrite(file, `${text}\n`);
|
|
14136
|
+
});
|
|
13965
14137
|
// src/features/check-runtime-version/model/node-version.ts
|
|
13966
|
-
const RULE$
|
|
14138
|
+
const RULE$2 = "node-version";
|
|
13967
14139
|
const MINIMUM = 26;
|
|
13968
14140
|
const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
|
|
13969
14141
|
const MANIFEST = /(?:^|\/)package\.json$/u;
|
|
@@ -13997,7 +14169,7 @@ const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some
|
|
|
13997
14169
|
const problemAt = ({ entry, source, index }, message) => ({
|
|
13998
14170
|
file: entry.file,
|
|
13999
14171
|
...positionOf(source)(index),
|
|
14000
|
-
rule: RULE$
|
|
14172
|
+
rule: RULE$2,
|
|
14001
14173
|
message
|
|
14002
14174
|
});
|
|
14003
14175
|
const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$1));
|
|
@@ -14050,13 +14222,13 @@ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersio
|
|
|
14050
14222
|
return yield* scanText(sources, problemsIn);
|
|
14051
14223
|
});
|
|
14052
14224
|
// src/features/check-unused-workspaces/model/unused-workspaces.ts
|
|
14053
|
-
const RULE = "unused-workspace";
|
|
14225
|
+
const RULE$1 = "unused-workspace";
|
|
14054
14226
|
const CARGO_FILE = "Cargo.toml";
|
|
14055
14227
|
const ROOT_DIRECTORY = "";
|
|
14056
14228
|
const TASK_SEPARATOR = "#";
|
|
14057
14229
|
const SEPARATOR = "/";
|
|
14058
14230
|
const START = 0;
|
|
14059
|
-
const FIRST = 1;
|
|
14231
|
+
const FIRST$1 = 1;
|
|
14060
14232
|
const READ_CONCURRENCY = 8;
|
|
14061
14233
|
const LIBRARY_KINDS = [
|
|
14062
14234
|
"lib",
|
|
@@ -14154,11 +14326,26 @@ const checkUnusedWorkspaces = Effect.fn("checkUnusedWorkspaces")(function* check
|
|
|
14154
14326
|
...tasks
|
|
14155
14327
|
];
|
|
14156
14328
|
return pipe(members, Array.filter(({ library, entry }) => library && !entry), Array.filter((member) => !isDependedOn(links)(member)), Array.map(({ directory }) => ({
|
|
14329
|
+
file: files.join(root, directory, MANIFEST_FILE$3),
|
|
14330
|
+
line: FIRST$1,
|
|
14331
|
+
column: FIRST$1,
|
|
14332
|
+
rule: RULE$1,
|
|
14333
|
+
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.`
|
|
14334
|
+
})));
|
|
14335
|
+
});
|
|
14336
|
+
// src/features/check-workspace-descriptions/model/workspace-descriptions.ts
|
|
14337
|
+
const RULE = "workspace-description";
|
|
14338
|
+
const FIRST = 1;
|
|
14339
|
+
/** @internal */
|
|
14340
|
+
const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(function* checkWorkspaceDescriptions(root) {
|
|
14341
|
+
const files = yield* RepositoryFiles;
|
|
14342
|
+
const projects = yield* workspaceProjects(root);
|
|
14343
|
+
return pipe(projects, Array.filter(({ description }) => Option.isNone(description)), Array.map(({ directory }) => ({
|
|
14157
14344
|
file: files.join(root, directory, MANIFEST_FILE$3),
|
|
14158
14345
|
line: FIRST,
|
|
14159
14346
|
column: FIRST,
|
|
14160
14347
|
rule: RULE,
|
|
14161
|
-
message:
|
|
14348
|
+
message: "Add a one-line \"description\" that says what this workspace is for. Agents find existing tools by these descriptions, so a workspace without one is invisible to them."
|
|
14162
14349
|
})));
|
|
14163
14350
|
});
|
|
14164
14351
|
// src/app/manifest-checks.ts
|
|
@@ -14171,7 +14358,9 @@ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root
|
|
|
14171
14358
|
checkExactVersions(root),
|
|
14172
14359
|
checkUpstreamExits(root),
|
|
14173
14360
|
checkScatteredDeviations(root),
|
|
14174
|
-
checkEffectDiagnostics(root)
|
|
14361
|
+
checkEffectDiagnostics(root),
|
|
14362
|
+
checkWorkspaceDescriptions(root),
|
|
14363
|
+
checkPluginMarketplace(root)
|
|
14175
14364
|
], { concurrency: "unbounded" });
|
|
14176
14365
|
return Array.flatten(found);
|
|
14177
14366
|
});
|