mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 06:00:07 +03:00
Merge branch 'main' into adjust-open-location
This commit is contained in:
commit
2cd9cbbfad
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
'd3-state-visualizer': major
|
|
||||||
---
|
|
||||||
|
|
||||||
- Remove UMD build.
|
|
||||||
- Split `style` option into `chartStyles`, `nodeStyleOptions`, `textStyleOptions`, and `linkStyles`.
|
|
||||||
- The shape of the argument passed to the `onClickText` option has been updated.
|
|
||||||
- Rename `InputOptions` to `Options`, `Primitive` to `StyleValue`, and `NodeWithId` to `HierarchyPointNode<Node>`.
|
|
6
.changeset/lovely-boats-happen.md
Normal file
6
.changeset/lovely-boats-happen.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
'@redux-devtools/cli': major
|
||||||
|
---
|
||||||
|
|
||||||
|
Convert @redux-devtools/cli to ESM. Please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) for more info about ESM.
|
||||||
|
Update supported Node versions from `>=14.15.0` to `^14.13.1 || ^16.13.0 || >=18.12.0`.
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
'@redux-devtools/chart-monitor': major
|
|
||||||
---
|
|
||||||
|
|
||||||
- Split `style` option into `chartStyles`, `nodeStyleOptions`, `textStyleOptions`, and `linkStyles`.
|
|
||||||
- The shape of the argument passed to the `onClickText` option has been updated.
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
'd3tooltip': major
|
|
||||||
---
|
|
||||||
|
|
||||||
- Remove UMD build.
|
|
||||||
- Upgrade d3 peer dependency from v3 to v6.
|
|
||||||
- Remove `attr` configuration method.
|
|
||||||
- Rename `style` configuration method to `styles` and move to options.
|
|
||||||
- Move `text` configuration method to options.
|
|
||||||
- Remove d3 parameter as first parameter for `tooltip`.
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
'map2tree': major
|
|
||||||
---
|
|
||||||
|
|
||||||
- Remove UMD build.
|
|
|
@ -1,5 +1,13 @@
|
||||||
# remotedev-redux-devtools-extension
|
# remotedev-redux-devtools-extension
|
||||||
|
|
||||||
|
## 3.0.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [81926f32]
|
||||||
|
- react-json-tree@0.18.0
|
||||||
|
- @redux-devtools/app@2.2.1
|
||||||
|
|
||||||
## 3.0.17
|
## 3.0.17
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -5,5 +5,7 @@ module.exports = {
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
resolver: '<rootDir>/jestResolver.js',
|
transformIgnorePatterns: [
|
||||||
|
'node_modules/(?!.pnpm|d3|dateformat|delaunator|internmap|nanoid|robust-predicates|uuid)',
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
module.exports = (path, options) => {
|
|
||||||
return options.defaultResolver(path, {
|
|
||||||
...options,
|
|
||||||
packageFilter: (pkg) => {
|
|
||||||
if (pkg.name === 'nanoid') {
|
|
||||||
pkg.exports['.'].browser = pkg.exports['.'].require;
|
|
||||||
}
|
|
||||||
if (pkg.name === 'uuid' && pkg.version.startsWith('8.')) {
|
|
||||||
delete pkg.exports;
|
|
||||||
delete pkg.module;
|
|
||||||
}
|
|
||||||
return pkg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "remotedev-redux-devtools-extension",
|
"name": "remotedev-redux-devtools-extension",
|
||||||
"version": "3.0.17",
|
"version": "3.0.18",
|
||||||
"description": "Redux Developer Tools for debugging application state changes.",
|
"description": "Redux Developer Tools for debugging application state changes.",
|
||||||
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
|
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/polyfill": "^7.12.1",
|
"@babel/polyfill": "^7.12.1",
|
||||||
"@redux-devtools/app": "^2.2.0",
|
"@redux-devtools/app": "^2.2.1",
|
||||||
"@redux-devtools/core": "^3.13.0",
|
"@redux-devtools/core": "^3.13.0",
|
||||||
"@redux-devtools/instrument": "^2.1.0",
|
"@redux-devtools/instrument": "^2.1.0",
|
||||||
"@redux-devtools/serialize": "^0.4.1",
|
"@redux-devtools/serialize": "^0.4.1",
|
||||||
|
@ -43,14 +43,14 @@
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.7.1",
|
"react-icons": "^4.7.1",
|
||||||
"react-is": "^18.2.0",
|
"react-is": "^18.2.0",
|
||||||
"react-json-tree": "^0.17.0",
|
"react-json-tree": "^0.18.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"styled-components": "^5.3.6"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
|
@ -60,16 +60,16 @@
|
||||||
"@types/chrome": "^0.0.206",
|
"@types/chrome": "^0.0.206",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"chromedriver": "^108.0.0",
|
"chromedriver": "^108.0.0",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"cpy-cli": "^4.2.0",
|
"cpy-cli": "^4.2.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"electron": "^22.0.0",
|
"electron": "^22.0.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.6.1",
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"jest-environment-jsdom": "^29.3.1",
|
"jest-environment-jsdom": "^29.3.1",
|
||||||
"pug-html-loader": "^1.1.5",
|
"pug-html-loader": "^1.1.5",
|
||||||
|
|
18
package.json
18
package.json
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@changesets/cli": "^2.26.0",
|
"@changesets/cli": "^2.26.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"prettier": "2.8.1",
|
"prettier": "2.8.2",
|
||||||
"typescript": "~4.9.4",
|
"typescript": "~4.9.4",
|
||||||
"nx": "^15.3.3",
|
"nx": "^15.4.5",
|
||||||
"@nrwl/nx-cloud": "^15.0.2"
|
"@nrwl/nx-cloud": "^15.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
"packages/redux-devtools-rtk-query-monitor/demo",
|
"packages/redux-devtools-rtk-query-monitor/demo",
|
||||||
"packages/redux-devtools-slider-monitor/examples/todomvc"
|
"packages/redux-devtools-slider-monitor/examples/todomvc"
|
||||||
],
|
],
|
||||||
"packageManager": "pnpm@7.19.0",
|
"packageManager": "pnpm@7.22.0",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@babel/highlight>chalk": "Methuselah96/chalk#v2-without-process"
|
"@babel/highlight>chalk": "Methuselah96/chalk#v2-without-process"
|
||||||
|
|
|
@ -1,5 +1,23 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 2.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- b323f77d: Upgrade D3
|
||||||
|
|
||||||
|
- Remove UMD build.
|
||||||
|
- Split `style` option into `chartStyles`, `nodeStyleOptions`, `textStyleOptions`, and `linkStyles`.
|
||||||
|
- The shape of the argument passed to the `onClickText` option has been updated.
|
||||||
|
- Rename `InputOptions` to `Options`, `Primitive` to `StyleValue`, and `NodeWithId` to `HierarchyPointNode<Node>`.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- d3tooltip@3.0.0
|
||||||
|
- map2tree@3.0.0
|
||||||
|
|
||||||
## [1.4.0](https://github.com/reduxjs/redux-devtools/compare/d3-state-visualizer@1.3.4...d3-state-visualizer@1.4.0) (2021-03-06)
|
## [1.4.0](https://github.com/reduxjs/redux-devtools/compare/d3-state-visualizer@1.3.4...d3-state-visualizer@1.4.0) (2021-03-06)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
10
packages/d3-state-visualizer/examples/tree/CHANGELOG.md
Normal file
10
packages/d3-state-visualizer/examples/tree/CHANGELOG.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# d3-state-visualizer-tree-example
|
||||||
|
|
||||||
|
## 0.1.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- d3-state-visualizer@2.0.0
|
||||||
|
- map2tree@3.0.0
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "d3-state-visualizer-tree-example",
|
"name": "d3-state-visualizer-tree-example",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "Visualize your app state as a tree",
|
"description": "Visualize your app state as a tree",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"d3",
|
"d3",
|
||||||
|
@ -25,20 +25,20 @@
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"d3-state-visualizer": "^1.6.0",
|
"d3-state-visualizer": "^2.0.0",
|
||||||
"map2tree": "^2.1.0"
|
"map2tree": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
"html-webpack-plugin": "^5.5.0",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "d3-state-visualizer",
|
"name": "d3-state-visualizer",
|
||||||
"version": "1.6.0",
|
"version": "2.0.0",
|
||||||
"description": "Visualize your app state with a range of reusable charts",
|
"description": "Visualize your app state with a range of reusable charts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"d3",
|
"d3",
|
||||||
|
@ -40,25 +40,25 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/d3": "^6.7.5",
|
"@types/d3": "^7.4.0",
|
||||||
"d3": "^6.7.0",
|
"d3": "^7.8.0",
|
||||||
"d3tooltip": "^2.1.0",
|
"d3tooltip": "^3.0.0",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"map2tree": "^2.1.0",
|
"map2tree": "^3.0.0",
|
||||||
"ramda": "^0.28.0"
|
"ramda": "^0.28.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/ramda": "^0.28.20",
|
"@types/ramda": "^0.28.20",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,18 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- b323f77d: Upgrade D3
|
||||||
|
|
||||||
|
- Remove UMD build.
|
||||||
|
- Upgrade d3 peer dependency from v3 to v7.
|
||||||
|
- Remove `attr` configuration method.
|
||||||
|
- Rename `style` configuration method to `styles` and move to options.
|
||||||
|
- Move `text` configuration method to options.
|
||||||
|
- Remove d3 parameter as first parameter for `tooltip`.
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
|
|
||||||
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):
|
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "d3tooltip",
|
"name": "d3tooltip",
|
||||||
"version": "2.1.0",
|
"version": "3.0.0",
|
||||||
"description": "A highly configurable tooltip for d3",
|
"description": "A highly configurable tooltip for d3",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"d3",
|
"d3",
|
||||||
|
@ -36,25 +36,25 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6"
|
"@babel/runtime": "^7.20.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/d3": "^6.7.5",
|
"@types/d3": "^7.4.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"d3": "^6.7.0",
|
"d3": "^7.8.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/d3": "^6.7.5",
|
"@types/d3": "^7.4.0",
|
||||||
"d3": "^6.7.0"
|
"d3": "^7.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- b323f77d: Remove UMD build.
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
|
|
||||||
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):
|
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "map2tree",
|
"name": "map2tree",
|
||||||
"version": "2.1.0",
|
"version": "3.0.0",
|
||||||
"description": "Utility for mapping maps to trees",
|
"description": "Utility for mapping maps to trees",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"map2tree",
|
"map2tree",
|
||||||
|
@ -40,23 +40,23 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.0.3",
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/base16": "^1.0.2",
|
"@types/base16": "^1.0.2",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"base16": "^1.0.0",
|
"base16": "^1.0.0",
|
||||||
|
@ -48,20 +48,20 @@
|
||||||
"lodash.curry": "^4.1.1"
|
"lodash.curry": "^4.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/color": "^3.0.3",
|
"@types/color": "^3.0.3",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/lodash.curry": "^4.1.7",
|
"@types/lodash.curry": "^4.1.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"jest-environment-jsdom": "^29.3.1",
|
"jest-environment-jsdom": "^29.3.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
|
|
@ -19,20 +19,20 @@
|
||||||
"styled-components": "^5.3.6"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -39,29 +39,29 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"prop-types": "^15.8.1"
|
"prop-types": "^15.8.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/lodash.debounce": "^4.0.7",
|
"@types/lodash.debounce": "^4.0.7",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-test-renderer": "^18.0.0",
|
"@types/react-test-renderer": "^18.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 0.18.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 81926f32: Remove UNSAFE method from react-json-tree
|
||||||
|
|
||||||
|
- Replace `shouldExpandNode` with `shouldExpandNodeInitially`. This function is now only called when a node in the tree is first rendered, when before it would update the expanded state of the node if the results of calling `shouldExpandNode` changed between renders. There is no way to replicate the old behavior exactly, but the new behavior is the intended behavior for the use cases within Redux DevTools. Please open an issue if you need a way to programatically control the expanded state of nodes.
|
||||||
|
- Bump the minimum React version from `16.3.0` to `16.8.0` so that `react-json-tree` can use hooks.
|
||||||
|
- Tightened TypeScript prop types to use `unknown` instead of `any` where possible and make the key path array `readonly`.
|
||||||
|
|
||||||
## 0.17.0
|
## 0.17.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|
|
@ -139,7 +139,7 @@ Their full signatures are:
|
||||||
|
|
||||||
#### More Options
|
#### More Options
|
||||||
|
|
||||||
- `shouldExpandNode: function(keyPath, data, level)` - determines if node should be expanded (root is expanded by default)
|
- `shouldExpandNodeInitially: function(keyPath, data, level)` - determines if node should be expanded when it first renders (root is expanded by default)
|
||||||
- `hideRoot: boolean` - if `true`, the root node is hidden.
|
- `hideRoot: boolean` - if `true`, the root node is hidden.
|
||||||
- `sortObjectKeys: boolean | function(a, b)` - sorts object keys with compare function (optional). Isn't applied to iterable maps like `Immutable.Map`.
|
- `sortObjectKeys: boolean | function(a, b)` - sorts object keys with compare function (optional). Isn't applied to iterable maps like `Immutable.Map`.
|
||||||
- `postprocessValue: function(value)` - maps `value` to a new `value`
|
- `postprocessValue: function(value)` - maps `value` to a new `value`
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# react-json-tree-example
|
# react-json-tree-example
|
||||||
|
|
||||||
|
## 1.1.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [81926f32]
|
||||||
|
- react-json-tree@0.18.0
|
||||||
|
|
||||||
## 1.1.7
|
## 1.1.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "react-json-tree-example",
|
"name": "react-json-tree-example",
|
||||||
"version": "1.1.7",
|
"version": "1.1.8",
|
||||||
"description": "React-Json-Tree example",
|
"description": "React-Json-Tree example",
|
||||||
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/react-json-tree/examples",
|
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/react-json-tree/examples",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -19,26 +19,26 @@
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-base16-styling": "^0.9.1",
|
"react-base16-styling": "^0.9.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-json-tree": "^0.17.0"
|
"react-json-tree": "^0.18.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -178,7 +178,7 @@ const App = () => (
|
||||||
<span role="img" aria-label="mellow">
|
<span role="img" aria-label="mellow">
|
||||||
😐
|
😐
|
||||||
</span>{' '}
|
</span>{' '}
|
||||||
{raw}{' '}
|
{raw as string}{' '}
|
||||||
<span role="img" aria-label="mellow">
|
<span role="img" aria-label="mellow">
|
||||||
😐
|
😐
|
||||||
</span>
|
</span>
|
||||||
|
@ -194,7 +194,11 @@ const App = () => (
|
||||||
</div>
|
</div>
|
||||||
<p>Collapsed root node</p>
|
<p>Collapsed root node</p>
|
||||||
<div>
|
<div>
|
||||||
<JSONTree data={data} theme={theme} shouldExpandNode={() => false} />
|
<JSONTree
|
||||||
|
data={data}
|
||||||
|
theme={theme}
|
||||||
|
shouldExpandNodeInitially={() => false}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "react-json-tree",
|
"name": "react-json-tree",
|
||||||
"version": "0.17.0",
|
"version": "0.18.0",
|
||||||
"description": "React JSON Viewer Component, Extracted from redux-devtools",
|
"description": "React JSON Viewer Component, Extracted from redux-devtools",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
@ -45,15 +45,13 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/prop-types": "^15.7.5",
|
|
||||||
"prop-types": "^15.8.1",
|
|
||||||
"react-base16-styling": "^0.9.1"
|
"react-base16-styling": "^0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -62,30 +60,30 @@
|
||||||
"@rollup/plugin-babel": "^6.0.3",
|
"@rollup/plugin-babel": "^6.0.3",
|
||||||
"@rollup/plugin-commonjs": "^24.0.0",
|
"@rollup/plugin-commonjs": "^24.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@rollup/plugin-terser": "^0.2.1",
|
"@rollup/plugin-terser": "^0.3.0",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-test-renderer": "^18.0.0",
|
"@types/react-test-renderer": "^18.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-test-renderer": "^18.2.0",
|
"react-test-renderer": "^18.2.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^3.7.5",
|
"rollup": "^3.9.1",
|
||||||
"rollup-plugin-typescript2": "^0.34.1",
|
"rollup-plugin-typescript2": "^0.34.1",
|
||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.0.3",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.4.1",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
|
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||||
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,59 +1,39 @@
|
||||||
import React from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import JSONArrow from './JSONArrow';
|
import JSONArrow from './JSONArrow';
|
||||||
import { CircularPropsPassedThroughItemRange } from './types';
|
import type { CircularCache, CommonInternalProps } from './types';
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughItemRange {
|
interface Props extends CommonInternalProps {
|
||||||
data: any;
|
data: unknown;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
from: number;
|
from: number;
|
||||||
to: number;
|
to: number;
|
||||||
renderChildNodes: (props: Props, from: number, to: number) => React.ReactNode;
|
renderChildNodes: (props: Props, from: number, to: number) => React.ReactNode;
|
||||||
|
circularCache: CircularCache;
|
||||||
|
level: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
export default function ItemRange(props: Props) {
|
||||||
expanded: boolean;
|
const { styling, from, to, renderChildNodes, nodeType } = props;
|
||||||
}
|
|
||||||
|
const [expanded, setExpanded] = useState<boolean>(false);
|
||||||
export default class ItemRange extends React.Component<Props, State> {
|
const handleClick = useCallback(() => {
|
||||||
static propTypes = {
|
setExpanded(!expanded);
|
||||||
styling: PropTypes.func.isRequired,
|
}, [expanded]);
|
||||||
from: PropTypes.number.isRequired,
|
|
||||||
to: PropTypes.number.isRequired,
|
return expanded ? (
|
||||||
renderChildNodes: PropTypes.func.isRequired,
|
<div {...styling('itemRange', expanded)}>
|
||||||
nodeType: PropTypes.string.isRequired,
|
{renderChildNodes(props, from, to)}
|
||||||
};
|
</div>
|
||||||
|
) : (
|
||||||
constructor(props: Props) {
|
<div {...styling('itemRange', expanded)} onClick={handleClick}>
|
||||||
super(props);
|
<JSONArrow
|
||||||
this.state = { expanded: false };
|
nodeType={nodeType}
|
||||||
}
|
styling={styling}
|
||||||
|
expanded={false}
|
||||||
render() {
|
onClick={handleClick}
|
||||||
const { styling, from, to, renderChildNodes, nodeType } = this.props;
|
arrowStyle="double"
|
||||||
|
/>
|
||||||
return this.state.expanded ? (
|
{`${from} ... ${to}`}
|
||||||
<div {...styling('itemRange', this.state.expanded)}>
|
</div>
|
||||||
{renderChildNodes(this.props, from, to)}
|
);
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
{...styling('itemRange', this.state.expanded)}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
>
|
|
||||||
<JSONArrow
|
|
||||||
nodeType={nodeType}
|
|
||||||
styling={styling}
|
|
||||||
expanded={false}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
arrowStyle="double"
|
|
||||||
/>
|
|
||||||
{`${from} ... ${to}`}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClick = () => {
|
|
||||||
this.setState({ expanded: !this.state.expanded });
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,30 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import JSONNestedNode from './JSONNestedNode';
|
import JSONNestedNode from './JSONNestedNode';
|
||||||
import { CircularPropsPassedThroughJSONNode } from './types';
|
import type { CommonInternalProps } from './types';
|
||||||
|
|
||||||
// Returns the "n Items" string for this node,
|
// Returns the "n Items" string for this node,
|
||||||
// generating and caching it if it hasn't been created yet.
|
// generating and caching it if it hasn't been created yet.
|
||||||
function createItemString(data: any) {
|
function createItemString(data: unknown) {
|
||||||
return `${(data as unknown[]).length} ${
|
return `${(data as unknown[]).length} ${
|
||||||
(data as unknown[]).length !== 1 ? 'items' : 'item'
|
(data as unknown[]).length !== 1 ? 'items' : 'item'
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONNode {
|
interface Props extends CommonInternalProps {
|
||||||
data: any;
|
data: unknown;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configures <JSONNestedNode> to render an Array
|
// Configures <JSONNestedNode> to render an Array
|
||||||
const JSONArrayNode: React.FunctionComponent<Props> = ({ data, ...props }) => (
|
export default function JSONArrayNode({ data, ...props }: Props) {
|
||||||
<JSONNestedNode
|
return (
|
||||||
{...props}
|
<JSONNestedNode
|
||||||
data={data}
|
{...props}
|
||||||
nodeType="Array"
|
data={data}
|
||||||
nodeTypeIndicator="[]"
|
nodeType="Array"
|
||||||
createItemString={createItemString}
|
nodeTypeIndicator="[]"
|
||||||
expandable={data.length > 0}
|
createItemString={createItemString}
|
||||||
/>
|
expandable={(data as unknown[]).length > 0}
|
||||||
);
|
/>
|
||||||
|
);
|
||||||
JSONArrayNode.propTypes = {
|
}
|
||||||
data: PropTypes.array,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default JSONArrayNode;
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import type { StylingFunction } from 'react-base16-styling';
|
||||||
import { StylingFunction } from 'react-base16-styling';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
styling: StylingFunction;
|
styling: StylingFunction;
|
||||||
|
@ -10,33 +9,21 @@ interface Props {
|
||||||
onClick: React.MouseEventHandler<HTMLDivElement>;
|
onClick: React.MouseEventHandler<HTMLDivElement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const JSONArrow: React.FunctionComponent<Props> = ({
|
export default function JSONArrow({
|
||||||
styling,
|
styling,
|
||||||
arrowStyle,
|
arrowStyle = 'single',
|
||||||
expanded,
|
expanded,
|
||||||
nodeType,
|
nodeType,
|
||||||
onClick,
|
onClick,
|
||||||
}) => (
|
}: Props) {
|
||||||
<div {...styling('arrowContainer', arrowStyle)} onClick={onClick}>
|
return (
|
||||||
<div {...styling(['arrow', 'arrowSign'], nodeType, expanded, arrowStyle)}>
|
<div {...styling('arrowContainer', arrowStyle)} onClick={onClick}>
|
||||||
{'\u25B6'}
|
<div {...styling(['arrow', 'arrowSign'], nodeType, expanded, arrowStyle)}>
|
||||||
{arrowStyle === 'double' && (
|
{'\u25B6'}
|
||||||
<div {...styling(['arrowSign', 'arrowSignInner'])}>{'\u25B6'}</div>
|
{arrowStyle === 'double' && (
|
||||||
)}
|
<div {...styling(['arrowSign', 'arrowSignInner'])}>{'\u25B6'}</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
JSONArrow.propTypes = {
|
|
||||||
styling: PropTypes.func.isRequired,
|
|
||||||
arrowStyle: PropTypes.oneOf(['single', 'double']),
|
|
||||||
expanded: PropTypes.bool.isRequired,
|
|
||||||
nodeType: PropTypes.string.isRequired,
|
|
||||||
onClick: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
JSONArrow.defaultProps = {
|
|
||||||
arrowStyle: 'single',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default JSONArrow;
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import JSONNestedNode from './JSONNestedNode';
|
import JSONNestedNode from './JSONNestedNode';
|
||||||
import { CircularPropsPassedThroughJSONNode } from './types';
|
import type { CommonInternalProps } from './types';
|
||||||
|
|
||||||
// Returns the "n Items" string for this node,
|
// Returns the "n Items" string for this node,
|
||||||
// generating and caching it if it hasn't been created yet.
|
// generating and caching it if it hasn't been created yet.
|
||||||
|
@ -22,21 +22,20 @@ function createItemString(data: any, limit: number) {
|
||||||
return `${hasMore ? '>' : ''}${count} ${count !== 1 ? 'entries' : 'entry'}`;
|
return `${hasMore ? '>' : ''}${count} ${count !== 1 ? 'entries' : 'entry'}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONNode {
|
interface Props extends CommonInternalProps {
|
||||||
data: any;
|
data: unknown;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configures <JSONNestedNode> to render an iterable
|
// Configures <JSONNestedNode> to render an iterable
|
||||||
const JSONIterableNode: React.FunctionComponent<Props> = ({ ...props }) => {
|
export default function JSONIterableNode(props: Props) {
|
||||||
return (
|
return (
|
||||||
<JSONNestedNode
|
<JSONNestedNode
|
||||||
{...props}
|
{...props}
|
||||||
nodeType="Iterable"
|
nodeType="Iterable"
|
||||||
nodeTypeIndicator="()"
|
nodeTypeIndicator="()"
|
||||||
createItemString={createItemString}
|
createItemString={createItemString}
|
||||||
|
expandable
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default JSONIterableNode;
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
import React from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import JSONArrow from './JSONArrow';
|
import JSONArrow from './JSONArrow';
|
||||||
import getCollectionEntries from './getCollectionEntries';
|
import getCollectionEntries from './getCollectionEntries';
|
||||||
import JSONNode from './JSONNode';
|
import JSONNode from './JSONNode';
|
||||||
import ItemRange from './ItemRange';
|
import ItemRange from './ItemRange';
|
||||||
import {
|
import type { CircularCache, CommonInternalProps } from './types';
|
||||||
CircularPropsPassedThroughJSONNestedNode,
|
|
||||||
CircularPropsPassedThroughRenderChildNodes,
|
|
||||||
} from './types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders nested values (eg. objects, arrays, lists, etc.)
|
* Renders nested values (eg. objects, arrays, lists, etc.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface RenderChildNodesProps
|
export interface RenderChildNodesProps extends CommonInternalProps {
|
||||||
extends CircularPropsPassedThroughRenderChildNodes {
|
data: unknown;
|
||||||
data: any;
|
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
|
circularCache: CircularCache;
|
||||||
|
level: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Range {
|
interface Range {
|
||||||
|
@ -26,7 +23,7 @@ interface Range {
|
||||||
|
|
||||||
interface Entry {
|
interface Entry {
|
||||||
key: string | number;
|
key: string | number;
|
||||||
value: any;
|
value: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
|
function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
|
||||||
|
@ -89,152 +86,92 @@ function renderChildNodes(
|
||||||
return childNodes;
|
return childNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONNestedNode {
|
interface Props extends CommonInternalProps {
|
||||||
data: any;
|
data: unknown;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
nodeTypeIndicator: string;
|
nodeTypeIndicator: string;
|
||||||
createItemString: (data: any, collectionLimit: number) => string;
|
createItemString: (data: unknown, collectionLimit: number) => string;
|
||||||
expandable: boolean;
|
expandable: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
export default function JSONNestedNode(props: Props) {
|
||||||
expanded: boolean;
|
const {
|
||||||
}
|
circularCache = [],
|
||||||
|
collectionLimit,
|
||||||
|
createItemString,
|
||||||
|
data,
|
||||||
|
expandable,
|
||||||
|
getItemString,
|
||||||
|
hideRoot,
|
||||||
|
isCircular,
|
||||||
|
keyPath,
|
||||||
|
labelRenderer,
|
||||||
|
level = 0,
|
||||||
|
nodeType,
|
||||||
|
nodeTypeIndicator,
|
||||||
|
shouldExpandNodeInitially,
|
||||||
|
styling,
|
||||||
|
} = props;
|
||||||
|
|
||||||
function getStateFromProps(props: Props) {
|
const [expanded, setExpanded] = useState<boolean>(
|
||||||
// calculate individual node expansion if necessary
|
// calculate individual node expansion if necessary
|
||||||
const expanded = !props.isCircular
|
isCircular ? false : shouldExpandNodeInitially(keyPath, data, level)
|
||||||
? props.shouldExpandNode(props.keyPath, props.data, props.level)
|
);
|
||||||
: false;
|
|
||||||
return {
|
|
||||||
expanded,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class JSONNestedNode extends React.Component<Props, State> {
|
const handleClick = useCallback(() => {
|
||||||
static propTypes = {
|
if (expandable) setExpanded(!expanded);
|
||||||
getItemString: PropTypes.func.isRequired,
|
}, [expandable, expanded]);
|
||||||
nodeTypeIndicator: PropTypes.any,
|
|
||||||
nodeType: PropTypes.string.isRequired,
|
|
||||||
data: PropTypes.any,
|
|
||||||
hideRoot: PropTypes.bool.isRequired,
|
|
||||||
createItemString: PropTypes.func.isRequired,
|
|
||||||
styling: PropTypes.func.isRequired,
|
|
||||||
collectionLimit: PropTypes.number,
|
|
||||||
keyPath: PropTypes.arrayOf(
|
|
||||||
PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
||||||
).isRequired,
|
|
||||||
labelRenderer: PropTypes.func.isRequired,
|
|
||||||
shouldExpandNode: PropTypes.func,
|
|
||||||
level: PropTypes.number.isRequired,
|
|
||||||
sortObjectKeys: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
||||||
isCircular: PropTypes.bool,
|
|
||||||
expandable: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
static defaultProps = {
|
const renderedChildren =
|
||||||
data: [],
|
expanded || (hideRoot && level === 0)
|
||||||
circularCache: [],
|
? renderChildNodes({ ...props, circularCache, level: level + 1 })
|
||||||
level: 0,
|
: null;
|
||||||
expandable: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(props: Props) {
|
const itemType = (
|
||||||
super(props);
|
<span {...styling('nestedNodeItemType', expanded)}>
|
||||||
this.state = getStateFromProps(props);
|
{nodeTypeIndicator}
|
||||||
}
|
</span>
|
||||||
|
);
|
||||||
|
const renderedItemString = getItemString(
|
||||||
|
nodeType,
|
||||||
|
data,
|
||||||
|
itemType,
|
||||||
|
createItemString(data, collectionLimit),
|
||||||
|
keyPath
|
||||||
|
);
|
||||||
|
const stylingArgs = [keyPath, nodeType, expanded, expandable] as const;
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps(nextProps: Props) {
|
return hideRoot ? (
|
||||||
const nextState = getStateFromProps(nextProps);
|
<li {...styling('rootNode', ...stylingArgs)}>
|
||||||
if (getStateFromProps(this.props).expanded !== nextState.expanded) {
|
<ul {...styling('rootNodeChildren', ...stylingArgs)}>
|
||||||
this.setState(nextState);
|
{renderedChildren}
|
||||||
}
|
</ul>
|
||||||
}
|
</li>
|
||||||
|
) : (
|
||||||
shouldComponentUpdate(nextProps: Props, nextState: State) {
|
<li {...styling('nestedNode', ...stylingArgs)}>
|
||||||
return (
|
{expandable && (
|
||||||
!!Object.keys(nextProps).find(
|
<JSONArrow
|
||||||
(key) =>
|
styling={styling}
|
||||||
key !== 'circularCache' &&
|
nodeType={nodeType}
|
||||||
(key === 'keyPath'
|
expanded={expanded}
|
||||||
? nextProps[key].join('/') !== this.props[key].join('/')
|
onClick={handleClick}
|
||||||
: nextProps[key as keyof Props] !== this.props[key as keyof Props])
|
/>
|
||||||
) || nextState.expanded !== this.state.expanded
|
)}
|
||||||
);
|
<label
|
||||||
}
|
{...styling(['label', 'nestedNodeLabel'], ...stylingArgs)}
|
||||||
|
onClick={handleClick}
|
||||||
render() {
|
>
|
||||||
const {
|
{labelRenderer(...stylingArgs)}
|
||||||
getItemString,
|
</label>
|
||||||
nodeTypeIndicator,
|
<span
|
||||||
nodeType,
|
{...styling('nestedNodeItemString', ...stylingArgs)}
|
||||||
data,
|
onClick={handleClick}
|
||||||
hideRoot,
|
>
|
||||||
createItemString,
|
{renderedItemString}
|
||||||
styling,
|
|
||||||
collectionLimit,
|
|
||||||
keyPath,
|
|
||||||
labelRenderer,
|
|
||||||
expandable,
|
|
||||||
} = this.props;
|
|
||||||
const { expanded } = this.state;
|
|
||||||
const renderedChildren =
|
|
||||||
expanded || (hideRoot && this.props.level === 0)
|
|
||||||
? renderChildNodes({ ...this.props, level: this.props.level + 1 })
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const itemType = (
|
|
||||||
<span {...styling('nestedNodeItemType', expanded)}>
|
|
||||||
{nodeTypeIndicator}
|
|
||||||
</span>
|
</span>
|
||||||
);
|
<ul {...styling('nestedNodeChildren', ...stylingArgs)}>
|
||||||
const renderedItemString = getItemString(
|
{renderedChildren}
|
||||||
nodeType,
|
</ul>
|
||||||
data,
|
</li>
|
||||||
itemType,
|
);
|
||||||
createItemString(data, collectionLimit),
|
|
||||||
keyPath
|
|
||||||
);
|
|
||||||
const stylingArgs = [keyPath, nodeType, expanded, expandable] as const;
|
|
||||||
|
|
||||||
return hideRoot ? (
|
|
||||||
<li {...styling('rootNode', ...stylingArgs)}>
|
|
||||||
<ul {...styling('rootNodeChildren', ...stylingArgs)}>
|
|
||||||
{renderedChildren}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
) : (
|
|
||||||
<li {...styling('nestedNode', ...stylingArgs)}>
|
|
||||||
{expandable && (
|
|
||||||
<JSONArrow
|
|
||||||
styling={styling}
|
|
||||||
nodeType={nodeType}
|
|
||||||
expanded={expanded}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<label
|
|
||||||
{...styling(['label', 'nestedNodeLabel'], ...stylingArgs)}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
>
|
|
||||||
{labelRenderer(...stylingArgs)}
|
|
||||||
</label>
|
|
||||||
<span
|
|
||||||
{...styling('nestedNodeItemString', ...stylingArgs)}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
>
|
|
||||||
{renderedItemString}
|
|
||||||
</span>
|
|
||||||
<ul {...styling('nestedNodeChildren', ...stylingArgs)}>
|
|
||||||
{renderedChildren}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClick = () => {
|
|
||||||
if (this.props.expandable) {
|
|
||||||
this.setState({ expanded: !this.state.expanded });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,16 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import objType from './objType';
|
import objType from './objType';
|
||||||
import JSONObjectNode from './JSONObjectNode';
|
import JSONObjectNode from './JSONObjectNode';
|
||||||
import JSONArrayNode from './JSONArrayNode';
|
import JSONArrayNode from './JSONArrayNode';
|
||||||
import JSONIterableNode from './JSONIterableNode';
|
import JSONIterableNode from './JSONIterableNode';
|
||||||
import JSONValueNode from './JSONValueNode';
|
import JSONValueNode from './JSONValueNode';
|
||||||
import { CircularPropsPassedThroughJSONNode } from './types';
|
import type { CommonInternalProps } from './types';
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONNode {
|
interface Props extends CommonInternalProps {
|
||||||
keyPath: (string | number)[];
|
value: unknown;
|
||||||
value: any;
|
|
||||||
isCustomNode: (value: any) => boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const JSONNode: React.FunctionComponent<Props> = ({
|
export default function JSONNode({
|
||||||
getItemString,
|
getItemString,
|
||||||
keyPath,
|
keyPath,
|
||||||
labelRenderer,
|
labelRenderer,
|
||||||
|
@ -22,7 +19,7 @@ const JSONNode: React.FunctionComponent<Props> = ({
|
||||||
valueRenderer,
|
valueRenderer,
|
||||||
isCustomNode,
|
isCustomNode,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}: Props) {
|
||||||
const nodeType = isCustomNode(value) ? 'Custom' : objType(value);
|
const nodeType = isCustomNode(value) ? 'Custom' : objType(value);
|
||||||
|
|
||||||
const simpleNodeProps = {
|
const simpleNodeProps = {
|
||||||
|
@ -102,18 +99,4 @@ const JSONNode: React.FunctionComponent<Props> = ({
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
JSONNode.propTypes = {
|
|
||||||
getItemString: PropTypes.func.isRequired,
|
|
||||||
keyPath: PropTypes.arrayOf(
|
|
||||||
PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
||||||
).isRequired,
|
|
||||||
labelRenderer: PropTypes.func.isRequired,
|
|
||||||
styling: PropTypes.func.isRequired,
|
|
||||||
value: PropTypes.any,
|
|
||||||
valueRenderer: PropTypes.func.isRequired,
|
|
||||||
isCustomNode: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default JSONNode;
|
|
||||||
|
|
|
@ -1,35 +1,29 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import JSONNestedNode from './JSONNestedNode';
|
import JSONNestedNode from './JSONNestedNode';
|
||||||
import { CircularPropsPassedThroughJSONNode } from './types';
|
import type { CommonInternalProps } from './types';
|
||||||
|
|
||||||
// Returns the "n Items" string for this node,
|
// Returns the "n Items" string for this node,
|
||||||
// generating and caching it if it hasn't been created yet.
|
// generating and caching it if it hasn't been created yet.
|
||||||
function createItemString(data: any) {
|
function createItemString(data: unknown) {
|
||||||
const len = Object.getOwnPropertyNames(data).length;
|
const len = Object.getOwnPropertyNames(data).length;
|
||||||
return `${len} ${len !== 1 ? 'keys' : 'key'}`;
|
return `${len} ${len !== 1 ? 'keys' : 'key'}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONNode {
|
interface Props extends CommonInternalProps {
|
||||||
data: any;
|
data: unknown;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configures <JSONNestedNode> to render an Object
|
// Configures <JSONNestedNode> to render an Object
|
||||||
const JSONObjectNode: React.FunctionComponent<Props> = ({ data, ...props }) => (
|
export default function JSONObjectNode({ data, ...props }: Props) {
|
||||||
<JSONNestedNode
|
return (
|
||||||
{...props}
|
<JSONNestedNode
|
||||||
data={data}
|
{...props}
|
||||||
nodeType="Object"
|
data={data}
|
||||||
nodeTypeIndicator={props.nodeType === 'Error' ? 'Error()' : '{}'}
|
nodeType="Object"
|
||||||
createItemString={createItemString}
|
nodeTypeIndicator={props.nodeType === 'Error' ? 'Error()' : '{}'}
|
||||||
expandable={Object.getOwnPropertyNames(data).length > 0}
|
createItemString={createItemString}
|
||||||
/>
|
expandable={Object.getOwnPropertyNames(data).length > 0}
|
||||||
);
|
/>
|
||||||
|
);
|
||||||
JSONObjectNode.propTypes = {
|
}
|
||||||
data: PropTypes.object,
|
|
||||||
nodeType: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default JSONObjectNode;
|
|
||||||
|
|
|
@ -1,18 +1,30 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import type {
|
||||||
import { JSONValueNodeCircularPropsProvidedByJSONNode } from './types';
|
GetItemString,
|
||||||
|
Key,
|
||||||
|
KeyPath,
|
||||||
|
LabelRenderer,
|
||||||
|
Styling,
|
||||||
|
ValueRenderer,
|
||||||
|
} from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders simple values (eg. strings, numbers, booleans, etc)
|
* Renders simple values (eg. strings, numbers, booleans, etc)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface Props extends JSONValueNodeCircularPropsProvidedByJSONNode {
|
interface Props {
|
||||||
|
getItemString: GetItemString;
|
||||||
|
key: Key;
|
||||||
|
keyPath: KeyPath;
|
||||||
|
labelRenderer: LabelRenderer;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
value: any;
|
styling: Styling;
|
||||||
valueGetter?: (value: any) => any;
|
value: unknown;
|
||||||
|
valueRenderer: ValueRenderer;
|
||||||
|
valueGetter?: (value: any) => unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
const JSONValueNode: React.FunctionComponent<Props> = ({
|
export default function JSONValueNode({
|
||||||
nodeType,
|
nodeType,
|
||||||
styling,
|
styling,
|
||||||
labelRenderer,
|
labelRenderer,
|
||||||
|
@ -20,27 +32,15 @@ const JSONValueNode: React.FunctionComponent<Props> = ({
|
||||||
valueRenderer,
|
valueRenderer,
|
||||||
value,
|
value,
|
||||||
valueGetter = (value) => value,
|
valueGetter = (value) => value,
|
||||||
}) => (
|
}: Props) {
|
||||||
<li {...styling('value', nodeType, keyPath)}>
|
return (
|
||||||
<label {...styling(['label', 'valueLabel'], nodeType, keyPath)}>
|
<li {...styling('value', nodeType, keyPath)}>
|
||||||
{labelRenderer(keyPath, nodeType, false, false)}
|
<label {...styling(['label', 'valueLabel'], nodeType, keyPath)}>
|
||||||
</label>
|
{labelRenderer(keyPath, nodeType, false, false)}
|
||||||
<span {...styling('valueText', nodeType, keyPath)}>
|
</label>
|
||||||
{valueRenderer(valueGetter(value), value, ...keyPath)}
|
<span {...styling('valueText', nodeType, keyPath)}>
|
||||||
</span>
|
{valueRenderer(valueGetter(value), value, ...keyPath)}
|
||||||
</li>
|
</span>
|
||||||
);
|
</li>
|
||||||
|
);
|
||||||
JSONValueNode.propTypes = {
|
}
|
||||||
nodeType: PropTypes.string.isRequired,
|
|
||||||
styling: PropTypes.func.isRequired,
|
|
||||||
labelRenderer: PropTypes.func.isRequired,
|
|
||||||
keyPath: PropTypes.arrayOf(
|
|
||||||
PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
||||||
).isRequired,
|
|
||||||
valueRenderer: PropTypes.func.isRequired,
|
|
||||||
value: PropTypes.any,
|
|
||||||
valueGetter: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default JSONValueNode;
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import type { CurriedFunction1 } from 'lodash';
|
import type { CurriedFunction1 } from 'lodash';
|
||||||
import {
|
import { createStyling } from 'react-base16-styling';
|
||||||
|
import type {
|
||||||
Base16Theme,
|
Base16Theme,
|
||||||
createStyling,
|
|
||||||
StylingConfig,
|
StylingConfig,
|
||||||
|
StylingFunction,
|
||||||
|
Theme,
|
||||||
} from 'react-base16-styling';
|
} from 'react-base16-styling';
|
||||||
import solarized from './themes/solarized';
|
import solarized from './themes/solarized';
|
||||||
import { StylingFunction, Theme } from 'react-base16-styling/src';
|
|
||||||
|
|
||||||
const colorMap = (theme: Base16Theme) => ({
|
const colorMap = (theme: Base16Theme) => ({
|
||||||
BACKGROUND_COLOR: theme.base00,
|
BACKGROUND_COLOR: theme.base00,
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
function getLength(type: string, collection: any) {
|
import type { SortObjectKeys } from './types';
|
||||||
|
|
||||||
|
function getLength(type: string, collection: unknown) {
|
||||||
if (type === 'Object') {
|
if (type === 'Object') {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
return Object.keys(collection as {}).length;
|
return Object.keys(collection as {}).length;
|
||||||
|
@ -9,17 +11,17 @@ function getLength(type: string, collection: any) {
|
||||||
return Infinity;
|
return Infinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isIterableMap(collection: any) {
|
function isIterableMap(collection: unknown) {
|
||||||
return typeof (collection as Map<any, any>).set === 'function';
|
return typeof (collection as Map<unknown, unknown>).set === 'function';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEntries(
|
function getEntries(
|
||||||
type: string,
|
type: string,
|
||||||
collection: any,
|
collection: any,
|
||||||
sortObjectKeys?: ((a: any, b: any) => number) | boolean | undefined,
|
sortObjectKeys: SortObjectKeys,
|
||||||
from = 0,
|
from = 0,
|
||||||
to = Infinity
|
to = Infinity
|
||||||
): { entries: { key: string | number; value: any }[]; hasMore?: boolean } {
|
): { entries: { key: string | number; value: unknown }[]; hasMore?: boolean } {
|
||||||
let res;
|
let res;
|
||||||
|
|
||||||
if (type === 'Object') {
|
if (type === 'Object') {
|
||||||
|
@ -95,8 +97,8 @@ function getRanges(from: number, to: number, limit: number) {
|
||||||
|
|
||||||
export default function getCollectionEntries(
|
export default function getCollectionEntries(
|
||||||
type: string,
|
type: string,
|
||||||
collection: any,
|
collection: unknown,
|
||||||
sortObjectKeys: ((a: any, b: any) => number) | boolean | undefined,
|
sortObjectKeys: SortObjectKeys,
|
||||||
limit: number,
|
limit: number,
|
||||||
from = 0,
|
from = 0,
|
||||||
to = Infinity
|
to = Infinity
|
||||||
|
|
|
@ -3,177 +3,88 @@
|
||||||
// Dave Vedder <veddermatic@gmail.com> http://www.eskimospy.com/
|
// Dave Vedder <veddermatic@gmail.com> http://www.eskimospy.com/
|
||||||
// port by Daniele Zannotti http://www.github.com/dzannotti <dzannotti@me.com>
|
// port by Daniele Zannotti http://www.github.com/dzannotti <dzannotti@me.com>
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import JSONNode from './JSONNode';
|
import JSONNode from './JSONNode';
|
||||||
import createStylingFromTheme from './createStylingFromTheme';
|
import createStylingFromTheme from './createStylingFromTheme';
|
||||||
import { invertTheme } from 'react-base16-styling';
|
import { invertTheme } from 'react-base16-styling';
|
||||||
|
import type { StylingValue, Theme } from 'react-base16-styling';
|
||||||
import type {
|
import type {
|
||||||
StylingConfig,
|
CommonExternalProps,
|
||||||
StylingFunction,
|
GetItemString,
|
||||||
StylingValue,
|
IsCustomNode,
|
||||||
Theme,
|
LabelRenderer,
|
||||||
} from 'react-base16-styling';
|
ShouldExpandNodeInitially,
|
||||||
import { CircularPropsPassedThroughJSONTree } from './types';
|
} from './types';
|
||||||
|
|
||||||
interface Props extends CircularPropsPassedThroughJSONTree {
|
interface Props extends Partial<CommonExternalProps> {
|
||||||
data: any;
|
data: unknown;
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
invertTheme: boolean;
|
invertTheme?: boolean;
|
||||||
}
|
|
||||||
|
|
||||||
interface State {
|
|
||||||
styling: StylingFunction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const identity = (value: any) => value;
|
const identity = (value: any) => value;
|
||||||
const expandRootNode = (
|
const expandRootNode: ShouldExpandNodeInitially = (keyPath, data, level) =>
|
||||||
keyPath: (string | number)[],
|
level === 0;
|
||||||
data: any,
|
const defaultItemString: GetItemString = (type, data, itemType, itemString) => (
|
||||||
level: number
|
|
||||||
) => level === 0;
|
|
||||||
const defaultItemString = (
|
|
||||||
type: string,
|
|
||||||
data: any,
|
|
||||||
itemType: React.ReactNode,
|
|
||||||
itemString: string
|
|
||||||
) => (
|
|
||||||
<span>
|
<span>
|
||||||
{itemType} {itemString}
|
{itemType} {itemString}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
const defaultLabelRenderer = ([label]: (string | number)[]) => (
|
const defaultLabelRenderer: LabelRenderer = ([label]) => <span>{label}:</span>;
|
||||||
<span>{label}:</span>
|
const noCustomNode: IsCustomNode = () => false;
|
||||||
);
|
|
||||||
const noCustomNode = () => false;
|
|
||||||
|
|
||||||
function checkLegacyTheming(theme: Theme | undefined, props: Props) {
|
export function JSONTree({
|
||||||
const deprecatedStylingMethodsMap = {
|
data: value,
|
||||||
getArrowStyle: 'arrow',
|
theme,
|
||||||
getListStyle: 'nestedNodeChildren',
|
invertTheme: shouldInvertTheme,
|
||||||
getItemStringStyle: 'nestedNodeItemString',
|
keyPath = ['root'],
|
||||||
getLabelStyle: 'label',
|
labelRenderer = defaultLabelRenderer,
|
||||||
getValueStyle: 'valueText',
|
valueRenderer = identity,
|
||||||
};
|
shouldExpandNodeInitially = expandRootNode,
|
||||||
|
hideRoot = false,
|
||||||
|
getItemString = defaultItemString,
|
||||||
|
postprocessValue = identity,
|
||||||
|
isCustomNode = noCustomNode,
|
||||||
|
collectionLimit = 50,
|
||||||
|
sortObjectKeys = false,
|
||||||
|
}: Props) {
|
||||||
|
const styling = useMemo(
|
||||||
|
() =>
|
||||||
|
createStylingFromTheme(shouldInvertTheme ? invertTheme(theme) : theme),
|
||||||
|
[theme, shouldInvertTheme]
|
||||||
|
);
|
||||||
|
|
||||||
const deprecatedStylingMethods = Object.keys(
|
return (
|
||||||
deprecatedStylingMethodsMap
|
<ul {...styling('tree')}>
|
||||||
).filter((name) => props[name as keyof Props]);
|
<JSONNode
|
||||||
|
keyPath={hideRoot ? [] : keyPath}
|
||||||
if (deprecatedStylingMethods.length > 0) {
|
value={postprocessValue(value)}
|
||||||
if (typeof theme === 'string') {
|
isCustomNode={isCustomNode}
|
||||||
theme = {
|
styling={styling}
|
||||||
extend: theme,
|
labelRenderer={labelRenderer}
|
||||||
};
|
valueRenderer={valueRenderer}
|
||||||
} else {
|
shouldExpandNodeInitially={shouldExpandNodeInitially}
|
||||||
theme = { ...theme };
|
hideRoot={hideRoot}
|
||||||
}
|
getItemString={getItemString}
|
||||||
|
postprocessValue={postprocessValue}
|
||||||
deprecatedStylingMethods.forEach((name) => {
|
collectionLimit={collectionLimit}
|
||||||
// eslint-disable-next-line no-console
|
sortObjectKeys={sortObjectKeys}
|
||||||
console.error(
|
/>
|
||||||
`Styling method "${name}" is deprecated, use "theme" property instead`
|
</ul>
|
||||||
);
|
);
|
||||||
|
|
||||||
(theme as StylingConfig)[
|
|
||||||
deprecatedStylingMethodsMap[
|
|
||||||
name as keyof typeof deprecatedStylingMethodsMap
|
|
||||||
]
|
|
||||||
] = ({ style }, ...args) => ({
|
|
||||||
style: {
|
|
||||||
...style,
|
|
||||||
...props[name as keyof Props](...args),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return theme;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStateFromProps(props: Props) {
|
export type {
|
||||||
let theme = checkLegacyTheming(props.theme, props);
|
Key,
|
||||||
if (props.invertTheme) {
|
KeyPath,
|
||||||
theme = invertTheme(theme);
|
GetItemString,
|
||||||
}
|
LabelRenderer,
|
||||||
|
ValueRenderer,
|
||||||
return {
|
ShouldExpandNodeInitially,
|
||||||
styling: createStylingFromTheme(theme),
|
PostprocessValue,
|
||||||
};
|
IsCustomNode,
|
||||||
}
|
SortObjectKeys,
|
||||||
|
Styling,
|
||||||
export class JSONTree extends React.Component<Props, State> {
|
CommonExternalProps,
|
||||||
static propTypes = {
|
} from './types';
|
||||||
data: PropTypes.any,
|
export type { StylingValue };
|
||||||
hideRoot: PropTypes.bool,
|
|
||||||
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
||||||
invertTheme: PropTypes.bool,
|
|
||||||
keyPath: PropTypes.arrayOf(
|
|
||||||
PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
||||||
),
|
|
||||||
postprocessValue: PropTypes.func,
|
|
||||||
sortObjectKeys: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
||||||
};
|
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
shouldExpandNode: expandRootNode,
|
|
||||||
hideRoot: false,
|
|
||||||
keyPath: ['root'],
|
|
||||||
getItemString: defaultItemString,
|
|
||||||
labelRenderer: defaultLabelRenderer,
|
|
||||||
valueRenderer: identity,
|
|
||||||
postprocessValue: identity,
|
|
||||||
isCustomNode: noCustomNode,
|
|
||||||
collectionLimit: 50,
|
|
||||||
invertTheme: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(props: Props) {
|
|
||||||
super(props);
|
|
||||||
this.state = getStateFromProps(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps(nextProps: Props) {
|
|
||||||
if (
|
|
||||||
['theme', 'invertTheme'].find(
|
|
||||||
(k) => nextProps[k as keyof Props] !== this.props[k as keyof Props]
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
this.setState(getStateFromProps(nextProps));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props) {
|
|
||||||
return !!Object.keys(nextProps).find((k) =>
|
|
||||||
k === 'keyPath'
|
|
||||||
? nextProps[k].join('/') !== this.props[k].join('/')
|
|
||||||
: nextProps[k as keyof Props] !== this.props[k as keyof Props]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
data: value,
|
|
||||||
keyPath,
|
|
||||||
postprocessValue,
|
|
||||||
hideRoot,
|
|
||||||
theme, // eslint-disable-line no-unused-vars
|
|
||||||
invertTheme: _, // eslint-disable-line no-unused-vars
|
|
||||||
...rest
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const { styling } = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul {...styling('tree')}>
|
|
||||||
<JSONNode
|
|
||||||
{...{ postprocessValue, hideRoot, styling, ...rest }}
|
|
||||||
keyPath={hideRoot ? [] : keyPath}
|
|
||||||
value={postprocessValue(value)}
|
|
||||||
/>
|
|
||||||
</ul>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { StylingValue };
|
|
||||||
|
|
|
@ -1,81 +1,63 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StylingFunction } from 'react-base16-styling';
|
import { StylingFunction } from 'react-base16-styling';
|
||||||
|
|
||||||
interface SharedCircularPropsPassedThroughJSONTree {
|
export type Key = string | number;
|
||||||
keyPath: (string | number)[];
|
|
||||||
labelRenderer: (
|
|
||||||
keyPath: (string | number)[],
|
|
||||||
nodeType: string,
|
|
||||||
expanded: boolean,
|
|
||||||
expandable: boolean
|
|
||||||
) => React.ReactNode;
|
|
||||||
}
|
|
||||||
interface SharedCircularPropsProvidedByJSONTree
|
|
||||||
extends SharedCircularPropsPassedThroughJSONTree {
|
|
||||||
styling: StylingFunction;
|
|
||||||
}
|
|
||||||
interface JSONValueNodeCircularPropsPassedThroughJSONTree {
|
|
||||||
valueRenderer: (
|
|
||||||
valueAsString: any,
|
|
||||||
value: any,
|
|
||||||
...keyPath: (string | number)[]
|
|
||||||
) => React.ReactNode;
|
|
||||||
}
|
|
||||||
export type JSONValueNodeCircularPropsProvidedByJSONNode =
|
|
||||||
SharedCircularPropsProvidedByJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree;
|
|
||||||
|
|
||||||
interface JSONNestedNodeCircularPropsPassedThroughJSONTree {
|
export type KeyPath = readonly (string | number)[];
|
||||||
shouldExpandNode: (
|
|
||||||
keyPath: (string | number)[],
|
export type GetItemString = (
|
||||||
data: any,
|
nodeType: string,
|
||||||
level: number
|
data: unknown,
|
||||||
) => boolean;
|
itemType: React.ReactNode,
|
||||||
|
itemString: string,
|
||||||
|
keyPath: KeyPath
|
||||||
|
) => React.ReactNode;
|
||||||
|
|
||||||
|
export type LabelRenderer = (
|
||||||
|
keyPath: KeyPath,
|
||||||
|
nodeType: string,
|
||||||
|
expanded: boolean,
|
||||||
|
expandable: boolean
|
||||||
|
) => React.ReactNode;
|
||||||
|
|
||||||
|
export type ValueRenderer = (
|
||||||
|
valueAsString: unknown,
|
||||||
|
value: unknown,
|
||||||
|
...keyPath: KeyPath
|
||||||
|
) => React.ReactNode;
|
||||||
|
|
||||||
|
export type ShouldExpandNodeInitially = (
|
||||||
|
keyPath: KeyPath,
|
||||||
|
data: unknown,
|
||||||
|
level: number
|
||||||
|
) => boolean;
|
||||||
|
|
||||||
|
export type PostprocessValue = (value: unknown) => unknown;
|
||||||
|
|
||||||
|
export type IsCustomNode = (value: unknown) => boolean;
|
||||||
|
|
||||||
|
export type SortObjectKeys = ((a: unknown, b: unknown) => number) | boolean;
|
||||||
|
|
||||||
|
export type Styling = StylingFunction;
|
||||||
|
|
||||||
|
export type CircularCache = unknown[];
|
||||||
|
|
||||||
|
export interface CommonExternalProps {
|
||||||
|
keyPath: KeyPath;
|
||||||
|
labelRenderer: LabelRenderer;
|
||||||
|
valueRenderer: ValueRenderer;
|
||||||
|
shouldExpandNodeInitially: ShouldExpandNodeInitially;
|
||||||
hideRoot: boolean;
|
hideRoot: boolean;
|
||||||
getItemString: (
|
getItemString: GetItemString;
|
||||||
nodeType: string,
|
postprocessValue: PostprocessValue;
|
||||||
data: any,
|
isCustomNode: IsCustomNode;
|
||||||
itemType: React.ReactNode,
|
|
||||||
itemString: string,
|
|
||||||
keyPath: (string | number)[]
|
|
||||||
) => React.ReactNode;
|
|
||||||
postprocessValue: (value: any) => any;
|
|
||||||
isCustomNode: (value: any) => boolean;
|
|
||||||
collectionLimit: number;
|
collectionLimit: number;
|
||||||
sortObjectKeys?: ((a: any, b: any) => number) | boolean;
|
sortObjectKeys: SortObjectKeys;
|
||||||
}
|
}
|
||||||
export type CircularPropsPassedThroughJSONTree =
|
|
||||||
SharedCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONNestedNodeCircularPropsPassedThroughJSONTree;
|
|
||||||
|
|
||||||
interface JSONNestedNodeCircularPropsPassedThroughJSONNode
|
export interface CommonInternalProps extends CommonExternalProps {
|
||||||
extends JSONNestedNodeCircularPropsPassedThroughJSONTree {
|
styling: StylingFunction;
|
||||||
circularCache?: any[];
|
circularCache?: CircularCache;
|
||||||
isCircular?: boolean;
|
|
||||||
level?: number;
|
level?: number;
|
||||||
|
isCircular?: boolean;
|
||||||
}
|
}
|
||||||
export type CircularPropsPassedThroughJSONNode =
|
|
||||||
SharedCircularPropsProvidedByJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONNestedNodeCircularPropsPassedThroughJSONNode;
|
|
||||||
|
|
||||||
export interface JSONNestedNodeCircularPropsPassedThroughJSONNestedNode
|
|
||||||
extends JSONNestedNodeCircularPropsPassedThroughJSONNode {
|
|
||||||
circularCache: any[];
|
|
||||||
level: number;
|
|
||||||
}
|
|
||||||
export type CircularPropsPassedThroughJSONNestedNode =
|
|
||||||
SharedCircularPropsProvidedByJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONNestedNodeCircularPropsPassedThroughJSONNestedNode;
|
|
||||||
|
|
||||||
export type CircularPropsPassedThroughRenderChildNodes =
|
|
||||||
SharedCircularPropsProvidedByJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONNestedNodeCircularPropsPassedThroughJSONNestedNode;
|
|
||||||
|
|
||||||
export type CircularPropsPassedThroughItemRange =
|
|
||||||
SharedCircularPropsProvidedByJSONTree &
|
|
||||||
JSONValueNodeCircularPropsPassedThroughJSONTree &
|
|
||||||
JSONNestedNodeCircularPropsPassedThroughJSONNestedNode;
|
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 2.2.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- d3-state-visualizer@2.0.0
|
||||||
|
- @redux-devtools/chart-monitor@4.0.0
|
||||||
|
- @redux-devtools/inspector-monitor@3.0.2
|
||||||
|
- @redux-devtools/log-monitor@4.0.2
|
||||||
|
- @redux-devtools/rtk-query-monitor@3.1.1
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|
|
@ -6,7 +6,10 @@ module.exports = {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
|
'^.+\\.jsx?$': 'babel-jest',
|
||||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
||||||
},
|
},
|
||||||
resolver: '<rootDir>/jestResolver.js',
|
transformIgnorePatterns: [
|
||||||
|
'node_modules/(?!.pnpm|d3|dateformat|delaunator|internmap|nanoid|robust-predicates|uuid)',
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
module.exports = (path, options) => {
|
|
||||||
return options.defaultResolver(path, {
|
|
||||||
...options,
|
|
||||||
packageFilter: (pkg) => {
|
|
||||||
if (pkg.name === 'nanoid') {
|
|
||||||
pkg.exports['.'].browser = pkg.exports['.'].require;
|
|
||||||
}
|
|
||||||
if (pkg.name === 'uuid' && pkg.version.startsWith('8.')) {
|
|
||||||
delete pkg.exports;
|
|
||||||
delete pkg.module;
|
|
||||||
}
|
|
||||||
return pkg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@redux-devtools/app",
|
"name": "@redux-devtools/app",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"description": "Redux DevTools app",
|
"description": "Redux DevTools app",
|
||||||
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-app",
|
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-app",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -40,19 +40,19 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@redux-devtools/chart-monitor": "^3.0.0",
|
"@redux-devtools/chart-monitor": "^4.0.0",
|
||||||
"@redux-devtools/core": "^3.13.0",
|
"@redux-devtools/core": "^3.13.0",
|
||||||
"@redux-devtools/inspector-monitor": "^3.0.0",
|
"@redux-devtools/inspector-monitor": "^3.0.2",
|
||||||
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
|
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
|
||||||
"@redux-devtools/inspector-monitor-trace-tab": "^1.0.0",
|
"@redux-devtools/inspector-monitor-trace-tab": "^1.0.0",
|
||||||
"@redux-devtools/log-monitor": "^4.0.0",
|
"@redux-devtools/log-monitor": "^4.0.2",
|
||||||
"@redux-devtools/rtk-query-monitor": "^3.0.0",
|
"@redux-devtools/rtk-query-monitor": "^3.1.1",
|
||||||
"@redux-devtools/slider-monitor": "^4.0.0",
|
"@redux-devtools/slider-monitor": "^4.0.0",
|
||||||
"@redux-devtools/ui": "^1.3.0",
|
"@redux-devtools/ui": "^1.3.0",
|
||||||
"@reduxjs/toolkit": "^1.9.1",
|
"@reduxjs/toolkit": "^1.9.1",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"d3-state-visualizer": "^1.6.0",
|
"d3-state-visualizer": "^2.0.0",
|
||||||
"javascript-stringify": "^2.1.0",
|
"javascript-stringify": "^2.1.0",
|
||||||
"jsan": "^3.1.14",
|
"jsan": "^3.1.14",
|
||||||
"jsondiffpatch": "^0.4.1",
|
"jsondiffpatch": "^0.4.1",
|
||||||
|
@ -67,8 +67,8 @@
|
||||||
"socketcluster-client": "^17.1.0"
|
"socketcluster-client": "^17.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -77,25 +77,25 @@
|
||||||
"@rjsf/core": "^4.2.3",
|
"@rjsf/core": "^4.2.3",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/jsan": "^3.1.2",
|
"@types/jsan": "^3.1.2",
|
||||||
"@types/json-schema": "^7.0.11",
|
"@types/json-schema": "^7.0.11",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/socketcluster-client": "^16.0.0",
|
"@types/socketcluster-client": "^16.0.0",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@types/testing-library__jest-dom": "^5.14.5",
|
"@types/testing-library__jest-dom": "^5.14.5",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 4.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- b323f77d: Upgrade D3
|
||||||
|
|
||||||
|
- Split `style` option into `chartStyles`, `nodeStyleOptions`, `textStyleOptions`, and `linkStyles`.
|
||||||
|
- The shape of the argument passed to the `onClickText` option has been updated.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b323f77d]
|
||||||
|
- d3-state-visualizer@2.0.0
|
||||||
|
|
||||||
## 3.0.1
|
## 3.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@redux-devtools/chart-monitor",
|
"name": "@redux-devtools/chart-monitor",
|
||||||
"version": "3.0.1",
|
"version": "4.0.0",
|
||||||
"description": "Chart monitor for Redux DevTools",
|
"description": "Chart monitor for Redux DevTools",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"redux",
|
"redux",
|
||||||
|
@ -39,15 +39,15 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
"d3-state-visualizer": "^1.6.0",
|
"d3-state-visualizer": "^2.0.0",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"redux-devtools-themes": "^1.0.0"
|
"redux-devtools-themes": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -55,10 +55,10 @@
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@redux-devtools/core": "^3.13.1",
|
"@redux-devtools/core": "^3.13.1",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#! /usr/bin/env node
|
#! /usr/bin/env node
|
||||||
|
|
||||||
require('../dist/bin/redux-devtools.js');
|
import '../dist/bin/redux-devtools.js';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"index.js",
|
"index.js",
|
||||||
"defaultDbOptions.json"
|
"defaultDbOptions.json"
|
||||||
],
|
],
|
||||||
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -37,22 +38,22 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.15.0"
|
"node": "^14.13.1 || ^16.13.0 || >= 18.12.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@apollo/server": "^4.3.0",
|
||||||
"@redux-devtools/app": "^2.1.3",
|
"@redux-devtools/app": "^2.1.3",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"apollo-server-express": "^3.11.1",
|
|
||||||
"body-parser": "^1.20.1",
|
"body-parser": "^1.20.1",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^5.2.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"electron": "^22.0.0",
|
"electron": "^22.0.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"getport": "^0.1.0",
|
"get-port": "^6.1.2",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"knex": "^2.3.0",
|
"knex": "^2.4.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"minimist": "^1.2.7",
|
"minimist": "^1.2.7",
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"open": "^8.4.0",
|
"open": "^8.4.0",
|
||||||
|
@ -70,22 +71,22 @@
|
||||||
"@types/cors": "^2.8.13",
|
"@types/cors": "^2.8.13",
|
||||||
"@types/cross-spawn": "^6.0.2",
|
"@types/cross-spawn": "^6.0.2",
|
||||||
"@types/express": "^4.17.15",
|
"@types/express": "^4.17.15",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash-es": "^4.17.6",
|
||||||
"@types/minimist": "^1.2.2",
|
"@types/minimist": "^1.2.2",
|
||||||
"@types/morgan": "^1.9.3",
|
"@types/morgan": "^1.9.4",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/semver": "^7.3.13",
|
"@types/semver": "^7.3.13",
|
||||||
"@types/socketcluster-client": "^16.0.0",
|
"@types/socketcluster-client": "^16.0.0",
|
||||||
"@types/socketcluster-server": "^16.1.0",
|
"@types/socketcluster-server": "^16.1.0",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@types/supertest": "^2.0.12",
|
"@types/supertest": "^2.0.12",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { Store } from '../store';
|
import type { Store } from '../store.js';
|
||||||
|
|
||||||
export const schema = fs
|
export const schema = fs.readFileSync(
|
||||||
.readFileSync(require.resolve('./schema_def.graphql'))
|
new URL('./schema_def.graphql', import.meta.url),
|
||||||
.toString();
|
'utf8'
|
||||||
|
);
|
||||||
|
|
||||||
export const resolvers = {
|
export const resolvers = {
|
||||||
Query: {
|
Query: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import { Options } from '../options';
|
import type { Options } from '../options.js';
|
||||||
|
|
||||||
const name = '@redux-devtools/cli';
|
const name = '@redux-devtools/cli';
|
||||||
const startFlag = '/* ' + name + ' start */';
|
const startFlag = '/* ' + name + ' start */';
|
||||||
|
@ -56,7 +56,7 @@ export function inject(
|
||||||
startFlag,
|
startFlag,
|
||||||
' require("' + name + '")(' + JSON.stringify(options) + ')',
|
' require("' + name + '")(' + JSON.stringify(options) + ')',
|
||||||
' .then(_remotedev =>',
|
' .then(_remotedev =>',
|
||||||
' _remotedev.on("ready", () => {',
|
' _remotedev.ready.then(() => {',
|
||||||
' if (!_remotedev.portAlreadyUsed) console.log("-".repeat(80));',
|
' if (!_remotedev.portAlreadyUsed) console.log("-".repeat(80));',
|
||||||
' ' + serverFlag,
|
' ' + serverFlag,
|
||||||
' })',
|
' })',
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import open from 'open';
|
import open from 'open';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
import { createRequire } from 'module';
|
||||||
import spawn from 'cross-spawn';
|
import spawn from 'cross-spawn';
|
||||||
import { Options } from '../options';
|
import type { Options } from '../options.js';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
export default async function openApp(app: true | string, options: Options) {
|
export default async function openApp(app: true | string, options: Options) {
|
||||||
if (app === true || app === 'electron') {
|
if (app === true || app === 'electron') {
|
||||||
|
@ -11,8 +15,13 @@ export default async function openApp(app: true | string, options: Options) {
|
||||||
const protocol = options.protocol ? `--protocol=${options.protocol}` : '';
|
const protocol = options.protocol ? `--protocol=${options.protocol}` : '';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
spawn.sync(require('electron') as string, [
|
spawn(require('electron') as string, [
|
||||||
path.join(__dirname, '..', '..', 'app'),
|
path.join(
|
||||||
|
path.dirname(fileURLToPath(import.meta.url)),
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'app'
|
||||||
|
),
|
||||||
port,
|
port,
|
||||||
host,
|
host,
|
||||||
protocol,
|
protocol,
|
||||||
|
|
|
@ -3,10 +3,10 @@ import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import parseArgs from 'minimist';
|
import parseArgs from 'minimist';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import * as injectServer from './injectServer';
|
import * as injectServer from './injectServer.js';
|
||||||
import getOptions from '../options';
|
import getOptions from '../options.js';
|
||||||
import server from '../index';
|
import server from '../index.js';
|
||||||
import openApp from './openApp';
|
import openApp from './openApp.js';
|
||||||
|
|
||||||
const argv = parseArgs(process.argv.slice(2));
|
const argv = parseArgs(process.argv.slice(2));
|
||||||
|
|
||||||
|
@ -87,10 +87,8 @@ if (argv.injectserver) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
const response = await server(argv);
|
||||||
server(argv).then(async function (r) {
|
if (argv.open && argv.open !== 'false') {
|
||||||
if (argv.open && argv.open !== 'false') {
|
await response.ready;
|
||||||
await r.listener('ready').once();
|
await openApp(argv.open as string, options);
|
||||||
await openApp(argv.open as string, options);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
@ -1,23 +1,37 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import knexModule, { Knex } from 'knex';
|
import { fileURLToPath } from 'url';
|
||||||
|
import knex from 'knex';
|
||||||
|
import type { Knex } from 'knex';
|
||||||
import { AGServer } from 'socketcluster-server';
|
import { AGServer } from 'socketcluster-server';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
|
type KnexFunction = <TRecord extends {} = any, TResult = unknown[]>(
|
||||||
|
config: Knex.Config | string
|
||||||
|
) => Knex<TRecord, TResult>;
|
||||||
|
|
||||||
export default function connector(options: AGServer.AGServerOptions) {
|
export default function connector(options: AGServer.AGServerOptions) {
|
||||||
const dbOptions = options.dbOptions as Knex.Config;
|
const dbOptions = options.dbOptions as Knex.Config;
|
||||||
dbOptions.useNullAsDefault = true;
|
dbOptions.useNullAsDefault = true;
|
||||||
if (!(dbOptions as any).migrate) {
|
if (!(dbOptions as any).migrate) {
|
||||||
return knexModule(dbOptions);
|
return (knex as unknown as KnexFunction)(dbOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbOptions.migrations = { directory: path.resolve(__dirname, 'migrations') };
|
dbOptions.migrations = {
|
||||||
dbOptions.seeds = { directory: path.resolve(__dirname, 'seeds') };
|
directory: path.join(
|
||||||
const knex = knexModule(dbOptions);
|
path.dirname(fileURLToPath(import.meta.url)),
|
||||||
|
'migrations'
|
||||||
|
),
|
||||||
|
};
|
||||||
|
dbOptions.seeds = {
|
||||||
|
directory: path.join(path.dirname(fileURLToPath(import.meta.url)), 'seeds'),
|
||||||
|
};
|
||||||
|
const knexInstance = (knex as unknown as KnexFunction)(dbOptions);
|
||||||
|
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
knex.migrate
|
knexInstance.migrate
|
||||||
.latest({ loadExtensions: ['.js'] })
|
.latest({ loadExtensions: ['.js'] })
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return knex.seed.run({ loadExtensions: ['.js'] });
|
return knexInstance.seed.run({ loadExtensions: ['.js'] });
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
console.log(' \x1b[0;32m[Done]\x1b[0m Migrations are finished\n');
|
console.log(' \x1b[0;32m[Done]\x1b[0m Migrations are finished\n');
|
||||||
|
@ -27,5 +41,5 @@ export default function connector(options: AGServer.AGServerOptions) {
|
||||||
});
|
});
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
|
||||||
return knex;
|
return knexInstance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
declare module 'getport' {
|
|
||||||
export default function getport(
|
|
||||||
start: number,
|
|
||||||
callback: (e: Error | undefined, port: number) => void
|
|
||||||
): void;
|
|
||||||
}
|
|
|
@ -1,23 +1,19 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import getPort from 'getport';
|
import getPort from 'get-port';
|
||||||
import socketClusterServer from 'socketcluster-server';
|
import socketClusterServer from 'socketcluster-server';
|
||||||
import getOptions, { Options } from './options';
|
import getOptions from './options.js';
|
||||||
import routes from './routes';
|
import routes from './routes.js';
|
||||||
import createStore from './store';
|
import createStore from './store.js';
|
||||||
|
|
||||||
// var LOG_LEVEL_NONE = 0;
|
// const LOG_LEVEL_NONE = 0;
|
||||||
const LOG_LEVEL_ERROR = 1;
|
// const LOG_LEVEL_ERROR = 1;
|
||||||
const LOG_LEVEL_WARN = 2;
|
const LOG_LEVEL_WARN = 2;
|
||||||
const LOG_LEVEL_INFO = 3;
|
const LOG_LEVEL_INFO = 3;
|
||||||
|
|
||||||
export interface ExtendedOptions extends Options {
|
export default async function (argv: { [arg: string]: any }): Promise<{
|
||||||
allowClientPublish: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function (argv: { [arg: string]: any }): Promise<{
|
|
||||||
portAlreadyUsed?: boolean;
|
portAlreadyUsed?: boolean;
|
||||||
listener: (eventName: 'ready') => { once(): Promise<void> };
|
ready: Promise<void>;
|
||||||
}> {
|
}> {
|
||||||
const options = Object.assign(getOptions(argv), {
|
const options = Object.assign(getOptions(argv), {
|
||||||
allowClientPublish: false,
|
allowClientPublish: false,
|
||||||
|
@ -25,131 +21,117 @@ export default function (argv: { [arg: string]: any }): Promise<{
|
||||||
const port = options.port;
|
const port = options.port;
|
||||||
const logLevel =
|
const logLevel =
|
||||||
options.logLevel === undefined ? LOG_LEVEL_INFO : options.logLevel;
|
options.logLevel === undefined ? LOG_LEVEL_INFO : options.logLevel;
|
||||||
return new Promise(function (resolve) {
|
// Check port already used
|
||||||
// Check port already used
|
const p = await getPort({ port });
|
||||||
getPort(port, function (err, p) {
|
if (port !== p) {
|
||||||
/* eslint-disable no-console */
|
if (logLevel >= LOG_LEVEL_WARN) {
|
||||||
if (err) {
|
console.log(`[ReduxDevTools] Server port ${port} is already used.`);
|
||||||
if (logLevel >= LOG_LEVEL_ERROR) {
|
}
|
||||||
console.error(err);
|
return {
|
||||||
}
|
portAlreadyUsed: true,
|
||||||
return;
|
ready: Promise.resolve(),
|
||||||
}
|
};
|
||||||
if (port !== p) {
|
}
|
||||||
if (logLevel >= LOG_LEVEL_WARN) {
|
|
||||||
console.log(`[ReduxDevTools] Server port ${port} is already used.`);
|
|
||||||
}
|
|
||||||
resolve({
|
|
||||||
portAlreadyUsed: true,
|
|
||||||
listener: function (eventName: 'ready') {
|
|
||||||
return {
|
|
||||||
once() {
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (logLevel >= LOG_LEVEL_INFO) {
|
|
||||||
console.log('[ReduxDevTools] Start server...');
|
|
||||||
console.log('-'.repeat(80) + '\n');
|
|
||||||
}
|
|
||||||
const httpServer = http.createServer();
|
|
||||||
const agServer = socketClusterServer.attach(httpServer, options);
|
|
||||||
|
|
||||||
const app = express();
|
if (logLevel >= LOG_LEVEL_INFO) {
|
||||||
httpServer.on('request', app);
|
console.log('[ReduxDevTools] Start server...');
|
||||||
const store = createStore(options);
|
console.log('-'.repeat(80) + '\n');
|
||||||
app.use(routes(options, store, agServer));
|
}
|
||||||
|
const httpServer = http.createServer();
|
||||||
|
const agServer = socketClusterServer.attach(httpServer, options);
|
||||||
|
|
||||||
agServer.setMiddleware(
|
const app = express();
|
||||||
agServer.MIDDLEWARE_INBOUND,
|
httpServer.on('request', app);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
const store = createStore(options);
|
||||||
async (middlewareStream) => {
|
app.use(routes(options, store, agServer));
|
||||||
for await (const action of middlewareStream) {
|
|
||||||
if (action.type === action.TRANSMIT) {
|
agServer.setMiddleware(
|
||||||
const channel = action.receiver;
|
agServer.MIDDLEWARE_INBOUND,
|
||||||
const data = action.data;
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
if (
|
async (middlewareStream) => {
|
||||||
channel.substring(0, 3) === 'sc-' ||
|
for await (const action of middlewareStream) {
|
||||||
channel === 'respond' ||
|
if (action.type === action.TRANSMIT) {
|
||||||
channel === 'log'
|
const channel = action.receiver;
|
||||||
) {
|
const data = action.data;
|
||||||
void agServer.exchange.transmitPublish(channel, data);
|
if (
|
||||||
} else if (channel === 'log-noid') {
|
channel.substring(0, 3) === 'sc-' ||
|
||||||
void agServer.exchange.transmitPublish('log', {
|
channel === 'respond' ||
|
||||||
id: action.socket.id,
|
channel === 'log'
|
||||||
data: data,
|
) {
|
||||||
});
|
void agServer.exchange.transmitPublish(channel, data);
|
||||||
}
|
} else if (channel === 'log-noid') {
|
||||||
} else if (action.type === action.SUBSCRIBE) {
|
void agServer.exchange.transmitPublish('log', {
|
||||||
if (action.channel === 'report') {
|
id: action.socket.id,
|
||||||
store
|
data: data,
|
||||||
.list()
|
});
|
||||||
.then(function (data) {
|
|
||||||
void agServer.exchange.transmitPublish('report', {
|
|
||||||
type: 'list',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.error(error); // eslint-disable-line no-console
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
action.allow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
} else if (action.type === action.SUBSCRIBE) {
|
||||||
|
if (action.channel === 'report') {
|
||||||
void (async () => {
|
store
|
||||||
for await (const { socket } of agServer.listener('connection')) {
|
.list()
|
||||||
let channelToWatch: string, channelToEmit: string;
|
.then(function (data) {
|
||||||
void (async () => {
|
void agServer.exchange.transmitPublish('report', {
|
||||||
for await (const request of socket.procedure('login')) {
|
type: 'list',
|
||||||
const credentials = request.data;
|
data: data,
|
||||||
if (credentials === 'master') {
|
|
||||||
channelToWatch = 'respond';
|
|
||||||
channelToEmit = 'log';
|
|
||||||
} else {
|
|
||||||
channelToWatch = 'log';
|
|
||||||
channelToEmit = 'respond';
|
|
||||||
}
|
|
||||||
request.end(channelToWatch);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
void (async () => {
|
|
||||||
for await (const request of socket.procedure('getReport')) {
|
|
||||||
const id = request.data as string;
|
|
||||||
store
|
|
||||||
.get(id)
|
|
||||||
.then(function (data) {
|
|
||||||
request.end(data);
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.error(error); // eslint-disable-line no-console
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
void (async () => {
|
|
||||||
for await (const data of socket.listener('disconnect')) {
|
|
||||||
const channel = agServer.exchange.channel('sc-' + socket.id);
|
|
||||||
channel.unsubscribe();
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
void agServer.exchange.transmitPublish(channelToEmit!, {
|
|
||||||
id: socket.id,
|
|
||||||
type: 'DISCONNECTED',
|
|
||||||
});
|
});
|
||||||
}
|
})
|
||||||
})();
|
.catch(function (error) {
|
||||||
|
console.error(error); // eslint-disable-line no-console
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})();
|
}
|
||||||
|
action.allow();
|
||||||
httpServer.listen(options.port);
|
|
||||||
// @ts-expect-error Shouldn't there be a 'ready' event?
|
|
||||||
resolve(agServer);
|
|
||||||
}
|
}
|
||||||
/* eslint-enable no-console */
|
}
|
||||||
});
|
);
|
||||||
});
|
|
||||||
|
void (async () => {
|
||||||
|
for await (const { socket } of agServer.listener('connection')) {
|
||||||
|
let channelToWatch: string, channelToEmit: string;
|
||||||
|
void (async () => {
|
||||||
|
for await (const request of socket.procedure('login')) {
|
||||||
|
const credentials = request.data;
|
||||||
|
if (credentials === 'master') {
|
||||||
|
channelToWatch = 'respond';
|
||||||
|
channelToEmit = 'log';
|
||||||
|
} else {
|
||||||
|
channelToWatch = 'log';
|
||||||
|
channelToEmit = 'respond';
|
||||||
|
}
|
||||||
|
request.end(channelToWatch);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
void (async () => {
|
||||||
|
for await (const request of socket.procedure('getReport')) {
|
||||||
|
const id = request.data as string;
|
||||||
|
store
|
||||||
|
.get(id)
|
||||||
|
.then(function (data) {
|
||||||
|
request.end(data);
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.error(error); // eslint-disable-line no-console
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
void (async () => {
|
||||||
|
for await (const data of socket.listener('disconnect')) {
|
||||||
|
const channel = agServer.exchange.channel('sc-' + socket.id);
|
||||||
|
channel.unsubscribe();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
void agServer.exchange.transmitPublish(channelToEmit!, {
|
||||||
|
id: socket.id,
|
||||||
|
type: 'DISCONNECTED',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
httpServer.listen(options.port);
|
||||||
|
return {
|
||||||
|
ready: (async () => {
|
||||||
|
await agServer.listener('ready' as 'error').once();
|
||||||
|
})(),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
import { ApolloServer } from 'apollo-server-express';
|
|
||||||
import { schema, resolvers } from '../api/schema';
|
|
||||||
import { Store } from '../store';
|
|
||||||
|
|
||||||
export default function (store: Store) {
|
|
||||||
return new ApolloServer({
|
|
||||||
typeDefs: schema,
|
|
||||||
resolvers,
|
|
||||||
context: {
|
|
||||||
store: store,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
import path from 'path';
|
import fs from 'fs';
|
||||||
|
|
||||||
interface ProtocolOptions {
|
interface ProtocolOptions {
|
||||||
key: string | undefined;
|
key: string | undefined;
|
||||||
|
@ -31,9 +31,14 @@ export interface Options {
|
||||||
export default function getOptions(argv: { [arg: string]: any }): Options {
|
export default function getOptions(argv: { [arg: string]: any }): Options {
|
||||||
let dbOptions = argv.dbOptions;
|
let dbOptions = argv.dbOptions;
|
||||||
if (typeof dbOptions === 'string') {
|
if (typeof dbOptions === 'string') {
|
||||||
dbOptions = require(path.resolve(process.cwd(), argv.dbOptions as string));
|
dbOptions = JSON.parse(fs.readFileSync(dbOptions, 'utf8'));
|
||||||
} else if (typeof dbOptions === 'undefined') {
|
} else if (typeof dbOptions === 'undefined') {
|
||||||
dbOptions = require('../defaultDbOptions.json');
|
dbOptions = JSON.parse(
|
||||||
|
fs.readFileSync(
|
||||||
|
new URL('../defaultDbOptions.json', import.meta.url),
|
||||||
|
'utf8'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import { createRequire } from 'module';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import type { Router } from 'express';
|
import type { Router } from 'express';
|
||||||
import morgan from 'morgan';
|
import morgan from 'morgan';
|
||||||
|
@ -6,12 +8,15 @@ import * as http from 'http';
|
||||||
import bodyParser from 'body-parser';
|
import bodyParser from 'body-parser';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import { AGServer } from 'socketcluster-server';
|
import { AGServer } from 'socketcluster-server';
|
||||||
import { ApolloServer } from 'apollo-server-express';
|
import { ApolloServer } from '@apollo/server';
|
||||||
import { AddData, ReportBaseFields, Store } from './store';
|
import { expressMiddleware } from '@apollo/server/express4';
|
||||||
import { resolvers, schema } from './api/schema';
|
import type { AddData, ReportBaseFields, Store } from './store.js';
|
||||||
|
import { resolvers, schema } from './api/schema.js';
|
||||||
|
|
||||||
const app = express.Router();
|
const app = express.Router();
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
function serveUmdModule(name: string) {
|
function serveUmdModule(name: string) {
|
||||||
app.use(
|
app.use(
|
||||||
express.static(
|
express.static(
|
||||||
|
@ -20,6 +25,10 @@ function serveUmdModule(name: string) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Context {
|
||||||
|
store?: Store;
|
||||||
|
}
|
||||||
|
|
||||||
function routes(
|
function routes(
|
||||||
options: AGServer.AGServerOptions,
|
options: AGServer.AGServerOptions,
|
||||||
store: Store,
|
store: Store,
|
||||||
|
@ -42,19 +51,19 @@ function routes(
|
||||||
else app.use(morgan('combined'));
|
else app.use(morgan('combined'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const server = new ApolloServer({
|
const server = new ApolloServer<Context>({
|
||||||
typeDefs: schema,
|
typeDefs: schema,
|
||||||
resolvers,
|
resolvers,
|
||||||
context: {
|
|
||||||
store: store,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
server
|
server
|
||||||
.start()
|
.start()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
server.applyMiddleware({ app } as {
|
app.use(
|
||||||
app: express.Application;
|
'/graphql',
|
||||||
});
|
cors<cors.CorsRequest>(),
|
||||||
|
bodyParser.json(),
|
||||||
|
expressMiddleware(server, { context: () => Promise.resolve({ store }) })
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error); // eslint-disable-line no-console
|
console.error(error); // eslint-disable-line no-console
|
||||||
|
@ -69,7 +78,12 @@ function routes(
|
||||||
res.send(`reduxDevToolsPort = ${options.port}`);
|
res.send(`reduxDevToolsPort = ${options.port}`);
|
||||||
});
|
});
|
||||||
app.get('*', function (req, res) {
|
app.get('*', function (req, res) {
|
||||||
res.sendFile(path.join(__dirname, '../app/index.html'));
|
res.sendFile(
|
||||||
|
path.join(
|
||||||
|
path.dirname(fileURLToPath(import.meta.url)),
|
||||||
|
'../app/index.html'
|
||||||
|
)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(cors({ methods: 'POST' }));
|
app.use(cors({ methods: 'POST' }));
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { v4 as uuidV4 } from 'uuid';
|
import { v4 as uuidV4 } from 'uuid';
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash-es';
|
||||||
import { AGServer } from 'socketcluster-server';
|
import { AGServer } from 'socketcluster-server';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import connector from './db/connector';
|
import connector from './db/connector.js';
|
||||||
|
|
||||||
const reports = 'remotedev_reports';
|
const reports = 'remotedev_reports';
|
||||||
// var payloads = 'remotedev_payloads';
|
// var payloads = 'remotedev_payloads';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "CommonJS",
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
"outDir": "dist"
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"]
|
||||||
|
|
|
@ -41,15 +41,15 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"parse-key": "^0.2.1",
|
"parse-key": "^0.2.1",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-dock": "^0.6.0"
|
"react-dock": "^0.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -58,10 +58,10 @@
|
||||||
"@redux-devtools/core": "^3.13.1",
|
"@redux-devtools/core": "^3.13.1",
|
||||||
"@types/parse-key": "^0.2.0",
|
"@types/parse-key": "^0.2.0",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
|
@ -29,20 +29,20 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"immutable": "^4.1.0"
|
"immutable": "^4.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
|
|
|
@ -15,36 +15,36 @@
|
||||||
"@redux-devtools/inspector-monitor": "^3.0.0",
|
"@redux-devtools/inspector-monitor": "^3.0.0",
|
||||||
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
|
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
|
||||||
"@redux-devtools/ui": "^1.3.0",
|
"@redux-devtools/ui": "^1.3.0",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"lodash.shuffle": "^4.2.0",
|
"lodash.shuffle": "^4.2.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-is": "^18.2.0",
|
"react-is": "^18.2.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.6.0",
|
"react-router-dom": "^6.6.1",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"styled-components": "^5.3.6"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/lodash.shuffle": "^4.2.7",
|
"@types/lodash.shuffle": "^4.2.7",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/redux-logger": "^3.0.9",
|
"@types/redux-logger": "^3.0.9",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -5,7 +5,8 @@ module.exports = {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
|
'^.+\\.jsx?$': 'babel-jest',
|
||||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
||||||
},
|
},
|
||||||
resolver: '<rootDir>/jestResolver.js',
|
transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
module.exports = (path, options) => {
|
|
||||||
return options.defaultResolver(path, {
|
|
||||||
...options,
|
|
||||||
packageFilter: (pkg) => {
|
|
||||||
if (pkg.name === 'nanoid') {
|
|
||||||
pkg.exports['.'].browser = pkg.exports['.'].require;
|
|
||||||
}
|
|
||||||
return pkg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -43,7 +43,7 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@redux-devtools/ui": "^1.3.0",
|
"@redux-devtools/ui": "^1.3.0",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"es6template": "^1.0.5",
|
"es6template": "^1.0.5",
|
||||||
|
@ -55,8 +55,8 @@
|
||||||
"simple-diff": "^1.6.0"
|
"simple-diff": "^1.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -65,17 +65,17 @@
|
||||||
"@redux-devtools/core": "^3.13.0",
|
"@redux-devtools/core": "^3.13.0",
|
||||||
"@redux-devtools/inspector-monitor": "^3.0.0",
|
"@redux-devtools/inspector-monitor": "^3.0.0",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@types/es6template": "^1.0.0",
|
"@types/es6template": "^1.0.1",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/jsan": "^3.1.2",
|
"@types/jsan": "^3.1.2",
|
||||||
"@types/object-path": "^0.11.1",
|
"@types/object-path": "^0.11.1",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/simple-diff": "^1.6.1",
|
"@types/simple-diff": "^1.6.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.18.6",
|
"@babel/code-frame": "^7.18.6",
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/chrome": "^0.0.206",
|
"@types/chrome": "^0.0.206",
|
||||||
"anser": "^2.1.1",
|
"anser": "^2.1.1",
|
||||||
"html-entities": "^2.3.3",
|
"html-entities": "^2.3.3",
|
||||||
|
@ -40,8 +40,8 @@
|
||||||
"source-map": "^0.5.7"
|
"source-map": "^0.5.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -52,17 +52,17 @@
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@types/babel__code-frame": "^7.0.3",
|
"@types/babel__code-frame": "^7.0.3",
|
||||||
"@types/html-entities": "^1.3.4",
|
"@types/html-entities": "^1.3.4",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/path-browserify": "^1.0.0",
|
"@types/path-browserify": "^1.0.0",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
"@types/source-map": "0.5.2",
|
"@types/source-map": "0.5.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 3.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [81926f32]
|
||||||
|
- react-json-tree@0.18.0
|
||||||
|
|
||||||
## 3.0.1
|
## 3.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -14,34 +14,34 @@
|
||||||
"@redux-devtools/dock-monitor": "^3.0.0",
|
"@redux-devtools/dock-monitor": "^3.0.0",
|
||||||
"@redux-devtools/inspector-monitor": "^3.0.0",
|
"@redux-devtools/inspector-monitor": "^3.0.0",
|
||||||
"base16": "^1.0.0",
|
"base16": "^1.0.0",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"lodash.shuffle": "^4.2.0",
|
"lodash.shuffle": "^4.2.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-bootstrap": "^2.7.0",
|
"react-bootstrap": "^2.7.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.6.0",
|
"react-router-dom": "^6.6.1",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"redux-logger": "^3.0.6"
|
"redux-logger": "^3.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/base16": "^1.0.2",
|
"@types/base16": "^1.0.2",
|
||||||
"@types/lodash.shuffle": "^4.2.7",
|
"@types/lodash.shuffle": "^4.2.7",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/redux-logger": "^3.0.9",
|
"@types/redux-logger": "^3.0.9",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@redux-devtools/inspector-monitor",
|
"name": "@redux-devtools/inspector-monitor",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"description": "Redux DevTools Diff Monitor",
|
"description": "Redux DevTools Diff Monitor",
|
||||||
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-inspector-monitor",
|
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-inspector-monitor",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -35,13 +35,13 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/dragula": "^3.7.1",
|
"@types/dragula": "^3.7.1",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"dateformat": "^4.6.3",
|
"dateformat": "^5.0.3",
|
||||||
"hex-rgba": "^1.0.2",
|
"hex-rgba": "^1.0.2",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"javascript-stringify": "^2.1.0",
|
"javascript-stringify": "^2.1.0",
|
||||||
"jsondiffpatch": "^0.4.1",
|
"jsondiffpatch": "^0.4.1",
|
||||||
"jss": "^10.9.2",
|
"jss": "^10.9.2",
|
||||||
|
@ -50,29 +50,29 @@
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-base16-styling": "^0.9.1",
|
"react-base16-styling": "^0.9.1",
|
||||||
"react-dragula": "^1.1.17",
|
"react-dragula": "^1.1.17",
|
||||||
"react-json-tree": "^0.17.0",
|
"react-json-tree": "^0.18.0",
|
||||||
"redux-devtools-themes": "^1.0.0"
|
"redux-devtools-themes": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@redux-devtools/core": "^3.13.1",
|
"@redux-devtools/core": "^3.13.1",
|
||||||
"@types/dateformat": "^3.0.1",
|
"@types/dateformat": "^5.0.0",
|
||||||
"@types/hex-rgba": "^1.0.1",
|
"@types/hex-rgba": "^1.0.1",
|
||||||
"@types/history": "^4.7.11",
|
"@types/history": "^4.7.11",
|
||||||
"@types/lodash.debounce": "^4.0.7",
|
"@types/lodash.debounce": "^4.0.7",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dragula": "^1.1.0",
|
"@types/react-dragula": "^1.1.0",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
||||||
import { Base16Theme } from 'redux-devtools-themes';
|
import { Base16Theme } from 'redux-devtools-themes';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import type { StylingFunction } from 'react-base16-styling';
|
import type { StylingFunction } from 'react-base16-styling';
|
||||||
|
import type { LabelRenderer } from 'react-json-tree';
|
||||||
import { PerformAction } from '@redux-devtools/core';
|
import { PerformAction } from '@redux-devtools/core';
|
||||||
import { Delta } from 'jsondiffpatch';
|
import { Delta } from 'jsondiffpatch';
|
||||||
import { DEFAULT_STATE, DevtoolsInspectorState } from './redux';
|
import { DEFAULT_STATE, DevtoolsInspectorState } from './redux';
|
||||||
|
@ -11,12 +12,7 @@ import StateTab from './tabs/StateTab';
|
||||||
import ActionTab from './tabs/ActionTab';
|
import ActionTab from './tabs/ActionTab';
|
||||||
|
|
||||||
export interface TabComponentProps<S, A extends Action<unknown>> {
|
export interface TabComponentProps<S, A extends Action<unknown>> {
|
||||||
labelRenderer: (
|
labelRenderer: LabelRenderer;
|
||||||
keyPath: (string | number)[],
|
|
||||||
nodeType: string,
|
|
||||||
expanded: boolean,
|
|
||||||
expandable: boolean
|
|
||||||
) => React.ReactNode;
|
|
||||||
styling: StylingFunction;
|
styling: StylingFunction;
|
||||||
computedStates: { state: S; error?: string }[];
|
computedStates: { state: S; error?: string }[];
|
||||||
actions: { [actionId: number]: PerformAction<A> };
|
actions: { [actionId: number]: PerformAction<A> };
|
||||||
|
@ -152,11 +148,7 @@ class ActionPreview<S, A extends Action<unknown>> extends Component<
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
labelRenderer = (
|
labelRenderer: LabelRenderer = ([key, ...rest], nodeType, expanded) => {
|
||||||
[key, ...rest]: (string | number)[],
|
|
||||||
nodeType: string,
|
|
||||||
expanded: boolean
|
|
||||||
) => {
|
|
||||||
const { styling, onInspectPath, inspectedPath } = this.props;
|
const { styling, onInspectPath, inspectedPath } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -28,13 +28,18 @@ import {
|
||||||
updateMonitorState,
|
updateMonitorState,
|
||||||
} from './redux';
|
} from './redux';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
||||||
const {
|
const {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
commit,
|
commit,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
sweep,
|
sweep,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
toggleAction,
|
toggleAction,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
jumpToAction,
|
jumpToAction,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
jumpToState,
|
jumpToState,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
reorderAction,
|
reorderAction,
|
||||||
} = ActionCreators;
|
} = ActionCreators;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export type { StylingFunction } from 'react-base16-styling';
|
export type { StylingFunction } from 'react-base16-styling';
|
||||||
|
export type { LabelRenderer } from 'react-json-tree';
|
||||||
export { default as InspectorMonitor } from './DevtoolsInspector';
|
export { default as InspectorMonitor } from './DevtoolsInspector';
|
||||||
export type { Tab, TabComponentProps } from './ActionPreview';
|
export type { Tab, TabComponentProps } from './ActionPreview';
|
||||||
export type { DevtoolsInspectorState } from './redux';
|
export type { DevtoolsInspectorState } from './redux';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { JSONTree } from 'react-json-tree';
|
import { JSONTree } from 'react-json-tree';
|
||||||
|
import type { LabelRenderer, ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { stringify } from 'javascript-stringify';
|
import { stringify } from 'javascript-stringify';
|
||||||
import { Delta } from 'jsondiffpatch';
|
import { Delta } from 'jsondiffpatch';
|
||||||
import { StylingFunction } from 'react-base16-styling';
|
import { StylingFunction } from 'react-base16-styling';
|
||||||
|
@ -22,11 +23,8 @@ function stringifyAndShrink(val: any, isWideLayout?: boolean) {
|
||||||
return str.length > 22 ? `${str.substr(0, 15)}…${str.substr(-5)}` : str;
|
return str.length > 22 ? `${str.substr(0, 15)}…${str.substr(-5)}` : str;
|
||||||
}
|
}
|
||||||
|
|
||||||
const expandFirstLevel = (
|
const expandFirstLevel: ShouldExpandNodeInitially = (keyName, data, level) =>
|
||||||
keyName: (string | number)[],
|
level <= 1;
|
||||||
data: any,
|
|
||||||
level: number
|
|
||||||
) => level <= 1;
|
|
||||||
|
|
||||||
function prepareDelta(value: any) {
|
function prepareDelta(value: any) {
|
||||||
if (value && value._t === 'a') {
|
if (value && value._t === 'a') {
|
||||||
|
@ -53,12 +51,7 @@ interface Props {
|
||||||
styling: StylingFunction;
|
styling: StylingFunction;
|
||||||
base16Theme: Base16Theme;
|
base16Theme: Base16Theme;
|
||||||
invertTheme: boolean;
|
invertTheme: boolean;
|
||||||
labelRenderer: (
|
labelRenderer: LabelRenderer;
|
||||||
keyPath: (string | number)[],
|
|
||||||
nodeType: string,
|
|
||||||
expanded: boolean,
|
|
||||||
expandable: boolean
|
|
||||||
) => React.ReactNode;
|
|
||||||
isWideLayout: boolean;
|
isWideLayout: boolean;
|
||||||
dataTypeKey: string | symbol | undefined;
|
dataTypeKey: string | symbol | undefined;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +97,7 @@ export default class JSONDiff extends Component<Props, State> {
|
||||||
valueRenderer={this.valueRenderer}
|
valueRenderer={this.valueRenderer}
|
||||||
postprocessValue={prepareDelta}
|
postprocessValue={prepareDelta}
|
||||||
isCustomNode={Array.isArray}
|
isCustomNode={Array.isArray}
|
||||||
shouldExpandNode={expandFirstLevel}
|
shouldExpandNodeInitially={expandFirstLevel}
|
||||||
hideRoot
|
hideRoot
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -41,24 +41,24 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 4.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [81926f32]
|
||||||
|
- react-json-tree@0.18.0
|
||||||
|
|
||||||
## 4.0.1
|
## 4.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@redux-devtools/log-monitor",
|
"name": "@redux-devtools/log-monitor",
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"description": "The default tree view monitor for Redux DevTools",
|
"description": "The default tree view monitor for Redux DevTools",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"redux",
|
"redux",
|
||||||
|
@ -41,18 +41,18 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@types/lodash.debounce": "^4.0.7",
|
"@types/lodash.debounce": "^4.0.7",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-json-tree": "^0.17.0",
|
"react-json-tree": "^0.18.0",
|
||||||
"redux-devtools-themes": "^1.0.0"
|
"redux-devtools-themes": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -60,10 +60,10 @@
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@redux-devtools/core": "^3.13.1",
|
"@redux-devtools/core": "^3.13.1",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { CSSProperties, MouseEventHandler, PureComponent } from 'react';
|
import React, { CSSProperties, MouseEventHandler, PureComponent } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { JSONTree, StylingValue } from 'react-json-tree';
|
import { JSONTree } from 'react-json-tree';
|
||||||
|
import type { ShouldExpandNodeInitially, StylingValue } from 'react-json-tree';
|
||||||
import { Base16Theme } from 'redux-devtools-themes';
|
import { Base16Theme } from 'redux-devtools-themes';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import LogMonitorEntryAction from './LogMonitorEntryAction';
|
import LogMonitorEntryAction from './LogMonitorEntryAction';
|
||||||
|
@ -115,7 +116,7 @@ export default class LogMonitorEntry<
|
||||||
data={data}
|
data={data}
|
||||||
invertTheme={false}
|
invertTheme={false}
|
||||||
keyPath={['state']}
|
keyPath={['state']}
|
||||||
shouldExpandNode={this.shouldExpandNode}
|
shouldExpandNodeInitially={this.shouldExpandNodeInitially}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -149,10 +150,10 @@ export default class LogMonitorEntry<
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
shouldExpandNode = (
|
shouldExpandNodeInitially: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
data: any,
|
data,
|
||||||
level: number
|
level
|
||||||
) => {
|
) => {
|
||||||
return this.props.expandStateRoot && level === 0;
|
return this.props.expandStateRoot && level === 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React, { Component, CSSProperties, MouseEventHandler } from 'react';
|
import React, { Component, CSSProperties, MouseEventHandler } from 'react';
|
||||||
import { JSONTree } from 'react-json-tree';
|
import { JSONTree } from 'react-json-tree';
|
||||||
|
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { Base16Theme } from 'redux-devtools-themes';
|
import { Base16Theme } from 'redux-devtools-themes';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ export default class LogMonitorAction<
|
||||||
invertTheme={false}
|
invertTheme={false}
|
||||||
keyPath={['action']}
|
keyPath={['action']}
|
||||||
data={payload}
|
data={payload}
|
||||||
shouldExpandNode={this.shouldExpandNode}
|
shouldExpandNodeInitially={this.shouldExpandNodeInitially}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
''
|
''
|
||||||
|
@ -51,10 +52,10 @@ export default class LogMonitorAction<
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldExpandNode = (
|
shouldExpandNodeInitially: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
data: any,
|
data,
|
||||||
level: number
|
level
|
||||||
) => {
|
) => {
|
||||||
return this.props.expandActionRoot && level === 0;
|
return this.props.expandActionRoot && level === 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@redux-devtools/instrument": "^2.1.0",
|
"@redux-devtools/instrument": "^2.1.0",
|
||||||
"@redux-devtools/utils": "^2.0.0",
|
"@redux-devtools/utils": "^2.0.0",
|
||||||
"jsan": "^3.1.14",
|
"jsan": "^3.1.14",
|
||||||
|
@ -50,20 +50,20 @@
|
||||||
"socketcluster-client": "^17.1.0"
|
"socketcluster-client": "^17.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/jsan": "^3.1.2",
|
"@types/jsan": "^3.1.2",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/rn-host-detect": "^1.2.0",
|
"@types/rn-host-detect": "^1.2.0",
|
||||||
"@types/socketcluster-client": "^16.0.0",
|
"@types/socketcluster-client": "^16.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 3.1.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [81926f32]
|
||||||
|
- react-json-tree@0.18.0
|
||||||
|
|
||||||
## 3.1.0
|
## 3.1.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@chakra-ui/react": "^2.4.4",
|
"@chakra-ui/react": "^2.4.6",
|
||||||
"@emotion/react": "^11.10.5",
|
"@emotion/react": "^11.10.5",
|
||||||
"@emotion/styled": "^11.10.5",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@mswjs/data": "^0.11.0",
|
"@mswjs/data": "^0.11.0",
|
||||||
|
@ -19,35 +19,35 @@
|
||||||
"@redux-devtools/dock-monitor": "^3.0.0",
|
"@redux-devtools/dock-monitor": "^3.0.0",
|
||||||
"@redux-devtools/rtk-query-monitor": "^3.1.0",
|
"@redux-devtools/rtk-query-monitor": "^3.1.0",
|
||||||
"@reduxjs/toolkit": "^1.9.1",
|
"@reduxjs/toolkit": "^1.9.1",
|
||||||
"framer-motion": "^8.0.1",
|
"framer-motion": "^8.2.4",
|
||||||
"msw": "^0.49.2",
|
"msw": "^0.49.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.7.1",
|
"react-icons": "^4.7.1",
|
||||||
"react-is": "^18.2.0",
|
"react-is": "^18.2.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.6.0",
|
"react-router-dom": "^6.6.1",
|
||||||
"styled-components": "^5.3.6"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/copy-webpack-plugin": "^8.0.1",
|
"@types/copy-webpack-plugin": "^8.0.1",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -152,4 +152,4 @@ export const POKEMON_NAMES = [
|
||||||
'mew',
|
'mew',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type PokemonName = typeof POKEMON_NAMES[number];
|
export type PokemonName = (typeof POKEMON_NAMES)[number];
|
||||||
|
|
|
@ -5,7 +5,8 @@ module.exports = {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
|
'^.+\\.jsx?$': 'babel-jest',
|
||||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
||||||
},
|
},
|
||||||
resolver: '<rootDir>/jestResolver.js',
|
transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
module.exports = (path, options) => {
|
|
||||||
return options.defaultResolver(path, {
|
|
||||||
...options,
|
|
||||||
packageFilter: (pkg) => {
|
|
||||||
if (pkg.name === 'nanoid') {
|
|
||||||
pkg.exports['.'].browser = pkg.exports['.'].require;
|
|
||||||
}
|
|
||||||
return pkg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@redux-devtools/rtk-query-monitor",
|
"name": "@redux-devtools/rtk-query-monitor",
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"description": "rtk-query monitor for Redux DevTools",
|
"description": "rtk-query monitor for Redux DevTools",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"redux",
|
"redux",
|
||||||
|
@ -44,24 +44,24 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@redux-devtools/ui": "^1.3.0",
|
"@redux-devtools/ui": "^1.3.0",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
"hex-rgba": "^1.0.2",
|
"hex-rgba": "^1.0.2",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"jss": "^10.9.2",
|
"jss": "^10.9.2",
|
||||||
"jss-preset-default": "^10.9.2",
|
"jss-preset-default": "^10.9.2",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-base16-styling": "^0.9.1",
|
"react-base16-styling": "^0.9.1",
|
||||||
"react-json-tree": "^0.17.0",
|
"react-json-tree": "^0.18.0",
|
||||||
"redux-devtools-themes": "^1.0.0"
|
"redux-devtools-themes": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
|
@ -71,15 +71,15 @@
|
||||||
"@reduxjs/toolkit": "^1.9.1",
|
"@reduxjs/toolkit": "^1.9.1",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/hex-rgba": "^1.0.1",
|
"@types/hex-rgba": "^1.0.1",
|
||||||
"@types/lodash.debounce": "^4.0.7",
|
"@types/lodash.debounce": "^4.0.7",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { createSelector, Selector } from '@reduxjs/toolkit';
|
import { createSelector, Selector } from '@reduxjs/toolkit';
|
||||||
import React, { ReactNode, PureComponent } from 'react';
|
import React, { ReactNode, PureComponent } from 'react';
|
||||||
import { Action, AnyAction } from 'redux';
|
import { Action, AnyAction } from 'redux';
|
||||||
|
import type { KeyPath, ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { QueryPreviewTabs } from '../types';
|
import { QueryPreviewTabs } from '../types';
|
||||||
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
||||||
import { emptyRecord, identity } from '../utils/object';
|
import { emptyRecord, identity } from '../utils/object';
|
||||||
|
@ -43,7 +44,7 @@ export class QueryPreviewActions extends PureComponent<QueryPreviewActionsProps>
|
||||||
return output;
|
return output;
|
||||||
});
|
});
|
||||||
|
|
||||||
isLastActionNode = (keyPath: (string | number)[], layer: number): boolean => {
|
isLastActionNode = (keyPath: KeyPath, layer: number): boolean => {
|
||||||
if (layer >= 1) {
|
if (layer >= 1) {
|
||||||
const len = this.props.actionsOfQuery.length;
|
const len = this.props.actionsOfQuery.length;
|
||||||
const actionKey = keyPath[keyPath.length - 1];
|
const actionKey = keyPath[keyPath.length - 1];
|
||||||
|
@ -58,11 +59,11 @@ export class QueryPreviewActions extends PureComponent<QueryPreviewActionsProps>
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
shouldExpandNode = (
|
shouldExpandNodeInitially: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
value: unknown,
|
value,
|
||||||
layer: number
|
layer
|
||||||
): boolean => {
|
) => {
|
||||||
if (layer === 1) {
|
if (layer === 1) {
|
||||||
return this.isLastActionNode(keyPath, layer);
|
return this.isLastActionNode(keyPath, layer);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +86,7 @@ export class QueryPreviewActions extends PureComponent<QueryPreviewActionsProps>
|
||||||
rootProps={rootProps}
|
rootProps={rootProps}
|
||||||
data={this.selectFormattedActions(actionsOfQuery)}
|
data={this.selectFormattedActions(actionsOfQuery)}
|
||||||
isWideLayout={isWideLayout}
|
isWideLayout={isWideLayout}
|
||||||
shouldExpandNode={this.shouldExpandNode}
|
shouldExpandNodeInitially={this.shouldExpandNodeInitially}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { ReactNode, PureComponent } from 'react';
|
import React, { ReactNode, PureComponent } from 'react';
|
||||||
|
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { ApiStats, QueryPreviewTabs, RtkQueryApiState } from '../types';
|
import { ApiStats, QueryPreviewTabs, RtkQueryApiState } from '../types';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
||||||
import { TreeView, TreeViewProps } from './TreeView';
|
import { TreeView, TreeViewProps } from './TreeView';
|
||||||
|
@ -17,11 +18,11 @@ const rootProps: TreeViewProps['rootProps'] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export class QueryPreviewApi extends PureComponent<QueryPreviewApiProps> {
|
export class QueryPreviewApi extends PureComponent<QueryPreviewApiProps> {
|
||||||
shouldExpandApiStateNode = (
|
shouldExpandApiStateNode: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
value: unknown,
|
value,
|
||||||
layer: number
|
layer
|
||||||
): boolean => {
|
) => {
|
||||||
const lastKey = keyPath[keyPath.length - 1];
|
const lastKey = keyPath[keyPath.length - 1];
|
||||||
|
|
||||||
return layer <= 1 && lastKey !== 'config';
|
return layer <= 1 && lastKey !== 'config';
|
||||||
|
@ -45,7 +46,7 @@ export class QueryPreviewApi extends PureComponent<QueryPreviewApiProps> {
|
||||||
<TreeView
|
<TreeView
|
||||||
before={<h3>State</h3>}
|
before={<h3>State</h3>}
|
||||||
data={apiState}
|
data={apiState}
|
||||||
shouldExpandNode={this.shouldExpandApiStateNode}
|
shouldExpandNodeInitially={this.shouldExpandApiStateNode}
|
||||||
isWideLayout={isWideLayout}
|
isWideLayout={isWideLayout}
|
||||||
/>
|
/>
|
||||||
{apiStats && (
|
{apiStats && (
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { ReactNode, PureComponent } from 'react';
|
import React, { ReactNode, PureComponent } from 'react';
|
||||||
|
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { QueryPreviewTabs, RtkResourceInfo } from '../types';
|
import { QueryPreviewTabs, RtkResourceInfo } from '../types';
|
||||||
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
||||||
import { TreeView, TreeViewProps } from './TreeView';
|
import { TreeView, TreeViewProps } from './TreeView';
|
||||||
|
@ -15,11 +16,11 @@ const rootProps: TreeViewProps['rootProps'] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export class QueryPreviewData extends PureComponent<QueryPreviewDataProps> {
|
export class QueryPreviewData extends PureComponent<QueryPreviewDataProps> {
|
||||||
shouldExpandNode = (
|
shouldExpandNodeInitially: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
value: unknown,
|
value,
|
||||||
layer: number
|
layer
|
||||||
): boolean => {
|
) => {
|
||||||
return layer <= 1;
|
return layer <= 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ export class QueryPreviewData extends PureComponent<QueryPreviewDataProps> {
|
||||||
rootProps={rootProps}
|
rootProps={rootProps}
|
||||||
data={data}
|
data={data}
|
||||||
isWideLayout={isWideLayout}
|
isWideLayout={isWideLayout}
|
||||||
shouldExpandNode={this.shouldExpandNode}
|
shouldExpandNodeInitially={this.shouldExpandNodeInitially}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { createSelector, Selector } from '@reduxjs/toolkit';
|
import { createSelector, Selector } from '@reduxjs/toolkit';
|
||||||
import { QueryStatus } from '@reduxjs/toolkit/dist/query';
|
import { QueryStatus } from '@reduxjs/toolkit/dist/query';
|
||||||
import React, { ReactNode, PureComponent } from 'react';
|
import React, { ReactNode, PureComponent } from 'react';
|
||||||
|
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { QueryPreviewTabs, RtkResourceInfo, RTKStatusFlags } from '../types';
|
import { QueryPreviewTabs, RtkResourceInfo, RTKStatusFlags } from '../types';
|
||||||
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
import { renderTabPanelButtonId, renderTabPanelId } from '../utils/a11y';
|
||||||
import { formatMs } from '../utils/formatters';
|
import { formatMs } from '../utils/formatters';
|
||||||
|
@ -35,11 +36,11 @@ export interface QueryPreviewInfoProps {
|
||||||
isWideLayout: boolean;
|
isWideLayout: boolean;
|
||||||
}
|
}
|
||||||
export class QueryPreviewInfo extends PureComponent<QueryPreviewInfoProps> {
|
export class QueryPreviewInfo extends PureComponent<QueryPreviewInfoProps> {
|
||||||
shouldExpandNode = (
|
shouldExpandNodeInitially: ShouldExpandNodeInitially = (
|
||||||
keyPath: (string | number)[],
|
keyPath,
|
||||||
value: unknown,
|
value,
|
||||||
layer: number
|
layer
|
||||||
): boolean => {
|
) => {
|
||||||
const lastKey = keyPath[keyPath.length - 1];
|
const lastKey = keyPath[keyPath.length - 1];
|
||||||
|
|
||||||
return layer <= 1 && lastKey !== 'query' && lastKey !== 'mutation';
|
return layer <= 1 && lastKey !== 'query' && lastKey !== 'mutation';
|
||||||
|
@ -107,7 +108,7 @@ export class QueryPreviewInfo extends PureComponent<QueryPreviewInfoProps> {
|
||||||
rootProps={rootProps}
|
rootProps={rootProps}
|
||||||
data={formattedQuery}
|
data={formattedQuery}
|
||||||
isWideLayout={isWideLayout}
|
isWideLayout={isWideLayout}
|
||||||
shouldExpandNode={this.shouldExpandNode}
|
shouldExpandNodeInitially={this.shouldExpandNodeInitially}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface TreeViewProps
|
||||||
extends Partial<
|
extends Partial<
|
||||||
Pick<
|
Pick<
|
||||||
ComponentProps<typeof JSONTree>,
|
ComponentProps<typeof JSONTree>,
|
||||||
'keyPath' | 'shouldExpandNode' | 'hideRoot'
|
'keyPath' | 'shouldExpandNodeInitially' | 'hideRoot'
|
||||||
>
|
>
|
||||||
> {
|
> {
|
||||||
data: unknown;
|
data: unknown;
|
||||||
|
@ -30,7 +30,7 @@ export interface TreeViewProps
|
||||||
export class TreeView extends React.PureComponent<TreeViewProps> {
|
export class TreeView extends React.PureComponent<TreeViewProps> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
hideRoot: true,
|
hideRoot: true,
|
||||||
shouldExpandNode: (
|
shouldExpandNodeInitially: (
|
||||||
keyPath: (string | number)[],
|
keyPath: (string | number)[],
|
||||||
value: unknown,
|
value: unknown,
|
||||||
layer: number
|
layer: number
|
||||||
|
@ -81,7 +81,7 @@ export class TreeView extends React.PureComponent<TreeViewProps> {
|
||||||
after,
|
after,
|
||||||
children,
|
children,
|
||||||
keyPath,
|
keyPath,
|
||||||
shouldExpandNode,
|
shouldExpandNodeInitially,
|
||||||
hideRoot,
|
hideRoot,
|
||||||
rootProps,
|
rootProps,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
@ -94,7 +94,7 @@ export class TreeView extends React.PureComponent<TreeViewProps> {
|
||||||
{before}
|
{before}
|
||||||
<JSONTree
|
<JSONTree
|
||||||
keyPath={keyPath}
|
keyPath={keyPath}
|
||||||
shouldExpandNode={shouldExpandNode}
|
shouldExpandNodeInitially={shouldExpandNodeInitially}
|
||||||
data={data}
|
data={data}
|
||||||
labelRenderer={this.selectLabelRenderer(styling)}
|
labelRenderer={this.selectLabelRenderer(styling)}
|
||||||
theme={this.selectTheme(base16Theme)}
|
theme={this.selectTheme(base16Theme)}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { StylingFunction } from 'react-base16-styling';
|
import { StylingFunction } from 'react-base16-styling';
|
||||||
|
import type { LabelRenderer } from 'react-json-tree';
|
||||||
import { isCollection, isIndexed, isKeyed } from 'immutable';
|
import { isCollection, isIndexed, isKeyed } from 'immutable';
|
||||||
import isIterable from '../utils/isIterable';
|
import isIterable from '../utils/isIterable';
|
||||||
|
|
||||||
|
@ -91,12 +92,10 @@ export function getItemString(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createTreeItemLabelRenderer(styling: StylingFunction) {
|
export function createTreeItemLabelRenderer(
|
||||||
return function labelRenderer(
|
styling: StylingFunction
|
||||||
[key]: (string | number)[],
|
): LabelRenderer {
|
||||||
nodeType: string,
|
return function labelRenderer([key], nodeType, expanded) {
|
||||||
expanded: boolean
|
|
||||||
): ReactNode {
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
<span {...styling('treeItemKey')}>{key}</span>
|
<span {...styling('treeItemKey')}>{key}</span>
|
||||||
|
|
|
@ -293,7 +293,7 @@ function computeRtkQueryRequests(
|
||||||
const [queryCacheKey, queryCache] = queryCacheEntries[i];
|
const [queryCacheKey, queryCache] = queryCacheEntries[i];
|
||||||
const requestId: string =
|
const requestId: string =
|
||||||
type === 'queries'
|
type === 'queries'
|
||||||
? (queryCache as typeof api['queries'][string])?.requestId ?? ''
|
? (queryCache as (typeof api)['queries'][string])?.requestId ?? ''
|
||||||
: queryCacheKey;
|
: queryCacheKey;
|
||||||
if (
|
if (
|
||||||
queryCache &&
|
queryCache &&
|
||||||
|
|
|
@ -37,30 +37,30 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"jsan": "^3.1.14"
|
"jsan": "^3.1.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/jest": "^29.2.4",
|
"@types/jest": "^29.2.5",
|
||||||
"@types/jsan": "^3.1.2",
|
"@types/jsan": "^3.1.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"immutable": "^4.1.0",
|
"immutable": "^4.2.2",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.0.3",
|
||||||
"typescript": "~4.9.4"
|
"typescript": "~4.9.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"immutable": "^4.1.0"
|
"immutable": "^4.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,24 +30,24 @@
|
||||||
"todomvc-app-css": "^2.4.2"
|
"todomvc-app-css": "^2.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@types/classnames": "^2.3.1",
|
"@types/classnames": "^2.3.1",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"babel-loader": "^9.1.0",
|
"babel-loader": "^9.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
"fork-ts-checker-webpack-plugin": "^7.2.14",
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"prepublish": "pnpm run type-check && pnpm run lint"
|
"prepublish": "pnpm run type-check && pnpm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.20.6",
|
"@babel/runtime": "^7.20.7",
|
||||||
"@redux-devtools/ui": "^1.3.0",
|
"@redux-devtools/ui": "^1.3.0",
|
||||||
"@types/prop-types": "^15.7.5",
|
"@types/prop-types": "^15.7.5",
|
||||||
"@types/redux-devtools-themes": "^1.0.0",
|
"@types/redux-devtools-themes": "^1.0.0",
|
||||||
|
@ -40,19 +40,19 @@
|
||||||
"redux-devtools-themes": "^1.0.0"
|
"redux-devtools-themes": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.19.3",
|
"@babel/cli": "^7.20.7",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.18.6",
|
||||||
"@redux-devtools/core": "^3.13.1",
|
"@redux-devtools/core": "^3.13.1",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.18",
|
||||||
"@types/react": "^18.0.26",
|
"@types/react": "^18.0.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
||||||
"@typescript-eslint/parser": "^5.47.0",
|
"@typescript-eslint/parser": "^5.48.0",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-react": "^7.31.11",
|
"eslint-plugin-react": "^7.31.11",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
|
@ -5,7 +5,8 @@ module.exports = {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
|
'^.+\\.jsx?$': 'babel-jest',
|
||||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
|
||||||
},
|
},
|
||||||
resolver: '<rootDir>/jestResolver.js',
|
transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
module.exports = (path, options) => {
|
|
||||||
return options.defaultResolver(path, {
|
|
||||||
...options,
|
|
||||||
packageFilter: (pkg) => {
|
|
||||||
if (pkg.name === 'nanoid') {
|
|
||||||
pkg.exports['.'].browser = pkg.exports['.'].require;
|
|
||||||
}
|
|
||||||
return pkg;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user