@r_masseater/msch 0.22.0 → 0.23.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.
|
@@ -81,6 +81,7 @@ const RuleNameSchema = Schema.Literals([
|
|
|
81
81
|
"python-command",
|
|
82
82
|
"docker-file",
|
|
83
83
|
"docker-command",
|
|
84
|
+
"git-subpath-dependency",
|
|
84
85
|
"unneeded-file",
|
|
85
86
|
"unneeded-setup",
|
|
86
87
|
"cargo-outside-pnpm",
|
|
@@ -157,4 +158,4 @@ const formatProblem = (relative) => (problem) => `${relative(problem.file)}:${St
|
|
|
157
158
|
const JSON_FLAG = "--json";
|
|
158
159
|
export { isPropertyAssignment as $, getNameOfDeclaration as A, isExportDeclaration as B, API as C, SyntaxKind as D, SignatureKind as E, isBlock as F, isInterfaceDeclaration as G, isFunctionExpression as H, isCallExpression as I, isNewExpression as J, isModuleBlock as K, isClassDeclaration as L, isArrayLiteralExpression as M, isArrowFunction as N, getJSDocTags as O, isBinaryExpression as P, isPropertyAccessExpression as Q, isElementAccessExpression as R, uniqueByReference as S, InternalSymbolName as T, isIdentifier as U, isFunctionDeclaration as V, isImportDeclaration as W, isObjectLiteralExpression as X, isNumericLiteral as Y, isParenthesizedExpression as Z, packageOf as _, problemAt as a, isStringLiteral as at, resolvedSymbol as b, columnOf as c, isTypeReferenceNode as ct, descendantsOf as d, isVariableDeclarationList as dt, isReturnStatement as et, importedModulesOf as f, isVariableStatement as ft, lineOf as g, isTypeDeclaration as h, formatProblem as i, isSpreadElement as it, getTextOfJSDocComment as j, getLeadingCommentRanges as k, contains as l, isUnionTypeNode as lt, isGenericDeclaration as m, ProblemList as n, isSignatureDeclaration as nt, sortProblems as o, isTypeAliasDeclaration as ot, isExternalDeclaration as p, isModuleDeclaration as q, describeFinding as r, isSourceFile as rt, childrenOf as s, isTypeLiteralNode as st, JSON_FLAG as t, isSatisfiesExpression as tt, declarationsOf as u, isVariableDeclaration as ut, propertyNamesOf as v, IndexKind as w, symbolAt as x, referencedSymbols as y, isEnumDeclaration as z };
|
|
159
160
|
|
|
160
|
-
//# sourceMappingURL=cli-contract-
|
|
161
|
+
//# sourceMappingURL=cli-contract-BViRo52q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-contract-BViRo52q.mjs","names":["Arr","Str","Arr"],"sources":["../src/shared/lib/syntax.ts","../src/shared/lib/problem.ts","../src/shared/lib/cli-contract.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isEnumDeclaration,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./repository-files.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nexport const POSITION_BASE = 1;\n\nexport const uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nexport const childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst SCOPE_PREFIX = \"@\";\nconst SCOPED_SEGMENTS = 2;\nconst UNSCOPED_SEGMENTS = 1;\n\nexport const packageOf = (fileName: string): string => {\n const afterModules = pipe(\n fileName,\n Str.lastIndexOf(NODE_MODULES_SEGMENT),\n Option.match({\n onNone: () => fileName,\n onSome: (index) => Str.slice(index + NODE_MODULES_SEGMENT.length)(fileName),\n }),\n );\n const segments = Str.split(\"/\")(afterModules);\n if (Str.startsWith(SCOPE_PREFIX)(afterModules)) {\n return pipe(Arr.take(segments, SCOPED_SEGMENTS), Arr.join(\"/\"));\n }\n return pipe(Arr.take(segments, UNSCOPED_SEGMENTS), Arr.join(\"/\"));\n};\n\nexport const descendantsOf = (node: Node): readonly Node[] =>\n pipe(\n childrenOf(node),\n Arr.flatMap((child) => Arr.prepend(descendantsOf(child), child)),\n );\n\nconst isExternalFile =\n (program: Program) =>\n (sourceFile: SourceFile): boolean =>\n Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile);\n\nexport const isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\n\nconst ALIAS_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.ImportSpecifier,\n SyntaxKind.ImportClause,\n SyntaxKind.NamespaceImport,\n SyntaxKind.ExportSpecifier,\n SyntaxKind.ImportEqualsDeclaration,\n SyntaxKind.ExportAssignment,\n]);\n\nexport const declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isAliasDeclaration = (declaration: Node): boolean => ALIAS_KINDS.has(declaration.kind);\n\nexport const resolvedSymbol =\n (checker: Checker) =>\n (symbol: TypeSymbol): TypeSymbol => {\n if (\n !pipe(\n declarationsOf(symbol),\n Arr.some((declaration) => isAliasDeclaration(declaration)),\n )\n ) {\n return symbol;\n }\n return checker.getAliasedSymbol(symbol);\n };\n\nexport const symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node)).pipe(\n Option.map(resolvedSymbol(checker)),\n );\n\nexport const referencedSymbols =\n (checker: Checker) =>\n (node: Node): readonly TypeSymbol[] => {\n const identifiers = pipe(\n Arr.prepend(descendantsOf(node), node),\n Arr.filter((candidate) => isIdentifier(candidate)),\n );\n const symbols = pipe(\n checker.getSymbolAtLocation(identifiers),\n Arr.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))),\n Arr.map(resolvedSymbol(checker)),\n );\n return uniqueByReference(symbols);\n };\n\nexport const lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nexport const columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nexport const contains =\n (outer: Node) =>\n (inner: Node): boolean =>\n outer.getSourceFile().fileName === inner.getSourceFile().fileName &&\n outer.getStart() <= inner.getStart() &&\n inner.getEnd() <= outer.getEnd();\n\nexport const isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nexport const isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nexport const propertyNamesOf =\n (checker: Checker) =>\n (type: Type): readonly string[] =>\n pipe(\n checker.getPropertiesOfType(type),\n Arr.map((property) => property.name),\n );\n\nconst moduleSpecifierOf = (statement: Node): Option.Option<string> => {\n if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(\n Option.filter((specifier) => isStringLiteral(specifier)),\n Option.map((specifier) => specifier.text),\n );\n};\n\nexport const importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\n );\n","import { Array as Arr, Order, Schema, pipe } from \"effect\";\n\nimport type { Node } from \"./compiler.ts\";\nimport { columnOf, lineOf } from \"./syntax.ts\";\n\nconst RuleNameSchema = Schema.Literals([\n \"owner-annotation\",\n \"duplicate-value-set\",\n \"owner-value-set\",\n \"owner-extension\",\n \"owned-literal\",\n \"library-value-set\",\n \"library-shape\",\n \"unused-override\",\n \"removable-override\",\n \"hidden-unicode\",\n \"python-file\",\n \"python-command\",\n \"docker-file\",\n \"docker-command\",\n \"git-subpath-dependency\",\n \"unneeded-file\",\n \"unneeded-setup\",\n \"cargo-outside-pnpm\",\n \"nested-docs\",\n \"root-readme\",\n \"agent-docs-length\",\n \"root-docs\",\n \"shell-script\",\n \"workflow-script\",\n \"workflow-queue\",\n \"stack-dependency\",\n \"install-size\",\n \"unverified-crate\",\n \"hidden-verify\",\n \"root-workspace-path\",\n \"shared-uncached-task\",\n \"workflow-path\",\n \"command-outside-bin\",\n \"unrun-command\",\n \"scripts-directory\",\n \"listed-entry\",\n \"workflow-path-filter\",\n \"workflow-package\",\n \"colocated-test\",\n \"comment\",\n \"applied-package\",\n \"package-script\",\n \"package-manager-command\",\n \"skipped-gate\",\n \"filter-task\",\n \"vite-plus-block\",\n \"node-version\",\n \"replaced-tool\",\n \"missing-hook\",\n \"dangling-link\",\n \"alchemy-patch\",\n \"skill-file\",\n \"unlocked-skill\",\n \"pass-through-wrapper\",\n]);\n\nexport type RuleName = typeof RuleNameSchema.Type;\n\nconst ProblemSchema = Schema.Struct({\n file: Schema.String,\n line: Schema.Int,\n column: Schema.Int,\n rule: RuleNameSchema,\n message: Schema.String,\n});\n\nexport type Problem = typeof ProblemSchema.Type;\n\nexport const ProblemList = Schema.Array(ProblemSchema);\n\nexport const CANDIDATE_LIMIT = 3;\n\nexport interface Finding {\n readonly rule: RuleName;\n readonly message: string;\n}\n\nexport const problemAt =\n ({ rule, message }: Finding) =>\n (node: Node): Problem => ({\n file: node.getSourceFile().fileName,\n line: lineOf(node),\n column: columnOf(node),\n rule,\n message,\n });\n\nconst problemOrder: Order.Order<Problem> = Order.combineAll([\n Order.mapInput(Order.String, (problem: Problem) => problem.file),\n Order.mapInput(Order.Number, (problem: Problem) => problem.line),\n Order.mapInput(Order.Number, (problem: Problem) => problem.column),\n Order.mapInput(Order.String, (problem: Problem) => problem.rule),\n Order.mapInput(Order.String, (problem: Problem) => problem.message),\n]);\n\nconst problemKey = (problem: Problem): string =>\n pipe(\n [problem.file, String(problem.line), String(problem.column), problem.rule, problem.message],\n Arr.join(\"\\0\"),\n );\n\nexport const sortProblems = (problems: readonly Problem[]): readonly Problem[] =>\n Arr.sort(\n Arr.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)),\n problemOrder,\n );\n\nexport const describeFinding = (problem: Problem): string => `[${problem.rule}] ${problem.message}`;\n\nexport const formatProblem =\n (relative: (file: string) => string) =>\n (problem: Problem): string =>\n `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;\n","export const JSON_FLAG = \"--json\";\n"],"mappings":";;;;;;AA0BA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAa,qBAA2B,UACtCA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAa,cAAc,SAAgC;CACzD,MAAM,WAAmB,CAAC;CAC1B,KAAK,cAAc,UAAU;EAC3B,SAAS,KAAK,KAAK;CACrB,CAAC;CACD,OAAO;AACT;AAEA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAE1B,MAAa,aAAa,aAA6B;CACrD,MAAM,eAAe,KACnB,UACAC,SAAI,YAAY,oBAAoB,GACpC,OAAO,MAAM;EACX,cAAc;EACd,SAAS,UAAUA,SAAI,MAAM,QAAQ,qBAAqB,MAAM,CAAC,CAAC,QAAQ;CAC5E,CAAC,CACH;CACA,MAAM,WAAWA,SAAI,MAAM,GAAG,CAAC,CAAC,YAAY;CAC5C,IAAIA,SAAI,WAAW,YAAY,CAAC,CAAC,YAAY,GAC3C,OAAO,KAAKD,MAAI,KAAK,UAAU,eAAe,GAAGA,MAAI,KAAK,GAAG,CAAC;CAEhE,OAAO,KAAKA,MAAI,KAAK,UAA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BAAgB,OAAO;;ACtH1G,MAAa,YAAY"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { A as dependencyEntries, C as propertyValue, D as publishedWorkspaces, M as workspaceDependencies, O as publicEntriesOf, S as nestedValues, _ as workspaceConfigOf, a as runTasksOf, b as keyName, c as VERIFY_TASK, i as workspaceDirectories, j as readManifest, k as MANIFEST_FILE, l as definesTask, s as RUN_TASKS, t as namedWorkspaces, u as hasVerifyTask, v as KeySchema, w as stringsIn, x as literalOf, y as childrenOf$2 } from "./workspace-CMPDXFWk.mjs";
|
|
3
|
-
import { $ as isPropertyAssignment, A as getNameOfDeclaration, B as isExportDeclaration, C as API, D as SyntaxKind, E as SignatureKind, F as isBlock, G as isInterfaceDeclaration, H as isFunctionExpression, I as isCallExpression, J as isNewExpression, K as isModuleBlock, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isPropertyAccessExpression, R as isElementAccessExpression, S as uniqueByReference, T as InternalSymbolName, U as isIdentifier, V as isFunctionDeclaration, W as isImportDeclaration, X as isObjectLiteralExpression, Y as isNumericLiteral, Z as isParenthesizedExpression, _ as packageOf$1, a as problemAt$
|
|
3
|
+
import { $ as isPropertyAssignment, A as getNameOfDeclaration, B as isExportDeclaration, C as API, D as SyntaxKind, E as SignatureKind, F as isBlock, G as isInterfaceDeclaration, H as isFunctionExpression, I as isCallExpression, J as isNewExpression, K as isModuleBlock, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isPropertyAccessExpression, R as isElementAccessExpression, S as uniqueByReference, T as InternalSymbolName, U as isIdentifier, V as isFunctionDeclaration, W as isImportDeclaration, X as isObjectLiteralExpression, Y as isNumericLiteral, Z as isParenthesizedExpression, _ as packageOf$1, a as problemAt$4, at as isStringLiteral, b as resolvedSymbol, c as columnOf, ct as isTypeReferenceNode, d as descendantsOf, dt as isVariableDeclarationList, et as isReturnStatement, f as importedModulesOf, ft as isVariableStatement, g as lineOf, h as isTypeDeclaration, i as formatProblem, it as isSpreadElement, j as getTextOfJSDocComment, k as getLeadingCommentRanges, l as contains, lt as isUnionTypeNode, m as isGenericDeclaration, n as ProblemList, nt as isSignatureDeclaration, o as sortProblems, ot as isTypeAliasDeclaration, p as isExternalDeclaration, q as isModuleDeclaration, rt as isSourceFile, s as childrenOf$3, st as isTypeLiteralNode, tt as isSatisfiesExpression, u as declarationsOf, ut as isVariableDeclaration, v as propertyNamesOf, w as IndexKind, x as symbolAt, y as referencedSymbols, z as isEnumDeclaration } from "./cli-contract-BViRo52q.mjs";
|
|
4
4
|
import { a as groupOf$1, i as nodeServicesLayer, n as RepositoryFiles, r as nodeRepositoryFiles, t as NODE_MODULES } from "./repository-files-B11FFAIk.mjs";
|
|
5
5
|
import { t as COMMENT_DIRECTIVES } from "./comment-directives-WcDqvLwJ.mjs";
|
|
6
6
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
@@ -1004,9 +1004,57 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1004
1004
|
if (Option.isNone(manifest) || !Array.isReadonlyArrayNonEmpty(keys)) return [];
|
|
1005
1005
|
return yield* problemsFor(root, manifest.value, keys);
|
|
1006
1006
|
});
|
|
1007
|
+
// src/shared/lib/scanned-files.ts
|
|
1008
|
+
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
1009
|
+
const LOCKFILE = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1010
|
+
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1011
|
+
const READ_CONCURRENCY$19 = 64;
|
|
1012
|
+
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE.test(name);
|
|
1013
|
+
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1014
|
+
/** @internal */
|
|
1015
|
+
const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
|
|
1016
|
+
const files = yield* RepositoryFiles;
|
|
1017
|
+
const names = yield* files.listedFiles(root);
|
|
1018
|
+
return pipe(names, Array.map((name) => ({
|
|
1019
|
+
name,
|
|
1020
|
+
file: files.join(root, name)
|
|
1021
|
+
})));
|
|
1022
|
+
});
|
|
1023
|
+
/** @internal */
|
|
1024
|
+
const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
|
|
1025
|
+
const files = yield* RepositoryFiles;
|
|
1026
|
+
return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
|
|
1027
|
+
});
|
|
1028
|
+
/** @internal */
|
|
1029
|
+
const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
|
|
1030
|
+
const files = yield* RepositoryFiles;
|
|
1031
|
+
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1032
|
+
onNone: () => [],
|
|
1033
|
+
onSome: (source) => problemsIn(entry, source)
|
|
1034
|
+
}))), { concurrency: READ_CONCURRENCY$19 });
|
|
1035
|
+
return Array.flatten(found);
|
|
1036
|
+
});
|
|
1037
|
+
// src/features/overrides/model/git-subpath.ts
|
|
1038
|
+
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1039
|
+
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1040
|
+
const RULE$27 = "git-subpath-dependency";
|
|
1041
|
+
const WHOLE_MATCH$2 = 0;
|
|
1042
|
+
const problemAt$3 = ({ file }, source) => (found) => ({
|
|
1043
|
+
file,
|
|
1044
|
+
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1045
|
+
rule: RULE$27,
|
|
1046
|
+
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$2])}\`.`
|
|
1047
|
+
});
|
|
1048
|
+
const problemsIn$11 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$3(entry, source)));
|
|
1049
|
+
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
1050
|
+
/** @internal */
|
|
1051
|
+
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
1052
|
+
const listed = yield* listedFiles(root);
|
|
1053
|
+
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$11);
|
|
1054
|
+
});
|
|
1007
1055
|
// src/shared/lib/agent-docs.ts
|
|
1008
1056
|
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
1009
|
-
const READ_CONCURRENCY$
|
|
1057
|
+
const READ_CONCURRENCY$18 = 16;
|
|
1010
1058
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
1011
1059
|
const files = yield* RepositoryFiles;
|
|
1012
1060
|
const listed = yield* files.listedFiles(root);
|
|
@@ -1015,7 +1063,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
1015
1063
|
const file = files.join(root, name);
|
|
1016
1064
|
const problemOf = Option.flatMap(problemIn(file));
|
|
1017
1065
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
1018
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
1066
|
+
}, { concurrency: READ_CONCURRENCY$18 });
|
|
1019
1067
|
return Array.getSomes(found);
|
|
1020
1068
|
});
|
|
1021
1069
|
// src/features/placement/model/agent-docs-length.ts
|
|
@@ -1038,7 +1086,7 @@ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source)
|
|
|
1038
1086
|
// src/features/placement/model/colocated-tests.ts
|
|
1039
1087
|
const RULE$25 = "colocated-test";
|
|
1040
1088
|
const FIRST$12 = 1;
|
|
1041
|
-
const READ_CONCURRENCY$
|
|
1089
|
+
const READ_CONCURRENCY$17 = 64;
|
|
1042
1090
|
const ROOT_SUBPATH = ".";
|
|
1043
1091
|
const NAME_GROUP = "name";
|
|
1044
1092
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -1124,14 +1172,14 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
1124
1172
|
directory: files.dirname(file)
|
|
1125
1173
|
};
|
|
1126
1174
|
}));
|
|
1127
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$5(context, test), { concurrency: READ_CONCURRENCY$
|
|
1175
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$5(context, test), { concurrency: READ_CONCURRENCY$17 });
|
|
1128
1176
|
return Array.getSomes(found);
|
|
1129
1177
|
});
|
|
1130
1178
|
// src/features/placement/model/dangling-links.ts
|
|
1131
1179
|
const RULE$24 = "dangling-link";
|
|
1132
1180
|
const SEPARATOR$12 = "/";
|
|
1133
1181
|
const FIRST$11 = 1;
|
|
1134
|
-
const READ_CONCURRENCY$
|
|
1182
|
+
const READ_CONCURRENCY$16 = 16;
|
|
1135
1183
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$12}`)(name);
|
|
1136
1184
|
/** @internal */
|
|
1137
1185
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -1148,7 +1196,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
1148
1196
|
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.`
|
|
1149
1197
|
})));
|
|
1150
1198
|
});
|
|
1151
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
1199
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$16 });
|
|
1152
1200
|
return Array.getSomes(found);
|
|
1153
1201
|
});
|
|
1154
1202
|
// src/features/placement/model/nested-docs.ts
|
|
@@ -1156,7 +1204,7 @@ const RULE$23 = "nested-docs";
|
|
|
1156
1204
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
1157
1205
|
const SEPARATOR$11 = "/";
|
|
1158
1206
|
const FIRST$10 = 1;
|
|
1159
|
-
const READ_CONCURRENCY$
|
|
1207
|
+
const READ_CONCURRENCY$15 = 64;
|
|
1160
1208
|
const AGENT_DOCS = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
1161
1209
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
1162
1210
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -1214,7 +1262,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
1214
1262
|
workspaces: pipe(nested, Array.filter((name) => files.basename(name) === MANIFEST_FILE), Array.map((name) => files.dirname(files.join(root, name))), HashSet.fromIterable),
|
|
1215
1263
|
workspaceAgentDocs
|
|
1216
1264
|
};
|
|
1217
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$4(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
1265
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$4(root, allowed, name), { concurrency: READ_CONCURRENCY$15 });
|
|
1218
1266
|
return Array.getSomes(found);
|
|
1219
1267
|
});
|
|
1220
1268
|
// src/features/placement/model/root-docs.ts
|
|
@@ -1240,7 +1288,7 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
1240
1288
|
// src/features/placement/model/root-readme.ts
|
|
1241
1289
|
const RULE$21 = "root-readme";
|
|
1242
1290
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
1243
|
-
const READ_CONCURRENCY$
|
|
1291
|
+
const READ_CONCURRENCY$14 = 16;
|
|
1244
1292
|
const START$12 = 0;
|
|
1245
1293
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
1246
1294
|
const isCheckPolicy = ({ packageName }) => Option.contains(packageName, CHECK_POLICY);
|
|
@@ -1269,7 +1317,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
1269
1317
|
const readmes = pipe(names, Array.filter((name) => ROOT_DOC.test(name)));
|
|
1270
1318
|
const named = yield* namedWorkspaces(root);
|
|
1271
1319
|
const workspaces = pipe(named, Array.filter((workspace) => !isCheckPolicy(workspace)));
|
|
1272
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces), { concurrency: READ_CONCURRENCY$
|
|
1320
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces), { concurrency: READ_CONCURRENCY$14 });
|
|
1273
1321
|
return Array.flatten(found);
|
|
1274
1322
|
});
|
|
1275
1323
|
// src/features/placement/model/placement-checks.ts
|
|
@@ -1294,7 +1342,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
1294
1342
|
const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
1295
1343
|
const SEPARATOR$9 = "/";
|
|
1296
1344
|
const CURRENT = "./";
|
|
1297
|
-
const READ_CONCURRENCY$
|
|
1345
|
+
const READ_CONCURRENCY$13 = 8;
|
|
1298
1346
|
const FIRST$8 = 1;
|
|
1299
1347
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
1300
1348
|
const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -1344,7 +1392,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
1344
1392
|
const files = yield* RepositoryFiles;
|
|
1345
1393
|
const listed = yield* files.listedFiles(root);
|
|
1346
1394
|
const workflows = pipe(listed, Array.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
|
|
1347
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
1395
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$13 });
|
|
1348
1396
|
return pipe(Array.getSomes(texts), Array.join("\n"));
|
|
1349
1397
|
});
|
|
1350
1398
|
const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$9));
|
|
@@ -1394,8 +1442,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
1394
1442
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
1395
1443
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
1396
1444
|
const workflows = yield* workflowText(root);
|
|
1397
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$9(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
1398
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
1445
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$9(root, directory, workflows), { concurrency: READ_CONCURRENCY$13 });
|
|
1446
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$13 });
|
|
1399
1447
|
return [...Array.flatten(found), ...Array.getSomes(scripts)];
|
|
1400
1448
|
});
|
|
1401
1449
|
// src/features/repository-layout/model/crates.ts
|
|
@@ -1404,7 +1452,7 @@ const CARGO_FILE = "Cargo.toml";
|
|
|
1404
1452
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
1405
1453
|
const SEPARATOR$8 = "/";
|
|
1406
1454
|
const FIRST$7 = 1;
|
|
1407
|
-
const READ_CONCURRENCY$
|
|
1455
|
+
const READ_CONCURRENCY$12 = 8;
|
|
1408
1456
|
const CrateEntry = Schema.Struct({
|
|
1409
1457
|
name: Schema.String,
|
|
1410
1458
|
manifest_path: Schema.String
|
|
@@ -1453,7 +1501,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
1453
1501
|
if (!(yield* files.exists(files.join(root, CARGO_FILE)))) return [];
|
|
1454
1502
|
const directories = yield* workspaceDirectories(root);
|
|
1455
1503
|
const crates = yield* cratesIn(root);
|
|
1456
|
-
const found = yield* Effect.forEach(crates, (crate) => problemIn$3(root, directories, crate), { concurrency: READ_CONCURRENCY$
|
|
1504
|
+
const found = yield* Effect.forEach(crates, (crate) => problemIn$3(root, directories, crate), { concurrency: READ_CONCURRENCY$12 });
|
|
1457
1505
|
return Array.getSomes(found);
|
|
1458
1506
|
});
|
|
1459
1507
|
// src/features/repository-layout/model/fallow-entries.ts
|
|
@@ -1467,7 +1515,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
1467
1515
|
const WILDCARD$1 = /[*?{[]/u;
|
|
1468
1516
|
const SEPARATOR$7 = "/";
|
|
1469
1517
|
const WRAP_OFFSET = 1;
|
|
1470
|
-
const READ_CONCURRENCY$
|
|
1518
|
+
const READ_CONCURRENCY$11 = 8;
|
|
1471
1519
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
1472
1520
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array.contains(ENTRY_KEYS, keyName(key))));
|
|
1473
1521
|
const entryPatternsIn = (node) => {
|
|
@@ -1495,14 +1543,14 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, file, di
|
|
|
1495
1543
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
1496
1544
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
1497
1545
|
const directories = yield* workspaceDirectories(root);
|
|
1498
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$8(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
1546
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$8(root, file, directories), { concurrency: READ_CONCURRENCY$11 });
|
|
1499
1547
|
return Array.flatten(found);
|
|
1500
1548
|
});
|
|
1501
1549
|
// src/features/repository-layout/model/hidden-verify.ts
|
|
1502
1550
|
const RULE$18 = "hidden-verify";
|
|
1503
1551
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
1504
1552
|
const FIRST$6 = 1;
|
|
1505
|
-
const READ_CONCURRENCY$
|
|
1553
|
+
const READ_CONCURRENCY$10 = 8;
|
|
1506
1554
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
1507
1555
|
const config = yield* workspaceConfigOf(root, directory);
|
|
1508
1556
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -1520,7 +1568,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
1520
1568
|
/** @internal */
|
|
1521
1569
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
1522
1570
|
const directories = yield* workspaceDirectories(root);
|
|
1523
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
1571
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$10 });
|
|
1524
1572
|
return Array.getSomes(found);
|
|
1525
1573
|
});
|
|
1526
1574
|
// src/features/repository-layout/model/root-workspace-paths.ts
|
|
@@ -1558,7 +1606,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
1558
1606
|
});
|
|
1559
1607
|
// src/features/repository-layout/model/shared-uncached-tasks.ts
|
|
1560
1608
|
const RULE$16 = "shared-uncached-task";
|
|
1561
|
-
const READ_CONCURRENCY$
|
|
1609
|
+
const READ_CONCURRENCY$9 = 8;
|
|
1562
1610
|
const SHARED = 2;
|
|
1563
1611
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
1564
1612
|
const UncachedTask = Schema.Struct({
|
|
@@ -1607,7 +1655,7 @@ const problemsOf$1 = (definitions) => {
|
|
|
1607
1655
|
/** @internal */
|
|
1608
1656
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
1609
1657
|
const directories = yield* workspaceDirectories(root);
|
|
1610
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
1658
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$9 });
|
|
1611
1659
|
return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$1));
|
|
1612
1660
|
});
|
|
1613
1661
|
// src/features/repository-layout/model/workflow-nodes.ts
|
|
@@ -1749,7 +1797,7 @@ const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) =
|
|
|
1749
1797
|
const RULE$15 = "workflow-path";
|
|
1750
1798
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
1751
1799
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
1752
|
-
const READ_CONCURRENCY$
|
|
1800
|
+
const READ_CONCURRENCY$8 = 8;
|
|
1753
1801
|
const WILDCARD = /[*?[]/u;
|
|
1754
1802
|
const SEPARATOR$5 = "/";
|
|
1755
1803
|
const FIRST$4 = 0;
|
|
@@ -1827,7 +1875,7 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, workflow
|
|
|
1827
1875
|
/** @internal */
|
|
1828
1876
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
1829
1877
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
1830
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$6(root, workflow), { concurrency: READ_CONCURRENCY$
|
|
1878
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$6(root, workflow), { concurrency: READ_CONCURRENCY$8 });
|
|
1831
1879
|
return Array.flatten(found);
|
|
1832
1880
|
});
|
|
1833
1881
|
// src/features/repository-layout/model/workflow-scale.ts
|
|
@@ -1839,7 +1887,7 @@ const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
|
1839
1887
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
1840
1888
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
1841
1889
|
const START$11 = 0;
|
|
1842
|
-
const READ_CONCURRENCY$
|
|
1890
|
+
const READ_CONCURRENCY$7 = 8;
|
|
1843
1891
|
const SEPARATOR$4 = "/";
|
|
1844
1892
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
1845
1893
|
const SPACE = " ";
|
|
@@ -1919,7 +1967,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
|
|
|
1919
1967
|
name: stem,
|
|
1920
1968
|
source: text
|
|
1921
1969
|
})]), Option.getOrElse(() => []));
|
|
1922
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
1970
|
+
}), { concurrency: READ_CONCURRENCY$7 });
|
|
1923
1971
|
const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf(ACTION, name), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
|
|
1924
1972
|
return [...Array.flatten(found), ...actions];
|
|
1925
1973
|
});
|
|
@@ -2035,7 +2083,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
2035
2083
|
};
|
|
2036
2084
|
const problemOf$4 = (checker) => (candidate) => {
|
|
2037
2085
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
2038
|
-
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$
|
|
2086
|
+
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$4({
|
|
2039
2087
|
rule: RULE$14,
|
|
2040
2088
|
message: messageOf(forward.callee.getText())
|
|
2041
2089
|
})(candidate.name)));
|
|
@@ -2125,7 +2173,7 @@ const ownerValuesOf = (checker) => (declaration) => {
|
|
|
2125
2173
|
const type = checker.getTypeAtLocation(declaration.name);
|
|
2126
2174
|
return finiteValuesOf(checker)(type).pipe(Option.orElse(() => objectValuesOf(checker)(type)));
|
|
2127
2175
|
};
|
|
2128
|
-
const annotationProblem = (message) => problemAt$
|
|
2176
|
+
const annotationProblem = (message) => problemAt$4({
|
|
2129
2177
|
rule: "owner-annotation",
|
|
2130
2178
|
message
|
|
2131
2179
|
});
|
|
@@ -2258,7 +2306,7 @@ const shapeProblem = (site, matches) => {
|
|
|
2258
2306
|
onNone: () => "Derive it from the library type, for example with Pick, instead of copying its properties.",
|
|
2259
2307
|
onSome: () => "Use the library type instead of copying it."
|
|
2260
2308
|
});
|
|
2261
|
-
return problemAt$
|
|
2309
|
+
return problemAt$4({
|
|
2262
2310
|
rule: "library-shape",
|
|
2263
2311
|
message: `This shape copies ${shown}. ${advice}`
|
|
2264
2312
|
})(site.node);
|
|
@@ -2352,7 +2400,7 @@ const derivedVerdict = (context) => (site) => {
|
|
|
2352
2400
|
const added = pipe(site.values, Array.filter((value) => !isSubsetOf([value], held)));
|
|
2353
2401
|
if (!Array.isReadonlyArrayNonEmpty(owners) || !Array.isReadonlyArrayNonEmpty(added)) return verdict([], []);
|
|
2354
2402
|
const message = `This set adds ${formatValues(added)} to ${describeOwners(owners)}. Add the values to the owner, or register the wider set as its own concept.`;
|
|
2355
|
-
return verdict([problemAt$
|
|
2403
|
+
return verdict([problemAt$4({
|
|
2356
2404
|
rule: "owner-extension",
|
|
2357
2405
|
message
|
|
2358
2406
|
})(site.node)], []);
|
|
@@ -2374,7 +2422,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
2374
2422
|
const owners = pipe(context.owners, Array.filter((owner) => isSubsetOf(site.values, owner.values)));
|
|
2375
2423
|
if (Array.isReadonlyArrayNonEmpty(owners)) {
|
|
2376
2424
|
const message = `The values ${formatValues(site.values)} are owned by ${describeOwners(owners)}. Derive this set from the owner instead of restating it.`;
|
|
2377
|
-
return verdict([problemAt$
|
|
2425
|
+
return verdict([problemAt$4({
|
|
2378
2426
|
rule: "owner-value-set",
|
|
2379
2427
|
message
|
|
2380
2428
|
})(site.node)], []);
|
|
@@ -2382,7 +2430,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
2382
2430
|
const candidates = libraryCandidates(context)(site);
|
|
2383
2431
|
if (Array.isReadonlyArrayNonEmpty(candidates)) {
|
|
2384
2432
|
const message = `The values ${formatValues(site.values)} restate a dependency type: ${listCandidates(candidates)}. Derive this set from the library type.`;
|
|
2385
|
-
return verdict([problemAt$
|
|
2433
|
+
return verdict([problemAt$4({
|
|
2386
2434
|
rule: "library-value-set",
|
|
2387
2435
|
message
|
|
2388
2436
|
})(site.node)], []);
|
|
@@ -2413,7 +2461,7 @@ const isValuePosition = (node) => {
|
|
|
2413
2461
|
const { parent } = node;
|
|
2414
2462
|
return VALUE_PARENT_KINDS.has(parent.kind) || pipe(VALUE_SLOTS, Array.some((isSlot) => isSlot(node, parent)));
|
|
2415
2463
|
};
|
|
2416
|
-
const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$
|
|
2464
|
+
const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$4({
|
|
2417
2465
|
rule: "owned-literal",
|
|
2418
2466
|
message: `${literal.getText()} is a value of ${describeOwners(owners)}. Write it through the owner's binding instead of as a literal.`
|
|
2419
2467
|
})(literal)));
|
|
@@ -2693,7 +2741,7 @@ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
2693
2741
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
2694
2742
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
2695
2743
|
const PLUGIN_ROOT = "..";
|
|
2696
|
-
const READ_CONCURRENCY$
|
|
2744
|
+
const READ_CONCURRENCY$6 = 16;
|
|
2697
2745
|
const START$10 = 0;
|
|
2698
2746
|
const referenceOf = (found) => pipe(groupOf$1("path")(found), Option.filter(() => Option.isNone(groupOf$1("optional")(found))), Option.map((path) => ({
|
|
2699
2747
|
path,
|
|
@@ -2736,7 +2784,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
2736
2784
|
}];
|
|
2737
2785
|
return [];
|
|
2738
2786
|
}));
|
|
2739
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$5, { concurrency: READ_CONCURRENCY$
|
|
2787
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$5, { concurrency: READ_CONCURRENCY$6 });
|
|
2740
2788
|
return Array.flatten(found);
|
|
2741
2789
|
});
|
|
2742
2790
|
// src/features/scripts/model/shell-scripts.ts
|
|
@@ -2744,7 +2792,7 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
2744
2792
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
2745
2793
|
const EXTENSION = /\.[^./]+$/u;
|
|
2746
2794
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
2747
|
-
const READ_CONCURRENCY$
|
|
2795
|
+
const READ_CONCURRENCY$5 = 64;
|
|
2748
2796
|
const FIRST$3 = 1;
|
|
2749
2797
|
const RULE$12 = "shell-script";
|
|
2750
2798
|
const MESSAGE$4 = "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.";
|
|
@@ -2786,12 +2834,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
2786
2834
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
2787
2835
|
};
|
|
2788
2836
|
const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
|
|
2789
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
2837
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$5 });
|
|
2790
2838
|
return pipe(shell, Array.map((name) => problemFor$1(files.join(root, name))));
|
|
2791
2839
|
});
|
|
2792
2840
|
// src/shared/lib/workflow-files.ts
|
|
2793
2841
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
2794
|
-
const READ_CONCURRENCY$
|
|
2842
|
+
const READ_CONCURRENCY$4 = 16;
|
|
2795
2843
|
const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
2796
2844
|
const files = yield* RepositoryFiles;
|
|
2797
2845
|
const names = yield* files.listedFiles(root);
|
|
@@ -2801,7 +2849,7 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
2801
2849
|
file,
|
|
2802
2850
|
source
|
|
2803
2851
|
}))));
|
|
2804
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
2852
|
+
}, { concurrency: READ_CONCURRENCY$4 });
|
|
2805
2853
|
return Array.getSomes(found);
|
|
2806
2854
|
});
|
|
2807
2855
|
// src/shared/lib/workflow-run.ts
|
|
@@ -2921,7 +2969,7 @@ const STEP_FILES = [
|
|
|
2921
2969
|
];
|
|
2922
2970
|
const HOOK_FILES = [":(glob).vite-hooks/*"];
|
|
2923
2971
|
const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
|
|
2924
|
-
const READ_CONCURRENCY$
|
|
2972
|
+
const READ_CONCURRENCY$3 = 16;
|
|
2925
2973
|
const START$8 = 0;
|
|
2926
2974
|
const FIRST$2 = 1;
|
|
2927
2975
|
const LINE = "\n";
|
|
@@ -2992,7 +3040,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
2992
3040
|
return pipe(tasks, Array.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
2993
3041
|
});
|
|
2994
3042
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
2995
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3043
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$3 });
|
|
2996
3044
|
return Array.flatten(found);
|
|
2997
3045
|
});
|
|
2998
3046
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -3004,7 +3052,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
3004
3052
|
onSome: sourcesOf(file, name)
|
|
3005
3053
|
});
|
|
3006
3054
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
3007
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3055
|
+
}, { concurrency: READ_CONCURRENCY$3 });
|
|
3008
3056
|
return Array.flatten(found);
|
|
3009
3057
|
});
|
|
3010
3058
|
/** @internal */
|
|
@@ -3124,36 +3172,6 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
3124
3172
|
], { concurrency: "unbounded" });
|
|
3125
3173
|
return Array.flatten(found);
|
|
3126
3174
|
});
|
|
3127
|
-
// src/shared/lib/scanned-files.ts
|
|
3128
|
-
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
3129
|
-
const LOCKFILE = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
3130
|
-
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
3131
|
-
const READ_CONCURRENCY$3 = 64;
|
|
3132
|
-
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE.test(name);
|
|
3133
|
-
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
3134
|
-
/** @internal */
|
|
3135
|
-
const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
|
|
3136
|
-
const files = yield* RepositoryFiles;
|
|
3137
|
-
const names = yield* files.listedFiles(root);
|
|
3138
|
-
return pipe(names, Array.map((name) => ({
|
|
3139
|
-
name,
|
|
3140
|
-
file: files.join(root, name)
|
|
3141
|
-
})));
|
|
3142
|
-
});
|
|
3143
|
-
/** @internal */
|
|
3144
|
-
const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
|
|
3145
|
-
const files = yield* RepositoryFiles;
|
|
3146
|
-
return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
|
|
3147
|
-
});
|
|
3148
|
-
/** @internal */
|
|
3149
|
-
const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
|
|
3150
|
-
const files = yield* RepositoryFiles;
|
|
3151
|
-
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
3152
|
-
onNone: () => [],
|
|
3153
|
-
onSome: (source) => problemsIn(entry, source)
|
|
3154
|
-
}))), { concurrency: READ_CONCURRENCY$3 });
|
|
3155
|
-
return Array.flatten(found);
|
|
3156
|
-
});
|
|
3157
3175
|
// src/features/banned-tools/model/banned-tool.ts
|
|
3158
3176
|
const FIRST_LINE$2 = 1;
|
|
3159
3177
|
const FIRST_COLUMN$2 = 1;
|
|
@@ -4190,7 +4208,8 @@ const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedTex
|
|
|
4190
4208
|
checkSkillFiles(root),
|
|
4191
4209
|
checkSkillEntry(root),
|
|
4192
4210
|
checkComments(root),
|
|
4193
|
-
checkAppliedPackages(root)
|
|
4211
|
+
checkAppliedPackages(root),
|
|
4212
|
+
checkGitSubpath(root)
|
|
4194
4213
|
], { concurrency: "unbounded" });
|
|
4195
4214
|
return Array.flatten(found);
|
|
4196
4215
|
});
|