@r_masseater/msch 0.86.1 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changed.mjs +2 -2
- package/dist/cli.mjs +251 -312
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/exits.mjs +2 -2
- package/dist/judge.mjs +2 -2
- package/dist/{lookup-report-VID9QVGU.mjs → lookup-report-jWcGgE_D.mjs} +2 -2
- package/dist/{lookup-report-VID9QVGU.mjs.map → lookup-report-jWcGgE_D.mjs.map} +1 -1
- package/dist/{output-DYnV3b5B.mjs → output-DMksIc-0.mjs} +2 -2
- package/dist/{output-DYnV3b5B.mjs.map → output-DMksIc-0.mjs.map} +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{pass-records-6XLhXZL3.mjs → pass-records-fctupGWy.mjs} +2 -2
- package/dist/{pass-records-6XLhXZL3.mjs.map → pass-records-fctupGWy.mjs.map} +1 -1
- package/dist/{problem-OJg859cN.mjs → problem-DGGF-vjW.mjs} +5 -4
- package/dist/problem-DGGF-vjW.mjs.map +1 -0
- package/dist/published.mjs +1 -1
- package/dist/refs.mjs +1 -1
- package/dist/unbumped.mjs +2 -2
- package/dist/{upstream-exits-2ut4fmJv.mjs → upstream-exits-BVey4j2q.mjs} +2 -2
- package/dist/{upstream-exits-2ut4fmJv.mjs.map → upstream-exits-BVey4j2q.mjs.map} +1 -1
- package/dist/upstream.mjs +1 -1
- package/package.json +3 -3
- package/dist/problem-OJg859cN.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as workspaceManifest } from "./workspace-manifest-CAVYfp66.mjs";
|
|
3
|
-
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-
|
|
3
|
+
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-fctupGWy.mjs";
|
|
4
4
|
import { a as groupOf, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-C2gVviac.mjs";
|
|
5
|
-
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-
|
|
5
|
+
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-BVey4j2q.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
|
|
7
7
|
import { a as unmatchedWorkspacePatterns, i as publishedProjects, n as readManifest, o as workspaceDirectories, s as workspaceProjects } from "./dependencies-BAjtDvY4.mjs";
|
|
8
|
-
import { $ as
|
|
8
|
+
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-DGGF-vjW.mjs";
|
|
9
9
|
import { A as keyName, D as workspaceConfigOf, M as nestedValues, N as propertyValue, O as KeySchema, P as stringsIn, _ as VERIFY_TASK, a as entryNameOf, d as deployEntries, g as RUN_TASKS, i as publishedWorkspaces, j as literalOf, k as childrenOf$2, l as workspaceLinks, o as isBinEntry, p as shadcnUiOf, r as packedWorkspaces, s as publicEntriesOf, u as bundledEntries, v as definesTask, y as hasVerifyTask } from "./published-C34bsbOH.mjs";
|
|
10
10
|
import { r as JAPANESE } from "./config-BBdsNPSO.mjs";
|
|
11
11
|
import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
|
|
12
12
|
import { n as baseName$1, r as baseRevision, t as manifestTexts } from "./manifest-texts-C6Qjv0xy.mjs";
|
|
13
13
|
import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-CSbML0KF.mjs";
|
|
14
|
-
import { a as offsetIn$1, i as namedCatalogsOf, n as manifestPattern, o as quoted$
|
|
14
|
+
import { a as offsetIn$1, i as namedCatalogsOf, n as manifestPattern, o as quoted$1, r as manifestSpecifiers, s as specifiedIn, t as fieldsOf } from "./specifiers-D9L0OV3r.mjs";
|
|
15
15
|
import { t as checkPackageVersions } from "./package-versions-G9Unih6I.mjs";
|
|
16
|
-
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-
|
|
16
|
+
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-DMksIc-0.mjs";
|
|
17
17
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
18
18
|
import "./cli-contract-D7btWrEu.mjs";
|
|
19
19
|
import { builtinModules } from "node:module";
|
|
@@ -22,7 +22,7 @@ import { Array as Array$1, Boolean as Boolean$1, Context, Effect, FileSystem, Ha
|
|
|
22
22
|
import { lockedGraph, lockedPackageIds, parseDependencyPath, updateWorkspaceManifest } from "@r_masseater/kestrion/pnpm";
|
|
23
23
|
import { ChildProcess } from "effect/process";
|
|
24
24
|
import { parse, resolveConfigFromFile } from "vite-plus";
|
|
25
|
-
import {
|
|
25
|
+
import { PACKAGE_JSON_FILE, RUNTIME_SECTIONS, binEntriesOf, namesIn, optionalPeerNames, runtimeDependencyNames, targetsIn } from "@r_masseater/kestrion";
|
|
26
26
|
import { decodePackageJson } from "@r_masseater/kestrion/npm";
|
|
27
27
|
import { fileURLToPath } from "node:url";
|
|
28
28
|
import { getStaticTOMLValue, parseTOML } from "toml-eslint-parser";
|
|
@@ -499,15 +499,15 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
499
499
|
// src/features/check-overrides/model/git-subpath.ts
|
|
500
500
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
501
501
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
502
|
-
const RULE$
|
|
502
|
+
const RULE$70 = "git-subpath-dependency";
|
|
503
503
|
const WHOLE_MATCH$4 = 0;
|
|
504
|
-
const problemAt$
|
|
504
|
+
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
505
505
|
file,
|
|
506
506
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
507
|
-
rule: RULE$
|
|
507
|
+
rule: RULE$70,
|
|
508
508
|
message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
|
|
509
509
|
});
|
|
510
|
-
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$
|
|
510
|
+
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
511
511
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
512
512
|
/** @internal */
|
|
513
513
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
@@ -515,13 +515,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
515
515
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$23);
|
|
516
516
|
});
|
|
517
517
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
518
|
-
const RULE$
|
|
518
|
+
const RULE$69 = "unnamed-restriction";
|
|
519
519
|
const WHOLE_MATCH$3 = 0;
|
|
520
520
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
521
521
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
522
522
|
file: entry.file,
|
|
523
523
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
524
|
-
rule: RULE$
|
|
524
|
+
rule: RULE$69,
|
|
525
525
|
message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
|
|
526
526
|
})));
|
|
527
527
|
/** @internal */
|
|
@@ -530,13 +530,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
530
530
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
|
|
531
531
|
});
|
|
532
532
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
533
|
-
const RULE$
|
|
533
|
+
const RULE$68 = "named-type-exemption";
|
|
534
534
|
const WHOLE_MATCH$2 = 0;
|
|
535
535
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
536
536
|
const problemsIn$21 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
537
537
|
file: entry.file,
|
|
538
538
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
539
|
-
rule: RULE$
|
|
539
|
+
rule: RULE$68,
|
|
540
540
|
message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
|
|
541
541
|
})));
|
|
542
542
|
/** @internal */
|
|
@@ -545,7 +545,7 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
|
|
|
545
545
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$21);
|
|
546
546
|
});
|
|
547
547
|
// src/features/check-overrides/model/package-registry.ts
|
|
548
|
-
const RULE$
|
|
548
|
+
const RULE$67 = "package-registry";
|
|
549
549
|
const REGISTRY = "https://npm.flatt.tech/";
|
|
550
550
|
const TRAILING_SLASH = /\/$/u;
|
|
551
551
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
@@ -562,7 +562,7 @@ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ inde
|
|
|
562
562
|
const workspaceProblem = (file, source, registry) => ({
|
|
563
563
|
file,
|
|
564
564
|
...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
|
|
565
|
-
rule: RULE$
|
|
565
|
+
rule: RULE$67,
|
|
566
566
|
message: Option.match(registry, {
|
|
567
567
|
onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
|
|
568
568
|
onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
|
|
@@ -571,7 +571,7 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
571
571
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isGuarded)), Array$1.map((found) => ({
|
|
572
572
|
file: entry.file,
|
|
573
573
|
...positionOf(source)(found.index ?? START$28),
|
|
574
|
-
rule: RULE$
|
|
574
|
+
rule: RULE$67,
|
|
575
575
|
message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$28])}\`. Remove the line.`
|
|
576
576
|
})));
|
|
577
577
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
@@ -2698,7 +2698,7 @@ const matcher = (patterns) => {
|
|
|
2698
2698
|
String$1.startsWith(NEGATION$2);
|
|
2699
2699
|
String$1.slice(1);
|
|
2700
2700
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
2701
|
-
const RULE$
|
|
2701
|
+
const RULE$66 = "colocated-git-patterns";
|
|
2702
2702
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
2703
2703
|
const ROOT$3 = ".";
|
|
2704
2704
|
const NEGATION$1 = "!";
|
|
@@ -2709,7 +2709,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
2709
2709
|
const TRAILING_SLASHES = /\/+$/u;
|
|
2710
2710
|
const SPACES = /\s+/u;
|
|
2711
2711
|
const FIRST$23 = 1;
|
|
2712
|
-
const READ_CONCURRENCY$
|
|
2712
|
+
const READ_CONCURRENCY$33 = 16;
|
|
2713
2713
|
const withoutPrefix = (prefix, text) => {
|
|
2714
2714
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
2715
2715
|
return text;
|
|
@@ -2745,7 +2745,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
2745
2745
|
const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
|
|
2746
2746
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
2747
2747
|
});
|
|
2748
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
2748
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$66)(entry.file, {
|
|
2749
2749
|
line: entry.line,
|
|
2750
2750
|
column: FIRST$23
|
|
2751
2751
|
}, message);
|
|
@@ -2800,10 +2800,10 @@ const repeated = (entries) => (entry) => {
|
|
|
2800
2800
|
/** @internal */
|
|
2801
2801
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
2802
2802
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
2803
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$
|
|
2803
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$33 });
|
|
2804
2804
|
const entries = Array$1.flatten(read);
|
|
2805
2805
|
const workspaces = yield* workspaceDirectories(root);
|
|
2806
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
2806
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$33 });
|
|
2807
2807
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
2808
2808
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
2809
2809
|
});
|
|
@@ -2827,9 +2827,9 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
2827
2827
|
})), Option.getOrElse(() => [])));
|
|
2828
2828
|
});
|
|
2829
2829
|
// src/features/check-placement/model/colocated-tests.ts
|
|
2830
|
-
const RULE$
|
|
2830
|
+
const RULE$65 = "colocated-test";
|
|
2831
2831
|
const FIRST$22 = 1;
|
|
2832
|
-
const READ_CONCURRENCY$
|
|
2832
|
+
const READ_CONCURRENCY$32 = 64;
|
|
2833
2833
|
const ROOT_SUBPATH$1 = ".";
|
|
2834
2834
|
const NAME_GROUP = "name";
|
|
2835
2835
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -2850,7 +2850,7 @@ const problemFor$9 = (test, message) => ({
|
|
|
2850
2850
|
file: test.file,
|
|
2851
2851
|
line: FIRST$22,
|
|
2852
2852
|
column: FIRST$22,
|
|
2853
|
-
rule: RULE$
|
|
2853
|
+
rule: RULE$65,
|
|
2854
2854
|
message: `${test.base} ${message}`
|
|
2855
2855
|
});
|
|
2856
2856
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
@@ -2913,12 +2913,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
2913
2913
|
directory: files.dirname(file)
|
|
2914
2914
|
};
|
|
2915
2915
|
}));
|
|
2916
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
2916
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$32 });
|
|
2917
2917
|
return Array$1.getSomes(found);
|
|
2918
2918
|
});
|
|
2919
2919
|
// src/shared/lib/agent-docs.ts
|
|
2920
2920
|
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
2921
|
-
const READ_CONCURRENCY$
|
|
2921
|
+
const READ_CONCURRENCY$31 = 16;
|
|
2922
2922
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
2923
2923
|
const files = yield* RepositoryFiles;
|
|
2924
2924
|
const listed = yield* files.listedFiles(root);
|
|
@@ -2927,13 +2927,13 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
2927
2927
|
const file = files.join(root, name);
|
|
2928
2928
|
const problemOf = Option.flatMap(problemIn(file));
|
|
2929
2929
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
2930
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
2930
|
+
}, { concurrency: READ_CONCURRENCY$31 });
|
|
2931
2931
|
return Array$1.getSomes(found);
|
|
2932
2932
|
});
|
|
2933
2933
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
2934
2934
|
const RECOMMENDED_LINES = 200;
|
|
2935
2935
|
const FIRST$21 = 1;
|
|
2936
|
-
const RULE$
|
|
2936
|
+
const RULE$64 = "agent-docs-length";
|
|
2937
2937
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
2938
2938
|
const problemFor$8 = (file) => (lines) => {
|
|
2939
2939
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -2941,18 +2941,18 @@ const problemFor$8 = (file) => (lines) => {
|
|
|
2941
2941
|
file,
|
|
2942
2942
|
line: 201,
|
|
2943
2943
|
column: FIRST$21,
|
|
2944
|
-
rule: RULE$
|
|
2944
|
+
rule: RULE$64,
|
|
2945
2945
|
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.`
|
|
2946
2946
|
});
|
|
2947
2947
|
};
|
|
2948
2948
|
/** @internal */
|
|
2949
2949
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
|
|
2950
2950
|
// src/features/check-placement/model/claude-link.ts
|
|
2951
|
-
const RULE$
|
|
2951
|
+
const RULE$63 = "claude-md-link";
|
|
2952
2952
|
const CLAUDE = "CLAUDE.md";
|
|
2953
2953
|
const AGENTS = "AGENTS.md";
|
|
2954
2954
|
const FIRST$20 = 1;
|
|
2955
|
-
const READ_CONCURRENCY$
|
|
2955
|
+
const READ_CONCURRENCY$30 = 16;
|
|
2956
2956
|
const MESSAGE$19 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
2957
2957
|
/** @internal */
|
|
2958
2958
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -2967,19 +2967,19 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
2967
2967
|
file: path,
|
|
2968
2968
|
line: FIRST$20,
|
|
2969
2969
|
column: FIRST$20,
|
|
2970
|
-
rule: RULE$
|
|
2970
|
+
rule: RULE$63,
|
|
2971
2971
|
message: MESSAGE$19
|
|
2972
2972
|
})));
|
|
2973
2973
|
});
|
|
2974
2974
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
2975
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
2975
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$30 });
|
|
2976
2976
|
return Array$1.getSomes(found);
|
|
2977
2977
|
});
|
|
2978
2978
|
// src/features/check-placement/model/dangling-links.ts
|
|
2979
|
-
const RULE$
|
|
2979
|
+
const RULE$62 = "dangling-link";
|
|
2980
2980
|
const SEPARATOR$21 = "/";
|
|
2981
2981
|
const FIRST$19 = 1;
|
|
2982
|
-
const READ_CONCURRENCY$
|
|
2982
|
+
const READ_CONCURRENCY$29 = 16;
|
|
2983
2983
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$21}`)(name);
|
|
2984
2984
|
/** @internal */
|
|
2985
2985
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -2992,11 +2992,11 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
2992
2992
|
file,
|
|
2993
2993
|
line: FIRST$19,
|
|
2994
2994
|
column: FIRST$19,
|
|
2995
|
-
rule: RULE$
|
|
2995
|
+
rule: RULE$62,
|
|
2996
2996
|
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.`
|
|
2997
2997
|
})));
|
|
2998
2998
|
});
|
|
2999
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
2999
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$29 });
|
|
3000
3000
|
return Array$1.getSomes(found);
|
|
3001
3001
|
});
|
|
3002
3002
|
// src/features/check-placement/model/member-sources.ts
|
|
@@ -3050,9 +3050,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3050
3050
|
}));
|
|
3051
3051
|
});
|
|
3052
3052
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3053
|
-
const RULE$
|
|
3053
|
+
const RULE$61 = "deployed-readme";
|
|
3054
3054
|
const ROOT_DIRECTORY$4 = "";
|
|
3055
|
-
const READ_CONCURRENCY$
|
|
3055
|
+
const READ_CONCURRENCY$28 = 16;
|
|
3056
3056
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
3057
3057
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3058
3058
|
const ADDRESS_KEYS = [
|
|
@@ -3090,14 +3090,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3090
3090
|
const readme = yield* readReadme({
|
|
3091
3091
|
root,
|
|
3092
3092
|
directory,
|
|
3093
|
-
rule: RULE$
|
|
3093
|
+
rule: RULE$61,
|
|
3094
3094
|
missingMessage: MISSING_MESSAGE$2
|
|
3095
3095
|
});
|
|
3096
3096
|
return Result.match(readme, {
|
|
3097
3097
|
onFailure: Option.some,
|
|
3098
3098
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3099
3099
|
file,
|
|
3100
|
-
rule: RULE$
|
|
3100
|
+
rule: RULE$61,
|
|
3101
3101
|
message: NO_URL_MESSAGE
|
|
3102
3102
|
})))
|
|
3103
3103
|
});
|
|
@@ -3108,26 +3108,26 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3108
3108
|
const listed = yield* files.listedFiles(root);
|
|
3109
3109
|
const directories = yield* workspaceDirectories(root);
|
|
3110
3110
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3111
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3111
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$28 });
|
|
3112
3112
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3113
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3113
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$28 });
|
|
3114
3114
|
return Array$1.getSomes(found);
|
|
3115
3115
|
});
|
|
3116
3116
|
// src/features/check-placement/model/nested-docs.ts
|
|
3117
|
-
const RULE$
|
|
3117
|
+
const RULE$60 = "nested-docs";
|
|
3118
3118
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
3119
3119
|
const SEPARATOR$19 = "/";
|
|
3120
|
-
const READ_CONCURRENCY$
|
|
3120
|
+
const READ_CONCURRENCY$27 = 64;
|
|
3121
3121
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3122
3122
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3123
3123
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
3124
|
-
const MANIFEST$
|
|
3124
|
+
const MANIFEST$2 = "package.json";
|
|
3125
3125
|
const MISSING_RULE = "workspace-agents-md";
|
|
3126
3126
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3127
3127
|
const taggedError$6 = Schema.TaggedError;
|
|
3128
3128
|
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3129
3129
|
const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
|
|
3130
|
-
const problemFor$7 = problemInFile(RULE$
|
|
3130
|
+
const problemFor$7 = problemInFile(RULE$60);
|
|
3131
3131
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3132
3132
|
const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
|
|
3133
3133
|
const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
|
|
@@ -3141,7 +3141,7 @@ const readmeProblem = ({ file, base, directory }, allowed) => {
|
|
|
3141
3141
|
if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
|
|
3142
3142
|
return Option.some(problemFor$7(file, `${base} ${README_MESSAGE}`));
|
|
3143
3143
|
};
|
|
3144
|
-
const missingProblems = ({ required, directories, present, join }) => pipe(directories, Array$1.filter((directory) => required && !HashSet.has(present, join(directory, WORKSPACE_AGENT_DOC))), Array$1.map((directory) => problemInFile(MISSING_RULE)(join(directory, MANIFEST$
|
|
3144
|
+
const missingProblems = ({ required, directories, present, join }) => pipe(directories, Array$1.filter((directory) => required && !HashSet.has(present, join(directory, WORKSPACE_AGENT_DOC))), Array$1.map((directory) => problemInFile(MISSING_RULE)(join(directory, MANIFEST$2), MISSING_MESSAGE$1)));
|
|
3145
3145
|
const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
|
|
3146
3146
|
const files = yield* RepositoryFiles;
|
|
3147
3147
|
const file = files.join(root, name);
|
|
@@ -3174,7 +3174,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3174
3174
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3175
3175
|
workspaceAgentDocs
|
|
3176
3176
|
};
|
|
3177
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3177
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$27 });
|
|
3178
3178
|
const missing = missingProblems({
|
|
3179
3179
|
required: workspaceAgentDocs,
|
|
3180
3180
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3184,15 +3184,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3184
3184
|
return [...Array$1.getSomes(found), ...missing];
|
|
3185
3185
|
});
|
|
3186
3186
|
// src/features/check-placement/model/published-readme.ts
|
|
3187
|
-
const RULE$
|
|
3188
|
-
const READ_CONCURRENCY$
|
|
3187
|
+
const RULE$59 = "published-readme";
|
|
3188
|
+
const READ_CONCURRENCY$26 = 16;
|
|
3189
3189
|
const MESSAGE$18 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3190
3190
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3191
3191
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3192
3192
|
const readme = yield* readReadme({
|
|
3193
3193
|
root,
|
|
3194
3194
|
directory,
|
|
3195
|
-
rule: RULE$
|
|
3195
|
+
rule: RULE$59,
|
|
3196
3196
|
missingMessage: MISSING_MESSAGE
|
|
3197
3197
|
});
|
|
3198
3198
|
return Result.match(readme, {
|
|
@@ -3203,7 +3203,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3203
3203
|
file,
|
|
3204
3204
|
line,
|
|
3205
3205
|
column,
|
|
3206
|
-
rule: RULE$
|
|
3206
|
+
rule: RULE$59,
|
|
3207
3207
|
message: MESSAGE$18
|
|
3208
3208
|
};
|
|
3209
3209
|
}))
|
|
@@ -3212,11 +3212,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3212
3212
|
/** @internal */
|
|
3213
3213
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3214
3214
|
const projects = yield* publishedProjects(root);
|
|
3215
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3215
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$26 });
|
|
3216
3216
|
return Array$1.getSomes(found);
|
|
3217
3217
|
});
|
|
3218
3218
|
// src/features/check-placement/model/published-tests.ts
|
|
3219
|
-
const RULE$
|
|
3219
|
+
const RULE$58 = "published-tests";
|
|
3220
3220
|
const FILE_START = 1;
|
|
3221
3221
|
const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3222
3222
|
const MESSAGE$17 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3230,7 +3230,7 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3230
3230
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3231
3231
|
line: FILE_START,
|
|
3232
3232
|
column: FILE_START,
|
|
3233
|
-
rule: RULE$
|
|
3233
|
+
rule: RULE$58,
|
|
3234
3234
|
message: MESSAGE$17
|
|
3235
3235
|
});
|
|
3236
3236
|
});
|
|
@@ -3244,7 +3244,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3244
3244
|
return Array$1.getSomes(found);
|
|
3245
3245
|
});
|
|
3246
3246
|
// src/features/check-placement/model/root-docs.ts
|
|
3247
|
-
const RULE$
|
|
3247
|
+
const RULE$57 = "root-docs";
|
|
3248
3248
|
const SEPARATOR$18 = "/";
|
|
3249
3249
|
const FIRST$17 = 1;
|
|
3250
3250
|
const MARKDOWN$2 = /\.(?:md|mdx|markdown)$/iu;
|
|
@@ -3259,14 +3259,14 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3259
3259
|
file: files.join(root, name),
|
|
3260
3260
|
line: FIRST$17,
|
|
3261
3261
|
column: FIRST$17,
|
|
3262
|
-
rule: RULE$
|
|
3262
|
+
rule: RULE$57,
|
|
3263
3263
|
message: `${name} ${MESSAGE$16}`
|
|
3264
3264
|
})));
|
|
3265
3265
|
});
|
|
3266
3266
|
// src/features/check-placement/model/root-readme.ts
|
|
3267
|
-
const RULE$
|
|
3267
|
+
const RULE$56 = "root-readme";
|
|
3268
3268
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3269
|
-
const READ_CONCURRENCY$
|
|
3269
|
+
const READ_CONCURRENCY$25 = 16;
|
|
3270
3270
|
const START$27 = 0;
|
|
3271
3271
|
const CHECK_POLICY = "@r_masseater/msch";
|
|
3272
3272
|
const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
|
|
@@ -3308,7 +3308,7 @@ const problemsIn$20 = (file, source, plugins) => (workspace) => {
|
|
|
3308
3308
|
const message = messageFor$2(workspace.directory);
|
|
3309
3309
|
const at = positionOf(source);
|
|
3310
3310
|
const pattern = patternFor(plugins)(workspace);
|
|
3311
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
3311
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$56)(file, at(found.index ?? START$27), message)));
|
|
3312
3312
|
};
|
|
3313
3313
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
3314
3314
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -3325,7 +3325,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
3325
3325
|
const named = yield* namedWorkspaces(root);
|
|
3326
3326
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
3327
3327
|
const plugins = yield* marketplacePlugins(root);
|
|
3328
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
3328
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$25 });
|
|
3329
3329
|
return Array$1.flatten(found);
|
|
3330
3330
|
});
|
|
3331
3331
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -3345,10 +3345,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
3345
3345
|
return Array$1.flatten(found);
|
|
3346
3346
|
});
|
|
3347
3347
|
// src/features/check-placement/model/docs-mirror.ts
|
|
3348
|
-
const RULE$
|
|
3348
|
+
const RULE$55 = "docs-mirror";
|
|
3349
3349
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
3350
3350
|
const MIRROR_LIMIT = 3;
|
|
3351
|
-
const READ_CONCURRENCY$
|
|
3351
|
+
const READ_CONCURRENCY$24 = 16;
|
|
3352
3352
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
3353
3353
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
3354
3354
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -3370,7 +3370,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
3370
3370
|
file,
|
|
3371
3371
|
line,
|
|
3372
3372
|
column,
|
|
3373
|
-
rule: RULE$
|
|
3373
|
+
rule: RULE$55,
|
|
3374
3374
|
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.`
|
|
3375
3375
|
};
|
|
3376
3376
|
}), Option.toArray);
|
|
@@ -3385,7 +3385,7 @@ const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
3385
3385
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
3386
3386
|
directory,
|
|
3387
3387
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
3388
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
3388
|
+
}))), { concurrency: READ_CONCURRENCY$24 });
|
|
3389
3389
|
});
|
|
3390
3390
|
/** @internal */
|
|
3391
3391
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -3398,11 +3398,11 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
3398
3398
|
onNone: () => [],
|
|
3399
3399
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
3400
3400
|
})));
|
|
3401
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3401
|
+
}, { concurrency: READ_CONCURRENCY$24 });
|
|
3402
3402
|
return Array$1.flatten(found);
|
|
3403
3403
|
});
|
|
3404
3404
|
// src/features/check-placement/model/ignored-sources.ts
|
|
3405
|
-
const RULE$
|
|
3405
|
+
const RULE$54 = "ignored-sources";
|
|
3406
3406
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
3407
3407
|
const FIRST$16 = 1;
|
|
3408
3408
|
const MESSAGE$15 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -3414,7 +3414,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
3414
3414
|
file: files.join(root, file),
|
|
3415
3415
|
line: FIRST$16,
|
|
3416
3416
|
column: FIRST$16,
|
|
3417
|
-
rule: RULE$
|
|
3417
|
+
rule: RULE$54,
|
|
3418
3418
|
message: MESSAGE$15
|
|
3419
3419
|
})));
|
|
3420
3420
|
});
|
|
@@ -3454,7 +3454,7 @@ const LAYERS = [
|
|
|
3454
3454
|
];
|
|
3455
3455
|
const RUST_FILE = /\.rs$/u;
|
|
3456
3456
|
const BINARY = /^src\/bin\/[^/]+\.rs$/u;
|
|
3457
|
-
const MANIFEST$
|
|
3457
|
+
const MANIFEST$1 = /(?:^|\/)Cargo\.toml$/u;
|
|
3458
3458
|
const MODULE_INDEX = "mod";
|
|
3459
3459
|
const CRATE_ROOTS = ["src/lib.rs", "src/main.rs"];
|
|
3460
3460
|
const OUTSIDE_ALLOWED = /^(?:build\.rs|benches\/.+)$/u;
|
|
@@ -3470,7 +3470,7 @@ const LAYER_DEPTH = 1;
|
|
|
3470
3470
|
const SOURCE_PREFIX$1 = `src/`;
|
|
3471
3471
|
const ROOT_CRATE = "";
|
|
3472
3472
|
const byLength = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3473
|
-
const crateDirectories = (listed) => pipe(listed, Array$1.filter((name) => MANIFEST$
|
|
3473
|
+
const crateDirectories = (listed) => pipe(listed, Array$1.filter((name) => MANIFEST$1.test(name)), Array$1.map((name) => String$1.replace(MANIFEST$1, "")(name)));
|
|
3474
3474
|
const ownedBy = (crate, name) => {
|
|
3475
3475
|
if (crate === ROOT_CRATE) return {
|
|
3476
3476
|
crate,
|
|
@@ -12057,7 +12057,7 @@ const LAYER_ITEMS = [
|
|
|
12057
12057
|
"attribute_item",
|
|
12058
12058
|
"inner_attribute_item"
|
|
12059
12059
|
];
|
|
12060
|
-
const READ_CONCURRENCY$
|
|
12060
|
+
const READ_CONCURRENCY$23 = 64;
|
|
12061
12061
|
const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12062
12062
|
const NONE$1 = [];
|
|
12063
12063
|
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.";
|
|
@@ -12133,17 +12133,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12133
12133
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$1;
|
|
12134
12134
|
const language = yield* loadLanguage(GRAMMAR).pipe(Effect.orDie);
|
|
12135
12135
|
const parse = parsedWith(language);
|
|
12136
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
12136
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$23 });
|
|
12137
12137
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12138
12138
|
});
|
|
12139
12139
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12140
|
-
const RULE$
|
|
12140
|
+
const RULE$53 = "shadcn-ui-alias";
|
|
12141
12141
|
const FIRST$15 = 1;
|
|
12142
12142
|
const problemOf$10 = (directory, { file, alias }) => ({
|
|
12143
12143
|
file,
|
|
12144
12144
|
line: FIRST$15,
|
|
12145
12145
|
column: FIRST$15,
|
|
12146
|
-
rule: RULE$
|
|
12146
|
+
rule: RULE$53,
|
|
12147
12147
|
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/*".`
|
|
12148
12148
|
});
|
|
12149
12149
|
/** @internal */
|
|
@@ -12206,7 +12206,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12206
12206
|
const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
12207
12207
|
const SEPARATOR$15 = "/";
|
|
12208
12208
|
const CURRENT = "./";
|
|
12209
|
-
const READ_CONCURRENCY$
|
|
12209
|
+
const READ_CONCURRENCY$22 = 8;
|
|
12210
12210
|
const FIRST$14 = 1;
|
|
12211
12211
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12212
12212
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -12221,7 +12221,7 @@ const runsIn = ({ text, start }) => pipe(Array$1.fromIterable(String$1.matchAll(
|
|
|
12221
12221
|
start
|
|
12222
12222
|
})), Option.toArray)));
|
|
12223
12223
|
const targetPaths = (held) => pipe(targetsIn(held), Array$1.map(withoutCurrent));
|
|
12224
|
-
const entriesOf$
|
|
12224
|
+
const entriesOf$1 = (manifest) => {
|
|
12225
12225
|
const bins = targetPaths(manifest.bin);
|
|
12226
12226
|
return {
|
|
12227
12227
|
all: [
|
|
@@ -12235,7 +12235,7 @@ const entriesOf$2 = (manifest) => {
|
|
|
12235
12235
|
const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
|
|
12236
12236
|
const files = yield* RepositoryFiles;
|
|
12237
12237
|
const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));
|
|
12238
|
-
return pipe(text, Option.flatMap(decodePackageJson), Option.map(entriesOf$
|
|
12238
|
+
return pipe(text, Option.flatMap(decodePackageJson), Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
|
|
12239
12239
|
});
|
|
12240
12240
|
const isCommand$1 = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
12241
12241
|
const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
@@ -12247,7 +12247,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12247
12247
|
const files = yield* RepositoryFiles;
|
|
12248
12248
|
const listed = yield* files.listedFiles(root);
|
|
12249
12249
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
|
|
12250
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
12250
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$22 });
|
|
12251
12251
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12252
12252
|
});
|
|
12253
12253
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$15));
|
|
@@ -12297,8 +12297,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
12297
12297
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
12298
12298
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
12299
12299
|
const workflows = yield* workflowText(root);
|
|
12300
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
12301
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12300
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$22 });
|
|
12301
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
12302
12302
|
return [...Array$1.flatten(found), ...Array$1.getSomes(scripts)];
|
|
12303
12303
|
});
|
|
12304
12304
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
@@ -12308,8 +12308,8 @@ const firstIndex = (source, needles) => {
|
|
|
12308
12308
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
12309
12309
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
12310
12310
|
};
|
|
12311
|
-
const quoted
|
|
12312
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted
|
|
12311
|
+
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
12312
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$26));
|
|
12313
12313
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
12314
12314
|
const MEMBER_LISTS = [
|
|
12315
12315
|
"members",
|
|
@@ -12326,16 +12326,16 @@ const PATCH = "patch";
|
|
|
12326
12326
|
const PATCH_DEPTH = 2;
|
|
12327
12327
|
const WORKSPACE_DEPTH = 1;
|
|
12328
12328
|
const START$25 = 0;
|
|
12329
|
-
const WILDCARD$
|
|
12329
|
+
const WILDCARD$4 = /[*?[]/u;
|
|
12330
12330
|
const KEY_SEPARATOR = ".";
|
|
12331
12331
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
12332
|
-
const decodeStrings
|
|
12332
|
+
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
12333
12333
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
12334
12334
|
const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$25).pipe(Option.exists((name) => name === PATCH));
|
|
12335
12335
|
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$25).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
|
|
12336
12336
|
const namedPaths = (trail, key, value) => {
|
|
12337
12337
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR);
|
|
12338
|
-
if (listsMembers(trail, key)) return pipe(decodeStrings
|
|
12338
|
+
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
12339
12339
|
field,
|
|
12340
12340
|
target: member
|
|
12341
12341
|
})));
|
|
@@ -12354,7 +12354,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
12354
12354
|
index: indexOfText(source)(target)
|
|
12355
12355
|
})));
|
|
12356
12356
|
// src/features/check-repository-layout/model/path-existence.ts
|
|
12357
|
-
const WILDCARD$
|
|
12357
|
+
const WILDCARD$3 = /[*?[]/u;
|
|
12358
12358
|
const SEPARATOR$14 = "/";
|
|
12359
12359
|
const FIRST$13 = 0;
|
|
12360
12360
|
/** @internal */
|
|
@@ -12370,7 +12370,7 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
|
|
|
12370
12370
|
});
|
|
12371
12371
|
/** @internal */
|
|
12372
12372
|
const staticPrefix = (path) => {
|
|
12373
|
-
const prefix = Array$1.headNonEmpty(String$1.split(path, WILDCARD$
|
|
12373
|
+
const prefix = Array$1.headNonEmpty(String$1.split(path, WILDCARD$3));
|
|
12374
12374
|
if (String$1.endsWith(SEPARATOR$14)(prefix)) return String$1.slice(FIRST$13, -1)(prefix);
|
|
12375
12375
|
return prefix;
|
|
12376
12376
|
};
|
|
@@ -12383,7 +12383,7 @@ const isIgnored = Effect.fn("isIgnored")(function* isIgnored(root, path) {
|
|
|
12383
12383
|
});
|
|
12384
12384
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
12385
12385
|
const WRAP_OFFSET$2 = 1;
|
|
12386
|
-
const WILDCARD$
|
|
12386
|
+
const WILDCARD$2 = /[*?[{]/u;
|
|
12387
12387
|
const SEPARATOR$13 = "/";
|
|
12388
12388
|
const RELATIVE$1 = ".";
|
|
12389
12389
|
const JSON_EXTENSION = ".json";
|
|
@@ -12392,7 +12392,7 @@ const firstObject = (node) => {
|
|
|
12392
12392
|
if (isObject(node)) return Option.some(node);
|
|
12393
12393
|
return pipe(childrenOf$2(node), Array$1.findFirst(firstObject));
|
|
12394
12394
|
};
|
|
12395
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$13), Array$1.takeWhile((segment) => !WILDCARD$
|
|
12395
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$13), Array$1.takeWhile((segment) => !WILDCARD$2.test(segment)), Array$1.join(SEPARATOR$13));
|
|
12396
12396
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
12397
12397
|
field: name,
|
|
12398
12398
|
text,
|
|
@@ -12419,26 +12419,26 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
12419
12419
|
])));
|
|
12420
12420
|
});
|
|
12421
12421
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
12422
|
-
const RULE$
|
|
12422
|
+
const RULE$52 = "config-path";
|
|
12423
12423
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
12424
12424
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
12425
12425
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
12426
12426
|
const OUTSIDE = "..";
|
|
12427
|
-
const READ_CONCURRENCY$
|
|
12427
|
+
const READ_CONCURRENCY$21 = 8;
|
|
12428
12428
|
const isMissing$2 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
12429
12429
|
const files = yield* RepositoryFiles;
|
|
12430
12430
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
12431
12431
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
12432
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
12432
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$21 });
|
|
12433
12433
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
12434
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
12434
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$21 });
|
|
12435
12435
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
12436
12436
|
});
|
|
12437
12437
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
12438
12438
|
const problemOf$9 = (file, source) => (mention) => ({
|
|
12439
12439
|
file,
|
|
12440
12440
|
...positionOf(source)(mention.index),
|
|
12441
|
-
rule: RULE$
|
|
12441
|
+
rule: RULE$52,
|
|
12442
12442
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
12443
12443
|
});
|
|
12444
12444
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -12451,7 +12451,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
12451
12451
|
const source = yield* files.readFile(file);
|
|
12452
12452
|
if (Option.isNone(source)) return [];
|
|
12453
12453
|
const mentions = yield* mentionsIn(file, source.value);
|
|
12454
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
12454
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$21 });
|
|
12455
12455
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$9(file, source.value)));
|
|
12456
12456
|
});
|
|
12457
12457
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -12463,7 +12463,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
12463
12463
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
12464
12464
|
file,
|
|
12465
12465
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
12466
|
-
rule: RULE$
|
|
12466
|
+
rule: RULE$52,
|
|
12467
12467
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
12468
12468
|
})));
|
|
12469
12469
|
});
|
|
@@ -12471,23 +12471,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
12471
12471
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
12472
12472
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
12473
12473
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
12474
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$18(root, name), { concurrency: READ_CONCURRENCY$
|
|
12474
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$18(root, name), { concurrency: READ_CONCURRENCY$21 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
12475
12475
|
return [...Array$1.flatten(found), ...patterns];
|
|
12476
12476
|
});
|
|
12477
12477
|
// src/features/check-repository-layout/model/crates.ts
|
|
12478
|
-
const RULE$
|
|
12478
|
+
const RULE$51 = "unverified-crate";
|
|
12479
12479
|
const VERSION_RULE = "release-version";
|
|
12480
12480
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
12481
12481
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
12482
12482
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
12483
12483
|
const SEPARATOR$12 = "/";
|
|
12484
12484
|
const FIRST$12 = 1;
|
|
12485
|
-
const READ_CONCURRENCY$
|
|
12485
|
+
const READ_CONCURRENCY$20 = 8;
|
|
12486
12486
|
const problemFor$4 = (crate, message) => ({
|
|
12487
12487
|
file: crate.manifest,
|
|
12488
12488
|
line: FIRST$12,
|
|
12489
12489
|
column: FIRST$12,
|
|
12490
|
-
rule: RULE$
|
|
12490
|
+
rule: RULE$51,
|
|
12491
12491
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
12492
12492
|
});
|
|
12493
12493
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
@@ -12519,11 +12519,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
12519
12519
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
12520
12520
|
const directories = yield* workspaceDirectories(root);
|
|
12521
12521
|
const crates = yield* cratesIn(root);
|
|
12522
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
12522
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$20 });
|
|
12523
12523
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
12524
12524
|
});
|
|
12525
12525
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
12526
|
-
const RULE$
|
|
12526
|
+
const RULE$50 = "deploy-entry-pattern";
|
|
12527
12527
|
const FALLOW_KEYS = [
|
|
12528
12528
|
"entry",
|
|
12529
12529
|
"entryPoints",
|
|
@@ -12541,7 +12541,7 @@ const NEGATED = "!";
|
|
|
12541
12541
|
const ROOT_WORKSPACE = ".";
|
|
12542
12542
|
const WRAP_OFFSET$1 = 1;
|
|
12543
12543
|
const NO_OFFSET = 0;
|
|
12544
|
-
const READ_CONCURRENCY$
|
|
12544
|
+
const READ_CONCURRENCY$19 = 8;
|
|
12545
12545
|
const MESSAGE$14 = "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.";
|
|
12546
12546
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
12547
12547
|
const FALLOW = {
|
|
@@ -12594,7 +12594,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
12594
12594
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
12595
12595
|
file: path,
|
|
12596
12596
|
...positionOf(text.value)(start - kind.offset),
|
|
12597
|
-
rule: RULE$
|
|
12597
|
+
rule: RULE$50,
|
|
12598
12598
|
message: `${pattern} ${MESSAGE$14}`
|
|
12599
12599
|
})));
|
|
12600
12600
|
});
|
|
@@ -12623,21 +12623,21 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
12623
12623
|
kind,
|
|
12624
12624
|
workspaces,
|
|
12625
12625
|
entries
|
|
12626
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
12626
|
+
}), { concurrency: READ_CONCURRENCY$19 });
|
|
12627
12627
|
return Array$1.flatten(found);
|
|
12628
12628
|
});
|
|
12629
12629
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
12630
|
-
const RULE$
|
|
12630
|
+
const RULE$49 = "listed-entry";
|
|
12631
12631
|
const ENTRY_KEYS = [
|
|
12632
12632
|
"entry",
|
|
12633
12633
|
"entryPoints",
|
|
12634
12634
|
"supportEntry"
|
|
12635
12635
|
];
|
|
12636
12636
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
12637
|
-
const WILDCARD$
|
|
12637
|
+
const WILDCARD$1 = /[*?{[]/u;
|
|
12638
12638
|
const SEPARATOR$11 = "/";
|
|
12639
12639
|
const WRAP_OFFSET = 1;
|
|
12640
|
-
const READ_CONCURRENCY$
|
|
12640
|
+
const READ_CONCURRENCY$18 = 8;
|
|
12641
12641
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
12642
12642
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
12643
12643
|
const entryPatternsIn = (node) => {
|
|
@@ -12647,7 +12647,7 @@ const entryPatternsIn = (node) => {
|
|
|
12647
12647
|
})));
|
|
12648
12648
|
return pipe(childrenOf$2(node), Array$1.flatMap(entryPatternsIn));
|
|
12649
12649
|
};
|
|
12650
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$
|
|
12650
|
+
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$1.test(text);
|
|
12651
12651
|
const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
12652
12652
|
const files = yield* RepositoryFiles;
|
|
12653
12653
|
const path = files.join(root, file);
|
|
@@ -12657,7 +12657,7 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
12657
12657
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
12658
12658
|
file: path,
|
|
12659
12659
|
...positionOf(text.value)(start),
|
|
12660
|
-
rule: RULE$
|
|
12660
|
+
rule: RULE$49,
|
|
12661
12661
|
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.`
|
|
12662
12662
|
})));
|
|
12663
12663
|
});
|
|
@@ -12665,11 +12665,11 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
12665
12665
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
12666
12666
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
12667
12667
|
const directories = yield* workspaceDirectories(root);
|
|
12668
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
12668
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$18 });
|
|
12669
12669
|
return Array$1.flatten(found);
|
|
12670
12670
|
});
|
|
12671
12671
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
12672
|
-
const RULE$
|
|
12672
|
+
const RULE$48 = "root-workspace-path";
|
|
12673
12673
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
12674
12674
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
12675
12675
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
@@ -12688,7 +12688,7 @@ const mentions = (directory) => (text) => {
|
|
|
12688
12688
|
const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
12689
12689
|
file,
|
|
12690
12690
|
...positionOf(source)(found.start),
|
|
12691
|
-
rule: RULE$
|
|
12691
|
+
rule: RULE$48,
|
|
12692
12692
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$5} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$5}: msch.lint, msch.devDependencies or its verify task.`
|
|
12693
12693
|
})));
|
|
12694
12694
|
/** @internal */
|
|
@@ -12702,10 +12702,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
12702
12702
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$15(file, source.value, directories)));
|
|
12703
12703
|
});
|
|
12704
12704
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
12705
|
-
const RULE$
|
|
12705
|
+
const RULE$47 = "hidden-verify";
|
|
12706
12706
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
12707
12707
|
const FIRST$10 = 1;
|
|
12708
|
-
const READ_CONCURRENCY$
|
|
12708
|
+
const READ_CONCURRENCY$17 = 8;
|
|
12709
12709
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
12710
12710
|
const config = yield* workspaceConfigOf(root, directory);
|
|
12711
12711
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -12716,19 +12716,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
12716
12716
|
file,
|
|
12717
12717
|
line: FIRST$10,
|
|
12718
12718
|
column: FIRST$10,
|
|
12719
|
-
rule: RULE$
|
|
12719
|
+
rule: RULE$47,
|
|
12720
12720
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
|
|
12721
12721
|
}).pipe(Option.filter(() => verified));
|
|
12722
12722
|
});
|
|
12723
12723
|
/** @internal */
|
|
12724
12724
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
12725
12725
|
const directories = yield* workspaceDirectories(root);
|
|
12726
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12726
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$17 });
|
|
12727
12727
|
return Array$1.getSomes(found);
|
|
12728
12728
|
});
|
|
12729
12729
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
12730
|
-
const RULE$
|
|
12731
|
-
const READ_CONCURRENCY$
|
|
12730
|
+
const RULE$46 = "shared-uncached-task";
|
|
12731
|
+
const READ_CONCURRENCY$16 = 8;
|
|
12732
12732
|
const SHARED = 2;
|
|
12733
12733
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
12734
12734
|
const UncachedTask = Schema.Struct({
|
|
@@ -12770,19 +12770,19 @@ const problemsOf$3 = (definitions) => {
|
|
|
12770
12770
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
12771
12771
|
file,
|
|
12772
12772
|
...position,
|
|
12773
|
-
rule: RULE$
|
|
12773
|
+
rule: RULE$46,
|
|
12774
12774
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
|
|
12775
12775
|
})));
|
|
12776
12776
|
};
|
|
12777
12777
|
/** @internal */
|
|
12778
12778
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
12779
12779
|
const directories = yield* workspaceDirectories(root);
|
|
12780
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12780
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$16 });
|
|
12781
12781
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
12782
12782
|
});
|
|
12783
12783
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
12784
|
-
const RULE$
|
|
12785
|
-
const READ_CONCURRENCY$
|
|
12784
|
+
const RULE$45 = "unlocked-task";
|
|
12785
|
+
const READ_CONCURRENCY$15 = 8;
|
|
12786
12786
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
12787
12787
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
12788
12788
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -12793,13 +12793,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
12793
12793
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
12794
12794
|
file,
|
|
12795
12795
|
...positionOf(source)(task.start),
|
|
12796
|
-
rule: RULE$
|
|
12796
|
+
rule: RULE$45,
|
|
12797
12797
|
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.`
|
|
12798
12798
|
})), Option.toArray)));
|
|
12799
12799
|
/** @internal */
|
|
12800
12800
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
12801
12801
|
const directories = yield* workspaceDirectories(root);
|
|
12802
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
12802
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$15 });
|
|
12803
12803
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
12804
12804
|
});
|
|
12805
12805
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -12835,7 +12835,7 @@ const workingDirectoryOf = (owner) => {
|
|
|
12835
12835
|
const itemsOf = (node) => pipe(Option.liftPredicate(node, isSeq), Option.map((seq) => seq.items), Option.getOrElse(() => []));
|
|
12836
12836
|
const pairsOf = (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => map.items), Option.getOrElse(() => []));
|
|
12837
12837
|
/** @internal */
|
|
12838
|
-
const entriesOf
|
|
12838
|
+
const entriesOf = (node) => pipe(pairsOf(node), Array$1.filter(isTextPair), Array$1.map((pair) => [pair.key.value, pair.value]));
|
|
12839
12839
|
/** @internal */
|
|
12840
12840
|
const scalarsIn = (source) => {
|
|
12841
12841
|
const found = [];
|
|
@@ -12903,7 +12903,7 @@ const linesOf$1 = ({ text, offset }) => pipe(String$1.split(text, LINE$1), Array
|
|
|
12903
12903
|
offset
|
|
12904
12904
|
})));
|
|
12905
12905
|
const fileInputOf = (field) => ([key, value]) => pipe(stringOf(value), Option.toArray, Array$1.flatMap(linesOf$1), Array$1.flatMap(reference("glob", `${field}.with.${key}`)));
|
|
12906
|
-
const fileInputsIn = (field, step) => pipe(entriesOf
|
|
12906
|
+
const fileInputsIn = (field, step) => pipe(entriesOf(childOf("with")(step)), Array$1.filter(isFileInput), Array$1.flatMap(fileInputOf(field)));
|
|
12907
12907
|
const stepReferences = (job, base) => (step, index) => {
|
|
12908
12908
|
const field = `jobs.${job}.steps[${index}]`;
|
|
12909
12909
|
const own = stringOf(childOf("working-directory")(step));
|
|
@@ -12930,14 +12930,14 @@ const groupsOf = (pattern, group) => ({ text, offset }) => pipe(Array$1.fromIter
|
|
|
12930
12930
|
offset
|
|
12931
12931
|
})));
|
|
12932
12932
|
const hashFilesIn = (source) => pipe(scalarsIn(source), Array$1.flatMap(groupsOf(HASH_FILES, "arguments")), Array$1.flatMap(groupsOf(QUOTED$2, "path")), Array$1.filter(isPositive), Array$1.flatMap(reference("glob", "hashFiles")));
|
|
12933
|
-
const jobsOf = (source) => entriesOf
|
|
12933
|
+
const jobsOf = (source) => entriesOf(childOf("jobs")(parseDocument(source).contents));
|
|
12934
12934
|
/** @internal */
|
|
12935
12935
|
const workflowReferences = (source) => {
|
|
12936
12936
|
const root = parseDocument(source).contents;
|
|
12937
12937
|
const workflowDefault = workingDirectoryOf(root);
|
|
12938
12938
|
const base = directoryOf$1(workflowDefault, ROOT$2);
|
|
12939
12939
|
return [
|
|
12940
|
-
...pipe(entriesOf
|
|
12940
|
+
...pipe(entriesOf(childOf("on")(root)), Array$1.flatMap(filtersOf)),
|
|
12941
12941
|
...located("directory", "defaults.run.working-directory")(workflowDefault),
|
|
12942
12942
|
...pipe(jobsOf(source), Array$1.flatMap(jobReferences(base))),
|
|
12943
12943
|
...hashFilesIn(source)
|
|
@@ -12948,10 +12948,10 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
12948
12948
|
/** @internal */
|
|
12949
12949
|
const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
|
|
12950
12950
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
12951
|
-
const RULE$
|
|
12951
|
+
const RULE$44 = "workflow-path";
|
|
12952
12952
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
12953
12953
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
12954
|
-
const READ_CONCURRENCY$
|
|
12954
|
+
const READ_CONCURRENCY$14 = 8;
|
|
12955
12955
|
const SEPARATOR$9 = "/";
|
|
12956
12956
|
const EXPECTED = {
|
|
12957
12957
|
action: "a directory with action.yml",
|
|
@@ -12992,7 +12992,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
12992
12992
|
const problemOf$8 = (file, source) => (found) => ({
|
|
12993
12993
|
file,
|
|
12994
12994
|
...positionOf(source)(found.offset),
|
|
12995
|
-
rule: RULE$
|
|
12995
|
+
rule: RULE$44,
|
|
12996
12996
|
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.`
|
|
12997
12997
|
});
|
|
12998
12998
|
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
@@ -13007,7 +13007,7 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
|
|
|
13007
13007
|
/** @internal */
|
|
13008
13008
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
13009
13009
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13010
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$
|
|
13010
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$14 });
|
|
13011
13011
|
return Array$1.flatten(found);
|
|
13012
13012
|
});
|
|
13013
13013
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -13019,14 +13019,14 @@ const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
|
13019
13019
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
13020
13020
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
13021
13021
|
const START$24 = 0;
|
|
13022
|
-
const READ_CONCURRENCY$
|
|
13022
|
+
const READ_CONCURRENCY$13 = 8;
|
|
13023
13023
|
const SEPARATOR$8 = "/";
|
|
13024
13024
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
13025
13025
|
const SPACE = " ";
|
|
13026
13026
|
const FILTER_MESSAGE = "A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.";
|
|
13027
13027
|
const packageMessage = (what, directory) => `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;
|
|
13028
13028
|
const keysOf = (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => map.items), Option.getOrElse(() => []), Array$1.filter(isPair), Array$1.flatMap(({ key }) => Option.toArray(stringOf(key))));
|
|
13029
|
-
const problemAt$
|
|
13029
|
+
const problemAt$4 = ({ file, source }, rule, message) => (offset) => ({
|
|
13030
13030
|
file,
|
|
13031
13031
|
...positionOf(source)(offset),
|
|
13032
13032
|
rule,
|
|
@@ -13034,9 +13034,9 @@ const problemAt$5 = ({ file, source }, rule, message) => (offset) => ({
|
|
|
13034
13034
|
});
|
|
13035
13035
|
const pathFiltersIn = (file, source) => {
|
|
13036
13036
|
const root = parseDocument(source).contents;
|
|
13037
|
-
const triggers = pipe(entriesOf
|
|
13037
|
+
const triggers = pipe(entriesOf(childOf("on")(root)), Array$1.flatMap(([, trigger]) => keysOf(trigger)), Array$1.filter(({ text }) => Array$1.contains(FILTER_KEYS, text)));
|
|
13038
13038
|
const actions = pipe(scalarsIn(source), Array$1.filter(({ text }) => PATHS_FILTER_ACTION.test(text)));
|
|
13039
|
-
return pipe([...triggers, ...actions], Array$1.map(({ offset }) => problemAt$
|
|
13039
|
+
return pipe([...triggers, ...actions], Array$1.map(({ offset }) => problemAt$4({
|
|
13040
13040
|
file,
|
|
13041
13041
|
source
|
|
13042
13042
|
}, PATH_FILTER, FILTER_MESSAGE)(offset)));
|
|
@@ -13059,7 +13059,7 @@ const filtersIn = (source) => pipe(scalarsIn(source), Array$1.flatMap(({ text, o
|
|
|
13059
13059
|
text: value,
|
|
13060
13060
|
offset
|
|
13061
13061
|
})))));
|
|
13062
|
-
const reported = (where, offset, what) => (found) => pipe(found, Option.map((directory) => problemAt$
|
|
13062
|
+
const reported = (where, offset, what) => (found) => pipe(found, Option.map((directory) => problemAt$4(where, PACKAGE, packageMessage(what, directory))(offset)), Option.toArray);
|
|
13063
13063
|
const packagesIn = (workspaces, { file, name, source }) => {
|
|
13064
13064
|
const where = {
|
|
13065
13065
|
file,
|
|
@@ -13098,7 +13098,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
|
|
|
13098
13098
|
name: stem,
|
|
13099
13099
|
source: text
|
|
13100
13100
|
})]), Option.getOrElse(() => []));
|
|
13101
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13101
|
+
}), { concurrency: READ_CONCURRENCY$13 });
|
|
13102
13102
|
const actions = pipe(listed, Array$1.flatMap((name) => pipe(groupOf("name")(ACTION.exec(name)), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
|
|
13103
13103
|
return [...Array$1.flatten(found), ...actions];
|
|
13104
13104
|
});
|
|
@@ -13131,7 +13131,7 @@ const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$7)
|
|
|
13131
13131
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13132
13132
|
const RELATIVE = /^\.\.?(?:\/|$)/u;
|
|
13133
13133
|
const SUBPATH_IMPORT$1 = "#";
|
|
13134
|
-
const WILDCARD
|
|
13134
|
+
const WILDCARD = "*";
|
|
13135
13135
|
const SOURCE_SUFFIXES = [
|
|
13136
13136
|
"",
|
|
13137
13137
|
".ts",
|
|
@@ -13139,15 +13139,11 @@ const SOURCE_SUFFIXES = [
|
|
|
13139
13139
|
"/index.ts"
|
|
13140
13140
|
];
|
|
13141
13141
|
const isImportMap = Schema.is(Schema.Record(Schema.String, Schema.String));
|
|
13142
|
-
const
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
const typeOnly = pipe(Option.fromUndefinedOr(statement.importClause), Option.exists((clause) => clause.phaseModifier === SyntaxKind.TypeKeyword));
|
|
13146
|
-
return Option.filter(literalText(statement.moduleSpecifier), () => !typeOnly);
|
|
13147
|
-
}
|
|
13148
|
-
if (isExportDeclaration(statement) && !statement.isTypeOnly) return Option.flatMap(Option.fromUndefinedOr(statement.moduleSpecifier), literalText);
|
|
13149
|
-
return Option.none();
|
|
13142
|
+
const isTypeOnly = (statement) => {
|
|
13143
|
+
if (isImportDeclaration(statement)) return pipe(Option.fromUndefinedOr(statement.importClause), Option.exists((clause) => clause.phaseModifier === SyntaxKind.TypeKeyword));
|
|
13144
|
+
return isExportDeclaration(statement) && statement.isTypeOnly;
|
|
13150
13145
|
};
|
|
13146
|
+
const runtimeSpecifierOf = (statement) => Option.filter(moduleSpecifierOf(statement), () => !isTypeOnly(statement));
|
|
13151
13147
|
const specifiersIn = (api, file, text) => {
|
|
13152
13148
|
const retained = api.createSourceFile(file, text);
|
|
13153
13149
|
const found = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.map(runtimeSpecifierOf));
|
|
@@ -13155,9 +13151,9 @@ const specifiersIn = (api, file, text) => {
|
|
|
13155
13151
|
return Array$1.getSomes(found);
|
|
13156
13152
|
};
|
|
13157
13153
|
const subpathTarget = (imports, specifier) => pipe(Record.toEntries(imports), Array$1.findFirst(([pattern, target]) => {
|
|
13158
|
-
if (!String$1.endsWith(WILDCARD
|
|
13159
|
-
const prefix = String$1.replace(WILDCARD
|
|
13160
|
-
return Option.liftPredicate(String$1.replace(WILDCARD
|
|
13154
|
+
if (!String$1.endsWith(WILDCARD)(pattern)) return Option.liftPredicate(target, () => pattern === specifier);
|
|
13155
|
+
const prefix = String$1.replace(WILDCARD, "")(pattern);
|
|
13156
|
+
return Option.liftPredicate(String$1.replace(WILDCARD, String$1.replace(prefix, "")(specifier))(target), () => String$1.startsWith(prefix)(specifier));
|
|
13161
13157
|
}));
|
|
13162
13158
|
const existingSource = Effect.fn("existingSource")(function* existingSource(base) {
|
|
13163
13159
|
const files = yield* RepositoryFiles;
|
|
@@ -13174,18 +13170,18 @@ const localFile = Effect.fn("localFile")(function* localFile({ directory, import
|
|
|
13174
13170
|
if (Option.isNone(target)) return Option.none();
|
|
13175
13171
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
13176
13172
|
});
|
|
13177
|
-
const referenceOf$
|
|
13173
|
+
const referenceOf$2 = (graph, from, specifier) => {
|
|
13178
13174
|
if (RELATIVE.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13179
13175
|
const name = packageNameOf(specifier);
|
|
13180
13176
|
return Effect.succeedSome(Result.fail(name));
|
|
13181
13177
|
};
|
|
13182
|
-
const referencesIn$
|
|
13178
|
+
const referencesIn$1 = Effect.fn("referencesIn")(function* referencesIn(graph, file) {
|
|
13183
13179
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
13184
13180
|
const specifiers = Option.match(text, {
|
|
13185
13181
|
onNone: () => [],
|
|
13186
13182
|
onSome: (source) => specifiersIn(graph.api, file, source)
|
|
13187
13183
|
});
|
|
13188
|
-
const references = yield* Effect.forEach(specifiers, (specifier) => referenceOf$
|
|
13184
|
+
const references = yield* Effect.forEach(specifiers, (specifier) => referenceOf$2(graph, file, specifier), { concurrency: 1 });
|
|
13189
13185
|
const found = Array$1.getSomes(references);
|
|
13190
13186
|
return {
|
|
13191
13187
|
packages: Array$1.getFailures(found),
|
|
@@ -13199,7 +13195,7 @@ const packagesFrom = (graph, walk) => Array$1.match(walk.pending, {
|
|
|
13199
13195
|
...walk,
|
|
13200
13196
|
pending: rest
|
|
13201
13197
|
});
|
|
13202
|
-
return referencesIn$
|
|
13198
|
+
return referencesIn$1(graph, next).pipe(Effect.flatMap(({ packages, sources }) => packagesFrom(graph, {
|
|
13203
13199
|
pending: [...rest, ...sources],
|
|
13204
13200
|
visited: HashSet.add(walk.visited, next),
|
|
13205
13201
|
packages: HashSet.union(walk.packages, HashSet.fromIterable(packages))
|
|
@@ -13394,12 +13390,12 @@ const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* che
|
|
|
13394
13390
|
return Array$1.flatten(found);
|
|
13395
13391
|
});
|
|
13396
13392
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13397
|
-
const RULE$
|
|
13393
|
+
const RULE$43 = "migration-order";
|
|
13398
13394
|
const SNAPSHOT = "snapshot.json";
|
|
13399
13395
|
const MIGRATION = "migration.sql";
|
|
13400
13396
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
13401
13397
|
const FIRST$9 = 1;
|
|
13402
|
-
const READ_CONCURRENCY$
|
|
13398
|
+
const READ_CONCURRENCY$12 = 16;
|
|
13403
13399
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
13404
13400
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
13405
13401
|
const files = yield* RepositoryFiles;
|
|
@@ -13428,7 +13424,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13428
13424
|
file: join(root, file),
|
|
13429
13425
|
line: FIRST$9,
|
|
13430
13426
|
column: FIRST$9,
|
|
13431
|
-
rule: RULE$
|
|
13427
|
+
rule: RULE$43,
|
|
13432
13428
|
message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
|
|
13433
13429
|
})))), Option.getOrElse(() => []));
|
|
13434
13430
|
/** @internal */
|
|
@@ -13439,7 +13435,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
13439
13435
|
if (Option.isNone(found)) return [];
|
|
13440
13436
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
13441
13437
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
13442
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
13438
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$12 });
|
|
13443
13439
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
13444
13440
|
});
|
|
13445
13441
|
// src/shared/lib/bundle-error.ts
|
|
@@ -13572,7 +13568,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
13572
13568
|
});
|
|
13573
13569
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
13574
13570
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
13575
|
-
const RULE$
|
|
13571
|
+
const RULE$42 = "optional-peer";
|
|
13576
13572
|
const REQUIRED_RULE = "required-peer";
|
|
13577
13573
|
const START$22 = 0;
|
|
13578
13574
|
const SINGLE = 1;
|
|
@@ -13588,7 +13584,7 @@ const positionIn = (located, key, name) => {
|
|
|
13588
13584
|
const problemFor$3 = (located, name, importers) => ({
|
|
13589
13585
|
file: located.file,
|
|
13590
13586
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
13591
|
-
rule: RULE$
|
|
13587
|
+
rule: RULE$42,
|
|
13592
13588
|
message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
|
|
13593
13589
|
});
|
|
13594
13590
|
const requiredPeerAdvice = (fromStack) => {
|
|
@@ -13624,7 +13620,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
13624
13620
|
}));
|
|
13625
13621
|
};
|
|
13626
13622
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
13627
|
-
const RULE$
|
|
13623
|
+
const RULE$41 = "side-effects";
|
|
13628
13624
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
13629
13625
|
const START$21 = 0;
|
|
13630
13626
|
const FIRST$8 = 1;
|
|
@@ -13676,13 +13672,13 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
|
|
|
13676
13672
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
13677
13673
|
file,
|
|
13678
13674
|
...positionOf(source)(keyIndex$1(source)),
|
|
13679
|
-
rule: RULE$
|
|
13675
|
+
rule: RULE$41,
|
|
13680
13676
|
message: messageOf$4(worst, excesses.length)
|
|
13681
13677
|
})), Option.toArray);
|
|
13682
13678
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
13683
|
-
const RULE$
|
|
13679
|
+
const RULE$40 = "top-level-effect";
|
|
13684
13680
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
13685
|
-
const READ_CONCURRENCY$
|
|
13681
|
+
const READ_CONCURRENCY$11 = 16;
|
|
13686
13682
|
const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
|
|
13687
13683
|
const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
|
|
13688
13684
|
const isEffect = (statement) => {
|
|
@@ -13695,8 +13691,8 @@ const messageOf$3 = (statement) => {
|
|
|
13695
13691
|
};
|
|
13696
13692
|
const problemsIn$13 = (api) => (file) => (source) => {
|
|
13697
13693
|
const retained = api.createSourceFile(file, source);
|
|
13698
|
-
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$
|
|
13699
|
-
rule: RULE$
|
|
13694
|
+
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
13695
|
+
rule: RULE$40,
|
|
13700
13696
|
message: messageOf$3(statement)
|
|
13701
13697
|
})(statement)));
|
|
13702
13698
|
retained.dispose();
|
|
@@ -13709,7 +13705,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
13709
13705
|
const names = yield* files.ownedFiles(root);
|
|
13710
13706
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
13711
13707
|
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
13712
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$13(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$
|
|
13708
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$13(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$11 });
|
|
13713
13709
|
return Array$1.flatten(found);
|
|
13714
13710
|
}, Effect.scoped);
|
|
13715
13711
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
@@ -13739,7 +13735,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
13739
13735
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
13740
13736
|
const ownedSet = new Set(owned);
|
|
13741
13737
|
const directories = pipe(used, Array$1.flatMap(({ modules }) => modules), Array$1.filter((module) => ownedSet.has(module)), Array$1.flatMap((module) => Option.toArray(packageDirectoryOf(manifests, files)(module))), Array$1.dedupe, Array$1.filter((found) => found !== directory), Array$1.sortBy(Order.String));
|
|
13742
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
13738
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$11 });
|
|
13743
13739
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
13744
13740
|
const index = nameIndex$1(located.source);
|
|
13745
13741
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -13864,7 +13860,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
|
|
|
13864
13860
|
return Array$1.flatten(found);
|
|
13865
13861
|
});
|
|
13866
13862
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
13867
|
-
const RULE$
|
|
13863
|
+
const RULE$39 = "legacy-typescript";
|
|
13868
13864
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
13869
13865
|
const COMPILER = "typescript";
|
|
13870
13866
|
const CURRENT_MAJOR = 7;
|
|
@@ -13895,12 +13891,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
13895
13891
|
file,
|
|
13896
13892
|
line: lineOf$2(source)(legacy.id),
|
|
13897
13893
|
column: FIRST$7,
|
|
13898
|
-
rule: RULE$
|
|
13894
|
+
rule: RULE$39,
|
|
13899
13895
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
13900
13896
|
})));
|
|
13901
13897
|
});
|
|
13902
13898
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
13903
|
-
const RULE$
|
|
13899
|
+
const RULE$38 = "worker-bundle";
|
|
13904
13900
|
const BUNDLE_CONCURRENCY = 4;
|
|
13905
13901
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
13906
13902
|
const CONDITIONS = [
|
|
@@ -13911,7 +13907,7 @@ const CONDITIONS = [
|
|
|
13911
13907
|
"module",
|
|
13912
13908
|
"default"
|
|
13913
13909
|
];
|
|
13914
|
-
const problemFor$2 = problemInFile(RULE$
|
|
13910
|
+
const problemFor$2 = problemInFile(RULE$38);
|
|
13915
13911
|
const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
13916
13912
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
13917
13913
|
const built = yield* Effect.tryPromise({
|
|
@@ -14024,11 +14020,7 @@ const isDefinition = (node) => {
|
|
|
14024
14020
|
return isModuleConstant(node);
|
|
14025
14021
|
};
|
|
14026
14022
|
const isTyped = (checker) => (node) => Option.fromUndefinedOr(checker.getContextualType(node)).pipe(Option.flatMap(finiteValuesOf(checker)), Option.isSome);
|
|
14027
|
-
const
|
|
14028
|
-
if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) return Option.none();
|
|
14029
|
-
return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(isStringLiteral));
|
|
14030
|
-
};
|
|
14031
|
-
const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array$1.map(specifierOf$1), Array$1.getSomes, Array$1.flatMap((specifier) => pipe(symbolAtLocation(checker)(specifier), Option.flatMap((symbol) => Array$1.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array$1.dedupe);
|
|
14023
|
+
const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array$1.map(moduleSpecifierLiteralOf), Array$1.getSomes, Array$1.flatMap((specifier) => pipe(symbolAtLocation(checker)(specifier), Option.flatMap((symbol) => Array$1.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array$1.dedupe);
|
|
14032
14024
|
const freeLiteralsIn = (checker) => (sourceFile, excluded) => pipe(descendantsOf(sourceFile), Array$1.filter((node) => isStringLiteral(node)), Array$1.filter((node) => NAME.test(node.text)), Array$1.filter(isDefinition), Array$1.filter((node) => !isModuleSpecifier(node)), Array$1.filter((node) => !isInsideAny(excluded)(node) && !isTyped(checker)(node)), Array$1.map((node) => node.text), Array$1.dedupe);
|
|
14033
14025
|
const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Array$1.map((sourceFile) => ({
|
|
14034
14026
|
file: sourceFile.fileName,
|
|
@@ -14036,7 +14028,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
14036
14028
|
imports: importedFilesOf(checker)(sourceFile)
|
|
14037
14029
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
14038
14030
|
// src/features/check-value-owners/model/name-lists.ts
|
|
14039
|
-
const RULE$
|
|
14031
|
+
const RULE$37 = "hand-written-names";
|
|
14040
14032
|
const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
14041
14033
|
const nameListOf = (site) => {
|
|
14042
14034
|
if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -14051,7 +14043,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
14051
14043
|
file,
|
|
14052
14044
|
line,
|
|
14053
14045
|
column,
|
|
14054
|
-
rule: RULE$
|
|
14046
|
+
rule: RULE$37,
|
|
14055
14047
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
14056
14048
|
});
|
|
14057
14049
|
const problemOf$6 = ({ list, reason }) => listedProblem({
|
|
@@ -14124,7 +14116,7 @@ const ownerValuesOf = (checker) => (declaration) => {
|
|
|
14124
14116
|
const type = checker.getTypeAtLocation(declaration.name);
|
|
14125
14117
|
return finiteValuesOf(checker)(type).pipe(Option.orElse(() => objectValuesOf(checker)(type)));
|
|
14126
14118
|
};
|
|
14127
|
-
const annotationProblem = (message) => problemAt$
|
|
14119
|
+
const annotationProblem = (message) => problemAt$6({
|
|
14128
14120
|
rule: "owner-annotation",
|
|
14129
14121
|
message
|
|
14130
14122
|
});
|
|
@@ -14260,7 +14252,7 @@ const shapeProblem = (site, matches) => {
|
|
|
14260
14252
|
onNone: () => "Derive it from the library type, for example with Pick, instead of copying its properties.",
|
|
14261
14253
|
onSome: () => "Use the library type instead of copying it."
|
|
14262
14254
|
});
|
|
14263
|
-
return problemAt$
|
|
14255
|
+
return problemAt$6({
|
|
14264
14256
|
rule: "library-shape",
|
|
14265
14257
|
message: `This shape copies ${shown}. ${advice}`
|
|
14266
14258
|
})(site.node);
|
|
@@ -14361,7 +14353,7 @@ const derivedVerdict = (context) => (site) => {
|
|
|
14361
14353
|
const added = pipe(site.values, Array$1.filter((value) => !isSubsetOf([value], held)));
|
|
14362
14354
|
if (!Array$1.isReadonlyArrayNonEmpty(owners) || !Array$1.isReadonlyArrayNonEmpty(added)) return verdict([], []);
|
|
14363
14355
|
const message = `This set adds ${formatValues(added)} to ${describeOwners(owners)}. Add the values to the owner, or register the wider set as its own concept.`;
|
|
14364
|
-
return verdict([problemAt$
|
|
14356
|
+
return verdict([problemAt$6({
|
|
14365
14357
|
rule: "owner-extension",
|
|
14366
14358
|
message
|
|
14367
14359
|
})(site.node)], []);
|
|
@@ -14383,7 +14375,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
14383
14375
|
const owners = pipe(context.owners, Array$1.filter((owner) => isSubsetOf(site.values, owner.values)));
|
|
14384
14376
|
if (Array$1.isReadonlyArrayNonEmpty(owners)) {
|
|
14385
14377
|
const message = `The values ${formatValues(site.values)} are owned by ${describeOwners(owners)}. Derive this set from the owner instead of restating it.`;
|
|
14386
|
-
return verdict([problemAt$
|
|
14378
|
+
return verdict([problemAt$6({
|
|
14387
14379
|
rule: "owner-value-set",
|
|
14388
14380
|
message
|
|
14389
14381
|
})(site.node)], []);
|
|
@@ -14391,7 +14383,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
14391
14383
|
const candidates = libraryCandidates(context)(site);
|
|
14392
14384
|
if (Array$1.isReadonlyArrayNonEmpty(candidates)) {
|
|
14393
14385
|
const message = `The values ${formatValues(site.values)} restate a dependency type: ${listCandidates(candidates)}. Derive this set from the library type.`;
|
|
14394
|
-
return verdict([problemAt$
|
|
14386
|
+
return verdict([problemAt$6({
|
|
14395
14387
|
rule: "library-value-set",
|
|
14396
14388
|
message
|
|
14397
14389
|
})(site.node)], []);
|
|
@@ -14422,7 +14414,7 @@ const isValuePosition = (node) => {
|
|
|
14422
14414
|
const { parent } = node;
|
|
14423
14415
|
return VALUE_PARENT_KINDS.has(parent.kind) || pipe(VALUE_SLOTS, Array$1.some((isSlot) => isSlot(node, parent)));
|
|
14424
14416
|
};
|
|
14425
|
-
const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array$1.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array$1.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array$1.map(String)))))), Option.filter((owners) => Array$1.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$
|
|
14417
|
+
const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array$1.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array$1.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array$1.map(String)))))), Option.filter((owners) => Array$1.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$6({
|
|
14426
14418
|
rule: "owned-literal",
|
|
14427
14419
|
message: `${literal.getText()} is a value of ${describeOwners(owners)}. Write it through the owner's binding instead of as a literal.`
|
|
14428
14420
|
})(literal)));
|
|
@@ -14847,7 +14839,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
14847
14839
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
14848
14840
|
}, Effect.scoped);
|
|
14849
14841
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
14850
|
-
const RULE$
|
|
14842
|
+
const RULE$36 = "namespace-destructuring";
|
|
14851
14843
|
const LOCAL = /^[.#/]/u;
|
|
14852
14844
|
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.`;
|
|
14853
14845
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -14862,8 +14854,8 @@ const destructuredName = (declaration) => {
|
|
|
14862
14854
|
if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
|
|
14863
14855
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
14864
14856
|
};
|
|
14865
|
-
const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$
|
|
14866
|
-
rule: RULE$
|
|
14857
|
+
const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
|
|
14858
|
+
rule: RULE$36,
|
|
14867
14859
|
message: messageOf$1(name)
|
|
14868
14860
|
})), Option.map((report) => report(declaration)));
|
|
14869
14861
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -14871,7 +14863,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
14871
14863
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$5(names)), Array$1.getSomes);
|
|
14872
14864
|
};
|
|
14873
14865
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
14874
|
-
const RULE$
|
|
14866
|
+
const RULE$35 = "pass-through-wrapper";
|
|
14875
14867
|
const SINGLE_STATEMENT = 1;
|
|
14876
14868
|
const SINGLE_DECLARATION = 1;
|
|
14877
14869
|
const THIS_PARAMETER = "this";
|
|
@@ -14967,8 +14959,8 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
14967
14959
|
};
|
|
14968
14960
|
const problemOf$4 = (checker) => (candidate) => {
|
|
14969
14961
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
14970
|
-
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$
|
|
14971
|
-
rule: RULE$
|
|
14962
|
+
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
|
|
14963
|
+
rule: RULE$35,
|
|
14972
14964
|
message: messageOf(forward.callee.getText())
|
|
14973
14965
|
})(candidate.name)));
|
|
14974
14966
|
};
|
|
@@ -14994,7 +14986,7 @@ var plugins = [{
|
|
|
14994
14986
|
"description": "CLI for watashi (watashi.masseater.dev). Sends Claude Code transcripts from a Stop hook after masking secrets locally with h56m, and manages login and API tokens."
|
|
14995
14987
|
}];
|
|
14996
14988
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
14997
|
-
const RULE$
|
|
14989
|
+
const RULE$34 = "known-plugins";
|
|
14998
14990
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
14999
14991
|
const GITHUB$2 = "github";
|
|
15000
14992
|
const Source$1 = Schema.Struct({
|
|
@@ -15012,7 +15004,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
|
|
|
15012
15004
|
const REPOSITORY_NAME = "masseater/masseater.dev";
|
|
15013
15005
|
const MARKETPLACE = name;
|
|
15014
15006
|
const PLUGINS = pipe(plugins, Array$1.map(({ name }) => `${name}@${MARKETPLACE}`));
|
|
15015
|
-
const problem$1 = problemInFile(RULE$
|
|
15007
|
+
const problem$1 = problemInFile(RULE$34);
|
|
15016
15008
|
const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
|
|
15017
15009
|
const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
|
|
15018
15010
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
@@ -15033,32 +15025,32 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
|
|
|
15033
15025
|
return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
|
|
15034
15026
|
});
|
|
15035
15027
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
15036
|
-
const RULE$
|
|
15028
|
+
const RULE$33 = "missing-hook";
|
|
15037
15029
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
15038
15030
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
15039
15031
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15040
15032
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15041
15033
|
const PLUGIN_ROOT = "..";
|
|
15042
|
-
const READ_CONCURRENCY$
|
|
15034
|
+
const READ_CONCURRENCY$10 = 16;
|
|
15043
15035
|
const START$19 = 0;
|
|
15044
|
-
const referenceOf$
|
|
15036
|
+
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
15045
15037
|
path,
|
|
15046
15038
|
index: found.index ?? START$19
|
|
15047
15039
|
})), Option.toArray);
|
|
15048
|
-
const referencesIn
|
|
15040
|
+
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf$1));
|
|
15049
15041
|
const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
15050
15042
|
const files = yield* RepositoryFiles;
|
|
15051
15043
|
const text = yield* files.readFile(file);
|
|
15052
15044
|
if (Option.isNone(text)) return [];
|
|
15053
15045
|
const source = text.value;
|
|
15054
|
-
const absent = yield* Effect.filter(referencesIn
|
|
15046
|
+
const absent = yield* Effect.filter(referencesIn(pattern, source), ({ path }) => files.exists(files.join(base, path)).pipe(Effect.map((exists) => !exists)));
|
|
15055
15047
|
const targetOf = ({ path }) => files.join(base, path);
|
|
15056
15048
|
const built = yield* files.ignoredPaths(root, pipe(absent, Array$1.map(targetOf)));
|
|
15057
15049
|
const missing = pipe(absent, Array$1.filter((reference) => !Array$1.contains(built, targetOf(reference))));
|
|
15058
15050
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
15059
15051
|
file,
|
|
15060
15052
|
...positionOf(source)(index),
|
|
15061
|
-
rule: RULE$
|
|
15053
|
+
rule: RULE$33,
|
|
15062
15054
|
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.`
|
|
15063
15055
|
})));
|
|
15064
15056
|
});
|
|
@@ -15082,7 +15074,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
15082
15074
|
}];
|
|
15083
15075
|
return [];
|
|
15084
15076
|
}));
|
|
15085
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$12, { concurrency: READ_CONCURRENCY$
|
|
15077
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$12, { concurrency: READ_CONCURRENCY$10 });
|
|
15086
15078
|
return Array$1.flatten(found);
|
|
15087
15079
|
});
|
|
15088
15080
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
@@ -15111,7 +15103,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
15111
15103
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
15112
15104
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
15113
15105
|
// src/features/check-documented-commands/model/commands.ts
|
|
15114
|
-
const RULE$
|
|
15106
|
+
const RULE$32 = "documented-commands";
|
|
15115
15107
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
15116
15108
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
15117
15109
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -15189,7 +15181,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
|
|
|
15189
15181
|
const problemsIn$11 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
|
|
15190
15182
|
file: absolute(file),
|
|
15191
15183
|
...positionOf(text)(match.index ?? START$18),
|
|
15192
|
-
rule: RULE$
|
|
15184
|
+
rule: RULE$32,
|
|
15193
15185
|
message: `${match[START$18]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
15194
15186
|
})), Option.toArray)));
|
|
15195
15187
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
@@ -15214,14 +15206,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
15214
15206
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
15215
15207
|
line: ONE$1,
|
|
15216
15208
|
column: ONE$1,
|
|
15217
|
-
rule: RULE$
|
|
15209
|
+
rule: RULE$32,
|
|
15218
15210
|
message: "msch could not list the tasks with `vp run --json`"
|
|
15219
15211
|
}],
|
|
15220
15212
|
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$11(found, absolute, document)))
|
|
15221
15213
|
});
|
|
15222
15214
|
});
|
|
15223
15215
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
15224
|
-
const RULE$
|
|
15216
|
+
const RULE$31 = "legacy-web";
|
|
15225
15217
|
const FIRST_COLUMN$3 = 1;
|
|
15226
15218
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
15227
15219
|
const Finding = Schema.Struct({
|
|
@@ -15260,7 +15252,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
15260
15252
|
file: files.join(root, file),
|
|
15261
15253
|
line,
|
|
15262
15254
|
column: FIRST_COLUMN$3,
|
|
15263
|
-
rule: RULE$
|
|
15255
|
+
rule: RULE$31,
|
|
15264
15256
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
15265
15257
|
});
|
|
15266
15258
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
@@ -15330,8 +15322,8 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
15330
15322
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
15331
15323
|
const EXTENSION = /\.[^./]+$/u;
|
|
15332
15324
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
15333
|
-
const READ_CONCURRENCY$
|
|
15334
|
-
const RULE$
|
|
15325
|
+
const READ_CONCURRENCY$9 = 64;
|
|
15326
|
+
const RULE$30 = "shell-script";
|
|
15335
15327
|
const MESSAGE$13 = "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.";
|
|
15336
15328
|
const HookSchema = Schema.Struct({
|
|
15337
15329
|
command: Schema.optional(Schema.String),
|
|
@@ -15363,12 +15355,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
15363
15355
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
15364
15356
|
};
|
|
15365
15357
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
15366
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
15367
|
-
return pipe(shell, Array$1.map((name) => problemInFile(RULE$
|
|
15358
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
|
|
15359
|
+
return pipe(shell, Array$1.map((name) => problemInFile(RULE$30)(files.join(root, name), MESSAGE$13)));
|
|
15368
15360
|
});
|
|
15369
15361
|
// src/shared/lib/workflow-files.ts
|
|
15370
15362
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
15371
|
-
const READ_CONCURRENCY$
|
|
15363
|
+
const READ_CONCURRENCY$8 = 16;
|
|
15372
15364
|
const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
15373
15365
|
const files = yield* RepositoryFiles;
|
|
15374
15366
|
const names = yield* files.listedFiles(root);
|
|
@@ -15378,7 +15370,7 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
15378
15370
|
file,
|
|
15379
15371
|
source
|
|
15380
15372
|
}))));
|
|
15381
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
15373
|
+
}, { concurrency: READ_CONCURRENCY$8 });
|
|
15382
15374
|
return Array$1.getSomes(found);
|
|
15383
15375
|
});
|
|
15384
15376
|
// src/shared/lib/workflow-run.ts
|
|
@@ -15399,7 +15391,7 @@ const runScriptsOf = (source) => {
|
|
|
15399
15391
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
15400
15392
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
15401
15393
|
const COMMENT = "#";
|
|
15402
|
-
const RULE$
|
|
15394
|
+
const RULE$29 = "workflow-script";
|
|
15403
15395
|
const ONE_COMMAND = 1;
|
|
15404
15396
|
const MESSAGE$12 = "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.";
|
|
15405
15397
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
@@ -15410,7 +15402,7 @@ const runsMoreThanOneCommand = ({ text }) => {
|
|
|
15410
15402
|
};
|
|
15411
15403
|
const problemsIn$10 = (file) => (source) => {
|
|
15412
15404
|
const at = positionOf(source);
|
|
15413
|
-
return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$
|
|
15405
|
+
return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$29)(file, at(start), MESSAGE$12)));
|
|
15414
15406
|
};
|
|
15415
15407
|
/** @internal */
|
|
15416
15408
|
const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
|
|
@@ -15540,7 +15532,7 @@ const AGENT_DOCS = [
|
|
|
15540
15532
|
":(glob)**/CLAUDE.md",
|
|
15541
15533
|
...EXCLUDED$4
|
|
15542
15534
|
];
|
|
15543
|
-
const READ_CONCURRENCY$
|
|
15535
|
+
const READ_CONCURRENCY$7 = 16;
|
|
15544
15536
|
const START$16 = 0;
|
|
15545
15537
|
const FIRST$5 = 1;
|
|
15546
15538
|
const LINE = "\n";
|
|
@@ -15609,7 +15601,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
15609
15601
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
15610
15602
|
});
|
|
15611
15603
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
15612
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
15604
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$7 });
|
|
15613
15605
|
return Array$1.flatten(found);
|
|
15614
15606
|
});
|
|
15615
15607
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -15621,7 +15613,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
15621
15613
|
onSome: sourcesOf(file, name)
|
|
15622
15614
|
});
|
|
15623
15615
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
15624
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
15616
|
+
}, { concurrency: READ_CONCURRENCY$7 });
|
|
15625
15617
|
return Array$1.flatten(found);
|
|
15626
15618
|
});
|
|
15627
15619
|
/** @internal */
|
|
@@ -15645,7 +15637,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
15645
15637
|
return Array$1.flatten(found);
|
|
15646
15638
|
});
|
|
15647
15639
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
15648
|
-
const RULE$
|
|
15640
|
+
const RULE$28 = "package-script";
|
|
15649
15641
|
const LIFECYCLE = [
|
|
15650
15642
|
"preinstall",
|
|
15651
15643
|
"install",
|
|
@@ -15668,12 +15660,12 @@ const LIFECYCLE = [
|
|
|
15668
15660
|
const problemOf$3 = ({ file, position, name }) => ({
|
|
15669
15661
|
file,
|
|
15670
15662
|
...position,
|
|
15671
|
-
rule: RULE$
|
|
15663
|
+
rule: RULE$28,
|
|
15672
15664
|
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.`
|
|
15673
15665
|
});
|
|
15674
15666
|
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$3));
|
|
15675
15667
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
15676
|
-
const RULE$
|
|
15668
|
+
const RULE$27 = "vite-plus-block";
|
|
15677
15669
|
const MARKER = Array$1.join([
|
|
15678
15670
|
"<!--",
|
|
15679
15671
|
"VITE PLUS START",
|
|
@@ -15686,7 +15678,7 @@ const problemIn = (file) => (source) => {
|
|
|
15686
15678
|
return Option.some({
|
|
15687
15679
|
file,
|
|
15688
15680
|
...positionOf(source)(index.value),
|
|
15689
|
-
rule: RULE$
|
|
15681
|
+
rule: RULE$27,
|
|
15690
15682
|
message: MESSAGE$11
|
|
15691
15683
|
});
|
|
15692
15684
|
};
|
|
@@ -15764,7 +15756,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
15764
15756
|
return pipe(drifts, Array$1.map(problemOf$2));
|
|
15765
15757
|
});
|
|
15766
15758
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
15767
|
-
const RULE$
|
|
15759
|
+
const RULE$25 = "publish-trigger";
|
|
15768
15760
|
const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
|
|
15769
15761
|
const MANUAL = "workflow_dispatch";
|
|
15770
15762
|
const TRIGGER_KEY$1 = "on";
|
|
@@ -15778,18 +15770,18 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
15778
15770
|
};
|
|
15779
15771
|
/** @internal */
|
|
15780
15772
|
const checkPublishTrigger = workflowCheck({
|
|
15781
|
-
rule: RULE$
|
|
15773
|
+
rule: RULE$25,
|
|
15782
15774
|
message: MESSAGE$9,
|
|
15783
15775
|
offsetsOf: publishTriggerOffsetsOf
|
|
15784
15776
|
});
|
|
15785
15777
|
// src/features/check-workflows/model/release-please.ts
|
|
15786
|
-
const RULE$
|
|
15778
|
+
const RULE$24 = "release-please";
|
|
15787
15779
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
15788
15780
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
15789
15781
|
const FIRST$4 = 1;
|
|
15790
15782
|
const MESSAGE$8 = "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.";
|
|
15791
15783
|
const checkReleasePleaseSteps = workflowCheck({
|
|
15792
|
-
rule: RULE$
|
|
15784
|
+
rule: RULE$24,
|
|
15793
15785
|
message: MESSAGE$8,
|
|
15794
15786
|
offsetsOf: scalarKeyOffsets({
|
|
15795
15787
|
name: "uses",
|
|
@@ -15803,7 +15795,7 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
15803
15795
|
file: files.join(root, name),
|
|
15804
15796
|
line: FIRST$4,
|
|
15805
15797
|
column: FIRST$4,
|
|
15806
|
-
rule: RULE$
|
|
15798
|
+
rule: RULE$24,
|
|
15807
15799
|
message: MESSAGE$8
|
|
15808
15800
|
})));
|
|
15809
15801
|
});
|
|
@@ -15813,7 +15805,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
15813
15805
|
return Array$1.flatten(found);
|
|
15814
15806
|
});
|
|
15815
15807
|
// src/features/check-workflows/model/workflow-cancel.ts
|
|
15816
|
-
const RULE$
|
|
15808
|
+
const RULE$23 = "workflow-cancel";
|
|
15817
15809
|
const PUSH = "push";
|
|
15818
15810
|
const TRIGGER_KEY = "on";
|
|
15819
15811
|
const CONCURRENCY_KEY$1 = "concurrency";
|
|
@@ -15828,24 +15820,24 @@ const cancelOffsetsOf = (source) => {
|
|
|
15828
15820
|
};
|
|
15829
15821
|
/** @internal */
|
|
15830
15822
|
const checkWorkflowCancel = workflowCheck({
|
|
15831
|
-
rule: RULE$
|
|
15823
|
+
rule: RULE$23,
|
|
15832
15824
|
message: MESSAGE$7,
|
|
15833
15825
|
offsetsOf: cancelOffsetsOf
|
|
15834
15826
|
});
|
|
15835
15827
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
15836
15828
|
const CONCURRENCY_KEY = "concurrency";
|
|
15837
15829
|
const QUEUE_KEY = "queue";
|
|
15838
|
-
const RULE$
|
|
15830
|
+
const RULE$22 = "workflow-queue";
|
|
15839
15831
|
const MESSAGE$6 = "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.";
|
|
15840
15832
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array$1.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
15841
15833
|
/** @internal */
|
|
15842
15834
|
const checkWorkflowQueues = workflowCheck({
|
|
15843
|
-
rule: RULE$
|
|
15835
|
+
rule: RULE$22,
|
|
15844
15836
|
message: MESSAGE$6,
|
|
15845
15837
|
offsetsOf: queueOffsetsOf
|
|
15846
15838
|
});
|
|
15847
15839
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
15848
|
-
const RULE$
|
|
15840
|
+
const RULE$21 = "workflow-commit";
|
|
15849
15841
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
15850
15842
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
15851
15843
|
const MESSAGE$5 = "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.";
|
|
@@ -15853,7 +15845,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
|
|
|
15853
15845
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
15854
15846
|
/** @internal */
|
|
15855
15847
|
const checkWorkflowCommits = workflowCheck({
|
|
15856
|
-
rule: RULE$
|
|
15848
|
+
rule: RULE$21,
|
|
15857
15849
|
message: MESSAGE$5,
|
|
15858
15850
|
offsetsOf: commitOffsetsOf
|
|
15859
15851
|
});
|
|
@@ -16082,11 +16074,11 @@ const shebangReader = (source) => {
|
|
|
16082
16074
|
};
|
|
16083
16075
|
const readerOf = (name) => (source) => pipe(READERS$1, Array$1.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
|
|
16084
16076
|
// src/features/ban-comments/model/comments.ts
|
|
16085
|
-
const RULE$
|
|
16086
|
-
const UNUSED_RULE
|
|
16077
|
+
const RULE$20 = "comment";
|
|
16078
|
+
const UNUSED_RULE = "unused-comment-allowance";
|
|
16087
16079
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
16088
16080
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
16089
|
-
const READ_CONCURRENCY$
|
|
16081
|
+
const READ_CONCURRENCY$6 = 64;
|
|
16090
16082
|
const START$14 = 0;
|
|
16091
16083
|
const SHEBANG = "#!";
|
|
16092
16084
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
@@ -16123,7 +16115,7 @@ const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but n
|
|
|
16123
16115
|
const problemOf$1 = (file, source) => ({ index }) => ({
|
|
16124
16116
|
file,
|
|
16125
16117
|
...positionOf(source)(index),
|
|
16126
|
-
rule: RULE$
|
|
16118
|
+
rule: RULE$20,
|
|
16127
16119
|
message: MESSAGE$4
|
|
16128
16120
|
});
|
|
16129
16121
|
const settingsOf = ({ msch, lint }) => ({
|
|
@@ -16169,7 +16161,7 @@ const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowance
|
|
|
16169
16161
|
return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => ({
|
|
16170
16162
|
file,
|
|
16171
16163
|
...positionOf(source)(entryOffset(source, entry)),
|
|
16172
|
-
rule: UNUSED_RULE
|
|
16164
|
+
rule: UNUSED_RULE,
|
|
16173
16165
|
message: unusedMessage(entry)
|
|
16174
16166
|
})));
|
|
16175
16167
|
});
|
|
@@ -16182,7 +16174,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16182
16174
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16183
16175
|
used: usedAllowances(allowances, found)
|
|
16184
16176
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16185
|
-
problems: [problemInFile(RULE$
|
|
16177
|
+
problems: [problemInFile(RULE$20)(file, `msch could not read the comments in this file: ${message}`)],
|
|
16186
16178
|
used: []
|
|
16187
16179
|
})))
|
|
16188
16180
|
});
|
|
@@ -16201,7 +16193,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
16201
16193
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
16202
16194
|
onNone: () => Effect.succeed(NOTHING),
|
|
16203
16195
|
onSome: (source) => scan(entry, source)
|
|
16204
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
16196
|
+
}))), { concurrency: READ_CONCURRENCY$6 });
|
|
16205
16197
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
16206
16198
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
16207
16199
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -16295,7 +16287,7 @@ const PYTHON = {
|
|
|
16295
16287
|
/** @internal */
|
|
16296
16288
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
16297
16289
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
16298
|
-
const RULE$
|
|
16290
|
+
const RULE$19 = "uncataloged-dependency";
|
|
16299
16291
|
const OWNED_ELSEWHERE = [
|
|
16300
16292
|
"catalog:",
|
|
16301
16293
|
"workspace:",
|
|
@@ -16309,7 +16301,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
|
|
|
16309
16301
|
const problemsIn$9 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
16310
16302
|
file: entry.file,
|
|
16311
16303
|
...positionOf(source)(offsetIn$1(source)(manifestPattern(found))),
|
|
16312
|
-
rule: RULE$
|
|
16304
|
+
rule: RULE$19,
|
|
16313
16305
|
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$3}`
|
|
16314
16306
|
})));
|
|
16315
16307
|
/** @internal */
|
|
@@ -16328,92 +16320,39 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
16328
16320
|
});
|
|
16329
16321
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
16330
16322
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
16331
|
-
const MANIFEST$1 = /(?:^|\/)package\.json$/u;
|
|
16332
|
-
const CATALOG_PROTOCOL = "catalog:";
|
|
16333
|
-
const DEFAULT_CATALOG = "default";
|
|
16334
|
-
const VERSION_SEPARATOR = "||";
|
|
16335
|
-
const WILDCARD = "*";
|
|
16336
16323
|
const FIRST_LINE$2 = 1;
|
|
16337
16324
|
const FIRST_COLUMN$1 = 1;
|
|
16338
|
-
const
|
|
16339
|
-
const
|
|
16340
|
-
const
|
|
16341
|
-
const
|
|
16342
|
-
const STALE_MESSAGE = "excludes a version from `minimumReleaseAge` that the lockfile no longer resolves. Remove the entry: it only exempted that one version while it was new.";
|
|
16343
|
-
const UNUSED_MESSAGE = "is a catalog entry no package refers to. Remove it, so the catalog holds only versions in use.";
|
|
16344
|
-
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
16345
|
-
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
16346
|
-
const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf(held)), Array$1.map((name) => ({
|
|
16347
|
-
catalog,
|
|
16348
|
-
name
|
|
16349
|
-
})));
|
|
16350
|
-
const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(namedCatalogsOf(settings), Array$1.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
|
|
16351
|
-
const catalogOf = (specifier) => pipe(Option.liftPredicate(specifier, String$1.startsWith(CATALOG_PROTOCOL)), Option.map(String$1.slice(8)), Option.map((name) => Option.getOrElse(Option.liftPredicate(name, String$1.isNonEmpty), () => DEFAULT_CATALOG)));
|
|
16352
|
-
const referenceOf$1 = ([name, specifier]) => pipe(decodeString$1(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
|
|
16353
|
-
const referencesIn = (manifest) => pipe([...pipe(DEPENDENCY_SECTIONS, Array$1.map((section) => manifest[section])), manifest.overrides], Array$1.flatMap((section) => pipe(fieldsOf(section), Record.toEntries, Array$1.flatMap(referenceOf$1))));
|
|
16354
|
-
const versionsOf = (raw) => pipe(Option.fromUndefinedOr(raw), Option.map((listed) => pipe(String$1.split(listed, VERSION_SEPARATOR), Array$1.map(String$1.trim))), Option.getOrElse(() => []));
|
|
16355
|
-
const hasKeyWith = (keys) => (prefix) => pipe(keys, Array$1.some(String$1.startsWith(prefix)));
|
|
16356
|
-
const isLocked = (keys) => (resolved) => Array$1.contains(keys, resolved) || hasKeyWith(keys)(`${resolved}(`);
|
|
16357
|
-
const hasPackage = (keys) => (name) => hasKeyWith(keys)(`${name}@`);
|
|
16358
|
-
const lockedVersion = (keys, name) => (version) => isLocked(keys)(`${name}@${version}`);
|
|
16359
|
-
const resolvedIn = (keys) => (entry) => String$1.includes(WILDCARD)(entry) || pipe(Option.fromNullishOr(SCOPED_NAME.exec(entry)), Option.flatMap(({ groups }) => Option.fromUndefinedOr(groups)), Option.match({
|
|
16360
|
-
onNone: () => true,
|
|
16361
|
-
onSome: ({ name = "", versions }) => Array$1.match(versionsOf(versions), {
|
|
16362
|
-
onEmpty: () => hasPackage(keys)(name),
|
|
16363
|
-
onNonEmpty: Array$1.some(lockedVersion(keys, name))
|
|
16364
|
-
})
|
|
16365
|
-
}));
|
|
16366
|
-
const lockedKeys = (root) => lockedPackageIds(root).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
16367
|
-
const usedReferences = Effect.fn("usedReferences")(function* usedReferences(root, settings) {
|
|
16368
|
-
const files = yield* RepositoryFiles;
|
|
16369
|
-
const listed = yield* files.listedFiles(root);
|
|
16370
|
-
const manifests = yield* Effect.forEach(pipe(listed, Array$1.filter((name) => MANIFEST$1.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$6 });
|
|
16371
|
-
const fromManifests = pipe(Array$1.getSomes(manifests), Array$1.flatMap((text) => Option.toArray(decodePackageJson(text))), Array$1.flatMap(referencesIn));
|
|
16372
|
-
const fromOverrides = pipe(fieldsOf(settings["overrides"]), Record.toEntries, Array$1.flatMap(referenceOf$1));
|
|
16373
|
-
return /* @__PURE__ */ new Set([...fromManifests, ...fromOverrides]);
|
|
16374
|
-
});
|
|
16375
|
-
const lineOf$1 = (source) => (needle) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex((line) => needle.test(line)), Option.match({
|
|
16325
|
+
const RULE$18 = "prune-setting-off";
|
|
16326
|
+
const PRUNE_SETTINGS = [["catalogPrune", "removes catalog entries no package refers to, so the catalog holds only versions in use."], ["minimumReleaseAgeExcludePrune", "removes `minimumReleaseAgeExclude` entries the lockfile no longer resolves, which only exempted that one version while it was new."]];
|
|
16327
|
+
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
16328
|
+
const lineOf$1 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
|
|
16376
16329
|
onNone: () => FIRST_LINE$2,
|
|
16377
16330
|
onSome: (index) => index + FIRST_LINE$2
|
|
16378
16331
|
}));
|
|
16379
|
-
const
|
|
16380
|
-
const entryLine = (name) => new RegExp(`^\\s+["']?${quoted(name)}["']?:`, "u");
|
|
16381
|
-
const excludeLine = (entry) => new RegExp(`^\\s+-\\s+["']?${quoted(entry)}["']?\\s*$`, "u");
|
|
16382
|
-
const problemAt$4 = ({ file, at }, rule, message) => (name, needle) => ({
|
|
16383
|
-
file,
|
|
16384
|
-
line: at(needle),
|
|
16385
|
-
column: FIRST_COLUMN$1,
|
|
16386
|
-
rule,
|
|
16387
|
-
message: `\`${name}\` ${message}`
|
|
16388
|
-
});
|
|
16389
|
-
const unusedIn = (located, settings, isUsed) => pipe(catalogEntries(settings), Array$1.filter(({ catalog, name }) => !isUsed(`${catalog}:${name}`)), Array$1.map(({ name }) => problemAt$4(located, UNUSED_RULE, UNUSED_MESSAGE)(name, entryLine(name))));
|
|
16390
|
-
const staleIn = (located, settings, keys) => {
|
|
16391
|
-
const excludes = Option.getOrElse(decodeStrings(settings["minimumReleaseAgeExclude"]), () => []);
|
|
16392
|
-
return pipe(Option.toArray(keys), Array$1.flatMap((locked) => pipe(excludes, Array$1.filter((entry) => !resolvedIn(locked)(entry)))), Array$1.map((entry) => problemAt$4(located, STALE_RULE, STALE_MESSAGE)(entry, excludeLine(entry))));
|
|
16393
|
-
};
|
|
16394
|
-
const findingsIn = Effect.fn("findingsIn")(function* findingsIn(root, file, settings) {
|
|
16332
|
+
const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, settings) {
|
|
16395
16333
|
const read = yield* (yield* RepositoryFiles).readFile(file);
|
|
16396
|
-
const
|
|
16334
|
+
const at = lineOf$1(Option.getOrElse(read, () => ""));
|
|
16335
|
+
return pipe(PRUNE_SETTINGS, Array$1.filter(([setting]) => Option.isNone(decodeTrue(settings[setting]))), Array$1.map(([setting, effect]) => ({
|
|
16397
16336
|
file,
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16337
|
+
line: at(setting),
|
|
16338
|
+
column: FIRST_COLUMN$1,
|
|
16339
|
+
rule: RULE$18,
|
|
16340
|
+
message: `Set \`${setting}: true\`. It ${effect}`
|
|
16341
|
+
})));
|
|
16403
16342
|
});
|
|
16404
16343
|
/** @internal */
|
|
16405
16344
|
const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCatalogEntries(root) {
|
|
16406
16345
|
const files = yield* RepositoryFiles;
|
|
16407
16346
|
const manifest = yield* workspaceManifest(root);
|
|
16408
|
-
const
|
|
16347
|
+
const pruned = yield* Option.match(manifest, {
|
|
16409
16348
|
onNone: () => Effect.succeed([]),
|
|
16410
|
-
onSome: (settings) =>
|
|
16349
|
+
onSome: (settings) => pruneProblems(files.join(root, WORKSPACE_FILE$3), fieldsOf(settings))
|
|
16411
16350
|
});
|
|
16412
16351
|
const uncataloged = yield* Option.match(manifest, {
|
|
16413
16352
|
onNone: () => Effect.succeed([]),
|
|
16414
16353
|
onSome: () => uncatalogedDependencies(root)
|
|
16415
16354
|
});
|
|
16416
|
-
return [...
|
|
16355
|
+
return [...pruned, ...uncataloged];
|
|
16417
16356
|
});
|
|
16418
16357
|
// src/features/check-skills/model/skill-entry.ts
|
|
16419
16358
|
const ENTRY_RULE = "unlocked-skill";
|
|
@@ -17245,7 +17184,7 @@ const problemsFor = (file, source, pattern) => (found) => pipe(found, Array$1.fi
|
|
|
17245
17184
|
rule: RULE$9,
|
|
17246
17185
|
message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE}`
|
|
17247
17186
|
})));
|
|
17248
|
-
const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted$
|
|
17187
|
+
const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted$1(name)}["']?:`, "mu");
|
|
17249
17188
|
const manifestProblems$2 = (entry, source) => problemsFor(entry.file, source, manifestPattern)(manifestSpecifiers(source));
|
|
17250
17189
|
const catalogSpecifiers = (settings) => [...specifiedIn(settings["catalog"]), ...pipe(fieldsOf(settings["catalogs"]), Record.values, Array$1.flatMap(specifiedIn))];
|
|
17251
17190
|
const catalogProblems = Effect.fn("catalogProblems")(function* catalogProblems(root) {
|