Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ const cli = configureProject(
'<rootDir>/lib/user-input.ts',
'<rootDir>/lib/convert-to-user-input.ts',
],
testEnvironment: './test/jest-bufferedconsole.ts',
setupFilesAfterEnv: ['<rootDir>/test/jest-setup-after-env.ts'],
testEnvironment: './test/_helpers/jest-bufferedconsole.ts',
setupFilesAfterEnv: ['<rootDir>/test/_helpers/jest-setup-after-env.ts'],
},
}),

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/aws-cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export { guessExecutable } from '../../../../aws-cdk/lib/api/cxapp/exec';

// @todo Should not use! investigate how to replace
export { versionNumber } from '../../../../aws-cdk/lib/cli/version';
export { CliIoHost } from '../../../../aws-cdk/lib/toolkit/cli-io-host';
export { CliIoHost } from '../../../../aws-cdk/lib/cli/io-host';
8 changes: 8 additions & 0 deletions packages/@aws-cdk/user-input-gen/test/user-input-gen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ describe('render', () => {
commands: {
deploy: {
description: 'Deploy a stack',
aliases: ['ship-it'],
options: {
all: {
type: 'boolean',
desc: 'Deploy all stacks',
alias: 'A',
default: false,
},
},
Expand Down Expand Up @@ -70,6 +72,8 @@ describe('render', () => {

/**
* Deploy a stack
*
* aliases: ship-it
*/
readonly deploy?: DeployOptions;
}
Expand Down Expand Up @@ -119,12 +123,16 @@ describe('render', () => {
/**
* Deploy a stack
*
* aliases: ship-it
*
* @struct
*/
export interface DeployOptions {
/**
* Deploy all stacks
*
* aliases: A
*
* @default - false
*/
readonly all?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/user-input-gen/test/yargs-gen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('render', () => {
commands: {
test: {
description: 'the action under test',
aliases: ['spec'],
options: {
one: {
type: 'boolean',
Expand All @@ -104,7 +105,7 @@ describe('render', () => {
return yargs
.env('CDK')
.usage('Usage: cdk -a <cdk-app> COMMAND')
.command('test', 'the action under test', (yargs: Argv) =>
.command(['test', 'spec'], 'the action under test', (yargs: Argv) =>
yargs
.option('one', {
default: undefined,
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk/jest.config.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/lib/api/aws-auth/awscli-compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { ProxyAgent } from 'proxy-agent';
import { makeCachingProvider } from './provider-caching';
import type { SdkHttpOptions } from './sdk-provider';
import { readIfPossible } from './util';
import { AuthenticationError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { debug } from '../../logging';
import { AuthenticationError } from '../../toolkit/error';

const DEFAULT_CONNECTION_TIMEOUT = 10000;
const DEFAULT_TIMEOUT = 300000;
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/credential-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { inspect } from 'util';
import type { CredentialProviderSource, ForReading, ForWriting, PluginProviderResult, SDKv2CompatibleCredentials, SDKv3CompatibleCredentialProvider, SDKv3CompatibleCredentials } from '@aws-cdk/cli-plugin-contract';
import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@smithy/types';
import { credentialsAboutToExpire, makeCachingProvider } from './provider-caching';
import { AuthenticationError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { debug, warning } from '../../logging';
import { AuthenticationError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import type { Mode } from '../plugin/mode';
import { PluginHost } from '../plugin/plugin';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { CredentialPlugins } from './credential-plugins';
import { makeCachingProvider } from './provider-caching';
import { SDK } from './sdk';
import { callTrace, traceMemberMethods } from './tracing';
import { AuthenticationError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { debug, warning } from '../../logging';
import { AuthenticationError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import { Mode } from '../plugin/mode';

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ import { cachedAsync } from './cached';
import type { Account } from './sdk-provider';
import { traceMemberMethods } from './tracing';
import { defaultCliUserAgent } from './user-agent';
import { AuthenticationError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { debug } from '../../logging';
import { AuthenticationError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';

export interface S3ClientOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type * as cxapi from '@aws-cdk/cx-api';
import type { BootstrapEnvironmentOptions, BootstrappingParameters } from './bootstrap-props';
import { BootstrapStack, bootstrapVersionFromTemplate } from './deploy-bootstrap';
import { legacyBootstrapTemplate } from './legacy-template';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { warn } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import { bundledPackageRootDir, loadStructuredFile, serializeStructure } from '../../util';
import type { SDK, SdkProvider } from '../aws-auth';
import type { SuccessfulDeployStackResult } from '../deployments';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Settings } from './settings';
import { ToolkitError } from '../toolkit/error';
import { ToolkitError } from '../../../@aws-cdk/tmp-toolkit-helpers/src/api';

export { TRANSIENT_CONTEXT_KEY } from './settings';
export const PROJECT_CONTEXT = 'cdk.context.json';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { type StackDetails } from '@aws-cdk/tmp-toolkit-helpers';
import * as chalk from 'chalk';
import { minimatch } from 'minimatch';
import * as semver from 'semver';
import { AssemblyError, ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { info } from '../../logging';
import { AssemblyError, ToolkitError } from '../../toolkit/error';
import { flatten } from '../../util';

export enum DefaultSelection {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/cxapp/cloud-executable.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type * as cxapi from '@aws-cdk/cx-api';
import { CloudAssembly } from './cloud-assembly';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { Configuration } from '../../cli/user-configuration';
import * as contextproviders from '../../context-providers';
import { debug } from '../../logging';
import { ToolkitError } from '../../toolkit/error';
import type { SdkProvider } from '../aws-auth';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/cxapp/environments.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type * as cxapi from '@aws-cdk/cx-api';
import { minimatch } from 'minimatch';
import type { StackCollection } from './cloud-assembly';
import { ToolkitError } from '../../toolkit/error';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { SdkProvider } from '../aws-auth';

export function looksLikeGlob(environment: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/cxapp/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs-extra';
import * as semver from 'semver';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { Configuration } from '../../cli/user-configuration';
import { PROJECT_CONFIG, USER_DEFAULTS } from '../../cli/user-configuration';
import { versionNumber } from '../../cli/version';
import { debug, warning } from '../../logging';
import { ToolkitError } from '../../toolkit/error';
import { loadTree, some } from '../../tree';
import { splitBySize } from '../../util';
import type { SdkProvider } from '../aws-auth';
Expand Down
41 changes: 17 additions & 24 deletions packages/aws-cdk/lib/api/deployments/asset-publishing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import {
AssetPublishing,
} from 'cdk-assets';
import type { SDK } from '..';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { formatMessage } from '../../cli/messages';
import type { IoMessageLevel } from '../../toolkit/cli-io-host';
import { ToolkitError } from '../../toolkit/error';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoMessageMaker, IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { IO } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import type { SdkProvider } from '../aws-auth';
import { Mode } from '../plugin';

Expand Down Expand Up @@ -169,17 +168,17 @@ export class PublishingAws implements IAws {
}
}

export const EVENT_TO_LEVEL: Record<EventType, IoMessageLevel | false> = {
build: 'debug',
cached: 'debug',
check: 'debug',
debug: 'debug',
fail: 'error',
found: 'debug',
start: 'info',
success: 'info',
upload: 'debug',
shell_open: 'debug',
const EVENT_TO_MSG_MAKER: Record<EventType, IoMessageMaker<any> | false> = {
build: IO.DEFAULT_TOOLKIT_DEBUG,
cached: IO.DEFAULT_TOOLKIT_DEBUG,
check: IO.DEFAULT_TOOLKIT_DEBUG,
debug: IO.DEFAULT_TOOLKIT_DEBUG,
fail: IO.DEFAULT_TOOLKIT_ERROR,
found: IO.DEFAULT_TOOLKIT_DEBUG,
start: IO.DEFAULT_TOOLKIT_INFO,
success: IO.DEFAULT_TOOLKIT_INFO,
upload: IO.DEFAULT_TOOLKIT_DEBUG,
shell_open: IO.DEFAULT_TOOLKIT_DEBUG,
shell_stderr: false,
shell_stdout: false,
shell_close: false,
Expand All @@ -195,15 +194,9 @@ export abstract class BasePublishProgressListener implements IPublishProgressLis
protected abstract getMessage(type: EventType, event: IPublishProgress): string;

public onPublishEvent(type: EventType, event: IPublishProgress): void {
const level = EVENT_TO_LEVEL[type];
if (level) {
void this.ioHelper.notify(
formatMessage({
level,
message: this.getMessage(type, event),
data: undefined,
}),
);
const maker = EVENT_TO_MSG_MAKER[type];
if (maker) {
void this.ioHelper.notify(maker.msg(this.getMessage(type, event)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cxapi from '@aws-cdk/cx-api';
import * as chalk from 'chalk';
import type { AssetManifestBuilder } from './asset-manifest-builder';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import type { EnvironmentResources } from '../environment';
import type { ToolkitInfo } from '../toolkit-info';

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/checks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import type { SDK } from '../aws-auth';

export async function determineAllowCrossAccountAssetPublishing(
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/cloudformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import type { FileManifestEntry } from 'cdk-assets';
import { AssetManifest } from 'cdk-assets';
import { AssetManifestBuilder } from './asset-manifest-builder';
import type { Deployments } from './deployments';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import { formatErrorMessage, deserializeStructure } from '../../util';
import type { ICloudFormationClient, SdkProvider } from '../aws-auth';
import { StackStatus } from '../stack-events';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/deploy-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {
import type { ChangeSetDeploymentMethod, DeploymentMethod } from './deployment-method';
import type { DeployStackResult, SuccessfulDeployStackResult } from './deployment-result';
import { tryHotswapDeployment } from './hotswap-deployments';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { IO, type IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { ToolkitError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import type { SDK, SdkProvider, ICloudFormationClient } from '../aws-auth';
import type { EnvironmentResources } from '../environment';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/deployment-result.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ToolkitError } from '../../toolkit/error';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';

export type DeployStackResult =
| SuccessfulDeployStackResult
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/deployments/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import {
loadCurrentTemplateWithNestedStacks,
type RootTemplateWithNestedStacks,
} from './nested-stack-helpers';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug, warn } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import type { SdkProvider } from '../aws-auth/sdk-provider';
import { type EnvironmentResources, EnvironmentAccess } from '../environment';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { SDK, SdkProvider } from '../aws-auth';
import type { CloudFormationStack } from './cloudformation';
import type { NestedStackTemplates } from './nested-stack-helpers';
import { loadCurrentTemplateWithNestedStacks } from './nested-stack-helpers';
import { ToolkitError } from '../../toolkit/error';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { formatErrorMessage } from '../../util';
import { EvaluateCloudFormationTemplate } from '../evaluate-cloudformation-template';
import { isHotswappableAppSyncChange } from '../hotswap/appsync-mapping-templates';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/environment/environment-access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type * as cxapi from '@aws-cdk/cx-api';
import type { SDK } from '../aws-auth';
import type { EnvironmentResources } from './environment-resources';
import { EnvironmentResourcesRegistry } from './environment-resources';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { warn } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import type { CredentialsOptions, SdkForEnvironment, SdkProvider } from '../aws-auth/sdk-provider';
import { Mode } from '../plugin/mode';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Environment } from '@aws-cdk/cx-api';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug, warn } from '../../cli/messages';
import { Notices } from '../../notices';
import { ToolkitError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util';
import type { SDK } from '../aws-auth';
import { type EcrRepositoryInfo, ToolkitInfo } from '../toolkit-info';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { CloudFormationStackArtifact } from '@aws-cdk/cx-api';
import type { Export, ListExportsCommandOutput, StackResourceSummary } from '@aws-sdk/client-cloudformation';
import type { SDK } from './aws-auth';
import type { NestedStackTemplates } from './deployments';
import { ToolkitError } from '../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import { resourceMetadata } from '../../../@aws-cdk/tmp-toolkit-helpers/src/api/resource-metadata/resource-metadata';
import type { ResourceMetadata } from '../../../@aws-cdk/tmp-toolkit-helpers/src/api/resource-metadata/resource-metadata';
import { ToolkitError } from '../toolkit/error';

export interface ListStackResources {
listStackResources(): Promise<StackResourceSummary[]>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { IECRClient, IS3Client, SDK, SdkProvider } from '../aws-auth';
import { DEFAULT_TOOLKIT_STACK_NAME, ToolkitInfo } from '../toolkit-info';
import { ProgressPrinter } from './progress-printer';
import { ActiveAssetCache, BackgroundStackRefresh, refreshStacks } from './stack-refresh';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug, info } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import { Mode } from '../plugin/mode';

// Must use a require() otherwise esbuild complains
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as chalk from 'chalk';
import type { GcAsset as GCAsset } from './garbage-collector';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { info } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';

export class ProgressPrinter {
private ioHelper: IoHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ParameterDeclaration } from '@aws-sdk/client-cloudformation';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { IoHelper } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private';
import { debug } from '../../cli/messages';
import { ToolkitError } from '../../toolkit/error';
import type { ICloudFormationClient } from '../aws-auth';

export class ActiveAssetCache {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
type HotswapChange,
classifyChanges,
} from './common';
import { ToolkitError } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api';
import type { ResourceChange } from '../../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/payloads/hotswap';
import { ToolkitError } from '../../toolkit/error';
import { lowerCaseFirstCharacter, transformObjectKeys } from '../../util';
import type { SDK } from '../aws-auth';

Expand Down
Loading
Loading