diff --git a/.babelrc b/.babelrc index 86c445f5..562a5e32 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["es2015", "react"] + "presets": ["es2015", "react", "stage-1"] } diff --git a/.eslintrc.json b/.eslintrc.json index 5d6f9e58..2e9b0bfb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,6 @@ { "extends": "airbnb", + "parser": "babel-eslint", "plugins": [ "react" ], diff --git a/.gitignore b/.gitignore index b34c92b8..511614fe 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ npm-debug.log* node_modules .npm /coverage +lib diff --git a/package.json b/package.json index 15e648a4..0401e3db 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,13 @@ "name": "@bufferapp/components", "version": "0.0.1", "description": "A shared set of UI Components", - "main": "src/index.js", + "main": "lib/index.js", "scripts": { "start": "start-storybook -p 9001", "deploy-storybook": "storybook-to-ghpages", + "build": "rm -rf ./lib && node_modules/babel-cli/bin/babel.js ./src --ignore story.js,test.js,testHelpers/* --out-dir ./lib", "lint": "./node_modules/eslint/bin/eslint.js --ignore-pattern coverage .", + "prepublish": "npm run build", "test": "npm run lint && ./node_modules/jest-cli/bin/jest.js --coverage", "test-watch": "./node_modules/jest-cli/bin/jest.js --watch", "test-update": "npm run lint && ./node_modules/jest-cli/bin/jest.js --coverage -u" @@ -28,15 +30,19 @@ "devDependencies": { "@kadira/storybook": "^2.5.2", "@kadira/storybook-deployer": "^1.1.0", + "babel-cli": "^6.14.0", + "babel-eslint": "^6.1.2", "babel-jest": "^14.1.0", "babel-preset-es2015": "^6.14.0", "babel-preset-react": "^6.11.1", + "babel-preset-stage-1": "^6.13.0", "eslint": "^2.11.1", "eslint-config-airbnb": "^9.0.1", "eslint-plugin-import": "^1.8.1", "eslint-plugin-jsx-a11y": "^1.2.3", "eslint-plugin-react": "^5.1.1", "jest-cli": "^14.1.0", + "react-addons-test-utils": "^15.3.1", "react-test-renderer": "^15.3.1" }, "jest": { @@ -47,5 +53,9 @@ "../testHelpers" ], "testRegex": "src/.*test\\.js$" - } + }, + "files": [ + "lib", + "src" + ] } diff --git a/src/index.js b/src/index.js index e5c46451..6cb9c928 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ -export { default as Card } from './Card'; -export { default as Icon } from './Icon'; -export { default as Image } from './Image'; -export { default as NavBar } from './NavBar'; -export { default as Text } from './Text'; -export { default as VectorGraphic } from './VectorGraphic'; -export { default as Video } from './Video'; +export Card from './Card'; +export Icon from './Icon'; +export Image from './Image'; +export NavBar from './NavBar'; +export Text from './Text'; +export VectorGraphic from './VectorGraphic'; +export Video from './Video';