@r_masseater/msch 0.64.0 → 0.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +4 -4
- package/dist/cli.mjs +105 -153
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +8 -3
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-CVDGUMjV.mjs → define-lint-preset-DpGK82kj.mjs} +6 -4
- package/dist/define-lint-preset-DpGK82kj.mjs.map +1 -0
- package/dist/{dependencies-B6p7x90y.mjs → dependencies-BDQ7XSwU.mjs} +7 -30
- package/dist/dependencies-BDQ7XSwU.mjs.map +1 -0
- package/dist/exits.mjs +13 -30
- package/dist/exits.mjs.map +1 -1
- package/dist/export-subpaths-D6ZLYZGy.mjs +17 -0
- package/dist/export-subpaths-D6ZLYZGy.mjs.map +1 -0
- package/dist/{ignored-directories-BgUqwuc4.mjs → ignored-directories-DurTKTTN.mjs} +2 -2
- package/dist/{ignored-directories-BgUqwuc4.mjs.map → ignored-directories-DurTKTTN.mjs.map} +1 -1
- package/dist/{index-BZIBqvmt.d.mts → index-MUn1dolO.d.mts} +2 -1
- package/dist/lint.mjs +1 -1
- package/dist/lookup-DjQU0W6q.mjs +33 -0
- package/dist/lookup-DjQU0W6q.mjs.map +1 -0
- package/dist/lookup-report-CPR_cj8F.mjs +29 -0
- package/dist/lookup-report-CPR_cj8F.mjs.map +1 -0
- package/dist/oxlint.mjs +2 -2
- package/dist/{pass-records-CFIrQmB5.mjs → pass-records-DdiDtl_g.mjs} +5 -5
- package/dist/pass-records-DdiDtl_g.mjs.map +1 -0
- package/dist/{problem-D2HKNIVq.mjs → problem-glqVxx3h.mjs} +2 -2
- package/dist/{problem-D2HKNIVq.mjs.map → problem-glqVxx3h.mjs.map} +1 -1
- package/dist/publish.mjs +15 -23
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-BIexKvdJ.mjs → published-DnkuW2Tw.mjs} +10 -15
- package/dist/published-DnkuW2Tw.mjs.map +1 -0
- package/dist/refs.d.mts +1 -0
- package/dist/refs.mjs +237 -0
- package/dist/refs.mjs.map +1 -0
- package/dist/{repository-files-B5sRbxlz.mjs → repository-files-mOPItI5o.mjs} +3 -3
- package/dist/repository-files-mOPItI5o.mjs.map +1 -0
- package/dist/{runtime-A2p57njU.mjs → runtime-mDBC8Yey.mjs} +2 -2
- package/dist/{runtime-A2p57njU.mjs.map → runtime-mDBC8Yey.mjs.map} +1 -1
- package/dist/{syntax-C0ddqOHc.mjs → syntax-A3ga4Ksb.mjs} +2 -2
- package/dist/{syntax-C0ddqOHc.mjs.map → syntax-A3ga4Ksb.mjs.map} +1 -1
- package/dist/tree-sitter-BfzHNwTR.mjs +41 -0
- package/dist/tree-sitter-BfzHNwTR.mjs.map +1 -0
- package/dist/{upstream-exits-DitN-yYH.mjs → upstream-exits-Bv2E-QO6.mjs} +13 -29
- package/dist/upstream-exits-Bv2E-QO6.mjs.map +1 -0
- package/dist/wake.mjs +1 -1
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +18 -5
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +5 -3
- package/skills/msch-checks/SKILL.md +6 -0
- package/skills/msch-publishing/SKILL.md +2 -0
- package/dist/define-lint-preset-CVDGUMjV.mjs.map +0 -1
- package/dist/dependencies-B6p7x90y.mjs.map +0 -1
- package/dist/pass-records-CFIrQmB5.mjs.map +0 -1
- package/dist/published-BIexKvdJ.mjs.map +0 -1
- package/dist/repository-files-B5sRbxlz.mjs.map +0 -1
- package/dist/upstream-exits-DitN-yYH.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-
|
|
3
|
-
import { a as publishedProjects, c as workspaceManifest, o as workspaceDirectories, r as readManifest, s as workspaceProjects, t as MANIFEST_FILE$3 } from "./dependencies-
|
|
4
|
-
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-
|
|
5
|
-
import { a as groupOf
|
|
6
|
-
import { a as workspaceDeviations, c as tomlSourceComments, 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-
|
|
2
|
+
import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-DnkuW2Tw.mjs";
|
|
3
|
+
import { a as publishedProjects, c as workspaceManifest, o as workspaceDirectories, r as readManifest, s as workspaceProjects, t as MANIFEST_FILE$3 } from "./dependencies-BDQ7XSwU.mjs";
|
|
4
|
+
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-DdiDtl_g.mjs";
|
|
5
|
+
import { a as groupOf, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-mOPItI5o.mjs";
|
|
6
|
+
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-Bv2E-QO6.mjs";
|
|
7
7
|
import { a as join, n as baseName, o as parent, r as isInside, t as matcher } from "./app-BwjhFdKD.mjs";
|
|
8
|
-
import { a as problemAtPosition, i as problemAt$
|
|
8
|
+
import { a as problemAtPosition, i as problemAt$7, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-glqVxx3h.mjs";
|
|
9
9
|
import { t as JAPANESE } from "./config-CvPuqi4L.mjs";
|
|
10
|
-
import { t as
|
|
11
|
-
import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-
|
|
12
|
-
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-
|
|
10
|
+
import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
|
|
11
|
+
import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-A3ga4Ksb.mjs";
|
|
12
|
+
import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-mDBC8Yey.mjs";
|
|
13
13
|
import "./cli-contract-D7btWrEu.mjs";
|
|
14
14
|
import { builtinModules } from "node:module";
|
|
15
15
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
@@ -19,7 +19,6 @@ import { ChildProcess } from "effect/process";
|
|
|
19
19
|
import { parse, resolveConfigFromFile } from "vite-plus";
|
|
20
20
|
import { parse as parse$1 } from "@pnpm/deps.path";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
|
-
import treeSitter from "@vscode/tree-sitter-wasm";
|
|
23
22
|
import { isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
|
|
24
23
|
import { rolldown } from "vite/rolldown";
|
|
25
24
|
import { stripVTControlCharacters } from "node:util";
|
|
@@ -371,8 +370,8 @@ const RESOLUTION_FILES = [
|
|
|
371
370
|
];
|
|
372
371
|
const RESOLUTION_CONCURRENCY = 2;
|
|
373
372
|
const SUCCEEDED$1 = 0;
|
|
374
|
-
const taggedError$
|
|
375
|
-
var OverrideResolutionFailed = class extends taggedError$
|
|
373
|
+
const taggedError$7 = Schema.TaggedError;
|
|
374
|
+
var OverrideResolutionFailed = class extends taggedError$7()("OverrideResolutionFailed", {
|
|
376
375
|
override: Schema.String,
|
|
377
376
|
output: Schema.String
|
|
378
377
|
}) {};
|
|
@@ -525,13 +524,13 @@ const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
|
525
524
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
526
525
|
const RULE$63 = "git-subpath-dependency";
|
|
527
526
|
const WHOLE_MATCH$4 = 0;
|
|
528
|
-
const problemAt$
|
|
527
|
+
const problemAt$6 = ({ file }, source) => (found) => ({
|
|
529
528
|
file,
|
|
530
529
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
531
530
|
rule: RULE$63,
|
|
532
531
|
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])}\`.`
|
|
533
532
|
});
|
|
534
|
-
const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$
|
|
533
|
+
const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$6(entry, source)));
|
|
535
534
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
536
535
|
/** @internal */
|
|
537
536
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
@@ -592,7 +591,7 @@ const workspaceProblem = (file, source, registry) => ({
|
|
|
592
591
|
onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
|
|
593
592
|
})
|
|
594
593
|
});
|
|
595
|
-
const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf
|
|
594
|
+
const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf("value")(found), isGuarded)), Array.map((found) => ({
|
|
596
595
|
file: entry.file,
|
|
597
596
|
...positionOf(source)(found.index ?? START$23),
|
|
598
597
|
rule: RULE$60,
|
|
@@ -1057,8 +1056,8 @@ const README = /^README(?:\.[^/]+)?$/iu;
|
|
|
1057
1056
|
const MANIFEST$5 = "package.json";
|
|
1058
1057
|
const MISSING_RULE = "workspace-agents-md";
|
|
1059
1058
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
1060
|
-
const taggedError$
|
|
1061
|
-
var RootConfigUnreadable = class extends taggedError$
|
|
1059
|
+
const taggedError$6 = Schema.TaggedError;
|
|
1060
|
+
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
1062
1061
|
const isNested = (name) => String$1.includes(SEPARATOR$17)(name);
|
|
1063
1062
|
const problemFor$7 = problemInFile(RULE$53);
|
|
1064
1063
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
@@ -1378,40 +1377,6 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
|
|
|
1378
1377
|
const entries = yield* Effect.forEach(workspaces, (workspace) => entryProblems$2(root, workspace), { concurrency: 1 });
|
|
1379
1378
|
return Array.flatten(entries);
|
|
1380
1379
|
});
|
|
1381
|
-
// src/shared/lib/tree-sitter.ts
|
|
1382
|
-
const taggedError$6 = Schema.TaggedError;
|
|
1383
|
-
var GrammarUnreadable = class extends taggedError$6()("GrammarUnreadable", {
|
|
1384
|
-
grammar: Schema.String,
|
|
1385
|
-
message: Schema.String
|
|
1386
|
-
}) {};
|
|
1387
|
-
const PARSER_KEY = "parser";
|
|
1388
|
-
const initParser = startedOnce();
|
|
1389
|
-
const loadOnce = startedOnce();
|
|
1390
|
-
const grammarFile = (grammar) => fileURLToPath(import.meta.resolve(`@vscode/tree-sitter-wasm/wasm/tree-sitter-${grammar}.wasm`));
|
|
1391
|
-
const loadLanguage = (grammar) => {
|
|
1392
|
-
const unreadable = (cause) => GrammarUnreadable.make({
|
|
1393
|
-
grammar,
|
|
1394
|
-
message: String(cause)
|
|
1395
|
-
});
|
|
1396
|
-
return Effect.tryPromise({
|
|
1397
|
-
try: () => initParser(PARSER_KEY, () => treeSitter.Parser.init()),
|
|
1398
|
-
catch: unreadable
|
|
1399
|
-
}).pipe(Effect.andThen(Effect.tryPromise({
|
|
1400
|
-
try: () => loadOnce(grammar, () => treeSitter.Language.load(grammarFile(grammar))),
|
|
1401
|
-
catch: unreadable
|
|
1402
|
-
})));
|
|
1403
|
-
};
|
|
1404
|
-
const readTree = ({ language, source, read }) => {
|
|
1405
|
-
const parser = new treeSitter.Parser();
|
|
1406
|
-
parser.setLanguage(language);
|
|
1407
|
-
const tree = parser.parse(source);
|
|
1408
|
-
parser.delete();
|
|
1409
|
-
return Option.map(Option.fromNullishOr(tree), (parsed) => {
|
|
1410
|
-
const result = read(parsed.rootNode);
|
|
1411
|
-
parsed.delete();
|
|
1412
|
-
return result;
|
|
1413
|
-
});
|
|
1414
|
-
};
|
|
1415
1380
|
// src/features/check-placement/model/rust-layout.ts
|
|
1416
1381
|
const LAYERS = [
|
|
1417
1382
|
"app",
|
|
@@ -10854,7 +10819,7 @@ const SPACE = " ";
|
|
|
10854
10819
|
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.";
|
|
10855
10820
|
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.`;
|
|
10856
10821
|
const keysOf$1 = (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => map.items), Option.getOrElse(() => []), Array.filter(isPair), Array.flatMap(({ key }) => Option.toArray(stringOf(key))));
|
|
10857
|
-
const problemAt$
|
|
10822
|
+
const problemAt$5 = ({ file, source }, rule, message) => (offset) => ({
|
|
10858
10823
|
file,
|
|
10859
10824
|
...positionOf(source)(offset),
|
|
10860
10825
|
rule,
|
|
@@ -10864,7 +10829,7 @@ const pathFiltersIn = (file, source) => {
|
|
|
10864
10829
|
const root = parseDocument(source).contents;
|
|
10865
10830
|
const triggers = pipe(entriesOf$1(childOf("on")(root)), Array.flatMap(([, trigger]) => keysOf$1(trigger)), Array.filter(({ text }) => Array.contains(FILTER_KEYS, text)));
|
|
10866
10831
|
const actions = pipe(scalarsIn(source), Array.filter(({ text }) => PATHS_FILTER_ACTION.test(text)));
|
|
10867
|
-
return pipe([...triggers, ...actions], Array.map(({ offset }) => problemAt$
|
|
10832
|
+
return pipe([...triggers, ...actions], Array.map(({ offset }) => problemAt$5({
|
|
10868
10833
|
file,
|
|
10869
10834
|
source
|
|
10870
10835
|
}, PATH_FILTER, FILTER_MESSAGE)(offset)));
|
|
@@ -10887,7 +10852,7 @@ const filtersIn = (source) => pipe(scalarsIn(source), Array.flatMap(({ text, off
|
|
|
10887
10852
|
text: value,
|
|
10888
10853
|
offset
|
|
10889
10854
|
})))));
|
|
10890
|
-
const reported = (where, offset, what) => (found) => pipe(found, Option.map((directory) => problemAt$
|
|
10855
|
+
const reported = (where, offset, what) => (found) => pipe(found, Option.map((directory) => problemAt$5(where, PACKAGE, packageMessage(what, directory))(offset)), Option.toArray);
|
|
10891
10856
|
const packagesIn = (workspaces, { file, name, source }) => {
|
|
10892
10857
|
const where = {
|
|
10893
10858
|
file,
|
|
@@ -10909,13 +10874,12 @@ const actionProblems = (workspaces, file, name) => pipe(named$1(workspaces, name
|
|
|
10909
10874
|
rule: PACKAGE,
|
|
10910
10875
|
message: packageMessage(`The action ${name}`, directory)
|
|
10911
10876
|
})), Option.toArray);
|
|
10912
|
-
const groupOf$1 = (pattern, name) => pipe(String$1.match(pattern)(name), Option.flatMap((match) => Option.fromNullishOr(match.groups)), Option.flatMap((groups) => Option.fromNullishOr(groups["name"])));
|
|
10913
10877
|
/** @internal */
|
|
10914
10878
|
const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkflowScale(root) {
|
|
10915
10879
|
const files = yield* RepositoryFiles;
|
|
10916
10880
|
const listed = yield* files.listedFiles(root);
|
|
10917
10881
|
const workspaces = yield* namedWorkspaces(root);
|
|
10918
|
-
const workflows = pipe(listed, Array.flatMap((name) => pipe(groupOf
|
|
10882
|
+
const workflows = pipe(listed, Array.flatMap((name) => pipe(groupOf("name")(WORKFLOW.exec(name)), Option.map((stem) => ({
|
|
10919
10883
|
name,
|
|
10920
10884
|
stem
|
|
10921
10885
|
})), Option.toArray)));
|
|
@@ -10928,7 +10892,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
|
|
|
10928
10892
|
source: text
|
|
10929
10893
|
})]), Option.getOrElse(() => []));
|
|
10930
10894
|
}), { concurrency: READ_CONCURRENCY$13 });
|
|
10931
|
-
const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf
|
|
10895
|
+
const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf("name")(ACTION.exec(name)), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
|
|
10932
10896
|
return [...Array.flatten(found), ...actions];
|
|
10933
10897
|
});
|
|
10934
10898
|
// src/features/check-repository-layout/model/workspace-checks.ts
|
|
@@ -10946,6 +10910,9 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
10946
10910
|
], { concurrency: "unbounded" });
|
|
10947
10911
|
return Array.flatten(found);
|
|
10948
10912
|
});
|
|
10913
|
+
// src/shared/lib/keys.ts
|
|
10914
|
+
/** @internal */
|
|
10915
|
+
const keysOf = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
10949
10916
|
// src/shared/lib/package-name.ts
|
|
10950
10917
|
const SCOPE$2 = "@";
|
|
10951
10918
|
const SEPARATOR$7 = "/";
|
|
@@ -11003,7 +10970,7 @@ const localFile = Effect.fn("localFile")(function* localFile({ directory, import
|
|
|
11003
10970
|
if (Option.isNone(target)) return Option.none();
|
|
11004
10971
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
11005
10972
|
});
|
|
11006
|
-
const referenceOf$
|
|
10973
|
+
const referenceOf$3 = (graph, from, specifier) => {
|
|
11007
10974
|
if (RELATIVE.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
11008
10975
|
const name = packageNameOf(specifier);
|
|
11009
10976
|
return Effect.succeedSome(Result.fail(name));
|
|
@@ -11014,7 +10981,7 @@ const referencesIn$2 = Effect.fn("referencesIn")(function* referencesIn(graph, f
|
|
|
11014
10981
|
onNone: () => [],
|
|
11015
10982
|
onSome: (source) => specifiersIn(graph.api, file, source)
|
|
11016
10983
|
});
|
|
11017
|
-
const references = yield* Effect.forEach(specifiers, (specifier) => referenceOf$
|
|
10984
|
+
const references = yield* Effect.forEach(specifiers, (specifier) => referenceOf$3(graph, file, specifier), { concurrency: 1 });
|
|
11018
10985
|
const found = Array.getSomes(references);
|
|
11019
10986
|
return {
|
|
11020
10987
|
packages: Array.getFailures(found),
|
|
@@ -11062,7 +11029,6 @@ const InstalledManifest = Schema.Struct({
|
|
|
11062
11029
|
peerDependenciesMeta: PeerMeta
|
|
11063
11030
|
});
|
|
11064
11031
|
const decodeManifest$6 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
|
|
11065
|
-
const keysOf = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
11066
11032
|
const isOptionalPeer = (manifest, name) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(name)), Option.exists((meta) => meta.optional === true));
|
|
11067
11033
|
const installedNames = (manifest) => [
|
|
11068
11034
|
...keysOf(manifest.dependencies),
|
|
@@ -11345,7 +11311,6 @@ const Manifest$5 = Schema.Struct({
|
|
|
11345
11311
|
});
|
|
11346
11312
|
const decode = Schema.decodeOption(Schema.fromJsonString(Manifest$5));
|
|
11347
11313
|
const manifestOf$1 = (text) => decode(text);
|
|
11348
|
-
const dependencyNames = (manifest) => pipe(Option.fromUndefinedOr(manifest.dependencies), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
11349
11314
|
const isFileList = Schema.is(Schema.Array(Schema.String));
|
|
11350
11315
|
const sourcesOf$1 = (workspace, target) => pipe(workspace.packEntries, Array.filter((entry) => entry.name === entryNameOf(target)), Array.map((entry) => entry.source));
|
|
11351
11316
|
const listedSources = (declared, { workspace, join }) => new Set(pipe(declared, Array.flatMap((target) => Array.append(sourcesOf$1(workspace, target), join(target)))));
|
|
@@ -11391,7 +11356,7 @@ const optionalPeerProblems = ({ located, dependencies, used }) => {
|
|
|
11391
11356
|
const libraries = pipe(used, Array.filter(({ entry }) => !isBinEntry(entry)));
|
|
11392
11357
|
const bins = pipe(used, Array.filter(({ entry }) => isBinEntry(entry)));
|
|
11393
11358
|
if (libraries.length <= SINGLE) return [];
|
|
11394
|
-
return pipe(dependencies, Array.flatMap((name) => {
|
|
11359
|
+
return pipe(keysOf(dependencies), Array.flatMap((name) => {
|
|
11395
11360
|
const importers = pipe(libraries, Array.filter(importsPackage(name)));
|
|
11396
11361
|
const neededByBin = pipe(bins, Array.some(importsPackage(name)));
|
|
11397
11362
|
if (!(importers.length > START$18 && importers.length < libraries.length) || neededByBin) return [];
|
|
@@ -11470,7 +11435,7 @@ const messageOf$3 = (statement) => {
|
|
|
11470
11435
|
};
|
|
11471
11436
|
const problemsIn$13 = (api) => (file) => (source) => {
|
|
11472
11437
|
const retained = api.createSourceFile(file, source);
|
|
11473
|
-
const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$
|
|
11438
|
+
const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$7({
|
|
11474
11439
|
rule: RULE$35,
|
|
11475
11440
|
message: messageOf$3(statement)
|
|
11476
11441
|
})(statement)));
|
|
@@ -11565,7 +11530,7 @@ const analyse = Effect.fn("analyse")(function* analyse(pack) {
|
|
|
11565
11530
|
...effects,
|
|
11566
11531
|
...optionalPeerProblems({
|
|
11567
11532
|
located,
|
|
11568
|
-
dependencies:
|
|
11533
|
+
dependencies: manifest.dependencies,
|
|
11569
11534
|
used
|
|
11570
11535
|
})
|
|
11571
11536
|
];
|
|
@@ -11724,8 +11689,10 @@ const slotTarget = (context) => (expression) => slotOf(context.checker)(expressi
|
|
|
11724
11689
|
}));
|
|
11725
11690
|
const libraryTargetOf = (context) => (expression, contextual) => aliasTarget(context)(contextual).pipe(Option.orElse(() => slotTarget(context)(expression)));
|
|
11726
11691
|
const siteWithin = (context) => (node) => Array.findFirst(context.sites, (site) => contains(node)(site.node));
|
|
11727
|
-
const
|
|
11728
|
-
const
|
|
11692
|
+
const aliasDeclarationOf = (type) => Option.fromUndefinedOr(type.getAliasSymbol()).pipe(Option.flatMap((alias) => Array.findFirst(declarationsOf(alias), isTypeAliasDeclaration)));
|
|
11693
|
+
const aliasSite = (context) => (type) => Option.flatMap(aliasDeclarationOf(type), siteWithin(context));
|
|
11694
|
+
const annotationAt = (checker) => (expression) => symbolAt(checker)(expression).pipe(Option.flatMap((symbol) => Option.fromUndefinedOr(symbol.valueDeclaration)), Option.flatMap((handle) => Option.fromUndefinedOr(handle.resolve())), Option.flatMap(annotationOf));
|
|
11695
|
+
const annotationSite = (context) => (expression) => annotationAt(context.checker)(expression).pipe(Option.flatMap((annotation) => siteWithin(context)(annotation).pipe(Option.orElse(() => aliasSite(context)(context.checker.getTypeFromTypeNode(annotation))))));
|
|
11729
11696
|
const siteBehind = (context) => (expression) => aliasSite(context)(context.checker.getTypeAtLocation(expression)).pipe(Option.orElse(() => annotationSite(context)(expression)));
|
|
11730
11697
|
const isFlowSource = (node) => isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node);
|
|
11731
11698
|
const flowOf = (context) => (expression) => Option.fromUndefinedOr(context.checker.getContextualType(expression)).pipe(Option.flatMap((contextual) => Option.all([vocabularyOf(context.checker)(contextual), libraryTargetOf(context)(expression, contextual)])), Option.flatMap(([vocabulary, target]) => siteBehind(context)(expression).pipe(Option.filter((site) => isSubsetOf(site.values, vocabulary.values)), Option.map((site) => ({
|
|
@@ -11852,7 +11819,7 @@ const ownerValuesOf = (checker) => (declaration) => {
|
|
|
11852
11819
|
const type = checker.getTypeAtLocation(declaration.name);
|
|
11853
11820
|
return finiteValuesOf(checker)(type).pipe(Option.orElse(() => objectValuesOf(checker)(type)));
|
|
11854
11821
|
};
|
|
11855
|
-
const annotationProblem = (message) => problemAt$
|
|
11822
|
+
const annotationProblem = (message) => problemAt$7({
|
|
11856
11823
|
rule: "owner-annotation",
|
|
11857
11824
|
message
|
|
11858
11825
|
});
|
|
@@ -11988,7 +11955,7 @@ const shapeProblem = (site, matches) => {
|
|
|
11988
11955
|
onNone: () => "Derive it from the library type, for example with Pick, instead of copying its properties.",
|
|
11989
11956
|
onSome: () => "Use the library type instead of copying it."
|
|
11990
11957
|
});
|
|
11991
|
-
return problemAt$
|
|
11958
|
+
return problemAt$7({
|
|
11992
11959
|
rule: "library-shape",
|
|
11993
11960
|
message: `This shape copies ${shown}. ${advice}`
|
|
11994
11961
|
})(site.node);
|
|
@@ -12036,14 +12003,10 @@ const selectsKeys = (checker) => (node, values) => {
|
|
|
12036
12003
|
return pipe(typeArguments, Array.filter((argument) => argument !== node), Array.some((argument) => isSubsetOf(values, propertyNamesOf(checker)(checker.getTypeFromTypeNode(argument)))));
|
|
12037
12004
|
};
|
|
12038
12005
|
const FILTERED_TYPE = 0;
|
|
12039
|
-
const isConditionalAlias = (
|
|
12006
|
+
const isConditionalAlias = (declaration) => isTypeAliasDeclaration(declaration) && declaration.type.kind === SyntaxKind.ConditionalType;
|
|
12040
12007
|
const filtersBy = (checker) => (node) => {
|
|
12041
12008
|
const { parent } = node;
|
|
12042
|
-
|
|
12043
|
-
const typeArguments = parent.typeArguments ?? [];
|
|
12044
|
-
if (Array.findFirstIndex(typeArguments, (argument) => argument === node).pipe(Option.exists((position) => position > FILTERED_TYPE)) && isConditionalAlias(checker)(parent)) return true;
|
|
12045
|
-
}
|
|
12046
|
-
return parent.kind !== SyntaxKind.SourceFile && filtersBy(checker)(parent);
|
|
12009
|
+
return isTypeReferenceNode(parent) && Array.findFirstIndex(parent.typeArguments ?? [], (argument) => argument === node).pipe(Option.exists((position) => position > FILTERED_TYPE)) && symbolAtLocation(checker)(parent.typeName).pipe(Option.map(declarationsOf), Option.exists(Array.some(isConditionalAlias))) || parent.kind !== SyntaxKind.SourceFile && filtersBy(checker)(parent);
|
|
12047
12010
|
};
|
|
12048
12011
|
const unionValuesOf = (checker) => (node) => literalUnionOf(checker.getTypeFromTypeNode(node)).pipe(Option.filter((values) => !selectsKeys(checker)(node, values) && !filtersBy(checker)(node)));
|
|
12049
12012
|
const isExpressionSite = (node) => isArrayLiteralExpression(node) || isCallExpression(node);
|
|
@@ -12093,7 +12056,7 @@ const derivedVerdict = (context) => (site) => {
|
|
|
12093
12056
|
const added = pipe(site.values, Array.filter((value) => !isSubsetOf([value], held)));
|
|
12094
12057
|
if (!Array.isReadonlyArrayNonEmpty(owners) || !Array.isReadonlyArrayNonEmpty(added)) return verdict([], []);
|
|
12095
12058
|
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.`;
|
|
12096
|
-
return verdict([problemAt$
|
|
12059
|
+
return verdict([problemAt$7({
|
|
12097
12060
|
rule: "owner-extension",
|
|
12098
12061
|
message
|
|
12099
12062
|
})(site.node)], []);
|
|
@@ -12115,7 +12078,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
12115
12078
|
const owners = pipe(context.owners, Array.filter((owner) => isSubsetOf(site.values, owner.values)));
|
|
12116
12079
|
if (Array.isReadonlyArrayNonEmpty(owners)) {
|
|
12117
12080
|
const message = `The values ${formatValues(site.values)} are owned by ${describeOwners(owners)}. Derive this set from the owner instead of restating it.`;
|
|
12118
|
-
return verdict([problemAt$
|
|
12081
|
+
return verdict([problemAt$7({
|
|
12119
12082
|
rule: "owner-value-set",
|
|
12120
12083
|
message
|
|
12121
12084
|
})(site.node)], []);
|
|
@@ -12123,7 +12086,7 @@ const originalVerdict = (context) => (site) => {
|
|
|
12123
12086
|
const candidates = libraryCandidates(context)(site);
|
|
12124
12087
|
if (Array.isReadonlyArrayNonEmpty(candidates)) {
|
|
12125
12088
|
const message = `The values ${formatValues(site.values)} restate a dependency type: ${listCandidates(candidates)}. Derive this set from the library type.`;
|
|
12126
|
-
return verdict([problemAt$
|
|
12089
|
+
return verdict([problemAt$7({
|
|
12127
12090
|
rule: "library-value-set",
|
|
12128
12091
|
message
|
|
12129
12092
|
})(site.node)], []);
|
|
@@ -12154,7 +12117,7 @@ const isValuePosition = (node) => {
|
|
|
12154
12117
|
const { parent } = node;
|
|
12155
12118
|
return VALUE_PARENT_KINDS.has(parent.kind) || pipe(VALUE_SLOTS, Array.some((isSlot) => isSlot(node, parent)));
|
|
12156
12119
|
};
|
|
12157
|
-
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.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$
|
|
12120
|
+
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.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$7({
|
|
12158
12121
|
rule: "owned-literal",
|
|
12159
12122
|
message: `${literal.getText()} is a value of ${describeOwners(owners)}. Write it through the owner's binding instead of as a literal.`
|
|
12160
12123
|
})(literal)));
|
|
@@ -12445,17 +12408,19 @@ const subsetListProblem = ({ lists, literals, relative }) => {
|
|
|
12445
12408
|
const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
12446
12409
|
const lists = pipe(sites, Array.dedupeWith((left, right) => left.file === right.file && left.start === right.start), Array.map(nameListOf), Array.getSomes);
|
|
12447
12410
|
const { relative } = repository;
|
|
12448
|
-
const
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12411
|
+
const checks = [
|
|
12412
|
+
listedPathProblem(repository),
|
|
12413
|
+
declaredNameProblem({
|
|
12414
|
+
literals,
|
|
12415
|
+
relative
|
|
12416
|
+
}),
|
|
12417
|
+
subsetListProblem({
|
|
12418
|
+
lists,
|
|
12419
|
+
literals,
|
|
12420
|
+
relative
|
|
12421
|
+
})
|
|
12422
|
+
];
|
|
12423
|
+
return pipe(lists, Array.map((list) => Array.findFirst(checks, (check) => check(list))), Array.getSomes);
|
|
12459
12424
|
};
|
|
12460
12425
|
// src/features/check-value-owners/model/repository-names.ts
|
|
12461
12426
|
const MANIFEST$3 = "package.json";
|
|
@@ -12595,7 +12560,7 @@ const destructuredName = (declaration) => {
|
|
|
12595
12560
|
if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
|
|
12596
12561
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
12597
12562
|
};
|
|
12598
|
-
const problemOf$4 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$
|
|
12563
|
+
const problemOf$4 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
12599
12564
|
rule: RULE$31,
|
|
12600
12565
|
message: messageOf$1(name)
|
|
12601
12566
|
})), Option.map((report) => report(declaration)));
|
|
@@ -12700,7 +12665,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
12700
12665
|
};
|
|
12701
12666
|
const problemOf$3 = (checker) => (candidate) => {
|
|
12702
12667
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
12703
|
-
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$
|
|
12668
|
+
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
12704
12669
|
rule: RULE$30,
|
|
12705
12670
|
message: messageOf(forward.callee.getText())
|
|
12706
12671
|
})(candidate.name)));
|
|
@@ -12774,11 +12739,11 @@ const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\
|
|
|
12774
12739
|
const PLUGIN_ROOT = "..";
|
|
12775
12740
|
const READ_CONCURRENCY$11 = 16;
|
|
12776
12741
|
const START$16 = 0;
|
|
12777
|
-
const referenceOf$
|
|
12742
|
+
const referenceOf$2 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
12778
12743
|
path,
|
|
12779
12744
|
index: found.index ?? START$16
|
|
12780
12745
|
})), Option.toArray);
|
|
12781
|
-
const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$
|
|
12746
|
+
const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$2));
|
|
12782
12747
|
const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
12783
12748
|
const files = yield* RepositoryFiles;
|
|
12784
12749
|
const text = yield* files.readFile(file);
|
|
@@ -13231,20 +13196,16 @@ const commandProblems$1 = (sources) => pipe(sources, Array.flatMap(problemsOf));
|
|
|
13231
13196
|
// src/features/check-vite-plus/model/doc-sources.ts
|
|
13232
13197
|
const FENCE = /^(?<open>```(?:sh|bash|shell|console|zsh)?[ \t]*\n)(?<body>[\s\S]*?)^```[ \t]*$/gmu;
|
|
13233
13198
|
const INLINE_CODE = /(?<open>(?<!`)`)(?<body>[^`\n]+)`(?!`)/gu;
|
|
13234
|
-
const
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
start: index + open.length,
|
|
13245
|
-
end: index + whole.length
|
|
13246
|
-
})), Option.toArray);
|
|
13247
|
-
}));
|
|
13199
|
+
const codeIn = (pattern) => (source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => pipe(Option.all({
|
|
13200
|
+
open: groupOf("open")(match),
|
|
13201
|
+
text: groupOf("body")(match),
|
|
13202
|
+
whole: Array.head(match),
|
|
13203
|
+
index: Option.fromUndefinedOr(match.index)
|
|
13204
|
+
}), Option.map(({ open, text, whole, index }) => ({
|
|
13205
|
+
text,
|
|
13206
|
+
start: index + open.length,
|
|
13207
|
+
end: index + whole.length
|
|
13208
|
+
})), Option.toArray)));
|
|
13248
13209
|
const outside = (fences) => (span) => !pipe(fences, Array.some((fence) => span.start >= fence.start && span.start < fence.end));
|
|
13249
13210
|
const docSources = (file) => (source) => {
|
|
13250
13211
|
const fences = codeIn(FENCE)(source);
|
|
@@ -13594,10 +13555,12 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
13594
13555
|
});
|
|
13595
13556
|
// src/shared/lib/comment-directives.ts
|
|
13596
13557
|
const COMMENT_DIRECTIVES = [
|
|
13558
|
+
"oxlint-disable",
|
|
13597
13559
|
"textlint-disable",
|
|
13598
13560
|
"textlint-enable",
|
|
13599
13561
|
String.raw`\* @internal \*?$`,
|
|
13600
13562
|
String.raw`\* @msch \S+ \*?$`,
|
|
13563
|
+
String.raw`\* @stability (?:experimental|unstable) \*?$`,
|
|
13601
13564
|
String.raw`shellcheck \w`,
|
|
13602
13565
|
String.raw`zizmor: ignore\[`,
|
|
13603
13566
|
String.raw`exit: \S`,
|
|
@@ -13681,7 +13644,7 @@ const loadGrammars = Effect.fn("loadGrammars")(function* loadGrammars() {
|
|
|
13681
13644
|
const commentNodesIn = (language, source) => pipe(readTree({
|
|
13682
13645
|
language,
|
|
13683
13646
|
source,
|
|
13684
|
-
read: (root) => pipe(root.descendantsOfType(COMMENT_NODES), Array.
|
|
13647
|
+
read: (root) => pipe(root.descendantsOfType(COMMENT_NODES), Array.filter(Predicate.isNotNullish), Array.map((node) => ({
|
|
13685
13648
|
index: node.startIndex,
|
|
13686
13649
|
text: node.text
|
|
13687
13650
|
})))
|
|
@@ -13698,11 +13661,11 @@ const scriptGrammar = (attribs) => {
|
|
|
13698
13661
|
if (SHADER_TYPE.test(type)) return Option.some("cpp");
|
|
13699
13662
|
return Option.liftPredicate("javascript", () => SCRIPT_TYPE.test(type));
|
|
13700
13663
|
};
|
|
13701
|
-
const
|
|
13702
|
-
|
|
13703
|
-
|
|
13704
|
-
return Option.none();
|
|
13664
|
+
const EMBEDDED_GRAMMARS = {
|
|
13665
|
+
style: () => Option.some("css"),
|
|
13666
|
+
script: scriptGrammar
|
|
13705
13667
|
};
|
|
13668
|
+
const embeddedGrammar = ({ name, attribs }) => Record.get(EMBEDDED_GRAMMARS, name).pipe(Option.flatMap((grammarOf) => grammarOf(attribs)));
|
|
13706
13669
|
const shifted = (offset) => ({ index, text }) => ({
|
|
13707
13670
|
index: index + offset,
|
|
13708
13671
|
text
|
|
@@ -14048,8 +14011,8 @@ const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf(held)), Array
|
|
|
14048
14011
|
})));
|
|
14049
14012
|
const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(namedCatalogsOf(settings), Array.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
|
|
14050
14013
|
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)));
|
|
14051
|
-
const referenceOf = ([name, specifier]) => pipe(decodeString$1(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
|
|
14052
|
-
const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf(section), Record.toEntries, Array.flatMap(referenceOf))));
|
|
14014
|
+
const referenceOf$1 = ([name, specifier]) => pipe(decodeString$1(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
|
|
14015
|
+
const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf(section), Record.toEntries, Array.flatMap(referenceOf$1))));
|
|
14053
14016
|
const versionsOf = (raw) => pipe(Option.fromUndefinedOr(raw), Option.map((listed) => pipe(String$1.split(listed, VERSION_SEPARATOR), Array.map(String$1.trim))), Option.getOrElse(() => []));
|
|
14054
14017
|
const hasKeyWith = (keys) => (prefix) => pipe(keys, Array.some(String$1.startsWith(prefix)));
|
|
14055
14018
|
const isLocked = (keys) => (resolved) => Array.contains(keys, resolved) || hasKeyWith(keys)(`${resolved}(`);
|
|
@@ -14068,7 +14031,7 @@ const usedReferences = Effect.fn("usedReferences")(function* usedReferences(root
|
|
|
14068
14031
|
const listed = yield* files.listedFiles(root);
|
|
14069
14032
|
const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$2.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$6 });
|
|
14070
14033
|
const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$10(text))), Array.flatMap(referencesIn));
|
|
14071
|
-
const fromOverrides = pipe(fieldsOf(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
|
|
14034
|
+
const fromOverrides = pipe(fieldsOf(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf$1));
|
|
14072
14035
|
return /* @__PURE__ */ new Set([...fromManifests, ...fromOverrides]);
|
|
14073
14036
|
});
|
|
14074
14037
|
const lineOf$1 = (source) => (needle) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => needle.test(line)), Option.match({
|
|
@@ -14078,17 +14041,17 @@ const lineOf$1 = (source) => (needle) => pipe(String$1.split(source, "\n"), Arra
|
|
|
14078
14041
|
const quoted = (name) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(name);
|
|
14079
14042
|
const entryLine = (name) => new RegExp(`^\\s+["']?${quoted(name)}["']?:`, "u");
|
|
14080
14043
|
const excludeLine = (entry) => new RegExp(`^\\s+-\\s+["']?${quoted(entry)}["']?\\s*$`, "u");
|
|
14081
|
-
const problemAt$
|
|
14044
|
+
const problemAt$4 = ({ file, at }, rule, message) => (name, needle) => ({
|
|
14082
14045
|
file,
|
|
14083
14046
|
line: at(needle),
|
|
14084
14047
|
column: FIRST_COLUMN$1,
|
|
14085
14048
|
rule,
|
|
14086
14049
|
message: `\`${name}\` ${message}`
|
|
14087
14050
|
});
|
|
14088
|
-
const unusedIn = (located, settings, isUsed) => pipe(catalogEntries(settings), Array.filter(({ catalog, name }) => !isUsed(`${catalog}:${name}`)), Array.map(({ name }) => problemAt$
|
|
14051
|
+
const unusedIn = (located, settings, isUsed) => pipe(catalogEntries(settings), Array.filter(({ catalog, name }) => !isUsed(`${catalog}:${name}`)), Array.map(({ name }) => problemAt$4(located, UNUSED_RULE, UNUSED_MESSAGE)(name, entryLine(name))));
|
|
14089
14052
|
const staleIn = (located, settings, keys) => {
|
|
14090
14053
|
const excludes = Option.getOrElse(decodeStrings(settings["minimumReleaseAgeExclude"]), () => []);
|
|
14091
|
-
return pipe(Option.toArray(keys), Array.flatMap((locked) => pipe(excludes, Array.filter((entry) => !resolvedIn(locked)(entry)))), Array.map((entry) => problemAt$
|
|
14054
|
+
return pipe(Option.toArray(keys), Array.flatMap((locked) => pipe(excludes, Array.filter((entry) => !resolvedIn(locked)(entry)))), Array.map((entry) => problemAt$4(located, STALE_RULE, STALE_MESSAGE)(entry, excludeLine(entry))));
|
|
14092
14055
|
};
|
|
14093
14056
|
const findingsIn = Effect.fn("findingsIn")(function* findingsIn(root, file, settings) {
|
|
14094
14057
|
const read = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -14132,7 +14095,7 @@ const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source
|
|
|
14132
14095
|
const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
|
|
14133
14096
|
const taggedError$1 = Schema.TaggedError;
|
|
14134
14097
|
var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
14135
|
-
const problemAt$
|
|
14098
|
+
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
14136
14099
|
file,
|
|
14137
14100
|
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
|
|
14138
14101
|
rule,
|
|
@@ -14154,20 +14117,20 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
|
|
|
14154
14117
|
})));
|
|
14155
14118
|
});
|
|
14156
14119
|
const entryProblems = ({ file, text, sources }) => {
|
|
14157
|
-
const at = problemAt$
|
|
14120
|
+
const at = problemAt$3(ENTRY_RULE, file, text);
|
|
14158
14121
|
return pipe(Record.get(sources, SOURCE), Option.match({
|
|
14159
14122
|
onNone: () => [at("skills", `does not install ${SOURCE}. Add "${SOURCE}": { commit, root: "plugins/masseater-skills/skills", skills: "all" } to skills.`)],
|
|
14160
14123
|
onSome: (source) => pipe(Option.liftPredicate(source, ({ skills }) => skills !== "all"), Option.map(() => at(`"${SOURCE}"`, `picks skills from ${SOURCE} by name. Write skills: "all", so every repository gets each new skill with the next digest update.`)), Option.toArray)
|
|
14161
14124
|
}));
|
|
14162
14125
|
};
|
|
14163
14126
|
const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
|
|
14164
|
-
const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array.map(([repository]) => problemAt$
|
|
14127
|
+
const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array.map(([repository]) => problemAt$3(VISIBLE_RULE, file, text)(repository, `declares ${repository} in a form the Renovate preset cannot read. Write "${repository}": { commit: "<sha>", ... } with commit first and as a string literal.`)));
|
|
14165
14128
|
const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root) {
|
|
14166
14129
|
const files = yield* RepositoryFiles;
|
|
14167
14130
|
const file = files.join(root, RENOVATE_FILE$1);
|
|
14168
14131
|
const text = yield* files.readFile(file);
|
|
14169
14132
|
if (pipe(text, Option.exists(String$1.includes(`"${PRESET$1}"`)))) return [];
|
|
14170
|
-
return [problemAt$
|
|
14133
|
+
return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET$1}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE$1}.`)];
|
|
14171
14134
|
});
|
|
14172
14135
|
/** @internal */
|
|
14173
14136
|
const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
|
|
@@ -14188,7 +14151,7 @@ const MANIFEST_FILE = "package.json";
|
|
|
14188
14151
|
const SKILL_FILE$1 = "SKILL.md";
|
|
14189
14152
|
const SUCCEEDED = 0;
|
|
14190
14153
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
14191
|
-
const problemAt$
|
|
14154
|
+
const problemAt$2 = problemInFile(RULE$14);
|
|
14192
14155
|
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array.filter((file) => files.basename(file) === SKILL_FILE$1), Array.map((file) => files.relative(directory, files.dirname(file))));
|
|
14193
14156
|
const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
|
|
14194
14157
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -14214,9 +14177,9 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, project)
|
|
|
14214
14177
|
const directory = files.join(root, project.directory);
|
|
14215
14178
|
const manifest = files.join(directory, MANIFEST_FILE);
|
|
14216
14179
|
const skills = skillDirectoriesIn(files, directory);
|
|
14217
|
-
if (!Array.isReadonlyArrayNonEmpty(skills)) return [problemAt$
|
|
14180
|
+
if (!Array.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without agent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$1}, so that repositories which approve them in the permissions of pnpm-workspace.yaml give their agents guidance for the installed version.`)];
|
|
14218
14181
|
const validation = yield* validationOf(directory).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
14219
|
-
return [...pipe(packagingMessages(project, skills), Array.map((message) => problemAt$
|
|
14182
|
+
return [...pipe(packagingMessages(project, skills), Array.map((message) => problemAt$2(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$2(files.join(directory, SKILLS), `fails intent validate:\n${output}`)), Option.toArray)];
|
|
14220
14183
|
});
|
|
14221
14184
|
/** @internal */
|
|
14222
14185
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
@@ -14254,13 +14217,13 @@ const Frontmatter = Schema.Struct({
|
|
|
14254
14217
|
});
|
|
14255
14218
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
14256
14219
|
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
|
|
14257
|
-
const frontmatterOf = (source) => pipe(groupOf
|
|
14220
|
+
const frontmatterOf = (source) => pipe(groupOf("yaml")(FRONTMATTER.exec(source)), Option.flatMap(Option.liftThrowable((yaml) => parse$2(yaml))), Option.flatMap(decodeFrontmatter));
|
|
14258
14221
|
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
|
|
14259
14222
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
14260
14223
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
14261
14224
|
const bodyStart = bodyStartOf(source);
|
|
14262
14225
|
const body = String$1.slice(bodyStart)(source);
|
|
14263
|
-
const heading = groupOf
|
|
14226
|
+
const heading = groupOf("title")(HEADING.exec(body));
|
|
14264
14227
|
return [...pipe(Option.liftPredicate(name, (found) => found !== folder), Option.map((found) => ({
|
|
14265
14228
|
index: offsetOf$1(source, NAME_KEY$1),
|
|
14266
14229
|
message: `The frontmatter name "${found}" differs from the directory ${directory}. Give the skill the name of its directory.`
|
|
@@ -14286,7 +14249,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
14286
14249
|
rule: RULE$13,
|
|
14287
14250
|
message
|
|
14288
14251
|
})));
|
|
14289
|
-
const linkOf = (found) => pipe(groupOf
|
|
14252
|
+
const linkOf = (found) => pipe(groupOf("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
|
|
14290
14253
|
target,
|
|
14291
14254
|
index: found.index ?? START$9
|
|
14292
14255
|
})), Option.toArray);
|
|
@@ -14295,7 +14258,7 @@ const rangeOf$1 = (found) => {
|
|
|
14295
14258
|
return [start, start + found[START$9].length];
|
|
14296
14259
|
};
|
|
14297
14260
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
|
|
14298
|
-
const linksIn = (source) => {
|
|
14261
|
+
const linksIn$1 = (source) => {
|
|
14299
14262
|
const code = pipe(Array.fromIterable(String$1.matchAll(CODE)(source)), Array.map(rangeOf$1));
|
|
14300
14263
|
return pipe(Array.fromIterable(String$1.matchAll(LINK)(source)), Array.flatMap(linkOf), Array.filter(isOutside(code)));
|
|
14301
14264
|
};
|
|
@@ -14306,7 +14269,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
14306
14269
|
const source = text.value;
|
|
14307
14270
|
const directory = files.dirname(file);
|
|
14308
14271
|
const isMissing = ({ target }) => files.exists(files.join(directory, target)).pipe(Effect.map((exists) => !exists));
|
|
14309
|
-
const missing = yield* Effect.filter(linksIn(source), isMissing);
|
|
14272
|
+
const missing = yield* Effect.filter(linksIn$1(source), isMissing);
|
|
14310
14273
|
return pipe(missing, Array.map(({ target, index }) => ({
|
|
14311
14274
|
file,
|
|
14312
14275
|
...positionOf(source)(index),
|
|
@@ -14585,7 +14548,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
14585
14548
|
const names = pipe(manifest, Option.flatMap(({ dependencies }) => Option.fromUndefinedOr(dependencies)), Option.map(Record.keys), Option.getOrElse(() => []), Array.filter(String$1.startsWith(SCOPE$1)));
|
|
14586
14549
|
return yield* Effect.forEach(names, installedPackage, { concurrency: 1 });
|
|
14587
14550
|
});
|
|
14588
|
-
const problemAt$
|
|
14551
|
+
const problemAt$1 = (file, source) => (index, name) => ({
|
|
14589
14552
|
file,
|
|
14590
14553
|
...positionOf(source)(index),
|
|
14591
14554
|
rule: RULE$10,
|
|
@@ -14593,7 +14556,7 @@ const problemAt$2 = (file, source) => (index, name) => ({
|
|
|
14593
14556
|
});
|
|
14594
14557
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
14595
14558
|
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
14596
|
-
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array.map(binPattern))], Array.flatMap((pattern) => Array.fromIterable(String$1.matchAll(pattern)(source))), Array.map((found) => problemAt$
|
|
14559
|
+
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array.map(binPattern))], Array.flatMap((pattern) => Array.fromIterable(String$1.matchAll(pattern)(source))), Array.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND, entry.name)))));
|
|
14597
14560
|
const ownerOf$1 = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$1}`)(name)), Array.match({
|
|
14598
14561
|
onEmpty: () => "",
|
|
14599
14562
|
onNonEmpty: Array.max(BY_LENGTH)
|
|
@@ -14613,7 +14576,7 @@ const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appl
|
|
|
14613
14576
|
declared: manifest
|
|
14614
14577
|
}), Option.match({
|
|
14615
14578
|
onNone: () => [],
|
|
14616
|
-
onSome: ({ source, declared }) => pipe(declaredNames(declared), Array.filter((name) => Array.contains(appliedNames, name)), Array.flatMap((name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.map((index) => problemAt$
|
|
14579
|
+
onSome: ({ source, declared }) => pipe(declaredNames(declared), Array.filter((name) => Array.contains(appliedNames, name)), Array.flatMap((name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.map((index) => problemAt$1(file, source)(index, name)), Option.toArray)))
|
|
14617
14580
|
}));
|
|
14618
14581
|
});
|
|
14619
14582
|
const sourceUses = Effect.fn("sourceUses")(function* sourceUses({ root, applied, directories, consumers }) {
|
|
@@ -14901,7 +14864,7 @@ const PROTOCOL = /^[a-z+]+:/u;
|
|
|
14901
14864
|
const PATH_LIKE = "/";
|
|
14902
14865
|
const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
14903
14866
|
const MESSAGE = "is a range. The lockfile decides the version anyway, so a range only lets the next install move it without a diff. Write the exact version the lockfile resolves; `msch-publish` widens `dependencies` and `peerDependencies` to `^` in the published package.";
|
|
14904
|
-
const versionOf = (specifier) => Option.getOrElse(groupOf
|
|
14867
|
+
const versionOf = (specifier) => Option.getOrElse(groupOf("version")(ALIAS.exec(specifier)), () => specifier);
|
|
14905
14868
|
/** @internal */
|
|
14906
14869
|
const isRange = (specifier) => {
|
|
14907
14870
|
const version = versionOf(specifier);
|
|
@@ -15145,7 +15108,7 @@ const Manifest$2 = Schema.Struct({
|
|
|
15145
15108
|
engines: Schema.optional(Engines)
|
|
15146
15109
|
});
|
|
15147
15110
|
const decodeManifest$2 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
|
|
15148
|
-
const majorOf = (found) => pipe(groupOf
|
|
15111
|
+
const majorOf = (found) => pipe(groupOf("major")(found), Option.map(Number));
|
|
15149
15112
|
const isOld = (major) => major < MINIMUM;
|
|
15150
15113
|
const floorOf = (alternative) => majorOf(RANGE_FLOOR.exec(String$1.trim(alternative)));
|
|
15151
15114
|
const floorIsOld = (alternative) => pipe(floorOf(alternative), Option.match({
|
|
@@ -15153,19 +15116,14 @@ const floorIsOld = (alternative) => pipe(floorOf(alternative), Option.match({
|
|
|
15153
15116
|
onSome: isOld
|
|
15154
15117
|
}));
|
|
15155
15118
|
const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some(floorIsOld));
|
|
15156
|
-
const problemAt
|
|
15157
|
-
file: entry.file,
|
|
15158
|
-
...positionOf(source)(index),
|
|
15159
|
-
rule: RULE$3,
|
|
15160
|
-
message
|
|
15161
|
-
});
|
|
15119
|
+
const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$3)(entry.file, source)(index, message);
|
|
15162
15120
|
const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$2));
|
|
15163
|
-
const unstatedProblem = (entry, source) => problemAt
|
|
15121
|
+
const unstatedProblem = (entry, source) => problemAt({
|
|
15164
15122
|
entry,
|
|
15165
15123
|
source,
|
|
15166
15124
|
index: START$2
|
|
15167
15125
|
}, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
|
|
15168
|
-
const rangeProblem = (entry, source) => (range) => problemAt
|
|
15126
|
+
const rangeProblem = (entry, source) => (range) => problemAt({
|
|
15169
15127
|
entry,
|
|
15170
15128
|
source,
|
|
15171
15129
|
index: offsetOf(source, ENGINES_KEY)
|
|
@@ -15179,12 +15137,12 @@ const manifestProblems$1 = (entry, source) => {
|
|
|
15179
15137
|
if (Option.isNone(range) && isPublished(manifest.value)) return [unstatedProblem(entry, source)];
|
|
15180
15138
|
return pipe(range, Option.filter(admitsOld), Option.map(rangeProblem(entry, source)), Option.toArray);
|
|
15181
15139
|
};
|
|
15182
|
-
const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt
|
|
15140
|
+
const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt({
|
|
15183
15141
|
entry,
|
|
15184
15142
|
source,
|
|
15185
15143
|
index: found.index ?? START$2
|
|
15186
15144
|
}, `${SUPPORTED} \`${String$1.trim(found[START$2])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
|
|
15187
|
-
const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt
|
|
15145
|
+
const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
|
|
15188
15146
|
entry,
|
|
15189
15147
|
source,
|
|
15190
15148
|
index: START$2
|
|
@@ -15335,12 +15293,6 @@ const Manifest = Schema.fromJsonString(Schema.Struct({
|
|
|
15335
15293
|
}));
|
|
15336
15294
|
const decodeManifest = Schema.decodeUnknownOption(Manifest);
|
|
15337
15295
|
const isManifest = (name) => name === MANIFEST || String$1.endsWith(`/${MANIFEST}`)(name);
|
|
15338
|
-
const problemAt = (entry, source) => (index, message) => ({
|
|
15339
|
-
file: entry.file,
|
|
15340
|
-
...positionOf(source)(index),
|
|
15341
|
-
rule: RULE$1,
|
|
15342
|
-
message
|
|
15343
|
-
});
|
|
15344
15296
|
const keyIndex = (source, key) => Option.getOrElse(String$1.indexOf(`"${key}"`)(source), () => START);
|
|
15345
15297
|
const fieldsIn = (source) => pipe(decodeManifest(source), Option.match({
|
|
15346
15298
|
onNone: () => [],
|
|
@@ -15357,8 +15309,8 @@ const fieldsIn = (source) => pipe(decodeManifest(source), Option.match({
|
|
|
15357
15309
|
return [...pnpmFields, ...managerFields];
|
|
15358
15310
|
}
|
|
15359
15311
|
}));
|
|
15360
|
-
const manifestProblems = (entry, source) => pipe(fieldsIn(source), Array.map(({ name, key }) =>
|
|
15361
|
-
const firstEntryProblem = (entry, source, deviations) => pipe(Array.head(deviations.entries), Option.map(({ index }) =>
|
|
15312
|
+
const manifestProblems = (entry, source) => pipe(fieldsIn(source), Array.map(({ name, key }) => problemAtIndex(RULE$1)(entry.file, source)(keyIndex(source, key), `${name} in package.json is not allowed. ${PLACE} Move it there.`)));
|
|
15313
|
+
const firstEntryProblem = (entry, source, deviations) => pipe(Array.head(deviations.entries), Option.map(({ index }) => problemAtIndex(RULE$1)(entry.file, source)(index, `This file is not read for upstream deviations. ${PLACE}`)), Option.toArray);
|
|
15362
15314
|
const problemsIn = (entry, source) => {
|
|
15363
15315
|
if (isManifest(entry.name)) return manifestProblems(entry, source);
|
|
15364
15316
|
if (String$1.endsWith(NESTED_WORKSPACE)(entry.name)) return firstEntryProblem(entry, source, workspaceDeviations(source));
|