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

Commit

Permalink
Merge pull request #299 from plotly/update_scripts
Browse files Browse the repository at this point in the history
Update npm scripts used for building, testing, etc.
  • Loading branch information
valentijnnieman authored Oct 2, 2018
2 parents 926f0fd + d02fc53 commit 4d7fe82
Show file tree
Hide file tree
Showing 52 changed files with 4,053 additions and 8,806 deletions.
8 changes: 3 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc",
"plugins": [
"styled-jsx/babel"
]
}
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread", "styled-jsx/babel"]
}
13 changes: 9 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@ jobs:
paths:
- "venv"
- "node_modules"

- run:
name: prettier --list-different
command: npm run format:test

- run:
name: npm run lint
command: npm run lint

- run:
name: Build
command: |
. venv/bin/activate
npm run build:js
npm run build:py
- run:
name: npm test
command: npm test

- run:
name: Run tests
command: |
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.31.0] - 2018-09-21
### Changed
- Updated NPM scripts:
- `test` now runs Selenium integration tests
- `format` runs Prettier formatter
- There are new `build` scripts, most notably `build:watch` runs a watcher and rebuilds upon changes
- There's a new `publish-all` script that publishes to NPM and PyPi
### Fixed
- The `start` script will now run the `Demo` application

## [0.30.2] - 2018-09-21
### Fixed
- Fixed regression in Graph component where it wouldn't resize correctly [#256](https://github.com/plotly/dash-core-components/issues/256)
Expand Down
67 changes: 19 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ $ npm i
2. Build the code:

```
$ npm run build-dev
$ npm run build-all
```

3. Install the library

```
$ cd dash-core-components
$ npm run copy-lib
$ python setup.py install
```

Expand All @@ -51,57 +49,34 @@ You can start up a demo development server to see a demo of the rendered
components:

```sh
$ builder run demo
$ open http://localhost:9000
$ npm start
```

You have to maintain the list of components in `demo/Demo.react.js`.

### Code quality and tests

### To run integration tests (test_integration.py)
We run our integration tests on CircleCI with help from Tox. There’s a tox.ini file which holds the configuration, refer to [tox's documentation](http://tox.readthedocs.io/en/latest/index.html) for help. You may need to set environment variables in your terminal, like `TOX_PYTHON_27` to my version of python that I wanted tox to use. So running:

```sh
export TOX_PYTHON_27=python2
```

set the `TOX_PYTHON_27` env variable to point to `python2`, which is Python 2.7 running on my machine.
You could also look in `tox.ini` and see which tests it runs, and run those commands yourself:

You can run the unit tests with the
```sh
python -m unittest test.test_integration
npm test
```
command.

### Testing your components in Dash
1. Run the build watcher by running
$ npm run build:watch

1. Build development bundle to `lib/` and watch for changes

# Once this is started, you can just leave it running.
$ npm start

2. Install module locally (after every change)

# Generate metadata, and build the JavaScript bundle
$ npm run install-local

# Now you're done. For subsequent changes, if you've got `npm start`
# running in a separate process, it's enough to just do:
$ python setup.py install

3. Run the dash layout you want to test
2. Run the dash layout you want to test

# Import dash_core_components to your layout, then run it:
$ python my_dash_layout.py

## Installing python package locally

Before publishing to PyPi, you can test installing the module locally:

```sh
# Install in `site-packages` on your machine
$ npm run install-local
```
You can run
$ python setup.py install
to install the package locally, so you can test it out in your current environment.

## Uninstalling python package locally

Expand All @@ -111,23 +86,19 @@ $ npm run uninstall-local

## Publishing

See the [Publishing New Components/Features](CONTRIBUTING.md#publishing-new-componentsfeatures) section of the Contributing guide for step-by-step instructions on publishing new components.

## Builder / Archetype

We use [Builder][] to centrally manage build configuration, dependencies, and
scripts.

To see all `builder` scripts available:
There's an npm script that will handle publish, provided you have the right credentials. You can run it by running

```sh
$ builder help
$ npm run publish-all
```

See the [dash-components-archetype][] repo for more information.
See the [Publishing New Components/Features](CONTRIBUTING.md#publishing-new-componentsfeatures) section of the Contributing guide for step-by-step instructions on publishing new components.

## Dash Component Boilerplate

See the [dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate) repo for more information.

[Builder]: https://github.com/FormidableLabs/builder
[Dash]: https://plot.ly/dash
[Dash Component Boilerplate]: (https://github.com/plotly/dash-component-boilerplate)
[NPM package authors]: https://www.npmjs.com/package/dash-core-components/access
[PyPi]: https://pypi.python.org/pypi
[dash-components-archetype]: https://github.com/plotly/dash-components-archetype
16 changes: 0 additions & 16 deletions config/webpack/infer-namespace.js

This file was deleted.

26 changes: 0 additions & 26 deletions config/webpack/partials/babel.js

This file was deleted.

31 changes: 0 additions & 31 deletions config/webpack/partials/babelHot.js

This file was deleted.

23 changes: 0 additions & 23 deletions config/webpack/partials/defineEnv.js

This file was deleted.

11 changes: 0 additions & 11 deletions config/webpack/partials/entryDev.js

This file was deleted.

15 changes: 0 additions & 15 deletions config/webpack/partials/entryHot.js

This file was deleted.

11 changes: 0 additions & 11 deletions config/webpack/partials/entryProd.js

This file was deleted.

20 changes: 0 additions & 20 deletions config/webpack/partials/optimizeProd.js

This file was deleted.

22 changes: 0 additions & 22 deletions config/webpack/partials/outputDev.js

This file was deleted.

20 changes: 0 additions & 20 deletions config/webpack/partials/outputProd.js

This file was deleted.

6 changes: 0 additions & 6 deletions config/webpack/partials/sourceMapDev.js

This file was deleted.

Loading

0 comments on commit 4d7fe82

Please sign in to comment.