@r_masseater/msch 0.112.0 → 0.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +140 -107
- package/dist/cli.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -43,7 +43,7 @@ import { Base64 } from "effect/encoding";
|
|
|
43
43
|
import { dual } from "effect/Function";
|
|
44
44
|
// package.json
|
|
45
45
|
var name = "@r_masseater/msch";
|
|
46
|
-
var version = "0.
|
|
46
|
+
var version = "0.113.0";
|
|
47
47
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
48
48
|
var repository = {
|
|
49
49
|
"type": "git",
|
|
@@ -435,7 +435,7 @@ const mentions$1 = (needle) => ({ api }) => (configPath) => Effect.gen(function*
|
|
|
435
435
|
return pipe(texts, Array$1.some((text) => Option.exists(text, includesNeedle)));
|
|
436
436
|
});
|
|
437
437
|
// src/entities/project/model/inputs.ts
|
|
438
|
-
const SEPARATOR$
|
|
438
|
+
const SEPARATOR$28 = "/";
|
|
439
439
|
const SCOPE_PREFIX$1 = "@";
|
|
440
440
|
const HIDDEN_PREFIX = ".";
|
|
441
441
|
const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
@@ -477,14 +477,14 @@ const closureOf$3 = Effect.fn("closureOf")(function* closureOf(root, configPath)
|
|
|
477
477
|
const directories = yield* workspaceClosure(directory);
|
|
478
478
|
return {
|
|
479
479
|
directories,
|
|
480
|
-
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$
|
|
480
|
+
prefixes: pipe(directories, Array$1.map((found) => `${files.relative(root, found)}${SEPARATOR$28}`))
|
|
481
481
|
};
|
|
482
482
|
});
|
|
483
483
|
const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
|
|
484
484
|
const files = yield* RepositoryFiles;
|
|
485
485
|
if (!String$1.startsWith(SCOPE_PREFIX$1)(name)) return [name];
|
|
486
486
|
const scoped = yield* files.readDirectory(files.join(modules, name));
|
|
487
|
-
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$
|
|
487
|
+
return pipe(scoped, Array$1.map((entry) => `${name}${SEPARATOR$28}${entry}`));
|
|
488
488
|
});
|
|
489
489
|
const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
|
|
490
490
|
const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
|
|
@@ -638,7 +638,7 @@ const runTasksOf = Effect.fn("runTasksOf")(function* runTasksOf(root, directory)
|
|
|
638
638
|
})));
|
|
639
639
|
});
|
|
640
640
|
// src/entities/workspace/model/cargo-crates.ts
|
|
641
|
-
const SEPARATOR$
|
|
641
|
+
const SEPARATOR$27 = "/";
|
|
642
642
|
const SUCCESS$7 = 0;
|
|
643
643
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
644
644
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
@@ -678,7 +678,7 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
678
678
|
}, Effect.scoped);
|
|
679
679
|
/** @internal */
|
|
680
680
|
const owningWorkspace = (directories) => (directory) => {
|
|
681
|
-
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$
|
|
681
|
+
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$27}`)(directory)));
|
|
682
682
|
return Array$1.last(Array$1.sort(owners, String$1.Order));
|
|
683
683
|
};
|
|
684
684
|
// src/entities/workspace/model/plugins.ts
|
|
@@ -686,7 +686,7 @@ const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
|
|
|
686
686
|
const SKILLS_DIRECTORY = "skills";
|
|
687
687
|
const SKILL_FILE$4 = "SKILL.md";
|
|
688
688
|
const CONCURRENCY$4 = 16;
|
|
689
|
-
const SEPARATOR$
|
|
689
|
+
const SEPARATOR$26 = "/";
|
|
690
690
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
691
691
|
name: Schema.String,
|
|
692
692
|
description: Schema.optionalKey(Schema.String),
|
|
@@ -702,7 +702,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
702
702
|
const directory = files.join(skills, name);
|
|
703
703
|
const file = files.join(directory, SKILL_FILE$4);
|
|
704
704
|
const source = yield* files.readFile(file);
|
|
705
|
-
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$
|
|
705
|
+
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
706
706
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
707
707
|
return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
|
|
708
708
|
plugin,
|
|
@@ -715,7 +715,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
715
715
|
})))));
|
|
716
716
|
});
|
|
717
717
|
const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
|
|
718
|
-
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$
|
|
718
|
+
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$26}`;
|
|
719
719
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
720
720
|
});
|
|
721
721
|
const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
@@ -908,7 +908,7 @@ const judge$1 = (baseline) => (key, candidate) => {
|
|
|
908
908
|
};
|
|
909
909
|
const BASELINE_PROBE = "msch-baseline-probe";
|
|
910
910
|
const REMOVED_DEPENDENCY = "-";
|
|
911
|
-
const QUOTES$
|
|
911
|
+
const QUOTES$1 = ["\"", "'"];
|
|
912
912
|
const PREVIOUS = 1;
|
|
913
913
|
const workspaceOverrides = Effect.fn("workspaceOverrides")(function* workspaceOverrides(root) {
|
|
914
914
|
const manifest = yield* workspaceManifest(root);
|
|
@@ -916,7 +916,7 @@ const workspaceOverrides = Effect.fn("workspaceOverrides")(function* workspaceOv
|
|
|
916
916
|
});
|
|
917
917
|
const keyStart = (source) => (index) => {
|
|
918
918
|
const before = String$1.slice(index - PREVIOUS, index)(source);
|
|
919
|
-
return index - Number(Array$1.contains(QUOTES$
|
|
919
|
+
return index - Number(Array$1.contains(QUOTES$1, before)) * PREVIOUS;
|
|
920
920
|
};
|
|
921
921
|
const overrideKeysOf = (source) => (overrides) => {
|
|
922
922
|
const at = positionOf(source);
|
|
@@ -3525,7 +3525,7 @@ const RULE$70 = "colocated-test";
|
|
|
3525
3525
|
const FIRST$25 = 1;
|
|
3526
3526
|
const READ_CONCURRENCY$39 = 64;
|
|
3527
3527
|
const ROOT_SUBPATH$2 = ".";
|
|
3528
|
-
const NAME_GROUP$
|
|
3528
|
+
const NAME_GROUP$2 = "name";
|
|
3529
3529
|
const SPECIFIER_GROUP = "specifier";
|
|
3530
3530
|
const SCRIPT$1 = /\.[cm]?[jt]sx?$/u;
|
|
3531
3531
|
const TEST_FILE$4 = /\.test\.[cm]?[jt]sx?$/u;
|
|
@@ -3548,7 +3548,7 @@ const problemFor$10 = (test, message) => ({
|
|
|
3548
3548
|
message: `${test.base} ${message}`
|
|
3549
3549
|
});
|
|
3550
3550
|
const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
3551
|
-
const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP$
|
|
3551
|
+
const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP$2), ...groupsOf$1(source, DIRNAME_REFERENCE, NAME_GROUP$2)], Array$1.some((name) => !TEST_FILE$4.test(name)));
|
|
3552
3552
|
const ownerOf$5 = (packages, name) => {
|
|
3553
3553
|
const owners = pipe(packages, Array$1.filter((directory) => String$1.startsWith(directory)(name)));
|
|
3554
3554
|
return Array$1.last(Array$1.sort(owners, byLength$2));
|
|
@@ -3671,10 +3671,10 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3671
3671
|
});
|
|
3672
3672
|
// src/features/check-placement/model/dangling-links.ts
|
|
3673
3673
|
const RULE$67 = "dangling-link";
|
|
3674
|
-
const SEPARATOR$
|
|
3674
|
+
const SEPARATOR$25 = "/";
|
|
3675
3675
|
const FIRST$22 = 1;
|
|
3676
3676
|
const READ_CONCURRENCY$36 = 16;
|
|
3677
|
-
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$
|
|
3677
|
+
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$25}`)(name);
|
|
3678
3678
|
/** @internal */
|
|
3679
3679
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3680
3680
|
const files = yield* RepositoryFiles;
|
|
@@ -3696,7 +3696,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3696
3696
|
// src/features/check-placement/model/member-sources.ts
|
|
3697
3697
|
const ROOT_WORKSPACE$1 = ".";
|
|
3698
3698
|
const FIRST$21 = 1;
|
|
3699
|
-
const SEPARATOR$
|
|
3699
|
+
const SEPARATOR$24 = "/";
|
|
3700
3700
|
const EXCLUDED$7 = [
|
|
3701
3701
|
":(exclude,attr:linguist-vendored)",
|
|
3702
3702
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3721,7 +3721,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
|
|
|
3721
3721
|
rule,
|
|
3722
3722
|
message
|
|
3723
3723
|
});
|
|
3724
|
-
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$
|
|
3724
|
+
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) => ({
|
|
3725
3725
|
workspace,
|
|
3726
3726
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3727
3727
|
})));
|
|
@@ -3810,7 +3810,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3810
3810
|
// src/features/check-placement/model/nested-docs.ts
|
|
3811
3811
|
const RULE$65 = "nested-docs";
|
|
3812
3812
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3813
|
-
const SEPARATOR$
|
|
3813
|
+
const SEPARATOR$23 = "/";
|
|
3814
3814
|
const READ_CONCURRENCY$34 = 64;
|
|
3815
3815
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3816
3816
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
@@ -3820,7 +3820,7 @@ const MISSING_RULE = "workspace-agents-md";
|
|
|
3820
3820
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3821
3821
|
const taggedError$13 = Schema.TaggedError;
|
|
3822
3822
|
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3823
|
-
const isNested = (name) => String$1.includes(SEPARATOR$
|
|
3823
|
+
const isNested = (name) => String$1.includes(SEPARATOR$23)(name);
|
|
3824
3824
|
const problemFor$8 = problemInFile(RULE$65);
|
|
3825
3825
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3826
3826
|
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.";
|
|
@@ -3939,12 +3939,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3939
3939
|
});
|
|
3940
3940
|
// src/features/check-placement/model/root-docs.ts
|
|
3941
3941
|
const RULE$62 = "root-docs";
|
|
3942
|
-
const SEPARATOR$
|
|
3942
|
+
const SEPARATOR$22 = "/";
|
|
3943
3943
|
const FIRST$20 = 1;
|
|
3944
3944
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
3945
3945
|
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3946
3946
|
const MESSAGE$11 = "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.";
|
|
3947
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$
|
|
3947
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$22)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
3948
3948
|
/** @internal */
|
|
3949
3949
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3950
3950
|
const files = yield* RepositoryFiles;
|
|
@@ -3963,7 +3963,7 @@ const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
|
3963
3963
|
const READ_CONCURRENCY$32 = 16;
|
|
3964
3964
|
const START$31 = 0;
|
|
3965
3965
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3966
|
-
const RELATIVE$
|
|
3966
|
+
const RELATIVE$3 = /^\.\//u;
|
|
3967
3967
|
const MarketplacePlugin = Schema.Struct({
|
|
3968
3968
|
name: Schema.optional(Schema.String),
|
|
3969
3969
|
source: Schema.Unknown
|
|
@@ -3976,7 +3976,7 @@ const NO_PLUGINS = {
|
|
|
3976
3976
|
const isCheckPolicy = ({ packageName }) => Option.contains(packageName, SELF_NAME);
|
|
3977
3977
|
const messageFor$4 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
|
|
3978
3978
|
const pluginsOf = (plugins) => {
|
|
3979
|
-
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$
|
|
3979
|
+
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$3, "")));
|
|
3980
3980
|
const segments = pipe(directories, Array$1.map(baseName$1));
|
|
3981
3981
|
return {
|
|
3982
3982
|
directories,
|
|
@@ -12688,7 +12688,7 @@ var english_verbs_default = [
|
|
|
12688
12688
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12689
12689
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12690
12690
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12691
|
-
const SEPARATOR$
|
|
12691
|
+
const SEPARATOR$20 = "/";
|
|
12692
12692
|
const NEXT$3 = 1;
|
|
12693
12693
|
const WORD_SEPARATOR$1 = "-";
|
|
12694
12694
|
const MINIMUM_WORDS = 2;
|
|
@@ -12714,7 +12714,7 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12714
12714
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12715
12715
|
};
|
|
12716
12716
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12717
|
-
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$
|
|
12717
|
+
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}`));
|
|
12718
12718
|
const SLICE_LAYERS = [
|
|
12719
12719
|
"features",
|
|
12720
12720
|
"entities",
|
|
@@ -12722,26 +12722,26 @@ const SLICE_LAYERS = [
|
|
|
12722
12722
|
"pages"
|
|
12723
12723
|
];
|
|
12724
12724
|
const SLICE_DEPTHS = [3, 4];
|
|
12725
|
-
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
12725
|
+
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$20);
|
|
12726
12726
|
const isInSliceLayer = (parts) => {
|
|
12727
12727
|
const [source, layer] = parts;
|
|
12728
|
-
return `${source}${SEPARATOR$
|
|
12728
|
+
return `${source}${SEPARATOR$20}` === SOURCE$2 && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12729
12729
|
};
|
|
12730
12730
|
const indexedSlice = (owned) => {
|
|
12731
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12731
|
+
const parts = String$1.split(owned.inner, SEPARATOR$20);
|
|
12732
12732
|
const depth = parts.length - NEXT$3;
|
|
12733
|
-
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$
|
|
12733
|
+
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)}`));
|
|
12734
12734
|
};
|
|
12735
12735
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12736
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12737
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12736
|
+
const parts = String$1.split(inner, SEPARATOR$20);
|
|
12737
|
+
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$20}${pathPrefix(parts, depth)}`);
|
|
12738
12738
|
const isSegmentFolder = (depth) => parts.length > depth + NEXT$3 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
|
|
12739
|
-
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$
|
|
12739
|
+
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$20}${pathPrefix(parts, depth + NEXT$3)}`));
|
|
12740
12740
|
};
|
|
12741
12741
|
const deployNamed = ({ workspace, inner }) => {
|
|
12742
12742
|
if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
|
|
12743
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12744
|
-
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$
|
|
12743
|
+
const segments = String$1.split(inner, SEPARATOR$20);
|
|
12744
|
+
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$3), SEPARATOR$20)}`));
|
|
12745
12745
|
};
|
|
12746
12746
|
/** @internal */
|
|
12747
12747
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12932,7 +12932,7 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
12932
12932
|
const BIN = "bin";
|
|
12933
12933
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
12934
12934
|
const WORKFLOW_DIRECTORY = ".github/";
|
|
12935
|
-
const SEPARATOR$
|
|
12935
|
+
const SEPARATOR$19 = "/";
|
|
12936
12936
|
const CURRENT = "./";
|
|
12937
12937
|
const READ_CONCURRENCY$29 = 8;
|
|
12938
12938
|
const FIRST$17 = 1;
|
|
@@ -12950,7 +12950,7 @@ const runsIn = ({ text, start }) => pipe(Array$1.fromIterable(String$1.matchAll(
|
|
|
12950
12950
|
start
|
|
12951
12951
|
})), Option.toArray)));
|
|
12952
12952
|
const targetPaths = (held) => pipe(targetsIn(held), Array$1.map(withoutCurrent));
|
|
12953
|
-
const entriesOf = (manifest) => {
|
|
12953
|
+
const entriesOf$1 = (manifest) => {
|
|
12954
12954
|
const bins = targetPaths(manifest.bin);
|
|
12955
12955
|
return {
|
|
12956
12956
|
all: [
|
|
@@ -12964,13 +12964,13 @@ const entriesOf = (manifest) => {
|
|
|
12964
12964
|
const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
|
|
12965
12965
|
const files = yield* RepositoryFiles;
|
|
12966
12966
|
const manifest = yield* readManifest(files.join(root, directory));
|
|
12967
|
-
return pipe(manifest, Option.map(entriesOf), Option.getOrElse(() => NO_ENTRIES));
|
|
12967
|
+
return pipe(manifest, Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
|
|
12968
12968
|
});
|
|
12969
12969
|
const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
12970
12970
|
const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
12971
12971
|
const files = yield* RepositoryFiles;
|
|
12972
12972
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
12973
|
-
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$
|
|
12973
|
+
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$19}${name}`), Array$1.filter(isCommand));
|
|
12974
12974
|
});
|
|
12975
12975
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
12976
12976
|
const files = yield* RepositoryFiles;
|
|
@@ -12979,7 +12979,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12979
12979
|
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$29 });
|
|
12980
12980
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12981
12981
|
});
|
|
12982
|
-
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
12982
|
+
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$19));
|
|
12983
12983
|
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 }) => ({
|
|
12984
12984
|
file,
|
|
12985
12985
|
...positionOf(source)(start),
|
|
@@ -13026,8 +13026,8 @@ const isCommandFile = (path) => isCommand(path) || COMMAND_FILE$1.test(path) &&
|
|
|
13026
13026
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
13027
13027
|
const files = yield* RepositoryFiles;
|
|
13028
13028
|
const listed = yield* files.listedFiles(root);
|
|
13029
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
13030
|
-
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$
|
|
13029
|
+
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$19}`);
|
|
13030
|
+
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) => ({
|
|
13031
13031
|
file: files.join(root, file),
|
|
13032
13032
|
line: FIRST$17,
|
|
13033
13033
|
column: FIRST$17,
|
|
@@ -13050,12 +13050,12 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
13050
13050
|
});
|
|
13051
13051
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
13052
13052
|
const START$30 = 0;
|
|
13053
|
-
const QUOTES
|
|
13053
|
+
const QUOTES = ["\"", "'"];
|
|
13054
13054
|
const firstIndex = (source, needles) => {
|
|
13055
13055
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
13056
13056
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
13057
13057
|
};
|
|
13058
|
-
const quoted = (text) => pipe(QUOTES
|
|
13058
|
+
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
13059
13059
|
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$30));
|
|
13060
13060
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
13061
13061
|
const MEMBER_LISTS = [
|
|
@@ -13103,15 +13103,15 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
13103
13103
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
13104
13104
|
const WRAP_OFFSET$2 = 1;
|
|
13105
13105
|
const WILDCARD$3 = /[*?[{]/u;
|
|
13106
|
-
const SEPARATOR$
|
|
13107
|
-
const RELATIVE$
|
|
13106
|
+
const SEPARATOR$18 = "/";
|
|
13107
|
+
const RELATIVE$2 = ".";
|
|
13108
13108
|
const JSON_EXTENSION = ".json";
|
|
13109
13109
|
const isObject = (node) => Predicate.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
13110
13110
|
const firstObject = (node) => {
|
|
13111
13111
|
if (isObject(node)) return Option.some(node);
|
|
13112
13112
|
return pipe(childrenOf$4(node), Array$1.findFirst(firstObject));
|
|
13113
13113
|
};
|
|
13114
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$
|
|
13114
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$18), Array$1.takeWhile((segment) => !WILDCARD$3.test(segment)), Array$1.join(SEPARATOR$18));
|
|
13115
13115
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
13116
13116
|
field: name,
|
|
13117
13117
|
text,
|
|
@@ -13122,7 +13122,7 @@ const objectsIn = (node) => [...Array$1.filter([node], isObject), ...pipe(childr
|
|
|
13122
13122
|
const referencedPaths = (references) => pipe(objectsIn(references), Array$1.flatMap((reference) => Option.toArray(propertyValue("path")(reference))), Array$1.flatMap(stringsIn));
|
|
13123
13123
|
const exactly = (text) => [text];
|
|
13124
13124
|
const relativeConfig = (text) => {
|
|
13125
|
-
if (String$1.startsWith(RELATIVE$
|
|
13125
|
+
if (String$1.startsWith(RELATIVE$2)(text)) return [text, `${text}${JSON_EXTENSION}`];
|
|
13126
13126
|
return [];
|
|
13127
13127
|
};
|
|
13128
13128
|
const patternRoot = (text) => pipe([leadingDirectory(text)], Array$1.filter(String$1.isNonEmpty));
|
|
@@ -13199,7 +13199,7 @@ const VERSION_RULE = "release-version";
|
|
|
13199
13199
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
13200
13200
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
13201
13201
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13202
|
-
const SEPARATOR$
|
|
13202
|
+
const SEPARATOR$17 = "/";
|
|
13203
13203
|
const FIRST$16 = 1;
|
|
13204
13204
|
const READ_CONCURRENCY$27 = 8;
|
|
13205
13205
|
const problemFor$5 = (crate, message) => ({
|
|
@@ -13219,7 +13219,7 @@ const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories
|
|
|
13219
13219
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
13220
13220
|
const files = yield* RepositoryFiles;
|
|
13221
13221
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
13222
|
-
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$
|
|
13222
|
+
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))));
|
|
13223
13223
|
if (Option.isNone(workspace)) return Option.none();
|
|
13224
13224
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
13225
13225
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
@@ -13354,7 +13354,7 @@ const ENTRY_KEYS = [
|
|
|
13354
13354
|
];
|
|
13355
13355
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
13356
13356
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13357
|
-
const SEPARATOR$
|
|
13357
|
+
const SEPARATOR$16 = "/";
|
|
13358
13358
|
const WRAP_OFFSET = 1;
|
|
13359
13359
|
const READ_CONCURRENCY$25 = 8;
|
|
13360
13360
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
@@ -13366,7 +13366,7 @@ const entryPatternsIn = (node) => {
|
|
|
13366
13366
|
})));
|
|
13367
13367
|
return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
|
|
13368
13368
|
};
|
|
13369
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
13369
|
+
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);
|
|
13370
13370
|
const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
13371
13371
|
const files = yield* RepositoryFiles;
|
|
13372
13372
|
const path = files.join(root, file);
|
|
@@ -13588,16 +13588,16 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13588
13588
|
});
|
|
13589
13589
|
// src/shared/lib/package-name.ts
|
|
13590
13590
|
const SCOPE$2 = "@";
|
|
13591
|
-
const SEPARATOR$
|
|
13591
|
+
const SEPARATOR$15 = "/";
|
|
13592
13592
|
const SCOPED_SEGMENTS = 2;
|
|
13593
13593
|
const PLAIN_SEGMENTS = 1;
|
|
13594
13594
|
const segmentCount = (specifier) => {
|
|
13595
13595
|
if (String$1.startsWith(SCOPE$2)(specifier)) return SCOPED_SEGMENTS;
|
|
13596
13596
|
return PLAIN_SEGMENTS;
|
|
13597
13597
|
};
|
|
13598
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13598
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$15), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$15));
|
|
13599
13599
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13600
|
-
const RELATIVE = /^\.\.?(?:\/|$)/u;
|
|
13600
|
+
const RELATIVE$1 = /^\.\.?(?:\/|$)/u;
|
|
13601
13601
|
const SUBPATH_IMPORT$1 = "#";
|
|
13602
13602
|
const WILDCARD$1 = "*";
|
|
13603
13603
|
const SOURCE_SUFFIXES = [
|
|
@@ -13633,13 +13633,13 @@ const existingSource = Effect.fn("existingSource")(function* existingSource(base
|
|
|
13633
13633
|
});
|
|
13634
13634
|
const localFile = Effect.fn("localFile")(function* localFile({ directory, imports }, from, specifier) {
|
|
13635
13635
|
const files = yield* RepositoryFiles;
|
|
13636
|
-
if (RELATIVE.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13636
|
+
if (RELATIVE$1.test(specifier)) return yield* existingSource(files.resolve(files.dirname(from), specifier));
|
|
13637
13637
|
const target = subpathTarget(imports, specifier);
|
|
13638
13638
|
if (Option.isNone(target)) return Option.none();
|
|
13639
13639
|
return yield* existingSource(files.resolve(directory, target.value));
|
|
13640
13640
|
});
|
|
13641
13641
|
const referenceOf$2 = (graph, from, specifier) => {
|
|
13642
|
-
if (RELATIVE.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13642
|
+
if (RELATIVE$1.test(specifier) || String$1.startsWith(SUBPATH_IMPORT$1)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
|
|
13643
13643
|
const name = packageNameOf(specifier);
|
|
13644
13644
|
return Effect.succeedSome(Result.fail(name));
|
|
13645
13645
|
};
|
|
@@ -15463,7 +15463,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15463
15463
|
const PATH_PREFIX = /^(?:!|\.\/)+/u;
|
|
15464
15464
|
const GLOB$1 = /[*?{[]/u;
|
|
15465
15465
|
const EXTENSION$2 = /\.[^./]+$/u;
|
|
15466
|
-
const SEPARATOR$
|
|
15466
|
+
const SEPARATOR$14 = "/";
|
|
15467
15467
|
const ROOT$2 = ".";
|
|
15468
15468
|
const namedPath = (repository, file) => (name) => {
|
|
15469
15469
|
const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
|
|
@@ -15472,12 +15472,12 @@ const namedPath = (repository, file) => (name) => {
|
|
|
15472
15472
|
return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
|
|
15473
15473
|
};
|
|
15474
15474
|
const kindOf = (repository) => (path) => {
|
|
15475
|
-
if (HashSet.has(repository.directories, path)) return SEPARATOR$
|
|
15475
|
+
if (HashSet.has(repository.directories, path)) return SEPARATOR$14;
|
|
15476
15476
|
return pipe(path, String$1.match(EXTENSION$2), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
|
|
15477
15477
|
};
|
|
15478
15478
|
const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array$1.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
|
|
15479
15479
|
const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
|
|
15480
|
-
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$
|
|
15480
|
+
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$14}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
|
|
15481
15481
|
const directoryLabel = (directory) => {
|
|
15482
15482
|
if (directory === ROOT$2) return "the repository root";
|
|
15483
15483
|
return directory;
|
|
@@ -15500,8 +15500,8 @@ const listedPathProblem = (repository) => (list) => {
|
|
|
15500
15500
|
const SUBSET_SHARE = 2;
|
|
15501
15501
|
const canImport = (importer, imported) => importer.name === imported.name || importer.dependencies.includes(imported.name);
|
|
15502
15502
|
const importIndexOf = (files) => pipe(files, Array$1.map((entry) => [entry.file, entry.imports]), Record.fromEntries);
|
|
15503
|
-
const imports
|
|
15504
|
-
const connected = (index) => (left, right) => left === right || imports
|
|
15503
|
+
const imports = (index) => (importer, imported) => Record.get(index, importer).pipe(Option.exists(Array$1.contains(imported)));
|
|
15504
|
+
const connected = (index) => (left, right) => left === right || imports(index)(left, right) || imports(index)(right, left);
|
|
15505
15505
|
const isPartOf = (index, list) => (other) => other !== list && canImport(list.site.scope, other.site.scope) && connected(index)(list.site.file, other.site.file) && isSubsetOf(list.names, other.names) && list.names.length * SUBSET_SHARE >= other.names.length && !sameValues(list.names, other.names);
|
|
15506
15506
|
const subsetListProblem = ({ lists, literals, relative }) => {
|
|
15507
15507
|
const index = importIndexOf(literals);
|
|
@@ -15529,11 +15529,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
|
15529
15529
|
return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
|
|
15530
15530
|
};
|
|
15531
15531
|
// src/features/check-value-owners/model/repository-names.ts
|
|
15532
|
-
const SEPARATOR$
|
|
15532
|
+
const SEPARATOR$13 = "/";
|
|
15533
15533
|
const FIRST_SEGMENT = 1;
|
|
15534
15534
|
const prefixesOf = (file) => {
|
|
15535
|
-
const segments = pipe(file, String$1.split(SEPARATOR$
|
|
15536
|
-
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$
|
|
15535
|
+
const segments = pipe(file, String$1.split(SEPARATOR$13));
|
|
15536
|
+
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$13))));
|
|
15537
15537
|
};
|
|
15538
15538
|
const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
|
|
15539
15539
|
const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
|
|
@@ -15925,7 +15925,7 @@ const ARGS = "args";
|
|
|
15925
15925
|
const PLACEHOLDER = /[<>*{}$]/u;
|
|
15926
15926
|
const WHITESPACE$1 = /\s+/u;
|
|
15927
15927
|
const ROOT$1 = ".";
|
|
15928
|
-
const SEPARATOR$
|
|
15928
|
+
const SEPARATOR$12 = "/";
|
|
15929
15929
|
const END_OF_OPTIONS = "--";
|
|
15930
15930
|
const FLAG = "-";
|
|
15931
15931
|
const TASK_SEPARATOR$1 = "#";
|
|
@@ -15972,8 +15972,8 @@ const parsed = (args) => {
|
|
|
15972
15972
|
return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
|
|
15973
15973
|
};
|
|
15974
15974
|
const ancestorsOf$1 = (file) => {
|
|
15975
|
-
const parts = pipe(String$1.split(file, SEPARATOR$
|
|
15976
|
-
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$
|
|
15975
|
+
const parts = pipe(String$1.split(file, SEPARATOR$12), Array$1.dropRight(ONE$2));
|
|
15976
|
+
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$12))), ROOT$1];
|
|
15977
15977
|
};
|
|
15978
15978
|
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));
|
|
15979
15979
|
const packagesOf = (graph, file) => (scope) => {
|
|
@@ -15997,7 +15997,7 @@ const problemsIn$12 = (graph, absolute, { file, text }) => pipe(Array$1.fromIter
|
|
|
15997
15997
|
rule: RULE$35,
|
|
15998
15998
|
message: `${match[START$22]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
15999
15999
|
})), Option.toArray)));
|
|
16000
|
-
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$
|
|
16000
|
+
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
16001
16001
|
/** @internal */
|
|
16002
16002
|
const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
|
|
16003
16003
|
const files = yield* RepositoryFiles;
|
|
@@ -16183,12 +16183,12 @@ const checkStructure = checkSection({
|
|
|
16183
16183
|
// src/features/check-vite-plus/model/command-words.ts
|
|
16184
16184
|
const CONTINUATION = /\\\n/gu;
|
|
16185
16185
|
const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
16186
|
-
const SEPARATOR$
|
|
16186
|
+
const SEPARATOR$11 = /&&|\|\||[;|\n`]|\$\(/u;
|
|
16187
16187
|
const BLANK$1 = /\s+/u;
|
|
16188
16188
|
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
16189
16189
|
const QUOTE = "\"\"";
|
|
16190
16190
|
const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
|
|
16191
|
-
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$
|
|
16191
|
+
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$11), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
|
|
16192
16192
|
// src/features/check-vite-plus/model/command-problems.ts
|
|
16193
16193
|
const PACKAGE_MANAGERS = [
|
|
16194
16194
|
"pnpm",
|
|
@@ -17165,7 +17165,7 @@ const FRAGMENT = /#.*$/u;
|
|
|
17165
17165
|
const GITHUB$3 = "https://github.com/";
|
|
17166
17166
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
17167
17167
|
const BLANK = /\s+/u;
|
|
17168
|
-
const SEPARATOR$
|
|
17168
|
+
const SEPARATOR$10 = "/";
|
|
17169
17169
|
const START$16 = 0;
|
|
17170
17170
|
const FIRST$7 = 1;
|
|
17171
17171
|
const READ_CONCURRENCY$14 = 16;
|
|
@@ -17241,7 +17241,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17241
17241
|
const files = yield* RepositoryFiles;
|
|
17242
17242
|
const file = files.join(root, name);
|
|
17243
17243
|
const directory = files.dirname(name);
|
|
17244
|
-
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$
|
|
17244
|
+
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$10}`)));
|
|
17245
17245
|
const text = yield* files.readFile(file);
|
|
17246
17246
|
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
17247
17247
|
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$14 });
|
|
@@ -17522,7 +17522,7 @@ const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
|
17522
17522
|
const RULE$22 = "applied-package";
|
|
17523
17523
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17524
17524
|
const NOT_FOUND$3 = -1;
|
|
17525
|
-
const SEPARATOR$
|
|
17525
|
+
const SEPARATOR$9 = "/";
|
|
17526
17526
|
/** @internal */
|
|
17527
17527
|
const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
|
|
17528
17528
|
const BY_LENGTH = Order.mapInput(Order.Number, (text) => text.length);
|
|
@@ -17561,7 +17561,7 @@ const problemAt$1 = (file, source) => (index, name) => ({
|
|
|
17561
17561
|
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
17562
17562
|
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped$1(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
17563
17563
|
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND$3, entry.name)))));
|
|
17564
|
-
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$
|
|
17564
|
+
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$9}`)(name)), Array$1.match({
|
|
17565
17565
|
onEmpty: () => "",
|
|
17566
17566
|
onNonEmpty: Array$1.max(BY_LENGTH)
|
|
17567
17567
|
}));
|
|
@@ -17709,7 +17709,7 @@ const unneededLockfile = (present) => (entry) => FOREIGN_LOCKFILE.test(entry.nam
|
|
|
17709
17709
|
// src/features/find-unneeded-files/model/unneeded-files.ts
|
|
17710
17710
|
const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
|
|
17711
17711
|
const PNPM_DIRECTORY = ".pnpm/";
|
|
17712
|
-
const SEPARATOR$
|
|
17712
|
+
const SEPARATOR$8 = "/";
|
|
17713
17713
|
const CARGO_MANIFEST_FILE = /(?:^|\/)Cargo\.toml$/u;
|
|
17714
17714
|
const CARGO_LOCK_FILE = /(?:^|\/)Cargo\.lock$/u;
|
|
17715
17715
|
const PNPM_OUTPUT = /(?:^|\/)\.pnpm\//u;
|
|
@@ -17777,10 +17777,10 @@ const matches = (pattern) => ({ name }) => pattern.test(name);
|
|
|
17777
17777
|
const isCargoManifest = matches(CARGO_MANIFEST_FILE);
|
|
17778
17778
|
const isLegacyCargoConfig = matches(LEGACY_CARGO_CONFIG);
|
|
17779
17779
|
const isPnpmOutput = matches(PNPM_OUTPUT);
|
|
17780
|
-
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$
|
|
17780
|
+
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$8), Array$1.dropRight(LAST_SEGMENT), Array$1.join(SEPARATOR$8));
|
|
17781
17781
|
const ancestorsOf = (directory) => {
|
|
17782
|
-
const parts = String$1.split(directory, SEPARATOR$
|
|
17783
|
-
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
17782
|
+
const parts = String$1.split(directory, SEPARATOR$8);
|
|
17783
|
+
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$8)), Array$1.filter((ancestor) => ancestor !== directory));
|
|
17784
17784
|
};
|
|
17785
17785
|
const readsCargoLock = (manifests, workspaces) => ({ name }) => {
|
|
17786
17786
|
const directory = directoryOf(name);
|
|
@@ -17871,7 +17871,7 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
|
|
|
17871
17871
|
const RULE$19 = "owner-name";
|
|
17872
17872
|
const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17873
17873
|
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17874
|
-
const SEPARATOR$
|
|
17874
|
+
const SEPARATOR$7 = "/";
|
|
17875
17875
|
const START$12 = 0;
|
|
17876
17876
|
const DECLARED = [
|
|
17877
17877
|
"dependencies",
|
|
@@ -17917,7 +17917,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
|
|
|
17917
17917
|
const files = yield* RepositoryFiles;
|
|
17918
17918
|
const manifest = yield* readManifest(directory);
|
|
17919
17919
|
if (Option.isNone(manifest)) return [];
|
|
17920
|
-
const prefix = `${files.relative(root, directory)}${SEPARATOR$
|
|
17920
|
+
const prefix = `${files.relative(root, directory)}${SEPARATOR$7}`;
|
|
17921
17921
|
const names = yield* files.listedFiles(root);
|
|
17922
17922
|
const listed = pipe(names, Array$1.filter((name) => String$1.startsWith(prefix)(name) && TEXT_FILE$1.test(name) && files.basename(name) !== PACKAGE_JSON_FILE && files.basename(name) !== CONFIG_FILE$1), Array$1.map((name) => ({
|
|
17923
17923
|
name,
|
|
@@ -18302,7 +18302,7 @@ const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
|
|
|
18302
18302
|
const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
|
|
18303
18303
|
const SKILL_FILE$1 = "SKILL.md";
|
|
18304
18304
|
const BIN_PREFIX = "bin/";
|
|
18305
|
-
const SEPARATOR$
|
|
18305
|
+
const SEPARATOR$6 = "/";
|
|
18306
18306
|
const MOST_FILES = 5e3;
|
|
18307
18307
|
const LONGEST_PATH = 472;
|
|
18308
18308
|
const MOST_DEPTH = 12;
|
|
@@ -18348,7 +18348,7 @@ const WIDE_PART = `has a path part longer than ${String(LONGEST_PART)} character
|
|
|
18348
18348
|
const BAD_CHARACTERS = "has characters outside letters, digits, space and _ . - / ( ).";
|
|
18349
18349
|
const ARCHIVE_MESSAGE = "is an archive, which claude.ai sync rejects.";
|
|
18350
18350
|
const pathViolation = (file) => {
|
|
18351
|
-
const parts = String$1.split(SEPARATOR$
|
|
18351
|
+
const parts = String$1.split(SEPARATOR$6)(file);
|
|
18352
18352
|
const wide = pipe(parts, Array$1.some((part) => part.length > LONGEST_PART));
|
|
18353
18353
|
return pipe([
|
|
18354
18354
|
[BAD_CHARACTERS, !ALLOWED_PATH.test(file)],
|
|
@@ -18380,9 +18380,9 @@ const skillViolations = (skills) => {
|
|
|
18380
18380
|
Option.liftPredicate(`shares the name ${name} with another SKILL.md of the plugin.`, () => pipe(Record.get(counts, name), Option.exists((group) => group.length > SINGLE)))
|
|
18381
18381
|
], Array$1.getSomes, Array$1.map((message) => violation(file, message)))));
|
|
18382
18382
|
};
|
|
18383
|
-
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$
|
|
18383
|
+
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
|
|
18384
18384
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18385
|
-
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$
|
|
18385
|
+
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
|
|
18386
18386
|
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$3 });
|
|
18387
18387
|
return [
|
|
18388
18388
|
...manifestViolations(plugin),
|
|
@@ -19448,10 +19448,13 @@ const checkUpstream = Effect.fn("checkUpstream")(function* checkUpstream(root) {
|
|
|
19448
19448
|
});
|
|
19449
19449
|
// src/features/check-surface-callers/model/caller-texts.ts
|
|
19450
19450
|
const READ_CONCURRENCY$7 = 64;
|
|
19451
|
-
const SEPARATOR$
|
|
19451
|
+
const SEPARATOR$5 = "/";
|
|
19452
19452
|
const UNTRACKED = /(?:^|\/)(?:node_modules|\.git)\//u;
|
|
19453
|
-
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml
|
|
19453
|
+
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml)$/u;
|
|
19454
|
+
const TEST = /\.test(?:\.support)?\.[cm]?[jt]sx?$/u;
|
|
19454
19455
|
const TEXT_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|ya?ml|toml|sh|mdx?|css|html|rs)|(?:^|\/)\.vite-hooks\/[^/.]+)$/u;
|
|
19456
|
+
/** @internal */
|
|
19457
|
+
const isTest = ({ file }) => TEST.test(file);
|
|
19455
19458
|
const isCallerText = (file) => TEXT_FILE.test(file) && !NOT_A_CALLER.test(file);
|
|
19456
19459
|
const readTexts = Effect.fn("readTexts")(function* readTexts(root, listed, label) {
|
|
19457
19460
|
const files = yield* RepositoryFiles;
|
|
@@ -19470,32 +19473,57 @@ const ownTexts = Effect.fn("ownTexts")(function* ownTexts(root) {
|
|
|
19470
19473
|
const textsUnder = Effect.fn("textsUnder")(function* textsUnder(directory, label) {
|
|
19471
19474
|
const walked = yield* (yield* RepositoryFiles).walkDirectory(directory);
|
|
19472
19475
|
const tracked = pipe(walked, Array$1.filter((file) => !UNTRACKED.test(file)));
|
|
19473
|
-
return yield* readTexts(directory, tracked, (file) => `${label}${SEPARATOR$
|
|
19476
|
+
return yield* readTexts(directory, tracked, (file) => `${label}${SEPARATOR$5}${file}`);
|
|
19474
19477
|
});
|
|
19475
|
-
// src/features/check-surface-callers/model/
|
|
19478
|
+
// src/features/check-surface-callers/model/export-callers.ts
|
|
19476
19479
|
const EXPORT_RULE = "uncalled-export";
|
|
19477
|
-
const
|
|
19478
|
-
const
|
|
19479
|
-
const READ_CONCURRENCY$6 = 64;
|
|
19480
|
-
const SEPARATOR$3 = "/";
|
|
19481
|
-
const START$2 = 0;
|
|
19480
|
+
const SEPARATOR$4 = "/";
|
|
19481
|
+
const NAME_GROUP$1 = "name";
|
|
19482
19482
|
const ROOT_SUBPATH$1 = ".";
|
|
19483
19483
|
const MANIFEST_SUBPATH = "./package.json";
|
|
19484
19484
|
const WILDCARD = "*";
|
|
19485
|
-
const
|
|
19485
|
+
const SPECIFIER_ENDS = [
|
|
19486
19486
|
"\"",
|
|
19487
19487
|
"'",
|
|
19488
19488
|
"`",
|
|
19489
|
-
"\\"
|
|
19489
|
+
"\\",
|
|
19490
|
+
"?"
|
|
19490
19491
|
];
|
|
19491
|
-
const NAME_GROUP = "name";
|
|
19492
19492
|
const MANIFEST = /(?:^|\/)package\.json$/u;
|
|
19493
|
+
const JSX_RUNTIME = /^(?<name>.+)\/jsx(?:-dev)?-runtime$/u;
|
|
19494
|
+
const JSX_IMPORT_SOURCE = "jsxImportSource";
|
|
19495
|
+
const RELATIVE = /^\.\//u;
|
|
19496
|
+
const DOCUMENT = /\.mdx?$/u;
|
|
19497
|
+
const EXPORT_MESSAGE = "is exported, and nothing imports it. Every name that code outside a package can use exists only while something uses it, and fallow never reports what an entry exports as unused. Delete the subpath, or import it from the code that needs it.";
|
|
19498
|
+
const entriesOf = ({ name, exports }) => pipe(Option.fromUndefinedOr(name), Option.filter(() => Predicate.isNotUndefined(exports)), Option.map((own) => pipe(exportEntriesOf(exports), Array$1.filter(([subpath]) => subpath !== MANIFEST_SUBPATH && !String$1.includes(WILDCARD)(subpath)), Array$1.map(([subpath, held]) => ({
|
|
19499
|
+
specifier: String$1.replace(ROOT_SUBPATH$1, own)(subpath),
|
|
19500
|
+
targets: pipe(targetsIn(held), Array$1.map(String$1.replace(RELATIVE, "")))
|
|
19501
|
+
})))), Option.getOrElse(() => []));
|
|
19502
|
+
const names = (specifier) => ({ text }) => pipe(SPECIFIER_ENDS, Array$1.some((end) => String$1.includes(`${specifier}${end}`)(text)));
|
|
19503
|
+
const setsJsxSource = (specifier) => (file) => pipe(String$1.match(JSX_RUNTIME)(specifier), Option.flatMap((found) => Option.fromUndefinedOr(found.groups)), Option.flatMap(Record.get(NAME_GROUP$1)), Option.exists((source) => String$1.includes(JSX_IMPORT_SOURCE)(file.text) && names(source)(file)));
|
|
19504
|
+
const linksTarget = (prefix, targets) => ({ file, text }) => DOCUMENT.test(file) && !String$1.startsWith(prefix)(file) && pipe(targets, Array$1.some((target) => String$1.includes(`${prefix}${target}`)(text)));
|
|
19505
|
+
const calls = (prefix, { specifier, targets }) => (file) => names(specifier)(file) || setsJsxSource(specifier)(file) || linksTarget(prefix, targets)(file);
|
|
19506
|
+
/** @internal */
|
|
19507
|
+
const exportProblems = ({ root, join, corpus, owner: { directory, manifest } }) => {
|
|
19508
|
+
const prefix = `${directory}${SEPARATOR$4}`;
|
|
19509
|
+
const ownTest = (text) => String$1.startsWith(prefix)(text.file) && isTest(text);
|
|
19510
|
+
const callersOf = (specifier) => pipe(corpus, Array$1.filter(({ file }) => specifier !== manifest.name || !MANIFEST.test(file)), Array$1.filter((text) => !ownTest(text)));
|
|
19511
|
+
return pipe(entriesOf(manifest), Array$1.filter((entry) => !pipe(callersOf(entry.specifier), Array$1.some(calls(prefix, entry)))), Array$1.map(({ specifier }) => problemInFile(EXPORT_RULE)(join(root, directory, PACKAGE_JSON_FILE), `${specifier} ${EXPORT_MESSAGE}`)));
|
|
19512
|
+
};
|
|
19513
|
+
// src/features/check-surface-callers/model/surface-callers.ts
|
|
19514
|
+
const COMMAND_RULE = "uncalled-command";
|
|
19515
|
+
const FLAG_RULE = "uncalled-flag";
|
|
19516
|
+
const READ_CONCURRENCY$6 = 64;
|
|
19517
|
+
const SEPARATOR$3 = "/";
|
|
19518
|
+
const START$2 = 0;
|
|
19519
|
+
const NAME_GROUP = "name";
|
|
19493
19520
|
const SOURCE = /\.[cm]?tsx?$/u;
|
|
19494
19521
|
const DECLARED_COMMAND = /\bCommand\.make\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19495
19522
|
const DECLARED_FLAG = /\bFlag\.[A-Z]\w*\(\s*["'](?<name>[a-z][a-z0-9-]*)["']/gu;
|
|
19523
|
+
const RUN_COMMAND = /\bCommand\.run\(\s*(?<name>[A-Za-z_$][\w$]*)/gu;
|
|
19524
|
+
const INSTALLED_SKILLS$1 = ".agents/skills";
|
|
19496
19525
|
const COMMAND_FILE = /^bin\/(?<name>[^/.]+)\.[cm]?ts$/u;
|
|
19497
19526
|
const SAFE_NAME = /^[a-z][a-z0-9-]*$/u;
|
|
19498
|
-
const EXPORT_MESSAGE = "is exported, and nothing imports it. Every name that code outside a package can use exists only while something uses it, and fallow never reports what an entry exports as unused. Delete the subpath, or import it from the code that needs it.";
|
|
19499
19527
|
const COMMAND_MESSAGE = "is declared, and no task, workflow, hook or skill runs it. Every name that a caller outside a package can use exists only while something uses it. Delete the command, or run it from what needs it.";
|
|
19500
19528
|
const FLAG_MESSAGE = "is declared, and no task, workflow, hook or skill passes it. Every name that a caller outside a package can use exists only while something uses it. Delete the flag, or pass it from what needs it.";
|
|
19501
19529
|
const reachOf = ({ manifest }) => {
|
|
@@ -19510,18 +19538,14 @@ const workspaceOf$1 = Effect.fn("workspaceOf")(function* workspaceOf(root, direc
|
|
|
19510
19538
|
manifest: found
|
|
19511
19539
|
})));
|
|
19512
19540
|
});
|
|
19513
|
-
const specifiersOf = ({ name, exports }) => pipe(Option.fromUndefinedOr(name), Option.filter(() => Predicate.isNotUndefined(exports)), Option.map((own) => pipe(exportEntriesOf(exports), Array$1.map(([subpath]) => subpath), Array$1.filter((subpath) => subpath !== MANIFEST_SUBPATH && !String$1.includes(WILDCARD)(subpath)), Array$1.map((subpath) => String$1.replace(ROOT_SUBPATH$1, own)(subpath)))), Option.getOrElse(() => []));
|
|
19514
|
-
const imports = (specifier) => ({ text }) => pipe(QUOTES, Array$1.some((quote) => String$1.includes(`${specifier}${quote}`)(text)));
|
|
19515
|
-
const exportProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
19516
|
-
const importersOf = (specifier) => pipe(corpus, Array$1.filter(({ file }) => specifier !== manifest.name || !MANIFEST.test(file)));
|
|
19517
|
-
return pipe(specifiersOf(manifest), Array$1.filter((specifier) => !pipe(importersOf(specifier), Array$1.some(imports(specifier)))), Array$1.map((specifier) => problemInFile(EXPORT_RULE)(join(root, directory, PACKAGE_JSON_FILE), `${specifier} ${EXPORT_MESSAGE}`)));
|
|
19518
|
-
};
|
|
19519
19541
|
const declaredIn = (pattern) => (source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.map((name) => ({
|
|
19520
19542
|
name,
|
|
19521
19543
|
index: found.index ?? START$2,
|
|
19522
19544
|
source
|
|
19523
19545
|
})), Option.toArray)));
|
|
19524
|
-
const
|
|
19546
|
+
const runIn = (source) => pipe(Array$1.fromIterable(String$1.matchAll(RUN_COMMAND)(source.text)), Array$1.flatMap((found) => pipe(Option.fromUndefinedOr(found.groups), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19547
|
+
const isRoot$1 = ({ index, source }) => pipe(runIn(source), Array$1.some((binding) => new RegExp(`\\b${binding}\\s*=\\s*$`, "u").test(String$1.slice(START$2, index)(source.text))));
|
|
19548
|
+
const elsewhere = (corpus) => ({ source }) => pipe(corpus, Array$1.filter((text) => text.file !== source.file && !isTest(text)));
|
|
19525
19549
|
const passesFlag = (declared) => {
|
|
19526
19550
|
const passed = new RegExp(`--${declared.name}(?![\\w-])`, "u");
|
|
19527
19551
|
return ({ text }) => passed.test(text);
|
|
@@ -19531,7 +19555,7 @@ const runsCommand = (bins) => (declared) => {
|
|
|
19531
19555
|
return ({ text }) => pipe(runs, Array$1.some((run) => run.test(text)));
|
|
19532
19556
|
};
|
|
19533
19557
|
const commandFilesIn = (prefix, corpus) => pipe(corpus, Array$1.flatMap(({ file }) => pipe(Option.liftPredicate(file, String$1.startsWith(prefix)), Option.map(String$1.slice(prefix.length)), Option.flatMap(String$1.match(COMMAND_FILE)), Option.flatMap((found) => Option.fromUndefinedOr(found.groups)), Option.flatMap(Record.get(NAME_GROUP)), Option.toArray)));
|
|
19534
|
-
const uncalledIn = (root, join, corpus) => (sources, kind) => pipe(sources, Array$1.flatMap(declaredIn(kind.pattern)), Array$1.filter((
|
|
19558
|
+
const uncalledIn = (root, join, corpus) => (sources, kind) => pipe(sources, Array$1.flatMap(declaredIn(kind.pattern)), Array$1.filter((declared) => !Array$1.contains(kind.skipped, declared.name) && !kind.root(declared)), Array$1.filter((declared) => !pipe(elsewhere(corpus)(declared), Array$1.some(kind.calls(declared)))), Array$1.map((declared) => problemAtIndex(kind.rule)(join(root, declared.source.file), declared.source.text)(declared.index, `${kind.label(declared.name)} ${kind.message}`)));
|
|
19535
19559
|
const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
19536
19560
|
const prefix = `${directory}${SEPARATOR$3}`;
|
|
19537
19561
|
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);
|
|
@@ -19542,6 +19566,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
19542
19566
|
rule: COMMAND_RULE,
|
|
19543
19567
|
pattern: DECLARED_COMMAND,
|
|
19544
19568
|
skipped: bins,
|
|
19569
|
+
root: isRoot$1,
|
|
19545
19570
|
message: COMMAND_MESSAGE,
|
|
19546
19571
|
label: (name) => `The command ${name}`,
|
|
19547
19572
|
calls: runsCommand(bins)
|
|
@@ -19550,6 +19575,7 @@ const commandProblems = (root, join, corpus) => ({ directory, manifest }) => {
|
|
|
19550
19575
|
rule: FLAG_RULE,
|
|
19551
19576
|
pattern: DECLARED_FLAG,
|
|
19552
19577
|
skipped: [],
|
|
19578
|
+
root: () => false,
|
|
19553
19579
|
message: FLAG_MESSAGE,
|
|
19554
19580
|
label: (name) => `The flag --${name}`,
|
|
19555
19581
|
calls: passesFlag
|
|
@@ -19563,13 +19589,20 @@ const surfaceProblems = Effect.fn("surfaceProblems")(function* surfaceProblems(r
|
|
|
19563
19589
|
const corpus = [...yield* ownTexts(root), ...callers];
|
|
19564
19590
|
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$6 });
|
|
19565
19591
|
const workspaces = pipe(Array$1.getSomes(found), Array$1.filter((workspace) => reachOf(workspace) === reach));
|
|
19566
|
-
return [...pipe(workspaces, Array$1.flatMap(
|
|
19592
|
+
return [...pipe(workspaces, Array$1.flatMap((owner) => exportProblems({
|
|
19593
|
+
root,
|
|
19594
|
+
join: files.join,
|
|
19595
|
+
corpus,
|
|
19596
|
+
owner
|
|
19597
|
+
}))), ...pipe(workspaces, Array$1.flatMap(commandProblems(root, files.join, corpus)))];
|
|
19567
19598
|
});
|
|
19568
19599
|
/** @internal */
|
|
19569
19600
|
const checkSurfaceCallers = Effect.fn("checkSurfaceCallers")(function* checkSurfaceCallers(root) {
|
|
19601
|
+
const files = yield* RepositoryFiles;
|
|
19602
|
+
const skills = yield* textsUnder(files.join(root, INSTALLED_SKILLS$1), INSTALLED_SKILLS$1);
|
|
19570
19603
|
return yield* surfaceProblems(root, {
|
|
19571
19604
|
reach: "repository",
|
|
19572
|
-
callers:
|
|
19605
|
+
callers: skills
|
|
19573
19606
|
});
|
|
19574
19607
|
});
|
|
19575
19608
|
// src/features/check-unused-workspaces/model/unused-workspaces.ts
|