@mnci/cli 4.46.0 → 4.48.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 +26 -1
- package/dist/cli.js +458 -108
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,9 @@ plays (`.use-case`, `.client`, `.repository`, `.algorithm`, `.validator`,
|
|
|
36
36
|
src/
|
|
37
37
|
main.ts the CLI transport — decodes argv, calls one use case
|
|
38
38
|
workspace-overlay/ the config files mnci owns and rewrites
|
|
39
|
-
workspace-creation/ mnci new
|
|
39
|
+
workspace-creation/ mnci new
|
|
40
|
+
interactive-wizard/ bare mnci: every command and option, asked from the command's own description
|
|
41
|
+
repository-adoption/ mnci adopt — bringing an existing repository under mnci, step by step
|
|
40
42
|
workspace-upgrade/ mnci upgrade
|
|
41
43
|
workspace-diagnostics/ mnci doctor
|
|
42
44
|
project-scaffolding/ mnci add — one use case per kind, plus post-generation repairs
|
|
@@ -505,6 +507,18 @@ from File`), and the curated root scripts.
|
|
|
505
507
|
4. Installs the chosen **stack** (see below), `husky` + `@commitlint/*` for
|
|
506
508
|
real, so versions resolve at generation time.
|
|
507
509
|
|
|
510
|
+
## The interactive wizard (`mnci` with no arguments)
|
|
511
|
+
|
|
512
|
+
Bare `mnci` lists **every command** (inside a workspace the Projects and Dependencies sections come first, outside
|
|
513
|
+
one the Workspace section does), asks the command's arguments and then the options that apply, prints the command
|
|
514
|
+
line it is about to run, and runs it through the same program the flags go through. It reads the commands from the
|
|
515
|
+
program itself, so a command or option added to `main.ts` is offered without a wizard change. Two groupings are
|
|
516
|
+
kept by hand and checked by a spec: `add` offers the flags of the kind just chosen, and `adopt` asks which step
|
|
517
|
+
first (report, baseline tags, toolchain, project kinds, dependencies, overlay) and offers that step's own flags.
|
|
518
|
+
`wizard-coverage.integration.spec.ts` fails when a command is missing from the menu, an `adopt` flag belongs to no
|
|
519
|
+
step, an `add` flag is reachable for no kind, or the line the wizard builds for an option is not one the program
|
|
520
|
+
accepts.
|
|
521
|
+
|
|
508
522
|
## `mnci adopt`: reading an existing repository before changing it
|
|
509
523
|
|
|
510
524
|
`mnci adopt` is the start of bringing a repository that already has history, tooling and published
|
|
@@ -517,6 +531,7 @@ mnci adopt --tags # step (#379): create the baseline release tags, locally
|
|
|
517
531
|
mnci adopt --toolchain [--nx <version>] # step (#380): retire old tooling, align Nx, pass the audit
|
|
518
532
|
mnci adopt --overlay --scope @org --registry npm --agent ubuntu-latest # step (#381): the overlay and pipeline
|
|
519
533
|
mnci adopt --kinds [--kind apps/api=node-app] # step (#378): record each project's kind
|
|
534
|
+
mnci adopt --dependencies # step (#392): root runtime dependencies into the projects that import them
|
|
520
535
|
```
|
|
521
536
|
|
|
522
537
|
It reads git and the filesystem (no Nx, no install, no network) and reports the package manager, the
|
|
@@ -550,6 +565,16 @@ guess, and the step exits non-zero until every project has a kind. A project tha
|
|
|
550
565
|
keeps it, even one that is not an mnci kind name. Nothing is regenerated and no target is written: Nx infers an
|
|
551
566
|
npm project's targets from its scripts. Needs a clean git tree.
|
|
552
567
|
|
|
568
|
+
**`--dependencies`** moves the root `package.json`'s runtime `dependencies` into the npm projects that import
|
|
569
|
+
them. The root is private and never published, and a bundler externalises only what a project's own manifest
|
|
570
|
+
declares, so a runtime dependency kept at the root ships as an inlined private copy (`mnci doctor` reports it).
|
|
571
|
+
For each root dependency it reads the projects' source (not `node_modules` or build output), adds the package to
|
|
572
|
+
every project that imports it from shipped code at the range the root had, to `devDependencies` where only test
|
|
573
|
+
files import it, and removes it from the root; it then reinstalls so the lockfile follows. A project that already
|
|
574
|
+
declares the package keeps its own range (a different one is reported), and a package no project imports stays at
|
|
575
|
+
the root and is listed, because only you know whether it is root tooling or unused. The root's own
|
|
576
|
+
`devDependencies` stay: sharing the toolchain is what the root is for. Needs a clean git tree.
|
|
577
|
+
|
|
553
578
|
**`--overlay`** applies the mnci overlay (release config, `.npmrc`, commitlint, the curated root scripts and the
|
|
554
579
|
CI pipeline) to a repository that has an `nx.json`. It is `mnci upgrade` behind adoption's guard rails: it
|
|
555
580
|
refuses an unclean git tree, takes the same flags (`--scope`, `--registry`, `--organization`, `--project`,
|