@heyoo/packs-js-template
v1.0.0
Published
heyoo's packs javascript template
Downloads
1
Readme
@heyoo/packs-js-template
This project is the heyoo Command line tool's packs template with javascript.
Before go on, you must install heyoo in global.
Usage
in the project you want to use a heyoo packs, create a heyoo config file(hey.config.js
or hey.config.json
):
// hey.config.js
export default {
packs: '@heyoo/packs-js-template'
}
then install:
pnpm add @heyoo/packs-js-template
# or
npm i @heyoo/packs-js-template
# or
yarn add @heyoo/packs-js-template
exec the exports script:
hey run foo
# or
hey run bar
Develop packs template
hey create packs
# choose packs-js-template and follow the other prompts
# the packsName is what you input by prompts
cd ./packsName
hey link
build package code:
<packageManager> run build
watch directory ./src, when update will rebuild:
<packageManager> run watch
packageManager can be one of pnpm
, npm
, yarn
.
Notice
- package.json must have
exports
attribute, it must look like:
{
"type": "module",
"exports": {
// you can know more on [Package entry points](https://nodejs.org/api/packages.html#packages_package_entry_points)
"./foo": "./bin/foo.js",
"./bar": "./bin/bar.js"
}
}
- exports targets must export default a function.