@r_masseater/msch 0.120.11 → 0.120.12
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 +227 -267
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/msch-checks/SKILL.md +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -47,7 +47,7 @@ import { Buffer } from "node:buffer";
|
|
|
47
47
|
import { createZstdDecompress } from "node:zlib";
|
|
48
48
|
// package.json
|
|
49
49
|
var name = "@r_masseater/msch";
|
|
50
|
-
var version = "0.120.
|
|
50
|
+
var version = "0.120.12";
|
|
51
51
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
52
52
|
var repository = {
|
|
53
53
|
"type": "git",
|
|
@@ -1065,7 +1065,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1065
1065
|
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;
|
|
1066
1066
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1067
1067
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1068
|
-
const READ_CONCURRENCY$
|
|
1068
|
+
const READ_CONCURRENCY$41 = 64;
|
|
1069
1069
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1070
1070
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1071
1071
|
/** @internal */
|
|
@@ -1088,18 +1088,18 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1088
1088
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1089
1089
|
onNone: () => [],
|
|
1090
1090
|
onSome: (source) => foundIn(entry, source)
|
|
1091
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1091
|
+
}))), { concurrency: READ_CONCURRENCY$41 });
|
|
1092
1092
|
return Array$1.flatten(found);
|
|
1093
1093
|
});
|
|
1094
1094
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1095
1095
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1096
1096
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1097
|
-
const RULE$
|
|
1097
|
+
const RULE$80 = "git-subpath-dependency";
|
|
1098
1098
|
const WHOLE_MATCH$4 = 0;
|
|
1099
1099
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1100
1100
|
file,
|
|
1101
1101
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1102
|
-
rule: RULE$
|
|
1102
|
+
rule: RULE$80,
|
|
1103
1103
|
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])}\`.`
|
|
1104
1104
|
});
|
|
1105
1105
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1110,13 +1110,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1110
1110
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1111
1111
|
});
|
|
1112
1112
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1113
|
-
const RULE$
|
|
1113
|
+
const RULE$79 = "unnamed-restriction";
|
|
1114
1114
|
const WHOLE_MATCH$3 = 0;
|
|
1115
1115
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1116
1116
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1117
1117
|
file: entry.file,
|
|
1118
1118
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1119
|
-
rule: RULE$
|
|
1119
|
+
rule: RULE$79,
|
|
1120
1120
|
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.`
|
|
1121
1121
|
})));
|
|
1122
1122
|
/** @internal */
|
|
@@ -1125,13 +1125,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1125
1125
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1126
1126
|
});
|
|
1127
1127
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1128
|
-
const RULE$
|
|
1128
|
+
const RULE$78 = "named-type-exemption";
|
|
1129
1129
|
const WHOLE_MATCH$2 = 0;
|
|
1130
1130
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1131
1131
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1132
1132
|
file: entry.file,
|
|
1133
1133
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1134
|
-
rule: RULE$
|
|
1134
|
+
rule: RULE$78,
|
|
1135
1135
|
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."
|
|
1136
1136
|
})));
|
|
1137
1137
|
/** @internal */
|
|
@@ -1147,7 +1147,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1147
1147
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1148
1148
|
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)))));
|
|
1149
1149
|
// src/features/check-overrides/model/package-registry.ts
|
|
1150
|
-
const RULE$
|
|
1150
|
+
const RULE$77 = "package-registry";
|
|
1151
1151
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1152
1152
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1153
1153
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
@@ -1161,7 +1161,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
1161
1161
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1162
1162
|
file,
|
|
1163
1163
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1164
|
-
rule: RULE$
|
|
1164
|
+
rule: RULE$77,
|
|
1165
1165
|
message: Option.match(registry, {
|
|
1166
1166
|
onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1167
1167
|
onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1170,7 +1170,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1170
1170
|
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) => ({
|
|
1171
1171
|
file: entry.file,
|
|
1172
1172
|
...positionOf(source)(found.index ?? START$34),
|
|
1173
|
-
rule: RULE$
|
|
1173
|
+
rule: RULE$77,
|
|
1174
1174
|
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$34])}\`. Remove the line.`
|
|
1175
1175
|
})));
|
|
1176
1176
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -1248,7 +1248,7 @@ const SELF_HOMEPAGE = homepage;
|
|
|
1248
1248
|
const SELF_DIRECTORY = repository.directory;
|
|
1249
1249
|
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`;
|
|
1250
1250
|
// src/features/check-overrides/model/removed-peers.ts
|
|
1251
|
-
const RULE$
|
|
1251
|
+
const RULE$76 = "removed-peer";
|
|
1252
1252
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
1253
1253
|
const REMOVED = "-";
|
|
1254
1254
|
const PARENT_SEPARATOR = ">";
|
|
@@ -1258,7 +1258,7 @@ const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(S
|
|
|
1258
1258
|
onNone: () => selector,
|
|
1259
1259
|
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
1260
1260
|
}));
|
|
1261
|
-
const removalOf
|
|
1261
|
+
const removalOf = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
1262
1262
|
onEmpty: () => Option.none(),
|
|
1263
1263
|
onNonEmpty: (parents, target) => Option.some({
|
|
1264
1264
|
key,
|
|
@@ -1275,12 +1275,12 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1275
1275
|
file,
|
|
1276
1276
|
line,
|
|
1277
1277
|
column,
|
|
1278
|
-
rule: RULE$
|
|
1278
|
+
rule: RULE$76,
|
|
1279
1279
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
1280
1280
|
});
|
|
1281
1281
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
1282
1282
|
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
1283
|
-
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf
|
|
1283
|
+
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)));
|
|
1284
1284
|
const requiredPeersOf$1 = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
1285
1285
|
peer,
|
|
1286
1286
|
dependent
|
|
@@ -3416,7 +3416,7 @@ const matcher = (patterns) => {
|
|
|
3416
3416
|
String$1.startsWith(NEGATION$1);
|
|
3417
3417
|
String$1.slice(1);
|
|
3418
3418
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3419
|
-
const RULE$
|
|
3419
|
+
const RULE$75 = "colocated-git-patterns";
|
|
3420
3420
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3421
3421
|
const ROOT$3 = ".";
|
|
3422
3422
|
const NEGATION = "!";
|
|
@@ -3427,7 +3427,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
3427
3427
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3428
3428
|
const SPACES = /\s+/u;
|
|
3429
3429
|
const FIRST$26 = 1;
|
|
3430
|
-
const READ_CONCURRENCY$
|
|
3430
|
+
const READ_CONCURRENCY$40 = 16;
|
|
3431
3431
|
const withoutPrefix = (prefix, text) => {
|
|
3432
3432
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3433
3433
|
return text;
|
|
@@ -3463,7 +3463,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3463
3463
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3464
3464
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3465
3465
|
});
|
|
3466
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3466
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$75)(entry.file, {
|
|
3467
3467
|
line: entry.line,
|
|
3468
3468
|
column: FIRST$26
|
|
3469
3469
|
}, message);
|
|
@@ -3518,17 +3518,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3518
3518
|
/** @internal */
|
|
3519
3519
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3520
3520
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3521
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3521
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$40 });
|
|
3522
3522
|
const entries = Array$1.flatten(read);
|
|
3523
3523
|
const workspaces = yield* workspaceDirectories(root);
|
|
3524
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3524
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$40 });
|
|
3525
3525
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3526
3526
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3527
3527
|
});
|
|
3528
3528
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3529
|
-
const RULE$
|
|
3529
|
+
const RULE$74 = "colocated-test";
|
|
3530
3530
|
const FIRST$25 = 1;
|
|
3531
|
-
const READ_CONCURRENCY$
|
|
3531
|
+
const READ_CONCURRENCY$39 = 64;
|
|
3532
3532
|
const ROOT_SUBPATH$2 = ".";
|
|
3533
3533
|
const NAME_GROUP$2 = "name";
|
|
3534
3534
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3549,7 +3549,7 @@ const problemFor$11 = (test, message) => ({
|
|
|
3549
3549
|
file: test.file,
|
|
3550
3550
|
line: FIRST$25,
|
|
3551
3551
|
column: FIRST$25,
|
|
3552
|
-
rule: RULE$
|
|
3552
|
+
rule: RULE$74,
|
|
3553
3553
|
message: `${test.base} ${message}`
|
|
3554
3554
|
});
|
|
3555
3555
|
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);
|
|
@@ -3612,12 +3612,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3612
3612
|
directory: files.dirname(file)
|
|
3613
3613
|
};
|
|
3614
3614
|
}));
|
|
3615
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3615
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$39 });
|
|
3616
3616
|
return Array$1.getSomes(found);
|
|
3617
3617
|
});
|
|
3618
3618
|
// src/shared/lib/agent-docs.ts
|
|
3619
3619
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3620
|
-
const READ_CONCURRENCY$
|
|
3620
|
+
const READ_CONCURRENCY$38 = 16;
|
|
3621
3621
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3622
3622
|
const files = yield* RepositoryFiles;
|
|
3623
3623
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3626,13 +3626,13 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3626
3626
|
const file = files.join(root, name);
|
|
3627
3627
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3628
3628
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3629
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3629
|
+
}, { concurrency: READ_CONCURRENCY$38 });
|
|
3630
3630
|
return Array$1.getSomes(found);
|
|
3631
3631
|
});
|
|
3632
3632
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3633
3633
|
const RECOMMENDED_LINES = 200;
|
|
3634
3634
|
const FIRST$24 = 1;
|
|
3635
|
-
const RULE$
|
|
3635
|
+
const RULE$73 = "agent-docs-length";
|
|
3636
3636
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3637
3637
|
const problemFor$10 = (file) => (lines) => {
|
|
3638
3638
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3640,18 +3640,18 @@ const problemFor$10 = (file) => (lines) => {
|
|
|
3640
3640
|
file,
|
|
3641
3641
|
line: 201,
|
|
3642
3642
|
column: FIRST$24,
|
|
3643
|
-
rule: RULE$
|
|
3643
|
+
rule: RULE$73,
|
|
3644
3644
|
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.`
|
|
3645
3645
|
});
|
|
3646
3646
|
};
|
|
3647
3647
|
/** @internal */
|
|
3648
3648
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
|
|
3649
3649
|
// src/features/check-placement/model/claude-link.ts
|
|
3650
|
-
const RULE$
|
|
3650
|
+
const RULE$72 = "claude-md-link";
|
|
3651
3651
|
const CLAUDE = "CLAUDE.md";
|
|
3652
3652
|
const AGENTS = "AGENTS.md";
|
|
3653
3653
|
const FIRST$23 = 1;
|
|
3654
|
-
const READ_CONCURRENCY$
|
|
3654
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3655
3655
|
const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3656
3656
|
/** @internal */
|
|
3657
3657
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3666,19 +3666,19 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3666
3666
|
file: path,
|
|
3667
3667
|
line: FIRST$23,
|
|
3668
3668
|
column: FIRST$23,
|
|
3669
|
-
rule: RULE$
|
|
3669
|
+
rule: RULE$72,
|
|
3670
3670
|
message: MESSAGE$15
|
|
3671
3671
|
})));
|
|
3672
3672
|
});
|
|
3673
3673
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3674
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3674
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$37 });
|
|
3675
3675
|
return Array$1.getSomes(found);
|
|
3676
3676
|
});
|
|
3677
3677
|
// src/features/check-placement/model/dangling-links.ts
|
|
3678
|
-
const RULE$
|
|
3678
|
+
const RULE$71 = "dangling-link";
|
|
3679
3679
|
const SEPARATOR$26 = "/";
|
|
3680
3680
|
const FIRST$22 = 1;
|
|
3681
|
-
const READ_CONCURRENCY$
|
|
3681
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3682
3682
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$26}`)(name);
|
|
3683
3683
|
/** @internal */
|
|
3684
3684
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -3691,11 +3691,11 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3691
3691
|
file,
|
|
3692
3692
|
line: FIRST$22,
|
|
3693
3693
|
column: FIRST$22,
|
|
3694
|
-
rule: RULE$
|
|
3694
|
+
rule: RULE$71,
|
|
3695
3695
|
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.`
|
|
3696
3696
|
})));
|
|
3697
3697
|
});
|
|
3698
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3698
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$36 });
|
|
3699
3699
|
return Array$1.getSomes(found);
|
|
3700
3700
|
});
|
|
3701
3701
|
// src/features/check-placement/model/member-sources.ts
|
|
@@ -3749,9 +3749,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3749
3749
|
}));
|
|
3750
3750
|
});
|
|
3751
3751
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3752
|
-
const RULE$
|
|
3752
|
+
const RULE$70 = "deployed-readme";
|
|
3753
3753
|
const ROOT_DIRECTORY$4 = "";
|
|
3754
|
-
const READ_CONCURRENCY$
|
|
3754
|
+
const READ_CONCURRENCY$35 = 16;
|
|
3755
3755
|
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.";
|
|
3756
3756
|
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.";
|
|
3757
3757
|
const ADDRESS_KEYS = [
|
|
@@ -3789,14 +3789,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3789
3789
|
const readme = yield* readReadme({
|
|
3790
3790
|
root,
|
|
3791
3791
|
directory,
|
|
3792
|
-
rule: RULE$
|
|
3792
|
+
rule: RULE$70,
|
|
3793
3793
|
missingMessage: MISSING_MESSAGE$2
|
|
3794
3794
|
});
|
|
3795
3795
|
return Result.match(readme, {
|
|
3796
3796
|
onFailure: Option.some,
|
|
3797
3797
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3798
3798
|
file,
|
|
3799
|
-
rule: RULE$
|
|
3799
|
+
rule: RULE$70,
|
|
3800
3800
|
message: NO_URL_MESSAGE
|
|
3801
3801
|
})))
|
|
3802
3802
|
});
|
|
@@ -3807,16 +3807,16 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3807
3807
|
const listed = yield* files.listedFiles(root);
|
|
3808
3808
|
const directories = yield* workspaceDirectories(root);
|
|
3809
3809
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3810
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3810
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$35 });
|
|
3811
3811
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3812
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3812
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$35 });
|
|
3813
3813
|
return Array$1.getSomes(found);
|
|
3814
3814
|
});
|
|
3815
3815
|
// src/features/check-placement/model/nested-docs.ts
|
|
3816
|
-
const RULE$
|
|
3816
|
+
const RULE$69 = "nested-docs";
|
|
3817
3817
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3818
3818
|
const SEPARATOR$24 = "/";
|
|
3819
|
-
const READ_CONCURRENCY$
|
|
3819
|
+
const READ_CONCURRENCY$34 = 64;
|
|
3820
3820
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3821
3821
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3822
3822
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -3826,7 +3826,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3826
3826
|
const taggedError$13 = Schema.TaggedError;
|
|
3827
3827
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3828
3828
|
const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
|
|
3829
|
-
const problemFor$9 = problemInFile(RULE$
|
|
3829
|
+
const problemFor$9 = problemInFile(RULE$69);
|
|
3830
3830
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3831
3831
|
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.";
|
|
3832
3832
|
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.";
|
|
@@ -3873,7 +3873,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3873
3873
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3874
3874
|
workspaceAgentDocs
|
|
3875
3875
|
};
|
|
3876
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3876
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$34 });
|
|
3877
3877
|
const missing = missingProblems({
|
|
3878
3878
|
required: workspaceAgentDocs,
|
|
3879
3879
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3883,15 +3883,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3883
3883
|
return [...Array$1.getSomes(found), ...missing];
|
|
3884
3884
|
});
|
|
3885
3885
|
// src/features/check-placement/model/published-readme.ts
|
|
3886
|
-
const RULE$
|
|
3887
|
-
const READ_CONCURRENCY$
|
|
3886
|
+
const RULE$68 = "published-readme";
|
|
3887
|
+
const READ_CONCURRENCY$33 = 16;
|
|
3888
3888
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3889
3889
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3890
3890
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3891
3891
|
const readme = yield* readReadme({
|
|
3892
3892
|
root,
|
|
3893
3893
|
directory,
|
|
3894
|
-
rule: RULE$
|
|
3894
|
+
rule: RULE$68,
|
|
3895
3895
|
missingMessage: MISSING_MESSAGE
|
|
3896
3896
|
});
|
|
3897
3897
|
return Result.match(readme, {
|
|
@@ -3902,7 +3902,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3902
3902
|
file,
|
|
3903
3903
|
line,
|
|
3904
3904
|
column,
|
|
3905
|
-
rule: RULE$
|
|
3905
|
+
rule: RULE$68,
|
|
3906
3906
|
message: MESSAGE$14
|
|
3907
3907
|
};
|
|
3908
3908
|
}))
|
|
@@ -3911,11 +3911,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3911
3911
|
/** @internal */
|
|
3912
3912
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3913
3913
|
const projects = yield* publishedProjects(root);
|
|
3914
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3914
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$33 });
|
|
3915
3915
|
return Array$1.getSomes(found);
|
|
3916
3916
|
});
|
|
3917
3917
|
// src/features/check-placement/model/published-tests.ts
|
|
3918
|
-
const RULE$
|
|
3918
|
+
const RULE$67 = "published-tests";
|
|
3919
3919
|
const FILE_START = 1;
|
|
3920
3920
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3921
3921
|
const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3929,7 +3929,7 @@ const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3929
3929
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3930
3930
|
line: FILE_START,
|
|
3931
3931
|
column: FILE_START,
|
|
3932
|
-
rule: RULE$
|
|
3932
|
+
rule: RULE$67,
|
|
3933
3933
|
message: MESSAGE$13
|
|
3934
3934
|
});
|
|
3935
3935
|
});
|
|
@@ -3943,7 +3943,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3943
3943
|
return Array$1.getSomes(found);
|
|
3944
3944
|
});
|
|
3945
3945
|
// src/features/check-placement/model/root-docs.ts
|
|
3946
|
-
const RULE$
|
|
3946
|
+
const RULE$66 = "root-docs";
|
|
3947
3947
|
const SEPARATOR$23 = "/";
|
|
3948
3948
|
const FIRST$20 = 1;
|
|
3949
3949
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
@@ -3958,14 +3958,14 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3958
3958
|
file: files.join(root, name),
|
|
3959
3959
|
line: FIRST$20,
|
|
3960
3960
|
column: FIRST$20,
|
|
3961
|
-
rule: RULE$
|
|
3961
|
+
rule: RULE$66,
|
|
3962
3962
|
message: `${name} ${MESSAGE$12}`
|
|
3963
3963
|
})));
|
|
3964
3964
|
});
|
|
3965
3965
|
// src/features/check-placement/model/root-readme.ts
|
|
3966
|
-
const RULE$
|
|
3966
|
+
const RULE$65 = "root-readme";
|
|
3967
3967
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3968
|
-
const READ_CONCURRENCY$
|
|
3968
|
+
const READ_CONCURRENCY$32 = 16;
|
|
3969
3969
|
const START$32 = 0;
|
|
3970
3970
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3971
3971
|
const RELATIVE$4 = /^\.\//u;
|
|
@@ -4006,7 +4006,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4006
4006
|
const message = messageFor$5(workspace.directory);
|
|
4007
4007
|
const at = positionOf(source);
|
|
4008
4008
|
const pattern = patternFor(plugins)(workspace);
|
|
4009
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4009
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$65)(file, at(found.index ?? START$32), message)));
|
|
4010
4010
|
};
|
|
4011
4011
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4012
4012
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4023,7 +4023,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4023
4023
|
const named = yield* namedWorkspaces(root);
|
|
4024
4024
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4025
4025
|
const plugins = yield* marketplacePlugins(root);
|
|
4026
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4026
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$32 });
|
|
4027
4027
|
return Array$1.flatten(found);
|
|
4028
4028
|
});
|
|
4029
4029
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4043,10 +4043,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4043
4043
|
return Array$1.flatten(found);
|
|
4044
4044
|
});
|
|
4045
4045
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4046
|
-
const RULE$
|
|
4046
|
+
const RULE$64 = "docs-mirror";
|
|
4047
4047
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4048
4048
|
const MIRROR_LIMIT = 3;
|
|
4049
|
-
const READ_CONCURRENCY$
|
|
4049
|
+
const READ_CONCURRENCY$31 = 16;
|
|
4050
4050
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4051
4051
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4052
4052
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4068,7 +4068,7 @@ const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4068
4068
|
file,
|
|
4069
4069
|
line,
|
|
4070
4070
|
column,
|
|
4071
|
-
rule: RULE$
|
|
4071
|
+
rule: RULE$64,
|
|
4072
4072
|
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.`
|
|
4073
4073
|
};
|
|
4074
4074
|
}), Option.toArray);
|
|
@@ -4083,7 +4083,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4083
4083
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4084
4084
|
directory,
|
|
4085
4085
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4086
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4086
|
+
}))), { concurrency: READ_CONCURRENCY$31 });
|
|
4087
4087
|
});
|
|
4088
4088
|
/** @internal */
|
|
4089
4089
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4096,11 +4096,11 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4096
4096
|
onNone: () => [],
|
|
4097
4097
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4098
4098
|
})));
|
|
4099
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4099
|
+
}, { concurrency: READ_CONCURRENCY$31 });
|
|
4100
4100
|
return Array$1.flatten(found);
|
|
4101
4101
|
});
|
|
4102
4102
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4103
|
-
const RULE$
|
|
4103
|
+
const RULE$63 = "ignored-sources";
|
|
4104
4104
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4105
4105
|
const FIRST$19 = 1;
|
|
4106
4106
|
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.";
|
|
@@ -4112,7 +4112,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4112
4112
|
file: files.join(root, file),
|
|
4113
4113
|
line: FIRST$19,
|
|
4114
4114
|
column: FIRST$19,
|
|
4115
|
-
rule: RULE$
|
|
4115
|
+
rule: RULE$63,
|
|
4116
4116
|
message: MESSAGE$11
|
|
4117
4117
|
})));
|
|
4118
4118
|
});
|
|
@@ -12789,7 +12789,7 @@ const LAYER_ITEMS = [
|
|
|
12789
12789
|
"attribute_item",
|
|
12790
12790
|
"inner_attribute_item"
|
|
12791
12791
|
];
|
|
12792
|
-
const READ_CONCURRENCY$
|
|
12792
|
+
const READ_CONCURRENCY$30 = 64;
|
|
12793
12793
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12794
12794
|
const NONE$4 = [];
|
|
12795
12795
|
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.";
|
|
@@ -12865,17 +12865,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12865
12865
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
12866
12866
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
12867
12867
|
const parse = parsedWith(language);
|
|
12868
|
-
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$
|
|
12868
|
+
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$30 });
|
|
12869
12869
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12870
12870
|
});
|
|
12871
12871
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12872
|
-
const RULE$
|
|
12872
|
+
const RULE$62 = "shadcn-ui-alias";
|
|
12873
12873
|
const FIRST$18 = 1;
|
|
12874
12874
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12875
12875
|
file,
|
|
12876
12876
|
line: FIRST$18,
|
|
12877
12877
|
column: FIRST$18,
|
|
12878
|
-
rule: RULE$
|
|
12878
|
+
rule: RULE$62,
|
|
12879
12879
|
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/*".`
|
|
12880
12880
|
});
|
|
12881
12881
|
/** @internal */
|
|
@@ -12939,7 +12939,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12939
12939
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12940
12940
|
const SEPARATOR$20 = "/";
|
|
12941
12941
|
const CURRENT = "./";
|
|
12942
|
-
const READ_CONCURRENCY$
|
|
12942
|
+
const READ_CONCURRENCY$29 = 8;
|
|
12943
12943
|
const FIRST$17 = 1;
|
|
12944
12944
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12945
12945
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -12981,7 +12981,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12981
12981
|
const files = yield* RepositoryFiles;
|
|
12982
12982
|
const listed = yield* files.listedFiles(root);
|
|
12983
12983
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
12984
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
12984
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$29 });
|
|
12985
12985
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12986
12986
|
});
|
|
12987
12987
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$20));
|
|
@@ -13044,9 +13044,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13044
13044
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13045
13045
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13046
13046
|
const workflows = yield* workflowText(root);
|
|
13047
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
13048
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13049
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13047
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$29 });
|
|
13048
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$29 });
|
|
13049
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$29 });
|
|
13050
13050
|
return [
|
|
13051
13051
|
...Array$1.flatten(found),
|
|
13052
13052
|
...Array$1.getSomes(scripts),
|
|
@@ -13143,26 +13143,26 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13143
13143
|
])));
|
|
13144
13144
|
});
|
|
13145
13145
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13146
|
-
const RULE$
|
|
13146
|
+
const RULE$61 = "config-path";
|
|
13147
13147
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13148
13148
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13149
13149
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13150
13150
|
const OUTSIDE = "..";
|
|
13151
|
-
const READ_CONCURRENCY$
|
|
13151
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13152
13152
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13153
13153
|
const files = yield* RepositoryFiles;
|
|
13154
13154
|
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)));
|
|
13155
13155
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13156
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13156
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$28 });
|
|
13157
13157
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13158
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13158
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$28 });
|
|
13159
13159
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13160
13160
|
});
|
|
13161
13161
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
13162
13162
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13163
13163
|
file,
|
|
13164
13164
|
...positionOf(source)(mention.index),
|
|
13165
|
-
rule: RULE$
|
|
13165
|
+
rule: RULE$61,
|
|
13166
13166
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13167
13167
|
});
|
|
13168
13168
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13175,7 +13175,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
13175
13175
|
const source = yield* files.readFile(file);
|
|
13176
13176
|
if (Option.isNone(source)) return [];
|
|
13177
13177
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13178
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13178
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$28 });
|
|
13179
13179
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13180
13180
|
});
|
|
13181
13181
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13187,7 +13187,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13187
13187
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13188
13188
|
file,
|
|
13189
13189
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13190
|
-
rule: RULE$
|
|
13190
|
+
rule: RULE$61,
|
|
13191
13191
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13192
13192
|
})));
|
|
13193
13193
|
});
|
|
@@ -13195,23 +13195,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13195
13195
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13196
13196
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13197
13197
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13198
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$
|
|
13198
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$28 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13199
13199
|
return [...Array$1.flatten(found), ...patterns];
|
|
13200
13200
|
});
|
|
13201
13201
|
// src/features/check-repository-layout/model/crates.ts
|
|
13202
|
-
const RULE$
|
|
13202
|
+
const RULE$60 = "unverified-crate";
|
|
13203
13203
|
const VERSION_RULE = "release-version";
|
|
13204
13204
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13205
13205
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13206
13206
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13207
13207
|
const SEPARATOR$18 = "/";
|
|
13208
13208
|
const FIRST$16 = 1;
|
|
13209
|
-
const READ_CONCURRENCY$
|
|
13209
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13210
13210
|
const problemFor$6 = (crate, message) => ({
|
|
13211
13211
|
file: crate.manifest,
|
|
13212
13212
|
line: FIRST$16,
|
|
13213
13213
|
column: FIRST$16,
|
|
13214
|
-
rule: RULE$
|
|
13214
|
+
rule: RULE$60,
|
|
13215
13215
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13216
13216
|
});
|
|
13217
13217
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13246,11 +13246,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13246
13246
|
const crates = yield* cratesIn(root);
|
|
13247
13247
|
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$8)));
|
|
13248
13248
|
const unverified = (crate) => problemIn$3(root, directories, crate).pipe(Effect.when(notAtRoot), Effect.map(Option.flatten));
|
|
13249
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13249
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$27 });
|
|
13250
13250
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13251
13251
|
});
|
|
13252
13252
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13253
|
-
const RULE$
|
|
13253
|
+
const RULE$59 = "deploy-entry-pattern";
|
|
13254
13254
|
const FALLOW_KEYS = [
|
|
13255
13255
|
"entry",
|
|
13256
13256
|
"entryPoints",
|
|
@@ -13268,7 +13268,7 @@ const NEGATED = "!";
|
|
|
13268
13268
|
const ROOT_WORKSPACE = ".";
|
|
13269
13269
|
const WRAP_OFFSET$1 = 1;
|
|
13270
13270
|
const NO_OFFSET = 0;
|
|
13271
|
-
const READ_CONCURRENCY$
|
|
13271
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13272
13272
|
const MESSAGE$10 = "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.";
|
|
13273
13273
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13274
13274
|
const FALLOW = {
|
|
@@ -13321,7 +13321,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13321
13321
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13322
13322
|
file: path,
|
|
13323
13323
|
...positionOf(text.value)(start - kind.offset),
|
|
13324
|
-
rule: RULE$
|
|
13324
|
+
rule: RULE$59,
|
|
13325
13325
|
message: `${pattern} ${MESSAGE$10}`
|
|
13326
13326
|
})));
|
|
13327
13327
|
});
|
|
@@ -13350,11 +13350,11 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13350
13350
|
kind,
|
|
13351
13351
|
workspaces,
|
|
13352
13352
|
entries
|
|
13353
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13353
|
+
}), { concurrency: READ_CONCURRENCY$26 });
|
|
13354
13354
|
return Array$1.flatten(found);
|
|
13355
13355
|
});
|
|
13356
13356
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13357
|
-
const RULE$
|
|
13357
|
+
const RULE$58 = "listed-entry";
|
|
13358
13358
|
const ENTRY_KEYS = [
|
|
13359
13359
|
"entry",
|
|
13360
13360
|
"entryPoints",
|
|
@@ -13364,7 +13364,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
13364
13364
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13365
13365
|
const SEPARATOR$17 = "/";
|
|
13366
13366
|
const WRAP_OFFSET = 1;
|
|
13367
|
-
const READ_CONCURRENCY$
|
|
13367
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13368
13368
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13369
13369
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13370
13370
|
const entryPatternsIn = (node) => {
|
|
@@ -13384,7 +13384,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13384
13384
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13385
13385
|
file: path,
|
|
13386
13386
|
...positionOf(text.value)(start),
|
|
13387
|
-
rule: RULE$
|
|
13387
|
+
rule: RULE$58,
|
|
13388
13388
|
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.`
|
|
13389
13389
|
})));
|
|
13390
13390
|
});
|
|
@@ -13392,11 +13392,11 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13392
13392
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13393
13393
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13394
13394
|
const directories = yield* workspaceDirectories(root);
|
|
13395
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
13395
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$25 });
|
|
13396
13396
|
return Array$1.flatten(found);
|
|
13397
13397
|
});
|
|
13398
13398
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13399
|
-
const RULE$
|
|
13399
|
+
const RULE$57 = "root-workspace-path";
|
|
13400
13400
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13401
13401
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13402
13402
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13415,7 +13415,7 @@ const mentions = (directory) => (text) => {
|
|
|
13415
13415
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13416
13416
|
file,
|
|
13417
13417
|
...positionOf(source)(found.start),
|
|
13418
|
-
rule: RULE$
|
|
13418
|
+
rule: RULE$57,
|
|
13419
13419
|
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.`
|
|
13420
13420
|
})));
|
|
13421
13421
|
/** @internal */
|
|
@@ -13429,10 +13429,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13429
13429
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13430
13430
|
});
|
|
13431
13431
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13432
|
-
const RULE$
|
|
13432
|
+
const RULE$56 = "hidden-verify";
|
|
13433
13433
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13434
13434
|
const FIRST$14 = 1;
|
|
13435
|
-
const READ_CONCURRENCY$
|
|
13435
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13436
13436
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13437
13437
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13438
13438
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13443,19 +13443,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13443
13443
|
file,
|
|
13444
13444
|
line: FIRST$14,
|
|
13445
13445
|
column: FIRST$14,
|
|
13446
|
-
rule: RULE$
|
|
13446
|
+
rule: RULE$56,
|
|
13447
13447
|
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}.`
|
|
13448
13448
|
}).pipe(Option.filter(() => verified));
|
|
13449
13449
|
});
|
|
13450
13450
|
/** @internal */
|
|
13451
13451
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13452
13452
|
const directories = yield* workspaceDirectories(root);
|
|
13453
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13453
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
13454
13454
|
return Array$1.getSomes(found);
|
|
13455
13455
|
});
|
|
13456
13456
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13457
|
-
const RULE$
|
|
13458
|
-
const READ_CONCURRENCY$
|
|
13457
|
+
const RULE$55 = "shared-uncached-task";
|
|
13458
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13459
13459
|
const SHARED = 2;
|
|
13460
13460
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13461
13461
|
const UncachedTask = Schema.Struct({
|
|
@@ -13497,19 +13497,19 @@ const problemsOf$3 = (definitions) => {
|
|
|
13497
13497
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13498
13498
|
file,
|
|
13499
13499
|
...position,
|
|
13500
|
-
rule: RULE$
|
|
13500
|
+
rule: RULE$55,
|
|
13501
13501
|
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.`
|
|
13502
13502
|
})));
|
|
13503
13503
|
};
|
|
13504
13504
|
/** @internal */
|
|
13505
13505
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13506
13506
|
const directories = yield* workspaceDirectories(root);
|
|
13507
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13507
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
13508
13508
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13509
13509
|
});
|
|
13510
13510
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13511
|
-
const RULE$
|
|
13512
|
-
const READ_CONCURRENCY$
|
|
13511
|
+
const RULE$54 = "tested-verify";
|
|
13512
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13513
13513
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13514
13514
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13515
13515
|
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
@@ -13537,19 +13537,19 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13537
13537
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13538
13538
|
file,
|
|
13539
13539
|
...positionOf(source)(at.start),
|
|
13540
|
-
rule: RULE$
|
|
13540
|
+
rule: RULE$54,
|
|
13541
13541
|
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.`
|
|
13542
13542
|
})))));
|
|
13543
13543
|
});
|
|
13544
13544
|
/** @internal */
|
|
13545
13545
|
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13546
13546
|
const directories = yield* workspaceDirectories(root);
|
|
13547
|
-
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13547
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
13548
13548
|
return Array$1.flatten(found);
|
|
13549
13549
|
});
|
|
13550
13550
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13551
|
-
const RULE$
|
|
13552
|
-
const READ_CONCURRENCY$
|
|
13551
|
+
const RULE$53 = "unlocked-task";
|
|
13552
|
+
const READ_CONCURRENCY$21 = 8;
|
|
13553
13553
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13554
13554
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13555
13555
|
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))));
|
|
@@ -13560,13 +13560,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13560
13560
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13561
13561
|
file,
|
|
13562
13562
|
...positionOf(source)(task.start),
|
|
13563
|
-
rule: RULE$
|
|
13563
|
+
rule: RULE$53,
|
|
13564
13564
|
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.`
|
|
13565
13565
|
})), Option.toArray)));
|
|
13566
13566
|
/** @internal */
|
|
13567
13567
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13568
13568
|
const directories = yield* workspaceDirectories(root);
|
|
13569
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13569
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$21 });
|
|
13570
13570
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13571
13571
|
});
|
|
13572
13572
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13876,12 +13876,12 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13876
13876
|
return yield* files.mergeBase(root, base);
|
|
13877
13877
|
});
|
|
13878
13878
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13879
|
-
const RULE$
|
|
13879
|
+
const RULE$52 = "migration-order";
|
|
13880
13880
|
const SNAPSHOT = "snapshot.json";
|
|
13881
13881
|
const MIGRATION = "migration.sql";
|
|
13882
13882
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
13883
13883
|
const FIRST$13 = 1;
|
|
13884
|
-
const READ_CONCURRENCY$
|
|
13884
|
+
const READ_CONCURRENCY$20 = 16;
|
|
13885
13885
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
13886
13886
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
13887
13887
|
const files = yield* RepositoryFiles;
|
|
@@ -13910,7 +13910,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13910
13910
|
file: join(root, file),
|
|
13911
13911
|
line: FIRST$13,
|
|
13912
13912
|
column: FIRST$13,
|
|
13913
|
-
rule: RULE$
|
|
13913
|
+
rule: RULE$52,
|
|
13914
13914
|
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}.`
|
|
13915
13915
|
})))), Option.getOrElse(() => []));
|
|
13916
13916
|
/** @internal */
|
|
@@ -13921,7 +13921,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
13921
13921
|
if (Option.isNone(found)) return [];
|
|
13922
13922
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
13923
13923
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
13924
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
13924
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$20 });
|
|
13925
13925
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
13926
13926
|
});
|
|
13927
13927
|
// src/shared/lib/bundle-error.ts
|
|
@@ -14013,7 +14013,7 @@ const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
|
|
|
14013
14013
|
return pipe(output.output, Array$1.filter(isChunk$2), Array$1.map((chunk) => [chunk.fileName, chunk.code]), Record.fromEntries, Record.set(`${request.name}.d.ts`, `export * from "${request.name}";\n`));
|
|
14014
14014
|
});
|
|
14015
14015
|
// src/features/check-mod-vendor/model/mod-vendor.ts
|
|
14016
|
-
const RULE$
|
|
14016
|
+
const RULE$51 = "mod-vendor";
|
|
14017
14017
|
const VENDOR = "vendor";
|
|
14018
14018
|
const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
|
|
14019
14019
|
const RELATIVE$1 = /^\.\.?\//u;
|
|
@@ -14021,7 +14021,7 @@ const FILE_LIMIT = 1048576;
|
|
|
14021
14021
|
const TOTAL_LIMIT = 8388608;
|
|
14022
14022
|
const CONCURRENCY$5 = 4;
|
|
14023
14023
|
const EMPTY$3 = "";
|
|
14024
|
-
const problemFor$5 = problemInFile(RULE$
|
|
14024
|
+
const problemFor$5 = problemInFile(RULE$51);
|
|
14025
14025
|
const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
|
|
14026
14026
|
const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
|
|
14027
14027
|
const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
|
|
@@ -14127,7 +14127,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
14127
14127
|
catch: bundleErrorDetail
|
|
14128
14128
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
14129
14129
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
14130
|
-
const RULE$
|
|
14130
|
+
const RULE$50 = "plugin-dependencies";
|
|
14131
14131
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
14132
14132
|
const LOCK_FILE = "bun.lock";
|
|
14133
14133
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
@@ -14136,7 +14136,7 @@ const SUCCESS$6 = 0;
|
|
|
14136
14136
|
const NOT_STARTED = -1;
|
|
14137
14137
|
const DETAIL_LINES = 3;
|
|
14138
14138
|
const PLUGIN_CONCURRENCY = 2;
|
|
14139
|
-
const problemFor$4 = problemInFile(RULE$
|
|
14139
|
+
const problemFor$4 = problemInFile(RULE$50);
|
|
14140
14140
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
14141
14141
|
const files = yield* RepositoryFiles;
|
|
14142
14142
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -14365,7 +14365,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
14365
14365
|
});
|
|
14366
14366
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
14367
14367
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14368
|
-
const RULE$
|
|
14368
|
+
const RULE$49 = "optional-peer";
|
|
14369
14369
|
const REQUIRED_RULE = "required-peer";
|
|
14370
14370
|
const START$28 = 0;
|
|
14371
14371
|
const SINGLE$3 = 1;
|
|
@@ -14382,7 +14382,7 @@ const positionIn = (located, key, name) => {
|
|
|
14382
14382
|
const problemFor$3 = (located, name, importers) => ({
|
|
14383
14383
|
file: located.file,
|
|
14384
14384
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
14385
|
-
rule: RULE$
|
|
14385
|
+
rule: RULE$49,
|
|
14386
14386
|
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.`
|
|
14387
14387
|
});
|
|
14388
14388
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -14418,7 +14418,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14418
14418
|
}));
|
|
14419
14419
|
};
|
|
14420
14420
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14421
|
-
const RULE$
|
|
14421
|
+
const RULE$48 = "side-effects";
|
|
14422
14422
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14423
14423
|
const START$27 = 0;
|
|
14424
14424
|
const FIRST$12 = 1;
|
|
@@ -14464,34 +14464,34 @@ const othersOf = (total) => {
|
|
|
14464
14464
|
if (total <= FIRST$12) return "";
|
|
14465
14465
|
return ` The same happens for ${String(total - FIRST$12)} other exports.`;
|
|
14466
14466
|
};
|
|
14467
|
-
const messageOf$
|
|
14467
|
+
const messageOf$5 = (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.`;
|
|
14468
14468
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14469
14469
|
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$27));
|
|
14470
14470
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14471
14471
|
file,
|
|
14472
14472
|
...positionOf(source)(keyIndex$1(source)),
|
|
14473
|
-
rule: RULE$
|
|
14474
|
-
message: messageOf$
|
|
14473
|
+
rule: RULE$48,
|
|
14474
|
+
message: messageOf$5(worst, excesses.length)
|
|
14475
14475
|
})), Option.toArray);
|
|
14476
14476
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14477
|
-
const RULE$
|
|
14477
|
+
const RULE$47 = "top-level-effect";
|
|
14478
14478
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14479
|
-
const READ_CONCURRENCY$
|
|
14479
|
+
const READ_CONCURRENCY$19 = 16;
|
|
14480
14480
|
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.";
|
|
14481
14481
|
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.";
|
|
14482
14482
|
const isEffect = (statement) => {
|
|
14483
14483
|
if (isExpressionStatement(statement)) return !isStringLiteral(statement.expression);
|
|
14484
14484
|
return isImportDeclaration(statement) && Predicate.isUndefined(statement.importClause);
|
|
14485
14485
|
};
|
|
14486
|
-
const messageOf$
|
|
14486
|
+
const messageOf$4 = (statement) => {
|
|
14487
14487
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
14488
14488
|
return STATEMENT_MESSAGE;
|
|
14489
14489
|
};
|
|
14490
14490
|
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14491
14491
|
const retained = api.createSourceFile(file, source);
|
|
14492
14492
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14493
|
-
rule: RULE$
|
|
14494
|
-
message: messageOf$
|
|
14493
|
+
rule: RULE$47,
|
|
14494
|
+
message: messageOf$4(statement)
|
|
14495
14495
|
})(statement)));
|
|
14496
14496
|
retained.dispose();
|
|
14497
14497
|
return problems;
|
|
@@ -14503,7 +14503,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14503
14503
|
const names = yield* files.ownedFiles(root);
|
|
14504
14504
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14505
14505
|
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
14506
|
-
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$
|
|
14506
|
+
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$19 });
|
|
14507
14507
|
return Array$1.flatten(found);
|
|
14508
14508
|
}, Effect.scoped);
|
|
14509
14509
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
@@ -14533,7 +14533,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14533
14533
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14534
14534
|
const ownedSet = new Set(owned);
|
|
14535
14535
|
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));
|
|
14536
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14536
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$19 });
|
|
14537
14537
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14538
14538
|
const index = nameIndex$1(located.source);
|
|
14539
14539
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14659,7 +14659,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
14659
14659
|
return Array$1.flatten(found);
|
|
14660
14660
|
});
|
|
14661
14661
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14662
|
-
const RULE$
|
|
14662
|
+
const RULE$46 = "legacy-typescript";
|
|
14663
14663
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14664
14664
|
const COMPILER = "typescript";
|
|
14665
14665
|
const CURRENT_MAJOR = 7;
|
|
@@ -14678,7 +14678,7 @@ const lineOf$4 = (source) => (id) => pipe(String$1.split(source, "\n"), Array$1.
|
|
|
14678
14678
|
onNone: () => FIRST$11,
|
|
14679
14679
|
onSome: (index) => index + FIRST$11
|
|
14680
14680
|
}));
|
|
14681
|
-
const messageOf$
|
|
14681
|
+
const messageOf$3 = (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)}.`;
|
|
14682
14682
|
/** @internal */
|
|
14683
14683
|
const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(function* checkTypescriptGeneration(root) {
|
|
14684
14684
|
const files = yield* RepositoryFiles;
|
|
@@ -14690,12 +14690,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14690
14690
|
file,
|
|
14691
14691
|
line: lineOf$4(source)(legacy.id),
|
|
14692
14692
|
column: FIRST$11,
|
|
14693
|
-
rule: RULE$
|
|
14694
|
-
message: messageOf$
|
|
14693
|
+
rule: RULE$46,
|
|
14694
|
+
message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14695
14695
|
})));
|
|
14696
14696
|
});
|
|
14697
14697
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14698
|
-
const RULE$
|
|
14698
|
+
const RULE$45 = "worker-bundle";
|
|
14699
14699
|
const BUNDLE_CONCURRENCY = 4;
|
|
14700
14700
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14701
14701
|
const CONDITIONS = [
|
|
@@ -14706,7 +14706,7 @@ const CONDITIONS = [
|
|
|
14706
14706
|
"module",
|
|
14707
14707
|
"default"
|
|
14708
14708
|
];
|
|
14709
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14709
|
+
const problemFor$2 = problemInFile(RULE$45);
|
|
14710
14710
|
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14711
14711
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14712
14712
|
const built = yield* Effect.tryPromise({
|
|
@@ -14899,7 +14899,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14899
14899
|
...secretWeakenings(config.h56m, expected.secrets)
|
|
14900
14900
|
];
|
|
14901
14901
|
// src/app/disabled-rules.ts
|
|
14902
|
-
const RULE$
|
|
14902
|
+
const RULE$44 = "disabled-rule";
|
|
14903
14903
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14904
14904
|
const START$25 = 0;
|
|
14905
14905
|
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;
|
|
@@ -14913,7 +14913,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14913
14913
|
const files = yield* RepositoryFiles;
|
|
14914
14914
|
const listed = yield* files.listedFiles(root);
|
|
14915
14915
|
const isExempt = matcher(exempt);
|
|
14916
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$
|
|
14916
|
+
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$44)(files.join(root, name), "")(START$25, SIDE_CONFIG_MESSAGE)));
|
|
14917
14917
|
});
|
|
14918
14918
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14919
14919
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14925,7 +14925,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14925
14925
|
})
|
|
14926
14926
|
});
|
|
14927
14927
|
const expected = yield* expectationsIn(root);
|
|
14928
|
-
const at = problemAtIndex(RULE$
|
|
14928
|
+
const at = problemAtIndex(RULE$44)(file, source);
|
|
14929
14929
|
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
|
|
14930
14930
|
});
|
|
14931
14931
|
/** @internal */
|
|
@@ -14933,7 +14933,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
|
|
|
14933
14933
|
const files = yield* RepositoryFiles;
|
|
14934
14934
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14935
14935
|
if (Option.isNone(text)) return [];
|
|
14936
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$
|
|
14936
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$44)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
14937
14937
|
});
|
|
14938
14938
|
// src/app/build-checks.ts
|
|
14939
14939
|
/** @internal */
|
|
@@ -15030,7 +15030,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
15030
15030
|
imports: importedFilesOf(checker)(sourceFile)
|
|
15031
15031
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
15032
15032
|
// src/features/check-value-owners/model/name-lists.ts
|
|
15033
|
-
const RULE$
|
|
15033
|
+
const RULE$43 = "hand-written-names";
|
|
15034
15034
|
const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
15035
15035
|
const nameListOf = (site) => {
|
|
15036
15036
|
if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -15045,7 +15045,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
15045
15045
|
file,
|
|
15046
15046
|
line,
|
|
15047
15047
|
column,
|
|
15048
|
-
rule: RULE$
|
|
15048
|
+
rule: RULE$43,
|
|
15049
15049
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
15050
15050
|
});
|
|
15051
15051
|
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
@@ -15836,9 +15836,9 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15836
15836
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
15837
15837
|
}, Effect.scoped);
|
|
15838
15838
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15839
|
-
const RULE$
|
|
15839
|
+
const RULE$42 = "namespace-destructuring";
|
|
15840
15840
|
const LOCAL = /^[.#/]/u;
|
|
15841
|
-
const messageOf$
|
|
15841
|
+
const messageOf$2 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
15842
15842
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
15843
15843
|
const importedNames = (sourceFile) => {
|
|
15844
15844
|
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);
|
|
@@ -15852,20 +15852,20 @@ const destructuredName = (declaration) => {
|
|
|
15852
15852
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15853
15853
|
};
|
|
15854
15854
|
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
|
|
15855
|
-
rule: RULE$
|
|
15856
|
-
message: messageOf$
|
|
15855
|
+
rule: RULE$42,
|
|
15856
|
+
message: messageOf$2(name)
|
|
15857
15857
|
})), Option.map((report) => report(declaration)));
|
|
15858
15858
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
15859
15859
|
const names = importedNames(sourceFile);
|
|
15860
15860
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15861
15861
|
};
|
|
15862
15862
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15863
|
-
const RULE$
|
|
15863
|
+
const RULE$41 = "pass-through-wrapper";
|
|
15864
15864
|
const SINGLE_STATEMENT = 1;
|
|
15865
15865
|
const SINGLE_DECLARATION = 1;
|
|
15866
15866
|
const THIS_PARAMETER = "this";
|
|
15867
15867
|
const NO_ARGUMENTS = [];
|
|
15868
|
-
const messageOf$
|
|
15868
|
+
const messageOf$1 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15869
15869
|
const unwrapped = (expression) => {
|
|
15870
15870
|
if (isParenthesizedExpression(expression)) return unwrapped(expression.expression);
|
|
15871
15871
|
return expression;
|
|
@@ -15957,8 +15957,8 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
15957
15957
|
const problemOf$7 = (checker) => (candidate) => {
|
|
15958
15958
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
15959
15959
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
|
|
15960
|
-
rule: RULE$
|
|
15961
|
-
message: messageOf$
|
|
15960
|
+
rule: RULE$41,
|
|
15961
|
+
message: messageOf$1(forward.callee.getText())
|
|
15962
15962
|
})(candidate.name)));
|
|
15963
15963
|
};
|
|
15964
15964
|
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$7(checker)), Array$1.getSomes);
|
|
@@ -15980,7 +15980,7 @@ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigi
|
|
|
15980
15980
|
/** @internal */
|
|
15981
15981
|
const slugOf = ({ owner, name }) => `${owner}/${name}`;
|
|
15982
15982
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
15983
|
-
const RULE$
|
|
15983
|
+
const RULE$40 = "known-plugins";
|
|
15984
15984
|
const SETTINGS_FILE$3 = ".claude/settings.json";
|
|
15985
15985
|
const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
|
|
15986
15986
|
const GITHUB$5 = "github";
|
|
@@ -16001,7 +16001,7 @@ const MarketplaceSchema = Schema.Struct({
|
|
|
16001
16001
|
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
16002
16002
|
});
|
|
16003
16003
|
const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
|
|
16004
|
-
const problem$5 = problemInFile(RULE$
|
|
16004
|
+
const problem$5 = problemInFile(RULE$40);
|
|
16005
16005
|
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));
|
|
16006
16006
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
16007
16007
|
const pluginProblems = (marketplace, file, settings) => {
|
|
@@ -16026,13 +16026,13 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
16026
16026
|
}));
|
|
16027
16027
|
});
|
|
16028
16028
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
16029
|
-
const RULE$
|
|
16029
|
+
const RULE$39 = "missing-hook";
|
|
16030
16030
|
const SETTINGS_FILE$2 = /^\.claude\/settings\.json$/u;
|
|
16031
16031
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
16032
16032
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16033
16033
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16034
16034
|
const PLUGIN_ROOT = "..";
|
|
16035
|
-
const READ_CONCURRENCY$
|
|
16035
|
+
const READ_CONCURRENCY$18 = 16;
|
|
16036
16036
|
const START$24 = 0;
|
|
16037
16037
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
16038
16038
|
path,
|
|
@@ -16051,7 +16051,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
16051
16051
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
16052
16052
|
file,
|
|
16053
16053
|
...positionOf(source)(index),
|
|
16054
|
-
rule: RULE$
|
|
16054
|
+
rule: RULE$39,
|
|
16055
16055
|
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.`
|
|
16056
16056
|
})));
|
|
16057
16057
|
});
|
|
@@ -16075,11 +16075,11 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
16075
16075
|
}];
|
|
16076
16076
|
return [];
|
|
16077
16077
|
}));
|
|
16078
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$
|
|
16078
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$18 });
|
|
16079
16079
|
return Array$1.flatten(found);
|
|
16080
16080
|
});
|
|
16081
16081
|
// src/features/check-agent-settings/model/project-extensions.ts
|
|
16082
|
-
const RULE$
|
|
16082
|
+
const RULE$38 = "project-claude-extensions";
|
|
16083
16083
|
const SETTINGS_FILE$1 = ".claude/settings.json";
|
|
16084
16084
|
const SETUP_EVENT = "SessionStart";
|
|
16085
16085
|
const EXTENSION_DIRECTORIES = [
|
|
@@ -16095,8 +16095,8 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
|
|
|
16095
16095
|
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) => {
|
|
16096
16096
|
const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
|
|
16097
16097
|
return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
|
|
16098
|
-
onNone: () => problemInFile(RULE$
|
|
16099
|
-
onSome: (index) => problemAtIndex(RULE$
|
|
16098
|
+
onNone: () => problemInFile(RULE$38)(file, message),
|
|
16099
|
+
onSome: (index) => problemAtIndex(RULE$38)(file, source)(index, message)
|
|
16100
16100
|
}));
|
|
16101
16101
|
}));
|
|
16102
16102
|
const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* checkProjectExtensions(root) {
|
|
@@ -16104,7 +16104,7 @@ const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* che
|
|
|
16104
16104
|
const settingsFile = files.join(root, SETTINGS_FILE$1);
|
|
16105
16105
|
const settings = yield* files.readFile(settingsFile);
|
|
16106
16106
|
const tracked = yield* files.trackedFiles(root, EXTENSION_DIRECTORIES);
|
|
16107
|
-
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$
|
|
16107
|
+
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$38)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
|
|
16108
16108
|
return [...Option.match(settings, {
|
|
16109
16109
|
onNone: () => [],
|
|
16110
16110
|
onSome: (source) => hookProblems(settingsFile, source)
|
|
@@ -16136,7 +16136,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
16136
16136
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
16137
16137
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
16138
16138
|
// src/features/check-documented-commands/model/commands.ts
|
|
16139
|
-
const RULE$
|
|
16139
|
+
const RULE$37 = "documented-commands";
|
|
16140
16140
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
16141
16141
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
16142
16142
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -16214,7 +16214,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
|
|
|
16214
16214
|
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 }) => ({
|
|
16215
16215
|
file: absolute(file),
|
|
16216
16216
|
...positionOf(text)(match.index ?? START$23),
|
|
16217
|
-
rule: RULE$
|
|
16217
|
+
rule: RULE$37,
|
|
16218
16218
|
message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
16219
16219
|
})), Option.toArray)));
|
|
16220
16220
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
@@ -16239,14 +16239,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16239
16239
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
16240
16240
|
line: ONE$2,
|
|
16241
16241
|
column: ONE$2,
|
|
16242
|
-
rule: RULE$
|
|
16242
|
+
rule: RULE$37,
|
|
16243
16243
|
message: "msch could not list the tasks with `vp run --json`"
|
|
16244
16244
|
}],
|
|
16245
16245
|
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
|
|
16246
16246
|
});
|
|
16247
16247
|
});
|
|
16248
16248
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
16249
|
-
const RULE$
|
|
16249
|
+
const RULE$36 = "legacy-web";
|
|
16250
16250
|
const FIRST_COLUMN$7 = 1;
|
|
16251
16251
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
16252
16252
|
const Finding = Schema.Struct({
|
|
@@ -16285,7 +16285,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16285
16285
|
file: files.join(root, file),
|
|
16286
16286
|
line,
|
|
16287
16287
|
column: FIRST_COLUMN$7,
|
|
16288
|
-
rule: RULE$
|
|
16288
|
+
rule: RULE$36,
|
|
16289
16289
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
16290
16290
|
});
|
|
16291
16291
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
@@ -16355,8 +16355,8 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
16355
16355
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
16356
16356
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
16357
16357
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16358
|
-
const READ_CONCURRENCY$
|
|
16359
|
-
const RULE$
|
|
16358
|
+
const READ_CONCURRENCY$17 = 64;
|
|
16359
|
+
const RULE$35 = "shell-script";
|
|
16360
16360
|
const MESSAGE$9 = "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.";
|
|
16361
16361
|
const HookSchema = Schema.Struct({
|
|
16362
16362
|
command: Schema.optional(Schema.String),
|
|
@@ -16388,8 +16388,8 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16388
16388
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16389
16389
|
};
|
|
16390
16390
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16391
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16392
|
-
return pipe(shell, Array$1.map((name) => problemInFile(RULE$
|
|
16391
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$17 });
|
|
16392
|
+
return pipe(shell, Array$1.map((name) => problemInFile(RULE$35)(files.join(root, name), MESSAGE$9)));
|
|
16393
16393
|
});
|
|
16394
16394
|
// src/features/check-structure/model/structure.ts
|
|
16395
16395
|
const checkStructure = checkSection({
|
|
@@ -16522,7 +16522,7 @@ const AGENT_DOCS = [
|
|
|
16522
16522
|
":(glob)**/CLAUDE.md",
|
|
16523
16523
|
...EXCLUDED$5
|
|
16524
16524
|
];
|
|
16525
|
-
const READ_CONCURRENCY$
|
|
16525
|
+
const READ_CONCURRENCY$16 = 16;
|
|
16526
16526
|
const START$21 = 0;
|
|
16527
16527
|
const FIRST$9 = 1;
|
|
16528
16528
|
const LINE = "\n";
|
|
@@ -16591,7 +16591,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16591
16591
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16592
16592
|
});
|
|
16593
16593
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16594
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
16594
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$16 });
|
|
16595
16595
|
return Array$1.flatten(found);
|
|
16596
16596
|
});
|
|
16597
16597
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16603,7 +16603,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16603
16603
|
onSome: sourcesOf(file, name)
|
|
16604
16604
|
});
|
|
16605
16605
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16606
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16606
|
+
}, { concurrency: READ_CONCURRENCY$16 });
|
|
16607
16607
|
return Array$1.flatten(found);
|
|
16608
16608
|
});
|
|
16609
16609
|
/** @internal */
|
|
@@ -16627,7 +16627,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
16627
16627
|
return Array$1.flatten(found);
|
|
16628
16628
|
});
|
|
16629
16629
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
16630
|
-
const RULE$
|
|
16630
|
+
const RULE$34 = "package-script";
|
|
16631
16631
|
const LIFECYCLE = [
|
|
16632
16632
|
"preinstall",
|
|
16633
16633
|
"install",
|
|
@@ -16650,25 +16650,25 @@ const LIFECYCLE = [
|
|
|
16650
16650
|
const problemOf$6 = ({ file, position, name }) => ({
|
|
16651
16651
|
file,
|
|
16652
16652
|
...position,
|
|
16653
|
-
rule: RULE$
|
|
16653
|
+
rule: RULE$34,
|
|
16654
16654
|
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.`
|
|
16655
16655
|
});
|
|
16656
16656
|
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
|
|
16657
16657
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
16658
|
-
const RULE$
|
|
16659
|
-
const MARKER
|
|
16658
|
+
const RULE$33 = "vite-plus-block";
|
|
16659
|
+
const MARKER = Array$1.join([
|
|
16660
16660
|
"<!--",
|
|
16661
16661
|
"VITE PLUS START",
|
|
16662
16662
|
"-->"
|
|
16663
16663
|
], "");
|
|
16664
16664
|
const MESSAGE$8 = "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.";
|
|
16665
16665
|
const problemIn = (file) => (source) => {
|
|
16666
|
-
const index = String$1.indexOf(MARKER
|
|
16666
|
+
const index = String$1.indexOf(MARKER)(source);
|
|
16667
16667
|
if (Option.isNone(index)) return Option.none();
|
|
16668
16668
|
return Option.some({
|
|
16669
16669
|
file,
|
|
16670
16670
|
...positionOf(source)(index.value),
|
|
16671
|
-
rule: RULE$
|
|
16671
|
+
rule: RULE$33,
|
|
16672
16672
|
message: MESSAGE$8
|
|
16673
16673
|
});
|
|
16674
16674
|
};
|
|
@@ -16701,7 +16701,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
16701
16701
|
return pipe(drifts, Array$1.map(problemOf$5));
|
|
16702
16702
|
});
|
|
16703
16703
|
// src/features/check-workflows/model/release-please.ts
|
|
16704
|
-
const RULE$
|
|
16704
|
+
const RULE$32 = "release-please";
|
|
16705
16705
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
16706
16706
|
const FIRST$8 = 1;
|
|
16707
16707
|
const MESSAGE$7 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch publish` for the workspace.";
|
|
@@ -16713,7 +16713,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
16713
16713
|
file: files.join(root, name),
|
|
16714
16714
|
line: FIRST$8,
|
|
16715
16715
|
column: FIRST$8,
|
|
16716
|
-
rule: RULE$
|
|
16716
|
+
rule: RULE$32,
|
|
16717
16717
|
message: MESSAGE$7
|
|
16718
16718
|
})));
|
|
16719
16719
|
});
|
|
@@ -17002,11 +17002,11 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
|
|
|
17002
17002
|
})), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
17003
17003
|
});
|
|
17004
17004
|
// src/features/ban-comments/model/comments.ts
|
|
17005
|
-
const RULE$
|
|
17005
|
+
const RULE$31 = "comment";
|
|
17006
17006
|
const SUPPRESSION_RULE = "suppression";
|
|
17007
17007
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
17008
17008
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
17009
|
-
const READ_CONCURRENCY$
|
|
17009
|
+
const READ_CONCURRENCY$15 = 64;
|
|
17010
17010
|
const START$19 = 0;
|
|
17011
17011
|
const SHEBANG = "#!";
|
|
17012
17012
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
@@ -17034,7 +17034,7 @@ const NOTHING = {
|
|
|
17034
17034
|
used: []
|
|
17035
17035
|
};
|
|
17036
17036
|
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.`;
|
|
17037
|
-
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$
|
|
17037
|
+
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$31)(file, source)(comment.index, MESSAGE$6)));
|
|
17038
17038
|
const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
17039
17039
|
onNone: () => NO_SETTINGS.allow,
|
|
17040
17040
|
onSome: ({ allow }) => allow
|
|
@@ -17071,7 +17071,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
17071
17071
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
17072
17072
|
used: usedAllowances(allowances, found)
|
|
17073
17073
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
17074
|
-
problems: [problemAtIndex(RULE$
|
|
17074
|
+
problems: [problemAtIndex(RULE$31)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
|
|
17075
17075
|
used: []
|
|
17076
17076
|
})))
|
|
17077
17077
|
});
|
|
@@ -17090,7 +17090,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
17090
17090
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
17091
17091
|
onNone: () => Effect.succeed(NOTHING),
|
|
17092
17092
|
onSome: (source) => scan(entry, source)
|
|
17093
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17093
|
+
}))), { concurrency: READ_CONCURRENCY$15 });
|
|
17094
17094
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
17095
17095
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
17096
17096
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -17184,7 +17184,7 @@ const PYTHON = {
|
|
|
17184
17184
|
/** @internal */
|
|
17185
17185
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
17186
17186
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
17187
|
-
const RULE$
|
|
17187
|
+
const RULE$30 = "uncataloged-dependency";
|
|
17188
17188
|
const OWNED_ELSEWHERE = [
|
|
17189
17189
|
"catalog:",
|
|
17190
17190
|
"workspace:",
|
|
@@ -17198,7 +17198,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
|
|
|
17198
17198
|
const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
17199
17199
|
file: entry.file,
|
|
17200
17200
|
...positionOf(source)(offsetIn(source)(manifestPattern(found))),
|
|
17201
|
-
rule: RULE$
|
|
17201
|
+
rule: RULE$30,
|
|
17202
17202
|
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$5}`
|
|
17203
17203
|
})));
|
|
17204
17204
|
/** @internal */
|
|
@@ -17219,7 +17219,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17219
17219
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
17220
17220
|
const FIRST_LINE$5 = 1;
|
|
17221
17221
|
const FIRST_COLUMN$5 = 1;
|
|
17222
|
-
const RULE$
|
|
17222
|
+
const RULE$29 = "prune-setting-off";
|
|
17223
17223
|
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."]];
|
|
17224
17224
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
17225
17225
|
const lineOf$3 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
|
|
@@ -17233,7 +17233,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
17233
17233
|
file,
|
|
17234
17234
|
line: at(setting),
|
|
17235
17235
|
column: FIRST_COLUMN$5,
|
|
17236
|
-
rule: RULE$
|
|
17236
|
+
rule: RULE$29,
|
|
17237
17237
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
17238
17238
|
})));
|
|
17239
17239
|
});
|
|
@@ -17327,13 +17327,13 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
17327
17327
|
];
|
|
17328
17328
|
});
|
|
17329
17329
|
// src/features/check-skills/model/published-skills.ts
|
|
17330
|
-
const RULE$
|
|
17330
|
+
const RULE$28 = "published-skills";
|
|
17331
17331
|
const KEYWORD = "tanstack-intent";
|
|
17332
17332
|
const SKILLS = "skills";
|
|
17333
17333
|
const SKILL_FILE$3 = "SKILL.md";
|
|
17334
17334
|
const SUCCEEDED = 0;
|
|
17335
17335
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
17336
|
-
const problemAt$2 = problemInFile(RULE$
|
|
17336
|
+
const problemAt$2 = problemInFile(RULE$28);
|
|
17337
17337
|
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))));
|
|
17338
17338
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
17339
17339
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -17370,7 +17370,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
17370
17370
|
return Array$1.flatten(problems);
|
|
17371
17371
|
});
|
|
17372
17372
|
// src/features/check-skills/model/skill-files.ts
|
|
17373
|
-
const RULE$
|
|
17373
|
+
const RULE$27 = "skill-file";
|
|
17374
17374
|
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
17375
17375
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
17376
17376
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
@@ -17389,7 +17389,7 @@ const BLANK = /\s+/u;
|
|
|
17389
17389
|
const SEPARATOR$10 = "/";
|
|
17390
17390
|
const START$17 = 0;
|
|
17391
17391
|
const FIRST$7 = 1;
|
|
17392
|
-
const READ_CONCURRENCY$
|
|
17392
|
+
const READ_CONCURRENCY$14 = 16;
|
|
17393
17393
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
17394
17394
|
const Frontmatter = Schema.Struct({
|
|
17395
17395
|
name: Schema.optional(Schema.String),
|
|
@@ -17427,7 +17427,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
17427
17427
|
]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
17428
17428
|
file: skill.file,
|
|
17429
17429
|
...positionOf(skill.source)(index),
|
|
17430
|
-
rule: RULE$
|
|
17430
|
+
rule: RULE$27,
|
|
17431
17431
|
message
|
|
17432
17432
|
})));
|
|
17433
17433
|
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) => ({
|
|
@@ -17454,7 +17454,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
17454
17454
|
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
17455
17455
|
file,
|
|
17456
17456
|
...positionOf(source)(index),
|
|
17457
|
-
rule: RULE$
|
|
17457
|
+
rule: RULE$27,
|
|
17458
17458
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
17459
17459
|
})));
|
|
17460
17460
|
});
|
|
@@ -17465,12 +17465,12 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17465
17465
|
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$10}`)));
|
|
17466
17466
|
const text = yield* files.readFile(file);
|
|
17467
17467
|
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
17468
|
-
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$
|
|
17468
|
+
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$14 });
|
|
17469
17469
|
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) => ({
|
|
17470
17470
|
file: files.join(root, entry),
|
|
17471
17471
|
line: FIRST$7,
|
|
17472
17472
|
column: FIRST$7,
|
|
17473
|
-
rule: RULE$
|
|
17473
|
+
rule: RULE$27,
|
|
17474
17474
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
17475
17475
|
})));
|
|
17476
17476
|
return [
|
|
@@ -17487,7 +17487,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17487
17487
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
17488
17488
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
17489
17489
|
const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)));
|
|
17490
|
-
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$
|
|
17490
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$14 });
|
|
17491
17491
|
return Array$1.flatten(found);
|
|
17492
17492
|
});
|
|
17493
17493
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -17548,8 +17548,8 @@ const cargoEntries = (text) => {
|
|
|
17548
17548
|
};
|
|
17549
17549
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
17550
17550
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
17551
|
-
const RULE$
|
|
17552
|
-
const READ_CONCURRENCY$
|
|
17551
|
+
const RULE$26 = "version-downgrade";
|
|
17552
|
+
const READ_CONCURRENCY$13 = 16;
|
|
17553
17553
|
const READERS = [
|
|
17554
17554
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
17555
17555
|
[/^pnpm-workspace\.yaml$/u, workspaceEntries],
|
|
@@ -17573,7 +17573,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
17573
17573
|
file,
|
|
17574
17574
|
line: lineOf$2(text, entry),
|
|
17575
17575
|
column: FIRST_LINE$4,
|
|
17576
|
-
rule: RULE$
|
|
17576
|
+
rule: RULE$26,
|
|
17577
17577
|
message: message$1(old, entry)
|
|
17578
17578
|
})), Option.toArray)));
|
|
17579
17579
|
};
|
|
@@ -17593,7 +17593,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
|
|
|
17593
17593
|
before: read(before),
|
|
17594
17594
|
after: read(after)
|
|
17595
17595
|
})), Option.getOrElse(() => []));
|
|
17596
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17596
|
+
}), { concurrency: READ_CONCURRENCY$13 });
|
|
17597
17597
|
return Array$1.flatten(found);
|
|
17598
17598
|
});
|
|
17599
17599
|
// src/features/check-version-downgrades/model/renovate-settings.ts
|
|
@@ -17604,7 +17604,7 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
17604
17604
|
const CAP_RULE = "renovate-version-cap";
|
|
17605
17605
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17606
17606
|
const START$16 = 0;
|
|
17607
|
-
const READ_CONCURRENCY$
|
|
17607
|
+
const READ_CONCURRENCY$12 = 16;
|
|
17608
17608
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17609
17609
|
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.";
|
|
17610
17610
|
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
@@ -17638,12 +17638,12 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
17638
17638
|
onNone: () => [],
|
|
17639
17639
|
onSome: (source) => problemsIn$8(file, source)
|
|
17640
17640
|
})));
|
|
17641
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
17641
|
+
}, { concurrency: READ_CONCURRENCY$12 });
|
|
17642
17642
|
return Array$1.flatten(found);
|
|
17643
17643
|
});
|
|
17644
17644
|
// src/shared/lib/manifest-texts.ts
|
|
17645
17645
|
const MANIFEST$2 = /(?:^|\/)package\.json$/u;
|
|
17646
|
-
const READ_CONCURRENCY$
|
|
17646
|
+
const READ_CONCURRENCY$11 = 16;
|
|
17647
17647
|
/** @internal */
|
|
17648
17648
|
const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
17649
17649
|
const files = yield* RepositoryFiles;
|
|
@@ -17652,16 +17652,16 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
17652
17652
|
const read = yield* Effect.forEach(names, (file) => Effect.map(files.readFile(files.join(root, file)), Option.map((text) => ({
|
|
17653
17653
|
file,
|
|
17654
17654
|
text
|
|
17655
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17655
|
+
}))), { concurrency: READ_CONCURRENCY$11 });
|
|
17656
17656
|
return Array$1.getSomes(read);
|
|
17657
17657
|
});
|
|
17658
17658
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
17659
|
-
const RULE$
|
|
17659
|
+
const RULE$25 = "unbumped-package";
|
|
17660
17660
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
17661
17661
|
const UNVERSIONED$5 = "0.0.0";
|
|
17662
17662
|
const FIRST_LINE$3 = 1;
|
|
17663
17663
|
const FIRST_COLUMN$4 = 1;
|
|
17664
|
-
const READ_CONCURRENCY$
|
|
17664
|
+
const READ_CONCURRENCY$10 = 16;
|
|
17665
17665
|
const LAST_SEGMENT$1 = /[^/]*$/u;
|
|
17666
17666
|
const directoryOf$1 = (file) => String$1.replace(LAST_SEGMENT$1, "")(file);
|
|
17667
17667
|
const packageAt$1 = (file, text) => pipe(decodeVersionedPackageJson(text), Option.filter(({ private: hidden, version }) => hidden !== true && version !== UNVERSIONED$5), Option.map((manifest) => ({
|
|
@@ -17731,16 +17731,16 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17731
17731
|
file: files.join(root, pack.file),
|
|
17732
17732
|
line: versionLine(pack.text),
|
|
17733
17733
|
column: FIRST_COLUMN$4,
|
|
17734
|
-
rule: RULE$
|
|
17734
|
+
rule: RULE$25,
|
|
17735
17735
|
message: message(pack, part, lowest)
|
|
17736
17736
|
})), Option.toArray);
|
|
17737
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17737
|
+
}), { concurrency: READ_CONCURRENCY$10 });
|
|
17738
17738
|
return Array$1.flatten(found);
|
|
17739
17739
|
});
|
|
17740
17740
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
17741
17741
|
const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
17742
17742
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17743
|
-
const RULE$
|
|
17743
|
+
const RULE$24 = "applied-package";
|
|
17744
17744
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17745
17745
|
const NOT_FOUND$4 = -1;
|
|
17746
17746
|
const SEPARATOR$9 = "/";
|
|
@@ -17776,7 +17776,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
17776
17776
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
17777
17777
|
file,
|
|
17778
17778
|
...positionOf(source)(index),
|
|
17779
|
-
rule: RULE$
|
|
17779
|
+
rule: RULE$24,
|
|
17780
17780
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
17781
17781
|
});
|
|
17782
17782
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
@@ -17831,7 +17831,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
17831
17831
|
return yield* appliedPackageProblems(root, applied);
|
|
17832
17832
|
});
|
|
17833
17833
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
17834
|
-
const RULE$
|
|
17834
|
+
const RULE$23 = "replaced-tool";
|
|
17835
17835
|
const FIRST$6 = 1;
|
|
17836
17836
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
17837
17837
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -17912,7 +17912,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
|
|
|
17912
17912
|
file,
|
|
17913
17913
|
line: FIRST$6,
|
|
17914
17914
|
column: FIRST$6,
|
|
17915
|
-
rule: RULE$
|
|
17915
|
+
rule: RULE$23,
|
|
17916
17916
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
17917
17917
|
})));
|
|
17918
17918
|
/** @internal */
|
|
@@ -18051,7 +18051,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
18051
18051
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
18052
18052
|
});
|
|
18053
18053
|
// src/features/check-markdown-directives/model/directives.ts
|
|
18054
|
-
const RULE$
|
|
18054
|
+
const RULE$22 = "markdown-directive";
|
|
18055
18055
|
const START$14 = 0;
|
|
18056
18056
|
const SECOND = 1;
|
|
18057
18057
|
const ODD = 1;
|
|
@@ -18076,7 +18076,7 @@ const problemsIn$7 = (file, source) => {
|
|
|
18076
18076
|
const { line, column } = positionOf(source)(index);
|
|
18077
18077
|
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$14, column - SECOND)), Option.exists(insideCodeSpan));
|
|
18078
18078
|
};
|
|
18079
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$14)), Array$1.map((match) => problemAtIndex(RULE$
|
|
18079
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$14)), Array$1.map((match) => problemAtIndex(RULE$22)(file, source)(match.index ?? START$14, MESSAGE$4)));
|
|
18080
18080
|
};
|
|
18081
18081
|
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)));
|
|
18082
18082
|
/** @internal */
|
|
@@ -18088,51 +18088,6 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
|
|
|
18088
18088
|
file: files.join(root, name)
|
|
18089
18089
|
}))), ({ file }, source) => problemsIn$7(file, source));
|
|
18090
18090
|
});
|
|
18091
|
-
// src/shared/lib/branch-trailer.ts
|
|
18092
|
-
/** @internal */
|
|
18093
|
-
const branchCarries = Effect.fn("branchCarries")(function* branchCarries(root, base, trailer) {
|
|
18094
|
-
const messages = yield* (yield* RepositoryFiles).commitMessages(root, base);
|
|
18095
|
-
return pipe(messages, Array$1.some((commit) => trailer.test(commit)));
|
|
18096
|
-
});
|
|
18097
|
-
// src/features/check-owner-markers/model/owner-markers.ts
|
|
18098
|
-
const RULE$22 = "owner-decision-removed";
|
|
18099
|
-
const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
|
|
18100
|
-
const TRAILER$1 = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
18101
|
-
const READ_CONCURRENCY$10 = 16;
|
|
18102
|
-
const HEAD$1 = "HEAD";
|
|
18103
|
-
const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
|
|
18104
|
-
const countOf = (markers) => (marker) => pipe(markers, Array$1.filter((candidate) => candidate === marker)).length;
|
|
18105
|
-
const lostMarkers = (before, after) => pipe(Array$1.dedupe(before), Array$1.flatMap((marker) => pipe(before, Array$1.filter((candidate) => candidate === marker), Array$1.take(countOf(before)(marker) - countOf(after)(marker)))));
|
|
18106
|
-
const removalOf = (file, lost) => pipe(Option.liftPredicate(lost, Array$1.isReadonlyArrayNonEmpty), Option.map((markers) => ({
|
|
18107
|
-
file,
|
|
18108
|
-
markers
|
|
18109
|
-
})), Option.toArray);
|
|
18110
|
-
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>".`;
|
|
18111
|
-
const removalsSince = Effect.fn("removalsSince")(function* removalsSince(root, base) {
|
|
18112
|
-
const files = yield* RepositoryFiles;
|
|
18113
|
-
const changed = yield* files.changedFiles(root, base);
|
|
18114
|
-
const found = yield* Effect.forEach(changed, (name) => Effect.gen(function* compare() {
|
|
18115
|
-
const before = yield* files.readAtRevision(root, base, name);
|
|
18116
|
-
const after = yield* files.readAtRevision(root, HEAD$1, name);
|
|
18117
|
-
const lost = lostMarkers(Option.match(before, {
|
|
18118
|
-
onNone: () => [],
|
|
18119
|
-
onSome: markersOf
|
|
18120
|
-
}), Option.match(after, {
|
|
18121
|
-
onNone: () => [],
|
|
18122
|
-
onSome: markersOf
|
|
18123
|
-
}));
|
|
18124
|
-
return removalOf(files.join(root, name), lost);
|
|
18125
|
-
}), { concurrency: READ_CONCURRENCY$10 });
|
|
18126
|
-
return Array$1.flatten(found);
|
|
18127
|
-
});
|
|
18128
|
-
/** @internal */
|
|
18129
|
-
const checkOwnerMarkers = Effect.fn("checkOwnerMarkers")(function* checkOwnerMarkers(root) {
|
|
18130
|
-
const base = yield* baseRevision(root);
|
|
18131
|
-
if (Option.isNone(base)) return [];
|
|
18132
|
-
const removals = yield* removalsSince(root, base.value);
|
|
18133
|
-
if (!Array$1.isReadonlyArrayNonEmpty(removals) || (yield* branchCarries(root, base.value, TRAILER$1))) return [];
|
|
18134
|
-
return pipe(removals, Array$1.map((removal) => problemInFile(RULE$22)(removal.file, messageOf$1(removal))));
|
|
18135
|
-
});
|
|
18136
18091
|
// src/features/check-owner-names/model/owner-names.ts
|
|
18137
18092
|
const RULE$21 = "owner-name";
|
|
18138
18093
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
@@ -18223,6 +18178,12 @@ const checkOwnerNames = Effect.fn("checkOwnerNames")(function* checkOwnerNames(r
|
|
|
18223
18178
|
const found = yield* Effect.forEach(directories, (directory) => workspaceProblems(root, origin.value.owner, directory), { concurrency: 1 });
|
|
18224
18179
|
return Array$1.flatten(found);
|
|
18225
18180
|
});
|
|
18181
|
+
// src/shared/lib/branch-trailer.ts
|
|
18182
|
+
/** @internal */
|
|
18183
|
+
const branchCarries = Effect.fn("branchCarries")(function* branchCarries(root, base, trailer) {
|
|
18184
|
+
const messages = yield* (yield* RepositoryFiles).commitMessages(root, base);
|
|
18185
|
+
return pipe(messages, Array$1.some((commit) => trailer.test(commit)));
|
|
18186
|
+
});
|
|
18226
18187
|
// src/features/check-owner-principles/model/owner-principles.ts
|
|
18227
18188
|
const RULE$20 = "owner-principle-changed";
|
|
18228
18189
|
const PRINCIPLE_FILE = /(?:^|\/)(?:skills\/principle-[^/]+\/|PRINCIPLE\.md$)/u;
|
|
@@ -18279,7 +18240,6 @@ const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root
|
|
|
18279
18240
|
const found = yield* Effect.all([
|
|
18280
18241
|
checkHiddenUnicode(root),
|
|
18281
18242
|
checkMarkdownDirectives(root),
|
|
18282
|
-
checkOwnerMarkers(root),
|
|
18283
18243
|
checkOwnerNames(root),
|
|
18284
18244
|
checkOwnerPrinciples(root)
|
|
18285
18245
|
], { concurrency: "unbounded" });
|