Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const packagePath = path.join(rootPath, 'packages', name);
const templatePath = path.join(selectedStack.path, 'template');
if (templatePath) {
applyTemplate(templatePath, packagePath, {
name
});
// Remove some files that aren't relevant for an individual project within a monorepo
fse.removeSync(path.join(packagePath, '.gitignore'));
fse.removeSync(path.join(packagePath, '.gitattributes'));
fse.removeSync(path.join(packagePath, '.vscode'));
rushAddPackage(name, rootPath);
logger.info('Running rush update');
rushUpdate(rootPath);
logger.info('All Set!');
const readmeFile = path.join(packagePath, 'README.md');
if (fse.existsSync(readmeFile)) {
logger.info('\n' + prettyPrintMarkdown(fse.readFileSync(readmeFile).toString()));
}
}
};
}
fse.removeSync(path.join(packagePath, '.gitignore'));
fse.removeSync(path.join(packagePath, '.gitattributes'));
fse.removeSync(path.join(packagePath, '.vscode'));
// Remove devDep entry that is not appropriate inside individual project
const pkgJson = readPackageJson(packagePath);
if (pkgJson && pkgJson.devDependencies && pkgJson.just && pkgJson.just.stack) {
delete pkgJson.devDependencies[pkgJson.just.stack];
}
fse.writeFileSync(path.join(packagePath, 'package.json'), JSON.stringify(pkgJson, null, 2));
rushAddPackage(name, rootPath);
logger.info('Running rush update');
rushUpdate(rootPath);
logger.info('All Set!');
const readmeFile = path.join(packagePath, 'README.md');
if (fse.existsSync(readmeFile)) {
logger.info('\n' + prettyPrintMarkdown(fse.readFileSync(readmeFile).toString()));
}
}
};
}