@deviceinsight/ng-ui-api-client 10.57.0 → 10.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,13 +56,11 @@ npx yalc link "@deviceinsight/ng-ui-api-client"
56
56
 
57
57
  # CI
58
58
 
59
- `.gitlab-ci.yml` installs the dependencies and then runs `scan`, `lint` and
60
- `typecheck` on every branch except `main`. The `publish` job runs for `develop` and
61
- for tags: `-SNAPSHOT` versions are published to the internal Nexus registry under the
62
- `next` tag, releases go to the public npm registry. A release older than the currently
63
- published `latest` is published under a `hotfix-<major>.<minor>` tag so that `latest`
64
- is not moved backwards. `publish_alpha` is a manual job that always publishes to the
65
- internal registry under `next`.
59
+ `.gitlab-ci.yml` installs the dependencies and then runs `lint` and `typecheck` on every branch except `main`.
60
+ The `audit` job (`npm run scan`) only runs on `develop`, `feature/*` and `renovate/*` branches, so hotfixes and tags are not blocked by it.
61
+ The `publish` job runs for `develop` and for tags: `-SNAPSHOT` versions are published to the internal Nexus registry under the `next` tag, releases go to the public npm registry.
62
+ A release older than the currently published `latest` is published under a `hotfix-<major>.<minor>` tag so that `latest` is not moved backwards.
63
+ `publish_alpha` is a manual job that always publishes to the internal registry under `next`.
66
64
 
67
65
  # Releasing the library using git flow
68
66
 
@@ -80,75 +78,54 @@ If not, execute `git checkout main`.
80
78
  Run `git flow init` and answer every question with the default (press Enter/Return).
81
79
  The script verifies that the branches are named `main` and `develop`.
82
80
 
83
- ## Building a release
81
+ ## Releasing the develop branch
84
82
 
85
- To build a release of this library, execute `./release.sh`, which consists of the following steps:
83
+ Run the release script from the repository root:
86
84
 
87
- ### Before the release: Check for vulnerabilities
88
-
89
- Vulnerabilities can occur at any time.
90
- To be sure, the pipeline for the branches and the tags created
91
- in the release process will not fail, the script runs the checks locally before building the
92
- release:
93
-
94
- ```
95
- npm install
96
- npm --registry=https://registry.npmjs.org audit
85
+ ```shell
86
+ ./release.sh
97
87
  ```
98
88
 
99
- If `package-lock.json` changed during the install, the script commits it.
100
-
101
- ### Building the release
102
-
103
- 1. Switch to develop branch and make sure both main and develop are current:
104
-
105
- `git checkout develop && git pull && git fetch origin main:main`
106
-
107
- The script also aborts if the workarea is dirty or if `develop` has unpushed commits.
108
-
109
- 2. Get the upcoming release from `package.json` and start the release:
110
-
111
- `git flow release start $RELEASE_VERSION`, e.g. `git flow release start 1.2.0`.
112
-
113
- 3. Edit the version in `package.json`.
114
-
115
- 3.1. Edit the version in `package.json`, remove the `-SNAPSHOT`.
116
-
117
- 3.2. Commit `package.json`. Commit message should be `Release $RELEASE_VERSION`, e.g. `Release 1.2.0`.
118
-
119
- 4. Finish the release:
120
-
121
- `git flow release finish`
122
-
123
- This will merge the release branch into the `main` branch and create a tag. It will also merge the release branch into the `develop` branch.
124
-
125
- After this you should be on the `develop` branch.
126
-
127
- 4.1 A merge conflict might occur in `package.json` for the `version`, when main is merged into the develop branch:
128
-
129
- Resolve it by taking the version of the `develop` branch. Then run `npm install` to resolve conflicts in `package-lock.version`.
130
-
131
- Run `git status` to see if there are more conflicts. If there are, resolve them and `git add` the fixed files.
132
-
133
- If there are no more conflicts, run `git add package*` and `git commit`.
134
-
135
- 5. Start a new snapshot version:
136
-
137
- 5.1.
138
- Edit the version in `package.json`,
139
- increment the minor version (e.g., from `1.1.0` to `1.2.0`) and add the `-SNAPSHOT` again,
140
- so that the version is e.g. `1.2.0-SNAPSHOT`.
141
-
142
- 5.2. Run `npm install`.
143
-
144
- 5.3. Commit `package.json` and `package-lock.json`. Commit message should be `Starting $NEW_SNAPSHOT_VERSION`, e.g. `Starting 1.2.0`.
145
-
146
- 6. Push the branches and the tag:
147
-
148
- On branch `develop`:
149
-
150
- `git push`
151
- `git checkout main`
152
- `git push`
153
- `git push --tags`
154
- `git checkout develop`
89
+ Before running it, make sure the workarea is clean and all commits on `develop` are pushed; otherwise the script aborts.
90
+ It releases the current version from `package.json` (without `-SNAPSHOT`) and afterwards starts the next minor snapshot version.
91
+
92
+ ## Building a hotfix for a specific version of this library
93
+
94
+ When building a hotfix in `ng-ui-scale`, first check which version of this library is used on the `main` branch of `ng-ui-scale`, e.g. with `git show origin/main:package.json | grep ng-ui-api-client`.
95
+ Then build the hotfix on top of exactly that version, so that no unrelated changes from newer releases end up in the `ng-ui-scale` hotfix.
96
+ Do not use `release.sh` or `git flow hotfix` for this: `git flow hotfix finish` merges into `main`, which already contains the newer release.
97
+
98
+ Example: `ng-ui-scale` uses 10.56.0 while 10.57.0 is already released (the version on `main` of this library):
99
+
100
+ 1. Create the branch `hotfix/10.56.1` from the tag 10.56.0 and install the dependencies of that version:
101
+ ```shell
102
+ git fetch --tags
103
+ git checkout -b hotfix/10.56.1 10.56.0
104
+ npm ci
105
+ ```
106
+ 2. Set the version in `package.json` and `package-lock.json` to 10.56.1:
107
+ ```shell
108
+ npm version 10.56.1 --no-git-tag-version
109
+ ```
110
+ If the `audit` job in `.gitlab-ci.yml` still runs on every branch except `main`, copy its `rules` from `develop`, so that the vulnerability audit does not block the hotfix pipeline.
111
+ 3. Implement or cherry-pick the changes needed for the hotfix, either directly on the hotfix branch or in a feature branch that is merged into it.
112
+ 4. Run `npm run build`, `npm run lint` and `npm run typecheck` to verify there are no errors.
113
+ 5. Commit the changes.
114
+ 6. Tag the hotfix commit and push the tag:
115
+ ```shell
116
+ git tag -a 10.56.1 -m "Hotfix 10.56.1"
117
+ git push origin 10.56.1
118
+ ```
119
+ The `publish` CI job builds the tag and publishes it to npm.
120
+ Because 10.56.1 is older than the `latest` version, it is published under the dist-tag `hotfix-10.56` and `latest` stays at 10.57.0.
121
+ 7. Merge the hotfix branch into `develop` and push `develop`:
122
+ ```shell
123
+ git checkout develop
124
+ git pull
125
+ git merge --no-ff hotfix/10.56.1
126
+ git push
127
+ ```
128
+ `package.json` and `package-lock.json` will conflict; keep the `-SNAPSHOT` version of `develop` and run `npm install` before committing the merge.
129
+ Do not merge the hotfix branch into `main`.
130
+ 8. Delete the local hotfix branch: `git branch -d hotfix/10.56.1`.
131
+ 9. Update `ng-ui-scale` on its hotfix branch to 10.56.1.