Geocld / sparkee

A publish tool for monorepo,just like lerna but support pnpm.
3 stars 0 forks source link

proposal: drop git-cliff #16

Open jrson83 opened 1 year ago

jrson83 commented 1 year ago

Proposal

So at first I thought git-cliff is cool. But there are multiple reasons I would prefer to drop git-cliff and write the changelog generator by ourselfs.

Git-cliff

  1. It's complicated
  2. The templates are horrible
  3. The template syntax is horrible
  4. It does not work with monorepo at the moment though
  5. Additional config file

Configuration files

Before using git-cliff, it was possible to configure the changelog generator using spark.json logPresetTypes. Now in addition to spark.conf you need another .toml configuration file.

At the moment, the spark.json is actually obsolete, since it holds only two options:

Those options are resolved on init either using package.json or pnpm-workspace.yaml. When keeping git-cliff it would make sense to drop spark.json and resolve the options at run time, from package.json or pnpm-workspace.yaml.

Solution

It would be great if you willing to drop git-cliff and replace it with a custom changelog generator. I be willing to implement the changelog generator.

Geocld commented 1 year ago

@jrson83 I agree with your perspective. I have also been using git-cliff in a simple manner before, but I didn't realize it had so many issues. I have thought about developing my own git log generation application, and currently, it seems to be the most reasonable and efficient solution. If we develop this application, I would be delighted to work on it with you because I have a strong interest in git myself and am looking forward to creating a git-related application. Here are a few suggestions from my side:

  1. Git log generation involves working with large text operations, and using JavaScript alone may lead to performance issues. Have you considered using Rust for development? Many Node applications have been redeveloped in Rust to achieve better performance.
  2. This project is independent of Sparkee, and perhaps it can also be used by other applications.

Additionally, I think the proposal for removing spark.json makes sense. Let's remove it in the next version.

jrson83 commented 1 year ago

@Geocld I don't know rust. But in Node.js the right approach would be to use streams.

Node.js can only hold up to 1.67GB in memory at any one time, after that, it throws a JavaScript heap out of memory error.

I recommend reading this post on A Performance Comparison of Node.js Methods for Reading Large Datasets


I have found the problem what causes the multiple issues I opend. Is it possible you please give me access to the repo, to commit to the main branch? So I do not need to wait for PR merge.

Geocld commented 1 year ago

@jrson83 Good jobs! I had Invited you to this repo collaborators.

jrson83 commented 1 year ago

@Geocld Thank you! I will open a new issue to describe the problem, since #14 & #15 come from the same problem. Then I will push the fix.

jrson83 commented 1 year ago

@Geocld I checked again the issue with monorepo #13. I now understand what problem you had and that you used the current body for monorepo in javascript, to get the package name. I was looking for a secure approach to get the github URL of the repo, but like you see in this issue, there is only a static way, to define the repo to get auto links work, like you do here.

I think this is really bad, especially sparkee is build for monorepo, but git-cliff does not properly support monorepo.

would be delighted to work on it with you

Thank you!

This project is independent of Sparkee

So you mean an independent package, but sparkee can use that package internally to generate a changelog? That would be a good idea!

So we could build a monorepo and create that new changelog package and include sparkee as standalone package, which has changelog as dependency. Then we can use a bundler like ptsup to minimize and optimize bundle size of the packages.

Can you please release a new version of sparkee, so we can test if it is working.

Geocld commented 1 year ago

@jrson83 New commits had published in v1.3.1.

jrson83 commented 1 year ago

@Geocld can I restrict the package manager for sparkee repo to pnpm? Guess we use pnpm but in the spark.json it is still npm.

EDIT: OK I just did :grin:

Can you please release next version 💌

Geocld commented 1 year ago

@jrson83 Good jobs! 1.3.2 had published.