Skip to content

Commit

Permalink
Remove copy step from postinstall (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Jul 9, 2021
1 parent 327dce0 commit 7974b84
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/webviz-subsurface-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
run: |
npm ci --ignore-scripts --prefix ./react
npm run postinstall --prefix ./react
npm run copy-package-json --prefix ./react
pip install .[dependencies]
pip install dash[dev]
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![PyPI version](https://badge.fury.io/py/webviz-subsurface-components.svg)](https://badge.fury.io/py/webviz-subsurface-components)
[![npm version](https://badge.fury.io/js/%40webviz%2Fsubsurface-components.svg)](https://badge.fury.io/js/%40webviz%2Fsubsurface-components)
[![Build Status](https://github.com/equinor/webviz-subsurface-components/workflows/webviz-subsurface-components/badge.svg)](https://github.com/equinor/webviz-subsurface-components/actions?query=branch%3Amaster)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/equinor/webviz-subsurface-components.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/webviz-subsurface-components/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/equinor/webviz-subsurface-components.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/webviz-subsurface-components/context:javascript)
Expand All @@ -25,6 +26,11 @@ This project was originally generated by the
[dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate).
(with some modifications).

If you are only interested in using the JavaScript code in your own JavaScript project,
you can install the [`npmjs` deployed version](https://www.npmjs.com/package/@webviz/subsurface-components):
```
npm i @webviz/subsurface-components
```
## How to contribute

### Install dependencies
Expand All @@ -34,11 +40,12 @@ then:

1. Install npm packages
```
npm ci --ignore-scripts
npm ci --ignore-scripts --prefix ./react
```
2. Run the project's own `postinstall` script
2. Run the project's own `postinstall` script (and optionally Dash component pre-script)
```
npm run postinstall
npm run postinstall --prefix ./react
npm run copy-package-json --prefix ./react # only needed if building Dash components
```
3. Install python packages required to build components.
```
Expand All @@ -60,7 +67,7 @@ then:
- To test your code in a Python environment:
1. Build your code
```
npm run build:all
npm run build:all --prefix ./react
```
2. Install the Python pacakge in development mode (if not already done and
assuming you are using a virtual environment):
Expand Down
5 changes: 3 additions & 2 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"main": "build/index.js",
"scripts": {
"start": "webpack serve --mode development --devtool inline-source-map --entry ./src/demo/index.js --open",
"postinstall": "copyfiles ./package.json ../webviz_subsurface_components/ && npm run setup_deckgl_types",
"postinstall": "npm run setup_deckgl_types",
"copy-package-json": "copyfiles ./package.json ../webviz_subsurface_components/",
"build:js": "webpack --mode production",
"build:js-dev": "webpack --mode development",
"build:js-demo": "webpack --mode production --entry ./src/demo/index.js",
Expand All @@ -28,7 +29,7 @@
"test": "jest",
"test:watch": "npm test -- --watch"
},
"author": "R&T Equinor <akia@equinor.com>",
"author": "Equinor <opensource@equinor.com>",
"license": "MPL",
"dependencies": {
"@danmarshall/deckgl-typings": "^4.9.0",
Expand Down

0 comments on commit 7974b84

Please sign in to comment.