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

upload-release-tools1

v1.0.3

Published

这是一个通过命令行交互的方式提示用户确认操作,并执行一系列的打包、版本更新、镜像构建和推送至 dev 服务器的步骤。 在脚本开始时,会输出一段绿色字体的提示,提醒用户需要满足一些前置条件,包括安装 Docker、配置 Docker 的 insecure-registries、启动 Docker 服务、确保工作区干净等。

Downloads

6

Readme

介绍

这是一个通过命令行交互的方式提示用户确认操作,并执行一系列的打包、版本更新、镜像构建和推送至 dev 服务器的步骤。 在脚本开始时,会输出一段绿色字体的提示,提醒用户需要满足一些前置条件,包括安装 Docker、配置 Docker 的 insecure-registries、启动 Docker 服务、确保工作区干净等。

脚本会读取通过 npm 命令传入的用户参数,用于指定版本号更新的级别。

用户需要确认已阅读并同意继续执行操作,否则脚本会提醒用户完成前置条件后再次执行命令。

脚本会检查 Node.js 的版本,如果不是当前项目版本,则会提示用户使用该版本后重新执行命令。

接着执行 如:npm run build:dev 命令进行打包,然后执行 npm version 命令更新版本号,并检查 Docker 服务是否启动。

用户需要输入 Dev 镜像仓库的用户名和密码,然后脚本会执行 Docker 登录和构建镜像的操作。

最后,脚本会推送镜像至 dev 服务器,并输出成功推送的消息。

代码示例

// 在上面的介绍中使用此包需要按照如下方式传入对应的所需参数;
const uploadTools = require("upload-release-tools");
const config = {
  host: "", // 必传项  服务器 IP 例:127.0.0.1
  port: "", // 必传项  远程服务器端口 例:8888
  dockername: "", // 必传项  docker 的镜像名称 例:xhgw-pc-website
  dockerDepotAddress: "", // 必传项  docker 仓库地址 例:127.0.0.1:8888/szzw/
  commands: "", // 必传项  打包命令 例:yarn build:dev
  currentNodeVersion: "", // 必传项  项目依赖的 nodeVersion 例:14
};

uploadTools({ config });

使用方式

npm i upload-release-tools

在 packeage.json 中配置

"scripts": {
"release": "node ./bin/release.js ",
}

在/bin/release.js 中添加:

const uploadTools = require("upload-release-tools");
const config = {
  host: "127.0.0.1",
  port: "8888",
  dockername: "xhgw-pc-website",
  dockerDepotAddress: "127.0.0.1:8888/szzw/",
  commands: "yarn build:dev",
  currentNodeVersion: "14",
};

uploadTools({ config });

运行命令:

yarn release