Skip to content

Commit

Permalink
Merge pull request #1385 from jpuri/dependency_update
Browse files Browse the repository at this point in the history
Dependency update
  • Loading branch information
jpuri authored Jun 12, 2023
2 parents b5a6b84 + 9a994b9 commit 51fecc1
Show file tree
Hide file tree
Showing 62 changed files with 49,873 additions and 26,398 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
["transform-flow-strip-types"],
["@babel/plugin-transform-class-properties"],
[
"@babel/plugin-proposal-class-properties",
{
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
7 changes: 0 additions & 7 deletions .storybook/config.js

This file was deleted.

17 changes: 17 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-webpack5",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
14 changes: 14 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
8 changes: 4 additions & 4 deletions config/test-compiler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('@babel/core');
require("@babel/core");

function noop() {
return null;
}
require.extensions['.css'] = noop;
require.extensions['.svg'] = noop;
require.extensions['.png'] = noop;
require.extensions[".css"] = noop;
require.extensions[".svg"] = noop;
require.extensions[".png"] = noop;
14 changes: 8 additions & 6 deletions config/test-setup.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
require('@babel/register')();
const Adapter = require('enzyme-adapter-react-16');
const { shallow, configure } = require('enzyme');
require("@babel/register")();
const { configure } = require("enzyme");
const Adapter = require("@wojtekmaj/enzyme-adapter-react-17");

const jsdom = require('jsdom');
configure({ adapter: new Adapter() });

const jsdom = require("jsdom");

const { JSDOM } = jsdom;

const { document } = new JSDOM({
url: 'http://localhost',
url: "http://localhost",
}).window;
global.document = document;

Expand All @@ -16,7 +18,7 @@ global.HTMLElement = window.HTMLElement;
global.HTMLAnchorElement = window.HTMLAnchorElement;

global.navigator = {
userAgent: 'node.js',
userAgent: "node.js",
};

configure({ adapter: new Adapter() });
57 changes: 29 additions & 28 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const autoprefixer = require('autoprefixer');
const precss = require('precss');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const path = require("path");
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const autoprefixer = require("autoprefixer");
const precss = require("precss");
const TerserPlugin = require("terser-webpack-plugin");

module.exports = {
devtool: 'source-map',
entry: ['./src/index'],
devtool: "source-map",
entry: ["./src/index"],
output: {
path: path.join(__dirname, '../dist'),
filename: 'react-draft-wysiwyg.js',
library: 'reactDraftWysiwyg',
libraryTarget: 'umd',
path: path.join(__dirname, "../dist"),
filename: "react-draft-wysiwyg.js",
library: "reactDraftWysiwyg",
libraryTarget: "umd",
},
externals: {
react: 'react',
immutable: 'immutable',
'react-dom': 'react-dom',
'draft-js': 'draft-js',
react: "react",
immutable: "immutable",
"react-dom": "react-dom",
"draft-js": "draft-js",
},
optimization: {
minimizer: [new UglifyJsPlugin()],
minimize: true,
minimizer: [new TerserPlugin()],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
"process.env": {
NODE_ENV: JSON.stringify("production"),
},
}),
new MiniCssExtractPlugin({
filename: 'react-draft-wysiwyg.css',
chunkFilename: '[id].css',
filename: "react-draft-wysiwyg.css",
chunkFilename: "[id].css",
ignoreOrder: false,
}),
new webpack.LoaderOptionsPlugin({
Expand All @@ -44,7 +45,7 @@ module.exports = {
rules: [
{
test: /\.js$/,
use: [{ loader: 'babel-loader' }],
use: [{ loader: "babel-loader" }],
exclude: /immutable\.js$|draftjs-utils\.js$/,
},
{
Expand All @@ -53,21 +54,21 @@ module.exports = {
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '../',
hmr: process.env.NODE_ENV === 'development',
publicPath: "../",
hmr: process.env.NODE_ENV === "development",
},
},
'css-loader',
"css-loader",
],
},
{ test: /\.(png|jpg)$/, use: [{ loader: 'url-loader?limit=8192' }] },
{ test: /\.(png|jpg)$/, use: [{ loader: "url-loader?limit=8192" }] },
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [{ loader: 'url-loader?limit=10000&mimetype=image/svg+xml' }],
use: [{ loader: "url-loader?limit=10000&mimetype=image/svg+xml" }],
},
],
},
resolve: {
extensions: ['.js', '.json'],
extensions: [".js", ".json"],
},
};
7 changes: 0 additions & 7 deletions dist/react-draft-wysiwyg.js

This file was deleted.

Loading

0 comments on commit 51fecc1

Please sign in to comment.