From e32c05083bb6286d58e30952bc23ea07cb8e2485 Mon Sep 17 00:00:00 2001 From: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> Date: Sun, 4 Aug 2024 10:28:36 +0800 Subject: [PATCH] fix: creating monorepo packages post-Lerna@7 Updates internal monorepo package creator to use `npm install` instead of `lerna bootstrap`. see: https://lerna.js.org/docs/legacy-package-management Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> --- bin/create-package.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/create-package.js b/bin/create-package.js index ba582aff885f..e64b83c623b7 100644 --- a/bin/create-package.js +++ b/bin/create-package.js @@ -32,10 +32,11 @@ * 4. Run `lb4 copyright` to update `LICENSE` and copyright headers for `*.ts` * and `*.js`. * - * 5. Run `lerna bootstrap --scope ` to link its local + * 5. Run `npm install --workspace ` to link its local * dependencies. * * 6. Run `update-ts-project-refs` to update TypeScript project references + * (via NPM `postinstall` hook) * * 7. Remind to update `CODEOWNERS` and `docs/site/MONOREPO.md` */ @@ -44,7 +45,7 @@ const path = require('node:path'); const fse = require('fs-extra'); const build = require('../packages/build'); -const {runMain, updateTsProjectRefs} = require('./script-util'); +const {runMain} = require('./script-util'); const cwd = process.cwd(); @@ -115,7 +116,6 @@ async function createPackage(name) { await fixupProject(project); await updateCopyrightAndLicense(project, options); await bootstrapProject(project); - await updateTsProjectRefs({dryRun: false}); promptActions(project); } @@ -152,8 +152,8 @@ async function bootstrapProject({repoRoot, name}) { process.chdir(repoRoot); // Run `npx lerna bootstrap --scope @loopback/` const shell = build.runShell( - 'npx', - ['lerna', 'bootstrap', '--scope', `@loopback/${name}`], + 'npm', + ['install', '--workspace', `@loopback/${name}`], { cwd: repoRoot, },