From 6b8586f2f98065281f20ca120fedb5715360a0a5 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Fri, 15 Jul 2022 15:27:26 -0400 Subject: [PATCH] Ensure pnpm workspace file is created --- index.js | 6 ++++++ src/root-package-json.js | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b68278de..fad6b6b4 100644 --- a/index.js +++ b/index.js @@ -26,6 +26,7 @@ module.exports = { throw new SilentError('Cannot find app blueprint for generating test-app!'); } + let addonInfo = addonInfoFromOptions(options); let testAppInfo = testAppInfoFromOptions(options); let testAppPath = path.join(options.target, testAppInfo.location); @@ -66,6 +67,11 @@ module.exports = { })() ); + if (options.pnpm) { + content = `packages:\n` + ` - '${addonInfo.location}'\n` + ` - '${testAppInfo.location}'\n`; + await fs.writeFile(path.join(options.target, 'pnpm-workspace.yaml'), content); + } + if (options.releaseIt) { tasks.push(this.setupReleaseIt(options.target)); } diff --git a/src/root-package-json.js b/src/root-package-json.js index 1494a67c..75913c11 100644 --- a/src/root-package-json.js +++ b/src/root-package-json.js @@ -24,7 +24,11 @@ module.exports = { }; if (packageManager === 'pnpm' || pnpm) { - return scripts.pnpm(options, info); + let result = scripts.pnpm(options, info); + + delete result.workspaces; + + return result; } if (packageManager === 'yarn' || yarn) {