@pnpm/exe 6.17.1

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/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-2021 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,39 @@
1
+ # @pnpm/exe
2
+
3
+ This version of the pnpm CLI is packaged with Node.js into an executable.
4
+ So it may be used on a system with no Node.js installed.
5
+ This makes pnpm not only a Node.js package manager but also a Node.js version manager (see [related discussion](https://github.com/pnpm/pnpm/discussions/3434)).
6
+
7
+ ## Installation
8
+
9
+ On macOS, Linux, or Windows Subsystem for Linux:
10
+
11
+ ```
12
+ curl -fsSL https://get.pnpm.io/install.sh | sh -
13
+ ```
14
+
15
+ If you don't have curl installed, you would like to use wget:
16
+
17
+ ```
18
+ wget -qO- https://get.pnpm.io/install.sh | sh -
19
+ ```
20
+
21
+ After installation, restart your shell to get pnpm accessible.
22
+
23
+ ### Alternatively, if you do have Node.js installed
24
+
25
+ On macOS, Linux, or Windows Subsystem for Linux:
26
+
27
+ ```
28
+ curl -f https://get.pnpm.io/v6.16.js | node - add --global @pnpm/exe
29
+ ```
30
+
31
+ On Windows (using PowerShell):
32
+
33
+ ```
34
+ (Invoke-WebRequest 'https://get.pnpm.io/v6.16.js' -UseBasicParsing).Content | node - add --global @pnpm/exe
35
+ ```
36
+
37
+ ## License
38
+
39
+ MIT
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@pnpm/exe",
3
+ "description": "Fast, disk space efficient package manager",
4
+ "version": "6.17.1",
5
+ "publishConfig": {
6
+ "bin": {
7
+ "pnpm": "pnpm"
8
+ }
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/pnpm/pnpm/issues"
12
+ },
13
+ "optionalDependencies": {
14
+ "@pnpm/linux-arm64": "6.17.1",
15
+ "@pnpm/linux-x64": "6.17.1",
16
+ "@pnpm/macos-arm64": "6.17.1",
17
+ "@pnpm/macos-x64": "6.17.1",
18
+ "@pnpm/win-x64": "6.17.1"
19
+ },
20
+ "devDependencies": {
21
+ "@zkochan/pkg": "0.0.0-2",
22
+ "execa": "npm:safe-execa@^0.1.1"
23
+ },
24
+ "funding": "https://opencollective.com/pnpm",
25
+ "homepage": "https://github.com/pnpm/pnpm/blob/master/packages/exe#readme",
26
+ "license": "MIT",
27
+ "preferGlobal": true,
28
+ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/exe",
29
+ "scripts": {
30
+ "preinstall": "node setup.js"
31
+ },
32
+ "bin": {
33
+ "pnpm": "pnpm"
34
+ }
35
+ }
package/prepare.js ADDED
@@ -0,0 +1,6 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+
4
+ const pnpmCli = path.join(__dirname, 'pnpm')
5
+ fs.unlinkSync(pnpmCli)
6
+ fs.writeFileSync(pnpmCli, 'This file intentionally left blank', 'utf8')
package/setup.js ADDED
@@ -0,0 +1,38 @@
1
+ const path = require('path')
2
+ const fs = require('fs')
3
+
4
+ const platform = process.platform == 'win32'
5
+ ? 'win'
6
+ : process.platform == 'darwin'
7
+ ? 'macos'
8
+ : process.platform
9
+ const arch = platform == 'win' && process.arch == 'ia32' ? 'x86' : process.arch
10
+
11
+ const pkgName = `@pnpm/${platform}-${arch}`
12
+ const pkgJson = require.resolve(`${pkgName}/package.json`)
13
+ const subpkg = JSON.parse(fs.readFileSync(pkgJson, 'utf8'))
14
+
15
+ if (subpkg.bin != null) {
16
+ const executable = subpkg.bin.pnpm
17
+ const bin = path.resolve(path.dirname(pkgJson), executable)
18
+
19
+ linkSync(bin, path.resolve(process.cwd(), executable))
20
+
21
+ if (platform == 'win') {
22
+ const pkg = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'package.json')))
23
+ fs.writeFileSync(path.resolve(process.cwd(), 'pnpm'), 'This file intentionally left blank')
24
+ pkg.bin.pnpm = 'pnpm.exe'
25
+ fs.writeFileSync(path.resolve(process.cwd(), 'package.json'), JSON.stringify(pkg, null, 2))
26
+ }
27
+ }
28
+
29
+ function linkSync(src, dest) {
30
+ try {
31
+ fs.unlinkSync(dest)
32
+ } catch (e) {
33
+ if (e.code != 'ENOENT') {
34
+ throw e
35
+ }
36
+ }
37
+ return fs.linkSync(src, dest)
38
+ }