Skip to content

Commit

Permalink
chore: remove 'ubergen exclude' from example package (#19177)
Browse files Browse the repository at this point in the history
The example construct library package comes with
`ubergen { exclude: true }` configured by default. We do want new construct
libraries included into ubergen by default, though.

I got into a little fight with `pkglint`: it said that `private` packages must always have `ubergen: exclude` set, but this package should be private but not have the `exclude` flag set.

Seems simpler to just exclude private packages from ubergen by default, without the middle man of the `exclude` flag.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr committed Mar 18, 2022
1 parent dc6d030 commit c94c277
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions packages/@aws-cdk/example-construct-library/package.json
Expand Up @@ -111,8 +111,5 @@
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
},
"ubergen": {
"exclude": true
}
}
12 changes: 0 additions & 12 deletions tools/@aws-cdk/pkglint/lib/rules.ts
Expand Up @@ -1733,18 +1733,6 @@ 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
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.ubergen?.exclude) {
if (packageJson.private || packageJson.ubergen?.exclude) {
console.log(`\t⚠️ Skipping (ubergen excluded): ${packageJson.name}`);
continue;
} else if (packageJson.jsii == null ) {
Expand Down

0 comments on commit c94c277

Please sign in to comment.