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

🔧 Move build deps and scripts to archetype #1

Merged
merged 5 commits into from
Jun 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"presets": ["es2015", "react"],
"env": {
"development": {
"presets": ["es2015-webpack", "react"],
"plugins": [
["transform-es2015-modules-commonjs-simple", {
"noMangle": true
}]
]
}
}
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc"
}
3 changes: 3 additions & 0 deletions .builderrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
archetypes:
- dash-components-archetype
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
extends: ./node_modules/dash-components-archetype/config/eslint/eslintrc-react.json
50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

Empty file added circle.yml
Empty file.
5 changes: 0 additions & 5 deletions config/.eslintrc.json

This file was deleted.

13 changes: 0 additions & 13 deletions config/eslint/eslintrc-node.json

This file was deleted.

18 changes: 0 additions & 18 deletions config/webpack/webpack.config.dev.js

This file was deleted.

17 changes: 0 additions & 17 deletions config/webpack/webpack.config.js

This file was deleted.

35 changes: 8 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,22 @@
"type": "git",
"url": "git://github.com/plotly/dash-components-core.git"
},
"main": "lib/basic/index.js",
"main": "lib/index.js",
"scripts": {
"clean-lib": "mkdir -p lib && rm -rf lib/*",
"transpile-dev": "npm run clean-lib && npm run extract-metadata && babel --source-root ./src/ -d lib/ src/",
"transpile-dev-watch": "npm run clean-lib && npm run extract-metadata && babel --watch --source-root ./src/ -d lib/ src/",
"build-dev": "webpack --config=config/webpack/webpack.config.dev.js",
"extract-metadata": "mkdir -p lib && react-docgen --pretty -o lib/metadata.json src/basic/components",
"dev": "webpack-dev-server --config=config/webpack/webpack.config.dev.js",
"lint": "eslint --quiet --fix --ignore-path .gitignore .",
"prepublish": "npm test",
"start": "npm run transpile-dev-watch",
"test": "npm run lint"
"start": "builder run transpile-dev-watch",
"test": "builder run lint"
},
"author": "Per Nilsson <[email protected]>",
"license": "MIT",
"dependencies": {
"babel-cli": "^6.10.1",
"babel-core": "^6.9.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"clean-webpack-plugin": "^0.1.9",
"builder": "2.10.1",
"dash-components-archetype": "^0.1.0",
"radium": "^0.17.1",
"ramda": "^0.21.0",
"react-docgen": "^2.8.2",
"react-dom": "^15.1.0",
"webpack": "^1.13.1",
"webpack-partial": "^1.2.0"
"react": "^15.1.0",
"react-dom": "^15.1.0"
},
"devDependencies": {
"babel-plugin-transform-es2015-modules-commonjs-simple": "^6.7.4",
"babel-preset-es2015-webpack": "^6.4.1",
"eslint": "^2.8.0",
"eslint-plugin-import": "^1.8.1",
"eslint-plugin-react": "^5.1.1",
"react": "^15.1.0"
"dash-components-archetype-dev": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion src/basic/Styles.js → src/Styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ const palette = {

export default {
colors: palette
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const baseStyles = {
':hover': {
color: Styles.colors.baseHover
}
}
};

/**
* A div for displaying text. The text is editable.
*/
export default class EditableDiv extends Component {

constructor(props) {
super(props);
this.state = {inEditMode: false};
super(props)
this.state = {inEditMode: false}
}

componentDidUpdate() {
if (this.state.inEditMode) ReactDOM.findDOMNode(this.refs.input).focus();
if (this.state.inEditMode) ReactDOM.findDOMNode(this.refs.input).focus()
}

render() {
Expand All @@ -43,18 +43,18 @@ export default class EditableDiv extends Component {
onBlur={() => this.setState({inEditMode: false})}
/>
</div>
);
)
}
else {
return (
<div style={R.merge(baseStyles, this.props.style)}
onClick={() => {
if (this.props.editable) this.setState({inEditMode: true});
if (this.props.editable) this.setState({inEditMode: true})
}}
>
{this.props.text}
</div>
);
)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
'use strict';

import React, {Component, PropTypes} from 'react';

/**
* A component that greets a person in a header
*/
class Header extends Component {
render() {
return <h2>Hello, {this.props.name}</h2>;
return <h2>Hello, {this.props.name}</h2>
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import React, {Component, PropTypes} from 'react';
*/
export default class InputControl extends Component {
constructor() {
super();
super()
this.state = {
value: ''
}
}

handleChange(value) {
this.setState({value});
this.setState({value})
/**
* TODO (#22): Remove conditional. Always pass a callback function
* to components that can change value.
Expand All @@ -29,7 +29,7 @@ export default class InputControl extends Component {
onChange={e => this.handleChange(e.target.value)}
{...this.props}
/>
);
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/basic/index.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export {
EditableDiv,
Header,
InputControl
};
};