refactor(client): split client to cms/mobile/party
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
34
justfile
34
justfile
@@ -1,39 +1,43 @@
|
||||
project_name := "nixcn-cms"
|
||||
project_dir := justfile_directory()
|
||||
server_enrty := "main.go"
|
||||
output_dir := join(project_dir, ".outputs")
|
||||
client_dir := join(project_dir, "client")
|
||||
exec_path := join(output_dir, project_name)
|
||||
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:
|
||||
cd {{ client_dir }} && {{ pnpm_cmd }} install
|
||||
install: install-cms
|
||||
|
||||
install-cms:
|
||||
cd {{ client_cms_dir }} && {{ pnpm_cmd }} install
|
||||
|
||||
clean:
|
||||
mkdir -p .outputs
|
||||
find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} +
|
||||
|
||||
build-client:
|
||||
cd {{ client_dir }} && {{ pnpm_cmd }} run build --outDir {{ join(output_dir, "static") }}
|
||||
build-client-cms:
|
||||
cd {{ client_cms_dir }} && {{ pnpm_cmd }} run build --outDir {{ join(client_output_dir, "cms") }}
|
||||
|
||||
build-back:
|
||||
{{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }}
|
||||
{{ go_cmd }} build -o {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_entry }}
|
||||
|
||||
run-back:
|
||||
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }}
|
||||
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }}
|
||||
|
||||
test-back:
|
||||
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...
|
||||
|
||||
watch-back:
|
||||
watchexec -r -e go,yaml,tpl -i '.devenv/**' -i '.direnv/**' -i 'client/**' -i 'vendor/**' 'go build -o {{ join(output_dir, "nixcn-cms") }} . && cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ exec_path }}'
|
||||
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
|
||||
devenv up --verbose
|
||||
|
||||
client: install
|
||||
devenv up client --verbose
|
||||
dev-client-cms: install-cms
|
||||
devenv up client-cms --verbose
|
||||
|
||||
back: clean
|
||||
dev-back: clean
|
||||
devenv up backend postgres redis meilisearch --verbose
|
||||
|
||||
Reference in New Issue
Block a user