Skip to content

Commit 764a12c

Browse files
authored
chore: prevent api-extractor from publishing tagsForStack (#581)
Fixes internal issue that caused a function `tagsForStack1` to be published in the AWS CDK Toolkit Library API Reference. Removes the following entry: <img width="1372" alt="Screenshot 2025-06-06 at 12 13 11" src="https://github.com/user-attachments/assets/d7c8340f-4db1-4a6a-ac16-f0ddebe0932b" /> --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent e629e30 commit 764a12c

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './tags';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './util';
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type * as cxapi from '@aws-cdk/cx-api';
2+
import type { Tag } from '../tags';
23

34
/**
45
* @returns an array with the tags available in the stack metadata.
56
*/
67
export function tagsForStack(stack: cxapi.CloudFormationStackArtifact): Tag[] {
78
return Object.entries(stack.tags).map(([Key, Value]) => ({ Key, Value }));
89
}
9-
10-
export interface Tag {
11-
readonly Key: string;
12-
readonly Value: string;
13-
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Tag {
2+
readonly Key: string;
3+
readonly Value: string;
4+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import type { CloudFormationStack, ResourceMapping } from '../api/refactoring/cl
7171
import { RefactoringContext } from '../api/refactoring/context';
7272
import { hashObject } from '../api/refactoring/digest';
7373
import { ResourceMigrator } from '../api/resource-import';
74-
import { tagsForStack } from '../api/tags';
74+
import { tagsForStack } from '../api/tags/private';
7575
import { DEFAULT_TOOLKIT_STACK_NAME } from '../api/toolkit-info';
7676
import type { AssetBuildNode, AssetPublishNode, Concurrency, StackNode } from '../api/work-graph';
7777
import { WorkGraphBuilder } from '../api/work-graph';

packages/aws-cdk/lib/api-private.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
export { deployStack, DeployStackOptions as DeployStackApiOptions } from '../../@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack';
33
export * as cfnApi from '../../@aws-cdk/toolkit-lib/lib/api/deployments/cfn-api';
44
export * from '../../@aws-cdk/toolkit-lib/lib/api/io/private';
5+
export * from '../../@aws-cdk/toolkit-lib/lib/api/tags/private';
56
export * from '../../@aws-cdk/toolkit-lib/lib/private/activity-printer';
67
export * from '../../@aws-cdk/toolkit-lib/lib/api/cloud-assembly/private/borrowed-assembly';
78

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import * as uuid from 'uuid';
1212
import { CliIoHost } from './io-host';
1313
import type { Configuration } from './user-configuration';
1414
import { PROJECT_CONFIG } from './user-configuration';
15-
import { asIoHelper, cfnApi } from '../../lib/api-private';
15+
import { asIoHelper, cfnApi, tagsForStack } from '../../lib/api-private';
1616
import type { AssetBuildNode, AssetPublishNode, Concurrency, StackNode, WorkGraph } from '../api';
1717
import { DEFAULT_TOOLKIT_STACK_NAME, DiffFormatter, WorkGraphBuilder, removeNonImportResources, ResourceImporter, ResourceMigrator, GarbageCollector, CloudWatchLogEventMonitor, findCloudWatchLogGroups } from '../api';
1818
import type { SdkProvider } from '../api/aws-auth';
1919
import type { BootstrapEnvironmentOptions } from '../api/bootstrap';
2020
import { Bootstrapper } from '../api/bootstrap';
2121
import { ExtendedStackSelection, StackCollection } from '../api/cloud-assembly';
2222
import type { Deployments, SuccessfulDeployStackResult } from '../api/deployments';
23-
import { type Tag, tagsForStack } from '../api/tags';
23+
import { type Tag } from '../api/tags';
2424
import { StackActivityProgress } from '../commands/deploy';
2525
import { listStacks } from '../commands/list-stacks';
2626
import type { FromScan, GenerateTemplateOutput } from '../commands/migrate';

0 commit comments

Comments
 (0)