@r_masseater/msch 0.110.0 → 0.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +197 -141
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -6
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-Jiu7pMHB.mjs → define-lint-preset-BXnNnSR9.mjs} +44 -5
- package/dist/define-lint-preset-BXnNnSR9.mjs.map +1 -0
- package/dist/{index-Cg3RkK6V.d.mts → index-CAgQX_8m.d.mts} +18 -5
- package/dist/{index-BjHoDbVQ.d.mts → index-CJiAUZDt.d.mts} +3 -3
- package/dist/lint-rules.mjs +111 -87
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/lint.d.mts +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/{published-DRs5iHkQ.mjs → published-B0rqrGML.mjs} +6 -208
- package/dist/published-B0rqrGML.mjs.map +1 -0
- package/dist/{repository-text-BZqpXNEe.mjs → repository-text-DdeWgRlO.mjs} +26 -17
- package/dist/repository-text-DdeWgRlO.mjs.map +1 -0
- package/dist/workspace-projects-YdLknbDq.mjs +261 -0
- package/dist/workspace-projects-YdLknbDq.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +18 -4
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +10 -8
- package/skills/msch-repository-config/SKILL.md +4 -1
- package/skills/msch-workspace-settings/SKILL.md +3 -0
- package/src/app/vite.d.ts +5 -0
- package/dist/define-lint-preset-Jiu7pMHB.mjs.map +0 -1
- package/dist/published-DRs5iHkQ.mjs.map +0 -1
- package/dist/repository-text-BZqpXNEe.mjs.map +0 -1
- package/dist/workspace-projects-ycyXdQRo.mjs +0 -69
- package/dist/workspace-projects-ycyXdQRo.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { i as nodeRepositoryFiles, n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-DbZY3I_3.mjs";
|
|
3
3
|
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-BP2B-3M4.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { a as workspaceManifest, i as workspaceProjects, n as unmatchedWorkspacePatterns, r as workspaceDirectories, t as publishedProjects } from "./workspace-projects-
|
|
4
|
+
import { S as workspaceDependencies$1, _ as shadcnUiOf, a as workspaceConfigs, b as installedManifest, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as readManifest, y as dependencyEntries } from "./published-B0rqrGML.mjs";
|
|
5
|
+
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-YdLknbDq.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
7
7
|
import { n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
8
|
-
import { a as
|
|
8
|
+
import { a as CI_TASKS, d as isIgnored, l as existsAt, m as patternOf$1, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, p as namedWorkspaces, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES } from "./repository-text-DdeWgRlO.mjs";
|
|
9
9
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
10
|
-
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3,
|
|
10
|
+
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-BXnNnSR9.mjs";
|
|
11
11
|
import { builtinModules, isBuiltin } from "node:module";
|
|
12
12
|
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
13
13
|
import { Array as Array$1, Boolean as Boolean$1, Clock, Config, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Runtime, Schedule, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
@@ -43,7 +43,7 @@ import { Base64 } from "effect/encoding";
|
|
|
43
43
|
import { dual } from "effect/Function";
|
|
44
44
|
// package.json
|
|
45
45
|
var name = "@r_masseater/msch";
|
|
46
|
-
var version = "0.
|
|
46
|
+
var version = "0.112.0";
|
|
47
47
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
48
48
|
var repository = {
|
|
49
49
|
"type": "git",
|
|
@@ -628,13 +628,13 @@ const TaskObject = Schema.Struct({
|
|
|
628
628
|
});
|
|
629
629
|
const decodeTaskProperty = Schema.decodeUnknownOption(TaskProperty);
|
|
630
630
|
const decodeTaskObject = Schema.decodeUnknownOption(TaskObject);
|
|
631
|
-
const
|
|
631
|
+
const runTasksIn = (program) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap((tasks) => pipe(decodeTaskObject(tasks), Option.map(({ properties }) => properties), Option.getOrElse(() => []))), Array$1.flatMap((property) => Option.toArray(decodeTaskProperty(property))));
|
|
632
632
|
const runTasksOf = Effect.fn("runTasksOf")(function* runTasksOf(root, directory) {
|
|
633
633
|
const config = yield* workspaceConfigOf(root, directory);
|
|
634
634
|
return pipe(config, Option.map(({ file, source, program }) => ({
|
|
635
635
|
file,
|
|
636
636
|
source,
|
|
637
|
-
tasks:
|
|
637
|
+
tasks: runTasksIn(program)
|
|
638
638
|
})));
|
|
639
639
|
});
|
|
640
640
|
// src/entities/workspace/model/cargo-crates.ts
|
|
@@ -1060,7 +1060,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1060
1060
|
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
1061
1061
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1062
1062
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1063
|
-
const READ_CONCURRENCY$
|
|
1063
|
+
const READ_CONCURRENCY$41 = 64;
|
|
1064
1064
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1065
1065
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1066
1066
|
/** @internal */
|
|
@@ -1083,56 +1083,56 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1083
1083
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1084
1084
|
onNone: () => [],
|
|
1085
1085
|
onSome: (source) => foundIn(entry, source)
|
|
1086
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1086
|
+
}))), { concurrency: READ_CONCURRENCY$41 });
|
|
1087
1087
|
return Array$1.flatten(found);
|
|
1088
1088
|
});
|
|
1089
1089
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1090
1090
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1091
1091
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1092
|
-
const RULE$
|
|
1092
|
+
const RULE$76 = "git-subpath-dependency";
|
|
1093
1093
|
const WHOLE_MATCH$4 = 0;
|
|
1094
1094
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1095
1095
|
file,
|
|
1096
1096
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1097
|
-
rule: RULE$
|
|
1097
|
+
rule: RULE$76,
|
|
1098
1098
|
message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
|
|
1099
1099
|
});
|
|
1100
|
-
const problemsIn$
|
|
1100
|
+
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
1101
1101
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
1102
1102
|
/** @internal */
|
|
1103
1103
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
1104
1104
|
const listed = yield* listedFiles(root);
|
|
1105
|
-
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$
|
|
1105
|
+
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1106
1106
|
});
|
|
1107
1107
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1108
|
-
const RULE$
|
|
1108
|
+
const RULE$75 = "unnamed-restriction";
|
|
1109
1109
|
const WHOLE_MATCH$3 = 0;
|
|
1110
1110
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1111
|
-
const problemsIn$
|
|
1111
|
+
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1112
1112
|
file: entry.file,
|
|
1113
1113
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1114
|
-
rule: RULE$
|
|
1114
|
+
rule: RULE$75,
|
|
1115
1115
|
message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
|
|
1116
1116
|
})));
|
|
1117
1117
|
/** @internal */
|
|
1118
1118
|
const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
|
|
1119
1119
|
const listed = yield* listedFiles(root);
|
|
1120
|
-
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$
|
|
1120
|
+
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1121
1121
|
});
|
|
1122
1122
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1123
|
-
const RULE$
|
|
1123
|
+
const RULE$74 = "named-type-exemption";
|
|
1124
1124
|
const WHOLE_MATCH$2 = 0;
|
|
1125
1125
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1126
|
-
const problemsIn$
|
|
1126
|
+
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1127
1127
|
file: entry.file,
|
|
1128
1128
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1129
|
-
rule: RULE$
|
|
1129
|
+
rule: RULE$74,
|
|
1130
1130
|
message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
|
|
1131
1131
|
})));
|
|
1132
1132
|
/** @internal */
|
|
1133
1133
|
const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
|
|
1134
1134
|
const listed = yield* listedFiles(root);
|
|
1135
|
-
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$
|
|
1135
|
+
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
|
|
1136
1136
|
});
|
|
1137
1137
|
// src/shared/lib/registries.ts
|
|
1138
1138
|
const TRAILING_SLASH$1 = /\/*$/u;
|
|
@@ -1142,7 +1142,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1142
1142
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1143
1143
|
const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
|
|
1144
1144
|
// src/features/check-overrides/model/package-registry.ts
|
|
1145
|
-
const RULE$
|
|
1145
|
+
const RULE$73 = "package-registry";
|
|
1146
1146
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1147
1147
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1148
1148
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
@@ -1156,7 +1156,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
1156
1156
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1157
1157
|
file,
|
|
1158
1158
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1159
|
-
rule: RULE$
|
|
1159
|
+
rule: RULE$73,
|
|
1160
1160
|
message: Option.match(registry, {
|
|
1161
1161
|
onNone: () => `${REASON$3} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1162
1162
|
onSome: (value) => `${REASON$3} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1165,7 +1165,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1165
1165
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
|
|
1166
1166
|
file: entry.file,
|
|
1167
1167
|
...positionOf(source)(found.index ?? START$33),
|
|
1168
|
-
rule: RULE$
|
|
1168
|
+
rule: RULE$73,
|
|
1169
1169
|
message: `${REASON$3} This .npmrc overrides it with \`${String$1.trim(found[START$33])}\`. Remove the line.`
|
|
1170
1170
|
})));
|
|
1171
1171
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -3350,7 +3350,7 @@ const SELF_HOMEPAGE = homepage;
|
|
|
3350
3350
|
const SELF_DIRECTORY = repository.directory;
|
|
3351
3351
|
const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
3352
3352
|
// src/features/check-overrides/model/removed-peers.ts
|
|
3353
|
-
const RULE$
|
|
3353
|
+
const RULE$72 = "removed-peer";
|
|
3354
3354
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
3355
3355
|
const REMOVED = "-";
|
|
3356
3356
|
const PARENT_SEPARATOR = ">";
|
|
@@ -3377,7 +3377,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
3377
3377
|
file,
|
|
3378
3378
|
line,
|
|
3379
3379
|
column,
|
|
3380
|
-
rule: RULE$
|
|
3380
|
+
rule: RULE$72,
|
|
3381
3381
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
3382
3382
|
});
|
|
3383
3383
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
@@ -3411,7 +3411,7 @@ const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedP
|
|
|
3411
3411
|
});
|
|
3412
3412
|
});
|
|
3413
3413
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3414
|
-
const RULE$
|
|
3414
|
+
const RULE$71 = "colocated-git-patterns";
|
|
3415
3415
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3416
3416
|
const ROOT$3 = ".";
|
|
3417
3417
|
const NEGATION = "!";
|
|
@@ -3422,7 +3422,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
3422
3422
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3423
3423
|
const SPACES = /\s+/u;
|
|
3424
3424
|
const FIRST$26 = 1;
|
|
3425
|
-
const READ_CONCURRENCY$
|
|
3425
|
+
const READ_CONCURRENCY$40 = 16;
|
|
3426
3426
|
const withoutPrefix = (prefix, text) => {
|
|
3427
3427
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3428
3428
|
return text;
|
|
@@ -3458,7 +3458,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3458
3458
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3459
3459
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3460
3460
|
});
|
|
3461
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3461
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$71)(entry.file, {
|
|
3462
3462
|
line: entry.line,
|
|
3463
3463
|
column: FIRST$26
|
|
3464
3464
|
}, message);
|
|
@@ -3513,17 +3513,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3513
3513
|
/** @internal */
|
|
3514
3514
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3515
3515
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3516
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3516
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$40 });
|
|
3517
3517
|
const entries = Array$1.flatten(read);
|
|
3518
3518
|
const workspaces = yield* workspaceDirectories(root);
|
|
3519
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3519
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$40 });
|
|
3520
3520
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3521
3521
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3522
3522
|
});
|
|
3523
3523
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3524
|
-
const RULE$
|
|
3524
|
+
const RULE$70 = "colocated-test";
|
|
3525
3525
|
const FIRST$25 = 1;
|
|
3526
|
-
const READ_CONCURRENCY$
|
|
3526
|
+
const READ_CONCURRENCY$39 = 64;
|
|
3527
3527
|
const ROOT_SUBPATH$2 = ".";
|
|
3528
3528
|
const NAME_GROUP$1 = "name";
|
|
3529
3529
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3544,7 +3544,7 @@ const problemFor$10 = (test, message) => ({
|
|
|
3544
3544
|
file: test.file,
|
|
3545
3545
|
line: FIRST$25,
|
|
3546
3546
|
column: FIRST$25,
|
|
3547
|
-
rule: RULE$
|
|
3547
|
+
rule: RULE$70,
|
|
3548
3548
|
message: `${test.base} ${message}`
|
|
3549
3549
|
});
|
|
3550
3550
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
@@ -3607,12 +3607,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3607
3607
|
directory: files.dirname(file)
|
|
3608
3608
|
};
|
|
3609
3609
|
}));
|
|
3610
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3610
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$39 });
|
|
3611
3611
|
return Array$1.getSomes(found);
|
|
3612
3612
|
});
|
|
3613
3613
|
// src/shared/lib/agent-docs.ts
|
|
3614
3614
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3615
|
-
const READ_CONCURRENCY$
|
|
3615
|
+
const READ_CONCURRENCY$38 = 16;
|
|
3616
3616
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3617
3617
|
const files = yield* RepositoryFiles;
|
|
3618
3618
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3621,13 +3621,13 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3621
3621
|
const file = files.join(root, name);
|
|
3622
3622
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3623
3623
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3624
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3624
|
+
}, { concurrency: READ_CONCURRENCY$38 });
|
|
3625
3625
|
return Array$1.getSomes(found);
|
|
3626
3626
|
});
|
|
3627
3627
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3628
3628
|
const RECOMMENDED_LINES = 200;
|
|
3629
3629
|
const FIRST$24 = 1;
|
|
3630
|
-
const RULE$
|
|
3630
|
+
const RULE$69 = "agent-docs-length";
|
|
3631
3631
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3632
3632
|
const problemFor$9 = (file) => (lines) => {
|
|
3633
3633
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3635,18 +3635,18 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3635
3635
|
file,
|
|
3636
3636
|
line: 201,
|
|
3637
3637
|
column: FIRST$24,
|
|
3638
|
-
rule: RULE$
|
|
3638
|
+
rule: RULE$69,
|
|
3639
3639
|
message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
|
|
3640
3640
|
});
|
|
3641
3641
|
};
|
|
3642
3642
|
/** @internal */
|
|
3643
3643
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3644
3644
|
// src/features/check-placement/model/claude-link.ts
|
|
3645
|
-
const RULE$
|
|
3645
|
+
const RULE$68 = "claude-md-link";
|
|
3646
3646
|
const CLAUDE = "CLAUDE.md";
|
|
3647
3647
|
const AGENTS = "AGENTS.md";
|
|
3648
3648
|
const FIRST$23 = 1;
|
|
3649
|
-
const READ_CONCURRENCY$
|
|
3649
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3650
3650
|
const MESSAGE$14 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3651
3651
|
/** @internal */
|
|
3652
3652
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3661,19 +3661,19 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3661
3661
|
file: path,
|
|
3662
3662
|
line: FIRST$23,
|
|
3663
3663
|
column: FIRST$23,
|
|
3664
|
-
rule: RULE$
|
|
3664
|
+
rule: RULE$68,
|
|
3665
3665
|
message: MESSAGE$14
|
|
3666
3666
|
})));
|
|
3667
3667
|
});
|
|
3668
3668
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3669
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3669
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$37 });
|
|
3670
3670
|
return Array$1.getSomes(found);
|
|
3671
3671
|
});
|
|
3672
3672
|
// src/features/check-placement/model/dangling-links.ts
|
|
3673
|
-
const RULE$
|
|
3673
|
+
const RULE$67 = "dangling-link";
|
|
3674
3674
|
const SEPARATOR$24 = "/";
|
|
3675
3675
|
const FIRST$22 = 1;
|
|
3676
|
-
const READ_CONCURRENCY$
|
|
3676
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3677
3677
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$24}`)(name);
|
|
3678
3678
|
/** @internal */
|
|
3679
3679
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -3686,11 +3686,11 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3686
3686
|
file,
|
|
3687
3687
|
line: FIRST$22,
|
|
3688
3688
|
column: FIRST$22,
|
|
3689
|
-
rule: RULE$
|
|
3689
|
+
rule: RULE$67,
|
|
3690
3690
|
message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
|
|
3691
3691
|
})));
|
|
3692
3692
|
});
|
|
3693
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3693
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$36 });
|
|
3694
3694
|
return Array$1.getSomes(found);
|
|
3695
3695
|
});
|
|
3696
3696
|
// src/features/check-placement/model/member-sources.ts
|
|
@@ -3744,9 +3744,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3744
3744
|
}));
|
|
3745
3745
|
});
|
|
3746
3746
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3747
|
-
const RULE$
|
|
3747
|
+
const RULE$66 = "deployed-readme";
|
|
3748
3748
|
const ROOT_DIRECTORY$4 = "";
|
|
3749
|
-
const READ_CONCURRENCY$
|
|
3749
|
+
const READ_CONCURRENCY$35 = 16;
|
|
3750
3750
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
3751
3751
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3752
3752
|
const ADDRESS_KEYS = [
|
|
@@ -3784,14 +3784,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3784
3784
|
const readme = yield* readReadme({
|
|
3785
3785
|
root,
|
|
3786
3786
|
directory,
|
|
3787
|
-
rule: RULE$
|
|
3787
|
+
rule: RULE$66,
|
|
3788
3788
|
missingMessage: MISSING_MESSAGE$2
|
|
3789
3789
|
});
|
|
3790
3790
|
return Result.match(readme, {
|
|
3791
3791
|
onFailure: Option.some,
|
|
3792
3792
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3793
3793
|
file,
|
|
3794
|
-
rule: RULE$
|
|
3794
|
+
rule: RULE$66,
|
|
3795
3795
|
message: NO_URL_MESSAGE
|
|
3796
3796
|
})))
|
|
3797
3797
|
});
|
|
@@ -3802,16 +3802,16 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3802
3802
|
const listed = yield* files.listedFiles(root);
|
|
3803
3803
|
const directories = yield* workspaceDirectories(root);
|
|
3804
3804
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3805
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3805
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$35 });
|
|
3806
3806
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3807
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3807
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$35 });
|
|
3808
3808
|
return Array$1.getSomes(found);
|
|
3809
3809
|
});
|
|
3810
3810
|
// src/features/check-placement/model/nested-docs.ts
|
|
3811
|
-
const RULE$
|
|
3811
|
+
const RULE$65 = "nested-docs";
|
|
3812
3812
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3813
3813
|
const SEPARATOR$22 = "/";
|
|
3814
|
-
const READ_CONCURRENCY$
|
|
3814
|
+
const READ_CONCURRENCY$34 = 64;
|
|
3815
3815
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3816
3816
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3817
3817
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -3821,7 +3821,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3821
3821
|
const taggedError$13 = Schema.TaggedError;
|
|
3822
3822
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3823
3823
|
const isNested = (name) => String$1.includes(SEPARATOR$22)(name);
|
|
3824
|
-
const problemFor$8 = problemInFile(RULE$
|
|
3824
|
+
const problemFor$8 = problemInFile(RULE$65);
|
|
3825
3825
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3826
3826
|
const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
|
|
3827
3827
|
const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
|
|
@@ -3868,7 +3868,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3868
3868
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3869
3869
|
workspaceAgentDocs
|
|
3870
3870
|
};
|
|
3871
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3871
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$34 });
|
|
3872
3872
|
const missing = missingProblems({
|
|
3873
3873
|
required: workspaceAgentDocs,
|
|
3874
3874
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3878,15 +3878,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3878
3878
|
return [...Array$1.getSomes(found), ...missing];
|
|
3879
3879
|
});
|
|
3880
3880
|
// src/features/check-placement/model/published-readme.ts
|
|
3881
|
-
const RULE$
|
|
3882
|
-
const READ_CONCURRENCY$
|
|
3881
|
+
const RULE$64 = "published-readme";
|
|
3882
|
+
const READ_CONCURRENCY$33 = 16;
|
|
3883
3883
|
const MESSAGE$13 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3884
3884
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3885
3885
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3886
3886
|
const readme = yield* readReadme({
|
|
3887
3887
|
root,
|
|
3888
3888
|
directory,
|
|
3889
|
-
rule: RULE$
|
|
3889
|
+
rule: RULE$64,
|
|
3890
3890
|
missingMessage: MISSING_MESSAGE
|
|
3891
3891
|
});
|
|
3892
3892
|
return Result.match(readme, {
|
|
@@ -3897,7 +3897,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3897
3897
|
file,
|
|
3898
3898
|
line,
|
|
3899
3899
|
column,
|
|
3900
|
-
rule: RULE$
|
|
3900
|
+
rule: RULE$64,
|
|
3901
3901
|
message: MESSAGE$13
|
|
3902
3902
|
};
|
|
3903
3903
|
}))
|
|
@@ -3906,11 +3906,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3906
3906
|
/** @internal */
|
|
3907
3907
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3908
3908
|
const projects = yield* publishedProjects(root);
|
|
3909
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3909
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$33 });
|
|
3910
3910
|
return Array$1.getSomes(found);
|
|
3911
3911
|
});
|
|
3912
3912
|
// src/features/check-placement/model/published-tests.ts
|
|
3913
|
-
const RULE$
|
|
3913
|
+
const RULE$63 = "published-tests";
|
|
3914
3914
|
const FILE_START = 1;
|
|
3915
3915
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3916
3916
|
const MESSAGE$12 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3924,7 +3924,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3924
3924
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3925
3925
|
line: FILE_START,
|
|
3926
3926
|
column: FILE_START,
|
|
3927
|
-
rule: RULE$
|
|
3927
|
+
rule: RULE$63,
|
|
3928
3928
|
message: MESSAGE$12
|
|
3929
3929
|
});
|
|
3930
3930
|
});
|
|
@@ -3938,7 +3938,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3938
3938
|
return Array$1.getSomes(found);
|
|
3939
3939
|
});
|
|
3940
3940
|
// src/features/check-placement/model/root-docs.ts
|
|
3941
|
-
const RULE$
|
|
3941
|
+
const RULE$62 = "root-docs";
|
|
3942
3942
|
const SEPARATOR$21 = "/";
|
|
3943
3943
|
const FIRST$20 = 1;
|
|
3944
3944
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
@@ -3953,14 +3953,14 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3953
3953
|
file: files.join(root, name),
|
|
3954
3954
|
line: FIRST$20,
|
|
3955
3955
|
column: FIRST$20,
|
|
3956
|
-
rule: RULE$
|
|
3956
|
+
rule: RULE$62,
|
|
3957
3957
|
message: `${name} ${MESSAGE$11}`
|
|
3958
3958
|
})));
|
|
3959
3959
|
});
|
|
3960
3960
|
// src/features/check-placement/model/root-readme.ts
|
|
3961
|
-
const RULE$
|
|
3961
|
+
const RULE$61 = "root-readme";
|
|
3962
3962
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3963
|
-
const READ_CONCURRENCY$
|
|
3963
|
+
const READ_CONCURRENCY$32 = 16;
|
|
3964
3964
|
const START$31 = 0;
|
|
3965
3965
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3966
3966
|
const RELATIVE$2 = /^\.\//u;
|
|
@@ -3997,17 +3997,17 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
|
|
|
3997
3997
|
onNone: () => ownNames(plugins, names),
|
|
3998
3998
|
onSome: () => [directory]
|
|
3999
3999
|
}));
|
|
4000
|
-
const problemsIn$
|
|
4000
|
+
const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
4001
4001
|
const message = messageFor$4(workspace.directory);
|
|
4002
4002
|
const at = positionOf(source);
|
|
4003
4003
|
const pattern = patternFor(plugins)(workspace);
|
|
4004
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4004
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$61)(file, at(found.index ?? START$31), message)));
|
|
4005
4005
|
};
|
|
4006
4006
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4007
4007
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
4008
4008
|
return pipe(text, Option.match({
|
|
4009
4009
|
onNone: () => [],
|
|
4010
|
-
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$
|
|
4010
|
+
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$21(file, source, plugins)))
|
|
4011
4011
|
}));
|
|
4012
4012
|
});
|
|
4013
4013
|
/** @internal */
|
|
@@ -4018,7 +4018,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4018
4018
|
const named = yield* namedWorkspaces(root);
|
|
4019
4019
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4020
4020
|
const plugins = yield* marketplacePlugins(root);
|
|
4021
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4021
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$32 });
|
|
4022
4022
|
return Array$1.flatten(found);
|
|
4023
4023
|
});
|
|
4024
4024
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4038,10 +4038,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4038
4038
|
return Array$1.flatten(found);
|
|
4039
4039
|
});
|
|
4040
4040
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4041
|
-
const RULE$
|
|
4041
|
+
const RULE$60 = "docs-mirror";
|
|
4042
4042
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4043
4043
|
const MIRROR_LIMIT = 3;
|
|
4044
|
-
const READ_CONCURRENCY$
|
|
4044
|
+
const READ_CONCURRENCY$31 = 16;
|
|
4045
4045
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4046
4046
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4047
4047
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4063,7 +4063,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4063
4063
|
file,
|
|
4064
4064
|
line,
|
|
4065
4065
|
column,
|
|
4066
|
-
rule: RULE$
|
|
4066
|
+
rule: RULE$60,
|
|
4067
4067
|
message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
|
|
4068
4068
|
};
|
|
4069
4069
|
}), Option.toArray);
|
|
@@ -4078,7 +4078,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4078
4078
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4079
4079
|
directory,
|
|
4080
4080
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4081
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4081
|
+
}))), { concurrency: READ_CONCURRENCY$31 });
|
|
4082
4082
|
});
|
|
4083
4083
|
/** @internal */
|
|
4084
4084
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4091,11 +4091,11 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4091
4091
|
onNone: () => [],
|
|
4092
4092
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4093
4093
|
})));
|
|
4094
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4094
|
+
}, { concurrency: READ_CONCURRENCY$31 });
|
|
4095
4095
|
return Array$1.flatten(found);
|
|
4096
4096
|
});
|
|
4097
4097
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4098
|
-
const RULE$
|
|
4098
|
+
const RULE$59 = "ignored-sources";
|
|
4099
4099
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4100
4100
|
const FIRST$19 = 1;
|
|
4101
4101
|
const MESSAGE$10 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -4107,7 +4107,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4107
4107
|
file: files.join(root, file),
|
|
4108
4108
|
line: FIRST$19,
|
|
4109
4109
|
column: FIRST$19,
|
|
4110
|
-
rule: RULE$
|
|
4110
|
+
rule: RULE$59,
|
|
4111
4111
|
message: MESSAGE$10
|
|
4112
4112
|
})));
|
|
4113
4113
|
});
|
|
@@ -12784,7 +12784,7 @@ const LAYER_ITEMS = [
|
|
|
12784
12784
|
"attribute_item",
|
|
12785
12785
|
"inner_attribute_item"
|
|
12786
12786
|
];
|
|
12787
|
-
const READ_CONCURRENCY$
|
|
12787
|
+
const READ_CONCURRENCY$30 = 64;
|
|
12788
12788
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12789
12789
|
const NONE$4 = [];
|
|
12790
12790
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
@@ -12860,17 +12860,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12860
12860
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
12861
12861
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
12862
12862
|
const parse = parsedWith(language);
|
|
12863
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
12863
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$30 });
|
|
12864
12864
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12865
12865
|
});
|
|
12866
12866
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12867
|
-
const RULE$
|
|
12867
|
+
const RULE$58 = "shadcn-ui-alias";
|
|
12868
12868
|
const FIRST$18 = 1;
|
|
12869
12869
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12870
12870
|
file,
|
|
12871
12871
|
line: FIRST$18,
|
|
12872
12872
|
column: FIRST$18,
|
|
12873
|
-
rule: RULE$
|
|
12873
|
+
rule: RULE$58,
|
|
12874
12874
|
message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
|
|
12875
12875
|
});
|
|
12876
12876
|
/** @internal */
|
|
@@ -12934,7 +12934,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12934
12934
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12935
12935
|
const SEPARATOR$18 = "/";
|
|
12936
12936
|
const CURRENT = "./";
|
|
12937
|
-
const READ_CONCURRENCY$
|
|
12937
|
+
const READ_CONCURRENCY$29 = 8;
|
|
12938
12938
|
const FIRST$17 = 1;
|
|
12939
12939
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12940
12940
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -12976,7 +12976,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12976
12976
|
const files = yield* RepositoryFiles;
|
|
12977
12977
|
const listed = yield* files.listedFiles(root);
|
|
12978
12978
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
12979
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
12979
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$29 });
|
|
12980
12980
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12981
12981
|
});
|
|
12982
12982
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$18));
|
|
@@ -12987,7 +12987,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.
|
|
|
12987
12987
|
message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
|
|
12988
12988
|
})));
|
|
12989
12989
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap(stringsIn), Array$1.flatMap(runsIn));
|
|
12990
|
-
const problemsIn$
|
|
12990
|
+
const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
12991
12991
|
const files = yield* RepositoryFiles;
|
|
12992
12992
|
const config = yield* workspaceConfigOf(root, directory);
|
|
12993
12993
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -13039,9 +13039,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13039
13039
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13040
13040
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13041
13041
|
const workflows = yield* workflowText(root);
|
|
13042
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$
|
|
13043
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13044
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13042
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$29 });
|
|
13043
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$29 });
|
|
13044
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$29 });
|
|
13045
13045
|
return [
|
|
13046
13046
|
...Array$1.flatten(found),
|
|
13047
13047
|
...Array$1.getSomes(scripts),
|
|
@@ -13138,39 +13138,39 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13138
13138
|
])));
|
|
13139
13139
|
});
|
|
13140
13140
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13141
|
-
const RULE$
|
|
13141
|
+
const RULE$57 = "config-path";
|
|
13142
13142
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13143
13143
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13144
13144
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13145
13145
|
const OUTSIDE = "..";
|
|
13146
|
-
const READ_CONCURRENCY$
|
|
13146
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13147
13147
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13148
13148
|
const files = yield* RepositoryFiles;
|
|
13149
13149
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
13150
13150
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13151
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13151
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$28 });
|
|
13152
13152
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13153
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13153
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$28 });
|
|
13154
13154
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13155
13155
|
});
|
|
13156
13156
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
13157
13157
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13158
13158
|
file,
|
|
13159
13159
|
...positionOf(source)(mention.index),
|
|
13160
|
-
rule: RULE$
|
|
13160
|
+
rule: RULE$57,
|
|
13161
13161
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13162
13162
|
});
|
|
13163
13163
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
13164
13164
|
if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
|
|
13165
13165
|
return yield* tsconfigMentions(file, source);
|
|
13166
13166
|
});
|
|
13167
|
-
const problemsIn$
|
|
13167
|
+
const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
13168
13168
|
const files = yield* RepositoryFiles;
|
|
13169
13169
|
const file = files.join(root, name);
|
|
13170
13170
|
const source = yield* files.readFile(file);
|
|
13171
13171
|
if (Option.isNone(source)) return [];
|
|
13172
13172
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13173
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13173
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$28 });
|
|
13174
13174
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13175
13175
|
});
|
|
13176
13176
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13182,7 +13182,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13182
13182
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13183
13183
|
file,
|
|
13184
13184
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13185
|
-
rule: RULE$
|
|
13185
|
+
rule: RULE$57,
|
|
13186
13186
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13187
13187
|
})));
|
|
13188
13188
|
});
|
|
@@ -13190,23 +13190,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13190
13190
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13191
13191
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13192
13192
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13193
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$
|
|
13193
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$28 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13194
13194
|
return [...Array$1.flatten(found), ...patterns];
|
|
13195
13195
|
});
|
|
13196
13196
|
// src/features/check-repository-layout/model/crates.ts
|
|
13197
|
-
const RULE$
|
|
13197
|
+
const RULE$56 = "unverified-crate";
|
|
13198
13198
|
const VERSION_RULE = "release-version";
|
|
13199
13199
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13200
13200
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13201
13201
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13202
13202
|
const SEPARATOR$16 = "/";
|
|
13203
13203
|
const FIRST$16 = 1;
|
|
13204
|
-
const READ_CONCURRENCY$
|
|
13204
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13205
13205
|
const problemFor$5 = (crate, message) => ({
|
|
13206
13206
|
file: crate.manifest,
|
|
13207
13207
|
line: FIRST$16,
|
|
13208
13208
|
column: FIRST$16,
|
|
13209
|
-
rule: RULE$
|
|
13209
|
+
rule: RULE$56,
|
|
13210
13210
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13211
13211
|
});
|
|
13212
13212
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13238,11 +13238,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13238
13238
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13239
13239
|
const directories = yield* workspaceDirectories(root);
|
|
13240
13240
|
const crates = yield* cratesIn(root);
|
|
13241
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13241
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$27 });
|
|
13242
13242
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13243
13243
|
});
|
|
13244
13244
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13245
|
-
const RULE$
|
|
13245
|
+
const RULE$55 = "deploy-entry-pattern";
|
|
13246
13246
|
const FALLOW_KEYS = [
|
|
13247
13247
|
"entry",
|
|
13248
13248
|
"entryPoints",
|
|
@@ -13260,7 +13260,7 @@ const NEGATED = "!";
|
|
|
13260
13260
|
const ROOT_WORKSPACE = ".";
|
|
13261
13261
|
const WRAP_OFFSET$1 = 1;
|
|
13262
13262
|
const NO_OFFSET = 0;
|
|
13263
|
-
const READ_CONCURRENCY$
|
|
13263
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13264
13264
|
const MESSAGE$9 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
|
|
13265
13265
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13266
13266
|
const FALLOW = {
|
|
@@ -13297,7 +13297,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
13297
13297
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
13298
13298
|
return pipe(patternsIn(kind.keys)(parsed.program), Array$1.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
13299
13299
|
});
|
|
13300
|
-
const problemsIn$
|
|
13300
|
+
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
13301
13301
|
const { root, file, kind, workspaces, entries } = request;
|
|
13302
13302
|
const files = yield* RepositoryFiles;
|
|
13303
13303
|
const path = files.join(root, file);
|
|
@@ -13313,7 +13313,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13313
13313
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13314
13314
|
file: path,
|
|
13315
13315
|
...positionOf(text.value)(start - kind.offset),
|
|
13316
|
-
rule: RULE$
|
|
13316
|
+
rule: RULE$55,
|
|
13317
13317
|
message: `${pattern} ${MESSAGE$9}`
|
|
13318
13318
|
})));
|
|
13319
13319
|
});
|
|
@@ -13336,17 +13336,17 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13336
13336
|
}];
|
|
13337
13337
|
return [];
|
|
13338
13338
|
}));
|
|
13339
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
13339
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
|
|
13340
13340
|
root,
|
|
13341
13341
|
file,
|
|
13342
13342
|
kind,
|
|
13343
13343
|
workspaces,
|
|
13344
13344
|
entries
|
|
13345
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13345
|
+
}), { concurrency: READ_CONCURRENCY$26 });
|
|
13346
13346
|
return Array$1.flatten(found);
|
|
13347
13347
|
});
|
|
13348
13348
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13349
|
-
const RULE$
|
|
13349
|
+
const RULE$54 = "listed-entry";
|
|
13350
13350
|
const ENTRY_KEYS = [
|
|
13351
13351
|
"entry",
|
|
13352
13352
|
"entryPoints",
|
|
@@ -13356,7 +13356,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
13356
13356
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13357
13357
|
const SEPARATOR$15 = "/";
|
|
13358
13358
|
const WRAP_OFFSET = 1;
|
|
13359
|
-
const READ_CONCURRENCY$
|
|
13359
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13360
13360
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13361
13361
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13362
13362
|
const entryPatternsIn = (node) => {
|
|
@@ -13367,7 +13367,7 @@ const entryPatternsIn = (node) => {
|
|
|
13367
13367
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13368
13368
|
};
|
|
13369
13369
|
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$15}`)(text))) || String$1.includes(SEPARATOR$15)(text) && !WILDCARD$2.test(text);
|
|
13370
|
-
const problemsIn$
|
|
13370
|
+
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13371
13371
|
const files = yield* RepositoryFiles;
|
|
13372
13372
|
const path = files.join(root, file);
|
|
13373
13373
|
const text = yield* files.readFile(path);
|
|
@@ -13376,7 +13376,7 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13376
13376
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13377
13377
|
file: path,
|
|
13378
13378
|
...positionOf(text.value)(start),
|
|
13379
|
-
rule: RULE$
|
|
13379
|
+
rule: RULE$54,
|
|
13380
13380
|
message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
|
|
13381
13381
|
})));
|
|
13382
13382
|
});
|
|
@@ -13384,11 +13384,11 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13384
13384
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13385
13385
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13386
13386
|
const directories = yield* workspaceDirectories(root);
|
|
13387
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$
|
|
13387
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$25 });
|
|
13388
13388
|
return Array$1.flatten(found);
|
|
13389
13389
|
});
|
|
13390
13390
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13391
|
-
const RULE$
|
|
13391
|
+
const RULE$53 = "root-workspace-path";
|
|
13392
13392
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13393
13393
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13394
13394
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13404,10 +13404,10 @@ const mentions = (directory) => (text) => {
|
|
|
13404
13404
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
13405
13405
|
}));
|
|
13406
13406
|
};
|
|
13407
|
-
const problemsIn$
|
|
13407
|
+
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13408
13408
|
file,
|
|
13409
13409
|
...positionOf(source)(found.start),
|
|
13410
|
-
rule: RULE$
|
|
13410
|
+
rule: RULE$53,
|
|
13411
13411
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
|
|
13412
13412
|
})));
|
|
13413
13413
|
/** @internal */
|
|
@@ -13418,13 +13418,13 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13418
13418
|
if (Option.isNone(source)) return [];
|
|
13419
13419
|
const directories = yield* workspaceDirectories(root);
|
|
13420
13420
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
13421
|
-
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$
|
|
13421
|
+
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13422
13422
|
});
|
|
13423
13423
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13424
|
-
const RULE$
|
|
13424
|
+
const RULE$52 = "hidden-verify";
|
|
13425
13425
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13426
13426
|
const FIRST$14 = 1;
|
|
13427
|
-
const READ_CONCURRENCY$
|
|
13427
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13428
13428
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13429
13429
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13430
13430
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13435,19 +13435,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13435
13435
|
file,
|
|
13436
13436
|
line: FIRST$14,
|
|
13437
13437
|
column: FIRST$14,
|
|
13438
|
-
rule: RULE$
|
|
13438
|
+
rule: RULE$52,
|
|
13439
13439
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
|
|
13440
13440
|
}).pipe(Option.filter(() => verified));
|
|
13441
13441
|
});
|
|
13442
13442
|
/** @internal */
|
|
13443
13443
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13444
13444
|
const directories = yield* workspaceDirectories(root);
|
|
13445
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13445
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
13446
13446
|
return Array$1.getSomes(found);
|
|
13447
13447
|
});
|
|
13448
13448
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13449
|
-
const RULE$
|
|
13450
|
-
const READ_CONCURRENCY$
|
|
13449
|
+
const RULE$51 = "shared-uncached-task";
|
|
13450
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13451
13451
|
const SHARED = 2;
|
|
13452
13452
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13453
13453
|
const UncachedTask = Schema.Struct({
|
|
@@ -13489,16 +13489,56 @@ const problemsOf$3 = (definitions) => {
|
|
|
13489
13489
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13490
13490
|
file,
|
|
13491
13491
|
...position,
|
|
13492
|
-
rule: RULE$
|
|
13492
|
+
rule: RULE$51,
|
|
13493
13493
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
|
|
13494
13494
|
})));
|
|
13495
13495
|
};
|
|
13496
13496
|
/** @internal */
|
|
13497
13497
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13498
13498
|
const directories = yield* workspaceDirectories(root);
|
|
13499
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13499
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
13500
13500
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13501
13501
|
});
|
|
13502
|
+
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13503
|
+
const RULE$50 = "tested-verify";
|
|
13504
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13505
|
+
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13506
|
+
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13507
|
+
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
13508
|
+
to: at.text,
|
|
13509
|
+
at
|
|
13510
|
+
})));
|
|
13511
|
+
const runsTests = (task) => TESTS.has(keyName(task.key)) || pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), stringsIn, Array$1.some(({ text }) => RUNS_TESTS.test(text)));
|
|
13512
|
+
const testsThrough = (byName) => (edge) => TESTS.has(edge.to) || pipe(Option.fromUndefinedOr(byName.get(edge.to)), Option.exists((target) => runsTests(target)));
|
|
13513
|
+
const edgesFrom = (byName, seen) => (name) => pipe(Option.fromUndefinedOr(byName.get(name)), Option.filter(() => !seen.has(name)), Option.match({
|
|
13514
|
+
onNone: () => [],
|
|
13515
|
+
onSome: (task) => {
|
|
13516
|
+
const next = /* @__PURE__ */ new Set([...seen, name]);
|
|
13517
|
+
const edges = edgesOf(task);
|
|
13518
|
+
const tests = testsThrough(byName);
|
|
13519
|
+
return [...pipe(edges, Array$1.filter(tests)), ...pipe(edges, Array$1.filter((edge) => !tests(edge)), Array$1.flatMap(({ to }) => edgesFrom(byName, next)(to)))];
|
|
13520
|
+
}
|
|
13521
|
+
}));
|
|
13522
|
+
const named$1 = (task) => [keyName(task.key), task];
|
|
13523
|
+
const testedEdges = (tasks) => {
|
|
13524
|
+
const byName = new Map(pipe(tasks, Array$1.map(named$1)));
|
|
13525
|
+
return edgesFrom(byName, /* @__PURE__ */ new Set())(TASK_NAMES.verify);
|
|
13526
|
+
};
|
|
13527
|
+
const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directory) {
|
|
13528
|
+
const config = yield* workspaceConfigOf(root, directory);
|
|
13529
|
+
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13530
|
+
file,
|
|
13531
|
+
...positionOf(source)(at.start),
|
|
13532
|
+
rule: RULE$50,
|
|
13533
|
+
message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
|
|
13534
|
+
})))));
|
|
13535
|
+
});
|
|
13536
|
+
/** @internal */
|
|
13537
|
+
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13538
|
+
const directories = yield* workspaceDirectories(root);
|
|
13539
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
13540
|
+
return Array$1.flatten(found);
|
|
13541
|
+
});
|
|
13502
13542
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13503
13543
|
const RULE$49 = "unlocked-task";
|
|
13504
13544
|
const READ_CONCURRENCY$21 = 8;
|
|
@@ -13527,6 +13567,7 @@ const checkTasks = Effect.fn("checkTasks")(function* checkTasks(root) {
|
|
|
13527
13567
|
const found = yield* Effect.all([
|
|
13528
13568
|
checkHiddenVerify(root),
|
|
13529
13569
|
checkSharedUncachedTasks(root),
|
|
13570
|
+
checkTestedVerify(root),
|
|
13530
13571
|
checkUnlockedTasks(root)
|
|
13531
13572
|
], { concurrency: "unbounded" });
|
|
13532
13573
|
return Array$1.flatten(found);
|
|
@@ -14535,21 +14576,19 @@ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root
|
|
|
14535
14576
|
});
|
|
14536
14577
|
/** @internal */
|
|
14537
14578
|
const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
|
|
14538
|
-
const enabledRules = yield* enabledRulesIn(root);
|
|
14539
|
-
const published = yield* publishedArticlesIn(root);
|
|
14540
|
-
const drafts = yield* draftArticlesIn(root);
|
|
14541
14579
|
return {
|
|
14542
|
-
enabledRules,
|
|
14580
|
+
enabledRules: yield* enabledRulesIn(root),
|
|
14543
14581
|
text: {
|
|
14544
|
-
ignores:
|
|
14582
|
+
ignores: TEXT_IGNORES,
|
|
14545
14583
|
builtRuleNames: builtTextRuleNames
|
|
14546
14584
|
},
|
|
14547
14585
|
markdown: {
|
|
14548
|
-
ignores:
|
|
14586
|
+
ignores: MARKDOWN_IGNORES,
|
|
14549
14587
|
rules: MARKDOWN_RULES
|
|
14550
14588
|
},
|
|
14551
14589
|
tasks: MSCH_TASK_COMMANDS,
|
|
14552
|
-
verifyTasks: Record.keys(
|
|
14590
|
+
verifyTasks: Record.keys(MSCH_VERIFY_COMMANDS),
|
|
14591
|
+
ciTasks: CI_TASKS,
|
|
14553
14592
|
secrets: secretsOf()
|
|
14554
14593
|
};
|
|
14555
14594
|
});
|
|
@@ -14617,8 +14656,13 @@ const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.bui
|
|
|
14617
14656
|
anchor: name,
|
|
14618
14657
|
message: `${owner} turns off ${name} or one of its rules. Rules are not turned off in a repository that uses msch: rewrite the text, or fix the rule in msch.`
|
|
14619
14658
|
})))];
|
|
14659
|
+
const checkedBySources = (section) => pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => listOf$2(sectionOf(source)["files"])));
|
|
14660
|
+
const ignoredOutsideSources = (section) => {
|
|
14661
|
+
const checked = checkedBySources(section);
|
|
14662
|
+
return pipe(listOf$2(section["ignores"]), Array$1.filter((ignored) => !Array$1.contains(checked, ignored)));
|
|
14663
|
+
};
|
|
14620
14664
|
const textWeakenings = (expected) => whenPresent("textlint section, so the Japanese text checks do not run", (section) => [
|
|
14621
|
-
...unless(Equal.equals(section
|
|
14665
|
+
...unless(Equal.equals(ignoredOutsideSources(section), expected.ignores), {
|
|
14622
14666
|
anchor: "ignores",
|
|
14623
14667
|
message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
|
|
14624
14668
|
}),
|
|
@@ -14632,16 +14676,28 @@ const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdow
|
|
|
14632
14676
|
anchor: "y8",
|
|
14633
14677
|
message: "y8.rules differs from what markdownOf builds. Markdown rules are not turned off or changed in a repository that uses msch."
|
|
14634
14678
|
})]);
|
|
14679
|
+
const missingDependencies$1 = (tasks, task) => (names) => {
|
|
14680
|
+
const dependsOn = listOf$2(sectionOf(tasks[task])["dependsOn"]);
|
|
14681
|
+
return pipe(names, Array$1.filter((name) => !Array$1.contains(dependsOn, name)), Array$1.map((name) => ({
|
|
14682
|
+
anchor: task,
|
|
14683
|
+
message: `${task} does not run the ${name} task. Leave ${task} as repositoryConfig builds it.`
|
|
14684
|
+
})));
|
|
14685
|
+
};
|
|
14635
14686
|
const taskWeakenings = (run, expected) => {
|
|
14636
14687
|
const tasks = sectionOf(sectionOf(run)["tasks"]);
|
|
14637
|
-
const dependsOn = listOf$2(sectionOf(tasks[
|
|
14638
|
-
return [
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14688
|
+
const dependsOn = listOf$2(sectionOf(tasks[TASK_NAMES.verify])["dependsOn"]);
|
|
14689
|
+
return [
|
|
14690
|
+
...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => !Equal.equals(sectionOf(tasks[name])["command"], command)), Array$1.map(([name]) => ({
|
|
14691
|
+
anchor: "run",
|
|
14692
|
+
message: `The ${name} task does not run what msch builds for it. Leave msch's tasks as repositoryConfig builds them; add other work under another task name.`
|
|
14693
|
+
}))),
|
|
14694
|
+
...missingDependencies$1(tasks, TASK_NAMES.verify)(expected.verifyTasks),
|
|
14695
|
+
...unless(!Array$1.contains(dependsOn, TASK_NAMES.test), {
|
|
14696
|
+
anchor: TASK_NAMES.verify,
|
|
14697
|
+
message: "verify runs the test task. Tests run in CI through the ci task, so verify, which the pre-push hook runs, leaves them out."
|
|
14698
|
+
}),
|
|
14699
|
+
...missingDependencies$1(tasks, "ci")(expected.ciTasks)
|
|
14700
|
+
];
|
|
14645
14701
|
};
|
|
14646
14702
|
const secretWeakenings = (h56m, expected) => unless(Equal.equals(h56m, expected), {
|
|
14647
14703
|
anchor: "h56m",
|