mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 22:19:48 +03:00
Use rollup for react-json-tree
This commit is contained in:
parent
288e975b17
commit
41fe530bdb
|
@ -17,7 +17,6 @@
|
|||
"author": "romseguy",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib",
|
||||
"src"
|
||||
],
|
||||
"main": "dist/d3-state-visualizer.cjs.js",
|
||||
|
@ -30,7 +29,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf lib dist",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
"prepack": "yarn run clean && yarn run build",
|
||||
|
|
|
@ -17,7 +17,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -36,7 +35,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -53,7 +51,6 @@ const config = [
|
|||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
|
|
@ -11,7 +11,7 @@ It was created by [@romseguy](https://github.com/romseguy) and merged from [`rom
|
|||
|
||||
```javascript
|
||||
import d3 from 'd3';
|
||||
import d3tooltip from 'd3tooltip';
|
||||
import { tooltip } from 'd3tooltip';
|
||||
|
||||
const DOMNode = document.getElementById('chart');
|
||||
const root = d3.select(DOMNode);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
"license": "MIT",
|
||||
"author": "romseguy",
|
||||
"files": [
|
||||
"lib",
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
|
@ -27,7 +26,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf lib dist",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
"prepack": "yarn run clean && yarn run build",
|
||||
|
|
|
@ -17,7 +17,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -36,7 +35,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -53,7 +51,6 @@ const config = [
|
|||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
"license": "MIT",
|
||||
"author": "romseguy",
|
||||
"files": [
|
||||
"lib",
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
|
@ -30,7 +29,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf lib dist",
|
||||
"clean": "rimraf dist",
|
||||
"test": "jest",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
|
|
|
@ -17,7 +17,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -36,7 +35,6 @@ const config = [
|
|||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
@ -53,7 +51,6 @@ const config = [
|
|||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"license": "MIT",
|
||||
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
||||
"files": [
|
||||
"lib",
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"main": "dist/react-base16-styling.cjs.js",
|
||||
|
@ -27,7 +27,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf lib",
|
||||
"clean": "rimraf dist",
|
||||
"test": "jest",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
|
|
|
@ -11,7 +11,6 @@ const config = [
|
|||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"license": "MIT",
|
||||
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
||||
"files": [
|
||||
"lib",
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"main": "dist/react-dock.cjs.js",
|
||||
|
@ -27,7 +27,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf lib",
|
||||
"clean": "rimraf dist",
|
||||
"test": "jest",
|
||||
"lint": "eslint . --ext .ts,.tsx",
|
||||
"type-check": "tsc --noEmit",
|
||||
|
|
|
@ -11,9 +11,8 @@ const config = [
|
|||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts'],
|
||||
extensions: ['.ts', '.tsx'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
}),
|
||||
],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"presets": [
|
||||
"@babel/preset-env",
|
||||
["@babel/preset-env", { "targets": "defaults" }],
|
||||
"@babel/preset-react",
|
||||
"@babel/preset-typescript"
|
||||
]
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
dist
|
||||
examples
|
||||
lib
|
||||
umd
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
module.exports = {
|
||||
extends: '../../eslintrc.ts.react.base.json',
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
extends: '../../eslintrc.js.base.json',
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
extends: '../../eslintrc.ts.react.base.json',
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['test/**/*.ts', 'test/**/*.tsx'],
|
||||
extends: '../../eslintrc.ts.react.jest.base.json',
|
||||
|
|
|
@ -7,7 +7,7 @@ React JSON Viewer Component, Extracted from [redux-devtools](https://github.com/
|
|||
### Usage
|
||||
|
||||
```jsx
|
||||
import JSONTree from 'react-json-tree';
|
||||
import { JSONTree } from 'react-json-tree';
|
||||
// If you're using Immutable.js: `npm i --save immutable`
|
||||
import { Map } from 'immutable';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import { Map } from 'immutable';
|
||||
import JSONTree, { StylingValue } from 'react-json-tree';
|
||||
import { JSONTree, StylingValue } from 'react-json-tree';
|
||||
|
||||
const getLabelStyle: StylingValue = ({ style }, nodeType, expanded) => ({
|
||||
style: {
|
||||
|
|
|
@ -19,23 +19,20 @@
|
|||
"Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)"
|
||||
],
|
||||
"files": [
|
||||
"lib",
|
||||
"src",
|
||||
"umd"
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"main": "dist/react-json-tree.cjs.js",
|
||||
"module": "dist/react-json-tree.esm.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"unpkg": "dist/react-json-tree.umd.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reduxjs/redux-devtools.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn run build:types && yarn run build:js && yarn run build:umd && npm run build:umd:min",
|
||||
"build:types": "tsc --emitDeclarationOnly",
|
||||
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
|
||||
"build:umd": "rimraf ./umd && webpack --progress --config webpack.config.umd.ts",
|
||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
||||
"clean": "rimraf lib umd",
|
||||
"build": "rollup -c",
|
||||
"clean": "rimraf umd",
|
||||
"test": "jest",
|
||||
"lint": "eslint . --ext .ts,.tsx",
|
||||
"type-check": "tsc --noEmit",
|
||||
|
@ -43,23 +40,26 @@
|
|||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@types/prop-types": "^15.7.4",
|
||||
"prop-types": "^15.8.0",
|
||||
"react-base16-styling": "^0.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.16.7",
|
||||
"@babel/core": "^7.16.7",
|
||||
"@babel/eslint-parser": "^7.16.5",
|
||||
"@babel/plugin-transform-runtime": "^7.16.7",
|
||||
"@babel/preset-env": "^7.16.7",
|
||||
"@babel/preset-react": "^7.16.7",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.17",
|
||||
"@types/react": "^17.0.38",
|
||||
"@types/react-test-renderer": "^17.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||
"@typescript-eslint/parser": "^5.8.1",
|
||||
"babel-loader": "^8.2.3",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-jest": "^25.3.4",
|
||||
|
@ -69,11 +69,12 @@
|
|||
"react": "^17.0.2",
|
||||
"react-test-renderer": "^17.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.63.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.31.1",
|
||||
"ts-jest": "^27.1.2",
|
||||
"ts-node": "^10.4.0",
|
||||
"typescript": "~4.5.4",
|
||||
"webpack": "^5.65.0",
|
||||
"webpack-cli": "^4.9.1"
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "~4.5.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^16.3.0 || ^17.0.0",
|
||||
|
|
76
packages/react-json-tree/rollup.config.js
Normal file
76
packages/react-json-tree/rollup.config.js
Normal file
|
@ -0,0 +1,76 @@
|
|||
import typescript from 'rollup-plugin-typescript2';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import babel from '@rollup/plugin-babel';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
const config = [
|
||||
{
|
||||
input: 'src/index.tsx',
|
||||
output: {
|
||||
name: 'ReactJsonTree',
|
||||
file: 'dist/react-json-tree.umd.js',
|
||||
format: 'umd',
|
||||
globals: {
|
||||
react: 'React',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts', '.tsx'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
}),
|
||||
],
|
||||
external: ['react'],
|
||||
},
|
||||
{
|
||||
input: 'src/index.tsx',
|
||||
output: {
|
||||
name: 'ReactJsonTree',
|
||||
file: 'dist/react-json-tree.umd.min.js',
|
||||
format: 'umd',
|
||||
globals: {
|
||||
react: 'React',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts', '.tsx'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
}),
|
||||
terser(),
|
||||
],
|
||||
external: ['react'],
|
||||
},
|
||||
{
|
||||
input: 'src/index.tsx',
|
||||
output: [
|
||||
{ file: 'dist/react-json-tree.cjs.js', format: 'cjs' },
|
||||
{ file: 'dist/react-json-tree.esm.js', format: 'esm' },
|
||||
],
|
||||
plugins: [
|
||||
typescript(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
extensions: ['.ts', '.tsx'],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
}),
|
||||
],
|
||||
external: [
|
||||
/@babel\/runtime/,
|
||||
'react',
|
||||
'prop-types',
|
||||
'react-base16-styling',
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default config;
|
|
@ -102,7 +102,7 @@ function getStateFromProps(props: Props) {
|
|||
};
|
||||
}
|
||||
|
||||
export default class JSONTree extends React.Component<Props, State> {
|
||||
export class JSONTree extends React.Component<Props, State> {
|
||||
static propTypes = {
|
||||
data: PropTypes.any,
|
||||
hideRoot: PropTypes.bool,
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["webpack.config.umd.ts"]
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
import * as path from 'path';
|
||||
import * as webpack from 'webpack';
|
||||
|
||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
||||
mode: env.production ? 'production' : 'development',
|
||||
entry: {
|
||||
app: ['./src/index'],
|
||||
},
|
||||
output: {
|
||||
library: 'ReactJsonTree',
|
||||
libraryExport: 'default',
|
||||
libraryTarget: 'umd',
|
||||
path: path.resolve(__dirname, 'umd'),
|
||||
filename: env.production ? 'react-json-tree.min.js' : 'react-json-tree.js',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|ts)x?$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
externals: {
|
||||
react: {
|
||||
root: 'React',
|
||||
commonjs2: 'react',
|
||||
commonjs: 'react',
|
||||
amd: 'react',
|
||||
},
|
||||
},
|
||||
});
|
16
yarn.lock
16
yarn.lock
|
@ -24252,19 +24252,22 @@ __metadata:
|
|||
version: 0.0.0-use.local
|
||||
resolution: "react-json-tree@workspace:packages/react-json-tree"
|
||||
dependencies:
|
||||
"@babel/cli": ^7.16.7
|
||||
"@babel/core": ^7.16.7
|
||||
"@babel/eslint-parser": ^7.16.5
|
||||
"@babel/plugin-transform-runtime": ^7.16.7
|
||||
"@babel/preset-env": ^7.16.7
|
||||
"@babel/preset-react": ^7.16.7
|
||||
"@babel/preset-typescript": ^7.16.7
|
||||
"@babel/runtime": ^7.16.7
|
||||
"@rollup/plugin-babel": ^5.3.0
|
||||
"@rollup/plugin-commonjs": ^21.0.1
|
||||
"@rollup/plugin-node-resolve": ^13.1.3
|
||||
"@types/jest": ^27.4.0
|
||||
"@types/node": ^16.11.17
|
||||
"@types/prop-types": ^15.7.4
|
||||
"@types/react": ^17.0.38
|
||||
"@types/react-test-renderer": ^17.0.1
|
||||
"@typescript-eslint/eslint-plugin": ^5.8.1
|
||||
"@typescript-eslint/parser": ^5.8.1
|
||||
babel-loader: ^8.2.3
|
||||
eslint: ^8.6.0
|
||||
eslint-config-prettier: ^8.3.0
|
||||
eslint-plugin-jest: ^25.3.4
|
||||
|
@ -24276,11 +24279,12 @@ __metadata:
|
|||
react-base16-styling: ^0.8.2
|
||||
react-test-renderer: ^17.0.2
|
||||
rimraf: ^3.0.2
|
||||
rollup: ^2.63.0
|
||||
rollup-plugin-terser: ^7.0.2
|
||||
rollup-plugin-typescript2: ^0.31.1
|
||||
ts-jest: ^27.1.2
|
||||
ts-node: ^10.4.0
|
||||
tslib: ^2.3.1
|
||||
typescript: ~4.5.4
|
||||
webpack: ^5.65.0
|
||||
webpack-cli: ^4.9.1
|
||||
peerDependencies:
|
||||
"@types/react": ^16.3.0 || ^17.0.0
|
||||
react: ^16.3.0 || ^17.0.0
|
||||
|
|
Loading…
Reference in New Issue
Block a user