Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/accept-kit-0-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@wolfstar/plugin-api": patch
"@wolfstar/plugin-broker": patch
"@wolfstar/plugin-cache": patch
"@wolfstar/plugin-gateway": patch
"@wolfstar/plugin-i18next": patch
"@wolfstar/plugin-logger": patch
"@wolfstar/plugin-opentelemetry": patch
"@wolfstar/plugin-scheduled-tasks": patch
"@wolfstar/plugin-sharder": patch
"@wolfstar/plugin-subcommands-advanced": patch
---

Accept `@wolfstar/kit` 0.3 and `@wolfstar/schema` 0.12 as peers, next to the previous ranges.
12 changes: 12 additions & 0 deletions .changeset/require-node-22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@wolfstar/plugin-api": major
"@wolfstar/plugin-i18next": major
"@wolfstar/plugin-subcommands-advanced": major
"@wolfstar/plugin-broker": minor
"@wolfstar/plugin-cache": minor
"@wolfstar/plugin-logger": minor
"@wolfstar/plugin-scheduled-tasks": minor
"@wolfstar/plugin-sharder": minor
---

Require Node.js 22 or later. Node.js 20 is no longer supported.
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ There is **no runnable app, frontend, backend, dev server, or database**. "Runni

## Stack

- **Language:** TypeScript (`7.0.2` major, bumped from `~5.8.3`), Node `^22.11 || ^24 || >=26` (the range required by Changesets v3, raised from `>=20`; most published packages still declare `>=20.0.0`, `plugin-api` declares `>=20.18.1` (`undici`), `plugin-gateway` `>=24.17.0`, and `plugin-opentelemetry` `>=22.15.0` (the OpenTelemetry SDK packages)). `mise.toml` pins Node 24 + pnpm 12 (matches CI).
- **Language:** TypeScript (`7.0.2` major, bumped from `~5.8.3`), Node `^22.11 || ^24 || >=26` (the range required by Changesets v3, raised from `>=20`; published packages declare `>=22.0.0`, except `plugin-gateway` `>=24.17.0`, `plugin-opentelemetry` `>=22.15.0` (the OpenTelemetry SDK packages) and `plugin-i18next` `>=22.22.0` (`chokidar` 6)). `mise.toml` pins Node 24 + pnpm 12 (matches CI).
- **Package manager:** `pnpm` (corepack-pinned via `packageManager` in root `package.json`; Renovate bumps it often — check that field for the exact pin, don't hardcode it here; if `pnpm` is ever missing, run `corepack enable`). Workspaces via `pnpm-workspace.yaml`.
- **Monorepo runner:** `turbo` (`turbo run build`; `test` `dependsOn: ["^build"]`, so a build is triggered as needed).
- **Bundler:** `tsdown` per package (→ `dist/esm/`, shared options in `scripts/tsdown.config.ts`).
Expand Down Expand Up @@ -86,7 +86,7 @@ pnpm exec knip # unused code/dependency check (CI's
- Non-trivial structural work (cross-package parity ports, manager/API redesigns, new plugin scaffolding) gets a design doc under `docs/superpowers/` before implementation: a plan at `docs/superpowers/plans/<date>-<slug>.md` and, for anything with real design decisions, a matching spec at `docs/superpowers/specs/<date>-<slug>-design.md` (e.g. `docs/superpowers/specs/2026-10-05-message-types-parity-design.md`). PR descriptions for such changes link the spec/plan instead of re-explaining the design. Check this directory for prior art before redesigning an area that already has one.
- Activation has two paths. `plugin-scheduled-tasks` and `plugin-opentelemetry` are module-only (their `./register` is a no-op); `plugin-opentelemetry` also ships a third entrypoint, `./preload` (loaded with `--import`), which starts the OpenTelemetry SDK before the bot's own imports run — `./register` cannot do this, since it only runs after the bot has already started importing. The older plugins ship `./module` (default export: `defineModule` from `@wolfstar/kit`, optional peer) and, for those with runtime hooks, `./plugin` (default export: a `definePlugin` factory); `./register` stays the legacy class + `Client.plugins.register*Hook` path for framework v3/v5/v6. Both call the same functions in `src/hooks.ts`, so change behaviour there. The `stars` CLI never imports `<pkg>/register` itself; it only preloads the sources registered through `ctx.addPlugin`, so a user's own `import "<pkg>/register"` (or passing the `./plugin` factory to `plugins` while also importing `/register`) still double-installs the hooks. `tests/module-entries.test.ts` checks that every `src/module.ts` (except `plugin-scheduled-tasks`, excluded on purpose) is exported, built and has kit and schema as optional peers.
- `plugin-opentelemetry` has process-level tests (`tests/preload.test.ts`: worker thread, `SIGTERM`, WebSocket handshake) that spawn Node with the preload. The CI unit job runs vitest with no build, so the test builds `src/preload.ts` itself with `tsdown` into `packages/plugin-opentelemetry/node_modules/.cache/preload-test/`. The `SIGTERM` cases are skipped on Windows (a Windows process cannot handle the signal); run them in WSL or Linux. Interaction spans are made the active span with `context.attach` (`@opentelemetry/api` 1.10), because the framework's `*Run` events do not wrap the command. `protobufjs` is denied in `allowBuilds` (its postinstall is not needed).
- Module config keys: every `defineModule` sets `meta.configKey`, so a project writes the options under that top-level key of `stars.config` instead of the `[specifier, options]` tuple (the tuple is merged over the key and wins). Needs `@wolfstar/kit` `^0.2.0` (the peer and dev range of every package with a `src/module.ts`), and each `module.ts` augments `StarsConfig` from `@wolfstar/schema` (an optional peer and devDependency) to type the key. Keys: `plugin-api` `api`, `plugin-broker` `broker`, `plugin-cache` `cache`, `plugin-gateway` `gateway`, `plugin-i18next` `i18n`, `plugin-logger` `logger`, `plugin-opentelemetry` `opentelemetry`, `plugin-scheduled-tasks` `scheduledTasks`, `plugin-sharder` `sharder`, `plugin-subcommands-advanced` `subcommandsAdvanced`; `cache`, `gateway`, `sharder` and `subcommandsAdvanced` take no options yet and only reserve the name. A key must be unique and not a built-in key (`BUILT_IN_CONFIG_KEYS` of `@wolfstar/schema`); renaming one is a breaking change. `tests/module-config-keys.test.ts` runs every module through kit's `setupModules`. What sits under a key is written into the build, so it must be JSON.
- Module config keys: every `defineModule` sets `meta.configKey`, so a project writes the options under that top-level key of `stars.config` instead of the `[specifier, options]` tuple (the tuple is merged over the key and wins). Needs `@wolfstar/kit` `^0.2.0 || ^0.3.0` as the peer range (dev range `^0.2.0`) of every package with a `src/module.ts`, and each `module.ts` augments `StarsConfig` from `@wolfstar/schema` (an optional peer and devDependency) to type the key. Keys: `plugin-api` `api`, `plugin-broker` `broker`, `plugin-cache` `cache`, `plugin-gateway` `gateway`, `plugin-i18next` `i18n`, `plugin-logger` `logger`, `plugin-opentelemetry` `opentelemetry`, `plugin-scheduled-tasks` `scheduledTasks`, `plugin-sharder` `sharder`, `plugin-subcommands-advanced` `subcommandsAdvanced`; `cache`, `gateway`, `sharder` and `subcommandsAdvanced` take no options yet and only reserve the name. A key must be unique and not a built-in key (`BUILT_IN_CONFIG_KEYS` of `@wolfstar/schema`); renaming one is a breaking change. `tests/module-config-keys.test.ts` runs every module through kit's `setupModules`. What sits under a key is written into the build, so it must be JSON.

## Notes for agents

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ claims every path on its port and 404s anything that doesn't match, so this plug
pnpm add @wolfstar/plugin-api
```

Requires Node.js `>=20.18.1`.
Requires Node.js `>=22.0.0`.

## Usage

Expand Down Expand Up @@ -254,7 +254,7 @@ listeners log with `container.logger.fatal(error)` and answer a generic `500`.
middleware have empty bodies.
- Listener piece names are PascalCase (`PluginServerRequest`, …), and `ServerEvent.Error` carries an
optional request/response.
- `@wolfstar/http-framework` peer range is `^3.6.0 || ^5.0.0`; Node.js `>=20.18.1`.
- `@wolfstar/http-framework` peer range is `^3.6.0 || ^5.0.0 || ^6.0.0`; Node.js `>=22.0.0`.

## Scope

Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^3.6.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand All @@ -90,6 +90,6 @@
}
},
"engines": {
"node": ">=20.18.1"
"node": ">=22.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^3.4.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand All @@ -93,6 +93,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"msgpackr": "^2.1.0"
},
"peerDependencies": {
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0",
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0",
"msgpackr": "^2.0.0"
},
"peerDependenciesMeta": {
Expand All @@ -91,6 +91,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/plugin-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^3.4.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-i18next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"peerDependencies": {
"@wolfstar/http-framework": "^3.1.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/i18next-type-generator": "^3.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/i18next-type-generator": {
Expand All @@ -100,6 +100,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.22.0"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^3.4.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0",
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0",
"consola": "^3.0.0",
"evlog": "^2.30.0",
"winston": "^3.0.0"
Expand All @@ -123,6 +123,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/plugin-opentelemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"peerDependencies": {
"@opentelemetry/api": "^1.10.0",
"@wolfstar/http-framework": "^6.1.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-scheduled-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^6.1.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/schema": {
"optional": true
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-sharder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"@wolfstar/schema": "^0.9.0"
},
"peerDependencies": {
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand All @@ -81,6 +81,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-subcommands-advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
},
"peerDependencies": {
"@wolfstar/http-framework": "^3.1.0 || ^5.0.0 || ^6.0.0",
"@wolfstar/kit": "^0.2.0",
"@wolfstar/schema": "^0.9.0"
"@wolfstar/kit": "^0.2.0 || ^0.3.0",
"@wolfstar/schema": "^0.9.0 || ^0.12.0"
},
"peerDependenciesMeta": {
"@wolfstar/kit": {
Expand All @@ -90,6 +90,6 @@
}
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
}
2 changes: 1 addition & 1 deletion tests/module-entries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe.each(entries)("$manifest.name module entries", ({ manifest, tsdown, has
});

test("declares @wolfstar/kit as an optional peer and a devDependency", () => {
expect(manifest.peerDependencies?.["@wolfstar/kit"]).toBe("^0.2.0");
expect(manifest.peerDependencies?.["@wolfstar/kit"]).toBe("^0.2.0 || ^0.3.0");
expect(manifest.peerDependenciesMeta?.["@wolfstar/kit"]?.optional).toBe(true);
expect(manifest.devDependencies?.["@wolfstar/kit"]).toBeDefined();
});
Expand Down
Loading