From b20a0a4fa582309206fcbd5cb5d19eb71d7fce46 Mon Sep 17 00:00:00 2001 From: Kelly Date: Wed, 10 Dec 2025 08:12:04 -0700 Subject: [PATCH] fix: Add generic delete method to ApiClient + CI speedups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add delete() method to ApiClient for WorkersDashboard cleanup - Add npm cache volume for faster npm ci - Add TypeScript incremental builds with tsBuildInfoFile cache - Should significantly speed up repeated CI runs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .woodpecker/.ci.yml | 26 ++++++++++++++++++-------- backend/src/index.ts | 1 - cannaiq/src/lib/api.ts | 7 +++++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.woodpecker/.ci.yml b/.woodpecker/.ci.yml index 1d23337a..660f6b22 100644 --- a/.woodpecker/.ci.yml +++ b/.woodpecker/.ci.yml @@ -1,46 +1,56 @@ when: - event: [push, pull_request] +# Volume mounts for caching npm and TypeScript across builds +variables: + - &node_volumes + - npm-cache:/root/.npm + - tsc-cache:/tmp/tsc-cache + steps: # =========================================== # PR VALIDATION: Parallel type checks (PRs only) # =========================================== typecheck-backend: image: code.cannabrands.app/creationshop/node:20 + volumes: *node_volumes commands: - cd backend - - npm ci --prefer-offline - - npx tsc --noEmit + - npm ci --prefer-offline --cache /root/.npm + - npx tsc --incremental --tsBuildInfoFile /tmp/tsc-cache/backend.tsbuildinfo --noEmit depends_on: [] when: event: pull_request typecheck-cannaiq: image: code.cannabrands.app/creationshop/node:20 + volumes: *node_volumes commands: - cd cannaiq - - npm ci --prefer-offline - - npx tsc --noEmit + - npm ci --prefer-offline --cache /root/.npm + - npx tsc --incremental --tsBuildInfoFile /tmp/tsc-cache/cannaiq.tsbuildinfo --noEmit depends_on: [] when: event: pull_request typecheck-findadispo: image: code.cannabrands.app/creationshop/node:20 + volumes: *node_volumes commands: - cd findadispo/frontend - - npm ci --prefer-offline - - npx tsc --noEmit 2>/dev/null || true + - npm ci --prefer-offline --cache /root/.npm + - npx tsc --incremental --tsBuildInfoFile /tmp/tsc-cache/findadispo.tsbuildinfo --noEmit 2>/dev/null || true depends_on: [] when: event: pull_request typecheck-findagram: image: code.cannabrands.app/creationshop/node:20 + volumes: *node_volumes commands: - cd findagram/frontend - - npm ci --prefer-offline - - npx tsc --noEmit 2>/dev/null || true + - npm ci --prefer-offline --cache /root/.npm + - npx tsc --incremental --tsBuildInfoFile /tmp/tsc-cache/findagram.tsbuildinfo --noEmit 2>/dev/null || true depends_on: [] when: event: pull_request diff --git a/backend/src/index.ts b/backend/src/index.ts index 4be0011e..89198438 100755 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -129,7 +129,6 @@ import { createStatesRouter } from './routes/states'; import { createAnalyticsV2Router } from './routes/analytics-v2'; import { createDiscoveryRoutes } from './discovery'; import pipelineRoutes from './routes/pipeline'; -import { getPool } from './db/pool'; // Consumer API routes (findadispo.com, findagram.co) import consumerAuthRoutes from './routes/consumer-auth'; diff --git a/cannaiq/src/lib/api.ts b/cannaiq/src/lib/api.ts index b96f7fd9..c1df5b10 100755 --- a/cannaiq/src/lib/api.ts +++ b/cannaiq/src/lib/api.ts @@ -69,6 +69,13 @@ class ApiClient { return { data }; } + async delete(endpoint: string): Promise<{ data: T }> { + const data = await this.request(endpoint, { + method: 'DELETE', + }); + return { data }; + } + // Auth async login(email: string, password: string) { return this.request<{ token: string; user: any }>('/api/auth/login', {