@wolfstar/plugin-sharder 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/esm/module.d.ts +9 -0
- package/dist/esm/module.d.ts.map +1 -0
- package/dist/esm/module.js +17 -0
- package/dist/esm/module.js.map +1 -0
- package/package.json +18 -1
package/README.md
CHANGED
|
@@ -304,6 +304,20 @@ ShardClient.registerMessageTransformer("aes", () => new AesTransformer(process.e
|
|
|
304
304
|
const manager = new ShardManager({ messageHandler: "v8", transformers: ["gzip", "aes"] });
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
+
## Stars module
|
|
308
|
+
|
|
309
|
+
On framework 6.1 and later, list the module in `modules` in `stars.config` (needs the optional
|
|
310
|
+
`@wolfstar/kit` peer) to add the package to the auto imports:
|
|
311
|
+
|
|
312
|
+
```ts
|
|
313
|
+
// stars.config.ts
|
|
314
|
+
export default defineConfig({
|
|
315
|
+
modules: ["@wolfstar/plugin-sharder/module"],
|
|
316
|
+
});
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The module registers no plugin and takes no options: you still construct the `ShardManager` yourself.
|
|
320
|
+
|
|
307
321
|
## RFC alignment
|
|
308
322
|
|
|
309
323
|
| Source | Point | Here |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/module.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Stars module: listing `@wolfstar/plugin-sharder/module` in `modules` in `stars.config` adds the package to the
|
|
4
|
+
* auto imports. Shards are still started by constructing a `ShardManager` yourself.
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: import("@wolfstar/kit").StarsModule<import("@wolfstar/kit").ModuleOptions>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default as default };
|
|
9
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","names":[],"sources":["../../src/module.ts"],"mappings":";;;;;cAEA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineModule } from "@wolfstar/kit";
|
|
2
|
+
|
|
3
|
+
//#region src/module.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Stars module: listing `@wolfstar/plugin-sharder/module` in `modules` in `stars.config` adds the package to the
|
|
6
|
+
* auto imports. Shards are still started by constructing a `ShardManager` yourself.
|
|
7
|
+
*/
|
|
8
|
+
var module_default = defineModule({
|
|
9
|
+
meta: { name: "@wolfstar/plugin-sharder" },
|
|
10
|
+
setup(_options, ctx) {
|
|
11
|
+
ctx.addImports("@wolfstar/plugin-sharder");
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { module_default as default };
|
|
17
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","names":[],"sources":["../../src/module.ts"],"sourcesContent":["import { defineModule } from \"@wolfstar/kit\";\n\n/**\n * The Stars module: listing `@wolfstar/plugin-sharder/module` in `modules` in `stars.config` adds the package to the\n * auto imports. Shards are still started by constructing a `ShardManager` yourself.\n */\nexport default defineModule({\n meta: { name: \"@wolfstar/plugin-sharder\" },\n setup(_options, ctx) {\n ctx.addImports(\"@wolfstar/plugin-sharder\");\n },\n});\n"],"mappings":";;;;;;;AAMA,qBAAe,aAAa;CAC1B,MAAM,EAAE,MAAM,2BAA2B;CACzC,MAAM,UAAU,KAAK;EACnB,IAAI,WAAW,0BAA0B;CAC3C;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wolfstar/plugin-sharder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Multi-process sharding for @wolfstar/plugin-gateway: spawn shards as processes, cluster workers, or worker threads, and message between them",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cluster",
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
"types": "./dist/esm/register.d.ts",
|
|
44
44
|
"default": "./dist/esm/register.js"
|
|
45
45
|
}
|
|
46
|
+
},
|
|
47
|
+
"./module": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/esm/module.d.ts",
|
|
50
|
+
"default": "./dist/esm/module.js"
|
|
51
|
+
}
|
|
46
52
|
}
|
|
47
53
|
},
|
|
48
54
|
"publishConfig": {
|
|
@@ -52,6 +58,17 @@
|
|
|
52
58
|
"dependencies": {
|
|
53
59
|
"@sapphire/result": "^2.8.0"
|
|
54
60
|
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@wolfstar/kit": "^0.1.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@wolfstar/kit": "^0.1.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@wolfstar/kit": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
55
72
|
"engines": {
|
|
56
73
|
"node": ">=20.0.0"
|
|
57
74
|
},
|