@bash-app/bash-common

中文文档
30.464.0发布于 2026/11/07ISCTypeScriptES Module近 30 天下载 5825

Common data and scripts to use on the frontend and backend

原始使用文档

Getting Started

If you have issues with a Prisma enum being undefined:

  1. Make certain that the enum is used in a model. If it isn't, it won't show up.

    You can add an unused enum to the model unusedModelButNeededForSomeTypesToBeDefinedForTypescript

  2. Delete node_modules directory and reinstall.

After pulling changes to prisma/schema.prisma (new fields, models), run npx prisma generate locally before npm run typecheck. Otherwise satisfies Prisma.UserSelect in extendedSchemas.ts may error until the generated client catches up (npm run build / CI does this).

Type layers

Prisma types and enums are re-exported through this package for bash-app and shared API contracts. See TYPE-LAYERS.md for where to add enums, extended schemas, and optional sub-entries like home.ts.

版本与发布记录

@bash-app/bash-common 共发布 818 个版本,首次发布于 2024/05/11;过去 12 个月发布了 267 个版本。

版本发布日期距今
30.464.0latest2026/11/07今天
30.463.02026/11/061 天前
30.461.02026/11/043 天前
30.457.02026/11/044 天前
30.455.02026/11/034 天前
30.454.02026/11/034 天前

关于 @bash-app/bash-common 的常见问题

@bash-app/bash-common 是什么?

Common data and scripts to use on the frontend and backend

如何安装 @bash-app/bash-common?

在项目目录运行 npm install @bash-app/bash-common,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:tsx(^4.10.3)、luxon(^3.5.0)、prisma(6.19.1)、@prisma/client(^6.19.1)、react-tailwindcss-datepicker(^1.6.6 || ^2.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bash-app/bash-common 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bash-app/bash-common 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bash-app/bash-common 可以商用吗?

@bash-app/bash-common 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bash-app/bash-common 的下载量有多少?

根据 npm 官方下载统计,@bash-app/bash-common 在 2026/10/08 – 2026/11/06 这 30 天内被下载 5,825 次,日均约 194 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bash-app/bash-common 还在维护吗?

最新版本 30.464.0 发布于 2026/11/07(今天);至今共发布 818 个版本,其中过去 12 个月发布了 267 个;首次发布于 2024/05/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。