Skip to content

Commit

Permalink
Merge 13bf249 into 0d99c33
Browse files Browse the repository at this point in the history
  • Loading branch information
antipin committed Jun 28, 2019
2 parents 0d99c33 + 13bf249 commit 359f517
Show file tree
Hide file tree
Showing 11 changed files with 1,250 additions and 1,334 deletions.
2 changes: 1 addition & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
const { getRules, plugins, PACKAGES_PATH } = require('../etc/webpack/webpack.config');
const { getRules, PACKAGES_PATH } = require('../scripts/build/webpack.config');

module.exports = ({ config: storybookBaseConfig }) => {

Expand Down
2 changes: 1 addition & 1 deletion example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import OneUI from '@textkernel/oneui';
import '@textkernel/oneui/dist/oneui.css';
import '@textkernel/oneui/dist/oneui.min.css';

const renderApplication = () => ReactDOM.render(<App />, document.getElementById('root'));

Expand Down
2,550 changes: 1,228 additions & 1,322 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"storybook": "start-storybook -s ./stories/static -p 9001 -c .storybook",
"storybook:build": "build-storybook -s ./stories/static -c .storybook -o .out",
"storybook:deploy": "storybook-to-ghpages --script=storybook:build --out=.out",
"build": "webpack --config ./etc/webpack/webpack.dev.config.js",
"build:prod": "webpack --config ./etc/webpack/webpack.prod.config.js",
"build": "webpack --config ./scripts/build/webpack.dev.config.js",
"build:prod": "webpack --config ./scripts/build/webpack.prod.config.js",
"lint": "npm run lint:ci -- --fix",
"lint:ci": "eslint .",
"lint:styles": "stylelint 'src/**/*.s(a|c)ss'",
"test": "jest --config etc/test/jest.config.js",
"test:coverage": "jest --config etc/test/jest.config.js --coverage",
"test": "jest --config scripts/test/jest.config.js",
"test:coverage": "jest --config scripts/test/jest.config.js --coverage",
"prepublishOnly": "npm test && npm run lint:ci && npm run lint:styles && npm run build:prod",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"release": "standard-version -t ''"
Expand Down Expand Up @@ -71,6 +71,7 @@
"babel-eslint": "10.0.0",
"babel-jest": "24.5.0",
"babel-loader": "8.0.2",
"clean-webpack-plugin": "3.0.0",
"coveralls": "3.0.2",
"css-loader": "1.0.0",
"enzyme": "3.9.0",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const webpack = require('webpack');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { getRuleJS, getRuleCSS } = require('./utils');

Expand Down Expand Up @@ -31,7 +32,8 @@ const plugins = {
bundleAnalyzerPlugin: new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: '../reports/bundle-size.html'
})
}),
cleanWebpackPlugin: new CleanWebpackPlugin({ verbose: true })
};

const getRules = (env = 'prod') => ({
Expand All @@ -54,7 +56,7 @@ const baseConfig = {
},

output: {
filename: `${LIBRARY_NAME}.min.js`,
filename: `${LIBRARY_NAME}.js`,
path: DIST_PATH,
library: LIBRARY_NAME,
libraryTarget: 'umd',
Expand All @@ -71,6 +73,7 @@ module.exports = {
baseConfig,
plugins,
getRules,
LIBRARY_NAME,
PROJECT_ROOT_PATH,
SOURCE_PATH,
DIST_PATH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
plugins.namedModulesPlugin,
plugins.cssPlugin,
plugins.styleLintPlugin,
plugins.bundleAnalyzerPlugin
plugins.bundleAnalyzerPlugin,
plugins.cleanWebpackPlugin
],
module: {
rules: [rules.js, rules.styles]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
const TerserPlugin = require('terser-webpack-plugin'); // eslint-disable-line import/no-extraneous-dependencies
const { baseConfig, plugins, getRules } = require('./webpack.config');
const { baseConfig, LIBRARY_NAME, plugins, getRules } = require('./webpack.config');

const rules = getRules('prod');

module.exports = {
...baseConfig,
mode: 'production',
output: {
...baseConfig.output,
filename: `${LIBRARY_NAME}.min.js`
},
plugins: [
plugins.hashedModuleIdsPlugin,
plugins.cssPlugin,
plugins.styleLintPlugin,
plugins.optimizeCssAssetsPlugin,
plugins.bundleAnalyzerPlugin
plugins.bundleAnalyzerPlugin,
plugins.cleanWebpackPlugin
],
module: {
rules: [rules.js, rules.styles]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion etc/test/jest.config.js → scripts/test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {

// The path to a module that runs some code to configure or set up the testing framework
// before each test
setupFiles: ['<rootDir>etc/test/enzyme.setup.js'],
setupFiles: ['<rootDir>scripts/test/enzyme.setup.js'],

// The glob patterns Jest uses to detect test files
testMatch: ['**/__tests__/**/*.spec.js'],
Expand Down

0 comments on commit 359f517

Please sign in to comment.