Skip to content

Commit ee18033

Browse files
authored
Ensure that the dashboard build is included in the py wheel (#596)
1 parent 44679f2 commit ee18033

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

.github/workflows/release.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ jobs:
5757
tomli_w.dump(pyproject, f)
5858
- name: Build dashboard
5959
run: |
60-
cd dashboard
61-
script/setup
62-
script/build
63-
cd ..
60+
dashboard/script/setup
61+
dashboard/script/build
6462
- name: Build python package
6563
run: >-
6664
python3 -m build

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,6 @@ venv39/
168168

169169
# ruff
170170
.ruff_cache/
171+
172+
# prebuilt dashboard files
173+
matter_server/dashboard/

dashboard/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ The production build is generated when you run
3030
script/build
3131
```
3232

33-
The folder `dist/web` will contain the build that can be served by any web browser.
33+
The production build is generated into the matter_server folder, to be picked up by
34+
the webserver of the python matter server.

dashboard/script/build

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -e
66
cd "$(dirname "$0")/.."
77

88
rm -rf dist
9+
rm -rf ../matter_server/dashboard
910
NODE_ENV=production npm exec -- tsc
1011
NODE_ENV=production npm exec -- rollup -c
1112
cp -r public/* dist/web
13+
mv dist/web ../matter_server/dashboard

matter_server/server/server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from .storage import StorageController
3535
from .vendor_info import VendorInfo
3636

37-
DASHBOARD_DIR = Path(__file__).parent.joinpath("../../dashboard/dist/web/").resolve()
37+
DASHBOARD_DIR = Path(__file__).parent.joinpath("../dashboard/").resolve()
3838
DASHBOARD_DIR_EXISTS = DASHBOARD_DIR.exists()
3939

4040

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ platforms = ["any"]
6767
zip-safe = false
6868

6969
[tool.setuptools.package-data]
70-
matter_server = ["py.typed"]
70+
matter_server = ["py.typed", "dashboard/**"]
7171

7272
[tool.setuptools.packages.find]
73-
include = ["matter_server*", "dashboard/dist/web*"]
73+
include = ["matter_server*"]
7474

7575
[tool.mypy]
7676
check_untyped_defs = true

0 commit comments

Comments
 (0)