Skip to content

Commit 87738ba

Browse files
committed
refactor(cli): rename logs to logs-monitor (#324)
We are about to move this module into a different package, and the target package is gitignoring any directory called `logs`. We could just fix the gitignore, but the module name is very inacurate anyway. Therefore we are renaming it. Also moves `rwlock` from `api/utils` to `api`. This was an oversight and doesn't warrant a separate PR. Finally moves some test files into their correct corresponding directories. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent d226562 commit 87738ba

29 files changed

+73
-57
lines changed

.projenrc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs');
12701270
toolkitLib.postCompileTask.exec('node ./lib/index.js >/dev/null 2>/dev/null </dev/null');
12711271
toolkitLib.postCompileTask.exec('node ./lib/api/aws-cdk.js >/dev/null 2>/dev/null </dev/null');
12721272
toolkitLib.postCompileTask.exec('node ./lib/api/shared-public.js >/dev/null 2>/dev/null </dev/null');
1273+
toolkitLib.postCompileTask.exec('node ./lib/api/shared-private.js >/dev/null 2>/dev/null </dev/null');
12731274
toolkitLib.postCompileTask.exec('node ./lib/private/util.js >/dev/null 2>/dev/null </dev/null');
12741275

12751276
// Do include all .ts files inside init-templates

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

Lines changed: 3 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/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

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,17 @@ export { Settings } from '../../../../aws-cdk/lib/api/settings';
88
export { type Tag, tagsForStack } from '../../../../aws-cdk/lib/api/tags';
99
export { DEFAULT_TOOLKIT_STACK_NAME } from '../../../../aws-cdk/lib/api/toolkit-info';
1010
export { ResourceMigrator } from '../../../../aws-cdk/lib/api/resource-import';
11-
export { CloudWatchLogEventMonitor, findCloudWatchLogGroups } from '../../../../aws-cdk/lib/api/logs';
11+
export { CloudWatchLogEventMonitor, findCloudWatchLogGroups } from '../../../../aws-cdk/lib/api/logs-monitor';
1212
export { type WorkGraph, WorkGraphBuilder, AssetBuildNode, AssetPublishNode, StackNode, Concurrency } from '../../../../aws-cdk/lib/api/work-graph';
1313
export { Bootstrapper } from '../../../../aws-cdk/lib/api/bootstrap';
1414
export { loadTree, some } from '../../../../aws-cdk/lib/api/tree';
1515
export { ResourcesToImport } from '../../../../aws-cdk/lib/api/resource-import';
16+
export { RWLock, type ILock } from '../../../../aws-cdk/lib/api/rwlock';
17+
export { HotswapMode, HotswapPropertyOverrides, EcsHotswapProperties } from '../../../../aws-cdk/lib/api/hotswap';
1618

1719
// Context Providers
1820
export * as contextproviders from '../../../../aws-cdk/lib/context-providers';
1921

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

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/shared-private.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
export * from '../../../tmp-toolkit-helpers/src/api/io/private';
44
export * from '../../../tmp-toolkit-helpers/src/private';
5+
export * from '../../../tmp-toolkit-helpers/src/api';
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
/* eslint-disable import/no-restricted-paths */
22

3-
export * from '../../../tmp-toolkit-helpers/src/api';
3+
export {
4+
ToolkitError,
5+
AuthenticationError,
6+
AssemblyError,
7+
ExpandStackSelection,
8+
StackSelectionStrategy,
9+
} from '../../../tmp-toolkit-helpers/src/api';
10+
11+
export type {
12+
IoMessageLevel,
13+
IoMessageCode,
14+
IIoHost,
15+
IoMessage,
16+
IoRequest,
17+
ToolkitAction,
18+
StackSelector,
19+
} from '../../../tmp-toolkit-helpers/src/api';
420

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

packages/@aws-cdk/toolkit-lib/lib/toolkit/non-interactive-io-host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as chalk from 'chalk';
2+
import type { IIoHost, IoMessage, IoMessageLevel, IoRequest } from '../api/io';
23
import type { IActivityPrinter } from '../api/shared-private';
34
import { HistoryActivityPrinter, isMessageRelevantForLevel } from '../api/shared-private';
4-
import type { IIoHost, IoMessage, IoMessageLevel, IoRequest } from '../api/shared-public';
55
import { isCI, isTTY } from '../util/shell-env';
66

77
export interface NonInteractiveIoHostProps {

0 commit comments

Comments
 (0)