@r_masseater/msch 0.48.1 → 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/cli.mjs +186 -114
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -2
package/dist/cli.mjs
CHANGED
|
@@ -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,9 +566,9 @@ 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);
|
|
@@ -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,19 +862,19 @@ 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({
|
|
@@ -899,7 +899,7 @@ 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));
|
|
902
|
+
const text = yield* files.readFile(files.join(root, MARKETPLACE$1));
|
|
903
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);
|
|
@@ -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;
|
|
@@ -981,7 +981,7 @@ 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);
|
|
@@ -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,8 +1052,8 @@ 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
|
});
|
|
@@ -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
|
});
|
|
@@ -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,6 +11947,77 @@ 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
12022
|
const RULE$24 = "missing-hook";
|
|
11952
12023
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
@@ -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),
|