-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: expose node-bundle options via CLI #32475
Conversation
Add two options that were not being exposed via the CLI: - `minifyWhitespace` - Packing `target`
@@ -16,6 +16,8 @@ export async function cliMain(cliArgs: string[]) { | |||
.option('resource', { type: 'array', nargs: 1, default: [], desc: 'List of resources that need to be explicitly copied to the bundle (example: node_modules/proxy-agent/contextify.js:bin/contextify.js)' }) | |||
.option('dont-attribute', { type: 'string', desc: 'Dependencies matching this regular expressions wont be added to the notice file' }) | |||
.option('test', { type: 'string', desc: 'Validation command to sanity test the bundle after its created' }) | |||
.option('minify-whitespace', { type: 'boolean', default: false, desc: 'Minify whitespace' }) | |||
.option('pack-destination', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) |
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.
Can we put this as an option of the pack
command instead of global?
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.
Ah yeah, I thought we weren't doing that but I should have looked better.
* | ||
* @default '.' | ||
*/ | ||
readonly packDestination?: string; |
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.
Why is this needed?
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.
It's not.
.command('validate', 'Validate the package is ready for bundling', args => args | ||
.option('fix', { type: 'boolean', default: false, alias: 'f', desc: 'Fix any fixable violations' }), | ||
) | ||
.command('write', 'Write the bundled version of the project to a temp directory') | ||
.command('pack', 'Write the bundle and create the tarball') | ||
.command('pack', 'Write the bundle and create the tarball', args => args | ||
.option('pack-destination', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) |
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.
.option('pack-destination', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) | |
.option('destination', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) |
or better yet, to align with the name in the API.
.option('pack-destination', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) | |
.option('target', { type: 'string', desc: 'Directory to write the tarball to', nargs: 1, requiresArg: true }) |
But lets remove the redundant pack
from there.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32475 +/- ##
=======================================
Coverage 78.66% 78.66%
=======================================
Files 107 107
Lines 7237 7237
Branches 1329 1329
=======================================
Hits 5693 5693
Misses 1358 1358
Partials 186 186
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thank you for contributing! Your pull request will be updated from main 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 |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Add two options that were not being exposed via the CLI:
minifyWhitespace
target
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license