English | 简体中文
The best JS|TS
third-party library scaffold, quickly setup the basic framework of a new library in 10 seconds.
Libraries based on jslib-base can be shared on the jsmini platform.
To create a new project, it is recommended to use Node.js version 16 or higher.
$ npx @js-lib/cli new mylib
# Interactive queries, input project info
$ cd mylib
$ npm i
To update the project, just execute the following command in the project root directory.
$ npx @js-lib/cli update
For old projects, you can't directly execute the update command, you can first initialize a config file.
$ npx @js-lib/cli new -c
Directory Overview
.
├── demo Usage demo
├── dist Compiled out code
├── doc Project documents
├── src Source code directory
├── test Unit tests
├── CHANGELOG.md Change log
└── TODO.md To-do features
Common command scripts
$ npm run lint
$ npm run test
$ npm run build
$ npm run release
$ npm publish
This project uses lerna to manage multiple plugins, common lerna commands are:
$ npx lerna init # Initialization
$ npx lerna create @js-lib/todo # Create a package
$ npx lerna add yargs --scope=@js-lib/cli # Install dependencies for a package
$ npx lerna list # List all the packages
$ npx lerna bootstrap # Install all dependencies
$ npx lerna link # Create all links
$ npx lerna changed # List the packages to be updated in the next release
$ npx lerna publish # Release with tag, upload to git, upload to npm