sandersn / downlevel-dts

Convert a new d.ts to one that works with older versions of Typescript
MIT License
227 stars 21 forks source link

Output folder being read as input, causes increasingly nesting output folders on each run #39

Open justinfagnani opened 4 years ago

justinfagnani commented 4 years ago

We run downlevel-dts as instructed here, with: downlevel-dts . ts3.4 && cp tsconfig.json ./ts3.4/, but on subsequent runs this causes the ./ts3.4 folder to be read as input and then included in the output folder.

We get something like

.
├── lib
├── ...
├── ts3.4
│   ├── ...
│   ├── ts3.4
│   │   ├── ...
│   │   ├── ts3.4

See https://github.com/Polymer/lit-element/issues/976

Seems like downlevel-dts should exclude the output folder from its inputs.

lazytype commented 4 years ago

I just ran into this as well. A preferable option that assumes less about users' directory structure would be to accept .d.ts files as direct inputs, i.e. `downlevel-dts dist/.d.ts dist/ts3.4`.