From 5a93f5261b986bf62786814975a2aa7175b58d34 Mon Sep 17 00:00:00 2001 From: Manuel Ruck Date: Wed, 1 May 2024 18:14:10 +0200 Subject: [PATCH] chore: bundestag-io setup sync mode Signed-off-by: Manuel Ruck --- bundestag.io/api/garden.yml | 10 ++++++++++ bundestag.io/api/package.json | 5 +++-- pnpm-lock.yaml | 18 +++++++++++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/bundestag.io/api/garden.yml b/bundestag.io/api/garden.yml index 11539ae86..7b0ca41c6 100644 --- a/bundestag.io/api/garden.yml +++ b/bundestag.io/api/garden.yml @@ -9,6 +9,10 @@ include: - ./infra/Dockerfile.service spec: dockerfile: ./infra/Dockerfile.service + targetStage: + $if: ${this.mode == "sync"} + $then: dev + $else: runner buildArgs: NODE_VERSION: 18.18.2 SERVICE: bundestag.io @@ -28,6 +32,12 @@ spec: kind: Deployment name: bundestag-io-api + sync: + paths: + - containerPath: /app/bundestag.io/api/src + sourcePath: src + mode: one-way + # Patch the K8s manifests for the api service so that we can set the correct image patchResources: - name: bundestag-io-api diff --git a/bundestag.io/api/package.json b/bundestag.io/api/package.json index 0c6b177cc..b54e51490 100644 --- a/bundestag.io/api/package.json +++ b/bundestag.io/api/package.json @@ -12,7 +12,8 @@ "build": "tsc", "prebuild": "pnpm run generate", "start": "node build/index.js", - "dev": "ts-node-dev --watch=resolvers,schemas --respawn src/index.ts", + "dev": "tsx watch src/index.ts", + "predev": "pnpm run generate", "lint": "pnpm lint:ts && pnpm lint:exports", "lint:es": "eslint src --ext .js,.jsx,.ts,.tsx", "lint:ts": "tsc --noEmit", @@ -50,8 +51,8 @@ "eslint-plugin-prettier": "5.0.1", "jest": "29.7.0", "prettier": "3.0.3", - "ts-node-dev": "2.0.0", "ts-unused-exports": "10.0.1", + "tsx": "^4.8.2", "typescript": "5.2.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d9720165..d44dae36a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -211,12 +211,12 @@ importers: prettier: specifier: 3.0.3 version: 3.0.3 - ts-node-dev: - specifier: 2.0.0 - version: 2.0.0(@swc/core@1.3.93(@swc/helpers@0.5.5))(@types/node@20.12.6)(typescript@5.2.2) ts-unused-exports: specifier: 10.0.1 version: 10.0.1(typescript@5.2.2) + tsx: + specifier: ^4.8.2 + version: 4.8.2 typescript: specifier: 5.2.2 version: 5.2.2 @@ -9474,6 +9474,11 @@ packages: peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + tsx@4.8.2: + resolution: {integrity: sha512-hmmzS4U4mdy1Cnzpl/NQiPUC2k34EcNSTZYVJThYKhdqTwuBeF+4cG9KUK/PFQ7KHaAaYwqlb7QfmsE2nuj+WA==} + engines: {node: '>=18.0.0'} + hasBin: true + tty@1.0.1: resolution: {integrity: sha512-yCPqGIuidycVkRigBDshlGDLKu9+p4JKtBQijtYcI7ZnWwak56vwT7y7dGGTcxG+ecjxgWQOPWuvlePmxC5S2w==} @@ -21453,6 +21458,13 @@ snapshots: tslib: 1.14.1 typescript: 5.4.4 + tsx@4.8.2: + dependencies: + esbuild: 0.20.2 + get-tsconfig: 4.7.3 + optionalDependencies: + fsevents: 2.3.3 + tty@1.0.1: {} tunnel-agent@0.6.0: