react-native-intlayer 7.0.0 → 7.0.2-canary.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/dist/cjs/configMetroIntlayer.cjs +33 -19
- package/dist/cjs/configMetroIntlayer.cjs.map +1 -1
- package/dist/cjs/metro.cjs +2 -1
- package/dist/esm/configMetroIntlayer.mjs +33 -19
- package/dist/esm/configMetroIntlayer.mjs.map +1 -1
- package/dist/esm/metro.mjs +2 -2
- package/dist/types/configMetroIntlayer.d.ts +18 -1
- package/dist/types/configMetroIntlayer.d.ts.map +1 -1
- package/dist/types/metro.d.ts +2 -2
- package/package.json +14 -14
|
@@ -6,8 +6,6 @@ let __intlayer_chokidar = require("@intlayer/chokidar");
|
|
|
6
6
|
__intlayer_chokidar = require_rolldown_runtime.__toESM(__intlayer_chokidar);
|
|
7
7
|
let __intlayer_config = require("@intlayer/config");
|
|
8
8
|
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
9
|
-
let expo_metro_config = require("expo/metro-config");
|
|
10
|
-
expo_metro_config = require_rolldown_runtime.__toESM(expo_metro_config);
|
|
11
9
|
let metro_resolver = require("metro-resolver");
|
|
12
10
|
metro_resolver = require_rolldown_runtime.__toESM(metro_resolver);
|
|
13
11
|
|
|
@@ -15,29 +13,25 @@ metro_resolver = require_rolldown_runtime.__toESM(metro_resolver);
|
|
|
15
13
|
/**
|
|
16
14
|
* // metro.config.js
|
|
17
15
|
* const { getDefaultConfig } = require("expo/metro-config");
|
|
18
|
-
* const {
|
|
16
|
+
* const { configMetroIntlayerSync } = require("react-native-intlayer/metro");
|
|
19
17
|
*
|
|
20
|
-
* module.exports = (async () => {
|
|
21
|
-
* const defaultConfig = getDefaultConfig(__dirname);
|
|
22
18
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
19
|
+
* const defaultConfig = getDefaultConfig(__dirname);
|
|
20
|
+
*
|
|
21
|
+
* return configMetroIntlayerSync(defaultConfig);
|
|
25
22
|
* ```
|
|
23
|
+
*
|
|
24
|
+
* > Note: `configMetroIntlayerSync` allow to build intlayer dictionaries on server start
|
|
26
25
|
*/
|
|
27
|
-
const
|
|
28
|
-
let resolvedBaseConfig;
|
|
29
|
-
const intlayerConfig = (0, __intlayer_config.getConfiguration)();
|
|
30
|
-
if (baseConfig) resolvedBaseConfig = baseConfig;
|
|
31
|
-
else resolvedBaseConfig = (0, expo_metro_config.getDefaultConfig)(intlayerConfig.content.baseDir);
|
|
32
|
-
await (0, __intlayer_chokidar.prepareIntlayer)(intlayerConfig);
|
|
26
|
+
const configMetroIntlayerSync = (baseConfig) => {
|
|
33
27
|
const alias = (0, __intlayer_config.getAlias)({
|
|
34
|
-
configuration:
|
|
35
|
-
formatter:
|
|
28
|
+
configuration: (0, __intlayer_config.getConfiguration)(),
|
|
29
|
+
formatter: node_path.resolve
|
|
36
30
|
});
|
|
37
31
|
return {
|
|
38
32
|
...baseConfig,
|
|
39
33
|
resolver: {
|
|
40
|
-
...
|
|
34
|
+
...baseConfig?.resolver,
|
|
41
35
|
resolveRequest: (context, moduleName, ...args) => {
|
|
42
36
|
if (Object.keys(alias).includes(moduleName)) return {
|
|
43
37
|
filePath: alias[moduleName],
|
|
@@ -47,18 +41,38 @@ const configMetroIntlayer = async (baseConfig) => {
|
|
|
47
41
|
filePath: require.resolve("@intlayer/config/client"),
|
|
48
42
|
type: "sourceFile"
|
|
49
43
|
};
|
|
50
|
-
if (moduleName
|
|
51
|
-
filePath: require.resolve(
|
|
44
|
+
if (moduleName === "@intlayer/core/file") return {
|
|
45
|
+
filePath: require.resolve("@intlayer/core/file/browser"),
|
|
52
46
|
type: "sourceFile"
|
|
53
47
|
};
|
|
54
48
|
if (typeof context.resolveRequest === "function") return context.resolveRequest(context, moduleName, ...args);
|
|
55
49
|
return (0, metro_resolver.resolve)(context, moduleName, ...args);
|
|
56
50
|
},
|
|
57
|
-
blockList: require_exclusionList.exclusionList([...[
|
|
51
|
+
blockList: require_exclusionList.exclusionList([...[baseConfig?.resolver?.blockList ?? []].flat(), /.*\.content\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/])
|
|
58
52
|
}
|
|
59
53
|
};
|
|
60
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* // metro.config.js
|
|
57
|
+
* const { getDefaultConfig } = require("expo/metro-config");
|
|
58
|
+
* const { configMetroIntlayer } = require("react-native-intlayer/metro");
|
|
59
|
+
*
|
|
60
|
+
* module.exports = (async () => {
|
|
61
|
+
* const defaultConfig = getDefaultConfig(__dirname);
|
|
62
|
+
*
|
|
63
|
+
* return await configMetroIntlayer(defaultConfig);
|
|
64
|
+
* })();
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously.
|
|
68
|
+
* > Note: `configMetroIntlayerSync` do not allow to build intlayer dictionaries on server start
|
|
69
|
+
*/
|
|
70
|
+
const configMetroIntlayer = async (baseConfig) => {
|
|
71
|
+
await (0, __intlayer_chokidar.prepareIntlayer)((0, __intlayer_config.getConfiguration)());
|
|
72
|
+
return configMetroIntlayerSync(baseConfig);
|
|
73
|
+
};
|
|
61
74
|
|
|
62
75
|
//#endregion
|
|
63
76
|
exports.configMetroIntlayer = configMetroIntlayer;
|
|
77
|
+
exports.configMetroIntlayerSync = configMetroIntlayerSync;
|
|
64
78
|
//# sourceMappingURL=configMetroIntlayer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configMetroIntlayer.cjs","names":["
|
|
1
|
+
{"version":3,"file":"configMetroIntlayer.cjs","names":["pathResolve","exclusionList"],"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { resolve as pathResolve } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar';\nimport { getAlias, getConfiguration } from '@intlayer/config';\nimport type { getDefaultConfig } from 'expo/metro-config';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\n/**\n * // metro.config.js\n * const { getDefaultConfig } = require(\"expo/metro-config\");\n * const { configMetroIntlayerSync } = require(\"react-native-intlayer/metro\");\n *\n *\n * const defaultConfig = getDefaultConfig(__dirname);\n *\n * return configMetroIntlayerSync(defaultConfig);\n * ```\n *\n * > Note: `configMetroIntlayerSync` allow to build intlayer dictionaries on server start\n */\nexport const configMetroIntlayerSync = (\n baseConfig?: MetroConfig\n): MetroConfig => {\n const configuration = getConfiguration();\n\n const alias = getAlias({\n configuration,\n formatter: pathResolve, // get absolute path\n });\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig?.resolver,\n resolveRequest: (context, moduleName, ...args) => {\n if (Object.keys(alias).includes(moduleName)) {\n return {\n filePath: alias[moduleName as keyof typeof alias],\n type: 'sourceFile',\n };\n }\n\n // Because metro does not resolve submodules, we need to resolve the path manually\n if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Because metro does not resolve subodules, we need to resolve the path manually\n if (moduleName === '@intlayer/core/file') {\n // Force React Native to use the correct transpiled version\n return {\n filePath: require.resolve('@intlayer/core/file/browser'),\n type: 'sourceFile',\n };\n }\n\n // Delegate to the default resolver to prevent infinite recursion\n if (typeof (context as any).resolveRequest === 'function') {\n return (context as any).resolveRequest(context, moduleName, ...args);\n }\n\n // Fallback to metro-resolver when no default resolver is present\n return resolve(context as any, moduleName, ...args);\n },\n blockList: exclusionList([\n ...[baseConfig?.resolver?.blockList ?? []].flat(),\n // the following instruction should be replaced configuration.content.watchedFilesPattern\n // but using watchedFilesPattern does not exclude the files properly for now\n /.*\\.content\\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/,\n ]),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n\n/**\n * // metro.config.js\n * const { getDefaultConfig } = require(\"expo/metro-config\");\n * const { configMetroIntlayer } = require(\"react-native-intlayer/metro\");\n *\n * module.exports = (async () => {\n * const defaultConfig = getDefaultConfig(__dirname);\n *\n * return await configMetroIntlayer(defaultConfig);\n * })();\n * ```\n *\n * > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously.\n * > Note: `configMetroIntlayerSync` do not allow to build intlayer dictionaries on server start\n */\nexport const configMetroIntlayer = async (\n baseConfig?: MetroConfig\n): Promise<MetroConfig> => {\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n return configMetroIntlayerSync(baseConfig);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,2BACX,eACgB;CAGhB,MAAM,wCAAiB;EACrB,wDAHsC;EAItC,WAAWA;EACZ,CAAC;AAiDF,QA/Ce;EACb,GAAG;EAEH,UAAU;GACR,GAAG,YAAY;GACf,iBAAiB,SAAS,YAAY,GAAG,SAAS;AAChD,QAAI,OAAO,KAAK,MAAM,CAAC,SAAS,WAAW,CACzC,QAAO;KACL,UAAU,MAAM;KAChB,MAAM;KACP;AAIH,QAAI,eAAe,0BACjB,QAAO;KACL,UAAU,QAAQ,QAAQ,0BAA0B;KACpD,MAAM;KACP;AAIH,QAAI,eAAe,sBAEjB,QAAO;KACL,UAAU,QAAQ,QAAQ,8BAA8B;KACxD,MAAM;KACP;AAIH,QAAI,OAAQ,QAAgB,mBAAmB,WAC7C,QAAQ,QAAgB,eAAe,SAAS,YAAY,GAAG,KAAK;AAItE,uCAAe,SAAgB,YAAY,GAAG,KAAK;;GAErD,WAAWC,oCAAc,CACvB,GAAG,CAAC,YAAY,UAAU,aAAa,EAAE,CAAC,CAAC,MAAM,EAGjD,uDACD,CAAC;GACH;EACF;;;;;;;;;;;;;;;;;AAoBH,MAAa,sBAAsB,OACjC,eACyB;AAGzB,yFAFwC,CAEJ;AAEpC,QAAO,wBAAwB,WAAW"}
|
package/dist/cjs/metro.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
const require_configMetroIntlayer = require('./configMetroIntlayer.cjs');
|
|
2
2
|
|
|
3
|
-
exports.configMetroIntlayer = require_configMetroIntlayer.configMetroIntlayer;
|
|
3
|
+
exports.configMetroIntlayer = require_configMetroIntlayer.configMetroIntlayer;
|
|
4
|
+
exports.configMetroIntlayerSync = require_configMetroIntlayer.configMetroIntlayerSync;
|
|
@@ -3,36 +3,31 @@ import { exclusionList } from "./exclusionList.mjs";
|
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { prepareIntlayer } from "@intlayer/chokidar";
|
|
5
5
|
import { getAlias, getConfiguration } from "@intlayer/config";
|
|
6
|
-
import { getDefaultConfig } from "expo/metro-config";
|
|
7
6
|
import { resolve as resolve$1 } from "metro-resolver";
|
|
8
7
|
|
|
9
8
|
//#region src/configMetroIntlayer.ts
|
|
10
9
|
/**
|
|
11
10
|
* // metro.config.js
|
|
12
11
|
* const { getDefaultConfig } = require("expo/metro-config");
|
|
13
|
-
* const {
|
|
12
|
+
* const { configMetroIntlayerSync } = require("react-native-intlayer/metro");
|
|
14
13
|
*
|
|
15
|
-
* module.exports = (async () => {
|
|
16
|
-
* const defaultConfig = getDefaultConfig(__dirname);
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* const defaultConfig = getDefaultConfig(__dirname);
|
|
16
|
+
*
|
|
17
|
+
* return configMetroIntlayerSync(defaultConfig);
|
|
20
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* > Note: `configMetroIntlayerSync` allow to build intlayer dictionaries on server start
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
23
|
-
let resolvedBaseConfig;
|
|
24
|
-
const intlayerConfig = getConfiguration();
|
|
25
|
-
if (baseConfig) resolvedBaseConfig = baseConfig;
|
|
26
|
-
else resolvedBaseConfig = getDefaultConfig(intlayerConfig.content.baseDir);
|
|
27
|
-
await prepareIntlayer(intlayerConfig);
|
|
22
|
+
const configMetroIntlayerSync = (baseConfig) => {
|
|
28
23
|
const alias = getAlias({
|
|
29
|
-
configuration:
|
|
30
|
-
formatter:
|
|
24
|
+
configuration: getConfiguration(),
|
|
25
|
+
formatter: resolve
|
|
31
26
|
});
|
|
32
27
|
return {
|
|
33
28
|
...baseConfig,
|
|
34
29
|
resolver: {
|
|
35
|
-
...
|
|
30
|
+
...baseConfig?.resolver,
|
|
36
31
|
resolveRequest: (context, moduleName, ...args) => {
|
|
37
32
|
if (Object.keys(alias).includes(moduleName)) return {
|
|
38
33
|
filePath: alias[moduleName],
|
|
@@ -42,18 +37,37 @@ const configMetroIntlayer = async (baseConfig) => {
|
|
|
42
37
|
filePath: __require.resolve("@intlayer/config/client"),
|
|
43
38
|
type: "sourceFile"
|
|
44
39
|
};
|
|
45
|
-
if (moduleName
|
|
46
|
-
filePath: __require.resolve(
|
|
40
|
+
if (moduleName === "@intlayer/core/file") return {
|
|
41
|
+
filePath: __require.resolve("@intlayer/core/file/browser"),
|
|
47
42
|
type: "sourceFile"
|
|
48
43
|
};
|
|
49
44
|
if (typeof context.resolveRequest === "function") return context.resolveRequest(context, moduleName, ...args);
|
|
50
45
|
return resolve$1(context, moduleName, ...args);
|
|
51
46
|
},
|
|
52
|
-
blockList: exclusionList([...[
|
|
47
|
+
blockList: exclusionList([...[baseConfig?.resolver?.blockList ?? []].flat(), /.*\.content\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/])
|
|
53
48
|
}
|
|
54
49
|
};
|
|
55
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* // metro.config.js
|
|
53
|
+
* const { getDefaultConfig } = require("expo/metro-config");
|
|
54
|
+
* const { configMetroIntlayer } = require("react-native-intlayer/metro");
|
|
55
|
+
*
|
|
56
|
+
* module.exports = (async () => {
|
|
57
|
+
* const defaultConfig = getDefaultConfig(__dirname);
|
|
58
|
+
*
|
|
59
|
+
* return await configMetroIntlayer(defaultConfig);
|
|
60
|
+
* })();
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously.
|
|
64
|
+
* > Note: `configMetroIntlayerSync` do not allow to build intlayer dictionaries on server start
|
|
65
|
+
*/
|
|
66
|
+
const configMetroIntlayer = async (baseConfig) => {
|
|
67
|
+
await prepareIntlayer(getConfiguration());
|
|
68
|
+
return configMetroIntlayerSync(baseConfig);
|
|
69
|
+
};
|
|
56
70
|
|
|
57
71
|
//#endregion
|
|
58
|
-
export { configMetroIntlayer };
|
|
72
|
+
export { configMetroIntlayer, configMetroIntlayerSync };
|
|
59
73
|
//# sourceMappingURL=configMetroIntlayer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configMetroIntlayer.mjs","names":["
|
|
1
|
+
{"version":3,"file":"configMetroIntlayer.mjs","names":["pathResolve","resolve"],"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { resolve as pathResolve } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar';\nimport { getAlias, getConfiguration } from '@intlayer/config';\nimport type { getDefaultConfig } from 'expo/metro-config';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\n/**\n * // metro.config.js\n * const { getDefaultConfig } = require(\"expo/metro-config\");\n * const { configMetroIntlayerSync } = require(\"react-native-intlayer/metro\");\n *\n *\n * const defaultConfig = getDefaultConfig(__dirname);\n *\n * return configMetroIntlayerSync(defaultConfig);\n * ```\n *\n * > Note: `configMetroIntlayerSync` allow to build intlayer dictionaries on server start\n */\nexport const configMetroIntlayerSync = (\n baseConfig?: MetroConfig\n): MetroConfig => {\n const configuration = getConfiguration();\n\n const alias = getAlias({\n configuration,\n formatter: pathResolve, // get absolute path\n });\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig?.resolver,\n resolveRequest: (context, moduleName, ...args) => {\n if (Object.keys(alias).includes(moduleName)) {\n return {\n filePath: alias[moduleName as keyof typeof alias],\n type: 'sourceFile',\n };\n }\n\n // Because metro does not resolve submodules, we need to resolve the path manually\n if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Because metro does not resolve subodules, we need to resolve the path manually\n if (moduleName === '@intlayer/core/file') {\n // Force React Native to use the correct transpiled version\n return {\n filePath: require.resolve('@intlayer/core/file/browser'),\n type: 'sourceFile',\n };\n }\n\n // Delegate to the default resolver to prevent infinite recursion\n if (typeof (context as any).resolveRequest === 'function') {\n return (context as any).resolveRequest(context, moduleName, ...args);\n }\n\n // Fallback to metro-resolver when no default resolver is present\n return resolve(context as any, moduleName, ...args);\n },\n blockList: exclusionList([\n ...[baseConfig?.resolver?.blockList ?? []].flat(),\n // the following instruction should be replaced configuration.content.watchedFilesPattern\n // but using watchedFilesPattern does not exclude the files properly for now\n /.*\\.content\\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/,\n ]),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n\n/**\n * // metro.config.js\n * const { getDefaultConfig } = require(\"expo/metro-config\");\n * const { configMetroIntlayer } = require(\"react-native-intlayer/metro\");\n *\n * module.exports = (async () => {\n * const defaultConfig = getDefaultConfig(__dirname);\n *\n * return await configMetroIntlayer(defaultConfig);\n * })();\n * ```\n *\n * > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously.\n * > Note: `configMetroIntlayerSync` do not allow to build intlayer dictionaries on server start\n */\nexport const configMetroIntlayer = async (\n baseConfig?: MetroConfig\n): Promise<MetroConfig> => {\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n return configMetroIntlayerSync(baseConfig);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,2BACX,eACgB;CAGhB,MAAM,QAAQ,SAAS;EACrB,eAHoB,kBAAkB;EAItC,WAAWA;EACZ,CAAC;AAiDF,QA/Ce;EACb,GAAG;EAEH,UAAU;GACR,GAAG,YAAY;GACf,iBAAiB,SAAS,YAAY,GAAG,SAAS;AAChD,QAAI,OAAO,KAAK,MAAM,CAAC,SAAS,WAAW,CACzC,QAAO;KACL,UAAU,MAAM;KAChB,MAAM;KACP;AAIH,QAAI,eAAe,0BACjB,QAAO;KACL,oBAAkB,QAAQ,0BAA0B;KACpD,MAAM;KACP;AAIH,QAAI,eAAe,sBAEjB,QAAO;KACL,oBAAkB,QAAQ,8BAA8B;KACxD,MAAM;KACP;AAIH,QAAI,OAAQ,QAAgB,mBAAmB,WAC7C,QAAQ,QAAgB,eAAe,SAAS,YAAY,GAAG,KAAK;AAItE,WAAOC,UAAQ,SAAgB,YAAY,GAAG,KAAK;;GAErD,WAAW,cAAc,CACvB,GAAG,CAAC,YAAY,UAAU,aAAa,EAAE,CAAC,CAAC,MAAM,EAGjD,uDACD,CAAC;GACH;EACF;;;;;;;;;;;;;;;;;AAoBH,MAAa,sBAAsB,OACjC,eACyB;AAGzB,OAAM,gBAFgB,kBAAkB,CAEJ;AAEpC,QAAO,wBAAwB,WAAW"}
|
package/dist/esm/metro.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { configMetroIntlayer } from "./configMetroIntlayer.mjs";
|
|
1
|
+
import { configMetroIntlayer, configMetroIntlayerSync } from "./configMetroIntlayer.mjs";
|
|
2
2
|
|
|
3
|
-
export { configMetroIntlayer };
|
|
3
|
+
export { configMetroIntlayer, configMetroIntlayerSync };
|
|
@@ -2,6 +2,20 @@ import { getDefaultConfig } from "expo/metro-config";
|
|
|
2
2
|
|
|
3
3
|
//#region src/configMetroIntlayer.d.ts
|
|
4
4
|
type MetroConfig = ReturnType<typeof getDefaultConfig>;
|
|
5
|
+
/**
|
|
6
|
+
* // metro.config.js
|
|
7
|
+
* const { getDefaultConfig } = require("expo/metro-config");
|
|
8
|
+
* const { configMetroIntlayerSync } = require("react-native-intlayer/metro");
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* const defaultConfig = getDefaultConfig(__dirname);
|
|
12
|
+
*
|
|
13
|
+
* return configMetroIntlayerSync(defaultConfig);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* > Note: `configMetroIntlayerSync` allow to build intlayer dictionaries on server start
|
|
17
|
+
*/
|
|
18
|
+
declare const configMetroIntlayerSync: (baseConfig?: MetroConfig) => MetroConfig;
|
|
5
19
|
/**
|
|
6
20
|
* // metro.config.js
|
|
7
21
|
* const { getDefaultConfig } = require("expo/metro-config");
|
|
@@ -13,8 +27,11 @@ type MetroConfig = ReturnType<typeof getDefaultConfig>;
|
|
|
13
27
|
* return await configMetroIntlayer(defaultConfig);
|
|
14
28
|
* })();
|
|
15
29
|
* ```
|
|
30
|
+
*
|
|
31
|
+
* > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously.
|
|
32
|
+
* > Note: `configMetroIntlayerSync` do not allow to build intlayer dictionaries on server start
|
|
16
33
|
*/
|
|
17
34
|
declare const configMetroIntlayer: (baseConfig?: MetroConfig) => Promise<MetroConfig>;
|
|
18
35
|
//#endregion
|
|
19
|
-
export { configMetroIntlayer };
|
|
36
|
+
export { configMetroIntlayer, configMetroIntlayerSync };
|
|
20
37
|
//# sourceMappingURL=configMetroIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configMetroIntlayer.d.ts","names":[],"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":[],"mappings":";;;KAOK,WAAA,GAAc,kBAAkB;;
|
|
1
|
+
{"version":3,"file":"configMetroIntlayer.d.ts","names":[],"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":[],"mappings":";;;KAOK,WAAA,GAAc,kBAAkB;;AAJqB;AAmB1D;AA2EA;;;;;;;;;;cA3Ea,uCACE,gBACZ;;;;;;;;;;;;;;;;cAyEU,mCACE,gBACZ,QAAQ"}
|
package/dist/types/metro.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { configMetroIntlayer } from "./configMetroIntlayer.js";
|
|
2
|
-
export { configMetroIntlayer };
|
|
1
|
+
import { configMetroIntlayer, configMetroIntlayerSync } from "./configMetroIntlayer.js";
|
|
2
|
+
export { configMetroIntlayer, configMetroIntlayerSync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-intlayer",
|
|
3
|
-
"version": "7.0.0",
|
|
3
|
+
"version": "7.0.2-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A React Native plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -83,18 +83,18 @@
|
|
|
83
83
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@intlayer/chokidar": "7.0.0",
|
|
87
|
-
"@intlayer/config": "7.0.0",
|
|
88
|
-
"@intlayer/core": "7.0.0",
|
|
89
|
-
"@intlayer/types": "7.0.0",
|
|
90
|
-
"react-intlayer": "7.0.0"
|
|
86
|
+
"@intlayer/chokidar": "7.0.2-canary.0",
|
|
87
|
+
"@intlayer/config": "7.0.2-canary.0",
|
|
88
|
+
"@intlayer/core": "7.0.2-canary.0",
|
|
89
|
+
"@intlayer/types": "7.0.2-canary.0",
|
|
90
|
+
"react-intlayer": "7.0.2-canary.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@types/node": "24.9.1",
|
|
94
94
|
"@types/react": ">=18.0.0",
|
|
95
|
-
"@utils/ts-config": "7.0.0",
|
|
96
|
-
"@utils/ts-config-types": "7.0.0",
|
|
97
|
-
"@utils/tsdown-config": "7.0.0",
|
|
95
|
+
"@utils/ts-config": "7.0.2-canary.0",
|
|
96
|
+
"@utils/ts-config-types": "7.0.2-canary.0",
|
|
97
|
+
"@utils/tsdown-config": "7.0.2-canary.0",
|
|
98
98
|
"expo": "54.0.12",
|
|
99
99
|
"metro-resolver": "0.82.0",
|
|
100
100
|
"react": ">=18.0.0",
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
"vitest": "4.0.3"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@intlayer/chokidar": "7.0.0",
|
|
108
|
-
"@intlayer/config": "7.0.0",
|
|
109
|
-
"@intlayer/core": "7.0.0",
|
|
110
|
-
"@intlayer/types": "7.0.0",
|
|
107
|
+
"@intlayer/chokidar": "7.0.2-canary.0",
|
|
108
|
+
"@intlayer/config": "7.0.2-canary.0",
|
|
109
|
+
"@intlayer/core": "7.0.2-canary.0",
|
|
110
|
+
"@intlayer/types": "7.0.2-canary.0",
|
|
111
111
|
"expo": ">=52",
|
|
112
112
|
"metro-resolver": ">=0.80",
|
|
113
113
|
"react": ">=18.0.0",
|
|
114
|
-
"react-intlayer": "7.0.0"
|
|
114
|
+
"react-intlayer": "7.0.2-canary.0"
|
|
115
115
|
},
|
|
116
116
|
"engines": {
|
|
117
117
|
"node": ">=14.18"
|