Skip to content

Commit

Permalink
Ensure pnpm workspace file is created
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jul 15, 2022
1 parent fc47c4f commit 6b8586f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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));
}
Expand Down
6 changes: 5 additions & 1 deletion src/root-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6b8586f

Please sign in to comment.