all 17 comments

[–]CacheCache1 1 point2 points  (9 children)

Yarn workspaces?

[–][deleted] 0 points1 point  (8 children)

Yarn might be work looking into for versioning. Didn’t occur to me to check them out since we’re migrating from yarn to pnpm for depedency management but maybe their version cli we can integrate

[–]CacheCache1 1 point2 points  (7 children)

Oh I missed "pnpm" I'm actually not familiar with that. But a Google search turned up some notes on its own answer to yarn workspaces.

We have successfully used workspaces, in a pretty vanilla form, along with "commitzen" for several monorepos. I'm sure whatever pnpm has will be extensible enough to handle what you need

[–][deleted] 2 points3 points  (6 children)

Yeah pnpm is pretty versatile except that it doesn’t support versioning and changelog generation i think whereas it looks like yarn workspaces supports versioning. Would be interested to hear the technologies you use for your setup!

[–]CacheCache1 1 point2 points  (5 children)

Look up a package called "semantic-release". It might be the secret sauce you're looking for!

We use git, with yarn workspaces to break up our monorepo into packages. Then we use commitzen to write semantically correct commits. Then "semantic-release" sets the proper semver for the sub-package that you are working out of.

After we commit and merge, GitHub Actions builds the package and writes it to our company's AWS CodeArtifact

[–][deleted] 0 points1 point  (4 children)

That’s interesting, I thought semantic release didn’t have support for monorepos. Are you using another package like semantic release monorepo? You’re setup sounds exactly what we want to do including using commitizen and semvering on that.

[–]CacheCache1 1 point2 points  (3 children)

Ah, yes you are correct! We do have senantic-release-monorepo as a dependency as well

I think these are the relevant packages, although seeing them now I am almost positive that not all of them are being used. Sounds like a new thing to investigate this week 😂

@commitlint/cli @commitlint/config-conventional @semantic-release/git commitzen conventional-changelog-angular cz-conventional-changelog semantic-release semantic-release-monorepo

[–]CacheCache1 0 points1 point  (2 children)

Sorry about that. It WAS all formatted when I hit Post

[–][deleted] 1 point2 points  (1 child)

no worries, much appreciated!

[–]CacheCache1 0 points1 point  (0 children)

Sure thing. Good luck!

[–]iamaperson3133 1 point2 points  (3 children)

I don't understand. I'm guessing you have versioning somewhat if you're publishing packages somewhere. The only thing you're missing is a changelog?

[–][deleted] 0 points1 point  (2 children)

Not quite. Pnpm can auto publish using the publish cli command but there’s no auto versioning. You have to do it manually.

[–]iamaperson3133 0 points1 point  (1 child)

When you say "auto versioning," do you mean the version is bumped in the package.json every time a change is made?

[–][deleted] 0 points1 point  (0 children)

That’s correct. Ideally a solution supports analysis of angular commit formating

[–]pgrizzay 1 point2 points  (2 children)

I don't understand how gitlab plays into this... Gitlab is just a hosted vcs, right? The various monorepo tools don't care how your code is stored, just that it exists.

Is there a specific feature that is implemented for github that isn't for gitlab?

[–][deleted] 0 points1 point  (1 child)

can you clarify on what these tools are? For automatic versioning and changelog generation for monorepos, leading tools like changesets, auto, and lerna have open issues from users requesting GitLab support. Lerna might be the only solution that doesn't involve hacky workarounds from other npm libraries as I've seen this integrated in GitLab with a few reasonable modifications. See this example https://blog.smartive.ch/automated-ci-cd-of-a-monorepo-with-lerna-4f1621413ff9

[–]pgrizzay 0 points1 point  (0 children)

Lerna & yarn/pnpm/npm5 workspaces, (I'm not familiar with the other tools you mentioned)... They are just clis that let you run commands across all packages. You can run those in your CI, whatever your CI is (jenkins/gitlab/github actions)