Skip to content

Commit 83bf7cd

Browse files
authored
feat: new package: @aws-cdk/cloud-assembly-api (#1033)
This package is going to contain the parts of `cx-api` that pertain to the CLI and the processing of Cloud Assemblies. First I've made copies of all parts of `cx-api` that actually are owned by the CLI instead of the library (that is: everything except feature flags and the environment variables that the Cloud Executable expects). After the first release of this package, we're going to remove everything that's been copied from the `cx-api` package from there, so that this becomes the only source of it. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 696dada commit 83bf7cd

227 files changed

Lines changed: 5205 additions & 160 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pull-request-lint.yml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/prepare-verdaccio.sh

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ function transitiveToolkitPackages(thisPkg: string) {
192192
const toolkitPackages = [
193193
'aws-cdk',
194194
'@aws-cdk/cloud-assembly-schema',
195+
'@aws-cdk/cloud-assembly-api',
195196
'@aws-cdk/cloudformation-diff',
196197
'@aws-cdk/toolkit-lib',
197198
];
@@ -493,43 +494,45 @@ const cloudFormationDiff = configureProject(
493494
);
494495

495496
// #endregion
496-
//////////////////////////////////////////////////////////////////////
497-
// #region @aws-cdk/cx-api
498497

499-
// cx-api currently is generated from `aws-cdk-lib` at build time. Not breaking
500-
// this dependency right now.
501-
502-
const cxApi = '@aws-cdk/cx-api';
498+
//////////////////////////////////////////////////////////////////////
499+
// #region @aws-cdk/cloud-assembly-api
503500

504-
/*
505-
const cxApi = overrideEslint(
501+
const cloudAssemblyApi = configureProject(
506502
new yarn.TypeScriptWorkspace({
507503
...genericCdkProps(),
508504
parent: repo,
509-
name: '@aws-cdk/cx-api',
510-
description: 'Helper functions to work with CDK Cloud Assembly files',
505+
name: '@aws-cdk/cloud-assembly-api',
506+
description: 'API for working with Cloud Assemblies',
511507
srcdir: 'lib',
512-
deps: ['semver'],
513-
devDeps: [cloudAssemblySchema, '@types/mock-fs', '@types/semver', 'madge', 'mock-fs'],
514-
bundledDeps: ['semver'],
515-
peerDeps: ['@aws-cdk/cloud-assembly-schema@>=38.0.0'],
516-
// FIXME: this should be a jsii project
517-
// (EDIT: or should it? We're going to bundle it into aws-cdk-lib)
508+
bundledDeps: ['jsonschema@~1.4.1', 'semver'],
509+
devDeps: [cloudAssemblySchema],
510+
peerDeps: [
511+
cloudAssemblySchema.customizeReference({ versionType: 'any-future' }),
512+
],
518513

519-
/*
520-
"build": "yarn gen && cdk-build --skip-lint",
521-
"gen": "cdk-copy cx-api",
522-
"watch": "cdk-watch",
523-
"lint": "cdk-lint && madge --circular --extensions js lib",
524-
*/
514+
jestOptions: jestOptionsForProject({
515+
jestConfig: {
516+
coverageThreshold: {
517+
functions: 75,
518+
},
519+
},
520+
}),
525521

526-
/*
527-
"awscdkio": {
528-
"announce": false
529-
},
522+
// Append a specific version string for testing
523+
nextVersionCommand: 'tsx ../../../projenrc/next-version.ts atLeast:2.0.0 maybeRc',
530524
}),
531525
);
532-
*/
526+
527+
// #endregion
528+
529+
//////////////////////////////////////////////////////////////////////
530+
// #region @aws-cdk/cx-api
531+
532+
// cx-api represents the flags that the Cloud Executable expects. It is
533+
// generated from `aws-cdk-lib` at build time. Stay within the same MV,
534+
// otherwise any should work
535+
const cxApi = '@aws-cdk/cx-api@^2';
533536

534537
// #endregion
535538
//////////////////////////////////////////////////////////////////////
@@ -626,7 +629,8 @@ const cdkAssetsLib = configureProject(
626629
srcdir: 'lib',
627630
deps: [
628631
cloudAssemblySchema.customizeReference({ versionType: 'any-future' }),
629-
`${cxApi}@^2`, // stay within the same MV, otherwise any should work
632+
cxApi,
633+
cloudAssemblyApi.customizeReference({ versionType: 'exact' }),
630634
'archiver',
631635
'glob',
632636
'mime@^2',
@@ -806,7 +810,8 @@ const toolkitLib = configureProject(
806810
cloudAssemblySchema.customizeReference({ versionType: 'any-future' }), // needs to be newer than what this was build with
807811
cloudFormationDiff.customizeReference({ versionType: 'any-minor' }), // stay within the same MV, otherwise any should work
808812
cdkAssetsLib.customizeReference({ versionType: 'any-minor' }), // stay within the same MV, otherwise any should work
809-
`${cxApi}@^2`, // stay within the same MV, otherwise any should work
813+
cxApi,
814+
cloudAssemblyApi.customizeReference({ versionType: 'exact' }),
810815
sdkDepForLib('@aws-sdk/client-appsync'),
811816
sdkDepForLib('@aws-sdk/client-bedrock-agentcore-control'),
812817
sdkDepForLib('@aws-sdk/client-cloudformation'),
@@ -1126,6 +1131,7 @@ const cli = configureProject(
11261131
cloudAssemblySchema.customizeReference({ versionType: 'any-future' }),
11271132
cloudFormationDiff.customizeReference({ versionType: 'exact' }),
11281133
cxApi,
1134+
cloudAssemblyApi.customizeReference({ versionType: 'exact' }),
11291135
toolkitLib,
11301136
'archiver',
11311137
'@aws-sdk/client-appsync',
@@ -1442,6 +1448,7 @@ const integRunner = configureProject(
14421448
deps: [
14431449
cloudAssemblySchema.customizeReference({ versionType: 'any-future' }),
14441450
cxApi,
1451+
cloudAssemblyApi.customizeReference({ versionType: 'exact' }),
14451452
cdkCliWrapper.customizeReference({ versionType: 'exact' }),
14461453
cli.customizeReference({ versionType: 'exact' }),
14471454
cdkAssetsLib.customizeReference({ versionType: 'exact' }),

aws-cdk-cli.code-workspace

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-assets-lib/.projen/deps.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-assets-lib/.projen/tasks.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-assets-lib/lib/private/placeholders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EnvironmentPlaceholders } from '@aws-cdk/cx-api';
1+
import { EnvironmentPlaceholders } from '@aws-cdk/cloud-assembly-api';
22
import type { IAws } from '../aws';
33

44
/**

packages/@aws-cdk/cdk-assets-lib/package.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)