Skip to content

Commit

Permalink
Fix hot-reloading in Demo API (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyomair authored Jan 28, 2025
1 parent 800b808 commit e65a401
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
3 changes: 3 additions & 0 deletions demo/api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ lerna-debug.log*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Hot reloading for API packages
src/reload.ts
6 changes: 1 addition & 5 deletions demo/api/nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"assets": ["node_modules/@comet/**/src/**/*.ts"],
"watchAssets": true
}
"sourceRoot": "src"
}
5 changes: 4 additions & 1 deletion demo/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"mikro-orm:drop": "mikro-orm schema:drop -r",
"mikro-orm:migration:generate": "mikro-orm migration:create",
"start": "$npm_execpath prebuild && dotenv -e .env.secrets -e .env.local -e .env -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput",
"start:dev": "$npm_execpath prebuild && $npm_execpath db:migrate && $npm_execpath console createBlockIndexViews && NODE_OPTIONS='--max-old-space-size=512' dotenv -e .env.secrets -e .env.local -e .env -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput",
"start:dev": "run-p dev:*",
"dev:nest": "$npm_execpath prebuild && $npm_execpath db:migrate && $npm_execpath console createBlockIndexViews && NODE_OPTIONS='--max-old-space-size=512' dotenv -e .env.secrets -e .env.local -e .env -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput",
"dev:reload": "rimraf src/reload.ts && chokidar \"node_modules/@comet/cms-api/lib/**\" \"node_modules/@comet/blocks-api/lib/**\" -s -c \"echo '// change' >> src/reload.ts\"",
"start:prod": "node dist/main"
},
"dependencies": {
Expand Down Expand Up @@ -101,6 +103,7 @@
"@types/response-time": "^2.3.8",
"@types/rimraf": "^3.0.0",
"@types/uuid": "^8.0.0",
"chokidar-cli": "^3.0.0",
"dotenv-cli": "^7.0.0",
"eslint": "^8.0.0",
"npm-run-all": "^4.1.5",
Expand Down
17 changes: 15 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e65a401

Please sign in to comment.