Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A modern JavaScript|Typescript library scaffolding, modularity, purity & extras

License

NotificationsYou must be signed in to change notification settings

yanhaijing/jslib-base

Repository files navigation

licensenpmNPM downloadsPercentage of issues still openexample workflow

English |简体中文

The bestJS|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 thejsmini platform.

⭐ Features

  • Command-line tool for quick creation and seamless upgrades
  • Supports writing source code in ES6+ or TypeScript, and compiles to generate production code
  • Auto-injection of third-party dependencies (automatically removes unnecessary code in third-party dependencies through tree shaking)
  • Supports multiple environments (native browser, AMD, commonjs, Webpack, Rollup, vite, fis, Node.js, etc.)
  • Integrated code style checker (eslint + prettier + husky)
  • Integrated unit test environment (mocha)
  • Integrated test coverage report (istanbul+nyc)
  • Integrated continuous integration tool github action
  • Integrated withjsmini

🚀 User Guide

To create a new project, it is recommended to use Node.js version 18 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 runtest$ npm run build$ npm run release$ npm publish

Contribution Guide

If you only want to modify the library code generated by the CLI, you can directly edit the template code, which is simpler.

After merging, I will migrate the template to the CLI. The template repository is as follows:

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

Contributors

contributors

Change Log

CHANGELOG.md

TODO

TODO.md

Current Users

About

A modern JavaScript|Typescript library scaffolding, modularity, purity & extras

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp