@netlify/zip-it-and-ship-it 9.32.2 → 9.33.0

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.
Files changed (87) hide show
  1. package/LICENSE +1 -1
  2. package/bin.js +5 -0
  3. package/dist/archive.js +0 -1
  4. package/dist/bin.js +4 -3
  5. package/dist/config.js +0 -2
  6. package/dist/feature_flags.js +0 -1
  7. package/dist/function.js +0 -1
  8. package/dist/main.js +1 -2
  9. package/dist/manifest.js +0 -1
  10. package/dist/priority.js +0 -1
  11. package/dist/rate_limit.js +0 -1
  12. package/dist/runtimes/detect_runtime.js +0 -1
  13. package/dist/runtimes/go/builder.js +0 -1
  14. package/dist/runtimes/go/index.js +0 -1
  15. package/dist/runtimes/index.js +0 -1
  16. package/dist/runtimes/node/bundlers/esbuild/bundler.js +0 -1
  17. package/dist/runtimes/node/bundlers/esbuild/bundler_target.js +0 -1
  18. package/dist/runtimes/node/bundlers/esbuild/index.js +0 -1
  19. package/dist/runtimes/node/bundlers/esbuild/plugin_native_modules.js +1 -7
  20. package/dist/runtimes/node/bundlers/esbuild/plugin_node_builtin.js +0 -1
  21. package/dist/runtimes/node/bundlers/esbuild/special_cases.js +0 -1
  22. package/dist/runtimes/node/bundlers/esbuild/src_files.js +0 -1
  23. package/dist/runtimes/node/bundlers/index.js +0 -1
  24. package/dist/runtimes/node/bundlers/nft/es_modules.js +0 -1
  25. package/dist/runtimes/node/bundlers/nft/index.js +0 -1
  26. package/dist/runtimes/node/bundlers/nft/side_files.js +0 -1
  27. package/dist/runtimes/node/bundlers/nft/transformer.js +0 -1
  28. package/dist/runtimes/node/bundlers/nft/transpile.js +0 -1
  29. package/dist/runtimes/node/bundlers/none/index.js +0 -1
  30. package/dist/runtimes/node/bundlers/types.js +0 -1
  31. package/dist/runtimes/node/bundlers/zisi/index.js +0 -1
  32. package/dist/runtimes/node/bundlers/zisi/list_imports.js +0 -1
  33. package/dist/runtimes/node/bundlers/zisi/nested.js +0 -1
  34. package/dist/runtimes/node/bundlers/zisi/published.js +0 -1
  35. package/dist/runtimes/node/bundlers/zisi/resolve.js +1 -3
  36. package/dist/runtimes/node/bundlers/zisi/side_files.js +0 -1
  37. package/dist/runtimes/node/bundlers/zisi/src_files.js +0 -1
  38. package/dist/runtimes/node/bundlers/zisi/traverse.js +0 -1
  39. package/dist/runtimes/node/bundlers/zisi/tree_files.js +0 -1
  40. package/dist/runtimes/node/bundlers/zisi/tree_shake.js +0 -1
  41. package/dist/runtimes/node/finder.js +0 -1
  42. package/dist/runtimes/node/in_source_config/index.js +0 -1
  43. package/dist/runtimes/node/in_source_config/properties/schedule.js +0 -1
  44. package/dist/runtimes/node/index.js +0 -1
  45. package/dist/runtimes/node/parser/bindings.js +0 -1
  46. package/dist/runtimes/node/parser/exports.js +0 -2
  47. package/dist/runtimes/node/parser/helpers.js +0 -1
  48. package/dist/runtimes/node/parser/imports.js +0 -1
  49. package/dist/runtimes/node/parser/index.js +0 -1
  50. package/dist/runtimes/node/utils/base_path.js +0 -1
  51. package/dist/runtimes/node/utils/detect_es_module.js +0 -1
  52. package/dist/runtimes/node/utils/detect_native_module.js +0 -1
  53. package/dist/runtimes/node/utils/entry_file.js +0 -1
  54. package/dist/runtimes/node/utils/esm_cjs_compat.js +0 -1
  55. package/dist/runtimes/node/utils/included_files.js +0 -1
  56. package/dist/runtimes/node/utils/module.js +0 -1
  57. package/dist/runtimes/node/utils/module_format.js +0 -1
  58. package/dist/runtimes/node/utils/node_runtime.js +0 -1
  59. package/dist/runtimes/node/utils/node_version.js +0 -1
  60. package/dist/runtimes/node/utils/normalize_path.js +0 -1
  61. package/dist/runtimes/node/utils/package_json.js +0 -1
  62. package/dist/runtimes/node/utils/plugin_modules_path.js +0 -1
  63. package/dist/runtimes/node/utils/traversal_cache.js +0 -1
  64. package/dist/runtimes/node/utils/zip.js +0 -1
  65. package/dist/runtimes/runtime.js +0 -1
  66. package/dist/runtimes/rust/builder.js +0 -1
  67. package/dist/runtimes/rust/cargo_manifest.js +0 -1
  68. package/dist/runtimes/rust/constants.js +0 -1
  69. package/dist/runtimes/rust/index.js +0 -1
  70. package/dist/types/utils.js +0 -1
  71. package/dist/utils/archive_size.js +0 -1
  72. package/dist/utils/cache.js +9 -1
  73. package/dist/utils/error.js +0 -1
  74. package/dist/utils/format_result.js +0 -1
  75. package/dist/utils/fs.js +3 -2
  76. package/dist/utils/get_internal_value.js +0 -1
  77. package/dist/utils/logger.js +0 -1
  78. package/dist/utils/matching.js +0 -1
  79. package/dist/utils/non_nullable.js +0 -1
  80. package/dist/utils/remove_undefined.js +1 -2
  81. package/dist/utils/routes.js +0 -1
  82. package/dist/utils/shell.js +0 -1
  83. package/dist/utils/timer.js +0 -1
  84. package/dist/utils/urlpattern.js +0 -1
  85. package/dist/zip.js +0 -1
  86. package/dist/zip_binary.js +0 -1
  87. package/package.json +14 -28
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 Netlify <team@netlify.com>
1
+ Copyright (c) 2020 Netlify <team@netlify.com>
2
2
 
3
3
  MIT License
4
4
 
package/bin.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ // This is a workaround for npm issue: https://github.com/npm/cli/issues/2632
4
+
5
+ import './dist/bin.js'
package/dist/archive.js CHANGED
@@ -40,4 +40,3 @@ export const endZip = async function (archive, output) {
40
40
  await archive.finalize();
41
41
  return result;
42
42
  };
43
- //# sourceMappingURL=archive.js.map
package/dist/bin.js CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from 'fs';
2
3
  import { argv, exit } from 'process';
3
4
  import yargs from 'yargs';
4
5
  import { hideBin } from 'yargs/helpers';
5
6
  import { ARCHIVE_FORMAT } from './archive.js';
6
7
  import { zipFunctions } from './main.js';
8
+ const packJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
7
9
  // CLI entry point
8
10
  const runCli = async function () {
9
- // @ts-expect-error TODO: `destFolder` and `srcFolder` are not being passed
10
- // back from `parseArgs()`.
11
+ // @ts-expect-error TODO: not returning the right types
11
12
  const { destFolder, srcFolder, ...options } = parseArgs();
12
13
  try {
13
14
  global.ZISI_CLI = true;
@@ -25,6 +26,7 @@ const parseArgs = function () {
25
26
  .command('* <srcFolder> <destFolder>', 'Create ZIP archives from a directory')
26
27
  .options(OPTIONS)
27
28
  .usage(USAGE)
29
+ .version(packJson.version)
28
30
  .strict()
29
31
  .parse();
30
32
  };
@@ -56,4 +58,3 @@ const USAGE = `$0 [OPTIONS...] FUNCTIONS_DIRECTORY OUTPUT_DIRECTORY
56
58
  Zip all function files inside FUNCTIONS_DIRECTORY so that they can be uploaded
57
59
  to AWS Lambda.`;
58
60
  runCli();
59
- //# sourceMappingURL=bin.js.map
package/dist/config.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { promises as fs } from 'fs';
2
2
  import { basename, extname, dirname, join } from 'path';
3
3
  import isPathInside from 'is-path-inside';
4
- // @ts-expect-error Typescript cannot find definition
5
4
  import mergeOptions from 'merge-options';
6
5
  import { minimatch } from './utils/matching.js';
7
6
  const getConfigForFunction = async ({ config, configFileDirectories, func, }) => {
@@ -57,4 +56,3 @@ const getFromFile = async (func) => {
57
56
  return {};
58
57
  };
59
58
  export { getConfigForFunction };
60
- //# sourceMappingURL=config.js.map
@@ -28,4 +28,3 @@ export const getFlags = (input = {}, flags = defaultFlags) => Object.entries(fla
28
28
  ...result,
29
29
  [key]: input[key] === undefined ? defaultValue : input[key],
30
30
  }), {});
31
- //# sourceMappingURL=feature_flags.js.map
package/dist/function.js CHANGED
@@ -3,4 +3,3 @@ export const INVOCATION_MODE = {
3
3
  Buffer: 'buffer',
4
4
  Stream: 'stream',
5
5
  };
6
- //# sourceMappingURL=function.js.map
package/dist/main.js CHANGED
@@ -19,7 +19,7 @@ const augmentWithStaticAnalysis = async (func) => {
19
19
  });
20
20
  return { ...func, staticAnalysisResult };
21
21
  };
22
- // List all Netlify Functions main entry files for a specific directory
22
+ // List all Netlify Functions main entry files for a specific directory.
23
23
  export const listFunctions = async function (relativeSrcFolders, { featureFlags: inputFeatureFlags, config, configFileDirectories, parseISC = false } = {}) {
24
24
  const featureFlags = getFlags(inputFeatureFlags);
25
25
  const srcFolders = resolveFunctionsDirectories(relativeSrcFolders);
@@ -90,4 +90,3 @@ const getSrcFiles = async function ({ extension, runtime, srcPath, ...args }) {
90
90
  ...args,
91
91
  });
92
92
  };
93
- //# sourceMappingURL=main.js.map
package/dist/manifest.js CHANGED
@@ -33,4 +33,3 @@ const formatFunctionForManifest = ({ bundler, displayName, generator, invocation
33
33
  }
34
34
  return manifestFunction;
35
35
  };
36
- //# sourceMappingURL=manifest.js.map
package/dist/priority.js CHANGED
@@ -3,4 +3,3 @@ export var Priority;
3
3
  Priority[Priority["GeneratedFunction"] = 0] = "GeneratedFunction";
4
4
  Priority[Priority["UserFunction"] = 10] = "UserFunction";
5
5
  })(Priority || (Priority = {}));
6
- //# sourceMappingURL=priority.js.map
@@ -12,4 +12,3 @@ export var RateLimitAction;
12
12
  RateLimitAction["Limit"] = "rate_limit";
13
13
  RateLimitAction["Rewrite"] = "rewrite";
14
14
  })(RateLimitAction || (RateLimitAction = {}));
15
- //# sourceMappingURL=rate_limit.js.map
@@ -31,4 +31,3 @@ export const detectBinaryRuntime = async function ({ path }) {
31
31
  // Possible errors are: non binary files, arch/platforms not supported by binary-info, path is directory
32
32
  }
33
33
  };
34
- //# sourceMappingURL=detect_runtime.js.map
@@ -29,4 +29,3 @@ export const build = async ({ destPath, mainFile, srcDir }) => {
29
29
  stat,
30
30
  };
31
31
  };
32
- //# sourceMappingURL=builder.js.map
@@ -119,4 +119,3 @@ const zipFunction = async function ({ config, destFolder, filename, mainFile, sr
119
119
  };
120
120
  const runtime = { findFunctionsInPaths, findFunctionInPath, name: RUNTIME.GO, zipFunction };
121
121
  export default runtime;
122
- //# sourceMappingURL=index.js.map
@@ -94,4 +94,3 @@ export const getFunctionFromPath = async (path, { cache, config, configFileDirec
94
94
  }
95
95
  return undefined;
96
96
  };
97
- //# sourceMappingURL=index.js.map
@@ -199,4 +199,3 @@ const getBundlePaths = ({ destFolder, outputExtension, outputs, srcFile, }) => {
199
199
  const getCleanupFunction = (paths) => async () => {
200
200
  await Promise.all(paths.filter(Boolean).map(safeUnlink));
201
201
  };
202
- //# sourceMappingURL=bundler.js.map
@@ -43,4 +43,3 @@ const getModuleFormat = async ({ srcDir, featureFlags, extension, runtimeAPIVers
43
43
  };
44
44
  };
45
45
  export { getBundlerTarget, getModuleFormat };
46
- //# sourceMappingURL=bundler_target.js.map
@@ -86,4 +86,3 @@ const bundle = async ({ basePath, config = {}, extension, featureFlags, filename
86
86
  };
87
87
  const bundler = { bundle, getSrcFiles };
88
88
  export default bundler;
89
- //# sourceMappingURL=index.js.map
@@ -7,7 +7,6 @@ const packageFilter = /^([^./]*)$/;
7
7
  const packageName = /^([^@][^/]*|@[^/]*\/[^/]+)(?:\/|$)/;
8
8
  const findNativeModule = (packageJsonPath, cache) => {
9
9
  if (cache[packageJsonPath] === undefined) {
10
- // eslint-disable-next-line no-param-reassign, promise/prefer-await-to-then
11
10
  cache[packageJsonPath] = readPackageJson(packageJsonPath).then((data) => [Boolean(isNativeModule(data)), data], () => [undefined, {}]);
12
11
  }
13
12
  return cache[packageJsonPath];
@@ -21,23 +20,19 @@ export const getNativeModulesPlugin = (externalizedModules) => ({
21
20
  if (!pkg)
22
21
  return;
23
22
  let directory = args.resolveDir;
23
+ // eslint-disable-next-line no-constant-condition
24
24
  while (true) {
25
25
  if (path.basename(directory) !== 'node_modules') {
26
26
  const modulePath = path.join(directory, 'node_modules', pkg[1]);
27
27
  const packageJsonPath = path.join(modulePath, 'package.json');
28
28
  const [isNative, packageJsonData] = await findNativeModule(packageJsonPath, cache);
29
- // eslint-disable-next-line max-depth
30
29
  if (isNative === true) {
31
- // eslint-disable-next-line max-depth
32
30
  if (externalizedModules[args.path] === undefined) {
33
- // eslint-disable-next-line no-param-reassign
34
31
  externalizedModules[args.path] = {};
35
32
  }
36
- // eslint-disable-next-line no-param-reassign
37
33
  externalizedModules[args.path][modulePath] = packageJsonData.version;
38
34
  return { path: args.path, external: true };
39
35
  }
40
- // eslint-disable-next-line max-depth
41
36
  if (isNative === false) {
42
37
  return;
43
38
  }
@@ -51,4 +46,3 @@ export const getNativeModulesPlugin = (externalizedModules) => ({
51
46
  });
52
47
  },
53
48
  });
54
- //# sourceMappingURL=plugin_native_modules.js.map
@@ -4,4 +4,3 @@ export const getNodeBuiltinPlugin = () => ({
4
4
  build.onResolve({ filter: /^node:/ }, (args) => ({ path: args.path.slice('node:'.length), external: true }));
5
5
  },
6
6
  });
7
- //# sourceMappingURL=plugin_node_builtin.js.map
@@ -28,4 +28,3 @@ export const getExternalAndIgnoredModulesFromSpecialCases = async ({ config, src
28
28
  ignoredModules,
29
29
  };
30
30
  };
31
- //# sourceMappingURL=special_cases.js.map
@@ -53,4 +53,3 @@ const getSrcFilesForDependency = async function ({ dependency, basedir, state =
53
53
  throw error;
54
54
  }
55
55
  };
56
- //# sourceMappingURL=src_files.js.map
@@ -48,4 +48,3 @@ const getDefaultBundler = async ({ extension, featureFlags, mainFile, }) => {
48
48
  const functionIsESM = extname(mainFile) !== MODULE_FILE_EXTENSION.CJS && (await detectEsModule({ mainFile }));
49
49
  return functionIsESM ? NODE_BUNDLER.NFT : NODE_BUNDLER.ZISI;
50
50
  };
51
- //# sourceMappingURL=index.js.map
@@ -112,4 +112,3 @@ const transpileESM = async ({ basePath, cache, config, esmPaths, reasons, name,
112
112
  }));
113
113
  return rewrites;
114
114
  };
115
- //# sourceMappingURL=es_modules.js.map
@@ -176,4 +176,3 @@ const getSrcFiles = async function ({ basePath, config, mainFile, featureFlags }
176
176
  };
177
177
  const bundler = { bundle, getSrcFiles };
178
178
  export default bundler;
179
- //# sourceMappingURL=index.js.map
@@ -17,4 +17,3 @@ export const getSideFiles = async function (functionPath, stat) {
17
17
  });
18
18
  return paths.filter((path) => !isJunk(basename(path)));
19
19
  };
20
- //# sourceMappingURL=side_files.js.map
@@ -98,4 +98,3 @@ export const transform = async ({ bundle = false, config, format, name, path })
98
98
  });
99
99
  }
100
100
  };
101
- //# sourceMappingURL=transformer.js.map
@@ -29,4 +29,3 @@ export const transpileESMToCJS = async ({ config, name, path }) => {
29
29
  });
30
30
  }
31
31
  };
32
- //# sourceMappingURL=transpile.js.map
@@ -73,4 +73,3 @@ const bundle = async ({ basePath, config, extension, featureFlags, filename, mai
73
73
  };
74
74
  const bundler = { bundle, getSrcFiles };
75
75
  export default bundler;
76
- //# sourceMappingURL=index.js.map
@@ -5,4 +5,3 @@ export const NODE_BUNDLER = {
5
5
  ZISI: 'zisi',
6
6
  NONE: 'none',
7
7
  };
8
- //# sourceMappingURL=types.js.map
@@ -32,4 +32,3 @@ const bundle = async ({ basePath, config, extension, featureFlags, filename, mai
32
32
  };
33
33
  const bundler = { bundle, getSrcFiles };
34
34
  export default bundler;
35
- //# sourceMappingURL=index.js.map
@@ -76,4 +76,3 @@ const listImportsWithPrecinct = async ({ functionName, path }) => {
76
76
  }
77
77
  };
78
78
  export const listImports = async ({ featureFlags, ...args }) => (featureFlags.parseWithEsbuild ? await listImportsWithESBuild(args) : await listImportsWithPrecinct(args));
79
- //# sourceMappingURL=list_imports.js.map
@@ -71,4 +71,3 @@ const isExternalCrittersModule = function (moduleName, { dependencies = {}, devD
71
71
  }
72
72
  return satisfiesRange(nextVersion);
73
73
  };
74
- //# sourceMappingURL=nested.js.map
@@ -26,4 +26,3 @@ const IGNORED_FILES = [
26
26
  '*.ts',
27
27
  '*.patch',
28
28
  ];
29
- //# sourceMappingURL=published.js.map
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
2
2
  import { version as nodeVersion } from 'process';
3
3
  import { findUp } from 'find-up';
4
4
  import { pathExists } from 'path-exists';
5
- // @ts-expect-error types are wrong
5
+ // @ts-expect-error doesnt export async
6
6
  import { async as asyncResolve } from 'resolve';
7
7
  import semver from 'semver';
8
8
  // The types do not include the mjs api of resolve
@@ -47,7 +47,6 @@ const REQUEST_RESOLVE_MIN_VERSION = '8.9.0';
47
47
  // https://github.com/browserify/resolve/issues/151#issuecomment-368210310
48
48
  const resolvePathPreserveSymlinksForDir = function (path, basedir) {
49
49
  return new Promise((resolve, reject) => {
50
- // eslint-disable-next-line promise/prefer-await-to-callbacks
51
50
  resolveLib(path, { basedir, preserveSymlinks: true }, (error, resolvedLocation) => {
52
51
  if (error || resolvedLocation === undefined) {
53
52
  return reject(error);
@@ -98,4 +97,3 @@ const isPackageDir = async function (moduleName, dir) {
98
97
  }
99
98
  return dir;
100
99
  };
101
- //# sourceMappingURL=resolve.js.map
@@ -11,4 +11,3 @@ export const getSideFiles = async function (modulePath, moduleName) {
11
11
  const SIDE_FILES = {
12
12
  '@prisma/client': '../../.prisma',
13
13
  };
14
- //# sourceMappingURL=side_files.js.map
@@ -106,4 +106,3 @@ const getTreeShakedDependencies = async function ({ dependency, basedir, feature
106
106
  });
107
107
  return [path, ...depsPath];
108
108
  };
109
- //# sourceMappingURL=src_files.js.map
@@ -66,4 +66,3 @@ const getNestedModules = async function ({ modulePath, state, packageJson, plugi
66
66
  })));
67
67
  return depsPaths.flat();
68
68
  };
69
- //# sourceMappingURL=traverse.js.map
@@ -10,4 +10,3 @@ export const getTreeFiles = async function (srcPath, stat) {
10
10
  absolute: true,
11
11
  });
12
12
  };
13
- //# sourceMappingURL=tree_files.js.map
@@ -11,4 +11,3 @@ export const shouldTreeShake = function (dependency, treeShakeNext) {
11
11
  }
12
12
  return treeShakeNext && getModuleName(dependency) === 'next';
13
13
  };
14
- //# sourceMappingURL=tree_shake.js.map
@@ -75,4 +75,3 @@ const getMainFile = async function (srcPath, filename, stat) {
75
75
  return srcPath;
76
76
  }
77
77
  };
78
- //# sourceMappingURL=finder.js.map
@@ -171,4 +171,3 @@ export const parseSource = (source, { functionName }) => {
171
171
  const mergedExports = iscExports.reduce((acc, obj) => ({ ...acc, ...obj }), {});
172
172
  return { ...mergedExports, inputModuleFormat, runtimeAPIVersion: 1 };
173
173
  };
174
- //# sourceMappingURL=index.js.map
@@ -12,4 +12,3 @@ export const parse = ({ args }, getAllBindings) => {
12
12
  schedule,
13
13
  };
14
14
  };
15
- //# sourceMappingURL=schedule.js.map
@@ -144,4 +144,3 @@ const runtime = {
144
144
  zipFunction: zipWithFunctionWithFallback,
145
145
  };
146
146
  export default runtime;
147
- //# sourceMappingURL=index.js.map
@@ -44,4 +44,3 @@ export const createBindingsMethod = function (nodes) {
44
44
  return result;
45
45
  };
46
46
  };
47
- //# sourceMappingURL=bindings.js.map
@@ -195,7 +195,6 @@ const getExportsFromBindings = (specifiers, name, getAllBindings) => {
195
195
  const defaultExport = specifiers.find((node) => isDefaultExport(node));
196
196
  if (defaultExport && defaultExport.type === 'ExportSpecifier') {
197
197
  const binding = getAllBindings().get(defaultExport.local.name);
198
- // eslint-disable-next-line max-depth
199
198
  if (binding?.type === 'ArrowFunctionExpression' ||
200
199
  binding?.type === 'FunctionDeclaration' ||
201
200
  binding?.type === 'Identifier') {
@@ -229,4 +228,3 @@ const getExportsFromExpression = (node) => {
229
228
  }
230
229
  }
231
230
  };
232
- //# sourceMappingURL=exports.js.map
@@ -31,4 +31,3 @@ export const isRequire = (node, requirePath) => {
31
31
  };
32
32
  const isRequireCall = (node) => node.type === 'Identifier' && node.name === 'require';
33
33
  const isRequirePath = (node, path) => node.type === 'StringLiteral' && node.value === path;
34
- //# sourceMappingURL=helpers.js.map
@@ -53,4 +53,3 @@ const getImportsFromESM = (node, importPath) => {
53
53
  .filter(nonNullable);
54
54
  return imports;
55
55
  };
56
- //# sourceMappingURL=imports.js.map
@@ -178,4 +178,3 @@ const validateGlobNodes = (globNodes) => {
178
178
  const hasStaticHead = globNodes[0] !== GLOB_WILDCARD;
179
179
  return hasStrings && hasStaticHead;
180
180
  };
181
- //# sourceMappingURL=index.js.map
@@ -5,4 +5,3 @@ export const getBasePath = (dirnames) => {
5
5
  }
6
6
  return commonPathPrefix(dirnames);
7
7
  };
8
- //# sourceMappingURL=base_path.js.map
@@ -14,4 +14,3 @@ export const detectEsModule = async ({ mainFile }) => {
14
14
  return false;
15
15
  }
16
16
  };
17
- //# sourceMappingURL=detect_es_module.js.map
@@ -14,4 +14,3 @@ export const isNativeModule = ({ binary, dependencies = {}, devDependencies = {}
14
14
  : false;
15
15
  return hasBinaryFile;
16
16
  };
17
- //# sourceMappingURL=detect_native_module.js.map
@@ -92,4 +92,3 @@ export const getEntryFile = ({ commonPrefix, featureFlags, filename, mainFile, m
92
92
  filename: entryFilename,
93
93
  };
94
94
  };
95
- //# sourceMappingURL=entry_file.js.map
@@ -12,4 +12,3 @@ let __filename=___nfyFileURLToPath(import.meta.url);
12
12
  let __dirname=___nfyPathDirname(___nfyFileURLToPath(import.meta.url));
13
13
  let require=___nfyCreateRequire(import.meta.url);
14
14
  `;
15
- //# sourceMappingURL=esm_cjs_compat.js.map
@@ -56,4 +56,3 @@ export const getPathsOfIncludedFiles = async (includedFiles, featureFlags, baseP
56
56
  // now filter the non symlinked directories out that got marked with a trailing slash
57
57
  return { excludePatterns, paths };
58
58
  };
59
- //# sourceMappingURL=included_files.js.map
@@ -7,4 +7,3 @@ export const getModuleName = function (dependency) {
7
7
  const moduleName = requirePackageName(dependencyA);
8
8
  return moduleName;
9
9
  };
10
- //# sourceMappingURL=module.js.map
@@ -19,4 +19,3 @@ export const getFileExtensionForFormat = (moduleFormat, featureFlags, runtimeAPI
19
19
  }
20
20
  return MODULE_FILE_EXTENSION.JS;
21
21
  };
22
- //# sourceMappingURL=module_format.js.map
@@ -31,4 +31,3 @@ export const getNodeRuntimeForV2 = (input) => {
31
31
  }
32
32
  return validRuntimeMap[version];
33
33
  };
34
- //# sourceMappingURL=node_runtime.js.map
@@ -17,4 +17,3 @@ export const parseVersion = (input) => {
17
17
  }
18
18
  return semver.coerce(input)?.major;
19
19
  };
20
- //# sourceMappingURL=node_version.js.map
@@ -10,4 +10,3 @@ export const normalizeFilePath = function ({ commonPrefix, path, userNamespace,
10
10
  const pathC = unixify(pathB);
11
11
  return pathC;
12
12
  };
13
- //# sourceMappingURL=normalize_path.js.map
@@ -55,4 +55,3 @@ export const sanitizePackageJson = (packageJson) => ({
55
55
  ...packageJson,
56
56
  files: sanitizeFiles(packageJson.files),
57
57
  });
58
- //# sourceMappingURL=package_json.js.map
@@ -11,4 +11,3 @@ export const createAliases = (paths, pluginsModulesPath, aliases, basePath) => {
11
11
  });
12
12
  };
13
13
  export const getPluginsModulesPath = (srcDir) => findUp(`${AUTO_PLUGINS_DIR}node_modules`, { cwd: srcDir, type: 'directory' });
14
- //# sourceMappingURL=plugin_modules_path.js.map
@@ -3,4 +3,3 @@ export const getNewCache = () => ({
3
3
  moduleNames: new Set(),
4
4
  modulePaths: new Set(),
5
5
  });
6
- //# sourceMappingURL=traversal_cache.js.map
@@ -180,4 +180,3 @@ const zipJsFile = function ({ aliases = new Map(), archive, commonPrefix, rewrit
180
180
  addZipFile(archive, srcFile, normalizedDestPath, stat);
181
181
  }
182
182
  };
183
- //# sourceMappingURL=zip.js.map
@@ -3,4 +3,3 @@ export const RUNTIME = {
3
3
  JAVASCRIPT: 'js',
4
4
  RUST: 'rs',
5
5
  };
6
- //# sourceMappingURL=runtime.js.map
@@ -88,4 +88,3 @@ const installToolchainOnce = () => {
88
88
  }
89
89
  return toolchainInstallation;
90
90
  };
91
- //# sourceMappingURL=builder.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=cargo_manifest.js.map
@@ -1,3 +1,2 @@
1
1
  export const BUILD_TARGET = 'x86_64-unknown-linux-musl';
2
2
  export const MANIFEST_NAME = 'Cargo.toml';
3
- //# sourceMappingURL=constants.js.map
@@ -110,4 +110,3 @@ const zipFunction = async function ({ cache, config, destFolder, filename, mainF
110
110
  };
111
111
  const runtime = { findFunctionsInPaths, findFunctionInPath, name: RUNTIME.RUST, zipFunction };
112
112
  export default runtime;
113
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=utils.js.map
@@ -10,4 +10,3 @@ export const addArchiveSize = async (result) => {
10
10
  const { size } = await fs.stat(path);
11
11
  return { ...result, size };
12
12
  };
13
- //# sourceMappingURL=archive_size.js.map
@@ -1,4 +1,13 @@
1
1
  export class RuntimeCache {
2
+ // Cache for fs.readFile() calls
3
+ fileCache;
4
+ // Cache for fs.lstat() calls
5
+ lstatCache;
6
+ // Cache fs.readdir() calls
7
+ readdirCache;
8
+ // NFT cache, which should not be used in zisi and only supplied to NFT
9
+ // this cache shares the file cache with zisi
10
+ nftCache;
2
11
  constructor() {
3
12
  this.fileCache = new Map();
4
13
  this.lstatCache = new Map();
@@ -7,4 +16,3 @@ export class RuntimeCache {
7
16
  this.nftCache.fileCache = this.fileCache;
8
17
  }
9
18
  }
10
- //# sourceMappingURL=cache.js.map
@@ -15,4 +15,3 @@ export class FunctionBundlingUserError extends Error {
15
15
  return error;
16
16
  }
17
17
  }
18
- //# sourceMappingURL=error.js.map
@@ -11,4 +11,3 @@ export const formatZipResult = (archive) => {
11
11
  };
12
12
  return removeUndefined(functionResult);
13
13
  };
14
- //# sourceMappingURL=format_result.js.map
package/dist/utils/fs.js CHANGED
@@ -34,7 +34,9 @@ export const safeUnlink = async (path) => {
34
34
  try {
35
35
  await fs.unlink(path);
36
36
  }
37
- catch { }
37
+ catch {
38
+ // no-op
39
+ }
38
40
  };
39
41
  // Takes a list of absolute paths and returns an array containing all the
40
42
  // filenames within those directories, if at least one of the directories
@@ -78,4 +80,3 @@ export const mkdirAndWriteFile = async (path, ...params) => {
78
80
  }
79
81
  return fs.writeFile(path, ...params);
80
82
  };
81
- //# sourceMappingURL=fs.js.map
@@ -1,3 +1,2 @@
1
1
  const getInternalValue = (isInternal) => (isInternal ? 'internalFunc' : undefined);
2
2
  export default getInternalValue;
3
- //# sourceMappingURL=get_internal_value.js.map
@@ -12,4 +12,3 @@ const getLogger = (systemLogger, debug = false) => {
12
12
  };
13
13
  };
14
14
  export { getLogger };
15
- //# sourceMappingURL=logger.js.map
@@ -21,4 +21,3 @@ export const glob = function (pattern, options) {
21
21
  export const minimatch = function (target, pattern, options) {
22
22
  return minimatchFunction(target, normalizePath(pattern), options);
23
23
  };
24
- //# sourceMappingURL=matching.js.map
@@ -1,2 +1 @@
1
1
  export const nonNullable = (value) => value !== null && value !== undefined;
2
- //# sourceMappingURL=non_nullable.js.map
@@ -1,6 +1,5 @@
1
1
  import { includeKeys } from 'filter-obj';
2
- const isUndefined = (key, value) => value !== undefined;
2
+ const isUndefined = (_key, value) => value !== undefined;
3
3
  export const removeUndefined = function (obj) {
4
4
  return includeKeys(obj, isUndefined);
5
5
  };
6
- //# sourceMappingURL=remove_undefined.js.map
@@ -67,4 +67,3 @@ export const getRoutes = ({ functionName, methods, path: pathOrPaths, preferStat
67
67
  .filter(nonNullable);
68
68
  return routes;
69
69
  };
70
- //# sourceMappingURL=routes.js.map
@@ -1,3 +1,2 @@
1
1
  import { execa } from 'execa';
2
2
  export const shellUtils = { runCommand: execa };
3
- //# sourceMappingURL=shell.js.map
@@ -9,4 +9,3 @@ export const endTimer = function ([startSecs, startNsecs]) {
9
9
  const durationNs = (endSecs - startSecs) * NANOSECS_TO_SECS + endNsecs - startNsecs;
10
10
  return durationNs;
11
11
  };
12
- //# sourceMappingURL=timer.js.map
@@ -1,4 +1,3 @@
1
1
  import { URLPattern } from 'urlpattern-polyfill';
2
2
  export class ExtendedURLPattern extends URLPattern {
3
3
  }
4
- //# sourceMappingURL=urlpattern.js.map
package/dist/zip.js CHANGED
@@ -115,4 +115,3 @@ export const zipFunction = async function (relativeSrcPath, destFolder, { archiv
115
115
  });
116
116
  return formatZipResult({ ...zipResult, mainFile, name, runtime });
117
117
  };
118
- //# sourceMappingURL=zip.js.map
@@ -6,4 +6,3 @@ export const zipBinary = async function ({ destPath, filename, runtime, srcPath,
6
6
  addZipContent(archive, JSON.stringify({ runtime: runtime.name }), 'netlify-toolchain');
7
7
  await endZip(archive, output);
8
8
  };
9
- //# sourceMappingURL=zip_binary.js.map
package/package.json CHANGED
@@ -1,42 +1,25 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "9.32.2",
3
+ "version": "9.33.0",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "zip-it-and-ship-it": "dist/bin.js"
8
+ "zip-it-and-ship-it": "./bin.js"
9
9
  },
10
10
  "files": [
11
11
  "dist/**/*.js",
12
12
  "dist/**/*.d.ts"
13
13
  ],
14
14
  "scripts": {
15
- "prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
16
- "prepublishOnly": "npm ci && npm test",
17
15
  "prepack": "npm run build",
18
16
  "build": "tsc",
19
17
  "build:dev": "tsc -w",
20
18
  "benchmark": "./benchmarks/run.sh",
21
- "format": "run-s build format:check-fix:*",
22
- "format:ci": "run-s build format:check:*",
23
- "format:check-fix:lint": "run-e format:check:lint format:fix:lint",
24
- "format:check:lint": "cross-env-shell eslint $npm_package_config_eslint",
25
- "format:fix:lint": "cross-env-shell eslint --fix $npm_package_config_eslint",
26
- "format:check-fix:prettier": "run-e format:check:prettier format:fix:prettier",
27
- "format:check:prettier": "cross-env-shell prettier --check $npm_package_config_prettier",
28
- "format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier",
29
- "test": "run-s build format && vitest run",
19
+ "test": "vitest run",
30
20
  "test:dev": "vitest",
31
21
  "test:ci": "npm run build && vitest run"
32
22
  },
33
- "config": {
34
- "eslint": "--report-unused-disable-directives --ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,tests,.github}/**/*.{mjs,cjs,js,mts,cts,ts,md,html}\" \"*.{cjs,mjs,js,cts,mts,ts,md,html}\" \".*.{cjs,mjs,js,cts,mts,ts,md,html}\"",
35
- "prettier": "--loglevel=warn \"{src,tests,.github}/**/*.{cjs,mjs,js,cts,mts,ts,md,yml,json,html}\" \"*.{cjs,mjs,js,cts,mts,ts,yml,json,html}\" \".*.{cjs,mjs,js,cts,mts,ts,yml,json,html}\" \"!package-lock.json\""
36
- },
37
- "eslintIgnore": [
38
- "benchmarks/fixtures/**"
39
- ],
40
23
  "keywords": [
41
24
  "api",
42
25
  "bundler",
@@ -48,10 +31,14 @@
48
31
  ],
49
32
  "author": "Netlify, Inc",
50
33
  "license": "MIT",
51
- "repository": "https://github.com/netlify/zip-it-and-ship-it",
52
- "homepage": "https://github.com/netlify/zip-it-and-ship-it#README",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/netlify/build.git",
37
+ "directory": "packages/zip-it-and-ship-it"
38
+ },
39
+ "homepage": "https://github.com/netlify/build/tree/main/packages/zip-it-and-ship-it#README",
53
40
  "bugs": {
54
- "url": "https://github.com/netlify/zip-it-and-ship-it/issues"
41
+ "url": "https://github.com/netlify/build/issues"
55
42
  },
56
43
  "dependencies": {
57
44
  "@babel/parser": "^7.22.5",
@@ -89,15 +76,14 @@
89
76
  "yargs": "^17.0.0"
90
77
  },
91
78
  "devDependencies": {
92
- "@netlify/eslint-config-node": "7.0.1",
93
79
  "@types/archiver": "5.3.4",
94
80
  "@types/glob": "8.1.0",
95
81
  "@types/is-ci": "3.0.4",
96
- "@types/node": "20.12.10",
82
+ "@types/node": "20.12.11",
97
83
  "@types/normalize-path": "3.0.2",
98
84
  "@types/picomatch": "2.3.3",
99
85
  "@types/resolve": "1.20.6",
100
- "@types/semver": "7.5.6",
86
+ "@types/semver": "7.5.8",
101
87
  "@types/tmp": "0.2.6",
102
88
  "@types/unixify": "1.0.2",
103
89
  "@types/yargs": "17.0.32",
@@ -108,7 +94,6 @@
108
94
  "decompress": "4.2.1",
109
95
  "deepmerge": "4.3.1",
110
96
  "get-stream": "8.0.1",
111
- "husky": "8.0.3",
112
97
  "is-ci": "3.0.1",
113
98
  "lambda-local": "2.2.0",
114
99
  "npm-run-all": "4.1.5",
@@ -118,5 +103,6 @@
118
103
  },
119
104
  "engines": {
120
105
  "node": "^14.18.0 || >=16.0.0"
121
- }
106
+ },
107
+ "gitHead": "46a7e2c1584acccb57a7c67e4133bbe35af96f9b"
122
108
  }