mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
First time build of the safe-chain binaries
This commit is contained in:
parent
72d6acaa7f
commit
b14ff4cb33
16 changed files with 608 additions and 53 deletions
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "bun";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "bunx";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "npm";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "npx";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ setCurrentPipInvocation(PIP_INVOCATIONS.PIP);
|
|||
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
|
||||
// Pass through only user-supplied pip args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
// Pass through only user-supplied pip args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ setCurrentPipInvocation(PIP_INVOCATIONS.PIP3);
|
|||
// Create package manager
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
|
||||
// Pass through only user-supplied pip args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
// Pass through only user-supplied pip args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "pnpm";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "pnpx";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -11,18 +11,20 @@ setEcoSystem(ECOSYSTEM_PY);
|
|||
// Strip nodejs and wrapper script from args
|
||||
let argv = process.argv.slice(2);
|
||||
|
||||
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||
setEcoSystem(ECOSYSTEM_PY);
|
||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY_PIP3 : PIP_INVOCATIONS.PY_PIP);
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
(async () => {
|
||||
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||
setEcoSystem(ECOSYSTEM_PY);
|
||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY_PIP3 : PIP_INVOCATIONS.PY_PIP);
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
|
||||
// Strip off the '-m pip' or '-m pip3' from the args
|
||||
argv = argv.slice(2);
|
||||
// Strip off the '-m pip' or '-m pip3' from the args
|
||||
argv = argv.slice(2);
|
||||
|
||||
var exitCode = await main(argv);
|
||||
process.exit(exitCode);
|
||||
} else {
|
||||
// Forward to real python binary for non-pip flows
|
||||
const { spawn } = await import('child_process');
|
||||
spawn('python', argv, { stdio: 'inherit' });
|
||||
}
|
||||
var exitCode = await main(argv);
|
||||
process.exit(exitCode);
|
||||
} else {
|
||||
// Forward to real python binary for non-pip flows
|
||||
const { spawn } = await import('child_process');
|
||||
spawn('python', argv, { stdio: 'inherit' });
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -11,18 +11,20 @@ setEcoSystem(ECOSYSTEM_PY);
|
|||
// Strip nodejs and wrapper script from args
|
||||
let argv = process.argv.slice(2);
|
||||
|
||||
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||
setEcoSystem(ECOSYSTEM_PY);
|
||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP3 : PIP_INVOCATIONS.PY3_PIP);
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
(async () => {
|
||||
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||
setEcoSystem(ECOSYSTEM_PY);
|
||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP3 : PIP_INVOCATIONS.PY3_PIP);
|
||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||
|
||||
// Strip off the '-m pip' or '-m pip3' from the args
|
||||
argv = argv.slice(2);
|
||||
// Strip off the '-m pip' or '-m pip3' from the args
|
||||
argv = argv.slice(2);
|
||||
|
||||
var exitCode = await main(argv);
|
||||
process.exit(exitCode);
|
||||
} else {
|
||||
// Forward to real python3 binary for non-pip flows
|
||||
const { spawn } = await import('child_process');
|
||||
spawn('python3', argv, { stdio: 'inherit' });
|
||||
}
|
||||
var exitCode = await main(argv);
|
||||
process.exit(exitCode);
|
||||
} else {
|
||||
// Forward to real python3 binary for non-pip flows
|
||||
const { spawn } = await import('child_process');
|
||||
spawn('python3', argv, { stdio: 'inherit' });
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ setEcoSystem(ECOSYSTEM_PY);
|
|||
|
||||
initializePackageManager("uv");
|
||||
|
||||
// Pass through only user-supplied uv args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
// Pass through only user-supplied uv args
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import { setEcoSystem, ECOSYSTEM_JS } from "../src/config/settings.js";
|
|||
setEcoSystem(ECOSYSTEM_JS);
|
||||
const packageManagerName = "yarn";
|
||||
initializePackageManager(packageManagerName);
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
|
||||
process.exit(exitCode);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(2));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import { setup } from "../src/shell-integration/setup.js";
|
|||
import { teardown } from "../src/shell-integration/teardown.js";
|
||||
import { setupCi } from "../src/shell-integration/setup-ci.js";
|
||||
import { initializeCliArguments } from "../src/config/cliArguments.js";
|
||||
import { ECOSYSTEM_JS, setEcoSystem } from "../src/config/settings.js";
|
||||
import { initializePackageManager } from "../src/packagemanager/currentPackageManager.js";
|
||||
import { main } from "../src/main.js";
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
ui.writeError("No command provided. Please provide a command to execute.");
|
||||
|
|
@ -19,12 +22,19 @@ initializeCliArguments(process.argv);
|
|||
|
||||
const command = process.argv[2];
|
||||
|
||||
if (command === "help" || command === "--help" || command === "-h") {
|
||||
const pkgManagerCommands = ["npm", "npx", "yarn"];
|
||||
|
||||
if (pkgManagerCommands.includes(command)) {
|
||||
setEcoSystem(ECOSYSTEM_JS);
|
||||
initializePackageManager(command);
|
||||
(async () => {
|
||||
var exitCode = await main(process.argv.slice(3));
|
||||
process.exit(exitCode);
|
||||
})();
|
||||
} else if (command === "help" || command === "--help" || command === "-h") {
|
||||
writeHelp();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === "setup") {
|
||||
}else if (command === "setup") {
|
||||
setup();
|
||||
} else if (command === "teardown") {
|
||||
teardown();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
"@types/node-forge": "^1.3.14",
|
||||
"@types/npm-registry-fetch": "^8.0.9",
|
||||
"@types/semver": "^7.7.1",
|
||||
"esbuild": "^0.27.0",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"main": "src/main.js",
|
||||
|
|
@ -63,5 +64,27 @@
|
|||
"type": "git",
|
||||
"url": "git+https://github.com/AikidoSec/safe-chain.git",
|
||||
"directory": "packages/safe-chain"
|
||||
},
|
||||
"pkg": {
|
||||
"targets": [
|
||||
"node22-linux-x64",
|
||||
"node22-linux-arm64",
|
||||
"node22-macos-x64",
|
||||
"node22-macos-arm64",
|
||||
"node22-win-x64",
|
||||
"node22-win-arm64"
|
||||
],
|
||||
"outputPath": "dist",
|
||||
"assets": [
|
||||
"node_modules/certifi/**/*"
|
||||
],
|
||||
"scripts": [
|
||||
"src/**/*.js",
|
||||
"bin/**/*.js"
|
||||
],
|
||||
"ignore": [
|
||||
"**/*.spec.js",
|
||||
"test/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue