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

[sdk/nodejs] Prevent Pulumi from overriding tsconfig.json options. #7068

Merged
merged 9 commits into from
Aug 16, 2021
Merged

[sdk/nodejs] Prevent Pulumi from overriding tsconfig.json options. #7068

merged 9 commits into from
Aug 16, 2021

Conversation

swen128
Copy link
Contributor

@swen128 swen128 commented May 17, 2021

Description

Fixes #4829, #2673

Checklist

  • I have added tests that prove my fix is effective or that my feature works

I haven't added tests yet because I'm not sure which test directory is relevant with this PR (maybe /tests/integration ?).

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@leezen leezen requested review from justinvp and pgavlin May 19, 2021 02:58
sdk/nodejs/cmd/run-policy-pack/run.ts Show resolved Hide resolved
sdk/nodejs/cmd/run-policy-pack/run.ts Show resolved Hide resolved
@lukehoban
Copy link
Member

Does this also address #3061?

@lukehoban
Copy link
Member

I haven't added tests yet because I'm not sure which test directory is relevant with this PR (maybe /tests/integration ?).

@justinvp Any thoughts on this? I seem to recall us having some tests for the tsnode compilation and configuration, but can't see where they are currently.


if (opts.typeScript) {
tsnode.register({
typeCheck: true,
skipProject: skipProject,
skipProject: true,
compilerOptions: {
target: "es6",
Copy link
Member

Choose a reason for hiding this comment

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

Note that since the default Pulumi templates use target: "es2016", this PR will lead to a change of beaviour for ~all users, where their tsnode compilation starts targeting es2016. I believe that should be fine (and indeed likely good). But it is a change, so we should be sure to do some further testing of this (for example, a run of the examples repo) to see if there are any issues raised.

Also related to pulumi/templates#116 which would involve bumping up the default target for new projects, which after this change would (correctly, I believe) cause those changes to get picked up by the tsnode compilation.

@swen128
Copy link
Contributor Author

swen128 commented May 24, 2021

Does this also address #3061?

tsnode.register({
typeCheck: true,
skipProject: skipProject,
compilerOptions: {
target: "es6",
module: "commonjs",
moduleResolution: "node",
sourceMap: "true",
},
});

This part does not override the paths option, so I doubt this is the cause of #3061.

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

Copy link
Member

@pgavlin pgavlin left a comment

Choose a reason for hiding this comment

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

LGTM aside from @lukehoban's comments.

@leezen leezen added this to the 0.58 milestone Jun 7, 2021
@aviflax
Copy link

aviflax commented Jun 18, 2021

I’m looking forward to this change! Just today I was frustrated that I couldn’t use Object.fromEntries which was just _exactly` what I needed. Kudos!

@emiliza emiliza modified the milestones: 0.58, 0.59 Jul 7, 2021
@emiliza emiliza modified the milestones: 0.59, 0.60 Jul 26, 2021
@github-actions
Copy link

github-actions bot commented Aug 2, 2021

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@github-actions
Copy link

github-actions bot commented Aug 2, 2021

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@justinvp
Copy link
Member

/run-acceptance-tests

@github-actions
Copy link

Please view the results of the PR Build + Acceptance Tests Run Here

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Further commands available:

  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@justinvp
Copy link
Member

/run-acceptance-tests

@github-actions
Copy link

Please view the results of the PR Build + Acceptance Tests Run Here

1 similar comment
@github-actions
Copy link

Please view the results of the PR Build + Acceptance Tests Run Here

@justinvp
Copy link
Member

LGTM. Thanks, @swen128! And many apologies for the delay getting this merged! I've included a test which confirms being able to set a new target compiler option from the program's tsconfig.json.

@justinvp justinvp merged commit b5ee840 into pulumi:master Aug 16, 2021
@swen128
Copy link
Contributor Author

swen128 commented Aug 16, 2021

@justinvp
Thanks for adding a test and merging this PR!

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

Successfully merging this pull request may close these issues.

Some tsconfig.json options are unintentionally overridden which can result in non-obvious TS compiler errors
8 participants