zapier-platform-cli 17.0.2 → 17.0.4

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.
@@ -2430,5 +2430,5 @@
2430
2430
  ]
2431
2431
  }
2432
2432
  },
2433
- "version": "17.0.2"
2433
+ "version": "17.0.4"
2434
2434
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-cli",
3
- "version": "17.0.2",
3
+ "version": "17.0.4",
4
4
  "description": "The CLI for managing integrations in Zapier Developer Platform.",
5
5
  "repository": "zapier/zapier-platform",
6
6
  "homepage": "https://platform.zapier.com/",
@@ -53,6 +53,17 @@ const requiredFiles = async ({ cwd, entryPoints }) => {
53
53
  cwd += path.sep;
54
54
  }
55
55
 
56
+ const appPackageJson = require(path.join(cwd, 'package.json'));
57
+ const isESM = appPackageJson.type === 'module';
58
+ // Only include 'module' condition if the app is an ESM app (PDE-6187)
59
+ // otherwise exclude 'module' since it breaks the build for hybrid packages (like uuid)
60
+ // in CJS apps by only including ESM version of packages.
61
+ // An empty list is necessary because otherwise if `platform: node` is specified,
62
+ // the 'module' condition is included by default.
63
+ // https://esbuild.github.io/api/#conditions
64
+ const conditions = isESM ? ['module'] : [];
65
+ const format = isESM ? 'esm' : 'cjs';
66
+
56
67
  const result = await esbuild.build({
57
68
  entryPoints,
58
69
  outdir: './build',
@@ -61,9 +72,11 @@ const requiredFiles = async ({ cwd, entryPoints }) => {
61
72
  metafile: true,
62
73
  logLevel: 'warning',
63
74
  external: ['../test/userapp'],
64
- format: 'esm',
75
+ format,
76
+ conditions,
65
77
  write: false, // no need to write outfile
66
78
  absWorkingDir: cwd,
79
+ tsconfigRaw: '{}',
67
80
  });
68
81
 
69
82
  return Object.keys(result.metafile.inputs).map((path) =>