Skip to content

Commit e5677b7

Browse files
committed
Introduce frontend build system using npm, Parcel and TypeScript
The`dashboard` page is ported to the new frontend.
1 parent a5b0163 commit e5677b7

File tree

12 files changed

+3567
-14
lines changed

12 files changed

+3567
-14
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
!/database
33
!/intern
44
!/site
5+
/site/frontend/node_modules
56
!/collector
67
!/Cargo.toml
78
!/Cargo.lock

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ RUN apt-get update -y && \
1616
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
1717
--default-toolchain stable --profile minimal -y
1818

19+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
20+
apt-get install -y nodejs
21+
1922
COPY ./Cargo.lock ./Cargo.lock
2023
COPY ./Cargo.toml ./Cargo.toml
21-
COPY ./site ./site
2224
COPY ./collector ./collector
2325
COPY ./database ./database
2426
COPY ./intern ./intern
27+
COPY ./site ./site
28+
29+
RUN cd site/frontend && npm ci
30+
RUN cd site/frontend && npm run check
31+
RUN cd site/frontend && npm run build
2532

2633
RUN bash -c 'source $HOME/.cargo/env && cargo build --release -p site'
2734
RUN bash -c 'source $HOME/.cargo/env && cargo build --release --bin postgres-to-sqlite'

site/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/data
22
/target
3+
frontend/node_modules
4+
frontend/dist/**/

site/frontend/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# `rustc-perf` site frontend
2+
This directory contains code for the `rustc-perf` website frontend.
3+
4+
## Build
5+
- Install dependencies
6+
```console
7+
$ npm install
8+
```
9+
- Development build - dynamically reloads after each change.
10+
```console
11+
$ npm run watch
12+
```
13+
- Production build - build optimized and minimized files.
14+
```console
15+
$ npm run build
16+
```
17+
18+
The files are packaged into the `dist` directory, from which they are embedded into the `rustc-perf`
19+
binary.

site/frontend/dist/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)