@r_masseater/msch 0.76.0 → 0.77.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/changed.mjs +1 -1
- package/dist/cli.mjs +209 -159
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +7 -7
- package/dist/config.mjs.map +1 -1
- package/dist/exits.mjs +1 -1
- package/dist/lint-rules.mjs +2 -2
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{pass-records-DylVXWk1.mjs → pass-records-D5HYFQWz.mjs} +2 -2
- package/dist/{pass-records-DylVXWk1.mjs.map → pass-records-D5HYFQWz.mjs.map} +1 -1
- package/dist/{problem-Ciud2WGj.mjs → problem-aeeiOlaz.mjs} +2 -2
- package/dist/{problem-Ciud2WGj.mjs.map → problem-aeeiOlaz.mjs.map} +1 -1
- package/dist/{syntax-Dx4HQIK-.mjs → syntax-CbxAKkqt.mjs} +4 -4
- package/dist/{syntax-Dx4HQIK-.mjs.map → syntax-CbxAKkqt.mjs.map} +1 -1
- package/dist/{upstream-exits-Clnl4-G5.mjs → upstream-exits-CiX81Owg.mjs} +2 -2
- package/dist/{upstream-exits-Clnl4-G5.mjs.map → upstream-exits-CiX81Owg.mjs.map} +1 -1
- package/package.json +7 -7
package/dist/cli.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as workspaceManifest } from "./workspace-manifest-CAVYfp66.mjs";
|
|
3
|
-
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-
|
|
3
|
+
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-D5HYFQWz.mjs";
|
|
4
4
|
import { a as groupOf, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-C2gVviac.mjs";
|
|
5
|
-
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-
|
|
5
|
+
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-CiX81Owg.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
|
|
7
7
|
import { a as unmatchedWorkspacePatterns, i as publishedProjects, n as readManifest, o as workspaceDirectories, s as workspaceProjects } from "./dependencies-BAjtDvY4.mjs";
|
|
8
|
-
import { a as problemAtPosition, i as problemAt$7, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-
|
|
8
|
+
import { a as problemAtPosition, i as problemAt$7, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-aeeiOlaz.mjs";
|
|
9
9
|
import { A as keyName, D as workspaceConfigOf, M as nestedValues, N as propertyValue, O as KeySchema, P as stringsIn, _ as VERIFY_TASK, a as entryNameOf, d as deployEntries, g as RUN_TASKS, i as publishedWorkspaces, j as literalOf, k as childrenOf$1, l as workspaceLinks, o as isBinEntry, p as shadcnUiOf, r as packedWorkspaces, s as publicEntriesOf, u as bundledEntries, v as definesTask, y as hasVerifyTask } from "./published-C34bsbOH.mjs";
|
|
10
10
|
import { t as JAPANESE } from "./config-CvPuqi4L.mjs";
|
|
11
11
|
import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
|
|
12
|
-
import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-
|
|
12
|
+
import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-CbxAKkqt.mjs";
|
|
13
13
|
import { a as manifestPattern, c as offsetIn$1, i as fieldsOf, l as quoted$2, n as baseName$1, o as manifestSpecifiers, r as baseRevision, s as namedCatalogsOf, t as manifestTexts, u as specifiedIn } from "./manifest-texts-CfnH7ifu.mjs";
|
|
14
14
|
import { n as writeStdout, t as ProblemsFound } from "./output-DrM4OsOJ.mjs";
|
|
15
15
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
@@ -498,7 +498,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
498
498
|
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
499
499
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
500
500
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
501
|
-
const READ_CONCURRENCY$
|
|
501
|
+
const READ_CONCURRENCY$36 = 64;
|
|
502
502
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
503
503
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
504
504
|
/** @internal */
|
|
@@ -521,18 +521,18 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
|
|
|
521
521
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
522
522
|
onNone: () => [],
|
|
523
523
|
onSome: (source) => problemsIn(entry, source)
|
|
524
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
524
|
+
}))), { concurrency: READ_CONCURRENCY$36 });
|
|
525
525
|
return Array$1.flatten(found);
|
|
526
526
|
});
|
|
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$69 = "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$69,
|
|
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
538
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$6(entry, source)));
|
|
@@ -543,13 +543,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
543
543
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$23);
|
|
544
544
|
});
|
|
545
545
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
546
|
-
const RULE$
|
|
546
|
+
const RULE$68 = "unnamed-restriction";
|
|
547
547
|
const WHOLE_MATCH$3 = 0;
|
|
548
548
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
549
549
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
550
550
|
file: entry.file,
|
|
551
551
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
552
|
-
rule: RULE$
|
|
552
|
+
rule: RULE$68,
|
|
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 */
|
|
@@ -558,13 +558,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
558
558
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
|
|
559
559
|
});
|
|
560
560
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
561
|
-
const RULE$
|
|
561
|
+
const RULE$67 = "named-type-exemption";
|
|
562
562
|
const WHOLE_MATCH$2 = 0;
|
|
563
563
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
564
564
|
const problemsIn$21 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
565
565
|
file: entry.file,
|
|
566
566
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
567
|
-
rule: RULE$
|
|
567
|
+
rule: RULE$67,
|
|
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 */
|
|
@@ -573,7 +573,7 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
|
|
|
573
573
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$21);
|
|
574
574
|
});
|
|
575
575
|
// src/features/check-overrides/model/package-registry.ts
|
|
576
|
-
const RULE$
|
|
576
|
+
const RULE$66 = "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";
|
|
@@ -590,7 +590,7 @@ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ inde
|
|
|
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$66,
|
|
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}.`
|
|
@@ -599,7 +599,7 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
599
599
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isGuarded)), Array$1.map((found) => ({
|
|
600
600
|
file: entry.file,
|
|
601
601
|
...positionOf(source)(found.index ?? START$28),
|
|
602
|
-
rule: RULE$
|
|
602
|
+
rule: RULE$66,
|
|
603
603
|
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$28])}\`. Remove the line.`
|
|
604
604
|
})));
|
|
605
605
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -2726,7 +2726,7 @@ const matcher = (patterns) => {
|
|
|
2726
2726
|
String$1.startsWith(NEGATION$2);
|
|
2727
2727
|
String$1.slice(1);
|
|
2728
2728
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
2729
|
-
const RULE$
|
|
2729
|
+
const RULE$65 = "colocated-git-patterns";
|
|
2730
2730
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
2731
2731
|
const ROOT$3 = ".";
|
|
2732
2732
|
const NEGATION$1 = "!";
|
|
@@ -2736,8 +2736,8 @@ const FLOATING_PREFIX = `${ANY_DEPTH}/`;
|
|
|
2736
2736
|
const LEADING_SLASHES = /^\/+/u;
|
|
2737
2737
|
const TRAILING_SLASHES = /\/+$/u;
|
|
2738
2738
|
const SPACES = /\s+/u;
|
|
2739
|
-
const FIRST$
|
|
2740
|
-
const READ_CONCURRENCY$
|
|
2739
|
+
const FIRST$23 = 1;
|
|
2740
|
+
const READ_CONCURRENCY$35 = 16;
|
|
2741
2741
|
const withoutPrefix = (prefix, text) => {
|
|
2742
2742
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
2743
2743
|
return text;
|
|
@@ -2761,7 +2761,7 @@ const entryOf$1 = (file, kind, directory) => (line, index) => {
|
|
|
2761
2761
|
file,
|
|
2762
2762
|
kind,
|
|
2763
2763
|
directory,
|
|
2764
|
-
line: index + FIRST$
|
|
2764
|
+
line: index + FIRST$23,
|
|
2765
2765
|
pattern,
|
|
2766
2766
|
values: Array$1.join(values, " ")
|
|
2767
2767
|
});
|
|
@@ -2773,12 +2773,12 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
2773
2773
|
const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
|
|
2774
2774
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
2775
2775
|
});
|
|
2776
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
2776
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$65)(entry.file, {
|
|
2777
2777
|
line: entry.line,
|
|
2778
|
-
column: FIRST$
|
|
2778
|
+
column: FIRST$23
|
|
2779
2779
|
}, message);
|
|
2780
2780
|
const misplacedMessage = (kind, workspaces) => {
|
|
2781
|
-
if (workspaces.length === FIRST$
|
|
2781
|
+
if (workspaces.length === FIRST$23) {
|
|
2782
2782
|
const workspace = Array$1.join(workspaces, "");
|
|
2783
2783
|
return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
|
|
2784
2784
|
}
|
|
@@ -2828,10 +2828,10 @@ const repeated = (entries) => (entry) => {
|
|
|
2828
2828
|
/** @internal */
|
|
2829
2829
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
2830
2830
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
2831
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$
|
|
2831
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$35 });
|
|
2832
2832
|
const entries = Array$1.flatten(read);
|
|
2833
2833
|
const workspaces = yield* workspaceDirectories(root);
|
|
2834
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
2834
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$35 });
|
|
2835
2835
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
2836
2836
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
2837
2837
|
});
|
|
@@ -2855,9 +2855,9 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
2855
2855
|
})), Option.getOrElse(() => [])));
|
|
2856
2856
|
});
|
|
2857
2857
|
// src/features/check-placement/model/colocated-tests.ts
|
|
2858
|
-
const RULE$
|
|
2859
|
-
const FIRST$
|
|
2860
|
-
const READ_CONCURRENCY$
|
|
2858
|
+
const RULE$64 = "colocated-test";
|
|
2859
|
+
const FIRST$22 = 1;
|
|
2860
|
+
const READ_CONCURRENCY$34 = 64;
|
|
2861
2861
|
const ROOT_SUBPATH$1 = ".";
|
|
2862
2862
|
const NAME_GROUP = "name";
|
|
2863
2863
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -2876,9 +2876,9 @@ const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test n
|
|
|
2876
2876
|
const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
2877
2877
|
const problemFor$9 = (test, message) => ({
|
|
2878
2878
|
file: test.file,
|
|
2879
|
-
line: FIRST$
|
|
2880
|
-
column: FIRST$
|
|
2881
|
-
rule: RULE$
|
|
2879
|
+
line: FIRST$22,
|
|
2880
|
+
column: FIRST$22,
|
|
2881
|
+
rule: RULE$64,
|
|
2882
2882
|
message: `${test.base} ${message}`
|
|
2883
2883
|
});
|
|
2884
2884
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
@@ -2941,12 +2941,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
2941
2941
|
directory: files.dirname(file)
|
|
2942
2942
|
};
|
|
2943
2943
|
}));
|
|
2944
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
2944
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$34 });
|
|
2945
2945
|
return Array$1.getSomes(found);
|
|
2946
2946
|
});
|
|
2947
2947
|
// src/shared/lib/agent-docs.ts
|
|
2948
2948
|
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
2949
|
-
const READ_CONCURRENCY$
|
|
2949
|
+
const READ_CONCURRENCY$33 = 16;
|
|
2950
2950
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
2951
2951
|
const files = yield* RepositoryFiles;
|
|
2952
2952
|
const listed = yield* files.listedFiles(root);
|
|
@@ -2955,32 +2955,32 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
2955
2955
|
const file = files.join(root, name);
|
|
2956
2956
|
const problemOf = Option.flatMap(problemIn(file));
|
|
2957
2957
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
2958
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
2958
|
+
}, { concurrency: READ_CONCURRENCY$33 });
|
|
2959
2959
|
return Array$1.getSomes(found);
|
|
2960
2960
|
});
|
|
2961
2961
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
2962
2962
|
const RECOMMENDED_LINES = 200;
|
|
2963
|
-
const FIRST$
|
|
2964
|
-
const RULE$
|
|
2963
|
+
const FIRST$21 = 1;
|
|
2964
|
+
const RULE$63 = "agent-docs-length";
|
|
2965
2965
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
2966
2966
|
const problemFor$8 = (file) => (lines) => {
|
|
2967
2967
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
2968
2968
|
return Option.some({
|
|
2969
2969
|
file,
|
|
2970
2970
|
line: 201,
|
|
2971
|
-
column: FIRST$
|
|
2972
|
-
rule: RULE$
|
|
2971
|
+
column: FIRST$21,
|
|
2972
|
+
rule: RULE$63,
|
|
2973
2973
|
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.`
|
|
2974
2974
|
});
|
|
2975
2975
|
};
|
|
2976
2976
|
/** @internal */
|
|
2977
2977
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
|
|
2978
2978
|
// src/features/check-placement/model/claude-link.ts
|
|
2979
|
-
const RULE$
|
|
2979
|
+
const RULE$62 = "claude-md-link";
|
|
2980
2980
|
const CLAUDE = "CLAUDE.md";
|
|
2981
2981
|
const AGENTS = "AGENTS.md";
|
|
2982
|
-
const FIRST$
|
|
2983
|
-
const READ_CONCURRENCY$
|
|
2982
|
+
const FIRST$20 = 1;
|
|
2983
|
+
const READ_CONCURRENCY$32 = 16;
|
|
2984
2984
|
const MESSAGE$18 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
2985
2985
|
/** @internal */
|
|
2986
2986
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -2993,21 +2993,21 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
2993
2993
|
const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
|
|
2994
2994
|
return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
|
|
2995
2995
|
file: path,
|
|
2996
|
-
line: FIRST$
|
|
2997
|
-
column: FIRST$
|
|
2998
|
-
rule: RULE$
|
|
2996
|
+
line: FIRST$20,
|
|
2997
|
+
column: FIRST$20,
|
|
2998
|
+
rule: RULE$62,
|
|
2999
2999
|
message: MESSAGE$18
|
|
3000
3000
|
})));
|
|
3001
3001
|
});
|
|
3002
3002
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3003
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3003
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$32 });
|
|
3004
3004
|
return Array$1.getSomes(found);
|
|
3005
3005
|
});
|
|
3006
3006
|
// src/features/check-placement/model/dangling-links.ts
|
|
3007
|
-
const RULE$
|
|
3007
|
+
const RULE$61 = "dangling-link";
|
|
3008
3008
|
const SEPARATOR$21 = "/";
|
|
3009
|
-
const FIRST$
|
|
3010
|
-
const READ_CONCURRENCY$
|
|
3009
|
+
const FIRST$19 = 1;
|
|
3010
|
+
const READ_CONCURRENCY$31 = 16;
|
|
3011
3011
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$21}`)(name);
|
|
3012
3012
|
/** @internal */
|
|
3013
3013
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -3018,18 +3018,18 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3018
3018
|
const link = yield* files.readLink(file);
|
|
3019
3019
|
return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array$1.some(holds(target)))), Option.map((target) => ({
|
|
3020
3020
|
file,
|
|
3021
|
-
line: FIRST$
|
|
3022
|
-
column: FIRST$
|
|
3023
|
-
rule: RULE$
|
|
3021
|
+
line: FIRST$19,
|
|
3022
|
+
column: FIRST$19,
|
|
3023
|
+
rule: RULE$61,
|
|
3024
3024
|
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.`
|
|
3025
3025
|
})));
|
|
3026
3026
|
});
|
|
3027
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3027
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$31 });
|
|
3028
3028
|
return Array$1.getSomes(found);
|
|
3029
3029
|
});
|
|
3030
3030
|
// src/features/check-placement/model/member-sources.ts
|
|
3031
3031
|
const ROOT_WORKSPACE$1 = ".";
|
|
3032
|
-
const FIRST$
|
|
3032
|
+
const FIRST$18 = 1;
|
|
3033
3033
|
const SEPARATOR$20 = "/";
|
|
3034
3034
|
const EXCLUDED$6 = [
|
|
3035
3035
|
":(exclude,attr:linguist-vendored)",
|
|
@@ -3050,8 +3050,8 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
|
|
|
3050
3050
|
const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3051
3051
|
const fileProblem$1 = ({ file, rule, message }) => ({
|
|
3052
3052
|
file,
|
|
3053
|
-
line: FIRST$
|
|
3054
|
-
column: FIRST$
|
|
3053
|
+
line: FIRST$18,
|
|
3054
|
+
column: FIRST$18,
|
|
3055
3055
|
rule,
|
|
3056
3056
|
message
|
|
3057
3057
|
});
|
|
@@ -3078,9 +3078,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3078
3078
|
}));
|
|
3079
3079
|
});
|
|
3080
3080
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3081
|
-
const RULE$
|
|
3081
|
+
const RULE$60 = "deployed-readme";
|
|
3082
3082
|
const ROOT_DIRECTORY$4 = "";
|
|
3083
|
-
const READ_CONCURRENCY$
|
|
3083
|
+
const READ_CONCURRENCY$30 = 16;
|
|
3084
3084
|
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.";
|
|
3085
3085
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3086
3086
|
const ADDRESS_KEYS = [
|
|
@@ -3118,14 +3118,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3118
3118
|
const readme = yield* readReadme({
|
|
3119
3119
|
root,
|
|
3120
3120
|
directory,
|
|
3121
|
-
rule: RULE$
|
|
3121
|
+
rule: RULE$60,
|
|
3122
3122
|
missingMessage: MISSING_MESSAGE$2
|
|
3123
3123
|
});
|
|
3124
3124
|
return Result.match(readme, {
|
|
3125
3125
|
onFailure: Option.some,
|
|
3126
3126
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3127
3127
|
file,
|
|
3128
|
-
rule: RULE$
|
|
3128
|
+
rule: RULE$60,
|
|
3129
3129
|
message: NO_URL_MESSAGE
|
|
3130
3130
|
})))
|
|
3131
3131
|
});
|
|
@@ -3136,16 +3136,16 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3136
3136
|
const listed = yield* files.listedFiles(root);
|
|
3137
3137
|
const directories = yield* workspaceDirectories(root);
|
|
3138
3138
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3139
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3139
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$30 });
|
|
3140
3140
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3141
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3141
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$30 });
|
|
3142
3142
|
return Array$1.getSomes(found);
|
|
3143
3143
|
});
|
|
3144
3144
|
// src/features/check-placement/model/nested-docs.ts
|
|
3145
|
-
const RULE$
|
|
3145
|
+
const RULE$59 = "nested-docs";
|
|
3146
3146
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
3147
3147
|
const SEPARATOR$19 = "/";
|
|
3148
|
-
const READ_CONCURRENCY$
|
|
3148
|
+
const READ_CONCURRENCY$29 = 64;
|
|
3149
3149
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3150
3150
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3151
3151
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -3155,7 +3155,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3155
3155
|
const taggedError$6 = Schema.TaggedError;
|
|
3156
3156
|
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3157
3157
|
const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
|
|
3158
|
-
const problemFor$7 = problemInFile(RULE$
|
|
3158
|
+
const problemFor$7 = problemInFile(RULE$59);
|
|
3159
3159
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3160
3160
|
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.";
|
|
3161
3161
|
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.";
|
|
@@ -3202,7 +3202,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3202
3202
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3203
3203
|
workspaceAgentDocs
|
|
3204
3204
|
};
|
|
3205
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3205
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$29 });
|
|
3206
3206
|
const missing = missingProblems({
|
|
3207
3207
|
required: workspaceAgentDocs,
|
|
3208
3208
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3212,15 +3212,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3212
3212
|
return [...Array$1.getSomes(found), ...missing];
|
|
3213
3213
|
});
|
|
3214
3214
|
// src/features/check-placement/model/published-readme.ts
|
|
3215
|
-
const RULE$
|
|
3216
|
-
const READ_CONCURRENCY$
|
|
3215
|
+
const RULE$58 = "published-readme";
|
|
3216
|
+
const READ_CONCURRENCY$28 = 16;
|
|
3217
3217
|
const MESSAGE$17 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3218
3218
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3219
3219
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3220
3220
|
const readme = yield* readReadme({
|
|
3221
3221
|
root,
|
|
3222
3222
|
directory,
|
|
3223
|
-
rule: RULE$
|
|
3223
|
+
rule: RULE$58,
|
|
3224
3224
|
missingMessage: MISSING_MESSAGE
|
|
3225
3225
|
});
|
|
3226
3226
|
return Result.match(readme, {
|
|
@@ -3231,7 +3231,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3231
3231
|
file,
|
|
3232
3232
|
line,
|
|
3233
3233
|
column,
|
|
3234
|
-
rule: RULE$
|
|
3234
|
+
rule: RULE$58,
|
|
3235
3235
|
message: MESSAGE$17
|
|
3236
3236
|
};
|
|
3237
3237
|
}))
|
|
@@ -3240,11 +3240,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3240
3240
|
/** @internal */
|
|
3241
3241
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3242
3242
|
const projects = yield* publishedProjects(root);
|
|
3243
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3243
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$28 });
|
|
3244
3244
|
return Array$1.getSomes(found);
|
|
3245
3245
|
});
|
|
3246
3246
|
// src/features/check-placement/model/published-tests.ts
|
|
3247
|
-
const RULE$
|
|
3247
|
+
const RULE$57 = "published-tests";
|
|
3248
3248
|
const FILE_START = 1;
|
|
3249
3249
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3250
3250
|
const MESSAGE$16 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3258,7 +3258,7 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3258
3258
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3259
3259
|
line: FILE_START,
|
|
3260
3260
|
column: FILE_START,
|
|
3261
|
-
rule: RULE$
|
|
3261
|
+
rule: RULE$57,
|
|
3262
3262
|
message: MESSAGE$16
|
|
3263
3263
|
});
|
|
3264
3264
|
});
|
|
@@ -3272,9 +3272,9 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3272
3272
|
return Array$1.getSomes(found);
|
|
3273
3273
|
});
|
|
3274
3274
|
// src/features/check-placement/model/root-docs.ts
|
|
3275
|
-
const RULE$
|
|
3275
|
+
const RULE$56 = "root-docs";
|
|
3276
3276
|
const SEPARATOR$18 = "/";
|
|
3277
|
-
const FIRST$
|
|
3277
|
+
const FIRST$17 = 1;
|
|
3278
3278
|
const MARKDOWN$2 = /\.(?:md|mdx|markdown)$/iu;
|
|
3279
3279
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3280
3280
|
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.";
|
|
@@ -3285,16 +3285,16 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3285
3285
|
const names = yield* files.listedFiles(root);
|
|
3286
3286
|
return pipe(names, Array$1.filter(isStrayRootDoc), Array$1.map((name) => ({
|
|
3287
3287
|
file: files.join(root, name),
|
|
3288
|
-
line: FIRST$
|
|
3289
|
-
column: FIRST$
|
|
3290
|
-
rule: RULE$
|
|
3288
|
+
line: FIRST$17,
|
|
3289
|
+
column: FIRST$17,
|
|
3290
|
+
rule: RULE$56,
|
|
3291
3291
|
message: `${name} ${MESSAGE$15}`
|
|
3292
3292
|
})));
|
|
3293
3293
|
});
|
|
3294
3294
|
// src/features/check-placement/model/root-readme.ts
|
|
3295
|
-
const RULE$
|
|
3295
|
+
const RULE$55 = "root-readme";
|
|
3296
3296
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3297
|
-
const READ_CONCURRENCY$
|
|
3297
|
+
const READ_CONCURRENCY$27 = 16;
|
|
3298
3298
|
const START$27 = 0;
|
|
3299
3299
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
3300
3300
|
const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
|
|
@@ -3336,7 +3336,7 @@ const problemsIn$20 = (file, source, plugins) => (workspace) => {
|
|
|
3336
3336
|
const message = messageFor$2(workspace.directory);
|
|
3337
3337
|
const at = positionOf(source);
|
|
3338
3338
|
const pattern = patternFor(plugins)(workspace);
|
|
3339
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
3339
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$55)(file, at(found.index ?? START$27), message)));
|
|
3340
3340
|
};
|
|
3341
3341
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
3342
3342
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -3353,7 +3353,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
3353
3353
|
const named = yield* namedWorkspaces(root);
|
|
3354
3354
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
3355
3355
|
const plugins = yield* marketplacePlugins(root);
|
|
3356
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
3356
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$27 });
|
|
3357
3357
|
return Array$1.flatten(found);
|
|
3358
3358
|
});
|
|
3359
3359
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -3373,10 +3373,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
3373
3373
|
return Array$1.flatten(found);
|
|
3374
3374
|
});
|
|
3375
3375
|
// src/features/check-placement/model/docs-mirror.ts
|
|
3376
|
-
const RULE$
|
|
3376
|
+
const RULE$54 = "docs-mirror";
|
|
3377
3377
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
3378
3378
|
const MIRROR_LIMIT = 3;
|
|
3379
|
-
const READ_CONCURRENCY$
|
|
3379
|
+
const READ_CONCURRENCY$26 = 16;
|
|
3380
3380
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
3381
3381
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
3382
3382
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -3398,7 +3398,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
3398
3398
|
file,
|
|
3399
3399
|
line,
|
|
3400
3400
|
column,
|
|
3401
|
-
rule: RULE$
|
|
3401
|
+
rule: RULE$54,
|
|
3402
3402
|
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.`
|
|
3403
3403
|
};
|
|
3404
3404
|
}), Option.toArray);
|
|
@@ -3413,7 +3413,7 @@ const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
3413
3413
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
3414
3414
|
directory,
|
|
3415
3415
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
3416
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
3416
|
+
}))), { concurrency: READ_CONCURRENCY$26 });
|
|
3417
3417
|
});
|
|
3418
3418
|
/** @internal */
|
|
3419
3419
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -3426,13 +3426,13 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
3426
3426
|
onNone: () => [],
|
|
3427
3427
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
3428
3428
|
})));
|
|
3429
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3429
|
+
}, { concurrency: READ_CONCURRENCY$26 });
|
|
3430
3430
|
return Array$1.flatten(found);
|
|
3431
3431
|
});
|
|
3432
3432
|
// src/features/check-placement/model/ignored-sources.ts
|
|
3433
|
-
const RULE$
|
|
3433
|
+
const RULE$53 = "ignored-sources";
|
|
3434
3434
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
3435
|
-
const FIRST$
|
|
3435
|
+
const FIRST$16 = 1;
|
|
3436
3436
|
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.";
|
|
3437
3437
|
/** @internal */
|
|
3438
3438
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
@@ -3440,9 +3440,9 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
3440
3440
|
const ignored = yield* files.ignoredFiles(root, SOURCES);
|
|
3441
3441
|
return pipe(ignored, Array$1.map((file) => ({
|
|
3442
3442
|
file: files.join(root, file),
|
|
3443
|
-
line: FIRST$
|
|
3444
|
-
column: FIRST$
|
|
3445
|
-
rule: RULE$
|
|
3443
|
+
line: FIRST$16,
|
|
3444
|
+
column: FIRST$16,
|
|
3445
|
+
rule: RULE$53,
|
|
3446
3446
|
message: MESSAGE$14
|
|
3447
3447
|
})));
|
|
3448
3448
|
});
|
|
@@ -12085,7 +12085,7 @@ const LAYER_ITEMS = [
|
|
|
12085
12085
|
"attribute_item",
|
|
12086
12086
|
"inner_attribute_item"
|
|
12087
12087
|
];
|
|
12088
|
-
const READ_CONCURRENCY$
|
|
12088
|
+
const READ_CONCURRENCY$25 = 64;
|
|
12089
12089
|
const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12090
12090
|
const NONE$1 = [];
|
|
12091
12091
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
@@ -12161,17 +12161,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12161
12161
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$1;
|
|
12162
12162
|
const language = yield* loadLanguage(GRAMMAR).pipe(Effect.orDie);
|
|
12163
12163
|
const parse = parsedWith(language);
|
|
12164
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
12164
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$25 });
|
|
12165
12165
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12166
12166
|
});
|
|
12167
12167
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12168
|
-
const RULE$
|
|
12169
|
-
const FIRST$
|
|
12168
|
+
const RULE$52 = "shadcn-ui-alias";
|
|
12169
|
+
const FIRST$15 = 1;
|
|
12170
12170
|
const problemOf$9 = (directory, { file, alias }) => ({
|
|
12171
12171
|
file,
|
|
12172
|
-
line: FIRST$
|
|
12173
|
-
column: FIRST$
|
|
12174
|
-
rule: RULE$
|
|
12172
|
+
line: FIRST$15,
|
|
12173
|
+
column: FIRST$15,
|
|
12174
|
+
rule: RULE$52,
|
|
12175
12175
|
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/*".`
|
|
12176
12176
|
});
|
|
12177
12177
|
/** @internal */
|
|
@@ -12234,8 +12234,8 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12234
12234
|
const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
12235
12235
|
const SEPARATOR$15 = "/";
|
|
12236
12236
|
const CURRENT = "./";
|
|
12237
|
-
const READ_CONCURRENCY$
|
|
12238
|
-
const FIRST$
|
|
12237
|
+
const READ_CONCURRENCY$24 = 8;
|
|
12238
|
+
const FIRST$14 = 1;
|
|
12239
12239
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12240
12240
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
12241
12241
|
const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
|
|
@@ -12275,7 +12275,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12275
12275
|
const files = yield* RepositoryFiles;
|
|
12276
12276
|
const listed = yield* files.listedFiles(root);
|
|
12277
12277
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
|
|
12278
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
12278
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$24 });
|
|
12279
12279
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12280
12280
|
});
|
|
12281
12281
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$15));
|
|
@@ -12302,8 +12302,8 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
12302
12302
|
const isRun = (path) => Array$1.contains(runPaths, path) || Array$1.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
|
|
12303
12303
|
const unrun = pipe(commands, Array$1.filter((path) => !isRun(path)), Array$1.map((path) => ({
|
|
12304
12304
|
file: files.join(root, directory, path),
|
|
12305
|
-
line: FIRST$
|
|
12306
|
-
column: FIRST$
|
|
12305
|
+
line: FIRST$14,
|
|
12306
|
+
column: FIRST$14,
|
|
12307
12307
|
rule: UNRUN,
|
|
12308
12308
|
message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
|
|
12309
12309
|
})));
|
|
@@ -12315,8 +12315,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
12315
12315
|
const isDirectory = yield* files.isDirectory(file);
|
|
12316
12316
|
return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
|
|
12317
12317
|
file,
|
|
12318
|
-
line: FIRST$
|
|
12319
|
-
column: FIRST$
|
|
12318
|
+
line: FIRST$14,
|
|
12319
|
+
column: FIRST$14,
|
|
12320
12320
|
rule: SCRIPTS,
|
|
12321
12321
|
message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
|
|
12322
12322
|
})));
|
|
@@ -12325,8 +12325,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
12325
12325
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
12326
12326
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
12327
12327
|
const workflows = yield* workflowText(root);
|
|
12328
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
12329
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12328
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$24 });
|
|
12329
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
12330
12330
|
return [...Array$1.flatten(found), ...Array$1.getSomes(scripts)];
|
|
12331
12331
|
});
|
|
12332
12332
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
@@ -12384,7 +12384,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
12384
12384
|
// src/features/check-repository-layout/model/path-existence.ts
|
|
12385
12385
|
const WILDCARD$4 = /[*?[]/u;
|
|
12386
12386
|
const SEPARATOR$14 = "/";
|
|
12387
|
-
const FIRST$
|
|
12387
|
+
const FIRST$13 = 0;
|
|
12388
12388
|
/** @internal */
|
|
12389
12389
|
const existsAt = Effect.fn("existsAt")(function* existsAt(root, path) {
|
|
12390
12390
|
const files = yield* RepositoryFiles;
|
|
@@ -12399,7 +12399,7 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
|
|
|
12399
12399
|
/** @internal */
|
|
12400
12400
|
const staticPrefix = (path) => {
|
|
12401
12401
|
const prefix = Array$1.headNonEmpty(String$1.split(path, WILDCARD$4));
|
|
12402
|
-
if (String$1.endsWith(SEPARATOR$14)(prefix)) return String$1.slice(FIRST$
|
|
12402
|
+
if (String$1.endsWith(SEPARATOR$14)(prefix)) return String$1.slice(FIRST$13, -1)(prefix);
|
|
12403
12403
|
return prefix;
|
|
12404
12404
|
};
|
|
12405
12405
|
/** @internal */
|
|
@@ -12447,26 +12447,26 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
12447
12447
|
])));
|
|
12448
12448
|
});
|
|
12449
12449
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
12450
|
-
const RULE$
|
|
12450
|
+
const RULE$51 = "config-path";
|
|
12451
12451
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
12452
12452
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
12453
12453
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
12454
12454
|
const OUTSIDE = "..";
|
|
12455
|
-
const READ_CONCURRENCY$
|
|
12455
|
+
const READ_CONCURRENCY$23 = 8;
|
|
12456
12456
|
const isMissing$2 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
12457
12457
|
const files = yield* RepositoryFiles;
|
|
12458
12458
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
12459
12459
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
12460
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
12460
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$23 });
|
|
12461
12461
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
12462
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
12462
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$23 });
|
|
12463
12463
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
12464
12464
|
});
|
|
12465
12465
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
12466
12466
|
const problemOf$8 = (file, source) => (mention) => ({
|
|
12467
12467
|
file,
|
|
12468
12468
|
...positionOf(source)(mention.index),
|
|
12469
|
-
rule: RULE$
|
|
12469
|
+
rule: RULE$51,
|
|
12470
12470
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
12471
12471
|
});
|
|
12472
12472
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -12479,7 +12479,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
12479
12479
|
const source = yield* files.readFile(file);
|
|
12480
12480
|
if (Option.isNone(source)) return [];
|
|
12481
12481
|
const mentions = yield* mentionsIn(file, source.value);
|
|
12482
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
12482
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$23 });
|
|
12483
12483
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$8(file, source.value)));
|
|
12484
12484
|
});
|
|
12485
12485
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -12491,7 +12491,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
12491
12491
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
12492
12492
|
file,
|
|
12493
12493
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
12494
|
-
rule: RULE$
|
|
12494
|
+
rule: RULE$51,
|
|
12495
12495
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
12496
12496
|
})));
|
|
12497
12497
|
});
|
|
@@ -12499,23 +12499,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
12499
12499
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
12500
12500
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
12501
12501
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
12502
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$18(root, name), { concurrency: READ_CONCURRENCY$
|
|
12502
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$18(root, name), { concurrency: READ_CONCURRENCY$23 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
12503
12503
|
return [...Array$1.flatten(found), ...patterns];
|
|
12504
12504
|
});
|
|
12505
12505
|
// src/features/check-repository-layout/model/crates.ts
|
|
12506
|
-
const RULE$
|
|
12506
|
+
const RULE$50 = "unverified-crate";
|
|
12507
12507
|
const VERSION_RULE = "release-version";
|
|
12508
12508
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
12509
12509
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
12510
12510
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
12511
12511
|
const SEPARATOR$12 = "/";
|
|
12512
|
-
const FIRST$
|
|
12513
|
-
const READ_CONCURRENCY$
|
|
12512
|
+
const FIRST$12 = 1;
|
|
12513
|
+
const READ_CONCURRENCY$22 = 8;
|
|
12514
12514
|
const problemFor$4 = (crate, message) => ({
|
|
12515
12515
|
file: crate.manifest,
|
|
12516
|
-
line: FIRST$
|
|
12517
|
-
column: FIRST$
|
|
12518
|
-
rule: RULE$
|
|
12516
|
+
line: FIRST$12,
|
|
12517
|
+
column: FIRST$12,
|
|
12518
|
+
rule: RULE$50,
|
|
12519
12519
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
12520
12520
|
});
|
|
12521
12521
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -12535,8 +12535,8 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
|
|
|
12535
12535
|
if (Option.isNone(version) || version.value === crate.version) return Option.none();
|
|
12536
12536
|
return Option.some({
|
|
12537
12537
|
file: crate.manifest,
|
|
12538
|
-
line: FIRST$
|
|
12539
|
-
column: FIRST$
|
|
12538
|
+
line: FIRST$12,
|
|
12539
|
+
column: FIRST$12,
|
|
12540
12540
|
rule: VERSION_RULE,
|
|
12541
12541
|
message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${PACKAGE_JSON_FILE} is ${version.value}. msch-publish releases the version in package.json, so bump both in the same PR.`
|
|
12542
12542
|
});
|
|
@@ -12547,11 +12547,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
12547
12547
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
12548
12548
|
const directories = yield* workspaceDirectories(root);
|
|
12549
12549
|
const crates = yield* cratesIn(root);
|
|
12550
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
12550
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$22 });
|
|
12551
12551
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
12552
12552
|
});
|
|
12553
12553
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
12554
|
-
const RULE$
|
|
12554
|
+
const RULE$49 = "deploy-entry-pattern";
|
|
12555
12555
|
const FALLOW_KEYS = [
|
|
12556
12556
|
"entry",
|
|
12557
12557
|
"entryPoints",
|
|
@@ -12569,7 +12569,7 @@ const NEGATED = "!";
|
|
|
12569
12569
|
const ROOT_WORKSPACE = ".";
|
|
12570
12570
|
const WRAP_OFFSET$1 = 1;
|
|
12571
12571
|
const NO_OFFSET = 0;
|
|
12572
|
-
const READ_CONCURRENCY$
|
|
12572
|
+
const READ_CONCURRENCY$21 = 8;
|
|
12573
12573
|
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.";
|
|
12574
12574
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
12575
12575
|
const FALLOW = {
|
|
@@ -12622,7 +12622,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
12622
12622
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
12623
12623
|
file: path,
|
|
12624
12624
|
...positionOf(text.value)(start - kind.offset),
|
|
12625
|
-
rule: RULE$
|
|
12625
|
+
rule: RULE$49,
|
|
12626
12626
|
message: `${pattern} ${MESSAGE$13}`
|
|
12627
12627
|
})));
|
|
12628
12628
|
});
|
|
@@ -12651,11 +12651,11 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
12651
12651
|
kind,
|
|
12652
12652
|
workspaces,
|
|
12653
12653
|
entries
|
|
12654
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
12654
|
+
}), { concurrency: READ_CONCURRENCY$21 });
|
|
12655
12655
|
return Array$1.flatten(found);
|
|
12656
12656
|
});
|
|
12657
12657
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
12658
|
-
const RULE$
|
|
12658
|
+
const RULE$48 = "listed-entry";
|
|
12659
12659
|
const ENTRY_KEYS = [
|
|
12660
12660
|
"entry",
|
|
12661
12661
|
"entryPoints",
|
|
@@ -12665,7 +12665,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
12665
12665
|
const WILDCARD$2 = /[*?{[]/u;
|
|
12666
12666
|
const SEPARATOR$11 = "/";
|
|
12667
12667
|
const WRAP_OFFSET = 1;
|
|
12668
|
-
const READ_CONCURRENCY$
|
|
12668
|
+
const READ_CONCURRENCY$20 = 8;
|
|
12669
12669
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
12670
12670
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
12671
12671
|
const entryPatternsIn = (node) => {
|
|
@@ -12685,7 +12685,7 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
12685
12685
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
12686
12686
|
file: path,
|
|
12687
12687
|
...positionOf(text.value)(start),
|
|
12688
|
-
rule: RULE$
|
|
12688
|
+
rule: RULE$48,
|
|
12689
12689
|
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.`
|
|
12690
12690
|
})));
|
|
12691
12691
|
});
|
|
@@ -12693,15 +12693,15 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
12693
12693
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
12694
12694
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
12695
12695
|
const directories = yield* workspaceDirectories(root);
|
|
12696
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
12696
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$20 });
|
|
12697
12697
|
return Array$1.flatten(found);
|
|
12698
12698
|
});
|
|
12699
12699
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
12700
|
-
const RULE$
|
|
12700
|
+
const RULE$47 = "root-workspace-path";
|
|
12701
12701
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
12702
12702
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
12703
12703
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
12704
|
-
const FIRST$
|
|
12704
|
+
const FIRST$11 = 0;
|
|
12705
12705
|
const NEXT$2 = 1;
|
|
12706
12706
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
12707
12707
|
const mentions = (directory) => (text) => {
|
|
@@ -12709,14 +12709,14 @@ const mentions = (directory) => (text) => {
|
|
|
12709
12709
|
return pipe(Array$1.drop(parts, NEXT$2), Array$1.some((after, index) => {
|
|
12710
12710
|
const before = parts[index] ?? "";
|
|
12711
12711
|
const previous = String$1.slice(before.length - NEXT$2)(before);
|
|
12712
|
-
const following = String$1.slice(FIRST$
|
|
12712
|
+
const following = String$1.slice(FIRST$11, NEXT$2)(after);
|
|
12713
12713
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
12714
12714
|
}));
|
|
12715
12715
|
};
|
|
12716
12716
|
const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
12717
12717
|
file,
|
|
12718
12718
|
...positionOf(source)(found.start),
|
|
12719
|
-
rule: RULE$
|
|
12719
|
+
rule: RULE$47,
|
|
12720
12720
|
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.`
|
|
12721
12721
|
})));
|
|
12722
12722
|
/** @internal */
|
|
@@ -12730,10 +12730,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
12730
12730
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$15(file, source.value, directories)));
|
|
12731
12731
|
});
|
|
12732
12732
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
12733
|
-
const RULE$
|
|
12733
|
+
const RULE$46 = "hidden-verify";
|
|
12734
12734
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
12735
|
-
const FIRST$
|
|
12736
|
-
const READ_CONCURRENCY$
|
|
12735
|
+
const FIRST$10 = 1;
|
|
12736
|
+
const READ_CONCURRENCY$19 = 8;
|
|
12737
12737
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
12738
12738
|
const config = yield* workspaceConfigOf(root, directory);
|
|
12739
12739
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -12742,21 +12742,21 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
12742
12742
|
const verified = yield* hasVerifyTask(file);
|
|
12743
12743
|
return Option.some({
|
|
12744
12744
|
file,
|
|
12745
|
-
line: FIRST$
|
|
12746
|
-
column: FIRST$
|
|
12747
|
-
rule: RULE$
|
|
12745
|
+
line: FIRST$10,
|
|
12746
|
+
column: FIRST$10,
|
|
12747
|
+
rule: RULE$46,
|
|
12748
12748
|
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}.`
|
|
12749
12749
|
}).pipe(Option.filter(() => verified));
|
|
12750
12750
|
});
|
|
12751
12751
|
/** @internal */
|
|
12752
12752
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
12753
12753
|
const directories = yield* workspaceDirectories(root);
|
|
12754
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12754
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$19 });
|
|
12755
12755
|
return Array$1.getSomes(found);
|
|
12756
12756
|
});
|
|
12757
12757
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
12758
|
-
const RULE$
|
|
12759
|
-
const READ_CONCURRENCY$
|
|
12758
|
+
const RULE$45 = "shared-uncached-task";
|
|
12759
|
+
const READ_CONCURRENCY$18 = 8;
|
|
12760
12760
|
const SHARED = 2;
|
|
12761
12761
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
12762
12762
|
const UncachedTask = Schema.Struct({
|
|
@@ -12798,19 +12798,19 @@ const problemsOf$3 = (definitions) => {
|
|
|
12798
12798
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
12799
12799
|
file,
|
|
12800
12800
|
...position,
|
|
12801
|
-
rule: RULE$
|
|
12801
|
+
rule: RULE$45,
|
|
12802
12802
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.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.`
|
|
12803
12803
|
})));
|
|
12804
12804
|
};
|
|
12805
12805
|
/** @internal */
|
|
12806
12806
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
12807
12807
|
const directories = yield* workspaceDirectories(root);
|
|
12808
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12808
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$18 });
|
|
12809
12809
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
12810
12810
|
});
|
|
12811
12811
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
12812
|
-
const RULE$
|
|
12813
|
-
const READ_CONCURRENCY$
|
|
12812
|
+
const RULE$44 = "unlocked-task";
|
|
12813
|
+
const READ_CONCURRENCY$17 = 8;
|
|
12814
12814
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
12815
12815
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
12816
12816
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -12821,13 +12821,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
12821
12821
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
12822
12822
|
file,
|
|
12823
12823
|
...positionOf(source)(task.start),
|
|
12824
|
-
rule: RULE$
|
|
12824
|
+
rule: RULE$44,
|
|
12825
12825
|
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.`
|
|
12826
12826
|
})), Option.toArray)));
|
|
12827
12827
|
/** @internal */
|
|
12828
12828
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
12829
12829
|
const directories = yield* workspaceDirectories(root);
|
|
12830
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12830
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$17 });
|
|
12831
12831
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
12832
12832
|
});
|
|
12833
12833
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -12976,10 +12976,10 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
12976
12976
|
/** @internal */
|
|
12977
12977
|
const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
|
|
12978
12978
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
12979
|
-
const RULE$
|
|
12979
|
+
const RULE$43 = "workflow-path";
|
|
12980
12980
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
12981
12981
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
12982
|
-
const READ_CONCURRENCY$
|
|
12982
|
+
const READ_CONCURRENCY$16 = 8;
|
|
12983
12983
|
const SEPARATOR$9 = "/";
|
|
12984
12984
|
const EXPECTED = {
|
|
12985
12985
|
action: "a directory with action.yml",
|
|
@@ -13020,7 +13020,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
13020
13020
|
const problemOf$7 = (file, source) => (found) => ({
|
|
13021
13021
|
file,
|
|
13022
13022
|
...positionOf(source)(found.offset),
|
|
13023
|
-
rule: RULE$
|
|
13023
|
+
rule: RULE$43,
|
|
13024
13024
|
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.`
|
|
13025
13025
|
});
|
|
13026
13026
|
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
@@ -13035,7 +13035,7 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
|
|
|
13035
13035
|
/** @internal */
|
|
13036
13036
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
13037
13037
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13038
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$
|
|
13038
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$16 });
|
|
13039
13039
|
return Array$1.flatten(found);
|
|
13040
13040
|
});
|
|
13041
13041
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -13047,7 +13047,7 @@ const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
|
13047
13047
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
13048
13048
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
13049
13049
|
const START$24 = 0;
|
|
13050
|
-
const READ_CONCURRENCY$
|
|
13050
|
+
const READ_CONCURRENCY$15 = 8;
|
|
13051
13051
|
const SEPARATOR$8 = "/";
|
|
13052
13052
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
13053
13053
|
const SPACE = " ";
|
|
@@ -13126,7 +13126,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
|
|
|
13126
13126
|
name: stem,
|
|
13127
13127
|
source: text
|
|
13128
13128
|
})]), Option.getOrElse(() => []));
|
|
13129
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13129
|
+
}), { concurrency: READ_CONCURRENCY$15 });
|
|
13130
13130
|
const actions = pipe(listed, Array$1.flatMap((name) => pipe(groupOf("name")(ACTION.exec(name)), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
|
|
13131
13131
|
return [...Array$1.flatten(found), ...actions];
|
|
13132
13132
|
});
|
|
@@ -13421,6 +13421,55 @@ const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* che
|
|
|
13421
13421
|
const found = yield* Effect.forEach(workspaces, workspaceProblems$1, { concurrency: 1 });
|
|
13422
13422
|
return Array$1.flatten(found);
|
|
13423
13423
|
});
|
|
13424
|
+
// src/features/check-migration-order/model/migration-order.ts
|
|
13425
|
+
const RULE$42 = "migration-order";
|
|
13426
|
+
const SNAPSHOT = "snapshot.json";
|
|
13427
|
+
const MIGRATION = "migration.sql";
|
|
13428
|
+
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
13429
|
+
const FIRST$9 = 1;
|
|
13430
|
+
const READ_CONCURRENCY$14 = 16;
|
|
13431
|
+
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
13432
|
+
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
13433
|
+
const files = yield* RepositoryFiles;
|
|
13434
|
+
const folder = files.dirname(file);
|
|
13435
|
+
const sql = files.join(folder, MIGRATION);
|
|
13436
|
+
const [here, there, sqlHere, sqlThere] = yield* Effect.all([
|
|
13437
|
+
files.exists(files.join(root, file)),
|
|
13438
|
+
files.readAtRevision(root, base, file),
|
|
13439
|
+
files.exists(files.join(root, sql)),
|
|
13440
|
+
files.readAtRevision(root, base, sql)
|
|
13441
|
+
], { concurrency: "unbounded" });
|
|
13442
|
+
const applied = Option.isSome(there) && Option.isSome(sqlThere);
|
|
13443
|
+
return pipe(Option.some({
|
|
13444
|
+
file,
|
|
13445
|
+
directory: files.dirname(folder),
|
|
13446
|
+
folder: files.basename(folder),
|
|
13447
|
+
applied
|
|
13448
|
+
}), Option.filter(() => here && sqlHere || applied));
|
|
13449
|
+
});
|
|
13450
|
+
const latestOf = (migrations) => pipe(migrations, Array$1.filter(({ applied }) => applied), Array$1.map(({ folder }) => folder), Array$1.match({
|
|
13451
|
+
onEmpty: () => Option.none(),
|
|
13452
|
+
onNonEmpty: (folders) => Option.some(Array$1.max(folders, String$1.Order))
|
|
13453
|
+
}), Option.flatMap((folder) => Array$1.findFirst(migrations, (migration) => migration.folder === folder)));
|
|
13454
|
+
const isBefore = (later) => (migration) => !migration.applied && Order.isLessThan(String$1.Order)(migration.folder, later.folder);
|
|
13455
|
+
const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migrations), Option.map((latest) => pipe(migrations, Array$1.filter(isBefore(latest)), Array$1.map(({ file, folder }) => ({
|
|
13456
|
+
file: join(root, file),
|
|
13457
|
+
line: FIRST$9,
|
|
13458
|
+
column: FIRST$9,
|
|
13459
|
+
rule: RULE$42,
|
|
13460
|
+
message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
|
|
13461
|
+
})))), Option.getOrElse(() => []));
|
|
13462
|
+
/** @internal */
|
|
13463
|
+
const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigrationOrder(root) {
|
|
13464
|
+
const files = yield* RepositoryFiles;
|
|
13465
|
+
const base = yield* baseName$1;
|
|
13466
|
+
const found = yield* files.mergeBase(root, base);
|
|
13467
|
+
if (Option.isNone(found)) return [];
|
|
13468
|
+
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
13469
|
+
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
13470
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$14 });
|
|
13471
|
+
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
13472
|
+
});
|
|
13424
13473
|
// src/shared/lib/bundle-error.ts
|
|
13425
13474
|
const ERROR_LINE = /\[[A-Z_]+\]/u;
|
|
13426
13475
|
const SHOWN_ERRORS = 3;
|
|
@@ -13925,7 +13974,8 @@ const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
|
|
|
13925
13974
|
const found = yield* Effect.all([
|
|
13926
13975
|
checkTypescriptGeneration(root),
|
|
13927
13976
|
checkWorkerBundles(root),
|
|
13928
|
-
checkTreeShaking(root)
|
|
13977
|
+
checkTreeShaking(root),
|
|
13978
|
+
checkMigrationOrder(root)
|
|
13929
13979
|
], { concurrency: "unbounded" });
|
|
13930
13980
|
return Array$1.flatten(found);
|
|
13931
13981
|
});
|