zapier-platform-cli 17.3.0 → 17.3.1
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/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/utils/build.js +23 -10
- package/src/utils/zapierwrapper.js +1 -1
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
package/src/utils/build.js
CHANGED
|
@@ -64,12 +64,10 @@ const findRequiredFiles = async (workingDir, entryPoints) => {
|
|
|
64
64
|
platform: 'node',
|
|
65
65
|
metafile: true,
|
|
66
66
|
logLevel: 'warning',
|
|
67
|
-
|
|
68
|
-
'
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
'./xhr-sync-worker.js', // appears in jsdom/living/xmlhttprequest.js
|
|
72
|
-
],
|
|
67
|
+
logOverride: {
|
|
68
|
+
'require-resolve-not-external': 'silent',
|
|
69
|
+
},
|
|
70
|
+
external: ['../test/userapp'],
|
|
73
71
|
format,
|
|
74
72
|
// Setting conditions to an empty array to exclude 'module' condition,
|
|
75
73
|
// which Node.js doesn't use. https://esbuild.github.io/api/#conditions
|
|
@@ -225,6 +223,10 @@ const looksLikeWorkspaceRoot = async (dir) => {
|
|
|
225
223
|
return true;
|
|
226
224
|
}
|
|
227
225
|
|
|
226
|
+
if (fs.existsSync(path.join(dir, 'lerna.json'))) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
|
|
228
230
|
const packageJsonPath = path.join(dir, 'package.json');
|
|
229
231
|
if (!fs.existsSync(packageJsonPath)) {
|
|
230
232
|
return false;
|
|
@@ -241,9 +243,12 @@ const looksLikeWorkspaceRoot = async (dir) => {
|
|
|
241
243
|
};
|
|
242
244
|
|
|
243
245
|
// Traverses up the directory tree to find the workspace root. The workspace
|
|
244
|
-
// root directory either
|
|
245
|
-
//
|
|
246
|
-
//
|
|
246
|
+
// root directory either:
|
|
247
|
+
// - contains pnpm-workspace.yaml
|
|
248
|
+
// - contains a package.json file with a "workspaces" field
|
|
249
|
+
// - contains lerna.json
|
|
250
|
+
// Returns the absolute path to the workspace root directory, or null if not
|
|
251
|
+
// found.
|
|
247
252
|
const findWorkspaceRoot = async (workingDir) => {
|
|
248
253
|
let dir = workingDir;
|
|
249
254
|
for (let i = 0; i < 500; i++) {
|
|
@@ -326,7 +331,10 @@ const writeBuildZipSmartly = async (workingDir, zip) => {
|
|
|
326
331
|
|
|
327
332
|
if (workspaceRoot !== workingDir) {
|
|
328
333
|
const appDirRelPath = path.relative(workspaceRoot, workingDir);
|
|
329
|
-
|
|
334
|
+
// zapierwrapper.js and index.js are entry points.
|
|
335
|
+
// 'config' is the default directory that the 'config' npm package expects
|
|
336
|
+
// to find config files at the root directory.
|
|
337
|
+
const linkNames = ['zapierwrapper.js', 'index.js', 'config'];
|
|
330
338
|
for (const name of linkNames) {
|
|
331
339
|
if (fs.existsSync(path.join(workingDir, name))) {
|
|
332
340
|
zip.symlink(name, path.join(appDirRelPath, name), 0o644);
|
|
@@ -548,6 +556,11 @@ const testBuildZip = async (zipPath) => {
|
|
|
548
556
|
`You may have to add it to ${colors.bold.underline('includeInBuild')} ` +
|
|
549
557
|
`in your ${colors.bold.underline('.zapierapprc')} file.`,
|
|
550
558
|
);
|
|
559
|
+
} else if (error.message) {
|
|
560
|
+
// Hide the unzipped temporary directory
|
|
561
|
+
error.message = error.message
|
|
562
|
+
.replaceAll(`file://${testDir}/`, '')
|
|
563
|
+
.replaceAll(`${testDir}/`, '');
|
|
551
564
|
}
|
|
552
565
|
throw error;
|
|
553
566
|
}
|
|
@@ -31,7 +31,7 @@ const copyZapierWrapper = async (corePackageDir, appDir) => {
|
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const wrapperText = (await readFile(wrapperPath, 'utf8')).
|
|
34
|
+
const wrapperText = (await readFile(wrapperPath, 'utf8')).replaceAll(
|
|
35
35
|
'{REPLACE_ME_PACKAGE_NAME}',
|
|
36
36
|
appPackageJson.name,
|
|
37
37
|
);
|