Skip to content

Commit

Permalink
chore(aws-cdk-lib): minimum supported node version is now v14 (aws#11964
Browse files Browse the repository at this point in the history
)

This is the current active LTS version and is a good minimum
requirement.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Niranjan Jayakar authored and Mohan Rajendran committed Jan 24, 2021
1 parent b9eb38a commit d05c98e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--install.check-files true # install will verify file tree of packages for consistency
ignore-engines true # the 'engines' key for 'aws-cdk-lib' has specifies node14 as min while v1 will remain at node10
16 changes: 12 additions & 4 deletions tools/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,11 @@ export class MustHaveNodeEnginesDeclaration extends ValidationRule {
public readonly name = 'package-info/engines';

public validate(pkg: PackageJson): void {
expectJSON(this.name, pkg, 'engines.node', '>= 10.13.0 <13 || >=13.7.0');
if (cdkMajorVersion() === 2) {
expectJSON(this.name, pkg, 'engines.node', '>= 14.15.0');
} else {
expectJSON(this.name, pkg, 'engines.node', '>= 10.13.0 <13 || >=13.7.0');
}
}
}

Expand Down Expand Up @@ -1508,9 +1512,7 @@ export class UbergenPackageVisibility extends ValidationRule {
];

public validate(pkg: PackageJson): void {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const releaseJson = require(`${__dirname}/../../../release.json`);
if (releaseJson.majorVersion === 2) {
if (cdkMajorVersion() === 2) {
// Only packages in the publicPackages list should be "public". Everything else should be private.
if (this.publicPackages.includes(pkg.json.name) && pkg.json.private === true) {
pkg.report({
Expand Down Expand Up @@ -1613,3 +1615,9 @@ function toRegExp(str: string): RegExp {
function readBannerFile(file: string): string {
return fs.readFileSync(path.join(__dirname, 'banners', file), { encoding: 'utf-8' }).trim();
}

function cdkMajorVersion() {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const releaseJson = require(`${__dirname}/../../../release.json`);
return releaseJson.majorVersion as number;
}

0 comments on commit d05c98e

Please sign in to comment.