How to use the lerna/package.json.version function in lerna

To help you get started, we’ve selected a few lerna examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chialab / rna-cli / commands / init / tasks / npm.js View on Github external
if (!project.get('private')) {
        // NPMIGNORE
        const ignoreFile = project.file('.npmignore');
        const ignoreTemplate = templates.file('npmignore');

        // "Append" configuration to `.npmignore`.
        configurator(ignoreFile,, '# RNA');

    if (project.get('workspaces')) {
        const lernaJson = project.file('lerna.json');
        if (!lernaJson.exists()) {
            const lernaPackage = require('lerna/package.json');
                lerna: lernaPackage.version,
                version: project.get('version') || '0.0.0',
                npmClient: 'yarn',
                useWorkspaces: true,

    app.logger.success('package.json updated', project.localPath);
github google / closure-compiler-npm / build-scripts / lerna-publish.js View on Github external
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) {
        path.resolve(process.env.HOME, '.npmrc'),

  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()