@seriousgaming/sdk-tools

中文文档
1.6.0发布于 2026/11/02SEE LICENSE IN LICENSETypeScriptES Module

SDK tooling for building Serious Gaming games

原始使用文档

@seriousgaming/sdk-tools

The tools for building Serious Gaming games: the seriousgaming-sdk command, the dev server and its console, scaffolding and templates, the build, the test helpers, and the documentation.

pnpm add -D @seriousgaming/sdk-tools

To start a new game, run it without installing:

pnpm dlx @seriousgaming/sdk-tools new package

The scaffolded package installs this package beside @seriousgaming/sdk, which it needs at the same version. The documentation ships inside the package, matched to its version and readable offline: start at dist/docs/index.md, or run pnpm run sdk docs view.

Stability

A version with a prerelease suffix, such as 1.0.0-alpha.1, carries none of these guarantees: it can change in any way before the release it leads to.

From 1.0.0, these follow semantic versioning. A breaking change waits for a major release:

SurfaceWhat it holds
The seriousgaming-sdk commandCommands, flags, the JSON result envelope, exit codes and error codes. Message text is not part of it
./clientcreateTestSession, startDevServer, FakeClock, the stub services and their types, and the command and projection types it re-exports from @seriousgaming/sdk

These exist for the Serious Gaming platform and this repository's own tooling, not for games, and clause 4(b) of the licence does not allow you to use them to build any other runtime. They are versioned with the package but may change in a minor release:

SubpathWhat it holds
./hostThe host half of the iframe protocol and its wire types, and how a host reads a guide
./runtimeThe uses guard, the context merge and projection, the tick-result check, the manifest version and the specification revision

Everything else in the package is internal: dist/cli.js and the other bundles, the dev console, and the layout of dist/. The exceptions are dist/docs/ and dist/templates/package/, which you may read and copy from, though their contents change with every release.

Licence

The Serious Gaming SDK Tools Licence, in LICENSE. In short: you may install and use the package to build, test and publish games for the Serious Gaming platform, and you own the games you make. Files it generates or copies into your project are yours under the Apache License, Version 2.0. You may not redistribute the package, or use it to build or run another runtime for games. The licence text, not this summary, is what applies.

版本与发布记录

@seriousgaming/sdk-tools 共发布 12 个版本,首次发布于 2026/10/18;过去 12 个月发布了 12 个版本。

版本发布日期距今
1.6.0latest2026/11/021 天前
1.5.02026/10/295 天前
1.4.02026/10/277 天前
1.3.02026/10/268 天前
1.2.02026/10/268 天前
1.1.02026/10/259 天前

其他发布通道:next → 1.0.0-alpha.4。

关于 @seriousgaming/sdk-tools 的常见问题

@seriousgaming/sdk-tools 是什么?

用于构建严肃游戏的SDK工具

如何安装 @seriousgaming/sdk-tools?

在项目目录运行 npm install @seriousgaming/sdk-tools,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@seriousgaming/sdk(^1.6.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 seriousgaming-sdk,可以用 npx seriousgaming-sdk 直接运行。

@seriousgaming/sdk-tools 支持 TypeScript 吗?

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

@seriousgaming/sdk-tools 支持 ESM 还是 CommonJS?

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

@seriousgaming/sdk-tools 需要什么版本的 Node.js?

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

@seriousgaming/sdk-tools 可以商用吗?

@seriousgaming/sdk-tools 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@seriousgaming/sdk-tools 还在维护吗?

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