@r_masseater/msch 0.134.1 → 0.141.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon-tasks.mjs +1 -1
- package/dist/build-workspace-settings-C2EOC9GX.mjs +627 -0
- package/dist/build-workspace-settings-C2EOC9GX.mjs.map +1 -0
- package/dist/cargo-inputs.mjs +1 -1
- package/dist/cli.mjs +708 -750
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +13 -37
- package/dist/config.mjs +335 -23
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules-CqgOVodl.mjs +43 -0
- package/dist/decision-rules-CqgOVodl.mjs.map +1 -0
- package/dist/decision-rules.d.mts +2 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{dependencies-Bjn3xWkq.mjs → dependencies-DgltkhvK.mjs} +2 -2
- package/dist/{dependencies-Bjn3xWkq.mjs.map → dependencies-DgltkhvK.mjs.map} +1 -1
- package/dist/{derive-cargo-inputs-BLMqkRS3.mjs → derive-cargo-inputs-DbMOBcGP.mjs} +3 -3
- package/dist/{derive-cargo-inputs-BLMqkRS3.mjs.map → derive-cargo-inputs-DbMOBcGP.mjs.map} +1 -1
- package/dist/{ignored-directories-CaTFIbjo.mjs → ignored-directories-BGiOSvNx.mjs} +2 -2
- package/dist/{ignored-directories-CaTFIbjo.mjs.map → ignored-directories-BGiOSvNx.mjs.map} +1 -1
- package/dist/index-DOkaGaUe.d.mts +25 -0
- package/dist/library.mjs +2 -2
- package/dist/lint.d.mts +38 -2
- package/dist/lint.mjs +20 -1
- package/dist/lint.mjs.map +1 -0
- package/dist/oxlint.mjs +2 -2
- package/dist/{problem-Dk1svgmC.mjs → problem-CkDaLJxX.mjs} +2 -2
- package/dist/{problem-Dk1svgmC.mjs.map → problem-CkDaLJxX.mjs.map} +1 -1
- package/dist/{published-Cgl1qeYH.mjs → published-BrX24558.mjs} +269 -8
- package/dist/published-BrX24558.mjs.map +1 -0
- package/dist/{repository-files-C_GzAnYp.mjs → repository-files-CX48nfE5.mjs} +4 -5
- package/dist/repository-files-CX48nfE5.mjs.map +1 -0
- package/dist/{define-lint-preset-_bDnJMcY.mjs → repository-text-CpD8Z1kp.mjs} +355 -380
- package/dist/repository-text-CpD8Z1kp.mjs.map +1 -0
- package/dist/traced-rules.config-CnYNZrOa.mjs +8 -0
- package/dist/traced-rules.config-CnYNZrOa.mjs.map +1 -0
- package/dist/workspace-settings.mjs +2 -434
- package/dist/zenn-markdown.config-uksui7Go.mjs +77 -0
- package/dist/zenn-markdown.config-uksui7Go.mjs.map +1 -0
- package/package.json +13 -13
- package/skills/msch-checks/SKILL.md +5 -5
- package/skills/msch-publishing/SKILL.md +1 -1
- package/skills/msch-repository-config/SKILL.md +19 -18
- package/skills/msch-workspace-settings/SKILL.md +15 -9
- package/src/app/vite.d.ts +5 -8
- package/dist/define-lint-preset-_bDnJMcY.mjs.map +0 -1
- package/dist/index-_y7Igwy0.d.mts +0 -321
- package/dist/published-Cgl1qeYH.mjs.map +0 -1
- package/dist/repository-files-C_GzAnYp.mjs.map +0 -1
- package/dist/repository-text-BPhi-pct.mjs +0 -331
- package/dist/repository-text-BPhi-pct.mjs.map +0 -1
- package/dist/required-stack-BLSiAmpx.mjs +0 -188
- package/dist/required-stack-BLSiAmpx.mjs.map +0 -1
- package/dist/workspace-projects-Zg078aA1.mjs +0 -269
- package/dist/workspace-projects-Zg078aA1.mjs.map +0 -1
- package/dist/workspace-settings.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Array as Array$1, Boolean as Boolean$1, Clock, Config as Config$1, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match,
|
|
2
|
+
import { Array as Array$1, Boolean as Boolean$1, Clock, Config as Config$1, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match, Number as Number$1, Option, Order, Path, Predicate as Predicate$1, Record, Result, Runtime, Schedule, Schema, SchemaTransformation, Semaphore, Stdio, Stream, String as String$1, Struct, pipe } from "effect";
|
|
3
3
|
import { Argument, Command, Flag } from "effect/cli";
|
|
4
|
-
import { i as nodeRepositoryFiles, n as NODE_MODULES$2, o as TOOL_NAME$1, r as RepositoryFiles,
|
|
4
|
+
import { i as nodeRepositoryFiles, n as NODE_MODULES$2, o as TOOL_NAME$1, r as RepositoryFiles, t as MSCH_CACHE } from "./repository-files-CX48nfE5.mjs";
|
|
5
5
|
import { hookFlags } from "@r_masseater/masseater-utils/hook-flags";
|
|
6
|
-
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-
|
|
6
|
+
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-CkDaLJxX.mjs";
|
|
7
7
|
import { lockedGraph, lockedPackageIds, parseDependencyPath, updateWorkspaceManifest } from "@r_masseater/masseater-utils/kestrion/pnpm";
|
|
8
8
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
9
9
|
import { DEPENDENCY_SECTIONS, PACKAGE_JSON_FILE, ROOT_SUBPATH as ROOT_SUBPATH$2, RUNTIME_SECTIONS, binEntriesOf, exportEntriesOf, importSpecifierOf, namesIn as namesIn$1, optionalPeerNames, runtimeDependencyNames, targetsIn, unscopedNameOf } from "@r_masseater/masseater-utils/kestrion";
|
|
10
|
-
import { i as workspaceDependencies$1, n as installedManifest, r as readManifest, t as dependencyEntries } from "./dependencies-
|
|
11
|
-
import { C as childrenOf$4,
|
|
10
|
+
import { i as workspaceDependencies$1, n as installedManifest, r as readManifest, t as dependencyEntries } from "./dependencies-DgltkhvK.mjs";
|
|
11
|
+
import { A as definesTask, B as workspaceConfigOf, C as workspaceProjects, D as TASK_NAMES, E as RUN_TASKS, G as literalOf, H as childrenOf$4, J as stringsIn, K as nestedValues, M as hasVerifyTask, O as TEST_TASK_NAMES, S as workspaceDirectories, U as keyName, V as KeySchema, W as keyValues, a as workspaceConfigs, b as publishedProjects, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, j as hasCargoTask, k as VERIFY_TASK, l as modDirectories, m as workspaceLinks, o as entryNameOf, q as propertyValue, r as packedWorkspaces, s as isBinEntry, u as INDEX_SKILL, v as shadcnUiOf, w as workspaceManifest, x as unmatchedWorkspacePatterns } from "./published-BrX24558.mjs";
|
|
12
12
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-BhBnc3Sn.mjs";
|
|
13
13
|
import { decodePackageJson, decodeVersionedPackageJson, readPackageJson, readRawPackageJson, readVersionedPackageJson, updatePackageJson, writePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { parse } from "vite-plus";
|
|
15
|
+
import { resolvedViteConfig } from "@r_masseater/masseater-utils/vite-config";
|
|
16
16
|
import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-B3SYjao5.mjs";
|
|
17
|
-
import {
|
|
17
|
+
import { _ as namedWorkspaces, a as GIT_HOOKS, f as existsAt, g as exempt, i as lint, l as forgetBuilt, m as isIgnored, t as BUILT_ALLOWANCES, u as lastBuilt, v as patternOf$1 } from "./repository-text-CpD8Z1kp.mjs";
|
|
18
18
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
19
|
import treeSitter from "@vscode/tree-sitter-wasm";
|
|
20
20
|
import { t as startedOnce } from "./started-once-BN_hLlmU.mjs";
|
|
21
|
+
import { rustCrate, workspace } from "@r_masseater/wism/presets";
|
|
21
22
|
import { getStaticTOMLValue, parseTOML } from "toml-eslint-parser";
|
|
22
23
|
import { rolldown } from "rolldown";
|
|
23
24
|
import { stripVTControlCharacters } from "node:util";
|
|
24
25
|
import { builtinModules, isBuiltin as isBuiltin$1 } from "node:module";
|
|
25
26
|
import semver from "semver";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
|
|
27
|
+
import { a as decisionTestRules } from "./zenn-markdown.config-uksui7Go.mjs";
|
|
28
|
+
import { groupOf } from "@r_masseater/masseater-utils/text";
|
|
29
29
|
import { Parser, isMap, isNode, isPair, isScalar, isSeq, parse as parse$1, parseDocument, visit as visit$1 } from "yaml";
|
|
30
|
-
import { fu4Section, lint as lint$2, workflowPathspecs } from "@r_masseater/fu4";
|
|
31
30
|
import { isComment, isTag, isText } from "domhandler";
|
|
32
31
|
import { DomUtils, parseDocument as parseDocument$1 } from "htmlparser2";
|
|
33
32
|
import { DockerfileParser } from "dockerfile-ast";
|
|
@@ -42,33 +41,32 @@ import { dual } from "effect/Function";
|
|
|
42
41
|
import { readWorkspaceManifest as readWorkspaceManifest$1 } from "@pnpm/workspace.workspace-manifest-reader";
|
|
43
42
|
import { judgeText } from "@r_masseater/oxlint-plugin-decision";
|
|
44
43
|
import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_masseater/masseater-utils/github-workflow";
|
|
44
|
+
import { NO_PATH, describeReference, linksIn, referenceOf as referenceOf$2 } from "@r_masseater/y8";
|
|
45
45
|
import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
|
|
46
46
|
import { Base64 } from "effect/encoding";
|
|
47
47
|
import { arch, platform } from "node:os";
|
|
48
|
+
import manifest from "@r_masseater/mdlct/package.json" with { type: "json" };
|
|
48
49
|
import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
49
50
|
import { Buffer } from "node:buffer";
|
|
50
51
|
import { createZstdDecompress } from "node:zlib";
|
|
51
52
|
// package.json
|
|
52
53
|
var name = "@r_masseater/msch";
|
|
53
|
-
var version = "0.
|
|
54
|
+
var version = "0.141.1";
|
|
54
55
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
55
56
|
var repository = {
|
|
56
57
|
"type": "git",
|
|
57
58
|
"url": "git+https://github.com/masseater/ecosystems.git",
|
|
58
59
|
"directory": "libs/msch"
|
|
59
60
|
};
|
|
60
|
-
// src/app/json-flag.ts
|
|
61
|
-
/** @internal */
|
|
62
|
-
const jsonFlag = Flag.Boolean("json").pipe(Flag.withDescription("Prints the result as JSON"), Flag.withDefault(false));
|
|
63
61
|
/** @internal */
|
|
64
62
|
const rootFlags = {
|
|
65
|
-
json:
|
|
63
|
+
json: Flag.Boolean("json").pipe(Flag.withDescription("Prints the result as JSON"), Flag.withDefault(false)),
|
|
66
64
|
...hookFlags
|
|
67
65
|
};
|
|
68
66
|
// src/app/output.ts
|
|
69
|
-
const taggedError$
|
|
67
|
+
const taggedError$15 = Schema.TaggedError;
|
|
70
68
|
const NO_PROBLEMS$2 = 0;
|
|
71
|
-
var ProblemsFound = class extends taggedError$
|
|
69
|
+
var ProblemsFound = class extends taggedError$15()("ProblemsFound", { count: Schema.Finite }) {
|
|
72
70
|
[Runtime.errorReported] = false;
|
|
73
71
|
};
|
|
74
72
|
/** @internal */
|
|
@@ -442,7 +440,7 @@ const mentions$1 = (needle) => ({ api }) => (configPath) => Effect.gen(function*
|
|
|
442
440
|
return pipe(texts, Array$1.some((text) => Option.exists(text, includesNeedle)));
|
|
443
441
|
});
|
|
444
442
|
// src/entities/project/model/inputs.ts
|
|
445
|
-
const SEPARATOR$
|
|
443
|
+
const SEPARATOR$28 = "/";
|
|
446
444
|
const SCOPE_PREFIX$1 = "@";
|
|
447
445
|
const HIDDEN_PREFIX = ".";
|
|
448
446
|
const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
@@ -484,14 +482,14 @@ const closureOf$3 = Effect.fn("closureOf")(function* closureOf(root, configPath)
|
|
|
484
482
|
const directories = yield* workspaceClosure(directory);
|
|
485
483
|
return {
|
|
486
484
|
directories,
|
|
487
|
-
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$
|
|
485
|
+
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$28}`))
|
|
488
486
|
};
|
|
489
487
|
});
|
|
490
488
|
const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
|
|
491
489
|
const files = yield* RepositoryFiles;
|
|
492
490
|
if (!String$1.startsWith(SCOPE_PREFIX$1)(name)) return [name];
|
|
493
491
|
const scoped = yield* files.readDirectory(files.join(modules, name));
|
|
494
|
-
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$
|
|
492
|
+
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$28}${entry}`));
|
|
495
493
|
});
|
|
496
494
|
const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
|
|
497
495
|
const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
|
|
@@ -645,7 +643,7 @@ const runTasksOf = Effect.fn("runTasksOf")(function* runTasksOf(root, directory)
|
|
|
645
643
|
})));
|
|
646
644
|
});
|
|
647
645
|
// src/entities/workspace/model/cargo-crates.ts
|
|
648
|
-
const SEPARATOR$
|
|
646
|
+
const SEPARATOR$27 = "/";
|
|
649
647
|
const SUCCESS$7 = 0;
|
|
650
648
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
651
649
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
@@ -686,7 +684,7 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
686
684
|
}, Effect.scoped);
|
|
687
685
|
/** @internal */
|
|
688
686
|
const owningWorkspace = (directories) => (directory) => {
|
|
689
|
-
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$
|
|
687
|
+
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$27}`)(directory)));
|
|
690
688
|
return Array$1.last(Array$1.sort(owners, String$1.Order));
|
|
691
689
|
};
|
|
692
690
|
// src/entities/workspace/model/plugins.ts
|
|
@@ -694,7 +692,7 @@ const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
|
|
|
694
692
|
const SKILLS_DIRECTORY = "skills";
|
|
695
693
|
const SKILL_FILE$4 = "SKILL.md";
|
|
696
694
|
const CONCURRENCY$7 = 16;
|
|
697
|
-
const SEPARATOR$
|
|
695
|
+
const SEPARATOR$26 = "/";
|
|
698
696
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
699
697
|
name: Schema.String,
|
|
700
698
|
description: Schema.optionalKey(Schema.String),
|
|
@@ -710,7 +708,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
710
708
|
const directory = files.join(skills, name);
|
|
711
709
|
const file = files.join(directory, SKILL_FILE$4);
|
|
712
710
|
const source = yield* files.readFile(file);
|
|
713
|
-
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$
|
|
711
|
+
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
714
712
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
715
713
|
return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
|
|
716
714
|
plugin,
|
|
@@ -723,7 +721,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
723
721
|
})))));
|
|
724
722
|
});
|
|
725
723
|
const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
|
|
726
|
-
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$
|
|
724
|
+
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
727
725
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
728
726
|
});
|
|
729
727
|
const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
@@ -786,10 +784,10 @@ const namesSkill = (skill) => (text) => new RegExp(namePattern(skill), "u").test
|
|
|
786
784
|
const SKILLS_START = "<!-- skills:generated -->";
|
|
787
785
|
const SKILLS_END = "<!-- /skills:generated -->";
|
|
788
786
|
// src/shared/lib/text-position.ts
|
|
789
|
-
const START$
|
|
787
|
+
const START$36 = 0;
|
|
790
788
|
const FIRST_COLUMN$8 = 1;
|
|
791
789
|
const positionOf = (source) => (index) => {
|
|
792
|
-
const before = pipe(source, String$1.slice(START$
|
|
790
|
+
const before = pipe(source, String$1.slice(START$36, index), String$1.split("\n"));
|
|
793
791
|
return {
|
|
794
792
|
line: before.length,
|
|
795
793
|
column: pipe(Array$1.last(before), Option.match({
|
|
@@ -922,7 +920,7 @@ const workspaceOverrides = Effect.fn("workspaceOverrides")(function* workspaceOv
|
|
|
922
920
|
const manifest = yield* workspaceManifest(root);
|
|
923
921
|
return pipe(manifest, Option.flatMap((found) => Option.fromUndefinedOr(found.overrides)), Option.getOrElse(() => ({})));
|
|
924
922
|
});
|
|
925
|
-
const keyStart = (source) => (index) => {
|
|
923
|
+
const keyStart$1 = (source) => (index) => {
|
|
926
924
|
const before = String$1.slice(index - PREVIOUS, index)(source);
|
|
927
925
|
return index - Number(Array$1.contains(QUOTES$1, before)) * PREVIOUS;
|
|
928
926
|
};
|
|
@@ -930,7 +928,7 @@ const overrideKeysOf = (source) => (overrides) => {
|
|
|
930
928
|
const at = positionOf(source);
|
|
931
929
|
return pipe(Record.keys(overrides), Array$1.flatMap((key) => pipe(String$1.indexOf(key)(source), Option.map((index) => ({
|
|
932
930
|
key,
|
|
933
|
-
...at(keyStart(source)(index))
|
|
931
|
+
...at(keyStart$1(source)(index))
|
|
934
932
|
})), Option.toArray)));
|
|
935
933
|
};
|
|
936
934
|
const withoutOverride = (key) => (overrides) => Record.remove(overrides, key);
|
|
@@ -949,8 +947,8 @@ const RESOLUTION_FILES = [
|
|
|
949
947
|
];
|
|
950
948
|
const RESOLUTION_CONCURRENCY = 2;
|
|
951
949
|
const SUCCEEDED$1 = 0;
|
|
952
|
-
const taggedError$
|
|
953
|
-
var OverrideResolutionFailed = class extends taggedError$
|
|
950
|
+
const taggedError$14 = Schema.TaggedError;
|
|
951
|
+
var OverrideResolutionFailed = class extends taggedError$14()("OverrideResolutionFailed", {
|
|
954
952
|
override: Schema.String,
|
|
955
953
|
output: Schema.String
|
|
956
954
|
}) {};
|
|
@@ -1068,7 +1066,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1068
1066
|
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
1069
1067
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1070
1068
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1071
|
-
const READ_CONCURRENCY$
|
|
1069
|
+
const READ_CONCURRENCY$40 = 64;
|
|
1072
1070
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1073
1071
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1074
1072
|
/** @internal */
|
|
@@ -1091,7 +1089,7 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1091
1089
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1092
1090
|
onNone: () => [],
|
|
1093
1091
|
onSome: (source) => foundIn(entry, source)
|
|
1094
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1092
|
+
}))), { concurrency: READ_CONCURRENCY$40 });
|
|
1095
1093
|
return Array$1.flatten(found);
|
|
1096
1094
|
});
|
|
1097
1095
|
/** @internal */
|
|
@@ -1107,7 +1105,7 @@ const problemsInFiles = Effect.fn("problemsInFiles")(function* problemsInFiles(r
|
|
|
1107
1105
|
source
|
|
1108
1106
|
})
|
|
1109
1107
|
})));
|
|
1110
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
1108
|
+
}, { concurrency: READ_CONCURRENCY$40 });
|
|
1111
1109
|
return Array$1.flatten(found);
|
|
1112
1110
|
});
|
|
1113
1111
|
// src/features/check-overrides/model/git-subpath.ts
|
|
@@ -1121,18 +1119,18 @@ const problemAt$5 = ({ file }, source) => (found) => ({
|
|
|
1121
1119
|
rule: RULE$83,
|
|
1122
1120
|
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])}\`.`
|
|
1123
1121
|
});
|
|
1124
|
-
const problemsIn$
|
|
1122
|
+
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
|
|
1125
1123
|
const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
|
|
1126
1124
|
/** @internal */
|
|
1127
1125
|
const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
|
|
1128
1126
|
const listed = yield* listedFiles(root);
|
|
1129
|
-
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$
|
|
1127
|
+
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
|
|
1130
1128
|
});
|
|
1131
1129
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
1132
1130
|
const RULE$82 = "unnamed-restriction";
|
|
1133
1131
|
const WHOLE_MATCH$3 = 0;
|
|
1134
1132
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
|
|
1135
|
-
const problemsIn$
|
|
1133
|
+
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
1136
1134
|
file: entry.file,
|
|
1137
1135
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
1138
1136
|
rule: RULE$82,
|
|
@@ -1141,13 +1139,13 @@ const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matc
|
|
|
1141
1139
|
/** @internal */
|
|
1142
1140
|
const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
|
|
1143
1141
|
const listed = yield* listedFiles(root);
|
|
1144
|
-
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$
|
|
1142
|
+
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
1145
1143
|
});
|
|
1146
1144
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
1147
1145
|
const RULE$81 = "named-type-exemption";
|
|
1148
1146
|
const WHOLE_MATCH$2 = 0;
|
|
1149
1147
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
1150
|
-
const problemsIn$
|
|
1148
|
+
const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
1151
1149
|
file: entry.file,
|
|
1152
1150
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
1153
1151
|
rule: RULE$81,
|
|
@@ -1156,7 +1154,7 @@ const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matc
|
|
|
1156
1154
|
/** @internal */
|
|
1157
1155
|
const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
|
|
1158
1156
|
const listed = yield* listedFiles(root);
|
|
1159
|
-
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$
|
|
1157
|
+
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
|
|
1160
1158
|
});
|
|
1161
1159
|
// src/shared/lib/registries.ts
|
|
1162
1160
|
const TRAILING_SLASH$1 = /\/*$/u;
|
|
@@ -1171,12 +1169,12 @@ const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
|
1171
1169
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
1172
1170
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
1173
1171
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
1174
|
-
const START$
|
|
1172
|
+
const START$35 = 0;
|
|
1175
1173
|
const REASON$4 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
1176
1174
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
1177
1175
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
1178
1176
|
const isRequired$1 = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
|
|
1179
|
-
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1177
|
+
const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$35));
|
|
1180
1178
|
const workspaceProblem = ({ file, source }, registry) => ({
|
|
1181
1179
|
file,
|
|
1182
1180
|
...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
|
|
@@ -1188,9 +1186,9 @@ const workspaceProblem = ({ file, source }, registry) => ({
|
|
|
1188
1186
|
});
|
|
1189
1187
|
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired$1)), Array$1.map((found) => ({
|
|
1190
1188
|
file: entry.file,
|
|
1191
|
-
...positionOf(source)(found.index ?? START$
|
|
1189
|
+
...positionOf(source)(found.index ?? START$35),
|
|
1192
1190
|
rule: RULE$80,
|
|
1193
|
-
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$
|
|
1191
|
+
message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$35])}\`. Remove the line.`
|
|
1194
1192
|
})));
|
|
1195
1193
|
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
1196
1194
|
const files = yield* RepositoryFiles;
|
|
@@ -1239,7 +1237,7 @@ const renovatePresetOf = Effect.fn("renovatePresetOf")(function* renovatePresetO
|
|
|
1239
1237
|
// src/entities/package/model/stack-catalog.ts
|
|
1240
1238
|
const STACK_CATALOG = "catalog:stack";
|
|
1241
1239
|
// src/entities/package/model/specifiers.ts
|
|
1242
|
-
const START$
|
|
1240
|
+
const START$34 = 0;
|
|
1243
1241
|
const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
|
|
1244
1242
|
const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
|
|
1245
1243
|
const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
|
|
@@ -1257,7 +1255,7 @@ const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.ra
|
|
|
1257
1255
|
/** @internal */
|
|
1258
1256
|
const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
|
|
1259
1257
|
/** @internal */
|
|
1260
|
-
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
1258
|
+
const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$34));
|
|
1261
1259
|
const SECTIONS$1 = [
|
|
1262
1260
|
"dependencies",
|
|
1263
1261
|
"devDependencies",
|
|
@@ -1300,6 +1298,11 @@ var renovate_default = {
|
|
|
1300
1298
|
prHourlyLimit: 0,
|
|
1301
1299
|
gitIgnoredAuthors: ["41898282+github-actions[bot]@users.noreply.github.com"],
|
|
1302
1300
|
packageRules: [
|
|
1301
|
+
{
|
|
1302
|
+
"description": "Renovate 自身では自動マージしない。PR はほかの PR と同じく merge queue が入れる。queue は main の verify が赤い間は bot の PR を止め、入れた PR を赤を起こす通知に載せる。Renovate が GitHub の自動マージで入れると、この 2 つを素通りして、赤い main に次の更新が重なる。",
|
|
1303
|
+
"matchPackageNames": ["*"],
|
|
1304
|
+
"automerge": false
|
|
1305
|
+
},
|
|
1303
1306
|
{
|
|
1304
1307
|
"description": "msch の commitlint は件名に日本語の文字を 1 文字以上求める(subject-script)。Renovate の既定の件名(update all dependencies など)は英語だけなので、PR の up-to-date が落ちてマージキューに入らなかった。件名を「<対象>(<版>)を上げる」の形にする。グループと digest の更新では Renovate が commitMessageExtra を消すので、日本語は消されない commitMessageSuffix に置く。",
|
|
1305
1308
|
"matchPackageNames": ["*"],
|
|
@@ -1434,7 +1437,7 @@ const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(S
|
|
|
1434
1437
|
onNone: () => selector,
|
|
1435
1438
|
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
1436
1439
|
}));
|
|
1437
|
-
const removalOf = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
1440
|
+
const removalOf$1 = (key) => Array$1.matchRight(String$1.split(key, PARENT_SEPARATOR), {
|
|
1438
1441
|
onEmpty: () => Option.none(),
|
|
1439
1442
|
onNonEmpty: (parents, target) => Option.some({
|
|
1440
1443
|
key,
|
|
@@ -1456,7 +1459,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1456
1459
|
});
|
|
1457
1460
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
1458
1461
|
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
1459
|
-
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
1462
|
+
const removedPeerProblems = (peers) => ({ file, source, overrides }) => pipe(overrideKeysOf(source)(removalsIn(overrides)), Array$1.flatMap((located) => pipe(removalOf$1(located.key), Option.flatMap(firstRemovedPeer(peers)), Option.map(problemAt$4(file, located)), Option.toArray)));
|
|
1460
1463
|
const requiredPeersOf$1 = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
1461
1464
|
peer,
|
|
1462
1465
|
dependent
|
|
@@ -3599,8 +3602,8 @@ const FLOATING_PREFIX = `${ANY_DEPTH}/`;
|
|
|
3599
3602
|
const LEADING_SLASHES = /^\/+/u;
|
|
3600
3603
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3601
3604
|
const SPACES = /\s+/u;
|
|
3602
|
-
const FIRST$
|
|
3603
|
-
const READ_CONCURRENCY$
|
|
3605
|
+
const FIRST$27 = 1;
|
|
3606
|
+
const READ_CONCURRENCY$39 = 16;
|
|
3604
3607
|
const withoutPrefix = (prefix, text) => {
|
|
3605
3608
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3606
3609
|
return text;
|
|
@@ -3624,7 +3627,7 @@ const entryOf$2 = (file, kind, directory) => (line, index) => {
|
|
|
3624
3627
|
file,
|
|
3625
3628
|
kind,
|
|
3626
3629
|
directory,
|
|
3627
|
-
line: index + FIRST$
|
|
3630
|
+
line: index + FIRST$27,
|
|
3628
3631
|
pattern,
|
|
3629
3632
|
values: Array$1.join(values, " ")
|
|
3630
3633
|
});
|
|
@@ -3638,10 +3641,10 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3638
3641
|
});
|
|
3639
3642
|
const patternProblem = (entry, message) => problemAtPosition(RULE$78)(entry.file, {
|
|
3640
3643
|
line: entry.line,
|
|
3641
|
-
column: FIRST$
|
|
3644
|
+
column: FIRST$27
|
|
3642
3645
|
}, message);
|
|
3643
3646
|
const misplacedMessage = (kind, workspaces) => {
|
|
3644
|
-
if (workspaces.length === FIRST$
|
|
3647
|
+
if (workspaces.length === FIRST$27) {
|
|
3645
3648
|
const workspace = Array$1.join(workspaces, "");
|
|
3646
3649
|
return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
|
|
3647
3650
|
}
|
|
@@ -3691,17 +3694,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3691
3694
|
/** @internal */
|
|
3692
3695
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3693
3696
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3694
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3697
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$39 });
|
|
3695
3698
|
const entries = Array$1.flatten(read);
|
|
3696
3699
|
const workspaces = yield* workspaceDirectories(root);
|
|
3697
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3700
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$39 });
|
|
3698
3701
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3699
3702
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3700
3703
|
});
|
|
3701
3704
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3702
3705
|
const RULE$77 = "colocated-test";
|
|
3703
|
-
const FIRST$
|
|
3704
|
-
const READ_CONCURRENCY$
|
|
3706
|
+
const FIRST$26 = 1;
|
|
3707
|
+
const READ_CONCURRENCY$38 = 64;
|
|
3705
3708
|
const ROOT_SUBPATH$1 = ".";
|
|
3706
3709
|
const NAME_GROUP$2 = "name";
|
|
3707
3710
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3720,8 +3723,8 @@ const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test n
|
|
|
3720
3723
|
const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3721
3724
|
const problemFor$11 = (test, message) => ({
|
|
3722
3725
|
file: test.file,
|
|
3723
|
-
line: FIRST$
|
|
3724
|
-
column: FIRST$
|
|
3726
|
+
line: FIRST$26,
|
|
3727
|
+
column: FIRST$26,
|
|
3725
3728
|
rule: RULE$77,
|
|
3726
3729
|
message: `${test.base} ${message}`
|
|
3727
3730
|
});
|
|
@@ -3785,12 +3788,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3785
3788
|
directory: files.dirname(file)
|
|
3786
3789
|
};
|
|
3787
3790
|
}));
|
|
3788
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3791
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$38 });
|
|
3789
3792
|
return Array$1.getSomes(found);
|
|
3790
3793
|
});
|
|
3791
3794
|
// src/shared/lib/agent-docs.ts
|
|
3792
3795
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3793
|
-
const READ_CONCURRENCY$
|
|
3796
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3794
3797
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3795
3798
|
const files = yield* RepositoryFiles;
|
|
3796
3799
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3799,12 +3802,12 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3799
3802
|
const file = files.join(root, name);
|
|
3800
3803
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3801
3804
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3802
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3805
|
+
}, { concurrency: READ_CONCURRENCY$37 });
|
|
3803
3806
|
return Array$1.getSomes(found);
|
|
3804
3807
|
});
|
|
3805
3808
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3806
3809
|
const RECOMMENDED_LINES = 200;
|
|
3807
|
-
const FIRST$
|
|
3810
|
+
const FIRST$25 = 1;
|
|
3808
3811
|
const RULE$76 = "agent-docs-length";
|
|
3809
3812
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3810
3813
|
const problemFor$10 = (file) => (lines) => {
|
|
@@ -3812,7 +3815,7 @@ const problemFor$10 = (file) => (lines) => {
|
|
|
3812
3815
|
return Option.some({
|
|
3813
3816
|
file,
|
|
3814
3817
|
line: 201,
|
|
3815
|
-
column: FIRST$
|
|
3818
|
+
column: FIRST$25,
|
|
3816
3819
|
rule: RULE$76,
|
|
3817
3820
|
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.`
|
|
3818
3821
|
});
|
|
@@ -3823,8 +3826,8 @@ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source)
|
|
|
3823
3826
|
const RULE$75 = "claude-md-link";
|
|
3824
3827
|
const CLAUDE = "CLAUDE.md";
|
|
3825
3828
|
const AGENTS = "AGENTS.md";
|
|
3826
|
-
const FIRST$
|
|
3827
|
-
const READ_CONCURRENCY$
|
|
3829
|
+
const FIRST$24 = 1;
|
|
3830
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3828
3831
|
const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3829
3832
|
/** @internal */
|
|
3830
3833
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3837,22 +3840,22 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3837
3840
|
const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
|
|
3838
3841
|
return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
|
|
3839
3842
|
file: path,
|
|
3840
|
-
line: FIRST$
|
|
3841
|
-
column: FIRST$
|
|
3843
|
+
line: FIRST$24,
|
|
3844
|
+
column: FIRST$24,
|
|
3842
3845
|
rule: RULE$75,
|
|
3843
3846
|
message: MESSAGE$15
|
|
3844
3847
|
})));
|
|
3845
3848
|
});
|
|
3846
3849
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3847
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3850
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$36 });
|
|
3848
3851
|
return Array$1.getSomes(found);
|
|
3849
3852
|
});
|
|
3850
3853
|
// src/features/check-placement/model/dangling-links.ts
|
|
3851
3854
|
const RULE$74 = "dangling-link";
|
|
3852
|
-
const SEPARATOR$
|
|
3853
|
-
const FIRST$
|
|
3854
|
-
const READ_CONCURRENCY$
|
|
3855
|
-
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$
|
|
3855
|
+
const SEPARATOR$25 = "/";
|
|
3856
|
+
const FIRST$23 = 1;
|
|
3857
|
+
const READ_CONCURRENCY$35 = 16;
|
|
3858
|
+
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$25}`)(name);
|
|
3856
3859
|
/** @internal */
|
|
3857
3860
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3858
3861
|
const files = yield* RepositoryFiles;
|
|
@@ -3862,19 +3865,19 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3862
3865
|
const link = yield* files.readLink(file);
|
|
3863
3866
|
return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array$1.some(holds(target)))), Option.map((target) => ({
|
|
3864
3867
|
file,
|
|
3865
|
-
line: FIRST$
|
|
3866
|
-
column: FIRST$
|
|
3868
|
+
line: FIRST$23,
|
|
3869
|
+
column: FIRST$23,
|
|
3867
3870
|
rule: RULE$74,
|
|
3868
3871
|
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.`
|
|
3869
3872
|
})));
|
|
3870
3873
|
});
|
|
3871
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3874
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$35 });
|
|
3872
3875
|
return Array$1.getSomes(found);
|
|
3873
3876
|
});
|
|
3874
3877
|
// src/features/check-placement/model/member-sources.ts
|
|
3875
3878
|
const ROOT_WORKSPACE$1 = ".";
|
|
3876
|
-
const FIRST$
|
|
3877
|
-
const SEPARATOR$
|
|
3879
|
+
const FIRST$22 = 1;
|
|
3880
|
+
const SEPARATOR$24 = "/";
|
|
3878
3881
|
const EXCLUDED$7 = [
|
|
3879
3882
|
":(exclude,attr:linguist-vendored)",
|
|
3880
3883
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3894,12 +3897,12 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
|
|
|
3894
3897
|
const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3895
3898
|
const fileProblem$1 = ({ file, rule, message }) => ({
|
|
3896
3899
|
file,
|
|
3897
|
-
line: FIRST$
|
|
3898
|
-
column: FIRST$
|
|
3900
|
+
line: FIRST$22,
|
|
3901
|
+
column: FIRST$22,
|
|
3899
3902
|
rule,
|
|
3900
3903
|
message
|
|
3901
3904
|
});
|
|
3902
|
-
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$
|
|
3905
|
+
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$24}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
|
|
3903
3906
|
workspace,
|
|
3904
3907
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3905
3908
|
})));
|
|
@@ -3924,7 +3927,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3924
3927
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3925
3928
|
const RULE$73 = "deployed-readme";
|
|
3926
3929
|
const ROOT_DIRECTORY$4 = "";
|
|
3927
|
-
const READ_CONCURRENCY$
|
|
3930
|
+
const READ_CONCURRENCY$34 = 16;
|
|
3928
3931
|
const MISSING_MESSAGE$3 = "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.";
|
|
3929
3932
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3930
3933
|
const ADDRESS_KEYS = [
|
|
@@ -3980,25 +3983,25 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3980
3983
|
const listed = yield* files.listedFiles(root);
|
|
3981
3984
|
const directories = yield* workspaceDirectories(root);
|
|
3982
3985
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3983
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3986
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$34 });
|
|
3984
3987
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3985
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3988
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$34 });
|
|
3986
3989
|
return Array$1.getSomes(found);
|
|
3987
3990
|
});
|
|
3988
3991
|
// src/features/check-placement/model/nested-docs.ts
|
|
3989
3992
|
const RULE$72 = "nested-docs";
|
|
3990
|
-
const CONFIG_FILE$
|
|
3991
|
-
const SEPARATOR$
|
|
3992
|
-
const READ_CONCURRENCY$
|
|
3993
|
+
const CONFIG_FILE$8 = "vite.config.ts";
|
|
3994
|
+
const SEPARATOR$23 = "/";
|
|
3995
|
+
const READ_CONCURRENCY$33 = 64;
|
|
3993
3996
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3994
3997
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3995
3998
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
3996
3999
|
const MANIFEST$4 = "package.json";
|
|
3997
4000
|
const MISSING_RULE = "workspace-agents-md";
|
|
3998
4001
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3999
|
-
const taggedError$
|
|
4000
|
-
var RootConfigUnreadable = class extends taggedError$
|
|
4001
|
-
const isNested = (name) => String$1.includes(SEPARATOR$
|
|
4002
|
+
const taggedError$13 = Schema.TaggedError;
|
|
4003
|
+
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
4004
|
+
const isNested = (name) => String$1.includes(SEPARATOR$23)(name);
|
|
4002
4005
|
const problemFor$9 = problemInFile(RULE$72);
|
|
4003
4006
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
4004
4007
|
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.";
|
|
@@ -4027,10 +4030,10 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
|
|
|
4027
4030
|
});
|
|
4028
4031
|
const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
|
|
4029
4032
|
const files = yield* RepositoryFiles;
|
|
4030
|
-
const file = files.join(root, CONFIG_FILE$
|
|
4033
|
+
const file = files.join(root, CONFIG_FILE$8);
|
|
4031
4034
|
if (!(yield* files.exists(file))) return false;
|
|
4032
4035
|
const config = yield* Effect.tryPromise({
|
|
4033
|
-
try: () =>
|
|
4036
|
+
try: () => resolvedViteConfig(file),
|
|
4034
4037
|
catch: () => RootConfigUnreadable.make({ file })
|
|
4035
4038
|
}).pipe(Effect.option);
|
|
4036
4039
|
return pipe(config, Option.flatMap(Schema.decodeUnknownOption(RootConfig$1)), Option.isSome);
|
|
@@ -4046,7 +4049,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
4046
4049
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
4047
4050
|
workspaceAgentDocs
|
|
4048
4051
|
};
|
|
4049
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
4052
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$33 });
|
|
4050
4053
|
const missing = missingProblems({
|
|
4051
4054
|
required: workspaceAgentDocs,
|
|
4052
4055
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -4057,7 +4060,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
4057
4060
|
});
|
|
4058
4061
|
// src/features/check-placement/model/published-readme.ts
|
|
4059
4062
|
const RULE$71 = "published-readme";
|
|
4060
|
-
const READ_CONCURRENCY$
|
|
4063
|
+
const READ_CONCURRENCY$32 = 16;
|
|
4061
4064
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
4062
4065
|
const MISSING_MESSAGE$1 = "is missing. This package is published to npm, so give it an English README.md.";
|
|
4063
4066
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
@@ -4084,7 +4087,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
4084
4087
|
/** @internal */
|
|
4085
4088
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
4086
4089
|
const projects = yield* publishedProjects(root);
|
|
4087
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
4090
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$32 });
|
|
4088
4091
|
return Array$1.getSomes(found);
|
|
4089
4092
|
});
|
|
4090
4093
|
// src/features/check-placement/model/published-tests.ts
|
|
@@ -4117,20 +4120,20 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
4117
4120
|
});
|
|
4118
4121
|
// src/features/check-placement/model/root-docs.ts
|
|
4119
4122
|
const RULE$69 = "root-docs";
|
|
4120
|
-
const SEPARATOR$
|
|
4121
|
-
const FIRST$
|
|
4122
|
-
const MARKDOWN$
|
|
4123
|
+
const SEPARATOR$22 = "/";
|
|
4124
|
+
const FIRST$21 = 1;
|
|
4125
|
+
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
4123
4126
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
4124
4127
|
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.";
|
|
4125
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$
|
|
4128
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$22)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
4126
4129
|
/** @internal */
|
|
4127
4130
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
4128
4131
|
const files = yield* RepositoryFiles;
|
|
4129
4132
|
const names = yield* files.listedFiles(root);
|
|
4130
4133
|
return pipe(names, Array$1.filter(isStrayRootDoc), Array$1.map((name) => ({
|
|
4131
4134
|
file: files.join(root, name),
|
|
4132
|
-
line: FIRST$
|
|
4133
|
-
column: FIRST$
|
|
4135
|
+
line: FIRST$21,
|
|
4136
|
+
column: FIRST$21,
|
|
4134
4137
|
rule: RULE$69,
|
|
4135
4138
|
message: `${name} ${MESSAGE$12}`
|
|
4136
4139
|
})));
|
|
@@ -4138,8 +4141,8 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
4138
4141
|
// src/features/check-placement/model/root-readme.ts
|
|
4139
4142
|
const RULE$68 = "root-readme";
|
|
4140
4143
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
4141
|
-
const READ_CONCURRENCY$
|
|
4142
|
-
const START$
|
|
4144
|
+
const READ_CONCURRENCY$31 = 16;
|
|
4145
|
+
const START$33 = 0;
|
|
4143
4146
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
4144
4147
|
const RELATIVE$4 = /^\.\//u;
|
|
4145
4148
|
const MarketplacePlugin = Schema.Struct({
|
|
@@ -4175,17 +4178,17 @@ const patternFor = (plugins) => ({ directory, names }) => Array$1.findFirst(plug
|
|
|
4175
4178
|
onNone: () => ownNames(plugins, names),
|
|
4176
4179
|
onSome: () => [directory]
|
|
4177
4180
|
}), patternOf$1);
|
|
4178
|
-
const problemsIn$
|
|
4181
|
+
const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
4179
4182
|
const message = messageFor$5(workspace.directory);
|
|
4180
4183
|
const at = positionOf(source);
|
|
4181
4184
|
const pattern = patternFor(plugins)(workspace);
|
|
4182
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$68)(file, at(found.index ?? START$
|
|
4185
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$68)(file, at(found.index ?? START$33), message)));
|
|
4183
4186
|
};
|
|
4184
4187
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4185
4188
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
4186
4189
|
return pipe(text, Option.match({
|
|
4187
4190
|
onNone: () => [],
|
|
4188
|
-
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$
|
|
4191
|
+
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$21(file, source, plugins)))
|
|
4189
4192
|
}));
|
|
4190
4193
|
});
|
|
4191
4194
|
/** @internal */
|
|
@@ -4196,7 +4199,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4196
4199
|
const named = yield* namedWorkspaces(root);
|
|
4197
4200
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4198
4201
|
const plugins = yield* marketplacePlugins(root);
|
|
4199
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4202
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$31 });
|
|
4200
4203
|
return Array$1.flatten(found);
|
|
4201
4204
|
});
|
|
4202
4205
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4219,7 +4222,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4219
4222
|
const RULE$67 = "docs-mirror";
|
|
4220
4223
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4221
4224
|
const MIRROR_LIMIT = 3;
|
|
4222
|
-
const READ_CONCURRENCY$
|
|
4225
|
+
const READ_CONCURRENCY$30 = 16;
|
|
4223
4226
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4224
4227
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4225
4228
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4256,7 +4259,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4256
4259
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4257
4260
|
directory,
|
|
4258
4261
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4259
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4262
|
+
}))), { concurrency: READ_CONCURRENCY$30 });
|
|
4260
4263
|
});
|
|
4261
4264
|
/** @internal */
|
|
4262
4265
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4269,13 +4272,13 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4269
4272
|
onNone: () => [],
|
|
4270
4273
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4271
4274
|
})));
|
|
4272
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4275
|
+
}, { concurrency: READ_CONCURRENCY$30 });
|
|
4273
4276
|
return Array$1.flatten(found);
|
|
4274
4277
|
});
|
|
4275
4278
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4276
4279
|
const RULE$66 = "ignored-sources";
|
|
4277
4280
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4278
|
-
const FIRST$
|
|
4281
|
+
const FIRST$20 = 1;
|
|
4279
4282
|
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.";
|
|
4280
4283
|
/** @internal */
|
|
4281
4284
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
@@ -4283,8 +4286,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4283
4286
|
const ignored = yield* files.ignoredFiles(root, SOURCES);
|
|
4284
4287
|
return pipe(ignored, Array$1.map((file) => ({
|
|
4285
4288
|
file: files.join(root, file),
|
|
4286
|
-
line: FIRST$
|
|
4287
|
-
column: FIRST$
|
|
4289
|
+
line: FIRST$20,
|
|
4290
|
+
column: FIRST$20,
|
|
4288
4291
|
rule: RULE$66,
|
|
4289
4292
|
message: MESSAGE$11
|
|
4290
4293
|
})));
|
|
@@ -4315,8 +4318,8 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
|
|
|
4315
4318
|
return Array$1.flatten(entries);
|
|
4316
4319
|
});
|
|
4317
4320
|
// src/shared/lib/tree-sitter.ts
|
|
4318
|
-
const taggedError$
|
|
4319
|
-
var GrammarUnreadable = class extends taggedError$
|
|
4321
|
+
const taggedError$12 = Schema.TaggedError;
|
|
4322
|
+
var GrammarUnreadable = class extends taggedError$12()("GrammarUnreadable", {
|
|
4320
4323
|
grammar: Schema.String,
|
|
4321
4324
|
message: Schema.String
|
|
4322
4325
|
}) {};
|
|
@@ -4349,14 +4352,11 @@ const readTree = ({ language, source, read }) => {
|
|
|
4349
4352
|
});
|
|
4350
4353
|
};
|
|
4351
4354
|
// src/features/check-placement/model/rust-layout.ts
|
|
4352
|
-
const
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
"entities",
|
|
4358
|
-
"shared"
|
|
4359
|
-
];
|
|
4355
|
+
const CRATE_LAYERS = Option.fromUndefinedOr(rustCrate().layers);
|
|
4356
|
+
const LAYERS = pipe(CRATE_LAYERS, Option.match({
|
|
4357
|
+
onNone: () => [],
|
|
4358
|
+
onSome: ({ order }) => order
|
|
4359
|
+
}));
|
|
4360
4360
|
const RUST_FILE = /\.rs$/u;
|
|
4361
4361
|
const BINARY$1 = /^src\/bin\/[^/]+\.rs$/u;
|
|
4362
4362
|
const MANIFEST$3 = /(?:^|\/)Cargo\.toml$/u;
|
|
@@ -4364,13 +4364,10 @@ const MODULE_INDEX = "mod";
|
|
|
4364
4364
|
const CRATE_ROOTS = ["src/lib.rs", "src/main.rs"];
|
|
4365
4365
|
const OUTSIDE_ALLOWED = /^(?:build\.rs|benches\/.+)$/u;
|
|
4366
4366
|
const SEPARATE_TEST = /^tests\/.+$/u;
|
|
4367
|
-
const SLICED_LAYERS =
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
"entities",
|
|
4372
|
-
"shared"
|
|
4373
|
-
];
|
|
4367
|
+
const SLICED_LAYERS = pipe(CRATE_LAYERS, Option.match({
|
|
4368
|
+
onNone: () => [],
|
|
4369
|
+
onSome: ({ sliced = [], segmented = [] }) => [...sliced, ...segmented]
|
|
4370
|
+
}));
|
|
4374
4371
|
const LAYER_DEPTH = 1;
|
|
4375
4372
|
const SOURCE_PREFIX$1 = `src/`;
|
|
4376
4373
|
const ROOT_CRATE = "";
|
|
@@ -4411,7 +4408,7 @@ const kindOf$1 = (inner) => {
|
|
|
4411
4408
|
const isSliceIndex = (modulePath) => modulePath.length === 2 && Option.exists(Array$1.head(modulePath), (layer) => Array$1.contains(SLICED_LAYERS, layer));
|
|
4412
4409
|
// src/features/check-placement/model/rust-syntax.ts
|
|
4413
4410
|
const IGNORED_ITEMS = ["line_comment", "block_comment"];
|
|
4414
|
-
const NEXT$
|
|
4411
|
+
const NEXT$8 = 1;
|
|
4415
4412
|
const ALLOCATOR = "global_allocator";
|
|
4416
4413
|
const field = (node, name) => Option.fromNullishOr(node.childForFieldName(name));
|
|
4417
4414
|
const namedChildren = (node) => pipe(node.namedChildren, Array$1.flatMap((child) => Option.toArray(Option.fromNullishOr(child))));
|
|
@@ -4420,8 +4417,8 @@ const itemOf = (node) => ({
|
|
|
4420
4417
|
name: Option.map(field(node, "name"), (name) => name.text),
|
|
4421
4418
|
inline: Option.isSome(field(node, "body")),
|
|
4422
4419
|
visible: Array$1.some(namedChildren(node), (child) => child.type === "visibility_modifier"),
|
|
4423
|
-
line: node.startPosition.row + NEXT$
|
|
4424
|
-
column: node.startPosition.column + NEXT$
|
|
4420
|
+
line: node.startPosition.row + NEXT$8,
|
|
4421
|
+
column: node.startPosition.column + NEXT$8
|
|
4425
4422
|
});
|
|
4426
4423
|
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)));
|
|
4427
4424
|
const readRustFile = (root) => ({
|
|
@@ -12866,8 +12863,8 @@ var english_verbs_default = [
|
|
|
12866
12863
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12867
12864
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12868
12865
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12869
|
-
const SEPARATOR$
|
|
12870
|
-
const NEXT$
|
|
12866
|
+
const SEPARATOR$20 = "/";
|
|
12867
|
+
const NEXT$7 = 1;
|
|
12871
12868
|
const WORD_SEPARATOR$1 = "-";
|
|
12872
12869
|
const MINIMUM_WORDS = 2;
|
|
12873
12870
|
const FEATURES$1 = "src/features/";
|
|
@@ -12892,34 +12889,29 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12892
12889
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12893
12890
|
};
|
|
12894
12891
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12895
|
-
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$
|
|
12896
|
-
const SLICE_LAYERS = [
|
|
12897
|
-
"features",
|
|
12898
|
-
"entities",
|
|
12899
|
-
"widgets",
|
|
12900
|
-
"pages"
|
|
12901
|
-
];
|
|
12892
|
+
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$20))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$20}${FEATURES$1}${slice}`));
|
|
12893
|
+
const SLICE_LAYERS = pipe(Option.fromUndefinedOr(workspace().layers), Option.flatMap(({ sliced }) => Option.fromUndefinedOr(sliced)), Option.getOrElse(() => []));
|
|
12902
12894
|
const SLICE_DEPTHS = [3, 4];
|
|
12903
|
-
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
12895
|
+
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$20);
|
|
12904
12896
|
const isInSliceLayer = (parts) => {
|
|
12905
12897
|
const [source, layer] = parts;
|
|
12906
|
-
return `${source}${SEPARATOR$
|
|
12898
|
+
return `${source}${SEPARATOR$20}` === SOURCE$2 && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12907
12899
|
};
|
|
12908
12900
|
const indexedSlice = (owned) => {
|
|
12909
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12910
|
-
const depth = parts.length - NEXT$
|
|
12911
|
-
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$
|
|
12901
|
+
const parts = String$1.split(owned.inner, SEPARATOR$20);
|
|
12902
|
+
const depth = parts.length - NEXT$7;
|
|
12903
|
+
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$20}${pathPrefix(parts, depth)}`));
|
|
12912
12904
|
};
|
|
12913
12905
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12914
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12915
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12916
|
-
const isSegmentFolder = (depth) => parts.length > depth + NEXT$
|
|
12917
|
-
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$
|
|
12906
|
+
const parts = String$1.split(inner, SEPARATOR$20);
|
|
12907
|
+
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$20}${pathPrefix(parts, depth)}`);
|
|
12908
|
+
const isSegmentFolder = (depth) => parts.length > depth + NEXT$7 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
|
|
12909
|
+
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$20}${pathPrefix(parts, depth + NEXT$7)}`));
|
|
12918
12910
|
};
|
|
12919
12911
|
const deployNamed = ({ workspace, inner }) => {
|
|
12920
12912
|
if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
|
|
12921
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12922
|
-
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$
|
|
12913
|
+
const segments = String$1.split(inner, SEPARATOR$20);
|
|
12914
|
+
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$20}${Array$1.join(Array$1.take(segments, index + NEXT$7), SEPARATOR$20)}`));
|
|
12923
12915
|
};
|
|
12924
12916
|
/** @internal */
|
|
12925
12917
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12962,7 +12954,7 @@ const LAYER_ITEMS = [
|
|
|
12962
12954
|
"attribute_item",
|
|
12963
12955
|
"inner_attribute_item"
|
|
12964
12956
|
];
|
|
12965
|
-
const READ_CONCURRENCY$
|
|
12957
|
+
const READ_CONCURRENCY$29 = 64;
|
|
12966
12958
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12967
12959
|
const NONE$4 = [];
|
|
12968
12960
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
@@ -13038,16 +13030,16 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
13038
13030
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
13039
13031
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
13040
13032
|
const parse = parsedWith(language);
|
|
13041
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
13033
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$29 });
|
|
13042
13034
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
13043
13035
|
});
|
|
13044
13036
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
13045
13037
|
const RULE$65 = "shadcn-ui-alias";
|
|
13046
|
-
const FIRST$
|
|
13038
|
+
const FIRST$19 = 1;
|
|
13047
13039
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
13048
13040
|
file,
|
|
13049
|
-
line: FIRST$
|
|
13050
|
-
column: FIRST$
|
|
13041
|
+
line: FIRST$19,
|
|
13042
|
+
column: FIRST$19,
|
|
13051
13043
|
rule: RULE$65,
|
|
13052
13044
|
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/*".`
|
|
13053
13045
|
});
|
|
@@ -13110,10 +13102,10 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
13110
13102
|
const BIN = "bin";
|
|
13111
13103
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
13112
13104
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
13113
|
-
const SEPARATOR$
|
|
13105
|
+
const SEPARATOR$19 = "/";
|
|
13114
13106
|
const CURRENT = "./";
|
|
13115
|
-
const READ_CONCURRENCY$
|
|
13116
|
-
const FIRST$
|
|
13107
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13108
|
+
const FIRST$18 = 1;
|
|
13117
13109
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
13118
13110
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
13119
13111
|
const COMMAND_FILE$1 = /^bin\/[^/]+$/u;
|
|
@@ -13148,16 +13140,16 @@ const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
|
13148
13140
|
const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
13149
13141
|
const files = yield* RepositoryFiles;
|
|
13150
13142
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
13151
|
-
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$
|
|
13143
|
+
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$19}${name}`), Array$1.filter(isCommand));
|
|
13152
13144
|
});
|
|
13153
13145
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
13154
13146
|
const files = yield* RepositoryFiles;
|
|
13155
13147
|
const listed = yield* files.listedFiles(root);
|
|
13156
13148
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
13157
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
13149
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$28 });
|
|
13158
13150
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
13159
13151
|
});
|
|
13160
|
-
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
13152
|
+
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$19));
|
|
13161
13153
|
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 }) => ({
|
|
13162
13154
|
file,
|
|
13163
13155
|
...positionOf(source)(start),
|
|
@@ -13165,7 +13157,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.
|
|
|
13165
13157
|
message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
|
|
13166
13158
|
})));
|
|
13167
13159
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap(stringsIn), Array$1.flatMap(runsIn));
|
|
13168
|
-
const problemsIn$
|
|
13160
|
+
const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
13169
13161
|
const files = yield* RepositoryFiles;
|
|
13170
13162
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13171
13163
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -13181,8 +13173,8 @@ const problemsIn$21 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13181
13173
|
const isRun = (path) => Array$1.contains(runPaths, path) || Array$1.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
|
|
13182
13174
|
const unrun = pipe(commands, Array$1.filter((path) => !isRun(path)), Array$1.map((path) => ({
|
|
13183
13175
|
file: files.join(root, directory, path),
|
|
13184
|
-
line: FIRST$
|
|
13185
|
-
column: FIRST$
|
|
13176
|
+
line: FIRST$18,
|
|
13177
|
+
column: FIRST$18,
|
|
13186
13178
|
rule: UNRUN,
|
|
13187
13179
|
message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
|
|
13188
13180
|
})));
|
|
@@ -13194,8 +13186,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
13194
13186
|
const isDirectory = yield* files.isDirectory(file);
|
|
13195
13187
|
return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
|
|
13196
13188
|
file,
|
|
13197
|
-
line: FIRST$
|
|
13198
|
-
column: FIRST$
|
|
13189
|
+
line: FIRST$18,
|
|
13190
|
+
column: FIRST$18,
|
|
13199
13191
|
rule: SCRIPTS,
|
|
13200
13192
|
message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
|
|
13201
13193
|
})));
|
|
@@ -13204,11 +13196,11 @@ const isCommandFile = (path) => isCommand(path) || COMMAND_FILE$1.test(path) &&
|
|
|
13204
13196
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
13205
13197
|
const files = yield* RepositoryFiles;
|
|
13206
13198
|
const listed = yield* files.listedFiles(root);
|
|
13207
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
13208
|
-
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$
|
|
13199
|
+
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$19}`);
|
|
13200
|
+
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$19}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
|
|
13209
13201
|
file: files.join(root, file),
|
|
13210
|
-
line: FIRST$
|
|
13211
|
-
column: FIRST$
|
|
13202
|
+
line: FIRST$18,
|
|
13203
|
+
column: FIRST$18,
|
|
13212
13204
|
rule: CODE_IN_BIN,
|
|
13213
13205
|
message: `${file} is in ${BIN}/ but is not a command. Put only commands at ${BIN}/<name>.ts and the code that they share in the package own source, in a slice under src/, so that fallow judges it as ordinary code instead of as an entry point that is never reported unused.`
|
|
13214
13206
|
})));
|
|
@@ -13217,9 +13209,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13217
13209
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13218
13210
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13219
13211
|
const workflows = yield* workflowText(root);
|
|
13220
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$
|
|
13221
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13222
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13212
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$28 });
|
|
13213
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$28 });
|
|
13214
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$28 });
|
|
13223
13215
|
return [
|
|
13224
13216
|
...Array$1.flatten(found),
|
|
13225
13217
|
...Array$1.getSomes(scripts),
|
|
@@ -13227,14 +13219,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13227
13219
|
];
|
|
13228
13220
|
});
|
|
13229
13221
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13230
|
-
const START$
|
|
13222
|
+
const START$32 = 0;
|
|
13231
13223
|
const QUOTES = ["\"", "'"];
|
|
13232
13224
|
const firstIndex = (source, needles) => {
|
|
13233
13225
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13234
13226
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13235
13227
|
};
|
|
13236
13228
|
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13237
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$
|
|
13229
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$32));
|
|
13238
13230
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13239
13231
|
const MEMBER_LISTS = [
|
|
13240
13232
|
"members",
|
|
@@ -13250,14 +13242,14 @@ const WORKSPACE = "workspace";
|
|
|
13250
13242
|
const PATCH = "patch";
|
|
13251
13243
|
const PATCH_DEPTH = 2;
|
|
13252
13244
|
const WORKSPACE_DEPTH = 1;
|
|
13253
|
-
const START$
|
|
13245
|
+
const START$31 = 0;
|
|
13254
13246
|
const WILDCARD$4 = /[*?[]/u;
|
|
13255
13247
|
const KEY_SEPARATOR$1 = ".";
|
|
13256
13248
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
13257
13249
|
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13258
13250
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
13259
|
-
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$
|
|
13260
|
-
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$
|
|
13251
|
+
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$31).pipe(Option.exists((name) => name === PATCH));
|
|
13252
|
+
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$31).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
|
|
13261
13253
|
const namedPaths = (trail, key, value) => {
|
|
13262
13254
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR$1);
|
|
13263
13255
|
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
@@ -13281,7 +13273,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
13281
13273
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
13282
13274
|
const WRAP_OFFSET$2 = 1;
|
|
13283
13275
|
const WILDCARD$3 = /[*?[{]/u;
|
|
13284
|
-
const SEPARATOR$
|
|
13276
|
+
const SEPARATOR$18 = "/";
|
|
13285
13277
|
const RELATIVE$3 = ".";
|
|
13286
13278
|
const JSON_EXTENSION = ".json";
|
|
13287
13279
|
const isObject = (node) => Predicate$1.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
@@ -13289,7 +13281,7 @@ const firstObject = (node) => {
|
|
|
13289
13281
|
if (isObject(node)) return Option.some(node);
|
|
13290
13282
|
return pipe(childrenOf$4(node), Array$1.findFirst(firstObject));
|
|
13291
13283
|
};
|
|
13292
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$
|
|
13284
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$18), Array$1.takeWhile((segment) => !WILDCARD$3.test(segment)), Array$1.join(SEPARATOR$18));
|
|
13293
13285
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
13294
13286
|
field: name,
|
|
13295
13287
|
text,
|
|
@@ -13321,14 +13313,14 @@ const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
|
13321
13313
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13322
13314
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13323
13315
|
const OUTSIDE = "..";
|
|
13324
|
-
const READ_CONCURRENCY$
|
|
13316
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13325
13317
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13326
13318
|
const files = yield* RepositoryFiles;
|
|
13327
13319
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
13328
13320
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13329
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13321
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$27 });
|
|
13330
13322
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13331
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13323
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$27 });
|
|
13332
13324
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13333
13325
|
});
|
|
13334
13326
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
@@ -13342,13 +13334,13 @@ const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
|
13342
13334
|
if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
|
|
13343
13335
|
return yield* tsconfigMentions(file, source);
|
|
13344
13336
|
});
|
|
13345
|
-
const problemsIn$
|
|
13337
|
+
const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
13346
13338
|
const files = yield* RepositoryFiles;
|
|
13347
13339
|
const file = files.join(root, name);
|
|
13348
13340
|
const source = yield* files.readFile(file);
|
|
13349
13341
|
if (Option.isNone(source)) return [];
|
|
13350
13342
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13351
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13343
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$1(root, file, mention), { concurrency: READ_CONCURRENCY$27 });
|
|
13352
13344
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13353
13345
|
});
|
|
13354
13346
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13368,7 +13360,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13368
13360
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13369
13361
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13370
13362
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13371
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$
|
|
13363
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$27 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13372
13364
|
return [...Array$1.flatten(found), ...patterns];
|
|
13373
13365
|
});
|
|
13374
13366
|
// src/features/check-repository-layout/model/crates.ts
|
|
@@ -13376,14 +13368,14 @@ const RULE$63 = "unverified-crate";
|
|
|
13376
13368
|
const VERSION_RULE = "release-version";
|
|
13377
13369
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13378
13370
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13379
|
-
const CONFIG_FILE$
|
|
13380
|
-
const SEPARATOR$
|
|
13381
|
-
const FIRST$
|
|
13382
|
-
const READ_CONCURRENCY$
|
|
13371
|
+
const CONFIG_FILE$7 = "vite.config.ts";
|
|
13372
|
+
const SEPARATOR$17 = "/";
|
|
13373
|
+
const FIRST$17 = 1;
|
|
13374
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13383
13375
|
const problemFor$6 = (crate, message) => ({
|
|
13384
13376
|
file: crate.manifest,
|
|
13385
|
-
line: FIRST$
|
|
13386
|
-
column: FIRST$
|
|
13377
|
+
line: FIRST$17,
|
|
13378
|
+
column: FIRST$17,
|
|
13387
13379
|
rule: RULE$63,
|
|
13388
13380
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13389
13381
|
});
|
|
@@ -13391,21 +13383,21 @@ const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories
|
|
|
13391
13383
|
const files = yield* RepositoryFiles;
|
|
13392
13384
|
const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
|
|
13393
13385
|
if (Option.isNone(workspace)) return Option.some(problemFor$6(crate, "is outside every workspace package"));
|
|
13394
|
-
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$
|
|
13395
|
-
return Option.some(problemFor$6(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$
|
|
13386
|
+
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$7))) return Option.none();
|
|
13387
|
+
return Option.some(problemFor$6(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$7} has no verify task`));
|
|
13396
13388
|
});
|
|
13397
13389
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
13398
13390
|
const files = yield* RepositoryFiles;
|
|
13399
13391
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
13400
|
-
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$
|
|
13392
|
+
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$17))), Array$1.contains(directory))));
|
|
13401
13393
|
if (Option.isNone(workspace)) return Option.none();
|
|
13402
13394
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
13403
13395
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
13404
13396
|
if (Option.isNone(version) || version.value === crate.version) return Option.none();
|
|
13405
13397
|
return Option.some({
|
|
13406
13398
|
file: crate.manifest,
|
|
13407
|
-
line: FIRST$
|
|
13408
|
-
column: FIRST$
|
|
13399
|
+
line: FIRST$17,
|
|
13400
|
+
column: FIRST$17,
|
|
13409
13401
|
rule: VERSION_RULE,
|
|
13410
13402
|
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.`
|
|
13411
13403
|
});
|
|
@@ -13417,9 +13409,9 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13417
13409
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13418
13410
|
const directories = yield* workspaceDirectories(root);
|
|
13419
13411
|
const crates = yield* cratesIn(root);
|
|
13420
|
-
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$
|
|
13412
|
+
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$7)));
|
|
13421
13413
|
const unverified = (crate) => problemIn$3(root, directories, crate).pipe(Effect.when(notAtRoot), Effect.map(Option.flatten));
|
|
13422
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13414
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([unverified(crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$26 });
|
|
13423
13415
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13424
13416
|
});
|
|
13425
13417
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
@@ -13441,7 +13433,7 @@ const NEGATED = "!";
|
|
|
13441
13433
|
const ROOT_WORKSPACE = ".";
|
|
13442
13434
|
const WRAP_OFFSET$1 = 1;
|
|
13443
13435
|
const NO_OFFSET$1 = 0;
|
|
13444
|
-
const READ_CONCURRENCY$
|
|
13436
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13445
13437
|
const MESSAGE$10 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
|
|
13446
13438
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13447
13439
|
const whole = (program) => [program];
|
|
@@ -13488,7 +13480,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
13488
13480
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
13489
13481
|
return pipe(kind.sections(parsed.program), Array$1.flatMap(patternsIn(kind.keys)), Array$1.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
13490
13482
|
});
|
|
13491
|
-
const problemsIn$
|
|
13483
|
+
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
13492
13484
|
const { root, file, kind, workspaces, entries } = request;
|
|
13493
13485
|
const files = yield* RepositoryFiles;
|
|
13494
13486
|
const path = files.join(root, file);
|
|
@@ -13530,13 +13522,13 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13530
13522
|
}];
|
|
13531
13523
|
return [];
|
|
13532
13524
|
}));
|
|
13533
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
13525
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
|
|
13534
13526
|
root,
|
|
13535
13527
|
file,
|
|
13536
13528
|
kind,
|
|
13537
13529
|
workspaces,
|
|
13538
13530
|
entries
|
|
13539
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13531
|
+
}), { concurrency: READ_CONCURRENCY$25 });
|
|
13540
13532
|
return Array$1.flatten(found);
|
|
13541
13533
|
});
|
|
13542
13534
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
@@ -13551,9 +13543,9 @@ const VITE_CONFIG = /(?:^|\/)vite\.config\.[cm]?ts$/u;
|
|
|
13551
13543
|
const FALLOW_SECTION = "fallow";
|
|
13552
13544
|
const NO_OFFSET = 0;
|
|
13553
13545
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13554
|
-
const SEPARATOR$
|
|
13546
|
+
const SEPARATOR$16 = "/";
|
|
13555
13547
|
const WRAP_OFFSET = 1;
|
|
13556
|
-
const READ_CONCURRENCY$
|
|
13548
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13557
13549
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13558
13550
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13559
13551
|
const entryPatternsIn = (node) => {
|
|
@@ -13563,7 +13555,7 @@ const entryPatternsIn = (node) => {
|
|
|
13563
13555
|
})));
|
|
13564
13556
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13565
13557
|
};
|
|
13566
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
13558
|
+
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$16}`)(text))) || String$1.includes(SEPARATOR$16)(text) && !WILDCARD$2.test(text);
|
|
13567
13559
|
const sourceOf$1 = (file, text) => {
|
|
13568
13560
|
if (VITE_CONFIG.test(file)) return {
|
|
13569
13561
|
code: text,
|
|
@@ -13576,7 +13568,7 @@ const sourceOf$1 = (file, text) => {
|
|
|
13576
13568
|
sections: (program) => [program]
|
|
13577
13569
|
};
|
|
13578
13570
|
};
|
|
13579
|
-
const problemsIn$
|
|
13571
|
+
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13580
13572
|
const files = yield* RepositoryFiles;
|
|
13581
13573
|
const path = files.join(root, file);
|
|
13582
13574
|
const text = yield* files.readFile(path);
|
|
@@ -13594,47 +13586,47 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13594
13586
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13595
13587
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13596
13588
|
const directories = yield* workspaceDirectories(root);
|
|
13597
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file) || VITE_CONFIG.test(file))), (file) => problemsIn$
|
|
13589
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file) || VITE_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$24 });
|
|
13598
13590
|
return Array$1.flatten(found);
|
|
13599
13591
|
});
|
|
13600
13592
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13601
13593
|
const RULE$60 = "root-workspace-path";
|
|
13602
|
-
const CONFIG_FILE$
|
|
13594
|
+
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13603
13595
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13604
13596
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
13605
|
-
const FIRST$
|
|
13606
|
-
const NEXT$
|
|
13597
|
+
const FIRST$16 = 0;
|
|
13598
|
+
const NEXT$6 = 1;
|
|
13607
13599
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
13608
13600
|
const mentions = (directory) => (text) => {
|
|
13609
13601
|
const parts = String$1.split(text, directory);
|
|
13610
|
-
return pipe(Array$1.drop(parts, NEXT$
|
|
13602
|
+
return pipe(Array$1.drop(parts, NEXT$6), Array$1.some((after, index) => {
|
|
13611
13603
|
const before = parts[index] ?? "";
|
|
13612
|
-
const previous = String$1.slice(before.length - NEXT$
|
|
13613
|
-
const following = String$1.slice(FIRST$
|
|
13604
|
+
const previous = String$1.slice(before.length - NEXT$6)(before);
|
|
13605
|
+
const following = String$1.slice(FIRST$16, NEXT$6)(after);
|
|
13614
13606
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
13615
13607
|
}));
|
|
13616
13608
|
};
|
|
13617
|
-
const problemsIn$
|
|
13609
|
+
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13618
13610
|
file,
|
|
13619
13611
|
...positionOf(source)(found.start),
|
|
13620
13612
|
rule: RULE$60,
|
|
13621
|
-
message: `${directory} is a workspace. The root ${CONFIG_FILE$
|
|
13613
|
+
message: `${directory} is a workspace. The root ${CONFIG_FILE$6} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$6}: msch.lint, msch.devDependencies or its verify task.`
|
|
13622
13614
|
})));
|
|
13623
13615
|
/** @internal */
|
|
13624
13616
|
const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
|
|
13625
13617
|
const files = yield* RepositoryFiles;
|
|
13626
|
-
const file = files.join(root, CONFIG_FILE$
|
|
13618
|
+
const file = files.join(root, CONFIG_FILE$6);
|
|
13627
13619
|
const source = yield* files.readFile(file);
|
|
13628
13620
|
if (Option.isNone(source)) return [];
|
|
13629
13621
|
const directories = yield* workspaceDirectories(root);
|
|
13630
13622
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
13631
|
-
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$
|
|
13623
|
+
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13632
13624
|
});
|
|
13633
13625
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13634
13626
|
const RULE$59 = "hidden-verify";
|
|
13635
|
-
const CONFIG_FILE$
|
|
13636
|
-
const FIRST$
|
|
13637
|
-
const READ_CONCURRENCY$
|
|
13627
|
+
const CONFIG_FILE$5 = "vite.config.ts";
|
|
13628
|
+
const FIRST$15 = 1;
|
|
13629
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13638
13630
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13639
13631
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13640
13632
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13643,21 +13635,21 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13643
13635
|
const verified = yield* hasVerifyTask(file);
|
|
13644
13636
|
return Option.some({
|
|
13645
13637
|
file,
|
|
13646
|
-
line: FIRST$
|
|
13647
|
-
column: FIRST$
|
|
13638
|
+
line: FIRST$15,
|
|
13639
|
+
column: FIRST$15,
|
|
13648
13640
|
rule: RULE$59,
|
|
13649
|
-
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$
|
|
13641
|
+
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$5}. The root verify reads ${CONFIG_FILE$5} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$5}.`
|
|
13650
13642
|
}).pipe(Option.filter(() => verified));
|
|
13651
13643
|
});
|
|
13652
13644
|
/** @internal */
|
|
13653
13645
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13654
13646
|
const directories = yield* workspaceDirectories(root);
|
|
13655
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13647
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$23 });
|
|
13656
13648
|
return Array$1.getSomes(found);
|
|
13657
13649
|
});
|
|
13658
13650
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13659
13651
|
const RULE$58 = "shared-uncached-task";
|
|
13660
|
-
const READ_CONCURRENCY$
|
|
13652
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13661
13653
|
const SHARED = 2;
|
|
13662
13654
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13663
13655
|
const UncachedTask = Schema.Struct({
|
|
@@ -13706,12 +13698,12 @@ const problemsOf$3 = (definitions) => {
|
|
|
13706
13698
|
/** @internal */
|
|
13707
13699
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13708
13700
|
const directories = yield* workspaceDirectories(root);
|
|
13709
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13701
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$22 });
|
|
13710
13702
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13711
13703
|
});
|
|
13712
13704
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13713
13705
|
const RULE$57 = "tested-verify";
|
|
13714
|
-
const READ_CONCURRENCY$
|
|
13706
|
+
const READ_CONCURRENCY$21 = 8;
|
|
13715
13707
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13716
13708
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13717
13709
|
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
@@ -13734,7 +13726,7 @@ const testedEdges = (tasks) => {
|
|
|
13734
13726
|
const byName = new Map(pipe(tasks, Array$1.map(named$1)));
|
|
13735
13727
|
return edgesFrom(byName, /* @__PURE__ */ new Set())(TASK_NAMES.verify);
|
|
13736
13728
|
};
|
|
13737
|
-
const problemsIn$
|
|
13729
|
+
const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directory) {
|
|
13738
13730
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13739
13731
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13740
13732
|
file,
|
|
@@ -13746,12 +13738,12 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13746
13738
|
/** @internal */
|
|
13747
13739
|
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13748
13740
|
const directories = yield* workspaceDirectories(root);
|
|
13749
|
-
const found = yield* Effect.forEach(directories, (directory) => problemsIn$
|
|
13741
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$21 });
|
|
13750
13742
|
return Array$1.flatten(found);
|
|
13751
13743
|
});
|
|
13752
13744
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13753
13745
|
const RULE$56 = "unlocked-task";
|
|
13754
|
-
const READ_CONCURRENCY$
|
|
13746
|
+
const READ_CONCURRENCY$20 = 8;
|
|
13755
13747
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13756
13748
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13757
13749
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -13768,7 +13760,7 @@ const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tra
|
|
|
13768
13760
|
/** @internal */
|
|
13769
13761
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13770
13762
|
const directories = yield* workspaceDirectories(root);
|
|
13771
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13763
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$20 });
|
|
13772
13764
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13773
13765
|
});
|
|
13774
13766
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13798,14 +13790,14 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13798
13790
|
});
|
|
13799
13791
|
// src/shared/lib/package-name.ts
|
|
13800
13792
|
const SCOPE$2 = "@";
|
|
13801
|
-
const SEPARATOR$
|
|
13793
|
+
const SEPARATOR$15 = "/";
|
|
13802
13794
|
const SCOPED_SEGMENTS = 2;
|
|
13803
13795
|
const PLAIN_SEGMENTS = 1;
|
|
13804
13796
|
const segmentCount = (specifier) => {
|
|
13805
13797
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13806
13798
|
return PLAIN_SEGMENTS;
|
|
13807
13799
|
};
|
|
13808
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13800
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$15), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$15));
|
|
13809
13801
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13810
13802
|
const RELATIVE$2 = /^\.\.?(?:\/|$)/u;
|
|
13811
13803
|
const SUBPATH_IMPORT$1 = "#";
|
|
@@ -13962,11 +13954,11 @@ const LISTED_LARGEST = 5;
|
|
|
13962
13954
|
const SIZE_CONCURRENCY = 32;
|
|
13963
13955
|
const MEGABYTE = 1e6;
|
|
13964
13956
|
const MEGABYTE_DIGITS = 1;
|
|
13965
|
-
const START$
|
|
13957
|
+
const START$30 = 0;
|
|
13966
13958
|
const SINGLE_ENTRY = 1;
|
|
13967
13959
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13968
13960
|
const usageHint = (dependency, entryCount) => {
|
|
13969
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13961
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$30 && dependency.entries.length < entryCount)) return "";
|
|
13970
13962
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13971
13963
|
};
|
|
13972
13964
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13975,7 +13967,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13975
13967
|
const { workspace, total } = overrun;
|
|
13976
13968
|
const config = yield* files.readFile(workspace.configFile);
|
|
13977
13969
|
const source = Option.getOrElse(config, () => "");
|
|
13978
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13970
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$30);
|
|
13979
13971
|
return {
|
|
13980
13972
|
file: workspace.configFile,
|
|
13981
13973
|
...positionOf(source)(index),
|
|
@@ -13992,7 +13984,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13992
13984
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13993
13985
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13994
13986
|
const sizes = HashMap.fromIterable(measured);
|
|
13995
|
-
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$
|
|
13987
|
+
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$30))), Number$1.sumAll);
|
|
13996
13988
|
return {
|
|
13997
13989
|
closures,
|
|
13998
13990
|
sizeOf,
|
|
@@ -14025,11 +14017,11 @@ const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(publishe
|
|
|
14025
14017
|
})];
|
|
14026
14018
|
});
|
|
14027
14019
|
const stackProblems = (file, source, dependencies) => {
|
|
14028
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
14020
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$30);
|
|
14029
14021
|
const rest = String$1.slice(section)(source);
|
|
14030
14022
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
14031
14023
|
file,
|
|
14032
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14024
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$30)),
|
|
14033
14025
|
rule: STACK_DEPENDENCY,
|
|
14034
14026
|
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.`
|
|
14035
14027
|
})));
|
|
@@ -14082,8 +14074,8 @@ const RULE$55 = "migration-order";
|
|
|
14082
14074
|
const SNAPSHOT = "snapshot.json";
|
|
14083
14075
|
const MIGRATION = "migration.sql";
|
|
14084
14076
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
14085
|
-
const FIRST$
|
|
14086
|
-
const READ_CONCURRENCY$
|
|
14077
|
+
const FIRST$14 = 1;
|
|
14078
|
+
const READ_CONCURRENCY$19 = 16;
|
|
14087
14079
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
14088
14080
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
14089
14081
|
const files = yield* RepositoryFiles;
|
|
@@ -14110,8 +14102,8 @@ const latestOf = (migrations) => pipe(migrations, Array$1.filter(({ applied }) =
|
|
|
14110
14102
|
const isBefore = (later) => (migration) => !migration.applied && Order.isLessThan(String$1.Order)(migration.folder, later.folder);
|
|
14111
14103
|
const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migrations), Option.map((latest) => pipe(migrations, Array$1.filter(isBefore(latest)), Array$1.map(({ file, folder }) => ({
|
|
14112
14104
|
file: join(root, file),
|
|
14113
|
-
line: FIRST$
|
|
14114
|
-
column: FIRST$
|
|
14105
|
+
line: FIRST$14,
|
|
14106
|
+
column: FIRST$14,
|
|
14115
14107
|
rule: RULE$55,
|
|
14116
14108
|
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}.`
|
|
14117
14109
|
})))), Option.getOrElse(() => []));
|
|
@@ -14123,7 +14115,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
14123
14115
|
if (Option.isNone(found)) return [];
|
|
14124
14116
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
14125
14117
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
14126
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
14118
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$19 });
|
|
14127
14119
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
14128
14120
|
});
|
|
14129
14121
|
// src/shared/lib/bundle-error.ts
|
|
@@ -14144,7 +14136,7 @@ const IMPORT_DECLARATION = /import\s+(?<kind>type\s+)?\{(?<names>[^}]*)\}\s*from
|
|
|
14144
14136
|
const TYPE_PREFIX = /^type\s+/u;
|
|
14145
14137
|
const ALIAS$1 = /\s+as\s+\S+$/u;
|
|
14146
14138
|
const VENDOR_FILE = /^(?<name>[\w.-]+)\.js$/u;
|
|
14147
|
-
const SEPARATOR$
|
|
14139
|
+
const SEPARATOR$14 = "/";
|
|
14148
14140
|
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, "")));
|
|
14149
14141
|
const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option.filter((groups) => !Predicate$1.isString(groups["kind"])), Option.flatMap((groups) => Option.all({
|
|
14150
14142
|
specifier: Option.fromNullishOr(groups["specifier"]),
|
|
@@ -14157,7 +14149,7 @@ const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option
|
|
|
14157
14149
|
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)));
|
|
14158
14150
|
const nameIn = (rest) => pipe(Option.fromNullishOr(VENDOR_FILE.exec(rest)), Option.flatMapNullishOr(({ groups }) => groups), Option.flatMapNullishOr((groups) => groups["name"]));
|
|
14159
14151
|
/** @internal */
|
|
14160
|
-
const vendorPackageOf = (vendor, file) => pipe(file, Option.liftPredicate(String$1.startsWith(`${vendor}${SEPARATOR$
|
|
14152
|
+
const vendorPackageOf = (vendor, file) => pipe(file, Option.liftPredicate(String$1.startsWith(`${vendor}${SEPARATOR$14}`)), Option.map(String$1.slice(vendor.length + 1)), Option.flatMap(nameIn), Option.toArray);
|
|
14161
14153
|
/** @internal */
|
|
14162
14154
|
const entrySource = (name, names) => {
|
|
14163
14155
|
return `export { ${pipe(Array$1.sort(Array$1.dedupe(names), Order.String), Array$1.join(", "))} } from "${name}";\n`;
|
|
@@ -14442,8 +14434,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
|
|
|
14442
14434
|
const builtins = new Set(builtinModules);
|
|
14443
14435
|
const always = () => true;
|
|
14444
14436
|
const never = () => false;
|
|
14445
|
-
const taggedError$
|
|
14446
|
-
var BundleFailed = class extends taggedError$
|
|
14437
|
+
const taggedError$11 = Schema.TaggedError;
|
|
14438
|
+
var BundleFailed = class extends taggedError$11()("BundleFailed", { detail: Schema.String }) {};
|
|
14447
14439
|
const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
|
|
14448
14440
|
const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
|
|
14449
14441
|
const isBuiltin = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
|
|
@@ -14568,7 +14560,7 @@ const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(dev
|
|
|
14568
14560
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14569
14561
|
const RULE$52 = "optional-peer";
|
|
14570
14562
|
const REQUIRED_RULE = "required-peer";
|
|
14571
|
-
const START$
|
|
14563
|
+
const START$29 = 0;
|
|
14572
14564
|
const SINGLE$3 = 1;
|
|
14573
14565
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
14574
14566
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
@@ -14576,9 +14568,9 @@ const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, na
|
|
|
14576
14568
|
const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
|
|
14577
14569
|
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
14578
14570
|
const positionIn = (located, key, name) => {
|
|
14579
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
14571
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$29);
|
|
14580
14572
|
const rest = String$1.slice(section)(located.source);
|
|
14581
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14573
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$29));
|
|
14582
14574
|
};
|
|
14583
14575
|
const problemFor$3 = (located, name, importers) => ({
|
|
14584
14576
|
file: located.file,
|
|
@@ -14598,7 +14590,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
|
14598
14590
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
14599
14591
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
14600
14592
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
14601
|
-
if (!(importers.length > START$
|
|
14593
|
+
if (!(importers.length > START$29 && importers.length < libraries.length) || neededByBin) return [];
|
|
14602
14594
|
return [problemFor$3(located, name, importers)];
|
|
14603
14595
|
}));
|
|
14604
14596
|
};
|
|
@@ -14621,8 +14613,8 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14621
14613
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14622
14614
|
const RULE$51 = "side-effects";
|
|
14623
14615
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14624
|
-
const START$
|
|
14625
|
-
const FIRST$
|
|
14616
|
+
const START$28 = 0;
|
|
14617
|
+
const FIRST$13 = 1;
|
|
14626
14618
|
const LISTED_PACKAGES = 4;
|
|
14627
14619
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
14628
14620
|
const EXPORTS_KEY = "\"exports\"";
|
|
@@ -14645,7 +14637,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
14645
14637
|
label: entry.label,
|
|
14646
14638
|
member,
|
|
14647
14639
|
...extra
|
|
14648
|
-
}, ({ modules }) => modules > START$
|
|
14640
|
+
}, ({ modules }) => modules > START$28);
|
|
14649
14641
|
});
|
|
14650
14642
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
14651
14643
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -14662,12 +14654,12 @@ const importsOf$1 = (packages) => Array$1.match(packages, {
|
|
|
14662
14654
|
onNonEmpty: (names) => ` and imports ${listed(names)}`
|
|
14663
14655
|
});
|
|
14664
14656
|
const othersOf = (total) => {
|
|
14665
|
-
if (total <= FIRST$
|
|
14666
|
-
return ` The same happens for ${String(total - FIRST$
|
|
14657
|
+
if (total <= FIRST$13) return "";
|
|
14658
|
+
return ` The same happens for ${String(total - FIRST$13)} other exports.`;
|
|
14667
14659
|
};
|
|
14668
14660
|
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.`;
|
|
14669
14661
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14670
|
-
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$
|
|
14662
|
+
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$28));
|
|
14671
14663
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14672
14664
|
file,
|
|
14673
14665
|
...positionOf(source)(keyIndex$1(source)),
|
|
@@ -14676,8 +14668,8 @@ const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$
|
|
|
14676
14668
|
})), Option.toArray);
|
|
14677
14669
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14678
14670
|
const RULE$50 = "top-level-effect";
|
|
14679
|
-
const CODE
|
|
14680
|
-
const READ_CONCURRENCY$
|
|
14671
|
+
const CODE = /\.[cm]?[jt]sx?$/u;
|
|
14672
|
+
const READ_CONCURRENCY$18 = 16;
|
|
14681
14673
|
const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
|
|
14682
14674
|
const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
|
|
14683
14675
|
const isEffect = (statement) => {
|
|
@@ -14688,7 +14680,7 @@ const messageOf$5 = (statement) => {
|
|
|
14688
14680
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
14689
14681
|
return STATEMENT_MESSAGE;
|
|
14690
14682
|
};
|
|
14691
|
-
const problemsIn$
|
|
14683
|
+
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14692
14684
|
const retained = api.createSourceFile(file, source);
|
|
14693
14685
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14694
14686
|
rule: RULE$50,
|
|
@@ -14703,13 +14695,13 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14703
14695
|
const compiler = yield* typeScriptCompiler;
|
|
14704
14696
|
const names = yield* files.ownedFiles(root);
|
|
14705
14697
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14706
|
-
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE
|
|
14707
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$
|
|
14698
|
+
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE.test(file)));
|
|
14699
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$18 });
|
|
14708
14700
|
return Array$1.flatten(found);
|
|
14709
14701
|
}, Effect.scoped);
|
|
14710
14702
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14711
|
-
const START$
|
|
14712
|
-
const NAME_KEY$
|
|
14703
|
+
const START$27 = 0;
|
|
14704
|
+
const NAME_KEY$1 = "\"name\"";
|
|
14713
14705
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14714
14706
|
const parent = files.dirname(module);
|
|
14715
14707
|
if (manifests.has(files.join(parent, PACKAGE_JSON_FILE))) return Option.some(parent);
|
|
@@ -14725,7 +14717,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14725
14717
|
})));
|
|
14726
14718
|
});
|
|
14727
14719
|
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.`;
|
|
14728
|
-
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$
|
|
14720
|
+
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$1)(source), Option.getOrElse(() => START$27));
|
|
14729
14721
|
/** @internal */
|
|
14730
14722
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14731
14723
|
const files = yield* RepositoryFiles;
|
|
@@ -14734,7 +14726,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14734
14726
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14735
14727
|
const ownedSet = new Set(owned);
|
|
14736
14728
|
const directories = pipe(used, Array$1.flatMap(({ modules }) => modules), Array$1.filter((module) => ownedSet.has(module)), Array$1.flatMap((module) => Option.toArray(packageDirectoryOf(manifests, files)(module))), Array$1.dedupe, Array$1.filter((found) => found !== directory), Array$1.sortBy(Order.String));
|
|
14737
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14729
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$18 });
|
|
14738
14730
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14739
14731
|
const index = nameIndex$1(located.source);
|
|
14740
14732
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14865,7 +14857,7 @@ const LOCKFILE = "pnpm-lock.yaml";
|
|
|
14865
14857
|
const COMPILER = "typescript";
|
|
14866
14858
|
const CURRENT_MAJOR = 7;
|
|
14867
14859
|
const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
|
|
14868
|
-
const FIRST$
|
|
14860
|
+
const FIRST$12 = 1;
|
|
14869
14861
|
const legacyOf = (id) => {
|
|
14870
14862
|
const { name, version } = parseDependencyPath(id);
|
|
14871
14863
|
const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
|
|
@@ -14876,8 +14868,8 @@ const legacyOf = (id) => {
|
|
|
14876
14868
|
};
|
|
14877
14869
|
const dependentsOf$1 = (nodes) => (id) => pipe(nodes, Array$1.filter(({ dependencies }) => Array$1.contains(dependencies, id)), Array$1.map((node) => `\`${node.id}\``));
|
|
14878
14870
|
const lineOf$4 = (source) => (id) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex((line) => String$1.replaceAll("'", "")(String$1.trim(line)) === `${id}:`), Option.match({
|
|
14879
|
-
onNone: () => FIRST$
|
|
14880
|
-
onSome: (index) => index + FIRST$
|
|
14871
|
+
onNone: () => FIRST$12,
|
|
14872
|
+
onSome: (index) => index + FIRST$12
|
|
14881
14873
|
}));
|
|
14882
14874
|
const messageOf$4 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array$1.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
|
|
14883
14875
|
/** @internal */
|
|
@@ -14890,7 +14882,7 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14890
14882
|
return pipe(Option.getOrElse(nodes, () => []), Array$1.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array$1.map((legacy) => ({
|
|
14891
14883
|
file,
|
|
14892
14884
|
line: lineOf$4(source)(legacy.id),
|
|
14893
|
-
column: FIRST$
|
|
14885
|
+
column: FIRST$12,
|
|
14894
14886
|
rule: RULE$49,
|
|
14895
14887
|
message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14896
14888
|
})));
|
|
@@ -14942,15 +14934,15 @@ const OFF = [
|
|
|
14942
14934
|
"allow",
|
|
14943
14935
|
0
|
|
14944
14936
|
];
|
|
14945
|
-
const taggedError$
|
|
14937
|
+
const taggedError$10 = Schema.TaggedError;
|
|
14946
14938
|
/** @internal */
|
|
14947
|
-
var DisabledRulesConfigUnreadable = class extends taggedError$
|
|
14939
|
+
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
14948
14940
|
file: Schema.String,
|
|
14949
14941
|
reason: Schema.String
|
|
14950
14942
|
}) {};
|
|
14951
14943
|
/** @internal */
|
|
14952
14944
|
const resolvedConfig = (file) => Effect.sync(forgetBuilt).pipe(Effect.andThen(Effect.tryPromise({
|
|
14953
|
-
try: () =>
|
|
14945
|
+
try: () => resolvedViteConfig(file),
|
|
14954
14946
|
catch: (error) => DisabledRulesConfigUnreadable.make({
|
|
14955
14947
|
file,
|
|
14956
14948
|
reason: String(error)
|
|
@@ -15097,7 +15089,7 @@ const MSCH_RELAXATIONS = [
|
|
|
15097
15089
|
const severityOf = (value) => pipe(listOf$3(value), Array$1.head, Option.getOrElse(() => value));
|
|
15098
15090
|
const hasOptions = (value) => Array$1.length(listOf$3(value)) > SEVERITY_ONLY;
|
|
15099
15091
|
const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
|
|
15100
|
-
const isPresetOverride = (override) => pipe(lint
|
|
15092
|
+
const isPresetOverride = (override) => pipe(lint.overrides, Array$1.some((built) => Equal.equals(built, override)));
|
|
15101
15093
|
const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
|
|
15102
15094
|
const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
|
|
15103
15095
|
anchor: name,
|
|
@@ -15129,9 +15121,9 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
15129
15121
|
];
|
|
15130
15122
|
// src/app/unused-proper-nouns.ts
|
|
15131
15123
|
const RULE$47 = "unused-proper-noun";
|
|
15132
|
-
const MARKDOWN$
|
|
15133
|
-
const START$
|
|
15134
|
-
const READ_CONCURRENCY$
|
|
15124
|
+
const MARKDOWN$5 = "**/*.md";
|
|
15125
|
+
const START$26 = 0;
|
|
15126
|
+
const READ_CONCURRENCY$17 = 16;
|
|
15135
15127
|
const properNounsOf = (textlint) => {
|
|
15136
15128
|
const filters = sectionOf$1(sectionOf$1(textlint)["filters"]);
|
|
15137
15129
|
const allowlist = sectionOf$1(filters["allowlist"]);
|
|
@@ -15140,7 +15132,7 @@ const properNounsOf = (textlint) => {
|
|
|
15140
15132
|
const checkedFiles = (textlint, listed) => {
|
|
15141
15133
|
const section = sectionOf$1(textlint);
|
|
15142
15134
|
const ignored = matcher(pipe(listOf$3(section["ignores"]), Array$1.filter(Predicate$1.isString)));
|
|
15143
|
-
const markdown = matcher([MARKDOWN$
|
|
15135
|
+
const markdown = matcher([MARKDOWN$5]);
|
|
15144
15136
|
const sources = matcher(pipe(listOf$3(section["sources"]), Array$1.flatMap((source) => listOf$3(sectionOf$1(source)["files"])), Array$1.filter(Predicate$1.isString)));
|
|
15145
15137
|
return pipe(listed, Array$1.filter((name) => markdown(name) && !ignored(name) || sources(name)));
|
|
15146
15138
|
};
|
|
@@ -15150,25 +15142,25 @@ const unusedProperNouns = Effect.fn("unusedProperNouns")(function* unusedProperN
|
|
|
15150
15142
|
if (Array$1.isReadonlyArrayEmpty(nouns)) return [];
|
|
15151
15143
|
const files = yield* RepositoryFiles;
|
|
15152
15144
|
const listed = yield* files.listedFiles(root);
|
|
15153
|
-
const texts = yield* Effect.forEach(checkedFiles(config.textlint, listed), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$
|
|
15145
|
+
const texts = yield* Effect.forEach(checkedFiles(config.textlint, listed), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$17 });
|
|
15154
15146
|
const found = Array$1.getSomes(texts);
|
|
15155
15147
|
const at = problemAtIndex(RULE$47)(file, source);
|
|
15156
|
-
return pipe(nouns, Array$1.filter((noun) => !pipe(found, Array$1.some(String$1.includes(noun)))), Array$1.map((noun) => at(pipe(source, String$1.indexOf(`"${noun}"`), Option.getOrElse(() => START$
|
|
15148
|
+
return pipe(nouns, Array$1.filter((noun) => !pipe(found, Array$1.some(String$1.includes(noun)))), Array$1.map((noun) => at(pipe(source, String$1.indexOf(`"${noun}"`), Option.getOrElse(() => START$26)), `The proper noun "${noun}" is in textlint.properNouns, but no text the Japanese checks read contains it, so it lets nothing through. Remove it.`)));
|
|
15157
15149
|
});
|
|
15158
15150
|
// src/app/disabled-rules.ts
|
|
15159
15151
|
const RULE$46 = "disabled-rule";
|
|
15160
|
-
const CONFIG_FILE$
|
|
15161
|
-
const START$
|
|
15152
|
+
const CONFIG_FILE$4 = "vite.config.ts";
|
|
15153
|
+
const START$25 = 0;
|
|
15162
15154
|
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;
|
|
15163
15155
|
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.";
|
|
15164
15156
|
const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
15165
15157
|
const files = yield* RepositoryFiles;
|
|
15166
15158
|
const listed = yield* files.listedFiles(root);
|
|
15167
15159
|
const isExempt = matcher(exempt);
|
|
15168
|
-
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$46)(files.join(root, name), "")(START$
|
|
15160
|
+
return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$46)(files.join(root, name), "")(START$25, SIDE_CONFIG_MESSAGE)));
|
|
15169
15161
|
});
|
|
15170
15162
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
15171
|
-
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$
|
|
15163
|
+
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$4);
|
|
15172
15164
|
const config = yield* resolvedConfig(file);
|
|
15173
15165
|
const expected = yield* expectationsIn(root);
|
|
15174
15166
|
const at = problemAtIndex(RULE$46)(file, source);
|
|
@@ -15178,14 +15170,14 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
15178
15170
|
source,
|
|
15179
15171
|
config
|
|
15180
15172
|
});
|
|
15181
|
-
return [...pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$
|
|
15173
|
+
return [...pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message))), ...unused];
|
|
15182
15174
|
});
|
|
15183
15175
|
/** @internal */
|
|
15184
15176
|
const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
|
|
15185
15177
|
const files = yield* RepositoryFiles;
|
|
15186
|
-
const text = yield* files.readFile(files.join(root, CONFIG_FILE$
|
|
15178
|
+
const text = yield* files.readFile(files.join(root, CONFIG_FILE$4));
|
|
15187
15179
|
if (Option.isNone(text)) return [];
|
|
15188
|
-
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$46)(file, "")(START$
|
|
15180
|
+
return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$46)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
|
|
15189
15181
|
});
|
|
15190
15182
|
// src/app/build-checks.ts
|
|
15191
15183
|
/** @internal */
|
|
@@ -15903,7 +15895,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15903
15895
|
const PATH_PREFIX = /^(?:!|\.\/)+/u;
|
|
15904
15896
|
const GLOB$1 = /[*?{[]/u;
|
|
15905
15897
|
const EXTENSION$2 = /\.[^./]+$/u;
|
|
15906
|
-
const SEPARATOR$
|
|
15898
|
+
const SEPARATOR$13 = "/";
|
|
15907
15899
|
const ROOT$2 = ".";
|
|
15908
15900
|
const namedPath = (repository, file) => (name) => {
|
|
15909
15901
|
const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
|
|
@@ -15912,12 +15904,12 @@ const namedPath = (repository, file) => (name) => {
|
|
|
15912
15904
|
return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
|
|
15913
15905
|
};
|
|
15914
15906
|
const kindOf = (repository) => (path) => {
|
|
15915
|
-
if (HashSet.has(repository.directories, path)) return SEPARATOR$
|
|
15907
|
+
if (HashSet.has(repository.directories, path)) return SEPARATOR$13;
|
|
15916
15908
|
return pipe(path, String$1.match(EXTENSION$2), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
|
|
15917
15909
|
};
|
|
15918
15910
|
const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array$1.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
|
|
15919
15911
|
const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
|
|
15920
|
-
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$
|
|
15912
|
+
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$13}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
|
|
15921
15913
|
const directoryLabel = (directory) => {
|
|
15922
15914
|
if (directory === ROOT$2) return "the repository root";
|
|
15923
15915
|
return directory;
|
|
@@ -15969,11 +15961,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
|
15969
15961
|
return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
|
|
15970
15962
|
};
|
|
15971
15963
|
// src/features/check-value-owners/model/repository-names.ts
|
|
15972
|
-
const SEPARATOR$
|
|
15964
|
+
const SEPARATOR$12 = "/";
|
|
15973
15965
|
const FIRST_SEGMENT = 1;
|
|
15974
15966
|
const prefixesOf = (file) => {
|
|
15975
|
-
const segments = pipe(file, String$1.split(SEPARATOR$
|
|
15976
|
-
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$
|
|
15967
|
+
const segments = pipe(file, String$1.split(SEPARATOR$12));
|
|
15968
|
+
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$12))));
|
|
15977
15969
|
};
|
|
15978
15970
|
const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
|
|
15979
15971
|
const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
|
|
@@ -16270,14 +16262,14 @@ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
16270
16262
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16271
16263
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16272
16264
|
const PLUGIN_ROOT$1 = "..";
|
|
16273
|
-
const READ_CONCURRENCY$
|
|
16274
|
-
const START$
|
|
16265
|
+
const READ_CONCURRENCY$16 = 16;
|
|
16266
|
+
const START$24 = 0;
|
|
16275
16267
|
const referenceOf = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
16276
16268
|
path,
|
|
16277
|
-
index: found.index ?? START$
|
|
16269
|
+
index: found.index ?? START$24
|
|
16278
16270
|
})), Option.toArray);
|
|
16279
16271
|
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf));
|
|
16280
|
-
const problemsIn$
|
|
16272
|
+
const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
16281
16273
|
const files = yield* RepositoryFiles;
|
|
16282
16274
|
const text = yield* files.readFile(file);
|
|
16283
16275
|
if (Option.isNone(text)) return [];
|
|
@@ -16313,7 +16305,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
16313
16305
|
}];
|
|
16314
16306
|
return [];
|
|
16315
16307
|
}));
|
|
16316
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$
|
|
16308
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$16 });
|
|
16317
16309
|
return Array$1.flatten(found);
|
|
16318
16310
|
});
|
|
16319
16311
|
// src/features/check-agent-settings/model/project-extensions.ts
|
|
@@ -16383,7 +16375,7 @@ const ARGS = "args";
|
|
|
16383
16375
|
const PLACEHOLDER = /[<>*{}$]/u;
|
|
16384
16376
|
const WHITESPACE$1 = /\s+/u;
|
|
16385
16377
|
const ROOT$1 = ".";
|
|
16386
|
-
const SEPARATOR$
|
|
16378
|
+
const SEPARATOR$11 = "/";
|
|
16387
16379
|
const END_OF_OPTIONS = "--";
|
|
16388
16380
|
const FLAG = "-";
|
|
16389
16381
|
const TASK_SEPARATOR$1 = "#";
|
|
@@ -16392,11 +16384,11 @@ const FILTER_FLAGS = /* @__PURE__ */ new Set(["--filter", "-F"]);
|
|
|
16392
16384
|
const FILTER_ASSIGNMENT = "--filter=";
|
|
16393
16385
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
16394
16386
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
16395
|
-
const ONE$
|
|
16396
|
-
const START$
|
|
16387
|
+
const ONE$1 = 1;
|
|
16388
|
+
const START$23 = 0;
|
|
16397
16389
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE$1), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
16398
|
-
const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$
|
|
16399
|
-
const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$
|
|
16390
|
+
const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array$1.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
|
|
16391
|
+
const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
16400
16392
|
const specifierOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token, index) => !String$1.startsWith(FLAG)(token) && !follows(tokens)(index)), Option.flatMap((index) => Array$1.get(tokens, index)));
|
|
16401
16393
|
const hasAny = (flags) => (tokens) => pipe(tokens, Array$1.some((token) => flags.has(token)));
|
|
16402
16394
|
const scopeOf = (tokens) => {
|
|
@@ -16430,8 +16422,8 @@ const parsed = (args) => {
|
|
|
16430
16422
|
return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
|
|
16431
16423
|
};
|
|
16432
16424
|
const ancestorsOf$1 = (file) => {
|
|
16433
|
-
const parts = pipe(String$1.split(file, SEPARATOR$
|
|
16434
|
-
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$
|
|
16425
|
+
const parts = pipe(String$1.split(file, SEPARATOR$11), Array$1.dropRight(ONE$1));
|
|
16426
|
+
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$11))), ROOT$1];
|
|
16435
16427
|
};
|
|
16436
16428
|
const named = (graph, name) => (directory) => directory === String$1.replace(LOCAL_PREFIX$1, "")(name) || pipe(Record.get(graph.packages, directory), Option.exists((found) => found.name === name));
|
|
16437
16429
|
const packagesOf = (graph, file) => (scope) => {
|
|
@@ -16449,13 +16441,13 @@ const whereOf = (scope, file) => {
|
|
|
16449
16441
|
return `the package that holds ${file}`;
|
|
16450
16442
|
};
|
|
16451
16443
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask$1(graph, task)));
|
|
16452
|
-
const problemsIn$
|
|
16444
|
+
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 }) => ({
|
|
16453
16445
|
file: absolute(file),
|
|
16454
|
-
...positionOf(text)(match.index ?? START$
|
|
16446
|
+
...positionOf(text)(match.index ?? START$23),
|
|
16455
16447
|
rule: RULE$39,
|
|
16456
|
-
message: `${match[START$
|
|
16448
|
+
message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
16457
16449
|
})), Option.toArray)));
|
|
16458
|
-
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$
|
|
16450
|
+
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$11), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
16459
16451
|
/** @internal */
|
|
16460
16452
|
const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
|
|
16461
16453
|
const files = yield* RepositoryFiles;
|
|
@@ -16475,12 +16467,12 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16475
16467
|
return Option.match(graph, {
|
|
16476
16468
|
onNone: () => [{
|
|
16477
16469
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
16478
|
-
line: ONE$
|
|
16479
|
-
column: ONE$
|
|
16470
|
+
line: ONE$1,
|
|
16471
|
+
column: ONE$1,
|
|
16480
16472
|
rule: RULE$39,
|
|
16481
16473
|
message: "msch could not list the tasks with `vp run --json`"
|
|
16482
16474
|
}],
|
|
16483
|
-
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$
|
|
16475
|
+
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
|
|
16484
16476
|
});
|
|
16485
16477
|
});
|
|
16486
16478
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
@@ -16528,66 +16520,6 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16528
16520
|
});
|
|
16529
16521
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
16530
16522
|
});
|
|
16531
|
-
// src/shared/lib/section-check.ts
|
|
16532
|
-
const taggedError$10 = Schema.TaggedError;
|
|
16533
|
-
var SectionConfigUnreadable = class extends taggedError$10()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
16534
|
-
const CONFIG_FILE$4 = "vite.config.ts";
|
|
16535
|
-
const FIRST$12 = 1;
|
|
16536
|
-
const ONE$1 = 1;
|
|
16537
|
-
const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
|
|
16538
|
-
const countDiagnostics = (check, found) => Effect.forEach(found, (diagnostic) => diagnostics.pipe(Metric.withAttributes({
|
|
16539
|
-
"lint.check": check,
|
|
16540
|
-
"lint.rule": diagnostic.rule,
|
|
16541
|
-
"lint.severity": diagnostic.severity
|
|
16542
|
-
}), Metric.update(ONE$1)), {
|
|
16543
|
-
concurrency: 1,
|
|
16544
|
-
discard: true
|
|
16545
|
-
});
|
|
16546
|
-
const sectionAt = (file, pick) => Effect.gen(function* readSection() {
|
|
16547
|
-
if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
|
|
16548
|
-
const config = yield* Effect.tryPromise({
|
|
16549
|
-
try: () => resolveConfigFromFile(file),
|
|
16550
|
-
catch: () => SectionConfigUnreadable.make({ file })
|
|
16551
|
-
}).pipe(Effect.option);
|
|
16552
|
-
return pipe(config, Option.map(pick));
|
|
16553
|
-
});
|
|
16554
|
-
const checkSection = (check) => (root) => Effect.gen(function* runSection() {
|
|
16555
|
-
const files = yield* RepositoryFiles;
|
|
16556
|
-
const configFile = files.join(root, CONFIG_FILE$4);
|
|
16557
|
-
const section = yield* sectionAt(configFile, check.pick);
|
|
16558
|
-
if (Option.isNone(section)) return [];
|
|
16559
|
-
const config = section.value;
|
|
16560
|
-
const [listed, projectFiles] = yield* Effect.all([files.matchingFiles(root, check.pathspecs(config)), files.listedFiles(root)], { concurrency: "unbounded" });
|
|
16561
|
-
const linted = yield* Effect.result(check.lint({
|
|
16562
|
-
root,
|
|
16563
|
-
files: listed,
|
|
16564
|
-
projectFiles,
|
|
16565
|
-
config
|
|
16566
|
-
}));
|
|
16567
|
-
yield* Result.match(linted, {
|
|
16568
|
-
onFailure: () => Effect.void,
|
|
16569
|
-
onSuccess: (found) => countDiagnostics(check.name, found)
|
|
16570
|
-
});
|
|
16571
|
-
return Result.match(linted, {
|
|
16572
|
-
onFailure: (failure) => [problemInFile(check.rule)(configFile, failure.message)],
|
|
16573
|
-
onSuccess: (found) => pipe(found, Array$1.filter(({ severity }) => severity === "error"), Array$1.map((diagnostic) => ({
|
|
16574
|
-
file: files.join(root, diagnostic.path),
|
|
16575
|
-
line: diagnostic.line,
|
|
16576
|
-
column: diagnostic.column ?? FIRST$12,
|
|
16577
|
-
rule: check.rule,
|
|
16578
|
-
message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
|
|
16579
|
-
})))
|
|
16580
|
-
});
|
|
16581
|
-
}).pipe(Effect.withSpan(check.name));
|
|
16582
|
-
// src/features/check-markdown/model/markdown.ts
|
|
16583
|
-
const checkMarkdown = checkSection({
|
|
16584
|
-
name: "checkMarkdown",
|
|
16585
|
-
rule: "markdown",
|
|
16586
|
-
pick: y8Section,
|
|
16587
|
-
pathspecs: (config) => markdownPathspecs({ config }),
|
|
16588
|
-
lint,
|
|
16589
|
-
detail: diagnosticDetail
|
|
16590
|
-
});
|
|
16591
16523
|
// src/features/check-scripts/model/shell-scripts.ts
|
|
16592
16524
|
const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
16593
16525
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
@@ -16595,7 +16527,7 @@ const EXTENSION$1 = /\.[^./]+$/u;
|
|
|
16595
16527
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16596
16528
|
const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
16597
16529
|
const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
|
|
16598
|
-
const READ_CONCURRENCY$
|
|
16530
|
+
const READ_CONCURRENCY$15 = 64;
|
|
16599
16531
|
const RULE$37 = "shell-script";
|
|
16600
16532
|
const MESSAGE$9 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only a SessionStart hook in .claude/settings.json, which installs the toolchain, and a script that a plugin's hooks/hooks.json runs to provide the plugin's dependencies before its TypeScript can load stay shell scripts.";
|
|
16601
16533
|
const HookSchema = Schema.Struct({
|
|
@@ -16624,7 +16556,7 @@ const pluginCommands = (hooksFile, source) => {
|
|
|
16624
16556
|
const hasExtension = (name) => EXTENSION$1.test(baseName$1(name));
|
|
16625
16557
|
const pluginSessionStarts = Effect.fn("pluginSessionStarts")(function* pluginSessionStarts(root, names) {
|
|
16626
16558
|
const files = yield* RepositoryFiles;
|
|
16627
|
-
const commands = yield* Effect.forEach(pipe(names, Array$1.filter((name) => PLUGIN_HOOKS.test(name))), (name) => files.readFile(files.join(root, name)).pipe(Effect.map((source) => pipe(source, Option.map((text) => pluginCommands(name, text)), Option.getOrElse(() => NO_TEXT)))), { concurrency: READ_CONCURRENCY$
|
|
16559
|
+
const commands = yield* Effect.forEach(pipe(names, Array$1.filter((name) => PLUGIN_HOOKS.test(name))), (name) => files.readFile(files.join(root, name)).pipe(Effect.map((source) => pipe(source, Option.map((text) => pluginCommands(name, text)), Option.getOrElse(() => NO_TEXT)))), { concurrency: READ_CONCURRENCY$15 });
|
|
16628
16560
|
return Array$1.flatten(commands);
|
|
16629
16561
|
});
|
|
16630
16562
|
/** @internal */
|
|
@@ -16642,27 +16574,18 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16642
16574
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16643
16575
|
};
|
|
16644
16576
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16645
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16577
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$15 });
|
|
16646
16578
|
return pipe(shell, Array$1.map((name) => problemInFile(RULE$37)(files.join(root, name), MESSAGE$9)));
|
|
16647
16579
|
});
|
|
16648
|
-
// src/features/check-structure/model/structure.ts
|
|
16649
|
-
const checkStructure = checkSection({
|
|
16650
|
-
name: "checkStructure",
|
|
16651
|
-
rule: "structure",
|
|
16652
|
-
pick: wismSection,
|
|
16653
|
-
pathspecs: (config) => wismPathspecs({ config }),
|
|
16654
|
-
lint: lint$1,
|
|
16655
|
-
detail: () => ""
|
|
16656
|
-
});
|
|
16657
16580
|
// src/features/check-vite-plus/model/command-words.ts
|
|
16658
16581
|
const CONTINUATION = /\\\n/gu;
|
|
16659
16582
|
const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
16660
|
-
const SEPARATOR$
|
|
16583
|
+
const SEPARATOR$10 = /&&|\|\||[;|\n`]|\$\(/u;
|
|
16661
16584
|
const BLANK = /\s+/u;
|
|
16662
16585
|
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
16663
16586
|
const QUOTE = "\"\"";
|
|
16664
16587
|
const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
|
|
16665
|
-
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$
|
|
16588
|
+
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$10), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
|
|
16666
16589
|
// src/features/check-vite-plus/model/command-problems.ts
|
|
16667
16590
|
const PACKAGE_MANAGERS = [
|
|
16668
16591
|
"pnpm",
|
|
@@ -16719,8 +16642,8 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array$1.flatMap
|
|
|
16719
16642
|
const commandProblems$2 = (sources) => pipe(sources, Array$1.flatMap(problemsOf));
|
|
16720
16643
|
// src/shared/lib/workflow-run.ts
|
|
16721
16644
|
const RUN_KEY = "run";
|
|
16722
|
-
const START$
|
|
16723
|
-
const startOf$3 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
16645
|
+
const START$22 = 0;
|
|
16646
|
+
const startOf$3 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$22));
|
|
16724
16647
|
const runScriptsOf = (source) => {
|
|
16725
16648
|
const found = [];
|
|
16726
16649
|
visit$1(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -16776,8 +16699,8 @@ const AGENT_DOCS = [
|
|
|
16776
16699
|
":(glob)**/CLAUDE.md",
|
|
16777
16700
|
...EXCLUDED$5
|
|
16778
16701
|
];
|
|
16779
|
-
const READ_CONCURRENCY$
|
|
16780
|
-
const START$
|
|
16702
|
+
const READ_CONCURRENCY$14 = 16;
|
|
16703
|
+
const START$21 = 0;
|
|
16781
16704
|
const FIRST$11 = 1;
|
|
16782
16705
|
const LINE = "\n";
|
|
16783
16706
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -16785,9 +16708,9 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
|
16785
16708
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
16786
16709
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
16787
16710
|
const NO_SOURCES = [];
|
|
16788
|
-
const offsetOf$
|
|
16711
|
+
const offsetOf$1 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$21));
|
|
16789
16712
|
const scriptSources = (file) => (source) => pipe(decodePackageJson(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([name, text]) => {
|
|
16790
|
-
const offset = offsetOf$
|
|
16713
|
+
const offset = offsetOf$1(source, `"${name}"`);
|
|
16791
16714
|
return {
|
|
16792
16715
|
kind: "script",
|
|
16793
16716
|
file,
|
|
@@ -16821,7 +16744,7 @@ const commandIn = (node) => {
|
|
|
16821
16744
|
const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$4(node), Array$1.flatMap(commandsIn))];
|
|
16822
16745
|
const agentSources = (file) => (source) => pipe(decodeJson$1(source), Option.map(commandsIn), Option.getOrElse(() => []), Array$1.map((text) => {
|
|
16823
16746
|
const program = Array$1.headNonEmpty(String$1.split(text, " "));
|
|
16824
|
-
const offset = offsetOf$
|
|
16747
|
+
const offset = offsetOf$1(source, `"${program}"`);
|
|
16825
16748
|
return {
|
|
16826
16749
|
kind: "agent",
|
|
16827
16750
|
file,
|
|
@@ -16845,7 +16768,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16845
16768
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16846
16769
|
});
|
|
16847
16770
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16848
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
16771
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$14 });
|
|
16849
16772
|
return Array$1.flatten(found);
|
|
16850
16773
|
});
|
|
16851
16774
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16857,7 +16780,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16857
16780
|
onSome: sourcesOf(file, name)
|
|
16858
16781
|
});
|
|
16859
16782
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16860
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16783
|
+
}, { concurrency: READ_CONCURRENCY$14 });
|
|
16861
16784
|
return Array$1.flatten(found);
|
|
16862
16785
|
});
|
|
16863
16786
|
/** @internal */
|
|
@@ -16938,12 +16861,52 @@ const checkVitePlus = Effect.fn("checkVitePlus")(function* checkVitePlus(root) {
|
|
|
16938
16861
|
...blocks
|
|
16939
16862
|
];
|
|
16940
16863
|
});
|
|
16864
|
+
// src/features/check-workflows/model/shared-actions.ts
|
|
16865
|
+
const ACTIONS_REF = "1f825b932e1a85233322991acd805c65b75dc358";
|
|
16866
|
+
const REPOSITORY = `${SELF_REPOSITORY}/.github`;
|
|
16867
|
+
const actionPath = (name) => `${REPOSITORY}/shared-actions/${name}`;
|
|
16868
|
+
const workflowPath = (file) => `${REPOSITORY}/workflows/${file}`;
|
|
16869
|
+
const SETUP_ACTION = actionPath("setup");
|
|
16870
|
+
const VERIFY_ACTION = actionPath("verify");
|
|
16871
|
+
const MAINTAIN_WORKFLOW_FILE = "maintain-caches.yml";
|
|
16872
|
+
const MAINTAIN_WORKFLOW = workflowPath(MAINTAIN_WORKFLOW_FILE);
|
|
16873
|
+
const KINDS = String.raw`${REPOSITORY}/(?:shared-actions|workflows)/`;
|
|
16874
|
+
const ACTIONS_USE = new RegExp(String.raw`^${KINDS}[^@]+@`, "u");
|
|
16875
|
+
const pinned = (path) => `${path}@${ACTIONS_REF}`;
|
|
16876
|
+
const CACHE_WORKFLOW = "cache.yml";
|
|
16877
|
+
const FINISHED_WORKFLOW = "finished.yml";
|
|
16878
|
+
const DEFAULT_BRANCH_ONLY = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
|
|
16879
|
+
const REGISTRY_ACCESS = `\${{ secrets.TAKUMI_GUARD_TOKEN }}`;
|
|
16880
|
+
const CACHE_WORKFLOW_SOURCE = Array$1.join([
|
|
16881
|
+
"name: cache",
|
|
16882
|
+
"",
|
|
16883
|
+
"on:",
|
|
16884
|
+
" schedule:",
|
|
16885
|
+
" - cron: \"47 * * * *\"",
|
|
16886
|
+
" workflow_dispatch:",
|
|
16887
|
+
"",
|
|
16888
|
+
"permissions: {}",
|
|
16889
|
+
"",
|
|
16890
|
+
"jobs:",
|
|
16891
|
+
" caches:",
|
|
16892
|
+
` if: ${DEFAULT_BRANCH_ONLY}`,
|
|
16893
|
+
" permissions:",
|
|
16894
|
+
" actions: write",
|
|
16895
|
+
" contents: read",
|
|
16896
|
+
` uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
16897
|
+
" secrets:",
|
|
16898
|
+
` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
|
|
16899
|
+
""
|
|
16900
|
+
], "\n");
|
|
16901
|
+
const PINNED_USE = new RegExp(String.raw`(?<use>${KINDS}[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
|
|
16902
|
+
const refsIn = (source) => pipe(source, String$1.matchAll(PINNED_USE), Array$1.fromIterable, Array$1.flatMap(({ groups }) => pipe(Option.fromNullishOr(groups), Option.flatMap(Record.get("ref")), Option.toArray)));
|
|
16903
|
+
const withoutRefs = (source) => pipe(source, String$1.replaceAll(PINNED_USE, "$<use>"));
|
|
16941
16904
|
// src/features/check-workflows/model/yaml-nodes.ts
|
|
16942
16905
|
const EMPTY$2 = "";
|
|
16943
16906
|
const ByStartDescending = Order.mapInput(Order.flip(Number$1.Order), ({ start }) => start);
|
|
16944
16907
|
const NEWLINE$1 = "\n";
|
|
16945
16908
|
const FIRST$10 = 0;
|
|
16946
|
-
const NEXT$
|
|
16909
|
+
const NEXT$5 = 1;
|
|
16947
16910
|
const RANGE_END = 2;
|
|
16948
16911
|
/** @internal */
|
|
16949
16912
|
const scalarText = (node) => pipe(Option.liftPredicate(node, isScalar), Option.map(({ value }) => value), Option.filter(Predicate$1.isString), Option.getOrElse(() => EMPTY$2));
|
|
@@ -16952,12 +16915,12 @@ const fieldOf$1 = (key) => (node) => pipe(Option.liftPredicate(node, isMap), Opt
|
|
|
16952
16915
|
/** @internal */
|
|
16953
16916
|
const usesOf = fieldOf$1("uses");
|
|
16954
16917
|
/** @internal */
|
|
16955
|
-
const lineStart = ({ source, offset }) => pipe(source, String$1.slice(FIRST$10, offset), String$1.lastIndexOf(NEWLINE$1), Option.map((index) => index + NEXT$
|
|
16956
|
-
const rangeOf$
|
|
16918
|
+
const lineStart = ({ source, offset }) => pipe(source, String$1.slice(FIRST$10, offset), String$1.lastIndexOf(NEWLINE$1), Option.map((index) => index + NEXT$5), Option.getOrElse(() => FIRST$10));
|
|
16919
|
+
const rangeOf$3 = (node) => pipe(Option.liftPredicate(node, isMap), Option.flatMapNullishOr(({ range }) => range));
|
|
16957
16920
|
/** @internal */
|
|
16958
|
-
const startOf$2 = (node) => pipe(rangeOf$
|
|
16921
|
+
const startOf$2 = (node) => pipe(rangeOf$3(node), Option.map(([start]) => start));
|
|
16959
16922
|
/** @internal */
|
|
16960
|
-
const endOf = (node) => pipe(rangeOf$
|
|
16923
|
+
const endOf = (node) => pipe(rangeOf$3(node), Option.map((range) => range[RANGE_END]));
|
|
16961
16924
|
const insertAt = (text) => ({ start, end, text: insert }) => pipe(text, String$1.slice(FIRST$10, start)) + insert + pipe(text, String$1.slice(end));
|
|
16962
16925
|
/** @internal */
|
|
16963
16926
|
const applyEdits = ({ source, edits }) => pipe(Array$1.sort(edits, ByStartDescending), Array$1.match({
|
|
@@ -16969,17 +16932,203 @@ const applyEdits = ({ source, edits }) => pipe(Array$1.sort(edits, ByStartDescen
|
|
|
16969
16932
|
}));
|
|
16970
16933
|
/** @internal */
|
|
16971
16934
|
const itemsOf = (node) => pipe(Option.liftPredicate(node, isSeq), Option.map(({ items }) => items), Option.getOrElse(() => []));
|
|
16935
|
+
// src/features/check-workflows/model/cache-workflow.ts
|
|
16936
|
+
const INDENT$3 = " ";
|
|
16937
|
+
const CALL = "caches";
|
|
16938
|
+
const jobText = (jobs) => pipe([
|
|
16939
|
+
"",
|
|
16940
|
+
`${INDENT$3}${CALL}:`,
|
|
16941
|
+
`${INDENT$3}${INDENT$3}needs: [${pipe(jobs, Array$1.join(", "))}]`,
|
|
16942
|
+
`${INDENT$3}${INDENT$3}if: always() && ${DEFAULT_BRANCH_ONLY}`,
|
|
16943
|
+
`${INDENT$3}${INDENT$3}permissions:`,
|
|
16944
|
+
`${INDENT$3}${INDENT$3}${INDENT$3}actions: write`,
|
|
16945
|
+
`${INDENT$3}${INDENT$3}${INDENT$3}contents: read`,
|
|
16946
|
+
`${INDENT$3}${INDENT$3}uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
16947
|
+
`${INDENT$3}${INDENT$3}secrets:`,
|
|
16948
|
+
`${INDENT$3}${INDENT$3}${INDENT$3}TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`
|
|
16949
|
+
], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
16950
|
+
/** @internal */
|
|
16951
|
+
const addMaintainJob = ({ source, jobs }) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(endOf), Option.match({
|
|
16952
|
+
onNone: () => source,
|
|
16953
|
+
onSome: (at) => applyEdits({
|
|
16954
|
+
source,
|
|
16955
|
+
edits: [{
|
|
16956
|
+
start: at,
|
|
16957
|
+
end: at,
|
|
16958
|
+
text: jobText(jobs)
|
|
16959
|
+
}]
|
|
16960
|
+
})
|
|
16961
|
+
}));
|
|
16962
|
+
// src/features/check-workflows/model/step-inputs.ts
|
|
16963
|
+
const NEXT$4 = 1;
|
|
16964
|
+
const TOKEN_INPUT = "github-token";
|
|
16965
|
+
const LOCAL_TELEMETRY = /^(?:\$|\.)\/\.github\/actions\/telemetry-files$/u;
|
|
16966
|
+
const TELEMETRY_FILES = "telemetry-files";
|
|
16967
|
+
const USES_KEY_WIDTH = 6;
|
|
16968
|
+
const pairNamed = (map, name) => Array$1.findFirst(map.items, ({ key }) => scalarText(key) === name);
|
|
16969
|
+
/** @internal */
|
|
16970
|
+
const keyStart = (source, pair) => pipe(Option.liftPredicate(pair.key, isScalar), Option.flatMapNullishOr(({ range }) => range), Option.map(([offset]) => lineStart({
|
|
16971
|
+
source,
|
|
16972
|
+
offset
|
|
16973
|
+
})));
|
|
16974
|
+
const followingOf = ({ pair, owner }) => Array$1.get(owner.items, owner.items.indexOf(pair) + NEXT$4);
|
|
16975
|
+
const removalOf = (source) => (target) => Option.map(keyStart(source, target.pair), (start) => ({
|
|
16976
|
+
start,
|
|
16977
|
+
end: pipe(followingOf(target), Option.flatMap((next) => keyStart(source, next)), Option.orElse(() => endOf(target.owner)), Option.getOrElse(() => source.length)),
|
|
16978
|
+
text: ""
|
|
16979
|
+
}));
|
|
16980
|
+
const tokenTarget = (step) => Option.flatMap(pairNamed(step, "with"), (inputsPair) => pipe(Option.liftPredicate(inputsPair.value, isMap), Option.flatMap((inputs) => Option.map(pairNamed(inputs, TOKEN_INPUT), (token) => Boolean$1.match(inputs.items.length === NEXT$4, {
|
|
16981
|
+
onTrue: () => ({
|
|
16982
|
+
pair: inputsPair,
|
|
16983
|
+
owner: step
|
|
16984
|
+
}),
|
|
16985
|
+
onFalse: () => ({
|
|
16986
|
+
pair: token,
|
|
16987
|
+
owner: inputs
|
|
16988
|
+
})
|
|
16989
|
+
})))));
|
|
16990
|
+
/** @internal */
|
|
16991
|
+
const tokenEdit = (source) => (step) => pipe(Option.liftPredicate(step, isMap), Option.filter((map) => ACTIONS_USE.test(usesOf(map))), Option.flatMap(tokenTarget), Option.flatMap(removalOf(source)));
|
|
16992
|
+
const suffixInput = (source, start, step) => Option.match(pairNamed(step, "with"), {
|
|
16993
|
+
onSome: () => "",
|
|
16994
|
+
onNone: () => {
|
|
16995
|
+
const width = start - lineStart({
|
|
16996
|
+
source,
|
|
16997
|
+
offset: start
|
|
16998
|
+
}) - USES_KEY_WIDTH;
|
|
16999
|
+
const pad = pipe(" ", String$1.repeat(width));
|
|
17000
|
+
return `\n${pad}with:\n${pad} suffix: ""`;
|
|
17001
|
+
}
|
|
17002
|
+
});
|
|
17003
|
+
/** @internal */
|
|
17004
|
+
const telemetryEdit = (source) => (step) => pipe(Option.liftPredicate(step, isMap), Option.filter((map) => LOCAL_TELEMETRY.test(usesOf(map))), Option.flatMap((map) => pipe(pairNamed(map, "uses"), Option.flatMap(({ value }) => Option.liftPredicate(value, isScalar)), Option.flatMapNullishOr(({ range }) => range), Option.map(([start, end]) => ({
|
|
17005
|
+
start,
|
|
17006
|
+
end,
|
|
17007
|
+
text: `${pinned(actionPath(TELEMETRY_FILES))}${suffixInput(source, start, map)}`
|
|
17008
|
+
})))));
|
|
17009
|
+
// src/features/check-workflows/model/finish-jobs.ts
|
|
17010
|
+
const FINISHED_STEP = /\/shared-actions\/(?:ci-telemetry|wake)@/u;
|
|
17011
|
+
const FINISHED_CALL = `${workflowPath(FINISHED_WORKFLOW)}@`;
|
|
17012
|
+
const TRAILING_NEWLINES = /\n+$/u;
|
|
17013
|
+
const NEXT$3 = 1;
|
|
17014
|
+
const INDENT$2 = " ";
|
|
17015
|
+
/** @internal */
|
|
17016
|
+
const reportsFinish = (job) => pipe(Option.liftPredicate(job, isMap), Option.exists((map) => pipe(usesOf(map), String$1.startsWith(FINISHED_CALL)) || pipe(itemsOf(map.get("steps", true)), Array$1.some((step) => FINISHED_STEP.test(usesOf(step))))));
|
|
17017
|
+
const jobPairs = (source) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.map(({ items }) => items), Option.getOrElse(() => []));
|
|
17018
|
+
const jobsEnd = (source) => pipe(endOf(parseDocument(source).get("jobs", true)), Option.getOrElse(() => source.length));
|
|
17019
|
+
const finishEdits = (source) => {
|
|
17020
|
+
const pairs = jobPairs(source);
|
|
17021
|
+
return pipe(pairs, Array$1.map((pair, index) => ({
|
|
17022
|
+
pair,
|
|
17023
|
+
next: Array$1.get(pairs, index + NEXT$3)
|
|
17024
|
+
})), Array$1.filter(({ pair }) => reportsFinish(pair.value)), Array$1.flatMap(({ pair, next }) => pipe(keyStart(source, pair), Option.map((start) => ({
|
|
17025
|
+
start,
|
|
17026
|
+
end: pipe(next, Option.flatMap((following) => keyStart(source, following)), Option.getOrElse(() => jobsEnd(source))),
|
|
17027
|
+
text: ""
|
|
17028
|
+
})), Option.toArray)));
|
|
17029
|
+
};
|
|
17030
|
+
const finishedText = (jobs) => pipe([
|
|
17031
|
+
"",
|
|
17032
|
+
`${INDENT$2}finished:`,
|
|
17033
|
+
`${INDENT$2}${INDENT$2}needs: [${Array$1.join(jobs, ", ")}]`,
|
|
17034
|
+
`${INDENT$2}${INDENT$2}if: always()`,
|
|
17035
|
+
`${INDENT$2}${INDENT$2}permissions:`,
|
|
17036
|
+
`${INDENT$2}${INDENT$2}${INDENT$2}actions: read`,
|
|
17037
|
+
`${INDENT$2}${INDENT$2}${INDENT$2}contents: read`,
|
|
17038
|
+
`${INDENT$2}${INDENT$2}${INDENT$2}id-token: write`,
|
|
17039
|
+
`${INDENT$2}${INDENT$2}uses: ${pinned(workflowPath(FINISHED_WORKFLOW))}`,
|
|
17040
|
+
`${INDENT$2}${INDENT$2}with:`,
|
|
17041
|
+
`${INDENT$2}${INDENT$2}${INDENT$2}failed: \${{ contains(needs.*.result, 'failure') }}`
|
|
17042
|
+
], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
17043
|
+
const appendFinished = (source) => pipe(jobPairs(source), Array$1.map(({ key }) => scalarText(key)), Array$1.match({
|
|
17044
|
+
onEmpty: () => source,
|
|
17045
|
+
onNonEmpty: (jobs) => {
|
|
17046
|
+
const at = jobsEnd(source);
|
|
17047
|
+
return applyEdits({
|
|
17048
|
+
source,
|
|
17049
|
+
edits: [{
|
|
17050
|
+
start: at,
|
|
17051
|
+
end: at,
|
|
17052
|
+
text: finishedText(jobs)
|
|
17053
|
+
}]
|
|
17054
|
+
});
|
|
17055
|
+
}
|
|
17056
|
+
}));
|
|
17057
|
+
/** @internal */
|
|
17058
|
+
const withFinishJob = (source) => pipe(finishEdits(source), Array$1.match({
|
|
17059
|
+
onEmpty: () => source,
|
|
17060
|
+
onNonEmpty: (edits) => appendFinished(pipe(applyEdits({
|
|
17061
|
+
source,
|
|
17062
|
+
edits
|
|
17063
|
+
}), String$1.replace(TRAILING_NEWLINES, "\n")))
|
|
17064
|
+
}));
|
|
17065
|
+
// src/features/check-workflows/model/added-files.ts
|
|
17066
|
+
const PACKAGES_FILE = "linux-packages.txt";
|
|
17067
|
+
const WORKFLOWS$1 = ".github/workflows";
|
|
17068
|
+
const ACTIONS$1 = ".github/actions";
|
|
17069
|
+
/** @internal */
|
|
17070
|
+
const packagesChange = (actions, localSetups) => Effect.gen(function* planPackagesFile() {
|
|
17071
|
+
const fs = yield* FileSystem.FileSystem;
|
|
17072
|
+
const path = yield* Path.Path;
|
|
17073
|
+
const target = path.join(path.dirname(actions), PACKAGES_FILE);
|
|
17074
|
+
const exists = (file) => fs.exists(file).pipe(Effect.orElseSucceed(() => false));
|
|
17075
|
+
if (yield* exists(target)) return [];
|
|
17076
|
+
const names = Array$1.sort(Array$1.fromIterable(localSetups), String$1.Order);
|
|
17077
|
+
const candidates = pipe(names, Array$1.map((name) => path.join(actions, name, PACKAGES_FILE)));
|
|
17078
|
+
const found = yield* Effect.findFirst(candidates, exists);
|
|
17079
|
+
return yield* Option.match(found, {
|
|
17080
|
+
onNone: () => Effect.succeed([]),
|
|
17081
|
+
onSome: (file) => fs.readFileString(file).pipe(Effect.orDie, Effect.map((source) => [{
|
|
17082
|
+
file: target,
|
|
17083
|
+
previous: "",
|
|
17084
|
+
setup: source,
|
|
17085
|
+
source
|
|
17086
|
+
}]))
|
|
17087
|
+
});
|
|
17088
|
+
});
|
|
17089
|
+
const cacheWorkflow = ({ root, workflows, usesSetup }) => Effect.gen(function* planCacheWorkflow() {
|
|
17090
|
+
const path = yield* Path.Path;
|
|
17091
|
+
if (!usesSetup || pipe(workflows, Array$1.some(({ rewritten }) => rewritten.callsMaintain))) return [];
|
|
17092
|
+
return [pipe(workflows, Array$1.findFirst(({ name }) => name === CACHE_WORKFLOW), Option.match({
|
|
17093
|
+
onNone: () => ({
|
|
17094
|
+
file: path.join(root, WORKFLOWS$1, CACHE_WORKFLOW),
|
|
17095
|
+
previous: "",
|
|
17096
|
+
setup: CACHE_WORKFLOW_SOURCE,
|
|
17097
|
+
source: CACHE_WORKFLOW_SOURCE
|
|
17098
|
+
}),
|
|
17099
|
+
onSome: ({ file, rewritten, source }) => {
|
|
17100
|
+
const maintained = withFinishJob(addMaintainJob({
|
|
17101
|
+
source: rewritten.source,
|
|
17102
|
+
jobs: rewritten.jobs
|
|
17103
|
+
}));
|
|
17104
|
+
return {
|
|
17105
|
+
file,
|
|
17106
|
+
previous: source,
|
|
17107
|
+
setup: maintained,
|
|
17108
|
+
source: maintained
|
|
17109
|
+
};
|
|
17110
|
+
}
|
|
17111
|
+
}))];
|
|
17112
|
+
});
|
|
17113
|
+
/** @internal */
|
|
17114
|
+
const addedFiles = (outline, localSetups) => Effect.gen(function* planAddedFiles() {
|
|
17115
|
+
const path = yield* Path.Path;
|
|
17116
|
+
if (!outline.usesSetup) return [];
|
|
17117
|
+
const cache = yield* cacheWorkflow(outline);
|
|
17118
|
+
const packages = yield* packagesChange(path.join(outline.root, ACTIONS$1), localSetups);
|
|
17119
|
+
return [...cache, ...packages];
|
|
17120
|
+
});
|
|
16972
17121
|
// src/features/check-workflows/model/apply-template.ts
|
|
16973
17122
|
const LAST_NEWLINE = /\n?$/u;
|
|
16974
17123
|
const NEWLINE = "\n";
|
|
16975
|
-
const rangeOf$
|
|
17124
|
+
const rangeOf$2 = (node) => pipe(Option.liftPredicate(node, isNode), Option.flatMapNullishOr(({ range }) => range));
|
|
16976
17125
|
const jobNamed = (source, name) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(({ items }) => Array$1.findFirst(items, ({ key }) => scalarText(key) === name)));
|
|
16977
17126
|
const pairSpan = (source, pair) => Option.all({
|
|
16978
|
-
start: Option.map(rangeOf$
|
|
17127
|
+
start: Option.map(rangeOf$2(pair.key), ([offset]) => lineStart({
|
|
16979
17128
|
source,
|
|
16980
17129
|
offset
|
|
16981
17130
|
})),
|
|
16982
|
-
end: Option.map(rangeOf$
|
|
17131
|
+
end: Option.map(rangeOf$2(pair.value), ([, end]) => end)
|
|
16983
17132
|
});
|
|
16984
17133
|
const fieldOfJob = (source, job, field) => pipe(jobNamed(source, job), Option.flatMap(({ value }) => Option.liftPredicate(value, isMap)), Option.flatMap(({ items }) => Array$1.findFirst(items, ({ key }) => scalarText(key) === field)));
|
|
16985
17134
|
const inputsSpan = (source, job) => pipe(fieldOfJob(source, job, "with"), Option.flatMap((pair) => pairSpan(source, pair)));
|
|
@@ -17003,76 +17152,6 @@ const fromTemplate = ({ templates, name, source }) => pipe(templates, Array$1.fi
|
|
|
17003
17152
|
onNone: () => source,
|
|
17004
17153
|
onSome: (template) => applied(template, source)
|
|
17005
17154
|
}));
|
|
17006
|
-
// src/features/check-workflows/model/shared-actions.ts
|
|
17007
|
-
const ACTIONS_REF = "1f825b932e1a85233322991acd805c65b75dc358";
|
|
17008
|
-
const REPOSITORY = `${SELF_REPOSITORY}/.github`;
|
|
17009
|
-
const actionPath = (name) => `${REPOSITORY}/shared-actions/${name}`;
|
|
17010
|
-
const workflowPath = (file) => `${REPOSITORY}/workflows/${file}`;
|
|
17011
|
-
const SETUP_ACTION = actionPath("setup");
|
|
17012
|
-
const VERIFY_ACTION = actionPath("verify");
|
|
17013
|
-
const MAINTAIN_WORKFLOW_FILE = "maintain-caches.yml";
|
|
17014
|
-
const MAINTAIN_WORKFLOW = workflowPath(MAINTAIN_WORKFLOW_FILE);
|
|
17015
|
-
const KINDS = String.raw`${REPOSITORY}/(?:shared-actions|workflows)/`;
|
|
17016
|
-
const ACTIONS_USE = new RegExp(String.raw`^${KINDS}[^@]+@`, "u");
|
|
17017
|
-
const pinned = (path) => `${path}@${ACTIONS_REF}`;
|
|
17018
|
-
const CACHE_WORKFLOW = "cache.yml";
|
|
17019
|
-
const DEFAULT_BRANCH_ONLY = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
|
|
17020
|
-
const REGISTRY_ACCESS = `\${{ secrets.TAKUMI_GUARD_TOKEN }}`;
|
|
17021
|
-
const CACHE_WORKFLOW_SOURCE = Array$1.join([
|
|
17022
|
-
"name: cache",
|
|
17023
|
-
"",
|
|
17024
|
-
"on:",
|
|
17025
|
-
" schedule:",
|
|
17026
|
-
" - cron: \"47 * * * *\"",
|
|
17027
|
-
" workflow_dispatch:",
|
|
17028
|
-
"",
|
|
17029
|
-
"permissions: {}",
|
|
17030
|
-
"",
|
|
17031
|
-
"jobs:",
|
|
17032
|
-
" caches:",
|
|
17033
|
-
` if: ${DEFAULT_BRANCH_ONLY}`,
|
|
17034
|
-
" permissions:",
|
|
17035
|
-
" actions: write",
|
|
17036
|
-
" contents: read",
|
|
17037
|
-
` uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
17038
|
-
" secrets:",
|
|
17039
|
-
` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
|
|
17040
|
-
""
|
|
17041
|
-
], "\n");
|
|
17042
|
-
const PINNED_USE = new RegExp(String.raw`(?<use>${KINDS}[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
|
|
17043
|
-
const refsIn = (source) => pipe(source, String$1.matchAll(PINNED_USE), Array$1.fromIterable, Array$1.flatMap(({ groups }) => pipe(Option.fromNullishOr(groups), Option.flatMap(Record.get("ref")), Option.toArray)));
|
|
17044
|
-
const withoutRefs = (source) => pipe(source, String$1.replaceAll(PINNED_USE, "$<use>"));
|
|
17045
|
-
// src/features/check-workflows/model/cache-workflow.ts
|
|
17046
|
-
const INDENT$2 = " ";
|
|
17047
|
-
const CALL = "caches";
|
|
17048
|
-
const jobText = (jobs) => pipe([
|
|
17049
|
-
"",
|
|
17050
|
-
`${INDENT$2}${CALL}:`,
|
|
17051
|
-
`${INDENT$2}${INDENT$2}needs: [${pipe(jobs, Array$1.join(", "))}]`,
|
|
17052
|
-
`${INDENT$2}${INDENT$2}if: always() && ${DEFAULT_BRANCH_ONLY}`,
|
|
17053
|
-
`${INDENT$2}${INDENT$2}permissions:`,
|
|
17054
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}actions: write`,
|
|
17055
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}contents: read`,
|
|
17056
|
-
`${INDENT$2}${INDENT$2}uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
17057
|
-
`${INDENT$2}${INDENT$2}secrets:`,
|
|
17058
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`
|
|
17059
|
-
], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
17060
|
-
/** @internal */
|
|
17061
|
-
const addMaintainJob = ({ source, jobs, telemetryNeeds }) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(endOf), Option.match({
|
|
17062
|
-
onNone: () => source,
|
|
17063
|
-
onSome: (at) => applyEdits({
|
|
17064
|
-
source,
|
|
17065
|
-
edits: [{
|
|
17066
|
-
start: at,
|
|
17067
|
-
end: at,
|
|
17068
|
-
text: jobText(jobs)
|
|
17069
|
-
}, ...pipe(telemetryNeeds, Array$1.map((start) => ({
|
|
17070
|
-
start,
|
|
17071
|
-
end: start,
|
|
17072
|
-
text: `, ${CALL}`
|
|
17073
|
-
})))]
|
|
17074
|
-
})
|
|
17075
|
-
}));
|
|
17076
17155
|
// src/features/check-workflows/model/drift.ts
|
|
17077
17156
|
const SINGLE_REF = 1;
|
|
17078
17157
|
/** @internal */
|
|
@@ -17108,7 +17187,12 @@ const VP_COMMAND = /(?:^|[\s;&|(])vpx?\s/u;
|
|
|
17108
17187
|
const SETUP_INPUTS = [
|
|
17109
17188
|
["cache", "\"true\""],
|
|
17110
17189
|
["save", "\"false\""],
|
|
17111
|
-
["session-path", "\"true\""]
|
|
17190
|
+
["session-path", "\"true\""],
|
|
17191
|
+
["native", "\"false\""],
|
|
17192
|
+
["tools", "\"\""],
|
|
17193
|
+
["rust-cache", "\"false\""],
|
|
17194
|
+
["sccache", "\"false\""],
|
|
17195
|
+
["telemetry", "\"false\""]
|
|
17112
17196
|
];
|
|
17113
17197
|
const INDENT$1 = " ";
|
|
17114
17198
|
const FIRST$9 = 0;
|
|
@@ -17118,19 +17202,20 @@ const isManaged = (step) => pipe(usesOf(step), String$1.startsWith(SETUP_VP_USE)
|
|
|
17118
17202
|
const localAction = (step) => pipe(LOCAL_USE.exec(usesOf(step)), Option.fromNullishOr, Option.flatMapNullishOr(({ groups }) => groups), Option.flatMap(Record.get("name")));
|
|
17119
17203
|
const isSetup = (localSetups) => (step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`)) || pipe(localAction(step), Option.exists((name) => localSetups.has(name)));
|
|
17120
17204
|
const runsVp = (step) => pipe(usesOf(step), String$1.startsWith(`${VERIFY_ACTION}@`)) || VP_COMMAND.test(runOf(step));
|
|
17121
|
-
const
|
|
17205
|
+
const NOTHING_GIVEN = () => Option.none();
|
|
17206
|
+
const valueOf$1 = (inputs, given, [name, fallback]) => {
|
|
17122
17207
|
if (pipe(inputs, Array$1.contains(name))) return `\${{ inputs.${name} }}`;
|
|
17123
|
-
return fallback;
|
|
17208
|
+
return Option.getOrElse(given(name), () => fallback);
|
|
17124
17209
|
};
|
|
17125
|
-
const inputLines = (inputs, pad) => [`${pad}with:`, ...pipe(SETUP_INPUTS, Array$1.map((
|
|
17210
|
+
const inputLines = (inputs, given, pad) => [`${pad}with:`, ...pipe(SETUP_INPUTS, Array$1.map((input) => `${pad}${INDENT$1}${input[FIRST$9]}: ${valueOf$1(inputs, given, input)}`))];
|
|
17126
17211
|
const prefixOf = (source, step) => pipe(startOf$2(step), Option.map((start) => pipe(source, String$1.slice(lineStart({
|
|
17127
17212
|
source,
|
|
17128
17213
|
offset: start
|
|
17129
17214
|
}), start))), Option.getOrElse(() => ""));
|
|
17130
|
-
const setupText = ({ source, inputs }, sample) => {
|
|
17215
|
+
const setupText = ({ source, inputs }, sample, given = NOTHING_GIVEN) => {
|
|
17131
17216
|
const prefix = prefixOf(source, sample);
|
|
17132
17217
|
const pad = pipe(" ", String$1.repeat(prefix.length));
|
|
17133
|
-
return pipe([`${prefix}uses: ${pinned(SETUP_ACTION)}`, ...inputLines(inputs, pad)], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
17218
|
+
return pipe([`${prefix}uses: ${pinned(SETUP_ACTION)}`, ...inputLines(inputs, given, pad)], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
17134
17219
|
};
|
|
17135
17220
|
const removal = (source, step) => Option.zipWith(startOf$2(step), endOf(step), (start, end) => ({
|
|
17136
17221
|
start: lineStart({
|
|
@@ -17162,20 +17247,30 @@ const managedEdits = (rewrite, items) => {
|
|
|
17162
17247
|
return removal(rewrite.source, step);
|
|
17163
17248
|
}), Array$1.getSomes);
|
|
17164
17249
|
};
|
|
17165
|
-
|
|
17166
|
-
const
|
|
17167
|
-
|
|
17168
|
-
|
|
17250
|
+
const quotedValue = (rewrite, node) => pipe(Option.liftPredicate(node, isNode), Option.flatMapNullishOr(({ range }) => range), Option.map(([start, end]) => pipe(rewrite.source, String$1.slice(start, end), String$1.trim)));
|
|
17251
|
+
const givenBy = (rewrite, step) => (name) => pipe(Option.liftPredicate(step, isMap), Option.flatMap((map) => Option.fromNullishOr(map.getIn(["with", name], true))), Option.flatMap((node) => quotedValue(rewrite, node)));
|
|
17252
|
+
const wrapperEdits = (rewrite, items) => pipe(items, Array$1.filter((step) => pipe(localAction(step), Option.exists((name) => rewrite.localSetups.has(name)))), Array$1.map((step) => Option.map(removal(rewrite.source, step), (edit) => ({
|
|
17253
|
+
...edit,
|
|
17254
|
+
text: setupText(rewrite, step, givenBy(rewrite, step))
|
|
17255
|
+
}))), Array$1.getSomes);
|
|
17256
|
+
const setupEdits = (rewrite, items) => {
|
|
17169
17257
|
if (pipe(items, Array$1.some(isManaged))) return managedEdits(rewrite, items);
|
|
17170
17258
|
const needsSetup = pipe(items, Array$1.some(runsVp));
|
|
17171
17259
|
const hasSetup = pipe(items, Array$1.some(isSetup(rewrite.localSetups)));
|
|
17172
17260
|
if (needsSetup && !hasSetup) return pipe(insertion(rewrite, items), Option.toArray);
|
|
17173
17261
|
return [];
|
|
17174
17262
|
};
|
|
17263
|
+
/** @internal */
|
|
17264
|
+
const stepEdits = (rewrite) => {
|
|
17265
|
+
if (!isSeq(rewrite.steps)) return [];
|
|
17266
|
+
const items = rewrite.steps.items;
|
|
17267
|
+
return Array$1.match(wrapperEdits(rewrite, items), {
|
|
17268
|
+
onEmpty: () => setupEdits(rewrite, items),
|
|
17269
|
+
onNonEmpty: (wrappers) => wrappers
|
|
17270
|
+
});
|
|
17271
|
+
};
|
|
17175
17272
|
// src/features/check-workflows/model/rewrite-document.ts
|
|
17176
17273
|
const AFTER_REF = /@.*$/u;
|
|
17177
|
-
const CLOSING_BRACKET = 1;
|
|
17178
|
-
const TELEMETRY_USE = /\/ci-telemetry@/u;
|
|
17179
17274
|
const pinEdits = (document, source) => {
|
|
17180
17275
|
const found = [];
|
|
17181
17276
|
visit$1(document, { Pair: (_key, pair) => {
|
|
@@ -17197,8 +17292,8 @@ const actionSteps = (document) => {
|
|
|
17197
17292
|
const allSteps = (document) => pipe(jobsOf(document), Array$1.flatMap(stepsOf), Array$1.appendAll(actionSteps(document)));
|
|
17198
17293
|
const includesSetup = (document) => pipe(allSteps(document), Array$1.some((step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`))));
|
|
17199
17294
|
const callsMaintain = (document) => pipe(jobsOf(document), Array$1.some((job) => pipe(usesOf(job), String$1.startsWith(`${MAINTAIN_WORKFLOW}@`))));
|
|
17200
|
-
const
|
|
17201
|
-
const
|
|
17295
|
+
const tokenEdits = (document, source) => pipe(allSteps(document), Array$1.map(tokenEdit(source)), Array$1.getSomes);
|
|
17296
|
+
const telemetryEdits = (document, source) => pipe(allSteps(document), Array$1.map(telemetryEdit(source)), Array$1.getSomes);
|
|
17202
17297
|
const inputNames = (document) => pipe(tableAt(document, ["inputs"]), Array$1.map(([name]) => name));
|
|
17203
17298
|
/** @internal */
|
|
17204
17299
|
const rewriteDocument = ({ source, localSetups }) => {
|
|
@@ -17209,7 +17304,7 @@ const rewriteDocument = ({ source, localSetups }) => {
|
|
|
17209
17304
|
source,
|
|
17210
17305
|
localSetups,
|
|
17211
17306
|
inputs
|
|
17212
|
-
})), Array$1.appendAll(pinEdits(document, source)));
|
|
17307
|
+
})), Array$1.appendAll(pinEdits(document, source)), Array$1.appendAll(tokenEdits(document, source)), Array$1.appendAll(telemetryEdits(document, source)));
|
|
17213
17308
|
const rewritten = applyEdits({
|
|
17214
17309
|
source,
|
|
17215
17310
|
edits
|
|
@@ -17219,8 +17314,7 @@ const rewriteDocument = ({ source, localSetups }) => {
|
|
|
17219
17314
|
source: rewritten,
|
|
17220
17315
|
includesSetup: includesSetup(result),
|
|
17221
17316
|
callsMaintain: callsMaintain(result),
|
|
17222
|
-
|
|
17223
|
-
jobs: pipe(tableAt(result, ["jobs"]), Array$1.filter(([, job]) => !reportsTelemetry(job)), Array$1.map(([name]) => name))
|
|
17317
|
+
jobs: pipe(tableAt(result, ["jobs"]), Array$1.filter(([, job]) => !reportsFinish(job)), Array$1.map(([name]) => name))
|
|
17224
17318
|
};
|
|
17225
17319
|
};
|
|
17226
17320
|
// src/features/check-workflows/model/template-workflows.ts
|
|
@@ -17266,16 +17360,51 @@ const UPDATE_BRANCHES_SOURCE = Array$1.join([
|
|
|
17266
17360
|
` uses: ${pinned(workflowPath("update-branches.yml"))}`,
|
|
17267
17361
|
""
|
|
17268
17362
|
], "\n");
|
|
17363
|
+
const PUBLISH_SOURCE = Array$1.join([
|
|
17364
|
+
"name: publish",
|
|
17365
|
+
"",
|
|
17366
|
+
"on:",
|
|
17367
|
+
" workflow_dispatch:",
|
|
17368
|
+
" inputs:",
|
|
17369
|
+
" workspace:",
|
|
17370
|
+
" description: Workspace directory to publish",
|
|
17371
|
+
" required: true",
|
|
17372
|
+
" type: string",
|
|
17373
|
+
"",
|
|
17374
|
+
"permissions: {}",
|
|
17375
|
+
"",
|
|
17376
|
+
"jobs:",
|
|
17377
|
+
" publish:",
|
|
17378
|
+
" permissions:",
|
|
17379
|
+
" actions: read",
|
|
17380
|
+
" contents: write",
|
|
17381
|
+
" id-token: write",
|
|
17382
|
+
` uses: ${pinned(workflowPath("publish.yml"))}`,
|
|
17383
|
+
" with:",
|
|
17384
|
+
` workspace: \${{ inputs.workspace }}`,
|
|
17385
|
+
" secrets:",
|
|
17386
|
+
` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
|
|
17387
|
+
` TAURI_SIGNING_PRIVATE_KEY: \${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}`,
|
|
17388
|
+
""
|
|
17389
|
+
], "\n");
|
|
17269
17390
|
/** @internal */
|
|
17270
|
-
const TEMPLATE_WORKFLOWS = [
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
17278
|
-
|
|
17391
|
+
const TEMPLATE_WORKFLOWS = [
|
|
17392
|
+
{
|
|
17393
|
+
name: "up-to-date.yml",
|
|
17394
|
+
source: UP_TO_DATE_SOURCE,
|
|
17395
|
+
ownInputs: ["up-to-date"]
|
|
17396
|
+
},
|
|
17397
|
+
{
|
|
17398
|
+
name: "update-branches.yml",
|
|
17399
|
+
source: UPDATE_BRANCHES_SOURCE,
|
|
17400
|
+
ownInputs: []
|
|
17401
|
+
},
|
|
17402
|
+
{
|
|
17403
|
+
name: "publish.yml",
|
|
17404
|
+
source: PUBLISH_SOURCE,
|
|
17405
|
+
ownInputs: []
|
|
17406
|
+
}
|
|
17407
|
+
];
|
|
17279
17408
|
// src/features/check-workflows/model/sync-ci.ts
|
|
17280
17409
|
const WORKFLOWS = ".github/workflows";
|
|
17281
17410
|
const ACTIONS = ".github/actions";
|
|
@@ -17324,31 +17453,13 @@ const rewriteAll = (sources, localSetups) => pipe(sources, Array$1.map((found) =
|
|
|
17324
17453
|
localSetups
|
|
17325
17454
|
})
|
|
17326
17455
|
})));
|
|
17327
|
-
const
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
setup: CACHE_WORKFLOW_SOURCE,
|
|
17335
|
-
source: CACHE_WORKFLOW_SOURCE
|
|
17336
|
-
}),
|
|
17337
|
-
onSome: ({ file, rewritten, source }) => {
|
|
17338
|
-
const maintained = addMaintainJob({
|
|
17339
|
-
source: rewritten.source,
|
|
17340
|
-
jobs: rewritten.jobs,
|
|
17341
|
-
telemetryNeeds: rewritten.telemetryNeeds
|
|
17342
|
-
});
|
|
17343
|
-
return {
|
|
17344
|
-
file,
|
|
17345
|
-
previous: source,
|
|
17346
|
-
setup: maintained,
|
|
17347
|
-
source: maintained
|
|
17348
|
-
};
|
|
17349
|
-
}
|
|
17350
|
-
}))];
|
|
17351
|
-
});
|
|
17456
|
+
const finishedOnce = (results) => pipe(results, Array$1.map((result) => ({
|
|
17457
|
+
...result,
|
|
17458
|
+
rewritten: {
|
|
17459
|
+
...result.rewritten,
|
|
17460
|
+
source: withFinishJob(result.rewritten.source)
|
|
17461
|
+
}
|
|
17462
|
+
})));
|
|
17352
17463
|
const write = (root, { file, source }) => Effect.gen(function* writeChanged() {
|
|
17353
17464
|
const fs = yield* FileSystem.FileSystem;
|
|
17354
17465
|
const path = yield* Path.Path;
|
|
@@ -17367,25 +17478,26 @@ const isHost = (root) => Effect.gen(function* findMaintainWorkflow() {
|
|
|
17367
17478
|
});
|
|
17368
17479
|
const planRewrites = (root, workflows, actions) => Effect.gen(function* planChanges() {
|
|
17369
17480
|
const localSetups = settle(actions, /* @__PURE__ */ new Set());
|
|
17370
|
-
const
|
|
17481
|
+
const pinnedWorkflows = rewriteAll(workflows, localSetups);
|
|
17371
17482
|
const rewrittenActions = rewriteAll(actions, localSetups);
|
|
17372
|
-
const usesSetup = pipe([...rewrittenActions, ...
|
|
17373
|
-
const
|
|
17483
|
+
const usesSetup = pipe([...rewrittenActions, ...pinnedWorkflows], Array$1.some(({ rewritten }) => rewritten.includesSetup));
|
|
17484
|
+
const rewrittenWorkflows = finishedOnce(pinnedWorkflows);
|
|
17485
|
+
const created = yield* addedFiles({
|
|
17374
17486
|
root,
|
|
17375
17487
|
workflows: rewrittenWorkflows,
|
|
17376
17488
|
usesSetup
|
|
17377
|
-
});
|
|
17489
|
+
}, localSetups);
|
|
17378
17490
|
const templates = pipe(TEMPLATE_WORKFLOWS, Array$1.filter(() => usesSetup));
|
|
17379
17491
|
return {
|
|
17380
17492
|
changes: pipe([...rewrittenActions, ...rewrittenWorkflows], Array$1.map(({ file, name, rewritten, source }) => ({
|
|
17381
17493
|
file,
|
|
17382
17494
|
previous: source,
|
|
17383
17495
|
setup: rewritten.source,
|
|
17384
|
-
source: fromTemplate({
|
|
17496
|
+
source: withFinishJob(fromTemplate({
|
|
17385
17497
|
templates,
|
|
17386
17498
|
name,
|
|
17387
17499
|
source: rewritten.source
|
|
17388
|
-
})
|
|
17500
|
+
}))
|
|
17389
17501
|
})), Array$1.filter(({ previous, source }) => previous !== source), Array$1.filter(({ file }) => !pipe(created, Array$1.some((change) => change.file === file))), Array$1.appendAll(created)),
|
|
17390
17502
|
sources: [...actions, ...workflows]
|
|
17391
17503
|
};
|
|
@@ -17407,7 +17519,7 @@ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effe
|
|
|
17407
17519
|
const SETUP_RULE$1 = "ci-setup";
|
|
17408
17520
|
const REF_RULE = "ci-template-ref";
|
|
17409
17521
|
const WORKFLOW_RULE = "ci-template-workflow";
|
|
17410
|
-
const SETUP_MESSAGE = "differs from what `msch ci` writes. Run `msch ci`: it puts the shared `setup` action where a job runs `vp`, removes the hand-written cache steps
|
|
17522
|
+
const SETUP_MESSAGE = "differs from what `msch ci` writes. Run `msch ci`: it puts the shared `setup` action where a job runs `vp`, removes the hand-written cache steps, keeps the cache workflow that cleans up old entries, and replaces the ci-telemetry and wake jobs of a workflow with one job that calls the shared finished workflow after every other job, which records the run and reports a failure.";
|
|
17411
17523
|
const REF_MESSAGE = "pins a different commit of the template than the other workflows. Run `msch ci` to pin them all to one.";
|
|
17412
17524
|
const WORKFLOW_MESSAGE = "differs from the template's workflow, which Renovate does not update because it only moves the pinned commits. Run `msch ci`: it writes the template's triggers and jobs, which call the shared queue workflows, and keeps the inputs the repository gives them.";
|
|
17413
17525
|
const setupProblem$1 = problemInFile(SETUP_RULE$1);
|
|
@@ -17423,7 +17535,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
17423
17535
|
const RULE$34 = "optional-input";
|
|
17424
17536
|
const ACTION_FILE = /^\.github\/(?:.+\/)?action\.ya?ml$/u;
|
|
17425
17537
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
17426
|
-
const START$
|
|
17538
|
+
const START$20 = 0;
|
|
17427
17539
|
const pairsAt = (document, path) => pipe(Option.liftPredicate(document.getIn(path, true), isMap), Option.map(({ items }) => items), Option.getOrElse(() => []));
|
|
17428
17540
|
const declaredIn$2 = (name, document) => {
|
|
17429
17541
|
if (ACTION_FILE.test(name)) return pipe(pairsAt(document, ["inputs"]), Array$1.map((pair) => ({
|
|
@@ -17447,9 +17559,9 @@ const declaredIn$2 = (name, document) => {
|
|
|
17447
17559
|
})))];
|
|
17448
17560
|
};
|
|
17449
17561
|
const isRequired = ({ pair }) => pipe(Option.liftPredicate(pair.value, isMap), Option.map((map) => map.get("required", true)), Option.exists((required) => isScalar(required) && required.value === true));
|
|
17450
|
-
const startOf$1 = ({ pair }) => pipe(Option.liftPredicate(pair.key, isScalar), Option.flatMapNullishOr(({ range }) => range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
17562
|
+
const startOf$1 = ({ pair }) => pipe(Option.liftPredicate(pair.key, isScalar), Option.flatMapNullishOr(({ range }) => range), Option.map(([start]) => start), Option.getOrElse(() => START$20));
|
|
17451
17563
|
const messageOf$1 = ({ kind, pair }) => `declares the ${kind} \`${scalarText(pair.key)}\` without \`required: true\`. Actions and reusable workflows take no optional ${kind}s: make it required and have every caller pass it, or remove it when no caller needs it.`;
|
|
17452
|
-
const problemsIn$
|
|
17564
|
+
const problemsIn$11 = (file, name, source) => {
|
|
17453
17565
|
const at = problemAtIndex(RULE$34)(file, source);
|
|
17454
17566
|
return pipe(declaredIn$2(name, parseDocument(source)), Array$1.filter((declared) => !isRequired(declared)), Array$1.map((declared) => at(startOf$1(declared), messageOf$1(declared))));
|
|
17455
17567
|
};
|
|
@@ -17457,7 +17569,7 @@ const problemsIn$12 = (file, name, source) => {
|
|
|
17457
17569
|
const checkOptionalInputs = Effect.fn("checkOptionalInputs")(function* checkOptionalInputs(root) {
|
|
17458
17570
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
17459
17571
|
const names = pipe(listed, Array$1.filter((name) => ACTION_FILE.test(name) || WORKFLOW_FILE.test(name)));
|
|
17460
|
-
return yield* problemsInFiles(root, names, ({ file, name, source }) => problemsIn$
|
|
17572
|
+
return yield* problemsInFiles(root, names, ({ file, name, source }) => problemsIn$11(file, name, source));
|
|
17461
17573
|
});
|
|
17462
17574
|
// src/features/check-workflows/model/installed-version.ts
|
|
17463
17575
|
const RANGE_PREFIX = /^[\^~]/u;
|
|
@@ -17486,15 +17598,6 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
17486
17598
|
message: MESSAGE$7
|
|
17487
17599
|
})));
|
|
17488
17600
|
});
|
|
17489
|
-
// src/features/check-workflows/model/workflow-lint.ts
|
|
17490
|
-
const checkWorkflowLint = checkSection({
|
|
17491
|
-
name: "checkWorkflowLint",
|
|
17492
|
-
rule: "workflow-lint",
|
|
17493
|
-
pick: fu4Section,
|
|
17494
|
-
pathspecs: (config) => workflowPathspecs({ config }),
|
|
17495
|
-
lint: lint$2,
|
|
17496
|
-
detail: () => ""
|
|
17497
|
-
});
|
|
17498
17601
|
// src/app/tool-use.ts
|
|
17499
17602
|
/** @internal */
|
|
17500
17603
|
const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
@@ -17509,11 +17612,8 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
17509
17612
|
checkReleasePlease(root),
|
|
17510
17613
|
checkRestrictedRules(root),
|
|
17511
17614
|
checkTypeExemptions(root),
|
|
17512
|
-
checkMarkdown(root),
|
|
17513
17615
|
checkLegacyWeb(root),
|
|
17514
|
-
checkDocumentedCommands(root)
|
|
17515
|
-
checkStructure(root),
|
|
17516
|
-
checkWorkflowLint(root)
|
|
17616
|
+
checkDocumentedCommands(root)
|
|
17517
17617
|
], { concurrency: "unbounded" });
|
|
17518
17618
|
return Array$1.flatten(found);
|
|
17519
17619
|
});
|
|
@@ -17642,7 +17742,7 @@ const COMMENT_NODES = [
|
|
|
17642
17742
|
"block_comment",
|
|
17643
17743
|
"multiline_comment"
|
|
17644
17744
|
];
|
|
17645
|
-
const START$
|
|
17745
|
+
const START$19 = 0;
|
|
17646
17746
|
const NEXT$1 = 1;
|
|
17647
17747
|
const NONE$3 = [];
|
|
17648
17748
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -17692,7 +17792,7 @@ const markupComment = (source) => (node) => {
|
|
|
17692
17792
|
}];
|
|
17693
17793
|
};
|
|
17694
17794
|
const textComments = (grammars, grammar) => (text) => {
|
|
17695
|
-
const shift = shifted(text.startIndex ?? START$
|
|
17795
|
+
const shift = shifted(text.startIndex ?? START$19);
|
|
17696
17796
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
17697
17797
|
};
|
|
17698
17798
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -17776,8 +17876,8 @@ const RULE$32 = "comment";
|
|
|
17776
17876
|
const SUPPRESSION_RULE = "suppression";
|
|
17777
17877
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
17778
17878
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
17779
|
-
const READ_CONCURRENCY$
|
|
17780
|
-
const START$
|
|
17879
|
+
const READ_CONCURRENCY$13 = 64;
|
|
17880
|
+
const START$18 = 0;
|
|
17781
17881
|
const SHEBANG = "#!";
|
|
17782
17882
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
17783
17883
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
@@ -17792,11 +17892,11 @@ const taggedError$8 = Schema.TaggedError;
|
|
|
17792
17892
|
var CommentConfigUnreadable = class extends taggedError$8()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
17793
17893
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
17794
17894
|
const lineBefore = (source, index) => {
|
|
17795
|
-
const lines = pipe(source, String$1.slice(START$
|
|
17895
|
+
const lines = pipe(source, String$1.slice(START$18, index), String$1.split("\n"));
|
|
17796
17896
|
return Option.getOrElse(Array$1.last(lines), () => "");
|
|
17797
17897
|
};
|
|
17798
17898
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
17799
|
-
const isShebang = ({ index, text }) => index === START$
|
|
17899
|
+
const isShebang = ({ index, text }) => index === START$18 && String$1.startsWith(SHEBANG)(text);
|
|
17800
17900
|
const isSuppression = (comment) => SUPPRESSION.test(comment.text);
|
|
17801
17901
|
const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
|
|
17802
17902
|
const NOTHING = {
|
|
@@ -17814,7 +17914,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
17814
17914
|
const file = files.join(root, CONFIG_FILE$3);
|
|
17815
17915
|
if (!(yield* files.exists(file))) return NO_SETTINGS;
|
|
17816
17916
|
const config = yield* Effect.tryPromise({
|
|
17817
|
-
try: () =>
|
|
17917
|
+
try: () => resolvedViteConfig(file),
|
|
17818
17918
|
catch: () => CommentConfigUnreadable.make({ file })
|
|
17819
17919
|
}).pipe(Effect.option);
|
|
17820
17920
|
return pipe(config, Option.flatMap(Schema.decodeUnknownOption(RootConfig)), Option.match({
|
|
@@ -17824,7 +17924,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
17824
17924
|
});
|
|
17825
17925
|
const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
|
|
17826
17926
|
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));
|
|
17827
|
-
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$
|
|
17927
|
+
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$18));
|
|
17828
17928
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
17829
17929
|
const files = yield* RepositoryFiles;
|
|
17830
17930
|
const file = files.join(root, CONFIG_FILE$3);
|
|
@@ -17841,7 +17941,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
17841
17941
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
17842
17942
|
used: usedAllowances(allowances, found)
|
|
17843
17943
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
17844
|
-
problems: [problemAtIndex(RULE$32)(file, source)(START$
|
|
17944
|
+
problems: [problemAtIndex(RULE$32)(file, source)(START$18, `msch could not read the comments in this file: ${message}`)],
|
|
17845
17945
|
used: []
|
|
17846
17946
|
})))
|
|
17847
17947
|
});
|
|
@@ -17860,7 +17960,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
17860
17960
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
17861
17961
|
onNone: () => Effect.succeed(NOTHING),
|
|
17862
17962
|
onSome: (source) => scan(entry, source)
|
|
17863
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17963
|
+
}))), { concurrency: READ_CONCURRENCY$13 });
|
|
17864
17964
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
17865
17965
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
17866
17966
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -17965,7 +18065,7 @@ const ROOT_DIRECTORY$2 = ".";
|
|
|
17965
18065
|
const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
|
|
17966
18066
|
const MESSAGE$5 = "is a version written in this package.json. Add it to the catalog in pnpm-workspace.yaml and write `catalog:` here, so that one entry owns the version and every package that uses the dependency moves together.";
|
|
17967
18067
|
const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((protocol) => String$1.startsWith(protocol)(specifier)));
|
|
17968
|
-
const problemsIn$
|
|
18068
|
+
const problemsIn$10 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
17969
18069
|
file: entry.file,
|
|
17970
18070
|
...positionOf(source)(offsetIn(source)(manifestPattern(found))),
|
|
17971
18071
|
rule: RULE$31,
|
|
@@ -17983,7 +18083,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17983
18083
|
file: files.join(root, name)
|
|
17984
18084
|
};
|
|
17985
18085
|
}));
|
|
17986
|
-
return yield* scanText(listed, problemsIn$
|
|
18086
|
+
return yield* scanText(listed, problemsIn$10);
|
|
17987
18087
|
});
|
|
17988
18088
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
17989
18089
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
@@ -18026,7 +18126,7 @@ const ENTRY_RULE = "unlocked-skill";
|
|
|
18026
18126
|
const VISIBLE_RULE = "skill-source-visible";
|
|
18027
18127
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
18028
18128
|
const SOURCE_SEPARATOR = "/";
|
|
18029
|
-
const START$
|
|
18129
|
+
const START$17 = 0;
|
|
18030
18130
|
const LOCAL_PREFIX = "./";
|
|
18031
18131
|
const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
|
|
18032
18132
|
const Source = Schema.Struct({
|
|
@@ -18039,7 +18139,7 @@ const taggedError$7 = Schema.TaggedError;
|
|
|
18039
18139
|
var SkillsConfigUnreadable = class extends taggedError$7()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
18040
18140
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
18041
18141
|
file,
|
|
18042
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
18142
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$17))),
|
|
18043
18143
|
rule,
|
|
18044
18144
|
message
|
|
18045
18145
|
});
|
|
@@ -18049,7 +18149,7 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
|
|
|
18049
18149
|
const text = yield* files.readFile(file);
|
|
18050
18150
|
if (Option.isNone(text)) return Option.none();
|
|
18051
18151
|
const config = yield* Effect.tryPromise({
|
|
18052
|
-
try: () =>
|
|
18152
|
+
try: () => resolvedViteConfig(file),
|
|
18053
18153
|
catch: () => SkillsConfigUnreadable.make({ file })
|
|
18054
18154
|
}).pipe(Effect.option);
|
|
18055
18155
|
return pipe(config, Option.flatMap(decodeSkills), Option.map(({ skills }) => ({
|
|
@@ -18100,7 +18200,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
|
|
|
18100
18200
|
const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
|
|
18101
18201
|
return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
|
|
18102
18202
|
}, Effect.scoped);
|
|
18103
|
-
const problemsIn$
|
|
18203
|
+
const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
|
|
18104
18204
|
const files = yield* RepositoryFiles;
|
|
18105
18205
|
const directory = files.join(root, project.directory);
|
|
18106
18206
|
const manifest = files.join(directory, PACKAGE_JSON_FILE);
|
|
@@ -18112,7 +18212,7 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, project
|
|
|
18112
18212
|
/** @internal */
|
|
18113
18213
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
18114
18214
|
const projects = yield* publishedProjects(root);
|
|
18115
|
-
const problems = yield* Effect.forEach(projects, (project) => problemsIn$
|
|
18215
|
+
const problems = yield* Effect.forEach(projects, (project) => problemsIn$9(root, project), { concurrency: 1 });
|
|
18116
18216
|
return Array$1.flatten(problems);
|
|
18117
18217
|
});
|
|
18118
18218
|
// src/features/check-skills/model/skill-files.ts
|
|
@@ -18120,108 +18220,23 @@ const RULE$28 = "skill-file";
|
|
|
18120
18220
|
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
18121
18221
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
18122
18222
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
18123
|
-
const MARKDOWN$5 = ".md";
|
|
18124
18223
|
const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
|
|
18125
|
-
const HEADING = /^# (?<title>.+)$/mu;
|
|
18126
|
-
const NAME_KEY$1 = /^name:/mu;
|
|
18127
|
-
const LICENSE_KEY = /^license:/mu;
|
|
18128
|
-
const CODE = /```[\s\S]*?```|`[^`\n]*`/gu;
|
|
18129
|
-
const LINK = /\]\((?<target>[^)\s]+)\)/gu;
|
|
18130
|
-
const EXTERNAL = /^(?:[a-z][a-z0-9+.-]*:|#|\/)|[<>{}]/iu;
|
|
18131
|
-
const FRAGMENT = /#.*$/u;
|
|
18132
|
-
const SEPARATOR$10 = "/";
|
|
18133
|
-
const START$17 = 0;
|
|
18134
18224
|
const FIRST$7 = 1;
|
|
18135
|
-
const
|
|
18136
|
-
const Frontmatter = Schema.Struct({
|
|
18137
|
-
name: Schema.optional(Schema.String),
|
|
18138
|
-
license: Schema.optional(Schema.Unknown)
|
|
18139
|
-
});
|
|
18140
|
-
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
18141
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$17));
|
|
18142
|
-
const frontmatterOf = (source) => pipe(splitFrontmatter(source), Option.flatMap(({ fields }) => decodeFrontmatter(fields)));
|
|
18143
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$17].length), Option.getOrElse(() => START$17));
|
|
18144
|
-
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
18145
|
-
const nameProblems = ({ source, directory }, name, folder) => {
|
|
18146
|
-
const bodyStart = bodyStartOf(source);
|
|
18147
|
-
const body = String$1.slice(bodyStart)(source);
|
|
18148
|
-
const heading = groupOf("title")(HEADING.exec(body));
|
|
18149
|
-
return [...pipe(Option.liftPredicate(name, (found) => found !== folder), Option.map((found) => ({
|
|
18150
|
-
index: offsetOf$1(source, NAME_KEY$1),
|
|
18151
|
-
message: `The frontmatter name "${found}" differs from the directory ${directory}. Give the skill the name of its directory.`
|
|
18152
|
-
})), Option.toArray), ...pipe(Option.liftPredicate(heading, (found) => !Option.contains(found, name)), Option.map((found) => ({
|
|
18153
|
-
index: bodyStart + offsetOf$1(body, HEADING),
|
|
18154
|
-
message: `The first heading is ${headingText(found)}. Start the body with "# ${name}", the frontmatter name.`
|
|
18155
|
-
})), Option.toArray)];
|
|
18156
|
-
};
|
|
18157
|
-
const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source), Option.map((frontmatter) => [...pipe(Option.fromUndefinedOr(frontmatter.name), Option.map((name) => nameProblems(skill, name, folder)), Option.getOrElse(() => [])), ...pipe(Option.fromUndefinedOr(frontmatter.license), Option.map(() => ({
|
|
18158
|
-
index: offsetOf$1(skill.source, LICENSE_KEY),
|
|
18159
|
-
message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
|
|
18160
|
-
})), Option.toArray)]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
18161
|
-
file: skill.file,
|
|
18162
|
-
...positionOf(skill.source)(index),
|
|
18163
|
-
rule: RULE$28,
|
|
18164
|
-
message
|
|
18165
|
-
})));
|
|
18166
|
-
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) => ({
|
|
18167
|
-
target,
|
|
18168
|
-
index: found.index ?? START$17
|
|
18169
|
-
})), Option.toArray);
|
|
18170
|
-
const rangeOf$2 = (found) => {
|
|
18171
|
-
const start = found.index ?? START$17;
|
|
18172
|
-
return [start, start + found[START$17].length];
|
|
18173
|
-
};
|
|
18174
|
-
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
|
|
18175
|
-
const linksIn = (source) => {
|
|
18176
|
-
const code = pipe(Array$1.fromIterable(String$1.matchAll(CODE)(source)), Array$1.map(rangeOf$2));
|
|
18177
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(LINK)(source)), Array$1.flatMap(linkOf), Array$1.filter(isOutside(code)));
|
|
18178
|
-
};
|
|
18179
|
-
const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
18180
|
-
const files = yield* RepositoryFiles;
|
|
18181
|
-
const text = yield* files.readFile(file);
|
|
18182
|
-
if (Option.isNone(text)) return [];
|
|
18183
|
-
const source = text.value;
|
|
18184
|
-
const directory = files.dirname(file);
|
|
18185
|
-
const isMissing = ({ target }) => files.exists(files.join(directory, target)).pipe(Effect.map((exists) => !exists));
|
|
18186
|
-
const missing = yield* Effect.filter(linksIn(source), isMissing);
|
|
18187
|
-
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
18188
|
-
file,
|
|
18189
|
-
...positionOf(source)(index),
|
|
18190
|
-
rule: RULE$28,
|
|
18191
|
-
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
18192
|
-
})));
|
|
18193
|
-
});
|
|
18194
|
-
const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
|
|
18195
|
-
const files = yield* RepositoryFiles;
|
|
18196
|
-
const file = files.join(root, name);
|
|
18225
|
+
const licensesIn = (root, listed, files) => (name) => {
|
|
18197
18226
|
const directory = files.dirname(name);
|
|
18198
|
-
|
|
18199
|
-
const text = yield* files.readFile(file);
|
|
18200
|
-
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
18201
|
-
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$13 });
|
|
18202
|
-
const licenses = pipe(inside, Array$1.filter((entry) => files.dirname(entry) === directory), Array$1.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array$1.map((entry) => ({
|
|
18227
|
+
return pipe(listed, Array$1.filter((entry) => files.dirname(entry) === directory), Array$1.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array$1.map((entry) => ({
|
|
18203
18228
|
file: files.join(root, entry),
|
|
18204
18229
|
line: FIRST$7,
|
|
18205
18230
|
column: FIRST$7,
|
|
18206
18231
|
rule: RULE$28,
|
|
18207
18232
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
18208
18233
|
})));
|
|
18209
|
-
|
|
18210
|
-
...pipe(text, Option.map((source) => frontmatterProblems({
|
|
18211
|
-
file,
|
|
18212
|
-
directory,
|
|
18213
|
-
source
|
|
18214
|
-
}, files.basename(directory))), Option.getOrElse(() => [])),
|
|
18215
|
-
...licenses,
|
|
18216
|
-
...Array$1.flatten(links)
|
|
18217
|
-
];
|
|
18218
|
-
});
|
|
18234
|
+
};
|
|
18219
18235
|
/** @internal */
|
|
18220
18236
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
18221
|
-
const
|
|
18222
|
-
const
|
|
18223
|
-
|
|
18224
|
-
return Array$1.flatten(found);
|
|
18237
|
+
const files = yield* RepositoryFiles;
|
|
18238
|
+
const listed = yield* files.listedFiles(root);
|
|
18239
|
+
return pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)), Array$1.flatMap(licensesIn(root, listed, files)));
|
|
18225
18240
|
});
|
|
18226
18241
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
18227
18242
|
const MANIFEST_SECTIONS = [
|
|
@@ -19140,7 +19155,7 @@ const problemFor = (file, source) => ({
|
|
|
19140
19155
|
});
|
|
19141
19156
|
const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
|
|
19142
19157
|
const config = yield* Effect.tryPromise({
|
|
19143
|
-
try: () =>
|
|
19158
|
+
try: () => resolvedViteConfig(configFile),
|
|
19144
19159
|
catch: () => PackConfigUnreadable.make({ file: configFile })
|
|
19145
19160
|
}).pipe(Effect.option);
|
|
19146
19161
|
return Option.exists(config, runsStrictPublint);
|
|
@@ -20721,7 +20736,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
20721
20736
|
const prefix = `${directory}${SEPARATOR$3}`;
|
|
20722
20737
|
const bins = pipe([...pipe(binEntriesOf(manifest), Array$1.map(([name]) => name)), ...commandFilesIn(prefix, corpus)], Array$1.filter((name) => SAFE_NAME.test(name)), Array$1.dedupe);
|
|
20723
20738
|
if (Array$1.isReadonlyArrayEmpty(bins)) return [];
|
|
20724
|
-
const sources = pipe(corpus, Array$1.filter((
|
|
20739
|
+
const sources = pipe(corpus, Array$1.filter((text) => String$1.startsWith(prefix)(text.file) && SOURCE.test(text.file) && !isTest(text)));
|
|
20725
20740
|
const uncalled = uncalledIn(root, join, corpus);
|
|
20726
20741
|
const commands = uncalled(sources, {
|
|
20727
20742
|
rule: COMMAND_RULE,
|
|
@@ -21343,15 +21358,12 @@ const agents = Effect.fn("agents")(function* investigating(input) {
|
|
|
21343
21358
|
const problems = sortProblems(found);
|
|
21344
21359
|
yield* reportProblems(root, {
|
|
21345
21360
|
problems,
|
|
21346
|
-
json:
|
|
21361
|
+
json: false
|
|
21347
21362
|
});
|
|
21348
21363
|
return yield* failWhenAny(problems.length);
|
|
21349
21364
|
});
|
|
21350
21365
|
/** @internal */
|
|
21351
|
-
const agentsCommand = Command.make("agents", {
|
|
21352
|
-
stateDirectory: Argument.String("state-directory").pipe(Argument.withDescription("The directory that keeps each finished step, so a rerun resumes from it")),
|
|
21353
|
-
json: jsonFlag
|
|
21354
|
-
}, agents).pipe(Command.withDescription("Has a swarm of agents plan, investigate and refute what the repository's rules and history miss"));
|
|
21366
|
+
const agentsCommand = Command.make("agents", { stateDirectory: Argument.String("state-directory").pipe(Argument.withDescription("The directory that keeps each finished step, so a rerun resumes from it")) }, agents).pipe(Command.withDescription("Has a swarm of agents plan, investigate and refute what the repository's rules and history miss"));
|
|
21355
21367
|
// src/features/run-changed/model/batches.ts
|
|
21356
21368
|
const ARITY$1 = 2;
|
|
21357
21369
|
const NO_BATCHES = [];
|
|
@@ -21587,27 +21599,15 @@ const byPlace = Order.Struct({
|
|
|
21587
21599
|
file: Order.String,
|
|
21588
21600
|
line: Order.Number
|
|
21589
21601
|
});
|
|
21590
|
-
const textOf = (
|
|
21591
|
-
if (json) return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);
|
|
21592
|
-
return Effect.succeed(pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join("")));
|
|
21593
|
-
};
|
|
21602
|
+
const textOf = (describe) => (rows) => pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join(""));
|
|
21594
21603
|
/** @internal */
|
|
21595
|
-
const lookupReport = ({
|
|
21604
|
+
const lookupReport = ({ rows, describe }) => Effect.gen(function* report() {
|
|
21596
21605
|
const found = yield* rows((yield* RepositoryFiles).resolve("."));
|
|
21597
|
-
|
|
21598
|
-
yield* writeStdout(text);
|
|
21606
|
+
yield* writeStdout(textOf(describe)(Array$1.sort(found, byPlace)));
|
|
21599
21607
|
if (found.length > NONE_FOUND) return yield* ProblemsFound.make({ count: found.length });
|
|
21600
21608
|
return NONE_FOUND;
|
|
21601
21609
|
});
|
|
21602
21610
|
// src/app/exits-command.ts
|
|
21603
|
-
const MetRow = Schema.Struct({
|
|
21604
|
-
file: Schema.String,
|
|
21605
|
-
line: Schema.Finite,
|
|
21606
|
-
section: Schema.String,
|
|
21607
|
-
key: Schema.String,
|
|
21608
|
-
condition: Schema.String,
|
|
21609
|
-
outcome: Schema.Literals(["met", "unchecked"])
|
|
21610
|
-
});
|
|
21611
21611
|
const VERDICTS$2 = {
|
|
21612
21612
|
met: "is met. Remove the deviation and run verify.",
|
|
21613
21613
|
unchecked: "could not be checked. Check it by hand or rerun where the lookup is reachable."
|
|
@@ -21626,11 +21626,10 @@ const rowsIn = Effect.fn("rowsIn")(function* rowsIn(root) {
|
|
|
21626
21626
|
})));
|
|
21627
21627
|
});
|
|
21628
21628
|
/** @internal */
|
|
21629
|
-
const exitsCommand = Command.make("exits", {
|
|
21630
|
-
row: MetRow,
|
|
21629
|
+
const exitsCommand = Command.make("exits", {}, () => lookupReport({
|
|
21631
21630
|
rows: rowsIn,
|
|
21632
21631
|
describe: describeRow$3
|
|
21633
|
-
})
|
|
21632
|
+
})).pipe(Command.withDescription("Reports upstream deviations whose exit condition is met"));
|
|
21634
21633
|
// src/features/judge-documents/model/agent-prompt.ts
|
|
21635
21634
|
/** @internal */
|
|
21636
21635
|
const AgentAnswer = Schema.Struct({
|
|
@@ -21763,8 +21762,7 @@ const judgeDecision = ({ rule, target: { text } }) => Effect.sync(() => {
|
|
|
21763
21762
|
},
|
|
21764
21763
|
text,
|
|
21765
21764
|
model: DECISION_MODEL,
|
|
21766
|
-
timeoutMs: DECISION_TIMEOUT_MS
|
|
21767
|
-
env: {}
|
|
21765
|
+
timeoutMs: DECISION_TIMEOUT_MS
|
|
21768
21766
|
});
|
|
21769
21767
|
if (judged.status === "violation") return {
|
|
21770
21768
|
status: "violation",
|
|
@@ -21974,15 +21972,12 @@ const judge = Effect.fn("judge")(function* judge(input) {
|
|
|
21974
21972
|
const problems = sortProblems(found);
|
|
21975
21973
|
yield* reportProblems(root, {
|
|
21976
21974
|
problems,
|
|
21977
|
-
json:
|
|
21975
|
+
json: false
|
|
21978
21976
|
});
|
|
21979
21977
|
return yield* failWhenAny(problems.length);
|
|
21980
21978
|
});
|
|
21981
21979
|
/** @internal */
|
|
21982
|
-
const judgeCommand = Command.make("judge", {
|
|
21983
|
-
cacheDirectory: Argument.String("cache-directory").pipe(Argument.withDescription("The directory that keeps the verdicts between runs")),
|
|
21984
|
-
json: jsonFlag
|
|
21985
|
-
}, judge).pipe(Command.withDescription("Judges documents against rules that need reading, and reports violations"));
|
|
21980
|
+
const judgeCommand = Command.make("judge", { cacheDirectory: Argument.String("cache-directory").pipe(Argument.withDescription("The directory that keeps the verdicts between runs")) }, judge).pipe(Command.withDescription("Judges documents against rules that need reading, and reports violations"));
|
|
21986
21981
|
// src/features/publish-workspace/model/export-targets.ts
|
|
21987
21982
|
const PATTERN = "*";
|
|
21988
21983
|
const taggedError$3 = Schema.TaggedError;
|
|
@@ -22338,6 +22333,9 @@ const writeNative = Effect.fn("publish.writeNative")(function* writeNative(direc
|
|
|
22338
22333
|
}), fileSystem.writeFileString(path.join(target, "README.md"), nativeReadme(native))], { concurrency: "unbounded" });
|
|
22339
22334
|
return target;
|
|
22340
22335
|
});
|
|
22336
|
+
// src/shared/lib/mdlct.ts
|
|
22337
|
+
/** @internal */
|
|
22338
|
+
const MDLCT_BIN = fileURLToPath(new URL(manifest.bin.mdlct, import.meta.resolve("@r_masseater/mdlct/package.json")));
|
|
22341
22339
|
// src/features/publish-workspace/model/pack-hook.ts
|
|
22342
22340
|
const HOOK_FILE = "pack-hook.mjs";
|
|
22343
22341
|
/** @internal */
|
|
@@ -23616,7 +23614,7 @@ const otherTexts = Effect.fn("otherTexts")(function* otherTexts() {
|
|
|
23616
23614
|
const texts = yield* Effect.forEach(others, ({ fullName }) => textsOf(fullName), { concurrency: 1 });
|
|
23617
23615
|
return Array$1.flatten(texts);
|
|
23618
23616
|
});
|
|
23619
|
-
const callers = Effect.fn("callers")(function* callers(
|
|
23617
|
+
const callers = Effect.fn("callers")(function* callers() {
|
|
23620
23618
|
const root = (yield* RepositoryFiles).resolve(".");
|
|
23621
23619
|
const texts = yield* otherTexts();
|
|
23622
23620
|
const found = yield* surfaceProblems(root, {
|
|
@@ -23626,12 +23624,12 @@ const callers = Effect.fn("callers")(function* callers(input) {
|
|
|
23626
23624
|
const problems = sortProblems(found);
|
|
23627
23625
|
yield* reportProblems(root, {
|
|
23628
23626
|
problems,
|
|
23629
|
-
json:
|
|
23627
|
+
json: false
|
|
23630
23628
|
});
|
|
23631
23629
|
return yield* failWhenAny(problems.length);
|
|
23632
23630
|
});
|
|
23633
23631
|
/** @internal */
|
|
23634
|
-
const callersCommand = Command.make("callers", {
|
|
23632
|
+
const callersCommand = Command.make("callers", {}, callers).pipe(Command.withDescription("Reports what a published package exports or declares as a command or flag that no repository of the owner uses"));
|
|
23635
23633
|
// src/features/check-references/model/markdown-texts.ts
|
|
23636
23634
|
const MARKDOWN = ".md";
|
|
23637
23635
|
const FIXTURE = /(?:^|\/)fixtures\//u;
|
|
@@ -23824,7 +23822,7 @@ const unresolvedOf = (outcomes) => ({ file, line, reference }) => {
|
|
|
23824
23822
|
const unresolvedReferences = Effect.fn("unresolvedReferences")(function* unresolvedReferences(root) {
|
|
23825
23823
|
const files = yield* RepositoryFiles;
|
|
23826
23824
|
const texts = yield* markdownTexts(root);
|
|
23827
|
-
const links = yield* linksIn
|
|
23825
|
+
const links = yield* linksIn(pipe(texts, Array$1.map(({ file, source }) => ({
|
|
23828
23826
|
path: files.relative(root, file),
|
|
23829
23827
|
text: source
|
|
23830
23828
|
}))));
|
|
@@ -23835,44 +23833,27 @@ const unresolvedReferences = Effect.fn("unresolvedReferences")(function* unresol
|
|
|
23835
23833
|
return pipe(occurrences, Array$1.flatMap(unresolvedOf(outcomes)));
|
|
23836
23834
|
});
|
|
23837
23835
|
// src/app/refs-command.ts
|
|
23838
|
-
const Row$2 = Schema.Struct({
|
|
23839
|
-
file: Schema.String,
|
|
23840
|
-
line: Schema.Finite,
|
|
23841
|
-
reference: Schema.String,
|
|
23842
|
-
outcome: Schema.Literals(["broken", "unchecked"]),
|
|
23843
|
-
reason: Schema.String
|
|
23844
|
-
});
|
|
23845
23836
|
const VERDICTS$1 = {
|
|
23846
23837
|
broken: "is stale:",
|
|
23847
23838
|
unchecked: "could not be checked:"
|
|
23848
23839
|
};
|
|
23849
23840
|
const describeRow$2 = (row) => `${row.file}:${String(row.line)} ${row.reference} ${VERDICTS$1[row.outcome]} ${row.reason}`;
|
|
23850
23841
|
/** @internal */
|
|
23851
|
-
const refsCommand = Command.make("refs", {
|
|
23852
|
-
row: Row$2,
|
|
23842
|
+
const refsCommand = Command.make("refs", {}, () => lookupReport({
|
|
23853
23843
|
rows: unresolvedReferences,
|
|
23854
23844
|
describe: describeRow$2
|
|
23855
|
-
})
|
|
23845
|
+
})).pipe(Command.withDescription("Reports github: and npm: reference links whose target is gone"));
|
|
23856
23846
|
// src/app/upstream-command.ts
|
|
23857
|
-
const Row$1 = Schema.Struct({
|
|
23858
|
-
file: Schema.String,
|
|
23859
|
-
line: Schema.Finite,
|
|
23860
|
-
upstream: Schema.String,
|
|
23861
|
-
reviewed: Schema.String,
|
|
23862
|
-
outcome: Schema.Literals(["undecided", "unchecked"]),
|
|
23863
|
-
detail: Schema.String
|
|
23864
|
-
});
|
|
23865
23847
|
const VERDICTS = {
|
|
23866
23848
|
undecided: "has changes nobody decided on. Read them, then set reviewed, verdict and reason of the record.",
|
|
23867
23849
|
unchecked: "could not be checked. Check it by hand or rerun where the lookup is reachable."
|
|
23868
23850
|
};
|
|
23869
23851
|
const describeRow$1 = (row) => `${row.file}:${String(row.line)} upstream ${row.upstream} after ${row.reviewed}: ${row.detail}. It ${VERDICTS[row.outcome]}`;
|
|
23870
23852
|
/** @internal */
|
|
23871
|
-
const upstreamCommand = Command.make("upstream", {
|
|
23872
|
-
row: Row$1,
|
|
23853
|
+
const upstreamCommand = Command.make("upstream", {}, () => lookupReport({
|
|
23873
23854
|
rows: undecidedUpdates,
|
|
23874
23855
|
describe: describeRow$1
|
|
23875
|
-
})
|
|
23856
|
+
})).pipe(Command.withDescription("Reports an upstream of a reimplementation that released since its verdict"));
|
|
23876
23857
|
// src/app/usage-command.ts
|
|
23877
23858
|
const METRICS_PATH = "/v1/metrics";
|
|
23878
23859
|
const UNAUTHORIZED = 401;
|
|
@@ -23891,13 +23872,9 @@ const removed = (files) => FileSystem.FileSystem.pipe(Effect.flatMap((fs) => Eff
|
|
|
23891
23872
|
concurrency: "unbounded",
|
|
23892
23873
|
discard: true
|
|
23893
23874
|
})));
|
|
23894
|
-
const withKey = (key) => Option.match(key, {
|
|
23895
|
-
onNone: () => (request) => request,
|
|
23896
|
-
onSome: (value) => HttpClientRequest.bearerToken(Redacted.value(value))
|
|
23897
|
-
});
|
|
23898
23875
|
const posted = Effect.fn("posted")(function* posted(input) {
|
|
23899
23876
|
const client = yield* HttpClient.HttpClient;
|
|
23900
|
-
const request = yield* HttpClientRequest.post(`${input.endpoint}${METRICS_PATH}`).pipe(
|
|
23877
|
+
const request = yield* HttpClientRequest.post(`${input.endpoint}${METRICS_PATH}`).pipe(HttpClientRequest.bodyJson(input.body));
|
|
23901
23878
|
return yield* client.execute(request);
|
|
23902
23879
|
});
|
|
23903
23880
|
const spooledTallies = Effect.fn("spooledTallies")(function* spooledTallies(files) {
|
|
@@ -23918,29 +23895,20 @@ const bodyOf = Effect.fn("bodyOf")(function* bodyOf(tallies) {
|
|
|
23918
23895
|
endNanos: now
|
|
23919
23896
|
})(tallies);
|
|
23920
23897
|
});
|
|
23921
|
-
const refusalHint = (apiKeyEnv) => Option.match(apiKeyEnv, {
|
|
23922
|
-
onNone: () => "Pass --api-key-env or let the proxy add the key.",
|
|
23923
|
-
onSome: (name) => `Set ${name} or let the proxy add the key.`
|
|
23924
|
-
});
|
|
23925
23898
|
const isRefused = (status) => status === UNAUTHORIZED || status === FORBIDDEN;
|
|
23926
|
-
const answered = (
|
|
23899
|
+
const answered = (files, status) => {
|
|
23927
23900
|
if (status >= OK_FROM && status < OK_BELOW) return removed(files);
|
|
23928
|
-
if (isRefused(status)) return Console.error(`msch usage: the endpoint refused the counters (${String(status)}), so the ${CALLS_METRIC} counters of this run were dropped.
|
|
23901
|
+
if (isRefused(status)) return Console.error(`msch usage: the endpoint refused the counters (${String(status)}), so the ${CALLS_METRIC} counters of this run were dropped. Let the proxy add the key.`).pipe(Effect.andThen(removed(files)));
|
|
23929
23902
|
return Console.error(`msch usage: the endpoint answered ${String(status)}, so the counters stay in the spool for the next run.`);
|
|
23930
23903
|
};
|
|
23931
23904
|
const sentOrKept = Effect.fn("sentOrKept")(function* sentOrKept(target, files, tallies) {
|
|
23932
|
-
const key = yield* Option.match(target.apiKeyEnv, {
|
|
23933
|
-
onNone: () => Effect.succeed(Option.none()),
|
|
23934
|
-
onSome: (name) => Config$1.option(Config$1.Redacted(name)).pipe(Effect.orElseSucceed(() => Option.none()))
|
|
23935
|
-
});
|
|
23936
23905
|
const body = yield* bodyOf(tallies);
|
|
23937
23906
|
const sent = yield* posted({
|
|
23938
23907
|
endpoint: target.endpoint,
|
|
23939
|
-
key,
|
|
23940
23908
|
body
|
|
23941
23909
|
}).pipe(Effect.option);
|
|
23942
23910
|
if (Option.isNone(sent)) return yield* Console.error("msch usage: the endpoint could not be reached, so the counters stay in the spool for the next run.");
|
|
23943
|
-
return yield* answered(
|
|
23911
|
+
return yield* answered(files, sent.value.status);
|
|
23944
23912
|
});
|
|
23945
23913
|
/** @internal */
|
|
23946
23914
|
const sendUsage = Effect.fn("sendUsage")(function* sendUsage(root, target) {
|
|
@@ -23960,10 +23928,7 @@ const NETWORK_COMMANDS = [
|
|
|
23960
23928
|
callersCommand,
|
|
23961
23929
|
refsCommand,
|
|
23962
23930
|
upstreamCommand,
|
|
23963
|
-
Command.make("usage", {
|
|
23964
|
-
endpoint: Flag.String("endpoint").pipe(Flag.withDescription("Sends the counters to this OTLP/HTTP base URL")),
|
|
23965
|
-
apiKeyEnv: Flag.String("api-key-env").pipe(Flag.withDescription("Reads the bearer token from this environment variable"), Flag.optional)
|
|
23966
|
-
}, usage).pipe(Command.withDescription("Sends the calls that metered libraries counted during the checks, then empties the spool"))
|
|
23931
|
+
Command.make("usage", { endpoint: Flag.String("endpoint").pipe(Flag.withDescription("Sends the counters to this OTLP/HTTP base URL")) }, usage).pipe(Command.withDescription("Sends the calls that metered libraries counted during the checks, then empties the spool"))
|
|
23967
23932
|
];
|
|
23968
23933
|
// src/app/publish-command.ts
|
|
23969
23934
|
const directory = Argument.String("directory").pipe(Argument.withDescription("The workspace directory"));
|
|
@@ -24092,19 +24057,12 @@ const missingVersions = Effect.fn("missingVersions")(function* missingVersions(r
|
|
|
24092
24057
|
return pipe(due, Array$1.flatMap(missingIn(known)));
|
|
24093
24058
|
});
|
|
24094
24059
|
// src/app/published-command.ts
|
|
24095
|
-
const Row = Schema.Struct({
|
|
24096
|
-
file: Schema.String,
|
|
24097
|
-
line: Schema.Finite,
|
|
24098
|
-
dependency: Schema.String,
|
|
24099
|
-
reason: Schema.String
|
|
24100
|
-
});
|
|
24101
24060
|
const describeRow = (row) => `${row.file}:${String(row.line)} ${row.dependency} ${row.reason}`;
|
|
24102
24061
|
/** @internal */
|
|
24103
|
-
const publishedCommand = Command.make("published", {
|
|
24104
|
-
row: Row,
|
|
24062
|
+
const publishedCommand = Command.make("published", {}, () => lookupReport({
|
|
24105
24063
|
rows: missingVersions,
|
|
24106
24064
|
describe: describeRow
|
|
24107
|
-
})
|
|
24065
|
+
})).pipe(Command.withDescription("Reports a dependency range that no version on npm satisfies"));
|
|
24108
24066
|
// src/app/unbumped-command.ts
|
|
24109
24067
|
const unbumped = Effect.fn("unbumped")(function* unbumped() {
|
|
24110
24068
|
const root = (yield* RepositoryFiles).resolve(".");
|