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

zhyao-cli

v1.0.0

Published

## 开发问题

Downloads

1

Readme

zhyao-cli

开发问题

npm 账号

  • https://www.npmjs.com/ 注册一个账号,创建一个organization,与mono项目的项目名一样
  • 本地终端 npm login 登录,按照提示操作就能登录
  • pnpm pulbish -r 就能发布到npm
  • 可以在Billing 下面删除 Alt text

changeset配置

官方文档

https://pnpm.io/zh/using-changesets

在 pnpm 中使用 Changesets

一定要安装git,changeset是根据git的差异来判断

pnpm add -Dw @changesets/cli
pnpm changeset init
修改配置文件

baseBranch: 类型为字符串,默认值为main。仓库主分支。该配置用于计算当前分支的变更包并进行分类,默认为main,运行命令会有错误提示

{
  "$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "fixed": [],
  "linked": [],
  "access": "restricted",
  "baseBranch": "master",
  "updateInternalDependencies": "patch",
  "ignore": []
}
发布变更
  • 运行 pnpm changeset
  • 运行 pnpm install。 这将更新锁文件并重新构建包
  • 提交更改
  • 运行 pnpm publish -r。 此命令将发布所有包含被更新版本且尚未出现在包注册源中的包

开发问题总结

  • 每个packages的package.json 的main配置项,就是当前module对外的所有暴露,需要正确配置
  • 引用同项目下的js模块,需要在import的文件名后面添加.js后缀
  • package.json 的type 设置为module, ESM

本地调试运行

pnpm run start --filter @zhyao-cli/cli

依赖安装

单独的package
# @zhyao-cli/init 模块安装 axios
pnpm --filter @zhyao-cli/init add axios
# @zhyao-cli/init 模块安装 @zhyao-cli/command
pnpm --filter @zhyao-cli/init add @zhyao-cli/command