@mnci/cli 1.9.1 → 1.10.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 +41 -3
- package/dist/cli.js +213 -80
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,43 @@ each a single cross-platform command:
|
|
|
75
75
|
| `npm run python:install` | fixed Python toolchain (ruff/pytest/build/twine) + editable-install every Python project — the same two guards CI runs, for local dev |
|
|
76
76
|
| `prepare` | `husky` (commit-msg lint hook) |
|
|
77
77
|
|
|
78
|
+
## Every `add` also wires local-dev commands
|
|
79
|
+
|
|
80
|
+
Every `mnci add` (and the inline `internal-lib` case) finishes by calling
|
|
81
|
+
`registerProjectCommands` (`commands/add/shared.ts`), which writes up to three
|
|
82
|
+
root `package.json` scripts for the project just added:
|
|
83
|
+
|
|
84
|
+
| Script | Runs | When it's added |
|
|
85
|
+
| -------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `<name>:build` | `nx run <name>:build` | the kind has a `build` target (not every kind does — a private lib with nothing to publish, or a Python function app deployed as source, has none) |
|
|
87
|
+
| `<name>:qa` | `nx run <name>:lint && nx run <name>:test` | always — every kind has both |
|
|
88
|
+
| `<name>:start` | the kind's real local-dev command | only kinds with a genuine dev-server story — never a library |
|
|
89
|
+
|
|
90
|
+
The same three (when present) are appended as VS Code Tasks into the
|
|
91
|
+
workspace's `<workspace-name>.code-workspace` file, so they also show up
|
|
92
|
+
under **Terminal → Run Task** / the Command Palette — `build`/`qa` grouped
|
|
93
|
+
accordingly, `start` marked `isBackground` since it runs a process that
|
|
94
|
+
doesn't exit on its own. Re-running `add` for the same project name
|
|
95
|
+
overwrites its own scripts/tasks rather than duplicating them.
|
|
96
|
+
|
|
97
|
+
`:start` resolves differently per kind — an existing generator target where
|
|
98
|
+
one already exists, a small `nx:run-commands` target mnci writes where none
|
|
99
|
+
did:
|
|
100
|
+
|
|
101
|
+
| Kind(s) | `:start` runs |
|
|
102
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `react-app`, `node-app` | `nx run <name>:serve` — the generator's own inferred dev-server target |
|
|
104
|
+
| `node-function-app`, `python-function-app` | `nx run <name>:start` → `func start` (Azure Functions Core Tools, install separately — never a prerequisite for `add` itself) |
|
|
105
|
+
| `python-app` | `nx run <name>:start` → `python3 main.py` — mnci writes a runnable `main.py`, since the plugin's own sample module has no entry point |
|
|
106
|
+
| `go-app` | `nx run <name>:start` → `go run .` |
|
|
107
|
+
| `flutter-app` | `nx run <name>:start` → `flutter run -d chrome` (web is the only platform this plugin builds for) |
|
|
108
|
+
| every library, `go-function-app` | no `:start` at all — see below |
|
|
109
|
+
|
|
110
|
+
**`go-function-app` is a known gap, not an oversight**: unlike the Node and
|
|
111
|
+
Python function-app kinds, it writes no `host.json`/custom-handler config, so
|
|
112
|
+
there is nothing for `func start` to attach to. Shipping a `:start` script
|
|
113
|
+
that would just fail felt worse than being upfront that it doesn't exist yet.
|
|
114
|
+
|
|
78
115
|
## What `new` actually does
|
|
79
116
|
|
|
80
117
|
1. `npx create-nx-workspace@latest <name> --preset=ts` — npm workspaces +
|
|
@@ -90,9 +127,10 @@ each a single cross-platform command:
|
|
|
90
127
|
(`azure-pipelines.yml` and/or `.github/workflows/ci.yml`, `--ci`, default
|
|
91
128
|
`azure`; `github`/`both` also gets `.github/dependabot.yml` — weekly
|
|
92
129
|
dependency-update PRs), a `<workspace-name>.code-workspace` file (VS Code
|
|
93
|
-
workspace configuration with folder structure, ESLint/Prettier settings,
|
|
94
|
-
recommended extensions
|
|
95
|
-
|
|
130
|
+
workspace configuration with folder structure, ESLint/Prettier settings,
|
|
131
|
+
recommended extensions, and an empty `tasks` array that `mnci add` fills in
|
|
132
|
+
per project — see below — open it in VS Code via `File > Open Workspace
|
|
133
|
+
from File`), and the curated root scripts.
|
|
96
134
|
4. Installs the chosen **stack** (see below), `husky` + `@commitlint/*` for
|
|
97
135
|
real, so versions resolve at generation time.
|
|
98
136
|
|