@oliasoft-open-source/charts-library 2.3.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -3
- package/release-notes.md +4 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -129
- package/.gitlab-ci.yml +0 -80
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -3
- package/.prettierrc +0 -4
- package/.storybook/main.js +0 -36
- package/.storybook/preview.js +0 -37
- package/.storybook/storybook.less +0 -8
- package/babel.config.js +0 -29
- package/jest.config.js +0 -9
- package/scripts/send-mattermost-message.sh +0 -21
- package/webpack/webpack.common.js +0 -39
- package/webpack/webpack.common.rules.js +0 -107
- package/webpack/webpack.dev.js +0 -22
- package/webpack/webpack.prod.js +0 -23
- package/webpack/webpack.resolve.js +0 -22
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js",
|
|
8
|
+
"LICENSE",
|
|
9
|
+
"README.md",
|
|
10
|
+
"release-notes.md",
|
|
11
|
+
"src/*"
|
|
12
|
+
],
|
|
6
13
|
"scripts": {
|
|
7
|
-
"build": "
|
|
14
|
+
"build": "yarn run build:storybook",
|
|
8
15
|
"build:storybook": "build-storybook --quiet --output-dir ./public",
|
|
9
16
|
"dev:storybook": "start-storybook -p 6006",
|
|
10
17
|
"preview:storybook": " http-server ./public -o -p 9002 -c-1",
|
|
11
|
-
"test": "
|
|
18
|
+
"test": "yarn run prettier:check && yarn run lint:check && yarn run test:unit",
|
|
12
19
|
"test:unit": "jest",
|
|
13
20
|
"lint:check": "eslint \"**/*.{js,jsx}\"",
|
|
14
21
|
"lint:fix": "eslint --fix \"**/*.{js,jsx}\"",
|
package/release-notes.md
CHANGED
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
node: true,
|
|
6
|
-
jest: true,
|
|
7
|
-
},
|
|
8
|
-
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
|
|
9
|
-
parser: '@babel/eslint-parser',
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaFeatures: {
|
|
12
|
-
jsx: true,
|
|
13
|
-
},
|
|
14
|
-
ecmaVersion: 12,
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
},
|
|
17
|
-
plugins: ['react'],
|
|
18
|
-
settings: {
|
|
19
|
-
'import/resolver': {
|
|
20
|
-
alias: {
|
|
21
|
-
map: [
|
|
22
|
-
['~components', './src/components'],
|
|
23
|
-
['~docs', './src/docs'],
|
|
24
|
-
['~helpers', './src/helpers'],
|
|
25
|
-
['~style', './src/style'],
|
|
26
|
-
['~vendor', './src/vendor'],
|
|
27
|
-
],
|
|
28
|
-
extensions: ['.js', '.jsx'],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
'arrow-parens': 0,
|
|
34
|
-
'array-callback-return': 0,
|
|
35
|
-
camelcase: 0,
|
|
36
|
-
'comma-dangle': 0,
|
|
37
|
-
'consistent-return': 0,
|
|
38
|
-
curly: 0,
|
|
39
|
-
'class-methods-use-this': 0,
|
|
40
|
-
'default-case': 0,
|
|
41
|
-
eqeqeq: 0,
|
|
42
|
-
'eol-last': 0,
|
|
43
|
-
'function-paren-newline': 0,
|
|
44
|
-
'max-len': 0,
|
|
45
|
-
'import/extensions': 0,
|
|
46
|
-
'import/prefer-default-export': 0,
|
|
47
|
-
'object-curly-newline': 0,
|
|
48
|
-
'object-curly-spacing': 0,
|
|
49
|
-
'one-var-declaration-per-line': 0,
|
|
50
|
-
'one-var': 0,
|
|
51
|
-
radix: 0,
|
|
52
|
-
'prefer-template': 0,
|
|
53
|
-
'prefer-const': 0,
|
|
54
|
-
'prefer-destructuring': [
|
|
55
|
-
'error',
|
|
56
|
-
{
|
|
57
|
-
VariableDeclarator: {
|
|
58
|
-
array: false,
|
|
59
|
-
object: true,
|
|
60
|
-
},
|
|
61
|
-
AssignmentExpression: {
|
|
62
|
-
array: false,
|
|
63
|
-
object: false,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
enforceForRenamedProperties: false,
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
'spaced-comment': 0,
|
|
71
|
-
'no-multi-spaces': 0,
|
|
72
|
-
'arrow-body-style': 0,
|
|
73
|
-
'no-shadow': 0,
|
|
74
|
-
'no-else-return': 0,
|
|
75
|
-
'no-param-reassign': 0,
|
|
76
|
-
'no-plusplus': 0,
|
|
77
|
-
'no-restricted-globals': 0,
|
|
78
|
-
'no-unused-vars': 0,
|
|
79
|
-
'no-unused-state': 0,
|
|
80
|
-
'no-case-declarations': 0,
|
|
81
|
-
'no-return-assign': 0,
|
|
82
|
-
'no-prototype-builtins': 0,
|
|
83
|
-
'no-restricted-syntax': 0,
|
|
84
|
-
'no-cond-assign': [2, 'except-parens'],
|
|
85
|
-
'no-console': 0,
|
|
86
|
-
'no-constant-condition': 0,
|
|
87
|
-
'no-underscore-dangle': 0,
|
|
88
|
-
'no-restricted-properties': 0,
|
|
89
|
-
'no-nested-ternary': 0,
|
|
90
|
-
'no-mixed-operators': 0,
|
|
91
|
-
'no-confusing-arrow': 0,
|
|
92
|
-
'no-lonely-if': 0,
|
|
93
|
-
'nonblock-statement-body-position': 0,
|
|
94
|
-
'react/jsx-tag-spacing': 0,
|
|
95
|
-
'react/jsx-one-expression-per-line': 0,
|
|
96
|
-
'react/no-array-index-key': 0,
|
|
97
|
-
'react/forbid-prop-types': 0,
|
|
98
|
-
'react/destructuring-assignment': 0,
|
|
99
|
-
'react/no-unused-state': 0,
|
|
100
|
-
'react/no-access-state-in-setstate': 0,
|
|
101
|
-
'react/no-did-update-set-state': 0,
|
|
102
|
-
'react/prop-types': 0,
|
|
103
|
-
'react/self-closing-comp': [
|
|
104
|
-
'error',
|
|
105
|
-
{
|
|
106
|
-
component: true,
|
|
107
|
-
html: false,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
'jsx-a11y/no-static-element-interactions': 0,
|
|
111
|
-
'jsx-a11y/click-events-have-key-events': 0,
|
|
112
|
-
'jsx-a11y/tabindex-no-positive': 0,
|
|
113
|
-
'jsx-a11y/label-has-associated-control': 0,
|
|
114
|
-
'jsx-a11y/label-has-for': 0,
|
|
115
|
-
'react/function-component-definition': [
|
|
116
|
-
2,
|
|
117
|
-
{ namedComponents: 'arrow-function' },
|
|
118
|
-
],
|
|
119
|
-
'import/no-extraneous-dependencies': [
|
|
120
|
-
'error',
|
|
121
|
-
{
|
|
122
|
-
devDependencies: [
|
|
123
|
-
'src/components/**/*.stories.{js,jsx}',
|
|
124
|
-
'webpack/**/*.js',
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
};
|
package/.gitlab-ci.yml
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
image: node:18
|
|
2
|
-
|
|
3
|
-
stages:
|
|
4
|
-
- test
|
|
5
|
-
- release
|
|
6
|
-
|
|
7
|
-
default:
|
|
8
|
-
tags:
|
|
9
|
-
- oliasoft
|
|
10
|
-
- kubernetes
|
|
11
|
-
|
|
12
|
-
test:
|
|
13
|
-
stage: test
|
|
14
|
-
only:
|
|
15
|
-
- merge_requests
|
|
16
|
-
script:
|
|
17
|
-
- npm install --progress=false --no-save
|
|
18
|
-
- npm run build
|
|
19
|
-
- npm run test
|
|
20
|
-
|
|
21
|
-
cache:
|
|
22
|
-
paths:
|
|
23
|
-
- node_modules/
|
|
24
|
-
- public/
|
|
25
|
-
|
|
26
|
-
# Publish the Storybook to Gitlab pages upon merge to master
|
|
27
|
-
pages:
|
|
28
|
-
stage: release
|
|
29
|
-
only:
|
|
30
|
-
- master
|
|
31
|
-
script:
|
|
32
|
-
- npm install --progress=false --no-save
|
|
33
|
-
- npm run build
|
|
34
|
-
artifacts:
|
|
35
|
-
paths:
|
|
36
|
-
- public
|
|
37
|
-
|
|
38
|
-
# Push a tag and publish the release to the public NPM registry upon merge to master
|
|
39
|
-
# Loosely inspired by:
|
|
40
|
-
# - https://markswanderingthoughts.nl/tagging-in-gitlab-ci-pipeline-using-deploy-keys/
|
|
41
|
-
# - https://www.garybell.co.uk/creating-a-release-with-gitlab-ci-and-composer/
|
|
42
|
-
publish:
|
|
43
|
-
stage: release
|
|
44
|
-
only:
|
|
45
|
-
- master
|
|
46
|
-
script:
|
|
47
|
-
# Get the version from package.json
|
|
48
|
-
- VERSION=$(node -p "require('./package.json').version")
|
|
49
|
-
# Prepare MatterMost message
|
|
50
|
-
- MESSAGE="🤖 Charts Library version $VERSION released ([release notes](https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/release-notes.md))"
|
|
51
|
-
- chmod +x ./scripts/send-mattermost-message.sh
|
|
52
|
-
# Prepare .npmrc
|
|
53
|
-
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
|
54
|
-
# Configure git
|
|
55
|
-
- mkdir -p ~/.ssh
|
|
56
|
-
- echo "$SSH_PRIVATE_KEY_TOOLKIT" > ~/.ssh/id_rsa; chmod 0600 ~/.ssh/id_rsa
|
|
57
|
-
- echo "StrictHostKeyChecking no " > /root/.ssh/config
|
|
58
|
-
- git config --global http.sslVerify false
|
|
59
|
-
- git config --global user.email "$GITLAB_USER_EMAIL"
|
|
60
|
-
- git config --global user.name "🤖 GitLab CI/CD"
|
|
61
|
-
- echo "setting origin remote to 'git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git'"
|
|
62
|
-
- git remote rm origin
|
|
63
|
-
- git remote add origin git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
|
|
64
|
-
- git fetch --quiet
|
|
65
|
-
- git checkout "$CI_BUILD_REF_NAME"
|
|
66
|
-
# Only complete pipeline if version does not already exist
|
|
67
|
-
- >
|
|
68
|
-
if [ $(git tag -l "$VERSION") ]; then
|
|
69
|
-
echo "Version $VERSION already exists"
|
|
70
|
-
exit 1
|
|
71
|
-
else
|
|
72
|
-
echo "Tagging release in git"
|
|
73
|
-
git tag $VERSION -m "🤖 Tagged by Gitlab CI/CD Pipeline" -m "For further reference see $CI_PIPELINE_URL" -m "[skip ci]"
|
|
74
|
-
echo "Pushing tag to remote repository"
|
|
75
|
-
git push origin $VERSION --no-verify
|
|
76
|
-
echo "Publishing package to NPM registry"
|
|
77
|
-
npm publish
|
|
78
|
-
echo "Notifying MatterMost"
|
|
79
|
-
./scripts/send-mattermost-message.sh "$MATTERMOST_BOT_KEY" "$MESSAGE"
|
|
80
|
-
fi
|
package/.husky/pre-commit
DELETED
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/.storybook/main.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const { merge } = require('webpack-merge');
|
|
2
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
|
-
const getRules = require('../webpack/webpack.common.rules.js');
|
|
4
|
-
const resolve = require('../webpack/webpack.resolve.js').resolve;
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
stories: ['../src/components/**/*.stories.@(js|jsx|mdx)'],
|
|
8
|
-
addons: [
|
|
9
|
-
'@storybook/addon-actions',
|
|
10
|
-
{
|
|
11
|
-
name: '@storybook/addon-docs',
|
|
12
|
-
options: {
|
|
13
|
-
sourceLoaderOptions: {
|
|
14
|
-
injectStoryParameters: false,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
'storybook-dark-mode',
|
|
19
|
-
],
|
|
20
|
-
features: {
|
|
21
|
-
modernInlineRender: true,
|
|
22
|
-
},
|
|
23
|
-
core: {
|
|
24
|
-
builder: 'webpack5',
|
|
25
|
-
},
|
|
26
|
-
webpackFinal: (config) =>
|
|
27
|
-
merge(config, {
|
|
28
|
-
module: { rules: getRules('development') },
|
|
29
|
-
plugins: [
|
|
30
|
-
new MiniCssExtractPlugin({
|
|
31
|
-
filename: '[name].css',
|
|
32
|
-
}),
|
|
33
|
-
],
|
|
34
|
-
resolve,
|
|
35
|
-
}),
|
|
36
|
-
};
|
package/.storybook/preview.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useDarkMode } from 'storybook-dark-mode';
|
|
3
|
-
import { themes } from '@storybook/theming';
|
|
4
|
-
import { DocsContainer } from '@storybook/addon-docs';
|
|
5
|
-
import '@oliasoft-open-source/react-ui-library/dist/global.css';
|
|
6
|
-
import './storybook.less';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Dark mode for GUI Library components (i.e. Controls)
|
|
10
|
-
*/
|
|
11
|
-
export const decorators = [
|
|
12
|
-
(Story) => {
|
|
13
|
-
document.documentElement.setAttribute(
|
|
14
|
-
'data-theme',
|
|
15
|
-
useDarkMode() ? 'dark' : 'default',
|
|
16
|
-
);
|
|
17
|
-
return <Story />;
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export const parameters = {
|
|
22
|
-
/**
|
|
23
|
-
* Fix for dark mode docs from https://github.com/hipstersmoothie/storybook-dark-mode/issues/180
|
|
24
|
-
*/
|
|
25
|
-
docs: {
|
|
26
|
-
container: (props) => {
|
|
27
|
-
const isDark = useDarkMode();
|
|
28
|
-
const { id: storyId, storyById } = props.context;
|
|
29
|
-
const {
|
|
30
|
-
parameters: { docs = {} },
|
|
31
|
-
} = storyById(storyId);
|
|
32
|
-
docs.theme = isDark ? themes.dark : themes.light;
|
|
33
|
-
|
|
34
|
-
return React.createElement(DocsContainer, props);
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
package/babel.config.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = (api) => {
|
|
2
|
-
api.cache(true);
|
|
3
|
-
|
|
4
|
-
const presets = [
|
|
5
|
-
[
|
|
6
|
-
'@babel/preset-env',
|
|
7
|
-
{
|
|
8
|
-
targets: {
|
|
9
|
-
browsers: ['defaults'],
|
|
10
|
-
},
|
|
11
|
-
useBuiltIns: 'usage',
|
|
12
|
-
corejs: 3,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
'@babel/preset-react',
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const plugins = [
|
|
19
|
-
[
|
|
20
|
-
'babel-plugin-webpack-aliases',
|
|
21
|
-
{ config: './webpack/webpack.resolve.js' },
|
|
22
|
-
],
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
presets,
|
|
27
|
-
plugins,
|
|
28
|
-
};
|
|
29
|
-
};
|
package/jest.config.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -eEuo pipefail
|
|
3
|
-
|
|
4
|
-
# This script requires the following things to be installed:
|
|
5
|
-
# - bash
|
|
6
|
-
# - curl
|
|
7
|
-
|
|
8
|
-
# Required inputs:
|
|
9
|
-
MATTERMOST_BOT_KEY=$1
|
|
10
|
-
MSG=$2
|
|
11
|
-
|
|
12
|
-
# Optional inputs:
|
|
13
|
-
CHANNEL=${3:-'#releases'}
|
|
14
|
-
USERNAME=${4:-'Gitlab CI/CD'}
|
|
15
|
-
ICON_URL=${5:-'https://oliasoftstaticwebsite.blob.core.windows.net/helpguideimages/robot-icon.png'}
|
|
16
|
-
MATTERMOST_URL=${6:-'https://mm.oliasoft.com/hooks/'}
|
|
17
|
-
|
|
18
|
-
curl -X POST \
|
|
19
|
-
--data-urlencode \
|
|
20
|
-
"payload={\"channel\": \"$CHANNEL\", \"username\": \"$USERNAME\", \"icon_url\": \"$ICON_URL\", \"text\": \"$MSG\"}" \
|
|
21
|
-
$MATTERMOST_URL$MATTERMOST_BOT_KEY
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
|
-
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
|
4
|
-
const { resolve } = require('./webpack.resolve.js');
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
resolve,
|
|
8
|
-
entry: {
|
|
9
|
-
app: './src/docs/start.jsx',
|
|
10
|
-
},
|
|
11
|
-
output: {
|
|
12
|
-
path: path.resolve(__dirname, '../public'),
|
|
13
|
-
filename: '[name].[contenthash].js',
|
|
14
|
-
},
|
|
15
|
-
plugins: [
|
|
16
|
-
new HtmlWebPackPlugin({
|
|
17
|
-
template: 'src/docs/html/index.html',
|
|
18
|
-
filename: './index.html',
|
|
19
|
-
favicon: 'src/docs/html/favicon.png',
|
|
20
|
-
cache: true,
|
|
21
|
-
}),
|
|
22
|
-
new MiniCssExtractPlugin({
|
|
23
|
-
filename: '[name].[contenthash].css',
|
|
24
|
-
}),
|
|
25
|
-
],
|
|
26
|
-
optimization: {
|
|
27
|
-
runtimeChunk: 'single', // single runtime bundle for all chunks
|
|
28
|
-
// put node_modules into separate bundles
|
|
29
|
-
splitChunks: {
|
|
30
|
-
cacheGroups: {
|
|
31
|
-
vendors: {
|
|
32
|
-
test: /[\\/]node_modules[\\/]/,
|
|
33
|
-
name: 'vendors',
|
|
34
|
-
chunks: 'all',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
|
-
|
|
4
|
-
module.exports = function getRules(env) {
|
|
5
|
-
const styleLoader = MiniCssExtractPlugin.loader;
|
|
6
|
-
|
|
7
|
-
return [
|
|
8
|
-
{
|
|
9
|
-
test: /\.jsx$|\.es6$|\.js$/,
|
|
10
|
-
exclude: /node_modules/,
|
|
11
|
-
use: {
|
|
12
|
-
loader: 'babel-loader',
|
|
13
|
-
options: {
|
|
14
|
-
cacheDirectory: false,
|
|
15
|
-
presets: ['@babel/react'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
test: /\.(ttf|eot|woff|woff2)$/,
|
|
21
|
-
type: 'asset/resource',
|
|
22
|
-
generator: {
|
|
23
|
-
filename: './fonts/[name].[contenthash][ext]',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
test: /\.(svg|gif|png|jpg)$/,
|
|
28
|
-
type: 'asset/resource',
|
|
29
|
-
generator: {
|
|
30
|
-
filename: './images/[name].[contenthash][ext]',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
test: /^(?!.*?(\.module)).*\.css$/, //all *.css except for *.module.css
|
|
35
|
-
exclude: /node_modules/,
|
|
36
|
-
use: [
|
|
37
|
-
styleLoader,
|
|
38
|
-
{
|
|
39
|
-
loader: 'css-loader',
|
|
40
|
-
options: {
|
|
41
|
-
sourceMap: env === 'development',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
test: /^(?!.*?(\.module)).*\.less$/, //all *.less except for *.module.less
|
|
48
|
-
use: [
|
|
49
|
-
styleLoader,
|
|
50
|
-
{
|
|
51
|
-
loader: 'css-loader',
|
|
52
|
-
options: {
|
|
53
|
-
sourceMap: env === 'development',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
'less-loader',
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
test: /\.module\.css$/, //*.module.css
|
|
61
|
-
use: [
|
|
62
|
-
styleLoader,
|
|
63
|
-
{
|
|
64
|
-
loader: 'css-loader',
|
|
65
|
-
options: {
|
|
66
|
-
sourceMap: env === 'development',
|
|
67
|
-
modules: {
|
|
68
|
-
mode: 'local',
|
|
69
|
-
localIdentName: '[name]-[local]-[hash:base64:5]', //friendly module classNames
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
test: /\.module\.less$/, //*.module.less
|
|
77
|
-
use: [
|
|
78
|
-
styleLoader,
|
|
79
|
-
{
|
|
80
|
-
loader: 'css-loader',
|
|
81
|
-
options: {
|
|
82
|
-
sourceMap: env === 'development',
|
|
83
|
-
modules: {
|
|
84
|
-
mode: 'local',
|
|
85
|
-
localIdentName: '[name]-[local]-[hash:base64:5]', //friendly module classNames
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
'less-loader',
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
test: /\.stories\.jsx?$/,
|
|
94
|
-
loader: require.resolve('@storybook/source-loader'),
|
|
95
|
-
include: [path.resolve(__dirname, '../src')],
|
|
96
|
-
enforce: 'pre',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
test: /\.mdx?$/,
|
|
100
|
-
use: ['babel-loader', '@mdx-js/loader'],
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
resourceQuery: /raw/,
|
|
104
|
-
type: 'asset/source',
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
};
|
package/webpack/webpack.dev.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const { merge } = require('webpack-merge');
|
|
2
|
-
const common = require('./webpack.common.js');
|
|
3
|
-
const getRules = require('./webpack.common.rules.js');
|
|
4
|
-
|
|
5
|
-
module.exports = merge(common, {
|
|
6
|
-
mode: 'development',
|
|
7
|
-
devtool: 'eval-cheap-module-source-map',
|
|
8
|
-
output: {
|
|
9
|
-
publicPath: '/',
|
|
10
|
-
},
|
|
11
|
-
devServer: {
|
|
12
|
-
port: 9001,
|
|
13
|
-
open: true,
|
|
14
|
-
historyApiFallback: true,
|
|
15
|
-
client: {
|
|
16
|
-
overlay: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
module: {
|
|
20
|
-
rules: getRules('development'),
|
|
21
|
-
},
|
|
22
|
-
});
|
package/webpack/webpack.prod.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const { merge } = require('webpack-merge');
|
|
2
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
3
|
-
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
4
|
-
const common = require('./webpack.common.js');
|
|
5
|
-
const getRules = require('./webpack.common.rules.js');
|
|
6
|
-
|
|
7
|
-
module.exports = merge(common, {
|
|
8
|
-
mode: 'production',
|
|
9
|
-
output: {
|
|
10
|
-
publicPath: '/line-chart-library/',
|
|
11
|
-
},
|
|
12
|
-
optimization: {
|
|
13
|
-
minimizer: [
|
|
14
|
-
new TerserPlugin({
|
|
15
|
-
parallel: true,
|
|
16
|
-
}),
|
|
17
|
-
new CssMinimizerPlugin(),
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
module: {
|
|
21
|
-
rules: getRules('production'),
|
|
22
|
-
},
|
|
23
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
resolve: {
|
|
5
|
-
extensions: ['.js', '.jsx'],
|
|
6
|
-
alias: {
|
|
7
|
-
'~components': path.resolve(__dirname, '../src/components'),
|
|
8
|
-
'~docs': path.resolve(__dirname, '../src/docs'),
|
|
9
|
-
'~helpers': path.resolve(__dirname, '../src/helpers'),
|
|
10
|
-
'~style': path.resolve(__dirname, '../src/style'),
|
|
11
|
-
'~vendor': path.resolve(__dirname, '../src/vendor'),
|
|
12
|
-
},
|
|
13
|
-
fallback: {
|
|
14
|
-
fs: false,
|
|
15
|
-
net: false,
|
|
16
|
-
repl: false,
|
|
17
|
-
tls: false,
|
|
18
|
-
path: false,
|
|
19
|
-
crypto: false,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|