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

@bct-common/mom

v0.0.15

Published

MOM (制造运营管理) 页面视图与页面级 i18n,可从宿主工程通过 pnpm workspace 或发布包复用

Downloads

70

Readme

@bct/mom

本包承载 MOM(制造运营管理) 相关的前端页面(views/mom)与 页面级国际化i18n/pages/mom),与宿主工程通过 pnpm workspace 链接;也可复制目录或发布后给其他 Vue 3 工程复用。

在本仓库中的用法

  1. 根目录已配置 pnpm-workspace.yaml,将 packages/* 纳入 workspace。
  2. package.json 依赖 "@bct/mom": "workspace:*"pnpm install 时会自动链接到 packages/mom,无需再手动拷贝源码。
  3. 宿主工程需保留以下约定(本仓库已写好):
    • Vite resolve.alias/@/views/mompackages/mom/views/mom(保证原有 /@/views/mom/... 引用与后端菜单 component 路径不变)。
    • 动态路由src/router/backEnd.ts):除 ../views/**/* 外,增加对 ../../packages/mom/views/**/*import.meta.glob,并用 normalizeViewsModuleKey 将 key 规范为与原先一致的 mom/... 后缀,以便 dynamicImport 匹配后端返回的组件路径。
    • i18nsrc/i18n/index.ts):合并 import.meta.glob('../../packages/mom/i18n/**/*.ts'),与 src/i18n 下其它页面语言包一起进入 messages
    • TypeScripttsconfig.jsoninclude 包含 packages/mom/**/*.vue**/*.ts,以便类型检查与 IDE 跳转。

在其它项目中复用

宿主需与本项目一样使用 /@/ 指向自身 src(axios、api、stores、utils 等仍从宿主解析)。MOM 页面内的业务代码大量依赖该别名。

方式 A:pnpm workspace(推荐,同 monorepo)

在宿主仓库根目录:

# pnpm-workspace.yaml
packages:
  - 'packages/*'

将本包目录放入宿主 packages/mom(或子模块 / git subtree 同步同路径),在宿主 package.json 中增加:

{
  "dependencies": {
    "@bct/mom": "workspace:*"
  }
}

然后在宿主 VitebackEnd 动态 globi18n 合并tsconfig include 四处按上文「在本仓库中的用法」对齐配置即可。

方式 B:发布到 npm / 私有 registry

  1. packages/mom/package.jsonnameversion 调整为你的 scope(例如 @your-org/mom),按需设置 "private": false 后执行发布流程。
  2. 在宿主中 pnpm add @your-org/mom,并把 Vite 中 /@/views/mom 别名指向 node_modules/@your-org/mom/views/mom(或该包 exports 所暴露的目录)。
  3. 动态路由 glob 改为指向 node_modules/@your-org/mom/views/**/*,并在 normalizeViewsModuleKey 中增加对路径片段 packages/mom/views/ 的识别(与本仓库一致;注意不要用前导 /packages/,否则匹配不到 Vite 返回的 ../../packages/... 形式 key)。

方式 C:file / link 本地路径

"@bct/mom": "file:../01-Client-QY/packages/mom"

别名仍指向该包内 views/mom 物理路径即可。

目录说明

| 路径 | 说明 | |------|------| | views/mom/** | 原 src/views/mom,组件路径仍以 mom/... 为后缀供后端路由匹配 | | i18n/pages/mom/** | 原 src/i18n/pages/mom,随宿主 i18n 初始化合并 |

维护注意

  • 新增仅 MOM 使用的页面级文案时,请在本包 i18n 下维护,避免与宿主 src/i18n/pages 键名冲突。
  • 若后端菜单 component 字段规则变更,需同步检查 dynamicImport 的匹配逻辑。