@heyoo/plugins-ts-template
v1.0.0
Published
heyoo's plugins typescript template
Downloads
1
Readme
@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.