From fa0e36d7e2bcebe47c45e349cafdb1825aee06c9 Mon Sep 17 00:00:00 2001 From: Merul Dhiman Date: Fri, 22 Aug 2025 18:02:41 +0530 Subject: [PATCH] chore: add env vars to adapter --- infrastructure/web3-adapter/package.json | 1 + .../web3-adapter/src/logging/transport.ts | 7 +- pnpm-lock.yaml | 116 +++++++++++++++--- 3 files changed, 103 insertions(+), 21 deletions(-) diff --git a/infrastructure/web3-adapter/package.json b/infrastructure/web3-adapter/package.json index 7b3eb359..0fb7779d 100644 --- a/infrastructure/web3-adapter/package.json +++ b/infrastructure/web3-adapter/package.json @@ -16,6 +16,7 @@ "dependencies": { "@types/node": "^24.0.0", "axios": "^1.6.7", + "dotenv": "^17.2.1", "evault-core": "workspace:*", "graphql-request": "^6.1.0", "pino": "^9.8.0", diff --git a/infrastructure/web3-adapter/src/logging/transport.ts b/infrastructure/web3-adapter/src/logging/transport.ts index c333bacf..ad08e272 100644 --- a/infrastructure/web3-adapter/src/logging/transport.ts +++ b/infrastructure/web3-adapter/src/logging/transport.ts @@ -1,10 +1,15 @@ import { transport as pinoTransport } from "pino"; import type { LokiOptions } from "pino-loki"; +import dotenv from "dotenv"; +import path from "path"; + +const envPath = path.resolve(__dirname, "../../../../.env") +dotenv.config({ path: envPath}) export const transport = pinoTransport({ target: "pino-loki", options: { - host: process.env.LOKI_URL || "http://localhost:3100", + host: process.env.LOKI_URL as string, labels: { app: "web3-adapter", }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c590e735..41b8b679 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -316,7 +316,7 @@ importers: version: 5.33.1 svelte-check: specifier: ^4.0.0 - version: 4.2.1(picomatch@4.0.2)(svelte@5.33.1)(typescript@5.6.3) + version: 4.2.1(picomatch@4.0.3)(svelte@5.33.1)(typescript@5.6.3) svelte-gestures: specifier: ^5.1.3 version: 5.1.4 @@ -515,6 +515,9 @@ importers: axios: specifier: ^1.6.7 version: 1.9.0 + dotenv: + specifier: ^17.2.1 + version: 17.2.1 evault-core: specifier: workspace:* version: link:../evault-core @@ -554,10 +557,10 @@ importers: version: 8.57.1 jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) ts-jest: specifier: ^29.1.0 - version: 29.3.4(@babel/core@7.27.1)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.27.1))(jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0))(typescript@5.8.3) + version: 29.3.4(@babel/core@7.27.1)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.27.1))(jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)))(typescript@5.8.3) typescript: specifier: ^5.0.4 version: 5.8.3 @@ -7313,6 +7316,10 @@ packages: resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==} engines: {node: '>=12'} + dotenv@17.2.1: + resolution: {integrity: sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==} + engines: {node: '>=12'} + draft-js@0.11.7: resolution: {integrity: sha512-ne7yFfN4sEL82QPQEn80xnADR8/Q6ALVworbC5UOSzOvjffmYfFsr3xSZtxbIirti14R7Y33EZC5rivpLgIbsg==} peerDependencies: @@ -14579,6 +14586,41 @@ snapshots: - supports-color - ts-node + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.17.50 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.17.50)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + '@jest/environment@28.1.3': dependencies: '@jest/fake-timers': 28.1.3 @@ -19588,13 +19630,13 @@ snapshots: - supports-color - ts-node - create-jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0): + create-jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + jest-config: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -19965,6 +20007,8 @@ snapshots: dotenv@16.5.0: {} + dotenv@17.2.1: {} + draft-js@0.11.7(encoding@0.1.13)(react-dom@19.1.0(react@19.1.0))(react@19.1.0): dependencies: fbjs: 2.0.0(encoding@0.1.13) @@ -22256,16 +22300,16 @@ snapshots: - supports-color - ts-node - jest-cli@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0): + jest-cli@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.50)(typescript@5.8.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + create-jest: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + jest-config: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -22366,7 +22410,38 @@ snapshots: - babel-plugin-macros - supports-color - jest-config@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0): + jest-config@29.7.0(@types/node@20.17.50)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)): + dependencies: + '@babel/core': 7.27.1 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.27.1) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.17.50 + ts-node: 10.9.2(@types/node@24.2.0)(typescript@5.8.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)): dependencies: '@babel/core': 7.27.1 '@jest/test-sequencer': 29.7.0 @@ -22392,6 +22467,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 24.2.0 + ts-node: 10.9.2(@types/node@24.2.0)(typescript@5.8.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -22866,12 +22942,12 @@ snapshots: - supports-color - ts-node - jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0): + jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.50)(typescript@5.8.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + jest-cli: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -26011,7 +26087,7 @@ snapshots: svelte: 5.33.1 zimmerframe: 1.1.2 - svelte-check@4.2.1(picomatch@4.0.2)(svelte@5.33.1)(typescript@5.6.3): + svelte-check@4.2.1(picomatch@4.0.2)(svelte@5.33.1)(typescript@5.8.3): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 4.0.3 @@ -26019,19 +26095,19 @@ snapshots: picocolors: 1.1.1 sade: 1.8.1 svelte: 5.33.1 - typescript: 5.6.3 + typescript: 5.8.3 transitivePeerDependencies: - picomatch - svelte-check@4.2.1(picomatch@4.0.2)(svelte@5.33.1)(typescript@5.8.3): + svelte-check@4.2.1(picomatch@4.0.3)(svelte@5.33.1)(typescript@5.6.3): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 4.0.3 - fdir: 6.4.4(picomatch@4.0.2) + fdir: 6.4.4(picomatch@4.0.3) picocolors: 1.1.1 sade: 1.8.1 svelte: 5.33.1 - typescript: 5.8.3 + typescript: 5.6.3 transitivePeerDependencies: - picomatch @@ -26428,12 +26504,12 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.27.1) - ts-jest@29.3.4(@babel/core@7.27.1)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.27.1))(jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0))(typescript@5.8.3): + ts-jest@29.3.4(@babel/core@7.27.1)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.27.1))(jest@29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)))(typescript@5.8.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0) + jest: 29.7.0(@types/node@24.2.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@24.2.0)(typescript@5.8.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2