@r_masseater/msch 0.47.0 → 0.48.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/README.md +1 -0
- package/dist/changed.mjs +1 -1
- package/dist/check-upstream-exits-BJNhgkLI.mjs +499 -0
- package/dist/check-upstream-exits-BJNhgkLI.mjs.map +1 -0
- package/dist/cli-contract-D7btWrEu.mjs +5 -0
- package/dist/cli-contract-D7btWrEu.mjs.map +1 -0
- package/dist/cli.mjs +260 -284
- package/dist/cli.mjs.map +1 -1
- package/dist/{comment-directives-5-f_qs1E.mjs → comment-directives-CRAU6yNZ.mjs} +2 -1
- package/dist/comment-directives-CRAU6yNZ.mjs.map +1 -0
- package/dist/config.mjs +5 -1
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-CxzPzVuB.mjs → define-lint-preset-BhT4RpHs.mjs} +2 -2
- package/dist/{define-lint-preset-CxzPzVuB.mjs.map → define-lint-preset-BhT4RpHs.mjs.map} +1 -1
- package/dist/exits.d.mts +1 -0
- package/dist/exits.mjs +58 -0
- package/dist/exits.mjs.map +1 -0
- package/dist/lint.mjs +1 -1
- package/dist/oxlint.mjs +2 -1
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{cli-contract-BY7vwgKc.mjs → problem-u-p6QglA.mjs} +2 -4
- package/dist/problem-u-p6QglA.mjs.map +1 -0
- package/dist/publish.mjs +1 -1
- package/dist/{runtime-GbrDfB8K.mjs → runtime-BmlYnI7T.mjs} +2 -2
- package/dist/{runtime-GbrDfB8K.mjs.map → runtime-BmlYnI7T.mjs.map} +1 -1
- package/package.json +5 -4
- package/skills/msch-checks/SKILL.md +9 -0
- package/dist/cli-contract-BY7vwgKc.mjs.map +0 -1
- package/dist/comment-directives-5-f_qs1E.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as stringsIn, E as hasVerifyTask, F as childrenOf$
|
|
2
|
+
import { B as stringsIn, E as hasVerifyTask, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as definesTask, _ as publishedProjects, a as cratesIn, b as runTasksOf, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, w as VERIFY_TASK, y as workspaceManifest, z as propertyValue } from "./dependencies-v59cxwTD.mjs";
|
|
3
3
|
import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-DeQcAglt.mjs";
|
|
4
4
|
import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-aXwrITdF.mjs";
|
|
5
|
+
import { a as isRecord, c as isScannedText, d as presentFiles, f as scanText, i as collectNodes, l as isToolVersions, n as checkUpstreamExits, o as tomlSourceComments, p as positionOf, s as yamlSourceComments, t as checkScatteredDeviations, u as listedFiles } from "./check-upstream-exits-BJNhgkLI.mjs";
|
|
5
6
|
import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-Bdv6W97F.mjs";
|
|
6
|
-
import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-
|
|
7
|
+
import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CRAU6yNZ.mjs";
|
|
7
8
|
import { t as startedOnce } from "./started-once-CkTooI_o.mjs";
|
|
8
|
-
import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$
|
|
9
|
-
import { a as
|
|
10
|
-
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-
|
|
9
|
+
import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$2, tt as isTypeAliasDeclaration, u as isTypeDeclaration, x as SignatureKind, z as isImportDeclaration } from "./syntax-ct2fFLtv.mjs";
|
|
10
|
+
import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-u-p6QglA.mjs";
|
|
11
|
+
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-BmlYnI7T.mjs";
|
|
12
|
+
import "./cli-contract-D7btWrEu.mjs";
|
|
11
13
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
12
14
|
import { Array, Config, Effect, FileSystem, HashMap, HashSet, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
13
15
|
import { updateWorkspaceManifest } from "@pnpm/workspace.workspace-manifest-writer";
|
|
@@ -16,7 +18,7 @@ import { parse, resolveConfigFromFile } from "vite-plus";
|
|
|
16
18
|
import { parse as parse$1 } from "@pnpm/deps.path";
|
|
17
19
|
import { fileURLToPath } from "node:url";
|
|
18
20
|
import treeSitter from "@vscode/tree-sitter-wasm";
|
|
19
|
-
import {
|
|
21
|
+
import { isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
|
|
20
22
|
import semver from "semver";
|
|
21
23
|
import { diagnosticDetail, lint, markdownPathspecs, y8Section } from "@r_masseater/y8";
|
|
22
24
|
import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
|
|
@@ -78,19 +80,6 @@ const unlessPassed = Effect.fn("unlessPassed")(function* unlessPassed(root, inpu
|
|
|
78
80
|
if (Array.isReadonlyArrayEmpty(problems)) yield* keepOnly(records, [key]);
|
|
79
81
|
return problems;
|
|
80
82
|
});
|
|
81
|
-
// src/shared/lib/text-position.ts
|
|
82
|
-
const START$19 = 0;
|
|
83
|
-
const FIRST_COLUMN$4 = 1;
|
|
84
|
-
const positionOf = (source) => (index) => {
|
|
85
|
-
const before = pipe(source, String$1.slice(START$19, index), String$1.split("\n"));
|
|
86
|
-
return {
|
|
87
|
-
line: before.length,
|
|
88
|
-
column: pipe(Array.last(before), Option.match({
|
|
89
|
-
onNone: () => FIRST_COLUMN$4,
|
|
90
|
-
onSome: (last) => last.length + FIRST_COLUMN$4
|
|
91
|
-
}))
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
83
|
// src/features/check-overrides/model/override-resolution.ts
|
|
95
84
|
const VerdictSchema = Schema.Literals([
|
|
96
85
|
"unused",
|
|
@@ -356,88 +345,58 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
356
345
|
overrides
|
|
357
346
|
}, keys));
|
|
358
347
|
});
|
|
359
|
-
// src/shared/lib/scanned-files.ts
|
|
360
|
-
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;
|
|
361
|
-
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
362
|
-
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
363
|
-
const READ_CONCURRENCY$30 = 64;
|
|
364
|
-
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
365
|
-
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
366
|
-
/** @internal */
|
|
367
|
-
const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
|
|
368
|
-
const files = yield* RepositoryFiles;
|
|
369
|
-
const names = yield* files.ownedFiles(root);
|
|
370
|
-
return pipe(names, Array.map((name) => ({
|
|
371
|
-
name,
|
|
372
|
-
file: files.join(root, name)
|
|
373
|
-
})));
|
|
374
|
-
});
|
|
375
|
-
/** @internal */
|
|
376
|
-
const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
|
|
377
|
-
const files = yield* RepositoryFiles;
|
|
378
|
-
return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
|
|
379
|
-
});
|
|
380
|
-
/** @internal */
|
|
381
|
-
const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
|
|
382
|
-
const files = yield* RepositoryFiles;
|
|
383
|
-
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
384
|
-
onNone: () => [],
|
|
385
|
-
onSome: (source) => problemsIn(entry, source)
|
|
386
|
-
}))), { concurrency: READ_CONCURRENCY$30 });
|
|
387
|
-
return Array.flatten(found);
|
|
388
|
-
});
|
|
389
348
|
// src/features/check-overrides/model/git-subpath.ts
|
|
390
349
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
391
350
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
392
|
-
const RULE$
|
|
351
|
+
const RULE$50 = "git-subpath-dependency";
|
|
393
352
|
const WHOLE_MATCH$3 = 0;
|
|
394
353
|
const problemAt$8 = ({ file }, source) => (found) => ({
|
|
395
354
|
file,
|
|
396
355
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
397
|
-
rule: RULE$
|
|
356
|
+
rule: RULE$50,
|
|
398
357
|
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$3])}\`.`
|
|
399
358
|
});
|
|
400
|
-
const problemsIn$
|
|
359
|
+
const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
|
|
401
360
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
402
361
|
/** @internal */
|
|
403
362
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
404
363
|
const listed = yield* listedFiles(root);
|
|
405
|
-
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$
|
|
364
|
+
return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$17);
|
|
406
365
|
});
|
|
407
366
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
408
|
-
const RULE$
|
|
367
|
+
const RULE$49 = "unnamed-restriction";
|
|
409
368
|
const WHOLE_MATCH$2 = 0;
|
|
410
369
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
411
|
-
const problemsIn$
|
|
370
|
+
const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
|
|
412
371
|
file: entry.file,
|
|
413
372
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
414
|
-
rule: RULE$
|
|
373
|
+
rule: RULE$49,
|
|
415
374
|
message: `${found[WHOLE_MATCH$2]} 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.`
|
|
416
375
|
})));
|
|
417
376
|
/** @internal */
|
|
418
377
|
const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
|
|
419
378
|
const listed = yield* listedFiles(root);
|
|
420
|
-
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$
|
|
379
|
+
return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$16);
|
|
421
380
|
});
|
|
422
381
|
// src/features/check-overrides/model/package-registry.ts
|
|
423
|
-
const RULE$
|
|
382
|
+
const RULE$48 = "package-registry";
|
|
424
383
|
const REGISTRY = "https://npm.flatt.tech/";
|
|
425
384
|
const TRAILING_SLASH = /\/$/u;
|
|
426
385
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
427
386
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
428
387
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
429
388
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
430
|
-
const START$
|
|
389
|
+
const START$19 = 0;
|
|
431
390
|
const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
432
391
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
433
392
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
434
393
|
const withoutSlash = String$1.replace(TRAILING_SLASH, "");
|
|
435
394
|
const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
|
|
436
|
-
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
395
|
+
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$19));
|
|
437
396
|
const workspaceProblem = (file, source, registry) => ({
|
|
438
397
|
file,
|
|
439
398
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
440
|
-
rule: RULE$
|
|
399
|
+
rule: RULE$48,
|
|
441
400
|
message: Option.match(registry, {
|
|
442
401
|
onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
|
|
443
402
|
onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
|
|
@@ -445,9 +404,9 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
445
404
|
});
|
|
446
405
|
const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf$2("value")(found), isGuarded)), Array.map((found) => ({
|
|
447
406
|
file: entry.file,
|
|
448
|
-
...positionOf(source)(found.index ?? START$
|
|
449
|
-
rule: RULE$
|
|
450
|
-
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$
|
|
407
|
+
...positionOf(source)(found.index ?? START$19),
|
|
408
|
+
rule: RULE$48,
|
|
409
|
+
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$19])}\`. Remove the line.`
|
|
451
410
|
})));
|
|
452
411
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
453
412
|
const files = yield* RepositoryFiles;
|
|
@@ -466,7 +425,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
|
|
|
466
425
|
return [...yield* checkWorkspace(root), ...overrides];
|
|
467
426
|
});
|
|
468
427
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
469
|
-
const RULE$
|
|
428
|
+
const RULE$47 = "colocated-git-patterns";
|
|
470
429
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
471
430
|
const ROOT$2 = ".";
|
|
472
431
|
const SEPARATOR$21 = "/";
|
|
@@ -519,7 +478,7 @@ const problemAt$7 = (entry, message) => ({
|
|
|
519
478
|
file: entry.file,
|
|
520
479
|
line: entry.line,
|
|
521
480
|
column: FIRST$24,
|
|
522
|
-
rule: RULE$
|
|
481
|
+
rule: RULE$47,
|
|
523
482
|
message
|
|
524
483
|
});
|
|
525
484
|
const misplacedMessage = (kind, workspaces) => {
|
|
@@ -581,7 +540,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
581
540
|
return Array.getSomes([...misplacedFound, ...repeatedFound]);
|
|
582
541
|
});
|
|
583
542
|
// src/features/check-placement/model/colocated-tests.ts
|
|
584
|
-
const RULE$
|
|
543
|
+
const RULE$46 = "colocated-test";
|
|
585
544
|
const FIRST$23 = 1;
|
|
586
545
|
const READ_CONCURRENCY$28 = 64;
|
|
587
546
|
const ROOT_SUBPATH = ".";
|
|
@@ -596,7 +555,7 @@ const SPEC_FILE = /\.spec\.[cm]?[jt]sx?$/u;
|
|
|
596
555
|
const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
|
|
597
556
|
const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
|
|
598
557
|
const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
|
|
599
|
-
const EXCLUDED$
|
|
558
|
+
const EXCLUDED$7 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
600
559
|
const DIRECTORY_MESSAGE = "sits in a separate test directory. Put each test next to the module it tests, and test-only helpers next to the tests as <name>.test.support.ts.";
|
|
601
560
|
const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test next to the module it tests and import that module, or a helper beside it, with ./<name>.";
|
|
602
561
|
const Manifest$5 = Schema.Struct({
|
|
@@ -609,7 +568,7 @@ const problemFor$7 = (test, message) => ({
|
|
|
609
568
|
file: test.file,
|
|
610
569
|
line: FIRST$23,
|
|
611
570
|
column: FIRST$23,
|
|
612
|
-
rule: RULE$
|
|
571
|
+
rule: RULE$46,
|
|
613
572
|
message: `${test.base} ${message}`
|
|
614
573
|
});
|
|
615
574
|
const groupsOf$1 = (source, pattern, group) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array.getSomes);
|
|
@@ -657,7 +616,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(context, test) {
|
|
|
657
616
|
/** @internal */
|
|
658
617
|
const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
|
|
659
618
|
const files = yield* RepositoryFiles;
|
|
660
|
-
const listed = yield* files.matchingFiles(root, EXCLUDED$
|
|
619
|
+
const listed = yield* files.matchingFiles(root, EXCLUDED$7);
|
|
661
620
|
const names = pipe(listed, Array.filter(String$1.isNonEmpty));
|
|
662
621
|
const context = {
|
|
663
622
|
root,
|
|
@@ -692,7 +651,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
692
651
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
693
652
|
const RECOMMENDED_LINES = 200;
|
|
694
653
|
const FIRST$22 = 1;
|
|
695
|
-
const RULE$
|
|
654
|
+
const RULE$45 = "agent-docs-length";
|
|
696
655
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
697
656
|
const problemFor$6 = (file) => (lines) => {
|
|
698
657
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -700,19 +659,19 @@ const problemFor$6 = (file) => (lines) => {
|
|
|
700
659
|
file,
|
|
701
660
|
line: 201,
|
|
702
661
|
column: FIRST$22,
|
|
703
|
-
rule: RULE$
|
|
662
|
+
rule: RULE$45,
|
|
704
663
|
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.`
|
|
705
664
|
});
|
|
706
665
|
};
|
|
707
666
|
/** @internal */
|
|
708
667
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$6(file)(lineCount(source)));
|
|
709
668
|
// src/features/check-placement/model/claude-link.ts
|
|
710
|
-
const RULE$
|
|
669
|
+
const RULE$44 = "claude-md-link";
|
|
711
670
|
const CLAUDE = "CLAUDE.md";
|
|
712
671
|
const AGENTS = "AGENTS.md";
|
|
713
672
|
const FIRST$21 = 1;
|
|
714
673
|
const READ_CONCURRENCY$26 = 16;
|
|
715
|
-
const MESSAGE$
|
|
674
|
+
const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
716
675
|
/** @internal */
|
|
717
676
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
718
677
|
const files = yield* RepositoryFiles;
|
|
@@ -726,8 +685,8 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
726
685
|
file: path,
|
|
727
686
|
line: FIRST$21,
|
|
728
687
|
column: FIRST$21,
|
|
729
|
-
rule: RULE$
|
|
730
|
-
message: MESSAGE$
|
|
688
|
+
rule: RULE$44,
|
|
689
|
+
message: MESSAGE$16
|
|
731
690
|
})));
|
|
732
691
|
});
|
|
733
692
|
const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
|
|
@@ -735,7 +694,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
735
694
|
return Array.getSomes(found);
|
|
736
695
|
});
|
|
737
696
|
// src/features/check-placement/model/dangling-links.ts
|
|
738
|
-
const RULE$
|
|
697
|
+
const RULE$43 = "dangling-link";
|
|
739
698
|
const SEPARATOR$20 = "/";
|
|
740
699
|
const FIRST$20 = 1;
|
|
741
700
|
const READ_CONCURRENCY$25 = 16;
|
|
@@ -751,7 +710,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
751
710
|
file,
|
|
752
711
|
line: FIRST$20,
|
|
753
712
|
column: FIRST$20,
|
|
754
|
-
rule: RULE$
|
|
713
|
+
rule: RULE$43,
|
|
755
714
|
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.`
|
|
756
715
|
})));
|
|
757
716
|
});
|
|
@@ -759,7 +718,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
759
718
|
return Array.getSomes(found);
|
|
760
719
|
});
|
|
761
720
|
// src/features/check-placement/model/nested-docs.ts
|
|
762
|
-
const RULE$
|
|
721
|
+
const RULE$42 = "nested-docs";
|
|
763
722
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
764
723
|
const SEPARATOR$19 = "/";
|
|
765
724
|
const FIRST$19 = 1;
|
|
@@ -775,7 +734,7 @@ const problemFor$5 = (file, message) => ({
|
|
|
775
734
|
file,
|
|
776
735
|
line: FIRST$19,
|
|
777
736
|
column: FIRST$19,
|
|
778
|
-
rule: RULE$
|
|
737
|
+
rule: RULE$42,
|
|
779
738
|
message
|
|
780
739
|
});
|
|
781
740
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
@@ -826,10 +785,10 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
826
785
|
return Array.getSomes(found);
|
|
827
786
|
});
|
|
828
787
|
// src/features/check-placement/model/published-readme.ts
|
|
829
|
-
const RULE$
|
|
788
|
+
const RULE$41 = "published-readme";
|
|
830
789
|
const README_FILE = "README.md";
|
|
831
790
|
const READ_CONCURRENCY$23 = 16;
|
|
832
|
-
const MESSAGE$
|
|
791
|
+
const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
833
792
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
834
793
|
const FILE_START$1 = 1;
|
|
835
794
|
const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
@@ -840,7 +799,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
840
799
|
file,
|
|
841
800
|
line: FILE_START$1,
|
|
842
801
|
column: FILE_START$1,
|
|
843
|
-
rule: RULE$
|
|
802
|
+
rule: RULE$41,
|
|
844
803
|
message: MISSING_MESSAGE
|
|
845
804
|
});
|
|
846
805
|
return pipe(text, Option.flatMap((source) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
|
|
@@ -849,8 +808,8 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
849
808
|
file,
|
|
850
809
|
line,
|
|
851
810
|
column,
|
|
852
|
-
rule: RULE$
|
|
853
|
-
message: MESSAGE$
|
|
811
|
+
rule: RULE$41,
|
|
812
|
+
message: MESSAGE$15
|
|
854
813
|
};
|
|
855
814
|
}))));
|
|
856
815
|
});
|
|
@@ -861,11 +820,11 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
861
820
|
return Array.getSomes(found);
|
|
862
821
|
});
|
|
863
822
|
// src/features/check-placement/model/published-tests.ts
|
|
864
|
-
const RULE$
|
|
823
|
+
const RULE$40 = "published-tests";
|
|
865
824
|
const MANIFEST_FILE$2 = "package.json";
|
|
866
825
|
const FILE_START = 1;
|
|
867
826
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
868
|
-
const MESSAGE$
|
|
827
|
+
const MESSAGE$14 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
869
828
|
const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
|
|
870
829
|
const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
|
|
871
830
|
const files = yield* RepositoryFiles;
|
|
@@ -876,8 +835,8 @@ const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
876
835
|
file: files.join(absolute, MANIFEST_FILE$2),
|
|
877
836
|
line: FILE_START,
|
|
878
837
|
column: FILE_START,
|
|
879
|
-
rule: RULE$
|
|
880
|
-
message: MESSAGE$
|
|
838
|
+
rule: RULE$40,
|
|
839
|
+
message: MESSAGE$14
|
|
881
840
|
});
|
|
882
841
|
});
|
|
883
842
|
/** @internal */
|
|
@@ -890,12 +849,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
890
849
|
return Array.getSomes(found);
|
|
891
850
|
});
|
|
892
851
|
// src/features/check-placement/model/root-docs.ts
|
|
893
|
-
const RULE$
|
|
852
|
+
const RULE$39 = "root-docs";
|
|
894
853
|
const SEPARATOR$18 = "/";
|
|
895
854
|
const FIRST$18 = 1;
|
|
896
855
|
const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
|
|
897
856
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
898
|
-
const MESSAGE$
|
|
857
|
+
const MESSAGE$13 = "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.";
|
|
899
858
|
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
|
|
900
859
|
/** @internal */
|
|
901
860
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
@@ -905,15 +864,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
905
864
|
file: files.join(root, name),
|
|
906
865
|
line: FIRST$18,
|
|
907
866
|
column: FIRST$18,
|
|
908
|
-
rule: RULE$
|
|
909
|
-
message: `${name} ${MESSAGE$
|
|
867
|
+
rule: RULE$39,
|
|
868
|
+
message: `${name} ${MESSAGE$13}`
|
|
910
869
|
})));
|
|
911
870
|
});
|
|
912
871
|
// src/features/check-placement/model/root-readme.ts
|
|
913
|
-
const RULE$
|
|
872
|
+
const RULE$38 = "root-readme";
|
|
914
873
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
915
874
|
const READ_CONCURRENCY$22 = 16;
|
|
916
|
-
const START$
|
|
875
|
+
const START$18 = 0;
|
|
917
876
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
918
877
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
919
878
|
const RELATIVE$1 = /^\.\//u;
|
|
@@ -952,14 +911,14 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
|
|
|
952
911
|
onNone: () => ownNames(plugins, names),
|
|
953
912
|
onSome: () => [directory]
|
|
954
913
|
}));
|
|
955
|
-
const problemsIn$
|
|
914
|
+
const problemsIn$15 = (file, source, plugins) => (workspace) => {
|
|
956
915
|
const message = messageFor(workspace.directory);
|
|
957
916
|
const at = positionOf(source);
|
|
958
917
|
const pattern = patternFor(plugins)(workspace);
|
|
959
918
|
return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
|
|
960
919
|
file,
|
|
961
|
-
...at(found.index ?? START$
|
|
962
|
-
rule: RULE$
|
|
920
|
+
...at(found.index ?? START$18),
|
|
921
|
+
rule: RULE$38,
|
|
963
922
|
message
|
|
964
923
|
})));
|
|
965
924
|
};
|
|
@@ -967,7 +926,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
|
|
|
967
926
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
968
927
|
return pipe(text, Option.match({
|
|
969
928
|
onNone: () => [],
|
|
970
|
-
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$
|
|
929
|
+
onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$15(file, source, plugins)))
|
|
971
930
|
}));
|
|
972
931
|
});
|
|
973
932
|
/** @internal */
|
|
@@ -997,7 +956,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
997
956
|
return Array.flatten(found);
|
|
998
957
|
});
|
|
999
958
|
// src/features/check-placement/model/docs-mirror.ts
|
|
1000
|
-
const RULE$
|
|
959
|
+
const RULE$37 = "docs-mirror";
|
|
1001
960
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
1002
961
|
const MIRROR_LIMIT = 3;
|
|
1003
962
|
const READ_CONCURRENCY$21 = 16;
|
|
@@ -1022,7 +981,7 @@ const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Opti
|
|
|
1022
981
|
file,
|
|
1023
982
|
line,
|
|
1024
983
|
column,
|
|
1025
|
-
rule: RULE$
|
|
984
|
+
rule: RULE$37,
|
|
1026
985
|
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.`
|
|
1027
986
|
};
|
|
1028
987
|
}), Option.toArray);
|
|
@@ -1054,10 +1013,10 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
1054
1013
|
return Array.flatten(found);
|
|
1055
1014
|
});
|
|
1056
1015
|
// src/features/check-placement/model/ignored-sources.ts
|
|
1057
|
-
const RULE$
|
|
1016
|
+
const RULE$36 = "ignored-sources";
|
|
1058
1017
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
1059
1018
|
const FIRST$17 = 1;
|
|
1060
|
-
const MESSAGE$
|
|
1019
|
+
const MESSAGE$12 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
1061
1020
|
/** @internal */
|
|
1062
1021
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
1063
1022
|
const files = yield* RepositoryFiles;
|
|
@@ -1066,15 +1025,15 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
1066
1025
|
file: files.join(root, file),
|
|
1067
1026
|
line: FIRST$17,
|
|
1068
1027
|
column: FIRST$17,
|
|
1069
|
-
rule: RULE$
|
|
1070
|
-
message: MESSAGE$
|
|
1028
|
+
rule: RULE$36,
|
|
1029
|
+
message: MESSAGE$12
|
|
1071
1030
|
})));
|
|
1072
1031
|
});
|
|
1073
1032
|
// src/features/check-placement/model/member-sources.ts
|
|
1074
1033
|
const ROOT_WORKSPACE$1 = ".";
|
|
1075
1034
|
const FIRST$16 = 1;
|
|
1076
1035
|
const SEPARATOR$16 = "/";
|
|
1077
|
-
const EXCLUDED$
|
|
1036
|
+
const EXCLUDED$6 = [
|
|
1078
1037
|
":(exclude,attr:linguist-vendored)",
|
|
1079
1038
|
":(exclude,attr:linguist-generated)",
|
|
1080
1039
|
":(exclude,attr:linguist-documentation)"
|
|
@@ -1087,7 +1046,7 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
|
|
|
1087
1046
|
const files = yield* RepositoryFiles;
|
|
1088
1047
|
return {
|
|
1089
1048
|
workspaces: yield* memberWorkspaces(root),
|
|
1090
|
-
listed: yield* files.matchingFiles(root, EXCLUDED$
|
|
1049
|
+
listed: yield* files.matchingFiles(root, EXCLUDED$6)
|
|
1091
1050
|
};
|
|
1092
1051
|
});
|
|
1093
1052
|
const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
@@ -9735,7 +9694,7 @@ const LAYER_ITEMS = [
|
|
|
9735
9694
|
"inner_attribute_item"
|
|
9736
9695
|
];
|
|
9737
9696
|
const READ_CONCURRENCY$20 = 64;
|
|
9738
|
-
const EXCLUDED$
|
|
9697
|
+
const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
9739
9698
|
const NONE$2 = [];
|
|
9740
9699
|
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.";
|
|
9741
9700
|
const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
|
|
@@ -9802,7 +9761,7 @@ const isRead = ({ inner }) => {
|
|
|
9802
9761
|
};
|
|
9803
9762
|
const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
|
|
9804
9763
|
const files = yield* RepositoryFiles;
|
|
9805
|
-
const listed = yield* files.matchingFiles(root, EXCLUDED$
|
|
9764
|
+
const listed = yield* files.matchingFiles(root, EXCLUDED$5);
|
|
9806
9765
|
const owner = crateOf(crateDirectories(listed));
|
|
9807
9766
|
return pipe(listed, Array.filter((name) => RUST_FILE.test(name)), Array.flatMap((name) => Option.toArray(Option.map(owner(name), (owned) => ({
|
|
9808
9767
|
...owned,
|
|
@@ -9820,13 +9779,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
9820
9779
|
return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
|
|
9821
9780
|
});
|
|
9822
9781
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
9823
|
-
const RULE$
|
|
9782
|
+
const RULE$35 = "shadcn-ui-alias";
|
|
9824
9783
|
const FIRST$15 = 1;
|
|
9825
9784
|
const problemOf$8 = (directory, { file, alias }) => ({
|
|
9826
9785
|
file,
|
|
9827
9786
|
line: FIRST$15,
|
|
9828
9787
|
column: FIRST$15,
|
|
9829
|
-
rule: RULE$
|
|
9788
|
+
rule: RULE$35,
|
|
9830
9789
|
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/*".`
|
|
9831
9790
|
});
|
|
9832
9791
|
/** @internal */
|
|
@@ -9960,7 +9919,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
|
|
|
9960
9919
|
message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
|
|
9961
9920
|
})));
|
|
9962
9921
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
|
|
9963
|
-
const problemsIn$
|
|
9922
|
+
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
9964
9923
|
const files = yield* RepositoryFiles;
|
|
9965
9924
|
const config = yield* workspaceConfigOf(root, directory);
|
|
9966
9925
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -9999,12 +9958,12 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
9999
9958
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
10000
9959
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
10001
9960
|
const workflows = yield* workflowText(root);
|
|
10002
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$
|
|
9961
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$14(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
|
|
10003
9962
|
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$19 });
|
|
10004
9963
|
return [...Array.flatten(found), ...Array.getSomes(scripts)];
|
|
10005
9964
|
});
|
|
10006
9965
|
// src/features/check-repository-layout/model/crates.ts
|
|
10007
|
-
const RULE$
|
|
9966
|
+
const RULE$34 = "unverified-crate";
|
|
10008
9967
|
const VERSION_RULE = "release-version";
|
|
10009
9968
|
const MANIFEST_FILE$1 = "package.json";
|
|
10010
9969
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
@@ -10018,7 +9977,7 @@ const problemFor$2 = (crate, message) => ({
|
|
|
10018
9977
|
file: crate.manifest,
|
|
10019
9978
|
line: FIRST$12,
|
|
10020
9979
|
column: FIRST$12,
|
|
10021
|
-
rule: RULE$
|
|
9980
|
+
rule: RULE$34,
|
|
10022
9981
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
10023
9982
|
});
|
|
10024
9983
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -10054,7 +10013,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
10054
10013
|
return Array.getSomes(Array.flatten(found));
|
|
10055
10014
|
});
|
|
10056
10015
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
10057
|
-
const RULE$
|
|
10016
|
+
const RULE$33 = "deploy-entry-pattern";
|
|
10058
10017
|
const FALLOW_KEYS = [
|
|
10059
10018
|
"entry",
|
|
10060
10019
|
"entryPoints",
|
|
@@ -10073,7 +10032,7 @@ const ROOT_WORKSPACE = ".";
|
|
|
10073
10032
|
const WRAP_OFFSET$1 = 1;
|
|
10074
10033
|
const NO_OFFSET = 0;
|
|
10075
10034
|
const READ_CONCURRENCY$17 = 8;
|
|
10076
|
-
const MESSAGE$
|
|
10035
|
+
const MESSAGE$11 = "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.";
|
|
10077
10036
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
10078
10037
|
const FALLOW = {
|
|
10079
10038
|
keys: FALLOW_KEYS,
|
|
@@ -10090,7 +10049,7 @@ const VITE = {
|
|
|
10090
10049
|
const isPatternProperty = (keys) => (node) => node["type"] === "Property" && pipe(decodeKey$1(node["key"]), Option.exists((key) => Array.contains(keys, keyName(key))));
|
|
10091
10050
|
const patternsIn = (keys) => (node) => {
|
|
10092
10051
|
if (Predicate.isReadonlyObject(node) && isPatternProperty(keys)(node)) return stringsIn(node["value"]);
|
|
10093
|
-
return pipe(childrenOf$
|
|
10052
|
+
return pipe(childrenOf$1(node), Array.flatMap(patternsIn(keys)));
|
|
10094
10053
|
};
|
|
10095
10054
|
const choicesOf = ([literal = "", options]) => pipe(Option.fromUndefinedOr(options), Option.map(String$1.split(OPTION_SEPARATOR)), Option.getOrElse(() => [""]), Array.map((option) => `${literal}${option}`));
|
|
10096
10055
|
const combined = (chunks) => Array.matchLeft(chunks, {
|
|
@@ -10109,7 +10068,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
10109
10068
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
10110
10069
|
return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
10111
10070
|
});
|
|
10112
|
-
const problemsIn$
|
|
10071
|
+
const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
10113
10072
|
const { root, file, kind, workspaces, entries } = request;
|
|
10114
10073
|
const files = yield* RepositoryFiles;
|
|
10115
10074
|
const path = files.join(root, file);
|
|
@@ -10125,8 +10084,8 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
10125
10084
|
return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
|
|
10126
10085
|
file: path,
|
|
10127
10086
|
...positionOf(text.value)(start - kind.offset),
|
|
10128
|
-
rule: RULE$
|
|
10129
|
-
message: `${pattern} ${MESSAGE$
|
|
10087
|
+
rule: RULE$33,
|
|
10088
|
+
message: `${pattern} ${MESSAGE$11}`
|
|
10130
10089
|
})));
|
|
10131
10090
|
});
|
|
10132
10091
|
/** @internal */
|
|
@@ -10148,7 +10107,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10148
10107
|
}];
|
|
10149
10108
|
return [];
|
|
10150
10109
|
}));
|
|
10151
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
10110
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$13({
|
|
10152
10111
|
root,
|
|
10153
10112
|
file,
|
|
10154
10113
|
kind,
|
|
@@ -10158,7 +10117,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
10158
10117
|
return Array.flatten(found);
|
|
10159
10118
|
});
|
|
10160
10119
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
10161
|
-
const RULE$
|
|
10120
|
+
const RULE$32 = "listed-entry";
|
|
10162
10121
|
const ENTRY_KEYS = [
|
|
10163
10122
|
"entry",
|
|
10164
10123
|
"entryPoints",
|
|
@@ -10176,10 +10135,10 @@ const entryPatternsIn = (node) => {
|
|
|
10176
10135
|
text,
|
|
10177
10136
|
start: start - WRAP_OFFSET
|
|
10178
10137
|
})));
|
|
10179
|
-
return pipe(childrenOf$
|
|
10138
|
+
return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
|
|
10180
10139
|
};
|
|
10181
10140
|
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$3.test(text);
|
|
10182
|
-
const problemsIn$
|
|
10141
|
+
const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
10183
10142
|
const files = yield* RepositoryFiles;
|
|
10184
10143
|
const path = files.join(root, file);
|
|
10185
10144
|
const text = yield* files.readFile(path);
|
|
@@ -10188,7 +10147,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10188
10147
|
return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
|
|
10189
10148
|
file: path,
|
|
10190
10149
|
...positionOf(text.value)(start),
|
|
10191
|
-
rule: RULE$
|
|
10150
|
+
rule: RULE$32,
|
|
10192
10151
|
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.`
|
|
10193
10152
|
})));
|
|
10194
10153
|
});
|
|
@@ -10196,11 +10155,11 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
10196
10155
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
10197
10156
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10198
10157
|
const directories = yield* workspaceDirectories(root);
|
|
10199
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$
|
|
10158
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$12(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
|
|
10200
10159
|
return Array.flatten(found);
|
|
10201
10160
|
});
|
|
10202
10161
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
10203
|
-
const RULE$
|
|
10162
|
+
const RULE$31 = "root-workspace-path";
|
|
10204
10163
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
10205
10164
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
10206
10165
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -10216,10 +10175,10 @@ const mentions = (directory) => (text) => {
|
|
|
10216
10175
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
10217
10176
|
}));
|
|
10218
10177
|
};
|
|
10219
|
-
const problemsIn$
|
|
10178
|
+
const problemsIn$11 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
|
|
10220
10179
|
file,
|
|
10221
10180
|
...positionOf(source)(found.start),
|
|
10222
|
-
rule: RULE$
|
|
10181
|
+
rule: RULE$31,
|
|
10223
10182
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$4} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$4}: msch.lint, msch.devDependencies or its verify task.`
|
|
10224
10183
|
})));
|
|
10225
10184
|
/** @internal */
|
|
@@ -10230,10 +10189,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
10230
10189
|
if (Option.isNone(source)) return [];
|
|
10231
10190
|
const directories = yield* workspaceDirectories(root);
|
|
10232
10191
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
10233
|
-
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$
|
|
10192
|
+
return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$11(file, source.value, directories)));
|
|
10234
10193
|
});
|
|
10235
10194
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
10236
|
-
const RULE$
|
|
10195
|
+
const RULE$30 = "hidden-verify";
|
|
10237
10196
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
10238
10197
|
const FIRST$10 = 1;
|
|
10239
10198
|
const READ_CONCURRENCY$15 = 8;
|
|
@@ -10247,7 +10206,7 @@ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
10247
10206
|
file,
|
|
10248
10207
|
line: FIRST$10,
|
|
10249
10208
|
column: FIRST$10,
|
|
10250
|
-
rule: RULE$
|
|
10209
|
+
rule: RULE$30,
|
|
10251
10210
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$3}. The root verify reads ${CONFIG_FILE$3} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$3}.`
|
|
10252
10211
|
}).pipe(Option.filter(() => verified));
|
|
10253
10212
|
});
|
|
@@ -10258,7 +10217,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
10258
10217
|
return Array.getSomes(found);
|
|
10259
10218
|
});
|
|
10260
10219
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
10261
|
-
const RULE$
|
|
10220
|
+
const RULE$29 = "shared-uncached-task";
|
|
10262
10221
|
const READ_CONCURRENCY$14 = 8;
|
|
10263
10222
|
const SHARED = 2;
|
|
10264
10223
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -10301,7 +10260,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
10301
10260
|
return pipe(definitions, Array.map(({ file, position, name, command }) => ({
|
|
10302
10261
|
file,
|
|
10303
10262
|
...position,
|
|
10304
|
-
rule: RULE$
|
|
10263
|
+
rule: RULE$29,
|
|
10305
10264
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array.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.`
|
|
10306
10265
|
})));
|
|
10307
10266
|
};
|
|
@@ -10312,7 +10271,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
10312
10271
|
return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
|
|
10313
10272
|
});
|
|
10314
10273
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
10315
|
-
const RULE$
|
|
10274
|
+
const RULE$28 = "unlocked-task";
|
|
10316
10275
|
const READ_CONCURRENCY$13 = 8;
|
|
10317
10276
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
10318
10277
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -10324,7 +10283,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
10324
10283
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
10325
10284
|
file,
|
|
10326
10285
|
...positionOf(source)(task.start),
|
|
10327
|
-
rule: RULE$
|
|
10286
|
+
rule: RULE$28,
|
|
10328
10287
|
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.`
|
|
10329
10288
|
})), Option.toArray)));
|
|
10330
10289
|
/** @internal */
|
|
@@ -10479,7 +10438,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
10479
10438
|
/** @internal */
|
|
10480
10439
|
const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
|
|
10481
10440
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
10482
|
-
const RULE$
|
|
10441
|
+
const RULE$27 = "workflow-path";
|
|
10483
10442
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
10484
10443
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
10485
10444
|
const READ_CONCURRENCY$12 = 8;
|
|
@@ -10545,10 +10504,10 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
|
|
|
10545
10504
|
const problemOf$7 = (file, source) => (found) => ({
|
|
10546
10505
|
file,
|
|
10547
10506
|
...positionOf(source)(found.offset),
|
|
10548
|
-
rule: RULE$
|
|
10507
|
+
rule: RULE$27,
|
|
10549
10508
|
message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`
|
|
10550
10509
|
});
|
|
10551
|
-
const problemsIn$
|
|
10510
|
+
const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
10552
10511
|
const files = yield* RepositoryFiles;
|
|
10553
10512
|
const file = files.join(root, workflow);
|
|
10554
10513
|
const source = yield* files.readFile(file);
|
|
@@ -10560,7 +10519,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow
|
|
|
10560
10519
|
/** @internal */
|
|
10561
10520
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
10562
10521
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
10563
|
-
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$
|
|
10522
|
+
const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$10(root, workflow), { concurrency: READ_CONCURRENCY$12 });
|
|
10564
10523
|
return Array.flatten(found);
|
|
10565
10524
|
});
|
|
10566
10525
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -10571,7 +10530,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
|
|
|
10571
10530
|
const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
10572
10531
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
10573
10532
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
10574
|
-
const START$
|
|
10533
|
+
const START$17 = 0;
|
|
10575
10534
|
const READ_CONCURRENCY$11 = 8;
|
|
10576
10535
|
const SEPARATOR$8 = "/";
|
|
10577
10536
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
@@ -10602,7 +10561,7 @@ const namesIn = (name, source) => {
|
|
|
10602
10561
|
return [
|
|
10603
10562
|
{
|
|
10604
10563
|
text: name,
|
|
10605
|
-
offset: START$
|
|
10564
|
+
offset: START$17
|
|
10606
10565
|
},
|
|
10607
10566
|
...Option.toArray(stringOf(childOf("name")(root))),
|
|
10608
10567
|
...keysOf$1(childOf("jobs")(root))
|
|
@@ -10672,7 +10631,7 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
10672
10631
|
return Array.flatten(found);
|
|
10673
10632
|
});
|
|
10674
10633
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
10675
|
-
const RULE$
|
|
10634
|
+
const RULE$26 = "legacy-typescript";
|
|
10676
10635
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
10677
10636
|
const COMPILER = "typescript";
|
|
10678
10637
|
const CURRENT_MAJOR = 7;
|
|
@@ -10703,7 +10662,7 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
10703
10662
|
file,
|
|
10704
10663
|
line: lineOf$2(source)(legacy.id),
|
|
10705
10664
|
column: FIRST$8,
|
|
10706
|
-
rule: RULE$
|
|
10665
|
+
rule: RULE$26,
|
|
10707
10666
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
10708
10667
|
})));
|
|
10709
10668
|
});
|
|
@@ -10829,7 +10788,7 @@ const installedNames = (manifest) => [
|
|
|
10829
10788
|
...keysOf(manifest.optionalDependencies),
|
|
10830
10789
|
...pipe(keysOf(manifest.peerDependencies), Array.filter((name) => !isOptionalPeer(manifest, name)))
|
|
10831
10790
|
];
|
|
10832
|
-
const childrenOf
|
|
10791
|
+
const childrenOf = Effect.fn("childrenOf")(function* childrenOf(directory) {
|
|
10833
10792
|
const files = yield* RepositoryFiles;
|
|
10834
10793
|
const text = yield* files.readFile(files.join(directory, MANIFEST_FILE$3));
|
|
10835
10794
|
return pipe(text, Option.flatMap(decodeManifest$6), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
|
|
@@ -10858,7 +10817,7 @@ const closureOf = (provided, collect) => Array.match(collect.pending, {
|
|
|
10858
10817
|
...collect,
|
|
10859
10818
|
pending: rest
|
|
10860
10819
|
});
|
|
10861
|
-
return childrenOf
|
|
10820
|
+
return childrenOf(resolved.value).pipe(Effect.flatMap((children) => closureOf(provided, {
|
|
10862
10821
|
pending: [...rest, ...children],
|
|
10863
10822
|
seen: HashSet.add(collect.seen, resolved.value)
|
|
10864
10823
|
})));
|
|
@@ -10894,11 +10853,11 @@ const LISTED_LARGEST = 5;
|
|
|
10894
10853
|
const SIZE_CONCURRENCY = 32;
|
|
10895
10854
|
const MEGABYTE = 1e6;
|
|
10896
10855
|
const MEGABYTE_DIGITS = 1;
|
|
10897
|
-
const START$
|
|
10856
|
+
const START$16 = 0;
|
|
10898
10857
|
const SINGLE_ENTRY = 1;
|
|
10899
10858
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
10900
10859
|
const usageHint = (dependency, entryCount) => {
|
|
10901
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
10860
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$16 && dependency.entries.length < entryCount)) return "";
|
|
10902
10861
|
return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
|
|
10903
10862
|
};
|
|
10904
10863
|
const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
|
|
@@ -10907,7 +10866,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
10907
10866
|
const { workspace, total } = overrun;
|
|
10908
10867
|
const config = yield* files.readFile(workspace.configFile);
|
|
10909
10868
|
const source = Option.getOrElse(config, () => "");
|
|
10910
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
10869
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$16);
|
|
10911
10870
|
return {
|
|
10912
10871
|
file: workspace.configFile,
|
|
10913
10872
|
...positionOf(source)(index),
|
|
@@ -10924,7 +10883,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
10924
10883
|
const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
|
|
10925
10884
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
10926
10885
|
const sizes = HashMap.fromIterable(measured);
|
|
10927
|
-
const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$
|
|
10886
|
+
const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$16))));
|
|
10928
10887
|
return {
|
|
10929
10888
|
closures,
|
|
10930
10889
|
sizeOf,
|
|
@@ -10957,11 +10916,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
10957
10916
|
})];
|
|
10958
10917
|
});
|
|
10959
10918
|
const stackProblems = (file, source, dependencies) => {
|
|
10960
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$
|
|
10919
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$16);
|
|
10961
10920
|
const rest = String$1.slice(section)(source);
|
|
10962
10921
|
return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
|
|
10963
10922
|
file,
|
|
10964
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
10923
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$16)),
|
|
10965
10924
|
rule: STACK_DEPENDENCY,
|
|
10966
10925
|
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.`
|
|
10967
10926
|
})));
|
|
@@ -11328,7 +11287,7 @@ const derivationScopeOf = (node) => {
|
|
|
11328
11287
|
};
|
|
11329
11288
|
const sourcesOf = (checker) => (node) => pipe(referencedSymbols(checker)(derivationScopeOf(node)), Array.filter((symbol) => Option.isSome(namedValuesOf(checker)(symbol))));
|
|
11330
11289
|
const sitesUnder = (checker) => (node) => {
|
|
11331
|
-
const nested = pipe(childrenOf$
|
|
11290
|
+
const nested = pipe(childrenOf$2(node), Array.flatMap((child) => sitesUnder(checker)(child)));
|
|
11332
11291
|
if (Array.isReadonlyArrayNonEmpty(nested)) return nested;
|
|
11333
11292
|
return siteValuesOf(checker)(node).pipe(Option.map((values) => ({
|
|
11334
11293
|
node,
|
|
@@ -11617,7 +11576,7 @@ const duplicateProblems = (relative) => (sites) => {
|
|
|
11617
11576
|
}))));
|
|
11618
11577
|
};
|
|
11619
11578
|
// src/features/check-value-owners/model/name-lists.ts
|
|
11620
|
-
const RULE$
|
|
11579
|
+
const RULE$25 = "hand-written-names";
|
|
11621
11580
|
const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
11622
11581
|
const nameListOf = (site) => {
|
|
11623
11582
|
if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -11632,7 +11591,7 @@ const problemOf$6 = ({ list, reason }) => ({
|
|
|
11632
11591
|
file: list.site.file,
|
|
11633
11592
|
line: list.site.line,
|
|
11634
11593
|
column: list.site.column,
|
|
11635
|
-
rule: RULE$
|
|
11594
|
+
rule: RULE$25,
|
|
11636
11595
|
message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
|
|
11637
11596
|
});
|
|
11638
11597
|
// src/features/check-value-owners/model/declared-names.ts
|
|
@@ -11859,7 +11818,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
11859
11818
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
11860
11819
|
}, Effect.scoped);
|
|
11861
11820
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
11862
|
-
const RULE$
|
|
11821
|
+
const RULE$24 = "namespace-destructuring";
|
|
11863
11822
|
const LOCAL = /^[.#/]/u;
|
|
11864
11823
|
const messageOf$1 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
11865
11824
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -11875,7 +11834,7 @@ const destructuredName = (declaration) => {
|
|
|
11875
11834
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
11876
11835
|
};
|
|
11877
11836
|
const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
|
|
11878
|
-
rule: RULE$
|
|
11837
|
+
rule: RULE$24,
|
|
11879
11838
|
message: messageOf$1(name)
|
|
11880
11839
|
})), Option.map((report) => report(declaration)));
|
|
11881
11840
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -11883,7 +11842,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
11883
11842
|
return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
|
|
11884
11843
|
};
|
|
11885
11844
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
11886
|
-
const RULE$
|
|
11845
|
+
const RULE$23 = "pass-through-wrapper";
|
|
11887
11846
|
const SINGLE_STATEMENT = 1;
|
|
11888
11847
|
const SINGLE_DECLARATION = 1;
|
|
11889
11848
|
const THIS_PARAMETER = "this";
|
|
@@ -11980,7 +11939,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
11980
11939
|
const problemOf$4 = (checker) => (candidate) => {
|
|
11981
11940
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
11982
11941
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
|
|
11983
|
-
rule: RULE$
|
|
11942
|
+
rule: RULE$23,
|
|
11984
11943
|
message: messageOf(forward.callee.getText())
|
|
11985
11944
|
})(candidate.name)));
|
|
11986
11945
|
};
|
|
@@ -11989,20 +11948,20 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
|
|
|
11989
11948
|
/** @internal */
|
|
11990
11949
|
const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
|
|
11991
11950
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
11992
|
-
const RULE$
|
|
11951
|
+
const RULE$22 = "missing-hook";
|
|
11993
11952
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
11994
11953
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
11995
11954
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
11996
11955
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
11997
11956
|
const PLUGIN_ROOT = "..";
|
|
11998
11957
|
const READ_CONCURRENCY$10 = 16;
|
|
11999
|
-
const START$
|
|
11958
|
+
const START$15 = 0;
|
|
12000
11959
|
const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
|
|
12001
11960
|
path,
|
|
12002
|
-
index: found.index ?? START$
|
|
11961
|
+
index: found.index ?? START$15
|
|
12003
11962
|
})), Option.toArray);
|
|
12004
11963
|
const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
|
|
12005
|
-
const problemsIn$
|
|
11964
|
+
const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
12006
11965
|
const files = yield* RepositoryFiles;
|
|
12007
11966
|
const text = yield* files.readFile(file);
|
|
12008
11967
|
if (Option.isNone(text)) return [];
|
|
@@ -12014,7 +11973,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
12014
11973
|
return pipe(missing, Array.map(({ path, index }) => ({
|
|
12015
11974
|
file,
|
|
12016
11975
|
...positionOf(source)(index),
|
|
12017
|
-
rule: RULE$
|
|
11976
|
+
rule: RULE$22,
|
|
12018
11977
|
message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
|
|
12019
11978
|
})));
|
|
12020
11979
|
});
|
|
@@ -12038,7 +11997,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
12038
11997
|
}];
|
|
12039
11998
|
return [];
|
|
12040
11999
|
}));
|
|
12041
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$
|
|
12000
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$9, { concurrency: READ_CONCURRENCY$10 });
|
|
12042
12001
|
return Array.flatten(found);
|
|
12043
12002
|
});
|
|
12044
12003
|
// src/shared/lib/section-check.ts
|
|
@@ -12101,8 +12060,8 @@ const EXTENSION = /\.[^./]+$/u;
|
|
|
12101
12060
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
12102
12061
|
const READ_CONCURRENCY$9 = 64;
|
|
12103
12062
|
const FIRST$6 = 1;
|
|
12104
|
-
const RULE$
|
|
12105
|
-
const MESSAGE$
|
|
12063
|
+
const RULE$21 = "shell-script";
|
|
12064
|
+
const MESSAGE$10 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
|
|
12106
12065
|
const HookSchema = Schema.Struct({
|
|
12107
12066
|
command: Schema.optional(Schema.String),
|
|
12108
12067
|
args: Schema.optional(Schema.Array(Schema.String))
|
|
@@ -12124,8 +12083,8 @@ const problemFor$1 = (file) => ({
|
|
|
12124
12083
|
file,
|
|
12125
12084
|
line: FIRST$6,
|
|
12126
12085
|
column: FIRST$6,
|
|
12127
|
-
rule: RULE$
|
|
12128
|
-
message: MESSAGE$
|
|
12086
|
+
rule: RULE$21,
|
|
12087
|
+
message: MESSAGE$10
|
|
12129
12088
|
});
|
|
12130
12089
|
/** @internal */
|
|
12131
12090
|
const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
|
|
@@ -12161,8 +12120,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
12161
12120
|
});
|
|
12162
12121
|
// src/shared/lib/workflow-run.ts
|
|
12163
12122
|
const RUN_KEY = "run";
|
|
12164
|
-
const START$
|
|
12165
|
-
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
12123
|
+
const START$14 = 0;
|
|
12124
|
+
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$14));
|
|
12166
12125
|
const runScriptsOf = (source) => {
|
|
12167
12126
|
const found = [];
|
|
12168
12127
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -12177,28 +12136,28 @@ const runScriptsOf = (source) => {
|
|
|
12177
12136
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
12178
12137
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
12179
12138
|
const COMMENT = "#";
|
|
12180
|
-
const RULE$
|
|
12139
|
+
const RULE$20 = "workflow-script";
|
|
12181
12140
|
const ONE_COMMAND = 1;
|
|
12182
|
-
const MESSAGE$
|
|
12141
|
+
const MESSAGE$9 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
|
|
12183
12142
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
12184
12143
|
const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
|
|
12185
12144
|
const runsMoreThanOneCommand = ({ text }) => {
|
|
12186
12145
|
const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
|
|
12187
12146
|
return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
|
|
12188
12147
|
};
|
|
12189
|
-
const problemsIn$
|
|
12148
|
+
const problemsIn$8 = (file) => (source) => {
|
|
12190
12149
|
const at = positionOf(source);
|
|
12191
12150
|
return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
|
|
12192
12151
|
file,
|
|
12193
12152
|
...at(start),
|
|
12194
|
-
rule: RULE$
|
|
12195
|
-
message: MESSAGE$
|
|
12153
|
+
rule: RULE$20,
|
|
12154
|
+
message: MESSAGE$9
|
|
12196
12155
|
})));
|
|
12197
12156
|
};
|
|
12198
12157
|
/** @internal */
|
|
12199
12158
|
const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
|
|
12200
12159
|
const workflows = yield* readWorkflows(root);
|
|
12201
|
-
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$
|
|
12160
|
+
return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$8(file)(source)));
|
|
12202
12161
|
});
|
|
12203
12162
|
// src/features/check-scripts/model/script-checks.ts
|
|
12204
12163
|
/** @internal */
|
|
@@ -12304,24 +12263,24 @@ const docSources = (file) => (source) => {
|
|
|
12304
12263
|
const ROOT_DIRECTORY$1 = ".";
|
|
12305
12264
|
const COMMAND_KEY = "command";
|
|
12306
12265
|
const ARGUMENTS_KEY = "args";
|
|
12307
|
-
const EXCLUDED$
|
|
12308
|
-
const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$
|
|
12266
|
+
const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12267
|
+
const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$4];
|
|
12309
12268
|
const STEP_FILES = [
|
|
12310
12269
|
":(glob).github/workflows/*.yml",
|
|
12311
12270
|
":(glob).github/workflows/*.yaml",
|
|
12312
12271
|
":(glob)**/action.yml",
|
|
12313
12272
|
":(glob)**/action.yaml",
|
|
12314
|
-
...EXCLUDED$
|
|
12273
|
+
...EXCLUDED$4
|
|
12315
12274
|
];
|
|
12316
12275
|
const HOOK_FILES = [":(glob).vite-hooks/*"];
|
|
12317
12276
|
const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
|
|
12318
12277
|
const AGENT_DOCS = [
|
|
12319
12278
|
":(glob)**/AGENTS.md",
|
|
12320
12279
|
":(glob)**/CLAUDE.md",
|
|
12321
|
-
...EXCLUDED$
|
|
12280
|
+
...EXCLUDED$4
|
|
12322
12281
|
];
|
|
12323
12282
|
const READ_CONCURRENCY$7 = 16;
|
|
12324
|
-
const START$
|
|
12283
|
+
const START$13 = 0;
|
|
12325
12284
|
const FIRST$5 = 1;
|
|
12326
12285
|
const LINE = "\n";
|
|
12327
12286
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -12331,7 +12290,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
|
|
|
12331
12290
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
12332
12291
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
12333
12292
|
const NO_SOURCES = [];
|
|
12334
|
-
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
12293
|
+
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$13));
|
|
12335
12294
|
const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
|
|
12336
12295
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
12337
12296
|
return {
|
|
@@ -12364,7 +12323,7 @@ const commandIn = (node) => {
|
|
|
12364
12323
|
const record = node;
|
|
12365
12324
|
return pipe(Option.fromUndefinedOr(record[COMMAND_KEY]), Option.filter(Predicate.isString), Option.map((command) => pipe(decodeArguments(record[ARGUMENTS_KEY]), Option.getOrElse(() => []), Array.prepend(command), Array.join(" "))));
|
|
12366
12325
|
};
|
|
12367
|
-
const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$
|
|
12326
|
+
const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$1(node), Array.flatMap(commandsIn))];
|
|
12368
12327
|
const agentSources = (file) => (source) => pipe(decodeJson$1(source), Option.map(commandsIn), Option.getOrElse(() => []), Array.map((text) => {
|
|
12369
12328
|
const program = Array.headNonEmpty(String$1.split(text, " "));
|
|
12370
12329
|
const offset = offsetOf$2(source, `"${program}"`);
|
|
@@ -12427,7 +12386,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
12427
12386
|
return Array.flatten(found);
|
|
12428
12387
|
});
|
|
12429
12388
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
12430
|
-
const RULE$
|
|
12389
|
+
const RULE$19 = "package-script";
|
|
12431
12390
|
const LIFECYCLE = [
|
|
12432
12391
|
"preinstall",
|
|
12433
12392
|
"install",
|
|
@@ -12450,26 +12409,26 @@ const LIFECYCLE = [
|
|
|
12450
12409
|
const problemOf$3 = ({ file, position, name }) => ({
|
|
12451
12410
|
file,
|
|
12452
12411
|
...position,
|
|
12453
|
-
rule: RULE$
|
|
12412
|
+
rule: RULE$19,
|
|
12454
12413
|
message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
|
|
12455
12414
|
});
|
|
12456
12415
|
const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
|
|
12457
12416
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
12458
|
-
const RULE$
|
|
12417
|
+
const RULE$18 = "vite-plus-block";
|
|
12459
12418
|
const MARKER = Array.join([
|
|
12460
12419
|
"<!--",
|
|
12461
12420
|
"VITE PLUS START",
|
|
12462
12421
|
"-->"
|
|
12463
12422
|
], "");
|
|
12464
|
-
const MESSAGE$
|
|
12423
|
+
const MESSAGE$8 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
|
|
12465
12424
|
const problemIn = (file) => (source) => {
|
|
12466
12425
|
const index = String$1.indexOf(MARKER)(source);
|
|
12467
12426
|
if (Option.isNone(index)) return Option.none();
|
|
12468
12427
|
return Option.some({
|
|
12469
12428
|
file,
|
|
12470
12429
|
...positionOf(source)(index.value),
|
|
12471
|
-
rule: RULE$
|
|
12472
|
-
message: MESSAGE$
|
|
12430
|
+
rule: RULE$18,
|
|
12431
|
+
message: MESSAGE$8
|
|
12473
12432
|
});
|
|
12474
12433
|
};
|
|
12475
12434
|
/** @internal */
|
|
@@ -12524,11 +12483,11 @@ const checkFullHistoryCheckout = workflowCheck({
|
|
|
12524
12483
|
})
|
|
12525
12484
|
});
|
|
12526
12485
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
12527
|
-
const RULE$
|
|
12486
|
+
const RULE$16 = "publish-trigger";
|
|
12528
12487
|
const PUBLISH = /\bmsch-publish\b/u;
|
|
12529
12488
|
const MANUAL = "workflow_dispatch";
|
|
12530
12489
|
const TRIGGER_KEY = "on";
|
|
12531
|
-
const MESSAGE$
|
|
12490
|
+
const MESSAGE$6 = "publishes with `msch-publish` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
|
|
12532
12491
|
const triggersOf = (node) => {
|
|
12533
12492
|
if (isScalar(node)) return [String(node.value)];
|
|
12534
12493
|
if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
|
|
@@ -12544,19 +12503,19 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
12544
12503
|
};
|
|
12545
12504
|
/** @internal */
|
|
12546
12505
|
const checkPublishTrigger = workflowCheck({
|
|
12547
|
-
rule: RULE$
|
|
12548
|
-
message: MESSAGE$
|
|
12506
|
+
rule: RULE$16,
|
|
12507
|
+
message: MESSAGE$6,
|
|
12549
12508
|
offsetsOf: publishTriggerOffsetsOf
|
|
12550
12509
|
});
|
|
12551
12510
|
// src/features/check-workflows/model/release-please.ts
|
|
12552
|
-
const RULE$
|
|
12511
|
+
const RULE$15 = "release-please";
|
|
12553
12512
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
12554
12513
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
12555
12514
|
const FIRST$4 = 1;
|
|
12556
|
-
const MESSAGE$
|
|
12515
|
+
const MESSAGE$5 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
|
|
12557
12516
|
const checkReleasePleaseSteps = workflowCheck({
|
|
12558
|
-
rule: RULE$
|
|
12559
|
-
message: MESSAGE$
|
|
12517
|
+
rule: RULE$15,
|
|
12518
|
+
message: MESSAGE$5,
|
|
12560
12519
|
offsetsOf: scalarKeyOffsets({
|
|
12561
12520
|
name: "uses",
|
|
12562
12521
|
matches: (value) => RELEASE_PLEASE.test(value)
|
|
@@ -12569,8 +12528,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
12569
12528
|
file: files.join(root, name),
|
|
12570
12529
|
line: FIRST$4,
|
|
12571
12530
|
column: FIRST$4,
|
|
12572
|
-
rule: RULE$
|
|
12573
|
-
message: MESSAGE$
|
|
12531
|
+
rule: RULE$15,
|
|
12532
|
+
message: MESSAGE$5
|
|
12574
12533
|
})));
|
|
12575
12534
|
});
|
|
12576
12535
|
/** @internal */
|
|
@@ -12581,26 +12540,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
12581
12540
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
12582
12541
|
const CONCURRENCY_KEY = "concurrency";
|
|
12583
12542
|
const QUEUE_KEY = "queue";
|
|
12584
|
-
const RULE$
|
|
12585
|
-
const MESSAGE$
|
|
12543
|
+
const RULE$14 = "workflow-queue";
|
|
12544
|
+
const MESSAGE$4 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
|
|
12586
12545
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
12587
12546
|
/** @internal */
|
|
12588
12547
|
const checkWorkflowQueues = workflowCheck({
|
|
12589
|
-
rule: RULE$
|
|
12590
|
-
message: MESSAGE$
|
|
12548
|
+
rule: RULE$14,
|
|
12549
|
+
message: MESSAGE$4,
|
|
12591
12550
|
offsetsOf: queueOffsetsOf
|
|
12592
12551
|
});
|
|
12593
12552
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
12594
|
-
const RULE$
|
|
12553
|
+
const RULE$13 = "workflow-commit";
|
|
12595
12554
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
12596
12555
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
12597
|
-
const MESSAGE$
|
|
12556
|
+
const MESSAGE$3 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
|
|
12598
12557
|
const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source), Array.filter(({ value }) => isScalar(value) && typeof value.value === "string" && pattern.test(value.value)), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([start]) => start), Option.toArray)));
|
|
12599
12558
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
12600
12559
|
/** @internal */
|
|
12601
12560
|
const checkWorkflowCommits = workflowCheck({
|
|
12602
|
-
rule: RULE$
|
|
12603
|
-
message: MESSAGE$
|
|
12561
|
+
rule: RULE$13,
|
|
12562
|
+
message: MESSAGE$3,
|
|
12604
12563
|
offsetsOf: commitOffsetsOf
|
|
12605
12564
|
});
|
|
12606
12565
|
// src/features/check-workflows/model/workflow-lint.ts
|
|
@@ -12647,29 +12606,12 @@ const trimmed = ({ index, text }) => ({
|
|
|
12647
12606
|
});
|
|
12648
12607
|
// src/features/ban-comments/model/config-comments.ts
|
|
12649
12608
|
const NEXT$1 = 1;
|
|
12650
|
-
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
12651
|
-
const childrenOf = (value) => {
|
|
12652
|
-
if (Array.isArray(value)) return value;
|
|
12653
|
-
if (isRecord(value)) return Record.values(value);
|
|
12654
|
-
return [];
|
|
12655
|
-
};
|
|
12656
|
-
const collect = (isItem) => (value) => {
|
|
12657
|
-
if (isItem(value)) return [value];
|
|
12658
|
-
return pipe(childrenOf(value), Array.flatMap(collect(isItem)));
|
|
12659
|
-
};
|
|
12660
|
-
const isYamlComment = (value) => isRecord(value) && value["type"] === "comment" && typeof value["offset"] === "number" && typeof value["source"] === "string";
|
|
12661
12609
|
const yamlComments = (source) => Effect.try({
|
|
12662
|
-
try: () => pipe(
|
|
12663
|
-
index: token.offset,
|
|
12664
|
-
text: token.source
|
|
12665
|
-
}))),
|
|
12610
|
+
try: () => pipe(yamlSourceComments(source), Array.map(trimmed)),
|
|
12666
12611
|
catch: unreadable("yaml")
|
|
12667
12612
|
});
|
|
12668
12613
|
const tomlComments = (source) => Effect.try({
|
|
12669
|
-
try: () => pipe(
|
|
12670
|
-
index: start,
|
|
12671
|
-
text: String$1.slice(start, end)(source)
|
|
12672
|
-
}))),
|
|
12614
|
+
try: () => pipe(tomlSourceComments(source), Array.map(trimmed)),
|
|
12673
12615
|
catch: unreadable("toml")
|
|
12674
12616
|
});
|
|
12675
12617
|
const isSqlComment = (value) => isRecord(value) && (value["type"] === "line_comment" || value["type"] === "block_comment") && typeof value["text"] === "string" && Array.isArray(value["range"]);
|
|
@@ -12681,7 +12623,7 @@ const sqlComments = (source) => Effect.try({
|
|
|
12681
12623
|
includeRange: true,
|
|
12682
12624
|
paramTypes: []
|
|
12683
12625
|
});
|
|
12684
|
-
return pipe(
|
|
12626
|
+
return pipe(collectNodes(isSqlComment)(program), Array.map(({ range: [start], text }) => trimmed({
|
|
12685
12627
|
index: start,
|
|
12686
12628
|
text
|
|
12687
12629
|
})));
|
|
@@ -12721,7 +12663,7 @@ const COMMENT_NODES = [
|
|
|
12721
12663
|
"block_comment",
|
|
12722
12664
|
"multiline_comment"
|
|
12723
12665
|
];
|
|
12724
|
-
const START$
|
|
12666
|
+
const START$12 = 0;
|
|
12725
12667
|
const NEXT = 1;
|
|
12726
12668
|
const NONE$1 = [];
|
|
12727
12669
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -12774,7 +12716,7 @@ const markupComment = (source) => (node) => {
|
|
|
12774
12716
|
}];
|
|
12775
12717
|
};
|
|
12776
12718
|
const textComments = (grammars, grammar) => (text) => {
|
|
12777
|
-
const shift = shifted(text.startIndex ?? START$
|
|
12719
|
+
const shift = shifted(text.startIndex ?? START$12);
|
|
12778
12720
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
|
|
12779
12721
|
};
|
|
12780
12722
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -12810,11 +12752,11 @@ const commentsWith = (grammars) => (reader, source) => {
|
|
|
12810
12752
|
}[reader](source);
|
|
12811
12753
|
};
|
|
12812
12754
|
// src/features/ban-comments/model/comments.ts
|
|
12813
|
-
const RULE$
|
|
12755
|
+
const RULE$12 = "comment";
|
|
12814
12756
|
const CONFIG_FILE$1 = "vite.config.ts";
|
|
12815
12757
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
12816
12758
|
const READ_CONCURRENCY$6 = 64;
|
|
12817
|
-
const START$
|
|
12759
|
+
const START$11 = 0;
|
|
12818
12760
|
const FIRST_LINE$4 = 1;
|
|
12819
12761
|
const FIRST_COLUMN$3 = 1;
|
|
12820
12762
|
const READERS$1 = [
|
|
@@ -12848,7 +12790,7 @@ const SHEBANG = "#!";
|
|
|
12848
12790
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
12849
12791
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
12850
12792
|
const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
|
|
12851
|
-
const MESSAGE$
|
|
12793
|
+
const MESSAGE$2 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
|
|
12852
12794
|
const Patterns = Schema.Array(Schema.String);
|
|
12853
12795
|
const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
12854
12796
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
@@ -12871,23 +12813,23 @@ const shebangReader = (source) => {
|
|
|
12871
12813
|
const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
|
|
12872
12814
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
12873
12815
|
const lineBefore = (source, index) => {
|
|
12874
|
-
const lines = pipe(source, String$1.slice(START$
|
|
12816
|
+
const lines = pipe(source, String$1.slice(START$11, index), String$1.split("\n"));
|
|
12875
12817
|
return Option.getOrElse(Array.last(lines), () => "");
|
|
12876
12818
|
};
|
|
12877
12819
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
12878
|
-
const isShebang = ({ index, text }) => index === START$
|
|
12820
|
+
const isShebang = ({ index, text }) => index === START$11 && String$1.startsWith(SHEBANG)(text);
|
|
12879
12821
|
const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
|
|
12880
12822
|
const problemOf$2 = (file, source) => ({ index }) => ({
|
|
12881
12823
|
file,
|
|
12882
12824
|
...positionOf(source)(index),
|
|
12883
|
-
rule: RULE$
|
|
12884
|
-
message: MESSAGE$
|
|
12825
|
+
rule: RULE$12,
|
|
12826
|
+
message: MESSAGE$2
|
|
12885
12827
|
});
|
|
12886
12828
|
const unreadableProblem = (file, message) => ({
|
|
12887
12829
|
file,
|
|
12888
12830
|
line: FIRST_LINE$4,
|
|
12889
12831
|
column: FIRST_COLUMN$3,
|
|
12890
|
-
rule: RULE$
|
|
12832
|
+
rule: RULE$12,
|
|
12891
12833
|
message: `msch could not read the comments in this file: ${message}`
|
|
12892
12834
|
});
|
|
12893
12835
|
const settingsOf = ({ msch, lint }) => ({
|
|
@@ -13126,7 +13068,7 @@ const CONFIG_FILE = "vite.config.ts";
|
|
|
13126
13068
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
13127
13069
|
const SOURCE = "masseater/skills";
|
|
13128
13070
|
const PRESET$1 = "github>masseater/masseater.dev//libs/vite-plus-adopt/renovate";
|
|
13129
|
-
const START$
|
|
13071
|
+
const START$10 = 0;
|
|
13130
13072
|
const LOCAL_PREFIX = "./";
|
|
13131
13073
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
13132
13074
|
const Source = Schema.Struct({
|
|
@@ -13139,7 +13081,7 @@ const taggedError = Schema.TaggedError;
|
|
|
13139
13081
|
var SkillsConfigUnreadable = class extends taggedError()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
13140
13082
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
13141
13083
|
file,
|
|
13142
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
13084
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
|
|
13143
13085
|
rule,
|
|
13144
13086
|
message
|
|
13145
13087
|
});
|
|
@@ -13186,7 +13128,7 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
13186
13128
|
];
|
|
13187
13129
|
});
|
|
13188
13130
|
// src/features/check-skills/model/published-skills.ts
|
|
13189
|
-
const RULE$
|
|
13131
|
+
const RULE$11 = "published-skills";
|
|
13190
13132
|
const KEYWORD = "tanstack-intent";
|
|
13191
13133
|
const SKILLS = "skills";
|
|
13192
13134
|
const MANIFEST_FILE = "package.json";
|
|
@@ -13199,7 +13141,7 @@ const problemAt$2 = (file, message) => ({
|
|
|
13199
13141
|
file,
|
|
13200
13142
|
line: FIRST$3,
|
|
13201
13143
|
column: FIRST$3,
|
|
13202
|
-
rule: RULE$
|
|
13144
|
+
rule: RULE$11,
|
|
13203
13145
|
message
|
|
13204
13146
|
});
|
|
13205
13147
|
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array.filter((file) => files.basename(file) === SKILL_FILE$1), Array.map((file) => files.relative(directory, files.dirname(file))));
|
|
@@ -13222,7 +13164,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
|
|
|
13222
13164
|
const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
|
|
13223
13165
|
return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
|
|
13224
13166
|
}, Effect.scoped);
|
|
13225
|
-
const problemsIn$
|
|
13167
|
+
const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
|
|
13226
13168
|
const files = yield* RepositoryFiles;
|
|
13227
13169
|
const directory = files.join(root, project.directory);
|
|
13228
13170
|
const manifest = files.join(directory, MANIFEST_FILE);
|
|
@@ -13234,11 +13176,11 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project)
|
|
|
13234
13176
|
/** @internal */
|
|
13235
13177
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
13236
13178
|
const projects = yield* publishedProjects(root);
|
|
13237
|
-
const problems = yield* Effect.forEach(projects, (project) => problemsIn$
|
|
13179
|
+
const problems = yield* Effect.forEach(projects, (project) => problemsIn$7(root, project), { concurrency: 1 });
|
|
13238
13180
|
return Array.flatten(problems);
|
|
13239
13181
|
});
|
|
13240
13182
|
// src/features/check-skills/model/skill-files.ts
|
|
13241
|
-
const RULE$
|
|
13183
|
+
const RULE$10 = "skill-file";
|
|
13242
13184
|
const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
|
|
13243
13185
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
13244
13186
|
const MARKDOWN = ".md";
|
|
@@ -13255,7 +13197,7 @@ const GITHUB = "https://github.com/";
|
|
|
13255
13197
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
13256
13198
|
const BLANK = /\s+/u;
|
|
13257
13199
|
const SEPARATOR$3 = "/";
|
|
13258
|
-
const START$
|
|
13200
|
+
const START$9 = 0;
|
|
13259
13201
|
const FIRST$2 = 1;
|
|
13260
13202
|
const READ_CONCURRENCY$4 = 16;
|
|
13261
13203
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -13265,9 +13207,9 @@ const Frontmatter = Schema.Struct({
|
|
|
13265
13207
|
metadata: Schema.optional(Metadata)
|
|
13266
13208
|
});
|
|
13267
13209
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
13268
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$
|
|
13210
|
+
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
|
|
13269
13211
|
const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$2(yaml))));
|
|
13270
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$
|
|
13212
|
+
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
|
|
13271
13213
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
13272
13214
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
13273
13215
|
const bodyStart = bodyStartOf(source);
|
|
@@ -13295,16 +13237,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
13295
13237
|
]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
|
|
13296
13238
|
file: skill.file,
|
|
13297
13239
|
...positionOf(skill.source)(index),
|
|
13298
|
-
rule: RULE$
|
|
13240
|
+
rule: RULE$10,
|
|
13299
13241
|
message
|
|
13300
13242
|
})));
|
|
13301
13243
|
const linkOf = (found) => pipe(groupOf$2("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
|
|
13302
13244
|
target,
|
|
13303
|
-
index: found.index ?? START$
|
|
13245
|
+
index: found.index ?? START$9
|
|
13304
13246
|
})), Option.toArray);
|
|
13305
13247
|
const rangeOf$1 = (found) => {
|
|
13306
|
-
const start = found.index ?? START$
|
|
13307
|
-
return [start, start + found[START$
|
|
13248
|
+
const start = found.index ?? START$9;
|
|
13249
|
+
return [start, start + found[START$9].length];
|
|
13308
13250
|
};
|
|
13309
13251
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
|
|
13310
13252
|
const linksIn = (source) => {
|
|
@@ -13322,11 +13264,11 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
13322
13264
|
return pipe(missing, Array.map(({ target, index }) => ({
|
|
13323
13265
|
file,
|
|
13324
13266
|
...positionOf(source)(index),
|
|
13325
|
-
rule: RULE$
|
|
13267
|
+
rule: RULE$10,
|
|
13326
13268
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
13327
13269
|
})));
|
|
13328
13270
|
});
|
|
13329
|
-
const problemsIn$
|
|
13271
|
+
const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
|
|
13330
13272
|
const files = yield* RepositoryFiles;
|
|
13331
13273
|
const file = files.join(root, name);
|
|
13332
13274
|
const directory = files.dirname(name);
|
|
@@ -13338,7 +13280,7 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
13338
13280
|
file: files.join(root, entry),
|
|
13339
13281
|
line: FIRST$2,
|
|
13340
13282
|
column: FIRST$2,
|
|
13341
|
-
rule: RULE$
|
|
13283
|
+
rule: RULE$10,
|
|
13342
13284
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
13343
13285
|
})));
|
|
13344
13286
|
return [
|
|
@@ -13355,7 +13297,7 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
13355
13297
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
13356
13298
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13357
13299
|
const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
|
|
13358
|
-
const found = yield* Effect.forEach(skills, (name) => problemsIn$
|
|
13300
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$6(root, listed, name), { concurrency: READ_CONCURRENCY$4 });
|
|
13359
13301
|
return Array.flatten(found);
|
|
13360
13302
|
});
|
|
13361
13303
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -13418,7 +13360,7 @@ const cargoEntries = (text) => {
|
|
|
13418
13360
|
};
|
|
13419
13361
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
13420
13362
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
13421
|
-
const RULE$
|
|
13363
|
+
const RULE$9 = "version-downgrade";
|
|
13422
13364
|
const DEFAULT_BASE = "origin/main";
|
|
13423
13365
|
const READ_CONCURRENCY$3 = 16;
|
|
13424
13366
|
const READERS = [
|
|
@@ -13444,7 +13386,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
13444
13386
|
file,
|
|
13445
13387
|
line: lineOf(text, entry),
|
|
13446
13388
|
column: FIRST_LINE$1,
|
|
13447
|
-
rule: RULE$
|
|
13389
|
+
rule: RULE$9,
|
|
13448
13390
|
message: message(old, entry)
|
|
13449
13391
|
})), Option.toArray)));
|
|
13450
13392
|
};
|
|
@@ -13481,13 +13423,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
13481
13423
|
const CAP_RULE = "renovate-version-cap";
|
|
13482
13424
|
const PRESET_RULE = "renovate-msch-preset";
|
|
13483
13425
|
const PRESET = "github>masseater/masseater.dev//libs/msch/renovate";
|
|
13484
|
-
const START$
|
|
13426
|
+
const START$8 = 0;
|
|
13485
13427
|
const READ_CONCURRENCY$2 = 16;
|
|
13486
13428
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
13487
13429
|
const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
|
|
13488
13430
|
const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
13489
13431
|
const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
|
|
13490
|
-
const problemsIn$
|
|
13432
|
+
const problemsIn$5 = (file, source) => {
|
|
13491
13433
|
const at = positionOf(source);
|
|
13492
13434
|
const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
|
|
13493
13435
|
file,
|
|
@@ -13500,7 +13442,7 @@ const problemsIn$4 = (file, source) => {
|
|
|
13500
13442
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
13501
13443
|
...pipe([{
|
|
13502
13444
|
file,
|
|
13503
|
-
...at(START$
|
|
13445
|
+
...at(START$8),
|
|
13504
13446
|
rule: PRESET_RULE,
|
|
13505
13447
|
message: PRESET_MESSAGE
|
|
13506
13448
|
}], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
|
|
@@ -13514,7 +13456,7 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
13514
13456
|
const file = files.join(root, name);
|
|
13515
13457
|
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
13516
13458
|
onNone: () => [],
|
|
13517
|
-
onSome: (source) => problemsIn$
|
|
13459
|
+
onSome: (source) => problemsIn$5(file, source)
|
|
13518
13460
|
})));
|
|
13519
13461
|
}, { concurrency: READ_CONCURRENCY$2 });
|
|
13520
13462
|
return Array.flatten(found);
|
|
@@ -13522,22 +13464,22 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
13522
13464
|
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
13523
13465
|
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
13524
13466
|
const NUL = "\0";
|
|
13525
|
-
const START$
|
|
13467
|
+
const START$7 = 0;
|
|
13526
13468
|
const HEX = 16;
|
|
13527
13469
|
const CODE_POINT_WIDTH = 4;
|
|
13528
13470
|
const READ_CONCURRENCY$1 = 64;
|
|
13529
|
-
const RULE$
|
|
13530
|
-
const hexOf = (character) => pipe(String$1.codePointAt(START$
|
|
13471
|
+
const RULE$8 = "hidden-unicode";
|
|
13472
|
+
const hexOf = (character) => pipe(String$1.codePointAt(START$7)(character), Option.getOrElse(() => START$7), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
|
|
13531
13473
|
const problemOf$1 = (file, source) => (found) => {
|
|
13532
|
-
const hex = hexOf(found[START$
|
|
13474
|
+
const hex = hexOf(found[START$7]);
|
|
13533
13475
|
return {
|
|
13534
13476
|
file,
|
|
13535
|
-
...positionOf(source)(found.index ?? START$
|
|
13536
|
-
rule: RULE$
|
|
13477
|
+
...positionOf(source)(found.index ?? START$7),
|
|
13478
|
+
rule: RULE$8,
|
|
13537
13479
|
message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
|
|
13538
13480
|
};
|
|
13539
13481
|
};
|
|
13540
|
-
const problemsIn$
|
|
13482
|
+
const problemsIn$4 = (file, source) => {
|
|
13541
13483
|
if (String$1.includes(NUL)(source)) return [];
|
|
13542
13484
|
return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
|
|
13543
13485
|
};
|
|
@@ -13549,25 +13491,25 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
|
|
|
13549
13491
|
const file = files.join(root, name);
|
|
13550
13492
|
return files.readFile(file).pipe(Effect.map(Option.match({
|
|
13551
13493
|
onNone: () => [],
|
|
13552
|
-
onSome: (source) => problemsIn$
|
|
13494
|
+
onSome: (source) => problemsIn$4(file, source)
|
|
13553
13495
|
})));
|
|
13554
13496
|
}, { concurrency: READ_CONCURRENCY$1 });
|
|
13555
13497
|
return Array.flatten(found);
|
|
13556
13498
|
});
|
|
13557
13499
|
// src/features/find-unneeded-files/model/alchemy-patch.ts
|
|
13558
|
-
const RULE$
|
|
13500
|
+
const RULE$7 = "alchemy-patch";
|
|
13559
13501
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
13560
13502
|
const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
|
|
13561
|
-
const START$
|
|
13503
|
+
const START$6 = 0;
|
|
13562
13504
|
const problemOf = (file, position, name) => ({
|
|
13563
13505
|
file,
|
|
13564
13506
|
...position,
|
|
13565
|
-
rule: RULE$
|
|
13507
|
+
rule: RULE$7,
|
|
13566
13508
|
message: `patches ${name}. A patch breaks on every Alchemy release. Define the missing setting as a custom resource in the stack and delete the patch.`
|
|
13567
13509
|
});
|
|
13568
|
-
const problemsIn$
|
|
13510
|
+
const problemsIn$3 = (file, patched) => (source) => {
|
|
13569
13511
|
const at = positionOf(source);
|
|
13570
|
-
const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$
|
|
13512
|
+
const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$6));
|
|
13571
13513
|
return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
|
|
13572
13514
|
};
|
|
13573
13515
|
/** @internal */
|
|
@@ -13577,12 +13519,12 @@ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyP
|
|
|
13577
13519
|
const text = yield* files.readFile(file);
|
|
13578
13520
|
const manifest = yield* workspaceManifest(root);
|
|
13579
13521
|
const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
13580
|
-
return pipe(text, Option.map(problemsIn$
|
|
13522
|
+
return pipe(text, Option.map(problemsIn$3(file, patched)), Option.getOrElse(() => []));
|
|
13581
13523
|
});
|
|
13582
13524
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
13583
13525
|
const MSCH = "@r_masseater/msch";
|
|
13584
13526
|
const SCOPE$1 = "@r_masseater/";
|
|
13585
|
-
const RULE$
|
|
13527
|
+
const RULE$6 = "applied-package";
|
|
13586
13528
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
13587
13529
|
const NOT_FOUND = -1;
|
|
13588
13530
|
const SEPARATOR$2 = "/";
|
|
@@ -13627,7 +13569,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
13627
13569
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
13628
13570
|
file,
|
|
13629
13571
|
...positionOf(source)(index),
|
|
13630
|
-
rule: RULE$
|
|
13572
|
+
rule: RULE$6,
|
|
13631
13573
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
13632
13574
|
});
|
|
13633
13575
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
@@ -13682,7 +13624,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
13682
13624
|
return yield* appliedPackageProblems(root, applied);
|
|
13683
13625
|
});
|
|
13684
13626
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
13685
|
-
const RULE$
|
|
13627
|
+
const RULE$5 = "replaced-tool";
|
|
13686
13628
|
const FIRST$1 = 1;
|
|
13687
13629
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
13688
13630
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -13763,7 +13705,7 @@ const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern
|
|
|
13763
13705
|
file,
|
|
13764
13706
|
line: FIRST$1,
|
|
13765
13707
|
column: FIRST$1,
|
|
13766
|
-
rule: RULE$
|
|
13708
|
+
rule: RULE$5,
|
|
13767
13709
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
13768
13710
|
})));
|
|
13769
13711
|
/** @internal */
|
|
@@ -13792,7 +13734,7 @@ const SETUP_PATTERNS = [
|
|
|
13792
13734
|
];
|
|
13793
13735
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
13794
13736
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
13795
|
-
const START$
|
|
13737
|
+
const START$5 = 0;
|
|
13796
13738
|
const LAST_SEGMENT = 1;
|
|
13797
13739
|
const FIRST_LINE = 1;
|
|
13798
13740
|
const FIRST_COLUMN = 1;
|
|
@@ -13862,7 +13804,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
13862
13804
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
13863
13805
|
return directoriesOf(roots);
|
|
13864
13806
|
});
|
|
13865
|
-
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$
|
|
13807
|
+
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$5), (end) => String$1.slice(START$5, end)(name));
|
|
13866
13808
|
const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
|
|
13867
13809
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
13868
13810
|
const cargoProblems = (present, enabled) => {
|
|
@@ -13897,6 +13839,37 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
13897
13839
|
if (Option.isNone(workspace)) return [];
|
|
13898
13840
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
13899
13841
|
});
|
|
13842
|
+
// src/features/check-effect-diagnostics/model/effect-diagnostics.ts
|
|
13843
|
+
const RULE$4 = "effect-diagnostics-once";
|
|
13844
|
+
const PLUGIN = "@effect/language-service";
|
|
13845
|
+
const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
|
|
13846
|
+
const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
13847
|
+
const START$4 = 0;
|
|
13848
|
+
const Plugin = Schema.Struct({
|
|
13849
|
+
name: Schema.optional(Schema.String),
|
|
13850
|
+
diagnostics: Schema.optional(Schema.Unknown)
|
|
13851
|
+
});
|
|
13852
|
+
const Plugins = Schema.Array(Plugin);
|
|
13853
|
+
const CompilerOptions = Schema.Struct({ plugins: Schema.optional(Plugins) });
|
|
13854
|
+
const Config$1 = Schema.Struct({ compilerOptions: Schema.optional(CompilerOptions) });
|
|
13855
|
+
const decodeConfig = Schema.decodeUnknownOption(Schema.fromJsonString(Config$1));
|
|
13856
|
+
const MESSAGE$1 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics during the type check, and the \`effecttsgo\` lint rules that msch enables report the same ones again. Set \`"diagnostics": false\` on the plugin so that each finding is reported once, by the lint rules, with the severity msch sets.`;
|
|
13857
|
+
const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
|
|
13858
|
+
const problemsIn$2 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array.some(reportsDiagnostics)), Option.map(() => ({
|
|
13859
|
+
file: entry.file,
|
|
13860
|
+
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$4))),
|
|
13861
|
+
rule: RULE$4,
|
|
13862
|
+
message: MESSAGE$1
|
|
13863
|
+
})), Option.toArray);
|
|
13864
|
+
/** @internal */
|
|
13865
|
+
const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* checkEffectDiagnostics(root) {
|
|
13866
|
+
const files = yield* RepositoryFiles;
|
|
13867
|
+
const configs = yield* files.matchingFiles(root, [CONFIG_PATHSPEC, ...EXCLUDED$3]);
|
|
13868
|
+
return yield* scanText(pipe(configs, Array.map((name) => ({
|
|
13869
|
+
name,
|
|
13870
|
+
file: files.join(root, name)
|
|
13871
|
+
}))), problemsIn$2);
|
|
13872
|
+
});
|
|
13900
13873
|
// src/features/check-exact-versions/model/exact-versions.ts
|
|
13901
13874
|
const RULE$3 = "version-range";
|
|
13902
13875
|
const WORKSPACE_FILE = "pnpm-workspace.yaml";
|
|
@@ -14195,7 +14168,10 @@ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root
|
|
|
14195
14168
|
checkNodeVersion(root),
|
|
14196
14169
|
checkPackageScope(root),
|
|
14197
14170
|
checkUnusedWorkspaces(root),
|
|
14198
|
-
checkExactVersions(root)
|
|
14171
|
+
checkExactVersions(root),
|
|
14172
|
+
checkUpstreamExits(root),
|
|
14173
|
+
checkScatteredDeviations(root),
|
|
14174
|
+
checkEffectDiagnostics(root)
|
|
14199
14175
|
], { concurrency: "unbounded" });
|
|
14200
14176
|
return Array.flatten(found);
|
|
14201
14177
|
});
|