ts-repo-utils 7.4.0 → 7.5.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.
- package/README.md +5 -1
- package/dist/cmd/assert-repo-is-clean.mjs +1 -1
- package/dist/cmd/check-should-run-type-checks.mjs +1 -1
- package/dist/cmd/format-diff-from.mjs +1 -1
- package/dist/cmd/format-uncommitted.mjs +1 -1
- package/dist/cmd/gen-index-ts.mjs +1 -1
- package/dist/node-global.d.mts +3 -0
- package/dist/node-global.d.mts.map +1 -1
- package/dist/node-global.mjs +2 -0
- package/dist/node-global.mjs.map +1 -1
- package/package.json +1 -1
- package/src/cmd/assert-repo-is-clean.mts +1 -1
- package/src/cmd/check-should-run-type-checks.mts +1 -1
- package/src/cmd/format-diff-from.mts +1 -1
- package/src/cmd/format-uncommitted.mts +1 -1
- package/src/cmd/gen-index-ts.mts +1 -1
- package/src/node-global.mts +4 -0
package/README.md
CHANGED
|
@@ -723,7 +723,10 @@ import 'ts-repo-utils';
|
|
|
723
723
|
|
|
724
724
|
// Now these functions are globally available
|
|
725
725
|
|
|
726
|
-
await $('npm test');
|
|
726
|
+
const result = await $('npm test');
|
|
727
|
+
if (Result.isErr(result)) {
|
|
728
|
+
console.error(result.value);
|
|
729
|
+
}
|
|
727
730
|
|
|
728
731
|
echo('Building project...');
|
|
729
732
|
|
|
@@ -741,6 +744,7 @@ if (isDirectlyExecuted(import.meta.url)) {
|
|
|
741
744
|
```
|
|
742
745
|
|
|
743
746
|
- `$` - The command execution utility described above.
|
|
747
|
+
- `Result` - A utility for Result pattern (from [ts-data-forge](https://github.com/noshiro-pf/ts-data-forge#readme))
|
|
744
748
|
- `echo` - Equivalent to `console.log`
|
|
745
749
|
- `path` - `node:path`
|
|
746
750
|
- `fs` - `node:fs/promises`
|
package/dist/node-global.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as glob_ } from 'fast-glob';
|
|
2
2
|
import * as fs_ from 'node:fs/promises';
|
|
3
3
|
import * as path_ from 'node:path';
|
|
4
|
+
import { Result as Result_ } from 'ts-data-forge';
|
|
4
5
|
import { $ as $_ } from './functions/exec-async.mjs';
|
|
5
6
|
import { isDirectlyExecuted as isDirectlyExecuted_ } from './functions/is-directly-executed.mjs';
|
|
6
7
|
declare global {
|
|
@@ -10,5 +11,7 @@ declare global {
|
|
|
10
11
|
const fs: typeof fs_;
|
|
11
12
|
const glob: typeof glob_;
|
|
12
13
|
const isDirectlyExecuted: typeof isDirectlyExecuted_;
|
|
14
|
+
const Result: typeof Result_;
|
|
15
|
+
type Result<S, E> = Result_<S, E>;
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=node-global.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-global.d.mts","sourceRoot":"","sources":["../src/node-global.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,kBAAkB,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"node-global.d.mts","sourceRoot":"","sources":["../src/node-global.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,kBAAkB,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAgBjG,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,IAAI,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IAE/B,MAAM,IAAI,EAAE,OAAO,KAAK,CAAC;IACzB,MAAM,EAAE,EAAE,OAAO,GAAG,CAAC;IACrB,MAAM,IAAI,EAAE,OAAO,KAAK,CAAC;IACzB,MAAM,kBAAkB,EAAE,OAAO,mBAAmB,CAAC;IACrD,MAAM,MAAM,EAAE,OAAO,OAAO,CAAC;IAC7B,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACnC"}
|
package/dist/node-global.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import glob_ from 'fast-glob';
|
|
2
2
|
import * as fs_ from 'node:fs/promises';
|
|
3
3
|
import * as path_ from 'node:path';
|
|
4
|
+
import { Result } from 'ts-data-forge';
|
|
4
5
|
import { $ } from './functions/exec-async.mjs';
|
|
5
6
|
import { isDirectlyExecuted } from './functions/is-directly-executed.mjs';
|
|
6
7
|
|
|
@@ -12,6 +13,7 @@ const globalsDef = {
|
|
|
12
13
|
fs: fs_,
|
|
13
14
|
glob: glob_,
|
|
14
15
|
isDirectlyExecuted: isDirectlyExecuted,
|
|
16
|
+
Result: Result,
|
|
15
17
|
};
|
|
16
18
|
// eslint-disable-next-line functional/immutable-data
|
|
17
19
|
Object.assign(globalThis, globalsDef);
|
package/dist/node-global.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-global.mjs","sources":["../src/node-global.mts"],"sourcesContent":[null],"names":["$_","isDirectlyExecuted_"],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-global.mjs","sources":["../src/node-global.mts"],"sourcesContent":[null],"names":["$_","isDirectlyExecuted_","Result_"],"mappings":";;;;;;;AAAA;AAQA,MAAM,UAAU,GAAG;AACjB,IAAA,CAAC,EAAEA,CAAE;IACL,IAAI,EAAE,OAAO,CAAC,GAAG;AAEjB,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,EAAE,EAAE,GAAG;AACP,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,kBAAkB,EAAEC,kBAAmB;AACvC,IAAA,MAAM,EAAEC,MAAO;CACP;AAEV;AACA,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC"}
|
package/package.json
CHANGED
package/src/cmd/gen-index-ts.mts
CHANGED
package/src/node-global.mts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { default as glob_ } from 'fast-glob';
|
|
3
3
|
import * as fs_ from 'node:fs/promises';
|
|
4
4
|
import * as path_ from 'node:path';
|
|
5
|
+
import { Result as Result_ } from 'ts-data-forge';
|
|
5
6
|
import { $ as $_ } from './functions/exec-async.mjs';
|
|
6
7
|
import { isDirectlyExecuted as isDirectlyExecuted_ } from './functions/is-directly-executed.mjs';
|
|
7
8
|
|
|
@@ -13,6 +14,7 @@ const globalsDef = {
|
|
|
13
14
|
fs: fs_,
|
|
14
15
|
glob: glob_,
|
|
15
16
|
isDirectlyExecuted: isDirectlyExecuted_,
|
|
17
|
+
Result: Result_,
|
|
16
18
|
} as const;
|
|
17
19
|
|
|
18
20
|
// eslint-disable-next-line functional/immutable-data
|
|
@@ -26,4 +28,6 @@ declare global {
|
|
|
26
28
|
const fs: typeof fs_;
|
|
27
29
|
const glob: typeof glob_;
|
|
28
30
|
const isDirectlyExecuted: typeof isDirectlyExecuted_;
|
|
31
|
+
const Result: typeof Result_;
|
|
32
|
+
type Result<S, E> = Result_<S, E>;
|
|
29
33
|
}
|