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

Commit 10e36c6

Browse files
author
Per Nilsson
committed
Add README with development, publish instructions
- Add eslint, fix paths in package.json - Move webpack config to subdirectory
1 parent 8bcf378 commit 10e36c6

File tree

7 files changed

+117
-4
lines changed

7 files changed

+117
-4
lines changed

.eslintrc.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"env": {
3+
"node": false,
4+
"browser": true,
5+
"es6": true
6+
},
7+
"extends": "eslint:recommended",
8+
"parserOptions": {
9+
"ecmaVersion": 6,
10+
"sourceType": "module",
11+
"ecmaFeatures": {
12+
"jsx": true
13+
}
14+
},
15+
"plugins": [
16+
"import",
17+
"react"
18+
],
19+
"rules": {
20+
"react/jsx-uses-vars": 2,
21+
"react/jsx-uses-react": 2,
22+
"react/react-in-jsx-scope": 2,
23+
"import/imports-first": 2,
24+
"import/no-unresolved": 2,
25+
"import/named": 2,
26+
"import/default": 2,
27+
"import/namespace": 2,
28+
"import/export": 2,
29+
"import/no-named-as-default": 2,
30+
"import/no-named-as-default-member": 2,
31+
"import/no-deprecated": 2,
32+
"import/no-extraneous-dependencies": 2,
33+
"import/no-mutable-exports": 2,
34+
"import/no-commonjs": 2,
35+
"import/no-amd": 2,
36+
"import/no-nodejs-modules": 2,
37+
"import/imports-first": 2,
38+
"import/no-duplicates": 2,
39+
"import/no-namespace": 2,
40+
"import/extensions": 2,
41+
"import/order": 2,
42+
"import/newline-after-import": 2,
43+
"import/prefer-default-export": 2
44+
},
45+
"settings": {
46+
"react": {
47+
"version": "15.0"
48+
}
49+
}
50+
}

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Dash Components Core
2+
3+
This package provides the core React component suite for [Dash2][].
4+
5+
## Development
6+
7+
We don't yet have a dev server with demo capabilities in this repo. The best way
8+
to test your components is by linking into `dash2` and testing them from there.
9+
10+
1. Prepare module by linking and watching for changes
11+
12+
# Symlink module
13+
$ npm link
14+
15+
# Transpile components to `lib/` and watch for changes
16+
$ npm start
17+
18+
2. Link module into `dash2` project
19+
20+
# In the `dash2/renderer` project directory:
21+
$ npm link dash-components-core
22+
23+
Now you should be able to restart the webpack process (in `dash2/renderer`:
24+
`ctrl-c`, `npm start`), after which webpack will automatically pick up new
25+
changes to the component suite.
26+
27+
## Publishing
28+
29+
Ask @coopy or @chriddyp to be added to the [NPM package authors][].
30+
31+
```sh
32+
# Bump the package version
33+
$ npm version major|minor|patch
34+
35+
# Push branch and tags to repo
36+
$ git push --follow-tags
37+
38+
# Publish to NPM (will run tests as a pre-publish step)
39+
$ npm publish
40+
```
41+
42+
[Dash2]: https://github.com/plotly/dash2
43+
[NPM package authors]: https://www.npmjs.com/package/dash-components-core/access

config/.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"extends": "../../config/eslint/eslintrc-node.json"
2+
// This is a little crazy - referencing `./` makes eslint look in the
3+
// `node_modules` directory. This is a workaround for now:
4+
"extends": "../config/eslint/eslintrc-node.json"
35
}

config/eslint/eslintrc-node.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"extends": "eslint:recommended",
6+
"plugins": [
7+
"import"
8+
],
9+
"rules": {
10+
"import/no-commonjs": 0,
11+
"import/no-nodejs-modules": 0
12+
}
13+
}
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
"name": "dash-components-core",
33
"version": "0.0.3",
44
"description": "Core component suite for Dash2",
5+
"repository": {
6+
"type": "git",
7+
"url": "git://github.com/plotly/dash-components-core.git"
8+
},
59
"main": "lib/basic/index.js",
610
"scripts": {
711
"clean-lib": "mkdir -p lib && rm -rf lib/*",
812
"transpile-dev": "npm run clean-lib && npm run extract-metadata && babel --source-root ./src/ -d lib/ src/",
913
"transpile-dev-watch": "npm run clean-lib && npm run extract-metadata && babel --watch --source-root ./src/ -d lib/ src/",
10-
"build-dev": "webpack --config=config/webpack.config.dev.js",
14+
"build-dev": "webpack --config=config/webpack/webpack.config.dev.js",
1115
"extract-metadata": "mkdir -p lib && react-docgen --pretty -o lib/metadata.json src/basic/components",
12-
"dev": "webpack-dev-server --config=config/webpack.config.dev.js",
13-
"lint": "eslint --quiet --fix --ignore-path ../.gitignore .",
16+
"dev": "webpack-dev-server --config=config/webpack/webpack.config.dev.js",
17+
"lint": "eslint --quiet --fix --ignore-path .gitignore .",
18+
"prepublish": "npm test",
1419
"start": "npm run transpile-dev-watch",
1520
"test": "npm run lint"
1621
},

0 commit comments

Comments
 (0)