@rdyl/react-i18n-connect 0.0.7 → 0.0.8

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
@@ -1,4 +1,4 @@
1
- ## 0.0.6 (2025-06-09)
1
+ ## 0.0.8 (2025-06-09)
2
2
 
3
3
 
4
4
 
package/dist/index.js CHANGED
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.useI18n = void 0;
40
37
  var react_1 = __importStar(require("react"));
@@ -95,5 +92,4 @@ var I18nConnect = function (_a) {
95
92
  };
96
93
  var useI18n = function () { return (0, react_1.useContext)(I18nCtx); };
97
94
  exports.useI18n = useI18n;
98
- __exportStar(require("./utils"), exports);
99
95
  exports.default = I18nConnect;
package/dist/utils.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParserI18nFn = ParserI18nFn;
4
- exports.viteLoadI18nLocales = viteLoadI18nLocales;
5
4
  function ParserI18nFn(data) {
6
5
  return function (k, named) {
7
6
  var text = data[k];
@@ -17,19 +16,3 @@ function ParserI18nFn(data) {
17
16
  return text;
18
17
  };
19
18
  }
20
- /**
21
- * @description 使用vite时可用
22
- */
23
- function viteLoadI18nLocales(path) {
24
- // @ts-ignore
25
- var modules = import.meta.glob("".concat(path, "/**/*.json"), { eager: true });
26
- var result = {};
27
- Object.entries(modules).forEach(function (_a) {
28
- var path = _a[0], module = _a[1];
29
- // 将文件路径转换为嵌套结构
30
- var parts = path.replace("".concat(path, "/"), "").split("/");
31
- var name = parts.map(function (e) { return e.replace(".json", ""); }).join("-");
32
- result[name] = module.default;
33
- });
34
- return result;
35
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdyl/react-i18n-connect",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -14,5 +14,4 @@ type I18nConnectProps = Partial<I18nConfig> & {
14
14
  onBeforeChange?(t: string): unknown;
15
15
  };
16
16
  export declare const useI18n: () => I18nConnectValue;
17
- export * from "./utils";
18
17
  export default I18nConnect;
package/types/utils.d.ts CHANGED
@@ -1,5 +1 @@
1
1
  export declare function ParserI18nFn(data: Record<string, TRValue>): (k: string, named?: Record<string, unknown>) => string;
2
- /**
3
- * @description 使用vite时可用
4
- */
5
- export declare function viteLoadI18nLocales(path: string): Record<string, Record<string, TRValue>>;
package/dist/resolve.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var fs_1 = __importDefault(require("fs"));
7
- function loadFiles() {
8
- console.log(fs_1.default);
9
- }
10
- exports.default = loadFiles;