@r_masseater/msch 0.72.0 → 0.74.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.
Files changed (39) hide show
  1. package/dist/changed.mjs +3 -3
  2. package/dist/cli.mjs +161 -266
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/config.d.mts +1 -1
  5. package/dist/{dependencies-C3kCe35Q.mjs → dependencies-BAjtDvY4.mjs} +27 -55
  6. package/dist/dependencies-BAjtDvY4.mjs.map +1 -0
  7. package/dist/exits.mjs +1 -1
  8. package/dist/{index-CWZNFtdG.d.mts → index-CHxAqDok.d.mts} +3 -6
  9. package/dist/lint-rules.mjs +2 -2
  10. package/dist/lint-rules.mjs.map +1 -1
  11. package/dist/{manifest-texts-K650kDy8.mjs → manifest-texts-CfnH7ifu.mjs} +4 -6
  12. package/dist/manifest-texts-CfnH7ifu.mjs.map +1 -0
  13. package/dist/{pass-records-kbx5VgwI.mjs → pass-records-DylVXWk1.mjs} +5 -4
  14. package/dist/pass-records-DylVXWk1.mjs.map +1 -0
  15. package/dist/publish.mjs +45 -135
  16. package/dist/publish.mjs.map +1 -1
  17. package/dist/{published-CpfXkChq.mjs → published-Bj0gR5IF.mjs} +27 -91
  18. package/dist/published-Bj0gR5IF.mjs.map +1 -0
  19. package/dist/published.mjs +9 -9
  20. package/dist/published.mjs.map +1 -1
  21. package/dist/refs.mjs +1 -1
  22. package/dist/{runtime-Q9CzisOt.mjs → runtime-CFZ41rB0.mjs} +9 -2
  23. package/dist/runtime-CFZ41rB0.mjs.map +1 -0
  24. package/dist/wake.mjs +1 -1
  25. package/dist/workspace-manifest-CAVYfp66.mjs +8 -0
  26. package/dist/workspace-manifest-CAVYfp66.mjs.map +1 -0
  27. package/dist/workspace-settings.d.mts +1 -1
  28. package/dist/workspace-settings.mjs +8 -6
  29. package/dist/workspace-settings.mjs.map +1 -1
  30. package/package.json +9 -5
  31. package/dist/dependencies-C3kCe35Q.mjs.map +0 -1
  32. package/dist/export-subpaths-D6ZLYZGy.mjs +0 -17
  33. package/dist/export-subpaths-D6ZLYZGy.mjs.map +0 -1
  34. package/dist/manifest-texts-K650kDy8.mjs.map +0 -1
  35. package/dist/pass-records-kbx5VgwI.mjs.map +0 -1
  36. package/dist/published-CpfXkChq.mjs.map +0 -1
  37. package/dist/runtime-Q9CzisOt.mjs.map +0 -1
  38. package/dist/workspace-manifest-BC-1cRIJ.mjs +0 -20
  39. package/dist/workspace-manifest-BC-1cRIJ.mjs.map +0 -1
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as WorkspaceSettings } from "./index-CWZNFtdG.mjs";
1
+ import { a as WorkspaceSettings } from "./index-CHxAqDok.mjs";
2
2
  import { t as MarkdownOptions } from "./index-DEuWKkok.mjs";
3
3
  import { ToolSections } from "@r_masseater/vite-plus-adopt";
4
4
  import { UserConfig } from "vite-plus";
@@ -1,19 +1,13 @@
1
1
  import { n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-C2gVviac.mjs";
2
- import { n as WorkspaceUnreadable, t as workspaceManifest } from "./workspace-manifest-BC-1cRIJ.mjs";
3
- import { n as importSpecifierOf, t as exportEntriesOf } from "./export-subpaths-D6ZLYZGy.mjs";
4
- import { Array, Effect, Option, Order, Predicate, Record, Schema, String as String$1, pipe } from "effect";
5
- import { findWorkspaceProjectsNoCheck } from "@pnpm/workspace.projects-reader";
2
+ import { t as workspaceManifest } from "./workspace-manifest-CAVYfp66.mjs";
3
+ import { Array, Effect, Option, Order, Predicate, Record, String, pipe } from "effect";
4
+ import { findWorkspaceProjects } from "@r_masseater/kestrion/pnpm";
5
+ import { PACKAGE_JSON_FILE, ROOT_SUBPATH, SUBPATH_PREFIX, exportEntriesOf, importSpecifierOf } from "@r_masseater/kestrion";
6
+ import { decodePackageJson } from "@r_masseater/kestrion/npm";
6
7
  // src/entities/workspace/model/workspace-projects.ts
7
- const MANIFEST_FILE$1 = "package.json";
8
8
  const ROOT_DIRECTORY = "";
9
- const byDirectory = Order.mapInput(String$1.Order, ({ directory }) => directory);
10
- const projectsMatching = (root, patterns) => Effect.tryPromise({
11
- try: () => findWorkspaceProjectsNoCheck(root, { patterns: [...patterns] }),
12
- catch: (cause) => WorkspaceUnreadable.make({
13
- root,
14
- reason: String(cause)
15
- })
16
- }).pipe(Effect.orElseSucceed(() => []));
9
+ const byDirectory = Order.mapInput(String.Order, ({ directory }) => directory);
10
+ const projectsMatching = (root, patterns) => findWorkspaceProjects(root, patterns).pipe(Effect.orElseSucceed(() => []));
17
11
  const workspacePatterns = Effect.fn("workspacePatterns")(function* workspacePatterns(root) {
18
12
  const manifest = yield* workspaceManifest(root);
19
13
  return pipe(manifest, Option.flatMap(({ packages }) => Option.fromNullishOr(packages)), Option.getOrElse(() => []));
@@ -27,11 +21,11 @@ const workspaceProjects = Effect.fn("workspaceProjects")(function* workspaceProj
27
21
  const found = pipe(projects, Array.map(({ rootDir, manifest: own }) => ({
28
22
  directory: files.relative(root, rootDir),
29
23
  packageName: Option.fromUndefinedOr(own.name),
30
- description: Option.filter(Option.fromUndefinedOr(own.description), String$1.isNonEmpty),
24
+ description: Option.filter(Option.fromUndefinedOr(own.description), String.isNonEmpty),
31
25
  published: own.private !== true,
32
26
  keywords: Option.getOrElse(Option.fromUndefinedOr(own.keywords), () => []),
33
27
  files: Option.fromUndefinedOr(own.files)
34
- })), Array.filter(({ directory }) => String$1.isNonEmpty(directory)));
28
+ })), Array.filter(({ directory }) => String.isNonEmpty(directory)));
35
29
  return Array.sort(found, byDirectory);
36
30
  });
37
31
  /** @internal */
@@ -39,21 +33,13 @@ const workspaceDirectories = Effect.fn("workspaceDirectories")(function* workspa
39
33
  const projects = yield* workspaceProjects(root);
40
34
  return pipe(projects, Array.map(({ directory }) => directory));
41
35
  });
42
- const Strings = Schema.Array(Schema.String);
43
- const RootManifest = Schema.fromJsonString(Schema.Struct({
44
- name: Schema.String,
45
- description: Schema.optional(Schema.String),
46
- private: Schema.optional(Schema.Boolean),
47
- keywords: Schema.optional(Strings),
48
- files: Schema.optional(Strings)
49
- }));
50
36
  const rootProject = Effect.fn("rootProject")(function* rootProject(root) {
51
37
  const files = yield* RepositoryFiles;
52
- const text = yield* files.readFile(files.join(root, MANIFEST_FILE$1));
53
- return pipe(text, Option.flatMap(Schema.decodeOption(RootManifest)), Option.map((own) => ({
38
+ const text = yield* files.readFile(files.join(root, PACKAGE_JSON_FILE));
39
+ return pipe(text, Option.flatMap(decodePackageJson), Option.filter((own) => Predicate.isNotUndefined(own.name)), Option.map((own) => ({
54
40
  directory: ROOT_DIRECTORY,
55
- packageName: Option.some(own.name),
56
- description: Option.filter(Option.fromUndefinedOr(own.description), String$1.isNonEmpty),
41
+ packageName: Option.fromUndefinedOr(own.name),
42
+ description: Option.filter(Option.fromUndefinedOr(own.description), String.isNonEmpty),
57
43
  published: own.private !== true,
58
44
  keywords: own.keywords ?? [],
59
45
  files: Option.fromUndefinedOr(own.files)
@@ -69,7 +55,7 @@ const MATCH_CONCURRENCY = 8;
69
55
  /** @internal */
70
56
  const unmatchedWorkspacePatterns = Effect.fn("unmatchedWorkspacePatterns")(function* unmatchedWorkspacePatterns(root) {
71
57
  const listed = yield* workspacePatterns(root);
72
- const patterns = pipe(listed, Array.filter((pattern) => !String$1.startsWith(NEGATION)(pattern)));
58
+ const patterns = pipe(listed, Array.filter((pattern) => !String.startsWith(NEGATION)(pattern)));
73
59
  const matched = yield* Effect.forEach(patterns, (pattern) => projectsMatching(root, [pattern]).pipe(Effect.map((projects) => ({
74
60
  pattern,
75
61
  matches: Array.isReadonlyArrayNonEmpty(projects)
@@ -77,19 +63,6 @@ const unmatchedWorkspacePatterns = Effect.fn("unmatchedWorkspacePatterns")(funct
77
63
  return pipe(matched, Array.filter(({ matches }) => !matches), Array.map(({ pattern }) => pattern));
78
64
  });
79
65
  // src/entities/package/model/dependencies.ts
80
- const DependencyMap = Schema.optional(Schema.Record(Schema.String, Schema.String));
81
- const PackageManifest = Schema.Struct({
82
- name: Schema.optional(Schema.String),
83
- dependencies: DependencyMap,
84
- devDependencies: DependencyMap,
85
- peerDependencies: DependencyMap,
86
- exports: Schema.optional(Schema.Unknown),
87
- types: Schema.optional(Schema.String),
88
- typings: Schema.optional(Schema.String),
89
- main: Schema.optional(Schema.String),
90
- native: Schema.optional(Schema.Unknown)
91
- });
92
- const MANIFEST_FILE = "package.json";
93
66
  const WORKSPACE_PROTOCOL = "workspace:";
94
67
  const WILDCARD = "*";
95
68
  const TYPES_CONDITION = "types";
@@ -102,10 +75,9 @@ const DECLARATIONS_SUFFIX = /\.d\.[cm]?ts$|\.[cm]?tsx?$/u;
102
75
  const SCRIPT_SUFFIX = /\.(?<module>[cm]?)js$/u;
103
76
  const readManifest = Effect.fn("readManifest")(function* readManifest(directory) {
104
77
  const files = yield* RepositoryFiles;
105
- const manifestText = yield* files.readFile(files.join(directory, MANIFEST_FILE));
106
- const text = yield* Effect.fromOption(manifestText);
107
- return yield* Schema.decodeEffect(Schema.fromJsonString(PackageManifest))(text);
108
- }, Effect.option);
78
+ const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
79
+ return pipe(text, Option.flatMap(decodePackageJson));
80
+ });
109
81
  const conditionsOf = (held) => {
110
82
  if (!Predicate.isObject(held)) return [];
111
83
  return Record.toEntries(held);
@@ -122,11 +94,11 @@ const anyConditionIn = (held, depth) => {
122
94
  return Array.findFirst(conditionsOf(held), ([, nested]) => anyConditionIn(nested, depth + DEPTH_STEP));
123
95
  };
124
96
  const targetPathsOf = (target) => Array.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);
125
- const isDeclaredSubpath = ([subpath]) => (subpath === "." || String$1.startsWith("./")(subpath)) && !String$1.includes(WILDCARD)(subpath);
97
+ const isDeclaredSubpath = ([subpath]) => (subpath === ROOT_SUBPATH || String.startsWith(SUBPATH_PREFIX)(subpath)) && !String.includes(WILDCARD)(subpath);
126
98
  const declarationsCandidateFor = (entryPath) => {
127
99
  if (DECLARATIONS_SUFFIX.test(entryPath)) return Option.some(entryPath);
128
100
  if (!SCRIPT_SUFFIX.test(entryPath)) return Option.none();
129
- return Option.some(String$1.replace(SCRIPT_SUFFIX, ".d.$<module>ts")(entryPath));
101
+ return Option.some(String.replace(SCRIPT_SUFFIX, ".d.$<module>ts")(entryPath));
130
102
  };
131
103
  const firstDeclarationsAmong = Effect.fn("firstDeclarationsAmong")(function* firstDeclarations(directory, entryPaths) {
132
104
  const files = yield* RepositoryFiles;
@@ -138,10 +110,10 @@ const firstDeclarationsAmong = Effect.fn("firstDeclarationsAmong")(function* fir
138
110
  });
139
111
  });
140
112
  const importNameOf = (packageName) => {
141
- if (!String$1.startsWith(TYPES_SCOPE)(packageName)) return packageName;
142
- const unscoped = String$1.slice(7)(packageName);
143
- if (!String$1.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) return unscoped;
144
- return `@${String$1.replace(TYPES_SCOPE_SEPARATOR, "/")(unscoped)}`;
113
+ if (!String.startsWith(TYPES_SCOPE)(packageName)) return packageName;
114
+ const unscoped = String.slice(7)(packageName);
115
+ if (!String.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) return unscoped;
116
+ return `@${String.replace(TYPES_SCOPE_SEPARATOR, "/")(unscoped)}`;
145
117
  };
146
118
  const rootEntryPaths = (manifest) => Array.getSomes([
147
119
  Option.fromUndefinedOr(manifest.types),
@@ -160,7 +132,7 @@ const entriesOfDependency = Effect.fn("entriesOfDependency")(function* entriesOf
160
132
  const manifest = yield* readManifest(directory);
161
133
  if (Option.isNone(manifest)) return [];
162
134
  const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);
163
- const rootSpecifier = importSpecifierOf(importNameOf(packageName), ".");
135
+ const rootSpecifier = importSpecifierOf(importNameOf(packageName), ROOT_SUBPATH);
164
136
  if (pipe(subpathEntries, Array.some((entry) => entry.specifier === rootSpecifier))) return subpathEntries;
165
137
  return [...(yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value))).pipe(Option.map((declarationsPath) => ({
166
138
  packageName,
@@ -168,7 +140,7 @@ const entriesOfDependency = Effect.fn("entriesOfDependency")(function* entriesOf
168
140
  declarationsPath
169
141
  })), Option.toArray), ...subpathEntries];
170
142
  });
171
- const isWorkspaceRange = String$1.startsWith(WORKSPACE_PROTOCOL);
143
+ const isWorkspaceRange = String.startsWith(WORKSPACE_PROTOCOL);
172
144
  const namesWhere = (keep, declared) => pipe(Record.toEntries(declared), Array.filter(([, range]) => keep(range)), Array.map(([packageName]) => packageName));
173
145
  const declaredDependencies = (manifest) => namesWhere((range) => !isWorkspaceRange(range), {
174
146
  ...manifest.dependencies,
@@ -187,6 +159,6 @@ const dependencyEntries = Effect.fn("dependencyEntries")(function* dependencyEnt
187
159
  const entries = yield* Effect.forEach(declaredDependencies(manifest.value), (packageName) => entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)), { concurrency: 1 });
188
160
  return Array.sort(Array.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier), entryOrder);
189
161
  });
190
- export { publishedProjects as a, workspaceProjects as c, workspaceDependencies as i, dependencyEntries as n, unmatchedWorkspacePatterns as o, readManifest as r, workspaceDirectories as s, MANIFEST_FILE as t };
162
+ export { unmatchedWorkspacePatterns as a, publishedProjects as i, readManifest as n, workspaceDirectories as o, workspaceDependencies as r, workspaceProjects as s, dependencyEntries as t };
191
163
 
192
- //# sourceMappingURL=dependencies-C3kCe35Q.mjs.map
164
+ //# sourceMappingURL=dependencies-BAjtDvY4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies-BAjtDvY4.mjs","names":["Str","Arr","Rec","Arr","Str"],"sources":["../src/entities/workspace/model/workspace-projects.ts","../src/entities/package/model/dependencies.ts"],"sourcesContent":["import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/kestrion/npm\";\nimport { findWorkspaceProjects } from \"@r_masseater/kestrion/pnpm\";\nimport type { Project } from \"@r_masseater/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Order, Predicate, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceManifest } from \"./workspace-manifest.ts\";\n\nconst ROOT_DIRECTORY = \"\";\n\nexport interface WorkspaceProject {\n readonly directory: string;\n readonly packageName: Option.Option<string>;\n readonly description: Option.Option<string>;\n readonly published: boolean;\n readonly keywords: readonly string[];\n readonly files: Option.Option<readonly string[]>;\n}\n\nconst byDirectory = Order.mapInput(Str.Order, ({ directory }: WorkspaceProject) => directory);\n\nconst projectsMatching = (\n root: string,\n patterns: readonly string[],\n): Effect.Effect<readonly Project[]> =>\n findWorkspaceProjects(root, patterns).pipe(Effect.orElseSucceed((): readonly Project[] => []));\n\nconst workspacePatterns = Effect.fn(\"workspacePatterns\")(function* workspacePatterns(root: string) {\n const manifest = yield* workspaceManifest(root);\n return pipe(\n manifest,\n Option.flatMap(({ packages }) => Option.fromNullishOr(packages)),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\n/** @internal */\nexport const workspaceProjects = Effect.fn(\"workspaceProjects\")(function* workspaceProjects(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const patterns = yield* workspacePatterns(root);\n if (!Arr.isReadonlyArrayNonEmpty(patterns)) {\n return [];\n }\n const projects = yield* projectsMatching(root, patterns);\n const found = pipe(\n projects,\n Arr.map(({ rootDir, manifest: own }): WorkspaceProject => ({\n directory: files.relative(root, rootDir),\n packageName: Option.fromUndefinedOr(own.name),\n description: Option.filter(Option.fromUndefinedOr(own.description), Str.isNonEmpty),\n published: own.private !== true,\n keywords: Option.getOrElse(Option.fromUndefinedOr(own.keywords), () => []),\n files: Option.fromUndefinedOr(own.files),\n })),\n Arr.filter(({ directory }) => Str.isNonEmpty(directory)),\n );\n return Arr.sort(found, byDirectory);\n});\n\n/** @internal */\nexport const workspaceDirectories = Effect.fn(\"workspaceDirectories\")(\n function* workspaceDirectories(root: string) {\n const projects = yield* workspaceProjects(root);\n return pipe(\n projects,\n Arr.map(({ directory }) => directory),\n );\n },\n);\n\nconst rootProject = Effect.fn(\"rootProject\")(function* rootProject(root: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, PACKAGE_JSON_FILE));\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.filter((own) => Predicate.isNotUndefined(own.name)),\n Option.map((own): WorkspaceProject => ({\n directory: ROOT_DIRECTORY,\n packageName: Option.fromUndefinedOr(own.name),\n description: Option.filter(Option.fromUndefinedOr(own.description), Str.isNonEmpty),\n published: own.private !== true,\n keywords: own.keywords ?? [],\n files: Option.fromUndefinedOr(own.files),\n })),\n );\n});\n\n/** @internal */\nexport const publishedProjects = Effect.fn(\"publishedProjects\")(function* publishedProjects(\n root: string,\n) {\n const [own, members] = yield* Effect.all([rootProject(root), workspaceProjects(root)], {\n concurrency: \"unbounded\",\n });\n return pipe(\n Option.toArray(own),\n Arr.appendAll(members),\n Arr.filter(({ published }) => published),\n );\n});\n\nconst NEGATION = \"!\";\nconst MATCH_CONCURRENCY = 8;\n\n/** @internal */\nexport const unmatchedWorkspacePatterns = Effect.fn(\"unmatchedWorkspacePatterns\")(\n function* unmatchedWorkspacePatterns(root: string) {\n const listed = yield* workspacePatterns(root);\n const patterns = pipe(\n listed,\n Arr.filter((pattern) => !Str.startsWith(NEGATION)(pattern)),\n );\n const matched = yield* Effect.forEach(\n patterns,\n (pattern) =>\n projectsMatching(root, [pattern]).pipe(\n Effect.map((projects) => ({ pattern, matches: Arr.isReadonlyArrayNonEmpty(projects) })),\n ),\n { concurrency: MATCH_CONCURRENCY },\n );\n return pipe(\n matched,\n Arr.filter(({ matches }) => !matches),\n Arr.map(({ pattern }) => pattern),\n );\n },\n);\n","import {\n PACKAGE_JSON_FILE,\n ROOT_SUBPATH,\n SUBPATH_PREFIX,\n exportEntriesOf,\n importSpecifierOf,\n} from \"@r_masseater/kestrion\";\nimport type { PackageJson } from \"@r_masseater/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/kestrion/npm\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles, NODE_MODULES } from \"#/shared/lib/repository-files.ts\";\n\nexport interface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nexport const readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));\n return pipe(text, Option.flatMap(decodePackageJson));\n});\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\nconst isDeclaredSubpath = ([subpath]: readonly [string, unknown]): boolean =>\n (subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)) &&\n !Str.includes(WILDCARD)(subpath);\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst rootEntryPaths = (manifest: PackageJson): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: PackageJson,\n) {\n const found = yield* Effect.forEach(\n pipe(exportEntriesOf(manifest.exports), Arr.filter(isDeclaredSubpath)),\n ([subpath, target]) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: importSpecifierOf(importNameOf(packageName), subpath),\n declarationsPath,\n })),\n ),\n ),\n { concurrency: 1 },\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = importSpecifierOf(importNameOf(packageName), ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst isWorkspaceRange = Str.startsWith(WORKSPACE_PROTOCOL);\n\nconst namesWhere = (\n keep: (range: string) => boolean,\n declared: Readonly<Record<string, string>>,\n): readonly string[] =>\n pipe(\n Rec.toEntries(declared),\n Arr.filter(([, range]) => keep(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst declaredDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere((range) => !isWorkspaceRange(range), {\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n });\n\nexport const workspaceDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere(isWorkspaceRange, { ...manifest.dependencies, ...manifest.devDependencies });\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nexport const dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(\n declaredDependencies(manifest.value),\n (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n { concurrency: 1 },\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n"],"mappings":";;;;;;;AAUA,MAAM,iBAAiB;AAWvB,MAAM,cAAc,MAAM,SAASA,OAAI,QAAQ,EAAE,gBAAkC,SAAS;AAE5F,MAAM,oBACJ,MACA,aAEA,sBAAsB,MAAM,QAAQ,CAAC,CAAC,KAAK,OAAO,oBAAwC,CAAC,CAAC,CAAC;AAE/F,MAAM,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBAAkB,MAAc;CACjG,MAAM,WAAW,OAAO,kBAAkB,IAAI;CAC9C,OAAO,KACL,UACA,OAAO,SAAS,EAAE,eAAe,OAAO,cAAc,QAAQ,CAAC,GAC/D,OAAO,gBAAmC,CAAC,CAAC,CAC9C;AACF,CAAC;;AAGD,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,MACA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,WAAW,OAAO,kBAAkB,IAAI;CAC9C,IAAI,CAACC,MAAI,wBAAwB,QAAQ,GACvC,OAAO,CAAC;CAEV,MAAM,WAAW,OAAO,iBAAiB,MAAM,QAAQ;CACvD,MAAM,QAAQ,KACZ,UACAA,MAAI,KAAK,EAAE,SAAS,UAAU,WAA6B;EACzD,WAAW,MAA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Aa,gBAAgB;CACrD,IAAI,OAAO,OAAO,QAAQ,GACxB,OAAO,CAAC;CAEV,MAAM,UAAU,OAAO,OAAO,QAC5B,qBAAqB,SAAS,KAAK,IAClC,gBACC,oBAAoB,aAAa,MAAM,KAAK,kBAAkB,cAAc,WAAW,CAAC,GAC1F,EAAE,aAAa,EAAE,CACnB;CACA,OAAOA,MAAI,KACTA,MAAI,WAAW,QAAQ,KAAK,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,SAAS,GAClF,UACF;AACF,CAAC"}
package/dist/exits.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { t as lookupReport } from "./lookup-report-Dp36RBaW.mjs";
3
- import { t as runCli } from "./runtime-Q9CzisOt.mjs";
3
+ import { t as runCli } from "./runtime-CFZ41rB0.mjs";
4
4
  import { n as upstreamExitsMet } from "./upstream-exits-Clnl4-G5.mjs";
5
5
  import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
6
6
  import { Array, Effect, Schema, pipe } from "effect";
@@ -1,10 +1,7 @@
1
1
  import { Context, Effect, FileSystem, Layer, Option, Path, Schema } from "effect";
2
+ import "@r_masseater/kestrion/pnpm";
2
3
  import { ChildProcessSpawner } from "effect/process";
3
- import "@pnpm/workspace.workspace-manifest-reader";
4
- import { readWantedLockfile } from "@pnpm/lockfile.fs";
5
- import "typescript/ast";
6
- import "typescript/ast/is";
7
- import "typescript/sync";
4
+ import "@r_masseater/kestrion";
8
5
  import { OxlintOverride } from "vite-plus/lint";
9
6
  interface WorkspaceTasks {
10
7
  readonly verify: readonly string[];
@@ -56,4 +53,4 @@ interface SettingsOptions {
56
53
  }
57
54
  declare const workspaceSettings: (options: SettingsOptions) => Promise<WorkspaceSettings>;
58
55
  export { WorkspaceSettings as a, DependencySets as c, WorkspaceTasks as d, WorkspaceLint as i, IgnoredDirectory as l, RuleSets as n, workspaceSettings as o, SettingsOptions as r, DependencyAllowance as s, RuleSet as t, ignoredDirectories as u };
59
- //# sourceMappingURL=index-CWZNFtdG.d.mts.map
56
+ //# sourceMappingURL=index-CHxAqDok.d.mts.map
@@ -120,12 +120,12 @@ const ECOSYSTEM_FILES = [
120
120
  {
121
121
  name: /^pnpm-workspace\.yaml$/u,
122
122
  format: "yaml",
123
- reader: "readWorkspaceManifest from @pnpm/workspace.workspace-manifest-reader, findWorkspaceProjects from @pnpm/workspace.projects-reader or updateWorkspaceManifest from @pnpm/workspace.workspace-manifest-writer"
123
+ reader: "readWorkspaceManifest, findWorkspaceProjects or updateWorkspaceManifest from @r_masseater/kestrion/pnpm, which run the @pnpm readers"
124
124
  },
125
125
  {
126
126
  name: /^pnpm-lock\.yaml$/u,
127
127
  format: "yaml",
128
- reader: "readWantedLockfile from @pnpm/lockfile.fs"
128
+ reader: "readWantedLockfile, lockedPackageIds or lockedGraph from @r_masseater/kestrion/pnpm, which run @pnpm/lockfile.fs"
129
129
  },
130
130
  {
131
131
  name: /^Cargo\.(?:toml|lock)$/u,