Skip to content

Commit

Permalink
feat: Renamed gitversion to gitbump
Browse files Browse the repository at this point in the history
  • Loading branch information
joostvdwsd committed Aug 15, 2024
1 parent a5595d5 commit d1d28ac
Show file tree
Hide file tree
Showing 92 changed files with 1,948 additions and 1,436 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: yarn

- name: Bump
run: yarn gitversion bump
run: yarn gitbump bump

- name: Build 🔧
run: yarn build:all
Expand All @@ -38,10 +38,10 @@ jobs:
role-session-name: upload-docs
aws-region: eu-west-1

- name: Publish
run: yarn gitversion publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# - name: Publish
# run: yarn gitbump publish
# env:
# NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}


2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#!.yarn/cache
.pnp.*
coverage
gitversion.out
gitbump.out
lib
tsconfig.tsbuildinfo

Expand Down
8 changes: 4 additions & 4 deletions .gitversion.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { defineConfig } = require("@cp-utils/gitversion");
const { S3Publish } = require('@cp-utils/gitversion-s3publish');
const { defineConfig } = require("gitbump");
const { S3Publish } = require('gitbump-s3publish');

module.exports = defineConfig({
independentVersioning: false,
Expand All @@ -9,8 +9,8 @@ module.exports = defineConfig({
bucketName: 'www-cputils-com-website-docspublishbucket31a61f6d-pixklxvi0wye',
baseFolder: 'docs',
fileNameTemplate: [
'gitversion/{version.major}.{version.minor}.x.zip',
'gitversion/{releaseChannel}.zip',
'gitbump/{version.major}.{version.minor}.x.zip',
'gitbump/{releaseChannel}.zip',
],
exclude: [
".vitepress",
Expand Down
256 changes: 128 additions & 128 deletions CHANGELOG.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to gitversion
# Contributing to gitbump

Nice of you to join te gitversion repository. In order to get started I'd like to explain the basic setups of the repo
Nice of you to join te gitbump repository. In order to get started I'd like to explain the basic setups of the repo

You can read about the way gitversion works at [the documentation site](https://www.cp-utils.com/projects/gitversion/).
You can read about the way gitbump works at [the documentation site](https://www.cp-utils.com/projects/gitversion/).

## Getting started

Expand All @@ -18,11 +18,11 @@ $ yarn
Verify if everything works as expected:

``` sh
$ yarn gitversion check
$ yarn gitversion bump
$ yarn gitversion pack
$ yarn gitversion publish --dry-run
$ yarn gitversion reset
$ yarn gitbump check
$ yarn gitbump bump
$ yarn gitbump pack
$ yarn gitbump publish --dry-run
$ yarn gitbump reset
```

## Repo setup
Expand All @@ -31,7 +31,7 @@ The repository setup has the following key elements:

- [yarn 4 (berry) package manager](#yarn)
- [Typescript only](#typescript)
- [Gitversion release](#gitversion)
- [Gitbump release](#gitbump)
- [Jest based unit testing](#jest)
- [Eslint linter](#eslint)

Expand All @@ -46,15 +46,15 @@ We also use yarn [constraints](https://yarnpkg.com/features/constraints) for con

All source code in the repo is [typescript](https://www.typescriptlang.org/). The only exception for this are (small) configuration files.

There should never be any need to have any javascript available during development time. The only time we have javascript is during the pack command of the actual production package. You can see this in action in [workspaces/packages/gitversion/package.json](workspaces/packages/gitversion/package.json) where we have basically this:
There should never be any need to have any javascript available during development time. The only time we have javascript is during the pack command of the actual production package. You can see this in action in [workspaces/packages/gitbump/package.json](workspaces/packages/gitbump/package.json) where we have basically this:

```json
"scripts": {
"prepack": "tsc --noEmit false", // Execute typescript with the option to emit teh output before we pack
"postpack": "rm -rf lib" // Remove the generated files to cleanup the workspace
}
```
And we use this to be able to use gitversion itself in typescript mode:
And we use this to be able to use gitbump itself in typescript mode:
```json
"bin": "bin/index-typescript.js",
"main": "src/index.ts",
Expand All @@ -66,9 +66,9 @@ And we use this to be able to use gitversion itself in typescript mode:
},
```

### Gitversion
### Gitbump

Of course we use gitversion itself in the repo. We use it in the default mode and execute it with the above helpers in combination with [ts-node](https://www.npmjs.com/package/ts-node)
Of course we use gitbump itself in the repo. We use it in the default mode and execute it with the above helpers in combination with [ts-node](https://www.npmjs.com/package/ts-node)

### Jest

Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Gitversion
# Gitbump

Gitversion is a complete customizable git-based release management system. Primarily focused on package releases.
Gitbump is a complete customizable git-based release management system. Primarily focused on package releases.

![NPM Version](https://img.shields.io/npm/v/%40cp-utils%2Fgitversion)
![NPM Version](https://img.shields.io/npm/v/gitbump)

## Key concepts

Expand All @@ -17,9 +17,9 @@ Gitversion is a complete customizable git-based release management system. Prima

### Branch based release strategy

The core concept of gitversion evolves around branch detection and branch types.
The core concept of gitbump evolves around branch detection and branch types.

Gitversion defines the following types:
Gitbump defines the following types:
- main/master branch (default branch name **'main'**)
- release branches (default matches **'release/*'**)
- feature branches (default matches **'feature/*'**)
Expand All @@ -38,48 +38,48 @@ Depending on the detected branch types the system will make different choices:
### Tag based versioning

Like most release systems gitversion will add a tag for each release. This will follow the tag naming with a prefix (default 'v'). I.e.
Like most release systems gitbump will add a tag for each release. This will follow the tag naming with a prefix (default 'v'). I.e.

- v1.0.0
- v1.2.3-next.0

The difference of gitversion is that the tags are the only source of truth. It does not care about versions inside files and will keep them even on the default "0.0.0".
The difference of gitbump is that the tags are the only source of truth. It does not care about versions inside files and will keep them even on the default "0.0.0".

There are two main advantages of this strategy:

- One source of truth. Easy to see in git history what the current state is
- No more merge conflicts due to mismatches of versions. Otherwise this will happen constantly with feature/release strategies

Gitversion has 2 commands to work with this git-only version strategy:
Gitbump has 2 commands to work with this git-only version strategy:

#### Restore
```bash
yarn gitversion restore
yarn gitbump restore
```

The output will be something like:

![gitversion restore](./assets/restore.png)
![gitbump restore](./assets/restore.png)

As you see with this you wil get all versions back in package.json files.

#### Reset
```bash
yarn gitversion reset
yarn gitbump reset
```

The output will be something like:

![gitversion reset](./assets/reset.png)
![gitbump reset](./assets/reset.png)

As you see with this you wil reset all versions back to '0.0.0'.

### Conventional commit based bumps

Gitversion works with the concept of a "bump". This is one of the key commands:
Gitbump works with the concept of a "bump". This is one of the key commands:

```bash
yarn gitversion bump
yarn gitbump bump
```

Bump will do the following steps:
Expand All @@ -89,11 +89,11 @@ Bump will do the following steps:
- Define a bump type based on the outcome
- Update the workspaces with the new version
- Udate the workspaces with the workspace specific changelogs
- Create a bump manifest in the **gitversion.out** folder containing versions and changelogs
- Create a bump manifest in the **gitbump.out** folder containing versions and changelogs

### Native monorepo support

Gitversion is build for monorepos with multiple workspaces. It will detect all (public) workspaces and use them during bump.
Gitbump is build for monorepos with multiple workspaces. It will detect all (public) workspaces and use them during bump.

There are 2 main operation modes:
- [global versioning](#Global-versioning)
Expand All @@ -109,8 +109,8 @@ This will use unique versions per workspace in the mono repo. Based on the path

### Split stage publish

Gitversion is buld for usage within CI/CD pipelines. When building packages gitversion can be used in a pipeline like this:
Gitbump is buld for usage within CI/CD pipelines. When building packages gitbump can be used in a pipeline like this:

![Pipeline](./assets/pipeline.png)

This will allow you to run your time consuming steps in parallel with your build step. Only when all checks pass you have a (quick) publish stage.
This will allow you to run your time consuming steps in parallel with your build step. Only when all checks pass you have a (quick) publish stage.
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const sidebar = await import('../sidebar.mjs');

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Testing gitversion docs",
title: "Testing gitbump docs",
description: "A VitePress Site",
themeConfig: {
nav: [
{ text: 'Gitversion', link: '/tutorials/getting-started' },
{ text: 'Gitbump', link: '/tutorials/getting-started' },
],

sidebar: sidebar.sidebar
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Bump will do the following steps:
- Define a bump type based on the outcome
- Update the workspaces with the new version
- Udate the workspaces with the workspace specific changelogs
- Create a bump manifest in the **gitversion.out** folder containing versions and changelogs
- Create a bump manifest in the **gitbump.out** folder containing versions and changelogs

### Native workspace/monorepo support {#monorepo}

Expand Down
16 changes: 8 additions & 8 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gitversion currently searches for the following file:
This has to be a commonjs file with the following basics:
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
// configuration options
Expand Down Expand Up @@ -52,7 +52,7 @@ Changelogs are always generated on a per workspace base. Therefor independent ve
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
independentVersioning: true
Expand Down Expand Up @@ -83,7 +83,7 @@ See more about branch types in [working with branches](../how-to/working-with-br
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
featureBumpBehavior: 'always'
Expand All @@ -110,7 +110,7 @@ See more about branch types in [working with branches](../how-to/working-with-br
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
mainBranchPatterns: [
Expand Down Expand Up @@ -140,7 +140,7 @@ See more about branch types in [working with branches](../how-to/working-with-br
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
releaseBranchPatterns: [
Expand Down Expand Up @@ -171,7 +171,7 @@ See more about branch types in [working with branches](../how-to/working-with-br
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
featureBranchPatterns: [
Expand All @@ -198,7 +198,7 @@ This will be used by all permanent actions to only run the logic without actuall
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
dryRun: true
Expand All @@ -219,7 +219,7 @@ Every tag in gitversion is prefixed. By default this is 'v' to get 'v1.0.0'. You
::: details Example .gitversion.cjs
```js
const { defineConfig } = require("@cp-utils/gitversion");
const { defineConfig } = require("gitbump");
module.exports = defineConfig({
versionTagPrefix: 'version-'
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebar.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const sidebar = [
{
text: 'Gitversion', items: [
text: 'Gitbump', items: [
{ text: 'Introduction', link: '/' },
{ text: 'Getting started', link: '/tutorials/getting-started' },
{ text: 'Configuration', link: '/reference/configuration' },
Expand Down
Loading

0 comments on commit d1d28ac

Please sign in to comment.