@r_masseater/msch 0.117.2 → 0.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +134 -101
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +2 -2
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-un6ctQig.mjs → define-lint-preset-D_gAe4V_.mjs} +5 -2
- package/dist/{define-lint-preset-un6ctQig.mjs.map → define-lint-preset-D_gAe4V_.mjs.map} +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/{repository-text-Cl6JiEYE.mjs → repository-text-DluK673j.mjs} +12 -6
- package/dist/{repository-text-Cl6JiEYE.mjs.map → repository-text-DluK673j.mjs.map} +1 -1
- package/package.json +3 -2
package/dist/cli.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T
|
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
7
7
|
import { _ as shadcnUiOf, a as workspaceConfigs, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries$1, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER } from "./published-BITU3twH.mjs";
|
|
8
8
|
import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-W6Uy7bV8.mjs";
|
|
9
|
-
import { a as CI_TASKS, c as meteredCommand, f as isIgnored, h as patternOf$1, m as namedWorkspaces, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES, u as existsAt } from "./repository-text-
|
|
9
|
+
import { a as CI_TASKS, c as meteredCommand, f as isIgnored, h as patternOf$1, m as namedWorkspaces, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES, u as existsAt } from "./repository-text-DluK673j.mjs";
|
|
10
10
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
11
|
-
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-
|
|
11
|
+
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-D_gAe4V_.mjs";
|
|
12
12
|
import { builtinModules, isBuiltin } from "node:module";
|
|
13
13
|
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
14
14
|
import { Array as Array$1, Boolean as Boolean$1, Clock, Config, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Redacted, Result, Runtime, Schedule, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
@@ -45,7 +45,7 @@ import { Base64 } from "effect/encoding";
|
|
|
45
45
|
import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
|
|
46
46
|
// package.json
|
|
47
47
|
var name = "@r_masseater/msch";
|
|
48
|
-
var version = "0.
|
|
48
|
+
var version = "0.118.0";
|
|
49
49
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
50
50
|
var repository = {
|
|
51
51
|
"type": "git",
|
|
@@ -1091,12 +1091,12 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1091
1091
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1092
1092
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1093
1093
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1094
|
-
const RULE$
|
|
1094
|
+
const RULE$80 = "git-subpath-dependency";
|
|
1095
1095
|
const WHOLE_MATCH$4 = 0;
|
|
1096
1096
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1097
1097
|
file,
|
|
1098
1098
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1099
|
-
rule: RULE$
|
|
1099
|
+
rule: RULE$80,
|
|
1100
1100
|
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])}\`.`
|
|
1101
1101
|
});
|
|
1102
1102
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1107,13 +1107,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1107
1107
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1108
1108
|
});
|
|
1109
1109
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1110
|
-
const RULE$
|
|
1110
|
+
const RULE$79 = "unnamed-restriction";
|
|
1111
1111
|
const WHOLE_MATCH$3 = 0;
|
|
1112
1112
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1113
1113
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1114
1114
|
file: entry.file,
|
|
1115
1115
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1116
|
-
rule: RULE$
|
|
1116
|
+
rule: RULE$79,
|
|
1117
1117
|
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.`
|
|
1118
1118
|
})));
|
|
1119
1119
|
/** @internal */
|
|
@@ -1122,13 +1122,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1122
1122
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1123
1123
|
});
|
|
1124
1124
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1125
|
-
const RULE$
|
|
1125
|
+
const RULE$78 = "named-type-exemption";
|
|
1126
1126
|
const WHOLE_MATCH$2 = 0;
|
|
1127
1127
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1128
1128
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1129
1129
|
file: entry.file,
|
|
1130
1130
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1131
|
-
rule: RULE$
|
|
1131
|
+
rule: RULE$78,
|
|
1132
1132
|
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."
|
|
1133
1133
|
})));
|
|
1134
1134
|
/** @internal */
|
|
@@ -1144,13 +1144,13 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1144
1144
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1145
1145
|
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)))));
|
|
1146
1146
|
// src/features/check-overrides/model/package-registry.ts
|
|
1147
|
-
const RULE$
|
|
1147
|
+
const RULE$77 = "package-registry";
|
|
1148
1148
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1149
1149
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1150
1150
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
1151
1151
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
1152
1152
|
const START$33 = 0;
|
|
1153
|
-
const REASON$
|
|
1153
|
+
const REASON$4 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
1154
1154
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
1155
1155
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
1156
1156
|
const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
|
|
@@ -1158,17 +1158,17 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
1158
1158
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1159
1159
|
file,
|
|
1160
1160
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1161
|
-
rule: RULE$
|
|
1161
|
+
rule: RULE$77,
|
|
1162
1162
|
message: Option.match(registry, {
|
|
1163
|
-
onNone: () => `${REASON$
|
|
1164
|
-
onSome: (value) => `${REASON$
|
|
1163
|
+
onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1164
|
+
onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
1165
1165
|
})
|
|
1166
1166
|
});
|
|
1167
1167
|
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) => ({
|
|
1168
1168
|
file: entry.file,
|
|
1169
1169
|
...positionOf(source)(found.index ?? START$33),
|
|
1170
|
-
rule: RULE$
|
|
1171
|
-
message: `${REASON$
|
|
1170
|
+
rule: RULE$77,
|
|
1171
|
+
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$33])}\`. Remove the line.`
|
|
1172
1172
|
})));
|
|
1173
1173
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
1174
1174
|
const files = yield* RepositoryFiles;
|
|
@@ -1245,7 +1245,7 @@ const SELF_HOMEPAGE = homepage;
|
|
|
1245
1245
|
const SELF_DIRECTORY = repository.directory;
|
|
1246
1246
|
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`;
|
|
1247
1247
|
// src/features/check-overrides/model/removed-peers.ts
|
|
1248
|
-
const RULE$
|
|
1248
|
+
const RULE$76 = "removed-peer";
|
|
1249
1249
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
1250
1250
|
const REMOVED = "-";
|
|
1251
1251
|
const PARENT_SEPARATOR = ">";
|
|
@@ -1272,7 +1272,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1272
1272
|
file,
|
|
1273
1273
|
line,
|
|
1274
1274
|
column,
|
|
1275
|
-
rule: RULE$
|
|
1275
|
+
rule: RULE$76,
|
|
1276
1276
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
1277
1277
|
});
|
|
1278
1278
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
@@ -3413,7 +3413,7 @@ const matcher = (patterns) => {
|
|
|
3413
3413
|
String$1.startsWith(NEGATION$1);
|
|
3414
3414
|
String$1.slice(1);
|
|
3415
3415
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3416
|
-
const RULE$
|
|
3416
|
+
const RULE$75 = "colocated-git-patterns";
|
|
3417
3417
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3418
3418
|
const ROOT$3 = ".";
|
|
3419
3419
|
const NEGATION = "!";
|
|
@@ -3460,7 +3460,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3460
3460
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3461
3461
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3462
3462
|
});
|
|
3463
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3463
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$75)(entry.file, {
|
|
3464
3464
|
line: entry.line,
|
|
3465
3465
|
column: FIRST$26
|
|
3466
3466
|
}, message);
|
|
@@ -3523,7 +3523,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
3523
3523
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3524
3524
|
});
|
|
3525
3525
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3526
|
-
const RULE$
|
|
3526
|
+
const RULE$74 = "colocated-test";
|
|
3527
3527
|
const FIRST$25 = 1;
|
|
3528
3528
|
const READ_CONCURRENCY$40 = 64;
|
|
3529
3529
|
const ROOT_SUBPATH$2 = ".";
|
|
@@ -3546,7 +3546,7 @@ const problemFor$10 = (test, message) => ({
|
|
|
3546
3546
|
file: test.file,
|
|
3547
3547
|
line: FIRST$25,
|
|
3548
3548
|
column: FIRST$25,
|
|
3549
|
-
rule: RULE$
|
|
3549
|
+
rule: RULE$74,
|
|
3550
3550
|
message: `${test.base} ${message}`
|
|
3551
3551
|
});
|
|
3552
3552
|
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);
|
|
@@ -3629,7 +3629,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3629
3629
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3630
3630
|
const RECOMMENDED_LINES = 200;
|
|
3631
3631
|
const FIRST$24 = 1;
|
|
3632
|
-
const RULE$
|
|
3632
|
+
const RULE$73 = "agent-docs-length";
|
|
3633
3633
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3634
3634
|
const problemFor$9 = (file) => (lines) => {
|
|
3635
3635
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3637,14 +3637,14 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3637
3637
|
file,
|
|
3638
3638
|
line: 201,
|
|
3639
3639
|
column: FIRST$24,
|
|
3640
|
-
rule: RULE$
|
|
3640
|
+
rule: RULE$73,
|
|
3641
3641
|
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.`
|
|
3642
3642
|
});
|
|
3643
3643
|
};
|
|
3644
3644
|
/** @internal */
|
|
3645
3645
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3646
3646
|
// src/features/check-placement/model/claude-link.ts
|
|
3647
|
-
const RULE$
|
|
3647
|
+
const RULE$72 = "claude-md-link";
|
|
3648
3648
|
const CLAUDE = "CLAUDE.md";
|
|
3649
3649
|
const AGENTS = "AGENTS.md";
|
|
3650
3650
|
const FIRST$23 = 1;
|
|
@@ -3663,7 +3663,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3663
3663
|
file: path,
|
|
3664
3664
|
line: FIRST$23,
|
|
3665
3665
|
column: FIRST$23,
|
|
3666
|
-
rule: RULE$
|
|
3666
|
+
rule: RULE$72,
|
|
3667
3667
|
message: MESSAGE$15
|
|
3668
3668
|
})));
|
|
3669
3669
|
});
|
|
@@ -3672,7 +3672,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3672
3672
|
return Array$1.getSomes(found);
|
|
3673
3673
|
});
|
|
3674
3674
|
// src/features/check-placement/model/dangling-links.ts
|
|
3675
|
-
const RULE$
|
|
3675
|
+
const RULE$71 = "dangling-link";
|
|
3676
3676
|
const SEPARATOR$25 = "/";
|
|
3677
3677
|
const FIRST$22 = 1;
|
|
3678
3678
|
const READ_CONCURRENCY$37 = 16;
|
|
@@ -3688,7 +3688,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3688
3688
|
file,
|
|
3689
3689
|
line: FIRST$22,
|
|
3690
3690
|
column: FIRST$22,
|
|
3691
|
-
rule: RULE$
|
|
3691
|
+
rule: RULE$71,
|
|
3692
3692
|
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.`
|
|
3693
3693
|
})));
|
|
3694
3694
|
});
|
|
@@ -3746,7 +3746,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3746
3746
|
}));
|
|
3747
3747
|
});
|
|
3748
3748
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3749
|
-
const RULE$
|
|
3749
|
+
const RULE$70 = "deployed-readme";
|
|
3750
3750
|
const ROOT_DIRECTORY$4 = "";
|
|
3751
3751
|
const READ_CONCURRENCY$36 = 16;
|
|
3752
3752
|
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.";
|
|
@@ -3786,14 +3786,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3786
3786
|
const readme = yield* readReadme({
|
|
3787
3787
|
root,
|
|
3788
3788
|
directory,
|
|
3789
|
-
rule: RULE$
|
|
3789
|
+
rule: RULE$70,
|
|
3790
3790
|
missingMessage: MISSING_MESSAGE$2
|
|
3791
3791
|
});
|
|
3792
3792
|
return Result.match(readme, {
|
|
3793
3793
|
onFailure: Option.some,
|
|
3794
3794
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3795
3795
|
file,
|
|
3796
|
-
rule: RULE$
|
|
3796
|
+
rule: RULE$70,
|
|
3797
3797
|
message: NO_URL_MESSAGE
|
|
3798
3798
|
})))
|
|
3799
3799
|
});
|
|
@@ -3810,7 +3810,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3810
3810
|
return Array$1.getSomes(found);
|
|
3811
3811
|
});
|
|
3812
3812
|
// src/features/check-placement/model/nested-docs.ts
|
|
3813
|
-
const RULE$
|
|
3813
|
+
const RULE$69 = "nested-docs";
|
|
3814
3814
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3815
3815
|
const SEPARATOR$23 = "/";
|
|
3816
3816
|
const READ_CONCURRENCY$35 = 64;
|
|
@@ -3823,7 +3823,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3823
3823
|
const taggedError$13 = Schema.TaggedError;
|
|
3824
3824
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3825
3825
|
const isNested = (name) => String$1.includes(SEPARATOR$23)(name);
|
|
3826
|
-
const problemFor$8 = problemInFile(RULE$
|
|
3826
|
+
const problemFor$8 = problemInFile(RULE$69);
|
|
3827
3827
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3828
3828
|
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.";
|
|
3829
3829
|
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.";
|
|
@@ -3880,7 +3880,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3880
3880
|
return [...Array$1.getSomes(found), ...missing];
|
|
3881
3881
|
});
|
|
3882
3882
|
// src/features/check-placement/model/published-readme.ts
|
|
3883
|
-
const RULE$
|
|
3883
|
+
const RULE$68 = "published-readme";
|
|
3884
3884
|
const READ_CONCURRENCY$34 = 16;
|
|
3885
3885
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3886
3886
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
@@ -3888,7 +3888,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3888
3888
|
const readme = yield* readReadme({
|
|
3889
3889
|
root,
|
|
3890
3890
|
directory,
|
|
3891
|
-
rule: RULE$
|
|
3891
|
+
rule: RULE$68,
|
|
3892
3892
|
missingMessage: MISSING_MESSAGE
|
|
3893
3893
|
});
|
|
3894
3894
|
return Result.match(readme, {
|
|
@@ -3899,7 +3899,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3899
3899
|
file,
|
|
3900
3900
|
line,
|
|
3901
3901
|
column,
|
|
3902
|
-
rule: RULE$
|
|
3902
|
+
rule: RULE$68,
|
|
3903
3903
|
message: MESSAGE$14
|
|
3904
3904
|
};
|
|
3905
3905
|
}))
|
|
@@ -3912,7 +3912,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
3912
3912
|
return Array$1.getSomes(found);
|
|
3913
3913
|
});
|
|
3914
3914
|
// src/features/check-placement/model/published-tests.ts
|
|
3915
|
-
const RULE$
|
|
3915
|
+
const RULE$67 = "published-tests";
|
|
3916
3916
|
const FILE_START = 1;
|
|
3917
3917
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3918
3918
|
const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3926,7 +3926,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3926
3926
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3927
3927
|
line: FILE_START,
|
|
3928
3928
|
column: FILE_START,
|
|
3929
|
-
rule: RULE$
|
|
3929
|
+
rule: RULE$67,
|
|
3930
3930
|
message: MESSAGE$13
|
|
3931
3931
|
});
|
|
3932
3932
|
});
|
|
@@ -3940,7 +3940,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3940
3940
|
return Array$1.getSomes(found);
|
|
3941
3941
|
});
|
|
3942
3942
|
// src/features/check-placement/model/root-docs.ts
|
|
3943
|
-
const RULE$
|
|
3943
|
+
const RULE$66 = "root-docs";
|
|
3944
3944
|
const SEPARATOR$22 = "/";
|
|
3945
3945
|
const FIRST$20 = 1;
|
|
3946
3946
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
@@ -3955,12 +3955,12 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3955
3955
|
file: files.join(root, name),
|
|
3956
3956
|
line: FIRST$20,
|
|
3957
3957
|
column: FIRST$20,
|
|
3958
|
-
rule: RULE$
|
|
3958
|
+
rule: RULE$66,
|
|
3959
3959
|
message: `${name} ${MESSAGE$12}`
|
|
3960
3960
|
})));
|
|
3961
3961
|
});
|
|
3962
3962
|
// src/features/check-placement/model/root-readme.ts
|
|
3963
|
-
const RULE$
|
|
3963
|
+
const RULE$65 = "root-readme";
|
|
3964
3964
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3965
3965
|
const READ_CONCURRENCY$33 = 16;
|
|
3966
3966
|
const START$31 = 0;
|
|
@@ -4003,7 +4003,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4003
4003
|
const message = messageFor$5(workspace.directory);
|
|
4004
4004
|
const at = positionOf(source);
|
|
4005
4005
|
const pattern = patternFor(plugins)(workspace);
|
|
4006
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4006
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$65)(file, at(found.index ?? START$31), message)));
|
|
4007
4007
|
};
|
|
4008
4008
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4009
4009
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4040,7 +4040,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4040
4040
|
return Array$1.flatten(found);
|
|
4041
4041
|
});
|
|
4042
4042
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4043
|
-
const RULE$
|
|
4043
|
+
const RULE$64 = "docs-mirror";
|
|
4044
4044
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4045
4045
|
const MIRROR_LIMIT = 3;
|
|
4046
4046
|
const READ_CONCURRENCY$32 = 16;
|
|
@@ -4065,7 +4065,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4065
4065
|
file,
|
|
4066
4066
|
line,
|
|
4067
4067
|
column,
|
|
4068
|
-
rule: RULE$
|
|
4068
|
+
rule: RULE$64,
|
|
4069
4069
|
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.`
|
|
4070
4070
|
};
|
|
4071
4071
|
}), Option.toArray);
|
|
@@ -4097,7 +4097,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4097
4097
|
return Array$1.flatten(found);
|
|
4098
4098
|
});
|
|
4099
4099
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4100
|
-
const RULE$
|
|
4100
|
+
const RULE$63 = "ignored-sources";
|
|
4101
4101
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4102
4102
|
const FIRST$19 = 1;
|
|
4103
4103
|
const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -4109,7 +4109,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4109
4109
|
file: files.join(root, file),
|
|
4110
4110
|
line: FIRST$19,
|
|
4111
4111
|
column: FIRST$19,
|
|
4112
|
-
rule: RULE$
|
|
4112
|
+
rule: RULE$63,
|
|
4113
4113
|
message: MESSAGE$11
|
|
4114
4114
|
})));
|
|
4115
4115
|
});
|
|
@@ -12866,13 +12866,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12866
12866
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12867
12867
|
});
|
|
12868
12868
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12869
|
-
const RULE$
|
|
12869
|
+
const RULE$62 = "shadcn-ui-alias";
|
|
12870
12870
|
const FIRST$18 = 1;
|
|
12871
12871
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12872
12872
|
file,
|
|
12873
12873
|
line: FIRST$18,
|
|
12874
12874
|
column: FIRST$18,
|
|
12875
|
-
rule: RULE$
|
|
12875
|
+
rule: RULE$62,
|
|
12876
12876
|
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/*".`
|
|
12877
12877
|
});
|
|
12878
12878
|
/** @internal */
|
|
@@ -13140,7 +13140,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13140
13140
|
])));
|
|
13141
13141
|
});
|
|
13142
13142
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13143
|
-
const RULE$
|
|
13143
|
+
const RULE$61 = "config-path";
|
|
13144
13144
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13145
13145
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13146
13146
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -13159,7 +13159,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
13159
13159
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13160
13160
|
file,
|
|
13161
13161
|
...positionOf(source)(mention.index),
|
|
13162
|
-
rule: RULE$
|
|
13162
|
+
rule: RULE$61,
|
|
13163
13163
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13164
13164
|
});
|
|
13165
13165
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13184,7 +13184,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13184
13184
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13185
13185
|
file,
|
|
13186
13186
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13187
|
-
rule: RULE$
|
|
13187
|
+
rule: RULE$61,
|
|
13188
13188
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13189
13189
|
})));
|
|
13190
13190
|
});
|
|
@@ -13196,7 +13196,7 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
|
|
|
13196
13196
|
return [...Array$1.flatten(found), ...patterns];
|
|
13197
13197
|
});
|
|
13198
13198
|
// src/features/check-repository-layout/model/crates.ts
|
|
13199
|
-
const RULE$
|
|
13199
|
+
const RULE$60 = "unverified-crate";
|
|
13200
13200
|
const VERSION_RULE = "release-version";
|
|
13201
13201
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13202
13202
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
@@ -13208,7 +13208,7 @@ const problemFor$5 = (crate, message) => ({
|
|
|
13208
13208
|
file: crate.manifest,
|
|
13209
13209
|
line: FIRST$16,
|
|
13210
13210
|
column: FIRST$16,
|
|
13211
|
-
rule: RULE$
|
|
13211
|
+
rule: RULE$60,
|
|
13212
13212
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13213
13213
|
});
|
|
13214
13214
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13244,7 +13244,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13244
13244
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13245
13245
|
});
|
|
13246
13246
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13247
|
-
const RULE$
|
|
13247
|
+
const RULE$59 = "deploy-entry-pattern";
|
|
13248
13248
|
const FALLOW_KEYS = [
|
|
13249
13249
|
"entry",
|
|
13250
13250
|
"entryPoints",
|
|
@@ -13315,7 +13315,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13315
13315
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13316
13316
|
file: path,
|
|
13317
13317
|
...positionOf(text.value)(start - kind.offset),
|
|
13318
|
-
rule: RULE$
|
|
13318
|
+
rule: RULE$59,
|
|
13319
13319
|
message: `${pattern} ${MESSAGE$10}`
|
|
13320
13320
|
})));
|
|
13321
13321
|
});
|
|
@@ -13348,7 +13348,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13348
13348
|
return Array$1.flatten(found);
|
|
13349
13349
|
});
|
|
13350
13350
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13351
|
-
const RULE$
|
|
13351
|
+
const RULE$58 = "listed-entry";
|
|
13352
13352
|
const ENTRY_KEYS = [
|
|
13353
13353
|
"entry",
|
|
13354
13354
|
"entryPoints",
|
|
@@ -13378,7 +13378,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13378
13378
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13379
13379
|
file: path,
|
|
13380
13380
|
...positionOf(text.value)(start),
|
|
13381
|
-
rule: RULE$
|
|
13381
|
+
rule: RULE$58,
|
|
13382
13382
|
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.`
|
|
13383
13383
|
})));
|
|
13384
13384
|
});
|
|
@@ -13390,7 +13390,7 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
13390
13390
|
return Array$1.flatten(found);
|
|
13391
13391
|
});
|
|
13392
13392
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13393
|
-
const RULE$
|
|
13393
|
+
const RULE$57 = "root-workspace-path";
|
|
13394
13394
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13395
13395
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13396
13396
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13409,7 +13409,7 @@ const mentions = (directory) => (text) => {
|
|
|
13409
13409
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13410
13410
|
file,
|
|
13411
13411
|
...positionOf(source)(found.start),
|
|
13412
|
-
rule: RULE$
|
|
13412
|
+
rule: RULE$57,
|
|
13413
13413
|
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.`
|
|
13414
13414
|
})));
|
|
13415
13415
|
/** @internal */
|
|
@@ -13423,7 +13423,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13423
13423
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13424
13424
|
});
|
|
13425
13425
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13426
|
-
const RULE$
|
|
13426
|
+
const RULE$56 = "hidden-verify";
|
|
13427
13427
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13428
13428
|
const FIRST$14 = 1;
|
|
13429
13429
|
const READ_CONCURRENCY$25 = 8;
|
|
@@ -13437,7 +13437,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13437
13437
|
file,
|
|
13438
13438
|
line: FIRST$14,
|
|
13439
13439
|
column: FIRST$14,
|
|
13440
|
-
rule: RULE$
|
|
13440
|
+
rule: RULE$56,
|
|
13441
13441
|
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}.`
|
|
13442
13442
|
}).pipe(Option.filter(() => verified));
|
|
13443
13443
|
});
|
|
@@ -13448,7 +13448,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
13448
13448
|
return Array$1.getSomes(found);
|
|
13449
13449
|
});
|
|
13450
13450
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13451
|
-
const RULE$
|
|
13451
|
+
const RULE$55 = "shared-uncached-task";
|
|
13452
13452
|
const READ_CONCURRENCY$24 = 8;
|
|
13453
13453
|
const SHARED = 2;
|
|
13454
13454
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -13491,7 +13491,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
13491
13491
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13492
13492
|
file,
|
|
13493
13493
|
...position,
|
|
13494
|
-
rule: RULE$
|
|
13494
|
+
rule: RULE$55,
|
|
13495
13495
|
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.`
|
|
13496
13496
|
})));
|
|
13497
13497
|
};
|
|
@@ -13502,7 +13502,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
13502
13502
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13503
13503
|
});
|
|
13504
13504
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13505
|
-
const RULE$
|
|
13505
|
+
const RULE$54 = "tested-verify";
|
|
13506
13506
|
const READ_CONCURRENCY$23 = 8;
|
|
13507
13507
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13508
13508
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
@@ -13531,7 +13531,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13531
13531
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13532
13532
|
file,
|
|
13533
13533
|
...positionOf(source)(at.start),
|
|
13534
|
-
rule: RULE$
|
|
13534
|
+
rule: RULE$54,
|
|
13535
13535
|
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.`
|
|
13536
13536
|
})))));
|
|
13537
13537
|
});
|
|
@@ -13542,7 +13542,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
|
|
|
13542
13542
|
return Array$1.flatten(found);
|
|
13543
13543
|
});
|
|
13544
13544
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13545
|
-
const RULE$
|
|
13545
|
+
const RULE$53 = "unlocked-task";
|
|
13546
13546
|
const READ_CONCURRENCY$22 = 8;
|
|
13547
13547
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13548
13548
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -13554,7 +13554,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13554
13554
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13555
13555
|
file,
|
|
13556
13556
|
...positionOf(source)(task.start),
|
|
13557
|
-
rule: RULE$
|
|
13557
|
+
rule: RULE$53,
|
|
13558
13558
|
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.`
|
|
13559
13559
|
})), Option.toArray)));
|
|
13560
13560
|
/** @internal */
|
|
@@ -13870,7 +13870,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13870
13870
|
return yield* files.mergeBase(root, base);
|
|
13871
13871
|
});
|
|
13872
13872
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13873
|
-
const RULE$
|
|
13873
|
+
const RULE$52 = "migration-order";
|
|
13874
13874
|
const SNAPSHOT = "snapshot.json";
|
|
13875
13875
|
const MIGRATION = "migration.sql";
|
|
13876
13876
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
@@ -13904,7 +13904,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13904
13904
|
file: join(root, file),
|
|
13905
13905
|
line: FIRST$13,
|
|
13906
13906
|
column: FIRST$13,
|
|
13907
|
-
rule: RULE$
|
|
13907
|
+
rule: RULE$52,
|
|
13908
13908
|
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}.`
|
|
13909
13909
|
})))), Option.getOrElse(() => []));
|
|
13910
13910
|
/** @internal */
|
|
@@ -13955,7 +13955,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
13955
13955
|
catch: bundleErrorDetail
|
|
13956
13956
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
13957
13957
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
13958
|
-
const RULE$
|
|
13958
|
+
const RULE$51 = "plugin-dependencies";
|
|
13959
13959
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
13960
13960
|
const LOCK_FILE = "bun.lock";
|
|
13961
13961
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
@@ -13965,7 +13965,7 @@ const SUCCESS$6 = 0;
|
|
|
13965
13965
|
const NOT_STARTED = -1;
|
|
13966
13966
|
const DETAIL_LINES = 3;
|
|
13967
13967
|
const PLUGIN_CONCURRENCY = 2;
|
|
13968
|
-
const problemFor$4 = problemInFile(RULE$
|
|
13968
|
+
const problemFor$4 = problemInFile(RULE$51);
|
|
13969
13969
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
13970
13970
|
const files = yield* RepositoryFiles;
|
|
13971
13971
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -14212,7 +14212,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
14212
14212
|
});
|
|
14213
14213
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
14214
14214
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14215
|
-
const RULE$
|
|
14215
|
+
const RULE$50 = "optional-peer";
|
|
14216
14216
|
const REQUIRED_RULE = "required-peer";
|
|
14217
14217
|
const START$27 = 0;
|
|
14218
14218
|
const SINGLE$1 = 1;
|
|
@@ -14229,7 +14229,7 @@ const positionIn = (located, key, name) => {
|
|
|
14229
14229
|
const problemFor$3 = (located, name, importers) => ({
|
|
14230
14230
|
file: located.file,
|
|
14231
14231
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
14232
|
-
rule: RULE$
|
|
14232
|
+
rule: RULE$50,
|
|
14233
14233
|
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.`
|
|
14234
14234
|
});
|
|
14235
14235
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -14265,7 +14265,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14265
14265
|
}));
|
|
14266
14266
|
};
|
|
14267
14267
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14268
|
-
const RULE$
|
|
14268
|
+
const RULE$49 = "side-effects";
|
|
14269
14269
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14270
14270
|
const START$26 = 0;
|
|
14271
14271
|
const FIRST$12 = 1;
|
|
@@ -14317,11 +14317,11 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
|
|
|
14317
14317
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14318
14318
|
file,
|
|
14319
14319
|
...positionOf(source)(keyIndex$1(source)),
|
|
14320
|
-
rule: RULE$
|
|
14320
|
+
rule: RULE$49,
|
|
14321
14321
|
message: messageOf$6(worst, excesses.length)
|
|
14322
14322
|
})), Option.toArray);
|
|
14323
14323
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14324
|
-
const RULE$
|
|
14324
|
+
const RULE$48 = "top-level-effect";
|
|
14325
14325
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14326
14326
|
const READ_CONCURRENCY$20 = 16;
|
|
14327
14327
|
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.";
|
|
@@ -14337,7 +14337,7 @@ const messageOf$5 = (statement) => {
|
|
|
14337
14337
|
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14338
14338
|
const retained = api.createSourceFile(file, source);
|
|
14339
14339
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14340
|
-
rule: RULE$
|
|
14340
|
+
rule: RULE$48,
|
|
14341
14341
|
message: messageOf$5(statement)
|
|
14342
14342
|
})(statement)));
|
|
14343
14343
|
retained.dispose();
|
|
@@ -14506,7 +14506,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
14506
14506
|
return Array$1.flatten(found);
|
|
14507
14507
|
});
|
|
14508
14508
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14509
|
-
const RULE$
|
|
14509
|
+
const RULE$47 = "legacy-typescript";
|
|
14510
14510
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14511
14511
|
const COMPILER = "typescript";
|
|
14512
14512
|
const CURRENT_MAJOR = 7;
|
|
@@ -14537,12 +14537,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14537
14537
|
file,
|
|
14538
14538
|
line: lineOf$4(source)(legacy.id),
|
|
14539
14539
|
column: FIRST$11,
|
|
14540
|
-
rule: RULE$
|
|
14540
|
+
rule: RULE$47,
|
|
14541
14541
|
message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14542
14542
|
})));
|
|
14543
14543
|
});
|
|
14544
14544
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14545
|
-
const RULE$
|
|
14545
|
+
const RULE$46 = "worker-bundle";
|
|
14546
14546
|
const BUNDLE_CONCURRENCY = 4;
|
|
14547
14547
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14548
14548
|
const CONDITIONS = [
|
|
@@ -14553,7 +14553,7 @@ const CONDITIONS = [
|
|
|
14553
14553
|
"module",
|
|
14554
14554
|
"default"
|
|
14555
14555
|
];
|
|
14556
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14556
|
+
const problemFor$2 = problemInFile(RULE$46);
|
|
14557
14557
|
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14558
14558
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14559
14559
|
const built = yield* Effect.tryPromise({
|
|
@@ -14746,7 +14746,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14746
14746
|
...secretWeakenings(config.h56m, expected.secrets)
|
|
14747
14747
|
];
|
|
14748
14748
|
// src/app/disabled-rules.ts
|
|
14749
|
-
const RULE$
|
|
14749
|
+
const RULE$45 = "disabled-rule";
|
|
14750
14750
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14751
14751
|
const START$24 = 0;
|
|
14752
14752
|
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;
|
|
@@ -14760,7 +14760,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14760
14760
|
const files = yield* RepositoryFiles;
|
|
14761
14761
|
const listed = yield* files.listedFiles(root);
|
|
14762
14762
|
const isExempt = matcher(exempt);
|
|
14763
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$
|
|
14763
|
+
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$45)(files.join(root, name), "")(START$24, SIDE_CONFIG_MESSAGE)));
|
|
14764
14764
|
});
|
|
14765
14765
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14766
14766
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14772,7 +14772,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14772
14772
|
})
|
|
14773
14773
|
});
|
|
14774
14774
|
const expected = yield* expectationsIn(root);
|
|
14775
|
-
const at = problemAtIndex(RULE$
|
|
14775
|
+
const at = problemAtIndex(RULE$45)(file, source);
|
|
14776
14776
|
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$24), message)));
|
|
14777
14777
|
});
|
|
14778
14778
|
/** @internal */
|
|
@@ -14780,7 +14780,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
|
|
|
14780
14780
|
const files = yield* RepositoryFiles;
|
|
14781
14781
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14782
14782
|
if (Option.isNone(text)) return [];
|
|
14783
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$
|
|
14783
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$45)(file, "")(START$24, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
14784
14784
|
});
|
|
14785
14785
|
// src/app/build-checks.ts
|
|
14786
14786
|
/** @internal */
|
|
@@ -14876,7 +14876,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
14876
14876
|
imports: importedFilesOf(checker)(sourceFile)
|
|
14877
14877
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
14878
14878
|
// src/features/check-value-owners/model/name-lists.ts
|
|
14879
|
-
const RULE$
|
|
14879
|
+
const RULE$44 = "hand-written-names";
|
|
14880
14880
|
const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
14881
14881
|
const nameListOf = (site) => {
|
|
14882
14882
|
if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -14891,7 +14891,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
14891
14891
|
file,
|
|
14892
14892
|
line,
|
|
14893
14893
|
column,
|
|
14894
|
-
rule: RULE$
|
|
14894
|
+
rule: RULE$44,
|
|
14895
14895
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
14896
14896
|
});
|
|
14897
14897
|
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
@@ -15682,7 +15682,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15682
15682
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
15683
15683
|
}, Effect.scoped);
|
|
15684
15684
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15685
|
-
const RULE$
|
|
15685
|
+
const RULE$43 = "namespace-destructuring";
|
|
15686
15686
|
const LOCAL = /^[.#/]/u;
|
|
15687
15687
|
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.`;
|
|
15688
15688
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -15698,7 +15698,7 @@ const destructuredName = (declaration) => {
|
|
|
15698
15698
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15699
15699
|
};
|
|
15700
15700
|
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
|
|
15701
|
-
rule: RULE$
|
|
15701
|
+
rule: RULE$43,
|
|
15702
15702
|
message: messageOf$3(name)
|
|
15703
15703
|
})), Option.map((report) => report(declaration)));
|
|
15704
15704
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -15706,7 +15706,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
15706
15706
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15707
15707
|
};
|
|
15708
15708
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15709
|
-
const RULE$
|
|
15709
|
+
const RULE$42 = "pass-through-wrapper";
|
|
15710
15710
|
const SINGLE_STATEMENT = 1;
|
|
15711
15711
|
const SINGLE_DECLARATION = 1;
|
|
15712
15712
|
const THIS_PARAMETER = "this";
|
|
@@ -15803,7 +15803,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
15803
15803
|
const problemOf$7 = (checker) => (candidate) => {
|
|
15804
15804
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
15805
15805
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
|
|
15806
|
-
rule: RULE$
|
|
15806
|
+
rule: RULE$42,
|
|
15807
15807
|
message: messageOf$2(forward.callee.getText())
|
|
15808
15808
|
})(candidate.name)));
|
|
15809
15809
|
};
|
|
@@ -15826,8 +15826,8 @@ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigi
|
|
|
15826
15826
|
/** @internal */
|
|
15827
15827
|
const slugOf = ({ owner, name }) => `${owner}/${name}`;
|
|
15828
15828
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
15829
|
-
const RULE$
|
|
15830
|
-
const SETTINGS_FILE$
|
|
15829
|
+
const RULE$41 = "known-plugins";
|
|
15830
|
+
const SETTINGS_FILE$3 = ".claude/settings.json";
|
|
15831
15831
|
const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
|
|
15832
15832
|
const GITHUB$5 = "github";
|
|
15833
15833
|
const Source$1 = Schema.Struct({
|
|
@@ -15841,13 +15841,13 @@ const SettingsSchema$1 = Schema.Struct({
|
|
|
15841
15841
|
extraKnownMarketplaces: Schema.optionalKey(Marketplaces),
|
|
15842
15842
|
enabledPlugins: Schema.optionalKey(Plugins$1)
|
|
15843
15843
|
});
|
|
15844
|
-
const decodeSettings$
|
|
15844
|
+
const decodeSettings$2 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
|
|
15845
15845
|
const MarketplaceSchema = Schema.Struct({
|
|
15846
15846
|
name: Schema.String,
|
|
15847
15847
|
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
15848
15848
|
});
|
|
15849
15849
|
const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
|
|
15850
|
-
const problem$5 = problemInFile(RULE$
|
|
15850
|
+
const problem$5 = problemInFile(RULE$41);
|
|
15851
15851
|
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));
|
|
15852
15852
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
15853
15853
|
const pluginProblems = (marketplace, file, settings) => {
|
|
@@ -15859,9 +15859,9 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
15859
15859
|
const files = yield* RepositoryFiles;
|
|
15860
15860
|
const origin = yield* repositoryOrigin(root);
|
|
15861
15861
|
const manifest = yield* files.readFile(files.join(root, MARKETPLACE_FILE$2));
|
|
15862
|
-
const file = files.join(root, SETTINGS_FILE$
|
|
15862
|
+
const file = files.join(root, SETTINGS_FILE$3);
|
|
15863
15863
|
const text = yield* files.readFile(file);
|
|
15864
|
-
const settings = pipe(text, Option.flatMap(decodeSettings$
|
|
15864
|
+
const settings = pipe(text, Option.flatMap(decodeSettings$2), Option.getOrElse(() => ({})));
|
|
15865
15865
|
const marketplace = pipe(manifest, Option.flatMap(decodeMarketplace));
|
|
15866
15866
|
return pipe(Option.all({
|
|
15867
15867
|
origin,
|
|
@@ -15872,8 +15872,8 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
15872
15872
|
}));
|
|
15873
15873
|
});
|
|
15874
15874
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
15875
|
-
const RULE$
|
|
15876
|
-
const SETTINGS_FILE$
|
|
15875
|
+
const RULE$40 = "missing-hook";
|
|
15876
|
+
const SETTINGS_FILE$2 = /^\.claude\/settings\.json$/u;
|
|
15877
15877
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
15878
15878
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15879
15879
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
@@ -15897,7 +15897,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
15897
15897
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
15898
15898
|
file,
|
|
15899
15899
|
...positionOf(source)(index),
|
|
15900
|
-
rule: RULE$
|
|
15900
|
+
rule: RULE$40,
|
|
15901
15901
|
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.`
|
|
15902
15902
|
})));
|
|
15903
15903
|
});
|
|
@@ -15907,7 +15907,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
15907
15907
|
const listed = yield* files.listedFiles(root);
|
|
15908
15908
|
const hookFiles = pipe(listed, Array$1.flatMap((name) => {
|
|
15909
15909
|
const file = files.join(root, name);
|
|
15910
|
-
if (SETTINGS_FILE$
|
|
15910
|
+
if (SETTINGS_FILE$2.test(name)) return [{
|
|
15911
15911
|
root,
|
|
15912
15912
|
file,
|
|
15913
15913
|
base: root,
|
|
@@ -15924,6 +15924,38 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
15924
15924
|
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$19 });
|
|
15925
15925
|
return Array$1.flatten(found);
|
|
15926
15926
|
});
|
|
15927
|
+
// src/features/check-agent-settings/model/project-extensions.ts
|
|
15928
|
+
const RULE$39 = "project-claude-extensions";
|
|
15929
|
+
const SETTINGS_FILE$1 = ".claude/settings.json";
|
|
15930
|
+
const SETUP_EVENT = "SessionStart";
|
|
15931
|
+
const EXTENSION_DIRECTORIES = [
|
|
15932
|
+
".claude/skills/",
|
|
15933
|
+
".claude/agents/",
|
|
15934
|
+
".claude/commands/",
|
|
15935
|
+
".claude/rules/",
|
|
15936
|
+
".claude/output-styles/"
|
|
15937
|
+
];
|
|
15938
|
+
const REASON$3 = "A Claude Code hook, skill, agent, command, rule or output style kept in one repository is copied into the next repository that needs it, and the copies drift apart. Put it in a plugin, enable the plugin in .claude/settings.json, and keep only the settings and the SessionStart environment setup in the repository.";
|
|
15939
|
+
const Settings = Schema.Struct({ hooks: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
15940
|
+
const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settings));
|
|
15941
|
+
const hookProblems = (file, source) => pipe(decodeSettings$1(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.filter((event) => event !== SETUP_EVENT), Array$1.map((event) => {
|
|
15942
|
+
const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
|
|
15943
|
+
return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
|
|
15944
|
+
onNone: () => problemInFile(RULE$39)(file, message),
|
|
15945
|
+
onSome: (index) => problemAtIndex(RULE$39)(file, source)(index, message)
|
|
15946
|
+
}));
|
|
15947
|
+
}));
|
|
15948
|
+
const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* checkProjectExtensions(root) {
|
|
15949
|
+
const files = yield* RepositoryFiles;
|
|
15950
|
+
const settingsFile = files.join(root, SETTINGS_FILE$1);
|
|
15951
|
+
const settings = yield* files.readFile(settingsFile);
|
|
15952
|
+
const tracked = yield* files.trackedFiles(root, EXTENSION_DIRECTORIES);
|
|
15953
|
+
const extensionProblems = pipe(tracked, Array$1.filter((name) => pipe(EXTENSION_DIRECTORIES, Array$1.some((directory) => String$1.startsWith(directory)(name)))), Array$1.map((name) => problemInFile(RULE$39)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
|
|
15954
|
+
return [...Option.match(settings, {
|
|
15955
|
+
onNone: () => [],
|
|
15956
|
+
onSome: (source) => hookProblems(settingsFile, source)
|
|
15957
|
+
}), ...extensionProblems];
|
|
15958
|
+
});
|
|
15927
15959
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
15928
15960
|
const SUCCESS$5 = 0;
|
|
15929
15961
|
const PackageSchema = Schema.Struct({ name: Schema.optional(Schema.String) });
|
|
@@ -16547,6 +16579,7 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
16547
16579
|
checkVitePlus(root),
|
|
16548
16580
|
checkMissingHooks(root),
|
|
16549
16581
|
checkKnownPlugins(root),
|
|
16582
|
+
checkProjectExtensions(root),
|
|
16550
16583
|
checkShellScripts(root),
|
|
16551
16584
|
checkCiDrift(root),
|
|
16552
16585
|
checkReleasePlease(root),
|