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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aplus-frontend/build-cli

v2.1.0

Published

aplus build cli for aplus-frontend team.

Readme

Aplus Build Cli

NPM Version NPM Downloads NPM License

aplus构建拉取应用脚本,三条线的业务应用会在构建阶段,合并拉取成一个发布应用。

提示:构建应用需要使用该脚本,业务应用不需要。

安装

pnpm add @aplus-frontend/build-cli -D -w

使用

// 构建应用中
// 根路径下的 scripts/build
import { buildAllApp } from "@aplus-frontend/build-cli";
import { execSync } from "child_process";
async function bootstrap() {
  // 拉取远程业务应用代码并构建
  await buildAllApp("master", "admin", () => {
    execSync(`pnpm build`, {
      stdio: "inherit",
      encoding: "utf8",
    });
  });
}
bootstrap();

配置文件

为了避免频繁的输入操作,可以在项目根目录下配置.aplus-sync-rc文件,接收一个json配置。

以下是一个例子:

{
  "aplus-user": {
    "aplus-user-base": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-user-group/aplus-user-base.git",
    "aplus-user-mos": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-user-group/aplus-user-mos.git",
    "aplus-user-wms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-user-group/aplus-user-wms.git",
    "aplus-user-bms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-user-group/aplus-user-bms.git"
  },
  "aplus-admin": {
    "aplus-admin-base": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-base.git",
    "aplus-admin-mos": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-mos.git",
    "aplus-admin-wms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-wms.git",
    "aplus-admin-bms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-bms.git"
  },
  "global-admin": {
    "aplus-admin-mos": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-mos.git",
    "aplus-admin-wms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-wms.git",
    "aplus-admin-bms": "https://codeup.aliyun.com/65f941491febde2b6c514822/frontend/aplus-admin-group/aplus-admin-bms.git"
  },
  "sub-app-name-mapping": {
    "aplus-admin-base": "subapp-base",
    "aplus-admin-mos": "subapp-mos",
    "aplus-admin-wms": "subapp-wms",
    "aplus-admin-bms": "subapp-bms"
  }
}

| 配置参数 | 配置值描述 | 类型 | | ---------------------- | -------------------------------------------------------------------------------------------------- | ------------------------ | | aplus-user | 业务应用对应的远程地址映射,key作为在发布应用中生成的文件夹名字,value是远程拉取业务应用的地址 | Record<string, string> | | aplus-admin | 业务应用对应的远程地址映射,key作为在发布应用中生成的文件夹名字,value是远程拉取业务应用的地址 | Record<string, string> | | global-admin | 业务应用对应的远程地址映射,key作为在发布应用中生成的文件夹名字,value是远程拉取业务应用的地址 | Record<string, string> | | sub-app-name-mapping | 需要拷贝的文件夹名字映射 | Record<string, string> |

API 方法

buildAllApp

类型: function buildAllApp(branchName?: string, platform: "admin" | "user", afterBuild?: () => void): Promise<void>

描述: 并行拉取配置文件中的所有子应用代码并复制到目标目录,支持自动根据 CPU 核心数调整并发数

参数

| 参数 | 类型 | 默认值 | 描述 | | ---------- | ------------------- | -------- | -------------------------------------------- | | branchName | string | master | 分支名字 | | platform | "admin" \| "user" | - | 平台类型,用于读取配置文件中对应的子应用列表 | | afterBuild | () => void | - | 远程拉取全部业务应用并拷贝之后的回调函数 |

返回值: Promise<void>


buildGlobalApp

类型: function buildGlobalApp(branchName?: string, platform: "global", ignoreFiles?: string[], afterBuild?: () => void): Promise<void>

描述: 并行拉取全局应用的所有子应用代码并复制到目标目录,支持忽略指定文件/目录

参数

| 参数 | 类型 | 默认值 | 描述 | | ----------- | ------------ | -------- | ---------------------------------------- | | branchName | string | master | 分支名字 | | platform | "global" | - | 平台类型,必须为 "global" | | ignoreFiles | string[] | - | 需要忽略的文件/目录列表 | | afterBuild | () => void | - | 远程拉取全部业务应用并拷贝之后的回调函数 |

返回值: Promise<void>


buildOneApp

类型: function buildOneApp(subAppName: string, branchName: string, repoUrl: string, afterBuild?: () => void): Promise<void>

描述: 拉取指定子应用的代码并复制到目标目录

参数

| 参数 | 类型 | 默认值 | 描述 | | ---------- | ------------ | ------ | ------------------------------------ | | subAppName | string | - | 业务应用名称 | | branchName | string | - | 分支名字 | | repoUrl | string | - | 远程仓库地址,推荐 https 格式 | | afterBuild | () => void | - | 远程拉取业务应用并拷贝之后的回调函数 |

返回值: Promise<void>