Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting a lot of *.d.ts files #2

Open
ts2kt opened this issue May 18, 2019 · 4 comments
Open

Converting a lot of *.d.ts files #2

ts2kt opened this issue May 18, 2019 · 4 comments

Comments

@ts2kt
Copy link

ts2kt commented May 18, 2019

There are such large projects, written directly in TypeScript and contains complex directory structure with a lot of files (hundreds). Such projects are compiled with option --declaration (which autogenerate *.d.ts for each *.ts files) and published directly to npm
Trying to convert typings of such project, I ran into a number of problems. Here are some of them:

  1. Need option to specify directory, from which dukat will take *.d.ts files recursively and put result to destination directory keeping source directory structure. It could be resolved with some scripting, but...
  2. I've tried to specify 200+ *.d.ts files via $ dukat /path/to/**/*.d.ts. It takes > 1 hour to convert them (2-4 files per minute)
  3. Option -b some_package_name gave no effect. Each file get same package name as it file name. It also don't work for single file. I expect that I can specify same package name for all files. Ability to specify @file:JsModule("path-to-module") would be also useful.
  4. Interface names like 'T$0' will be duplicated, because each file converted independently.
  5. If one external class implement interface from another file, there are no override modifier, because each file converted independently.
  6. Notice: as mentioned here package.json could contain types property or index.d.ts at the root of the package. It would be nice if also it were ability to analyze dependencies starting from index.d.ts before just converting all files from npm package.
    Also mainly index.d.ts contains re-exports.
@Schahen
Copy link
Contributor

Schahen commented May 21, 2019

  1. Will consider this as an enhancement however I still feel that this should be resolved on a caller side
  2. I'll investigate. The bottleneck is the initialization of javascript part (ts compiler plus our logic) - however this should happen only once per call. The translation itself not supposed to take that long.
  3. created a separate issue - Option -b some_package_name gave no effect #8
  4. Will be considered as a feature request (reuse entities between files)
  5. A separate issue - Overrides are not resolved for parent entities defined in different files #9
  6. Will be considered as a feature request.

@webleaf
Copy link

webleaf commented May 27, 2019

  1. Are there any plans for this?
  2. I see the milestone 0.0.5 was removed for Overrides are not resolved for parent entities defined in different files #9

dukat is not useful without ability to convert multiply files (it requires a huge amount of manual work after dukat, because many files are related).

@Schahen
Copy link
Contributor

Schahen commented May 27, 2019

@webleaf There are definitely plans for this, I've removed #9 from 0.0.5 only because 0.0.5 is a bugfix release which is planned to happen tomorrow (so earlier than next Friday). I'm also reviewing all that can be improved regarding the import/compile-all-togeher etc. issues and than I'll create tasks accordingly and we'll see what's next. Since the process is pretty transparent you'll see related issues pinned to corresponding milestone )

@ts2kt
Copy link
Author

ts2kt commented Jun 5, 2019

  1. Will be considered as a feature request (reuse entities between files)
  1. As a temporary solution, it could be global counter for all specified files. This will avoid the name conflicts in the package (otherwise a package contains many 'T$0', 'T$1' etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants