ts-repo-utils 10.6.1 → 10.6.2
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.
|
@@ -12,29 +12,33 @@
|
|
|
12
12
|
* reports a status check, so a pull request that changed only the filtered
|
|
13
13
|
* paths waits forever on a required check that will never arrive.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* // Custom base branch
|
|
21
|
-
* await checkShouldRun({
|
|
22
|
-
* pathsIgnore: ['docs/', '**.md'],
|
|
23
|
-
* baseBranch: 'origin/develop',
|
|
24
|
-
* });
|
|
25
|
-
* ```;
|
|
15
|
+
* In a GitHub Actions workflow, the step writes `should_run` to
|
|
16
|
+
* `GITHUB_OUTPUT`, and the steps it gates read it — the YAML is not an
|
|
17
|
+
* `@example` because it is not TypeScript and so cannot be embedded from a
|
|
18
|
+
* sample file:
|
|
26
19
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ```yaml
|
|
30
|
-
* - name: Check diff
|
|
20
|
+
* ```yaml
|
|
21
|
+
* - name: Check diff
|
|
31
22
|
* id: check_diff
|
|
32
23
|
* run: npm exec -- check-should-run --paths-ignore 'experimental/'
|
|
33
24
|
*
|
|
34
|
-
*
|
|
25
|
+
* - name: Run the checks
|
|
35
26
|
* if: steps.check_diff.outputs.should_run == 'true'
|
|
36
27
|
* run: npm run check
|
|
37
|
-
*
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* // Skip when the diff only touches a directory nothing checks
|
|
34
|
+
* await checkShouldRun({ pathsIgnore: ['experimental/'] });
|
|
35
|
+
*
|
|
36
|
+
* // Custom base branch
|
|
37
|
+
* await checkShouldRun({
|
|
38
|
+
* pathsIgnore: ['docs/', '**.md'],
|
|
39
|
+
* baseBranch: 'origin/develop',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
38
42
|
*
|
|
39
43
|
* @param options - Configuration options
|
|
40
44
|
* @param options.pathsIgnore - Patterns whose files do not affect the step.
|
|
@@ -68,33 +72,34 @@ export declare const checkShouldRun: (options?: Readonly<{
|
|
|
68
72
|
* are documentation, configuration, or other non-TypeScript files, type checks
|
|
69
73
|
* can be safely skipped to improve build performance.
|
|
70
74
|
*
|
|
71
|
-
*
|
|
72
|
-
* ```typescript
|
|
73
|
-
* // Use default settings (compare against origin/main, ignore docs/md/txt files)
|
|
74
|
-
* await checkShouldRunTypeChecks();
|
|
75
|
-
*
|
|
76
|
-
* // Custom ignore patterns
|
|
77
|
-
* await checkShouldRunTypeChecks({
|
|
78
|
-
* pathsIgnore: ['.eslintrc.json', 'docs/', '**.md', 'scripts/'],
|
|
79
|
-
* });
|
|
80
|
-
*
|
|
81
|
-
* // Custom base branch
|
|
82
|
-
* await checkShouldRunTypeChecks({
|
|
83
|
-
* baseBranch: 'origin/develop',
|
|
84
|
-
* });
|
|
85
|
-
* ```;
|
|
75
|
+
* The GitHub Actions form, for the same reason not an `@example`:
|
|
86
76
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* ```yaml
|
|
90
|
-
* - name: Check if type checks should run
|
|
77
|
+
* ```yaml
|
|
78
|
+
* - name: Check if type checks should run
|
|
91
79
|
* id: check_diff
|
|
92
80
|
* run: npm exec check-should-run-type-checks
|
|
93
81
|
*
|
|
94
|
-
*
|
|
82
|
+
* - name: Run type checks
|
|
95
83
|
* if: steps.check_diff.outputs.should_run == 'true'
|
|
96
84
|
* run: npm run type-check
|
|
97
|
-
*
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
*
|
|
89
|
+
* ```ts
|
|
90
|
+
* // Use the defaults: compare against origin/main, ignore docs/md/txt files
|
|
91
|
+
* await checkShouldRunTypeChecks();
|
|
92
|
+
*
|
|
93
|
+
* // Custom ignore patterns
|
|
94
|
+
* await checkShouldRunTypeChecks({
|
|
95
|
+
* pathsIgnore: ['.eslintrc.json', 'docs/', '**.md', 'scripts/'],
|
|
96
|
+
* });
|
|
97
|
+
*
|
|
98
|
+
* // Custom base branch
|
|
99
|
+
* await checkShouldRunTypeChecks({
|
|
100
|
+
* baseBranch: 'origin/develop',
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
98
103
|
*
|
|
99
104
|
* @param options - Configuration options
|
|
100
105
|
* @param options.pathsIgnore - Array of patterns to ignore when determining if
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-run.d.mts","sourceRoot":"","sources":["../../src/functions/should-run.mts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"should-run.d.mts","sourceRoot":"","sources":["../../src/functions/should-run.mts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,cAAc,aACf,QAAQ,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,KACD,OAAO,CAAC,OAAO,CAyCjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,wBAAwB,aACzB,QAAQ,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,KACD,OAAO,CAAC,OAAO,CAId,CAAC"}
|
|
@@ -50,6 +50,10 @@ import { getDiffFrom, getGitRoot } from './diff.mjs';
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
|
|
@@ -137,6 +141,7 @@ export const checkShouldRun = async (options) => {
|
|
|
137
141
|
|
|
138
142
|
|
|
139
143
|
|
|
144
|
+
|
|
140
145
|
|
|
141
146
|
|
|
142
147
|
export const checkShouldRunTypeChecks = async (options) => checkShouldRun({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-run.mjs","sourceRoot":"","sources":["../../src/functions/should-run.mts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"should-run.mjs","sourceRoot":"","sources":["../../src/functions/should-run.mts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAGE,EACgB,EAAE;IACpB,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,EAAE,CAAC;IAE/C,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,aAAa,CAAC;IAExD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAEnD,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAC;IAEnC,IAAI,MAAM,CAAC,KAAK,CAAC,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M,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAC3C,OAGE,EACgB,EAAE,CACpB,cAAc,CAAC;IACb,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,2BAA2B;IAChE,UAAU,EAAE,OAAO,EAAE,UAAU;CAChC,CAAC,CAAC;AAEL,MAAM,2BAA2B,GAAG;IAClC,SAAS;IACT,eAAe;IACf,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,wBAAwB;IACxB,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,OAAO;IACP,OAAO;IACP,QAAQ;CACA,CAAC;AAEX;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,OAAe,EAAU,EAAE,CACjD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAG,OAAO,IAAc,CAAC,CAAC,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-repo-utils",
|
|
3
|
-
"version": "10.6.
|
|
3
|
+
"version": "10.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript"
|
|
@@ -49,22 +49,22 @@
|
|
|
49
49
|
"cmd-ts": "^0.15.0",
|
|
50
50
|
"fast-glob": "^3.3.3",
|
|
51
51
|
"micromatch": "^4.0.8",
|
|
52
|
-
"ts-data-forge": "^14.
|
|
52
|
+
"ts-data-forge": "^14.7.1",
|
|
53
53
|
"ts-type-forge": "^9.2.2",
|
|
54
54
|
"typescript": ">=5.0.0 <7.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/node": "26.
|
|
58
|
-
"@vitest/coverage-v8": "
|
|
59
|
-
"@vitest/ui": "
|
|
60
|
-
"cspell": "10.
|
|
57
|
+
"@types/node": "26.5.0",
|
|
58
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
59
|
+
"@vitest/ui": "5.0.0",
|
|
60
|
+
"cspell": "10.2.1",
|
|
61
61
|
"dedent": "1.7.2",
|
|
62
62
|
"esbuild": "0.28.2",
|
|
63
63
|
"eslint": "10.9.1",
|
|
64
|
-
"eslint-config-typed": "5.11.
|
|
65
|
-
"eslint-plugin-ts-data-forge": "0.7.
|
|
66
|
-
"eslint-plugin-ts-fortress": "1.2.
|
|
67
|
-
"eslint-plugin-ts-type-forge": "0.8.
|
|
64
|
+
"eslint-config-typed": "5.11.7",
|
|
65
|
+
"eslint-plugin-ts-data-forge": "0.7.4",
|
|
66
|
+
"eslint-plugin-ts-fortress": "1.2.2",
|
|
67
|
+
"eslint-plugin-ts-type-forge": "0.8.3",
|
|
68
68
|
"jiti": "2.7.0",
|
|
69
69
|
"npm-run-all2": "9.0.3",
|
|
70
70
|
"prettier": "3.9.6",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typedoc-github-theme": "0.4.0",
|
|
76
76
|
"typescript-native": "npm:typescript@7.0.2",
|
|
77
77
|
"vite": "8.2.2",
|
|
78
|
-
"vitest": "
|
|
78
|
+
"vitest": "5.0.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"prettier": ">=3.0.0"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"pnpm": ">=8.0.0"
|
|
86
86
|
},
|
|
87
87
|
"volta": {
|
|
88
|
-
"node": "26.
|
|
88
|
+
"node": "26.8.1"
|
|
89
89
|
},
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"cspell": "cspell \"**\" --gitignore --gitignore-root ../../ --no-progress",
|
|
103
103
|
"doc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/gen-docs.mts",
|
|
104
104
|
"doc:embed": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples.mts",
|
|
105
|
+
"doc:embed:jsdoc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples-in-jsdoc.mts",
|
|
105
106
|
"doc:preview": "vite preview --config ./configs/vite.doc.config.mts",
|
|
106
107
|
"doc:watch": "typedoc --options ./configs/typedoc.config.mjs --watch",
|
|
107
108
|
"fmt": "pnpm run z:format-uncommitted --cwd .",
|
|
@@ -18,29 +18,33 @@ import { getDiffFrom, getGitRoot } from './diff.mjs';
|
|
|
18
18
|
* reports a status check, so a pull request that changed only the filtered
|
|
19
19
|
* paths waits forever on a required check that will never arrive.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* // Custom base branch
|
|
27
|
-
* await checkShouldRun({
|
|
28
|
-
* pathsIgnore: ['docs/', '**.md'],
|
|
29
|
-
* baseBranch: 'origin/develop',
|
|
30
|
-
* });
|
|
31
|
-
* ```;
|
|
21
|
+
* In a GitHub Actions workflow, the step writes `should_run` to
|
|
22
|
+
* `GITHUB_OUTPUT`, and the steps it gates read it — the YAML is not an
|
|
23
|
+
* `@example` because it is not TypeScript and so cannot be embedded from a
|
|
24
|
+
* sample file:
|
|
32
25
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* ```yaml
|
|
36
|
-
* - name: Check diff
|
|
26
|
+
* ```yaml
|
|
27
|
+
* - name: Check diff
|
|
37
28
|
* id: check_diff
|
|
38
29
|
* run: npm exec -- check-should-run --paths-ignore 'experimental/'
|
|
39
30
|
*
|
|
40
|
-
*
|
|
31
|
+
* - name: Run the checks
|
|
41
32
|
* if: steps.check_diff.outputs.should_run == 'true'
|
|
42
33
|
* run: npm run check
|
|
43
|
-
*
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Skip when the diff only touches a directory nothing checks
|
|
40
|
+
* await checkShouldRun({ pathsIgnore: ['experimental/'] });
|
|
41
|
+
*
|
|
42
|
+
* // Custom base branch
|
|
43
|
+
* await checkShouldRun({
|
|
44
|
+
* pathsIgnore: ['docs/', '**.md'],
|
|
45
|
+
* baseBranch: 'origin/develop',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
44
48
|
*
|
|
45
49
|
* @param options - Configuration options
|
|
46
50
|
* @param options.pathsIgnore - Patterns whose files do not affect the step.
|
|
@@ -118,33 +122,34 @@ export const checkShouldRun = async (
|
|
|
118
122
|
* are documentation, configuration, or other non-TypeScript files, type checks
|
|
119
123
|
* can be safely skipped to improve build performance.
|
|
120
124
|
*
|
|
121
|
-
*
|
|
122
|
-
* ```typescript
|
|
123
|
-
* // Use default settings (compare against origin/main, ignore docs/md/txt files)
|
|
124
|
-
* await checkShouldRunTypeChecks();
|
|
125
|
-
*
|
|
126
|
-
* // Custom ignore patterns
|
|
127
|
-
* await checkShouldRunTypeChecks({
|
|
128
|
-
* pathsIgnore: ['.eslintrc.json', 'docs/', '**.md', 'scripts/'],
|
|
129
|
-
* });
|
|
130
|
-
*
|
|
131
|
-
* // Custom base branch
|
|
132
|
-
* await checkShouldRunTypeChecks({
|
|
133
|
-
* baseBranch: 'origin/develop',
|
|
134
|
-
* });
|
|
135
|
-
* ```;
|
|
125
|
+
* The GitHub Actions form, for the same reason not an `@example`:
|
|
136
126
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* ```yaml
|
|
140
|
-
* - name: Check if type checks should run
|
|
127
|
+
* ```yaml
|
|
128
|
+
* - name: Check if type checks should run
|
|
141
129
|
* id: check_diff
|
|
142
130
|
* run: npm exec check-should-run-type-checks
|
|
143
131
|
*
|
|
144
|
-
*
|
|
132
|
+
* - name: Run type checks
|
|
145
133
|
* if: steps.check_diff.outputs.should_run == 'true'
|
|
146
134
|
* run: npm run type-check
|
|
147
|
-
*
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
*
|
|
139
|
+
* ```ts
|
|
140
|
+
* // Use the defaults: compare against origin/main, ignore docs/md/txt files
|
|
141
|
+
* await checkShouldRunTypeChecks();
|
|
142
|
+
*
|
|
143
|
+
* // Custom ignore patterns
|
|
144
|
+
* await checkShouldRunTypeChecks({
|
|
145
|
+
* pathsIgnore: ['.eslintrc.json', 'docs/', '**.md', 'scripts/'],
|
|
146
|
+
* });
|
|
147
|
+
*
|
|
148
|
+
* // Custom base branch
|
|
149
|
+
* await checkShouldRunTypeChecks({
|
|
150
|
+
* baseBranch: 'origin/develop',
|
|
151
|
+
* });
|
|
152
|
+
* ```
|
|
148
153
|
*
|
|
149
154
|
* @param options - Configuration options
|
|
150
155
|
* @param options.pathsIgnore - Array of patterns to ignore when determining if
|