Skip to content

Commit 3818fe3

Browse files
committed
refactor
1 parent d2bf72e commit 3818fe3

Some content is hidden

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

46 files changed

+67
-68
lines changed

.projenrc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,8 @@ toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs');
12531253
// Smoke test built JS files
12541254
toolkitLib.postCompileTask.exec('node ./lib/index.js >/dev/null 2>/dev/null </dev/null');
12551255
toolkitLib.postCompileTask.exec('node ./lib/api/aws-cdk.js >/dev/null 2>/dev/null </dev/null');
1256+
toolkitLib.postCompileTask.exec('node ./lib/api/shared-public.js >/dev/null 2>/dev/null </dev/null');
1257+
toolkitLib.postCompileTask.exec('node ./lib/private/util.js >/dev/null 2>/dev/null </dev/null');
12561258

12571259
// Do include all .ts files inside init-templates
12581260
toolkitLib.npmignore?.addPatterns(

packages/@aws-cdk/tmp-toolkit-helpers/src/util/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export * from './bool';
44
export * from './bytes';
55
export * from './cloudformation';
66
export * from './content-hash';
7+
export * from './directories';
78
export * from './format-error';
9+
export * from './json';
810
export * from './objects';
911
export * from './parallel';
1012
export * from './serialize';

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

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

packages/@aws-cdk/toolkit-lib/build-tools/bundle.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ await esbuild.build({
2727
entryPoints: [
2828
'lib/api/aws-cdk.ts',
2929
'lib/api/shared-public.ts',
30+
'lib/private/util.ts',
3031
],
3132
target: 'node18',
3233
platform: 'node',

packages/@aws-cdk/toolkit-lib/lib/api/aws-cdk.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ export { type WorkGraph, WorkGraphBuilder, AssetBuildNode, AssetPublishNode, Sta
1414
// Context Providers
1515
export * as contextproviders from '../../../../aws-cdk/lib/context-providers';
1616

17-
// utils
18-
export { formatTime } from '../../../../aws-cdk/lib/util/string-manipulation';
19-
export { formatErrorMessage } from '../../../../aws-cdk/lib/util/format-error';
20-
export { obscureTemplate, serializeStructure } from '../../../../aws-cdk/lib/util/serialize';
21-
export { validateSnsTopicArn } from '../../../../aws-cdk/lib/util/cloudformation';
22-
export { splitBySize } from '../../../../aws-cdk/lib/util/objects';
23-
2417
// @todo APIs not clean import
2518
export { HotswapMode } from '../../../../aws-cdk/lib/api/hotswap/common';
2619
export { HotswapPropertyOverrides, EcsHotswapProperties } from '../../../../aws-cdk/lib/api/hotswap/common';

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema';
44
import * as cxapi from '@aws-cdk/cx-api';
55
import * as fs from 'fs-extra';
66
import { lte } from 'semver';
7-
import { prepareDefaultEnvironment as oldPrepare, prepareContext, spaceAvailableForContext, Settings, loadTree, some, splitBySize, versionNumber } from '../../../api/aws-cdk';
7+
import { prepareDefaultEnvironment as oldPrepare, prepareContext, spaceAvailableForContext, Settings, loadTree, some, versionNumber } from '../../../api/aws-cdk';
8+
import { splitBySize } from '../../../private/util';
89
import { ToolkitServices } from '../../../toolkit/private';
910
import { ActionAwareIoHost, asLogger, CODES, error } from '../../io/private';
1011
import { ToolkitError } from '../../shared-public';

packages/@aws-cdk/toolkit-lib/lib/api/io/private/timer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CodeInfo, CODES } from './codes';
22
import { info } from './messages';
33
import { ActionAwareIoHost } from './types';
4-
import { formatTime } from '../../aws-cdk';
4+
import { formatTime } from '../../../private/util';
55

66
/**
77
* Helper class to measure the time of code.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/* eslint-disable import/no-restricted-paths */
22

3-
// APIs
43
export * from '../../../tmp-toolkit-helpers/src/api';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* eslint-disable import/no-restricted-paths */
2+
3+
export * from '../../../tmp-toolkit-helpers/src/util';

packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ import { type SynthOptions } from '../actions/synth';
1515
import { WatchOptions } from '../actions/watch';
1616
import { patternsArrayForWatch } from '../actions/watch/private';
1717
import { type SdkConfig } from '../api/aws-auth';
18-
import { DEFAULT_TOOLKIT_STACK_NAME, SdkProvider, SuccessfulDeployStackResult, StackCollection, Deployments, HotswapMode, ResourceMigrator, obscureTemplate, serializeStructure, tagsForStack, CliIoHost, validateSnsTopicArn, Concurrency, WorkGraphBuilder, AssetBuildNode, AssetPublishNode, StackNode, formatErrorMessage, CloudWatchLogEventMonitor, findCloudWatchLogGroups, formatTime, StackDetails } from '../api/aws-cdk';
18+
import { DEFAULT_TOOLKIT_STACK_NAME, SdkProvider, SuccessfulDeployStackResult, StackCollection, Deployments, HotswapMode, ResourceMigrator, tagsForStack, CliIoHost, Concurrency, WorkGraphBuilder, AssetBuildNode, AssetPublishNode, StackNode, CloudWatchLogEventMonitor, findCloudWatchLogGroups, StackDetails } from '../api/aws-cdk';
1919
import { ICloudAssemblySource, StackSelectionStrategy } from '../api/cloud-assembly';
2020
import { ALL_STACKS, CachedCloudAssemblySource, CloudAssemblySourceBuilder, IdentityCloudAssemblySource, StackAssembly } from '../api/cloud-assembly/private';
2121
import { IIoHost, IoMessageCode, IoMessageLevel } from '../api/io';
2222
import { asSdkLogger, withAction, Timer, confirm, error, info, success, warn, ActionAwareIoHost, debug, result, withoutEmojis, withoutColor, withTrimmedWhitespace, CODES } from '../api/io/private';
2323
import { ToolkitError } from '../api/shared-public';
24+
import { obscureTemplate, serializeStructure, validateSnsTopicArn, formatTime, formatErrorMessage } from '../private/util';
2425

2526
/**
2627
* The current action being performed by the CLI. 'none' represents the absence of an action.

0 commit comments

Comments
 (0)