-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[typescript-axios] Properly emit module as ES6 instead of commonJS when using ES6 #10308
Conversation
Thanks, looks good, but since it is a breaking change, please file against the 6.0 branch |
@macjohnny Done! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Travis CI failed with the following:
Can you please take a look when you've time? Ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/236742100 |
@wing328 Seems it doesn't like uppercase names even when Typescript own documentation allows it The generated packages should still work, so anyone using the beta or compiling should not have any problems. I have those keys always upper-cased in all my projects without issues. So this seems more like a linting problem. Will make a PR for this later. |
What version of typescript are you using? |
@wing328 4.2.4 |
I think it is about the „module“ for non-es6, which should remain commonjs. @ferferga can you file a PR to fix that? |
@macjohnny Totally true! Read the log in my mobile phone quickly while commuting and thought it was all complaing about capitalization, but it's the CommonJS thing! PR up at #10316 as you can see linked above in this thread (this time pointing to the correct branch and with fully passing tests! :D) CC @wing328 as well. |
When using ES6 in the generator, the generated sources are indeed ES6. However, when building the package (and publishing to npm or other registries, as that's done automatically), TypeScript compiler builds a commonJS version of the code, which goes against the desire of the user's desire to build ES6.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02)