Commit eb77b53
refactor(migrations): avoid TS error 18003 when no files found (angular#57899)
When running a migration, tsurge creates a TS program from the tsconfig files found.
This can result in a 18003 error when no files are found (based on the includes/files of the config).
For example, the signal input migration throws in a CLI project that has no spec files:
```
ng g @angular/core:signal-inputs --defaults
Tsconfig could not be parsed or is invalid:
No inputs were found in config file '/tsconfig.spec.json'. Specified 'include' paths were '["src/**/*.spec.ts","src/**/*.d.ts"]' and 'exclude' paths were '["/out-tsc/spec"]'.
```
A similar issue has already been raised in the CDK migration (see angular/components#27055).
This was solved in the CDK (credits to @crisbeto) by ignoring the 18003 error (see 9c1112d408361a47c98dfd470b8e990cbd1753db).
This PR does the same in tsurge.
PR Close angular#578991 parent 101d162 commit eb77b53
File tree
1 file changed
+10
-4
lines changed- packages/core/schematics/utils/tsurge/helpers
1 file changed
+10
-4
lines changedLines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | | - | |
39 | | - | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
0 commit comments