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

feat(typescript): add an option to not rename all .js files to .ts and to set `allowJs` to true #4212

Merged
merged 5 commits into from Jul 3, 2019

Conversation

Projects
None yet
3 participants
@NataliaTepluhina
Copy link
Contributor

commented Jun 30, 2019

What does this PR do?

Close #2676

At the moment when we run vue add, Vue CLI renames all *.js files to *.ts. This PR introduces two new prompts on @vue/cli-plugin-typescript late-invokation:

  1. convertJsToTs: if set to true, renames all .js files to .ts. Otherwise renames only main.js -> main.ts;
  2. allowJs: if set to true, adds allowJs: true to TSConfig compiler options.

@NataliaTepluhina NataliaTepluhina requested review from Akryum and sodatea Jun 30, 2019

@NataliaTepluhina

This comment has been minimized.

Copy link
Contributor Author

commented Jun 30, 2019

@Akryum @sodatea could you please take a look? 🙇‍♀

@NataliaTepluhina NataliaTepluhina changed the title Do not rename all *.js files to *.ts after running `vue add @vue/typescript` - give users a choice to enable `allowJs:true` mode Add an option to not rename all .js to .ts and to add `allowJs: true` Jun 30, 2019

@NataliaTepluhina NataliaTepluhina changed the title Add an option to not rename all .js to .ts and to add `allowJs: true` chore(typescript): add an option to not rename all .js to .ts and to set `allowJs` to true` Jun 30, 2019

@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js to .ts and to set `allowJs` to true` chore(typescript): add an option to not rename all .js to .ts and to set `allowJs` to true Jun 30, 2019

@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js to .ts and to set `allowJs` to true chore(typescript): add an option to not rename all .js files to .ts and to set `allowJs` to true Jun 30, 2019

@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js files to .ts and to set `allowJs` to true feat(typescript): add an option to not rename all .js files to .ts and to set `allowJs` to true Jun 30, 2019

@sodatea

sodatea approved these changes Jul 2, 2019

@NataliaTepluhina NataliaTepluhina requested a review from sodatea Jul 2, 2019

@sodatea

sodatea approved these changes Jul 3, 2019

@sodatea sodatea merged commit 38debb4 into vuejs:dev Jul 3, 2019

7 checks passed

ci/circleci: cli-ui Your tests passed on CircleCI!
Details
ci/circleci: group-1 Your tests passed on CircleCI!
Details
ci/circleci: group-2 Your tests passed on CircleCI!
Details
ci/circleci: group-3 Your tests passed on CircleCI!
Details
ci/circleci: group-4 Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

sodatea added a commit that referenced this pull request Jul 3, 2019

feat(typescript): add `convertJsToTs` and `allowJs` options (#4212)
Close #2676

At the moment when we run `vue add`, Vue CLI renames all `*.js` files to `*.ts`. This PR introduces two new prompts on `@vue/cli-plugin-typescript` late-invokation:

1. `convertJsToTs`: if set to `true`, renames all `.js` files to `.ts`. Otherwise renames only `main.js` -> `main.ts`;
2. `allowJs`: if set to `true`, adds `allowJs: true` to TSConfig compiler options.

(cherry picked from commit 38debb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.