@moonrepo/cli
Advanced tools
+2
-2
| #!/usr/bin/env node | ||
| const cp = require('child_process'); | ||
| const { findMoonExe } = require('./utils'); | ||
| const { findMoonxExe } = require('./utils'); | ||
| const result = cp.spawnSync(findMoonExe(), ['run', ...process.argv.slice(2)], { | ||
| const result = cp.spawnSync(findMoonxExe(), process.argv.slice(2), { | ||
| shell: false, | ||
@@ -8,0 +8,0 @@ stdio: 'inherit', |
+14
-17
| { | ||
| "name": "@moonrepo/cli", | ||
| "version": "1.41.7", | ||
| "version": "2.0.0-alpha.11", | ||
| "type": "commonjs", | ||
@@ -15,4 +15,3 @@ "description": "moon command line and core system.", | ||
| "moonx.js", | ||
| "utils.js", | ||
| "postinstall-old.js" | ||
| "utils.js" | ||
| ], | ||
@@ -22,3 +21,4 @@ "author": "Miles Johnson", | ||
| "bin": { | ||
| "moon": "moon.js" | ||
| "moon": "moon.js", | ||
| "moonx": "moonx.js" | ||
| }, | ||
@@ -30,17 +30,14 @@ "repository": { | ||
| }, | ||
| "scripts": { | ||
| "__postinstall__": "node ./postinstall-old.js" | ||
| }, | ||
| "dependencies": { | ||
| "detect-libc": "^2.0.4" | ||
| "detect-libc": "^2.1.2" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@moonrepo/core-linux-arm64-gnu": "1.41.7", | ||
| "@moonrepo/core-linux-arm64-musl": "1.41.7", | ||
| "@moonrepo/core-linux-x64-gnu": "1.41.7", | ||
| "@moonrepo/core-linux-x64-musl": "1.41.7", | ||
| "@moonrepo/core-macos-arm64": "1.41.7", | ||
| "@moonrepo/core-macos-x64": "1.41.7", | ||
| "@moonrepo/core-windows-x64-msvc": "1.41.7" | ||
| } | ||
| } | ||
| "@moonrepo/core-linux-arm64-gnu": "2.0.0-alpha.11", | ||
| "@moonrepo/core-linux-arm64-musl": "2.0.0-alpha.11", | ||
| "@moonrepo/core-linux-x64-gnu": "2.0.0-alpha.11", | ||
| "@moonrepo/core-linux-x64-musl": "2.0.0-alpha.11", | ||
| "@moonrepo/core-macos-arm64": "2.0.0-alpha.11", | ||
| "@moonrepo/core-windows-x64-msvc": "2.0.0-alpha.11" | ||
| }, | ||
| "stableVersion": "1.41.8" | ||
| } |
+1
-1
@@ -94,3 +94,3 @@ # @moonrepo/cli | ||
| - **Action distribution** - Distributes actions across multiple machines to increase throughput. | ||
| - **Incremental builds** - With our smart hashing, only rebuild projects that have been touched | ||
| - **Incremental builds** - With our smart hashing, only rebuild projects that have been changed | ||
| since the last build. | ||
@@ -97,0 +97,0 @@ |
+11
-2
@@ -31,5 +31,5 @@ const fs = require('fs'); | ||
| function findMoonExe() { | ||
| function findExe(name) { | ||
| const pkgPath = require.resolve(`@moonrepo/core-${triple}/package.json`); | ||
| const exePath = path.join(path.dirname(pkgPath), isWindows ? 'moon.exe' : 'moon'); | ||
| const exePath = path.join(path.dirname(pkgPath), isWindows ? `${name}.exe` : name); | ||
@@ -43,2 +43,11 @@ if (fs.existsSync(exePath)) { | ||
| function findMoonExe() { | ||
| return findExe('moon'); | ||
| } | ||
| function findMoonxExe() { | ||
| return findExe('moonx'); | ||
| } | ||
| exports.findMoonExe = findMoonExe; | ||
| exports.findMoonxExe = findMoonxExe; |
| #!/usr/bin/env node | ||
| // Based on the great parcel-css | ||
| // https://github.com/parcel-bundler/parcel-css/blob/master/cli/postinstall.js | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const isMoonLocal = | ||
| fs.existsSync(path.join(__dirname, '../../.moon')) && | ||
| fs.existsSync(path.join(__dirname, '../../crates')); | ||
| const isLinux = process.platform === 'linux'; | ||
| const isMacos = process.platform === 'darwin'; | ||
| const isWindows = process.platform === 'win32'; | ||
| const platform = isWindows ? 'windows' : isMacos ? 'macos' : process.platform; | ||
| const arch = | ||
| process.env['npm_config_user_agent'] && process.env['npm_config_user_agent'].match(/^bun.*arm64$/) | ||
| ? 'arm64' | ||
| : process.arch; // https://github.com/moonrepo/moon/issues/1103 | ||
| const parts = [platform, arch]; | ||
| if (isLinux) { | ||
| const { familySync } = require('detect-libc'); | ||
| if (familySync() === 'musl') { | ||
| parts.push('musl'); | ||
| } else if (process.arch === 'arm') { | ||
| parts.push('gnueabihf'); | ||
| } else { | ||
| parts.push('gnu'); | ||
| } | ||
| } else if (isWindows) { | ||
| parts.push('msvc'); | ||
| } | ||
| const binary = isWindows ? 'moon.exe' : 'moon'; | ||
| const triple = parts.join('-'); | ||
| const pkgPath = path.dirname(require.resolve(`@moonrepo/core-${triple}/package.json`)); | ||
| const binPath = path.join(pkgPath, binary); | ||
| try { | ||
| const linkPath = path.join(__dirname, binary); | ||
| if (fs.existsSync(binPath)) { | ||
| try { | ||
| fs.linkSync(binPath, linkPath); | ||
| } catch { | ||
| fs.copyFileSync(binPath, linkPath); | ||
| } | ||
| fs.chmodSync(linkPath, 0o755); | ||
| } else { | ||
| throw new Error(); | ||
| } | ||
| } catch { | ||
| console.error(`Failed to find "${binary}" binary.`); | ||
| if (!isMoonLocal) { | ||
| // process.exit(1); | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
7
-12.5%3
-50%8432
-15.12%6
-14.29%62
-41.51%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated