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(jsii): exclude files in tsconfig.json #1491

Closed
wants to merge 1 commit into from

Conversation

nija-at
Copy link
Contributor

@nija-at nija-at commented Apr 6, 2020

Commit Message

This change lets package.json of a jsii package to specify additional
'exclude' paths. They are encoded into tsconfig.json.

Motivation
jsconfig is a common way to configure tools like eslint and jest. These
files have the 'js' extension but should not be compiled into the
package. This flag lets the jsii compiled packages to configure this.

End Commit Message


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This change lets package.json of a jsii package to specify additional
'exclude' paths. They are encoded into tsconfig.json.

Motivation
jsconfig is a common way to configure tools like eslint and jest. These
files have the 'js' extension but should not be compiled into the
package. This flag lets the jsii compiled packages to configure this.
@nija-at nija-at requested review from RomainMuller and a team April 6, 2020 18:16
@nija-at nija-at self-assigned this Apr 6, 2020
@nija-at nija-at changed the title feat(jsii): files to exclude in tsconfig.json feat(jsii): exclude files in tsconfig.json Apr 6, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 6, 2020
@eladb
Copy link
Contributor

eladb commented Apr 6, 2020

Not sure what’s I am seeing here? Seems like we already have this feature under a different name, no?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: ffad449
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@nija-at
Copy link
Contributor Author

nija-at commented Apr 6, 2020

Are you referring to the property excludeTypescript? It wasn't clear why there's the typescript suffix, so I've tried to unify it under one property called exclude.

@eladb
Copy link
Contributor

eladb commented Apr 6, 2020

Are you referring to the property excludeTypescript? It wasn't clear why there's the typescript suffix, so I've tried to unify it under one property called exclude.

I’ll let @RomainMuller chime in on this.

@RomainMuller
Copy link
Contributor

Are you referring to the property excludeTypescript? It wasn't clear why there's the typescript suffix, so I've tried to unify it under one property called exclude.

I’ll let @RomainMuller chime in on this.

Well that was introduced in #343, and since the PR was mostly about something else it flew in.

But I'm generally favorable of modeling all the TypeScript compilation tweaks as an object under the jsii.tsc key, where the key for each option is the same as what's in tsconfig.json.

I am also wondering if we took a wrong turn in generating the tsconfig.json systematically, and whether we should actually allow a hand-written file with the other jsii configuration in there -- but this is a conversation for later.

@@ -142,6 +144,7 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies
&& (pkg.contributors as any[]).map((contrib, index) => _toPerson(contrib, `contributors[${index}]`, 'contributor')),

excludeTypescript: (pkg.jsii && pkg.jsii.excludeTypescript) || [],
exclude: (pkg.jsii && pkg.jsii.exclude) || [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Breaks surrounding style, and you might not want to fix them all up, so take it or leave it:

Suggested change
exclude: (pkg.jsii && pkg.jsii.exclude) || [],
exclude: pkg.jsii?.exclude ?? [],

@nija-at nija-at closed this Apr 7, 2020
@RomainMuller RomainMuller deleted the nija-at/excludes-in-pkginfo branch April 20, 2020 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants