Skip to content

Commit

Permalink
Merge branch 'main' into otaviom/caret-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain authored Feb 28, 2025
2 parents 2545a0e + b580d1e commit 4cb7dfb
Show file tree
Hide file tree
Showing 66 changed files with 1,337 additions and 332 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/integ.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 61 additions & 8 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ function transitiveFeaturesAndFixes(thisPkg: string, depPkgs: string[]) {
].join(' '));
}

/**
* Returns all packages that are considered part of the toolkit,
* as relative paths from the provided package.
*/
function transitiveToolkitPackages(thisPkg: string) {
const toolkitPackages = [
'aws-cdk',
'@aws-cdk/tmp-toolkit-helpers',
'@aws-cdk/cloud-assembly-schema',
'@aws-cdk/cloudformation-diff',
];

return transitiveFeaturesAndFixes(thisPkg, toolkitPackages.filter(name => name !== thisPkg));
}

const repoProject = new yarn.Monorepo({
projenrcTs: true,
name: 'aws-cdk-cli',
Expand All @@ -160,7 +175,7 @@ const repoProject = new yarn.Monorepo({

defaultReleaseBranch: 'main',
devDeps: [
'cdklabs-projen-project-types@^0.1.220',
'cdklabs-projen-project-types',
'glob',
'semver',
`@aws-sdk/client-s3@${CLI_SDK_V3_RANGE}`,
Expand Down Expand Up @@ -623,7 +638,6 @@ const cdkAssets = configureProject(
},
],
npmDistTag: 'v3-latest',
prerelease: 'rc',
majorVersion: 3,

jestOptions: jestOptionsForProject({
Expand Down Expand Up @@ -665,6 +679,38 @@ cdkAssets.eslint?.addRules({ 'jest/no-export': ['off'] });

//////////////////////////////////////////////////////////////////////

const tmpToolkitHelpers = configureProject(
new yarn.TypeScriptWorkspace({
...genericCdkProps({
private: true,
}),
parent: repo,
name: '@aws-cdk/tmp-toolkit-helpers',
description: 'A temporary package to hold code shared between aws-cdk and @aws-cdk/toolkit-lib',
deps: [],
devDeps: [
cdkBuildTools,
],
tsconfig: {
compilerOptions: {
target: 'es2022',
lib: ['es2022', 'esnext.disposable'],
module: 'NodeNext',
esModuleInterop: false,
},
},
}),
);

// Prevent imports of private API surface
tmpToolkitHelpers.package.addField('exports', {
'.': './lib/index.js',
'./package.json': './package.json',
'./api': './lib/api/index.js',
});

//////////////////////////////////////////////////////////////////////

let CLI_SDK_VERSION: '2' | '3' = ('3' as any);

const cli = configureProject(
Expand All @@ -680,6 +726,7 @@ const cli = configureProject(
cdkBuildTools,
yargsGen,
cliPluginContract,
tmpToolkitHelpers,
'@octokit/rest',
'@types/archiver',
'@types/fs-extra@^9',
Expand Down Expand Up @@ -823,7 +870,7 @@ const cli = configureProject(
// Append a specific version string for testing
nextVersionCommand: 'tsx ../../projenrc/next-version.ts maybeRc',

releasableCommits: transitiveFeaturesAndFixes('aws-cdk', [cloudAssemblySchema.name, cloudFormationDiff.name]),
releasableCommits: transitiveToolkitPackages('aws-cdk'),
}),
);

Expand Down Expand Up @@ -959,7 +1006,7 @@ const cliLib = configureProject(
devDeps: ['aws-cdk-lib', cli, 'constructs'],
disableTsconfig: true,
nextVersionCommand: `tsx ../../../projenrc/next-version.ts copyVersion:../../../${cliPackageJson} append:-alpha.0`,
releasableCommits: transitiveFeaturesAndFixes('@aws-cdk/cli-lib-alpha', [cli.name, cloudAssemblySchema.name, cloudFormationDiff.name]),
releasableCommits: transitiveToolkitPackages('@aws-cdk/cli-lib-alpha'),
eslintOptions: {
dirs: ['lib'],
ignorePatterns: [
Expand Down Expand Up @@ -1115,13 +1162,14 @@ const toolkitLib = configureProject(
'@types/fs-extra',
'@types/split2',
cli,
tmpToolkitHelpers,
'aws-cdk-lib',
'aws-sdk-client-mock',
'esbuild',
'typedoc',
],
// Watch 2 directories at once
releasableCommits: transitiveFeaturesAndFixes('@aws-cdk/toolkit-lib', [cli.name, cloudAssemblySchema.name, cloudFormationDiff.name]),
releasableCommits: transitiveToolkitPackages('@aws-cdk/toolkit-lib'),
eslintOptions: {
dirs: ['lib'],
ignorePatterns: [
Expand Down Expand Up @@ -1167,6 +1215,11 @@ toolkitLib.eslint?.addRules({
target: './',
from: '../../aws-cdk',
message: 'All `aws-cdk` code must be used via lib/api/aws-cdk.ts',
},
{
target: './',
from: '../tmp-toolkit-helpers',
message: 'All `@aws-cdk/tmp-toolkit-helpers` code must be used via lib/api/shared-*.ts',
}],
}],
});
Expand Down Expand Up @@ -1262,7 +1315,7 @@ const cdkCliWrapper = configureProject(
srcdir: 'lib',
devDeps: ['aws-cdk-lib', cli, 'constructs', '@aws-cdk/integ-runner'],
nextVersionCommand: `tsx ../../../projenrc/next-version.ts copyVersion:../../../${cliPackageJson}`,
releasableCommits: transitiveFeaturesAndFixes('@aws-cdk/cdk-cli-wrapper', [cli.name, cloudAssemblySchema.name, cloudFormationDiff.name]),
releasableCommits: transitiveToolkitPackages('@aws-cdk/cdk-cli-wrapper'),

jestOptions: jestOptionsForProject({
jestConfig: {
Expand Down Expand Up @@ -1292,7 +1345,7 @@ const cdkAliasPackage = configureProject(
srcdir: 'lib',
deps: [cli],
nextVersionCommand: `tsx ../../projenrc/next-version.ts copyVersion:../../${cliPackageJson}`,
releasableCommits: transitiveFeaturesAndFixes('cdk', [cli.name, cloudAssemblySchema.name, cloudFormationDiff.name]),
releasableCommits: transitiveToolkitPackages('cdk'),
}),
);
void cdkAliasPackage;
Expand Down Expand Up @@ -1324,11 +1377,11 @@ const APPROVAL_ENVIRONMENT = 'integ-approval';
const TEST_ENVIRONMENT = 'run-tests';

new CdkCliIntegTestsWorkflow(repo, {
sourceRepo: 'aws/aws-cdk-cli',
approvalEnvironment: APPROVAL_ENVIRONMENT,
testEnvironment: TEST_ENVIRONMENT,
buildRunsOn: POWERFUL_RUNNER,
testRunsOn: POWERFUL_RUNNER,
expectNewCliLibVersion: true,

localPackages: [
// CloudAssemblySchema is not in this list because in the way we're doing
Expand Down
3 changes: 3 additions & 0 deletions aws-cdk-cli.code-workspace

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@aws-cdk/cdk-cli-wrapper/lib/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface DeployOptions extends DefaultCdkOptions {
/**
* What kind of security changes require approval
*
* @default RequireApproval.Never
* @default RequireApproval.NEVER
*/
readonly requireApproval?: RequireApproval;

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cli-lib-alpha/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@aws-cdk/cli-lib-alpha/API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@aws-cdk/cli-lib-alpha/lib/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface DeployOptions extends SharedOptions {
/**
* What kind of security changes require approval
*
* @default RequireApproval.Never
* @default RequireApproval.NEVER
*/
readonly requireApproval?: RequireApproval;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface DeployOptions extends DefaultCdkOptions {
/**
* What kind of security changes require approval
*
* @default RequireApproval.Never
* @default RequireApproval.NEVER
*/
readonly requireApproval?: RequireApproval;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
}
},
"requireApproval": {
"description": "What kind of security changes require approval (Default RequireApproval.Never)",
"description": "What kind of security changes require approval (Default RequireApproval.NEVER)",
"enum": [
"any-change",
"broadening",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"schemaHash": "1063bafc562a50e6dafeb8664275f5d61ff631542d47992963bfaf5cf277ab6e",
"schemaHash": "4244f1ed6fcece9abcfb319c637fd2eb863a5deef9cc36f05f7d52377ce60012",
"revision": 40
}
9 changes: 9 additions & 0 deletions packages/@aws-cdk/tmp-toolkit-helpers/.eslintrc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4cb7dfb

Please sign in to comment.