Commit 6929300
committed
(optim/fix): only emit type declarations once
- every other emission is just a duplicate -- no need to spend compute
time to make duplicates
- even for the upcoming multi-entry, the same types are emitted for
each entry as the compiler just emits types for everything in the
`tsconfig` `include`
- fixes a long-standing bug with the deprecated moveTypes() function
that would occassionally cause types to not be properly output
- this was actually due to moveTypes() being run multiple times in
parallel (as well as the types themselves being emitted multiple
times in parallel)
- hence the EEXIST and ENOENT filesystem errors being thrown, as
that directory was being changed multiple times in parallel
- race conditions, fun!
- now they're only emitted once and only moved once, so no problems!
- also fixes a bug with an initial version of multi-entry where if an
entry in a subdir of src/ were added, e.g. src/foo/bar, the entire
tree of type declarations would get output into dist/foo/src/*.d.ts
- alternatively, could call `moveTypes()` with an arg for each entry,
but there's no need since all declarations get produced the first
time around anyway
- similar bug occurred with an initial version of `--preserveModules`
that used separate format directories1 parent 5c73483 commit 6929300
4 files changed
Lines changed: 16 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
46 | 33 | | |
47 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
405 | 404 | | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
| |||
0 commit comments