Skip to content

Commit eeb9df3

Browse files
committed
refactor(toolkit): move aws-auth and plugin to shared package
This intentionally only moves the source, and not the tests. Tests will be moved later to keep the diff size managable. Code is still tested as the tests are still running from `aws-cdk` package.
1 parent 5ed29f0 commit eeb9df3

Some content is hidden

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

55 files changed

+340
-64
lines changed

.projenrc.ts

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,16 +676,54 @@ const tmpToolkitHelpers = configureProject(
676676
devDeps: [
677677
'@types/archiver',
678678
'@types/semver',
679+
'aws-sdk-client-mock',
680+
'aws-sdk-client-mock-jest',
679681
'fast-check',
682+
'nock',
683+
'@smithy/util-stream',
684+
'xml-js',
680685
],
681686
deps: [
682687
cloudAssemblySchema.name,
683688
cloudFormationDiff,
684689
cxApi,
690+
`@aws-sdk/client-appsync@${CLI_SDK_V3_RANGE}`,
691+
`@aws-sdk/client-cloudcontrol@${CLI_SDK_V3_RANGE}`,
685692
`@aws-sdk/client-cloudformation@${CLI_SDK_V3_RANGE}`,
693+
`@aws-sdk/client-cloudwatch-logs@${CLI_SDK_V3_RANGE}`,
694+
`@aws-sdk/client-codebuild@${CLI_SDK_V3_RANGE}`,
695+
`@aws-sdk/client-ec2@${CLI_SDK_V3_RANGE}`,
696+
`@aws-sdk/client-ecr@${CLI_SDK_V3_RANGE}`,
697+
`@aws-sdk/client-ecs@${CLI_SDK_V3_RANGE}`,
698+
`@aws-sdk/client-elastic-load-balancing-v2@${CLI_SDK_V3_RANGE}`,
699+
`@aws-sdk/client-iam@${CLI_SDK_V3_RANGE}`,
700+
`@aws-sdk/client-kms@${CLI_SDK_V3_RANGE}`,
701+
`@aws-sdk/client-lambda@${CLI_SDK_V3_RANGE}`,
702+
`@aws-sdk/client-route-53@${CLI_SDK_V3_RANGE}`,
703+
`@aws-sdk/client-s3@${CLI_SDK_V3_RANGE}`,
704+
`@aws-sdk/client-secrets-manager@${CLI_SDK_V3_RANGE}`,
705+
`@aws-sdk/client-sfn@${CLI_SDK_V3_RANGE}`,
706+
`@aws-sdk/client-ssm@${CLI_SDK_V3_RANGE}`,
707+
`@aws-sdk/client-sts@${CLI_SDK_V3_RANGE}`,
708+
`@aws-sdk/credential-providers@${CLI_SDK_V3_RANGE}`,
709+
`@aws-sdk/lib-storage@${CLI_SDK_V3_RANGE}`,
710+
`@aws-sdk/ec2-metadata-service@${CLI_SDK_V3_RANGE}`,
711+
'@smithy/middleware-endpoint',
712+
'@smithy/node-http-handler',
713+
'@smithy/property-provider',
714+
'@smithy/shared-ini-file-loader',
715+
'@smithy/types',
716+
'@smithy/util-retry',
717+
'@smithy/util-waiter',
718+
cdkAssets,
686719
'archiver',
687720
'chalk@4',
721+
'fs-extra@^9',
688722
'glob',
723+
'minimatch',
724+
'p-limit@^3',
725+
'promptly', // @todo remove this should only be in CLI
726+
'proxy-agent', // @todo remove this should only be in CLI
689727
'semver',
690728
'uuid',
691729
'wrap-ansi@^7', // Last non-ESM version
@@ -870,9 +908,6 @@ const cli = configureProject(
870908
// We have many tests here that commonly time out
871909
testTimeout: 60_000,
872910
coveragePathIgnorePatterns: [
873-
// Mostly wrappers around the SDK, which get mocked in unit tests
874-
'<rootDir>/lib/api/aws-auth/sdk.ts',
875-
876911
// Files generated by cli-args-gen
877912
'<rootDir>/lib/cli/parse-command-line-arguments.ts',
878913
'<rootDir>/lib/cli/user-input.ts',

packages/@aws-cdk/tmp-toolkit-helpers/.projen/deps.json

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

packages/@aws-cdk/tmp-toolkit-helpers/.projen/tasks.json

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

packages/@aws-cdk/tmp-toolkit-helpers/package.json

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

packages/aws-cdk/lib/api/aws-auth/account-cache.ts renamed to packages/@aws-cdk/tmp-toolkit-helpers/src/api/aws-auth/account-cache.ts

File renamed without changes.

packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts renamed to packages/@aws-cdk/tmp-toolkit-helpers/src/api/aws-auth/awscli-compatible.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import * as promptly from 'promptly';
88
import { makeCachingProvider } from './provider-caching';
99
import { ProxyAgentProvider } from './proxy-agent';
1010
import type { SdkHttpOptions } from './sdk-provider';
11-
import { AuthenticationError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
12-
import { IO, type IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
11+
import { IO, type IoHelper } from '../io/private';
12+
import { AuthenticationError } from '../toolkit-error';
1313

1414
const DEFAULT_CONNECTION_TIMEOUT = 10000;
1515
const DEFAULT_TIMEOUT = 300000;

packages/aws-cdk/lib/api/aws-auth/cached.ts renamed to packages/@aws-cdk/tmp-toolkit-helpers/src/api/aws-auth/cached.ts

File renamed without changes.

0 commit comments

Comments
 (0)