Skip to content

Commit

Permalink
chore: incorporate cdk-assets-schema into cloud-assembly-schema (aws#…
Browse files Browse the repository at this point in the history
…8482)

assets.json is part of the cloud assembly and as such we want to make sure it's schema and compatibility is managed together with the cloud assembly manifest.

To do that, we extended the cloud assembly schema "root" to include two keys `manifest` and `assets` and incorporated all the types from cdk-assets-schema into the JSON schema.

Now we can leverage the compatibility checks and versioning from cloud-assembly-schema instead of the ones we had in cdk-assets-schema.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Elad Ben-Israel authored Jun 23, 2020
1 parent f048e4e commit 7e2be93
Show file tree
Hide file tree
Showing 49 changed files with 481 additions and 404 deletions.
12 changes: 12 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ removed:@aws-cdk/core.BootstraplessSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingExternalId
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingRoleArn

# merge asset manifest schema into cloud assembly schema
removed:@aws-cdk/cdk-assets-schema.AssetManifestSchema
removed:@aws-cdk/cdk-assets-schema.AwsDestination
removed:@aws-cdk/cdk-assets-schema.DockerImageAsset
removed:@aws-cdk/cdk-assets-schema.DockerImageDestination
removed:@aws-cdk/cdk-assets-schema.DockerImageSource
removed:@aws-cdk/cdk-assets-schema.FileAsset
removed:@aws-cdk/cdk-assets-schema.FileDestination
removed:@aws-cdk/cdk-assets-schema.FileSource
removed:@aws-cdk/cdk-assets-schema.ManifestFile
removed:@aws-cdk/cdk-assets-schema.FileAssetPackaging
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
"@aws-cdk/aws-ecr-assets/minimatch/**",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler/**",
"@aws-cdk/cdk-assets-schema/semver",
"@aws-cdk/cdk-assets-schema/semver/**",
"@aws-cdk/cloud-assembly-schema/jsonschema",
"@aws-cdk/cloud-assembly-schema/jsonschema/**",
"@aws-cdk/cloud-assembly-schema/semver",
Expand Down
11 changes: 4 additions & 7 deletions packages/@aws-cdk/cdk-assets-schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
<!--BEGIN STABILITY BANNER-->
---

![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)
![Deprecated](https://img.shields.io/badge/deprecated-critical.svg?style=for-the-badge)

> This API may emit warnings. Backward compatibility is not guaranteed.
---
<!--END STABILITY BANNER-->

This module contains the schema definitions for the Asset Manifest.

We expose them via JSII so that they are checked for backwards compatibility
by the `jsii-diff` tool; routines exist in `validate.ts` which will return
them, so that the structs can only be strengthened (i.e., existing fields
may not be removed or made optional).
This schema is now part of @aws-cdk/cloud-assembly-schema.
7 changes: 2 additions & 5 deletions packages/@aws-cdk/cdk-assets-schema/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
export * from './manifest-schema';
export * from './docker-image-asset';
export * from './file-asset';
export * from './aws-destination';
export * from './validate';
// tslint:disable-next-line: no-console
console.error('error: @aws-cdk/cdk-assets-schema has been merged into @aws-cdk/cloud-assembly-schema');
25 changes: 0 additions & 25 deletions packages/@aws-cdk/cdk-assets-schema/lib/private/my-package-json.ts

This file was deleted.

65 changes: 0 additions & 65 deletions packages/@aws-cdk/cdk-assets-schema/lib/private/schema-helpers.ts

This file was deleted.

104 changes: 0 additions & 104 deletions packages/@aws-cdk/cdk-assets-schema/lib/validate.ts

This file was deleted.

11 changes: 3 additions & 8 deletions packages/@aws-cdk/cdk-assets-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
"url": "https://aws.amazon.com",
"organization": true
},
"dependencies": {
"semver": "^7.2.2"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.0",
Expand All @@ -64,17 +61,15 @@
"cdk"
],
"homepage": "https://github.com/aws/aws-cdk",
"bundledDependencies": [
"semver"
],
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"stability": "stable",
"stability": "deprecated",
"awscdkio": {
"announce": false
},
"maturity": "stable",
"deprecated": "merged into @aws-cdk/cloud-assembly-schema",
"maturity": "deprecated",
"cdk-build": {
"jest": true
}
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/cdk-assets-schema/test/dummy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('dummy', () => {
expect(true).toBeTruthy();
});
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cloud-assembly-schema/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lib/*.js
test/*.js
lib/**/*.js
test/**/*.js
scripts/*.js
*.js.map
*.d.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface DockerImageAsset {
/**
* Destinations for this file asset
*/
readonly destinations: Record<string, DockerImageDestination>;
readonly destinations: { [id: string]: DockerImageDestination };
}

/**
Expand Down Expand Up @@ -45,7 +45,7 @@ export interface DockerImageSource {
*
* @default - No additional build arguments
*/
readonly dockerBuildArgs?: Record<string, string>;
readonly dockerBuildArgs?: { [name: string]: string };
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface FileAsset {
/**
* Destinations for this file asset
*/
readonly destinations: Record<string, FileDestination>;
readonly destinations: { [id: string]: FileDestination };
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/cloud-assembly-schema/lib/assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './schema';
export * from './docker-image-asset';
export * from './file-asset';
export * from './aws-destination';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FileAsset } from './file-asset';
/**
* Definitions for the asset manifest
*/
export interface ManifestFile {
export interface AssetManifest {
/**
* Version of the manifest
*/
Expand All @@ -15,12 +15,12 @@ export interface ManifestFile {
*
* @default - No files
*/
readonly files?: Record<string, FileAsset>;
readonly files?: { [id: string]: FileAsset };

/**
* The Docker image assets in this manifest
*
* @default - No Docker images
*/
readonly dockerImages?: Record<string, DockerImageAsset>;
}
readonly dockerImages?: { [id: string]: DockerImageAsset };
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './schema';
export * from './metadata-schema';
export * from './artifact-schema';
export * from './context-queries';
6 changes: 2 additions & 4 deletions packages/@aws-cdk/cloud-assembly-schema/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from './cloud-assembly';
export * from './assets';
export * from './manifest';
export * from './schema';
export * from './metadata-schema';
export * from './artifact-schema';
export * from './context-queries';
Loading

0 comments on commit 7e2be93

Please sign in to comment.