ts-repo-utils 6.1.0 → 7.0.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 (51) hide show
  1. package/README.md +153 -33
  2. package/dist/cmd/assert-repo-is-clean.mjs +1 -1
  3. package/dist/cmd/check-should-run-type-checks.mjs +1 -1
  4. package/dist/cmd/format-diff-from.mjs +29 -8
  5. package/dist/cmd/format-diff-from.mjs.map +1 -1
  6. package/dist/cmd/format-uncommitted.d.mts +3 -0
  7. package/dist/cmd/format-uncommitted.d.mts.map +1 -0
  8. package/dist/cmd/format-uncommitted.mjs +59 -0
  9. package/dist/cmd/format-uncommitted.mjs.map +1 -0
  10. package/dist/cmd/gen-index-ts.mjs +1 -1
  11. package/dist/functions/assert-repo-is-clean.d.mts.map +1 -1
  12. package/dist/functions/assert-repo-is-clean.mjs +30 -30
  13. package/dist/functions/assert-repo-is-clean.mjs.map +1 -1
  14. package/dist/functions/diff.d.mts +32 -2
  15. package/dist/functions/diff.d.mts.map +1 -1
  16. package/dist/functions/diff.mjs +47 -29
  17. package/dist/functions/diff.mjs.map +1 -1
  18. package/dist/functions/exec-async.d.mts +4 -4
  19. package/dist/functions/exec-async.d.mts.map +1 -1
  20. package/dist/functions/exec-async.mjs +5 -5
  21. package/dist/functions/exec-async.mjs.map +1 -1
  22. package/dist/functions/format.d.mts +20 -11
  23. package/dist/functions/format.d.mts.map +1 -1
  24. package/dist/functions/format.mjs +136 -110
  25. package/dist/functions/format.mjs.map +1 -1
  26. package/dist/functions/gen-index.d.mts +2 -1
  27. package/dist/functions/gen-index.d.mts.map +1 -1
  28. package/dist/functions/gen-index.mjs +10 -8
  29. package/dist/functions/gen-index.mjs.map +1 -1
  30. package/dist/functions/index.mjs +2 -2
  31. package/dist/index.mjs +2 -2
  32. package/package.json +2 -2
  33. package/src/cmd/assert-repo-is-clean.mts +1 -1
  34. package/src/cmd/check-should-run-type-checks.mts +1 -1
  35. package/src/cmd/format-diff-from.mts +35 -9
  36. package/src/cmd/format-uncommitted.mts +67 -0
  37. package/src/cmd/gen-index-ts.mts +1 -1
  38. package/src/functions/assert-repo-is-clean.mts +43 -34
  39. package/src/functions/diff.mts +85 -32
  40. package/src/functions/diff.test.mts +569 -102
  41. package/src/functions/exec-async.mts +21 -29
  42. package/src/functions/exec-async.test.mts +77 -47
  43. package/src/functions/format.mts +222 -150
  44. package/src/functions/format.test.mts +625 -20
  45. package/src/functions/gen-index.mts +16 -10
  46. package/src/functions/workspace-utils/run-cmd-in-stages.test.mts +266 -0
  47. package/dist/cmd/format-untracked.d.mts +0 -3
  48. package/dist/cmd/format-untracked.d.mts.map +0 -1
  49. package/dist/cmd/format-untracked.mjs +0 -34
  50. package/dist/cmd/format-untracked.mjs.map +0 -1
  51. package/src/cmd/format-untracked.mts +0 -31
package/README.md CHANGED
@@ -72,21 +72,24 @@ npm exec -- assert-repo-is-clean --silent
72
72
 
73
73
  - `--silent` - Suppress output messages (optional)
74
74
 
75
- ### `format-untracked`
75
+ ### `format-uncommitted`
76
76
 
77
77
  Formats only untracked/modified files using Prettier.
78
78
 
79
79
  ```bash
80
80
  # Basic usage
81
- npm exec -- format-untracked
81
+ npm exec -- format-uncommitted
82
82
 
83
83
  # Silent mode
84
- npm exec -- format-untracked --silent
84
+ npm exec -- format-uncommitted --silent
85
85
  ```
86
86
 
87
87
  **Options:**
88
88
 
89
- - `--silent` - Suppress output messages (optional)
89
+ - `--exclude-untracked` - Exclude untracked files (default: false)
90
+ - `--exclude-modified` - Exclude modified files (default: false)
91
+ - `--exclude-staged` - Exclude staged files (default: false)
92
+ - `--silent` - Suppress output messages (default: false)
90
93
 
91
94
  ### `format-diff-from`
92
95
 
@@ -112,9 +115,10 @@ npm exec -- format-diff-from main --silent
112
115
  **Options:**
113
116
 
114
117
  - `<base>` - Base branch name or commit hash to compare against (required)
115
- - `--include-untracked` - Include untracked files in addition to diff files (default: true)
116
- - `--exclude-untracked` - Exclude untracked files, only format diff files (optional)
117
- - `--silent` - Suppress output messages (optional)
118
+ - `--exclude-untracked` - Exclude untracked files (default: false)
119
+ - `--exclude-modified` - Exclude modified files (default: false)
120
+ - `--exclude-staged` - Exclude staged files (default: false)
121
+ - `--silent` - Suppress output messages (default: false)
118
122
 
119
123
  ### `check-should-run-type-checks`
120
124
 
@@ -279,9 +283,49 @@ import { assertRepoIsClean } from 'ts-repo-utils';
279
283
  await assertRepoIsClean();
280
284
  ```
281
285
 
286
+ **Options:**
287
+
288
+ - `silent?` - Suppress output messages (default: false)
289
+
290
+ #### Getting Git diff files
291
+
292
+ ##### `getUntrackedFiles(options?)`
293
+
294
+ Get untracked files from the working tree (files not added to git).
295
+ Runs `git ls-files --others --exclude-standard [--deleted]`
296
+
297
+ ##### `getModifiedFiles(options?)`
298
+
299
+ Get modified files from the working tree (files that have been changed but not staged).
300
+ Runs `git diff --name-only [--diff-filter=d]`
301
+
302
+ ##### `getStagedFiles(options?)`
303
+
304
+ Get files that are staged for commit (files added with git add).
305
+ Runs `git diff --staged --name-only [--diff-filter=d]`
306
+
307
+ ##### `getDiffFrom(base: string, options?)`
308
+
309
+ Get files that differ from the specified base branch or commit.
310
+ Runs `git diff --name-only <base> [--diff-filter=d]`
311
+
312
+ **Common options:**
313
+
314
+ - `excludeDeleted?: boolean` - Exclude deleted files (for formatters etc.) (default: true)
315
+ - `silent?: boolean` - Don't log command/output (default: false)
316
+
317
+ **Common Return Type:**
318
+
319
+ ```typescript
320
+ type Ret = Result<
321
+ readonly string[],
322
+ ExecException | Readonly<{ message: string }>
323
+ >;
324
+ ```
325
+
282
326
  ### Command Execution
283
327
 
284
- #### `$(command: string, options?: { silent?: boolean; timeout?: number }): Promise<ExecResult>`
328
+ #### `$(command: string, options?: ExecOptions): Promise<ExecResult>`
285
329
 
286
330
  Executes a shell command asynchronously with timeout support and type-safe results.
287
331
 
@@ -300,45 +344,69 @@ if (result.type === 'ok') {
300
344
  **Options:**
301
345
 
302
346
  - `silent?: boolean` - Don't log command/output (default: false)
303
- - `timeout?: number` - Timeout in milliseconds (default: 30000)
347
+ - `'node:child_process'` `exec` function options
304
348
 
305
349
  **Return Type:**
306
350
 
307
351
  ```typescript
308
- type ExecResult = Readonly<
309
- | { type: 'ok'; stdout: string; stderr: string }
310
- | { type: 'error'; exception: ExecException }
352
+ type Ret = Promise<
353
+ Result<
354
+ Readonly<{ stdout: string | Buffer; stderr: string | Buffer }>,
355
+ import('node:child_process').ExecException
356
+ >
311
357
  >;
312
358
  ```
313
359
 
314
360
  ### Code Formatting Utilities
315
361
 
316
- #### `formatFiles(pathGlob: string): Promise<'ok' | 'err'>`
362
+ #### `formatFilesGlob(pathGlob: string): Promise<Result<undefined, unknown>>`
317
363
 
318
364
  Format files matching a glob pattern using Prettier.
319
365
 
320
366
  ```typescript
321
- import { formatFiles } from 'ts-repo-utils';
367
+ import { formatFilesGlob } from 'ts-repo-utils';
322
368
 
323
369
  // Format all TypeScript files in src
324
- await formatFiles('src/**/*.ts');
370
+ await formatFilesGlob('src/**/*.ts');
325
371
 
326
372
  // Format specific files
327
- await formatFiles('src/{index,utils}.ts');
373
+ await formatFilesGlob('src/{index,utils}.ts');
328
374
  ```
329
375
 
330
- #### `formatUntracked(): Promise<'ok' | 'err'>`
376
+ **Options:**
377
+
378
+ - `silent?` - Suppress output messages (default: false)
379
+
380
+ #### `formatUncommittedFiles(): Promise<Result>`
331
381
 
332
382
  Format only files that have been changed according to git status.
333
383
 
334
384
  ```typescript
335
- import { formatUntracked } from 'ts-repo-utils';
385
+ import { formatUncommittedFiles } from 'ts-repo-utils';
336
386
 
337
387
  // Format only modified files
338
- await formatUntracked();
388
+ await formatUncommittedFiles();
339
389
  ```
340
390
 
341
- #### `formatDiffFrom(base: string): Promise<'ok' | 'err'>`
391
+ **Options:**
392
+
393
+ - `untracked?` - Format untracked files (default: true)
394
+ - `modified?` - Format modified files (default: true)
395
+ - `staged?` - Format staged files (default: true)
396
+ - `silent?` - Suppress output messages (default: false)
397
+
398
+ **Return Type:**
399
+
400
+ ```typescript
401
+ type Ret = Promise<
402
+ Result<
403
+ undefined,
404
+ ExecException | Readonly<{ message: string }> | readonly unknown[]
405
+ >
406
+ >;
407
+ ```
408
+
409
+ #### `formatDiffFrom(base: string): Promise<Result>`
342
410
 
343
411
  Format only files that differ from the specified base branch or commit.
344
412
 
@@ -352,9 +420,27 @@ await formatDiffFrom('main');
352
420
  await formatDiffFrom('abc123');
353
421
  ```
354
422
 
423
+ **Options:**
424
+
425
+ - `includeUntracked?` - Include untracked files in addition to diff files (default: true)
426
+ - `includeModified?` - Include modified files in addition to diff files (default: true)
427
+ - `includeStaged?` - Include staged files in addition to diff files (default: true)
428
+ - `silent?` - Suppress output messages (default: false)
429
+
430
+ **Return Type:**
431
+
432
+ ```typescript
433
+ type Ret = Promise<
434
+ Result<
435
+ undefined,
436
+ ExecException | Readonly<{ message: string }> | readonly unknown[]
437
+ >
438
+ >;
439
+ ```
440
+
355
441
  ### Index File Generation
356
442
 
357
- #### `genIndex(config: GenIndexConfig): Promise<void>`
443
+ #### `genIndex(config: GenIndexConfig): Promise<Result<undefined, unknown>>`
358
444
 
359
445
  Generates index files recursively in target directories with automatic barrel exports.
360
446
 
@@ -363,9 +449,7 @@ import { genIndex } from 'ts-repo-utils';
363
449
 
364
450
  await genIndex({
365
451
  targetDirectory: './src',
366
- sourceExtension: '.ts',
367
- exportExtension: '.js',
368
- excludePatterns: ['*.test.ts', '*.spec.ts'],
452
+ exclude: ['*.test.ts', '*.spec.ts'],
369
453
  });
370
454
  ```
371
455
 
@@ -373,10 +457,41 @@ await genIndex({
373
457
 
374
458
  ```typescript
375
459
  type GenIndexConfig = DeepReadonly<{
376
- targetDirectory: string | string[]; // Target directories to generate index files for
377
- sourceExtension?: `.${string}`; // File extension of source files (default: '.mts')
378
- exportExtension?: `.${string}`; // Extension to use in exports (default: '.mjs')
379
- excludePatterns?: string[]; // Glob patterns to exclude (default: excludes .d.* and .test.*)
460
+ /**
461
+ * Target directories to generate index files for (string or array of
462
+ * strings)
463
+ */
464
+ targetDirectory: string | readonly string[];
465
+
466
+ /**
467
+ * Glob patterns of files or predicate function to exclude from exports
468
+ * (default: excludes `'**\/*.{test,spec}.?(c|m)[jt]s?(x)'` and
469
+ * `'**\/*.d.?(c|m)ts'`)
470
+ */
471
+ exclude?:
472
+ | readonly string[]
473
+ | ((
474
+ args: Readonly<{
475
+ absolutePath: string;
476
+ relativePath: string;
477
+ fileName: string;
478
+ }>,
479
+ ) => boolean);
480
+
481
+ /** File extensions of source files to export (default: ['.ts', '.tsx']) */
482
+ targetExtensions?: readonly `.${string}`[];
483
+
484
+ /** File extension of index files to generate (default: '.ts') */
485
+ indexFileExtension?: `.${string}`;
486
+
487
+ /** File extension to use in export statements (default: '.js') */
488
+ exportStatementExtension?: `.${string}` | 'none';
489
+
490
+ /** Command to run for formatting generated files (optional) */
491
+ formatCommand?: string;
492
+
493
+ /** Whether to suppress output during execution (default: false) */
494
+ silent?: boolean;
380
495
  }>;
381
496
  ```
382
497
 
@@ -388,6 +503,11 @@ type GenIndexConfig = DeepReadonly<{
388
503
  - Works with both single directories and directory arrays
389
504
  - Respects source and export extension configuration
390
505
 
506
+ **Benefits:**
507
+
508
+ - Prevents forgetting to export libraries
509
+ - tsc can detect duplicate variables, type names, etc.
510
+
391
511
  ## Key Features
392
512
 
393
513
  - **Type Safety**: All functions use strict TypeScript types with readonly parameters
@@ -406,14 +526,14 @@ type GenIndexConfig = DeepReadonly<{
406
526
  ```typescript
407
527
  import { formatUntracked, assertExt, assertRepoIsClean } from 'ts-repo-utils';
408
528
 
409
- // Format changed files
410
- await formatUntracked();
411
-
412
529
  // Validate file extensions
413
530
  await assertExt({
414
531
  directories: [{ path: './src', extension: '.ts' }],
415
532
  });
416
533
 
534
+ // Format changed files
535
+ await formatUncommittedFiles();
536
+
417
537
  // Ensure repository is clean (exits if dirty)
418
538
  await assertRepoIsClean();
419
539
  ```
@@ -421,7 +541,7 @@ await assertRepoIsClean();
421
541
  ### Build Pipeline
422
542
 
423
543
  ```typescript
424
- import { assertExt, genIndex, $, formatFiles } from 'ts-repo-utils';
544
+ import { assertExt, genIndex, $, formatFilesGlob } from 'ts-repo-utils';
425
545
 
426
546
  // Validate extensions
427
547
  await assertExt({
@@ -441,7 +561,7 @@ await $('tsc --noEmit');
441
561
  await $('rollup -c');
442
562
 
443
563
  // Format output
444
- await formatFiles('dist/**/*.js');
564
+ await formatFilesGlob('dist/**/*.js');
445
565
  ```
446
566
 
447
567
  ### Project Validation
@@ -10,7 +10,7 @@ import 'child_process';
10
10
 
11
11
  const cmdDef = cmd.command({
12
12
  name: 'assert-repo-is-clean-cli',
13
- version: '6.1.0',
13
+ version: '7.0.0',
14
14
  args: {
15
15
  silent: cmd.flag({
16
16
  long: 'silent',
@@ -10,7 +10,7 @@ import 'child_process';
10
10
 
11
11
  const cmdDef = cmd.command({
12
12
  name: 'check-should-run-type-checks-cli',
13
- version: '6.1.0',
13
+ version: '7.0.0',
14
14
  args: {
15
15
  pathsIgnore: cmd.multioption({
16
16
  long: 'paths-ignore',
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  import * as cmd from 'cmd-ts';
3
- import 'ts-data-forge';
3
+ import { Result } from 'ts-data-forge';
4
4
  import '../node-global.mjs';
5
5
  import 'node:child_process';
6
6
  import { formatDiffFrom } from '../functions/format.mjs';
@@ -9,17 +9,27 @@ import 'child_process';
9
9
 
10
10
  const cmdDef = cmd.command({
11
11
  name: 'format-diff-from-cli',
12
- version: '6.1.0',
12
+ version: '7.0.0',
13
13
  args: {
14
14
  base: cmd.positional({
15
15
  type: cmd.string,
16
16
  displayName: 'base',
17
17
  description: 'Base branch name or commit hash to compare against',
18
18
  }),
19
- includeUntracked: cmd.flag({
20
- long: 'include-untracked',
19
+ excludeUntracked: cmd.flag({
20
+ long: 'exclude-untracked',
21
21
  type: cmd.optional(cmd.boolean),
22
- description: 'Include untracked files in addition to diff files (default: true)',
22
+ description: 'Exclude untracked files in addition to diff files (default: false)',
23
+ }),
24
+ excludeModified: cmd.flag({
25
+ long: 'exclude-modified',
26
+ type: cmd.optional(cmd.boolean),
27
+ description: 'Exclude modified files in addition to diff files (default: false)',
28
+ }),
29
+ excludeStaged: cmd.flag({
30
+ long: 'exclude-staged',
31
+ type: cmd.optional(cmd.boolean),
32
+ description: 'Exclude staged files in addition to diff files (default: false)',
23
33
  }),
24
34
  silent: cmd.flag({
25
35
  long: 'silent',
@@ -28,15 +38,26 @@ const cmdDef = cmd.command({
28
38
  }),
29
39
  },
30
40
  handler: (args) => {
31
- main(args).catch((error) => {
41
+ main({
42
+ base: args.base,
43
+ excludeUntracked: args.excludeUntracked ?? false,
44
+ excludeModified: args.excludeModified ?? false,
45
+ excludeStaged: args.excludeStaged ?? false,
46
+ silent: args.silent ?? false,
47
+ }).catch((error) => {
32
48
  console.error('An error occurred:', error);
33
49
  process.exit(1);
34
50
  });
35
51
  },
36
52
  });
37
53
  const main = async (args) => {
38
- const result = await formatDiffFrom(args.base, args);
39
- if (result === 'err') {
54
+ const result = await formatDiffFrom(args.base, {
55
+ includeUntracked: !args.excludeUntracked,
56
+ includeModified: !args.excludeModified,
57
+ includeStaged: !args.excludeStaged,
58
+ silent: args.silent,
59
+ });
60
+ if (Result.isErr(result)) {
40
61
  process.exit(1);
41
62
  }
42
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"format-diff-from.mjs","sources":["../../src/cmd/format-diff-from.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,sBAAsB;AAC5B,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC;YACnB,IAAI,EAAE,GAAG,CAAC,MAAM;AAChB,YAAA,WAAW,EAAE,MAAM;AACnB,YAAA,WAAW,EAAE,oDAAoD;SAClE,CAAC;AACF,QAAA,gBAA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K;AAC7B,SAAA,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC;AAC1C,YAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjB,QAAA,CAAC,CAAC;IACJ,CAAC;AACF,CAAA,CAAC;AAEF,MAAM,IAAI,GAAG,OACX,IAME,KACe;IACjB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE;AAC7C,QAAA,gBAAgB,EAAE,CAAC,IAAI,CAAC,gBAAgB;AACxC,QAAA,eAAe,EAAE,CAAC,IAAI,CAAC,eAAe;AACtC,QAAA,aAAa,EAAE,CAAC,IAAI,CAAC,aAAa;QAClC,MAAM,EAAE,IAAI,CAAC,MAAM;AACpB,KAAA,CAAC;AAEF,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACxB,QAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjB;AACF,CAAC;AAED,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env -S npx tsx
2
+ export {};
3
+ //# sourceMappingURL=format-uncommitted.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-uncommitted.d.mts","sourceRoot":"","sources":["../../src/cmd/format-uncommitted.mts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env -S npx tsx
2
+ import * as cmd from 'cmd-ts';
3
+ import { Result } from 'ts-data-forge';
4
+ import '../node-global.mjs';
5
+ import 'node:child_process';
6
+ import { formatUncommittedFiles } from '../functions/format.mjs';
7
+ import 'micromatch';
8
+ import 'child_process';
9
+
10
+ const cmdDef = cmd.command({
11
+ name: 'format-uncommitted-cli',
12
+ version: '7.0.0',
13
+ args: {
14
+ excludeUntracked: cmd.flag({
15
+ long: 'exclude-untracked',
16
+ type: cmd.optional(cmd.boolean),
17
+ description: 'Exclude untracked files in addition to diff files (default: false)',
18
+ }),
19
+ excludeModified: cmd.flag({
20
+ long: 'exclude-modified',
21
+ type: cmd.optional(cmd.boolean),
22
+ description: 'Exclude modified files in addition to diff files (default: false)',
23
+ }),
24
+ excludeStaged: cmd.flag({
25
+ long: 'exclude-staged',
26
+ type: cmd.optional(cmd.boolean),
27
+ description: 'Exclude staged files in addition to diff files (default: false)',
28
+ }),
29
+ silent: cmd.flag({
30
+ long: 'silent',
31
+ type: cmd.optional(cmd.boolean),
32
+ description: 'If true, suppresses output messages (default: false)',
33
+ }),
34
+ },
35
+ handler: (args) => {
36
+ main({
37
+ excludeUntracked: args.excludeUntracked ?? false,
38
+ excludeModified: args.excludeModified ?? false,
39
+ excludeStaged: args.excludeStaged ?? false,
40
+ silent: args.silent ?? false,
41
+ }).catch((error) => {
42
+ console.error('An error occurred:', error);
43
+ process.exit(1);
44
+ });
45
+ },
46
+ });
47
+ const main = async (args) => {
48
+ const result = await formatUncommittedFiles({
49
+ untracked: !args.excludeUntracked,
50
+ modified: !args.excludeModified,
51
+ staged: !args.excludeStaged,
52
+ silent: args.silent,
53
+ });
54
+ if (Result.isErr(result)) {
55
+ process.exit(1);
56
+ }
57
+ };
58
+ await cmd.run(cmdDef, process.argv.slice(2));
59
+ //# sourceMappingURL=format-uncommitted.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-uncommitted.mjs","sources":["../../src/cmd/format-uncommitted.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAMA,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,wBAAwB;AAC9B,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,IAAI,EAAE;AACJ,QAAA,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC;AACzB,YAAA,IAAI,EAAE,mBAAmB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IAKE,KACe;AACjB,IAAA,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC;AAC1C,QAAA,SAAS,EAAE,CAAC,IAAI,CAAC,gBAAgB;AACjC,QAAA,QAAQ,EAAE,CAAC,IAAI,CAAC,eAAe;AAC/B,QAAA,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;AACpB,KAAA,CAAC;AACF,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACxB,QAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjB;AACF,CAAC;AAED,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -28,7 +28,7 @@ const nonEmptyArray = (t, commandName) => cmd.extendType(cmd.array(t), {
28
28
  });
29
29
  const cmdDef = cmd.command({
30
30
  name: 'gen-index-ts-cli',
31
- version: '6.1.0',
31
+ version: '7.0.0',
32
32
  args: {
33
33
  // required args
34
34
  targetDirectory: cmd.positional({
@@ -1 +1 @@
1
- {"version":3,"file":"assert-repo-is-clean.d.mts","sourceRoot":"","sources":["../../src/functions/assert-repo-is-clean.mts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,QAAQ,CAAC;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvC,OAAO,CAAC,OAAO,CAGjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,QAAQ,CAAC;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvC,OAAO,CAAC,IAAI,CAiCd,CAAC"}
1
+ {"version":3,"file":"assert-repo-is-clean.d.mts","sourceRoot":"","sources":["../../src/functions/assert-repo-is-clean.mts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,QAAQ,CAAC;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvC,OAAO,CAAC,OAAO,CAMjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,QAAQ,CAAC;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,KACvC,OAAO,CAAC,IAAI,CAkCd,CAAC"}
@@ -9,41 +9,41 @@ import '../node-global.mjs';
9
9
  */
10
10
  const repoIsDirty = async (options) => {
11
11
  const status = await getGitStatus({ silent: options?.silent ?? false });
12
- return status.isDirty;
12
+ if (Result.isErr(status)) {
13
+ throw new Error(`Failed to get git status: ${status.value}`);
14
+ }
15
+ return status.value.isDirty;
13
16
  };
14
17
  /**
15
18
  * Checks if the repository is clean and exits with code 1 if it is dirty. Shows
16
19
  * git status and diff output before exiting.
17
20
  */
18
21
  const assertRepoIsClean = async (options) => {
19
- try {
20
- const status = await getGitStatus({ silent: options?.silent ?? false });
21
- if (!status.isDirty) {
22
- echo('Repo is clean\n');
23
- return;
24
- }
25
- echo('Repo is dirty\n');
26
- echo('Changed files:\n');
27
- echo(status.stdout);
28
- // Show files not tracked by git and unstaged changes
29
- const addResult = await $('git add -N .', {
30
- silent: options?.silent ?? false,
31
- });
32
- if (Result.isErr(addResult)) {
33
- echo('Warning: Failed to add untracked files for diff\n');
34
- }
35
- const diffResult = await $('git diff', {
36
- silent: options?.silent ?? false,
37
- });
38
- if (Result.isErr(diffResult)) {
39
- echo('Warning: Failed to show diff\n');
40
- }
41
- process.exit(1);
22
+ const silent = options?.silent ?? false;
23
+ const conditionalEcho = silent ? () => { } : echo;
24
+ const gitStatusResult = await getGitStatus({ silent });
25
+ if (Result.isErr(gitStatusResult)) {
26
+ conditionalEcho(gitStatusResult.value);
27
+ return;
28
+ }
29
+ const gitStatus = gitStatusResult.value;
30
+ if (!gitStatus.isDirty) {
31
+ conditionalEcho('Repo is clean\n');
32
+ return;
42
33
  }
43
- catch (error) {
44
- echo(`Error checking repository status: ${String(error)}\n`);
45
- process.exit(1);
34
+ conditionalEcho('Repo is dirty\n');
35
+ conditionalEcho('Changed files:\n');
36
+ conditionalEcho(gitStatus.stdout);
37
+ // Show files not tracked by git and unstaged changes
38
+ const addResult = await $('git add -N .', { silent });
39
+ if (Result.isErr(addResult)) {
40
+ conditionalEcho('Warning: Failed to add untracked files for diff\n');
46
41
  }
42
+ const diffResult = await $('git diff', { silent });
43
+ if (Result.isErr(diffResult)) {
44
+ conditionalEcho('Warning: Failed to show diff\n');
45
+ }
46
+ process.exit(1);
47
47
  };
48
48
  /**
49
49
  * Gets the git status of the repository.
@@ -55,13 +55,13 @@ const getGitStatus = async (options) => {
55
55
  silent: options?.silent ?? false,
56
56
  });
57
57
  if (Result.isErr(res)) {
58
- throw new Error(`Failed to get git status: ${res.value.message}`);
58
+ return Result.err(`Failed to get git status: ${res.value.message}`);
59
59
  }
60
60
  const { stdout } = res.value;
61
- return {
61
+ return Result.ok({
62
62
  isDirty: stdout.trim() !== '',
63
63
  stdout,
64
- };
64
+ });
65
65
  };
66
66
 
67
67
  export { assertRepoIsClean, repoIsDirty };
@@ -1 +1 @@
1
- {"version":3,"file":"assert-repo-is-clean.mjs","sources":["../../src/functions/assert-repo-is-clean.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGA;;;;;AAKG;MACU,WAAW,GAAG,OACzB,OAAwC,KACpB;AACpB,IAAA,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC;IACvE,OAAO,MAAM,CAAC,OAAO;AACvB;AAEA;;;AAGG;MACU,iBAAiB,GAAG,OAC/B,OAAwC,KACvB;AACjB,IAAA,IAAI;AACF,QAAA,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAA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CAAC,OAAO,CAAA,CAAE,CAAC;IACnE;AAEA,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK;IAE5B,OAAO;AACL,QAAA,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;QAC7B,MAAM;KACP;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"assert-repo-is-clean.mjs","sources":["../../src/functions/assert-repo-is-clean.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGA;;;;;AAKG;MACU,WAAW,GAAG,OACzB,OAAwC,KACpB;AACpB,IAAA,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC;AACvE,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,CAAA,0BAAA,EAA6B,MAAM,CAAC,KAAK,CAAA,CAAE,CAAC;IAC9D;AACA,IAAA,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO;AAC7B;AAEA;;;AAGG;MACU,iBAAiB,GAAG,OAC/B,OAAwC,KACvB;AACjB,IAAA,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK;AACvC,IAAA,MAAM,eAAe,GAAG,MAAM,GAAG,MAAK,EAAE,CAAC,GAAG,IAAI;IAEhD,MAAM,eAAe,GAAG,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;AAEtD,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE;AACjC,QAAA,eAAe,CAAC,eAAe,CAAC,KAAK,CAAC;QACtC;IACF;AAEA,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK;AAEvC,IAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;QACtB,eAAe,CAAC,iBAAiB,CAAC;QAClC;IACF;IAEA,eAAe,CAAC,iBAAiB,CAAC;IAClC,eAAe,CAAC,kBAAkB,CAAC;AACnC,IAAA,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC;;IAGjC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC;AACrD,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QAC3B,eAAe,CAAC,mDAAmD,CAAC;IACtE;IAEA,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC;AAClD,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC5B,eAAe,CAAC,gCAAgC,CAAC;IACnD;AAEA,IAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjB;AAEA;;;;AAIG;AACH,MAAM,YAAY,GAAG,OACnB,OAAwC,KAStC;AACF,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,wBAAwB,EAAE;AAC5C,QAAA,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK;AACjC,KAAA,CAAC;AAEF,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACrB,QAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA,0BAAA,EAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAA,CAAE,CAAC;IACrE;AAEA,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK;IAE5B,OAAO,MAAM,CAAC,EAAE,CAAC;AACf,QAAA,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;QAC7B,MAAM;AACP,KAAA,CAAC;AACJ,CAAC;;;;"}
@@ -1,7 +1,10 @@
1
1
  import { type ExecException } from 'node:child_process';
2
2
  import { Result } from 'ts-data-forge';
3
3
  import '../node-global.mjs';
4
- /** Get files that have been changed (git status). */
4
+ /**
5
+ * Get untracked files from the working tree (files not added to git). Runs `git
6
+ * ls-files --others --exclude-standard [--deleted]`
7
+ */
5
8
  export declare const getUntrackedFiles: (options?: Readonly<{
6
9
  /** @default true */
7
10
  excludeDeleted?: boolean;
@@ -10,7 +13,34 @@ export declare const getUntrackedFiles: (options?: Readonly<{
10
13
  }>) => Promise<Result<readonly string[], ExecException | Readonly<{
11
14
  message: string;
12
15
  }>>>;
13
- /** Get files that differ from the specified base branch or commit */
16
+ /**
17
+ * Get modified files from the working tree (files that have been changed but
18
+ * not staged). Runs `git diff --name-only [--diff-filter=d]`
19
+ */
20
+ export declare const getModifiedFiles: (options?: Readonly<{
21
+ /** @default true */
22
+ excludeDeleted?: boolean;
23
+ /** @default false */
24
+ silent?: boolean;
25
+ }>) => Promise<Result<readonly string[], ExecException | Readonly<{
26
+ message: string;
27
+ }>>>;
28
+ /**
29
+ * Get files that are staged for commit (files added with git add). Runs `git
30
+ * diff --staged --name-only [--diff-filter=d]`
31
+ */
32
+ export declare const getStagedFiles: (options?: Readonly<{
33
+ /** @default true */
34
+ excludeDeleted?: boolean;
35
+ /** @default false */
36
+ silent?: boolean;
37
+ }>) => Promise<Result<readonly string[], ExecException | Readonly<{
38
+ message: string;
39
+ }>>>;
40
+ /**
41
+ * Get files that differ from the specified base branch or commit. Runs `git
42
+ * diff --name-only <base> [--diff-filter=d]`
43
+ */
14
44
  export declare const getDiffFrom: (base: string, options?: Readonly<{
15
45
  /** @default true */
16
46
  excludeDeleted?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"diff.d.mts","sourceRoot":"","sources":["../../src/functions/diff.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,oBAAoB,CAAC;AAE5B,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,GAC5B,UAAU,QAAQ,CAAC;IACjB,oBAAoB;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB;IACrB,M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