1.0.0 • Published 3 years ago

@heyoo/packs-ts-template v1.0.0

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

@heyoo/packs-ts-template

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

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-ts-template'
}

then install:

pnpm add @heyoo/packs-ts-template
# or
npm i @heyoo/packs-ts-template
# or
yarn add @heyoo/packs-ts-template

exec the exports script:

hey run foo
# or
hey run bar

Develop packs template

hey create packs
# choose packs-ts-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.