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 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-whale-env

v1.0.1

Published

Create whale corp env scaffold (npm/pnpm/yarn create whale-env)

Readme

create-whale-env

交互式创建 / 追加 / 编辑 / 卸载 app-env 下的公司(corp)环境配置骨架。

生成目录示例:

app-env/src/corp/<corp-code>/
├── build.json
└── <project>/          # officeAutomatic / driver / ...
    ├── env/
    └── manifest/

要求

  • Node.js >= 18
  • 在 app-env 目录(或含有 src/corp 的目录)下执行

快速开始

# 推荐:在 app-env 下执行
cd app-env
pnpm create whale-env
# 或
npm create whale-env
yarn create whale-env

也可显式安装后再跑:

pnpm add create-whale-env
pnpm exec create-whale-env

带公司编码:

pnpm create whale-env demo001

不传编码时,会先交互询问公司编码。

卸载

# 在 app-env 下
pnpm exec create-whale-env uninstall
pnpm exec create-whale-env uninstall demo001

# 跳过确认,直接删整个公司
pnpm exec create-whale-env uninstall demo001 --force

卸载时可选择:

  • 卸载整个公司:删除 src/corp/<corp-code>/
  • 卸载部分业务端:多选后只删对应端目录;若端被删光,会一并删除公司目录

命令参数

创建 / 编辑

pnpm create whale-env [corp-code] [options]
# 或
pnpm exec create-whale-env [corp-code] [options]

| 参数 / 选项 | 说明 | |---|---| | corp-code | 公司编码(目录名 / build.json.value),可省略 | | --root <path> | 指定 app-env 根目录;默认从当前目录向上查找含 src/corp 的目录 | | --force | 公司已存在时直接走编辑模式,跳过写入方式选择 | | -h, --help | 帮助 | | -v, --version | 版本 |

卸载

pnpm exec create-whale-env uninstall [corp-code] [options]

| 参数 / 选项 | 说明 | |---|---| | corp-code | 公司编码,可省略(交互输入) | | --root <path> | 指定 app-env 根目录 | | --force | 跳过确认,直接卸载整个公司 |

公司编码规则:字母开头,仅含字母 / 数字 / _ / -,不能以下划线开头。

交互流程

  1. 公司编码(未传参时询问)
  2. 若公司已存在:展示已有业务端
  3. 公司中文名
    • 新建:直接填写
    • 已存在:选择「保持原名 / 重命名」
  4. 若公司已存在:选择写入方式
    • 追加新端:只生成尚未开通的端
    • 编辑已有的端:回填已有配置后修改(全部端都已开通时不出现「追加」)
    • 取消
  5. 多选业务端(空格勾选,回车确认)
  6. 按端填写配置(有默认值显示「回车保留」,非必填空值显示「回车跳过」)

可开通业务端

| 显示名 | 目录名 | CLIENT | |---|---|---| | 移动OA | officeAutomatic | EMPLOYEE | | 司机端 | driver | DRIVER | | 冶金仓储 | steelWare | EMPLOYEE | | 供应商端 | vendor | VENDOR | | 客户端 | customer | CUSTOMER | | 生产商端 | manufactUser | MANUFACTURER | | 自定义端 | portal | (空) |

每端会询问的字段

| 字段 | 必填 | 写入位置(示意) | |---|---|---| | DOMAIN | 是 | env/base.ts | | App 显示名 | 是 | manifest/*.manifest.json → name | | WECHAT_APPID | 否 | env/base.ts / env/wechat/base.ts | | WORK_WECHAT_APPID | 否 | 同上 | | WECHAT_SERVICE_APPID | 否 | 同上 | | uni-app appid | 否 | manifest → appid(空则占位) | | DCloud AppKey | 否 | env/android|ios/base.ts | | 集团域名 | 否 | env/group*.ts(默认占位域名) |

每个业务端会生成完整 env(含 wechat / android / ios × 各环境)+ 三份 manifest。

本地开发

cd app-cli/packages/env
pnpm install
pnpm dev -- demo001 --root ../../../app-env
# 或
pnpm build && node ./dist/cli.js demo001 --root ../../../app-env
# 卸载本地验证
pnpm build && node ./dist/cli.js uninstall demo001 --root ../../../app-env

说明

  • loginConf / pages / userCenter 等在 app-env/src/app/config/<project>/,按业务端共享,本工具不生成。
  • 生成后执行 app-env 的 pnpm build,新公司会出现在公司选择列表中。