@pnpm/pacquet 0.0.0 → 0.2.2-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.
Files changed (3) hide show
  1. package/LICENSE +22 -0
  2. package/bin/pacquet +66 -0
  3. package/package.json +32 -8
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/bin/pacquet ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ const { platform, arch, env, version, release } = process;
3
+
4
+ const PLATFORMS = {
5
+ win32: {
6
+ x64: "@pacquet/win32-x64/pacquet.exe",
7
+ arm64: "@pacquet/win32-arm64/pacquet.exe",
8
+ },
9
+ darwin: {
10
+ x64: "@pacquet/darwin-x64/pacquet",
11
+ arm64: "@pacquet/darwin-arm64/pacquet",
12
+ },
13
+ linux: {
14
+ x64: "@pacquet/linux-x64/pacquet",
15
+ arm64: "@pacquet/linux-arm64/pacquet",
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
+ ...env,
29
+ JS_RUNTIME_VERSION: version,
30
+ JS_RUNTIME_NAME: release.name,
31
+ NODE_PACKAGE_MANAGER: detectPackageManager(),
32
+ },
33
+ }
34
+ );
35
+
36
+ if (result.error) {
37
+ throw result.error;
38
+ }
39
+
40
+ process.exitCode = result.status;
41
+ } else {
42
+ console.error(
43
+ "The pacquet CLI package doesn't ship with prebuilt binaries for your platform yet. " +
44
+ "You can create an issue at https://github.com/pnpm/pacquet/issues for support."
45
+ );
46
+ process.exitCode = 1;
47
+ }
48
+
49
+ /**
50
+ * NPM, Yarn, and other package manager set the `npm_config_user_agent`. It has the following format:
51
+ *
52
+ * ```
53
+ * "npm/8.3.0 node/v16.13.2 win32 x64 workspaces/false
54
+ * ```
55
+ *
56
+ * @returns The package manager string (`npm/8.3.0`) or null if the user agent string isn't set.
57
+ */
58
+ function detectPackageManager() {
59
+ const userAgent = env.npm_config_user_agent;
60
+
61
+ if (userAgent == null) {
62
+ return null;
63
+ }
64
+
65
+ return userAgent.split(" ")[0];
66
+ }
package/package.json CHANGED
@@ -1,13 +1,37 @@
1
1
  {
2
2
  "name": "@pnpm/pacquet",
3
- "version": "0.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "keywords": [],
7
- "author": "",
3
+ "description": "The official pnpm rewrite in Rust (preview, not production-ready)",
4
+ "keywords": [
5
+ "pnpm"
6
+ ],
7
+ "author": {
8
+ "name": "Yagiz Nizipli",
9
+ "email": "yagiz@nizipli.com"
10
+ },
8
11
  "license": "MIT",
9
- "type": "module",
10
- "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
+ "homepage": "https://github.com/pnpm/pnpm/tree/main/pacquet",
13
+ "bugs": "https://github.com/pnpm/pnpm/issues",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/pnpm/pnpm",
17
+ "directory": "pacquet/npm/pnpm-pacquet"
18
+ },
19
+ "engines": {
20
+ "node": ">=18.*"
21
+ },
22
+ "files": [
23
+ "bin/pacquet"
24
+ ],
25
+ "version": "0.2.2-11",
26
+ "optionalDependencies": {
27
+ "@pacquet/win32-x64": "0.2.2-11",
28
+ "@pacquet/win32-arm64": "0.2.2-11",
29
+ "@pacquet/darwin-x64": "0.2.2-11",
30
+ "@pacquet/darwin-arm64": "0.2.2-11",
31
+ "@pacquet/linux-x64": "0.2.2-11",
32
+ "@pacquet/linux-arm64": "0.2.2-11"
33
+ },
34
+ "bin": {
35
+ "pacquet": "bin/pacquet"
12
36
  }
13
37
  }