zudojs-cli 2.0.0 → 2.0.1
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.
package/README.md
CHANGED
|
@@ -133,8 +133,16 @@ current directory.
|
|
|
133
133
|
Where a schematic lands depends on the architecture: a `monolith` puts
|
|
134
134
|
services in `src/services` and modules in `src/modules`; a
|
|
135
135
|
`modular-monolith` has modules only, so `generate service` there generates a
|
|
136
|
-
module
|
|
137
|
-
to `apps/services/<name>` with `--service <name>`.
|
|
136
|
+
module and registers it in `app.ts`; in a `microservice` project a schematic
|
|
137
|
+
goes to the gateway app, or to `apps/services/<name>` with `--service <name>`.
|
|
138
|
+
|
|
139
|
+
`generate service` is **refused** in a microservice project. A service there is
|
|
140
|
+
a whole workspace app — its own `package.json`, `tsconfig.json`, `Dockerfile`
|
|
141
|
+
and port — which the schematic does not produce; it used to write a bare class
|
|
142
|
+
into a directory pnpm skipped and no build compiled. Create services with
|
|
143
|
+
`zudojs create <project> --architecture microservice --services <names>`, and
|
|
144
|
+
add domain logic to an existing app with
|
|
145
|
+
`zudojs generate module <name> --service <existing-service>`.
|
|
138
146
|
|
|
139
147
|
## Commands
|
|
140
148
|
|
|
@@ -37,7 +37,10 @@ export declare const RESERVED_MICROSERVICE_APP_NAMES: readonly ["gateway"];
|
|
|
37
37
|
* (`identity`, `enrollment`, `assessment`, `notification`), which put four
|
|
38
38
|
* domains nobody asked for into every microservice project and left the
|
|
39
39
|
* author deleting them before they could start. Services are created when
|
|
40
|
-
* they are named — here, or
|
|
40
|
+
* they are named — here, or in another `create` run. `generate service` is
|
|
41
|
+
* refused in a microservice project, because a service is a whole workspace
|
|
42
|
+
* app (package.json, tsconfig, Dockerfile, port) that the schematic does not
|
|
43
|
+
* produce; `generate module --service <name>` adds to an existing app.
|
|
41
44
|
*/
|
|
42
45
|
export declare function resolveMicroserviceServices(requested: readonly string[]): readonly string[];
|
|
43
46
|
export declare function generateMicroserviceFiles(options: ScaffoldOptions): Record<string, string>;
|
|
@@ -39,7 +39,10 @@ export const RESERVED_MICROSERVICE_APP_NAMES = ["gateway"];
|
|
|
39
39
|
* (`identity`, `enrollment`, `assessment`, `notification`), which put four
|
|
40
40
|
* domains nobody asked for into every microservice project and left the
|
|
41
41
|
* author deleting them before they could start. Services are created when
|
|
42
|
-
* they are named — here, or
|
|
42
|
+
* they are named — here, or in another `create` run. `generate service` is
|
|
43
|
+
* refused in a microservice project, because a service is a whole workspace
|
|
44
|
+
* app (package.json, tsconfig, Dockerfile, port) that the schematic does not
|
|
45
|
+
* produce; `generate module --service <name>` adds to an existing app.
|
|
43
46
|
*/
|
|
44
47
|
export function resolveMicroserviceServices(requested) {
|
|
45
48
|
const normalized = requested
|
|
@@ -158,10 +161,17 @@ A microservice architecture built with the Zudojs framework.
|
|
|
158
161
|
${services.length > 0
|
|
159
162
|
? services.map((s, i) => `- **${s}** - Port ${3001 + i}`).join("\n")
|
|
160
163
|
: `
|
|
161
|
-
No services yet.
|
|
164
|
+
No services yet. A service is a whole workspace app, so it is created with
|
|
165
|
+
\`create\` rather than by a schematic:
|
|
162
166
|
|
|
163
167
|
\`\`\`bash
|
|
164
|
-
npx zudojs
|
|
168
|
+
npx zudojs create <project> --architecture microservice --services <name>
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
To add domain logic to an app that already exists, generate a module into it:
|
|
172
|
+
|
|
173
|
+
\`\`\`bash
|
|
174
|
+
npx zudojs generate module <name> --service <existing-service>
|
|
165
175
|
\`\`\``}
|
|
166
176
|
|
|
167
177
|
## Getting Started
|