@intlayer/chokidar 2.0.13 → 3.0.1
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 +18 -26
- package/dist/cjs/chokidar/watcher.cjs.map +1 -1
- package/dist/cjs/fetchDistantDictionaries.cjs +101 -0
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -0
- package/dist/cjs/fetchDistantDictionaryKeys.cjs +50 -0
- package/dist/cjs/fetchDistantDictionaryKeys.cjs.map +1 -0
- package/dist/cjs/index.cjs +10 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/index.cjs +29 -0
- package/dist/cjs/loadDictionaries/index.cjs.map +1 -0
- package/dist/cjs/{transpiler/declaration_file_to_dictionary/intlayer_dictionary → loadDictionaries}/loadContentDeclaration.cjs +23 -7
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +86 -0
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -0
- package/dist/cjs/{transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.cjs → loadDictionaries/loadDistantDictionaries.cjs} +15 -22
- package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +51 -0
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -0
- package/dist/cjs/log.cjs +255 -0
- package/dist/cjs/log.cjs.map +1 -0
- package/dist/cjs/mergeDictionaries.cjs +62 -0
- package/dist/cjs/mergeDictionaries.cjs.map +1 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.cjs +13 -49
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.cjs +52 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/index.cjs +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/index.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs +4 -37
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.cjs +0 -2
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.cjs +8 -10
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs +46 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs +8 -9
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +1 -1
- package/dist/esm/chokidar/watcher.mjs +18 -16
- package/dist/esm/chokidar/watcher.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaries.mjs +67 -0
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -0
- package/dist/esm/fetchDistantDictionaryKeys.mjs +26 -0
- package/dist/esm/fetchDistantDictionaryKeys.mjs.map +1 -0
- package/dist/esm/index.mjs +10 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/index.mjs +5 -0
- package/dist/esm/loadDictionaries/index.mjs.map +1 -0
- package/dist/esm/{transpiler/declaration_file_to_dictionary/intlayer_dictionary → loadDictionaries}/loadContentDeclaration.mjs +22 -5
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +52 -0
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +14 -0
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +27 -0
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -0
- package/dist/esm/log.mjs +221 -0
- package/dist/esm/log.mjs.map +1 -0
- package/dist/esm/mergeDictionaries.mjs +28 -0
- package/dist/esm/mergeDictionaries.mjs.map +1 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.mjs +15 -54
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.mjs +28 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/index.mjs +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/index.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs +5 -38
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs +8 -10
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs +22 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs +9 -9
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +1 -1
- package/dist/types/chokidar/index.d.ts +2 -0
- package/dist/types/chokidar/index.d.ts.map +1 -0
- package/dist/types/chokidar/watcher.d.ts +4 -0
- package/dist/types/chokidar/watcher.d.ts.map +1 -0
- package/dist/types/fetchDistantDictionaries.d.ts +12 -0
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -0
- package/dist/types/fetchDistantDictionaryKeys.d.ts +2 -0
- package/dist/types/fetchDistantDictionaryKeys.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/loadDictionaries/index.d.ts +5 -0
- package/dist/types/loadDictionaries/index.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +3 -0
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +3 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts +8 -0
- package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +3 -0
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
- package/dist/types/log.d.ts +40 -0
- package/dist/types/log.d.ts.map +1 -0
- package/dist/types/mergeDictionaries.d.ts +5 -0
- package/dist/types/mergeDictionaries.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.d.ts +6 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.d.ts +7 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertPluralsValues.d.ts +2 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertPluralsValues.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/index.d.ts +2 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/index.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.d.ts +7 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts +3 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts +6 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts +3 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.d.ts +6 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts +3 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/dictionary_to_main/createDictionaryList.d.ts +5 -0
- package/dist/types/transpiler/dictionary_to_main/createDictionaryList.d.ts.map +1 -0
- package/dist/types/transpiler/dictionary_to_main/index.d.ts +2 -0
- package/dist/types/transpiler/dictionary_to_main/index.d.ts.map +1 -0
- package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts +6 -0
- package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +1 -0
- package/dist/types/transpiler/dictionary_to_type/createType.d.ts +6 -0
- package/dist/types/transpiler/dictionary_to_type/createType.d.ts.map +1 -0
- package/dist/types/transpiler/dictionary_to_type/index.d.ts +3 -0
- package/dist/types/transpiler/dictionary_to_type/index.d.ts.map +1 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +32 -16
- package/dist/cjs/chokidar/index.d.ts +0 -2
- package/dist/cjs/chokidar/watcher.d.ts +0 -5
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.d.ts +0 -6
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.d.ts +0 -8
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertPluralsValues.d.ts +0 -3
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18n_dictionary/index.d.ts +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/index.d.ts +0 -3
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts +0 -6
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.d.ts +0 -44
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts +0 -4
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/loadContentDeclaration.cjs.map +0 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/loadContentDeclaration.d.ts +0 -10
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.d.ts +0 -8
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.d.ts +0 -6
- package/dist/cjs/transpiler/dictionary_to_main/index.d.ts +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.d.ts +0 -7
- package/dist/cjs/transpiler/dictionary_to_type/createType.d.ts +0 -7
- package/dist/cjs/transpiler/dictionary_to_type/index.d.ts +0 -2
- package/dist/cjs/utils.d.ts +0 -4
- package/dist/esm/chokidar/index.d.mts +0 -2
- package/dist/esm/chokidar/watcher.d.mts +0 -5
- package/dist/esm/index.d.mts +0 -4
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.d.mts +0 -6
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.d.mts +0 -8
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertPluralsValues.d.mts +0 -3
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18n_dictionary/index.d.mts +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/index.d.mts +0 -3
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.mts +0 -6
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.d.mts +0 -44
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.mjs +0 -21
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/extractNestedJSON.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.mts +0 -4
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/loadContentDeclaration.d.mts +0 -10
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/loadContentDeclaration.mjs.map +0 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.d.mts +0 -8
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.d.mts +0 -6
- package/dist/esm/transpiler/dictionary_to_main/index.d.mts +0 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.d.mts +0 -7
- package/dist/esm/transpiler/dictionary_to_type/createType.d.mts +0 -7
- package/dist/esm/transpiler/dictionary_to_type/index.d.mts +0 -2
- package/dist/esm/utils.d.mts +0 -4
|
@@ -1,46 +1,13 @@
|
|
|
1
|
-
import { mkdir
|
|
1
|
+
import { mkdir } from "fs/promises";
|
|
2
2
|
import { resolve } from "path";
|
|
3
3
|
import { getConfiguration } from "@intlayer/config";
|
|
4
|
-
import {
|
|
5
|
-
import { processContentDeclaration } from './processContentDeclaration.mjs';
|
|
4
|
+
import { writeDictionary } from './writeDictionary.mjs';
|
|
6
5
|
const { content } = getConfiguration();
|
|
7
6
|
const { dictionariesDir } = content;
|
|
8
|
-
const
|
|
9
|
-
const resultDictionariesPaths = [];
|
|
10
|
-
for await (const dictionaryContent of dictionaries) {
|
|
11
|
-
const contentString = JSON.stringify(dictionaryContent);
|
|
12
|
-
const id = dictionaryContent.id;
|
|
13
|
-
const outputFileName = `${id}.json`;
|
|
14
|
-
const resultFilePath = resolve(dictionariesDir, outputFileName);
|
|
15
|
-
await writeFile(resultFilePath, contentString, "utf8").catch((err) => {
|
|
16
|
-
console.error(`Error creating ${outputFileName}:`, err);
|
|
17
|
-
});
|
|
18
|
-
resultDictionariesPaths.push(resultFilePath);
|
|
19
|
-
}
|
|
20
|
-
return resultDictionariesPaths;
|
|
21
|
-
};
|
|
22
|
-
const buildIntlayerDictionary = async (contentDeclarationsPaths) => {
|
|
23
|
-
const resultDictionariesPaths = [];
|
|
24
|
-
if (typeof contentDeclarationsPaths === "string") {
|
|
25
|
-
contentDeclarationsPaths = [contentDeclarationsPaths];
|
|
26
|
-
}
|
|
7
|
+
const buildIntlayerDictionary = async (contentDeclarations) => {
|
|
27
8
|
await mkdir(resolve(dictionariesDir), { recursive: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!result) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
const nestedContent = extractObjectsWithId(result);
|
|
34
|
-
const contentWithFilePath = nestedContent.map(
|
|
35
|
-
(content2) => ({
|
|
36
|
-
...content2,
|
|
37
|
-
filePath: contentDeclarationPath
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
const dictionariesPaths = await writeDictionary(contentWithFilePath);
|
|
41
|
-
resultDictionariesPaths.push(...dictionariesPaths);
|
|
42
|
-
}
|
|
43
|
-
return resultDictionariesPaths;
|
|
9
|
+
const dictionariesPaths = await writeDictionary(contentDeclarations);
|
|
10
|
+
return dictionariesPaths;
|
|
44
11
|
};
|
|
45
12
|
export {
|
|
46
13
|
buildIntlayerDictionary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"sourcesContent":["import { mkdir
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"sourcesContent":["import { mkdir } from 'fs/promises';\nimport { resolve } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { writeDictionary } from './writeDictionary';\n\nconst { content } = getConfiguration();\nconst { dictionariesDir } = content;\n\n/**\n * This function transpile the bundled code to to make dictionaries as JSON files\n */\nexport const buildIntlayerDictionary = async (\n contentDeclarations: Dictionary[]\n) => {\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const dictionariesPaths: string[] =\n await writeDictionary(contentDeclarations);\n\n return dictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,wBAAwB;AAEjC,SAAS,uBAAuB;AAEhC,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AACrC,MAAM,EAAE,gBAAgB,IAAI;AAKrB,MAAM,0BAA0B,OACrC,wBACG;AAEH,QAAM,MAAM,QAAQ,eAAe,GAAG,EAAE,WAAW,KAAK,CAAC;AAEzD,QAAM,oBACJ,MAAM,gBAAgB,mBAAmB;AAE3C,SAAO;AACT;","names":[]}
|
package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.ts"],"sourcesContent":["export * from './
|
|
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,5 +1,3 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { loadContentDeclaration } from './loadContentDeclaration.mjs';
|
|
3
1
|
const processFunctionResults = async (entry) => {
|
|
4
2
|
if (entry && typeof entry === "object") {
|
|
5
3
|
const promises = [];
|
|
@@ -32,15 +30,15 @@ const processFunctionResults = async (entry) => {
|
|
|
32
30
|
}
|
|
33
31
|
return entry;
|
|
34
32
|
};
|
|
35
|
-
const processContentDeclaration = async (
|
|
33
|
+
const processContentDeclaration = async (contentDeclaration) => {
|
|
36
34
|
try {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
const content = await processFunctionResults(
|
|
36
|
+
contentDeclaration.content
|
|
37
|
+
);
|
|
38
|
+
return {
|
|
39
|
+
...contentDeclaration,
|
|
40
|
+
content
|
|
41
|
+
};
|
|
44
42
|
} catch (error) {
|
|
45
43
|
console.error("Error processing module:", error);
|
|
46
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.ts"],"sourcesContent":["import type {\n Content,\n DeclarationContent,\n Dictionary,\n FlatContent,\n FlatContentValue,\n} from '@intlayer/core';\n\n/**\n * Function to replace function and async function fields with their results in the object\n */\nconst processFunctionResults = async (entry: Content): Promise<FlatContent> => {\n if (entry && typeof entry === 'object') {\n const promises: Promise<void>[] = [];\n const result: FlatContent = {};\n\n for (const key of Object.keys(entry)) {\n const field = entry?.[key];\n const isArray = Array.isArray(field);\n\n if (typeof field === 'object' && isArray) {\n result[key] = (await Promise.all(\n field.map(async (el) => {\n return await processFunctionResults(el as Content);\n })\n )) as unknown as FlatContentValue;\n } else if (typeof field === 'object') {\n result[key] = (await processFunctionResults(\n field as Content\n )) as FlatContentValue;\n } else if (typeof field === 'function') {\n // Wait for the function to resolve if it's an async function\n const promise = (async () => {\n // Execute the function and await the result if it's a Promise\n const value = await field();\n\n result[key] = value as FlatContentValue;\n })();\n promises.push(promise);\n } else {\n result[key] = field as FlatContentValue;\n }\n }\n\n // Wait for all async operations to complete\n await Promise.all(promises);\n\n return result;\n }\n\n return entry as FlatContent;\n};\n\n/**\n * Function to load, process the module and return the Intlayer DeclarationContent from the module file\n */\nexport const processContentDeclaration = async (\n contentDeclaration: DeclarationContent\n): Promise<Dictionary | undefined> => {\n try {\n const content = (await processFunctionResults(\n contentDeclaration.content\n )) as DeclarationContent['content'];\n\n return {\n ...contentDeclaration,\n content,\n } as Dictionary;\n } catch (error) {\n console.error('Error processing module:', error);\n }\n};\n"],"mappings":"AAWA,MAAM,yBAAyB,OAAO,UAAyC;AAC7E,MAAI,SAAS,OAAO,UAAU,UAAU;AACtC,UAAM,WAA4B,CAAC;AACnC,UAAM,SAAsB,CAAC;AAE7B,eAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AACpC,YAAM,QAAQ,QAAQ,GAAG;AACzB,YAAM,UAAU,MAAM,QAAQ,KAAK;AAEnC,UAAI,OAAO,UAAU,YAAY,SAAS;AACxC,eAAO,GAAG,IAAK,MAAM,QAAQ;AAAA,UAC3B,MAAM,IAAI,OAAO,OAAO;AACtB,mBAAO,MAAM,uBAAuB,EAAa;AAAA,UACnD,CAAC;AAAA,QACH;AAAA,MACF,WAAW,OAAO,UAAU,UAAU;AACpC,eAAO,GAAG,IAAK,MAAM;AAAA,UACnB;AAAA,QACF;AAAA,MACF,WAAW,OAAO,UAAU,YAAY;AAEtC,cAAM,WAAW,YAAY;AAE3B,gBAAM,QAAQ,MAAM,MAAM;AAE1B,iBAAO,GAAG,IAAI;AAAA,QAChB,GAAG;AACH,iBAAS,KAAK,OAAO;AAAA,MACvB,OAAO;AACL,eAAO,GAAG,IAAI;AAAA,MAChB;AAAA,IACF;AAGA,UAAM,QAAQ,IAAI,QAAQ;AAE1B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,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,YAAQ,MAAM,4BAA4B,KAAK;AAAA,EACjD;AACF;","names":[]}
|
package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { writeFile } from "fs/promises";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import { getConfiguration } from "@intlayer/config";
|
|
4
|
+
const { dictionariesDir } = getConfiguration().content;
|
|
5
|
+
const writeDictionary = async (dictionaries) => {
|
|
6
|
+
const resultDictionariesPaths = [];
|
|
7
|
+
for await (const dictionaryContent of dictionaries) {
|
|
8
|
+
const contentString = JSON.stringify(dictionaryContent);
|
|
9
|
+
const id = dictionaryContent.key;
|
|
10
|
+
const outputFileName = `${id}.json`;
|
|
11
|
+
const resultFilePath = resolve(dictionariesDir, outputFileName);
|
|
12
|
+
await writeFile(resultFilePath, contentString, "utf8").catch((err) => {
|
|
13
|
+
console.error(`Error creating ${outputFileName}:`, err);
|
|
14
|
+
});
|
|
15
|
+
resultDictionariesPaths.push(resultFilePath);
|
|
16
|
+
}
|
|
17
|
+
return resultDictionariesPaths;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
writeDictionary
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=writeDictionary.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.ts"],"sourcesContent":["import { writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\n\nconst { dictionariesDir } = getConfiguration().content;\n\nexport const writeDictionary = async (dictionaries: Dictionary[]) => {\n const resultDictionariesPaths: string[] = [];\n\n for await (const dictionaryContent of dictionaries) {\n const contentString = JSON.stringify(dictionaryContent);\n\n const id = dictionaryContent.key;\n const outputFileName = `${id}.json`;\n const resultFilePath = resolve(dictionariesDir, outputFileName);\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 return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,wBAAwB;AAGjC,MAAM,EAAE,gBAAgB,IAAI,iBAAiB,EAAE;AAExC,MAAM,kBAAkB,OAAO,iBAA+B;AACnE,QAAM,0BAAoC,CAAC;AAE3C,mBAAiB,qBAAqB,cAAc;AAClD,UAAM,gBAAgB,KAAK,UAAU,iBAAiB;AAEtD,UAAM,KAAK,kBAAkB;AAC7B,UAAM,iBAAiB,GAAG,EAAE;AAC5B,UAAM,iBAAiB,QAAQ,iBAAiB,cAAc;AAG9D,UAAM,UAAU,gBAAgB,eAAe,MAAM,EAAE,MAAM,CAAC,QAAQ;AACpE,cAAQ,MAAM,kBAAkB,cAAc,KAAK,GAAG;AAAA,IACxD,CAAC;AAED,4BAAwB,KAAK,cAAc;AAAA,EAC7C;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -8,7 +8,7 @@ const { typesDir, moduleAugmentationDir } = content;
|
|
|
8
8
|
const { locales, strictMode } = internationalization;
|
|
9
9
|
const getTypeName = (id) => transformToCamelCase(`${id}Content`);
|
|
10
10
|
const generateTypeIndexContent = (typeFiles) => {
|
|
11
|
-
let content2 = "/* eslint-disable */\nimport { Locales } from 'intlayer'
|
|
11
|
+
let content2 = "/* eslint-disable */\nimport { Locales } from 'intlayer';\n";
|
|
12
12
|
const dictionariesRef = typeFiles.map((dictionaryPath) => ({
|
|
13
13
|
relativePath: relative(moduleAugmentationDir, dictionaryPath),
|
|
14
14
|
id: basename(dictionaryPath, ".d.ts"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { basename, join, relative } from 'path';\nimport { Locales, getConfiguration } from '@intlayer/config';\nimport { sync } from 'glob';\nimport { getFileHash, transformToCamelCase } from '../../utils';\n\nconst { content, internationalization } = getConfiguration();\nconst { typesDir, moduleAugmentationDir } = content;\nconst { locales, strictMode } = internationalization;\n\nexport const getTypeName = (id: string): string =>\n transformToCamelCase(`${id}Content`);\n\n/**\n * This function generates the content of the module augmentation file\n */\nconst generateTypeIndexContent = (typeFiles: string[]): string => {\n let content = \"/* eslint-disable */\\nimport { Locales } from 'intlayer'
|
|
1
|
+
{"version":3,"sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { basename, join, relative } from 'path';\nimport { Locales, getConfiguration } from '@intlayer/config';\nimport { sync } from 'glob';\nimport { getFileHash, transformToCamelCase } from '../../utils';\n\nconst { content, internationalization } = getConfiguration();\nconst { typesDir, moduleAugmentationDir } = content;\nconst { locales, strictMode } = internationalization;\n\nexport const getTypeName = (id: string): string =>\n transformToCamelCase(`${id}Content`);\n\n/**\n * This function generates the content of the module augmentation file\n */\nconst generateTypeIndexContent = (typeFiles: string[]): string => {\n let content = \"/* eslint-disable */\\nimport { Locales } from 'intlayer';\\n\";\n\n const dictionariesRef = typeFiles.map((dictionaryPath) => ({\n relativePath: relative(moduleAugmentationDir, dictionaryPath),\n id: basename(dictionaryPath, '.d.ts'), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n const typeName = getTypeName(dictionary.id);\n content += `import type { ${typeName} as ${dictionary.hash} } from '${dictionary.relativePath}';\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash};`)\n .join('\\n');\n\n const formatLocales = locales\n .map((locale) => {\n for (const key in Locales) {\n if (Locales[key as keyof typeof Locales] === locale) {\n return `Locales.${key}`;\n }\n }\n })\n .join(' | ');\n\n const strictModeRecord =\n strictMode === 'strict'\n ? `interface IConfigLocales<Content> extends Record<ExtractedLocales, Content> {}`\n : strictMode === 'required_only'\n ? `interface IConfigLocales<Content> extends Record<ExtractedLocales, Content>, Partial<Record<ExcludedLocales, Content>> {}`\n : `interface IConfigLocales<Content> extends Partial<Record<Locales, Content>> {}`;\n\n /**\n * Write the module augmentation to extend the intlayer module with the dictionaries types\n * Will suggest the type resulting of the dictionaries\n *\n * declare module 'intlayer' {\n * interface IntlayerDictionaryTypesConnector = {\n * dictionaries: {\n * id: DictionaryType;\n * }\n * }\n *\n * type ConfigLocales = Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH;\n * type ExtractedLocales = Extract<Locales, ConfigLocales>;\n * type ExcludedLocales = Exclude<Locales, ConfigLocales>;\n *\n * interface IConfigLocales<Content> extends Record<ExtractedLocales, Content>, Partial<Record<ExcludedLocales, Content>> {}\n *\n *\n * }\n * See https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\n */\n content += `declare module 'intlayer' {\\n`;\n content += ` interface IntlayerDictionaryTypesConnector {\\n${formattedDictionaryMap}\\n }\\n\\n`;\n content += ` type ConfigLocales = ${formatLocales};\\n`;\n content += ` type ExtractedLocales = Extract<Locales, ConfigLocales>;\\n`;\n content += ` type ExcludedLocales = Exclude<Locales, ConfigLocales>;\\n\\n`;\n content += ` ${strictModeRecord}\\n`;\n content += `}`;\n\n return content;\n};\n\n/**\n * This function generates a index file merging all the types\n */\nexport const createModuleAugmentation = () => {\n // Create main directory if it doesn't exist\n if (!existsSync(moduleAugmentationDir)) {\n mkdirSync(moduleAugmentationDir, { recursive: true });\n }\n\n const dictionaries: string[] = sync(`${typesDir}/**/*.d.ts`);\n // Create the dictionary list file\n\n const tsContent = generateTypeIndexContent(dictionaries);\n writeFileSync(join(moduleAugmentationDir, 'intlayer.d.ts'), tsContent);\n};\n"],"mappings":"AAAA,SAAS,YAAY,WAAW,qBAAqB;AACrD,SAAS,UAAU,MAAM,gBAAgB;AACzC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,YAAY;AACrB,SAAS,aAAa,4BAA4B;AAElD,MAAM,EAAE,SAAS,qBAAqB,IAAI,iBAAiB;AAC3D,MAAM,EAAE,UAAU,sBAAsB,IAAI;AAC5C,MAAM,EAAE,SAAS,WAAW,IAAI;AAEzB,MAAM,cAAc,CAAC,OAC1B,qBAAqB,GAAG,EAAE,SAAS;AAKrC,MAAM,2BAA2B,CAAC,cAAgC;AAChE,MAAIA,WAAU;AAEd,QAAM,kBAAkB,UAAU,IAAI,CAAC,oBAAoB;AAAA,IACzD,cAAc,SAAS,uBAAuB,cAAc;AAAA,IAC5D,IAAI,SAAS,gBAAgB,OAAO;AAAA;AAAA,IACpC,MAAM,IAAI,YAAY,cAAc,CAAC;AAAA;AAAA,EACvC,EAAE;AAGF,kBAAgB,QAAQ,CAAC,eAAe;AACtC,UAAM,WAAW,YAAY,WAAW,EAAE;AAC1C,IAAAA,YAAW,iBAAiB,QAAQ,OAAO,WAAW,IAAI,YAAY,WAAW,YAAY;AAAA;AAAA,EAC/F,CAAC;AAED,EAAAA,YAAW;AAGX,QAAM,yBAAiC,gBACpC,IAAI,CAAC,eAAe,QAAQ,WAAW,EAAE,MAAM,WAAW,IAAI,GAAG,EACjE,KAAK,IAAI;AAEZ,QAAM,gBAAgB,QACnB,IAAI,CAAC,WAAW;AACf,eAAW,OAAO,SAAS;AACzB,UAAI,QAAQ,GAA2B,MAAM,QAAQ;AACnD,eAAO,WAAW,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC,EACA,KAAK,KAAK;AAEb,QAAM,mBACJ,eAAe,WACX,mFACA,eAAe,kBACb,8HACA;AAuBR,EAAAA,YAAW;AAAA;AACX,EAAAA,YAAW;AAAA,EAAmD,sBAAsB;AAAA;AAAA;AAAA;AACpF,EAAAA,YAAW,0BAA0B,aAAa;AAAA;AAClD,EAAAA,YAAW;AAAA;AACX,EAAAA,YAAW;AAAA;AAAA;AACX,EAAAA,YAAW,KAAK,gBAAgB;AAAA;AAChC,EAAAA,YAAW;AAEX,SAAOA;AACT;AAKO,MAAM,2BAA2B,MAAM;AAE5C,MAAI,CAAC,WAAW,qBAAqB,GAAG;AACtC,cAAU,uBAAuB,EAAE,WAAW,KAAK,CAAC;AAAA,EACtD;AAEA,QAAM,eAAyB,KAAK,GAAG,QAAQ,YAAY;AAG3D,QAAM,YAAY,yBAAyB,YAAY;AACvD,gBAAc,KAAK,uBAAuB,eAAe,GAAG,SAAS;AACvE;","names":["content"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
2
|
-
import { createRequire } from "module";
|
|
3
2
|
import { resolve } from "path";
|
|
4
|
-
import { getConfiguration } from "@intlayer/config";
|
|
3
|
+
import { getConfiguration, ESMxCJSRequire } from "@intlayer/config";
|
|
5
4
|
import {
|
|
6
5
|
quicktype,
|
|
7
6
|
InputData,
|
|
@@ -9,13 +8,11 @@ import {
|
|
|
9
8
|
} from "quicktype-core";
|
|
10
9
|
const { content } = getConfiguration();
|
|
11
10
|
const { typesDir } = content;
|
|
12
|
-
const isESModule = typeof import.meta.url === "string";
|
|
13
|
-
const requireFunction = isESModule ? createRequire(import.meta.url) : require;
|
|
14
11
|
const requireUncached = (module) => {
|
|
15
|
-
delete
|
|
16
|
-
return
|
|
12
|
+
delete ESMxCJSRequire.cache[ESMxCJSRequire.resolve(module)];
|
|
13
|
+
return ESMxCJSRequire(module);
|
|
17
14
|
};
|
|
18
|
-
const
|
|
15
|
+
const kebabCaseToCamelCase = (name) => name.split(/[\s\-_]+/).map((word, index) => {
|
|
19
16
|
if (index === 0) {
|
|
20
17
|
return word;
|
|
21
18
|
}
|
|
@@ -54,8 +51,11 @@ const createTypes = async (dictionariesPaths) => {
|
|
|
54
51
|
}
|
|
55
52
|
for (const dictionaryPath of dictionariesPaths) {
|
|
56
53
|
const dictionary = requireUncached(dictionaryPath);
|
|
57
|
-
const dictionaryName = dictionary.
|
|
58
|
-
|
|
54
|
+
const dictionaryName = dictionary.key;
|
|
55
|
+
if (!dictionaryName) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const dictionaryNameCamelCase = kebabCaseToCamelCase(dictionaryName) + "Content";
|
|
59
59
|
const dictionaryContentString = JSON.stringify(dictionary);
|
|
60
60
|
const typeDefinition = await generateTypeScriptType(
|
|
61
61
|
dictionaryNameCamelCase,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { resolve } from 'path';\nimport { getConfiguration, ESMxCJSRequire } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n quicktype,\n InputData,\n jsonInputForTargetLanguage,\n} from 'quicktype-core';\n\nconst { content } = getConfiguration();\nconst { typesDir } = content;\n\nconst requireUncached = (module: string) => {\n delete ESMxCJSRequire.cache[ESMxCJSRequire.resolve(module)];\n return ESMxCJSRequire(module);\n};\n\nconst kebabCaseToCamelCase = (name: string): string =>\n name\n .split(/[\\s\\-_]+/) // Regular expression to match space, hyphen, or underscore\n .map((word, index) => {\n if (index === 0) {\n return word; // Return the first word as is\n }\n return word.charAt(0).toUpperCase() + word.slice(1); // Capitalize the first letter of subsequent words\n })\n .join(''); // Join all the segments into one string\n\nexport const generateTypeScriptType = async (\n typeName: string,\n jsonString: string\n) => {\n const { lines } = await quicktypeJSON(typeName, jsonString);\n\n const linesString: string = lines.join('\\n');\n\n return linesString;\n};\n\nconst quicktypeJSON = async (typeName: string, jsonString: string) => {\n const jsonInput = jsonInputForTargetLanguage('typescript');\n\n // We could add multiple samples for the same desired\n // type, or many sources for other types. Here we're\n // just making one type from one piece of sample JSON.\n\n await jsonInput.addSource({\n name: typeName,\n samples: [jsonString],\n });\n\n const inputData = new InputData();\n inputData.addInput(jsonInput);\n\n return await quicktype({\n inputData,\n lang: 'typescript',\n alphabetizeProperties: true,\n rendererOptions: {\n 'just-types': 'true',\n 'explicit-unions': 'true',\n 'acronym-style': 'camel',\n 'prefer-types': 'true',\n readonly: 'false',\n },\n });\n};\n\n/**\n * This function generates a TypeScript type definition from a JSON object\n */\nexport const createTypes = async (\n dictionariesPaths: string[]\n): Promise<string[]> => {\n const resultTypesPaths: string[] = [];\n\n // Create type folders if they don't exist\n if (!existsSync(typesDir)) {\n mkdirSync(typesDir, { recursive: true });\n }\n\n for (const dictionaryPath of dictionariesPaths) {\n const dictionary: Dictionary = requireUncached(dictionaryPath);\n\n const dictionaryName: string = dictionary.key;\n\n if (!dictionaryName) {\n // Skip dictionary if it doesn't have a key, if not exported as default etc\n continue;\n }\n\n const dictionaryNameCamelCase: string =\n kebabCaseToCamelCase(dictionaryName) + 'Content';\n\n const dictionaryContentString: string = JSON.stringify(dictionary);\n\n const typeDefinition: string = await generateTypeScriptType(\n dictionaryNameCamelCase,\n dictionaryContentString\n );\n\n const outputPath: string = resolve(typesDir, `${dictionaryName}.d.ts`);\n\n writeFileSync(outputPath, typeDefinition);\n\n resultTypesPaths.push(outputPath);\n }\n\n return resultTypesPaths;\n};\n"],"mappings":"AAAA,SAAS,YAAY,WAAW,qBAAqB;AACrD,SAAS,eAAe;AACxB,SAAS,kBAAkB,sBAAsB;AAEjD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AACrC,MAAM,EAAE,SAAS,IAAI;AAErB,MAAM,kBAAkB,CAAC,WAAmB;AAC1C,SAAO,eAAe,MAAM,eAAe,QAAQ,MAAM,CAAC;AAC1D,SAAO,eAAe,MAAM;AAC9B;AAEA,MAAM,uBAAuB,CAAC,SAC5B,KACG,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,UAAU;AACpB,MAAI,UAAU,GAAG;AACf,WAAO;AAAA,EACT;AACA,SAAO,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AACpD,CAAC,EACA,KAAK,EAAE;AAEL,MAAM,yBAAyB,OACpC,UACA,eACG;AACH,QAAM,EAAE,MAAM,IAAI,MAAM,cAAc,UAAU,UAAU;AAE1D,QAAM,cAAsB,MAAM,KAAK,IAAI;AAE3C,SAAO;AACT;AAEA,MAAM,gBAAgB,OAAO,UAAkB,eAAuB;AACpE,QAAM,YAAY,2BAA2B,YAAY;AAMzD,QAAM,UAAU,UAAU;AAAA,IACxB,MAAM;AAAA,IACN,SAAS,CAAC,UAAU;AAAA,EACtB,CAAC;AAED,QAAM,YAAY,IAAI,UAAU;AAChC,YAAU,SAAS,SAAS;AAE5B,SAAO,MAAM,UAAU;AAAA,IACrB;AAAA,IACA,MAAM;AAAA,IACN,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,MACf,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACZ;AAAA,EACF,CAAC;AACH;AAKO,MAAM,cAAc,OACzB,sBACsB;AACtB,QAAM,mBAA6B,CAAC;AAGpC,MAAI,CAAC,WAAW,QAAQ,GAAG;AACzB,cAAU,UAAU,EAAE,WAAW,KAAK,CAAC;AAAA,EACzC;AAEA,aAAW,kBAAkB,mBAAmB;AAC9C,UAAM,aAAyB,gBAAgB,cAAc;AAE7D,UAAM,iBAAyB,WAAW;AAE1C,QAAI,CAAC,gBAAgB;AAEnB;AAAA,IACF;AAEA,UAAM,0BACJ,qBAAqB,cAAc,IAAI;AAEzC,UAAM,0BAAkC,KAAK,UAAU,UAAU;AAEjE,UAAM,iBAAyB,MAAM;AAAA,MACnC;AAAA,MACA;AAAA,IACF;AAEA,UAAM,aAAqB,QAAQ,UAAU,GAAG,cAAc,OAAO;AAErE,kBAAc,YAAY,cAAc;AAExC,qBAAiB,KAAK,UAAU;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chokidar/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../../src/chokidar/watcher.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,UAAU,CAAC;AAcxE,eAAO,MAAM,KAAK,aAAc,eAAe,QAiE9C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DictionaryAPI } from '@intlayer/backend';
|
|
2
|
+
type FetchDistantDictionariesOptions = {
|
|
3
|
+
dictionaryKeys: string[];
|
|
4
|
+
newDictionariesPath?: string;
|
|
5
|
+
logPrefix?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Fetch distant dictionaries and update the logger with their statuses.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fetchDistantDictionaries: (options: FetchDistantDictionariesOptions) => Promise<DictionaryAPI[]>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=fetchDistantDictionaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchDistantDictionaries.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOvD,KAAK,+BAA+B,GAAG;IACrC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,YAC1B,+BAA+B,KACvC,OAAO,CAAC,aAAa,EAAE,CAgFzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchDistantDictionaryKeys.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaryKeys.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,QAAa,OAAO,CAAC,MAAM,EAAE,CA6BnE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { watch } from './chokidar/watcher';
|
|
2
|
+
export { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';
|
|
3
|
+
export { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';
|
|
4
|
+
export { fetchDistantDictionaries } from './fetchDistantDictionaries';
|
|
5
|
+
export { loadDistantDictionaries, loadDictionaries, loadLocalDictionaries, } from './loadDictionaries/index';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA+GrE,eAAO,MAAM,uBAAuB,+BACN,MAAM,EAAE,KACnC,OAAO,CAAC,UAAU,EAAE,CAsBtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAU5C,eAAO,MAAM,gBAAgB,6BACD,MAAM,EAAE,GAAG,MAAM,KAC1C,OAAO,CAAC,UAAU,EAAE,CA8DtB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DictionaryAPI } from '@intlayer/backend';
|
|
2
|
+
type LoadDistantDictionariesOptions = {
|
|
3
|
+
dictionaryKeys: string[];
|
|
4
|
+
newDictionariesPath?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const loadDistantDictionaries: (options: LoadDistantDictionariesOptions) => Promise<DictionaryAPI[]>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=loadDistantDictionaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadDistantDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadDistantDictionaries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,KAAK,8BAA8B,GAAG;IACpC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,YACzB,8BAA8B,KACtC,OAAO,CAAC,aAAa,EAAE,CASzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadLocalDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadLocalDictionaries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,qBAAqB,6BACN,MAAM,EAAE,GAAG,MAAM,KAC1C,OAAO,CAAC,UAAU,EAAE,CA2BtB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type State = {
|
|
2
|
+
type: 'local' | 'distant';
|
|
3
|
+
status: 'pending' | 'fetching' | 'fetched' | 'error' | 'imported' | 'built';
|
|
4
|
+
icon?: string;
|
|
5
|
+
error?: Error;
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
spinnerFrameIndex?: number;
|
|
8
|
+
};
|
|
9
|
+
export type DictionariesStatus = {
|
|
10
|
+
dictionaryKey: string;
|
|
11
|
+
state: State[];
|
|
12
|
+
};
|
|
13
|
+
declare class Logger {
|
|
14
|
+
private dictionariesStatuses;
|
|
15
|
+
private spinnerFrames;
|
|
16
|
+
private spinnerTimer;
|
|
17
|
+
private maxDictionaryKeyLength;
|
|
18
|
+
private RESET;
|
|
19
|
+
private GREEN;
|
|
20
|
+
private RED;
|
|
21
|
+
private BLUE;
|
|
22
|
+
private GREY;
|
|
23
|
+
private GREY_DARK;
|
|
24
|
+
private static instance;
|
|
25
|
+
private constructor();
|
|
26
|
+
static getInstance(): Logger;
|
|
27
|
+
init(localDictionariesKeys: string[], distantDictionariesKeys: string[]): void;
|
|
28
|
+
addDictionaryKeys(type: 'local' | 'distant', dictionaryKeys: string[]): void;
|
|
29
|
+
private startSpinner;
|
|
30
|
+
private stopSpinner;
|
|
31
|
+
stop(): void;
|
|
32
|
+
updateStatus(dictionaryKey: string, type: 'local' | 'distant', status: Partial<State>): void;
|
|
33
|
+
private getStatusIcon;
|
|
34
|
+
private getStatusLine;
|
|
35
|
+
private updateAllStatusLines;
|
|
36
|
+
getStatuses(): DictionariesStatus[];
|
|
37
|
+
}
|
|
38
|
+
export declare const logger: Logger;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC;AAEF,cAAM,MAAM;IACV,OAAO,CAAC,oBAAoB,CAA4B;IACxD,OAAO,CAAC,aAAa,CAAsD;IAC3E,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,sBAAsB,CAAa;IAG3C,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,SAAS,CAAc;IAG/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAEhC,OAAO;WAEO,WAAW,IAAI,MAAM;IAO5B,IAAI,CACT,qBAAqB,EAAE,MAAM,EAAE,EAC/B,uBAAuB,EAAE,MAAM,EAAE;IA2C5B,iBAAiB,CACtB,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,cAAc,EAAE,MAAM,EAAE;IA8D1B,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,WAAW;IAOZ,IAAI;IAMJ,YAAY,CACjB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC;IA4CxB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,aAAa;IAqCrB,OAAO,CAAC,oBAAoB;IAyBrB,WAAW;CAGnB;AAED,eAAO,MAAM,MAAM,QAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/mergeDictionaries.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG3C,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,OAAO,MAAM,CAAC,cAChD,CAAC,EAAE,UAAU,CAAC,EAAE,YAAY,OAAO,KAAG,CAAC,EA6BxD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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[]) => Promise<string[]>;
|
|
6
|
+
//# sourceMappingURL=buildI18nDictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildI18nDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18n_dictionary/buildI18nDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,wBACT,UAAU,EAAE,sBAoBlC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Locales } from '@intlayer/config';
|
|
2
|
+
import { DictionaryValue } from '@intlayer/core';
|
|
3
|
+
type Dictionary = Record<string, unknown>;
|
|
4
|
+
export type I18nDictionariesOutput = Partial<Record<Locales, Dictionary>>;
|
|
5
|
+
export declare const createI18nDictionaries: (content: DictionaryValue) => I18nDictionariesOutput;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=convertContentDeclarationInto18nDictionaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertContentDeclarationInto18nDictionaries.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertContentDeclarationInto18nDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAKL,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1C,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAyE1E,eAAO,MAAM,sBAAsB,YACxB,eAAe,KACvB,sBAWF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertPluralsValues.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18n_dictionary/convertPluralsValues.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,WAAY,MAAM,KAAG,MAqBrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18n_dictionary/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/dist/types/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { I18nDictionariesOutput } from './convertContentDeclarationInto18nDictionaries';
|
|
2
|
+
export type DictionariesDeclaration = Record<string, I18nDictionariesOutput>;
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/i18n_dictionary/writeDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAKxF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,eAAe,4BACD,uBAAuB,sBA2BjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/declaration_file_to_dictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,eAAO,MAAM,eAAe,6BACA,UAAU,EAAE,KACrC,OAAO,CAAC,MAAM,EAAE,CAUlB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Dictionary } from '@intlayer/core';
|
|
2
|
+
/**
|
|
3
|
+
* This function transpile the bundled code to to make dictionaries as JSON files
|
|
4
|
+
*/
|
|
5
|
+
export declare const buildIntlayerDictionary: (contentDeclarations: Dictionary[]) => Promise<string[]>;
|
|
6
|
+
//# sourceMappingURL=buildIntlayerDictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildIntlayerDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD;;GAEG;AACH,eAAO,MAAM,uBAAuB,wBACb,UAAU,EAAE,sBASlC,CAAC"}
|
package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DeclarationContent, Dictionary } from '@intlayer/core';
|
|
2
|
+
/**
|
|
3
|
+
* Function to load, process the module and return the Intlayer DeclarationContent from the module file
|
|
4
|
+
*/
|
|
5
|
+
export declare const processContentDeclaration: (contentDeclaration: DeclarationContent) => Promise<Dictionary | undefined>;
|
|
6
|
+
//# sourceMappingURL=processContentDeclaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processContentDeclaration.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AA+CxB;;GAEG;AACH,eAAO,MAAM,yBAAyB,uBAChB,kBAAkB,KACrC,OAAO,CAAC,UAAU,GAAG,SAAS,CAahC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,eAAe,iBAAwB,UAAU,EAAE,sBAmB/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDictionaryList.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryList.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,eAAO,MAAM,oBAAoB,YAchC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW,OAAQ,MAAM,KAAG,MACH,CAAC;AA4EvC;;GAEG;AACH,eAAO,MAAM,wBAAwB,YAWpC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const generateTypeScriptType: (typeName: string, jsonString: string) => Promise<string>;
|
|
2
|
+
/**
|
|
3
|
+
* This function generates a TypeScript type definition from a JSON object
|
|
4
|
+
*/
|
|
5
|
+
export declare const createTypes: (dictionariesPaths: string[]) => Promise<string[]>;
|
|
6
|
+
//# sourceMappingURL=createType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,sBAAsB,aACvB,MAAM,cACJ,MAAM,oBAOnB,CAAC;AA+BF;;GAEG;AACH,eAAO,MAAM,WAAW,sBACH,MAAM,EAAE,KAC1B,OAAO,CAAC,MAAM,EAAE,CAoClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC"}
|