@sapphire/plugin-i18next 7.0.0-pr-513.f0e9a18.0 → 7.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ # [@sapphire/plugin-i18next@7.0.0](https://github.com/sapphiredev/plugins/compare/@sapphire/plugin-i18next@7.0.0...@sapphire/plugin-i18next@7.0.0) - (2023-12-05)
6
+
7
+ ## 🏠 Refactor
8
+
9
+ - **register:** Cleanup unnecessary side effect imports of index ([dede596](https://github.com/sapphiredev/plugins/commit/dede596ae22ceec2700dd860287a1260f092b502))
10
+
11
+ ## 🐛 Bug Fixes
12
+
13
+ - Update transitive dependencies ([9fd4cfa](https://github.com/sapphiredev/plugins/commit/9fd4cfae031b20044aad8ae1051ade3dd29c69dd))
14
+
15
+ ## 🚀 Features
16
+
17
+ - Split ESM and CJS bundles for proper ESM and CJS loading (#512) ([d9aa006](https://github.com/sapphiredev/plugins/commit/d9aa006ff8c7f78a613dcca605d3353b992b7a46))
18
+ - 💥 **BREAKING CHANGE:** This ensures that the plugins will properly load the
19
+ either only ESM or only CJS files. This is done by outputting
20
+ dist/cjs and dist/esm folders. This requires @sapphire/framework v5.x!
21
+
5
22
  # [@sapphire/plugin-i18next@6.1.0](https://github.com/sapphiredev/plugins/compare/@sapphire/plugin-i18next@6.1.0...@sapphire/plugin-i18next@6.1.0) - (2023-11-16)
6
23
 
7
24
  ## 🐛 Bug Fixes
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
  var i18next__default = /*#__PURE__*/_interopDefault(i18next);
11
11
 
12
12
  // src/index.ts
13
- var version = "7.0.0-pr-513.f0e9a18.0";
13
+ var version = "7.0.0";
14
14
 
15
15
  Object.defineProperty(exports, 'i18next', {
16
16
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["default"],"mappings":";AAGA,SAAoB,WAAXA,gBAAyD;AAClE,cAAc;AACd,cAAc;AACd,cAAc;AAmBP,IAAM,UAAkB","sourcesContent":["import type { InternationalizationHandler } from './lib/InternationalizationHandler';\nimport type { InternationalizationClientOptions } from './lib/types';\n\nexport { default as i18next, type TFunction, type TOptions } from 'i18next';\nexport * from './lib/InternationalizationHandler';\nexport * from './lib/functions';\nexport * from './lib/types';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ti18n: InternationalizationHandler;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions extends InternationalizationClientOptions {}\n}\n\n/**\n * The [@sapphire/plugin-i18next](https://github.com/sapphiredev/plugins/blob/main/packages/i18next) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0-pr-513.f0e9a18.0';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["default"],"mappings":";AAGA,SAAoB,WAAXA,gBAAyD;AAClE,cAAc;AACd,cAAc;AACd,cAAc;AAmBP,IAAM,UAAkB","sourcesContent":["import type { InternationalizationHandler } from './lib/InternationalizationHandler';\nimport type { InternationalizationClientOptions } from './lib/types';\n\nexport { default as i18next, type TFunction, type TOptions } from 'i18next';\nexport * from './lib/InternationalizationHandler';\nexport * from './lib/functions';\nexport * from './lib/types';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ti18n: InternationalizationHandler;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions extends InternationalizationClientOptions {}\n}\n\n/**\n * The [@sapphire/plugin-i18next](https://github.com/sapphiredev/plugins/blob/main/packages/i18next) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0';\n"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index_cjs = require('./index.cjs');
4
3
  var framework = require('@sapphire/framework');
5
4
  var chokidar = require('chokidar');
5
+ var index_cjs = require('./index.cjs');
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;AAAA,OAAO;AAEP,SAAS,QAAQ,gBAAgB,WAAW,WAAW,2BAA2B,gBAAgB;AAClG,SAAS,aAAa;AAEtB,SAAS,mCAAmC;AAErC,IAAM,iBAAN,MAAM,uBAAsB,OAAO;AAAA,EACzC,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,OAAO,IAAI,4BAA4B,QAAQ,IAAI;AAAA,EAC9D;AAAA,EAEA,cAAqB,QAAQ,IAAuC;AACnE,UAAM,UAAU,KAAK,KAAK;AAAA,EAC3B;AAAA,EAEA,QAAe,SAAS,IAA8B;AACrD,QAAI,KAAK,QAAQ,MAAM,KAAK,SAAS;AACpC,gBAAU,OAAO,KAAK,gEAAgE;AACtF,YAAM,MAAM,MAAM,UAAU,KAAK,oBAAoB,KAAK,QAAQ,KAAK,IAAI,OAAO;AAElF,iBAAW,SAAS,CAAC,UAAU,QAAQ;AAAG,YAAI,GAAG,OAAO,MAAM,UAAU,KAAK,gBAAgB,CAAC;AAAA,IAC/F;AAAA,EACD;AACD;AAjB0C;AAAnC,IAAM,gBAAN;AAmBP,eAAe,QAAQ,+BAA+B,cAAc,yBAAyB,GAAG,mCAAmC;AACnI,eAAe,QAAQ,qBAAqB,cAAc,QAAQ,GAAG,kBAAkB;AACvF,eAAe,QAAQ,sBAAsB,cAAc,SAAS,GAAG,mBAAmB","sourcesContent":["import './index';\n\nimport { Plugin, SapphireClient, container, postLogin, preGenericsInitialization, preLogin } from '@sapphire/framework';\nimport { watch } from 'chokidar';\nimport type { ClientOptions } from 'discord.js';\nimport { InternationalizationHandler } from './index';\n\nexport class I18nextPlugin extends Plugin {\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.i18n = new InternationalizationHandler(options.i18n);\n\t}\n\n\tpublic static async [preLogin](this: SapphireClient): Promise<void> {\n\t\tawait container.i18n.init();\n\t}\n\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tif (this.options.i18n?.hmr?.enabled) {\n\t\t\tcontainer.logger.info('[i18next-Plugin]: HMR enabled. Watching for languages changes.');\n\t\t\tconst hmr = watch(container.i18n.languagesDirectory, this.options.i18n.hmr.options);\n\n\t\t\tfor (const event of ['change', 'unlink']) hmr.on(event, () => container.i18n.reloadResources());\n\t\t}\n\t}\n}\n\nSapphireClient.plugins.registerPostInitializationHook(I18nextPlugin[preGenericsInitialization], 'I18next-PreGenericsInitialization');\nSapphireClient.plugins.registerPreLoginHook(I18nextPlugin[preLogin], 'I18next-PreLogin');\nSapphireClient.plugins.registerPostLoginHook(I18nextPlugin[postLogin], 'I18next-PostLogin');\n"]}
1
+ {"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;AAAA,SAAS,QAAQ,gBAAgB,WAAW,WAAW,2BAA2B,gBAAgB;AAClG,SAAS,aAAa;AAEtB,SAAS,mCAAmC;AAErC,IAAM,iBAAN,MAAM,uBAAsB,OAAO;AAAA,EACzC,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,OAAO,IAAI,4BAA4B,QAAQ,IAAI;AAAA,EAC9D;AAAA,EAEA,cAAqB,QAAQ,IAAuC;AACnE,UAAM,UAAU,KAAK,KAAK;AAAA,EAC3B;AAAA,EAEA,QAAe,SAAS,IAA8B;AACrD,QAAI,KAAK,QAAQ,MAAM,KAAK,SAAS;AACpC,gBAAU,OAAO,KAAK,gEAAgE;AACtF,YAAM,MAAM,MAAM,UAAU,KAAK,oBAAoB,KAAK,QAAQ,KAAK,IAAI,OAAO;AAElF,iBAAW,SAAS,CAAC,UAAU,QAAQ;AAAG,YAAI,GAAG,OAAO,MAAM,UAAU,KAAK,gBAAgB,CAAC;AAAA,IAC/F;AAAA,EACD;AACD;AAjB0C;AAAnC,IAAM,gBAAN;AAmBP,eAAe,QAAQ,+BAA+B,cAAc,yBAAyB,GAAG,mCAAmC;AACnI,eAAe,QAAQ,qBAAqB,cAAc,QAAQ,GAAG,kBAAkB;AACvF,eAAe,QAAQ,sBAAsB,cAAc,SAAS,GAAG,mBAAmB","sourcesContent":["import { Plugin, SapphireClient, container, postLogin, preGenericsInitialization, preLogin } from '@sapphire/framework';\nimport { watch } from 'chokidar';\nimport type { ClientOptions } from 'discord.js';\nimport { InternationalizationHandler } from './index';\n\nexport class I18nextPlugin extends Plugin {\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.i18n = new InternationalizationHandler(options.i18n);\n\t}\n\n\tpublic static async [preLogin](this: SapphireClient): Promise<void> {\n\t\tawait container.i18n.init();\n\t}\n\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tif (this.options.i18n?.hmr?.enabled) {\n\t\t\tcontainer.logger.info('[i18next-Plugin]: HMR enabled. Watching for languages changes.');\n\t\t\tconst hmr = watch(container.i18n.languagesDirectory, this.options.i18n.hmr.options);\n\n\t\t\tfor (const event of ['change', 'unlink']) hmr.on(event, () => container.i18n.reloadResources());\n\t\t}\n\t}\n}\n\nSapphireClient.plugins.registerPostInitializationHook(I18nextPlugin[preGenericsInitialization], 'I18next-PreGenericsInitialization');\nSapphireClient.plugins.registerPreLoginHook(I18nextPlugin[preLogin], 'I18next-PreLogin');\nSapphireClient.plugins.registerPostLoginHook(I18nextPlugin[postLogin], 'I18next-PostLogin');\n"]}
@@ -1,4 +1,3 @@
1
- import './index.cjs';
2
1
  import { Plugin, preGenericsInitialization, SapphireClient, preLogin, postLogin } from '@sapphire/framework';
3
2
  import { ClientOptions } from 'discord.js';
4
3
 
@@ -4,7 +4,7 @@ export * from './lib/InternationalizationHandler.mjs';
4
4
  export * from './lib/functions.mjs';
5
5
  export * from './lib/types.mjs';
6
6
 
7
- var version = "7.0.0-pr-513.f0e9a18.0";
7
+ var version = "7.0.0";
8
8
 
9
9
  export { version };
10
10
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["default"],"mappings":";;;AAGA,SAAoB,WAAXA,gBAAyD;AAClE,cAAc;AACd,cAAc;AACd,cAAc;AAmBP,IAAM,UAAkB","sourcesContent":["import type { InternationalizationHandler } from './lib/InternationalizationHandler';\nimport type { InternationalizationClientOptions } from './lib/types';\n\nexport { default as i18next, type TFunction, type TOptions } from 'i18next';\nexport * from './lib/InternationalizationHandler';\nexport * from './lib/functions';\nexport * from './lib/types';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ti18n: InternationalizationHandler;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions extends InternationalizationClientOptions {}\n}\n\n/**\n * The [@sapphire/plugin-i18next](https://github.com/sapphiredev/plugins/blob/main/packages/i18next) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0-pr-513.f0e9a18.0';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["default"],"mappings":";;;AAGA,SAAoB,WAAXA,gBAAyD;AAClE,cAAc;AACd,cAAc;AACd,cAAc;AAmBP,IAAM,UAAkB","sourcesContent":["import type { InternationalizationHandler } from './lib/InternationalizationHandler';\nimport type { InternationalizationClientOptions } from './lib/types';\n\nexport { default as i18next, type TFunction, type TOptions } from 'i18next';\nexport * from './lib/InternationalizationHandler';\nexport * from './lib/functions';\nexport * from './lib/types';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ti18n: InternationalizationHandler;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions extends InternationalizationClientOptions {}\n}\n\n/**\n * The [@sapphire/plugin-i18next](https://github.com/sapphiredev/plugins/blob/main/packages/i18next) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0';\n"]}
@@ -1,4 +1,3 @@
1
- import './index.mjs';
2
1
  import { Plugin, preGenericsInitialization, SapphireClient, preLogin, postLogin } from '@sapphire/framework';
3
2
  import { ClientOptions } from 'discord.js';
4
3
 
@@ -1,7 +1,7 @@
1
1
  import { __name } from './chunk-6QB3UK4Q.mjs';
2
- import { InternationalizationHandler } from './index.mjs';
3
2
  import { SapphireClient, preGenericsInitialization, preLogin, postLogin, Plugin, container } from '@sapphire/framework';
4
3
  import { watch } from 'chokidar';
4
+ import { InternationalizationHandler } from './index.mjs';
5
5
 
6
6
  var _I18nextPlugin = class _I18nextPlugin extends Plugin {
7
7
  static [preGenericsInitialization](options) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;AAAA,OAAO;AAEP,SAAS,QAAQ,gBAAgB,WAAW,WAAW,2BAA2B,gBAAgB;AAClG,SAAS,aAAa;AAEtB,SAAS,mCAAmC;AAErC,IAAM,iBAAN,MAAM,uBAAsB,OAAO;AAAA,EACzC,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,OAAO,IAAI,4BAA4B,QAAQ,IAAI;AAAA,EAC9D;AAAA,EAEA,cAAqB,QAAQ,IAAuC;AACnE,UAAM,UAAU,KAAK,KAAK;AAAA,EAC3B;AAAA,EAEA,QAAe,SAAS,IAA8B;AACrD,QAAI,KAAK,QAAQ,MAAM,KAAK,SAAS;AACpC,gBAAU,OAAO,KAAK,gEAAgE;AACtF,YAAM,MAAM,MAAM,UAAU,KAAK,oBAAoB,KAAK,QAAQ,KAAK,IAAI,OAAO;AAElF,iBAAW,SAAS,CAAC,UAAU,QAAQ;AAAG,YAAI,GAAG,OAAO,MAAM,UAAU,KAAK,gBAAgB,CAAC;AAAA,IAC/F;AAAA,EACD;AACD;AAjB0C;AAAnC,IAAM,gBAAN;AAmBP,eAAe,QAAQ,+BAA+B,cAAc,yBAAyB,GAAG,mCAAmC;AACnI,eAAe,QAAQ,qBAAqB,cAAc,QAAQ,GAAG,kBAAkB;AACvF,eAAe,QAAQ,sBAAsB,cAAc,SAAS,GAAG,mBAAmB","sourcesContent":["import './index';\n\nimport { Plugin, SapphireClient, container, postLogin, preGenericsInitialization, preLogin } from '@sapphire/framework';\nimport { watch } from 'chokidar';\nimport type { ClientOptions } from 'discord.js';\nimport { InternationalizationHandler } from './index';\n\nexport class I18nextPlugin extends Plugin {\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.i18n = new InternationalizationHandler(options.i18n);\n\t}\n\n\tpublic static async [preLogin](this: SapphireClient): Promise<void> {\n\t\tawait container.i18n.init();\n\t}\n\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tif (this.options.i18n?.hmr?.enabled) {\n\t\t\tcontainer.logger.info('[i18next-Plugin]: HMR enabled. Watching for languages changes.');\n\t\t\tconst hmr = watch(container.i18n.languagesDirectory, this.options.i18n.hmr.options);\n\n\t\t\tfor (const event of ['change', 'unlink']) hmr.on(event, () => container.i18n.reloadResources());\n\t\t}\n\t}\n}\n\nSapphireClient.plugins.registerPostInitializationHook(I18nextPlugin[preGenericsInitialization], 'I18next-PreGenericsInitialization');\nSapphireClient.plugins.registerPreLoginHook(I18nextPlugin[preLogin], 'I18next-PreLogin');\nSapphireClient.plugins.registerPostLoginHook(I18nextPlugin[postLogin], 'I18next-PostLogin');\n"]}
1
+ {"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;AAAA,SAAS,QAAQ,gBAAgB,WAAW,WAAW,2BAA2B,gBAAgB;AAClG,SAAS,aAAa;AAEtB,SAAS,mCAAmC;AAErC,IAAM,iBAAN,MAAM,uBAAsB,OAAO;AAAA,EACzC,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,OAAO,IAAI,4BAA4B,QAAQ,IAAI;AAAA,EAC9D;AAAA,EAEA,cAAqB,QAAQ,IAAuC;AACnE,UAAM,UAAU,KAAK,KAAK;AAAA,EAC3B;AAAA,EAEA,QAAe,SAAS,IAA8B;AACrD,QAAI,KAAK,QAAQ,MAAM,KAAK,SAAS;AACpC,gBAAU,OAAO,KAAK,gEAAgE;AACtF,YAAM,MAAM,MAAM,UAAU,KAAK,oBAAoB,KAAK,QAAQ,KAAK,IAAI,OAAO;AAElF,iBAAW,SAAS,CAAC,UAAU,QAAQ;AAAG,YAAI,GAAG,OAAO,MAAM,UAAU,KAAK,gBAAgB,CAAC;AAAA,IAC/F;AAAA,EACD;AACD;AAjB0C;AAAnC,IAAM,gBAAN;AAmBP,eAAe,QAAQ,+BAA+B,cAAc,yBAAyB,GAAG,mCAAmC;AACnI,eAAe,QAAQ,qBAAqB,cAAc,QAAQ,GAAG,kBAAkB;AACvF,eAAe,QAAQ,sBAAsB,cAAc,SAAS,GAAG,mBAAmB","sourcesContent":["import { Plugin, SapphireClient, container, postLogin, preGenericsInitialization, preLogin } from '@sapphire/framework';\nimport { watch } from 'chokidar';\nimport type { ClientOptions } from 'discord.js';\nimport { InternationalizationHandler } from './index';\n\nexport class I18nextPlugin extends Plugin {\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.i18n = new InternationalizationHandler(options.i18n);\n\t}\n\n\tpublic static async [preLogin](this: SapphireClient): Promise<void> {\n\t\tawait container.i18n.init();\n\t}\n\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tif (this.options.i18n?.hmr?.enabled) {\n\t\t\tcontainer.logger.info('[i18next-Plugin]: HMR enabled. Watching for languages changes.');\n\t\t\tconst hmr = watch(container.i18n.languagesDirectory, this.options.i18n.hmr.options);\n\n\t\t\tfor (const event of ['change', 'unlink']) hmr.on(event, () => container.i18n.reloadResources());\n\t\t}\n\t}\n}\n\nSapphireClient.plugins.registerPostInitializationHook(I18nextPlugin[preGenericsInitialization], 'I18next-PreGenericsInitialization');\nSapphireClient.plugins.registerPreLoginHook(I18nextPlugin[preLogin], 'I18next-PreLogin');\nSapphireClient.plugins.registerPostLoginHook(I18nextPlugin[postLogin], 'I18next-PostLogin');\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/plugin-i18next",
3
- "version": "7.0.0-pr-513.f0e9a18.0",
3
+ "version": "7.0.0",
4
4
  "description": "Plugin for @sapphire/framework to support i18next.",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",
@@ -60,8 +60,7 @@
60
60
  "directory": "packages/i18next"
61
61
  },
62
62
  "files": [
63
- "dist/",
64
- "!dist/.tsbuildinfo"
63
+ "dist/"
65
64
  ],
66
65
  "engines": {
67
66
  "node": ">=v18",
@@ -87,7 +86,7 @@
87
86
  },
88
87
  "devDependencies": {
89
88
  "@favware/cliff-jumper": "^2.2.3",
90
- "@favware/rollup-type-bundler": "^3.2.0",
89
+ "@favware/rollup-type-bundler": "^3.2.1",
91
90
  "concurrently": "^8.2.2",
92
91
  "tsup": "^8.0.1",
93
92
  "tsx": "^4.6.2",