Skip to content

feat: support version prefixes for dependencies#49

Merged
lostpebble merged 2 commits intolostpebble:masterfrom
pcorpet:feature/version-prefix-support
Feb 25, 2026
Merged

feat: support version prefixes for dependencies#49
lostpebble merged 2 commits intolostpebble:masterfrom
pcorpet:feature/version-prefix-support

Conversation

@pcorpet
Copy link
Contributor

@pcorpet pcorpet commented Feb 11, 2026

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
}

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
  }
@lostpebble
Copy link
Owner

lostpebble commented Feb 12, 2026

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 👌

@pcorpet
Copy link
Contributor Author

pcorpet commented Feb 24, 2026

Hi Paul, thanks for your message. Anything I can do to help move thins one forward?

@lostpebble
Copy link
Owner

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.

@pcorpet
Copy link
Contributor Author

pcorpet commented Feb 25, 2026

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.

@lostpebble
Copy link
Owner

lostpebble commented Feb 25, 2026

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 😄

@lostpebble lostpebble merged commit feda9d7 into lostpebble:master Feb 25, 2026
@lostpebble
Copy link
Owner

Thanks for this! Just added a comment based on my initial confusion on reading the code.

@lostpebble
Copy link
Owner

This is available in 2.7.0 now

@pcorpet pcorpet deleted the feature/version-prefix-support branch February 25, 2026 20:01
pcorpet added a commit to pcorpet/openapi-generator-cli that referenced this pull request Feb 25, 2026
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
wing328 pushed a commit to OpenAPITools/openapi-generator-cli that referenced this pull request Feb 26, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants