@shivaedev/quality 0.46.0 → 0.48.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 (124) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +6 -0
  3. package/dist/{biome → adapters/biome}/run.d.ts +1 -2
  4. package/dist/adapters/biome/run.d.ts.map +1 -0
  5. package/dist/{biome → adapters/biome}/run.js +1 -1
  6. package/dist/adapters/biome/run.js.map +1 -0
  7. package/dist/adapters/fixJsxConditionals.d.ts +3 -0
  8. package/dist/adapters/fixJsxConditionals.d.ts.map +1 -0
  9. package/dist/adapters/fixJsxConditionals.js +98 -0
  10. package/dist/adapters/fixJsxConditionals.js.map +1 -0
  11. package/dist/appViteConfig.d.ts +1 -0
  12. package/dist/appViteConfig.d.ts.map +1 -1
  13. package/dist/appViteConfig.js +1 -1
  14. package/dist/appViteConfig.js.map +1 -1
  15. package/dist/baseline/installDriver.d.ts +2 -1
  16. package/dist/baseline/installDriver.d.ts.map +1 -1
  17. package/dist/baseline/installDriver.js.map +1 -1
  18. package/dist/biome/recommendedRules.d.ts +2 -2
  19. package/dist/biome/recommendedRules.d.ts.map +1 -1
  20. package/dist/biome/recommendedRules.js +1 -1
  21. package/dist/biome/recommendedRules.js.map +1 -1
  22. package/dist/biome/report.d.ts +2 -1
  23. package/dist/biome/report.d.ts.map +1 -1
  24. package/dist/biome/report.js +6 -5
  25. package/dist/biome/report.js.map +1 -1
  26. package/dist/cli/args.d.ts +2 -1
  27. package/dist/cli/args.d.ts.map +1 -1
  28. package/dist/cli/args.js +2 -2
  29. package/dist/cli/args.js.map +1 -1
  30. package/dist/cli/fix.d.ts +2 -2
  31. package/dist/cli/fix.d.ts.map +1 -1
  32. package/dist/cli/fixRule.d.ts +5 -0
  33. package/dist/cli/fixRule.d.ts.map +1 -0
  34. package/dist/cli/fixRule.js +40 -0
  35. package/dist/cli/fixRule.js.map +1 -0
  36. package/dist/cli/messages.d.ts +1 -1
  37. package/dist/cli/messages.d.ts.map +1 -1
  38. package/dist/cli/messages.js +2 -1
  39. package/dist/cli/messages.js.map +1 -1
  40. package/dist/cli/program.d.ts.map +1 -1
  41. package/dist/cli/program.js +2 -1
  42. package/dist/cli/program.js.map +1 -1
  43. package/dist/cli/runMain.d.ts +3 -3
  44. package/dist/cli/runMain.d.ts.map +1 -1
  45. package/dist/cli/runMain.js.map +1 -1
  46. package/dist/cli/shrink.d.ts +3 -3
  47. package/dist/cli/shrink.d.ts.map +1 -1
  48. package/dist/cli/shrink.js.map +1 -1
  49. package/dist/engine/session.d.ts.map +1 -1
  50. package/dist/engine/session.js +1 -1
  51. package/dist/engine/session.js.map +1 -1
  52. package/dist/git/base.d.ts +2 -1
  53. package/dist/git/base.d.ts.map +1 -1
  54. package/dist/git/base.js +6 -6
  55. package/dist/git/base.js.map +1 -1
  56. package/dist/git/command.d.ts +2 -3
  57. package/dist/git/command.d.ts.map +1 -1
  58. package/dist/git/command.js +6 -6
  59. package/dist/git/command.js.map +1 -1
  60. package/dist/git/history.d.ts +2 -2
  61. package/dist/git/history.d.ts.map +1 -1
  62. package/dist/git/history.js.map +1 -1
  63. package/dist/hooks/forwarding.js +2 -2
  64. package/dist/hooks/location.js +3 -3
  65. package/dist/hooks/uninstall.js +2 -2
  66. package/dist/hooks/uninstall.js.map +1 -1
  67. package/dist/imports/withoutGenerated.d.ts +4 -2
  68. package/dist/imports/withoutGenerated.d.ts.map +1 -1
  69. package/dist/imports/withoutGenerated.js +22 -35
  70. package/dist/imports/withoutGenerated.js.map +1 -1
  71. package/dist/inventory/collect.d.ts +4 -3
  72. package/dist/inventory/collect.d.ts.map +1 -1
  73. package/dist/inventory/collect.js.map +1 -1
  74. package/dist/inventory/shadcnFolders.d.ts +4 -2
  75. package/dist/inventory/shadcnFolders.d.ts.map +1 -1
  76. package/dist/inventory/shadcnFolders.js.map +1 -1
  77. package/dist/inventory/trackedPaths.d.ts +5 -3
  78. package/dist/inventory/trackedPaths.d.ts.map +1 -1
  79. package/dist/inventory/trackedPaths.js +22 -24
  80. package/dist/inventory/trackedPaths.js.map +1 -1
  81. package/dist/inventory/walk.d.ts +5 -3
  82. package/dist/inventory/walk.d.ts.map +1 -1
  83. package/dist/inventory/walk.js +3 -9
  84. package/dist/inventory/walk.js.map +1 -1
  85. package/dist/manifests/sorted.d.ts +5 -3
  86. package/dist/manifests/sorted.d.ts.map +1 -1
  87. package/dist/manifests/sorted.js.map +1 -1
  88. package/dist/rules/builtIn.d.ts +2 -2
  89. package/dist/rules/imports/resolvable.d.ts +1 -1
  90. package/dist/rules/imports/resolvable.d.ts.map +1 -1
  91. package/dist/rules/imports/resolvable.js +4 -3
  92. package/dist/rules/imports/resolvable.js.map +1 -1
  93. package/dist/rules/suppressions/noIgnoreDeprecations.d.ts +1 -1
  94. package/dist/rules/suppressions/noIgnoreDeprecations.d.ts.map +1 -1
  95. package/package.json +2 -2
  96. package/src/{biome → adapters/biome}/run.ts +1 -1
  97. package/src/adapters/fixJsxConditionals.ts +116 -0
  98. package/src/appViteConfig.ts +3 -1
  99. package/src/baseline/installDriver.ts +6 -2
  100. package/src/biome/recommendedRules.ts +1 -1
  101. package/src/biome/report.ts +7 -6
  102. package/src/cli/args.ts +3 -3
  103. package/src/cli/fix.ts +1 -1
  104. package/src/cli/fixRule.ts +49 -0
  105. package/src/cli/messages.ts +2 -1
  106. package/src/cli/program.ts +2 -1
  107. package/src/cli/runMain.ts +4 -2
  108. package/src/cli/shrink.ts +4 -4
  109. package/src/engine/session.ts +4 -2
  110. package/src/git/base.ts +16 -13
  111. package/src/git/command.ts +10 -9
  112. package/src/git/history.ts +6 -2
  113. package/src/hooks/forwarding.ts +2 -2
  114. package/src/hooks/location.ts +3 -3
  115. package/src/hooks/uninstall.ts +2 -2
  116. package/src/imports/withoutGenerated.ts +25 -38
  117. package/src/inventory/collect.ts +4 -3
  118. package/src/inventory/shadcnFolders.ts +4 -2
  119. package/src/inventory/trackedPaths.ts +22 -24
  120. package/src/inventory/walk.ts +7 -11
  121. package/src/manifests/sorted.ts +4 -2
  122. package/src/rules/imports/resolvable.ts +4 -3
  123. package/dist/biome/run.d.ts.map +0 -1
  124. package/dist/biome/run.js.map +0 -1
@@ -2,7 +2,7 @@ export const USAGE = `Usage:
2
2
  quality lint [--config <file>]
3
3
  quality ci [--coverage]
4
4
  quality setup [--config <file>]
5
- quality fix [--config <file>]
5
+ quality fix [--config <file>] [--rule <id>]...
6
6
  quality exceptions migrate [--config <file>] [--from <registry>]
7
7
  quality baseline merge <ancestor> <current> <other>
8
8
  quality baseline install-driver
@@ -20,6 +20,7 @@ setup Install the Quality hook when the current folder owns a .git e
20
20
  lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
21
21
  or a baseline entry for an unknown rule.
22
22
  fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
23
+ With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.
23
24
  exceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.
24
25
  baseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.
25
26
  baseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.
@@ -5,6 +5,7 @@ import { parseCommand, USAGE } from "#cli/args.ts";
5
5
  import { writeBaseline } from "#cli/baseline.ts";
6
6
  import { ci } from "#cli/ci.ts";
7
7
  import { fix } from "#cli/fix.ts";
8
+ import { fixRule } from "#cli/fixRule.ts";
8
9
  import { lint } from "#cli/lint.ts";
9
10
  import { migrateBaseline } from "#cli/migrateBaseline.ts";
10
11
  import { migrateExceptions } from "#cli/migrateExceptions.ts";
@@ -38,7 +39,7 @@ export const program = Effect.fn("Cli.program")(function* (args: readonly string
38
39
  case "Lint":
39
40
  return yield* lint(cwd, command.config);
40
41
  case "Fix":
41
- return yield* fix(cwd, command.config);
42
+ return yield* command.rules.length === 0 ? fix(cwd, command.config) : fixRule(cwd, command.config, command.rules);
42
43
  case "BaselineMerge":
43
44
  return yield* mergeBaseline(command.base, command.ours, command.theirs);
44
45
  case "BaselineInstallDriver":
@@ -5,8 +5,8 @@ import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
5
5
  import * as NodePath from "@effect/platform-node/NodePath";
6
6
  import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
7
7
  import { Cause, Console, Effect, Exit, type FileSystem, Layer, Runtime } from "effect";
8
+ import type { ChildProcessSpawner } from "effect/process";
8
9
  import { SetupFailure } from "#failure.ts";
9
- import type { Git } from "#git/command.ts";
10
10
 
11
11
  const INTERRUPTED = 130;
12
12
  const COULD_NOT_RUN = 2;
@@ -54,7 +54,9 @@ export function explained<TValue, TError, TRequirements>(
54
54
  return Effect.tapCause(program, (cause) => (Cause.hasInterruptsOnly(cause) ? Effect.void : explain(cause)));
55
55
  }
56
56
 
57
- export function runMain<TValue, TError>(program: Effect.Effect<TValue, TError, FileSystem.FileSystem | Git>): void {
57
+ export function runMain<TValue, TError>(
58
+ program: Effect.Effect<TValue, TError, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner>,
59
+ ): void {
58
60
  quietOnClosedPipe(process.stdout);
59
61
  quietOnClosedPipe(process.stderr);
60
62
  NodeRuntime.runMain(Effect.provide(explained(program), services), { disableErrorReporting: true, teardown });
package/src/cli/shrink.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Console, Effect, type FileSystem } from "effect";
2
+ import type { ChildProcessSpawner } from "effect/process";
2
3
  import type { Scope } from "#baseline/update.ts";
3
4
  import type { SetupFailure } from "#failure.ts";
4
5
  import { resolveBase } from "#git/base.ts";
5
- import type { Git } from "#git/command.ts";
6
6
  import { changesSince } from "#git/history.ts";
7
7
  import { shrinkBaseline } from "./baseline.ts";
8
8
 
9
- function followedMoves(root: string, against: string | undefined): Effect.Effect<Scope, SetupFailure, Git> {
9
+ function followedMoves(root: string, against: string | undefined): Effect.Effect<Scope, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
10
10
  return resolveBase(root, against).pipe(
11
11
  Effect.flatMap((base) => changesSince(root, [base.commit])),
12
12
  Effect.map((changes): Scope => ({ moves: changes.moves })),
@@ -21,7 +21,7 @@ export function pruneBaseline(
21
21
  cwd: string,
22
22
  config: string | undefined,
23
23
  against: string | undefined,
24
- ): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | Git> {
24
+ ): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner> {
25
25
  return shrinkBaseline(cwd, config, (session) => followedMoves(session.config.root, against));
26
26
  }
27
27
 
@@ -29,6 +29,6 @@ export function tightenBaseline(
29
29
  cwd: string,
30
30
  config: string | undefined,
31
31
  staged: boolean,
32
- ): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | Git> {
32
+ ): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner> {
33
33
  return shrinkBaseline(cwd, config, (session) => changesSince(session.config.root, staged ? ["--cached"] : ["HEAD"]));
34
34
  }
@@ -23,9 +23,11 @@ export interface Session {
23
23
  }
24
24
 
25
25
  function setup<TValue, TRequirements>(
26
- effect: Effect.Effect<TValue, FilesystemFailure, TRequirements>,
26
+ effect: Effect.Effect<TValue, FilesystemFailure | SetupFailure, TRequirements>,
27
27
  ): Effect.Effect<TValue, SetupFailure, TRequirements> {
28
- return Effect.mapError(effect, (failure) => new SetupFailure({ cause: failure, message: failure.message }));
28
+ return Effect.mapError(effect, (failure) =>
29
+ failure instanceof SetupFailure ? failure : new SetupFailure({ cause: failure, message: failure.message }),
30
+ );
29
31
  }
30
32
 
31
33
  export const scan = Effect.fn("Engine.scan")(function* (
package/src/git/base.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Effect } from "effect";
2
+ import type { ChildProcessSpawner } from "effect/process";
2
3
  import { SetupFailure } from "#failure.ts";
3
- import { type Git, git } from "./command.ts";
4
+ import { run } from "./command.ts";
4
5
 
5
6
  export interface Base {
6
7
  readonly commit: string;
@@ -13,12 +14,14 @@ function fail(message: string) {
13
14
  return Effect.fail(new SetupFailure({ message }));
14
15
  }
15
16
 
16
- function isCommit(root: string, ref: string): Effect.Effect<boolean, SetupFailure, Git> {
17
- return Effect.map(git(root, ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`]), (result) => result.code === 0);
17
+ function isCommit(root: string, ref: string): Effect.Effect<boolean, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
18
+ return Effect.map(run(root, ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`]), (result) => result.code === 0);
18
19
  }
19
20
 
20
- const defaultBranch = Effect.fn("Git.defaultBranch")(function* (root: string): Effect.fn.Return<string, SetupFailure, Git> {
21
- const head = yield* git(root, ["symbolic-ref", "--quiet", "--short", "refs/remotes/origin/HEAD"]);
21
+ const defaultBranch = Effect.fn("Git.defaultBranch")(function* (
22
+ root: string,
23
+ ): Effect.fn.Return<string, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
24
+ const head = yield* run(root, ["symbolic-ref", "--quiet", "--short", "refs/remotes/origin/HEAD"]);
22
25
  if (head.code === 0) {
23
26
  return head.stdout.trim();
24
27
  }
@@ -32,15 +35,15 @@ const defaultBranch = Effect.fn("Git.defaultBranch")(function* (root: string): E
32
35
  );
33
36
  });
34
37
 
35
- function isShallow(root: string): Effect.Effect<boolean, SetupFailure, Git> {
36
- return Effect.map(git(root, ["rev-parse", "--is-shallow-repository"]), (result) => result.stdout.trim() === "true");
38
+ function isShallow(root: string): Effect.Effect<boolean, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
39
+ return Effect.map(run(root, ["rev-parse", "--is-shallow-repository"]), (result) => result.stdout.trim() === "true");
37
40
  }
38
41
 
39
- function mergeBase(root: string, ref: string): Effect.Effect<string | undefined, SetupFailure, Git> {
40
- return Effect.map(git(root, ["merge-base", "HEAD", ref]), (result) => (result.code === 0 ? result.stdout.trim() : undefined));
42
+ function mergeBase(root: string, ref: string): Effect.Effect<string | undefined, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
43
+ return Effect.map(run(root, ["merge-base", "HEAD", ref]), (result) => (result.code === 0 ? result.stdout.trim() : undefined));
41
44
  }
42
45
 
43
- function missingMergeBase(root: string, ref: string): Effect.Effect<never, SetupFailure, Git> {
46
+ function missingMergeBase(root: string, ref: string): Effect.Effect<never, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
44
47
  return Effect.flatMap(isShallow(root), (shallow) =>
45
48
  fail(
46
49
  shallow
@@ -50,15 +53,15 @@ function missingMergeBase(root: string, ref: string): Effect.Effect<never, Setup
50
53
  );
51
54
  }
52
55
 
53
- function reachMergeBase(root: string, ref: string): Effect.Effect<string, SetupFailure, Git> {
56
+ function reachMergeBase(root: string, ref: string): Effect.Effect<string, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
54
57
  return Effect.flatMap(mergeBase(root, ref), (found) => (found === undefined ? missingMergeBase(root, ref) : Effect.succeed(found)));
55
58
  }
56
59
 
57
60
  export const resolveBase = Effect.fn("Git.resolveBase")(function* (
58
61
  root: string,
59
62
  against: string | undefined,
60
- ): Effect.fn.Return<Base, SetupFailure, Git> {
61
- const inside = yield* git(root, ["rev-parse", "--is-inside-work-tree"]);
63
+ ): Effect.fn.Return<Base, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
64
+ const inside = yield* run(root, ["rev-parse", "--is-inside-work-tree"]);
62
65
  if (inside.code !== 0 || inside.stdout.trim() !== "true") {
63
66
  return yield* fail(`${root} is not in a git work tree; moves are followed through git history.`);
64
67
  }
@@ -8,10 +8,11 @@ export interface GitResult {
8
8
  readonly stdout: string;
9
9
  }
10
10
 
11
- export type Git = ChildProcessSpawner.ChildProcessSpawner;
12
-
13
- export function git(cwd: string, args: readonly string[]): Effect.Effect<GitResult, SetupFailure, Git> {
14
- return Effect.scoped(
11
+ export const run = Effect.fn("Git.run")(function* (
12
+ cwd: string,
13
+ args: readonly string[],
14
+ ): Effect.fn.Return<GitResult, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
15
+ return yield* Effect.scoped(
15
16
  Effect.gen(function* () {
16
17
  const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
17
18
  const child = yield* spawner.spawn(ChildProcess.make("git", [...args], { cwd, stdin: "ignore" }));
@@ -21,13 +22,13 @@ export function git(cwd: string, args: readonly string[]): Effect.Effect<GitResu
21
22
  );
22
23
  return { code: Number(code), stderr, stdout };
23
24
  }),
24
- ).pipe(Effect.mapError((error) => new SetupFailure({ cause: error, message: `cannot run git: ${error.message}` })));
25
- }
25
+ ).pipe(Effect.mapError((error) => new SetupFailure({ cause: error, message: `cannot run git in ${cwd}: ${error.message}` })));
26
+ });
26
27
 
27
- export function gitOrFail(cwd: string, args: readonly string[]): Effect.Effect<string, SetupFailure, Git> {
28
- return Effect.flatMap(git(cwd, args), (result) =>
28
+ export function gitOrFail(cwd: string, args: readonly string[]): Effect.Effect<string, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
29
+ return Effect.flatMap(run(cwd, args), (result) =>
29
30
  result.code === 0
30
31
  ? Effect.succeed(result.stdout)
31
- : Effect.fail(new SetupFailure({ message: `git ${args[0]} failed: ${result.stderr.trim() || `exit code ${result.code}`}` })),
32
+ : Effect.fail(new SetupFailure({ message: `git ${args[0]} exited ${result.code}: ${result.stderr.trim()}` })),
32
33
  );
33
34
  }
@@ -1,6 +1,7 @@
1
1
  import { Effect } from "effect";
2
+ import type { ChildProcessSpawner } from "effect/process";
2
3
  import type { SetupFailure } from "#failure.ts";
3
- import { type Git, gitOrFail } from "./command.ts";
4
+ import { gitOrFail } from "./command.ts";
4
5
 
5
6
  export interface Changes {
6
7
  readonly files: ReadonlySet<string>;
@@ -27,7 +28,10 @@ function parse(output: string): Changes {
27
28
  }
28
29
 
29
30
  // Paths are relative to the root, and only tracked files count: a move is seen once both of its sides are staged.
30
- export function changesSince(root: string, revision: readonly string[]): Effect.Effect<Changes, SetupFailure, Git> {
31
+ export function changesSince(
32
+ root: string,
33
+ revision: readonly string[],
34
+ ): Effect.Effect<Changes, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
31
35
  return Effect.map(
32
36
  gitOrFail(root, ["diff", "--no-color", "--no-ext-diff", "--find-renames", "--name-status", "-z", "--relative", ...revision, "--"]),
33
37
  parse,
@@ -1,7 +1,7 @@
1
1
  import { dirname, join } from "node:path";
2
2
  import { Effect, FileSystem } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
- import { git } from "#git/command.ts";
4
+ import { run } from "#git/command.ts";
5
5
  import { readOptionalText } from "#inventory/filesystem.ts";
6
6
  import { shellWords } from "./command.ts";
7
7
  import { isHookShim, OWNER } from "./shim.ts";
@@ -42,7 +42,7 @@ export function forwardingPath(file: string): string {
42
42
  }
43
43
 
44
44
  export const globalHooksPath = Effect.fn("Hooks.globalHooksPath")(function* (cwd: string) {
45
- const global = yield* git(cwd, ["config", "--global", "--includes", "--type=path", "--get", "core.hooksPath"]);
45
+ const global = yield* run(cwd, ["config", "--global", "--includes", "--type=path", "--get", "core.hooksPath"]);
46
46
  if (global.code !== 0 && global.code !== 1) {
47
47
  return yield* new SetupFailure({ message: `cannot read global core.hooksPath: ${global.stderr.trim()}` });
48
48
  }
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { Effect } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
- import { git } from "#git/command.ts";
4
+ import { run } from "#git/command.ts";
5
5
 
6
6
  export interface HookLocation {
7
7
  readonly file: string;
@@ -11,14 +11,14 @@ export interface HookLocation {
11
11
 
12
12
  // Hooks live in the common git directory, which every worktree of the repository shares.
13
13
  export const hookLocation = Effect.fn("Hooks.hookLocation")(function* (cwd: string) {
14
- const paths = yield* git(cwd, ["rev-parse", "--path-format=absolute", "--show-toplevel", "--git-common-dir"]);
14
+ const paths = yield* run(cwd, ["rev-parse", "--path-format=absolute", "--show-toplevel", "--git-common-dir"]);
15
15
  const [toplevel, common] = paths.stdout.trim().split("\n");
16
16
  if (paths.code !== 0 || toplevel === undefined || common === undefined) {
17
17
  return yield* new SetupFailure({
18
18
  message: `${cwd} is not in a git work tree, so there is no hook to manage.\nhelp: run quality from inside the repository, or run \`git init\` first.`,
19
19
  });
20
20
  }
21
- const hooksPath = yield* git(cwd, ["config", "--type=path", "--get", "core.hooksPath"]);
21
+ const hooksPath = yield* run(cwd, ["config", "--type=path", "--get", "core.hooksPath"]);
22
22
  const location: HookLocation = {
23
23
  file: join(common, "hooks", "pre-commit"),
24
24
  hooksPath: hooksPath.code === 0 ? hooksPath.stdout.trim() : undefined,
@@ -1,7 +1,7 @@
1
1
  import { dirname } from "node:path";
2
2
  import { Console, Effect, FileSystem } from "effect";
3
3
  import { SetupFailure } from "#failure.ts";
4
- import { git, gitOrFail } from "#git/command.ts";
4
+ import { gitOrFail, run } from "#git/command.ts";
5
5
  import { readOptionalText } from "#inventory/filesystem.ts";
6
6
  import { forwardingPath, removeForwarding } from "./forwarding.ts";
7
7
  import { hookLocation } from "./location.ts";
@@ -18,7 +18,7 @@ export const uninstallHook = Effect.fn("Hooks.uninstallHook")(function* (cwd: st
18
18
  return yield* Console.error(`quality: kept ${file}: it is not quality's pre-commit hook.`);
19
19
  }
20
20
  yield* Effect.mapError(fs.remove(file), (error) => new SetupFailure({ cause: error, message: `cannot remove ${file}: ${error.message}` }));
21
- const local = yield* git(cwd, ["config", "--local", "--get", "core.hooksPath"]);
21
+ const local = yield* run(cwd, ["config", "--local", "--get", "core.hooksPath"]);
22
22
  yield* removeForwarding(file).pipe(Effect.mapError((error) => new SetupFailure({ cause: error, message: error.message })));
23
23
  if ([dirname(file), forwardingPath(file)].includes(local.stdout.trim())) {
24
24
  yield* gitOrFail(cwd, ["config", "--local", "--unset-all", "core.hooksPath"]);
@@ -1,9 +1,10 @@
1
- import { execFile } from "node:child_process";
2
- import { posix } from "node:path";
3
- import { promisify } from "node:util";
1
+ import { basename, posix, relative } from "node:path";
2
+ import { Effect } from "effect";
3
+ import { SetupFailure } from "#failure.ts";
4
4
  import { emptyScope, type IgnoreScope, verdictFor, withIgnoreFile } from "#inventory/ignoreScope.ts";
5
+ import { trackedPaths } from "#inventory/trackedPaths.ts";
5
6
  import type { RuleInputs } from "#rule.ts";
6
- import type { ImportGraph, UnresolvedImport } from "./graph.ts";
7
+ import type { ImportGraph } from "./graph.ts";
7
8
 
8
9
  type Reader = Pick<RuleInputs, "readText" | "root">;
9
10
 
@@ -15,53 +16,37 @@ const TRAILING_SLASHES = /\/+$/u;
15
16
 
16
17
  const NODE_MODULES = "node_modules";
17
18
 
18
- const NOT_A_REPOSITORY = "not a git repository";
19
-
20
19
  const PLACEHOLDERS = new Set([".gitkeep", ".keep"]);
21
20
 
22
- const run = promisify(execFile);
23
-
24
- async function withIgnoreFileIn(reader: Reader, scope: IgnoreScope, directory: string): Promise<IgnoreScope> {
25
- const contents = await reader.readText(posix.join(directory, IGNORE_FILE));
21
+ const withIgnoreFileIn = Effect.fn("Imports.withIgnoreFileIn")(function* (reader: Reader, scope: IgnoreScope, directory: string) {
22
+ const contents = yield* Effect.promise(() => reader.readText(posix.join(directory, IGNORE_FILE)));
26
23
  return contents === undefined || contents === "" ? scope : withIgnoreFile(scope, posix.join(reader.root, directory), contents);
27
- }
24
+ });
28
25
 
29
- async function ignored(reader: Reader, file: string): Promise<boolean> {
26
+ const ignored = Effect.fn("Imports.ignored")(function* (reader: Reader, file: string) {
30
27
  const parts = file.split("/");
31
28
  let scope = emptyScope;
32
29
  for (const index of parts.keys()) {
33
- scope = await withIgnoreFileIn(reader, scope, parts.slice(0, index).join("/") || ".");
30
+ scope = yield* withIgnoreFileIn(reader, scope, parts.slice(0, index).join("/") || ".");
34
31
  if (verdictFor(scope, posix.join(reader.root, ...parts.slice(0, index + 1)), index < parts.length - 1) === "ignored") {
35
32
  return true;
36
33
  }
37
34
  }
38
35
  return false;
39
- }
40
-
41
- async function tracked(root: string, folder: string): Promise<readonly string[]> {
42
- try {
43
- const { stdout } = await run("git", ["ls-files", "-z", "--", folder], { cwd: root });
44
- return stdout.split("\0").filter(Boolean);
45
- } catch (error) {
46
- if (error instanceof Error && "stderr" in error && String(error.stderr).includes(NOT_A_REPOSITORY)) {
47
- return [];
48
- }
49
- throw error;
50
- }
51
- }
36
+ });
52
37
 
53
38
  function under(folder: string, path: string | undefined): boolean {
54
39
  return path?.startsWith(`${folder}/`) === true;
55
40
  }
56
41
 
57
- async function contentIssue(reader: Reader, folder: string, named: readonly string[]): Promise<string | undefined> {
58
- const verdicts = await Promise.all(named.map((file) => ignored(reader, file)));
42
+ const contentIssue = Effect.fn("Imports.contentIssue")(function* (reader: Reader, folder: string, named: readonly string[]) {
43
+ const verdicts = yield* Effect.forEach(named, (file) => ignored(reader, file), { concurrency: "unbounded" });
59
44
  if (verdicts.includes(false)) {
60
45
  return `"${folder}" is not ignored by git, so it holds source, not generated output`;
61
46
  }
62
- const kept = (await tracked(reader.root, folder)).find((file) => !PLACEHOLDERS.has(posix.basename(file)));
63
- return kept === undefined ? undefined : `"${folder}" holds files git tracks, such as ${kept}, so it is not generated output`;
64
- }
47
+ const kept = (yield* trackedPaths(reader.root, folder)).find((file) => !PLACEHOLDERS.has(basename(file)));
48
+ return kept === undefined ? undefined : `"${folder}" holds files git tracks, such as ${relative(reader.root, kept)}, so it is not generated output`;
49
+ });
65
50
 
66
51
  function placeIssue(graph: ImportGraph, folder: string): string | undefined {
67
52
  if (folder === "" || folder.startsWith("../") || posix.isAbsolute(folder)) {
@@ -75,21 +60,23 @@ function placeIssue(graph: ImportGraph, folder: string): string | undefined {
75
60
  : `"${folder}" holds no file that an import names`;
76
61
  }
77
62
 
78
- async function issueOf(reader: Reader, graph: ImportGraph, folder: string): Promise<string | undefined> {
63
+ const issueOf = Effect.fn("Imports.issueOf")(function* (reader: Reader, graph: ImportGraph, folder: string) {
79
64
  const misplaced = placeIssue(graph, folder);
80
65
  if (misplaced !== undefined) {
81
66
  return misplaced;
82
67
  }
83
68
  const named = [...new Set(graph.edges.flatMap((edge) => (edge.to.kind === "file" && under(folder, edge.to.path) ? [edge.to.path] : [])))];
84
- return await contentIssue(reader, folder, named);
85
- }
69
+ return yield* contentIssue(reader, folder, named);
70
+ });
86
71
 
87
72
  // A generated folder may be empty until its generator runs, so a relative import of a missing file in it resolves.
88
- export async function withoutGenerated(reader: Reader, graph: ImportGraph, declared: readonly string[]): Promise<readonly UnresolvedImport[]> {
73
+ export const withoutGenerated = Effect.fn("Imports.withoutGenerated")(function* (reader: Reader, graph: ImportGraph, declared: readonly string[]) {
89
74
  const folders = declared.map((folder) => posix.normalize(folder).replace(LEADING_DOT, "").replace(TRAILING_SLASHES, ""));
90
- const issues = (await Promise.all(folders.map((folder) => issueOf(reader, graph, folder)))).flatMap((issue) => issue ?? []);
75
+ const issues = (yield* Effect.forEach(folders, (folder) => issueOf(reader, graph, folder), { concurrency: "unbounded" })).flatMap(
76
+ (issue) => issue ?? [],
77
+ );
91
78
  if (issues.length > 0) {
92
- throw new Error(`the generated folders are invalid:\n${issues.map((issue) => ` - ${issue}`).join("\n")}`);
79
+ return yield* new SetupFailure({ message: `the generated folders are invalid:\n${issues.map((issue) => ` - ${issue}`).join("\n")}` });
93
80
  }
94
81
  return graph.unresolved.filter((request) => !folders.some((folder) => under(folder, request.missing)));
95
- }
82
+ });
@@ -1,8 +1,9 @@
1
1
  import { join, relative } from "node:path";
2
2
  import { Effect, FileSystem } from "effect";
3
3
  import ignore from "ignore";
4
+ import type { SetupFailure } from "#failure.ts";
4
5
  import { manifestsIn } from "#manifests/sorted.ts";
5
- import type { SourceFile } from "#rule.ts";
6
+ import type { RuleServices, SourceFile } from "#rule.ts";
6
7
  import { FilesystemFailure, orWhenAbsent, readRequiredText } from "./filesystem.ts";
7
8
  import { posix } from "./ignoreScope.ts";
8
9
  import { linesOf } from "./linesOf.ts";
@@ -26,7 +27,7 @@ const READ_CONCURRENCY = 16;
26
27
  const zoneFiles = Effect.fn("Inventory.zoneFiles")(function* (
27
28
  root: string,
28
29
  zone: string,
29
- ): Effect.fn.Return<readonly string[], FilesystemFailure, FileSystem.FileSystem> {
30
+ ): Effect.fn.Return<readonly string[], FilesystemFailure | SetupFailure, RuleServices> {
30
31
  const fs = yield* FileSystem.FileSystem;
31
32
  const path = join(root, zone);
32
33
  if (posix(relative(root, path)).startsWith("..")) {
@@ -46,7 +47,7 @@ function readSource(root: string, path: string): Effect.Effect<SourceFile, Files
46
47
  export const collectInventory = Effect.fn("Inventory.collectInventory")(function* (
47
48
  root: string,
48
49
  scope: InventoryScope,
49
- ): Effect.fn.Return<Inventory, FilesystemFailure, FileSystem.FileSystem> {
50
+ ): Effect.fn.Return<Inventory, FilesystemFailure | SetupFailure, RuleServices> {
50
51
  const excluded = ignore().add([...scope.exclude]);
51
52
  const toolOwned = yield* shadcnFolders(root);
52
53
  const zones = yield* Effect.forEach(scope.sources, (zone) => zoneFiles(root, zone), { concurrency: READ_CONCURRENCY });
@@ -1,5 +1,7 @@
1
1
  import { basename, dirname, relative } from "node:path";
2
- import { Effect, type FileSystem, Schema } from "effect";
2
+ import { Effect, Schema } from "effect";
3
+ import type { SetupFailure } from "#failure.ts";
4
+ import type { RuleServices } from "#rule.ts";
3
5
  import { FilesystemFailure, readRequiredText } from "./filesystem.ts";
4
6
  import { posix } from "./ignoreScope.ts";
5
7
  import { shadcnAlias } from "./shadcnAlias.ts";
@@ -9,7 +11,7 @@ const Components = Schema.fromJsonString(Schema.Struct({ aliases: Schema.Struct(
9
11
 
10
12
  export const shadcnFolders = Effect.fn("Inventory.shadcnFolders")(function* (
11
13
  root: string,
12
- ): Effect.fn.Return<readonly string[], FilesystemFailure, FileSystem.FileSystem> {
14
+ ): Effect.fn.Return<readonly string[], FilesystemFailure | SetupFailure, RuleServices> {
13
15
  const paths = (yield* walk(root)).filter((path) => basename(path) === "components.json");
14
16
  return yield* Effect.forEach(paths, (path) =>
15
17
  Effect.gen(function* () {
@@ -1,33 +1,31 @@
1
- import { execFile } from "node:child_process";
2
1
  import { join, resolve } from "node:path";
3
- import { promisify } from "node:util";
2
+ import { Effect } from "effect";
3
+ import { SetupFailure } from "#failure.ts";
4
+ import { run } from "#git/command.ts";
4
5
 
5
- const run = promisify(execFile);
6
-
7
- async function listedPaths(directory: string, options: readonly string[]): Promise<readonly string[] | undefined> {
8
- try {
9
- const { stdout } = await run("git", ["ls-files", "-z", ...options, "--", "."], { cwd: directory, maxBuffer: 2 ** 30 });
10
- return stdout
11
- .split("\0")
12
- .filter(Boolean)
13
- .map((path) => join(directory, path));
14
- } catch (error) {
15
- if (error instanceof Error && "stderr" in error && String(error.stderr).includes("not a git repository")) {
6
+ const listedPaths = Effect.fn("Inventory.listedPaths")(function* (directory: string, options: readonly string[], path = ".") {
7
+ const result = yield* run(directory, ["ls-files", "-z", ...options, "--", path]);
8
+ if (result.code !== 0) {
9
+ if (result.stderr.includes("not a git repository")) {
16
10
  return undefined;
17
11
  }
18
- throw error;
12
+ return yield* new SetupFailure({ message: `git ls-files exited ${result.code}: ${result.stderr.trim()}` });
19
13
  }
20
- }
14
+ return result.stdout
15
+ .split("\0")
16
+ .filter(Boolean)
17
+ .map((file) => join(directory, file));
18
+ });
21
19
 
22
- export async function trackedPaths(directory: string): Promise<readonly string[]> {
23
- return (await listedPaths(directory, [])) ?? [];
24
- }
20
+ export const trackedPaths = Effect.fn("Inventory.trackedPaths")(function* (directory: string, path = ".") {
21
+ return (yield* listedPaths(directory, [], path)) ?? [];
22
+ });
25
23
 
26
- export async function ignoredTrackedPaths(directory: string): Promise<readonly string[]> {
27
- return (await listedPaths(directory, ["--cached", "--ignored", "--exclude-standard"])) ?? [];
28
- }
24
+ export const ignoredTrackedPaths = Effect.fn("Inventory.ignoredTrackedPaths")(function* (directory: string) {
25
+ return (yield* listedPaths(directory, ["--cached", "--ignored", "--exclude-standard"])) ?? [];
26
+ });
29
27
 
30
- export async function ignoredPaths(directory: string): Promise<readonly string[] | undefined> {
31
- const paths = await listedPaths(directory, ["--others", "--ignored", "--exclude-standard", "--directory"]);
28
+ export const ignoredPaths = Effect.fn("Inventory.ignoredPaths")(function* (directory: string) {
29
+ const paths = yield* listedPaths(directory, ["--others", "--ignored", "--exclude-standard", "--directory"]);
32
30
  return paths?.map((path) => resolve(path));
33
- }
31
+ });
@@ -1,6 +1,8 @@
1
1
  import { dirname, join, relative, sep } from "node:path";
2
2
  import { Effect, FileSystem } from "effect";
3
- import { FilesystemFailure, orWhenAbsent, readOptionalText } from "./filesystem.ts";
3
+ import type { SetupFailure } from "#failure.ts";
4
+ import type { RuleServices } from "#rule.ts";
5
+ import { type FilesystemFailure, orWhenAbsent, readOptionalText } from "./filesystem.ts";
4
6
  import { emptyScope, type IgnoreScope, insideKept, verdictFor, withIgnoreFile } from "./ignoreScope.ts";
5
7
  import { ignoredPaths, trackedPaths } from "./trackedPaths.ts";
6
8
 
@@ -21,11 +23,8 @@ export function ignoreScopeAt(
21
23
  export const scopeAbove = Effect.fnUntraced(function* (
22
24
  root: string,
23
25
  dir: string,
24
- ): Effect.fn.Return<IgnoreScope, FilesystemFailure, FileSystem.FileSystem> {
25
- const ignored = yield* Effect.tryPromise({
26
- catch: (cause) => new FilesystemFailure({ message: `cannot list ignored files in ${dir}: ${String(cause)}`, path: dir }),
27
- try: () => ignoredPaths(dir),
28
- });
26
+ ): Effect.fn.Return<IgnoreScope, FilesystemFailure | SetupFailure, RuleServices> {
27
+ const ignored = yield* ignoredPaths(dir);
29
28
  if (ignored !== undefined) {
30
29
  return { ...emptyScope, ignored: new Set(ignored) };
31
30
  }
@@ -43,15 +42,12 @@ export const scopeAbove = Effect.fnUntraced(function* (
43
42
  export const walk = Effect.fnUntraced(function* (
44
43
  dir: string,
45
44
  inherited?: IgnoreScope,
46
- ): Effect.fn.Return<readonly string[], FilesystemFailure, FileSystem.FileSystem> {
45
+ ): Effect.fn.Return<readonly string[], FilesystemFailure | SetupFailure, RuleServices> {
47
46
  const fs = yield* FileSystem.FileSystem;
48
47
  if ((yield* orWhenAbsent<FileSystem.File.Info | undefined>(dir, fs.stat(dir), undefined)) === undefined) {
49
48
  return [];
50
49
  }
51
- const paths = yield* Effect.tryPromise({
52
- catch: (cause) => new FilesystemFailure({ message: `cannot list tracked files in ${dir}: ${String(cause)}`, path: dir }),
53
- try: () => trackedPaths(dir),
54
- });
50
+ const paths = yield* trackedPaths(dir);
55
51
  const tracked = new Set(paths);
56
52
  for (const path of paths) {
57
53
  for (let folder = dirname(path); folder !== dir && folder !== dirname(folder); folder = dirname(folder)) {
@@ -3,13 +3,15 @@ import { Effect, FileSystem } from "effect";
3
3
  import { sortPackageJson } from "sort-package-json";
4
4
  import { ManifestFailure, manifestEntry } from "#adapters/manifestInventory.ts";
5
5
  import { manifestReader } from "#adapters/manifestReader.ts";
6
+ import type { SetupFailure } from "#failure.ts";
6
7
  import { FilesystemFailure } from "#inventory/filesystem.ts";
7
8
  import { posix } from "#inventory/ignoreScope.ts";
8
9
  import { walk } from "#inventory/walk.ts";
10
+ import type { RuleServices } from "#rule.ts";
9
11
 
10
12
  export type Sorting = { readonly _tag: "Sorted" } | { readonly _tag: "Unsorted"; readonly sorted: string };
11
13
 
12
- export function manifestsIn(root: string): Effect.Effect<readonly string[], FilesystemFailure, FileSystem.FileSystem> {
14
+ export function manifestsIn(root: string): Effect.Effect<readonly string[], FilesystemFailure | SetupFailure, RuleServices> {
13
15
  return Effect.map(walk(root), (paths) =>
14
16
  paths
15
17
  .filter((path) => basename(path) === "package.json")
@@ -25,7 +27,7 @@ export function sortingOf(text: string): Sorting {
25
27
 
26
28
  export const sortManifests = Effect.fn("Manifests.sortManifests")(function* (
27
29
  root: string,
28
- ): Effect.fn.Return<number, FilesystemFailure | ManifestFailure, FileSystem.FileSystem> {
30
+ ): Effect.fn.Return<number, FilesystemFailure | ManifestFailure | SetupFailure, RuleServices> {
29
31
  const fs = yield* FileSystem.FileSystem;
30
32
  const manifests = yield* manifestsIn(root);
31
33
  const readText = yield* manifestReader(root);
@@ -8,15 +8,16 @@ const ResolvableOptions = Schema.Struct({
8
8
  });
9
9
 
10
10
  export const importsResolvable = defineRule({
11
- check: async ({ options, ...inputs }) => {
12
- const unresolved = await withoutGenerated(inputs, await importGraph(inputs), options.generated);
11
+ check: Effect.fn("Imports.check")(function* ({ options, ...inputs }) {
12
+ const graph = yield* Effect.promise(() => importGraph(inputs));
13
+ const unresolved = yield* withoutGenerated(inputs, graph, options.generated);
13
14
  return unresolved.map((request) => ({
14
15
  file: request.from,
15
16
  line: request.line,
16
17
  message: `Cannot resolve "${request.specifier}". Fix the path, install or declare the package, or declare the module in a .d.ts file among the sources.`,
17
18
  subject: request.specifier,
18
19
  }));
19
- },
20
+ }),
20
21
  description: "Every import resolves to a file, a package or a declared module, so no edge of the import graph goes unchecked.",
21
22
  id: "imports/resolvable",
22
23
  options: Schema.toStandardSchemaV1(ResolvableOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/biome/run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAKnE,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAID,eAAO,MAAM,QAAQ;;;;;;;;;iOA4BnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/biome/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQ3D,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,EAC5D,IAAY,EACZ,IAAuB,EACvB,UAAU,GAAoC,EAAE;IAEhD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAoC;QAClD;YACC,KAAK,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;YAC7E,MAAM,EAAE,kFAAkF;YAC1F,KAAK,EAAE,CAAC,sBAAsB,CAAC;SAC/B;KACD,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAC1B,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,CACvE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;QAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CACjC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,EAAE,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAClH,CAAC;QACF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAC/C,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EACpH,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC,CAAC,CACF,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}