Skip to content

Commit d114be8

Browse files
authored
Add build widget and frontend in docs (#110)
1 parent cd91cbc commit d114be8

File tree

5 files changed

+44
-36
lines changed

5 files changed

+44
-36
lines changed

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ To install the latest version from source, first clone the repository and then i
3939

4040
```console
4141
git clone https://github.com/superstar54/aiida-workgraph
42-
cd aiida-workgraph
43-
pip install -e .
44-
```
45-
In order to use the widget, you also need to run:
46-
```console
42+
pip install -e aiida-workgraph
43+
# build widget
4744
cd aiida_workgraph/widget/
4845
npm install
4946
npm run build
47+
# build web frontend
48+
cd ../../aiida_workgraph/web/frontend/
49+
npm install
50+
npm run build
5051
```
5152

5253
## Documentation
@@ -118,20 +119,12 @@ pip install -e .[tests, pre-commit]
118119
pre-commit install
119120
```
120121

122+
### Widget
123+
See the [README.md](https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/widget/README.md)
124+
121125
### Web app
122126
See the [README.md](https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/web/README.md)
123127

124-
### Build and publish
125-
Build package:
126-
```console
127-
pip install build
128-
python -m build
129-
```
130-
Upload to PyPI:
131-
```console
132-
pip install twine
133-
twine upload dist/*
134-
```
135128

136129
## License
137130
[MIT](http://opensource.org/licenses/MIT)

aiida_workgraph/widget/README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
11
# widget
22

3-
## Installation
4-
5-
```sh
6-
pip install widget
7-
```
8-
93
## Development installation
104

11-
Create a virtual environment and and install widget in *editable* mode with the
12-
optional development dependencies:
13-
14-
```sh
15-
python -m venv .venv
16-
source .venv/bin/activate
17-
pip install -e ".[dev]"
18-
```
19-
20-
You then need to install the JavaScript dependencies and run the development server.
5+
You need to install the JavaScript dependencies and run the development server.
216

227
```sh
238
npm install
249
npm run dev
2510
```
2611

27-
Open `example.ipynb` in JupyterLab, VS Code, or your favorite editor
12+
Then open JupyterLab, VS Code, or your favorite editor
2813
to start developing. Changes made in `js/` will be reflected
2914
in the notebook.

aiida_workgraph/widget/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "widget"
7-
version = "0.0.0"
6+
name = "node-graph-widget"
7+
version = "0.0.1"
8+
description = "Widget for node-graph"
9+
authors = [{name = "Xing Wang", email = "xingwang1991@gmail.com"}]
10+
readme = "README.md"
811
dependencies = ["anywidget"]
912
readme = "README.md"
1013

docs/source/development/index.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,28 @@ Development
44

55
This section contains information for developers.
66

7+
Pre-commit and Tests
8+
---------------------
9+
To contribute to this repository, please enable pre-commit to ensure that the code in commits conforms to the standards.
10+
11+
.. code-block:: console
12+
13+
$ pip install -e .[tests, pre-commit]
14+
$ pre-commit install
15+
16+
Widget
17+
----------------
18+
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/widget/README.md>`_.
19+
20+
Web app
21+
----------------
22+
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/web/README.md>`_.
23+
24+
25+
726
.. toctree::
827
:maxdepth: 1
9-
:caption: Contents:
28+
:caption: Other Contents:
1029

1130
data_serialization
1231
python_task

docs/source/installation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ To install the package from source, first clone the repository and then install
3535
3636
$ git clone https://github.com/superstar54/aiida-workgraph
3737
$ pip install -e aiida-workgraph
38+
$ # build widget
39+
$ cd aiida_workgraph/widget/
40+
$ npm install
41+
$ npm run build
42+
$ # build web frontend
43+
$ cd ../../aiida_workgraph/web/frontend/
44+
$ npm install
45+
$ npm run build
3846
3947
The ``-e`` flag will install the package in editable mode, meaning that changes to the source code will be automatically picked up.
4048

0 commit comments

Comments
 (0)