ts-repo-utils 3.0.0 → 3.0.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.
- package/README.md +8 -8
- package/dist/functions/{assert-repo-is-dirty.d.mts → assert-repo-is-clean.d.mts} +2 -2
- package/dist/functions/{assert-repo-is-dirty.d.mts.map → assert-repo-is-clean.d.mts.map} +1 -1
- package/dist/functions/{assert-repo-is-dirty.mjs → assert-repo-is-clean.mjs} +2 -2
- package/dist/functions/{assert-repo-is-dirty.mjs.map → assert-repo-is-clean.mjs.map} +1 -1
- package/dist/functions/index.d.mts +1 -1
- package/dist/functions/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/functions/{assert-repo-is-dirty.mts → assert-repo-is-clean.mts} +1 -1
- package/src/functions/index.mts +1 -1
package/README.md
CHANGED
|
@@ -92,15 +92,15 @@ if (isDirty) {
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
#### `
|
|
95
|
+
#### `assertRepoIsClean(): Promise<void>`
|
|
96
96
|
|
|
97
|
-
Checks if repository is
|
|
97
|
+
Checks if repository is clean and exits with code 1 if it has uncommitted changes (shows changes and diff).
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
|
-
import {
|
|
100
|
+
import { assertRepoIsClean } from 'ts-repo-utils';
|
|
101
101
|
|
|
102
102
|
// Use in CI/build scripts to ensure clean state
|
|
103
|
-
await
|
|
103
|
+
await assertRepoIsClean();
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### Command Execution
|
|
@@ -228,7 +228,7 @@ type GenIndexConfig = DeepReadonly<{
|
|
|
228
228
|
### Pre-commit Hook
|
|
229
229
|
|
|
230
230
|
```typescript
|
|
231
|
-
import { formatUntracked, assertExt,
|
|
231
|
+
import { formatUntracked, assertExt, assertRepoIsClean } from 'ts-repo-utils';
|
|
232
232
|
|
|
233
233
|
// Format changed files
|
|
234
234
|
await formatUntracked();
|
|
@@ -239,7 +239,7 @@ await assertExt({
|
|
|
239
239
|
});
|
|
240
240
|
|
|
241
241
|
// Ensure repository is clean (exits if dirty)
|
|
242
|
-
await
|
|
242
|
+
await assertRepoIsClean();
|
|
243
243
|
```
|
|
244
244
|
|
|
245
245
|
### Build Pipeline
|
|
@@ -271,14 +271,14 @@ await formatFiles('dist/**/*.js');
|
|
|
271
271
|
### Project Validation
|
|
272
272
|
|
|
273
273
|
```typescript
|
|
274
|
-
import { pathExists, assertPathExists,
|
|
274
|
+
import { pathExists, assertPathExists, assertRepoIsClean } from 'ts-repo-utils';
|
|
275
275
|
|
|
276
276
|
// Check required files exist (exits with code 1 if files don't exist)
|
|
277
277
|
await assertPathExists('./package.json', 'Package manifest');
|
|
278
278
|
await assertPathExists('./tsconfig.json', 'TypeScript config');
|
|
279
279
|
|
|
280
280
|
// Verify clean repository state (exits with code 1 if repo is dirty)
|
|
281
|
-
await
|
|
281
|
+
await assertRepoIsClean();
|
|
282
282
|
```
|
|
283
283
|
|
|
284
284
|
## License
|
|
@@ -8,10 +8,10 @@ export declare const repoIsDirty: (options?: Readonly<{
|
|
|
8
8
|
silent?: boolean;
|
|
9
9
|
}>) => Promise<boolean>;
|
|
10
10
|
/**
|
|
11
|
-
* Checks if the repository is
|
|
11
|
+
* Checks if the repository is clean and exits with code 1 if it is dirty.
|
|
12
12
|
* Shows git status and diff output before exiting.
|
|
13
13
|
*/
|
|
14
14
|
export declare const assertRepoIsClean: (options?: Readonly<{
|
|
15
15
|
silent?: boolean;
|
|
16
16
|
}>) => Promise<void>;
|
|
17
|
-
//# sourceMappingURL=assert-repo-is-
|
|
17
|
+
//# sourceMappingURL=assert-repo-is-clean.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert-repo-is-
|
|
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;;;;GAIG;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"}
|
|
@@ -11,7 +11,7 @@ const repoIsDirty = async (options) => {
|
|
|
11
11
|
return status.isDirty;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* Checks if the repository is
|
|
14
|
+
* Checks if the repository is clean and exits with code 1 if it is dirty.
|
|
15
15
|
* Shows git status and diff output before exiting.
|
|
16
16
|
*/
|
|
17
17
|
const assertRepoIsClean = async (options) => {
|
|
@@ -63,4 +63,4 @@ const getGitStatus = async (options) => {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export { assertRepoIsClean, repoIsDirty };
|
|
66
|
-
//# sourceMappingURL=assert-repo-is-
|
|
66
|
+
//# sourceMappingURL=assert-repo-is-clean.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert-repo-is-
|
|
1
|
+
{"version":3,"file":"assert-repo-is-clean.mjs","sources":["../../src/functions/assert-repo-is-clean.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGA;;;;AAIG;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,E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AAC,OAAO,CAAA,CAAE,CAAC;;AAGnE,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;;;;"}
|
package/dist/functions/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { assertExt } from './assert-ext.mjs';
|
|
2
2
|
export { assertPathExists, pathExists } from './assert-path-exists.mjs';
|
|
3
|
-
export { assertRepoIsClean, repoIsDirty } from './assert-repo-is-
|
|
3
|
+
export { assertRepoIsClean, repoIsDirty } from './assert-repo-is-clean.mjs';
|
|
4
4
|
export { getDiffFrom, getUntrackedFiles } from './diff.mjs';
|
|
5
5
|
export { $ } from './exec-async.mjs';
|
|
6
6
|
export { formatDiffFrom, formatFiles, formatFilesList, formatUntracked } from './format.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { assertExt } from './functions/assert-ext.mjs';
|
|
2
2
|
export { assertPathExists, pathExists } from './functions/assert-path-exists.mjs';
|
|
3
|
-
export { assertRepoIsClean, repoIsDirty } from './functions/assert-repo-is-
|
|
3
|
+
export { assertRepoIsClean, repoIsDirty } from './functions/assert-repo-is-clean.mjs';
|
|
4
4
|
export { getDiffFrom, getUntrackedFiles } from './functions/diff.mjs';
|
|
5
5
|
export { $ } from './functions/exec-async.mjs';
|
|
6
6
|
export { formatDiffFrom, formatFiles, formatFilesList, formatUntracked } from './functions/format.mjs';
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export const repoIsDirty = async (
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Checks if the repository is
|
|
17
|
+
* Checks if the repository is clean and exits with code 1 if it is dirty.
|
|
18
18
|
* Shows git status and diff output before exiting.
|
|
19
19
|
*/
|
|
20
20
|
export const assertRepoIsClean = async (
|
package/src/functions/index.mts
CHANGED