@r_masseater/msch 0.119.1 → 0.120.2
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 +12 -15
- package/dist/addon-tasks.mjs.map +1 -1
- package/dist/cargo-inputs.mjs +1 -1
- package/dist/cli.mjs +599 -335
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +8 -3
- package/dist/config.mjs +6 -5
- package/dist/config.mjs.map +1 -1
- 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-u44g9ha6.mjs} +25 -4
- package/dist/published-u44g9ha6.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-BMqkLDDC.mjs} +18 -5
- package/dist/repository-text-BMqkLDDC.mjs.map +1 -0
- package/dist/{workspace-projects-DYfp6Tpn.mjs → workspace-projects-wllEd2HL.mjs} +14 -7
- package/dist/workspace-projects-wllEd2HL.mjs.map +1 -0
- 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 +7 -7
- 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/repository-text-DluK673j.mjs.map +0 -1
- package/dist/workspace-projects-DYfp6Tpn.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
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
|
|
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 childrenOf$4, D as propertyValue, E as nestedValues, O as stringsIn, S as KeySchema, T as literalOf, a as workspaceManifest, c as TASK_NAMES, d as definesTask, f as hasCargoTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, p as hasVerifyTask, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as keyName, x as workspaceConfigOf } from "./workspace-projects-wllEd2HL.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-u44g9ha6.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-BMqkLDDC.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 {
|
|
14
|
-
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";
|
|
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, Semaphore, 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";
|
|
17
16
|
import { hookFlags } from "@r_masseater/masseater-utils/hook-flags";
|
|
@@ -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.2";
|
|
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)));
|
|
@@ -13234,17 +13236,20 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
|
|
|
13234
13236
|
message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${PACKAGE_JSON_FILE} is ${version.value}. msch publish releases the version in package.json, so bump both in the same PR.`
|
|
13235
13237
|
});
|
|
13236
13238
|
});
|
|
13239
|
+
const lintedPerWorkspace = (config) => Effect.map(hasCargoTask(config), (atRoot) => !atRoot);
|
|
13237
13240
|
/** @internal */
|
|
13238
13241
|
const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
13239
13242
|
const files = yield* RepositoryFiles;
|
|
13240
13243
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13241
13244
|
const directories = yield* workspaceDirectories(root);
|
|
13242
13245
|
const crates = yield* cratesIn(root);
|
|
13243
|
-
const
|
|
13246
|
+
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$8)));
|
|
13247
|
+
const unverified = (crate) => problemIn$3(root, directories, crate).pipe(Effect.when(notAtRoot), Effect.map(Option.flatten));
|
|
13248
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$28 });
|
|
13244
13249
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13245
13250
|
});
|
|
13246
13251
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
13247
|
-
const RULE$
|
|
13252
|
+
const RULE$60 = "deploy-entry-pattern";
|
|
13248
13253
|
const FALLOW_KEYS = [
|
|
13249
13254
|
"entry",
|
|
13250
13255
|
"entryPoints",
|
|
@@ -13315,7 +13320,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
13315
13320
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
13316
13321
|
file: path,
|
|
13317
13322
|
...positionOf(text.value)(start - kind.offset),
|
|
13318
|
-
rule: RULE$
|
|
13323
|
+
rule: RULE$60,
|
|
13319
13324
|
message: `${pattern} ${MESSAGE$10}`
|
|
13320
13325
|
})));
|
|
13321
13326
|
});
|
|
@@ -13348,7 +13353,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13348
13353
|
return Array$1.flatten(found);
|
|
13349
13354
|
});
|
|
13350
13355
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
13351
|
-
const RULE$
|
|
13356
|
+
const RULE$59 = "listed-entry";
|
|
13352
13357
|
const ENTRY_KEYS = [
|
|
13353
13358
|
"entry",
|
|
13354
13359
|
"entryPoints",
|
|
@@ -13356,7 +13361,7 @@ const ENTRY_KEYS = [
|
|
|
13356
13361
|
];
|
|
13357
13362
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
13358
13363
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13359
|
-
const SEPARATOR$
|
|
13364
|
+
const SEPARATOR$17 = "/";
|
|
13360
13365
|
const WRAP_OFFSET = 1;
|
|
13361
13366
|
const READ_CONCURRENCY$26 = 8;
|
|
13362
13367
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
@@ -13368,7 +13373,7 @@ const entryPatternsIn = (node) => {
|
|
|
13368
13373
|
})));
|
|
13369
13374
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13370
13375
|
};
|
|
13371
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
13376
|
+
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
13377
|
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13373
13378
|
const files = yield* RepositoryFiles;
|
|
13374
13379
|
const path = files.join(root, file);
|
|
@@ -13378,7 +13383,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13378
13383
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
13379
13384
|
file: path,
|
|
13380
13385
|
...positionOf(text.value)(start),
|
|
13381
|
-
rule: RULE$
|
|
13386
|
+
rule: RULE$59,
|
|
13382
13387
|
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
13388
|
})));
|
|
13384
13389
|
});
|
|
@@ -13390,26 +13395,26 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
13390
13395
|
return Array$1.flatten(found);
|
|
13391
13396
|
});
|
|
13392
13397
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13393
|
-
const RULE$
|
|
13398
|
+
const RULE$58 = "root-workspace-path";
|
|
13394
13399
|
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13395
13400
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13396
13401
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
13397
13402
|
const FIRST$15 = 0;
|
|
13398
|
-
const NEXT$
|
|
13403
|
+
const NEXT$3 = 1;
|
|
13399
13404
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
13400
13405
|
const mentions = (directory) => (text) => {
|
|
13401
13406
|
const parts = String$1.split(text, directory);
|
|
13402
|
-
return pipe(Array$1.drop(parts, NEXT$
|
|
13407
|
+
return pipe(Array$1.drop(parts, NEXT$3), Array$1.some((after, index) => {
|
|
13403
13408
|
const before = parts[index] ?? "";
|
|
13404
|
-
const previous = String$1.slice(before.length - NEXT$
|
|
13405
|
-
const following = String$1.slice(FIRST$15, NEXT$
|
|
13409
|
+
const previous = String$1.slice(before.length - NEXT$3)(before);
|
|
13410
|
+
const following = String$1.slice(FIRST$15, NEXT$3)(after);
|
|
13406
13411
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
13407
13412
|
}));
|
|
13408
13413
|
};
|
|
13409
13414
|
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13410
13415
|
file,
|
|
13411
13416
|
...positionOf(source)(found.start),
|
|
13412
|
-
rule: RULE$
|
|
13417
|
+
rule: RULE$58,
|
|
13413
13418
|
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
13419
|
})));
|
|
13415
13420
|
/** @internal */
|
|
@@ -13423,7 +13428,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13423
13428
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13424
13429
|
});
|
|
13425
13430
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13426
|
-
const RULE$
|
|
13431
|
+
const RULE$57 = "hidden-verify";
|
|
13427
13432
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13428
13433
|
const FIRST$14 = 1;
|
|
13429
13434
|
const READ_CONCURRENCY$25 = 8;
|
|
@@ -13437,7 +13442,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13437
13442
|
file,
|
|
13438
13443
|
line: FIRST$14,
|
|
13439
13444
|
column: FIRST$14,
|
|
13440
|
-
rule: RULE$
|
|
13445
|
+
rule: RULE$57,
|
|
13441
13446
|
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
13447
|
}).pipe(Option.filter(() => verified));
|
|
13443
13448
|
});
|
|
@@ -13448,7 +13453,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
13448
13453
|
return Array$1.getSomes(found);
|
|
13449
13454
|
});
|
|
13450
13455
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13451
|
-
const RULE$
|
|
13456
|
+
const RULE$56 = "shared-uncached-task";
|
|
13452
13457
|
const READ_CONCURRENCY$24 = 8;
|
|
13453
13458
|
const SHARED = 2;
|
|
13454
13459
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -13491,7 +13496,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
13491
13496
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
13492
13497
|
file,
|
|
13493
13498
|
...position,
|
|
13494
|
-
rule: RULE$
|
|
13499
|
+
rule: RULE$56,
|
|
13495
13500
|
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
13501
|
})));
|
|
13497
13502
|
};
|
|
@@ -13502,7 +13507,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
13502
13507
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13503
13508
|
});
|
|
13504
13509
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13505
|
-
const RULE$
|
|
13510
|
+
const RULE$55 = "tested-verify";
|
|
13506
13511
|
const READ_CONCURRENCY$23 = 8;
|
|
13507
13512
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13508
13513
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
@@ -13531,7 +13536,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13531
13536
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13532
13537
|
file,
|
|
13533
13538
|
...positionOf(source)(at.start),
|
|
13534
|
-
rule: RULE$
|
|
13539
|
+
rule: RULE$55,
|
|
13535
13540
|
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
13541
|
})))));
|
|
13537
13542
|
});
|
|
@@ -13542,7 +13547,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
|
|
|
13542
13547
|
return Array$1.flatten(found);
|
|
13543
13548
|
});
|
|
13544
13549
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13545
|
-
const RULE$
|
|
13550
|
+
const RULE$54 = "unlocked-task";
|
|
13546
13551
|
const READ_CONCURRENCY$22 = 8;
|
|
13547
13552
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13548
13553
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -13554,7 +13559,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
13554
13559
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
13555
13560
|
file,
|
|
13556
13561
|
...positionOf(source)(task.start),
|
|
13557
|
-
rule: RULE$
|
|
13562
|
+
rule: RULE$54,
|
|
13558
13563
|
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
13564
|
})), Option.toArray)));
|
|
13560
13565
|
/** @internal */
|
|
@@ -13590,16 +13595,16 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13590
13595
|
});
|
|
13591
13596
|
// src/shared/lib/package-name.ts
|
|
13592
13597
|
const SCOPE$2 = "@";
|
|
13593
|
-
const SEPARATOR$
|
|
13598
|
+
const SEPARATOR$16 = "/";
|
|
13594
13599
|
const SCOPED_SEGMENTS = 2;
|
|
13595
13600
|
const PLAIN_SEGMENTS = 1;
|
|
13596
13601
|
const segmentCount = (specifier) => {
|
|
13597
13602
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13598
13603
|
return PLAIN_SEGMENTS;
|
|
13599
13604
|
};
|
|
13600
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13605
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$16), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$16));
|
|
13601
13606
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13602
|
-
const RELATIVE$
|
|
13607
|
+
const RELATIVE$2 = /^\.\.?(?:\/|$)/u;
|
|
13603
13608
|
const SUBPATH_IMPORT$1 = "#";
|
|
13604
13609
|
const WILDCARD$1 = "*";
|
|
13605
13610
|
const SOURCE_SUFFIXES = [
|
|
@@ -13635,13 +13640,13 @@ const existingSource = Effect.fn("existingSource")(function* existingSource(base
|
|
|
13635
13640
|
});
|
|
13636
13641
|
const localFile = Effect.fn("localFile")(function* localFile({ directory, imports }, from, specifier) {
|
|
13637
13642
|
const files = yield* RepositoryFiles;
|
|
13638
|
-
if (RELATIVE$
|
|
13643
|
+
if (RELATIVE$2.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13639
13644
|
const target = subpathTarget(imports, specifier);
|
|
13640
13645
|
if (Option.isNone(target)) return Option.none();
|
|
13641
13646
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
13642
13647
|
});
|
|
13643
13648
|
const referenceOf$2 = (graph, from, specifier) => {
|
|
13644
|
-
if (RELATIVE$
|
|
13649
|
+
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
13650
|
const name = packageNameOf(specifier);
|
|
13646
13651
|
return Effect.succeedSome(Result.fail(name));
|
|
13647
13652
|
};
|
|
@@ -13688,7 +13693,7 @@ const packagesByEntry = Effect.fn("packagesByEntry")(function* packagesByEntry(a
|
|
|
13688
13693
|
}).pipe(Effect.map((packages) => [entry, packages])), { concurrency: 1 });
|
|
13689
13694
|
});
|
|
13690
13695
|
// src/features/measure-install-size/model/installed-closure.ts
|
|
13691
|
-
const EMPTY$
|
|
13696
|
+
const EMPTY$4 = 0;
|
|
13692
13697
|
const installedNames = (manifest) => [...namesIn(manifest, ["dependencies", "optionalDependencies"]), ...pipe(namesIn(manifest, ["peerDependencies"]), Array$1.difference(optionalPeerNames(manifest)))];
|
|
13693
13698
|
const childrenOf$2 = Effect.fn("childrenOf")(function* childrenOf(directory) {
|
|
13694
13699
|
const files = yield* RepositoryFiles;
|
|
@@ -13697,7 +13702,7 @@ const childrenOf$2 = Effect.fn("childrenOf")(function* childrenOf(directory) {
|
|
|
13697
13702
|
});
|
|
13698
13703
|
const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
|
|
13699
13704
|
const files = yield* RepositoryFiles;
|
|
13700
|
-
const candidate = files.join(from, NODE_MODULES$
|
|
13705
|
+
const candidate = files.join(from, NODE_MODULES$2, name);
|
|
13701
13706
|
if (yield* files.exists(files.join(candidate, PACKAGE_JSON_FILE))) {
|
|
13702
13707
|
const real = yield* files.realPath(candidate);
|
|
13703
13708
|
return Option.some(real);
|
|
@@ -13729,9 +13734,9 @@ const closureOf$2 = (provided, collect) => Array$1.match(collect.pending, {
|
|
|
13729
13734
|
const directorySize = (directory) => Effect.gen(function* sizeOfDirectory() {
|
|
13730
13735
|
const files = yield* RepositoryFiles;
|
|
13731
13736
|
const names = yield* files.readDirectory(directory);
|
|
13732
|
-
const entries = pipe(names, Array$1.filter((name) => name !== NODE_MODULES$
|
|
13737
|
+
const entries = pipe(names, Array$1.filter((name) => name !== NODE_MODULES$2), Array$1.map((name) => files.join(directory, name)));
|
|
13733
13738
|
const sizes = yield* Effect.forEach(entries, (entry) => files.isDirectory(entry).pipe(Effect.flatMap((kind) => {
|
|
13734
|
-
if (Option.isNone(kind)) return Effect.succeed(EMPTY$
|
|
13739
|
+
if (Option.isNone(kind)) return Effect.succeed(EMPTY$4);
|
|
13735
13740
|
if (kind.value) return directorySize(entry);
|
|
13736
13741
|
return files.fileSize(entry);
|
|
13737
13742
|
})), { concurrency: 1 });
|
|
@@ -13743,7 +13748,7 @@ const installedClosure = ({ provided, from, name }) => closureOf$2(provided, {
|
|
|
13743
13748
|
});
|
|
13744
13749
|
const installedSize = (directory) => {
|
|
13745
13750
|
if (String$1.includes(`/node_modules/`)(directory)) return directorySize(directory);
|
|
13746
|
-
return Effect.succeed(EMPTY$
|
|
13751
|
+
return Effect.succeed(EMPTY$4);
|
|
13747
13752
|
};
|
|
13748
13753
|
// src/features/measure-install-size/model/install-size.ts
|
|
13749
13754
|
const INSTALL_SIZE = "install-size";
|
|
@@ -13754,11 +13759,11 @@ const LISTED_LARGEST = 5;
|
|
|
13754
13759
|
const SIZE_CONCURRENCY = 32;
|
|
13755
13760
|
const MEGABYTE = 1e6;
|
|
13756
13761
|
const MEGABYTE_DIGITS = 1;
|
|
13757
|
-
const START$
|
|
13762
|
+
const START$29 = 0;
|
|
13758
13763
|
const SINGLE_ENTRY = 1;
|
|
13759
13764
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13760
13765
|
const usageHint = (dependency, entryCount) => {
|
|
13761
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13766
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$29 && dependency.entries.length < entryCount)) return "";
|
|
13762
13767
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13763
13768
|
};
|
|
13764
13769
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13767,7 +13772,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13767
13772
|
const { workspace, total } = overrun;
|
|
13768
13773
|
const config = yield* files.readFile(workspace.configFile);
|
|
13769
13774
|
const source = Option.getOrElse(config, () => "");
|
|
13770
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13775
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$29);
|
|
13771
13776
|
return {
|
|
13772
13777
|
file: workspace.configFile,
|
|
13773
13778
|
...positionOf(source)(index),
|
|
@@ -13784,7 +13789,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13784
13789
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13785
13790
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13786
13791
|
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$
|
|
13792
|
+
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$29)), Number$1.sumAll);
|
|
13788
13793
|
return {
|
|
13789
13794
|
closures,
|
|
13790
13795
|
sizeOf,
|
|
@@ -13799,7 +13804,7 @@ const importersOf = Effect.fn("importersOf")(function* importersOf({ workspace,
|
|
|
13799
13804
|
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
13805
|
}, Effect.scoped);
|
|
13801
13806
|
const bySizeDescending = Order.mapInput(Order.flip(Order.Number), (dependency) => dependency.size);
|
|
13802
|
-
const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published, direct) {
|
|
13807
|
+
const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(published, direct) {
|
|
13803
13808
|
const { closures, sizeOf, total } = yield* measure(published, direct);
|
|
13804
13809
|
if (total <= published.workspace.installBudget) return [];
|
|
13805
13810
|
const importers = yield* importersOf(published);
|
|
@@ -13817,11 +13822,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
13817
13822
|
})];
|
|
13818
13823
|
});
|
|
13819
13824
|
const stackProblems = (file, source, dependencies) => {
|
|
13820
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
13825
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$29);
|
|
13821
13826
|
const rest = String$1.slice(section)(source);
|
|
13822
13827
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
13823
13828
|
file,
|
|
13824
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
13829
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$29)),
|
|
13825
13830
|
rule: STACK_DEPENDENCY,
|
|
13826
13831
|
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
13832
|
})));
|
|
@@ -13837,7 +13842,7 @@ const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, fil
|
|
|
13837
13842
|
packEntries: workspace.packEntries
|
|
13838
13843
|
});
|
|
13839
13844
|
const provided = HashSet.fromIterable(namesIn(manifest.value, ["peerDependencies"]));
|
|
13840
|
-
const sized = yield* sizeProblems({
|
|
13845
|
+
const sized = yield* sizeProblems$1({
|
|
13841
13846
|
workspace,
|
|
13842
13847
|
entries,
|
|
13843
13848
|
provided
|
|
@@ -13870,7 +13875,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
|
|
|
13870
13875
|
return yield* files.mergeBase(root, base);
|
|
13871
13876
|
});
|
|
13872
13877
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13873
|
-
const RULE$
|
|
13878
|
+
const RULE$53 = "migration-order";
|
|
13874
13879
|
const SNAPSHOT = "snapshot.json";
|
|
13875
13880
|
const MIGRATION = "migration.sql";
|
|
13876
13881
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
@@ -13904,7 +13909,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13904
13909
|
file: join(root, file),
|
|
13905
13910
|
line: FIRST$13,
|
|
13906
13911
|
column: FIRST$13,
|
|
13907
|
-
rule: RULE$
|
|
13912
|
+
rule: RULE$53,
|
|
13908
13913
|
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
13914
|
})))), Option.getOrElse(() => []));
|
|
13910
13915
|
/** @internal */
|
|
@@ -13931,6 +13936,172 @@ const bundleErrorDetail = (error) => {
|
|
|
13931
13936
|
onNonEmpty: Array$1.join(" ")
|
|
13932
13937
|
}));
|
|
13933
13938
|
};
|
|
13939
|
+
// src/features/check-mod-vendor/model/vendor-imports.ts
|
|
13940
|
+
const IMPORT_DECLARATION = /import\s+(?<kind>type\s+)?\{(?<names>[^}]*)\}\s*from\s*["'](?<specifier>[^"']+)["']/gu;
|
|
13941
|
+
const TYPE_PREFIX = /^type\s+/u;
|
|
13942
|
+
const ALIAS$1 = /\s+as\s+\S+$/u;
|
|
13943
|
+
const VENDOR_FILE = /^(?<name>[\w.-]+)\.js$/u;
|
|
13944
|
+
const SEPARATOR$15 = "/";
|
|
13945
|
+
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, "")));
|
|
13946
|
+
const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option.filter((groups) => !Predicate.isString(groups["kind"])), Option.flatMap((groups) => Option.all({
|
|
13947
|
+
specifier: Option.fromNullishOr(groups["specifier"]),
|
|
13948
|
+
list: Option.fromNullishOr(groups["names"])
|
|
13949
|
+
})), Option.map(({ specifier, list }) => ({
|
|
13950
|
+
specifier,
|
|
13951
|
+
names: valueNames(list)
|
|
13952
|
+
})));
|
|
13953
|
+
/** @internal */
|
|
13954
|
+
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)));
|
|
13955
|
+
const nameIn = (rest) => pipe(Option.fromNullishOr(VENDOR_FILE.exec(rest)), Option.flatMapNullishOr(({ groups }) => groups), Option.flatMapNullishOr((groups) => groups["name"]));
|
|
13956
|
+
/** @internal */
|
|
13957
|
+
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);
|
|
13958
|
+
/** @internal */
|
|
13959
|
+
const entrySource = (name, names) => {
|
|
13960
|
+
return `export { ${pipe(Array$1.sort(Array$1.dedupe(names), Order.String), Array$1.join(", "))} } from "${name}";\n`;
|
|
13961
|
+
};
|
|
13962
|
+
// src/features/check-mod-vendor/model/vendor-build.ts
|
|
13963
|
+
const ENTRY_PREFIX = "\0msch-vendor:";
|
|
13964
|
+
const NODE_MODULES$1 = "node_modules";
|
|
13965
|
+
const PACKAGE_FILE = "package.json";
|
|
13966
|
+
const ancestors = (from, root, dirname) => Array$1.unfold(Option.some(from), (current) => pipe(current, Option.map((directory) => {
|
|
13967
|
+
const parent = dirname(directory);
|
|
13968
|
+
return [directory, pipe(parent, Option.liftPredicate(() => directory !== root && parent !== directory))];
|
|
13969
|
+
})));
|
|
13970
|
+
const packageDirectory = Effect.fn("packageDirectory")(function* packageDirectory(request) {
|
|
13971
|
+
const files = yield* RepositoryFiles;
|
|
13972
|
+
const candidates = pipe(ancestors(request.from, request.root, files.dirname), Array$1.map((directory) => files.join(directory, NODE_MODULES$1, request.name)));
|
|
13973
|
+
const found = yield* Effect.findFirst(candidates, (candidate) => files.exists(files.join(candidate, PACKAGE_FILE)));
|
|
13974
|
+
return yield* Option.match(found, {
|
|
13975
|
+
onNone: () => Effect.fail(`${request.name} is not installed, so it cannot be bundled.`),
|
|
13976
|
+
onSome: files.realPath
|
|
13977
|
+
});
|
|
13978
|
+
});
|
|
13979
|
+
const isChunk$2 = (output) => output.type === "chunk";
|
|
13980
|
+
const vendorPlugin = (request) => {
|
|
13981
|
+
const entry = `${ENTRY_PREFIX}${request.name}`;
|
|
13982
|
+
const isEntry = (id) => id === entry;
|
|
13983
|
+
return {
|
|
13984
|
+
name: "msch-vendor",
|
|
13985
|
+
resolveId: (id) => pipe(id, Option.liftPredicate(isEntry), Option.getOrNull),
|
|
13986
|
+
load: (id) => pipe(id, Option.liftPredicate(isEntry), Option.map(() => entrySource(request.name, request.names)), Option.getOrNull)
|
|
13987
|
+
};
|
|
13988
|
+
};
|
|
13989
|
+
/** @internal */
|
|
13990
|
+
const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
|
|
13991
|
+
const files = yield* RepositoryFiles;
|
|
13992
|
+
const directory = yield* packageDirectory(request);
|
|
13993
|
+
const built = yield* Effect.tryPromise({
|
|
13994
|
+
try: () => rolldown({
|
|
13995
|
+
input: { [request.name]: `${ENTRY_PREFIX}${request.name}` },
|
|
13996
|
+
cwd: request.from,
|
|
13997
|
+
platform: "neutral",
|
|
13998
|
+
logLevel: "silent",
|
|
13999
|
+
plugins: [vendorPlugin(request)]
|
|
14000
|
+
}),
|
|
14001
|
+
catch: bundleErrorDetail
|
|
14002
|
+
});
|
|
14003
|
+
const output = yield* Effect.tryPromise({
|
|
14004
|
+
try: () => built.generate({
|
|
14005
|
+
format: "esm",
|
|
14006
|
+
preserveModules: true,
|
|
14007
|
+
preserveModulesRoot: files.dirname(directory),
|
|
14008
|
+
entryFileNames: "[name].js"
|
|
14009
|
+
}),
|
|
14010
|
+
catch: bundleErrorDetail
|
|
14011
|
+
}).pipe(Effect.ensuring(Effect.promise(() => built.close())));
|
|
14012
|
+
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`));
|
|
14013
|
+
});
|
|
14014
|
+
// src/features/check-mod-vendor/model/mod-vendor.ts
|
|
14015
|
+
const RULE$52 = "mod-vendor";
|
|
14016
|
+
const VENDOR = "vendor";
|
|
14017
|
+
const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
|
|
14018
|
+
const RELATIVE$1 = /^\.\.?\//u;
|
|
14019
|
+
const FILE_LIMIT = 1048576;
|
|
14020
|
+
const TOTAL_LIMIT = 8388608;
|
|
14021
|
+
const CONCURRENCY$5 = 4;
|
|
14022
|
+
const EMPTY$3 = "";
|
|
14023
|
+
const problemFor$5 = problemInFile(RULE$52);
|
|
14024
|
+
const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
|
|
14025
|
+
const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
|
|
14026
|
+
const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
|
|
14027
|
+
const files = yield* RepositoryFiles;
|
|
14028
|
+
const directories = yield* modDirectories(plugin.directory);
|
|
14029
|
+
const modOf = (directory) => ({
|
|
14030
|
+
vendor: files.join(plugin.directory, directory, VENDOR),
|
|
14031
|
+
sources: sourcesOf$2(plugin, directory, files.join),
|
|
14032
|
+
from: plugin.directory,
|
|
14033
|
+
root
|
|
14034
|
+
});
|
|
14035
|
+
return pipe(directories, Array$1.map(modOf));
|
|
14036
|
+
});
|
|
14037
|
+
const wantedIn$1 = Effect.fn("wantedIn")(function* wantedIn(mod, file) {
|
|
14038
|
+
const files = yield* RepositoryFiles;
|
|
14039
|
+
const source = yield* files.readFile(file);
|
|
14040
|
+
const declarations = importedNames$1(Option.getOrElse(source, () => EMPTY$3));
|
|
14041
|
+
const directory = files.dirname(file);
|
|
14042
|
+
const packagesOf = (specifier) => vendorPackageOf(mod.vendor, files.join(directory, specifier));
|
|
14043
|
+
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]))));
|
|
14044
|
+
});
|
|
14045
|
+
const wantedOf = Effect.fn("wantedOf")(function* wantedOf(mod) {
|
|
14046
|
+
const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$5 });
|
|
14047
|
+
return pipe(Array$1.flatten(found), Array$1.groupBy(([name]) => name), Record.map(Array$1.flatMap(([, names]) => names)));
|
|
14048
|
+
});
|
|
14049
|
+
const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
|
|
14050
|
+
const built = yield* Effect.forEach(Record.toEntries(wanted), ([name, names]) => vendorFiles({
|
|
14051
|
+
name,
|
|
14052
|
+
names,
|
|
14053
|
+
from: mod.from,
|
|
14054
|
+
root: mod.root
|
|
14055
|
+
}), { concurrency: 1 });
|
|
14056
|
+
return pipe(built, Array$1.flatMap(Record.toEntries), Record.fromEntries);
|
|
14057
|
+
});
|
|
14058
|
+
const currentOf = Effect.fn("currentOf")(function* currentOf(mod) {
|
|
14059
|
+
const files = yield* RepositoryFiles;
|
|
14060
|
+
const entries = yield* files.walkDirectory(mod.vendor);
|
|
14061
|
+
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 });
|
|
14062
|
+
return Record.fromEntries(Array$1.getSomes(read));
|
|
14063
|
+
});
|
|
14064
|
+
const byteLength = (text) => new TextEncoder().encode(text).length;
|
|
14065
|
+
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.`)));
|
|
14066
|
+
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);
|
|
14067
|
+
const sizeProblems = (mod, expected) => {
|
|
14068
|
+
const sizes = pipe(expected, Record.map(byteLength));
|
|
14069
|
+
return [...fileProblems(mod, sizes), ...totalProblems(mod, sizes)];
|
|
14070
|
+
};
|
|
14071
|
+
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)));
|
|
14072
|
+
const rewrite$1 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
|
|
14073
|
+
const files = yield* RepositoryFiles;
|
|
14074
|
+
const stale = pipe(Record.keys(current), Array$1.filter((name) => !Record.has(expected, name)));
|
|
14075
|
+
yield* Effect.forEach(stale, (name) => files.removeFile(files.join(mod.vendor, name)), {
|
|
14076
|
+
concurrency: CONCURRENCY$5,
|
|
14077
|
+
discard: true
|
|
14078
|
+
});
|
|
14079
|
+
yield* Effect.forEach(Record.toEntries(expected), ([name, text]) => files.writeFile(files.join(mod.vendor, name), text), {
|
|
14080
|
+
concurrency: CONCURRENCY$5,
|
|
14081
|
+
discard: true
|
|
14082
|
+
});
|
|
14083
|
+
});
|
|
14084
|
+
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.";
|
|
14085
|
+
const syncMod = Effect.fn("syncMod")(function* syncMod(mod) {
|
|
14086
|
+
const wanted = yield* wantedOf(mod);
|
|
14087
|
+
const expected = yield* expectedOf(mod, wanted);
|
|
14088
|
+
const current = yield* currentOf(mod);
|
|
14089
|
+
const sized = sizeProblems(mod, expected);
|
|
14090
|
+
if (sameFiles(current, expected)) return sized;
|
|
14091
|
+
yield* rewrite$1(mod, current, expected);
|
|
14092
|
+
return [problemFor$5(mod.vendor, REWRITTEN), ...sized];
|
|
14093
|
+
});
|
|
14094
|
+
const failedBundle = (mod) => (detail) => [problemFor$5(mod.vendor, `The vendor directory could not be bundled. ${detail}`)];
|
|
14095
|
+
const checkMod = Effect.fn("checkMod")(function* checkMod(mod) {
|
|
14096
|
+
return yield* syncMod(mod).pipe(Effect.orElseSucceed(failedBundle(mod)));
|
|
14097
|
+
});
|
|
14098
|
+
/** @internal */
|
|
14099
|
+
const checkModVendor = Effect.fn("checkModVendor")(function* checkModVendor(root) {
|
|
14100
|
+
const plugins = yield* pluginsIn$1(root);
|
|
14101
|
+
const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$5 });
|
|
14102
|
+
const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$5 });
|
|
14103
|
+
return Array$1.flatten(found);
|
|
14104
|
+
});
|
|
13934
14105
|
// src/features/check-plugin-dependencies/model/unresolved-imports.ts
|
|
13935
14106
|
const NOT_A_PACKAGE = /^(?:\.|\/|[A-Za-z]:[\\/])/u;
|
|
13936
14107
|
/** @internal */
|
|
@@ -13960,7 +14131,6 @@ const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
|
13960
14131
|
const LOCK_FILE = "bun.lock";
|
|
13961
14132
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
13962
14133
|
const TEST_FILE$2 = /\.(?:test|spec)(?:\.support)?\.[cm]?[jt]sx?$/u;
|
|
13963
|
-
const HOOKS_FILE = "hooks/hooks.json";
|
|
13964
14134
|
const SUCCESS$6 = 0;
|
|
13965
14135
|
const NOT_STARTED = -1;
|
|
13966
14136
|
const DETAIL_LINES = 3;
|
|
@@ -13982,27 +14152,9 @@ const needed = (project) => (file) => {
|
|
|
13982
14152
|
const prefix = `${project.directory}/`;
|
|
13983
14153
|
return String$1.startsWith(prefix)(file) && (SOURCE_FILE$1.test(file) || file === `${prefix}${PACKAGE_JSON_FILE}` || file === `${prefix}${LOCK_FILE}`);
|
|
13984
14154
|
};
|
|
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
14155
|
const underAny = (directories) => (name) => pipe(directories, Array$1.some((directory) => String$1.startsWith(directory)(name)));
|
|
13996
14156
|
/** @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
|
-
});
|
|
14157
|
+
const bundledEntries = (names, mods) => pipe(names, Array$1.filter((name) => SOURCE_FILE$1.test(name) && !TEST_FILE$2.test(name) && !underAny(mods)(name)));
|
|
14006
14158
|
const copied = Effect.fn("copied")(function* copied(root, project, sandbox) {
|
|
14007
14159
|
const files = yield* RepositoryFiles;
|
|
14008
14160
|
const listed = yield* files.listedFiles(root);
|
|
@@ -14214,17 +14366,17 @@ const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(dev
|
|
|
14214
14366
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14215
14367
|
const RULE$50 = "optional-peer";
|
|
14216
14368
|
const REQUIRED_RULE = "required-peer";
|
|
14217
|
-
const START$
|
|
14218
|
-
const SINGLE$
|
|
14369
|
+
const START$28 = 0;
|
|
14370
|
+
const SINGLE$3 = 1;
|
|
14219
14371
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
14220
14372
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
14221
14373
|
const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, name);
|
|
14222
14374
|
const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
|
|
14223
14375
|
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
14224
14376
|
const positionIn = (located, key, name) => {
|
|
14225
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
14377
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$28);
|
|
14226
14378
|
const rest = String$1.slice(section)(located.source);
|
|
14227
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14379
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$28));
|
|
14228
14380
|
};
|
|
14229
14381
|
const problemFor$3 = (located, name, importers) => ({
|
|
14230
14382
|
file: located.file,
|
|
@@ -14240,11 +14392,11 @@ const librariesIn = (used) => pipe(used, Array$1.filter(({ entry }) => !isBinEnt
|
|
|
14240
14392
|
const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
14241
14393
|
const libraries = librariesIn(used);
|
|
14242
14394
|
const bins = pipe(used, Array$1.filter(({ entry }) => isBinEntry(entry)));
|
|
14243
|
-
if (libraries.length <= SINGLE$
|
|
14395
|
+
if (libraries.length <= SINGLE$3) return [];
|
|
14244
14396
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
14245
14397
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
14246
14398
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
14247
|
-
if (!(importers.length > START$
|
|
14399
|
+
if (!(importers.length > START$28 && importers.length < libraries.length) || neededByBin) return [];
|
|
14248
14400
|
return [problemFor$3(located, name, importers)];
|
|
14249
14401
|
}));
|
|
14250
14402
|
};
|
|
@@ -14267,7 +14419,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14267
14419
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14268
14420
|
const RULE$49 = "side-effects";
|
|
14269
14421
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14270
|
-
const START$
|
|
14422
|
+
const START$27 = 0;
|
|
14271
14423
|
const FIRST$12 = 1;
|
|
14272
14424
|
const LISTED_PACKAGES = 4;
|
|
14273
14425
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -14291,7 +14443,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
14291
14443
|
label: entry.label,
|
|
14292
14444
|
member,
|
|
14293
14445
|
...extra
|
|
14294
|
-
}, ({ modules }) => modules > START$
|
|
14446
|
+
}, ({ modules }) => modules > START$27);
|
|
14295
14447
|
});
|
|
14296
14448
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
14297
14449
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -14313,7 +14465,7 @@ const othersOf = (total) => {
|
|
|
14313
14465
|
};
|
|
14314
14466
|
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
14467
|
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$
|
|
14468
|
+
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
14469
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14318
14470
|
file,
|
|
14319
14471
|
...positionOf(source)(keyIndex$1(source)),
|
|
@@ -14354,7 +14506,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14354
14506
|
return Array$1.flatten(found);
|
|
14355
14507
|
}, Effect.scoped);
|
|
14356
14508
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14357
|
-
const START$
|
|
14509
|
+
const START$26 = 0;
|
|
14358
14510
|
const NAME_KEY$2 = "\"name\"";
|
|
14359
14511
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14360
14512
|
const parent = files.dirname(module);
|
|
@@ -14371,7 +14523,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14371
14523
|
})));
|
|
14372
14524
|
});
|
|
14373
14525
|
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$
|
|
14526
|
+
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$26));
|
|
14375
14527
|
/** @internal */
|
|
14376
14528
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14377
14529
|
const files = yield* RepositoryFiles;
|
|
@@ -14748,7 +14900,7 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
14748
14900
|
// src/app/disabled-rules.ts
|
|
14749
14901
|
const RULE$45 = "disabled-rule";
|
|
14750
14902
|
const CONFIG_FILE$5 = "vite.config.ts";
|
|
14751
|
-
const START$
|
|
14903
|
+
const START$25 = 0;
|
|
14752
14904
|
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
14905
|
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
14906
|
const taggedError$10 = Schema.TaggedError;
|
|
@@ -14760,7 +14912,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
|
14760
14912
|
const files = yield* RepositoryFiles;
|
|
14761
14913
|
const listed = yield* files.listedFiles(root);
|
|
14762
14914
|
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$
|
|
14915
|
+
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
14916
|
});
|
|
14765
14917
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
14766
14918
|
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
|
|
@@ -14773,14 +14925,14 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
14773
14925
|
});
|
|
14774
14926
|
const expected = yield* expectationsIn(root);
|
|
14775
14927
|
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$
|
|
14928
|
+
return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
|
|
14777
14929
|
});
|
|
14778
14930
|
/** @internal */
|
|
14779
14931
|
const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
|
|
14780
14932
|
const files = yield* RepositoryFiles;
|
|
14781
14933
|
const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
|
|
14782
14934
|
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$
|
|
14935
|
+
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
14936
|
});
|
|
14785
14937
|
// src/app/build-checks.ts
|
|
14786
14938
|
/** @internal */
|
|
@@ -14791,6 +14943,7 @@ const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
|
|
|
14791
14943
|
checkTreeShaking(root),
|
|
14792
14944
|
checkMigrationOrder(root),
|
|
14793
14945
|
checkPluginDependencies(root),
|
|
14946
|
+
checkModVendor(root),
|
|
14794
14947
|
checkDisabledRules(root)
|
|
14795
14948
|
], { concurrency: "unbounded" });
|
|
14796
14949
|
return Array$1.flatten(found);
|
|
@@ -15879,10 +16032,10 @@ const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR
|
|
|
15879
16032
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15880
16033
|
const PLUGIN_ROOT = "..";
|
|
15881
16034
|
const READ_CONCURRENCY$19 = 16;
|
|
15882
|
-
const START$
|
|
16035
|
+
const START$24 = 0;
|
|
15883
16036
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
15884
16037
|
path,
|
|
15885
|
-
index: found.index ?? START$
|
|
16038
|
+
index: found.index ?? START$24
|
|
15886
16039
|
})), Option.toArray);
|
|
15887
16040
|
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf$1));
|
|
15888
16041
|
const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
@@ -16001,7 +16154,7 @@ const FILTER_ASSIGNMENT = "--filter=";
|
|
|
16001
16154
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
16002
16155
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
16003
16156
|
const ONE$2 = 1;
|
|
16004
|
-
const START$
|
|
16157
|
+
const START$23 = 0;
|
|
16005
16158
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE$1), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
16006
16159
|
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
16160
|
const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$2), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
@@ -16059,9 +16212,9 @@ const whereOf = (scope, file) => {
|
|
|
16059
16212
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask$1(graph, task)));
|
|
16060
16213
|
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
16214
|
file: absolute(file),
|
|
16062
|
-
...positionOf(text)(match.index ?? START$
|
|
16215
|
+
...positionOf(text)(match.index ?? START$23),
|
|
16063
16216
|
rule: RULE$38,
|
|
16064
|
-
message: `${match[START$
|
|
16217
|
+
message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
16065
16218
|
})), Option.toArray)));
|
|
16066
16219
|
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
16067
16220
|
/** @internal */
|
|
@@ -16311,8 +16464,8 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array$1.flatMap
|
|
|
16311
16464
|
const commandProblems$2 = (sources) => pipe(sources, Array$1.flatMap(problemsOf));
|
|
16312
16465
|
// src/shared/lib/workflow-run.ts
|
|
16313
16466
|
const RUN_KEY = "run";
|
|
16314
|
-
const START$
|
|
16315
|
-
const startOf$1 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
16467
|
+
const START$22 = 0;
|
|
16468
|
+
const startOf$1 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$22));
|
|
16316
16469
|
const runScriptsOf = (source) => {
|
|
16317
16470
|
const found = [];
|
|
16318
16471
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -16369,7 +16522,7 @@ const AGENT_DOCS = [
|
|
|
16369
16522
|
...EXCLUDED$5
|
|
16370
16523
|
];
|
|
16371
16524
|
const READ_CONCURRENCY$17 = 16;
|
|
16372
|
-
const START$
|
|
16525
|
+
const START$21 = 0;
|
|
16373
16526
|
const FIRST$9 = 1;
|
|
16374
16527
|
const LINE = "\n";
|
|
16375
16528
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -16377,7 +16530,7 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
|
16377
16530
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
16378
16531
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
16379
16532
|
const NO_SOURCES = [];
|
|
16380
|
-
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
16533
|
+
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$21));
|
|
16381
16534
|
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
16535
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
16383
16536
|
return {
|
|
@@ -16676,7 +16829,7 @@ const commentsFrom = (reader) => (read) => (source) => Effect.try({
|
|
|
16676
16829
|
catch: unreadable(reader)
|
|
16677
16830
|
});
|
|
16678
16831
|
// src/features/ban-comments/model/config-comments.ts
|
|
16679
|
-
const NEXT$
|
|
16832
|
+
const NEXT$2 = 1;
|
|
16680
16833
|
const yamlComments = commentsFrom("yaml")(yamlSourceComments);
|
|
16681
16834
|
const tomlComments = commentsFrom("toml")(tomlSourceComments);
|
|
16682
16835
|
const isSqlComment = (value) => isRecord(value) && (value["type"] === "line_comment" || value["type"] === "block_comment") && typeof value["text"] === "string" && Array$1.isArray(value["range"]);
|
|
@@ -16692,7 +16845,7 @@ const sqlComments = commentsFrom("sql")((source) => {
|
|
|
16692
16845
|
text
|
|
16693
16846
|
})));
|
|
16694
16847
|
});
|
|
16695
|
-
const offsetAt = (lines) => ({ line, character }) => character + pipe(lines, Array$1.take(line), Array$1.map((text) => text.length + NEXT$
|
|
16848
|
+
const offsetAt = (lines) => ({ line, character }) => character + pipe(lines, Array$1.take(line), Array$1.map((text) => text.length + NEXT$2), Number$1.sumAll);
|
|
16696
16849
|
const dockerfileComments = commentsFrom("dockerfile")((source) => {
|
|
16697
16850
|
const lines = String$1.split(source, "\n");
|
|
16698
16851
|
return pipe(DockerfileParser.parse(source).getComments(), Array$1.map((comment) => ({
|
|
@@ -16718,8 +16871,8 @@ const COMMENT_NODES = [
|
|
|
16718
16871
|
"block_comment",
|
|
16719
16872
|
"multiline_comment"
|
|
16720
16873
|
];
|
|
16721
|
-
const START$
|
|
16722
|
-
const NEXT = 1;
|
|
16874
|
+
const START$20 = 0;
|
|
16875
|
+
const NEXT$1 = 1;
|
|
16723
16876
|
const NONE$3 = [];
|
|
16724
16877
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
16725
16878
|
onFailure: ({ message }) => unreadable(grammar)(message),
|
|
@@ -16764,11 +16917,11 @@ const markupComment = (source) => (node) => {
|
|
|
16764
16917
|
if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$3;
|
|
16765
16918
|
return [{
|
|
16766
16919
|
index: node.startIndex,
|
|
16767
|
-
text: String$1.slice(node.startIndex, node.endIndex + NEXT)(source)
|
|
16920
|
+
text: String$1.slice(node.startIndex, node.endIndex + NEXT$1)(source)
|
|
16768
16921
|
}];
|
|
16769
16922
|
};
|
|
16770
16923
|
const textComments = (grammars, grammar) => (text) => {
|
|
16771
|
-
const shift = shifted(text.startIndex ?? START$
|
|
16924
|
+
const shift = shifted(text.startIndex ?? START$20);
|
|
16772
16925
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
16773
16926
|
};
|
|
16774
16927
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -16853,7 +17006,7 @@ const SUPPRESSION_RULE = "suppression";
|
|
|
16853
17006
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
16854
17007
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
16855
17008
|
const READ_CONCURRENCY$16 = 64;
|
|
16856
|
-
const START$
|
|
17009
|
+
const START$19 = 0;
|
|
16857
17010
|
const SHEBANG = "#!";
|
|
16858
17011
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
16859
17012
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
@@ -16868,11 +17021,11 @@ const taggedError$7 = Schema.TaggedError;
|
|
|
16868
17021
|
var CommentConfigUnreadable = class extends taggedError$7()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
16869
17022
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
16870
17023
|
const lineBefore = (source, index) => {
|
|
16871
|
-
const lines = pipe(source, String$1.slice(START$
|
|
17024
|
+
const lines = pipe(source, String$1.slice(START$19, index), String$1.split("\n"));
|
|
16872
17025
|
return Option.getOrElse(Array$1.last(lines), () => "");
|
|
16873
17026
|
};
|
|
16874
17027
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
16875
|
-
const isShebang = ({ index, text }) => index === START$
|
|
17028
|
+
const isShebang = ({ index, text }) => index === START$19 && String$1.startsWith(SHEBANG)(text);
|
|
16876
17029
|
const isSuppression = (comment) => SUPPRESSION.test(comment.text);
|
|
16877
17030
|
const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
|
|
16878
17031
|
const NOTHING = {
|
|
@@ -16900,7 +17053,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
16900
17053
|
});
|
|
16901
17054
|
const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
|
|
16902
17055
|
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$
|
|
17056
|
+
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$19));
|
|
16904
17057
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
16905
17058
|
const files = yield* RepositoryFiles;
|
|
16906
17059
|
const file = files.join(root, CONFIG_FILE$3);
|
|
@@ -16917,7 +17070,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16917
17070
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16918
17071
|
used: usedAllowances(allowances, found)
|
|
16919
17072
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16920
|
-
problems: [problemAtIndex(RULE$32)(file, source)(START$
|
|
17073
|
+
problems: [problemAtIndex(RULE$32)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
|
|
16921
17074
|
used: []
|
|
16922
17075
|
})))
|
|
16923
17076
|
});
|
|
@@ -17104,7 +17257,7 @@ const CONFIG_FILE$2 = "vite.config.ts";
|
|
|
17104
17257
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
17105
17258
|
const ADOPTER = "@r_masseater/vite-plus-adopt";
|
|
17106
17259
|
const SOURCE_SEPARATOR = "/";
|
|
17107
|
-
const START$
|
|
17260
|
+
const START$18 = 0;
|
|
17108
17261
|
const LOCAL_PREFIX = "./";
|
|
17109
17262
|
const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
|
|
17110
17263
|
const Source = Schema.Struct({
|
|
@@ -17117,7 +17270,7 @@ const taggedError$6 = Schema.TaggedError;
|
|
|
17117
17270
|
var SkillsConfigUnreadable = class extends taggedError$6()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
17118
17271
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
17119
17272
|
file,
|
|
17120
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
17273
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$18))),
|
|
17121
17274
|
rule,
|
|
17122
17275
|
message
|
|
17123
17276
|
});
|
|
@@ -17233,7 +17386,7 @@ const GITHUB$3 = "https://github.com/";
|
|
|
17233
17386
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
17234
17387
|
const BLANK = /\s+/u;
|
|
17235
17388
|
const SEPARATOR$10 = "/";
|
|
17236
|
-
const START$
|
|
17389
|
+
const START$17 = 0;
|
|
17237
17390
|
const FIRST$7 = 1;
|
|
17238
17391
|
const READ_CONCURRENCY$15 = 16;
|
|
17239
17392
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -17243,9 +17396,9 @@ const Frontmatter = Schema.Struct({
|
|
|
17243
17396
|
metadata: Schema.optional(Metadata)
|
|
17244
17397
|
});
|
|
17245
17398
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
17246
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$
|
|
17399
|
+
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$17));
|
|
17247
17400
|
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$
|
|
17401
|
+
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$17].length), Option.getOrElse(() => START$17));
|
|
17249
17402
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
17250
17403
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
17251
17404
|
const bodyStart = bodyStartOf(source);
|
|
@@ -17278,11 +17431,11 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
17278
17431
|
})));
|
|
17279
17432
|
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
17433
|
target,
|
|
17281
|
-
index: found.index ?? START$
|
|
17434
|
+
index: found.index ?? START$17
|
|
17282
17435
|
})), Option.toArray);
|
|
17283
17436
|
const rangeOf$2 = (found) => {
|
|
17284
|
-
const start = found.index ?? START$
|
|
17285
|
-
return [start, start + found[START$
|
|
17437
|
+
const start = found.index ?? START$17;
|
|
17438
|
+
return [start, start + found[START$17].length];
|
|
17286
17439
|
};
|
|
17287
17440
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
|
|
17288
17441
|
const linksIn$1 = (source) => {
|
|
@@ -17449,7 +17602,7 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
|
|
|
17449
17602
|
const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
17450
17603
|
const CAP_RULE = "renovate-version-cap";
|
|
17451
17604
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17452
|
-
const START$
|
|
17605
|
+
const START$16 = 0;
|
|
17453
17606
|
const READ_CONCURRENCY$13 = 16;
|
|
17454
17607
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17455
17608
|
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 +17621,7 @@ const problemsIn$8 = (file, source) => {
|
|
|
17468
17621
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
17469
17622
|
...pipe([{
|
|
17470
17623
|
file,
|
|
17471
|
-
...at(START$
|
|
17624
|
+
...at(START$16),
|
|
17472
17625
|
rule: PRESET_RULE,
|
|
17473
17626
|
message: PRESET_MESSAGE
|
|
17474
17627
|
}], Array$1.filter(() => !String$1.includes(`"${RENOVATE_PRESET}"`)(source)))
|
|
@@ -17588,7 +17741,7 @@ const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
|
17588
17741
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17589
17742
|
const RULE$25 = "applied-package";
|
|
17590
17743
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17591
|
-
const NOT_FOUND$
|
|
17744
|
+
const NOT_FOUND$4 = -1;
|
|
17592
17745
|
const SEPARATOR$9 = "/";
|
|
17593
17746
|
/** @internal */
|
|
17594
17747
|
const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
|
|
@@ -17627,7 +17780,7 @@ const problemAt$1 = (file, source) => (index, name) => ({
|
|
|
17627
17780
|
});
|
|
17628
17781
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
17629
17782
|
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$
|
|
17783
|
+
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
17784
|
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$9}`)(name)), Array$1.match({
|
|
17632
17785
|
onEmpty: () => "",
|
|
17633
17786
|
onNonEmpty: Array$1.max(BY_LENGTH)
|
|
@@ -17792,7 +17945,7 @@ const SETUP_PATTERNS = [
|
|
|
17792
17945
|
];
|
|
17793
17946
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
17794
17947
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
17795
|
-
const START$
|
|
17948
|
+
const START$15 = 0;
|
|
17796
17949
|
const LAST_SEGMENT = 1;
|
|
17797
17950
|
const FIRST_LINE$2 = 1;
|
|
17798
17951
|
const FIRST_COLUMN$3 = 1;
|
|
@@ -17861,7 +18014,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
17861
18014
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
17862
18015
|
return directoriesOf(roots);
|
|
17863
18016
|
});
|
|
17864
|
-
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$
|
|
18017
|
+
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$15), (end) => String$1.slice(START$15, end)(name));
|
|
17865
18018
|
const pnpmOutputs = (present) => pipe(present, Array$1.filter(isPnpmOutput), Array$1.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array$1.map(pnpmOutput));
|
|
17866
18019
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
17867
18020
|
const cargoProblems = (present, enabled) => {
|
|
@@ -17898,7 +18051,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
17898
18051
|
});
|
|
17899
18052
|
// src/features/check-markdown-directives/model/directives.ts
|
|
17900
18053
|
const RULE$23 = "markdown-directive";
|
|
17901
|
-
const START$
|
|
18054
|
+
const START$14 = 0;
|
|
17902
18055
|
const SECOND = 1;
|
|
17903
18056
|
const ODD = 1;
|
|
17904
18057
|
const PAIR = 2;
|
|
@@ -17920,9 +18073,9 @@ const problemsIn$7 = (file, source) => {
|
|
|
17920
18073
|
const fenced = Array$1.mapAccum(lines, false, fenceStep)[SECOND];
|
|
17921
18074
|
const isCode = (index) => {
|
|
17922
18075
|
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$
|
|
18076
|
+
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
18077
|
};
|
|
17925
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$
|
|
18078
|
+
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
18079
|
};
|
|
17927
18080
|
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
18081
|
/** @internal */
|
|
@@ -17945,7 +18098,7 @@ const RULE$22 = "owner-decision-removed";
|
|
|
17945
18098
|
const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
|
|
17946
18099
|
const TRAILER$1 = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
|
|
17947
18100
|
const READ_CONCURRENCY$10 = 16;
|
|
17948
|
-
const HEAD = "HEAD";
|
|
18101
|
+
const HEAD$1 = "HEAD";
|
|
17949
18102
|
const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
|
|
17950
18103
|
const countOf = (markers) => (marker) => pipe(markers, Array$1.filter((candidate) => candidate === marker)).length;
|
|
17951
18104
|
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 +18112,7 @@ const removalsSince = Effect.fn("removalsSince")(function* removalsSince(root, b
|
|
|
17959
18112
|
const changed = yield* files.changedFiles(root, base);
|
|
17960
18113
|
const found = yield* Effect.forEach(changed, (name) => Effect.gen(function* compare() {
|
|
17961
18114
|
const before = yield* files.readAtRevision(root, base, name);
|
|
17962
|
-
const after = yield* files.readAtRevision(root, HEAD, name);
|
|
18115
|
+
const after = yield* files.readAtRevision(root, HEAD$1, name);
|
|
17963
18116
|
const lost = lostMarkers(Option.match(before, {
|
|
17964
18117
|
onNone: () => [],
|
|
17965
18118
|
onSome: markersOf
|
|
@@ -17984,7 +18137,7 @@ const RULE$21 = "owner-name";
|
|
|
17984
18137
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17985
18138
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17986
18139
|
const SEPARATOR$7 = "/";
|
|
17987
|
-
const START$
|
|
18140
|
+
const START$13 = 0;
|
|
17988
18141
|
const DECLARED = [
|
|
17989
18142
|
"dependencies",
|
|
17990
18143
|
"devDependencies",
|
|
@@ -18021,7 +18174,7 @@ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
|
|
|
18021
18174
|
source: describedText(manifest)
|
|
18022
18175
|
}), Array$1.head, Option.toArray, Array$1.map(() => ({
|
|
18023
18176
|
file,
|
|
18024
|
-
...positionOf("")(START$
|
|
18177
|
+
...positionOf("")(START$13),
|
|
18025
18178
|
rule: RULE$21,
|
|
18026
18179
|
message: `Its description or keywords ${messageFor$4(owner)}`
|
|
18027
18180
|
})));
|
|
@@ -18087,17 +18240,17 @@ const checkOwnerPrinciples = Effect.fn("checkOwnerPrinciples")(function* checkOw
|
|
|
18087
18240
|
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
18088
18241
|
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
18242
|
const NUL = "\0";
|
|
18090
|
-
const START$
|
|
18243
|
+
const START$12 = 0;
|
|
18091
18244
|
const HEX = 16;
|
|
18092
18245
|
const CODE_POINT_WIDTH = 4;
|
|
18093
18246
|
const READ_CONCURRENCY$9 = 64;
|
|
18094
18247
|
const RULE$19 = "hidden-unicode";
|
|
18095
|
-
const hexOf = (character) => pipe(String$1.codePointAt(START$
|
|
18248
|
+
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
18249
|
const problemOf$3 = (file, source) => (found) => {
|
|
18097
|
-
const hex = hexOf(found[START$
|
|
18250
|
+
const hex = hexOf(found[START$12]);
|
|
18098
18251
|
return {
|
|
18099
18252
|
file,
|
|
18100
|
-
...positionOf(source)(found.index ?? START$
|
|
18253
|
+
...positionOf(source)(found.index ?? START$12),
|
|
18101
18254
|
rule: RULE$19,
|
|
18102
18255
|
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
18256
|
};
|
|
@@ -18136,7 +18289,7 @@ const RULE$18 = "effect-diagnostics-once";
|
|
|
18136
18289
|
const PLUGIN = "@effect/language-service";
|
|
18137
18290
|
const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
|
|
18138
18291
|
const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18139
|
-
const START$
|
|
18292
|
+
const START$11 = 0;
|
|
18140
18293
|
const Plugin = Schema.Struct({
|
|
18141
18294
|
name: Schema.optional(Schema.String),
|
|
18142
18295
|
diagnostics: Schema.optional(Schema.Unknown)
|
|
@@ -18149,7 +18302,7 @@ const MESSAGE$2 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics durin
|
|
|
18149
18302
|
const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
|
|
18150
18303
|
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
18304
|
file: entry.file,
|
|
18152
|
-
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$
|
|
18305
|
+
...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$11))),
|
|
18153
18306
|
rule: RULE$18,
|
|
18154
18307
|
message: MESSAGE$2
|
|
18155
18308
|
})), Option.toArray);
|
|
@@ -18211,7 +18364,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
|
|
|
18211
18364
|
const RULE$16 = "pack-publint";
|
|
18212
18365
|
const CONFIG_FILE = "vite.config.ts";
|
|
18213
18366
|
const PACK_KEY = "pack:";
|
|
18214
|
-
const START$
|
|
18367
|
+
const START$10 = 0;
|
|
18215
18368
|
const READ_CONCURRENCY$8 = 16;
|
|
18216
18369
|
const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18217
18370
|
const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
|
|
@@ -18223,7 +18376,7 @@ var PackConfigUnreadable = class extends taggedError$5()("PackConfigUnreadable",
|
|
|
18223
18376
|
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
18377
|
const problemFor = (file, source) => ({
|
|
18225
18378
|
file,
|
|
18226
|
-
...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$
|
|
18379
|
+
...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$10)),
|
|
18227
18380
|
rule: RULE$16,
|
|
18228
18381
|
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
18382
|
});
|
|
@@ -18255,14 +18408,14 @@ const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSett
|
|
|
18255
18408
|
});
|
|
18256
18409
|
// src/features/check-published-manifest/model/private-dependency.ts
|
|
18257
18410
|
const RULE$15 = "private-workspace-dependency";
|
|
18258
|
-
const START$
|
|
18411
|
+
const START$9 = 0;
|
|
18259
18412
|
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
18413
|
section,
|
|
18261
18414
|
name
|
|
18262
18415
|
})))));
|
|
18263
18416
|
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
18417
|
/** @internal */
|
|
18265
|
-
const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$
|
|
18418
|
+
const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$9));
|
|
18266
18419
|
/** @internal */
|
|
18267
18420
|
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
18421
|
// src/features/check-published-manifest/model/dependency-peer-floor.ts
|
|
@@ -18335,7 +18488,7 @@ const dependencyPeerFloorProblems = (installed) => (found) => {
|
|
|
18335
18488
|
const RULE$13 = "package-homepage";
|
|
18336
18489
|
const BRANCH = "main";
|
|
18337
18490
|
const ROOT_DIRECTORY$1 = ".";
|
|
18338
|
-
const START$
|
|
18491
|
+
const START$8 = 0;
|
|
18339
18492
|
const KEYS = [
|
|
18340
18493
|
"\"homepage\"",
|
|
18341
18494
|
"\"repository\"",
|
|
@@ -18361,20 +18514,20 @@ const messagesOf = (manifest, directory) => pipe(decodeRepository$1(manifest.rep
|
|
|
18361
18514
|
onNone: () => [repositoryMissing(directory)],
|
|
18362
18515
|
onSome: repositoryMessages(manifest, directory)
|
|
18363
18516
|
}));
|
|
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$
|
|
18517
|
+
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
18518
|
/** @internal */
|
|
18366
18519
|
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
18520
|
// src/features/check-published-manifest/model/package-scope.ts
|
|
18368
18521
|
const RULE$12 = "package-scope";
|
|
18369
18522
|
const NAME_KEY = "\"name\"";
|
|
18370
|
-
const START$
|
|
18523
|
+
const START$7 = 0;
|
|
18371
18524
|
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$
|
|
18525
|
+
const nameIndex = (source) => pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$7));
|
|
18373
18526
|
const BY_COUNT = Order.mapInput(Order.Number, ([, names]) => names.length);
|
|
18374
18527
|
/** @internal */
|
|
18375
18528
|
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
18529
|
onEmpty: () => Option.none(),
|
|
18377
|
-
onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$
|
|
18530
|
+
onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$7])
|
|
18378
18531
|
}));
|
|
18379
18532
|
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
18533
|
/** @internal */
|
|
@@ -18425,7 +18578,7 @@ const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t
|
|
|
18425
18578
|
const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
|
|
18426
18579
|
const ALTERNATIVE$1 = "||";
|
|
18427
18580
|
const ENGINES_KEY = "\"engines\"";
|
|
18428
|
-
const START$
|
|
18581
|
+
const START$6 = 0;
|
|
18429
18582
|
const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18430
18583
|
const majorOf = (found) => pipe(groupOf("major")(found), Option.map(Number));
|
|
18431
18584
|
const isOld = (major) => major < MINIMUM;
|
|
@@ -18436,11 +18589,11 @@ const floorIsOld = (alternative) => pipe(floorOf$1(alternative), Option.match({
|
|
|
18436
18589
|
}));
|
|
18437
18590
|
const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE$1), Array$1.some(floorIsOld));
|
|
18438
18591
|
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$
|
|
18592
|
+
const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$6));
|
|
18440
18593
|
const unstatedProblem = (entry, source) => problemAt({
|
|
18441
18594
|
entry,
|
|
18442
18595
|
source,
|
|
18443
|
-
index: START$
|
|
18596
|
+
index: START$6
|
|
18444
18597
|
}, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
|
|
18445
18598
|
const rangeProblem = (entry, source) => (range) => problemAt({
|
|
18446
18599
|
entry,
|
|
@@ -18459,12 +18612,12 @@ const manifestProblems$1 = (entry, source) => {
|
|
|
18459
18612
|
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
18613
|
entry,
|
|
18461
18614
|
source,
|
|
18462
|
-
index: found.index ?? START$
|
|
18463
|
-
}, `${SUPPORTED} \`${String$1.trim(found[START$
|
|
18615
|
+
index: found.index ?? START$6
|
|
18616
|
+
}, `${SUPPORTED} \`${String$1.trim(found[START$6])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
|
|
18464
18617
|
const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
|
|
18465
18618
|
entry,
|
|
18466
18619
|
source,
|
|
18467
|
-
index: START$
|
|
18620
|
+
index: START$6
|
|
18468
18621
|
}, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
|
|
18469
18622
|
const problemsIn$3 = (entry, source) => {
|
|
18470
18623
|
if (MANIFEST$1.test(entry.name)) return manifestProblems$1(entry, source);
|
|
@@ -18512,12 +18665,12 @@ const LONGEST_PATH = 472;
|
|
|
18512
18665
|
const MOST_DEPTH = 12;
|
|
18513
18666
|
const LONGEST_PART = 255;
|
|
18514
18667
|
const LONGEST_DESCRIPTION = 500;
|
|
18515
|
-
const CONCURRENCY$
|
|
18668
|
+
const CONCURRENCY$4 = 16;
|
|
18516
18669
|
const PLUGIN_NAME = /^[\p{Ll}\p{Nd}-]{1,64}$/u;
|
|
18517
18670
|
const ALLOWED_PATH = /^[A-Za-z0-9 _.\-/(),]+$/u;
|
|
18518
18671
|
const XML_TAG = /<[A-Za-z][^>]*>/u;
|
|
18519
18672
|
const ARCHIVE = ".zip";
|
|
18520
|
-
const SINGLE = 1;
|
|
18673
|
+
const SINGLE$2 = 1;
|
|
18521
18674
|
const SkillFields$1 = Schema.Struct({
|
|
18522
18675
|
name: Schema.optionalKey(Schema.String),
|
|
18523
18676
|
description: Schema.optionalKey(Schema.String)
|
|
@@ -18581,13 +18734,13 @@ const skillViolations = (skills) => {
|
|
|
18581
18734
|
Option.liftPredicate("has no name.", () => String$1.isEmpty(name)),
|
|
18582
18735
|
Option.liftPredicate("has no description.", () => String$1.isEmpty(description)),
|
|
18583
18736
|
Option.liftPredicate("has an XML tag in its name or description.", () => XML_TAG.test(`${name}\n${description}`)),
|
|
18584
|
-
Option.liftPredicate(`shares the name ${name} with another SKILL.md of the plugin.`, () => pipe(Record.get(counts, name), Option.exists((group) => group.length > SINGLE)))
|
|
18737
|
+
Option.liftPredicate(`shares the name ${name} with another SKILL.md of the plugin.`, () => pipe(Record.get(counts, name), Option.exists((group) => group.length > SINGLE$2)))
|
|
18585
18738
|
], Array$1.getSomes, Array$1.map((message) => violation(file, message)))));
|
|
18586
18739
|
};
|
|
18587
18740
|
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
|
|
18588
18741
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18589
18742
|
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
|
|
18590
|
-
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$
|
|
18743
|
+
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$4 });
|
|
18591
18744
|
return [
|
|
18592
18745
|
...manifestViolations(plugin),
|
|
18593
18746
|
...nestedManifests(plugin),
|
|
@@ -18611,7 +18764,7 @@ const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLa
|
|
|
18611
18764
|
const plugins = yield* pluginsIn$1(root);
|
|
18612
18765
|
const linked = yield* files.linkedFiles(root);
|
|
18613
18766
|
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$
|
|
18767
|
+
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
18768
|
const marketplace = yield* rootProblems(root);
|
|
18616
18769
|
return [...Array$1.flatten(found), ...marketplace];
|
|
18617
18770
|
});
|
|
@@ -18722,7 +18875,7 @@ const README_FILE = "README.md";
|
|
|
18722
18875
|
const FIRST_SENTENCE = /^[\s\S]*?(?:。|\.(?=\s|$))/u;
|
|
18723
18876
|
const CALLED_SKILL$1 = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/u;
|
|
18724
18877
|
const EMPTY$1 = "";
|
|
18725
|
-
const START$
|
|
18878
|
+
const START$5 = 0;
|
|
18726
18879
|
const DIVIDER = "| --- | --- | --- |";
|
|
18727
18880
|
const CELL_BORDER = /(?<!\\)\|/u;
|
|
18728
18881
|
const DIVIDER_CELL = /^:?-+:?$/u;
|
|
@@ -18776,7 +18929,7 @@ const withSkillsTable = ({ readme, table, heading }) => {
|
|
|
18776
18929
|
const end = String$1.indexOf(SKILLS_END)(readme);
|
|
18777
18930
|
return pipe(Option.all([start, end]), Option.filter(([from, to]) => to > from), Option.match({
|
|
18778
18931
|
onNone: () => `${String$1.trimEnd(readme)}\n\n${heading}\n\n${block}\n`,
|
|
18779
|
-
onSome: ([from, to]) => `${String$1.slice(START$
|
|
18932
|
+
onSome: ([from, to]) => `${String$1.slice(START$5, from)(readme)}${block}${String$1.slice(to + 26)(readme)}`
|
|
18780
18933
|
}));
|
|
18781
18934
|
};
|
|
18782
18935
|
const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, skills }, labels) {
|
|
@@ -18876,7 +19029,7 @@ const enumerationSignals = (entities) => (file, text) => {
|
|
|
18876
19029
|
// src/features/check-skill-enumerations/model/skill-enumerations.ts
|
|
18877
19030
|
const RULE$6 = "skill-enumeration";
|
|
18878
19031
|
const FIRST$3 = 1;
|
|
18879
|
-
const CONCURRENCY$
|
|
19032
|
+
const CONCURRENCY$3 = 16;
|
|
18880
19033
|
const DOCUMENT_FILE = /\.(?:md|ts|tsx)$/u;
|
|
18881
19034
|
const position = problemAtPosition(RULE$6);
|
|
18882
19035
|
const problemsIn$2 = Effect.fn("problemsIn")(function* problemsIn(root, name, entities) {
|
|
@@ -18896,14 +19049,14 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
|
|
|
18896
19049
|
if (!Array$1.isReadonlyArrayNonEmpty(entities)) return [];
|
|
18897
19050
|
const listed = yield* files.listedFiles(root);
|
|
18898
19051
|
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$
|
|
19052
|
+
const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$3 });
|
|
18900
19053
|
return Array$1.flatten(found);
|
|
18901
19054
|
});
|
|
18902
19055
|
// src/features/check-skill-references/model/skill-references.ts
|
|
18903
19056
|
const RULE$5 = "skill-reference";
|
|
18904
19057
|
const OWNER_PREFIX = "do-";
|
|
18905
19058
|
const MARKDOWN$2 = ".md";
|
|
18906
|
-
const CONCURRENCY$
|
|
19059
|
+
const CONCURRENCY$2 = 16;
|
|
18907
19060
|
const MOST_OWNER_LINES = 4;
|
|
18908
19061
|
const NAMED_IN_BACKTICKS = /`(?<name>[a-z0-9]+(?:-[a-z0-9]+)*)`(?!\]\()/gu;
|
|
18909
19062
|
const CALLED_SKILL = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/gu;
|
|
@@ -18944,12 +19097,12 @@ const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, sk
|
|
|
18944
19097
|
const found = yield* Effect.forEach(documents, (file) => documentProblems({
|
|
18945
19098
|
file,
|
|
18946
19099
|
hub
|
|
18947
|
-
}, skill, others), { concurrency: CONCURRENCY$
|
|
19100
|
+
}, skill, others), { concurrency: CONCURRENCY$2 });
|
|
18948
19101
|
return Array$1.flatten(found);
|
|
18949
19102
|
});
|
|
18950
19103
|
const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
|
|
18951
19104
|
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$
|
|
19105
|
+
const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$2 });
|
|
18953
19106
|
const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
|
|
18954
19107
|
return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
|
|
18955
19108
|
});
|
|
@@ -18968,7 +19121,7 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
|
|
|
18968
19121
|
});
|
|
18969
19122
|
// src/features/check-skill-structure/model/skill-structure.ts
|
|
18970
19123
|
const RULE$4 = "skill-maintainer-context";
|
|
18971
|
-
const CONCURRENCY = 16;
|
|
19124
|
+
const CONCURRENCY$1 = 16;
|
|
18972
19125
|
const MARKDOWN$1 = ".md";
|
|
18973
19126
|
const PROJECT_FILE = /(?:^|\/)(?:package\.json|tsconfig[^/]*\.json|vite\.config\.[cm]?[jt]s|vitest\.config\.[cm]?[jt]s)$|\.[jt]sx$/u;
|
|
18974
19127
|
const SCRIPT_FILE = /\.[cm]?[jt]s$/u;
|
|
@@ -18993,7 +19146,7 @@ const problemsIn$1 = Effect.fn("problemsIn")(function* problemsIn(file) {
|
|
|
18993
19146
|
const checkSkillStructure = Effect.fn("checkSkillStructure")(function* checkSkillStructure(root) {
|
|
18994
19147
|
const plugins = yield* pluginsIn$1(root);
|
|
18995
19148
|
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 });
|
|
19149
|
+
const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$1 });
|
|
18997
19150
|
return Array$1.flatten(found);
|
|
18998
19151
|
});
|
|
18999
19152
|
// src/app/plugin-checks.ts
|
|
@@ -19116,8 +19269,8 @@ const ALTERNATIVE = " || ";
|
|
|
19116
19269
|
const UNUSED = "unused";
|
|
19117
19270
|
const ANY_RANGE = "*";
|
|
19118
19271
|
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$
|
|
19272
|
+
const PACKAGE$2 = String.raw`(?:@[^\s/@]+\/)?[^\s@]+`;
|
|
19273
|
+
const REGISTRY_CONDITION = new RegExp(String.raw`^(?<registry>npm|crate):(?<name>${PACKAGE$2})(?:@(?<range>.+)| (?<relation>drops|allows|requires) (?<dependency>${PACKAGE$2})(?:@(?<dependencyRange>.+))?)$`, "u");
|
|
19121
19274
|
const GITHUB_CONDITION = /^github:(?<owner>[\w.-]+)\/(?<repo>[\w.-]+)#(?<number>[1-9]\d*)$/u;
|
|
19122
19275
|
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
19276
|
const isRegistry$1 = (value) => value === "npm" || value === "crate";
|
|
@@ -19253,7 +19406,7 @@ const DECLARING_SECTIONS = [
|
|
|
19253
19406
|
const Dependencies = Schema.Record(Schema.String, Schema.String);
|
|
19254
19407
|
const NpmVersion = Schema.Record(Schema.String, Schema.Unknown);
|
|
19255
19408
|
const decodeDependencies = Schema.decodeUnknownOption(Dependencies);
|
|
19256
|
-
const NOT_FOUND$
|
|
19409
|
+
const NOT_FOUND$3 = 404;
|
|
19257
19410
|
const NOT_PUBLISHED = {
|
|
19258
19411
|
versions: [],
|
|
19259
19412
|
latestDependencies: {}
|
|
@@ -19282,7 +19435,7 @@ const releaseOfPackument = ({ "dist-tags": tags, versions }) => ({
|
|
|
19282
19435
|
latestDependencies: pipe(Record.get(versions, tags.latest), Option.map(declaredBy), Option.getOrElse(() => ({})))
|
|
19283
19436
|
});
|
|
19284
19437
|
const npmRelease = (name) => sent(packageLookup(name)).pipe(Effect.flatMap((response) => {
|
|
19285
|
-
if (response.status === NOT_FOUND$
|
|
19438
|
+
if (response.status === NOT_FOUND$3) return Effect.succeed(NOT_PUBLISHED);
|
|
19286
19439
|
return HttpClientResponse.filterStatusOk(response).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(NpmPackument)), Effect.map(releaseOfPackument));
|
|
19287
19440
|
}));
|
|
19288
19441
|
const crateRelease = Effect.fn("crateRelease")(function* lookupCrate(name) {
|
|
@@ -19431,10 +19584,10 @@ const NESTED_WORKSPACE = "/pnpm-workspace.yaml";
|
|
|
19431
19584
|
const NESTED_CARGO = "/Cargo.toml";
|
|
19432
19585
|
const CARGO_CONFIG = /(?:^|\/)\.cargo\/config(?:\.toml)?$/u;
|
|
19433
19586
|
const MANAGER_FIELDS = ["overrides", "resolutions"];
|
|
19434
|
-
const START$
|
|
19587
|
+
const START$4 = 0;
|
|
19435
19588
|
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
19589
|
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$
|
|
19590
|
+
const keyIndex = (source, key) => Option.getOrElse(String$1.indexOf(`"${key}"`)(source), () => START$4);
|
|
19438
19591
|
const fieldsIn = (source) => pipe(decodePackageJson(source), Option.match({
|
|
19439
19592
|
onNone: () => [],
|
|
19440
19593
|
onSome: (manifest) => {
|
|
@@ -19464,8 +19617,8 @@ const checkScatteredDeviations = Effect.fn("checkScatteredDeviations")(function*
|
|
|
19464
19617
|
return yield* scanText(pipe(listed, Array$1.filter(isScanned)), problemsIn);
|
|
19465
19618
|
});
|
|
19466
19619
|
// 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");
|
|
19620
|
+
const PACKAGE$1 = String.raw`(?:@[^\s/@]+\/)?[^\s/@]+`;
|
|
19621
|
+
const SOURCE$1 = new RegExp(String.raw`^(?:(?<registry>npm|crate):(?<name>${PACKAGE$1})|github:(?<owner>[\w.-]+)\/(?<repo>[\w.-]+))$`, "u");
|
|
19469
19622
|
/** @internal */
|
|
19470
19623
|
const SOURCE_GRAMMAR = "`npm:<package>`, `crate:<crate>` or `github:<owner>/<repo>`";
|
|
19471
19624
|
const isRegistry = (value) => value === "npm" || value === "crate";
|
|
@@ -19507,8 +19660,8 @@ const Entry = Schema.Struct({
|
|
|
19507
19660
|
verdict: Schema.Literals(VERDICTS$3),
|
|
19508
19661
|
reason: Schema.String.check(Schema.isNonEmpty())
|
|
19509
19662
|
});
|
|
19510
|
-
const Manifest = Schema.Struct({ upstream: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
19511
|
-
const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
|
|
19663
|
+
const Manifest$1 = Schema.Struct({ upstream: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) });
|
|
19664
|
+
const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
|
|
19512
19665
|
const decodeEntry = Schema.decodeUnknownOption(Entry);
|
|
19513
19666
|
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
19667
|
const SHAPE = `Write \`"<source>": { "reviewed": "<version>", "verdict": ${pipe(VERDICTS$3, Array$1.map((verdict) => `"${verdict}"`), Array$1.join(" | "))}, "reason": "<why>" }\``;
|
|
@@ -19544,7 +19697,7 @@ const foundFrom = (place, value) => {
|
|
|
19544
19697
|
problem: Option.none()
|
|
19545
19698
|
};
|
|
19546
19699
|
};
|
|
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({
|
|
19700
|
+
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
19701
|
file,
|
|
19549
19702
|
source,
|
|
19550
19703
|
key
|
|
@@ -19719,7 +19872,7 @@ const COMMAND_RULE = "uncalled-command";
|
|
|
19719
19872
|
const FLAG_RULE = "uncalled-flag";
|
|
19720
19873
|
const READ_CONCURRENCY$6 = 64;
|
|
19721
19874
|
const SEPARATOR$3 = "/";
|
|
19722
|
-
const START$
|
|
19875
|
+
const START$3 = 0;
|
|
19723
19876
|
const NAME_GROUP = "name";
|
|
19724
19877
|
const SOURCE = /\.[cm]?tsx?$/u;
|
|
19725
19878
|
const DECLARED_COMMAND = /\bCommand\.make\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
@@ -19744,11 +19897,11 @@ const workspaceOf$1 = Effect.fn("workspaceOf")(function* workspaceOf(root, direc
|
|
|
19744
19897
|
});
|
|
19745
19898
|
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
19899
|
name,
|
|
19747
|
-
index: found.index ?? START$
|
|
19900
|
+
index: found.index ?? START$3,
|
|
19748
19901
|
source
|
|
19749
19902
|
})), Option.toArray)));
|
|
19750
19903
|
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$
|
|
19904
|
+
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
19905
|
const elsewhere = (corpus) => ({ source }) => pipe(corpus, Array$1.filter((text) => text.file !== source.file && !isTest(text)));
|
|
19753
19906
|
const passesFlag = (declared) => {
|
|
19754
19907
|
const passed = new RegExp(`--${declared.name}(?![\\w-])`, "u");
|
|
@@ -19814,7 +19967,7 @@ const RULE = "unused-workspace";
|
|
|
19814
19967
|
const CARGO_FILE = "Cargo.toml";
|
|
19815
19968
|
const ROOT_DIRECTORY = "";
|
|
19816
19969
|
const TASK_SEPARATOR = "#";
|
|
19817
|
-
const START$
|
|
19970
|
+
const START$2 = 0;
|
|
19818
19971
|
const FIRST$1 = 1;
|
|
19819
19972
|
const READ_CONCURRENCY$5 = 8;
|
|
19820
19973
|
const LIBRARY_KINDS = [
|
|
@@ -19853,7 +20006,7 @@ const cargoFacts = Effect.fn("cargoFacts")(function* cargoFacts(root, directorie
|
|
|
19853
20006
|
links: pipe(crates, Array$1.flatMap(({ manifest, pathDependencies }) => linksOf(manifest, pathDependencies)))
|
|
19854
20007
|
};
|
|
19855
20008
|
});
|
|
19856
|
-
const workspaceOfTask = (text) => pipe(String$1.indexOf(TASK_SEPARATOR)(text), Option.map((at) => String$1.slice(START$
|
|
20009
|
+
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
20010
|
const taskTargets = Effect.fn("taskTargets")(function* taskTargets(root, directory) {
|
|
19858
20011
|
const config = yield* workspaceConfigOf(root, directory);
|
|
19859
20012
|
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 +20149,11 @@ const runCli = (name) => (program) => {
|
|
|
19996
20149
|
};
|
|
19997
20150
|
// src/shared/lib/quote-line.ts
|
|
19998
20151
|
const LINE_BREAK$2 = "\n";
|
|
19999
|
-
const START = 0;
|
|
20152
|
+
const START$1 = 0;
|
|
20000
20153
|
/** @internal */
|
|
20001
20154
|
const lineOfQuote = ({ text, quote }) => {
|
|
20002
20155
|
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));
|
|
20156
|
+
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
20157
|
};
|
|
20005
20158
|
// src/features/check-with-agents/model/answers.ts
|
|
20006
20159
|
const HypothesisSchema = Schema.Struct({
|
|
@@ -21379,7 +21532,10 @@ const nativeFields = (native) => {
|
|
|
21379
21532
|
const nativeReadme = ({ name, target }) => `# ${name}-${target}\n\nThe prebuilt ${target} native addon of [${name}](https://www.npmjs.com/package/${name}). Install ${name} instead; npm picks this package for your platform.\n`;
|
|
21380
21533
|
// src/features/publish-workspace/model/native-package.ts
|
|
21381
21534
|
const NPM_DIR = "npm";
|
|
21382
|
-
|
|
21535
|
+
/** @internal */
|
|
21536
|
+
const BUILT_DIR = "native";
|
|
21537
|
+
/** @internal */
|
|
21538
|
+
const RELEASE_DIR = "native/release";
|
|
21383
21539
|
const KEPT_FIELDS = [
|
|
21384
21540
|
"license",
|
|
21385
21541
|
"repository",
|
|
@@ -21392,14 +21548,14 @@ const keptFields = Effect.fn("keptFields")(function* keptFields(directory) {
|
|
|
21392
21548
|
return pipe(fields, Record.filter((_value, key) => Array$1.contains(KEPT_FIELDS, key)));
|
|
21393
21549
|
});
|
|
21394
21550
|
/** @internal */
|
|
21395
|
-
const writeNative = Effect.fn("publish.writeNative")(function* writeNative(directory, native) {
|
|
21551
|
+
const writeNative = Effect.fn("publish.writeNative")(function* writeNative(directory, native, builtIn) {
|
|
21396
21552
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
21397
21553
|
const path = yield* Path.Path;
|
|
21398
21554
|
const kept = yield* keptFields(directory);
|
|
21399
21555
|
const target = path.resolve(directory, NPM_DIR, native.target);
|
|
21400
21556
|
const file = nativeFileOf(native);
|
|
21401
21557
|
yield* fileSystem.makeDirectory(target, { recursive: true });
|
|
21402
|
-
yield* fileSystem.copyFile(path.join(directory,
|
|
21558
|
+
yield* fileSystem.copyFile(path.join(directory, builtIn, file), path.join(target, file));
|
|
21403
21559
|
yield* Effect.all([writePackageJson(target, {
|
|
21404
21560
|
...kept,
|
|
21405
21561
|
...nativeFields(native)
|
|
@@ -21471,12 +21627,17 @@ const builtOf$1 = (directory, manifest) => pipe(Option.fromUndefinedOr(manifest.
|
|
|
21471
21627
|
target
|
|
21472
21628
|
})))));
|
|
21473
21629
|
const packedNative = Effect.fn("compat.packedNative")(function* packedNative({ directory, manifest, binary, target }) {
|
|
21630
|
+
yield* mustSucceed({
|
|
21631
|
+
command: "vp",
|
|
21632
|
+
args: ["run", "native"],
|
|
21633
|
+
cwd: directory
|
|
21634
|
+
});
|
|
21474
21635
|
const written = yield* writeNative(directory, {
|
|
21475
21636
|
name: manifest.name,
|
|
21476
21637
|
version: manifest.version,
|
|
21477
21638
|
binary,
|
|
21478
21639
|
target
|
|
21479
|
-
});
|
|
21640
|
+
}, BUILT_DIR);
|
|
21480
21641
|
const tarball = yield* pack(written);
|
|
21481
21642
|
return [[`${manifest.name}-${target}`, tarball]];
|
|
21482
21643
|
});
|
|
@@ -21545,6 +21706,7 @@ const meetsPeer = (peers) => ({ name, version }) => Option.match(Record.get(peer
|
|
|
21545
21706
|
const tarballsFor = (peers) => (local) => pipe(local, Array$1.filter(meetsPeer(peers)), Array$1.flatMap(({ tarballs }) => Record.toEntries(tarballs)), Record.fromEntries);
|
|
21546
21707
|
// src/features/publish-workspace/model/compat.ts
|
|
21547
21708
|
const INSTALL_FLAGS = ["--no-audit", "--no-fund"];
|
|
21709
|
+
const SINGLE$1 = 1;
|
|
21548
21710
|
const IMPORT_ONLY = "await import(process.argv[1])";
|
|
21549
21711
|
const Versions$1 = Schema.String.pipe(Schema.Array, Schema.fromJsonString);
|
|
21550
21712
|
const installedNode = Effect.fn("compat.node")(function* installedNode(directory, range) {
|
|
@@ -21672,21 +21834,26 @@ const runCase = Effect.fn("compat.case")(function* runCase({ manifest, local, co
|
|
|
21672
21834
|
});
|
|
21673
21835
|
}, Effect.scoped);
|
|
21674
21836
|
/** @internal */
|
|
21675
|
-
const
|
|
21837
|
+
const checkCompatPacking = Effect.fn("publish.compat")(function* checkCompatPacking(directory, packing) {
|
|
21676
21838
|
const manifest = yield* readVersionedPackageJson(directory);
|
|
21677
21839
|
const cases = compatCasesOf(manifest);
|
|
21678
21840
|
if (Array$1.isReadonlyArrayEmpty(cases)) return yield* IncompatiblePackage.make({ message: `${manifest.name} declares no engines.node, so there is no supported Node.js range to check` });
|
|
21679
|
-
const local = yield* workspaceTarballs(directory, manifest);
|
|
21841
|
+
const local = yield* workspaceTarballs(directory, manifest).pipe(Semaphore.withPermits(packing, SINGLE$1));
|
|
21680
21842
|
yield* Effect.forEach(cases, (compat) => runCase({
|
|
21681
21843
|
manifest,
|
|
21682
21844
|
local,
|
|
21683
21845
|
compat
|
|
21684
21846
|
}), {
|
|
21685
|
-
concurrency:
|
|
21847
|
+
concurrency: "unbounded",
|
|
21686
21848
|
discard: true
|
|
21687
21849
|
});
|
|
21688
21850
|
return yield* checkPluginInstall(directory, manifest, tarballsFor({})(local));
|
|
21689
21851
|
}, Effect.scoped);
|
|
21852
|
+
/** @internal */
|
|
21853
|
+
const checkCompat = Effect.fn("publish.compatOne")(function* checkCompat(directory) {
|
|
21854
|
+
const packing = yield* Semaphore.make(SINGLE$1);
|
|
21855
|
+
return yield* checkCompatPacking(directory, packing);
|
|
21856
|
+
});
|
|
21690
21857
|
// src/features/publish-workspace/model/consumer-build.ts
|
|
21691
21858
|
const PNPMFILE = ".pnpmfile.cjs";
|
|
21692
21859
|
const TASK = "msch";
|
|
@@ -22388,6 +22555,7 @@ const writeCompatPlan = Effect.fn("publish.compatPlan")(function* writeCompatPla
|
|
|
22388
22555
|
// src/features/publish-workspace/model/compat-changed.ts
|
|
22389
22556
|
const LOCAL_ONLY = "the compat jobs of the verify workflow run it for every package in CI";
|
|
22390
22557
|
const ARITY = 2;
|
|
22558
|
+
const SINGLE = 1;
|
|
22391
22559
|
const selected = (workspaces, directories) => {
|
|
22392
22560
|
if (Array$1.isReadonlyArrayEmpty(directories)) return workspaces;
|
|
22393
22561
|
return pipe(workspaces, Array$1.filter((workspace) => Array$1.contains(directories, workspace)));
|
|
@@ -22400,8 +22568,9 @@ const checkChangedCompat = Effect.fn("publish.compatChanged")(function* checkCha
|
|
|
22400
22568
|
const graph = yield* graphTasks;
|
|
22401
22569
|
const chosen = selectedWorkspaces(workspacesOf(graph), directories);
|
|
22402
22570
|
const checked = yield* Effect.filter(chosen, isChecked, { concurrency: 1 });
|
|
22403
|
-
yield*
|
|
22404
|
-
|
|
22571
|
+
const packing = yield* Semaphore.make(SINGLE);
|
|
22572
|
+
yield* Effect.forEach(checked, (directory) => checkCompatPacking(directory, packing), {
|
|
22573
|
+
concurrency: "unbounded",
|
|
22405
22574
|
discard: true
|
|
22406
22575
|
});
|
|
22407
22576
|
return yield* checkConsumers(checked);
|
|
@@ -22454,7 +22623,7 @@ const publishNatives = Effect.fn("publish.publishNatives")(function* publishNati
|
|
|
22454
22623
|
version: manifest.version,
|
|
22455
22624
|
binary,
|
|
22456
22625
|
target
|
|
22457
|
-
}), { concurrency: 1 });
|
|
22626
|
+
}, RELEASE_DIR), { concurrency: 1 });
|
|
22458
22627
|
const names = yield* Effect.forEach(written, publishNative, { concurrency: 1 });
|
|
22459
22628
|
yield* addOptionalDependencies(directory, names, manifest.version);
|
|
22460
22629
|
});
|
|
@@ -22723,7 +22892,7 @@ const declaredSymbols = Effect.fn("declaredSymbols")(function* declaredSymbols(g
|
|
|
22723
22892
|
// src/features/check-references/model/resolve-reference.ts
|
|
22724
22893
|
const GITHUB = "https://api.github.com/repos/";
|
|
22725
22894
|
const RAW = "application/vnd.github.raw+json";
|
|
22726
|
-
const NOT_FOUND$
|
|
22895
|
+
const NOT_FOUND$2 = 404;
|
|
22727
22896
|
const MULTIPLE_CHOICES = 300;
|
|
22728
22897
|
const SEPARATOR = "/";
|
|
22729
22898
|
const LATEST = "latest";
|
|
@@ -22747,7 +22916,7 @@ const Packument$1 = Schema.Struct({
|
|
|
22747
22916
|
versions: Schema.Record(Schema.String, Version)
|
|
22748
22917
|
});
|
|
22749
22918
|
const answered$1 = (lookup, missing, next) => Effect.flatMap(sent(lookup), (response) => {
|
|
22750
|
-
if (response.status === NOT_FOUND$
|
|
22919
|
+
if (response.status === NOT_FOUND$2) return Effect.succeed(broken(missing));
|
|
22751
22920
|
if (response.status >= MULTIPLE_CHOICES) return Effect.succeed(unchecked(`the lookup answered HTTP ${String(response.status)}`));
|
|
22752
22921
|
return next(response);
|
|
22753
22922
|
});
|
|
@@ -23045,10 +23214,10 @@ const packageAt = (file, text) => pipe(decodePackageJson(text), Option.filter((m
|
|
|
23045
23214
|
specified: pipe(SECTIONS, Array$1.flatMap((section) => specifiedIn(manifest[section])))
|
|
23046
23215
|
})))));
|
|
23047
23216
|
const OK = 200;
|
|
23048
|
-
const NOT_FOUND = 404;
|
|
23217
|
+
const NOT_FOUND$1 = 404;
|
|
23049
23218
|
const versionsIn = (response) => {
|
|
23050
23219
|
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([]);
|
|
23220
|
+
if (response.status === NOT_FOUND$1) return Effect.succeedSome([]);
|
|
23052
23221
|
return Effect.succeedNone;
|
|
23053
23222
|
};
|
|
23054
23223
|
const publishedVersions = (name) => abbreviatedPackument(name).pipe(Effect.flatMap(versionsIn), Effect.orElseSucceed(() => Option.none()));
|
|
@@ -23150,16 +23319,102 @@ const SUBCOMMANDS = [
|
|
|
23150
23319
|
Command.make("unbumped", {}, unbumped).pipe(Command.withDescription("Reports a changed workspace whose version is not above the base")),
|
|
23151
23320
|
...NETWORK_COMMANDS
|
|
23152
23321
|
];
|
|
23153
|
-
// src/
|
|
23322
|
+
// src/features/write-mod-types/model/embedded-types.ts
|
|
23323
|
+
const FRAME = Buffer.from("KLUv/Q==", "base64");
|
|
23324
|
+
const HEAD = "// Claude Code function hooks:";
|
|
23325
|
+
const PROBE = 65536;
|
|
23326
|
+
const NOT_FOUND = -1;
|
|
23327
|
+
const NEXT = 1;
|
|
23328
|
+
const START = 0;
|
|
23329
|
+
const decompressed = (bytes, enough) => Effect.callback((resume) => {
|
|
23330
|
+
const stream = createZstdDecompress();
|
|
23331
|
+
const chunks = [];
|
|
23332
|
+
let size = 0;
|
|
23333
|
+
const done = () => {
|
|
23334
|
+
resume(Effect.succeed(Buffer.concat(chunks).toString("utf8")));
|
|
23335
|
+
};
|
|
23336
|
+
stream.on("data", (chunk) => {
|
|
23337
|
+
chunks.push(chunk);
|
|
23338
|
+
size += chunk.length;
|
|
23339
|
+
if (size >= enough) stream.destroy();
|
|
23340
|
+
});
|
|
23341
|
+
stream.once("error", done);
|
|
23342
|
+
stream.once("close", done);
|
|
23343
|
+
stream.end(bytes);
|
|
23344
|
+
});
|
|
23345
|
+
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)])));
|
|
23346
|
+
const frameAt = (binary, starts) => (at) => {
|
|
23347
|
+
const end = pipe(starts, Array$1.findFirst((start) => start > at), Option.getOrElse(() => binary.length));
|
|
23348
|
+
return binary.subarray(at, end);
|
|
23349
|
+
};
|
|
23350
|
+
const isTypes = (frame) => pipe(decompressed(frame.subarray(START, PROBE), 30), Effect.map(String$1.startsWith(HEAD)));
|
|
23351
|
+
const embeddedTypes = Effect.fn("embeddedTypes")(function* embeddedTypes(bytes) {
|
|
23352
|
+
const binary = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
23353
|
+
const starts = frameStarts(binary);
|
|
23354
|
+
const frames = pipe(starts, Array$1.map(frameAt(binary, starts)));
|
|
23355
|
+
const found = yield* Effect.filter(frames, isTypes, { concurrency: 1 });
|
|
23356
|
+
return yield* Option.match(Array$1.head(found), {
|
|
23357
|
+
onNone: () => Effect.succeed(Option.none()),
|
|
23358
|
+
onSome: (frame) => Effect.asSome(decompressed(frame, Number.POSITIVE_INFINITY))
|
|
23359
|
+
});
|
|
23360
|
+
});
|
|
23361
|
+
// src/features/write-mod-types/model/mod-types.ts
|
|
23362
|
+
const PACKAGE = "@anthropic-ai/claude-code";
|
|
23363
|
+
const BINARY = "bin/claude.exe";
|
|
23364
|
+
const TYPES_FILE = ".claude-plugin/types/claude-code/index.d.ts";
|
|
23365
|
+
const CONCURRENCY = 4;
|
|
23366
|
+
const stampOf = (version) => `// Written by Claude Code ${version}.`;
|
|
23367
|
+
const Manifest = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
|
|
23368
|
+
const decodeManifest = Schema.decodeUnknownOption(Manifest);
|
|
23369
|
+
const modsIn = Effect.fn("modsIn")(function* modsIn(plugin) {
|
|
23370
|
+
const directories = yield* modDirectories(plugin.directory);
|
|
23371
|
+
return pipe(Option.liftPredicate(plugin.directory, () => Array$1.isReadonlyArrayNonEmpty(directories)), Option.toArray);
|
|
23372
|
+
});
|
|
23373
|
+
const installedVersion = Effect.fn("installedVersion")(function* installedVersion(directory) {
|
|
23374
|
+
const files = yield* RepositoryFiles;
|
|
23375
|
+
const manifest = yield* files.readFile(files.join(directory, "package.json"));
|
|
23376
|
+
return pipe(manifest, Option.flatMap(decodeManifest), Option.map(({ version }) => version));
|
|
23377
|
+
});
|
|
23378
|
+
const typesOf = Effect.fn("typesOf")(function* typesOf(directory, version) {
|
|
23379
|
+
const files = yield* RepositoryFiles;
|
|
23380
|
+
const binary = yield* files.readBytes(files.join(directory, BINARY));
|
|
23381
|
+
const types = yield* Option.match(binary, {
|
|
23382
|
+
onNone: () => Effect.succeed(Option.none()),
|
|
23383
|
+
onSome: embeddedTypes
|
|
23384
|
+
});
|
|
23385
|
+
return pipe(types, Option.map((text) => `${stampOf(version)}\n${text}`));
|
|
23386
|
+
});
|
|
23387
|
+
const isStamped = (stamp) => (text) => pipe(text, String$1.startsWith(`${stamp}\n`));
|
|
23388
|
+
const writeAll = Effect.fn("writeAll")(function* writeAll(plugins, directory, version) {
|
|
23389
|
+
const files = yield* RepositoryFiles;
|
|
23390
|
+
const targets = pipe(plugins, Array$1.map((plugin) => files.join(plugin, TYPES_FILE)));
|
|
23391
|
+
const written = yield* Effect.forEach(targets, files.readFile, { concurrency: CONCURRENCY });
|
|
23392
|
+
const stamped = isStamped(stampOf(version));
|
|
23393
|
+
if (pipe(written, Array$1.every(Option.exists(stamped)))) return;
|
|
23394
|
+
const types = yield* typesOf(directory, version);
|
|
23395
|
+
const writeTo = (text) => Effect.forEach(targets, (target) => files.writeFile(target, text), {
|
|
23396
|
+
concurrency: CONCURRENCY,
|
|
23397
|
+
discard: true
|
|
23398
|
+
});
|
|
23399
|
+
yield* Option.match(types, {
|
|
23400
|
+
onNone: () => Effect.void,
|
|
23401
|
+
onSome: writeTo
|
|
23402
|
+
});
|
|
23403
|
+
});
|
|
23404
|
+
const writeModTypes = Effect.fn("writeModTypes")(function* writeModTypes(root) {
|
|
23405
|
+
const files = yield* RepositoryFiles;
|
|
23406
|
+
const plugins = yield* pluginsIn$1(root);
|
|
23407
|
+
const found = yield* Effect.forEach(plugins, modsIn, { concurrency: CONCURRENCY });
|
|
23408
|
+
const mods = Array$1.flatten(found);
|
|
23409
|
+
const directory = files.join(root, NODE_MODULES$2, PACKAGE);
|
|
23410
|
+
const version = yield* installedVersion(directory);
|
|
23411
|
+
if (Array$1.isReadonlyArrayEmpty(mods) || Option.isNone(version)) return;
|
|
23412
|
+
yield* writeAll(mods, directory, version.value);
|
|
23413
|
+
});
|
|
23414
|
+
// src/app/tool-checks.ts
|
|
23154
23415
|
const NO_PROBLEMS = 0;
|
|
23155
23416
|
const ONE_FAILURE = 1;
|
|
23156
23417
|
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
23418
|
const writeStderr = Effect.fn("writeStderr")(function* writeStderr(text) {
|
|
23164
23419
|
const stdio = yield* Stdio.Stdio;
|
|
23165
23420
|
yield* Stream.make(text).pipe(Stream.run(stdio.stderr()), Effect.orDie);
|
|
@@ -23168,7 +23423,15 @@ const failuresOf = (args, kind, message) => {
|
|
|
23168
23423
|
if (Array$1.isReadonlyArrayEmpty(args) && kind === NO_CONFIG) return Effect.succeed(NO_PROBLEMS);
|
|
23169
23424
|
return writeStderr(`${message}\n`).pipe(Effect.as(ONE_FAILURE));
|
|
23170
23425
|
};
|
|
23426
|
+
/** @internal */
|
|
23171
23427
|
const toolChecks = (root, args) => runVpa(root, args).pipe(Effect.as(NO_PROBLEMS), Effect.catchIf(Schema.is(VpToolsError), (failure) => failuresOf(args, failure.kind, failure.message)));
|
|
23428
|
+
// src/app/cli.ts
|
|
23429
|
+
const PREPARE = "prepare";
|
|
23430
|
+
const STAGED = "staged";
|
|
23431
|
+
const PRE_PUSH = "pre-push";
|
|
23432
|
+
const COMMIT_MSG = "commit-msg";
|
|
23433
|
+
const MESSAGE = "message";
|
|
23434
|
+
const FLAG_PREFIX = "--";
|
|
23172
23435
|
const checkEverything = Effect.fn("checkEverything")(function* checkEverything(root) {
|
|
23173
23436
|
const problemCount = yield* reportProblemCount(root);
|
|
23174
23437
|
const toolFailures = yield* toolChecks(root, []);
|
|
@@ -23192,6 +23455,7 @@ const hookArguments = (input) => [
|
|
|
23192
23455
|
const checks = Effect.fn("checks")(function* checks(input) {
|
|
23193
23456
|
const root = (yield* RepositoryFiles).resolve(".");
|
|
23194
23457
|
if (input.json) return yield* writeJson(root);
|
|
23458
|
+
if (input.prepare) yield* writeModTypes(root);
|
|
23195
23459
|
const args = hookArguments(input);
|
|
23196
23460
|
if (Array$1.isReadonlyArrayNonEmpty(args)) return yield* toolChecks(root, args).pipe(Effect.flatMap(failWhenAny));
|
|
23197
23461
|
return yield* checkEverything(root);
|