Skip to content

Commit 824e2d2

Browse files
committed
toolkit-lib
1 parent ad1dbb2 commit 824e2d2

File tree

16 files changed

+47
-356
lines changed

16 files changed

+47
-356
lines changed

.projenrc.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ const tmpToolkitHelpers = configureProject(
720720
'chalk@4',
721721
'fs-extra@^9',
722722
'glob',
723+
'minimatch',
723724
'p-limit@^3',
724725
'promptly', // @todo remove this should only be in CLI
725726
'proxy-agent', // @todo remove this should only be in CLI
@@ -870,10 +871,10 @@ const cli = configureProject(
870871
// We want to improve our test coverage
871872
// DO NOT LOWER THESE VALUES!
872873
// If you need to break glass, open an issue to re-up the values with additional test coverage
873-
statements: 84,
874-
branches: 74,
874+
statements: 80,
875+
branches: 76,
875876
functions: 87,
876-
lines: 84,
877+
lines: 82,
877878
},
878879
// We have many tests here that commonly time out
879880
testTimeout: 60_000,

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

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

packages/@aws-cdk/toolkit-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/toolkit-lib/lib/actions/bootstrap/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type * as cxapi from '@aws-cdk/cx-api';
22
import { environmentsFromDescriptors } from './private';
33
import type { Tag } from '../../api/aws-cdk';
4-
import type { ICloudAssemblySource, IIoHost } from '../../api/cloud-assembly';
4+
import type { ICloudAssemblySource } from '../../api/cloud-assembly';
55
import { ALL_STACKS } from '../../api/cloud-assembly/private';
6+
import type { IIoHost } from '../../api/io';
67
import { asIoHelper } from '../../api/shared-private';
78
import { assemblyFromSource } from '../../toolkit/private';
89

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
/* eslint-disable import/no-restricted-paths */
22

3-
// APIs
4-
export { SdkProvider } from '../../../../aws-cdk/lib/api/aws-auth';
5-
export { Context, PROJECT_CONTEXT } from '../../../../aws-cdk/lib/api/context';
6-
export { createDiffChangeSet, Deployments, type SuccessfulDeployStackResult, type DeployStackOptions, type DeployStackResult } from '../../../../aws-cdk/lib/api/deployments';
7-
export { Settings } from '../../../../aws-cdk/lib/api/settings';
8-
export { type Tag, tagsForStack } from '../../../../aws-cdk/lib/api/tags';
9-
export { DEFAULT_TOOLKIT_STACK_NAME } from '../../../../aws-cdk/lib/api/toolkit-info';
10-
export { ResourceMigrator } from '../../../../aws-cdk/lib/api/resource-import';
11-
export { CloudWatchLogEventMonitor, findCloudWatchLogGroups } from '../../../../aws-cdk/lib/api/logs';
12-
export { type WorkGraph, WorkGraphBuilder, AssetBuildNode, AssetPublishNode, StackNode, Concurrency } from '../../../../aws-cdk/lib/api/work-graph';
13-
export { Bootstrapper } from '../../../../aws-cdk/lib/api/bootstrap';
14-
export { loadTree, some } from '../../../../aws-cdk/lib/api/tree';
3+
export * from '../../../tmp-toolkit-helpers/src/api';
4+
export * as contextproviders from '../../../tmp-toolkit-helpers/src/context-providers';
155

16-
// Context Providers
17-
export * as contextproviders from '../../../../aws-cdk/lib/context-providers';
6+
// // @todo Cloud Assembly and Executable - this is a messy API right now
7+
// export { prepareDefaultEnvironment, prepareContext, spaceAvailableForContext } from '../../../../aws-cdk/lib/api/cxapp/exec';
8+
// export { guessExecutable } from '../../../../aws-cdk/lib/api/cxapp/exec';
189

19-
// @todo APIs not clean import
20-
export { HotswapMode } from '../../../../aws-cdk/lib/api/hotswap';
21-
export { HotswapPropertyOverrides, EcsHotswapProperties } from '../../../../aws-cdk/lib/api/hotswap';
22-
export { RWLock, type ILock } from '../../../../aws-cdk/lib/api/util/rwlock';
23-
24-
// @todo Cloud Assembly and Executable - this is a messy API right now
25-
export { CloudAssembly, sanitizePatterns, StackCollection, ExtendedStackSelection } from '../../../../aws-cdk/lib/api/cxapp/cloud-assembly';
26-
export { prepareDefaultEnvironment, prepareContext, spaceAvailableForContext } from '../../../../aws-cdk/lib/api/cxapp/exec';
27-
export { guessExecutable } from '../../../../aws-cdk/lib/api/cxapp/exec';
28-
29-
// @todo Should not use! investigate how to replace
30-
export { versionNumber } from '../../../../aws-cdk/lib/cli/version';
10+
// // @todo Should not use! investigate how to replace
11+
// export { versionNumber } from '../../../../aws-cdk/lib/cli/version';
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from '../../api/shared-public';
21
export * from './source-builder';
32
export * from './types';
4-
3+
export { StackSelector, StackSelectionStrategy } from '../shared-public';

packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/prepare-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import * as cxapi from '@aws-cdk/cx-api';
66
import * as fs from 'fs-extra';
77
import { lte } from 'semver';
88
import type { SdkProvider } from '../../../api/aws-cdk';
9-
import { prepareDefaultEnvironment as oldPrepare, prepareContext, spaceAvailableForContext, Settings, loadTree, some, versionNumber, guessExecutable } from '../../../api/aws-cdk';
10-
import { splitBySize } from '../../../private/util';
9+
import { prepareDefaultEnvironment as oldPrepare, prepareContext, spaceAvailableForContext, Settings, loadTree, some, guessExecutable } from '../../../api/aws-cdk';
10+
import { splitBySize, versionNumber } from '../../../private/util';
1111
import type { ToolkitServices } from '../../../toolkit/private';
1212
import { IO } from '../../io/private';
1313
import type { IoHelper } from '../../shared-private';

packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/stack-assembly.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type * as cxapi from '@aws-cdk/cx-api';
22
import { major } from 'semver';
3-
import { CloudAssembly, sanitizePatterns, StackCollection, ExtendedStackSelection as CliExtendedStackSelection } from '../../aws-cdk';
3+
import { StackCollection, ExtendedStackSelection as CliExtendedStackSelection, BaseStackAssembly } from '../../aws-cdk';
44
import { ToolkitError } from '../../shared-public';
55
import type { StackSelector } from '../stack-selector';
66
import { ExpandStackSelection, StackSelectionStrategy } from '../stack-selector';
@@ -9,7 +9,7 @@ import type { ICloudAssemblySource } from '../types';
99
/**
1010
* A single Cloud Assembly wrapped to provide additional stack operations.
1111
*/
12-
export class StackAssembly extends CloudAssembly implements ICloudAssemblySource {
12+
export class StackAssembly extends BaseStackAssembly implements ICloudAssemblySource {
1313
public async produce(): Promise<cxapi.CloudAssembly> {
1414
return this.assembly;
1515
}
@@ -29,7 +29,7 @@ export class StackAssembly extends CloudAssembly implements ICloudAssemblySource
2929
}
3030

3131
const extend = expandToExtendEnum(selector.expand);
32-
const patterns = sanitizePatterns(selector.patterns ?? []);
32+
const patterns = StackAssembly.sanitizePatterns(selector.patterns ?? []);
3333

3434
switch (selector.strategy) {
3535
case StackSelectionStrategy.ALL_STACKS:
@@ -43,7 +43,7 @@ export class StackAssembly extends CloudAssembly implements ICloudAssemblySource
4343
case StackSelectionStrategy.ONLY_SINGLE:
4444
if (topLevelStacks.length !== 1) {
4545
// @todo text should probably be handled in io host
46-
throw new ToolkitError('Since this app includes more than a single stack, specify which stacks to use (wildcards are supported) or specify `--all`\n' +
46+
throw new ToolkitError('Since this app includes more than a single stack, specsify which stacks to use (wildcards are supported) or specify `--all`\n' +
4747
`Stacks: ${allStacks.map(x => x.hierarchicalId).join(' · ')}`);
4848
}
4949
return new StackCollection(this, topLevelStacks);
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
/* eslint-disable import/no-restricted-paths */
22

3-
export * from '../../../tmp-toolkit-helpers/src/api';
3+
export {
4+
ToolkitError,
5+
AssemblyError,
6+
StackSelector,
7+
ExpandStackSelection,
8+
StackSelectionStrategy,
9+
IoMessageLevel,
10+
IoMessageCode,
11+
IIoHost,
12+
IoMessage,
13+
IoRequest,
14+
ToolkitAction,
15+
} from '../../../tmp-toolkit-helpers/src/api';
16+
17+
export * from '../../../tmp-toolkit-helpers/src/payloads';
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './toolkit';
22
export * from './non-interactive-io-host';
3-
export * from '../api/shared-public';

0 commit comments

Comments
 (0)