@codefast/cli 0.11.0 → 0.12.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 (222) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +57 -46
  3. package/dist/arrange/command.js +24 -25
  4. package/dist/arrange/domain/ast/collectors-cn.d.ts +2 -2
  5. package/dist/arrange/domain/ast/collectors-cn.js +2 -2
  6. package/dist/arrange/domain/ast/collectors-jsx.d.ts +2 -2
  7. package/dist/arrange/domain/ast/collectors-jsx.js +1 -1
  8. package/dist/arrange/domain/ast/collectors-tv.d.ts +2 -2
  9. package/dist/arrange/domain/ast/collectors-tv.js +5 -5
  10. package/dist/arrange/domain/ast/helpers.d.ts +2 -2
  11. package/dist/arrange/domain/ast/helpers.js +3 -4
  12. package/dist/arrange/domain/ast/simplify-targets.d.ts +1 -1
  13. package/dist/arrange/domain/ast/simplify-targets.js +5 -5
  14. package/dist/arrange/domain/ast/targets.d.ts +2 -2
  15. package/dist/arrange/domain/ast/targets.js +9 -9
  16. package/dist/arrange/domain/ast/translator.d.ts +1 -1
  17. package/dist/arrange/domain/ast/translator.js +1 -1
  18. package/dist/arrange/domain/constants.d.ts +1 -1
  19. package/dist/arrange/domain/grouping-service.d.ts +2 -2
  20. package/dist/arrange/domain/grouping-service.js +3 -3
  21. package/dist/arrange/domain/grouping.js +3 -3
  22. package/dist/arrange/domain/imports.d.ts +1 -1
  23. package/dist/arrange/domain/imports.js +2 -2
  24. package/dist/arrange/domain/source-text-formatters.js +1 -1
  25. package/dist/arrange/domain/tailwind-token.js +1 -1
  26. package/dist/arrange/domain/token-classifier.d.ts +1 -1
  27. package/dist/arrange/domain/token-classifier.js +2 -2
  28. package/dist/arrange/domain/types.d.ts +3 -3
  29. package/dist/arrange/group/cli-result.d.ts +1 -1
  30. package/dist/arrange/group/output.d.ts +1 -1
  31. package/dist/arrange/group/output.js +1 -1
  32. package/dist/arrange/group/suggest.d.ts +2 -2
  33. package/dist/arrange/group/suggest.js +2 -2
  34. package/dist/arrange/inspect/cli-result.d.ts +1 -1
  35. package/dist/arrange/inspect/domain/analyze-service.d.ts +2 -2
  36. package/dist/arrange/inspect/domain/analyze-service.js +7 -7
  37. package/dist/arrange/inspect/output.d.ts +1 -1
  38. package/dist/arrange/inspect/output.js +2 -2
  39. package/dist/arrange/inspect/run.d.ts +4 -4
  40. package/dist/arrange/inspect/run.js +6 -6
  41. package/dist/arrange/prepare.d.ts +4 -4
  42. package/dist/arrange/prepare.js +5 -5
  43. package/dist/arrange/regroup/cli-result.d.ts +1 -1
  44. package/dist/arrange/regroup/cli-result.js +1 -1
  45. package/dist/arrange/regroup/output.d.ts +2 -2
  46. package/dist/arrange/regroup/output.js +2 -2
  47. package/dist/arrange/regroup/process-file.d.ts +2 -2
  48. package/dist/arrange/regroup/process-file.js +3 -3
  49. package/dist/arrange/regroup/run.d.ts +5 -5
  50. package/dist/arrange/regroup/run.js +4 -4
  51. package/dist/arrange/resolve-target.d.ts +1 -1
  52. package/dist/arrange/resolve-target.js +2 -2
  53. package/dist/arrange/scan-target.d.ts +1 -1
  54. package/dist/arrange/scan-target.js +3 -3
  55. package/dist/arrange/simplify/cli-result.d.ts +1 -1
  56. package/dist/arrange/simplify/fold-targets.d.ts +3 -3
  57. package/dist/arrange/simplify/fold-targets.js +3 -3
  58. package/dist/arrange/simplify/output.d.ts +1 -1
  59. package/dist/arrange/simplify/output.js +1 -1
  60. package/dist/arrange/simplify/process-file.d.ts +3 -3
  61. package/dist/arrange/simplify/process-file.js +5 -5
  62. package/dist/arrange/simplify/run.d.ts +4 -4
  63. package/dist/arrange/simplify/run.js +4 -4
  64. package/dist/arrange/simplify/variant-classname-probe.js +1 -1
  65. package/dist/arrange/source-parse.d.ts +1 -1
  66. package/dist/arrange/source-parse.js +3 -3
  67. package/dist/audit/command.js +45 -28
  68. package/dist/audit/comments/cli-result.d.ts +1 -1
  69. package/dist/audit/comments/cli-result.js +1 -1
  70. package/dist/audit/comments/output.d.ts +1 -1
  71. package/dist/audit/comments/output.js +1 -1
  72. package/dist/audit/comments/prepare.d.ts +4 -4
  73. package/dist/audit/comments/prepare.js +1 -1
  74. package/dist/audit/comments/run.d.ts +4 -4
  75. package/dist/audit/comments/run.js +9 -9
  76. package/dist/audit/display-names/cli-result.d.ts +1 -1
  77. package/dist/audit/display-names/cli-result.js +1 -1
  78. package/dist/audit/display-names/domain/display-names.d.ts +1 -1
  79. package/dist/audit/display-names/output.d.ts +1 -1
  80. package/dist/audit/display-names/output.js +1 -1
  81. package/dist/audit/display-names/prepare.d.ts +4 -4
  82. package/dist/audit/display-names/prepare.js +1 -1
  83. package/dist/audit/display-names/run.d.ts +4 -4
  84. package/dist/audit/display-names/run.js +5 -5
  85. package/dist/audit/domain/types.d.ts +43 -0
  86. package/dist/audit/imports/cli-result.d.ts +1 -1
  87. package/dist/audit/imports/cli-result.js +1 -1
  88. package/dist/audit/imports/domain/import-policy.d.ts +1 -1
  89. package/dist/audit/imports/output.d.ts +1 -1
  90. package/dist/audit/imports/output.js +1 -1
  91. package/dist/audit/imports/prepare.d.ts +4 -4
  92. package/dist/audit/imports/prepare.js +1 -1
  93. package/dist/audit/imports/run.d.ts +4 -4
  94. package/dist/audit/imports/run.js +6 -6
  95. package/dist/audit/links/cli-result.d.ts +1 -1
  96. package/dist/audit/links/cli-result.js +1 -1
  97. package/dist/audit/links/domain/markdown-links.d.ts +3 -3
  98. package/dist/audit/links/domain/markdown-links.js +22 -8
  99. package/dist/audit/links/output.d.ts +1 -1
  100. package/dist/audit/links/output.js +1 -1
  101. package/dist/audit/links/prepare.d.ts +4 -4
  102. package/dist/audit/links/prepare.js +1 -1
  103. package/dist/audit/links/run.d.ts +4 -4
  104. package/dist/audit/links/run.js +4 -4
  105. package/dist/audit/prepare.d.ts +4 -4
  106. package/dist/audit/prepare.js +4 -4
  107. package/dist/audit/publish/cli-result.d.ts +13 -0
  108. package/dist/audit/publish/cli-result.js +22 -0
  109. package/dist/audit/publish/cli-schema.d.ts +18 -0
  110. package/dist/audit/publish/cli-schema.js +12 -0
  111. package/dist/audit/publish/domain/legacy-subpath.d.ts +8 -0
  112. package/dist/audit/publish/domain/legacy-subpath.js +22 -0
  113. package/dist/audit/publish/output.d.ts +7 -0
  114. package/dist/audit/publish/output.js +24 -0
  115. package/dist/audit/publish/prepare.d.ts +16 -0
  116. package/dist/audit/publish/prepare.js +12 -0
  117. package/dist/audit/publish/run.d.ts +14 -0
  118. package/dist/audit/publish/run.js +62 -0
  119. package/dist/audit/rtl/cli-result.d.ts +1 -1
  120. package/dist/audit/rtl/cli-result.js +1 -1
  121. package/dist/audit/rtl/domain/audit-file.d.ts +1 -1
  122. package/dist/audit/rtl/domain/audit-file.js +2 -2
  123. package/dist/audit/rtl/domain/tokenize.d.ts +1 -1
  124. package/dist/audit/rtl/output.d.ts +1 -1
  125. package/dist/audit/rtl/output.js +1 -1
  126. package/dist/audit/rtl/prepare.d.ts +4 -4
  127. package/dist/audit/rtl/prepare.js +5 -5
  128. package/dist/audit/rtl/run.d.ts +4 -4
  129. package/dist/audit/rtl/run.js +4 -4
  130. package/dist/bin.js +1 -1
  131. package/dist/cli.js +5 -5
  132. package/dist/core/cli/command-pipeline.d.ts +4 -5
  133. package/dist/core/cli/command-pipeline.js +7 -7
  134. package/dist/core/cli/format-error.d.ts +1 -1
  135. package/dist/core/cli/resolve-root.d.ts +3 -3
  136. package/dist/core/cli/resolve-root.js +3 -3
  137. package/dist/core/cli/result-handle.d.ts +2 -2
  138. package/dist/core/cli/result-handle.js +4 -4
  139. package/dist/core/config/define-config.d.ts +1 -1
  140. package/dist/core/config/loader.d.ts +2 -2
  141. package/dist/core/config/loader.js +2 -2
  142. package/dist/core/config/warnings.js +1 -1
  143. package/dist/core/config.d.ts +4 -4
  144. package/dist/core/config.js +4 -4
  145. package/dist/core/filesystem/node.d.ts +1 -1
  146. package/dist/core/schema-parse.d.ts +2 -2
  147. package/dist/core/schema-parse.js +2 -2
  148. package/dist/core/workspace/markdown-walk.d.ts +1 -1
  149. package/dist/core/workspace/markdown-walk.js +1 -1
  150. package/dist/core/workspace/package-version.d.ts +1 -1
  151. package/dist/core/workspace/package-version.js +2 -2
  152. package/dist/core/workspace/resolver.d.ts +1 -1
  153. package/dist/core/workspace/resolver.js +5 -5
  154. package/dist/core/workspace/source-walk.d.ts +1 -1
  155. package/dist/core/workspace/source-walk.js +1 -1
  156. package/dist/core/workspace/typescript-walk.d.ts +1 -1
  157. package/dist/core/workspace/typescript-walk.js +1 -1
  158. package/dist/core/workspace/walk-files.d.ts +1 -1
  159. package/dist/core/workspace/walk-files.js +1 -1
  160. package/dist/index.d.ts +3 -3
  161. package/dist/index.js +2 -2
  162. package/dist/mirror/cli-result.d.ts +1 -1
  163. package/dist/mirror/cli-result.js +1 -1
  164. package/dist/mirror/cli-schema.d.ts +1 -1
  165. package/dist/mirror/command.js +7 -7
  166. package/dist/mirror/dist-filesystem-node.d.ts +2 -2
  167. package/dist/mirror/dist-filesystem-node.js +2 -2
  168. package/dist/mirror/domain/dirent-guard.d.ts +1 -1
  169. package/dist/mirror/domain/exports.d.ts +2 -2
  170. package/dist/mirror/domain/exports.js +1 -1
  171. package/dist/mirror/domain/types.d.ts +2 -2
  172. package/dist/mirror/output.d.ts +1 -1
  173. package/dist/mirror/output.js +2 -2
  174. package/dist/mirror/package-path.d.ts +3 -3
  175. package/dist/mirror/package-path.js +3 -3
  176. package/dist/mirror/prepare.d.ts +5 -5
  177. package/dist/mirror/prepare.js +4 -4
  178. package/dist/mirror/run.d.ts +6 -6
  179. package/dist/mirror/run.js +7 -7
  180. package/dist/mirror/supplement-exports.d.ts +1 -1
  181. package/dist/mirror/supplement-exports.js +2 -2
  182. package/dist/mirror/sync-workspace-package.d.ts +3 -3
  183. package/dist/mirror/sync-workspace-package.js +11 -14
  184. package/dist/mirror/write-exports.d.ts +2 -2
  185. package/dist/mirror/write-exports.js +3 -3
  186. package/dist/pack-slim/cli-result.d.ts +1 -1
  187. package/dist/pack-slim/cli-result.js +1 -1
  188. package/dist/pack-slim/command.js +9 -9
  189. package/dist/pack-slim/domain/transform.d.ts +22 -1
  190. package/dist/pack-slim/domain/transform.js +65 -8
  191. package/dist/pack-slim/output.d.ts +1 -1
  192. package/dist/pack-slim/output.js +1 -1
  193. package/dist/pack-slim/prepare.d.ts +3 -3
  194. package/dist/pack-slim/prepare.js +2 -2
  195. package/dist/pack-slim/run.d.ts +5 -5
  196. package/dist/pack-slim/run.js +5 -5
  197. package/dist/pack-slim/working-tree.d.ts +2 -2
  198. package/dist/pack-slim/working-tree.js +2 -2
  199. package/dist/tag/cli-result.d.ts +1 -1
  200. package/dist/tag/cli-result.js +1 -1
  201. package/dist/tag/cli-schema.d.ts +1 -1
  202. package/dist/tag/command.js +7 -7
  203. package/dist/tag/domain/skip-filter.d.ts +1 -1
  204. package/dist/tag/domain/skip-filter.js +1 -1
  205. package/dist/tag/domain/types.d.ts +1 -1
  206. package/dist/tag/domain/version-summary.d.ts +1 -1
  207. package/dist/tag/output.d.ts +1 -1
  208. package/dist/tag/output.js +1 -1
  209. package/dist/tag/prepare.d.ts +4 -4
  210. package/dist/tag/prepare.js +4 -4
  211. package/dist/tag/run.d.ts +4 -4
  212. package/dist/tag/run.js +7 -7
  213. package/dist/tag/target/candidates.d.ts +2 -2
  214. package/dist/tag/target/candidates.js +2 -2
  215. package/dist/tag/target/resolve-path.d.ts +1 -1
  216. package/dist/tag/target/runner.d.ts +2 -2
  217. package/dist/tag/target/runner.js +3 -3
  218. package/dist/tag/writer/since-writer.d.ts +2 -2
  219. package/dist/tag/writer/since-writer.js +1 -1
  220. package/dist/tag/writer/version-resolver.d.ts +1 -1
  221. package/dist/tag/writer/version-resolver.js +1 -1
  222. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
- import { DIRECTION_RESOLVED_VARIANT, PHYSICAL_SIDE_VARIANT, RTL_MAPPINGS, RTL_REVERSE_MAPPINGS, RTL_SWAP_MAPPINGS, RTL_TRANSLATE_X_MAPPINGS, SLIDE_PREFIXES, } from "#/audit/rtl/domain/mappings";
2
- import { collectTokens } from "#/audit/rtl/domain/tokenize";
1
+ import { DIRECTION_RESOLVED_VARIANT, PHYSICAL_SIDE_VARIANT, RTL_MAPPINGS, RTL_REVERSE_MAPPINGS, RTL_SWAP_MAPPINGS, RTL_TRANSLATE_X_MAPPINGS, SLIDE_PREFIXES, } from "#audit/rtl/domain/mappings";
2
+ import { collectTokens } from "#audit/rtl/domain/tokenize";
3
3
  /**
4
4
  * A token satisfies an "rtl companion" requirement when the same file has a
5
5
  * token whose variants include `rtl` and whose value matches. Variant order
@@ -1,4 +1,4 @@
1
- import type { RtlClassToken } from "#/audit/domain/types";
1
+ import type { RtlClassToken } from "#audit/domain/types";
2
2
  /**
3
3
  * Splits a class token into [variant, value, modifier], colon/slash-aware of
4
4
  * brackets and parens (arbitrary values like data-[side=left] or calc(...)).
@@ -1,4 +1,4 @@
1
- import type { RtlAuditResult } from "#/audit/domain/types";
1
+ import type { RtlAuditResult } from "#audit/domain/types";
2
2
  /**
3
3
  * Human-readable RTL audit report (matches the former packages/ui script shape).
4
4
  *
@@ -1,4 +1,4 @@
1
- import { logger } from "#/core/logger";
1
+ import { logger } from "#core/logger";
2
2
  /**
3
3
  * Human-readable RTL audit report (matches the former packages/ui script shape).
4
4
  *
@@ -1,7 +1,7 @@
1
- import type { AuditCommandPrelude } from "#/audit/prepare";
2
- import { AppError } from "#/core/errors";
3
- import type { Filesystem } from "#/core/filesystem/filesystem";
4
- import type { Result } from "#/core/result";
1
+ import type { AuditCommandPrelude } from "#audit/prepare";
2
+ import { AppError } from "#core/errors";
3
+ import type { Filesystem } from "#core/filesystem/filesystem";
4
+ import type { Result } from "#core/result";
5
5
  /**
6
6
  * Loads config and resolves the scan target for `audit rtl`.
7
7
  *
@@ -1,8 +1,8 @@
1
- import { resolveRepoRelativePath } from "#/audit/prepare";
2
- import { loadCodefastConfig } from "#/core/config";
3
- import { AppError, messageFrom } from "#/core/errors";
4
- import { err, ok } from "#/core/result";
5
- import { resolveProjectRoot } from "#/core/workspace/resolver";
1
+ import { resolveRepoRelativePath } from "#audit/prepare";
2
+ import { loadCodefastConfig } from "#core/config";
3
+ import { AppError, messageFrom } from "#core/errors";
4
+ import { err, ok } from "#core/result";
5
+ import { resolveProjectRoot } from "#core/workspace/resolver";
6
6
  /**
7
7
  * Loads config and resolves the scan target for `audit rtl`.
8
8
  *
@@ -1,7 +1,7 @@
1
- import type { RtlAuditResult } from "#/audit/domain/types";
2
- import { AppError } from "#/core/errors";
3
- import type { Filesystem } from "#/core/filesystem/filesystem";
4
- import type { Result } from "#/core/result";
1
+ import type { RtlAuditResult } from "#audit/domain/types";
2
+ import { AppError } from "#core/errors";
3
+ import type { Filesystem } from "#core/filesystem/filesystem";
4
+ import type { Result } from "#core/result";
5
5
  /**
6
6
  * Scans a target path for physical-direction Tailwind class violations.
7
7
  *
@@ -1,8 +1,8 @@
1
1
  import path from "node:path";
2
- import { auditFileContent } from "#/audit/rtl/domain/audit-file";
3
- import { AppError, messageFrom } from "#/core/errors";
4
- import { err, ok } from "#/core/result";
5
- import { walkTsxFiles } from "#/core/workspace/typescript-walk";
2
+ import { auditFileContent } from "#audit/rtl/domain/audit-file";
3
+ import { AppError, messageFrom } from "#core/errors";
4
+ import { err, ok } from "#core/result";
5
+ import { walkTsxFiles } from "#core/workspace/typescript-walk";
6
6
  /**
7
7
  * Scans a target path for physical-direction Tailwind class violations.
8
8
  *
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import process from "node:process";
3
- import { runCli } from "#/cli";
3
+ import { runCli } from "#cli";
4
4
  const code = await runCli(process.argv);
5
5
  process.exit(code);
package/dist/cli.js CHANGED
@@ -3,11 +3,11 @@ import path from "node:path";
3
3
  import process from "node:process";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { Command } from "commander";
6
- import { createArrangeCommand } from "#/arrange/command";
7
- import { createAuditCommand } from "#/audit/command";
8
- import { createMirrorCommand } from "#/mirror/command";
9
- import { createPackSlimCommand } from "#/pack-slim/command";
10
- import { createTagCommand } from "#/tag/command";
6
+ import { createArrangeCommand } from "#arrange/command";
7
+ import { createAuditCommand } from "#audit/command";
8
+ import { createMirrorCommand } from "#mirror/command";
9
+ import { createPackSlimCommand } from "#pack-slim/command";
10
+ import { createTagCommand } from "#tag/command";
11
11
  function readVersion() {
12
12
  try {
13
13
  const dir = path.dirname(fileURLToPath(import.meta.url));
@@ -1,9 +1,9 @@
1
1
  import type { Command } from "commander";
2
2
  import type { ZodType } from "zod";
3
- import type { GlobalCliOptions } from "#/core/cli/global-options";
4
- import type { AppError } from "#/core/errors";
5
- import type { Filesystem } from "#/core/filesystem/filesystem";
6
- import type { Result } from "#/core/result";
3
+ import type { GlobalCliOptions } from "#core/cli/global-options";
4
+ import type { AppError } from "#core/errors";
5
+ import type { Filesystem } from "#core/filesystem/filesystem";
6
+ import type { Result } from "#core/result";
7
7
  /**
8
8
  * The options every command shares: the `--json` machine-output flag. Per-command option shapes extend this.
9
9
  *
@@ -52,7 +52,6 @@ export interface CommandPipeline<Prelude, Request, RunResult, Presenter = never,
52
52
  readonly name: string;
53
53
  readonly help: string;
54
54
  } | undefined;
55
- readonly jsonHelp?: string | undefined;
56
55
  readonly configureArgv?: ((command: Command) => void) | undefined;
57
56
  readonly prepare: CommandPrepare<Prelude>;
58
57
  readonly guard?: ((input: {
@@ -1,10 +1,10 @@
1
1
  import process from "node:process";
2
- import { globalCliCommanderOptionsSchema } from "#/core/cli/global-options";
3
- import { readOptionalPositionalArg } from "#/core/cli/positional";
4
- import { consumeCliAppError } from "#/core/cli/result-handle";
5
- import { logger } from "#/core/logger";
6
- import { parseWithSchema } from "#/core/schema-parse";
7
- const DEFAULT_JSON_HELP = "Print one JSON summary on stdout (suppresses human progress)";
2
+ import { globalCliCommanderOptionsSchema } from "#core/cli/global-options";
3
+ import { readOptionalPositionalArg } from "#core/cli/positional";
4
+ import { consumeCliAppError } from "#core/cli/result-handle";
5
+ import { logger } from "#core/logger";
6
+ import { parseWithSchema } from "#core/schema-parse";
7
+ const DEFAULT_JSON_HELP = "Print one JSON object on stdout instead of the human-readable output";
8
8
  function readGlobalOptions(command) {
9
9
  return (command.optsWithGlobals?.() ?? command.opts());
10
10
  }
@@ -68,7 +68,7 @@ export function applyCommandPipeline(command, fs, pipeline) {
68
68
  if (pipeline.positional) {
69
69
  command.argument(pipeline.positional.name, pipeline.positional.help);
70
70
  }
71
- command.option("--json", pipeline.jsonHelp ?? DEFAULT_JSON_HELP, false);
71
+ command.option("--json", DEFAULT_JSON_HELP, false);
72
72
  pipeline.configureArgv?.(command);
73
73
  command.action(makeAction(fs, pipeline));
74
74
  return command;
@@ -1,4 +1,4 @@
1
- import type { AppError } from "#/core/errors";
1
+ import type { AppError } from "#core/errors";
2
2
  /**
3
3
  * Formats an `AppError` as a `[CODE] message` line for CLI output.
4
4
  *
@@ -1,6 +1,6 @@
1
- import { AppError } from "#/core/errors";
2
- import type { Filesystem } from "#/core/filesystem/filesystem";
3
- import type { Result } from "#/core/result";
1
+ import { AppError } from "#core/errors";
2
+ import type { Filesystem } from "#core/filesystem/filesystem";
3
+ import type { Result } from "#core/result";
4
4
  /**
5
5
  * Resolves the project root as a `Result`, mapping a resolution failure to an `INFRA_FAILURE` error.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { AppError, messageFrom } from "#/core/errors";
2
- import { err, ok } from "#/core/result";
3
- import { resolveProjectRoot } from "#/core/workspace/resolver";
1
+ import { AppError, messageFrom } from "#core/errors";
2
+ import { err, ok } from "#core/result";
3
+ import { resolveProjectRoot } from "#core/workspace/resolver";
4
4
  /**
5
5
  * Resolves the project root as a `Result`, mapping a resolution failure to an `INFRA_FAILURE` error.
6
6
  *
@@ -1,5 +1,5 @@
1
- import type { AppError } from "#/core/errors";
2
- import type { Result } from "#/core/result";
1
+ import type { AppError } from "#core/errors";
2
+ import type { Result } from "#core/result";
3
3
  /**
4
4
  * Narrows a `Result`, reporting a failure and setting the exit code, or logging an optional success message.
5
5
  *
@@ -1,8 +1,8 @@
1
1
  import process from "node:process";
2
- import { formatAppError } from "#/core/cli/format-error";
3
- import { CLI_EXIT_GENERAL_ERROR, CLI_EXIT_USAGE } from "#/core/exit-codes";
4
- import { logger } from "#/core/logger";
5
- import { isVerboseCliDiagnostics } from "#/core/verbose-diagnostics";
2
+ import { formatAppError } from "#core/cli/format-error";
3
+ import { CLI_EXIT_GENERAL_ERROR, CLI_EXIT_USAGE } from "#core/exit-codes";
4
+ import { logger } from "#core/logger";
5
+ import { isVerboseCliDiagnostics } from "#core/verbose-diagnostics";
6
6
  function exitCodeForAppError(error) {
7
7
  switch (error.code) {
8
8
  case "NOT_FOUND":
@@ -1,4 +1,4 @@
1
- import type { CodefastConfig } from "#/core/config/schema";
1
+ import type { CodefastConfig } from "#core/config/schema";
2
2
  /**
3
3
  * Types a `codefast.config.*` object for editor autocomplete and type-checking; returns it unchanged.
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { CodefastConfig } from "#/core/config/schema";
2
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { CodefastConfig } from "#core/config/schema";
2
+ import type { Filesystem } from "#core/filesystem/filesystem";
3
3
  /**
4
4
  * A loaded config together with its schema warnings and the path it was read from.
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
2
  import jiti from "jiti";
3
- import { codefastConfigRootSchema } from "#/core/config/schema";
4
- import { ancestorDirectories } from "#/core/workspace/ancestor-directories";
3
+ import { codefastConfigRootSchema } from "#core/config/schema";
4
+ import { ancestorDirectories } from "#core/workspace/ancestor-directories";
5
5
  function formatZodError(error, filePath) {
6
6
  const formatted = error.issues
7
7
  .map((issue) => {
@@ -1,4 +1,4 @@
1
- import { logger } from "#/core/logger";
1
+ import { logger } from "#core/logger";
2
2
  const yellowAnsi = "\x1b[33m";
3
3
  const resetAnsi = "\x1b[0m";
4
4
  /**
@@ -1,7 +1,7 @@
1
- import type { CodefastConfig } from "#/core/config/schema";
2
- import { AppError } from "#/core/errors";
3
- import type { Filesystem } from "#/core/filesystem/filesystem";
4
- import type { Result } from "#/core/result";
1
+ import type { CodefastConfig } from "#core/config/schema";
2
+ import { AppError } from "#core/errors";
3
+ import type { Filesystem } from "#core/filesystem/filesystem";
4
+ import type { Result } from "#core/result";
5
5
  /**
6
6
  * Loads the `codefast.config.js` for a workspace root, reporting schema warnings along the way.
7
7
  *
@@ -1,7 +1,7 @@
1
- import { loadConfigPayload } from "#/core/config/loader";
2
- import { reportSchemaWarnings } from "#/core/config/warnings";
3
- import { AppError, messageFrom } from "#/core/errors";
4
- import { err, ok } from "#/core/result";
1
+ import { loadConfigPayload } from "#core/config/loader";
2
+ import { reportSchemaWarnings } from "#core/config/warnings";
3
+ import { AppError, messageFrom } from "#core/errors";
4
+ import { err, ok } from "#core/result";
5
5
  /**
6
6
  * Loads the `codefast.config.js` for a workspace root, reporting schema warnings along the way.
7
7
  *
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * The `Filesystem` implementation backed by Node's real filesystem.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import type { ZodType } from "zod";
2
- import { AppError } from "#/core/errors";
3
- import type { Result } from "#/core/result";
2
+ import { AppError } from "#core/errors";
3
+ import type { Result } from "#core/result";
4
4
  /**
5
5
  * Parses an input against a Zod schema and returns a `Result` with the value or a validation `AppError`.
6
6
  *
@@ -1,5 +1,5 @@
1
- import { AppError } from "#/core/errors";
2
- import { err, ok } from "#/core/result";
1
+ import { AppError } from "#core/errors";
2
+ import { err, ok } from "#core/result";
3
3
  function formatSchemaIssues(issues) {
4
4
  return issues
5
5
  .map((issue) => {
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Every markdown file under a root, skipping build output and vendored trees.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { walkFiles } from "#/core/workspace/walk-files";
1
+ import { walkFiles } from "#core/workspace/walk-files";
2
2
  /**
3
3
  * Every markdown file under a root, skipping build output and vendored trees.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Finds the `version` of the nearest enclosing `package.json`, or null when the first
4
4
  * one found declares none (the private workspace root is version-less by design).
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
- import { findNearestAncestor } from "#/core/workspace/ancestor-directories";
3
- import { packageJsonFileName } from "#/core/workspace/well-known-files";
2
+ import { findNearestAncestor } from "#core/workspace/ancestor-directories";
3
+ import { packageJsonFileName } from "#core/workspace/well-known-files";
4
4
  /**
5
5
  * Finds the `version` of the nearest enclosing `package.json`, or null when the first
6
6
  * one found declares none (the private workspace root is version-less by design).
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * A resolved project root and whether it is a pnpm workspace or a standalone single package.
4
4
  *
@@ -1,10 +1,10 @@
1
1
  import path from "node:path";
2
2
  import { parse as parseYaml } from "yaml";
3
- import { messageFrom } from "#/core/errors";
4
- import { createAnyGlobMatcher } from "#/core/glob";
5
- import { logger } from "#/core/logger";
6
- import { findNearestAncestor } from "#/core/workspace/ancestor-directories";
7
- import { packageJsonFileName, workspaceYamlFileName } from "#/core/workspace/well-known-files";
3
+ import { messageFrom } from "#core/errors";
4
+ import { createAnyGlobMatcher } from "#core/glob";
5
+ import { logger } from "#core/logger";
6
+ import { findNearestAncestor } from "#core/workspace/ancestor-directories";
7
+ import { packageJsonFileName, workspaceYamlFileName } from "#core/workspace/well-known-files";
8
8
  /**
9
9
  * Resolves the project root: the `pnpm-workspace.yaml` directory, or the nearest `package.json` for a single package.
10
10
  *
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Every hand-written source file a comment convention applies to — `.ts`, `.tsx`, `.css`, and ignore files.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { walkFiles } from "#/core/workspace/walk-files";
2
+ import { walkFiles } from "#core/workspace/walk-files";
3
3
  // Ignore files carry the divider convention over `#` comments — the content rules stay code-only.
4
4
  const ignoreFileNames = new Set([
5
5
  ".gitignore",
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Recursively collects the `.ts`/`.tsx` file paths under a root, skipping `.d.ts` and skip-listed directories.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { walkFiles } from "#/core/workspace/walk-files";
1
+ import { walkFiles } from "#core/workspace/walk-files";
2
2
  /**
3
3
  * Recursively collects the `.ts`/`.tsx` file paths under a root, skipping `.d.ts` and skip-listed directories.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Every file under a root the predicate accepts, skipping build output and vendored trees.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { defaultSkipDirectoryNames } from "#/core/workspace/skip-directories";
2
+ import { defaultSkipDirectoryNames } from "#core/workspace/skip-directories";
3
3
  /**
4
4
  * Every file under a root the predicate accepts, skipping build output and vendored trees.
5
5
  *
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `@codefast/cli` public API: run the CLI in-process, and author a typed `codefast.config.*`.
3
3
  */
4
- export { runCli } from "#/cli";
5
- export { defineConfig } from "#/core/config/define-config";
6
- export type { CodefastAfterWriteHook, CodefastArrangeConfig, CodefastConfig, CodefastTagConfig, MirrorConfig, } from "#/core/config/schema";
4
+ export { runCli } from "#cli";
5
+ export { defineConfig } from "#core/config/define-config";
6
+ export type { CodefastAfterWriteHook, CodefastArrangeConfig, CodefastConfig, CodefastTagConfig, MirrorConfig, } from "#core/config/schema";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * The `@codefast/cli` public API: run the CLI in-process, and author a typed `codefast.config.*`.
3
3
  */
4
- export { runCli } from "#/cli";
5
- export { defineConfig } from "#/core/config/define-config";
4
+ export { runCli } from "#cli";
5
+ export { defineConfig } from "#core/config/define-config";
@@ -1,4 +1,4 @@
1
- import type { GlobalStats } from "#/mirror/domain/types";
1
+ import type { GlobalStats } from "#mirror/domain/types";
2
2
  /**
3
3
  * Maps a mirror run's stats to the process exit code.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { CLI_EXIT_GENERAL_ERROR, CLI_EXIT_SUCCESS } from "#/core/exit-codes";
1
+ import { CLI_EXIT_GENERAL_ERROR, CLI_EXIT_SUCCESS } from "#core/exit-codes";
2
2
  /**
3
3
  * Maps a mirror run's stats to the process exit code.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import * as z from "zod";
2
- import type { MirrorSyncRunRequest } from "#/mirror/domain/types";
2
+ import type { MirrorSyncRunRequest } from "#mirror/domain/types";
3
3
  /**
4
4
  * Zod schema validating a `MirrorSyncRunRequest`.
5
5
  *
@@ -1,11 +1,11 @@
1
1
  import { Command } from "commander";
2
- import { applyCommandPipeline } from "#/core/cli/command-pipeline";
3
- import { nodeFilesystem } from "#/core/filesystem/node";
4
- import { exitCodeForMirrorSyncResult, formatMirrorSyncJsonOutput } from "#/mirror/cli-result";
5
- import { mirrorSyncRunRequestSchema } from "#/mirror/cli-schema";
6
- import { MirrorSyncProgressPresenter } from "#/mirror/output";
7
- import { prepareMirrorSync } from "#/mirror/prepare";
8
- import { runMirrorSync } from "#/mirror/run";
2
+ import { applyCommandPipeline } from "#core/cli/command-pipeline";
3
+ import { nodeFilesystem } from "#core/filesystem/node";
4
+ import { exitCodeForMirrorSyncResult, formatMirrorSyncJsonOutput } from "#mirror/cli-result";
5
+ import { mirrorSyncRunRequestSchema } from "#mirror/cli-schema";
6
+ import { MirrorSyncProgressPresenter } from "#mirror/output";
7
+ import { prepareMirrorSync } from "#mirror/prepare";
8
+ import { runMirrorSync } from "#mirror/run";
9
9
  const mirrorPipeline = {
10
10
  positional: { name: "[package]", help: "Optional package path relative to repo root (e.g. packages/ui)" },
11
11
  schema: mirrorSyncRunRequestSchema,
@@ -1,5 +1,5 @@
1
- import type { Filesystem } from "#/core/filesystem/filesystem";
2
- import type { DistFilesystem } from "#/mirror/domain/dist-filesystem";
1
+ import type { Filesystem } from "#core/filesystem/filesystem";
2
+ import type { DistFilesystem } from "#mirror/domain/dist-filesystem";
3
3
  /**
4
4
  * Creates the `DistFilesystem` the mirror scan uses, backed by a `Filesystem`.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
- import { isDirentList } from "#/mirror/domain/dirent-guard";
3
- import { normalizePath } from "#/mirror/domain/path-normalizer";
2
+ import { isDirentList } from "#mirror/domain/dirent-guard";
3
+ import { normalizePath } from "#mirror/domain/path-normalizer";
4
4
  /**
5
5
  * Creates the `DistFilesystem` the mirror scan uses, backed by a `Filesystem`.
6
6
  *
@@ -1,4 +1,4 @@
1
- import type { DirectoryEntry } from "#/core/filesystem/filesystem";
1
+ import type { DirectoryEntry } from "#core/filesystem/filesystem";
2
2
  /**
3
3
  * Narrow `fs.promises.readdir` overload result to `Dirent[]` when `withFileTypes: true`.
4
4
  * Accepts both historical checks (`isFile` / `isDirectory`) in one guard.
@@ -1,5 +1,5 @@
1
- import type { DistFilesystem } from "#/mirror/domain/dist-filesystem";
2
- import type { GenerateExportsResult } from "#/mirror/domain/types";
1
+ import type { DistFilesystem } from "#mirror/domain/dist-filesystem";
2
+ import type { GenerateExportsResult } from "#mirror/domain/types";
3
3
  /**
4
4
  * Creates a transform that strips a configured prefix from export paths, or `null` when none is set.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import * as nodePath from "node:path";
2
- import { PACKAGE_JSON_EXPORT, VALID_DTS_EXTENSIONS, VALID_JS_EXTENSIONS } from "#/mirror/domain/constants";
2
+ import { PACKAGE_JSON_EXPORT, VALID_DTS_EXTENSIONS, VALID_JS_EXTENSIONS } from "#mirror/domain/constants";
3
3
  function groupDistFilesByModule(relativeDistFiles) {
4
4
  const distModulesByPath = new Map();
5
5
  for (const relativeDistFile of relativeDistFiles) {
@@ -1,5 +1,5 @@
1
- import type { GlobalCliOptions } from "#/core/cli/global-options";
2
- import type { CodefastConfig } from "#/core/config/schema";
1
+ import type { GlobalCliOptions } from "#core/cli/global-options";
2
+ import type { CodefastConfig } from "#core/config/schema";
3
3
  /**
4
4
  * One conditional exports entry, keyed by resolution condition.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { GlobalStats, MirrorProcessingModeInput, MirrorSyncProgressListener, PackageStats } from "#/mirror/domain/types";
1
+ import type { GlobalStats, MirrorProcessingModeInput, MirrorSyncProgressListener, PackageStats } from "#mirror/domain/types";
2
2
  /**
3
3
  * A progress listener that renders mirror run events through the CLI reporter.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import process from "node:process";
2
- import { messageFrom } from "#/core/errors";
3
- import { logger } from "#/core/logger";
2
+ import { messageFrom } from "#core/errors";
3
+ import { logger } from "#core/logger";
4
4
  const cliLogger = logger;
5
5
  /**
6
6
  * A progress listener that renders mirror run events through the CLI reporter.
@@ -1,6 +1,6 @@
1
- import { AppError } from "#/core/errors";
2
- import type { Filesystem } from "#/core/filesystem/filesystem";
3
- import type { Result } from "#/core/result";
1
+ import { AppError } from "#core/errors";
2
+ import type { Filesystem } from "#core/filesystem/filesystem";
3
+ import type { Result } from "#core/result";
4
4
  /**
5
5
  * Resolves the optional positional package argument to a root-relative path, or `undefined` when absent.
6
6
  *
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
- import { AppError } from "#/core/errors";
3
- import { err, ok } from "#/core/result";
4
- import { normalizePath } from "#/mirror/domain/path-normalizer";
2
+ import { AppError } from "#core/errors";
3
+ import { err, ok } from "#core/result";
4
+ import { normalizePath } from "#mirror/domain/path-normalizer";
5
5
  /**
6
6
  * Resolves the optional positional package argument to a root-relative path, or `undefined` when absent.
7
7
  *
@@ -1,8 +1,8 @@
1
- import type { GlobalCliOptions } from "#/core/cli/global-options";
2
- import type { AppError } from "#/core/errors";
3
- import type { Filesystem } from "#/core/filesystem/filesystem";
4
- import type { Result } from "#/core/result";
5
- import type { MirrorSyncCommandPrelude } from "#/mirror/domain/types";
1
+ import type { GlobalCliOptions } from "#core/cli/global-options";
2
+ import type { AppError } from "#core/errors";
3
+ import type { Filesystem } from "#core/filesystem/filesystem";
4
+ import type { Result } from "#core/result";
5
+ import type { MirrorSyncCommandPrelude } from "#mirror/domain/types";
6
6
  /**
7
7
  * Resolves the repo root, config, and package filter into the prelude a mirror run starts from.
8
8
  *
@@ -1,7 +1,7 @@
1
- import { resolveProjectRootResult } from "#/core/cli/resolve-root";
2
- import { loadCodefastConfig } from "#/core/config";
3
- import { ok } from "#/core/result";
4
- import { resolveMirrorPackageFromCliArg } from "#/mirror/package-path";
1
+ import { resolveProjectRootResult } from "#core/cli/resolve-root";
2
+ import { loadCodefastConfig } from "#core/config";
3
+ import { ok } from "#core/result";
4
+ import { resolveMirrorPackageFromCliArg } from "#mirror/package-path";
5
5
  /**
6
6
  * Resolves the repo root, config, and package filter into the prelude a mirror run starts from.
7
7
  *