@mnci/cli 4.48.0 → 4.49.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 +34 -0
- package/dist/cli.js +408 -301
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -507,6 +507,40 @@ 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
|
+
## A paired Playwright project (`mnci add react-app web --e2e`)
|
|
511
|
+
|
|
512
|
+
`--e2e` scaffolds `apps/<name>-e2e` beside a React app with `@nx/react:app --e2eTestRunner=playwright`. It is
|
|
513
|
+
opt-in, and for React apps only: it adds Playwright to the workspace, and a Node API has no page to drive.
|
|
514
|
+
|
|
515
|
+
- **The test.** Nx's sample looks for an `h1` containing "Welcome", which mnci's greeting app does not render, so it
|
|
516
|
+
is replaced by `src/greeting.e2e.spec.ts`: open `/` and expect the app's own greeting.
|
|
517
|
+
- **What CI verifies.** The project has `lint` and `typecheck` (both pass, and CI's `lint,typecheck,test,build` run
|
|
518
|
+
picks them up); it has no `test` or `build`. Its `e2e` target is **not** part of CI's verify, because it needs a
|
|
519
|
+
browser, and installing one on every agent would cost every run. Run it where a browser exists:
|
|
520
|
+
`npx playwright install chromium`, then `npx nx run <name>-e2e:e2e -- --project=chromium` (the `--` hands the
|
|
521
|
+
flag to Playwright, not to Nx).
|
|
522
|
+
- **Commands.** `npm run <name>-e2e:qa` is lint and typecheck. There is no `:build` or `:start`.
|
|
523
|
+
- **No per-project ESLint config.** None is generated (`--linter=none`), and the usual sweep covers the directory.
|
|
524
|
+
|
|
525
|
+
The `react e2e project` e2e section generates one, checks CI's targets, installs Chromium and runs the test against
|
|
526
|
+
the built app.
|
|
527
|
+
|
|
528
|
+
## ES module Node apps (`mnci add node-app|node-function-app --esm`)
|
|
529
|
+
|
|
530
|
+
Generated Node apps are CommonJS by default, and `npm-lib` packages are ESM-only. `--esm` makes an app an ES module
|
|
531
|
+
too: its `package.json` gets `"type": "module"` and its esbuild target builds `esm`; every relative import in its
|
|
532
|
+
sources names its file the way `nodenext` resolution needs (`./hello` becomes `./hello/index.js`, which TypeScript
|
|
533
|
+
reports as TS2835 otherwise); and its `jest.config.cts` gets a `moduleNameMapper` that resolves `./x.js` back to the
|
|
534
|
+
`./x.ts` Jest transforms. It applies to `node-app` (Express, Koa or no framework) and `node-function-app`; Fastify
|
|
535
|
+
and Nest keep the layout their framework mandates (autoloaded routes, decorators), so `--esm` is refused with them,
|
|
536
|
+
and on any other kind.
|
|
537
|
+
|
|
538
|
+
Measured on generated apps rather than assumed (the `node esm apps` e2e section): lint, typecheck, test and build are
|
|
539
|
+
green; the built bundle is ES module syntax and runs; `prune` keeps `"type": "module"` in the pruned manifest, so
|
|
540
|
+
`dist` still runs afterwards; and a **CommonJS** app that depends on an ESM-only library typechecks, builds and runs,
|
|
541
|
+
including from `dist` after `prune` and an install there, because Node loads the ES module through `require`
|
|
542
|
+
(unflagged from Node 22.12; the e2e says so and skips on older Node).
|
|
543
|
+
|
|
510
544
|
## The interactive wizard (`mnci` with no arguments)
|
|
511
545
|
|
|
512
546
|
Bare `mnci` lists **every command** (inside a workspace the Projects and Dependencies sections come first, outside
|