@haxtheweb/haxcms-nodejs

中文文档
26.8.1发布于 2026/08/15Apache-2.0CommonJS近 30 天下载 5387

HAXcms single and multisite nodejs server, api, and administration

原始使用文档
文档目录5 节
  1. Run commands
  2. API conformance testing
  3. Current coverage snapshot
  4. MCP and deployment profiles
  5. Watch and Learn more about HAX here:

Project Status: Active – The project has reached a stable, usable state and is being actively developed. OpenSSF Scorecard Community Support License: Apache 2.0 Contributor Covenant Discord Lit #HAXTheWeb Published on npm build X

HAXcms with nodejs backend

Start the server in any HAXsite or HAXcms instance

HAXcms nodejs backend

Run commands

npm install
npm start

Visit http://localhost:3000 if it doesn't automatically open

API conformance testing

Run endpoint conformance checks against src/openapi/site-spec.yaml:

npm run test:api-conformance

The runner creates an isolated runtime workspace, then bootstraps a real site via API before endpoint checks run.

  • The first bootstrap step calls createSite and generates a runtime site name:
    • haxcms-test-harness-{timestampStartOfTest}
  • All conformance calls then run against that real site path.
  • Optional runtime login override values:
    • HAXCMS_TEST_USERNAME
    • HAXCMS_TEST_PASSWORD

Runtime credential overrides are also supported in-process via globals:

  • globalThis.HAXCMS_RUNTIME_CREDENTIALS = { username, password }
  • globalThis.HAXCMS_RUNTIME_USERNAME
  • globalThis.HAXCMS_RUNTIME_PASSWORD

Current coverage snapshot

Current automated test coverage in this repository is the API conformance suite:

  • Suite file: test/api-conformance/site-spec.conformance.test.cjs
  • Script: npm run test:api-conformance
  • Additional test scripts/suites are not currently wired in package.json

The suite currently validates:

  • Discovery/spec endpoints:
    • getSiteApiDiscovery, getSiteOpenApi, getSiteOpenApiJson, getSiteOpenApiYaml, getApiCatalog
  • Site/content graph endpoints:
    • getSiteSummary, listEntityDescriptors, listSchemas, listItems, getItemByIdOrSlug, listContent, getContentByIdOrSlug, listTags, searchContent
  • Component and metadata endpoints:
    • listCustomElements, getCustomElementByName, listBlocks, getBlockByName, getBlockUsage, listRegions, getRegionByName
  • Theme/report/view/analytics endpoints:
    • listThemes, getActiveTheme, getThemeByName, listReports, getReportByName, getAnalyticsCapabilities, listViews, getViewById, getViewResults, listDisplaysAlias, getDisplayResultsAlias
  • Secured file and revision endpoints:
    • listFiles, createFile, getFileByUuid, updateFileByUuid, deleteFileByUuid, listItemRevisions

Behavior coverage in the same suite includes:

  • OpenAPI response/schema conformance checks
  • Auth matrix checks for secured routes (no auth, bearer-only, invalid site token, valid site token)
  • Boundary/error checks (missing required params, invalid ids/slugs, pagination/query bounds)
  • Representation/header checks (json, yaml, xml, md, html where supported)
  • End-to-end file lifecycle checks (create → list/find → get → update → delete)

Temporary known skip in the suite:

  • getApiCatalog returns linkset payload
    • Reason: runtime /.well-known/api-catalog fixture behavior is still being finalized

MCP and deployment profiles

  • MCP policy defaults are controlled via _config/config.json.
  • New installs include:
    • deploymentProfile: single-site, self-hosted-multi-site, or haxiam-managed
    • mcp.enabled: global MCP toggle
    • mcp.readOnly: write-protection toggle for future MCP write tools
  • Default behavior:
    • haxiam-managed defaults MCP to disabled unless explicitly enabled.
    • Other profiles default to MCP enabled with read-only mode on.

Get Help / Issues / Support

Watch and Learn more about HAX here:

Related links and tech

HAX Traveler: World Changer

版本与发布记录

@haxtheweb/haxcms-nodejs 共发布 61 个版本,首次发布于 2024/06/18;过去 12 个月发布了 4 个版本。

版本发布日期距今
26.8.1latest2026/08/153 个月前
26.0.12026/05/225 个月前
26.0.02026/05/136 个月前
25.0.02026/01/1010 个月前
11.0.152025/07/251.3 年前
11.0.142025/07/241.3 年前

关于 @haxtheweb/haxcms-nodejs 的常见问题

@haxtheweb/haxcms-nodejs 是什么?

HAXcms single and multisite nodejs server, api, and administration

如何安装 @haxtheweb/haxcms-nodejs?

在项目目录运行 npm install @haxtheweb/haxcms-nodejs,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 haxcms-nodejs、haxcms-nodejs-cli,可以用 npx haxcms-nodejs 直接运行。

@haxtheweb/haxcms-nodejs 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/haxtheweb__haxcms-nodejs 是否存在。

@haxtheweb/haxcms-nodejs 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@haxtheweb/haxcms-nodejs 需要什么版本的 Node.js?

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

@haxtheweb/haxcms-nodejs 可以商用吗?

@haxtheweb/haxcms-nodejs 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@haxtheweb/haxcms-nodejs 的下载量有多少?

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

@haxtheweb/haxcms-nodejs 还在维护吗?

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