@mnci/cli 4.13.1 → 4.14.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 +53 -0
- package/dist/cli.js +405 -219
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,6 +102,7 @@ mnci add python-vendor shared --lib core # wire core's module into shared's bui
|
|
|
102
102
|
|
|
103
103
|
# Go (@nx-go/nx-go — one root go.mod, golangci-lint + go test)
|
|
104
104
|
mnci add go-app api # executable -> apps/ (binary, zipped into the drop)
|
|
105
|
+
mnci add go-app cli --release # ...released: tag + per-platform zips on the GitHub Release
|
|
105
106
|
mnci add go-function-app fn # serverless handler -> apps/
|
|
106
107
|
mnci add go-lib core # publishable (by git tag) -> packages/
|
|
107
108
|
mnci add go-internal-lib util # private shared package -> libs/
|
|
@@ -693,6 +694,7 @@ copy is discarded.
|
|
|
693
694
|
| ------------------ | -------------------------------------------------------------- | -------------------------------------- |
|
|
694
695
|
| `apps/` | React / Node / Python / Go / Flutter apps (plain or Functions) | Never (packed into the drop) |
|
|
695
696
|
| `apps/` (tagged) | VS Code extensions (`type:vscode-extension`) | Yes — `nx release`, `vsce publish` |
|
|
697
|
+
| `apps/` (tagged) | Go apps added with `--release` (`release:go`) | Yes — `nx release` tag, zips on the GitHub Release |
|
|
696
698
|
| `packages/` | Publishable npm libraries, plus Go and Dart packages | Yes — `nx release`, per-package tags |
|
|
697
699
|
| `python-packages/` | Publishable Python packages (hatchling wheels) | Yes — `twine upload` (Azure Artifacts) |
|
|
698
700
|
| `libs/` | Internal libraries (TS, Python, Go or Dart), never published | Never |
|
|
@@ -719,6 +721,11 @@ rewritten by every `mnci upgrade`, so a hand-added `apps/my-extension` would be
|
|
|
719
721
|
lost, while a tag matcher is the same on every upgrade and covers every extension
|
|
720
722
|
there will ever be.
|
|
721
723
|
|
|
724
|
+
The third is an opt-in: a **Go app** added with `mnci add go-app <name> --release`
|
|
725
|
+
is tagged `release:go` and joins the release the same way. Without the flag an app
|
|
726
|
+
stays unreleased, because most Go apps are internal tools. See _Releasing a Go
|
|
727
|
+
app_ in the Go section.
|
|
728
|
+
|
|
722
729
|
Every kind builds to its own Nx-default output location (`apps/<name>/dist`,
|
|
723
730
|
`packages/<name>/dist`, ...) — no post-generation build-output rewiring for
|
|
724
731
|
any kind. `mnci add` is pure delegation to the official generators; each
|
|
@@ -1410,6 +1417,16 @@ pipeline installs `golangci-lint` itself (see below).
|
|
|
1410
1417
|
per-project `go.mod` — which single-module mode does not have, so nothing
|
|
1411
1418
|
is inferred. mnci writes them into `project.json` instead, as it already
|
|
1412
1419
|
does for most kinds.
|
|
1420
|
+
- **The project graph is still inferred, so `affected` is correct.** What the
|
|
1421
|
+
plugin does not infer is targets; it still derives the _graph_ from imports.
|
|
1422
|
+
An app that imports `libs/<name>/<slice>` depends on that lib, transitively,
|
|
1423
|
+
and every app sharing a lib is affected when it changes (measured on
|
|
1424
|
+
`@nx-go/nx-go` 4.1.1 with Nx 23.2.0, including a dependency created only by a
|
|
1425
|
+
test file's import). That matters because the pipeline verifies only the
|
|
1426
|
+
affected projects on a pull request: a missing edge would let a lib change
|
|
1427
|
+
pass without testing the apps that use it. The e2e pins the edges and the
|
|
1428
|
+
affected sets (russoedu/MoNecromanCi#260), since they are the plugin's
|
|
1429
|
+
behaviour rather than mnci's.
|
|
1413
1430
|
- **Lint is `golangci-lint`, pinned deliberately.** The plugin's `lint`
|
|
1414
1431
|
executor defaults to `go fmt`, which only reformats — a green lint step
|
|
1415
1432
|
with that default would mean nothing. The generated target passes
|
|
@@ -1422,6 +1439,42 @@ pipeline installs `golangci-lint` itself (see below).
|
|
|
1422
1439
|
`nx-release-publish` target is written: there is nothing to push. The only
|
|
1423
1440
|
real difference between `go-lib` and `go-internal-lib` is intent, recorded
|
|
1424
1441
|
in the `type:go-lib` tag and the `packages/` location.
|
|
1442
|
+
- **Releasing a Go app is an opt-in: `mnci add go-app <name> --release`.** The
|
|
1443
|
+
app is tagged `release:go`, which `release.projects` selects by tag (as it
|
|
1444
|
+
does for a VS Code extension, so `mnci upgrade` keeps it). Without the flag
|
|
1445
|
+
an app is never released.
|
|
1446
|
+
- **Versioned from its git tag, with no manifest.** Nx's default
|
|
1447
|
+
`versionActions` reads a `package.json`, and a project without one aborts
|
|
1448
|
+
the release for the whole workspace, so the app carries a project-level
|
|
1449
|
+
`release.version` pointing at `tools/go-app-release.cjs` and resolving its
|
|
1450
|
+
current version from the tag (`<name>@<version>`). The same file is the
|
|
1451
|
+
`versionActions`: it declares no manifest and writes nothing, which fits
|
|
1452
|
+
because mnci releases never commit. `mnci upgrade` rewrites it, so local
|
|
1453
|
+
edits do not survive.
|
|
1454
|
+
- **The first release is `0.0.1`.** With no tag yet, the base is `0.0.0` and
|
|
1455
|
+
Nx bumps it by its own rule for a `0.x` version. To start somewhere else,
|
|
1456
|
+
push a `<name>@<version>` tag before the first release (`mvd-cli@0.9.0`),
|
|
1457
|
+
or set `RELEASE_SPECIFIER` to an exact version.
|
|
1458
|
+
- **It carries a publish target that publishes nothing.** `nx release` tags
|
|
1459
|
+
first and publishes last, and a project matched for publishing without an
|
|
1460
|
+
`nx-release-publish` target made it exit 1 _after_ the tag existed
|
|
1461
|
+
(measured). Publishing a Go app is its tag.
|
|
1462
|
+
- **The platform zips are attached to the GitHub Release, GitHub Actions only.**
|
|
1463
|
+
After `nx release`, the generated workflow runs
|
|
1464
|
+
`node tools/go-app-release.cjs assets`: for each app tagged by this run it
|
|
1465
|
+
builds `package-all` with `VERSION` set to the new version, so the binary
|
|
1466
|
+
reports it, and uploads `dist/drop/go-app-<name>-<goos>-<goarch>.zip` with
|
|
1467
|
+
`gh release upload --clobber`, so a re-run is harmless. A run that released
|
|
1468
|
+
nothing uploads nothing. Azure Pipelines (and `--ci both`'s Azure side)
|
|
1469
|
+
creates the tag but has no GitHub Release to attach to, so it attaches
|
|
1470
|
+
nothing.
|
|
1471
|
+
- **A change to a library the app imports releases it too.** Nx counts the
|
|
1472
|
+
commits that touch an app's dependencies, not only its own folder (measured:
|
|
1473
|
+
a `fix:` touching only an imported `go-internal-lib` produced a patch
|
|
1474
|
+
release of the app), which is right for a binary that links the library in.
|
|
1475
|
+
- Not covered yet: apps that need a native toolchain (cgo) and so one runner
|
|
1476
|
+
per OS (russoedu/MoNecromanCi#263). The asset step builds all six
|
|
1477
|
+
platforms on one runner, which is what `CGO_ENABLED=0` allows.
|
|
1425
1478
|
- **No publish-time dependency injection**, unlike Python's vendoring: `go
|
|
1426
1479
|
build` links statically, so the binary in the drop already contains
|
|
1427
1480
|
everything it needs.
|