Skip to content

[PR available] Lerna useWorkspaces has been removed, bump get-monorepo-packages dependency and release #2488

Open
@rosskevin

Description

@rosskevin

Describe the bug

When using "@lerna-lite/cli": "^3.11.0", with "auto": "^11.3.0", execution fails due to the presence of useWorkspaces in the lerna.json.

Example

lerna ERR! ECONFIGWORKSPACES The "useWorkspaces" option has been removed. By default lerna will resolve your packages using your package manager's workspaces configuration. Alternatively, you can manually provide a list of package globs to be used instead via the "packages" option in lerna.json.

    at ChildProcess.<anonymous> (/home/runner/work/graphs/graphs/node_modules/@auto-it/core/src/utils/exec-promise.ts:76:23)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:[4](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:4)89:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)Error
    at Object.execPromise [as default] (/home/runner/work/graphs/graphs/node_modules/@auto-it/core/src/utils/exec-promise.ts:17:20)
    at Object.getLernaPackages (/home/runner/work/graphs/graphs/node_modules/@auto-it/core/src/utils/get-lerna-packages.ts:1[5](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:5):37)
    at NPMPlugin.getLernaPackages (/home/runner/work/graphs/graphs/node_modules/@auto-it/npm/src/index.ts:[6](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:6)18:12)
    at NPMPlugin.<anonymous> (/home/runner/work/graphs/graphs/node_modules/typescript-memoize/src/memoize-decorator.ts:123:36)
    at /home/runner/work/graphs/graphs/node_modules/@auto-it/npm/src/index.ts:830:46
    at eval (eval at create (/home/runner/work/graphs/graphs/node_modules/tapable/lib/HookCodeFactory.js:[7](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:7)5:10), <anonymous>:32:17)
    at new Promise (<anonymous>)
    at Hook.eval [as promise] (eval at create (/home/runner/work/graphs/graphs/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:6:[8](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:9))
    at Hook.PROMISE_DELEGATE [as _promise] (/home/runner/work/graphs/graphs/node_modules/tapable/lib/Hook.js:22:14)
    at /home/runner/work/graphs/graphs/node_modules/@auto-it/core/src/changelog.ts:3[9](https://github.com/AMN-DATA/graphs/actions/runs/5255804434/jobs/9496215088#step:15:10)7:63
Error: Process completed with exit code 1.

But, if you remove useWorkspaces to appease lerna, then we are presented with azz/get-monorepo-packages#11 bug that hasn't been updated to deal with it.

 TypeError: Cannot read properties of undefined (reading 'reduce')
    at findPackages (/home/runner/work/logger/logger/node_modules/get-monorepo-packages/index.js:17:6)
    at Object.getPackages [as default] (/home/runner/work/logger/logger/node_modules/get-monorepo-packages/index.js:37:14)
    at getMonorepoPackage (/home/runner/work/logger/logger/node_modules/@auto-it/npm/src/index.ts:157:31)
    at getPreviousVersion (/home/runner/work/logger/logger/node_modules/@auto-it/npm/src/index.ts:308:31)
    at /home/runner/work/logger/logger/node_modules/@auto-it/npm/src/index.ts:784:7
    at eval (eval at create (/home/runner/work/logger/logger/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:34:17)
    at new Promise (<anonymous>)
    at Hook.eval [as promise] (eval at create (/home/runner/work/logger/logger/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:6:8)
    at Hook.PROMISE_DELEGATE [as _promise] (/home/runner/work/logger/logger/node_modules/tapable/lib/Hook.js:22:14)
    at Auto.getCurrentVersion (/home/runner/work/logger/logger/node_modules/@auto-it/core/src/auto.ts:1702:61)

To Reproduce

  1. Use the latest lerna/auto
  2. Remove useWorkspaces from the lerna.json
  3. Run yarn auto shipit
    Expected behavior

Related package bug: azz/get-monorepo-packages#11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions