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

nodejs-auto-publish

v1.0.64

Published

NodeJS-based front-end GitFlow automates code deployment

Downloads

170

Readme

基于nodejs的前端gitflow自动化代码部署。

NodeJS-based front-end GitFlow automates code deployment

说明 (illustrate):

运用git worktree 实现前端自动部署,源码工作区和生产分支互不干扰。一键运行,自动部署。

Use Git Worktree to implement automatic front-end deployment, and the source code workspace and production branch do not interfere with each other.

准备工作 (preparations):

  • 前端 --- front-end

    • 需至少准备一个源码分支以外的生产分支(You need to prepare at least one production branch other than the source code branch)
    • branches eg:
      • master -- 源码主分支
      • test -- 测试分支
      • release -- 生产代码分支
      • ...其他分支
  • 服务端 --- server

    • 服务端对接代码仓库的各生产分支,部署于对应服务上。(The server connects to each production branch of the code repository and deploys it on the corresponding service.)

使用 (usage):

// ./scripts/publish.mjs
import autoPublish from 'nodejs-auto-publish';

// 只有一个打包分支 only one packaging branch
autoPublish({
  branch: 'release',
  dist:'myDistPath',
  npmScript: 'app:prod',
  master:'master'  // Package qualifies the source branch that must be switched to
});

// 有多个打包分支 monorepo or multiple packaging branch
autoPublish({
  branch: {
    1: {
      name: 'release-branch-1',
      dist: 'myDistPath/app1',
      npmScript: 'app1:prod',
      master:'master'
    },
    2: {
      name: 'release-branch-2',
      dist: 'myDistPath/app2',
      npmScript: 'app2:prod'
    }
  }
});

// run node ./scripts/publish.mjs in terminal 
// 终端运行 node ./scripts/publish.mjs

| prop | type | desc | default | |--------------|-----------------|-------------------------------------------------------------------------------|----------------------------------| | master | string | 你的主源码分支,如果设置为null,则任意分支均可以打包发布代码,否则必须切换到master分支才能进行 | master | | branch | string / object | 打包分支名,请参照上述示例 | release | | npmScript | string | 打包脚本,参照package.json的打包脚本,内部会执行npm run ${npmScript},只在单个打包分支下有效,多个打包分支参照示例配置 | | | debug | boolean | 调试模式,在git commit 后结束进程,不会触发 git push | false | | customCommit | function | 自定义git commit message | ({release,currentSrcBranch})=>{} | | dist | string | 打包输出的目录,只在单个打包分支下有效,多个打包分支参照示例配置 | dist | | shortCommit | boolean | 简短的commit hash | true |