@r_masseater/msch 0.115.3 → 0.116.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 +295 -271
- package/dist/cli.mjs.map +1 -1
- package/dist/dependencies-CgIp-gS1.mjs +112 -0
- package/dist/dependencies-CgIp-gS1.mjs.map +1 -0
- package/dist/library.d.mts +11 -17
- package/dist/library.mjs +169 -25
- package/dist/library.mjs.map +1 -1
- package/dist/locked-inputs.mjs +20 -1
- package/dist/locked-inputs.mjs.map +1 -0
- package/dist/{published-J2q6skGp.mjs → published-BITU3twH.mjs} +10 -114
- package/dist/published-BITU3twH.mjs.map +1 -0
- package/dist/workspace-settings.mjs +2 -1
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +22 -49
- package/skills/msch-checks/SKILL.md +2 -0
- package/skills/msch-workspace-settings/SKILL.md +8 -0
- package/dist/locked-inputs-DMSoGCa-.mjs +0 -20
- package/dist/locked-inputs-DMSoGCa-.mjs.map +0 -1
- package/dist/published-J2q6skGp.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { i as nodeRepositoryFiles, n as NODE_MODULES$1, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-BU_wY36C.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-DaWjnZyW.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { i as workspaceDependencies$1, n as installedManifest, r as readManifest, t as dependencyEntries } from "./dependencies-CgIp-gS1.mjs";
|
|
5
5
|
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-DYfp6Tpn.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
7
|
+
import { _ as shadcnUiOf, a as workspaceConfigs, 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 } from "./published-BITU3twH.mjs";
|
|
7
8
|
import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-W6Uy7bV8.mjs";
|
|
8
9
|
import { a as CI_TASKS, c as meteredCommand, f as isIgnored, h as patternOf$1, m as namedWorkspaces, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES, u as existsAt } from "./repository-text-DEyMe2S6.mjs";
|
|
9
10
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
@@ -44,7 +45,7 @@ import { Base64 } from "effect/encoding";
|
|
|
44
45
|
import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
|
|
45
46
|
// package.json
|
|
46
47
|
var name = "@r_masseater/msch";
|
|
47
|
-
var version = "0.
|
|
48
|
+
var version = "0.116.0";
|
|
48
49
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
49
50
|
var repository = {
|
|
50
51
|
"type": "git",
|
|
@@ -1090,12 +1091,12 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1090
1091
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1091
1092
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1092
1093
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1093
|
-
const RULE$
|
|
1094
|
+
const RULE$79 = "git-subpath-dependency";
|
|
1094
1095
|
const WHOLE_MATCH$4 = 0;
|
|
1095
1096
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1096
1097
|
file,
|
|
1097
1098
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1098
|
-
rule: RULE$
|
|
1099
|
+
rule: RULE$79,
|
|
1099
1100
|
message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
|
|
1100
1101
|
});
|
|
1101
1102
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1106,13 +1107,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1106
1107
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1107
1108
|
});
|
|
1108
1109
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1109
|
-
const RULE$
|
|
1110
|
+
const RULE$78 = "unnamed-restriction";
|
|
1110
1111
|
const WHOLE_MATCH$3 = 0;
|
|
1111
1112
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1112
1113
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1113
1114
|
file: entry.file,
|
|
1114
1115
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1115
|
-
rule: RULE$
|
|
1116
|
+
rule: RULE$78,
|
|
1116
1117
|
message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
|
|
1117
1118
|
})));
|
|
1118
1119
|
/** @internal */
|
|
@@ -1121,13 +1122,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1121
1122
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1122
1123
|
});
|
|
1123
1124
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1124
|
-
const RULE$
|
|
1125
|
+
const RULE$77 = "named-type-exemption";
|
|
1125
1126
|
const WHOLE_MATCH$2 = 0;
|
|
1126
1127
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1127
1128
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1128
1129
|
file: entry.file,
|
|
1129
1130
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1130
|
-
rule: RULE$
|
|
1131
|
+
rule: RULE$77,
|
|
1131
1132
|
message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
|
|
1132
1133
|
})));
|
|
1133
1134
|
/** @internal */
|
|
@@ -1143,7 +1144,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1143
1144
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1144
1145
|
const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
|
|
1145
1146
|
// src/features/check-overrides/model/package-registry.ts
|
|
1146
|
-
const RULE$
|
|
1147
|
+
const RULE$76 = "package-registry";
|
|
1147
1148
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1148
1149
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1149
1150
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
@@ -1157,7 +1158,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
|
|
|
1157
1158
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1158
1159
|
file,
|
|
1159
1160
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1160
|
-
rule: RULE$
|
|
1161
|
+
rule: RULE$76,
|
|
1161
1162
|
message: Option.match(registry, {
|
|
1162
1163
|
onNone: () => `${REASON$3} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1163
1164
|
onSome: (value) => `${REASON$3} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1166,7 +1167,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1166
1167
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
|
|
1167
1168
|
file: entry.file,
|
|
1168
1169
|
...positionOf(source)(found.index ?? START$33),
|
|
1169
|
-
rule: RULE$
|
|
1170
|
+
rule: RULE$76,
|
|
1170
1171
|
message: `${REASON$3} This .npmrc overrides it with \`${String$1.trim(found[START$33])}\`. Remove the line.`
|
|
1171
1172
|
})));
|
|
1172
1173
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -1191,6 +1192,119 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
|
|
|
1191
1192
|
});
|
|
1192
1193
|
// src/entities/package/model/stack-catalog.ts
|
|
1193
1194
|
const STACK_CATALOG = "catalog:stack";
|
|
1195
|
+
// src/entities/package/model/specifiers.ts
|
|
1196
|
+
const START$32 = 0;
|
|
1197
|
+
const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
|
|
1198
|
+
const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
|
|
1199
|
+
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
1200
|
+
/** @internal */
|
|
1201
|
+
const fieldsOf = (value) => Option.getOrElse(decodeFields$1(value), () => ({}));
|
|
1202
|
+
/** @internal */
|
|
1203
|
+
const namedCatalogsOf = (settings) => Record.toEntries(fieldsOf(settings["catalogs"]));
|
|
1204
|
+
/** @internal */
|
|
1205
|
+
const specifiedIn = (held) => pipe(fieldsOf(held), Record.toEntries, Array$1.flatMap(([name, value]) => pipe(decodeString$1(value), Option.map((specifier) => ({
|
|
1206
|
+
name,
|
|
1207
|
+
specifier
|
|
1208
|
+
})), Option.toArray)));
|
|
1209
|
+
/** @internal */
|
|
1210
|
+
const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(text);
|
|
1211
|
+
/** @internal */
|
|
1212
|
+
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
|
|
1213
|
+
/** @internal */
|
|
1214
|
+
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$32));
|
|
1215
|
+
const SECTIONS$1 = [
|
|
1216
|
+
"dependencies",
|
|
1217
|
+
"devDependencies",
|
|
1218
|
+
"optionalDependencies"
|
|
1219
|
+
];
|
|
1220
|
+
/** @internal */
|
|
1221
|
+
const manifestSpecifiers = (source) => pipe(decodePackageJson(source), Option.map((manifest) => pipe(SECTIONS$1, Array$1.flatMap((section) => specifiedIn(manifest[section])))), Option.getOrElse(() => []));
|
|
1222
|
+
// src/entities/package/model/published-manifest.ts
|
|
1223
|
+
const EXCLUDED$9 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
1224
|
+
const isPublished$1 = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
|
|
1225
|
+
const publishedManifestOf = (source) => pipe(source, Option.flatMap(decodePackageJson), Option.filter(isPublished$1));
|
|
1226
|
+
/** @internal */
|
|
1227
|
+
const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* scanPublishedManifests(root, problemsIn) {
|
|
1228
|
+
const files = yield* RepositoryFiles;
|
|
1229
|
+
const manifests = yield* files.matchingFiles(root, [`:(glob)**/${PACKAGE_JSON_FILE}`, ...EXCLUDED$9]);
|
|
1230
|
+
return yield* scanText(pipe(manifests, Array$1.map((name) => ({
|
|
1231
|
+
name,
|
|
1232
|
+
file: files.join(root, name)
|
|
1233
|
+
}))), (entry, source) => pipe(publishedManifestOf(Option.some(source)), Option.map((manifest) => problemsIn({
|
|
1234
|
+
entry,
|
|
1235
|
+
source,
|
|
1236
|
+
manifest
|
|
1237
|
+
})), Option.getOrElse(() => [])));
|
|
1238
|
+
});
|
|
1239
|
+
// src/shared/config/self.ts
|
|
1240
|
+
const GIT_PREFIX = /^git\+/u;
|
|
1241
|
+
const GIT_SUFFIX = /\.git$/u;
|
|
1242
|
+
const GITHUB$6 = "https://github.com/";
|
|
1243
|
+
const SELF_NAME = name;
|
|
1244
|
+
const SELF_HOMEPAGE = homepage;
|
|
1245
|
+
const SELF_DIRECTORY = repository.directory;
|
|
1246
|
+
const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
1247
|
+
// src/features/check-overrides/model/removed-peers.ts
|
|
1248
|
+
const RULE$75 = "removed-peer";
|
|
1249
|
+
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
1250
|
+
const REMOVED = "-";
|
|
1251
|
+
const PARENT_SEPARATOR = ">";
|
|
1252
|
+
const VERSION_SEPARATOR = "@";
|
|
1253
|
+
const SCOPED_START = 1;
|
|
1254
|
+
const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(String$1.slice(SCOPED_START)(selector)), Option.match({
|
|
1255
|
+
onNone: () => selector,
|
|
1256
|
+
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
1257
|
+
}));
|
|
1258
|
+
const removalOf$1 = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
1259
|
+
onEmpty: () => Option.none(),
|
|
1260
|
+
onNonEmpty: (parents, target) => Option.some({
|
|
1261
|
+
key,
|
|
1262
|
+
target: packageNameOf$1(target),
|
|
1263
|
+
parent: pipe(Array$1.last(parents), Option.map(packageNameOf$1))
|
|
1264
|
+
})
|
|
1265
|
+
});
|
|
1266
|
+
const removesPeer = ({ target, parent }) => ({ peer, dependent }) => peer === target && Option.match(parent, {
|
|
1267
|
+
onNone: () => true,
|
|
1268
|
+
onSome: (name) => name === dependent
|
|
1269
|
+
});
|
|
1270
|
+
const isRemoval = (value) => value === REMOVED;
|
|
1271
|
+
const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
1272
|
+
file,
|
|
1273
|
+
line,
|
|
1274
|
+
column,
|
|
1275
|
+
rule: RULE$75,
|
|
1276
|
+
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
1277
|
+
});
|
|
1278
|
+
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
1279
|
+
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
1280
|
+
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf$1(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
1281
|
+
const requiredPeersOf$1 = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
1282
|
+
peer,
|
|
1283
|
+
dependent
|
|
1284
|
+
})));
|
|
1285
|
+
const mschPeers = Effect.fn("mschPeers")(function* mschPeers() {
|
|
1286
|
+
const files = yield* RepositoryFiles;
|
|
1287
|
+
const own = findPackageJson(SELF_NAME, import.meta.url);
|
|
1288
|
+
if (Option.isNone(own)) return [];
|
|
1289
|
+
const manifest = yield* readManifest(files.dirname(own.value));
|
|
1290
|
+
const dependencies = pipe(manifest, Option.map(({ dependencies: held }) => Record.keys(held ?? {})), Option.getOrElse(() => []));
|
|
1291
|
+
const found = yield* Effect.forEach(dependencies, (dependency) => Effect.map(installedManifest(dependency, own.value), (installed) => pipe(installed, Option.map((held) => requiredPeersOf$1(dependency, held)), Option.getOrElse(() => []))), { concurrency: 1 });
|
|
1292
|
+
return Array$1.flatten(found);
|
|
1293
|
+
});
|
|
1294
|
+
/** @internal */
|
|
1295
|
+
const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedPeers(root) {
|
|
1296
|
+
const files = yield* RepositoryFiles;
|
|
1297
|
+
const overrides = yield* workspaceOverrides(root);
|
|
1298
|
+
if (!pipe(Record.values(overrides), Array$1.some(isRemoval))) return [];
|
|
1299
|
+
const file = files.join(root, WORKSPACE_FILE$5);
|
|
1300
|
+
const source = yield* files.readFile(file);
|
|
1301
|
+
const peers = yield* mschPeers();
|
|
1302
|
+
return removedPeerProblems(peers)({
|
|
1303
|
+
file,
|
|
1304
|
+
source: Option.getOrElse(source, () => ""),
|
|
1305
|
+
overrides
|
|
1306
|
+
});
|
|
1307
|
+
});
|
|
1194
1308
|
// ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
1195
1309
|
const balanced = (a, b, str) => {
|
|
1196
1310
|
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
@@ -3298,121 +3412,8 @@ const matcher = (patterns) => {
|
|
|
3298
3412
|
};
|
|
3299
3413
|
String$1.startsWith(NEGATION$1);
|
|
3300
3414
|
String$1.slice(1);
|
|
3301
|
-
// src/entities/package/model/specifiers.ts
|
|
3302
|
-
const START$32 = 0;
|
|
3303
|
-
const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
|
|
3304
|
-
const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
|
|
3305
|
-
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
3306
|
-
/** @internal */
|
|
3307
|
-
const fieldsOf = (value) => Option.getOrElse(decodeFields$1(value), () => ({}));
|
|
3308
|
-
/** @internal */
|
|
3309
|
-
const namedCatalogsOf = (settings) => Record.toEntries(fieldsOf(settings["catalogs"]));
|
|
3310
|
-
/** @internal */
|
|
3311
|
-
const specifiedIn = (held) => pipe(fieldsOf(held), Record.toEntries, Array$1.flatMap(([name, value]) => pipe(decodeString$1(value), Option.map((specifier) => ({
|
|
3312
|
-
name,
|
|
3313
|
-
specifier
|
|
3314
|
-
})), Option.toArray)));
|
|
3315
|
-
/** @internal */
|
|
3316
|
-
const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(text);
|
|
3317
|
-
/** @internal */
|
|
3318
|
-
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
|
|
3319
|
-
/** @internal */
|
|
3320
|
-
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$32));
|
|
3321
|
-
const SECTIONS$1 = [
|
|
3322
|
-
"dependencies",
|
|
3323
|
-
"devDependencies",
|
|
3324
|
-
"optionalDependencies"
|
|
3325
|
-
];
|
|
3326
|
-
/** @internal */
|
|
3327
|
-
const manifestSpecifiers = (source) => pipe(decodePackageJson(source), Option.map((manifest) => pipe(SECTIONS$1, Array$1.flatMap((section) => specifiedIn(manifest[section])))), Option.getOrElse(() => []));
|
|
3328
|
-
// src/entities/package/model/published-manifest.ts
|
|
3329
|
-
const EXCLUDED$9 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
3330
|
-
const isPublished$1 = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
|
|
3331
|
-
const publishedManifestOf = (source) => pipe(source, Option.flatMap(decodePackageJson), Option.filter(isPublished$1));
|
|
3332
|
-
/** @internal */
|
|
3333
|
-
const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* scanPublishedManifests(root, problemsIn) {
|
|
3334
|
-
const files = yield* RepositoryFiles;
|
|
3335
|
-
const manifests = yield* files.matchingFiles(root, [`:(glob)**/${PACKAGE_JSON_FILE}`, ...EXCLUDED$9]);
|
|
3336
|
-
return yield* scanText(pipe(manifests, Array$1.map((name) => ({
|
|
3337
|
-
name,
|
|
3338
|
-
file: files.join(root, name)
|
|
3339
|
-
}))), (entry, source) => pipe(publishedManifestOf(Option.some(source)), Option.map((manifest) => problemsIn({
|
|
3340
|
-
entry,
|
|
3341
|
-
source,
|
|
3342
|
-
manifest
|
|
3343
|
-
})), Option.getOrElse(() => [])));
|
|
3344
|
-
});
|
|
3345
|
-
// src/shared/config/self.ts
|
|
3346
|
-
const GIT_PREFIX = /^git\+/u;
|
|
3347
|
-
const GIT_SUFFIX = /\.git$/u;
|
|
3348
|
-
const GITHUB$6 = "https://github.com/";
|
|
3349
|
-
const SELF_NAME = name;
|
|
3350
|
-
const SELF_HOMEPAGE = homepage;
|
|
3351
|
-
const SELF_DIRECTORY = repository.directory;
|
|
3352
|
-
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`;
|
|
3353
|
-
// src/features/check-overrides/model/removed-peers.ts
|
|
3354
|
-
const RULE$74 = "removed-peer";
|
|
3355
|
-
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
3356
|
-
const REMOVED = "-";
|
|
3357
|
-
const PARENT_SEPARATOR = ">";
|
|
3358
|
-
const VERSION_SEPARATOR = "@";
|
|
3359
|
-
const SCOPED_START = 1;
|
|
3360
|
-
const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(String$1.slice(SCOPED_START)(selector)), Option.match({
|
|
3361
|
-
onNone: () => selector,
|
|
3362
|
-
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
3363
|
-
}));
|
|
3364
|
-
const removalOf$1 = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
3365
|
-
onEmpty: () => Option.none(),
|
|
3366
|
-
onNonEmpty: (parents, target) => Option.some({
|
|
3367
|
-
key,
|
|
3368
|
-
target: packageNameOf$1(target),
|
|
3369
|
-
parent: pipe(Array$1.last(parents), Option.map(packageNameOf$1))
|
|
3370
|
-
})
|
|
3371
|
-
});
|
|
3372
|
-
const removesPeer = ({ target, parent }) => ({ peer, dependent }) => peer === target && Option.match(parent, {
|
|
3373
|
-
onNone: () => true,
|
|
3374
|
-
onSome: (name) => name === dependent
|
|
3375
|
-
});
|
|
3376
|
-
const isRemoval = (value) => value === REMOVED;
|
|
3377
|
-
const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
3378
|
-
file,
|
|
3379
|
-
line,
|
|
3380
|
-
column,
|
|
3381
|
-
rule: RULE$74,
|
|
3382
|
-
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
3383
|
-
});
|
|
3384
|
-
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
3385
|
-
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
3386
|
-
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf$1(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
3387
|
-
const requiredPeersOf$1 = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
3388
|
-
peer,
|
|
3389
|
-
dependent
|
|
3390
|
-
})));
|
|
3391
|
-
const mschPeers = Effect.fn("mschPeers")(function* mschPeers() {
|
|
3392
|
-
const files = yield* RepositoryFiles;
|
|
3393
|
-
const own = findPackageJson(SELF_NAME, import.meta.url);
|
|
3394
|
-
if (Option.isNone(own)) return [];
|
|
3395
|
-
const manifest = yield* readManifest(files.dirname(own.value));
|
|
3396
|
-
const dependencies = pipe(manifest, Option.map(({ dependencies: held }) => Record.keys(held ?? {})), Option.getOrElse(() => []));
|
|
3397
|
-
const found = yield* Effect.forEach(dependencies, (dependency) => Effect.map(installedManifest(dependency, own.value), (installed) => pipe(installed, Option.map((held) => requiredPeersOf$1(dependency, held)), Option.getOrElse(() => []))), { concurrency: 1 });
|
|
3398
|
-
return Array$1.flatten(found);
|
|
3399
|
-
});
|
|
3400
|
-
/** @internal */
|
|
3401
|
-
const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedPeers(root) {
|
|
3402
|
-
const files = yield* RepositoryFiles;
|
|
3403
|
-
const overrides = yield* workspaceOverrides(root);
|
|
3404
|
-
if (!pipe(Record.values(overrides), Array$1.some(isRemoval))) return [];
|
|
3405
|
-
const file = files.join(root, WORKSPACE_FILE$5);
|
|
3406
|
-
const source = yield* files.readFile(file);
|
|
3407
|
-
const peers = yield* mschPeers();
|
|
3408
|
-
return removedPeerProblems(peers)({
|
|
3409
|
-
file,
|
|
3410
|
-
source: Option.getOrElse(source, () => ""),
|
|
3411
|
-
overrides
|
|
3412
|
-
});
|
|
3413
|
-
});
|
|
3414
3415
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3415
|
-
const RULE$
|
|
3416
|
+
const RULE$74 = "colocated-git-patterns";
|
|
3416
3417
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3417
3418
|
const ROOT$3 = ".";
|
|
3418
3419
|
const NEGATION = "!";
|
|
@@ -3459,7 +3460,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3459
3460
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3460
3461
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3461
3462
|
});
|
|
3462
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3463
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$74)(entry.file, {
|
|
3463
3464
|
line: entry.line,
|
|
3464
3465
|
column: FIRST$26
|
|
3465
3466
|
}, message);
|
|
@@ -3522,7 +3523,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
3522
3523
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3523
3524
|
});
|
|
3524
3525
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3525
|
-
const RULE$
|
|
3526
|
+
const RULE$73 = "colocated-test";
|
|
3526
3527
|
const FIRST$25 = 1;
|
|
3527
3528
|
const READ_CONCURRENCY$40 = 64;
|
|
3528
3529
|
const ROOT_SUBPATH$2 = ".";
|
|
@@ -3545,7 +3546,7 @@ const problemFor$10 = (test, message) => ({
|
|
|
3545
3546
|
file: test.file,
|
|
3546
3547
|
line: FIRST$25,
|
|
3547
3548
|
column: FIRST$25,
|
|
3548
|
-
rule: RULE$
|
|
3549
|
+
rule: RULE$73,
|
|
3549
3550
|
message: `${test.base} ${message}`
|
|
3550
3551
|
});
|
|
3551
3552
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
@@ -3628,7 +3629,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3628
3629
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3629
3630
|
const RECOMMENDED_LINES = 200;
|
|
3630
3631
|
const FIRST$24 = 1;
|
|
3631
|
-
const RULE$
|
|
3632
|
+
const RULE$72 = "agent-docs-length";
|
|
3632
3633
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3633
3634
|
const problemFor$9 = (file) => (lines) => {
|
|
3634
3635
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3636,19 +3637,19 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3636
3637
|
file,
|
|
3637
3638
|
line: 201,
|
|
3638
3639
|
column: FIRST$24,
|
|
3639
|
-
rule: RULE$
|
|
3640
|
+
rule: RULE$72,
|
|
3640
3641
|
message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
|
|
3641
3642
|
});
|
|
3642
3643
|
};
|
|
3643
3644
|
/** @internal */
|
|
3644
3645
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3645
3646
|
// src/features/check-placement/model/claude-link.ts
|
|
3646
|
-
const RULE$
|
|
3647
|
+
const RULE$71 = "claude-md-link";
|
|
3647
3648
|
const CLAUDE = "CLAUDE.md";
|
|
3648
3649
|
const AGENTS = "AGENTS.md";
|
|
3649
3650
|
const FIRST$23 = 1;
|
|
3650
3651
|
const READ_CONCURRENCY$38 = 16;
|
|
3651
|
-
const MESSAGE$
|
|
3652
|
+
const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3652
3653
|
/** @internal */
|
|
3653
3654
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
3654
3655
|
const files = yield* RepositoryFiles;
|
|
@@ -3662,8 +3663,8 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3662
3663
|
file: path,
|
|
3663
3664
|
line: FIRST$23,
|
|
3664
3665
|
column: FIRST$23,
|
|
3665
|
-
rule: RULE$
|
|
3666
|
-
message: MESSAGE$
|
|
3666
|
+
rule: RULE$71,
|
|
3667
|
+
message: MESSAGE$15
|
|
3667
3668
|
})));
|
|
3668
3669
|
});
|
|
3669
3670
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
@@ -3671,7 +3672,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3671
3672
|
return Array$1.getSomes(found);
|
|
3672
3673
|
});
|
|
3673
3674
|
// src/features/check-placement/model/dangling-links.ts
|
|
3674
|
-
const RULE$
|
|
3675
|
+
const RULE$70 = "dangling-link";
|
|
3675
3676
|
const SEPARATOR$25 = "/";
|
|
3676
3677
|
const FIRST$22 = 1;
|
|
3677
3678
|
const READ_CONCURRENCY$37 = 16;
|
|
@@ -3687,7 +3688,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3687
3688
|
file,
|
|
3688
3689
|
line: FIRST$22,
|
|
3689
3690
|
column: FIRST$22,
|
|
3690
|
-
rule: RULE$
|
|
3691
|
+
rule: RULE$70,
|
|
3691
3692
|
message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
|
|
3692
3693
|
})));
|
|
3693
3694
|
});
|
|
@@ -3745,7 +3746,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3745
3746
|
}));
|
|
3746
3747
|
});
|
|
3747
3748
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3748
|
-
const RULE$
|
|
3749
|
+
const RULE$69 = "deployed-readme";
|
|
3749
3750
|
const ROOT_DIRECTORY$4 = "";
|
|
3750
3751
|
const READ_CONCURRENCY$36 = 16;
|
|
3751
3752
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
@@ -3785,14 +3786,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3785
3786
|
const readme = yield* readReadme({
|
|
3786
3787
|
root,
|
|
3787
3788
|
directory,
|
|
3788
|
-
rule: RULE$
|
|
3789
|
+
rule: RULE$69,
|
|
3789
3790
|
missingMessage: MISSING_MESSAGE$2
|
|
3790
3791
|
});
|
|
3791
3792
|
return Result.match(readme, {
|
|
3792
3793
|
onFailure: Option.some,
|
|
3793
3794
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3794
3795
|
file,
|
|
3795
|
-
rule: RULE$
|
|
3796
|
+
rule: RULE$69,
|
|
3796
3797
|
message: NO_URL_MESSAGE
|
|
3797
3798
|
})))
|
|
3798
3799
|
});
|
|
@@ -3809,7 +3810,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3809
3810
|
return Array$1.getSomes(found);
|
|
3810
3811
|
});
|
|
3811
3812
|
// src/features/check-placement/model/nested-docs.ts
|
|
3812
|
-
const RULE$
|
|
3813
|
+
const RULE$68 = "nested-docs";
|
|
3813
3814
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3814
3815
|
const SEPARATOR$23 = "/";
|
|
3815
3816
|
const READ_CONCURRENCY$35 = 64;
|
|
@@ -3822,7 +3823,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3822
3823
|
const taggedError$13 = Schema.TaggedError;
|
|
3823
3824
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3824
3825
|
const isNested = (name) => String$1.includes(SEPARATOR$23)(name);
|
|
3825
|
-
const problemFor$8 = problemInFile(RULE$
|
|
3826
|
+
const problemFor$8 = problemInFile(RULE$68);
|
|
3826
3827
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3827
3828
|
const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
|
|
3828
3829
|
const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
|
|
@@ -3879,15 +3880,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3879
3880
|
return [...Array$1.getSomes(found), ...missing];
|
|
3880
3881
|
});
|
|
3881
3882
|
// src/features/check-placement/model/published-readme.ts
|
|
3882
|
-
const RULE$
|
|
3883
|
+
const RULE$67 = "published-readme";
|
|
3883
3884
|
const READ_CONCURRENCY$34 = 16;
|
|
3884
|
-
const MESSAGE$
|
|
3885
|
+
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3885
3886
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3886
3887
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3887
3888
|
const readme = yield* readReadme({
|
|
3888
3889
|
root,
|
|
3889
3890
|
directory,
|
|
3890
|
-
rule: RULE$
|
|
3891
|
+
rule: RULE$67,
|
|
3891
3892
|
missingMessage: MISSING_MESSAGE
|
|
3892
3893
|
});
|
|
3893
3894
|
return Result.match(readme, {
|
|
@@ -3898,8 +3899,8 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3898
3899
|
file,
|
|
3899
3900
|
line,
|
|
3900
3901
|
column,
|
|
3901
|
-
rule: RULE$
|
|
3902
|
-
message: MESSAGE$
|
|
3902
|
+
rule: RULE$67,
|
|
3903
|
+
message: MESSAGE$14
|
|
3903
3904
|
};
|
|
3904
3905
|
}))
|
|
3905
3906
|
});
|
|
@@ -3911,10 +3912,10 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
3911
3912
|
return Array$1.getSomes(found);
|
|
3912
3913
|
});
|
|
3913
3914
|
// src/features/check-placement/model/published-tests.ts
|
|
3914
|
-
const RULE$
|
|
3915
|
+
const RULE$66 = "published-tests";
|
|
3915
3916
|
const FILE_START = 1;
|
|
3916
3917
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3917
|
-
const MESSAGE$
|
|
3918
|
+
const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
3918
3919
|
const testedIn = (listed) => (prefix) => pipe(listed, Array$1.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$3.test(file)));
|
|
3919
3920
|
const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
|
|
3920
3921
|
const files = yield* RepositoryFiles;
|
|
@@ -3925,8 +3926,8 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3925
3926
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3926
3927
|
line: FILE_START,
|
|
3927
3928
|
column: FILE_START,
|
|
3928
|
-
rule: RULE$
|
|
3929
|
-
message: MESSAGE$
|
|
3929
|
+
rule: RULE$66,
|
|
3930
|
+
message: MESSAGE$13
|
|
3930
3931
|
});
|
|
3931
3932
|
});
|
|
3932
3933
|
/** @internal */
|
|
@@ -3939,12 +3940,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3939
3940
|
return Array$1.getSomes(found);
|
|
3940
3941
|
});
|
|
3941
3942
|
// src/features/check-placement/model/root-docs.ts
|
|
3942
|
-
const RULE$
|
|
3943
|
+
const RULE$65 = "root-docs";
|
|
3943
3944
|
const SEPARATOR$22 = "/";
|
|
3944
3945
|
const FIRST$20 = 1;
|
|
3945
3946
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
3946
3947
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3947
|
-
const MESSAGE$
|
|
3948
|
+
const MESSAGE$12 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
|
|
3948
3949
|
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$22)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
3949
3950
|
/** @internal */
|
|
3950
3951
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
@@ -3954,12 +3955,12 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3954
3955
|
file: files.join(root, name),
|
|
3955
3956
|
line: FIRST$20,
|
|
3956
3957
|
column: FIRST$20,
|
|
3957
|
-
rule: RULE$
|
|
3958
|
-
message: `${name} ${MESSAGE$
|
|
3958
|
+
rule: RULE$65,
|
|
3959
|
+
message: `${name} ${MESSAGE$12}`
|
|
3959
3960
|
})));
|
|
3960
3961
|
});
|
|
3961
3962
|
// src/features/check-placement/model/root-readme.ts
|
|
3962
|
-
const RULE$
|
|
3963
|
+
const RULE$64 = "root-readme";
|
|
3963
3964
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3964
3965
|
const READ_CONCURRENCY$33 = 16;
|
|
3965
3966
|
const START$31 = 0;
|
|
@@ -4002,7 +4003,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4002
4003
|
const message = messageFor$5(workspace.directory);
|
|
4003
4004
|
const at = positionOf(source);
|
|
4004
4005
|
const pattern = patternFor(plugins)(workspace);
|
|
4005
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4006
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$64)(file, at(found.index ?? START$31), message)));
|
|
4006
4007
|
};
|
|
4007
4008
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4008
4009
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4039,7 +4040,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4039
4040
|
return Array$1.flatten(found);
|
|
4040
4041
|
});
|
|
4041
4042
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4042
|
-
const RULE$
|
|
4043
|
+
const RULE$63 = "docs-mirror";
|
|
4043
4044
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4044
4045
|
const MIRROR_LIMIT = 3;
|
|
4045
4046
|
const READ_CONCURRENCY$32 = 16;
|
|
@@ -4064,7 +4065,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4064
4065
|
file,
|
|
4065
4066
|
line,
|
|
4066
4067
|
column,
|
|
4067
|
-
rule: RULE$
|
|
4068
|
+
rule: RULE$63,
|
|
4068
4069
|
message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
|
|
4069
4070
|
};
|
|
4070
4071
|
}), Option.toArray);
|
|
@@ -4096,10 +4097,10 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4096
4097
|
return Array$1.flatten(found);
|
|
4097
4098
|
});
|
|
4098
4099
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4099
|
-
const RULE$
|
|
4100
|
+
const RULE$62 = "ignored-sources";
|
|
4100
4101
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4101
4102
|
const FIRST$19 = 1;
|
|
4102
|
-
const MESSAGE$
|
|
4103
|
+
const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
4103
4104
|
/** @internal */
|
|
4104
4105
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
4105
4106
|
const files = yield* RepositoryFiles;
|
|
@@ -4108,8 +4109,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4108
4109
|
file: files.join(root, file),
|
|
4109
4110
|
line: FIRST$19,
|
|
4110
4111
|
column: FIRST$19,
|
|
4111
|
-
rule: RULE$
|
|
4112
|
-
message: MESSAGE$
|
|
4112
|
+
rule: RULE$62,
|
|
4113
|
+
message: MESSAGE$11
|
|
4113
4114
|
})));
|
|
4114
4115
|
});
|
|
4115
4116
|
// src/features/check-placement/model/public-entries.ts
|
|
@@ -12865,13 +12866,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12865
12866
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12866
12867
|
});
|
|
12867
12868
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12868
|
-
const RULE$
|
|
12869
|
+
const RULE$61 = "shadcn-ui-alias";
|
|
12869
12870
|
const FIRST$18 = 1;
|
|
12870
12871
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12871
12872
|
file,
|
|
12872
12873
|
line: FIRST$18,
|
|
12873
12874
|
column: FIRST$18,
|
|
12874
|
-
rule: RULE$
|
|
12875
|
+
rule: RULE$61,
|
|
12875
12876
|
message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
|
|
12876
12877
|
});
|
|
12877
12878
|
/** @internal */
|
|
@@ -13139,7 +13140,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13139
13140
|
])));
|
|
13140
13141
|
});
|
|
13141
13142
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13142
|
-
const RULE$
|
|
13143
|
+
const RULE$60 = "config-path";
|
|
13143
13144
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13144
13145
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13145
13146
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -13158,7 +13159,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
13158
13159
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13159
13160
|
file,
|
|
13160
13161
|
...positionOf(source)(mention.index),
|
|
13161
|
-
rule: RULE$
|
|
13162
|
+
rule: RULE$60,
|
|
13162
13163
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13163
13164
|
});
|
|
13164
13165
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13183,7 +13184,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13183
13184
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13184
13185
|
file,
|
|
13185
13186
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13186
|
-
rule: RULE$
|
|
13187
|
+
rule: RULE$60,
|
|
13187
13188
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13188
13189
|
})));
|
|
13189
13190
|
});
|
|
@@ -13195,7 +13196,7 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
|
|
|
13195
13196
|
return [...Array$1.flatten(found), ...patterns];
|
|
13196
13197
|
});
|
|
13197
13198
|
// src/features/check-repository-layout/model/crates.ts
|
|
13198
|
-
const RULE$
|
|
13199
|
+
const RULE$59 = "unverified-crate";
|
|
13199
13200
|
const VERSION_RULE = "release-version";
|
|
13200
13201
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13201
13202
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
@@ -13207,7 +13208,7 @@ const problemFor$5 = (crate, message) => ({
|
|
|
13207
13208
|
file: crate.manifest,
|
|
13208
13209
|
line: FIRST$16,
|
|
13209
13210
|
column: FIRST$16,
|
|
13210
|
-
rule: RULE$
|
|
13211
|
+
rule: RULE$59,
|
|
13211
13212
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13212
13213
|
});
|
|
13213
13214
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13243,7 +13244,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13243
13244
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13244
13245
|
});
|
|
13245
13246
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13246
|
-
const RULE$
|
|
13247
|
+
const RULE$58 = "deploy-entry-pattern";
|
|
13247
13248
|
const FALLOW_KEYS = [
|
|
13248
13249
|
"entry",
|
|
13249
13250
|
"entryPoints",
|
|
@@ -13262,7 +13263,7 @@ const ROOT_WORKSPACE = ".";
|
|
|
13262
13263
|
const WRAP_OFFSET$1 = 1;
|
|
13263
13264
|
const NO_OFFSET = 0;
|
|
13264
13265
|
const READ_CONCURRENCY$27 = 8;
|
|
13265
|
-
const MESSAGE$
|
|
13266
|
+
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.";
|
|
13266
13267
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13267
13268
|
const FALLOW = {
|
|
13268
13269
|
keys: FALLOW_KEYS,
|
|
@@ -13314,8 +13315,8 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13314
13315
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13315
13316
|
file: path,
|
|
13316
13317
|
...positionOf(text.value)(start - kind.offset),
|
|
13317
|
-
rule: RULE$
|
|
13318
|
-
message: `${pattern} ${MESSAGE$
|
|
13318
|
+
rule: RULE$58,
|
|
13319
|
+
message: `${pattern} ${MESSAGE$10}`
|
|
13319
13320
|
})));
|
|
13320
13321
|
});
|
|
13321
13322
|
/** @internal */
|
|
@@ -13347,7 +13348,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13347
13348
|
return Array$1.flatten(found);
|
|
13348
13349
|
});
|
|
13349
13350
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13350
|
-
const RULE$
|
|
13351
|
+
const RULE$57 = "listed-entry";
|
|
13351
13352
|
const ENTRY_KEYS = [
|
|
13352
13353
|
"entry",
|
|
13353
13354
|
"entryPoints",
|
|
@@ -13377,7 +13378,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13377
13378
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13378
13379
|
file: path,
|
|
13379
13380
|
...positionOf(text.value)(start),
|
|
13380
|
-
rule: RULE$
|
|
13381
|
+
rule: RULE$57,
|
|
13381
13382
|
message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
|
|
13382
13383
|
})));
|
|
13383
13384
|
});
|
|
@@ -13389,7 +13390,7 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
13389
13390
|
return Array$1.flatten(found);
|
|
13390
13391
|
});
|
|
13391
13392
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13392
|
-
const RULE$
|
|
13393
|
+
const RULE$56 = "root-workspace-path";
|
|
13393
13394
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13394
13395
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13395
13396
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13408,7 +13409,7 @@ const mentions = (directory) => (text) => {
|
|
|
13408
13409
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13409
13410
|
file,
|
|
13410
13411
|
...positionOf(source)(found.start),
|
|
13411
|
-
rule: RULE$
|
|
13412
|
+
rule: RULE$56,
|
|
13412
13413
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
|
|
13413
13414
|
})));
|
|
13414
13415
|
/** @internal */
|
|
@@ -13422,7 +13423,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13422
13423
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13423
13424
|
});
|
|
13424
13425
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13425
|
-
const RULE$
|
|
13426
|
+
const RULE$55 = "hidden-verify";
|
|
13426
13427
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13427
13428
|
const FIRST$14 = 1;
|
|
13428
13429
|
const READ_CONCURRENCY$25 = 8;
|
|
@@ -13436,7 +13437,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13436
13437
|
file,
|
|
13437
13438
|
line: FIRST$14,
|
|
13438
13439
|
column: FIRST$14,
|
|
13439
|
-
rule: RULE$
|
|
13440
|
+
rule: RULE$55,
|
|
13440
13441
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
|
|
13441
13442
|
}).pipe(Option.filter(() => verified));
|
|
13442
13443
|
});
|
|
@@ -13447,7 +13448,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
13447
13448
|
return Array$1.getSomes(found);
|
|
13448
13449
|
});
|
|
13449
13450
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13450
|
-
const RULE$
|
|
13451
|
+
const RULE$54 = "shared-uncached-task";
|
|
13451
13452
|
const READ_CONCURRENCY$24 = 8;
|
|
13452
13453
|
const SHARED = 2;
|
|
13453
13454
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -13490,7 +13491,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
13490
13491
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13491
13492
|
file,
|
|
13492
13493
|
...position,
|
|
13493
|
-
rule: RULE$
|
|
13494
|
+
rule: RULE$54,
|
|
13494
13495
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
|
|
13495
13496
|
})));
|
|
13496
13497
|
};
|
|
@@ -13501,7 +13502,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
13501
13502
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13502
13503
|
});
|
|
13503
13504
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13504
|
-
const RULE$
|
|
13505
|
+
const RULE$53 = "tested-verify";
|
|
13505
13506
|
const READ_CONCURRENCY$23 = 8;
|
|
13506
13507
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13507
13508
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
@@ -13530,7 +13531,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13530
13531
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13531
13532
|
file,
|
|
13532
13533
|
...positionOf(source)(at.start),
|
|
13533
|
-
rule: RULE$
|
|
13534
|
+
rule: RULE$53,
|
|
13534
13535
|
message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
|
|
13535
13536
|
})))));
|
|
13536
13537
|
});
|
|
@@ -13541,7 +13542,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
|
|
|
13541
13542
|
return Array$1.flatten(found);
|
|
13542
13543
|
});
|
|
13543
13544
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13544
|
-
const RULE$
|
|
13545
|
+
const RULE$52 = "unlocked-task";
|
|
13545
13546
|
const READ_CONCURRENCY$22 = 8;
|
|
13546
13547
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13547
13548
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -13553,7 +13554,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13553
13554
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13554
13555
|
file,
|
|
13555
13556
|
...positionOf(source)(task.start),
|
|
13556
|
-
rule: RULE$
|
|
13557
|
+
rule: RULE$52,
|
|
13557
13558
|
message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
|
|
13558
13559
|
})), Option.toArray)));
|
|
13559
13560
|
/** @internal */
|
|
@@ -13869,7 +13870,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13869
13870
|
return yield* files.mergeBase(root, base);
|
|
13870
13871
|
});
|
|
13871
13872
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13872
|
-
const RULE$
|
|
13873
|
+
const RULE$51 = "migration-order";
|
|
13873
13874
|
const SNAPSHOT = "snapshot.json";
|
|
13874
13875
|
const MIGRATION = "migration.sql";
|
|
13875
13876
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
@@ -13903,7 +13904,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13903
13904
|
file: join(root, file),
|
|
13904
13905
|
line: FIRST$13,
|
|
13905
13906
|
column: FIRST$13,
|
|
13906
|
-
rule: RULE$
|
|
13907
|
+
rule: RULE$51,
|
|
13907
13908
|
message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
|
|
13908
13909
|
})))), Option.getOrElse(() => []));
|
|
13909
13910
|
/** @internal */
|
|
@@ -13954,7 +13955,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
13954
13955
|
catch: bundleErrorDetail
|
|
13955
13956
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
13956
13957
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
13957
|
-
const RULE$
|
|
13958
|
+
const RULE$50 = "plugin-dependencies";
|
|
13958
13959
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
13959
13960
|
const LOCK_FILE = "bun.lock";
|
|
13960
13961
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
@@ -13963,7 +13964,7 @@ const SUCCESS$6 = 0;
|
|
|
13963
13964
|
const NOT_STARTED = -1;
|
|
13964
13965
|
const DETAIL_LINES = 3;
|
|
13965
13966
|
const PLUGIN_CONCURRENCY = 2;
|
|
13966
|
-
const problemFor$4 = problemInFile(RULE$
|
|
13967
|
+
const problemFor$4 = problemInFile(RULE$50);
|
|
13967
13968
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
13968
13969
|
const files = yield* RepositoryFiles;
|
|
13969
13970
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -14068,7 +14069,12 @@ var BundleFailed = class extends taggedError$11()("BundleFailed", { detail: Sche
|
|
|
14068
14069
|
const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
|
|
14069
14070
|
const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
|
|
14070
14071
|
const isBuiltin$1 = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
|
|
14071
|
-
const
|
|
14072
|
+
const matchesPattern = (name) => (pattern) => {
|
|
14073
|
+
if (Predicate.isString(pattern)) return pattern === name;
|
|
14074
|
+
return pattern.test(name);
|
|
14075
|
+
};
|
|
14076
|
+
const isBundledBy = (bundled, name) => pipe(bundled, Array$1.some(matchesPattern(name)));
|
|
14077
|
+
const isExternal = ({ declared, bundled }) => (specifier, importer) => Predicate.isNotUndefined(importer) && isBare(specifier) && (isBuiltin$1(specifier) || Array$1.contains(declared, packageNameOf(specifier)) && !isBundledBy(bundled, packageNameOf(specifier)));
|
|
14072
14078
|
const consumerSource = ({ entry, member }) => Option.match(member, {
|
|
14073
14079
|
onNone: () => `export * from ${quote(entry)};\n`,
|
|
14074
14080
|
onSome: (name) => `import * as ${NAMESPACE} from ${quote(entry)};\nglobalThis.used = ${NAMESPACE}[${quote(name)}];\n`
|
|
@@ -14182,7 +14188,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
14182
14188
|
});
|
|
14183
14189
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
14184
14190
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14185
|
-
const RULE$
|
|
14191
|
+
const RULE$49 = "optional-peer";
|
|
14186
14192
|
const REQUIRED_RULE = "required-peer";
|
|
14187
14193
|
const START$27 = 0;
|
|
14188
14194
|
const SINGLE$1 = 1;
|
|
@@ -14199,7 +14205,7 @@ const positionIn = (located, key, name) => {
|
|
|
14199
14205
|
const problemFor$3 = (located, name, importers) => ({
|
|
14200
14206
|
file: located.file,
|
|
14201
14207
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
14202
|
-
rule: RULE$
|
|
14208
|
+
rule: RULE$49,
|
|
14203
14209
|
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.`
|
|
14204
14210
|
});
|
|
14205
14211
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -14235,7 +14241,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14235
14241
|
}));
|
|
14236
14242
|
};
|
|
14237
14243
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14238
|
-
const RULE$
|
|
14244
|
+
const RULE$48 = "side-effects";
|
|
14239
14245
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14240
14246
|
const START$26 = 0;
|
|
14241
14247
|
const FIRST$12 = 1;
|
|
@@ -14287,11 +14293,11 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
|
|
|
14287
14293
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14288
14294
|
file,
|
|
14289
14295
|
...positionOf(source)(keyIndex$1(source)),
|
|
14290
|
-
rule: RULE$
|
|
14296
|
+
rule: RULE$48,
|
|
14291
14297
|
message: messageOf$6(worst, excesses.length)
|
|
14292
14298
|
})), Option.toArray);
|
|
14293
14299
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14294
|
-
const RULE$
|
|
14300
|
+
const RULE$47 = "top-level-effect";
|
|
14295
14301
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14296
14302
|
const READ_CONCURRENCY$20 = 16;
|
|
14297
14303
|
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.";
|
|
@@ -14307,7 +14313,7 @@ const messageOf$5 = (statement) => {
|
|
|
14307
14313
|
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14308
14314
|
const retained = api.createSourceFile(file, source);
|
|
14309
14315
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14310
|
-
rule: RULE$
|
|
14316
|
+
rule: RULE$47,
|
|
14311
14317
|
message: messageOf$5(statement)
|
|
14312
14318
|
})(statement)));
|
|
14313
14319
|
retained.dispose();
|
|
@@ -14476,7 +14482,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
14476
14482
|
return Array$1.flatten(found);
|
|
14477
14483
|
});
|
|
14478
14484
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14479
|
-
const RULE$
|
|
14485
|
+
const RULE$46 = "legacy-typescript";
|
|
14480
14486
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14481
14487
|
const COMPILER = "typescript";
|
|
14482
14488
|
const CURRENT_MAJOR = 7;
|
|
@@ -14507,12 +14513,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14507
14513
|
file,
|
|
14508
14514
|
line: lineOf$4(source)(legacy.id),
|
|
14509
14515
|
column: FIRST$11,
|
|
14510
|
-
rule: RULE$
|
|
14516
|
+
rule: RULE$46,
|
|
14511
14517
|
message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14512
14518
|
})));
|
|
14513
14519
|
});
|
|
14514
14520
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14515
|
-
const RULE$
|
|
14521
|
+
const RULE$45 = "worker-bundle";
|
|
14516
14522
|
const BUNDLE_CONCURRENCY = 4;
|
|
14517
14523
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14518
14524
|
const CONDITIONS = [
|
|
@@ -14523,7 +14529,7 @@ const CONDITIONS = [
|
|
|
14523
14529
|
"module",
|
|
14524
14530
|
"default"
|
|
14525
14531
|
];
|
|
14526
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14532
|
+
const problemFor$2 = problemInFile(RULE$45);
|
|
14527
14533
|
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14528
14534
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14529
14535
|
const built = yield* Effect.tryPromise({
|
|
@@ -14716,7 +14722,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14716
14722
|
...secretWeakenings(config.h56m, expected.secrets)
|
|
14717
14723
|
];
|
|
14718
14724
|
// src/app/disabled-rules.ts
|
|
14719
|
-
const RULE$
|
|
14725
|
+
const RULE$44 = "disabled-rule";
|
|
14720
14726
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14721
14727
|
const START$24 = 0;
|
|
14722
14728
|
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;
|
|
@@ -14730,7 +14736,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14730
14736
|
const files = yield* RepositoryFiles;
|
|
14731
14737
|
const listed = yield* files.listedFiles(root);
|
|
14732
14738
|
const isExempt = matcher(exempt);
|
|
14733
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$
|
|
14739
|
+
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$24, SIDE_CONFIG_MESSAGE)));
|
|
14734
14740
|
});
|
|
14735
14741
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14736
14742
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14742,7 +14748,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14742
14748
|
})
|
|
14743
14749
|
});
|
|
14744
14750
|
const expected = yield* expectationsIn(root);
|
|
14745
|
-
const at = problemAtIndex(RULE$
|
|
14751
|
+
const at = problemAtIndex(RULE$44)(file, source);
|
|
14746
14752
|
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$24), message)));
|
|
14747
14753
|
});
|
|
14748
14754
|
/** @internal */
|
|
@@ -14750,7 +14756,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
|
|
|
14750
14756
|
const files = yield* RepositoryFiles;
|
|
14751
14757
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14752
14758
|
if (Option.isNone(text)) return [];
|
|
14753
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$
|
|
14759
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$44)(file, "")(START$24, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
14754
14760
|
});
|
|
14755
14761
|
// src/app/build-checks.ts
|
|
14756
14762
|
/** @internal */
|
|
@@ -14846,7 +14852,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
14846
14852
|
imports: importedFilesOf(checker)(sourceFile)
|
|
14847
14853
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
14848
14854
|
// src/features/check-value-owners/model/name-lists.ts
|
|
14849
|
-
const RULE$
|
|
14855
|
+
const RULE$43 = "hand-written-names";
|
|
14850
14856
|
const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
14851
14857
|
const nameListOf = (site) => {
|
|
14852
14858
|
if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -14861,7 +14867,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
14861
14867
|
file,
|
|
14862
14868
|
line,
|
|
14863
14869
|
column,
|
|
14864
|
-
rule: RULE$
|
|
14870
|
+
rule: RULE$43,
|
|
14865
14871
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
14866
14872
|
});
|
|
14867
14873
|
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
@@ -15652,7 +15658,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15652
15658
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
15653
15659
|
}, Effect.scoped);
|
|
15654
15660
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15655
|
-
const RULE$
|
|
15661
|
+
const RULE$42 = "namespace-destructuring";
|
|
15656
15662
|
const LOCAL = /^[.#/]/u;
|
|
15657
15663
|
const messageOf$3 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
15658
15664
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -15668,7 +15674,7 @@ const destructuredName = (declaration) => {
|
|
|
15668
15674
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15669
15675
|
};
|
|
15670
15676
|
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
|
|
15671
|
-
rule: RULE$
|
|
15677
|
+
rule: RULE$42,
|
|
15672
15678
|
message: messageOf$3(name)
|
|
15673
15679
|
})), Option.map((report) => report(declaration)));
|
|
15674
15680
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -15676,7 +15682,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
15676
15682
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15677
15683
|
};
|
|
15678
15684
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15679
|
-
const RULE$
|
|
15685
|
+
const RULE$41 = "pass-through-wrapper";
|
|
15680
15686
|
const SINGLE_STATEMENT = 1;
|
|
15681
15687
|
const SINGLE_DECLARATION = 1;
|
|
15682
15688
|
const THIS_PARAMETER = "this";
|
|
@@ -15773,7 +15779,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
15773
15779
|
const problemOf$7 = (checker) => (candidate) => {
|
|
15774
15780
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
15775
15781
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
|
|
15776
|
-
rule: RULE$
|
|
15782
|
+
rule: RULE$41,
|
|
15777
15783
|
message: messageOf$2(forward.callee.getText())
|
|
15778
15784
|
})(candidate.name)));
|
|
15779
15785
|
};
|
|
@@ -15796,7 +15802,7 @@ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigi
|
|
|
15796
15802
|
/** @internal */
|
|
15797
15803
|
const slugOf = ({ owner, name }) => `${owner}/${name}`;
|
|
15798
15804
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
15799
|
-
const RULE$
|
|
15805
|
+
const RULE$40 = "known-plugins";
|
|
15800
15806
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
15801
15807
|
const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
|
|
15802
15808
|
const GITHUB$5 = "github";
|
|
@@ -15817,7 +15823,7 @@ const MarketplaceSchema = Schema.Struct({
|
|
|
15817
15823
|
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
15818
15824
|
});
|
|
15819
15825
|
const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
|
|
15820
|
-
const problem$5 = problemInFile(RULE$
|
|
15826
|
+
const problem$5 = problemInFile(RULE$40);
|
|
15821
15827
|
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));
|
|
15822
15828
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
15823
15829
|
const pluginProblems = (marketplace, file, settings) => {
|
|
@@ -15842,7 +15848,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
15842
15848
|
}));
|
|
15843
15849
|
});
|
|
15844
15850
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
15845
|
-
const RULE$
|
|
15851
|
+
const RULE$39 = "missing-hook";
|
|
15846
15852
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
15847
15853
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
15848
15854
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
@@ -15867,7 +15873,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
15867
15873
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
15868
15874
|
file,
|
|
15869
15875
|
...positionOf(source)(index),
|
|
15870
|
-
rule: RULE$
|
|
15876
|
+
rule: RULE$39,
|
|
15871
15877
|
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.`
|
|
15872
15878
|
})));
|
|
15873
15879
|
});
|
|
@@ -15920,7 +15926,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
15920
15926
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
15921
15927
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
15922
15928
|
// src/features/check-documented-commands/model/commands.ts
|
|
15923
|
-
const RULE$
|
|
15929
|
+
const RULE$38 = "documented-commands";
|
|
15924
15930
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
15925
15931
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
15926
15932
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -15998,7 +16004,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
|
|
|
15998
16004
|
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 }) => ({
|
|
15999
16005
|
file: absolute(file),
|
|
16000
16006
|
...positionOf(text)(match.index ?? START$22),
|
|
16001
|
-
rule: RULE$
|
|
16007
|
+
rule: RULE$38,
|
|
16002
16008
|
message: `${match[START$22]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
16003
16009
|
})), Option.toArray)));
|
|
16004
16010
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
@@ -16023,14 +16029,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16023
16029
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
16024
16030
|
line: ONE$2,
|
|
16025
16031
|
column: ONE$2,
|
|
16026
|
-
rule: RULE$
|
|
16032
|
+
rule: RULE$38,
|
|
16027
16033
|
message: "msch could not list the tasks with `vp run --json`"
|
|
16028
16034
|
}],
|
|
16029
16035
|
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
|
|
16030
16036
|
});
|
|
16031
16037
|
});
|
|
16032
16038
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
16033
|
-
const RULE$
|
|
16039
|
+
const RULE$37 = "legacy-web";
|
|
16034
16040
|
const FIRST_COLUMN$7 = 1;
|
|
16035
16041
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
16036
16042
|
const Finding = Schema.Struct({
|
|
@@ -16069,7 +16075,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16069
16075
|
file: files.join(root, file),
|
|
16070
16076
|
line,
|
|
16071
16077
|
column: FIRST_COLUMN$7,
|
|
16072
|
-
rule: RULE$
|
|
16078
|
+
rule: RULE$37,
|
|
16073
16079
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
16074
16080
|
});
|
|
16075
16081
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
@@ -16140,8 +16146,8 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
|
|
|
16140
16146
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
16141
16147
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16142
16148
|
const READ_CONCURRENCY$18 = 64;
|
|
16143
|
-
const RULE$
|
|
16144
|
-
const MESSAGE$
|
|
16149
|
+
const RULE$36 = "shell-script";
|
|
16150
|
+
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.";
|
|
16145
16151
|
const HookSchema = Schema.Struct({
|
|
16146
16152
|
command: Schema.optional(Schema.String),
|
|
16147
16153
|
args: Schema.String.pipe(Schema.Array, Schema.optional)
|
|
@@ -16173,7 +16179,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16173
16179
|
};
|
|
16174
16180
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16175
16181
|
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$18 });
|
|
16176
|
-
return pipe(shell, Array$1.map((name) => problemInFile(RULE$
|
|
16182
|
+
return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$9)));
|
|
16177
16183
|
});
|
|
16178
16184
|
// src/features/check-structure/model/structure.ts
|
|
16179
16185
|
const checkStructure = checkSection({
|
|
@@ -16411,7 +16417,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
16411
16417
|
return Array$1.flatten(found);
|
|
16412
16418
|
});
|
|
16413
16419
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
16414
|
-
const RULE$
|
|
16420
|
+
const RULE$35 = "package-script";
|
|
16415
16421
|
const LIFECYCLE = [
|
|
16416
16422
|
"preinstall",
|
|
16417
16423
|
"install",
|
|
@@ -16434,26 +16440,26 @@ const LIFECYCLE = [
|
|
|
16434
16440
|
const problemOf$6 = ({ file, position, name }) => ({
|
|
16435
16441
|
file,
|
|
16436
16442
|
...position,
|
|
16437
|
-
rule: RULE$
|
|
16443
|
+
rule: RULE$35,
|
|
16438
16444
|
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.`
|
|
16439
16445
|
});
|
|
16440
16446
|
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
|
|
16441
16447
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
16442
|
-
const RULE$
|
|
16448
|
+
const RULE$34 = "vite-plus-block";
|
|
16443
16449
|
const MARKER$1 = Array$1.join([
|
|
16444
16450
|
"<!--",
|
|
16445
16451
|
"VITE PLUS START",
|
|
16446
16452
|
"-->"
|
|
16447
16453
|
], "");
|
|
16448
|
-
const MESSAGE$
|
|
16454
|
+
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.";
|
|
16449
16455
|
const problemIn = (file) => (source) => {
|
|
16450
16456
|
const index = String$1.indexOf(MARKER$1)(source);
|
|
16451
16457
|
if (Option.isNone(index)) return Option.none();
|
|
16452
16458
|
return Option.some({
|
|
16453
16459
|
file,
|
|
16454
16460
|
...positionOf(source)(index.value),
|
|
16455
|
-
rule: RULE$
|
|
16456
|
-
message: MESSAGE$
|
|
16461
|
+
rule: RULE$34,
|
|
16462
|
+
message: MESSAGE$8
|
|
16457
16463
|
});
|
|
16458
16464
|
};
|
|
16459
16465
|
/** @internal */
|
|
@@ -16485,10 +16491,10 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
16485
16491
|
return pipe(drifts, Array$1.map(problemOf$5));
|
|
16486
16492
|
});
|
|
16487
16493
|
// src/features/check-workflows/model/release-please.ts
|
|
16488
|
-
const RULE$
|
|
16494
|
+
const RULE$33 = "release-please";
|
|
16489
16495
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
16490
16496
|
const FIRST$8 = 1;
|
|
16491
|
-
const MESSAGE$
|
|
16497
|
+
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.";
|
|
16492
16498
|
/** @internal */
|
|
16493
16499
|
const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleasePlease(root) {
|
|
16494
16500
|
const files = yield* RepositoryFiles;
|
|
@@ -16497,8 +16503,8 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
16497
16503
|
file: files.join(root, name),
|
|
16498
16504
|
line: FIRST$8,
|
|
16499
16505
|
column: FIRST$8,
|
|
16500
|
-
rule: RULE$
|
|
16501
|
-
message: MESSAGE$
|
|
16506
|
+
rule: RULE$33,
|
|
16507
|
+
message: MESSAGE$7
|
|
16502
16508
|
})));
|
|
16503
16509
|
});
|
|
16504
16510
|
// src/features/check-workflows/model/workflow-lint.ts
|
|
@@ -16785,7 +16791,7 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
|
|
|
16785
16791
|
})), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
16786
16792
|
});
|
|
16787
16793
|
// src/features/ban-comments/model/comments.ts
|
|
16788
|
-
const RULE$
|
|
16794
|
+
const RULE$32 = "comment";
|
|
16789
16795
|
const SUPPRESSION_RULE = "suppression";
|
|
16790
16796
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
16791
16797
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
@@ -16795,7 +16801,7 @@ const SHEBANG = "#!";
|
|
|
16795
16801
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
16796
16802
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
16797
16803
|
const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
|
|
16798
|
-
const MESSAGE$
|
|
16804
|
+
const MESSAGE$6 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
|
|
16799
16805
|
const Patterns = Schema.Array(Schema.String);
|
|
16800
16806
|
const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
16801
16807
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
@@ -16817,7 +16823,7 @@ const NOTHING = {
|
|
|
16817
16823
|
used: []
|
|
16818
16824
|
};
|
|
16819
16825
|
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.`;
|
|
16820
|
-
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$
|
|
16826
|
+
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$32)(file, source)(comment.index, MESSAGE$6)));
|
|
16821
16827
|
const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
16822
16828
|
onNone: () => NO_SETTINGS.allow,
|
|
16823
16829
|
onSome: ({ allow }) => allow
|
|
@@ -16854,7 +16860,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16854
16860
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16855
16861
|
used: usedAllowances(allowances, found)
|
|
16856
16862
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16857
|
-
problems: [problemAtIndex(RULE$
|
|
16863
|
+
problems: [problemAtIndex(RULE$32)(file, source)(START$18, `msch could not read the comments in this file: ${message}`)],
|
|
16858
16864
|
used: []
|
|
16859
16865
|
})))
|
|
16860
16866
|
});
|
|
@@ -16967,7 +16973,7 @@ const PYTHON = {
|
|
|
16967
16973
|
/** @internal */
|
|
16968
16974
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
16969
16975
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
16970
|
-
const RULE$
|
|
16976
|
+
const RULE$31 = "uncataloged-dependency";
|
|
16971
16977
|
const OWNED_ELSEWHERE = [
|
|
16972
16978
|
"catalog:",
|
|
16973
16979
|
"workspace:",
|
|
@@ -16976,13 +16982,13 @@ const OWNED_ELSEWHERE = [
|
|
|
16976
16982
|
];
|
|
16977
16983
|
const ROOT_DIRECTORY$2 = ".";
|
|
16978
16984
|
const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
|
|
16979
|
-
const MESSAGE$
|
|
16985
|
+
const MESSAGE$5 = "is a version written in this package.json. Add it to the catalog in pnpm-workspace.yaml and write `catalog:` here, so that one entry owns the version and every package that uses the dependency moves together.";
|
|
16980
16986
|
const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((protocol) => String$1.startsWith(protocol)(specifier)));
|
|
16981
16987
|
const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
16982
16988
|
file: entry.file,
|
|
16983
16989
|
...positionOf(source)(offsetIn(source)(manifestPattern(found))),
|
|
16984
|
-
rule: RULE$
|
|
16985
|
-
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$
|
|
16990
|
+
rule: RULE$31,
|
|
16991
|
+
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$5}`
|
|
16986
16992
|
})));
|
|
16987
16993
|
/** @internal */
|
|
16988
16994
|
const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* uncatalogedDependencies(root) {
|
|
@@ -17002,7 +17008,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17002
17008
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
17003
17009
|
const FIRST_LINE$5 = 1;
|
|
17004
17010
|
const FIRST_COLUMN$5 = 1;
|
|
17005
|
-
const RULE$
|
|
17011
|
+
const RULE$30 = "prune-setting-off";
|
|
17006
17012
|
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."]];
|
|
17007
17013
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
17008
17014
|
const lineOf$3 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
|
|
@@ -17016,7 +17022,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
17016
17022
|
file,
|
|
17017
17023
|
line: at(setting),
|
|
17018
17024
|
column: FIRST_COLUMN$5,
|
|
17019
|
-
rule: RULE$
|
|
17025
|
+
rule: RULE$30,
|
|
17020
17026
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
17021
17027
|
})));
|
|
17022
17028
|
});
|
|
@@ -17110,13 +17116,13 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
17110
17116
|
];
|
|
17111
17117
|
});
|
|
17112
17118
|
// src/features/check-skills/model/published-skills.ts
|
|
17113
|
-
const RULE$
|
|
17119
|
+
const RULE$29 = "published-skills";
|
|
17114
17120
|
const KEYWORD = "tanstack-intent";
|
|
17115
17121
|
const SKILLS = "skills";
|
|
17116
17122
|
const SKILL_FILE$3 = "SKILL.md";
|
|
17117
17123
|
const SUCCEEDED = 0;
|
|
17118
17124
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
17119
|
-
const problemAt$2 = problemInFile(RULE$
|
|
17125
|
+
const problemAt$2 = problemInFile(RULE$29);
|
|
17120
17126
|
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))));
|
|
17121
17127
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
17122
17128
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -17153,7 +17159,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
17153
17159
|
return Array$1.flatten(problems);
|
|
17154
17160
|
});
|
|
17155
17161
|
// src/features/check-skills/model/skill-files.ts
|
|
17156
|
-
const RULE$
|
|
17162
|
+
const RULE$28 = "skill-file";
|
|
17157
17163
|
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
17158
17164
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
17159
17165
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
@@ -17210,7 +17216,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
17210
17216
|
]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
17211
17217
|
file: skill.file,
|
|
17212
17218
|
...positionOf(skill.source)(index),
|
|
17213
|
-
rule: RULE$
|
|
17219
|
+
rule: RULE$28,
|
|
17214
17220
|
message
|
|
17215
17221
|
})));
|
|
17216
17222
|
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) => ({
|
|
@@ -17237,7 +17243,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
17237
17243
|
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
17238
17244
|
file,
|
|
17239
17245
|
...positionOf(source)(index),
|
|
17240
|
-
rule: RULE$
|
|
17246
|
+
rule: RULE$28,
|
|
17241
17247
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
17242
17248
|
})));
|
|
17243
17249
|
});
|
|
@@ -17253,7 +17259,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17253
17259
|
file: files.join(root, entry),
|
|
17254
17260
|
line: FIRST$7,
|
|
17255
17261
|
column: FIRST$7,
|
|
17256
|
-
rule: RULE$
|
|
17262
|
+
rule: RULE$28,
|
|
17257
17263
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
17258
17264
|
})));
|
|
17259
17265
|
return [
|
|
@@ -17331,7 +17337,7 @@ const cargoEntries = (text) => {
|
|
|
17331
17337
|
};
|
|
17332
17338
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
17333
17339
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
17334
|
-
const RULE$
|
|
17340
|
+
const RULE$27 = "version-downgrade";
|
|
17335
17341
|
const READ_CONCURRENCY$14 = 16;
|
|
17336
17342
|
const READERS = [
|
|
17337
17343
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
@@ -17356,7 +17362,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
17356
17362
|
file,
|
|
17357
17363
|
line: lineOf$2(text, entry),
|
|
17358
17364
|
column: FIRST_LINE$4,
|
|
17359
|
-
rule: RULE$
|
|
17365
|
+
rule: RULE$27,
|
|
17360
17366
|
message: message$1(old, entry)
|
|
17361
17367
|
})), Option.toArray)));
|
|
17362
17368
|
};
|
|
@@ -17439,7 +17445,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
17439
17445
|
return Array$1.getSomes(read);
|
|
17440
17446
|
});
|
|
17441
17447
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
17442
|
-
const RULE$
|
|
17448
|
+
const RULE$26 = "unbumped-package";
|
|
17443
17449
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
17444
17450
|
const UNVERSIONED$5 = "0.0.0";
|
|
17445
17451
|
const FIRST_LINE$3 = 1;
|
|
@@ -17514,7 +17520,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17514
17520
|
file: files.join(root, pack.file),
|
|
17515
17521
|
line: versionLine(pack.text),
|
|
17516
17522
|
column: FIRST_COLUMN$4,
|
|
17517
|
-
rule: RULE$
|
|
17523
|
+
rule: RULE$26,
|
|
17518
17524
|
message: message(pack, part, lowest)
|
|
17519
17525
|
})), Option.toArray);
|
|
17520
17526
|
}), { concurrency: READ_CONCURRENCY$11 });
|
|
@@ -17523,7 +17529,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17523
17529
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
17524
17530
|
const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
17525
17531
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17526
|
-
const RULE$
|
|
17532
|
+
const RULE$25 = "applied-package";
|
|
17527
17533
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17528
17534
|
const NOT_FOUND$3 = -1;
|
|
17529
17535
|
const SEPARATOR$9 = "/";
|
|
@@ -17559,7 +17565,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
17559
17565
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
17560
17566
|
file,
|
|
17561
17567
|
...positionOf(source)(index),
|
|
17562
|
-
rule: RULE$
|
|
17568
|
+
rule: RULE$25,
|
|
17563
17569
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
17564
17570
|
});
|
|
17565
17571
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
@@ -17614,7 +17620,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
17614
17620
|
return yield* appliedPackageProblems(root, applied);
|
|
17615
17621
|
});
|
|
17616
17622
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
17617
|
-
const RULE$
|
|
17623
|
+
const RULE$24 = "replaced-tool";
|
|
17618
17624
|
const FIRST$6 = 1;
|
|
17619
17625
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
17620
17626
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -17695,7 +17701,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
|
|
|
17695
17701
|
file,
|
|
17696
17702
|
line: FIRST$6,
|
|
17697
17703
|
column: FIRST$6,
|
|
17698
|
-
rule: RULE$
|
|
17704
|
+
rule: RULE$24,
|
|
17699
17705
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
17700
17706
|
})));
|
|
17701
17707
|
/** @internal */
|
|
@@ -17834,7 +17840,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
17834
17840
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
17835
17841
|
});
|
|
17836
17842
|
// src/features/check-markdown-directives/model/directives.ts
|
|
17837
|
-
const RULE$
|
|
17843
|
+
const RULE$23 = "markdown-directive";
|
|
17838
17844
|
const START$13 = 0;
|
|
17839
17845
|
const SECOND = 1;
|
|
17840
17846
|
const ODD = 1;
|
|
@@ -17849,7 +17855,7 @@ const SKIPPED_FILES = ["CHANGELOG.md", "CLAUDE.md"];
|
|
|
17849
17855
|
const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-(?:disable|enable|capture|restore|configure-file)(?:-next-line|-line|-file)?(?:\s[\s\S]*?)?-->/giu;
|
|
17850
17856
|
const FENCE$1 = /^\s{0,3}(?:`{3,}|~{3,})/u;
|
|
17851
17857
|
const BACKTICK = /`/gu;
|
|
17852
|
-
const MESSAGE$
|
|
17858
|
+
const MESSAGE$4 = "This comment turns a Markdown or text check off. Checks are not turned off in a repository that uses msch: fix what the check reports, or, when the check itself is wrong, fix the check in msch.";
|
|
17853
17859
|
const fenceStep = (inside, line) => Match.value(FENCE$1.test(line)).pipe(Match.when(true, () => [!inside, true]), Match.orElse(() => [inside, inside]));
|
|
17854
17860
|
const insideCodeSpan = (before) => Array$1.fromIterable(String$1.matchAll(BACKTICK)(before)).length % PAIR === ODD;
|
|
17855
17861
|
const problemsIn$7 = (file, source) => {
|
|
@@ -17859,7 +17865,7 @@ const problemsIn$7 = (file, source) => {
|
|
|
17859
17865
|
const { line, column } = positionOf(source)(index);
|
|
17860
17866
|
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$13, column - SECOND)), Option.exists(insideCodeSpan));
|
|
17861
17867
|
};
|
|
17862
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$13)), Array$1.map((match) => problemAtIndex(RULE$
|
|
17868
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$13)), Array$1.map((match) => problemAtIndex(RULE$23)(file, source)(match.index ?? START$13, MESSAGE$4)));
|
|
17863
17869
|
};
|
|
17864
17870
|
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)));
|
|
17865
17871
|
/** @internal */
|
|
@@ -17871,10 +17877,16 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
|
|
|
17871
17877
|
file: files.join(root, name)
|
|
17872
17878
|
}))), ({ file }, source) => problemsIn$7(file, source));
|
|
17873
17879
|
});
|
|
17880
|
+
// src/shared/lib/branch-trailer.ts
|
|
17881
|
+
/** @internal */
|
|
17882
|
+
const branchCarries = Effect.fn("branchCarries")(function* branchCarries(root, base, trailer) {
|
|
17883
|
+
const messages = yield* (yield* RepositoryFiles).commitMessages(root, base);
|
|
17884
|
+
return pipe(messages, Array$1.some((commit) => trailer.test(commit)));
|
|
17885
|
+
});
|
|
17874
17886
|
// src/features/check-owner-markers/model/owner-markers.ts
|
|
17875
|
-
const RULE$
|
|
17887
|
+
const RULE$22 = "owner-decision-removed";
|
|
17876
17888
|
const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
|
|
17877
|
-
const TRAILER = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
17889
|
+
const TRAILER$1 = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
17878
17890
|
const READ_CONCURRENCY$10 = 16;
|
|
17879
17891
|
const HEAD = "HEAD";
|
|
17880
17892
|
const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
|
|
@@ -17902,20 +17914,16 @@ const removalsSince = Effect.fn("removalsSince")(function* removalsSince(root, b
|
|
|
17902
17914
|
}), { concurrency: READ_CONCURRENCY$10 });
|
|
17903
17915
|
return Array$1.flatten(found);
|
|
17904
17916
|
});
|
|
17905
|
-
const hasTrailer = Effect.fn("hasTrailer")(function* hasTrailer(root, base) {
|
|
17906
|
-
const messages = yield* (yield* RepositoryFiles).commitMessages(root, base);
|
|
17907
|
-
return pipe(messages, Array$1.some((commit) => TRAILER.test(commit)));
|
|
17908
|
-
});
|
|
17909
17917
|
/** @internal */
|
|
17910
17918
|
const checkOwnerMarkers = Effect.fn("checkOwnerMarkers")(function* checkOwnerMarkers(root) {
|
|
17911
17919
|
const base = yield* baseRevision(root);
|
|
17912
17920
|
if (Option.isNone(base)) return [];
|
|
17913
17921
|
const removals = yield* removalsSince(root, base.value);
|
|
17914
|
-
if (!Array$1.isReadonlyArrayNonEmpty(removals) || (yield*
|
|
17915
|
-
return pipe(removals, Array$1.map((removal) => problemInFile(RULE$
|
|
17922
|
+
if (!Array$1.isReadonlyArrayNonEmpty(removals) || (yield* branchCarries(root, base.value, TRAILER$1))) return [];
|
|
17923
|
+
return pipe(removals, Array$1.map((removal) => problemInFile(RULE$22)(removal.file, messageOf$1(removal))));
|
|
17916
17924
|
});
|
|
17917
17925
|
// src/features/check-owner-names/model/owner-names.ts
|
|
17918
|
-
const RULE$
|
|
17926
|
+
const RULE$21 = "owner-name";
|
|
17919
17927
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17920
17928
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17921
17929
|
const SEPARATOR$7 = "/";
|
|
@@ -17957,7 +17965,7 @@ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
|
|
|
17957
17965
|
}), Array$1.head, Option.toArray, Array$1.map(() => ({
|
|
17958
17966
|
file,
|
|
17959
17967
|
...positionOf("")(START$12),
|
|
17960
|
-
rule: RULE$
|
|
17968
|
+
rule: RULE$21,
|
|
17961
17969
|
message: `Its description or keywords ${messageFor$4(owner)}`
|
|
17962
17970
|
})));
|
|
17963
17971
|
const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, owner, directory) {
|
|
@@ -17978,7 +17986,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
|
|
|
17978
17986
|
}), Array$1.map((offset) => ({
|
|
17979
17987
|
file,
|
|
17980
17988
|
...positionOf(source)(offset),
|
|
17981
|
-
rule: RULE$
|
|
17989
|
+
rule: RULE$21,
|
|
17982
17990
|
message: messageFor$4(owner)
|
|
17983
17991
|
}))));
|
|
17984
17992
|
return [...manifestProblems$3({
|
|
@@ -18004,6 +18012,21 @@ const checkOwnerNames = Effect.fn("checkOwnerNames")(function* checkOwnerNames(r
|
|
|
18004
18012
|
const found = yield* Effect.forEach(directories, (directory) => workspaceProblems(root, origin.value.owner, directory), { concurrency: 1 });
|
|
18005
18013
|
return Array$1.flatten(found);
|
|
18006
18014
|
});
|
|
18015
|
+
// src/features/check-owner-principles/model/owner-principles.ts
|
|
18016
|
+
const RULE$20 = "owner-principle-changed";
|
|
18017
|
+
const PRINCIPLE_FILE = /(?:^|\/)(?:skills\/principle-[^/]+\/|plugins\/[^/]+-principles\/|PRINCIPLE\.md$)/u;
|
|
18018
|
+
const TRAILER = /^Owner-Said:[ \t]*\S/mu;
|
|
18019
|
+
const MESSAGE$3 = "changes a principle. Only the owner changes a principle: change it in a session the owner opened with /do-principle, and add the trailer \"Owner-Said: <the owner's words>\" to a commit of the branch. When you only found a fact at odds with the principle, record it as a lesson instead.";
|
|
18020
|
+
/** @internal */
|
|
18021
|
+
const checkOwnerPrinciples = Effect.fn("checkOwnerPrinciples")(function* checkOwnerPrinciples(root) {
|
|
18022
|
+
const files = yield* RepositoryFiles;
|
|
18023
|
+
const base = yield* baseRevision(root);
|
|
18024
|
+
if (Option.isNone(base)) return [];
|
|
18025
|
+
const all = yield* files.changedFiles(root, base.value);
|
|
18026
|
+
const changed = pipe(all, Array$1.filter((name) => PRINCIPLE_FILE.test(name)));
|
|
18027
|
+
if (!Array$1.isReadonlyArrayNonEmpty(changed) || (yield* branchCarries(root, base.value, TRAILER))) return [];
|
|
18028
|
+
return pipe(changed, Array$1.map((name) => problemInFile(RULE$20)(files.join(root, name), MESSAGE$3)));
|
|
18029
|
+
});
|
|
18007
18030
|
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
18008
18031
|
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
18009
18032
|
const NUL = "\0";
|
|
@@ -18046,7 +18069,8 @@ const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root
|
|
|
18046
18069
|
checkHiddenUnicode(root),
|
|
18047
18070
|
checkMarkdownDirectives(root),
|
|
18048
18071
|
checkOwnerMarkers(root),
|
|
18049
|
-
checkOwnerNames(root)
|
|
18072
|
+
checkOwnerNames(root),
|
|
18073
|
+
checkOwnerPrinciples(root)
|
|
18050
18074
|
], { concurrency: "unbounded" });
|
|
18051
18075
|
return Array$1.flatten(found);
|
|
18052
18076
|
});
|