Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 74 additions & 43 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,16 +676,54 @@ const tmpToolkitHelpers = configureProject(
devDeps: [
'@types/archiver',
'@types/semver',
'aws-sdk-client-mock',
'aws-sdk-client-mock-jest',
'fast-check',
'nock',
'@smithy/util-stream',
'xml-js',
],
deps: [
cloudAssemblySchema.name,
cloudFormationDiff,
cxApi,
`@aws-sdk/client-appsync@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudcontrol@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudformation@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudwatch-logs@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-codebuild@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ec2@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ecr@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ecs@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-elastic-load-balancing-v2@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-iam@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-kms@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-lambda@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-route-53@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-s3@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-secrets-manager@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-sfn@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ssm@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-sts@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/credential-providers@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/lib-storage@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/ec2-metadata-service@${CLI_SDK_V3_RANGE}`,
'@smithy/middleware-endpoint',
'@smithy/node-http-handler',
'@smithy/property-provider',
'@smithy/shared-ini-file-loader',
'@smithy/types',
'@smithy/util-retry',
'@smithy/util-waiter',
cdkAssets,
'archiver',
'chalk@4',
'fs-extra@^9',
'glob',
'minimatch',
'p-limit@^3',
'promptly', // @todo remove this should only be in CLI
'proxy-agent', // @todo remove this should only be in CLI
'semver',
'uuid',
'wrap-ansi@^7', // Last non-ESM version
Expand All @@ -699,6 +737,24 @@ const tmpToolkitHelpers = configureProject(
module: 'NodeNext',
},
},

jestOptions: jestOptionsForProject({
jestConfig: {
coverageThreshold: {
// We want to improve our test coverage
// DO NOT LOWER THESE VALUES!
// If you need to break glass, open an issue to re-up the values with additional test coverage
statements: 83,
branches: 84,
functions: 82,
lines: 83,
},
// We have many tests here that commonly time out
testTimeout: 30_000,
testEnvironment: './test/_helpers/jest-bufferedconsole.ts',
setupFilesAfterEnv: ['<rootDir>/test/_helpers/jest-setup-after-env.ts'],
},
}),
}),
);

Expand All @@ -713,7 +769,16 @@ tmpToolkitHelpers.package.addField('exports', {
tmpToolkitHelpers.eslint?.addRules({
'@cdklabs/no-throw-default-error': 'error',
});
tmpToolkitHelpers.eslint?.addOverride({
files: ['./test/**'],
rules: {
'@cdklabs/no-throw-default-error': 'off',
},
});

tmpToolkitHelpers.preCompileTask.exec('mkdir -p ./lib/api/bootstrap/ && cp ../../aws-cdk/lib/api/bootstrap/bootstrap-template.yaml ./lib/api/bootstrap/');

tmpToolkitHelpers.npmignore?.addPatterns('!lib/api/bootstrap/bootstrap-template.yaml');
tmpToolkitHelpers.gitignore.addPatterns('test/**/*.map');

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -756,37 +821,6 @@ const cli = configureProject(
cxApi,
'@aws-cdk/region-info',
'archiver',
`@aws-sdk/client-appsync@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudformation@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudwatch-logs@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-cloudcontrol@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-codebuild@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ec2@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ecr@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ecs@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-elastic-load-balancing-v2@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-iam@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-kms@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-lambda@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-route-53@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-s3@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-secrets-manager@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-sfn@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-ssm@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/client-sts@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/credential-providers@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/ec2-metadata-service@${CLI_SDK_V3_RANGE}`,
`@aws-sdk/lib-storage@${CLI_SDK_V3_RANGE}`,
'@aws-sdk/middleware-endpoint',
'@aws-sdk/util-retry',
'@aws-sdk/util-waiter',
'@smithy/middleware-endpoint',
'@smithy/shared-ini-file-loader',
'@smithy/property-provider',
'@smithy/types',
'@smithy/util-retry',
'@smithy/util-stream',
'@smithy/util-waiter',
'camelcase@^6', // Non-ESM
cdkAssets,
// A version that is guaranteed to still work on Node 16
Expand Down Expand Up @@ -837,21 +871,18 @@ const cli = configureProject(
// We want to improve our test coverage
// DO NOT LOWER THESE VALUES!
// If you need to break glass, open an issue to re-up the values with additional test coverage
statements: 84,
branches: 74,
statements: 80,
branches: 76,
functions: 87,
lines: 84,
lines: 82,
},
// We have many tests here that commonly time out
testTimeout: 60_000,
coveragePathIgnorePatterns: [
// Mostly wrappers around the SDK, which get mocked in unit tests
'<rootDir>/lib/api/aws-auth/sdk.ts',

// Files generated by cli-args-gen
'<rootDir>/lib/parse-command-line-arguments.ts',
'<rootDir>/lib/user-input.ts',
'<rootDir>/lib/convert-to-user-input.ts',
'<rootDir>/lib/cli/parse-command-line-arguments.ts',
'<rootDir>/lib/cli/user-input.ts',
'<rootDir>/lib/cli/convert-to-user-input.ts',
],
testEnvironment: './test/_helpers/jest-bufferedconsole.ts',
setupFilesAfterEnv: ['<rootDir>/test/_helpers/jest-setup-after-env.ts'],
Expand All @@ -867,7 +898,7 @@ const cli = configureProject(

// Eslint rules
cli.eslint?.addRules({
'@cdklabs/no-throw-default-error': ['error'],
'@cdklabs/no-throw-default-error': 'error',
});
cli.eslint?.addOverride({
files: ['./test/**'],
Expand Down Expand Up @@ -1128,7 +1159,6 @@ const toolkitLib = configureProject(
'@smithy/property-provider',
'@smithy/shared-ini-file-loader',
'@smithy/util-retry',
'@smithy/util-stream',
'@smithy/util-waiter',
'archiver',
'camelcase@^6', // Non-ESM
Expand Down Expand Up @@ -1177,14 +1207,15 @@ const toolkitLib = configureProject(
},
jestOptions: jestOptionsForProject({
jestConfig: {
testEnvironment: './test/_helpers/jest-bufferedconsole.ts',
coverageThreshold: {
// this is very sad but we will get better
statements: 85,
branches: 76,
functions: 77,
lines: 85,
},
testEnvironment: './test/_helpers/jest-bufferedconsole.ts',
setupFilesAfterEnv: ['<rootDir>/test/_helpers/jest-setup-after-env.ts'],
},
}),
tsconfig: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cli-lib-alpha/lib/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SharedOptions, DeployOptions, DestroyOptions, BootstrapOptions, SynthOptions, ListOptions } from './commands';
import { StackActivityProgress, HotswapMode } from './commands';
import { exec as runCli } from '../../../aws-cdk/lib';
import { createAssembly, prepareContext, prepareDefaultEnvironment } from '../../../aws-cdk/lib/api/cxapp/exec';
import { createAssembly, prepareContext, prepareDefaultEnvironment } from '../../../aws-cdk/lib/cxapp/exec';
import { debug } from '../../../aws-cdk/lib/legacy-exports';

const debugFn = async (msg: string) => void debug(msg);
Expand Down
11 changes: 10 additions & 1 deletion packages/@aws-cdk/tmp-toolkit-helpers/.eslintrc.json

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

1 change: 1 addition & 0 deletions packages/@aws-cdk/tmp-toolkit-helpers/.npmignore

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

Loading
Loading