-
-
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
feat(semver): support ranges for workspace dependencies #124
Comments
On an initial glance it may be enough just to remove this line
It was an assumption I had that the version would/should always exactly match given the origin of that package is there in the same monorepo. |
Did you mean this line?
I made that change locally and ran it against this repo/branch (with some further updates to the config), and still got errors. This is the config I used. It also gave the exact same results without the
Sample of the errors:
|
No problem I'll take a look |
I've done some work on this, I'm on holiday next week but the next release will include it. I've been thinking that - export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~';
+ export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~' | 'workspace:'; |
Thanks! I guess I should have clarified that by "workspace dependencies" I assumed it meant just "packages defined within the same workspace." I haven't personally used the |
I generally use My syncpack config ended up ignoring |
My bad, I keep confusing the various things "workspace" can refer to. Ok, I think I have a fix for this locally but it's not everything you're looking for. It will allow ranges to be used when you depend on a package which is developed locally, but those range versions will need to be identical to each other as per current syncpack behaviour. At a later date though hopefully #128 can deliver some support for ranges being satisfied.
I'm tempted to limit support to only
Can you create an issue for this scenario so it can be looked into? Thanks both |
Closes #124 When using the `workspace` dependency type, packages installing that dependency no longer have to exactly match the `version` property of the package.json of origin. If the version or version range used by every dependent package matches, it is considered valid. Closes #130 JavaScript config files now have support for TypeScript IntelliSense. https://jamiemason.github.io/syncpack/config-file#typescript-intellisense Closes #114 Refs #109 Refs #125 Unsupported versions can now at least be managed via `pinVersion`, where previously anything which was not valid semver would be ignored. Refs #111 Refs #132 TypeScript IntelliSense support helps catch invalid config, but more work is needed to display useful error messages at runtime. Refs #48 Refs #3 Syncpack's internals are now better organised, so providing a Node.js API and general lint and fix CLI commands are now closer to being released. BREAKING CHANGES: Although they are still not auto-fixable, unsupported versions which were previously ignored are now acknowledged, which may introduce mismatches which previously would have been considered valid. This release was also a huge rewrite of Syncpack's internals and, while there is a large amount of tests, some scenarios may have been missed. If you run into any problems, please create an issue.
Closes #124 When using the `workspace` dependency type, packages installing that dependency no longer have to exactly match the `version` property of the package.json of origin. If the version or version range used by every dependent package matches, it is considered valid. Closes #130 Closes #131 JavaScript config files now have support for TypeScript IntelliSense. https://jamiemason.github.io/syncpack/config-file#typescript-intellisense Closes #114 Refs #109 Refs #125 Unsupported versions can now at least be managed via `pinVersion`, where previously anything which was not valid semver would be ignored. Refs #111 Refs #132 TypeScript IntelliSense support helps catch invalid config, but more work is needed to display useful error messages at runtime. Refs #48 Refs #3 Syncpack's internals are now better organised, so providing a Node.js API and general lint and fix CLI commands are now closer to being released. BREAKING CHANGES: - `fix-mismatches` will now exit with a status code of 1 if there are mismatches among unsupported versions which syncpack cannot auto-fix. - Although they are still not auto-fixable, unsupported versions which were previously ignored are now acknowledged, which may introduce mismatches which previously would have been considered valid. - This release was also a huge rewrite of Syncpack's internals and, while there is a large amount of tests, some scenarios may have been missed. - If you run into any problems, please create an issue.
### #124 When using the `workspace` dependency type, packages installing that dependency no longer have to exactly match the `version` property of the package.json of origin. Closes #124 If the version or version range used by every dependent package matches, it is considered valid. ### #130, #131 JavaScript config files now have support for TypeScript IntelliSense. Closes #130 Closes #131 https://jamiemason.github.io/syncpack/config-file#typescript-intellisense ### #109, #114, #125 Unsupported versions can now at least be managed via `pinVersion`, where previously anything which was not valid semver would be ignored. Closes #114 ### #111, #132 TypeScript IntelliSense support helps catch invalid config, but more work is needed to display useful error messages at runtime. ### #48, #3 Syncpack's internals are now better organised, so providing a Node.js API and general lint and fix CLI commands are now closer to being released. BREAKING CHANGE: - `fix-mismatches` will now exit with a status code of 1 if there are mismatches among unsupported versions which syncpack cannot auto-fix. - Although they are still not auto-fixable, unsupported versions which were previously ignored are now acknowledged, which may introduce mismatches which previously would have been considered valid. - This release was also a huge rewrite of Syncpack's internals and, while there is a large amount of tests, some scenarios may have been missed. - If you run into any problems, please create an issue.
Released in [email protected], please let me know if you run into any issues. |
Description
Unless I'm missing something, syncpack only seems to support exact versions for workspace dependencies.
Sometimes it would be helpful to have the option of allowing a range, but verifying that the range matches the current version. Some example scenarios:
*
^x.y.z
(this can reduce duplication for consumers if they depend on multiple packages from the repo)The behavior with this setting enabled would be that given a workspace package with version
1.2.3
:^1.0.0
,~1.2.0
,*
, etc^0.9.0
,^1.3.0
,~1.1.0
, etc (or inconsistent semver spec)Suggested Solution
I'm not sure exactly where this should fit into the config. The most obvious thing I could think of (which I tried before filing this) is putting it in
semverGroups
like this:Help Needed
I might be able to implement this if you point to the right place.
The text was updated successfully, but these errors were encountered: