-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
package.version triggers a mismatch when using workspace:* protocol #238
Comments
@JamieMason That indeed fixes it! Thank you! My head swims thinking through how |
Great, this is what the config is trying to do:
Instead of writing out all the dependency names we use these keywords, a bit like variables. When you use |
Elegant! |
Hey @JamieMason, I'm using Turbopack on my monrepo, with bun as a package manager, and yet I'm not able to make it work with the solution you propose. Here's an example output: = Default Version Group ========================================================
...
3x @monorepo/actions:
✘ workspace:* → 0.0.0 [LocalPackageMismatch]
... My // @ts-check
/** @type {import("syncpack").RcFile} */
const config = {
versionGroups: [
{
label: 'Use workspace protocol when developing local packages',
dependencies: ['$LOCAL'],
dependencyTypes: ['!local'],
pinVersion: 'workspace:*'
}
]
};
module.exports = config; Any idea? Currently running |
Hmm, even though I'm using a name specified here at the root level, somehow, unless I use the Edit: seems to only work with |
I wonder if it is similar to this problem, where an error is happening in the config but is not being surfaced yet.
|
Well, working with |
Great, my best guess is maybe there was some ESM issue going on that syncpack is swallowing (will be fixed in #229), but I'm not sure. |
Description
In a monorepo using
pnpm
, each package has its ownpackage.json
file that lists its current version in theversion
field and depends on another package using theworkspace:*
protocol:/packages/a/package.json
/packages/b/package.json
With the following modified example config (modified to include non-dev dependencies as well):
/.syncpackrc
When running
syncpack
this is identified as a mismatch:Even more excitingly, if
sync fix-mismatches
is run, the the@app/a
package.json
is updated thus:/packages/a/package.json
Suggested Solution
If I am correctly understanding what is going on, then the
package.version
field should not be identified as a mismatch -- only the dependency versions should be. That is, it should be fine for local packages to maintain their own versioning within the monorepo, but the other packages should not be depending on a specific version (per.syncpackrc
) but instead depend only on `workspace:*.And
fix-mismatches
should not update theversion
field of a package, since that is an information source, not a dependency.Help Needed
It is entirely possible that I'm misunderstanding what
syncpack
is reporting, but I think this is a bug and not desired behavior?The text was updated successfully, but these errors were encountered: