@mnci/cli 4.10.8 → 4.12.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
@@ -111,6 +111,11 @@ mnci add flutter-app hello # Flutter web app -> apps/ (bundle, zipped in
111
111
  mnci add flutter-lib shared # publishable (by git tag) -> packages/
112
112
  mnci add flutter-internal-lib core # private shared package -> libs/
113
113
 
114
+ # VS Code extensions (@nx/node + vsce — bundled, packaged per platform, published by nx release)
115
+ mnci add vscode-extension editor # one universal .vsix -> dist/drop/
116
+ mnci add vscode-extension editor --sidecar api # one .vsix per platform, go-app api's binary in bin/
117
+ mnci add vscode-extension editor --publisher acme # Marketplace publisher (default: the scope without @)
118
+
114
119
  mnci upgrade # re-apply the latest overlay (see below)
115
120
  mnci upgrade --agent windows-latest # ...with an explicit override
116
121
 
@@ -687,6 +692,7 @@ copy is discarded.
687
692
  | Directory | Contents | Released? |
688
693
  | ------------------ | -------------------------------------------------------------- | -------------------------------------- |
689
694
  | `apps/` | React / Node / Python / Go / Flutter apps (plain or Functions) | Never (packed into the drop) |
695
+ | `apps/` (tagged) | VS Code extensions (`type:vscode-extension`) | Yes — `nx release`, `vsce publish` |
690
696
  | `packages/` | Publishable npm libraries, plus Go and Dart packages | Yes — `nx release`, per-package tags |
691
697
  | `python-packages/` | Publishable Python packages (hatchling wheels) | Yes — `twine upload` (Azure Artifacts) |
692
698
  | `libs/` | Internal libraries (TS, Python, Go or Dart), never published | Never |
@@ -705,6 +711,14 @@ reads it. Publishable Python packages get their own
705
711
  `python-packages/` dir so the npm `nx release` (`packages/*`) is never entangled
706
712
  with Python publishing.
707
713
 
714
+ The second exception goes the other way: a **VS Code extension** lives in
715
+ `apps/` (it is an application, and the slice lint treats it as one) but is
716
+ versioned and published like a package. `release.projects` matches it by its tag,
717
+ `tag:type:vscode-extension`, rather than by path: the array is mnci's and is
718
+ rewritten by every `mnci upgrade`, so a hand-added `apps/my-extension` would be
719
+ lost, while a tag matcher is the same on every upgrade and covers every extension
720
+ there will ever be.
721
+
708
722
  Every kind builds to its own Nx-default output location (`apps/<name>/dist`,
709
723
  `packages/<name>/dist`, ...) — no post-generation build-output rewiring for
710
724
  any kind. `mnci add` is pure delegation to the official generators; each
@@ -1360,7 +1374,7 @@ pipeline installs `golangci-lint` itself (see below).
1360
1374
 
1361
1375
  | Kind | Location | Build / deploy |
1362
1376
  | ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1363
- | `go-app` | `apps/<name>` | `go build` binary into `dist/apps/<name>/`, zipped by mnci into `dist/drop/go-app-<name>.zip` |
1377
+ | `go-app` | `apps/<name>` | `go build` binary into `dist/apps/<name>/`, zipped by mnci into `dist/drop/go-app-<name>.zip`; `build-all` / `package-all` cross-compile six platforms into `dist/platforms/<name>/<goos>-<goarch>/` and zip each (`VERSION` env stamps `main.version`) |
1364
1378
  | `go-function-app` | `apps/<name>` | same build; zipped into `dist/drop/go-function-app-<name>.zip`. The handler body is yours to write — AWS Lambda, Google Cloud Functions and Azure each want a different signature, and mnci does not pick one |
1365
1379
  | `go-lib` | `packages/<name>` | publishable **by git tag** — see below; lint + test targets only |
1366
1380
  | `go-internal-lib` | `libs/<name>` | private shared code, lint + test only — a non-`main` package produces no binary |
@@ -1429,6 +1443,53 @@ build` links statically, so the binary in the drop already contains
1429
1443
  workspace has no root `go.mod`, and the linter install also skips when the
1430
1444
  agent already provides it.
1431
1445
 
1446
+ ## VS Code extensions (`@nx/node:application` + `vsce`)
1447
+
1448
+ `mnci add vscode-extension <name>` scaffolds with the plain `@nx/node:application`
1449
+ generator (your test runner, esbuild) and turns the result into a Marketplace
1450
+ extension:
1451
+
1452
+ - **Bundled.** `bundle: true`, `thirdParty: true`, `external: ['vscode']`. A `.vsix`
1453
+ ships no `node_modules`, so the generator's un-bundled mirror of the source tree
1454
+ could not run in the extension host; `vscode` is the host's own module.
1455
+ - **A manifest `vsce` accepts.** Unscoped `name` (`vsce` rejects scopes),
1456
+ `publisher` (`--publisher`, default the workspace scope without `@`),
1457
+ `engines.vscode` pinned to the installed `@types/vscode` (`vsce` refuses types
1458
+ newer than the engine range), `main: ./dist/main.js`, empty `activationEvents`
1459
+ (VS Code activates on a contributed command by itself since 1.74) and one sample
1460
+ command. Tagged `type:vscode-extension`.
1461
+ - **`src/main.ts`**, not `extension.ts`: the slice rules allow only `index` and
1462
+ `main` at the root of `src`.
1463
+ - **Unit tests run against a stub of `vscode`**, `test/vscode.stub.ts`, mapped by
1464
+ Jest's `moduleNameMapper` or Vitest's `alias`. The real module exists only
1465
+ inside the extension host. The stub covers the sample and grows with your code.
1466
+ - **`package`** writes `dist/drop/<name>.vsix` with `vsce package
1467
+ --no-dependencies` (mandatory with hoisted npm workspaces).
1468
+ - **`--sidecar <go-app>`** ships a native binary. `package` then runs the Go app's
1469
+ `build-all` with `VERSION` set to the extension's version, and writes one `.vsix`
1470
+ per Marketplace target, `dist/drop/<name>-<target>.vsix`, with that platform's
1471
+ binary in `bin/`: `win32-x64`, `win32-arm64`, `linux-x64`, `linux-arm64`,
1472
+ `darwin-x64`, `darwin-arm64`, plus `alpine-x64`/`alpine-arm64` from the static
1473
+ Linux binaries. Unix file modes survive into the package, so the binary stays
1474
+ executable. Resolve it at runtime from `context.extensionPath` + `bin/`.
1475
+ - **`nx-release-publish`** runs `vsce publish --packagePath <every vsix>
1476
+ --skip-duplicate` when `VSCE_PAT` is set (a Marketplace personal access token, as
1477
+ a CI secret) and skips with a message otherwise. It depends on `package`, so it
1478
+ ships the version `nx release` just wrote. The CI release step passes `VSCE_PAT`
1479
+ through in both providers.
1480
+ - **Debugging**: an `<name>: debug` launch entry (`extensionHost`) opens a second
1481
+ VS Code window with the extension loaded, after the `<name>: build (development)`
1482
+ task, which keeps source maps.
1483
+
1484
+ Both targets run `tools/vscode-extension.cjs`, a workspace file mnci owns (like
1485
+ `tools/csharp-version-actions.cjs`): `mnci add vscode-extension` writes it and
1486
+ `mnci upgrade` rewrites it. It resolves `vsce` and `nx` through their own
1487
+ `package.json` `bin` and runs them with `node`, with no shell, so a workspace path
1488
+ containing spaces works on Windows.
1489
+
1490
+ Not built yet: integration tests through `@vscode/test-cli` (they download VS Code
1491
+ and need a display, so they would be gated like the Go and Flutter sections).
1492
+
1432
1493
  ## Flutter (`@mnci/nx-flutter` — one root `pubspec.yaml` pub workspace)
1433
1494
 
1434
1495
  Requires the **Flutter SDK** (3.27+, for Dart 3.6+ pub workspaces) on the