@deviceinsight/ng-ui-components 7.24.0 → 7.25.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 +52 -73
- package/dist/index.cjs +3 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -65
- package/dist/index.js.map +1 -1
- package/dist/types/components/slider/RcSliderWithTooltip.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -95,9 +95,10 @@ npx yalc link "@deviceinsight/ng-ui-components"
|
|
|
95
95
|
|
|
96
96
|
# CI
|
|
97
97
|
|
|
98
|
-
`.gitlab-ci.yml` installs the dependencies and then runs `test`, `
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
`.gitlab-ci.yml` installs the dependencies and then runs `test`, `lint` and `typecheck`
|
|
99
|
+
on every branch except `main`. The `audit` job (`npm run scan`) only runs on `develop`,
|
|
100
|
+
`feature/*` and `renovate/*` branches, so hotfixes and tags are not blocked by it. On `develop` the
|
|
101
|
+
`pages` job publishes the static Storybook to GitLab Pages. The `publish` job runs for `develop` and for tags:
|
|
101
102
|
`-SNAPSHOT` versions are published to the internal Nexus registry under the `next`
|
|
102
103
|
tag, releases go to the public npm registry. A release older than the currently
|
|
103
104
|
published `latest` is published under a `hotfix-<major>.<minor>` tag so that `latest`
|
|
@@ -118,77 +119,55 @@ After git flow is installed, the repo needs to be initialized. Run `git flow ini
|
|
|
118
119
|
question with the default (press Enter/Return). The script verifies that the branches
|
|
119
120
|
are named `main` and `develop`.
|
|
120
121
|
|
|
121
|
-
##
|
|
122
|
+
## Releasing the develop branch
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
Run the release script from the repository root:
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Vulnerabilities can occur at any time.
|
|
128
|
-
To be sure, the pipeline for the branches and the tags created
|
|
129
|
-
in the release process will not fail, the script runs the checks locally before building the
|
|
130
|
-
release:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
npm install
|
|
134
|
-
npm run scan
|
|
135
|
-
npm run test
|
|
126
|
+
```shell
|
|
127
|
+
./release.sh
|
|
136
128
|
```
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
5.2. Run `npm install`.
|
|
183
|
-
|
|
184
|
-
5.3. Commit `package.json` and `package-lock.json`. Commit message should be `Starting $NEW_SNAPSHOT_VERSION`, e.g. `Starting 1.2.0`.
|
|
185
|
-
|
|
186
|
-
6. Push the branches and the tag:
|
|
187
|
-
|
|
188
|
-
On branch `develop`:
|
|
189
|
-
|
|
190
|
-
`git push`
|
|
191
|
-
`git checkout main`
|
|
192
|
-
`git push`
|
|
193
|
-
`git push --tags`
|
|
194
|
-
`git checkout develop`
|
|
130
|
+
Before running it, make sure the workarea is clean and all commits on `develop` are pushed; otherwise the script aborts.
|
|
131
|
+
It releases the current version from `package.json` (without `-SNAPSHOT`) and afterwards starts the next minor snapshot version.
|
|
132
|
+
|
|
133
|
+
## Building a hotfix for a specific version of this library
|
|
134
|
+
|
|
135
|
+
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-components`.
|
|
136
|
+
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.
|
|
137
|
+
Do not use `release.sh` or `git flow hotfix` for this: `git flow hotfix finish` merges into `main`, which already contains the newer release.
|
|
138
|
+
|
|
139
|
+
Example: `ng-ui-scale` uses 7.22.0 while 7.24.0 is already released (the version on `main` of this library):
|
|
140
|
+
|
|
141
|
+
1. Create the branch `hotfix/7.22.1` from the tag 7.22.0:
|
|
142
|
+
```shell
|
|
143
|
+
git fetch --tags
|
|
144
|
+
git checkout -b hotfix/7.22.1 7.22.0
|
|
145
|
+
```
|
|
146
|
+
2. Set the version in `package.json` and `package-lock.json` to 7.22.1:
|
|
147
|
+
```shell
|
|
148
|
+
npm version 7.22.1 --no-git-tag-version
|
|
149
|
+
```
|
|
150
|
+
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.
|
|
151
|
+
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.
|
|
152
|
+
4. Add a `## Version 7.22.1` entry to `CHANGELOG.md` describing the changes in the hotfix.
|
|
153
|
+
5. Run `npm run build`, `npm test -- --run` and `npm run lint` to verify there are no errors.
|
|
154
|
+
6. Commit the changes.
|
|
155
|
+
7. Tag the hotfix commit and push the tag:
|
|
156
|
+
```shell
|
|
157
|
+
git tag -a 7.22.1 -m "Hotfix 7.22.1"
|
|
158
|
+
git push origin 7.22.1
|
|
159
|
+
```
|
|
160
|
+
The `publish` CI job builds the tag and publishes it to npm.
|
|
161
|
+
Because 7.22.1 is older than the `latest` version, it is published under the dist-tag `hotfix-7.22` and `latest` stays at 7.24.0.
|
|
162
|
+
8. Merge the hotfix branch into `develop` and push `develop`:
|
|
163
|
+
```shell
|
|
164
|
+
git checkout develop
|
|
165
|
+
git pull
|
|
166
|
+
git merge --no-ff hotfix/7.22.1
|
|
167
|
+
git push
|
|
168
|
+
```
|
|
169
|
+
`package.json` and `package-lock.json` will conflict; keep the `-SNAPSHOT` version of `develop` and run `npm install` before committing the merge.
|
|
170
|
+
In `CHANGELOG.md`, keep the 7.22.1 entry between the entries for 7.23.0 and 7.22.0.
|
|
171
|
+
Do not merge the hotfix branch into `main`.
|
|
172
|
+
9. Delete the local hotfix branch: `git branch -d hotfix/7.22.1`.
|
|
173
|
+
10. Update `ng-ui-scale` on its hotfix branch to 7.22.1.
|
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
9
|
var __copyProps = (to, from, except, desc) => {
|
|
11
10
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
@@ -73,7 +72,6 @@ let _svgdotjs_svg_js = require("@svgdotjs/svg.js");
|
|
|
73
72
|
let highcharts = require("highcharts");
|
|
74
73
|
highcharts = __toESM(highcharts, 1);
|
|
75
74
|
let highcharts_react_official = require("highcharts-react-official");
|
|
76
|
-
highcharts_react_official = __toESM(highcharts_react_official, 1);
|
|
77
75
|
let _rc_component_slider = require("@rc-component/slider");
|
|
78
76
|
_rc_component_slider = __toESM(_rc_component_slider, 1);
|
|
79
77
|
let _rc_component_tooltip = require("@rc-component/tooltip");
|
|
@@ -3423,7 +3421,7 @@ var Chart = class extends react.Component {
|
|
|
3423
3421
|
render() {
|
|
3424
3422
|
const built = this.buildOptions();
|
|
3425
3423
|
const options = this.props.updateOptions ? this.props.updateOptions(built) : built;
|
|
3426
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.
|
|
3424
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.HighchartsReact, {
|
|
3427
3425
|
highcharts: highcharts.default,
|
|
3428
3426
|
options,
|
|
3429
3427
|
containerProps: { className: this.props.className },
|
|
@@ -3433,54 +3431,15 @@ var Chart = class extends react.Component {
|
|
|
3433
3431
|
};
|
|
3434
3432
|
//#endregion
|
|
3435
3433
|
//#region src/components/slider/RcSliderWithTooltip.tsx
|
|
3436
|
-
var import_raf = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3437
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3438
|
-
exports.default = void 0;
|
|
3439
|
-
var raf = (callback) => +setTimeout(callback, 16);
|
|
3440
|
-
var caf = (num) => clearTimeout(num);
|
|
3441
|
-
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
|
|
3442
|
-
raf = (callback) => window.requestAnimationFrame(callback);
|
|
3443
|
-
caf = (handle) => window.cancelAnimationFrame(handle);
|
|
3444
|
-
}
|
|
3445
|
-
var rafUUID = 0;
|
|
3446
|
-
var rafIds = /* @__PURE__ */ new Map();
|
|
3447
|
-
function cleanup(id) {
|
|
3448
|
-
rafIds.delete(id);
|
|
3449
|
-
}
|
|
3450
|
-
var wrapperRaf = (callback, times = 1) => {
|
|
3451
|
-
rafUUID += 1;
|
|
3452
|
-
const id = rafUUID;
|
|
3453
|
-
function callRef(leftTimes) {
|
|
3454
|
-
if (leftTimes === 0) {
|
|
3455
|
-
cleanup(id);
|
|
3456
|
-
callback();
|
|
3457
|
-
} else {
|
|
3458
|
-
const realId = raf(() => {
|
|
3459
|
-
callRef(leftTimes - 1);
|
|
3460
|
-
});
|
|
3461
|
-
rafIds.set(id, realId);
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
callRef(times);
|
|
3465
|
-
return id;
|
|
3466
|
-
};
|
|
3467
|
-
wrapperRaf.cancel = (id) => {
|
|
3468
|
-
const realId = rafIds.get(id);
|
|
3469
|
-
cleanup(id);
|
|
3470
|
-
return caf(realId);
|
|
3471
|
-
};
|
|
3472
|
-
if (process.env.NODE_ENV !== "production") wrapperRaf.ids = () => rafIds;
|
|
3473
|
-
exports.default = wrapperRaf;
|
|
3474
|
-
})))(), 1);
|
|
3475
3434
|
var HandleTooltip = (props) => {
|
|
3476
3435
|
const { value, children, visible, tipFormatter = (val) => `${val}`, ...restProps } = props;
|
|
3477
3436
|
const tooltipRef = (0, react.useRef)(null);
|
|
3478
3437
|
const rafRef = (0, react.useRef)(null);
|
|
3479
3438
|
function cancelKeepAlign() {
|
|
3480
|
-
if (rafRef.current)
|
|
3439
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
3481
3440
|
}
|
|
3482
3441
|
function keepAlign() {
|
|
3483
|
-
rafRef.current = (
|
|
3442
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
3484
3443
|
tooltipRef.current?.forceAlign();
|
|
3485
3444
|
});
|
|
3486
3445
|
}
|