@mnci/cli 4.53.0 → 4.54.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
@@ -1689,7 +1689,7 @@ release version --dry-run`), which wins over the workspace's default
1689
1689
  every Python project workspace-wide (the workspace-wide install above) —
1690
1690
  both skipped cleanly when the workspace has no Python projects.
1691
1691
 
1692
- ## Go (`@nx-go/nx-go` — one root `go.mod`, golangci-lint + `go test`)
1692
+ ## Go (`@nx-go/nx-go` — a `go.mod` per project, a root `go.work`, golangci-lint + `go test`)
1693
1693
 
1694
1694
  Requires **Go 1.21+** on the machine and on the build agent; `mnci add go-*`
1695
1695
  fails fast with an install link when `go` is not on the `PATH`. The generated
@@ -1702,14 +1702,14 @@ pipeline installs `golangci-lint` itself (see below).
1702
1702
  | `go-lib` | `packages/<name>` | publishable **by git tag** — see below; lint + test targets only |
1703
1703
  | `go-internal-lib` | `libs/<name>` | private shared code, lint + test only — a non-`main` package produces no binary |
1704
1704
 
1705
- - **One root `go.mod`**, matching how TS uses one root `package.json` and
1706
- Python one root `requirements-dev.txt`. `project-scaffolding/go.use-case.ts` bootstraps it on the
1707
- first Go `add` by running the plugin's `init` then `convert-to-one-mod`
1708
- generators, in that order — `convert-to-one-mod` refuses once `go.work`
1709
- lists any module, so it has to happen before the first Go project exists.
1710
- Every Go project then shares that module and imports its siblings as
1711
- `<module>/libs/<name>/<slice>`, with no per-project manifests and no
1712
- `replace` directives.
1705
+ - **One `go.mod` per project, and a root `go.work` mnci owns** (#289), so a Go
1706
+ project's dependencies are declared in that project, like every other
1707
+ language's. `project-scaffolding/go.use-case.ts` bootstraps the workspace on
1708
+ the first Go `add` with the plugin's `init` (no `convert-to-one-mod`); each
1709
+ generator then writes its own `go.mod`, whose module line mnci rewrites to
1710
+ `<host>/<org>/<repo>/<dir>` from the git origin. Siblings import each other
1711
+ by that path, and `go.work` resolves them locally, with no `replace`
1712
+ directives.
1713
1713
  - **A Go library is a capability of slice packages.** The plugin's library
1714
1714
  generator writes `<name>.go` at the project root, which makes the root
1715
1715
  package the whole library. mnci replaces it with a root `doc.go` and moves
@@ -1723,16 +1723,17 @@ pipeline installs `golangci-lint` itself (see below).
1723
1723
  plants a failing test and a lint finding in a nested package and asserts
1724
1724
  both fail the project target, so a plugin change that stopped recursing
1725
1725
  would surface there rather than as a silently green lib.
1726
- - **The `go.work` multi-module layout was rejected deliberately.** Besides
1727
- splitting dependencies across per-project manifests, it is brittle: a
1728
- single stale `use` entry — a project directory removed by hand — makes
1729
- `go list -m -json` fail, and that breaks the **entire** Nx project graph,
1730
- not just the Go projects. Verified empirically.
1726
+ - **The `go.work` multi-module layout was first rejected and then adopted**
1727
+ (#289), because per-project dependencies are the point. Its one hazard is
1728
+ real: a single stale `use` entry — a project directory removed by hand —
1729
+ makes `go list -m -json` fail, and that breaks the **entire** Nx project
1730
+ graph, not just the Go projects. `mnci doctor` fails on one and names the
1731
+ line to remove.
1731
1732
  - **Targets are written explicitly** rather than inferred. `@nx-go/nx-go`
1732
- supplies `build`/`test`/`lint` by inference, but keys that inference on a
1733
- per-project `go.mod` — which single-module mode does not have, so nothing
1734
- is inferred. mnci writes them into `project.json` instead, as it already
1735
- does for most kinds.
1733
+ supplies `build`/`test`/`lint` by inference, but mnci writes them into
1734
+ `project.json` explicitly so lint is pinned to `golangci-lint` (the plugin's
1735
+ default is `go fmt`, which only reformats), as it already does for most
1736
+ kinds.
1736
1737
  - **The project graph is still inferred, so `affected` is correct.** What the
1737
1738
  plugin does not infer is targets; it still derives the _graph_ from imports.
1738
1739
  An app that imports `libs/<name>/<slice>` depends on that lib, transitively,