Skip to content
This repository was archived by the owner on Mar 26, 2022. It is now read-only.

Commit 8bc6468

Browse files
authored
Merge pull request #1281 from openlattice/develop
Release 2021-06-16
2 parents f6c839a + 3703eef commit 8bc6468

31 files changed

+51024
-14007
lines changed

.eslintrc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"parser": "babel-eslint",
2+
"env": {
3+
"browser": true,
4+
"jest": true
5+
},
36
"extends": [
47
"airbnb",
58
"plugin:flowtype/recommended"
69
],
10+
"parser": "babel-eslint",
711
"plugins": [
812
"flowtype",
913
"jest",
1014
"react",
1115
"react-hooks"
1216
],
13-
"env": {
14-
"browser": true,
15-
"jest": true
16-
},
1717
"settings": {
1818
"flowtype": {
1919
"onlyFilesWithFlowAnnotation": true
@@ -70,6 +70,7 @@
7070
"OrderedList",
7171
"Map",
7272
"OrderedMap",
73+
"Seq",
7374
"Set",
7475
"OrderedSet",
7576
"SortableContainer",

config/babel/babel.config.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,38 @@ module.exports = {
22
plugins: [
33
'@babel/plugin-proposal-class-properties',
44
'@babel/plugin-proposal-object-rest-spread',
5-
'@babel/plugin-transform-runtime',
5+
['@babel/plugin-transform-runtime', {
6+
corejs: 3,
7+
}],
68
[
79
'babel-plugin-styled-components',
810
{ ssr: false, displayName: false, namespace: 'sc' },
911
],
1012
['babel-plugin-transform-imports', {
13+
'@fortawesome/free-solid-svg-icons': {
14+
transform: (importName) => `@fortawesome/free-solid-svg-icons/${importName}`,
15+
preventFullImport: true,
16+
skipDefaultConversion: true,
17+
},
1118
'@fortawesome/pro-duotone-svg-icons': {
12-
transform: (importName) => `@fortawesome/pro-duotone-svg-icons/${importName}`,
1319
preventFullImport: true,
1420
skipDefaultConversion: true,
21+
transform: (importName) => `@fortawesome/pro-duotone-svg-icons/${importName}`,
1522
},
1623
'@fortawesome/pro-light-svg-icons': {
17-
transform: (importName) => `@fortawesome/pro-light-svg-icons/${importName}`,
1824
preventFullImport: true,
1925
skipDefaultConversion: true,
26+
transform: (importName) => `@fortawesome/pro-light-svg-icons/${importName}`,
2027
},
2128
'@fortawesome/pro-regular-svg-icons': {
22-
transform: (importName) => `@fortawesome/pro-regular-svg-icons/${importName}`,
2329
preventFullImport: true,
2430
skipDefaultConversion: true,
31+
transform: (importName) => `@fortawesome/pro-regular-svg-icons/${importName}`,
2532
},
2633
'@fortawesome/pro-solid-svg-icons': {
27-
transform: (importName) => `@fortawesome/pro-solid-svg-icons/${importName}`,
2834
preventFullImport: true,
2935
skipDefaultConversion: true,
36+
transform: (importName) => `@fortawesome/pro-solid-svg-icons/${importName}`,
3037
},
3138
}],
3239
],
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
const path = require('path');
23

3-
module.exports = require('babel-jest').createTransformer({
4+
module.exports = require('babel-jest').default.createTransformer({
45
configFile: path.resolve(__dirname, '../babel/babel.config.js')
56
});

config/jest/test.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
import '@babel/polyfill';
21
import 'jest-styled-components';

config/lib/lib.config.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

config/lib/paths.config.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

config/storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
2+
core: {
3+
builder: 'webpack5',
4+
},
25
stories: ['../../src/**/*.stories.js'],
36
addons: [
47
'@storybook/addon-actions',

config/storybook/webpack.config.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

config/webpack/webpack.config.js

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
/* eslint-disable import/extensions */
1+
/* eslint-disable import/no-extraneous-dependencies */
22

33
const path = require('path');
44
const Webpack = require('webpack');
55

6-
const LIB_CONFIG = require('../lib/lib.config.js');
7-
const LIB_PATHS = require('../lib/paths.config.js');
86
const PACKAGE = require('../../package.json');
97

8+
const BANNER = `
9+
${PACKAGE.name} - v${PACKAGE.version}
10+
${PACKAGE.description}
11+
${PACKAGE.homepage}
12+
Copyright (c) 2017-${(new Date()).getFullYear()}, OpenLattice, Inc. All rights reserved.
13+
`;
14+
1015
module.exports = (env = {}) => {
1116

1217
/*
@@ -16,8 +21,11 @@ module.exports = (env = {}) => {
1621
const BABEL_CONFIG = path.resolve(__dirname, '../babel/babel.config.js');
1722
const ENV_DEV = 'development';
1823
const ENV_PROD = 'production';
19-
const LIB_FILE_NAME = 'index.js';
20-
const LIB_NAMESPACE = 'LUK';
24+
25+
const ROOT = path.resolve(__dirname, '../..');
26+
const BUILD = path.resolve(ROOT, 'build');
27+
const NODE = path.resolve(ROOT, 'node_modules');
28+
const SOURCE = path.resolve(ROOT, 'src');
2129

2230
/*
2331
* loaders
@@ -26,9 +34,7 @@ module.exports = (env = {}) => {
2634
const BABEL_LOADER = {
2735
test: /\.js$/,
2836
exclude: /node_modules/,
29-
include: [
30-
LIB_PATHS.ABS.SOURCE,
31-
],
37+
include: [SOURCE],
3238
use: {
3339
loader: 'babel-loader',
3440
options: {
@@ -42,7 +48,7 @@ module.exports = (env = {}) => {
4248
*/
4349

4450
const BANNER_PLUGIN = new Webpack.BannerPlugin({
45-
banner: LIB_CONFIG.BANNER,
51+
banner: BANNER,
4652
entryOnly: true,
4753
});
4854

@@ -60,43 +66,29 @@ module.exports = (env = {}) => {
6066
return {
6167
bail: true,
6268
entry: [
63-
LIB_PATHS.ABS.ENTRY,
69+
path.resolve(ROOT, 'src/index.js'),
6470
],
65-
externals: {
66-
react: {
67-
root: 'React',
68-
commonjs2: 'react',
69-
commonjs: 'react',
70-
amd: 'react'
71-
},
72-
'react-dom': {
73-
root: 'ReactDOM',
74-
commonjs2: 'react-dom',
75-
commonjs: 'react-dom',
76-
amd: 'react-dom'
77-
},
78-
'styled-components': {
79-
amd: 'styled-components',
80-
commonjs: 'styled-components',
81-
commonjs2: 'styled-components',
82-
},
83-
},
8471
mode: env.production ? ENV_PROD : ENV_DEV,
8572
module: {
8673
rules: [
8774
BABEL_LOADER,
75+
{
76+
test: /\.(jpg|png|svg)$/,
77+
type: 'asset/inline',
78+
},
8879
],
8980
},
9081
optimization: {
91-
// minimize: !!env.production,
92-
minimize: false,
82+
minimize: !!env.production,
9383
},
9484
output: {
95-
library: LIB_NAMESPACE,
96-
libraryTarget: 'umd',
97-
path: LIB_PATHS.ABS.BUILD,
85+
filename: 'index.js',
86+
library: {
87+
name: 'LUK',
88+
type: 'umd',
89+
},
90+
path: BUILD,
9891
publicPath: '/',
99-
filename: LIB_FILE_NAME,
10092
},
10193
performance: {
10294
hints: false, // disable performance hints for now
@@ -108,8 +100,8 @@ module.exports = (env = {}) => {
108100
resolve: {
109101
extensions: ['.js'],
110102
modules: [
111-
LIB_PATHS.ABS.SOURCE,
112-
'node_modules',
103+
SOURCE,
104+
NODE,
113105
],
114106
},
115107
target: 'web',

0 commit comments

Comments
 (0)