Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions project/server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ out/
*.tsbuildinfo
.envrc
.ephemeral
.nestjs_repl_history
3 changes: 2 additions & 1 deletion project/server/build/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const copyPlugin = (
{ out: "main", in: "src/entrypoint.ts" },
{ out: "main-nest", in: "src/entrypoint-nest.ts" },
{ out: "worker-database", in: "src/service/database/worker.ts" },
{ out: "repl", in: "src/repl.ts" }
{ out: "repl", in: "src/repl.ts" },
{ out: "repl-nest", in: "src/repl-nest.ts" }
],
platform: "node",
format: "esm",
Expand Down
3 changes: 2 additions & 1 deletion project/server/make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ SERVER_IN := \
SERVER_OUT_MAIN := out/server/main.mjs
SERVER_OUT_MAIN_NEST := out/server/main-nest.mjs
SERVER_OUT_REPL := out/server/repl.mjs
SERVER_OUT := $(SERVER_OUT_MAIN) $(SERVER_OUT_MAIN_NEST) $(SERVER_OUT_REPL)
SERVER_OUT_REPL_NEST := out/server/repl-nest.mjs
SERVER_OUT := $(SERVER_OUT_MAIN) $(SERVER_OUT_MAIN_NEST) $(SERVER_OUT_REPL) $(SERVER_OUT_REPL_NEST)

.PRECIOUS: $(SERVER_QUERY_OUT)

Expand Down
5 changes: 5 additions & 0 deletions project/server/make/dev.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ repl: build
SIGNING_VOUCHER=$(shell $(call secret,voucher,signing-key)) \
node --enable-source-maps --import='./$(SERVER_OUT_REPL)' $(NODE_ARGS) $(SCRIPT) $(SCRIPT_ARGS)

repl-nest: build
@ \
SIGNING_VOUCHER=$(shell $(call secret,voucher,signing-key)) \
node --enable-source-maps $(SERVER_OUT_REPL_NEST)

start-container:
@:$(call check_defined, EXTERNAL_AUTHORITY)

Expand Down
8 changes: 8 additions & 0 deletions project/server/src/repl-nest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { repl } from "@nestjs/core";

import { ModuleApp } from "./layer/app.module";

void (async () => {
const r = await repl(ModuleApp);
r.setupHistory(".nestjs_repl_history", () => {});
})();