Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!project.get('private')) {
// NPMIGNORE
const ignoreFile = project.file('.npmignore');
const ignoreTemplate = templates.file('npmignore');
// "Append" configuration to `.npmignore`.
configurator(ignoreFile, ignoreTemplate.read(), '# RNA');
}
if (project.get('workspaces')) {
const lernaJson = project.file('lerna.json');
if (!lernaJson.exists()) {
const lernaPackage = require('lerna/package.json');
lernaJson.writeJson({
lerna: lernaPackage.version,
version: project.get('version') || '0.0.0',
npmClient: 'yarn',
useWorkspaces: true,
});
}
}
app.logger.success('package.json updated', project.localPath);
};
function main(argv) {
// For lerna publication to work, the NPM token must be stored in the .npmrc file in the user home directory
if ((process.env.TRAVIS || process.env.APPVEYOR) && process.env.NPM_TOKEN) {
fs.writeFileSync(
path.resolve(process.env.HOME, '.npmrc'),
`//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`,
'utf8');
}
const context = {
lernaVersion: pkg.version,
};
// yargs instance.
// Add all the standard lerna commands + our custom travis-publish command
// This is a direct copy of the lerna cli setup with our custom travis command added.
return cli()
.command(addCmd)
.command(bootstrapCmd)
.command(changedCmd)
.command(cleanCmd)
.command(createCmd)
.command(diffCmd)
.command(execCmd)
.command(importCmd)
.command(initCmd)
.command(linkCmd)