diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56c5fc7..084365b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,3 +82,22 @@ jobs: run: bash scripts/pressure-test-governance.sh - name: Lint (skipped) run: echo "no linter configured" + + build-ui: + runs-on: ubuntu-latest + needs: + - workflow-secret-policy + - secret-scan + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ui/package-lock.json + - name: Install + run: npm ci + working-directory: ui + - name: Build (includes typecheck) + run: npm run build + working-directory: ui diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..3378f50 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,61 @@ +name: Deploy Pages + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - 'ui/**' + - '.github/workflows/deploy-pages.yml' + +jobs: + get-credentials: + runs-on: ubuntu-latest + outputs: + cloudflare_token: ${{ steps.creds.outputs.cloudflare_token }} + account_id: ${{ steps.creds.outputs.account_id }} + steps: + - uses: actions/checkout@v4 + with: + repository: CHITTYOS/chittyops + sparse-checkout: .github/actions/getchitty-creds + path: .chittyops + + - name: Fetch ephemeral credentials + id: creds + uses: ./.chittyops/.github/actions/getchitty-creds + with: + api_key: ${{ secrets.CHITTYCONNECT_API_KEY }} + purpose: 'pages-deploy' + service: 'chittycommand-ui' + + deploy: + needs: get-credentials + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ui/package-lock.json + + - name: Install dependencies + run: npm ci + working-directory: ui + + - name: Build + run: npm run build + working-directory: ui + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ needs.get-credentials.outputs.cloudflare_token }} + accountId: ${{ needs.get-credentials.outputs.account_id }} + command: pages deploy dist --project-name=chittycommand-ui + workingDirectory: ui diff --git a/package-lock.json b/package-lock.json index 14f24ce..53f56a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,14 +33,14 @@ } }, "node_modules/@cloudflare/unenv-preset": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.14.0.tgz", - "integrity": "sha512-XKAkWhi1nBdNsSEoNG9nkcbyvfUrSjSf+VYVPfOto3gLTZVc3F4g6RASCMh6IixBKCG2yDgZKQIHGKtjcnLnKg==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.15.0.tgz", + "integrity": "sha512-EGYmJaGZKWl+X8tXxcnx4v2bOZSjQeNI5dWFeXivgX9+YCT69AkzHHwlNbVpqtEUTbew8eQurpyOpeN8fg00nw==", "dev": true, "license": "MIT OR Apache-2.0", "peerDependencies": { "unenv": "2.0.0-rc.24", - "workerd": "^1.20260218.0" + "workerd": "1.20260301.1 || ~1.20260302.1 || ~1.20260303.1 || ~1.20260304.1 || >1.20260305.0 <2.0.0-0" }, "peerDependenciesMeta": { "workerd": { @@ -49,9 +49,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260219.0.tgz", - "integrity": "sha512-k+xM+swQBQnkrvwobjRPxyeYwjLSludJusR0PqeHe+h6X9QIRGgw3s1AO38lXQsqzMSgG5709oOXSF19NKVVaQ==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260312.1.tgz", + "integrity": "sha512-HUAtDWaqUduS6yasV6+NgsK7qBpP1qGU49ow/Wb117IHjYp+PZPUGReDYocpB4GOMRoQlvdd4L487iFxzdARpw==", "cpu": [ "x64" ], @@ -66,9 +66,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260219.0.tgz", - "integrity": "sha512-EyfQdsG1KcIVAf4qndT00LZly7sLFm1VxMWHBvOFB/EVYF2sE5HZ0dPbe+yrax5p3eS0oLZthR8ynhz4UulMUQ==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260312.1.tgz", + "integrity": "sha512-DOn7TPTHSxJYfi4m4NYga/j32wOTqvJf/pY4Txz5SDKWIZHSTXFyGz2K4B+thoPWLop/KZxGoyTv7db0mk/qyw==", "cpu": [ "arm64" ], @@ -83,9 +83,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260219.0.tgz", - "integrity": "sha512-N0UHXILYYa6htFO/uC92uAqusvynbSbOcHcrVXMKqP9Jy7eqXGMovyKIrNgzYnKIszNB+0lfUYdGI3Wci07LuA==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260312.1.tgz", + "integrity": "sha512-TdkIh3WzPXYHuvz7phAtFEEvAxvFd30tHrm4gsgpw0R0F5b8PtoM3hfL2uY7EcBBWVYUBtkY2ahDYFfufnXw/g==", "cpu": [ "x64" ], @@ -100,9 +100,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260219.0.tgz", - "integrity": "sha512-835pjQ9uuAtwPBOAkPf+oxH3mNE5mqWuE3H7hJsul7WZsRD2FDcariyoT2AW6xyOePILrn4uMnmG1KGc9m/8Pg==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260312.1.tgz", + "integrity": "sha512-kNauZhL569Iy94t844OMwa1zP6zKFiL3xiJ4tGLS+TFTEfZ3pZsRH6lWWOtkXkjTyCmBEOog0HSEKjIV4oAffw==", "cpu": [ "arm64" ], @@ -117,9 +117,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260219.0.tgz", - "integrity": "sha512-i7qcuOsuAxqqn1n5Ar3Rh1dHUL9vNmpF9FcdMTT84jIrdm5UNrPZz5grJthPmpB9LTcreT9iiP6qKbzGjnCwPA==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260312.1.tgz", + "integrity": "sha512-5dBrlSK+nMsZy5bYQpj8t9iiQNvCRlkm9GGvswJa9vVU/1BNO4BhJMlqOLWT24EmFyApZ+kaBiPJMV8847NDTg==", "cpu": [ "x64" ], @@ -134,9 +134,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20260302.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260302.0.tgz", - "integrity": "sha512-mbFRnlu1lNCScMpXZk/X/uBPufYx5OSbq+euGonGRcY+DgOwm2kczGdK401rUh52NB0fFMEcOy/zqwxv7CdDNA==", + "version": "4.20260316.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260316.1.tgz", + "integrity": "sha512-HUZ+vQD8/1A4Fz/8WAlzYWcS5W5u3Nu7Dv9adkIkmLfeKqMIRn01vc4nSUBar60KkmohyQHkPi8jtWV/zazvAg==", "devOptional": true, "license": "MIT OR Apache-2.0" }, @@ -161,9 +161,9 @@ "license": "Apache-2.0" }, "node_modules/@emnapi/runtime": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", - "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.0.tgz", + "integrity": "sha512-QN75eB0IH2ywSpRpNddCRfQIhmJYBCJ1x5Lb3IscKAL8bMnVAKnRg8dCoXbHzVLLH7P38N2Z3mtulB7W0J0FKw==", "dev": true, "license": "MIT", "optional": true, @@ -1060,9 +1060,9 @@ } }, "node_modules/@img/colour": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", - "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", "dev": true, "license": "MIT", "engines": { @@ -2551,9 +2551,9 @@ } }, "node_modules/hono": { - "version": "4.12.5", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.5.tgz", - "integrity": "sha512-3qq+FUBtlTHhtYxbxheZgY8NIFnkkC/MR8u5TTsr7YZ3wixryQ3cCwn3iZbg8p8B88iDBBAYSfZDS75t8MN7Vg==", + "version": "4.12.8", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.8.tgz", + "integrity": "sha512-VJCEvtrezO1IAR+kqEYnxUOoStaQPGrCmX3j4wDTNOcD1uRPFpGlwQUIW8niPuvHXaTUxeOUl5MMDGrl+tmO9A==", "license": "MIT", "engines": { "node": ">=16.9.0" @@ -2580,16 +2580,16 @@ } }, "node_modules/miniflare": { - "version": "4.20260219.0", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260219.0.tgz", - "integrity": "sha512-EIb5wXbWUnnC60XU2aiFOPNd4fgTXzECkwRSOXZ1vdcY9WZaEE9rVf+h+Apw+WkOHRkp3Dr9/ZhQ5y1R+9iZ4Q==", + "version": "4.20260312.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260312.0.tgz", + "integrity": "sha512-pieP2rfXynPT6VRINYaiHe/tfMJ4c5OIhqRlIdLF6iZ9g5xgpEmvimvIgMpgAdDJuFlrLcwDUi8MfAo2R6dt/w==", "dev": true, "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "^0.34.5", "undici": "7.18.2", - "workerd": "1.20260219.0", + "workerd": "1.20260312.1", "ws": "8.18.0", "youch": "4.1.0-beta.10" }, @@ -3038,9 +3038,9 @@ } }, "node_modules/undici": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", - "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.4.tgz", + "integrity": "sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w==", "dev": true, "license": "MIT", "engines": { @@ -3667,9 +3667,9 @@ } }, "node_modules/workerd": { - "version": "1.20260219.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260219.0.tgz", - "integrity": "sha512-l4U4iT5H8jNV6+EK23ExnUV2z6JvqQtQPrT8XCm4G8RpwC9EPpYTOO9s/ImMPJKe1WSbQUQoJ4k8Nd83fz8skQ==", + "version": "1.20260312.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260312.1.tgz", + "integrity": "sha512-nNpPkw9jaqo79B+iBCOiksx+N62xC+ETIfyzofUEdY3cSOHJg6oNnVSHm7vHevzVblfV76c8Gr0cXHEapYMBEg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -3680,28 +3680,28 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20260219.0", - "@cloudflare/workerd-darwin-arm64": "1.20260219.0", - "@cloudflare/workerd-linux-64": "1.20260219.0", - "@cloudflare/workerd-linux-arm64": "1.20260219.0", - "@cloudflare/workerd-windows-64": "1.20260219.0" + "@cloudflare/workerd-darwin-64": "1.20260312.1", + "@cloudflare/workerd-darwin-arm64": "1.20260312.1", + "@cloudflare/workerd-linux-64": "1.20260312.1", + "@cloudflare/workerd-linux-arm64": "1.20260312.1", + "@cloudflare/workerd-windows-64": "1.20260312.1" } }, "node_modules/wrangler": { - "version": "4.67.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.67.0.tgz", - "integrity": "sha512-58OoVth7bqm0nqsRgcI67gHbpp0IfR1JIBqDY0XR1FzRu9Qkjn6v2iJAdFf82QcVBFhaMBYQi88WqYGswq5wlQ==", + "version": "4.73.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.73.0.tgz", + "integrity": "sha512-VJXsqKDFCp6OtFEHXITSOR5kh95JOknwPY8m7RyQuWJQguSybJy43m4vhoCSt42prutTef7eeuw7L4V4xiynGw==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { "@cloudflare/kv-asset-handler": "0.4.2", - "@cloudflare/unenv-preset": "2.14.0", + "@cloudflare/unenv-preset": "2.15.0", "blake3-wasm": "2.1.5", "esbuild": "0.27.3", - "miniflare": "4.20260219.0", + "miniflare": "4.20260312.0", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.24", - "workerd": "1.20260219.0" + "workerd": "1.20260312.1" }, "bin": { "wrangler": "bin/wrangler.js", @@ -3714,7 +3714,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20260219.0" + "@cloudflare/workers-types": "^4.20260312.1" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { diff --git a/package.json b/package.json index c600581..3656398 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,10 @@ "typescript": "^5.5.0", "vitest": "^4.0.18", "wrangler": "^4.60.0" + }, + "overrides": { + "miniflare": { + "undici": "^7.24.0" + } } } diff --git a/ui/.env.production b/ui/.env.production new file mode 100644 index 0000000..d13ce01 --- /dev/null +++ b/ui/.env.production @@ -0,0 +1,2 @@ +VITE_API_URL=https://command.chitty.cc/api +VITE_AUTH_URL=https://command.chitty.cc/auth diff --git a/ui/wrangler.toml b/ui/wrangler.toml new file mode 100644 index 0000000..7941163 --- /dev/null +++ b/ui/wrangler.toml @@ -0,0 +1,3 @@ +name = "chittycommand-ui" +pages_build_output_dir = "dist" +compatibility_date = "2026-01-15" diff --git a/wrangler.toml b/wrangler.toml index 5b3ae80..24b432a 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -15,7 +15,7 @@ CHITTYLEDGER_URL = "https://ledger.chitty.cc" CHITTYFINANCE_URL = "https://finance.chitty.cc" CHITTYCHARGE_URL = "https://charge.chitty.cc" CHITTYCONNECT_URL = "https://connect.chitty.cc" -PLAID_ENV = "sandbox" +PLAID_ENV = "production" CHITTYBOOKS_URL = "https://chittybooks.chitty.cc" CHITTYASSETS_URL = "https://chittyassets.chitty.cc" CHITTYSCRAPE_URL = "https://scrape.chitty.cc" @@ -60,6 +60,3 @@ crons = [ "0 15 1 * *" # Monthly 1st 9 AM CT: Mortgage, property tax ] -# Production overrides -[env.production.vars] -PLAID_ENV = "production"