@netlify/zip-it-and-ship-it 5.2.0 → 5.3.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.
@@ -6,7 +6,6 @@ const FLAGS = {
6
6
  buildGoSource: Boolean(process_1.env.NETLIFY_EXPERIMENTAL_BUILD_GO_SOURCE),
7
7
  buildRustSource: Boolean(process_1.env.NETLIFY_EXPERIMENTAL_BUILD_RUST_SOURCE),
8
8
  defaultEsModulesToEsbuild: Boolean(process_1.env.NETLIFY_EXPERIMENTAL_DEFAULT_ES_MODULES_TO_ESBUILD),
9
- parseISC: false,
10
9
  parseWithEsbuild: false,
11
10
  traceWithNft: false,
12
11
  };
@@ -89,10 +89,7 @@ const zipFunction = function ({ archiveFormat, basePath, config = {}, destFolder
89
89
  srcPath,
90
90
  stat,
91
91
  });
92
- let inSourceConfig = {};
93
- if (featureFlags.parseISC) {
94
- inSourceConfig = yield (0, in_source_config_1.findISCDeclarationsInPath)(mainFile);
95
- }
92
+ const inSourceConfig = yield (0, in_source_config_1.findISCDeclarationsInPath)(mainFile);
96
93
  (0, plugin_modules_path_1.createAliases)(srcFiles, pluginsModulesPath, aliases, finalBasePath);
97
94
  const zipPath = yield (0, zip_1.zipNodeJs)({
98
95
  aliases,
@@ -23,11 +23,16 @@ const getMainExport = (nodes) => {
23
23
  exports.getMainExport = getMainExport;
24
24
  // Finds the main handler export in a CJS AST.
25
25
  const getMainExportFromCJS = (node) => {
26
- const handlerPath = ['module', 'exports', 'handler'];
27
- if (!(0, helpers_1.isModuleExports)(node, handlerPath) || node.expression.right.type !== 'CallExpression') {
28
- return [];
29
- }
30
- return getExportsFromCallExpression(node.expression.right);
26
+ const handlerPaths = [
27
+ ['module', 'exports', 'handler'],
28
+ ['exports', 'handler'],
29
+ ];
30
+ return handlerPaths.flatMap((handlerPath) => {
31
+ if (!(0, helpers_1.isModuleExports)(node, handlerPath) || node.expression.right.type !== 'CallExpression') {
32
+ return [];
33
+ }
34
+ return getExportsFromCallExpression(node.expression.right);
35
+ });
31
36
  };
32
37
  // Finds the main handler export in an ESM AST.
33
38
  // eslint-disable-next-line complexity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "bin": {
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "devDependencies": {
95
95
  "@babel/types": "^7.15.6",
96
- "@netlify/eslint-config-node": "^3.3.10",
96
+ "@netlify/eslint-config-node": "^4.0.0",
97
97
  "@types/archiver": "^5.1.1",
98
98
  "@types/end-of-stream": "^1.4.1",
99
99
  "@types/resolve": "^1.20.1",