Skip to content

Commit 63abd0b

Browse files
author
Dave Ferris
committed
Reconfigure package.json and organize directories for installation
1 parent 1dca205 commit 63abd0b

File tree

11 files changed

+631
-20
lines changed

11 files changed

+631
-20
lines changed

.babelrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
"@babel/plugin-proposal-object-rest-spread",
8+
],
9+
"env": {
10+
"production": {
11+
"plugins": [
12+
[
13+
"transform-react-remove-prop-types",
14+
{
15+
"removeImport": true
16+
}
17+
]
18+
]
19+
}
20+
}
21+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.pnp.js
77

88
# distribution
9-
dist
9+
lib
1010

1111
# testing
1212
/coverage

.storybook/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { configure, addDecorator } from '@storybook/react';
33
import { withA11y } from '@storybook/addon-a11y';
44

55
import 'bootstrap/dist/css/bootstrap.min.css';
6-
import '../src/shared/global.scss';
6+
import '../scss/global.scss';
77

88
addDecorator(withA11y);
99
addDecorator(story => (
@@ -13,4 +13,4 @@ addDecorator(story => (
1313
));
1414

1515
// automatically import all files ending in *.stories.jsx
16-
configure(require.context('../src', true, /\.stories\.jsx$/), module);
16+
configure(require.context('../stories', true, /\.stories\.jsx$/), module);

package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"react-dom": "^16.12.0"
1212
},
1313
"scripts": {
14-
"start": "react-scripts start",
15-
"build": "react-scripts build",
14+
"build": "NODE_ENV=production babel src --out-dir lib",
1615
"lint": "eslint . --ext .js,.jsx",
1716
"test": "react-scripts test",
1817
"eject": "react-scripts eject",
1918
"storybook": "start-storybook -p 9009 -s public",
2019
"build-storybook": "build-storybook -s public",
2120
"build-storybook-docs": "build-storybook -s public --docs",
22-
"deploy-storybook": "storybook-to-ghpages"
21+
"deploy-storybook": "storybook-to-ghpages",
22+
"prepare": "yarn build"
2323
},
2424
"eslintConfig": {
2525
"extends": "react-app"
@@ -37,6 +37,9 @@
3737
]
3838
},
3939
"devDependencies": {
40+
"@babel/cli": "^7.8.4",
41+
"@babel/core": "^7.8.4",
42+
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
4043
"@storybook/addon-a11y": "^5.2.6",
4144
"@storybook/addon-actions": "^5.2.6",
4245
"@storybook/addon-docs": "^5.2.6",
@@ -46,14 +49,23 @@
4649
"@storybook/addons": "^5.2.6",
4750
"@storybook/react": "^5.2.6",
4851
"@storybook/storybook-deployer": "^2.8.1",
52+
"babel-loader": "^8.0.6",
53+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
54+
"babel-preset-env": "^1.7.0",
55+
"babel-preset-react": "^6.24.1",
4956
"eslint-config-airbnb": "^18.0.1",
5057
"eslint-import-resolver-webpack": "^0.11.1",
5158
"eslint-plugin-babel": "^5.3.0",
5259
"eslint-utils": "^1.4.3",
5360
"react-scripts": "3.2.0"
5461
},
5562
"description": "UI Storybook design system",
56-
"main": "dist/index.js",
63+
"files": [
64+
"lib",
65+
"scss",
66+
"src"
67+
],
68+
"main": "lib/index.js",
5769
"publishConfig": {
5870
"registry": "https://npm.pkg.github.com/@user-interviews"
5971
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import url('https://fonts.googleapis.com/css?family=Lato:300,300italic,400,700:latin');
2-
@import '../scss/theme';
2+
@import './theme';
33

44
body {
55
font-family: $font-family;
File renamed without changes.
File renamed without changes.

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export * from './Card';
1+
import Card from './Card';
2+
3+
export { Card };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { withKnobs, text } from '@storybook/addon-knobs';
33

4-
import Card from './Card';
4+
import Card from '../src/Card';
55

66
export default {
77
title: 'Design System|Card',

0 commit comments

Comments
 (0)