Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
398ddde169 | |||
74b9bb86a1 | |||
701f80540b | |||
3926fa09ff | |||
e3d9b437c5 | |||
deaaec2c57 | |||
bf5f07222c | |||
75f89c0edf | |||
ad9ac18c18 | |||
24d3067e52 | |||
1c7cf7966f | |||
7a799868fb | |||
0093a0879e | |||
071b719309 | |||
f6c5acee8f | |||
8fe2b57c1e | |||
d4ae79a1cd | |||
d49b699e83 | |||
2eaa9b300c |
@ -1,6 +1,6 @@
|
|||||||
.env
|
.env
|
||||||
/docker-compose.*
|
/docker-compose.*
|
||||||
/result
|
/result*
|
||||||
/.direnv/
|
/.direnv/
|
||||||
/build/
|
/build/
|
||||||
|
|
||||||
|
30
.github/workflows/lint.yaml
vendored
30
.github/workflows/lint.yaml
vendored
@ -5,8 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@ -26,29 +24,5 @@ jobs:
|
|||||||
name: trevstack
|
name: trevstack
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
- name: Install NPM Packages
|
- name: Run checks
|
||||||
working-directory: ./client
|
run: nix flake check
|
||||||
run: npm i && npm ci # https://github.com/npm/cli/issues/6787#issuecomment-2128344748
|
|
||||||
|
|
||||||
- uses: nicknovitski/nix-develop@v1
|
|
||||||
|
|
||||||
- run: npx prettier --check .
|
|
||||||
working-directory: ./client
|
|
||||||
|
|
||||||
- run: npx eslint .
|
|
||||||
working-directory: ./client
|
|
||||||
|
|
||||||
- run: npx svelte-check
|
|
||||||
working-directory: ./client
|
|
||||||
|
|
||||||
- run: revive -config revive.toml -set_exit_status ./...
|
|
||||||
working-directory: ./server
|
|
||||||
|
|
||||||
- run: sqlfluff lint
|
|
||||||
working-directory: ./server
|
|
||||||
|
|
||||||
- run: buf lint
|
|
||||||
|
|
||||||
- run: nix fmt -- flake.nix --check
|
|
||||||
|
|
||||||
- run: nix flake check --all-systems
|
|
11
.github/workflows/release.yaml
vendored
11
.github/workflows/release.yaml
vendored
@ -28,13 +28,20 @@ jobs:
|
|||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: nix develop --command trevstack-build
|
run: >
|
||||||
|
nix build
|
||||||
|
.#trevstack-linux-amd64
|
||||||
|
.#trevstack-linux-arm64
|
||||||
|
.#trevstack-linux-arm
|
||||||
|
.#trevstack-windows-amd64
|
||||||
|
.#trevstack-darwin-amd64
|
||||||
|
.#trevstack-darwin-arm64
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |-
|
files: |-
|
||||||
build/**
|
result*/bin/*
|
||||||
|
|
||||||
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
||||||
package:
|
package:
|
||||||
|
10
.github/workflows/update.yaml
vendored
10
.github/workflows/update.yaml
vendored
@ -23,12 +23,14 @@ jobs:
|
|||||||
name: trevstack
|
name: trevstack
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
- name: Install NPM Packages
|
# https://github.com/actions/checkout/issues/13
|
||||||
working-directory: ./client
|
- name: Set Git Config
|
||||||
run: npm i && npm ci # https://github.com/npm/cli/issues/6787#issuecomment-2128344748
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Update
|
- name: Update
|
||||||
run: nix develop --command trevstack-update
|
run: nix run .#update
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
.env
|
.env
|
||||||
/docker-compose.*
|
/docker-compose.*
|
||||||
/result
|
/result*
|
||||||
/.direnv/
|
/.direnv/
|
||||||
/build/
|
/build/
|
@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
git_root=$(git rev-parse --show-toplevel)
|
|
||||||
url=$(git config --get remote.origin.url)
|
|
||||||
name=$(basename -s .git "${url}")
|
|
||||||
git_version=$(git describe --tags --abbrev=0)
|
|
||||||
version=${git_version#v}
|
|
||||||
|
|
||||||
echo "building client"
|
|
||||||
cd "${git_root}"
|
|
||||||
nix build .#trevstack-client
|
|
||||||
cp -a result/. server/client
|
|
||||||
chmod -R u+w server/client
|
|
||||||
|
|
||||||
echo "building server"
|
|
||||||
cd "${git_root}/server"
|
|
||||||
echo "Building ${name}-windows-amd64-${version}.exe"
|
|
||||||
GOOS=windows GOARCH=amd64 go build -o "./build/${name}-windows-amd64-${version}.exe" .
|
|
||||||
echo "Building ${name}-linux-amd64-${version}"
|
|
||||||
GOOS=linux GOARCH=amd64 go build -o "./build/${name}-linux-amd64-${version}" .
|
|
||||||
echo "Building ${name}-linux-amd64-${version}"
|
|
||||||
GOOS=linux GOARCH=arm64 go build -o "./build/${name}-linux-arm64-${version}" .
|
|
||||||
echo "Building ${name}-linux-arm-${version}"
|
|
||||||
GOOS=linux GOARCH=arm go build -o "./build/${name}-linux-arm-${version}" .
|
|
@ -7,13 +7,13 @@ next_version=$(echo "${version}" | awk -F. -v OFS=. '{$NF += 1 ; print}')
|
|||||||
|
|
||||||
echo "bumping client"
|
echo "bumping client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
npm version "${next_version}" && npm i
|
npm version "${next_version}"
|
||||||
git add package-lock.json
|
git add package-lock.json
|
||||||
git add package.json
|
git add package.json
|
||||||
|
|
||||||
echo "bumping nix"
|
echo "bumping nix"
|
||||||
cd "${git_root}"
|
cd "${git_root}"
|
||||||
nix-update --flake --version "${next_version}" --subpackage trevstack-client trevstack
|
nix-update --flake --version "${next_version}" --subpackage client default
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
|
|
||||||
git commit -m "bump: v${version} -> v${next_version}"
|
git commit -m "bump: v${version} -> v${next_version}"
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
git_root=$(git rev-parse --show-toplevel)
|
|
||||||
|
|
||||||
echo "linting client"
|
|
||||||
cd "${git_root}/client"
|
|
||||||
npx prettier --check .
|
|
||||||
npx eslint .
|
|
||||||
npx svelte-check
|
|
||||||
|
|
||||||
echo "linting server"
|
|
||||||
cd "${git_root}/server"
|
|
||||||
revive -config revive.toml -set_exit_status ./...
|
|
||||||
sqlfluff lint
|
|
||||||
|
|
||||||
echo "linting protobuf"
|
|
||||||
cd "${git_root}"
|
|
||||||
buf lint
|
|
||||||
|
|
||||||
echo "linting nix"
|
|
||||||
cd "${git_root}"
|
|
||||||
nix fmt -- flake.nix --check
|
|
||||||
nix flake check --all-systems
|
|
@ -3,6 +3,14 @@
|
|||||||
git_root=$(git rev-parse --show-toplevel)
|
git_root=$(git rev-parse --show-toplevel)
|
||||||
updated=false
|
updated=false
|
||||||
|
|
||||||
|
echo "updating nix flake"
|
||||||
|
cd "${git_root}"
|
||||||
|
nix flake update
|
||||||
|
if ! git diff --exit-code flake.nix; then
|
||||||
|
git add flake.nix
|
||||||
|
git commit -m "build(nix): updated nix dependencies"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "updating client"
|
echo "updating client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
npm update --save && npm i
|
npm update --save && npm i
|
||||||
@ -25,9 +33,9 @@ if ! git diff --exit-code go.mod go.sum; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${updated}" = true ]; then
|
if [ "${updated}" = true ]; then
|
||||||
echo "updating nix"
|
echo "updating nix hashes"
|
||||||
cd "${git_root}"
|
cd "${git_root}"
|
||||||
nix-update --flake --version=skip --subpackage trevstack-client trevstack
|
nix-update --flake --version=skip --subpackage client default
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
git commit -m "build(nix): updated nix hashes"
|
git commit -m "build(nix): updated nix hashes"
|
||||||
else
|
else
|
||||||
|
@ -26,4 +26,4 @@ WORKDIR /app
|
|||||||
# Copy /nix/store
|
# Copy /nix/store
|
||||||
COPY --from=builder /tmp/nix-store-closure /nix/store
|
COPY --from=builder /tmp/nix-store-closure /nix/store
|
||||||
COPY --from=builder /tmp/build/result /app
|
COPY --from=builder /tmp/build/result /app
|
||||||
CMD ["/app/bin/server"]
|
CMD ["/app/bin/trevstack"]
|
158
client/package-lock.json
generated
158
client/package-lock.json
generated
@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"version": "0.0.18",
|
"version": "0.0.20",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"version": "0.0.18",
|
"version": "0.0.20",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@connectrpc/connect": "^2.0.2",
|
"@connectrpc/connect": "^2.0.2",
|
||||||
"@connectrpc/connect-web": "^2.0.2",
|
"@connectrpc/connect-web": "^2.0.2",
|
||||||
"@eslint/compat": "^1.2.8",
|
"@eslint/compat": "^1.2.8",
|
||||||
"@eslint/js": "^9.18.0",
|
"@eslint/js": "^9.18.0",
|
||||||
"@lucide/svelte": "^0.479.0",
|
"@lucide/svelte": "^0.479.0",
|
||||||
"@scalar/api-reference": "^1.28.19",
|
"@scalar/api-reference": "^1.28.22",
|
||||||
"@simplewebauthn/browser": "^13.1.0",
|
"@simplewebauthn/browser": "^13.1.0",
|
||||||
"@sveltejs/adapter-static": "^3.0.8",
|
"@sveltejs/adapter-static": "^3.0.8",
|
||||||
"@sveltejs/kit": "^2.20.7",
|
"@sveltejs/kit": "^2.20.7",
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"prettier-plugin-svelte": "^3.3.3",
|
"prettier-plugin-svelte": "^3.3.3",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||||
"svelte": "^5.27.0",
|
"svelte": "^5.27.3",
|
||||||
"svelte-check": "^4.1.6",
|
"svelte-check": "^4.1.6",
|
||||||
"svelte-sonner": "^0.3.28",
|
"svelte-sonner": "^0.3.28",
|
||||||
"tailwind-merge": "^3.2.0",
|
"tailwind-merge": "^3.2.0",
|
||||||
@ -37,7 +37,7 @@
|
|||||||
"tw-animate-css": "^1.2.5",
|
"tw-animate-css": "^1.2.5",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"typescript-eslint": "^8.30.1",
|
"typescript-eslint": "^8.30.1",
|
||||||
"vite": "^6.3.0"
|
"vite": "^6.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@ -736,9 +736,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint-community/eslint-utils": {
|
"node_modules/@eslint-community/eslint-utils": {
|
||||||
"version": "4.6.0",
|
"version": "4.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.1.tgz",
|
||||||
"integrity": "sha512-WhCn7Z7TauhBtmzhvKpoQs0Wwb/kBcy4CwpuI0/eEIr2Lx2auxmulAzLr91wVZJaz47iUZdkXOK7WlAfxGKCnA==",
|
"integrity": "sha512-KTsJMmobmbrFLe3LDh0PC2FXpcSYJt/MLjlkh/9LEnmKYLSYmT/0EW9JWANjeoemiuZrmogti0tW5Ch+qNUYDw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1295,9 +1295,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lezer/javascript": {
|
"node_modules/@lezer/javascript": {
|
||||||
"version": "1.4.21",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz",
|
"resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.5.0.tgz",
|
||||||
"integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==",
|
"integrity": "sha512-i/uZt1eoiojC3BRsjtiYZjT8DhzgZvWiKJjpXW3Jc2y4FkXY9YoBLKx+jSct+ynUINv5GtRxjTK7hBNhujPwrg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1718,28 +1718,28 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/api-client": {
|
"node_modules/@scalar/api-client": {
|
||||||
"version": "2.3.19",
|
"version": "2.3.22",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/api-client/-/api-client-2.3.19.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/api-client/-/api-client-2.3.22.tgz",
|
||||||
"integrity": "sha512-1Scff4QL6UExxcmSYv5j1dktvQZTXbmDUJp99RqmUROEhneNWEeWaZe+GZWsda5mvDoe4vP9zZKaymkulBDKYQ==",
|
"integrity": "sha512-9gMFjWog7t0lUbLwqhQRXw0wOEc03WfkXNRwrCuvEjKmm3FgDQELQhG6V1m2a7SO4nI+Wmj5ubJxN9dD3Ehtdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/tailwindcss": "^0.2.0",
|
"@headlessui/tailwindcss": "^0.2.0",
|
||||||
"@headlessui/vue": "^1.7.20",
|
"@headlessui/vue": "^1.7.20",
|
||||||
"@scalar/components": "0.13.47",
|
"@scalar/components": "0.13.49",
|
||||||
"@scalar/draggable": "0.1.11",
|
"@scalar/draggable": "0.1.11",
|
||||||
"@scalar/icons": "0.1.3",
|
"@scalar/icons": "0.1.3",
|
||||||
"@scalar/import": "0.3.13",
|
"@scalar/import": "0.3.16",
|
||||||
"@scalar/oas-utils": "0.2.130",
|
"@scalar/oas-utils": "0.2.133",
|
||||||
"@scalar/object-utils": "1.1.13",
|
"@scalar/object-utils": "1.1.13",
|
||||||
"@scalar/openapi-parser": "0.10.14",
|
"@scalar/openapi-parser": "0.10.16",
|
||||||
"@scalar/openapi-types": "0.2.0",
|
"@scalar/openapi-types": "0.2.0",
|
||||||
"@scalar/postman-to-openapi": "0.2.3",
|
"@scalar/postman-to-openapi": "0.2.6",
|
||||||
"@scalar/snippetz": "0.2.19",
|
"@scalar/snippetz": "0.2.19",
|
||||||
"@scalar/themes": "0.9.86",
|
"@scalar/themes": "0.10.0",
|
||||||
"@scalar/types": "0.1.7",
|
"@scalar/types": "0.1.8",
|
||||||
"@scalar/use-codemirror": "0.11.92",
|
"@scalar/use-codemirror": "0.11.94",
|
||||||
"@scalar/use-hooks": "0.1.40",
|
"@scalar/use-hooks": "0.1.41",
|
||||||
"@scalar/use-toasts": "0.7.9",
|
"@scalar/use-toasts": "0.7.9",
|
||||||
"@scalar/use-tooltip": "1.0.6",
|
"@scalar/use-tooltip": "1.0.6",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^10.10.0",
|
||||||
@ -1763,24 +1763,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/api-reference": {
|
"node_modules/@scalar/api-reference": {
|
||||||
"version": "1.28.19",
|
"version": "1.28.22",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/api-reference/-/api-reference-1.28.19.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/api-reference/-/api-reference-1.28.22.tgz",
|
||||||
"integrity": "sha512-w3J6RgGXdql9+Fb1BkumargffjzmHRTdcEaWQUJcCRtxw8ZRvOLtA+hQ+/3mpZohf6Y0bC8T1hTeKZVQ1j3L5g==",
|
"integrity": "sha512-RM1AZafAZeQdNhE+/zhb4ptRYBwmFU6PcJP6Tjub55jYBZp5tMe8/BCMZIgCucEEO8v9t17NIMs703SK5vSzrg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/vue": "^1.0.2",
|
"@floating-ui/vue": "^1.0.2",
|
||||||
"@headlessui/vue": "^1.7.20",
|
"@headlessui/vue": "^1.7.20",
|
||||||
"@scalar/api-client": "2.3.19",
|
"@scalar/api-client": "2.3.22",
|
||||||
"@scalar/code-highlight": "0.0.27",
|
"@scalar/code-highlight": "0.0.27",
|
||||||
"@scalar/components": "0.13.47",
|
"@scalar/components": "0.13.49",
|
||||||
"@scalar/oas-utils": "0.2.130",
|
"@scalar/oas-utils": "0.2.133",
|
||||||
"@scalar/openapi-parser": "0.10.14",
|
"@scalar/openapi-parser": "0.10.16",
|
||||||
"@scalar/openapi-types": "0.2.0",
|
"@scalar/openapi-types": "0.2.0",
|
||||||
"@scalar/snippetz": "0.2.19",
|
"@scalar/snippetz": "0.2.19",
|
||||||
"@scalar/themes": "0.9.86",
|
"@scalar/themes": "0.10.0",
|
||||||
"@scalar/types": "0.1.7",
|
"@scalar/types": "0.1.8",
|
||||||
"@scalar/use-hooks": "0.1.40",
|
"@scalar/use-hooks": "0.1.41",
|
||||||
"@scalar/use-toasts": "0.7.9",
|
"@scalar/use-toasts": "0.7.9",
|
||||||
"@unhead/vue": "^1.11.11",
|
"@unhead/vue": "^1.11.11",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^10.10.0",
|
||||||
@ -1825,9 +1825,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/components": {
|
"node_modules/@scalar/components": {
|
||||||
"version": "0.13.47",
|
"version": "0.13.49",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/components/-/components-0.13.47.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/components/-/components-0.13.49.tgz",
|
||||||
"integrity": "sha512-e88mKKsCEspd06bpPQPnhtEvCo/jjoFFOX9yUSV9sr0sWFZHi0ihq1zvnpLKpULyS+C5zzyoN/tGVhmaYpXgyg==",
|
"integrity": "sha512-Y2w2/xxvrDTb+PkFR8/texZ93LnTkvhLMYFe6bDqlfwp3m4vrbHlzfAmKpzOcYWzQYgx9Gfi/8BXKlyzC5c7Ow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1835,8 +1835,8 @@
|
|||||||
"@floating-ui/vue": "^1.0.2",
|
"@floating-ui/vue": "^1.0.2",
|
||||||
"@headlessui/vue": "^1.7.20",
|
"@headlessui/vue": "^1.7.20",
|
||||||
"@scalar/code-highlight": "0.0.27",
|
"@scalar/code-highlight": "0.0.27",
|
||||||
"@scalar/themes": "0.9.86",
|
"@scalar/themes": "0.10.0",
|
||||||
"@scalar/use-hooks": "0.1.40",
|
"@scalar/use-hooks": "0.1.41",
|
||||||
"@scalar/use-toasts": "0.7.9",
|
"@scalar/use-toasts": "0.7.9",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^10.10.0",
|
||||||
"cva": "1.0.0-beta.2",
|
"cva": "1.0.0-beta.2",
|
||||||
@ -1888,14 +1888,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/import": {
|
"node_modules/@scalar/import": {
|
||||||
"version": "0.3.13",
|
"version": "0.3.16",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/import/-/import-0.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/import/-/import-0.3.16.tgz",
|
||||||
"integrity": "sha512-ooKyRxwtvMpxBnoLt9mSJF8er5rCR6RzGJaIMRCj7ViN776eY4mbLiYcXre/LO8XfLSHb1p7XbNDhfFyTHaUlw==",
|
"integrity": "sha512-UfjH8WBmAnb/0UwQZOv+mGbFdgQKMKIgziDR/LpTuQcGpR2MnYdQKTJ8KTmpYG3KURMzDpZ5iEJss4YGPBlTZw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scalar/oas-utils": "0.2.130",
|
"@scalar/oas-utils": "0.2.133",
|
||||||
"@scalar/openapi-parser": "0.10.14",
|
"@scalar/openapi-parser": "0.10.16",
|
||||||
"yaml": "^2.4.5"
|
"yaml": "^2.4.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -1903,17 +1903,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/oas-utils": {
|
"node_modules/@scalar/oas-utils": {
|
||||||
"version": "0.2.130",
|
"version": "0.2.133",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/oas-utils/-/oas-utils-0.2.130.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/oas-utils/-/oas-utils-0.2.133.tgz",
|
||||||
"integrity": "sha512-sVpdc3+3c/WiNrKEIwzJ+ml2ZQBjarMOTDJCM/IrvYhrJE0nHrdkzxlJgNPi++vJbVl0saYt8LhEItALv7NziA==",
|
"integrity": "sha512-5uYlFh9/P3iS+P03OYJxpvCtunc6hUqoFTxXOu4VQ4VTCPx2tR747RQE+5titMHD3dbBK7Mvf4U9RzW5/J2Glw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hyperjump/json-schema": "^1.9.6",
|
"@hyperjump/json-schema": "^1.9.6",
|
||||||
"@scalar/object-utils": "1.1.13",
|
"@scalar/object-utils": "1.1.13",
|
||||||
"@scalar/openapi-types": "0.2.0",
|
"@scalar/openapi-types": "0.2.0",
|
||||||
"@scalar/themes": "0.9.86",
|
"@scalar/themes": "0.10.0",
|
||||||
"@scalar/types": "0.1.7",
|
"@scalar/types": "0.1.8",
|
||||||
"flatted": "^3.3.1",
|
"flatted": "^3.3.1",
|
||||||
"microdiff": "^1.4.0",
|
"microdiff": "^1.4.0",
|
||||||
"nanoid": "^5.1.5",
|
"nanoid": "^5.1.5",
|
||||||
@ -1941,9 +1941,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/openapi-parser": {
|
"node_modules/@scalar/openapi-parser": {
|
||||||
"version": "0.10.14",
|
"version": "0.10.16",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.10.14.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.10.16.tgz",
|
||||||
"integrity": "sha512-VXr979NMx6wZ+kpFKor2eyCJZOjyMwcBRc6c4Gc92ZMOC7ZNYqjwbw+Ubh2ELJyP5cWAjOFSrNwtylema0pw5w==",
|
"integrity": "sha512-UF+noQXEEQ52lm2Uum7mxkZdvsl8pMCIoTtN9jCTAfjutRwUPo7vfuic4JK+ChFLHDZyiYXYsbCwlP+aLk+4Xg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1972,13 +1972,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/postman-to-openapi": {
|
"node_modules/@scalar/postman-to-openapi": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/postman-to-openapi/-/postman-to-openapi-0.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/postman-to-openapi/-/postman-to-openapi-0.2.6.tgz",
|
||||||
"integrity": "sha512-/I5QbDFy+Sh29EIEgub/ztI+1eNtHRn+mln726hR+uWOyVyaDk0FfNC0R4XOn8SsDNyu5eqPbXBb9vceTVG6jQ==",
|
"integrity": "sha512-MZFkvw60XzdJGwS2Wm5Jtcw3ZwYKMeZ2jInWfy3i9gHteSRtFF54keoXuxlIeoyLWWWBUS2rP4NGzEPaT6cQnw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scalar/oas-utils": "0.2.130",
|
"@scalar/oas-utils": "0.2.133",
|
||||||
"@scalar/openapi-types": "0.2.0"
|
"@scalar/openapi-types": "0.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -1999,22 +1999,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/themes": {
|
"node_modules/@scalar/themes": {
|
||||||
"version": "0.9.86",
|
"version": "0.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/themes/-/themes-0.9.86.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/themes/-/themes-0.10.0.tgz",
|
||||||
"integrity": "sha512-QUHo9g5oSWi+0Lm1vJY9TaMZRau8LHg+vte7q5BVTBnu6NuQfigCaN+ouQ73FqIVd96TwMO6Db+dilK1B+9row==",
|
"integrity": "sha512-r6dNrIILuBckVSXUysm2VCPpKG+Sh/+XYV3U8R18lpRga/0Qxq9VFMTxO8xMAyVupErxRlzrBoVlmnia8YruIw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scalar/types": "0.1.7"
|
"@scalar/types": "0.1.8"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/types": {
|
"node_modules/@scalar/types": {
|
||||||
"version": "0.1.7",
|
"version": "0.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/types/-/types-0.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/types/-/types-0.1.8.tgz",
|
||||||
"integrity": "sha512-irIDYzTQG2KLvFbuTI8k2Pz/R4JR+zUUSykVTbEMatkzMmVFnn1VzNSMlODbadycwZunbnL2tA27AXed9URVjw==",
|
"integrity": "sha512-VL1dcLB6w7V0htFxIgcdQeQhD5LFW1oqWk9ZWfzd9Ekl0a3bDGc81R5S3fk6qCHahPZR3cVPr4rHVQh0aX+FrQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -2029,9 +2029,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/use-codemirror": {
|
"node_modules/@scalar/use-codemirror": {
|
||||||
"version": "0.11.92",
|
"version": "0.11.94",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/use-codemirror/-/use-codemirror-0.11.92.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/use-codemirror/-/use-codemirror-0.11.94.tgz",
|
||||||
"integrity": "sha512-WDd50xGLV+q1T36cKzmhqYP+TyHe4MOW0tIiu09ed9aMXGUk6kQgnf0J3rYPsGeNj9IkVG3znZ7oYT3QplLGVA==",
|
"integrity": "sha512-+qd5+rIdtRpGsWHu4QDdeid5NiSLxViy2Of5Th5BN2a/U9A1dFa61D62gufYfUCniTxJUSn1mVljcIyD5oBgrw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -2050,7 +2050,7 @@
|
|||||||
"@lezer/highlight": "^1.2.1",
|
"@lezer/highlight": "^1.2.1",
|
||||||
"@lezer/lr": "^1.4.2",
|
"@lezer/lr": "^1.4.2",
|
||||||
"@replit/codemirror-css-color-picker": "^6.3.0",
|
"@replit/codemirror-css-color-picker": "^6.3.0",
|
||||||
"@scalar/components": "0.13.47",
|
"@scalar/components": "0.13.49",
|
||||||
"codemirror": "^6.0.0",
|
"codemirror": "^6.0.0",
|
||||||
"style-mod": "^4.1.2",
|
"style-mod": "^4.1.2",
|
||||||
"vue": "^3.5.12"
|
"vue": "^3.5.12"
|
||||||
@ -2060,13 +2060,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@scalar/use-hooks": {
|
"node_modules/@scalar/use-hooks": {
|
||||||
"version": "0.1.40",
|
"version": "0.1.41",
|
||||||
"resolved": "https://registry.npmjs.org/@scalar/use-hooks/-/use-hooks-0.1.40.tgz",
|
"resolved": "https://registry.npmjs.org/@scalar/use-hooks/-/use-hooks-0.1.41.tgz",
|
||||||
"integrity": "sha512-z8qtgIcW9Z3PCrP2cbKG+D2EVhpNgl1N0ucGtDg5SMl/fvCyXNfqB9j+u3ygxkouatfQ9zRZuhxreNMkW9/H5g==",
|
"integrity": "sha512-YoXf8BOHyBIpiRt2FXzjFrS9OJtGrtfmeWzx7o8zV84dRqMs9/0mP9KXeyQHa0LlHckJ2Ubyl+jQI2Bis59zYQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scalar/themes": "0.9.86",
|
"@scalar/themes": "0.10.0",
|
||||||
"@scalar/use-toasts": "0.7.9",
|
"@scalar/use-toasts": "0.7.9",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^10.10.0",
|
||||||
"vue": "^3.5.12",
|
"vue": "^3.5.12",
|
||||||
@ -7232,9 +7232,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/svelte": {
|
"node_modules/svelte": {
|
||||||
"version": "5.27.0",
|
"version": "5.27.3",
|
||||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.27.3.tgz",
|
||||||
"integrity": "sha512-Uai13Ydt1ZE+bUHme6b9U38PCYVNCqBRoBMkUKbFbKiD7kHWjdUUrklYAQZJxyKK81qII4mrBwe/YmvEMSlC9w==",
|
"integrity": "sha512-MK16NUEFwAunCkdJpIIJ6hvKElx0zFlKMqQd7NAIugMfrL0YeOH8VEn5pg9g2Q6RLj2JrGJL6c0zaAwmXx/nHQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -7752,9 +7752,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "6.3.0",
|
"version": "6.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.1.tgz",
|
||||||
"integrity": "sha512-9aC0n4pr6hIbvi1YOpFjwQ+QOTGssvbJKoeYkuHHGWwlXfdxQlI8L2qNMo9awEEcCPSiS+5mJZk5jH1PAqoDeQ==",
|
"integrity": "sha512-kkzzkqtMESYklo96HKKPE5KKLkC1amlsqt+RjFMlX2AvbRB/0wghap19NdBxxwGZ+h/C6DLCrcEphPIItlGrRQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -7988,9 +7988,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/zod": {
|
"node_modules/zod": {
|
||||||
"version": "3.24.2",
|
"version": "3.24.3",
|
||||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",
|
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.3.tgz",
|
||||||
"integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",
|
"integrity": "sha512-HhY1oqzWCQWuUqvBFnsyrtZRhyPeR7SUGv+C4+MsisMuVfSPx8HpwWqH8tRahSlt6M3PiFAcoeFhZAqIXTxoSg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.18",
|
"version": "0.0.20",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
@ -19,7 +19,7 @@
|
|||||||
"@eslint/compat": "^1.2.8",
|
"@eslint/compat": "^1.2.8",
|
||||||
"@eslint/js": "^9.18.0",
|
"@eslint/js": "^9.18.0",
|
||||||
"@lucide/svelte": "^0.479.0",
|
"@lucide/svelte": "^0.479.0",
|
||||||
"@scalar/api-reference": "^1.28.19",
|
"@scalar/api-reference": "^1.28.22",
|
||||||
"@simplewebauthn/browser": "^13.1.0",
|
"@simplewebauthn/browser": "^13.1.0",
|
||||||
"@sveltejs/adapter-static": "^3.0.8",
|
"@sveltejs/adapter-static": "^3.0.8",
|
||||||
"@sveltejs/kit": "^2.20.7",
|
"@sveltejs/kit": "^2.20.7",
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"prettier-plugin-svelte": "^3.3.3",
|
"prettier-plugin-svelte": "^3.3.3",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||||
"svelte": "^5.27.0",
|
"svelte": "^5.27.3",
|
||||||
"svelte-check": "^4.1.6",
|
"svelte-check": "^4.1.6",
|
||||||
"svelte-sonner": "^0.3.28",
|
"svelte-sonner": "^0.3.28",
|
||||||
"tailwind-merge": "^3.2.0",
|
"tailwind-merge": "^3.2.0",
|
||||||
@ -43,6 +43,6 @@
|
|||||||
"tw-animate-css": "^1.2.5",
|
"tw-animate-css": "^1.2.5",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"typescript-eslint": "^8.30.1",
|
"typescript-eslint": "^8.30.1",
|
||||||
"vite": "^6.3.0"
|
"vite": "^6.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
262
flake.nix
262
flake.nix
@ -21,16 +21,42 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
pname = "trevstack";
|
pname = "trevstack";
|
||||||
version = "0.0.18";
|
version = "0.0.20";
|
||||||
|
|
||||||
supportedSystems = [
|
build-systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
|
host-systems = [
|
||||||
|
{
|
||||||
|
GOOS = "linux";
|
||||||
|
GOARCH = "amd64";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
GOOS = "linux";
|
||||||
|
GOARCH = "arm64";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
GOOS = "linux";
|
||||||
|
GOARCH = "arm";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
GOOS = "windows";
|
||||||
|
GOARCH = "amd64";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
GOOS = "darwin";
|
||||||
|
GOARCH = "amd64";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
GOOS = "darwin";
|
||||||
|
GOARCH = "arm64";
|
||||||
|
}
|
||||||
|
];
|
||||||
forSystem = f:
|
forSystem = f:
|
||||||
nixpkgs.lib.genAttrs supportedSystems (
|
nixpkgs.lib.genAttrs build-systems (
|
||||||
system:
|
system:
|
||||||
f {
|
f {
|
||||||
inherit system;
|
inherit system;
|
||||||
@ -40,83 +66,185 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
in {
|
in {
|
||||||
devShells = forSystem ({pkgs, ...}: {
|
devShells = forSystem ({pkgs, ...}: let
|
||||||
|
protoc-gen-connect-openapi = pkgs.buildGoModule {
|
||||||
|
name = "protoc-gen-connect-openapi";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "sudorandom";
|
||||||
|
repo = "protoc-gen-connect-openapi";
|
||||||
|
rev = "v0.16.1";
|
||||||
|
sha256 = "sha256-3XBQCc9H9N/AZm/8J5bJRgBhVtoZKFvbdTB+glHxYdA=";
|
||||||
|
};
|
||||||
|
vendorHash = "sha256-CIiG/XhV8xxjYY0sZcSvIFcJ1Wh8LyDDwqem2cSSwBA=";
|
||||||
|
};
|
||||||
|
in {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs;
|
packages = with pkgs; [
|
||||||
[
|
git
|
||||||
git
|
nix-update
|
||||||
nix-update
|
treli.packages."${system}".default
|
||||||
treli.packages."${system}".default
|
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
go
|
go
|
||||||
gotools
|
gotools
|
||||||
gopls
|
gopls
|
||||||
revive
|
revive
|
||||||
sqlc
|
sqlc
|
||||||
|
|
||||||
# database
|
# database
|
||||||
sqlite
|
sqlite
|
||||||
dbmate
|
dbmate
|
||||||
sqlfluff
|
sqlfluff
|
||||||
|
|
||||||
# Protobuf
|
# Protobuf
|
||||||
|
buf
|
||||||
|
protoc-gen-go
|
||||||
|
protoc-gen-connect-go
|
||||||
|
protoc-gen-es
|
||||||
|
protoc-gen-connect-openapi
|
||||||
|
|
||||||
|
# Client
|
||||||
|
nodejs_22
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
checks = forSystem ({pkgs, ...}: {
|
||||||
|
buf = with pkgs;
|
||||||
|
runCommandLocal "check-buf" {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
buf
|
buf
|
||||||
protoc-gen-go
|
];
|
||||||
protoc-gen-connect-go
|
} ''
|
||||||
protoc-gen-es
|
export HOME=$(pwd)
|
||||||
(buildGoModule {
|
cd ${./.}
|
||||||
name = "protoc-gen-connect-openapi";
|
buf lint
|
||||||
src = pkgs.fetchFromGitHub {
|
touch $out
|
||||||
owner = "sudorandom";
|
'';
|
||||||
repo = "protoc-gen-connect-openapi";
|
|
||||||
rev = "v0.16.1";
|
|
||||||
sha256 = "sha256-3XBQCc9H9N/AZm/8J5bJRgBhVtoZKFvbdTB+glHxYdA=";
|
|
||||||
};
|
|
||||||
vendorHash = "sha256-CIiG/XhV8xxjYY0sZcSvIFcJ1Wh8LyDDwqem2cSSwBA=";
|
|
||||||
nativeCheckInputs = with pkgs; [less];
|
|
||||||
})
|
|
||||||
|
|
||||||
# Client
|
nix = with pkgs;
|
||||||
|
runCommandLocal "check-nix" {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
alejandra
|
||||||
|
];
|
||||||
|
} ''
|
||||||
|
cd ${./.}
|
||||||
|
alejandra -c .
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
client = with pkgs;
|
||||||
|
buildNpmPackage {
|
||||||
|
pname = "check-client";
|
||||||
|
inherit version;
|
||||||
|
src = ./client;
|
||||||
|
npmDepsHash = "sha256-kZmwV99Qj6gjTk6PCMQZfqxGLzLHZOfZOqcYLufDztQ=";
|
||||||
|
dontNpmInstall = true;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
npx prettier --check .
|
||||||
|
npx eslint .
|
||||||
|
npx svelte-kit sync && npx svelte-check
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
server = with pkgs;
|
||||||
|
runCommandLocal "check-server" {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
revive
|
||||||
|
sqlfluff
|
||||||
|
];
|
||||||
|
} ''
|
||||||
|
cd ${./server}
|
||||||
|
revive -config revive.toml -set_exit_status ./...
|
||||||
|
sqlfluff lint
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
apps = forSystem ({pkgs, ...}: {
|
||||||
|
update = {
|
||||||
|
type = "app";
|
||||||
|
program = pkgs.lib.getExe (pkgs.writeShellApplication {
|
||||||
|
name = "update";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
git
|
||||||
|
nix
|
||||||
nodejs_22
|
nodejs_22
|
||||||
]
|
go
|
||||||
# Use .scripts
|
nix-update
|
||||||
++ map (
|
];
|
||||||
x: (
|
text = builtins.readFile ./.scripts/update.sh;
|
||||||
pkgs.writeShellApplication {
|
});
|
||||||
name = "${pname}-${(lib.nameFromURL (baseNameOf x) ".")}";
|
};
|
||||||
text = builtins.readFile x;
|
|
||||||
}
|
bump = {
|
||||||
)
|
type = "app";
|
||||||
) (pkgs.lib.filesystem.listFilesRecursive ./.scripts);
|
program = pkgs.lib.getExe (pkgs.writeShellApplication {
|
||||||
|
name = "bump";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
git
|
||||||
|
nodejs_22
|
||||||
|
nix-update
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./.scripts/bump.sh;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
formatter = forSystem ({pkgs, ...}: pkgs.alejandra);
|
formatter = forSystem ({pkgs, ...}: pkgs.alejandra);
|
||||||
|
|
||||||
packages = forSystem ({pkgs, ...}: rec {
|
packages = forSystem (
|
||||||
trevstack-client = pkgs.buildNpmPackage {
|
{pkgs, ...}: let
|
||||||
pname = "${pname}-client";
|
client = pkgs.buildNpmPackage {
|
||||||
inherit version;
|
inherit pname version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-SHt4y3WkiC819zl7NSdh+XW6yCDuaMEPMg1wmq3ctjE=";
|
npmDepsHash = "sha256-kZmwV99Qj6gjTk6PCMQZfqxGLzLHZOfZOqcYLufDztQ=";
|
||||||
nodejs = pkgs.nodejs_22;
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r build "$out"
|
cp -r build "$out"
|
||||||
chmod -R u+w "$out"
|
'';
|
||||||
'';
|
};
|
||||||
};
|
|
||||||
trevstack = pkgs.buildGoModule {
|
|
||||||
inherit trevstack-client pname version;
|
|
||||||
src = ./server;
|
|
||||||
vendorHash = "sha256-ocOqypV4OjlepoMgYFpk/+zpRzBlHg/dljBVMZzS9Yg=";
|
|
||||||
|
|
||||||
preBuild = ''
|
server = pkgs.buildGoModule {
|
||||||
cp -r ${trevstack-client} client
|
inherit client pname version;
|
||||||
'';
|
src = ./server;
|
||||||
};
|
vendorHash = "sha256-uXyCYODrBWNm7nbibm66oO90SYXRvrNtjF0K4ZI7IkM=";
|
||||||
default = trevstack;
|
env.CGO_ENABLED = 0;
|
||||||
});
|
|
||||||
|
preBuild = ''
|
||||||
|
cp -r ${client} client
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = server;
|
||||||
|
}
|
||||||
|
// builtins.listToAttrs (builtins.map (x: {
|
||||||
|
name = "${pname}-${x.GOOS}-${x.GOARCH}";
|
||||||
|
value = server.overrideAttrs {
|
||||||
|
nativeBuildInputs =
|
||||||
|
server.nativeBuildInputs
|
||||||
|
++ [
|
||||||
|
pkgs.rename
|
||||||
|
];
|
||||||
|
env.CGO_ENABLED = 0;
|
||||||
|
env.GOOS = x.GOOS;
|
||||||
|
env.GOARCH = x.GOARCH;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
find $GOPATH/bin -type f -exec mv -t $out/bin {} +
|
||||||
|
rename 's/(.+\/)(.+?)(\.[^.]*$|$)/$1${pname}-${x.GOOS}-${x.GOARCH}-${version}$3/' $out/bin/*
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
host-systems)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"embed"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
@ -18,6 +17,7 @@ import (
|
|||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
"golang.org/x/net/http2/h2c"
|
"golang.org/x/net/http2/h2c"
|
||||||
|
|
||||||
|
embed "github.com/spotdemo4/trevstack/server"
|
||||||
"github.com/spotdemo4/trevstack/server/internal/database"
|
"github.com/spotdemo4/trevstack/server/internal/database"
|
||||||
"github.com/spotdemo4/trevstack/server/internal/handlers/client"
|
"github.com/spotdemo4/trevstack/server/internal/handlers/client"
|
||||||
"github.com/spotdemo4/trevstack/server/internal/handlers/file"
|
"github.com/spotdemo4/trevstack/server/internal/handlers/file"
|
||||||
@ -26,9 +26,6 @@ import (
|
|||||||
"github.com/spotdemo4/trevstack/server/internal/interceptors"
|
"github.com/spotdemo4/trevstack/server/internal/interceptors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var clientFS *embed.FS
|
|
||||||
var dbFS *embed.FS
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{}))
|
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{}))
|
||||||
slog.SetDefault(logger)
|
slog.SetDefault(logger)
|
||||||
@ -40,7 +37,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Migrate database
|
// Migrate database
|
||||||
err = database.Migrate(env.DatabaseURL, dbFS)
|
err = database.Migrate(env.DatabaseURL, embed.DBFS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err.Error())
|
log.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
@ -59,7 +56,7 @@ func main() {
|
|||||||
|
|
||||||
// Serve web interface
|
// Serve web interface
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.Handle("/", client.NewClientHandler(env.Key, clientFS))
|
mux.Handle("/", client.NewClientHandler(env.Key, embed.ClientFS))
|
||||||
mux.Handle("/file/", file.NewFileHandler(sqlc, env.Key))
|
mux.Handle("/file/", file.NewFileHandler(sqlc, env.Key))
|
||||||
mux.Handle("/grpc/", http.StripPrefix("/grpc", api))
|
mux.Handle("/grpc/", http.StripPrefix("/grpc", api))
|
||||||
|
|
13
server/embed.go
Normal file
13
server/embed.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
//go:build !dev
|
||||||
|
|
||||||
|
package embed
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed all:client
|
||||||
|
var ClientFS embed.FS
|
||||||
|
|
||||||
|
//go:embed db/migrations/*.sql
|
||||||
|
var DBFS embed.FS
|
10
server/embed_dev.go
Normal file
10
server/embed_dev.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//go:build dev
|
||||||
|
|
||||||
|
package embed
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
)
|
||||||
|
|
||||||
|
var ClientFS embed.FS
|
||||||
|
var DBFS embed.FS
|
@ -29,5 +29,5 @@ require (
|
|||||||
golang.org/x/text v0.24.0 // indirect
|
golang.org/x/text v0.24.0 // indirect
|
||||||
modernc.org/libc v1.62.1 // indirect
|
modernc.org/libc v1.62.1 // indirect
|
||||||
modernc.org/mathutil v1.7.1 // indirect
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
modernc.org/memory v1.9.1 // indirect
|
modernc.org/memory v1.10.0 // indirect
|
||||||
)
|
)
|
||||||
|
@ -77,8 +77,8 @@ modernc.org/libc v1.62.1 h1:s0+fv5E3FymN8eJVmnk0llBe6rOxCu/DEU+XygRbS8s=
|
|||||||
modernc.org/libc v1.62.1/go.mod h1:iXhATfJQLjG3NWy56a6WVU73lWOcdYVxsvwCgoPljuo=
|
modernc.org/libc v1.62.1/go.mod h1:iXhATfJQLjG3NWy56a6WVU73lWOcdYVxsvwCgoPljuo=
|
||||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||||
modernc.org/memory v1.9.1 h1:V/Z1solwAVmMW1yttq3nDdZPJqV1rM05Ccq6KMSZ34g=
|
modernc.org/memory v1.10.0 h1:fzumd51yQ1DxcOxSO+S6X7+QTuVU+n8/Aj7swYjFfC4=
|
||||||
modernc.org/memory v1.9.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
modernc.org/memory v1.10.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||||
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
||||||
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||||
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||||
|
@ -2,6 +2,7 @@ package database
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
@ -9,8 +10,9 @@ import (
|
|||||||
_ "github.com/spotdemo4/dbmate-sqlite-modernc/pkg/driver/sqlite" // Modernc sqlite
|
_ "github.com/spotdemo4/dbmate-sqlite-modernc/pkg/driver/sqlite" // Modernc sqlite
|
||||||
)
|
)
|
||||||
|
|
||||||
func Migrate(dsn string, dbFS *embed.FS) error {
|
func Migrate(dsn string, dbFS embed.FS) error {
|
||||||
if dbFS == nil {
|
_, err := dbFS.ReadDir(".")
|
||||||
|
if err == io.EOF {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,6 +24,7 @@ func Migrate(dsn string, dbFS *embed.FS) error {
|
|||||||
db := dbmate.New(dburl)
|
db := dbmate.New(dburl)
|
||||||
db.Driver()
|
db.Driver()
|
||||||
db.FS = dbFS
|
db.FS = dbFS
|
||||||
|
db.AutoDumpSchema = false
|
||||||
|
|
||||||
log.Println("Migrations:")
|
log.Println("Migrations:")
|
||||||
migrations, err := db.FindMigrations()
|
migrations, err := db.FindMigrations()
|
||||||
|
@ -2,14 +2,16 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/spotdemo4/trevstack/server/internal/interceptors"
|
"github.com/spotdemo4/trevstack/server/internal/interceptors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewClientHandler(key string, clientFS *embed.FS) http.Handler {
|
func NewClientHandler(key string, clientFS embed.FS) http.Handler {
|
||||||
if clientFS == nil {
|
_, err := clientFS.ReadDir(".")
|
||||||
|
if err == io.EOF {
|
||||||
return http.NotFoundHandler()
|
return http.NotFoundHandler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
//go:build !dev
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"embed"
|
|
||||||
"log"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed all:client
|
|
||||||
var cFS embed.FS
|
|
||||||
|
|
||||||
//go:embed db/migrations/*.sql
|
|
||||||
var dFS embed.FS
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
log.Println("initializing for production")
|
|
||||||
clientFS = &cFS
|
|
||||||
dbFS = &dFS
|
|
||||||
}
|
|
Reference in New Issue
Block a user