Skip to content

Commit

Permalink
fix: creating monorepo packages post-Lerna@7
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
achrinza committed Nov 18, 2024
1 parent c9b47e2 commit e32c050
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/create-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
* 4. Run `lb4 copyright` to update `LICENSE` and copyright headers for `*.ts`
* and `*.js`.
*
* 5. Run `lerna bootstrap --scope <full-package-name>` to link its local
* 5. Run `npm install --workspace <full-package-name>` 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`
*/
Expand All @@ -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();

Expand Down Expand Up @@ -115,7 +116,6 @@ async function createPackage(name) {
await fixupProject(project);
await updateCopyrightAndLicense(project, options);
await bootstrapProject(project);
await updateTsProjectRefs({dryRun: false});

promptActions(project);
}
Expand Down Expand Up @@ -152,8 +152,8 @@ async function bootstrapProject({repoRoot, name}) {
process.chdir(repoRoot);
// Run `npx lerna bootstrap --scope @loopback/<name>`
const shell = build.runShell(
'npx',
['lerna', 'bootstrap', '--scope', `@loopback/${name}`],
'npm',
['install', '--workspace', `@loopback/${name}`],
{
cwd: repoRoot,
},
Expand Down

0 comments on commit e32c050

Please sign in to comment.