Skip to content

Commit

Permalink
chore(ubergen): Revert "chore: remove 'ubergen exclude' from example …
Browse files Browse the repository at this point in the history
…package (#19177)" (#19540)

This reverts commit c94c277.

In the `v2-main` branch all packages are private, which causes ubergen to exclude all of them, which we don't want.

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
otaviomacedo authored Mar 24, 2022
1 parent d06b27f commit a349666
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/example-construct-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,8 @@
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions packages/cdk-cli-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,8 @@
"maturity": "experimental",
"publishConfig": {
"tag": "latest"
},
"ubergen": {
"exclude": true
}
}
12 changes: 12 additions & 0 deletions tools/@aws-cdk/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,18 @@ export class UbergenPackageVisibility extends ValidationRule {
},
});
}
} else {
if (pkg.json.private && !pkg.json.ubergen?.exclude) {
pkg.report({
ruleName: this.name,
message: 'ubergen.exclude must be configured for private packages',
fix: () => {
pkg.json.ubergen = {
exclude: true,
};
},
});
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/@aws-cdk/ubergen/bin/ubergen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function findLibrariesToPackage(uberPackageJson: PackageJson): Promise<rea
for (const dir of await fs.readdir(librariesRoot)) {
const packageJson = await fs.readJson(path.resolve(librariesRoot, dir, 'package.json'));

if (packageJson.private || packageJson.ubergen?.exclude) {
if (packageJson.ubergen?.exclude) {
console.log(`\t⚠️ Skipping (ubergen excluded): ${packageJson.name}`);
continue;
} else if (packageJson.jsii == null ) {
Expand Down

0 comments on commit a349666

Please sign in to comment.