Skip to content

Commit 1c5731f

Browse files
Merge pull request #96 from Digital-Alchemy-TS/dev
Dev -> Main
2 parents 57fec6c + 2b4745b commit 1c5731f

419 files changed

Lines changed: 18274 additions & 13157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

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

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ root = true
33

44
[*]
55
charset = utf-8
6+
end_of_line = lf
67
indent_style = space
78
indent_size = 2
89
insert_final_newline = true

.github/workflows/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# GitHub Actions Workflows
2+
3+
## Build Home Assistant Addon
4+
5+
The `docker-build.yml` workflow automatically builds and publishes multi-architecture Docker images for the Code Glue Home Assistant addon.
6+
7+
### Triggers
8+
9+
- **Push to `main` branch**: Builds and publishes as `:latest` tag
10+
- **Push to `dev` branch**: Builds and publishes as `:dev` tag with modified config
11+
- **Tag push (`v*`)**: Builds and publishes versioned releases
12+
- **Manual trigger**: Via workflow_dispatch
13+
14+
### What it does
15+
16+
1. **Main branch builds**:
17+
- Uses `config.yaml` as-is
18+
- Publishes to `ghcr.io/digital-alchemy-ts/code-glue:latest`
19+
- Suitable for production Home Assistant installations
20+
21+
2. **Dev branch builds**:
22+
- Automatically modifies `config.yaml` during build to:
23+
- Change name to "Code Glue (Dev)"
24+
- Set slug to `code_glue_dev` (allows side-by-side installation with production)
25+
- Set version to "dev"
26+
- Change icon to outline variant
27+
- Update port to 3790
28+
- Point image to `:dev` tag
29+
- Publishes to `ghcr.io/digital-alchemy-ts/code-glue:dev`
30+
- Can be installed alongside the production addon
31+
32+
3. **Multi-architecture support**:
33+
- Builds for: `linux/amd64`, `linux/arm64`, `linux/arm/v7`
34+
- Covers all Home Assistant supported architectures
35+
36+
### Installing the Addon
37+
38+
#### Production Version (from `main` branch)
39+
1. Add repository to Home Assistant: `https://github.com/Digital-Alchemy-TS/code-glue`
40+
2. Install "Code Glue" addon
41+
3. Home Assistant will pull the `:latest` image
42+
43+
#### Development Version (from `dev` branch)
44+
1. Add repository to Home Assistant: `https://github.com/Digital-Alchemy-TS/code-glue`
45+
2. Install "Code Glue (Dev)" addon
46+
3. Home Assistant will pull the `:dev` image
47+
4. Uses separate slug `code_glue_dev` - can run alongside production
48+
49+
### Development Workflow
50+
51+
Since the workflow handles config modifications automatically, you don't need to maintain separate config files:
52+
53+
1. Make changes on your branch
54+
2. Merge to `dev` for testing → workflow builds `:dev` image
55+
3. Test in Home Assistant with the dev addon
56+
4. Merge to `main` for release → workflow builds `:latest` image

.github/workflows/check.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,23 @@ name: Pull Request Checks
33
on:
44
pull_request:
55
branches:
6-
- stage
7-
- prod
8-
- develop
9-
push:
10-
branches:
11-
- stage
12-
- prod
13-
- develop
6+
- dev
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
1412
jobs:
1513
lint-and-build:
1614
runs-on: ubuntu-latest
1715
steps:
1816
- uses: actions/checkout@v4
1917
- uses: actions/setup-node@v4
2018
with:
21-
node-version: '22'
19+
node-version: "22"
20+
cache: "yarn"
2221
- run: corepack enable
2322
- run: yarn config set enableImmutableInstalls false
2423
- run: yarn install
25-
- run: yarn server:build
26-
- run: yarn server:lint
27-
- run: yarn server:test
28-
# - name: Upload coverage reports to Codecov
29-
# uses: codecov/codecov-action@v4.6.0
30-
# with:
31-
# token: ${{ secrets.CODECOV_TOKEN }}
32-
- run: yarn client:lint
24+
- run: yarn lint
25+
- run: yarn test

.github/workflows/docker-build.yml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: Build and Push Docker Image
1+
name: Build Home Assistant Addon
22

33
on:
44
push:
55
branches:
66
- main
7+
- dev
78
tags:
89
- "v*"
910
workflow_dispatch:
1011

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1116
env:
1217
REGISTRY: ghcr.io
1318
IMAGE_NAME: ${{ github.repository }}
@@ -25,23 +30,6 @@ jobs:
2530
with:
2631
submodules: recursive
2732

28-
- name: Set up Node.js
29-
uses: actions/setup-node@v4
30-
with:
31-
node-version: "22"
32-
33-
- name: Enable Corepack
34-
run: corepack enable
35-
36-
- name: Configure Yarn
37-
run: yarn config set enableImmutableInstalls false
38-
39-
- name: Install dependencies
40-
run: yarn install
41-
42-
- name: Build client and server
43-
run: yarn build
44-
4533
- name: Set up QEMU
4634
uses: docker/setup-qemu-action@v3
4735

@@ -55,25 +43,31 @@ jobs:
5543
username: ${{ github.actor }}
5644
password: ${{ secrets.GITHUB_TOKEN }}
5745

58-
- name: Extract metadata (tags, labels)
59-
id: meta
60-
uses: docker/metadata-action@v5
61-
with:
62-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
63-
tags: |
64-
type=ref,event=branch
65-
type=semver,pattern={{version}}
66-
type=semver,pattern={{major}}.{{minor}}
67-
type=semver,pattern={{major}}
68-
type=sha
46+
- name: Determine Docker tags
47+
id: tags
48+
run: |
49+
# Convert repository name to lowercase for Docker
50+
IMAGE_NAME_LOWER=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
51+
52+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
53+
echo "tags=${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:latest" >> $GITHUB_OUTPUT
54+
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
55+
echo "tags=${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:dev" >> $GITHUB_OUTPUT
56+
elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
57+
VERSION=${GITHUB_REF#refs/tags/v}
58+
echo "tags=${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:${VERSION},${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:latest" >> $GITHUB_OUTPUT
59+
else
60+
echo "tags=${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:${{ github.sha }}" >> $GITHUB_OUTPUT
61+
fi
6962
7063
- name: Build and push Docker image
7164
uses: docker/build-push-action@v5
7265
with:
7366
context: .
74-
platforms: linux/amd64,linux/arm64,linux/arm/v7
67+
platforms: linux/amd64,linux/arm64
7568
push: true
76-
tags: ${{ steps.meta.outputs.tags }}
77-
labels: ${{ steps.meta.outputs.labels }}
78-
cache-from: type=gha
69+
tags: ${{ steps.tags.outputs.tags }}
70+
cache-from: |
71+
type=gha
72+
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:buildcache
7973
cache-to: type=gha,mode=max

.gitignore

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
1-
.expo/
2-
/dist
3-
/build
4-
/tmp
5-
/backup
6-
/out-tsc
7-
**/node_modules
8-
npm-debug.log
9-
yarn-error.log
10-
.ds_store
11-
apps/server/cache
12-
thumbs.db
13-
.yarn/
1+
# Node/Yarn
2+
node_modules/
3+
.yarn/*
4+
!.yarn/patches
5+
!.yarn/plugins
6+
!.yarn/releases
7+
!.yarn/sdks
8+
!.yarn/versions
9+
10+
# Builds & caches
11+
dist/
12+
build/
13+
coverage/
14+
*.tsbuildinfo
15+
out-tsc/
16+
.eslintcache
17+
18+
# Vite/others
19+
.vite/
20+
tmp/
21+
temp/
22+
backup/
1423
.transform_cache
24+
25+
# Project specific
26+
apps/server/cache/
27+
**/synapse_storage.db
28+
tagui-web.css
29+
.tamagui
1530
.schemas
16-
.env
17-
.code_glue
1831
.cli
1932
.VSCodeCounter
20-
coverage
2133

22-
**/synapse_storage.db
34+
# Environment & secrets
35+
.env
36+
.env.*
37+
!.env.example
38+
.code_glue
2339

24-
tamagui-web.css
25-
.tamagui
40+
# Logs
41+
npm-debug.log*
42+
yarn-error.log*
43+
yarn-debug.log*
44+
45+
# VSCode
46+
.vscode/*
47+
!.vscode/extensions.json
48+
!.vscode/settings.json
49+
!.vscode/launch.json
50+
!.vscode/tasks.json
2651

2752
# macOS
2853
.DS_Store
29-
/.eslintcache
30-
apps/server/cache/
31-
/apps/client/dist
54+
.ds_store
55+
thumbs.db
56+
57+
*storybook.log
58+
storybook-static

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "packages/paradigm"]
2-
path = packages/paradigm
3-
url = https://github.com/tiltshift/paradigm.git

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"biomejs.biome",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode",
6+
"editorconfig.editorconfig"
7+
]
8+
}

.vscode/settings.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"explorer.fileNesting.enabled": true,
33
"explorer.fileNesting.patterns": {
4-
"package.json": "package-lock.json, yarn.lock, .yarnrc.yml",
4+
"package.json": "package-lock.json, yarn.lock, .yarnrc.yml, cspell.config.yaml, .yarnrc.yml",
55
"*.js": "${capture}.js.map, ${capture}.d.ts, ${capture}.d.ts.map",
6-
"*.ts": "$(capture).test.ts, $(capture).test.tsx, $(capture).test.node.ts, $(capture).test.node.tsx, $(capture).test.native.ts, $(capture).test.native.tsx, $(capture).test.ios.ts, $(capture).test.ios.tsx, $(capture).test.web.ts, $(capture).test.web.tsx, $(capture).test.android.ts, $(capture).test.android.tsx, ${capture}.native.tsx, ${capture}.ios.tsx, ${capture}.android.tsx, ${capture}.web.tsx, ${capture}.native.ts, ${capture}.ios.ts, ${capture}.android.ts, ${capture}.web.ts, ${capture}.native.js, ${capture}.ios.js, ${capture}.android.js, ${capture}.web.js, ${capture}.native.jsx, ${capture}.ios.jsx, ${capture}.android.jsx, ${capture}.web.jsx, ${capture}.stories.tsx, ${capture}.stories.ts, ${capture}.stories.jsx, ${capture}.stories.js",
6+
"*.ts": "$(capture).test.ts, $(capture).test.tsx, $(capture).test.node.ts, $(capture).test.node.tsx, $(capture).test.native.ts, $(capture).test.native.tsx, $(capture).test.ios.ts, $(capture).test.ios.tsx, $(capture).test.web.ts, $(capture).test.web.tsx, $(capture).test.android.ts, $(capture).test.android.tsx, ${capture}.native.tsx, ${capture}.ios.tsx, ${capture}.android.tsx, ${capture}.web.tsx, ${capture}.native.ts, ${capture}.ios.ts, ${capture}.android.ts, ${capture}.web.ts, ${capture}.native.js, ${capture}.ios.js, ${capture}.android.js, ${capture}.web.js, ${capture}.native.jsx, ${capture}.ios.jsx, ${capture}.android.jsx, ${capture}.web.jsx, ${capture}.stories.tsx, ${capture}.story.tsx, ${capture}.stories.ts, ${capture}.stories.jsx, ${capture}.stories.js",
77
"*.tsx": "$(capture).test.ts, $(capture).test.tsx, $(capture).test.node.ts, $(capture).test.node.tsx, $(capture).test.native.ts, $(capture).test.native.tsx, $(capture).test.ios.ts, $(capture).test.ios.tsx, $(capture).test.web.ts, $(capture).test.web.tsx, $(capture).test.android.ts, $(capture).test.android.tsx, ${capture}.native.tsx, ${capture}.ios.tsx, ${capture}.android.tsx, ${capture}.web.tsx, ${capture}.native.ts, ${capture}.ios.ts, ${capture}.android.ts, ${capture}.web.ts, ${capture}.native.js, ${capture}.ios.js, ${capture}.android.js, ${capture}.web.js, ${capture}.native.jsx, ${capture}.ios.jsx, ${capture}.android.jsx, ${capture}.web.jsx, ${capture}.stories.tsx, ${capture}.stories.ts, ${capture}.stories.jsx, ${capture}.stories.js"
88
},
9-
"typescript.tsdk": "node_modules/typescript/lib"
9+
"typescript.tsdk": "node_modules/typescript/lib",
10+
"eslint.workingDirectories": [
11+
"apps/server"
12+
],
13+
"biome.requireConfiguration": true
1014
}

0 commit comments

Comments
 (0)