Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-

# - name: Run tests
# working-directory: packages/web
# run: deno task test
- name: Run tests
run: pnpm run test

- name: Install Dependencies
working-directory: packages/web
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Check formatter
run: pnpm run check

- name: Run tests
run: pnpm run test

- name: Build Package
working-directory: packages/web
run: pnpm run build
43 changes: 24 additions & 19 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,31 @@ jobs:
- name: Publish packages to npm and JSR
run: |
for dir in packages/*; do
echo "Processing $dir"

cd $dir

# Build and publish to npm if package.json exists
if [ -f "package.json" ]; then
echo "Building and publishing $dir to npm..."
pnpm run build:npm
pnpm run publish:npm || echo "npm publish failed for $dir"
fi

pnpm run prepare:jsr

# Publish to JSR if jsr.json exists
if [ -f "jsr.json" ]; then
echo "Publishing $dir to jsr..."
deno publish || echo "JSR publish failed for $dir"
if [ "$dir" != "packages/web" ]; then
echo "Processing $dir"

cd $dir

# Build and publish to npm if package.json exists
if [ -f "package.json" ]; then
echo "Building and publishing $dir to npm..."
pnpm install
pnpm run build:npm
pnpm run publish:npm || echo "npm publish failed for $dir"
fi

pnpm run prepare:jsr

# Publish to JSR if jsr.json exists
if [ -f "jsr.json" ]; then
echo "Publishing $dir to jsr..."
deno publish || echo "JSR publish failed for $dir"
fi

cd - > /dev/null
else
echo "Skipping $dir"
fi

cd - > /dev/null
done


29 changes: 17 additions & 12 deletions .github/workflows/release-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,36 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4

# --- Setup Node.js and pnpm ---
- name: Setup Node.js
uses: actions/setup-node@v4
with:
fetch-depth: 0
node-version: 22

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
bun-version: latest
version: latest

- name: Cache Bun Dependencies
# --- Cache pnpm Dependencies ---
- name: Cache pnpm Dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
~/.pnpm-store
packages/web/node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-bun-
${{ runner.os }}-pnpm-

- name: Run Web App Tests
- name: Install dependencies
working-directory: packages/web
run: bun run test
run: pnpm install

- name: Create Web App Release Archive
working-directory: packages/web
run: bun run package
run: pnpm run package

- name: Upload Web App Archive
uses: actions/upload-artifact@v4
Expand All @@ -59,7 +64,7 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
./infra/Containerfile
./packages/web/infra/Containerfile
image: ghcr.io/${{ github.repository }}
tags: latest, ${{ github.event.release.tag_name }}
oci: true
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"check:fix": "biome check --write",
"build:all": "pnpm run --filter '*' build",
"clean:all": "pnpm run --filter '*' clean",
"publish:packages": "pnpm run --filter 'packages/transport-* packages/core' build"
"publish:packages": "pnpm run --filter 'packages/transport-* packages/core' build",
"test": "vitest"
},
"dependencies": {
"@bufbuild/protobuf": "^2.6.1",
Expand All @@ -37,6 +38,7 @@
"@types/node": "^22.16.4",
"biome": "^0.3.3",
"tsdown": "^0.13.4",
"typescript": "^5.8.3"
"typescript": "^5.8.3",
"vitest": "^3.2.4"
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": "./dist/mod.d.mts",
"license": "GPL-3.0-only",
"tsdown": {
"entry": ["mod.ts"],
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
Expand Down
10 changes: 10 additions & 0 deletions packages/transport-deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"types": "./dist/mod.d.mts",
"files": ["dist/*", "mod.ts", "README.md", "../../LICENSE"],
"license": "GPL-3.0-only",
"tsdown": {
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
"clean": true
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"prepack": "cp ../../LICENSE ./LICENSE",
Expand All @@ -18,5 +25,8 @@
"publish:npm": "pnpm clean && pnpm build:npm && pnpm publish --access public",
"prepare:jsr": "rm -rf dist && pnpm dlx pkg-to-jsr",
"publish:jsr": "pnpm run prepack && pnpm prepare:jsr && deno publish --allow-dirty --no-check"
},
"dependencies": {
"@meshtastic/core": "workspace:*"
}
}
5 changes: 4 additions & 1 deletion packages/transport-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"types": "./dist/mod.d.mts",
"license": "GPL-3.0-only",
"tsdown": {
"entry": ["mod.ts"],
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
Expand All @@ -28,5 +28,8 @@
"publish:npm": "pnpm clean && pnpm build:npm && pnpm publish --access public",
"prepare:jsr": "rm -rf dist && pnpm dlx pkg-to-jsr",
"publish:jsr": "pnpm run prepack && pnpm prepare:jsr && deno publish --allow-dirty --no-check"
},
"dependencies": {
"@meshtastic/core": "workspace:*"
}
}
5 changes: 4 additions & 1 deletion packages/transport-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

"license": "GPL-3.0-only",
"tsdown": {
"entry": ["mod.ts"],
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
Expand All @@ -31,5 +31,8 @@
"publish:npm": "pnpm clean && pnpm build:npm && pnpm publish --access public",
"prepare:jsr": "rm -rf dist && pnpm dlx pkg-to-jsr",
"publish:jsr": "pnpm run prepack && pnpm prepare:jsr && deno publish --allow-dirty --no-check"
},
"dependencies": {
"@meshtastic/core": "workspace:*"
}
}
20 changes: 10 additions & 10 deletions packages/transport-web-bluetooth/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@meshtastic/transport-web-bluetooth",
"version": "0.1.4",
"description": "A transport layer for Meshtastic applications using Web Bluetooth.",
"exports": {
".": "./mod.ts"
},
"version": "0.1.4",
"description": "A transport layer for Meshtastic applications using Web Bluetooth.",
"exports": {
".": "./mod.ts"
},
"main": "./dist/mod.mjs",
"module": "./dist/mod.mjs",
"types": "./dist/mod.d.mts",
"files": ["dist/*", "mod.ts", "README.md", "../../LICENSE"],
"license": "GPL-3.0-only",
"tsdown": {
"entry": ["mod.ts"],
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
Expand All @@ -26,8 +26,8 @@
"prepare:jsr": "rm -rf dist && pnpm dlx pkg-to-jsr",
"publish:jsr": "pnpm run prepack && pnpm prepare:jsr && deno publish --allow-dirty --no-check"
},
"dependencies": {
"@types/web-bluetooth": "npm:@types/web-bluetooth@^0.0.20"
}

"dependencies": {
"@types/web-bluetooth": "npm:@types/web-bluetooth@^0.0.20",
"@meshtastic/core": "workspace:*"
}
}
5 changes: 3 additions & 2 deletions packages/transport-web-serial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files": ["dist/*", "mod.ts", "README.md", "../../LICENSE"],
"license": "GPL-3.0-only",
"tsdown": {
"entry": ["mod.ts"],
"entry": "mod.ts",
"dts": true,
"format": ["esm"],
"splitting": false,
Expand All @@ -27,6 +27,7 @@
"publish:jsr": "pnpm run prepack && pnpm prepare:jsr && deno publish --allow-dirty --no-check"
},
"dependencies": {
"@types/w3c-web-serial": "npm:@types/w3c-web-serial@^1.0.7"
"@types/w3c-web-serial": "npm:@types/w3c-web-serial@^1.0.7",
"@meshtastic/core": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions packages/web/infra/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM nginx:1.27-alpine

RUN rm -r /usr/share/nginx/html \
&& mkdir -p /usr/share/nginx/html \
&& mkdir -p /etc/nginx/conf.d
&& mkdir -p /usr/share/nginx/html \
&& mkdir -p /etc/nginx/conf.d

WORKDIR /usr/share/nginx/html

ADD dist .
ADD ./dist .

COPY ./infra/default.conf /etc/nginx/conf.d/default.conf

Expand Down
6 changes: 3 additions & 3 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@bufbuild/protobuf": "^2.6.0",
"@hookform/resolvers": "^5.1.1",
"@meshtastic/core": "workspace:*",
"@meshtastic/transport-http": "npm:@jsr/meshtastic__transport-http",
"@meshtastic/transport-web-bluetooth": "npm:@jsr/meshtastic__transport-web-bluetooth",
"@meshtastic/transport-web-serial": "npm:@jsr/meshtastic__transport-web-serial",
"@meshtastic/transport-http": "workspace:*",
"@meshtastic/transport-web-bluetooth": "workspace:*",
"@meshtastic/transport-web-serial": "workspace:*",
"@noble/curves": "^1.9.2",
"@radix-ui/react-accordion": "^1.2.11",
"@radix-ui/react-checkbox": "^1.3.2",
Expand Down
24 changes: 13 additions & 11 deletions packages/web/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import path from "node:path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";

import process from "node:process";
import react from "@vitejs/plugin-react";
import { enableMapSet } from "immer";
import { defineProject } from "vitest/config";

enableMapSet();
export default defineConfig({
export default defineProject({
plugins: [react()],
resolve: {
alias: {
"@app": path.resolve(process.cwd(), "./src"),
"@public": path.resolve(process.cwd(), "./public"),
"@core": path.resolve(process.cwd(), "./src/core"),
"@pages": path.resolve(process.cwd(), "./src/pages"),
"@components": path.resolve(process.cwd(), "./src/components"),
"@layouts": path.resolve(process.cwd(), "./src/layouts"),
"@app": path.resolve(process.cwd(), "./packages/web/src"),
"@public": path.resolve(process.cwd(), "./packages/web/public"),
"@core": path.resolve(process.cwd(), "./packages/web/src/core"),
"@pages": path.resolve(process.cwd(), "./packages/web/src/pages"),
"@components": path.resolve(
process.cwd(),
"./packages/web/src/components",
),
"@layouts": path.resolve(process.cwd(), "./packages/web/src/layouts"),
},
},
test: {
Expand All @@ -24,7 +26,7 @@ export default defineConfig({
mockReset: true,
clearMocks: true,
restoreMocks: true,
root: path.resolve(process.cwd(), "./src"),
root: path.resolve(process.cwd(), "./packages/web/src"),
include: ["**/*.{test,spec}.{ts,tsx}"],
setupFiles: ["./src/tests/setup.ts"],
},
Expand Down
Loading