Skip to content

Commit

Permalink
Build ES6 to ES5 in prepublish step. Closes carbon-design-system#177 (c…
Browse files Browse the repository at this point in the history
…arbon-design-system#196)

* Build ES5. Closes carbon-design-system#177

* dont lint es5 build

* build es5 in deploy script

* fix deploy, update readme

* fix package name
  • Loading branch information
mbecvarik authored and Christopher A. Dhanaraj committed Nov 1, 2016
1 parent 0aec9df commit 561bba9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules

# docs
.gh-pages

# distribution files
dist
86 changes: 39 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,56 @@ A set of React Components that implements [Bluemix Components](https://github.ib
View available React Components [here](https://pages.github.ibm.com/Bluemix/bluemix-components-react/).

## Getting Started
Bluemix Components React is published to a private npm registry maintained by Bluemix Ops Console team.

> NPM package for `bluemix-components-react` is coming soon.
1. Before installing with npm,
you must create an **.npmrc** file - you can create this in the root of your project folder or on your computer's **~** directory.

Requires the use of
[Webpack](http://webpack.github.io/docs/tutorials/getting-started/) and the following dependencies below.
See [webpack.config.js](https://github.ibm.com/Bluemix/bluemix-components-react/blob/master/.storybook/webpack.config.js) for details.
```
$ touch .npmrc
```

All dependencies can be installed with `npm`.
Next, write the following into your **.npmrc** file:

- `json-loader`
- `postcss-loader`
- `sass-loader`
- `style-loader`
- `css-loader`
- `node-sass`
```
//dev-console-npm.stage1.ng.bluemix.net/:_authToken="u6vjQywpRv51/eKBiRcAFA=="
@console:registry=https://dev-console-npm.stage1.ng.bluemix.net/
```

## Contributing

First: Fork the repo, Clone your Fork and install dependencies with `npm`

```sh
npm install
```

Start dev server (which uses [React Storybook](https://github.com/kadirahq/react-storybook)):
If you haven't done so already, create a **package.json** for your project:

```sh
npm run storybook
```
```
$ npm init
```

Open browser to [http://localhost:9001/](http://localhost:9001/) and develop components in [.storybook](https://github.ibm.com/Bluemix/bluemix-components-react/tree/master/.storybook) folder.
2. Install bluemix-components-react with `npm`.

## Run tests
```
$ npm install --save @console/bluemix-components-react
```

```sh
npm run test
```
3. These components require the use of
[Webpack](http://webpack.github.io/docs/tutorials/getting-started/) in your project.
See [webpack.config.js](https://github.ibm.com/Bluemix/bluemix-components-react/blob/master/.storybook/webpack.config.js) for an example config.

## Run coverage test
The following dependencies are required and can be installed with `npm`.

```sh
npm run coverage
```
- `json-loader`
- `postcss-loader`
- `sass-loader`
- `style-loader`
- `css-loader`
- `node-sass`

## Run linting
4. Example Usage
```
import { Loading } from '@console/bluemix-components-react';
ReactDOM.render(
<Loading className="example-loading" />,
document.getElementById('example-container')
);
```

```sh
npm run lint
```

## Run lint and tests

```sh
npm run check
```

## Deploy react-storybook to gh-pages
## Contributing

```sh
npm run deploy
```
Please refer to our [Contributing Guidelines](https://github.ibm.com/Bluemix/bluemix-components-react/blob/master/CONTRIBUTING.md).
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
"name": "@console/bluemix-components-react",
"version": "0.0.8-beta",
"description": "A React wrapper for bluemix-components",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"check": "npm run lint && npm run test",
"coverage": "jest --coverage && node scripts/create-badge.js",
"lint": "eslint .",
"lint": "eslint --ignore-pattern dist .",
"storybook": "start-storybook -p 9001",
"test": "jest",
"test-watch": "jest --watch",
"deploy": "build-storybook -s .storybook -o .gh-pages && node scripts/gh-pages.js"
"deploy": "build-storybook -s .storybook -o .gh-pages && node scripts/gh-pages.js",
"build-es5": "babel . -d dist --ignore __tests__,node_modules,scripts,deploy.js"
},
"keywords": [
"react",
"bluemix",
"bluemix-components"
],
"files": [
"components/**/*",
"containers/**/*",
"elements/**/*",
"internal/**/*",
"lib/**/*",
"index.js"
"dist/**/*"
],
"contributors": [
{
Expand Down Expand Up @@ -80,6 +76,7 @@
"@kadira/react-storybook-decorator-centered": "^1.0.0",
"@kadira/storybook": "^2.29.0",
"autoprefixer": "^6.3.7",
"babel-cli": "^6.18.0",
"babel-eslint": "^6.1.2",
"babel-jest": "^14.1.0",
"babel-preset-es2015": "^6.14.0",
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
npm run build-es5

npm install @console/console-npm-scripts
./node_modules/@console/console-npm-scripts/deploy.sh
Expand Down

0 comments on commit 561bba9

Please sign in to comment.