@shivaedev/quality 0.55.0 → 0.56.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 (170) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +13 -13
  3. package/dist/adapters/ImportCompiler.d.ts +21 -0
  4. package/dist/adapters/ImportCompiler.d.ts.map +1 -0
  5. package/dist/adapters/ImportCompiler.js +22 -0
  6. package/dist/adapters/ImportCompiler.js.map +1 -0
  7. package/dist/adapters/imports/browserChecker.d.ts +3 -0
  8. package/dist/adapters/imports/browserChecker.d.ts.map +1 -0
  9. package/dist/adapters/imports/browserChecker.js +8 -0
  10. package/dist/adapters/imports/browserChecker.js.map +1 -0
  11. package/dist/adapters/imports/departures.d.ts +5 -0
  12. package/dist/adapters/imports/departures.d.ts.map +1 -0
  13. package/dist/adapters/imports/departures.js +61 -0
  14. package/dist/adapters/imports/departures.js.map +1 -0
  15. package/dist/adapters/imports/graph.d.ts +4 -0
  16. package/dist/adapters/imports/graph.d.ts.map +1 -0
  17. package/dist/adapters/imports/graph.js +44 -0
  18. package/dist/adapters/imports/graph.js.map +1 -0
  19. package/dist/adapters/imports/projects.d.ts.map +1 -0
  20. package/dist/adapters/imports/projects.js.map +1 -0
  21. package/dist/{imports → adapters/imports}/resolve.d.ts +3 -10
  22. package/dist/adapters/imports/resolve.d.ts.map +1 -0
  23. package/dist/{imports → adapters/imports}/resolve.js +1 -1
  24. package/dist/adapters/imports/resolve.js.map +1 -0
  25. package/dist/adapters/knip/entryPointFindings.d.ts +2 -1
  26. package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -1
  27. package/dist/adapters/knip/entryPointFindings.js +7 -6
  28. package/dist/adapters/knip/entryPointFindings.js.map +1 -1
  29. package/dist/adapters/knip/run.d.ts +1 -1
  30. package/dist/adapters/knip/run.d.ts.map +1 -1
  31. package/dist/adapters/knip/run.js +1 -1
  32. package/dist/adapters/knip/run.js.map +1 -1
  33. package/dist/adapters/rule.d.ts +9 -0
  34. package/dist/adapters/rule.d.ts.map +1 -0
  35. package/dist/adapters/rule.js +35 -0
  36. package/dist/adapters/rule.js.map +1 -0
  37. package/dist/adapters/standardSchema.d.ts.map +1 -0
  38. package/dist/adapters/standardSchema.js.map +1 -0
  39. package/dist/config/decode.d.ts +2 -2
  40. package/dist/config/decode.d.ts.map +1 -1
  41. package/dist/config/decode.js +3 -2
  42. package/dist/config/decode.js.map +1 -1
  43. package/dist/config/resolve.d.ts +2 -2
  44. package/dist/config/resolve.d.ts.map +1 -1
  45. package/dist/config/resolve.js +2 -1
  46. package/dist/config/resolve.js.map +1 -1
  47. package/dist/config.d.ts +5 -5
  48. package/dist/config.d.ts.map +1 -1
  49. package/dist/decoded.d.ts.map +1 -1
  50. package/dist/decoded.js +1 -1
  51. package/dist/decoded.js.map +1 -1
  52. package/dist/imports/Endpoint.d.ts +9 -0
  53. package/dist/imports/Endpoint.d.ts.map +1 -0
  54. package/dist/imports/Endpoint.js +2 -0
  55. package/dist/imports/Endpoint.js.map +1 -0
  56. package/dist/imports/browserGlobals.d.ts +2 -1
  57. package/dist/imports/browserGlobals.d.ts.map +1 -1
  58. package/dist/imports/browserGlobals.js +6 -9
  59. package/dist/imports/browserGlobals.js.map +1 -1
  60. package/dist/imports/departures.d.ts +3 -2
  61. package/dist/imports/departures.d.ts.map +1 -1
  62. package/dist/imports/departures.js +8 -61
  63. package/dist/imports/departures.js.map +1 -1
  64. package/dist/imports/fences/check.d.ts +3 -2
  65. package/dist/imports/fences/check.d.ts.map +1 -1
  66. package/dist/imports/fences/check.js +5 -4
  67. package/dist/imports/fences/check.js.map +1 -1
  68. package/dist/imports/fences/compilePolicy.js.map +1 -1
  69. package/dist/imports/fences/match.d.ts +1 -1
  70. package/dist/imports/fences/match.d.ts.map +1 -1
  71. package/dist/imports/fences/match.js.map +1 -1
  72. package/dist/imports/fences/reach.d.ts +1 -1
  73. package/dist/imports/fences/reach.d.ts.map +1 -1
  74. package/dist/imports/fences/vocabulary.d.ts +1 -1
  75. package/dist/imports/fences/vocabulary.d.ts.map +1 -1
  76. package/dist/imports/graph.d.ts +4 -3
  77. package/dist/imports/graph.d.ts.map +1 -1
  78. package/dist/imports/graph.js +17 -55
  79. package/dist/imports/graph.js.map +1 -1
  80. package/dist/rule.d.ts +12 -8
  81. package/dist/rule.d.ts.map +1 -1
  82. package/dist/rule.js +8 -31
  83. package/dist/rule.js.map +1 -1
  84. package/dist/rules/effect/program.js +1 -1
  85. package/dist/rules/effect/program.js.map +1 -1
  86. package/dist/rules/imports/adminPaths.js +1 -1
  87. package/dist/rules/imports/adminPaths.js.map +1 -1
  88. package/dist/rules/imports/aliased.d.ts.map +1 -1
  89. package/dist/rules/imports/aliased.js +3 -2
  90. package/dist/rules/imports/aliased.js.map +1 -1
  91. package/dist/rules/imports/cycles.d.ts.map +1 -1
  92. package/dist/rules/imports/cycles.js +4 -3
  93. package/dist/rules/imports/cycles.js.map +1 -1
  94. package/dist/rules/imports/manifest.d.ts.map +1 -1
  95. package/dist/rules/imports/manifest.js +6 -5
  96. package/dist/rules/imports/manifest.js.map +1 -1
  97. package/dist/rules/imports/noTestCode.d.ts.map +1 -1
  98. package/dist/rules/imports/noTestCode.js +3 -2
  99. package/dist/rules/imports/noTestCode.js.map +1 -1
  100. package/dist/rules/imports/resolvable.js +1 -1
  101. package/dist/rules/imports/resolvable.js.map +1 -1
  102. package/dist/rules/imports/runtime.d.ts.map +1 -1
  103. package/dist/rules/imports/runtime.js +3 -2
  104. package/dist/rules/imports/runtime.js.map +1 -1
  105. package/dist/rules/stories/engine.d.ts.map +1 -1
  106. package/dist/rules/stories/engine.js +5 -4
  107. package/dist/rules/stories/engine.js.map +1 -1
  108. package/dist/rules/stories/engineOf.d.ts +1 -1
  109. package/dist/rules/stories/engineOf.d.ts.map +1 -1
  110. package/dist/rules/stories/globalRetries.js +1 -1
  111. package/dist/rules/stories/globalRetries.js.map +1 -1
  112. package/dist/rules/stories/noExpect.d.ts.map +1 -1
  113. package/dist/rules/stories/noExpect.js +4 -3
  114. package/dist/rules/stories/noExpect.js.map +1 -1
  115. package/dist/rules/stories/sources.d.ts +1 -1
  116. package/dist/rules/stories/sources.d.ts.map +1 -1
  117. package/dist/rules/stories/sources.js +1 -1
  118. package/dist/rules/stories/sources.js.map +1 -1
  119. package/dist/rules/stories/specs.d.ts.map +1 -1
  120. package/dist/rules/stories/specs.js +5 -4
  121. package/dist/rules/stories/specs.js.map +1 -1
  122. package/package.json +3 -3
  123. package/src/adapters/ImportCompiler.ts +30 -0
  124. package/src/adapters/imports/browserChecker.ts +8 -0
  125. package/src/adapters/imports/departures.ts +82 -0
  126. package/src/adapters/imports/graph.ts +48 -0
  127. package/src/{imports → adapters/imports}/resolve.ts +4 -7
  128. package/src/adapters/knip/entryPointFindings.ts +12 -9
  129. package/src/adapters/knip/run.ts +1 -1
  130. package/src/adapters/rule.ts +53 -0
  131. package/src/config/decode.ts +5 -4
  132. package/src/config/resolve.ts +7 -6
  133. package/src/config.ts +5 -5
  134. package/src/decoded.ts +1 -1
  135. package/src/imports/Endpoint.ts +3 -0
  136. package/src/imports/browserGlobals.ts +6 -10
  137. package/src/imports/departures.ts +9 -80
  138. package/src/imports/fences/check.ts +6 -5
  139. package/src/imports/fences/compilePolicy.ts +1 -1
  140. package/src/imports/fences/match.ts +1 -1
  141. package/src/imports/fences/reach.ts +1 -1
  142. package/src/imports/fences/vocabulary.ts +1 -1
  143. package/src/imports/graph.ts +25 -61
  144. package/src/rule.ts +20 -52
  145. package/src/rules/effect/program.ts +1 -1
  146. package/src/rules/imports/adminPaths.ts +1 -1
  147. package/src/rules/imports/aliased.ts +10 -7
  148. package/src/rules/imports/cycles.ts +4 -3
  149. package/src/rules/imports/manifest.ts +8 -5
  150. package/src/rules/imports/noTestCode.ts +12 -9
  151. package/src/rules/imports/resolvable.ts +1 -1
  152. package/src/rules/imports/runtime.ts +3 -2
  153. package/src/rules/stories/engine.ts +5 -4
  154. package/src/rules/stories/engineOf.ts +1 -1
  155. package/src/rules/stories/globalRetries.ts +1 -1
  156. package/src/rules/stories/noExpect.ts +4 -3
  157. package/src/rules/stories/sources.ts +1 -1
  158. package/src/rules/stories/specs.ts +5 -4
  159. package/dist/imports/projects.d.ts.map +0 -1
  160. package/dist/imports/projects.js.map +0 -1
  161. package/dist/imports/resolve.d.ts.map +0 -1
  162. package/dist/imports/resolve.js.map +0 -1
  163. package/dist/standardSchema.d.ts.map +0 -1
  164. package/dist/standardSchema.js.map +0 -1
  165. /package/dist/{imports → adapters/imports}/projects.d.ts +0 -0
  166. /package/dist/{imports → adapters/imports}/projects.js +0 -0
  167. /package/dist/{standardSchema.d.ts → adapters/standardSchema.d.ts} +0 -0
  168. /package/dist/{standardSchema.js → adapters/standardSchema.js} +0 -0
  169. /package/src/{imports → adapters/imports}/projects.ts +0 -0
  170. /package/src/{standardSchema.ts → adapters/standardSchema.ts} +0 -0
@@ -1,12 +1,13 @@
1
+ import { Effect } from "effect";
1
2
  import { importGraph } from "#imports/graph.ts";
2
- import type { Findings, RuleInputs } from "#rule.ts";
3
+ import type { RuleInputs } from "#rule.ts";
3
4
  import { compilePolicy } from "./compilePolicy.ts";
4
5
  import { discoverFences } from "./discover.ts";
5
6
  import type { Fence } from "./model.ts";
6
7
 
7
- export async function checkFences(inputs: RuleInputs, configured: readonly Fence[]): Promise<Findings> {
8
- const graph = await importGraph(inputs);
9
- const fences = [...configured, ...(await discoverFences(inputs, graph.packages))];
8
+ export const checkFences = Effect.fn("Imports.checkFences")(function* (inputs: RuleInputs, configured: readonly Fence[]) {
9
+ const graph = yield* importGraph(inputs);
10
+ const fences = [...configured, ...(yield* Effect.promise(() => discoverFences(inputs, graph.packages)))];
10
11
  const policy = compilePolicy(fences, { files: inputs.files, packages: graph.packages });
11
12
  return policy.flatMap((compiled) => compiled.evaluate(graph));
12
- }
13
+ });
@@ -1,6 +1,6 @@
1
+ import type { Endpoint } from "#imports/Endpoint.ts";
1
2
  import type { ImportEdge } from "#imports/graph.ts";
2
3
  import { packageNameOf } from "#imports/packageName.ts";
3
- import type { Endpoint } from "#imports/resolve.ts";
4
4
  import { type CompiledFence, compileFence, type FenceGraph } from "./evaluate.ts";
5
5
  import type { PolicyScope } from "./match.ts";
6
6
  import type { Chain, ExampleStep, Fence } from "./model.ts";
@@ -1,5 +1,5 @@
1
+ import type { Endpoint } from "#imports/Endpoint.ts";
1
2
  import { builtinName, packageNameOf } from "#imports/packageName.ts";
2
- import type { Endpoint } from "#imports/resolve.ts";
3
3
  import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
4
4
  import type { Selector } from "./model.ts";
5
5
 
@@ -1,5 +1,5 @@
1
+ import type { Endpoint } from "#imports/Endpoint.ts";
1
2
  import type { ImportEdge } from "#imports/graph.ts";
2
- import type { Endpoint } from "#imports/resolve.ts";
3
3
  import type { Matcher } from "./match.ts";
4
4
 
5
5
  export interface Reached<TMatch = unknown> {
@@ -1,4 +1,4 @@
1
- import type { Endpoint } from "#imports/resolve.ts";
1
+ import type { Endpoint } from "#imports/Endpoint.ts";
2
2
  import { type Compiler, holdsFiles, packageNamed, trimmed } from "./match.ts";
3
3
  import type { Selector } from "./model.ts";
4
4
 
@@ -1,12 +1,8 @@
1
- import { realpathSync } from "node:fs";
2
- import { join, posix } from "node:path";
3
- import ts from "typescript";
1
+ import { Effect } from "effect";
2
+ import { ImportCompiler } from "#adapters/ImportCompiler.ts";
4
3
  import type { Findings, RuleInputs, SourceFile } from "#rule.ts";
5
- import { parse } from "#rules/parse.ts";
6
- import { ambientModules } from "./ambient.ts";
7
- import { type ImportKind, type ImportRequest, importsOf } from "./extract.ts";
8
- import { type Project, projectsFor } from "./projects.ts";
9
- import { type Endpoint, isDeclarationFile, presumedTarget, resolveImport } from "./resolve.ts";
4
+ import type { Endpoint } from "./Endpoint.ts";
5
+ import type { ImportKind } from "./extract.ts";
10
6
  import { type WorkspacePackage, workspacePackages } from "./workspace.ts";
11
7
 
12
8
  export interface ImportEdge {
@@ -28,61 +24,29 @@ export interface ImportGraph {
28
24
  readonly unresolved: readonly UnresolvedImport[];
29
25
  }
30
26
 
31
- const QUERY = /\?.*$/u;
32
-
33
- const NO_MODULES =
34
- "the import graph covers no modules: the sources hold no TypeScript or JavaScript module. Point `sources` at the TypeScript or JavaScript code.";
35
-
36
- function relativeTarget(from: string, request: ImportRequest): string | undefined {
37
- const relative = request.kind === "path-reference" || request.specifier.startsWith("./") || request.specifier.startsWith("../");
38
- return relative ? posix.join(posix.dirname(from), request.specifier.replace(QUERY, "")) : undefined;
39
- }
40
-
41
- // A relative import or a package import of a missing file still names a path, so fences see it before its generator writes it.
42
- function missingTarget(root: string, from: string, request: ImportRequest, project: Project): string | undefined {
43
- const target = presumedTarget(root, request, join(root, from), project) ?? relativeTarget(from, request);
44
- return target === undefined || target.startsWith("../") ? undefined : target;
45
- }
46
-
47
- function walk(inputs: RuleInputs, root: string): Pick<ImportGraph, "configFindings" | "edges" | "modules" | "unresolved"> {
48
- const projectOf = projectsFor(root);
49
- const parsed = inputs.sources.flatMap((file) => {
50
- const syntax = parse(file);
51
- return syntax === undefined ? [] : [{ file, path: join(root, file.path), syntax }];
52
- });
53
- const ambient = ambientModules(parsed);
54
- const edges: ImportEdge[] = [];
55
- const unresolved: UnresolvedImport[] = [];
56
- for (const { file, path, syntax } of parsed) {
57
- const project = projectOf(path);
58
- syntax.impliedNodeFormat = ts.getImpliedNodeFormatForFile(path, undefined, ts.sys, project.options);
59
- for (const request of importsOf(syntax, isDeclarationFile(file.path), project.options)) {
60
- const to = resolveImport(root, ambient, request, path, project);
61
- if (to === undefined) {
62
- const missing = missingTarget(root, file.path, request, project);
63
- unresolved.push({ ...request, from: file.path, missing });
64
- edges.push(...(missing === undefined ? [] : [{ ...request, from: file.path, to: { kind: "file" as const, path: missing } }]));
65
- } else {
66
- edges.push({ ...request, from: file.path, to });
67
- }
68
- }
69
- }
70
- return { configFindings: projectOf.findings, edges, modules: parsed.map(({ file }) => file.path), unresolved };
71
- }
72
-
73
- async function build(inputs: RuleInputs): Promise<ImportGraph> {
74
- const walked = walk(inputs, realpathSync(inputs.root));
27
+ const build = Effect.fn("Imports.build")(function* (inputs: RuleInputs) {
28
+ const compiler = yield* ImportCompiler;
29
+ const walked = yield* compiler.graph(inputs);
75
30
  if (walked.modules.length === 0) {
76
- throw new Error(NO_MODULES);
31
+ return yield* Effect.die(
32
+ new Error(
33
+ "the import graph covers no modules: the sources hold no TypeScript or JavaScript module. Point `sources` at the TypeScript or JavaScript code.",
34
+ ),
35
+ );
77
36
  }
78
- return { ...walked, packages: await workspacePackages(inputs) };
79
- }
37
+ return { ...walked, packages: yield* Effect.promise(() => workspacePackages(inputs)) };
38
+ });
80
39
 
81
- const graphs = new WeakMap<readonly SourceFile[], Promise<ImportGraph>>();
40
+ type Graph = ReturnType<typeof build>;
41
+ const graphs = new WeakMap<readonly SourceFile[], Effect.Effect<ImportGraph, Effect.Error<Graph>>>();
82
42
 
83
43
  // Import rules run on one scan, so they share the graph built from its sources.
84
- export function importGraph(inputs: RuleInputs): Promise<ImportGraph> {
85
- const known = graphs.get(inputs.sources) ?? build(inputs);
86
- graphs.set(inputs.sources, known);
87
- return known;
88
- }
44
+ export const importGraph = Effect.fn("Imports.importGraph")(function* (inputs: RuleInputs) {
45
+ const known = graphs.get(inputs.sources);
46
+ if (known !== undefined) {
47
+ return yield* known;
48
+ }
49
+ const graph = yield* Effect.cached(build(inputs).pipe(Effect.provide(ImportCompiler.layer)));
50
+ graphs.set(inputs.sources, graph);
51
+ return yield* graph;
52
+ });
package/src/rule.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { Effect, type FileSystem } from "effect";
1
+ import type { Effect, FileSystem } from "effect";
2
2
  import type { ChildProcessSpawner } from "effect/process";
3
- import type { Bivariant } from "@shivaedev/types/Bivariant.ts";
4
- import { validOrFail } from "#decoded.ts";
3
+ import { configureWith, noOptions, type RuleCheckResult, ruleConfiguration } from "#adapters/rule.ts";
4
+ import type { StandardSchemaV1 } from "#adapters/standardSchema.ts";
5
5
  import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
6
- import { describeIssue, type StandardSchemaV1 } from "./standardSchema.ts";
7
6
 
8
7
  export interface Finding {
9
8
  readonly count?: number | undefined;
@@ -44,21 +43,25 @@ export type Configured<TServices = RuleServices> =
44
43
  | { readonly _tag: "Invalid"; readonly issues: readonly string[] }
45
44
  | { readonly _tag: "Ready"; readonly check: RuleCheck<TServices> };
46
45
 
47
- export interface Rule<TId extends string = string, TInput = unknown, TServices = RuleServices> {
48
- // Bivariance keeps rules with different options in one list; configure validates its input at runtime.
49
- configure: Bivariant<(options: TInput | undefined) => Promise<Configured<TServices>>>;
46
+ export interface RegisteredRule<TServices = RuleServices> {
50
47
  readonly description: string;
51
48
  readonly family?: boolean;
52
- readonly id: TId;
49
+ readonly id: string;
53
50
  readonly registrable?: boolean;
51
+ readonly [ruleConfiguration]: (options: unknown) => Promise<Configured<TServices>>;
52
+ }
53
+
54
+ export interface Rule<TId extends string = string, TInput = unknown, TServices = RuleServices> extends RegisteredRule<TServices> {
55
+ readonly configure: (options: TInput | undefined) => Promise<Configured<TServices>>;
56
+ readonly id: TId;
54
57
  }
55
58
 
56
59
  interface RuleDefinition<TId extends string, TOptions, TServices> {
57
- readonly check: (context: RuleContext<TOptions>) => Findings | PromiseLike<Findings> | Effect.Effect<Findings, unknown, TServices>;
60
+ readonly check: (context: RuleContext<NoInfer<TOptions>>) => RuleCheckResult<TServices>;
58
61
  readonly description: string;
59
62
  readonly id: TId;
60
63
  readonly registrable?: false;
61
- readonly validate?: (context: RuleContext<TOptions>) => readonly string[];
64
+ readonly validate?: (context: RuleContext<NoInfer<TOptions>>) => readonly string[];
62
65
  }
63
66
 
64
67
  interface RuleDefinitionWithOptions<TId extends string, TInput, TOptions, TServices> extends RuleDefinition<TId, TOptions, TServices> {
@@ -69,47 +72,6 @@ interface RuleDefinitionWithoutOptions<TId extends string, TServices> extends Ru
69
72
  readonly options?: undefined;
70
73
  }
71
74
 
72
- const noOptions: StandardSchemaV1<undefined, undefined> = {
73
- "~standard": {
74
- validate: (value) => (value === undefined ? { value: undefined } : { issues: [{ message: "this rule takes no options" }] }),
75
- vendor: "@shivaedev/quality",
76
- version: 1,
77
- },
78
- };
79
-
80
- function configureWith<TInput, TOptions, TServices>(
81
- schema: StandardSchemaV1<TInput, TOptions>,
82
- check: RuleDefinition<string, TOptions, TServices>["check"],
83
- id: string,
84
- absent: unknown,
85
- validate?: RuleDefinition<string, TOptions, TServices>["validate"],
86
- ) {
87
- return async (options: unknown): Promise<Configured<TServices>> => {
88
- const result = await schema["~standard"].validate(options ?? absent);
89
- if (result.issues !== undefined) {
90
- return { _tag: "Invalid", issues: result.issues.map(describeIssue) };
91
- }
92
- const value = result.value;
93
- return {
94
- _tag: "Ready",
95
- check: (inputs) =>
96
- Effect.scoped(
97
- Effect.gen(function* () {
98
- const context = { ...inputs, options: value };
99
- const issues = validate?.(context).map((issue) => `rules.${id}.options: ${issue}`) ?? [];
100
- yield* validOrFail(
101
- inputs.configFile ?? "quality.config.ts",
102
- issues.length === 0 ? { _tag: "Valid", value: undefined } : { _tag: "Invalid", issues },
103
- );
104
- const signal = yield* Effect.abortSignal;
105
- const checked = check({ ...inputs, options: value, signal });
106
- return yield* Effect.isEffect(checked) ? checked : Effect.promise(() => Promise.resolve(checked));
107
- }),
108
- ),
109
- };
110
- };
111
- }
112
-
113
75
  export function defineRule<const TId extends string, TInput, TOptions, TServices = never>(
114
76
  definition: RuleDefinitionWithOptions<TId, TInput, TOptions, TServices>,
115
77
  ): Rule<TId, TInput, TServices>;
@@ -123,5 +85,11 @@ export function defineRule<const TId extends string, TInput, TOptions, TServices
123
85
  definition.options === undefined
124
86
  ? configureWith(noOptions, definition.check, definition.id, undefined, definition.validate)
125
87
  : configureWith(definition.options, definition.check, definition.id, {}, definition.validate);
126
- return { configure, description: definition.description, id: definition.id, registrable: definition.registrable ?? true };
88
+ return {
89
+ [ruleConfiguration]: configure,
90
+ configure,
91
+ description: definition.description,
92
+ id: definition.id,
93
+ registrable: definition.registrable ?? true,
94
+ };
127
95
  }
@@ -1,6 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import ts from "typescript";
3
- import { projectsFor } from "#imports/projects.ts";
3
+ import { projectsFor } from "#adapters/imports/projects.ts";
4
4
  import type { RuleInputs } from "#rule.ts";
5
5
 
6
6
  export function effectProgram(inputs: RuleInputs, externalTypes = true): ts.Program {
@@ -4,7 +4,7 @@ import { importGraph } from "#imports/graph.ts";
4
4
  import { defineRule } from "#rule.ts";
5
5
 
6
6
  export const adminPaths = defineRule({
7
- check: (inputs) => Effect.promise(() => importGraph(inputs)).pipe(Effect.map((graph) => adminFindings(graph, inputs.sources))),
7
+ check: (inputs) => importGraph(inputs).pipe(Effect.map((graph) => adminFindings(graph, inputs.sources))),
8
8
  description:
9
9
  "Admin-only source files live under an admin/ segment; member code cannot reach admin/ implementations. Registration and module composition may import admin registrations and declarations. Move the file to the folder named by the finding.",
10
10
  id: "imports/admin-paths",
@@ -1,3 +1,4 @@
1
+ import { Effect } from "effect";
1
2
  import { type Departure, departures } from "#imports/departures.ts";
2
3
  import { defineRule } from "#rule.ts";
3
4
 
@@ -13,13 +14,15 @@ function messageOf({ installed, specifier, workspace }: Departure): string {
13
14
  }
14
15
 
15
16
  export const importsAliased = defineRule({
16
- check: async (inputs) =>
17
- (await departures(inputs)).map((departure) => ({
18
- file: departure.file,
19
- line: departure.line,
20
- message: messageOf(departure),
21
- subject: departure.specifier,
22
- })),
17
+ check: (inputs) =>
18
+ Effect.map(departures(inputs), (found) =>
19
+ found.map((departure) => ({
20
+ file: departure.file,
21
+ line: departure.line,
22
+ message: messageOf(departure),
23
+ subject: departure.specifier,
24
+ })),
25
+ ),
23
26
  description:
24
27
  "A relative import names only a file in its own folder, except a module's client or server registration may import its own ./admin/ subtree. Every other import goes through an alias: the package.json `imports` of its package or another workspace package's name.",
25
28
  id: "imports/aliased",
@@ -1,3 +1,4 @@
1
+ import { Effect } from "effect";
1
2
  import { cyclicComponents } from "#imports/cyclicComponents.ts";
2
3
  import { type ImportEdge, importGraph } from "#imports/graph.ts";
3
4
  import { shortestPath } from "#imports/shortestPath.ts";
@@ -33,11 +34,11 @@ function findingOf(edges: readonly RuntimeEdge[], adjacency: ReadonlyMap<string,
33
34
  }
34
35
 
35
36
  export const importCycles = defineRule({
36
- check: async (inputs) => {
37
- const edges = (await importGraph(inputs)).edges.filter(isRuntime);
37
+ check: Effect.fn("Imports.check")(function* (inputs) {
38
+ const edges = (yield* importGraph(inputs)).edges.filter(isRuntime);
38
39
  const adjacency = runtimeAdjacency(edges);
39
40
  return cyclicComponents(adjacency).map((component) => findingOf(edges, adjacency, component));
40
- },
41
+ }),
41
42
  description: "Modules never import each other in a loop at runtime. A group of modules that reach one another counts once for each module in it.",
42
43
  id: "imports/cycles",
43
44
  registrable: false,
@@ -1,4 +1,5 @@
1
1
  import { posix } from "node:path";
2
+ import { Effect } from "effect";
2
3
  import { readPackageManifest } from "#adapters/manifestInventory.ts";
3
4
  import { type ImportGraph, importGraph } from "#imports/graph.ts";
4
5
  import { isTooling } from "#imports/isTooling.ts";
@@ -85,14 +86,16 @@ function undeclared(owner: WorkspacePackage, policy: ManifestDependencies | unde
85
86
  }
86
87
 
87
88
  export const importsManifest = defineRule({
88
- check: async (inputs) => {
89
- const graph = await importGraph(inputs);
89
+ check: Effect.fn("Imports.check")(function* (inputs) {
90
+ const graph = yield* importGraph(inputs);
90
91
  const root: WorkspacePackage | undefined =
91
- (await readPackageManifest(inputs.readText, "package.json")) === undefined ? undefined : { directory: ".", name: "." };
92
+ (yield* Effect.promise(() => readPackageManifest(inputs.readText, "package.json"))) === undefined ? undefined : { directory: ".", name: "." };
92
93
  const owners = [...graph.packages, ...(root === undefined ? [] : [root])];
93
94
  const workspace = new Map(graph.packages.map((owner) => [owner.name, owner.directory]));
94
95
  const policies = new Map(
95
- await Promise.all(owners.map(async (owner) => [owner, await manifestDependencies(inputs, owner, graph, workspace)] as const)),
96
+ yield* Effect.promise(() =>
97
+ Promise.all(owners.map(async (owner) => [owner, await manifestDependencies(inputs, owner, graph, workspace)] as const)),
98
+ ),
96
99
  );
97
100
  const runtime = new Set([...policies.values()].flatMap((policy) => [...policy.runtime]));
98
101
  const named = new Map(graph.packages.map((owner) => [owner.name, owner]));
@@ -112,7 +115,7 @@ export const importsManifest = defineRule({
112
115
  }
113
116
  return [{ file: request.from, line: request.line, message: undeclared(owner, policy, target.name, development), subject: target.name }];
114
117
  });
115
- },
118
+ }),
116
119
  description:
117
120
  "Workspace imports follow the importing package's manifest; devDependencies are available only outside runtime code, including export-blocked bundle inputs, and an application also reaches the dependencies of the entry points it declares: @shivaedev/platform for any code and @shivaedev/test-story for test code.",
118
121
  id: "imports/manifest",
@@ -1,17 +1,20 @@
1
+ import { Effect } from "effect";
1
2
  import { importGraph } from "#imports/graph.ts";
2
3
  import { isTestCode } from "#naming/testName.ts";
3
4
  import { defineRule } from "#rule.ts";
4
5
 
5
6
  export const noTestCode = defineRule({
6
- check: async (inputs) =>
7
- (await importGraph(inputs)).edges
8
- .filter((edge) => !isTestCode(edge.from) && edge.to.kind === "file" && isTestCode(edge.to.path))
9
- .map((edge) => ({
10
- file: edge.from,
11
- line: edge.line,
12
- message: `Imports test code through "${edge.specifier}". Move the shared code into a production module and import it from both production and tests.`,
13
- subject: edge.specifier,
14
- })),
7
+ check: (inputs) =>
8
+ Effect.map(importGraph(inputs), (graph) =>
9
+ graph.edges
10
+ .filter((edge) => !isTestCode(edge.from) && edge.to.kind === "file" && isTestCode(edge.to.path))
11
+ .map((edge) => ({
12
+ file: edge.from,
13
+ line: edge.line,
14
+ message: `Imports test code through "${edge.specifier}". Move the shared code into a production module and import it from both production and tests.`,
15
+ subject: edge.specifier,
16
+ })),
17
+ ),
15
18
  description: "Production modules import production code. Move shared code out of test files and test-support/ into a production module.",
16
19
  id: "imports/no-test-code",
17
20
  registrable: false,
@@ -9,7 +9,7 @@ const ResolvableOptions = Schema.Struct({
9
9
 
10
10
  export const importsResolvable = defineRule({
11
11
  check: Effect.fn("Imports.check")(function* ({ options, ...inputs }) {
12
- const graph = yield* Effect.promise(() => importGraph(inputs));
12
+ const graph = yield* importGraph(inputs);
13
13
  const unresolved = yield* withoutGenerated(inputs, graph, options.generated);
14
14
  return [
15
15
  ...graph.configFindings,
@@ -38,7 +38,7 @@ function runtimeFindings(graph: ImportGraph, runtime: (path: string) => Runtime
38
38
  export const importsRuntime = defineRule({
39
39
  check: (inputs) =>
40
40
  Effect.gen(function* () {
41
- const graph = yield* Effect.promise(() => importGraph(inputs));
41
+ const graph = yield* importGraph(inputs);
42
42
  const runtime = yield* runtimeOf(inputs, graph.packages);
43
43
  const imports = [...runtimeFindings(graph, runtime), ...inputs.sources.flatMap(nodePlatformBarrels)];
44
44
  const declarations = (yield* runtimeDeclarationProblems(inputs, graph.packages)).map(({ directory, message }) => ({
@@ -52,7 +52,8 @@ export const importsRuntime = defineRule({
52
52
  return [...imports, ...declarations];
53
53
  }
54
54
  const { browserGlobals } = yield* Effect.promise(() => import("#imports/browserGlobals.ts"));
55
- return [...imports, ...declarations, ...shared.flatMap(browserGlobals)];
55
+ const globals = yield* Effect.forEach(shared, browserGlobals);
56
+ return [...imports, ...declarations, ...globals.flat()];
56
57
  }),
57
58
  description:
58
59
  "Runtime folders define client, server and shared code. A manifest's quality.runtime declares a single-runtime package whole; executable packages without runtime folders and package-root tooling are server code. Production imports use @effect/platform-node module subpaths so its barrel does not load optional integrations.",
@@ -1,3 +1,4 @@
1
+ import { Effect } from "effect";
1
2
  import ts from "typescript";
2
3
  import { importGraph } from "#imports/graph.ts";
3
4
  import { packageOf } from "#imports/workspace.ts";
@@ -21,9 +22,9 @@ function ignoresEngine(call: ts.CallExpression, checker: ts.TypeChecker): boolea
21
22
  }
22
23
 
23
24
  export const storyEngine = defineRule({
24
- check: async (inputs) => {
25
- const graph = await importGraph(inputs);
26
- const exempt = await storyPrerequisites(inputs, graph.packages);
25
+ check: Effect.fn("Stories.check")(function* (inputs) {
26
+ const graph = yield* importGraph(inputs);
27
+ const exempt = yield* Effect.promise(() => storyPrerequisites(inputs, graph.packages));
27
28
  const origins = storyOrigins(inputs, graph);
28
29
  return inputs.sources.flatMap((file) => {
29
30
  const name = testName(file.path);
@@ -49,7 +50,7 @@ export const storyEngine = defineRule({
49
50
  message: `Declares a story without traits whose body never references its verbs, its story or its test context. Drive the engine through one of the kit's verbs or traits. If the code under test is pure, move the test to ${name.stem}.unit.${name.kind}${name.extension}, which reaches no engine and mocks nothing. See https://github.com/ShivaeDev/platform/tree/main/packages/quality#story-tests.`,
50
51
  }));
51
52
  });
52
- },
53
+ }),
53
54
  description:
54
55
  "A story without traits references its kit's verbs, its story or its test context; pure tests belong in .unit files that reach no engine and mock nothing.",
55
56
  id: "tests/story-engine",
@@ -1,4 +1,4 @@
1
- import type { Endpoint } from "#imports/resolve.ts";
1
+ import type { Endpoint } from "#imports/Endpoint.ts";
2
2
 
3
3
  const ENGINES: ReadonlyArray<readonly [string, readonly string[]]> = [
4
4
  ["the file system", ["node:fs"]],
@@ -21,7 +21,7 @@ function optionsOf(call: ts.CallExpression, origin: Origin): readonly ts.Express
21
21
  export const globalRetries = defineRule({
22
22
  check: (inputs) =>
23
23
  Effect.gen(function* () {
24
- const graph = yield* Effect.promise(() => importGraph(inputs));
24
+ const graph = yield* importGraph(inputs);
25
25
  const origins = storyOrigins(inputs, graph);
26
26
  const retry = retryOption(origins.checker);
27
27
  return inputs.sources.flatMap((file) => {
@@ -1,3 +1,4 @@
1
+ import { Effect } from "effect";
1
2
  import ts from "typescript";
2
3
  import { importGraph } from "#imports/graph.ts";
3
4
  import { isTestSupport } from "#naming/testName.ts";
@@ -35,17 +36,17 @@ function assertionsIn(source: ts.SourceFile): readonly ts.Node[] {
35
36
  }
36
37
 
37
38
  export const noExpect = defineRule({
38
- check: async (inputs) => {
39
+ check: Effect.fn("Stories.check")(function* (inputs) {
39
40
  const support = inputs.sources.filter((file) => isTestSupport(file.path));
40
41
  if (support.length === 0) {
41
42
  return [];
42
43
  }
43
- const graph = await importGraph(inputs);
44
+ const graph = yield* importGraph(inputs);
44
45
  const imported = new Set(graph.edges.flatMap((edge) => (edge.kind === "import" && edge.to.kind === "file" ? [edge.to.path] : [])));
45
46
  return support.flatMap((file) =>
46
47
  syntaxFindings(file, (source) => (!imported.has(file.path) && registersTests(source) ? [] : assertionsIn(source)), MESSAGE),
47
48
  );
48
- },
49
+ }),
49
50
  description: "Test-support performs actions and exposes observations; specs own expectations.",
50
51
  id: "tests/no-expect-in-support",
51
52
  });
@@ -8,7 +8,7 @@ import { storyOrigins } from "./origins.ts";
8
8
  import { storyPrerequisites } from "./prerequisites.ts";
9
9
 
10
10
  export const storySources = Effect.fn("Stories.storySources")(function* (inputs: RuleInputs) {
11
- const graph = yield* Effect.promise(() => importGraph(inputs));
11
+ const graph = yield* importGraph(inputs);
12
12
  const packages = graph.packages;
13
13
  const origins = storyOrigins(inputs, graph);
14
14
  const exempt = yield* Effect.promise(() => storyPrerequisites(inputs, packages));
@@ -1,3 +1,4 @@
1
+ import { Effect } from "effect";
1
2
  import ts from "typescript";
2
3
  import { importGraph } from "#imports/graph.ts";
3
4
  import { packageOf } from "#imports/workspace.ts";
@@ -57,9 +58,9 @@ function uncoveredRegistration(call: ts.CallExpression, originOf: OriginOf): boo
57
58
  }
58
59
 
59
60
  export const storySpecs = defineRule({
60
- check: async (inputs) => {
61
- const graph = await importGraph(inputs);
62
- const exempt = await storyPrerequisites(inputs, graph.packages);
61
+ check: Effect.fn("Stories.check")(function* (inputs) {
62
+ const graph = yield* importGraph(inputs);
63
+ const exempt = yield* Effect.promise(() => storyPrerequisites(inputs, graph.packages));
63
64
  const origins = storyOrigins(inputs, graph);
64
65
  const unit = unitTests(graph, inputs.sources);
65
66
  return inputs.sources.flatMap((file) => {
@@ -93,7 +94,7 @@ export const storySpecs = defineRule({
93
94
  },
94
95
  ];
95
96
  });
96
- },
97
+ }),
97
98
  description:
98
99
  "Every package tests its real engine through its own test-story kit, and a plain test lives only in a .unit file that reaches no engine and mocks nothing. Typecheck tests and the test-story, test and types packages need no kit.",
99
100
  id: "tests/story-specs",
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/imports/projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,eAAe,CAAC;CAC1C;AA0FD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAuCvG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/imports/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAkB5B,MAAM,MAAM,GAAG,eAAe,CAAC;AAE/B,SAAS,iBAAiB,CAAC,OAA2B,EAAE,YAAqB;IAC5E,OAAO;QACN,GAAG,OAAO;QACV,eAAe,EAAE,CAAC,YAAY;KAC9B,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAAY,EAAE,MAAiC;IACjE,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,IAAI;QAClC,OAAO,EAAE,IA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AAK,CAAC,CAAC;QAC5D,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC3B,OAAO,OAAO,CAAC;IAChB,CAAC,EACD,EAAE,QAAQ,EAAE,CACZ,CAAC;AACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/imports/resolve.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,QAAQ,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AA8BvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AA8BD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOvH;AAYD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAY1I"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/imports/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO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