-
Notifications
You must be signed in to change notification settings - Fork 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
chore(pkglint): dont publish cdk.out directories #8803
Conversation
if (!npmIgnore.includes('**/cdk.out')) { | ||
pkg.report({ | ||
ruleName: this.name, | ||
message: `${npmIgnorePath}: Must exclude **/cdk.out`, | ||
fix: () => fs.writeFileSync( | ||
npmIgnorePath, | ||
`${npmIgnore}\n# exclude cdk artifacts\n**/cdk.out` | ||
) | ||
}); | ||
} |
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.
No need to prefix with **/
, and only ignore if it is a directory:
if (!npmIgnore.includes('**/cdk.out')) { | |
pkg.report({ | |
ruleName: this.name, | |
message: `${npmIgnorePath}: Must exclude **/cdk.out`, | |
fix: () => fs.writeFileSync( | |
npmIgnorePath, | |
`${npmIgnore}\n# exclude cdk artifacts\n**/cdk.out` | |
) | |
}); | |
} | |
if (!npmIgnore.includes('cdk.out/')) { | |
pkg.report({ | |
ruleName: this.name, | |
message: `${npmIgnorePath}: Must exclude cdk.out/`, | |
fix: () => fs.writeFileSync( | |
npmIgnorePath, | |
`${npmIgnore}\n# exclude cdk artifacts\ncdk.out/` | |
) | |
}); | |
} |
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.
@RomainMuller Are you sure about the **/
?
This is npm pack
output without it:
❯ npm pack
npm notice
npm notice 📦 @aws-cdk/aws-batch@0.0.0
npm notice === Tarball Contents ===
npm notice 193.3kB .jsii
npm notice 0 test/cdk.out/file
npm notice 0 test/nested/cdk.out/hello
npm notice 11.4kB LICENSE
npm notice 113B NOTICE
....
....
aws-cdk-aws-batch-0.0.0.tgz
And this is with it:
❯ npm pack
npm notice
npm notice 📦 @aws-cdk/aws-batch@0.0.0
npm notice === Tarball Contents ===
npm notice 193.3kB .jsii
npm notice 11.4kB LICENSE
npm notice 113B NOTICE
....
....
aws-cdk-aws-batch-0.0.0.tgz
Notice the first two lines. Am I missing something?
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.
Oh fuck this is npmIgnore, not gitignore! Sorry this is PEBCAK.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Adds a pkglint validation so that we always include `**/cdk.out` in our `.npmignore` files. This will prevent us from accidentally publishing cdk artifacts that were generated during build/test. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…g missing libraries this change was introduced in #8803 but the script to create missing construct libraries was not updated. As a follow-up, will look into creating a test that exercises creation of a new construct library and the subsequent validation against pkglint.
…g missing libraries (#10876) this change was introduced in #8803 but the script to create missing construct libraries was not updated. As a follow-up, will look into creating a test that exercises creation of a new construct library and the subsequent validation against pkglint. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Adds a pkglint validation so that we always include
**/cdk.out
in our.npmignore
files. This will prevent us from accidentally publishing cdk artifacts that were generated during build/test.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license