@netlify/zip-it-and-ship-it 12.1.4 → 12.2.0-experimental

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/bin.js CHANGED
File without changes
package/dist/config.d.ts CHANGED
@@ -18,6 +18,7 @@ export declare const functionConfig: z.ZodObject<{
18
18
  nodeVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
19
19
  rustTargetDirectory: z.ZodCatch<z.ZodOptional<z.ZodString>>;
20
20
  schedule: z.ZodCatch<z.ZodOptional<z.ZodString>>;
21
+ scopedToFunctionDirectory: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
21
22
  timeout: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
22
23
  zipGo: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
23
24
  nodeModuleFormat: z.ZodCatch<z.ZodOptional<z.ZodNativeEnum<{
@@ -36,6 +37,7 @@ export declare const functionConfig: z.ZodObject<{
36
37
  nodeVersion?: string | undefined;
37
38
  rustTargetDirectory?: string | undefined;
38
39
  schedule?: string | undefined;
40
+ scopedToFunctionDirectory?: boolean | undefined;
39
41
  timeout?: number | undefined;
40
42
  zipGo?: boolean | undefined;
41
43
  nodeModuleFormat?: "cjs" | "esm" | undefined;
@@ -51,6 +53,7 @@ export declare const functionConfig: z.ZodObject<{
51
53
  nodeVersion?: unknown;
52
54
  rustTargetDirectory?: unknown;
53
55
  schedule?: unknown;
56
+ scopedToFunctionDirectory?: unknown;
54
57
  timeout?: unknown;
55
58
  zipGo?: unknown;
56
59
  nodeModuleFormat?: unknown;
package/dist/config.js CHANGED
@@ -20,6 +20,7 @@ export const functionConfig = z.object({
20
20
  nodeVersion: z.string().optional().catch(undefined),
21
21
  rustTargetDirectory: z.string().optional().catch(undefined),
22
22
  schedule: z.string().optional().catch(undefined),
23
+ scopedToFunctionDirectory: z.boolean().optional().catch(false),
23
24
  timeout: z.number().optional().catch(undefined),
24
25
  zipGo: z.boolean().optional().catch(undefined),
25
26
  // Temporary configuration property, only meant to be used by the deploy
@@ -20,7 +20,6 @@ export const getNativeModulesPlugin = (externalizedModules) => ({
20
20
  if (!pkg)
21
21
  return;
22
22
  let directory = args.resolveDir;
23
- // eslint-disable-next-line no-constant-condition
24
23
  while (true) {
25
24
  if (path.basename(directory) !== 'node_modules') {
26
25
  const modulePath = path.join(directory, 'node_modules', pkg[1]);
@@ -38,13 +38,14 @@ export declare const inSourceConfig: z.ZodObject<Pick<{
38
38
  nodeVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
39
39
  rustTargetDirectory: z.ZodCatch<z.ZodOptional<z.ZodString>>;
40
40
  schedule: z.ZodCatch<z.ZodOptional<z.ZodString>>;
41
+ scopedToFunctionDirectory: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
41
42
  timeout: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
42
43
  zipGo: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
43
44
  nodeModuleFormat: z.ZodCatch<z.ZodOptional<z.ZodNativeEnum<{
44
45
  readonly COMMONJS: "cjs";
45
46
  readonly ESM: "esm";
46
47
  }>>>;
47
- }, "name" | "externalNodeModules" | "generator" | "includedFiles" | "ignoredNodeModules" | "nodeBundler" | "nodeVersion" | "schedule" | "timeout"> & {
48
+ }, "name" | "externalNodeModules" | "generator" | "includedFiles" | "ignoredNodeModules" | "nodeBundler" | "nodeVersion" | "schedule" | "scopedToFunctionDirectory" | "timeout"> & {
48
49
  method: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "OPTIONS", "DELETE", "HEAD"]>, "GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD", unknown>, z.ZodArray<z.ZodEffects<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "OPTIONS", "DELETE", "HEAD"]>, "GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD", unknown>, "many">]>, ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[], unknown>>;
49
50
  path: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, string[], string | string[]>>;
50
51
  excludedPath: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, string[], string | string[]>>;
@@ -83,6 +84,7 @@ export declare const inSourceConfig: z.ZodObject<Pick<{
83
84
  nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
84
85
  nodeVersion?: string | undefined;
85
86
  schedule?: string | undefined;
87
+ scopedToFunctionDirectory?: boolean | undefined;
86
88
  timeout?: number | undefined;
87
89
  method?: ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[] | undefined;
88
90
  excludedPath?: string[] | undefined;
@@ -105,6 +107,7 @@ export declare const inSourceConfig: z.ZodObject<Pick<{
105
107
  nodeBundler?: unknown;
106
108
  nodeVersion?: unknown;
107
109
  schedule?: unknown;
110
+ scopedToFunctionDirectory?: unknown;
108
111
  timeout?: unknown;
109
112
  method?: unknown;
110
113
  excludedPath?: string | string[] | undefined;
@@ -135,6 +138,7 @@ export declare const augmentFunctionConfig: (mainFile: string, tomlConfig: Funct
135
138
  nodeVersion?: string | undefined;
136
139
  rustTargetDirectory?: string | undefined;
137
140
  schedule?: string | undefined;
141
+ scopedToFunctionDirectory?: boolean | undefined;
138
142
  timeout?: number | undefined;
139
143
  zipGo?: boolean | undefined;
140
144
  nodeModuleFormat?: "cjs" | "esm" | undefined;
@@ -148,6 +152,7 @@ export declare const augmentFunctionConfig: (mainFile: string, tomlConfig: Funct
148
152
  nodeBundler?: "none" | "esbuild" | "esbuild_zisi" | "nft" | "zisi" | undefined;
149
153
  nodeVersion?: string | undefined;
150
154
  schedule?: string | undefined;
155
+ scopedToFunctionDirectory?: boolean | undefined;
151
156
  timeout?: number | undefined;
152
157
  method?: ("GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD")[] | undefined;
153
158
  excludedPath?: string[] | undefined;
@@ -29,6 +29,7 @@ export const inSourceConfig = functionConfig
29
29
  nodeBundler: true,
30
30
  nodeVersion: true,
31
31
  schedule: true,
32
+ scopedToFunctionDirectory: true,
32
33
  timeout: true,
33
34
  })
34
35
  .extend({
@@ -48,6 +48,7 @@ const zipFunction = async function ({ archiveFormat, basePath, branch, cache, co
48
48
  runtimeAPIVersion,
49
49
  });
50
50
  const bundler = getBundler(bundlerName);
51
+ const functionBasePath = mergedConfig.scopedToFunctionDirectory && srcDir === srcPath ? srcDir : repositoryRoot;
51
52
  const { aliases = new Map(), cleanupFunction, basePath: finalBasePath, bundlerWarnings, includedFiles, inputs, mainFile: finalMainFile = mainFile, moduleFormat, nativeNodeModules, rewrites = new Map(), srcFiles, } = await bundler.bundle({
52
53
  basePath,
53
54
  cache,
@@ -59,7 +60,7 @@ const zipFunction = async function ({ archiveFormat, basePath, branch, cache, co
59
60
  mainFile,
60
61
  name,
61
62
  pluginsModulesPath,
62
- repositoryRoot,
63
+ repositoryRoot: functionBasePath,
63
64
  runtime,
64
65
  runtimeAPIVersion,
65
66
  srcDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "12.1.4",
3
+ "version": "12.2.0-experimental",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
@@ -44,7 +44,7 @@
44
44
  "@babel/parser": "^7.22.5",
45
45
  "@babel/types": "7.27.6",
46
46
  "@netlify/binary-info": "^1.0.0",
47
- "@netlify/serverless-functions-api": "^2.1.1",
47
+ "@netlify/serverless-functions-api": "^2.1.2",
48
48
  "@vercel/nft": "0.29.4",
49
49
  "archiver": "^7.0.0",
50
50
  "common-path-prefix": "^3.0.0",
@@ -99,6 +99,5 @@
99
99
  },
100
100
  "engines": {
101
101
  "node": ">=18.14.0"
102
- },
103
- "gitHead": "4a0f587ae4efe1c2e62c25c11374e3fbaa9aebce"
102
+ }
104
103
  }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2020 Netlify <team@netlify.com>
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.