Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable no-console */
const chalk = require('chalk');
const fs = require('fs-extra');
const lerna = require('lerna');
const npm = require('./npm');
const pack = require('./pack');
const path = require('path');
const Repository = require('lerna/lib/Repository');
const integrationTestsDir = path.join(__dirname, '..', 'integration-tests');
const outputDir = path.join(integrationTestsDir, 'packages');
fs.mkdirsSync(outputDir);
const packages = lerna.getPackages(new Repository());
const packageLookup = packages.reduce((result, pkg) => {
result[pkg.name] = pkg;
return result;
}, {});
const packageTgz = {};
packages.forEach(pkg => {
console.log(`Packing ${pkg.name}...`);
const tgz = pack(pkg.location, pkg, outputDir);
packageTgz[pkg.name] = tgz;
});
const installed = new Set();
const install = pkg => {
if (installed.has(pkg.name)) {
return;