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(ubergen): switch to ubergen.exclude as a filter instead of private #11375

Merged
merged 4 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
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 @@ -100,5 +100,8 @@
},
"cdk-build": {
"jest": true
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,8 @@
],
"awscdkio": {
"announce": false
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions tools/cdk-build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions tools/cdk-integ-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@
},
"peerDependencies": {
"@aws-cdk/assert": "0.0.0"
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions tools/cfn2ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"ubergen": {
"exclude": true
}
}
24 changes: 24 additions & 0 deletions tools/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,30 @@ export class JestSetup extends ValidationRule {
}
}

export class UbergenPackageVisibility extends ValidationRule {
public readonly name = 'ubergen/package-visibility';

public validate(pkg: PackageJson): void {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const releaseJson = require(`${__dirname}/../../../release.json`);
if (releaseJson.majorVersion === 2) {
// skip in v2 for now
return;
}
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,
};
},
});
}
}
}

/**
* Determine whether this is a JSII package
*
Expand Down
3 changes: 3 additions & 0 deletions tools/pkgtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"ubergen": {
"exclude": true
}
}
4 changes: 2 additions & 2 deletions tools/ubergen/bin/ubergen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ async function findLibrariesToPackage(): Promise<readonly LibraryReference[]> {
for (const dir of await fs.readdir(librariesRoot)) {
const packageJson = await fs.readJson(path.resolve(librariesRoot, dir, 'package.json'));

if (packageJson.private) {
console.log(`\t⚠️ Skipping (private): ${packageJson.name}`);
if (packageJson.ubergen?.exclude) {
console.log(`\t⚠️ Skipping (ubergen excluded): ${packageJson.name}`);
continue;
} else if (packageJson.deprecated) {
console.log(`\t⚠️ Skipping (deprecated): ${packageJson.name}`);
Expand Down
3 changes: 3 additions & 0 deletions tools/ubergen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"ubergen": {
"exclude": true
}
}
3 changes: 3 additions & 0 deletions tools/yarn-cling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"ubergen": {
"exclude": true
}
}