Compare commits

..
2 Commits
Author SHA1 Message Date
Gabriel20xx 5f13c2d347 Rename shared snapshot directory
Docker / Docker Build & Push (push) Failing after 56s
Lint / Lint (push) Successful in 13s
Tests / Go backend (push) Successful in 15s
Tests / Dashboard checks (push) Successful in 17s
2026-08-06 16:55:37 +02:00
Gabriel20xx 06efc832ca Sync shared snapshot from df68167 2026-08-06 16:53:48 +02:00
83 changed files with 47 additions and 30 deletions

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ on:
branches:
- "**"
paths:
- 'SharedCode/**'
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
@@ -15,7 +15,7 @@ on:
- main
- master
paths:
- 'SharedCode/**'
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
+1 -1
View File
@@ -7,7 +7,7 @@ require (
github.com/joho/godotenv v1.5.1
)
replace repos.gfranz.ch/Gabriel20xx/shared/backend => ../SharedCode/backend
replace repos.gfranz.ch/Gabriel20xx/shared/backend => ../shared/backend
require golang.org/x/crypto v0.54.0 // indirect
+2 -2
View File
@@ -1,7 +1,7 @@
FROM node:22-alpine AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
COPY SharedCode/packages/web-ui /SharedCode/packages/web-ui
COPY shared/packages/web-ui /shared/packages/web-ui
RUN --mount=type=cache,target=/root/.npm \
for attempt in 1 2 3 4 5; do \
npm ci && break; \
@@ -16,7 +16,7 @@ RUN npm run build
FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY backend/go.mod backend/go.sum ./
COPY SharedCode/backend/ /SharedCode/backend/
COPY shared/backend/ /shared/backend/
RUN go mod download
COPY backend/*.go ./
COPY --from=frontend-builder /frontend/build ./web
+3 -3
View File
@@ -8,7 +8,7 @@
"name": "collabtable-server-frontend",
"version": "1.0.0",
"dependencies": {
"@gabriel20xx/web-ui": "file:../SharedCode/packages/web-ui",
"@gabriel20xx/web-ui": "file:../shared/packages/web-ui",
"@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest",
"bits-ui": "latest",
@@ -34,7 +34,7 @@
"vite": "latest"
}
},
"../SharedCode/packages/web-ui": {
"../shared/packages/web-ui": {
"name": "@gabriel20xx/web-ui",
"version": "0.1.1",
"license": "MIT",
@@ -234,7 +234,7 @@
"license": "MIT"
},
"node_modules/@gabriel20xx/web-ui": {
"resolved": "../SharedCode/packages/web-ui",
"resolved": "../shared/packages/web-ui",
"link": true
},
"node_modules/@humanfs/core": {
+1 -1
View File
@@ -30,7 +30,7 @@
"vite": "latest"
},
"dependencies": {
"@gabriel20xx/web-ui": "file:../SharedCode/packages/web-ui",
"@gabriel20xx/web-ui": "file:../shared/packages/web-ui",
"@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest",
"bits-ui": "latest",
File renamed without changes.
File renamed without changes.
@@ -9,6 +9,6 @@ if command -v pwsh >/dev/null 2>&1; then
elif command -v powershell.exe >/dev/null 2>&1; then
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$sync_script" -Commit
else
echo "SharedCode synchronization requires pwsh or powershell.exe." >&2
echo "shared synchronization requires pwsh or powershell.exe." >&2
exit 1
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -1,4 +1,4 @@
# SharedCode packages
# shared packages
This folder is the single source of truth for reusable web UI across the projects in this workspace.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -17,4 +17,4 @@ legacy package as a compatibility layer until every consumer has moved.
Pass a service-specific `tableName` to `runMigrations` when multiple services
share one PostgreSQL database, so their migration histories cannot collide.
Run `npm test` from this package or `npm run test --workspace=@gabriel20xx/node-backend` from `SharedCode`.
Run `npm test` from this package or `npm run test --workspace=@gabriel20xx/node-backend` from `shared`.
@@ -9,7 +9,7 @@ Shared Python backend infrastructure for services using `asyncpg`:
- common account/session persistence for the single-admin or optional multi-user model.
HTTP framework adapters stay in each service. Install this package from the
published index or directly from the SharedCode repository with a subdirectory
published index or directly from the shared repository with a subdirectory
install during development:
```bash
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -171,12 +171,14 @@ function Test-LocalSharedDependency {
if ([string]::IsNullOrWhiteSpace($SourceRepository)) {
$scriptParent = Resolve-FullPath (Join-Path $PSScriptRoot '..')
if ((Split-Path -Leaf $scriptParent) -ieq 'shared') {
$scriptParentGitRoot = (Invoke-GitText -WorkingDirectory $scriptParent -Arguments @('rev-parse', '--show-toplevel') | Select-Object -First 1).Trim()
$scriptParentGitRoot = Resolve-FullPath $scriptParentGitRoot
if ($scriptParentGitRoot -ieq $scriptParent) {
$SourceRepository = $scriptParent
}
else {
$consumerRoot = Resolve-FullPath (Join-Path $PSScriptRoot '..\..')
$SourceRepository = Join-Path $consumerRoot '..\..\shared'
$workspaceRoot = Split-Path -Parent (Split-Path -Parent $scriptParentGitRoot)
$SourceRepository = Join-Path $workspaceRoot 'shared'
}
}
@@ -192,7 +194,7 @@ foreach ($sourceFile in $sourceFiles) {
$sourceFileSet[$sourceFile.Replace('\', '/')] = $true
}
Write-Host "Synchronizing $($sourceFiles.Count) tracked SharedCode files from $sourceCommit."
Write-Host "Synchronizing $($sourceFiles.Count) tracked shared files from $sourceCommit."
$failures = New-Object 'System.Collections.Generic.List[string]'
@@ -205,17 +207,32 @@ foreach ($relativeProject in $consumerProjects) {
try {
$projectRoot = Resolve-FullPath $projectRoot
$destinationRoot = Join-Path $projectRoot 'SharedCode'
$dirtySharedCode = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('status', '--porcelain', '--', 'SharedCode'))
if ($dirtySharedCode.Count -gt 0 -and -not $Force) {
throw "SharedCode has local changes. Commit them or rerun with -Force."
$destinationRoot = Join-Path $projectRoot 'shared'
$legacyDirectoryName = ('Shared' + 'Code')
$projectDirectories = @(Get-ChildItem -LiteralPath $projectRoot -Directory -Force)
$destinationEntry = $projectDirectories | Where-Object { $_.Name -ceq 'shared' }
$legacyEntry = $projectDirectories | Where-Object { $_.Name -ceq $legacyDirectoryName }
if ($null -ne $destinationEntry -and $null -ne $legacyEntry) {
throw "Both shared and the legacy shared snapshot directory exist. Remove the legacy directory before synchronizing."
}
$dirtyshared = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('status', '--porcelain', '--', 'shared'))
$dirtyLegacy = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('status', '--porcelain', '--', $legacyDirectoryName))
if (($dirtyshared.Count -gt 0 -or $dirtyLegacy.Count -gt 0) -and -not $Force) {
throw "shared has local changes. Commit them or rerun with -Force."
}
if ($null -ne $legacyEntry) {
$temporaryRenamePath = Join-Path $projectRoot ('.shared-sync-rename-' + [Guid]::NewGuid().ToString('N'))
Move-Item -LiteralPath $legacyEntry.FullName -Destination $temporaryRenamePath
Move-Item -LiteralPath $temporaryRenamePath -Destination $destinationRoot
}
New-Item -ItemType Directory -Force -Path $destinationRoot | Out-Null
$existingSharedFiles = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('ls-files', '--', 'SharedCode') | Where-Object { $_ -like 'SharedCode/*' })
$existingSharedFiles = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('ls-files', '--', 'shared') | Where-Object { $_ -like 'shared/*' })
foreach ($existingSharedFile in $existingSharedFiles) {
$relativeSharedFile = $existingSharedFile.Substring('SharedCode/'.Length).Replace('\', '/')
$relativeSharedFile = $existingSharedFile.Substring('shared/'.Length).Replace('\', '/')
if (-not $sourceFileSet.ContainsKey($relativeSharedFile)) {
$stalePath = Join-Path $destinationRoot ($relativeSharedFile -replace '/', '\')
if (Test-Path -LiteralPath $stalePath -PathType Leaf) {
@@ -239,10 +256,10 @@ foreach ($relativeProject in $consumerProjects) {
}
$lockFiles = @()
$sharedCodePrefix = ((Resolve-FullPath $destinationRoot).TrimEnd('\') + '\')
$sharedPrefix = ((Resolve-FullPath $destinationRoot).TrimEnd('\') + '\')
$packageFiles = @(Get-ChildItem -LiteralPath $projectRoot -Recurse -File -Filter 'package.json' -Force |
Where-Object {
$_.FullName -notlike "$sharedCodePrefix*" -and
$_.FullName -notlike "$sharedPrefix*" -and
$_.FullName -notmatch '\\node_modules\\'
})
@@ -280,15 +297,15 @@ foreach ($relativeProject in $consumerProjects) {
}
}
$null = Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('add', '--', 'SharedCode')
$null = Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('add', '--', 'shared')
foreach ($lockFile in $lockFiles) {
$null = Invoke-GitText -WorkingDirectory $projectRoot -Arguments @('add', '--', $lockFile)
}
$targetPaths = @('SharedCode') + $lockFiles
$targetPaths = @('shared') + $lockFiles
$stagedChanges = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments (@('diff', '--cached', '--name-only', '--') + $targetPaths))
if ($Commit -and $stagedChanges.Count -gt 0) {
$commitMessage = "Sync SharedCode snapshot from $sourceCommit"
$commitMessage = "Sync shared snapshot from $sourceCommit"
$commitArguments = @('commit', '--only', '-m', $commitMessage, '--') + $targetPaths
$commitOutput = @(Invoke-GitText -WorkingDirectory $projectRoot -Arguments $commitArguments)
$commitOutput | ForEach-Object { Write-Host " $_" }
@@ -318,7 +335,7 @@ foreach ($relativeProject in $consumerProjects) {
}
if ($failures.Count -gt 0) {
throw "SharedCode synchronization failed for $($failures.Count) project(s): $($failures -join '; ')"
throw "shared synchronization failed for $($failures.Count) project(s): $($failures -join '; ')"
}
Write-Host 'SharedCode synchronization completed.'
Write-Host 'shared synchronization completed.'
File renamed without changes.