@r_masseater/msch 0.134.0 → 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 +711 -752
- 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": ["*"],
|
|
@@ -1346,12 +1349,13 @@ var renovate_default = {
|
|
|
1346
1349
|
"automerge": false
|
|
1347
1350
|
},
|
|
1348
1351
|
{
|
|
1349
|
-
"description": "Effect と Alchemy は日々の更新に追従する前提で、公開後の待機期間を掛けない。pnpm 側は各リポジトリの minimumReleaseAgeExclude に同じ名前を置く。",
|
|
1352
|
+
"description": "Effect と Alchemy は日々の更新に追従する前提で、公開後の待機期間を掛けない。Alchemy は @distilled.cloud を固定の版で使い、利用側の版が遅れると Credentials などのタグが 2 つに分かれて型が合わなくなるので、@distilled.cloud も同じに扱う。pnpm 側は各リポジトリの minimumReleaseAgeExclude に同じ名前を置く。",
|
|
1350
1353
|
"matchPackageNames": [
|
|
1351
1354
|
"effect",
|
|
1352
1355
|
"@effect/**",
|
|
1353
1356
|
"alchemy",
|
|
1354
|
-
"@alchemy.run/**"
|
|
1357
|
+
"@alchemy.run/**",
|
|
1358
|
+
"@distilled.cloud/**"
|
|
1355
1359
|
],
|
|
1356
1360
|
"minimumReleaseAge": null
|
|
1357
1361
|
},
|
|
@@ -1433,7 +1437,7 @@ const packageNameOf$1 = (selector) => pipe(String$1.indexOf(VERSION_SEPARATOR)(S
|
|
|
1433
1437
|
onNone: () => selector,
|
|
1434
1438
|
onSome: (index) => String$1.takeLeft(selector, index + SCOPED_START)
|
|
1435
1439
|
}));
|
|
1436
|
-
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), {
|
|
1437
1441
|
onEmpty: () => Option.none(),
|
|
1438
1442
|
onNonEmpty: (parents, target) => Option.some({
|
|
1439
1443
|
key,
|
|
@@ -1455,7 +1459,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
1455
1459
|
});
|
|
1456
1460
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
1457
1461
|
const firstRemovedPeer = (peers) => (removal) => pipe(peers, Array$1.findFirst(removesPeer(removal)));
|
|
1458
|
-
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)));
|
|
1459
1463
|
const requiredPeersOf$1 = (dependent, manifest) => pipe(Record.keys(manifest.peerDependencies ?? {}), Array$1.difference(optionalPeerNames(manifest)), Array$1.map((peer) => ({
|
|
1460
1464
|
peer,
|
|
1461
1465
|
dependent
|
|
@@ -3598,8 +3602,8 @@ const FLOATING_PREFIX = `${ANY_DEPTH}/`;
|
|
|
3598
3602
|
const LEADING_SLASHES = /^\/+/u;
|
|
3599
3603
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3600
3604
|
const SPACES = /\s+/u;
|
|
3601
|
-
const FIRST$
|
|
3602
|
-
const READ_CONCURRENCY$
|
|
3605
|
+
const FIRST$27 = 1;
|
|
3606
|
+
const READ_CONCURRENCY$39 = 16;
|
|
3603
3607
|
const withoutPrefix = (prefix, text) => {
|
|
3604
3608
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3605
3609
|
return text;
|
|
@@ -3623,7 +3627,7 @@ const entryOf$2 = (file, kind, directory) => (line, index) => {
|
|
|
3623
3627
|
file,
|
|
3624
3628
|
kind,
|
|
3625
3629
|
directory,
|
|
3626
|
-
line: index + FIRST$
|
|
3630
|
+
line: index + FIRST$27,
|
|
3627
3631
|
pattern,
|
|
3628
3632
|
values: Array$1.join(values, " ")
|
|
3629
3633
|
});
|
|
@@ -3637,10 +3641,10 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
3637
3641
|
});
|
|
3638
3642
|
const patternProblem = (entry, message) => problemAtPosition(RULE$78)(entry.file, {
|
|
3639
3643
|
line: entry.line,
|
|
3640
|
-
column: FIRST$
|
|
3644
|
+
column: FIRST$27
|
|
3641
3645
|
}, message);
|
|
3642
3646
|
const misplacedMessage = (kind, workspaces) => {
|
|
3643
|
-
if (workspaces.length === FIRST$
|
|
3647
|
+
if (workspaces.length === FIRST$27) {
|
|
3644
3648
|
const workspace = Array$1.join(workspaces, "");
|
|
3645
3649
|
return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
|
|
3646
3650
|
}
|
|
@@ -3690,17 +3694,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3690
3694
|
/** @internal */
|
|
3691
3695
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3692
3696
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3693
|
-
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 });
|
|
3694
3698
|
const entries = Array$1.flatten(read);
|
|
3695
3699
|
const workspaces = yield* workspaceDirectories(root);
|
|
3696
|
-
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 });
|
|
3697
3701
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3698
3702
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3699
3703
|
});
|
|
3700
3704
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3701
3705
|
const RULE$77 = "colocated-test";
|
|
3702
|
-
const FIRST$
|
|
3703
|
-
const READ_CONCURRENCY$
|
|
3706
|
+
const FIRST$26 = 1;
|
|
3707
|
+
const READ_CONCURRENCY$38 = 64;
|
|
3704
3708
|
const ROOT_SUBPATH$1 = ".";
|
|
3705
3709
|
const NAME_GROUP$2 = "name";
|
|
3706
3710
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3719,8 +3723,8 @@ const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test n
|
|
|
3719
3723
|
const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3720
3724
|
const problemFor$11 = (test, message) => ({
|
|
3721
3725
|
file: test.file,
|
|
3722
|
-
line: FIRST$
|
|
3723
|
-
column: FIRST$
|
|
3726
|
+
line: FIRST$26,
|
|
3727
|
+
column: FIRST$26,
|
|
3724
3728
|
rule: RULE$77,
|
|
3725
3729
|
message: `${test.base} ${message}`
|
|
3726
3730
|
});
|
|
@@ -3784,12 +3788,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3784
3788
|
directory: files.dirname(file)
|
|
3785
3789
|
};
|
|
3786
3790
|
}));
|
|
3787
|
-
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 });
|
|
3788
3792
|
return Array$1.getSomes(found);
|
|
3789
3793
|
});
|
|
3790
3794
|
// src/shared/lib/agent-docs.ts
|
|
3791
3795
|
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3792
|
-
const READ_CONCURRENCY$
|
|
3796
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3793
3797
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3794
3798
|
const files = yield* RepositoryFiles;
|
|
3795
3799
|
const listed = yield* files.listedFiles(root);
|
|
@@ -3798,12 +3802,12 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3798
3802
|
const file = files.join(root, name);
|
|
3799
3803
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3800
3804
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3801
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3805
|
+
}, { concurrency: READ_CONCURRENCY$37 });
|
|
3802
3806
|
return Array$1.getSomes(found);
|
|
3803
3807
|
});
|
|
3804
3808
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3805
3809
|
const RECOMMENDED_LINES = 200;
|
|
3806
|
-
const FIRST$
|
|
3810
|
+
const FIRST$25 = 1;
|
|
3807
3811
|
const RULE$76 = "agent-docs-length";
|
|
3808
3812
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3809
3813
|
const problemFor$10 = (file) => (lines) => {
|
|
@@ -3811,7 +3815,7 @@ const problemFor$10 = (file) => (lines) => {
|
|
|
3811
3815
|
return Option.some({
|
|
3812
3816
|
file,
|
|
3813
3817
|
line: 201,
|
|
3814
|
-
column: FIRST$
|
|
3818
|
+
column: FIRST$25,
|
|
3815
3819
|
rule: RULE$76,
|
|
3816
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.`
|
|
3817
3821
|
});
|
|
@@ -3822,8 +3826,8 @@ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source)
|
|
|
3822
3826
|
const RULE$75 = "claude-md-link";
|
|
3823
3827
|
const CLAUDE = "CLAUDE.md";
|
|
3824
3828
|
const AGENTS = "AGENTS.md";
|
|
3825
|
-
const FIRST$
|
|
3826
|
-
const READ_CONCURRENCY$
|
|
3829
|
+
const FIRST$24 = 1;
|
|
3830
|
+
const READ_CONCURRENCY$36 = 16;
|
|
3827
3831
|
const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3828
3832
|
/** @internal */
|
|
3829
3833
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3836,22 +3840,22 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3836
3840
|
const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
|
|
3837
3841
|
return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
|
|
3838
3842
|
file: path,
|
|
3839
|
-
line: FIRST$
|
|
3840
|
-
column: FIRST$
|
|
3843
|
+
line: FIRST$24,
|
|
3844
|
+
column: FIRST$24,
|
|
3841
3845
|
rule: RULE$75,
|
|
3842
3846
|
message: MESSAGE$15
|
|
3843
3847
|
})));
|
|
3844
3848
|
});
|
|
3845
3849
|
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3846
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3850
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$36 });
|
|
3847
3851
|
return Array$1.getSomes(found);
|
|
3848
3852
|
});
|
|
3849
3853
|
// src/features/check-placement/model/dangling-links.ts
|
|
3850
3854
|
const RULE$74 = "dangling-link";
|
|
3851
|
-
const SEPARATOR$
|
|
3852
|
-
const FIRST$
|
|
3853
|
-
const READ_CONCURRENCY$
|
|
3854
|
-
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);
|
|
3855
3859
|
/** @internal */
|
|
3856
3860
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3857
3861
|
const files = yield* RepositoryFiles;
|
|
@@ -3861,19 +3865,19 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3861
3865
|
const link = yield* files.readLink(file);
|
|
3862
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) => ({
|
|
3863
3867
|
file,
|
|
3864
|
-
line: FIRST$
|
|
3865
|
-
column: FIRST$
|
|
3868
|
+
line: FIRST$23,
|
|
3869
|
+
column: FIRST$23,
|
|
3866
3870
|
rule: RULE$74,
|
|
3867
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.`
|
|
3868
3872
|
})));
|
|
3869
3873
|
});
|
|
3870
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3874
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$35 });
|
|
3871
3875
|
return Array$1.getSomes(found);
|
|
3872
3876
|
});
|
|
3873
3877
|
// src/features/check-placement/model/member-sources.ts
|
|
3874
3878
|
const ROOT_WORKSPACE$1 = ".";
|
|
3875
|
-
const FIRST$
|
|
3876
|
-
const SEPARATOR$
|
|
3879
|
+
const FIRST$22 = 1;
|
|
3880
|
+
const SEPARATOR$24 = "/";
|
|
3877
3881
|
const EXCLUDED$7 = [
|
|
3878
3882
|
":(exclude,attr:linguist-vendored)",
|
|
3879
3883
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3893,12 +3897,12 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
|
|
|
3893
3897
|
const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
|
|
3894
3898
|
const fileProblem$1 = ({ file, rule, message }) => ({
|
|
3895
3899
|
file,
|
|
3896
|
-
line: FIRST$
|
|
3897
|
-
column: FIRST$
|
|
3900
|
+
line: FIRST$22,
|
|
3901
|
+
column: FIRST$22,
|
|
3898
3902
|
rule,
|
|
3899
3903
|
message
|
|
3900
3904
|
});
|
|
3901
|
-
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) => ({
|
|
3902
3906
|
workspace,
|
|
3903
3907
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3904
3908
|
})));
|
|
@@ -3923,7 +3927,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3923
3927
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3924
3928
|
const RULE$73 = "deployed-readme";
|
|
3925
3929
|
const ROOT_DIRECTORY$4 = "";
|
|
3926
|
-
const READ_CONCURRENCY$
|
|
3930
|
+
const READ_CONCURRENCY$34 = 16;
|
|
3927
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.";
|
|
3928
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.";
|
|
3929
3933
|
const ADDRESS_KEYS = [
|
|
@@ -3979,25 +3983,25 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3979
3983
|
const listed = yield* files.listedFiles(root);
|
|
3980
3984
|
const directories = yield* workspaceDirectories(root);
|
|
3981
3985
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3982
|
-
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 });
|
|
3983
3987
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3984
|
-
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 });
|
|
3985
3989
|
return Array$1.getSomes(found);
|
|
3986
3990
|
});
|
|
3987
3991
|
// src/features/check-placement/model/nested-docs.ts
|
|
3988
3992
|
const RULE$72 = "nested-docs";
|
|
3989
|
-
const CONFIG_FILE$
|
|
3990
|
-
const SEPARATOR$
|
|
3991
|
-
const READ_CONCURRENCY$
|
|
3993
|
+
const CONFIG_FILE$8 = "vite.config.ts";
|
|
3994
|
+
const SEPARATOR$23 = "/";
|
|
3995
|
+
const READ_CONCURRENCY$33 = 64;
|
|
3992
3996
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3993
3997
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3994
3998
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
3995
3999
|
const MANIFEST$4 = "package.json";
|
|
3996
4000
|
const MISSING_RULE = "workspace-agents-md";
|
|
3997
4001
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3998
|
-
const taggedError$
|
|
3999
|
-
var RootConfigUnreadable = class extends taggedError$
|
|
4000
|
-
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);
|
|
4001
4005
|
const problemFor$9 = problemInFile(RULE$72);
|
|
4002
4006
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
4003
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.";
|
|
@@ -4026,10 +4030,10 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
|
|
|
4026
4030
|
});
|
|
4027
4031
|
const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
|
|
4028
4032
|
const files = yield* RepositoryFiles;
|
|
4029
|
-
const file = files.join(root, CONFIG_FILE$
|
|
4033
|
+
const file = files.join(root, CONFIG_FILE$8);
|
|
4030
4034
|
if (!(yield* files.exists(file))) return false;
|
|
4031
4035
|
const config = yield* Effect.tryPromise({
|
|
4032
|
-
try: () =>
|
|
4036
|
+
try: () => resolvedViteConfig(file),
|
|
4033
4037
|
catch: () => RootConfigUnreadable.make({ file })
|
|
4034
4038
|
}).pipe(Effect.option);
|
|
4035
4039
|
return pipe(config, Option.flatMap(Schema.decodeUnknownOption(RootConfig$1)), Option.isSome);
|
|
@@ -4045,7 +4049,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
4045
4049
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
4046
4050
|
workspaceAgentDocs
|
|
4047
4051
|
};
|
|
4048
|
-
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 });
|
|
4049
4053
|
const missing = missingProblems({
|
|
4050
4054
|
required: workspaceAgentDocs,
|
|
4051
4055
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -4056,7 +4060,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
4056
4060
|
});
|
|
4057
4061
|
// src/features/check-placement/model/published-readme.ts
|
|
4058
4062
|
const RULE$71 = "published-readme";
|
|
4059
|
-
const READ_CONCURRENCY$
|
|
4063
|
+
const READ_CONCURRENCY$32 = 16;
|
|
4060
4064
|
const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
4061
4065
|
const MISSING_MESSAGE$1 = "is missing. This package is published to npm, so give it an English README.md.";
|
|
4062
4066
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
@@ -4083,7 +4087,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
4083
4087
|
/** @internal */
|
|
4084
4088
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
4085
4089
|
const projects = yield* publishedProjects(root);
|
|
4086
|
-
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 });
|
|
4087
4091
|
return Array$1.getSomes(found);
|
|
4088
4092
|
});
|
|
4089
4093
|
// src/features/check-placement/model/published-tests.ts
|
|
@@ -4116,20 +4120,20 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
4116
4120
|
});
|
|
4117
4121
|
// src/features/check-placement/model/root-docs.ts
|
|
4118
4122
|
const RULE$69 = "root-docs";
|
|
4119
|
-
const SEPARATOR$
|
|
4120
|
-
const FIRST$
|
|
4121
|
-
const MARKDOWN$
|
|
4123
|
+
const SEPARATOR$22 = "/";
|
|
4124
|
+
const FIRST$21 = 1;
|
|
4125
|
+
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
4122
4126
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
4123
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.";
|
|
4124
|
-
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);
|
|
4125
4129
|
/** @internal */
|
|
4126
4130
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
4127
4131
|
const files = yield* RepositoryFiles;
|
|
4128
4132
|
const names = yield* files.listedFiles(root);
|
|
4129
4133
|
return pipe(names, Array$1.filter(isStrayRootDoc), Array$1.map((name) => ({
|
|
4130
4134
|
file: files.join(root, name),
|
|
4131
|
-
line: FIRST$
|
|
4132
|
-
column: FIRST$
|
|
4135
|
+
line: FIRST$21,
|
|
4136
|
+
column: FIRST$21,
|
|
4133
4137
|
rule: RULE$69,
|
|
4134
4138
|
message: `${name} ${MESSAGE$12}`
|
|
4135
4139
|
})));
|
|
@@ -4137,8 +4141,8 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
4137
4141
|
// src/features/check-placement/model/root-readme.ts
|
|
4138
4142
|
const RULE$68 = "root-readme";
|
|
4139
4143
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
4140
|
-
const READ_CONCURRENCY$
|
|
4141
|
-
const START$
|
|
4144
|
+
const READ_CONCURRENCY$31 = 16;
|
|
4145
|
+
const START$33 = 0;
|
|
4142
4146
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
4143
4147
|
const RELATIVE$4 = /^\.\//u;
|
|
4144
4148
|
const MarketplacePlugin = Schema.Struct({
|
|
@@ -4174,17 +4178,17 @@ const patternFor = (plugins) => ({ directory, names }) => Array$1.findFirst(plug
|
|
|
4174
4178
|
onNone: () => ownNames(plugins, names),
|
|
4175
4179
|
onSome: () => [directory]
|
|
4176
4180
|
}), patternOf$1);
|
|
4177
|
-
const problemsIn$
|
|
4181
|
+
const problemsIn$21 = (file, source, plugins) => (workspace) => {
|
|
4178
4182
|
const message = messageFor$5(workspace.directory);
|
|
4179
4183
|
const at = positionOf(source);
|
|
4180
4184
|
const pattern = patternFor(plugins)(workspace);
|
|
4181
|
-
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)));
|
|
4182
4186
|
};
|
|
4183
4187
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
4184
4188
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
4185
4189
|
return pipe(text, Option.match({
|
|
4186
4190
|
onNone: () => [],
|
|
4187
|
-
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$
|
|
4191
|
+
onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$21(file, source, plugins)))
|
|
4188
4192
|
}));
|
|
4189
4193
|
});
|
|
4190
4194
|
/** @internal */
|
|
@@ -4195,7 +4199,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4195
4199
|
const named = yield* namedWorkspaces(root);
|
|
4196
4200
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4197
4201
|
const plugins = yield* marketplacePlugins(root);
|
|
4198
|
-
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 });
|
|
4199
4203
|
return Array$1.flatten(found);
|
|
4200
4204
|
});
|
|
4201
4205
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4218,7 +4222,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4218
4222
|
const RULE$67 = "docs-mirror";
|
|
4219
4223
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4220
4224
|
const MIRROR_LIMIT = 3;
|
|
4221
|
-
const READ_CONCURRENCY$
|
|
4225
|
+
const READ_CONCURRENCY$30 = 16;
|
|
4222
4226
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4223
4227
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4224
4228
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4255,7 +4259,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4255
4259
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4256
4260
|
directory,
|
|
4257
4261
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4258
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4262
|
+
}))), { concurrency: READ_CONCURRENCY$30 });
|
|
4259
4263
|
});
|
|
4260
4264
|
/** @internal */
|
|
4261
4265
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4268,13 +4272,13 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4268
4272
|
onNone: () => [],
|
|
4269
4273
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4270
4274
|
})));
|
|
4271
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4275
|
+
}, { concurrency: READ_CONCURRENCY$30 });
|
|
4272
4276
|
return Array$1.flatten(found);
|
|
4273
4277
|
});
|
|
4274
4278
|
// src/features/check-placement/model/ignored-sources.ts
|
|
4275
4279
|
const RULE$66 = "ignored-sources";
|
|
4276
4280
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
4277
|
-
const FIRST$
|
|
4281
|
+
const FIRST$20 = 1;
|
|
4278
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.";
|
|
4279
4283
|
/** @internal */
|
|
4280
4284
|
const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
|
|
@@ -4282,8 +4286,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
4282
4286
|
const ignored = yield* files.ignoredFiles(root, SOURCES);
|
|
4283
4287
|
return pipe(ignored, Array$1.map((file) => ({
|
|
4284
4288
|
file: files.join(root, file),
|
|
4285
|
-
line: FIRST$
|
|
4286
|
-
column: FIRST$
|
|
4289
|
+
line: FIRST$20,
|
|
4290
|
+
column: FIRST$20,
|
|
4287
4291
|
rule: RULE$66,
|
|
4288
4292
|
message: MESSAGE$11
|
|
4289
4293
|
})));
|
|
@@ -4314,8 +4318,8 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
|
|
|
4314
4318
|
return Array$1.flatten(entries);
|
|
4315
4319
|
});
|
|
4316
4320
|
// src/shared/lib/tree-sitter.ts
|
|
4317
|
-
const taggedError$
|
|
4318
|
-
var GrammarUnreadable = class extends taggedError$
|
|
4321
|
+
const taggedError$12 = Schema.TaggedError;
|
|
4322
|
+
var GrammarUnreadable = class extends taggedError$12()("GrammarUnreadable", {
|
|
4319
4323
|
grammar: Schema.String,
|
|
4320
4324
|
message: Schema.String
|
|
4321
4325
|
}) {};
|
|
@@ -4348,14 +4352,11 @@ const readTree = ({ language, source, read }) => {
|
|
|
4348
4352
|
});
|
|
4349
4353
|
};
|
|
4350
4354
|
// src/features/check-placement/model/rust-layout.ts
|
|
4351
|
-
const
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
"entities",
|
|
4357
|
-
"shared"
|
|
4358
|
-
];
|
|
4355
|
+
const CRATE_LAYERS = Option.fromUndefinedOr(rustCrate().layers);
|
|
4356
|
+
const LAYERS = pipe(CRATE_LAYERS, Option.match({
|
|
4357
|
+
onNone: () => [],
|
|
4358
|
+
onSome: ({ order }) => order
|
|
4359
|
+
}));
|
|
4359
4360
|
const RUST_FILE = /\.rs$/u;
|
|
4360
4361
|
const BINARY$1 = /^src\/bin\/[^/]+\.rs$/u;
|
|
4361
4362
|
const MANIFEST$3 = /(?:^|\/)Cargo\.toml$/u;
|
|
@@ -4363,13 +4364,10 @@ const MODULE_INDEX = "mod";
|
|
|
4363
4364
|
const CRATE_ROOTS = ["src/lib.rs", "src/main.rs"];
|
|
4364
4365
|
const OUTSIDE_ALLOWED = /^(?:build\.rs|benches\/.+)$/u;
|
|
4365
4366
|
const SEPARATE_TEST = /^tests\/.+$/u;
|
|
4366
|
-
const SLICED_LAYERS =
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
"entities",
|
|
4371
|
-
"shared"
|
|
4372
|
-
];
|
|
4367
|
+
const SLICED_LAYERS = pipe(CRATE_LAYERS, Option.match({
|
|
4368
|
+
onNone: () => [],
|
|
4369
|
+
onSome: ({ sliced = [], segmented = [] }) => [...sliced, ...segmented]
|
|
4370
|
+
}));
|
|
4373
4371
|
const LAYER_DEPTH = 1;
|
|
4374
4372
|
const SOURCE_PREFIX$1 = `src/`;
|
|
4375
4373
|
const ROOT_CRATE = "";
|
|
@@ -4410,7 +4408,7 @@ const kindOf$1 = (inner) => {
|
|
|
4410
4408
|
const isSliceIndex = (modulePath) => modulePath.length === 2 && Option.exists(Array$1.head(modulePath), (layer) => Array$1.contains(SLICED_LAYERS, layer));
|
|
4411
4409
|
// src/features/check-placement/model/rust-syntax.ts
|
|
4412
4410
|
const IGNORED_ITEMS = ["line_comment", "block_comment"];
|
|
4413
|
-
const NEXT$
|
|
4411
|
+
const NEXT$8 = 1;
|
|
4414
4412
|
const ALLOCATOR = "global_allocator";
|
|
4415
4413
|
const field = (node, name) => Option.fromNullishOr(node.childForFieldName(name));
|
|
4416
4414
|
const namedChildren = (node) => pipe(node.namedChildren, Array$1.flatMap((child) => Option.toArray(Option.fromNullishOr(child))));
|
|
@@ -4419,8 +4417,8 @@ const itemOf = (node) => ({
|
|
|
4419
4417
|
name: Option.map(field(node, "name"), (name) => name.text),
|
|
4420
4418
|
inline: Option.isSome(field(node, "body")),
|
|
4421
4419
|
visible: Array$1.some(namedChildren(node), (child) => child.type === "visibility_modifier"),
|
|
4422
|
-
line: node.startPosition.row + NEXT$
|
|
4423
|
-
column: node.startPosition.column + NEXT$
|
|
4420
|
+
line: node.startPosition.row + NEXT$8,
|
|
4421
|
+
column: node.startPosition.column + NEXT$8
|
|
4424
4422
|
});
|
|
4425
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)));
|
|
4426
4424
|
const readRustFile = (root) => ({
|
|
@@ -12865,8 +12863,8 @@ var english_verbs_default = [
|
|
|
12865
12863
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12866
12864
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12867
12865
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12868
|
-
const SEPARATOR$
|
|
12869
|
-
const NEXT$
|
|
12866
|
+
const SEPARATOR$20 = "/";
|
|
12867
|
+
const NEXT$7 = 1;
|
|
12870
12868
|
const WORD_SEPARATOR$1 = "-";
|
|
12871
12869
|
const MINIMUM_WORDS = 2;
|
|
12872
12870
|
const FEATURES$1 = "src/features/";
|
|
@@ -12891,34 +12889,29 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12891
12889
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12892
12890
|
};
|
|
12893
12891
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12894
|
-
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$
|
|
12895
|
-
const SLICE_LAYERS = [
|
|
12896
|
-
"features",
|
|
12897
|
-
"entities",
|
|
12898
|
-
"widgets",
|
|
12899
|
-
"pages"
|
|
12900
|
-
];
|
|
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(() => []));
|
|
12901
12894
|
const SLICE_DEPTHS = [3, 4];
|
|
12902
|
-
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);
|
|
12903
12896
|
const isInSliceLayer = (parts) => {
|
|
12904
12897
|
const [source, layer] = parts;
|
|
12905
|
-
return `${source}${SEPARATOR$
|
|
12898
|
+
return `${source}${SEPARATOR$20}` === SOURCE$2 && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12906
12899
|
};
|
|
12907
12900
|
const indexedSlice = (owned) => {
|
|
12908
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12909
|
-
const depth = parts.length - NEXT$
|
|
12910
|
-
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)}`));
|
|
12911
12904
|
};
|
|
12912
12905
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12913
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12914
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12915
|
-
const isSegmentFolder = (depth) => parts.length > depth + NEXT$
|
|
12916
|
-
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)}`));
|
|
12917
12910
|
};
|
|
12918
12911
|
const deployNamed = ({ workspace, inner }) => {
|
|
12919
12912
|
if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
|
|
12920
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12921
|
-
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)}`));
|
|
12922
12915
|
};
|
|
12923
12916
|
/** @internal */
|
|
12924
12917
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12961,7 +12954,7 @@ const LAYER_ITEMS = [
|
|
|
12961
12954
|
"attribute_item",
|
|
12962
12955
|
"inner_attribute_item"
|
|
12963
12956
|
];
|
|
12964
|
-
const READ_CONCURRENCY$
|
|
12957
|
+
const READ_CONCURRENCY$29 = 64;
|
|
12965
12958
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12966
12959
|
const NONE$4 = [];
|
|
12967
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.";
|
|
@@ -13037,16 +13030,16 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
13037
13030
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
13038
13031
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
13039
13032
|
const parse = parsedWith(language);
|
|
13040
|
-
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 });
|
|
13041
13034
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
13042
13035
|
});
|
|
13043
13036
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
13044
13037
|
const RULE$65 = "shadcn-ui-alias";
|
|
13045
|
-
const FIRST$
|
|
13038
|
+
const FIRST$19 = 1;
|
|
13046
13039
|
const problemOf$12 = (directory, { file, alias }) => ({
|
|
13047
13040
|
file,
|
|
13048
|
-
line: FIRST$
|
|
13049
|
-
column: FIRST$
|
|
13041
|
+
line: FIRST$19,
|
|
13042
|
+
column: FIRST$19,
|
|
13050
13043
|
rule: RULE$65,
|
|
13051
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/*".`
|
|
13052
13045
|
});
|
|
@@ -13109,10 +13102,10 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
13109
13102
|
const BIN = "bin";
|
|
13110
13103
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
13111
13104
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
13112
|
-
const SEPARATOR$
|
|
13105
|
+
const SEPARATOR$19 = "/";
|
|
13113
13106
|
const CURRENT = "./";
|
|
13114
|
-
const READ_CONCURRENCY$
|
|
13115
|
-
const FIRST$
|
|
13107
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13108
|
+
const FIRST$18 = 1;
|
|
13116
13109
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
13117
13110
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
13118
13111
|
const COMMAND_FILE$1 = /^bin\/[^/]+$/u;
|
|
@@ -13147,16 +13140,16 @@ const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
|
13147
13140
|
const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
13148
13141
|
const files = yield* RepositoryFiles;
|
|
13149
13142
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
13150
|
-
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));
|
|
13151
13144
|
});
|
|
13152
13145
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
13153
13146
|
const files = yield* RepositoryFiles;
|
|
13154
13147
|
const listed = yield* files.listedFiles(root);
|
|
13155
13148
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY)));
|
|
13156
|
-
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 });
|
|
13157
13150
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
13158
13151
|
});
|
|
13159
|
-
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));
|
|
13160
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 }) => ({
|
|
13161
13154
|
file,
|
|
13162
13155
|
...positionOf(source)(start),
|
|
@@ -13164,7 +13157,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.
|
|
|
13164
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.`
|
|
13165
13158
|
})));
|
|
13166
13159
|
const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap(stringsIn), Array$1.flatMap(runsIn));
|
|
13167
|
-
const problemsIn$
|
|
13160
|
+
const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
|
|
13168
13161
|
const files = yield* RepositoryFiles;
|
|
13169
13162
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13170
13163
|
const entries = yield* declaredEntries(root, directory);
|
|
@@ -13180,8 +13173,8 @@ const problemsIn$21 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13180
13173
|
const isRun = (path) => Array$1.contains(runPaths, path) || Array$1.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
|
|
13181
13174
|
const unrun = pipe(commands, Array$1.filter((path) => !isRun(path)), Array$1.map((path) => ({
|
|
13182
13175
|
file: files.join(root, directory, path),
|
|
13183
|
-
line: FIRST$
|
|
13184
|
-
column: FIRST$
|
|
13176
|
+
line: FIRST$18,
|
|
13177
|
+
column: FIRST$18,
|
|
13185
13178
|
rule: UNRUN,
|
|
13186
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.`
|
|
13187
13180
|
})));
|
|
@@ -13193,8 +13186,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
|
|
|
13193
13186
|
const isDirectory = yield* files.isDirectory(file);
|
|
13194
13187
|
return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
|
|
13195
13188
|
file,
|
|
13196
|
-
line: FIRST$
|
|
13197
|
-
column: FIRST$
|
|
13189
|
+
line: FIRST$18,
|
|
13190
|
+
column: FIRST$18,
|
|
13198
13191
|
rule: SCRIPTS,
|
|
13199
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.`
|
|
13200
13193
|
})));
|
|
@@ -13203,11 +13196,11 @@ const isCommandFile = (path) => isCommand(path) || COMMAND_FILE$1.test(path) &&
|
|
|
13203
13196
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
13204
13197
|
const files = yield* RepositoryFiles;
|
|
13205
13198
|
const listed = yield* files.listedFiles(root);
|
|
13206
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
13207
|
-
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) => ({
|
|
13208
13201
|
file: files.join(root, file),
|
|
13209
|
-
line: FIRST$
|
|
13210
|
-
column: FIRST$
|
|
13202
|
+
line: FIRST$18,
|
|
13203
|
+
column: FIRST$18,
|
|
13211
13204
|
rule: CODE_IN_BIN,
|
|
13212
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.`
|
|
13213
13206
|
})));
|
|
@@ -13216,9 +13209,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13216
13209
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13217
13210
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13218
13211
|
const workflows = yield* workflowText(root);
|
|
13219
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$
|
|
13220
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13221
|
-
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 });
|
|
13222
13215
|
return [
|
|
13223
13216
|
...Array$1.flatten(found),
|
|
13224
13217
|
...Array$1.getSomes(scripts),
|
|
@@ -13226,14 +13219,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13226
13219
|
];
|
|
13227
13220
|
});
|
|
13228
13221
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13229
|
-
const START$
|
|
13222
|
+
const START$32 = 0;
|
|
13230
13223
|
const QUOTES = ["\"", "'"];
|
|
13231
13224
|
const firstIndex = (source, needles) => {
|
|
13232
13225
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13233
13226
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13234
13227
|
};
|
|
13235
13228
|
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13236
|
-
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));
|
|
13237
13230
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13238
13231
|
const MEMBER_LISTS = [
|
|
13239
13232
|
"members",
|
|
@@ -13249,14 +13242,14 @@ const WORKSPACE = "workspace";
|
|
|
13249
13242
|
const PATCH = "patch";
|
|
13250
13243
|
const PATCH_DEPTH = 2;
|
|
13251
13244
|
const WORKSPACE_DEPTH = 1;
|
|
13252
|
-
const START$
|
|
13245
|
+
const START$31 = 0;
|
|
13253
13246
|
const WILDCARD$4 = /[*?[]/u;
|
|
13254
13247
|
const KEY_SEPARATOR$1 = ".";
|
|
13255
13248
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
13256
13249
|
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
13257
13250
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
13258
|
-
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$
|
|
13259
|
-
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);
|
|
13260
13253
|
const namedPaths = (trail, key, value) => {
|
|
13261
13254
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR$1);
|
|
13262
13255
|
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
@@ -13280,7 +13273,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
13280
13273
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
13281
13274
|
const WRAP_OFFSET$2 = 1;
|
|
13282
13275
|
const WILDCARD$3 = /[*?[{]/u;
|
|
13283
|
-
const SEPARATOR$
|
|
13276
|
+
const SEPARATOR$18 = "/";
|
|
13284
13277
|
const RELATIVE$3 = ".";
|
|
13285
13278
|
const JSON_EXTENSION = ".json";
|
|
13286
13279
|
const isObject = (node) => Predicate$1.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
@@ -13288,7 +13281,7 @@ const firstObject = (node) => {
|
|
|
13288
13281
|
if (isObject(node)) return Option.some(node);
|
|
13289
13282
|
return pipe(childrenOf$4(node), Array$1.findFirst(firstObject));
|
|
13290
13283
|
};
|
|
13291
|
-
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));
|
|
13292
13285
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
13293
13286
|
field: name,
|
|
13294
13287
|
text,
|
|
@@ -13320,14 +13313,14 @@ const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
|
13320
13313
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13321
13314
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13322
13315
|
const OUTSIDE = "..";
|
|
13323
|
-
const READ_CONCURRENCY$
|
|
13316
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13324
13317
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13325
13318
|
const files = yield* RepositoryFiles;
|
|
13326
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)));
|
|
13327
13320
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13328
|
-
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 });
|
|
13329
13322
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13330
|
-
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 });
|
|
13331
13324
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13332
13325
|
});
|
|
13333
13326
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
@@ -13341,13 +13334,13 @@ const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
|
13341
13334
|
if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
|
|
13342
13335
|
return yield* tsconfigMentions(file, source);
|
|
13343
13336
|
});
|
|
13344
|
-
const problemsIn$
|
|
13337
|
+
const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
13345
13338
|
const files = yield* RepositoryFiles;
|
|
13346
13339
|
const file = files.join(root, name);
|
|
13347
13340
|
const source = yield* files.readFile(file);
|
|
13348
13341
|
if (Option.isNone(source)) return [];
|
|
13349
13342
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13350
|
-
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 });
|
|
13351
13344
|
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$11(file, source.value)));
|
|
13352
13345
|
});
|
|
13353
13346
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
@@ -13367,7 +13360,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13367
13360
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13368
13361
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13369
13362
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13370
|
-
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" });
|
|
13371
13364
|
return [...Array$1.flatten(found), ...patterns];
|
|
13372
13365
|
});
|
|
13373
13366
|
// src/features/check-repository-layout/model/crates.ts
|
|
@@ -13375,14 +13368,14 @@ const RULE$63 = "unverified-crate";
|
|
|
13375
13368
|
const VERSION_RULE = "release-version";
|
|
13376
13369
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13377
13370
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13378
|
-
const CONFIG_FILE$
|
|
13379
|
-
const SEPARATOR$
|
|
13380
|
-
const FIRST$
|
|
13381
|
-
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;
|
|
13382
13375
|
const problemFor$6 = (crate, message) => ({
|
|
13383
13376
|
file: crate.manifest,
|
|
13384
|
-
line: FIRST$
|
|
13385
|
-
column: FIRST$
|
|
13377
|
+
line: FIRST$17,
|
|
13378
|
+
column: FIRST$17,
|
|
13386
13379
|
rule: RULE$63,
|
|
13387
13380
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
13388
13381
|
});
|
|
@@ -13390,21 +13383,21 @@ const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories
|
|
|
13390
13383
|
const files = yield* RepositoryFiles;
|
|
13391
13384
|
const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
|
|
13392
13385
|
if (Option.isNone(workspace)) return Option.some(problemFor$6(crate, "is outside every workspace package"));
|
|
13393
|
-
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$
|
|
13394
|
-
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`));
|
|
13395
13388
|
});
|
|
13396
13389
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
13397
13390
|
const files = yield* RepositoryFiles;
|
|
13398
13391
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
13399
|
-
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))));
|
|
13400
13393
|
if (Option.isNone(workspace)) return Option.none();
|
|
13401
13394
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
13402
13395
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
13403
13396
|
if (Option.isNone(version) || version.value === crate.version) return Option.none();
|
|
13404
13397
|
return Option.some({
|
|
13405
13398
|
file: crate.manifest,
|
|
13406
|
-
line: FIRST$
|
|
13407
|
-
column: FIRST$
|
|
13399
|
+
line: FIRST$17,
|
|
13400
|
+
column: FIRST$17,
|
|
13408
13401
|
rule: VERSION_RULE,
|
|
13409
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.`
|
|
13410
13403
|
});
|
|
@@ -13416,9 +13409,9 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13416
13409
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13417
13410
|
const directories = yield* workspaceDirectories(root);
|
|
13418
13411
|
const crates = yield* cratesIn(root);
|
|
13419
|
-
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$
|
|
13412
|
+
const notAtRoot = yield* Effect.cached(lintedPerWorkspace(files.join(root, CONFIG_FILE$7)));
|
|
13420
13413
|
const unverified = (crate) => problemIn$3(root, directories, crate).pipe(Effect.when(notAtRoot), Effect.map(Option.flatten));
|
|
13421
|
-
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 });
|
|
13422
13415
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13423
13416
|
});
|
|
13424
13417
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
@@ -13440,7 +13433,7 @@ const NEGATED = "!";
|
|
|
13440
13433
|
const ROOT_WORKSPACE = ".";
|
|
13441
13434
|
const WRAP_OFFSET$1 = 1;
|
|
13442
13435
|
const NO_OFFSET$1 = 0;
|
|
13443
|
-
const READ_CONCURRENCY$
|
|
13436
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13444
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.";
|
|
13445
13438
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13446
13439
|
const whole = (program) => [program];
|
|
@@ -13487,7 +13480,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
|
|
|
13487
13480
|
const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
|
|
13488
13481
|
return pipe(kind.sections(parsed.program), Array$1.flatMap(patternsIn(kind.keys)), Array$1.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
|
|
13489
13482
|
});
|
|
13490
|
-
const problemsIn$
|
|
13483
|
+
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
13491
13484
|
const { root, file, kind, workspaces, entries } = request;
|
|
13492
13485
|
const files = yield* RepositoryFiles;
|
|
13493
13486
|
const path = files.join(root, file);
|
|
@@ -13529,13 +13522,13 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13529
13522
|
}];
|
|
13530
13523
|
return [];
|
|
13531
13524
|
}));
|
|
13532
|
-
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$
|
|
13525
|
+
const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
|
|
13533
13526
|
root,
|
|
13534
13527
|
file,
|
|
13535
13528
|
kind,
|
|
13536
13529
|
workspaces,
|
|
13537
13530
|
entries
|
|
13538
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13531
|
+
}), { concurrency: READ_CONCURRENCY$25 });
|
|
13539
13532
|
return Array$1.flatten(found);
|
|
13540
13533
|
});
|
|
13541
13534
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
@@ -13550,9 +13543,9 @@ const VITE_CONFIG = /(?:^|\/)vite\.config\.[cm]?ts$/u;
|
|
|
13550
13543
|
const FALLOW_SECTION = "fallow";
|
|
13551
13544
|
const NO_OFFSET = 0;
|
|
13552
13545
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13553
|
-
const SEPARATOR$
|
|
13546
|
+
const SEPARATOR$16 = "/";
|
|
13554
13547
|
const WRAP_OFFSET = 1;
|
|
13555
|
-
const READ_CONCURRENCY$
|
|
13548
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13556
13549
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13557
13550
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13558
13551
|
const entryPatternsIn = (node) => {
|
|
@@ -13562,7 +13555,7 @@ const entryPatternsIn = (node) => {
|
|
|
13562
13555
|
})));
|
|
13563
13556
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13564
13557
|
};
|
|
13565
|
-
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);
|
|
13566
13559
|
const sourceOf$1 = (file, text) => {
|
|
13567
13560
|
if (VITE_CONFIG.test(file)) return {
|
|
13568
13561
|
code: text,
|
|
@@ -13575,7 +13568,7 @@ const sourceOf$1 = (file, text) => {
|
|
|
13575
13568
|
sections: (program) => [program]
|
|
13576
13569
|
};
|
|
13577
13570
|
};
|
|
13578
|
-
const problemsIn$
|
|
13571
|
+
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13579
13572
|
const files = yield* RepositoryFiles;
|
|
13580
13573
|
const path = files.join(root, file);
|
|
13581
13574
|
const text = yield* files.readFile(path);
|
|
@@ -13593,47 +13586,47 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13593
13586
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13594
13587
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13595
13588
|
const directories = yield* workspaceDirectories(root);
|
|
13596
|
-
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 });
|
|
13597
13590
|
return Array$1.flatten(found);
|
|
13598
13591
|
});
|
|
13599
13592
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
13600
13593
|
const RULE$60 = "root-workspace-path";
|
|
13601
|
-
const CONFIG_FILE$
|
|
13594
|
+
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13602
13595
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
13603
13596
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
13604
|
-
const FIRST$
|
|
13605
|
-
const NEXT$
|
|
13597
|
+
const FIRST$16 = 0;
|
|
13598
|
+
const NEXT$6 = 1;
|
|
13606
13599
|
const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
|
|
13607
13600
|
const mentions = (directory) => (text) => {
|
|
13608
13601
|
const parts = String$1.split(text, directory);
|
|
13609
|
-
return pipe(Array$1.drop(parts, NEXT$
|
|
13602
|
+
return pipe(Array$1.drop(parts, NEXT$6), Array$1.some((after, index) => {
|
|
13610
13603
|
const before = parts[index] ?? "";
|
|
13611
|
-
const previous = String$1.slice(before.length - NEXT$
|
|
13612
|
-
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);
|
|
13613
13606
|
return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
|
|
13614
13607
|
}));
|
|
13615
13608
|
};
|
|
13616
|
-
const problemsIn$
|
|
13609
|
+
const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
13617
13610
|
file,
|
|
13618
13611
|
...positionOf(source)(found.start),
|
|
13619
13612
|
rule: RULE$60,
|
|
13620
|
-
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.`
|
|
13621
13614
|
})));
|
|
13622
13615
|
/** @internal */
|
|
13623
13616
|
const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
|
|
13624
13617
|
const files = yield* RepositoryFiles;
|
|
13625
|
-
const file = files.join(root, CONFIG_FILE$
|
|
13618
|
+
const file = files.join(root, CONFIG_FILE$6);
|
|
13626
13619
|
const source = yield* files.readFile(file);
|
|
13627
13620
|
if (Option.isNone(source)) return [];
|
|
13628
13621
|
const directories = yield* workspaceDirectories(root);
|
|
13629
13622
|
const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
|
|
13630
|
-
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$
|
|
13623
|
+
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
|
|
13631
13624
|
});
|
|
13632
13625
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
13633
13626
|
const RULE$59 = "hidden-verify";
|
|
13634
|
-
const CONFIG_FILE$
|
|
13635
|
-
const FIRST$
|
|
13636
|
-
const READ_CONCURRENCY$
|
|
13627
|
+
const CONFIG_FILE$5 = "vite.config.ts";
|
|
13628
|
+
const FIRST$15 = 1;
|
|
13629
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13637
13630
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13638
13631
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13639
13632
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13642,21 +13635,21 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13642
13635
|
const verified = yield* hasVerifyTask(file);
|
|
13643
13636
|
return Option.some({
|
|
13644
13637
|
file,
|
|
13645
|
-
line: FIRST$
|
|
13646
|
-
column: FIRST$
|
|
13638
|
+
line: FIRST$15,
|
|
13639
|
+
column: FIRST$15,
|
|
13647
13640
|
rule: RULE$59,
|
|
13648
|
-
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}.`
|
|
13649
13642
|
}).pipe(Option.filter(() => verified));
|
|
13650
13643
|
});
|
|
13651
13644
|
/** @internal */
|
|
13652
13645
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13653
13646
|
const directories = yield* workspaceDirectories(root);
|
|
13654
|
-
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 });
|
|
13655
13648
|
return Array$1.getSomes(found);
|
|
13656
13649
|
});
|
|
13657
13650
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13658
13651
|
const RULE$58 = "shared-uncached-task";
|
|
13659
|
-
const READ_CONCURRENCY$
|
|
13652
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13660
13653
|
const SHARED = 2;
|
|
13661
13654
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13662
13655
|
const UncachedTask = Schema.Struct({
|
|
@@ -13705,12 +13698,12 @@ const problemsOf$3 = (definitions) => {
|
|
|
13705
13698
|
/** @internal */
|
|
13706
13699
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13707
13700
|
const directories = yield* workspaceDirectories(root);
|
|
13708
|
-
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 });
|
|
13709
13702
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13710
13703
|
});
|
|
13711
13704
|
// src/features/check-repository-layout/model/tested-verify.ts
|
|
13712
13705
|
const RULE$57 = "tested-verify";
|
|
13713
|
-
const READ_CONCURRENCY$
|
|
13706
|
+
const READ_CONCURRENCY$21 = 8;
|
|
13714
13707
|
const TESTS = new Set(TEST_TASK_NAMES);
|
|
13715
13708
|
const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
|
|
13716
13709
|
const edgesOf = (task) => pipe(Option.toArray(propertyValue("dependsOn")(task.value)), Array$1.flatMap(stringsIn), Array$1.map((at) => ({
|
|
@@ -13733,7 +13726,7 @@ const testedEdges = (tasks) => {
|
|
|
13733
13726
|
const byName = new Map(pipe(tasks, Array$1.map(named$1)));
|
|
13734
13727
|
return edgesFrom(byName, /* @__PURE__ */ new Set())(TASK_NAMES.verify);
|
|
13735
13728
|
};
|
|
13736
|
-
const problemsIn$
|
|
13729
|
+
const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directory) {
|
|
13737
13730
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13738
13731
|
return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
|
|
13739
13732
|
file,
|
|
@@ -13745,12 +13738,12 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, directo
|
|
|
13745
13738
|
/** @internal */
|
|
13746
13739
|
const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
|
|
13747
13740
|
const directories = yield* workspaceDirectories(root);
|
|
13748
|
-
const found = yield* Effect.forEach(directories, (directory) => problemsIn$
|
|
13741
|
+
const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$21 });
|
|
13749
13742
|
return Array$1.flatten(found);
|
|
13750
13743
|
});
|
|
13751
13744
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13752
13745
|
const RULE$56 = "unlocked-task";
|
|
13753
|
-
const READ_CONCURRENCY$
|
|
13746
|
+
const READ_CONCURRENCY$20 = 8;
|
|
13754
13747
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13755
13748
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13756
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))));
|
|
@@ -13767,7 +13760,7 @@ const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tra
|
|
|
13767
13760
|
/** @internal */
|
|
13768
13761
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13769
13762
|
const directories = yield* workspaceDirectories(root);
|
|
13770
|
-
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 });
|
|
13771
13764
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13772
13765
|
});
|
|
13773
13766
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13797,14 +13790,14 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13797
13790
|
});
|
|
13798
13791
|
// src/shared/lib/package-name.ts
|
|
13799
13792
|
const SCOPE$2 = "@";
|
|
13800
|
-
const SEPARATOR$
|
|
13793
|
+
const SEPARATOR$15 = "/";
|
|
13801
13794
|
const SCOPED_SEGMENTS = 2;
|
|
13802
13795
|
const PLAIN_SEGMENTS = 1;
|
|
13803
13796
|
const segmentCount = (specifier) => {
|
|
13804
13797
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13805
13798
|
return PLAIN_SEGMENTS;
|
|
13806
13799
|
};
|
|
13807
|
-
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));
|
|
13808
13801
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13809
13802
|
const RELATIVE$2 = /^\.\.?(?:\/|$)/u;
|
|
13810
13803
|
const SUBPATH_IMPORT$1 = "#";
|
|
@@ -13961,11 +13954,11 @@ const LISTED_LARGEST = 5;
|
|
|
13961
13954
|
const SIZE_CONCURRENCY = 32;
|
|
13962
13955
|
const MEGABYTE = 1e6;
|
|
13963
13956
|
const MEGABYTE_DIGITS = 1;
|
|
13964
|
-
const START$
|
|
13957
|
+
const START$30 = 0;
|
|
13965
13958
|
const SINGLE_ENTRY = 1;
|
|
13966
13959
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13967
13960
|
const usageHint = (dependency, entryCount) => {
|
|
13968
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13961
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$30 && dependency.entries.length < entryCount)) return "";
|
|
13969
13962
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13970
13963
|
};
|
|
13971
13964
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13974,7 +13967,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13974
13967
|
const { workspace, total } = overrun;
|
|
13975
13968
|
const config = yield* files.readFile(workspace.configFile);
|
|
13976
13969
|
const source = Option.getOrElse(config, () => "");
|
|
13977
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13970
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$30);
|
|
13978
13971
|
return {
|
|
13979
13972
|
file: workspace.configFile,
|
|
13980
13973
|
...positionOf(source)(index),
|
|
@@ -13991,7 +13984,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13991
13984
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13992
13985
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13993
13986
|
const sizes = HashMap.fromIterable(measured);
|
|
13994
|
-
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);
|
|
13995
13988
|
return {
|
|
13996
13989
|
closures,
|
|
13997
13990
|
sizeOf,
|
|
@@ -14024,11 +14017,11 @@ const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(publishe
|
|
|
14024
14017
|
})];
|
|
14025
14018
|
});
|
|
14026
14019
|
const stackProblems = (file, source, dependencies) => {
|
|
14027
|
-
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);
|
|
14028
14021
|
const rest = String$1.slice(section)(source);
|
|
14029
14022
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
14030
14023
|
file,
|
|
14031
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
14024
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$30)),
|
|
14032
14025
|
rule: STACK_DEPENDENCY,
|
|
14033
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.`
|
|
14034
14027
|
})));
|
|
@@ -14081,8 +14074,8 @@ const RULE$55 = "migration-order";
|
|
|
14081
14074
|
const SNAPSHOT = "snapshot.json";
|
|
14082
14075
|
const MIGRATION = "migration.sql";
|
|
14083
14076
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
14084
|
-
const FIRST$
|
|
14085
|
-
const READ_CONCURRENCY$
|
|
14077
|
+
const FIRST$14 = 1;
|
|
14078
|
+
const READ_CONCURRENCY$19 = 16;
|
|
14086
14079
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
14087
14080
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
14088
14081
|
const files = yield* RepositoryFiles;
|
|
@@ -14109,8 +14102,8 @@ const latestOf = (migrations) => pipe(migrations, Array$1.filter(({ applied }) =
|
|
|
14109
14102
|
const isBefore = (later) => (migration) => !migration.applied && Order.isLessThan(String$1.Order)(migration.folder, later.folder);
|
|
14110
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 }) => ({
|
|
14111
14104
|
file: join(root, file),
|
|
14112
|
-
line: FIRST$
|
|
14113
|
-
column: FIRST$
|
|
14105
|
+
line: FIRST$14,
|
|
14106
|
+
column: FIRST$14,
|
|
14114
14107
|
rule: RULE$55,
|
|
14115
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}.`
|
|
14116
14109
|
})))), Option.getOrElse(() => []));
|
|
@@ -14122,7 +14115,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
14122
14115
|
if (Option.isNone(found)) return [];
|
|
14123
14116
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
14124
14117
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
14125
|
-
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 });
|
|
14126
14119
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
14127
14120
|
});
|
|
14128
14121
|
// src/shared/lib/bundle-error.ts
|
|
@@ -14143,7 +14136,7 @@ const IMPORT_DECLARATION = /import\s+(?<kind>type\s+)?\{(?<names>[^}]*)\}\s*from
|
|
|
14143
14136
|
const TYPE_PREFIX = /^type\s+/u;
|
|
14144
14137
|
const ALIAS$1 = /\s+as\s+\S+$/u;
|
|
14145
14138
|
const VENDOR_FILE = /^(?<name>[\w.-]+)\.js$/u;
|
|
14146
|
-
const SEPARATOR$
|
|
14139
|
+
const SEPARATOR$14 = "/";
|
|
14147
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, "")));
|
|
14148
14141
|
const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option.filter((groups) => !Predicate$1.isString(groups["kind"])), Option.flatMap((groups) => Option.all({
|
|
14149
14142
|
specifier: Option.fromNullishOr(groups["specifier"]),
|
|
@@ -14156,7 +14149,7 @@ const declarationOf = (match) => pipe(Option.fromNullishOr(match.groups), Option
|
|
|
14156
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)));
|
|
14157
14150
|
const nameIn = (rest) => pipe(Option.fromNullishOr(VENDOR_FILE.exec(rest)), Option.flatMapNullishOr(({ groups }) => groups), Option.flatMapNullishOr((groups) => groups["name"]));
|
|
14158
14151
|
/** @internal */
|
|
14159
|
-
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);
|
|
14160
14153
|
/** @internal */
|
|
14161
14154
|
const entrySource = (name, names) => {
|
|
14162
14155
|
return `export { ${pipe(Array$1.sort(Array$1.dedupe(names), Order.String), Array$1.join(", "))} } from "${name}";\n`;
|
|
@@ -14441,8 +14434,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
|
|
|
14441
14434
|
const builtins = new Set(builtinModules);
|
|
14442
14435
|
const always = () => true;
|
|
14443
14436
|
const never = () => false;
|
|
14444
|
-
const taggedError$
|
|
14445
|
-
var BundleFailed = class extends taggedError$
|
|
14437
|
+
const taggedError$11 = Schema.TaggedError;
|
|
14438
|
+
var BundleFailed = class extends taggedError$11()("BundleFailed", { detail: Schema.String }) {};
|
|
14446
14439
|
const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
|
|
14447
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);
|
|
14448
14441
|
const isBuiltin = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
|
|
@@ -14567,7 +14560,7 @@ const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(dev
|
|
|
14567
14560
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
14568
14561
|
const RULE$52 = "optional-peer";
|
|
14569
14562
|
const REQUIRED_RULE = "required-peer";
|
|
14570
|
-
const START$
|
|
14563
|
+
const START$29 = 0;
|
|
14571
14564
|
const SINGLE$3 = 1;
|
|
14572
14565
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
14573
14566
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
@@ -14575,9 +14568,9 @@ const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, na
|
|
|
14575
14568
|
const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
|
|
14576
14569
|
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
14577
14570
|
const positionIn = (located, key, name) => {
|
|
14578
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
14571
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$29);
|
|
14579
14572
|
const rest = String$1.slice(section)(located.source);
|
|
14580
|
-
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));
|
|
14581
14574
|
};
|
|
14582
14575
|
const problemFor$3 = (located, name, importers) => ({
|
|
14583
14576
|
file: located.file,
|
|
@@ -14597,7 +14590,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
|
14597
14590
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
14598
14591
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
14599
14592
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
14600
|
-
if (!(importers.length > START$
|
|
14593
|
+
if (!(importers.length > START$29 && importers.length < libraries.length) || neededByBin) return [];
|
|
14601
14594
|
return [problemFor$3(located, name, importers)];
|
|
14602
14595
|
}));
|
|
14603
14596
|
};
|
|
@@ -14620,8 +14613,8 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
14620
14613
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
14621
14614
|
const RULE$51 = "side-effects";
|
|
14622
14615
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
14623
|
-
const START$
|
|
14624
|
-
const FIRST$
|
|
14616
|
+
const START$28 = 0;
|
|
14617
|
+
const FIRST$13 = 1;
|
|
14625
14618
|
const LISTED_PACKAGES = 4;
|
|
14626
14619
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
14627
14620
|
const EXPORTS_KEY = "\"exports\"";
|
|
@@ -14644,7 +14637,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
14644
14637
|
label: entry.label,
|
|
14645
14638
|
member,
|
|
14646
14639
|
...extra
|
|
14647
|
-
}, ({ modules }) => modules > START$
|
|
14640
|
+
}, ({ modules }) => modules > START$28);
|
|
14648
14641
|
});
|
|
14649
14642
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
14650
14643
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -14661,12 +14654,12 @@ const importsOf$1 = (packages) => Array$1.match(packages, {
|
|
|
14661
14654
|
onNonEmpty: (names) => ` and imports ${listed(names)}`
|
|
14662
14655
|
});
|
|
14663
14656
|
const othersOf = (total) => {
|
|
14664
|
-
if (total <= FIRST$
|
|
14665
|
-
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.`;
|
|
14666
14659
|
};
|
|
14667
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.`;
|
|
14668
14661
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14669
|
-
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));
|
|
14670
14663
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14671
14664
|
file,
|
|
14672
14665
|
...positionOf(source)(keyIndex$1(source)),
|
|
@@ -14675,8 +14668,8 @@ const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$
|
|
|
14675
14668
|
})), Option.toArray);
|
|
14676
14669
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14677
14670
|
const RULE$50 = "top-level-effect";
|
|
14678
|
-
const CODE
|
|
14679
|
-
const READ_CONCURRENCY$
|
|
14671
|
+
const CODE = /\.[cm]?[jt]sx?$/u;
|
|
14672
|
+
const READ_CONCURRENCY$18 = 16;
|
|
14680
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.";
|
|
14681
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.";
|
|
14682
14675
|
const isEffect = (statement) => {
|
|
@@ -14687,7 +14680,7 @@ const messageOf$5 = (statement) => {
|
|
|
14687
14680
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
14688
14681
|
return STATEMENT_MESSAGE;
|
|
14689
14682
|
};
|
|
14690
|
-
const problemsIn$
|
|
14683
|
+
const problemsIn$14 = (api) => (file) => (source) => {
|
|
14691
14684
|
const retained = api.createSourceFile(file, source);
|
|
14692
14685
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
|
|
14693
14686
|
rule: RULE$50,
|
|
@@ -14702,13 +14695,13 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14702
14695
|
const compiler = yield* typeScriptCompiler;
|
|
14703
14696
|
const names = yield* files.ownedFiles(root);
|
|
14704
14697
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14705
|
-
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE
|
|
14706
|
-
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 });
|
|
14707
14700
|
return Array$1.flatten(found);
|
|
14708
14701
|
}, Effect.scoped);
|
|
14709
14702
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14710
|
-
const START$
|
|
14711
|
-
const NAME_KEY$
|
|
14703
|
+
const START$27 = 0;
|
|
14704
|
+
const NAME_KEY$1 = "\"name\"";
|
|
14712
14705
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14713
14706
|
const parent = files.dirname(module);
|
|
14714
14707
|
if (manifests.has(files.join(parent, PACKAGE_JSON_FILE))) return Option.some(parent);
|
|
@@ -14724,7 +14717,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14724
14717
|
})));
|
|
14725
14718
|
});
|
|
14726
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.`;
|
|
14727
|
-
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));
|
|
14728
14721
|
/** @internal */
|
|
14729
14722
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14730
14723
|
const files = yield* RepositoryFiles;
|
|
@@ -14733,7 +14726,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14733
14726
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14734
14727
|
const ownedSet = new Set(owned);
|
|
14735
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));
|
|
14736
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14729
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$18 });
|
|
14737
14730
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14738
14731
|
const index = nameIndex$1(located.source);
|
|
14739
14732
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14864,7 +14857,7 @@ const LOCKFILE = "pnpm-lock.yaml";
|
|
|
14864
14857
|
const COMPILER = "typescript";
|
|
14865
14858
|
const CURRENT_MAJOR = 7;
|
|
14866
14859
|
const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
|
|
14867
|
-
const FIRST$
|
|
14860
|
+
const FIRST$12 = 1;
|
|
14868
14861
|
const legacyOf = (id) => {
|
|
14869
14862
|
const { name, version } = parseDependencyPath(id);
|
|
14870
14863
|
const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
|
|
@@ -14875,8 +14868,8 @@ const legacyOf = (id) => {
|
|
|
14875
14868
|
};
|
|
14876
14869
|
const dependentsOf$1 = (nodes) => (id) => pipe(nodes, Array$1.filter(({ dependencies }) => Array$1.contains(dependencies, id)), Array$1.map((node) => `\`${node.id}\``));
|
|
14877
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({
|
|
14878
|
-
onNone: () => FIRST$
|
|
14879
|
-
onSome: (index) => index + FIRST$
|
|
14871
|
+
onNone: () => FIRST$12,
|
|
14872
|
+
onSome: (index) => index + FIRST$12
|
|
14880
14873
|
}));
|
|
14881
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)}.`;
|
|
14882
14875
|
/** @internal */
|
|
@@ -14889,7 +14882,7 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14889
14882
|
return pipe(Option.getOrElse(nodes, () => []), Array$1.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array$1.map((legacy) => ({
|
|
14890
14883
|
file,
|
|
14891
14884
|
line: lineOf$4(source)(legacy.id),
|
|
14892
|
-
column: FIRST$
|
|
14885
|
+
column: FIRST$12,
|
|
14893
14886
|
rule: RULE$49,
|
|
14894
14887
|
message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14895
14888
|
})));
|
|
@@ -14941,15 +14934,15 @@ const OFF = [
|
|
|
14941
14934
|
"allow",
|
|
14942
14935
|
0
|
|
14943
14936
|
];
|
|
14944
|
-
const taggedError$
|
|
14937
|
+
const taggedError$10 = Schema.TaggedError;
|
|
14945
14938
|
/** @internal */
|
|
14946
|
-
var DisabledRulesConfigUnreadable = class extends taggedError$
|
|
14939
|
+
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
14947
14940
|
file: Schema.String,
|
|
14948
14941
|
reason: Schema.String
|
|
14949
14942
|
}) {};
|
|
14950
14943
|
/** @internal */
|
|
14951
14944
|
const resolvedConfig = (file) => Effect.sync(forgetBuilt).pipe(Effect.andThen(Effect.tryPromise({
|
|
14952
|
-
try: () =>
|
|
14945
|
+
try: () => resolvedViteConfig(file),
|
|
14953
14946
|
catch: (error) => DisabledRulesConfigUnreadable.make({
|
|
14954
14947
|
file,
|
|
14955
14948
|
reason: String(error)
|
|
@@ -15096,7 +15089,7 @@ const MSCH_RELAXATIONS = [
|
|
|
15096
15089
|
const severityOf = (value) => pipe(listOf$3(value), Array$1.head, Option.getOrElse(() => value));
|
|
15097
15090
|
const hasOptions = (value) => Array$1.length(listOf$3(value)) > SEVERITY_ONLY;
|
|
15098
15091
|
const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
|
|
15099
|
-
const isPresetOverride = (override) => pipe(lint
|
|
15092
|
+
const isPresetOverride = (override) => pipe(lint.overrides, Array$1.some((built) => Equal.equals(built, override)));
|
|
15100
15093
|
const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
|
|
15101
15094
|
const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
|
|
15102
15095
|
anchor: name,
|
|
@@ -15128,9 +15121,9 @@ const weakeningsOf = (expected) => (config) => [
|
|
|
15128
15121
|
];
|
|
15129
15122
|
// src/app/unused-proper-nouns.ts
|
|
15130
15123
|
const RULE$47 = "unused-proper-noun";
|
|
15131
|
-
const MARKDOWN$
|
|
15132
|
-
const START$
|
|
15133
|
-
const READ_CONCURRENCY$
|
|
15124
|
+
const MARKDOWN$5 = "**/*.md";
|
|
15125
|
+
const START$26 = 0;
|
|
15126
|
+
const READ_CONCURRENCY$17 = 16;
|
|
15134
15127
|
const properNounsOf = (textlint) => {
|
|
15135
15128
|
const filters = sectionOf$1(sectionOf$1(textlint)["filters"]);
|
|
15136
15129
|
const allowlist = sectionOf$1(filters["allowlist"]);
|
|
@@ -15139,7 +15132,7 @@ const properNounsOf = (textlint) => {
|
|
|
15139
15132
|
const checkedFiles = (textlint, listed) => {
|
|
15140
15133
|
const section = sectionOf$1(textlint);
|
|
15141
15134
|
const ignored = matcher(pipe(listOf$3(section["ignores"]), Array$1.filter(Predicate$1.isString)));
|
|
15142
|
-
const markdown = matcher([MARKDOWN$
|
|
15135
|
+
const markdown = matcher([MARKDOWN$5]);
|
|
15143
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)));
|
|
15144
15137
|
return pipe(listed, Array$1.filter((name) => markdown(name) && !ignored(name) || sources(name)));
|
|
15145
15138
|
};
|
|
@@ -15149,25 +15142,25 @@ const unusedProperNouns = Effect.fn("unusedProperNouns")(function* unusedProperN
|
|
|
15149
15142
|
if (Array$1.isReadonlyArrayEmpty(nouns)) return [];
|
|
15150
15143
|
const files = yield* RepositoryFiles;
|
|
15151
15144
|
const listed = yield* files.listedFiles(root);
|
|
15152
|
-
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 });
|
|
15153
15146
|
const found = Array$1.getSomes(texts);
|
|
15154
15147
|
const at = problemAtIndex(RULE$47)(file, source);
|
|
15155
|
-
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.`)));
|
|
15156
15149
|
});
|
|
15157
15150
|
// src/app/disabled-rules.ts
|
|
15158
15151
|
const RULE$46 = "disabled-rule";
|
|
15159
|
-
const CONFIG_FILE$
|
|
15160
|
-
const START$
|
|
15152
|
+
const CONFIG_FILE$4 = "vite.config.ts";
|
|
15153
|
+
const START$25 = 0;
|
|
15161
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;
|
|
15162
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.";
|
|
15163
15156
|
const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
|
|
15164
15157
|
const files = yield* RepositoryFiles;
|
|
15165
15158
|
const listed = yield* files.listedFiles(root);
|
|
15166
15159
|
const isExempt = matcher(exempt);
|
|
15167
|
-
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)));
|
|
15168
15161
|
});
|
|
15169
15162
|
const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
|
|
15170
|
-
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$
|
|
15163
|
+
const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$4);
|
|
15171
15164
|
const config = yield* resolvedConfig(file);
|
|
15172
15165
|
const expected = yield* expectationsIn(root);
|
|
15173
15166
|
const at = problemAtIndex(RULE$46)(file, source);
|
|
@@ -15177,14 +15170,14 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
|
|
|
15177
15170
|
source,
|
|
15178
15171
|
config
|
|
15179
15172
|
});
|
|
15180
|
-
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];
|
|
15181
15174
|
});
|
|
15182
15175
|
/** @internal */
|
|
15183
15176
|
const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
|
|
15184
15177
|
const files = yield* RepositoryFiles;
|
|
15185
|
-
const text = yield* files.readFile(files.join(root, CONFIG_FILE$
|
|
15178
|
+
const text = yield* files.readFile(files.join(root, CONFIG_FILE$4));
|
|
15186
15179
|
if (Option.isNone(text)) return [];
|
|
15187
|
-
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)];
|
|
15188
15181
|
});
|
|
15189
15182
|
// src/app/build-checks.ts
|
|
15190
15183
|
/** @internal */
|
|
@@ -15902,7 +15895,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15902
15895
|
const PATH_PREFIX = /^(?:!|\.\/)+/u;
|
|
15903
15896
|
const GLOB$1 = /[*?{[]/u;
|
|
15904
15897
|
const EXTENSION$2 = /\.[^./]+$/u;
|
|
15905
|
-
const SEPARATOR$
|
|
15898
|
+
const SEPARATOR$13 = "/";
|
|
15906
15899
|
const ROOT$2 = ".";
|
|
15907
15900
|
const namedPath = (repository, file) => (name) => {
|
|
15908
15901
|
const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
|
|
@@ -15911,12 +15904,12 @@ const namedPath = (repository, file) => (name) => {
|
|
|
15911
15904
|
return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
|
|
15912
15905
|
};
|
|
15913
15906
|
const kindOf = (repository) => (path) => {
|
|
15914
|
-
if (HashSet.has(repository.directories, path)) return SEPARATOR$
|
|
15907
|
+
if (HashSet.has(repository.directories, path)) return SEPARATOR$13;
|
|
15915
15908
|
return pipe(path, String$1.match(EXTENSION$2), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
|
|
15916
15909
|
};
|
|
15917
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)));
|
|
15918
15911
|
const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
|
|
15919
|
-
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));
|
|
15920
15913
|
const directoryLabel = (directory) => {
|
|
15921
15914
|
if (directory === ROOT$2) return "the repository root";
|
|
15922
15915
|
return directory;
|
|
@@ -15968,11 +15961,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
|
15968
15961
|
return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
|
|
15969
15962
|
};
|
|
15970
15963
|
// src/features/check-value-owners/model/repository-names.ts
|
|
15971
|
-
const SEPARATOR$
|
|
15964
|
+
const SEPARATOR$12 = "/";
|
|
15972
15965
|
const FIRST_SEGMENT = 1;
|
|
15973
15966
|
const prefixesOf = (file) => {
|
|
15974
|
-
const segments = pipe(file, String$1.split(SEPARATOR$
|
|
15975
|
-
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))));
|
|
15976
15969
|
};
|
|
15977
15970
|
const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
|
|
15978
15971
|
const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
|
|
@@ -16269,14 +16262,14 @@ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
16269
16262
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16270
16263
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16271
16264
|
const PLUGIN_ROOT$1 = "..";
|
|
16272
|
-
const READ_CONCURRENCY$
|
|
16273
|
-
const START$
|
|
16265
|
+
const READ_CONCURRENCY$16 = 16;
|
|
16266
|
+
const START$24 = 0;
|
|
16274
16267
|
const referenceOf = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
16275
16268
|
path,
|
|
16276
|
-
index: found.index ?? START$
|
|
16269
|
+
index: found.index ?? START$24
|
|
16277
16270
|
})), Option.toArray);
|
|
16278
16271
|
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf));
|
|
16279
|
-
const problemsIn$
|
|
16272
|
+
const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
16280
16273
|
const files = yield* RepositoryFiles;
|
|
16281
16274
|
const text = yield* files.readFile(file);
|
|
16282
16275
|
if (Option.isNone(text)) return [];
|
|
@@ -16312,7 +16305,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
16312
16305
|
}];
|
|
16313
16306
|
return [];
|
|
16314
16307
|
}));
|
|
16315
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$
|
|
16308
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$16 });
|
|
16316
16309
|
return Array$1.flatten(found);
|
|
16317
16310
|
});
|
|
16318
16311
|
// src/features/check-agent-settings/model/project-extensions.ts
|
|
@@ -16382,7 +16375,7 @@ const ARGS = "args";
|
|
|
16382
16375
|
const PLACEHOLDER = /[<>*{}$]/u;
|
|
16383
16376
|
const WHITESPACE$1 = /\s+/u;
|
|
16384
16377
|
const ROOT$1 = ".";
|
|
16385
|
-
const SEPARATOR$
|
|
16378
|
+
const SEPARATOR$11 = "/";
|
|
16386
16379
|
const END_OF_OPTIONS = "--";
|
|
16387
16380
|
const FLAG = "-";
|
|
16388
16381
|
const TASK_SEPARATOR$1 = "#";
|
|
@@ -16391,11 +16384,11 @@ const FILTER_FLAGS = /* @__PURE__ */ new Set(["--filter", "-F"]);
|
|
|
16391
16384
|
const FILTER_ASSIGNMENT = "--filter=";
|
|
16392
16385
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
16393
16386
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
16394
|
-
const ONE$
|
|
16395
|
-
const START$
|
|
16387
|
+
const ONE$1 = 1;
|
|
16388
|
+
const START$23 = 0;
|
|
16396
16389
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE$1), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
16397
|
-
const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$
|
|
16398
|
-
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)));
|
|
16399
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)));
|
|
16400
16393
|
const hasAny = (flags) => (tokens) => pipe(tokens, Array$1.some((token) => flags.has(token)));
|
|
16401
16394
|
const scopeOf = (tokens) => {
|
|
@@ -16429,8 +16422,8 @@ const parsed = (args) => {
|
|
|
16429
16422
|
return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
|
|
16430
16423
|
};
|
|
16431
16424
|
const ancestorsOf$1 = (file) => {
|
|
16432
|
-
const parts = pipe(String$1.split(file, SEPARATOR$
|
|
16433
|
-
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];
|
|
16434
16427
|
};
|
|
16435
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));
|
|
16436
16429
|
const packagesOf = (graph, file) => (scope) => {
|
|
@@ -16448,13 +16441,13 @@ const whereOf = (scope, file) => {
|
|
|
16448
16441
|
return `the package that holds ${file}`;
|
|
16449
16442
|
};
|
|
16450
16443
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask$1(graph, task)));
|
|
16451
|
-
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 }) => ({
|
|
16452
16445
|
file: absolute(file),
|
|
16453
|
-
...positionOf(text)(match.index ?? START$
|
|
16446
|
+
...positionOf(text)(match.index ?? START$23),
|
|
16454
16447
|
rule: RULE$39,
|
|
16455
|
-
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`
|
|
16456
16449
|
})), Option.toArray)));
|
|
16457
|
-
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)));
|
|
16458
16451
|
/** @internal */
|
|
16459
16452
|
const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
|
|
16460
16453
|
const files = yield* RepositoryFiles;
|
|
@@ -16474,12 +16467,12 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16474
16467
|
return Option.match(graph, {
|
|
16475
16468
|
onNone: () => [{
|
|
16476
16469
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
16477
|
-
line: ONE$
|
|
16478
|
-
column: ONE$
|
|
16470
|
+
line: ONE$1,
|
|
16471
|
+
column: ONE$1,
|
|
16479
16472
|
rule: RULE$39,
|
|
16480
16473
|
message: "msch could not list the tasks with `vp run --json`"
|
|
16481
16474
|
}],
|
|
16482
|
-
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$
|
|
16475
|
+
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
|
|
16483
16476
|
});
|
|
16484
16477
|
});
|
|
16485
16478
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
@@ -16527,66 +16520,6 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16527
16520
|
});
|
|
16528
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)))))));
|
|
16529
16522
|
});
|
|
16530
|
-
// src/shared/lib/section-check.ts
|
|
16531
|
-
const taggedError$10 = Schema.TaggedError;
|
|
16532
|
-
var SectionConfigUnreadable = class extends taggedError$10()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
16533
|
-
const CONFIG_FILE$4 = "vite.config.ts";
|
|
16534
|
-
const FIRST$12 = 1;
|
|
16535
|
-
const ONE$1 = 1;
|
|
16536
|
-
const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
|
|
16537
|
-
const countDiagnostics = (check, found) => Effect.forEach(found, (diagnostic) => diagnostics.pipe(Metric.withAttributes({
|
|
16538
|
-
"lint.check": check,
|
|
16539
|
-
"lint.rule": diagnostic.rule,
|
|
16540
|
-
"lint.severity": diagnostic.severity
|
|
16541
|
-
}), Metric.update(ONE$1)), {
|
|
16542
|
-
concurrency: 1,
|
|
16543
|
-
discard: true
|
|
16544
|
-
});
|
|
16545
|
-
const sectionAt = (file, pick) => Effect.gen(function* readSection() {
|
|
16546
|
-
if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
|
|
16547
|
-
const config = yield* Effect.tryPromise({
|
|
16548
|
-
try: () => resolveConfigFromFile(file),
|
|
16549
|
-
catch: () => SectionConfigUnreadable.make({ file })
|
|
16550
|
-
}).pipe(Effect.option);
|
|
16551
|
-
return pipe(config, Option.map(pick));
|
|
16552
|
-
});
|
|
16553
|
-
const checkSection = (check) => (root) => Effect.gen(function* runSection() {
|
|
16554
|
-
const files = yield* RepositoryFiles;
|
|
16555
|
-
const configFile = files.join(root, CONFIG_FILE$4);
|
|
16556
|
-
const section = yield* sectionAt(configFile, check.pick);
|
|
16557
|
-
if (Option.isNone(section)) return [];
|
|
16558
|
-
const config = section.value;
|
|
16559
|
-
const [listed, projectFiles] = yield* Effect.all([files.matchingFiles(root, check.pathspecs(config)), files.listedFiles(root)], { concurrency: "unbounded" });
|
|
16560
|
-
const linted = yield* Effect.result(check.lint({
|
|
16561
|
-
root,
|
|
16562
|
-
files: listed,
|
|
16563
|
-
projectFiles,
|
|
16564
|
-
config
|
|
16565
|
-
}));
|
|
16566
|
-
yield* Result.match(linted, {
|
|
16567
|
-
onFailure: () => Effect.void,
|
|
16568
|
-
onSuccess: (found) => countDiagnostics(check.name, found)
|
|
16569
|
-
});
|
|
16570
|
-
return Result.match(linted, {
|
|
16571
|
-
onFailure: (failure) => [problemInFile(check.rule)(configFile, failure.message)],
|
|
16572
|
-
onSuccess: (found) => pipe(found, Array$1.filter(({ severity }) => severity === "error"), Array$1.map((diagnostic) => ({
|
|
16573
|
-
file: files.join(root, diagnostic.path),
|
|
16574
|
-
line: diagnostic.line,
|
|
16575
|
-
column: diagnostic.column ?? FIRST$12,
|
|
16576
|
-
rule: check.rule,
|
|
16577
|
-
message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
|
|
16578
|
-
})))
|
|
16579
|
-
});
|
|
16580
|
-
}).pipe(Effect.withSpan(check.name));
|
|
16581
|
-
// src/features/check-markdown/model/markdown.ts
|
|
16582
|
-
const checkMarkdown = checkSection({
|
|
16583
|
-
name: "checkMarkdown",
|
|
16584
|
-
rule: "markdown",
|
|
16585
|
-
pick: y8Section,
|
|
16586
|
-
pathspecs: (config) => markdownPathspecs({ config }),
|
|
16587
|
-
lint,
|
|
16588
|
-
detail: diagnosticDetail
|
|
16589
|
-
});
|
|
16590
16523
|
// src/features/check-scripts/model/shell-scripts.ts
|
|
16591
16524
|
const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
16592
16525
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
@@ -16594,7 +16527,7 @@ const EXTENSION$1 = /\.[^./]+$/u;
|
|
|
16594
16527
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16595
16528
|
const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
16596
16529
|
const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
|
|
16597
|
-
const READ_CONCURRENCY$
|
|
16530
|
+
const READ_CONCURRENCY$15 = 64;
|
|
16598
16531
|
const RULE$37 = "shell-script";
|
|
16599
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.";
|
|
16600
16533
|
const HookSchema = Schema.Struct({
|
|
@@ -16623,7 +16556,7 @@ const pluginCommands = (hooksFile, source) => {
|
|
|
16623
16556
|
const hasExtension = (name) => EXTENSION$1.test(baseName$1(name));
|
|
16624
16557
|
const pluginSessionStarts = Effect.fn("pluginSessionStarts")(function* pluginSessionStarts(root, names) {
|
|
16625
16558
|
const files = yield* RepositoryFiles;
|
|
16626
|
-
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 });
|
|
16627
16560
|
return Array$1.flatten(commands);
|
|
16628
16561
|
});
|
|
16629
16562
|
/** @internal */
|
|
@@ -16641,27 +16574,18 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16641
16574
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16642
16575
|
};
|
|
16643
16576
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16644
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16577
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$15 });
|
|
16645
16578
|
return pipe(shell, Array$1.map((name) => problemInFile(RULE$37)(files.join(root, name), MESSAGE$9)));
|
|
16646
16579
|
});
|
|
16647
|
-
// src/features/check-structure/model/structure.ts
|
|
16648
|
-
const checkStructure = checkSection({
|
|
16649
|
-
name: "checkStructure",
|
|
16650
|
-
rule: "structure",
|
|
16651
|
-
pick: wismSection,
|
|
16652
|
-
pathspecs: (config) => wismPathspecs({ config }),
|
|
16653
|
-
lint: lint$1,
|
|
16654
|
-
detail: () => ""
|
|
16655
|
-
});
|
|
16656
16580
|
// src/features/check-vite-plus/model/command-words.ts
|
|
16657
16581
|
const CONTINUATION = /\\\n/gu;
|
|
16658
16582
|
const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
16659
|
-
const SEPARATOR$
|
|
16583
|
+
const SEPARATOR$10 = /&&|\|\||[;|\n`]|\$\(/u;
|
|
16660
16584
|
const BLANK = /\s+/u;
|
|
16661
16585
|
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
16662
16586
|
const QUOTE = "\"\"";
|
|
16663
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)));
|
|
16664
|
-
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));
|
|
16665
16589
|
// src/features/check-vite-plus/model/command-problems.ts
|
|
16666
16590
|
const PACKAGE_MANAGERS = [
|
|
16667
16591
|
"pnpm",
|
|
@@ -16718,8 +16642,8 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array$1.flatMap
|
|
|
16718
16642
|
const commandProblems$2 = (sources) => pipe(sources, Array$1.flatMap(problemsOf));
|
|
16719
16643
|
// src/shared/lib/workflow-run.ts
|
|
16720
16644
|
const RUN_KEY = "run";
|
|
16721
|
-
const START$
|
|
16722
|
-
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));
|
|
16723
16647
|
const runScriptsOf = (source) => {
|
|
16724
16648
|
const found = [];
|
|
16725
16649
|
visit$1(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -16775,8 +16699,8 @@ const AGENT_DOCS = [
|
|
|
16775
16699
|
":(glob)**/CLAUDE.md",
|
|
16776
16700
|
...EXCLUDED$5
|
|
16777
16701
|
];
|
|
16778
|
-
const READ_CONCURRENCY$
|
|
16779
|
-
const START$
|
|
16702
|
+
const READ_CONCURRENCY$14 = 16;
|
|
16703
|
+
const START$21 = 0;
|
|
16780
16704
|
const FIRST$11 = 1;
|
|
16781
16705
|
const LINE = "\n";
|
|
16782
16706
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -16784,9 +16708,9 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
|
16784
16708
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
16785
16709
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
16786
16710
|
const NO_SOURCES = [];
|
|
16787
|
-
const offsetOf$
|
|
16711
|
+
const offsetOf$1 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$21));
|
|
16788
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]) => {
|
|
16789
|
-
const offset = offsetOf$
|
|
16713
|
+
const offset = offsetOf$1(source, `"${name}"`);
|
|
16790
16714
|
return {
|
|
16791
16715
|
kind: "script",
|
|
16792
16716
|
file,
|
|
@@ -16820,7 +16744,7 @@ const commandIn = (node) => {
|
|
|
16820
16744
|
const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$4(node), Array$1.flatMap(commandsIn))];
|
|
16821
16745
|
const agentSources = (file) => (source) => pipe(decodeJson$1(source), Option.map(commandsIn), Option.getOrElse(() => []), Array$1.map((text) => {
|
|
16822
16746
|
const program = Array$1.headNonEmpty(String$1.split(text, " "));
|
|
16823
|
-
const offset = offsetOf$
|
|
16747
|
+
const offset = offsetOf$1(source, `"${program}"`);
|
|
16824
16748
|
return {
|
|
16825
16749
|
kind: "agent",
|
|
16826
16750
|
file,
|
|
@@ -16844,7 +16768,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16844
16768
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16845
16769
|
});
|
|
16846
16770
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16847
|
-
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 });
|
|
16848
16772
|
return Array$1.flatten(found);
|
|
16849
16773
|
});
|
|
16850
16774
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16856,7 +16780,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16856
16780
|
onSome: sourcesOf(file, name)
|
|
16857
16781
|
});
|
|
16858
16782
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16859
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16783
|
+
}, { concurrency: READ_CONCURRENCY$14 });
|
|
16860
16784
|
return Array$1.flatten(found);
|
|
16861
16785
|
});
|
|
16862
16786
|
/** @internal */
|
|
@@ -16937,12 +16861,52 @@ const checkVitePlus = Effect.fn("checkVitePlus")(function* checkVitePlus(root) {
|
|
|
16937
16861
|
...blocks
|
|
16938
16862
|
];
|
|
16939
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>"));
|
|
16940
16904
|
// src/features/check-workflows/model/yaml-nodes.ts
|
|
16941
16905
|
const EMPTY$2 = "";
|
|
16942
16906
|
const ByStartDescending = Order.mapInput(Order.flip(Number$1.Order), ({ start }) => start);
|
|
16943
16907
|
const NEWLINE$1 = "\n";
|
|
16944
16908
|
const FIRST$10 = 0;
|
|
16945
|
-
const NEXT$
|
|
16909
|
+
const NEXT$5 = 1;
|
|
16946
16910
|
const RANGE_END = 2;
|
|
16947
16911
|
/** @internal */
|
|
16948
16912
|
const scalarText = (node) => pipe(Option.liftPredicate(node, isScalar), Option.map(({ value }) => value), Option.filter(Predicate$1.isString), Option.getOrElse(() => EMPTY$2));
|
|
@@ -16951,12 +16915,12 @@ const fieldOf$1 = (key) => (node) => pipe(Option.liftPredicate(node, isMap), Opt
|
|
|
16951
16915
|
/** @internal */
|
|
16952
16916
|
const usesOf = fieldOf$1("uses");
|
|
16953
16917
|
/** @internal */
|
|
16954
|
-
const lineStart = ({ source, offset }) => pipe(source, String$1.slice(FIRST$10, offset), String$1.lastIndexOf(NEWLINE$1), Option.map((index) => index + NEXT$
|
|
16955
|
-
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));
|
|
16956
16920
|
/** @internal */
|
|
16957
|
-
const startOf$2 = (node) => pipe(rangeOf$
|
|
16921
|
+
const startOf$2 = (node) => pipe(rangeOf$3(node), Option.map(([start]) => start));
|
|
16958
16922
|
/** @internal */
|
|
16959
|
-
const endOf = (node) => pipe(rangeOf$
|
|
16923
|
+
const endOf = (node) => pipe(rangeOf$3(node), Option.map((range) => range[RANGE_END]));
|
|
16960
16924
|
const insertAt = (text) => ({ start, end, text: insert }) => pipe(text, String$1.slice(FIRST$10, start)) + insert + pipe(text, String$1.slice(end));
|
|
16961
16925
|
/** @internal */
|
|
16962
16926
|
const applyEdits = ({ source, edits }) => pipe(Array$1.sort(edits, ByStartDescending), Array$1.match({
|
|
@@ -16968,17 +16932,203 @@ const applyEdits = ({ source, edits }) => pipe(Array$1.sort(edits, ByStartDescen
|
|
|
16968
16932
|
}));
|
|
16969
16933
|
/** @internal */
|
|
16970
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
|
+
});
|
|
16971
17121
|
// src/features/check-workflows/model/apply-template.ts
|
|
16972
17122
|
const LAST_NEWLINE = /\n?$/u;
|
|
16973
17123
|
const NEWLINE = "\n";
|
|
16974
|
-
const rangeOf$
|
|
17124
|
+
const rangeOf$2 = (node) => pipe(Option.liftPredicate(node, isNode), Option.flatMapNullishOr(({ range }) => range));
|
|
16975
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)));
|
|
16976
17126
|
const pairSpan = (source, pair) => Option.all({
|
|
16977
|
-
start: Option.map(rangeOf$
|
|
17127
|
+
start: Option.map(rangeOf$2(pair.key), ([offset]) => lineStart({
|
|
16978
17128
|
source,
|
|
16979
17129
|
offset
|
|
16980
17130
|
})),
|
|
16981
|
-
end: Option.map(rangeOf$
|
|
17131
|
+
end: Option.map(rangeOf$2(pair.value), ([, end]) => end)
|
|
16982
17132
|
});
|
|
16983
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)));
|
|
16984
17134
|
const inputsSpan = (source, job) => pipe(fieldOfJob(source, job, "with"), Option.flatMap((pair) => pairSpan(source, pair)));
|
|
@@ -17002,76 +17152,6 @@ const fromTemplate = ({ templates, name, source }) => pipe(templates, Array$1.fi
|
|
|
17002
17152
|
onNone: () => source,
|
|
17003
17153
|
onSome: (template) => applied(template, source)
|
|
17004
17154
|
}));
|
|
17005
|
-
// src/features/check-workflows/model/shared-actions.ts
|
|
17006
|
-
const ACTIONS_REF = "1f825b932e1a85233322991acd805c65b75dc358";
|
|
17007
|
-
const REPOSITORY = `${SELF_REPOSITORY}/.github`;
|
|
17008
|
-
const actionPath = (name) => `${REPOSITORY}/shared-actions/${name}`;
|
|
17009
|
-
const workflowPath = (file) => `${REPOSITORY}/workflows/${file}`;
|
|
17010
|
-
const SETUP_ACTION = actionPath("setup");
|
|
17011
|
-
const VERIFY_ACTION = actionPath("verify");
|
|
17012
|
-
const MAINTAIN_WORKFLOW_FILE = "maintain-caches.yml";
|
|
17013
|
-
const MAINTAIN_WORKFLOW = workflowPath(MAINTAIN_WORKFLOW_FILE);
|
|
17014
|
-
const KINDS = String.raw`${REPOSITORY}/(?:shared-actions|workflows)/`;
|
|
17015
|
-
const ACTIONS_USE = new RegExp(String.raw`^${KINDS}[^@]+@`, "u");
|
|
17016
|
-
const pinned = (path) => `${path}@${ACTIONS_REF}`;
|
|
17017
|
-
const CACHE_WORKFLOW = "cache.yml";
|
|
17018
|
-
const DEFAULT_BRANCH_ONLY = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
|
|
17019
|
-
const REGISTRY_ACCESS = `\${{ secrets.TAKUMI_GUARD_TOKEN }}`;
|
|
17020
|
-
const CACHE_WORKFLOW_SOURCE = Array$1.join([
|
|
17021
|
-
"name: cache",
|
|
17022
|
-
"",
|
|
17023
|
-
"on:",
|
|
17024
|
-
" schedule:",
|
|
17025
|
-
" - cron: \"47 * * * *\"",
|
|
17026
|
-
" workflow_dispatch:",
|
|
17027
|
-
"",
|
|
17028
|
-
"permissions: {}",
|
|
17029
|
-
"",
|
|
17030
|
-
"jobs:",
|
|
17031
|
-
" caches:",
|
|
17032
|
-
` if: ${DEFAULT_BRANCH_ONLY}`,
|
|
17033
|
-
" permissions:",
|
|
17034
|
-
" actions: write",
|
|
17035
|
-
" contents: read",
|
|
17036
|
-
` uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
17037
|
-
" secrets:",
|
|
17038
|
-
` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
|
|
17039
|
-
""
|
|
17040
|
-
], "\n");
|
|
17041
|
-
const PINNED_USE = new RegExp(String.raw`(?<use>${KINDS}[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
|
|
17042
|
-
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)));
|
|
17043
|
-
const withoutRefs = (source) => pipe(source, String$1.replaceAll(PINNED_USE, "$<use>"));
|
|
17044
|
-
// src/features/check-workflows/model/cache-workflow.ts
|
|
17045
|
-
const INDENT$2 = " ";
|
|
17046
|
-
const CALL = "caches";
|
|
17047
|
-
const jobText = (jobs) => pipe([
|
|
17048
|
-
"",
|
|
17049
|
-
`${INDENT$2}${CALL}:`,
|
|
17050
|
-
`${INDENT$2}${INDENT$2}needs: [${pipe(jobs, Array$1.join(", "))}]`,
|
|
17051
|
-
`${INDENT$2}${INDENT$2}if: always() && ${DEFAULT_BRANCH_ONLY}`,
|
|
17052
|
-
`${INDENT$2}${INDENT$2}permissions:`,
|
|
17053
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}actions: write`,
|
|
17054
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}contents: read`,
|
|
17055
|
-
`${INDENT$2}${INDENT$2}uses: ${pinned(MAINTAIN_WORKFLOW)}`,
|
|
17056
|
-
`${INDENT$2}${INDENT$2}secrets:`,
|
|
17057
|
-
`${INDENT$2}${INDENT$2}${INDENT$2}TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`
|
|
17058
|
-
], Array$1.map((line) => `${line}\n`), Array$1.join(""));
|
|
17059
|
-
/** @internal */
|
|
17060
|
-
const addMaintainJob = ({ source, jobs, telemetryNeeds }) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(endOf), Option.match({
|
|
17061
|
-
onNone: () => source,
|
|
17062
|
-
onSome: (at) => applyEdits({
|
|
17063
|
-
source,
|
|
17064
|
-
edits: [{
|
|
17065
|
-
start: at,
|
|
17066
|
-
end: at,
|
|
17067
|
-
text: jobText(jobs)
|
|
17068
|
-
}, ...pipe(telemetryNeeds, Array$1.map((start) => ({
|
|
17069
|
-
start,
|
|
17070
|
-
end: start,
|
|
17071
|
-
text: `, ${CALL}`
|
|
17072
|
-
})))]
|
|
17073
|
-
})
|
|
17074
|
-
}));
|
|
17075
17155
|
// src/features/check-workflows/model/drift.ts
|
|
17076
17156
|
const SINGLE_REF = 1;
|
|
17077
17157
|
/** @internal */
|
|
@@ -17107,7 +17187,12 @@ const VP_COMMAND = /(?:^|[\s;&|(])vpx?\s/u;
|
|
|
17107
17187
|
const SETUP_INPUTS = [
|
|
17108
17188
|
["cache", "\"true\""],
|
|
17109
17189
|
["save", "\"false\""],
|
|
17110
|
-
["session-path", "\"true\""]
|
|
17190
|
+
["session-path", "\"true\""],
|
|
17191
|
+
["native", "\"false\""],
|
|
17192
|
+
["tools", "\"\""],
|
|
17193
|
+
["rust-cache", "\"false\""],
|
|
17194
|
+
["sccache", "\"false\""],
|
|
17195
|
+
["telemetry", "\"false\""]
|
|
17111
17196
|
];
|
|
17112
17197
|
const INDENT$1 = " ";
|
|
17113
17198
|
const FIRST$9 = 0;
|
|
@@ -17117,19 +17202,20 @@ const isManaged = (step) => pipe(usesOf(step), String$1.startsWith(SETUP_VP_USE)
|
|
|
17117
17202
|
const localAction = (step) => pipe(LOCAL_USE.exec(usesOf(step)), Option.fromNullishOr, Option.flatMapNullishOr(({ groups }) => groups), Option.flatMap(Record.get("name")));
|
|
17118
17203
|
const isSetup = (localSetups) => (step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`)) || pipe(localAction(step), Option.exists((name) => localSetups.has(name)));
|
|
17119
17204
|
const runsVp = (step) => pipe(usesOf(step), String$1.startsWith(`${VERIFY_ACTION}@`)) || VP_COMMAND.test(runOf(step));
|
|
17120
|
-
const
|
|
17205
|
+
const NOTHING_GIVEN = () => Option.none();
|
|
17206
|
+
const valueOf$1 = (inputs, given, [name, fallback]) => {
|
|
17121
17207
|
if (pipe(inputs, Array$1.contains(name))) return `\${{ inputs.${name} }}`;
|
|
17122
|
-
return fallback;
|
|
17208
|
+
return Option.getOrElse(given(name), () => fallback);
|
|
17123
17209
|
};
|
|
17124
|
-
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)}`))];
|
|
17125
17211
|
const prefixOf = (source, step) => pipe(startOf$2(step), Option.map((start) => pipe(source, String$1.slice(lineStart({
|
|
17126
17212
|
source,
|
|
17127
17213
|
offset: start
|
|
17128
17214
|
}), start))), Option.getOrElse(() => ""));
|
|
17129
|
-
const setupText = ({ source, inputs }, sample) => {
|
|
17215
|
+
const setupText = ({ source, inputs }, sample, given = NOTHING_GIVEN) => {
|
|
17130
17216
|
const prefix = prefixOf(source, sample);
|
|
17131
17217
|
const pad = pipe(" ", String$1.repeat(prefix.length));
|
|
17132
|
-
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(""));
|
|
17133
17219
|
};
|
|
17134
17220
|
const removal = (source, step) => Option.zipWith(startOf$2(step), endOf(step), (start, end) => ({
|
|
17135
17221
|
start: lineStart({
|
|
@@ -17161,20 +17247,30 @@ const managedEdits = (rewrite, items) => {
|
|
|
17161
17247
|
return removal(rewrite.source, step);
|
|
17162
17248
|
}), Array$1.getSomes);
|
|
17163
17249
|
};
|
|
17164
|
-
|
|
17165
|
-
const
|
|
17166
|
-
|
|
17167
|
-
|
|
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) => {
|
|
17168
17257
|
if (pipe(items, Array$1.some(isManaged))) return managedEdits(rewrite, items);
|
|
17169
17258
|
const needsSetup = pipe(items, Array$1.some(runsVp));
|
|
17170
17259
|
const hasSetup = pipe(items, Array$1.some(isSetup(rewrite.localSetups)));
|
|
17171
17260
|
if (needsSetup && !hasSetup) return pipe(insertion(rewrite, items), Option.toArray);
|
|
17172
17261
|
return [];
|
|
17173
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
|
+
};
|
|
17174
17272
|
// src/features/check-workflows/model/rewrite-document.ts
|
|
17175
17273
|
const AFTER_REF = /@.*$/u;
|
|
17176
|
-
const CLOSING_BRACKET = 1;
|
|
17177
|
-
const TELEMETRY_USE = /\/ci-telemetry@/u;
|
|
17178
17274
|
const pinEdits = (document, source) => {
|
|
17179
17275
|
const found = [];
|
|
17180
17276
|
visit$1(document, { Pair: (_key, pair) => {
|
|
@@ -17196,8 +17292,8 @@ const actionSteps = (document) => {
|
|
|
17196
17292
|
const allSteps = (document) => pipe(jobsOf(document), Array$1.flatMap(stepsOf), Array$1.appendAll(actionSteps(document)));
|
|
17197
17293
|
const includesSetup = (document) => pipe(allSteps(document), Array$1.some((step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`))));
|
|
17198
17294
|
const callsMaintain = (document) => pipe(jobsOf(document), Array$1.some((job) => pipe(usesOf(job), String$1.startsWith(`${MAINTAIN_WORKFLOW}@`))));
|
|
17199
|
-
const
|
|
17200
|
-
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);
|
|
17201
17297
|
const inputNames = (document) => pipe(tableAt(document, ["inputs"]), Array$1.map(([name]) => name));
|
|
17202
17298
|
/** @internal */
|
|
17203
17299
|
const rewriteDocument = ({ source, localSetups }) => {
|
|
@@ -17208,7 +17304,7 @@ const rewriteDocument = ({ source, localSetups }) => {
|
|
|
17208
17304
|
source,
|
|
17209
17305
|
localSetups,
|
|
17210
17306
|
inputs
|
|
17211
|
-
})), 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)));
|
|
17212
17308
|
const rewritten = applyEdits({
|
|
17213
17309
|
source,
|
|
17214
17310
|
edits
|
|
@@ -17218,8 +17314,7 @@ const rewriteDocument = ({ source, localSetups }) => {
|
|
|
17218
17314
|
source: rewritten,
|
|
17219
17315
|
includesSetup: includesSetup(result),
|
|
17220
17316
|
callsMaintain: callsMaintain(result),
|
|
17221
|
-
|
|
17222
|
-
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))
|
|
17223
17318
|
};
|
|
17224
17319
|
};
|
|
17225
17320
|
// src/features/check-workflows/model/template-workflows.ts
|
|
@@ -17265,16 +17360,51 @@ const UPDATE_BRANCHES_SOURCE = Array$1.join([
|
|
|
17265
17360
|
` uses: ${pinned(workflowPath("update-branches.yml"))}`,
|
|
17266
17361
|
""
|
|
17267
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");
|
|
17268
17390
|
/** @internal */
|
|
17269
|
-
const TEMPLATE_WORKFLOWS = [
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
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
|
+
];
|
|
17278
17408
|
// src/features/check-workflows/model/sync-ci.ts
|
|
17279
17409
|
const WORKFLOWS = ".github/workflows";
|
|
17280
17410
|
const ACTIONS = ".github/actions";
|
|
@@ -17323,31 +17453,13 @@ const rewriteAll = (sources, localSetups) => pipe(sources, Array$1.map((found) =
|
|
|
17323
17453
|
localSetups
|
|
17324
17454
|
})
|
|
17325
17455
|
})));
|
|
17326
|
-
const
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
setup: CACHE_WORKFLOW_SOURCE,
|
|
17334
|
-
source: CACHE_WORKFLOW_SOURCE
|
|
17335
|
-
}),
|
|
17336
|
-
onSome: ({ file, rewritten, source }) => {
|
|
17337
|
-
const maintained = addMaintainJob({
|
|
17338
|
-
source: rewritten.source,
|
|
17339
|
-
jobs: rewritten.jobs,
|
|
17340
|
-
telemetryNeeds: rewritten.telemetryNeeds
|
|
17341
|
-
});
|
|
17342
|
-
return {
|
|
17343
|
-
file,
|
|
17344
|
-
previous: source,
|
|
17345
|
-
setup: maintained,
|
|
17346
|
-
source: maintained
|
|
17347
|
-
};
|
|
17348
|
-
}
|
|
17349
|
-
}))];
|
|
17350
|
-
});
|
|
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
|
+
})));
|
|
17351
17463
|
const write = (root, { file, source }) => Effect.gen(function* writeChanged() {
|
|
17352
17464
|
const fs = yield* FileSystem.FileSystem;
|
|
17353
17465
|
const path = yield* Path.Path;
|
|
@@ -17366,25 +17478,26 @@ const isHost = (root) => Effect.gen(function* findMaintainWorkflow() {
|
|
|
17366
17478
|
});
|
|
17367
17479
|
const planRewrites = (root, workflows, actions) => Effect.gen(function* planChanges() {
|
|
17368
17480
|
const localSetups = settle(actions, /* @__PURE__ */ new Set());
|
|
17369
|
-
const
|
|
17481
|
+
const pinnedWorkflows = rewriteAll(workflows, localSetups);
|
|
17370
17482
|
const rewrittenActions = rewriteAll(actions, localSetups);
|
|
17371
|
-
const usesSetup = pipe([...rewrittenActions, ...
|
|
17372
|
-
const
|
|
17483
|
+
const usesSetup = pipe([...rewrittenActions, ...pinnedWorkflows], Array$1.some(({ rewritten }) => rewritten.includesSetup));
|
|
17484
|
+
const rewrittenWorkflows = finishedOnce(pinnedWorkflows);
|
|
17485
|
+
const created = yield* addedFiles({
|
|
17373
17486
|
root,
|
|
17374
17487
|
workflows: rewrittenWorkflows,
|
|
17375
17488
|
usesSetup
|
|
17376
|
-
});
|
|
17489
|
+
}, localSetups);
|
|
17377
17490
|
const templates = pipe(TEMPLATE_WORKFLOWS, Array$1.filter(() => usesSetup));
|
|
17378
17491
|
return {
|
|
17379
17492
|
changes: pipe([...rewrittenActions, ...rewrittenWorkflows], Array$1.map(({ file, name, rewritten, source }) => ({
|
|
17380
17493
|
file,
|
|
17381
17494
|
previous: source,
|
|
17382
17495
|
setup: rewritten.source,
|
|
17383
|
-
source: fromTemplate({
|
|
17496
|
+
source: withFinishJob(fromTemplate({
|
|
17384
17497
|
templates,
|
|
17385
17498
|
name,
|
|
17386
17499
|
source: rewritten.source
|
|
17387
|
-
})
|
|
17500
|
+
}))
|
|
17388
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)),
|
|
17389
17502
|
sources: [...actions, ...workflows]
|
|
17390
17503
|
};
|
|
@@ -17406,7 +17519,7 @@ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effe
|
|
|
17406
17519
|
const SETUP_RULE$1 = "ci-setup";
|
|
17407
17520
|
const REF_RULE = "ci-template-ref";
|
|
17408
17521
|
const WORKFLOW_RULE = "ci-template-workflow";
|
|
17409
|
-
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.";
|
|
17410
17523
|
const REF_MESSAGE = "pins a different commit of the template than the other workflows. Run `msch ci` to pin them all to one.";
|
|
17411
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.";
|
|
17412
17525
|
const setupProblem$1 = problemInFile(SETUP_RULE$1);
|
|
@@ -17422,7 +17535,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
17422
17535
|
const RULE$34 = "optional-input";
|
|
17423
17536
|
const ACTION_FILE = /^\.github\/(?:.+\/)?action\.ya?ml$/u;
|
|
17424
17537
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
17425
|
-
const START$
|
|
17538
|
+
const START$20 = 0;
|
|
17426
17539
|
const pairsAt = (document, path) => pipe(Option.liftPredicate(document.getIn(path, true), isMap), Option.map(({ items }) => items), Option.getOrElse(() => []));
|
|
17427
17540
|
const declaredIn$2 = (name, document) => {
|
|
17428
17541
|
if (ACTION_FILE.test(name)) return pipe(pairsAt(document, ["inputs"]), Array$1.map((pair) => ({
|
|
@@ -17446,9 +17559,9 @@ const declaredIn$2 = (name, document) => {
|
|
|
17446
17559
|
})))];
|
|
17447
17560
|
};
|
|
17448
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));
|
|
17449
|
-
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));
|
|
17450
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.`;
|
|
17451
|
-
const problemsIn$
|
|
17564
|
+
const problemsIn$11 = (file, name, source) => {
|
|
17452
17565
|
const at = problemAtIndex(RULE$34)(file, source);
|
|
17453
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))));
|
|
17454
17567
|
};
|
|
@@ -17456,7 +17569,7 @@ const problemsIn$12 = (file, name, source) => {
|
|
|
17456
17569
|
const checkOptionalInputs = Effect.fn("checkOptionalInputs")(function* checkOptionalInputs(root) {
|
|
17457
17570
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
17458
17571
|
const names = pipe(listed, Array$1.filter((name) => ACTION_FILE.test(name) || WORKFLOW_FILE.test(name)));
|
|
17459
|
-
return yield* problemsInFiles(root, names, ({ file, name, source }) => problemsIn$
|
|
17572
|
+
return yield* problemsInFiles(root, names, ({ file, name, source }) => problemsIn$11(file, name, source));
|
|
17460
17573
|
});
|
|
17461
17574
|
// src/features/check-workflows/model/installed-version.ts
|
|
17462
17575
|
const RANGE_PREFIX = /^[\^~]/u;
|
|
@@ -17485,15 +17598,6 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
17485
17598
|
message: MESSAGE$7
|
|
17486
17599
|
})));
|
|
17487
17600
|
});
|
|
17488
|
-
// src/features/check-workflows/model/workflow-lint.ts
|
|
17489
|
-
const checkWorkflowLint = checkSection({
|
|
17490
|
-
name: "checkWorkflowLint",
|
|
17491
|
-
rule: "workflow-lint",
|
|
17492
|
-
pick: fu4Section,
|
|
17493
|
-
pathspecs: (config) => workflowPathspecs({ config }),
|
|
17494
|
-
lint: lint$2,
|
|
17495
|
-
detail: () => ""
|
|
17496
|
-
});
|
|
17497
17601
|
// src/app/tool-use.ts
|
|
17498
17602
|
/** @internal */
|
|
17499
17603
|
const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
@@ -17508,11 +17612,8 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
|
|
|
17508
17612
|
checkReleasePlease(root),
|
|
17509
17613
|
checkRestrictedRules(root),
|
|
17510
17614
|
checkTypeExemptions(root),
|
|
17511
|
-
checkMarkdown(root),
|
|
17512
17615
|
checkLegacyWeb(root),
|
|
17513
|
-
checkDocumentedCommands(root)
|
|
17514
|
-
checkStructure(root),
|
|
17515
|
-
checkWorkflowLint(root)
|
|
17616
|
+
checkDocumentedCommands(root)
|
|
17516
17617
|
], { concurrency: "unbounded" });
|
|
17517
17618
|
return Array$1.flatten(found);
|
|
17518
17619
|
});
|
|
@@ -17641,7 +17742,7 @@ const COMMENT_NODES = [
|
|
|
17641
17742
|
"block_comment",
|
|
17642
17743
|
"multiline_comment"
|
|
17643
17744
|
];
|
|
17644
|
-
const START$
|
|
17745
|
+
const START$19 = 0;
|
|
17645
17746
|
const NEXT$1 = 1;
|
|
17646
17747
|
const NONE$3 = [];
|
|
17647
17748
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -17691,7 +17792,7 @@ const markupComment = (source) => (node) => {
|
|
|
17691
17792
|
}];
|
|
17692
17793
|
};
|
|
17693
17794
|
const textComments = (grammars, grammar) => (text) => {
|
|
17694
|
-
const shift = shifted(text.startIndex ?? START$
|
|
17795
|
+
const shift = shifted(text.startIndex ?? START$19);
|
|
17695
17796
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
17696
17797
|
};
|
|
17697
17798
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -17775,8 +17876,8 @@ const RULE$32 = "comment";
|
|
|
17775
17876
|
const SUPPRESSION_RULE = "suppression";
|
|
17776
17877
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
17777
17878
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
17778
|
-
const READ_CONCURRENCY$
|
|
17779
|
-
const START$
|
|
17879
|
+
const READ_CONCURRENCY$13 = 64;
|
|
17880
|
+
const START$18 = 0;
|
|
17780
17881
|
const SHEBANG = "#!";
|
|
17781
17882
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
17782
17883
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
@@ -17791,11 +17892,11 @@ const taggedError$8 = Schema.TaggedError;
|
|
|
17791
17892
|
var CommentConfigUnreadable = class extends taggedError$8()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
17792
17893
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
17793
17894
|
const lineBefore = (source, index) => {
|
|
17794
|
-
const lines = pipe(source, String$1.slice(START$
|
|
17895
|
+
const lines = pipe(source, String$1.slice(START$18, index), String$1.split("\n"));
|
|
17795
17896
|
return Option.getOrElse(Array$1.last(lines), () => "");
|
|
17796
17897
|
};
|
|
17797
17898
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
17798
|
-
const isShebang = ({ index, text }) => index === START$
|
|
17899
|
+
const isShebang = ({ index, text }) => index === START$18 && String$1.startsWith(SHEBANG)(text);
|
|
17799
17900
|
const isSuppression = (comment) => SUPPRESSION.test(comment.text);
|
|
17800
17901
|
const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
|
|
17801
17902
|
const NOTHING = {
|
|
@@ -17813,7 +17914,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
17813
17914
|
const file = files.join(root, CONFIG_FILE$3);
|
|
17814
17915
|
if (!(yield* files.exists(file))) return NO_SETTINGS;
|
|
17815
17916
|
const config = yield* Effect.tryPromise({
|
|
17816
|
-
try: () =>
|
|
17917
|
+
try: () => resolvedViteConfig(file),
|
|
17817
17918
|
catch: () => CommentConfigUnreadable.make({ file })
|
|
17818
17919
|
}).pipe(Effect.option);
|
|
17819
17920
|
return pipe(config, Option.flatMap(Schema.decodeUnknownOption(RootConfig)), Option.match({
|
|
@@ -17823,7 +17924,7 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
|
17823
17924
|
});
|
|
17824
17925
|
const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
|
|
17825
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));
|
|
17826
|
-
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));
|
|
17827
17928
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
17828
17929
|
const files = yield* RepositoryFiles;
|
|
17829
17930
|
const file = files.join(root, CONFIG_FILE$3);
|
|
@@ -17840,7 +17941,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
17840
17941
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
17841
17942
|
used: usedAllowances(allowances, found)
|
|
17842
17943
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
17843
|
-
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}`)],
|
|
17844
17945
|
used: []
|
|
17845
17946
|
})))
|
|
17846
17947
|
});
|
|
@@ -17859,7 +17960,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
17859
17960
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
17860
17961
|
onNone: () => Effect.succeed(NOTHING),
|
|
17861
17962
|
onSome: (source) => scan(entry, source)
|
|
17862
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17963
|
+
}))), { concurrency: READ_CONCURRENCY$13 });
|
|
17863
17964
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
17864
17965
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
17865
17966
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -17964,7 +18065,7 @@ const ROOT_DIRECTORY$2 = ".";
|
|
|
17964
18065
|
const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
|
|
17965
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.";
|
|
17966
18067
|
const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((protocol) => String$1.startsWith(protocol)(specifier)));
|
|
17967
|
-
const problemsIn$
|
|
18068
|
+
const problemsIn$10 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
17968
18069
|
file: entry.file,
|
|
17969
18070
|
...positionOf(source)(offsetIn(source)(manifestPattern(found))),
|
|
17970
18071
|
rule: RULE$31,
|
|
@@ -17982,7 +18083,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17982
18083
|
file: files.join(root, name)
|
|
17983
18084
|
};
|
|
17984
18085
|
}));
|
|
17985
|
-
return yield* scanText(listed, problemsIn$
|
|
18086
|
+
return yield* scanText(listed, problemsIn$10);
|
|
17986
18087
|
});
|
|
17987
18088
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
17988
18089
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
@@ -18025,7 +18126,7 @@ const ENTRY_RULE = "unlocked-skill";
|
|
|
18025
18126
|
const VISIBLE_RULE = "skill-source-visible";
|
|
18026
18127
|
const CONFIG_FILE$2 = "vite.config.ts";
|
|
18027
18128
|
const SOURCE_SEPARATOR = "/";
|
|
18028
|
-
const START$
|
|
18129
|
+
const START$17 = 0;
|
|
18029
18130
|
const LOCAL_PREFIX = "./";
|
|
18030
18131
|
const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
|
|
18031
18132
|
const Source = Schema.Struct({
|
|
@@ -18038,7 +18139,7 @@ const taggedError$7 = Schema.TaggedError;
|
|
|
18038
18139
|
var SkillsConfigUnreadable = class extends taggedError$7()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
18039
18140
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
18040
18141
|
file,
|
|
18041
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
18142
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$17))),
|
|
18042
18143
|
rule,
|
|
18043
18144
|
message
|
|
18044
18145
|
});
|
|
@@ -18048,7 +18149,7 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
|
|
|
18048
18149
|
const text = yield* files.readFile(file);
|
|
18049
18150
|
if (Option.isNone(text)) return Option.none();
|
|
18050
18151
|
const config = yield* Effect.tryPromise({
|
|
18051
|
-
try: () =>
|
|
18152
|
+
try: () => resolvedViteConfig(file),
|
|
18052
18153
|
catch: () => SkillsConfigUnreadable.make({ file })
|
|
18053
18154
|
}).pipe(Effect.option);
|
|
18054
18155
|
return pipe(config, Option.flatMap(decodeSkills), Option.map(({ skills }) => ({
|
|
@@ -18099,7 +18200,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
|
|
|
18099
18200
|
const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
|
|
18100
18201
|
return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
|
|
18101
18202
|
}, Effect.scoped);
|
|
18102
|
-
const problemsIn$
|
|
18203
|
+
const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
|
|
18103
18204
|
const files = yield* RepositoryFiles;
|
|
18104
18205
|
const directory = files.join(root, project.directory);
|
|
18105
18206
|
const manifest = files.join(directory, PACKAGE_JSON_FILE);
|
|
@@ -18111,7 +18212,7 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, project
|
|
|
18111
18212
|
/** @internal */
|
|
18112
18213
|
const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
|
|
18113
18214
|
const projects = yield* publishedProjects(root);
|
|
18114
|
-
const problems = yield* Effect.forEach(projects, (project) => problemsIn$
|
|
18215
|
+
const problems = yield* Effect.forEach(projects, (project) => problemsIn$9(root, project), { concurrency: 1 });
|
|
18115
18216
|
return Array$1.flatten(problems);
|
|
18116
18217
|
});
|
|
18117
18218
|
// src/features/check-skills/model/skill-files.ts
|
|
@@ -18119,108 +18220,23 @@ const RULE$28 = "skill-file";
|
|
|
18119
18220
|
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
18120
18221
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
18121
18222
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
18122
|
-
const MARKDOWN$5 = ".md";
|
|
18123
18223
|
const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
|
|
18124
|
-
const HEADING = /^# (?<title>.+)$/mu;
|
|
18125
|
-
const NAME_KEY$1 = /^name:/mu;
|
|
18126
|
-
const LICENSE_KEY = /^license:/mu;
|
|
18127
|
-
const CODE = /```[\s\S]*?```|`[^`\n]*`/gu;
|
|
18128
|
-
const LINK = /\]\((?<target>[^)\s]+)\)/gu;
|
|
18129
|
-
const EXTERNAL = /^(?:[a-z][a-z0-9+.-]*:|#|\/)|[<>{}]/iu;
|
|
18130
|
-
const FRAGMENT = /#.*$/u;
|
|
18131
|
-
const SEPARATOR$10 = "/";
|
|
18132
|
-
const START$17 = 0;
|
|
18133
18224
|
const FIRST$7 = 1;
|
|
18134
|
-
const
|
|
18135
|
-
const Frontmatter = Schema.Struct({
|
|
18136
|
-
name: Schema.optional(Schema.String),
|
|
18137
|
-
license: Schema.optional(Schema.Unknown)
|
|
18138
|
-
});
|
|
18139
|
-
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
18140
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$17));
|
|
18141
|
-
const frontmatterOf = (source) => pipe(splitFrontmatter(source), Option.flatMap(({ fields }) => decodeFrontmatter(fields)));
|
|
18142
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$17].length), Option.getOrElse(() => START$17));
|
|
18143
|
-
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
18144
|
-
const nameProblems = ({ source, directory }, name, folder) => {
|
|
18145
|
-
const bodyStart = bodyStartOf(source);
|
|
18146
|
-
const body = String$1.slice(bodyStart)(source);
|
|
18147
|
-
const heading = groupOf("title")(HEADING.exec(body));
|
|
18148
|
-
return [...pipe(Option.liftPredicate(name, (found) => found !== folder), Option.map((found) => ({
|
|
18149
|
-
index: offsetOf$1(source, NAME_KEY$1),
|
|
18150
|
-
message: `The frontmatter name "${found}" differs from the directory ${directory}. Give the skill the name of its directory.`
|
|
18151
|
-
})), Option.toArray), ...pipe(Option.liftPredicate(heading, (found) => !Option.contains(found, name)), Option.map((found) => ({
|
|
18152
|
-
index: bodyStart + offsetOf$1(body, HEADING),
|
|
18153
|
-
message: `The first heading is ${headingText(found)}. Start the body with "# ${name}", the frontmatter name.`
|
|
18154
|
-
})), Option.toArray)];
|
|
18155
|
-
};
|
|
18156
|
-
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(() => ({
|
|
18157
|
-
index: offsetOf$1(skill.source, LICENSE_KEY),
|
|
18158
|
-
message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
|
|
18159
|
-
})), Option.toArray)]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
18160
|
-
file: skill.file,
|
|
18161
|
-
...positionOf(skill.source)(index),
|
|
18162
|
-
rule: RULE$28,
|
|
18163
|
-
message
|
|
18164
|
-
})));
|
|
18165
|
-
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) => ({
|
|
18166
|
-
target,
|
|
18167
|
-
index: found.index ?? START$17
|
|
18168
|
-
})), Option.toArray);
|
|
18169
|
-
const rangeOf$2 = (found) => {
|
|
18170
|
-
const start = found.index ?? START$17;
|
|
18171
|
-
return [start, start + found[START$17].length];
|
|
18172
|
-
};
|
|
18173
|
-
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
|
|
18174
|
-
const linksIn = (source) => {
|
|
18175
|
-
const code = pipe(Array$1.fromIterable(String$1.matchAll(CODE)(source)), Array$1.map(rangeOf$2));
|
|
18176
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(LINK)(source)), Array$1.flatMap(linkOf), Array$1.filter(isOutside(code)));
|
|
18177
|
-
};
|
|
18178
|
-
const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
18179
|
-
const files = yield* RepositoryFiles;
|
|
18180
|
-
const text = yield* files.readFile(file);
|
|
18181
|
-
if (Option.isNone(text)) return [];
|
|
18182
|
-
const source = text.value;
|
|
18183
|
-
const directory = files.dirname(file);
|
|
18184
|
-
const isMissing = ({ target }) => files.exists(files.join(directory, target)).pipe(Effect.map((exists) => !exists));
|
|
18185
|
-
const missing = yield* Effect.filter(linksIn(source), isMissing);
|
|
18186
|
-
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
18187
|
-
file,
|
|
18188
|
-
...positionOf(source)(index),
|
|
18189
|
-
rule: RULE$28,
|
|
18190
|
-
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
18191
|
-
})));
|
|
18192
|
-
});
|
|
18193
|
-
const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
|
|
18194
|
-
const files = yield* RepositoryFiles;
|
|
18195
|
-
const file = files.join(root, name);
|
|
18225
|
+
const licensesIn = (root, listed, files) => (name) => {
|
|
18196
18226
|
const directory = files.dirname(name);
|
|
18197
|
-
|
|
18198
|
-
const text = yield* files.readFile(file);
|
|
18199
|
-
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
18200
|
-
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$13 });
|
|
18201
|
-
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) => ({
|
|
18202
18228
|
file: files.join(root, entry),
|
|
18203
18229
|
line: FIRST$7,
|
|
18204
18230
|
column: FIRST$7,
|
|
18205
18231
|
rule: RULE$28,
|
|
18206
18232
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
18207
18233
|
})));
|
|
18208
|
-
|
|
18209
|
-
...pipe(text, Option.map((source) => frontmatterProblems({
|
|
18210
|
-
file,
|
|
18211
|
-
directory,
|
|
18212
|
-
source
|
|
18213
|
-
}, files.basename(directory))), Option.getOrElse(() => [])),
|
|
18214
|
-
...licenses,
|
|
18215
|
-
...Array$1.flatten(links)
|
|
18216
|
-
];
|
|
18217
|
-
});
|
|
18234
|
+
};
|
|
18218
18235
|
/** @internal */
|
|
18219
18236
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
18220
|
-
const
|
|
18221
|
-
const
|
|
18222
|
-
|
|
18223
|
-
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)));
|
|
18224
18240
|
});
|
|
18225
18241
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
18226
18242
|
const MANIFEST_SECTIONS = [
|
|
@@ -19139,7 +19155,7 @@ const problemFor = (file, source) => ({
|
|
|
19139
19155
|
});
|
|
19140
19156
|
const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
|
|
19141
19157
|
const config = yield* Effect.tryPromise({
|
|
19142
|
-
try: () =>
|
|
19158
|
+
try: () => resolvedViteConfig(configFile),
|
|
19143
19159
|
catch: () => PackConfigUnreadable.make({ file: configFile })
|
|
19144
19160
|
}).pipe(Effect.option);
|
|
19145
19161
|
return Option.exists(config, runsStrictPublint);
|
|
@@ -20720,7 +20736,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
20720
20736
|
const prefix = `${directory}${SEPARATOR$3}`;
|
|
20721
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);
|
|
20722
20738
|
if (Array$1.isReadonlyArrayEmpty(bins)) return [];
|
|
20723
|
-
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)));
|
|
20724
20740
|
const uncalled = uncalledIn(root, join, corpus);
|
|
20725
20741
|
const commands = uncalled(sources, {
|
|
20726
20742
|
rule: COMMAND_RULE,
|
|
@@ -21342,15 +21358,12 @@ const agents = Effect.fn("agents")(function* investigating(input) {
|
|
|
21342
21358
|
const problems = sortProblems(found);
|
|
21343
21359
|
yield* reportProblems(root, {
|
|
21344
21360
|
problems,
|
|
21345
|
-
json:
|
|
21361
|
+
json: false
|
|
21346
21362
|
});
|
|
21347
21363
|
return yield* failWhenAny(problems.length);
|
|
21348
21364
|
});
|
|
21349
21365
|
/** @internal */
|
|
21350
|
-
const agentsCommand = Command.make("agents", {
|
|
21351
|
-
stateDirectory: Argument.String("state-directory").pipe(Argument.withDescription("The directory that keeps each finished step, so a rerun resumes from it")),
|
|
21352
|
-
json: jsonFlag
|
|
21353
|
-
}, 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"));
|
|
21354
21367
|
// src/features/run-changed/model/batches.ts
|
|
21355
21368
|
const ARITY$1 = 2;
|
|
21356
21369
|
const NO_BATCHES = [];
|
|
@@ -21586,27 +21599,15 @@ const byPlace = Order.Struct({
|
|
|
21586
21599
|
file: Order.String,
|
|
21587
21600
|
line: Order.Number
|
|
21588
21601
|
});
|
|
21589
|
-
const textOf = (
|
|
21590
|
-
if (json) return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);
|
|
21591
|
-
return Effect.succeed(pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join("")));
|
|
21592
|
-
};
|
|
21602
|
+
const textOf = (describe) => (rows) => pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join(""));
|
|
21593
21603
|
/** @internal */
|
|
21594
|
-
const lookupReport = ({
|
|
21604
|
+
const lookupReport = ({ rows, describe }) => Effect.gen(function* report() {
|
|
21595
21605
|
const found = yield* rows((yield* RepositoryFiles).resolve("."));
|
|
21596
|
-
|
|
21597
|
-
yield* writeStdout(text);
|
|
21606
|
+
yield* writeStdout(textOf(describe)(Array$1.sort(found, byPlace)));
|
|
21598
21607
|
if (found.length > NONE_FOUND) return yield* ProblemsFound.make({ count: found.length });
|
|
21599
21608
|
return NONE_FOUND;
|
|
21600
21609
|
});
|
|
21601
21610
|
// src/app/exits-command.ts
|
|
21602
|
-
const MetRow = Schema.Struct({
|
|
21603
|
-
file: Schema.String,
|
|
21604
|
-
line: Schema.Finite,
|
|
21605
|
-
section: Schema.String,
|
|
21606
|
-
key: Schema.String,
|
|
21607
|
-
condition: Schema.String,
|
|
21608
|
-
outcome: Schema.Literals(["met", "unchecked"])
|
|
21609
|
-
});
|
|
21610
21611
|
const VERDICTS$2 = {
|
|
21611
21612
|
met: "is met. Remove the deviation and run verify.",
|
|
21612
21613
|
unchecked: "could not be checked. Check it by hand or rerun where the lookup is reachable."
|
|
@@ -21625,11 +21626,10 @@ const rowsIn = Effect.fn("rowsIn")(function* rowsIn(root) {
|
|
|
21625
21626
|
})));
|
|
21626
21627
|
});
|
|
21627
21628
|
/** @internal */
|
|
21628
|
-
const exitsCommand = Command.make("exits", {
|
|
21629
|
-
row: MetRow,
|
|
21629
|
+
const exitsCommand = Command.make("exits", {}, () => lookupReport({
|
|
21630
21630
|
rows: rowsIn,
|
|
21631
21631
|
describe: describeRow$3
|
|
21632
|
-
})
|
|
21632
|
+
})).pipe(Command.withDescription("Reports upstream deviations whose exit condition is met"));
|
|
21633
21633
|
// src/features/judge-documents/model/agent-prompt.ts
|
|
21634
21634
|
/** @internal */
|
|
21635
21635
|
const AgentAnswer = Schema.Struct({
|
|
@@ -21762,8 +21762,7 @@ const judgeDecision = ({ rule, target: { text } }) => Effect.sync(() => {
|
|
|
21762
21762
|
},
|
|
21763
21763
|
text,
|
|
21764
21764
|
model: DECISION_MODEL,
|
|
21765
|
-
timeoutMs: DECISION_TIMEOUT_MS
|
|
21766
|
-
env: {}
|
|
21765
|
+
timeoutMs: DECISION_TIMEOUT_MS
|
|
21767
21766
|
});
|
|
21768
21767
|
if (judged.status === "violation") return {
|
|
21769
21768
|
status: "violation",
|
|
@@ -21973,15 +21972,12 @@ const judge = Effect.fn("judge")(function* judge(input) {
|
|
|
21973
21972
|
const problems = sortProblems(found);
|
|
21974
21973
|
yield* reportProblems(root, {
|
|
21975
21974
|
problems,
|
|
21976
|
-
json:
|
|
21975
|
+
json: false
|
|
21977
21976
|
});
|
|
21978
21977
|
return yield* failWhenAny(problems.length);
|
|
21979
21978
|
});
|
|
21980
21979
|
/** @internal */
|
|
21981
|
-
const judgeCommand = Command.make("judge", {
|
|
21982
|
-
cacheDirectory: Argument.String("cache-directory").pipe(Argument.withDescription("The directory that keeps the verdicts between runs")),
|
|
21983
|
-
json: jsonFlag
|
|
21984
|
-
}, 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"));
|
|
21985
21981
|
// src/features/publish-workspace/model/export-targets.ts
|
|
21986
21982
|
const PATTERN = "*";
|
|
21987
21983
|
const taggedError$3 = Schema.TaggedError;
|
|
@@ -22337,6 +22333,9 @@ const writeNative = Effect.fn("publish.writeNative")(function* writeNative(direc
|
|
|
22337
22333
|
}), fileSystem.writeFileString(path.join(target, "README.md"), nativeReadme(native))], { concurrency: "unbounded" });
|
|
22338
22334
|
return target;
|
|
22339
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")));
|
|
22340
22339
|
// src/features/publish-workspace/model/pack-hook.ts
|
|
22341
22340
|
const HOOK_FILE = "pack-hook.mjs";
|
|
22342
22341
|
/** @internal */
|
|
@@ -23615,7 +23614,7 @@ const otherTexts = Effect.fn("otherTexts")(function* otherTexts() {
|
|
|
23615
23614
|
const texts = yield* Effect.forEach(others, ({ fullName }) => textsOf(fullName), { concurrency: 1 });
|
|
23616
23615
|
return Array$1.flatten(texts);
|
|
23617
23616
|
});
|
|
23618
|
-
const callers = Effect.fn("callers")(function* callers(
|
|
23617
|
+
const callers = Effect.fn("callers")(function* callers() {
|
|
23619
23618
|
const root = (yield* RepositoryFiles).resolve(".");
|
|
23620
23619
|
const texts = yield* otherTexts();
|
|
23621
23620
|
const found = yield* surfaceProblems(root, {
|
|
@@ -23625,12 +23624,12 @@ const callers = Effect.fn("callers")(function* callers(input) {
|
|
|
23625
23624
|
const problems = sortProblems(found);
|
|
23626
23625
|
yield* reportProblems(root, {
|
|
23627
23626
|
problems,
|
|
23628
|
-
json:
|
|
23627
|
+
json: false
|
|
23629
23628
|
});
|
|
23630
23629
|
return yield* failWhenAny(problems.length);
|
|
23631
23630
|
});
|
|
23632
23631
|
/** @internal */
|
|
23633
|
-
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"));
|
|
23634
23633
|
// src/features/check-references/model/markdown-texts.ts
|
|
23635
23634
|
const MARKDOWN = ".md";
|
|
23636
23635
|
const FIXTURE = /(?:^|\/)fixtures\//u;
|
|
@@ -23823,7 +23822,7 @@ const unresolvedOf = (outcomes) => ({ file, line, reference }) => {
|
|
|
23823
23822
|
const unresolvedReferences = Effect.fn("unresolvedReferences")(function* unresolvedReferences(root) {
|
|
23824
23823
|
const files = yield* RepositoryFiles;
|
|
23825
23824
|
const texts = yield* markdownTexts(root);
|
|
23826
|
-
const links = yield* linksIn
|
|
23825
|
+
const links = yield* linksIn(pipe(texts, Array$1.map(({ file, source }) => ({
|
|
23827
23826
|
path: files.relative(root, file),
|
|
23828
23827
|
text: source
|
|
23829
23828
|
}))));
|
|
@@ -23834,44 +23833,27 @@ const unresolvedReferences = Effect.fn("unresolvedReferences")(function* unresol
|
|
|
23834
23833
|
return pipe(occurrences, Array$1.flatMap(unresolvedOf(outcomes)));
|
|
23835
23834
|
});
|
|
23836
23835
|
// src/app/refs-command.ts
|
|
23837
|
-
const Row$2 = Schema.Struct({
|
|
23838
|
-
file: Schema.String,
|
|
23839
|
-
line: Schema.Finite,
|
|
23840
|
-
reference: Schema.String,
|
|
23841
|
-
outcome: Schema.Literals(["broken", "unchecked"]),
|
|
23842
|
-
reason: Schema.String
|
|
23843
|
-
});
|
|
23844
23836
|
const VERDICTS$1 = {
|
|
23845
23837
|
broken: "is stale:",
|
|
23846
23838
|
unchecked: "could not be checked:"
|
|
23847
23839
|
};
|
|
23848
23840
|
const describeRow$2 = (row) => `${row.file}:${String(row.line)} ${row.reference} ${VERDICTS$1[row.outcome]} ${row.reason}`;
|
|
23849
23841
|
/** @internal */
|
|
23850
|
-
const refsCommand = Command.make("refs", {
|
|
23851
|
-
row: Row$2,
|
|
23842
|
+
const refsCommand = Command.make("refs", {}, () => lookupReport({
|
|
23852
23843
|
rows: unresolvedReferences,
|
|
23853
23844
|
describe: describeRow$2
|
|
23854
|
-
})
|
|
23845
|
+
})).pipe(Command.withDescription("Reports github: and npm: reference links whose target is gone"));
|
|
23855
23846
|
// src/app/upstream-command.ts
|
|
23856
|
-
const Row$1 = Schema.Struct({
|
|
23857
|
-
file: Schema.String,
|
|
23858
|
-
line: Schema.Finite,
|
|
23859
|
-
upstream: Schema.String,
|
|
23860
|
-
reviewed: Schema.String,
|
|
23861
|
-
outcome: Schema.Literals(["undecided", "unchecked"]),
|
|
23862
|
-
detail: Schema.String
|
|
23863
|
-
});
|
|
23864
23847
|
const VERDICTS = {
|
|
23865
23848
|
undecided: "has changes nobody decided on. Read them, then set reviewed, verdict and reason of the record.",
|
|
23866
23849
|
unchecked: "could not be checked. Check it by hand or rerun where the lookup is reachable."
|
|
23867
23850
|
};
|
|
23868
23851
|
const describeRow$1 = (row) => `${row.file}:${String(row.line)} upstream ${row.upstream} after ${row.reviewed}: ${row.detail}. It ${VERDICTS[row.outcome]}`;
|
|
23869
23852
|
/** @internal */
|
|
23870
|
-
const upstreamCommand = Command.make("upstream", {
|
|
23871
|
-
row: Row$1,
|
|
23853
|
+
const upstreamCommand = Command.make("upstream", {}, () => lookupReport({
|
|
23872
23854
|
rows: undecidedUpdates,
|
|
23873
23855
|
describe: describeRow$1
|
|
23874
|
-
})
|
|
23856
|
+
})).pipe(Command.withDescription("Reports an upstream of a reimplementation that released since its verdict"));
|
|
23875
23857
|
// src/app/usage-command.ts
|
|
23876
23858
|
const METRICS_PATH = "/v1/metrics";
|
|
23877
23859
|
const UNAUTHORIZED = 401;
|
|
@@ -23890,13 +23872,9 @@ const removed = (files) => FileSystem.FileSystem.pipe(Effect.flatMap((fs) => Eff
|
|
|
23890
23872
|
concurrency: "unbounded",
|
|
23891
23873
|
discard: true
|
|
23892
23874
|
})));
|
|
23893
|
-
const withKey = (key) => Option.match(key, {
|
|
23894
|
-
onNone: () => (request) => request,
|
|
23895
|
-
onSome: (value) => HttpClientRequest.bearerToken(Redacted.value(value))
|
|
23896
|
-
});
|
|
23897
23875
|
const posted = Effect.fn("posted")(function* posted(input) {
|
|
23898
23876
|
const client = yield* HttpClient.HttpClient;
|
|
23899
|
-
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));
|
|
23900
23878
|
return yield* client.execute(request);
|
|
23901
23879
|
});
|
|
23902
23880
|
const spooledTallies = Effect.fn("spooledTallies")(function* spooledTallies(files) {
|
|
@@ -23917,29 +23895,20 @@ const bodyOf = Effect.fn("bodyOf")(function* bodyOf(tallies) {
|
|
|
23917
23895
|
endNanos: now
|
|
23918
23896
|
})(tallies);
|
|
23919
23897
|
});
|
|
23920
|
-
const refusalHint = (apiKeyEnv) => Option.match(apiKeyEnv, {
|
|
23921
|
-
onNone: () => "Pass --api-key-env or let the proxy add the key.",
|
|
23922
|
-
onSome: (name) => `Set ${name} or let the proxy add the key.`
|
|
23923
|
-
});
|
|
23924
23898
|
const isRefused = (status) => status === UNAUTHORIZED || status === FORBIDDEN;
|
|
23925
|
-
const answered = (
|
|
23899
|
+
const answered = (files, status) => {
|
|
23926
23900
|
if (status >= OK_FROM && status < OK_BELOW) return removed(files);
|
|
23927
|
-
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)));
|
|
23928
23902
|
return Console.error(`msch usage: the endpoint answered ${String(status)}, so the counters stay in the spool for the next run.`);
|
|
23929
23903
|
};
|
|
23930
23904
|
const sentOrKept = Effect.fn("sentOrKept")(function* sentOrKept(target, files, tallies) {
|
|
23931
|
-
const key = yield* Option.match(target.apiKeyEnv, {
|
|
23932
|
-
onNone: () => Effect.succeed(Option.none()),
|
|
23933
|
-
onSome: (name) => Config$1.option(Config$1.Redacted(name)).pipe(Effect.orElseSucceed(() => Option.none()))
|
|
23934
|
-
});
|
|
23935
23905
|
const body = yield* bodyOf(tallies);
|
|
23936
23906
|
const sent = yield* posted({
|
|
23937
23907
|
endpoint: target.endpoint,
|
|
23938
|
-
key,
|
|
23939
23908
|
body
|
|
23940
23909
|
}).pipe(Effect.option);
|
|
23941
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.");
|
|
23942
|
-
return yield* answered(
|
|
23911
|
+
return yield* answered(files, sent.value.status);
|
|
23943
23912
|
});
|
|
23944
23913
|
/** @internal */
|
|
23945
23914
|
const sendUsage = Effect.fn("sendUsage")(function* sendUsage(root, target) {
|
|
@@ -23959,10 +23928,7 @@ const NETWORK_COMMANDS = [
|
|
|
23959
23928
|
callersCommand,
|
|
23960
23929
|
refsCommand,
|
|
23961
23930
|
upstreamCommand,
|
|
23962
|
-
Command.make("usage", {
|
|
23963
|
-
endpoint: Flag.String("endpoint").pipe(Flag.withDescription("Sends the counters to this OTLP/HTTP base URL")),
|
|
23964
|
-
apiKeyEnv: Flag.String("api-key-env").pipe(Flag.withDescription("Reads the bearer token from this environment variable"), Flag.optional)
|
|
23965
|
-
}, 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"))
|
|
23966
23932
|
];
|
|
23967
23933
|
// src/app/publish-command.ts
|
|
23968
23934
|
const directory = Argument.String("directory").pipe(Argument.withDescription("The workspace directory"));
|
|
@@ -24091,19 +24057,12 @@ const missingVersions = Effect.fn("missingVersions")(function* missingVersions(r
|
|
|
24091
24057
|
return pipe(due, Array$1.flatMap(missingIn(known)));
|
|
24092
24058
|
});
|
|
24093
24059
|
// src/app/published-command.ts
|
|
24094
|
-
const Row = Schema.Struct({
|
|
24095
|
-
file: Schema.String,
|
|
24096
|
-
line: Schema.Finite,
|
|
24097
|
-
dependency: Schema.String,
|
|
24098
|
-
reason: Schema.String
|
|
24099
|
-
});
|
|
24100
24060
|
const describeRow = (row) => `${row.file}:${String(row.line)} ${row.dependency} ${row.reason}`;
|
|
24101
24061
|
/** @internal */
|
|
24102
|
-
const publishedCommand = Command.make("published", {
|
|
24103
|
-
row: Row,
|
|
24062
|
+
const publishedCommand = Command.make("published", {}, () => lookupReport({
|
|
24104
24063
|
rows: missingVersions,
|
|
24105
24064
|
describe: describeRow
|
|
24106
|
-
})
|
|
24065
|
+
})).pipe(Command.withDescription("Reports a dependency range that no version on npm satisfies"));
|
|
24107
24066
|
// src/app/unbumped-command.ts
|
|
24108
24067
|
const unbumped = Effect.fn("unbumped")(function* unbumped() {
|
|
24109
24068
|
const root = (yield* RepositoryFiles).resolve(".");
|