npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@liuli-util/cli

v3.22.1

Published

一个针对于库和 CLI 应用程序打包的零配置 CLI

Downloads

8

Readme

@liuli-util/cli

中文

A zero-configuration CLI for packaging libraries and CLI applications.

Getting Started

Install

pnpm i -D @liuli-util/cli # Local installation
pnpm i -g @liuli-util/cli # global install

Packages

liuli-cli build lib # Package the library
liuli-cli build cli # Package cli references

Adding the -w option starts the rollup monitoring mode, the dist/ will not be compressed and the dependencies will not be added to the bundle.

watchdog mode

Generate

liuli-cli generate <name> --template lib # Generate ts-lib project
liuli-cli generate <name> --template cli # generate cli project

util also supports interactive project creation

liuli-cli generate

liuli-cli interactive creation screenshot

Deployment

Support for deploying front-end resources to a remote location via sftp/gh-pages, with configuration information in the deploy field in package.json

liuli deploy

public

| configuration | description | defaults | | ------------- | --------------------------------- | -------- | | type` | deployment type, sftp/gh-pgaes| none | |dist | Static resource directory | None | |dest` | deployed remote directory | none |

sftp

| configuration | description | defaults | | -------------------- | ----------------- | -------- | | sshConfig.host | ip address of ssh | | | sshConfig.port | ssh's port number | 22 | | sshConfig.username | ssh's username | |

gh-pages

| configuration | description | default | | ----------------- | ----------------------------------------- | --------------------------------------- | | repo?: string | the git address of the project to push to | the default is the current project | | remote?: string | push remote | defaults to origin | | branch?: string | remote branch name | defaults to gh-pages | | add?: boolean | whether to push incrementally | cleans up the dest directory by default |

Example configuration for deploying a vuepress documentation site

{
  "deploy": {
    "type": "gh-pages",
    "dist": "docs/.vuepress/dist"
  }
}

Sync configuration

liuli-cli sync

You need to specify which configuration to sync in package.json

{
  "sync": ["prettier", "workspaces", "commitlint", "simplehooks"]
}

Currently supported configuration items

  • prettier
  • commitlint
  • simplehooks
  • workspaces
  • gitignore
  • eslint-ts
  • eslint-vue-ts
  • jest

Future goals: By default, this will include checking the cli's own sync (if it needs to be used outside of monorepo), eslint/style-lint, and interactive cli when not configured

Note: Currently, only dependencies are synchronized and no installation is performed

Interactive initialization of synchronized configuration is also supported

liuli-cli sync init

Design philosophy

  • Conventions outweigh configuration and should be left out if possible. VitePress does the same thing, see: https://vitepress.vuejs.org/#lighter-page-weight This leads to a number of constraints, including the following
    • The entry file must be src/index.ts when packaging the library, and the exit file must be dist/index.esm.js and dist/index.js
    • The entry file must be src/bin.ts and the exit file is dist/bin.js when packaging the CLI.
    • When packaging lib, all dependencies are treated as external dependencies, while when packaging cli, all dependencies are typed into the bundle

FAQ

Why not bundle external dependencies

The main reason is that we want to leave the bundling to the final application, to avoid bundling the same dependencies over and over again, and to avoid dealing with the problem of using worker_threads directly on the filesystem in nodejs.