From f17c88547b002285c4dcf310d00f7f3ddfb658a3 Mon Sep 17 00:00:00 2001 From: Asai Neko Date: Wed, 18 Feb 2026 14:17:34 +0800 Subject: [PATCH] Remove client components from devenv and justfile Signed-off-by: Asai Neko --- devenv.nix | 8 +------- justfile | 37 ++++++++++--------------------------- 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/devenv.nix b/devenv.nix index 3f7360c..e9f17d6 100644 --- a/devenv.nix +++ b/devenv.nix @@ -26,18 +26,12 @@ enable = true; version = "1.25.5"; }; - javascript.enable = true; - javascript.corepack.enable = true; }; env.PODMAN_COMPOSE_PROVIDER = "none"; processes = { - client-cms = { - exec = "pnpm run dev"; - cwd = "./client/cms"; - }; - backend.exec = "sleep 30 && just watch-back"; + server.exec = "sleep 30 && just watch"; lgtm.exec = '' podman rm -f lgtm || true podman run --name lgtm \ diff --git a/justfile b/justfile index afa73bd..f2e12e6 100644 --- a/justfile +++ b/justfile @@ -1,52 +1,35 @@ project_name := "nixcn-cms" go_cmd := `realpath $(which go)` -pnpm_cmd := `realpath $(which pnpm)` project_dir := justfile_directory() output_dir := join(project_dir, ".outputs") -client_dir := join(project_dir, "client") -client_output_dir := join(output_dir, "client") -client_cms_dir := join(client_dir, "cms") server_exec_path := join(output_dir, project_name) server_entry := "main.go" -install: install-cms install-back +install: + go install github.com/swaggo/swag/cmd/swag@latest + cd {{ project_dir }} && go mod tidy -generate: gen-back - -install-cms: - cd {{ client_cms_dir }} && {{ pnpm_cmd }} install +generate: + cd {{ project_dir }} && go generate . clean: mkdir -p .outputs find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} + -build-client-cms: - cd {{ client_cms_dir }} && {{ pnpm_cmd }} run build --outDir {{ join(client_output_dir, "cms") }} - -build-back: +build: {{ go_cmd }} build -o {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_entry }} -install-back: - go install github.com/swaggo/swag/cmd/swag@latest - cd {{ project_dir }} && go mod tidy - -run-back: +run: cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} -test-back: +test: cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./... -gen-back: - cd {{ project_dir }} && go generate . - -watch-back: +watch: watchexec -r -e go,yaml,tpl -i '.devenv/**' -i '.direnv/**' -i 'client/**' -i 'vendor/**' 'go build -o {{ server_exec_path }} . && cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}' dev: clean install generate devenv up --verbose -dev-client-cms: install-cms - devenv up client-cms --verbose - -dev-back: clean install-back gen-back +back: clean install generate devenv up postgres redis lgtm --verbose