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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(versions): support link: versions #114

Closed
bombillazo opened this issue Feb 13, 2023 · 3 comments
Closed

fix(versions): support link: versions #114

bombillazo opened this issue Feb 13, 2023 · 3 comments

Comments

@bombillazo
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch syncpack@8.5.14 for the project I'm working on.

I added this line to my build process since syncpack would fail if a local package was used. We can identify local packages with link: or using a local directory in the path.

Here is the diff that solved my problem:

diff --git a/node_modules/syncpack/dist/bin-fix-mismatches/fix-mismatches.js b/node_modules/syncpack/dist/bin-fix-mismatches/fix-mismatches.js
index 2909484..f34cae0 100644
--- a/node_modules/syncpack/dist/bin-fix-mismatches/fix-mismatches.js
+++ b/node_modules/syncpack/dist/bin-fix-mismatches/fix-mismatches.js
@@ -11,6 +11,7 @@ function fixMismatches(ctx) {
         // Set the correct version on each instance.
         invalidGroups.forEach(function (instanceGroup) {
             var nextVersion = instanceGroup.getExpectedVersion();
+            if(!nextVersion || nextVersion.includes('link:') || nextVersion.substring(0,2) === './') return;
             instanceGroup.instances.forEach(function (instance) {
                 return instance.setVersion(nextVersion);
             });

This issue body was partially generated by patch-package.

@JamieMason
Copy link
Owner

Thanks a lot @bombillazo that's great

@bombillazo
Copy link
Author

Some testing may be required but its a start 馃榿

@JamieMason JamieMason changed the title Allow local packages to match fix(local): allow local packages to match May 28, 2023
@JamieMason JamieMason changed the title fix(local): allow local packages to match fix(versions): support link: filepaths May 28, 2023
@JamieMason JamieMason changed the title fix(versions): support link: filepaths fix(versions): support link: versions May 28, 2023
JamieMason added a commit that referenced this issue May 28, 2023
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.
JamieMason added a commit that referenced this issue May 28, 2023
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.
JamieMason added a commit that referenced this issue May 28, 2023
### #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.
@JamieMason
Copy link
Owner

Released in syncpack@10.0.0, please let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants