fix(sdk): restore native ESM imports and action exports

This commit is contained in:
DrSmoothl committed 2026-10-23 13:04:33 +08:00
1 parent f8cb15c27b
commit b997de44a2
33 files changed
+482 -81

No files matched your search

+5 -1
View File
@@ -13,6 +13,8 @@ SDK and application versions are synchronized by `pnpm bump <version>` from the
The current Node.js requirement is `^24.22.1 || >=26.12.1`. Use the repository's `.node-version` for development and builds.
The SDK is an ES module package that supports native Node.js imports and bundler consumers. Its build uses `NodeNext`; relative source imports and re-exports must use `.js` specifiers so both emitted JavaScript and declarations resolve without a bundler. Package tests compile fresh output, load every runtime entry point with Node.js, and typecheck consumers with both NodeNext and bundler resolution.
- Major: removes or changes a public export, changes runtime behavior incompatibly, changes supported Node version, or changes package subpaths.
- Minor: adds new public API, supports new SnowLuma actions, adds optional parameters, or adds error subclasses.
- Patch: fixes bugs, improves docs, narrows implementation details without breaking public types, or updates action metadata without changing call signatures.
@@ -37,4 +39,6 @@ If the package version already exists on npm, the workflow skips publishing that
## Action Compatibility
SnowLuma action coverage is synchronized from `packages/onebot/src/actions/*.ts`. Adding an action type is a minor change unless it changes an existing method signature or return type.
`SNOWLUMA_ACTIONS`, `isSnowLumaAction`, and `SnowLumaKnownAction` are available from both `@snowluma/sdk` and `@snowluma/sdk/actions`. The catalog includes this release's executable action names, compatibility aliases, and raw actions. OneBot's registry tests verify that the SDK catalog stays aligned with the server; the published SDK does not import server code.
This local catalog is not a capability check against a connected server. Detailed parameter and result types remain in `SnowLumaActionMap`; knowing an action name does not imply it has a specialized type mapping. Custom actions remain supported through `raw()`. Adding an action type is a minor change unless it changes an existing method signature or return type.