Skip to content

Commit 60d3f7d

Browse files
committed
refactor
1 parent c20a468 commit 60d3f7d

Some content is hidden

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

49 files changed

+72
-71
lines changed

.projenrc.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ tmpToolkitHelpers.package.addField('exports', {
717717
'.': './lib/index.js',
718718
'./package.json': './package.json',
719719
'./api': './lib/api/index.js',
720+
'./util': './lib/util/index.js',
720721
});
721722

722723
//////////////////////////////////////////////////////////////////////
@@ -1254,6 +1255,8 @@ toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs');
12541255
// Smoke test built JS files
12551256
toolkitLib.postCompileTask.exec('node ./lib/index.js >/dev/null 2>/dev/null </dev/null');
12561257
toolkitLib.postCompileTask.exec('node ./lib/api/aws-cdk.js >/dev/null 2>/dev/null </dev/null');
1258+
toolkitLib.postCompileTask.exec('node ./lib/api/shared-public.js >/dev/null 2>/dev/null </dev/null');
1259+
toolkitLib.postCompileTask.exec('node ./lib/private/util.js >/dev/null 2>/dev/null </dev/null');
12571260

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

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

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

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';

0 commit comments

Comments
 (0)