feat: support version prefixes for dependencies#49
feat: support version prefixes for dependencies#49lostpebble merged 2 commits intolostpebble:masterfrom
Conversation
Add support for using version prefixes (^, ~, >=, <=, =, >, <, *, latest)
in basePackageValues. When a prefix is used instead of an explicit version,
the plugin will resolve the installed version from node_modules and prepend
the specified prefix to it.
This allows for cleaner configuration and enables single-source-of-truth
for dependency versions while maintaining flexibility in version constraints.
Example usage:
dependencies: {
'axios': '^', // resolves to '^1.13.5' if that's the installed version
'lodash': '~', // resolves to '~4.17.21' if that's the installed version
}
|
Hi @pcorpet, Thanks for this- it makes sense (I've removed my previous comment on this). I'll review it and merge it soon if all looks good 👌 |
|
Hi Paul, thanks for your message. Anything I can do to help move thins one forward? |
|
Actually, I'm not really using webpack anymore- would you mind if I added you as a "maintainer" to this and the NPM package? So that you can continue to push things as you please. I'll still look at this right now, but just thought I'd ask. |
|
Oh that's nice to suggest. Unfortunately I'm a vite user myself and I came here because of another tool I use is using webpack internally (OpenAPITools/openapi-generator-cli#796). However I used to be a webpack user, and also totally understand the load of maintaining OpenSource libraries alone. So without taking any strong participation or leadership, I could be a deputy owner to help you. |
Yea sure, that's totally fine with me. I wouldn't expect you to do much at all (I'm not doing much myself) - but at least it seems you are using Webpack indirectly, and at least took the time to make this PR- so that's something. It could definitely help both of us in the future haha. I'll add you now- sorry, still looking at your PR- just got a bit side-tracked this afternoon. EDIT: Btw, I've also moved on to Vite 😄 |
|
Thanks for this! Just added a comment based on my initial confusion on reading the code. |
|
This is available in |
Use the recent improvement of lostpebble/generate-package-json-webpack-plugin#49 to propagate a caret version of the axios dep in the released package. Fixes OpenAPITools#796
Use the recent improvement of lostpebble/generate-package-json-webpack-plugin#49 to propagate a caret version of the axios dep in the released package. Fixes #796
Add support for using version prefixes (^, ~) in basePackageValues. When a prefix is used instead of an explicit version, the plugin will resolve the installed version from node_modules and prepend the specified prefix to it.
This allows for cleaner configuration and enables single-source-of-truth for dependency versions while maintaining flexibility in version constraints.
Example usage:
dependencies: {
'axios': '^', // resolves to '^1.13.5' if that's the installed version
'lodash': '~', // resolves to '~4.17.21' if that's the installed version
}