Fix some stuff

This commit is contained in:
Nathan Bierema 2020-05-04 23:09:19 -04:00
parent 39f560f20e
commit 9d180d9cd2
7 changed files with 22 additions and 5 deletions

View File

@ -1,8 +1,8 @@
{ {
"presets": [ "presets": [
"@babel/preset-env", "@babel/preset-env",
"@babel/preset-typescript", "@babel/preset-react",
"@babel/preset-react" "@babel/preset-typescript"
], ],
"plugins": [ "plugins": [
"@babel/plugin-proposal-class-properties" "@babel/plugin-proposal-class-properties"

View File

@ -1 +1,3 @@
lib lib
umd
webpack.config.umd.js

View File

@ -0,0 +1,2 @@
lib
umd

View File

@ -35,7 +35,7 @@ Check out [examples](examples) directory for more details.
This component now uses [react-base16-styling](https://github.com/alexkuz/react-base16-styling) module, which allows to customize component via `theme` property, which can be the following: This component now uses [react-base16-styling](https://github.com/alexkuz/react-base16-styling) module, which allows to customize component via `theme` property, which can be the following:
- [base16](http://chriskempson.github.io/base16) theme data. [The example theme data can be found here](https://github.com/gaearon/redux-devtools/tree/75322b15ee7ba03fddf10ac3399881e302848874/src/react/themes). - [base16](http://chriskempson.github.io/base16) theme data. [The example theme data can be found here](https://github.com/gaearon/redux-devtools/tree/75322b15ee7ba03fddf10ac3399881e302848874/src/react/themes).
- object that contains style objects, strings (that treated as classnames) or functions. A function is used to extend its first argument `{ style, className }` and should return an object with the same structure. Other arguments depend on particular context (and should be described here). See [createStylingFromTheme.js](https://github.com/alexkuz/react-json-tree/blob/feature-refactor-styling/src/createStylingFromTheme.js) for the list of styling object keys. Also, this object can extend `base16` theme via `extend` property. - object that contains style objects, strings (that treated as classnames) or functions. A function is used to extend its first argument `{ style, className }` and should return an object with the same structure. Other arguments depend on particular context (and should be described here). See [createStylingFromTheme.ts](https://github.com/reduxjs/redux-devtools/blob/master/packages/react-json-tree/src/createStylingFromTheme.ts) for the list of styling object keys. Also, this object can extend `base16` theme via `extend` property.
Every theme has a light version, which is enabled with `invertTheme` prop. Every theme has a light version, which is enabled with `invertTheme` prop.

View File

@ -1,3 +1,5 @@
/* eslint-env jest */
import React from 'react'; import React from 'react';
import { createRenderer } from 'react-test-renderer/shallow'; import { createRenderer } from 'react-test-renderer/shallow';

View File

@ -1,3 +1,5 @@
/* eslint-env jest, es6 */
import objType from '../src/objType'; import objType from '../src/objType';
describe('objType', () => { describe('objType', () => {
@ -10,7 +12,11 @@ describe('objType', () => {
expect(objType(new WeakSet())).toBe('WeakSet'); expect(objType(new WeakSet())).toBe('WeakSet');
expect(objType(new Error())).toBe('Error'); expect(objType(new Error())).toBe('Error');
expect(objType(new Date())).toBe('Date'); expect(objType(new Date())).toBe('Date');
expect(objType(() => {})).toBe('Function'); expect(
objType(() => {
/* noop */
})
).toBe('Function');
expect(objType('')).toBe('String'); expect(objType('')).toBe('String');
expect(objType(true)).toBe('Boolean'); expect(objType(true)).toBe('Boolean');
expect(objType(null)).toBe('Null'); expect(objType(null)).toBe('Null');

View File

@ -1,3 +1,5 @@
/* eslint-env node */
const path = require('path'); const path = require('path');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
@ -15,12 +17,15 @@ module.exports = (env = {}) => ({
module: { module: {
rules: [ rules: [
{ {
test: /\.(ts|tsx)$/, test: /\.tsx?$/,
loader: 'babel-loader', loader: 'babel-loader',
exclude: /node_modules/ exclude: /node_modules/
} }
] ]
}, },
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
externals: { externals: {
react: { react: {
root: 'React', root: 'React',