这是indexloc提供的服务,不要输入任何密码
Skip to content

Generated CLIs should have the new .exclude by default #362

@jamonholmgren

Description

@jamonholmgren

This is a good first-PR for someone

Per @GantMan , let's include a commented-out line for the new exclude builder method.

https://github.com/infinitered/gluegun/blob/master/src/cli/templates/cli/src/cli.js.ejs#L8-L15

(While you're in there, also change to .brand('<%= props.name %>') to fit the new recommendations in #358)

  const cli = build('<%= props.name %>')
    .src(__dirname)
    .plugins('./node_modules', { matching: '<%= props.name %>-*', hidden: true })
    .help()           // provides default for help, h, --help, -h
    .version()        // provides default for version, v, --version, -v
    // enabled the following method if you'd like to skip loading one of these core extensions
    // this can improve performance if they're not necessary
    // .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching'])
    .create()

Why?

gluegun new foo creates a new CLI called foo. If we include the .exclude method, it'll give new CLI authors the tools they need to optimize their CLI startup time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions