@mnci/cli 4.49.0 → 4.50.0
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 +29 -0
- package/dist/cli.js +476 -228
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -507,6 +507,35 @@ from File`), and the curated root scripts.
|
|
|
507
507
|
4. Installs the chosen **stack** (see below), `husky` + `@commitlint/*` for
|
|
508
508
|
real, so versions resolve at generation time.
|
|
509
509
|
|
|
510
|
+
## Container images (`mnci add container <name> --app <app>`)
|
|
511
|
+
|
|
512
|
+
`container` is a kind that wraps an app you already have, so the app keeps its own kind and the image is a project
|
|
513
|
+
of its own beside it: `mnci add container api-image --app api --port 3000`. It writes `apps/<name>/` with a
|
|
514
|
+
`Dockerfile`, a `Dockerfile.dockerignore`, a `files/` directory for anything the image copies from beside the build
|
|
515
|
+
context, and a manifest tagged `type:container` with two targets. `image` builds `<name>:<VERSION>` and
|
|
516
|
+
`<name>:latest` after the app's own output target (`VERSION` is `dev` when unset, as in the Go builds), and `start`
|
|
517
|
+
runs the image, publishing the port. The project declares the app as an implicit dependency, so `nx affected`
|
|
518
|
+
knows a change to the app affects its image. `npm run <name>:image` and `<name>:start` are registered; `:qa` builds
|
|
519
|
+
the image.
|
|
520
|
+
|
|
521
|
+
One recipe per app kind, each a plain image of what the app already produces:
|
|
522
|
+
|
|
523
|
+
| App | Build context | Image |
|
|
524
|
+
|---|---|---|
|
|
525
|
+
| `node-app` | the app's pruned output (`prune` target) | `node:24-alpine`, production dependencies installed, runs as `node`, `HOST=0.0.0.0` so a published port is reachable |
|
|
526
|
+
| `react-app` | its production `dist` | `nginx` with a server block that falls back to `index.html` for client-side routes |
|
|
527
|
+
| `go-app` | the static `linux-amd64` binary from `build-all` | `distroless/static`, non-root |
|
|
528
|
+
|
|
529
|
+
An Azure Functions app is refused, because its image is the Functions host's own and needs its own entry point.
|
|
530
|
+
|
|
531
|
+
The target is called `image`, not `build`, **on purpose**: CI runs every project's `build`, and building an image needs a
|
|
532
|
+
Docker engine that an agent may not have (a Windows agent cannot run Linux images at all). Adding a container project
|
|
533
|
+
therefore does not change what CI verifies; building and publishing images is a step you add in a pipeline slot where
|
|
534
|
+
the agent has Docker. `mnci upgrade` rewrites `tools/container-image.cjs`, the small helper both targets run.
|
|
535
|
+
|
|
536
|
+
The `container images` e2e section builds a Node, a React and a Go image and talks to the running containers. It needs
|
|
537
|
+
a Docker engine, so it skips where there is none and runs in CI's Linux `e2e-containers` job (nightly and on demand).
|
|
538
|
+
|
|
510
539
|
## A paired Playwright project (`mnci add react-app web --e2e`)
|
|
511
540
|
|
|
512
541
|
`--e2e` scaffolds `apps/<name>-e2e` beside a React app with `@nx/react:app --e2eTestRunner=playwright`. It is
|