Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 3393376

Browse files
authored
Merge pull request #1 from plotly/builder-archetype
🔧 Move build deps and scripts to archetype
2 parents 10e36c6 + e8f8081 commit 3393376

15 files changed

+27
-156
lines changed

.babelrc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"presets": ["es2015", "react"],
3-
"env": {
4-
"development": {
5-
"presets": ["es2015-webpack", "react"],
6-
"plugins": [
7-
["transform-es2015-modules-commonjs-simple", {
8-
"noMangle": true
9-
}]
10-
]
11-
}
12-
}
2+
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc"
133
}

.builderrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
archetypes:
3+
- dash-components-archetype

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
extends: ./node_modules/dash-components-archetype/config/eslint/eslintrc-react.json

.eslintrc.json

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

circle.yml

Whitespace-only changes.

config/.eslintrc.json

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

config/eslint/eslintrc-node.json

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

config/webpack/webpack.config.dev.js

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

config/webpack/webpack.config.js

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

package.json

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,22 @@
66
"type": "git",
77
"url": "git://github.com/plotly/dash-components-core.git"
88
},
9-
"main": "lib/basic/index.js",
9+
"main": "lib/index.js",
1010
"scripts": {
11-
"clean-lib": "mkdir -p lib && rm -rf lib/*",
12-
"transpile-dev": "npm run clean-lib && npm run extract-metadata && babel --source-root ./src/ -d lib/ src/",
13-
"transpile-dev-watch": "npm run clean-lib && npm run extract-metadata && babel --watch --source-root ./src/ -d lib/ src/",
14-
"build-dev": "webpack --config=config/webpack/webpack.config.dev.js",
15-
"extract-metadata": "mkdir -p lib && react-docgen --pretty -o lib/metadata.json src/basic/components",
16-
"dev": "webpack-dev-server --config=config/webpack/webpack.config.dev.js",
17-
"lint": "eslint --quiet --fix --ignore-path .gitignore .",
18-
"prepublish": "npm test",
19-
"start": "npm run transpile-dev-watch",
20-
"test": "npm run lint"
11+
"start": "builder run transpile-dev-watch",
12+
"test": "builder run lint"
2113
},
2214
"author": "Per Nilsson <[email protected]>",
2315
"license": "MIT",
2416
"dependencies": {
25-
"babel-cli": "^6.10.1",
26-
"babel-core": "^6.9.0",
27-
"babel-loader": "^6.2.4",
28-
"babel-preset-es2015": "^6.6.0",
29-
"babel-preset-react": "^6.5.0",
30-
"clean-webpack-plugin": "^0.1.9",
17+
"builder": "2.10.1",
18+
"dash-components-archetype": "^0.1.0",
3119
"radium": "^0.17.1",
3220
"ramda": "^0.21.0",
33-
"react-docgen": "^2.8.2",
34-
"react-dom": "^15.1.0",
35-
"webpack": "^1.13.1",
36-
"webpack-partial": "^1.2.0"
21+
"react": "^15.1.0",
22+
"react-dom": "^15.1.0"
3723
},
3824
"devDependencies": {
39-
"babel-plugin-transform-es2015-modules-commonjs-simple": "^6.7.4",
40-
"babel-preset-es2015-webpack": "^6.4.1",
41-
"eslint": "^2.8.0",
42-
"eslint-plugin-import": "^1.8.1",
43-
"eslint-plugin-react": "^5.1.1",
44-
"react": "^15.1.0"
25+
"dash-components-archetype-dev": "^0.1.0"
4526
}
4627
}

src/basic/Styles.js renamed to src/Styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const palette = {
99

1010
export default {
1111
colors: palette
12-
}
12+
};

src/basic/components/EditableDiv.react.js renamed to src/components/EditableDiv.react.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ const baseStyles = {
1010
':hover': {
1111
color: Styles.colors.baseHover
1212
}
13-
}
13+
};
1414

1515
/**
1616
* A div for displaying text. The text is editable.
1717
*/
1818
export default class EditableDiv extends Component {
1919

2020
constructor(props) {
21-
super(props);
22-
this.state = {inEditMode: false};
21+
super(props)
22+
this.state = {inEditMode: false}
2323
}
2424

2525
componentDidUpdate() {
26-
if (this.state.inEditMode) ReactDOM.findDOMNode(this.refs.input).focus();
26+
if (this.state.inEditMode) ReactDOM.findDOMNode(this.refs.input).focus()
2727
}
2828

2929
render() {
@@ -43,18 +43,18 @@ export default class EditableDiv extends Component {
4343
onBlur={() => this.setState({inEditMode: false})}
4444
/>
4545
</div>
46-
);
46+
)
4747
}
4848
else {
4949
return (
5050
<div style={R.merge(baseStyles, this.props.style)}
5151
onClick={() => {
52-
if (this.props.editable) this.setState({inEditMode: true});
52+
if (this.props.editable) this.setState({inEditMode: true})
5353
}}
5454
>
5555
{this.props.text}
5656
</div>
57-
);
57+
)
5858
}
5959
}
6060

src/basic/components/Header.react.js renamed to src/components/Header.react.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
'use strict';
2-
31
import React, {Component, PropTypes} from 'react';
42

53
/**
64
* A component that greets a person in a header
75
*/
86
class Header extends Component {
97
render() {
10-
return <h2>Hello, {this.props.name}</h2>;
8+
return <h2>Hello, {this.props.name}</h2>
119
}
1210
}
1311

src/basic/components/InputControl.react.js renamed to src/components/InputControl.react.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import React, {Component, PropTypes} from 'react';
55
*/
66
export default class InputControl extends Component {
77
constructor() {
8-
super();
8+
super()
99
this.state = {
1010
value: ''
1111
}
1212
}
1313

1414
handleChange(value) {
15-
this.setState({value});
15+
this.setState({value})
1616
/**
1717
* TODO (#22): Remove conditional. Always pass a callback function
1818
* to components that can change value.
@@ -29,7 +29,7 @@ export default class InputControl extends Component {
2929
onChange={e => this.handleChange(e.target.value)}
3030
{...this.props}
3131
/>
32-
);
32+
)
3333
}
3434
}
3535

src/basic/index.js renamed to src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export {
1010
EditableDiv,
1111
Header,
1212
InputControl
13-
};
13+
};

0 commit comments

Comments
 (0)