Skip to content

Commit

Permalink
Move redux-devtools-inspector package (#429)
Browse files Browse the repository at this point in the history
* Move from zalmoxisus/remotedev-inspector-monitor fork

* Fix linting

* Add credits

* Upgrade to react 16

Moved from zalmoxisus/remotedev-inspector-monitor/pull/5

* Upgrade dependences

* Add demo for ES6 map

From
alexkuz/redux-devtools-inspector/commit/9dfaaabcfba7913fd15ee6ee43627e0c
eb1d5c7b
  • Loading branch information
zalmoxisus authored Dec 22, 2018
1 parent 4187bc1 commit 8988026
Show file tree
Hide file tree
Showing 38 changed files with 3,718 additions and 51 deletions.
15 changes: 15 additions & 0 deletions packages/redux-devtools-inspector/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["transform-runtime"],
"env": {
"development": {
"plugins": [["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}]
}]]
}
}
}
57 changes: 57 additions & 0 deletions packages/redux-devtools-inspector/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"parser": "babel-eslint",
"rules": {
"no-undef": ["error"],
"no-trailing-spaces": ["warn"],
"space-before-blocks": ["warn", "always"],
"no-unused-expressions": ["off"],
"no-underscore-dangle": ["off"],
"quote-props": ["warn", "as-needed"],
"no-multi-spaces": ["off"],
"no-unused-vars": ["warn"],
"no-loop-func": ["off"],
"key-spacing": ["off"],
"max-len": ["warn", 100],
"strict": ["off"],
"eol-last": ["warn"],
"no-console": ["warn"],
"indent": ["warn", 2],
"quotes": ["warn", "single", "avoid-escape"],
"curly": ["off"],
"jsx-quotes": ["warn", "prefer-single"],

"react/jsx-boolean-value": "warn",
"react/jsx-no-undef": "error",
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-did-mount-set-state": "warn",
"react/no-did-update-set-state": "warn",
"react/no-multi-comp": "off",
"react/no-unknown-property": "error",
"react/react-in-jsx-scope": "error",
"react/self-closing-comp": "warn",
"react/jsx-wrap-multilines": "warn",

"generator-star-spacing": "off",
"new-cap": "off",
"object-curly-spacing": "off",
"object-shorthand": "off",

"babel/generator-star-spacing": "warn",
"babel/new-cap": "warn",
"babel/object-curly-spacing": ["warn", "always"],
"babel/object-shorthand": "warn"
},
"plugins": [
"react",
"babel"
],
"settings": {
"ecmascript": 6,
"jsx": true
},
"env": {
"browser": true,
"node": true
}
}
8 changes: 8 additions & 0 deletions packages/redux-devtools-inspector/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
static
src
demo
.*
webpack.config.js
index.html
*.gif
*.png
21 changes: 21 additions & 0 deletions packages/redux-devtools-inspector/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2015 Alexander Kuznetsov

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.
68 changes: 68 additions & 0 deletions packages/redux-devtools-inspector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# redux-devtools-inspector

[![npm version](https://badge.fury.io/js/redux-devtools-inspector.svg)](https://badge.fury.io/js/redux-devtools-inspector)

A state monitor for [Redux DevTools](https://github.com/reduxjs/redux-devtools) that provides a convenient way to inspect "real world" app states that could be complicated and deeply nested. Created by [@alexkuz](https://github.com/alexkuz) and merged from [`alexkuz/redux-devtools-inspector`](https://github.com/romseguy/map2tree) into [`reduxjs/redux-devtools` monorepo](https://github.com/reduxjs/redux-devtools).

![](https://raw.githubusercontent.com/alexkuz/redux-devtools-inspector/master/demo.gif)

### Installation

```
npm install --save-dev redux-devtools-inspector
```

### Usage

You can use `Inspector` as the only monitor in your app:

##### `containers/DevTools.js`

```js
import React from 'react';
import { createDevTools } from 'redux-devtools';
import Inspector from 'redux-devtools-inspector';

export default createDevTools(
<Inspector />
);
```

Then you can render `<DevTools>` to any place inside app or even into a separate popup window.

Alternative, you can use it together with [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) to make it dockable.
Consult the [`DockMonitor` README](https://github.com/gaearon/redux-devtools-dock-monitor) for details of this approach.

[Read how to start using Redux DevTools.](https://github.com/gaearon/redux-devtools)

### Features

The inspector displays a list of actions and a preview panel which shows the state after the selected action and a diff with the previous state. If no actions are selected, the last state is shown.

You may pin a certain part of the state to only track its changes.

### Props

Name | Type | Description
------------------ | ---------------- | -------------
`theme` | Object or string | Contains either [base16](https://github.com/chriskempson/base16) theme name or object, that can be `base16` colors map or object containing classnames or styles.
`invertTheme` | Boolean | Inverts theme color luminance, making light theme out of dark theme and vice versa.
`supportImmutable` | Boolean | Better `Immutable` rendering in `Diff` (can affect performance if state has huge objects/arrays). `false` by default.
`tabs` | Array or function | Overrides list of tabs (see below)
`diffObjectHash` | Function | Optional callback for better array handling in diffs (see [jsondiffpatch docs](https://github.com/benjamine/jsondiffpatch/blob/master/docs/arrays.md))
`diffPropertyFilter` | Function | Optional callback for ignoring particular props in diff (see [jsondiffpatch docs](https://github.com/benjamine/jsondiffpatch#options))


If `tabs` is a function, it receives a list of default tabs and should return updated list, for example:
```
defaultTabs => [...defaultTabs, { name: 'My Tab', component: MyTab }]
```
If `tabs` is an array, only provided tabs are rendered.

`component` is provided with `action` and other props, see [`ActionPreview.jsx`](src/ActionPreview.jsx#L42) for reference.

Usage example: [`redux-devtools-test-generator`](https://github.com/zalmoxisus/redux-devtools-test-generator#containersdevtoolsjs).

### License

MIT
Binary file added packages/redux-devtools-inspector/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/redux-devtools-inspector/demo/src/.noderequirer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"import": true
}
14 changes: 14 additions & 0 deletions packages/redux-devtools-inspector/demo/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title><%= htmlWebpackPlugin.options.package.name %></title>
<meta name="description" content="<%= htmlWebpackPlugin.options.package.description %>">
<link href="http://fonts.googleapis.com/css?family=Noto+Sans|Roboto:400,300,500" rel="stylesheet" type="text/css">
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.5/paper/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<a href="<%= htmlWebpackPlugin.options.package.repository.url %>"><img style="z-index: 999999999; position: fixed; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/121cd7cbdc3e4855075ea8b558508b91ac463ac2/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png"></a>
<div id="root"></div>
</body>
</html>
Loading

0 comments on commit 8988026

Please sign in to comment.