Skip to content

Commit 0bf0ec0

Browse files
Jason McElwaineJason McElwaine
authored andcommitted
update packages
1 parent 6917959 commit 0bf0ec0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+27389
-83261
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
.DS_STORE

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Jason McElwaine
3+
Copyright (c) 2021 Jason McElwaine
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Advanced Color Picker
22
Harnessing the full power of CSS Gradients
33

4+
# DEMO
5+
[https://www.codingjack.com/wp-content/adv/cp/](https://www.codingjack.com/wp-content/adv/cp/)
6+
47
![Screenshot of the Color Picker Editor in Full Mode](/screenshot.jpg)
58

69
## Description

config/babel.config.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
const presets = [
2-
[
3-
'@babel/preset-env',
4-
{
5-
targets: {
6-
browsers: ['last 2 versions', 'safari >= 7'],
7-
},
8-
useBuiltIns: 'usage',
9-
corejs: 3,
10-
},
11-
'@babel/preset-react',
12-
],
2+
[
3+
'@babel/preset-env',
4+
{
5+
targets: {
6+
browsers: ['last 2 versions', 'safari >= 7'],
7+
},
8+
useBuiltIns: 'usage',
9+
corejs: 3,
10+
},
11+
'@babel/preset-react',
12+
],
1313
];
1414
const plugins = [
15-
'@babel/plugin-proposal-class-properties',
16-
'@babel/plugin-transform-react-jsx',
15+
'@babel/plugin-proposal-class-properties',
16+
'@babel/plugin-transform-react-jsx',
1717
];
1818

1919
module.exports = { presets, plugins };

config/eslint.config.js

Lines changed: 78 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,80 @@
1-
module.exports = {
2-
3-
env: {
4-
browser: true,
5-
es6: true,
6-
},
7-
plugins: [
8-
'react',
9-
'jsx-a11y',
10-
],
11-
extends: [
12-
'eslint:recommended',
13-
'plugin:react/recommended',
14-
'plugin:jsx-a11y/recommended',
15-
],
16-
globals: [],
17-
parser: 'babel-eslint',
18-
parserOptions: {
19-
sourceType: 'module',
20-
ecmaFeatures: {
21-
ecmaVersion: 6,
22-
impliedStrict: true,
23-
jsx: true,
24-
},
25-
},
26-
rules: {
27-
'no-unused-vars': 'error',
28-
'react/jsx-uses-react': 'error',
29-
'react/jsx-uses-vars': 'error',
30-
'no-cond-assign': 'error',
31-
'no-template-curly-in-string': 'error',
32-
'no-eval': 'error',
33-
'no-floating-decimal': 'error',
34-
'no-implicit-globals': 'error',
35-
'no-implied-eval': 'error',
36-
'no-lone-blocks': 'error',
37-
'no-multi-spaces': 'error',
38-
'no-multi-str': 'error',
39-
'no-new': 'error',
40-
'no-new-func': 'error',
41-
'no-new-wrappers': 'error',
42-
'no-param-reassign': 'error',
43-
'no-return-assign': 'error',
44-
'no-script-url': 'error',
45-
'no-self-compare': 'error',
46-
'no-sequences': 'error',
47-
'no-unmodified-loop-condition': 'error',
48-
'no-unused-expressions': 'error',
49-
'no-useless-call': 'error',
50-
'no-useless-concat': 'error',
51-
'no-useless-return': 'error',
52-
radix: 'error',
53-
yoda: 'error',
54-
'no-delete-var': 'error',
55-
'no-label-var': 'error',
56-
},
1+
const path = require( 'path' );
2+
const dir = path.resolve( __dirname, '' );
573

4+
module.exports = {
5+
overrideConfig: {
6+
env: {
7+
browser: true,
8+
es6: true,
9+
},
10+
plugins: [
11+
'react',
12+
'jsx-a11y',
13+
],
14+
settings: {
15+
react: {
16+
version: 'detect',
17+
},
18+
},
19+
extends: [
20+
'eslint:recommended',
21+
'plugin:react/recommended',
22+
'plugin:jsx-a11y/recommended',
23+
],
24+
globals: {
25+
require: 'readonly',
26+
ReactDOM: 'readonly',
27+
__webpack_public_path__: 'writable',
28+
},
29+
parser: '@babel/eslint-parser',
30+
parserOptions: {
31+
sourceType: 'module',
32+
ecmaFeatures: {
33+
ecmaVersion: 6,
34+
impliedStrict: true,
35+
jsx: true,
36+
},
37+
babelOptions: {
38+
configFile: `${ dir }/babel.config.js`,
39+
},
40+
requireConfigFile: false,
41+
},
42+
rules: {
43+
'no-unused-vars': 'error',
44+
'react/jsx-uses-react': 'error',
45+
'react/jsx-uses-vars': 'error',
46+
'no-cond-assign': 'error',
47+
'no-template-curly-in-string': 'error',
48+
'no-eval': 'error',
49+
'no-floating-decimal': 'error',
50+
'no-implicit-globals': 'error',
51+
'no-implied-eval': 'error',
52+
'no-lone-blocks': 'error',
53+
'no-multi-spaces': 'error',
54+
'no-multi-str': 'error',
55+
'no-new': 'error',
56+
'no-new-func': 'error',
57+
'no-new-wrappers': 'error',
58+
'no-param-reassign': 'error',
59+
'no-return-assign': 'error',
60+
'no-script-url': 'error',
61+
'no-self-compare': 'error',
62+
'no-sequences': 'error',
63+
'no-unmodified-loop-condition': 'error',
64+
'no-unused-expressions': 'error',
65+
'no-useless-call': 'error',
66+
'no-useless-concat': 'error',
67+
'no-useless-return': 'error',
68+
radix: 'error',
69+
yoda: 'error',
70+
'no-delete-var': 'error',
71+
'no-label-var': 'error',
72+
'no-useless-escape': 0,
73+
'react/prop-types': 0,
74+
'jsx-a11y/click-events-have-key-events': 0,
75+
'jsx-a11y/no-static-element-interactions': 0,
76+
'react/display-name': 0,
77+
'react/jsx-no-target-blank': 0,
78+
},
79+
},
5880
};

config/webpack.config.js

Lines changed: 91 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,94 @@
1+
const ESLintPlugin = require( 'eslint-webpack-plugin' );
12
const TerserPlugin = require( 'terser-webpack-plugin' );
23
const resolve = require( 'path' ).resolve;
4+
const webpack = require( 'webpack' );
35

4-
module.exports = {
5-
target: 'web',
6-
output: {
7-
path: resolve( 'dist' ),
8-
filename: 'cj-color.min.js',
9-
chunkFilename: 'cj-color-chunk-[id].min.js',
10-
publicPath: 'js/',
11-
},
12-
module: {
13-
rules: [
14-
{
15-
test: /\.js$/,
16-
exclude: /node_modules/,
17-
use: [
18-
{
19-
loader: 'babel-loader',
20-
options: require( './babel.config.js' ),
21-
},
22-
{
23-
loader: 'eslint-loader',
24-
options: require( './eslint.config.js' ),
25-
},
26-
],
27-
},
28-
{
29-
test:/\.(s*)css$/,
30-
use:[
31-
'style-loader',
32-
'css-loader',
33-
'sass-loader',
34-
]
35-
},
36-
],
37-
},
38-
optimization: {
39-
minimizer: [
40-
new TerserPlugin( {
41-
terserOptions: {
42-
output: {
43-
comments: false,
44-
},
45-
},
46-
extractComments: true,
47-
} ),
48-
],
49-
},
50-
};
6+
module.exports = env => {
7+
const plugins = [
8+
new ESLintPlugin( require( './eslint.config.js' ) ),
9+
];
10+
const { WEBPACK_BUILD: production } = env;
11+
if( ! production ) {
12+
plugins.push( new webpack.SourceMapDevToolPlugin( {} ) );
13+
}
14+
return {
15+
target: 'web',
16+
output: {
17+
path: resolve( 'dist' ),
18+
filename: 'cj-color.min.js',
19+
chunkFilename: 'cj-color-chunk-[id].min.js',
20+
publicPath: 'js/',
21+
},
22+
resolve: {
23+
alias: {
24+
'react-dom$': 'react-dom/profiling',
25+
'scheduler/tracing': 'scheduler/tracing-profiling',
26+
},
27+
},
28+
module: {
29+
noParse: [
30+
/benchmark/,
31+
],
32+
rules: [
33+
{
34+
test: /\.js$/,
35+
enforce: 'pre',
36+
exclude: /node_modules/,
37+
use: [
38+
{
39+
loader: 'babel-loader',
40+
options: require( './babel.config.js' ),
41+
},
42+
{
43+
loader: 'source-map-loader',
44+
options: {},
45+
},
46+
],
47+
},
48+
{
49+
test: /\.(s*)css$/,
50+
use: [
51+
{
52+
loader: 'style-loader',
53+
options: {
54+
injectType: 'styleTag',
55+
},
56+
},
57+
{
58+
loader: 'css-loader',
59+
options: {
60+
sourceMap: true,
61+
},
62+
},
63+
{
64+
loader: 'sass-loader',
65+
options: {
66+
sourceMap: true,
67+
},
68+
},
69+
],
70+
},
71+
],
72+
},
73+
stats: 'error-details',
74+
optimization: {
75+
minimizer: [
76+
new TerserPlugin( {
77+
terserOptions: {
78+
output: {
79+
comments: false,
80+
},
81+
},
82+
extractComments: true,
83+
} ),
84+
],
85+
},
86+
plugins,
87+
devtool: false,
88+
performance: {
89+
hints: false,
90+
maxEntrypointSize: 300000,
91+
maxAssetSize: 300000
92+
},
93+
};
94+
}

0 commit comments

Comments
 (0)