Skip to content

Commit

Permalink
chore: add enough information to make package builds cacheable (#14341)
Browse files Browse the repository at this point in the history
Enhance our `package.json`s with enough information to make hermetic, cacheable builds possible. Mostly consists of:

* Adding missing `@types/*` packages to `devDepencendies` everywhere. Those dependencies were always required but undeclared.
* Add `nozem.ostools` to various packages to indicate the non-hermetic binaries these scripts depend on.
* Add `/// !cdk-integ pragma:ignore-assets` to all integ tests that use assets.
* Fix some `.gitignores` that were ignoring files that were already committed inside git.
* Update `pkglint` to not be reliant on its *own* location inside the monorepo, but instead search upwards for the monorepo root from the package it's checking.

To give this a shot yourself, run:

```
$ npx nozem
```


This is a revival of #10039, which is now obsolete.

----

*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 authored Apr 23, 2021
1 parent 75c96d7 commit 96cb9e3
Show file tree
Hide file tree
Showing 204 changed files with 293 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ yarn-error.log

# Cloud9
.c9
.nzm-*

/.versionrc.json
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
"name": "Amazon Web Services",
"url": "https://aws.amazon.com"
},
"nozem": {
"$comment": [
"these files are read by pkglint and cdk-build-tools tests for almost every package.",
"Rather than add them to each package.json individually, do it globally here."
],
"globalNonPackageFiles": [
"package.json",
"release.json",
"scripts/resolve-version.js",
"scripts/resolve-version-lib.js",
"version.v1.json"
]
},
"workspaces": {
"packages": [
"packages/*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// !cdk-integ pragma:ignore-assets
import { SubnetType, Vpc } from '@aws-cdk/aws-ec2';
import { ContainerImage } from '@aws-cdk/aws-ecs';
import { CnameRecord, PublicHostedZone } from '@aws-cdk/aws-route53';
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/alexa-ask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"ubergen": {
"exclude": true
},
"nozem": false,
"stability": "experimental",
"maturity": "developer-preview",
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"awscdkio": {
"announce": false
},
"nozem": {
"ostools": ["rm", "tar", "gzip"]
},
"publishConfig": {
"tag": "latest"
}
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-accessanalyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-acmpca/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-amazonmq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-apigatewayv2-integrations": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"cdk-build-tools": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-apigatewayv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-appconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-appflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-applicationinsights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-appstream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-appsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-athena/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"nodeunit-shim": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-auditmanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-autoscaling-hooktargets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-ec2": "0.0.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-autoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/cx-api": "0.0.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-autoscalingplans/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-backup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-budgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cassandra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-ce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require('cdk-build-tools/config/eslintrc');
baseConfig.parserOptions.project = __dirname + '/tsconfig.json';
module.exports = baseConfig;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/aws-lambda": "^8.10.75",
"@types/sinon": "^9.0.11",
"cdk-build-tools": "0.0.0",
"aws-sdk": "^2.596.0",
"aws-sdk-mock": "^5.1.0",
"eslint": "^7.24.0",
Expand All @@ -37,6 +40,7 @@
"eslint-plugin-standard": "^4.1.0",
"jest": "^26.6.3",
"lambda-tester": "^3.6.0",
"sinon": "^9.0.2",
"nock": "^13.0.11",
"ts-jest": "^26.5.4"
}
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-certificatemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-chatbot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// !cdk-integ pragma:ignore-assets
import * as iam from '@aws-cdk/aws-iam';
import * as logs from '@aws-cdk/aws-logs';
import * as cdk from '@aws-cdk/core';
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloud9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-codecommit": "0.0.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudfront-origins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-ec2": "0.0.0",
"aws-sdk": "^2.848.0",
"cdk-build-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"aws-sdk": "^2.848.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudtrail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"aws-sdk": "^2.848.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudwatch-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-ec2": "0.0.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codeartifact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codedeploy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js

junit.xml
junit.xml
!test/lambda/*/*.js
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codeguruprofiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codegurureviewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
"pkglint": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/aws-cloudtrail": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@types/lodash": "^4.14.168",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codepipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"@aws-cdk/cx-api": "0.0.0",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-codestar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.22",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
Loading

0 comments on commit 96cb9e3

Please sign in to comment.