@r_masseater/msch 0.129.2 → 0.130.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 +505 -333
- package/dist/cli.mjs.map +1 -1
- package/dist/config-B3SYjao5.mjs.map +1 -1
- package/dist/config.d.mts +2 -4
- package/dist/config.mjs +538 -1
- package/dist/config.mjs.map +1 -0
- package/dist/{index-B15MNLWU.d.mts → index-C93QRE06.d.mts} +4 -2
- package/dist/repository-text-Dy8EkFIh.mjs +350 -0
- package/dist/repository-text-Dy8EkFIh.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +2 -2
- package/package.json +5 -3
- package/skills/msch-checks/SKILL.md +1 -1
- package/skills/msch-publishing/SKILL.md +1 -1
- package/skills/msch-repository-config/SKILL.md +8 -4
- package/skills/msch-workspace-settings/SKILL.md +1 -1
- package/dist/repository-config-Dq5OIwyx.mjs +0 -869
- package/dist/repository-config-Dq5OIwyx.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { decodePackageJson, decodeVersionedPackageJson, readPackageJson, readRaw
|
|
|
14
14
|
import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as INDEX_SKILL, v as shadcnUiOf } from "./published-BdMq0wXq.mjs";
|
|
15
15
|
import { parse, resolveConfigFromFile } from "vite-plus";
|
|
16
16
|
import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-B3SYjao5.mjs";
|
|
17
|
-
import {
|
|
17
|
+
import { c as forgetBuilt, d as existsAt, g as patternOf$1, h as namedWorkspaces, i as GIT_HOOKS, l as lastBuilt, p as isIgnored, s as MDLCT_BIN, t as BUILT_ALLOWANCES } from "./repository-text-Dy8EkFIh.mjs";
|
|
18
18
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
19
|
import treeSitter from "@vscode/tree-sitter-wasm";
|
|
20
20
|
import { t as startedOnce } from "./started-once-BN_hLlmU.mjs";
|
|
@@ -23,7 +23,7 @@ import { rolldown } from "rolldown";
|
|
|
23
23
|
import { stripVTControlCharacters } from "node:util";
|
|
24
24
|
import { builtinModules, isBuiltin as isBuiltin$1 } from "node:module";
|
|
25
25
|
import semver from "semver";
|
|
26
|
-
import { g as decisionTestRules,
|
|
26
|
+
import { g as decisionTestRules, p as lint$3, x as exempt } from "./define-lint-preset-PLWK5HYf.mjs";
|
|
27
27
|
import { NO_PATH, describeReference, diagnosticDetail, linksIn as linksIn$1, lint, markdownPathspecs, referenceOf as referenceOf$2, y8Section } from "@r_masseater/y8";
|
|
28
28
|
import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
|
|
29
29
|
import { Parser, isPair, isScalar, parse as parse$1, parseDocument, visit as visit$1 } from "yaml";
|
|
@@ -49,7 +49,7 @@ import { Buffer } from "node:buffer";
|
|
|
49
49
|
import { createZstdDecompress } from "node:zlib";
|
|
50
50
|
// package.json
|
|
51
51
|
var name = "@r_masseater/msch";
|
|
52
|
-
var version = "0.
|
|
52
|
+
var version = "0.130.0";
|
|
53
53
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
54
54
|
var repository = {
|
|
55
55
|
"type": "git",
|
|
@@ -785,10 +785,10 @@ const namesSkill = (skill) => (text) => new RegExp(namePattern(skill), "u").test
|
|
|
785
785
|
const SKILLS_START = "<!-- skills:generated -->";
|
|
786
786
|
const SKILLS_END = "<!-- /skills:generated -->";
|
|
787
787
|
// src/shared/lib/text-position.ts
|
|
788
|
-
const START$
|
|
788
|
+
const START$36 = 0;
|
|
789
789
|
const FIRST_COLUMN$8 = 1;
|
|
790
790
|
const positionOf = (source) => (index) => {
|
|
791
|
-
const before = pipe(source, String$1.slice(START$
|
|
791
|
+
const before = pipe(source, String$1.slice(START$36, index), String$1.split("\n"));
|
|
792
792
|
return {
|
|
793
793
|
line: before.length,
|
|
794
794
|
column: pipe(Array$1.last(before), Option.match({
|
|
@@ -1067,7 +1067,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1067
1067
|
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
1068
1068
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1069
1069
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1070
|
-
const READ_CONCURRENCY$
|
|
1070
|
+
const READ_CONCURRENCY$42 = 64;
|
|
1071
1071
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1072
1072
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1073
1073
|
/** @internal */
|
|
@@ -1090,18 +1090,18 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1090
1090
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1091
1091
|
onNone: () => [],
|
|
1092
1092
|
onSome: (source) => foundIn(entry, source)
|
|
1093
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1093
|
+
}))), { concurrency: READ_CONCURRENCY$42 });
|
|
1094
1094
|
return Array$1.flatten(found);
|
|
1095
1095
|
});
|
|
1096
1096
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1097
1097
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1098
1098
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1099
|
-
const RULE$
|
|
1099
|
+
const RULE$82 = "git-subpath-dependency";
|
|
1100
1100
|
const WHOLE_MATCH$4 = 0;
|
|
1101
1101
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1102
1102
|
file,
|
|
1103
1103
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1104
|
-
rule: RULE$
|
|
1104
|
+
rule: RULE$82,
|
|
1105
1105
|
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])}\`.`
|
|
1106
1106
|
});
|
|
1107
1107
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1112,13 +1112,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1112
1112
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1113
1113
|
});
|
|
1114
1114
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1115
|
-
const RULE$
|
|
1115
|
+
const RULE$81 = "unnamed-restriction";
|
|
1116
1116
|
const WHOLE_MATCH$3 = 0;
|
|
1117
1117
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1118
1118
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1119
1119
|
file: entry.file,
|
|
1120
1120
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1121
|
-
rule: RULE$
|
|
1121
|
+
rule: RULE$81,
|
|
1122
1122
|
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.`
|
|
1123
1123
|
})));
|
|
1124
1124
|
/** @internal */
|
|
@@ -1127,13 +1127,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1127
1127
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1128
1128
|
});
|
|
1129
1129
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1130
|
-
const RULE$
|
|
1130
|
+
const RULE$80 = "named-type-exemption";
|
|
1131
1131
|
const WHOLE_MATCH$2 = 0;
|
|
1132
1132
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1133
1133
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1134
1134
|
file: entry.file,
|
|
1135
1135
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1136
|
-
rule: RULE$
|
|
1136
|
+
rule: RULE$80,
|
|
1137
1137
|
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."
|
|
1138
1138
|
})));
|
|
1139
1139
|
/** @internal */
|
|
@@ -1149,21 +1149,21 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1149
1149
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1150
1150
|
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)))));
|
|
1151
1151
|
// src/features/check-overrides/model/package-registry.ts
|
|
1152
|
-
const RULE$
|
|
1152
|
+
const RULE$79 = "package-registry";
|
|
1153
1153
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1154
1154
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1155
1155
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
1156
1156
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
1157
|
-
const START$
|
|
1157
|
+
const START$35 = 0;
|
|
1158
1158
|
const REASON$4 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
1159
1159
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
1160
1160
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
1161
1161
|
const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
|
|
1162
|
-
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1162
|
+
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$35));
|
|
1163
1163
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1164
1164
|
file,
|
|
1165
1165
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1166
|
-
rule: RULE$
|
|
1166
|
+
rule: RULE$79,
|
|
1167
1167
|
message: Option.match(registry, {
|
|
1168
1168
|
onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1169
1169
|
onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1171,9 +1171,9 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1171
1171
|
});
|
|
1172
1172
|
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) => ({
|
|
1173
1173
|
file: entry.file,
|
|
1174
|
-
...positionOf(source)(found.index ?? START$
|
|
1175
|
-
rule: RULE$
|
|
1176
|
-
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$
|
|
1174
|
+
...positionOf(source)(found.index ?? START$35),
|
|
1175
|
+
rule: RULE$79,
|
|
1176
|
+
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$35])}\`. Remove the line.`
|
|
1177
1177
|
})));
|
|
1178
1178
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
1179
1179
|
const files = yield* RepositoryFiles;
|
|
@@ -1222,7 +1222,7 @@ const renovatePresetOf = Effect.fn("renovatePresetOf")(function* renovatePresetO
|
|
|
1222
1222
|
// src/entities/package/model/stack-catalog.ts
|
|
1223
1223
|
const STACK_CATALOG = "catalog:stack";
|
|
1224
1224
|
// src/entities/package/model/specifiers.ts
|
|
1225
|
-
const START$
|
|
1225
|
+
const START$34 = 0;
|
|
1226
1226
|
const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
|
|
1227
1227
|
const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
|
|
1228
1228
|
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
@@ -1240,7 +1240,7 @@ const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.ra
|
|
|
1240
1240
|
/** @internal */
|
|
1241
1241
|
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
|
|
1242
1242
|
/** @internal */
|
|
1243
|
-
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1243
|
+
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$34));
|
|
1244
1244
|
const SECTIONS$1 = [
|
|
1245
1245
|
"dependencies",
|
|
1246
1246
|
"devDependencies",
|
|
@@ -1265,6 +1265,135 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
1265
1265
|
manifest
|
|
1266
1266
|
})), Option.getOrElse(() => [])));
|
|
1267
1267
|
});
|
|
1268
|
+
// renovate.json
|
|
1269
|
+
var renovate_default = {
|
|
1270
|
+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
|
|
1271
|
+
"extends": [
|
|
1272
|
+
"config:recommended",
|
|
1273
|
+
"security:minimumReleaseAgeNpm",
|
|
1274
|
+
":semanticCommits"
|
|
1275
|
+
],
|
|
1276
|
+
timezone: "Asia/Tokyo",
|
|
1277
|
+
schedule: ["* 4 * * *"],
|
|
1278
|
+
minimumReleaseAge: "3 days",
|
|
1279
|
+
configMigration: true,
|
|
1280
|
+
rollbackPrs: false,
|
|
1281
|
+
separateMajorMinor: false,
|
|
1282
|
+
rangeStrategy: "pin",
|
|
1283
|
+
prHourlyLimit: 0,
|
|
1284
|
+
gitIgnoredAuthors: ["41898282+github-actions[bot]@users.noreply.github.com"],
|
|
1285
|
+
packageRules: [
|
|
1286
|
+
{
|
|
1287
|
+
"description": "msch の commitlint は件名に日本語の文字を 1 文字以上求める(subject-script)。Renovate の既定の件名(update all dependencies など)は英語だけなので、PR の up-to-date が落ちてマージキューに入らなかった。件名を「<対象>(<版>)を上げる」の形にする。グループと digest の更新では Renovate が commitMessageExtra を消すので、日本語は消されない commitMessageSuffix に置く。",
|
|
1288
|
+
"matchPackageNames": ["*"],
|
|
1289
|
+
"commitMessageAction": "",
|
|
1290
|
+
"commitMessageTopic": "{{{depName}}}",
|
|
1291
|
+
"commitMessageExtra": "({{{newVersion}}})",
|
|
1292
|
+
"commitMessageSuffix": "を上げる"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
"description": "依存の更新は 1 日 1 回、朝 4 時台にまとめて 1 つの PR で出す。更新ごとに PR を出すと、main への統合と verify が 1 日に何十回も走り、赤くなったときにどの更新が原因かを探す手間も増える。組で上げないと壊れるパッケージ(textlint、better-auth、effect と alchemy など)も、同じ PR に入るので組で上がる。待ち合わせが要る組(公開の時期がずれる組)だけは、この後ろの規則と、この preset の後ろに置く preset や各リポジトリの規則で別の PR に分ける。脆弱性の修正は Renovate の既定どおり、この時刻を待たずに別の PR で出る。",
|
|
1296
|
+
"matchPackageNames": ["*"],
|
|
1297
|
+
"groupName": "all dependencies",
|
|
1298
|
+
"groupSlug": "all"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"description": "peerDependencies は利用側との互換の範囲を宣言するもので、版を選ばない。範囲のまま広げる。",
|
|
1302
|
+
"matchDepTypes": ["peerDependencies"],
|
|
1303
|
+
"rangeStrategy": "widen"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
"description": "overrides は推移的な依存の下限を強制するもので、範囲のまま置き換える。",
|
|
1307
|
+
"matchDepTypes": [
|
|
1308
|
+
"pnpm-workspace.overrides",
|
|
1309
|
+
"pnpm.overrides",
|
|
1310
|
+
"overrides"
|
|
1311
|
+
],
|
|
1312
|
+
"rangeStrategy": "replace"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
"description": "msch は版が上がるたびに検査が増え、利用側は同じ変更で移行しないと main の verify が落ちる(msch 0.60.1 で利用側の main が赤になった)。msch の dependencies と peerDependencies にある同じスコープのパッケージもこの組に並べ、msch に足したらここにも足す。bump だけを自動マージしない。bump と移行を同じ PR で出す。 日次の全体の PR にも入れない。移行の要る msch の版上げで、ほかの更新が止まらないようにする。",
|
|
1316
|
+
"matchPackageNames": [
|
|
1317
|
+
"@r_masseater/msch",
|
|
1318
|
+
"@r_masseater/fu4",
|
|
1319
|
+
"@r_masseater/h56m",
|
|
1320
|
+
"@r_masseater/masseater-utils",
|
|
1321
|
+
"@r_masseater/oxlint-plugin-decision",
|
|
1322
|
+
"@r_masseater/oxlint-typed-rules",
|
|
1323
|
+
"@r_masseater/textlint-rule-preset-ja",
|
|
1324
|
+
"@r_masseater/vite-plus-adopt",
|
|
1325
|
+
"@r_masseater/wism",
|
|
1326
|
+
"@r_masseater/y8"
|
|
1327
|
+
],
|
|
1328
|
+
"groupName": "msch",
|
|
1329
|
+
"automerge": false
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"description": "Effect と Alchemy は日々の更新に追従する前提で、公開後の待機期間を掛けない。pnpm 側は各リポジトリの minimumReleaseAgeExclude に同じ名前を置く。",
|
|
1333
|
+
"matchPackageNames": [
|
|
1334
|
+
"effect",
|
|
1335
|
+
"@effect/**",
|
|
1336
|
+
"alchemy",
|
|
1337
|
+
"@alchemy.run/**"
|
|
1338
|
+
],
|
|
1339
|
+
"minimumReleaseAge": null
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
"description": "TypeScript は 7 以降だけを使う。6 以前や dev 版に戻さない。",
|
|
1343
|
+
"matchPackageNames": ["typescript"],
|
|
1344
|
+
"matchDepNames": ["!typescript-wasm"],
|
|
1345
|
+
"allowedVersions": "/^(?:[7-9]|[1-9][0-9]+)\\.[0-9]+\\.[0-9]+(?:-(?:beta|rc)[0-9.]*)?$/"
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
"description": "overrides の major は上流の範囲を越えて推移的な依存を動かす。上げない。",
|
|
1349
|
+
"matchDepTypes": ["pnpm-workspace.overrides"],
|
|
1350
|
+
"matchUpdateTypes": ["major"],
|
|
1351
|
+
"enabled": false
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
"description": "patches/ の crate はルートの Cargo.lock で解決される。Renovate は写しの Cargo.toml と写し自身の Cargo.lock だけを上げ、ルートの Cargo.lock と食い違って cargo の --locked が落ちる (#1283, #1284, #1289)。更新しない。",
|
|
1355
|
+
"matchFileNames": ["patches/**"],
|
|
1356
|
+
"enabled": false
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"description": "テストの fixtures は外部ツールの出力と突き合わせる写しで、版を上げると記録した結果と食い違う (#1399, #1401, #1405, #1406)。更新しない。",
|
|
1360
|
+
"matchFileNames": ["**/fixtures/**"],
|
|
1361
|
+
"enabled": false
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"description": "vite-plus は oxlint と tsrs の版を固定し(tsrs はルートの devDependencies にも入れてあり、oxlint と同時に上げる)、@effect/tsgo は対応している版の oxlint と oxlint-tsgolint にしかパッチを当てられない。合わないと prepare が落ちて vp install が失敗する。vite-plus は vitest の版も固定し、@vitest/* だけが上がると vitest が 2 つ入って @effect/vitest のテストが suite を見つけられずに落ちる (#1479)。組で上げ、up-to-date の install が通ったときだけマージする。@effect/tsgo は tsrs や oxlint より後に対応版を出すので、日次の全体の PR に入れると、合う版がそろうまで全体が止まる。全体の PR から分ける。",
|
|
1365
|
+
"matchPackageNames": [
|
|
1366
|
+
"vite-plus",
|
|
1367
|
+
"oxlint",
|
|
1368
|
+
"@oxlint/plugins",
|
|
1369
|
+
"oxlint-tsgolint",
|
|
1370
|
+
"oxlint-plugin-eslint",
|
|
1371
|
+
"tsrs",
|
|
1372
|
+
"@effect/tsgo",
|
|
1373
|
+
"vitest",
|
|
1374
|
+
"@vitest/**"
|
|
1375
|
+
],
|
|
1376
|
+
"groupName": "oxlint and effect-tsgo"
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
"description": "公開日時の無い種類の更新は待機期間を判定できず、掛けると止まったままになるので外す。",
|
|
1380
|
+
"matchUpdateTypes": [
|
|
1381
|
+
"lockFileMaintenance",
|
|
1382
|
+
"replacement",
|
|
1383
|
+
"pin",
|
|
1384
|
+
"bump",
|
|
1385
|
+
"lockfileUpdate",
|
|
1386
|
+
"rollback"
|
|
1387
|
+
],
|
|
1388
|
+
"minimumReleaseAge": null
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"description": "公開日時を返さないデータソースは待機期間を判定できず、掛けると止まったままになるので外す。",
|
|
1392
|
+
"matchDatasources": ["git-refs"],
|
|
1393
|
+
"minimumReleaseAge": null
|
|
1394
|
+
}
|
|
1395
|
+
]
|
|
1396
|
+
};
|
|
1268
1397
|
// src/shared/config/self.ts
|
|
1269
1398
|
const GIT_PREFIX = /^git\+/u;
|
|
1270
1399
|
const GIT_SUFFIX = /\.git$/u;
|
|
@@ -1273,8 +1402,10 @@ const SELF_NAME = name;
|
|
|
1273
1402
|
const SELF_HOMEPAGE = homepage;
|
|
1274
1403
|
const SELF_DIRECTORY = repository.directory;
|
|
1275
1404
|
const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$5, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
1405
|
+
/** @internal */
|
|
1406
|
+
const RENOVATE_PRESET_SETTINGS = renovate_default;
|
|
1276
1407
|
// src/features/check-overrides/model/removed-peers.ts
|
|
1277
|
-
const RULE$
|
|
1408
|
+
const RULE$78 = "removed-peer";
|
|
1278
1409
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
1279
1410
|
const REMOVED = "-";
|
|
1280
1411
|
const PARENT_SEPARATOR = ">";
|
|
@@ -1301,7 +1432,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1301
1432
|
file,
|
|
1302
1433
|
line,
|
|
1303
1434
|
column,
|
|
1304
|
-
rule: RULE$
|
|
1435
|
+
rule: RULE$78,
|
|
1305
1436
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
1306
1437
|
});
|
|
1307
1438
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
@@ -3439,7 +3570,7 @@ const matcher = (patterns) => {
|
|
|
3439
3570
|
String$1.startsWith(NEGATION$1);
|
|
3440
3571
|
String$1.slice(1);
|
|
3441
3572
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3442
|
-
const RULE$
|
|
3573
|
+
const RULE$77 = "colocated-git-patterns";
|
|
3443
3574
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3444
3575
|
const ROOT$3 = ".";
|
|
3445
3576
|
const NEGATION = "!";
|
|
@@ -3450,7 +3581,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
3450
3581
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3451
3582
|
const SPACES = /\s+/u;
|
|
3452
3583
|
const FIRST$26 = 1;
|
|
3453
|
-
const READ_CONCURRENCY$
|
|
3584
|
+
const READ_CONCURRENCY$41 = 16;
|
|
3454
3585
|
const withoutPrefix = (prefix, text) => {
|
|
3455
3586
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3456
3587
|
return text;
|
|
@@ -3486,7 +3617,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3486
3617
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3487
3618
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3488
3619
|
});
|
|
3489
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3620
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$77)(entry.file, {
|
|
3490
3621
|
line: entry.line,
|
|
3491
3622
|
column: FIRST$26
|
|
3492
3623
|
}, message);
|
|
@@ -3541,17 +3672,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3541
3672
|
/** @internal */
|
|
3542
3673
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3543
3674
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3544
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3675
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$41 });
|
|
3545
3676
|
const entries = Array$1.flatten(read);
|
|
3546
3677
|
const workspaces = yield* workspaceDirectories(root);
|
|
3547
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3678
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$41 });
|
|
3548
3679
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3549
3680
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3550
3681
|
});
|
|
3551
3682
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3552
|
-
const RULE$
|
|
3683
|
+
const RULE$76 = "colocated-test";
|
|
3553
3684
|
const FIRST$25 = 1;
|
|
3554
|
-
const READ_CONCURRENCY$
|
|
3685
|
+
const READ_CONCURRENCY$40 = 64;
|
|
3555
3686
|
const ROOT_SUBPATH$1 = ".";
|
|
3556
3687
|
const NAME_GROUP$2 = "name";
|
|
3557
3688
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3572,7 +3703,7 @@ const problemFor$11 = (test, message) => ({
|
|
|
3572
3703
|
file: test.file,
|
|
3573
3704
|
line: FIRST$25,
|
|
3574
3705
|
column: FIRST$25,
|
|
3575
|
-
rule: RULE$
|
|
3706
|
+
rule: RULE$76,
|
|
3576
3707
|
message: `${test.base} ${message}`
|
|
3577
3708
|
});
|
|
3578
3709
|
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);
|
|
@@ -3635,12 +3766,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3635
3766
|
directory: files.dirname(file)
|
|
3636
3767
|
};
|
|
3637
3768
|
}));
|
|
3638
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3769
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$40 });
|
|
3639
3770
|
return Array$1.getSomes(found);
|
|
3640
3771
|
});
|
|
3641
3772
|
// src/shared/lib/agent-docs.ts
|
|
3642
3773
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3643
|
-
const READ_CONCURRENCY$
|
|
3774
|
+
const READ_CONCURRENCY$39 = 16;
|
|
3644
3775
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3645
3776
|
const files = yield* RepositoryFiles;
|
|
3646
3777
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3649,13 +3780,13 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3649
3780
|
const file = files.join(root, name);
|
|
3650
3781
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3651
3782
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3652
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3783
|
+
}, { concurrency: READ_CONCURRENCY$39 });
|
|
3653
3784
|
return Array$1.getSomes(found);
|
|
3654
3785
|
});
|
|
3655
3786
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3656
3787
|
const RECOMMENDED_LINES = 200;
|
|
3657
3788
|
const FIRST$24 = 1;
|
|
3658
|
-
const RULE$
|
|
3789
|
+
const RULE$75 = "agent-docs-length";
|
|
3659
3790
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3660
3791
|
const problemFor$10 = (file) => (lines) => {
|
|
3661
3792
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3663,18 +3794,18 @@ const problemFor$10 = (file) => (lines) => {
|
|
|
3663
3794
|
file,
|
|
3664
3795
|
line: 201,
|
|
3665
3796
|
column: FIRST$24,
|
|
3666
|
-
rule: RULE$
|
|
3797
|
+
rule: RULE$75,
|
|
3667
3798
|
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.`
|
|
3668
3799
|
});
|
|
3669
3800
|
};
|
|
3670
3801
|
/** @internal */
|
|
3671
3802
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
|
|
3672
3803
|
// src/features/check-placement/model/claude-link.ts
|
|
3673
|
-
const RULE$
|
|
3804
|
+
const RULE$74 = "claude-md-link";
|
|
3674
3805
|
const CLAUDE = "CLAUDE.md";
|
|
3675
3806
|
const AGENTS = "AGENTS.md";
|
|
3676
3807
|
const FIRST$23 = 1;
|
|
3677
|
-
const READ_CONCURRENCY$
|
|
3808
|
+
const READ_CONCURRENCY$38 = 16;
|
|
3678
3809
|
const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3679
3810
|
/** @internal */
|
|
3680
3811
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3689,19 +3820,19 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3689
3820
|
file: path,
|
|
3690
3821
|
line: FIRST$23,
|
|
3691
3822
|
column: FIRST$23,
|
|
3692
|
-
rule: RULE$
|
|
3823
|
+
rule: RULE$74,
|
|
3693
3824
|
message: MESSAGE$15
|
|
3694
3825
|
})));
|
|
3695
3826
|
});
|
|
3696
3827
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3697
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3828
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$38 });
|
|
3698
3829
|
return Array$1.getSomes(found);
|
|
3699
3830
|
});
|
|
3700
3831
|
// src/features/check-placement/model/dangling-links.ts
|
|
3701
|
-
const RULE$
|
|
3832
|
+
const RULE$73 = "dangling-link";
|
|
3702
3833
|
const SEPARATOR$26 = "/";
|
|
3703
3834
|
const FIRST$22 = 1;
|
|
3704
|
-
const READ_CONCURRENCY$
|
|
3835
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3705
3836
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$26}`)(name);
|
|
3706
3837
|
/** @internal */
|
|
3707
3838
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -3714,11 +3845,11 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3714
3845
|
file,
|
|
3715
3846
|
line: FIRST$22,
|
|
3716
3847
|
column: FIRST$22,
|
|
3717
|
-
rule: RULE$
|
|
3848
|
+
rule: RULE$73,
|
|
3718
3849
|
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.`
|
|
3719
3850
|
})));
|
|
3720
3851
|
});
|
|
3721
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3852
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$37 });
|
|
3722
3853
|
return Array$1.getSomes(found);
|
|
3723
3854
|
});
|
|
3724
3855
|
// src/features/check-placement/model/member-sources.ts
|
|
@@ -3772,9 +3903,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3772
3903
|
}));
|
|
3773
3904
|
});
|
|
3774
3905
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3775
|
-
const RULE$
|
|
3906
|
+
const RULE$72 = "deployed-readme";
|
|
3776
3907
|
const ROOT_DIRECTORY$4 = "";
|
|
3777
|
-
const READ_CONCURRENCY$
|
|
3908
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3778
3909
|
const MISSING_MESSAGE$3 = "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.";
|
|
3779
3910
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3780
3911
|
const ADDRESS_KEYS = [
|
|
@@ -3812,14 +3943,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3812
3943
|
const readme = yield* readReadme({
|
|
3813
3944
|
root,
|
|
3814
3945
|
directory,
|
|
3815
|
-
rule: RULE$
|
|
3946
|
+
rule: RULE$72,
|
|
3816
3947
|
missingMessage: MISSING_MESSAGE$3
|
|
3817
3948
|
});
|
|
3818
3949
|
return Result.match(readme, {
|
|
3819
3950
|
onFailure: Option.some,
|
|
3820
3951
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3821
3952
|
file,
|
|
3822
|
-
rule: RULE$
|
|
3953
|
+
rule: RULE$72,
|
|
3823
3954
|
message: NO_URL_MESSAGE
|
|
3824
3955
|
})))
|
|
3825
3956
|
});
|
|
@@ -3830,16 +3961,16 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3830
3961
|
const listed = yield* files.listedFiles(root);
|
|
3831
3962
|
const directories = yield* workspaceDirectories(root);
|
|
3832
3963
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3833
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3964
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$36 });
|
|
3834
3965
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3835
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3966
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$36 });
|
|
3836
3967
|
return Array$1.getSomes(found);
|
|
3837
3968
|
});
|
|
3838
3969
|
// src/features/check-placement/model/nested-docs.ts
|
|
3839
|
-
const RULE$
|
|
3970
|
+
const RULE$71 = "nested-docs";
|
|
3840
3971
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3841
3972
|
const SEPARATOR$24 = "/";
|
|
3842
|
-
const READ_CONCURRENCY$
|
|
3973
|
+
const READ_CONCURRENCY$35 = 64;
|
|
3843
3974
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3844
3975
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3845
3976
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
@@ -3849,7 +3980,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
|
|
|
3849
3980
|
const taggedError$13 = Schema.TaggedError;
|
|
3850
3981
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3851
3982
|
const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
|
|
3852
|
-
const problemFor$9 = problemInFile(RULE$
|
|
3983
|
+
const problemFor$9 = problemInFile(RULE$71);
|
|
3853
3984
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3854
3985
|
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.";
|
|
3855
3986
|
const MISSING_MESSAGE$2 = "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.";
|
|
@@ -3896,7 +4027,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3896
4027
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3897
4028
|
workspaceAgentDocs
|
|
3898
4029
|
};
|
|
3899
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
4030
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$35 });
|
|
3900
4031
|
const missing = missingProblems({
|
|
3901
4032
|
required: workspaceAgentDocs,
|
|
3902
4033
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3906,15 +4037,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3906
4037
|
return [...Array$1.getSomes(found), ...missing];
|
|
3907
4038
|
});
|
|
3908
4039
|
// src/features/check-placement/model/published-readme.ts
|
|
3909
|
-
const RULE$
|
|
3910
|
-
const READ_CONCURRENCY$
|
|
4040
|
+
const RULE$70 = "published-readme";
|
|
4041
|
+
const READ_CONCURRENCY$34 = 16;
|
|
3911
4042
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3912
4043
|
const MISSING_MESSAGE$1 = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3913
4044
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3914
4045
|
const readme = yield* readReadme({
|
|
3915
4046
|
root,
|
|
3916
4047
|
directory,
|
|
3917
|
-
rule: RULE$
|
|
4048
|
+
rule: RULE$70,
|
|
3918
4049
|
missingMessage: MISSING_MESSAGE$1
|
|
3919
4050
|
});
|
|
3920
4051
|
return Result.match(readme, {
|
|
@@ -3925,7 +4056,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3925
4056
|
file,
|
|
3926
4057
|
line,
|
|
3927
4058
|
column,
|
|
3928
|
-
rule: RULE$
|
|
4059
|
+
rule: RULE$70,
|
|
3929
4060
|
message: MESSAGE$14
|
|
3930
4061
|
};
|
|
3931
4062
|
}))
|
|
@@ -3934,11 +4065,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3934
4065
|
/** @internal */
|
|
3935
4066
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3936
4067
|
const projects = yield* publishedProjects(root);
|
|
3937
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
4068
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$34 });
|
|
3938
4069
|
return Array$1.getSomes(found);
|
|
3939
4070
|
});
|
|
3940
4071
|
// src/features/check-placement/model/published-tests.ts
|
|
3941
|
-
const RULE$
|
|
4072
|
+
const RULE$69 = "published-tests";
|
|
3942
4073
|
const FILE_START = 1;
|
|
3943
4074
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3944
4075
|
const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3952,7 +4083,7 @@ const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3952
4083
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3953
4084
|
line: FILE_START,
|
|
3954
4085
|
column: FILE_START,
|
|
3955
|
-
rule: RULE$
|
|
4086
|
+
rule: RULE$69,
|
|
3956
4087
|
message: MESSAGE$13
|
|
3957
4088
|
});
|
|
3958
4089
|
});
|
|
@@ -3966,13 +4097,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3966
4097
|
return Array$1.getSomes(found);
|
|
3967
4098
|
});
|
|
3968
4099
|
// src/features/check-placement/model/root-docs.ts
|
|
3969
|
-
const RULE$
|
|
4100
|
+
const RULE$68 = "root-docs";
|
|
3970
4101
|
const SEPARATOR$23 = "/";
|
|
3971
4102
|
const FIRST$20 = 1;
|
|
3972
|
-
const MARKDOWN$
|
|
4103
|
+
const MARKDOWN$7 = /\.(?:md|mdx|markdown)$/iu;
|
|
3973
4104
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3974
4105
|
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.";
|
|
3975
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$23)(name) && MARKDOWN$
|
|
4106
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$23)(name) && MARKDOWN$7.test(name) && !ALLOWED$1.test(name);
|
|
3976
4107
|
/** @internal */
|
|
3977
4108
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3978
4109
|
const files = yield* RepositoryFiles;
|
|
@@ -3981,15 +4112,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3981
4112
|
file: files.join(root, name),
|
|
3982
4113
|
line: FIRST$20,
|
|
3983
4114
|
column: FIRST$20,
|
|
3984
|
-
rule: RULE$
|
|
4115
|
+
rule: RULE$68,
|
|
3985
4116
|
message: `${name} ${MESSAGE$12}`
|
|
3986
4117
|
})));
|
|
3987
4118
|
});
|
|
3988
4119
|
// src/features/check-placement/model/root-readme.ts
|
|
3989
|
-
const RULE$
|
|
4120
|
+
const RULE$67 = "root-readme";
|
|
3990
4121
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3991
|
-
const READ_CONCURRENCY$
|
|
3992
|
-
const START$
|
|
4122
|
+
const READ_CONCURRENCY$33 = 16;
|
|
4123
|
+
const START$33 = 0;
|
|
3993
4124
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3994
4125
|
const RELATIVE$4 = /^\.\//u;
|
|
3995
4126
|
const MarketplacePlugin = Schema.Struct({
|
|
@@ -4029,7 +4160,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4029
4160
|
const message = messageFor$5(workspace.directory);
|
|
4030
4161
|
const at = positionOf(source);
|
|
4031
4162
|
const pattern = patternFor(plugins)(workspace);
|
|
4032
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4163
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$67)(file, at(found.index ?? START$33), message)));
|
|
4033
4164
|
};
|
|
4034
4165
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4035
4166
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4046,7 +4177,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4046
4177
|
const named = yield* namedWorkspaces(root);
|
|
4047
4178
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4048
4179
|
const plugins = yield* marketplacePlugins(root);
|
|
4049
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4180
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$33 });
|
|
4050
4181
|
return Array$1.flatten(found);
|
|
4051
4182
|
});
|
|
4052
4183
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4066,10 +4197,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4066
4197
|
return Array$1.flatten(found);
|
|
4067
4198
|
});
|
|
4068
4199
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4069
|
-
const RULE$
|
|
4200
|
+
const RULE$66 = "docs-mirror";
|
|
4070
4201
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4071
4202
|
const MIRROR_LIMIT = 3;
|
|
4072
|
-
const READ_CONCURRENCY$
|
|
4203
|
+
const READ_CONCURRENCY$32 = 16;
|
|
4073
4204
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4074
4205
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4075
4206
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4091,7 +4222,7 @@ const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
4091
4222
|
file,
|
|
4092
4223
|
line,
|
|
4093
4224
|
column,
|
|
4094
|
-
rule: RULE$
|
|
4225
|
+
rule: RULE$66,
|
|
4095
4226
|
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.`
|
|
4096
4227
|
};
|
|
4097
4228
|
}), Option.toArray);
|
|
@@ -4106,7 +4237,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4106
4237
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4107
4238
|
directory,
|
|
4108
4239
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4109
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4240
|
+
}))), { concurrency: READ_CONCURRENCY$32 });
|
|
4110
4241
|
});
|
|
4111
4242
|
/** @internal */
|
|
4112
4243
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4119,11 +4250,11 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4119
4250
|
onNone: () => [],
|
|
4120
4251
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4121
4252
|
})));
|
|
4122
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4253
|
+
}, { concurrency: READ_CONCURRENCY$32 });
|
|
4123
4254
|
return Array$1.flatten(found);
|
|
4124
4255
|
});
|
|
4125
4256
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4126
|
-
const RULE$
|
|
4257
|
+
const RULE$65 = "ignored-sources";
|
|
4127
4258
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4128
4259
|
const FIRST$19 = 1;
|
|
4129
4260
|
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.";
|
|
@@ -4135,7 +4266,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4135
4266
|
file: files.join(root, file),
|
|
4136
4267
|
line: FIRST$19,
|
|
4137
4268
|
column: FIRST$19,
|
|
4138
|
-
rule: RULE$
|
|
4269
|
+
rule: RULE$65,
|
|
4139
4270
|
message: MESSAGE$11
|
|
4140
4271
|
})));
|
|
4141
4272
|
});
|
|
@@ -12812,7 +12943,7 @@ const LAYER_ITEMS = [
|
|
|
12812
12943
|
"attribute_item",
|
|
12813
12944
|
"inner_attribute_item"
|
|
12814
12945
|
];
|
|
12815
|
-
const READ_CONCURRENCY$
|
|
12946
|
+
const READ_CONCURRENCY$31 = 64;
|
|
12816
12947
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12817
12948
|
const NONE$4 = [];
|
|
12818
12949
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
@@ -12888,17 +13019,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12888
13019
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
12889
13020
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
12890
13021
|
const parse = parsedWith(language);
|
|
12891
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
13022
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$31 });
|
|
12892
13023
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12893
13024
|
});
|
|
12894
13025
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12895
|
-
const RULE$
|
|
13026
|
+
const RULE$64 = "shadcn-ui-alias";
|
|
12896
13027
|
const FIRST$18 = 1;
|
|
12897
13028
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12898
13029
|
file,
|
|
12899
13030
|
line: FIRST$18,
|
|
12900
13031
|
column: FIRST$18,
|
|
12901
|
-
rule: RULE$
|
|
13032
|
+
rule: RULE$64,
|
|
12902
13033
|
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/*".`
|
|
12903
13034
|
});
|
|
12904
13035
|
/** @internal */
|
|
@@ -12962,7 +13093,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12962
13093
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12963
13094
|
const SEPARATOR$20 = "/";
|
|
12964
13095
|
const CURRENT = "./";
|
|
12965
|
-
const READ_CONCURRENCY$
|
|
13096
|
+
const READ_CONCURRENCY$30 = 8;
|
|
12966
13097
|
const FIRST$17 = 1;
|
|
12967
13098
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12968
13099
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -13004,7 +13135,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
13004
13135
|
const files = yield* RepositoryFiles;
|
|
13005
13136
|
const listed = yield* files.listedFiles(root);
|
|
13006
13137
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
13007
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
13138
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$30 });
|
|
13008
13139
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
13009
13140
|
});
|
|
13010
13141
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$20));
|
|
@@ -13067,9 +13198,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13067
13198
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13068
13199
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13069
13200
|
const workflows = yield* workflowText(root);
|
|
13070
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
13071
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13072
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13201
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$30 });
|
|
13202
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$30 });
|
|
13203
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$30 });
|
|
13073
13204
|
return [
|
|
13074
13205
|
...Array$1.flatten(found),
|
|
13075
13206
|
...Array$1.getSomes(scripts),
|
|
@@ -13077,14 +13208,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13077
13208
|
];
|
|
13078
13209
|
});
|
|
13079
13210
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13080
|
-
const START$
|
|
13211
|
+
const START$32 = 0;
|
|
13081
13212
|
const QUOTES = ["\"", "'"];
|
|
13082
13213
|
const firstIndex = (source, needles) => {
|
|
13083
13214
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13084
13215
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13085
13216
|
};
|
|
13086
13217
|
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13087
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$
|
|
13218
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$32));
|
|
13088
13219
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13089
13220
|
const MEMBER_LISTS = [
|
|
13090
13221
|
"members",
|
|
@@ -13100,14 +13231,14 @@ const WORKSPACE = "workspace";
|
|
|
13100
13231
|
const PATCH = "patch";
|
|
13101
13232
|
const PATCH_DEPTH = 2;
|
|
13102
13233
|
const WORKSPACE_DEPTH = 1;
|
|
13103
|
-
const START$
|
|
13234
|
+
const START$31 = 0;
|
|
13104
13235
|
const WILDCARD$4 = /[*?[]/u;
|
|
13105
13236
|
const KEY_SEPARATOR$1 = ".";
|
|
13106
13237
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
13107
13238
|
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13108
13239
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
13109
|
-
const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$
|
|
13110
|
-
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$
|
|
13240
|
+
const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$31).pipe(Option.exists((name) => name === PATCH));
|
|
13241
|
+
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$31).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
|
|
13111
13242
|
const namedPaths = (trail, key, value) => {
|
|
13112
13243
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR$1);
|
|
13113
13244
|
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
@@ -13166,26 +13297,26 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13166
13297
|
])));
|
|
13167
13298
|
});
|
|
13168
13299
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13169
|
-
const RULE$
|
|
13300
|
+
const RULE$63 = "config-path";
|
|
13170
13301
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13171
13302
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13172
13303
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13173
13304
|
const OUTSIDE = "..";
|
|
13174
|
-
const READ_CONCURRENCY$
|
|
13305
|
+
const READ_CONCURRENCY$29 = 8;
|
|
13175
13306
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13176
13307
|
const files = yield* RepositoryFiles;
|
|
13177
13308
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
13178
13309
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13179
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13310
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$29 });
|
|
13180
13311
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13181
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13312
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$29 });
|
|
13182
13313
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13183
13314
|
});
|
|
13184
13315
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
13185
13316
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13186
13317
|
file,
|
|
13187
13318
|
...positionOf(source)(mention.index),
|
|
13188
|
-
rule: RULE$
|
|
13319
|
+
rule: RULE$63,
|
|
13189
13320
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13190
13321
|
});
|
|
13191
13322
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13198,7 +13329,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
13198
13329
|
const source = yield* files.readFile(file);
|
|
13199
13330
|
if (Option.isNone(source)) return [];
|
|
13200
13331
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13201
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13332
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$29 });
|
|
13202
13333
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13203
13334
|
});
|
|
13204
13335
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13210,7 +13341,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13210
13341
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13211
13342
|
file,
|
|
13212
13343
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13213
|
-
rule: RULE$
|
|
13344
|
+
rule: RULE$63,
|
|
13214
13345
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13215
13346
|
})));
|
|
13216
13347
|
});
|
|
@@ -13218,23 +13349,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13218
13349
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13219
13350
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13220
13351
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13221
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$
|
|
13352
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$29 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13222
13353
|
return [...Array$1.flatten(found), ...patterns];
|
|
13223
13354
|
});
|
|
13224
13355
|
// src/features/check-repository-layout/model/crates.ts
|
|
13225
|
-
const RULE$
|
|
13356
|
+
const RULE$62 = "unverified-crate";
|
|
13226
13357
|
const VERSION_RULE = "release-version";
|
|
13227
13358
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13228
13359
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13229
13360
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13230
13361
|
const SEPARATOR$18 = "/";
|
|
13231
13362
|
const FIRST$16 = 1;
|
|
13232
|
-
const READ_CONCURRENCY$
|
|
13363
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13233
13364
|
const problemFor$6 = (crate, message) => ({
|
|
13234
13365
|
file: crate.manifest,
|
|
13235
13366
|
line: FIRST$16,
|
|
13236
13367
|
column: FIRST$16,
|
|
13237
|
-
rule: RULE$
|
|
13368
|
+
rule: RULE$62,
|
|
13238
13369
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13239
13370
|
});
|
|
13240
13371
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -13269,11 +13400,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13269
13400
|
const crates = yield* cratesIn(root);
|
|
13270
13401
|
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$8)));
|
|
13271
13402
|
const unverified = (crate) => problemIn$3(root, directories, crate).pipe(Effect.when(notAtRoot), Effect.map(Option.flatten));
|
|
13272
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13403
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$28 });
|
|
13273
13404
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13274
13405
|
});
|
|
13275
13406
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13276
|
-
const RULE$
|
|
13407
|
+
const RULE$61 = "deploy-entry-pattern";
|
|
13277
13408
|
const FALLOW_KEYS = [
|
|
13278
13409
|
"entry",
|
|
13279
13410
|
"entryPoints",
|
|
@@ -13291,7 +13422,7 @@ const NEGATED = "!";
|
|
|
13291
13422
|
const ROOT_WORKSPACE = ".";
|
|
13292
13423
|
const WRAP_OFFSET$1 = 1;
|
|
13293
13424
|
const NO_OFFSET = 0;
|
|
13294
|
-
const READ_CONCURRENCY$
|
|
13425
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13295
13426
|
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.";
|
|
13296
13427
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13297
13428
|
const FALLOW = {
|
|
@@ -13344,7 +13475,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13344
13475
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13345
13476
|
file: path,
|
|
13346
13477
|
...positionOf(text.value)(start - kind.offset),
|
|
13347
|
-
rule: RULE$
|
|
13478
|
+
rule: RULE$61,
|
|
13348
13479
|
message: `${pattern} ${MESSAGE$10}`
|
|
13349
13480
|
})));
|
|
13350
13481
|
});
|
|
@@ -13373,11 +13504,11 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13373
13504
|
kind,
|
|
13374
13505
|
workspaces,
|
|
13375
13506
|
entries
|
|
13376
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13507
|
+
}), { concurrency: READ_CONCURRENCY$27 });
|
|
13377
13508
|
return Array$1.flatten(found);
|
|
13378
13509
|
});
|
|
13379
13510
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13380
|
-
const RULE$
|
|
13511
|
+
const RULE$60 = "listed-entry";
|
|
13381
13512
|
const ENTRY_KEYS = [
|
|
13382
13513
|
"entry",
|
|
13383
13514
|
"entryPoints",
|
|
@@ -13387,7 +13518,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
13387
13518
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13388
13519
|
const SEPARATOR$17 = "/";
|
|
13389
13520
|
const WRAP_OFFSET = 1;
|
|
13390
|
-
const READ_CONCURRENCY$
|
|
13521
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13391
13522
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13392
13523
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13393
13524
|
const entryPatternsIn = (node) => {
|
|
@@ -13407,7 +13538,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13407
13538
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13408
13539
|
file: path,
|
|
13409
13540
|
...positionOf(text.value)(start),
|
|
13410
|
-
rule: RULE$
|
|
13541
|
+
rule: RULE$60,
|
|
13411
13542
|
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.`
|
|
13412
13543
|
})));
|
|
13413
13544
|
});
|
|
@@ -13415,11 +13546,11 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13415
13546
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13416
13547
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13417
13548
|
const directories = yield* workspaceDirectories(root);
|
|
13418
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
13549
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$26 });
|
|
13419
13550
|
return Array$1.flatten(found);
|
|
13420
13551
|
});
|
|
13421
13552
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13422
|
-
const RULE$
|
|
13553
|
+
const RULE$59 = "root-workspace-path";
|
|
13423
13554
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13424
13555
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13425
13556
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -13438,7 +13569,7 @@ const mentions = (directory) => (text) => {
|
|
|
13438
13569
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13439
13570
|
file,
|
|
13440
13571
|
...positionOf(source)(found.start),
|
|
13441
|
-
rule: RULE$
|
|
13572
|
+
rule: RULE$59,
|
|
13442
13573
|
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.`
|
|
13443
13574
|
})));
|
|
13444
13575
|
/** @internal */
|
|
@@ -13452,10 +13583,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13452
13583
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13453
13584
|
});
|
|
13454
13585
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13455
|
-
const RULE$
|
|
13586
|
+
const RULE$58 = "hidden-verify";
|
|
13456
13587
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13457
13588
|
const FIRST$14 = 1;
|
|
13458
|
-
const READ_CONCURRENCY$
|
|
13589
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13459
13590
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13460
13591
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13461
13592
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13466,19 +13597,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13466
13597
|
file,
|
|
13467
13598
|
line: FIRST$14,
|
|
13468
13599
|
column: FIRST$14,
|
|
13469
|
-
rule: RULE$
|
|
13600
|
+
rule: RULE$58,
|
|
13470
13601
|
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}.`
|
|
13471
13602
|
}).pipe(Option.filter(() => verified));
|
|
13472
13603
|
});
|
|
13473
13604
|
/** @internal */
|
|
13474
13605
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13475
13606
|
const directories = yield* workspaceDirectories(root);
|
|
13476
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13607
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$25 });
|
|
13477
13608
|
return Array$1.getSomes(found);
|
|
13478
13609
|
});
|
|
13479
13610
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13480
|
-
const RULE$
|
|
13481
|
-
const READ_CONCURRENCY$
|
|
13611
|
+
const RULE$57 = "shared-uncached-task";
|
|
13612
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13482
13613
|
const SHARED = 2;
|
|
13483
13614
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13484
13615
|
const UncachedTask = Schema.Struct({
|
|
@@ -13520,19 +13651,19 @@ const problemsOf$3 = (definitions) => {
|
|
|
13520
13651
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13521
13652
|
file,
|
|
13522
13653
|
...position,
|
|
13523
|
-
rule: RULE$
|
|
13654
|
+
rule: RULE$57,
|
|
13524
13655
|
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.`
|
|
13525
13656
|
})));
|
|
13526
13657
|
};
|
|
13527
13658
|
/** @internal */
|
|
13528
13659
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13529
13660
|
const directories = yield* workspaceDirectories(root);
|
|
13530
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13661
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
13531
13662
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13532
13663
|
});
|
|
13533
13664
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13534
|
-
const RULE$
|
|
13535
|
-
const READ_CONCURRENCY$
|
|
13665
|
+
const RULE$56 = "tested-verify";
|
|
13666
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13536
13667
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13537
13668
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13538
13669
|
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
@@ -13560,19 +13691,19 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13560
13691
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13561
13692
|
file,
|
|
13562
13693
|
...positionOf(source)(at.start),
|
|
13563
|
-
rule: RULE$
|
|
13694
|
+
rule: RULE$56,
|
|
13564
13695
|
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.`
|
|
13565
13696
|
})))));
|
|
13566
13697
|
});
|
|
13567
13698
|
/** @internal */
|
|
13568
13699
|
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13569
13700
|
const directories = yield* workspaceDirectories(root);
|
|
13570
|
-
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13701
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
13571
13702
|
return Array$1.flatten(found);
|
|
13572
13703
|
});
|
|
13573
13704
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13574
|
-
const RULE$
|
|
13575
|
-
const READ_CONCURRENCY$
|
|
13705
|
+
const RULE$55 = "unlocked-task";
|
|
13706
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13576
13707
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13577
13708
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13578
13709
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -13583,13 +13714,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13583
13714
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13584
13715
|
file,
|
|
13585
13716
|
...positionOf(source)(task.start),
|
|
13586
|
-
rule: RULE$
|
|
13717
|
+
rule: RULE$55,
|
|
13587
13718
|
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.`
|
|
13588
13719
|
})), Option.toArray)));
|
|
13589
13720
|
/** @internal */
|
|
13590
13721
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13591
13722
|
const directories = yield* workspaceDirectories(root);
|
|
13592
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13723
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
13593
13724
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13594
13725
|
});
|
|
13595
13726
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13783,11 +13914,11 @@ const LISTED_LARGEST = 5;
|
|
|
13783
13914
|
const SIZE_CONCURRENCY = 32;
|
|
13784
13915
|
const MEGABYTE = 1e6;
|
|
13785
13916
|
const MEGABYTE_DIGITS = 1;
|
|
13786
|
-
const START$
|
|
13917
|
+
const START$30 = 0;
|
|
13787
13918
|
const SINGLE_ENTRY = 1;
|
|
13788
13919
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13789
13920
|
const usageHint = (dependency, entryCount) => {
|
|
13790
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13921
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$30 && dependency.entries.length < entryCount)) return "";
|
|
13791
13922
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13792
13923
|
};
|
|
13793
13924
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13796,7 +13927,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13796
13927
|
const { workspace, total } = overrun;
|
|
13797
13928
|
const config = yield* files.readFile(workspace.configFile);
|
|
13798
13929
|
const source = Option.getOrElse(config, () => "");
|
|
13799
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13930
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$30);
|
|
13800
13931
|
return {
|
|
13801
13932
|
file: workspace.configFile,
|
|
13802
13933
|
...positionOf(source)(index),
|
|
@@ -13813,7 +13944,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13813
13944
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13814
13945
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13815
13946
|
const sizes = HashMap.fromIterable(measured);
|
|
13816
|
-
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$
|
|
13947
|
+
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$30))), Number$1.sumAll);
|
|
13817
13948
|
return {
|
|
13818
13949
|
closures,
|
|
13819
13950
|
sizeOf,
|
|
@@ -13846,11 +13977,11 @@ const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(publishe
|
|
|
13846
13977
|
})];
|
|
13847
13978
|
});
|
|
13848
13979
|
const stackProblems = (file, source, dependencies) => {
|
|
13849
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
13980
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$30);
|
|
13850
13981
|
const rest = String$1.slice(section)(source);
|
|
13851
13982
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
13852
13983
|
file,
|
|
13853
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
13984
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$30)),
|
|
13854
13985
|
rule: STACK_DEPENDENCY,
|
|
13855
13986
|
message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
|
|
13856
13987
|
})));
|
|
@@ -13899,12 +14030,12 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13899
14030
|
return yield* files.mergeBase(root, base);
|
|
13900
14031
|
});
|
|
13901
14032
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13902
|
-
const RULE$
|
|
14033
|
+
const RULE$54 = "migration-order";
|
|
13903
14034
|
const SNAPSHOT = "snapshot.json";
|
|
13904
14035
|
const MIGRATION = "migration.sql";
|
|
13905
14036
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
13906
14037
|
const FIRST$13 = 1;
|
|
13907
|
-
const READ_CONCURRENCY$
|
|
14038
|
+
const READ_CONCURRENCY$21 = 16;
|
|
13908
14039
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
13909
14040
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
13910
14041
|
const files = yield* RepositoryFiles;
|
|
@@ -13933,7 +14064,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13933
14064
|
file: join(root, file),
|
|
13934
14065
|
line: FIRST$13,
|
|
13935
14066
|
column: FIRST$13,
|
|
13936
|
-
rule: RULE$
|
|
14067
|
+
rule: RULE$54,
|
|
13937
14068
|
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}.`
|
|
13938
14069
|
})))), Option.getOrElse(() => []));
|
|
13939
14070
|
/** @internal */
|
|
@@ -13944,7 +14075,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
13944
14075
|
if (Option.isNone(found)) return [];
|
|
13945
14076
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
13946
14077
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
13947
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
14078
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$21 });
|
|
13948
14079
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
13949
14080
|
});
|
|
13950
14081
|
// src/shared/lib/bundle-error.ts
|
|
@@ -14036,7 +14167,7 @@ const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
|
|
|
14036
14167
|
return pipe(output.output, Array$1.filter(isChunk$2), Array$1.map((chunk) => [chunk.fileName, chunk.code]), Record.fromEntries, Record.set(`${request.name}.d.ts`, `export * from "${request.name}";\n`));
|
|
14037
14168
|
});
|
|
14038
14169
|
// src/features/check-mod-vendor/model/mod-vendor.ts
|
|
14039
|
-
const RULE$
|
|
14170
|
+
const RULE$53 = "mod-vendor";
|
|
14040
14171
|
const VENDOR = "vendor";
|
|
14041
14172
|
const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
|
|
14042
14173
|
const RELATIVE$1 = /^\.\.?\//u;
|
|
@@ -14044,7 +14175,7 @@ const FILE_LIMIT = 1048576;
|
|
|
14044
14175
|
const TOTAL_LIMIT = 8388608;
|
|
14045
14176
|
const CONCURRENCY$6 = 4;
|
|
14046
14177
|
const EMPTY$3 = "";
|
|
14047
|
-
const problemFor$5 = problemInFile(RULE$
|
|
14178
|
+
const problemFor$5 = problemInFile(RULE$53);
|
|
14048
14179
|
const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
|
|
14049
14180
|
const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
|
|
14050
14181
|
const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
|
|
@@ -14149,7 +14280,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
14149
14280
|
catch: bundleErrorDetail
|
|
14150
14281
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
14151
14282
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
14152
|
-
const RULE$
|
|
14283
|
+
const RULE$52 = "plugin-dependencies";
|
|
14153
14284
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
14154
14285
|
const LOCK_FILE = "bun.lock";
|
|
14155
14286
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
@@ -14158,7 +14289,7 @@ const SUCCESS$6 = 0;
|
|
|
14158
14289
|
const NOT_STARTED = -1;
|
|
14159
14290
|
const DETAIL_LINES = 3;
|
|
14160
14291
|
const PLUGIN_CONCURRENCY = 2;
|
|
14161
|
-
const problemFor$4 = problemInFile(RULE$
|
|
14292
|
+
const problemFor$4 = problemInFile(RULE$52);
|
|
14162
14293
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
14163
14294
|
const files = yield* RepositoryFiles;
|
|
14164
14295
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -14387,9 +14518,9 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
14387
14518
|
});
|
|
14388
14519
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
14389
14520
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14390
|
-
const RULE$
|
|
14521
|
+
const RULE$51 = "optional-peer";
|
|
14391
14522
|
const REQUIRED_RULE = "required-peer";
|
|
14392
|
-
const START$
|
|
14523
|
+
const START$29 = 0;
|
|
14393
14524
|
const SINGLE$3 = 1;
|
|
14394
14525
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
14395
14526
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
@@ -14397,14 +14528,14 @@ const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, na
|
|
|
14397
14528
|
const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
|
|
14398
14529
|
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
14399
14530
|
const positionIn = (located, key, name) => {
|
|
14400
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
14531
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$29);
|
|
14401
14532
|
const rest = String$1.slice(section)(located.source);
|
|
14402
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14533
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$29));
|
|
14403
14534
|
};
|
|
14404
14535
|
const problemFor$3 = (located, name, importers) => ({
|
|
14405
14536
|
file: located.file,
|
|
14406
14537
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
14407
|
-
rule: RULE$
|
|
14538
|
+
rule: RULE$51,
|
|
14408
14539
|
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.`
|
|
14409
14540
|
});
|
|
14410
14541
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -14419,7 +14550,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
|
14419
14550
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
14420
14551
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
14421
14552
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
14422
|
-
if (!(importers.length > START$
|
|
14553
|
+
if (!(importers.length > START$29 && importers.length < libraries.length) || neededByBin) return [];
|
|
14423
14554
|
return [problemFor$3(located, name, importers)];
|
|
14424
14555
|
}));
|
|
14425
14556
|
};
|
|
@@ -14440,9 +14571,9 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14440
14571
|
}));
|
|
14441
14572
|
};
|
|
14442
14573
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14443
|
-
const RULE$
|
|
14574
|
+
const RULE$50 = "side-effects";
|
|
14444
14575
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14445
|
-
const START$
|
|
14576
|
+
const START$28 = 0;
|
|
14446
14577
|
const FIRST$12 = 1;
|
|
14447
14578
|
const LISTED_PACKAGES = 4;
|
|
14448
14579
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -14466,7 +14597,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
14466
14597
|
label: entry.label,
|
|
14467
14598
|
member,
|
|
14468
14599
|
...extra
|
|
14469
|
-
}, ({ modules }) => modules > START$
|
|
14600
|
+
}, ({ modules }) => modules > START$28);
|
|
14470
14601
|
});
|
|
14471
14602
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
14472
14603
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -14488,17 +14619,17 @@ const othersOf = (total) => {
|
|
|
14488
14619
|
};
|
|
14489
14620
|
const messageOf$5 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
|
|
14490
14621
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14491
|
-
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$
|
|
14622
|
+
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$28));
|
|
14492
14623
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14493
14624
|
file,
|
|
14494
14625
|
...positionOf(source)(keyIndex$1(source)),
|
|
14495
|
-
rule: RULE$
|
|
14626
|
+
rule: RULE$50,
|
|
14496
14627
|
message: messageOf$5(worst, excesses.length)
|
|
14497
14628
|
})), Option.toArray);
|
|
14498
14629
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14499
|
-
const RULE$
|
|
14630
|
+
const RULE$49 = "top-level-effect";
|
|
14500
14631
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14501
|
-
const READ_CONCURRENCY$
|
|
14632
|
+
const READ_CONCURRENCY$20 = 16;
|
|
14502
14633
|
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.";
|
|
14503
14634
|
const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
|
|
14504
14635
|
const isEffect = (statement) => {
|
|
@@ -14512,7 +14643,7 @@ const messageOf$4 = (statement) => {
|
|
|
14512
14643
|
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14513
14644
|
const retained = api.createSourceFile(file, source);
|
|
14514
14645
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14515
|
-
rule: RULE$
|
|
14646
|
+
rule: RULE$49,
|
|
14516
14647
|
message: messageOf$4(statement)
|
|
14517
14648
|
})(statement)));
|
|
14518
14649
|
retained.dispose();
|
|
@@ -14525,11 +14656,11 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14525
14656
|
const names = yield* files.ownedFiles(root);
|
|
14526
14657
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14527
14658
|
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
14528
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$
|
|
14659
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$20 });
|
|
14529
14660
|
return Array$1.flatten(found);
|
|
14530
14661
|
}, Effect.scoped);
|
|
14531
14662
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14532
|
-
const START$
|
|
14663
|
+
const START$27 = 0;
|
|
14533
14664
|
const NAME_KEY$2 = "\"name\"";
|
|
14534
14665
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14535
14666
|
const parent = files.dirname(module);
|
|
@@ -14546,7 +14677,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14546
14677
|
})));
|
|
14547
14678
|
});
|
|
14548
14679
|
const undeclaredMessage = (files, root) => ({ directory, name }) => `bundles modules of \`${name}\`, whose package.json does not declare "sideEffects". A bundler reads that field from the package that owns each module, so it keeps every module that \`${name}\` re-exports, together with what those modules import, even when this package uses none of them. Declare "sideEffects": false in ${files.relative(root, files.join(directory, PACKAGE_JSON_FILE))}, and keep a module that must run for its effect out of that package.`;
|
|
14549
|
-
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$
|
|
14680
|
+
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$27));
|
|
14550
14681
|
/** @internal */
|
|
14551
14682
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14552
14683
|
const files = yield* RepositoryFiles;
|
|
@@ -14555,7 +14686,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14555
14686
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14556
14687
|
const ownedSet = new Set(owned);
|
|
14557
14688
|
const directories = pipe(used, Array$1.flatMap(({ modules }) => modules), Array$1.filter((module) => ownedSet.has(module)), Array$1.flatMap((module) => Option.toArray(packageDirectoryOf(manifests, files)(module))), Array$1.dedupe, Array$1.filter((found) => found !== directory), Array$1.sortBy(Order.String));
|
|
14558
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14689
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$20 });
|
|
14559
14690
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14560
14691
|
const index = nameIndex$1(located.source);
|
|
14561
14692
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14681,7 +14812,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
14681
14812
|
return Array$1.flatten(found);
|
|
14682
14813
|
});
|
|
14683
14814
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14684
|
-
const RULE$
|
|
14815
|
+
const RULE$48 = "legacy-typescript";
|
|
14685
14816
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14686
14817
|
const COMPILER = "typescript";
|
|
14687
14818
|
const CURRENT_MAJOR = 7;
|
|
@@ -14712,12 +14843,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14712
14843
|
file,
|
|
14713
14844
|
line: lineOf$4(source)(legacy.id),
|
|
14714
14845
|
column: FIRST$11,
|
|
14715
|
-
rule: RULE$
|
|
14846
|
+
rule: RULE$48,
|
|
14716
14847
|
message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14717
14848
|
})));
|
|
14718
14849
|
});
|
|
14719
14850
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14720
|
-
const RULE$
|
|
14851
|
+
const RULE$47 = "worker-bundle";
|
|
14721
14852
|
const BUNDLE_CONCURRENCY = 4;
|
|
14722
14853
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14723
14854
|
const CONDITIONS = [
|
|
@@ -14728,7 +14859,7 @@ const CONDITIONS = [
|
|
|
14728
14859
|
"module",
|
|
14729
14860
|
"default"
|
|
14730
14861
|
];
|
|
14731
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14862
|
+
const problemFor$2 = problemInFile(RULE$47);
|
|
14732
14863
|
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14733
14864
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14734
14865
|
const built = yield* Effect.tryPromise({
|
|
@@ -14763,6 +14894,20 @@ const OFF = [
|
|
|
14763
14894
|
"allow",
|
|
14764
14895
|
0
|
|
14765
14896
|
];
|
|
14897
|
+
const taggedError$10 = Schema.TaggedError;
|
|
14898
|
+
/** @internal */
|
|
14899
|
+
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
14900
|
+
file: Schema.String,
|
|
14901
|
+
reason: Schema.String
|
|
14902
|
+
}) {};
|
|
14903
|
+
/** @internal */
|
|
14904
|
+
const resolvedConfig = (file) => Effect.sync(forgetBuilt).pipe(Effect.andThen(Effect.tryPromise({
|
|
14905
|
+
try: () => resolveConfigFromFile(file),
|
|
14906
|
+
catch: (error) => DisabledRulesConfigUnreadable.make({
|
|
14907
|
+
file,
|
|
14908
|
+
reason: String(error)
|
|
14909
|
+
})
|
|
14910
|
+
})));
|
|
14766
14911
|
const PrintedConfig = Schema.fromJsonString(Schema.Struct({ rules: Schema.Record(Schema.String, Schema.Unknown) }));
|
|
14767
14912
|
const isList$1 = (value) => Array$1.isArray(value);
|
|
14768
14913
|
const severityOf$1 = (value) => pipe(Option.some(value), Option.filter(isList$1), Option.flatMap(Array$1.head), Option.getOrElse(() => value));
|
|
@@ -14784,87 +14929,116 @@ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root
|
|
|
14784
14929
|
const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
|
|
14785
14930
|
return {
|
|
14786
14931
|
enabledRules: yield* enabledRulesIn(root),
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
builtRuleNames: builtTextRuleNames
|
|
14790
|
-
},
|
|
14791
|
-
markdown: {
|
|
14792
|
-
ignores: MARKDOWN_IGNORES,
|
|
14793
|
-
rules: MARKDOWN_RULES
|
|
14794
|
-
},
|
|
14795
|
-
tasks: MSCH_TASK_COMMANDS,
|
|
14796
|
-
verifyTasks: Record.keys(MSCH_VERIFY_COMMANDS),
|
|
14797
|
-
ciTasks: CI_TASKS,
|
|
14798
|
-
secrets: secretsOf(),
|
|
14799
|
-
fixed: {
|
|
14800
|
-
commitlint: COMMIT_LINT,
|
|
14801
|
-
fu4: fu4Of(),
|
|
14802
|
-
staged: STAGED$1,
|
|
14803
|
-
fmt: FORMAT
|
|
14804
|
-
},
|
|
14805
|
-
gitHooks: GIT_HOOKS
|
|
14932
|
+
gitHooks: GIT_HOOKS,
|
|
14933
|
+
built: lastBuilt()
|
|
14806
14934
|
};
|
|
14807
14935
|
});
|
|
14808
14936
|
// src/app/config-sections.ts
|
|
14809
14937
|
const isList = (value) => Array$1.isArray(value);
|
|
14810
14938
|
const isSection = (value) => Predicate$1.isObject(value) && !Array$1.isArray(value);
|
|
14811
|
-
const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
|
|
14812
|
-
const listOf$
|
|
14813
|
-
// src/app/
|
|
14814
|
-
const
|
|
14815
|
-
|
|
14816
|
-
const commitlint = sectionOf(value);
|
|
14817
|
-
const rules = Struct.omit(sectionOf(commitlint["rules"]), [SUBJECT_SCRIPT]);
|
|
14818
|
-
if (Record.isEmptyRecord(rules)) return Struct.omit(commitlint, ["rules"]);
|
|
14819
|
-
return {
|
|
14820
|
-
...commitlint,
|
|
14821
|
-
rules
|
|
14822
|
-
};
|
|
14823
|
-
};
|
|
14824
|
-
const fixedWeakenings = (config, expected) => pipe(Record.toEntries(expected.fixed), Array$1.filter(([section, built]) => !Equal.equals(withoutOptedRules(section, config[section]), built)), Array$1.map(([section]) => ({
|
|
14825
|
-
anchor: section,
|
|
14826
|
-
message: `${section} differs from what repositoryConfig builds, so msch's ${section} settings do not apply. Leave the ${section} section as repositoryConfig builds it.`
|
|
14827
|
-
})));
|
|
14828
|
-
const builtSections = [
|
|
14829
|
-
"wism",
|
|
14939
|
+
const sectionOf$1 = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
|
|
14940
|
+
const listOf$3 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
|
|
14941
|
+
// src/app/built-weakenings.ts
|
|
14942
|
+
const WHOLE_SECTIONS = [
|
|
14943
|
+
"commitlint",
|
|
14830
14944
|
"dependencyRules",
|
|
14831
|
-
"
|
|
14945
|
+
"h56m",
|
|
14946
|
+
"wism",
|
|
14947
|
+
"textlint",
|
|
14948
|
+
"y8",
|
|
14949
|
+
"fu4",
|
|
14950
|
+
"staged",
|
|
14951
|
+
"fmt",
|
|
14952
|
+
"lint"
|
|
14832
14953
|
];
|
|
14833
|
-
const
|
|
14954
|
+
const NOT_BUILT = {
|
|
14834
14955
|
anchor: "defineConfig",
|
|
14835
|
-
message:
|
|
14956
|
+
message: "vite.config.ts does not call repositoryConfig from @r_masseater/msch/config, so msch cannot tell which of its settings the repository left out or changed. Spread repositoryConfig into defineConfig."
|
|
14957
|
+
};
|
|
14958
|
+
const withoutPlugins$1 = (project) => pipe(Option.some(project), Option.filter(Predicate$1.isObject), Option.map((found) => Struct.omit(sectionOf$1(found), ["plugins"])), Option.getOrElse(() => project));
|
|
14959
|
+
const IMPLEMENTED_PLUGINS = /* @__PURE__ */ new Set(["wism"]);
|
|
14960
|
+
const comparable = (section, value) => pipe(Option.some(value), Option.filter(() => IMPLEMENTED_PLUGINS.has(section)), Option.map(withoutPlugins$1), Option.getOrElse(() => value));
|
|
14961
|
+
const wholeWeakenings = (config, built) => pipe(WHOLE_SECTIONS, Array$1.filter((section) => {
|
|
14962
|
+
const expected = comparable(section, built[section]);
|
|
14963
|
+
return !Equal.equals(comparable(section, config[section]), expected);
|
|
14964
|
+
}), Array$1.map((section) => ({
|
|
14965
|
+
anchor: section,
|
|
14966
|
+
message: `${section} differs from what repositoryConfig builds from the options vite.config.ts gives it, so msch's ${section} settings do not all apply. Pass the change through repositoryConfig's options, or change msch.`
|
|
14836
14967
|
})));
|
|
14968
|
+
const testNameOf = (project) => {
|
|
14969
|
+
const test = sectionOf$1(sectionOf$1(project)["test"]);
|
|
14970
|
+
return pipe(Option.some(test["name"]), Option.filter(Predicate$1.isString));
|
|
14971
|
+
};
|
|
14972
|
+
const projectName = (project) => pipe(Option.some(project), Option.filter(Predicate$1.isString), Option.orElse(() => testNameOf(project)), Option.getOrElse(() => "a project"));
|
|
14973
|
+
const testWeakenings = (config, built) => {
|
|
14974
|
+
const test = sectionOf$1(config.test);
|
|
14975
|
+
const builtTest = sectionOf$1(built.test);
|
|
14976
|
+
const projects = pipe(listOf$3(test["projects"]), Array$1.map(withoutPlugins$1));
|
|
14977
|
+
return [...pipe(listOf$3(builtTest["projects"]), Array$1.filter((project) => {
|
|
14978
|
+
const expected = withoutPlugins$1(project);
|
|
14979
|
+
return !pipe(projects, Array$1.some(Equal.equals(expected)));
|
|
14980
|
+
}), Array$1.map((project) => ({
|
|
14981
|
+
anchor: "test",
|
|
14982
|
+
message: `test.projects leaves out ${projectName(project)}, which repositoryConfig builds from the workspaces, so its tests never run. Keep every project repositoryConfig builds and add others after them.`
|
|
14983
|
+
}))), ...Array$1.filter([{
|
|
14984
|
+
anchor: "passWithNoTests",
|
|
14985
|
+
message: "test.passWithNoTests differs from what repositoryConfig builds. Leave it as repositoryConfig builds it."
|
|
14986
|
+
}], () => !Equal.equals(test["passWithNoTests"], builtTest["passWithNoTests"]))];
|
|
14987
|
+
};
|
|
14988
|
+
const cacheOf = (task) => pipe(Option.some(task["cache"]), Option.filter(Predicate$1.isObject), Option.map((cache) => Struct.omit(sectionOf$1(cache), ["untrackedEnv"])), Option.getOrElse(() => task["cache"]));
|
|
14989
|
+
const taskWeakenings = (tasks) => ([name, builtTask]) => {
|
|
14990
|
+
const task = sectionOf$1(tasks[name]);
|
|
14991
|
+
const expected = sectionOf$1(builtTask);
|
|
14992
|
+
const dependsOn = listOf$3(task["dependsOn"]);
|
|
14993
|
+
const changed = [
|
|
14994
|
+
...Array$1.filter(["command"], () => !Equal.equals(task["command"], expected["command"])),
|
|
14995
|
+
...Array$1.filter(["cache"], () => !Equal.equals(cacheOf(task), cacheOf(expected))),
|
|
14996
|
+
...Array$1.filter(["dependsOn"], () => Array$1.some(listOf$3(expected["dependsOn"]), (needed) => !Array$1.contains(dependsOn, needed)))
|
|
14997
|
+
];
|
|
14998
|
+
return pipe(changed, Array$1.map((part) => ({
|
|
14999
|
+
anchor: name,
|
|
15000
|
+
message: `The ${part} of the ${name} task differs from what repositoryConfig builds, so the task does not do or cache what msch set. Leave the task as repositoryConfig builds it; add work under another task name, or pass it in run.tasks.`
|
|
15001
|
+
})));
|
|
15002
|
+
};
|
|
15003
|
+
const runWeakenings = (config, built) => {
|
|
15004
|
+
const run = sectionOf$1(config.run);
|
|
15005
|
+
const builtRun = sectionOf$1(built.run);
|
|
15006
|
+
const builtTasks = Record.toEntries(sectionOf$1(builtRun["tasks"]));
|
|
15007
|
+
const tasks = sectionOf$1(run["tasks"]);
|
|
15008
|
+
return [...Array$1.filter([{
|
|
15009
|
+
anchor: "run",
|
|
15010
|
+
message: "run.cache differs from what repositoryConfig builds, so tasks do not cache or share their results as msch set. Pass the remote cache through run.remoteCache of repositoryConfig."
|
|
15011
|
+
}], () => !Equal.equals(run["cache"], builtRun["cache"])), ...pipe(builtTasks, Array$1.flatMap(taskWeakenings(tasks)))];
|
|
15012
|
+
};
|
|
15013
|
+
/** @internal */
|
|
15014
|
+
const builtWeakenings = (built) => (config) => Option.match(built, {
|
|
15015
|
+
onNone: () => [NOT_BUILT],
|
|
15016
|
+
onSome: (made) => [
|
|
15017
|
+
...wholeWeakenings(config, made),
|
|
15018
|
+
...testWeakenings(config, made),
|
|
15019
|
+
...runWeakenings(config, made)
|
|
15020
|
+
]
|
|
15021
|
+
});
|
|
15022
|
+
// src/app/section-weakenings.ts
|
|
14837
15023
|
const RUN_PREFIX = "vp run ";
|
|
14838
15024
|
const tasksRunBy = (tasks) => (command) => {
|
|
14839
15025
|
const named = String$1.slice(7)(command);
|
|
14840
|
-
const dependsOn = listOf$
|
|
15026
|
+
const dependsOn = listOf$3(sectionOf$1(tasks[named])["dependsOn"]);
|
|
14841
15027
|
return [named, ...pipe(dependsOn, Array$1.filter(Predicate$1.isString))];
|
|
14842
15028
|
};
|
|
14843
15029
|
const runCommandOf = (command) => pipe(String$1.lastIndexOf(RUN_PREFIX)(command), Option.map((index) => String$1.slice(index)(command)));
|
|
14844
15030
|
const covers = (tasks) => (built) => (command) => Predicate$1.isString(command) && (String$1.endsWith(built)(command) || String$1.startsWith(RUN_PREFIX)(built) && pipe(runCommandOf(command), Option.exists((run) => Array$1.contains(tasksRunBy(tasks)(run), String$1.slice(7)(built)))));
|
|
14845
15031
|
const hookWeakenings = (config, expected) => {
|
|
14846
|
-
const hooks = sectionOf(config.gitHooks);
|
|
14847
|
-
const tasks = sectionOf(sectionOf(config.run)["tasks"]);
|
|
14848
|
-
return pipe(Record.toEntries(expected.gitHooks), Array$1.flatMap(([hook, commands]) => pipe(commands, Array$1.filter((built) => !Array$1.some(listOf$
|
|
15032
|
+
const hooks = sectionOf$1(config.gitHooks);
|
|
15033
|
+
const tasks = sectionOf$1(sectionOf$1(config.run)["tasks"]);
|
|
15034
|
+
return pipe(Record.toEntries(expected.gitHooks), Array$1.flatMap(([hook, commands]) => pipe(commands, Array$1.filter((built) => !Array$1.some(listOf$3(hooks[hook]), covers(tasks)(built))), Array$1.map((built) => ({
|
|
14849
15035
|
anchor: "gitHooks",
|
|
14850
15036
|
message: `The ${hook} hook does not run \`${built}\`, which msch puts there. Add commands to a hook or wrap them, but keep the ones repositoryConfig builds.`
|
|
14851
15037
|
})))));
|
|
14852
15038
|
};
|
|
14853
15039
|
/** @internal */
|
|
14854
|
-
const sectionWeakenings = (config, expected) => [
|
|
14855
|
-
...fixedWeakenings(config, expected),
|
|
14856
|
-
...missingSections(config),
|
|
14857
|
-
...hookWeakenings(config, expected)
|
|
14858
|
-
];
|
|
15040
|
+
const sectionWeakenings = (config, expected) => [...hookWeakenings(config, expected)];
|
|
14859
15041
|
// src/app/config-weakenings.ts
|
|
14860
|
-
const PRESET_KEYS = [
|
|
14861
|
-
"categories",
|
|
14862
|
-
"plugins",
|
|
14863
|
-
"jsPlugins",
|
|
14864
|
-
"rules",
|
|
14865
|
-
"options",
|
|
14866
|
-
"settings"
|
|
14867
|
-
];
|
|
14868
15042
|
const ENABLED = ["error", "deny"];
|
|
14869
15043
|
const SEVERITY_ONLY = 1;
|
|
14870
15044
|
const MSCH_RELAXATIONS = [
|
|
@@ -14872,20 +15046,9 @@ const MSCH_RELAXATIONS = [
|
|
|
14872
15046
|
{ "import/no-default-export": "off" },
|
|
14873
15047
|
decisionTestRules
|
|
14874
15048
|
];
|
|
14875
|
-
const severityOf = (value) => pipe(listOf$
|
|
14876
|
-
const hasOptions = (value) => Array$1.length(listOf$
|
|
15049
|
+
const severityOf = (value) => pipe(listOf$3(value), Array$1.head, Option.getOrElse(() => value));
|
|
15050
|
+
const hasOptions = (value) => Array$1.length(listOf$3(value)) > SEVERITY_ONLY;
|
|
14877
15051
|
const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
|
|
14878
|
-
const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
|
|
14879
|
-
onNone: () => [{
|
|
14880
|
-
anchor: "defineConfig",
|
|
14881
|
-
message: `vite.config.ts has no ${what}. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
|
|
14882
|
-
}],
|
|
14883
|
-
onSome: (present) => weakeningsIn(sectionOf(present))
|
|
14884
|
-
});
|
|
14885
|
-
const presetDifferences = (lint) => pipe(PRESET_KEYS, Array$1.filter((key) => !Equal.equals(lint[key], lint$3[key])), Array$1.map((key) => ({
|
|
14886
|
-
anchor: "lint",
|
|
14887
|
-
message: `lint.${key} differs from the msch preset. Leave the lint section as repositoryConfig builds it; to add a rule, pass it in overrides or a workspace's msch.lint.overrides.`
|
|
14888
|
-
})));
|
|
14889
15052
|
const isPresetOverride = (override) => pipe(lint$3.overrides, Array$1.some((built) => Equal.equals(built, override)));
|
|
14890
15053
|
const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
|
|
14891
15054
|
const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
|
|
@@ -14896,96 +15059,60 @@ const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.co
|
|
|
14896
15059
|
message: `An override changes the options of ${name}, which the msch preset already sets. Options of preset rules are not changed per file: fix what the rule reports, or change the rule in msch.`
|
|
14897
15060
|
})];
|
|
14898
15061
|
const overrideWeakenings = (enabledRules) => (override) => {
|
|
14899
|
-
const section = sectionOf(override);
|
|
15062
|
+
const section = sectionOf$1(override);
|
|
14900
15063
|
const builtByMsch = isPresetOverride(override) || isMschRelaxation(section);
|
|
14901
|
-
return pipe(Record.toEntries(sectionOf(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
|
|
14902
|
-
};
|
|
14903
|
-
const lintWeakenings = (enabledRules) =>
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
|
|
14912
|
-
const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
|
|
14913
|
-
anchor: "textlint",
|
|
14914
|
-
message: `${owner} does not run ${name}, which msch sets. Leave the textlint section as repositoryConfig builds it.`
|
|
14915
|
-
}))), ...pipe(Record.toEntries(rules), Array$1.filter(([, value]) => isOff(value)), Array$1.map(([name]) => ({
|
|
14916
|
-
anchor: name,
|
|
14917
|
-
message: `${owner} turns off ${name} or one of its rules. Rules are not turned off in a repository that uses msch: rewrite the text, or fix the rule in msch.`
|
|
14918
|
-
})))];
|
|
14919
|
-
const checkedBySources = (section) => pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => listOf$2(sectionOf(source)["files"])));
|
|
14920
|
-
const ignoredOutsideSources = (section) => {
|
|
14921
|
-
const checked = checkedBySources(section);
|
|
14922
|
-
return pipe(listOf$2(section["ignores"]), Array$1.filter((ignored) => !Array$1.contains(checked, ignored)));
|
|
14923
|
-
};
|
|
14924
|
-
const textWeakenings = (expected) => whenPresent("textlint section, so the Japanese text checks do not run", (section) => [
|
|
14925
|
-
...unless(Equal.equals(ignoredOutsideSources(section), expected.ignores), {
|
|
14926
|
-
anchor: "ignores",
|
|
14927
|
-
message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
|
|
14928
|
-
}),
|
|
14929
|
-
...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
|
|
14930
|
-
...pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
|
|
14931
|
-
]);
|
|
14932
|
-
const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
|
|
14933
|
-
anchor: "ignores",
|
|
14934
|
-
message: "y8.ignores differs from the files msch exempts. Files are not taken out of the Markdown checks in a repository that uses msch."
|
|
14935
|
-
}), ...unless(Equal.equals(section["rules"], expected.rules), {
|
|
14936
|
-
anchor: "y8",
|
|
14937
|
-
message: "y8.rules differs from what markdownOf builds. Markdown rules are not turned off or changed in a repository that uses msch."
|
|
14938
|
-
})]);
|
|
14939
|
-
const missingDependencies$1 = (tasks, task) => (names) => {
|
|
14940
|
-
const dependsOn = listOf$2(sectionOf(tasks[task])["dependsOn"]);
|
|
14941
|
-
return pipe(names, Array$1.filter((name) => !Array$1.contains(dependsOn, name)), Array$1.map((name) => ({
|
|
14942
|
-
anchor: task,
|
|
14943
|
-
message: `${task} does not run the ${name} task. Leave ${task} as repositoryConfig builds it.`
|
|
14944
|
-
})));
|
|
14945
|
-
};
|
|
14946
|
-
const taskWeakenings = (run, expected) => {
|
|
14947
|
-
const tasks = sectionOf(sectionOf(run)["tasks"]);
|
|
14948
|
-
const dependsOn = listOf$2(sectionOf(tasks[TASK_NAMES.verify])["dependsOn"]);
|
|
14949
|
-
return [
|
|
14950
|
-
...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => {
|
|
14951
|
-
const actual = sectionOf(tasks[name])["command"];
|
|
14952
|
-
return !Equal.equals(actual, command) && !(Predicate$1.isString(command) && Equal.equals(actual, meteredCommand(command)));
|
|
14953
|
-
}), Array$1.map(([name]) => ({
|
|
14954
|
-
anchor: "run",
|
|
14955
|
-
message: `The ${name} task does not run what msch builds for it. Leave msch's tasks as repositoryConfig builds them; add other work under another task name.`
|
|
14956
|
-
}))),
|
|
14957
|
-
...missingDependencies$1(tasks, TASK_NAMES.verify)(expected.verifyTasks),
|
|
14958
|
-
...unless(!Array$1.contains(dependsOn, TASK_NAMES.test), {
|
|
14959
|
-
anchor: TASK_NAMES.verify,
|
|
14960
|
-
message: "verify runs the test task. Tests run in CI through the ci task, so verify, which the pre-push hook runs, leaves them out."
|
|
14961
|
-
}),
|
|
14962
|
-
...missingDependencies$1(tasks, "ci")(expected.ciTasks)
|
|
14963
|
-
];
|
|
15064
|
+
return pipe(Record.toEntries(sectionOf$1(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
|
|
15065
|
+
};
|
|
15066
|
+
const lintWeakenings = (enabledRules, lint) => pipe(listOf$3(sectionOf$1(lint)["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)));
|
|
15067
|
+
const testInVerify = (run) => {
|
|
15068
|
+
const tasks = sectionOf$1(sectionOf$1(run)["tasks"]);
|
|
15069
|
+
const dependsOn = listOf$3(sectionOf$1(tasks[TASK_NAMES.verify])["dependsOn"]);
|
|
15070
|
+
return unless(!Array$1.contains(dependsOn, TASK_NAMES.test), {
|
|
15071
|
+
anchor: TASK_NAMES.verify,
|
|
15072
|
+
message: "verify runs the test task. Tests run in CI through the ci task, so verify, which the pre-push hook runs, leaves them out."
|
|
15073
|
+
});
|
|
14964
15074
|
};
|
|
14965
|
-
const secretWeakenings = (h56m, expected) => unless(Equal.equals(h56m, expected), {
|
|
14966
|
-
anchor: "h56m",
|
|
14967
|
-
message: "h56m differs from what secretsOf builds. Findings and files are not taken out of the secret scan in a repository that uses msch: remove the value, or fix the scan in msch when the value is public."
|
|
14968
|
-
});
|
|
14969
15075
|
/** @internal */
|
|
14970
15076
|
const weakeningsOf = (expected) => (config) => [
|
|
14971
|
-
...lintWeakenings(expected.enabledRules
|
|
14972
|
-
...
|
|
14973
|
-
...
|
|
14974
|
-
...
|
|
14975
|
-
...secretWeakenings(config.h56m, expected.secrets),
|
|
14976
|
-
...sectionWeakenings(config, expected)
|
|
15077
|
+
...lintWeakenings(expected.enabledRules, config.lint),
|
|
15078
|
+
...testInVerify(config.run),
|
|
15079
|
+
...sectionWeakenings(config, expected),
|
|
15080
|
+
...builtWeakenings(expected.built)(config)
|
|
14977
15081
|
];
|
|
15082
|
+
// src/app/unused-proper-nouns.ts
|
|
15083
|
+
const RULE$46 = "unused-proper-noun";
|
|
15084
|
+
const MARKDOWN$6 = "**/*.md";
|
|
15085
|
+
const START$26 = 0;
|
|
15086
|
+
const READ_CONCURRENCY$19 = 16;
|
|
15087
|
+
const properNounsOf = (textlint) => {
|
|
15088
|
+
const filters = sectionOf$1(sectionOf$1(textlint)["filters"]);
|
|
15089
|
+
const allowlist = sectionOf$1(filters["allowlist"]);
|
|
15090
|
+
return pipe(listOf$3(allowlist["allow"]), Array$1.filter(Predicate$1.isString), Array$1.filter((entry) => !Array$1.contains(BUILT_ALLOWANCES, entry)));
|
|
15091
|
+
};
|
|
15092
|
+
const checkedFiles = (textlint, listed) => {
|
|
15093
|
+
const section = sectionOf$1(textlint);
|
|
15094
|
+
const ignored = matcher(pipe(listOf$3(section["ignores"]), Array$1.filter(Predicate$1.isString)));
|
|
15095
|
+
const markdown = matcher([MARKDOWN$6]);
|
|
15096
|
+
const sources = matcher(pipe(listOf$3(section["sources"]), Array$1.flatMap((source) => listOf$3(sectionOf$1(source)["files"])), Array$1.filter(Predicate$1.isString)));
|
|
15097
|
+
return pipe(listed, Array$1.filter((name) => markdown(name) && !ignored(name) || sources(name)));
|
|
15098
|
+
};
|
|
15099
|
+
/** @internal */
|
|
15100
|
+
const unusedProperNouns = Effect.fn("unusedProperNouns")(function* unusedProperNouns({ root, file, source, config }) {
|
|
15101
|
+
const nouns = properNounsOf(config.textlint);
|
|
15102
|
+
if (Array$1.isReadonlyArrayEmpty(nouns)) return [];
|
|
15103
|
+
const files = yield* RepositoryFiles;
|
|
15104
|
+
const listed = yield* files.listedFiles(root);
|
|
15105
|
+
const texts = yield* Effect.forEach(checkedFiles(config.textlint, listed), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$19 });
|
|
15106
|
+
const found = Array$1.getSomes(texts);
|
|
15107
|
+
const at = problemAtIndex(RULE$46)(file, source);
|
|
15108
|
+
return pipe(nouns, Array$1.filter((noun) => !pipe(found, Array$1.some(String$1.includes(noun)))), Array$1.map((noun) => at(pipe(source, String$1.indexOf(`"${noun}"`), Option.getOrElse(() => START$26)), `The proper noun "${noun}" is in textlint.properNouns, but no text the Japanese checks read contains it, so it lets nothing through. Remove it.`)));
|
|
15109
|
+
});
|
|
14978
15110
|
// src/app/disabled-rules.ts
|
|
14979
15111
|
const RULE$45 = "disabled-rule";
|
|
14980
15112
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14981
15113
|
const START$25 = 0;
|
|
14982
15114
|
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;
|
|
14983
15115
|
const SIDE_CONFIG_MESSAGE = "This file configures a check outside vite.config.ts, where msch cannot see whether it turns rules off. Delete it; msch builds every check setting in vite.config.ts.";
|
|
14984
|
-
const taggedError$10 = Schema.TaggedError;
|
|
14985
|
-
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
14986
|
-
file: Schema.String,
|
|
14987
|
-
reason: Schema.String
|
|
14988
|
-
}) {};
|
|
14989
15116
|
const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
14990
15117
|
const files = yield* RepositoryFiles;
|
|
14991
15118
|
const listed = yield* files.listedFiles(root);
|
|
@@ -14994,16 +15121,16 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14994
15121
|
});
|
|
14995
15122
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14996
15123
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
14997
|
-
const config = yield*
|
|
14998
|
-
try: () => resolveConfigFromFile(file),
|
|
14999
|
-
catch: (error) => DisabledRulesConfigUnreadable.make({
|
|
15000
|
-
file,
|
|
15001
|
-
reason: String(error)
|
|
15002
|
-
})
|
|
15003
|
-
});
|
|
15124
|
+
const config = yield* resolvedConfig(file);
|
|
15004
15125
|
const expected = yield* expectationsIn(root);
|
|
15005
15126
|
const at = problemAtIndex(RULE$45)(file, source);
|
|
15006
|
-
|
|
15127
|
+
const unused = yield* unusedProperNouns({
|
|
15128
|
+
root,
|
|
15129
|
+
file,
|
|
15130
|
+
source,
|
|
15131
|
+
config
|
|
15132
|
+
});
|
|
15133
|
+
return [...pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message))), ...unused];
|
|
15007
15134
|
});
|
|
15008
15135
|
/** @internal */
|
|
15009
15136
|
const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
|
|
@@ -16058,7 +16185,7 @@ const SettingsSchema$1 = Schema.Struct({
|
|
|
16058
16185
|
extraKnownMarketplaces: Schema.optionalKey(Marketplaces),
|
|
16059
16186
|
enabledPlugins: Schema.optionalKey(Plugins$1)
|
|
16060
16187
|
});
|
|
16061
|
-
const decodeSettings$
|
|
16188
|
+
const decodeSettings$3 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
|
|
16062
16189
|
const MarketplaceSchema = Schema.Struct({
|
|
16063
16190
|
name: Schema.String,
|
|
16064
16191
|
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
@@ -16078,7 +16205,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
16078
16205
|
const manifest = yield* files.readFile(files.join(root, MARKETPLACE_FILE$2));
|
|
16079
16206
|
const file = files.join(root, SETTINGS_FILE$3);
|
|
16080
16207
|
const text = yield* files.readFile(file);
|
|
16081
|
-
const settings = pipe(text, Option.flatMap(decodeSettings$
|
|
16208
|
+
const settings = pipe(text, Option.flatMap(decodeSettings$3), Option.getOrElse(() => ({})));
|
|
16082
16209
|
const marketplace = pipe(manifest, Option.flatMap(decodeMarketplace));
|
|
16083
16210
|
return pipe(Option.all({
|
|
16084
16211
|
origin,
|
|
@@ -16153,9 +16280,9 @@ const EXTENSION_DIRECTORIES = [
|
|
|
16153
16280
|
".claude/output-styles/"
|
|
16154
16281
|
];
|
|
16155
16282
|
const REASON$3 = "A Claude Code hook, skill, agent, command, rule or output style kept in one repository is copied into the next repository that needs it, and the copies drift apart. Put it in a plugin, enable the plugin in .claude/settings.json, and keep only the settings and the SessionStart environment setup in the repository.";
|
|
16156
|
-
const Settings = Schema.Struct({ hooks: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
16157
|
-
const decodeSettings$
|
|
16158
|
-
const hookProblems = (file, source) => pipe(decodeSettings$
|
|
16283
|
+
const Settings$1 = Schema.Struct({ hooks: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
16284
|
+
const decodeSettings$2 = Schema.decodeUnknownOption(Schema.fromJsonString(Settings$1));
|
|
16285
|
+
const hookProblems = (file, source) => pipe(decodeSettings$2(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.filter((event) => event !== SETUP_EVENT), Array$1.map((event) => {
|
|
16159
16286
|
const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
|
|
16160
16287
|
return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
|
|
16161
16288
|
onNone: () => problemInFile(RULE$39)(file, message),
|
|
@@ -16430,14 +16557,14 @@ const HookSchema = Schema.Struct({
|
|
|
16430
16557
|
const MatcherSchema = Schema.Struct({ hooks: Schema.Array(HookSchema) });
|
|
16431
16558
|
const HooksSchema = Schema.Struct({ SessionStart: MatcherSchema.pipe(Schema.Array, Schema.optional) });
|
|
16432
16559
|
const SettingsSchema = Schema.Struct({ hooks: Schema.optional(HooksSchema) });
|
|
16433
|
-
const decodeSettings = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
|
|
16560
|
+
const decodeSettings$1 = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
|
|
16434
16561
|
const PluginHooksSchema = Schema.Struct({ hooks: Schema.Record(Schema.String, Schema.Array(MatcherSchema)) });
|
|
16435
16562
|
const decodePluginHooks = Schema.decodeOption(Schema.fromJsonString(PluginHooksSchema));
|
|
16436
16563
|
const NO_TEXT = [];
|
|
16437
16564
|
const commandText = ({ command, args }) => [...Option.toArray(Option.fromUndefinedOr(command)), ...pipe(Option.fromUndefinedOr(args), Option.getOrElse(() => NO_TEXT))];
|
|
16438
16565
|
const matcherText = ({ hooks }) => pipe(hooks, Array$1.flatMap((hook) => commandText(hook)));
|
|
16439
16566
|
const sessionStartCommands = (source) => {
|
|
16440
|
-
const matchers = pipe(decodeSettings(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
|
|
16567
|
+
const matchers = pipe(decodeSettings$1(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
|
|
16441
16568
|
return pipe(matchers, Option.map(Array$1.flatMap((matcher) => matcherText(matcher))), Option.getOrElse(() => NO_TEXT));
|
|
16442
16569
|
};
|
|
16443
16570
|
const pluginRootOf = (hooksFile) => String$1.replace(PLUGIN_HOOKS, "")(hooksFile);
|
|
@@ -17645,6 +17772,19 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
|
|
|
17645
17772
|
const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
17646
17773
|
const CAP_RULE = "renovate-version-cap";
|
|
17647
17774
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17775
|
+
const OVERRIDE_RULE = "renovate-preset-override";
|
|
17776
|
+
const PACKAGE_RULES = "packageRules";
|
|
17777
|
+
const OPEN_KEYS = [
|
|
17778
|
+
"$schema",
|
|
17779
|
+
"description",
|
|
17780
|
+
"extends",
|
|
17781
|
+
PACKAGE_RULES
|
|
17782
|
+
];
|
|
17783
|
+
const REPOSITORY_CHOICES = [
|
|
17784
|
+
"automerge",
|
|
17785
|
+
"enabled",
|
|
17786
|
+
"allowedVersions"
|
|
17787
|
+
];
|
|
17648
17788
|
const ADOPTER = "@r_masseater/vite-plus-adopt";
|
|
17649
17789
|
const DEFAULT_FILE = "renovate.json";
|
|
17650
17790
|
const START$16 = 0;
|
|
@@ -17654,6 +17794,32 @@ const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A
|
|
|
17654
17794
|
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
17655
17795
|
const MISSING_MESSAGE = `is missing, so Renovate does not run msch's preset \`${RENOVATE_PRESET}\` and dependencies stay on old versions. Add a Renovate config that extends it.`;
|
|
17656
17796
|
const adopterMessage = (preset) => `does not extend \`${preset}\` after \`${RENOVATE_PRESET}\`, so Renovate never updates the commits and versions in the skills and tools sections of vite.config.ts, and the package groups it waits for go out apart. Add it to \`extends\` after msch's preset.`;
|
|
17797
|
+
const Settings = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown));
|
|
17798
|
+
const decodeSettings = Schema.decodeUnknownOption(Settings);
|
|
17799
|
+
const sectionOf = (value) => pipe(Option.some(value), Option.filter(Predicate$1.isReadonlyObject), Option.filter((found) => !Array$1.isArray(found)), Option.getOrElse(() => ({})));
|
|
17800
|
+
const listOf$2 = (value) => pipe(Option.some(value), Option.filter((found) => Array$1.isArray(found)), Option.getOrElse(() => []));
|
|
17801
|
+
const isSetting = (key) => !Array$1.contains(OPEN_KEYS, key) && !Array$1.contains(REPOSITORY_CHOICES, key) && !String$1.startsWith("match")(key);
|
|
17802
|
+
const PRESET_RULES = pipe(listOf$2(RENOVATE_PRESET_SETTINGS[PACKAGE_RULES]), Array$1.map(sectionOf));
|
|
17803
|
+
const PRESET_KEYS = new Set(pipe([RENOVATE_PRESET_SETTINGS, ...PRESET_RULES], Array$1.flatMap(Record.keys), Array$1.filter(isSetting)));
|
|
17804
|
+
const setOver = (where) => (key) => ({
|
|
17805
|
+
key,
|
|
17806
|
+
message: `sets \`${key}\`${where}, which msch's preset \`${RENOVATE_PRESET}\` sets, so the preset's value no longer applies. Remove it, or change the preset in msch when its value is wrong.`
|
|
17807
|
+
});
|
|
17808
|
+
const overridesIn = (settings) => [
|
|
17809
|
+
...pipe(Record.keys(settings), Array$1.filter((key) => PRESET_KEYS.has(key)), Array$1.map(setOver(""))),
|
|
17810
|
+
...Array$1.filter([{
|
|
17811
|
+
key: "enabled",
|
|
17812
|
+
message: "sets `enabled: false`, so Renovate updates nothing and msch's preset never runs."
|
|
17813
|
+
}], () => settings["enabled"] === false),
|
|
17814
|
+
...Array$1.filter([{
|
|
17815
|
+
key: "ignorePresets",
|
|
17816
|
+
message: `lists \`${RENOVATE_PRESET}\` in \`ignorePresets\`, so Renovate does not apply msch's preset. Remove it.`
|
|
17817
|
+
}], () => Array$1.contains(listOf$2(settings["ignorePresets"]), RENOVATE_PRESET)),
|
|
17818
|
+
...pipe(listOf$2(settings[PACKAGE_RULES]), Array$1.map(sectionOf), Array$1.flatMap((rule) => [...pipe(Record.keys(rule), Array$1.filter((key) => PRESET_KEYS.has(key)), Array$1.map(setOver(" in a package rule"))), ...Array$1.filter([{
|
|
17819
|
+
key: "automerge",
|
|
17820
|
+
message: "sets `automerge: true` in a package rule, which can turn automerge back on for the msch group that msch's preset keeps out of automerge. Set automerge at the top level instead, where msch's package rules still apply after it."
|
|
17821
|
+
}], () => rule["automerge"] === true)]))
|
|
17822
|
+
];
|
|
17657
17823
|
const Presets = Schema.Unknown.pipe(Schema.Array, Schema.optional);
|
|
17658
17824
|
const Extends = Schema.fromJsonString(Schema.Struct({ extends: Presets }));
|
|
17659
17825
|
const decodeExtends = Schema.decodeUnknownOption(Extends);
|
|
@@ -17680,6 +17846,12 @@ const problemsIn$8 = (adopter) => (file, source) => {
|
|
|
17680
17846
|
message
|
|
17681
17847
|
})));
|
|
17682
17848
|
return [
|
|
17849
|
+
...pipe(decodeSettings(source), Option.map(overridesIn), Option.getOrElse(() => []), Array$1.map(({ key, message }) => ({
|
|
17850
|
+
file,
|
|
17851
|
+
...at(pipe(source, String$1.indexOf(`"${key}"`), Option.getOrElse(() => START$16))),
|
|
17852
|
+
rule: OVERRIDE_RULE,
|
|
17853
|
+
message
|
|
17854
|
+
}))),
|
|
17683
17855
|
...found(AUTOMERGE_OFF, AUTOMERGE_RULE, AUTOMERGE_MESSAGE),
|
|
17684
17856
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
17685
17857
|
...pipe(presetsMissing(source, adopter), Array$1.map((message) => ({
|
|
@@ -19954,7 +20126,7 @@ const NAME_GROUP = "name";
|
|
|
19954
20126
|
const SOURCE = /\.[cm]?tsx?$/u;
|
|
19955
20127
|
const DECLARED_COMMAND = /\bCommand\.make\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19956
20128
|
const DECLARED_FLAG = /\bFlag\.[A-Z]\w*\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19957
|
-
const
|
|
20129
|
+
const RUN_COMMANDS = [/\bCommand\.run\(\s*(?<name>[A-Za-z_$][\w$]*)/gu, /\b(?<name>[A-Za-z_$][\w$]*)\.pipe\(\s*Command\.run\(/gu];
|
|
19958
20130
|
const INSTALLED_SKILLS$1 = ".agents/skills";
|
|
19959
20131
|
const COMMAND_FILE = /^bin\/(?<name>[^/.]+)\.[cm]?ts$/u;
|
|
19960
20132
|
const SAFE_NAME = /^[a-z][a-z0-9-]*$/u;
|
|
@@ -19977,7 +20149,7 @@ const declaredIn = (pattern) => (source) => pipe(Array$1.fromIterable(String$1.m
|
|
|
19977
20149
|
index: found.index ?? START$3,
|
|
19978
20150
|
source
|
|
19979
20151
|
})), Option.toArray)));
|
|
19980
|
-
const runIn = (source) => pipe(Array$1.fromIterable(String$1.matchAll(
|
|
20152
|
+
const runIn = (source) => pipe(RUN_COMMANDS, Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source.text))), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19981
20153
|
const isRoot$1 = ({ index, source }) => pipe(runIn(source), Array$1.some((binding) => new RegExp(`\\b${binding}\\s*=\\s*$`, "u").test(String$1.slice(START$3, index)(source.text))));
|
|
19982
20154
|
const elsewhere = (corpus) => ({ source }) => pipe(corpus, Array$1.filter((text) => text.file !== source.file && !isTest(text)));
|
|
19983
20155
|
const passesFlag = (declared) => {
|