Skip to content

Commit

Permalink
Move the logic from @redux-devtools/app into @redux-devtools/app-core (
Browse files Browse the repository at this point in the history
…#1655)

This change splits out the main logic from the Redux Devtools App into a new
core package but keeps the socket connection management in @redux-devtools/app.
The aim is to allow for easier reuse of the rest of the app in other envioronments
with their own transport methods, such as React Native or Electron.
  • Loading branch information
matt-oakes committed Jun 12, 2024
1 parent a4382ec commit 96ac1f2
Show file tree
Hide file tree
Showing 70 changed files with 13,805 additions and 10,438 deletions.
6 changes: 6 additions & 0 deletions .changeset/hip-apricots-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@redux-devtools/app-core': major
'@redux-devtools/app': minor
---

Move the logic from @redux-devtools/app into @redux-devtools/app-core
2 changes: 2 additions & 0 deletions packages/redux-devtools-app-core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
lib
21 changes: 21 additions & 0 deletions packages/redux-devtools-app-core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: '../../eslintrc.js.base.json',
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: '../../eslintrc.ts.react.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: true,
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
extends: '../../eslintrc.ts.react.jest.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.test.json'],
},
},
],
};
21 changes: 21 additions & 0 deletions packages/redux-devtools-app-core/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Mihail Diordiev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions packages/redux-devtools-app-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Redux DevTools monitor app core

The core React component and Redux store for the Redux DevTools monitor app. It is split out to allow you to use it directly for transports other than the standard WebSocket one.

### Usage

```js
import { Provider } from 'react-redux';
import { Persistor } from 'redux-persist';
import { PersistGate } from 'redux-persist/integration/react';
import { App } from '@redux-devtools/app-core';
import { store, persistor } from "./yourStore";

export function Root() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor!}>
<App />
</PersistGate>
</Provider>
);
}
```

### License

MIT
8 changes: 8 additions & 0 deletions packages/redux-devtools-app-core/babel.config.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [
["@babel/preset-env", { "targets": "defaults", "modules": false }],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}
8 changes: 8 additions & 0 deletions packages/redux-devtools-app-core/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [
["@babel/preset-env", { "targets": "defaults" }],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}
File renamed without changes.
108 changes: 108 additions & 0 deletions packages/redux-devtools-app-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"name": "@redux-devtools/app-core",
"version": "1.0.0",
"description": "Redux DevTools app core",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-app-core",
"bugs": {
"url": "https://github.com/reduxjs/redux-devtools/issues"
},
"license": "MIT",
"author": "Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)",
"files": [
"build",
"lib",
"src",
"umd"
],
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.24.7",
"@redux-devtools/chart-monitor": "^5.0.1",
"@redux-devtools/core": "^4.0.0",
"@redux-devtools/inspector-monitor": "^6.0.0",
"@redux-devtools/inspector-monitor-test-tab": "^4.0.0",
"@redux-devtools/inspector-monitor-trace-tab": "^4.0.0",
"@redux-devtools/log-monitor": "^5.0.0",
"@redux-devtools/rtk-query-monitor": "^5.0.0",
"@redux-devtools/slider-monitor": "^5.0.0",
"@redux-devtools/ui": "^1.3.1",
"d3-state-visualizer": "^3.0.0",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
"jsondiffpatch": "^0.6.0",
"react-icons": "^5.2.1",
"react-is": "^18.3.1"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/eslint-parser": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@emotion/react": "^11.11.4",
"@rjsf/core": "^4.2.3",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/jsan": "^3.1.5",
"@types/json-schema": "^7.0.15",
"@types/node": "^20.11.30",
"@types/react": "^18.2.72",
"@types/react-dom": "^18.2.22",
"@types/styled-components": "^5.1.34",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"cross-env": "^7.0.3",
"esbuild": "^0.20.2",
"eslint": "^8.57.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^8.1.3",
"redux": "^4.2.1",
"redux-persist": "^6.0.0",
"rimraf": "^5.0.7",
"styled-components": "^5.3.11",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "~5.3.3"
},
"peerDependencies": {
"@emotion/react": "^11.11.4",
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"@types/styled-components": "^5.1.34",
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
"react-redux": "^8.0.0 || ^9.0.0",
"redux": "^4.0.0 || ^5.0.0",
"redux-persist": "^6.0.0",
"styled-components": "^5.3.11"
}
}
Loading

0 comments on commit 96ac1f2

Please sign in to comment.