@korioinc/next-core 1.0.7 → 1.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.
@@ -5,11 +5,11 @@ type SupportedLocales = string;
5
5
  type AllMessagesType = {
6
6
  [key: string]: Messages;
7
7
  };
8
- export declare const allMessages: AllMessagesType;
8
+ declare const allMessages: AllMessagesType;
9
+ export { allMessages };
9
10
  type AllI18nInstances = {
10
11
  [K in SupportedLocales]: I18n;
11
12
  };
12
13
  export declare const allI18nInstances: AllI18nInstances;
13
14
  export declare const getI18nInstance: (locale: SupportedLocales) => I18n;
14
- export {};
15
15
  //# sourceMappingURL=lingui.setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lingui.setup.d.ts","sourceRoot":"","sources":["../../src/i18n/lingui.setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAG/C,OAAO,aAAa,CAAC;AAIrB,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAe/B,KAAK,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAGnD,eAAO,MAAM,WAAW,EAAE,eAKzB,CAAC;AAEF,KAAK,gBAAgB,GAAG;KAAG,CAAC,IAAI,gBAAgB,GAAG,IAAI;CAAE,CAAC;AAE1D,eAAO,MAAM,gBAAgB,EAAE,gBAQL,CAAC;AAE3B,eAAO,MAAM,eAAe,GAAI,QAAQ,gBAAgB,KAAG,IAM1D,CAAC"}
1
+ {"version":3,"file":"lingui.setup.d.ts","sourceRoot":"","sources":["../../src/i18n/lingui.setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAK/C,OAAO,aAAa,CAAC;AAIrB,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAG/B,KAAK,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAWnD,QAAA,MAAM,WAAW,EAAE,eAAgE,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,KAAK,gBAAgB,GAAG;KAAG,CAAC,IAAI,gBAAgB,GAAG,IAAI;CAAE,CAAC;AAE1D,eAAO,MAAM,gBAAgB,EAAE,gBAQL,CAAC;AAE3B,eAAO,MAAM,eAAe,GAAI,QAAQ,gBAAgB,KAAG,IAM1D,CAAC"}
@@ -1,18 +1,16 @@
1
1
  import { setupI18n } from '@lingui/core';
2
2
  import linguiConfig from 'lingui.config';
3
+ import * as appLoader from 'lingui.loader';
3
4
  import 'server-only';
4
5
  const { locales } = linguiConfig;
5
- async function loadCatalog(locale) {
6
- const { messages } = await import(`lang/${locale}.po`);
7
- return {
8
- [locale]: messages,
9
- };
10
- }
11
- const catalogs = await Promise.all(locales.map(loadCatalog));
12
- // transform array of catalogs into a single object
13
- export const allMessages = catalogs.reduce((acc, oneCatalog) => {
14
- return { ...acc, ...oneCatalog };
15
- }, {});
6
+ // Load catalogs via app-provided loader
7
+ const loader = appLoader;
8
+ const entries = await Promise.all(locales.map(async (l) => {
9
+ const messages = await loader.load(l);
10
+ return [l, messages];
11
+ }));
12
+ const allMessages = Object.fromEntries(entries);
13
+ export { allMessages };
16
14
  export const allI18nInstances = locales.reduce((acc, locale) => {
17
15
  const messages = allMessages[locale] ?? {};
18
16
  const i18n = setupI18n({
@@ -0,0 +1,5 @@
1
+ import type { Messages } from '@lingui/core';
2
+ export interface CatalogLoader {
3
+ load(locale: string): Promise<Messages>;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACzC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ declare module 'lingui.loader' {
2
+ import type { Messages } from '@lingui/core';
3
+ export function load(locale: string): Promise<Messages>;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korioinc/next-core",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./ads": {
@@ -62,27 +62,26 @@
62
62
  "LICENSE"
63
63
  ],
64
64
  "devDependencies": {
65
- "@headlessui/react": "^2.2.7",
66
- "@lingui/conf": "^5.5.0",
67
- "@lingui/core": "^5.5.0",
68
- "@lingui/react": "^5.5.0",
65
+ "@headlessui/react": "^2.2.8",
66
+ "@lingui/conf": "5.5.0",
67
+ "@lingui/core": "5.5.0",
68
+ "@lingui/react": "5.5.0",
69
69
  "@tailwindcss/typography": "^0.5.16",
70
70
  "@types/negotiator": "^0.6.4",
71
- "@types/node": "^22.18.1",
71
+ "@types/node": "^22.18.3",
72
72
  "@types/react": "^19.1.12",
73
73
  "@types/react-dom": "^19.1.9",
74
74
  "eslint": "^9.35.0",
75
75
  "next-themes": "^0.4.6",
76
+ "react": "19.1.1",
77
+ "react-dom": "19.1.1",
76
78
  "tailwindcss": "^4.1.13",
77
79
  "tsc-alias": "^1.8.16",
78
80
  "tw-animate-css": "^1.3.8",
79
81
  "typescript": "^5.9.2",
80
- "react": "^19.1.0",
81
- "react-dom": "^19.1.0",
82
82
  "@korioinc/next-configs": "1.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "schema-dts": "^1.1.5",
86
85
  "@floating-ui/react": "^0.27.16",
87
86
  "@formatjs/intl-localematcher": "^0.6.1",
88
87
  "clsx": "^2.1.1",
@@ -92,9 +91,10 @@
92
91
  "localforage": "^1.10.0",
93
92
  "negotiator": "^1.0.0",
94
93
  "pretendard": "^1.3.9",
94
+ "schema-dts": "^1.1.5",
95
95
  "tailwind-merge": "^3.3.1",
96
- "valtio": "^2.0.0",
97
- "@korioinc/next-conf": "1.0.5"
96
+ "valtio": "^2.1.7",
97
+ "@korioinc/next-conf": "1.0.6"
98
98
  },
99
99
  "publishConfig": {
100
100
  "access": "public",
@@ -107,14 +107,14 @@
107
107
  },
108
108
  "author": "Korio Inc.",
109
109
  "peerDependencies": {
110
+ "@headlessui/react": ">=2.2.0",
110
111
  "@lingui/core": ">=5.0.0",
111
112
  "@lingui/react": ">=5.0.0",
112
- "@headlessui/react": ">=2.2.0",
113
113
  "next": ">=15",
114
114
  "next-themes": ">=0.4.5",
115
- "tailwindcss": ">=4.0.0",
116
115
  "react": ">=19",
117
- "react-dom": ">=19"
116
+ "react-dom": ">=19",
117
+ "tailwindcss": ">=4.0.0"
118
118
  },
119
119
  "scripts": {
120
120
  "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && cp -r src/styles dist/ && cp -r src/types dist/",