-
-
Notifications
You must be signed in to change notification settings - Fork 44
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(versions): support patch: versions #109
Comments
Can you expand on this please @Aghassi? I don't understand so far, what's a patch in this context? |
@JamieMason With this package https://www.npmjs.com/package/patch-package you can locally patch NPM packages if you are waiting on upstream changes, or need to modify the logic to support your use case that an upstream maintainer doesn't want to take in. This package adds |
It looks like this is something officially supported in yarn and pnpm and there's a Yarn example at https://github.com/ryanhs/yarn2-patch-example/blob/master/package.json. Because they're defined using version numbers, it's in syncpack's remit I suppose – I must admit though I'm not motivated to work on this so I'll leave it in as a low priority to look at after some of the other features have landed. Not many users use patches, but this is quite a cool thing. |
Yeah I think this is definitely a case of OSS vs Enterprise. We use patches heavily because we may be waiting on an upstream PR and need to move forward while maintaining the fix. Patches allow us to check in the fix without forking the upstream repo. I can hep contribute to this if you can point me to the relevant code spots. But I agree that it's not major, just an edge case I ran into |
Do you have any thoughts how you would resolve mismatches in these @Aghassi? In the above example I see EDIT: Maybe things like this can be lintable but not fixable, probably good enough for complicated cases. |
I haven't yet tried with pnpm but the API surface between I believe there are two scenarios:
I am biased towards I'm not sure (yet) if the syntax is standard. I'm migrating to pnpm now internally so I will have a better sense as I migrate. I agree lintable but not fixable is a good start, as well as bias towards erroring not warning. Thoughts? |
patches
files when using patch-package
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 syncpack@10.0.0, please let me know if you run into any issues. Note that for nested workspaces there is also #133 which is not yet complete. |
Description
Currently if you have different packages in a monorepo, and they aren't shared by a workspace, you need to copy paste any patches you create between them. Having a way to enforce that these patches exists and are all the same for any packages that need them would be a helpful check to keeping everything in sync.
Suggested Solution
Add a
patches
boolean that is defaulted to false, but becomes true in the next major, that let's users opt into this feature. It should respect the grouping that we already do also in the config (if there are multiple versions).Help Needed
The text was updated successfully, but these errors were encountered: