yjcli 0.2.4__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yjcli-0.2.4 → yjcli-0.2.5}/PKG-INFO +55 -7
- {yjcli-0.2.4 → yjcli-0.2.5}/README.md +54 -6
- {yjcli-0.2.4 → yjcli-0.2.5}/pyproject.toml +1 -1
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-arch-core/SKILL.md +52 -6
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-backend-msa/SKILL.md +32 -2
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-backend-service/SKILL.md +25 -1
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-browser-extension/SKILL.md +7 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-cli/SKILL.md +6 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-frontend/SKILL.md +20 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-scheduler/SKILL.md +25 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/AGENTS.md +17 -6
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/Makefile +17 -3
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/make.bat +34 -8
- yjcli-0.2.4/src/yjcli/data/templates/platform/scripts/deploy-common.sh → yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/build-common.sh +20 -6
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/build-development.sh +9 -0
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/build-production.sh +9 -0
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/deploy-common.sh +28 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/scripts/deploy-development.sh +3 -1
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/scripts/deploy-production.sh +3 -1
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/plugin-build-docker.sh +95 -0
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/plugin-build-proto.sh +25 -0
- yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/plugin-build-ssr.sh +34 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/scripts/run.bat +1 -1
- yjcli-0.2.5/src/yjcli/data/templates/platform/service/.dockerignore +17 -0
- yjcli-0.2.5/src/yjcli/data/templates/platform/service/Dockerfile +44 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/services/scaffold.py +47 -4
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/services/sync.py +12 -14
- yjcli-0.2.4/src/yjcli/data/templates/platform/scripts/deploy-common.bat +0 -33
- yjcli-0.2.4/src/yjcli/data/templates/platform/scripts/deploy-development.bat +0 -21
- yjcli-0.2.4/src/yjcli/data/templates/platform/scripts/deploy-production.bat +0 -21
- {yjcli-0.2.4 → yjcli-0.2.5}/.gitignore +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/LICENSE +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/__init__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/__main__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/cli.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/commands/__init__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/commands/init_cmd.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/commands/platform.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/commands/service.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/commands/sync.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/__init__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-mobile-app/SKILL.md +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/skills/yj-pc-app/SKILL.md +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/.gitignore +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/Diff.md +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/TOOLS.md +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/app/.env.development +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/app/.env.examples +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/app/.env.local-dev +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/app/.env.production +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/listen/.env.development +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/listen/.env.examples +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/listen/.env.local-dev +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/listen/.env.production +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/worker/.env.development +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/worker/.env.examples +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/worker/.env.local-dev +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/envs/worker/.env.production +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/frontend/package.json +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/frontend/vite.config.ts +0 -0
- /yjcli-0.2.4/src/yjcli/data/templates/platform/scripts/run-all.ps1 → /yjcli-0.2.5/src/yjcli/data/templates/platform/scripts/run.ps1 +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/platform/scripts/run.sh +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/data/templates/settings.json +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/modules/__init__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/modules/constants.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/modules/fsutil.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/modules/paths.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/modules/prompt.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/services/__init__.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/services/status.py +0 -0
- {yjcli-0.2.4 → yjcli-0.2.5}/src/yjcli/services/wiring.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: yjcli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Scaffold platforms, services, and AI agent wiring (Cursor/Claude/Codex) for YJ architecture repos.
|
|
5
5
|
Project-URL: Homepage, https://github.com/yseiren87/yjcli
|
|
6
6
|
Project-URL: Repository, https://github.com/yseiren87/yjcli
|
|
@@ -77,13 +77,59 @@ Use with `-t` / `--type` (repeatable on `init` / `platform add`):
|
|
|
77
77
|
- Claude `settings.json`
|
|
78
78
|
- Root `Makefile`, `make.bat`, `TOOLS.md`, `.gitignore`
|
|
79
79
|
- `Diff.md` — user-maintained architecture difference and manual restoration notes
|
|
80
|
-
- Selected platform roots with `scripts/run.*` and development/production deploy templates
|
|
80
|
+
- Selected platform roots with `scripts/run.*` and development/production build/deploy templates
|
|
81
81
|
|
|
82
|
-
The root `Makefile` / `make.bat` wires platform run and deploy entry points.
|
|
83
|
-
templates print the exact file to implement and fail until the project
|
|
84
|
-
its build/package and upload logic. They remain platform-level; do not add
|
|
82
|
+
The root `Makefile` / `make.bat` wires platform run, build, and deploy entry points.
|
|
83
|
+
Build/deploy templates print the exact file to implement and fail until the project
|
|
84
|
+
supplies its build/package and upload logic. They remain platform-level; do not add
|
|
85
85
|
per-service `scripts/` directories or per-service Makefiles.
|
|
86
86
|
|
|
87
|
+
`run.*` ships as `.sh` + `.bat` + `.ps1` since local dev runs natively per platform.
|
|
88
|
+
`build-*` and `deploy-*` ship as `.sh` only — build/deploy tooling (Docker, etc.) is
|
|
89
|
+
not native to Windows, so `make.bat` runs those targets through WSL; macOS/Linux use
|
|
90
|
+
the shell script directly.
|
|
91
|
+
|
|
92
|
+
`build-common.sh` is the same file for every platform and is a thin plugin host:
|
|
93
|
+
it runs every `scripts/plugin-build-*.sh` file present, then falls through to its
|
|
94
|
+
own generic build guard. The `build` segment names the consumer (a deploy-side
|
|
95
|
+
plugin would be `plugin-deploy-*.sh` instead). Each plugin is its own file —
|
|
96
|
+
visible in `scripts/`, and runnable standalone — and self-detects whether it
|
|
97
|
+
applies by folder presence, not a platform-name check, so any platform can opt in.
|
|
98
|
+
|
|
99
|
+
- `plugin-build-proto.sh` → protoc codegen guard when `<platform>/proto/` exists.
|
|
100
|
+
`backend` always has this (fixed gRPC MSA root, see `yj-backend-msa`); any other
|
|
101
|
+
platform (including `backend-service`) gets the same guard only if it creates
|
|
102
|
+
`proto/` too. protoc is the standard; buf is not used.
|
|
103
|
+
- `plugin-build-ssr.sh` → template/asset build guard when
|
|
104
|
+
`<platform>/{service}/views/` exists, checked per service. Any platform's
|
|
105
|
+
service can opt in by creating `views/`.
|
|
106
|
+
- `plugin-build-docker.sh` → docker image **build only** (no push, no
|
|
107
|
+
swarm/stack rollout — that belongs in a deploy-side plugin) guard, per
|
|
108
|
+
service that has a `Dockerfile` (delete it to opt that service out). Builds
|
|
109
|
+
always use `.env.development` or `.env.production` depending on which
|
|
110
|
+
environment is targeted. The image version comes from the service's
|
|
111
|
+
`package.json`/`pyproject.toml` `version` field when present, otherwise the
|
|
112
|
+
`VERSION` env var — set it for languages with no package-manifest version
|
|
113
|
+
field.
|
|
114
|
+
|
|
115
|
+
None of these plugins imply each other, and using gRPC in `backend-service` does
|
|
116
|
+
not make it MSA — see `yj-backend-msa` / `yj-backend-service` for what each
|
|
117
|
+
option chapter actually changes.
|
|
118
|
+
|
|
119
|
+
- `yjcli service add` adds `Dockerfile` + `.dockerignore` to new services under
|
|
120
|
+
deployable platforms (`backend`, `backend-service`, `frontend`, `scheduler`);
|
|
121
|
+
`cli`/`mobile-app`/`pc-app`/`browser-extension` are local/client artifacts, not
|
|
122
|
+
docker-swarm services, so they don't get one. The Dockerfile is
|
|
123
|
+
language-agnostic and intentionally has no `FROM` yet — `docker build` fails
|
|
124
|
+
until it's replaced, matching every other generated build/deploy stub.
|
|
125
|
+
|
|
126
|
+
`deploy-common.sh` is the same kind of plugin host for the deploy side: after
|
|
127
|
+
calling the matching build script, it runs every `scripts/plugin-deploy-*.sh`
|
|
128
|
+
file present (none ship by default — pushing an image, `docker stack deploy`,
|
|
129
|
+
`kubectl apply`, etc. are deploy-side plugins the project adds). `deploy-development.sh`
|
|
130
|
+
/ `deploy-production.sh` call `deploy-common.sh` and then own their own
|
|
131
|
+
upload/rollout guidance only.
|
|
132
|
+
|
|
87
133
|
`Diff.md` is created only when missing, including with `init --force`. yjcli never
|
|
88
134
|
reads, updates, overwrites, or uses it for automatic restoration during sync or
|
|
89
135
|
migration.
|
|
@@ -105,8 +151,10 @@ inferring npm, uv, Go, or another language/runtime from project manifests.
|
|
|
105
151
|
```bash
|
|
106
152
|
make <platform> # all services under that platform (concurrent)
|
|
107
153
|
make <platform> NAME=<service> # one service
|
|
154
|
+
make <platform>-build-development [NAME=<service>]
|
|
155
|
+
make <platform>-build-production [NAME=<service>]
|
|
108
156
|
make <platform>-deploy-development [NAME=<service>]
|
|
109
|
-
make <platform>-deploy-production
|
|
157
|
+
make <platform>-deploy-production [NAME=<service>]
|
|
110
158
|
make help
|
|
111
159
|
```
|
|
112
160
|
|
|
@@ -116,7 +164,7 @@ make help
|
|
|
116
164
|
|---------|------|
|
|
117
165
|
| `yjcli sync agents` | After editing `AGENTS.md` — refreshes `CLAUDE.md` |
|
|
118
166
|
| `yjcli sync skills` | Refresh packaged skills (Cursor / Claude / Codex) |
|
|
119
|
-
| `yjcli sync make` | Overwrite root make/run files; install missing deploy scripts while preserving implemented ones |
|
|
167
|
+
| `yjcli sync make` | Overwrite root make/run files; install missing build/deploy scripts while preserving implemented ones |
|
|
120
168
|
| `yjcli sync all` | Soft upgrade — mirror CLAUDE + skills + make (**keeps** your `AGENTS.md`) |
|
|
121
169
|
| `yjcli sync migrate -y` | **Hard** upgrade — package template overwrites `AGENTS.md`, wipes skills dirs, drops legacy rules/`.agent`, refreshes settings/TOOLS/gitignore/make |
|
|
122
170
|
|
|
@@ -52,13 +52,59 @@ Use with `-t` / `--type` (repeatable on `init` / `platform add`):
|
|
|
52
52
|
- Claude `settings.json`
|
|
53
53
|
- Root `Makefile`, `make.bat`, `TOOLS.md`, `.gitignore`
|
|
54
54
|
- `Diff.md` — user-maintained architecture difference and manual restoration notes
|
|
55
|
-
- Selected platform roots with `scripts/run.*` and development/production deploy templates
|
|
55
|
+
- Selected platform roots with `scripts/run.*` and development/production build/deploy templates
|
|
56
56
|
|
|
57
|
-
The root `Makefile` / `make.bat` wires platform run and deploy entry points.
|
|
58
|
-
templates print the exact file to implement and fail until the project
|
|
59
|
-
its build/package and upload logic. They remain platform-level; do not add
|
|
57
|
+
The root `Makefile` / `make.bat` wires platform run, build, and deploy entry points.
|
|
58
|
+
Build/deploy templates print the exact file to implement and fail until the project
|
|
59
|
+
supplies its build/package and upload logic. They remain platform-level; do not add
|
|
60
60
|
per-service `scripts/` directories or per-service Makefiles.
|
|
61
61
|
|
|
62
|
+
`run.*` ships as `.sh` + `.bat` + `.ps1` since local dev runs natively per platform.
|
|
63
|
+
`build-*` and `deploy-*` ship as `.sh` only — build/deploy tooling (Docker, etc.) is
|
|
64
|
+
not native to Windows, so `make.bat` runs those targets through WSL; macOS/Linux use
|
|
65
|
+
the shell script directly.
|
|
66
|
+
|
|
67
|
+
`build-common.sh` is the same file for every platform and is a thin plugin host:
|
|
68
|
+
it runs every `scripts/plugin-build-*.sh` file present, then falls through to its
|
|
69
|
+
own generic build guard. The `build` segment names the consumer (a deploy-side
|
|
70
|
+
plugin would be `plugin-deploy-*.sh` instead). Each plugin is its own file —
|
|
71
|
+
visible in `scripts/`, and runnable standalone — and self-detects whether it
|
|
72
|
+
applies by folder presence, not a platform-name check, so any platform can opt in.
|
|
73
|
+
|
|
74
|
+
- `plugin-build-proto.sh` → protoc codegen guard when `<platform>/proto/` exists.
|
|
75
|
+
`backend` always has this (fixed gRPC MSA root, see `yj-backend-msa`); any other
|
|
76
|
+
platform (including `backend-service`) gets the same guard only if it creates
|
|
77
|
+
`proto/` too. protoc is the standard; buf is not used.
|
|
78
|
+
- `plugin-build-ssr.sh` → template/asset build guard when
|
|
79
|
+
`<platform>/{service}/views/` exists, checked per service. Any platform's
|
|
80
|
+
service can opt in by creating `views/`.
|
|
81
|
+
- `plugin-build-docker.sh` → docker image **build only** (no push, no
|
|
82
|
+
swarm/stack rollout — that belongs in a deploy-side plugin) guard, per
|
|
83
|
+
service that has a `Dockerfile` (delete it to opt that service out). Builds
|
|
84
|
+
always use `.env.development` or `.env.production` depending on which
|
|
85
|
+
environment is targeted. The image version comes from the service's
|
|
86
|
+
`package.json`/`pyproject.toml` `version` field when present, otherwise the
|
|
87
|
+
`VERSION` env var — set it for languages with no package-manifest version
|
|
88
|
+
field.
|
|
89
|
+
|
|
90
|
+
None of these plugins imply each other, and using gRPC in `backend-service` does
|
|
91
|
+
not make it MSA — see `yj-backend-msa` / `yj-backend-service` for what each
|
|
92
|
+
option chapter actually changes.
|
|
93
|
+
|
|
94
|
+
- `yjcli service add` adds `Dockerfile` + `.dockerignore` to new services under
|
|
95
|
+
deployable platforms (`backend`, `backend-service`, `frontend`, `scheduler`);
|
|
96
|
+
`cli`/`mobile-app`/`pc-app`/`browser-extension` are local/client artifacts, not
|
|
97
|
+
docker-swarm services, so they don't get one. The Dockerfile is
|
|
98
|
+
language-agnostic and intentionally has no `FROM` yet — `docker build` fails
|
|
99
|
+
until it's replaced, matching every other generated build/deploy stub.
|
|
100
|
+
|
|
101
|
+
`deploy-common.sh` is the same kind of plugin host for the deploy side: after
|
|
102
|
+
calling the matching build script, it runs every `scripts/plugin-deploy-*.sh`
|
|
103
|
+
file present (none ship by default — pushing an image, `docker stack deploy`,
|
|
104
|
+
`kubectl apply`, etc. are deploy-side plugins the project adds). `deploy-development.sh`
|
|
105
|
+
/ `deploy-production.sh` call `deploy-common.sh` and then own their own
|
|
106
|
+
upload/rollout guidance only.
|
|
107
|
+
|
|
62
108
|
`Diff.md` is created only when missing, including with `init --force`. yjcli never
|
|
63
109
|
reads, updates, overwrites, or uses it for automatic restoration during sync or
|
|
64
110
|
migration.
|
|
@@ -80,8 +126,10 @@ inferring npm, uv, Go, or another language/runtime from project manifests.
|
|
|
80
126
|
```bash
|
|
81
127
|
make <platform> # all services under that platform (concurrent)
|
|
82
128
|
make <platform> NAME=<service> # one service
|
|
129
|
+
make <platform>-build-development [NAME=<service>]
|
|
130
|
+
make <platform>-build-production [NAME=<service>]
|
|
83
131
|
make <platform>-deploy-development [NAME=<service>]
|
|
84
|
-
make <platform>-deploy-production
|
|
132
|
+
make <platform>-deploy-production [NAME=<service>]
|
|
85
133
|
make help
|
|
86
134
|
```
|
|
87
135
|
|
|
@@ -91,7 +139,7 @@ make help
|
|
|
91
139
|
|---------|------|
|
|
92
140
|
| `yjcli sync agents` | After editing `AGENTS.md` — refreshes `CLAUDE.md` |
|
|
93
141
|
| `yjcli sync skills` | Refresh packaged skills (Cursor / Claude / Codex) |
|
|
94
|
-
| `yjcli sync make` | Overwrite root make/run files; install missing deploy scripts while preserving implemented ones |
|
|
142
|
+
| `yjcli sync make` | Overwrite root make/run files; install missing build/deploy scripts while preserving implemented ones |
|
|
95
143
|
| `yjcli sync all` | Soft upgrade — mirror CLAUDE + skills + make (**keeps** your `AGENTS.md`) |
|
|
96
144
|
| `yjcli sync migrate -y` | **Hard** upgrade — package template overwrites `AGENTS.md`, wipes skills dirs, drops legacy rules/`.agent`, refreshes settings/TOOLS/gitignore/make |
|
|
97
145
|
|
|
@@ -46,13 +46,59 @@ scheduler/ # yj-scheduler
|
|
|
46
46
|
`install`, or `help` targets. Do not add per-service `scripts/`.
|
|
47
47
|
Root `make <platform>` starts all services under that platform (concurrent); `NAME=<service>` runs one.
|
|
48
48
|
Platforms run via `*/scripts/run.*`; services are sibling dirs created with `yjcli service add`.
|
|
49
|
-
- The root `Makefile` / `make.bat` wires platform run and deploy commands. Use
|
|
49
|
+
- The root `Makefile` / `make.bat` wires platform run, build, and deploy commands. Use
|
|
50
|
+
`<platform>-build-development|production [NAME=<service>]` for builds and
|
|
50
51
|
`<platform>-deploy-development|production [NAME=<service>]` for deploys.
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
`build-common.sh` owns shared build/package preparation; the environment-specific
|
|
53
|
+
build script (`build-development.sh` / `build-production.sh`) calls it.
|
|
54
|
+
`deploy-common.sh` owns shared deploy orchestration (calls the matching build
|
|
55
|
+
script, then runs deploy plugins); the environment-specific deploy script
|
|
56
|
+
(`deploy-development.sh` / `deploy-production.sh`) calls it first and then
|
|
57
|
+
owns upload/rollout guidance only. Generated build/deploy scripts fail with an
|
|
58
|
+
implementation prompt until the repository replaces their guarded stubs.
|
|
59
|
+
- `run.*` ships as `.sh` + `.bat` + `.ps1` (local dev runs natively per platform).
|
|
60
|
+
`build-*` and `deploy-*` are `.sh` only — build/deploy tooling is not native to
|
|
61
|
+
Windows, so `make.bat` runs those targets through WSL.
|
|
62
|
+
- Build/deploy scripts are repository-owned after creation. `yjcli sync make` installs
|
|
63
|
+
missing build/deploy scripts but preserves existing ones.
|
|
64
|
+
- `build-common.sh` is the same file for every platform — it is not backend-specific.
|
|
65
|
+
It is a thin plugin host: it runs every `scripts/plugin-build-*.sh` file present,
|
|
66
|
+
then falls through to its own generic build guard. Each capability is its own
|
|
67
|
+
file, self-detected by folder presence at runtime, not by branching on platform
|
|
68
|
+
name — so any platform can opt in. (A deploy-side plugin would be
|
|
69
|
+
`plugin-deploy-*.sh` — the naming segment names the consumer.)
|
|
70
|
+
- `plugin-build-proto.sh` → protoc codegen guard when `<platform>/proto/` exists
|
|
71
|
+
(schema `proto/*.proto` → generated `proto/dist/{lang}`). `backend` always has
|
|
72
|
+
this (fixed gRPC MSA root); any other platform gets the same guard only if it
|
|
73
|
+
creates a `proto/` folder too — do not assume gRPC on non-backend platforms.
|
|
74
|
+
protoc is the standard; buf is not used.
|
|
75
|
+
- `plugin-build-ssr.sh` → template/asset build guard when
|
|
76
|
+
`<platform>/{service}/views/` exists, checked per service (or across all
|
|
77
|
+
services when no service is targeted). Any platform's service may opt in by
|
|
78
|
+
creating `views/` — this is not backend-service-specific either.
|
|
79
|
+
- `plugin-build-docker.sh` → docker image **build only** guard (no push, no
|
|
80
|
+
swarm/stack rollout — that is a deploy-side plugin's job, not this one),
|
|
81
|
+
per service that has a `Dockerfile` (delete it to opt that service out).
|
|
82
|
+
Builds use `{service}/.env.development` or `.env.production` matching the
|
|
83
|
+
target environment. Image version: the service's `package.json` or
|
|
84
|
+
`pyproject.toml` `version` field when present, else the `VERSION` env var.
|
|
85
|
+
None of these plugins imply each other, and none imply MSA: a backend-service
|
|
86
|
+
using gRPC is still a single deployable, not multiple services sharing a
|
|
87
|
+
proto contract. Each plugin is also runnable standalone (e.g.
|
|
88
|
+
`./plugin-build-proto.sh development`) for testing without the base build guard.
|
|
89
|
+
- `yjcli service add` adds `Dockerfile` + `.dockerignore` to new services under
|
|
90
|
+
deployable platforms (`backend`, `backend-service`, `frontend`, `scheduler`)
|
|
91
|
+
— not under `cli`/`mobile-app`/`pc-app`/`browser-extension`, which are
|
|
92
|
+
local/client artifacts, not docker-swarm services. The Dockerfile is
|
|
93
|
+
language-agnostic with no `FROM` yet — `docker build` fails until replaced,
|
|
94
|
+
same guard-until-implemented contract as the other stubs.
|
|
95
|
+
- `deploy-common.sh` is the deploy-side plugin host, same contract as
|
|
96
|
+
`build-common.sh`: after calling the matching build script, it runs every
|
|
97
|
+
`scripts/plugin-deploy-*.sh` file present. None ship by default — a project
|
|
98
|
+
adds one (e.g. an image-push + `docker stack deploy` plugin, `kubectl apply`,
|
|
99
|
+
nginx/reverse-proxy) when it needs it. `deploy-development.sh` /
|
|
100
|
+
`deploy-production.sh` call `deploy-common.sh` and then own upload/rollout
|
|
101
|
+
guidance only.
|
|
56
102
|
- `Diff.md` is an optional, user-maintained reference for meaningful architecture
|
|
57
103
|
differences from yjcli defaults and their manual restoration notes. Update it
|
|
58
104
|
when that record would help, but never treat it as an automated sync, migration,
|
|
@@ -4,8 +4,10 @@ description: >-
|
|
|
4
4
|
Backend MSA architecture with mandatory gRPC/protobuf. Use only when creating
|
|
5
5
|
or editing code under backend/. Language-agnostic (Go/Python/Java/etc.).
|
|
6
6
|
Covers backend/{service}, backend/proto, and proto/dist/{lang}. Supports owner,
|
|
7
|
-
policy, and edge/gateway services (domains optional).
|
|
8
|
-
|
|
7
|
+
policy, and edge/gateway services (domains optional). Optional server-templating
|
|
8
|
+
(SSR) add-on for a service that must render HTML, same as backend-service — not
|
|
9
|
+
a separate platform. Do not use for backend-service/, frontend/, mobile-app/,
|
|
10
|
+
pc-app/, cli/, or browser-extension/.
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
# yj-backend-msa
|
|
@@ -52,6 +54,34 @@ Omit empty `domains/` trees. Do not invent fake repositories to “have a domain
|
|
|
52
54
|
- Generated stubs go to `backend/proto/dist/{lang}/`.
|
|
53
55
|
- Other platforms (e.g. `mobile-app`) may **symlink** to `backend/proto/dist/{lang}` — they must not own `.proto` copies.
|
|
54
56
|
- Prefer package boundaries in proto that align with service boundaries.
|
|
57
|
+
- Regeneration is wired through `backend/scripts/plugin-build-proto.sh` — a plugin
|
|
58
|
+
file every platform gets (not backend-specific), which auto-detects
|
|
59
|
+
`backend/proto/` and adds a protoc codegen guard (protoc is the standard here;
|
|
60
|
+
buf is not used). It runs automatically as part of `build-common.sh`, invoked via
|
|
61
|
+
`make backend-build-development|production`, and is also runnable standalone.
|
|
62
|
+
Implement codegen there, not as an ad-hoc one-off command.
|
|
63
|
+
|
|
64
|
+
## Optional: server templating (SSR/MPA)
|
|
65
|
+
|
|
66
|
+
Templating is an **option**, not something MSA forbids. Enable only when a
|
|
67
|
+
service must render HTML itself (e.g. an edge/gateway serving an admin page).
|
|
68
|
+
Most services stay gRPC-only — do not create `views/` speculatively.
|
|
69
|
+
|
|
70
|
+
When enabled for `{service_name}`, add role `view`:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
view = views/{feature}/{page}.html | views/layouts/* | views/partials/*
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Extra rules:
|
|
77
|
+
|
|
78
|
+
- Handlers: parse → call flow → build template context → render. No DB in handlers.
|
|
79
|
+
- flow returns plain data / view models — never HTML.
|
|
80
|
+
- templates: presentation only; no DB/service/domain calls.
|
|
81
|
+
- Template/asset bundling is wired the same way as proto: `plugin-build-ssr.sh`
|
|
82
|
+
auto-detects `{service_name}/views/` and adds a build guard for it. Implement
|
|
83
|
+
the bundling there, not as an ad-hoc one-off command.
|
|
84
|
+
- If the service is gRPC-only, do **not** create `views/`.
|
|
55
85
|
|
|
56
86
|
## Roles inside `{service_name}`
|
|
57
87
|
|
|
@@ -3,7 +3,8 @@ name: yj-backend-service
|
|
|
3
3
|
description: >-
|
|
4
4
|
Single deployable backend service architecture (non-MSA). Use when editing
|
|
5
5
|
backend-service/** or browser-extension/native_*/**. Language-agnostic.
|
|
6
|
-
Optional server-templating/SSR
|
|
6
|
+
Optional server-templating/SSR and optional gRPC/protobuf transport are both
|
|
7
|
+
add-on chapters, not separate platforms — choosing gRPC does not make this MSA.
|
|
7
8
|
Domains are optional owned concepts (not persistence-only). Do not use for
|
|
8
9
|
backend/ (MSA), frontend/, mobile-app/, pc-app/, cli/, or
|
|
9
10
|
browser-extension UI/background (non-native_*) paths.
|
|
@@ -74,6 +75,26 @@ If the process owns **no** local concept (only calls remote APIs / extension mes
|
|
|
74
75
|
- Clients in `modules`; feature orchestration + feature-local rules in `services`.
|
|
75
76
|
- If a **shared** policy grows across features, prefer a small rules-only domain over stuffing `apps/`.
|
|
76
77
|
|
|
78
|
+
## Optional: gRPC transport (protobuf)
|
|
79
|
+
|
|
80
|
+
Protobuf/gRPC is an **option**, not backend-service's default, and choosing it
|
|
81
|
+
does **not** turn this into MSA. Enable only when this single service's own
|
|
82
|
+
external API is defined as proto. Unlike `backend`, there is no shared
|
|
83
|
+
multi-service contract here, no fan-out to sibling services, and the
|
|
84
|
+
cross-service "call only through generated clients" rule from `yj-backend-msa`
|
|
85
|
+
does not apply — there is no sibling service to call.
|
|
86
|
+
|
|
87
|
+
Keep the schema at `{platform}/proto/*.proto` (same reserved location
|
|
88
|
+
`plugin-build-proto.sh` already checks). If more than one service under this
|
|
89
|
+
platform needs its own independent proto contract at the same time, that is a
|
|
90
|
+
signal the unit may belong in `backend/` (MSA) instead — do not invent a second
|
|
91
|
+
proto location to work around the ambiguity.
|
|
92
|
+
|
|
93
|
+
Codegen is wired the same way as MSA: `plugin-build-proto.sh` auto-detects
|
|
94
|
+
`proto/` and adds a protoc codegen guard (protoc is the standard; buf is not
|
|
95
|
+
used). It runs automatically as part of `build-common.sh` and is also runnable
|
|
96
|
+
standalone. Implement codegen there, not as an ad-hoc one-off command.
|
|
97
|
+
|
|
77
98
|
## Optional: server templating (SSR/MPA)
|
|
78
99
|
|
|
79
100
|
Templating is an **option**, not the folder identity. Enable only when the service must render HTML.
|
|
@@ -89,6 +110,9 @@ Extra rules:
|
|
|
89
110
|
- Handlers: parse → call flow → build template context → render. No DB in handlers.
|
|
90
111
|
- flow returns plain data / view models — never HTML.
|
|
91
112
|
- templates: presentation only; no DB/service/domain calls.
|
|
113
|
+
- Template/asset bundling is wired the same way as proto: `plugin-build-ssr.sh`
|
|
114
|
+
auto-detects `{service_name}/views/` and adds a build guard for it. Implement
|
|
115
|
+
the bundling there, not as an ad-hoc one-off command.
|
|
92
116
|
- If the service is JSON-API only, do **not** create `views/`.
|
|
93
117
|
|
|
94
118
|
Guide when adding SSR later:
|
|
@@ -56,6 +56,13 @@ Feature rules and orchestration live in background flow — not in listeners/`ap
|
|
|
56
56
|
|
|
57
57
|
- UI only; talk to background via messaging.
|
|
58
58
|
|
|
59
|
+
## Contracts
|
|
60
|
+
|
|
61
|
+
- Consume `backend/proto/dist/{lang}` (symlink) only through a companion
|
|
62
|
+
`native_*` host or a generated web client — do not copy `.proto` sources
|
|
63
|
+
into `browser-extension/`. Browsers rarely speak gRPC directly; route
|
|
64
|
+
through the native host or a REST/gRPC-web gateway instead.
|
|
65
|
+
|
|
59
66
|
## native_host
|
|
60
67
|
|
|
61
68
|
- Folder name: `native_{name}/` under `browser-extension/`.
|
|
@@ -63,6 +63,12 @@ infra = modules/{module}.{ext} # config, http, db, output formatters
|
|
|
63
63
|
|
|
64
64
|
- Printing helpers OK; **what** to print is decided in the command (entry).
|
|
65
65
|
|
|
66
|
+
## Contracts
|
|
67
|
+
|
|
68
|
+
- Consume `backend/proto/dist/{lang}` (symlink) for MSA contracts when a
|
|
69
|
+
command must call backend services directly; do not copy `.proto` sources
|
|
70
|
+
into `cli/`.
|
|
71
|
+
|
|
66
72
|
## Import direction
|
|
67
73
|
|
|
68
74
|
```text
|
|
@@ -63,6 +63,26 @@ Missing domain ≠ dump DTOs/utils into `main.tsx` / `App.tsx`. Keep feature wor
|
|
|
63
63
|
- Generated UI primitives: do not hand-edit or duplicate.
|
|
64
64
|
- Consume backend contracts via generated client or `backend/proto/dist/{lang}` — never copy `.proto` into frontend.
|
|
65
65
|
|
|
66
|
+
## Optional: server templating (SSR)
|
|
67
|
+
|
|
68
|
+
Templating is an **option**, not this app's default. Most apps stay a
|
|
69
|
+
client-rendered SPA — enable only when this app must render HTML server-side
|
|
70
|
+
(e.g. a lightweight SSR/SSG entry alongside the Vite build).
|
|
71
|
+
|
|
72
|
+
When enabled, add sibling to `src/`:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
views/{page}.html | views/layouts/* | views/partials/*
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Template/asset bundling is wired the same way as other platforms:
|
|
79
|
+
`plugin-build-ssr.sh` auto-detects `{app_name}/views/` and adds a build
|
|
80
|
+
guard for it. Implement the bundling there, not as an ad-hoc one-off command.
|
|
81
|
+
- Keep `src/` (client bundle) and `views/` (server-rendered templates)
|
|
82
|
+
separate; do not fold template markup into `pages/`/`components/`.
|
|
83
|
+
- Do **not** create `views/` speculatively — it does not apply to a normal
|
|
84
|
+
client-only SPA.
|
|
85
|
+
|
|
66
86
|
## Import direction
|
|
67
87
|
|
|
68
88
|
```text
|
|
@@ -71,6 +71,31 @@ scheduler/
|
|
|
71
71
|
- Do not import another platform's source tree; communicate through explicit
|
|
72
72
|
APIs or generated contracts.
|
|
73
73
|
|
|
74
|
+
## Optional: template rendering (reports/emails)
|
|
75
|
+
|
|
76
|
+
Templating is an **option**, not this platform's default. Enable only when a
|
|
77
|
+
job must render HTML/text output (e.g. an email digest or a generated report).
|
|
78
|
+
|
|
79
|
+
When enabled for `{scheduler_name}`, add:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
views/{job_name}/*.html | views/layouts/* | views/partials/*
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- flow (`services/{job_name}`) returns plain data / render context — never
|
|
86
|
+
pre-rendered HTML. Rendering happens at the point of use (e.g. before
|
|
87
|
+
sending an email), not scattered across `modules/`.
|
|
88
|
+
- Template/asset bundling is wired the same way as other platforms:
|
|
89
|
+
`plugin-build-ssr.sh` auto-detects `{scheduler_name}/views/` and adds a
|
|
90
|
+
build guard for it. Implement the bundling there, not as an ad-hoc command.
|
|
91
|
+
- If no job renders output, do **not** create `views/` speculatively.
|
|
92
|
+
|
|
93
|
+
## Contracts
|
|
94
|
+
|
|
95
|
+
- Consume `backend/proto/dist/{lang}` (symlink) for MSA contracts when a job
|
|
96
|
+
must call backend services directly; do not copy `.proto` sources into
|
|
97
|
+
`scheduler/`.
|
|
98
|
+
|
|
74
99
|
## Scheduling policy
|
|
75
100
|
|
|
76
101
|
For every job, make these decisions explicit near its registration or config:
|
|
@@ -59,11 +59,18 @@ Paths from `yjcli init` are fixed; add platform/app rows with `<path>` / `<role>
|
|
|
59
59
|
| `CLAUDE.md` | Mirror of `AGENTS.md` — do not edit; refresh with `yjcli sync agents` |
|
|
60
60
|
| `TOOLS.md` | Release-tools feature spec (version / deploy / git) |
|
|
61
61
|
| `Diff.md` | User-maintained reference for project differences from yjcli defaults; yjcli never updates or restores from it |
|
|
62
|
-
| `Makefile` | Root entry — run via `make <platform>`; deploy via `<platform>-deploy-development\|production`, optionally with `NAME=<service>` |
|
|
63
|
-
| `make.bat` |
|
|
64
|
-
| `<platform>/scripts/
|
|
65
|
-
| `<platform>/scripts/
|
|
66
|
-
| `<platform>/scripts/
|
|
62
|
+
| `Makefile` | Root entry — run via `make <platform>`; build via `<platform>-build-development\|production`, deploy via `<platform>-deploy-development\|production`, optionally with `NAME=<service>` |
|
|
63
|
+
| `make.bat` | Windows counterpart of root Makefile — `run.*` is native; `build-*`/`deploy-*` targets shell out to WSL (build/deploy tooling such as Docker is not native to Windows) |
|
|
64
|
+
| `<platform>/scripts/build-common.sh` | Repository-owned shared build/package implementation; same file for every platform — runs every `scripts/plugin-build-*.sh` present, then its own generic build guard |
|
|
65
|
+
| `<platform>/scripts/plugin-build-proto.sh` | Plugin: protoc codegen guard, self-detects `<platform>/proto/` at runtime — no platform-name branching, any platform can opt in |
|
|
66
|
+
| `<platform>/scripts/plugin-build-ssr.sh` | Plugin: template/asset build guard, self-detects `<platform>/{service}/views/` per service — no platform-name branching, any platform's service can opt in |
|
|
67
|
+
| `<platform>/scripts/plugin-build-docker.sh` | Plugin: docker image **build only** (no push, no swarm/stack rollout — that's a deploy-side plugin's job), self-detects `{service}/Dockerfile` per service; resolves image version from `package.json`/`pyproject.toml`, else the `VERSION` env var |
|
|
68
|
+
| `<platform>/scripts/build-development.sh` | Repository-owned development build implementation (calls `build-common.sh`) |
|
|
69
|
+
| `<platform>/scripts/build-production.sh` | Repository-owned production build implementation (calls `build-common.sh`) |
|
|
70
|
+
| `<platform>/scripts/deploy-common.sh` | Repository-owned shared deploy orchestration; same file for every platform — calls the matching build script, then runs every `scripts/plugin-deploy-*.sh` present (none ship by default) |
|
|
71
|
+
| `<platform>/scripts/deploy-development.sh` | Repository-owned development upload/deploy implementation (calls `deploy-common.sh`, then owns upload guidance) |
|
|
72
|
+
| `<platform>/scripts/deploy-production.sh` | Repository-owned production upload/deploy implementation (calls `deploy-common.sh`, then owns upload guidance) |
|
|
73
|
+
| `<platform>/{service}/Dockerfile`, `.dockerignore` | Docker build stub for a service, added by `yjcli service add` for deployable platforms (`backend`, `backend-service`, `frontend`, `scheduler`); language-agnostic — fails `docker build` until replaced |
|
|
67
74
|
| `.gitignore` | Canonical ignore rules |
|
|
68
75
|
| `.cursor/skills/` | Cursor skills (copied from package) |
|
|
69
76
|
| `.claude/skills/` | Claude skills (copied from package) |
|
|
@@ -99,7 +106,11 @@ Paths from `yjcli init` are fixed; add platform/app rows with `<path>` / `<role>
|
|
|
99
106
|
# build
|
|
100
107
|
<command>
|
|
101
108
|
|
|
102
|
-
#
|
|
109
|
+
# build (generated stubs fail until implemented; .sh only — Windows runs via WSL)
|
|
110
|
+
make <platform>-build-development [NAME=<service>]
|
|
111
|
+
make <platform>-build-production [NAME=<service>]
|
|
112
|
+
|
|
113
|
+
# deploy (generated stubs fail until implemented; .sh only — Windows runs via WSL)
|
|
103
114
|
make <platform>-deploy-development [NAME=<service>]
|
|
104
115
|
make <platform>-deploy-production [NAME=<service>]
|
|
105
116
|
```
|
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
# Usage:
|
|
3
3
|
# make <platform> # all services under that platform (concurrent)
|
|
4
4
|
# make <platform> NAME=<service> # one service
|
|
5
|
-
#
|
|
5
|
+
# Build/deploy templates are platform-owned extension points. They intentionally fail
|
|
6
6
|
# until the repository implements the printed build/package/upload steps.
|
|
7
|
+
# Build/deploy scripts are POSIX shell (.sh) only — build/deploy tooling (Docker, etc.)
|
|
8
|
+
# is not native to Windows. Run this Makefile through WSL on Windows for those targets.
|
|
7
9
|
|
|
8
10
|
PLATFORMS := $(patsubst %/scripts/run.sh,%,$(wildcard */scripts/run.sh))
|
|
11
|
+
BUILD_DEVELOPMENT_TARGETS := $(addsuffix -build-development,$(PLATFORMS))
|
|
12
|
+
BUILD_PRODUCTION_TARGETS := $(addsuffix -build-production,$(PLATFORMS))
|
|
9
13
|
DEPLOY_DEVELOPMENT_TARGETS := $(addsuffix -deploy-development,$(PLATFORMS))
|
|
10
14
|
DEPLOY_PRODUCTION_TARGETS := $(addsuffix -deploy-production,$(PLATFORMS))
|
|
11
15
|
|
|
12
|
-
.PHONY: help $(PLATFORMS) $(DEPLOY_DEVELOPMENT_TARGETS) $(DEPLOY_PRODUCTION_TARGETS)
|
|
16
|
+
.PHONY: help $(PLATFORMS) $(BUILD_DEVELOPMENT_TARGETS) $(BUILD_PRODUCTION_TARGETS) $(DEPLOY_DEVELOPMENT_TARGETS) $(DEPLOY_PRODUCTION_TARGETS)
|
|
13
17
|
|
|
14
18
|
help:
|
|
15
19
|
@echo "Usage:"
|
|
16
20
|
@echo " make <platform> # start all services concurrently"
|
|
17
21
|
@echo " make <platform> NAME=<service> # start one service"
|
|
22
|
+
@echo " make <platform>-build-development [NAME=<service>]"
|
|
23
|
+
@echo " make <platform>-build-production [NAME=<service>]"
|
|
18
24
|
@echo " make <platform>-deploy-development [NAME=<service>]"
|
|
19
25
|
@echo " make <platform>-deploy-production [NAME=<service>]"
|
|
20
26
|
@echo ""
|
|
@@ -27,7 +33,7 @@ help:
|
|
|
27
33
|
@echo ""
|
|
28
34
|
@echo "Example: make backend"
|
|
29
35
|
@echo " make backend NAME=api"
|
|
30
|
-
@echo " make backend-
|
|
36
|
+
@echo " make backend-build-development NAME=api"
|
|
31
37
|
@echo " make backend-deploy-production NAME=api"
|
|
32
38
|
|
|
33
39
|
$(PLATFORMS):
|
|
@@ -38,6 +44,14 @@ $(PLATFORMS):
|
|
|
38
44
|
"$@/scripts/run.sh" $(ARGS); \
|
|
39
45
|
fi
|
|
40
46
|
|
|
47
|
+
$(BUILD_DEVELOPMENT_TARGETS): %-build-development:
|
|
48
|
+
@test -x "$*/scripts/build-development.sh" || (echo "missing: $*/scripts/build-development.sh"; exit 1)
|
|
49
|
+
@"$*/scripts/build-development.sh" "$(NAME)" $(ARGS)
|
|
50
|
+
|
|
51
|
+
$(BUILD_PRODUCTION_TARGETS): %-build-production:
|
|
52
|
+
@test -x "$*/scripts/build-production.sh" || (echo "missing: $*/scripts/build-production.sh"; exit 1)
|
|
53
|
+
@"$*/scripts/build-production.sh" "$(NAME)" $(ARGS)
|
|
54
|
+
|
|
41
55
|
$(DEPLOY_DEVELOPMENT_TARGETS): %-deploy-development:
|
|
42
56
|
@test -x "$*/scripts/deploy-development.sh" || (echo "missing: $*/scripts/deploy-development.sh"; exit 1)
|
|
43
57
|
@"$*/scripts/deploy-development.sh" "$(NAME)" $(ARGS)
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
@echo off
|
|
2
2
|
setlocal EnableExtensions EnableDelayedExpansion
|
|
3
|
-
rem
|
|
3
|
+
rem Build/deploy scripts are POSIX shell (.sh) only (Docker etc. are not native to
|
|
4
|
+
rem Windows); those targets run through WSL. run.* stays native Windows.
|
|
5
|
+
rem Build/deploy scripts intentionally fail until their printed implementation steps
|
|
6
|
+
rem are completed.
|
|
4
7
|
|
|
5
8
|
if /I "%~1"=="" goto help
|
|
6
9
|
if /I "%~1"=="help" goto help
|
|
7
10
|
|
|
8
11
|
set "TARGET=%~1"
|
|
12
|
+
set "ACTION="
|
|
13
|
+
|
|
14
|
+
set "PLATFORM=%TARGET:-build-development=%"
|
|
15
|
+
if /I not "%PLATFORM%"=="%TARGET%" (
|
|
16
|
+
set "ACTION=build-development"
|
|
17
|
+
goto parse_start
|
|
18
|
+
)
|
|
19
|
+
set "PLATFORM=%TARGET:-build-production=%"
|
|
20
|
+
if /I not "%PLATFORM%"=="%TARGET%" (
|
|
21
|
+
set "ACTION=build-production"
|
|
22
|
+
goto parse_start
|
|
23
|
+
)
|
|
9
24
|
set "PLATFORM=%TARGET:-deploy-development=%"
|
|
10
25
|
if /I not "%PLATFORM%"=="%TARGET%" (
|
|
11
|
-
set "
|
|
26
|
+
set "ACTION=deploy-development"
|
|
12
27
|
goto parse_start
|
|
13
28
|
)
|
|
14
29
|
set "PLATFORM=%TARGET:-deploy-production=%"
|
|
15
30
|
if /I not "%PLATFORM%"=="%TARGET%" (
|
|
16
|
-
set "
|
|
31
|
+
set "ACTION=deploy-production"
|
|
17
32
|
goto parse_start
|
|
18
33
|
)
|
|
19
34
|
set "PLATFORM=%TARGET%"
|
|
@@ -35,8 +50,17 @@ shift
|
|
|
35
50
|
goto parse
|
|
36
51
|
|
|
37
52
|
:run_exec
|
|
38
|
-
if defined
|
|
39
|
-
|
|
53
|
+
if defined ACTION (
|
|
54
|
+
where wsl >nul 2>&1
|
|
55
|
+
if errorlevel 1 (
|
|
56
|
+
echo wsl.exe not found. Build/deploy scripts are .sh only; install WSL to run %ACTION% on Windows.
|
|
57
|
+
exit /b 1
|
|
58
|
+
)
|
|
59
|
+
if not exist "%PLATFORM%\scripts\%ACTION%.sh" (
|
|
60
|
+
echo missing: %PLATFORM%\scripts\%ACTION%.sh
|
|
61
|
+
exit /b 1
|
|
62
|
+
)
|
|
63
|
+
wsl bash "%PLATFORM%/scripts/%ACTION%.sh" "%NAME%"
|
|
40
64
|
exit /b !ERRORLEVEL!
|
|
41
65
|
)
|
|
42
66
|
if "%NAME%"=="" (
|
|
@@ -50,8 +74,10 @@ exit /b %ERRORLEVEL%
|
|
|
50
74
|
echo Usage:
|
|
51
75
|
echo make.bat ^<platform^> # all services ^(separate windows^)
|
|
52
76
|
echo make.bat ^<platform^> NAME=^<service^> # one service
|
|
53
|
-
echo make.bat ^<platform^>-
|
|
54
|
-
echo make.bat ^<platform^>-
|
|
77
|
+
echo make.bat ^<platform^>-build-development [NAME=^<service^>] ^(via WSL^)
|
|
78
|
+
echo make.bat ^<platform^>-build-production [NAME=^<service^>] ^(via WSL^)
|
|
79
|
+
echo make.bat ^<platform^>-deploy-development [NAME=^<service^>] ^(via WSL^)
|
|
80
|
+
echo make.bat ^<platform^>-deploy-production [NAME=^<service^>] ^(via WSL^)
|
|
55
81
|
echo.
|
|
56
82
|
echo Available platforms (dirs with scripts\run.bat):
|
|
57
83
|
set "FOUND="
|
|
@@ -65,6 +91,6 @@ if not defined FOUND echo ^(none — run: yjcli platform add^)
|
|
|
65
91
|
echo.
|
|
66
92
|
echo Example: make.bat backend
|
|
67
93
|
echo make.bat backend NAME=api
|
|
68
|
-
echo make.bat backend-
|
|
94
|
+
echo make.bat backend-build-development NAME=api
|
|
69
95
|
echo make.bat backend-deploy-production NAME=api
|
|
70
96
|
exit /b 0
|