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

[TS] Fixes typescript-axios "File custom.d.ts not found" when building consumer TS project #4230

Merged
merged 6 commits into from
Oct 30, 2019

Conversation

alavkx
Copy link
Contributor

@alavkx alavkx commented Oct 23, 2019

Fixes #4227

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07)

@macjohnny
Copy link
Member

@alavkx what is the impact of removing this custom.d.ts?

@macjohnny
Copy link
Member

please re-generate all typescript-axios samples with

mvn clean package
https://github.com/OpenAPITools/openapi-generator/blob/master/bin/typescript-axios-petstore-all.sh

See https://circleci.com/gh/OpenAPITools/openapi-generator/9747#tests/containers/2

@alavkx
Copy link
Contributor Author

alavkx commented Oct 23, 2019

please re-generate all typescript-axios samples

Hmm 🤔
I did that but there were no file changes, strange. I'll give it another go.

Clearly did something wrong 😅
Pushed up the samples.

@alavkx what is the impact of removing this custom.d.ts?

I didn't find any impact, but I also don't understand the purpose of the file in the first place.

It is a declaration file with a single module, node's "url" module. I'm assuming that this declaration was created because @node/types was missing the url module in an older version. I've upgraded the package responsible for the types to the latest and removed the declaration—the project compiles a-ok.

Forgive my formatter making this diff so big, I can fix it up if we decide to merge this in.

@macjohnny
Copy link
Member

@nicokoenig do you know the purpose of the custom.d.ts and whether it could safely be removed?

@alavkx
Copy link
Contributor Author

alavkx commented Oct 28, 2019

Is there instructions somewhere for forking openapi-generator and building a binary to use in a fork of the node cli?

I understand if this takes a while to get merged in. Unfortunately, the problem is blocking other typescript projects from consuming the client — help with a workaround would be greatly appreciated ❤️

@macjohnny
Copy link
Member

@alavk you could also write a small script that will simply delete that file after generating code.

@macjohnny macjohnny merged commit b1984f3 into OpenAPITools:master Oct 30, 2019
@macjohnny macjohnny added this to the 4.2.0 milestone Oct 30, 2019
@alavkx alavkx deleted the patch-1 branch October 30, 2019 13:53
@wing328
Copy link
Member

wing328 commented Oct 31, 2019

@alavkx thanks for the PR, which has been included in v4.2.0 release: https://twitter.com/oas_generator/status/1189824932345069569

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

Successfully merging this pull request may close these issues.

[BUG] [TS] typescript-axios: Ambient declaration custom.d.ts not included in build
3 participants