@endora-commerce/platform

中文文档
0.110.0发布于 2026/11/09MITTypeScriptES Module构建来源已验证近 30 天下载 2023

The host package (feature 080, T042a). Publishes the surface an installed extension package compiles against: five enumerated subpaths, one per platform directory that has published API. No root export and no wildcard (D-160.7). The remaining subpaths are

原始使用文档
文档目录3 节
  1. It has no src/ , and that is the answer to the placement qu…
  2. Two tsconfigs, for the reason the other packages have two
  3. No lint and no test script

@endora-commerce/platform — the host package

The surface an installed extension package compiles against. Five enumerated exports subpaths, one per platform directory that has published API; no root export and no wildcard (D-160.7). The design, the classification behind it and every rejected alternative are in specs/080-f4-real-scope/contracts/host-package.md; this file records only what is peculiar to the package directory itself.

It has no src/, and that is the answer to the placement question

The contract's §2.1 points every subpath at ./dist/<dir>/index.js and its §8 step 5 says rootDir. Read together those two sentences imply the package's own src/ holds kernel/, http/, tenancy/, commands/ and events/ — which would mean relocating five directories out of backend/src: 82 files, plus every relative specifier aimed at them from the 1400-plus module files, plus both composition roots and the whole test tree. §9 records that tsc -p over a host package with rootDir set was never run, so this was the part the contract had not tested.

It is not required. tsconfig.build.json sets rootDir to ../../backend/src and includes exactly the five published directories. tsc emits paths relative to rootDir, so the layout under dist is kernel/, http/, tenancy/, commands/, events/ — byte-for-byte the layout §2.1's exports map names, with the sources left where 1400 files already point at them.

Two measurements make that safe rather than lucky:

  • The five directories are closed under relative imports. 82 files, and zero specifiers escaping the set — nothing reaches db/, overlay/, packages/, modules/ or apps/. So the include list is the whole compilation and no db/index.js (§1.4f: 219 module-owned entity references) can be dragged in behind it.
  • backend's own build is untouched. backend type-checks with --noEmit and executes through tsx/vitest; it does not compile these files to dist. Nothing about this package changes what backend reads or emits, and the emitted output lands only under packages/platform/dist, which is git-ignored.

The relocation stays available and stays cheap in the direction that matters: moving the sources here later changes rootDir and include and nothing else, because the exports map already names the emitted layout rather than the source layout.

Two tsconfigs, for the reason the other packages have two

tsconfig.json type-checks with tsconfig.base.json's paths active — @endora-commerce/* resolves at a sibling's source, which is what keeps a worktree honest (issue #255) — and carries noEmit. tsconfig.build.json clears paths, sets rootDir, and emits with noEmitOnError. Do not merge them: rootDir with an active paths block is TS6059, which exits 2 and writes the sibling's output beside the sibling's source.

rootDir is deliberately absent from the type-check half. Here it would be a guaranteed TS6059 — with paths active, @endora-commerce/contracts resolves into packages/contracts/src, which no rootDir this package could name contains.

No lint and no test script

The sources belong to the backend workspace, which lints them (eslint src) and tests them (backend/test). A second eslint pass over the same files from here would be a second author of the same verdict, and the package's own probes — the type probe, the runtime probe and the distribution-shape assertions — live in backend/test/unit/packages/, where the rest of the packaging evidence already is.

版本与发布记录

@endora-commerce/platform 共发布 15 个版本,首次发布于 2026/10/01;过去 12 个月发布了 15 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.110.0latest2026/11/095 天前
0.109.02026/11/0311 天前
0.108.02026/10/2520 天前
0.107.02026/10/2025 天前
0.106.02026/10/131 个月前
0.105.02026/10/111 个月前

关于 @endora-commerce/platform 的常见问题

@endora-commerce/platform 是什么?

The host package (feature 080, T042a). Publishes the surface an installed extension package compiles against: five enumerated subpaths, one per platform directory that has published API. No root export and no wildcard (D-160.7). The remaining subpaths are

如何安装 @endora-commerce/platform?

在项目目录运行 npm install @endora-commerce/platform,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^4)、fastify(^5.11.0)、@mikro-orm/core(^6)、@mikro-orm/migrations(^6)、@mikro-orm/postgresql(^6)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@endora-commerce/platform 支持 TypeScript 吗?

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

@endora-commerce/platform 支持 ESM 还是 CommonJS?

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

@endora-commerce/platform 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.18.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@endora-commerce/platform 可以商用吗?

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

@endora-commerce/platform 的下载量有多少?

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

@endora-commerce/platform 还在维护吗?

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