From 75e63166469a48df7e976c342ce744a612f90bb3 Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Mon, 4 Nov 2024 09:16:27 +0200 Subject: [PATCH] feat(wallet/backend,boutique/backend): DEV env - add hot reload for wallet and boutique backends (#1740) * setup wallet backend hot reload * setup wallet backend hot reload dockerfile.dev * setup boutique backend hot reload * wallet hot reload watch also for shared folder changes * fix watch share path and remove chokidar env var * enable multiple types of local environment run configurations * pretty fix * fix pnpm lock --- README.md | 14 ++- boutique-entrypoint.sh | 12 +++ docker/dev/docker-compose.yml | 13 +++ package.json | 7 +- packages/boutique/backend/Dockerfile.dev | 15 +++- packages/boutique/backend/package.json | 1 + packages/wallet/backend/Dockerfile.dev | 13 ++- packages/wallet/backend/package.json | 1 + pnpm-lock.yaml | 106 +++++++++++++++++------ wallet-entrypoint.sh | 12 +++ 10 files changed, 159 insertions(+), 35 deletions(-) create mode 100644 boutique-entrypoint.sh create mode 100644 wallet-entrypoint.sh diff --git a/README.md b/README.md index 313c60f69..508577acd 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,19 @@ If you would like to set up e-commerce application, you will need to create a US Navigate to the project's root directory and execute: ```sh -pnpm dev +pnpm dev #this will start the project in hot reload mode for backend containers. Frontend containers have hot reload functionality enabled on all dev commads +``` + +other options to start the local env are: + +```sh +pnpm dev:debug #backend containers will not have hot reload feture enabled but will expose and have node `--inspect` option set with wallet container debug port set to 9229 and boutique port set to 9230. Once the containers are running, you can connect your debugger (e.g., Chrome DevTools, VS Code) +``` + +and: + +```sh +pnpm dev:lite #backend containers will build and run the builds, no debug and no hot reload for these containers ``` Upon executing the above command, the following will be available diff --git a/boutique-entrypoint.sh b/boutique-entrypoint.sh new file mode 100644 index 000000000..61289f7aa --- /dev/null +++ b/boutique-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$DEV_MODE" = "lite" ]; then + echo "DEV_MODE is lite, running default command..." + exec node ./packages/boutique/backend/dist/index.js +elif [ "$DEV_MODE" = "debug" ]; then + echo "DEV_MODE is debug, running build with debug port $DEBUG_PORT open..." + exec node --inspect=0.0.0.0:${DEBUG_PORT} ./packages/boutique/backend/dist/index.js +else + echo "DEV_MODE is hot-reload, running dev command with nodemon watcher and rebuild..." + exec pnpm boutique:backend dev +fi \ No newline at end of file diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index d7b8d5810..56657ec03 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -27,14 +27,20 @@ services: container_name: wallet-backend build: context: ../.. + args: + DEV_MODE: ${DEV_MODE} dockerfile: ./packages/wallet/backend/Dockerfile.dev depends_on: - postgres - rafiki-backend - redis + volumes: + - ../../packages/wallet/backend:/home/testnet/packages/wallet/backend + - ../../packages/wallet/shared:/home/testnet/packages/wallet/shared environment: NODE_ENV: development PORT: 3003 + DEBUG_PORT: 9229 DATABASE_URL: postgres://wallet_backend:wallet_backend@postgres/wallet_backend COOKIE_NAME: testnet.cookie COOKIE_PASSWORD: testnet.cookie.password.super.secret.ilp @@ -76,12 +82,18 @@ services: container_name: boutique-backend build: context: ../.. + args: + DEV_MODE: ${DEV_MODE} dockerfile: ./packages/boutique/backend/Dockerfile.dev + volumes: + - ../../packages/boutique/backend:/home/testnet/packages/boutique/backend + - ../../packages/boutique/shared:/home/testnet/packages/boutique/shared depends_on: - postgres environment: NODE_ENV: development PORT: 3004 + DEBUG_PORT: 9230 DATABASE_URL: postgres://boutique_backend:boutique_backend@postgres/boutique_backend PRIVATE_KEY: ${PRIVATE_KEY} KEY_ID: ${KEY_ID} @@ -91,6 +103,7 @@ services: - testnet ports: - '3004:3004' + - '9230:9230' # Map debugger port to local machine's port 9230 <<: *logging # Rafiki diff --git a/package.json b/package.json index 68fae584d..cf87ab963 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,16 @@ "clean:builds": "find . \\( -name \"dist\" -o -name \".next\" \\) -type d -prune -exec rm -rf '{}' +", "clean:modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +", "dev": "pnpm localenv:start && concurrently -n 'WALLET,BOUTIQUE' -c blue.bold,red.bold 'pnpm wallet:frontend dev' 'pnpm boutique:frontend dev'", + "dev:debug": "pnpm localenv:start:debug && concurrently -n 'WALLET,BOUTIQUE' -c blue.bold,red.bold 'pnpm wallet:frontend dev' 'pnpm boutique:frontend dev'", + "dev:lite": "pnpm localenv:start:lite && concurrently -n 'WALLET,BOUTIQUE' -c blue.bold,red.bold 'pnpm wallet:frontend dev' 'pnpm boutique:frontend dev'", "format": "pnpm prettier:write && pnpm lint:fix", "lint:check": "eslint --max-warnings=0 .", "lint:fix": "eslint --max-warnings=0 --fix .", "compose": "docker compose -f ./docker/dev/docker-compose.yml", "compose:prod": "docker compose -f ./docker/prod/docker-compose.yml", - "localenv:start": "pnpm compose up -d --build", + "localenv:start": "DEV_MODE=hot-reload pnpm compose up -d --build", + "localenv:start:debug": "DEV_MODE=debug pnpm compose up -d --build", + "localenv:start:lite": "DEV_MODE=lite pnpm compose up -d --build", "localenv:stop": "pnpm compose down", "preinstall": "npx only-allow pnpm", "prettier:write": "prettier --config '.prettierrc.js' --write .", @@ -44,6 +48,7 @@ "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^4.6.2", "globals": "^15.10.0", + "nodemon": "^3.1.7", "only-allow": "^1.2.1", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", diff --git a/packages/boutique/backend/Dockerfile.dev b/packages/boutique/backend/Dockerfile.dev index ccc87d771..b55f45b98 100644 --- a/packages/boutique/backend/Dockerfile.dev +++ b/packages/boutique/backend/Dockerfile.dev @@ -12,7 +12,7 @@ RUN corepack enable RUN corepack prepare pnpm@9.1.4 --activate # Copy lockfile, NVM and NPM configuration to the working directory -COPY pnpm-lock.yaml .nvmrc .npmrc ./ +COPY pnpm-lock.yaml .nvmrc .npmrc boutique-entrypoint.sh ./ # Fetch packages from lockfile (https://pnpm.io/cli/fetch#usage-scenario) RUN pnpm fetch @@ -23,7 +23,16 @@ ADD . ./ # Install packages from virtual store RUN pnpm install -r --offline -# Build backend RUN pnpm boutique:backend build -CMD ["node", "./packages/boutique/backend/dist/index.js"] +# Expose debugger port regardlless of DEV_MODE +EXPOSE ${DEBUG_PORT} + +ARG DEV_MODE + +# Set it as an environment variable +ENV DEV_MODE=${DEV_MODE} + +RUN chmod +x /home/testnet/boutique-entrypoint.sh + +ENTRYPOINT ["/home/testnet/boutique-entrypoint.sh"] diff --git a/packages/boutique/backend/package.json b/packages/boutique/backend/package.json index 5e86a0f6a..651b8b77a 100644 --- a/packages/boutique/backend/package.json +++ b/packages/boutique/backend/package.json @@ -4,6 +4,7 @@ "start": "node dist/index.js", "build:deps": "pnpm --filter @shared/backend build && pnpm --filter @boutique/shared build", "build": "pnpm build:deps && tsc --build tsconfig.build.json && tsc-alias -p tsconfig.build.json", + "dev": "nodemon --watch ./src --watch ../shared/src --ext ts,json --delay 0.5 --exec \"pnpm run build && node ./dist/index.js\"", "test": "pnpm build:deps && NODE_OPTIONS='--experimental-vm-modules' jest --passWithNoTests --maxWorkers=2" }, "dependencies": { diff --git a/packages/wallet/backend/Dockerfile.dev b/packages/wallet/backend/Dockerfile.dev index 8dd338959..8c480a4f0 100644 --- a/packages/wallet/backend/Dockerfile.dev +++ b/packages/wallet/backend/Dockerfile.dev @@ -12,7 +12,7 @@ RUN corepack enable RUN corepack prepare pnpm@9.1.4 --activate # Copy lockfile, NVM and NPM configuration to the working directory -COPY pnpm-lock.yaml .nvmrc .npmrc ./ +COPY pnpm-lock.yaml .nvmrc .npmrc wallet-entrypoint.sh ./ # Fetch packages from lockfile (https://pnpm.io/cli/fetch#usage-scenario) RUN pnpm fetch @@ -27,6 +27,13 @@ RUN pnpm install -r --offline RUN pnpm wallet:backend build # Expose debugger port -EXPOSE 9229 +EXPOSE ${DEBUG_PORT} -CMD ["node", "--inspect=0.0.0.0:9229", "./packages/wallet/backend/dist/index.js"] +ARG DEV_MODE + +# Set it as an environment variable +ENV DEV_MODE=${DEV_MODE} + +RUN chmod +x /home/testnet/wallet-entrypoint.sh + +ENTRYPOINT ["/home/testnet/wallet-entrypoint.sh"] diff --git a/packages/wallet/backend/package.json b/packages/wallet/backend/package.json index adab933ef..2f1e7c2ec 100644 --- a/packages/wallet/backend/package.json +++ b/packages/wallet/backend/package.json @@ -4,6 +4,7 @@ "start": "node -r tsconfig-paths/register dist/index.js", "build:deps": "pnpm --filter @shared/backend build && pnpm --filter @wallet/shared build", "build": "pnpm build:deps && tsc --build tsconfig.build.json && tsc-alias -p tsconfig.build.json", + "dev": "nodemon --watch ./src --watch ../shared/src --ext ts,json --delay 1 --exec \"pnpm run build && node ./dist/index.js\"", "test": "jest --passWithNoTests --maxWorkers=75%", "generate": "graphql-codegen --config codegen.yml" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 803744742..274eaa5a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: globals: specifier: ^15.10.0 version: 15.10.0 + nodemon: + specifier: ^3.1.7 + version: 3.1.7 only-allow: specifier: ^1.2.1 version: 1.2.1 @@ -4027,6 +4030,9 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore-by-default@1.0.1: + resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -4854,6 +4860,11 @@ packages: node-rsa@1.1.1: resolution: {integrity: sha512-Jd4cvbJMryN21r5HgxQOpMEqv+ooke/korixNNK3mGqfGJmy0M77WDDzo/05969+OkMy3XW1UuZsSmW9KQm7Fw==} + nodemon@3.1.7: + resolution: {integrity: sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==} + engines: {node: '>=10'} + hasBin: true + normalize-path@2.1.1: resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} engines: {node: '>=0.10.0'} @@ -5318,6 +5329,9 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pstree.remy@1.1.8: + resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==} + pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} @@ -5694,6 +5708,10 @@ packages: simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + simple-update-notifier@2.0.0: + resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} + engines: {node: '>=10'} + sirv@1.0.19: resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==} engines: {node: '>= 10'} @@ -6009,6 +6027,10 @@ packages: resolution: {integrity: sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==} engines: {node: '>=6'} + touch@3.1.1: + resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==} + hasBin: true + tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -6130,6 +6152,9 @@ packages: uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + undefsafe@2.0.5: + resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} + undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} @@ -6508,7 +6533,7 @@ snapshots: '@babel/traverse': 7.25.3 '@babel/types': 7.25.2 convert-source-map: 2.0.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -6868,7 +6893,7 @@ snapshots: '@babel/parser': 7.25.3 '@babel/template': 7.25.0 '@babel/types': 7.25.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -7043,7 +7068,7 @@ snapshots: '@eslint/config-array@0.18.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -7053,7 +7078,7 @@ snapshots: '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) espree: 10.2.0 globals: 14.0.0 ignore: 5.3.2 @@ -7509,7 +7534,7 @@ snapshots: '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.9.21 chalk: 4.1.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) dotenv: 16.4.5 graphql: 16.9.0 graphql-request: 6.1.0(graphql@16.9.0) @@ -8799,7 +8824,7 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2) '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) eslint: 9.12.0(jiti@1.21.6) optionalDependencies: typescript: 5.6.2 @@ -8815,7 +8840,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2) '@typescript-eslint/utils': 7.18.0(eslint@9.12.0(jiti@1.21.6))(typescript@5.6.2) - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) eslint: 9.12.0(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.6.2) optionalDependencies: @@ -8829,7 +8854,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 @@ -8896,13 +8921,13 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color agent-base@7.1.1: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -9661,9 +9686,11 @@ snapshots: dependencies: ms: 2.1.2 - debug@4.3.6: + debug@4.3.6(supports-color@5.5.0): dependencies: ms: 2.1.2 + optionalDependencies: + supports-color: 5.5.0 decamelize@1.2.0: {} @@ -9735,7 +9762,7 @@ snapshots: docker-modem@3.0.8: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) readable-stream: 3.6.2 split-ca: 1.0.1 ssh2: 1.15.0 @@ -9816,7 +9843,7 @@ snapshots: engine.io-client@6.6.1: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) engine.io-parser: 5.2.3 ws: 8.17.1 xmlhttprequest-ssl: 2.1.1 @@ -9836,7 +9863,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) engine.io-parser: 5.2.3 ws: 8.17.1 transitivePeerDependencies: @@ -10034,7 +10061,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) escape-string-regexp: 4.0.0 eslint-scope: 8.1.0 eslint-visitor-keys: 4.1.0 @@ -10578,14 +10605,14 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -10596,14 +10623,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -10615,6 +10642,8 @@ snapshots: ieee754@1.2.1: {} + ignore-by-default@1.0.1: {} + ignore@5.3.2: {} immutable@3.7.6: {} @@ -10676,7 +10705,7 @@ snapshots: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -10873,7 +10902,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -11318,7 +11347,7 @@ snapshots: content-disposition: 0.5.4 content-type: 1.0.5 cookies: 0.9.1 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -11604,6 +11633,19 @@ snapshots: dependencies: asn1: 0.2.6 + nodemon@3.1.7: + dependencies: + chokidar: 3.6.0 + debug: 4.3.6(supports-color@5.5.0) + ignore-by-default: 1.0.1 + minimatch: 3.1.2 + pstree.remy: 1.1.8 + semver: 7.6.3 + simple-update-notifier: 2.0.0 + supports-color: 5.5.0 + touch: 3.1.1 + undefsafe: 2.0.5 + normalize-path@2.1.1: dependencies: remove-trailing-separator: 1.1.0 @@ -12031,6 +12073,8 @@ snapshots: proxy-from-env@1.1.0: {} + pstree.remy@1.1.8: {} + pump@3.0.0: dependencies: end-of-stream: 1.4.4 @@ -12497,6 +12541,10 @@ snapshots: dependencies: is-arrayish: 0.3.2 + simple-update-notifier@2.0.0: + dependencies: + semver: 7.6.3 + sirv@1.0.19: dependencies: '@polka/url': 1.0.0-next.25 @@ -12526,7 +12574,7 @@ snapshots: socket.io-adapter@2.5.5: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) ws: 8.17.1 transitivePeerDependencies: - bufferutil @@ -12536,7 +12584,7 @@ snapshots: socket.io-client@4.8.0: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) engine.io-client: 6.6.1 socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -12547,7 +12595,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -12556,7 +12604,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) engine.io: 6.6.1 socket.io-adapter: 2.5.5 socket.io-parser: 4.2.4 @@ -12842,7 +12890,7 @@ snapshots: archiver: 7.0.1 async-lock: 1.4.1 byline: 5.0.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) docker-compose: 0.24.8 dockerode: 3.3.5 get-port: 5.1.1 @@ -12901,6 +12949,8 @@ snapshots: totalist@1.1.0: {} + touch@3.1.1: {} + tr46@0.0.3: {} tree-changes@0.11.2: @@ -13021,6 +13071,8 @@ snapshots: uncrypto@0.1.3: {} + undefsafe@2.0.5: {} + undici-types@5.26.5: {} undici-types@6.19.8: diff --git a/wallet-entrypoint.sh b/wallet-entrypoint.sh new file mode 100644 index 000000000..eb3308c20 --- /dev/null +++ b/wallet-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$DEV_MODE" = "lite" ]; then + echo "DEV_MODE is lite, running default command..." + exec node ./packages/wallet/backend/dist/index.js +elif [ "$DEV_MODE" = "debug" ]; then + echo "DEV_MODE is debug, running build with debug port $DEBUG_PORT open..." + exec node --inspect=0.0.0.0:${DEBUG_PORT} ./packages/wallet/backend/dist/index.js +else + echo "DEV_MODE is hot-reload, running dev command with nodemon watcher and rebuild..." + exec pnpm wallet:backend dev +fi