@wolfstar/shared-http-pieces 2.1.1 → 2.2.0-next-20261113172019
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 +6 -0
- package/dist/module.d.ts +14 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +5 -0
- package/dist/module.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -47,6 +47,12 @@ registers the `@wolfstar/shared-http-pieces/pieces` plugin, which loads the shar
|
|
|
47
47
|
plugin's own `register` entrypoint. Importing `@wolfstar/shared-http-pieces/register` keeps working; use one or the
|
|
48
48
|
other, not both. Sentry and the information variables below are set up the same way either way.
|
|
49
49
|
|
|
50
|
+
The module owns the `httpPieces` key of `stars.config` (`meta.configKey`, read by `@wolfstar/kit` 0.2 and later). It takes
|
|
51
|
+
no options yet and only reserves the name. When it does, options written under the key and options given in the
|
|
52
|
+
`['@wolfstar/shared-http-pieces', options]` tuple of `modules` both work, and the tuple wins. To type the key in `defineConfig`,
|
|
53
|
+
import the package's types in `stars.config.ts` (`import type {} from '@wolfstar/shared-http-pieces/module';`), with
|
|
54
|
+
`@wolfstar/schema` installed.
|
|
55
|
+
|
|
50
56
|
## Usage
|
|
51
57
|
|
|
52
58
|
You can either register after setting environment parameters:
|
package/dist/module.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
//#region src/module.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The options of the module: none yet. The `httpPieces` key of `stars.config` is reserved for them.
|
|
4
|
+
*/
|
|
5
|
+
export type SharedHttpPiecesModuleOptions = Record<string, never>;
|
|
2
6
|
/**
|
|
3
7
|
* Installs the shared commands, listeners and locales from `modules` in `stars.config`, instead of importing
|
|
4
8
|
* `@wolfstar/shared-http-pieces/register` by hand:
|
|
@@ -7,8 +11,17 @@
|
|
|
7
11
|
* ```ts
|
|
8
12
|
* export default defineConfig({ modules: ['@wolfstar/shared-http-pieces'] });
|
|
9
13
|
* ```
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The module owns the `httpPieces` key of `stars.config`, which takes no options for now. Options given in the
|
|
17
|
+
* `[specifier, options]` tuple of `modules` are merged over that key, so they win.
|
|
10
18
|
*/
|
|
11
|
-
declare const _default: import("@wolfstar/kit").StarsModule<
|
|
19
|
+
declare const _default: import("@wolfstar/kit").StarsModule<SharedHttpPiecesModuleOptions>;
|
|
20
|
+
declare module '@wolfstar/schema' {
|
|
21
|
+
interface StarsConfig {
|
|
22
|
+
httpPieces?: SharedHttpPiecesModuleOptions;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
12
25
|
//#endregion
|
|
13
26
|
export { _default as default };
|
|
14
27
|
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","names":[],"sources":["../src/module.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","names":[],"sources":["../src/module.ts"],"mappings":";;;;YAKY,gCAAgC;;;;;;;;;;;;;;;;YAyBjC;IACT,aAAa"}
|
package/dist/module.js
CHANGED
|
@@ -9,10 +9,15 @@ import { defineModule } from "@wolfstar/kit";
|
|
|
9
9
|
* ```ts
|
|
10
10
|
* export default defineConfig({ modules: ['@wolfstar/shared-http-pieces'] });
|
|
11
11
|
* ```
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* The module owns the `httpPieces` key of `stars.config`, which takes no options for now. Options given in the
|
|
15
|
+
* `[specifier, options]` tuple of `modules` are merged over that key, so they win.
|
|
12
16
|
*/
|
|
13
17
|
var module_default = defineModule({
|
|
14
18
|
meta: {
|
|
15
19
|
name: "@wolfstar/shared-http-pieces",
|
|
20
|
+
configKey: "httpPieces",
|
|
16
21
|
compatibility: { framework: ">=6.5.0" }
|
|
17
22
|
},
|
|
18
23
|
setup(_options, ctx) {
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","names":[],"sources":["../src/module.ts"],"sourcesContent":["import { defineModule } from '@wolfstar/kit';\n\n/**\n * Installs the shared commands, listeners and locales from `modules` in `stars.config`, instead of importing\n * `@wolfstar/shared-http-pieces/register` by hand:\n *\n * @example\n * ```ts\n * export default defineConfig({ modules: ['@wolfstar/shared-http-pieces'] });\n * ```\n */\nexport default defineModule({\n\tmeta: { name: '@wolfstar/shared-http-pieces', compatibility: { framework: '>=6.5.0' } },\n\tsetup(_options, ctx) {\n\t\t// `src/locales` is published next to `dist`, as `localesPath` in `./register.ts` expects.\n\t\tctx.addLocales(new URL('../src/locales', import.meta.url));\n\t\tctx.addPlugin({ from: new URL('./pieces.js', import.meta.url) });\n\t}\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","names":[],"sources":["../src/module.ts"],"sourcesContent":["import { defineModule } from '@wolfstar/kit';\n\n/**\n * The options of the module: none yet. The `httpPieces` key of `stars.config` is reserved for them.\n */\nexport type SharedHttpPiecesModuleOptions = Record<string, never>;\n\n/**\n * Installs the shared commands, listeners and locales from `modules` in `stars.config`, instead of importing\n * `@wolfstar/shared-http-pieces/register` by hand:\n *\n * @example\n * ```ts\n * export default defineConfig({ modules: ['@wolfstar/shared-http-pieces'] });\n * ```\n *\n * @remarks\n * The module owns the `httpPieces` key of `stars.config`, which takes no options for now. Options given in the\n * `[specifier, options]` tuple of `modules` are merged over that key, so they win.\n */\nexport default defineModule<SharedHttpPiecesModuleOptions>({\n\tmeta: { name: '@wolfstar/shared-http-pieces', configKey: 'httpPieces', compatibility: { framework: '>=6.5.0' } },\n\tsetup(_options, ctx) {\n\t\t// `src/locales` is published next to `dist`, as `localesPath` in `./register.ts` expects.\n\t\tctx.addLocales(new URL('../src/locales', import.meta.url));\n\t\tctx.addPlugin({ from: new URL('./pieces.js', import.meta.url) });\n\t}\n});\n\ndeclare module '@wolfstar/schema' {\n\tinterface StarsConfig {\n\t\thttpPieces?: SharedHttpPiecesModuleOptions;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,qBAAe,aAA4C;CAC1D,MAAM;EAAE,MAAM;EAAgC,WAAW;EAAc,eAAe,EAAE,WAAW,UAAU;CAAE;CAC/G,MAAM,UAAU,KAAK;EAEpB,IAAI,WAAW,IAAI,IAAI,kBAAkB,YAAY,GAAG,CAAC;EACzD,IAAI,UAAU,EAAE,MAAM,IAAI,IAAI,eAAe,YAAY,GAAG,EAAE,CAAC;CAChE;AACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wolfstar/shared-http-pieces",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-next-20261113172019",
|
|
4
4
|
"description": "The common pieces for Star Network's HTTP-only bots",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@sapphire/pieces": "^4.4.1",
|
|
63
63
|
"@sentry/node": "^11.4.0",
|
|
64
64
|
"@wolfstar/env-utilities": "^2.3.1",
|
|
65
|
-
"@wolfstar/http-framework": "^6.
|
|
65
|
+
"@wolfstar/http-framework": "^6.6.0-next-20261113172019",
|
|
66
66
|
"@wolfstar/plugin-i18next": "2.1.1",
|
|
67
67
|
"discord-api-types": "^0.38.8",
|
|
68
68
|
"i18next": "^26.4.2",
|
|
@@ -72,16 +72,21 @@
|
|
|
72
72
|
"@vitest/coverage-v8": "^5.0.3",
|
|
73
73
|
"@wolfstar/i18next-type-generator": "^3.1.6",
|
|
74
74
|
"@wolfstar/kit": "^0.3.1",
|
|
75
|
+
"@wolfstar/schema": "^0.12.0",
|
|
75
76
|
"golar": "^0.1.10",
|
|
76
77
|
"typescript": "~7.0.2",
|
|
77
78
|
"vitest": "^5.0.3"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
80
|
-
"@wolfstar/kit": ">=0.3.0"
|
|
81
|
+
"@wolfstar/kit": ">=0.3.0",
|
|
82
|
+
"@wolfstar/schema": ">=0.9.0"
|
|
81
83
|
},
|
|
82
84
|
"peerDependenciesMeta": {
|
|
83
85
|
"@wolfstar/kit": {
|
|
84
86
|
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@wolfstar/schema": {
|
|
89
|
+
"optional": true
|
|
85
90
|
}
|
|
86
91
|
},
|
|
87
92
|
"engines": {
|