@r_masseater/msch 0.91.5 → 0.93.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.
@@ -33,6 +33,8 @@ A version that is already on npm or already has a GitHub Release with assets is
33
33
 
34
34
  In the repository every dependency is an exact version, as the `version-range` check requires. When packing, msch-publish widens each exact version in `dependencies` and `peerDependencies` to a `^` range, so users of the package can share one copy with their other dependencies. `optionalDependencies`, which hold the per-target native packages, stay exact.
35
35
 
36
+ A workspace with `.claude-plugin/plugin.json` is a Claude Code plugin that is installed from npm. Claude Code installs the dependencies of such a plugin only from a lockfile inside the package, at exact versions and without install scripts. For a plugin, msch-publish therefore keeps `dependencies` exact, leaves `devDependencies` out of the packed `package.json`, and writes `npm-shrinkwrap.json` into the tarball when the plugin has dependencies. List what the build bundles into `dist` in `devDependencies`, and keep in `dependencies` only what must be on disk, such as a package that loads a native addon. A plugin declares no `peerDependencies`, because nothing in the plugin cache provides them.
37
+
36
38
  ## What the workspace declares
37
39
 
38
40
  `msch-publish plan <directory>` reads the workspace and decides what to publish.
@@ -53,10 +55,14 @@ The tag is the package name without its scope, then `-v` and the version. The re
53
55
 
54
56
  A published package supports the latest major and minor of what it runs on, not one exact version. `engines.node` and each `peerDependencies` range start at the version the repository develops against, such as `>=26.13.1` and `^4.1.0`, and a peer range names no patch. A package that declares `engines.node` is checked by `msch-publish compat <directory>`: it builds and packs the workspace and every workspace it depends on, installs the tarballs into a clean consumer, and imports every published export and starts every published bin on two runtimes. The floor case runs the newest patch of the lowest declared Node.js and peer minors, and a sibling workspace whose version is outside its peer floor comes from npm at that floor instead of from its tarball, so a peer range that admits a version without an API the package uses fails here. The latest case runs the newest Node.js of the same major with the declared peer ranges. An import or start that fails to load, as a missing module, an unexported subpath or a syntax error, fails the check; an error raised while the module runs does not. A package that needs a runtime dependency to load declares it as a required peer, not an optional one.
55
57
 
58
+ For a plugin, the check also unpacks the tarball, installs its dependencies with `npm ci --ignore-scripts` from the `npm-shrinkwrap.json` inside it, as Claude Code does when it caches a plugin, and starts every published bin from there. A plugin with dependencies and no lockfile in its tarball fails.
59
+
56
60
  The `verify` workflow runs the check for every package `msch-publish compat-plan .` lists, on every push to main and on the daily schedule, so a new upstream release that breaks a package shows up the same day. `msch-publish npm` runs it again before it publishes.
57
61
 
58
62
  The `compat` task of `vp run verify`, which the pre-push hook and the stop hook run, catches a missing dependency before the push instead of after it lands on main. It runs `msch-publish compat-changed` through `msch-changed`, so it checks only the packages whose own files or workspace dependencies changed since the check last passed. A dependency that breaks several consumers, such as moving code into a shared package, therefore rechecks every package that depends on it. The `verify` job in CI skips it, because the compat jobs above already check every package there.
59
63
 
64
+ The consumers of a package are checked against its new build before it publishes. `msch-publish consumers <directory>` lists the repositories of the same owner that the GitHub token of the credential broker can read, keeps the ones whose `package.json` or `pnpm-workspace.yaml` names the package or a workspace that depends on it, and for each one clones the default branch, installs it with the tarballs of the new build in place of the registry versions, and runs `vp run msch`. The install goes through a `.pnpmfile.cjs` that is deleted afterwards and the tracked files are restored, so the checks read the manifests and the lockfile as committed. The check fails when the task exits with an error or leaves changed files, unless the same task fails on the repository's own main too. The `consumers` job of `publish.yml` runs it in the `consumers` environment, whose broker grant reads contents, and `msch-publish npm` and the release wait for it, so a build that breaks a consumer never reaches npm. `compat-changed` runs it before the push when the session can list repositories and skips it when it cannot.
65
+
60
66
  ## The workflow
61
67
 
62
68
  The `publish` workflow runs `msch-publish plan`, the builds and checks the plan lists, `msch-publish npm` in the `npm` environment, and `msch-publish release`, which tags the commit and uploads `release-assets/`. Runs for the same workspace are serialized and never cancelled; different workspaces publish independently.