1.0.0 • Published 3 years ago

@heyoo/plugins-ts-template v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@heyoo/plugins-ts-template

This project is the heyoo Command line tool's plugins template with typescript.

Before go on, you must install heyoo in global.

Usage

install:

hey install @heyoo/plugins-ts-template

exec the plugins commands:

hey foo
# or
hey bar

Develop packs template

hey create plugins
# choose plugins-ts-template and follow the other prompts

# the pluginsName is what you input by prompts
cd ./pluginsName

hey link

build package code:

<packageManager> run build

watch directory ./src, when update will rebuild:

<packageManager> run build

packageManager can be one of pnpm, npm, yarn.

Notice

  • package.json must have exports attribute, its value type must be string:
{
  "type": "module",
  "exports": "./bin/index.js"
}
  • exports targets must export default a command array:
interface command {
  command: string;
  action: (...args: any[]) => void | Promise<void>;
  option?: string[][];
  requiredOption?: string[][];
  argument?: string[][];
  description?: string;
}

export default [] as command[];

You can read this document to learn more about the interface command's attrtibute.