intor 2.5.1 → 2.6.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/core/export/index.js +1 -0
- package/dist/core/src/server/messages/load-local-messages/read-locale-messages/collect-file-entries/collect-file-entries.js +1 -1
- package/dist/next/export/next/server/index.js +1 -0
- package/dist/next/src/adapters/next/create-intor-handler.js +17 -8
- package/dist/next/src/{core/constants/headers.js → adapters/next/header-keys.js} +3 -2
- package/dist/next/src/adapters/next/server/get-locale.js +3 -3
- package/dist/next/src/adapters/next/server/read-intor-url-state.js +13 -0
- package/dist/types/export/index.d.ts +1 -1
- package/dist/types/export/index.d.ts.map +1 -1
- package/dist/types/export/next/server/index.d.ts +1 -1
- package/dist/types/export/next/server/index.d.ts.map +1 -1
- package/dist/types/src/adapters/fastify/intor-fastify-plugin.d.ts.map +1 -1
- package/dist/types/src/adapters/next/create-intor-handler.d.ts.map +1 -1
- package/dist/types/src/{core/constants/headers.d.ts → adapters/next/header-keys.d.ts} +3 -2
- package/dist/types/src/adapters/next/header-keys.d.ts.map +1 -0
- package/dist/types/src/adapters/next/server/get-locale.d.ts.map +1 -1
- package/dist/types/src/adapters/next/server/index.d.ts +1 -0
- package/dist/types/src/adapters/next/server/index.d.ts.map +1 -1
- package/dist/types/src/adapters/next/server/read-intor-url-state.d.ts +13 -0
- package/dist/types/src/adapters/next/server/read-intor-url-state.d.ts.map +1 -0
- package/dist/types/src/core/constants/index.d.ts +0 -1
- package/dist/types/src/core/constants/index.d.ts.map +1 -1
- package/dist/types/src/core/constants/locale-placeholder.d.ts +5 -0
- package/dist/types/src/core/constants/locale-placeholder.d.ts.map +1 -1
- package/dist/types/src/core/index.d.ts +1 -1
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/edge/translator/init-translator.d.ts.map +1 -1
- package/dist/types/src/server/translator/init-translator.d.ts.map +1 -1
- package/package.json +53 -65
- package/dist/types/src/core/constants/headers.d.ts.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ The i18n library for modern JavaScript
|
|
|
16
16
|
|
|
17
17
|
<div align="center">
|
|
18
18
|
|
|
19
|
-
#### [](https://intor
|
|
19
|
+
#### [](https://intor.dev)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
|
@@ -17,7 +17,7 @@ async function collectFileEntries({
|
|
|
17
17
|
const supportedExts = /* @__PURE__ */ new Set(["json", ...exts]);
|
|
18
18
|
const fileEntries = [];
|
|
19
19
|
const walk = async (currentDir) => {
|
|
20
|
-
let entries
|
|
20
|
+
let entries;
|
|
21
21
|
try {
|
|
22
22
|
entries = await readdir(currentDir, { withFileTypes: true });
|
|
23
23
|
} catch {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { intor } from '../../../src/adapters/next/server/intor.js';
|
|
2
2
|
export { getLocale } from '../../../src/adapters/next/server/get-locale.js';
|
|
3
3
|
export { getTranslator } from '../../../src/adapters/next/server/get-translator.js';
|
|
4
|
+
export { readIntorUrlState } from '../../../src/adapters/next/server/read-intor-url-state.js';
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
|
-
import { INTOR_HEADERS } from '../../core/constants/headers.js';
|
|
3
2
|
import { normalizeQuery } from '../../core/utils/normalizers/normalize-query.js';
|
|
4
3
|
import 'logry';
|
|
5
4
|
import 'p-limit';
|
|
6
5
|
import 'intor-translator';
|
|
7
6
|
import { resolveInbound } from '../../routing/inbound/resolve-inbound.js';
|
|
8
7
|
import { getLocaleFromAcceptLanguage } from '../../routing/locale/get-locale-from-accept-language.js';
|
|
8
|
+
import { INTOR_HEADER_KEYS } from './header-keys.js';
|
|
9
9
|
|
|
10
10
|
function createIntorHandler(config) {
|
|
11
11
|
return function intorHandler(request) {
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
host,
|
|
14
|
+
searchParams,
|
|
15
|
+
pathname: rawPathname,
|
|
16
|
+
search
|
|
17
|
+
} = request.nextUrl;
|
|
13
18
|
const acceptLanguageHeader = request.headers.get("accept-language");
|
|
14
19
|
const localeFromAcceptLanguage = getLocaleFromAcceptLanguage(
|
|
15
20
|
acceptLanguageHeader,
|
|
16
21
|
config.supportedLocales
|
|
17
22
|
);
|
|
18
|
-
const hasRedirected = request.headers.get(
|
|
23
|
+
const hasRedirected = request.headers.get(INTOR_HEADER_KEYS.REDIRECTED) === "1";
|
|
19
24
|
const cookie = request.cookies.get(config.cookie.name)?.value;
|
|
20
25
|
const { locale, localeSource, pathname, shouldRedirect } = resolveInbound(
|
|
21
26
|
config,
|
|
@@ -29,12 +34,16 @@ function createIntorHandler(config) {
|
|
|
29
34
|
{ hasRedirected }
|
|
30
35
|
);
|
|
31
36
|
const url = request.nextUrl.clone();
|
|
32
|
-
|
|
37
|
+
if (shouldRedirect) {
|
|
38
|
+
url.pathname = pathname;
|
|
39
|
+
url.search = search;
|
|
40
|
+
}
|
|
33
41
|
const response = shouldRedirect ? NextResponse.redirect(url) : NextResponse.next();
|
|
34
|
-
response.headers.set(
|
|
35
|
-
response.headers.set(
|
|
36
|
-
response.headers.set(
|
|
37
|
-
|
|
42
|
+
response.headers.set(INTOR_HEADER_KEYS.LOCALE, locale);
|
|
43
|
+
response.headers.set(INTOR_HEADER_KEYS.LOCALE_SOURCE, localeSource);
|
|
44
|
+
response.headers.set(INTOR_HEADER_KEYS.PATHNAME, pathname);
|
|
45
|
+
response.headers.set(INTOR_HEADER_KEYS.SEARCH, search);
|
|
46
|
+
if (shouldRedirect) response.headers.set(INTOR_HEADER_KEYS.REDIRECTED, "1");
|
|
38
47
|
return response;
|
|
39
48
|
};
|
|
40
49
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const INTOR_HEADER_KEYS = {
|
|
2
2
|
LOCALE: "x-intor-locale",
|
|
3
3
|
LOCALE_SOURCE: "x-intor-locale-source",
|
|
4
4
|
PATHNAME: "x-intor-pathname",
|
|
5
|
+
SEARCH: "x-intor-search",
|
|
5
6
|
REDIRECTED: "x-intor-redirected"
|
|
6
7
|
};
|
|
7
8
|
|
|
8
|
-
export {
|
|
9
|
+
export { INTOR_HEADER_KEYS };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { headers, cookies } from 'next/headers';
|
|
2
|
-
import { INTOR_HEADERS } from '../../../core/constants/headers.js';
|
|
3
2
|
import { matchLocale } from '../../../core/locale/match-locale.js';
|
|
4
3
|
import 'logry';
|
|
5
4
|
import 'p-limit';
|
|
6
5
|
import 'intor-translator';
|
|
6
|
+
import { INTOR_HEADER_KEYS } from '../header-keys.js';
|
|
7
7
|
|
|
8
8
|
const getLocale = async (config) => {
|
|
9
|
-
const
|
|
10
|
-
const headerLocale =
|
|
9
|
+
const headersList = await headers();
|
|
10
|
+
const headerLocale = headersList.get(INTOR_HEADER_KEYS.LOCALE);
|
|
11
11
|
if (headerLocale) {
|
|
12
12
|
return headerLocale;
|
|
13
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { headers } from 'next/headers';
|
|
2
|
+
import { INTOR_HEADER_KEYS } from '../header-keys.js';
|
|
3
|
+
|
|
4
|
+
async function readIntorUrlState() {
|
|
5
|
+
const headersList = await headers();
|
|
6
|
+
return {
|
|
7
|
+
locale: headersList.get(INTOR_HEADER_KEYS.LOCALE) ?? null,
|
|
8
|
+
pathname: headersList.get(INTOR_HEADER_KEYS.PATHNAME) ?? "/",
|
|
9
|
+
search: headersList.get(INTOR_HEADER_KEYS.SEARCH) ?? ""
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { readIntorUrlState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./shared-types";
|
|
2
|
-
export { type IntorErrorOptions, IntorError, INTOR_ERROR_CODE, type IntorErrorCode, matchLocale, mergeMessages, type MergeMessagesOptions, type MergeMessagesEvent, } from "../src/core";
|
|
2
|
+
export { type IntorErrorOptions, IntorError, INTOR_ERROR_CODE, type IntorErrorCode, matchLocale, mergeMessages, type MergeMessagesOptions, type MergeMessagesEvent, LOCALE_PLACEHOLDER, } from "../src/core";
|
|
3
3
|
export { defineIntorConfig } from "../src/config";
|
|
4
4
|
export { localizePathname, type LocalizedPathname, type InboundResult, type InboundContext, resolveInboundFromRequest, } from "../src/routing";
|
|
5
5
|
export { getClientLocale } from "../src/client";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../export/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAK/B,OAAO,EAEL,KAAK,iBAAiB,EACtB,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EAGnB,WAAW,EAGX,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../export/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAK/B,OAAO,EAEL,KAAK,iBAAiB,EACtB,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EAGnB,WAAW,EAGX,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAGvB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKlD,OAAO,EAEL,gBAAgB,EAChB,KAAK,iBAAiB,EAGtB,KAAK,aAAa,EAClB,KAAK,cAAc,EAGnB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKhD,YAAY,EACV,UAAU,EAGV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EAGd,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "../../shared-types";
|
|
2
|
-
export { intor, getLocale, getTranslator, } from "../../../src/adapters/next/server";
|
|
2
|
+
export { intor, getLocale, getTranslator, readIntorUrlState, } from "../../../src/adapters/next/server";
|
|
3
3
|
export type { IntorValue, IntorOptions, GetTranslatorParams, } from "../../../src/server";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/next/server/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EACL,KAAK,EACL,SAAS,EACT,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/next/server/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EACL,KAAK,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,UAAU,EACV,YAAY,EACZ,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intor-fastify-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/fastify/intor-fastify-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD;;;;;;;GAOG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"intor-fastify-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/fastify/intor-fastify-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD;;;;;;;GAOG;AACH,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CACrD,mBAAmB,EACnB,QAAQ,GAAG,OAAO,GAAG,iBAAiB,CACvC;IACC,MAAM,EAAE,WAAW,CAAC;IAEpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAoDD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,kDAE7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-intor-handler.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/next/create-intor-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"create-intor-handler.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/next/create-intor-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,IACvB,SAAS,WAAW,2BA6DlD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const INTOR_HEADER_KEYS: {
|
|
2
2
|
readonly LOCALE: "x-intor-locale";
|
|
3
3
|
readonly LOCALE_SOURCE: "x-intor-locale-source";
|
|
4
4
|
readonly PATHNAME: "x-intor-pathname";
|
|
5
|
+
readonly SEARCH: "x-intor-search";
|
|
5
6
|
readonly REDIRECTED: "x-intor-redirected";
|
|
6
7
|
};
|
|
7
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=header-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-keys.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/next/header-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-locale.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/next/server/get-locale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"get-locale.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/next/server/get-locale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK9D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAU,EAAE,SAAS,aAAa,GAAG,aAAa,EACtE,QAAQ,WAAW,KAClB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAmBvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/next/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/next/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the current request's Intor URL state.
|
|
3
|
+
*
|
|
4
|
+
* - Resolves locale, pathname, and search from the execution context.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare function readIntorUrlState(): Promise<{
|
|
9
|
+
locale: string | null;
|
|
10
|
+
pathname: string;
|
|
11
|
+
search: string;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=read-intor-url-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-intor-url-state.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/next/server/read-intor-url-state.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,iBAAiB;;;;GAQtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-placeholder.d.ts","sourceRoot":"","sources":["../../../../../src/core/constants/locale-placeholder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale-placeholder.d.ts","sourceRoot":"","sources":["../../../../../src/core/constants/locale-placeholder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { LOCALE_PLACEHOLDER
|
|
1
|
+
export { LOCALE_PLACEHOLDER } from "./constants";
|
|
2
2
|
export { type IntorErrorOptions, IntorError, INTOR_ERROR_CODE, type IntorErrorCode, } from "./error";
|
|
3
3
|
export { deepMerge, resolveLoaderOptions, parseCookieHeader, normalizePathname, normalizeCacheKey, normalizeQuery, type NormalizedQuery, } from "./utils";
|
|
4
4
|
export { matchLocale } from "./locale";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKjD,OAAO,EACL,KAAK,iBAAiB,EACtB,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AAKjB,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EAGjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKtD,OAAO,EAEL,kBAAkB,EAGlB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAGvB,eAAe,EACf,kBAAkB,EAGlB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EAGnB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,WAAW,GACZ,MAAM,cAAc,CAAC;AAKtB,YAAY,EAEV,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,EAGN,SAAS,EACT,WAAW,EACX,cAAc,EAGd,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EAGP,cAAc,EAGd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAGhB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-translator.d.ts","sourceRoot":"","sources":["../../../../../src/edge/translator/init-translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAEpB,UAAU,
|
|
1
|
+
{"version":3,"file":"init-translator.d.ts","sourceRoot":"","sources":["../../../../../src/edge/translator/init-translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAEpB,UAAU,qBAAsB,SAAQ,IAAI,CAC1C,sBAAsB,EACtB,QAAQ,GAAG,QAAQ,GAAG,UAAU,CACjC;IACC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CA6BrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-translator.d.ts","sourceRoot":"","sources":["../../../../../src/server/translator/init-translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,qBACf,
|
|
1
|
+
{"version":3,"file":"init-translator.d.ts","sourceRoot":"","sources":["../../../../../src/server/translator/init-translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,qBACf,SACE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,QAAQ,CAAC,EAC7C,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IAChE,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAmCrC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "The i18n library for modern JavaScript",
|
|
5
|
-
"author":
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Yiming Liao",
|
|
7
|
+
"email": "yimingliao.official@gmail.com",
|
|
8
|
+
"url": "https://github.com/yiming-liao"
|
|
9
|
+
},
|
|
6
10
|
"homepage": "https://intor.dev",
|
|
7
11
|
"repository": {
|
|
8
12
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/yiming-liao/intor"
|
|
13
|
+
"url": "https://github.com/yiming-liao/intor",
|
|
14
|
+
"directory": "packages/intor"
|
|
10
15
|
},
|
|
11
16
|
"bugs": {
|
|
12
17
|
"url": "https://github.com/yiming-liao/intor/issues"
|
|
@@ -101,76 +106,59 @@
|
|
|
101
106
|
],
|
|
102
107
|
"sideEffects": false,
|
|
103
108
|
"engines": {
|
|
104
|
-
"node": ">=20"
|
|
109
|
+
"node": ">=20.0.0"
|
|
110
|
+
},
|
|
111
|
+
"dependencies": {
|
|
112
|
+
"logry": "2.1.6",
|
|
113
|
+
"p-limit": "7.2.0",
|
|
114
|
+
"intor-translator": "1.5.0"
|
|
115
|
+
},
|
|
116
|
+
"peerDependencies": {
|
|
117
|
+
"react": "^19",
|
|
118
|
+
"vue": "^3",
|
|
119
|
+
"svelte": "^5",
|
|
120
|
+
"next": "^16",
|
|
121
|
+
"@sveltejs/kit": "^2",
|
|
122
|
+
"hono": "^4",
|
|
123
|
+
"fastify": "^5",
|
|
124
|
+
"fastify-plugin": "^5"
|
|
125
|
+
},
|
|
126
|
+
"peerDependenciesMeta": {
|
|
127
|
+
"react": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"vue": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"svelte": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"next": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"@sveltejs/kit": {
|
|
140
|
+
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"hono": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"fastify": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"fastify-plugin": {
|
|
149
|
+
"optional": true
|
|
150
|
+
}
|
|
105
151
|
},
|
|
106
152
|
"scripts": {
|
|
107
153
|
"type": "tsc -p tsconfig.json --noEmit",
|
|
108
|
-
"lint": "eslint",
|
|
109
154
|
"test": "vitest",
|
|
110
155
|
"test:types": "tsx scripts/test-types.ts",
|
|
111
156
|
"test:check": "tsx scripts/check-test-structure.ts",
|
|
112
|
-
"knip": "knip --config .config/knip.config.ts",
|
|
113
157
|
"clean": "rm -rf dist",
|
|
114
158
|
"build": "tsx scripts/build.ts",
|
|
115
159
|
"build:types": "tsc -p tsconfig.build.json && tsc-alias tsconfig.build.json --outDir dist/types",
|
|
116
|
-
"build:release": "
|
|
160
|
+
"build:release": "pnpm clean && pnpm build && pnpm build:types && pnpm api:build",
|
|
117
161
|
"api:build": "tsx scripts/api-extractor/build.ts",
|
|
118
|
-
"api:check": "tsx scripts/api-extractor/check.ts"
|
|
119
|
-
"prepublishOnly": "yarn build:release"
|
|
120
|
-
},
|
|
121
|
-
"dependencies": {
|
|
122
|
-
"intor-translator": "^1.5.0",
|
|
123
|
-
"logry": "2.1.6",
|
|
124
|
-
"p-limit": "7.2.0"
|
|
125
|
-
},
|
|
126
|
-
"devDependencies": {
|
|
127
|
-
"@microsoft/api-extractor": "^7.57.6",
|
|
128
|
-
"@rollup/plugin-alias": "6.0.0",
|
|
129
|
-
"@rollup/pluginutils": "5.3.0",
|
|
130
|
-
"@sveltejs/kit": "2.50.1",
|
|
131
|
-
"@testing-library/dom": "10.4.1",
|
|
132
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
133
|
-
"@testing-library/react": "16.3.1",
|
|
134
|
-
"@types/express": "5.0.6",
|
|
135
|
-
"@types/node": "24.10.1",
|
|
136
|
-
"@types/react": "19.0.0",
|
|
137
|
-
"@types/react-dom": "19.0.0",
|
|
138
|
-
"@vitejs/plugin-react": "5.1.2",
|
|
139
|
-
"@vitest/coverage-v8": "4.0.16",
|
|
140
|
-
"@vue/test-utils": "^2.4.6",
|
|
141
|
-
"eslint": "9.39.2",
|
|
142
|
-
"eslint-config-prettier": "10.1.8",
|
|
143
|
-
"eslint-import-resolver-typescript": "4.4.4",
|
|
144
|
-
"eslint-plugin-import": "2.31.0",
|
|
145
|
-
"eslint-plugin-prettier": "5.5.4",
|
|
146
|
-
"eslint-plugin-react": "7.37.5",
|
|
147
|
-
"eslint-plugin-react-hooks": "7.0.1",
|
|
148
|
-
"eslint-plugin-unicorn": "62.0.0",
|
|
149
|
-
"eslint-plugin-unused-imports": "4.1.4",
|
|
150
|
-
"fastify": "^5.7.4",
|
|
151
|
-
"fastify-plugin": "^5.1.0",
|
|
152
|
-
"hono": "^4.11.8",
|
|
153
|
-
"jsdom": "27.3.0",
|
|
154
|
-
"knip": "5.69.1",
|
|
155
|
-
"magic-string": "0.30.21",
|
|
156
|
-
"next": "16.0.3",
|
|
157
|
-
"prettier": "3.6.2",
|
|
158
|
-
"react": "19.0.0",
|
|
159
|
-
"react-dom": "19.0.0",
|
|
160
|
-
"remark": "15.0.1",
|
|
161
|
-
"remark-gfm": "4.0.1",
|
|
162
|
-
"rollup": "4.53.3",
|
|
163
|
-
"rollup-plugin-copy": "3.5.0",
|
|
164
|
-
"rollup-plugin-esbuild": "^6.2.1",
|
|
165
|
-
"svelte": "5.46.1",
|
|
166
|
-
"tsc-alias": "1.8.16",
|
|
167
|
-
"tsd": "0.33.0",
|
|
168
|
-
"tsx": "^4.21.0",
|
|
169
|
-
"typescript": "5.8.3",
|
|
170
|
-
"typescript-eslint": "^8.56.1",
|
|
171
|
-
"vite": "7.3.0",
|
|
172
|
-
"vite-tsconfig-paths": "6.0.3",
|
|
173
|
-
"vitest": "4.0.16",
|
|
174
|
-
"vue": "3.5.26"
|
|
162
|
+
"api:check": "tsx scripts/api-extractor/check.ts"
|
|
175
163
|
}
|
|
176
|
-
}
|
|
164
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../../src/core/constants/headers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC"}
|