Skip to content

Commit 73cef0a

Browse files
committed
refactored code from lorabridge/bridge-device-interface for svelte 5 (with svelte 4 syntax in compat mode)
0 parents  commit 73cef0a

36 files changed

+8255
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
schedule:
9+
- cron: '0 0 * * SUN'
10+
workflow_dispatch:
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
15+
jobs:
16+
build-and-push-image:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3.3.0
25+
26+
- name: Log in to the Container registry
27+
uses: docker/login-action@v2.1.0
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Docker Setup QEMU
34+
uses: docker/setup-qemu-action@v2.1.0
35+
36+
- name: Docker Setup Buildx
37+
uses: docker/setup-buildx-action@v2.2.1
38+
39+
- name: Build and push bridge-device-interface
40+
uses: docker/build-push-action@v3.3.0
41+
with:
42+
context: .
43+
push: true
44+
platforms: linux/arm64,linux/arm/v7
45+
tags: |
46+
${{ env.REGISTRY }}/lorabridge2/bridge-device-interface:latest
47+
cache-from: type=registry,ref=${{ env.REGISTRY }}/lorabridge2/bridge-device-interface:latest
48+
cache-to: type=inline

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM node:18-alpine AS build
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY package.json package-lock.json ./
6+
7+
RUN npm install
8+
#RUN npm audit fix
9+
10+
COPY . .
11+
12+
ENV NODE_ENV=production
13+
#ARG VITE_SSE_ADDR
14+
ENV VITE_REDIS_CONN_STRING=redis://redis:6379
15+
ENV VITE_MQTT_HOST=mqtt
16+
ENV VITE_MQTT_PORT=1883
17+
# ARG VITE_CMS_SSL=false
18+
# ENV VITE_CMS_HOST=${VITE_CMS_HOST}
19+
RUN npm run build
20+
21+
FROM node:18-alpine
22+
23+
WORKDIR /usr/src/app
24+
25+
COPY --from=build /usr/src/app/build ./
26+
27+
# RUN echo '{"type": "module"}' > package.json
28+
COPY package.json package-lock.json ./
29+
RUN npm i redis async-mqtt
30+
#RUN npm audit fix
31+
32+
USER 1337:1337
33+
ENV NODE_ENV=production
34+
ENV VITE_SSE_ADDR=http://sse:8080
35+
ENTRYPOINT [ "node", "/usr/src/app/index.js" ]

0 commit comments

Comments
 (0)