Skip to content

Commit 9aece32

Browse files
committed
Use Task and Bun workspaces instead of nx
1 parent e4e7d3a commit 9aece32

37 files changed

+97
-17080
lines changed

.github/workflows/master.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ jobs:
1818
- configurator
1919
- gatherer-http
2020
- gatherer-stdin
21-
- listener
2221
- publisher
23-
node-version: [20]
2422

2523
steps:
2624
- uses: actions/checkout@v4
2725
- uses: arduino/setup-task@v2
2826
with:
29-
version: 2.x
27+
version: 3.38.0
3028
- uses: oven-sh/setup-bun@v1
3129
with:
3230
bun-version: 1.1.20

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Thumbs.db
4141
# Bun
4242
node_modules.bun
4343

44-
# Nx
44+
# Tasks
4545
.env.local
4646

4747
*-secret.yaml

Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:lts-alpine AS buildtime
22
WORKDIR /app
3-
COPY package*.json nx.json /app/
3+
COPY package.json bun.lockb /app/
44

55
# Add any node packages
66
COPY packages/archive/*.json /app/packages/archive/
@@ -10,8 +10,8 @@ COPY packages/common-archive-client/*.json /app/packages/common-archive-client/
1010
COPY packages/common-data/*.json /app/packages/common-data/
1111
COPY packages/common-postgres/*.json /app/packages/common-postgres/
1212

13-
# Install dev deps for buildtime
14-
RUN npm ci
13+
# Remove dev deps for runtime
14+
RUN bun install --frozen-lockfile --production
1515

1616
# Copy source code
1717
COPY packages/archive /app/packages/archive/
@@ -21,14 +21,4 @@ COPY packages/common-archive-client /app/packages/common-archive-client/
2121
COPY packages/common-data /app/packages/common-data/
2222
COPY packages/common-postgres /app/packages/common-postgres/
2323

24-
# Build any node packages
25-
RUN npx nx run-many --target=node:build --all
26-
27-
# Clean slate for runtime
28-
FROM node:lts-alpine AS runtime
2924
WORKDIR /app
30-
COPY --link --from=buildtime /app/package*.json /app/nx.json /app/
31-
COPY --link --from=buildtime /app/packages /app/packages
32-
33-
# Remove dev deps for runtime
34-
RUN npm ci --omit=dev

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Following shiny tools are used
1515

1616
- [Redis Streams](https://redis.io/docs/data-types/streams/) for durable processing of measurements
1717
- [TimescaleDb](https://www.timescale.com/) for SQL based long term storage of time series data
18-
- [Nx (package based)](https://nx.dev) for monorepo organization and task running
18+
- [Task](https://taskfile.dev/) for task running
19+
- [Bun workspaces](https://bun.sh/docs/install/workspaces) for monorepo organization
1920
- [Bun](https://bun.sh) TypeScript runtime for faster microservices (where necessary APIs are supported)
2021
- [tRPC](https://trpc.io/) type-safe API for exposing database to serverless functions and apps
2122
- [ruuvitag-listener](https://github.com/lautis/ruuvitag-listener) fast readings from Ruuvitag devices, written in Rust
@@ -28,27 +29,28 @@ Following shiny tools are used
2829
Ensure you have installed following tools in your gateway box (e.g. raspberry pi).
2930

3031
- [Rust](https://rustup.rs/)
31-
- [Node](https://nodejs.org/en/download/)
32+
- [Bun](https://bun.sh/)
3233
- [Redis](https://redis.io/docs/getting-started/installation/install-redis-on-linux/)
3334

3435
Install monorepo dependencies
3536

3637
```
37-
npm install
38+
bun install
3839
```
3940

4041
Run package specific setup scripts
4142

4243
```
43-
npm run setup
44+
task common-data:setup
45+
task infra-redis:setup
4446
```
4547

4648
### Running
4749

4850
Run gateway functionality in gateway box
4951

5052
```
51-
npm run start-gateway
53+
task start-gateway
5254
```
5355

5456
## Architecture

bun.lockb

496 KB
Binary file not shown.

nx.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)