@r_masseater/msch 0.69.0 → 0.70.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 +333 -285
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +7 -2
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-DpGK82kj.mjs → define-lint-preset-TN74hRYq.mjs} +7 -2
- package/dist/define-lint-preset-TN74hRYq.mjs.map +1 -0
- package/dist/{index-lKj9OQdX.d.mts → index-BvxWopv8.d.mts} +3 -2
- package/dist/lint.d.mts +2 -2
- package/dist/lint.mjs +1 -1
- package/package.json +4 -3
- package/dist/define-lint-preset-DpGK82kj.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-1ex
|
|
|
15
15
|
import "./cli-contract-D7btWrEu.mjs";
|
|
16
16
|
import { builtinModules } from "node:module";
|
|
17
17
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
18
|
-
import { Array, Boolean as Boolean$1, Context, Effect, FileSystem, HashMap, HashSet, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
18
|
+
import { Array, Boolean as Boolean$1, Context, Effect, FileSystem, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
19
19
|
import { updateWorkspaceManifest } from "@pnpm/workspace.workspace-manifest-writer";
|
|
20
20
|
import { ChildProcess } from "effect/process";
|
|
21
21
|
import { parse, resolveConfigFromFile } from "vite-plus";
|
|
@@ -527,70 +527,70 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
|
|
|
527
527
|
// src/features/check-overrides/model/git-subpath.ts
|
|
528
528
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
529
529
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
530
|
-
const RULE$
|
|
530
|
+
const RULE$67 = "git-subpath-dependency";
|
|
531
531
|
const WHOLE_MATCH$4 = 0;
|
|
532
532
|
const problemAt$6 = ({ file }, source) => (found) => ({
|
|
533
533
|
file,
|
|
534
534
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
535
|
-
rule: RULE$
|
|
535
|
+
rule: RULE$67,
|
|
536
536
|
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$4])}\`.`
|
|
537
537
|
});
|
|
538
|
-
const problemsIn$
|
|
538
|
+
const problemsIn$23 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$6(entry, source)));
|
|
539
539
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
540
540
|
/** @internal */
|
|
541
541
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
542
542
|
const listed = yield* listedFiles(root);
|
|
543
|
-
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$
|
|
543
|
+
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$23);
|
|
544
544
|
});
|
|
545
545
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
546
|
-
const RULE$
|
|
546
|
+
const RULE$66 = "unnamed-restriction";
|
|
547
547
|
const WHOLE_MATCH$3 = 0;
|
|
548
548
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
549
|
-
const problemsIn$
|
|
549
|
+
const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
|
|
550
550
|
file: entry.file,
|
|
551
551
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
552
|
-
rule: RULE$
|
|
552
|
+
rule: RULE$66,
|
|
553
553
|
message: `${found[WHOLE_MATCH$3]} 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.`
|
|
554
554
|
})));
|
|
555
555
|
/** @internal */
|
|
556
556
|
const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
|
|
557
557
|
const listed = yield* listedFiles(root);
|
|
558
|
-
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$
|
|
558
|
+
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$22);
|
|
559
559
|
});
|
|
560
560
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
561
|
-
const RULE$
|
|
561
|
+
const RULE$65 = "named-type-exemption";
|
|
562
562
|
const WHOLE_MATCH$2 = 0;
|
|
563
563
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
564
|
-
const problemsIn$
|
|
564
|
+
const problemsIn$21 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array.map((found) => ({
|
|
565
565
|
file: entry.file,
|
|
566
566
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
567
|
-
rule: RULE$
|
|
567
|
+
rule: RULE$65,
|
|
568
568
|
message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
|
|
569
569
|
})));
|
|
570
570
|
/** @internal */
|
|
571
571
|
const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
|
|
572
572
|
const listed = yield* listedFiles(root);
|
|
573
|
-
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$
|
|
573
|
+
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$21);
|
|
574
574
|
});
|
|
575
575
|
// src/features/check-overrides/model/package-registry.ts
|
|
576
|
-
const RULE$
|
|
576
|
+
const RULE$64 = "package-registry";
|
|
577
577
|
const REGISTRY = "https://npm.flatt.tech/";
|
|
578
578
|
const TRAILING_SLASH = /\/$/u;
|
|
579
579
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
580
580
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
581
581
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
582
582
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
583
|
-
const START$
|
|
583
|
+
const START$26 = 0;
|
|
584
584
|
const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
585
585
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
586
586
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
587
587
|
const withoutSlash = String$1.replace(TRAILING_SLASH, "");
|
|
588
588
|
const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
|
|
589
|
-
const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
589
|
+
const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$26));
|
|
590
590
|
const workspaceProblem = (file, source, registry) => ({
|
|
591
591
|
file,
|
|
592
592
|
...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
|
|
593
|
-
rule: RULE$
|
|
593
|
+
rule: RULE$64,
|
|
594
594
|
message: Option.match(registry, {
|
|
595
595
|
onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
|
|
596
596
|
onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
|
|
@@ -598,9 +598,9 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
598
598
|
});
|
|
599
599
|
const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf("value")(found), isGuarded)), Array.map((found) => ({
|
|
600
600
|
file: entry.file,
|
|
601
|
-
...positionOf(source)(found.index ?? START$
|
|
602
|
-
rule: RULE$
|
|
603
|
-
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$
|
|
601
|
+
...positionOf(source)(found.index ?? START$26),
|
|
602
|
+
rule: RULE$64,
|
|
603
|
+
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$26])}\`. Remove the line.`
|
|
604
604
|
})));
|
|
605
605
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
606
606
|
const files = yield* RepositoryFiles;
|
|
@@ -646,7 +646,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
646
646
|
})), Option.getOrElse(() => [])));
|
|
647
647
|
});
|
|
648
648
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
649
|
-
const RULE$
|
|
649
|
+
const RULE$63 = "colocated-git-patterns";
|
|
650
650
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
651
651
|
const ROOT$3 = ".";
|
|
652
652
|
const NEGATION$1 = "!";
|
|
@@ -693,7 +693,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
693
693
|
const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
|
|
694
694
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array.map(toEntry), Array.getSomes);
|
|
695
695
|
});
|
|
696
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
696
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$63)(entry.file, {
|
|
697
697
|
line: entry.line,
|
|
698
698
|
column: FIRST$22
|
|
699
699
|
}, message);
|
|
@@ -756,7 +756,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
756
756
|
return Array.getSomes([...misplacedFound, ...repeatedFound]);
|
|
757
757
|
});
|
|
758
758
|
// src/features/check-placement/model/colocated-tests.ts
|
|
759
|
-
const RULE$
|
|
759
|
+
const RULE$62 = "colocated-test";
|
|
760
760
|
const FIRST$21 = 1;
|
|
761
761
|
const READ_CONCURRENCY$33 = 64;
|
|
762
762
|
const ROOT_SUBPATH = ".";
|
|
@@ -784,7 +784,7 @@ const problemFor$9 = (test, message) => ({
|
|
|
784
784
|
file: test.file,
|
|
785
785
|
line: FIRST$21,
|
|
786
786
|
column: FIRST$21,
|
|
787
|
-
rule: RULE$
|
|
787
|
+
rule: RULE$62,
|
|
788
788
|
message: `${test.base} ${message}`
|
|
789
789
|
});
|
|
790
790
|
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);
|
|
@@ -867,7 +867,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
867
867
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
868
868
|
const RECOMMENDED_LINES = 200;
|
|
869
869
|
const FIRST$20 = 1;
|
|
870
|
-
const RULE$
|
|
870
|
+
const RULE$61 = "agent-docs-length";
|
|
871
871
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
872
872
|
const problemFor$8 = (file) => (lines) => {
|
|
873
873
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -875,19 +875,19 @@ const problemFor$8 = (file) => (lines) => {
|
|
|
875
875
|
file,
|
|
876
876
|
line: 201,
|
|
877
877
|
column: FIRST$20,
|
|
878
|
-
rule: RULE$
|
|
878
|
+
rule: RULE$61,
|
|
879
879
|
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.`
|
|
880
880
|
});
|
|
881
881
|
};
|
|
882
882
|
/** @internal */
|
|
883
883
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
|
|
884
884
|
// src/features/check-placement/model/claude-link.ts
|
|
885
|
-
const RULE$
|
|
885
|
+
const RULE$60 = "claude-md-link";
|
|
886
886
|
const CLAUDE = "CLAUDE.md";
|
|
887
887
|
const AGENTS = "AGENTS.md";
|
|
888
888
|
const FIRST$19 = 1;
|
|
889
889
|
const READ_CONCURRENCY$31 = 16;
|
|
890
|
-
const MESSAGE$
|
|
890
|
+
const MESSAGE$18 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
891
891
|
/** @internal */
|
|
892
892
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
893
893
|
const files = yield* RepositoryFiles;
|
|
@@ -901,8 +901,8 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
901
901
|
file: path,
|
|
902
902
|
line: FIRST$19,
|
|
903
903
|
column: FIRST$19,
|
|
904
|
-
rule: RULE$
|
|
905
|
-
message: MESSAGE$
|
|
904
|
+
rule: RULE$60,
|
|
905
|
+
message: MESSAGE$18
|
|
906
906
|
})));
|
|
907
907
|
});
|
|
908
908
|
const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
|
|
@@ -910,7 +910,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
910
910
|
return Array.getSomes(found);
|
|
911
911
|
});
|
|
912
912
|
// src/features/check-placement/model/dangling-links.ts
|
|
913
|
-
const RULE$
|
|
913
|
+
const RULE$59 = "dangling-link";
|
|
914
914
|
const SEPARATOR$21 = "/";
|
|
915
915
|
const FIRST$18 = 1;
|
|
916
916
|
const READ_CONCURRENCY$30 = 16;
|
|
@@ -926,7 +926,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
926
926
|
file,
|
|
927
927
|
line: FIRST$18,
|
|
928
928
|
column: FIRST$18,
|
|
929
|
-
rule: RULE$
|
|
929
|
+
rule: RULE$59,
|
|
930
930
|
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.`
|
|
931
931
|
})));
|
|
932
932
|
});
|
|
@@ -984,7 +984,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
984
984
|
}));
|
|
985
985
|
});
|
|
986
986
|
// src/features/check-placement/model/deployed-readme.ts
|
|
987
|
-
const RULE$
|
|
987
|
+
const RULE$58 = "deployed-readme";
|
|
988
988
|
const ROOT_DIRECTORY$4 = "";
|
|
989
989
|
const READ_CONCURRENCY$29 = 16;
|
|
990
990
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
@@ -1024,14 +1024,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
1024
1024
|
const readme = yield* readReadme({
|
|
1025
1025
|
root,
|
|
1026
1026
|
directory,
|
|
1027
|
-
rule: RULE$
|
|
1027
|
+
rule: RULE$58,
|
|
1028
1028
|
missingMessage: MISSING_MESSAGE$2
|
|
1029
1029
|
});
|
|
1030
1030
|
return Result.match(readme, {
|
|
1031
1031
|
onFailure: Option.some,
|
|
1032
1032
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
1033
1033
|
file,
|
|
1034
|
-
rule: RULE$
|
|
1034
|
+
rule: RULE$58,
|
|
1035
1035
|
message: NO_URL_MESSAGE
|
|
1036
1036
|
})))
|
|
1037
1037
|
});
|
|
@@ -1048,7 +1048,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
1048
1048
|
return Array.getSomes(found);
|
|
1049
1049
|
});
|
|
1050
1050
|
// src/features/check-placement/model/nested-docs.ts
|
|
1051
|
-
const RULE$
|
|
1051
|
+
const RULE$57 = "nested-docs";
|
|
1052
1052
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
1053
1053
|
const SEPARATOR$19 = "/";
|
|
1054
1054
|
const READ_CONCURRENCY$28 = 64;
|
|
@@ -1061,7 +1061,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
1061
1061
|
const taggedError$6 = Schema.TaggedError;
|
|
1062
1062
|
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
1063
1063
|
const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
|
|
1064
|
-
const problemFor$7 = problemInFile(RULE$
|
|
1064
|
+
const problemFor$7 = problemInFile(RULE$57);
|
|
1065
1065
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
1066
1066
|
const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
|
|
1067
1067
|
const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
|
|
@@ -1118,15 +1118,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
1118
1118
|
return [...Array.getSomes(found), ...missing];
|
|
1119
1119
|
});
|
|
1120
1120
|
// src/features/check-placement/model/published-readme.ts
|
|
1121
|
-
const RULE$
|
|
1121
|
+
const RULE$56 = "published-readme";
|
|
1122
1122
|
const READ_CONCURRENCY$27 = 16;
|
|
1123
|
-
const MESSAGE$
|
|
1123
|
+
const MESSAGE$17 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
1124
1124
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
1125
1125
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
1126
1126
|
const readme = yield* readReadme({
|
|
1127
1127
|
root,
|
|
1128
1128
|
directory,
|
|
1129
|
-
rule: RULE$
|
|
1129
|
+
rule: RULE$56,
|
|
1130
1130
|
missingMessage: MISSING_MESSAGE
|
|
1131
1131
|
});
|
|
1132
1132
|
return Result.match(readme, {
|
|
@@ -1137,8 +1137,8 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
1137
1137
|
file,
|
|
1138
1138
|
line,
|
|
1139
1139
|
column,
|
|
1140
|
-
rule: RULE$
|
|
1141
|
-
message: MESSAGE$
|
|
1140
|
+
rule: RULE$56,
|
|
1141
|
+
message: MESSAGE$17
|
|
1142
1142
|
};
|
|
1143
1143
|
}))
|
|
1144
1144
|
});
|
|
@@ -1150,11 +1150,11 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
1150
1150
|
return Array.getSomes(found);
|
|
1151
1151
|
});
|
|
1152
1152
|
// src/features/check-placement/model/published-tests.ts
|
|
1153
|
-
const RULE$
|
|
1153
|
+
const RULE$55 = "published-tests";
|
|
1154
1154
|
const MANIFEST_FILE$2 = "package.json";
|
|
1155
1155
|
const FILE_START = 1;
|
|
1156
1156
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
1157
|
-
const MESSAGE$
|
|
1157
|
+
const MESSAGE$16 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
1158
1158
|
const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
|
|
1159
1159
|
const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
|
|
1160
1160
|
const files = yield* RepositoryFiles;
|
|
@@ -1165,8 +1165,8 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
1165
1165
|
file: files.join(absolute, MANIFEST_FILE$2),
|
|
1166
1166
|
line: FILE_START,
|
|
1167
1167
|
column: FILE_START,
|
|
1168
|
-
rule: RULE$
|
|
1169
|
-
message: MESSAGE$
|
|
1168
|
+
rule: RULE$55,
|
|
1169
|
+
message: MESSAGE$16
|
|
1170
1170
|
});
|
|
1171
1171
|
});
|
|
1172
1172
|
/** @internal */
|
|
@@ -1179,13 +1179,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
1179
1179
|
return Array.getSomes(found);
|
|
1180
1180
|
});
|
|
1181
1181
|
// src/features/check-placement/model/root-docs.ts
|
|
1182
|
-
const RULE$
|
|
1182
|
+
const RULE$54 = "root-docs";
|
|
1183
1183
|
const SEPARATOR$18 = "/";
|
|
1184
1184
|
const FIRST$16 = 1;
|
|
1185
|
-
const MARKDOWN$
|
|
1185
|
+
const MARKDOWN$2 = /\.(?:md|mdx|markdown)$/iu;
|
|
1186
1186
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
1187
|
-
const MESSAGE$
|
|
1188
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$
|
|
1187
|
+
const MESSAGE$15 = "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.";
|
|
1188
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$2.test(name) && !ALLOWED.test(name);
|
|
1189
1189
|
/** @internal */
|
|
1190
1190
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
1191
1191
|
const files = yield* RepositoryFiles;
|
|
@@ -1194,15 +1194,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
1194
1194
|
file: files.join(root, name),
|
|
1195
1195
|
line: FIRST$16,
|
|
1196
1196
|
column: FIRST$16,
|
|
1197
|
-
rule: RULE$
|
|
1198
|
-
message: `${name} ${MESSAGE$
|
|
1197
|
+
rule: RULE$54,
|
|
1198
|
+
message: `${name} ${MESSAGE$15}`
|
|
1199
1199
|
})));
|
|
1200
1200
|
});
|
|
1201
1201
|
// src/features/check-placement/model/root-readme.ts
|
|
1202
|
-
const RULE$
|
|
1202
|
+
const RULE$53 = "root-readme";
|
|
1203
1203
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
1204
1204
|
const READ_CONCURRENCY$26 = 16;
|
|
1205
|
-
const START$
|
|
1205
|
+
const START$25 = 0;
|
|
1206
1206
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
1207
1207
|
const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
|
|
1208
1208
|
const RELATIVE$2 = /^\.\//u;
|
|
@@ -1239,17 +1239,17 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
|
|
|
1239
1239
|
onNone: () => ownNames(plugins, names),
|
|
1240
1240
|
onSome: () => [directory]
|
|
1241
1241
|
}));
|
|
1242
|
-
const problemsIn$
|
|
1242
|
+
const problemsIn$20 = (file, source, plugins) => (workspace) => {
|
|
1243
1243
|
const message = messageFor$1(workspace.directory);
|
|
1244
1244
|
const at = positionOf(source);
|
|
1245
1245
|
const pattern = patternFor(plugins)(workspace);
|
|
1246
|
-
return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$
|
|
1246
|
+
return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$53)(file, at(found.index ?? START$25), message)));
|
|
1247
1247
|
};
|
|
1248
1248
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
1249
1249
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
1250
1250
|
return pipe(text, Option.match({
|
|
1251
1251
|
onNone: () => [],
|
|
1252
|
-
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$
|
|
1252
|
+
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$20(file, source, plugins)))
|
|
1253
1253
|
}));
|
|
1254
1254
|
});
|
|
1255
1255
|
/** @internal */
|
|
@@ -1280,7 +1280,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
1280
1280
|
return Array.flatten(found);
|
|
1281
1281
|
});
|
|
1282
1282
|
// src/features/check-placement/model/docs-mirror.ts
|
|
1283
|
-
const RULE$
|
|
1283
|
+
const RULE$52 = "docs-mirror";
|
|
1284
1284
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
1285
1285
|
const MIRROR_LIMIT = 3;
|
|
1286
1286
|
const READ_CONCURRENCY$25 = 16;
|
|
@@ -1305,7 +1305,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array.head(mentions), Opti
|
|
|
1305
1305
|
file,
|
|
1306
1306
|
line,
|
|
1307
1307
|
column,
|
|
1308
|
-
rule: RULE$
|
|
1308
|
+
rule: RULE$52,
|
|
1309
1309
|
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.`
|
|
1310
1310
|
};
|
|
1311
1311
|
}), Option.toArray);
|
|
@@ -1337,10 +1337,10 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
1337
1337
|
return Array.flatten(found);
|
|
1338
1338
|
});
|
|
1339
1339
|
// src/features/check-placement/model/ignored-sources.ts
|
|
1340
|
-
const RULE$
|
|
1340
|
+
const RULE$51 = "ignored-sources";
|
|
1341
1341
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
1342
1342
|
const FIRST$15 = 1;
|
|
1343
|
-
const MESSAGE$
|
|
1343
|
+
const MESSAGE$14 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
1344
1344
|
/** @internal */
|
|
1345
1345
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
1346
1346
|
const files = yield* RepositoryFiles;
|
|
@@ -1349,8 +1349,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
1349
1349
|
file: files.join(root, file),
|
|
1350
1350
|
line: FIRST$15,
|
|
1351
1351
|
column: FIRST$15,
|
|
1352
|
-
rule: RULE$
|
|
1353
|
-
message: MESSAGE$
|
|
1352
|
+
rule: RULE$51,
|
|
1353
|
+
message: MESSAGE$14
|
|
1354
1354
|
})));
|
|
1355
1355
|
});
|
|
1356
1356
|
// src/features/check-placement/model/public-entries.ts
|
|
@@ -10073,13 +10073,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
10073
10073
|
return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
|
|
10074
10074
|
});
|
|
10075
10075
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
10076
|
-
const RULE$
|
|
10076
|
+
const RULE$50 = "shadcn-ui-alias";
|
|
10077
10077
|
const FIRST$14 = 1;
|
|
10078
10078
|
const problemOf$9 = (directory, { file, alias }) => ({
|
|
10079
10079
|
file,
|
|
10080
10080
|
line: FIRST$14,
|
|
10081
10081
|
column: FIRST$14,
|
|
10082
|
-
rule: RULE$
|
|
10082
|
+
rule: RULE$50,
|
|
10083
10083
|
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/*".`
|
|
10084
10084
|
});
|
|
10085
10085
|
/** @internal */
|
|
@@ -10202,7 +10202,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
|
|
|
10202
10202
|
message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
|
|
10203
10203
|
})));
|
|
10204
10204
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
|
|
10205
|
-
const problemsIn$
|
|
10205
|
+
const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
10206
10206
|
const files = yield* RepositoryFiles;
|
|
10207
10207
|
const config = yield* workspaceConfigOf(root, directory);
|
|
10208
10208
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -10241,19 +10241,19 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
10241
10241
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
10242
10242
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
10243
10243
|
const workflows = yield* workflowText(root);
|
|
10244
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$
|
|
10244
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$23 });
|
|
10245
10245
|
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
10246
10246
|
return [...Array.flatten(found), ...Array.getSomes(scripts)];
|
|
10247
10247
|
});
|
|
10248
10248
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
10249
|
-
const START$
|
|
10249
|
+
const START$24 = 0;
|
|
10250
10250
|
const QUOTES = ["\"", "'"];
|
|
10251
10251
|
const firstIndex = (source, needles) => {
|
|
10252
10252
|
const found = pipe(needles, Array.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
10253
10253
|
return Array.head(Array.sort(found, Order.Number));
|
|
10254
10254
|
};
|
|
10255
10255
|
const quoted$1 = (text) => pipe(QUOTES, Array.map((quote) => `${quote}${text}${quote}`));
|
|
10256
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted$1(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$
|
|
10256
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted$1(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$24));
|
|
10257
10257
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
10258
10258
|
const MEMBER_LISTS = [
|
|
10259
10259
|
"members",
|
|
@@ -10269,14 +10269,14 @@ const WORKSPACE = "workspace";
|
|
|
10269
10269
|
const PATCH = "patch";
|
|
10270
10270
|
const PATCH_DEPTH = 2;
|
|
10271
10271
|
const WORKSPACE_DEPTH = 1;
|
|
10272
|
-
const START$
|
|
10272
|
+
const START$23 = 0;
|
|
10273
10273
|
const WILDCARD$5 = /[*?[]/u;
|
|
10274
10274
|
const KEY_SEPARATOR = ".";
|
|
10275
10275
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
10276
10276
|
const decodeStrings$1 = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
10277
10277
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
10278
|
-
const declaresPath = (trail) => pipe(Array.last(trail), Option.exists((name) => Array.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array.get(trail, START$
|
|
10279
|
-
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array.get(trail, START$
|
|
10278
|
+
const declaresPath = (trail) => pipe(Array.last(trail), Option.exists((name) => Array.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array.get(trail, START$23).pipe(Option.exists((name) => name === PATCH));
|
|
10279
|
+
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array.get(trail, START$23).pipe(Option.exists((name) => name === WORKSPACE)) && Array.contains(MEMBER_LISTS, key);
|
|
10280
10280
|
const namedPaths = (trail, key, value) => {
|
|
10281
10281
|
const field = Array.join([...trail, key], KEY_SEPARATOR);
|
|
10282
10282
|
if (listsMembers(trail, key)) return pipe(decodeStrings$1(value), Option.getOrElse(() => []), Array.filter((member) => !WILDCARD$5.test(member)), Array.map((member) => ({
|
|
@@ -10363,7 +10363,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
10363
10363
|
])));
|
|
10364
10364
|
});
|
|
10365
10365
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
10366
|
-
const RULE$
|
|
10366
|
+
const RULE$49 = "config-path";
|
|
10367
10367
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
10368
10368
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
10369
10369
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -10382,14 +10382,14 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
10382
10382
|
const problemOf$8 = (file, source) => (mention) => ({
|
|
10383
10383
|
file,
|
|
10384
10384
|
...positionOf(source)(mention.index),
|
|
10385
|
-
rule: RULE$
|
|
10385
|
+
rule: RULE$49,
|
|
10386
10386
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
10387
10387
|
});
|
|
10388
10388
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
10389
10389
|
if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
|
|
10390
10390
|
return yield* tsconfigMentions(file, source);
|
|
10391
10391
|
});
|
|
10392
|
-
const problemsIn$
|
|
10392
|
+
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
10393
10393
|
const files = yield* RepositoryFiles;
|
|
10394
10394
|
const file = files.join(root, name);
|
|
10395
10395
|
const source = yield* files.readFile(file);
|
|
@@ -10407,7 +10407,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
10407
10407
|
return pipe(patterns, Array.map((pattern) => ({
|
|
10408
10408
|
file,
|
|
10409
10409
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
10410
|
-
rule: RULE$
|
|
10410
|
+
rule: RULE$49,
|
|
10411
10411
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
10412
10412
|
})));
|
|
10413
10413
|
});
|
|
@@ -10415,11 +10415,11 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
10415
10415
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
10416
10416
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
10417
10417
|
const configs = pipe(owned, Array.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
10418
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$
|
|
10418
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$18(root, name), { concurrency: READ_CONCURRENCY$22 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
10419
10419
|
return [...Array.flatten(found), ...patterns];
|
|
10420
10420
|
});
|
|
10421
10421
|
// src/features/check-repository-layout/model/crates.ts
|
|
10422
|
-
const RULE$
|
|
10422
|
+
const RULE$48 = "unverified-crate";
|
|
10423
10423
|
const VERSION_RULE = "release-version";
|
|
10424
10424
|
const MANIFEST_FILE$1 = "package.json";
|
|
10425
10425
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
@@ -10433,7 +10433,7 @@ const problemFor$4 = (crate, message) => ({
|
|
|
10433
10433
|
file: crate.manifest,
|
|
10434
10434
|
line: FIRST$11,
|
|
10435
10435
|
column: FIRST$11,
|
|
10436
|
-
rule: RULE$
|
|
10436
|
+
rule: RULE$48,
|
|
10437
10437
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
10438
10438
|
});
|
|
10439
10439
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -10469,7 +10469,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
10469
10469
|
return Array.getSomes(Array.flatten(found));
|
|
10470
10470
|
});
|
|
10471
10471
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
10472
|
-
const RULE$
|
|
10472
|
+
const RULE$47 = "deploy-entry-pattern";
|
|
10473
10473
|
const FALLOW_KEYS = [
|
|
10474
10474
|
"entry",
|
|
10475
10475
|
"entryPoints",
|
|
@@ -10482,13 +10482,13 @@ const FALLOW_CONFIG$1 = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.json
|
|
|
10482
10482
|
const VITE_CONFIG = /(?:^|\/)vite\.config\.[cm]?ts$/u;
|
|
10483
10483
|
const BRACE_GROUP = /\{(?<options>[^{}]*)\}/u;
|
|
10484
10484
|
const OPTION_SEPARATOR = ",";
|
|
10485
|
-
const PAIR = 2;
|
|
10485
|
+
const PAIR$1 = 2;
|
|
10486
10486
|
const NEGATED = "!";
|
|
10487
10487
|
const ROOT_WORKSPACE = ".";
|
|
10488
10488
|
const WRAP_OFFSET$1 = 1;
|
|
10489
10489
|
const NO_OFFSET = 0;
|
|
10490
10490
|
const READ_CONCURRENCY$20 = 8;
|
|
10491
|
-
const MESSAGE$
|
|
10491
|
+
const MESSAGE$13 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
|
|
10492
10492
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
10493
10493
|
const FALLOW = {
|
|
10494
10494
|
keys: FALLOW_KEYS,
|
|
@@ -10512,7 +10512,7 @@ const combined = (chunks) => Array.matchLeft(chunks, {
|
|
|
10512
10512
|
onEmpty: () => [""],
|
|
10513
10513
|
onNonEmpty: (head, tail) => pipe(choicesOf(head), Array.flatMap((choice) => pipe(combined(tail), Array.map((rest) => `${choice}${rest}`))))
|
|
10514
10514
|
});
|
|
10515
|
-
const expanded = (pattern) => combined(Array.chunksOf(String$1.split(pattern, BRACE_GROUP), PAIR));
|
|
10515
|
+
const expanded = (pattern) => combined(Array.chunksOf(String$1.split(pattern, BRACE_GROUP), PAIR$1));
|
|
10516
10516
|
const selectsOnlyDeployEntries = Effect.fn("selectsOnlyDeployEntries")(function* selectsOnlyDeployEntries({ root, bases, entries }, pattern) {
|
|
10517
10517
|
const files = yield* RepositoryFiles;
|
|
10518
10518
|
const pathspecs = pipe(bases, Array.flatMap((base) => pipe(expanded(pattern.text), Array.map((spec) => `:(glob)${files.join(base, spec)}`))));
|
|
@@ -10524,7 +10524,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
10524
10524
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
10525
10525
|
return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
10526
10526
|
});
|
|
10527
|
-
const problemsIn$
|
|
10527
|
+
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
10528
10528
|
const { root, file, kind, workspaces, entries } = request;
|
|
10529
10529
|
const files = yield* RepositoryFiles;
|
|
10530
10530
|
const path = files.join(root, file);
|
|
@@ -10540,8 +10540,8 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
10540
10540
|
return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
|
|
10541
10541
|
file: path,
|
|
10542
10542
|
...positionOf(text.value)(start - kind.offset),
|
|
10543
|
-
rule: RULE$
|
|
10544
|
-
message: `${pattern} ${MESSAGE$
|
|
10543
|
+
rule: RULE$47,
|
|
10544
|
+
message: `${pattern} ${MESSAGE$13}`
|
|
10545
10545
|
})));
|
|
10546
10546
|
});
|
|
10547
10547
|
/** @internal */
|
|
@@ -10563,7 +10563,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10563
10563
|
}];
|
|
10564
10564
|
return [];
|
|
10565
10565
|
}));
|
|
10566
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
10566
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$17({
|
|
10567
10567
|
root,
|
|
10568
10568
|
file,
|
|
10569
10569
|
kind,
|
|
@@ -10573,7 +10573,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10573
10573
|
return Array.flatten(found);
|
|
10574
10574
|
});
|
|
10575
10575
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
10576
|
-
const RULE$
|
|
10576
|
+
const RULE$46 = "listed-entry";
|
|
10577
10577
|
const ENTRY_KEYS = [
|
|
10578
10578
|
"entry",
|
|
10579
10579
|
"entryPoints",
|
|
@@ -10594,7 +10594,7 @@ const entryPatternsIn = (node) => {
|
|
|
10594
10594
|
return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
|
|
10595
10595
|
};
|
|
10596
10596
|
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$2.test(text);
|
|
10597
|
-
const problemsIn$
|
|
10597
|
+
const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
10598
10598
|
const files = yield* RepositoryFiles;
|
|
10599
10599
|
const path = files.join(root, file);
|
|
10600
10600
|
const text = yield* files.readFile(path);
|
|
@@ -10603,7 +10603,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10603
10603
|
return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
|
|
10604
10604
|
file: path,
|
|
10605
10605
|
...positionOf(text.value)(start),
|
|
10606
|
-
rule: RULE$
|
|
10606
|
+
rule: RULE$46,
|
|
10607
10607
|
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.`
|
|
10608
10608
|
})));
|
|
10609
10609
|
});
|
|
@@ -10611,11 +10611,11 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10611
10611
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
10612
10612
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10613
10613
|
const directories = yield* workspaceDirectories(root);
|
|
10614
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$
|
|
10614
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$19 });
|
|
10615
10615
|
return Array.flatten(found);
|
|
10616
10616
|
});
|
|
10617
10617
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
10618
|
-
const RULE$
|
|
10618
|
+
const RULE$45 = "root-workspace-path";
|
|
10619
10619
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
10620
10620
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
10621
10621
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -10631,10 +10631,10 @@ const mentions = (directory) => (text) => {
|
|
|
10631
10631
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
10632
10632
|
}));
|
|
10633
10633
|
};
|
|
10634
|
-
const problemsIn$
|
|
10634
|
+
const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
|
|
10635
10635
|
file,
|
|
10636
10636
|
...positionOf(source)(found.start),
|
|
10637
|
-
rule: RULE$
|
|
10637
|
+
rule: RULE$45,
|
|
10638
10638
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$5} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$5}: msch.lint, msch.devDependencies or its verify task.`
|
|
10639
10639
|
})));
|
|
10640
10640
|
/** @internal */
|
|
@@ -10645,10 +10645,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
10645
10645
|
if (Option.isNone(source)) return [];
|
|
10646
10646
|
const directories = yield* workspaceDirectories(root);
|
|
10647
10647
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
10648
|
-
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$
|
|
10648
|
+
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$15(file, source.value, directories)));
|
|
10649
10649
|
});
|
|
10650
10650
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
10651
|
-
const RULE$
|
|
10651
|
+
const RULE$44 = "hidden-verify";
|
|
10652
10652
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
10653
10653
|
const FIRST$9 = 1;
|
|
10654
10654
|
const READ_CONCURRENCY$18 = 8;
|
|
@@ -10662,7 +10662,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
10662
10662
|
file,
|
|
10663
10663
|
line: FIRST$9,
|
|
10664
10664
|
column: FIRST$9,
|
|
10665
|
-
rule: RULE$
|
|
10665
|
+
rule: RULE$44,
|
|
10666
10666
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
|
|
10667
10667
|
}).pipe(Option.filter(() => verified));
|
|
10668
10668
|
});
|
|
@@ -10673,7 +10673,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
10673
10673
|
return Array.getSomes(found);
|
|
10674
10674
|
});
|
|
10675
10675
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
10676
|
-
const RULE$
|
|
10676
|
+
const RULE$43 = "shared-uncached-task";
|
|
10677
10677
|
const READ_CONCURRENCY$17 = 8;
|
|
10678
10678
|
const SHARED = 2;
|
|
10679
10679
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -10716,7 +10716,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
10716
10716
|
return pipe(definitions, Array.map(({ file, position, name, command }) => ({
|
|
10717
10717
|
file,
|
|
10718
10718
|
...position,
|
|
10719
|
-
rule: RULE$
|
|
10719
|
+
rule: RULE$43,
|
|
10720
10720
|
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.`
|
|
10721
10721
|
})));
|
|
10722
10722
|
};
|
|
@@ -10727,7 +10727,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
10727
10727
|
return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
|
|
10728
10728
|
});
|
|
10729
10729
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
10730
|
-
const RULE$
|
|
10730
|
+
const RULE$42 = "unlocked-task";
|
|
10731
10731
|
const READ_CONCURRENCY$16 = 8;
|
|
10732
10732
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
10733
10733
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -10739,7 +10739,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
10739
10739
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
10740
10740
|
file,
|
|
10741
10741
|
...positionOf(source)(task.start),
|
|
10742
|
-
rule: RULE$
|
|
10742
|
+
rule: RULE$42,
|
|
10743
10743
|
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.`
|
|
10744
10744
|
})), Option.toArray)));
|
|
10745
10745
|
/** @internal */
|
|
@@ -10894,7 +10894,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
10894
10894
|
/** @internal */
|
|
10895
10895
|
const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
|
|
10896
10896
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
10897
|
-
const RULE$
|
|
10897
|
+
const RULE$41 = "workflow-path";
|
|
10898
10898
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
10899
10899
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
10900
10900
|
const READ_CONCURRENCY$15 = 8;
|
|
@@ -10938,10 +10938,10 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
10938
10938
|
const problemOf$7 = (file, source) => (found) => ({
|
|
10939
10939
|
file,
|
|
10940
10940
|
...positionOf(source)(found.offset),
|
|
10941
|
-
rule: RULE$
|
|
10941
|
+
rule: RULE$41,
|
|
10942
10942
|
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.`
|
|
10943
10943
|
});
|
|
10944
|
-
const problemsIn$
|
|
10944
|
+
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
10945
10945
|
const files = yield* RepositoryFiles;
|
|
10946
10946
|
const file = files.join(root, workflow);
|
|
10947
10947
|
const source = yield* files.readFile(file);
|
|
@@ -10953,7 +10953,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
|
|
|
10953
10953
|
/** @internal */
|
|
10954
10954
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
10955
10955
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10956
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$
|
|
10956
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$15 });
|
|
10957
10957
|
return Array.flatten(found);
|
|
10958
10958
|
});
|
|
10959
10959
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -10964,7 +10964,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
|
|
|
10964
10964
|
const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
10965
10965
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
10966
10966
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
10967
|
-
const START$
|
|
10967
|
+
const START$22 = 0;
|
|
10968
10968
|
const READ_CONCURRENCY$14 = 8;
|
|
10969
10969
|
const SEPARATOR$8 = "/";
|
|
10970
10970
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
@@ -10995,7 +10995,7 @@ const namesIn$1 = (name, source) => {
|
|
|
10995
10995
|
return [
|
|
10996
10996
|
{
|
|
10997
10997
|
text: name,
|
|
10998
|
-
offset: START$
|
|
10998
|
+
offset: START$22
|
|
10999
10999
|
},
|
|
11000
11000
|
...Option.toArray(stringOf(childOf("name")(root))),
|
|
11001
11001
|
...keysOf$1(childOf("jobs")(root))
|
|
@@ -11253,11 +11253,11 @@ const LISTED_LARGEST = 5;
|
|
|
11253
11253
|
const SIZE_CONCURRENCY = 32;
|
|
11254
11254
|
const MEGABYTE = 1e6;
|
|
11255
11255
|
const MEGABYTE_DIGITS = 1;
|
|
11256
|
-
const START$
|
|
11256
|
+
const START$21 = 0;
|
|
11257
11257
|
const SINGLE_ENTRY = 1;
|
|
11258
11258
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
11259
11259
|
const usageHint = (dependency, entryCount) => {
|
|
11260
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
11260
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$21 && dependency.entries.length < entryCount)) return "";
|
|
11261
11261
|
return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
|
|
11262
11262
|
};
|
|
11263
11263
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
|
|
@@ -11266,7 +11266,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
11266
11266
|
const { workspace, total } = overrun;
|
|
11267
11267
|
const config = yield* files.readFile(workspace.configFile);
|
|
11268
11268
|
const source = Option.getOrElse(config, () => "");
|
|
11269
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
11269
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$21);
|
|
11270
11270
|
return {
|
|
11271
11271
|
file: workspace.configFile,
|
|
11272
11272
|
...positionOf(source)(index),
|
|
@@ -11283,7 +11283,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
11283
11283
|
const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
|
|
11284
11284
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
11285
11285
|
const sizes = HashMap.fromIterable(measured);
|
|
11286
|
-
const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$
|
|
11286
|
+
const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$21)), Number$1.sumAll);
|
|
11287
11287
|
return {
|
|
11288
11288
|
closures,
|
|
11289
11289
|
sizeOf,
|
|
@@ -11316,11 +11316,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
11316
11316
|
})];
|
|
11317
11317
|
});
|
|
11318
11318
|
const stackProblems = (file, source, dependencies) => {
|
|
11319
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
11319
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$21);
|
|
11320
11320
|
const rest = String$1.slice(section)(source);
|
|
11321
11321
|
return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
|
|
11322
11322
|
file,
|
|
11323
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
11323
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$21)),
|
|
11324
11324
|
rule: STACK_DEPENDENCY,
|
|
11325
11325
|
message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
|
|
11326
11326
|
})));
|
|
@@ -11502,23 +11502,23 @@ const declaredBy$1 = ({ declared, locator }) => {
|
|
|
11502
11502
|
};
|
|
11503
11503
|
};
|
|
11504
11504
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
11505
|
-
const RULE$
|
|
11505
|
+
const RULE$40 = "optional-peer";
|
|
11506
11506
|
const REQUIRED_RULE = "required-peer";
|
|
11507
|
-
const START$
|
|
11507
|
+
const START$20 = 0;
|
|
11508
11508
|
const SINGLE = 1;
|
|
11509
11509
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
11510
11510
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
11511
11511
|
const importsPackage = (name) => ({ packages }) => Array.contains(packages, name);
|
|
11512
11512
|
const labelsOf = (importers) => pipe(importers, Array.map(({ entry }) => `\`${entry.label}\``), Array.dedupe, Array.join(", "));
|
|
11513
11513
|
const positionIn = (located, key, name) => {
|
|
11514
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
11514
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$20);
|
|
11515
11515
|
const rest = String$1.slice(section)(located.source);
|
|
11516
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
11516
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$20));
|
|
11517
11517
|
};
|
|
11518
11518
|
const problemFor$3 = (located, name, importers) => ({
|
|
11519
11519
|
file: located.file,
|
|
11520
11520
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
11521
|
-
rule: RULE$
|
|
11521
|
+
rule: RULE$40,
|
|
11522
11522
|
message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
|
|
11523
11523
|
});
|
|
11524
11524
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -11532,7 +11532,7 @@ const optionalPeerProblems = ({ located, dependencies, used }) => {
|
|
|
11532
11532
|
return pipe(keysOf(dependencies), Array.flatMap((name) => {
|
|
11533
11533
|
const importers = pipe(libraries, Array.filter(importsPackage(name)));
|
|
11534
11534
|
const neededByBin = pipe(bins, Array.some(importsPackage(name)));
|
|
11535
|
-
if (!(importers.length > START$
|
|
11535
|
+
if (!(importers.length > START$20 && importers.length < libraries.length) || neededByBin) return [];
|
|
11536
11536
|
return [problemFor$3(located, name, importers)];
|
|
11537
11537
|
}));
|
|
11538
11538
|
};
|
|
@@ -11552,9 +11552,9 @@ const requiredPeerProblems = ({ located, optional, stack, used }) => {
|
|
|
11552
11552
|
}));
|
|
11553
11553
|
};
|
|
11554
11554
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
11555
|
-
const RULE$
|
|
11555
|
+
const RULE$39 = "side-effects";
|
|
11556
11556
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
11557
|
-
const START$
|
|
11557
|
+
const START$19 = 0;
|
|
11558
11558
|
const FIRST$8 = 1;
|
|
11559
11559
|
const LISTED_PACKAGES = 4;
|
|
11560
11560
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -11578,7 +11578,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
11578
11578
|
label: entry.label,
|
|
11579
11579
|
member,
|
|
11580
11580
|
...extra
|
|
11581
|
-
}, ({ modules }) => modules > START$
|
|
11581
|
+
}, ({ modules }) => modules > START$19);
|
|
11582
11582
|
});
|
|
11583
11583
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
11584
11584
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -11600,15 +11600,15 @@ const othersOf = (total) => {
|
|
|
11600
11600
|
};
|
|
11601
11601
|
const messageOf$4 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
|
|
11602
11602
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
11603
|
-
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$
|
|
11603
|
+
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$19));
|
|
11604
11604
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array.sortBy(largest), Array.head, Option.map((worst) => ({
|
|
11605
11605
|
file,
|
|
11606
11606
|
...positionOf(source)(keyIndex$1(source)),
|
|
11607
|
-
rule: RULE$
|
|
11607
|
+
rule: RULE$39,
|
|
11608
11608
|
message: messageOf$4(worst, excesses.length)
|
|
11609
11609
|
})), Option.toArray);
|
|
11610
11610
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
11611
|
-
const RULE$
|
|
11611
|
+
const RULE$38 = "top-level-effect";
|
|
11612
11612
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
11613
11613
|
const READ_CONCURRENCY$13 = 16;
|
|
11614
11614
|
const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
|
|
@@ -11621,10 +11621,10 @@ const messageOf$3 = (statement) => {
|
|
|
11621
11621
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
11622
11622
|
return STATEMENT_MESSAGE;
|
|
11623
11623
|
};
|
|
11624
|
-
const problemsIn$
|
|
11624
|
+
const problemsIn$13 = (api) => (file) => (source) => {
|
|
11625
11625
|
const retained = api.createSourceFile(file, source);
|
|
11626
11626
|
const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$7({
|
|
11627
|
-
rule: RULE$
|
|
11627
|
+
rule: RULE$38,
|
|
11628
11628
|
message: messageOf$3(statement)
|
|
11629
11629
|
})(statement)));
|
|
11630
11630
|
retained.dispose();
|
|
@@ -11637,7 +11637,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
11637
11637
|
const names = yield* files.ownedFiles(root);
|
|
11638
11638
|
const owned = new Set(pipe(names, Array.map((name) => files.join(root, name))));
|
|
11639
11639
|
const sources = pipe(modules, Array.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
11640
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$
|
|
11640
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$13(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$13 });
|
|
11641
11641
|
return Array.flatten(found);
|
|
11642
11642
|
}, Effect.scoped);
|
|
11643
11643
|
// src/features/check-tree-shaking/model/usage.ts
|
|
@@ -11757,7 +11757,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
11757
11757
|
return Array.flatten(found);
|
|
11758
11758
|
});
|
|
11759
11759
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
11760
|
-
const RULE$
|
|
11760
|
+
const RULE$37 = "legacy-typescript";
|
|
11761
11761
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
11762
11762
|
const COMPILER = "typescript";
|
|
11763
11763
|
const CURRENT_MAJOR = 7;
|
|
@@ -11788,12 +11788,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
11788
11788
|
file,
|
|
11789
11789
|
line: lineOf$2(source)(legacy.id),
|
|
11790
11790
|
column: FIRST$7,
|
|
11791
|
-
rule: RULE$
|
|
11791
|
+
rule: RULE$37,
|
|
11792
11792
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
11793
11793
|
})));
|
|
11794
11794
|
});
|
|
11795
11795
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
11796
|
-
const RULE$
|
|
11796
|
+
const RULE$36 = "worker-bundle";
|
|
11797
11797
|
const BUNDLE_CONCURRENCY = 4;
|
|
11798
11798
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
11799
11799
|
const CONDITIONS = [
|
|
@@ -11804,7 +11804,7 @@ const CONDITIONS = [
|
|
|
11804
11804
|
"module",
|
|
11805
11805
|
"default"
|
|
11806
11806
|
];
|
|
11807
|
-
const problemFor$2 = problemInFile(RULE$
|
|
11807
|
+
const problemFor$2 = problemInFile(RULE$36);
|
|
11808
11808
|
const problemOf$6 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
11809
11809
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
11810
11810
|
const built = yield* Effect.tryPromise({
|
|
@@ -11928,7 +11928,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
11928
11928
|
imports: importedFilesOf(checker)(sourceFile)
|
|
11929
11929
|
})), Array.filter((facts) => Array.isReadonlyArrayNonEmpty(facts.values) || Array.isReadonlyArrayNonEmpty(facts.imports)));
|
|
11930
11930
|
// src/features/check-value-owners/model/name-lists.ts
|
|
11931
|
-
const RULE$
|
|
11931
|
+
const RULE$35 = "hand-written-names";
|
|
11932
11932
|
const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
11933
11933
|
const nameListOf = (site) => {
|
|
11934
11934
|
if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -11943,7 +11943,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
11943
11943
|
file,
|
|
11944
11944
|
line,
|
|
11945
11945
|
column,
|
|
11946
|
-
rule: RULE$
|
|
11946
|
+
rule: RULE$35,
|
|
11947
11947
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
11948
11948
|
});
|
|
11949
11949
|
const problemOf$5 = ({ list, reason }) => listedProblem({
|
|
@@ -12742,7 +12742,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
12742
12742
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
12743
12743
|
}, Effect.scoped);
|
|
12744
12744
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
12745
|
-
const RULE$
|
|
12745
|
+
const RULE$34 = "namespace-destructuring";
|
|
12746
12746
|
const LOCAL = /^[.#/]/u;
|
|
12747
12747
|
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.`;
|
|
12748
12748
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -12758,7 +12758,7 @@ const destructuredName = (declaration) => {
|
|
|
12758
12758
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
12759
12759
|
};
|
|
12760
12760
|
const problemOf$4 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
12761
|
-
rule: RULE$
|
|
12761
|
+
rule: RULE$34,
|
|
12762
12762
|
message: messageOf$1(name)
|
|
12763
12763
|
})), Option.map((report) => report(declaration)));
|
|
12764
12764
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -12766,7 +12766,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
12766
12766
|
return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$4(names)), Array.getSomes);
|
|
12767
12767
|
};
|
|
12768
12768
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
12769
|
-
const RULE$
|
|
12769
|
+
const RULE$33 = "pass-through-wrapper";
|
|
12770
12770
|
const SINGLE_STATEMENT = 1;
|
|
12771
12771
|
const SINGLE_DECLARATION = 1;
|
|
12772
12772
|
const THIS_PARAMETER = "this";
|
|
@@ -12863,7 +12863,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
12863
12863
|
const problemOf$3 = (checker) => (candidate) => {
|
|
12864
12864
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
12865
12865
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
12866
|
-
rule: RULE$
|
|
12866
|
+
rule: RULE$33,
|
|
12867
12867
|
message: messageOf(forward.callee.getText())
|
|
12868
12868
|
})(candidate.name)));
|
|
12869
12869
|
};
|
|
@@ -12889,7 +12889,7 @@ var plugins = [{
|
|
|
12889
12889
|
"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."
|
|
12890
12890
|
}];
|
|
12891
12891
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
12892
|
-
const RULE$
|
|
12892
|
+
const RULE$32 = "known-plugins";
|
|
12893
12893
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
12894
12894
|
const GITHUB$2 = "github";
|
|
12895
12895
|
const Source$1 = Schema.Struct({
|
|
@@ -12907,7 +12907,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
|
|
|
12907
12907
|
const REPOSITORY_NAME = "masseater/masseater.dev";
|
|
12908
12908
|
const MARKETPLACE = name;
|
|
12909
12909
|
const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
|
|
12910
|
-
const problem$1 = problemInFile(RULE$
|
|
12910
|
+
const problem$1 = problemInFile(RULE$32);
|
|
12911
12911
|
const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
|
|
12912
12912
|
const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
|
|
12913
12913
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
@@ -12928,20 +12928,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
12928
12928
|
return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
|
|
12929
12929
|
});
|
|
12930
12930
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
12931
|
-
const RULE$
|
|
12931
|
+
const RULE$31 = "missing-hook";
|
|
12932
12932
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
12933
12933
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
12934
12934
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
12935
12935
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
12936
12936
|
const PLUGIN_ROOT = "..";
|
|
12937
12937
|
const READ_CONCURRENCY$12 = 16;
|
|
12938
|
-
const START$
|
|
12938
|
+
const START$18 = 0;
|
|
12939
12939
|
const referenceOf$2 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
12940
12940
|
path,
|
|
12941
|
-
index: found.index ?? START$
|
|
12941
|
+
index: found.index ?? START$18
|
|
12942
12942
|
})), Option.toArray);
|
|
12943
12943
|
const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$2));
|
|
12944
|
-
const problemsIn$
|
|
12944
|
+
const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
12945
12945
|
const files = yield* RepositoryFiles;
|
|
12946
12946
|
const text = yield* files.readFile(file);
|
|
12947
12947
|
if (Option.isNone(text)) return [];
|
|
@@ -12953,7 +12953,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
12953
12953
|
return pipe(missing, Array.map(({ path, index }) => ({
|
|
12954
12954
|
file,
|
|
12955
12955
|
...positionOf(source)(index),
|
|
12956
|
-
rule: RULE$
|
|
12956
|
+
rule: RULE$31,
|
|
12957
12957
|
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.`
|
|
12958
12958
|
})));
|
|
12959
12959
|
});
|
|
@@ -12977,7 +12977,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
12977
12977
|
}];
|
|
12978
12978
|
return [];
|
|
12979
12979
|
}));
|
|
12980
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$
|
|
12980
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$12, { concurrency: READ_CONCURRENCY$12 });
|
|
12981
12981
|
return Array.flatten(found);
|
|
12982
12982
|
});
|
|
12983
12983
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
@@ -13006,7 +13006,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
13006
13006
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
13007
13007
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
13008
13008
|
// src/features/check-documented-commands/model/commands.ts
|
|
13009
|
-
const RULE$
|
|
13009
|
+
const RULE$30 = "documented-commands";
|
|
13010
13010
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
13011
13011
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
13012
13012
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -13025,7 +13025,7 @@ const FILTER_ASSIGNMENT = "--filter=";
|
|
|
13025
13025
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
13026
13026
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
13027
13027
|
const ONE$1 = 1;
|
|
13028
|
-
const START$
|
|
13028
|
+
const START$17 = 0;
|
|
13029
13029
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
13030
13030
|
const filterOf = (tokens) => pipe(tokens, Array.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
|
|
13031
13031
|
const follows = (tokens) => (index) => pipe(Array.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
@@ -13081,11 +13081,11 @@ const whereOf = (scope, file) => {
|
|
|
13081
13081
|
return `the package that holds ${file}`;
|
|
13082
13082
|
};
|
|
13083
13083
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array.some(hasTask(graph, task)));
|
|
13084
|
-
const problemsIn$
|
|
13084
|
+
const problemsIn$11 = (graph, absolute, { file, text }) => pipe(Array.fromIterable(String$1.matchAll(COMMAND)(text)), Array.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
|
|
13085
13085
|
file: absolute(file),
|
|
13086
|
-
...positionOf(text)(match.index ?? START$
|
|
13087
|
-
rule: RULE$
|
|
13088
|
-
message: `${match[START$
|
|
13086
|
+
...positionOf(text)(match.index ?? START$17),
|
|
13087
|
+
rule: RULE$30,
|
|
13088
|
+
message: `${match[START$17]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
13089
13089
|
})), Option.toArray)));
|
|
13090
13090
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
13091
13091
|
/** @internal */
|
|
@@ -13109,14 +13109,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
13109
13109
|
file: absolute(Array.headNonEmpty(commanded).file),
|
|
13110
13110
|
line: ONE$1,
|
|
13111
13111
|
column: ONE$1,
|
|
13112
|
-
rule: RULE$
|
|
13112
|
+
rule: RULE$30,
|
|
13113
13113
|
message: "msch could not list the tasks with `vp run --json`"
|
|
13114
13114
|
}],
|
|
13115
|
-
onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$
|
|
13115
|
+
onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$11(found, absolute, document)))
|
|
13116
13116
|
});
|
|
13117
13117
|
});
|
|
13118
13118
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
13119
|
-
const RULE$
|
|
13119
|
+
const RULE$29 = "legacy-web";
|
|
13120
13120
|
const FIRST_COLUMN$4 = 1;
|
|
13121
13121
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
13122
13122
|
const Finding = Schema.Struct({
|
|
@@ -13155,7 +13155,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
13155
13155
|
file: files.join(root, file),
|
|
13156
13156
|
line,
|
|
13157
13157
|
column: FIRST_COLUMN$4,
|
|
13158
|
-
rule: RULE$
|
|
13158
|
+
rule: RULE$29,
|
|
13159
13159
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
13160
13160
|
});
|
|
13161
13161
|
return pipe(scan.guides, Array.flatMap(({ guideId, rules }) => pipe(rules, Array.flatMap(({ ruleId, findings }) => pipe(findings, Array.map(problemOf(guideId, ruleId)))))));
|
|
@@ -13226,8 +13226,8 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
|
|
|
13226
13226
|
const EXTENSION = /\.[^./]+$/u;
|
|
13227
13227
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
13228
13228
|
const READ_CONCURRENCY$11 = 64;
|
|
13229
|
-
const RULE$
|
|
13230
|
-
const MESSAGE$
|
|
13229
|
+
const RULE$28 = "shell-script";
|
|
13230
|
+
const MESSAGE$12 = "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.";
|
|
13231
13231
|
const HookSchema = Schema.Struct({
|
|
13232
13232
|
command: Schema.optional(Schema.String),
|
|
13233
13233
|
args: Schema.String.pipe(Schema.Array, Schema.optional)
|
|
@@ -13259,7 +13259,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
13259
13259
|
};
|
|
13260
13260
|
const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
|
|
13261
13261
|
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$11 });
|
|
13262
|
-
return pipe(shell, Array.map((name) => problemInFile(RULE$
|
|
13262
|
+
return pipe(shell, Array.map((name) => problemInFile(RULE$28)(files.join(root, name), MESSAGE$12)));
|
|
13263
13263
|
});
|
|
13264
13264
|
// src/shared/lib/workflow-files.ts
|
|
13265
13265
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
@@ -13278,8 +13278,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
13278
13278
|
});
|
|
13279
13279
|
// src/shared/lib/workflow-run.ts
|
|
13280
13280
|
const RUN_KEY = "run";
|
|
13281
|
-
const START$
|
|
13282
|
-
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
13281
|
+
const START$16 = 0;
|
|
13282
|
+
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$16));
|
|
13283
13283
|
const runScriptsOf = (source) => {
|
|
13284
13284
|
const found = [];
|
|
13285
13285
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -13294,23 +13294,23 @@ const runScriptsOf = (source) => {
|
|
|
13294
13294
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
13295
13295
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
13296
13296
|
const COMMENT = "#";
|
|
13297
|
-
const RULE$
|
|
13297
|
+
const RULE$27 = "workflow-script";
|
|
13298
13298
|
const ONE_COMMAND = 1;
|
|
13299
|
-
const MESSAGE$
|
|
13299
|
+
const MESSAGE$11 = "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.";
|
|
13300
13300
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
13301
13301
|
const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
|
|
13302
13302
|
const runsMoreThanOneCommand = ({ text }) => {
|
|
13303
13303
|
const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
|
|
13304
13304
|
return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
|
|
13305
13305
|
};
|
|
13306
|
-
const problemsIn$
|
|
13306
|
+
const problemsIn$10 = (file) => (source) => {
|
|
13307
13307
|
const at = positionOf(source);
|
|
13308
|
-
return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$
|
|
13308
|
+
return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$27)(file, at(start), MESSAGE$11)));
|
|
13309
13309
|
};
|
|
13310
13310
|
/** @internal */
|
|
13311
13311
|
const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
|
|
13312
13312
|
const workflows = yield* readWorkflows(root);
|
|
13313
|
-
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$
|
|
13313
|
+
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$10(file)(source)));
|
|
13314
13314
|
});
|
|
13315
13315
|
// src/features/check-scripts/model/script-checks.ts
|
|
13316
13316
|
/** @internal */
|
|
@@ -13355,16 +13355,16 @@ const SKIP_HOOKS = "--no-verify";
|
|
|
13355
13355
|
const BYPASS_RULESET = "--admin";
|
|
13356
13356
|
const FILTER = /^(?:--filter(?:=.*)?|-F)$/u;
|
|
13357
13357
|
const TASK_KINDS = ["script", "task"];
|
|
13358
|
-
const SECOND = 1;
|
|
13358
|
+
const SECOND$1 = 1;
|
|
13359
13359
|
const DOC_KIND = "doc";
|
|
13360
13360
|
const NODE = "node";
|
|
13361
13361
|
const INLINE_CODE$1 = /^(?:--eval(?:=.*)?|--print(?:=.*)?|-[a-z]*[ep][a-z]*)$/u;
|
|
13362
13362
|
const programOf = (words) => Array.headNonEmpty(words);
|
|
13363
|
-
const subcommandOf = (words) => Array.get(words, SECOND);
|
|
13363
|
+
const subcommandOf = (words) => Array.get(words, SECOND$1);
|
|
13364
13364
|
const RULES = [
|
|
13365
13365
|
{
|
|
13366
13366
|
rule: "package-manager-command",
|
|
13367
|
-
applies: (source, words) => Array.contains(PACKAGE_MANAGERS, programOf(words)) && (source.kind !== DOC_KIND || words.length > SECOND),
|
|
13367
|
+
applies: (source, words) => Array.contains(PACKAGE_MANAGERS, programOf(words)) && (source.kind !== DOC_KIND || words.length > SECOND$1),
|
|
13368
13368
|
message: (command) => `\`${command}\` calls the package manager directly. Run it through vp (vp install, vp add, vp exec, vp dlx, vp run), so that hooks, CI and sessions all use the toolchain Vite+ pins.`
|
|
13369
13369
|
},
|
|
13370
13370
|
{
|
|
@@ -13379,7 +13379,7 @@ const RULES = [
|
|
|
13379
13379
|
},
|
|
13380
13380
|
{
|
|
13381
13381
|
rule: "inline-script",
|
|
13382
|
-
applies: (source, words) => source.kind !== DOC_KIND && programOf(words) === NODE && pipe(Array.drop(words, SECOND), Array.some((word) => INLINE_CODE$1.test(word))),
|
|
13382
|
+
applies: (source, words) => source.kind !== DOC_KIND && programOf(words) === NODE && pipe(Array.drop(words, SECOND$1), Array.some((word) => INLINE_CODE$1.test(word))),
|
|
13383
13383
|
message: (command) => `\`${command}\` runs code written inside a command, which gets copied from package to package. Put the code in bin/<name>.ts of the package that owns it, or in a shared package, and run it with node bin/<name>.ts.`
|
|
13384
13384
|
}
|
|
13385
13385
|
];
|
|
@@ -13391,7 +13391,7 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array.flatMap((
|
|
|
13391
13391
|
})))));
|
|
13392
13392
|
const commandProblems$1 = (sources) => pipe(sources, Array.flatMap(problemsOf));
|
|
13393
13393
|
// src/features/check-vite-plus/model/doc-sources.ts
|
|
13394
|
-
const FENCE = /^(?<open>```(?:sh|bash|shell|console|zsh)?[ \t]*\n)(?<body>[\s\S]*?)^```[ \t]*$/gmu;
|
|
13394
|
+
const FENCE$1 = /^(?<open>```(?:sh|bash|shell|console|zsh)?[ \t]*\n)(?<body>[\s\S]*?)^```[ \t]*$/gmu;
|
|
13395
13395
|
const INLINE_CODE = /(?<open>(?<!`)`)(?<body>[^`\n]+)`(?!`)/gu;
|
|
13396
13396
|
const codeIn = (pattern) => (source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => pipe(Option.all({
|
|
13397
13397
|
open: groupOf("open")(match),
|
|
@@ -13405,7 +13405,7 @@ const codeIn = (pattern) => (source) => pipe(Array.fromIterable(String$1.matchAl
|
|
|
13405
13405
|
})), Option.toArray)));
|
|
13406
13406
|
const outside = (fences) => (span) => !pipe(fences, Array.some((fence) => span.start >= fence.start && span.start < fence.end));
|
|
13407
13407
|
const docSources = (file) => (source) => {
|
|
13408
|
-
const fences = codeIn(FENCE)(source);
|
|
13408
|
+
const fences = codeIn(FENCE$1)(source);
|
|
13409
13409
|
const inline = pipe(codeIn(INLINE_CODE)(source), Array.filter(outside(fences)));
|
|
13410
13410
|
return pipe([...fences, ...inline], Array.map(({ text, start }) => ({
|
|
13411
13411
|
kind: "doc",
|
|
@@ -13436,7 +13436,7 @@ const AGENT_DOCS = [
|
|
|
13436
13436
|
...EXCLUDED$4
|
|
13437
13437
|
];
|
|
13438
13438
|
const READ_CONCURRENCY$9 = 16;
|
|
13439
|
-
const START$
|
|
13439
|
+
const START$15 = 0;
|
|
13440
13440
|
const FIRST$5 = 1;
|
|
13441
13441
|
const LINE = "\n";
|
|
13442
13442
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -13446,7 +13446,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
|
|
|
13446
13446
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
13447
13447
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13448
13448
|
const NO_SOURCES = [];
|
|
13449
|
-
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
13449
|
+
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$15));
|
|
13450
13450
|
const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
|
|
13451
13451
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
13452
13452
|
return {
|
|
@@ -13542,7 +13542,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
13542
13542
|
return Array.flatten(found);
|
|
13543
13543
|
});
|
|
13544
13544
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
13545
|
-
const RULE$
|
|
13545
|
+
const RULE$26 = "package-script";
|
|
13546
13546
|
const LIFECYCLE = [
|
|
13547
13547
|
"preinstall",
|
|
13548
13548
|
"install",
|
|
@@ -13565,26 +13565,26 @@ const LIFECYCLE = [
|
|
|
13565
13565
|
const problemOf$2 = ({ file, position, name }) => ({
|
|
13566
13566
|
file,
|
|
13567
13567
|
...position,
|
|
13568
|
-
rule: RULE$
|
|
13568
|
+
rule: RULE$26,
|
|
13569
13569
|
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.`
|
|
13570
13570
|
});
|
|
13571
13571
|
const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$2));
|
|
13572
13572
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
13573
|
-
const RULE$
|
|
13573
|
+
const RULE$25 = "vite-plus-block";
|
|
13574
13574
|
const MARKER = Array.join([
|
|
13575
13575
|
"<!--",
|
|
13576
13576
|
"VITE PLUS START",
|
|
13577
13577
|
"-->"
|
|
13578
13578
|
], "");
|
|
13579
|
-
const MESSAGE$
|
|
13579
|
+
const MESSAGE$10 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
|
|
13580
13580
|
const problemIn = (file) => (source) => {
|
|
13581
13581
|
const index = String$1.indexOf(MARKER)(source);
|
|
13582
13582
|
if (Option.isNone(index)) return Option.none();
|
|
13583
13583
|
return Option.some({
|
|
13584
13584
|
file,
|
|
13585
13585
|
...positionOf(source)(index.value),
|
|
13586
|
-
rule: RULE$
|
|
13587
|
-
message: MESSAGE$
|
|
13586
|
+
rule: RULE$25,
|
|
13587
|
+
message: MESSAGE$10
|
|
13588
13588
|
});
|
|
13589
13589
|
};
|
|
13590
13590
|
/** @internal */
|
|
@@ -13639,11 +13639,11 @@ const checkFullHistoryCheckout = workflowCheck({
|
|
|
13639
13639
|
})
|
|
13640
13640
|
});
|
|
13641
13641
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
13642
|
-
const RULE$
|
|
13642
|
+
const RULE$23 = "publish-trigger";
|
|
13643
13643
|
const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
|
|
13644
13644
|
const MANUAL = "workflow_dispatch";
|
|
13645
13645
|
const TRIGGER_KEY = "on";
|
|
13646
|
-
const MESSAGE$
|
|
13646
|
+
const MESSAGE$8 = "publishes with `msch-publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch-publish dispatch`.";
|
|
13647
13647
|
const triggersOf = (node) => {
|
|
13648
13648
|
if (isScalar(node)) return [String(node.value)];
|
|
13649
13649
|
if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
|
|
@@ -13659,19 +13659,19 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
13659
13659
|
};
|
|
13660
13660
|
/** @internal */
|
|
13661
13661
|
const checkPublishTrigger = workflowCheck({
|
|
13662
|
-
rule: RULE$
|
|
13663
|
-
message: MESSAGE$
|
|
13662
|
+
rule: RULE$23,
|
|
13663
|
+
message: MESSAGE$8,
|
|
13664
13664
|
offsetsOf: publishTriggerOffsetsOf
|
|
13665
13665
|
});
|
|
13666
13666
|
// src/features/check-workflows/model/release-please.ts
|
|
13667
|
-
const RULE$
|
|
13667
|
+
const RULE$22 = "release-please";
|
|
13668
13668
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
13669
13669
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
13670
13670
|
const FIRST$4 = 1;
|
|
13671
|
-
const MESSAGE$
|
|
13671
|
+
const MESSAGE$7 = "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.";
|
|
13672
13672
|
const checkReleasePleaseSteps = workflowCheck({
|
|
13673
|
-
rule: RULE$
|
|
13674
|
-
message: MESSAGE$
|
|
13673
|
+
rule: RULE$22,
|
|
13674
|
+
message: MESSAGE$7,
|
|
13675
13675
|
offsetsOf: scalarKeyOffsets({
|
|
13676
13676
|
name: "uses",
|
|
13677
13677
|
matches: (value) => RELEASE_PLEASE.test(value)
|
|
@@ -13684,8 +13684,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
13684
13684
|
file: files.join(root, name),
|
|
13685
13685
|
line: FIRST$4,
|
|
13686
13686
|
column: FIRST$4,
|
|
13687
|
-
rule: RULE$
|
|
13688
|
-
message: MESSAGE$
|
|
13687
|
+
rule: RULE$22,
|
|
13688
|
+
message: MESSAGE$7
|
|
13689
13689
|
})));
|
|
13690
13690
|
});
|
|
13691
13691
|
/** @internal */
|
|
@@ -13696,26 +13696,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
13696
13696
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
13697
13697
|
const CONCURRENCY_KEY = "concurrency";
|
|
13698
13698
|
const QUEUE_KEY = "queue";
|
|
13699
|
-
const RULE$
|
|
13700
|
-
const MESSAGE$
|
|
13699
|
+
const RULE$21 = "workflow-queue";
|
|
13700
|
+
const MESSAGE$6 = "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.";
|
|
13701
13701
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
13702
13702
|
/** @internal */
|
|
13703
13703
|
const checkWorkflowQueues = workflowCheck({
|
|
13704
|
-
rule: RULE$
|
|
13705
|
-
message: MESSAGE$
|
|
13704
|
+
rule: RULE$21,
|
|
13705
|
+
message: MESSAGE$6,
|
|
13706
13706
|
offsetsOf: queueOffsetsOf
|
|
13707
13707
|
});
|
|
13708
13708
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
13709
|
-
const RULE$
|
|
13709
|
+
const RULE$20 = "workflow-commit";
|
|
13710
13710
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
13711
13711
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
13712
|
-
const MESSAGE$
|
|
13712
|
+
const MESSAGE$5 = "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.";
|
|
13713
13713
|
const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source), Array.filter(({ value }) => isScalar(value) && typeof value.value === "string" && pattern.test(value.value)), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([start]) => start), Option.toArray)));
|
|
13714
13714
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
13715
13715
|
/** @internal */
|
|
13716
13716
|
const checkWorkflowCommits = workflowCheck({
|
|
13717
|
-
rule: RULE$
|
|
13718
|
-
message: MESSAGE$
|
|
13717
|
+
rule: RULE$20,
|
|
13718
|
+
message: MESSAGE$5,
|
|
13719
13719
|
offsetsOf: commitOffsetsOf
|
|
13720
13720
|
});
|
|
13721
13721
|
// src/features/check-workflows/model/workflow-lint.ts
|
|
@@ -13825,7 +13825,7 @@ const COMMENT_NODES = [
|
|
|
13825
13825
|
"block_comment",
|
|
13826
13826
|
"multiline_comment"
|
|
13827
13827
|
];
|
|
13828
|
-
const START$
|
|
13828
|
+
const START$14 = 0;
|
|
13829
13829
|
const NEXT = 1;
|
|
13830
13830
|
const NONE = [];
|
|
13831
13831
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -13875,7 +13875,7 @@ const markupComment = (source) => (node) => {
|
|
|
13875
13875
|
}];
|
|
13876
13876
|
};
|
|
13877
13877
|
const textComments = (grammars, grammar) => (text) => {
|
|
13878
|
-
const shift = shifted(text.startIndex ?? START$
|
|
13878
|
+
const shift = shifted(text.startIndex ?? START$14);
|
|
13879
13879
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
|
|
13880
13880
|
};
|
|
13881
13881
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -13941,17 +13941,17 @@ const shebangReader = (source) => {
|
|
|
13941
13941
|
};
|
|
13942
13942
|
const readerOf = (name) => (source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
|
|
13943
13943
|
// src/features/ban-comments/model/comments.ts
|
|
13944
|
-
const RULE$
|
|
13944
|
+
const RULE$19 = "comment";
|
|
13945
13945
|
const UNUSED_RULE$1 = "unused-comment-allowance";
|
|
13946
13946
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
13947
13947
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
13948
13948
|
const READ_CONCURRENCY$8 = 64;
|
|
13949
|
-
const START$
|
|
13949
|
+
const START$13 = 0;
|
|
13950
13950
|
const SHEBANG = "#!";
|
|
13951
13951
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
13952
13952
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
13953
13953
|
const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
|
|
13954
|
-
const MESSAGE$
|
|
13954
|
+
const MESSAGE$4 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
|
|
13955
13955
|
const Patterns = Schema.Array(Schema.String);
|
|
13956
13956
|
const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
13957
13957
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
@@ -13968,11 +13968,11 @@ const taggedError$2 = Schema.TaggedError;
|
|
|
13968
13968
|
var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
13969
13969
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
13970
13970
|
const lineBefore = (source, index) => {
|
|
13971
|
-
const lines = pipe(source, String$1.slice(START$
|
|
13971
|
+
const lines = pipe(source, String$1.slice(START$13, index), String$1.split("\n"));
|
|
13972
13972
|
return Option.getOrElse(Array.last(lines), () => "");
|
|
13973
13973
|
};
|
|
13974
13974
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
13975
|
-
const isShebang = ({ index, text }) => index === START$
|
|
13975
|
+
const isShebang = ({ index, text }) => index === START$13 && String$1.startsWith(SHEBANG)(text);
|
|
13976
13976
|
const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
|
|
13977
13977
|
const NOTHING = {
|
|
13978
13978
|
problems: [],
|
|
@@ -13982,8 +13982,8 @@ const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but n
|
|
|
13982
13982
|
const problemOf$1 = (file, source) => ({ index }) => ({
|
|
13983
13983
|
file,
|
|
13984
13984
|
...positionOf(source)(index),
|
|
13985
|
-
rule: RULE$
|
|
13986
|
-
message: MESSAGE$
|
|
13985
|
+
rule: RULE$19,
|
|
13986
|
+
message: MESSAGE$4
|
|
13987
13987
|
});
|
|
13988
13988
|
const settingsOf = ({ msch, lint }) => ({
|
|
13989
13989
|
allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
@@ -14019,7 +14019,7 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, sett
|
|
|
14019
14019
|
})), Array.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
14020
14020
|
});
|
|
14021
14021
|
const usedAllowances = (allowances, found) => pipe(allowances, Array.map((pattern, index) => [pattern, index]), Array.filter(([pattern]) => pipe(found, Array.some((comment) => pattern.test(valueOf(comment.text))))), Array.map(([, index]) => index));
|
|
14022
|
-
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$
|
|
14022
|
+
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$13));
|
|
14023
14023
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
14024
14024
|
const files = yield* RepositoryFiles;
|
|
14025
14025
|
const file = files.join(root, CONFIG_FILE$2);
|
|
@@ -14041,7 +14041,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
14041
14041
|
problems: pipe(found, Array.filter(kept), Array.map(toProblem)),
|
|
14042
14042
|
used: usedAllowances(allowances, found)
|
|
14043
14043
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
14044
|
-
problems: [problemInFile(RULE$
|
|
14044
|
+
problems: [problemInFile(RULE$19)(file, `msch could not read the comments in this file: ${message}`)],
|
|
14045
14045
|
used: []
|
|
14046
14046
|
})))
|
|
14047
14047
|
});
|
|
@@ -14154,7 +14154,7 @@ const PYTHON = {
|
|
|
14154
14154
|
/** @internal */
|
|
14155
14155
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
14156
14156
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
14157
|
-
const RULE$
|
|
14157
|
+
const RULE$18 = "uncataloged-dependency";
|
|
14158
14158
|
const OWNED_ELSEWHERE = [
|
|
14159
14159
|
"catalog:",
|
|
14160
14160
|
"workspace:",
|
|
@@ -14163,13 +14163,13 @@ const OWNED_ELSEWHERE = [
|
|
|
14163
14163
|
];
|
|
14164
14164
|
const ROOT_DIRECTORY$2 = ".";
|
|
14165
14165
|
const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
|
|
14166
|
-
const MESSAGE$
|
|
14166
|
+
const MESSAGE$3 = "is a version written in this package.json. Add it to the catalog in pnpm-workspace.yaml and write `catalog:` here, so that one entry owns the version and every package that uses the dependency moves together.";
|
|
14167
14167
|
const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array.some((protocol) => String$1.startsWith(protocol)(specifier)));
|
|
14168
|
-
const problemsIn$
|
|
14168
|
+
const problemsIn$9 = (entry, source) => pipe(manifestSpecifiers(source), Array.filter((found) => !isOwnedElsewhere(found)), Array.map((found) => ({
|
|
14169
14169
|
file: entry.file,
|
|
14170
14170
|
...positionOf(source)(offsetIn$1(source)(manifestPattern(found))),
|
|
14171
|
-
rule: RULE$
|
|
14172
|
-
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$
|
|
14171
|
+
rule: RULE$18,
|
|
14172
|
+
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$3}`
|
|
14173
14173
|
})));
|
|
14174
14174
|
/** @internal */
|
|
14175
14175
|
const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* uncatalogedDependencies(root) {
|
|
@@ -14183,7 +14183,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
14183
14183
|
file: files.join(root, name)
|
|
14184
14184
|
};
|
|
14185
14185
|
}));
|
|
14186
|
-
return yield* scanText(listed, problemsIn$
|
|
14186
|
+
return yield* scanText(listed, problemsIn$9);
|
|
14187
14187
|
});
|
|
14188
14188
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
14189
14189
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
@@ -14281,7 +14281,7 @@ const CONFIG_FILE$1 = "vite.config.ts";
|
|
|
14281
14281
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
14282
14282
|
const SOURCE = "masseater/skills";
|
|
14283
14283
|
const PRESET$1 = "github>masseater/ecosystems//libs/vite-plus-adopt/renovate";
|
|
14284
|
-
const START$
|
|
14284
|
+
const START$12 = 0;
|
|
14285
14285
|
const LOCAL_PREFIX = "./";
|
|
14286
14286
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
14287
14287
|
const Source = Schema.Struct({
|
|
@@ -14294,7 +14294,7 @@ const taggedError$1 = Schema.TaggedError;
|
|
|
14294
14294
|
var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
14295
14295
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
14296
14296
|
file,
|
|
14297
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
14297
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$12))),
|
|
14298
14298
|
rule,
|
|
14299
14299
|
message
|
|
14300
14300
|
});
|
|
@@ -14341,14 +14341,14 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
14341
14341
|
];
|
|
14342
14342
|
});
|
|
14343
14343
|
// src/features/check-skills/model/published-skills.ts
|
|
14344
|
-
const RULE$
|
|
14344
|
+
const RULE$17 = "published-skills";
|
|
14345
14345
|
const KEYWORD = "tanstack-intent";
|
|
14346
14346
|
const SKILLS = "skills";
|
|
14347
14347
|
const MANIFEST_FILE = "package.json";
|
|
14348
14348
|
const SKILL_FILE$1 = "SKILL.md";
|
|
14349
14349
|
const SUCCEEDED = 0;
|
|
14350
14350
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
14351
|
-
const problemAt$2 = problemInFile(RULE$
|
|
14351
|
+
const problemAt$2 = problemInFile(RULE$17);
|
|
14352
14352
|
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))));
|
|
14353
14353
|
const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
|
|
14354
14354
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -14369,7 +14369,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
|
|
|
14369
14369
|
const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
|
|
14370
14370
|
return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
|
|
14371
14371
|
}, Effect.scoped);
|
|
14372
|
-
const problemsIn$
|
|
14372
|
+
const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
|
|
14373
14373
|
const files = yield* RepositoryFiles;
|
|
14374
14374
|
const directory = files.join(root, project.directory);
|
|
14375
14375
|
const manifest = files.join(directory, MANIFEST_FILE);
|
|
@@ -14381,15 +14381,15 @@ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, project)
|
|
|
14381
14381
|
/** @internal */
|
|
14382
14382
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
14383
14383
|
const projects = yield* publishedProjects(root);
|
|
14384
|
-
const problems = yield* Effect.forEach(projects, (project) => problemsIn$
|
|
14384
|
+
const problems = yield* Effect.forEach(projects, (project) => problemsIn$8(root, project), { concurrency: 1 });
|
|
14385
14385
|
return Array.flatten(problems);
|
|
14386
14386
|
});
|
|
14387
14387
|
// src/features/check-skills/model/skill-files.ts
|
|
14388
|
-
const RULE$
|
|
14388
|
+
const RULE$16 = "skill-file";
|
|
14389
14389
|
const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
|
|
14390
14390
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
14391
14391
|
const FIXTURE = /(?:^|\/)fixtures\//u;
|
|
14392
|
-
const MARKDOWN = ".md";
|
|
14392
|
+
const MARKDOWN$1 = ".md";
|
|
14393
14393
|
const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
|
|
14394
14394
|
const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
|
|
14395
14395
|
const HEADING = /^# (?<title>.+)$/mu;
|
|
@@ -14403,7 +14403,7 @@ const GITHUB = "https://github.com/";
|
|
|
14403
14403
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
14404
14404
|
const BLANK = /\s+/u;
|
|
14405
14405
|
const SEPARATOR$2 = "/";
|
|
14406
|
-
const START$
|
|
14406
|
+
const START$11 = 0;
|
|
14407
14407
|
const FIRST$3 = 1;
|
|
14408
14408
|
const READ_CONCURRENCY$6 = 16;
|
|
14409
14409
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -14413,9 +14413,9 @@ const Frontmatter = Schema.Struct({
|
|
|
14413
14413
|
metadata: Schema.optional(Metadata)
|
|
14414
14414
|
});
|
|
14415
14415
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
14416
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$
|
|
14416
|
+
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$11));
|
|
14417
14417
|
const frontmatterOf = (source) => pipe(groupOf("yaml")(FRONTMATTER.exec(source)), Option.flatMap(Option.liftThrowable((yaml) => parse$2(yaml))), Option.flatMap(decodeFrontmatter));
|
|
14418
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$
|
|
14418
|
+
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$11].length), Option.getOrElse(() => START$11));
|
|
14419
14419
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
14420
14420
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
14421
14421
|
const bodyStart = bodyStartOf(source);
|
|
@@ -14443,16 +14443,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
14443
14443
|
]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
|
|
14444
14444
|
file: skill.file,
|
|
14445
14445
|
...positionOf(skill.source)(index),
|
|
14446
|
-
rule: RULE$
|
|
14446
|
+
rule: RULE$16,
|
|
14447
14447
|
message
|
|
14448
14448
|
})));
|
|
14449
14449
|
const linkOf = (found) => pipe(groupOf("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
|
|
14450
14450
|
target,
|
|
14451
|
-
index: found.index ?? START$
|
|
14451
|
+
index: found.index ?? START$11
|
|
14452
14452
|
})), Option.toArray);
|
|
14453
14453
|
const rangeOf$1 = (found) => {
|
|
14454
|
-
const start = found.index ?? START$
|
|
14455
|
-
return [start, start + found[START$
|
|
14454
|
+
const start = found.index ?? START$11;
|
|
14455
|
+
return [start, start + found[START$11].length];
|
|
14456
14456
|
};
|
|
14457
14457
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
|
|
14458
14458
|
const linksIn$1 = (source) => {
|
|
@@ -14470,23 +14470,23 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
14470
14470
|
return pipe(missing, Array.map(({ target, index }) => ({
|
|
14471
14471
|
file,
|
|
14472
14472
|
...positionOf(source)(index),
|
|
14473
|
-
rule: RULE$
|
|
14473
|
+
rule: RULE$16,
|
|
14474
14474
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
14475
14475
|
})));
|
|
14476
14476
|
});
|
|
14477
|
-
const problemsIn$
|
|
14477
|
+
const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
|
|
14478
14478
|
const files = yield* RepositoryFiles;
|
|
14479
14479
|
const file = files.join(root, name);
|
|
14480
14480
|
const directory = files.dirname(name);
|
|
14481
14481
|
const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$2}`)));
|
|
14482
14482
|
const text = yield* files.readFile(file);
|
|
14483
|
-
const documents = pipe(inside, Array.filter(String$1.endsWith(MARKDOWN)), Array.map((entry) => files.join(root, entry)));
|
|
14483
|
+
const documents = pipe(inside, Array.filter(String$1.endsWith(MARKDOWN$1)), Array.map((entry) => files.join(root, entry)));
|
|
14484
14484
|
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$6 });
|
|
14485
14485
|
const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
|
|
14486
14486
|
file: files.join(root, entry),
|
|
14487
14487
|
line: FIRST$3,
|
|
14488
14488
|
column: FIRST$3,
|
|
14489
|
-
rule: RULE$
|
|
14489
|
+
rule: RULE$16,
|
|
14490
14490
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
14491
14491
|
})));
|
|
14492
14492
|
return [
|
|
@@ -14503,7 +14503,7 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
14503
14503
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
14504
14504
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
14505
14505
|
const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name) && !FIXTURE.test(name)));
|
|
14506
|
-
const found = yield* Effect.forEach(skills, (name) => problemsIn$
|
|
14506
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$7(root, listed, name), { concurrency: READ_CONCURRENCY$6 });
|
|
14507
14507
|
return Array.flatten(found);
|
|
14508
14508
|
});
|
|
14509
14509
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -14564,7 +14564,7 @@ const cargoEntries = (text) => {
|
|
|
14564
14564
|
};
|
|
14565
14565
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
14566
14566
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
14567
|
-
const RULE$
|
|
14567
|
+
const RULE$15 = "version-downgrade";
|
|
14568
14568
|
const READ_CONCURRENCY$5 = 16;
|
|
14569
14569
|
const READERS = [
|
|
14570
14570
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
@@ -14589,7 +14589,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
14589
14589
|
file,
|
|
14590
14590
|
line: lineOf(text, entry),
|
|
14591
14591
|
column: FIRST_LINE$2,
|
|
14592
|
-
rule: RULE$
|
|
14592
|
+
rule: RULE$15,
|
|
14593
14593
|
message: message$1(old, entry)
|
|
14594
14594
|
})), Option.toArray)));
|
|
14595
14595
|
};
|
|
@@ -14620,13 +14620,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
14620
14620
|
const CAP_RULE = "renovate-version-cap";
|
|
14621
14621
|
const PRESET_RULE = "renovate-msch-preset";
|
|
14622
14622
|
const PRESET = "github>masseater/ecosystems//libs/msch/renovate";
|
|
14623
|
-
const START$
|
|
14623
|
+
const START$10 = 0;
|
|
14624
14624
|
const READ_CONCURRENCY$4 = 16;
|
|
14625
14625
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
14626
14626
|
const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
|
|
14627
14627
|
const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
14628
14628
|
const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
|
|
14629
|
-
const problemsIn$
|
|
14629
|
+
const problemsIn$6 = (file, source) => {
|
|
14630
14630
|
const at = positionOf(source);
|
|
14631
14631
|
const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
|
|
14632
14632
|
file,
|
|
@@ -14639,7 +14639,7 @@ const problemsIn$5 = (file, source) => {
|
|
|
14639
14639
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
14640
14640
|
...pipe([{
|
|
14641
14641
|
file,
|
|
14642
|
-
...at(START$
|
|
14642
|
+
...at(START$10),
|
|
14643
14643
|
rule: PRESET_RULE,
|
|
14644
14644
|
message: PRESET_MESSAGE
|
|
14645
14645
|
}], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
|
|
@@ -14653,13 +14653,13 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
14653
14653
|
const file = files.join(root, name);
|
|
14654
14654
|
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
14655
14655
|
onNone: () => [],
|
|
14656
|
-
onSome: (source) => problemsIn$
|
|
14656
|
+
onSome: (source) => problemsIn$6(file, source)
|
|
14657
14657
|
})));
|
|
14658
14658
|
}, { concurrency: READ_CONCURRENCY$4 });
|
|
14659
14659
|
return Array.flatten(found);
|
|
14660
14660
|
});
|
|
14661
14661
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
14662
|
-
const RULE$
|
|
14662
|
+
const RULE$14 = "unbumped-package";
|
|
14663
14663
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
14664
14664
|
const UNVERSIONED = "0.0.0";
|
|
14665
14665
|
const FIRST_LINE$1 = 1;
|
|
@@ -14716,51 +14716,16 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
14716
14716
|
file: files.join(root, pack.file),
|
|
14717
14717
|
line: versionLine(pack.text),
|
|
14718
14718
|
column: FIRST_COLUMN$1,
|
|
14719
|
-
rule: RULE$
|
|
14719
|
+
rule: RULE$14,
|
|
14720
14720
|
message: message(pack, lowest)
|
|
14721
14721
|
})), Option.toArray);
|
|
14722
14722
|
}), { concurrency: READ_CONCURRENCY$3 });
|
|
14723
14723
|
return Array.flatten(found);
|
|
14724
14724
|
});
|
|
14725
|
-
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
14726
|
-
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
14727
|
-
const NUL = "\0";
|
|
14728
|
-
const START$8 = 0;
|
|
14729
|
-
const HEX = 16;
|
|
14730
|
-
const CODE_POINT_WIDTH = 4;
|
|
14731
|
-
const READ_CONCURRENCY$2 = 64;
|
|
14732
|
-
const RULE$12 = "hidden-unicode";
|
|
14733
|
-
const hexOf = (character) => pipe(String$1.codePointAt(START$8)(character), Option.getOrElse(() => START$8), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
|
|
14734
|
-
const problemOf = (file, source) => (found) => {
|
|
14735
|
-
const hex = hexOf(found[START$8]);
|
|
14736
|
-
return {
|
|
14737
|
-
file,
|
|
14738
|
-
...positionOf(source)(found.index ?? START$8),
|
|
14739
|
-
rule: RULE$12,
|
|
14740
|
-
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}.`
|
|
14741
|
-
};
|
|
14742
|
-
};
|
|
14743
|
-
const problemsIn$4 = (file, source) => {
|
|
14744
|
-
if (String$1.includes(NUL)(source)) return [];
|
|
14745
|
-
return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf(file, source)));
|
|
14746
|
-
};
|
|
14747
|
-
/** @internal */
|
|
14748
|
-
const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
|
|
14749
|
-
const files = yield* RepositoryFiles;
|
|
14750
|
-
const names = yield* files.listedFiles(root);
|
|
14751
|
-
const found = yield* Effect.forEach(names, (name) => {
|
|
14752
|
-
const file = files.join(root, name);
|
|
14753
|
-
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
14754
|
-
onNone: () => [],
|
|
14755
|
-
onSome: (source) => problemsIn$4(file, source)
|
|
14756
|
-
})));
|
|
14757
|
-
}, { concurrency: READ_CONCURRENCY$2 });
|
|
14758
|
-
return Array.flatten(found);
|
|
14759
|
-
});
|
|
14760
14725
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
14761
14726
|
const MSCH = "@r_masseater/msch";
|
|
14762
14727
|
const SCOPE$1 = "@r_masseater/";
|
|
14763
|
-
const RULE$
|
|
14728
|
+
const RULE$13 = "applied-package";
|
|
14764
14729
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
14765
14730
|
const NOT_FOUND = -1;
|
|
14766
14731
|
const SEPARATOR$1 = "/";
|
|
@@ -14805,7 +14770,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
14805
14770
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
14806
14771
|
file,
|
|
14807
14772
|
...positionOf(source)(index),
|
|
14808
|
-
rule: RULE$
|
|
14773
|
+
rule: RULE$13,
|
|
14809
14774
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
14810
14775
|
});
|
|
14811
14776
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
@@ -14860,7 +14825,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
14860
14825
|
return yield* appliedPackageProblems(root, applied);
|
|
14861
14826
|
});
|
|
14862
14827
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
14863
|
-
const RULE$
|
|
14828
|
+
const RULE$12 = "replaced-tool";
|
|
14864
14829
|
const FIRST$2 = 1;
|
|
14865
14830
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
14866
14831
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -14941,7 +14906,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ patte
|
|
|
14941
14906
|
file,
|
|
14942
14907
|
line: FIRST$2,
|
|
14943
14908
|
column: FIRST$2,
|
|
14944
|
-
rule: RULE$
|
|
14909
|
+
rule: RULE$12,
|
|
14945
14910
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
14946
14911
|
})));
|
|
14947
14912
|
/** @internal */
|
|
@@ -14975,7 +14940,7 @@ const SETUP_PATTERNS = [
|
|
|
14975
14940
|
];
|
|
14976
14941
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
14977
14942
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
14978
|
-
const START$
|
|
14943
|
+
const START$9 = 0;
|
|
14979
14944
|
const LAST_SEGMENT = 1;
|
|
14980
14945
|
const FIRST_LINE = 1;
|
|
14981
14946
|
const FIRST_COLUMN = 1;
|
|
@@ -15044,7 +15009,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
15044
15009
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
15045
15010
|
return directoriesOf(roots);
|
|
15046
15011
|
});
|
|
15047
|
-
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$
|
|
15012
|
+
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$9), (end) => String$1.slice(START$9, end)(name));
|
|
15048
15013
|
const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
|
|
15049
15014
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
15050
15015
|
const cargoProblems = (present, enabled) => {
|
|
@@ -15079,6 +15044,89 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
15079
15044
|
if (Option.isNone(workspace)) return [];
|
|
15080
15045
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
15081
15046
|
});
|
|
15047
|
+
// src/features/check-markdown-directives/model/directives.ts
|
|
15048
|
+
const RULE$11 = "markdown-directive";
|
|
15049
|
+
const START$8 = 0;
|
|
15050
|
+
const SECOND = 1;
|
|
15051
|
+
const ODD = 1;
|
|
15052
|
+
const PAIR = 2;
|
|
15053
|
+
const MARKDOWN = ".md";
|
|
15054
|
+
const SKIPPED_DIRECTORIES = [
|
|
15055
|
+
".agents/skills/",
|
|
15056
|
+
"/fixtures/",
|
|
15057
|
+
"/upstream/"
|
|
15058
|
+
];
|
|
15059
|
+
const SKIPPED_FILES = ["CHANGELOG.md", "CLAUDE.md"];
|
|
15060
|
+
const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-disable(?:-next-line|-line|-file)?(?<rest>(?:\s[\s\S]*?)?)-->/giu;
|
|
15061
|
+
const FENCE = /^\s{0,3}(?:`{3,}|~{3,})/u;
|
|
15062
|
+
const BACKTICK = /`/gu;
|
|
15063
|
+
const DESCRIPTION = / -- .*/u;
|
|
15064
|
+
const SEPARATORS = /[\s,]+/u;
|
|
15065
|
+
const MESSAGE$2 = "Name the rules this comment disables, as in `<!-- y8-disable MD033 -->`. A comment with no rule name stops every rule, so it also hides violations that are added later.";
|
|
15066
|
+
const fenceStep = (inside, line) => Match.value(FENCE.test(line)).pipe(Match.when(true, () => [!inside, true]), Match.orElse(() => [inside, inside]));
|
|
15067
|
+
const insideCodeSpan = (before) => Array.fromIterable(String$1.matchAll(BACKTICK)(before)).length % PAIR === ODD;
|
|
15068
|
+
const namedRules = (rest) => pipe(rest, String$1.replace(DESCRIPTION, ""), String$1.split(SEPARATORS), Array.filter(String$1.isNonEmpty));
|
|
15069
|
+
const restOf = (found) => pipe(Option.fromNullishOr(found.groups), Option.flatMap(Record.get("rest")), Option.getOrElse(() => ""));
|
|
15070
|
+
const problemsIn$5 = (file, source) => {
|
|
15071
|
+
const lines = String$1.split("\n")(source);
|
|
15072
|
+
const fenced = Array.mapAccum(lines, false, fenceStep)[SECOND];
|
|
15073
|
+
const isCode = (index) => {
|
|
15074
|
+
const { line, column } = positionOf(source)(index);
|
|
15075
|
+
return pipe(Array.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array.get(lines, line - SECOND), Option.map(String$1.slice(START$8, column - SECOND)), Option.exists(insideCodeSpan));
|
|
15076
|
+
};
|
|
15077
|
+
return pipe(Array.fromIterable(String$1.matchAll(DISABLE)(source)), Array.filter((match) => Array.isReadonlyArrayEmpty(namedRules(restOf(match)))), Array.filter((match) => !isCode(match.index ?? START$8)), Array.map((match) => problemAtIndex(RULE$11)(file, source)(match.index ?? START$8, MESSAGE$2)));
|
|
15078
|
+
};
|
|
15079
|
+
const isChecked = (name) => String$1.endsWith(MARKDOWN)(name) && !pipe(SKIPPED_DIRECTORIES, Array.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
|
|
15080
|
+
/** @internal */
|
|
15081
|
+
const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* checkMarkdownDirectives(root) {
|
|
15082
|
+
const files = yield* RepositoryFiles;
|
|
15083
|
+
const names = yield* files.listedFiles(root);
|
|
15084
|
+
return yield* scanText(pipe(names, Array.filter((name) => isChecked(name)), Array.map((name) => ({
|
|
15085
|
+
name,
|
|
15086
|
+
file: files.join(root, name)
|
|
15087
|
+
}))), ({ file }, source) => problemsIn$5(file, source));
|
|
15088
|
+
});
|
|
15089
|
+
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
15090
|
+
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
15091
|
+
const NUL = "\0";
|
|
15092
|
+
const START$7 = 0;
|
|
15093
|
+
const HEX = 16;
|
|
15094
|
+
const CODE_POINT_WIDTH = 4;
|
|
15095
|
+
const READ_CONCURRENCY$2 = 64;
|
|
15096
|
+
const RULE$10 = "hidden-unicode";
|
|
15097
|
+
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"));
|
|
15098
|
+
const problemOf = (file, source) => (found) => {
|
|
15099
|
+
const hex = hexOf(found[START$7]);
|
|
15100
|
+
return {
|
|
15101
|
+
file,
|
|
15102
|
+
...positionOf(source)(found.index ?? START$7),
|
|
15103
|
+
rule: RULE$10,
|
|
15104
|
+
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}.`
|
|
15105
|
+
};
|
|
15106
|
+
};
|
|
15107
|
+
const problemsIn$4 = (file, source) => {
|
|
15108
|
+
if (String$1.includes(NUL)(source)) return [];
|
|
15109
|
+
return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf(file, source)));
|
|
15110
|
+
};
|
|
15111
|
+
/** @internal */
|
|
15112
|
+
const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
|
|
15113
|
+
const files = yield* RepositoryFiles;
|
|
15114
|
+
const names = yield* files.listedFiles(root);
|
|
15115
|
+
const found = yield* Effect.forEach(names, (name) => {
|
|
15116
|
+
const file = files.join(root, name);
|
|
15117
|
+
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
15118
|
+
onNone: () => [],
|
|
15119
|
+
onSome: (source) => problemsIn$4(file, source)
|
|
15120
|
+
})));
|
|
15121
|
+
}, { concurrency: READ_CONCURRENCY$2 });
|
|
15122
|
+
return Array.flatten(found);
|
|
15123
|
+
});
|
|
15124
|
+
// src/app/document-checks.ts
|
|
15125
|
+
/** @internal */
|
|
15126
|
+
const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root) {
|
|
15127
|
+
const found = yield* Effect.all([checkHiddenUnicode(root), checkMarkdownDirectives(root)], { concurrency: "unbounded" });
|
|
15128
|
+
return Array.flatten(found);
|
|
15129
|
+
});
|
|
15082
15130
|
// src/features/check-effect-diagnostics/model/effect-diagnostics.ts
|
|
15083
15131
|
const RULE$9 = "effect-diagnostics-once";
|
|
15084
15132
|
const PLUGIN = "@effect/language-service";
|
|
@@ -15626,7 +15674,7 @@ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root
|
|
|
15626
15674
|
/** @internal */
|
|
15627
15675
|
const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedText(root) {
|
|
15628
15676
|
const found = yield* Effect.all([
|
|
15629
|
-
|
|
15677
|
+
checkDocuments(root),
|
|
15630
15678
|
checkPython(root),
|
|
15631
15679
|
checkDocker(root),
|
|
15632
15680
|
checkUnneededFiles(root),
|