New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grafbase

Package Overview
Dependencies
Maintainers
3
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grafbase - npm Package Compare versions

Comparing version 0.1.2-pre.1 to 0.1.2-pre.6

get-environment-data.js

41

package.json
{
"name": "grafbase",
"version": "0.1.2-pre.1",
"version": "0.1.2-pre.6",
"description": "The Grafbase command line interface",
"keywords": [
"grafbase"
],
"homepage": "https://grafbase.com",
"bugs": {
"url": "https://github.com/grafbase/grafbase/issues"
},
"repository": {
"type": "git",
"directory": "cli",
"url": "https://github.com/grafbase/grafbase"
"url": "https://github.com/grafbase/grafbase",
"directory": "cli"
},
"license": "Apache-2.0",
"bin": {

@@ -16,26 +24,17 @@ "grafbase": "grafbase"

},
"files": [
".npmrc",
"grafbase",
"postinstall.js",
"ACKNOWLEDGEMENTS.md"
],
"keywords": [
"grafbase"
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/grafbase/grafbase/issues"
},
"homepage": "https://grafbase.com",
"dependencies": {
"detect-libc": "^2.0.1"
},
"devDependencies": {
"jest": "^28.1.2"
},
"optionalDependencies": {
"@grafbase/cli-aarch64-apple-darwin": "^0.1.2-pre.6",
"@grafbase/cli-x86_64-apple-darwin": "^0.1.2-pre.6",
"@grafbase/cli-x86_64-pc-windows-msvc": "^0.1.2-pre.6",
"@grafbase/cli-x86_64-unknown-linux-musl": "^0.1.2-pre.6"
},
"engines": {
"node": ">=16.7.0"
},
"optionalDependencies": {
"@grafbase/cli-macos-arm64": "^0.1.2-pre.1",
"@grafbase/cli-macos-x64": "^0.1.2-pre.1"
}
}

@@ -6,41 +6,45 @@ // Based on

const fs = require('fs');
const path = require('path');
const { existsSync, linkSync, copyFileSync } = require('fs');
const { dirname, join } = require('path');
const { getEnvironmentData } = require('./get-environment-data');
const platform = process.platform === 'win32' ? 'windows' : process.platform === 'darwin' ? 'macos' : process.platform;
const parts = [platform, process.arch];
const SUPPORTED_TARGET_TRIPLES = [
'x86_64-apple-darwin',
'aarch64-apple-darwin',
'x86_64-unknown-linux-musl',
'x86_64-pc-windows-msvc',
];
if (process.platform === 'linux') {
const { familySync } = require('detect-libc');
const linkBinary = (binary, binaryPath) => {
try {
linkSync(binaryPath, join(__dirname, binary));
} catch {
copyFileSync(binaryPath, join(__dirname, binary));
}
};
if (familySync() === 'musl') {
parts.push('musl');
} else if (process.arch === 'arm') {
parts.push('gnueabihf');
} else {
parts.push('gnu');
const postinstall = () => {
const { targetTriple, binary } = getEnvironmentData('grafbase');
if (!SUPPORTED_TARGET_TRIPLES.includes(targetTriple)) {
console.error(`'${targetTriple}' is currently unsupported`);
return;
}
} else if (process.platform === 'win32') {
parts.push('msvc');
}
const binary = process.platform === 'win32' ? 'grafbase.exe' : 'grafbase';
const triple = parts.join('-');
const packagePath = dirname(require.resolve(`@grafbase/cli-${targetTriple}/package.json`));
const binaryPath = join(packagePath, binary);
const pkgPath = path.dirname(require.resolve(`@grafbase/cli-${triple}/package.json`));
const binPath = path.join(pkgPath, binary);
try {
if (fs.existsSync(binPath)) {
if (existsSync(binaryPath)) {
try {
fs.linkSync(binPath, path.join(__dirname, binary));
linkBinary(binary, binaryPath);
} catch {
fs.copyFileSync(binPath, path.join(__dirname, binary));
console.error('Could not link or copy "grafbase" binary');
return;
}
} else {
console.error('Could not link the "grafbase" binary');
throw new Error();
console.error('Could not find "grafbase" binary');
return;
}
} catch {
console.error('Failed to find "grafbase" binary.');
}
};
postinstall();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc