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

chore(cdk-build-tools): allow packing of private packages for local testing #32644

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tools/@aws-cdk/cdk-build-tools/bin/cdk-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function main() {
})
.option('pre-only', { type: 'boolean', default: false, desc: 'run pre package steps only' })
.option('post-only', { type: 'boolean', default: false, desc: 'run post package steps only' })
.option('private', { type: 'boolean', default: false, desc: 'Also package private packages for local usage' })
.argv;

if (args['pre-only'] && args['post-only']) {
Expand All @@ -43,8 +44,9 @@ async function main() {
const outdir = 'dist';

// if this is a private module, don't package
if (isPrivate()) {
process.stdout.write('No packaging for private modules.\n');
const packPrivate = args.private || options.private;
if (isPrivate() && !packPrivate) {
process.stdout.write('No packaging for private modules.\nUse --private to force packing private packages for local testing.\n');
return;
}

Expand Down
6 changes: 6 additions & 0 deletions tools/@aws-cdk/cdk-build-tools/lib/package-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ export interface CDKPackageOptions {
* Should this package be bundled. (and if so, how)
*/
bundle?: Omit<BundleProps, 'packageDir'>;

/**
* Also package private packages for local usage.
* @default false
*/
private?: boolean;
}

/**
Expand Down
Loading