@mnci/cli 4.18.0 → 4.19.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 CHANGED
@@ -75,7 +75,7 @@ helpers — they have no interest in adding a project. The concept now sits in i
75
75
  own slice that depends on nothing above it (`file-system` alone), and all three
76
76
  consumers point at it.
77
77
 
78
- ## Commands (deliberately just seven)
78
+ ## Commands (deliberately few)
79
79
 
80
80
  ```sh
81
81
  mnci new my-repo # create a monorepo (prompts scope + registry)
@@ -100,7 +100,7 @@ mnci add python-lib shared # publishable -> python-packages/ (twine uplo
100
100
  mnci add python-internal-lib core # private shared lib -> libs/
101
101
  mnci add python-vendor shared --lib core # wire core's module into shared's built wheel
102
102
 
103
- # Go (@nx-go/nx-go — one root go.mod, golangci-lint + go test)
103
+ # Go (@nx-go/nx-go — multi-module: one go.mod per project + a root go.work, golangci-lint + go test)
104
104
  mnci add go-app api # executable -> apps/ (binary, zipped into the drop)
105
105
  mnci add go-app cli --release # ...released: tag + per-platform zips on the GitHub Release
106
106
  mnci add go-app tray --cgo # needs a C toolchain: built on a runner of each OS
@@ -131,6 +131,12 @@ mnci sync --check # ...report and exit non-zero, writing nothing
131
131
 
132
132
  mnci up # what has a newer release, grouped; pick what to update
133
133
  mnci up --check # ...report only (the default when output is piped)
134
+
135
+ mnci i -w web left-pad # add a dep to ONE project, using its toolchain (alias: mnci install)
136
+ mnci i -w api github.com/x/y # ...go get in the Go module; dotnet/flutter/pip all dispatched the same way
137
+ mnci i -w ui -w web react # ...-w repeats, to add to several projects at once
138
+ mnci i -w svc jest -D # ...--save-dev where the ecosystem has a dev-dependency notion
139
+ mnci i # no -w: install/restore the whole workspace (the one-shot bootstrap)
134
140
  ```
135
141
 
136
142
  ## Where a dependency belongs: root vs project
@@ -145,13 +151,16 @@ One rule, and it is the same in every language mnci supports:
145
151
  | npm | each project's `package.json` | `package.json` — scripts, devDependencies, `overrides` (root-only by npm's rules) |
146
152
  | pip | each project's `pyproject.toml` (a function app: its `requirements.txt`) | `requirements-dev.txt` — the shared toolchain, nothing else |
147
153
  | pub | each member's `pubspec.yaml` | `pubspec.yaml` — the member list and an SDK floor, **no** dependency blocks |
148
- | go | *(nothing per-project)* | `go.mod` — the whole module's requirements |
149
-
150
- **Go is the stated exception.** Its single-root-module layout means there are no
151
- per-project manifests to own anything, so every Go dependency is a root
152
- dependency by construction. That is deliberate — the multi-module `go.work`
153
- alternative was rejected because one stale `use` entry makes `go list -m -json`
154
- fail, which breaks the entire Nx project graph, not just the Go projects.
154
+ | go | each project's own `go.mod` (multi-module) | `go.work` — the `use` list only; mnci owns it, no requirements |
155
+
156
+ **Go follows the same rule as everything else** (MoNecromanCI/MoNecromanCi#289). Each
157
+ project has its own `go.mod` with a fetchable module path
158
+ (`<host>/<org>/<repo>/<dir>`, derived from the git origin), tied together by a
159
+ root `go.work` that mnci owns. That is what lets `mnci i -w <go-project> <pkg>`
160
+ `go get` into exactly that module. The one hazard it introduces —
161
+ a stale `use` entry whose directory is gone makes `go list -m` fail and breaks
162
+ the whole Nx project graph — is caught by `mnci doctor`, which fails on it and
163
+ names the line to remove.
155
164
 
156
165
  ### Why hoisting a runtime dependency to the root is a bug, not a tidy-up
157
166