what's the right approach for the root monorepo package and updateInternalDependencies with pnpm ?
See original GitHub issueour monorepo package.json
depends on some of the packages in the monorepo (a jest config preset), so yesterday when i made some changes to the jest config preset package, it didn’t update our root package.json. and as a result all our apps triggered a failed CodeBuild deployment due to pnpm install
failing (due to the root package jest preset dep version not being bumped).
I’ve found that if i update our pnpm-workspace.yaml
to describe the root package as a monorepo package, then changesets now updates the root package.
Without pnpm-workspace.yaml
change
repo/
package.json
name: @reckon-web/repo
deps:
@reckon-web/jest-preset: 0.0.2
apps/
something:
package.json
name: @reckon-web/something-app
deps:
@reckon-web/jest-preset: 0.0.2
packages/config/
jest-preset/
package.json
name: @reckon-web/jest-preset
version: 0.0.2
If i do a changeset like :
---
"@reckon-web/jest-preset": "patch"
---
something something something darkside
then i end up with:
repo/
package.json
name: @reckon-web/repo
deps:
@reckon-web/jest-preset: 0.0.2
apps/
something:
package.json
name: @reckon-web/something-app
deps:
@reckon-web/jest-preset: 0.0.3
packages/config/
jest-preset/
package.json
name: @reckon-web/jest-preset
version: 0.0.3
if i change pnpm-workspace.yaml
from :
packages:
- 'packages/**'
- 'design-system/packages/*'
- 'design-system/storybook'
- 'design-system/website'
- 'apps/*'
- 'services/*'
- 'runbooks'
- 'infrastructure'
to
packages:
- '.'
- 'packages/**'
- 'design-system/packages/*'
- 'design-system/storybook'
- 'design-system/website'
- 'apps/*'
- 'services/*'
- 'runbooks'
- 'infrastructure'
then the above changeset resuts in :
repo/
package.json
name: @reckon-web/repo
deps:
@reckon-web/jest-preset: 0.0.3
apps/
something:
package.json
name: @reckon-web/something-app
deps:
@reckon-web/jest-preset: 0.0.3
packages/config/
jest-preset/
package.json
name: @reckon-web/jest-preset
version: 0.0.3
Is this the right approach? or should we talk about supporting this via changesets configuration ?
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
This would be really helpful for me as well, this is my scenario:
devtools
repository where I am hosting my prettier, eslint, etc configs.devtools
repository has a prettier config.package.json
manypkg check
before pushSo, after running
changeset version
, everything works fine, except for the push part, since my config package bumped its version and it didn’t get updated in the rootpackage.json
, it throws an error.A workaround I am doing is to run
manypkg fix
afterchangeset version
and then removing the generatedyarn.lock
(since I’m using NPM), but that feels hacky.Ok, so to sum up - the proposed change is to just update dependency ranges in
<root>/package.json
regardless of the list of workspace packages. Would this change alone fix your problem? Do you want to work on a fix?