UNPKG

3.05 kBTypeScriptView Raw
1/**
2 * Determines how symlinks are followed.
3 */
4export declare enum SymlinkFollowMode {
5 /**
6 * Never follow symlinks.
7 */
8 NEVER = "never",
9 /**
10 * Materialize all symlinks, whether they are internal or external to the source directory.
11 */
12 ALWAYS = "always",
13 /**
14 * Only follows symlinks that are external to the source directory.
15 */
16 EXTERNAL = "external",
17 /**
18 * Forbids source from having any symlinks pointing outside of the source
19 * tree.
20 *
21 * This is the safest mode of operation as it ensures that copy operations
22 * won't materialize files from the user's file system. Internal symlinks are
23 * not followed.
24 *
25 * If the copy operation runs into an external symlink, it will fail.
26 */
27 BLOCK_EXTERNAL = "internal-only"
28}
29/**
30 * Determines the ignore behavior to use.
31 */
32export declare enum IgnoreMode {
33 /**
34 * Ignores file paths based on simple glob patterns.
35 *
36 * This is the default for file assets.
37 *
38 * It is also the default for Docker image assets, unless the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport'
39 * context flag is set.
40 */
41 GLOB = "glob",
42 /**
43 * Ignores file paths based on the [`.gitignore specification`](https://git-scm.com/docs/gitignore).
44 */
45 GIT = "git",
46 /**
47 * Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
48 *
49 * This is the default for Docker image assets if the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport'
50 * context flag is set.
51 */
52 DOCKER = "docker"
53}
54interface FileOptions {
55 /**
56 * Glob patterns to exclude from the copy.
57 *
58 * @default - nothing is excluded
59 */
60 readonly exclude?: string[];
61 /**
62 * The ignore behavior to use for exclude patterns.
63 *
64 * @default IgnoreMode.GLOB
65 */
66 readonly ignoreMode?: IgnoreMode;
67}
68/**
69 * Options applied when copying directories
70 */
71export interface CopyOptions extends FileOptions {
72 /**
73 * A strategy for how to handle symlinks.
74 *
75 * @default SymlinkFollowMode.NEVER
76 */
77 readonly follow?: SymlinkFollowMode;
78}
79/**
80 * Options applied when copying directories into the staging location.
81 */
82export interface FileCopyOptions extends FileOptions {
83 /**
84 * A strategy for how to handle symlinks.
85 *
86 * @default SymlinkFollowMode.NEVER
87 */
88 readonly followSymlinks?: SymlinkFollowMode;
89}
90interface ExtraHashOptions {
91 /**
92 * Extra information to encode into the fingerprint (e.g. build instructions
93 * and other inputs)
94 *
95 * @default - hash is only based on source content
96 */
97 readonly extraHash?: string;
98}
99/**
100 * Options related to calculating source hash.
101 */
102export interface FingerprintOptions extends CopyOptions, ExtraHashOptions {
103}
104/**
105 * Options related to calculating source hash.
106 */
107export interface FileFingerprintOptions extends FileCopyOptions, ExtraHashOptions {
108}
109export {};