@gridsuite/commons-ui 0.91.1 → 0.92.1
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
|
@@ -8,33 +8,35 @@ The commons-ui library have a demo app in which you can call your components to
|
|
|
8
8
|
The `npm start` command install the library's dependencies then launches the demo app.
|
|
9
9
|
|
|
10
10
|
If you want to test your library integration with a consumer application my-app you have first
|
|
11
|
-
to build commons-ui via
|
|
11
|
+
to build commons-ui via
|
|
12
|
+
|
|
12
13
|
- `npm install` (if not already done to get `tsc`)
|
|
13
14
|
- `npm run build:pack`
|
|
14
15
|
|
|
15
16
|
Then in the my-app project :
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
- Change the commons-ui dependency in my-app's package.json from
|
|
19
|
+
`@gridsuite/commons-ui:"^x.x.x"`
|
|
20
|
+
to
|
|
21
|
+
`@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
|
|
20
22
|
- `npm install`
|
|
21
23
|
- `npm start`
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
_Warning_ : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
|
|
24
26
|
To fix this, run this command from the app **after** running "npm install"
|
|
27
|
+
|
|
25
28
|
- rm -Rf node_modules/.cache
|
|
26
|
-
|
|
27
29
|
|
|
28
30
|
#### For integrators
|
|
29
31
|
|
|
30
32
|
If you want to deploy a new version of commons-ui in the [NPM package registry](https://www.npmjs.com/package/@gridsuite/commons-ui),
|
|
31
33
|
you need to follow the steps below:
|
|
32
34
|
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
- [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
|
|
36
|
+
- In the 'run workflow' combobox select, let the branch on main
|
|
37
|
+
- Enter the type of evolution (major | minor | patch)
|
|
38
|
+
- Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
|
|
39
|
+
- Click 'run workflow'
|
|
38
40
|
|
|
39
41
|
#### License Headers and dependencies checking
|
|
40
42
|
|
|
@@ -44,6 +46,7 @@ To check dependencies license compatibility with this project one locally, pleas
|
|
|
44
46
|
npm run licenses-check
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
Notes :
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
Notes :
|
|
50
|
+
|
|
51
|
+
- Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
|
|
52
|
+
If you need to update this list, please inform organization's owners.
|
|
@@ -2,10 +2,13 @@ import { useRef, useEffect, useCallback } from "react";
|
|
|
2
2
|
const useListenerManager = (urls) => {
|
|
3
3
|
const urlsListenersRef = useRef({});
|
|
4
4
|
useEffect(() => {
|
|
5
|
-
urlsListenersRef.current = Object.keys(urls).reduce(
|
|
6
|
-
acc
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
urlsListenersRef.current = Object.keys(urls).reduce(
|
|
6
|
+
(acc, urlKey) => {
|
|
7
|
+
acc[urlKey] = urlsListenersRef.current[urlKey] ?? [];
|
|
8
|
+
return acc;
|
|
9
|
+
},
|
|
10
|
+
{}
|
|
11
|
+
);
|
|
9
12
|
}, [urls]);
|
|
10
13
|
const addListenerEvent = useCallback((urlKey, listener) => {
|
|
11
14
|
const urlsListeners = urlsListenersRef.current;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.1",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"node": ">=22",
|
|
11
11
|
"npm": "^10.9.2"
|
|
12
12
|
},
|
|
13
|
+
"type": "module",
|
|
13
14
|
"exports": "./dist/index.js",
|
|
14
15
|
"module": "./dist/index.js",
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
@@ -20,8 +21,8 @@
|
|
|
20
21
|
"**/*.css"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
|
-
"start": "vite demo/ --config vite.config.
|
|
24
|
-
"start:open": "vite demo/ --config vite.config.
|
|
24
|
+
"start": "vite demo/ --config vite.config.ts",
|
|
25
|
+
"start:open": "vite demo/ --config vite.config.ts --open",
|
|
25
26
|
"build": "tsc && vite build",
|
|
26
27
|
"build:pack": "tsc && vite build && npm pack",
|
|
27
28
|
"prepublishOnly": "npm run build",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"test:coverage": "jest --coverage",
|
|
30
31
|
"test:watch": "jest --watch",
|
|
31
32
|
"lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0",
|
|
33
|
+
"lint:format": "prettier --check --cache .",
|
|
32
34
|
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"react-hook-form": "^7.54.2",
|
|
66
68
|
"react-intl": "^7.1.6",
|
|
67
69
|
"react-papaparse": "^4.4.0",
|
|
68
|
-
"react-router": "^
|
|
70
|
+
"react-router": "^7.4.1",
|
|
69
71
|
"yup": "^1.6.1"
|
|
70
72
|
},
|
|
71
73
|
"devDependencies": {
|
|
@@ -108,12 +110,12 @@
|
|
|
108
110
|
"eslint": "^8.57.1",
|
|
109
111
|
"eslint-config-airbnb": "^19.0.4",
|
|
110
112
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
111
|
-
"eslint-config-prettier": "^
|
|
113
|
+
"eslint-config-prettier": "^10.1.1",
|
|
112
114
|
"eslint-config-react-app": "^7.0.1",
|
|
113
115
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
114
116
|
"eslint-plugin-import": "^2.31.0",
|
|
115
117
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
116
|
-
"eslint-plugin-prettier": "^
|
|
118
|
+
"eslint-plugin-prettier": "^5.2.5",
|
|
117
119
|
"eslint-plugin-react": "^7.37.4",
|
|
118
120
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
119
121
|
"glob": "^11.0.1",
|
|
@@ -122,15 +124,16 @@
|
|
|
122
124
|
"jest-environment-jsdom": "^29.7.0",
|
|
123
125
|
"license-checker": "^25.0.1",
|
|
124
126
|
"notistack": "^3.0.2",
|
|
125
|
-
"prettier": "^
|
|
127
|
+
"prettier": "^3.5.3",
|
|
128
|
+
"prettier-plugin-properties": "^0.3.0",
|
|
126
129
|
"react": "^18.3.1",
|
|
127
130
|
"react-dom": "^18.3.1",
|
|
128
131
|
"react-hook-form": "^7.54.2",
|
|
129
132
|
"react-intl": "^7.1.6",
|
|
130
133
|
"react-papaparse": "^4.4.0",
|
|
131
134
|
"react-resizable": "^3.0.5",
|
|
132
|
-
"react-router": "^
|
|
133
|
-
"
|
|
135
|
+
"react-router": "^7.4.1",
|
|
136
|
+
"svgo": "^3.3.2",
|
|
134
137
|
"ts-node": "^10.9.2",
|
|
135
138
|
"typescript": "~5.5.4",
|
|
136
139
|
"vite": "^6.2.1",
|