Skip to content

Commit

Permalink
using raw json as style theme for specify classes
Browse files Browse the repository at this point in the history
  • Loading branch information
carloluis committed May 24, 2018
1 parent c0fa399 commit 65813d1
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 46 deletions.
29 changes: 13 additions & 16 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');
const path = require('path');
Expand Down Expand Up @@ -156,22 +157,18 @@ const production = {
...shared.plugins,
new MiniCssExtractPlugin({
filename: 'styles.min.css'
})
}),
new CopyWebpackPlugin([
{
from: path.join(PATHS.src, 'themes/bootstrap-3.json'),
to: path.join(PATHS.dist, 'bootstrap-3.json')
},
{
from: path.join(PATHS.src, 'themes/bootstrap-4.json'),
to: path.join(PATHS.dist, 'bootstrap-4.json')
}
])
]
};

const themes = {
entry: {
bootstrap3: path.join(PATHS.src, 'themes/bootstrap-3.js'),
bootstrap4: path.join(PATHS.src, 'themes/bootstrap-4.js')
},
mode: 'production',
output: {
filename: '[name].js',
libraryTarget: 'umd',
library: 'Theme',
path: PATHS.dist
}
};

module.exports = [development, production, themes];
module.exports = [development, production];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"clean-webpack-plugin": "^0.1.18",
"copy-webpack-plugin": "^4.4.1",
"copy-webpack-plugin": "^4.5.1",
"coveralls": "^3.0.0",
"css-loader": "^0.28.11",
"enzyme": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/suggestor/__tests__/ListItem.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { shallow } from 'enzyme';
import classSchema from '../../themes/bootstrap-3';
import classSchema from '../../themes/bootstrap-3.json';
import ListItem from '../ListItem';

const PROPS = {
Expand Down
2 changes: 1 addition & 1 deletion src/suggestor/__tests__/Suggestor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import renderer from 'react-test-renderer';
import ReactTestUtils from 'react-dom/test-utils';
import { shallow, mount } from 'enzyme';

import classSchema from '../../themes/bootstrap-3';
import classSchema from '../../themes/bootstrap-3.json';
import * as utils from '../../utils';
import transform from '../../utils/transform';
import Suggestor from '../Suggestor';
Expand Down
13 changes: 0 additions & 13 deletions src/themes/bootstrap-3.js

This file was deleted.

9 changes: 9 additions & 0 deletions src/themes/bootstrap-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"root": "input-group",
"input": "form-control",
"arrow": "glyphicon glyphicon-triangle-bottom ss-triangle",
"close": "glyphicon glyphicon-remove ss-remove",
"list": "dropdown-menu ss-list",
"item": "",
"activeItem": "ss-over-item"
}
11 changes: 0 additions & 11 deletions src/themes/bootstrap-4.js

This file was deleted.

9 changes: 9 additions & 0 deletions src/themes/bootstrap-4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"root": "input-group",
"input": "form-control",
"arrow": "dropdown-toggle ss-triangle",
"close": "",
"list": "dropdown-menu ss-list",
"item": "dropdown-item",
"activeItem": "ss-over-item"
}
4 changes: 2 additions & 2 deletions src/themes/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bootstrap3 from './bootstrap-3';
import bootstrap4 from './bootstrap-4';
import bootstrap3 from './bootstrap-3.json';
import bootstrap4 from './bootstrap-4.json';

export { bootstrap3 };
export { bootstrap4 };
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ copy-descriptor@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"

copy-webpack-plugin@^4.4.1:
copy-webpack-plugin@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz#fc4f68f4add837cc5e13d111b20715793225d29c"
dependencies:
Expand Down

0 comments on commit 65813d1

Please sign in to comment.