Skip to content

Commit bd14cbb

Browse files
skinny85njlynch
authored andcommitted
revert: "chore: add new interfaces for Assets (#13356)" (#13426)
This reverts commit 48963f7 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a0b1c3c commit bd14cbb

File tree

4 files changed

+19
-54
lines changed

4 files changed

+19
-54
lines changed

packages/@aws-cdk/assets/lib/fs/options.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface CopyOptions {
1010
* A strategy for how to handle symlinks.
1111
*
1212
* @default Never
13-
* @deprecated use `followSymlinks` instead
1413
*/
1514
readonly follow?: FollowMode;
1615

packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import * as assets from '@aws-cdk/assets';
44
import * as ecr from '@aws-cdk/aws-ecr';
5-
import { Annotations, AssetStaging, FeatureFlags, FileFingerprintOptions, IgnoreMode, Stack, SymlinkFollowMode, Token } from '@aws-cdk/core';
5+
import { Annotations, FeatureFlags, IgnoreMode, Stack, Token } from '@aws-cdk/core';
66
import * as cxapi from '@aws-cdk/cx-api';
77

88
// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
@@ -12,7 +12,7 @@ import { Construct } from 'constructs';
1212
/**
1313
* Options for DockerImageAsset
1414
*/
15-
export interface DockerImageAssetOptions extends assets.FingerprintOptions, FileFingerprintOptions {
15+
export interface DockerImageAssetOptions extends assets.FingerprintOptions {
1616
/**
1717
* ECR repository name
1818
*
@@ -140,9 +140,8 @@ export class DockerImageAsset extends Construct implements assets.IAsset {
140140
// deletion of the ECR repository the app used).
141141
extraHash.version = '1.21.0';
142142

143-
const staging = new AssetStaging(this, 'Staging', {
143+
const staging = new assets.Staging(this, 'Staging', {
144144
...props,
145-
follow: props.followSymlinks ?? toSymlinkFollow(props.follow),
146145
exclude,
147146
ignoreMode,
148147
sourcePath: dir,
@@ -185,13 +184,3 @@ function validateBuildArgs(buildArgs?: { [key: string]: string }) {
185184
}
186185
}
187186
}
188-
189-
function toSymlinkFollow(follow?: assets.FollowMode): SymlinkFollowMode | undefined {
190-
switch (follow) {
191-
case undefined: return undefined;
192-
case assets.FollowMode.NEVER: return SymlinkFollowMode.NEVER;
193-
case assets.FollowMode.ALWAYS: return SymlinkFollowMode.ALWAYS;
194-
case assets.FollowMode.BLOCK_EXTERNAL: return SymlinkFollowMode.BLOCK_EXTERNAL;
195-
case assets.FollowMode.EXTERNAL: return SymlinkFollowMode.EXTERNAL;
196-
}
197-
}

packages/@aws-cdk/aws-s3-assets/lib/asset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as cxapi from '@aws-cdk/cx-api';
88
import { Construct } from 'constructs';
99
import { toSymlinkFollow } from './compat';
1010

11-
export interface AssetOptions extends assets.CopyOptions, cdk.FileCopyOptions, cdk.AssetOptions {
11+
export interface AssetOptions extends assets.CopyOptions, cdk.AssetOptions {
1212
/**
1313
* A list of principals that should be able to read this asset from S3.
1414
* You can use `asset.grantRead(principal)` to grant read permissions later.
@@ -121,7 +121,7 @@ export class Asset extends Construct implements cdk.IAsset {
121121
const staging = new cdk.AssetStaging(this, 'Stage', {
122122
...props,
123123
sourcePath: path.resolve(props.path),
124-
follow: props.followSymlinks ?? toSymlinkFollow(props.follow),
124+
follow: toSymlinkFollow(props.follow),
125125
assetHash: props.assetHash ?? props.sourceHash,
126126
});
127127

packages/@aws-cdk/core/lib/fs/options.ts

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,19 @@ export enum IgnoreMode {
5656
* context flag is set.
5757
*/
5858
DOCKER = 'docker'
59-
}
59+
};
60+
61+
/**
62+
* Obtains applied when copying directories into the staging location.
63+
*/
64+
export interface CopyOptions {
65+
/**
66+
* A strategy for how to handle symlinks.
67+
*
68+
* @default SymlinkFollowMode.NEVER
69+
*/
70+
readonly follow?: SymlinkFollowMode;
6071

61-
interface FileOptions {
6272
/**
6373
* Glob patterns to exclude from the copy.
6474
*
@@ -75,30 +85,9 @@ interface FileOptions {
7585
}
7686

7787
/**
78-
* Options applied when copying directories
79-
*/
80-
export interface CopyOptions extends FileOptions {
81-
/**
82-
* A strategy for how to handle symlinks.
83-
*
84-
* @default SymlinkFollowMode.NEVER
85-
*/
86-
readonly follow?: SymlinkFollowMode;
87-
}
88-
89-
/**
90-
* Options applied when copying directories into the staging location.
88+
* Options related to calculating source hash.
9189
*/
92-
export interface FileCopyOptions extends FileOptions {
93-
/**
94-
* A strategy for how to handle symlinks.
95-
*
96-
* @default SymlinkFollowMode.NEVER
97-
*/
98-
readonly followSymlinks?: SymlinkFollowMode;
99-
}
100-
101-
interface ExtraHashOptions {
90+
export interface FingerprintOptions extends CopyOptions {
10291
/**
10392
* Extra information to encode into the fingerprint (e.g. build instructions
10493
* and other inputs)
@@ -107,15 +96,3 @@ interface ExtraHashOptions {
10796
*/
10897
readonly extraHash?: string;
10998
}
110-
111-
/**
112-
* Options related to calculating source hash.
113-
*/
114-
export interface FingerprintOptions extends CopyOptions, ExtraHashOptions {
115-
}
116-
117-
/**
118-
* Options related to calculating source hash.
119-
*/
120-
export interface FileFingerprintOptions extends FileCopyOptions, ExtraHashOptions {
121-
}

0 commit comments

Comments
 (0)