Custom self-set version of package? #2429
-
Hey all, Trying to figure out how to appropriately set our package versions while developing shared CDK constructs. While developing, we are using another project as a consumer project to test if everything works as intended. We wish to publish tags only for production releases (versions that are used by other people), and to release custom versions while developing onto our private npm repository without pushing new tags on our Git. For example, ideally would be : So while developing, every time we push new version onto our feature branch, new version would be released and it would look like :
This would allow us not to "dirty" our Git until we release to production and to allow us to increment versions uniquely per feature and ticket number to make sure our consumer projects can use them if needed. Any recommendation on how to do this (or if it is even possible)? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Ideally if we could somehow set a version for next release in |
Beta Was this translation helpful? Give feedback.
-
projen's release system is definitely not setup for this. 😅 But there are ways to work around it. This will set a version to an explicit string: project.package.addVersion('1.2.3-banana'); Now build should give you a releaseable artifact with the correct version number, somewhere in projen build Finally you need to adjust the release workflows and/or tasks to only do something like npm publish dist/js/my-package-1.2.3-banana.tgz Let me know if that works for you! |
Beta Was this translation helpful? Give feedback.
-
This is what we do in the
|
Beta Was this translation helpful? Give feedback.
projen's release system is definitely not setup for this. 😅 But there are ways to work around it.
This will set a version to an explicit string:
Now build should give you a releaseable artifact with the correct version number, somewhere in
dist
:projen build
Finally you need to adjust the release workflows and/or tasks to only do something like
npm publish dist/js/my-package-1.2.3-banana.tgz
Let me know if that works for you!