@pnpm/pnpr 0.0.0-0 → 0.0.0-26052601

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.
Files changed (4) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +20 -0
  3. package/bin/pnpr +52 -0
  4. package/package.json +31 -10
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
+ Copyright (c) 2016-2026 Zoltan Kochan and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # @pnpm/pnpr
2
+
3
+ A pnpm-compatible npm registry server, written in Rust.
4
+
5
+ Lives in the [pnpm monorepo](https://github.com/pnpm/pnpm) under [`registry/`](https://github.com/pnpm/pnpm/tree/main/registry).
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add -g @pnpm/pnpr
11
+ ```
12
+
13
+ The wrapper resolves to the native binary published under
14
+ `@pnpm/pnpr.<platform>-<arch>` (e.g. `@pnpm/pnpr.linux-x64`).
15
+
16
+ ## Usage
17
+
18
+ ```sh
19
+ pnpr --help
20
+ ```
package/bin/pnpr ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ const { platform, arch, env } = process;
3
+
4
+ const PLATFORMS = {
5
+ win32: {
6
+ x64: "@pnpm/pnpr.win32-x64/pnpr.exe",
7
+ arm64: "@pnpm/pnpr.win32-arm64/pnpr.exe",
8
+ },
9
+ darwin: {
10
+ x64: "@pnpm/pnpr.darwin-x64/pnpr",
11
+ arm64: "@pnpm/pnpr.darwin-arm64/pnpr",
12
+ },
13
+ linux: {
14
+ x64: "@pnpm/pnpr.linux-x64/pnpr",
15
+ arm64: "@pnpm/pnpr.linux-arm64/pnpr",
16
+ },
17
+ };
18
+
19
+ const binPath = PLATFORMS?.[platform]?.[arch];
20
+ if (binPath) {
21
+ const result = require("child_process").spawnSync(
22
+ require.resolve(binPath),
23
+ process.argv.slice(2),
24
+ {
25
+ shell: false,
26
+ stdio: "inherit",
27
+ env,
28
+ }
29
+ );
30
+
31
+ if (result.error) {
32
+ throw result.error;
33
+ }
34
+
35
+ // result.status is null when the child was killed by a signal; falling
36
+ // through to `exitCode = null` would make the wrapper appear to exit 0
37
+ // and mask the signal. Re-raise the signal so the parent terminates
38
+ // the same way; fall back to a non-zero exit if that's not possible.
39
+ if (typeof result.status === "number") {
40
+ process.exitCode = result.status;
41
+ } else if (result.signal) {
42
+ process.kill(process.pid, result.signal);
43
+ } else {
44
+ process.exitCode = 1;
45
+ }
46
+ } else {
47
+ console.error(
48
+ "The @pnpm/pnpr package doesn't ship with prebuilt binaries for your platform yet. " +
49
+ "You can create an issue at https://github.com/pnpm/pnpm/issues for support."
50
+ );
51
+ process.exitCode = 1;
52
+ }
package/package.json CHANGED
@@ -1,14 +1,35 @@
1
1
  {
2
2
  "name": "@pnpm/pnpr",
3
- "version": "0.0.0-0",
4
- "description": "",
5
- "main": "index.js",
6
- "keywords": [],
7
- "author": "",
8
- "license": "ISC",
9
- "devEngines": {},
10
- "type": "module",
11
- "scripts": {
12
- "test": "echo \"Error: no test specified\" && exit 1"
3
+ "description": "pnpm-compatible npm registry server, written in Rust",
4
+ "keywords": [
5
+ "pnpm",
6
+ "npm",
7
+ "registry"
8
+ ],
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/pnpm/pnpm/tree/main/registry",
11
+ "bugs": "https://github.com/pnpm/pnpm/issues",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/pnpm/pnpm",
15
+ "directory": "registry/npm/pnpr"
16
+ },
17
+ "engines": {
18
+ "node": ">=18.*"
19
+ },
20
+ "files": [
21
+ "bin/pnpr"
22
+ ],
23
+ "version": "0.0.0-26052601",
24
+ "optionalDependencies": {
25
+ "@pnpm/pnpr.win32-x64": "0.0.0-26052601",
26
+ "@pnpm/pnpr.win32-arm64": "0.0.0-26052601",
27
+ "@pnpm/pnpr.darwin-x64": "0.0.0-26052601",
28
+ "@pnpm/pnpr.darwin-arm64": "0.0.0-26052601",
29
+ "@pnpm/pnpr.linux-x64": "0.0.0-26052601",
30
+ "@pnpm/pnpr.linux-arm64": "0.0.0-26052601"
31
+ },
32
+ "bin": {
33
+ "pnpr": "bin/pnpr"
13
34
  }
14
35
  }