@wolfstar/shared-http-pieces 2.0.6 → 2.0.7
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 +2 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +9 -1
- package/dist/register.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ The shared commands used for Star Network's HTTP-only bots.
|
|
|
25
25
|
- Importing `@wolfstar/shared-http-pieces/register` registers a `preGenericsInitialization` hook
|
|
26
26
|
that adds this package's bundled locales and `commands/shared` namespace to your `Client`'s i18n
|
|
27
27
|
configuration automatically, while retaining the consumer's own locale path and namespaces. As
|
|
28
|
-
long as it's imported before `new Client(...)
|
|
28
|
+
long as it's imported before `new Client(...)` — before or after `@wolfstar/plugin-i18next/register`,
|
|
29
|
+
which the Stars CLI injects on its own — no manual wiring is required. The resolved path
|
|
29
30
|
is also exported as `localesPath`, if you need it directly.
|
|
30
31
|
|
|
31
32
|
## Usage
|
package/dist/register.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","names":[],"sources":["../src/register.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"register.d.ts","names":[],"sources":["../src/register.ts"],"mappings":";;;;;;qBAYa"}
|
package/dist/register.js
CHANGED
|
@@ -3,8 +3,8 @@ import { captureException } from "@sentry/node";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { Client, Command, Listener, RegisterCommand, container } from "@wolfstar/http-framework";
|
|
6
|
+
import { InternationalizationHandler, applyLocalizedBuilder, getSupportedUserLanguageName, getSupportedUserLanguageT } from "@wolfstar/plugin-i18next";
|
|
6
7
|
import { EmbedBuilder, TimestampStyles, time } from "@discordjs/builders";
|
|
7
|
-
import { applyLocalizedBuilder, getSupportedUserLanguageName, getSupportedUserLanguageT } from "@wolfstar/plugin-i18next";
|
|
8
8
|
import { ButtonStyle, ComponentType, MessageFlags } from "discord-api-types/v10";
|
|
9
9
|
import { cpus, uptime } from "node:os";
|
|
10
10
|
import { getRootData } from "@sapphire/pieces";
|
|
@@ -252,11 +252,19 @@ const localesPath = join(fileURLToPath(new URL("../src/locales", import.meta.url
|
|
|
252
252
|
* package's locales into `options.i18n.backend.paths` before the plugin builds its
|
|
253
253
|
* `InternationalizationHandler` — consumers that only import this module keep working
|
|
254
254
|
* without having to list `localesPath` in their own `Client` config.
|
|
255
|
+
*
|
|
256
|
+
* That ordering only holds when this module is evaluated first. When the plugin's `register`
|
|
257
|
+
* entrypoint is imported earlier (the Stars CLI prepends it to the entry of every project that
|
|
258
|
+
* depends on the plugin), its hook runs first and has already built the handler from the
|
|
259
|
+
* original options. The handler is then rebuilt from the merged ones: it only reads its options
|
|
260
|
+
* in the constructor and is initialized later, in the plugin's `preLoad` hook, which reads
|
|
261
|
+
* `container.i18n` at call time.
|
|
255
262
|
*/
|
|
256
263
|
Client.plugins.registerPreGenericsInitializationHook((options) => {
|
|
257
264
|
const { i18n } = options;
|
|
258
265
|
if (!i18n) return;
|
|
259
266
|
options.i18n = registerSharedLocales(i18n, localesPath);
|
|
267
|
+
if (container.i18n) container.i18n = new InternationalizationHandler(options.i18n);
|
|
260
268
|
}, "@wolfstar/shared-http-pieces");
|
|
261
269
|
await import("@wolfstar/plugin-i18next/register");
|
|
262
270
|
|
package/dist/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","names":["SharedListener","SharedListener","SharedListener"],"sources":["../src/commands/info.ts","../src/listeners/SharedAutocompleteError.ts","../src/listeners/SharedCommandError.ts","../src/listeners/SharedError.ts","../src/listeners/SharedInteractionHandlerError.ts","../src/lib/register-i18n.ts","../src/register.ts"],"sourcesContent":["import { EmbedBuilder, time, TimestampStyles } from '@discordjs/builders';\nimport { Command, container, RegisterCommand } from '@wolfstar/http-framework';\nimport { applyLocalizedBuilder, getSupportedUserLanguageName, getSupportedUserLanguageT, type TFunction } from '@wolfstar/plugin-i18next';\nimport {\n\tButtonStyle,\n\tComponentType,\n\tMessageFlags,\n\ttype APIActionRowComponent,\n\ttype APIComponentInMessageActionRow,\n\ttype APIEmbedField\n} from 'discord-api-types/v10';\nimport { cpus, uptime, type CpuInfo } from 'node:os';\nimport { getInvite, getRepository } from '../lib/information.js';\n\ntype TranslateFn = TFunction;\n\n@RegisterCommand((builder) => applyLocalizedBuilder(builder, 'commands/shared:info'))\nexport class SharedCommand extends Command {\n\tpublic override chatInputRun(interaction: Command.ChatInputInteraction) {\n\t\tconst t = getSupportedUserLanguageT(interaction) as TranslateFn;\n\t\tconst lng = getSupportedUserLanguageName(interaction);\n\t\tconst embed = new EmbedBuilder()\n\t\t\t.setDescription(t('commands/shared:infoEmbedDescription'))\n\t\t\t.addFields(this.getUptimeStatistics(t), this.getServerUsageStatistics(t, lng));\n\t\tconst components = this.getComponents(t);\n\n\t\treturn interaction.reply({ embeds: [embed.toJSON()], components, flags: MessageFlags.Ephemeral });\n\t}\n\n\tprivate getUptimeStatistics(t: TranslateFn): APIEmbedField {\n\t\tconst now = Date.now();\n\t\tconst nowSeconds = Math.round(now / 1000);\n\n\t\treturn {\n\t\t\tname: t('commands/shared:infoFieldUptimeTitle'),\n\t\t\tvalue: t('commands/shared:infoFieldUptimeValue', {\n\t\t\t\thost: time(Math.round(nowSeconds - uptime()), TimestampStyles.RelativeTime),\n\t\t\t\tclient: time(Math.round(nowSeconds - process.uptime()), TimestampStyles.RelativeTime)\n\t\t\t})\n\t\t};\n\t}\n\n\tprivate getServerUsageStatistics(t: TranslateFn, lng: string): APIEmbedField {\n\t\tconst usage = process.memoryUsage();\n\n\t\treturn {\n\t\t\tname: t('commands/shared:infoFieldServerUsageTitle'),\n\t\t\tvalue: t('commands/shared:infoFieldServerUsageValue', {\n\t\t\t\tcpu: cpus().map(SharedCommand.formatCpuInfo.bind(null)).join(' | '),\n\t\t\t\theapUsed: (usage.heapUsed / 1048576).toLocaleString(lng, { maximumFractionDigits: 2 }),\n\t\t\t\theapTotal: (usage.heapTotal / 1048576).toLocaleString(lng, { maximumFractionDigits: 2 })\n\t\t\t})\n\t\t};\n\t}\n\n\tprivate getComponents(t: TranslateFn) {\n\t\tconst url = getInvite();\n\t\tconst support = this.getSupportComponent(t);\n\t\tconst github = this.getGitHubComponent(t);\n\t\tconst donate = this.getDonateComponent(t);\n\t\tconst data = url\n\t\t\t? [this.getActionRow(support, this.getInviteComponent(t, url)), this.getActionRow(github, donate)]\n\t\t\t: [this.getActionRow(support, github, donate)];\n\n\t\treturn data;\n\t}\n\n\tprivate getActionRow(...components: APIComponentInMessageActionRow[]): APIActionRowComponent<APIComponentInMessageActionRow> {\n\t\treturn { type: ComponentType.ActionRow, components };\n\t}\n\n\tprivate getSupportComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonSupport'),\n\t\t\temoji: { name: '🆘' },\n\t\t\turl: 'https://discord.gg/6gakFR2'\n\t\t};\n\t}\n\n\tprivate getInviteComponent(t: TranslateFn, url: string): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonInvite'),\n\t\t\temoji: { name: '🎉' },\n\t\t\turl\n\t\t};\n\t}\n\n\tprivate getGitHubComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonGitHub'),\n\t\t\temoji: { id: '950888087188283422', name: 'github2' },\n\t\t\turl: getRepository()\n\t\t};\n\t}\n\n\tprivate getDonateComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonDonate'),\n\t\t\temoji: { name: '🧡' },\n\t\t\turl: 'https://donate.wolfstar.rocks'\n\t\t};\n\t}\n\n\tprivate static formatCpuInfo({ times }: CpuInfo) {\n\t\treturn `${Math.round(((times.user + times.nice + times.sys + times.irq) / times.idle) * 10000) / 100}%`;\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'info', piece: SharedCommand as any, store: 'commands' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventAutocompleteContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'autocompleteError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventAutocompleteContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('command', context.command.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedAutocompleteError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventCommandContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'commandError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventCommandContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('command', context.command.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedCommandError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'error' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventInteractionHandlerContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'interactionHandlerError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventInteractionHandlerContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('handler', context.handler.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedInteractionHandlerError', piece: SharedListener as any, store: 'listeners' });\n","import { getRootData } from '@sapphire/pieces';\nimport type { InternationalizationOptions } from '@wolfstar/plugin-i18next';\nimport type { InitOptions } from 'i18next';\nimport { join } from 'node:path';\n\nexport const sharedNamespace = 'commands/shared';\n\nfunction addSharedNamespace(options: InitOptions | undefined, discoveredNamespaces: string[]): InitOptions {\n\tconst configuredNamespaces = options?.ns === undefined ? [] : [options.ns].flat();\n\n\treturn {\n\t\t...options,\n\t\tns: [...new Set([...discoveredNamespaces, ...configuredNamespaces, sharedNamespace])]\n\t};\n}\n\n/**\n * Adds this package's locales without losing locales and namespaces discovered by the consumer.\n *\n * `@wolfstar/plugin-i18next@2` lets `backend.paths` replace its generated consumer path and only\n * discovers namespaces below `defaultLanguageDirectory`. Supplying both values explicitly keeps\n * the consumer resources and makes this package's namespace available to i18next.\n */\nexport function registerSharedLocales(i18n: InternationalizationOptions, localesPath: string): InternationalizationOptions {\n\tconst languagesDirectory = i18n.defaultLanguageDirectory ?? join(getRootData().root, 'languages');\n\tconst consumerLocalesPath = join(languagesDirectory, '{{lng}}', '{{ns}}.json');\n\tconst configuredI18next = i18n.i18next;\n\n\treturn {\n\t\t...i18n,\n\t\tbackend: {\n\t\t\t...i18n.backend,\n\t\t\tpaths: [...new Set([consumerLocalesPath, ...(i18n.backend?.paths ?? []), localesPath])]\n\t\t},\n\t\ti18next(namespaces, languages) {\n\t\t\tconst options = typeof configuredI18next === 'function' ? configuredI18next(namespaces, languages) : configuredI18next;\n\t\t\treturn addSharedNamespace(options, namespaces);\n\t\t}\n\t};\n}\n","import { Client } from '@wolfstar/http-framework';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport './commands/_load.js';\nimport './listeners/_load.js';\nimport { registerSharedLocales } from './lib/register-i18n.js';\n\n/**\n * Path pattern for this package's bundled locales, in the format\n * `@wolfstar/plugin-i18next` expects for `i18n.backend.paths`.\n */\nexport const localesPath = join(fileURLToPath(new URL('../src/locales', import.meta.url)), '{{lng}}', '{{ns}}.json');\n\n/**\n * `@wolfstar/plugin-i18next` reads `Client`'s `i18n` option exactly once, in its own\n * `preGenericsInitialization` hook, and has no API to register extra locale directories\n * afterwards. Hooks run in registration order, so registering this one *before* importing\n * the plugin's `register` entrypoint below guarantees it runs first and can splice this\n * package's locales into `options.i18n.backend.paths` before the plugin builds its\n * `InternationalizationHandler` — consumers that only import this module keep working\n * without having to list `localesPath` in their own `Client` config.\n */\nClient.plugins.registerPreGenericsInitializationHook((options) => {\n\tconst { i18n } = options;\n\tif (!i18n) return;\n\toptions.i18n = registerSharedLocales(i18n, localesPath);\n}, '@wolfstar/shared-http-pieces');\n\n// A dynamic import, not a static one: static imports are hoisted above the hook\n// registration above, which would let the plugin's own hook register — and run — first.\nawait import('@wolfstar/plugin-i18next/register');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAM,iCAAN,MAAM,sBAAsB,QAAQ;CAC1C,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,CAAC,MAAM;CACX,QAAQ,OAAO,sBAAsB,MAAM,WAAW;AACvD,GAAG,8BAA8B;AAIjC,MAAM,OAAO"}
|
|
1
|
+
{"version":3,"file":"register.js","names":["SharedListener","SharedListener","SharedListener"],"sources":["../src/commands/info.ts","../src/listeners/SharedAutocompleteError.ts","../src/listeners/SharedCommandError.ts","../src/listeners/SharedError.ts","../src/listeners/SharedInteractionHandlerError.ts","../src/lib/register-i18n.ts","../src/register.ts"],"sourcesContent":["import { EmbedBuilder, time, TimestampStyles } from '@discordjs/builders';\nimport { Command, container, RegisterCommand } from '@wolfstar/http-framework';\nimport { applyLocalizedBuilder, getSupportedUserLanguageName, getSupportedUserLanguageT, type TFunction } from '@wolfstar/plugin-i18next';\nimport {\n\tButtonStyle,\n\tComponentType,\n\tMessageFlags,\n\ttype APIActionRowComponent,\n\ttype APIComponentInMessageActionRow,\n\ttype APIEmbedField\n} from 'discord-api-types/v10';\nimport { cpus, uptime, type CpuInfo } from 'node:os';\nimport { getInvite, getRepository } from '../lib/information.js';\n\ntype TranslateFn = TFunction;\n\n@RegisterCommand((builder) => applyLocalizedBuilder(builder, 'commands/shared:info'))\nexport class SharedCommand extends Command {\n\tpublic override chatInputRun(interaction: Command.ChatInputInteraction) {\n\t\tconst t = getSupportedUserLanguageT(interaction) as TranslateFn;\n\t\tconst lng = getSupportedUserLanguageName(interaction);\n\t\tconst embed = new EmbedBuilder()\n\t\t\t.setDescription(t('commands/shared:infoEmbedDescription'))\n\t\t\t.addFields(this.getUptimeStatistics(t), this.getServerUsageStatistics(t, lng));\n\t\tconst components = this.getComponents(t);\n\n\t\treturn interaction.reply({ embeds: [embed.toJSON()], components, flags: MessageFlags.Ephemeral });\n\t}\n\n\tprivate getUptimeStatistics(t: TranslateFn): APIEmbedField {\n\t\tconst now = Date.now();\n\t\tconst nowSeconds = Math.round(now / 1000);\n\n\t\treturn {\n\t\t\tname: t('commands/shared:infoFieldUptimeTitle'),\n\t\t\tvalue: t('commands/shared:infoFieldUptimeValue', {\n\t\t\t\thost: time(Math.round(nowSeconds - uptime()), TimestampStyles.RelativeTime),\n\t\t\t\tclient: time(Math.round(nowSeconds - process.uptime()), TimestampStyles.RelativeTime)\n\t\t\t})\n\t\t};\n\t}\n\n\tprivate getServerUsageStatistics(t: TranslateFn, lng: string): APIEmbedField {\n\t\tconst usage = process.memoryUsage();\n\n\t\treturn {\n\t\t\tname: t('commands/shared:infoFieldServerUsageTitle'),\n\t\t\tvalue: t('commands/shared:infoFieldServerUsageValue', {\n\t\t\t\tcpu: cpus().map(SharedCommand.formatCpuInfo.bind(null)).join(' | '),\n\t\t\t\theapUsed: (usage.heapUsed / 1048576).toLocaleString(lng, { maximumFractionDigits: 2 }),\n\t\t\t\theapTotal: (usage.heapTotal / 1048576).toLocaleString(lng, { maximumFractionDigits: 2 })\n\t\t\t})\n\t\t};\n\t}\n\n\tprivate getComponents(t: TranslateFn) {\n\t\tconst url = getInvite();\n\t\tconst support = this.getSupportComponent(t);\n\t\tconst github = this.getGitHubComponent(t);\n\t\tconst donate = this.getDonateComponent(t);\n\t\tconst data = url\n\t\t\t? [this.getActionRow(support, this.getInviteComponent(t, url)), this.getActionRow(github, donate)]\n\t\t\t: [this.getActionRow(support, github, donate)];\n\n\t\treturn data;\n\t}\n\n\tprivate getActionRow(...components: APIComponentInMessageActionRow[]): APIActionRowComponent<APIComponentInMessageActionRow> {\n\t\treturn { type: ComponentType.ActionRow, components };\n\t}\n\n\tprivate getSupportComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonSupport'),\n\t\t\temoji: { name: '🆘' },\n\t\t\turl: 'https://discord.gg/6gakFR2'\n\t\t};\n\t}\n\n\tprivate getInviteComponent(t: TranslateFn, url: string): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonInvite'),\n\t\t\temoji: { name: '🎉' },\n\t\t\turl\n\t\t};\n\t}\n\n\tprivate getGitHubComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonGitHub'),\n\t\t\temoji: { id: '950888087188283422', name: 'github2' },\n\t\t\turl: getRepository()\n\t\t};\n\t}\n\n\tprivate getDonateComponent(t: TranslateFn): APIComponentInMessageActionRow {\n\t\treturn {\n\t\t\ttype: ComponentType.Button,\n\t\t\tstyle: ButtonStyle.Link,\n\t\t\tlabel: t('commands/shared:infoButtonDonate'),\n\t\t\temoji: { name: '🧡' },\n\t\t\turl: 'https://donate.wolfstar.rocks'\n\t\t};\n\t}\n\n\tprivate static formatCpuInfo({ times }: CpuInfo) {\n\t\treturn `${Math.round(((times.user + times.nice + times.sys + times.irq) / times.idle) * 10000) / 100}%`;\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'info', piece: SharedCommand as any, store: 'commands' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventAutocompleteContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'autocompleteError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventAutocompleteContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('command', context.command.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedAutocompleteError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventCommandContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'commandError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventCommandContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('command', context.command.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedCommandError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'error' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedError', piece: SharedListener as any, store: 'listeners' });\n","import { captureException } from '@sentry/node';\nimport { Listener, container, type ClientEventInteractionHandlerContext, type ClientEvents } from '@wolfstar/http-framework';\nimport { isSentryInitialized } from '../lib/sentry.js';\n\nexport class SharedListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext, options: Listener.Options) {\n\t\tsuper(context, { ...options, event: 'interactionHandlerError' satisfies keyof ClientEvents, enabled: isSentryInitialized() });\n\t}\n\n\tpublic run(error: unknown, context: ClientEventInteractionHandlerContext) {\n\t\tcaptureException(error, (scope) => scope.setLevel('error').setTag('event', this.name).setExtra('handler', context.handler.name));\n\t}\n}\n\nvoid container.stores.loadPiece({ name: 'SharedInteractionHandlerError', piece: SharedListener as any, store: 'listeners' });\n","import { getRootData } from '@sapphire/pieces';\nimport type { InternationalizationOptions } from '@wolfstar/plugin-i18next';\nimport type { InitOptions } from 'i18next';\nimport { join } from 'node:path';\n\nexport const sharedNamespace = 'commands/shared';\n\nfunction addSharedNamespace(options: InitOptions | undefined, discoveredNamespaces: string[]): InitOptions {\n\tconst configuredNamespaces = options?.ns === undefined ? [] : [options.ns].flat();\n\n\treturn {\n\t\t...options,\n\t\tns: [...new Set([...discoveredNamespaces, ...configuredNamespaces, sharedNamespace])]\n\t};\n}\n\n/**\n * Adds this package's locales without losing locales and namespaces discovered by the consumer.\n *\n * `@wolfstar/plugin-i18next@2` lets `backend.paths` replace its generated consumer path and only\n * discovers namespaces below `defaultLanguageDirectory`. Supplying both values explicitly keeps\n * the consumer resources and makes this package's namespace available to i18next.\n */\nexport function registerSharedLocales(i18n: InternationalizationOptions, localesPath: string): InternationalizationOptions {\n\tconst languagesDirectory = i18n.defaultLanguageDirectory ?? join(getRootData().root, 'languages');\n\tconst consumerLocalesPath = join(languagesDirectory, '{{lng}}', '{{ns}}.json');\n\tconst configuredI18next = i18n.i18next;\n\n\treturn {\n\t\t...i18n,\n\t\tbackend: {\n\t\t\t...i18n.backend,\n\t\t\tpaths: [...new Set([consumerLocalesPath, ...(i18n.backend?.paths ?? []), localesPath])]\n\t\t},\n\t\ti18next(namespaces, languages) {\n\t\t\tconst options = typeof configuredI18next === 'function' ? configuredI18next(namespaces, languages) : configuredI18next;\n\t\t\treturn addSharedNamespace(options, namespaces);\n\t\t}\n\t};\n}\n","import { Client, container } from '@wolfstar/http-framework';\nimport { InternationalizationHandler } from '@wolfstar/plugin-i18next';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport './commands/_load.js';\nimport './listeners/_load.js';\nimport { registerSharedLocales } from './lib/register-i18n.js';\n\n/**\n * Path pattern for this package's bundled locales, in the format\n * `@wolfstar/plugin-i18next` expects for `i18n.backend.paths`.\n */\nexport const localesPath = join(fileURLToPath(new URL('../src/locales', import.meta.url)), '{{lng}}', '{{ns}}.json');\n\n/**\n * `@wolfstar/plugin-i18next` reads `Client`'s `i18n` option exactly once, in its own\n * `preGenericsInitialization` hook, and has no API to register extra locale directories\n * afterwards. Hooks run in registration order, so registering this one *before* importing\n * the plugin's `register` entrypoint below guarantees it runs first and can splice this\n * package's locales into `options.i18n.backend.paths` before the plugin builds its\n * `InternationalizationHandler` — consumers that only import this module keep working\n * without having to list `localesPath` in their own `Client` config.\n *\n * That ordering only holds when this module is evaluated first. When the plugin's `register`\n * entrypoint is imported earlier (the Stars CLI prepends it to the entry of every project that\n * depends on the plugin), its hook runs first and has already built the handler from the\n * original options. The handler is then rebuilt from the merged ones: it only reads its options\n * in the constructor and is initialized later, in the plugin's `preLoad` hook, which reads\n * `container.i18n` at call time.\n */\nClient.plugins.registerPreGenericsInitializationHook((options) => {\n\tconst { i18n } = options;\n\tif (!i18n) return;\n\toptions.i18n = registerSharedLocales(i18n, localesPath);\n\tif (container.i18n) container.i18n = new InternationalizationHandler(options.i18n);\n}, '@wolfstar/shared-http-pieces');\n\n// A dynamic import, not a static one: static imports are hoisted above the hook\n// registration above, which would let the plugin's own hook register — and run — first.\nawait import('@wolfstar/plugin-i18next/register');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAM,iCAAN,MAAM,sBAAsB,QAAQ;CAC1C,AAAgB,aAAa,aAA2C;EACvE,MAAM,IAAI,0BAA0B,WAAW;EAC/C,MAAM,MAAM,6BAA6B,WAAW;EACpD,MAAM,QAAQ,IAAI,aAAa,CAAC,CAC9B,eAAe,EAAE,sCAAsC,CAAC,CAAC,CACzD,UAAU,KAAK,oBAAoB,CAAC,GAAG,KAAK,yBAAyB,GAAG,GAAG,CAAC;EAC9E,MAAM,aAAa,KAAK,cAAc,CAAC;EAEvC,OAAO,YAAY,MAAM;GAAE,QAAQ,CAAC,MAAM,OAAO,CAAC;GAAG;GAAY,OAAO,aAAa;EAAU,CAAC;CACjG;CAEA,AAAQ,oBAAoB,GAA+B;EAE1D,MAAM,aAAa,KAAK,MADZ,KAAK,IACe,IAAI,GAAI;EAExC,OAAO;GACN,MAAM,EAAE,sCAAsC;GAC9C,OAAO,EAAE,wCAAwC;IAChD,MAAM,KAAK,K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AG;GAAsB;EAAe,CAAC,CAAC;CACrF;AACD;;;;;;;;AASA,SAAgB,sBAAsB,MAAmC,aAAkD;CAC1H,MAAM,qBAAqB,KAAK,4BAA4B,KAAK,YAAY,CAAC,CAAC,MAAM,WAAW;CAChG,MAAM,sBAAsB,KAAK,oBAAoB,WAAW,aAAa;CAC7E,MAAM,oBAAoB,KAAK;CAE/B,OAAO;EACN,GAAG;EACH,SAAS;GACR,GAAG,KAAK;GACR,OAAO,CAAC,mBAAG,IAAI,IAAI;IAAC;IAAqB,GAAI,KAAK,SAAS,SAAS,CAAC;IAAI;GAAW,CAAC,CAAC;EACvF;EACA,QAAQ,YAAY,WAAW;GAE9B,OAAO,mBADS,OAAO,sBAAsB,aAAa,kBAAkB,YAAY,SAAS,IAAI,mBAClE,UAAU;EAC9C;CACD;AACD;;;;;;;;AC3BA,MAAa,cAAc,KAAK,cAAc,IAAI,IAAI,kBAAkB,YAAY,GAAG,CAAC,GAAG,WAAW,aAAa;;;;;;;;;;;;;;;;;AAkBnH,OAAO,QAAQ,uCAAuC,YAAY;CACjE,MAAM,EAAE,SAAS;CACjB,IAAI,CAAC,MAAM;CACX,QAAQ,OAAO,sBAAsB,MAAM,WAAW;CACtD,IAAI,UAAU,MAAM,UAAU,OAAO,IAAI,4BAA4B,QAAQ,IAAI;AAClF,GAAG,8BAA8B;AAIjC,MAAM,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wolfstar/shared-http-pieces",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "The common pieces for Star Network's HTTP-only bots",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@sapphire/pieces": "^4.4.1",
|
|
53
53
|
"@sentry/node": "^10.75.0",
|
|
54
54
|
"@wolfstar/env-utilities": "^2.2.0",
|
|
55
|
-
"@wolfstar/http-framework": "^5.1.
|
|
55
|
+
"@wolfstar/http-framework": "^5.1.1",
|
|
56
56
|
"@wolfstar/plugin-i18next": "2.0.3",
|
|
57
57
|
"discord-api-types": "^0.38.8",
|
|
58
58
|
"i18next": "^25.10.10",
|