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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use lerna for more than NPM packages #834

Open
3 tasks done
StarpTech opened this issue Mar 22, 2024 · 3 comments
Open
3 tasks done

Allow to use lerna for more than NPM packages #834

StarpTech opened this issue Mar 22, 2024 · 3 comments

Comments

@StarpTech
Copy link
Contributor

Clear and concise description of the problem

Hello, we use lerna for more than NPM packages to align our release workflow. This works very well but can be quite confusing when a package.json file is inside a Go project.

Suggested solution

It would be great, if lerna would support other languages or support a more neutral way to version software. For example a yaml file with the following content could work.

release.yml

name: 'my-app'
version: '0.0.1'
hooks:
	postVersion: "gh wf run ${name}" # Trigger a GH workflow

This will be handled as a private package without publishing it to NPM. Git tags, Github releases, changelog aren't NPM specific. Based on the published tag, we can trigger the deployment. Because of the limits described in #701 we would need a way to define a hook that is executed after a release.

Alternative

Create a package.json with the propertly private:true and use scripts to hook into the release lifecycle.
I'd understand if this is not the purpose of the project but I see lerna as much more than just a handy tool for npm packages.

Additional context

We use lerna in a monorepo with a diverse technology stack https://github.com/wundergraph/cosmo

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@ghiscoding
Copy link
Member

hmm yeah this is not really the purpose of the project and is out of my league, my main goal was really to keep it updated and add a few small features but not necessary large features. I would be glad to receive PR on the subject. I have already invested a lot of time on the project already

we would need a way to define a hook that is executed after a release.

can't you just use the postpublish lifecycle script? See Lifecycle Scripts

@ghiscoding
Copy link
Member

At this point I think that the answer to this issue should be the same answer as this Lerna issue

Lerna is built on top of npm CLI internals and even when using pnpm as the package manager, it is still npm interals logic that is used for versioning and publishing. We wouldn't look to deviate from npm's way of doing things (i.e. no support for custom manifest files) as that would introduce unnecessary complexity.

I understand your reason for wanting this, but I'm afraid it's not something we will proceed with

@StarpTech
Copy link
Contributor Author

StarpTech commented Apr 13, 2024

Makes sense. I understand if you don't intend to change the scope of the project. I can only speak from my experience. We love Lerna because it helps manage all our packages. As with any monorepo, we work with more than JS/NPM, but all of them have something in common: we separate them into directories and want to version and release them through Git. Lerna isn't so far from being a tool that is specialized in NPM but also helps with a broader problem.

  • Identify project configuration (Currently, through package.json)
  • Bumps the version based on conventional-commits
  • Generate the changelog
  • Creates a github release
  • Create a tag

Publishing to NPM is just an intermediate step here.

Haven't see any tool that solve all of these problems in a nice way.

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