ts-repo-utils 7.7.3 → 7.8.1

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 (54) hide show
  1. package/README.md +197 -144
  2. package/dist/cmd/assert-repo-is-clean.mjs +1 -1
  3. package/dist/cmd/assert-repo-is-clean.mjs.map +1 -1
  4. package/dist/cmd/check-should-run-type-checks.mjs +1 -1
  5. package/dist/cmd/check-should-run-type-checks.mjs.map +1 -1
  6. package/dist/cmd/format-diff-from.mjs +1 -1
  7. package/dist/cmd/format-diff-from.mjs.map +1 -1
  8. package/dist/cmd/format-uncommitted.mjs +1 -1
  9. package/dist/cmd/format-uncommitted.mjs.map +1 -1
  10. package/dist/cmd/gen-index-ts.mjs +1 -1
  11. package/dist/cmd/gen-index-ts.mjs.map +1 -1
  12. package/dist/entry-point.mjs +2 -1
  13. package/dist/entry-point.mjs.map +1 -1
  14. package/dist/functions/assert-ext.d.mts +20 -1
  15. package/dist/functions/assert-ext.d.mts.map +1 -1
  16. package/dist/functions/assert-ext.mjs +52 -35
  17. package/dist/functions/assert-ext.mjs.map +1 -1
  18. package/dist/functions/create-result-assert.d.mts +18 -0
  19. package/dist/functions/create-result-assert.d.mts.map +1 -0
  20. package/dist/functions/create-result-assert.mjs +40 -0
  21. package/dist/functions/create-result-assert.mjs.map +1 -0
  22. package/dist/functions/exec-async.d.mts +5 -6
  23. package/dist/functions/exec-async.d.mts.map +1 -1
  24. package/dist/functions/exec-async.mjs +26 -7
  25. package/dist/functions/exec-async.mjs.map +1 -1
  26. package/dist/functions/format.d.mts.map +1 -1
  27. package/dist/functions/format.mjs +8 -2
  28. package/dist/functions/format.mjs.map +1 -1
  29. package/dist/functions/index.d.mts +1 -0
  30. package/dist/functions/index.d.mts.map +1 -1
  31. package/dist/functions/index.mjs +2 -1
  32. package/dist/functions/index.mjs.map +1 -1
  33. package/dist/functions/workspace-utils/execute-parallel.mjs.map +1 -1
  34. package/dist/index.mjs +2 -1
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/node-global.d.mts +2 -0
  37. package/dist/node-global.d.mts.map +1 -1
  38. package/dist/node-global.mjs +3 -1
  39. package/dist/node-global.mjs.map +1 -1
  40. package/package.json +20 -14
  41. package/src/cmd/assert-repo-is-clean.mts +2 -2
  42. package/src/cmd/check-should-run-type-checks.mts +2 -2
  43. package/src/cmd/format-diff-from.mts +2 -2
  44. package/src/cmd/format-uncommitted.mts +2 -2
  45. package/src/cmd/gen-index-ts.mts +3 -3
  46. package/src/functions/assert-ext.mts +78 -52
  47. package/src/functions/create-result-assert.mts +59 -0
  48. package/src/functions/exec-async.mts +71 -14
  49. package/src/functions/exec-async.test.mts +5 -5
  50. package/src/functions/format.mts +11 -3
  51. package/src/functions/index.mts +1 -0
  52. package/src/functions/workspace-utils/execute-parallel.mts +1 -1
  53. package/src/functions/workspace-utils/run-cmd-in-stages.test.mts +5 -8
  54. package/src/node-global.mts +4 -1
package/README.md CHANGED
@@ -295,9 +295,9 @@ import { assertPathExists } from 'ts-repo-utils';
295
295
  await assertPathExists('./src/index.ts', 'Entry point file');
296
296
  ```
297
297
 
298
- #### `assertExt(config: CheckExtConfig): Promise<void>`
298
+ #### `checkExt(config: CheckExtConfig): Promise<Result<undefined, Readonly<{ message: string; files: readonly string[] }>>>`
299
299
 
300
- Validates that all files in specified directories have the correct extensions. Exits with code 1 if any files have incorrect extensions.
300
+ Runs the extension validation and reports findings without exiting the process. Useful when you want to combine extension checks with other validations or surface the failure information in a custom way.
301
301
 
302
302
  ```tsx
303
303
  import { assertExt } from 'ts-repo-utils';
@@ -317,7 +317,9 @@ await assertExt({
317
317
  });
318
318
  ```
319
319
 
320
- **Configuration Type:**
320
+ #### `assertExt(config: CheckExtConfig): Promise<void>`
321
+
322
+ Validates that all files in specified directories have the correct extensions. Exits with code 1 if any files have incorrect extensions.
321
323
 
322
324
  ```tsx
323
325
  type CheckExtConfig = Readonly<{
@@ -329,9 +331,7 @@ type CheckExtConfig = Readonly<{
329
331
  }>;
330
332
  ```
331
333
 
332
- #### `makeEmptyDir(dir: string): Promise<void>`
333
-
334
- Removes any existing directory at `dir` and recreates it, ensuring a clean target for generated assets or build output.
334
+ **Configuration Type:**
335
335
 
336
336
  ```tsx
337
337
  import { makeEmptyDir } from 'ts-repo-utils';
@@ -340,13 +340,11 @@ import { makeEmptyDir } from 'ts-repo-utils';
340
340
  await makeEmptyDir('./tmp/build');
341
341
  ```
342
342
 
343
- This helper uses `fs.rm` with `recursive` cleanup before calling `fs.mkdir`, so prefer it over manual `rimraf` + `mkdir` sequences when scripting workflows.
343
+ ### Result Utilities
344
344
 
345
- ### Git Repository Utilities
345
+ #### `createResultAssert(options): (config) => Promise<TOk>`
346
346
 
347
- #### `repoIsDirty(): Promise<boolean>`
348
-
349
- Checks if the repository has uncommitted changes.
347
+ Creates an assert-style wrapper around a function that returns a `Result`, exiting the process with a non-zero code when the underlying function yields an error. The wrapper keeps success handling customizable while reusing the composable Result-based variant elsewhere.
350
348
 
351
349
  ```tsx
352
350
  import { repoIsDirty } from 'ts-repo-utils';
@@ -357,10 +355,16 @@ if (isDirty) {
357
355
  }
358
356
  ```
359
357
 
360
- #### `assertRepoIsClean(): Promise<void>`
358
+ **Options:**
361
359
 
362
- Checks if the repository is clean and exits with code 1 if it has uncommitted changes (shows changes and diff).
363
- (Function version of the `assert-repo-is-clean` command)
360
+ - `run` - Function returning a `Result` to assert (required)
361
+ - `onSuccess` - Optional callback invoked with the OK value
362
+ - `onError` - Optional callback invoked with the Err value before exiting
363
+ - `exitCode` - Custom exit code on failure (default: `1`)
364
+
365
+ #### `makeEmptyDir(dir: string): Promise<void>`
366
+
367
+ Removes any existing directory at `dir` and recreates it, ensuring a clean target for generated assets or build output.
364
368
 
365
369
  ```tsx
366
370
  import { assertRepoIsClean } from 'ts-repo-utils';
@@ -369,38 +373,13 @@ import { assertRepoIsClean } from 'ts-repo-utils';
369
373
  await assertRepoIsClean();
370
374
  ```
371
375
 
372
- **Options:**
373
-
374
- - `silent?` - Suppress output messages (default: false)
375
-
376
- #### Getting Git diff files
377
-
378
- ##### `getUntrackedFiles(options?)`
379
-
380
- Gets untracked files from the working tree (files not added to git).
381
- Runs `git ls-files --others --exclude-standard [--deleted]`
382
-
383
- ##### `getModifiedFiles(options?)`
384
-
385
- Gets modified files from the working tree (files that have been changed but not staged).
386
- Runs `git diff --name-only [--diff-filter=d]`
387
-
388
- ##### `getStagedFiles(options?)`
389
-
390
- Gets files that are staged for commit (files added with git add).
391
- Runs `git diff --staged --name-only [--diff-filter=d]`
392
-
393
- ##### `getDiffFrom(base: string, options?)`
394
-
395
- Gets files that differ from the specified base branch or commit.
396
- Runs `git diff --name-only <base> [--diff-filter=d]`
376
+ This helper uses `fs.rm` with `recursive` cleanup before calling `fs.mkdir`, so prefer it over manual `rimraf` + `mkdir` sequences when scripting workflows.
397
377
 
398
- **Common options:**
378
+ ### Git Repository Utilities
399
379
 
400
- - `excludeDeleted?: boolean` - Exclude deleted files (for formatters etc.) (default: true)
401
- - `silent?: boolean` - Don't log command/output (default: false)
380
+ #### `repoIsDirty(): Promise<boolean>`
402
381
 
403
- **Common Return Type:**
382
+ Checks if the repository has uncommitted changes.
404
383
 
405
384
  ```tsx
406
385
  import { type ExecException } from 'node:child_process';
@@ -411,12 +390,10 @@ type Ret = Result<
411
390
  >;
412
391
  ```
413
392
 
414
- #### Build Optimization Utilities
415
-
416
- ##### `checkShouldRunTypeChecks(options?): Promise<boolean>`
393
+ #### `assertRepoIsClean(): Promise<void>`
417
394
 
418
- Checks whether TypeScript type checks should run based on file changes from the base branch. Optimizes CI/CD pipelines by skipping type checks when only non-TypeScript files have changed.
419
- (Function version of the `check-should-run-type-checks` command)
395
+ Checks if the repository is clean and exits with code 1 if it has uncommitted changes (shows changes and diff).
396
+ (Function version of the `assert-repo-is-clean` command)
420
397
 
421
398
  ```tsx
422
399
  import { checkShouldRunTypeChecks } from 'ts-repo-utils';
@@ -437,18 +414,36 @@ const shouldRun2 = await checkShouldRunTypeChecks({
437
414
 
438
415
  **Options:**
439
416
 
440
- - `pathsIgnore?` - Patterns to ignore when checking if type checks should run:
441
- - Exact file matches: `.cspell.json`
442
- - Directory prefixes: `docs/` (matches any file in docs directory)
443
- - File extensions: `**.md` (matches any markdown file)
444
- - Default: `['LICENSE', '.editorconfig', '.gitignore', '.cspell.json', '.markdownlint-cli2.mjs', '.npmignore', '.prettierignore', '.prettierrc', 'docs/', '**.md', '**.txt']`
445
- - `baseBranch?` - Base branch to compare against (default: `origin/main`)
417
+ - `silent?` - Suppress output messages (default: false)
446
418
 
447
- ### Code Formatting Utilities
419
+ #### Getting Git diff files
448
420
 
449
- #### `formatFilesGlob(pathGlob: string, options?): Promise<Result<undefined, unknown>>`
421
+ ##### `getUntrackedFiles(options?)`
450
422
 
451
- Formats files matching a glob pattern using Prettier.
423
+ Gets untracked files from the working tree (files not added to git).
424
+ Runs `git ls-files --others --exclude-standard [--deleted]`
425
+
426
+ ##### `getModifiedFiles(options?)`
427
+
428
+ Gets modified files from the working tree (files that have been changed but not staged).
429
+ Runs `git diff --name-only [--diff-filter=d]`
430
+
431
+ ##### `getStagedFiles(options?)`
432
+
433
+ Gets files that are staged for commit (files added with git add).
434
+ Runs `git diff --staged --name-only [--diff-filter=d]`
435
+
436
+ ##### `getDiffFrom(base: string, options?)`
437
+
438
+ Gets files that differ from the specified base branch or commit.
439
+ Runs `git diff --name-only <base> [--diff-filter=d]`
440
+
441
+ **Common options:**
442
+
443
+ - `excludeDeleted?: boolean` - Exclude deleted files (for formatters etc.) (default: true)
444
+ - `silent?: boolean` - Don't log command/output (default: false)
445
+
446
+ **Common Return Type:**
452
447
 
453
448
  ```tsx
454
449
  import { formatFilesGlob } from 'ts-repo-utils';
@@ -466,16 +461,12 @@ await formatFilesGlob('src/**/*.ts', {
466
461
  });
467
462
  ```
468
463
 
469
- **Options:**
470
-
471
- - `silent?` - Suppress output messages (default: false)
472
- - `ignoreUnknown?` - Skip files without a Prettier parser instead of erroring (default: true)
473
- - `ignore?` - Custom function to ignore files (default: built-in ignore list)
464
+ #### Build Optimization Utilities
474
465
 
475
- #### `formatUncommittedFiles(options?): Promise<Result>`
466
+ ##### `checkShouldRunTypeChecks(options?): Promise<boolean>`
476
467
 
477
- Formats only files that have been changed according to git status.
478
- (Function version of the `format-uncommitted` command)
468
+ Checks whether TypeScript type checks should run based on file changes from the base branch. Optimizes CI/CD pipelines by skipping type checks when only non-TypeScript files have changed.
469
+ (Function version of the `check-should-run-type-checks` command)
479
470
 
480
471
  ```tsx
481
472
  import { formatUncommittedFiles } from 'ts-repo-utils';
@@ -492,14 +483,18 @@ await formatUncommittedFiles({
492
483
 
493
484
  **Options:**
494
485
 
495
- - `untracked?` - Format untracked files (default: true)
496
- - `modified?` - Format modified files (default: true)
497
- - `staged?` - Format staged files (default: true)
498
- - `silent?` - Suppress output messages (default: false)
499
- - `ignoreUnknown?` - Skip files without a Prettier parser instead of erroring (default: true)
500
- - `ignore?` - Custom function to ignore files (default: built-in ignore list)
486
+ - `pathsIgnore?` - Patterns to ignore when checking if type checks should run:
487
+ - Exact file matches: `.cspell.json`
488
+ - Directory prefixes: `docs/` (matches any file in docs directory)
489
+ - File extensions: `**.md` (matches any markdown file)
490
+ - Default: `['LICENSE', '.editorconfig', '.gitignore', '.cspell.json', '.markdownlint-cli2.mjs', '.npmignore', '.prettierignore', '.prettierrc', 'docs/', '**.md', '**.txt']`
491
+ - `baseBranch?` - Base branch to compare against (default: `origin/main`)
501
492
 
502
- **Return Type:**
493
+ ### Code Formatting Utilities
494
+
495
+ #### `formatFilesGlob(pathGlob: string, options?): Promise<Result<undefined, unknown>>`
496
+
497
+ Formats files matching a glob pattern using Prettier.
503
498
 
504
499
  ```tsx
505
500
  import { type ExecException } from 'node:child_process';
@@ -512,10 +507,16 @@ type Ret = Promise<
512
507
  >;
513
508
  ```
514
509
 
515
- #### `formatDiffFrom(base: string, options?): Promise<Result>`
510
+ **Options:**
516
511
 
517
- Formats only files that differ from the specified base branch or commit.
518
- (Function version of the `format-diff-from` command)
512
+ - `silent?` - Suppress output messages (default: false)
513
+ - `ignoreUnknown?` - Skip files without a Prettier parser instead of erroring (default: true)
514
+ - `ignore?` - Custom function to ignore files (default: built-in ignore list)
515
+
516
+ #### `formatUncommittedFiles(options?): Promise<Result>`
517
+
518
+ Formats only files that have been changed according to git status.
519
+ (Function version of the `format-uncommitted` command)
519
520
 
520
521
  ```tsx
521
522
  import { formatDiffFrom } from 'ts-repo-utils';
@@ -536,9 +537,9 @@ await formatDiffFrom('main', {
536
537
 
537
538
  **Options:**
538
539
 
539
- - `includeUntracked?` - Include untracked files in addition to diff files (default: true)
540
- - `includeModified?` - Include modified files in addition to diff files (default: true)
541
- - `includeStaged?` - Include staged files in addition to diff files (default: true)
540
+ - `untracked?` - Format untracked files (default: true)
541
+ - `modified?` - Format modified files (default: true)
542
+ - `staged?` - Format staged files (default: true)
542
543
  - `silent?` - Suppress output messages (default: false)
543
544
  - `ignoreUnknown?` - Skip files without a Prettier parser instead of erroring (default: true)
544
545
  - `ignore?` - Custom function to ignore files (default: built-in ignore list)
@@ -556,12 +557,10 @@ type Ret = Promise<
556
557
  >;
557
558
  ```
558
559
 
559
- ### Index File Generation
560
-
561
- #### `genIndex(config: GenIndexConfig): Promise<Result<undefined, unknown>>`
560
+ #### `formatDiffFrom(base: string, options?): Promise<Result>`
562
561
 
563
- Generates index files recursively in target directories with automatic barrel exports.
564
- (Function version of the `gen-index-ts` command)
562
+ Formats only files that differ from the specified base branch or commit.
563
+ (Function version of the `format-diff-from` command)
565
564
 
566
565
  ```tsx
567
566
  import { genIndex } from 'ts-repo-utils';
@@ -572,7 +571,16 @@ await genIndex({
572
571
  });
573
572
  ```
574
573
 
575
- **Configuration Type:**
574
+ **Options:**
575
+
576
+ - `includeUntracked?` - Include untracked files in addition to diff files (default: true)
577
+ - `includeModified?` - Include modified files in addition to diff files (default: true)
578
+ - `includeStaged?` - Include staged files in addition to diff files (default: true)
579
+ - `silent?` - Suppress output messages (default: false)
580
+ - `ignoreUnknown?` - Skip files without a Prettier parser instead of erroring (default: true)
581
+ - `ignore?` - Custom function to ignore files (default: built-in ignore list)
582
+
583
+ **Return Type:**
576
584
 
577
585
  ```tsx
578
586
  type GenIndexConfig = Readonly<{
@@ -614,24 +622,12 @@ type GenIndexConfig = Readonly<{
614
622
  }>;
615
623
  ```
616
624
 
617
- **Features:**
618
-
619
- - Creates barrel exports for all subdirectories
620
- - Supports complex glob exclusion patterns (using micromatch)
621
- - Automatically formats generated files using the project's Prettier config
622
- - Works with both single directories and directory arrays
623
- - Respects source and export extension configuration
624
-
625
- **Benefits:**
626
-
627
- - Prevents forgetting to export modules
628
- - TypeScript can detect duplicate variables, type names, etc.
629
-
630
- ### Monorepo Workspace Management Utilities
625
+ ### Index File Generation
631
626
 
632
- #### `runCmdInStagesAcrossWorkspaces(options): Promise<void>`
627
+ #### `genIndex(config: GenIndexConfig): Promise<Result<undefined, unknown>>`
633
628
 
634
- Executes an npm script command across all workspace packages in dependency order stages. Packages are grouped into stages where each stage contains packages whose dependencies have been completed in previous stages. Uses fail-fast behavior.
629
+ Generates index files recursively in target directories with automatic barrel exports.
630
+ (Function version of the `gen-index-ts` command)
635
631
 
636
632
  ```tsx
637
633
  import { runCmdInStagesAcrossWorkspaces } from 'ts-repo-utils';
@@ -645,16 +641,7 @@ await runCmdInStagesAcrossWorkspaces({
645
641
  });
646
642
  ```
647
643
 
648
- **Options:**
649
-
650
- - `rootPackageJsonDir` - Directory containing the root package.json file
651
- - `cmd` - The npm script command to execute in each package
652
- - `concurrency?` - Maximum packages to process simultaneously within each stage (default: 3)
653
- - `filterWorkspacePattern?` - Optional function to filter packages by name
654
-
655
- #### `runCmdInParallelAcrossWorkspaces(options): Promise<void>`
656
-
657
- Executes an npm script command across all workspace packages in parallel. Uses fail-fast behavior - stops execution immediately when any package fails.
644
+ **Configuration Type:**
658
645
 
659
646
  ```tsx
660
647
  import { runCmdInParallelAcrossWorkspaces } from 'ts-repo-utils';
@@ -668,16 +655,24 @@ await runCmdInParallelAcrossWorkspaces({
668
655
  });
669
656
  ```
670
657
 
671
- **Options:**
658
+ **Features:**
672
659
 
673
- - `rootPackageJsonDir` - Directory containing the root package.json file
674
- - `cmd` - The npm script command to execute in each package
675
- - `concurrency?` - Maximum packages to process simultaneously (default: 3)
676
- - `filterWorkspacePattern?` - Optional function to filter packages by name
660
+ - Creates barrel exports for all subdirectories
661
+ - Supports complex glob exclusion patterns (using micromatch)
662
+ - Automatically formats generated files using the project's Prettier config
663
+ - Works with both single directories and directory arrays
664
+ - Respects source and export extension configuration
677
665
 
678
- #### `getWorkspacePackages(rootPackageJsonDir): Promise<readonly Package[]>`
666
+ **Benefits:**
679
667
 
680
- Retrieves all workspace packages from a monorepo based on the workspace patterns defined in the root package.json file.
668
+ - Prevents forgetting to export modules
669
+ - TypeScript can detect duplicate variables, type names, etc.
670
+
671
+ ### Monorepo Workspace Management Utilities
672
+
673
+ #### `runCmdInStagesAcrossWorkspaces(options): Promise<void>`
674
+
675
+ Executes an npm script command across all workspace packages in dependency order stages. Packages are grouped into stages where each stage contains packages whose dependencies have been completed in previous stages. Uses fail-fast behavior.
681
676
 
682
677
  ```tsx
683
678
  import { getWorkspacePackages } from 'ts-repo-utils';
@@ -687,7 +682,16 @@ console.log(packages.map((pkg) => pkg.name));
687
682
  // ['@myorg/package-a', '@myorg/package-b', ...]
688
683
  ```
689
684
 
690
- **Return Type:**
685
+ **Options:**
686
+
687
+ - `rootPackageJsonDir` - Directory containing the root package.json file
688
+ - `cmd` - The npm script command to execute in each package
689
+ - `concurrency?` - Maximum packages to process simultaneously within each stage (default: 3)
690
+ - `filterWorkspacePattern?` - Optional function to filter packages by name
691
+
692
+ #### `runCmdInParallelAcrossWorkspaces(options): Promise<void>`
693
+
694
+ Executes an npm script command across all workspace packages in parallel. Uses fail-fast behavior - stops execution immediately when any package fails.
691
695
 
692
696
  ```tsx
693
697
  type Package = Readonly<{
@@ -698,9 +702,16 @@ type Package = Readonly<{
698
702
  }>;
699
703
  ```
700
704
 
701
- #### `executeParallel(packages, scriptName, concurrency?): Promise<readonly Result[]>`
705
+ **Options:**
702
706
 
703
- Executes an npm script across multiple packages in parallel with a concurrency limit. Lower-level function used by `runCmdInParallelAcrossWorkspaces`.
707
+ - `rootPackageJsonDir` - Directory containing the root package.json file
708
+ - `cmd` - The npm script command to execute in each package
709
+ - `concurrency?` - Maximum packages to process simultaneously (default: 3)
710
+ - `filterWorkspacePattern?` - Optional function to filter packages by name
711
+
712
+ #### `getWorkspacePackages(rootPackageJsonDir): Promise<readonly Package[]>`
713
+
714
+ Retrieves all workspace packages from a monorepo based on the workspace patterns defined in the root package.json file.
704
715
 
705
716
  ```tsx
706
717
  import { executeParallel, getWorkspacePackages } from 'ts-repo-utils';
@@ -709,9 +720,7 @@ const packages = await getWorkspacePackages('.');
709
720
  await executeParallel(packages, 'lint', 4);
710
721
  ```
711
722
 
712
- #### `executeStages(packages, scriptName, concurrency?): Promise<void>`
713
-
714
- Executes an npm script across packages in dependency order stages. Lower-level function used by `runCmdInStagesAcrossWorkspaces`.
723
+ **Return Type:**
715
724
 
716
725
  ```tsx
717
726
  import { executeStages, getWorkspacePackages } from 'ts-repo-utils';
@@ -720,17 +729,9 @@ const packages = await getWorkspacePackages('.');
720
729
  await executeStages(packages, 'build', 3);
721
730
  ```
722
731
 
723
- **Features:**
724
-
725
- - Automatic dependency graph construction
726
- - Topological sorting for correct build order
727
- - Parallel execution within each stage
728
- - Fail-fast behavior on errors
729
- - Circular dependency detection
730
-
731
- ### Globals
732
+ #### `executeParallel(packages, scriptName, concurrency?): Promise<readonly Result[]>`
732
733
 
733
- When you import `ts-repo-utils` without destructuring, several utilities become globally available. This is useful for scripts where you want quick access to common functions without explicit imports.
734
+ Executes an npm script across multiple packages in parallel with a concurrency limit. Lower-level function used by `runCmdInParallelAcrossWorkspaces`.
734
735
 
735
736
  ```tsx
736
737
  import 'ts-repo-utils';
@@ -759,18 +760,9 @@ if (isDirectlyExecuted(import.meta.url)) {
759
760
  }
760
761
  ```
761
762
 
762
- - `$` - The command execution utility described above.
763
- - `Result` - A utility for Result pattern (from [ts-data-forge](https://github.com/noshiro-pf/ts-data-forge#readme))
764
- - `echo` - Equivalent to `console.log`
765
- - `path` - `node:path`
766
- - `fs` - `node:fs/promises`
767
- - `os` - `node:os`
768
- - `glob` - `fast-glob`
769
- - `isDirectlyExecuted` - The script execution utility described above.
770
-
771
- ## Common Patterns
763
+ #### `executeStages(packages, scriptName, concurrency?): Promise<void>`
772
764
 
773
- ### Pre-commit Hook
765
+ Executes an npm script across packages in dependency order stages. Lower-level function used by `runCmdInStagesAcrossWorkspaces`.
774
766
 
775
767
  ```tsx
776
768
  import {
@@ -791,6 +783,67 @@ await formatUncommittedFiles();
791
783
  await assertRepoIsClean();
792
784
  ```
793
785
 
786
+ **Features:**
787
+
788
+ - Automatic dependency graph construction
789
+ - Topological sorting for correct build order
790
+ - Parallel execution within each stage
791
+ - Fail-fast behavior on errors
792
+ - Circular dependency detection
793
+
794
+ ### Globals
795
+
796
+ When you import `ts-repo-utils` without destructuring, several utilities become globally available. This is useful for scripts where you want quick access to common functions without explicit imports.
797
+
798
+ ```tsx
799
+ import { formatFilesGlob, genIndex } from 'ts-repo-utils';
800
+
801
+ // Generate barrel exports
802
+ await genIndex({ targetDirectory: './src' });
803
+
804
+ // Type check
805
+ await $('tsc --noEmit');
806
+
807
+ // Build
808
+ await $('rollup -c');
809
+
810
+ // Format output
811
+ await formatFilesGlob('dist/**/*.js');
812
+ ```
813
+
814
+ - `$` - The command execution utility described above.
815
+ - `Result` - A utility for Result pattern (from [ts-data-forge](https://github.com/noshiro-pf/ts-data-forge#readme))
816
+ - `echo` - Equivalent to `console.log`
817
+ - `cd` - Equivalent to `process.chdir`
818
+ - `path` - `node:path`
819
+ - `fs` - `node:fs/promises`
820
+ - `os` - `node:os`
821
+ - `glob` - `fast-glob`
822
+ - `isDirectlyExecuted` - The script execution utility described above.
823
+
824
+ ## Common Patterns
825
+
826
+ ### Pre-commit Hook
827
+
828
+ ```tsx
829
+ import { assertExt, assertPathExists, assertRepoIsClean } from 'ts-repo-utils';
830
+
831
+ // Check required files exist (exits with code 1 if files don't exist)
832
+ await assertPathExists('./package.json', 'Package manifest');
833
+ await assertPathExists('./tsconfig.json', 'TypeScript config');
834
+
835
+ // Validate extensions
836
+ await assertExt({
837
+ directories: [
838
+ { path: './src', extension: '.ts' },
839
+ { path: './scripts', extension: '.mjs' },
840
+ ],
841
+ });
842
+
843
+ // Verify clean repository state (exits with code 1 if repo is dirty)
844
+ await assertRepoIsClean();
845
+ ```
846
+
794
847
  ### Build Pipeline
795
848
 
796
849
  ```tsx
@@ -11,7 +11,7 @@ import 'node:fs/promises';
11
11
 
12
12
  const cmdDef = cmd.command({
13
13
  name: 'assert-repo-is-clean-cli',
14
- version: '7.7.3',
14
+ version: '7.8.1',
15
15
  args: {
16
16
  silent: cmd.flag({
17
17
  long: 'silent',
@@ -1 +1 @@
1
- {"version":3,"file":"assert-repo-is-clean.mjs","sources":["../../src/cmd/assert-repo-is-clean.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAKA,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,0BAA0B;AAChC,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,IAAI,EAAE;AACJ,QAAA,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC;AACf,YAAA,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC;AAC/B,YAAA,WAAW,EAAE,sDAAsD;SACpE,CAAC;AACH,KAAA;AACD,IAAA,OAAO,EAAE,CAAC,IAAI,KAAI;QAChB,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAI;AACzB,YAAA,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC;AAC1C,YAAA,OAAO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C,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -11,7 +11,7 @@ import { checkShouldRunTypeChecks } from '../functions/should-run.mjs';
11
11
 
12
12
  const cmdDef = cmd.command({
13
13
  name: 'check-should-run-type-checks-cli',
14
- version: '7.7.3',
14
+ version: '7.8.1',
15
15
  args: {
16
16
  pathsIgnore: cmd.multioption({
17
17
  long: 'paths-ignore',
@@ -1 +1 @@
1
- {"version":3,"file":"check-should-run-type-checks.mjs","sources":["../../src/cmd/check-should-run-type-checks.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAKA,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC;AAC3B,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACzC,YAAA,WAAW,EACT,0KAA0K;SAC7K,CAAC;AACF,QAAA,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC;AACrB,YAAA,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AAC9B,YAAA,WAAW,EACT,yFAAyF;SAC5F,CAAC;AACH,KAAA;AACD,IAAA,OAAO,EAAE,CAAC,IAAI,KAAI;QAChB,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAI;AACzB,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,IAGE,KACe;AACjB,IAAA,MAAM,wBAAwB,CAAC;QAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;AAC5B,KAAA,CAAC;AACJ,CAAC;AAED,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"check-should-run-type-checks.mjs","sources":["../../src/cmd/check-should-run-type-checks.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAKA,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,IAAI,EAAE,kCAAkC;AACxC,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC;AAC3B,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACzC,YAAA,WAAW,EACT,0KAA0K;SAC7K,CAAC;AACF,QAAA,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC;AACrB,YAAA,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AAC9B,YAAA,WAAW,EACT,yFAAyF;SAC5F,CAAC;AACH,KAAA;AACD,IAAA,OAAO,EAAE,CAAC,IAAI,KAAI;QAChB,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,KAAI;AAClC,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,IAGE,KACe;AACjB,IAAA,MAAM,wBAAwB,CAAC;QAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;AAC5B,KAAA,CAAC;AACJ,CAAC;AAED,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -10,7 +10,7 @@ import 'node:fs/promises';
10
10
 
11
11
  const cmdDef = cmd.command({
12
12
  name: 'format-diff-from-cli',
13
- version: '7.7.3',
13
+ version: '7.8.1',
14
14
  args: {
15
15
  base: cmd.positional({
16
16
  type: cmd.string,
@@ -1 +1 @@
1
- {"version":3,"file":"format-diff-from.mjs","sources":["../../src/cmd/format-diff-from.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAMA,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,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC;AACzB,YAAA,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC;AAC/B,YAAA,WAAW,EACT,oEAAoE;SACvE,CAAC;AACF,QAAA,eAAe,EAAE,GAAG,CAAC,IAAI,CAAC;AACxB,YAAA,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC;AAC/B,YAAA,WAAW,EACT,mEAAmE;SACtE,CAAC;AACF,QAAA,aAAa,EAAE,GAAG,CAAC,IAAI,CA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,IAOE,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,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,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"}
@@ -10,7 +10,7 @@ import 'node:fs/promises';
10
10
 
11
11
  const cmdDef = cmd.command({
12
12
  name: 'format-uncommitted-cli',
13
- version: '7.7.3',
13
+ version: '7.8.1',
14
14
  args: {
15
15
  excludeUntracked: cmd.flag({
16
16
  long: 'exclude-untracked',
@@ -1 +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;YACzB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC;AAC/B,YAAA,WAAW,EACT,oEAAoE;SACvE,CAAC;AACF,QAAA,eAAe,EAAE,GAAG,CAAC,IAAI,CAAC;AACxB,YAAA,IAAI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AA,SAAS,EAAE,CAAC,IAAI,CAAC,gBAAgB;AACjC,QAAA,QAAQ,EAAE,CAAC,IAAI,CAAC,eAAe;AAC/B,QAAA,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa;QAC3B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,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"}
@@ -29,7 +29,7 @@ const nonEmptyArray = (t, commandName) => cmd.extendType(cmd.array(t), {
29
29
  });
30
30
  const cmdDef = cmd.command({
31
31
  name: 'gen-index-ts-cli',
32
- version: '7.7.3',
32
+ version: '7.8.1',
33
33
  args: {
34
34
  // required args
35
35
  targetDirectory: cmd.positional({
@@ -1 +1 @@
1
- {"version":3,"file":"gen-index-ts.mjs","sources":["../../src/cmd/gen-index-ts.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAWA,MAAM,aAAa,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE;AAC/C,IAAA,IAAI,EAAE,CAAC,CAAC,KAAI;QACV,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,CAA2B,CAAC;;;AAI9C,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,CAAQ,CAAC;KACjC;AACF,CAAA,CAAC;AAEF;AACA,MAAM,aAAa,GAAG,CACpB,CAAI,EACJ,WAAmB,KAEnB,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;AAC3B,IAAA,IAAI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GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export { Result } from 'ts-data-forge';
2
- export { assertExt } from './functions/assert-ext.mjs';
2
+ export { assertExt, checkExt } from './functions/assert-ext.mjs';
3
3
  export { assertPathExists, pathExists } from './functions/assert-path-exists.mjs';
4
4
  export { assertRepoIsClean, repoIsDirty } from './functions/assert-repo-is-clean.mjs';
5
+ export { createResultAssert } from './functions/create-result-assert.mjs';
5
6
  export { getDiffFrom, getModifiedFiles, getStagedFiles, getUntrackedFiles } from './functions/diff.mjs';
6
7
  export { $ } from './functions/exec-async.mjs';
7
8
  export { formatDiffFrom, formatFiles, formatFilesGlob, formatUncommittedFiles } from './functions/format.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}