@intlayer/chokidar 6.0.0-canary.2 → 6.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/dist/cjs/chokidar/watcher.cjs +4 -4
- package/dist/cjs/chokidar/watcher.cjs.map +1 -1
- package/dist/cjs/fetchDistantDictionaries.cjs +3 -25
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +19 -21
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +13 -4
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +47 -12
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +52 -9
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs +5 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +3 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/buildIntlayerDictionary.cjs +3 -3
- package/dist/cjs/transpiler/intlayer_dictionary/buildIntlayerDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/index.cjs +3 -3
- package/dist/cjs/transpiler/intlayer_dictionary/index.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/processContentDeclaration.cjs +1 -1
- package/dist/cjs/transpiler/intlayer_dictionary/processContentDeclaration.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeDynamicDictionary.cjs +19 -10
- package/dist/cjs/transpiler/intlayer_dictionary/writeDynamicDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeFetchDictionary.cjs +9 -3
- package/dist/cjs/transpiler/intlayer_dictionary/writeFetchDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeMergedDictionary.cjs +12 -8
- package/dist/cjs/transpiler/intlayer_dictionary/writeMergedDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeRemoteDictionary.cjs +9 -7
- package/dist/cjs/transpiler/intlayer_dictionary/writeRemoteDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeUnmergedDictionary.cjs +12 -8
- package/dist/cjs/transpiler/intlayer_dictionary/writeUnmergedDictionary.cjs.map +1 -0
- package/dist/cjs/writeConfiguration/index.cjs +5 -6
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -5
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeFileIfChanged.cjs +46 -0
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -0
- package/dist/cjs/{transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.cjs → writeJsonIfChanged.cjs} +11 -14
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -0
- package/dist/esm/chokidar/watcher.mjs +1 -1
- package/dist/esm/chokidar/watcher.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaries.mjs +5 -32
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +19 -21
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +14 -5
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/log.mjs +50 -13
- package/dist/esm/loadDictionaries/log.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +53 -8
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs +6 -2
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +4 -2
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/buildIntlayerDictionary.mjs +2 -2
- package/dist/esm/transpiler/intlayer_dictionary/buildIntlayerDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/index.mjs +1 -1
- package/dist/esm/transpiler/intlayer_dictionary/index.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/processContentDeclaration.mjs +1 -1
- package/dist/esm/transpiler/intlayer_dictionary/processContentDeclaration.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeDynamicDictionary.mjs +25 -12
- package/dist/esm/transpiler/intlayer_dictionary/writeDynamicDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeFetchDictionary.mjs +15 -5
- package/dist/esm/transpiler/intlayer_dictionary/writeFetchDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeMergedDictionary.mjs +14 -10
- package/dist/esm/transpiler/intlayer_dictionary/writeMergedDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeRemoteDictionary.mjs +11 -9
- package/dist/esm/transpiler/intlayer_dictionary/writeRemoteDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeUnmergedDictionary.mjs +14 -10
- package/dist/esm/transpiler/intlayer_dictionary/writeUnmergedDictionary.mjs.map +1 -0
- package/dist/esm/writeConfiguration/index.mjs +5 -6
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -5
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeFileIfChanged.mjs +22 -0
- package/dist/esm/writeFileIfChanged.mjs.map +1 -0
- package/dist/esm/writeJsonIfChanged.mjs +10 -0
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -0
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +4 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +5 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/log.d.ts +7 -0
- package/dist/types/loadDictionaries/log.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +1 -1
- package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +1 -1
- package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/buildIntlayerDictionary.d.ts +1 -1
- package/dist/types/transpiler/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/index.d.ts +1 -1
- package/dist/types/transpiler/intlayer_dictionary/index.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/processContentDeclaration.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/writeDynamicDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/writeFetchDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/writeMergedDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/writeRemoteDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +1 -0
- package/dist/types/writeConfiguration/index.d.ts +1 -1
- package/dist/types/writeConfiguration/index.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeFileIfChanged.d.ts +4 -0
- package/dist/types/writeFileIfChanged.d.ts.map +1 -0
- package/dist/types/writeJsonIfChanged.d.ts +4 -0
- package/dist/types/writeJsonIfChanged.d.ts.map +1 -0
- package/package.json +16 -16
- package/dist/cjs/fetchDistantDictionaryKeysAndUpdateTimestamp.cjs +0 -45
- package/dist/cjs/fetchDistantDictionaryKeysAndUpdateTimestamp.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.cjs +0 -46
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.cjs +0 -103
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.cjs +0 -23
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs +0 -51
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/index.cjs +0 -40
- package/dist/cjs/transpiler/declaration_file_to_dictionary/index.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.cjs +0 -30
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs +0 -52
- package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs.map +0 -1
- package/dist/esm/fetchDistantDictionaryKeysAndUpdateTimestamp.mjs +0 -21
- package/dist/esm/fetchDistantDictionaryKeysAndUpdateTimestamp.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.mjs +0 -24
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.mjs +0 -81
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.mjs +0 -13
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.mjs +0 -2
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs +0 -27
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/index.mjs +0 -16
- package/dist/esm/transpiler/declaration_file_to_dictionary/index.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.mjs +0 -6
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs +0 -28
- package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs.map +0 -1
- package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts +0 -3
- package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.d.ts +0 -6
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.d.ts +0 -7
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.d.ts +0 -2
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.d.ts +0 -2
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.d.ts +0 -7
- package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts +0 -8
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.d.ts +0 -2
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.d.ts +0 -7
- package/dist/types/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.d.ts.map +0 -1
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/processContentDeclaration.d.ts +0 -0
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeDynamicDictionary.d.ts +0 -0
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeFetchDictionary.d.ts +0 -0
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeMergedDictionary.d.ts +0 -0
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeRemoteDictionary.d.ts +0 -0
- /package/dist/types/transpiler/{declaration_file_to_dictionary/intlayer_dictionary → intlayer_dictionary}/writeUnmergedDictionary.d.ts +0 -0
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config";
|
|
2
|
-
import {
|
|
3
|
-
NodeType
|
|
4
|
-
} from "@intlayer/core";
|
|
5
|
-
import { convertPluralsValues } from "./convertPluralsValues.mjs";
|
|
6
|
-
const isReactNode = (node) => typeof node?.key !== "undefined" && typeof node?.props !== "undefined" && typeof node?.type !== "undefined";
|
|
7
|
-
const buildDictionary = (content, locale) => {
|
|
8
|
-
if (
|
|
9
|
-
// Translation node
|
|
10
|
-
content && content.nodeType === NodeType.Translation
|
|
11
|
-
) {
|
|
12
|
-
const contentState = content[NodeType.Translation];
|
|
13
|
-
const result = contentState[locale];
|
|
14
|
-
return buildDictionary(result, locale);
|
|
15
|
-
} else if (
|
|
16
|
-
// Translation node
|
|
17
|
-
content && content.nodeType === NodeType.Enumeration
|
|
18
|
-
) {
|
|
19
|
-
const plurals = {};
|
|
20
|
-
Object.keys(
|
|
21
|
-
content[NodeType.Enumeration]
|
|
22
|
-
).forEach((quantity) => {
|
|
23
|
-
const letterNumber = convertPluralsValues(quantity);
|
|
24
|
-
const value = content[quantity];
|
|
25
|
-
plurals[`${letterNumber}_${letterNumber}`] = buildDictionary(
|
|
26
|
-
value,
|
|
27
|
-
locale
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
return plurals;
|
|
31
|
-
} else if (
|
|
32
|
-
// React element node
|
|
33
|
-
isReactNode(content)
|
|
34
|
-
) {
|
|
35
|
-
return JSON.stringify(content);
|
|
36
|
-
} else if (
|
|
37
|
-
// Nested object
|
|
38
|
-
typeof content === "object" && Array.isArray(content)
|
|
39
|
-
) {
|
|
40
|
-
const result = [];
|
|
41
|
-
Object.keys(content).forEach((dictionaryValue) => {
|
|
42
|
-
result.push(
|
|
43
|
-
buildDictionary(
|
|
44
|
-
content[dictionaryValue],
|
|
45
|
-
locale
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
return result;
|
|
50
|
-
} else if (
|
|
51
|
-
// Nested object
|
|
52
|
-
typeof content === "object"
|
|
53
|
-
) {
|
|
54
|
-
const result = {};
|
|
55
|
-
Object.keys(content).forEach(
|
|
56
|
-
(dictionaryValue) => {
|
|
57
|
-
result[dictionaryValue] = buildDictionary(
|
|
58
|
-
content?.[dictionaryValue],
|
|
59
|
-
locale
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
return content;
|
|
66
|
-
};
|
|
67
|
-
const createI18nextDictionaries = (content, configuration = getConfiguration()) => {
|
|
68
|
-
const { locales } = configuration.internationalization;
|
|
69
|
-
const result = locales.reduce(
|
|
70
|
-
(acc, locale) => ({
|
|
71
|
-
...acc,
|
|
72
|
-
[locale]: buildDictionary(content, locale)
|
|
73
|
-
}),
|
|
74
|
-
{}
|
|
75
|
-
);
|
|
76
|
-
return result;
|
|
77
|
-
};
|
|
78
|
-
export {
|
|
79
|
-
createI18nextDictionaries
|
|
80
|
-
};
|
|
81
|
-
//# sourceMappingURL=convertContentDeclarationInto18nDictionaries.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.ts"],"sourcesContent":["import { getConfiguration, type Locales } from '@intlayer/config';\nimport {\n NodeType,\n type TranslationContent,\n type EnumerationContent,\n type TypedNode,\n type ContentNode,\n} from '@intlayer/core';\nimport { convertPluralsValues } from './convertPluralsValues';\n\ntype Dictionary = Record<string, unknown>;\nexport type I18nextDictionariesOutput = Partial<Record<Locales, Dictionary>>;\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' &&\n typeof node?.props !== 'undefined' &&\n typeof node?.type !== 'undefined';\n\n// Build dictionary for a specific locale\nconst buildDictionary = (content: ContentNode, locale: Locales): unknown => {\n if (\n // Translation node\n content &&\n (content as TypedNode).nodeType === NodeType.Translation\n ) {\n const contentState = (content as TranslationContent)[NodeType.Translation];\n const result = contentState[locale as keyof typeof contentState];\n\n return buildDictionary(result as ContentNode, locale);\n } else if (\n // Translation node\n content &&\n (content as TypedNode).nodeType === NodeType.Enumeration\n ) {\n const plurals: Record<string, unknown> = {};\n\n Object.keys(\n (content as EnumerationContent<unknown>)[NodeType.Enumeration]\n ).forEach((quantity) => {\n const letterNumber = convertPluralsValues(quantity);\n\n const value = (content as EnumerationContent<unknown>)[\n quantity as keyof EnumerationContent<unknown>\n ];\n\n plurals[`${letterNumber}_${letterNumber}`] = buildDictionary(\n value as ContentNode,\n locale\n );\n });\n\n return plurals;\n } else if (\n // React element node\n isReactNode(content as Record<string, unknown>)\n ) {\n return JSON.stringify(content);\n } else if (\n // Nested object\n typeof content === 'object' &&\n Array.isArray(content)\n ) {\n const result: unknown[] = [];\n\n Object.keys(content).forEach((dictionaryValue) => {\n result.push(\n buildDictionary(\n content[dictionaryValue as keyof typeof content] as ContentNode,\n locale\n )\n );\n });\n\n return result;\n } else if (\n // Nested object\n typeof content === 'object'\n ) {\n const result: Record<string, unknown> = {};\n\n Object.keys(content as Record<string, unknown>).forEach(\n (dictionaryValue) => {\n result[dictionaryValue] = buildDictionary(\n content?.[\n dictionaryValue as keyof typeof content\n ] as unknown as ContentNode,\n locale\n );\n }\n );\n\n return result;\n }\n\n return content;\n};\n\nexport const createI18nextDictionaries = (\n content: ContentNode,\n configuration = getConfiguration()\n): I18nextDictionariesOutput => {\n const { locales } = configuration.internationalization;\n\n // Map dictionaries for each locale\n const result: I18nextDictionariesOutput = locales.reduce(\n (acc, locale) => ({\n ...acc,\n [locale]: buildDictionary(content, locale),\n }),\n {}\n );\n\n return result;\n};\n"],"mappings":"AAAA,SAAS,wBAAsC;AAC/C;AAAA,EACE;AAAA,OAKK;AACP,SAAS,4BAA4B;AAKrC,MAAM,cAAc,CAAC,SACnB,OAAO,MAAM,QAAQ,eACrB,OAAO,MAAM,UAAU,eACvB,OAAO,MAAM,SAAS;AAGxB,MAAM,kBAAkB,CAAC,SAAsB,WAA6B;AAC1E;AAAA;AAAA,IAEE,WACC,QAAsB,aAAa,SAAS;AAAA,IAC7C;AACA,UAAM,eAAgB,QAA+B,SAAS,WAAW;AACzE,UAAM,SAAS,aAAa,MAAmC;AAE/D,WAAO,gBAAgB,QAAuB,MAAM;AAAA,EACtD;AAAA;AAAA,IAEE,WACC,QAAsB,aAAa,SAAS;AAAA,IAC7C;AACA,UAAM,UAAmC,CAAC;AAE1C,WAAO;AAAA,MACJ,QAAwC,SAAS,WAAW;AAAA,IAC/D,EAAE,QAAQ,CAAC,aAAa;AACtB,YAAM,eAAe,qBAAqB,QAAQ;AAElD,YAAM,QAAS,QACb,QACF;AAEA,cAAQ,GAAG,YAAY,IAAI,YAAY,EAAE,IAAI;AAAA,QAC3C;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AAAA;AAAA,IAEE,YAAY,OAAkC;AAAA,IAC9C;AACA,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA;AAAA,IAEE,OAAO,YAAY,YACnB,MAAM,QAAQ,OAAO;AAAA,IACrB;AACA,UAAM,SAAoB,CAAC;AAE3B,WAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,oBAAoB;AAChD,aAAO;AAAA,QACL;AAAA,UACE,QAAQ,eAAuC;AAAA,UAC/C;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AAAA;AAAA,IAEE,OAAO,YAAY;AAAA,IACnB;AACA,UAAM,SAAkC,CAAC;AAEzC,WAAO,KAAK,OAAkC,EAAE;AAAA,MAC9C,CAAC,oBAAoB;AACnB,eAAO,eAAe,IAAI;AAAA,UACxB,UACE,eACF;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEO,MAAM,4BAA4B,CACvC,SACA,gBAAgB,iBAAiB,MACH;AAC9B,QAAM,EAAE,QAAQ,IAAI,cAAc;AAGlC,QAAM,SAAoC,QAAQ;AAAA,IAChD,CAAC,KAAK,YAAY;AAAA,MAChB,GAAG;AAAA,MACH,CAAC,MAAM,GAAG,gBAAgB,SAAS,MAAM;AAAA,IAC3C;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const convertPluralsValues = (number) => {
|
|
2
|
-
const numberValue = Number(number);
|
|
3
|
-
if (numberValue === 0) return "zero";
|
|
4
|
-
else if (numberValue === 1) return "singular";
|
|
5
|
-
else if (numberValue === 2) return "two";
|
|
6
|
-
else if (numberValue <= 7) return "few";
|
|
7
|
-
else if (numberValue <= 99) return "many";
|
|
8
|
-
else return "other";
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
convertPluralsValues
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=convertPluralsValues.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.ts"],"sourcesContent":["export const convertPluralsValues = (number: string | number): string => {\n const numberValue = Number(number);\n\n if (numberValue === 0) return 'zero';\n else if (numberValue === 1) return 'singular';\n else if (numberValue === 2) return 'two';\n else if (numberValue <= 7) return 'few';\n else if (numberValue <= 99) return 'many';\n else return 'other';\n};\n"],"mappings":"AAAO,MAAM,uBAAuB,CAAC,WAAoC;AACvE,QAAM,cAAc,OAAO,MAAM;AAEjC,MAAI,gBAAgB,EAAG,QAAO;AAAA,WACrB,gBAAgB,EAAG,QAAO;AAAA,WAC1B,gBAAgB,EAAG,QAAO;AAAA,WAC1B,eAAe,EAAG,QAAO;AAAA,WACzB,eAAe,GAAI,QAAO;AAAA,MAC9B,QAAO;AACd;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.ts"],"sourcesContent":["export * from './buildI18nextDictionary';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config";
|
|
2
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
const writeDictionary = async (dictionariesDeclaration, configuration = getConfiguration()) => {
|
|
5
|
-
const { i18nextResourcesDir } = configuration.content;
|
|
6
|
-
const resultDictionariesPaths = [];
|
|
7
|
-
for (const [nameSpace, localContent] of Object.entries(
|
|
8
|
-
dictionariesDeclaration
|
|
9
|
-
)) {
|
|
10
|
-
for await (const [locale, content] of Object.entries(localContent)) {
|
|
11
|
-
const contentString = JSON.stringify(content);
|
|
12
|
-
const outputFileName = `${nameSpace}.json`;
|
|
13
|
-
const dictionariesDirPath = resolve(i18nextResourcesDir, locale);
|
|
14
|
-
const resultFilePath = resolve(dictionariesDirPath, outputFileName);
|
|
15
|
-
await mkdir(dictionariesDirPath, { recursive: true });
|
|
16
|
-
await writeFile(resultFilePath, contentString, "utf8").catch((err) => {
|
|
17
|
-
console.error(`Error creating ${outputFileName}:`, err);
|
|
18
|
-
});
|
|
19
|
-
resultDictionariesPaths.push(resultFilePath);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return resultDictionariesPaths;
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
writeDictionary
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=writeDictionary.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport type { I18nextDictionariesOutput } from './convertContentDeclarationInto18nDictionaries';\n\nexport type DictionariesDeclaration = Record<string, I18nextDictionariesOutput>;\n\n/**\n * This function writes the dictionaries to the file system\n */\nexport const writeDictionary = async (\n dictionariesDeclaration: DictionariesDeclaration,\n configuration = getConfiguration()\n) => {\n const { i18nextResourcesDir } = configuration.content;\n\n const resultDictionariesPaths: string[] = [];\n\n for (const [nameSpace, localContent] of Object.entries(\n dictionariesDeclaration\n )) {\n for await (const [locale, content] of Object.entries(localContent)) {\n const contentString = JSON.stringify(content);\n\n const outputFileName = `${nameSpace}.json`;\n const dictionariesDirPath = resolve(i18nextResourcesDir, locale);\n const resultFilePath = resolve(dictionariesDirPath, outputFileName);\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(dictionariesDirPath, { recursive: true });\n\n // Create the json file\n await writeFile(resultFilePath, contentString, 'utf8').catch((err) => {\n console.error(`Error creating ${outputFileName}:`, err);\n });\n\n resultDictionariesPaths.push(resultFilePath);\n }\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AAQjB,MAAM,kBAAkB,OAC7B,yBACA,gBAAgB,iBAAiB,MAC9B;AACH,QAAM,EAAE,oBAAoB,IAAI,cAAc;AAE9C,QAAM,0BAAoC,CAAC;AAE3C,aAAW,CAAC,WAAW,YAAY,KAAK,OAAO;AAAA,IAC7C;AAAA,EACF,GAAG;AACD,qBAAiB,CAAC,QAAQ,OAAO,KAAK,OAAO,QAAQ,YAAY,GAAG;AAClE,YAAM,gBAAgB,KAAK,UAAU,OAAO;AAE5C,YAAM,iBAAiB,GAAG,SAAS;AACnC,YAAM,sBAAsB,QAAQ,qBAAqB,MAAM;AAC/D,YAAM,iBAAiB,QAAQ,qBAAqB,cAAc;AAGlE,YAAM,MAAM,qBAAqB,EAAE,WAAW,KAAK,CAAC;AAGpD,YAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,gBAAQ,MAAM,kBAAkB,cAAc,KAAK,GAAG;AAAA,MACxD,CAAC;AAED,8BAAwB,KAAK,cAAc;AAAA,IAC7C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config";
|
|
2
|
-
import { buildI18nDictionary } from "./i18next_dictionary/index.mjs";
|
|
3
|
-
import { buildIntlayerDictionary } from "./intlayer_dictionary/index.mjs";
|
|
4
|
-
const buildDictionary = async (dictionaries, configuration = getConfiguration()) => {
|
|
5
|
-
const { dictionaryOutput } = configuration.content;
|
|
6
|
-
if (dictionaryOutput.includes("i18next")) {
|
|
7
|
-
await buildI18nDictionary(dictionaries, configuration);
|
|
8
|
-
}
|
|
9
|
-
if (dictionaryOutput.includes("intlayer")) {
|
|
10
|
-
return await buildIntlayerDictionary(dictionaries, configuration);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
buildDictionary
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/transpiler/declaration_file_to_dictionary/index.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { buildI18nDictionary } from './i18next_dictionary/index';\nimport { buildIntlayerDictionary } from './intlayer_dictionary/index';\n\nexport const buildDictionary = async (\n dictionaries: Dictionary[],\n configuration = getConfiguration()\n) => {\n const { dictionaryOutput } = configuration.content;\n\n if (dictionaryOutput.includes('i18next')) {\n await buildI18nDictionary(dictionaries, configuration);\n }\n\n if (dictionaryOutput.includes('intlayer')) {\n return await buildIntlayerDictionary(dictionaries, configuration);\n }\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AAEjC,SAAS,2BAA2B;AACpC,SAAS,+BAA+B;AAEjC,MAAM,kBAAkB,OAC7B,cACA,gBAAgB,iBAAiB,MAC9B;AACH,QAAM,EAAE,iBAAiB,IAAI,cAAc;AAE3C,MAAI,iBAAiB,SAAS,SAAS,GAAG;AACxC,UAAM,oBAAoB,cAAc,aAAa;AAAA,EACvD;AAEA,MAAI,iBAAiB,SAAS,UAAU,GAAG;AACzC,WAAO,MAAM,wBAAwB,cAAc,aAAa;AAAA,EAClE;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"sourcesContent":["// @ts-ignore: @intlayer/backend is not built yet\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n LocalizedDictionaryOutput,\n writeDynamicDictionary,\n} from './writeDynamicDictionary';\nimport { writeFetchDictionary } from './writeFetchDictionary';\nimport { writeMergedDictionaries } from './writeMergedDictionary';\nimport { writeUnmergedDictionaries } from './writeUnmergedDictionary';\n\n/**\n * This function transpile the bundled code to to make dictionaries as JSON files\n */\nexport const buildIntlayerDictionary = async (\n localDictionariesEntries: Dictionary[],\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm']\n) => {\n const { importMode } = configuration.build;\n\n const unmergedDictionaries = await writeUnmergedDictionaries(\n localDictionariesEntries,\n configuration\n );\n\n const mergedDictionaries = await writeMergedDictionaries(\n unmergedDictionaries,\n configuration\n );\n\n let dynamicDictionaries: LocalizedDictionaryOutput | null = null;\n\n if (importMode === 'dynamic' || importMode === 'live') {\n dynamicDictionaries = await writeDynamicDictionary(\n mergedDictionaries,\n configuration,\n formats\n );\n }\n\n let fetchDictionaries: LocalizedDictionaryOutput | null = null;\n\n if (importMode === 'live') {\n fetchDictionaries = await writeFetchDictionary(\n dynamicDictionaries!,\n configuration,\n formats\n );\n }\n\n return {\n unmergedDictionaries,\n mergedDictionaries,\n dynamicDictionaries,\n fetchDictionaries,\n };\n};\n"],"mappings":"AACA,SAAS,wBAAwB;AAEjC;AAAA,EAEE;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAKnC,MAAM,0BAA0B,OACrC,0BACA,gBAAgB,iBAAiB,GACjC,UAA6B,CAAC,OAAO,KAAK,MACvC;AACH,QAAM,EAAE,WAAW,IAAI,cAAc;AAErC,QAAM,uBAAuB,MAAM;AAAA,IACjC;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,MAAM;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAEA,MAAI,sBAAwD;AAE5D,MAAI,eAAe,aAAa,eAAe,QAAQ;AACrD,0BAAsB,MAAM;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,oBAAsD;AAE1D,MAAI,eAAe,QAAQ;AACzB,wBAAoB,MAAM;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const isDevelopment = process.env.NODE_ENV === "development";
|
|
2
|
-
const formatDictionaryText = (dictionary) => isDevelopment ? JSON.stringify(dictionary, null, 2) : JSON.stringify(dictionary);
|
|
3
|
-
export {
|
|
4
|
-
formatDictionaryText
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=formatDictionaryText.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.ts"],"sourcesContent":["const isDevelopment = process.env.NODE_ENV === 'development';\n\nexport const formatDictionaryText = (dictionary: object) =>\n isDevelopment\n ? JSON.stringify(dictionary, null, 2)\n : JSON.stringify(dictionary);\n"],"mappings":"AAAA,MAAM,gBAAgB,QAAQ,IAAI,aAAa;AAExC,MAAM,uBAAuB,CAAC,eACnC,gBACI,KAAK,UAAU,YAAY,MAAM,CAAC,IAClC,KAAK,UAAU,UAAU;","names":[]}
|
package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.ts"],"sourcesContent":["export * from './processContentDeclaration';\nexport * from './buildIntlayerDictionary';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.ts"],"sourcesContent":["import { logger } from '@intlayer/config/client';\nimport type { Dictionary } from '@intlayer/core';\nimport { resolveObjectPromises } from '../../../utils/resolveObjectPromises';\n\n/**\n * Function to load, process the module and return the Intlayer Dictionary from the module file\n */\nexport const processContentDeclaration = async (\n contentDeclaration: Dictionary\n): Promise<Dictionary | undefined> => {\n try {\n const content = (await resolveObjectPromises(\n contentDeclaration.content\n )) as Dictionary['content'];\n\n return {\n ...contentDeclaration,\n content,\n } as Dictionary;\n } catch (error) {\n logger(error, {\n level: 'error',\n });\n }\n};\n"],"mappings":"AAAA,SAAS,cAAc;AAEvB,SAAS,6BAA6B;AAK/B,MAAM,4BAA4B,OACvC,uBACoC;AACpC,MAAI;AACF,UAAM,UAAW,MAAM;AAAA,MACrB,mBAAmB;AAAA,IACrB;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AACd,WAAO,OAAO;AAAA,MACZ,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.ts"],"sourcesContent":["import { getConfiguration, Locales, normalizePath } from '@intlayer/config';\nimport { getLocalisedContent, type Dictionary } from '@intlayer/core';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { relative, resolve } from 'path';\nimport { parallelize } from '../../../utils/parallelize';\nimport { formatDictionaryText } from './formatDictionaryText';\nimport { MergedDictionaryOutput } from './writeMergedDictionary';\n\nexport type DictionaryResult = {\n dictionaryPath: string;\n dictionary: Dictionary;\n};\n\nexport type LocalizedDictionaryResult = Partial<\n Record<Locales, DictionaryResult>\n>;\n\nexport type LocalizedDictionaryOutput = Record<\n string,\n LocalizedDictionaryResult\n>;\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryEntryPoint = (\n localedDictionariesPathsRecord: LocalizedDictionaryResult,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { dynamicDictionariesDir } = configuration.content;\n\n let content = '';\n\n // Format Dictionary Map - map locales to functions\n const formattedDictionaryMap: string = Object.entries(\n localedDictionariesPathsRecord\n )\n .map(([locale, dictionary]) => {\n const relativePath = normalizePath(\n relative(dynamicDictionariesDir, dictionary.dictionaryPath)\n );\n\n if (format === 'esm') {\n return ` '${locale}': () => import('./${relativePath}', { assert: { type: 'json' }}).then(mod => mod.default)`;\n }\n\n return ` '${locale}': () => Promise.resolve(require('./${relativePath}'))`;\n })\n .join(',\\n');\n\n content += `const content = {\\n${formattedDictionaryMap}\\n};\\n`;\n\n if (format === 'esm') content += `export default content;\\n`;\n if (format === 'cjs') content += `module.exports = content;\\n`;\n\n return content;\n};\n\n/**\n * Write the localized dictionaries to the dictionariesDir\n * @param mergedDictionaries - The merged dictionaries\n * @param configuration - The configuration\n * @returns The final dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);\n * console.log(finalDictionaries);\n *\n * // .intlayer/dynamic_dictionaries/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeDynamicDictionary = async (\n mergedDictionaries: MergedDictionaryOutput,\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm']\n): Promise<LocalizedDictionaryOutput> => {\n const { locales, defaultLocale } = configuration.internationalization;\n const { dynamicDictionariesDir } = configuration.content;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dynamicDictionariesDir), { recursive: true });\n\n let resultDictionariesPaths: LocalizedDictionaryOutput = {};\n\n // Merge dictionaries with the same key and write to dictionariesDir\n await parallelize(\n Object.entries(mergedDictionaries),\n async ([key, dictionaryEntry]) => {\n if (key === 'undefined') return;\n\n let localedDictionariesPathsRecord: LocalizedDictionaryResult = {};\n\n await parallelize(locales, async (locale) => {\n const localizedDictionary = {\n ...dictionaryEntry.dictionary,\n locale,\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n content: getLocalisedContent(\n JSON.parse(JSON.stringify(dictionaryEntry.dictionary.content)),\n locale,\n { dictionaryKey: key, keyPath: [] },\n defaultLocale\n ) as any,\n };\n\n const contentString = formatDictionaryText(localizedDictionary);\n\n const outputFileName = `${key}.${locale}.json`;\n const resultFilePath = resolve(dynamicDictionariesDir, outputFileName);\n\n // Write the localized dictionary\n await writeFile(resultFilePath, contentString, 'utf8').catch((err) => {\n console.error(`Error creating localized ${outputFileName}:`, err);\n });\n\n localedDictionariesPathsRecord[locale] = {\n dictionaryPath: resultFilePath,\n dictionary: localizedDictionary,\n };\n });\n\n resultDictionariesPaths[key] = localedDictionariesPathsRecord;\n\n await parallelize(formats, async (format) => {\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n const content = generateDictionaryEntryPoint(\n localedDictionariesPathsRecord,\n format,\n configuration\n );\n\n await writeFile(\n resolve(dynamicDictionariesDir, `${key}.${extension}`),\n content\n );\n });\n }\n );\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,kBAA2B,qBAAqB;AACzD,SAAS,2BAA4C;AACrD,SAAS,OAAO,iBAAiB;AACjC,SAAS,UAAU,eAAe;AAClC,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AAoB9B,MAAM,+BAA+B,CAC1C,gCACA,SAAwB,OACxB,gBAAgB,iBAAiB,MACtB;AACX,QAAM,EAAE,uBAAuB,IAAI,cAAc;AAEjD,MAAI,UAAU;AAGd,QAAM,yBAAiC,OAAO;AAAA,IAC5C;AAAA,EACF,EACG,IAAI,CAAC,CAAC,QAAQ,UAAU,MAAM;AAC7B,UAAM,eAAe;AAAA,MACnB,SAAS,wBAAwB,WAAW,cAAc;AAAA,IAC5D;AAEA,QAAI,WAAW,OAAO;AACpB,aAAO,MAAM,MAAM,sBAAsB,YAAY;AAAA,IACvD;AAEA,WAAO,MAAM,MAAM,uCAAuC,YAAY;AAAA,EACxE,CAAC,EACA,KAAK,KAAK;AAEb,aAAW;AAAA,EAAsB,sBAAsB;AAAA;AAAA;AAEvD,MAAI,WAAW,MAAO,YAAW;AAAA;AACjC,MAAI,WAAW,MAAO,YAAW;AAAA;AAEjC,SAAO;AACT;AAkBO,MAAM,yBAAyB,OACpC,oBACA,gBAAgB,iBAAiB,GACjC,UAA6B,CAAC,OAAO,KAAK,MACH;AACvC,QAAM,EAAE,SAAS,cAAc,IAAI,cAAc;AACjD,QAAM,EAAE,uBAAuB,IAAI,cAAc;AAGjD,QAAM,MAAM,QAAQ,sBAAsB,GAAG,EAAE,WAAW,KAAK,CAAC;AAEhE,MAAI,0BAAqD,CAAC;AAG1D,QAAM;AAAA,IACJ,OAAO,QAAQ,kBAAkB;AAAA,IACjC,OAAO,CAAC,KAAK,eAAe,MAAM;AAChC,UAAI,QAAQ,YAAa;AAEzB,UAAI,iCAA4D,CAAC;AAEjE,YAAM,YAAY,SAAS,OAAO,WAAW;AAC3C,cAAM,sBAAsB;AAAA,UAC1B,GAAG,gBAAgB;AAAA,UACnB;AAAA;AAAA,UAEA,SAAS;AAAA,YACP,KAAK,MAAM,KAAK,UAAU,gBAAgB,WAAW,OAAO,CAAC;AAAA,YAC7D;AAAA,YACA,EAAE,eAAe,KAAK,SAAS,CAAC,EAAE;AAAA,YAClC;AAAA,UACF;AAAA,QACF;AAEA,cAAM,gBAAgB,qBAAqB,mBAAmB;AAE9D,cAAM,iBAAiB,GAAG,GAAG,IAAI,MAAM;AACvC,cAAM,iBAAiB,QAAQ,wBAAwB,cAAc;AAGrE,cAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,kBAAQ,MAAM,4BAA4B,cAAc,KAAK,GAAG;AAAA,QAClE,CAAC;AAED,uCAA+B,MAAM,IAAI;AAAA,UACvC,gBAAgB;AAAA,UAChB,YAAY;AAAA,QACd;AAAA,MACF,CAAC;AAED,8BAAwB,GAAG,IAAI;AAE/B,YAAM,YAAY,SAAS,OAAO,WAAW;AAC3C,cAAM,YAAY,WAAW,QAAQ,QAAQ;AAC7C,cAAM,UAAU;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAEA,cAAM;AAAA,UACJ,QAAQ,wBAAwB,GAAG,GAAG,IAAI,SAAS,EAAE;AAAA,UACrD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { relative, resolve } from 'path';\nimport { parallelize } from '../../../utils/parallelize';\nimport type {\n LocalizedDictionaryOutput,\n LocalizedDictionaryResult,\n} from './writeDynamicDictionary';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryEntryPoint = (\n localedDictionariesPathsRecord: LocalizedDictionaryResult,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { fetchDictionariesDir } = configuration.content;\n const { liveSyncURL } = configuration.editor;\n\n let content = '';\n\n const formattedDictionaryMap: string = Object.entries(\n localedDictionariesPathsRecord\n )\n .map(([locale, dictionary]) => {\n const relativePath = normalizePath(\n relative(fetchDictionariesDir, dictionary.dictionaryPath)\n );\n\n if (format === 'esm') {\n return ` '${locale}': () => (async () => { try {return await fetch('${liveSyncURL}/dictionaries/${dictionary.dictionary.key}/${locale}').then(res => res.json())} catch (_error) {return await import('./${relativePath}', { assert: { type: 'json' }}).then(mod => mod.default)}})()`;\n }\n\n return ` '${locale}': () => (async () => { try {return await fetch('${liveSyncURL}/dictionaries/${dictionary.dictionary.key}/${locale}').then(res => res.json())} catch (_error) {return Promise.resolve(require('./${relativePath}'))}})()`;\n })\n .join(',\\n');\n\n content += `const content = {\\n${formattedDictionaryMap}\\n};\\n`;\n\n if (format === 'esm') content += `export default content;\\n`;\n if (format === 'cjs') content += `module.exports = content;\\n`;\n\n return content;\n};\n\n/**\n * Write the localized dictionaries to the dictionariesDir\n * @param mergedDictionaries - The merged dictionaries\n * @param configuration - The configuration\n * @returns The final dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);\n * console.log(finalDictionaries);\n *\n * // .intlayer/fetch_dictionaries/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeFetchDictionary = async (\n dynamicDictionaries: LocalizedDictionaryOutput,\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm']\n): Promise<LocalizedDictionaryOutput> => {\n const { fetchDictionariesDir } = configuration.content;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(fetchDictionariesDir), { recursive: true });\n\n let resultDictionariesPaths: LocalizedDictionaryOutput = {};\n\n // Write entry points for each dictionary in parallel\n await parallelize(\n Object.entries(dynamicDictionaries),\n async ([key, localedDictionariesPathsRecord]) => {\n if (key === 'undefined') return;\n\n await parallelize(formats, async (format) => {\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n const content = generateDictionaryEntryPoint(\n localedDictionariesPathsRecord,\n format,\n configuration\n );\n\n await writeFile(\n resolve(fetchDictionariesDir, `${key}.${extension}`),\n content\n );\n });\n }\n );\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,OAAO,iBAAiB;AACjC,SAAS,UAAU,eAAe;AAClC,SAAS,mBAAmB;AASrB,MAAM,+BAA+B,CAC1C,gCACA,SAAwB,OACxB,gBAAgB,iBAAiB,MACtB;AACX,QAAM,EAAE,qBAAqB,IAAI,cAAc;AAC/C,QAAM,EAAE,YAAY,IAAI,cAAc;AAEtC,MAAI,UAAU;AAEd,QAAM,yBAAiC,OAAO;AAAA,IAC5C;AAAA,EACF,EACG,IAAI,CAAC,CAAC,QAAQ,UAAU,MAAM;AAC7B,UAAM,eAAe;AAAA,MACnB,SAAS,sBAAsB,WAAW,cAAc;AAAA,IAC1D;AAEA,QAAI,WAAW,OAAO;AACpB,aAAO,MAAM,MAAM,oDAAoD,WAAW,iBAAiB,WAAW,WAAW,GAAG,IAAI,MAAM,sEAAsE,YAAY;AAAA,IAC1N;AAEA,WAAO,MAAM,MAAM,oDAAoD,WAAW,iBAAiB,WAAW,WAAW,GAAG,IAAI,MAAM,iFAAiF,YAAY;AAAA,EACrO,CAAC,EACA,KAAK,KAAK;AAEb,aAAW;AAAA,EAAsB,sBAAsB;AAAA;AAAA;AAEvD,MAAI,WAAW,MAAO,YAAW;AAAA;AACjC,MAAI,WAAW,MAAO,YAAW;AAAA;AAEjC,SAAO;AACT;AAkBO,MAAM,uBAAuB,OAClC,qBACA,gBAAgB,iBAAiB,GACjC,UAA6B,CAAC,OAAO,KAAK,MACH;AACvC,QAAM,EAAE,qBAAqB,IAAI,cAAc;AAG/C,QAAM,MAAM,QAAQ,oBAAoB,GAAG,EAAE,WAAW,KAAK,CAAC;AAE9D,MAAI,0BAAqD,CAAC;AAG1D,QAAM;AAAA,IACJ,OAAO,QAAQ,mBAAmB;AAAA,IAClC,OAAO,CAAC,KAAK,8BAA8B,MAAM;AAC/C,UAAI,QAAQ,YAAa;AAEzB,YAAM,YAAY,SAAS,OAAO,WAAW;AAC3C,cAAM,YAAY,WAAW,QAAQ,QAAQ;AAC7C,cAAM,UAAU;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAEA,cAAM;AAAA,UACJ,QAAQ,sBAAsB,GAAG,GAAG,IAAI,SAAS,EAAE;AAAA,UACnD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport { mergeDictionaries } from '../../../mergeDictionaries';\nimport { processPerLocaleDictionary } from '../../../processPerLocaleDictionary';\nimport { parallelize } from '../../../utils/parallelize';\nimport { formatDictionaryText } from './formatDictionaryText';\nimport { UnmergedDictionaryOutput } from './writeUnmergedDictionary';\n\nexport type MergedDictionaryResult = {\n dictionaryPath: string;\n dictionary: Dictionary;\n};\n\nexport type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;\n\n/**\n * Write the merged dictionaries to the dictionariesDir\n * @param groupedDictionaries - The grouped dictionaries\n * @param configuration - The configuration\n * @returns The merged dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);\n * console.log(finalDictionaries);\n *\n * // .intlayer/dictionary/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeMergedDictionaries = async (\n groupedDictionaries: UnmergedDictionaryOutput,\n configuration = getConfiguration()\n): Promise<MergedDictionaryOutput> => {\n const { dictionariesDir } = configuration.content;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionariesEntry]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n MergedDictionaryResult,\n ];\n }\n\n const multiLocaleDictionaries = dictionariesEntry.dictionaries.map(\n (dictionary) => processPerLocaleDictionary(dictionary)\n );\n\n const mergedDictionary = mergeDictionaries(multiLocaleDictionaries);\n\n const contentString = formatDictionaryText(mergedDictionary);\n\n const outputFileName = `${key}.json`;\n const resultFilePath = resolve(dictionariesDir, outputFileName);\n\n // Write the merged dictionary\n await writeFile(resultFilePath, contentString, 'utf8').catch((err) => {\n console.error(`Error creating merged ${outputFileName}:`, err);\n });\n\n return [\n key,\n {\n dictionaryPath: resultFilePath,\n dictionary: mergedDictionary,\n } as MergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<readonly [string, MergedDictionaryResult]>\n );\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AAEjC,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AA0B9B,MAAM,0BAA0B,OACrC,qBACA,gBAAgB,iBAAiB,MACG;AACpC,QAAM,EAAE,gBAAgB,IAAI,cAAc;AAG1C,QAAM,MAAM,QAAQ,eAAe,GAAG,EAAE,WAAW,KAAK,CAAC;AAEzD,QAAM,UAAU,MAAM;AAAA,IACpB,OAAO,QAAQ,mBAAmB;AAAA,IAClC,OAAO,CAAC,KAAK,iBAAiB,MAAM;AAClC,UAAI,QAAQ,aAAa;AACvB,eAAO;AAAA,MAIT;AAEA,YAAM,0BAA0B,kBAAkB,aAAa;AAAA,QAC7D,CAAC,eAAe,2BAA2B,UAAU;AAAA,MACvD;AAEA,YAAM,mBAAmB,kBAAkB,uBAAuB;AAElE,YAAM,gBAAgB,qBAAqB,gBAAgB;AAE3D,YAAM,iBAAiB,GAAG,GAAG;AAC7B,YAAM,iBAAiB,QAAQ,iBAAiB,cAAc;AAG9D,YAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,gBAAQ,MAAM,yBAAyB,cAAc,KAAK,GAAG;AAAA,MAC/D,CAAC;AAED,aAAO;AAAA,QACL;AAAA,QACA;AAAA,UACE,gBAAgB;AAAA,UAChB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,OAAO;AAAA,IACZ,QAAQ,OAAO,OAAO;AAAA,EACxB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport { Dictionary } from '@intlayer/core';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport { filterInvalidDictionaries } from '../../../filterInvalidDictionaries';\nimport { formatDistantDictionaries } from '../../../loadDictionaries';\nimport { parallelize } from '../../../utils/parallelize';\nimport { formatDictionaryText } from './formatDictionaryText';\n\n/**\n * Write the localized dictionaries to the dictionariesDir\n * @param mergedDictionaries - The merged dictionaries\n * @param configuration - The configuration\n * @returns The final dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);\n * console.log(finalDictionaries);\n *\n * // .intlayer/fetch_dictionaries/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeRemoteDictionary = async (\n remoteDictionaries: Dictionary[],\n configuration = getConfiguration()\n): Promise<Dictionary[]> => {\n const { remoteDictionariesDir } = configuration.content;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(remoteDictionariesDir), { recursive: true });\n\n const filteredDictionaries = filterInvalidDictionaries(remoteDictionaries);\n\n // Merge dictionaries with the same key and write to dictionariesDir\n await parallelize(\n filteredDictionaries.filter((dictionary) => dictionary.key !== 'undefined'),\n async (dictionary) => {\n const outputFileName = `${dictionary.key}.json`;\n const resultFilePath = resolve(remoteDictionariesDir, outputFileName);\n\n const contentString = formatDictionaryText(dictionary);\n\n // Write the merged dictionary\n await writeFile(resultFilePath, contentString, 'utf8').catch((err) => {\n console.error(`Error creating merged ${outputFileName}:`, err);\n });\n }\n );\n\n return formatDistantDictionaries(remoteDictionaries);\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AAEjC,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AACxB,SAAS,iCAAiC;AAC1C,SAAS,iCAAiC;AAC1C,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AAkB9B,MAAM,wBAAwB,OACnC,oBACA,gBAAgB,iBAAiB,MACP;AAC1B,QAAM,EAAE,sBAAsB,IAAI,cAAc;AAGhD,QAAM,MAAM,QAAQ,qBAAqB,GAAG,EAAE,WAAW,KAAK,CAAC;AAE/D,QAAM,uBAAuB,0BAA0B,kBAAkB;AAGzE,QAAM;AAAA,IACJ,qBAAqB,OAAO,CAAC,eAAe,WAAW,QAAQ,WAAW;AAAA,IAC1E,OAAO,eAAe;AACpB,YAAM,iBAAiB,GAAG,WAAW,GAAG;AACxC,YAAM,iBAAiB,QAAQ,uBAAuB,cAAc;AAEpE,YAAM,gBAAgB,qBAAqB,UAAU;AAGrD,YAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,gBAAQ,MAAM,yBAAyB,cAAc,KAAK,GAAG;AAAA,MAC/D,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,0BAA0B,kBAAkB;AACrD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.ts"],"sourcesContent":["import { getConfiguration, x } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport { filterInvalidDictionaries } from '../../../filterInvalidDictionaries';\nimport { orderDictionaries } from '../../../orderDictionaries';\nimport { parallelize } from '../../../utils/parallelize';\nimport { formatDictionaryText } from './formatDictionaryText';\n\nconst groupDictionariesByKey = (\n dictionaries: Dictionary[]\n): Record<string, Dictionary[]> =>\n dictionaries.reduce(\n (acc, dictionary) => {\n const key = dictionary.key;\n if (!acc[key]) {\n acc[key] = [];\n }\n acc[key].push(dictionary);\n return acc;\n },\n {} as Record<string, Dictionary[]>\n );\n\nexport type UnmergedDictionaryResult = {\n dictionaryPath: string;\n dictionaries: Dictionary[];\n};\n\nexport type UnmergedDictionaryOutput = Record<string, UnmergedDictionaryResult>;\n\n/**\n * Write the unmerged dictionaries to the unmergedDictionariesDir\n * @param dictionaries - The dictionaries to write\n * @param configuration - The configuration\n * @returns The grouped dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * console.log(unmergedDictionaries);\n *\n * // .intlayer/unmerged_dictionaries/home.json\n * // {\n * // [\n * // { key: 'home', content: { ... } },\n * // { key: 'home', content: { ... } },\n * // ],\n * // }\n * ```\n */\nexport const writeUnmergedDictionaries = async (\n dictionaries: Dictionary[],\n configuration = getConfiguration()\n): Promise<UnmergedDictionaryOutput> => {\n const { unmergedDictionariesDir } = configuration.content;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(unmergedDictionariesDir), { recursive: true });\n\n const filteredDictionaries = filterInvalidDictionaries(dictionaries);\n\n // Group dictionaries by key and write to unmergedDictionariesDir\n const groupedDictionaries = groupDictionariesByKey(filteredDictionaries);\n\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionaries]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n UnmergedDictionaryResult,\n ];\n }\n\n const orderedDictionaries = orderDictionaries(\n dictionaries,\n configuration\n );\n const contentString = formatDictionaryText(orderedDictionaries);\n\n const outputFileName = `${key}.json`;\n const unmergedFilePath = resolve(unmergedDictionariesDir, outputFileName);\n\n // Write the grouped dictionaries\n await writeFile(unmergedFilePath, contentString, 'utf8').catch((err) => {\n console.error(`${x} Error creating unmerged ${outputFileName}:`, err);\n });\n\n return [\n key,\n {\n dictionaryPath: unmergedFilePath,\n dictionaries: dictionaries,\n } as UnmergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<\n readonly [string, UnmergedDictionaryResult]\n >\n );\n};\n"],"mappings":"AAAA,SAAS,kBAAkB,SAAS;AAEpC,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AACxB,SAAS,iCAAiC;AAC1C,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AAErC,MAAM,yBAAyB,CAC7B,iBAEA,aAAa;AAAA,EACX,CAAC,KAAK,eAAe;AACnB,UAAM,MAAM,WAAW;AACvB,QAAI,CAAC,IAAI,GAAG,GAAG;AACb,UAAI,GAAG,IAAI,CAAC;AAAA,IACd;AACA,QAAI,GAAG,EAAE,KAAK,UAAU;AACxB,WAAO;AAAA,EACT;AAAA,EACA,CAAC;AACH;AA6BK,MAAM,4BAA4B,OACvC,cACA,gBAAgB,iBAAiB,MACK;AACtC,QAAM,EAAE,wBAAwB,IAAI,cAAc;AAGlD,QAAM,MAAM,QAAQ,uBAAuB,GAAG,EAAE,WAAW,KAAK,CAAC;AAEjE,QAAM,uBAAuB,0BAA0B,YAAY;AAGnE,QAAM,sBAAsB,uBAAuB,oBAAoB;AAEvE,QAAM,UAAU,MAAM;AAAA,IACpB,OAAO,QAAQ,mBAAmB;AAAA,IAClC,OAAO,CAAC,KAAKA,aAAY,MAAM;AAC7B,UAAI,QAAQ,aAAa;AACvB,eAAO;AAAA,MAIT;AAEA,YAAM,sBAAsB;AAAA,QAC1BA;AAAA,QACA;AAAA,MACF;AACA,YAAM,gBAAgB,qBAAqB,mBAAmB;AAE9D,YAAM,iBAAiB,GAAG,GAAG;AAC7B,YAAM,mBAAmB,QAAQ,yBAAyB,cAAc;AAGxE,YAAM,UAAU,kBAAkB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACtE,gBAAQ,MAAM,GAAG,CAAC,4BAA4B,cAAc,KAAK,GAAG;AAAA,MACtE,CAAC;AAED,aAAO;AAAA,QACL;AAAA,QACA;AAAA,UACE,gBAAgB;AAAA,UAChB,cAAcA;AAAA,QAChB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,OAAO;AAAA,IACZ,QAAQ,OAAO,OAAO;AAAA,EAGxB;AACF;","names":["dictionaries"]}
|
package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config";
|
|
2
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
const { content } = getConfiguration();
|
|
5
|
-
const { reactIntlMessagesDir } = content;
|
|
6
|
-
const writeDictionary = async (dictionariesDeclaration) => {
|
|
7
|
-
const resultDictionariesPaths = [];
|
|
8
|
-
for (const [nameSpace, localContent] of Object.entries(
|
|
9
|
-
dictionariesDeclaration
|
|
10
|
-
)) {
|
|
11
|
-
for await (const [locale, content2] of Object.entries(localContent)) {
|
|
12
|
-
const contentString = JSON.stringify(content2);
|
|
13
|
-
const outputFileName = `${nameSpace}.json`;
|
|
14
|
-
const dictionariesDirPath = resolve(reactIntlMessagesDir, locale);
|
|
15
|
-
const resultFilePath = resolve(dictionariesDirPath, outputFileName);
|
|
16
|
-
await mkdir(dictionariesDirPath, { recursive: true });
|
|
17
|
-
await writeFile(resultFilePath, contentString, "utf8").catch((err) => {
|
|
18
|
-
console.error(`Error creating ${outputFileName}:`, err);
|
|
19
|
-
});
|
|
20
|
-
resultDictionariesPaths.push(resultFilePath);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return resultDictionariesPaths;
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
writeDictionary
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=writeDictionary.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport type { I18nextDictionariesOutput } from '../i18next_dictionary/convertContentDeclarationInto18nDictionaries';\n\nconst { content } = getConfiguration();\nconst { reactIntlMessagesDir } = content;\n\nexport type DictionariesDeclaration = Record<string, I18nextDictionariesOutput>;\n\n/**\n * This function writes the dictionaries to the file system\n */\nexport const writeDictionary = async (\n dictionariesDeclaration: DictionariesDeclaration\n) => {\n const resultDictionariesPaths: string[] = [];\n\n for (const [nameSpace, localContent] of Object.entries(\n dictionariesDeclaration\n )) {\n for await (const [locale, content] of Object.entries(localContent)) {\n const contentString = JSON.stringify(content);\n\n const outputFileName = `${nameSpace}.json`;\n const dictionariesDirPath = resolve(reactIntlMessagesDir, locale);\n const resultFilePath = resolve(dictionariesDirPath, outputFileName);\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(dictionariesDirPath, { recursive: true });\n\n // Create the json file\n await writeFile(resultFilePath, contentString, 'utf8').catch((err) => {\n console.error(`Error creating ${outputFileName}:`, err);\n });\n\n resultDictionariesPaths.push(resultFilePath);\n }\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AAGxB,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AACrC,MAAM,EAAE,qBAAqB,IAAI;AAO1B,MAAM,kBAAkB,OAC7B,4BACG;AACH,QAAM,0BAAoC,CAAC;AAE3C,aAAW,CAAC,WAAW,YAAY,KAAK,OAAO;AAAA,IAC7C;AAAA,EACF,GAAG;AACD,qBAAiB,CAAC,QAAQA,QAAO,KAAK,OAAO,QAAQ,YAAY,GAAG;AAClE,YAAM,gBAAgB,KAAK,UAAUA,QAAO;AAE5C,YAAM,iBAAiB,GAAG,SAAS;AACnC,YAAM,sBAAsB,QAAQ,sBAAsB,MAAM;AAChE,YAAM,iBAAiB,QAAQ,qBAAqB,cAAc;AAGlE,YAAM,MAAM,qBAAqB,EAAE,WAAW,KAAK,CAAC;AAGpD,YAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,gBAAQ,MAAM,kBAAkB,cAAc,KAAK,GAAG;AAAA,MACxD,CAAC;AAED,8BAAwB,KAAK,cAAc;AAAA,IAC7C;AAAA,EACF;AAEA,SAAO;AACT;","names":["content"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaryKeysAndUpdateTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzE,eAAO,MAAM,4CAA4C,GACvD,gBAAe,cAAmC,KACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBhC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Dictionary } from '@intlayer/core';
|
|
2
|
-
/**
|
|
3
|
-
* This function transpile content declaration to i18n dictionaries
|
|
4
|
-
*/
|
|
5
|
-
export declare const buildI18nDictionary: (contentDeclarations: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<string[]>;
|
|
6
|
-
//# sourceMappingURL=buildI18nextDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildI18nextDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,qBAAqB,UAAU,EAAE,EACjC,yDAAkC,sBAqBnC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Locales } from '@intlayer/config';
|
|
2
|
-
import { type ContentNode } from '@intlayer/core';
|
|
3
|
-
type Dictionary = Record<string, unknown>;
|
|
4
|
-
export type I18nextDictionariesOutput = Partial<Record<Locales, Dictionary>>;
|
|
5
|
-
export declare const createI18nextDictionaries: (content: ContentNode, configuration?: import("@intlayer/config").IntlayerConfig) => I18nextDictionariesOutput;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=convertContentDeclarationInto18nDictionaries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertContentDeclarationInto18nDictionaries.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1C,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAsF7E,eAAO,MAAM,yBAAyB,GACpC,SAAS,WAAW,EACpB,yDAAkC,KACjC,yBAaF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertPluralsValues.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertPluralsValues.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,GAAG,MAAM,KAAG,MAS9D,CAAC"}
|
package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
package/dist/types/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { I18nextDictionariesOutput } from './convertContentDeclarationInto18nDictionaries';
|
|
2
|
-
export type DictionariesDeclaration = Record<string, I18nextDictionariesOutput>;
|
|
3
|
-
/**
|
|
4
|
-
* This function writes the dictionaries to the file system
|
|
5
|
-
*/
|
|
6
|
-
export declare const writeDictionary: (dictionariesDeclaration: DictionariesDeclaration, configuration?: import("@intlayer/config").IntlayerConfig) => Promise<string[]>;
|
|
7
|
-
//# sourceMappingURL=writeDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAEhG,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,yBAAyB,uBAAuB,EAChD,yDAAkC,sBA6BnC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Dictionary } from '@intlayer/core';
|
|
2
|
-
export declare const buildDictionary: (dictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<{
|
|
3
|
-
unmergedDictionaries: import("./intlayer_dictionary/writeUnmergedDictionary").UnmergedDictionaryOutput;
|
|
4
|
-
mergedDictionaries: import("./intlayer_dictionary/writeMergedDictionary").MergedDictionaryOutput;
|
|
5
|
-
dynamicDictionaries: import("./intlayer_dictionary/writeDynamicDictionary").LocalizedDictionaryOutput;
|
|
6
|
-
fetchDictionaries: import("./intlayer_dictionary/writeDynamicDictionary").LocalizedDictionaryOutput;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/declaration_file_to_dictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,eAAe,GAC1B,cAAc,UAAU,EAAE,EAC1B,yDAAkC;;;;;EAWnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildIntlayerDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,0BAA0B,UAAU,EAAE,EACtC,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB;;;;;EAwC5C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatDictionaryText.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/formatDictionaryText.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,GAAI,YAAY,MAAM,WAGvB,CAAC"}
|
package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processContentDeclaration.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACpC,oBAAoB,UAAU,KAC7B,OAAO,CAAC,UAAU,GAAG,SAAS,CAehC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeDynamicDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,MAAM,EACN,yBAAyB,CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GACjC,oBAAoB,sBAAsB,EAC1C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CAiEnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeFetchDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAC/B,qBAAqB,yBAAyB,EAC9C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CA+BnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeMergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,wBAAwB,EAC7C,yDAAkC,KACjC,OAAO,CAAC,sBAAsB,CA6ChC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeRemoteDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAChC,oBAAoB,UAAU,EAAE,EAChC,yDAAkC,KACjC,OAAO,CAAC,UAAU,EAAE,CAyBtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeUnmergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAuBjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,UAAU,EAAE,EAC1B,yDAAkC,KACjC,OAAO,CAAC,wBAAwB,CAkDlC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { I18nextDictionariesOutput } from '../i18next_dictionary/convertContentDeclarationInto18nDictionaries';
|
|
2
|
-
export type DictionariesDeclaration = Record<string, I18nextDictionariesOutput>;
|
|
3
|
-
/**
|
|
4
|
-
* This function writes the dictionaries to the file system
|
|
5
|
-
*/
|
|
6
|
-
export declare const writeDictionary: (dictionariesDeclaration: DictionariesDeclaration) => Promise<string[]>;
|
|
7
|
-
//# sourceMappingURL=writeDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oEAAoE,CAAC;AAKpH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,yBAAyB,uBAAuB,sBA2BjD,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|