Skip to content

Latest commit

 

History

History

new

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

garden lerna-new

Generate a new Lerna package based on a template source directory. All source file names and content are evaluated for Handlebars (with registered helpers) tag expressions. The following custom helpers are also available:

  • kebabcase – convert string to kebab case
  • pluralize – convert word to plural form
  • singularize – convert word to singular form
  • snakecase – convert string to snake case
  • startcase – convert string to start case

Usage

import { lernaNew } from '@zendeskgarden/scripts';
import { tmpdir } from 'os';

const args: {
  src: string;
  dest: string;
  tags?: Record<string, string>;
} = {
  src: __dirname,
  dest: tmpdir()
  /* optional overrides */
};

(async () => {
  const result = await lernaNew(args);

  if (result) {
    const { src, dest } = result;

    console.log(src, dest);
  }
})();

Arguments

  • src template source directory.
  • dest package destination directory.
  • tag <name>=<value> tags for template substitution.

Command

garden lerna-new [--tag <tags...>] <src> <dest>