@netlify/zip-it-and-ship-it 15.3.2 → 15.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +20 -151
- package/dist/config.js +0 -5
- package/dist/rate_limit.d.ts +15 -20
- package/dist/rate_limit.js +5 -5
- package/dist/runtimes/node/bundlers/types.d.ts +1 -1
- package/dist/runtimes/node/bundlers/types.js +1 -1
- package/dist/runtimes/node/in_source_config/index.d.ts +61 -140
- package/dist/runtimes/node/in_source_config/index.js +3 -3
- package/dist/runtimes/node/parser/index.d.ts +0 -8
- package/dist/runtimes/node/parser/index.js +0 -142
- package/dist/runtimes/node/utils/entry_file.d.ts +0 -1
- package/dist/runtimes/node/utils/entry_file.js +0 -1
- package/dist/runtimes/node/utils/module_format.d.ts +1 -1
- package/dist/runtimes/node/utils/module_format.js +1 -1
- package/package.json +3 -5
- package/dist/utils/timer.d.ts +0 -2
- package/dist/utils/timer.js +0 -11
package/dist/config.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type { FunctionRegion } from '@netlify/types';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
import { FunctionSource } from './function.js';
|
|
4
3
|
export declare const functionConfigShape: z.ZodObject<{
|
|
5
4
|
background: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
-
externalNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString
|
|
5
|
+
externalNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
7
6
|
generator: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
includedFiles: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString
|
|
7
|
+
includedFiles: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
9
8
|
includedFilesBasePath: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
10
|
-
ignoredNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString
|
|
9
|
+
ignoredNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
11
10
|
name: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
12
|
-
nodeBundler: z.ZodCatch<z.ZodOptional<z.
|
|
11
|
+
nodeBundler: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
13
12
|
readonly ESBUILD: "esbuild";
|
|
14
13
|
readonly ESBUILD_ZISI: "esbuild_zisi";
|
|
15
14
|
readonly NFT: "nft";
|
|
@@ -18,161 +17,31 @@ export declare const functionConfigShape: z.ZodObject<{
|
|
|
18
17
|
}>>>;
|
|
19
18
|
nodeSourcemap: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
20
19
|
nodeVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
21
|
-
memory: z.ZodOptional<z.
|
|
22
|
-
region: z.ZodOptional<z.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
memory: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
21
|
+
region: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
22
|
+
cmh: "cmh";
|
|
23
|
+
dub: "dub";
|
|
24
|
+
fra: "fra";
|
|
25
|
+
gru: "gru";
|
|
26
|
+
iad: "iad";
|
|
27
|
+
lhr: "lhr";
|
|
28
|
+
nrt: "nrt";
|
|
29
|
+
pdx: "pdx";
|
|
30
|
+
sfo: "sfo";
|
|
31
|
+
sin: "sin";
|
|
32
|
+
syd: "syd";
|
|
33
|
+
yul: "yul";
|
|
31
34
|
}>>>;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
name?: string | undefined;
|
|
34
|
-
background?: boolean | undefined;
|
|
35
|
-
externalNodeModules?: string[] | undefined;
|
|
36
|
-
generator?: string | undefined;
|
|
37
|
-
includedFiles?: string[] | undefined;
|
|
38
|
-
includedFilesBasePath?: string | undefined;
|
|
39
|
-
ignoredNodeModules?: string[] | undefined;
|
|
40
|
-
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
41
|
-
nodeSourcemap?: boolean | undefined;
|
|
42
|
-
nodeVersion?: string | undefined;
|
|
43
|
-
memory?: number | undefined;
|
|
44
|
-
region?: FunctionRegion | undefined;
|
|
45
|
-
rustTargetDirectory?: string | undefined;
|
|
46
|
-
schedule?: string | undefined;
|
|
47
|
-
timeout?: number | undefined;
|
|
48
|
-
vcpu?: number | undefined;
|
|
49
|
-
zipGo?: boolean | undefined;
|
|
50
|
-
nodeModuleFormat?: "cjs" | "esm" | undefined;
|
|
51
|
-
}, {
|
|
52
|
-
name?: unknown;
|
|
53
|
-
background?: unknown;
|
|
54
|
-
externalNodeModules?: unknown;
|
|
55
|
-
generator?: unknown;
|
|
56
|
-
includedFiles?: unknown;
|
|
57
|
-
includedFilesBasePath?: unknown;
|
|
58
|
-
ignoredNodeModules?: unknown;
|
|
59
|
-
nodeBundler?: unknown;
|
|
60
|
-
nodeSourcemap?: unknown;
|
|
61
|
-
nodeVersion?: unknown;
|
|
62
|
-
memory?: unknown;
|
|
63
|
-
region?: unknown;
|
|
64
|
-
rustTargetDirectory?: unknown;
|
|
65
|
-
schedule?: unknown;
|
|
66
|
-
timeout?: unknown;
|
|
67
|
-
vcpu?: number | undefined;
|
|
68
|
-
zipGo?: unknown;
|
|
69
|
-
nodeModuleFormat?: unknown;
|
|
70
|
-
}>;
|
|
71
|
-
export declare const functionConfig: z.ZodEffects<z.ZodObject<{
|
|
72
|
-
background: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
73
|
-
externalNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
74
|
-
generator: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
75
|
-
includedFiles: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
76
|
-
includedFilesBasePath: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
77
|
-
ignoredNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
78
|
-
name: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
79
|
-
nodeBundler: z.ZodCatch<z.ZodOptional<z.ZodNativeEnum<{
|
|
80
|
-
readonly ESBUILD: "esbuild";
|
|
81
|
-
readonly ESBUILD_ZISI: "esbuild_zisi";
|
|
82
|
-
readonly NFT: "nft";
|
|
83
|
-
readonly ZISI: "zisi";
|
|
84
|
-
readonly NONE: "none";
|
|
85
|
-
}>>>;
|
|
86
|
-
nodeSourcemap: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
87
|
-
nodeVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
88
|
-
memory: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, unknown>>;
|
|
89
|
-
region: z.ZodOptional<z.ZodEffects<z.ZodEnum<[FunctionRegion, ...FunctionRegion[]]>, FunctionRegion, unknown>>;
|
|
90
35
|
rustTargetDirectory: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
91
36
|
schedule: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
92
37
|
timeout: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
93
38
|
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
94
39
|
zipGo: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
95
|
-
nodeModuleFormat: z.ZodCatch<z.ZodOptional<z.
|
|
40
|
+
nodeModuleFormat: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
96
41
|
readonly COMMONJS: "cjs";
|
|
97
42
|
readonly ESM: "esm";
|
|
98
43
|
}>>>;
|
|
99
|
-
},
|
|
100
|
-
name?: string | undefined;
|
|
101
|
-
background?: boolean | undefined;
|
|
102
|
-
externalNodeModules?: string[] | undefined;
|
|
103
|
-
generator?: string | undefined;
|
|
104
|
-
includedFiles?: string[] | undefined;
|
|
105
|
-
includedFilesBasePath?: string | undefined;
|
|
106
|
-
ignoredNodeModules?: string[] | undefined;
|
|
107
|
-
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
108
|
-
nodeSourcemap?: boolean | undefined;
|
|
109
|
-
nodeVersion?: string | undefined;
|
|
110
|
-
memory?: number | undefined;
|
|
111
|
-
region?: FunctionRegion | undefined;
|
|
112
|
-
rustTargetDirectory?: string | undefined;
|
|
113
|
-
schedule?: string | undefined;
|
|
114
|
-
timeout?: number | undefined;
|
|
115
|
-
vcpu?: number | undefined;
|
|
116
|
-
zipGo?: boolean | undefined;
|
|
117
|
-
nodeModuleFormat?: "cjs" | "esm" | undefined;
|
|
118
|
-
}, {
|
|
119
|
-
name?: unknown;
|
|
120
|
-
background?: unknown;
|
|
121
|
-
externalNodeModules?: unknown;
|
|
122
|
-
generator?: unknown;
|
|
123
|
-
includedFiles?: unknown;
|
|
124
|
-
includedFilesBasePath?: unknown;
|
|
125
|
-
ignoredNodeModules?: unknown;
|
|
126
|
-
nodeBundler?: unknown;
|
|
127
|
-
nodeSourcemap?: unknown;
|
|
128
|
-
nodeVersion?: unknown;
|
|
129
|
-
memory?: unknown;
|
|
130
|
-
region?: unknown;
|
|
131
|
-
rustTargetDirectory?: unknown;
|
|
132
|
-
schedule?: unknown;
|
|
133
|
-
timeout?: unknown;
|
|
134
|
-
vcpu?: number | undefined;
|
|
135
|
-
zipGo?: unknown;
|
|
136
|
-
nodeModuleFormat?: unknown;
|
|
137
|
-
}>, {
|
|
138
|
-
name?: string | undefined;
|
|
139
|
-
background?: boolean | undefined;
|
|
140
|
-
externalNodeModules?: string[] | undefined;
|
|
141
|
-
generator?: string | undefined;
|
|
142
|
-
includedFiles?: string[] | undefined;
|
|
143
|
-
includedFilesBasePath?: string | undefined;
|
|
144
|
-
ignoredNodeModules?: string[] | undefined;
|
|
145
|
-
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
146
|
-
nodeSourcemap?: boolean | undefined;
|
|
147
|
-
nodeVersion?: string | undefined;
|
|
148
|
-
memory?: number | undefined;
|
|
149
|
-
region?: FunctionRegion | undefined;
|
|
150
|
-
rustTargetDirectory?: string | undefined;
|
|
151
|
-
schedule?: string | undefined;
|
|
152
|
-
timeout?: number | undefined;
|
|
153
|
-
vcpu?: number | undefined;
|
|
154
|
-
zipGo?: boolean | undefined;
|
|
155
|
-
nodeModuleFormat?: "cjs" | "esm" | undefined;
|
|
156
|
-
}, {
|
|
157
|
-
name?: unknown;
|
|
158
|
-
background?: unknown;
|
|
159
|
-
externalNodeModules?: unknown;
|
|
160
|
-
generator?: unknown;
|
|
161
|
-
includedFiles?: unknown;
|
|
162
|
-
includedFilesBasePath?: unknown;
|
|
163
|
-
ignoredNodeModules?: unknown;
|
|
164
|
-
nodeBundler?: unknown;
|
|
165
|
-
nodeSourcemap?: unknown;
|
|
166
|
-
nodeVersion?: unknown;
|
|
167
|
-
memory?: unknown;
|
|
168
|
-
region?: unknown;
|
|
169
|
-
rustTargetDirectory?: unknown;
|
|
170
|
-
schedule?: unknown;
|
|
171
|
-
timeout?: unknown;
|
|
172
|
-
vcpu?: number | undefined;
|
|
173
|
-
zipGo?: unknown;
|
|
174
|
-
nodeModuleFormat?: unknown;
|
|
175
|
-
}>;
|
|
44
|
+
}, z.core.$strip>;
|
|
176
45
|
type FunctionConfig = z.infer<typeof functionConfigShape>;
|
|
177
46
|
type GlobPattern = string;
|
|
178
47
|
type Config = Record<GlobPattern, FunctionConfig>;
|
package/dist/config.js
CHANGED
|
@@ -66,11 +66,6 @@ export const functionConfigShape = z.object({
|
|
|
66
66
|
// we can remove this.
|
|
67
67
|
nodeModuleFormat: moduleFormat.optional().catch(undefined),
|
|
68
68
|
});
|
|
69
|
-
const refuseMemoryAndVcpu = (cfg) => !(cfg.memory !== undefined && cfg.vcpu !== undefined);
|
|
70
|
-
export const functionConfig = functionConfigShape.refine(refuseMemoryAndVcpu, {
|
|
71
|
-
message: '`memory` and `vcpu` cannot both be set.',
|
|
72
|
-
path: ['vcpu'],
|
|
73
|
-
});
|
|
74
69
|
const getConfigForFunction = async ({ config, configFileDirectories, func, }) => {
|
|
75
70
|
const fromConfig = getFromMainConfig({ config, func });
|
|
76
71
|
// We try to read from a function config file if the function directory is
|
package/dist/rate_limit.d.ts
CHANGED
|
@@ -18,29 +18,24 @@ export interface TrafficRules {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export declare const rateLimit: z.ZodObject<{
|
|
21
|
-
action: z.ZodOptional<z.ZodEnum<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
21
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
rate_limit: "rate_limit";
|
|
23
|
+
rewrite: "rewrite";
|
|
24
|
+
}>>;
|
|
25
|
+
aggregateBy: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
26
|
+
domain: "domain";
|
|
27
|
+
ip: "ip";
|
|
28
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
29
|
+
domain: "domain";
|
|
30
|
+
ip: "ip";
|
|
31
|
+
}>>]>>;
|
|
32
|
+
algorithm: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
sliding_window: "sliding_window";
|
|
34
|
+
}>>;
|
|
25
35
|
windowLimit: z.ZodNumber;
|
|
26
36
|
windowSize: z.ZodNumber;
|
|
27
|
-
} & {
|
|
28
37
|
to: z.ZodOptional<z.ZodString>;
|
|
29
|
-
},
|
|
30
|
-
windowLimit: number;
|
|
31
|
-
windowSize: number;
|
|
32
|
-
to?: string | undefined;
|
|
33
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
34
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
35
|
-
algorithm?: "sliding_window" | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
windowLimit: number;
|
|
38
|
-
windowSize: number;
|
|
39
|
-
to?: string | undefined;
|
|
40
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
41
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
42
|
-
algorithm?: "sliding_window" | undefined;
|
|
43
|
-
}>;
|
|
38
|
+
}, z.core.$strip>;
|
|
44
39
|
type RateLimit = z.infer<typeof rateLimit>;
|
|
45
40
|
/**
|
|
46
41
|
* Takes a rate limiting configuration object and returns a traffic rules
|
package/dist/rate_limit.js
CHANGED
|
@@ -15,25 +15,25 @@ export const rateLimit = z
|
|
|
15
15
|
aggregateBy: rateLimitAggregator.or(z.array(rateLimitAggregator)).optional(),
|
|
16
16
|
algorithm: rateLimitAlgorithm.optional(),
|
|
17
17
|
})
|
|
18
|
-
.
|
|
19
|
-
.
|
|
18
|
+
.extend(slidingWindow.shape)
|
|
19
|
+
.extend(rewriteActionConfig.partial().shape);
|
|
20
20
|
/**
|
|
21
21
|
* Takes a rate limiting configuration object and returns a traffic rules
|
|
22
22
|
* object that is added to the manifest.
|
|
23
23
|
*/
|
|
24
24
|
export const getTrafficRulesConfig = (input) => {
|
|
25
25
|
const { windowSize, windowLimit, algorithm, aggregateBy, action, to } = input;
|
|
26
|
-
const rateLimitAgg = Array.isArray(aggregateBy) ? aggregateBy : [rateLimitAggregator.
|
|
26
|
+
const rateLimitAgg = Array.isArray(aggregateBy) ? aggregateBy : [rateLimitAggregator.enum.domain];
|
|
27
27
|
const rewriteConfig = to ? { to: input.to } : undefined;
|
|
28
28
|
return {
|
|
29
29
|
action: {
|
|
30
|
-
type: action || rateLimitAction.
|
|
30
|
+
type: action || rateLimitAction.enum.rate_limit,
|
|
31
31
|
config: {
|
|
32
32
|
...rewriteConfig,
|
|
33
33
|
rateLimitConfig: {
|
|
34
34
|
windowLimit,
|
|
35
35
|
windowSize,
|
|
36
|
-
algorithm: algorithm || rateLimitAlgorithm.
|
|
36
|
+
algorithm: algorithm || rateLimitAlgorithm.enum.sliding_window,
|
|
37
37
|
},
|
|
38
38
|
aggregate: {
|
|
39
39
|
keys: rateLimitAgg.map((agg) => ({ type: agg })),
|
|
@@ -14,7 +14,7 @@ export declare const NODE_BUNDLER: {
|
|
|
14
14
|
readonly ZISI: "zisi";
|
|
15
15
|
readonly NONE: "none";
|
|
16
16
|
};
|
|
17
|
-
export declare const nodeBundler: z.
|
|
17
|
+
export declare const nodeBundler: z.ZodEnum<{
|
|
18
18
|
readonly ESBUILD: "esbuild";
|
|
19
19
|
readonly ESBUILD_ZISI: "esbuild_zisi";
|
|
20
20
|
readonly NFT: "nft";
|
|
@@ -6,7 +6,7 @@ export const NODE_BUNDLER = {
|
|
|
6
6
|
ZISI: 'zisi',
|
|
7
7
|
NONE: 'none',
|
|
8
8
|
};
|
|
9
|
-
export const nodeBundler = z.
|
|
9
|
+
export const nodeBundler = z.enum(NODE_BUNDLER);
|
|
10
10
|
/* Why a bundler was used to bundle a given function */
|
|
11
11
|
export const BUNDLER_REASON = {
|
|
12
12
|
ConfigOverride: 'config-override', // explicit `config.nodeBundler`
|
|
@@ -17,158 +17,79 @@ export interface StaticAnalysisResult {
|
|
|
17
17
|
interface FindISCDeclarationsOptions {
|
|
18
18
|
functionName: string;
|
|
19
19
|
}
|
|
20
|
-
declare const
|
|
21
|
-
|
|
22
|
-
export type HttpMethod = z.infer<typeof httpMethod>;
|
|
23
|
-
export type HttpMethods = z.infer<typeof httpMethods>;
|
|
24
|
-
export declare const inSourceConfig: z.ZodEffects<z.ZodObject<Pick<{
|
|
20
|
+
export declare const inSourceConfig: z.ZodObject<{
|
|
21
|
+
name: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
25
22
|
background: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
26
|
-
externalNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString
|
|
23
|
+
externalNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
27
24
|
generator: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
28
|
-
includedFiles: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
name: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
32
|
-
nodeBundler: z.ZodCatch<z.ZodOptional<z.ZodNativeEnum<{
|
|
25
|
+
includedFiles: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
26
|
+
ignoredNodeModules: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
27
|
+
nodeBundler: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
33
28
|
readonly ESBUILD: "esbuild";
|
|
34
29
|
readonly ESBUILD_ZISI: "esbuild_zisi";
|
|
35
30
|
readonly NFT: "nft";
|
|
36
31
|
readonly ZISI: "zisi";
|
|
37
32
|
readonly NONE: "none";
|
|
38
33
|
}>>>;
|
|
39
|
-
nodeSourcemap: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
40
34
|
nodeVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
41
|
-
memory: z.ZodOptional<z.
|
|
42
|
-
region: z.ZodOptional<z.
|
|
43
|
-
|
|
35
|
+
memory: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
36
|
+
region: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
37
|
+
cmh: "cmh";
|
|
38
|
+
dub: "dub";
|
|
39
|
+
fra: "fra";
|
|
40
|
+
gru: "gru";
|
|
41
|
+
iad: "iad";
|
|
42
|
+
lhr: "lhr";
|
|
43
|
+
nrt: "nrt";
|
|
44
|
+
pdx: "pdx";
|
|
45
|
+
sfo: "sfo";
|
|
46
|
+
sin: "sin";
|
|
47
|
+
syd: "syd";
|
|
48
|
+
yul: "yul";
|
|
49
|
+
}>>>;
|
|
44
50
|
schedule: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
45
51
|
timeout: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
46
52
|
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
method: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodEnum<{
|
|
54
|
+
GET: "GET";
|
|
55
|
+
POST: "POST";
|
|
56
|
+
PUT: "PUT";
|
|
57
|
+
PATCH: "PATCH";
|
|
58
|
+
OPTIONS: "OPTIONS";
|
|
59
|
+
DELETE: "DELETE";
|
|
60
|
+
HEAD: "HEAD";
|
|
61
|
+
}>>, z.ZodArray<z.ZodPreprocess<z.ZodEnum<{
|
|
62
|
+
GET: "GET";
|
|
63
|
+
POST: "POST";
|
|
64
|
+
PUT: "PUT";
|
|
65
|
+
PATCH: "PATCH";
|
|
66
|
+
OPTIONS: "OPTIONS";
|
|
67
|
+
DELETE: "DELETE";
|
|
68
|
+
HEAD: "HEAD";
|
|
69
|
+
}>>>]>, z.ZodTransform<("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[], "GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD" | ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[]>>>;
|
|
70
|
+
path: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
|
|
71
|
+
excludedPath: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
|
|
56
72
|
preferStatic: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
57
73
|
rateLimit: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
58
|
-
action: z.ZodOptional<z.ZodEnum<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
rate_limit: "rate_limit";
|
|
76
|
+
rewrite: "rewrite";
|
|
77
|
+
}>>;
|
|
78
|
+
aggregateBy: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
79
|
+
domain: "domain";
|
|
80
|
+
ip: "ip";
|
|
81
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
82
|
+
domain: "domain";
|
|
83
|
+
ip: "ip";
|
|
84
|
+
}>>]>>;
|
|
85
|
+
algorithm: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
sliding_window: "sliding_window";
|
|
87
|
+
}>>;
|
|
62
88
|
windowLimit: z.ZodNumber;
|
|
63
89
|
windowSize: z.ZodNumber;
|
|
64
|
-
} & {
|
|
65
90
|
to: z.ZodOptional<z.ZodString>;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
windowSize: number;
|
|
69
|
-
to?: string | undefined;
|
|
70
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
71
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
72
|
-
algorithm?: "sliding_window" | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
windowLimit: number;
|
|
75
|
-
windowSize: number;
|
|
76
|
-
to?: string | undefined;
|
|
77
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
78
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
79
|
-
algorithm?: "sliding_window" | undefined;
|
|
80
|
-
}>>>;
|
|
81
|
-
}, "strip", z.ZodTypeAny, {
|
|
82
|
-
name?: string | undefined;
|
|
83
|
-
path?: string[] | undefined;
|
|
84
|
-
background?: boolean | undefined;
|
|
85
|
-
externalNodeModules?: string[] | undefined;
|
|
86
|
-
generator?: string | undefined;
|
|
87
|
-
includedFiles?: string[] | undefined;
|
|
88
|
-
ignoredNodeModules?: string[] | undefined;
|
|
89
|
-
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
90
|
-
nodeVersion?: string | undefined;
|
|
91
|
-
memory?: number | undefined;
|
|
92
|
-
region?: import("@netlify/types").FunctionRegion | undefined;
|
|
93
|
-
schedule?: string | undefined;
|
|
94
|
-
timeout?: number | undefined;
|
|
95
|
-
vcpu?: number | undefined;
|
|
96
|
-
method?: ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[] | undefined;
|
|
97
|
-
excludedPath?: string[] | undefined;
|
|
98
|
-
preferStatic?: boolean | undefined;
|
|
99
|
-
rateLimit?: {
|
|
100
|
-
windowLimit: number;
|
|
101
|
-
windowSize: number;
|
|
102
|
-
to?: string | undefined;
|
|
103
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
104
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
105
|
-
algorithm?: "sliding_window" | undefined;
|
|
106
|
-
} | undefined;
|
|
107
|
-
}, {
|
|
108
|
-
name?: unknown;
|
|
109
|
-
path?: string | string[] | undefined;
|
|
110
|
-
background?: unknown;
|
|
111
|
-
externalNodeModules?: unknown;
|
|
112
|
-
generator?: unknown;
|
|
113
|
-
includedFiles?: unknown;
|
|
114
|
-
ignoredNodeModules?: unknown;
|
|
115
|
-
nodeBundler?: unknown;
|
|
116
|
-
nodeVersion?: unknown;
|
|
117
|
-
memory?: unknown;
|
|
118
|
-
region?: unknown;
|
|
119
|
-
schedule?: unknown;
|
|
120
|
-
timeout?: unknown;
|
|
121
|
-
vcpu?: number | undefined;
|
|
122
|
-
method?: unknown;
|
|
123
|
-
excludedPath?: string | string[] | undefined;
|
|
124
|
-
preferStatic?: unknown;
|
|
125
|
-
rateLimit?: unknown;
|
|
126
|
-
}>, {
|
|
127
|
-
name?: string | undefined;
|
|
128
|
-
path?: string[] | undefined;
|
|
129
|
-
background?: boolean | undefined;
|
|
130
|
-
externalNodeModules?: string[] | undefined;
|
|
131
|
-
generator?: string | undefined;
|
|
132
|
-
includedFiles?: string[] | undefined;
|
|
133
|
-
ignoredNodeModules?: string[] | undefined;
|
|
134
|
-
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
135
|
-
nodeVersion?: string | undefined;
|
|
136
|
-
memory?: number | undefined;
|
|
137
|
-
region?: import("@netlify/types").FunctionRegion | undefined;
|
|
138
|
-
schedule?: string | undefined;
|
|
139
|
-
timeout?: number | undefined;
|
|
140
|
-
vcpu?: number | undefined;
|
|
141
|
-
method?: ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[] | undefined;
|
|
142
|
-
excludedPath?: string[] | undefined;
|
|
143
|
-
preferStatic?: boolean | undefined;
|
|
144
|
-
rateLimit?: {
|
|
145
|
-
windowLimit: number;
|
|
146
|
-
windowSize: number;
|
|
147
|
-
to?: string | undefined;
|
|
148
|
-
action?: "rate_limit" | "rewrite" | undefined;
|
|
149
|
-
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
150
|
-
algorithm?: "sliding_window" | undefined;
|
|
151
|
-
} | undefined;
|
|
152
|
-
}, {
|
|
153
|
-
name?: unknown;
|
|
154
|
-
path?: string | string[] | undefined;
|
|
155
|
-
background?: unknown;
|
|
156
|
-
externalNodeModules?: unknown;
|
|
157
|
-
generator?: unknown;
|
|
158
|
-
includedFiles?: unknown;
|
|
159
|
-
ignoredNodeModules?: unknown;
|
|
160
|
-
nodeBundler?: unknown;
|
|
161
|
-
nodeVersion?: unknown;
|
|
162
|
-
memory?: unknown;
|
|
163
|
-
region?: unknown;
|
|
164
|
-
schedule?: unknown;
|
|
165
|
-
timeout?: unknown;
|
|
166
|
-
vcpu?: number | undefined;
|
|
167
|
-
method?: unknown;
|
|
168
|
-
excludedPath?: string | string[] | undefined;
|
|
169
|
-
preferStatic?: unknown;
|
|
170
|
-
rateLimit?: unknown;
|
|
171
|
-
}>;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
172
93
|
export type InSourceConfig = z.infer<typeof inSourceConfig>;
|
|
173
94
|
/**
|
|
174
95
|
* Loads a file at a given path, parses it into an AST, and returns a series of
|
|
@@ -182,18 +103,18 @@ export declare const parseFile: (sourcePath: string, { functionName }: FindISCDe
|
|
|
182
103
|
*/
|
|
183
104
|
export declare const parseSource: (source: string, { functionName }: FindISCDeclarationsOptions) => StaticAnalysisResult;
|
|
184
105
|
export declare const augmentFunctionConfig: (mainFile: string, tomlConfig: FunctionConfig, inSourceConfig?: InSourceConfig) => {
|
|
185
|
-
name?: string | undefined;
|
|
186
106
|
background?: boolean | undefined;
|
|
187
107
|
externalNodeModules?: string[] | undefined;
|
|
188
108
|
generator?: string | undefined;
|
|
189
109
|
includedFiles?: string[] | undefined;
|
|
190
110
|
includedFilesBasePath?: string | undefined;
|
|
191
111
|
ignoredNodeModules?: string[] | undefined;
|
|
112
|
+
name?: string | undefined;
|
|
192
113
|
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
193
114
|
nodeSourcemap?: boolean | undefined;
|
|
194
115
|
nodeVersion?: string | undefined;
|
|
195
116
|
memory?: number | undefined;
|
|
196
|
-
region?:
|
|
117
|
+
region?: "cmh" | "dub" | "fra" | "gru" | "iad" | "lhr" | "nrt" | "pdx" | "sfo" | "sin" | "syd" | "yul" | undefined;
|
|
197
118
|
rustTargetDirectory?: string | undefined;
|
|
198
119
|
schedule?: string | undefined;
|
|
199
120
|
timeout?: number | undefined;
|
|
@@ -202,7 +123,6 @@ export declare const augmentFunctionConfig: (mainFile: string, tomlConfig: Funct
|
|
|
202
123
|
nodeModuleFormat?: "cjs" | "esm" | undefined;
|
|
203
124
|
} & {
|
|
204
125
|
name?: string | undefined;
|
|
205
|
-
path?: string[] | undefined;
|
|
206
126
|
background?: boolean | undefined;
|
|
207
127
|
externalNodeModules?: string[] | undefined;
|
|
208
128
|
generator?: string | undefined;
|
|
@@ -211,20 +131,21 @@ export declare const augmentFunctionConfig: (mainFile: string, tomlConfig: Funct
|
|
|
211
131
|
nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
|
|
212
132
|
nodeVersion?: string | undefined;
|
|
213
133
|
memory?: number | undefined;
|
|
214
|
-
region?:
|
|
134
|
+
region?: "cmh" | "dub" | "fra" | "gru" | "iad" | "lhr" | "nrt" | "pdx" | "sfo" | "sin" | "syd" | "yul" | undefined;
|
|
215
135
|
schedule?: string | undefined;
|
|
216
136
|
timeout?: number | undefined;
|
|
217
137
|
vcpu?: number | undefined;
|
|
218
138
|
method?: ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[] | undefined;
|
|
139
|
+
path?: string[] | undefined;
|
|
219
140
|
excludedPath?: string[] | undefined;
|
|
220
141
|
preferStatic?: boolean | undefined;
|
|
221
142
|
rateLimit?: {
|
|
222
143
|
windowLimit: number;
|
|
223
144
|
windowSize: number;
|
|
224
|
-
to?: string | undefined;
|
|
225
145
|
action?: "rate_limit" | "rewrite" | undefined;
|
|
226
146
|
aggregateBy?: "domain" | "ip" | ("domain" | "ip")[] | undefined;
|
|
227
147
|
algorithm?: "sliding_window" | undefined;
|
|
148
|
+
to?: string | undefined;
|
|
228
149
|
} | undefined;
|
|
229
150
|
};
|
|
230
151
|
export type ISCHandlerArg = ArgumentPlaceholder | Expression | SpreadElement | JSXNamespacedName;
|
|
@@ -39,16 +39,16 @@ export const inSourceConfig = functionConfigShape
|
|
|
39
39
|
.extend({
|
|
40
40
|
method: z
|
|
41
41
|
.union([httpMethods, z.array(httpMethods)], {
|
|
42
|
-
|
|
42
|
+
error: () => ({ message: 'Must be a string or array of strings' }),
|
|
43
43
|
})
|
|
44
44
|
.transform(ensureArray)
|
|
45
45
|
.optional(),
|
|
46
46
|
path: z
|
|
47
|
-
.union([path, z.array(path)], {
|
|
47
|
+
.union([path, z.array(path)], { error: () => ({ message: 'Must be a string or array of strings' }) })
|
|
48
48
|
.transform(ensureArray)
|
|
49
49
|
.optional(),
|
|
50
50
|
excludedPath: z
|
|
51
|
-
.union([path, z.array(path)], {
|
|
51
|
+
.union([path, z.array(path)], { error: () => ({ message: 'Must be a string or array of strings' }) })
|
|
52
52
|
.transform(ensureArray)
|
|
53
53
|
.optional(),
|
|
54
54
|
preferStatic: z.boolean().optional().catch(undefined),
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import type { Program } from '@babel/types';
|
|
2
|
-
export declare const parseExpression: ({ basePath, expression: rawExpression, resolveDir, }: {
|
|
3
|
-
basePath: string;
|
|
4
|
-
expression: string;
|
|
5
|
-
resolveDir: string;
|
|
6
|
-
}) => {
|
|
7
|
-
includedPathsGlob: string | null | undefined;
|
|
8
|
-
type: string;
|
|
9
|
-
} | undefined;
|
|
10
2
|
export declare const safelyParseSource: (source: string) => Program | null;
|
|
11
3
|
export declare const safelyReadSource: (path: string) => Promise<string | null>;
|
|
@@ -1,76 +1,5 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
|
-
import { join, relative, resolve } from 'path';
|
|
3
2
|
import { parse } from '@babel/parser';
|
|
4
|
-
import { nonNullable } from '../../../utils/non_nullable.js';
|
|
5
|
-
const GLOB_WILDCARD = '**';
|
|
6
|
-
// Transforms an array of glob nodes into a glob string including an absolute
|
|
7
|
-
// path.
|
|
8
|
-
//
|
|
9
|
-
// Example: ["./files/", "*", ".json"] => "/home/ntl/files/*.json"
|
|
10
|
-
const getAbsoluteGlob = ({ basePath, globNodes, resolveDir, }) => {
|
|
11
|
-
if (!validateGlobNodes(globNodes)) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const globStarIndex = globNodes.indexOf(GLOB_WILDCARD);
|
|
15
|
-
const [staticPath, dynamicPath] = globStarIndex === -1
|
|
16
|
-
? [globNodes.join(''), '']
|
|
17
|
-
: [globNodes.slice(0, globStarIndex).join(''), globNodes.slice(globStarIndex).join('')];
|
|
18
|
-
const absoluteStaticPath = resolve(resolveDir, staticPath);
|
|
19
|
-
const relativeStaticPath = relative(basePath, absoluteStaticPath);
|
|
20
|
-
const absoluteGlob = join(relativeStaticPath, dynamicPath);
|
|
21
|
-
return absoluteGlob;
|
|
22
|
-
};
|
|
23
|
-
// Returns GLOB_WILDCARD for AST nodes that are accepted as part of a dynamic
|
|
24
|
-
// expression and convertable to a wildcard character. This determines whether
|
|
25
|
-
// we convert an expression or leave it alone. For example:
|
|
26
|
-
//
|
|
27
|
-
// - `./files/${someVariable}`: Convert `someVariable` to GLOB_WILDCARD
|
|
28
|
-
// - `./files/${[some, array]}`: Don't convert expression
|
|
29
|
-
//
|
|
30
|
-
// The following AST nodes are converted to a wildcard:
|
|
31
|
-
//
|
|
32
|
-
// - CallExpression: `someFunction()`
|
|
33
|
-
// - ConditionalExpression: `someCond ? someValue : otherValue`
|
|
34
|
-
// - Identifier: `someVariable`
|
|
35
|
-
// - MemberExpression: `someArray[index]` or `someObject.property`
|
|
36
|
-
const getWildcardFromASTNode = (node) => {
|
|
37
|
-
switch (node.type) {
|
|
38
|
-
case 'CallExpression':
|
|
39
|
-
case 'ConditionalExpression':
|
|
40
|
-
case 'Identifier':
|
|
41
|
-
case 'MemberExpression':
|
|
42
|
-
return GLOB_WILDCARD;
|
|
43
|
-
default:
|
|
44
|
-
throw new Error('Expression member not supported');
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
// Tries to parse an expression, returning an object with:
|
|
48
|
-
// - `includedPathsGlob`: A glob with the files to be included in the bundle
|
|
49
|
-
// - `type`: The expression type (e.g. "require", "import")
|
|
50
|
-
export const parseExpression = ({ basePath, expression: rawExpression, resolveDir, }) => {
|
|
51
|
-
const { program } = parse(rawExpression, {
|
|
52
|
-
sourceType: 'module',
|
|
53
|
-
});
|
|
54
|
-
const [statement] = program.body;
|
|
55
|
-
if (statement.type !== 'ExpressionStatement') {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const { expression } = statement;
|
|
59
|
-
if (expression.type === 'CallExpression' &&
|
|
60
|
-
expression.callee.type === 'Identifier' &&
|
|
61
|
-
expression.callee.name === 'require') {
|
|
62
|
-
try {
|
|
63
|
-
const includedPathsGlob = parseRequire({ basePath, expression, resolveDir });
|
|
64
|
-
return {
|
|
65
|
-
includedPathsGlob,
|
|
66
|
-
type: expression.callee.name,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// no-op
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
3
|
// Parses a JS/TS source and returns the resulting AST.
|
|
75
4
|
const parseSource = (source) => {
|
|
76
5
|
const ast = parse(source, {
|
|
@@ -107,74 +36,3 @@ export const safelyReadSource = async (path) => {
|
|
|
107
36
|
return null;
|
|
108
37
|
}
|
|
109
38
|
};
|
|
110
|
-
// Parses a `require()` and returns a glob string with an absolute path.
|
|
111
|
-
const parseRequire = ({ basePath, expression, resolveDir, }) => {
|
|
112
|
-
const { arguments: args = [] } = expression;
|
|
113
|
-
const [firstArg] = args;
|
|
114
|
-
if (firstArg === undefined) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (firstArg.type === 'BinaryExpression') {
|
|
118
|
-
try {
|
|
119
|
-
const globNodes = parseBinaryExpression(firstArg);
|
|
120
|
-
return getAbsoluteGlob({ basePath, globNodes, resolveDir });
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
// no-op
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (firstArg.type === 'TemplateLiteral') {
|
|
127
|
-
const globNodes = parseTemplateLiteral(firstArg);
|
|
128
|
-
return getAbsoluteGlob({ basePath, globNodes, resolveDir });
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
// Transforms a binary expression AST node into an array of glob nodes, where
|
|
132
|
-
// static parts will be left untouched and identifiers will be replaced by
|
|
133
|
-
// `GLOB_WILDCARD`.
|
|
134
|
-
//
|
|
135
|
-
// Example: './files/' + lang + '.json' => ["./files/", "**", ".json"]
|
|
136
|
-
const parseBinaryExpression = (expression) => {
|
|
137
|
-
const { left, operator, right } = expression;
|
|
138
|
-
if (operator !== '+') {
|
|
139
|
-
throw new Error('Expression operator not supported');
|
|
140
|
-
}
|
|
141
|
-
const operands = [left, right].flatMap((operand) => {
|
|
142
|
-
switch (operand.type) {
|
|
143
|
-
case 'BinaryExpression':
|
|
144
|
-
return parseBinaryExpression(operand);
|
|
145
|
-
case 'StringLiteral':
|
|
146
|
-
return operand.value;
|
|
147
|
-
default:
|
|
148
|
-
return getWildcardFromASTNode(operand);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
return operands;
|
|
152
|
-
};
|
|
153
|
-
// Transforms a template literal AST node into an array of glob nodes, where
|
|
154
|
-
// static parts will be left untouched and identifiers will be replaced by
|
|
155
|
-
// `GLOB_WILDCARD`.
|
|
156
|
-
//
|
|
157
|
-
// Example: `./files/${lang}.json` => ["./files/", "**", ".json"]
|
|
158
|
-
const parseTemplateLiteral = (expression) => {
|
|
159
|
-
const { expressions, quasis } = expression;
|
|
160
|
-
const parts = [...expressions, ...quasis].sort((partA, partB) => (partA.start ?? 0) - (partB.start ?? 0));
|
|
161
|
-
const globNodes = parts.map((part) => {
|
|
162
|
-
switch (part.type) {
|
|
163
|
-
case 'TemplateElement':
|
|
164
|
-
return part.value.cooked === '' ? null : part.value.cooked;
|
|
165
|
-
default:
|
|
166
|
-
return getWildcardFromASTNode(part);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return globNodes.filter(nonNullable);
|
|
170
|
-
};
|
|
171
|
-
// For our purposes, we consider a glob to be valid if all the nodes are
|
|
172
|
-
// strings and the first node is static (i.e. not a wildcard character).
|
|
173
|
-
const validateGlobNodes = (globNodes) => {
|
|
174
|
-
if (!globNodes) {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
const hasStrings = globNodes.every((node) => typeof node === 'string');
|
|
178
|
-
const hasStaticHead = globNodes[0] !== GLOB_WILDCARD;
|
|
179
|
-
return hasStrings && hasStaticHead;
|
|
180
|
-
};
|
|
@@ -2,7 +2,6 @@ import type { FeatureFlags } from '../../../feature_flags.js';
|
|
|
2
2
|
import { ModuleFormat } from './module_format.js';
|
|
3
3
|
export declare const ENTRY_FILE_NAME = "___netlify-entry-point";
|
|
4
4
|
export declare const BOOTSTRAP_FILE_NAME = "___netlify-bootstrap.mjs";
|
|
5
|
-
export declare const BOOTSTRAP_VERSION_FILE_NAME = "___netlify-bootstrap-version";
|
|
6
5
|
export declare const METADATA_FILE_NAME = "___netlify-metadata.json";
|
|
7
6
|
export declare const TELEMETRY_FILE_NAME = "___netlify-telemetry.mjs";
|
|
8
7
|
export interface EntryFile {
|
|
@@ -7,7 +7,6 @@ import { getFileExtensionForFormat, MODULE_FILE_EXTENSION, MODULE_FORMAT, } from
|
|
|
7
7
|
import { normalizeFilePath } from './normalize_path.js';
|
|
8
8
|
export const ENTRY_FILE_NAME = '___netlify-entry-point';
|
|
9
9
|
export const BOOTSTRAP_FILE_NAME = '___netlify-bootstrap.mjs';
|
|
10
|
-
export const BOOTSTRAP_VERSION_FILE_NAME = '___netlify-bootstrap-version';
|
|
11
10
|
export const METADATA_FILE_NAME = '___netlify-metadata.json';
|
|
12
11
|
export const TELEMETRY_FILE_NAME = '___netlify-telemetry.mjs';
|
|
13
12
|
const require = createRequire(import.meta.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "15.3.
|
|
3
|
+
"version": "15.3.3",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -73,13 +73,12 @@
|
|
|
73
73
|
"unixify": "^1.0.0",
|
|
74
74
|
"urlpattern-polyfill": "8.0.2",
|
|
75
75
|
"yargs": "^17.0.0",
|
|
76
|
-
"zod": "^
|
|
76
|
+
"zod": "^4.0.5"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@netlify/types": "2.7.0",
|
|
80
80
|
"@opentelemetry/sdk-trace-base": "~1.24.0",
|
|
81
81
|
"@types/archiver": "8.0.0",
|
|
82
|
-
"@types/is-ci": "3.0.4",
|
|
83
82
|
"@types/node": "^22.12.0",
|
|
84
83
|
"@types/normalize-path": "3.0.2",
|
|
85
84
|
"@types/resolve": "1.20.6",
|
|
@@ -96,11 +95,10 @@
|
|
|
96
95
|
"is-ci": "4.1.0",
|
|
97
96
|
"lambda-local": "2.2.0",
|
|
98
97
|
"source-map-support": "0.5.21",
|
|
99
|
-
"typescript": "5.9.3",
|
|
100
98
|
"vitest": "^3.0.0"
|
|
101
99
|
},
|
|
102
100
|
"engines": {
|
|
103
101
|
"node": ">=22.12.0"
|
|
104
102
|
},
|
|
105
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "599e9a8d17fed6cc6e95eea728896f59102217c5"
|
|
106
104
|
}
|
package/dist/utils/timer.d.ts
DELETED
package/dist/utils/timer.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { hrtime } from 'process';
|
|
2
|
-
const NANOSECS_TO_SECS = 1e9;
|
|
3
|
-
export const startTimer = function () {
|
|
4
|
-
return hrtime();
|
|
5
|
-
};
|
|
6
|
-
// returns the time in nanoseconds
|
|
7
|
-
export const endTimer = function ([startSecs, startNsecs]) {
|
|
8
|
-
const [endSecs, endNsecs] = hrtime();
|
|
9
|
-
const durationNs = (endSecs - startSecs) * NANOSECS_TO_SECS + endNsecs - startNsecs;
|
|
10
|
-
return durationNs;
|
|
11
|
-
};
|