@r_masseater/msch 0.112.0 → 0.114.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/cli.mjs +415 -337
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +2 -2
- package/dist/{ignored-directories-B9ZYjMI4.mjs → ignored-directories-Btth0IHS.mjs} +2 -2
- package/dist/{ignored-directories-B9ZYjMI4.mjs.map → ignored-directories-Btth0IHS.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/{problem-BP2B-3M4.mjs → problem-DaWjnZyW.mjs} +2 -2
- package/dist/{problem-BP2B-3M4.mjs.map → problem-DaWjnZyW.mjs.map} +1 -1
- package/dist/{published-B0rqrGML.mjs → published-J2q6skGp.mjs} +3 -3
- package/dist/{published-B0rqrGML.mjs.map → published-J2q6skGp.mjs.map} +1 -1
- package/dist/{repository-files-DbZY3I_3.mjs → repository-files-BU_wY36C.mjs} +20 -9
- package/dist/repository-files-BU_wY36C.mjs.map +1 -0
- package/dist/{repository-text-DdeWgRlO.mjs → repository-text-Cu-_rD_Q.mjs} +3 -3
- package/dist/{repository-text-DdeWgRlO.mjs.map → repository-text-Cu-_rD_Q.mjs.map} +1 -1
- package/dist/{workspace-projects-YdLknbDq.mjs → workspace-projects-DYfp6Tpn.mjs} +2 -2
- package/dist/{workspace-projects-YdLknbDq.mjs.map → workspace-projects-DYfp6Tpn.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +6 -6
- package/skills/msch-checks/SKILL.md +4 -0
- package/dist/repository-files-DbZY3I_3.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as nodeRepositoryFiles, n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-
|
|
3
|
-
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-
|
|
4
|
-
import { S as workspaceDependencies$1, _ as shadcnUiOf, a as workspaceConfigs, b as installedManifest, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as readManifest, y as dependencyEntries } from "./published-
|
|
5
|
-
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-
|
|
2
|
+
import { i as nodeRepositoryFiles, n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-BU_wY36C.mjs";
|
|
3
|
+
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-DaWjnZyW.mjs";
|
|
4
|
+
import { S as workspaceDependencies$1, _ as shadcnUiOf, a as workspaceConfigs, b as installedManifest, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as readManifest, y as dependencyEntries } from "./published-J2q6skGp.mjs";
|
|
5
|
+
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-DYfp6Tpn.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
7
7
|
import { n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
8
|
-
import { a as CI_TASKS, d as isIgnored, l as existsAt, m as patternOf$1, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, p as namedWorkspaces, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES } from "./repository-text-
|
|
8
|
+
import { a as CI_TASKS, d as isIgnored, l as existsAt, m as patternOf$1, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, p as namedWorkspaces, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES } from "./repository-text-Cu-_rD_Q.mjs";
|
|
9
9
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
10
10
|
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-BXnNnSR9.mjs";
|
|
11
11
|
import { builtinModules, isBuiltin } from "node:module";
|
|
@@ -43,7 +43,7 @@ import { Base64 } from "effect/encoding";
|
|
|
43
43
|
import { dual } from "effect/Function";
|
|
44
44
|
// package.json
|
|
45
45
|
var name = "@r_masseater/msch";
|
|
46
|
-
var version = "0.
|
|
46
|
+
var version = "0.114.0";
|
|
47
47
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
48
48
|
var repository = {
|
|
49
49
|
"type": "git",
|
|
@@ -435,7 +435,7 @@ const mentions$1 = (needle) => ({ api }) => (configPath) => Effect.gen(function*
|
|
|
435
435
|
return pipe(texts, Array$1.some((text) => Option.exists(text, includesNeedle)));
|
|
436
436
|
});
|
|
437
437
|
// src/entities/project/model/inputs.ts
|
|
438
|
-
const SEPARATOR$
|
|
438
|
+
const SEPARATOR$28 = "/";
|
|
439
439
|
const SCOPE_PREFIX$1 = "@";
|
|
440
440
|
const HIDDEN_PREFIX = ".";
|
|
441
441
|
const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
@@ -477,14 +477,14 @@ const closureOf$3 = Effect.fn("closureOf")(function* closureOf(root, configPath)
|
|
|
477
477
|
const directories = yield* workspaceClosure(directory);
|
|
478
478
|
return {
|
|
479
479
|
directories,
|
|
480
|
-
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$
|
|
480
|
+
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$28}`))
|
|
481
481
|
};
|
|
482
482
|
});
|
|
483
483
|
const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
|
|
484
484
|
const files = yield* RepositoryFiles;
|
|
485
485
|
if (!String$1.startsWith(SCOPE_PREFIX$1)(name)) return [name];
|
|
486
486
|
const scoped = yield* files.readDirectory(files.join(modules, name));
|
|
487
|
-
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$
|
|
487
|
+
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$28}${entry}`));
|
|
488
488
|
});
|
|
489
489
|
const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
|
|
490
490
|
const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
|
|
@@ -638,7 +638,7 @@ const runTasksOf = Effect.fn("runTasksOf")(function* runTasksOf(root, directory)
|
|
|
638
638
|
})));
|
|
639
639
|
});
|
|
640
640
|
// src/entities/workspace/model/cargo-crates.ts
|
|
641
|
-
const SEPARATOR$
|
|
641
|
+
const SEPARATOR$27 = "/";
|
|
642
642
|
const SUCCESS$7 = 0;
|
|
643
643
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
644
644
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
@@ -678,7 +678,7 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
678
678
|
}, Effect.scoped);
|
|
679
679
|
/** @internal */
|
|
680
680
|
const owningWorkspace = (directories) => (directory) => {
|
|
681
|
-
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$
|
|
681
|
+
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$27}`)(directory)));
|
|
682
682
|
return Array$1.last(Array$1.sort(owners, String$1.Order));
|
|
683
683
|
};
|
|
684
684
|
// src/entities/workspace/model/plugins.ts
|
|
@@ -686,7 +686,7 @@ const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
|
|
|
686
686
|
const SKILLS_DIRECTORY = "skills";
|
|
687
687
|
const SKILL_FILE$4 = "SKILL.md";
|
|
688
688
|
const CONCURRENCY$4 = 16;
|
|
689
|
-
const SEPARATOR$
|
|
689
|
+
const SEPARATOR$26 = "/";
|
|
690
690
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
691
691
|
name: Schema.String,
|
|
692
692
|
description: Schema.optionalKey(Schema.String),
|
|
@@ -702,7 +702,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
702
702
|
const directory = files.join(skills, name);
|
|
703
703
|
const file = files.join(directory, SKILL_FILE$4);
|
|
704
704
|
const source = yield* files.readFile(file);
|
|
705
|
-
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$
|
|
705
|
+
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
706
706
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
707
707
|
return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
|
|
708
708
|
plugin,
|
|
@@ -715,7 +715,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
715
715
|
})))));
|
|
716
716
|
});
|
|
717
717
|
const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
|
|
718
|
-
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$
|
|
718
|
+
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
719
719
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
720
720
|
});
|
|
721
721
|
const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
@@ -908,7 +908,7 @@ const judge$1 = (baseline) => (key, candidate) => {
|
|
|
908
908
|
};
|
|
909
909
|
const BASELINE_PROBE = "msch-baseline-probe";
|
|
910
910
|
const REMOVED_DEPENDENCY = "-";
|
|
911
|
-
const QUOTES$
|
|
911
|
+
const QUOTES$1 = ["\"", "'"];
|
|
912
912
|
const PREVIOUS = 1;
|
|
913
913
|
const workspaceOverrides = Effect.fn("workspaceOverrides")(function* workspaceOverrides(root) {
|
|
914
914
|
const manifest = yield* workspaceManifest(root);
|
|
@@ -916,7 +916,7 @@ const workspaceOverrides = Effect.fn("workspaceOverrides")(function* workspaceOv
|
|
|
916
916
|
});
|
|
917
917
|
const keyStart = (source) => (index) => {
|
|
918
918
|
const before = String$1.slice(index - PREVIOUS, index)(source);
|
|
919
|
-
return index - Number(Array$1.contains(QUOTES$
|
|
919
|
+
return index - Number(Array$1.contains(QUOTES$1, before)) * PREVIOUS;
|
|
920
920
|
};
|
|
921
921
|
const overrideKeysOf = (source) => (overrides) => {
|
|
922
922
|
const at = positionOf(source);
|
|
@@ -1060,7 +1060,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1060
1060
|
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;
|
|
1061
1061
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1062
1062
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1063
|
-
const READ_CONCURRENCY$
|
|
1063
|
+
const READ_CONCURRENCY$42 = 64;
|
|
1064
1064
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1065
1065
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1066
1066
|
/** @internal */
|
|
@@ -1083,18 +1083,18 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1083
1083
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1084
1084
|
onNone: () => [],
|
|
1085
1085
|
onSome: (source) => foundIn(entry, source)
|
|
1086
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1086
|
+
}))), { concurrency: READ_CONCURRENCY$42 });
|
|
1087
1087
|
return Array$1.flatten(found);
|
|
1088
1088
|
});
|
|
1089
1089
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1090
1090
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1091
1091
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1092
|
-
const RULE$
|
|
1092
|
+
const RULE$77 = "git-subpath-dependency";
|
|
1093
1093
|
const WHOLE_MATCH$4 = 0;
|
|
1094
1094
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1095
1095
|
file,
|
|
1096
1096
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1097
|
-
rule: RULE$
|
|
1097
|
+
rule: RULE$77,
|
|
1098
1098
|
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])}\`.`
|
|
1099
1099
|
});
|
|
1100
1100
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1105,13 +1105,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1105
1105
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1106
1106
|
});
|
|
1107
1107
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1108
|
-
const RULE$
|
|
1108
|
+
const RULE$76 = "unnamed-restriction";
|
|
1109
1109
|
const WHOLE_MATCH$3 = 0;
|
|
1110
1110
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1111
1111
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1112
1112
|
file: entry.file,
|
|
1113
1113
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1114
|
-
rule: RULE$
|
|
1114
|
+
rule: RULE$76,
|
|
1115
1115
|
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.`
|
|
1116
1116
|
})));
|
|
1117
1117
|
/** @internal */
|
|
@@ -1120,13 +1120,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1120
1120
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1121
1121
|
});
|
|
1122
1122
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1123
|
-
const RULE$
|
|
1123
|
+
const RULE$75 = "named-type-exemption";
|
|
1124
1124
|
const WHOLE_MATCH$2 = 0;
|
|
1125
1125
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1126
1126
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1127
1127
|
file: entry.file,
|
|
1128
1128
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1129
|
-
rule: RULE$
|
|
1129
|
+
rule: RULE$75,
|
|
1130
1130
|
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."
|
|
1131
1131
|
})));
|
|
1132
1132
|
/** @internal */
|
|
@@ -1142,7 +1142,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1142
1142
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1143
1143
|
const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
|
|
1144
1144
|
// src/features/check-overrides/model/package-registry.ts
|
|
1145
|
-
const RULE$
|
|
1145
|
+
const RULE$74 = "package-registry";
|
|
1146
1146
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1147
1147
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1148
1148
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
@@ -1156,7 +1156,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
1156
1156
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1157
1157
|
file,
|
|
1158
1158
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1159
|
-
rule: RULE$
|
|
1159
|
+
rule: RULE$74,
|
|
1160
1160
|
message: Option.match(registry, {
|
|
1161
1161
|
onNone: () => `${REASON$3} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1162
1162
|
onSome: (value) => `${REASON$3} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1165,7 +1165,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1165
1165
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
|
|
1166
1166
|
file: entry.file,
|
|
1167
1167
|
...positionOf(source)(found.index ?? START$33),
|
|
1168
|
-
rule: RULE$
|
|
1168
|
+
rule: RULE$74,
|
|
1169
1169
|
message: `${REASON$3} This .npmrc overrides it with \`${String$1.trim(found[START$33])}\`. Remove the line.`
|
|
1170
1170
|
})));
|
|
1171
1171
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -3350,7 +3350,7 @@ const SELF_HOMEPAGE = homepage;
|
|
|
3350
3350
|
const SELF_DIRECTORY = repository.directory;
|
|
3351
3351
|
const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
3352
3352
|
// src/features/check-overrides/model/removed-peers.ts
|
|
3353
|
-
const RULE$
|
|
3353
|
+
const RULE$73 = "removed-peer";
|
|
3354
3354
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
3355
3355
|
const REMOVED = "-";
|
|
3356
3356
|
const PARENT_SEPARATOR = ">";
|
|
@@ -3360,7 +3360,7 @@ const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(S
|
|
|
3360
3360
|
onNone: () => selector,
|
|
3361
3361
|
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
3362
3362
|
}));
|
|
3363
|
-
const removalOf = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
3363
|
+
const removalOf$1 = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
3364
3364
|
onEmpty: () => Option.none(),
|
|
3365
3365
|
onNonEmpty: (parents, target) => Option.some({
|
|
3366
3366
|
key,
|
|
@@ -3377,12 +3377,12 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
3377
3377
|
file,
|
|
3378
3378
|
line,
|
|
3379
3379
|
column,
|
|
3380
|
-
rule: RULE$
|
|
3380
|
+
rule: RULE$73,
|
|
3381
3381
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
3382
3382
|
});
|
|
3383
3383
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
3384
3384
|
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
3385
|
-
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
3385
|
+
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf$1(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
3386
3386
|
const requiredPeersOf = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
3387
3387
|
peer,
|
|
3388
3388
|
dependent
|
|
@@ -3411,7 +3411,7 @@ const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedP
|
|
|
3411
3411
|
});
|
|
3412
3412
|
});
|
|
3413
3413
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3414
|
-
const RULE$
|
|
3414
|
+
const RULE$72 = "colocated-git-patterns";
|
|
3415
3415
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3416
3416
|
const ROOT$3 = ".";
|
|
3417
3417
|
const NEGATION = "!";
|
|
@@ -3422,7 +3422,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
3422
3422
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3423
3423
|
const SPACES = /\s+/u;
|
|
3424
3424
|
const FIRST$26 = 1;
|
|
3425
|
-
const READ_CONCURRENCY$
|
|
3425
|
+
const READ_CONCURRENCY$41 = 16;
|
|
3426
3426
|
const withoutPrefix = (prefix, text) => {
|
|
3427
3427
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3428
3428
|
return text;
|
|
@@ -3458,7 +3458,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3458
3458
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3459
3459
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3460
3460
|
});
|
|
3461
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3461
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$72)(entry.file, {
|
|
3462
3462
|
line: entry.line,
|
|
3463
3463
|
column: FIRST$26
|
|
3464
3464
|
}, message);
|
|
@@ -3513,19 +3513,19 @@ const repeated = (entries) => (entry) => {
|
|
|
3513
3513
|
/** @internal */
|
|
3514
3514
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3515
3515
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3516
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3516
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$41 });
|
|
3517
3517
|
const entries = Array$1.flatten(read);
|
|
3518
3518
|
const workspaces = yield* workspaceDirectories(root);
|
|
3519
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3519
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$41 });
|
|
3520
3520
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3521
3521
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3522
3522
|
});
|
|
3523
3523
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3524
|
-
const RULE$
|
|
3524
|
+
const RULE$71 = "colocated-test";
|
|
3525
3525
|
const FIRST$25 = 1;
|
|
3526
|
-
const READ_CONCURRENCY$
|
|
3526
|
+
const READ_CONCURRENCY$40 = 64;
|
|
3527
3527
|
const ROOT_SUBPATH$2 = ".";
|
|
3528
|
-
const NAME_GROUP$
|
|
3528
|
+
const NAME_GROUP$2 = "name";
|
|
3529
3529
|
const SPECIFIER_GROUP = "specifier";
|
|
3530
3530
|
const SCRIPT$1 = /\.[cm]?[jt]sx?$/u;
|
|
3531
3531
|
const TEST_FILE$4 = /\.test\.[cm]?[jt]sx?$/u;
|
|
@@ -3544,11 +3544,11 @@ const problemFor$10 = (test, message) => ({
|
|
|
3544
3544
|
file: test.file,
|
|
3545
3545
|
line: FIRST$25,
|
|
3546
3546
|
column: FIRST$25,
|
|
3547
|
-
rule: RULE$
|
|
3547
|
+
rule: RULE$71,
|
|
3548
3548
|
message: `${test.base} ${message}`
|
|
3549
3549
|
});
|
|
3550
3550
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
3551
|
-
const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP$
|
|
3551
|
+
const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP$2), ...groupsOf$1(source, DIRNAME_REFERENCE, NAME_GROUP$2)], Array$1.some((name) => !TEST_FILE$4.test(name)));
|
|
3552
3552
|
const ownerOf$5 = (packages, name) => {
|
|
3553
3553
|
const owners = pipe(packages, Array$1.filter((directory) => String$1.startsWith(directory)(name)));
|
|
3554
3554
|
return Array$1.last(Array$1.sort(owners, byLength$2));
|
|
@@ -3607,12 +3607,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3607
3607
|
directory: files.dirname(file)
|
|
3608
3608
|
};
|
|
3609
3609
|
}));
|
|
3610
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3610
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$40 });
|
|
3611
3611
|
return Array$1.getSomes(found);
|
|
3612
3612
|
});
|
|
3613
3613
|
// src/shared/lib/agent-docs.ts
|
|
3614
3614
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3615
|
-
const READ_CONCURRENCY$
|
|
3615
|
+
const READ_CONCURRENCY$39 = 16;
|
|
3616
3616
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3617
3617
|
const files = yield* RepositoryFiles;
|
|
3618
3618
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3621,13 +3621,13 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3621
3621
|
const file = files.join(root, name);
|
|
3622
3622
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3623
3623
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3624
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3624
|
+
}, { concurrency: READ_CONCURRENCY$39 });
|
|
3625
3625
|
return Array$1.getSomes(found);
|
|
3626
3626
|
});
|
|
3627
3627
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3628
3628
|
const RECOMMENDED_LINES = 200;
|
|
3629
3629
|
const FIRST$24 = 1;
|
|
3630
|
-
const RULE$
|
|
3630
|
+
const RULE$70 = "agent-docs-length";
|
|
3631
3631
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3632
3632
|
const problemFor$9 = (file) => (lines) => {
|
|
3633
3633
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3635,18 +3635,18 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3635
3635
|
file,
|
|
3636
3636
|
line: 201,
|
|
3637
3637
|
column: FIRST$24,
|
|
3638
|
-
rule: RULE$
|
|
3638
|
+
rule: RULE$70,
|
|
3639
3639
|
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.`
|
|
3640
3640
|
});
|
|
3641
3641
|
};
|
|
3642
3642
|
/** @internal */
|
|
3643
3643
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3644
3644
|
// src/features/check-placement/model/claude-link.ts
|
|
3645
|
-
const RULE$
|
|
3645
|
+
const RULE$69 = "claude-md-link";
|
|
3646
3646
|
const CLAUDE = "CLAUDE.md";
|
|
3647
3647
|
const AGENTS = "AGENTS.md";
|
|
3648
3648
|
const FIRST$23 = 1;
|
|
3649
|
-
const READ_CONCURRENCY$
|
|
3649
|
+
const READ_CONCURRENCY$38 = 16;
|
|
3650
3650
|
const MESSAGE$14 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3651
3651
|
/** @internal */
|
|
3652
3652
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3661,20 +3661,20 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3661
3661
|
file: path,
|
|
3662
3662
|
line: FIRST$23,
|
|
3663
3663
|
column: FIRST$23,
|
|
3664
|
-
rule: RULE$
|
|
3664
|
+
rule: RULE$69,
|
|
3665
3665
|
message: MESSAGE$14
|
|
3666
3666
|
})));
|
|
3667
3667
|
});
|
|
3668
3668
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3669
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3669
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$38 });
|
|
3670
3670
|
return Array$1.getSomes(found);
|
|
3671
3671
|
});
|
|
3672
3672
|
// src/features/check-placement/model/dangling-links.ts
|
|
3673
|
-
const RULE$
|
|
3674
|
-
const SEPARATOR$
|
|
3673
|
+
const RULE$68 = "dangling-link";
|
|
3674
|
+
const SEPARATOR$25 = "/";
|
|
3675
3675
|
const FIRST$22 = 1;
|
|
3676
|
-
const READ_CONCURRENCY$
|
|
3677
|
-
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$
|
|
3676
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3677
|
+
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$25}`)(name);
|
|
3678
3678
|
/** @internal */
|
|
3679
3679
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3680
3680
|
const files = yield* RepositoryFiles;
|
|
@@ -3686,17 +3686,17 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3686
3686
|
file,
|
|
3687
3687
|
line: FIRST$22,
|
|
3688
3688
|
column: FIRST$22,
|
|
3689
|
-
rule: RULE$
|
|
3689
|
+
rule: RULE$68,
|
|
3690
3690
|
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.`
|
|
3691
3691
|
})));
|
|
3692
3692
|
});
|
|
3693
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3693
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$37 });
|
|
3694
3694
|
return Array$1.getSomes(found);
|
|
3695
3695
|
});
|
|
3696
3696
|
// src/features/check-placement/model/member-sources.ts
|
|
3697
3697
|
const ROOT_WORKSPACE$1 = ".";
|
|
3698
3698
|
const FIRST$21 = 1;
|
|
3699
|
-
const SEPARATOR$
|
|
3699
|
+
const SEPARATOR$24 = "/";
|
|
3700
3700
|
const EXCLUDED$7 = [
|
|
3701
3701
|
":(exclude,attr:linguist-vendored)",
|
|
3702
3702
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3721,7 +3721,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
|
|
|
3721
3721
|
rule,
|
|
3722
3722
|
message
|
|
3723
3723
|
});
|
|
3724
|
-
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$
|
|
3724
|
+
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$24}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
|
|
3725
3725
|
workspace,
|
|
3726
3726
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3727
3727
|
})));
|
|
@@ -3744,9 +3744,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3744
3744
|
}));
|
|
3745
3745
|
});
|
|
3746
3746
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3747
|
-
const RULE$
|
|
3747
|
+
const RULE$67 = "deployed-readme";
|
|
3748
3748
|
const ROOT_DIRECTORY$4 = "";
|
|
3749
|
-
const READ_CONCURRENCY$
|
|
3749
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3750
3750
|
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.";
|
|
3751
3751
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3752
3752
|
const ADDRESS_KEYS = [
|
|
@@ -3784,14 +3784,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3784
3784
|
const readme = yield* readReadme({
|
|
3785
3785
|
root,
|
|
3786
3786
|
directory,
|
|
3787
|
-
rule: RULE$
|
|
3787
|
+
rule: RULE$67,
|
|
3788
3788
|
missingMessage: MISSING_MESSAGE$2
|
|
3789
3789
|
});
|
|
3790
3790
|
return Result.match(readme, {
|
|
3791
3791
|
onFailure: Option.some,
|
|
3792
3792
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3793
3793
|
file,
|
|
3794
|
-
rule: RULE$
|
|
3794
|
+
rule: RULE$67,
|
|
3795
3795
|
message: NO_URL_MESSAGE
|
|
3796
3796
|
})))
|
|
3797
3797
|
});
|
|
@@ -3802,16 +3802,16 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3802
3802
|
const listed = yield* files.listedFiles(root);
|
|
3803
3803
|
const directories = yield* workspaceDirectories(root);
|
|
3804
3804
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3805
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3805
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$36 });
|
|
3806
3806
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3807
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3807
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$36 });
|
|
3808
3808
|
return Array$1.getSomes(found);
|
|
3809
3809
|
});
|
|
3810
3810
|
// src/features/check-placement/model/nested-docs.ts
|
|
3811
|
-
const RULE$
|
|
3811
|
+
const RULE$66 = "nested-docs";
|
|
3812
3812
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3813
|
-
const SEPARATOR$
|
|
3814
|
-
const READ_CONCURRENCY$
|
|
3813
|
+
const SEPARATOR$23 = "/";
|
|
3814
|
+
const READ_CONCURRENCY$35 = 64;
|
|
3815
3815
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3816
3816
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3817
3817
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -3820,8 +3820,8 @@ const MISSING_RULE = "workspace-agents-md";
|
|
|
3820
3820
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3821
3821
|
const taggedError$13 = Schema.TaggedError;
|
|
3822
3822
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3823
|
-
const isNested = (name) => String$1.includes(SEPARATOR$
|
|
3824
|
-
const problemFor$8 = problemInFile(RULE$
|
|
3823
|
+
const isNested = (name) => String$1.includes(SEPARATOR$23)(name);
|
|
3824
|
+
const problemFor$8 = problemInFile(RULE$66);
|
|
3825
3825
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3826
3826
|
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.";
|
|
3827
3827
|
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.";
|
|
@@ -3868,7 +3868,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3868
3868
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3869
3869
|
workspaceAgentDocs
|
|
3870
3870
|
};
|
|
3871
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3871
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$35 });
|
|
3872
3872
|
const missing = missingProblems({
|
|
3873
3873
|
required: workspaceAgentDocs,
|
|
3874
3874
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3878,15 +3878,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3878
3878
|
return [...Array$1.getSomes(found), ...missing];
|
|
3879
3879
|
});
|
|
3880
3880
|
// src/features/check-placement/model/published-readme.ts
|
|
3881
|
-
const RULE$
|
|
3882
|
-
const READ_CONCURRENCY$
|
|
3881
|
+
const RULE$65 = "published-readme";
|
|
3882
|
+
const READ_CONCURRENCY$34 = 16;
|
|
3883
3883
|
const MESSAGE$13 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3884
3884
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3885
3885
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3886
3886
|
const readme = yield* readReadme({
|
|
3887
3887
|
root,
|
|
3888
3888
|
directory,
|
|
3889
|
-
rule: RULE$
|
|
3889
|
+
rule: RULE$65,
|
|
3890
3890
|
missingMessage: MISSING_MESSAGE
|
|
3891
3891
|
});
|
|
3892
3892
|
return Result.match(readme, {
|
|
@@ -3897,7 +3897,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3897
3897
|
file,
|
|
3898
3898
|
line,
|
|
3899
3899
|
column,
|
|
3900
|
-
rule: RULE$
|
|
3900
|
+
rule: RULE$65,
|
|
3901
3901
|
message: MESSAGE$13
|
|
3902
3902
|
};
|
|
3903
3903
|
}))
|
|
@@ -3906,11 +3906,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3906
3906
|
/** @internal */
|
|
3907
3907
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3908
3908
|
const projects = yield* publishedProjects(root);
|
|
3909
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3909
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$34 });
|
|
3910
3910
|
return Array$1.getSomes(found);
|
|
3911
3911
|
});
|
|
3912
3912
|
// src/features/check-placement/model/published-tests.ts
|
|
3913
|
-
const RULE$
|
|
3913
|
+
const RULE$64 = "published-tests";
|
|
3914
3914
|
const FILE_START = 1;
|
|
3915
3915
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3916
3916
|
const MESSAGE$12 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3924,7 +3924,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3924
3924
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3925
3925
|
line: FILE_START,
|
|
3926
3926
|
column: FILE_START,
|
|
3927
|
-
rule: RULE$
|
|
3927
|
+
rule: RULE$64,
|
|
3928
3928
|
message: MESSAGE$12
|
|
3929
3929
|
});
|
|
3930
3930
|
});
|
|
@@ -3938,13 +3938,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3938
3938
|
return Array$1.getSomes(found);
|
|
3939
3939
|
});
|
|
3940
3940
|
// src/features/check-placement/model/root-docs.ts
|
|
3941
|
-
const RULE$
|
|
3942
|
-
const SEPARATOR$
|
|
3941
|
+
const RULE$63 = "root-docs";
|
|
3942
|
+
const SEPARATOR$22 = "/";
|
|
3943
3943
|
const FIRST$20 = 1;
|
|
3944
3944
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
3945
3945
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3946
3946
|
const MESSAGE$11 = "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.";
|
|
3947
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$
|
|
3947
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$22)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
3948
3948
|
/** @internal */
|
|
3949
3949
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3950
3950
|
const files = yield* RepositoryFiles;
|
|
@@ -3953,17 +3953,17 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3953
3953
|
file: files.join(root, name),
|
|
3954
3954
|
line: FIRST$20,
|
|
3955
3955
|
column: FIRST$20,
|
|
3956
|
-
rule: RULE$
|
|
3956
|
+
rule: RULE$63,
|
|
3957
3957
|
message: `${name} ${MESSAGE$11}`
|
|
3958
3958
|
})));
|
|
3959
3959
|
});
|
|
3960
3960
|
// src/features/check-placement/model/root-readme.ts
|
|
3961
|
-
const RULE$
|
|
3961
|
+
const RULE$62 = "root-readme";
|
|
3962
3962
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3963
|
-
const READ_CONCURRENCY$
|
|
3963
|
+
const READ_CONCURRENCY$33 = 16;
|
|
3964
3964
|
const START$31 = 0;
|
|
3965
3965
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3966
|
-
const RELATIVE$
|
|
3966
|
+
const RELATIVE$3 = /^\.\//u;
|
|
3967
3967
|
const MarketplacePlugin = Schema.Struct({
|
|
3968
3968
|
name: Schema.optional(Schema.String),
|
|
3969
3969
|
source: Schema.Unknown
|
|
@@ -3976,7 +3976,7 @@ const NO_PLUGINS = {
|
|
|
3976
3976
|
const isCheckPolicy = ({ packageName }) => Option.contains(packageName, SELF_NAME);
|
|
3977
3977
|
const messageFor$4 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
|
|
3978
3978
|
const pluginsOf = (plugins) => {
|
|
3979
|
-
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$
|
|
3979
|
+
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$3, "")));
|
|
3980
3980
|
const segments = pipe(directories, Array$1.map(baseName$1));
|
|
3981
3981
|
return {
|
|
3982
3982
|
directories,
|
|
@@ -4001,7 +4001,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4001
4001
|
const message = messageFor$4(workspace.directory);
|
|
4002
4002
|
const at = positionOf(source);
|
|
4003
4003
|
const pattern = patternFor(plugins)(workspace);
|
|
4004
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4004
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$62)(file, at(found.index ?? START$31), message)));
|
|
4005
4005
|
};
|
|
4006
4006
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4007
4007
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4018,7 +4018,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4018
4018
|
const named = yield* namedWorkspaces(root);
|
|
4019
4019
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4020
4020
|
const plugins = yield* marketplacePlugins(root);
|
|
4021
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4021
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$33 });
|
|
4022
4022
|
return Array$1.flatten(found);
|
|
4023
4023
|
});
|
|
4024
4024
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4038,10 +4038,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4038
4038
|
return Array$1.flatten(found);
|
|
4039
4039
|
});
|
|
4040
4040
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4041
|
-
const RULE$
|
|
4041
|
+
const RULE$61 = "docs-mirror";
|
|
4042
4042
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4043
4043
|
const MIRROR_LIMIT = 3;
|
|
4044
|
-
const READ_CONCURRENCY$
|
|
4044
|
+
const READ_CONCURRENCY$32 = 16;
|
|
4045
4045
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4046
4046
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4047
4047
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4063,7 +4063,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4063
4063
|
file,
|
|
4064
4064
|
line,
|
|
4065
4065
|
column,
|
|
4066
|
-
rule: RULE$
|
|
4066
|
+
rule: RULE$61,
|
|
4067
4067
|
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.`
|
|
4068
4068
|
};
|
|
4069
4069
|
}), Option.toArray);
|
|
@@ -4078,7 +4078,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4078
4078
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4079
4079
|
directory,
|
|
4080
4080
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4081
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4081
|
+
}))), { concurrency: READ_CONCURRENCY$32 });
|
|
4082
4082
|
});
|
|
4083
4083
|
/** @internal */
|
|
4084
4084
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4091,11 +4091,11 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4091
4091
|
onNone: () => [],
|
|
4092
4092
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4093
4093
|
})));
|
|
4094
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4094
|
+
}, { concurrency: READ_CONCURRENCY$32 });
|
|
4095
4095
|
return Array$1.flatten(found);
|
|
4096
4096
|
});
|
|
4097
4097
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4098
|
-
const RULE$
|
|
4098
|
+
const RULE$60 = "ignored-sources";
|
|
4099
4099
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4100
4100
|
const FIRST$19 = 1;
|
|
4101
4101
|
const MESSAGE$10 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -4107,7 +4107,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4107
4107
|
file: files.join(root, file),
|
|
4108
4108
|
line: FIRST$19,
|
|
4109
4109
|
column: FIRST$19,
|
|
4110
|
-
rule: RULE$
|
|
4110
|
+
rule: RULE$60,
|
|
4111
4111
|
message: MESSAGE$10
|
|
4112
4112
|
})));
|
|
4113
4113
|
});
|
|
@@ -12688,7 +12688,7 @@ var english_verbs_default = [
|
|
|
12688
12688
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12689
12689
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12690
12690
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12691
|
-
const SEPARATOR$
|
|
12691
|
+
const SEPARATOR$20 = "/";
|
|
12692
12692
|
const NEXT$3 = 1;
|
|
12693
12693
|
const WORD_SEPARATOR$1 = "-";
|
|
12694
12694
|
const MINIMUM_WORDS = 2;
|
|
@@ -12714,7 +12714,7 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12714
12714
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12715
12715
|
};
|
|
12716
12716
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12717
|
-
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$
|
|
12717
|
+
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$20))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$20}${FEATURES$1}${slice}`));
|
|
12718
12718
|
const SLICE_LAYERS = [
|
|
12719
12719
|
"features",
|
|
12720
12720
|
"entities",
|
|
@@ -12722,26 +12722,26 @@ const SLICE_LAYERS = [
|
|
|
12722
12722
|
"pages"
|
|
12723
12723
|
];
|
|
12724
12724
|
const SLICE_DEPTHS = [3, 4];
|
|
12725
|
-
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
12725
|
+
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$20);
|
|
12726
12726
|
const isInSliceLayer = (parts) => {
|
|
12727
12727
|
const [source, layer] = parts;
|
|
12728
|
-
return `${source}${SEPARATOR$
|
|
12728
|
+
return `${source}${SEPARATOR$20}` === SOURCE$2 && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12729
12729
|
};
|
|
12730
12730
|
const indexedSlice = (owned) => {
|
|
12731
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12731
|
+
const parts = String$1.split(owned.inner, SEPARATOR$20);
|
|
12732
12732
|
const depth = parts.length - NEXT$3;
|
|
12733
|
-
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$
|
|
12733
|
+
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$20}${pathPrefix(parts, depth)}`));
|
|
12734
12734
|
};
|
|
12735
12735
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12736
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12737
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12736
|
+
const parts = String$1.split(inner, SEPARATOR$20);
|
|
12737
|
+
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$20}${pathPrefix(parts, depth)}`);
|
|
12738
12738
|
const isSegmentFolder = (depth) => parts.length > depth + NEXT$3 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
|
|
12739
|
-
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$
|
|
12739
|
+
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$20}${pathPrefix(parts, depth + NEXT$3)}`));
|
|
12740
12740
|
};
|
|
12741
12741
|
const deployNamed = ({ workspace, inner }) => {
|
|
12742
12742
|
if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
|
|
12743
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12744
|
-
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$
|
|
12743
|
+
const segments = String$1.split(inner, SEPARATOR$20);
|
|
12744
|
+
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$20}${Array$1.join(Array$1.take(segments, index + NEXT$3), SEPARATOR$20)}`));
|
|
12745
12745
|
};
|
|
12746
12746
|
/** @internal */
|
|
12747
12747
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12784,9 +12784,9 @@ const LAYER_ITEMS = [
|
|
|
12784
12784
|
"attribute_item",
|
|
12785
12785
|
"inner_attribute_item"
|
|
12786
12786
|
];
|
|
12787
|
-
const READ_CONCURRENCY$
|
|
12787
|
+
const READ_CONCURRENCY$31 = 64;
|
|
12788
12788
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12789
|
-
const NONE$
|
|
12789
|
+
const NONE$5 = [];
|
|
12790
12790
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
12791
12791
|
const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
|
|
12792
12792
|
const ENTRY_MESSAGE = "makes an inner module of a slice public. Declare it with plain mod and re-export what other slices use with pub use from the slice module.";
|
|
@@ -12801,12 +12801,12 @@ const isRootItem = (inner) => (item) => {
|
|
|
12801
12801
|
};
|
|
12802
12802
|
const isLayerItem = (item) => Array$1.contains(LAYER_ITEMS, item.kind) || item.kind === "mod_item" && !item.inline;
|
|
12803
12803
|
const entryProblems$2 = (file, modulePath, parsed) => {
|
|
12804
|
-
if (!isSliceIndex(modulePath)) return NONE$
|
|
12804
|
+
if (!isSliceIndex(modulePath)) return NONE$5;
|
|
12805
12805
|
return pipe(parsed.items, Array$1.filter((item) => item.kind === "mod_item" && item.visible), Array$1.map(itemProblem(file, ENTRY_RULE$1, ENTRY_MESSAGE)));
|
|
12806
12806
|
};
|
|
12807
12807
|
const moduleProblems = ({ source, parsed }) => entryProblems$2(source.file, modulePathOf(source.inner), parsed);
|
|
12808
12808
|
const testProblems = ({ source, parsed }) => {
|
|
12809
|
-
if (parsed.replacesAllocator) return NONE$
|
|
12809
|
+
if (parsed.replacesAllocator) return NONE$5;
|
|
12810
12810
|
return [fileProblem$1({
|
|
12811
12811
|
file: source.file,
|
|
12812
12812
|
rule: TEST_RULE,
|
|
@@ -12819,8 +12819,8 @@ const PROBLEMS = {
|
|
|
12819
12819
|
layer: (read) => strayItems(read, isLayerItem, LAYER_INDEX_MESSAGE),
|
|
12820
12820
|
test: testProblems,
|
|
12821
12821
|
module: moduleProblems,
|
|
12822
|
-
skipped: () => NONE$
|
|
12823
|
-
misplaced: () => NONE$
|
|
12822
|
+
skipped: () => NONE$5,
|
|
12823
|
+
misplaced: () => NONE$5
|
|
12824
12824
|
};
|
|
12825
12825
|
const problemsOf$4 = (read) => PROBLEMS[kindOf$1(read.source.inner)](read);
|
|
12826
12826
|
const misnamedSlice = ({ crate, inner }, root, join) => {
|
|
@@ -12857,20 +12857,20 @@ const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
|
|
|
12857
12857
|
const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModules(root) {
|
|
12858
12858
|
const files = yield* RepositoryFiles;
|
|
12859
12859
|
const sources = yield* rustSources(root);
|
|
12860
|
-
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$
|
|
12860
|
+
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$5;
|
|
12861
12861
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
12862
12862
|
const parse = parsedWith(language);
|
|
12863
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
12863
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$31 });
|
|
12864
12864
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12865
12865
|
});
|
|
12866
12866
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12867
|
-
const RULE$
|
|
12867
|
+
const RULE$59 = "shadcn-ui-alias";
|
|
12868
12868
|
const FIRST$18 = 1;
|
|
12869
12869
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12870
12870
|
file,
|
|
12871
12871
|
line: FIRST$18,
|
|
12872
12872
|
column: FIRST$18,
|
|
12873
|
-
rule: RULE$
|
|
12873
|
+
rule: RULE$59,
|
|
12874
12874
|
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/*".`
|
|
12875
12875
|
});
|
|
12876
12876
|
/** @internal */
|
|
@@ -12932,9 +12932,9 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
12932
12932
|
const BIN = "bin";
|
|
12933
12933
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
12934
12934
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12935
|
-
const SEPARATOR$
|
|
12935
|
+
const SEPARATOR$19 = "/";
|
|
12936
12936
|
const CURRENT = "./";
|
|
12937
|
-
const READ_CONCURRENCY$
|
|
12937
|
+
const READ_CONCURRENCY$30 = 8;
|
|
12938
12938
|
const FIRST$17 = 1;
|
|
12939
12939
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12940
12940
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -12950,7 +12950,7 @@ const runsIn = ({ text, start }) => pipe(Array$1.fromIterable(String$1.matchAll(
|
|
|
12950
12950
|
start
|
|
12951
12951
|
})), Option.toArray)));
|
|
12952
12952
|
const targetPaths = (held) => pipe(targetsIn(held), Array$1.map(withoutCurrent));
|
|
12953
|
-
const entriesOf = (manifest) => {
|
|
12953
|
+
const entriesOf$1 = (manifest) => {
|
|
12954
12954
|
const bins = targetPaths(manifest.bin);
|
|
12955
12955
|
return {
|
|
12956
12956
|
all: [
|
|
@@ -12964,22 +12964,22 @@ const entriesOf = (manifest) => {
|
|
|
12964
12964
|
const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
|
|
12965
12965
|
const files = yield* RepositoryFiles;
|
|
12966
12966
|
const manifest = yield* readManifest(files.join(root, directory));
|
|
12967
|
-
return pipe(manifest, Option.map(entriesOf), Option.getOrElse(() => NO_ENTRIES));
|
|
12967
|
+
return pipe(manifest, Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
|
|
12968
12968
|
});
|
|
12969
12969
|
const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
12970
12970
|
const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
12971
12971
|
const files = yield* RepositoryFiles;
|
|
12972
12972
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
12973
|
-
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$
|
|
12973
|
+
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$19}${name}`), Array$1.filter(isCommand));
|
|
12974
12974
|
});
|
|
12975
12975
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
12976
12976
|
const files = yield* RepositoryFiles;
|
|
12977
12977
|
const listed = yield* files.listedFiles(root);
|
|
12978
12978
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
12979
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
12979
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$30 });
|
|
12980
12980
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12981
12981
|
});
|
|
12982
|
-
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
12982
|
+
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$19));
|
|
12983
12983
|
const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.filter(({ path }) => !COMMAND$1.test(path) && !Array$1.contains(entries.all, path)), Array$1.map(({ path, start }) => ({
|
|
12984
12984
|
file,
|
|
12985
12985
|
...positionOf(source)(start),
|
|
@@ -13026,8 +13026,8 @@ const isCommandFile = (path) => isCommand(path) || COMMAND_FILE$1.test(path) &&
|
|
|
13026
13026
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
13027
13027
|
const files = yield* RepositoryFiles;
|
|
13028
13028
|
const listed = yield* files.listedFiles(root);
|
|
13029
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
13030
|
-
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$
|
|
13029
|
+
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$19}`);
|
|
13030
|
+
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$19}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
|
|
13031
13031
|
file: files.join(root, file),
|
|
13032
13032
|
line: FIRST$17,
|
|
13033
13033
|
column: FIRST$17,
|
|
@@ -13039,9 +13039,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13039
13039
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13040
13040
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13041
13041
|
const workflows = yield* workflowText(root);
|
|
13042
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
13043
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13044
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13042
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$30 });
|
|
13043
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$30 });
|
|
13044
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$30 });
|
|
13045
13045
|
return [
|
|
13046
13046
|
...Array$1.flatten(found),
|
|
13047
13047
|
...Array$1.getSomes(scripts),
|
|
@@ -13050,12 +13050,12 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13050
13050
|
});
|
|
13051
13051
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13052
13052
|
const START$30 = 0;
|
|
13053
|
-
const QUOTES
|
|
13053
|
+
const QUOTES = ["\"", "'"];
|
|
13054
13054
|
const firstIndex = (source, needles) => {
|
|
13055
13055
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13056
13056
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13057
13057
|
};
|
|
13058
|
-
const quoted = (text) => pipe(QUOTES
|
|
13058
|
+
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13059
13059
|
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$30));
|
|
13060
13060
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13061
13061
|
const MEMBER_LISTS = [
|
|
@@ -13103,15 +13103,15 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
13103
13103
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
13104
13104
|
const WRAP_OFFSET$2 = 1;
|
|
13105
13105
|
const WILDCARD$3 = /[*?[{]/u;
|
|
13106
|
-
const SEPARATOR$
|
|
13107
|
-
const RELATIVE$
|
|
13106
|
+
const SEPARATOR$18 = "/";
|
|
13107
|
+
const RELATIVE$2 = ".";
|
|
13108
13108
|
const JSON_EXTENSION = ".json";
|
|
13109
13109
|
const isObject = (node) => Predicate.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
13110
13110
|
const firstObject = (node) => {
|
|
13111
13111
|
if (isObject(node)) return Option.some(node);
|
|
13112
13112
|
return pipe(childrenOf$4(node), Array$1.findFirst(firstObject));
|
|
13113
13113
|
};
|
|
13114
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$
|
|
13114
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$18), Array$1.takeWhile((segment) => !WILDCARD$3.test(segment)), Array$1.join(SEPARATOR$18));
|
|
13115
13115
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
13116
13116
|
field: name,
|
|
13117
13117
|
text,
|
|
@@ -13122,7 +13122,7 @@ const objectsIn = (node) => [...Array$1.filter([node], isObject), ...pipe(childr
|
|
|
13122
13122
|
const referencedPaths = (references) => pipe(objectsIn(references), Array$1.flatMap((reference) => Option.toArray(propertyValue("path")(reference))), Array$1.flatMap(stringsIn));
|
|
13123
13123
|
const exactly = (text) => [text];
|
|
13124
13124
|
const relativeConfig = (text) => {
|
|
13125
|
-
if (String$1.startsWith(RELATIVE$
|
|
13125
|
+
if (String$1.startsWith(RELATIVE$2)(text)) return [text, `${text}${JSON_EXTENSION}`];
|
|
13126
13126
|
return [];
|
|
13127
13127
|
};
|
|
13128
13128
|
const patternRoot = (text) => pipe([leadingDirectory(text)], Array$1.filter(String$1.isNonEmpty));
|
|
@@ -13138,26 +13138,26 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13138
13138
|
])));
|
|
13139
13139
|
});
|
|
13140
13140
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13141
|
-
const RULE$
|
|
13141
|
+
const RULE$58 = "config-path";
|
|
13142
13142
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13143
13143
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13144
13144
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13145
13145
|
const OUTSIDE = "..";
|
|
13146
|
-
const READ_CONCURRENCY$
|
|
13146
|
+
const READ_CONCURRENCY$29 = 8;
|
|
13147
13147
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13148
13148
|
const files = yield* RepositoryFiles;
|
|
13149
13149
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
13150
13150
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13151
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13151
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$29 });
|
|
13152
13152
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13153
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13153
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$29 });
|
|
13154
13154
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13155
13155
|
});
|
|
13156
13156
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
13157
13157
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13158
13158
|
file,
|
|
13159
13159
|
...positionOf(source)(mention.index),
|
|
13160
|
-
rule: RULE$
|
|
13160
|
+
rule: RULE$58,
|
|
13161
13161
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13162
13162
|
});
|
|
13163
13163
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13170,7 +13170,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
13170
13170
|
const source = yield* files.readFile(file);
|
|
13171
13171
|
if (Option.isNone(source)) return [];
|
|
13172
13172
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13173
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13173
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$29 });
|
|
13174
13174
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13175
13175
|
});
|
|
13176
13176
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13182,7 +13182,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13182
13182
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13183
13183
|
file,
|
|
13184
13184
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13185
|
-
rule: RULE$
|
|
13185
|
+
rule: RULE$58,
|
|
13186
13186
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13187
13187
|
})));
|
|
13188
13188
|
});
|
|
@@ -13190,23 +13190,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13190
13190
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13191
13191
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13192
13192
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13193
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$
|
|
13193
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$29 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13194
13194
|
return [...Array$1.flatten(found), ...patterns];
|
|
13195
13195
|
});
|
|
13196
13196
|
// src/features/check-repository-layout/model/crates.ts
|
|
13197
|
-
const RULE$
|
|
13197
|
+
const RULE$57 = "unverified-crate";
|
|
13198
13198
|
const VERSION_RULE = "release-version";
|
|
13199
13199
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13200
13200
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13201
13201
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13202
|
-
const SEPARATOR$
|
|
13202
|
+
const SEPARATOR$17 = "/";
|
|
13203
13203
|
const FIRST$16 = 1;
|
|
13204
|
-
const READ_CONCURRENCY$
|
|
13204
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13205
13205
|
const problemFor$5 = (crate, message) => ({
|
|
13206
13206
|
file: crate.manifest,
|
|
13207
13207
|
line: FIRST$16,
|
|
13208
13208
|
column: FIRST$16,
|
|
13209
|
-
rule: RULE$
|
|
13209
|
+
rule: RULE$57,
|
|
13210
13210
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13211
13211
|
});
|
|
13212
13212
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13219,7 +13219,7 @@ const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories
|
|
|
13219
13219
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
13220
13220
|
const files = yield* RepositoryFiles;
|
|
13221
13221
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
13222
|
-
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
13222
|
+
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$17))), Array$1.contains(directory))));
|
|
13223
13223
|
if (Option.isNone(workspace)) return Option.none();
|
|
13224
13224
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
13225
13225
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
@@ -13238,11 +13238,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13238
13238
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13239
13239
|
const directories = yield* workspaceDirectories(root);
|
|
13240
13240
|
const crates = yield* cratesIn(root);
|
|
13241
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13241
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$28 });
|
|
13242
13242
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13243
13243
|
});
|
|
13244
13244
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13245
|
-
const RULE$
|
|
13245
|
+
const RULE$56 = "deploy-entry-pattern";
|
|
13246
13246
|
const FALLOW_KEYS = [
|
|
13247
13247
|
"entry",
|
|
13248
13248
|
"entryPoints",
|
|
@@ -13260,7 +13260,7 @@ const NEGATED = "!";
|
|
|
13260
13260
|
const ROOT_WORKSPACE = ".";
|
|
13261
13261
|
const WRAP_OFFSET$1 = 1;
|
|
13262
13262
|
const NO_OFFSET = 0;
|
|
13263
|
-
const READ_CONCURRENCY$
|
|
13263
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13264
13264
|
const MESSAGE$9 = "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.";
|
|
13265
13265
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13266
13266
|
const FALLOW = {
|
|
@@ -13313,7 +13313,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13313
13313
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13314
13314
|
file: path,
|
|
13315
13315
|
...positionOf(text.value)(start - kind.offset),
|
|
13316
|
-
rule: RULE$
|
|
13316
|
+
rule: RULE$56,
|
|
13317
13317
|
message: `${pattern} ${MESSAGE$9}`
|
|
13318
13318
|
})));
|
|
13319
13319
|
});
|
|
@@ -13342,11 +13342,11 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13342
13342
|
kind,
|
|
13343
13343
|
workspaces,
|
|
13344
13344
|
entries
|
|
13345
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13345
|
+
}), { concurrency: READ_CONCURRENCY$27 });
|
|
13346
13346
|
return Array$1.flatten(found);
|
|
13347
13347
|
});
|
|
13348
13348
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13349
|
-
const RULE$
|
|
13349
|
+
const RULE$55 = "listed-entry";
|
|
13350
13350
|
const ENTRY_KEYS = [
|
|
13351
13351
|
"entry",
|
|
13352
13352
|
"entryPoints",
|
|
@@ -13354,9 +13354,9 @@ const ENTRY_KEYS = [
|
|
|
13354
13354
|
];
|
|
13355
13355
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
13356
13356
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13357
|
-
const SEPARATOR$
|
|
13357
|
+
const SEPARATOR$16 = "/";
|
|
13358
13358
|
const WRAP_OFFSET = 1;
|
|
13359
|
-
const READ_CONCURRENCY$
|
|
13359
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13360
13360
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13361
13361
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13362
13362
|
const entryPatternsIn = (node) => {
|
|
@@ -13366,7 +13366,7 @@ const entryPatternsIn = (node) => {
|
|
|
13366
13366
|
})));
|
|
13367
13367
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13368
13368
|
};
|
|
13369
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
13369
|
+
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$16}`)(text))) || String$1.includes(SEPARATOR$16)(text) && !WILDCARD$2.test(text);
|
|
13370
13370
|
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13371
13371
|
const files = yield* RepositoryFiles;
|
|
13372
13372
|
const path = files.join(root, file);
|
|
@@ -13376,7 +13376,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13376
13376
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13377
13377
|
file: path,
|
|
13378
13378
|
...positionOf(text.value)(start),
|
|
13379
|
-
rule: RULE$
|
|
13379
|
+
rule: RULE$55,
|
|
13380
13380
|
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.`
|
|
13381
13381
|
})));
|
|
13382
13382
|
});
|
|
@@ -13384,11 +13384,11 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13384
13384
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13385
13385
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13386
13386
|
const directories = yield* workspaceDirectories(root);
|
|
13387
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
13387
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$26 });
|
|
13388
13388
|
return Array$1.flatten(found);
|
|
13389
13389
|
});
|
|
13390
13390
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13391
|
-
const RULE$
|
|
13391
|
+
const RULE$54 = "root-workspace-path";
|
|
13392
13392
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13393
13393
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13394
13394
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13407,7 +13407,7 @@ const mentions = (directory) => (text) => {
|
|
|
13407
13407
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13408
13408
|
file,
|
|
13409
13409
|
...positionOf(source)(found.start),
|
|
13410
|
-
rule: RULE$
|
|
13410
|
+
rule: RULE$54,
|
|
13411
13411
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
|
|
13412
13412
|
})));
|
|
13413
13413
|
/** @internal */
|
|
@@ -13421,10 +13421,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13421
13421
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13422
13422
|
});
|
|
13423
13423
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13424
|
-
const RULE$
|
|
13424
|
+
const RULE$53 = "hidden-verify";
|
|
13425
13425
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13426
13426
|
const FIRST$14 = 1;
|
|
13427
|
-
const READ_CONCURRENCY$
|
|
13427
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13428
13428
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13429
13429
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13430
13430
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13435,19 +13435,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13435
13435
|
file,
|
|
13436
13436
|
line: FIRST$14,
|
|
13437
13437
|
column: FIRST$14,
|
|
13438
|
-
rule: RULE$
|
|
13438
|
+
rule: RULE$53,
|
|
13439
13439
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
|
|
13440
13440
|
}).pipe(Option.filter(() => verified));
|
|
13441
13441
|
});
|
|
13442
13442
|
/** @internal */
|
|
13443
13443
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13444
13444
|
const directories = yield* workspaceDirectories(root);
|
|
13445
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13445
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$25 });
|
|
13446
13446
|
return Array$1.getSomes(found);
|
|
13447
13447
|
});
|
|
13448
13448
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13449
|
-
const RULE$
|
|
13450
|
-
const READ_CONCURRENCY$
|
|
13449
|
+
const RULE$52 = "shared-uncached-task";
|
|
13450
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13451
13451
|
const SHARED = 2;
|
|
13452
13452
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13453
13453
|
const UncachedTask = Schema.Struct({
|
|
@@ -13489,19 +13489,19 @@ const problemsOf$3 = (definitions) => {
|
|
|
13489
13489
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13490
13490
|
file,
|
|
13491
13491
|
...position,
|
|
13492
|
-
rule: RULE$
|
|
13492
|
+
rule: RULE$52,
|
|
13493
13493
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
|
|
13494
13494
|
})));
|
|
13495
13495
|
};
|
|
13496
13496
|
/** @internal */
|
|
13497
13497
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13498
13498
|
const directories = yield* workspaceDirectories(root);
|
|
13499
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13499
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
13500
13500
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13501
13501
|
});
|
|
13502
13502
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13503
|
-
const RULE$
|
|
13504
|
-
const READ_CONCURRENCY$
|
|
13503
|
+
const RULE$51 = "tested-verify";
|
|
13504
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13505
13505
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13506
13506
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13507
13507
|
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
@@ -13529,19 +13529,19 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13529
13529
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13530
13530
|
file,
|
|
13531
13531
|
...positionOf(source)(at.start),
|
|
13532
|
-
rule: RULE$
|
|
13532
|
+
rule: RULE$51,
|
|
13533
13533
|
message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
|
|
13534
13534
|
})))));
|
|
13535
13535
|
});
|
|
13536
13536
|
/** @internal */
|
|
13537
13537
|
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13538
13538
|
const directories = yield* workspaceDirectories(root);
|
|
13539
|
-
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13539
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
13540
13540
|
return Array$1.flatten(found);
|
|
13541
13541
|
});
|
|
13542
13542
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13543
|
-
const RULE$
|
|
13544
|
-
const READ_CONCURRENCY$
|
|
13543
|
+
const RULE$50 = "unlocked-task";
|
|
13544
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13545
13545
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13546
13546
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13547
13547
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -13552,13 +13552,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13552
13552
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13553
13553
|
file,
|
|
13554
13554
|
...positionOf(source)(task.start),
|
|
13555
|
-
rule: RULE$
|
|
13555
|
+
rule: RULE$50,
|
|
13556
13556
|
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.`
|
|
13557
13557
|
})), Option.toArray)));
|
|
13558
13558
|
/** @internal */
|
|
13559
13559
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13560
13560
|
const directories = yield* workspaceDirectories(root);
|
|
13561
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13561
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
13562
13562
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13563
13563
|
});
|
|
13564
13564
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13588,16 +13588,16 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13588
13588
|
});
|
|
13589
13589
|
// src/shared/lib/package-name.ts
|
|
13590
13590
|
const SCOPE$2 = "@";
|
|
13591
|
-
const SEPARATOR$
|
|
13591
|
+
const SEPARATOR$15 = "/";
|
|
13592
13592
|
const SCOPED_SEGMENTS = 2;
|
|
13593
13593
|
const PLAIN_SEGMENTS = 1;
|
|
13594
13594
|
const segmentCount = (specifier) => {
|
|
13595
13595
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13596
13596
|
return PLAIN_SEGMENTS;
|
|
13597
13597
|
};
|
|
13598
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13598
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$15), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$15));
|
|
13599
13599
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13600
|
-
const RELATIVE = /^\.\.?(?:\/|$)/u;
|
|
13600
|
+
const RELATIVE$1 = /^\.\.?(?:\/|$)/u;
|
|
13601
13601
|
const SUBPATH_IMPORT$1 = "#";
|
|
13602
13602
|
const WILDCARD$1 = "*";
|
|
13603
13603
|
const SOURCE_SUFFIXES = [
|
|
@@ -13633,13 +13633,13 @@ const existingSource = Effect.fn("existingSource")(function* existingSource(base
|
|
|
13633
13633
|
});
|
|
13634
13634
|
const localFile = Effect.fn("localFile")(function* localFile({ directory, imports }, from, specifier) {
|
|
13635
13635
|
const files = yield* RepositoryFiles;
|
|
13636
|
-
if (RELATIVE.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13636
|
+
if (RELATIVE$1.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13637
13637
|
const target = subpathTarget(imports, specifier);
|
|
13638
13638
|
if (Option.isNone(target)) return Option.none();
|
|
13639
13639
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
13640
13640
|
});
|
|
13641
13641
|
const referenceOf$2 = (graph, from, specifier) => {
|
|
13642
|
-
if (RELATIVE.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13642
|
+
if (RELATIVE$1.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13643
13643
|
const name = packageNameOf(specifier);
|
|
13644
13644
|
return Effect.succeedSome(Result.fail(name));
|
|
13645
13645
|
};
|
|
@@ -13868,12 +13868,12 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13868
13868
|
return yield* files.mergeBase(root, base);
|
|
13869
13869
|
});
|
|
13870
13870
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13871
|
-
const RULE$
|
|
13871
|
+
const RULE$49 = "migration-order";
|
|
13872
13872
|
const SNAPSHOT = "snapshot.json";
|
|
13873
13873
|
const MIGRATION = "migration.sql";
|
|
13874
13874
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
13875
13875
|
const FIRST$13 = 1;
|
|
13876
|
-
const READ_CONCURRENCY$
|
|
13876
|
+
const READ_CONCURRENCY$21 = 16;
|
|
13877
13877
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
13878
13878
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
13879
13879
|
const files = yield* RepositoryFiles;
|
|
@@ -13902,7 +13902,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13902
13902
|
file: join(root, file),
|
|
13903
13903
|
line: FIRST$13,
|
|
13904
13904
|
column: FIRST$13,
|
|
13905
|
-
rule: RULE$
|
|
13905
|
+
rule: RULE$49,
|
|
13906
13906
|
message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
|
|
13907
13907
|
})))), Option.getOrElse(() => []));
|
|
13908
13908
|
/** @internal */
|
|
@@ -13913,7 +13913,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
13913
13913
|
if (Option.isNone(found)) return [];
|
|
13914
13914
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
13915
13915
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
13916
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
13916
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$21 });
|
|
13917
13917
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
13918
13918
|
});
|
|
13919
13919
|
// src/shared/lib/bundle-error.ts
|
|
@@ -13953,7 +13953,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
13953
13953
|
catch: bundleErrorDetail
|
|
13954
13954
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
13955
13955
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
13956
|
-
const RULE$
|
|
13956
|
+
const RULE$48 = "plugin-dependencies";
|
|
13957
13957
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
13958
13958
|
const LOCK_FILE = "bun.lock";
|
|
13959
13959
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
@@ -13962,7 +13962,7 @@ const SUCCESS$6 = 0;
|
|
|
13962
13962
|
const NOT_STARTED = -1;
|
|
13963
13963
|
const DETAIL_LINES = 3;
|
|
13964
13964
|
const PLUGIN_CONCURRENCY = 2;
|
|
13965
|
-
const problemFor$4 = problemInFile(RULE$
|
|
13965
|
+
const problemFor$4 = problemInFile(RULE$48);
|
|
13966
13966
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
13967
13967
|
const files = yield* RepositoryFiles;
|
|
13968
13968
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -14181,7 +14181,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
14181
14181
|
});
|
|
14182
14182
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
14183
14183
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14184
|
-
const RULE$
|
|
14184
|
+
const RULE$47 = "optional-peer";
|
|
14185
14185
|
const REQUIRED_RULE = "required-peer";
|
|
14186
14186
|
const START$27 = 0;
|
|
14187
14187
|
const SINGLE$1 = 1;
|
|
@@ -14198,7 +14198,7 @@ const positionIn = (located, key, name) => {
|
|
|
14198
14198
|
const problemFor$3 = (located, name, importers) => ({
|
|
14199
14199
|
file: located.file,
|
|
14200
14200
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
14201
|
-
rule: RULE$
|
|
14201
|
+
rule: RULE$47,
|
|
14202
14202
|
message: `${name} is imported only from ${labelsOf$1(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
|
|
14203
14203
|
});
|
|
14204
14204
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -14234,7 +14234,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14234
14234
|
}));
|
|
14235
14235
|
};
|
|
14236
14236
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14237
|
-
const RULE$
|
|
14237
|
+
const RULE$46 = "side-effects";
|
|
14238
14238
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14239
14239
|
const START$26 = 0;
|
|
14240
14240
|
const FIRST$12 = 1;
|
|
@@ -14280,34 +14280,34 @@ const othersOf = (total) => {
|
|
|
14280
14280
|
if (total <= FIRST$12) return "";
|
|
14281
14281
|
return ` The same happens for ${String(total - FIRST$12)} other exports.`;
|
|
14282
14282
|
};
|
|
14283
|
-
const messageOf$
|
|
14283
|
+
const messageOf$6 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(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.`;
|
|
14284
14284
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14285
14285
|
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$26));
|
|
14286
14286
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14287
14287
|
file,
|
|
14288
14288
|
...positionOf(source)(keyIndex$1(source)),
|
|
14289
|
-
rule: RULE$
|
|
14290
|
-
message: messageOf$
|
|
14289
|
+
rule: RULE$46,
|
|
14290
|
+
message: messageOf$6(worst, excesses.length)
|
|
14291
14291
|
})), Option.toArray);
|
|
14292
14292
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14293
|
-
const RULE$
|
|
14293
|
+
const RULE$45 = "top-level-effect";
|
|
14294
14294
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14295
|
-
const READ_CONCURRENCY$
|
|
14295
|
+
const READ_CONCURRENCY$20 = 16;
|
|
14296
14296
|
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.";
|
|
14297
14297
|
const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
|
|
14298
14298
|
const isEffect = (statement) => {
|
|
14299
14299
|
if (isExpressionStatement(statement)) return !isStringLiteral(statement.expression);
|
|
14300
14300
|
return isImportDeclaration(statement) && Predicate.isUndefined(statement.importClause);
|
|
14301
14301
|
};
|
|
14302
|
-
const messageOf$
|
|
14302
|
+
const messageOf$5 = (statement) => {
|
|
14303
14303
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
14304
14304
|
return STATEMENT_MESSAGE;
|
|
14305
14305
|
};
|
|
14306
14306
|
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14307
14307
|
const retained = api.createSourceFile(file, source);
|
|
14308
14308
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14309
|
-
rule: RULE$
|
|
14310
|
-
message: messageOf$
|
|
14309
|
+
rule: RULE$45,
|
|
14310
|
+
message: messageOf$5(statement)
|
|
14311
14311
|
})(statement)));
|
|
14312
14312
|
retained.dispose();
|
|
14313
14313
|
return problems;
|
|
@@ -14319,7 +14319,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14319
14319
|
const names = yield* files.ownedFiles(root);
|
|
14320
14320
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14321
14321
|
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
14322
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$
|
|
14322
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$20 });
|
|
14323
14323
|
return Array$1.flatten(found);
|
|
14324
14324
|
}, Effect.scoped);
|
|
14325
14325
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
@@ -14349,7 +14349,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14349
14349
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14350
14350
|
const ownedSet = new Set(owned);
|
|
14351
14351
|
const directories = pipe(used, Array$1.flatMap(({ modules }) => modules), Array$1.filter((module) => ownedSet.has(module)), Array$1.flatMap((module) => Option.toArray(packageDirectoryOf(manifests, files)(module))), Array$1.dedupe, Array$1.filter((found) => found !== directory), Array$1.sortBy(Order.String));
|
|
14352
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14352
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$20 });
|
|
14353
14353
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14354
14354
|
const index = nameIndex$1(located.source);
|
|
14355
14355
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14475,7 +14475,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
14475
14475
|
return Array$1.flatten(found);
|
|
14476
14476
|
});
|
|
14477
14477
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14478
|
-
const RULE$
|
|
14478
|
+
const RULE$44 = "legacy-typescript";
|
|
14479
14479
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14480
14480
|
const COMPILER = "typescript";
|
|
14481
14481
|
const CURRENT_MAJOR = 7;
|
|
@@ -14494,7 +14494,7 @@ const lineOf$4 = (source) => (id) => pipe(String$1.split(source, "\n"), Array$1.
|
|
|
14494
14494
|
onNone: () => FIRST$11,
|
|
14495
14495
|
onSome: (index) => index + FIRST$11
|
|
14496
14496
|
}));
|
|
14497
|
-
const messageOf$
|
|
14497
|
+
const messageOf$4 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array$1.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
|
|
14498
14498
|
/** @internal */
|
|
14499
14499
|
const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(function* checkTypescriptGeneration(root) {
|
|
14500
14500
|
const files = yield* RepositoryFiles;
|
|
@@ -14506,12 +14506,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14506
14506
|
file,
|
|
14507
14507
|
line: lineOf$4(source)(legacy.id),
|
|
14508
14508
|
column: FIRST$11,
|
|
14509
|
-
rule: RULE$
|
|
14510
|
-
message: messageOf$
|
|
14509
|
+
rule: RULE$44,
|
|
14510
|
+
message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14511
14511
|
})));
|
|
14512
14512
|
});
|
|
14513
14513
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14514
|
-
const RULE$
|
|
14514
|
+
const RULE$43 = "worker-bundle";
|
|
14515
14515
|
const BUNDLE_CONCURRENCY = 4;
|
|
14516
14516
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14517
14517
|
const CONDITIONS = [
|
|
@@ -14522,7 +14522,7 @@ const CONDITIONS = [
|
|
|
14522
14522
|
"module",
|
|
14523
14523
|
"default"
|
|
14524
14524
|
];
|
|
14525
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14525
|
+
const problemFor$2 = problemInFile(RULE$43);
|
|
14526
14526
|
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14527
14527
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14528
14528
|
const built = yield* Effect.tryPromise({
|
|
@@ -14712,7 +14712,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14712
14712
|
...secretWeakenings(config.h56m, expected.secrets)
|
|
14713
14713
|
];
|
|
14714
14714
|
// src/app/disabled-rules.ts
|
|
14715
|
-
const RULE$
|
|
14715
|
+
const RULE$42 = "disabled-rule";
|
|
14716
14716
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14717
14717
|
const START$24 = 0;
|
|
14718
14718
|
const SIDE_CONFIG = /(?:^|\/)(?:\.oxlintrc(?:\.jsonc?)?|oxlint\.config\.[cm]?[jt]s|\.oxlintignore|\.eslintrc(?:\.\w+)?|eslint\.config\.[cm]?[jt]s|\.eslintignore|\.textlintrc(?:\.\w+)?|\.textlintignore|\.markdownlint(?:-cli2)?(?:\.\w+)?|\.markdownlintignore|\.prettierignore|\.oxfmtrc(?:\.jsonc?)?|knip\.jsonc?)$/u;
|
|
@@ -14726,7 +14726,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14726
14726
|
const files = yield* RepositoryFiles;
|
|
14727
14727
|
const listed = yield* files.listedFiles(root);
|
|
14728
14728
|
const isExempt = matcher(exempt);
|
|
14729
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$
|
|
14729
|
+
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$42)(files.join(root, name), "")(START$24, SIDE_CONFIG_MESSAGE)));
|
|
14730
14730
|
});
|
|
14731
14731
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14732
14732
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14738,7 +14738,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14738
14738
|
})
|
|
14739
14739
|
});
|
|
14740
14740
|
const expected = yield* expectationsIn(root);
|
|
14741
|
-
const at = problemAtIndex(RULE$
|
|
14741
|
+
const at = problemAtIndex(RULE$42)(file, source);
|
|
14742
14742
|
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$24), message)));
|
|
14743
14743
|
});
|
|
14744
14744
|
/** @internal */
|
|
@@ -14746,7 +14746,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
|
|
|
14746
14746
|
const files = yield* RepositoryFiles;
|
|
14747
14747
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14748
14748
|
if (Option.isNone(text)) return [];
|
|
14749
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$
|
|
14749
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$42)(file, "")(START$24, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
14750
14750
|
});
|
|
14751
14751
|
// src/app/build-checks.ts
|
|
14752
14752
|
/** @internal */
|
|
@@ -14842,7 +14842,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
14842
14842
|
imports: importedFilesOf(checker)(sourceFile)
|
|
14843
14843
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
14844
14844
|
// src/features/check-value-owners/model/name-lists.ts
|
|
14845
|
-
const RULE$
|
|
14845
|
+
const RULE$41 = "hand-written-names";
|
|
14846
14846
|
const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
14847
14847
|
const nameListOf = (site) => {
|
|
14848
14848
|
if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -14857,7 +14857,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
14857
14857
|
file,
|
|
14858
14858
|
line,
|
|
14859
14859
|
column,
|
|
14860
|
-
rule: RULE$
|
|
14860
|
+
rule: RULE$41,
|
|
14861
14861
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
14862
14862
|
});
|
|
14863
14863
|
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
@@ -15463,7 +15463,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15463
15463
|
const PATH_PREFIX = /^(?:!|\.\/)+/u;
|
|
15464
15464
|
const GLOB$1 = /[*?{[]/u;
|
|
15465
15465
|
const EXTENSION$2 = /\.[^./]+$/u;
|
|
15466
|
-
const SEPARATOR$
|
|
15466
|
+
const SEPARATOR$14 = "/";
|
|
15467
15467
|
const ROOT$2 = ".";
|
|
15468
15468
|
const namedPath = (repository, file) => (name) => {
|
|
15469
15469
|
const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
|
|
@@ -15472,12 +15472,12 @@ const namedPath = (repository, file) => (name) => {
|
|
|
15472
15472
|
return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
|
|
15473
15473
|
};
|
|
15474
15474
|
const kindOf = (repository) => (path) => {
|
|
15475
|
-
if (HashSet.has(repository.directories, path)) return SEPARATOR$
|
|
15475
|
+
if (HashSet.has(repository.directories, path)) return SEPARATOR$14;
|
|
15476
15476
|
return pipe(path, String$1.match(EXTENSION$2), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
|
|
15477
15477
|
};
|
|
15478
15478
|
const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array$1.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
|
|
15479
15479
|
const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
|
|
15480
|
-
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$
|
|
15480
|
+
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$14}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
|
|
15481
15481
|
const directoryLabel = (directory) => {
|
|
15482
15482
|
if (directory === ROOT$2) return "the repository root";
|
|
15483
15483
|
return directory;
|
|
@@ -15500,8 +15500,8 @@ const listedPathProblem = (repository) => (list) => {
|
|
|
15500
15500
|
const SUBSET_SHARE = 2;
|
|
15501
15501
|
const canImport = (importer, imported) => importer.name === imported.name || importer.dependencies.includes(imported.name);
|
|
15502
15502
|
const importIndexOf = (files) => pipe(files, Array$1.map((entry) => [entry.file, entry.imports]), Record.fromEntries);
|
|
15503
|
-
const imports
|
|
15504
|
-
const connected = (index) => (left, right) => left === right || imports
|
|
15503
|
+
const imports = (index) => (importer, imported) => Record.get(index, importer).pipe(Option.exists(Array$1.contains(imported)));
|
|
15504
|
+
const connected = (index) => (left, right) => left === right || imports(index)(left, right) || imports(index)(right, left);
|
|
15505
15505
|
const isPartOf = (index, list) => (other) => other !== list && canImport(list.site.scope, other.site.scope) && connected(index)(list.site.file, other.site.file) && isSubsetOf(list.names, other.names) && list.names.length * SUBSET_SHARE >= other.names.length && !sameValues(list.names, other.names);
|
|
15506
15506
|
const subsetListProblem = ({ lists, literals, relative }) => {
|
|
15507
15507
|
const index = importIndexOf(literals);
|
|
@@ -15529,11 +15529,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
|
15529
15529
|
return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
|
|
15530
15530
|
};
|
|
15531
15531
|
// src/features/check-value-owners/model/repository-names.ts
|
|
15532
|
-
const SEPARATOR$
|
|
15532
|
+
const SEPARATOR$13 = "/";
|
|
15533
15533
|
const FIRST_SEGMENT = 1;
|
|
15534
15534
|
const prefixesOf = (file) => {
|
|
15535
|
-
const segments = pipe(file, String$1.split(SEPARATOR$
|
|
15536
|
-
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$
|
|
15535
|
+
const segments = pipe(file, String$1.split(SEPARATOR$13));
|
|
15536
|
+
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$13))));
|
|
15537
15537
|
};
|
|
15538
15538
|
const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
|
|
15539
15539
|
const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
|
|
@@ -15648,9 +15648,9 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15648
15648
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
15649
15649
|
}, Effect.scoped);
|
|
15650
15650
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15651
|
-
const RULE$
|
|
15651
|
+
const RULE$40 = "namespace-destructuring";
|
|
15652
15652
|
const LOCAL = /^[.#/]/u;
|
|
15653
|
-
const messageOf$
|
|
15653
|
+
const messageOf$3 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
15654
15654
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
15655
15655
|
const importedNames = (sourceFile) => {
|
|
15656
15656
|
const bindings = pipe(sourceFile.statements, Array$1.filter(isImportDeclaration), Array$1.filter((declaration) => isPackage(declaration.moduleSpecifier)), Array$1.map((declaration) => Option.fromUndefinedOr(declaration.importClause)), Array$1.getSomes, Array$1.filter((clause) => clause.phaseModifier !== SyntaxKind.TypeKeyword), Array$1.map((clause) => Option.fromUndefinedOr(clause.namedBindings)), Array$1.getSomes);
|
|
@@ -15664,20 +15664,20 @@ const destructuredName = (declaration) => {
|
|
|
15664
15664
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15665
15665
|
};
|
|
15666
15666
|
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
|
|
15667
|
-
rule: RULE$
|
|
15668
|
-
message: messageOf$
|
|
15667
|
+
rule: RULE$40,
|
|
15668
|
+
message: messageOf$3(name)
|
|
15669
15669
|
})), Option.map((report) => report(declaration)));
|
|
15670
15670
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
15671
15671
|
const names = importedNames(sourceFile);
|
|
15672
15672
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15673
15673
|
};
|
|
15674
15674
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15675
|
-
const RULE$
|
|
15675
|
+
const RULE$39 = "pass-through-wrapper";
|
|
15676
15676
|
const SINGLE_STATEMENT = 1;
|
|
15677
15677
|
const SINGLE_DECLARATION = 1;
|
|
15678
15678
|
const THIS_PARAMETER = "this";
|
|
15679
15679
|
const NO_ARGUMENTS = [];
|
|
15680
|
-
const messageOf$
|
|
15680
|
+
const messageOf$2 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15681
15681
|
const unwrapped = (expression) => {
|
|
15682
15682
|
if (isParenthesizedExpression(expression)) return unwrapped(expression.expression);
|
|
15683
15683
|
return expression;
|
|
@@ -15769,8 +15769,8 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
15769
15769
|
const problemOf$7 = (checker) => (candidate) => {
|
|
15770
15770
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
15771
15771
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
|
|
15772
|
-
rule: RULE$
|
|
15773
|
-
message: messageOf$
|
|
15772
|
+
rule: RULE$39,
|
|
15773
|
+
message: messageOf$2(forward.callee.getText())
|
|
15774
15774
|
})(candidate.name)));
|
|
15775
15775
|
};
|
|
15776
15776
|
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$7(checker)), Array$1.getSomes);
|
|
@@ -15792,7 +15792,7 @@ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigi
|
|
|
15792
15792
|
/** @internal */
|
|
15793
15793
|
const slugOf = ({ owner, name }) => `${owner}/${name}`;
|
|
15794
15794
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
15795
|
-
const RULE$
|
|
15795
|
+
const RULE$38 = "known-plugins";
|
|
15796
15796
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
15797
15797
|
const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
|
|
15798
15798
|
const GITHUB$5 = "github";
|
|
@@ -15813,7 +15813,7 @@ const MarketplaceSchema = Schema.Struct({
|
|
|
15813
15813
|
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
15814
15814
|
});
|
|
15815
15815
|
const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
|
|
15816
|
-
const problem$5 = problemInFile(RULE$
|
|
15816
|
+
const problem$5 = problemInFile(RULE$38);
|
|
15817
15817
|
const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$5 && source.repo === repository));
|
|
15818
15818
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
15819
15819
|
const pluginProblems = (marketplace, file, settings) => {
|
|
@@ -15838,13 +15838,13 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
15838
15838
|
}));
|
|
15839
15839
|
});
|
|
15840
15840
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
15841
|
-
const RULE$
|
|
15841
|
+
const RULE$37 = "missing-hook";
|
|
15842
15842
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
15843
15843
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
15844
15844
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15845
15845
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15846
15846
|
const PLUGIN_ROOT = "..";
|
|
15847
|
-
const READ_CONCURRENCY$
|
|
15847
|
+
const READ_CONCURRENCY$19 = 16;
|
|
15848
15848
|
const START$23 = 0;
|
|
15849
15849
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
15850
15850
|
path,
|
|
@@ -15863,7 +15863,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
15863
15863
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
15864
15864
|
file,
|
|
15865
15865
|
...positionOf(source)(index),
|
|
15866
|
-
rule: RULE$
|
|
15866
|
+
rule: RULE$37,
|
|
15867
15867
|
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.`
|
|
15868
15868
|
})));
|
|
15869
15869
|
});
|
|
@@ -15887,7 +15887,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
15887
15887
|
}];
|
|
15888
15888
|
return [];
|
|
15889
15889
|
}));
|
|
15890
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$
|
|
15890
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$19 });
|
|
15891
15891
|
return Array$1.flatten(found);
|
|
15892
15892
|
});
|
|
15893
15893
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
@@ -15916,7 +15916,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
15916
15916
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
15917
15917
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
15918
15918
|
// src/features/check-documented-commands/model/commands.ts
|
|
15919
|
-
const RULE$
|
|
15919
|
+
const RULE$36 = "documented-commands";
|
|
15920
15920
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
15921
15921
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
15922
15922
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -15925,7 +15925,7 @@ const ARGS = "args";
|
|
|
15925
15925
|
const PLACEHOLDER = /[<>*{}$]/u;
|
|
15926
15926
|
const WHITESPACE$1 = /\s+/u;
|
|
15927
15927
|
const ROOT$1 = ".";
|
|
15928
|
-
const SEPARATOR$
|
|
15928
|
+
const SEPARATOR$12 = "/";
|
|
15929
15929
|
const END_OF_OPTIONS = "--";
|
|
15930
15930
|
const FLAG = "-";
|
|
15931
15931
|
const TASK_SEPARATOR$1 = "#";
|
|
@@ -15972,8 +15972,8 @@ const parsed = (args) => {
|
|
|
15972
15972
|
return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
|
|
15973
15973
|
};
|
|
15974
15974
|
const ancestorsOf$1 = (file) => {
|
|
15975
|
-
const parts = pipe(String$1.split(file, SEPARATOR$
|
|
15976
|
-
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$
|
|
15975
|
+
const parts = pipe(String$1.split(file, SEPARATOR$12), Array$1.dropRight(ONE$2));
|
|
15976
|
+
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$12))), ROOT$1];
|
|
15977
15977
|
};
|
|
15978
15978
|
const named = (graph, name) => (directory) => directory === String$1.replace(LOCAL_PREFIX$1, "")(name) || pipe(Record.get(graph.packages, directory), Option.exists((found) => found.name === name));
|
|
15979
15979
|
const packagesOf = (graph, file) => (scope) => {
|
|
@@ -15994,10 +15994,10 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
|
|
|
15994
15994
|
const problemsIn$12 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
|
|
15995
15995
|
file: absolute(file),
|
|
15996
15996
|
...positionOf(text)(match.index ?? START$22),
|
|
15997
|
-
rule: RULE$
|
|
15997
|
+
rule: RULE$36,
|
|
15998
15998
|
message: `${match[START$22]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
15999
15999
|
})), Option.toArray)));
|
|
16000
|
-
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$
|
|
16000
|
+
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
16001
16001
|
/** @internal */
|
|
16002
16002
|
const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
|
|
16003
16003
|
const files = yield* RepositoryFiles;
|
|
@@ -16019,14 +16019,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16019
16019
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
16020
16020
|
line: ONE$2,
|
|
16021
16021
|
column: ONE$2,
|
|
16022
|
-
rule: RULE$
|
|
16022
|
+
rule: RULE$36,
|
|
16023
16023
|
message: "msch could not list the tasks with `vp run --json`"
|
|
16024
16024
|
}],
|
|
16025
16025
|
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
|
|
16026
16026
|
});
|
|
16027
16027
|
});
|
|
16028
16028
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
16029
|
-
const RULE$
|
|
16029
|
+
const RULE$35 = "legacy-web";
|
|
16030
16030
|
const FIRST_COLUMN$7 = 1;
|
|
16031
16031
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
16032
16032
|
const Finding = Schema.Struct({
|
|
@@ -16065,7 +16065,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16065
16065
|
file: files.join(root, file),
|
|
16066
16066
|
line,
|
|
16067
16067
|
column: FIRST_COLUMN$7,
|
|
16068
|
-
rule: RULE$
|
|
16068
|
+
rule: RULE$35,
|
|
16069
16069
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
16070
16070
|
});
|
|
16071
16071
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
@@ -16135,8 +16135,8 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
16135
16135
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
16136
16136
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
16137
16137
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16138
|
-
const READ_CONCURRENCY$
|
|
16139
|
-
const RULE$
|
|
16138
|
+
const READ_CONCURRENCY$18 = 64;
|
|
16139
|
+
const RULE$34 = "shell-script";
|
|
16140
16140
|
const MESSAGE$8 = "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.";
|
|
16141
16141
|
const HookSchema = Schema.Struct({
|
|
16142
16142
|
command: Schema.optional(Schema.String),
|
|
@@ -16168,8 +16168,8 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16168
16168
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16169
16169
|
};
|
|
16170
16170
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16171
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16172
|
-
return pipe(shell, Array$1.map((name) => problemInFile(RULE$
|
|
16171
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$18 });
|
|
16172
|
+
return pipe(shell, Array$1.map((name) => problemInFile(RULE$34)(files.join(root, name), MESSAGE$8)));
|
|
16173
16173
|
});
|
|
16174
16174
|
// src/features/check-structure/model/structure.ts
|
|
16175
16175
|
const checkStructure = checkSection({
|
|
@@ -16183,12 +16183,12 @@ const checkStructure = checkSection({
|
|
|
16183
16183
|
// src/features/check-vite-plus/model/command-words.ts
|
|
16184
16184
|
const CONTINUATION = /\\\n/gu;
|
|
16185
16185
|
const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
16186
|
-
const SEPARATOR$
|
|
16186
|
+
const SEPARATOR$11 = /&&|\|\||[;|\n`]|\$\(/u;
|
|
16187
16187
|
const BLANK$1 = /\s+/u;
|
|
16188
16188
|
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
16189
16189
|
const QUOTE = "\"\"";
|
|
16190
16190
|
const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
|
|
16191
|
-
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$
|
|
16191
|
+
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$11), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
|
|
16192
16192
|
// src/features/check-vite-plus/model/command-problems.ts
|
|
16193
16193
|
const PACKAGE_MANAGERS = [
|
|
16194
16194
|
"pnpm",
|
|
@@ -16302,7 +16302,7 @@ const AGENT_DOCS = [
|
|
|
16302
16302
|
":(glob)**/CLAUDE.md",
|
|
16303
16303
|
...EXCLUDED$5
|
|
16304
16304
|
];
|
|
16305
|
-
const READ_CONCURRENCY$
|
|
16305
|
+
const READ_CONCURRENCY$17 = 16;
|
|
16306
16306
|
const START$20 = 0;
|
|
16307
16307
|
const FIRST$9 = 1;
|
|
16308
16308
|
const LINE = "\n";
|
|
@@ -16371,7 +16371,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16371
16371
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16372
16372
|
});
|
|
16373
16373
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16374
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
16374
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$17 });
|
|
16375
16375
|
return Array$1.flatten(found);
|
|
16376
16376
|
});
|
|
16377
16377
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16383,7 +16383,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16383
16383
|
onSome: sourcesOf(file, name)
|
|
16384
16384
|
});
|
|
16385
16385
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16386
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16386
|
+
}, { concurrency: READ_CONCURRENCY$17 });
|
|
16387
16387
|
return Array$1.flatten(found);
|
|
16388
16388
|
});
|
|
16389
16389
|
/** @internal */
|
|
@@ -16407,7 +16407,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
16407
16407
|
return Array$1.flatten(found);
|
|
16408
16408
|
});
|
|
16409
16409
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
16410
|
-
const RULE$
|
|
16410
|
+
const RULE$33 = "package-script";
|
|
16411
16411
|
const LIFECYCLE = [
|
|
16412
16412
|
"preinstall",
|
|
16413
16413
|
"install",
|
|
@@ -16430,25 +16430,25 @@ const LIFECYCLE = [
|
|
|
16430
16430
|
const problemOf$6 = ({ file, position, name }) => ({
|
|
16431
16431
|
file,
|
|
16432
16432
|
...position,
|
|
16433
|
-
rule: RULE$
|
|
16433
|
+
rule: RULE$33,
|
|
16434
16434
|
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.`
|
|
16435
16435
|
});
|
|
16436
16436
|
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
|
|
16437
16437
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
16438
|
-
const RULE$
|
|
16439
|
-
const MARKER = Array$1.join([
|
|
16438
|
+
const RULE$32 = "vite-plus-block";
|
|
16439
|
+
const MARKER$1 = Array$1.join([
|
|
16440
16440
|
"<!--",
|
|
16441
16441
|
"VITE PLUS START",
|
|
16442
16442
|
"-->"
|
|
16443
16443
|
], "");
|
|
16444
16444
|
const MESSAGE$7 = "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.";
|
|
16445
16445
|
const problemIn = (file) => (source) => {
|
|
16446
|
-
const index = String$1.indexOf(MARKER)(source);
|
|
16446
|
+
const index = String$1.indexOf(MARKER$1)(source);
|
|
16447
16447
|
if (Option.isNone(index)) return Option.none();
|
|
16448
16448
|
return Option.some({
|
|
16449
16449
|
file,
|
|
16450
16450
|
...positionOf(source)(index.value),
|
|
16451
|
-
rule: RULE$
|
|
16451
|
+
rule: RULE$32,
|
|
16452
16452
|
message: MESSAGE$7
|
|
16453
16453
|
});
|
|
16454
16454
|
};
|
|
@@ -16481,7 +16481,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
16481
16481
|
return pipe(drifts, Array$1.map(problemOf$5));
|
|
16482
16482
|
});
|
|
16483
16483
|
// src/features/check-workflows/model/release-please.ts
|
|
16484
|
-
const RULE$
|
|
16484
|
+
const RULE$31 = "release-please";
|
|
16485
16485
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
16486
16486
|
const FIRST$8 = 1;
|
|
16487
16487
|
const MESSAGE$6 = "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.";
|
|
@@ -16493,7 +16493,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
16493
16493
|
file: files.join(root, name),
|
|
16494
16494
|
line: FIRST$8,
|
|
16495
16495
|
column: FIRST$8,
|
|
16496
|
-
rule: RULE$
|
|
16496
|
+
rule: RULE$31,
|
|
16497
16497
|
message: MESSAGE$6
|
|
16498
16498
|
})));
|
|
16499
16499
|
});
|
|
@@ -16653,7 +16653,7 @@ const COMMENT_NODES = [
|
|
|
16653
16653
|
];
|
|
16654
16654
|
const START$19 = 0;
|
|
16655
16655
|
const NEXT = 1;
|
|
16656
|
-
const NONE$
|
|
16656
|
+
const NONE$4 = [];
|
|
16657
16657
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
16658
16658
|
onFailure: ({ message }) => unreadable(grammar)(message),
|
|
16659
16659
|
onSuccess: (language) => [grammar, language]
|
|
@@ -16671,7 +16671,7 @@ const commentNodesIn = (language, source) => pipe(readTree({
|
|
|
16671
16671
|
index: node.startIndex,
|
|
16672
16672
|
text: node.text
|
|
16673
16673
|
})))
|
|
16674
|
-
}), Option.getOrElse(() => NONE$
|
|
16674
|
+
}), Option.getOrElse(() => NONE$4));
|
|
16675
16675
|
const syntaxComments = (grammars, grammar) => (source) => Option.match(grammars(grammar), {
|
|
16676
16676
|
onNone: () => Effect.fail(unreadable(grammar)("the grammar is not loaded")),
|
|
16677
16677
|
onSome: (language) => commentsFrom(grammar)((text) => commentNodesIn(language, text))(source)
|
|
@@ -16694,7 +16694,7 @@ const shifted = (offset) => ({ index, text }) => ({
|
|
|
16694
16694
|
text
|
|
16695
16695
|
});
|
|
16696
16696
|
const markupComment = (source) => (node) => {
|
|
16697
|
-
if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$
|
|
16697
|
+
if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$4;
|
|
16698
16698
|
return [{
|
|
16699
16699
|
index: node.startIndex,
|
|
16700
16700
|
text: String$1.slice(node.startIndex, node.endIndex + NEXT)(source)
|
|
@@ -16705,10 +16705,10 @@ const textComments = (grammars, grammar) => (text) => {
|
|
|
16705
16705
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
16706
16706
|
};
|
|
16707
16707
|
const embeddedComments = (grammars) => (node) => {
|
|
16708
|
-
if (!isTag(node)) return Effect.succeed(NONE$
|
|
16708
|
+
if (!isTag(node)) return Effect.succeed(NONE$4);
|
|
16709
16709
|
const texts = pipe(node.children, Array$1.filter(isText));
|
|
16710
16710
|
return Option.match(embeddedGrammar(node), {
|
|
16711
|
-
onNone: () => Effect.succeed(NONE$
|
|
16711
|
+
onNone: () => Effect.succeed(NONE$4),
|
|
16712
16712
|
onSome: (grammar) => pipe(texts, (items) => Effect.forEach(items, textComments(grammars, grammar), { concurrency: 1 }), Effect.map(Array$1.flatten))
|
|
16713
16713
|
});
|
|
16714
16714
|
};
|
|
@@ -16781,11 +16781,11 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
|
|
|
16781
16781
|
})), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
16782
16782
|
});
|
|
16783
16783
|
// src/features/ban-comments/model/comments.ts
|
|
16784
|
-
const RULE$
|
|
16784
|
+
const RULE$30 = "comment";
|
|
16785
16785
|
const SUPPRESSION_RULE = "suppression";
|
|
16786
16786
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
16787
16787
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
16788
|
-
const READ_CONCURRENCY$
|
|
16788
|
+
const READ_CONCURRENCY$16 = 64;
|
|
16789
16789
|
const START$18 = 0;
|
|
16790
16790
|
const SHEBANG = "#!";
|
|
16791
16791
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
@@ -16813,7 +16813,7 @@ const NOTHING = {
|
|
|
16813
16813
|
used: []
|
|
16814
16814
|
};
|
|
16815
16815
|
const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but no comment in the repository matches it. Delete the entry and add it back when a comment needs it.`;
|
|
16816
|
-
const problemOf$4 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$
|
|
16816
|
+
const problemOf$4 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$30)(file, source)(comment.index, MESSAGE$5)));
|
|
16817
16817
|
const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
16818
16818
|
onNone: () => NO_SETTINGS.allow,
|
|
16819
16819
|
onSome: ({ allow }) => allow
|
|
@@ -16850,7 +16850,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16850
16850
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16851
16851
|
used: usedAllowances(allowances, found)
|
|
16852
16852
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16853
|
-
problems: [problemAtIndex(RULE$
|
|
16853
|
+
problems: [problemAtIndex(RULE$30)(file, source)(START$18, `msch could not read the comments in this file: ${message}`)],
|
|
16854
16854
|
used: []
|
|
16855
16855
|
})))
|
|
16856
16856
|
});
|
|
@@ -16869,7 +16869,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
16869
16869
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
16870
16870
|
onNone: () => Effect.succeed(NOTHING),
|
|
16871
16871
|
onSome: (source) => scan(entry, source)
|
|
16872
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
16872
|
+
}))), { concurrency: READ_CONCURRENCY$16 });
|
|
16873
16873
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
16874
16874
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
16875
16875
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -16963,7 +16963,7 @@ const PYTHON = {
|
|
|
16963
16963
|
/** @internal */
|
|
16964
16964
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
16965
16965
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
16966
|
-
const RULE$
|
|
16966
|
+
const RULE$29 = "uncataloged-dependency";
|
|
16967
16967
|
const OWNED_ELSEWHERE = [
|
|
16968
16968
|
"catalog:",
|
|
16969
16969
|
"workspace:",
|
|
@@ -16977,7 +16977,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
|
|
|
16977
16977
|
const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
16978
16978
|
file: entry.file,
|
|
16979
16979
|
...positionOf(source)(offsetIn(source)(manifestPattern(found))),
|
|
16980
|
-
rule: RULE$
|
|
16980
|
+
rule: RULE$29,
|
|
16981
16981
|
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$4}`
|
|
16982
16982
|
})));
|
|
16983
16983
|
/** @internal */
|
|
@@ -16998,7 +16998,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
16998
16998
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
16999
16999
|
const FIRST_LINE$5 = 1;
|
|
17000
17000
|
const FIRST_COLUMN$5 = 1;
|
|
17001
|
-
const RULE$
|
|
17001
|
+
const RULE$28 = "prune-setting-off";
|
|
17002
17002
|
const PRUNE_SETTINGS = [["catalogPrune", "removes catalog entries no package refers to, so the catalog holds only versions in use."], ["minimumReleaseAgeExcludePrune", "removes `minimumReleaseAgeExclude` entries the lockfile no longer resolves, which only exempted that one version while it was new."]];
|
|
17003
17003
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
17004
17004
|
const lineOf$3 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
|
|
@@ -17012,7 +17012,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
17012
17012
|
file,
|
|
17013
17013
|
line: at(setting),
|
|
17014
17014
|
column: FIRST_COLUMN$5,
|
|
17015
|
-
rule: RULE$
|
|
17015
|
+
rule: RULE$28,
|
|
17016
17016
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
17017
17017
|
})));
|
|
17018
17018
|
});
|
|
@@ -17106,13 +17106,13 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
17106
17106
|
];
|
|
17107
17107
|
});
|
|
17108
17108
|
// src/features/check-skills/model/published-skills.ts
|
|
17109
|
-
const RULE$
|
|
17109
|
+
const RULE$27 = "published-skills";
|
|
17110
17110
|
const KEYWORD = "tanstack-intent";
|
|
17111
17111
|
const SKILLS = "skills";
|
|
17112
17112
|
const SKILL_FILE$3 = "SKILL.md";
|
|
17113
17113
|
const SUCCEEDED = 0;
|
|
17114
17114
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
17115
|
-
const problemAt$2 = problemInFile(RULE$
|
|
17115
|
+
const problemAt$2 = problemInFile(RULE$27);
|
|
17116
17116
|
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$3), Array$1.map((file) => files.relative(directory, files.dirname(file))));
|
|
17117
17117
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
17118
17118
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -17149,7 +17149,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
17149
17149
|
return Array$1.flatten(problems);
|
|
17150
17150
|
});
|
|
17151
17151
|
// src/features/check-skills/model/skill-files.ts
|
|
17152
|
-
const RULE$
|
|
17152
|
+
const RULE$26 = "skill-file";
|
|
17153
17153
|
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
17154
17154
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
17155
17155
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
@@ -17165,10 +17165,10 @@ const FRAGMENT = /#.*$/u;
|
|
|
17165
17165
|
const GITHUB$3 = "https://github.com/";
|
|
17166
17166
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
17167
17167
|
const BLANK = /\s+/u;
|
|
17168
|
-
const SEPARATOR$
|
|
17168
|
+
const SEPARATOR$10 = "/";
|
|
17169
17169
|
const START$16 = 0;
|
|
17170
17170
|
const FIRST$7 = 1;
|
|
17171
|
-
const READ_CONCURRENCY$
|
|
17171
|
+
const READ_CONCURRENCY$15 = 16;
|
|
17172
17172
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
17173
17173
|
const Frontmatter = Schema.Struct({
|
|
17174
17174
|
name: Schema.optional(Schema.String),
|
|
@@ -17206,7 +17206,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
17206
17206
|
]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
17207
17207
|
file: skill.file,
|
|
17208
17208
|
...positionOf(skill.source)(index),
|
|
17209
|
-
rule: RULE$
|
|
17209
|
+
rule: RULE$26,
|
|
17210
17210
|
message
|
|
17211
17211
|
})));
|
|
17212
17212
|
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) => ({
|
|
@@ -17233,7 +17233,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
17233
17233
|
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
17234
17234
|
file,
|
|
17235
17235
|
...positionOf(source)(index),
|
|
17236
|
-
rule: RULE$
|
|
17236
|
+
rule: RULE$26,
|
|
17237
17237
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
17238
17238
|
})));
|
|
17239
17239
|
});
|
|
@@ -17241,15 +17241,15 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17241
17241
|
const files = yield* RepositoryFiles;
|
|
17242
17242
|
const file = files.join(root, name);
|
|
17243
17243
|
const directory = files.dirname(name);
|
|
17244
|
-
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$
|
|
17244
|
+
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$10}`)));
|
|
17245
17245
|
const text = yield* files.readFile(file);
|
|
17246
17246
|
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
17247
|
-
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$
|
|
17247
|
+
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$15 });
|
|
17248
17248
|
const licenses = pipe(inside, Array$1.filter((entry) => files.dirname(entry) === directory), Array$1.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array$1.map((entry) => ({
|
|
17249
17249
|
file: files.join(root, entry),
|
|
17250
17250
|
line: FIRST$7,
|
|
17251
17251
|
column: FIRST$7,
|
|
17252
|
-
rule: RULE$
|
|
17252
|
+
rule: RULE$26,
|
|
17253
17253
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
17254
17254
|
})));
|
|
17255
17255
|
return [
|
|
@@ -17266,7 +17266,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17266
17266
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
17267
17267
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
17268
17268
|
const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)));
|
|
17269
|
-
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$
|
|
17269
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$15 });
|
|
17270
17270
|
return Array$1.flatten(found);
|
|
17271
17271
|
});
|
|
17272
17272
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -17327,8 +17327,8 @@ const cargoEntries = (text) => {
|
|
|
17327
17327
|
};
|
|
17328
17328
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
17329
17329
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
17330
|
-
const RULE$
|
|
17331
|
-
const READ_CONCURRENCY$
|
|
17330
|
+
const RULE$25 = "version-downgrade";
|
|
17331
|
+
const READ_CONCURRENCY$14 = 16;
|
|
17332
17332
|
const READERS = [
|
|
17333
17333
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
17334
17334
|
[/^pnpm-workspace\.yaml$/u, workspaceEntries],
|
|
@@ -17352,7 +17352,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
17352
17352
|
file,
|
|
17353
17353
|
line: lineOf$2(text, entry),
|
|
17354
17354
|
column: FIRST_LINE$4,
|
|
17355
|
-
rule: RULE$
|
|
17355
|
+
rule: RULE$25,
|
|
17356
17356
|
message: message$1(old, entry)
|
|
17357
17357
|
})), Option.toArray)));
|
|
17358
17358
|
};
|
|
@@ -17372,7 +17372,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
|
|
|
17372
17372
|
before: read(before),
|
|
17373
17373
|
after: read(after)
|
|
17374
17374
|
})), Option.getOrElse(() => []));
|
|
17375
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17375
|
+
}), { concurrency: READ_CONCURRENCY$14 });
|
|
17376
17376
|
return Array$1.flatten(found);
|
|
17377
17377
|
});
|
|
17378
17378
|
// src/features/check-version-downgrades/model/renovate-settings.ts
|
|
@@ -17383,7 +17383,7 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
17383
17383
|
const CAP_RULE = "renovate-version-cap";
|
|
17384
17384
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17385
17385
|
const START$15 = 0;
|
|
17386
|
-
const READ_CONCURRENCY$
|
|
17386
|
+
const READ_CONCURRENCY$13 = 16;
|
|
17387
17387
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17388
17388
|
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.";
|
|
17389
17389
|
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
@@ -17417,12 +17417,12 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
17417
17417
|
onNone: () => [],
|
|
17418
17418
|
onSome: (source) => problemsIn$8(file, source)
|
|
17419
17419
|
})));
|
|
17420
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
17420
|
+
}, { concurrency: READ_CONCURRENCY$13 });
|
|
17421
17421
|
return Array$1.flatten(found);
|
|
17422
17422
|
});
|
|
17423
17423
|
// src/shared/lib/manifest-texts.ts
|
|
17424
17424
|
const MANIFEST$2 = /(?:^|\/)package\.json$/u;
|
|
17425
|
-
const READ_CONCURRENCY$
|
|
17425
|
+
const READ_CONCURRENCY$12 = 16;
|
|
17426
17426
|
/** @internal */
|
|
17427
17427
|
const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
17428
17428
|
const files = yield* RepositoryFiles;
|
|
@@ -17431,16 +17431,16 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
17431
17431
|
const read = yield* Effect.forEach(names, (file) => Effect.map(files.readFile(files.join(root, file)), Option.map((text) => ({
|
|
17432
17432
|
file,
|
|
17433
17433
|
text
|
|
17434
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17434
|
+
}))), { concurrency: READ_CONCURRENCY$12 });
|
|
17435
17435
|
return Array$1.getSomes(read);
|
|
17436
17436
|
});
|
|
17437
17437
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
17438
|
-
const RULE$
|
|
17438
|
+
const RULE$24 = "unbumped-package";
|
|
17439
17439
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
17440
17440
|
const UNVERSIONED$5 = "0.0.0";
|
|
17441
17441
|
const FIRST_LINE$3 = 1;
|
|
17442
17442
|
const FIRST_COLUMN$4 = 1;
|
|
17443
|
-
const READ_CONCURRENCY$
|
|
17443
|
+
const READ_CONCURRENCY$11 = 16;
|
|
17444
17444
|
const LAST_SEGMENT$1 = /[^/]*$/u;
|
|
17445
17445
|
const directoryOf$1 = (file) => String$1.replace(LAST_SEGMENT$1, "")(file);
|
|
17446
17446
|
const packageAt$1 = (file, text) => pipe(decodeVersionedPackageJson(text), Option.filter(({ private: hidden, version }) => hidden !== true && version !== UNVERSIONED$5), Option.map((manifest) => ({
|
|
@@ -17510,19 +17510,19 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17510
17510
|
file: files.join(root, pack.file),
|
|
17511
17511
|
line: versionLine(pack.text),
|
|
17512
17512
|
column: FIRST_COLUMN$4,
|
|
17513
|
-
rule: RULE$
|
|
17513
|
+
rule: RULE$24,
|
|
17514
17514
|
message: message(pack, part, lowest)
|
|
17515
17515
|
})), Option.toArray);
|
|
17516
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17516
|
+
}), { concurrency: READ_CONCURRENCY$11 });
|
|
17517
17517
|
return Array$1.flatten(found);
|
|
17518
17518
|
});
|
|
17519
17519
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
17520
17520
|
const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
17521
17521
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17522
|
-
const RULE$
|
|
17522
|
+
const RULE$23 = "applied-package";
|
|
17523
17523
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17524
17524
|
const NOT_FOUND$3 = -1;
|
|
17525
|
-
const SEPARATOR$
|
|
17525
|
+
const SEPARATOR$9 = "/";
|
|
17526
17526
|
/** @internal */
|
|
17527
17527
|
const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
|
|
17528
17528
|
const BY_LENGTH = Order.mapInput(Order.Number, (text) => text.length);
|
|
@@ -17555,13 +17555,13 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
17555
17555
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
17556
17556
|
file,
|
|
17557
17557
|
...positionOf(source)(index),
|
|
17558
|
-
rule: RULE$
|
|
17558
|
+
rule: RULE$23,
|
|
17559
17559
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
17560
17560
|
});
|
|
17561
17561
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
17562
17562
|
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped$1(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
17563
17563
|
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND$3, entry.name)))));
|
|
17564
|
-
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$
|
|
17564
|
+
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$9}`)(name)), Array$1.match({
|
|
17565
17565
|
onEmpty: () => "",
|
|
17566
17566
|
onNonEmpty: Array$1.max(BY_LENGTH)
|
|
17567
17567
|
}));
|
|
@@ -17610,7 +17610,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
17610
17610
|
return yield* appliedPackageProblems(root, applied);
|
|
17611
17611
|
});
|
|
17612
17612
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
17613
|
-
const RULE$
|
|
17613
|
+
const RULE$22 = "replaced-tool";
|
|
17614
17614
|
const FIRST$6 = 1;
|
|
17615
17615
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
17616
17616
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -17691,7 +17691,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
|
|
|
17691
17691
|
file,
|
|
17692
17692
|
line: FIRST$6,
|
|
17693
17693
|
column: FIRST$6,
|
|
17694
|
-
rule: RULE$
|
|
17694
|
+
rule: RULE$22,
|
|
17695
17695
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
17696
17696
|
})));
|
|
17697
17697
|
/** @internal */
|
|
@@ -17709,7 +17709,7 @@ const unneededLockfile = (present) => (entry) => FOREIGN_LOCKFILE.test(entry.nam
|
|
|
17709
17709
|
// src/features/find-unneeded-files/model/unneeded-files.ts
|
|
17710
17710
|
const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
|
|
17711
17711
|
const PNPM_DIRECTORY = ".pnpm/";
|
|
17712
|
-
const SEPARATOR$
|
|
17712
|
+
const SEPARATOR$8 = "/";
|
|
17713
17713
|
const CARGO_MANIFEST_FILE = /(?:^|\/)Cargo\.toml$/u;
|
|
17714
17714
|
const CARGO_LOCK_FILE = /(?:^|\/)Cargo\.lock$/u;
|
|
17715
17715
|
const PNPM_OUTPUT = /(?:^|\/)\.pnpm\//u;
|
|
@@ -17777,10 +17777,10 @@ const matches = (pattern) => ({ name }) => pattern.test(name);
|
|
|
17777
17777
|
const isCargoManifest = matches(CARGO_MANIFEST_FILE);
|
|
17778
17778
|
const isLegacyCargoConfig = matches(LEGACY_CARGO_CONFIG);
|
|
17779
17779
|
const isPnpmOutput = matches(PNPM_OUTPUT);
|
|
17780
|
-
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$
|
|
17780
|
+
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$8), Array$1.dropRight(LAST_SEGMENT), Array$1.join(SEPARATOR$8));
|
|
17781
17781
|
const ancestorsOf = (directory) => {
|
|
17782
|
-
const parts = String$1.split(directory, SEPARATOR$
|
|
17783
|
-
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
17782
|
+
const parts = String$1.split(directory, SEPARATOR$8);
|
|
17783
|
+
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$8)), Array$1.filter((ancestor) => ancestor !== directory));
|
|
17784
17784
|
};
|
|
17785
17785
|
const readsCargoLock = (manifests, workspaces) => ({ name }) => {
|
|
17786
17786
|
const directory = directoryOf(name);
|
|
@@ -17830,7 +17830,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
17830
17830
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
17831
17831
|
});
|
|
17832
17832
|
// src/features/check-markdown-directives/model/directives.ts
|
|
17833
|
-
const RULE$
|
|
17833
|
+
const RULE$21 = "markdown-directive";
|
|
17834
17834
|
const START$13 = 0;
|
|
17835
17835
|
const SECOND = 1;
|
|
17836
17836
|
const ODD = 1;
|
|
@@ -17855,7 +17855,7 @@ const problemsIn$7 = (file, source) => {
|
|
|
17855
17855
|
const { line, column } = positionOf(source)(index);
|
|
17856
17856
|
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$13, column - SECOND)), Option.exists(insideCodeSpan));
|
|
17857
17857
|
};
|
|
17858
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$13)), Array$1.map((match) => problemAtIndex(RULE$
|
|
17858
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$13)), Array$1.map((match) => problemAtIndex(RULE$21)(file, source)(match.index ?? START$13, MESSAGE$3)));
|
|
17859
17859
|
};
|
|
17860
17860
|
const isChecked$1 = (name) => String$1.endsWith(MARKDOWN$4)(name) && !pipe(SKIPPED_DIRECTORIES, Array$1.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array$1.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
|
|
17861
17861
|
/** @internal */
|
|
@@ -17867,11 +17867,55 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
|
|
|
17867
17867
|
file: files.join(root, name)
|
|
17868
17868
|
}))), ({ file }, source) => problemsIn$7(file, source));
|
|
17869
17869
|
});
|
|
17870
|
+
// src/features/check-owner-markers/model/owner-markers.ts
|
|
17871
|
+
const RULE$20 = "owner-decision-removed";
|
|
17872
|
+
const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
|
|
17873
|
+
const TRAILER = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
17874
|
+
const READ_CONCURRENCY$10 = 16;
|
|
17875
|
+
const HEAD = "HEAD";
|
|
17876
|
+
const NONE$3 = 0;
|
|
17877
|
+
const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
|
|
17878
|
+
const countOf = (markers) => (marker) => pipe(markers, Array$1.filter((candidate) => candidate === marker)).length;
|
|
17879
|
+
const lostMarkers = (before, after) => pipe(Array$1.dedupe(before), Array$1.flatMap((marker) => Array$1.replicate(marker, Math.max(NONE$3, countOf(before)(marker) - countOf(after)(marker)))));
|
|
17880
|
+
const removalOf = (file, lost) => pipe(Option.liftPredicate(lost, Array$1.isReadonlyArrayNonEmpty), Option.map((markers) => ({
|
|
17881
|
+
file,
|
|
17882
|
+
markers
|
|
17883
|
+
})), Option.toArray);
|
|
17884
|
+
const messageOf$1 = ({ markers }) => `removes ${Array$1.join(markers, " ")}. Only the owner changes or removes an owner decision. When it moves to a stronger home, add the trailer "Owner-Decision-Moved: <new place>" to a commit of the branch. When the owner revoked it, add "Owner-Decision-Revoked: <the owner's words>".`;
|
|
17885
|
+
const removalsSince = Effect.fn("removalsSince")(function* removalsSince(root, base) {
|
|
17886
|
+
const files = yield* RepositoryFiles;
|
|
17887
|
+
const changed = yield* files.changedFiles(root, base);
|
|
17888
|
+
const found = yield* Effect.forEach(changed, (name) => Effect.gen(function* compare() {
|
|
17889
|
+
const before = yield* files.readAtRevision(root, base, name);
|
|
17890
|
+
const after = yield* files.readAtRevision(root, HEAD, name);
|
|
17891
|
+
const lost = lostMarkers(Option.match(before, {
|
|
17892
|
+
onNone: () => [],
|
|
17893
|
+
onSome: markersOf
|
|
17894
|
+
}), Option.match(after, {
|
|
17895
|
+
onNone: () => [],
|
|
17896
|
+
onSome: markersOf
|
|
17897
|
+
}));
|
|
17898
|
+
return removalOf(files.join(root, name), lost);
|
|
17899
|
+
}), { concurrency: READ_CONCURRENCY$10 });
|
|
17900
|
+
return Array$1.flatten(found);
|
|
17901
|
+
});
|
|
17902
|
+
const hasTrailer = Effect.fn("hasTrailer")(function* hasTrailer(root, base) {
|
|
17903
|
+
const messages = yield* (yield* RepositoryFiles).commitMessages(root, base);
|
|
17904
|
+
return pipe(messages, Array$1.some((commit) => TRAILER.test(commit)));
|
|
17905
|
+
});
|
|
17906
|
+
/** @internal */
|
|
17907
|
+
const checkOwnerMarkers = Effect.fn("checkOwnerMarkers")(function* checkOwnerMarkers(root) {
|
|
17908
|
+
const base = yield* baseRevision(root);
|
|
17909
|
+
if (Option.isNone(base)) return [];
|
|
17910
|
+
const removals = yield* removalsSince(root, base.value);
|
|
17911
|
+
if (!Array$1.isReadonlyArrayNonEmpty(removals) || (yield* hasTrailer(root, base.value))) return [];
|
|
17912
|
+
return pipe(removals, Array$1.map((removal) => problemInFile(RULE$20)(removal.file, messageOf$1(removal))));
|
|
17913
|
+
});
|
|
17870
17914
|
// src/features/check-owner-names/model/owner-names.ts
|
|
17871
17915
|
const RULE$19 = "owner-name";
|
|
17872
17916
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17873
17917
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17874
|
-
const SEPARATOR$
|
|
17918
|
+
const SEPARATOR$7 = "/";
|
|
17875
17919
|
const START$12 = 0;
|
|
17876
17920
|
const DECLARED = [
|
|
17877
17921
|
"dependencies",
|
|
@@ -17917,7 +17961,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
|
|
|
17917
17961
|
const files = yield* RepositoryFiles;
|
|
17918
17962
|
const manifest = yield* readManifest(directory);
|
|
17919
17963
|
if (Option.isNone(manifest)) return [];
|
|
17920
|
-
const prefix = `${files.relative(root, directory)}${SEPARATOR$
|
|
17964
|
+
const prefix = `${files.relative(root, directory)}${SEPARATOR$7}`;
|
|
17921
17965
|
const names = yield* files.listedFiles(root);
|
|
17922
17966
|
const listed = pipe(names, Array$1.filter((name) => String$1.startsWith(prefix)(name) && TEXT_FILE$1.test(name) && files.basename(name) !== PACKAGE_JSON_FILE && files.basename(name) !== CONFIG_FILE$1), Array$1.map((name) => ({
|
|
17923
17967
|
name,
|
|
@@ -17998,6 +18042,7 @@ const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root
|
|
|
17998
18042
|
const found = yield* Effect.all([
|
|
17999
18043
|
checkHiddenUnicode(root),
|
|
18000
18044
|
checkMarkdownDirectives(root),
|
|
18045
|
+
checkOwnerMarkers(root),
|
|
18001
18046
|
checkOwnerNames(root)
|
|
18002
18047
|
], { concurrency: "unbounded" });
|
|
18003
18048
|
return Array$1.flatten(found);
|
|
@@ -18302,7 +18347,7 @@ const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
|
|
|
18302
18347
|
const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
|
|
18303
18348
|
const SKILL_FILE$1 = "SKILL.md";
|
|
18304
18349
|
const BIN_PREFIX = "bin/";
|
|
18305
|
-
const SEPARATOR$
|
|
18350
|
+
const SEPARATOR$6 = "/";
|
|
18306
18351
|
const MOST_FILES = 5e3;
|
|
18307
18352
|
const LONGEST_PATH = 472;
|
|
18308
18353
|
const MOST_DEPTH = 12;
|
|
@@ -18348,7 +18393,7 @@ const WIDE_PART = `has a path part longer than ${String(LONGEST_PART)} character
|
|
|
18348
18393
|
const BAD_CHARACTERS = "has characters outside letters, digits, space and _ . - / ( ).";
|
|
18349
18394
|
const ARCHIVE_MESSAGE = "is an archive, which claude.ai sync rejects.";
|
|
18350
18395
|
const pathViolation = (file) => {
|
|
18351
|
-
const parts = String$1.split(SEPARATOR$
|
|
18396
|
+
const parts = String$1.split(SEPARATOR$6)(file);
|
|
18352
18397
|
const wide = pipe(parts, Array$1.some((part) => part.length > LONGEST_PART));
|
|
18353
18398
|
return pipe([
|
|
18354
18399
|
[BAD_CHARACTERS, !ALLOWED_PATH.test(file)],
|
|
@@ -18380,9 +18425,9 @@ const skillViolations = (skills) => {
|
|
|
18380
18425
|
Option.liftPredicate(`shares the name ${name} with another SKILL.md of the plugin.`, () => pipe(Record.get(counts, name), Option.exists((group) => group.length > SINGLE)))
|
|
18381
18426
|
], Array$1.getSomes, Array$1.map((message) => violation(file, message)))));
|
|
18382
18427
|
};
|
|
18383
|
-
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$
|
|
18428
|
+
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
|
|
18384
18429
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18385
|
-
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$
|
|
18430
|
+
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
|
|
18386
18431
|
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$3 });
|
|
18387
18432
|
return [
|
|
18388
18433
|
...manifestViolations(plugin),
|
|
@@ -19448,10 +19493,13 @@ const checkUpstream = Effect.fn("checkUpstream")(function* checkUpstream(root) {
|
|
|
19448
19493
|
});
|
|
19449
19494
|
// src/features/check-surface-callers/model/caller-texts.ts
|
|
19450
19495
|
const READ_CONCURRENCY$7 = 64;
|
|
19451
|
-
const SEPARATOR$
|
|
19496
|
+
const SEPARATOR$5 = "/";
|
|
19452
19497
|
const UNTRACKED = /(?:^|\/)(?:node_modules|\.git)\//u;
|
|
19453
|
-
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml
|
|
19498
|
+
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml)$/u;
|
|
19499
|
+
const TEST = /\.test(?:\.support)?\.[cm]?[jt]sx?$/u;
|
|
19454
19500
|
const TEXT_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|ya?ml|toml|sh|mdx?|css|html|rs)|(?:^|\/)\.vite-hooks\/[^/.]+)$/u;
|
|
19501
|
+
/** @internal */
|
|
19502
|
+
const isTest = ({ file }) => TEST.test(file);
|
|
19455
19503
|
const isCallerText = (file) => TEXT_FILE.test(file) && !NOT_A_CALLER.test(file);
|
|
19456
19504
|
const readTexts = Effect.fn("readTexts")(function* readTexts(root, listed, label) {
|
|
19457
19505
|
const files = yield* RepositoryFiles;
|
|
@@ -19470,32 +19518,57 @@ const ownTexts = Effect.fn("ownTexts")(function* ownTexts(root) {
|
|
|
19470
19518
|
const textsUnder = Effect.fn("textsUnder")(function* textsUnder(directory, label) {
|
|
19471
19519
|
const walked = yield* (yield* RepositoryFiles).walkDirectory(directory);
|
|
19472
19520
|
const tracked = pipe(walked, Array$1.filter((file) => !UNTRACKED.test(file)));
|
|
19473
|
-
return yield* readTexts(directory, tracked, (file) => `${label}${SEPARATOR$
|
|
19521
|
+
return yield* readTexts(directory, tracked, (file) => `${label}${SEPARATOR$5}${file}`);
|
|
19474
19522
|
});
|
|
19475
|
-
// src/features/check-surface-callers/model/
|
|
19523
|
+
// src/features/check-surface-callers/model/export-callers.ts
|
|
19476
19524
|
const EXPORT_RULE = "uncalled-export";
|
|
19477
|
-
const
|
|
19478
|
-
const
|
|
19479
|
-
const READ_CONCURRENCY$6 = 64;
|
|
19480
|
-
const SEPARATOR$3 = "/";
|
|
19481
|
-
const START$2 = 0;
|
|
19525
|
+
const SEPARATOR$4 = "/";
|
|
19526
|
+
const NAME_GROUP$1 = "name";
|
|
19482
19527
|
const ROOT_SUBPATH$1 = ".";
|
|
19483
19528
|
const MANIFEST_SUBPATH = "./package.json";
|
|
19484
19529
|
const WILDCARD = "*";
|
|
19485
|
-
const
|
|
19530
|
+
const SPECIFIER_ENDS = [
|
|
19486
19531
|
"\"",
|
|
19487
19532
|
"'",
|
|
19488
19533
|
"`",
|
|
19489
|
-
"\\"
|
|
19534
|
+
"\\",
|
|
19535
|
+
"?"
|
|
19490
19536
|
];
|
|
19491
|
-
const NAME_GROUP = "name";
|
|
19492
19537
|
const MANIFEST = /(?:^|\/)package\.json$/u;
|
|
19538
|
+
const JSX_RUNTIME = /^(?<name>.+)\/jsx(?:-dev)?-runtime$/u;
|
|
19539
|
+
const JSX_IMPORT_SOURCE = "jsxImportSource";
|
|
19540
|
+
const RELATIVE = /^\.\//u;
|
|
19541
|
+
const DOCUMENT = /\.mdx?$/u;
|
|
19542
|
+
const EXPORT_MESSAGE = "is exported, and nothing imports it. Every name that code outside a package can use exists only while something uses it, and fallow never reports what an entry exports as unused. Delete the subpath, or import it from the code that needs it.";
|
|
19543
|
+
const entriesOf = ({ name, exports }) => pipe(Option.fromUndefinedOr(name), Option.filter(() => Predicate.isNotUndefined(exports)), Option.map((own) => pipe(exportEntriesOf(exports), Array$1.filter(([subpath]) => subpath !== MANIFEST_SUBPATH && !String$1.includes(WILDCARD)(subpath)), Array$1.map(([subpath, held]) => ({
|
|
19544
|
+
specifier: String$1.replace(ROOT_SUBPATH$1, own)(subpath),
|
|
19545
|
+
targets: pipe(targetsIn(held), Array$1.map(String$1.replace(RELATIVE, "")))
|
|
19546
|
+
})))), Option.getOrElse(() => []));
|
|
19547
|
+
const names = (specifier) => ({ text }) => pipe(SPECIFIER_ENDS, Array$1.some((end) => String$1.includes(`${specifier}${end}`)(text)));
|
|
19548
|
+
const setsJsxSource = (specifier) => (file) => pipe(String$1.match(JSX_RUNTIME)(specifier), Option.flatMap((found) => Option.fromUndefinedOr(found.groups)), Option.flatMap(Record.get(NAME_GROUP$1)), Option.exists((source) => String$1.includes(JSX_IMPORT_SOURCE)(file.text) && names(source)(file)));
|
|
19549
|
+
const linksTarget = (prefix, targets) => ({ file, text }) => DOCUMENT.test(file) && !String$1.startsWith(prefix)(file) && pipe(targets, Array$1.some((target) => String$1.includes(`${prefix}${target}`)(text)));
|
|
19550
|
+
const calls = (prefix, { specifier, targets }) => (file) => names(specifier)(file) || setsJsxSource(specifier)(file) || linksTarget(prefix, targets)(file);
|
|
19551
|
+
/** @internal */
|
|
19552
|
+
const exportProblems = ({ root, join, corpus, owner: { directory, manifest } }) => {
|
|
19553
|
+
const prefix = `${directory}${SEPARATOR$4}`;
|
|
19554
|
+
const ownTest = (text) => String$1.startsWith(prefix)(text.file) && isTest(text);
|
|
19555
|
+
const callersOf = (specifier) => pipe(corpus, Array$1.filter(({ file }) => specifier !== manifest.name || !MANIFEST.test(file)), Array$1.filter((text) => !ownTest(text)));
|
|
19556
|
+
return pipe(entriesOf(manifest), Array$1.filter((entry) => !pipe(callersOf(entry.specifier), Array$1.some(calls(prefix, entry)))), Array$1.map(({ specifier }) => problemInFile(EXPORT_RULE)(join(root, directory, PACKAGE_JSON_FILE), `${specifier} ${EXPORT_MESSAGE}`)));
|
|
19557
|
+
};
|
|
19558
|
+
// src/features/check-surface-callers/model/surface-callers.ts
|
|
19559
|
+
const COMMAND_RULE = "uncalled-command";
|
|
19560
|
+
const FLAG_RULE = "uncalled-flag";
|
|
19561
|
+
const READ_CONCURRENCY$6 = 64;
|
|
19562
|
+
const SEPARATOR$3 = "/";
|
|
19563
|
+
const START$2 = 0;
|
|
19564
|
+
const NAME_GROUP = "name";
|
|
19493
19565
|
const SOURCE = /\.[cm]?tsx?$/u;
|
|
19494
19566
|
const DECLARED_COMMAND = /\bCommand\.make\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19495
19567
|
const DECLARED_FLAG = /\bFlag\.[A-Z]\w*\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19568
|
+
const RUN_COMMAND = /\bCommand\.run\(\s*(?<name>[A-Za-z_$][\w$]*)/gu;
|
|
19569
|
+
const INSTALLED_SKILLS$1 = ".agents/skills";
|
|
19496
19570
|
const COMMAND_FILE = /^bin\/(?<name>[^/.]+)\.[cm]?ts$/u;
|
|
19497
19571
|
const SAFE_NAME = /^[a-z][a-z0-9-]*$/u;
|
|
19498
|
-
const EXPORT_MESSAGE = "is exported, and nothing imports it. Every name that code outside a package can use exists only while something uses it, and fallow never reports what an entry exports as unused. Delete the subpath, or import it from the code that needs it.";
|
|
19499
19572
|
const COMMAND_MESSAGE = "is declared, and no task, workflow, hook or skill runs it. Every name that a caller outside a package can use exists only while something uses it. Delete the command, or run it from what needs it.";
|
|
19500
19573
|
const FLAG_MESSAGE = "is declared, and no task, workflow, hook or skill passes it. Every name that a caller outside a package can use exists only while something uses it. Delete the flag, or pass it from what needs it.";
|
|
19501
19574
|
const reachOf = ({ manifest }) => {
|
|
@@ -19510,18 +19583,14 @@ const workspaceOf$1 = Effect.fn("workspaceOf")(function* workspaceOf(root, direc
|
|
|
19510
19583
|
manifest: found
|
|
19511
19584
|
})));
|
|
19512
19585
|
});
|
|
19513
|
-
const specifiersOf = ({ name, exports }) => pipe(Option.fromUndefinedOr(name), Option.filter(() => Predicate.isNotUndefined(exports)), Option.map((own) => pipe(exportEntriesOf(exports), Array$1.map(([subpath]) => subpath), Array$1.filter((subpath) => subpath !== MANIFEST_SUBPATH && !String$1.includes(WILDCARD)(subpath)), Array$1.map((subpath) => String$1.replace(ROOT_SUBPATH$1, own)(subpath)))), Option.getOrElse(() => []));
|
|
19514
|
-
const imports = (specifier) => ({ text }) => pipe(QUOTES, Array$1.some((quote) => String$1.includes(`${specifier}${quote}`)(text)));
|
|
19515
|
-
const exportProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
19516
|
-
const importersOf = (specifier) => pipe(corpus, Array$1.filter(({ file }) => specifier !== manifest.name || !MANIFEST.test(file)));
|
|
19517
|
-
return pipe(specifiersOf(manifest), Array$1.filter((specifier) => !pipe(importersOf(specifier), Array$1.some(imports(specifier)))), Array$1.map((specifier) => problemInFile(EXPORT_RULE)(join(root, directory, PACKAGE_JSON_FILE), `${specifier} ${EXPORT_MESSAGE}`)));
|
|
19518
|
-
};
|
|
19519
19586
|
const declaredIn = (pattern) => (source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.map((name) => ({
|
|
19520
19587
|
name,
|
|
19521
19588
|
index: found.index ?? START$2,
|
|
19522
19589
|
source
|
|
19523
19590
|
})), Option.toArray)));
|
|
19524
|
-
const
|
|
19591
|
+
const runIn = (source) => pipe(Array$1.fromIterable(String$1.matchAll(RUN_COMMAND)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19592
|
+
const isRoot$1 = ({ index, source }) => pipe(runIn(source), Array$1.some((binding) => new RegExp(`\\b${binding}\\s*=\\s*$`, "u").test(String$1.slice(START$2, index)(source.text))));
|
|
19593
|
+
const elsewhere = (corpus) => ({ source }) => pipe(corpus, Array$1.filter((text) => text.file !== source.file && !isTest(text)));
|
|
19525
19594
|
const passesFlag = (declared) => {
|
|
19526
19595
|
const passed = new RegExp(`--${declared.name}(?![\\w-])`, "u");
|
|
19527
19596
|
return ({ text }) => passed.test(text);
|
|
@@ -19531,7 +19600,7 @@ const runsCommand = (bins) => (declared) => {
|
|
|
19531
19600
|
return ({ text }) => pipe(runs, Array$1.some((run) => run.test(text)));
|
|
19532
19601
|
};
|
|
19533
19602
|
const commandFilesIn = (prefix, corpus) => pipe(corpus, Array$1.flatMap(({ file }) => pipe(Option.liftPredicate(file, String$1.startsWith(prefix)), Option.map(String$1.slice(prefix.length)), Option.flatMap(String$1.match(COMMAND_FILE)), Option.flatMap((found) => Option.fromUndefinedOr(found.groups)), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19534
|
-
const uncalledIn = (root, join, corpus) => (sources, kind) => pipe(sources, Array$1.flatMap(declaredIn(kind.pattern)), Array$1.filter((
|
|
19603
|
+
const uncalledIn = (root, join, corpus) => (sources, kind) => pipe(sources, Array$1.flatMap(declaredIn(kind.pattern)), Array$1.filter((declared) => !Array$1.contains(kind.skipped, declared.name) && !kind.root(declared)), Array$1.filter((declared) => !pipe(elsewhere(corpus)(declared), Array$1.some(kind.calls(declared)))), Array$1.map((declared) => problemAtIndex(kind.rule)(join(root, declared.source.file), declared.source.text)(declared.index, `${kind.label(declared.name)} ${kind.message}`)));
|
|
19535
19604
|
const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
19536
19605
|
const prefix = `${directory}${SEPARATOR$3}`;
|
|
19537
19606
|
const bins = pipe([...pipe(binEntriesOf(manifest), Array$1.map(([name]) => name)), ...commandFilesIn(prefix, corpus)], Array$1.filter((name) => SAFE_NAME.test(name)), Array$1.dedupe);
|
|
@@ -19542,6 +19611,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
19542
19611
|
rule: COMMAND_RULE,
|
|
19543
19612
|
pattern: DECLARED_COMMAND,
|
|
19544
19613
|
skipped: bins,
|
|
19614
|
+
root: isRoot$1,
|
|
19545
19615
|
message: COMMAND_MESSAGE,
|
|
19546
19616
|
label: (name) => `The command ${name}`,
|
|
19547
19617
|
calls: runsCommand(bins)
|
|
@@ -19550,6 +19620,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
19550
19620
|
rule: FLAG_RULE,
|
|
19551
19621
|
pattern: DECLARED_FLAG,
|
|
19552
19622
|
skipped: [],
|
|
19623
|
+
root: () => false,
|
|
19553
19624
|
message: FLAG_MESSAGE,
|
|
19554
19625
|
label: (name) => `The flag --${name}`,
|
|
19555
19626
|
calls: passesFlag
|
|
@@ -19563,13 +19634,20 @@ const surfaceProblems = Effect.fn("surfaceProblems")(function* surfaceProblems(r
|
|
|
19563
19634
|
const corpus = [...yield* ownTexts(root), ...callers];
|
|
19564
19635
|
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$6 });
|
|
19565
19636
|
const workspaces = pipe(Array$1.getSomes(found), Array$1.filter((workspace) => reachOf(workspace) === reach));
|
|
19566
|
-
return [...pipe(workspaces, Array$1.flatMap(
|
|
19637
|
+
return [...pipe(workspaces, Array$1.flatMap((owner) => exportProblems({
|
|
19638
|
+
root,
|
|
19639
|
+
join: files.join,
|
|
19640
|
+
corpus,
|
|
19641
|
+
owner
|
|
19642
|
+
}))), ...pipe(workspaces, Array$1.flatMap(commandProblems(root, files.join, corpus)))];
|
|
19567
19643
|
});
|
|
19568
19644
|
/** @internal */
|
|
19569
19645
|
const checkSurfaceCallers = Effect.fn("checkSurfaceCallers")(function* checkSurfaceCallers(root) {
|
|
19646
|
+
const files = yield* RepositoryFiles;
|
|
19647
|
+
const skills = yield* textsUnder(files.join(root, INSTALLED_SKILLS$1), INSTALLED_SKILLS$1);
|
|
19570
19648
|
return yield* surfaceProblems(root, {
|
|
19571
19649
|
reach: "repository",
|
|
19572
|
-
callers:
|
|
19650
|
+
callers: skills
|
|
19573
19651
|
});
|
|
19574
19652
|
});
|
|
19575
19653
|
// src/features/check-unused-workspaces/model/unused-workspaces.ts
|