@r_masseater/msch 0.67.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/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +4 -4
- package/dist/cli.mjs +354 -298
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +8 -3
- 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/{dependencies-B9hf2aIC.mjs → dependencies-C3kCe35Q.mjs} +2 -2
- package/dist/{dependencies-B9hf2aIC.mjs.map → dependencies-C3kCe35Q.mjs.map} +1 -1
- package/dist/exits.mjs +4 -4
- package/dist/{ignored-directories-DzwJE3Y7.mjs → ignored-directories-BW8gCBE1.mjs} +2 -2
- package/dist/{ignored-directories-DzwJE3Y7.mjs.map → ignored-directories-BW8gCBE1.mjs.map} +1 -1
- 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/dist/{lookup-report-FU7iFxSa.mjs → lookup-report-D1VTEK5k.mjs} +3 -3
- package/dist/{lookup-report-FU7iFxSa.mjs.map → lookup-report-D1VTEK5k.mjs.map} +1 -1
- package/dist/{manifest-texts-B8NV4YCS.mjs → manifest-texts-K650kDy8.mjs} +2 -2
- package/dist/{manifest-texts-B8NV4YCS.mjs.map → manifest-texts-K650kDy8.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/{pass-records-C5tcV6Qh.mjs → pass-records-kbx5VgwI.mjs} +4 -4
- package/dist/{pass-records-C5tcV6Qh.mjs.map → pass-records-kbx5VgwI.mjs.map} +1 -1
- package/dist/{problem-BvRpVt97.mjs → problem-Ciud2WGj.mjs} +2 -2
- package/dist/{problem-BvRpVt97.mjs.map → problem-Ciud2WGj.mjs.map} +1 -1
- package/dist/publish.mjs +55 -8
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-l5wN7u0m.mjs → published-CpfXkChq.mjs} +3 -3
- package/dist/{published-l5wN7u0m.mjs.map → published-CpfXkChq.mjs.map} +1 -1
- package/dist/published.mjs +44 -26
- package/dist/published.mjs.map +1 -1
- package/dist/refs.mjs +3 -3
- package/dist/{repository-files-BxmKrOgg.mjs → repository-files-C2gVviac.mjs} +10 -1
- package/dist/repository-files-C2gVviac.mjs.map +1 -0
- package/dist/{runtime-C6khg0XJ.mjs → runtime-1exMm81b.mjs} +2 -2
- package/dist/{runtime-C6khg0XJ.mjs.map → runtime-1exMm81b.mjs.map} +1 -1
- package/dist/{syntax-V4CunkGE.mjs → syntax-Dx4HQIK-.mjs} +2 -2
- package/dist/{syntax-V4CunkGE.mjs.map → syntax-Dx4HQIK-.mjs.map} +1 -1
- package/dist/{upstream-exits-DLZh68ZH.mjs → upstream-exits-Clnl4-G5.mjs} +3 -3
- package/dist/{upstream-exits-DLZh68ZH.mjs.map → upstream-exits-Clnl4-G5.mjs.map} +1 -1
- package/dist/wake.mjs +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +4 -3
- package/skills/msch-checks/SKILL.md +2 -2
- package/skills/msch-publishing/SKILL.md +7 -6
- package/dist/define-lint-preset-DpGK82kj.mjs.map +0 -1
- package/dist/repository-files-BxmKrOgg.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-
|
|
2
|
+
import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-CpfXkChq.mjs";
|
|
3
3
|
import { t as workspaceManifest } from "./workspace-manifest-BC-1cRIJ.mjs";
|
|
4
|
-
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-
|
|
5
|
-
import { a as groupOf, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-
|
|
6
|
-
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-
|
|
4
|
+
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-kbx5VgwI.mjs";
|
|
5
|
+
import { a as groupOf, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-C2gVviac.mjs";
|
|
6
|
+
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-Clnl4-G5.mjs";
|
|
7
7
|
import { a as join, n as baseName, o as parent, r as isInside, t as matcher } from "./app-BwjhFdKD.mjs";
|
|
8
|
-
import { a as publishedProjects, c as workspaceProjects, o as unmatchedWorkspacePatterns, r as readManifest, s as workspaceDirectories, t as MANIFEST_FILE$3 } from "./dependencies-
|
|
9
|
-
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 publishedProjects, c as workspaceProjects, o as unmatchedWorkspacePatterns, r as readManifest, s as workspaceDirectories, t as MANIFEST_FILE$3 } from "./dependencies-C3kCe35Q.mjs";
|
|
9
|
+
import { a as problemAtPosition, i as problemAt$7, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-Ciud2WGj.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-
|
|
13
|
-
import { a as fieldsOf, c as namedCatalogsOf, d as specifiedIn, i as decodeManifest$9, l as offsetIn$1, n as baseName$1, o as manifestPattern, r as baseRevision, s as manifestSpecifiers, t as manifestTexts, u as quoted$2 } from "./manifest-texts-
|
|
14
|
-
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-
|
|
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-Dx4HQIK-.mjs";
|
|
13
|
+
import { a as fieldsOf, c as namedCatalogsOf, d as specifiedIn, i as decodeManifest$9, l as offsetIn$1, n as baseName$1, o as manifestPattern, r as baseRevision, s as manifestSpecifiers, t as manifestTexts, u as quoted$2 } from "./manifest-texts-K650kDy8.mjs";
|
|
14
|
+
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-1exMm81b.mjs";
|
|
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;
|
|
@@ -618,6 +618,8 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
|
|
|
618
618
|
const overrides = yield* scanText(pipe(listed, Array.filter(({ name }) => NPMRC.test(name))), npmrcProblems);
|
|
619
619
|
return [...yield* checkWorkspace(root), ...overrides];
|
|
620
620
|
});
|
|
621
|
+
// src/entities/package/model/stack-catalog.ts
|
|
622
|
+
const STACK_CATALOG = "catalog:stack";
|
|
621
623
|
// src/entities/package/model/published-manifest.ts
|
|
622
624
|
const EXCLUDED$8 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
623
625
|
const PublishedManifestSchema = Schema.Struct({
|
|
@@ -644,7 +646,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
644
646
|
})), Option.getOrElse(() => [])));
|
|
645
647
|
});
|
|
646
648
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
647
|
-
const RULE$
|
|
649
|
+
const RULE$63 = "colocated-git-patterns";
|
|
648
650
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
649
651
|
const ROOT$3 = ".";
|
|
650
652
|
const NEGATION$1 = "!";
|
|
@@ -691,7 +693,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
691
693
|
const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
|
|
692
694
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array.map(toEntry), Array.getSomes);
|
|
693
695
|
});
|
|
694
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
696
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$63)(entry.file, {
|
|
695
697
|
line: entry.line,
|
|
696
698
|
column: FIRST$22
|
|
697
699
|
}, message);
|
|
@@ -754,7 +756,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
754
756
|
return Array.getSomes([...misplacedFound, ...repeatedFound]);
|
|
755
757
|
});
|
|
756
758
|
// src/features/check-placement/model/colocated-tests.ts
|
|
757
|
-
const RULE$
|
|
759
|
+
const RULE$62 = "colocated-test";
|
|
758
760
|
const FIRST$21 = 1;
|
|
759
761
|
const READ_CONCURRENCY$33 = 64;
|
|
760
762
|
const ROOT_SUBPATH = ".";
|
|
@@ -782,7 +784,7 @@ const problemFor$9 = (test, message) => ({
|
|
|
782
784
|
file: test.file,
|
|
783
785
|
line: FIRST$21,
|
|
784
786
|
column: FIRST$21,
|
|
785
|
-
rule: RULE$
|
|
787
|
+
rule: RULE$62,
|
|
786
788
|
message: `${test.base} ${message}`
|
|
787
789
|
});
|
|
788
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);
|
|
@@ -865,7 +867,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
865
867
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
866
868
|
const RECOMMENDED_LINES = 200;
|
|
867
869
|
const FIRST$20 = 1;
|
|
868
|
-
const RULE$
|
|
870
|
+
const RULE$61 = "agent-docs-length";
|
|
869
871
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
870
872
|
const problemFor$8 = (file) => (lines) => {
|
|
871
873
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -873,19 +875,19 @@ const problemFor$8 = (file) => (lines) => {
|
|
|
873
875
|
file,
|
|
874
876
|
line: 201,
|
|
875
877
|
column: FIRST$20,
|
|
876
|
-
rule: RULE$
|
|
878
|
+
rule: RULE$61,
|
|
877
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.`
|
|
878
880
|
});
|
|
879
881
|
};
|
|
880
882
|
/** @internal */
|
|
881
883
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
|
|
882
884
|
// src/features/check-placement/model/claude-link.ts
|
|
883
|
-
const RULE$
|
|
885
|
+
const RULE$60 = "claude-md-link";
|
|
884
886
|
const CLAUDE = "CLAUDE.md";
|
|
885
887
|
const AGENTS = "AGENTS.md";
|
|
886
888
|
const FIRST$19 = 1;
|
|
887
889
|
const READ_CONCURRENCY$31 = 16;
|
|
888
|
-
const MESSAGE$
|
|
890
|
+
const MESSAGE$18 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
889
891
|
/** @internal */
|
|
890
892
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
891
893
|
const files = yield* RepositoryFiles;
|
|
@@ -899,8 +901,8 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
899
901
|
file: path,
|
|
900
902
|
line: FIRST$19,
|
|
901
903
|
column: FIRST$19,
|
|
902
|
-
rule: RULE$
|
|
903
|
-
message: MESSAGE$
|
|
904
|
+
rule: RULE$60,
|
|
905
|
+
message: MESSAGE$18
|
|
904
906
|
})));
|
|
905
907
|
});
|
|
906
908
|
const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
|
|
@@ -908,7 +910,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
908
910
|
return Array.getSomes(found);
|
|
909
911
|
});
|
|
910
912
|
// src/features/check-placement/model/dangling-links.ts
|
|
911
|
-
const RULE$
|
|
913
|
+
const RULE$59 = "dangling-link";
|
|
912
914
|
const SEPARATOR$21 = "/";
|
|
913
915
|
const FIRST$18 = 1;
|
|
914
916
|
const READ_CONCURRENCY$30 = 16;
|
|
@@ -924,7 +926,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
924
926
|
file,
|
|
925
927
|
line: FIRST$18,
|
|
926
928
|
column: FIRST$18,
|
|
927
|
-
rule: RULE$
|
|
929
|
+
rule: RULE$59,
|
|
928
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.`
|
|
929
931
|
})));
|
|
930
932
|
});
|
|
@@ -982,7 +984,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
982
984
|
}));
|
|
983
985
|
});
|
|
984
986
|
// src/features/check-placement/model/deployed-readme.ts
|
|
985
|
-
const RULE$
|
|
987
|
+
const RULE$58 = "deployed-readme";
|
|
986
988
|
const ROOT_DIRECTORY$4 = "";
|
|
987
989
|
const READ_CONCURRENCY$29 = 16;
|
|
988
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.";
|
|
@@ -1022,14 +1024,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
1022
1024
|
const readme = yield* readReadme({
|
|
1023
1025
|
root,
|
|
1024
1026
|
directory,
|
|
1025
|
-
rule: RULE$
|
|
1027
|
+
rule: RULE$58,
|
|
1026
1028
|
missingMessage: MISSING_MESSAGE$2
|
|
1027
1029
|
});
|
|
1028
1030
|
return Result.match(readme, {
|
|
1029
1031
|
onFailure: Option.some,
|
|
1030
1032
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
1031
1033
|
file,
|
|
1032
|
-
rule: RULE$
|
|
1034
|
+
rule: RULE$58,
|
|
1033
1035
|
message: NO_URL_MESSAGE
|
|
1034
1036
|
})))
|
|
1035
1037
|
});
|
|
@@ -1046,7 +1048,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
1046
1048
|
return Array.getSomes(found);
|
|
1047
1049
|
});
|
|
1048
1050
|
// src/features/check-placement/model/nested-docs.ts
|
|
1049
|
-
const RULE$
|
|
1051
|
+
const RULE$57 = "nested-docs";
|
|
1050
1052
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
1051
1053
|
const SEPARATOR$19 = "/";
|
|
1052
1054
|
const READ_CONCURRENCY$28 = 64;
|
|
@@ -1059,7 +1061,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
1059
1061
|
const taggedError$6 = Schema.TaggedError;
|
|
1060
1062
|
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
1061
1063
|
const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
|
|
1062
|
-
const problemFor$7 = problemInFile(RULE$
|
|
1064
|
+
const problemFor$7 = problemInFile(RULE$57);
|
|
1063
1065
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
1064
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.";
|
|
1065
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.";
|
|
@@ -1116,15 +1118,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
1116
1118
|
return [...Array.getSomes(found), ...missing];
|
|
1117
1119
|
});
|
|
1118
1120
|
// src/features/check-placement/model/published-readme.ts
|
|
1119
|
-
const RULE$
|
|
1121
|
+
const RULE$56 = "published-readme";
|
|
1120
1122
|
const READ_CONCURRENCY$27 = 16;
|
|
1121
|
-
const MESSAGE$
|
|
1123
|
+
const MESSAGE$17 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
1122
1124
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
1123
1125
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
1124
1126
|
const readme = yield* readReadme({
|
|
1125
1127
|
root,
|
|
1126
1128
|
directory,
|
|
1127
|
-
rule: RULE$
|
|
1129
|
+
rule: RULE$56,
|
|
1128
1130
|
missingMessage: MISSING_MESSAGE
|
|
1129
1131
|
});
|
|
1130
1132
|
return Result.match(readme, {
|
|
@@ -1135,8 +1137,8 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
1135
1137
|
file,
|
|
1136
1138
|
line,
|
|
1137
1139
|
column,
|
|
1138
|
-
rule: RULE$
|
|
1139
|
-
message: MESSAGE$
|
|
1140
|
+
rule: RULE$56,
|
|
1141
|
+
message: MESSAGE$17
|
|
1140
1142
|
};
|
|
1141
1143
|
}))
|
|
1142
1144
|
});
|
|
@@ -1148,11 +1150,11 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
1148
1150
|
return Array.getSomes(found);
|
|
1149
1151
|
});
|
|
1150
1152
|
// src/features/check-placement/model/published-tests.ts
|
|
1151
|
-
const RULE$
|
|
1153
|
+
const RULE$55 = "published-tests";
|
|
1152
1154
|
const MANIFEST_FILE$2 = "package.json";
|
|
1153
1155
|
const FILE_START = 1;
|
|
1154
1156
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
1155
|
-
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.";
|
|
1156
1158
|
const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
|
|
1157
1159
|
const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
|
|
1158
1160
|
const files = yield* RepositoryFiles;
|
|
@@ -1163,8 +1165,8 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
1163
1165
|
file: files.join(absolute, MANIFEST_FILE$2),
|
|
1164
1166
|
line: FILE_START,
|
|
1165
1167
|
column: FILE_START,
|
|
1166
|
-
rule: RULE$
|
|
1167
|
-
message: MESSAGE$
|
|
1168
|
+
rule: RULE$55,
|
|
1169
|
+
message: MESSAGE$16
|
|
1168
1170
|
});
|
|
1169
1171
|
});
|
|
1170
1172
|
/** @internal */
|
|
@@ -1177,13 +1179,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
1177
1179
|
return Array.getSomes(found);
|
|
1178
1180
|
});
|
|
1179
1181
|
// src/features/check-placement/model/root-docs.ts
|
|
1180
|
-
const RULE$
|
|
1182
|
+
const RULE$54 = "root-docs";
|
|
1181
1183
|
const SEPARATOR$18 = "/";
|
|
1182
1184
|
const FIRST$16 = 1;
|
|
1183
|
-
const MARKDOWN$
|
|
1185
|
+
const MARKDOWN$2 = /\.(?:md|mdx|markdown)$/iu;
|
|
1184
1186
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
1185
|
-
const MESSAGE$
|
|
1186
|
-
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);
|
|
1187
1189
|
/** @internal */
|
|
1188
1190
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
1189
1191
|
const files = yield* RepositoryFiles;
|
|
@@ -1192,15 +1194,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
1192
1194
|
file: files.join(root, name),
|
|
1193
1195
|
line: FIRST$16,
|
|
1194
1196
|
column: FIRST$16,
|
|
1195
|
-
rule: RULE$
|
|
1196
|
-
message: `${name} ${MESSAGE$
|
|
1197
|
+
rule: RULE$54,
|
|
1198
|
+
message: `${name} ${MESSAGE$15}`
|
|
1197
1199
|
})));
|
|
1198
1200
|
});
|
|
1199
1201
|
// src/features/check-placement/model/root-readme.ts
|
|
1200
|
-
const RULE$
|
|
1202
|
+
const RULE$53 = "root-readme";
|
|
1201
1203
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
1202
1204
|
const READ_CONCURRENCY$26 = 16;
|
|
1203
|
-
const START$
|
|
1205
|
+
const START$25 = 0;
|
|
1204
1206
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
1205
1207
|
const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
|
|
1206
1208
|
const RELATIVE$2 = /^\.\//u;
|
|
@@ -1237,17 +1239,17 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
|
|
|
1237
1239
|
onNone: () => ownNames(plugins, names),
|
|
1238
1240
|
onSome: () => [directory]
|
|
1239
1241
|
}));
|
|
1240
|
-
const problemsIn$
|
|
1242
|
+
const problemsIn$20 = (file, source, plugins) => (workspace) => {
|
|
1241
1243
|
const message = messageFor$1(workspace.directory);
|
|
1242
1244
|
const at = positionOf(source);
|
|
1243
1245
|
const pattern = patternFor(plugins)(workspace);
|
|
1244
|
-
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)));
|
|
1245
1247
|
};
|
|
1246
1248
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
1247
1249
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
1248
1250
|
return pipe(text, Option.match({
|
|
1249
1251
|
onNone: () => [],
|
|
1250
|
-
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$
|
|
1252
|
+
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$20(file, source, plugins)))
|
|
1251
1253
|
}));
|
|
1252
1254
|
});
|
|
1253
1255
|
/** @internal */
|
|
@@ -1278,7 +1280,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
1278
1280
|
return Array.flatten(found);
|
|
1279
1281
|
});
|
|
1280
1282
|
// src/features/check-placement/model/docs-mirror.ts
|
|
1281
|
-
const RULE$
|
|
1283
|
+
const RULE$52 = "docs-mirror";
|
|
1282
1284
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
1283
1285
|
const MIRROR_LIMIT = 3;
|
|
1284
1286
|
const READ_CONCURRENCY$25 = 16;
|
|
@@ -1303,7 +1305,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array.head(mentions), Opti
|
|
|
1303
1305
|
file,
|
|
1304
1306
|
line,
|
|
1305
1307
|
column,
|
|
1306
|
-
rule: RULE$
|
|
1308
|
+
rule: RULE$52,
|
|
1307
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.`
|
|
1308
1310
|
};
|
|
1309
1311
|
}), Option.toArray);
|
|
@@ -1335,10 +1337,10 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
1335
1337
|
return Array.flatten(found);
|
|
1336
1338
|
});
|
|
1337
1339
|
// src/features/check-placement/model/ignored-sources.ts
|
|
1338
|
-
const RULE$
|
|
1340
|
+
const RULE$51 = "ignored-sources";
|
|
1339
1341
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
1340
1342
|
const FIRST$15 = 1;
|
|
1341
|
-
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.";
|
|
1342
1344
|
/** @internal */
|
|
1343
1345
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
1344
1346
|
const files = yield* RepositoryFiles;
|
|
@@ -1347,8 +1349,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
1347
1349
|
file: files.join(root, file),
|
|
1348
1350
|
line: FIRST$15,
|
|
1349
1351
|
column: FIRST$15,
|
|
1350
|
-
rule: RULE$
|
|
1351
|
-
message: MESSAGE$
|
|
1352
|
+
rule: RULE$51,
|
|
1353
|
+
message: MESSAGE$14
|
|
1352
1354
|
})));
|
|
1353
1355
|
});
|
|
1354
1356
|
// src/features/check-placement/model/public-entries.ts
|
|
@@ -10071,13 +10073,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
10071
10073
|
return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
|
|
10072
10074
|
});
|
|
10073
10075
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
10074
|
-
const RULE$
|
|
10076
|
+
const RULE$50 = "shadcn-ui-alias";
|
|
10075
10077
|
const FIRST$14 = 1;
|
|
10076
10078
|
const problemOf$9 = (directory, { file, alias }) => ({
|
|
10077
10079
|
file,
|
|
10078
10080
|
line: FIRST$14,
|
|
10079
10081
|
column: FIRST$14,
|
|
10080
|
-
rule: RULE$
|
|
10082
|
+
rule: RULE$50,
|
|
10081
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/*".`
|
|
10082
10084
|
});
|
|
10083
10085
|
/** @internal */
|
|
@@ -10200,7 +10202,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
|
|
|
10200
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.`
|
|
10201
10203
|
})));
|
|
10202
10204
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
|
|
10203
|
-
const problemsIn$
|
|
10205
|
+
const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
10204
10206
|
const files = yield* RepositoryFiles;
|
|
10205
10207
|
const config = yield* workspaceConfigOf(root, directory);
|
|
10206
10208
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -10239,19 +10241,19 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
10239
10241
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
10240
10242
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
10241
10243
|
const workflows = yield* workflowText(root);
|
|
10242
|
-
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 });
|
|
10243
10245
|
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
10244
10246
|
return [...Array.flatten(found), ...Array.getSomes(scripts)];
|
|
10245
10247
|
});
|
|
10246
10248
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
10247
|
-
const START$
|
|
10249
|
+
const START$24 = 0;
|
|
10248
10250
|
const QUOTES = ["\"", "'"];
|
|
10249
10251
|
const firstIndex = (source, needles) => {
|
|
10250
10252
|
const found = pipe(needles, Array.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
10251
10253
|
return Array.head(Array.sort(found, Order.Number));
|
|
10252
10254
|
};
|
|
10253
10255
|
const quoted$1 = (text) => pipe(QUOTES, Array.map((quote) => `${quote}${text}${quote}`));
|
|
10254
|
-
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));
|
|
10255
10257
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
10256
10258
|
const MEMBER_LISTS = [
|
|
10257
10259
|
"members",
|
|
@@ -10267,14 +10269,14 @@ const WORKSPACE = "workspace";
|
|
|
10267
10269
|
const PATCH = "patch";
|
|
10268
10270
|
const PATCH_DEPTH = 2;
|
|
10269
10271
|
const WORKSPACE_DEPTH = 1;
|
|
10270
|
-
const START$
|
|
10272
|
+
const START$23 = 0;
|
|
10271
10273
|
const WILDCARD$5 = /[*?[]/u;
|
|
10272
10274
|
const KEY_SEPARATOR = ".";
|
|
10273
10275
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
10274
10276
|
const decodeStrings$1 = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
10275
10277
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
10276
|
-
const declaresPath = (trail) => pipe(Array.last(trail), Option.exists((name) => Array.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array.get(trail, START$
|
|
10277
|
-
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);
|
|
10278
10280
|
const namedPaths = (trail, key, value) => {
|
|
10279
10281
|
const field = Array.join([...trail, key], KEY_SEPARATOR);
|
|
10280
10282
|
if (listsMembers(trail, key)) return pipe(decodeStrings$1(value), Option.getOrElse(() => []), Array.filter((member) => !WILDCARD$5.test(member)), Array.map((member) => ({
|
|
@@ -10361,7 +10363,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
10361
10363
|
])));
|
|
10362
10364
|
});
|
|
10363
10365
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
10364
|
-
const RULE$
|
|
10366
|
+
const RULE$49 = "config-path";
|
|
10365
10367
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
10366
10368
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
10367
10369
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -10380,14 +10382,14 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
10380
10382
|
const problemOf$8 = (file, source) => (mention) => ({
|
|
10381
10383
|
file,
|
|
10382
10384
|
...positionOf(source)(mention.index),
|
|
10383
|
-
rule: RULE$
|
|
10385
|
+
rule: RULE$49,
|
|
10384
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.`
|
|
10385
10387
|
});
|
|
10386
10388
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
10387
10389
|
if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
|
|
10388
10390
|
return yield* tsconfigMentions(file, source);
|
|
10389
10391
|
});
|
|
10390
|
-
const problemsIn$
|
|
10392
|
+
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
10391
10393
|
const files = yield* RepositoryFiles;
|
|
10392
10394
|
const file = files.join(root, name);
|
|
10393
10395
|
const source = yield* files.readFile(file);
|
|
@@ -10405,7 +10407,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
10405
10407
|
return pipe(patterns, Array.map((pattern) => ({
|
|
10406
10408
|
file,
|
|
10407
10409
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
10408
|
-
rule: RULE$
|
|
10410
|
+
rule: RULE$49,
|
|
10409
10411
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
10410
10412
|
})));
|
|
10411
10413
|
});
|
|
@@ -10413,11 +10415,11 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
10413
10415
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
10414
10416
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
10415
10417
|
const configs = pipe(owned, Array.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
10416
|
-
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" });
|
|
10417
10419
|
return [...Array.flatten(found), ...patterns];
|
|
10418
10420
|
});
|
|
10419
10421
|
// src/features/check-repository-layout/model/crates.ts
|
|
10420
|
-
const RULE$
|
|
10422
|
+
const RULE$48 = "unverified-crate";
|
|
10421
10423
|
const VERSION_RULE = "release-version";
|
|
10422
10424
|
const MANIFEST_FILE$1 = "package.json";
|
|
10423
10425
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
@@ -10431,7 +10433,7 @@ const problemFor$4 = (crate, message) => ({
|
|
|
10431
10433
|
file: crate.manifest,
|
|
10432
10434
|
line: FIRST$11,
|
|
10433
10435
|
column: FIRST$11,
|
|
10434
|
-
rule: RULE$
|
|
10436
|
+
rule: RULE$48,
|
|
10435
10437
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
10436
10438
|
});
|
|
10437
10439
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -10467,7 +10469,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
10467
10469
|
return Array.getSomes(Array.flatten(found));
|
|
10468
10470
|
});
|
|
10469
10471
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
10470
|
-
const RULE$
|
|
10472
|
+
const RULE$47 = "deploy-entry-pattern";
|
|
10471
10473
|
const FALLOW_KEYS = [
|
|
10472
10474
|
"entry",
|
|
10473
10475
|
"entryPoints",
|
|
@@ -10480,13 +10482,13 @@ const FALLOW_CONFIG$1 = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.json
|
|
|
10480
10482
|
const VITE_CONFIG = /(?:^|\/)vite\.config\.[cm]?ts$/u;
|
|
10481
10483
|
const BRACE_GROUP = /\{(?<options>[^{}]*)\}/u;
|
|
10482
10484
|
const OPTION_SEPARATOR = ",";
|
|
10483
|
-
const PAIR = 2;
|
|
10485
|
+
const PAIR$1 = 2;
|
|
10484
10486
|
const NEGATED = "!";
|
|
10485
10487
|
const ROOT_WORKSPACE = ".";
|
|
10486
10488
|
const WRAP_OFFSET$1 = 1;
|
|
10487
10489
|
const NO_OFFSET = 0;
|
|
10488
10490
|
const READ_CONCURRENCY$20 = 8;
|
|
10489
|
-
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.";
|
|
10490
10492
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
10491
10493
|
const FALLOW = {
|
|
10492
10494
|
keys: FALLOW_KEYS,
|
|
@@ -10510,7 +10512,7 @@ const combined = (chunks) => Array.matchLeft(chunks, {
|
|
|
10510
10512
|
onEmpty: () => [""],
|
|
10511
10513
|
onNonEmpty: (head, tail) => pipe(choicesOf(head), Array.flatMap((choice) => pipe(combined(tail), Array.map((rest) => `${choice}${rest}`))))
|
|
10512
10514
|
});
|
|
10513
|
-
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));
|
|
10514
10516
|
const selectsOnlyDeployEntries = Effect.fn("selectsOnlyDeployEntries")(function* selectsOnlyDeployEntries({ root, bases, entries }, pattern) {
|
|
10515
10517
|
const files = yield* RepositoryFiles;
|
|
10516
10518
|
const pathspecs = pipe(bases, Array.flatMap((base) => pipe(expanded(pattern.text), Array.map((spec) => `:(glob)${files.join(base, spec)}`))));
|
|
@@ -10522,7 +10524,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
10522
10524
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
10523
10525
|
return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
10524
10526
|
});
|
|
10525
|
-
const problemsIn$
|
|
10527
|
+
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
10526
10528
|
const { root, file, kind, workspaces, entries } = request;
|
|
10527
10529
|
const files = yield* RepositoryFiles;
|
|
10528
10530
|
const path = files.join(root, file);
|
|
@@ -10538,8 +10540,8 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
10538
10540
|
return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
|
|
10539
10541
|
file: path,
|
|
10540
10542
|
...positionOf(text.value)(start - kind.offset),
|
|
10541
|
-
rule: RULE$
|
|
10542
|
-
message: `${pattern} ${MESSAGE$
|
|
10543
|
+
rule: RULE$47,
|
|
10544
|
+
message: `${pattern} ${MESSAGE$13}`
|
|
10543
10545
|
})));
|
|
10544
10546
|
});
|
|
10545
10547
|
/** @internal */
|
|
@@ -10561,7 +10563,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10561
10563
|
}];
|
|
10562
10564
|
return [];
|
|
10563
10565
|
}));
|
|
10564
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
10566
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$17({
|
|
10565
10567
|
root,
|
|
10566
10568
|
file,
|
|
10567
10569
|
kind,
|
|
@@ -10571,7 +10573,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10571
10573
|
return Array.flatten(found);
|
|
10572
10574
|
});
|
|
10573
10575
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
10574
|
-
const RULE$
|
|
10576
|
+
const RULE$46 = "listed-entry";
|
|
10575
10577
|
const ENTRY_KEYS = [
|
|
10576
10578
|
"entry",
|
|
10577
10579
|
"entryPoints",
|
|
@@ -10592,7 +10594,7 @@ const entryPatternsIn = (node) => {
|
|
|
10592
10594
|
return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
|
|
10593
10595
|
};
|
|
10594
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);
|
|
10595
|
-
const problemsIn$
|
|
10597
|
+
const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
10596
10598
|
const files = yield* RepositoryFiles;
|
|
10597
10599
|
const path = files.join(root, file);
|
|
10598
10600
|
const text = yield* files.readFile(path);
|
|
@@ -10601,7 +10603,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10601
10603
|
return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
|
|
10602
10604
|
file: path,
|
|
10603
10605
|
...positionOf(text.value)(start),
|
|
10604
|
-
rule: RULE$
|
|
10606
|
+
rule: RULE$46,
|
|
10605
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.`
|
|
10606
10608
|
})));
|
|
10607
10609
|
});
|
|
@@ -10609,11 +10611,11 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10609
10611
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
10610
10612
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10611
10613
|
const directories = yield* workspaceDirectories(root);
|
|
10612
|
-
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 });
|
|
10613
10615
|
return Array.flatten(found);
|
|
10614
10616
|
});
|
|
10615
10617
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
10616
|
-
const RULE$
|
|
10618
|
+
const RULE$45 = "root-workspace-path";
|
|
10617
10619
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
10618
10620
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
10619
10621
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -10629,10 +10631,10 @@ const mentions = (directory) => (text) => {
|
|
|
10629
10631
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
10630
10632
|
}));
|
|
10631
10633
|
};
|
|
10632
|
-
const problemsIn$
|
|
10634
|
+
const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
|
|
10633
10635
|
file,
|
|
10634
10636
|
...positionOf(source)(found.start),
|
|
10635
|
-
rule: RULE$
|
|
10637
|
+
rule: RULE$45,
|
|
10636
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.`
|
|
10637
10639
|
})));
|
|
10638
10640
|
/** @internal */
|
|
@@ -10643,10 +10645,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
10643
10645
|
if (Option.isNone(source)) return [];
|
|
10644
10646
|
const directories = yield* workspaceDirectories(root);
|
|
10645
10647
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
10646
|
-
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$
|
|
10648
|
+
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$15(file, source.value, directories)));
|
|
10647
10649
|
});
|
|
10648
10650
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
10649
|
-
const RULE$
|
|
10651
|
+
const RULE$44 = "hidden-verify";
|
|
10650
10652
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
10651
10653
|
const FIRST$9 = 1;
|
|
10652
10654
|
const READ_CONCURRENCY$18 = 8;
|
|
@@ -10660,7 +10662,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
10660
10662
|
file,
|
|
10661
10663
|
line: FIRST$9,
|
|
10662
10664
|
column: FIRST$9,
|
|
10663
|
-
rule: RULE$
|
|
10665
|
+
rule: RULE$44,
|
|
10664
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}.`
|
|
10665
10667
|
}).pipe(Option.filter(() => verified));
|
|
10666
10668
|
});
|
|
@@ -10671,7 +10673,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
10671
10673
|
return Array.getSomes(found);
|
|
10672
10674
|
});
|
|
10673
10675
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
10674
|
-
const RULE$
|
|
10676
|
+
const RULE$43 = "shared-uncached-task";
|
|
10675
10677
|
const READ_CONCURRENCY$17 = 8;
|
|
10676
10678
|
const SHARED = 2;
|
|
10677
10679
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -10714,7 +10716,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
10714
10716
|
return pipe(definitions, Array.map(({ file, position, name, command }) => ({
|
|
10715
10717
|
file,
|
|
10716
10718
|
...position,
|
|
10717
|
-
rule: RULE$
|
|
10719
|
+
rule: RULE$43,
|
|
10718
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.`
|
|
10719
10721
|
})));
|
|
10720
10722
|
};
|
|
@@ -10725,7 +10727,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
10725
10727
|
return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
|
|
10726
10728
|
});
|
|
10727
10729
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
10728
|
-
const RULE$
|
|
10730
|
+
const RULE$42 = "unlocked-task";
|
|
10729
10731
|
const READ_CONCURRENCY$16 = 8;
|
|
10730
10732
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
10731
10733
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -10737,7 +10739,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
10737
10739
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
10738
10740
|
file,
|
|
10739
10741
|
...positionOf(source)(task.start),
|
|
10740
|
-
rule: RULE$
|
|
10742
|
+
rule: RULE$42,
|
|
10741
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.`
|
|
10742
10744
|
})), Option.toArray)));
|
|
10743
10745
|
/** @internal */
|
|
@@ -10892,7 +10894,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
10892
10894
|
/** @internal */
|
|
10893
10895
|
const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
|
|
10894
10896
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
10895
|
-
const RULE$
|
|
10897
|
+
const RULE$41 = "workflow-path";
|
|
10896
10898
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
10897
10899
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
10898
10900
|
const READ_CONCURRENCY$15 = 8;
|
|
@@ -10936,10 +10938,10 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
10936
10938
|
const problemOf$7 = (file, source) => (found) => ({
|
|
10937
10939
|
file,
|
|
10938
10940
|
...positionOf(source)(found.offset),
|
|
10939
|
-
rule: RULE$
|
|
10941
|
+
rule: RULE$41,
|
|
10940
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.`
|
|
10941
10943
|
});
|
|
10942
|
-
const problemsIn$
|
|
10944
|
+
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
10943
10945
|
const files = yield* RepositoryFiles;
|
|
10944
10946
|
const file = files.join(root, workflow);
|
|
10945
10947
|
const source = yield* files.readFile(file);
|
|
@@ -10951,7 +10953,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
|
|
|
10951
10953
|
/** @internal */
|
|
10952
10954
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
10953
10955
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10954
|
-
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 });
|
|
10955
10957
|
return Array.flatten(found);
|
|
10956
10958
|
});
|
|
10957
10959
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -10962,7 +10964,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
|
|
|
10962
10964
|
const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
10963
10965
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
10964
10966
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
10965
|
-
const START$
|
|
10967
|
+
const START$22 = 0;
|
|
10966
10968
|
const READ_CONCURRENCY$14 = 8;
|
|
10967
10969
|
const SEPARATOR$8 = "/";
|
|
10968
10970
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
@@ -10993,7 +10995,7 @@ const namesIn$1 = (name, source) => {
|
|
|
10993
10995
|
return [
|
|
10994
10996
|
{
|
|
10995
10997
|
text: name,
|
|
10996
|
-
offset: START$
|
|
10998
|
+
offset: START$22
|
|
10997
10999
|
},
|
|
10998
11000
|
...Option.toArray(stringOf(childOf("name")(root))),
|
|
10999
11001
|
...keysOf$1(childOf("jobs")(root))
|
|
@@ -11245,18 +11247,17 @@ const installedSize = (directory) => {
|
|
|
11245
11247
|
// src/features/measure-install-size/model/install-size.ts
|
|
11246
11248
|
const INSTALL_SIZE = "install-size";
|
|
11247
11249
|
const STACK_DEPENDENCY = "stack-dependency";
|
|
11248
|
-
const STACK_CATALOG = "catalog:stack";
|
|
11249
11250
|
const BUDGET_KEY = "installSize";
|
|
11250
11251
|
const DEPENDENCIES_KEY$1 = "\"dependencies\"";
|
|
11251
11252
|
const LISTED_LARGEST = 5;
|
|
11252
11253
|
const SIZE_CONCURRENCY = 32;
|
|
11253
11254
|
const MEGABYTE = 1e6;
|
|
11254
11255
|
const MEGABYTE_DIGITS = 1;
|
|
11255
|
-
const START$
|
|
11256
|
+
const START$21 = 0;
|
|
11256
11257
|
const SINGLE_ENTRY = 1;
|
|
11257
11258
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
11258
11259
|
const usageHint = (dependency, entryCount) => {
|
|
11259
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
11260
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$21 && dependency.entries.length < entryCount)) return "";
|
|
11260
11261
|
return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
|
|
11261
11262
|
};
|
|
11262
11263
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
|
|
@@ -11265,12 +11266,12 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
11265
11266
|
const { workspace, total } = overrun;
|
|
11266
11267
|
const config = yield* files.readFile(workspace.configFile);
|
|
11267
11268
|
const source = Option.getOrElse(config, () => "");
|
|
11268
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
11269
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$21);
|
|
11269
11270
|
return {
|
|
11270
11271
|
file: workspace.configFile,
|
|
11271
11272
|
...positionOf(source)(index),
|
|
11272
11273
|
rule: INSTALL_SIZE,
|
|
11273
|
-
message: `installing this package adds ${megabytes(total)} of dependencies besides its peers, over the ${workspace.installSize} in msch.publish.installSize. Largest: ${listed$1(overrun)}. Make a dependency imported only from some entries an optional peer, move one that the installing project already has to peerDependencies, or replace a heavy one. Raise installSize only when none of these applies.`
|
|
11274
|
+
message: `installing this package adds ${megabytes(total)} of dependencies besides its peers, over the ${workspace.installSize} in msch.publish.installSize. Largest: ${listed$1(overrun)}. Make a dependency imported only from some library entries an optional peer, make one that a bin needs at startup a required peer, move one that the installing project already has to peerDependencies, or replace a heavy one. Raise installSize only when none of these applies.`
|
|
11274
11275
|
};
|
|
11275
11276
|
});
|
|
11276
11277
|
const measure = Effect.fn("measure")(function* measure({ workspace, provided }, direct) {
|
|
@@ -11282,7 +11283,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
11282
11283
|
const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
|
|
11283
11284
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
11284
11285
|
const sizes = HashMap.fromIterable(measured);
|
|
11285
|
-
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);
|
|
11286
11287
|
return {
|
|
11287
11288
|
closures,
|
|
11288
11289
|
sizeOf,
|
|
@@ -11315,11 +11316,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
11315
11316
|
})];
|
|
11316
11317
|
});
|
|
11317
11318
|
const stackProblems = (file, source, dependencies) => {
|
|
11318
|
-
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);
|
|
11319
11320
|
const rest = String$1.slice(section)(source);
|
|
11320
11321
|
return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
|
|
11321
11322
|
file,
|
|
11322
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
11323
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$21)),
|
|
11323
11324
|
rule: STACK_DEPENDENCY,
|
|
11324
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.`
|
|
11325
11326
|
})));
|
|
@@ -11462,6 +11463,7 @@ const Manifest$4 = Schema.Struct({
|
|
|
11462
11463
|
bin: Schema.optional(Schema.Unknown),
|
|
11463
11464
|
sideEffects: Schema.optional(Schema.Unknown),
|
|
11464
11465
|
dependencies: Schema.optional(Versions),
|
|
11466
|
+
devDependencies: Schema.optional(Versions),
|
|
11465
11467
|
peerDependencies: Schema.optional(Versions),
|
|
11466
11468
|
optionalDependencies: Schema.optional(Versions),
|
|
11467
11469
|
peerDependenciesMeta: Schema.optional(Schema.Record(Schema.String, PeerMeta))
|
|
@@ -11472,6 +11474,7 @@ const runtimeDependenciesOf = ({ dependencies, peerDependencies, optionalDepende
|
|
|
11472
11474
|
optionalDependencies
|
|
11473
11475
|
], Array.flatMap(keysOf), Array.dedupe);
|
|
11474
11476
|
const optionalPeersOf = ({ peerDependenciesMeta }) => pipe(Option.fromUndefinedOr(peerDependenciesMeta), Option.map(Record.filter(({ optional }) => optional === true)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
11477
|
+
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
11475
11478
|
const decode = Schema.decodeOption(Schema.fromJsonString(Manifest$4));
|
|
11476
11479
|
const manifestOf$1 = (text) => decode(text);
|
|
11477
11480
|
const isFileList = Schema.is(Schema.Array(Schema.String));
|
|
@@ -11499,25 +11502,29 @@ const declaredBy$1 = ({ declared, locator }) => {
|
|
|
11499
11502
|
};
|
|
11500
11503
|
};
|
|
11501
11504
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
11502
|
-
const RULE$
|
|
11505
|
+
const RULE$40 = "optional-peer";
|
|
11503
11506
|
const REQUIRED_RULE = "required-peer";
|
|
11504
|
-
const START$
|
|
11507
|
+
const START$20 = 0;
|
|
11505
11508
|
const SINGLE = 1;
|
|
11506
11509
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
11507
11510
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
11508
11511
|
const importsPackage = (name) => ({ packages }) => Array.contains(packages, name);
|
|
11509
11512
|
const labelsOf = (importers) => pipe(importers, Array.map(({ entry }) => `\`${entry.label}\``), Array.dedupe, Array.join(", "));
|
|
11510
11513
|
const positionIn = (located, key, name) => {
|
|
11511
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
11514
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$20);
|
|
11512
11515
|
const rest = String$1.slice(section)(located.source);
|
|
11513
|
-
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));
|
|
11514
11517
|
};
|
|
11515
11518
|
const problemFor$3 = (located, name, importers) => ({
|
|
11516
11519
|
file: located.file,
|
|
11517
11520
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
11518
|
-
rule: RULE$
|
|
11521
|
+
rule: RULE$40,
|
|
11519
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.`
|
|
11520
11523
|
});
|
|
11524
|
+
const requiredPeerAdvice = (fromStack) => {
|
|
11525
|
+
if (fromStack) return "Make it a required peer by removing it from peerDependenciesMeta; it comes from the stack catalog, so every project that installs this package already has it.";
|
|
11526
|
+
return "Make it a required peer by removing it from peerDependenciesMeta when every project that installs this package already has it, or move it to dependencies, which count toward msch.publish.installSize.";
|
|
11527
|
+
};
|
|
11521
11528
|
const optionalPeerProblems = ({ located, dependencies, used }) => {
|
|
11522
11529
|
const libraries = pipe(used, Array.filter(({ entry }) => !isBinEntry(entry)));
|
|
11523
11530
|
const bins = pipe(used, Array.filter(({ entry }) => isBinEntry(entry)));
|
|
@@ -11525,11 +11532,11 @@ const optionalPeerProblems = ({ located, dependencies, used }) => {
|
|
|
11525
11532
|
return pipe(keysOf(dependencies), Array.flatMap((name) => {
|
|
11526
11533
|
const importers = pipe(libraries, Array.filter(importsPackage(name)));
|
|
11527
11534
|
const neededByBin = pipe(bins, Array.some(importsPackage(name)));
|
|
11528
|
-
if (!(importers.length > START$
|
|
11535
|
+
if (!(importers.length > START$20 && importers.length < libraries.length) || neededByBin) return [];
|
|
11529
11536
|
return [problemFor$3(located, name, importers)];
|
|
11530
11537
|
}));
|
|
11531
11538
|
};
|
|
11532
|
-
const requiredPeerProblems = ({ located, optional, used }) => {
|
|
11539
|
+
const requiredPeerProblems = ({ located, optional, stack, used }) => {
|
|
11533
11540
|
const libraries = pipe(used, Array.filter(({ entry }) => !isBinEntry(entry)));
|
|
11534
11541
|
return pipe(optional, Array.flatMap((name) => {
|
|
11535
11542
|
const bins = pipe(used, Array.filter((entry) => isBinEntry(entry.entry) && importsPackage(name)(entry)));
|
|
@@ -11540,14 +11547,14 @@ const requiredPeerProblems = ({ located, optional, used }) => {
|
|
|
11540
11547
|
file: located.file,
|
|
11541
11548
|
...positionIn(located, PEER_META_KEY, name),
|
|
11542
11549
|
rule: REQUIRED_RULE,
|
|
11543
|
-
message: `${name} is an optional peer, but ${labelsOf(importers)} import it at startup, so installing the package without it breaks them.
|
|
11550
|
+
message: `${name} is an optional peer, but ${labelsOf(importers)} import it at startup, so installing the package without it breaks them. ${requiredPeerAdvice(Array.contains(stack, name))}`
|
|
11544
11551
|
}];
|
|
11545
11552
|
}));
|
|
11546
11553
|
};
|
|
11547
11554
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
11548
|
-
const RULE$
|
|
11555
|
+
const RULE$39 = "side-effects";
|
|
11549
11556
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
11550
|
-
const START$
|
|
11557
|
+
const START$19 = 0;
|
|
11551
11558
|
const FIRST$8 = 1;
|
|
11552
11559
|
const LISTED_PACKAGES = 4;
|
|
11553
11560
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -11571,7 +11578,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
11571
11578
|
label: entry.label,
|
|
11572
11579
|
member,
|
|
11573
11580
|
...extra
|
|
11574
|
-
}, ({ modules }) => modules > START$
|
|
11581
|
+
}, ({ modules }) => modules > START$19);
|
|
11575
11582
|
});
|
|
11576
11583
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
11577
11584
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -11593,15 +11600,15 @@ const othersOf = (total) => {
|
|
|
11593
11600
|
};
|
|
11594
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.`;
|
|
11595
11602
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
11596
|
-
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));
|
|
11597
11604
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array.sortBy(largest), Array.head, Option.map((worst) => ({
|
|
11598
11605
|
file,
|
|
11599
11606
|
...positionOf(source)(keyIndex$1(source)),
|
|
11600
|
-
rule: RULE$
|
|
11607
|
+
rule: RULE$39,
|
|
11601
11608
|
message: messageOf$4(worst, excesses.length)
|
|
11602
11609
|
})), Option.toArray);
|
|
11603
11610
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
11604
|
-
const RULE$
|
|
11611
|
+
const RULE$38 = "top-level-effect";
|
|
11605
11612
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
11606
11613
|
const READ_CONCURRENCY$13 = 16;
|
|
11607
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.";
|
|
@@ -11614,10 +11621,10 @@ const messageOf$3 = (statement) => {
|
|
|
11614
11621
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
11615
11622
|
return STATEMENT_MESSAGE;
|
|
11616
11623
|
};
|
|
11617
|
-
const problemsIn$
|
|
11624
|
+
const problemsIn$13 = (api) => (file) => (source) => {
|
|
11618
11625
|
const retained = api.createSourceFile(file, source);
|
|
11619
11626
|
const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$7({
|
|
11620
|
-
rule: RULE$
|
|
11627
|
+
rule: RULE$38,
|
|
11621
11628
|
message: messageOf$3(statement)
|
|
11622
11629
|
})(statement)));
|
|
11623
11630
|
retained.dispose();
|
|
@@ -11630,7 +11637,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
11630
11637
|
const names = yield* files.ownedFiles(root);
|
|
11631
11638
|
const owned = new Set(pipe(names, Array.map((name) => files.join(root, name))));
|
|
11632
11639
|
const sources = pipe(modules, Array.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
11633
|
-
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 });
|
|
11634
11641
|
return Array.flatten(found);
|
|
11635
11642
|
}, Effect.scoped);
|
|
11636
11643
|
// src/features/check-tree-shaking/model/usage.ts
|
|
@@ -11720,6 +11727,7 @@ const analyse = Effect.fn("analyse")(function* analyse(pack) {
|
|
|
11720
11727
|
...requiredPeerProblems({
|
|
11721
11728
|
located,
|
|
11722
11729
|
optional: optionalPeersOf(manifest),
|
|
11730
|
+
stack: stackPackagesOf(manifest),
|
|
11723
11731
|
used
|
|
11724
11732
|
})
|
|
11725
11733
|
];
|
|
@@ -11749,7 +11757,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
11749
11757
|
return Array.flatten(found);
|
|
11750
11758
|
});
|
|
11751
11759
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
11752
|
-
const RULE$
|
|
11760
|
+
const RULE$37 = "legacy-typescript";
|
|
11753
11761
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
11754
11762
|
const COMPILER = "typescript";
|
|
11755
11763
|
const CURRENT_MAJOR = 7;
|
|
@@ -11780,12 +11788,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
11780
11788
|
file,
|
|
11781
11789
|
line: lineOf$2(source)(legacy.id),
|
|
11782
11790
|
column: FIRST$7,
|
|
11783
|
-
rule: RULE$
|
|
11791
|
+
rule: RULE$37,
|
|
11784
11792
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
11785
11793
|
})));
|
|
11786
11794
|
});
|
|
11787
11795
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
11788
|
-
const RULE$
|
|
11796
|
+
const RULE$36 = "worker-bundle";
|
|
11789
11797
|
const BUNDLE_CONCURRENCY = 4;
|
|
11790
11798
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
11791
11799
|
const CONDITIONS = [
|
|
@@ -11796,7 +11804,7 @@ const CONDITIONS = [
|
|
|
11796
11804
|
"module",
|
|
11797
11805
|
"default"
|
|
11798
11806
|
];
|
|
11799
|
-
const problemFor$2 = problemInFile(RULE$
|
|
11807
|
+
const problemFor$2 = problemInFile(RULE$36);
|
|
11800
11808
|
const problemOf$6 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
11801
11809
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
11802
11810
|
const built = yield* Effect.tryPromise({
|
|
@@ -11920,7 +11928,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
11920
11928
|
imports: importedFilesOf(checker)(sourceFile)
|
|
11921
11929
|
})), Array.filter((facts) => Array.isReadonlyArrayNonEmpty(facts.values) || Array.isReadonlyArrayNonEmpty(facts.imports)));
|
|
11922
11930
|
// src/features/check-value-owners/model/name-lists.ts
|
|
11923
|
-
const RULE$
|
|
11931
|
+
const RULE$35 = "hand-written-names";
|
|
11924
11932
|
const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
11925
11933
|
const nameListOf = (site) => {
|
|
11926
11934
|
if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -11935,7 +11943,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
11935
11943
|
file,
|
|
11936
11944
|
line,
|
|
11937
11945
|
column,
|
|
11938
|
-
rule: RULE$
|
|
11946
|
+
rule: RULE$35,
|
|
11939
11947
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
11940
11948
|
});
|
|
11941
11949
|
const problemOf$5 = ({ list, reason }) => listedProblem({
|
|
@@ -12734,7 +12742,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
12734
12742
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
12735
12743
|
}, Effect.scoped);
|
|
12736
12744
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
12737
|
-
const RULE$
|
|
12745
|
+
const RULE$34 = "namespace-destructuring";
|
|
12738
12746
|
const LOCAL = /^[.#/]/u;
|
|
12739
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.`;
|
|
12740
12748
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -12750,7 +12758,7 @@ const destructuredName = (declaration) => {
|
|
|
12750
12758
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
12751
12759
|
};
|
|
12752
12760
|
const problemOf$4 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
12753
|
-
rule: RULE$
|
|
12761
|
+
rule: RULE$34,
|
|
12754
12762
|
message: messageOf$1(name)
|
|
12755
12763
|
})), Option.map((report) => report(declaration)));
|
|
12756
12764
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -12758,7 +12766,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
12758
12766
|
return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$4(names)), Array.getSomes);
|
|
12759
12767
|
};
|
|
12760
12768
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
12761
|
-
const RULE$
|
|
12769
|
+
const RULE$33 = "pass-through-wrapper";
|
|
12762
12770
|
const SINGLE_STATEMENT = 1;
|
|
12763
12771
|
const SINGLE_DECLARATION = 1;
|
|
12764
12772
|
const THIS_PARAMETER = "this";
|
|
@@ -12855,7 +12863,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
12855
12863
|
const problemOf$3 = (checker) => (candidate) => {
|
|
12856
12864
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
12857
12865
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
12858
|
-
rule: RULE$
|
|
12866
|
+
rule: RULE$33,
|
|
12859
12867
|
message: messageOf(forward.callee.getText())
|
|
12860
12868
|
})(candidate.name)));
|
|
12861
12869
|
};
|
|
@@ -12881,7 +12889,7 @@ var plugins = [{
|
|
|
12881
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."
|
|
12882
12890
|
}];
|
|
12883
12891
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
12884
|
-
const RULE$
|
|
12892
|
+
const RULE$32 = "known-plugins";
|
|
12885
12893
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
12886
12894
|
const GITHUB$2 = "github";
|
|
12887
12895
|
const Source$1 = Schema.Struct({
|
|
@@ -12899,7 +12907,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
|
|
|
12899
12907
|
const REPOSITORY_NAME = "masseater/masseater.dev";
|
|
12900
12908
|
const MARKETPLACE = name;
|
|
12901
12909
|
const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
|
|
12902
|
-
const problem$1 = problemInFile(RULE$
|
|
12910
|
+
const problem$1 = problemInFile(RULE$32);
|
|
12903
12911
|
const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
|
|
12904
12912
|
const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
|
|
12905
12913
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
@@ -12920,20 +12928,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
12920
12928
|
return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
|
|
12921
12929
|
});
|
|
12922
12930
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
12923
|
-
const RULE$
|
|
12931
|
+
const RULE$31 = "missing-hook";
|
|
12924
12932
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
12925
12933
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
12926
12934
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
12927
12935
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
12928
12936
|
const PLUGIN_ROOT = "..";
|
|
12929
12937
|
const READ_CONCURRENCY$12 = 16;
|
|
12930
|
-
const START$
|
|
12938
|
+
const START$18 = 0;
|
|
12931
12939
|
const referenceOf$2 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
12932
12940
|
path,
|
|
12933
|
-
index: found.index ?? START$
|
|
12941
|
+
index: found.index ?? START$18
|
|
12934
12942
|
})), Option.toArray);
|
|
12935
12943
|
const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$2));
|
|
12936
|
-
const problemsIn$
|
|
12944
|
+
const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
12937
12945
|
const files = yield* RepositoryFiles;
|
|
12938
12946
|
const text = yield* files.readFile(file);
|
|
12939
12947
|
if (Option.isNone(text)) return [];
|
|
@@ -12945,7 +12953,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
12945
12953
|
return pipe(missing, Array.map(({ path, index }) => ({
|
|
12946
12954
|
file,
|
|
12947
12955
|
...positionOf(source)(index),
|
|
12948
|
-
rule: RULE$
|
|
12956
|
+
rule: RULE$31,
|
|
12949
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.`
|
|
12950
12958
|
})));
|
|
12951
12959
|
});
|
|
@@ -12969,7 +12977,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
12969
12977
|
}];
|
|
12970
12978
|
return [];
|
|
12971
12979
|
}));
|
|
12972
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$
|
|
12980
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$12, { concurrency: READ_CONCURRENCY$12 });
|
|
12973
12981
|
return Array.flatten(found);
|
|
12974
12982
|
});
|
|
12975
12983
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
@@ -12998,7 +13006,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
12998
13006
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
12999
13007
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
13000
13008
|
// src/features/check-documented-commands/model/commands.ts
|
|
13001
|
-
const RULE$
|
|
13009
|
+
const RULE$30 = "documented-commands";
|
|
13002
13010
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
13003
13011
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
13004
13012
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -13017,7 +13025,7 @@ const FILTER_ASSIGNMENT = "--filter=";
|
|
|
13017
13025
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
13018
13026
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
13019
13027
|
const ONE$1 = 1;
|
|
13020
|
-
const START$
|
|
13028
|
+
const START$17 = 0;
|
|
13021
13029
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
13022
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)))));
|
|
13023
13031
|
const follows = (tokens) => (index) => pipe(Array.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
@@ -13073,11 +13081,11 @@ const whereOf = (scope, file) => {
|
|
|
13073
13081
|
return `the package that holds ${file}`;
|
|
13074
13082
|
};
|
|
13075
13083
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array.some(hasTask(graph, task)));
|
|
13076
|
-
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 }) => ({
|
|
13077
13085
|
file: absolute(file),
|
|
13078
|
-
...positionOf(text)(match.index ?? START$
|
|
13079
|
-
rule: RULE$
|
|
13080
|
-
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`
|
|
13081
13089
|
})), Option.toArray)));
|
|
13082
13090
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
13083
13091
|
/** @internal */
|
|
@@ -13101,14 +13109,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
13101
13109
|
file: absolute(Array.headNonEmpty(commanded).file),
|
|
13102
13110
|
line: ONE$1,
|
|
13103
13111
|
column: ONE$1,
|
|
13104
|
-
rule: RULE$
|
|
13112
|
+
rule: RULE$30,
|
|
13105
13113
|
message: "msch could not list the tasks with `vp run --json`"
|
|
13106
13114
|
}],
|
|
13107
|
-
onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$
|
|
13115
|
+
onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$11(found, absolute, document)))
|
|
13108
13116
|
});
|
|
13109
13117
|
});
|
|
13110
13118
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
13111
|
-
const RULE$
|
|
13119
|
+
const RULE$29 = "legacy-web";
|
|
13112
13120
|
const FIRST_COLUMN$4 = 1;
|
|
13113
13121
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
13114
13122
|
const Finding = Schema.Struct({
|
|
@@ -13147,7 +13155,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
13147
13155
|
file: files.join(root, file),
|
|
13148
13156
|
line,
|
|
13149
13157
|
column: FIRST_COLUMN$4,
|
|
13150
|
-
rule: RULE$
|
|
13158
|
+
rule: RULE$29,
|
|
13151
13159
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
13152
13160
|
});
|
|
13153
13161
|
return pipe(scan.guides, Array.flatMap(({ guideId, rules }) => pipe(rules, Array.flatMap(({ ruleId, findings }) => pipe(findings, Array.map(problemOf(guideId, ruleId)))))));
|
|
@@ -13218,8 +13226,8 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
|
|
|
13218
13226
|
const EXTENSION = /\.[^./]+$/u;
|
|
13219
13227
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
13220
13228
|
const READ_CONCURRENCY$11 = 64;
|
|
13221
|
-
const RULE$
|
|
13222
|
-
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.";
|
|
13223
13231
|
const HookSchema = Schema.Struct({
|
|
13224
13232
|
command: Schema.optional(Schema.String),
|
|
13225
13233
|
args: Schema.String.pipe(Schema.Array, Schema.optional)
|
|
@@ -13251,7 +13259,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
13251
13259
|
};
|
|
13252
13260
|
const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
|
|
13253
13261
|
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$11 });
|
|
13254
|
-
return pipe(shell, Array.map((name) => problemInFile(RULE$
|
|
13262
|
+
return pipe(shell, Array.map((name) => problemInFile(RULE$28)(files.join(root, name), MESSAGE$12)));
|
|
13255
13263
|
});
|
|
13256
13264
|
// src/shared/lib/workflow-files.ts
|
|
13257
13265
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
@@ -13270,8 +13278,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
13270
13278
|
});
|
|
13271
13279
|
// src/shared/lib/workflow-run.ts
|
|
13272
13280
|
const RUN_KEY = "run";
|
|
13273
|
-
const START$
|
|
13274
|
-
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));
|
|
13275
13283
|
const runScriptsOf = (source) => {
|
|
13276
13284
|
const found = [];
|
|
13277
13285
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -13286,23 +13294,23 @@ const runScriptsOf = (source) => {
|
|
|
13286
13294
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
13287
13295
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
13288
13296
|
const COMMENT = "#";
|
|
13289
|
-
const RULE$
|
|
13297
|
+
const RULE$27 = "workflow-script";
|
|
13290
13298
|
const ONE_COMMAND = 1;
|
|
13291
|
-
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.";
|
|
13292
13300
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
13293
13301
|
const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
|
|
13294
13302
|
const runsMoreThanOneCommand = ({ text }) => {
|
|
13295
13303
|
const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
|
|
13296
13304
|
return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
|
|
13297
13305
|
};
|
|
13298
|
-
const problemsIn$
|
|
13306
|
+
const problemsIn$10 = (file) => (source) => {
|
|
13299
13307
|
const at = positionOf(source);
|
|
13300
|
-
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)));
|
|
13301
13309
|
};
|
|
13302
13310
|
/** @internal */
|
|
13303
13311
|
const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
|
|
13304
13312
|
const workflows = yield* readWorkflows(root);
|
|
13305
|
-
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$
|
|
13313
|
+
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$10(file)(source)));
|
|
13306
13314
|
});
|
|
13307
13315
|
// src/features/check-scripts/model/script-checks.ts
|
|
13308
13316
|
/** @internal */
|
|
@@ -13347,16 +13355,16 @@ const SKIP_HOOKS = "--no-verify";
|
|
|
13347
13355
|
const BYPASS_RULESET = "--admin";
|
|
13348
13356
|
const FILTER = /^(?:--filter(?:=.*)?|-F)$/u;
|
|
13349
13357
|
const TASK_KINDS = ["script", "task"];
|
|
13350
|
-
const SECOND = 1;
|
|
13358
|
+
const SECOND$1 = 1;
|
|
13351
13359
|
const DOC_KIND = "doc";
|
|
13352
13360
|
const NODE = "node";
|
|
13353
13361
|
const INLINE_CODE$1 = /^(?:--eval(?:=.*)?|--print(?:=.*)?|-[a-z]*[ep][a-z]*)$/u;
|
|
13354
13362
|
const programOf = (words) => Array.headNonEmpty(words);
|
|
13355
|
-
const subcommandOf = (words) => Array.get(words, SECOND);
|
|
13363
|
+
const subcommandOf = (words) => Array.get(words, SECOND$1);
|
|
13356
13364
|
const RULES = [
|
|
13357
13365
|
{
|
|
13358
13366
|
rule: "package-manager-command",
|
|
13359
|
-
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),
|
|
13360
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.`
|
|
13361
13369
|
},
|
|
13362
13370
|
{
|
|
@@ -13371,7 +13379,7 @@ const RULES = [
|
|
|
13371
13379
|
},
|
|
13372
13380
|
{
|
|
13373
13381
|
rule: "inline-script",
|
|
13374
|
-
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))),
|
|
13375
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.`
|
|
13376
13384
|
}
|
|
13377
13385
|
];
|
|
@@ -13383,7 +13391,7 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array.flatMap((
|
|
|
13383
13391
|
})))));
|
|
13384
13392
|
const commandProblems$1 = (sources) => pipe(sources, Array.flatMap(problemsOf));
|
|
13385
13393
|
// src/features/check-vite-plus/model/doc-sources.ts
|
|
13386
|
-
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;
|
|
13387
13395
|
const INLINE_CODE = /(?<open>(?<!`)`)(?<body>[^`\n]+)`(?!`)/gu;
|
|
13388
13396
|
const codeIn = (pattern) => (source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => pipe(Option.all({
|
|
13389
13397
|
open: groupOf("open")(match),
|
|
@@ -13397,7 +13405,7 @@ const codeIn = (pattern) => (source) => pipe(Array.fromIterable(String$1.matchAl
|
|
|
13397
13405
|
})), Option.toArray)));
|
|
13398
13406
|
const outside = (fences) => (span) => !pipe(fences, Array.some((fence) => span.start >= fence.start && span.start < fence.end));
|
|
13399
13407
|
const docSources = (file) => (source) => {
|
|
13400
|
-
const fences = codeIn(FENCE)(source);
|
|
13408
|
+
const fences = codeIn(FENCE$1)(source);
|
|
13401
13409
|
const inline = pipe(codeIn(INLINE_CODE)(source), Array.filter(outside(fences)));
|
|
13402
13410
|
return pipe([...fences, ...inline], Array.map(({ text, start }) => ({
|
|
13403
13411
|
kind: "doc",
|
|
@@ -13428,7 +13436,7 @@ const AGENT_DOCS = [
|
|
|
13428
13436
|
...EXCLUDED$4
|
|
13429
13437
|
];
|
|
13430
13438
|
const READ_CONCURRENCY$9 = 16;
|
|
13431
|
-
const START$
|
|
13439
|
+
const START$15 = 0;
|
|
13432
13440
|
const FIRST$5 = 1;
|
|
13433
13441
|
const LINE = "\n";
|
|
13434
13442
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -13438,7 +13446,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
|
|
|
13438
13446
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
13439
13447
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13440
13448
|
const NO_SOURCES = [];
|
|
13441
|
-
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));
|
|
13442
13450
|
const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
|
|
13443
13451
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
13444
13452
|
return {
|
|
@@ -13534,7 +13542,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
13534
13542
|
return Array.flatten(found);
|
|
13535
13543
|
});
|
|
13536
13544
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
13537
|
-
const RULE$
|
|
13545
|
+
const RULE$26 = "package-script";
|
|
13538
13546
|
const LIFECYCLE = [
|
|
13539
13547
|
"preinstall",
|
|
13540
13548
|
"install",
|
|
@@ -13557,26 +13565,26 @@ const LIFECYCLE = [
|
|
|
13557
13565
|
const problemOf$2 = ({ file, position, name }) => ({
|
|
13558
13566
|
file,
|
|
13559
13567
|
...position,
|
|
13560
|
-
rule: RULE$
|
|
13568
|
+
rule: RULE$26,
|
|
13561
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.`
|
|
13562
13570
|
});
|
|
13563
13571
|
const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$2));
|
|
13564
13572
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
13565
|
-
const RULE$
|
|
13573
|
+
const RULE$25 = "vite-plus-block";
|
|
13566
13574
|
const MARKER = Array.join([
|
|
13567
13575
|
"<!--",
|
|
13568
13576
|
"VITE PLUS START",
|
|
13569
13577
|
"-->"
|
|
13570
13578
|
], "");
|
|
13571
|
-
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.";
|
|
13572
13580
|
const problemIn = (file) => (source) => {
|
|
13573
13581
|
const index = String$1.indexOf(MARKER)(source);
|
|
13574
13582
|
if (Option.isNone(index)) return Option.none();
|
|
13575
13583
|
return Option.some({
|
|
13576
13584
|
file,
|
|
13577
13585
|
...positionOf(source)(index.value),
|
|
13578
|
-
rule: RULE$
|
|
13579
|
-
message: MESSAGE$
|
|
13586
|
+
rule: RULE$25,
|
|
13587
|
+
message: MESSAGE$10
|
|
13580
13588
|
});
|
|
13581
13589
|
};
|
|
13582
13590
|
/** @internal */
|
|
@@ -13631,11 +13639,11 @@ const checkFullHistoryCheckout = workflowCheck({
|
|
|
13631
13639
|
})
|
|
13632
13640
|
});
|
|
13633
13641
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
13634
|
-
const RULE$
|
|
13642
|
+
const RULE$23 = "publish-trigger";
|
|
13635
13643
|
const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
|
|
13636
13644
|
const MANUAL = "workflow_dispatch";
|
|
13637
13645
|
const TRIGGER_KEY = "on";
|
|
13638
|
-
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`.";
|
|
13639
13647
|
const triggersOf = (node) => {
|
|
13640
13648
|
if (isScalar(node)) return [String(node.value)];
|
|
13641
13649
|
if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
|
|
@@ -13651,19 +13659,19 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
13651
13659
|
};
|
|
13652
13660
|
/** @internal */
|
|
13653
13661
|
const checkPublishTrigger = workflowCheck({
|
|
13654
|
-
rule: RULE$
|
|
13655
|
-
message: MESSAGE$
|
|
13662
|
+
rule: RULE$23,
|
|
13663
|
+
message: MESSAGE$8,
|
|
13656
13664
|
offsetsOf: publishTriggerOffsetsOf
|
|
13657
13665
|
});
|
|
13658
13666
|
// src/features/check-workflows/model/release-please.ts
|
|
13659
|
-
const RULE$
|
|
13667
|
+
const RULE$22 = "release-please";
|
|
13660
13668
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
13661
13669
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
13662
13670
|
const FIRST$4 = 1;
|
|
13663
|
-
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.";
|
|
13664
13672
|
const checkReleasePleaseSteps = workflowCheck({
|
|
13665
|
-
rule: RULE$
|
|
13666
|
-
message: MESSAGE$
|
|
13673
|
+
rule: RULE$22,
|
|
13674
|
+
message: MESSAGE$7,
|
|
13667
13675
|
offsetsOf: scalarKeyOffsets({
|
|
13668
13676
|
name: "uses",
|
|
13669
13677
|
matches: (value) => RELEASE_PLEASE.test(value)
|
|
@@ -13676,8 +13684,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
13676
13684
|
file: files.join(root, name),
|
|
13677
13685
|
line: FIRST$4,
|
|
13678
13686
|
column: FIRST$4,
|
|
13679
|
-
rule: RULE$
|
|
13680
|
-
message: MESSAGE$
|
|
13687
|
+
rule: RULE$22,
|
|
13688
|
+
message: MESSAGE$7
|
|
13681
13689
|
})));
|
|
13682
13690
|
});
|
|
13683
13691
|
/** @internal */
|
|
@@ -13688,26 +13696,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
13688
13696
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
13689
13697
|
const CONCURRENCY_KEY = "concurrency";
|
|
13690
13698
|
const QUEUE_KEY = "queue";
|
|
13691
|
-
const RULE$
|
|
13692
|
-
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.";
|
|
13693
13701
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
13694
13702
|
/** @internal */
|
|
13695
13703
|
const checkWorkflowQueues = workflowCheck({
|
|
13696
|
-
rule: RULE$
|
|
13697
|
-
message: MESSAGE$
|
|
13704
|
+
rule: RULE$21,
|
|
13705
|
+
message: MESSAGE$6,
|
|
13698
13706
|
offsetsOf: queueOffsetsOf
|
|
13699
13707
|
});
|
|
13700
13708
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
13701
|
-
const RULE$
|
|
13709
|
+
const RULE$20 = "workflow-commit";
|
|
13702
13710
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
13703
13711
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
13704
|
-
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.";
|
|
13705
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)));
|
|
13706
13714
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
13707
13715
|
/** @internal */
|
|
13708
13716
|
const checkWorkflowCommits = workflowCheck({
|
|
13709
|
-
rule: RULE$
|
|
13710
|
-
message: MESSAGE$
|
|
13717
|
+
rule: RULE$20,
|
|
13718
|
+
message: MESSAGE$5,
|
|
13711
13719
|
offsetsOf: commitOffsetsOf
|
|
13712
13720
|
});
|
|
13713
13721
|
// src/features/check-workflows/model/workflow-lint.ts
|
|
@@ -13817,7 +13825,7 @@ const COMMENT_NODES = [
|
|
|
13817
13825
|
"block_comment",
|
|
13818
13826
|
"multiline_comment"
|
|
13819
13827
|
];
|
|
13820
|
-
const START$
|
|
13828
|
+
const START$14 = 0;
|
|
13821
13829
|
const NEXT = 1;
|
|
13822
13830
|
const NONE = [];
|
|
13823
13831
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -13867,7 +13875,7 @@ const markupComment = (source) => (node) => {
|
|
|
13867
13875
|
}];
|
|
13868
13876
|
};
|
|
13869
13877
|
const textComments = (grammars, grammar) => (text) => {
|
|
13870
|
-
const shift = shifted(text.startIndex ?? START$
|
|
13878
|
+
const shift = shifted(text.startIndex ?? START$14);
|
|
13871
13879
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
|
|
13872
13880
|
};
|
|
13873
13881
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -13933,17 +13941,17 @@ const shebangReader = (source) => {
|
|
|
13933
13941
|
};
|
|
13934
13942
|
const readerOf = (name) => (source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
|
|
13935
13943
|
// src/features/ban-comments/model/comments.ts
|
|
13936
|
-
const RULE$
|
|
13944
|
+
const RULE$19 = "comment";
|
|
13937
13945
|
const UNUSED_RULE$1 = "unused-comment-allowance";
|
|
13938
13946
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
13939
13947
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
13940
13948
|
const READ_CONCURRENCY$8 = 64;
|
|
13941
|
-
const START$
|
|
13949
|
+
const START$13 = 0;
|
|
13942
13950
|
const SHEBANG = "#!";
|
|
13943
13951
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
13944
13952
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
13945
13953
|
const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
|
|
13946
|
-
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.";
|
|
13947
13955
|
const Patterns = Schema.Array(Schema.String);
|
|
13948
13956
|
const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
13949
13957
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
@@ -13960,11 +13968,11 @@ const taggedError$2 = Schema.TaggedError;
|
|
|
13960
13968
|
var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
13961
13969
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
13962
13970
|
const lineBefore = (source, index) => {
|
|
13963
|
-
const lines = pipe(source, String$1.slice(START$
|
|
13971
|
+
const lines = pipe(source, String$1.slice(START$13, index), String$1.split("\n"));
|
|
13964
13972
|
return Option.getOrElse(Array.last(lines), () => "");
|
|
13965
13973
|
};
|
|
13966
13974
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
13967
|
-
const isShebang = ({ index, text }) => index === START$
|
|
13975
|
+
const isShebang = ({ index, text }) => index === START$13 && String$1.startsWith(SHEBANG)(text);
|
|
13968
13976
|
const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
|
|
13969
13977
|
const NOTHING = {
|
|
13970
13978
|
problems: [],
|
|
@@ -13974,8 +13982,8 @@ const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but n
|
|
|
13974
13982
|
const problemOf$1 = (file, source) => ({ index }) => ({
|
|
13975
13983
|
file,
|
|
13976
13984
|
...positionOf(source)(index),
|
|
13977
|
-
rule: RULE$
|
|
13978
|
-
message: MESSAGE$
|
|
13985
|
+
rule: RULE$19,
|
|
13986
|
+
message: MESSAGE$4
|
|
13979
13987
|
});
|
|
13980
13988
|
const settingsOf = ({ msch, lint }) => ({
|
|
13981
13989
|
allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
@@ -14011,7 +14019,7 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, sett
|
|
|
14011
14019
|
})), Array.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
14012
14020
|
});
|
|
14013
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));
|
|
14014
|
-
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));
|
|
14015
14023
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
14016
14024
|
const files = yield* RepositoryFiles;
|
|
14017
14025
|
const file = files.join(root, CONFIG_FILE$2);
|
|
@@ -14033,7 +14041,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
14033
14041
|
problems: pipe(found, Array.filter(kept), Array.map(toProblem)),
|
|
14034
14042
|
used: usedAllowances(allowances, found)
|
|
14035
14043
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
14036
|
-
problems: [problemInFile(RULE$
|
|
14044
|
+
problems: [problemInFile(RULE$19)(file, `msch could not read the comments in this file: ${message}`)],
|
|
14037
14045
|
used: []
|
|
14038
14046
|
})))
|
|
14039
14047
|
});
|
|
@@ -14146,7 +14154,7 @@ const PYTHON = {
|
|
|
14146
14154
|
/** @internal */
|
|
14147
14155
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
14148
14156
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
14149
|
-
const RULE$
|
|
14157
|
+
const RULE$18 = "uncataloged-dependency";
|
|
14150
14158
|
const OWNED_ELSEWHERE = [
|
|
14151
14159
|
"catalog:",
|
|
14152
14160
|
"workspace:",
|
|
@@ -14155,13 +14163,13 @@ const OWNED_ELSEWHERE = [
|
|
|
14155
14163
|
];
|
|
14156
14164
|
const ROOT_DIRECTORY$2 = ".";
|
|
14157
14165
|
const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
|
|
14158
|
-
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.";
|
|
14159
14167
|
const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array.some((protocol) => String$1.startsWith(protocol)(specifier)));
|
|
14160
|
-
const problemsIn$
|
|
14168
|
+
const problemsIn$9 = (entry, source) => pipe(manifestSpecifiers(source), Array.filter((found) => !isOwnedElsewhere(found)), Array.map((found) => ({
|
|
14161
14169
|
file: entry.file,
|
|
14162
14170
|
...positionOf(source)(offsetIn$1(source)(manifestPattern(found))),
|
|
14163
|
-
rule: RULE$
|
|
14164
|
-
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$
|
|
14171
|
+
rule: RULE$18,
|
|
14172
|
+
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$3}`
|
|
14165
14173
|
})));
|
|
14166
14174
|
/** @internal */
|
|
14167
14175
|
const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* uncatalogedDependencies(root) {
|
|
@@ -14175,7 +14183,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
14175
14183
|
file: files.join(root, name)
|
|
14176
14184
|
};
|
|
14177
14185
|
}));
|
|
14178
|
-
return yield* scanText(listed, problemsIn$
|
|
14186
|
+
return yield* scanText(listed, problemsIn$9);
|
|
14179
14187
|
});
|
|
14180
14188
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
14181
14189
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
@@ -14273,7 +14281,7 @@ const CONFIG_FILE$1 = "vite.config.ts";
|
|
|
14273
14281
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
14274
14282
|
const SOURCE = "masseater/skills";
|
|
14275
14283
|
const PRESET$1 = "github>masseater/ecosystems//libs/vite-plus-adopt/renovate";
|
|
14276
|
-
const START$
|
|
14284
|
+
const START$12 = 0;
|
|
14277
14285
|
const LOCAL_PREFIX = "./";
|
|
14278
14286
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
14279
14287
|
const Source = Schema.Struct({
|
|
@@ -14286,7 +14294,7 @@ const taggedError$1 = Schema.TaggedError;
|
|
|
14286
14294
|
var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
14287
14295
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
14288
14296
|
file,
|
|
14289
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
14297
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$12))),
|
|
14290
14298
|
rule,
|
|
14291
14299
|
message
|
|
14292
14300
|
});
|
|
@@ -14333,14 +14341,14 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
14333
14341
|
];
|
|
14334
14342
|
});
|
|
14335
14343
|
// src/features/check-skills/model/published-skills.ts
|
|
14336
|
-
const RULE$
|
|
14344
|
+
const RULE$17 = "published-skills";
|
|
14337
14345
|
const KEYWORD = "tanstack-intent";
|
|
14338
14346
|
const SKILLS = "skills";
|
|
14339
14347
|
const MANIFEST_FILE = "package.json";
|
|
14340
14348
|
const SKILL_FILE$1 = "SKILL.md";
|
|
14341
14349
|
const SUCCEEDED = 0;
|
|
14342
14350
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
14343
|
-
const problemAt$2 = problemInFile(RULE$
|
|
14351
|
+
const problemAt$2 = problemInFile(RULE$17);
|
|
14344
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))));
|
|
14345
14353
|
const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
|
|
14346
14354
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -14361,7 +14369,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
|
|
|
14361
14369
|
const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
|
|
14362
14370
|
return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
|
|
14363
14371
|
}, Effect.scoped);
|
|
14364
|
-
const problemsIn$
|
|
14372
|
+
const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
|
|
14365
14373
|
const files = yield* RepositoryFiles;
|
|
14366
14374
|
const directory = files.join(root, project.directory);
|
|
14367
14375
|
const manifest = files.join(directory, MANIFEST_FILE);
|
|
@@ -14373,15 +14381,15 @@ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, project)
|
|
|
14373
14381
|
/** @internal */
|
|
14374
14382
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
14375
14383
|
const projects = yield* publishedProjects(root);
|
|
14376
|
-
const problems = yield* Effect.forEach(projects, (project) => problemsIn$
|
|
14384
|
+
const problems = yield* Effect.forEach(projects, (project) => problemsIn$8(root, project), { concurrency: 1 });
|
|
14377
14385
|
return Array.flatten(problems);
|
|
14378
14386
|
});
|
|
14379
14387
|
// src/features/check-skills/model/skill-files.ts
|
|
14380
|
-
const RULE$
|
|
14388
|
+
const RULE$16 = "skill-file";
|
|
14381
14389
|
const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
|
|
14382
14390
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
14383
14391
|
const FIXTURE = /(?:^|\/)fixtures\//u;
|
|
14384
|
-
const MARKDOWN = ".md";
|
|
14392
|
+
const MARKDOWN$1 = ".md";
|
|
14385
14393
|
const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
|
|
14386
14394
|
const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
|
|
14387
14395
|
const HEADING = /^# (?<title>.+)$/mu;
|
|
@@ -14395,7 +14403,7 @@ const GITHUB = "https://github.com/";
|
|
|
14395
14403
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
14396
14404
|
const BLANK = /\s+/u;
|
|
14397
14405
|
const SEPARATOR$2 = "/";
|
|
14398
|
-
const START$
|
|
14406
|
+
const START$11 = 0;
|
|
14399
14407
|
const FIRST$3 = 1;
|
|
14400
14408
|
const READ_CONCURRENCY$6 = 16;
|
|
14401
14409
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -14405,9 +14413,9 @@ const Frontmatter = Schema.Struct({
|
|
|
14405
14413
|
metadata: Schema.optional(Metadata)
|
|
14406
14414
|
});
|
|
14407
14415
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
14408
|
-
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));
|
|
14409
14417
|
const frontmatterOf = (source) => pipe(groupOf("yaml")(FRONTMATTER.exec(source)), Option.flatMap(Option.liftThrowable((yaml) => parse$2(yaml))), Option.flatMap(decodeFrontmatter));
|
|
14410
|
-
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));
|
|
14411
14419
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
14412
14420
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
14413
14421
|
const bodyStart = bodyStartOf(source);
|
|
@@ -14435,16 +14443,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
14435
14443
|
]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
|
|
14436
14444
|
file: skill.file,
|
|
14437
14445
|
...positionOf(skill.source)(index),
|
|
14438
|
-
rule: RULE$
|
|
14446
|
+
rule: RULE$16,
|
|
14439
14447
|
message
|
|
14440
14448
|
})));
|
|
14441
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) => ({
|
|
14442
14450
|
target,
|
|
14443
|
-
index: found.index ?? START$
|
|
14451
|
+
index: found.index ?? START$11
|
|
14444
14452
|
})), Option.toArray);
|
|
14445
14453
|
const rangeOf$1 = (found) => {
|
|
14446
|
-
const start = found.index ?? START$
|
|
14447
|
-
return [start, start + found[START$
|
|
14454
|
+
const start = found.index ?? START$11;
|
|
14455
|
+
return [start, start + found[START$11].length];
|
|
14448
14456
|
};
|
|
14449
14457
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
|
|
14450
14458
|
const linksIn$1 = (source) => {
|
|
@@ -14462,23 +14470,23 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
14462
14470
|
return pipe(missing, Array.map(({ target, index }) => ({
|
|
14463
14471
|
file,
|
|
14464
14472
|
...positionOf(source)(index),
|
|
14465
|
-
rule: RULE$
|
|
14473
|
+
rule: RULE$16,
|
|
14466
14474
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
14467
14475
|
})));
|
|
14468
14476
|
});
|
|
14469
|
-
const problemsIn$
|
|
14477
|
+
const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
|
|
14470
14478
|
const files = yield* RepositoryFiles;
|
|
14471
14479
|
const file = files.join(root, name);
|
|
14472
14480
|
const directory = files.dirname(name);
|
|
14473
14481
|
const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$2}`)));
|
|
14474
14482
|
const text = yield* files.readFile(file);
|
|
14475
|
-
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)));
|
|
14476
14484
|
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$6 });
|
|
14477
14485
|
const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
|
|
14478
14486
|
file: files.join(root, entry),
|
|
14479
14487
|
line: FIRST$3,
|
|
14480
14488
|
column: FIRST$3,
|
|
14481
|
-
rule: RULE$
|
|
14489
|
+
rule: RULE$16,
|
|
14482
14490
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
14483
14491
|
})));
|
|
14484
14492
|
return [
|
|
@@ -14495,7 +14503,7 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
14495
14503
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
14496
14504
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
14497
14505
|
const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name) && !FIXTURE.test(name)));
|
|
14498
|
-
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 });
|
|
14499
14507
|
return Array.flatten(found);
|
|
14500
14508
|
});
|
|
14501
14509
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -14556,7 +14564,7 @@ const cargoEntries = (text) => {
|
|
|
14556
14564
|
};
|
|
14557
14565
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
14558
14566
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
14559
|
-
const RULE$
|
|
14567
|
+
const RULE$15 = "version-downgrade";
|
|
14560
14568
|
const READ_CONCURRENCY$5 = 16;
|
|
14561
14569
|
const READERS = [
|
|
14562
14570
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
@@ -14581,7 +14589,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
14581
14589
|
file,
|
|
14582
14590
|
line: lineOf(text, entry),
|
|
14583
14591
|
column: FIRST_LINE$2,
|
|
14584
|
-
rule: RULE$
|
|
14592
|
+
rule: RULE$15,
|
|
14585
14593
|
message: message$1(old, entry)
|
|
14586
14594
|
})), Option.toArray)));
|
|
14587
14595
|
};
|
|
@@ -14612,13 +14620,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
14612
14620
|
const CAP_RULE = "renovate-version-cap";
|
|
14613
14621
|
const PRESET_RULE = "renovate-msch-preset";
|
|
14614
14622
|
const PRESET = "github>masseater/ecosystems//libs/msch/renovate";
|
|
14615
|
-
const START$
|
|
14623
|
+
const START$10 = 0;
|
|
14616
14624
|
const READ_CONCURRENCY$4 = 16;
|
|
14617
14625
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
14618
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.";
|
|
14619
14627
|
const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
14620
14628
|
const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
|
|
14621
|
-
const problemsIn$
|
|
14629
|
+
const problemsIn$6 = (file, source) => {
|
|
14622
14630
|
const at = positionOf(source);
|
|
14623
14631
|
const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
|
|
14624
14632
|
file,
|
|
@@ -14631,7 +14639,7 @@ const problemsIn$5 = (file, source) => {
|
|
|
14631
14639
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
14632
14640
|
...pipe([{
|
|
14633
14641
|
file,
|
|
14634
|
-
...at(START$
|
|
14642
|
+
...at(START$10),
|
|
14635
14643
|
rule: PRESET_RULE,
|
|
14636
14644
|
message: PRESET_MESSAGE
|
|
14637
14645
|
}], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
|
|
@@ -14645,13 +14653,13 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
14645
14653
|
const file = files.join(root, name);
|
|
14646
14654
|
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
14647
14655
|
onNone: () => [],
|
|
14648
|
-
onSome: (source) => problemsIn$
|
|
14656
|
+
onSome: (source) => problemsIn$6(file, source)
|
|
14649
14657
|
})));
|
|
14650
14658
|
}, { concurrency: READ_CONCURRENCY$4 });
|
|
14651
14659
|
return Array.flatten(found);
|
|
14652
14660
|
});
|
|
14653
14661
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
14654
|
-
const RULE$
|
|
14662
|
+
const RULE$14 = "unbumped-package";
|
|
14655
14663
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
14656
14664
|
const UNVERSIONED = "0.0.0";
|
|
14657
14665
|
const FIRST_LINE$1 = 1;
|
|
@@ -14708,51 +14716,16 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
14708
14716
|
file: files.join(root, pack.file),
|
|
14709
14717
|
line: versionLine(pack.text),
|
|
14710
14718
|
column: FIRST_COLUMN$1,
|
|
14711
|
-
rule: RULE$
|
|
14719
|
+
rule: RULE$14,
|
|
14712
14720
|
message: message(pack, lowest)
|
|
14713
14721
|
})), Option.toArray);
|
|
14714
14722
|
}), { concurrency: READ_CONCURRENCY$3 });
|
|
14715
14723
|
return Array.flatten(found);
|
|
14716
14724
|
});
|
|
14717
|
-
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
14718
|
-
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;
|
|
14719
|
-
const NUL = "\0";
|
|
14720
|
-
const START$8 = 0;
|
|
14721
|
-
const HEX = 16;
|
|
14722
|
-
const CODE_POINT_WIDTH = 4;
|
|
14723
|
-
const READ_CONCURRENCY$2 = 64;
|
|
14724
|
-
const RULE$12 = "hidden-unicode";
|
|
14725
|
-
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"));
|
|
14726
|
-
const problemOf = (file, source) => (found) => {
|
|
14727
|
-
const hex = hexOf(found[START$8]);
|
|
14728
|
-
return {
|
|
14729
|
-
file,
|
|
14730
|
-
...positionOf(source)(found.index ?? START$8),
|
|
14731
|
-
rule: RULE$12,
|
|
14732
|
-
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}.`
|
|
14733
|
-
};
|
|
14734
|
-
};
|
|
14735
|
-
const problemsIn$4 = (file, source) => {
|
|
14736
|
-
if (String$1.includes(NUL)(source)) return [];
|
|
14737
|
-
return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf(file, source)));
|
|
14738
|
-
};
|
|
14739
|
-
/** @internal */
|
|
14740
|
-
const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
|
|
14741
|
-
const files = yield* RepositoryFiles;
|
|
14742
|
-
const names = yield* files.listedFiles(root);
|
|
14743
|
-
const found = yield* Effect.forEach(names, (name) => {
|
|
14744
|
-
const file = files.join(root, name);
|
|
14745
|
-
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
14746
|
-
onNone: () => [],
|
|
14747
|
-
onSome: (source) => problemsIn$4(file, source)
|
|
14748
|
-
})));
|
|
14749
|
-
}, { concurrency: READ_CONCURRENCY$2 });
|
|
14750
|
-
return Array.flatten(found);
|
|
14751
|
-
});
|
|
14752
14725
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
14753
14726
|
const MSCH = "@r_masseater/msch";
|
|
14754
14727
|
const SCOPE$1 = "@r_masseater/";
|
|
14755
|
-
const RULE$
|
|
14728
|
+
const RULE$13 = "applied-package";
|
|
14756
14729
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
14757
14730
|
const NOT_FOUND = -1;
|
|
14758
14731
|
const SEPARATOR$1 = "/";
|
|
@@ -14797,7 +14770,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
14797
14770
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
14798
14771
|
file,
|
|
14799
14772
|
...positionOf(source)(index),
|
|
14800
|
-
rule: RULE$
|
|
14773
|
+
rule: RULE$13,
|
|
14801
14774
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
14802
14775
|
});
|
|
14803
14776
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
@@ -14852,7 +14825,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
14852
14825
|
return yield* appliedPackageProblems(root, applied);
|
|
14853
14826
|
});
|
|
14854
14827
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
14855
|
-
const RULE$
|
|
14828
|
+
const RULE$12 = "replaced-tool";
|
|
14856
14829
|
const FIRST$2 = 1;
|
|
14857
14830
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
14858
14831
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -14933,7 +14906,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ patte
|
|
|
14933
14906
|
file,
|
|
14934
14907
|
line: FIRST$2,
|
|
14935
14908
|
column: FIRST$2,
|
|
14936
|
-
rule: RULE$
|
|
14909
|
+
rule: RULE$12,
|
|
14937
14910
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
14938
14911
|
})));
|
|
14939
14912
|
/** @internal */
|
|
@@ -14967,7 +14940,7 @@ const SETUP_PATTERNS = [
|
|
|
14967
14940
|
];
|
|
14968
14941
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
14969
14942
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
14970
|
-
const START$
|
|
14943
|
+
const START$9 = 0;
|
|
14971
14944
|
const LAST_SEGMENT = 1;
|
|
14972
14945
|
const FIRST_LINE = 1;
|
|
14973
14946
|
const FIRST_COLUMN = 1;
|
|
@@ -15036,7 +15009,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
15036
15009
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
15037
15010
|
return directoriesOf(roots);
|
|
15038
15011
|
});
|
|
15039
|
-
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));
|
|
15040
15013
|
const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
|
|
15041
15014
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
15042
15015
|
const cargoProblems = (present, enabled) => {
|
|
@@ -15071,6 +15044,89 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
15071
15044
|
if (Option.isNone(workspace)) return [];
|
|
15072
15045
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
15073
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
|
+
});
|
|
15074
15130
|
// src/features/check-effect-diagnostics/model/effect-diagnostics.ts
|
|
15075
15131
|
const RULE$9 = "effect-diagnostics-once";
|
|
15076
15132
|
const PLUGIN = "@effect/language-service";
|
|
@@ -15618,7 +15674,7 @@ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root
|
|
|
15618
15674
|
/** @internal */
|
|
15619
15675
|
const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedText(root) {
|
|
15620
15676
|
const found = yield* Effect.all([
|
|
15621
|
-
|
|
15677
|
+
checkDocuments(root),
|
|
15622
15678
|
checkPython(root),
|
|
15623
15679
|
checkDocker(root),
|
|
15624
15680
|
checkUnneededFiles(root),
|