Skip to content

Commit

Permalink
chore: fixup cli THIRD_PARTY_LICENSES (#21355)
Browse files Browse the repository at this point in the history
And introduce a pkglint rule that runs the @aws-cdk/node-bundle
validations as well as automated fixes as appropriate.
  • Loading branch information
RomainMuller authored Jul 28, 2022
1 parent 2904d2a commit b5ace66
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 10 deletions.
60 changes: 53 additions & 7 deletions packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

----------------

** async@3.2.3 - https://www.npmjs.com/package/async/v/3.2.3 | MIT
** async@3.2.4 - https://www.npmjs.com/package/async/v/3.2.4 | MIT
Copyright (c) 2010-2018 Caolan McMahon

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -156,7 +156,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE

----------------

** aws-sdk@2.1132.0 - https://www.npmjs.com/package/aws-sdk/v/2.1132.0 | Apache-2.0
** aws-sdk@2.1182.0 - https://www.npmjs.com/package/aws-sdk/v/2.1182.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down Expand Up @@ -198,6 +198,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


----------------

** brace-expansion@2.0.1 - https://www.npmjs.com/package/brace-expansion/v/2.0.1 | MIT
MIT License

Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


----------------

** buffer-crc32@0.2.13 - https://www.npmjs.com/package/buffer-crc32/v/0.2.13 | MIT
Expand Down Expand Up @@ -600,7 +626,7 @@ OTHER DEALINGS IN THE SOFTWARE.

----------------

** diff@5.0.0 - https://www.npmjs.com/package/diff/v/5.0.0 | BSD-3-Clause
** diff@5.1.0 - https://www.npmjs.com/package/diff/v/5.1.0 | BSD-3-Clause
Software License Agreement (BSD License)

Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
Expand Down Expand Up @@ -823,7 +849,7 @@ the licensed code:

----------------

** glob@7.2.0 - https://www.npmjs.com/package/glob/v/7.2.0 | ISC
** glob@7.2.3 - https://www.npmjs.com/package/glob/v/7.2.3 | ISC
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors
Expand Down Expand Up @@ -980,7 +1006,7 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE

----------------

** jsonschema@1.4.0 - https://www.npmjs.com/package/jsonschema/v/1.4.0 | MIT
** jsonschema@1.4.1 - https://www.npmjs.com/package/jsonschema/v/1.4.1 | MIT
jsonschema is licensed under MIT license.

Copyright (C) 2012-2015 Tom de Grunt <tom@degrunt.nl>
Expand Down Expand Up @@ -1410,6 +1436,26 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


----------------

** minimatch@5.1.0 - https://www.npmjs.com/package/minimatch/v/5.1.0 | ISC
The ISC License

Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


----------------

** normalize-path@3.0.0 - https://www.npmjs.com/package/normalize-path/v/3.0.0 | MIT
Expand Down Expand Up @@ -1592,7 +1638,7 @@ IN THE SOFTWARE.

----------------

** readdir-glob@1.1.1 - https://www.npmjs.com/package/readdir-glob/v/1.1.1 | Apache-2.0
** readdir-glob@1.1.2 - https://www.npmjs.com/package/readdir-glob/v/1.1.2 | Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -2213,7 +2259,7 @@ OTHER DEALINGS IN THE SOFTWARE.

----------------

** uuid@3.3.2 - https://www.npmjs.com/package/uuid/v/3.3.2 | MIT
** uuid@8.0.0 - https://www.npmjs.com/package/uuid/v/8.0.0 | MIT

----------------

Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The aws-cdk package includes the following third-party software/licensing:

** @jsii/check-node@1.62.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.62.0 | Apache-2.0
** @jsii/check-node@1.63.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.63.0 | Apache-2.0
jsii
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down Expand Up @@ -37,7 +37,7 @@ THE SOFTWARE.

----------------

** acorn@8.7.1 - https://www.npmjs.com/package/acorn/v/8.7.1 | MIT
** acorn@8.8.0 - https://www.npmjs.com/package/acorn/v/8.8.0 | MIT
MIT License

Copyright (C) 2012-2022 by various contributors (see AUTHORS)
Expand Down Expand Up @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE

----------------

** aws-sdk@2.1178.0 - https://www.npmjs.com/package/aws-sdk/v/2.1178.0 | Apache-2.0
** aws-sdk@2.1182.0 - https://www.npmjs.com/package/aws-sdk/v/2.1182.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down
30 changes: 30 additions & 0 deletions tools/@aws-cdk/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Bundle } from '@aws-cdk/node-bundle';
import * as fs from 'fs';
import * as path from 'path';
import * as caseUtils from 'case';
Expand Down Expand Up @@ -220,6 +221,35 @@ export class ThirdPartyAttributions extends ValidationRule {
}
}

export class NodeBundleValidation extends ValidationRule {
public readonly name = '@aws-cdk/node-bundle';

public validate(pkg: PackageJson): void {
const bundleConfig = pkg.json['cdk-package']?.bundle;
if (bundleConfig == null) {
return;
}

const bundle = new Bundle({
...bundleConfig,
packageDir: pkg.packageRoot,
});

const result = bundle.validate({ fix: false });
if (result.success) {
return;
}

for (const violation of result.violations) {
pkg.report({
fix: violation.fix,
message: violation.message,
ruleName: `${this.name} => ${violation.type}`,
});
}
}
}

/**
* Author must be AWS (as an Organization)
*/
Expand Down

0 comments on commit b5ace66

Please sign in to comment.