@r_masseater/msch 0.119.1 → 0.120.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/addon-tasks.mjs +1 -1
- package/dist/cargo-inputs.mjs +1 -1
- package/dist/cli.mjs +564 -319
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +3 -3
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-D_gAe4V_.mjs → define-lint-preset-CYgaGe8E.mjs} +4 -3
- package/dist/define-lint-preset-CYgaGe8E.mjs.map +1 -0
- package/dist/{dependencies-CgIp-gS1.mjs → dependencies-OrBsaeID.mjs} +2 -2
- package/dist/{dependencies-CgIp-gS1.mjs.map → dependencies-OrBsaeID.mjs.map} +1 -1
- package/dist/{derive-cargo-inputs-IFNMRDnZ.mjs → derive-cargo-inputs-Btc2ojuD.mjs} +3 -3
- package/dist/{derive-cargo-inputs-IFNMRDnZ.mjs.map → derive-cargo-inputs-Btc2ojuD.mjs.map} +1 -1
- package/dist/{ignored-directories-Btth0IHS.mjs → ignored-directories-wh-dhKsl.mjs} +2 -2
- package/dist/{ignored-directories-Btth0IHS.mjs.map → ignored-directories-wh-dhKsl.mjs.map} +1 -1
- package/dist/{index-CJiAUZDt.d.mts → index-B0ahB5vD.d.mts} +4 -11
- package/dist/{index-UROHZT4o.d.mts → index-D6X9EgDG.d.mts} +2 -2
- package/dist/library.mjs +2 -2
- package/dist/lint.d.mts +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/{problem-DaWjnZyW.mjs → problem-D0e14vkQ.mjs} +2 -2
- package/dist/{problem-DaWjnZyW.mjs.map → problem-D0e14vkQ.mjs.map} +1 -1
- package/dist/{published-BITU3twH.mjs → published-izw3wLkK.mjs} +25 -4
- package/dist/published-izw3wLkK.mjs.map +1 -0
- package/dist/{repository-files-BU_wY36C.mjs → repository-files-C8B7lrka.mjs} +2 -1
- package/dist/repository-files-C8B7lrka.mjs.map +1 -0
- package/dist/{repository-text-DluK673j.mjs → repository-text-cJOgGgCp.mjs} +4 -4
- package/dist/{repository-text-DluK673j.mjs.map → repository-text-cJOgGgCp.mjs.map} +1 -1
- package/dist/{workspace-projects-DYfp6Tpn.mjs → workspace-projects-C4I3zOvh.mjs} +2 -2
- package/dist/{workspace-projects-DYfp6Tpn.mjs.map → workspace-projects-C4I3zOvh.mjs.map} +1 -1
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +39 -10
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +4 -4
- package/skills/msch-repository-config/SKILL.md +3 -0
- package/dist/define-lint-preset-D_gAe4V_.mjs.map +0 -1
- package/dist/published-BITU3twH.mjs.map +0 -1
- package/dist/repository-files-BU_wY36C.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as nodeRepositoryFiles, n as NODE_MODULES$
|
|
3
|
-
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-
|
|
4
|
-
import { i as workspaceDependencies$1, n as installedManifest, r as readManifest, t as dependencyEntries } from "./dependencies-
|
|
5
|
-
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-
|
|
2
|
+
import { i as nodeRepositoryFiles, n as NODE_MODULES$2, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-C8B7lrka.mjs";
|
|
3
|
+
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$6, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-D0e14vkQ.mjs";
|
|
4
|
+
import { i as workspaceDependencies$1, n as installedManifest, r as readManifest, t as dependencyEntries } from "./dependencies-OrBsaeID.mjs";
|
|
5
|
+
import { C as keyName, D as stringsIn, E as propertyValue, S as childrenOf$4, T as nestedValues, a as workspaceManifest, b as workspaceConfigOf, c as TASK_NAMES, d as definesTask, f as hasVerifyTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as literalOf, x as KeySchema } from "./workspace-projects-C4I3zOvh.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as isIndexSkill, v as shadcnUiOf } from "./published-izw3wLkK.mjs";
|
|
8
8
|
import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-W6Uy7bV8.mjs";
|
|
9
|
-
import { a as CI_TASKS, c as meteredCommand, f as isIgnored, h as patternOf$1, m as namedWorkspaces, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES, u as existsAt } from "./repository-text-
|
|
9
|
+
import { a as CI_TASKS, c as meteredCommand, f as isIgnored, h as patternOf$1, m as namedWorkspaces, n as builtTextRuleNames, o as MSCH_TASK_COMMANDS, r as secretsOf, s as MSCH_VERIFY_COMMANDS, t as TEXT_IGNORES, u as existsAt } from "./repository-text-cJOgGgCp.mjs";
|
|
10
10
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
11
|
-
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-
|
|
11
|
+
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-CYgaGe8E.mjs";
|
|
12
12
|
import { builtinModules, isBuiltin } from "node:module";
|
|
13
|
-
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
14
13
|
import { Array as Array$1, Boolean as Boolean$1, Clock, Config, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Redacted, Result, Runtime, Schedule, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
15
14
|
import { Argument, Command, Flag } from "effect/cli";
|
|
16
15
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
@@ -30,6 +29,7 @@ import semver from "semver";
|
|
|
30
29
|
import { judgeText } from "@r_masseater/oxlint-plugin-decision";
|
|
31
30
|
import { NO_PATH, describeReference, diagnosticDetail, linksIn, lint, markdownPathspecs, referenceOf, y8Section } from "@r_masseater/y8";
|
|
32
31
|
import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
|
|
32
|
+
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
33
33
|
import { fu4Section, lint as lint$2, workflowPathspecs } from "@r_masseater/fu4";
|
|
34
34
|
import { isComment, isTag, isText } from "domhandler";
|
|
35
35
|
import { DomUtils, parseDocument as parseDocument$1 } from "htmlparser2";
|
|
@@ -43,9 +43,11 @@ import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_mass
|
|
|
43
43
|
import { arch, platform } from "node:os";
|
|
44
44
|
import { Base64 } from "effect/encoding";
|
|
45
45
|
import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
|
|
46
|
+
import { Buffer } from "node:buffer";
|
|
47
|
+
import { createZstdDecompress } from "node:zlib";
|
|
46
48
|
// package.json
|
|
47
49
|
var name = "@r_masseater/msch";
|
|
48
|
-
var version = "0.
|
|
50
|
+
var version = "0.120.0";
|
|
49
51
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
50
52
|
var repository = {
|
|
51
53
|
"type": "git",
|
|
@@ -345,7 +347,7 @@ const annotateResources = (api) => Effect.gen(function* annotateCompiler() {
|
|
|
345
347
|
const CONFIG_PATHSPEC$1 = `:(glob)**/tsconfig.json`;
|
|
346
348
|
const HIDDEN_PREFIX$1 = ".";
|
|
347
349
|
const SKIPPED_DIRECTORIES$1 = /* @__PURE__ */ new Set([
|
|
348
|
-
NODE_MODULES$
|
|
350
|
+
NODE_MODULES$2,
|
|
349
351
|
"dist",
|
|
350
352
|
"coverage"
|
|
351
353
|
]);
|
|
@@ -437,7 +439,7 @@ const mentions$1 = (needle) => ({ api }) => (configPath) => Effect.gen(function*
|
|
|
437
439
|
return pipe(texts, Array$1.some((text) => Option.exists(text, includesNeedle)));
|
|
438
440
|
});
|
|
439
441
|
// src/entities/project/model/inputs.ts
|
|
440
|
-
const SEPARATOR$
|
|
442
|
+
const SEPARATOR$29 = "/";
|
|
441
443
|
const SCOPE_PREFIX$1 = "@";
|
|
442
444
|
const HIDDEN_PREFIX = ".";
|
|
443
445
|
const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
@@ -458,7 +460,7 @@ const dependenciesOf = Effect.fn("dependenciesOf")(function* dependenciesOf(dire
|
|
|
458
460
|
onNone: () => [],
|
|
459
461
|
onSome: workspaceDependencies$1
|
|
460
462
|
});
|
|
461
|
-
return yield* Effect.forEach(names, (name) => files.realPath(files.join(directory, NODE_MODULES$
|
|
463
|
+
return yield* Effect.forEach(names, (name) => files.realPath(files.join(directory, NODE_MODULES$2, name)), { concurrency: 1 });
|
|
462
464
|
});
|
|
463
465
|
const workspaceClosure = Effect.fn("workspaceClosure")(function* workspaceClosure(start) {
|
|
464
466
|
const seen = /* @__PURE__ */ new Set([start]);
|
|
@@ -479,14 +481,14 @@ const closureOf$3 = Effect.fn("closureOf")(function* closureOf(root, configPath)
|
|
|
479
481
|
const directories = yield* workspaceClosure(directory);
|
|
480
482
|
return {
|
|
481
483
|
directories,
|
|
482
|
-
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$
|
|
484
|
+
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$29}`))
|
|
483
485
|
};
|
|
484
486
|
});
|
|
485
487
|
const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
|
|
486
488
|
const files = yield* RepositoryFiles;
|
|
487
489
|
if (!String$1.startsWith(SCOPE_PREFIX$1)(name)) return [name];
|
|
488
490
|
const scoped = yield* files.readDirectory(files.join(modules, name));
|
|
489
|
-
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$
|
|
491
|
+
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$29}${entry}`));
|
|
490
492
|
});
|
|
491
493
|
const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
|
|
492
494
|
const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
|
|
@@ -495,7 +497,7 @@ const installedNames$1 = Effect.fn("installedNames")(function* installedNames(mo
|
|
|
495
497
|
});
|
|
496
498
|
const installedPackages = Effect.fn("installedPackages")(function* installedPackages(root, directory) {
|
|
497
499
|
const files = yield* RepositoryFiles;
|
|
498
|
-
const modules = files.join(directory, NODE_MODULES$
|
|
500
|
+
const modules = files.join(directory, NODE_MODULES$2);
|
|
499
501
|
const names = yield* installedNames$1(modules);
|
|
500
502
|
return yield* Effect.forEach(names, (name) => files.realPath(files.join(modules, name)).pipe(Effect.map((found) => files.relative(root, found))), { concurrency: 1 });
|
|
501
503
|
});
|
|
@@ -640,7 +642,7 @@ const runTasksOf = Effect.fn("runTasksOf")(function* runTasksOf(root, directory)
|
|
|
640
642
|
})));
|
|
641
643
|
});
|
|
642
644
|
// src/entities/workspace/model/cargo-crates.ts
|
|
643
|
-
const SEPARATOR$
|
|
645
|
+
const SEPARATOR$28 = "/";
|
|
644
646
|
const SUCCESS$7 = 0;
|
|
645
647
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
646
648
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
@@ -680,22 +682,22 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
680
682
|
}, Effect.scoped);
|
|
681
683
|
/** @internal */
|
|
682
684
|
const owningWorkspace = (directories) => (directory) => {
|
|
683
|
-
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$
|
|
685
|
+
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$28}`)(directory)));
|
|
684
686
|
return Array$1.last(Array$1.sort(owners, String$1.Order));
|
|
685
687
|
};
|
|
686
688
|
// src/entities/workspace/model/plugins.ts
|
|
687
689
|
const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
|
|
688
690
|
const SKILLS_DIRECTORY = "skills";
|
|
689
691
|
const SKILL_FILE$4 = "SKILL.md";
|
|
690
|
-
const CONCURRENCY$
|
|
691
|
-
const SEPARATOR$
|
|
692
|
+
const CONCURRENCY$6 = 16;
|
|
693
|
+
const SEPARATOR$27 = "/";
|
|
692
694
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
693
695
|
name: Schema.String,
|
|
694
696
|
description: Schema.optionalKey(Schema.String),
|
|
695
697
|
version: Schema.optionalKey(Schema.Unknown)
|
|
696
698
|
}));
|
|
697
|
-
const decodeManifest$
|
|
698
|
-
const PACKAGE_FILE = "package.json";
|
|
699
|
+
const decodeManifest$2 = Schema.decodeUnknownOption(PluginManifest$1);
|
|
700
|
+
const PACKAGE_FILE$1 = "package.json";
|
|
699
701
|
const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.optionalKey(Schema.String) }));
|
|
700
702
|
const decodePackageVersion = Schema.decodeUnknownOption(PackageVersion);
|
|
701
703
|
const bySkillName = Order.mapInput(String$1.Order, ({ name }) => name);
|
|
@@ -704,7 +706,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
704
706
|
const directory = files.join(skills, name);
|
|
705
707
|
const file = files.join(directory, SKILL_FILE$4);
|
|
706
708
|
const source = yield* files.readFile(file);
|
|
707
|
-
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$
|
|
709
|
+
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$27}`;
|
|
708
710
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
709
711
|
return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
|
|
710
712
|
plugin,
|
|
@@ -717,7 +719,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
717
719
|
})))));
|
|
718
720
|
});
|
|
719
721
|
const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
|
|
720
|
-
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$
|
|
722
|
+
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$27}`;
|
|
721
723
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
722
724
|
});
|
|
723
725
|
const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
@@ -727,18 +729,18 @@ const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, direct
|
|
|
727
729
|
const found = yield* Effect.forEach(names, (entry) => skillIn(scan, {
|
|
728
730
|
plugin,
|
|
729
731
|
skills
|
|
730
|
-
}, entry), { concurrency: CONCURRENCY$
|
|
732
|
+
}, entry), { concurrency: CONCURRENCY$6 });
|
|
731
733
|
return Array$1.sort(Array$1.getSomes(found), bySkillName);
|
|
732
734
|
});
|
|
733
735
|
const packageVersionAt = Effect.fn("packageVersionAt")(function* packageVersionAt(directory) {
|
|
734
736
|
const files = yield* RepositoryFiles;
|
|
735
|
-
const text = yield* files.readFile(files.join(directory, PACKAGE_FILE));
|
|
737
|
+
const text = yield* files.readFile(files.join(directory, PACKAGE_FILE$1));
|
|
736
738
|
return pipe(text, Option.flatMap(decodePackageVersion), Option.flatMapNullishOr(({ version }) => version));
|
|
737
739
|
});
|
|
738
740
|
const pluginAt = Effect.fn("pluginAt")(function* pluginAt(scan, { directory, published }) {
|
|
739
741
|
const files = yield* RepositoryFiles;
|
|
740
742
|
const manifest = yield* files.readFile(files.join(directory, PLUGIN_FILE$4));
|
|
741
|
-
const decoded = pipe(manifest, Option.flatMap(decodeManifest$
|
|
743
|
+
const decoded = pipe(manifest, Option.flatMap(decodeManifest$2));
|
|
742
744
|
if (Option.isNone(decoded)) return Option.none();
|
|
743
745
|
const { name } = decoded.value;
|
|
744
746
|
const packageVersion = yield* packageVersionAt(directory);
|
|
@@ -766,7 +768,7 @@ const pluginsIn$1 = Effect.fn("pluginsIn")(function* pluginsIn(root) {
|
|
|
766
768
|
}, {
|
|
767
769
|
directory: files.join(root, directory),
|
|
768
770
|
published
|
|
769
|
-
}), { concurrency: CONCURRENCY$
|
|
771
|
+
}), { concurrency: CONCURRENCY$6 });
|
|
770
772
|
return Array$1.getSomes(found);
|
|
771
773
|
});
|
|
772
774
|
const HYPHENATED = "-";
|
|
@@ -780,10 +782,10 @@ const namesSkill = (skill) => (text) => new RegExp(namePattern(skill), "u").test
|
|
|
780
782
|
const SKILLS_START = "<!-- skills:generated -->";
|
|
781
783
|
const SKILLS_END = "<!-- /skills:generated -->";
|
|
782
784
|
// src/shared/lib/text-position.ts
|
|
783
|
-
const START$
|
|
785
|
+
const START$35 = 0;
|
|
784
786
|
const FIRST_COLUMN$8 = 1;
|
|
785
787
|
const positionOf = (source) => (index) => {
|
|
786
|
-
const before = pipe(source, String$1.slice(START$
|
|
788
|
+
const before = pipe(source, String$1.slice(START$35, index), String$1.split("\n"));
|
|
787
789
|
return {
|
|
788
790
|
line: before.length,
|
|
789
791
|
column: pipe(Array$1.last(before), Option.match({
|
|
@@ -1091,12 +1093,12 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1091
1093
|
// src/features/check-overrides/model/git-subpath.ts
|
|
1092
1094
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
1093
1095
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
1094
|
-
const RULE$
|
|
1096
|
+
const RULE$81 = "git-subpath-dependency";
|
|
1095
1097
|
const WHOLE_MATCH$4 = 0;
|
|
1096
1098
|
const problemAt$5 = ({ file }, source) => (found) => ({
|
|
1097
1099
|
file,
|
|
1098
1100
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
1099
|
-
rule: RULE$
|
|
1101
|
+
rule: RULE$81,
|
|
1100
1102
|
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])}\`.`
|
|
1101
1103
|
});
|
|
1102
1104
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
@@ -1107,13 +1109,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
1107
1109
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1108
1110
|
});
|
|
1109
1111
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1110
|
-
const RULE$
|
|
1112
|
+
const RULE$80 = "unnamed-restriction";
|
|
1111
1113
|
const WHOLE_MATCH$3 = 0;
|
|
1112
1114
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1113
1115
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1114
1116
|
file: entry.file,
|
|
1115
1117
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1116
|
-
rule: RULE$
|
|
1118
|
+
rule: RULE$80,
|
|
1117
1119
|
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.`
|
|
1118
1120
|
})));
|
|
1119
1121
|
/** @internal */
|
|
@@ -1122,13 +1124,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
1122
1124
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1123
1125
|
});
|
|
1124
1126
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1125
|
-
const RULE$
|
|
1127
|
+
const RULE$79 = "named-type-exemption";
|
|
1126
1128
|
const WHOLE_MATCH$2 = 0;
|
|
1127
1129
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1128
1130
|
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1129
1131
|
file: entry.file,
|
|
1130
1132
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1131
|
-
rule: RULE$
|
|
1133
|
+
rule: RULE$79,
|
|
1132
1134
|
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."
|
|
1133
1135
|
})));
|
|
1134
1136
|
/** @internal */
|
|
@@ -1144,21 +1146,21 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
|
|
|
1144
1146
|
const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
|
|
1145
1147
|
const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
|
|
1146
1148
|
// src/features/check-overrides/model/package-registry.ts
|
|
1147
|
-
const RULE$
|
|
1149
|
+
const RULE$78 = "package-registry";
|
|
1148
1150
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
1149
1151
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1150
1152
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
1151
1153
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
1152
|
-
const START$
|
|
1154
|
+
const START$34 = 0;
|
|
1153
1155
|
const REASON$4 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
1154
1156
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
1155
1157
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
1156
1158
|
const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
|
|
1157
|
-
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1159
|
+
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$34));
|
|
1158
1160
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1159
1161
|
file,
|
|
1160
1162
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
1161
|
-
rule: RULE$
|
|
1163
|
+
rule: RULE$78,
|
|
1162
1164
|
message: Option.match(registry, {
|
|
1163
1165
|
onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
1164
1166
|
onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
@@ -1166,9 +1168,9 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1166
1168
|
});
|
|
1167
1169
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
|
|
1168
1170
|
file: entry.file,
|
|
1169
|
-
...positionOf(source)(found.index ?? START$
|
|
1170
|
-
rule: RULE$
|
|
1171
|
-
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$
|
|
1171
|
+
...positionOf(source)(found.index ?? START$34),
|
|
1172
|
+
rule: RULE$78,
|
|
1173
|
+
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$34])}\`. Remove the line.`
|
|
1172
1174
|
})));
|
|
1173
1175
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
1174
1176
|
const files = yield* RepositoryFiles;
|
|
@@ -1193,7 +1195,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
|
|
|
1193
1195
|
// src/entities/package/model/stack-catalog.ts
|
|
1194
1196
|
const STACK_CATALOG = "catalog:stack";
|
|
1195
1197
|
// src/entities/package/model/specifiers.ts
|
|
1196
|
-
const START$
|
|
1198
|
+
const START$33 = 0;
|
|
1197
1199
|
const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
|
|
1198
1200
|
const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
|
|
1199
1201
|
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
@@ -1211,7 +1213,7 @@ const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.ra
|
|
|
1211
1213
|
/** @internal */
|
|
1212
1214
|
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
|
|
1213
1215
|
/** @internal */
|
|
1214
|
-
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1216
|
+
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$33));
|
|
1215
1217
|
const SECTIONS$1 = [
|
|
1216
1218
|
"dependencies",
|
|
1217
1219
|
"devDependencies",
|
|
@@ -1245,7 +1247,7 @@ const SELF_HOMEPAGE = homepage;
|
|
|
1245
1247
|
const SELF_DIRECTORY = repository.directory;
|
|
1246
1248
|
const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
1247
1249
|
// src/features/check-overrides/model/removed-peers.ts
|
|
1248
|
-
const RULE$
|
|
1250
|
+
const RULE$77 = "removed-peer";
|
|
1249
1251
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
1250
1252
|
const REMOVED = "-";
|
|
1251
1253
|
const PARENT_SEPARATOR = ">";
|
|
@@ -1272,7 +1274,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1272
1274
|
file,
|
|
1273
1275
|
line,
|
|
1274
1276
|
column,
|
|
1275
|
-
rule: RULE$
|
|
1277
|
+
rule: RULE$77,
|
|
1276
1278
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
1277
1279
|
});
|
|
1278
1280
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
@@ -3413,7 +3415,7 @@ const matcher = (patterns) => {
|
|
|
3413
3415
|
String$1.startsWith(NEGATION$1);
|
|
3414
3416
|
String$1.slice(1);
|
|
3415
3417
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
3416
|
-
const RULE$
|
|
3418
|
+
const RULE$76 = "colocated-git-patterns";
|
|
3417
3419
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
3418
3420
|
const ROOT$3 = ".";
|
|
3419
3421
|
const NEGATION = "!";
|
|
@@ -3460,7 +3462,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3460
3462
|
const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
|
|
3461
3463
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
3462
3464
|
});
|
|
3463
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
3465
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$76)(entry.file, {
|
|
3464
3466
|
line: entry.line,
|
|
3465
3467
|
column: FIRST$26
|
|
3466
3468
|
}, message);
|
|
@@ -3523,7 +3525,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
3523
3525
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3524
3526
|
});
|
|
3525
3527
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3526
|
-
const RULE$
|
|
3528
|
+
const RULE$75 = "colocated-test";
|
|
3527
3529
|
const FIRST$25 = 1;
|
|
3528
3530
|
const READ_CONCURRENCY$40 = 64;
|
|
3529
3531
|
const ROOT_SUBPATH$2 = ".";
|
|
@@ -3542,11 +3544,11 @@ const EXCLUDED$8 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguis
|
|
|
3542
3544
|
const DIRECTORY_MESSAGE = "sits in a separate test directory. Put each test next to the module it tests, and test-only helpers next to the tests as <name>.test.support.ts.";
|
|
3543
3545
|
const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test next to the module it tests and import that module, or a helper beside it, with ./<name>.";
|
|
3544
3546
|
const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3545
|
-
const problemFor$
|
|
3547
|
+
const problemFor$11 = (test, message) => ({
|
|
3546
3548
|
file: test.file,
|
|
3547
3549
|
line: FIRST$25,
|
|
3548
3550
|
column: FIRST$25,
|
|
3549
|
-
rule: RULE$
|
|
3551
|
+
rule: RULE$75,
|
|
3550
3552
|
message: `${test.base} ${message}`
|
|
3551
3553
|
});
|
|
3552
3554
|
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);
|
|
@@ -3586,10 +3588,10 @@ const refersIn = Effect.fn("refersIn")(function* refersIn(context, test) {
|
|
|
3586
3588
|
});
|
|
3587
3589
|
const inSeparateTestDirectory = (name) => SEPARATE_TEST_DIRECTORY.test(name) || SPEC_DIRECTORY.test(name) && SPEC_FILE.test(name);
|
|
3588
3590
|
const problemIn$8 = Effect.fn("problemIn")(function* problemIn(context, test) {
|
|
3589
|
-
if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$
|
|
3591
|
+
if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$11(test, DIRECTORY_MESSAGE));
|
|
3590
3592
|
if (!TEST_FILE$4.test(test.name)) return Option.none();
|
|
3591
3593
|
if (yield* refersIn(context, test)) return Option.none();
|
|
3592
|
-
return Option.some(problemFor$
|
|
3594
|
+
return Option.some(problemFor$11(test, SIBLING_MESSAGE));
|
|
3593
3595
|
});
|
|
3594
3596
|
/** @internal */
|
|
3595
3597
|
const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
|
|
@@ -3629,22 +3631,22 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3629
3631
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3630
3632
|
const RECOMMENDED_LINES = 200;
|
|
3631
3633
|
const FIRST$24 = 1;
|
|
3632
|
-
const RULE$
|
|
3634
|
+
const RULE$74 = "agent-docs-length";
|
|
3633
3635
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3634
|
-
const problemFor$
|
|
3636
|
+
const problemFor$10 = (file) => (lines) => {
|
|
3635
3637
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
3636
3638
|
return Option.some({
|
|
3637
3639
|
file,
|
|
3638
3640
|
line: 201,
|
|
3639
3641
|
column: FIRST$24,
|
|
3640
|
-
rule: RULE$
|
|
3642
|
+
rule: RULE$74,
|
|
3641
3643
|
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.`
|
|
3642
3644
|
});
|
|
3643
3645
|
};
|
|
3644
3646
|
/** @internal */
|
|
3645
|
-
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$
|
|
3647
|
+
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
|
|
3646
3648
|
// src/features/check-placement/model/claude-link.ts
|
|
3647
|
-
const RULE$
|
|
3649
|
+
const RULE$73 = "claude-md-link";
|
|
3648
3650
|
const CLAUDE = "CLAUDE.md";
|
|
3649
3651
|
const AGENTS = "AGENTS.md";
|
|
3650
3652
|
const FIRST$23 = 1;
|
|
@@ -3663,7 +3665,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3663
3665
|
file: path,
|
|
3664
3666
|
line: FIRST$23,
|
|
3665
3667
|
column: FIRST$23,
|
|
3666
|
-
rule: RULE$
|
|
3668
|
+
rule: RULE$73,
|
|
3667
3669
|
message: MESSAGE$15
|
|
3668
3670
|
})));
|
|
3669
3671
|
});
|
|
@@ -3672,11 +3674,11 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3672
3674
|
return Array$1.getSomes(found);
|
|
3673
3675
|
});
|
|
3674
3676
|
// src/features/check-placement/model/dangling-links.ts
|
|
3675
|
-
const RULE$
|
|
3676
|
-
const SEPARATOR$
|
|
3677
|
+
const RULE$72 = "dangling-link";
|
|
3678
|
+
const SEPARATOR$26 = "/";
|
|
3677
3679
|
const FIRST$22 = 1;
|
|
3678
3680
|
const READ_CONCURRENCY$37 = 16;
|
|
3679
|
-
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$
|
|
3681
|
+
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$26}`)(name);
|
|
3680
3682
|
/** @internal */
|
|
3681
3683
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3682
3684
|
const files = yield* RepositoryFiles;
|
|
@@ -3688,7 +3690,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3688
3690
|
file,
|
|
3689
3691
|
line: FIRST$22,
|
|
3690
3692
|
column: FIRST$22,
|
|
3691
|
-
rule: RULE$
|
|
3693
|
+
rule: RULE$72,
|
|
3692
3694
|
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.`
|
|
3693
3695
|
})));
|
|
3694
3696
|
});
|
|
@@ -3698,7 +3700,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3698
3700
|
// src/features/check-placement/model/member-sources.ts
|
|
3699
3701
|
const ROOT_WORKSPACE$1 = ".";
|
|
3700
3702
|
const FIRST$21 = 1;
|
|
3701
|
-
const SEPARATOR$
|
|
3703
|
+
const SEPARATOR$25 = "/";
|
|
3702
3704
|
const EXCLUDED$7 = [
|
|
3703
3705
|
":(exclude,attr:linguist-vendored)",
|
|
3704
3706
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3723,7 +3725,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
|
|
|
3723
3725
|
rule,
|
|
3724
3726
|
message
|
|
3725
3727
|
});
|
|
3726
|
-
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$
|
|
3728
|
+
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$25}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
|
|
3727
3729
|
workspace,
|
|
3728
3730
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3729
3731
|
})));
|
|
@@ -3746,7 +3748,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3746
3748
|
}));
|
|
3747
3749
|
});
|
|
3748
3750
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3749
|
-
const RULE$
|
|
3751
|
+
const RULE$71 = "deployed-readme";
|
|
3750
3752
|
const ROOT_DIRECTORY$4 = "";
|
|
3751
3753
|
const READ_CONCURRENCY$36 = 16;
|
|
3752
3754
|
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.";
|
|
@@ -3786,14 +3788,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3786
3788
|
const readme = yield* readReadme({
|
|
3787
3789
|
root,
|
|
3788
3790
|
directory,
|
|
3789
|
-
rule: RULE$
|
|
3791
|
+
rule: RULE$71,
|
|
3790
3792
|
missingMessage: MISSING_MESSAGE$2
|
|
3791
3793
|
});
|
|
3792
3794
|
return Result.match(readme, {
|
|
3793
3795
|
onFailure: Option.some,
|
|
3794
3796
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3795
3797
|
file,
|
|
3796
|
-
rule: RULE$
|
|
3798
|
+
rule: RULE$71,
|
|
3797
3799
|
message: NO_URL_MESSAGE
|
|
3798
3800
|
})))
|
|
3799
3801
|
});
|
|
@@ -3810,9 +3812,9 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3810
3812
|
return Array$1.getSomes(found);
|
|
3811
3813
|
});
|
|
3812
3814
|
// src/features/check-placement/model/nested-docs.ts
|
|
3813
|
-
const RULE$
|
|
3815
|
+
const RULE$70 = "nested-docs";
|
|
3814
3816
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3815
|
-
const SEPARATOR$
|
|
3817
|
+
const SEPARATOR$24 = "/";
|
|
3816
3818
|
const READ_CONCURRENCY$35 = 64;
|
|
3817
3819
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3818
3820
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
@@ -3822,20 +3824,20 @@ const MISSING_RULE = "workspace-agents-md";
|
|
|
3822
3824
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3823
3825
|
const taggedError$13 = Schema.TaggedError;
|
|
3824
3826
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3825
|
-
const isNested = (name) => String$1.includes(SEPARATOR$
|
|
3826
|
-
const problemFor$
|
|
3827
|
+
const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
|
|
3828
|
+
const problemFor$9 = problemInFile(RULE$70);
|
|
3827
3829
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3828
3830
|
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.";
|
|
3829
3831
|
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.";
|
|
3830
3832
|
const README_MESSAGE = "is allowed below the root only in a workspace, the directory that holds its package.json. Move it into the workspace it describes.";
|
|
3831
3833
|
const agentDocProblem = ({ file, base, directory }, allowed) => {
|
|
3832
|
-
if (!allowed.workspaceAgentDocs) return Option.some(problemFor$
|
|
3834
|
+
if (!allowed.workspaceAgentDocs) return Option.some(problemFor$9(file, `${base} ${AGENT_DOCS_MESSAGE}`));
|
|
3833
3835
|
if (base === WORKSPACE_AGENT_DOC && HashSet.has(allowed.workspaces, directory)) return Option.none();
|
|
3834
|
-
return Option.some(problemFor$
|
|
3836
|
+
return Option.some(problemFor$9(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
|
|
3835
3837
|
};
|
|
3836
3838
|
const readmeProblem = ({ file, base, directory }, allowed) => {
|
|
3837
3839
|
if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
|
|
3838
|
-
return Option.some(problemFor$
|
|
3840
|
+
return Option.some(problemFor$9(file, `${base} ${README_MESSAGE}`));
|
|
3839
3841
|
};
|
|
3840
3842
|
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$4), MISSING_MESSAGE$1)));
|
|
3841
3843
|
const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
|
|
@@ -3880,7 +3882,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3880
3882
|
return [...Array$1.getSomes(found), ...missing];
|
|
3881
3883
|
});
|
|
3882
3884
|
// src/features/check-placement/model/published-readme.ts
|
|
3883
|
-
const RULE$
|
|
3885
|
+
const RULE$69 = "published-readme";
|
|
3884
3886
|
const READ_CONCURRENCY$34 = 16;
|
|
3885
3887
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3886
3888
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
@@ -3888,7 +3890,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3888
3890
|
const readme = yield* readReadme({
|
|
3889
3891
|
root,
|
|
3890
3892
|
directory,
|
|
3891
|
-
rule: RULE$
|
|
3893
|
+
rule: RULE$69,
|
|
3892
3894
|
missingMessage: MISSING_MESSAGE
|
|
3893
3895
|
});
|
|
3894
3896
|
return Result.match(readme, {
|
|
@@ -3899,7 +3901,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3899
3901
|
file,
|
|
3900
3902
|
line,
|
|
3901
3903
|
column,
|
|
3902
|
-
rule: RULE$
|
|
3904
|
+
rule: RULE$69,
|
|
3903
3905
|
message: MESSAGE$14
|
|
3904
3906
|
};
|
|
3905
3907
|
}))
|
|
@@ -3912,12 +3914,12 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
|
|
|
3912
3914
|
return Array$1.getSomes(found);
|
|
3913
3915
|
});
|
|
3914
3916
|
// src/features/check-placement/model/published-tests.ts
|
|
3915
|
-
const RULE$
|
|
3917
|
+
const RULE$68 = "published-tests";
|
|
3916
3918
|
const FILE_START = 1;
|
|
3917
3919
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3918
3920
|
const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
3919
3921
|
const testedIn = (listed) => (prefix) => pipe(listed, Array$1.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$3.test(file)));
|
|
3920
|
-
const problemFor$
|
|
3922
|
+
const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
|
|
3921
3923
|
const files = yield* RepositoryFiles;
|
|
3922
3924
|
const absolute = files.join(root, directory);
|
|
3923
3925
|
const prefix = `${absolute}/`;
|
|
@@ -3926,7 +3928,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3926
3928
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3927
3929
|
line: FILE_START,
|
|
3928
3930
|
column: FILE_START,
|
|
3929
|
-
rule: RULE$
|
|
3931
|
+
rule: RULE$68,
|
|
3930
3932
|
message: MESSAGE$13
|
|
3931
3933
|
});
|
|
3932
3934
|
});
|
|
@@ -3936,17 +3938,17 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3936
3938
|
const projects = yield* publishedProjects(root);
|
|
3937
3939
|
const listed = yield* files.listedFiles(root);
|
|
3938
3940
|
const absolute = pipe(listed, Array$1.map((file) => files.join(root, file)));
|
|
3939
|
-
const found = yield* Effect.forEach(projects, (project) => problemFor$
|
|
3941
|
+
const found = yield* Effect.forEach(projects, (project) => problemFor$8(root, absolute, project), { concurrency: 1 });
|
|
3940
3942
|
return Array$1.getSomes(found);
|
|
3941
3943
|
});
|
|
3942
3944
|
// src/features/check-placement/model/root-docs.ts
|
|
3943
|
-
const RULE$
|
|
3944
|
-
const SEPARATOR$
|
|
3945
|
+
const RULE$67 = "root-docs";
|
|
3946
|
+
const SEPARATOR$23 = "/";
|
|
3945
3947
|
const FIRST$20 = 1;
|
|
3946
3948
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
3947
3949
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3948
3950
|
const MESSAGE$12 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
|
|
3949
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$
|
|
3951
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$23)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
3950
3952
|
/** @internal */
|
|
3951
3953
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3952
3954
|
const files = yield* RepositoryFiles;
|
|
@@ -3955,17 +3957,17 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3955
3957
|
file: files.join(root, name),
|
|
3956
3958
|
line: FIRST$20,
|
|
3957
3959
|
column: FIRST$20,
|
|
3958
|
-
rule: RULE$
|
|
3960
|
+
rule: RULE$67,
|
|
3959
3961
|
message: `${name} ${MESSAGE$12}`
|
|
3960
3962
|
})));
|
|
3961
3963
|
});
|
|
3962
3964
|
// src/features/check-placement/model/root-readme.ts
|
|
3963
|
-
const RULE$
|
|
3965
|
+
const RULE$66 = "root-readme";
|
|
3964
3966
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3965
3967
|
const READ_CONCURRENCY$33 = 16;
|
|
3966
|
-
const START$
|
|
3968
|
+
const START$32 = 0;
|
|
3967
3969
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3968
|
-
const RELATIVE$
|
|
3970
|
+
const RELATIVE$4 = /^\.\//u;
|
|
3969
3971
|
const MarketplacePlugin = Schema.Struct({
|
|
3970
3972
|
name: Schema.optional(Schema.String),
|
|
3971
3973
|
source: Schema.Unknown
|
|
@@ -3978,7 +3980,7 @@ const NO_PLUGINS = {
|
|
|
3978
3980
|
const isCheckPolicy = ({ packageName }) => Option.contains(packageName, SELF_NAME);
|
|
3979
3981
|
const messageFor$5 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
|
|
3980
3982
|
const pluginsOf = (plugins) => {
|
|
3981
|
-
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$
|
|
3983
|
+
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$4, "")));
|
|
3982
3984
|
const segments = pipe(directories, Array$1.map(baseName$1));
|
|
3983
3985
|
return {
|
|
3984
3986
|
directories,
|
|
@@ -4003,7 +4005,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
|
4003
4005
|
const message = messageFor$5(workspace.directory);
|
|
4004
4006
|
const at = positionOf(source);
|
|
4005
4007
|
const pattern = patternFor(plugins)(workspace);
|
|
4006
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
4008
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$66)(file, at(found.index ?? START$32), message)));
|
|
4007
4009
|
};
|
|
4008
4010
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4009
4011
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -4040,7 +4042,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4040
4042
|
return Array$1.flatten(found);
|
|
4041
4043
|
});
|
|
4042
4044
|
// src/features/check-placement/model/docs-mirror.ts
|
|
4043
|
-
const RULE$
|
|
4045
|
+
const RULE$65 = "docs-mirror";
|
|
4044
4046
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4045
4047
|
const MIRROR_LIMIT = 3;
|
|
4046
4048
|
const READ_CONCURRENCY$32 = 16;
|
|
@@ -4059,20 +4061,20 @@ const firstMention = (source, workspace) => {
|
|
|
4059
4061
|
};
|
|
4060
4062
|
const ownerOf$3 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
|
|
4061
4063
|
const describe = (mentions) => pipe(mentions, Array$1.map(({ directory }) => `\`${directory}\``), Array$1.join(", "));
|
|
4062
|
-
const problemFor$
|
|
4064
|
+
const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
|
|
4063
4065
|
const { line, column } = positionOf(source)(offset);
|
|
4064
4066
|
return {
|
|
4065
4067
|
file,
|
|
4066
4068
|
line,
|
|
4067
4069
|
column,
|
|
4068
|
-
rule: RULE$
|
|
4070
|
+
rule: RULE$65,
|
|
4069
4071
|
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.`
|
|
4070
4072
|
};
|
|
4071
4073
|
}), Option.toArray);
|
|
4072
4074
|
const othersIn = (doc, workspaces) => pipe(workspaces, Array$1.filter((workspace) => !ownerOf$3(doc)(workspace)));
|
|
4073
4075
|
const problemIn$4 = (workspaces) => (doc, file, source) => {
|
|
4074
4076
|
const mentions = pipe(othersIn(doc, workspaces), Array$1.flatMap((workspace) => Option.toArray(firstMention(source, workspace))));
|
|
4075
|
-
return problemFor$
|
|
4077
|
+
return problemFor$7(file, source, Array$1.sort(mentions, byOffset));
|
|
4076
4078
|
};
|
|
4077
4079
|
const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
4078
4080
|
const files = yield* RepositoryFiles;
|
|
@@ -4097,7 +4099,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4097
4099
|
return Array$1.flatten(found);
|
|
4098
4100
|
});
|
|
4099
4101
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4100
|
-
const RULE$
|
|
4102
|
+
const RULE$64 = "ignored-sources";
|
|
4101
4103
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4102
4104
|
const FIRST$19 = 1;
|
|
4103
4105
|
const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -4109,7 +4111,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4109
4111
|
file: files.join(root, file),
|
|
4110
4112
|
line: FIRST$19,
|
|
4111
4113
|
column: FIRST$19,
|
|
4112
|
-
rule: RULE$
|
|
4114
|
+
rule: RULE$64,
|
|
4113
4115
|
message: MESSAGE$11
|
|
4114
4116
|
})));
|
|
4115
4117
|
});
|
|
@@ -4182,7 +4184,7 @@ const LAYERS = [
|
|
|
4182
4184
|
"shared"
|
|
4183
4185
|
];
|
|
4184
4186
|
const RUST_FILE = /\.rs$/u;
|
|
4185
|
-
const BINARY = /^src\/bin\/[^/]+\.rs$/u;
|
|
4187
|
+
const BINARY$1 = /^src\/bin\/[^/]+\.rs$/u;
|
|
4186
4188
|
const MANIFEST$3 = /(?:^|\/)Cargo\.toml$/u;
|
|
4187
4189
|
const MODULE_INDEX = "mod";
|
|
4188
4190
|
const CRATE_ROOTS = ["src/lib.rs", "src/main.rs"];
|
|
@@ -4226,7 +4228,7 @@ const sourceKindOf = (inner) => {
|
|
|
4226
4228
|
return "module";
|
|
4227
4229
|
};
|
|
4228
4230
|
const kindOf$1 = (inner) => {
|
|
4229
|
-
if (Array$1.contains(CRATE_ROOTS, inner) || BINARY.test(inner)) return "root";
|
|
4231
|
+
if (Array$1.contains(CRATE_ROOTS, inner) || BINARY$1.test(inner)) return "root";
|
|
4230
4232
|
if (SEPARATE_TEST.test(inner)) return "test";
|
|
4231
4233
|
if (OUTSIDE_ALLOWED.test(inner)) return "skipped";
|
|
4232
4234
|
if (!String$1.startsWith(SOURCE_PREFIX$1)(inner)) return "misplaced";
|
|
@@ -4235,7 +4237,7 @@ const kindOf$1 = (inner) => {
|
|
|
4235
4237
|
const isSliceIndex = (modulePath) => modulePath.length === 2 && Option.exists(Array$1.head(modulePath), (layer) => Array$1.contains(SLICED_LAYERS, layer));
|
|
4236
4238
|
// src/features/check-placement/model/rust-syntax.ts
|
|
4237
4239
|
const IGNORED_ITEMS = ["line_comment", "block_comment"];
|
|
4238
|
-
const NEXT$
|
|
4240
|
+
const NEXT$5 = 1;
|
|
4239
4241
|
const ALLOCATOR = "global_allocator";
|
|
4240
4242
|
const field = (node, name) => Option.fromNullishOr(node.childForFieldName(name));
|
|
4241
4243
|
const namedChildren = (node) => pipe(node.namedChildren, Array$1.flatMap((child) => Option.toArray(Option.fromNullishOr(child))));
|
|
@@ -4244,8 +4246,8 @@ const itemOf = (node) => ({
|
|
|
4244
4246
|
name: Option.map(field(node, "name"), (name) => name.text),
|
|
4245
4247
|
inline: Option.isSome(field(node, "body")),
|
|
4246
4248
|
visible: Array$1.some(namedChildren(node), (child) => child.type === "visibility_modifier"),
|
|
4247
|
-
line: node.startPosition.row + NEXT$
|
|
4248
|
-
column: node.startPosition.column + NEXT$
|
|
4249
|
+
line: node.startPosition.row + NEXT$5,
|
|
4250
|
+
column: node.startPosition.column + NEXT$5
|
|
4249
4251
|
});
|
|
4250
4252
|
const replacesAllocator = (root) => pipe(root.descendantsOfType("attribute"), Array$1.flatMap((node) => Option.toArray(Option.fromNullishOr(node))), Array$1.some((attribute) => Option.exists(Array$1.head(namedChildren(attribute)), (name) => name.text === ALLOCATOR)));
|
|
4251
4253
|
const readRustFile = (root) => ({
|
|
@@ -12690,8 +12692,8 @@ var english_verbs_default = [
|
|
|
12690
12692
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12691
12693
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12692
12694
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12693
|
-
const SEPARATOR$
|
|
12694
|
-
const NEXT$
|
|
12695
|
+
const SEPARATOR$21 = "/";
|
|
12696
|
+
const NEXT$4 = 1;
|
|
12695
12697
|
const WORD_SEPARATOR$1 = "-";
|
|
12696
12698
|
const MINIMUM_WORDS = 2;
|
|
12697
12699
|
const FEATURES$1 = "src/features/";
|
|
@@ -12716,7 +12718,7 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12716
12718
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12717
12719
|
};
|
|
12718
12720
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12719
|
-
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$
|
|
12721
|
+
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$21))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$21}${FEATURES$1}${slice}`));
|
|
12720
12722
|
const SLICE_LAYERS = [
|
|
12721
12723
|
"features",
|
|
12722
12724
|
"entities",
|
|
@@ -12724,26 +12726,26 @@ const SLICE_LAYERS = [
|
|
|
12724
12726
|
"pages"
|
|
12725
12727
|
];
|
|
12726
12728
|
const SLICE_DEPTHS = [3, 4];
|
|
12727
|
-
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
12729
|
+
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$21);
|
|
12728
12730
|
const isInSliceLayer = (parts) => {
|
|
12729
12731
|
const [source, layer] = parts;
|
|
12730
|
-
return `${source}${SEPARATOR$
|
|
12732
|
+
return `${source}${SEPARATOR$21}` === SOURCE$2 && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12731
12733
|
};
|
|
12732
12734
|
const indexedSlice = (owned) => {
|
|
12733
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12734
|
-
const depth = parts.length - NEXT$
|
|
12735
|
-
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$
|
|
12735
|
+
const parts = String$1.split(owned.inner, SEPARATOR$21);
|
|
12736
|
+
const depth = parts.length - NEXT$4;
|
|
12737
|
+
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$21}${pathPrefix(parts, depth)}`));
|
|
12736
12738
|
};
|
|
12737
12739
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12738
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12739
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12740
|
-
const isSegmentFolder = (depth) => parts.length > depth + NEXT$
|
|
12741
|
-
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$
|
|
12740
|
+
const parts = String$1.split(inner, SEPARATOR$21);
|
|
12741
|
+
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$21}${pathPrefix(parts, depth)}`);
|
|
12742
|
+
const isSegmentFolder = (depth) => parts.length > depth + NEXT$4 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
|
|
12743
|
+
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$21}${pathPrefix(parts, depth + NEXT$4)}`));
|
|
12742
12744
|
};
|
|
12743
12745
|
const deployNamed = ({ workspace, inner }) => {
|
|
12744
12746
|
if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
|
|
12745
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12746
|
-
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$
|
|
12747
|
+
const segments = String$1.split(inner, SEPARATOR$21);
|
|
12748
|
+
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$21}${Array$1.join(Array$1.take(segments, index + NEXT$4), SEPARATOR$21)}`));
|
|
12747
12749
|
};
|
|
12748
12750
|
/** @internal */
|
|
12749
12751
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12799,7 +12801,7 @@ const itemProblem = (file, rule, message) => (position) => problemAtPosition(rul
|
|
|
12799
12801
|
const isRootItem = (inner) => (item) => {
|
|
12800
12802
|
if (Array$1.contains(ROOT_ITEMS, item.kind)) return true;
|
|
12801
12803
|
if (item.kind === "mod_item") return !item.inline && Option.exists(item.name, (name) => Array$1.contains(LAYERS, name));
|
|
12802
|
-
return item.kind === "function_item" && (inner === MAIN_FILE || BINARY.test(inner)) && Option.contains(item.name, MAIN);
|
|
12804
|
+
return item.kind === "function_item" && (inner === MAIN_FILE || BINARY$1.test(inner)) && Option.contains(item.name, MAIN);
|
|
12803
12805
|
};
|
|
12804
12806
|
const isLayerItem = (item) => Array$1.contains(LAYER_ITEMS, item.kind) || item.kind === "mod_item" && !item.inline;
|
|
12805
12807
|
const entryProblems$2 = (file, modulePath, parsed) => {
|
|
@@ -12866,13 +12868,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12866
12868
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12867
12869
|
});
|
|
12868
12870
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12869
|
-
const RULE$
|
|
12871
|
+
const RULE$63 = "shadcn-ui-alias";
|
|
12870
12872
|
const FIRST$18 = 1;
|
|
12871
12873
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
12872
12874
|
file,
|
|
12873
12875
|
line: FIRST$18,
|
|
12874
12876
|
column: FIRST$18,
|
|
12875
|
-
rule: RULE$
|
|
12877
|
+
rule: RULE$63,
|
|
12876
12878
|
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/*".`
|
|
12877
12879
|
});
|
|
12878
12880
|
/** @internal */
|
|
@@ -12934,7 +12936,7 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
12934
12936
|
const BIN = "bin";
|
|
12935
12937
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
12936
12938
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12937
|
-
const SEPARATOR$
|
|
12939
|
+
const SEPARATOR$20 = "/";
|
|
12938
12940
|
const CURRENT = "./";
|
|
12939
12941
|
const READ_CONCURRENCY$30 = 8;
|
|
12940
12942
|
const FIRST$17 = 1;
|
|
@@ -12972,7 +12974,7 @@ const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
|
12972
12974
|
const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
12973
12975
|
const files = yield* RepositoryFiles;
|
|
12974
12976
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
12975
|
-
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$
|
|
12977
|
+
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$20}${name}`), Array$1.filter(isCommand));
|
|
12976
12978
|
});
|
|
12977
12979
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
12978
12980
|
const files = yield* RepositoryFiles;
|
|
@@ -12981,7 +12983,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12981
12983
|
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$30 });
|
|
12982
12984
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12983
12985
|
});
|
|
12984
|
-
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
12986
|
+
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$20));
|
|
12985
12987
|
const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.filter(({ path }) => !COMMAND$1.test(path) && !Array$1.contains(entries.all, path)), Array$1.map(({ path, start }) => ({
|
|
12986
12988
|
file,
|
|
12987
12989
|
...positionOf(source)(start),
|
|
@@ -13028,8 +13030,8 @@ const isCommandFile = (path) => isCommand(path) || COMMAND_FILE$1.test(path) &&
|
|
|
13028
13030
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
13029
13031
|
const files = yield* RepositoryFiles;
|
|
13030
13032
|
const listed = yield* files.listedFiles(root);
|
|
13031
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
13032
|
-
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$
|
|
13033
|
+
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$20}`);
|
|
13034
|
+
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$20}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
|
|
13033
13035
|
file: files.join(root, file),
|
|
13034
13036
|
line: FIRST$17,
|
|
13035
13037
|
column: FIRST$17,
|
|
@@ -13051,14 +13053,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13051
13053
|
];
|
|
13052
13054
|
});
|
|
13053
13055
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13054
|
-
const START$
|
|
13056
|
+
const START$31 = 0;
|
|
13055
13057
|
const QUOTES = ["\"", "'"];
|
|
13056
13058
|
const firstIndex = (source, needles) => {
|
|
13057
13059
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13058
13060
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13059
13061
|
};
|
|
13060
13062
|
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13061
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$
|
|
13063
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$31));
|
|
13062
13064
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13063
13065
|
const MEMBER_LISTS = [
|
|
13064
13066
|
"members",
|
|
@@ -13074,14 +13076,14 @@ const WORKSPACE = "workspace";
|
|
|
13074
13076
|
const PATCH = "patch";
|
|
13075
13077
|
const PATCH_DEPTH = 2;
|
|
13076
13078
|
const WORKSPACE_DEPTH = 1;
|
|
13077
|
-
const START$
|
|
13079
|
+
const START$30 = 0;
|
|
13078
13080
|
const WILDCARD$4 = /[*?[]/u;
|
|
13079
13081
|
const KEY_SEPARATOR$1 = ".";
|
|
13080
13082
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
13081
13083
|
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13082
13084
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
13083
|
-
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$
|
|
13084
|
-
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$
|
|
13085
|
+
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$30).pipe(Option.exists((name) => name === PATCH));
|
|
13086
|
+
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$30).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
|
|
13085
13087
|
const namedPaths = (trail, key, value) => {
|
|
13086
13088
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR$1);
|
|
13087
13089
|
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
@@ -13105,15 +13107,15 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
13105
13107
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
13106
13108
|
const WRAP_OFFSET$2 = 1;
|
|
13107
13109
|
const WILDCARD$3 = /[*?[{]/u;
|
|
13108
|
-
const SEPARATOR$
|
|
13109
|
-
const RELATIVE$
|
|
13110
|
+
const SEPARATOR$19 = "/";
|
|
13111
|
+
const RELATIVE$3 = ".";
|
|
13110
13112
|
const JSON_EXTENSION = ".json";
|
|
13111
13113
|
const isObject = (node) => Predicate.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
13112
13114
|
const firstObject = (node) => {
|
|
13113
13115
|
if (isObject(node)) return Option.some(node);
|
|
13114
13116
|
return pipe(childrenOf$4(node), Array$1.findFirst(firstObject));
|
|
13115
13117
|
};
|
|
13116
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$
|
|
13118
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$19), Array$1.takeWhile((segment) => !WILDCARD$3.test(segment)), Array$1.join(SEPARATOR$19));
|
|
13117
13119
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
13118
13120
|
field: name,
|
|
13119
13121
|
text,
|
|
@@ -13124,7 +13126,7 @@ const objectsIn = (node) => [...Array$1.filter([node], isObject), ...pipe(childr
|
|
|
13124
13126
|
const referencedPaths = (references) => pipe(objectsIn(references), Array$1.flatMap((reference) => Option.toArray(propertyValue("path")(reference))), Array$1.flatMap(stringsIn));
|
|
13125
13127
|
const exactly = (text) => [text];
|
|
13126
13128
|
const relativeConfig = (text) => {
|
|
13127
|
-
if (String$1.startsWith(RELATIVE$
|
|
13129
|
+
if (String$1.startsWith(RELATIVE$3)(text)) return [text, `${text}${JSON_EXTENSION}`];
|
|
13128
13130
|
return [];
|
|
13129
13131
|
};
|
|
13130
13132
|
const patternRoot = (text) => pipe([leadingDirectory(text)], Array$1.filter(String$1.isNonEmpty));
|
|
@@ -13140,7 +13142,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
13140
13142
|
])));
|
|
13141
13143
|
});
|
|
13142
13144
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
13143
|
-
const RULE$
|
|
13145
|
+
const RULE$62 = "config-path";
|
|
13144
13146
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
13145
13147
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13146
13148
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -13159,7 +13161,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
13159
13161
|
const problemOf$11 = (file, source) => (mention) => ({
|
|
13160
13162
|
file,
|
|
13161
13163
|
...positionOf(source)(mention.index),
|
|
13162
|
-
rule: RULE$
|
|
13164
|
+
rule: RULE$62,
|
|
13163
13165
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
13164
13166
|
});
|
|
13165
13167
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -13184,7 +13186,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13184
13186
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
13185
13187
|
file,
|
|
13186
13188
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
13187
|
-
rule: RULE$
|
|
13189
|
+
rule: RULE$62,
|
|
13188
13190
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
13189
13191
|
})));
|
|
13190
13192
|
});
|
|
@@ -13196,32 +13198,32 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
|
|
|
13196
13198
|
return [...Array$1.flatten(found), ...patterns];
|
|
13197
13199
|
});
|
|
13198
13200
|
// src/features/check-repository-layout/model/crates.ts
|
|
13199
|
-
const RULE$
|
|
13201
|
+
const RULE$61 = "unverified-crate";
|
|
13200
13202
|
const VERSION_RULE = "release-version";
|
|
13201
13203
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13202
13204
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13203
13205
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13204
|
-
const SEPARATOR$
|
|
13206
|
+
const SEPARATOR$18 = "/";
|
|
13205
13207
|
const FIRST$16 = 1;
|
|
13206
13208
|
const READ_CONCURRENCY$28 = 8;
|
|
13207
|
-
const problemFor$
|
|
13209
|
+
const problemFor$6 = (crate, message) => ({
|
|
13208
13210
|
file: crate.manifest,
|
|
13209
13211
|
line: FIRST$16,
|
|
13210
13212
|
column: FIRST$16,
|
|
13211
|
-
rule: RULE$
|
|
13213
|
+
rule: RULE$61,
|
|
13212
13214
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13213
13215
|
});
|
|
13214
13216
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
13215
13217
|
const files = yield* RepositoryFiles;
|
|
13216
13218
|
const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
|
|
13217
|
-
if (Option.isNone(workspace)) return Option.some(problemFor$
|
|
13219
|
+
if (Option.isNone(workspace)) return Option.some(problemFor$6(crate, "is outside every workspace package"));
|
|
13218
13220
|
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$8))) return Option.none();
|
|
13219
|
-
return Option.some(problemFor$
|
|
13221
|
+
return Option.some(problemFor$6(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$8} has no verify task`));
|
|
13220
13222
|
});
|
|
13221
13223
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
13222
13224
|
const files = yield* RepositoryFiles;
|
|
13223
13225
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
13224
|
-
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
13226
|
+
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$18))), Array$1.contains(directory))));
|
|
13225
13227
|
if (Option.isNone(workspace)) return Option.none();
|
|
13226
13228
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
13227
13229
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
@@ -13244,7 +13246,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13244
13246
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13245
13247
|
});
|
|
13246
13248
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13247
|
-
const RULE$
|
|
13249
|
+
const RULE$60 = "deploy-entry-pattern";
|
|
13248
13250
|
const FALLOW_KEYS = [
|
|
13249
13251
|
"entry",
|
|
13250
13252
|
"entryPoints",
|
|
@@ -13315,7 +13317,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13315
13317
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13316
13318
|
file: path,
|
|
13317
13319
|
...positionOf(text.value)(start - kind.offset),
|
|
13318
|
-
rule: RULE$
|
|
13320
|
+
rule: RULE$60,
|
|
13319
13321
|
message: `${pattern} ${MESSAGE$10}`
|
|
13320
13322
|
})));
|
|
13321
13323
|
});
|
|
@@ -13348,7 +13350,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13348
13350
|
return Array$1.flatten(found);
|
|
13349
13351
|
});
|
|
13350
13352
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13351
|
-
const RULE$
|
|
13353
|
+
const RULE$59 = "listed-entry";
|
|
13352
13354
|
const ENTRY_KEYS = [
|
|
13353
13355
|
"entry",
|
|
13354
13356
|
"entryPoints",
|
|
@@ -13356,7 +13358,7 @@ const ENTRY_KEYS = [
|
|
|
13356
13358
|
];
|
|
13357
13359
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
13358
13360
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13359
|
-
const SEPARATOR$
|
|
13361
|
+
const SEPARATOR$17 = "/";
|
|
13360
13362
|
const WRAP_OFFSET = 1;
|
|
13361
13363
|
const READ_CONCURRENCY$26 = 8;
|
|
13362
13364
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
@@ -13368,7 +13370,7 @@ const entryPatternsIn = (node) => {
|
|
|
13368
13370
|
})));
|
|
13369
13371
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13370
13372
|
};
|
|
13371
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
13373
|
+
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$17}`)(text))) || String$1.includes(SEPARATOR$17)(text) && !WILDCARD$2.test(text);
|
|
13372
13374
|
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13373
13375
|
const files = yield* RepositoryFiles;
|
|
13374
13376
|
const path = files.join(root, file);
|
|
@@ -13378,7 +13380,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13378
13380
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13379
13381
|
file: path,
|
|
13380
13382
|
...positionOf(text.value)(start),
|
|
13381
|
-
rule: RULE$
|
|
13383
|
+
rule: RULE$59,
|
|
13382
13384
|
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.`
|
|
13383
13385
|
})));
|
|
13384
13386
|
});
|
|
@@ -13390,26 +13392,26 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
13390
13392
|
return Array$1.flatten(found);
|
|
13391
13393
|
});
|
|
13392
13394
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13393
|
-
const RULE$
|
|
13395
|
+
const RULE$58 = "root-workspace-path";
|
|
13394
13396
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13395
13397
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13396
13398
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
13397
13399
|
const FIRST$15 = 0;
|
|
13398
|
-
const NEXT$
|
|
13400
|
+
const NEXT$3 = 1;
|
|
13399
13401
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
13400
13402
|
const mentions = (directory) => (text) => {
|
|
13401
13403
|
const parts = String$1.split(text, directory);
|
|
13402
|
-
return pipe(Array$1.drop(parts, NEXT$
|
|
13404
|
+
return pipe(Array$1.drop(parts, NEXT$3), Array$1.some((after, index) => {
|
|
13403
13405
|
const before = parts[index] ?? "";
|
|
13404
|
-
const previous = String$1.slice(before.length - NEXT$
|
|
13405
|
-
const following = String$1.slice(FIRST$15, NEXT$
|
|
13406
|
+
const previous = String$1.slice(before.length - NEXT$3)(before);
|
|
13407
|
+
const following = String$1.slice(FIRST$15, NEXT$3)(after);
|
|
13406
13408
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
13407
13409
|
}));
|
|
13408
13410
|
};
|
|
13409
13411
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13410
13412
|
file,
|
|
13411
13413
|
...positionOf(source)(found.start),
|
|
13412
|
-
rule: RULE$
|
|
13414
|
+
rule: RULE$58,
|
|
13413
13415
|
message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
|
|
13414
13416
|
})));
|
|
13415
13417
|
/** @internal */
|
|
@@ -13423,7 +13425,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13423
13425
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13424
13426
|
});
|
|
13425
13427
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13426
|
-
const RULE$
|
|
13428
|
+
const RULE$57 = "hidden-verify";
|
|
13427
13429
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13428
13430
|
const FIRST$14 = 1;
|
|
13429
13431
|
const READ_CONCURRENCY$25 = 8;
|
|
@@ -13437,7 +13439,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13437
13439
|
file,
|
|
13438
13440
|
line: FIRST$14,
|
|
13439
13441
|
column: FIRST$14,
|
|
13440
|
-
rule: RULE$
|
|
13442
|
+
rule: RULE$57,
|
|
13441
13443
|
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
|
|
13442
13444
|
}).pipe(Option.filter(() => verified));
|
|
13443
13445
|
});
|
|
@@ -13448,7 +13450,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
13448
13450
|
return Array$1.getSomes(found);
|
|
13449
13451
|
});
|
|
13450
13452
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13451
|
-
const RULE$
|
|
13453
|
+
const RULE$56 = "shared-uncached-task";
|
|
13452
13454
|
const READ_CONCURRENCY$24 = 8;
|
|
13453
13455
|
const SHARED = 2;
|
|
13454
13456
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -13491,7 +13493,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
13491
13493
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13492
13494
|
file,
|
|
13493
13495
|
...position,
|
|
13494
|
-
rule: RULE$
|
|
13496
|
+
rule: RULE$56,
|
|
13495
13497
|
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.`
|
|
13496
13498
|
})));
|
|
13497
13499
|
};
|
|
@@ -13502,7 +13504,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
13502
13504
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13503
13505
|
});
|
|
13504
13506
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13505
|
-
const RULE$
|
|
13507
|
+
const RULE$55 = "tested-verify";
|
|
13506
13508
|
const READ_CONCURRENCY$23 = 8;
|
|
13507
13509
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13508
13510
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
@@ -13531,7 +13533,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13531
13533
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13532
13534
|
file,
|
|
13533
13535
|
...positionOf(source)(at.start),
|
|
13534
|
-
rule: RULE$
|
|
13536
|
+
rule: RULE$55,
|
|
13535
13537
|
message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
|
|
13536
13538
|
})))));
|
|
13537
13539
|
});
|
|
@@ -13542,7 +13544,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
|
|
|
13542
13544
|
return Array$1.flatten(found);
|
|
13543
13545
|
});
|
|
13544
13546
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13545
|
-
const RULE$
|
|
13547
|
+
const RULE$54 = "unlocked-task";
|
|
13546
13548
|
const READ_CONCURRENCY$22 = 8;
|
|
13547
13549
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13548
13550
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -13554,7 +13556,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13554
13556
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13555
13557
|
file,
|
|
13556
13558
|
...positionOf(source)(task.start),
|
|
13557
|
-
rule: RULE$
|
|
13559
|
+
rule: RULE$54,
|
|
13558
13560
|
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.`
|
|
13559
13561
|
})), Option.toArray)));
|
|
13560
13562
|
/** @internal */
|
|
@@ -13590,16 +13592,16 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13590
13592
|
});
|
|
13591
13593
|
// src/shared/lib/package-name.ts
|
|
13592
13594
|
const SCOPE$2 = "@";
|
|
13593
|
-
const SEPARATOR$
|
|
13595
|
+
const SEPARATOR$16 = "/";
|
|
13594
13596
|
const SCOPED_SEGMENTS = 2;
|
|
13595
13597
|
const PLAIN_SEGMENTS = 1;
|
|
13596
13598
|
const segmentCount = (specifier) => {
|
|
13597
13599
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13598
13600
|
return PLAIN_SEGMENTS;
|
|
13599
13601
|
};
|
|
13600
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13602
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$16), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$16));
|
|
13601
13603
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13602
|
-
const RELATIVE$
|
|
13604
|
+
const RELATIVE$2 = /^\.\.?(?:\/|$)/u;
|
|
13603
13605
|
const SUBPATH_IMPORT$1 = "#";
|
|
13604
13606
|
const WILDCARD$1 = "*";
|
|
13605
13607
|
const SOURCE_SUFFIXES = [
|
|
@@ -13635,13 +13637,13 @@ const existingSource = Effect.fn("existingSource")(function* existingSource(base
|
|
|
13635
13637
|
});
|
|
13636
13638
|
const localFile = Effect.fn("localFile")(function* localFile({ directory, imports }, from, specifier) {
|
|
13637
13639
|
const files = yield* RepositoryFiles;
|
|
13638
|
-
if (RELATIVE$
|
|
13640
|
+
if (RELATIVE$2.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13639
13641
|
const target = subpathTarget(imports, specifier);
|
|
13640
13642
|
if (Option.isNone(target)) return Option.none();
|
|
13641
13643
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
13642
13644
|
});
|
|
13643
13645
|
const referenceOf$2 = (graph, from, specifier) => {
|
|
13644
|
-
if (RELATIVE$
|
|
13646
|
+
if (RELATIVE$2.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13645
13647
|
const name = packageNameOf(specifier);
|
|
13646
13648
|
return Effect.succeedSome(Result.fail(name));
|
|
13647
13649
|
};
|
|
@@ -13688,7 +13690,7 @@ const packagesByEntry = Effect.fn("packagesByEntry")(function* packagesByEntry(a
|
|
|
13688
13690
|
}).pipe(Effect.map((packages) => [entry, packages])), { concurrency: 1 });
|
|
13689
13691
|
});
|
|
13690
13692
|
// src/features/measure-install-size/model/installed-closure.ts
|
|
13691
|
-
const EMPTY$
|
|
13693
|
+
const EMPTY$4 = 0;
|
|
13692
13694
|
const installedNames = (manifest) => [...namesIn(manifest, ["dependencies", "optionalDependencies"]), ...pipe(namesIn(manifest, ["peerDependencies"]), Array$1.difference(optionalPeerNames(manifest)))];
|
|
13693
13695
|
const childrenOf$2 = Effect.fn("childrenOf")(function* childrenOf(directory) {
|
|
13694
13696
|
const files = yield* RepositoryFiles;
|
|
@@ -13697,7 +13699,7 @@ const childrenOf$2 = Effect.fn("childrenOf")(function* childrenOf(directory) {
|
|
|
13697
13699
|
});
|
|
13698
13700
|
const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
|
|
13699
13701
|
const files = yield* RepositoryFiles;
|
|
13700
|
-
const candidate = files.join(from, NODE_MODULES$
|
|
13702
|
+
const candidate = files.join(from, NODE_MODULES$2, name);
|
|
13701
13703
|
if (yield* files.exists(files.join(candidate, PACKAGE_JSON_FILE))) {
|
|
13702
13704
|
const real = yield* files.realPath(candidate);
|
|
13703
13705
|
return Option.some(real);
|
|
@@ -13729,9 +13731,9 @@ const closureOf$2 = (provided, collect) => Array$1.match(collect.pending, {
|
|
|
13729
13731
|
const directorySize = (directory) => Effect.gen(function* sizeOfDirectory() {
|
|
13730
13732
|
const files = yield* RepositoryFiles;
|
|
13731
13733
|
const names = yield* files.readDirectory(directory);
|
|
13732
|
-
const entries = pipe(names, Array$1.filter((name) => name !== NODE_MODULES$
|
|
13734
|
+
const entries = pipe(names, Array$1.filter((name) => name !== NODE_MODULES$2), Array$1.map((name) => files.join(directory, name)));
|
|
13733
13735
|
const sizes = yield* Effect.forEach(entries, (entry) => files.isDirectory(entry).pipe(Effect.flatMap((kind) => {
|
|
13734
|
-
if (Option.isNone(kind)) return Effect.succeed(EMPTY$
|
|
13736
|
+
if (Option.isNone(kind)) return Effect.succeed(EMPTY$4);
|
|
13735
13737
|
if (kind.value) return directorySize(entry);
|
|
13736
13738
|
return files.fileSize(entry);
|
|
13737
13739
|
})), { concurrency: 1 });
|
|
@@ -13743,7 +13745,7 @@ const installedClosure = ({ provided, from, name }) => closureOf$2(provided, {
|
|
|
13743
13745
|
});
|
|
13744
13746
|
const installedSize = (directory) => {
|
|
13745
13747
|
if (String$1.includes(`/node_modules/`)(directory)) return directorySize(directory);
|
|
13746
|
-
return Effect.succeed(EMPTY$
|
|
13748
|
+
return Effect.succeed(EMPTY$4);
|
|
13747
13749
|
};
|
|
13748
13750
|
// src/features/measure-install-size/model/install-size.ts
|
|
13749
13751
|
const INSTALL_SIZE = "install-size";
|
|
@@ -13754,11 +13756,11 @@ const LISTED_LARGEST = 5;
|
|
|
13754
13756
|
const SIZE_CONCURRENCY = 32;
|
|
13755
13757
|
const MEGABYTE = 1e6;
|
|
13756
13758
|
const MEGABYTE_DIGITS = 1;
|
|
13757
|
-
const START$
|
|
13759
|
+
const START$29 = 0;
|
|
13758
13760
|
const SINGLE_ENTRY = 1;
|
|
13759
13761
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13760
13762
|
const usageHint = (dependency, entryCount) => {
|
|
13761
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13763
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$29 && dependency.entries.length < entryCount)) return "";
|
|
13762
13764
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13763
13765
|
};
|
|
13764
13766
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13767,7 +13769,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13767
13769
|
const { workspace, total } = overrun;
|
|
13768
13770
|
const config = yield* files.readFile(workspace.configFile);
|
|
13769
13771
|
const source = Option.getOrElse(config, () => "");
|
|
13770
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13772
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$29);
|
|
13771
13773
|
return {
|
|
13772
13774
|
file: workspace.configFile,
|
|
13773
13775
|
...positionOf(source)(index),
|
|
@@ -13784,7 +13786,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13784
13786
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13785
13787
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13786
13788
|
const sizes = HashMap.fromIterable(measured);
|
|
13787
|
-
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$
|
|
13789
|
+
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$29)), Number$1.sumAll);
|
|
13788
13790
|
return {
|
|
13789
13791
|
closures,
|
|
13790
13792
|
sizeOf,
|
|
@@ -13799,7 +13801,7 @@ const importersOf = Effect.fn("importersOf")(function* importersOf({ workspace,
|
|
|
13799
13801
|
return (name) => pipe(entries, Array$1.filter((entry) => pipe(HashMap.get(reached, entry.source), Option.exists(HashSet.has(name)))), Array$1.map((entry) => entry.label), Array$1.dedupe);
|
|
13800
13802
|
}, Effect.scoped);
|
|
13801
13803
|
const bySizeDescending = Order.mapInput(Order.flip(Order.Number), (dependency) => dependency.size);
|
|
13802
|
-
const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published, direct) {
|
|
13804
|
+
const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(published, direct) {
|
|
13803
13805
|
const { closures, sizeOf, total } = yield* measure(published, direct);
|
|
13804
13806
|
if (total <= published.workspace.installBudget) return [];
|
|
13805
13807
|
const importers = yield* importersOf(published);
|
|
@@ -13817,11 +13819,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
13817
13819
|
})];
|
|
13818
13820
|
});
|
|
13819
13821
|
const stackProblems = (file, source, dependencies) => {
|
|
13820
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
13822
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$29);
|
|
13821
13823
|
const rest = String$1.slice(section)(source);
|
|
13822
13824
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
13823
13825
|
file,
|
|
13824
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
13826
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$29)),
|
|
13825
13827
|
rule: STACK_DEPENDENCY,
|
|
13826
13828
|
message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
|
|
13827
13829
|
})));
|
|
@@ -13837,7 +13839,7 @@ const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, fil
|
|
|
13837
13839
|
packEntries: workspace.packEntries
|
|
13838
13840
|
});
|
|
13839
13841
|
const provided = HashSet.fromIterable(namesIn(manifest.value, ["peerDependencies"]));
|
|
13840
|
-
const sized = yield* sizeProblems({
|
|
13842
|
+
const sized = yield* sizeProblems$1({
|
|
13841
13843
|
workspace,
|
|
13842
13844
|
entries,
|
|
13843
13845
|
provided
|
|
@@ -13870,7 +13872,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13870
13872
|
return yield* files.mergeBase(root, base);
|
|
13871
13873
|
});
|
|
13872
13874
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13873
|
-
const RULE$
|
|
13875
|
+
const RULE$53 = "migration-order";
|
|
13874
13876
|
const SNAPSHOT = "snapshot.json";
|
|
13875
13877
|
const MIGRATION = "migration.sql";
|
|
13876
13878
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
@@ -13904,7 +13906,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13904
13906
|
file: join(root, file),
|
|
13905
13907
|
line: FIRST$13,
|
|
13906
13908
|
column: FIRST$13,
|
|
13907
|
-
rule: RULE$
|
|
13909
|
+
rule: RULE$53,
|
|
13908
13910
|
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}.`
|
|
13909
13911
|
})))), Option.getOrElse(() => []));
|
|
13910
13912
|
/** @internal */
|
|
@@ -13931,6 +13933,172 @@ const bundleErrorDetail = (error) => {
|
|
|
13931
13933
|
onNonEmpty: Array$1.join(" ")
|
|
13932
13934
|
}));
|
|
13933
13935
|
};
|
|
13936
|
+
// src/features/check-mod-vendor/model/vendor-imports.ts
|
|
13937
|
+
const IMPORT_DECLARATION = /import\s+(?<kind>type\s+)?\{(?<names>[^}]*)\}\s*from\s*["'](?<specifier>[^"']+)["']/gu;
|
|
13938
|
+
const TYPE_PREFIX = /^type\s+/u;
|
|
13939
|
+
const ALIAS$1 = /\s+as\s+\S+$/u;
|
|
13940
|
+
const VENDOR_FILE = /^(?<name>[\w.-]+)\.js$/u;
|
|
13941
|
+
const SEPARATOR$15 = "/";
|
|
13942
|
+
const valueNames = (list) => pipe(String$1.split(list, ","), Array$1.map(String$1.trim), Array$1.filter((name) => String$1.isNonEmpty(name) && !TYPE_PREFIX.test(name)), Array$1.map(String$1.replace(ALIAS$1, "")));
|
|
13943
|
+
const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option.filter((groups) => !Predicate.isString(groups["kind"])), Option.flatMap((groups) => Option.all({
|
|
13944
|
+
specifier: Option.fromNullishOr(groups["specifier"]),
|
|
13945
|
+
list: Option.fromNullishOr(groups["names"])
|
|
13946
|
+
})), Option.map(({ specifier, list }) => ({
|
|
13947
|
+
specifier,
|
|
13948
|
+
names: valueNames(list)
|
|
13949
|
+
})));
|
|
13950
|
+
/** @internal */
|
|
13951
|
+
const importedNames$1 = (source) => pipe(Array$1.fromIterable(String$1.matchAll(IMPORT_DECLARATION)(source)), Array$1.map(declarationOf), Array$1.getSomes, Array$1.filter(({ names }) => Array$1.isReadonlyArrayNonEmpty(names)));
|
|
13952
|
+
const nameIn = (rest) => pipe(Option.fromNullishOr(VENDOR_FILE.exec(rest)), Option.flatMapNullishOr(({ groups }) => groups), Option.flatMapNullishOr((groups) => groups["name"]));
|
|
13953
|
+
/** @internal */
|
|
13954
|
+
const vendorPackageOf = (vendor, file) => pipe(file, Option.liftPredicate(String$1.startsWith(`${vendor}${SEPARATOR$15}`)), Option.map(String$1.slice(vendor.length + 1)), Option.flatMap(nameIn), Option.toArray);
|
|
13955
|
+
/** @internal */
|
|
13956
|
+
const entrySource = (name, names) => {
|
|
13957
|
+
return `export { ${pipe(Array$1.sort(Array$1.dedupe(names), Order.String), Array$1.join(", "))} } from "${name}";\n`;
|
|
13958
|
+
};
|
|
13959
|
+
// src/features/check-mod-vendor/model/vendor-build.ts
|
|
13960
|
+
const ENTRY_PREFIX = "\0msch-vendor:";
|
|
13961
|
+
const NODE_MODULES$1 = "node_modules";
|
|
13962
|
+
const PACKAGE_FILE = "package.json";
|
|
13963
|
+
const ancestors = (from, root, dirname) => Array$1.unfold(Option.some(from), (current) => pipe(current, Option.map((directory) => {
|
|
13964
|
+
const parent = dirname(directory);
|
|
13965
|
+
return [directory, pipe(parent, Option.liftPredicate(() => directory !== root && parent !== directory))];
|
|
13966
|
+
})));
|
|
13967
|
+
const packageDirectory = Effect.fn("packageDirectory")(function* packageDirectory(request) {
|
|
13968
|
+
const files = yield* RepositoryFiles;
|
|
13969
|
+
const candidates = pipe(ancestors(request.from, request.root, files.dirname), Array$1.map((directory) => files.join(directory, NODE_MODULES$1, request.name)));
|
|
13970
|
+
const found = yield* Effect.findFirst(candidates, (candidate) => files.exists(files.join(candidate, PACKAGE_FILE)));
|
|
13971
|
+
return yield* Option.match(found, {
|
|
13972
|
+
onNone: () => Effect.fail(`${request.name} is not installed, so it cannot be bundled.`),
|
|
13973
|
+
onSome: files.realPath
|
|
13974
|
+
});
|
|
13975
|
+
});
|
|
13976
|
+
const isChunk$2 = (output) => output.type === "chunk";
|
|
13977
|
+
const vendorPlugin = (request) => {
|
|
13978
|
+
const entry = `${ENTRY_PREFIX}${request.name}`;
|
|
13979
|
+
const isEntry = (id) => id === entry;
|
|
13980
|
+
return {
|
|
13981
|
+
name: "msch-vendor",
|
|
13982
|
+
resolveId: (id) => pipe(id, Option.liftPredicate(isEntry), Option.getOrNull),
|
|
13983
|
+
load: (id) => pipe(id, Option.liftPredicate(isEntry), Option.map(() => entrySource(request.name, request.names)), Option.getOrNull)
|
|
13984
|
+
};
|
|
13985
|
+
};
|
|
13986
|
+
/** @internal */
|
|
13987
|
+
const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
|
|
13988
|
+
const files = yield* RepositoryFiles;
|
|
13989
|
+
const directory = yield* packageDirectory(request);
|
|
13990
|
+
const built = yield* Effect.tryPromise({
|
|
13991
|
+
try: () => rolldown({
|
|
13992
|
+
input: { [request.name]: `${ENTRY_PREFIX}${request.name}` },
|
|
13993
|
+
cwd: request.from,
|
|
13994
|
+
platform: "neutral",
|
|
13995
|
+
logLevel: "silent",
|
|
13996
|
+
plugins: [vendorPlugin(request)]
|
|
13997
|
+
}),
|
|
13998
|
+
catch: bundleErrorDetail
|
|
13999
|
+
});
|
|
14000
|
+
const output = yield* Effect.tryPromise({
|
|
14001
|
+
try: () => built.generate({
|
|
14002
|
+
format: "esm",
|
|
14003
|
+
preserveModules: true,
|
|
14004
|
+
preserveModulesRoot: files.dirname(directory),
|
|
14005
|
+
entryFileNames: "[name].js"
|
|
14006
|
+
}),
|
|
14007
|
+
catch: bundleErrorDetail
|
|
14008
|
+
}).pipe(Effect.ensuring(Effect.promise(() => built.close())));
|
|
14009
|
+
return pipe(output.output, Array$1.filter(isChunk$2), Array$1.map((chunk) => [chunk.fileName, chunk.code]), Record.fromEntries, Record.set(`${request.name}.d.ts`, `export * from "${request.name}";\n`));
|
|
14010
|
+
});
|
|
14011
|
+
// src/features/check-mod-vendor/model/mod-vendor.ts
|
|
14012
|
+
const RULE$52 = "mod-vendor";
|
|
14013
|
+
const VENDOR = "vendor";
|
|
14014
|
+
const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
|
|
14015
|
+
const RELATIVE$1 = /^\.\.?\//u;
|
|
14016
|
+
const FILE_LIMIT = 1048576;
|
|
14017
|
+
const TOTAL_LIMIT = 8388608;
|
|
14018
|
+
const CONCURRENCY$5 = 4;
|
|
14019
|
+
const EMPTY$3 = "";
|
|
14020
|
+
const problemFor$5 = problemInFile(RULE$52);
|
|
14021
|
+
const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
|
|
14022
|
+
const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
|
|
14023
|
+
const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
|
|
14024
|
+
const files = yield* RepositoryFiles;
|
|
14025
|
+
const directories = yield* modDirectories(plugin.directory);
|
|
14026
|
+
const modOf = (directory) => ({
|
|
14027
|
+
vendor: files.join(plugin.directory, directory, VENDOR),
|
|
14028
|
+
sources: sourcesOf$2(plugin, directory, files.join),
|
|
14029
|
+
from: plugin.directory,
|
|
14030
|
+
root
|
|
14031
|
+
});
|
|
14032
|
+
return pipe(directories, Array$1.map(modOf));
|
|
14033
|
+
});
|
|
14034
|
+
const wantedIn$1 = Effect.fn("wantedIn")(function* wantedIn(mod, file) {
|
|
14035
|
+
const files = yield* RepositoryFiles;
|
|
14036
|
+
const source = yield* files.readFile(file);
|
|
14037
|
+
const declarations = importedNames$1(Option.getOrElse(source, () => EMPTY$3));
|
|
14038
|
+
const directory = files.dirname(file);
|
|
14039
|
+
const packagesOf = (specifier) => vendorPackageOf(mod.vendor, files.join(directory, specifier));
|
|
14040
|
+
return pipe(declarations, Array$1.filter(({ specifier }) => RELATIVE$1.test(specifier)), Array$1.flatMap(({ specifier, names }) => pipe(packagesOf(specifier), Array$1.map((name) => [name, names]))));
|
|
14041
|
+
});
|
|
14042
|
+
const wantedOf = Effect.fn("wantedOf")(function* wantedOf(mod) {
|
|
14043
|
+
const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$5 });
|
|
14044
|
+
return pipe(Array$1.flatten(found), Array$1.groupBy(([name]) => name), Record.map(Array$1.flatMap(([, names]) => names)));
|
|
14045
|
+
});
|
|
14046
|
+
const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
|
|
14047
|
+
const built = yield* Effect.forEach(Record.toEntries(wanted), ([name, names]) => vendorFiles({
|
|
14048
|
+
name,
|
|
14049
|
+
names,
|
|
14050
|
+
from: mod.from,
|
|
14051
|
+
root: mod.root
|
|
14052
|
+
}), { concurrency: 1 });
|
|
14053
|
+
return pipe(built, Array$1.flatMap(Record.toEntries), Record.fromEntries);
|
|
14054
|
+
});
|
|
14055
|
+
const currentOf = Effect.fn("currentOf")(function* currentOf(mod) {
|
|
14056
|
+
const files = yield* RepositoryFiles;
|
|
14057
|
+
const entries = yield* files.walkDirectory(mod.vendor);
|
|
14058
|
+
const read = yield* Effect.forEach(entries, (name) => files.readFile(files.join(mod.vendor, name)).pipe(Effect.map(Option.map((text) => [name, text]))), { concurrency: CONCURRENCY$5 });
|
|
14059
|
+
return Record.fromEntries(Array$1.getSomes(read));
|
|
14060
|
+
});
|
|
14061
|
+
const byteLength = (text) => new TextEncoder().encode(text).length;
|
|
14062
|
+
const fileProblems = (mod, sizes) => pipe(Record.toEntries(sizes), Array$1.filter(([, size]) => size > FILE_LIMIT), Array$1.map(([name]) => problemFor$5(mod.vendor, `${name} is over ${FILE_LIMIT} bytes, and Claude Code does not read a file of a mod that large. Import fewer names from the vendor entry.`)));
|
|
14063
|
+
const totalProblems = (mod, sizes) => pipe(Number$1.sumAll(Record.values(sizes)), Option.liftPredicate((total) => total > TOTAL_LIMIT), Option.map((total) => problemFor$5(mod.vendor, `The vendored files take ${total} bytes, over the ${TOTAL_LIMIT} bytes Claude Code reads for one mod.`)), Option.toArray);
|
|
14064
|
+
const sizeProblems = (mod, expected) => {
|
|
14065
|
+
const sizes = pipe(expected, Record.map(byteLength));
|
|
14066
|
+
return [...fileProblems(mod, sizes), ...totalProblems(mod, sizes)];
|
|
14067
|
+
};
|
|
14068
|
+
const sameFiles = (current, expected) => Record.size(current) === Record.size(expected) && pipe(Record.toEntries(expected), Array$1.every(([name, text]) => Option.contains(Record.get(current, name), text)));
|
|
14069
|
+
const rewrite$1 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
|
|
14070
|
+
const files = yield* RepositoryFiles;
|
|
14071
|
+
const stale = pipe(Record.keys(current), Array$1.filter((name) => !Record.has(expected, name)));
|
|
14072
|
+
yield* Effect.forEach(stale, (name) => files.removeFile(files.join(mod.vendor, name)), {
|
|
14073
|
+
concurrency: CONCURRENCY$5,
|
|
14074
|
+
discard: true
|
|
14075
|
+
});
|
|
14076
|
+
yield* Effect.forEach(Record.toEntries(expected), ([name, text]) => files.writeFile(files.join(mod.vendor, name), text), {
|
|
14077
|
+
concurrency: CONCURRENCY$5,
|
|
14078
|
+
discard: true
|
|
14079
|
+
});
|
|
14080
|
+
});
|
|
14081
|
+
const REWRITTEN = "A mod imports packages only as files of its own, so msch bundles the names the mod imports from vendor/<package>.js out of the installed package, unminified. msch rewrote the vendor directory; commit the result.";
|
|
14082
|
+
const syncMod = Effect.fn("syncMod")(function* syncMod(mod) {
|
|
14083
|
+
const wanted = yield* wantedOf(mod);
|
|
14084
|
+
const expected = yield* expectedOf(mod, wanted);
|
|
14085
|
+
const current = yield* currentOf(mod);
|
|
14086
|
+
const sized = sizeProblems(mod, expected);
|
|
14087
|
+
if (sameFiles(current, expected)) return sized;
|
|
14088
|
+
yield* rewrite$1(mod, current, expected);
|
|
14089
|
+
return [problemFor$5(mod.vendor, REWRITTEN), ...sized];
|
|
14090
|
+
});
|
|
14091
|
+
const failedBundle = (mod) => (detail) => [problemFor$5(mod.vendor, `The vendor directory could not be bundled. ${detail}`)];
|
|
14092
|
+
const checkMod = Effect.fn("checkMod")(function* checkMod(mod) {
|
|
14093
|
+
return yield* syncMod(mod).pipe(Effect.orElseSucceed(failedBundle(mod)));
|
|
14094
|
+
});
|
|
14095
|
+
/** @internal */
|
|
14096
|
+
const checkModVendor = Effect.fn("checkModVendor")(function* checkModVendor(root) {
|
|
14097
|
+
const plugins = yield* pluginsIn$1(root);
|
|
14098
|
+
const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$5 });
|
|
14099
|
+
const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$5 });
|
|
14100
|
+
return Array$1.flatten(found);
|
|
14101
|
+
});
|
|
13934
14102
|
// src/features/check-plugin-dependencies/model/unresolved-imports.ts
|
|
13935
14103
|
const NOT_A_PACKAGE = /^(?:\.|\/|[A-Za-z]:[\\/])/u;
|
|
13936
14104
|
/** @internal */
|
|
@@ -13960,7 +14128,6 @@ const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
|
13960
14128
|
const LOCK_FILE = "bun.lock";
|
|
13961
14129
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
13962
14130
|
const TEST_FILE$2 = /\.(?:test|spec)(?:\.support)?\.[cm]?[jt]sx?$/u;
|
|
13963
|
-
const HOOKS_FILE = "hooks/hooks.json";
|
|
13964
14131
|
const SUCCESS$6 = 0;
|
|
13965
14132
|
const NOT_STARTED = -1;
|
|
13966
14133
|
const DETAIL_LINES = 3;
|
|
@@ -13982,27 +14149,9 @@ const needed = (project) => (file) => {
|
|
|
13982
14149
|
const prefix = `${project.directory}/`;
|
|
13983
14150
|
return String$1.startsWith(prefix)(file) && (SOURCE_FILE$1.test(file) || file === `${prefix}${PACKAGE_JSON_FILE}` || file === `${prefix}${LOCK_FILE}`);
|
|
13984
14151
|
};
|
|
13985
|
-
const Modules = Schema.String.pipe(Schema.Array, Schema.optional);
|
|
13986
|
-
const HooksFile = Schema.fromJsonString(Schema.Struct({ modules: Modules }));
|
|
13987
|
-
const decodeHooks = Schema.decodeUnknownOption(HooksFile);
|
|
13988
|
-
const PARENT = 1;
|
|
13989
|
-
const directoryOf$2 = (module) => {
|
|
13990
|
-
const parts = pipe(String$1.split(`hooks/${module}`, "/"), Array$1.filter((part) => part !== "" && part !== "."));
|
|
13991
|
-
return `${Array$1.join(Array$1.dropRight(parts, PARENT), "/")}/`;
|
|
13992
|
-
};
|
|
13993
|
-
/** @internal */
|
|
13994
|
-
const modDirectoriesOf = (hooks) => pipe(decodeHooks(hooks), Option.flatMap(({ modules }) => Option.fromNullishOr(modules)), Option.getOrElse(() => []), Array$1.map(directoryOf$2), Array$1.dedupe);
|
|
13995
14152
|
const underAny = (directories) => (name) => pipe(directories, Array$1.some((directory) => String$1.startsWith(directory)(name)));
|
|
13996
14153
|
/** @internal */
|
|
13997
|
-
const bundledEntries = (names,
|
|
13998
|
-
const modDirectories = Effect.fn("modDirectories")(function* modDirectories(directory) {
|
|
13999
|
-
const files = yield* RepositoryFiles;
|
|
14000
|
-
const hooks = yield* files.readFile(files.join(directory, HOOKS_FILE));
|
|
14001
|
-
return Option.match(hooks, {
|
|
14002
|
-
onNone: () => [],
|
|
14003
|
-
onSome: modDirectoriesOf
|
|
14004
|
-
});
|
|
14005
|
-
});
|
|
14154
|
+
const bundledEntries = (names, mods) => pipe(names, Array$1.filter((name) => SOURCE_FILE$1.test(name) && !TEST_FILE$2.test(name) && !underAny(mods)(name)));
|
|
14006
14155
|
const copied = Effect.fn("copied")(function* copied(root, project, sandbox) {
|
|
14007
14156
|
const files = yield* RepositoryFiles;
|
|
14008
14157
|
const listed = yield* files.listedFiles(root);
|
|
@@ -14214,7 +14363,7 @@ const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(dev
|
|
|
14214
14363
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14215
14364
|
const RULE$50 = "optional-peer";
|
|
14216
14365
|
const REQUIRED_RULE = "required-peer";
|
|
14217
|
-
const START$
|
|
14366
|
+
const START$28 = 0;
|
|
14218
14367
|
const SINGLE$1 = 1;
|
|
14219
14368
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
14220
14369
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
@@ -14222,9 +14371,9 @@ const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, na
|
|
|
14222
14371
|
const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
|
|
14223
14372
|
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
14224
14373
|
const positionIn = (located, key, name) => {
|
|
14225
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
14374
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$28);
|
|
14226
14375
|
const rest = String$1.slice(section)(located.source);
|
|
14227
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14376
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$28));
|
|
14228
14377
|
};
|
|
14229
14378
|
const problemFor$3 = (located, name, importers) => ({
|
|
14230
14379
|
file: located.file,
|
|
@@ -14244,7 +14393,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
|
14244
14393
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
14245
14394
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
14246
14395
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
14247
|
-
if (!(importers.length > START$
|
|
14396
|
+
if (!(importers.length > START$28 && importers.length < libraries.length) || neededByBin) return [];
|
|
14248
14397
|
return [problemFor$3(located, name, importers)];
|
|
14249
14398
|
}));
|
|
14250
14399
|
};
|
|
@@ -14267,7 +14416,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14267
14416
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14268
14417
|
const RULE$49 = "side-effects";
|
|
14269
14418
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14270
|
-
const START$
|
|
14419
|
+
const START$27 = 0;
|
|
14271
14420
|
const FIRST$12 = 1;
|
|
14272
14421
|
const LISTED_PACKAGES = 4;
|
|
14273
14422
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -14291,7 +14440,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
14291
14440
|
label: entry.label,
|
|
14292
14441
|
member,
|
|
14293
14442
|
...extra
|
|
14294
|
-
}, ({ modules }) => modules > START$
|
|
14443
|
+
}, ({ modules }) => modules > START$27);
|
|
14295
14444
|
});
|
|
14296
14445
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
14297
14446
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -14313,7 +14462,7 @@ const othersOf = (total) => {
|
|
|
14313
14462
|
};
|
|
14314
14463
|
const messageOf$6 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
|
|
14315
14464
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14316
|
-
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$
|
|
14465
|
+
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$27));
|
|
14317
14466
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14318
14467
|
file,
|
|
14319
14468
|
...positionOf(source)(keyIndex$1(source)),
|
|
@@ -14354,7 +14503,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14354
14503
|
return Array$1.flatten(found);
|
|
14355
14504
|
}, Effect.scoped);
|
|
14356
14505
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14357
|
-
const START$
|
|
14506
|
+
const START$26 = 0;
|
|
14358
14507
|
const NAME_KEY$2 = "\"name\"";
|
|
14359
14508
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14360
14509
|
const parent = files.dirname(module);
|
|
@@ -14371,7 +14520,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14371
14520
|
})));
|
|
14372
14521
|
});
|
|
14373
14522
|
const undeclaredMessage = (files, root) => ({ directory, name }) => `bundles modules of \`${name}\`, whose package.json does not declare "sideEffects". A bundler reads that field from the package that owns each module, so it keeps every module that \`${name}\` re-exports, together with what those modules import, even when this package uses none of them. Declare "sideEffects": false in ${files.relative(root, files.join(directory, PACKAGE_JSON_FILE))}, and keep a module that must run for its effect out of that package.`;
|
|
14374
|
-
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$
|
|
14523
|
+
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$26));
|
|
14375
14524
|
/** @internal */
|
|
14376
14525
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14377
14526
|
const files = yield* RepositoryFiles;
|
|
@@ -14748,7 +14897,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14748
14897
|
// src/app/disabled-rules.ts
|
|
14749
14898
|
const RULE$45 = "disabled-rule";
|
|
14750
14899
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14751
|
-
const START$
|
|
14900
|
+
const START$25 = 0;
|
|
14752
14901
|
const SIDE_CONFIG = /(?:^|\/)(?:\.oxlintrc(?:\.jsonc?)?|oxlint\.config\.[cm]?[jt]s|\.oxlintignore|\.eslintrc(?:\.\w+)?|eslint\.config\.[cm]?[jt]s|\.eslintignore|\.textlintrc(?:\.\w+)?|\.textlintignore|\.markdownlint(?:-cli2)?(?:\.\w+)?|\.markdownlintignore|\.prettierignore|\.oxfmtrc(?:\.jsonc?)?|knip\.jsonc?)$/u;
|
|
14753
14902
|
const SIDE_CONFIG_MESSAGE = "This file configures a check outside vite.config.ts, where msch cannot see whether it turns rules off. Delete it; msch builds every check setting in vite.config.ts.";
|
|
14754
14903
|
const taggedError$10 = Schema.TaggedError;
|
|
@@ -14760,7 +14909,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14760
14909
|
const files = yield* RepositoryFiles;
|
|
14761
14910
|
const listed = yield* files.listedFiles(root);
|
|
14762
14911
|
const isExempt = matcher(exempt);
|
|
14763
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$45)(files.join(root, name), "")(START$
|
|
14912
|
+
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$45)(files.join(root, name), "")(START$25, SIDE_CONFIG_MESSAGE)));
|
|
14764
14913
|
});
|
|
14765
14914
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14766
14915
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14773,14 +14922,14 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14773
14922
|
});
|
|
14774
14923
|
const expected = yield* expectationsIn(root);
|
|
14775
14924
|
const at = problemAtIndex(RULE$45)(file, source);
|
|
14776
|
-
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$
|
|
14925
|
+
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
|
|
14777
14926
|
});
|
|
14778
14927
|
/** @internal */
|
|
14779
14928
|
const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
|
|
14780
14929
|
const files = yield* RepositoryFiles;
|
|
14781
14930
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14782
14931
|
if (Option.isNone(text)) return [];
|
|
14783
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$45)(file, "")(START$
|
|
14932
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$45)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
14784
14933
|
});
|
|
14785
14934
|
// src/app/build-checks.ts
|
|
14786
14935
|
/** @internal */
|
|
@@ -14791,6 +14940,7 @@ const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
|
|
|
14791
14940
|
checkTreeShaking(root),
|
|
14792
14941
|
checkMigrationOrder(root),
|
|
14793
14942
|
checkPluginDependencies(root),
|
|
14943
|
+
checkModVendor(root),
|
|
14794
14944
|
checkDisabledRules(root)
|
|
14795
14945
|
], { concurrency: "unbounded" });
|
|
14796
14946
|
return Array$1.flatten(found);
|
|
@@ -15879,10 +16029,10 @@ const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR
|
|
|
15879
16029
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15880
16030
|
const PLUGIN_ROOT = "..";
|
|
15881
16031
|
const READ_CONCURRENCY$19 = 16;
|
|
15882
|
-
const START$
|
|
16032
|
+
const START$24 = 0;
|
|
15883
16033
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
15884
16034
|
path,
|
|
15885
|
-
index: found.index ?? START$
|
|
16035
|
+
index: found.index ?? START$24
|
|
15886
16036
|
})), Option.toArray);
|
|
15887
16037
|
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf$1));
|
|
15888
16038
|
const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
@@ -16001,7 +16151,7 @@ const FILTER_ASSIGNMENT = "--filter=";
|
|
|
16001
16151
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
16002
16152
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
16003
16153
|
const ONE$2 = 1;
|
|
16004
|
-
const START$
|
|
16154
|
+
const START$23 = 0;
|
|
16005
16155
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE$1), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
16006
16156
|
const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$2)), Option.orElse(() => pipe(tokens, Array$1.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
|
|
16007
16157
|
const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$2), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
@@ -16059,9 +16209,9 @@ const whereOf = (scope, file) => {
|
|
|
16059
16209
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask$1(graph, task)));
|
|
16060
16210
|
const problemsIn$12 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
|
|
16061
16211
|
file: absolute(file),
|
|
16062
|
-
...positionOf(text)(match.index ?? START$
|
|
16212
|
+
...positionOf(text)(match.index ?? START$23),
|
|
16063
16213
|
rule: RULE$38,
|
|
16064
|
-
message: `${match[START$
|
|
16214
|
+
message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
16065
16215
|
})), Option.toArray)));
|
|
16066
16216
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
16067
16217
|
/** @internal */
|
|
@@ -16311,8 +16461,8 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array$1.flatMap
|
|
|
16311
16461
|
const commandProblems$2 = (sources) => pipe(sources, Array$1.flatMap(problemsOf));
|
|
16312
16462
|
// src/shared/lib/workflow-run.ts
|
|
16313
16463
|
const RUN_KEY = "run";
|
|
16314
|
-
const START$
|
|
16315
|
-
const startOf$1 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
16464
|
+
const START$22 = 0;
|
|
16465
|
+
const startOf$1 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$22));
|
|
16316
16466
|
const runScriptsOf = (source) => {
|
|
16317
16467
|
const found = [];
|
|
16318
16468
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -16369,7 +16519,7 @@ const AGENT_DOCS = [
|
|
|
16369
16519
|
...EXCLUDED$5
|
|
16370
16520
|
];
|
|
16371
16521
|
const READ_CONCURRENCY$17 = 16;
|
|
16372
|
-
const START$
|
|
16522
|
+
const START$21 = 0;
|
|
16373
16523
|
const FIRST$9 = 1;
|
|
16374
16524
|
const LINE = "\n";
|
|
16375
16525
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -16377,7 +16527,7 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
|
16377
16527
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
16378
16528
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
16379
16529
|
const NO_SOURCES = [];
|
|
16380
|
-
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
16530
|
+
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$21));
|
|
16381
16531
|
const scriptSources = (file) => (source) => pipe(decodePackageJson(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([name, text]) => {
|
|
16382
16532
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
16383
16533
|
return {
|
|
@@ -16676,7 +16826,7 @@ const commentsFrom = (reader) => (read) => (source) => Effect.try({
|
|
|
16676
16826
|
catch: unreadable(reader)
|
|
16677
16827
|
});
|
|
16678
16828
|
// src/features/ban-comments/model/config-comments.ts
|
|
16679
|
-
const NEXT$
|
|
16829
|
+
const NEXT$2 = 1;
|
|
16680
16830
|
const yamlComments = commentsFrom("yaml")(yamlSourceComments);
|
|
16681
16831
|
const tomlComments = commentsFrom("toml")(tomlSourceComments);
|
|
16682
16832
|
const isSqlComment = (value) => isRecord(value) && (value["type"] === "line_comment" || value["type"] === "block_comment") && typeof value["text"] === "string" && Array$1.isArray(value["range"]);
|
|
@@ -16692,7 +16842,7 @@ const sqlComments = commentsFrom("sql")((source) => {
|
|
|
16692
16842
|
text
|
|
16693
16843
|
})));
|
|
16694
16844
|
});
|
|
16695
|
-
const offsetAt = (lines) => ({ line, character }) => character + pipe(lines, Array$1.take(line), Array$1.map((text) => text.length + NEXT$
|
|
16845
|
+
const offsetAt = (lines) => ({ line, character }) => character + pipe(lines, Array$1.take(line), Array$1.map((text) => text.length + NEXT$2), Number$1.sumAll);
|
|
16696
16846
|
const dockerfileComments = commentsFrom("dockerfile")((source) => {
|
|
16697
16847
|
const lines = String$1.split(source, "\n");
|
|
16698
16848
|
return pipe(DockerfileParser.parse(source).getComments(), Array$1.map((comment) => ({
|
|
@@ -16718,8 +16868,8 @@ const COMMENT_NODES = [
|
|
|
16718
16868
|
"block_comment",
|
|
16719
16869
|
"multiline_comment"
|
|
16720
16870
|
];
|
|
16721
|
-
const START$
|
|
16722
|
-
const NEXT = 1;
|
|
16871
|
+
const START$20 = 0;
|
|
16872
|
+
const NEXT$1 = 1;
|
|
16723
16873
|
const NONE$3 = [];
|
|
16724
16874
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
16725
16875
|
onFailure: ({ message }) => unreadable(grammar)(message),
|
|
@@ -16764,11 +16914,11 @@ const markupComment = (source) => (node) => {
|
|
|
16764
16914
|
if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$3;
|
|
16765
16915
|
return [{
|
|
16766
16916
|
index: node.startIndex,
|
|
16767
|
-
text: String$1.slice(node.startIndex, node.endIndex + NEXT)(source)
|
|
16917
|
+
text: String$1.slice(node.startIndex, node.endIndex + NEXT$1)(source)
|
|
16768
16918
|
}];
|
|
16769
16919
|
};
|
|
16770
16920
|
const textComments = (grammars, grammar) => (text) => {
|
|
16771
|
-
const shift = shifted(text.startIndex ?? START$
|
|
16921
|
+
const shift = shifted(text.startIndex ?? START$20);
|
|
16772
16922
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
16773
16923
|
};
|
|
16774
16924
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -16853,7 +17003,7 @@ const SUPPRESSION_RULE = "suppression";
|
|
|
16853
17003
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
16854
17004
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
16855
17005
|
const READ_CONCURRENCY$16 = 64;
|
|
16856
|
-
const START$
|
|
17006
|
+
const START$19 = 0;
|
|
16857
17007
|
const SHEBANG = "#!";
|
|
16858
17008
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
16859
17009
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
@@ -16868,11 +17018,11 @@ const taggedError$7 = Schema.TaggedError;
|
|
|
16868
17018
|
var CommentConfigUnreadable = class extends taggedError$7()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
16869
17019
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
16870
17020
|
const lineBefore = (source, index) => {
|
|
16871
|
-
const lines = pipe(source, String$1.slice(START$
|
|
17021
|
+
const lines = pipe(source, String$1.slice(START$19, index), String$1.split("\n"));
|
|
16872
17022
|
return Option.getOrElse(Array$1.last(lines), () => "");
|
|
16873
17023
|
};
|
|
16874
17024
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
16875
|
-
const isShebang = ({ index, text }) => index === START$
|
|
17025
|
+
const isShebang = ({ index, text }) => index === START$19 && String$1.startsWith(SHEBANG)(text);
|
|
16876
17026
|
const isSuppression = (comment) => SUPPRESSION.test(comment.text);
|
|
16877
17027
|
const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
|
|
16878
17028
|
const NOTHING = {
|
|
@@ -16900,7 +17050,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
16900
17050
|
});
|
|
16901
17051
|
const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
|
|
16902
17052
|
const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => !isSuppression(comment) && pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
|
|
16903
|
-
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$
|
|
17053
|
+
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$19));
|
|
16904
17054
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
16905
17055
|
const files = yield* RepositoryFiles;
|
|
16906
17056
|
const file = files.join(root, CONFIG_FILE$3);
|
|
@@ -16917,7 +17067,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16917
17067
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16918
17068
|
used: usedAllowances(allowances, found)
|
|
16919
17069
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16920
|
-
problems: [problemAtIndex(RULE$32)(file, source)(START$
|
|
17070
|
+
problems: [problemAtIndex(RULE$32)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
|
|
16921
17071
|
used: []
|
|
16922
17072
|
})))
|
|
16923
17073
|
});
|
|
@@ -17104,7 +17254,7 @@ const CONFIG_FILE$2 = "vite.config.ts";
|
|
|
17104
17254
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
17105
17255
|
const ADOPTER = "@r_masseater/vite-plus-adopt";
|
|
17106
17256
|
const SOURCE_SEPARATOR = "/";
|
|
17107
|
-
const START$
|
|
17257
|
+
const START$18 = 0;
|
|
17108
17258
|
const LOCAL_PREFIX = "./";
|
|
17109
17259
|
const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
|
|
17110
17260
|
const Source = Schema.Struct({
|
|
@@ -17117,7 +17267,7 @@ const taggedError$6 = Schema.TaggedError;
|
|
|
17117
17267
|
var SkillsConfigUnreadable = class extends taggedError$6()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
17118
17268
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
17119
17269
|
file,
|
|
17120
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
17270
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$18))),
|
|
17121
17271
|
rule,
|
|
17122
17272
|
message
|
|
17123
17273
|
});
|
|
@@ -17233,7 +17383,7 @@ const GITHUB$3 = "https://github.com/";
|
|
|
17233
17383
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
17234
17384
|
const BLANK = /\s+/u;
|
|
17235
17385
|
const SEPARATOR$10 = "/";
|
|
17236
|
-
const START$
|
|
17386
|
+
const START$17 = 0;
|
|
17237
17387
|
const FIRST$7 = 1;
|
|
17238
17388
|
const READ_CONCURRENCY$15 = 16;
|
|
17239
17389
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -17243,9 +17393,9 @@ const Frontmatter = Schema.Struct({
|
|
|
17243
17393
|
metadata: Schema.optional(Metadata)
|
|
17244
17394
|
});
|
|
17245
17395
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
17246
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$
|
|
17396
|
+
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$17));
|
|
17247
17397
|
const frontmatterOf = (source) => pipe(splitFrontmatter(source), Option.flatMap(({ fields }) => decodeFrontmatter(fields)));
|
|
17248
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$
|
|
17398
|
+
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$17].length), Option.getOrElse(() => START$17));
|
|
17249
17399
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
17250
17400
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
17251
17401
|
const bodyStart = bodyStartOf(source);
|
|
@@ -17278,11 +17428,11 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
17278
17428
|
})));
|
|
17279
17429
|
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) => ({
|
|
17280
17430
|
target,
|
|
17281
|
-
index: found.index ?? START$
|
|
17431
|
+
index: found.index ?? START$17
|
|
17282
17432
|
})), Option.toArray);
|
|
17283
17433
|
const rangeOf$2 = (found) => {
|
|
17284
|
-
const start = found.index ?? START$
|
|
17285
|
-
return [start, start + found[START$
|
|
17434
|
+
const start = found.index ?? START$17;
|
|
17435
|
+
return [start, start + found[START$17].length];
|
|
17286
17436
|
};
|
|
17287
17437
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
|
|
17288
17438
|
const linksIn$1 = (source) => {
|
|
@@ -17449,7 +17599,7 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
|
|
|
17449
17599
|
const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
17450
17600
|
const CAP_RULE = "renovate-version-cap";
|
|
17451
17601
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17452
|
-
const START$
|
|
17602
|
+
const START$16 = 0;
|
|
17453
17603
|
const READ_CONCURRENCY$13 = 16;
|
|
17454
17604
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17455
17605
|
const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
|
|
@@ -17468,7 +17618,7 @@ const problemsIn$8 = (file, source) => {
|
|
|
17468
17618
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
17469
17619
|
...pipe([{
|
|
17470
17620
|
file,
|
|
17471
|
-
...at(START$
|
|
17621
|
+
...at(START$16),
|
|
17472
17622
|
rule: PRESET_RULE,
|
|
17473
17623
|
message: PRESET_MESSAGE
|
|
17474
17624
|
}], Array$1.filter(() => !String$1.includes(`"${RENOVATE_PRESET}"`)(source)))
|
|
@@ -17588,7 +17738,7 @@ const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
|
17588
17738
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17589
17739
|
const RULE$25 = "applied-package";
|
|
17590
17740
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17591
|
-
const NOT_FOUND$
|
|
17741
|
+
const NOT_FOUND$4 = -1;
|
|
17592
17742
|
const SEPARATOR$9 = "/";
|
|
17593
17743
|
/** @internal */
|
|
17594
17744
|
const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
|
|
@@ -17627,7 +17777,7 @@ const problemAt$1 = (file, source) => (index, name) => ({
|
|
|
17627
17777
|
});
|
|
17628
17778
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
17629
17779
|
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped$1(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
17630
|
-
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND$
|
|
17780
|
+
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND$4, entry.name)))));
|
|
17631
17781
|
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$9}`)(name)), Array$1.match({
|
|
17632
17782
|
onEmpty: () => "",
|
|
17633
17783
|
onNonEmpty: Array$1.max(BY_LENGTH)
|
|
@@ -17792,7 +17942,7 @@ const SETUP_PATTERNS = [
|
|
|
17792
17942
|
];
|
|
17793
17943
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
17794
17944
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
17795
|
-
const START$
|
|
17945
|
+
const START$15 = 0;
|
|
17796
17946
|
const LAST_SEGMENT = 1;
|
|
17797
17947
|
const FIRST_LINE$2 = 1;
|
|
17798
17948
|
const FIRST_COLUMN$3 = 1;
|
|
@@ -17861,7 +18011,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
17861
18011
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
17862
18012
|
return directoriesOf(roots);
|
|
17863
18013
|
});
|
|
17864
|
-
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$
|
|
18014
|
+
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$15), (end) => String$1.slice(START$15, end)(name));
|
|
17865
18015
|
const pnpmOutputs = (present) => pipe(present, Array$1.filter(isPnpmOutput), Array$1.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array$1.map(pnpmOutput));
|
|
17866
18016
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
17867
18017
|
const cargoProblems = (present, enabled) => {
|
|
@@ -17898,7 +18048,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
17898
18048
|
});
|
|
17899
18049
|
// src/features/check-markdown-directives/model/directives.ts
|
|
17900
18050
|
const RULE$23 = "markdown-directive";
|
|
17901
|
-
const START$
|
|
18051
|
+
const START$14 = 0;
|
|
17902
18052
|
const SECOND = 1;
|
|
17903
18053
|
const ODD = 1;
|
|
17904
18054
|
const PAIR = 2;
|
|
@@ -17920,9 +18070,9 @@ const problemsIn$7 = (file, source) => {
|
|
|
17920
18070
|
const fenced = Array$1.mapAccum(lines, false, fenceStep)[SECOND];
|
|
17921
18071
|
const isCode = (index) => {
|
|
17922
18072
|
const { line, column } = positionOf(source)(index);
|
|
17923
|
-
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$
|
|
18073
|
+
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$14, column - SECOND)), Option.exists(insideCodeSpan));
|
|
17924
18074
|
};
|
|
17925
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$
|
|
18075
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$14)), Array$1.map((match) => problemAtIndex(RULE$23)(file, source)(match.index ?? START$14, MESSAGE$4)));
|
|
17926
18076
|
};
|
|
17927
18077
|
const isChecked$1 = (name) => String$1.endsWith(MARKDOWN$4)(name) && !pipe(SKIPPED_DIRECTORIES, Array$1.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array$1.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
|
|
17928
18078
|
/** @internal */
|
|
@@ -17945,7 +18095,7 @@ const RULE$22 = "owner-decision-removed";
|
|
|
17945
18095
|
const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
|
|
17946
18096
|
const TRAILER$1 = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
17947
18097
|
const READ_CONCURRENCY$10 = 16;
|
|
17948
|
-
const HEAD = "HEAD";
|
|
18098
|
+
const HEAD$1 = "HEAD";
|
|
17949
18099
|
const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
|
|
17950
18100
|
const countOf = (markers) => (marker) => pipe(markers, Array$1.filter((candidate) => candidate === marker)).length;
|
|
17951
18101
|
const lostMarkers = (before, after) => pipe(Array$1.dedupe(before), Array$1.flatMap((marker) => pipe(before, Array$1.filter((candidate) => candidate === marker), Array$1.take(countOf(before)(marker) - countOf(after)(marker)))));
|
|
@@ -17959,7 +18109,7 @@ const removalsSince = Effect.fn("removalsSince")(function* removalsSince(root, b
|
|
|
17959
18109
|
const changed = yield* files.changedFiles(root, base);
|
|
17960
18110
|
const found = yield* Effect.forEach(changed, (name) => Effect.gen(function* compare() {
|
|
17961
18111
|
const before = yield* files.readAtRevision(root, base, name);
|
|
17962
|
-
const after = yield* files.readAtRevision(root, HEAD, name);
|
|
18112
|
+
const after = yield* files.readAtRevision(root, HEAD$1, name);
|
|
17963
18113
|
const lost = lostMarkers(Option.match(before, {
|
|
17964
18114
|
onNone: () => [],
|
|
17965
18115
|
onSome: markersOf
|
|
@@ -17984,7 +18134,7 @@ const RULE$21 = "owner-name";
|
|
|
17984
18134
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17985
18135
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17986
18136
|
const SEPARATOR$7 = "/";
|
|
17987
|
-
const START$
|
|
18137
|
+
const START$13 = 0;
|
|
17988
18138
|
const DECLARED = [
|
|
17989
18139
|
"dependencies",
|
|
17990
18140
|
"devDependencies",
|
|
@@ -18021,7 +18171,7 @@ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
|
|
|
18021
18171
|
source: describedText(manifest)
|
|
18022
18172
|
}), Array$1.head, Option.toArray, Array$1.map(() => ({
|
|
18023
18173
|
file,
|
|
18024
|
-
...positionOf("")(START$
|
|
18174
|
+
...positionOf("")(START$13),
|
|
18025
18175
|
rule: RULE$21,
|
|
18026
18176
|
message: `Its description or keywords ${messageFor$4(owner)}`
|
|
18027
18177
|
})));
|
|
@@ -18087,17 +18237,17 @@ const checkOwnerPrinciples = Effect.fn("checkOwnerPrinciples")(function* checkOw
|
|
|
18087
18237
|
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
18088
18238
|
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
18089
18239
|
const NUL = "\0";
|
|
18090
|
-
const START$
|
|
18240
|
+
const START$12 = 0;
|
|
18091
18241
|
const HEX = 16;
|
|
18092
18242
|
const CODE_POINT_WIDTH = 4;
|
|
18093
18243
|
const READ_CONCURRENCY$9 = 64;
|
|
18094
18244
|
const RULE$19 = "hidden-unicode";
|
|
18095
|
-
const hexOf = (character) => pipe(String$1.codePointAt(START$
|
|
18245
|
+
const hexOf = (character) => pipe(String$1.codePointAt(START$12)(character), Option.getOrElse(() => START$12), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
|
|
18096
18246
|
const problemOf$3 = (file, source) => (found) => {
|
|
18097
|
-
const hex = hexOf(found[START$
|
|
18247
|
+
const hex = hexOf(found[START$12]);
|
|
18098
18248
|
return {
|
|
18099
18249
|
file,
|
|
18100
|
-
...positionOf(source)(found.index ?? START$
|
|
18250
|
+
...positionOf(source)(found.index ?? START$12),
|
|
18101
18251
|
rule: RULE$19,
|
|
18102
18252
|
message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
|
|
18103
18253
|
};
|
|
@@ -18136,7 +18286,7 @@ const RULE$18 = "effect-diagnostics-once";
|
|
|
18136
18286
|
const PLUGIN = "@effect/language-service";
|
|
18137
18287
|
const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
|
|
18138
18288
|
const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18139
|
-
const START$
|
|
18289
|
+
const START$11 = 0;
|
|
18140
18290
|
const Plugin = Schema.Struct({
|
|
18141
18291
|
name: Schema.optional(Schema.String),
|
|
18142
18292
|
diagnostics: Schema.optional(Schema.Unknown)
|
|
@@ -18149,7 +18299,7 @@ const MESSAGE$2 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics durin
|
|
|
18149
18299
|
const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
|
|
18150
18300
|
const problemsIn$5 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array$1.some(reportsDiagnostics)), Option.map(() => ({
|
|
18151
18301
|
file: entry.file,
|
|
18152
|
-
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$
|
|
18302
|
+
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$11))),
|
|
18153
18303
|
rule: RULE$18,
|
|
18154
18304
|
message: MESSAGE$2
|
|
18155
18305
|
})), Option.toArray);
|
|
@@ -18211,7 +18361,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
|
|
|
18211
18361
|
const RULE$16 = "pack-publint";
|
|
18212
18362
|
const CONFIG_FILE = "vite.config.ts";
|
|
18213
18363
|
const PACK_KEY = "pack:";
|
|
18214
|
-
const START$
|
|
18364
|
+
const START$10 = 0;
|
|
18215
18365
|
const READ_CONCURRENCY$8 = 16;
|
|
18216
18366
|
const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18217
18367
|
const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
|
|
@@ -18223,7 +18373,7 @@ var PackConfigUnreadable = class extends taggedError$5()("PackConfigUnreadable",
|
|
|
18223
18373
|
const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flatMap(({ pack }) => Option.fromUndefinedOr(pack)), Option.map((pack) => Array$1.ensure(pack)), Option.exists(Array$1.some(isStrict)));
|
|
18224
18374
|
const problemFor = (file, source) => ({
|
|
18225
18375
|
file,
|
|
18226
|
-
...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$
|
|
18376
|
+
...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$10)),
|
|
18227
18377
|
rule: RULE$16,
|
|
18228
18378
|
message: "This package is published, so its pack must run publint with `publint: { strict: true }`. Without it, publishConfig can point at files vp pack never writes, and the published package fails to import."
|
|
18229
18379
|
});
|
|
@@ -18255,14 +18405,14 @@ const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSett
|
|
|
18255
18405
|
});
|
|
18256
18406
|
// src/features/check-published-manifest/model/private-dependency.ts
|
|
18257
18407
|
const RULE$15 = "private-workspace-dependency";
|
|
18258
|
-
const START$
|
|
18408
|
+
const START$9 = 0;
|
|
18259
18409
|
const listedIn = (manifest) => pipe(RUNTIME_SECTIONS, Array$1.flatMap((section) => pipe(Option.fromUndefinedOr(manifest[section]), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.map((name) => ({
|
|
18260
18410
|
section,
|
|
18261
18411
|
name
|
|
18262
18412
|
})))));
|
|
18263
18413
|
const messageFor$3 = ({ section, name }) => `lists the private workspace package "${name}" in ${section}. A private package is never on npm, so pnpm refuses to pack this package and an install could not resolve it. Move "${name}" to devDependencies so that vp pack bundles it.`;
|
|
18264
18414
|
/** @internal */
|
|
18265
|
-
const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$
|
|
18415
|
+
const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$9));
|
|
18266
18416
|
/** @internal */
|
|
18267
18417
|
const privateDependencyProblems = (privateNames) => (found) => pipe(listedIn(found.manifest), Array$1.filter(({ name }) => privateNames.has(name)), Array$1.map((listed) => problemAtIndex(RULE$15)(found.entry.file, found.source)(quotedNameIndex(found.source)(listed.name), messageFor$3(listed))));
|
|
18268
18418
|
// src/features/check-published-manifest/model/dependency-peer-floor.ts
|
|
@@ -18335,7 +18485,7 @@ const dependencyPeerFloorProblems = (installed) => (found) => {
|
|
|
18335
18485
|
const RULE$13 = "package-homepage";
|
|
18336
18486
|
const BRANCH = "main";
|
|
18337
18487
|
const ROOT_DIRECTORY$1 = ".";
|
|
18338
|
-
const START$
|
|
18488
|
+
const START$8 = 0;
|
|
18339
18489
|
const KEYS = [
|
|
18340
18490
|
"\"homepage\"",
|
|
18341
18491
|
"\"repository\"",
|
|
@@ -18361,20 +18511,20 @@ const messagesOf = (manifest, directory) => pipe(decodeRepository$1(manifest.rep
|
|
|
18361
18511
|
onNone: () => [repositoryMissing(directory)],
|
|
18362
18512
|
onSome: repositoryMessages(manifest, directory)
|
|
18363
18513
|
}));
|
|
18364
|
-
const firstKeyIndex = (source) => pipe(KEYS, Array$1.findFirst((key) => String$1.includes(key)(source)), Option.flatMap((key) => String$1.indexOf(key)(source)), Option.getOrElse(() => START$
|
|
18514
|
+
const firstKeyIndex = (source) => pipe(KEYS, Array$1.findFirst((key) => String$1.includes(key)(source)), Option.flatMap((key) => String$1.indexOf(key)(source)), Option.getOrElse(() => START$8));
|
|
18365
18515
|
/** @internal */
|
|
18366
18516
|
const homepageProblems = (dirname) => ({ entry, source, manifest }) => pipe(Option.some(dirname(entry.name)), Option.filter((directory) => directory !== ROOT_DIRECTORY$1), Option.map((directory) => messagesOf(manifest, directory)), Option.getOrElse(() => []), Array$1.map((message) => problemAtIndex(RULE$13)(entry.file, source)(firstKeyIndex(source), message)));
|
|
18367
18517
|
// src/features/check-published-manifest/model/package-scope.ts
|
|
18368
18518
|
const RULE$12 = "package-scope";
|
|
18369
18519
|
const NAME_KEY = "\"name\"";
|
|
18370
|
-
const START$
|
|
18520
|
+
const START$7 = 0;
|
|
18371
18521
|
const unscopedName = (scope) => ({ manifest }) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(scope)(name)));
|
|
18372
|
-
const nameIndex = (source) => pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$
|
|
18522
|
+
const nameIndex = (source) => pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$7));
|
|
18373
18523
|
const BY_COUNT = Order.mapInput(Order.Number, ([, names]) => names.length);
|
|
18374
18524
|
/** @internal */
|
|
18375
18525
|
const sharedScope = (names) => pipe(names, Array$1.flatMap((name) => Option.toArray(scopeOfName(name))), Array$1.groupBy((scope) => scope), Record.toEntries, Array$1.sortBy(Order.mapInput(Order.String, ([scope]) => scope)), Array$1.match({
|
|
18376
18526
|
onEmpty: () => Option.none(),
|
|
18377
|
-
onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$
|
|
18527
|
+
onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$7])
|
|
18378
18528
|
}));
|
|
18379
18529
|
const messageFor$1 = (scope, name) => `Most packages of this repository are published under the ${scope} scope, and one scope tells whose packages they are. Rename "${name}" to "${scope}${String$1.replace(/^@[^/]+\//u, "")(name)}".`;
|
|
18380
18530
|
/** @internal */
|
|
@@ -18425,7 +18575,7 @@ const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t
|
|
|
18425
18575
|
const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
|
|
18426
18576
|
const ALTERNATIVE$1 = "||";
|
|
18427
18577
|
const ENGINES_KEY = "\"engines\"";
|
|
18428
|
-
const START$
|
|
18578
|
+
const START$6 = 0;
|
|
18429
18579
|
const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18430
18580
|
const majorOf = (found) => pipe(groupOf("major")(found), Option.map(Number));
|
|
18431
18581
|
const isOld = (major) => major < MINIMUM;
|
|
@@ -18436,11 +18586,11 @@ const floorIsOld = (alternative) => pipe(floorOf$1(alternative), Option.match({
|
|
|
18436
18586
|
}));
|
|
18437
18587
|
const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE$1), Array$1.some(floorIsOld));
|
|
18438
18588
|
const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$11)(entry.file, source)(index, message);
|
|
18439
|
-
const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
18589
|
+
const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$6));
|
|
18440
18590
|
const unstatedProblem = (entry, source) => problemAt({
|
|
18441
18591
|
entry,
|
|
18442
18592
|
source,
|
|
18443
|
-
index: START$
|
|
18593
|
+
index: START$6
|
|
18444
18594
|
}, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
|
|
18445
18595
|
const rangeProblem = (entry, source) => (range) => problemAt({
|
|
18446
18596
|
entry,
|
|
@@ -18459,12 +18609,12 @@ const manifestProblems$1 = (entry, source) => {
|
|
|
18459
18609
|
const pinnedProblems = (pattern) => (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.filter((found) => Option.exists(majorOf(found), isOld)), Array$1.map((found) => problemAt({
|
|
18460
18610
|
entry,
|
|
18461
18611
|
source,
|
|
18462
|
-
index: found.index ?? START$
|
|
18463
|
-
}, `${SUPPORTED} \`${String$1.trim(found[START$
|
|
18612
|
+
index: found.index ?? START$6
|
|
18613
|
+
}, `${SUPPORTED} \`${String$1.trim(found[START$6])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
|
|
18464
18614
|
const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
|
|
18465
18615
|
entry,
|
|
18466
18616
|
source,
|
|
18467
|
-
index: START$
|
|
18617
|
+
index: START$6
|
|
18468
18618
|
}, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
|
|
18469
18619
|
const problemsIn$3 = (entry, source) => {
|
|
18470
18620
|
if (MANIFEST$1.test(entry.name)) return manifestProblems$1(entry, source);
|
|
@@ -18512,7 +18662,7 @@ const LONGEST_PATH = 472;
|
|
|
18512
18662
|
const MOST_DEPTH = 12;
|
|
18513
18663
|
const LONGEST_PART = 255;
|
|
18514
18664
|
const LONGEST_DESCRIPTION = 500;
|
|
18515
|
-
const CONCURRENCY$
|
|
18665
|
+
const CONCURRENCY$4 = 16;
|
|
18516
18666
|
const PLUGIN_NAME = /^[\p{Ll}\p{Nd}-]{1,64}$/u;
|
|
18517
18667
|
const ALLOWED_PATH = /^[A-Za-z0-9 _.\-/(),]+$/u;
|
|
18518
18668
|
const XML_TAG = /<[A-Za-z][^>]*>/u;
|
|
@@ -18587,7 +18737,7 @@ const skillViolations = (skills) => {
|
|
|
18587
18737
|
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
|
|
18588
18738
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18589
18739
|
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
|
|
18590
|
-
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$
|
|
18740
|
+
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$4 });
|
|
18591
18741
|
return [
|
|
18592
18742
|
...manifestViolations(plugin),
|
|
18593
18743
|
...nestedManifests(plugin),
|
|
@@ -18611,7 +18761,7 @@ const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLa
|
|
|
18611
18761
|
const plugins = yield* pluginsIn$1(root);
|
|
18612
18762
|
const linked = yield* files.linkedFiles(root);
|
|
18613
18763
|
const links = new Set(linked);
|
|
18614
|
-
const found = yield* Effect.forEach(plugins, (plugin) => violationsOf(root, plugin, links).pipe(Effect.map(Array$1.map(({ path, message }) => problem$4(files.join(plugin.directory, path), message)))), { concurrency: CONCURRENCY$
|
|
18764
|
+
const found = yield* Effect.forEach(plugins, (plugin) => violationsOf(root, plugin, links).pipe(Effect.map(Array$1.map(({ path, message }) => problem$4(files.join(plugin.directory, path), message)))), { concurrency: CONCURRENCY$4 });
|
|
18615
18765
|
const marketplace = yield* rootProblems(root);
|
|
18616
18766
|
return [...Array$1.flatten(found), ...marketplace];
|
|
18617
18767
|
});
|
|
@@ -18722,7 +18872,7 @@ const README_FILE = "README.md";
|
|
|
18722
18872
|
const FIRST_SENTENCE = /^[\s\S]*?(?:。|\.(?=\s|$))/u;
|
|
18723
18873
|
const CALLED_SKILL$1 = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/u;
|
|
18724
18874
|
const EMPTY$1 = "";
|
|
18725
|
-
const START$
|
|
18875
|
+
const START$5 = 0;
|
|
18726
18876
|
const DIVIDER = "| --- | --- | --- |";
|
|
18727
18877
|
const CELL_BORDER = /(?<!\\)\|/u;
|
|
18728
18878
|
const DIVIDER_CELL = /^:?-+:?$/u;
|
|
@@ -18776,7 +18926,7 @@ const withSkillsTable = ({ readme, table, heading }) => {
|
|
|
18776
18926
|
const end = String$1.indexOf(SKILLS_END)(readme);
|
|
18777
18927
|
return pipe(Option.all([start, end]), Option.filter(([from, to]) => to > from), Option.match({
|
|
18778
18928
|
onNone: () => `${String$1.trimEnd(readme)}\n\n${heading}\n\n${block}\n`,
|
|
18779
|
-
onSome: ([from, to]) => `${String$1.slice(START$
|
|
18929
|
+
onSome: ([from, to]) => `${String$1.slice(START$5, from)(readme)}${block}${String$1.slice(to + 26)(readme)}`
|
|
18780
18930
|
}));
|
|
18781
18931
|
};
|
|
18782
18932
|
const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, skills }, labels) {
|
|
@@ -18876,7 +19026,7 @@ const enumerationSignals = (entities) => (file, text) => {
|
|
|
18876
19026
|
// src/features/check-skill-enumerations/model/skill-enumerations.ts
|
|
18877
19027
|
const RULE$6 = "skill-enumeration";
|
|
18878
19028
|
const FIRST$3 = 1;
|
|
18879
|
-
const CONCURRENCY$
|
|
19029
|
+
const CONCURRENCY$3 = 16;
|
|
18880
19030
|
const DOCUMENT_FILE = /\.(?:md|ts|tsx)$/u;
|
|
18881
19031
|
const position = problemAtPosition(RULE$6);
|
|
18882
19032
|
const problemsIn$2 = Effect.fn("problemsIn")(function* problemsIn(root, name, entities) {
|
|
@@ -18896,14 +19046,14 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
|
|
|
18896
19046
|
if (!Array$1.isReadonlyArrayNonEmpty(entities)) return [];
|
|
18897
19047
|
const listed = yield* files.listedFiles(root);
|
|
18898
19048
|
const documents = pipe(listed, Array$1.filter((name) => DOCUMENT_FILE.test(name)));
|
|
18899
|
-
const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$
|
|
19049
|
+
const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$3 });
|
|
18900
19050
|
return Array$1.flatten(found);
|
|
18901
19051
|
});
|
|
18902
19052
|
// src/features/check-skill-references/model/skill-references.ts
|
|
18903
19053
|
const RULE$5 = "skill-reference";
|
|
18904
19054
|
const OWNER_PREFIX = "do-";
|
|
18905
19055
|
const MARKDOWN$2 = ".md";
|
|
18906
|
-
const CONCURRENCY$
|
|
19056
|
+
const CONCURRENCY$2 = 16;
|
|
18907
19057
|
const MOST_OWNER_LINES = 4;
|
|
18908
19058
|
const NAMED_IN_BACKTICKS = /`(?<name>[a-z0-9]+(?:-[a-z0-9]+)*)`(?!\]\()/gu;
|
|
18909
19059
|
const CALLED_SKILL = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/gu;
|
|
@@ -18944,12 +19094,12 @@ const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, sk
|
|
|
18944
19094
|
const found = yield* Effect.forEach(documents, (file) => documentProblems({
|
|
18945
19095
|
file,
|
|
18946
19096
|
hub
|
|
18947
|
-
}, skill, others), { concurrency: CONCURRENCY$
|
|
19097
|
+
}, skill, others), { concurrency: CONCURRENCY$2 });
|
|
18948
19098
|
return Array$1.flatten(found);
|
|
18949
19099
|
});
|
|
18950
19100
|
const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
|
|
18951
19101
|
const others = pipe(skills, Array$1.filter((skill) => skill.name !== hub.name && !isOwnerEntry(skill)));
|
|
18952
|
-
const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$
|
|
19102
|
+
const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$2 });
|
|
18953
19103
|
const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
|
|
18954
19104
|
return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
|
|
18955
19105
|
});
|
|
@@ -18968,7 +19118,7 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
|
|
|
18968
19118
|
});
|
|
18969
19119
|
// src/features/check-skill-structure/model/skill-structure.ts
|
|
18970
19120
|
const RULE$4 = "skill-maintainer-context";
|
|
18971
|
-
const CONCURRENCY = 16;
|
|
19121
|
+
const CONCURRENCY$1 = 16;
|
|
18972
19122
|
const MARKDOWN$1 = ".md";
|
|
18973
19123
|
const PROJECT_FILE = /(?:^|\/)(?:package\.json|tsconfig[^/]*\.json|vite\.config\.[cm]?[jt]s|vitest\.config\.[cm]?[jt]s)$|\.[jt]sx$/u;
|
|
18974
19124
|
const SCRIPT_FILE = /\.[cm]?[jt]s$/u;
|
|
@@ -18993,7 +19143,7 @@ const problemsIn$1 = Effect.fn("problemsIn")(function* problemsIn(file) {
|
|
|
18993
19143
|
const checkSkillStructure = Effect.fn("checkSkillStructure")(function* checkSkillStructure(root) {
|
|
18994
19144
|
const plugins = yield* pluginsIn$1(root);
|
|
18995
19145
|
const inside = pipe(plugins, Array$1.flatMap(({ skills }) => skills), Array$1.flatMap(({ files }) => files));
|
|
18996
|
-
const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY });
|
|
19146
|
+
const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$1 });
|
|
18997
19147
|
return Array$1.flatten(found);
|
|
18998
19148
|
});
|
|
18999
19149
|
// src/app/plugin-checks.ts
|
|
@@ -19116,8 +19266,8 @@ const ALTERNATIVE = " || ";
|
|
|
19116
19266
|
const UNUSED = "unused";
|
|
19117
19267
|
const ANY_RANGE = "*";
|
|
19118
19268
|
const EXIT_COMMENT = /^#?\s*exit:\s*(?<condition>.*?)\s*$/u;
|
|
19119
|
-
const PACKAGE$
|
|
19120
|
-
const REGISTRY_CONDITION = new RegExp(String.raw`^(?<registry>npm|crate):(?<name>${PACKAGE$
|
|
19269
|
+
const PACKAGE$2 = String.raw`(?:@[^\s/@]+\/)?[^\s@]+`;
|
|
19270
|
+
const REGISTRY_CONDITION = new RegExp(String.raw`^(?<registry>npm|crate):(?<name>${PACKAGE$2})(?:@(?<range>.+)| (?<relation>drops|allows|requires) (?<dependency>${PACKAGE$2})(?:@(?<dependencyRange>.+))?)$`, "u");
|
|
19121
19271
|
const GITHUB_CONDITION = /^github:(?<owner>[\w.-]+)\/(?<repo>[\w.-]+)#(?<number>[1-9]\d*)$/u;
|
|
19122
19272
|
const GRAMMAR = "`unused`, `npm:<package>@<range>`, `npm:<package> drops <dependency>`, `npm:<package> allows <dependency>@<range>`, `npm:<package> requires <dependency>@<range>` (the same forms with `crate:`), or `github:<owner>/<repo>#<number>`, joined with ` || `";
|
|
19123
19273
|
const isRegistry$1 = (value) => value === "npm" || value === "crate";
|
|
@@ -19253,7 +19403,7 @@ const DECLARING_SECTIONS = [
|
|
|
19253
19403
|
const Dependencies = Schema.Record(Schema.String, Schema.String);
|
|
19254
19404
|
const NpmVersion = Schema.Record(Schema.String, Schema.Unknown);
|
|
19255
19405
|
const decodeDependencies = Schema.decodeUnknownOption(Dependencies);
|
|
19256
|
-
const NOT_FOUND$
|
|
19406
|
+
const NOT_FOUND$3 = 404;
|
|
19257
19407
|
const NOT_PUBLISHED = {
|
|
19258
19408
|
versions: [],
|
|
19259
19409
|
latestDependencies: {}
|
|
@@ -19282,7 +19432,7 @@ const releaseOfPackument = ({ "dist-tags": tags, versions }) => ({
|
|
|
19282
19432
|
latestDependencies: pipe(Record.get(versions, tags.latest), Option.map(declaredBy), Option.getOrElse(() => ({})))
|
|
19283
19433
|
});
|
|
19284
19434
|
const npmRelease = (name) => sent(packageLookup(name)).pipe(Effect.flatMap((response) => {
|
|
19285
|
-
if (response.status === NOT_FOUND$
|
|
19435
|
+
if (response.status === NOT_FOUND$3) return Effect.succeed(NOT_PUBLISHED);
|
|
19286
19436
|
return HttpClientResponse.filterStatusOk(response).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(NpmPackument)), Effect.map(releaseOfPackument));
|
|
19287
19437
|
}));
|
|
19288
19438
|
const crateRelease = Effect.fn("crateRelease")(function* lookupCrate(name) {
|
|
@@ -19431,10 +19581,10 @@ const NESTED_WORKSPACE = "/pnpm-workspace.yaml";
|
|
|
19431
19581
|
const NESTED_CARGO = "/Cargo.toml";
|
|
19432
19582
|
const CARGO_CONFIG = /(?:^|\/)\.cargo\/config(?:\.toml)?$/u;
|
|
19433
19583
|
const MANAGER_FIELDS = ["overrides", "resolutions"];
|
|
19434
|
-
const START$
|
|
19584
|
+
const START$4 = 0;
|
|
19435
19585
|
const PLACE = "Upstream deviations live only in the root pnpm-workspace.yaml (overrides, patchedDependencies, packageExtensions) and the root Cargo.toml ([patch]), each with an exit condition.";
|
|
19436
19586
|
const isManifest = (name) => name === PACKAGE_JSON_FILE || String$1.endsWith(`/${PACKAGE_JSON_FILE}`)(name);
|
|
19437
|
-
const keyIndex = (source, key) => Option.getOrElse(String$1.indexOf(`"${key}"`)(source), () => START$
|
|
19587
|
+
const keyIndex = (source, key) => Option.getOrElse(String$1.indexOf(`"${key}"`)(source), () => START$4);
|
|
19438
19588
|
const fieldsIn = (source) => pipe(decodePackageJson(source), Option.match({
|
|
19439
19589
|
onNone: () => [],
|
|
19440
19590
|
onSome: (manifest) => {
|
|
@@ -19464,8 +19614,8 @@ const checkScatteredDeviations = Effect.fn("checkScatteredDeviations")(function*
|
|
|
19464
19614
|
return yield* scanText(pipe(listed, Array$1.filter(isScanned)), problemsIn);
|
|
19465
19615
|
});
|
|
19466
19616
|
// src/features/check-upstream-updates/model/upstream-source.ts
|
|
19467
|
-
const PACKAGE = String.raw`(?:@[^\s/@]+\/)?[^\s/@]+`;
|
|
19468
|
-
const SOURCE$1 = new RegExp(String.raw`^(?:(?<registry>npm|crate):(?<name>${PACKAGE})|github:(?<owner>[\w.-]+)\/(?<repo>[\w.-]+))$`, "u");
|
|
19617
|
+
const PACKAGE$1 = String.raw`(?:@[^\s/@]+\/)?[^\s/@]+`;
|
|
19618
|
+
const SOURCE$1 = new RegExp(String.raw`^(?:(?<registry>npm|crate):(?<name>${PACKAGE$1})|github:(?<owner>[\w.-]+)\/(?<repo>[\w.-]+))$`, "u");
|
|
19469
19619
|
/** @internal */
|
|
19470
19620
|
const SOURCE_GRAMMAR = "`npm:<package>`, `crate:<crate>` or `github:<owner>/<repo>`";
|
|
19471
19621
|
const isRegistry = (value) => value === "npm" || value === "crate";
|
|
@@ -19507,8 +19657,8 @@ const Entry = Schema.Struct({
|
|
|
19507
19657
|
verdict: Schema.Literals(VERDICTS$3),
|
|
19508
19658
|
reason: Schema.String.check(Schema.isNonEmpty())
|
|
19509
19659
|
});
|
|
19510
|
-
const Manifest = Schema.Struct({ upstream: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
19511
|
-
const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
|
|
19660
|
+
const Manifest$1 = Schema.Struct({ upstream: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
19661
|
+
const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
|
|
19512
19662
|
const decodeEntry = Schema.decodeUnknownOption(Entry);
|
|
19513
19663
|
const REASON = "A workspace that reimplements something records its upstream so that msch upstream can tell when the upstream moves on without a decision.";
|
|
19514
19664
|
const SHAPE = `Write \`"<source>": { "reviewed": "<version>", "verdict": ${pipe(VERDICTS$3, Array$1.map((verdict) => `"${verdict}"`), Array$1.join(" | "))}, "reason": "<why>" }\``;
|
|
@@ -19544,7 +19694,7 @@ const foundFrom = (place, value) => {
|
|
|
19544
19694
|
problem: Option.none()
|
|
19545
19695
|
};
|
|
19546
19696
|
};
|
|
19547
|
-
const foundIn = (file, source) => pipe(decodeManifest(source), Option.flatMap(({ upstream }) => Option.fromUndefinedOr(upstream)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([key, value]) => foundFrom({
|
|
19697
|
+
const foundIn = (file, source) => pipe(decodeManifest$1(source), Option.flatMap(({ upstream }) => Option.fromUndefinedOr(upstream)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([key, value]) => foundFrom({
|
|
19548
19698
|
file,
|
|
19549
19699
|
source,
|
|
19550
19700
|
key
|
|
@@ -19719,7 +19869,7 @@ const COMMAND_RULE = "uncalled-command";
|
|
|
19719
19869
|
const FLAG_RULE = "uncalled-flag";
|
|
19720
19870
|
const READ_CONCURRENCY$6 = 64;
|
|
19721
19871
|
const SEPARATOR$3 = "/";
|
|
19722
|
-
const START$
|
|
19872
|
+
const START$3 = 0;
|
|
19723
19873
|
const NAME_GROUP = "name";
|
|
19724
19874
|
const SOURCE = /\.[cm]?tsx?$/u;
|
|
19725
19875
|
const DECLARED_COMMAND = /\bCommand\.make\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
@@ -19744,11 +19894,11 @@ const workspaceOf$1 = Effect.fn("workspaceOf")(function* workspaceOf(root, direc
|
|
|
19744
19894
|
});
|
|
19745
19895
|
const declaredIn = (pattern) => (source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.map((name) => ({
|
|
19746
19896
|
name,
|
|
19747
|
-
index: found.index ?? START$
|
|
19897
|
+
index: found.index ?? START$3,
|
|
19748
19898
|
source
|
|
19749
19899
|
})), Option.toArray)));
|
|
19750
19900
|
const runIn = (source) => pipe(Array$1.fromIterable(String$1.matchAll(RUN_COMMAND)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19751
|
-
const isRoot$1 = ({ index, source }) => pipe(runIn(source), Array$1.some((binding) => new RegExp(`\\b${binding}\\s*=\\s*$`, "u").test(String$1.slice(START$
|
|
19901
|
+
const isRoot$1 = ({ index, source }) => pipe(runIn(source), Array$1.some((binding) => new RegExp(`\\b${binding}\\s*=\\s*$`, "u").test(String$1.slice(START$3, index)(source.text))));
|
|
19752
19902
|
const elsewhere = (corpus) => ({ source }) => pipe(corpus, Array$1.filter((text) => text.file !== source.file && !isTest(text)));
|
|
19753
19903
|
const passesFlag = (declared) => {
|
|
19754
19904
|
const passed = new RegExp(`--${declared.name}(?![\\w-])`, "u");
|
|
@@ -19814,7 +19964,7 @@ const RULE = "unused-workspace";
|
|
|
19814
19964
|
const CARGO_FILE = "Cargo.toml";
|
|
19815
19965
|
const ROOT_DIRECTORY = "";
|
|
19816
19966
|
const TASK_SEPARATOR = "#";
|
|
19817
|
-
const START$
|
|
19967
|
+
const START$2 = 0;
|
|
19818
19968
|
const FIRST$1 = 1;
|
|
19819
19969
|
const READ_CONCURRENCY$5 = 8;
|
|
19820
19970
|
const LIBRARY_KINDS = [
|
|
@@ -19853,7 +20003,7 @@ const cargoFacts = Effect.fn("cargoFacts")(function* cargoFacts(root, directorie
|
|
|
19853
20003
|
links: pipe(crates, Array$1.flatMap(({ manifest, pathDependencies }) => linksOf(manifest, pathDependencies)))
|
|
19854
20004
|
};
|
|
19855
20005
|
});
|
|
19856
|
-
const workspaceOfTask = (text) => pipe(String$1.indexOf(TASK_SEPARATOR)(text), Option.map((at) => String$1.slice(START$
|
|
20006
|
+
const workspaceOfTask = (text) => pipe(String$1.indexOf(TASK_SEPARATOR)(text), Option.map((at) => String$1.slice(START$2, at)(text)), Option.filter(String$1.isNonEmpty));
|
|
19857
20007
|
const taskTargets = Effect.fn("taskTargets")(function* taskTargets(root, directory) {
|
|
19858
20008
|
const config = yield* workspaceConfigOf(root, directory);
|
|
19859
20009
|
return pipe(config, Option.map(({ program }) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap(stringsIn), Array$1.flatMap(({ text }) => Option.toArray(workspaceOfTask(text))))), Option.getOrElse(() => []));
|
|
@@ -19996,11 +20146,11 @@ const runCli = (name) => (program) => {
|
|
|
19996
20146
|
};
|
|
19997
20147
|
// src/shared/lib/quote-line.ts
|
|
19998
20148
|
const LINE_BREAK$2 = "\n";
|
|
19999
|
-
const START = 0;
|
|
20149
|
+
const START$1 = 0;
|
|
20000
20150
|
/** @internal */
|
|
20001
20151
|
const lineOfQuote = ({ text, quote }) => {
|
|
20002
20152
|
if (String$1.isEmpty(quote)) return Option.none();
|
|
20003
|
-
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START, index)(text), String$1.split(LINE_BREAK$2)).length));
|
|
20153
|
+
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START$1, index)(text), String$1.split(LINE_BREAK$2)).length));
|
|
20004
20154
|
};
|
|
20005
20155
|
// src/features/check-with-agents/model/answers.ts
|
|
20006
20156
|
const HypothesisSchema = Schema.Struct({
|
|
@@ -22723,7 +22873,7 @@ const declaredSymbols = Effect.fn("declaredSymbols")(function* declaredSymbols(g
|
|
|
22723
22873
|
// src/features/check-references/model/resolve-reference.ts
|
|
22724
22874
|
const GITHUB = "https://api.github.com/repos/";
|
|
22725
22875
|
const RAW = "application/vnd.github.raw+json";
|
|
22726
|
-
const NOT_FOUND$
|
|
22876
|
+
const NOT_FOUND$2 = 404;
|
|
22727
22877
|
const MULTIPLE_CHOICES = 300;
|
|
22728
22878
|
const SEPARATOR = "/";
|
|
22729
22879
|
const LATEST = "latest";
|
|
@@ -22747,7 +22897,7 @@ const Packument$1 = Schema.Struct({
|
|
|
22747
22897
|
versions: Schema.Record(Schema.String, Version)
|
|
22748
22898
|
});
|
|
22749
22899
|
const answered$1 = (lookup, missing, next) => Effect.flatMap(sent(lookup), (response) => {
|
|
22750
|
-
if (response.status === NOT_FOUND$
|
|
22900
|
+
if (response.status === NOT_FOUND$2) return Effect.succeed(broken(missing));
|
|
22751
22901
|
if (response.status >= MULTIPLE_CHOICES) return Effect.succeed(unchecked(`the lookup answered HTTP ${String(response.status)}`));
|
|
22752
22902
|
return next(response);
|
|
22753
22903
|
});
|
|
@@ -23045,10 +23195,10 @@ const packageAt = (file, text) => pipe(decodePackageJson(text), Option.filter((m
|
|
|
23045
23195
|
specified: pipe(SECTIONS, Array$1.flatMap((section) => specifiedIn(manifest[section])))
|
|
23046
23196
|
})))));
|
|
23047
23197
|
const OK = 200;
|
|
23048
|
-
const NOT_FOUND = 404;
|
|
23198
|
+
const NOT_FOUND$1 = 404;
|
|
23049
23199
|
const versionsIn = (response) => {
|
|
23050
23200
|
if (response.status === OK) return HttpClientResponse.schemaBodyJson(Packument)(response).pipe(Effect.map(({ versions }) => Option.some(Record.keys(versions))));
|
|
23051
|
-
if (response.status === NOT_FOUND) return Effect.succeedSome([]);
|
|
23201
|
+
if (response.status === NOT_FOUND$1) return Effect.succeedSome([]);
|
|
23052
23202
|
return Effect.succeedNone;
|
|
23053
23203
|
};
|
|
23054
23204
|
const publishedVersions = (name) => abbreviatedPackument(name).pipe(Effect.flatMap(versionsIn), Effect.orElseSucceed(() => Option.none()));
|
|
@@ -23150,16 +23300,102 @@ const SUBCOMMANDS = [
|
|
|
23150
23300
|
Command.make("unbumped", {}, unbumped).pipe(Command.withDescription("Reports a changed workspace whose version is not above the base")),
|
|
23151
23301
|
...NETWORK_COMMANDS
|
|
23152
23302
|
];
|
|
23153
|
-
// src/
|
|
23303
|
+
// src/features/write-mod-types/model/embedded-types.ts
|
|
23304
|
+
const FRAME = Buffer.from("KLUv/Q==", "base64");
|
|
23305
|
+
const HEAD = "// Claude Code function hooks:";
|
|
23306
|
+
const PROBE = 65536;
|
|
23307
|
+
const NOT_FOUND = -1;
|
|
23308
|
+
const NEXT = 1;
|
|
23309
|
+
const START = 0;
|
|
23310
|
+
const decompressed = (bytes, enough) => Effect.callback((resume) => {
|
|
23311
|
+
const stream = createZstdDecompress();
|
|
23312
|
+
const chunks = [];
|
|
23313
|
+
let size = 0;
|
|
23314
|
+
const done = () => {
|
|
23315
|
+
resume(Effect.succeed(Buffer.concat(chunks).toString("utf8")));
|
|
23316
|
+
};
|
|
23317
|
+
stream.on("data", (chunk) => {
|
|
23318
|
+
chunks.push(chunk);
|
|
23319
|
+
size += chunk.length;
|
|
23320
|
+
if (size >= enough) stream.destroy();
|
|
23321
|
+
});
|
|
23322
|
+
stream.once("error", done);
|
|
23323
|
+
stream.once("close", done);
|
|
23324
|
+
stream.end(bytes);
|
|
23325
|
+
});
|
|
23326
|
+
const frameStarts = (binary) => Array$1.unfold(binary.indexOf(FRAME), (at) => pipe(Option.liftPredicate(at, (offset) => offset !== NOT_FOUND), Option.map((offset) => [offset, binary.indexOf(FRAME, offset + NEXT)])));
|
|
23327
|
+
const frameAt = (binary, starts) => (at) => {
|
|
23328
|
+
const end = pipe(starts, Array$1.findFirst((start) => start > at), Option.getOrElse(() => binary.length));
|
|
23329
|
+
return binary.subarray(at, end);
|
|
23330
|
+
};
|
|
23331
|
+
const isTypes = (frame) => pipe(decompressed(frame.subarray(START, PROBE), 30), Effect.map(String$1.startsWith(HEAD)));
|
|
23332
|
+
const embeddedTypes = Effect.fn("embeddedTypes")(function* embeddedTypes(bytes) {
|
|
23333
|
+
const binary = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
23334
|
+
const starts = frameStarts(binary);
|
|
23335
|
+
const frames = pipe(starts, Array$1.map(frameAt(binary, starts)));
|
|
23336
|
+
const found = yield* Effect.filter(frames, isTypes, { concurrency: 1 });
|
|
23337
|
+
return yield* Option.match(Array$1.head(found), {
|
|
23338
|
+
onNone: () => Effect.succeed(Option.none()),
|
|
23339
|
+
onSome: (frame) => Effect.asSome(decompressed(frame, Number.POSITIVE_INFINITY))
|
|
23340
|
+
});
|
|
23341
|
+
});
|
|
23342
|
+
// src/features/write-mod-types/model/mod-types.ts
|
|
23343
|
+
const PACKAGE = "@anthropic-ai/claude-code";
|
|
23344
|
+
const BINARY = "bin/claude.exe";
|
|
23345
|
+
const TYPES_FILE = ".claude-plugin/types/claude-code/index.d.ts";
|
|
23346
|
+
const CONCURRENCY = 4;
|
|
23347
|
+
const stampOf = (version) => `// Written by Claude Code ${version}.`;
|
|
23348
|
+
const Manifest = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
|
|
23349
|
+
const decodeManifest = Schema.decodeUnknownOption(Manifest);
|
|
23350
|
+
const modsIn = Effect.fn("modsIn")(function* modsIn(plugin) {
|
|
23351
|
+
const directories = yield* modDirectories(plugin.directory);
|
|
23352
|
+
return pipe(Option.liftPredicate(plugin.directory, () => Array$1.isReadonlyArrayNonEmpty(directories)), Option.toArray);
|
|
23353
|
+
});
|
|
23354
|
+
const installedVersion = Effect.fn("installedVersion")(function* installedVersion(directory) {
|
|
23355
|
+
const files = yield* RepositoryFiles;
|
|
23356
|
+
const manifest = yield* files.readFile(files.join(directory, "package.json"));
|
|
23357
|
+
return pipe(manifest, Option.flatMap(decodeManifest), Option.map(({ version }) => version));
|
|
23358
|
+
});
|
|
23359
|
+
const typesOf = Effect.fn("typesOf")(function* typesOf(directory, version) {
|
|
23360
|
+
const files = yield* RepositoryFiles;
|
|
23361
|
+
const binary = yield* files.readBytes(files.join(directory, BINARY));
|
|
23362
|
+
const types = yield* Option.match(binary, {
|
|
23363
|
+
onNone: () => Effect.succeed(Option.none()),
|
|
23364
|
+
onSome: embeddedTypes
|
|
23365
|
+
});
|
|
23366
|
+
return pipe(types, Option.map((text) => `${stampOf(version)}\n${text}`));
|
|
23367
|
+
});
|
|
23368
|
+
const isStamped = (stamp) => (text) => pipe(text, String$1.startsWith(`${stamp}\n`));
|
|
23369
|
+
const writeAll = Effect.fn("writeAll")(function* writeAll(plugins, directory, version) {
|
|
23370
|
+
const files = yield* RepositoryFiles;
|
|
23371
|
+
const targets = pipe(plugins, Array$1.map((plugin) => files.join(plugin, TYPES_FILE)));
|
|
23372
|
+
const written = yield* Effect.forEach(targets, files.readFile, { concurrency: CONCURRENCY });
|
|
23373
|
+
const stamped = isStamped(stampOf(version));
|
|
23374
|
+
if (pipe(written, Array$1.every(Option.exists(stamped)))) return;
|
|
23375
|
+
const types = yield* typesOf(directory, version);
|
|
23376
|
+
const writeTo = (text) => Effect.forEach(targets, (target) => files.writeFile(target, text), {
|
|
23377
|
+
concurrency: CONCURRENCY,
|
|
23378
|
+
discard: true
|
|
23379
|
+
});
|
|
23380
|
+
yield* Option.match(types, {
|
|
23381
|
+
onNone: () => Effect.void,
|
|
23382
|
+
onSome: writeTo
|
|
23383
|
+
});
|
|
23384
|
+
});
|
|
23385
|
+
const writeModTypes = Effect.fn("writeModTypes")(function* writeModTypes(root) {
|
|
23386
|
+
const files = yield* RepositoryFiles;
|
|
23387
|
+
const plugins = yield* pluginsIn$1(root);
|
|
23388
|
+
const found = yield* Effect.forEach(plugins, modsIn, { concurrency: CONCURRENCY });
|
|
23389
|
+
const mods = Array$1.flatten(found);
|
|
23390
|
+
const directory = files.join(root, NODE_MODULES$2, PACKAGE);
|
|
23391
|
+
const version = yield* installedVersion(directory);
|
|
23392
|
+
if (Array$1.isReadonlyArrayEmpty(mods) || Option.isNone(version)) return;
|
|
23393
|
+
yield* writeAll(mods, directory, version.value);
|
|
23394
|
+
});
|
|
23395
|
+
// src/app/tool-checks.ts
|
|
23154
23396
|
const NO_PROBLEMS = 0;
|
|
23155
23397
|
const ONE_FAILURE = 1;
|
|
23156
23398
|
const NO_CONFIG = "config-missing";
|
|
23157
|
-
const PREPARE = "prepare";
|
|
23158
|
-
const STAGED = "staged";
|
|
23159
|
-
const PRE_PUSH = "pre-push";
|
|
23160
|
-
const COMMIT_MSG = "commit-msg";
|
|
23161
|
-
const MESSAGE = "message";
|
|
23162
|
-
const FLAG_PREFIX = "--";
|
|
23163
23399
|
const writeStderr = Effect.fn("writeStderr")(function* writeStderr(text) {
|
|
23164
23400
|
const stdio = yield* Stdio.Stdio;
|
|
23165
23401
|
yield* Stream.make(text).pipe(Stream.run(stdio.stderr()), Effect.orDie);
|
|
@@ -23168,7 +23404,15 @@ const failuresOf = (args, kind, message) => {
|
|
|
23168
23404
|
if (Array$1.isReadonlyArrayEmpty(args) && kind === NO_CONFIG) return Effect.succeed(NO_PROBLEMS);
|
|
23169
23405
|
return writeStderr(`${message}\n`).pipe(Effect.as(ONE_FAILURE));
|
|
23170
23406
|
};
|
|
23407
|
+
/** @internal */
|
|
23171
23408
|
const toolChecks = (root, args) => runVpa(root, args).pipe(Effect.as(NO_PROBLEMS), Effect.catchIf(Schema.is(VpToolsError), (failure) => failuresOf(args, failure.kind, failure.message)));
|
|
23409
|
+
// src/app/cli.ts
|
|
23410
|
+
const PREPARE = "prepare";
|
|
23411
|
+
const STAGED = "staged";
|
|
23412
|
+
const PRE_PUSH = "pre-push";
|
|
23413
|
+
const COMMIT_MSG = "commit-msg";
|
|
23414
|
+
const MESSAGE = "message";
|
|
23415
|
+
const FLAG_PREFIX = "--";
|
|
23172
23416
|
const checkEverything = Effect.fn("checkEverything")(function* checkEverything(root) {
|
|
23173
23417
|
const problemCount = yield* reportProblemCount(root);
|
|
23174
23418
|
const toolFailures = yield* toolChecks(root, []);
|
|
@@ -23192,6 +23436,7 @@ const hookArguments = (input) => [
|
|
|
23192
23436
|
const checks = Effect.fn("checks")(function* checks(input) {
|
|
23193
23437
|
const root = (yield* RepositoryFiles).resolve(".");
|
|
23194
23438
|
if (input.json) return yield* writeJson(root);
|
|
23439
|
+
if (input.prepare) yield* writeModTypes(root);
|
|
23195
23440
|
const args = hookArguments(input);
|
|
23196
23441
|
if (Array$1.isReadonlyArrayNonEmpty(args)) return yield* toolChecks(root, args).pipe(Effect.flatMap(failWhenAny));
|
|
23197
23442
|
return yield* checkEverything(root);
|