Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import gulp from 'gulp';
import {cd, exec, rm} from 'shelljs';
import {argv} from 'yargs';
import babel from 'gulp-babel';
const ROOT_PATH = path.resolve(__dirname);
const PACKAGES_PATH = path.resolve(__dirname, './packages');
const packages = fs.readdirSync(PACKAGES_PATH).filter((file) => {
return fs.statSync(path.resolve(PACKAGES_PATH, file)).isDirectory();
}).reduce((acc, file) => {
return {
...acc,
[file]: path.resolve(PACKAGES_PATH, file)
};
}, {});
packages['fluxible.io'] = path.resolve(PACKAGES_PATH, '..', 'site');
packages['fluxible-examples'] = path.resolve(PACKAGES_PATH, '..', 'examples');
const sharedDeps = [
'react',
'react-dom'
];
gulp.task('install', () => {
return Promise.all(
// Link all packages to the root
Object.keys(packages).map((packageName) => {
return new Promise((resolve) => {
cd(packages[packageName]);
exec('npm link');
cd(ROOT_PATH);
exec('npm link ' + packageName);
resolve();