Skip to content

typescript-angular: add providedIn for Angular 9+ - #8324

Merged
macjohnny merged 6 commits into
OpenAPITools:masterfrom
UnleashSpirit:fix_issue6432
Jan 6, 2021
Merged

typescript-angular: add providedIn for Angular 9+ #8324
macjohnny merged 6 commits into
OpenAPITools:masterfrom
UnleashSpirit:fix_issue6432

Conversation

@UnleashSpirit

@UnleashSpirit UnleashSpirit commented Jan 4, 2021

Copy link
Copy Markdown
Contributor

Adding new option, providedIn, for generator typescript-angular
Keep providedInRoot for backward compatibility but mark as deprecated for Angular 9+

fix: #6432

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. 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.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@UnleashSpirit

Copy link
Copy Markdown
Contributor Author

technical committee for typescript
@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)

@UnleashSpirit
UnleashSpirit marked this pull request as ready for review January 5, 2021 12:32
@wing328

wing328 commented Jan 6, 2021

Copy link
Copy Markdown
Member

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

Adding new option, providedIn, for generator typescript-angular
Keep providedInRoot for backward compatibility but mark as deprecated
for Angular 9+

fix: OpenAPITools#6432
infos about providedIn
Mark providedInRoot as deprecated
using typescript-angular-v9-provided-in-any.yaml

@macjohnny macjohnny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the providers array should also be adapted according the the selected providedIn option:

providers: [{{^providedInRoot}}
{{#apiInfo}}{{#apis}}{{classname}}{{^-last}},
{{/-last}}{{/apis}}{{/apiInfo}} {{/providedInRoot}}]

@macjohnny macjohnny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@macjohnny macjohnny added this to the 5.0.1 milestone Jan 6, 2021
@macjohnny macjohnny changed the title feat: add providedIn for Angular 9+ typescript-angular: add providedIn for Angular 9+ Jan 6, 2021
@macjohnny

Copy link
Copy Markdown
Member

@UnleashSpirit thanks for your contribution!
please re-generate the samples

@UnleashSpirit

UnleashSpirit commented Jan 6, 2021

Copy link
Copy Markdown
Contributor Author

@UnleashSpirit thanks for your contribution!
please re-generate the samples

Hmm ok, now I guess I need some explanation.
I just ran bin/generate-samples.sh and git status gives me 104 files to commit.
But none of them show any change inside?

@macjohnny

Copy link
Copy Markdown
Member

Hmm ok, now I guess I need some explanation.
I just ran bin/generate-samples.sh and git status gives me 104 files to commit.
But none of them show any change inside?

simply run

mvn clean package
bin/generate-samples.sh

@UnleashSpirit

Copy link
Copy Markdown
Contributor Author

Ok I figured out why, I'm on windows and newline are a mix of LF & CRLF currently.
Using GitBash to generate-samples gives me 334 files changes
Using WSL to generate-samples gives me 104 files changes
What do I do ? ^^

@macjohnny

Copy link
Copy Markdown
Member

commit all changed files with WSL

@UnleashSpirit

UnleashSpirit commented Jan 6, 2021

Copy link
Copy Markdown
Contributor Author

commit all changed files with WSL

Ok so I changed my mind, I clone again my repo with WLS so only LF newline.
Run mvn clean package then bin/generate-samples.sh, and guess what ? Nothing change ! (except the sample related to your remark)

May be add * text=auto eol=lf to gitattributes works ?

@macjohnny
macjohnny merged commit 9bd2a45 into OpenAPITools:master Jan 6, 2021
@UnleashSpirit
UnleashSpirit deleted the fix_issue6432 branch January 22, 2021 11:14
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.

[REQ][typescript-angular] Angular 9 providedIn support

3 participants