@antelopejs/tooling-configs 0.7.1 → 0.7.3

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
@@ -23,28 +23,28 @@ The AntelopeJS guardrail pack: shared lint, format and dead-code presets, the co
23
23
 
24
24
  ## What's in the box
25
25
 
26
- | Export | Import | What it gives |
27
- | ------------------ | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
28
- | `./oxc/lint` | `import { antelopePreset } from "@antelopejs/tooling-configs/oxc/lint"` | The oxlint preset |
29
- | `./oxc/fmt` | `import { antelopeFmtPreset } from "@antelopejs/tooling-configs/oxc/fmt"` | The oxfmt preset (house style) |
30
- | `./eslint` | `import { antelopeNuxtConfig } from "@antelopejs/tooling-configs/eslint"` | ESLint for Nuxt layers |
31
- | `./knip` | `import { antelopeKnipConfig } from "@antelopejs/tooling-configs/knip"` | Knip for AntelopeJS modules |
32
- | `./oxc/anti-slop` | Loaded by the oxlint preset as a JS plugin | The vendored [anti-slop](https://github.com/dmmulroy/anti-slop) rules |
33
- | `./oxc/guardrails` | Loaded by the oxlint preset as a JS plugin | The `antelopejs` comment and test-quality rules |
34
- | `./verify` | `import type { VerifyConfig } from "@antelopejs/tooling-configs/verify"` | Types and check helpers for a shared verification skill's `verify.config.ts` |
35
- | bin | `antelopejs-sync [--init]` | Writes the guardrail pack into a repository; `--check` reports drift; `--init` onboards a bare repository |
36
- | bin | `antelopejs-checks [--no-services]` | Runs every check and prints only the failures; starts `.github/compose.yml` services around them |
37
- | bin | `antelopejs-ratchet` | Fails when recorded debt grows; `--update` lowers the record and adopts rules a pack release newly enabled |
38
- | bin | `antelopejs-suppressions` | Fails when suppressions exceed their budget or an added one breaks policy; `--update` lowers the budget |
39
- | bin | `antelopejs-check-size` | Fails on authored files over 20,000 bytes and on blanket disable directives |
40
- | bin | `antelopejs-api-diff <base-ref>` | Compares published declaration bundles against committed HEAD |
41
- | bin | `antelopejs-comment-proof <base-ref>` | Compares comment-free JavaScript emit against committed HEAD |
42
- | bin | `antelopejs-body-check <body.md \| -> [--head <sha>] [--base <sha>]` | Checks a PR body's proof and findings blocks against HEAD; `--findings` prints the findings block |
43
- | bin | `antelopejs-readme-strip --kind <kind> --name <label-name>` | Writes a framework repository's README strip banner to `.github/readme/strip.svg` ([docs](docs/documentation-checks.md#framework-strip-banner)) |
44
- | bin | `antelopejs-garden [--json] [--apply] [--apply-prunes]` | The Gardener's scans of the organization through the GitHub API and npm |
45
- | bin | `antelopejs-triage [--json]` | Community Triage's ranked shortlist of untriaged issues |
46
- | bin | `antelopejs-verify <command>` | The harness of the shared `verify-interface`, `verify-module` and `verify-template` skills |
47
- | bin | `antelopejs-lease run \| status \| down \| gc` | Ports, a mongod, logs and tmp per worktree; see [Run a DMS from a git worktree](./docs/agent-worktrees.md) |
26
+ | Export | Import | What it gives |
27
+ | ------------------ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
28
+ | `./oxc/lint` | `import { antelopePreset } from "@antelopejs/tooling-configs/oxc/lint"` | The oxlint preset |
29
+ | `./oxc/fmt` | `import { antelopeFmtPreset } from "@antelopejs/tooling-configs/oxc/fmt"` | The oxfmt preset (house style) |
30
+ | `./eslint` | `import { antelopeNuxtConfig } from "@antelopejs/tooling-configs/eslint"` | ESLint for Nuxt layers |
31
+ | `./knip` | `import { antelopeKnipConfig } from "@antelopejs/tooling-configs/knip"` | Knip for AntelopeJS modules |
32
+ | `./oxc/anti-slop` | Loaded by the oxlint preset as a JS plugin | The vendored [anti-slop](https://github.com/dmmulroy/anti-slop) rules |
33
+ | `./oxc/guardrails` | Loaded by the oxlint preset as a JS plugin | The `antelopejs` comment and test-quality rules |
34
+ | `./verify` | `import type { VerifyConfig } from "@antelopejs/tooling-configs/verify"` | Types and check helpers for a shared verification skill's `verify.config.ts` |
35
+ | bin | `antelopejs-sync [--init]` | Writes the guardrail pack into a repository; `--check` reports drift; `--init` onboards a bare repository |
36
+ | bin | `antelopejs-checks [--no-services]` | Runs every check and prints only the failures and the errors `published:types` declares as known; starts `.github/compose.yml` services around them |
37
+ | bin | `antelopejs-ratchet` | Fails when recorded debt grows; `--update` lowers the record and adopts rules a pack release newly enabled |
38
+ | bin | `antelopejs-suppressions` | Fails when suppressions exceed their budget or an added one breaks policy; `--update` lowers the budget |
39
+ | bin | `antelopejs-check-size` | Fails on authored files over 20,000 bytes and on blanket disable directives |
40
+ | bin | `antelopejs-api-diff <base-ref>` | Compares published declaration bundles against committed HEAD |
41
+ | bin | `antelopejs-comment-proof <base-ref>` | Compares comment-free JavaScript emit against committed HEAD |
42
+ | bin | `antelopejs-body-check <body.md \| -> [--head <sha>] [--base <sha>]` | Checks a PR body's proof and findings blocks against HEAD; `--findings` prints the findings block |
43
+ | bin | `antelopejs-readme-strip --kind <kind> --name <label-name>` | Writes a framework repository's README strip banner to `.github/readme/strip.svg` ([docs](docs/documentation-checks.md#framework-strip-banner)) |
44
+ | bin | `antelopejs-garden [--json] [--apply] [--apply-prunes]` | The Gardener's scans of the organization through the GitHub API and npm |
45
+ | bin | `antelopejs-triage [--json]` | Community Triage's ranked shortlist of untriaged issues |
46
+ | bin | `antelopejs-verify <command>` | The harness of the shared `verify-interface`, `verify-module` and `verify-template` skills |
47
+ | bin | `antelopejs-lease run \| status \| down \| gc` | Ports, a mongod, logs and tmp per worktree; see [Run a DMS from a git worktree](./docs/agent-worktrees.md) |
48
48
 
49
49
  ## antelopejs-garden
50
50
 
@@ -180,7 +180,7 @@ antelopePreset({
180
180
 
181
181
  ### Add ignore patterns
182
182
 
183
- oxlint reads `ignorePatterns` only from the root config, never from `extends`, so the synced `oxlint.config.ts` sets `ignorePatterns: ANTELOPE_IGNORE_PATTERNS`, and sync replaces the earlier template that did not. `ANTELOPE_IGNORE_PATTERNS` holds generated output and what sync writes under the agent directories: the synced files of each shared skill and its `.claude/skills` link, which shows the repository's own files a second time. The repository's own files under `.agents/` and `.claude/` are linted. Spread the shared patterns when adding your own:
183
+ oxlint reads `ignorePatterns` only from the root config, never from `extends`, so the synced `oxlint.config.ts` sets `ignorePatterns: ANTELOPE_IGNORE_PATTERNS`, and sync replaces the earlier template that did not. `ANTELOPE_IGNORE_PATTERNS` holds generated output and what sync writes under the agent directories: the synced files of each shared skill and its `.claude/skills` link, which shows the repository's own files a second time. The repository's own files under `.agents/` and `.claude/` are linted. oxlint skips `node_modules` only when a `.gitignore` or the root config's `ignorePatterns` leaves it out, so a root config without the shared patterns, in a project with no `.gitignore`, makes a bare `oxlint` lint every dependency file with the type-aware rules. Spread the shared patterns when adding your own:
184
184
 
185
185
  ```ts
186
186
  // oxlint.config.ts
@@ -232,9 +232,23 @@ pnpm install
232
232
  | `guardrails.suppressions.json` | Records the current suppression counts when the file is missing; restores the committed file instead when HEAD has one; otherwise only adds `config` and `agentFiles` at today's counts when the file predates them |
233
233
  | `<layer>/build/backend-boundary.ts` | Where a DMS frontend layer tracks one, restores the pack's backend boundary plugin for the package that holds the layer. A formatter's rewrite is not drift; any other edit is |
234
234
 
235
- `--profile template` writes only what `antelopejs-checks` runs, for template repositories: the three preset configs, `.gitattributes`, a user-facing `AGENTS.md` block, `guardrails.suppressions.json`, and the `package.json` scripts and devDependencies of the table above without the hooks (no `prepare`, no `lefthook`). It sets `checks`, `size`, `suppressions` and `suppressions:update`, plus `ratchet` and `ratchet:update` once `guardrails.ratchet.json` exists. It adds `typecheck`, `lint`, `format`, `format:check`, `knip`, `sync` and `sync:check` only where the template has none, the sync scripts with `--profile template`. It writes no `guardrails.ratchet.json`. The agent layer, `verify-template` and the writing skills under `.agents/skills/` with their `.claude/skills` links, is synced and checked only in the template source, marked by its `.agents/skills/verify-template/` folder; a project scaffolded from the template ships without it, so the template's `AGENTS.md` block links no skill under `.agents/` or `.claude/skills/`. `antelopejs-sync --check` writes nothing and exits 1 on any drift; `pnpm run checks` runs it.
235
+ `--profile template` writes only what `antelopejs-checks` runs, for template repositories: the three preset configs, `.gitattributes`, in a pnpm template the `pnpm-workspace.yaml` exclusion `lockfile:singletons` needs (see below) without `allowBuilds`, a user-facing `AGENTS.md` block, `guardrails.suppressions.json`, and the `package.json` scripts and devDependencies of the table above without the hooks (no `prepare`, no `lefthook`). It sets `checks`, `size`, `suppressions` and `suppressions:update`, plus `ratchet` and `ratchet:update` once `guardrails.ratchet.json` exists. It adds `typecheck`, `lint`, `format`, `format:check`, `knip`, `sync` and `sync:check` only where the template has none, the sync scripts with `--profile template`. It writes no `guardrails.ratchet.json`. The agent layer, `verify-template` and the writing skills under `.agents/skills/` with their `.claude/skills` links, is synced and checked only in the template source, marked by its `.agents/skills/verify-template/` folder; a project scaffolded from the template ships without it, so the template's `AGENTS.md` block links no skill under `.agents/` or `.claude/skills/`. `antelopejs-sync --check` writes nothing and exits 1 on any drift; `pnpm run checks` runs it.
236
236
 
237
- `pnpm run checks` runs `typecheck`, `lint`, `format:check`, `knip`, `test`, `size`, `suppressions` and `sync:check`, plus `ratchet` when `guardrails.ratchet.json` exists. It prints only the output of the steps that failed. Sync adds the ratchet scripts and pre-commit hook only while `guardrails.ratchet.json` exists. When the repository has a verify layer, an `.agents/skills/verify-*` folder holding a `verify.config.ts` or a `tsconfig.json`, it also runs `verify:types` and `verify:lockfiles`, which need no package script. Neither writes a file in the repository, spawns a package manager or fetches anything, so both pass offline after a root install, as CI runs them. When the repository holds a `pnpm-lock.yaml`, outside what `.gitignore` leaves out, it also runs `lockfile:singletons`, which fails when a lockfile resolves an `@antelopejs/interface-*` package at more than one version and names the importers and packages that pull each copy. It reads the lockfiles only. When a tracked `package.json` declares an `@antelopejs/*` package, it also runs `dependency:ranges` (see [Dependency ranges](#dependency-ranges)), which reads the manifests only. In a git checkout it also runs `git:identity`, which fails when the repository's own git config, the `.git/config` every worktree shares or a worktree's `config.worktree`, sets `user.name` or `user.email`, and names the file and value. An identity from the global config or a `git -c` passes. When the `README.md` of the root or of a workspace package holds a config example whose `package` is an `@antelopejs/*` package, such as `source: { type: "package", package: "@antelopejs/brevo", version: ">=0.0.9 <0.1.0" }`, it also runs `readme:version`. It fails when that example's `version` range does not stop below the next minor of the package's newest version and admit it, as [Dependency ranges](#dependency-ranges) reads a range, and names the README line and the range to use. The newest version of a package of the repository is the `version` in its `package.json`. For any other package it is the `latest` dist-tag on the registry npm is configured with, and the step fails when it cannot read it. A value that is not a range, such as `latest`, passes. When the root or a workspace package is not `private` and names declarations through `types`, `typings` or `exports`, it also runs `published:types`, after `test` and alone. It runs each such package's `prepack` through `pnpm run` or `npm run`, then packs it with lifecycle scripts off, so `prepare` and `postpack` do not run. It installs the tarball alone in a scratch folder without install scripts, together with the package's peers (optional ones included), `typescript` and `@types/node`, both at their latest version unless the package names them as peers. A workspace package it depends on comes from that package's own tarball, not from the registry. Then it runs `tsc` with `skipLibCheck: false`, `strict` and `nodenext` resolution over a file that imports each entry the package's `exports` names, a `*` subpath once per shipped file it matches. A package without `exports` gets its bare name and every declaration file it ships instead. The step fails on any error and names each file as `<package>/<path>`. It needs the registry, so it fails offline unless the package manager's store already holds what the install needs.
237
+ `pnpm run checks` runs `typecheck`, `lint`, `format:check`, `knip`, `test`, `size`, `suppressions` and `sync:check`, plus `ratchet` when `guardrails.ratchet.json` exists. It prints only the output of the steps that failed, and the errors `published:types` declares as known. Sync adds the ratchet scripts and pre-commit hook only while `guardrails.ratchet.json` exists. When the repository has a verify layer, an `.agents/skills/verify-*` folder holding a `verify.config.ts` or a `tsconfig.json`, it also runs `verify:types` and `verify:lockfiles`, which need no package script. Neither writes a file in the repository, spawns a package manager or fetches anything, so both pass offline after a root install, as CI runs them. When the repository holds a `pnpm-lock.yaml`, outside what `.gitignore` leaves out, it also runs `lockfile:singletons`, which fails when a lockfile resolves an `@antelopejs/interface-*` package at more than one version and names the importers and packages that pull each copy. It reads the lockfiles only. Sync lists `@antelopejs/interface-*` under `minimumReleaseAgeExclude` in a pnpm repository's `pnpm-workspace.yaml`, and in the `pnpm-workspace.yaml` of each folder with its own `pnpm-lock.yaml`, and of each `playground` with a `package.json` that no workspace above lists, before its first install: pnpm installs that folder as a workspace of its own and does not read the root's file. It writes these nested files in a repository whose root npm installs too, there only in folders pnpm installs: one with a `pnpm-lock.yaml`, or a playground with no lockfile and no `package-lock.json` above it. A root that sets no `packageManager` counts as pnpm's unless it holds a `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, `bun.lock` or `bun.lockb` and no `pnpm-lock.yaml`. Without it, pnpm 11 and later resolve each range to an interface release more than a day old where the range admits one, so an install in the day after an interface release locks two copies. When a tracked `package.json` declares an `@antelopejs/*` package, it also runs `dependency:ranges` (see [Dependency ranges](#dependency-ranges)), which reads the manifests, and from the registry the `latest` dist-tag of each `@antelopejs/interface-*` package they take and the newest release of each DMS module. In a git checkout it also runs `git:identity`, which fails when the repository's own git config, the `.git/config` every worktree shares or a worktree's `config.worktree`, sets `user.name` or `user.email`, and names the file and value. An identity from the global config or a `git -c` passes. When the `README.md` of the root or of a workspace package holds a config example whose `package` is an `@antelopejs/*` package, such as `source: { type: "package", package: "@antelopejs/brevo", version: ">=0.0.9 <0.1.0" }`, it also runs `readme:version`. It fails when that example's `version` range does not stop below the next minor of the package's newest version and admit it, as [Dependency ranges](#dependency-ranges) reads a range, and names the README line and the range to use. The newest version of a package of the repository is the `version` in its `package.json`. For any other package it is the `latest` dist-tag on the registry npm is configured with, and the step fails when it cannot read it. A value that is not a range, such as `latest`, passes. When the root or a workspace package is not `private` and names declarations through `types`, `typings` or `exports`, it also runs `published:types`, after `test` and alone. It runs each such package's `prepack` through `pnpm run` or `npm run`, then packs it with lifecycle scripts off, so `prepare` and `postpack` do not run. It installs the tarball alone in a scratch folder without install scripts, together with the package's peers (optional ones included), `typescript` and `@types/node`, both at their latest version unless the package names them as peers. A workspace package it depends on comes from that package's own tarball, not from the registry. Then it runs `tsc` with `skipLibCheck: false`, `strict` and `nodenext` resolution over a file that imports each entry the package's `exports` names, a `*` subpath once per shipped file it matches. A package without `exports` gets its bare name and every declaration file it ships instead. The step fails on any error and names each file as `<package>/<path>`. An error inside the declarations of a dependency the repository does not publish, which the repository cannot fix, is declared in `guardrails.published-types.json` at the root, by the dependency, the file inside it and the code tsc prints:
238
+
239
+ ```json
240
+ {
241
+ "knownFailures": [
242
+ {
243
+ "dependency": "rethinkdb-ts",
244
+ "file": "lib/response/cursor.d.ts",
245
+ "code": "TS2416"
246
+ }
247
+ ]
248
+ }
249
+ ```
250
+
251
+ An entry matches every error with that code in that file, at any line. The step prints each matched error under `errors guardrails.published-types.json declares as known` whether it passes or fails, and passes when every error it found is declared. An error in a package of the repository, or in a file or with a code no entry names, still fails, and an entry may not name a package of the repository. Once tsc ran over every package, an entry that matched no error fails with `<dependency>/<file> <code> no longer occurs. Remove the entry.`, so the entry goes when the dependency fixes its declarations. When the step runs, a malformed file, an entry with a path tsc does not print (such as `./lib/x.d.ts`) or a repeated entry fails it before anything is packed. It needs the registry, so it fails offline unless the package manager's store already holds what the install needs.
238
252
 
239
253
  - `verify:types` type-checks each layer's own code with the repository's own TypeScript, run as `node <typescript>/bin/tsc` without a shell. A repository that installs the TypeScript 6 API as `typescript` (`npm:@typescript/typescript6`) for tools that need it, beside TypeScript 7 as `@typescript/native`, runs `@typescript/native`'s `tsc`. The files are those the layer's `tsconfig.json` includes, minus its `playground` folder and any `node_modules` or `dist` folder: verify compiles a playground itself, with the playground's own config, after installing it. The step writes a config to the system temp folder that extends the layer's, lists those files, keeps the layer's type roots, sets `noEmit` and unsets with `null` the `declaration`, `composite`, `incremental`, `tsBuildInfoFile`, `declarationDir`, `declarationMap`, `emitDeclarationOnly` and `isolatedDeclarations` the layer may inherit, then deletes it. No `.tsbuildinfo` is written, no declaration check runs on code that is never emitted, and `skipLibCheck` keeps the layer's value. `antelopejs-sync` writes the `tsconfig.json` of the shared `verify-interface`, `verify-module` and `verify-template` layers; a repository's own layer, such as a `verify-dms-*` one, keeps the one it wrote. A layer with a `verify.config.ts` and no `tsconfig.json` fails, and so does one whose `tsconfig.json` does not include its `verify.config.ts`.
240
254
  - `verify:lockfiles` compares, in code, the direct dependencies each lockfile records with the `package.json` files it locks, and fails on a difference in either direction, naming the dependency and the command that regenerates the lockfile. It reads each lockfile in a folder under a layer, `node_modules` and `dist` aside, and in the root `playground`. A `pnpm-lock.yaml` is compared importer by importer, for each importer it lists that has a `package.json` on disk; a `package-lock.json` by its root entry. Only `dependencies`, `devDependencies` and `optionalDependencies` are compared, by name and specifier: a name counts as present whichever of the three fields records it, and a `catalog:` or `workspace:` specifier compares as written, as pnpm stores it. A name the lockfile records that `package.json` declares only in `peerDependencies` passes, whether or not peers are auto-installed. A name an override selector in the `pnpm-lock.yaml` mentions is not compared, nor is a `link:` dependency the lockfile leaves out under `excludeLinksFromLockfile`. A lockfile it cannot parse, or of a version before pnpm's 6 or npm's 2, fails as unreadable. A missing lockfile fails only in a layer's `playground` or the root `playground` whose `package.json` has dependencies, unless a folder above it holds a `pnpm-workspace.yaml` or a `package.json` with `workspaces`; the fix it names is npm's when a `package-lock.json` sits in a folder above, pnpm's otherwise. It does not check workspace membership, `overrides`, lockfile `settings`, catalogs, `.npmrc` or user configuration, resolved versions, integrity hashes, transitive entries, npm workspace members, or `yarn.lock` and `bun.lock`: verify's own frozen install still rejects a lockfile stale there.
@@ -468,6 +482,8 @@ An `@antelopejs/*` package ships breaking changes in minor releases, so a range
468
482
 
469
483
  A narrower range fails too: `@antelopejs/core` keeps one copy of each interface and refuses to start a module whose range that copy falls outside, so an exact pin (`0.1.7`) breaks startup at the next patch release. `file:` and `link:` specs are skipped. A `workspace:` spec is read as pnpm publishes it, `workspace:^` on a sibling at `1.2.3` as `^1.2.3`, so declare `workspace:~`; it is skipped in a `private` manifest, which is never published. The step runs only in a git checkout whose tracked manifests declare an `@antelopejs/*` package.
470
484
 
485
+ A range on an `@antelopejs/interface-*` package that is not in the repository must admit the interface version a project loads: `@antelopejs/core` loads one copy of each interface, so a project that installs `interface-dms-automation` 0.7.0 for one module cannot start another whose range stops at `<0.7.0`. When the newest release, the `latest` dist-tag on the registry npm is configured with, of a DMS module names the interface in `antelopeJs.implements`, that release decides: the range must share a release with the range the module declares on the interface. The modules read are `@antelopejs/dms` and those of the [generated DMS module table](./docs/documentation-checks.md#generated-dms-module-table), each published under its repository's name, except one that sits in the repository; a prerelease, or a range semver cannot read, does not count. A project that runs `dms-automation` 0.11.1, which implements `interface-dms-automation` on `>=0.7.0 <0.8.0`, cannot start a module on `>=0.6.0 <0.7.0` or `>=0.8.0 <0.9.0`, so the step fails both and prints the range on the minor that release implements, `use ">=0.7.0 <0.8.0"`. Any other interface must not stop below the package's own `latest`: the step fails `>=0.6.0 <0.7.0` once 0.7.0 is published and prints the range on the minor of that release, `use ">=0.7.0 <0.8.0"`, and a range whose floor is above that release passes. A read of the registry fails after two attempts of three seconds or on an error response. A DMS module the registry answers 404 for has no release. While a DMS module cannot be read, any interface no read release implements is held to the cap alone, since the unread one may implement it, and so is an interface whose `latest` cannot be read, so a registry outage does not fail the step.
486
+
471
487
  When the package sits in the same repository, as in a DMS monorepo, its range must also admit the version there, and `antelopejs-sync` moves it for you: a minor release of a sibling from `0.6.1` to `0.7.0` moves every `>=0.6.0 <0.7.0` on it to `>=0.7.0 <0.8.0`, then sync runs `pnpm install --lockfile-only` so the lockfile follows. The package is not on npm yet when the release hook runs, so the workspace must link it: set `link-workspace-packages=true` in `.npmrc` or `linkWorkspacePackages: true` in `pnpm-workspace.yaml`. When the relock fails, sync leaves the ranges unmoved and exits 1. An interface `.release-it.json` whose `after:bump` hook runs `pnpm --dir ../.. run sync` and `git add -u ../..` commits both with the release. `antelopejs-sync --check` reports the stale range as drift.
472
488
 
473
489
  ## Vendored anti-slop
@@ -5,7 +5,7 @@ import { t as runCli } from "../cli-4Tv71vYk.mjs";
5
5
  import { c as repositoryRoot, l as resolveRevision } from "../files-C-JJhExM.mjs";
6
6
  import { n as shimInvocation } from "../run-command-BlFRPORx.mjs";
7
7
  import { a as DIRECTORY_LINK, c as revisionCounts, d as createAddedPolicy, f as describeAllowance, i as stampProof, l as workspaceManifests, m as recordVerdict, o as compareRevisions, p as fillStars, u as allowedByGlob } from "../proof-stamp-BFV7JTZT.mjs";
8
- import { c as unpublishedAt, i as isTestSource, o as outputRoot, r as isExportPath, s as packagesAt, t as emitPackage } from "../typescript-CxfNxyr2.mjs";
8
+ import { c as unpublishedAt, i as isTestSource, o as outputRoot, r as isExportPath, s as packagesAt, t as emitPackage } from "../typescript-QfxkJYzd.mjs";
9
9
  import { createRequire } from "node:module";
10
10
  import { copyFileSync, cpSync, existsSync, globSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
11
11
  import { basename, dirname, isAbsolute, join, parse, posix, relative, resolve, sep } from "node:path";
@@ -1065,6 +1065,25 @@ function authoredDeclaration(directory, target, path, scratch) {
1065
1065
  copyFileSync(source, join(scratch, file));
1066
1066
  return file;
1067
1067
  }
1068
+ function declarationStem(path) {
1069
+ return path.replace(/\.d\.[cm]?ts$/u, "");
1070
+ }
1071
+ /** A path below its top-level directory; a top-level file is its own inner path. */
1072
+ function innerPath(path) {
1073
+ const [first, ...rest] = path.split("/");
1074
+ return rest.length ? rest.join("/") : first;
1075
+ }
1076
+ /** A package whose tsconfig sets no `outDir` publishes what a bundler lays out: `dist/a/b.d.mts` for `src/a/b.ts`, a path no compiler emit takes. The emit lays each module out below `rootDir`, else the package directory; the one emitted declaration of a module in the package whose path below its top-level directory is the target's, whatever its declaration extension, stands for it; none or several leave the target unmatched. */
1077
+ function bundledDeclaration(path, files, options, directory) {
1078
+ if (options.outDir !== void 0 || path.includes("*") || !path.includes("/")) return [];
1079
+ const root = options.rootDir ?? directory;
1080
+ const stem = declarationStem(innerPath(path));
1081
+ const found = files.filter((file) => {
1082
+ const source = relative(directory, resolve(root, file)).replaceAll("\\", "/");
1083
+ return !source.startsWith("../") && declarationStem(innerPath(source)) === stem;
1084
+ });
1085
+ return found.length === 1 ? found : [];
1086
+ }
1068
1087
  function publishedEntries(directory, manifest, emitted, scratch) {
1069
1088
  const outputRoot = resolve(directory, emitted.options.outDir ?? ".");
1070
1089
  const files = [...emitted.files, ...emitted.withheld].map((file) => relative(scratch, file).split("\\").join("/"));
@@ -1081,6 +1100,7 @@ function publishedEntries(directory, manifest, emitted, scratch) {
1081
1100
  if (!found.length) {
1082
1101
  const authored = authoredDeclaration(directory, target, path, scratch);
1083
1102
  if (authored !== void 0) found.push(authored);
1103
+ else found.push(...bundledDeclaration(path, files, emitted.options, directory));
1084
1104
  }
1085
1105
  if (!found.length && !path.includes("*")) throw new Error(`${directory}: published target ${target} has no emitted declaration.`);
1086
1106
  const matches = found.filter((file) => !isTestSource(outputRoot, join(outputRoot, file)));
@@ -1154,6 +1174,7 @@ function bundlePackage(paths, manifest, policy) {
1154
1174
  composite: false,
1155
1175
  incremental: false,
1156
1176
  noEmit: false,
1177
+ emitDeclarationOnly: true,
1157
1178
  rootDir: scratch,
1158
1179
  paths: emittedPaths(emitted, scratch)
1159
1180
  },
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as runCliAsync } from "../cli-4Tv71vYk.mjs";
3
3
  import { c as repositoryRoot } from "../files-C-JJhExM.mjs";
4
- import { r as runChecks, t as CHECKS_SKIP_ENV } from "../checks-DJ_CFEZH.mjs";
4
+ import { r as runChecks, t as CHECKS_SKIP_ENV } from "../checks-CSlWvky1.mjs";
5
5
  import { parseArgs } from "node:util";
6
6
  //#region src/bin/checks.ts
7
7
  const SIGNAL_EXIT = /* @__PURE__ */ new Map([
@@ -2,7 +2,7 @@
2
2
  import { t as runCli } from "../cli-4Tv71vYk.mjs";
3
3
  import { c as repositoryRoot } from "../files-C-JJhExM.mjs";
4
4
  import { c as revisionCounts, i as stampProof, o as compareRevisions } from "../proof-stamp-BFV7JTZT.mjs";
5
- import { a as listsNoFiles, n as extendedConfigs, s as packagesAt, t as emitPackage } from "../typescript-CxfNxyr2.mjs";
5
+ import { a as listsNoFiles, n as extendedConfigs, s as packagesAt, t as emitPackage } from "../typescript-QfxkJYzd.mjs";
6
6
  import { copyFileSync, existsSync, mkdirSync } from "node:fs";
7
7
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
8
8
  //#region src/guardrails/comment-proof.ts
package/dist/bin/sync.mjs CHANGED
@@ -7,9 +7,9 @@ import { a as VERIFY_KINDS, c as isVerifyKind, d as linkPointsAt, i as SYNCED_SK
7
7
  import { t as runCli } from "../cli-4Tv71vYk.mjs";
8
8
  import { _ as placeholderTestScript, f as CI_CONTEXT, g as ciWorkflow, i as hasChecksWorkflow, l as GITATTRIBUTES_ARTIFACT, m as CI_PATH, n as ciNodeCallers, r as ciRenovateSyncCallers, s as renovateArtifacts, t as MISSING_CHECKS_WORKFLOW } from "../workflow-C-oBwL2H.mjs";
9
9
  import { a as gitFiles, c as repositoryRoot } from "../files-C-JJhExM.mjs";
10
- import { n as workspaceDirectories, r as workspacePatterns, t as planDocs } from "../docs-compat-CSljVi3O.mjs";
10
+ import { n as workspaceDirectories, r as workspacePatterns, t as planDocs } from "../docs-compat-BAZiPLZt.mjs";
11
11
  import { n as shimInvocation } from "../run-command-BlFRPORx.mjs";
12
- import { a as stepsOf, i as matchingScripts, n as droppedChecksSteps, o as moveDependencyRanges, s as runPnpm } from "../checks-DJ_CFEZH.mjs";
12
+ import { a as stepsOf, c as installsWithPnpm, d as runPnpm, i as matchingScripts, l as verifyLayers, n as droppedChecksSteps, o as pnpmLockfiles, s as inWorkspace, u as moveDependencyRanges } from "../checks-CSlWvky1.mjs";
13
13
  import { i as recordedRelease, t as measureBaseline } from "../ratchet-DLCfeaPY.mjs";
14
14
  import { n as SUPPRESSIONS_FILE, r as adoptedBudget } from "../suppression-budget-CPDSFg4X.mjs";
15
15
  import { u as typescript } from "../suppressions-CxPnh4sC.mjs";
@@ -300,14 +300,25 @@ function makeExecutable(root, file, mode) {
300
300
  //#endregion
301
301
  //#region src/guardrails/pnpm-workspace.ts
302
302
  const PATH = "pnpm-workspace.yaml";
303
+ /** The folder a repository's playground lives in, which verify installs as a project of its own. */
304
+ const PLAYGROUND = "playground";
303
305
  /** The first pnpm that keeps `pnpm --dir <nested> install` in the nested project when the root `pnpm-workspace.yaml` has no `packages`. Earlier pnpm installs the root instead. */
304
306
  const SCOPED_NESTED_INSTALLS = "11.27.1";
307
+ /** The pnpm setting that lists the packages pnpm 11 installs the day they are published, despite its one-day `minimumReleaseAge` default. */
308
+ const EXCLUDE = "minimumReleaseAgeExclude";
305
309
  /**
306
- * What sync does for a repository without a `pnpm-workspace.yaml`, by its pinned pnpm. An unpinned pnpm counts as current.
310
+ * The packages sync lists under `minimumReleaseAgeExclude`. Under the one-day default, pnpm 11 resolves a range that admits
311
+ * an older interface release to that release, and only a range that admits nothing older to the new one, so a fresh install
312
+ * locks two copies of one interface and `lockfile:singletons` fails.
313
+ */
314
+ const FRESH_RELEASES = "@antelopejs/interface-*";
315
+ /**
316
+ * What sync does for a repository without a `pnpm-workspace.yaml`, by its pinned pnpm. An unpinned pnpm counts as current,
317
+ * and so does the pnpm of a repository whose root pins another package manager.
307
318
  * pnpm 10 and earlier only warn about an undecided build, so they get no file. pnpm 11 fails the install without one, and before 11.27.1 misroutes nested installs with one, so its pin must rise.
308
319
  */
309
320
  function creation(manifest) {
310
- const pinned = manifest.packageManager?.split("@")[1];
321
+ const pinned = packageManager(manifest) === "pnpm" ? manifest.packageManager?.split("@")[1] : void 0;
311
322
  if (pinned === void 0 || admits(`>=${SCOPED_NESTED_INSTALLS}`, pinned)) return "write";
312
323
  return admits(">=11.0.0", pinned) ? "raise" : "skip";
313
324
  }
@@ -318,74 +329,140 @@ function creation(manifest) {
318
329
  function skippedBuilds(captures) {
319
330
  return captures ? ["lefthook", "mongodb-memory-server"] : ["lefthook"];
320
331
  }
321
- /** Whether `current` holds nothing but builds sync turns off, so pnpm reads it only to make the repository root a workspace. */
322
- function onlyDecidedBuilds(current) {
332
+ /**
333
+ * The root `playground` and each verify layer's, when it has a `package.json` and no workspace above lists it: verify installs
334
+ * each as a project of its own, so its first lockfile comes from an install that reads only its own `pnpm-workspace.yaml`.
335
+ */
336
+ function playgrounds(root) {
337
+ return [PLAYGROUND, ...verifyLayers(root).map((layer) => `${layer}/${PLAYGROUND}`)].filter((folder) => existsSync(join(root, folder, "package.json")) && !inWorkspace(root, folder));
338
+ }
339
+ /**
340
+ * Each folder whose tracked `pnpm-lock.yaml` `lockfile:singletons` reads and each playground verify installs on its own,
341
+ * and in a pnpm repository the root, deciding the builds of the full profile's hooks and captures. In a repository whose
342
+ * root another package manager installs, only the nested folders pnpm installs. A root that pins no package manager is
343
+ * pnpm's unless it holds another package manager's lockfile.
344
+ */
345
+ function installRoots(root, manifest, profile) {
346
+ const pnpmRoot = manifest.packageManager === void 0 ? installsWithPnpm(root, ".") : packageManager(manifest) === "pnpm";
347
+ const locked = pnpmLockfiles(root).map((lockfile) => dirname(lockfile));
348
+ const unlocked = playgrounds(root).filter((folder) => pnpmRoot || installsWithPnpm(root, folder));
349
+ const nested = [.../* @__PURE__ */ new Set([...locked, ...unlocked])].filter((folder) => folder !== ".").map((folder) => ({
350
+ folder,
351
+ builds: []
352
+ }));
353
+ if (!pnpmRoot) return nested;
354
+ return [{
355
+ folder: "",
356
+ builds: profile === "full" ? skippedBuilds(usesCaptures(root)) : []
357
+ }, ...nested];
358
+ }
359
+ /** Whether `current` holds nothing but the settings sync writes, so pnpm reads it only to make the repository root a workspace. */
360
+ function onlySyncedSettings(current) {
323
361
  const document = parseDocument(current);
324
- const builds = document.get("allowBuilds");
325
- if (document.errors.length || !isMap(document.contents) || document.contents.items.length !== 1 || !isMap(builds) || !builds.items.length) return false;
362
+ if (document.errors.length || !isMap(document.contents)) return false;
326
363
  const synced = skippedBuilds(true);
327
- return builds.items.every(({ key, value }) => isScalar(key) && synced.includes(String(key.value)) && isScalar(value) && value.value === false);
364
+ return document.contents.items.every(({ key, value }) => {
365
+ if (!isScalar(key)) return false;
366
+ if (key.value === EXCLUDE) return isSeq(value) && value.items.every((item) => isScalar(item) && item.value === FRESH_RELEASES);
367
+ return key.value === "allowBuilds" && isMap(value) && value.items.length > 0 && value.items.every((build) => isScalar(build.key) && synced.includes(String(build.key.value)) && isScalar(build.value) && build.value.value === false);
368
+ });
369
+ }
370
+ /** Sets `allowBuilds.<name>` to `false` for each of `names` the repository does not already decide. Returns whether it changed `document`. */
371
+ function decideBuilds(document, names) {
372
+ if (!names.length) return false;
373
+ if (document.get("allowBuilds") == null) document.set("allowBuilds", document.createNode({}));
374
+ const builds = document.get("allowBuilds");
375
+ if (!isMap(builds)) throw new Error("allowBuilds must be a mapping.");
376
+ const undecided = names.filter((name) => builds.get(name) == null);
377
+ if (!undecided.length) return false;
378
+ builds.flow = false;
379
+ for (const name of undecided) builds.set(name, false);
380
+ return true;
381
+ }
382
+ /** Adds `FRESH_RELEASES` to an existing `minimumReleaseAgeExclude` list unless it holds it. Returns whether it changed `document`. */
383
+ function excludeFreshReleases(document) {
384
+ const excluded = document.get(EXCLUDE);
385
+ if (!isSeq(excluded)) throw new Error(`${EXCLUDE} must be a list.`);
386
+ if (excluded.items.some((item) => isScalar(item) && item.value === FRESH_RELEASES)) return false;
387
+ excluded.flow = false;
388
+ excluded.add(FRESH_RELEASES);
389
+ return true;
390
+ }
391
+ /** `text` followed by a line break when it lacks one, and by `block`, so a file sync only appends to keeps every other byte, flow-map padding included. */
392
+ function appended(text, block) {
393
+ return `${text}${text === "" || text.endsWith("\n") ? "" : "\n"}${block}`;
328
394
  }
329
395
  /**
330
- * `current` with `allowBuilds.<name>` set to `false` for each of `names` the repository does not already decide.
331
- * pnpm 11 fails an install on a dependency build it was not told about.
396
+ * `current` with `allowBuilds.<name>` set to `false` for each of `names` the repository does not already decide, and
397
+ * `@antelopejs/interface-*` in `minimumReleaseAgeExclude`. pnpm 11 fails an install on a dependency build it was not told
398
+ * about, and locks two copies of an interface released less than a day ago.
332
399
  */
333
- function withBuildsDecided(names, current = "") {
400
+ function withSyncedSettings(names, current = "") {
401
+ const exclude = `${EXCLUDE}:\n - "${FRESH_RELEASES}"\n`;
334
402
  const document = parseDocument(current);
335
- if (document.errors.length) throw new Error(`${PATH}: ${document.errors.map(({ message }) => message).join("; ")}`);
403
+ if (document.errors.length) throw new Error(document.errors.map(({ message }) => message).join("; "));
336
404
  if (document.toJS() == null) {
337
405
  const kept = current.trimStart();
338
406
  const lines = names.map((name) => ` ${name}: false\n`).join("");
339
- return `${kept}${kept === "" || kept.endsWith("\n") ? "" : "\n"}allowBuilds:\n${lines}`;
407
+ return appended(names.length ? appended(kept, `allowBuilds:\n${lines}`) : kept, exclude);
340
408
  }
341
- if (!isMap(document.contents)) throw new Error(`${PATH} must contain a YAML mapping.`);
342
- if (document.get("allowBuilds") == null) document.set("allowBuilds", document.createNode({}));
343
- const builds = document.get("allowBuilds");
344
- if (!isMap(builds)) throw new Error(`${PATH}: allowBuilds must be a mapping.`);
345
- const undecided = names.filter((name) => builds.get(name) == null);
346
- if (!undecided.length) return current;
409
+ if (!isMap(document.contents)) throw new Error("its top level must be a YAML mapping.");
410
+ const absent = document.get(EXCLUDE) == null;
411
+ const decided = decideBuilds(document, names);
412
+ const excluded = !absent && excludeFreshReleases(document);
347
413
  document.contents.flow = false;
348
- builds.flow = false;
349
- for (const name of undecided) builds.set(name, false);
350
- return document.toString({
414
+ const text = decided || excluded ? document.toString({
351
415
  lineWidth: 0,
352
416
  flowCollectionPadding: false
353
- });
417
+ }) : current;
418
+ return absent ? appended(text, exclude) : text;
419
+ }
420
+ /** Why sync refuses a repository root `pnpm-workspace.yaml` that holds only its own settings under `action`. */
421
+ function refusal(action, builds) {
422
+ const need = builds.length ? `to install ${builds.join(" and ")}` : "to lock one copy of an interface released less than a day ago";
423
+ return action === "skip" ? `${PATH} holds nothing but the settings antelopejs-sync writes. pnpm before 11 does not need it, and it makes a nested \`pnpm install\` install the repository root. Delete ${PATH}, then rerun antelopejs-sync.` : `pnpm 11 needs a ${PATH} ${need}, and before ${SCOPED_NESTED_INSTALLS} that file makes a nested \`pnpm install\` install the repository root. Set \`packageManager\` to \`pnpm@${SCOPED_NESTED_INSTALLS}\` or later, then rerun antelopejs-sync.`;
354
424
  }
355
- /** The `pnpm-workspace.yaml` a full-profile pnpm repository needs so pnpm 11 and later install the builds sync declares without `ERR_PNPM_IGNORED_BUILDS`. */
356
- function pnpmWorkspaceArtifacts(root, manifest, managed) {
357
- if (!managed || packageManager(manifest) !== "pnpm") return [];
358
- const file = join(root, PATH);
425
+ /** The artifact for the `pnpm-workspace.yaml` of one install root; none for a file sync need not create. */
426
+ function installRootArtifact(root, manifest, { folder, builds }) {
427
+ const path = folder === "" ? PATH : posix.join(folder, PATH);
428
+ const file = join(root, path);
359
429
  const current = existsSync(file) ? readFileSync(file, "utf8") : void 0;
360
- const names = skippedBuilds(usesCaptures(root));
361
430
  try {
362
- const content = withBuildsDecided(names, current);
431
+ const content = withSyncedSettings(builds, current);
363
432
  const action = creation(manifest);
364
- if (action !== "write" && onlyDecidedBuilds(content)) {
365
- if (action === "skip" && current === void 0) return [];
366
- return [{
367
- kind: "error",
368
- path: PATH,
369
- message: action === "skip" ? `${PATH} holds nothing but the allowBuilds that antelopejs-sync writes. pnpm before 11 does not need it, and it makes a nested \`pnpm install\` install the repository root. Delete ${PATH}, then rerun antelopejs-sync.` : `pnpm 11 needs a ${PATH} to install ${names.join(" and ")}, and before ${SCOPED_NESTED_INSTALLS} that file makes a nested \`pnpm install\` install the repository root. Set \`packageManager\` to \`pnpm@${SCOPED_NESTED_INSTALLS}\` or later, then rerun antelopejs-sync.`
370
- }];
371
- }
433
+ if (action === "skip" && current === void 0) return [];
434
+ if (folder === "" && action !== "write" && onlySyncedSettings(content)) return [{
435
+ kind: "error",
436
+ path,
437
+ message: refusal(action, builds)
438
+ }];
372
439
  return [content === current ? {
373
440
  kind: "unchanged",
374
- path: PATH
441
+ path
375
442
  } : {
376
443
  kind: "write",
377
- path: PATH,
444
+ path,
378
445
  content,
379
446
  mode: void 0
380
447
  }];
381
448
  } catch (error) {
449
+ const settings = [...builds.length ? [`\`allowBuilds: { ${builds.map((name) => `${name}: false`).join(", ")} }\``] : [], `\`${EXCLUDE}: ["${FRESH_RELEASES}"]\``];
382
450
  return [{
383
451
  kind: "error",
384
- path: PATH,
385
- message: `${error instanceof Error ? error.message : String(error)} Add \`allowBuilds: { ${names.map((name) => `${name}: false`).join(", ")} }\` to it, then rerun antelopejs-sync.`
452
+ path,
453
+ message: `${path}: ${error instanceof Error ? error.message : String(error)} Add ${settings.join(" and ")} to it, then rerun antelopejs-sync.`
386
454
  }];
387
455
  }
388
456
  }
457
+ /**
458
+ * The `pnpm-workspace.yaml` of each folder pnpm installs as its own workspace root: the root of a pnpm repository and each
459
+ * nested folder with its own `pnpm-lock.yaml` or that verify installs with pnpm on its own. Each lists `@antelopejs/interface-*` under `minimumReleaseAgeExclude`,
460
+ * so pnpm 11 and later lock one copy of an interface released less than a day ago. A full-profile root also decides the
461
+ * builds sync declares, so pnpm 11 installs them without `ERR_PNPM_IGNORED_BUILDS`.
462
+ */
463
+ function pnpmWorkspaceArtifacts(root, manifest, profile) {
464
+ return installRoots(root, manifest, profile).flatMap((installRoot) => installRootArtifact(root, manifest, installRoot));
465
+ }
389
466
  //#endregion
390
467
  //#region src/guardrails/backend-boundary.ts
391
468
  /** Where a DMS frontend layer keeps its backend boundary plugin, relative to the layer. */
@@ -942,7 +1019,7 @@ const KIND_TEXT = {
942
1019
  description: "Drive this AntelopeJS interface the way a module author does: pack it, load it in `ajs project dev` next to a stub provider wired through ImplementInterface and a consumer, call every declared function through core, and check the minor-bump rule against the published version. Use to prove a change to the interface works before merge, or to verify a PR.",
943
1020
  title: "Verify interface",
944
1021
  user: "The user of an interface is a module author: one module implements it, others import it and call its functions through core.",
945
- launch: "`new` runs the setup (`pnpm run build` by default), then packs the interface with `pnpm pack` and extracts it, so journeys load what npm would publish, `files` and `exports` included. Every `services` entry of `verify.config.ts` then starts in its own Docker container on a free loopback port, as for a module.",
1022
+ launch: "`new` runs the setup (`pnpm run build` by default), then runs the interface's `prepack` through `pnpm run`, packs it with `pnpm pack` with lifecycle scripts off, and extracts it, so journeys load what npm would publish, `files` and `exports` included. Every `services` entry of `verify.config.ts` then starts in its own Docker container on a free loopback port, as for a module.",
946
1023
  builtins: `- \`every-function\`: a fixture project loads the packed interface with a stub provider and a consumer module. The consumer walks the loaded interface, and every function the \`.d.ts\` files declare is called through core:
947
1024
  - an async proxy answers the stub's echo, and the stub's call log shows the same arguments (the second view);
948
1025
  - a registering proxy registers and unregisters, and the stub logs both;
@@ -1597,7 +1674,7 @@ function syncRepository(root, options = {}) {
1597
1674
  const standalone = [
1598
1675
  ...backendBoundaryArtifacts(root),
1599
1676
  ...renovateArtifacts(root, manifest, profile === "full" || verify.kind === "template"),
1600
- ...pnpmWorkspaceArtifacts(root, manifest, profile === "full")
1677
+ ...pnpmWorkspaceArtifacts(root, manifest, profile)
1601
1678
  ];
1602
1679
  let plan = [...planSync(current, executables, context), ...standalone];
1603
1680
  const errors = plan.filter((artifact) => artifact.kind === "error").map(({ message }) => message);
@@ -4,6 +4,7 @@ import { a as isString, c as object, f as parseJson, i as isObject, n as childre
4
4
  import { a as exitIs, c as interrupted, i as exists, r as equal, u as refused } from "../checks-CxkSu2E6.mjs";
5
5
  import { n as runCliAsync } from "../cli-4Tv71vYk.mjs";
6
6
  import { c as repositoryRoot } from "../files-C-JJhExM.mjs";
7
+ import { t as packSteps } from "../pack-tarball-Cn4zGKn7.mjs";
7
8
  import { C as pauseSync, S as writeWhole, _ as ownRun, a as readFeatures, b as saveRun, c as allocateRun, d as git, f as isolatedEnv, g as operatorTmpdir, h as operatorEnv, i as planFor, l as canonical, m as openWorkspace, n as SMOKE_FEATURE, o as CACHE_DIR, p as loadRun, r as checkMap, s as RUNS_DIR, u as commandRecords, v as recordProcesses, w as matchesPath, x as withLocalBins, y as removeTree } from "../map-BYkmnvNw.mjs";
8
9
  import { t as relativeSlashed } from "../slash-BEgSnfYw.mjs";
9
10
  import { n as launch, r as spawnLaunched, t as killTree } from "../launch-D5cylwvb.mjs";
@@ -2780,7 +2781,7 @@ const BUILD_ONLY_PREPACKS = /* @__PURE__ */ new Set([
2780
2781
  function script(workspace, name) {
2781
2782
  return optStr(child(workspace.manifest, "scripts"), name);
2782
2783
  }
2783
- /** Whether `pnpm pack` builds the package itself, so a setup build before it would run the same build twice. */
2784
+ /** Whether packing builds the package itself through its `prepack`, so a setup build before it would run the same build twice. */
2784
2785
  function packBuilds(workspace) {
2785
2786
  const prepack = script(workspace, "prepack");
2786
2787
  return workspace.kind === "interface" && prepack !== void 0 && BUILD_ONLY_PREPACKS.has(prepack.trim());
@@ -2823,18 +2824,17 @@ async function packInterface(workspace, state) {
2823
2824
  const folder = join(state.dir, "pack");
2824
2825
  mkdirSync(folder, { recursive: true });
2825
2826
  const env = isolatedEnv(workspace, join(state.dir, "home"));
2826
- const packed = await runRecorded(join(state.evidence, "setup", "pack"), {
2827
- program: "pnpm",
2828
- args: [
2829
- "pack",
2830
- "--pack-destination",
2831
- folder
2832
- ],
2833
- cwd: workspace.root,
2834
- env
2835
- });
2827
+ for (const [index, args] of packSteps("pnpm", folder).entries()) {
2828
+ const step = await runRecorded(join(state.evidence, "setup", "pack", `0${index + 1}-${args[0]}`), {
2829
+ program: "pnpm",
2830
+ args,
2831
+ cwd: workspace.root,
2832
+ env
2833
+ });
2834
+ if (step.exitCode !== 0) throw new Error(`pnpm pack failed; see ${step.folder}\n${outputTail(step)}`);
2835
+ }
2836
2836
  const tarball = readdirSync(folder).find((file) => file.endsWith(".tgz"));
2837
- if (packed.exitCode !== 0 || tarball === void 0) throw new Error(`pnpm pack failed; see ${packed.folder}\n${outputTail(packed)}`);
2837
+ if (tarball === void 0) throw new Error(`pnpm pack left no tarball in ${folder}`);
2838
2838
  const extract = await runRecorded(join(state.evidence, "setup", "extract"), {
2839
2839
  program: "tar",
2840
2840
  args: [
@@ -3513,10 +3513,10 @@ function bornAt(path) {
3513
3513
  return 0n;
3514
3514
  }
3515
3515
  }
3516
- /** Whether `project` held the lock record of `name@version` when a command that started at `start` began; `ajs` writes a record only after an install that used none. */
3517
- function pinned(project, name, version, start) {
3516
+ /** Whether `project` held the lock record of the registry module cached as `entry` (`<name>@<version>`, the name `ajs` gives both) when a command that started at `start` began; `ajs` writes a record only after an install that used none. */
3517
+ function pinned(project, entry, start) {
3518
3518
  try {
3519
- const record = join(project, LOCK_FOLDER, `${name}@${version}`);
3519
+ const record = join(project, LOCK_FOLDER, entry);
3520
3520
  return lstatSync(record, { bigint: true }).mtimeNs <= start;
3521
3521
  } catch {
3522
3522
  return false;
@@ -3532,7 +3532,7 @@ function names(folder) {
3532
3532
  /** Why a module the harness recorded as `known` is no longer that install, now that the manifest lists `version` in a folder created at `born`. */
3533
3533
  function reinstalled(name, known, version, born) {
3534
3534
  if (known.version !== version) return `${name} changed from ${known.version} to ${version} after ajs installed it`;
3535
- if (born !== known.born) return `${name} was created again after ajs installed ${name}@${version}`;
3535
+ if (born !== known.born) return `${name} was created again after ajs installed it`;
3536
3536
  }
3537
3537
  /** Whether a project's antelope config (antelope.json or antelope.config.*) mentions `cacheFolder`, so `ajs` may install somewhere other than `.antelope/cache`. */
3538
3538
  function namesCacheFolder(project) {
@@ -3545,7 +3545,7 @@ function namesCacheFolder(project) {
3545
3545
  /** Why a registry module the project followed is no longer among `modules`, or `undefined` when each still is. */
3546
3546
  function departure(state, modules) {
3547
3547
  const listed = new Set(modules.map(([name]) => name));
3548
- for (const [name, known] of state.installed) if (!listed.has(name)) return `${name} left ${MANIFEST} after ajs installed ${name}@${known.version}`;
3548
+ for (const name of state.installed.keys()) if (!listed.has(name)) return `${name} left ${MANIFEST} after ajs installed it`;
3549
3549
  }
3550
3550
  /** Whether `name`, listed at `version`, is a git module `state` does not follow; one seen for the first time joins `added`. */
3551
3551
  function recordGit(state, name, version, added) {
@@ -3554,7 +3554,7 @@ function recordGit(state, name, version, added) {
3554
3554
  state.git.add(name);
3555
3555
  return true;
3556
3556
  }
3557
- /** The manifest `ajs` writes each time it finishes installing a module: its modification time and each module's version, sorted by module. */
3557
+ /** The manifest `ajs` writes each time it finishes installing a module: its modification time and each module's version, sorted by the module's cache folder, `<name>@<version>` for a registry module and the remote's file name for a git module. */
3558
3558
  function manifestOf(cache) {
3559
3559
  try {
3560
3560
  const file = join(cache, MANIFEST);
@@ -3581,7 +3581,7 @@ function manifestOf(cache) {
3581
3581
  function changeIn(cache, installed, folders, left) {
3582
3582
  const modules = [...installed].map(([name, module]) => ({
3583
3583
  folder: join(name),
3584
- label: `${name}@${module.version}`,
3584
+ label: name,
3585
3585
  bound: module.bound
3586
3586
  }));
3587
3587
  try {
@@ -3712,7 +3712,7 @@ var ProjectCaches = class {
3712
3712
  const known = state.installed.get(name);
3713
3713
  if (recordGit(state, name, version, added)) continue;
3714
3714
  if (known === void 0) {
3715
- added.push(`${name}@${version}`);
3715
+ added.push(name);
3716
3716
  if (state.git.has(name)) state.refused ??= `${name} changed from a git module to ${version} after ajs installed it`;
3717
3717
  state.installed.set(name, {
3718
3718
  version,
@@ -3720,7 +3720,7 @@ var ProjectCaches = class {
3720
3720
  bound: manifest.mtime
3721
3721
  });
3722
3722
  if (manifest.mtime > latest) latest = manifest.mtime;
3723
- if (pinned(project, name, version, start)) state.refused ??= `ajs installed ${name}@${version} from the project's lock record`;
3723
+ if (pinned(project, name, start)) state.refused ??= `ajs installed ${name} from the project's lock record`;
3724
3724
  } else state.refused ??= reinstalled(name, known, version, born);
3725
3725
  }
3726
3726
  if (!ajs && added.length > 1) state.refused ??= `${added.join(" and ")} appeared in one command that is not ajs, which may have changed one of them before ajs installed the next`;