Skip to content

Commit b1ab0db

Browse files
committed
Getting build environment working.
1 parent 9d300c8 commit b1ab0db

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"env": {
3+
"production": {
4+
"plugins": [
5+
"transform-react-remove-prop-types",
6+
"transform-react-constant-elements",
7+
"transform-react-inline-elements"
8+
]
9+
}
10+
},
11+
"presets": ["airbnb", "es2015", "stage-0", "react"]
12+
}

.eslintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "airbnb",
3+
"rules": {
4+
"indent": ["warn", 4, {"SwitchCase": 1}],
5+
"react/prop-types": "off",
6+
"react/jsx-indent": ["warn", 4],
7+
"react/jsx-indent-props": ["warn", 4],
8+
"comma-dangle": ["error", "never"],
9+
"max-len": ["error", 140],
10+
"react/jsx-boolean-value": ["error", "always"],
11+
"no-plusplus": "off",
12+
"no-param-reassign": "off"
13+
}
14+
}

package.json

+50-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"name": "react-virtualized-sticky-tree",
3-
"version": "1.0.0",
43
"description": "A React component for efficiently rendering tree like structures with support for position: sticky",
5-
"main": "index.js",
4+
"version": "1.0.0",
5+
"author": "Marc McIntyre <marchaos@gmail.com>",
6+
"license": "MIT",
7+
"main": "dist/commonjs/index.js",
8+
"module": "dist/es/index.js",
9+
"homepage": "https://github.com/marchaos/react-virtualized-sticky-tree#readme",
610
"repository": {
711
"type": "git",
8-
"url": "git+https://github.com/marchaos/react-virtualized-sticky-tree.git"
12+
"url": "https://github.com/marchaos/react-virtualized-sticky-tree.git"
913
},
1014
"keywords": [
1115
"react",
@@ -14,13 +18,53 @@
1418
"position",
1519
"sticky"
1620
],
17-
"author": "Marc McIntyre <marchaos@gmail.com>",
18-
"license": "MIT",
21+
"scripts": {
22+
"build": "npm run build:commonjs && npm run build:es",
23+
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel src --out-dir dist/commonjs --ignore *.spec.js",
24+
"build:es": "npm run clean:es && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel src --out-dir dist/es --ignore *.spec.js",
25+
"prepublish": "npm run build",
26+
"clean:commonjs": "rimraf dist/commonjs",
27+
"clean:es": "rimraf dist/es"
28+
},
29+
"files": [
30+
"dist"
31+
],
1932
"bugs": {
2033
"url": "https://github.com/marchaos/react-virtualized-sticky-tree/issues"
2134
},
22-
"homepage": "https://github.com/marchaos/react-virtualized-sticky-tree#readme",
2335
"peerDependencies": {
2436
"react": "^15.6.1"
37+
},
38+
"devDependencies": {
39+
"webpack": "latest",
40+
"babel-cli": "6.8.0",
41+
"babel-core": "latest",
42+
"babel-loader": "latest",
43+
"cross-env": "latest",
44+
"rimraf": "latest",
45+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
46+
"babel-plugin-transform-react-constant-elements": "latest",
47+
"babel-plugin-transform-react-inline-elements": "latest",
48+
"babel-plugin-transform-react-remove-prop-types": "latest",
49+
"babel-polyfill": "^6.13.0",
50+
"babel-preset-airbnb": "^2.0.0",
51+
"babel-preset-es2015": "latest",
52+
"babel-preset-react": "latest",
53+
"babel-preset-stage-0": "latest",
54+
"babel-register": "^6.18.0",
55+
"chai": "^3.5.0",
56+
"chai-enzyme": "latest",
57+
"enzyme": "latest",
58+
"eslint": "^3.19.0",
59+
"eslint-config-airbnb": "latest",
60+
"eslint-plugin-import": "^2.2.0",
61+
"eslint-plugin-jsx-a11y": "^5.0.0",
62+
"eslint-plugin-react": "^7.0.0",
63+
"jsdom": "10.1.0",
64+
"jsdom-global": "latest",
65+
"json-loader": "^0.5.4",
66+
"mocha": "^3.4.2",
67+
"nyc": "^8.3.1",
68+
"testdouble": "^1.8.0"
2569
}
2670
}

0 commit comments

Comments
 (0)