mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
chore: have setup install all deps (#6421)
* chore: have setup install all deps * Update scripts/setup.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -57,6 +57,25 @@ const glob = function (startPath, pattern) {
|
||||
return results;
|
||||
};
|
||||
|
||||
function forceInstallPlatformDeps() {
|
||||
// Note: make sure to hard pin deps and only add deps that have been checked
|
||||
// for sec vuln already since the following will be force installed.
|
||||
const deps = {
|
||||
darwin: ['@lydell/node-pty-darwin-arm64@1.1.0', '@lydell/node-pty-darwin-x64@1.1.0'],
|
||||
win32: ['@lydell/node-pty-win32-arm64@1.1.0', '@lydell/node-pty-win32-x64@1.1.0'],
|
||||
linux: ['@lydell/node-pty-linux-arm64@1.1.0', '@lydell/node-pty-linux-x64@1.1.0']
|
||||
};
|
||||
|
||||
// Ignore if no deps need to be installed
|
||||
if (!deps[process.platform] || (Array.isArray(deps[process.platform]) && deps[process.platform].length === 0)) return;
|
||||
|
||||
const toInstall = deps[process.platform];
|
||||
execCommand(
|
||||
`npm i --legacy-peer-deps --no-save --force ${toInstall.join(' ')}`,
|
||||
'Installing platform specific dependencies'
|
||||
);
|
||||
}
|
||||
|
||||
async function setup() {
|
||||
try {
|
||||
// Clean up node_modules (if exists)
|
||||
@@ -69,6 +88,7 @@ async function setup() {
|
||||
|
||||
// Install dependencies
|
||||
execCommand('npm i --legacy-peer-deps', 'Installing dependencies');
|
||||
forceInstallPlatformDeps();
|
||||
|
||||
// Build packages
|
||||
execCommand('npm run build:graphql-docs', 'Building graphql-docs');
|
||||
@@ -80,10 +100,7 @@ async function setup() {
|
||||
execCommand('npm run build:bruno-filestore', 'Building bruno-filestore');
|
||||
|
||||
// Bundle JS sandbox libraries
|
||||
execCommand(
|
||||
'npm run sandbox:bundle-libraries --workspace=packages/bruno-js',
|
||||
'Bundling JS sandbox libraries'
|
||||
);
|
||||
execCommand('npm run sandbox:bundle-libraries --workspace=packages/bruno-js', 'Bundling JS sandbox libraries');
|
||||
|
||||
console.log(`\n${icons.success} Setup completed successfully!\n`);
|
||||
} catch (error) {
|
||||
@@ -93,7 +110,7 @@ async function setup() {
|
||||
}
|
||||
}
|
||||
|
||||
setup().catch(error => {
|
||||
setup().catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user