@ryanatkn/gro 0.176.0 → 0.177.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 (211) hide show
  1. package/dist/args.d.ts +5 -5
  2. package/dist/args.d.ts.map +1 -1
  3. package/dist/build.task.d.ts.map +1 -1
  4. package/dist/build.task.js +2 -2
  5. package/dist/build_cache.d.ts +12 -12
  6. package/dist/build_cache.d.ts.map +1 -1
  7. package/dist/build_cache.js +4 -4
  8. package/dist/changelog.d.ts +2 -2
  9. package/dist/changelog.d.ts.map +1 -1
  10. package/dist/changelog.js +1 -1
  11. package/dist/changeset.task.d.ts.map +1 -1
  12. package/dist/changeset.task.js +9 -9
  13. package/dist/changeset_helpers.d.ts +4 -4
  14. package/dist/changeset_helpers.d.ts.map +1 -1
  15. package/dist/changeset_helpers.js +2 -2
  16. package/dist/check.task.d.ts.map +1 -1
  17. package/dist/check.task.js +3 -3
  18. package/dist/clean.task.js +2 -2
  19. package/dist/cli.d.ts +6 -6
  20. package/dist/cli.d.ts.map +1 -1
  21. package/dist/commit.task.js +2 -2
  22. package/dist/deploy.task.d.ts.map +1 -1
  23. package/dist/deploy.task.js +13 -13
  24. package/dist/dev.task.d.ts +2 -2
  25. package/dist/dev.task.d.ts.map +1 -1
  26. package/dist/disknode.d.ts +4 -4
  27. package/dist/disknode.d.ts.map +1 -1
  28. package/dist/esbuild_helpers.d.ts +2 -2
  29. package/dist/esbuild_helpers.d.ts.map +1 -1
  30. package/dist/esbuild_plugin_external_worker.d.ts +5 -5
  31. package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
  32. package/dist/esbuild_plugin_svelte.d.ts +4 -4
  33. package/dist/esbuild_plugin_svelte.d.ts.map +1 -1
  34. package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts +2 -2
  35. package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts.map +1 -1
  36. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +5 -5
  37. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts.map +1 -1
  38. package/dist/esbuild_plugin_sveltekit_shim_env.d.ts +2 -2
  39. package/dist/esbuild_plugin_sveltekit_shim_env.d.ts.map +1 -1
  40. package/dist/filer.d.ts +15 -15
  41. package/dist/filer.d.ts.map +1 -1
  42. package/dist/filer.js +2 -2
  43. package/dist/format.task.d.ts.map +1 -1
  44. package/dist/format.task.js +2 -2
  45. package/dist/format_directory.d.ts +2 -2
  46. package/dist/format_directory.d.ts.map +1 -1
  47. package/dist/gen.d.ts +73 -73
  48. package/dist/gen.d.ts.map +1 -1
  49. package/dist/gen.js +1 -1
  50. package/dist/gen.task.d.ts.map +1 -1
  51. package/dist/gen.task.js +8 -8
  52. package/dist/gen_helpers.d.ts +4 -4
  53. package/dist/gen_helpers.d.ts.map +1 -1
  54. package/dist/gen_helpers.js +1 -1
  55. package/dist/github.d.ts +4 -4
  56. package/dist/github.d.ts.map +1 -1
  57. package/dist/github.js +3 -3
  58. package/dist/gro.config.default.d.ts +2 -2
  59. package/dist/gro.config.default.d.ts.map +1 -1
  60. package/dist/gro_config.d.ts +25 -25
  61. package/dist/gro_config.d.ts.map +1 -1
  62. package/dist/gro_config.js +2 -2
  63. package/dist/gro_helpers.d.ts +2 -2
  64. package/dist/gro_helpers.d.ts.map +1 -1
  65. package/dist/gro_plugin_gen.d.ts +3 -3
  66. package/dist/gro_plugin_gen.d.ts.map +1 -1
  67. package/dist/gro_plugin_gen.js +2 -2
  68. package/dist/gro_plugin_server.d.ts +7 -7
  69. package/dist/gro_plugin_server.d.ts.map +1 -1
  70. package/dist/gro_plugin_sveltekit_app.d.ts +10 -10
  71. package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
  72. package/dist/gro_plugin_sveltekit_app.js +2 -2
  73. package/dist/gro_plugin_sveltekit_library.d.ts +4 -4
  74. package/dist/gro_plugin_sveltekit_library.d.ts.map +1 -1
  75. package/dist/gro_plugin_sveltekit_library.js +2 -2
  76. package/dist/index.d.ts +3 -3
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/input_path.d.ts +30 -30
  80. package/dist/input_path.d.ts.map +1 -1
  81. package/dist/input_path.js +2 -2
  82. package/dist/invoke.js +1 -1
  83. package/dist/invoke_task.d.ts +3 -3
  84. package/dist/invoke_task.d.ts.map +1 -1
  85. package/dist/invoke_task.js +4 -4
  86. package/dist/lint.task.d.ts.map +1 -1
  87. package/dist/lint.task.js +2 -2
  88. package/dist/modules.d.ts +20 -20
  89. package/dist/modules.d.ts.map +1 -1
  90. package/dist/modules.js +2 -2
  91. package/dist/package_json.d.ts +16 -16
  92. package/dist/package_json.d.ts.map +1 -1
  93. package/dist/package_json.js +6 -6
  94. package/dist/parse_exports.d.ts +7 -7
  95. package/dist/parse_exports.d.ts.map +1 -1
  96. package/dist/parse_exports.js +3 -3
  97. package/dist/parse_exports_context.d.ts +3 -3
  98. package/dist/parse_exports_context.d.ts.map +1 -1
  99. package/dist/parse_exports_context.js +1 -1
  100. package/dist/parse_imports.d.ts +3 -3
  101. package/dist/parse_imports.d.ts.map +1 -1
  102. package/dist/parse_imports.js +2 -2
  103. package/dist/paths.d.ts +6 -6
  104. package/dist/paths.d.ts.map +1 -1
  105. package/dist/plugin.d.ts +13 -13
  106. package/dist/plugin.d.ts.map +1 -1
  107. package/dist/plugin.js +1 -1
  108. package/dist/publish.task.d.ts.map +1 -1
  109. package/dist/publish.task.js +12 -12
  110. package/dist/reinstall.task.d.ts.map +1 -1
  111. package/dist/reinstall.task.js +4 -4
  112. package/dist/resolve_specifier.d.ts +4 -4
  113. package/dist/resolve_specifier.d.ts.map +1 -1
  114. package/dist/run.task.d.ts.map +1 -1
  115. package/dist/run.task.js +3 -3
  116. package/dist/run_gen.d.ts +4 -4
  117. package/dist/run_gen.d.ts.map +1 -1
  118. package/dist/run_task.d.ts +4 -4
  119. package/dist/run_task.d.ts.map +1 -1
  120. package/dist/run_task.js +3 -3
  121. package/dist/search_fs.d.ts +6 -6
  122. package/dist/search_fs.d.ts.map +1 -1
  123. package/dist/src_json.d.ts +6 -6
  124. package/dist/src_json.d.ts.map +1 -1
  125. package/dist/src_json.js +3 -3
  126. package/dist/svelte_config.d.ts +3 -3
  127. package/dist/svelte_config.d.ts.map +1 -1
  128. package/dist/sveltekit_helpers.d.ts +5 -5
  129. package/dist/sveltekit_helpers.d.ts.map +1 -1
  130. package/dist/sveltekit_helpers.js +5 -5
  131. package/dist/sveltekit_shim_app.d.ts +2 -2
  132. package/dist/sveltekit_shim_app.d.ts.map +1 -1
  133. package/dist/sync.task.d.ts.map +1 -1
  134. package/dist/sync.task.js +2 -2
  135. package/dist/task.d.ts +54 -54
  136. package/dist/task.d.ts.map +1 -1
  137. package/dist/task.js +3 -3
  138. package/dist/task_logging.d.ts +3 -3
  139. package/dist/task_logging.d.ts.map +1 -1
  140. package/dist/test.task.d.ts.map +1 -1
  141. package/dist/test.task.js +4 -4
  142. package/dist/typecheck.task.d.ts.map +1 -1
  143. package/dist/typecheck.task.js +4 -4
  144. package/dist/upgrade.task.d.ts.map +1 -1
  145. package/dist/upgrade.task.js +5 -5
  146. package/dist/watch_dir.d.ts +10 -10
  147. package/dist/watch_dir.d.ts.map +1 -1
  148. package/package.json +3 -3
  149. package/src/lib/args.ts +9 -9
  150. package/src/lib/build.task.ts +2 -2
  151. package/src/lib/build_cache.ts +18 -18
  152. package/src/lib/changelog.ts +10 -10
  153. package/src/lib/changeset.task.ts +16 -16
  154. package/src/lib/changeset_helpers.ts +4 -4
  155. package/src/lib/check.task.ts +3 -3
  156. package/src/lib/clean.task.ts +2 -2
  157. package/src/lib/cli.ts +7 -7
  158. package/src/lib/commit.task.ts +2 -2
  159. package/src/lib/deploy.task.ts +15 -15
  160. package/src/lib/dev.task.ts +2 -2
  161. package/src/lib/disknode.ts +4 -4
  162. package/src/lib/esbuild_helpers.ts +2 -2
  163. package/src/lib/esbuild_plugin_external_worker.ts +7 -7
  164. package/src/lib/esbuild_plugin_svelte.ts +4 -4
  165. package/src/lib/esbuild_plugin_sveltekit_shim_alias.ts +2 -2
  166. package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +5 -5
  167. package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +2 -2
  168. package/src/lib/filer.ts +35 -35
  169. package/src/lib/format.task.ts +2 -2
  170. package/src/lib/format_directory.ts +2 -2
  171. package/src/lib/gen.task.ts +19 -19
  172. package/src/lib/gen.ts +85 -85
  173. package/src/lib/gen_helpers.ts +17 -17
  174. package/src/lib/github.ts +6 -6
  175. package/src/lib/gro.config.default.ts +2 -2
  176. package/src/lib/gro_config.ts +28 -28
  177. package/src/lib/gro_helpers.ts +2 -2
  178. package/src/lib/gro_plugin_gen.ts +5 -5
  179. package/src/lib/gro_plugin_server.ts +8 -8
  180. package/src/lib/gro_plugin_sveltekit_app.ts +15 -15
  181. package/src/lib/gro_plugin_sveltekit_library.ts +6 -6
  182. package/src/lib/index.ts +3 -3
  183. package/src/lib/input_path.ts +56 -56
  184. package/src/lib/invoke.ts +2 -2
  185. package/src/lib/invoke_task.ts +7 -7
  186. package/src/lib/lint.task.ts +2 -2
  187. package/src/lib/modules.ts +31 -31
  188. package/src/lib/package_json.ts +27 -27
  189. package/src/lib/parse_exports.ts +15 -15
  190. package/src/lib/parse_exports_context.ts +9 -9
  191. package/src/lib/parse_imports.ts +6 -6
  192. package/src/lib/paths.ts +6 -6
  193. package/src/lib/plugin.ts +17 -17
  194. package/src/lib/publish.task.ts +13 -13
  195. package/src/lib/reinstall.task.ts +4 -4
  196. package/src/lib/resolve_specifier.ts +5 -5
  197. package/src/lib/run.task.ts +3 -3
  198. package/src/lib/run_gen.ts +14 -14
  199. package/src/lib/run_task.ts +8 -8
  200. package/src/lib/search_fs.ts +13 -13
  201. package/src/lib/src_json.ts +13 -13
  202. package/src/lib/svelte_config.ts +2 -2
  203. package/src/lib/sveltekit_helpers.ts +12 -12
  204. package/src/lib/sveltekit_shim_app.ts +3 -3
  205. package/src/lib/sync.task.ts +2 -2
  206. package/src/lib/task.ts +63 -63
  207. package/src/lib/task_logging.ts +11 -11
  208. package/src/lib/test.task.ts +4 -4
  209. package/src/lib/typecheck.task.ts +4 -4
  210. package/src/lib/upgrade.task.ts +7 -7
  211. package/src/lib/watch_dir.ts +10 -10
package/src/lib/filer.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import {EMPTY_OBJECT} from '@ryanatkn/belt/object.js';
2
2
  import {readFileSync, statSync} from 'node:fs';
3
3
  import {dirname, resolve} from 'node:path';
4
- import type {Omit_Strict} from '@ryanatkn/belt/types.js';
4
+ import type {OmitStrict} from '@ryanatkn/belt/types.js';
5
5
  import {isBuiltin} from 'node:module';
6
6
  import {fileURLToPath, pathToFileURL} from 'node:url';
7
- import {Unreachable_Error} from '@ryanatkn/belt/error.js';
7
+ import {UnreachableError} from '@ryanatkn/belt/error.js';
8
8
  import type {Logger} from '@ryanatkn/belt/log.js';
9
- import type {Package_Json} from '@ryanatkn/belt/package_json.js';
10
- import type {File_Filter, Path_Id} from '@ryanatkn/belt/path.js';
9
+ import type {PackageJson} from '@ryanatkn/belt/package_json.js';
10
+ import type {FileFilter, PathId} from '@ryanatkn/belt/path.js';
11
11
 
12
12
  import {
13
13
  watch_dir,
14
- type Watch_Node_Fs,
15
- type Watcher_Change,
16
- type Watch_Dir_Options,
17
- type Watcher_Change_Callback,
14
+ type WatchNodeFs,
15
+ type WatcherChange,
16
+ type WatchDirOptions,
17
+ type WatcherChangeCallback,
18
18
  } from './watch_dir.ts';
19
19
  import {paths} from './paths.ts';
20
20
  import {parse_imports} from './parse_imports.ts';
@@ -26,32 +26,32 @@ import type {Disknode} from './disknode.ts';
26
26
 
27
27
  const aliases = Object.entries(default_svelte_config.alias);
28
28
 
29
- export type On_Filer_Change = (change: Watcher_Change, disknode: Disknode) => void;
29
+ export type OnFilerChange = (change: WatcherChange, disknode: Disknode) => void;
30
30
 
31
- export interface Filer_Options {
31
+ export interface FilerOptions {
32
32
  watch_dir?: typeof watch_dir;
33
- watch_dir_options?: Partial<Omit_Strict<Watch_Dir_Options, 'on_change'>>;
34
- package_json_cache?: Record<string, Package_Json>;
33
+ watch_dir_options?: Partial<OmitStrict<WatchDirOptions, 'on_change'>>;
34
+ package_json_cache?: Record<string, PackageJson>;
35
35
  log?: Logger;
36
36
  }
37
37
 
38
38
  export class Filer {
39
- readonly root_dir: Path_Id;
39
+ readonly root_dir: PathId;
40
40
 
41
41
  // TODO rename everything to `disknode`
42
- readonly files: Map<Path_Id, Disknode> = new Map();
42
+ readonly files: Map<PathId, Disknode> = new Map();
43
43
 
44
44
  #watch_dir: typeof watch_dir;
45
- #watch_dir_options: Partial<Watch_Dir_Options>;
45
+ #watch_dir_options: Partial<WatchDirOptions>;
46
46
 
47
47
  #log?: Logger;
48
48
 
49
- #listeners: Set<On_Filer_Change> = new Set();
50
- #watching: Watch_Node_Fs | undefined;
49
+ #listeners: Set<OnFilerChange> = new Set();
50
+ #watching: WatchNodeFs | undefined;
51
51
  #initing: Promise<void> | undefined;
52
52
  #closing: Promise<void> | undefined;
53
53
 
54
- constructor(options: Filer_Options = EMPTY_OBJECT) {
54
+ constructor(options: FilerOptions = EMPTY_OBJECT) {
55
55
  this.#watch_dir = options.watch_dir ?? watch_dir;
56
56
  this.#watch_dir_options = options.watch_dir_options ?? EMPTY_OBJECT;
57
57
  this.root_dir = resolve(options.watch_dir_options?.dir ?? paths.source);
@@ -65,11 +65,11 @@ export class Filer {
65
65
  return this.#watching !== undefined;
66
66
  }
67
67
 
68
- get_by_id = (id: Path_Id): Disknode | undefined => {
68
+ get_by_id = (id: PathId): Disknode | undefined => {
69
69
  return this.files.get(id);
70
70
  };
71
71
 
72
- get_or_create = (id: Path_Id): Disknode => {
72
+ get_or_create = (id: PathId): Disknode => {
73
73
  const existing = this.get_by_id(id);
74
74
  if (existing) return existing;
75
75
  const file: Disknode = {
@@ -155,7 +155,7 @@ export class Filer {
155
155
  }
156
156
  }
157
157
 
158
- async watch(listener: On_Filer_Change): Promise<() => void> {
158
+ async watch(listener: OnFilerChange): Promise<() => void> {
159
159
  await this.#add_listener(listener);
160
160
  return () => {
161
161
  this.#remove_listener(listener);
@@ -214,7 +214,7 @@ export class Filer {
214
214
  this.#cleanup();
215
215
  }
216
216
 
217
- #update(id: Path_Id): Disknode | null {
217
+ #update(id: PathId): Disknode | null {
218
218
  const file = this.get_or_create(id);
219
219
 
220
220
  let stats: ReturnType<typeof statSync> | null = null;
@@ -284,7 +284,7 @@ export class Filer {
284
284
  return file;
285
285
  }
286
286
 
287
- #remove(id: Path_Id): Disknode | null {
287
+ #remove(id: PathId): Disknode | null {
288
288
  const file = this.get_by_id(id);
289
289
  if (!file) return null; // this is safe because the object would exist if any other file referenced it as a dependency or dependent
290
290
 
@@ -300,7 +300,7 @@ export class Filer {
300
300
  return file;
301
301
  }
302
302
 
303
- #sync_listener_with_files(listener: On_Filer_Change): void {
303
+ #sync_listener_with_files(listener: OnFilerChange): void {
304
304
  for (const disknode of this.files.values()) {
305
305
  try {
306
306
  listener({type: 'add', path: disknode.id, is_directory: false}, disknode);
@@ -310,7 +310,7 @@ export class Filer {
310
310
  }
311
311
  }
312
312
 
313
- #notify_change(change: Watcher_Change, disknode: Disknode): void {
313
+ #notify_change(change: WatcherChange, disknode: Disknode): void {
314
314
  for (const listener of this.#listeners) {
315
315
  try {
316
316
  listener(change, disknode);
@@ -320,7 +320,7 @@ export class Filer {
320
320
  }
321
321
  }
322
322
 
323
- async #add_listener(listener: On_Filer_Change): Promise<void> {
323
+ async #add_listener(listener: OnFilerChange): Promise<void> {
324
324
  this.#listeners.add(listener);
325
325
 
326
326
  // ensure initialized
@@ -330,12 +330,12 @@ export class Filer {
330
330
  this.#sync_listener_with_files(listener);
331
331
  }
332
332
 
333
- #remove_listener(listener: On_Filer_Change): void {
333
+ #remove_listener(listener: OnFilerChange): void {
334
334
  this.#listeners.delete(listener);
335
335
  // keep watching active even with no listeners, only close() tears down
336
336
  }
337
337
 
338
- #on_change: Watcher_Change_Callback = (change) => {
338
+ #on_change: WatcherChangeCallback = (change) => {
339
339
  if (this.#closing) return; // ignore changes during close
340
340
  if (change.is_directory) return; // TODO manage directories?
341
341
  let disknode: Disknode | null;
@@ -350,14 +350,14 @@ export class Filer {
350
350
  break;
351
351
  }
352
352
  default:
353
- throw new Unreachable_Error(change.type);
353
+ throw new UnreachableError(change.type);
354
354
  }
355
355
  if (disknode && this.#listeners.size > 0) {
356
356
  this.#notify_change(change, disknode);
357
357
  }
358
358
  };
359
359
 
360
- #is_external(id: Path_Id): boolean {
360
+ #is_external(id: PathId): boolean {
361
361
  const {filter} = this.#watch_dir_options;
362
362
  return !id.startsWith(this.root_dir + '/') || (!!filter && !filter(id, false));
363
363
  }
@@ -366,12 +366,12 @@ export class Filer {
366
366
  // TODO maybe `Disknode` class?
367
367
  export const filter_dependents = (
368
368
  disknode: Disknode,
369
- get_by_id: (id: Path_Id) => Disknode | undefined,
370
- filter?: File_Filter,
371
- results: Set<Path_Id> = new Set(),
372
- searched: Set<Path_Id> = new Set(),
369
+ get_by_id: (id: PathId) => Disknode | undefined,
370
+ filter?: FileFilter,
371
+ results: Set<PathId> = new Set(),
372
+ searched: Set<PathId> = new Set(),
373
373
  log?: Logger,
374
- ): Set<Path_Id> => {
374
+ ): Set<PathId> => {
375
375
  const {dependents} = disknode;
376
376
  for (const dependent_id of dependents.keys()) {
377
377
  if (searched.has(dependent_id)) continue;
@@ -1,7 +1,7 @@
1
1
  import {print_spawn_result} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
 
4
- import {Task_Error, type Task} from './task.ts';
4
+ import {TaskError, type Task} from './task.ts';
5
5
  import {format_directory} from './format_directory.ts';
6
6
  import {paths} from './paths.ts';
7
7
 
@@ -31,7 +31,7 @@ export const task: Task<Args> = {
31
31
  config.pm_cli,
32
32
  );
33
33
  if (!format_result.ok) {
34
- throw new Task_Error(
34
+ throw new TaskError(
35
35
  `Failed ${check ? 'formatting check' : 'to format'}. ${print_spawn_result(format_result)}`,
36
36
  );
37
37
  }
@@ -1,4 +1,4 @@
1
- import type {Spawn_Result} from '@ryanatkn/belt/process.js';
1
+ import type {SpawnResult} from '@ryanatkn/belt/process.js';
2
2
  import type {Logger} from '@ryanatkn/belt/log.js';
3
3
 
4
4
  import {paths} from './paths.ts';
@@ -39,7 +39,7 @@ export const format_directory = async (
39
39
  root_paths = ROOT_PATHS_DEFAULT,
40
40
  prettier_cli: string | Cli = PRETTIER_CLI_DEFAULT,
41
41
  pm_cli: string = PM_CLI_DEFAULT,
42
- ): Promise<Spawn_Result> => {
42
+ ): Promise<SpawnResult> => {
43
43
  const forwarded_args = to_forwarded_args(to_cli_name(prettier_cli));
44
44
  forwarded_args[check ? 'check' : 'write'] = true;
45
45
  const serialized_args = serialize_args(forwarded_args);
@@ -3,9 +3,9 @@ import {print_ms, print_error} from '@ryanatkn/belt/print.js';
3
3
  import {plural} from '@ryanatkn/belt/string.js';
4
4
  import {z} from 'zod';
5
5
 
6
- import {Task_Error, type Task} from './task.ts';
6
+ import {TaskError, type Task} from './task.ts';
7
7
  import {run_gen} from './run_gen.ts';
8
- import {Raw_Input_Path, to_input_paths} from './input_path.ts';
8
+ import {RawInputPath, to_input_paths} from './input_path.ts';
9
9
  import {format_file} from './format_file.ts';
10
10
  import {print_path} from './paths.ts';
11
11
  import {log_error_reasons} from './task_logging.ts';
@@ -14,20 +14,20 @@ import {
14
14
  analyze_gen_results,
15
15
  find_genfiles,
16
16
  load_genfiles,
17
- type Analyzed_Gen_Result,
18
- type Gen_Results,
17
+ type AnalyzedGenResult,
18
+ type GenResults,
19
19
  } from './gen.ts';
20
20
  import {SOURCE_DIRNAME} from './constants.ts';
21
21
 
22
22
  /** @nodocs */
23
23
  export const Args = z.strictObject({
24
24
  _: z
25
- .array(Raw_Input_Path)
25
+ .array(RawInputPath)
26
26
  .meta({description: 'input paths to generate'})
27
27
  .default([SOURCE_DIRNAME]),
28
28
  root_dirs: z
29
29
  .array(z.string())
30
- .meta({description: 'root directories to resolve input paths against'}) // TODO `Path_Id` schema
30
+ .meta({description: 'root directories to resolve input paths against'}) // TODO `PathId` schema
31
31
  .default([process.cwd()]),
32
32
  check: z
33
33
  .boolean()
@@ -54,7 +54,7 @@ export const task: Task<Args> = {
54
54
  return;
55
55
  } else {
56
56
  log_error_reasons(log, found.reasons);
57
- throw new Task_Error('Failed to find gen modules.');
57
+ throw new TaskError('Failed to find gen modules.');
58
58
  }
59
59
  }
60
60
  const found_genfiles = found.value;
@@ -65,7 +65,7 @@ export const task: Task<Args> = {
65
65
  const loaded = await load_genfiles(found_genfiles, timings);
66
66
  if (!loaded.ok) {
67
67
  log_error_reasons(log, loaded.reasons);
68
- throw new Task_Error('Failed to load gen modules.');
68
+ throw new TaskError('Failed to load gen modules.');
69
69
  }
70
70
  const loaded_genfiles = loaded.value;
71
71
 
@@ -106,7 +106,7 @@ export const task: Task<Args> = {
106
106
  );
107
107
  }
108
108
  if (has_unexpected_changes) {
109
- throw new Task_Error(
109
+ throw new TaskError(
110
110
  'Failed gen check. Some generated files have unexpectedly changed.' +
111
111
  ' Run `gro gen` and try again.',
112
112
  );
@@ -135,26 +135,26 @@ export const task: Task<Args> = {
135
135
  for (const result of gen_results.failures) {
136
136
  log.error(result.reason, '\n', print_error(result.error));
137
137
  }
138
- throw new Task_Error(`Failed to generate ${fail_count} file${plural(fail_count)}.`);
138
+ throw new TaskError(`Failed to generate ${fail_count} file${plural(fail_count)}.`);
139
139
  }
140
140
  },
141
141
  };
142
142
 
143
- interface Gen_Status {
143
+ interface GenStatus {
144
144
  symbol: string;
145
145
  color: Parameters<typeof st>[0];
146
146
  text: string;
147
147
  }
148
148
 
149
- const format_gen_status = (analyzed: Analyzed_Gen_Result | undefined): Gen_Status => {
149
+ const format_gen_status = (analyzed: AnalyzedGenResult | undefined): GenStatus => {
150
150
  if (!analyzed) return {symbol: '?', color: 'gray', text: 'unknown'};
151
151
  if (analyzed.is_new) return {symbol: '●', color: 'green', text: 'new'};
152
152
  if (analyzed.has_changed) return {symbol: '◐', color: 'cyan', text: 'changed'};
153
153
  return {symbol: '○', color: 'gray', text: 'unchanged'};
154
154
  };
155
155
 
156
- interface Output_Line {
157
- status: Gen_Status;
156
+ interface OutputLine {
157
+ status: GenStatus;
158
158
  elapsed: string;
159
159
  source: string;
160
160
  target: string;
@@ -162,10 +162,10 @@ interface Output_Line {
162
162
  }
163
163
 
164
164
  const collect_output_lines = (
165
- gen_results: Gen_Results,
166
- analyzed_gen_results: Array<Analyzed_Gen_Result>,
167
- ): Array<Output_Line> => {
168
- const output_lines: Array<Output_Line> = [];
165
+ gen_results: GenResults,
166
+ analyzed_gen_results: Array<AnalyzedGenResult>,
167
+ ): Array<OutputLine> => {
168
+ const output_lines: Array<OutputLine> = [];
169
169
 
170
170
  for (const result of gen_results.results) {
171
171
  if (result.ok) {
@@ -193,7 +193,7 @@ const collect_output_lines = (
193
193
  return output_lines;
194
194
  };
195
195
 
196
- const format_gen_output = (output_lines: Array<Output_Line>): string => {
196
+ const format_gen_output = (output_lines: Array<OutputLine>): string => {
197
197
  // calculate column widths for alignment
198
198
  const max_elapsed_length = Math.max(...output_lines.map((l) => l.elapsed.length));
199
199
  const max_source_length = Math.max(...output_lines.map((l) => l.source.length));