Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lerna useWorkspaces has been removed, and is incompatible with get-monorepo-packages #2488

Open
rosskevin opened this issue Jan 22, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@rosskevin
Copy link

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

@rosskevin rosskevin added the bug Something isn't working label Jan 22, 2025
@rosskevin
Copy link
Author

I PR'd the fix to azz/get-monorepo-packages#12

rosskevin added a commit to alienfast/logger that referenced this issue Jan 22, 2025
@rosskevin
Copy link
Author

PR was accepted, we just need a bump get-monorepo-packages and a patch release for auto and libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant