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

zan-trashbin

v1.0.1-beta.1

Published

打包垃圾桶

Downloads

8

Readme

前端仓库垃圾桶工具

一、工具介绍

  • 当前前端开发套路依赖version文件,在多人开发中难免遇到version文件冲突的问题。
  • 为了解决这个问题,演变出了一个开发仓库,一个发布仓库的开发模式,通过垃圾桶可以让开发仓库无感知发布仓库。 流程图

二、工具实现

两个实现: 初始化、 发布

初始化做了两件件事:

  • 添加一份配置文件(trashbin.json)到开发仓库 (init)
  • 增加.gitignore对version文件的覆盖 (init)

发布流程:

  • 根据配置,确保发布仓库存在
  • 检查当前开发仓库工作区干净
  • 切换至当前开发分支对应的发布分支
  • 根据配置,移动开发仓库中的文件至发布仓库
  • 根据自定义的commit模版提交发布仓库代码

三、如何使用

1. 安装开发依赖

  yarn add --dev zan-trashbin

2. 项目初始化

  npx trashbin init

需要填写发布仓库地址以及选择是否要删除开发依赖,记不住可以无脑回车,再修改配置文件

  // trashbin.json
  {
    "packageName": "pc-shared-service", // 默认开发分支package.json.name
    "trashbinPath": "[email protected]", // 发布仓库地址
    "include": [  // 一个应用必要运行的文件即可
      "dist/app",
      "dist/definitions", // 如果用了ts,记得移动 definitions
      "static",
      "bin",
      "config",
      "app.yaml",
      "yarn.lock",
      "package.json",
      "README.md"
    ],
    "commit": [
      "\t{#PACKAGE#} 构建\n",
      "\ttime:     {#TIME#}\n",
      "\tbuild:    {#BUILDER#}\n",
      "\tbranch:   {#BRANCH#}\n",
      "\tcommit:   {#COMMIT#}\n"
    ],
    "removeDevDeps": true // 在发布仓库移除 devDependencies 加快发布 0.1.0 开始支持的功能
    "forceOriginBranch": [] // 移动时,当前分支必须与远端分支保持一直(commit); ["*"]、["merge/*","master"]、["master"]、[],1.0.0 开始支持的功能
  }

3. run it

  npx trashbin init

实际常场: 搭配packas.json.script 或则 makefile 因为只是一个文件移动提交工具,垃圾桶并不会帮你打包之类的。

四、注意事项

  • include 千千万万别加 .gitignore
  • 会在本地拉打包仓库,地址 ~/.trashbin/**