@pnpm/pnpr 0.0.0-26070301 → 0.1.0-alpha.11
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/CHANGELOG.md +182 -0
- package/README.md +73 -0
- package/install.js +24 -0
- package/package.json +12 -12
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# @pnpm/pnpr
|
|
2
|
+
|
|
3
|
+
## 0.1.0-alpha.11
|
|
4
|
+
|
|
5
|
+
pnpr now serves Cargo, Python, and container registries alongside npm, publishes across all of them in one transaction, and signs users in through OIDC.
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
#### Cargo and Python registries
|
|
10
|
+
|
|
11
|
+
- pnpr now serves Cargo and Python registries alongside npm from one instance. Hosted Cargo registries support `cargo publish`, `cargo yank`, and crate downloads. Hosted Python registries support `pip install --index-url` and `twine upload`. Upstream registries can proxy crates.io and PyPI with checksum verified downloads, and a router can combine sources from all three ecosystems.
|
|
12
|
+
|
|
13
|
+
A registry that serves more than one ecosystem addresses them through `/npm/`, `/cargo/`, and `/pypi/`. A registry that serves only one ecosystem keeps serving packages at the root, so existing npm URLs still work. A `/~<name>/` registry prefix must arrive with an unencoded `~`.
|
|
14
|
+
|
|
15
|
+
Registry names can be reused across ecosystems by grouping configuration under `registries.npm`, `registries.cargo`, `registries.pypi`, or `registries.oci`. Router sources and defaults resolve within their own ecosystem.
|
|
16
|
+
|
|
17
|
+
- `pnpm install` now resolves Cargo and Python dependencies through the server configured in `pnprServer`. The client no longer fetches one sparse-index file per crate in the dependency graph, and no longer downloads a wheel to find out what it requires. If the server does not serve that resolution, pnpm resolves those dependencies locally.
|
|
18
|
+
|
|
19
|
+
- `pnpm install` can install Cargo dependencies from the sparse registry configured by `cargo.indexUrl`. The generated `Cargo.lock` records that registry as the source of every crate.
|
|
20
|
+
|
|
21
|
+
- `cargo search` works against a pnpr registry. It matches on crate name over the crates the registry hosts. Each result reports the crate's newest release that is not yanked, and a crate whose releases are all yanked reports its newest release.
|
|
22
|
+
|
|
23
|
+
#### Container images
|
|
24
|
+
|
|
25
|
+
- pnpr now serves container images [#14630](https://github.com/pnpm/pnpm/issues/14630). Declare a registry with `ecosystem: oci`, then push to it with `docker`, `podman`, or `skopeo`. The distribution API answers at `/v2/` on the host root, and an image keeps its own name with no registry key in the path. Sign in with `docker login`, using a pnpr token as the password, or set `oci.bearerAuth: true` to hand clients short lived, repository scoped credentials instead.
|
|
26
|
+
|
|
27
|
+
Ranged blob downloads, cross repository blob mounts, the referrers API, and paginated tag and repository listings are supported. Authorized users can delete unreferenced blobs, and a blob that a retained manifest still reaches stays protected while another publish is running. `oci.maxBlobBytes` and `oci.maxManifestBytes` cap what a client may upload.
|
|
28
|
+
|
|
29
|
+
- pnpr can cache image pulls from Docker Hub and GHCR [#14630](https://github.com/pnpm/pnpm/issues/14630). Upstream authentication supports repository scoped bearer tokens, and pnpr verifies every cached image by digest. A proxied download whose contents fail verification is aborted and stays out of the cache.
|
|
30
|
+
|
|
31
|
+
- pnpr can resume OCI uploads across replicas when it keeps blobs in S3. Abandoned shared upload sessions expire at startup after 24 hours of inactivity. `pnpr oci-gc --registry <name>` collects old, unreferenced image blobs while registry writers are stopped, and `--dry-run` previews the cleanup.
|
|
32
|
+
|
|
33
|
+
#### Publishing and authentication
|
|
34
|
+
|
|
35
|
+
- pnpr can now publish packages of more than one ecosystem in a single transaction. `PUT /-/pnpr/v0/publish` takes a batch whose entries each name their `ecosystem`, so a workspace that ships an npm package, a crate, and a Python distribution releases them together. OCI manifests can ride along in the same batch once their layers are uploaded [#14630](https://github.com/pnpm/pnpm/issues/14630). A batch that fails a check publishes none of it, and a server that stops midway finishes the release on the next startup. An entry without an `ecosystem` is an npm publish document, the same one `PUT /-/pnpm/v1/publish` takes.
|
|
36
|
+
|
|
37
|
+
- pnpr now supports OIDC browser sign in. Administrators can map provider subjects to registry users, and GitHub Actions can publish npm packages without a persistent registry token. Workload publishing is restricted to the packages you configure.
|
|
38
|
+
|
|
39
|
+
#### Builds and pipelines
|
|
40
|
+
|
|
41
|
+
- pnpr can share Cargo compilation caches between CI and developers through sccache. Configure `artifacts.compilerCaches` to grant read and publication access separately. sccache can combine its local disk cache with pnpr's remote cache.
|
|
42
|
+
|
|
43
|
+
- pnpr can store `pnpm pipeline` run reports. Turn it on with `pipeline.enabled` and configure each workspace's `access` and `publish` permissions under `pipeline.workspaces`. `pnpm pipeline --report` and `--report-to` submit run summaries and events, and pnpr answers with authenticated listing and detail endpoints and a web viewer. Records are kept with the hosted packages, so a run submitted through one replica is listed and served by every other.
|
|
44
|
+
|
|
45
|
+
#### Discovery and administration
|
|
46
|
+
|
|
47
|
+
- pnpr can now serve browser registry UIs through an origin allowlist. Search supports pagination and maintainer filters, organization package listings are available, and authenticated publishers are recorded for discovery. Upstream discovery can be enabled per registry. Passing `browse=true` to the search APIs pages through the npm packages and Cargo crates a registry hosts, respecting its routing and package access rules.
|
|
48
|
+
|
|
49
|
+
A registry directory endpoint lists the named registries, ecosystem endpoints, and routing order that the current user can see.
|
|
50
|
+
|
|
51
|
+
- pnpr now reads every command line option from an environment variable when the flag is omitted. The variable is named after the flag with a `PNPR_` prefix, so `--public-url` becomes `PNPR_PUBLIC_URL` and `--disable-resolver` becomes `PNPR_DISABLE_RESOLVER`. A flag given on the command line wins over its environment variable. Boolean flags accept `true`, `1`, `yes`, `on`, `false`, `0`, `no`, and `off`.
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- pnpr now rejects a package name that carries `?`, `#`, `%`, whitespace, or a control character, and holds artifact filenames to the same rule. A percent encoded delimiter let a request read an upstream package under a name the access rules had not checked.
|
|
56
|
+
|
|
57
|
+
- pnpr now resolves JSR packages without configuration. npm.jsr.io is a built-in public route, like the npm registry. The built-in routes are reachable over HTTPS only.
|
|
58
|
+
|
|
59
|
+
- A publish that loses a write race now reports `document_write_conflict` on every registry surface, and the message names the package document [#14599](https://github.com/pnpm/pnpm/issues/14599). A publish whose file another writer had already stored under the same name now answers `409` instead of `201`, which it answered while leaving the version out of the registry document. Both cases arise only where several pnpr instances share one object store.
|
|
60
|
+
|
|
61
|
+
- A staged publish is now approved once, whichever replica of a shared registry the approval reaches [#12199](https://github.com/pnpm/pnpm/issues/12199). A second approval of the same stage answers `409`. Rejecting a stage stops an approval that has not published it yet.
|
|
62
|
+
|
|
63
|
+
- Registration no longer fails when several users sign up at the same time against a libsql backend with a configured user limit.
|
|
64
|
+
|
|
65
|
+
- pnpr now records a URL's query exactly as it was written when it redacts the credentials in an error message. It re-encoded the query, rewriting `?options=a%20b` as `?options=a+b`.
|
|
66
|
+
|
|
67
|
+
## 0.1.0-alpha.10
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- A shared build artifact publication that cannot unregister itself no longer stops the registry reclaiming space or refusing further publications. A publication says at intervals that it is still working, and a registration that has gone quiet for an hour is written off, so a publication whose bookkeeping write failed stops holding back the collector that reclaims unreferenced blobs and returns the compatibility scopes a failed publication claimed, and stops counting toward the limit on publications in flight.
|
|
72
|
+
|
|
73
|
+
## 0.1.0-alpha.9
|
|
74
|
+
|
|
75
|
+
### Minor Changes
|
|
76
|
+
|
|
77
|
+
- Made the signed shared-artifact cache horizontally scalable with S3-compatible storage and an independent top-level `artifacts` feature toggle.
|
|
78
|
+
|
|
79
|
+
- Generalized the experimental shared-artifact protocol so candidates and signed payloads identify a discriminated subject. Dependency side effects use package and source-integrity subjects, while workspace tasks use project and task subjects.
|
|
80
|
+
|
|
81
|
+
This changes shared-artifact request bodies and signed payloads. A pnpr server and its clients have to be on matching versions.
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- A published build artifact is now immutable: one input key and one set of compatibility constraints admit one artifact, so publishing a different one over it answers `409 Conflict`, the same as a re-published `name@version`. Republishing the identical artifact still succeeds. Artifacts already stored by an earlier version keep their slot, so upgrading a populated registry does not leave them replaceable.
|
|
86
|
+
|
|
87
|
+
- A published build artifact is now immutable for every consumer it can reach, not only for the exact compatibility constraints it declares. Publishing an artifact that reaches a machine an existing one already reaches answers `409 Conflict`, so a later universal, broader, or higher-floor build can no longer take precedence over the artifact a consumer already receives. Publishing across a platform matrix is unaffected: artifacts for different operating systems, architectures, or Node majors reach no machine in common and coexist as before.
|
|
88
|
+
|
|
89
|
+
- pnpr reclaims unreferenced shared artifact blobs after ambiguous object-storage write failures once active publications drain.
|
|
90
|
+
|
|
91
|
+
- Recognize `pnpm install --fix-lockfile`, including filtered installs, and regenerate broken lockfile metadata while preserving compatible locked versions [pnpm/pnpm#14250](https://github.com/pnpm/pnpm/issues/14250).
|
|
92
|
+
|
|
93
|
+
- pnpr retains shared artifact quota after object storage reports an ambiguous write failure.
|
|
94
|
+
|
|
95
|
+
## 0.1.0-alpha.8
|
|
96
|
+
|
|
97
|
+
### Minor Changes
|
|
98
|
+
|
|
99
|
+
- Added an opt-in proof of concept that lets installs reuse a dependency's build output across machines, by publishing and restoring signed, organization-scoped artifacts through pnpr instead of running the lifecycle scripts locally.
|
|
100
|
+
|
|
101
|
+
Configure it with the new `remoteSideEffectsCache` setting. A workspace names the eligible `organization` and `packages`; everything describing the act of signing — `publish`, `keyId`, `builderId`, `trustedKeys`, `privateKey` and the provenance fields — is refused in `pnpm-workspace.yaml` and read from the global config file or the environment instead.
|
|
102
|
+
|
|
103
|
+
- Hosted pnpr registries now serve newly published original artifacts from registry-scoped SHA-512 digest URLs.
|
|
104
|
+
|
|
105
|
+
- Allowed `pnpm update --patches` to refresh registry revisions through a configured pnpr server while retaining locked package versions.
|
|
106
|
+
|
|
107
|
+
- Added explicit registry revision selection with `<version>+rN` and `pnpm update --patches` for refreshing revision artifacts without changing package versions. Registry-backed lockfile policy checks recognize historical revisions, and pnpr now preserves safe revision histories from upstream registries.
|
|
108
|
+
|
|
109
|
+
- Added support for registry replacement tarballs using standard integrity values, explicit revision fields, registry routing from the `registries` setting, non-redirecting integrity-addressed URLs, canonical safe-integer revision numbers, and pnpr proxying for immutable upstream revision artifacts.
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- Forward `patchedDependencies` hashes and `packageExtensions` to pnpr so server-side resolution preserves patches and package extensions in the lockfile and installed packages.
|
|
114
|
+
|
|
115
|
+
## 0.1.0-alpha.7
|
|
116
|
+
|
|
117
|
+
### Minor Changes
|
|
118
|
+
|
|
119
|
+
- Packument responses now carry a `Last-Modified` header derived from the document's `time.modified`, so a client's release-age check can learn the package-level last-publish bound from a cheap `HEAD` probe instead of downloading the metadata body.
|
|
120
|
+
|
|
121
|
+
- A pnpr resolve request now carries the client's registries the way the `registries` setting declares them — keyed by URL, with the scopes routed to each, the bare-specifier prefix each answers to, and each one's `serverType` — in place of the prefix map it used to send.
|
|
122
|
+
|
|
123
|
+
The server routes them through the same inversion the config reader runs, so a pnpr-served install resolves a scoped dependency from the registry that scope is routed to, which it previously could not: only the default registry and the prefix-addressed ones reached the server. A declared `serverType` reaches it too, so the tarball URLs pnpr omits from the lockfile match the ones the client reconstructs.
|
|
124
|
+
|
|
125
|
+
Built-in scope routes the project has not pointed elsewhere are not declared, so a pnpr server's allowlist is not asked about `npm.jsr.io` on requests that resolve no JSR package.
|
|
126
|
+
|
|
127
|
+
A registry a request only declares is no longer refused up front for being off the server's allowlist — a client describes its whole configuration, including scopes a given resolve never reaches, so a stray `@scope:registry` in a developer's `~/.npmrc` no longer fails every install against a pnpr server that does not serve it. The boundary moves to the fetch itself: an origin the resolve does reach is refused before the request leaves the server, with the same message.
|
|
128
|
+
|
|
129
|
+
This changes the resolve and verify-lockfile request bodies. A pnpr server and its clients have to be on matching versions; the protocol is still experimental and unversioned.
|
|
130
|
+
|
|
131
|
+
- A resolve request now carries the client's `resolutionMode`, so an install delegated to a pnpr server picks versions the way the client would. `time-based` and `lowest-direct` reached the server as nothing at all, leaving it on its `highest` default: the returned lockfile pinned the highest satisfying version of every dependency, and the setting appeared to be ignored.
|
|
132
|
+
|
|
133
|
+
This adds a field to the resolve request body. A server older than its client ignores it and keeps resolving `highest`; the protocol is still experimental and unversioned.
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Fixed `pnpm` installs using pnpr to honor the client's `autoInstallPeers`, `dedupePeers`, and `excludeLinksFromLockfile` settings [pnpm/pnpm#13389](https://github.com/pnpm/pnpm/issues/13389).
|
|
138
|
+
|
|
139
|
+
## 0.1.0-alpha.6
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Validated forwarded catalog targets and kept catalog-specific resolutions isolated in the server cache.
|
|
144
|
+
|
|
145
|
+
## 0.1.0-alpha.5
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- Fixed `catalog:` references in dependencies and overrides failing to resolve when installing through a pnpr server, which errored with "No catalog entry '<name>' was found for catalog 'default'." even though the catalog entry existed. Also fixed a crash on Windows when installing a nested workspace member (e.g. `packages/foo`) through a pnpr server [#13232](https://github.com/pnpm/pnpm/issues/13232).
|
|
150
|
+
|
|
151
|
+
## 0.1.0-alpha.4
|
|
152
|
+
|
|
153
|
+
### Patch Changes
|
|
154
|
+
|
|
155
|
+
- Fixed Pacquet workspace commands to honor project filters, preserve complete lockfile state, and materialize only the selected dependency closure, including pnpr-backed installs.
|
|
156
|
+
|
|
157
|
+
- Fixed pnpr workspace resolution to preserve project names and versions for `workspace:` dependencies.
|
|
158
|
+
|
|
159
|
+
## 0.1.0-alpha.3
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- The `--help` text now reads as user-facing help rather than developer documentation. Command and flag descriptions say what each option does for you, and the leftover markdown that was printing verbatim in the terminal — intra-doc links, an inline link, and an HTML-like path placeholder — has been cleaned out.
|
|
164
|
+
|
|
165
|
+
## 0.1.0-alpha.2
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- Bump version.
|
|
170
|
+
|
|
171
|
+
## 0.1.0-alpha.1
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- On publish, the README of the `latest` version is now hoisted to the packument's top-level `readme` (and `readmeFilename`) field, matching npm and verdaccio. Publish clients only send the readme inside the version manifest, so without this a package published to pnpr exposed no top-level readme for full-packument consumers and registry UIs to render.
|
|
176
|
+
|
|
177
|
+
## 0.1.0-alpha.0
|
|
178
|
+
|
|
179
|
+
### Minor Changes
|
|
180
|
+
|
|
181
|
+
- `@pnpm/pnpr` is now versioned with changesets and released from the unified release workflow. Versions switch from the `0.0.0-<datestamp>` scheme to semver, starting the 0.1.0 prerelease line at 0.1.0-alpha.0.
|
|
182
|
+
- The install script exits without error in the pnpm monorepo checkout, where the per-platform binary packages are not generated.
|
package/README.md
CHANGED
|
@@ -35,6 +35,32 @@ by default. Point a client at it with:
|
|
|
35
35
|
pnpm config set registry http://127.0.0.1:7677/
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
### Install accelerator
|
|
39
|
+
|
|
40
|
+
pnpr also resolves dependencies on a client's behalf. Point pnpm at it
|
|
41
|
+
with `pnprServer` and pnpm sends its manifests instead of resolving
|
|
42
|
+
locally:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pnpm config set pnprServer http://127.0.0.1:7677/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
npm, Cargo and Python dependencies all resolve this way.
|
|
49
|
+
|
|
50
|
+
For Cargo, pnpr walks the crates.io sparse index and answers with the
|
|
51
|
+
`Cargo.lock`, so a workspace resolves without the client fetching one
|
|
52
|
+
index file per crate.
|
|
53
|
+
|
|
54
|
+
For Python, pnpr reads the index and answers with the `pylock.toml`.
|
|
55
|
+
Reading what a distribution requires means reading a wheel's `METADATA`,
|
|
56
|
+
so a client resolving alone downloads whole wheels for versions it then
|
|
57
|
+
rejects; pnpr reads the metadata file the index publishes beside each
|
|
58
|
+
wheel instead. When an index publishes no such file, pnpr downloads the
|
|
59
|
+
wheel itself and keeps the metadata it holds, so only the first client
|
|
60
|
+
pays for that download.
|
|
61
|
+
|
|
62
|
+
Everything pnpr reads is cached for every client that follows.
|
|
63
|
+
|
|
38
64
|
## CLI flags
|
|
39
65
|
|
|
40
66
|
| Flag | Description |
|
|
@@ -45,6 +71,19 @@ pnpm config set registry http://127.0.0.1:7677/
|
|
|
45
71
|
| `--cache <path>` | Override the disposable proxy-cache directory (the mirror of upstream registries plus the resolver cache). Defaults to a `.pnpr-cache` subdirectory of `--storage`. |
|
|
46
72
|
| `--public-url <url>` | URL clients should use to reach the server, used when rewriting `dist.tarball` in served packuments. Defaults to `http://<listen>`. |
|
|
47
73
|
| `--packument-ttl-secs <n>` | Seconds before a cached packument is considered stale and refetched. |
|
|
74
|
+
| `--osv` | Enable local OSV npm vulnerability checks. Requires a local OSV npm database at `--osv-db` or `<cache>/osv/npm/all.zip`. |
|
|
75
|
+
| `--osv-db <path>` | Path to the local OSV npm database zip or extracted JSON directory. |
|
|
76
|
+
| `--disable-registry` | Disable the npm-registry surface (packument and tarball reads, publish, unpublish, dist-tag, search). |
|
|
77
|
+
| `--disable-resolver` | Disable the install-accelerator surface (`/-/pnpr/v0/resolve` for npm, Cargo and Python, `/-/pnpr/v0/verify-lockfile`). |
|
|
78
|
+
| `--disable-artifacts` | Disable the signed shared-artifact surface. |
|
|
79
|
+
|
|
80
|
+
Every flag can also be set through an environment variable named after
|
|
81
|
+
it: `PNPR_` followed by the flag name in upper case with dashes replaced
|
|
82
|
+
by underscores. `--public-url` becomes `PNPR_PUBLIC_URL` and
|
|
83
|
+
`--packument-ttl-secs` becomes `PNPR_PACKUMENT_TTL_SECS`. A flag given on
|
|
84
|
+
the command line wins over its environment variable. Boolean flags such
|
|
85
|
+
as `--disable-registry` accept `true`, `1`, `yes`, `on`, `false`, `0`,
|
|
86
|
+
`no`, and `off`.
|
|
48
87
|
|
|
49
88
|
Log level is controlled via the standard `RUST_LOG` environment
|
|
50
89
|
variable (e.g. `RUST_LOG=debug pnpr`).
|
|
@@ -272,6 +311,40 @@ When the `backend:` block is absent, auth stays on local disk and the
|
|
|
272
311
|
`auth.htpasswd` / `auth.tokens` settings apply as before. The
|
|
273
312
|
`auth.htpasswd.max_users` registration cap is honored either way.
|
|
274
313
|
|
|
314
|
+
### Running several replicas
|
|
315
|
+
|
|
316
|
+
Several `pnpr` processes can serve one registry behind a load balancer once
|
|
317
|
+
they share their state. Give every replica the same `s3:` bucket for hosted
|
|
318
|
+
packages and the same `backend:` database for users and tokens, and give each
|
|
319
|
+
its own `storage` path for what stays local.
|
|
320
|
+
|
|
321
|
+
Requests need no affinity. Every write into the shared bucket is conditional:
|
|
322
|
+
a publish, a `dist-tag` change, a partial unpublish, and the approval of a
|
|
323
|
+
staged publish each rewrite the package document under the `ETag` they read it
|
|
324
|
+
at, and a replica that loses the race re-reads and merges on top of what the
|
|
325
|
+
other one wrote. A published tarball is written only if its key is still free,
|
|
326
|
+
so two replicas publishing one version can never overwrite each other's bytes:
|
|
327
|
+
the one whose bytes did not land is told so with a `409` instead of
|
|
328
|
+
advertising an integrity the store no longer serves. A staged publish is
|
|
329
|
+
approved once, whichever replica the approval reaches.
|
|
330
|
+
|
|
331
|
+
This needs an object store that honors the `If-Match` and `If-None-Match`
|
|
332
|
+
preconditions. AWS S3, Cloudflare R2 and MinIO do.
|
|
333
|
+
|
|
334
|
+
What stays local to each replica:
|
|
335
|
+
|
|
336
|
+
- the proxy cache of upstream registries, and the resolver cache
|
|
337
|
+
- publish staging scratch and the commit journal that rolls an interrupted
|
|
338
|
+
publish forward, so keep each replica's `storage` path on a volume that
|
|
339
|
+
outlives its restarts
|
|
340
|
+
- blob upload sessions of the image registry when hosted packages are on
|
|
341
|
+
local disk, which is why `docker push` needs sticky sessions there; with
|
|
342
|
+
`s3:` an upload continues on any replica
|
|
343
|
+
- accounts and tokens, unless a `backend:` database is configured
|
|
344
|
+
|
|
345
|
+
Pipeline run records are shared: a run submitted through one replica is listed
|
|
346
|
+
and served by every other, and a run id stays append-only across all of them.
|
|
347
|
+
|
|
275
348
|
## License
|
|
276
349
|
|
|
277
350
|
Source-available under the [PolyForm Shield License 1.0.0](https://github.com/pnpm/pnpm/blob/main/pnpr/LICENSE.md) — **not** open source. You may run, modify, and self-host pnpr for any purpose except providing a product that competes with it. Commercial / non-compete licenses are available from Zoltan Kochan (<https://kochan.io>).
|
package/install.js
CHANGED
|
@@ -44,6 +44,13 @@ const PLATFORMS = {
|
|
|
44
44
|
setup()
|
|
45
45
|
|
|
46
46
|
function setup () {
|
|
47
|
+
// The committed manifest has no `optionalDependencies`; generate-packages.mjs
|
|
48
|
+
// adds them at release time. Without them this is the monorepo checkout, where
|
|
49
|
+
// the wrapper is a workspace package and there is no native binary to link.
|
|
50
|
+
if (readOwnManifest().optionalDependencies == null) {
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
47
54
|
const candidates = getBinCandidates()
|
|
48
55
|
if (candidates.length === 0) {
|
|
49
56
|
fail(`@pnpm/pnpr does not ship a prebuilt binary for ${platform}-${arch}.`)
|
|
@@ -142,6 +149,23 @@ function fail (message) {
|
|
|
142
149
|
process.exit(1)
|
|
143
150
|
}
|
|
144
151
|
|
|
152
|
+
// A successful read with no optionalDependencies is the dev checkout (setup
|
|
153
|
+
// no-ops there); a read/parse failure is a corrupt published package and must
|
|
154
|
+
// not be silently swallowed into that same no-op path.
|
|
155
|
+
function readOwnManifest () {
|
|
156
|
+
const manifestPath = path.join(ownDir, 'package.json')
|
|
157
|
+
let manifest
|
|
158
|
+
try {
|
|
159
|
+
manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
|
|
160
|
+
} catch (err) {
|
|
161
|
+
throw new Error(`Failed to read ${manifestPath}: ${err.message}`)
|
|
162
|
+
}
|
|
163
|
+
if (typeof manifest !== 'object' || manifest == null || Array.isArray(manifest)) {
|
|
164
|
+
throw new Error(`Expected ${manifestPath} to contain a JSON object`)
|
|
165
|
+
}
|
|
166
|
+
return manifest
|
|
167
|
+
}
|
|
168
|
+
|
|
145
169
|
/**
|
|
146
170
|
* Native binary specifiers to try, most-preferred first; empty when the host is
|
|
147
171
|
* unsupported. The linux glibc/musl pair is ordered by detected libc, which
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/pnpr",
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
3
4
|
"description": "pnpm-compatible npm registry server, written in Rust",
|
|
4
5
|
"keywords": [
|
|
5
6
|
"pnpm",
|
|
@@ -14,6 +15,9 @@
|
|
|
14
15
|
"url": "https://github.com/pnpm/pnpm",
|
|
15
16
|
"directory": "pnpr/npm/pnpr"
|
|
16
17
|
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"pnpr": "bin/pnpr"
|
|
20
|
+
},
|
|
17
21
|
"type": "module",
|
|
18
22
|
"engines": {
|
|
19
23
|
"node": ">=18.*"
|
|
@@ -23,21 +27,17 @@
|
|
|
23
27
|
"install.js",
|
|
24
28
|
"LICENSE.md"
|
|
25
29
|
],
|
|
26
|
-
"version": "0.0.0-26070301",
|
|
27
30
|
"optionalDependencies": {
|
|
28
|
-
"@pnpm/pnpr.win32-x64": "0.
|
|
29
|
-
"@pnpm/pnpr.win32-arm64": "0.
|
|
30
|
-
"@pnpm/pnpr.darwin-x64": "0.
|
|
31
|
-
"@pnpm/pnpr.darwin-arm64": "0.
|
|
32
|
-
"@pnpm/pnpr.linux-x64": "0.
|
|
33
|
-
"@pnpm/pnpr.linux-arm64": "0.
|
|
34
|
-
"@pnpm/pnpr.linux-x64-musl": "0.
|
|
35
|
-
"@pnpm/pnpr.linux-arm64-musl": "0.
|
|
31
|
+
"@pnpm/pnpr.win32-x64": "0.1.0-alpha.11",
|
|
32
|
+
"@pnpm/pnpr.win32-arm64": "0.1.0-alpha.11",
|
|
33
|
+
"@pnpm/pnpr.darwin-x64": "0.1.0-alpha.11",
|
|
34
|
+
"@pnpm/pnpr.darwin-arm64": "0.1.0-alpha.11",
|
|
35
|
+
"@pnpm/pnpr.linux-x64": "0.1.0-alpha.11",
|
|
36
|
+
"@pnpm/pnpr.linux-arm64": "0.1.0-alpha.11",
|
|
37
|
+
"@pnpm/pnpr.linux-x64-musl": "0.1.0-alpha.11",
|
|
38
|
+
"@pnpm/pnpr.linux-arm64-musl": "0.1.0-alpha.11"
|
|
36
39
|
},
|
|
37
40
|
"scripts": {
|
|
38
41
|
"preinstall": "node install.js"
|
|
39
|
-
},
|
|
40
|
-
"bin": {
|
|
41
|
-
"pnpr": "bin/pnpr"
|
|
42
42
|
}
|
|
43
43
|
}
|