diff --git a/.babelrc b/.babelrc index e27fa59825..2529c0293c 100644 --- a/.babelrc +++ b/.babelrc @@ -1,17 +1,32 @@ { - "presets": ["react", "es2015", "stage-1"], - "env": { - "amd": { - "plugins": ["import-noop"] - }, - "commonjs": { - "plugins": ["import-noop"] - }, - "test": { - "plugins": ["istanbul"] + "presets": [ + ["env", { + "targets": { + browsers: ['last 2 versions', 'ie 11'], + node: '6.10' } + }], + "babel-preset-react" + ], + "env": { + "amd": { + "plugins": ["import-noop"] + }, + "commonjs": { + "plugins": ["import-noop"] }, - "plugins": [ - ["babel-plugin-root-import", "transform-class-properties"] - ] -} + "test": { + "plugins": ["istanbul"] + } + }, + "ignore": [ + "preset/**", + ], + plugins: [ + "babel-plugin-root-import", + "babel-plugin-transform-object-rest-spread", + "babel-plugin-transform-class-properties", + "babel-plugin-syntax-export-extensions", + "babel-plugin-transform-export-default" + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1f8d7f1af4..5c373a6838 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ ### Project files ### +# Only used for release server authentication +.npmrc + # We may want to remove to make first-time contributing easier package-lock.json diff --git a/README.md b/README.md index e5023c65fd..1366b832bb 100644 --- a/README.md +++ b/README.md @@ -4,35 +4,56 @@ [![Build Status](https://travis-ci.com/salesforce/design-system-react.svg?token=erkizBStRxre5p3S1xij&branch=master)](https://travis-ci.com/salesforce/design-system-react) [![DeepScan Grade](https://deepscan.io/api/projects/1475/branches/4666/badge/grade.svg)](https://deepscan.io/dashboard/#view=project&pid=1475&bid=4666) +## Install + +``` +$ npm install @salesforce-ux/design-system @salesforce/design-system-react +``` + ## Getting Started -Welcome to the project! :wave: This library is the [React](https://facebook.github.io/react/) implementation of the [Salesforce Lightning Design System](https://www.lightningdesignsystem.com/). It has been tested with React >=15.4.1 <16 and is stable despite its version numbers. A 1.0 will be released soon. +Welcome to the project! :wave: This library is the [React](https://facebook.github.io/react/) implementation of the [Salesforce Lightning Design System](https://www.lightningdesignsystem.com/). This library has a peer dependency on `@salesforce-ux/design-system`, `react`, and `react-dom`. It has been tested with React >=15.4.1 <16 and is stable despite its version number. A 1.0 will be released soon. +* [Usage](#usage-recommended) * [Getting Started](https://react.lightningdesignsystem.com/getting-started/) -* [Documentation and examples](https://react.lightningdesignsystem.com) +* [Documentation and interactive examples](https://react.lightningdesignsystem.com) * [Contributing](CONTRIBUTING.md) * [Codebase Overview](docs/codebase-overview.md) * [Usage with Webpack](docs/webpack.md) -#### ECMAScript 6, CommonJS and `create-react-app` +### Quick Setup (CommonJS) -It is highly recommended that you `npm install` the `-es` suffixed tag and import individual components. You will need a [stage-1 and higher proposed features](https://babeljs.io/docs/plugins/preset-stage-1/) transpiler ([stage-1 Babel preset](https://www.npmjs.com/package/babel-preset-stage-1) or review our `.babelrc`) and include transpiling the `node_modules/design-system-react` folder in your configuration. The non-suffixed package is a [CommonJS](https://nodejs.org/docs/latest/api/modules.html) build that should allow dropping dead code, but not tree-shaking. +A CommonJS-compatible version has been included within the NPM package to allows usage without transpiling. Use the following named `import` syntax to access CommonJS components from `/lib/index.js`: + +``` +import { Button } from 'design-system-react'; + +