@intlayer/chokidar 5.8.1 → 6.0.0-canary.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 +15 -20
- package/dist/cjs/chokidar/watcher.cjs.map +1 -1
- package/dist/cjs/fetchDistantDictionaries.cjs +18 -37
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/{fetchDistantDictionaryKeys.cjs → fetchDistantDictionaryKeysAndUpdateTimestamp.cjs} +11 -19
- package/dist/cjs/fetchDistantDictionaryKeysAndUpdateTimestamp.cjs.map +1 -0
- package/dist/cjs/filterInvalidDictionaries.cjs +70 -0
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -0
- package/dist/cjs/getBuiltFetchDictionariesPath.cjs +52 -0
- package/dist/cjs/getBuiltFetchDictionariesPath.cjs.map +1 -0
- package/dist/cjs/getBuiltRemoteDictionariesPath.cjs +51 -0
- package/dist/cjs/getBuiltRemoteDictionariesPath.cjs.map +1 -0
- package/dist/cjs/index.cjs +13 -11
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/index.cjs +4 -4
- package/dist/cjs/loadDictionaries/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +57 -17
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +128 -53
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +108 -0
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/log.cjs +144 -0
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -0
- package/dist/cjs/mergeDictionaries.cjs +18 -22
- package/dist/cjs/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/orderDictionaries.cjs +71 -0
- package/dist/cjs/orderDictionaries.cjs.map +1 -0
- package/dist/cjs/prepareContentDeclaration.cjs +4 -1
- package/dist/cjs/prepareContentDeclaration.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +9 -4
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/processPerLocaleDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs +22 -8
- 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/writeDynamicDictionary.cjs +44 -42
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.cjs +83 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.cjs +29 -21
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.cjs +52 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.cjs.map +1 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.cjs +44 -29
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs +39 -34
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +4 -6
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs +17 -16
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +1 -1
- package/dist/cjs/utils/formatter.cjs +50 -0
- package/dist/cjs/utils/formatter.cjs.map +1 -0
- package/dist/cjs/utils/parallelize.cjs +43 -0
- package/dist/cjs/utils/parallelize.cjs.map +1 -0
- package/dist/cjs/utils/runOnce.cjs +2 -1
- package/dist/cjs/utils/runOnce.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/formatCode.cjs +7 -4
- package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +6 -2
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +43 -25
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/esm/chokidar/watcher.mjs +16 -21
- package/dist/esm/chokidar/watcher.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaries.mjs +24 -28
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaryKeysAndUpdateTimestamp.mjs +21 -0
- package/dist/esm/fetchDistantDictionaryKeysAndUpdateTimestamp.mjs.map +1 -0
- package/dist/esm/filterInvalidDictionaries.mjs +40 -0
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -0
- package/dist/esm/getBuiltFetchDictionariesPath.mjs +18 -0
- package/dist/esm/getBuiltFetchDictionariesPath.mjs.map +1 -0
- package/dist/esm/getBuiltRemoteDictionariesPath.mjs +17 -0
- package/dist/esm/getBuiltRemoteDictionariesPath.mjs.map +1 -0
- package/dist/esm/index.mjs +10 -9
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/index.mjs +2 -2
- package/dist/esm/loadDictionaries/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +61 -18
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +132 -53
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +73 -0
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/log.mjs +125 -0
- package/dist/esm/loadDictionaries/log.mjs.map +1 -0
- package/dist/esm/mergeDictionaries.mjs +19 -23
- package/dist/esm/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/orderDictionaries.mjs +37 -0
- package/dist/esm/orderDictionaries.mjs.map +1 -0
- package/dist/esm/prepareContentDeclaration.mjs +4 -1
- package/dist/esm/prepareContentDeclaration.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +9 -4
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/processPerLocaleDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs +25 -9
- 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/writeDynamicDictionary.mjs +45 -43
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.mjs +58 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.mjs +29 -21
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.mjs +28 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.mjs.map +1 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.mjs +45 -30
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs +39 -34
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +4 -6
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs +17 -16
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +15 -0
- package/dist/esm/utils/formatter.mjs.map +1 -0
- package/dist/esm/utils/parallelize.mjs +9 -0
- package/dist/esm/utils/parallelize.mjs.map +1 -0
- package/dist/esm/utils/runOnce.mjs +2 -1
- package/dist/esm/utils/runOnce.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/formatCode.mjs +8 -5
- package/dist/esm/writeContentDeclaration/formatCode.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +6 -2
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +40 -22
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/types/chokidar/watcher.d.ts.map +1 -1
- package/dist/types/fetchDistantDictionaries.d.ts +2 -1
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts +3 -0
- package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts.map +1 -0
- package/dist/types/filterInvalidDictionaries.d.ts +3 -0
- package/dist/types/filterInvalidDictionaries.d.ts.map +1 -0
- package/dist/types/getBuiltFetchDictionariesPath.d.ts +5 -0
- package/dist/types/getBuiltFetchDictionariesPath.d.ts.map +1 -0
- package/dist/types/getBuiltRemoteDictionariesPath.d.ts +5 -0
- package/dist/types/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/loadDictionaries/index.d.ts +2 -2
- package/dist/types/loadDictionaries/index.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +4 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +11 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +6 -0
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/log.d.ts +19 -0
- package/dist/types/loadDictionaries/log.d.ts.map +1 -0
- package/dist/types/mergeDictionaries.d.ts +1 -1
- package/dist/types/mergeDictionaries.d.ts.map +1 -1
- package/dist/types/orderDictionaries.d.ts +10 -0
- package/dist/types/orderDictionaries.d.ts.map +1 -0
- package/dist/types/prepareContentDeclaration.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/processPerLocaleDictionary.d.ts +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts.map +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts +4 -3
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.d.ts +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.d.ts.map +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.d.ts +23 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.d.ts +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.d.ts.map +1 -1
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.d.ts +19 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +1 -1
- package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts +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 +1 -1
- package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +1 -1
- package/dist/types/transpiler/dictionary_to_type/createType.d.ts +1 -1
- package/dist/types/transpiler/dictionary_to_type/createType.d.ts.map +1 -1
- package/dist/types/utils/formatter.d.ts +4 -0
- package/dist/types/utils/formatter.d.ts.map +1 -0
- package/dist/types/utils/parallelize.d.ts +2 -0
- package/dist/types/utils/parallelize.d.ts.map +1 -0
- package/dist/types/utils/runOnce.d.ts +1 -1
- package/dist/types/utils/runOnce.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +1 -1
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/formatCode.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +1 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
- package/package.json +17 -15
- package/dist/cjs/checkDictionaryChanges.cjs +0 -58
- package/dist/cjs/checkDictionaryChanges.cjs.map +0 -1
- package/dist/cjs/fetchDistantDictionaryKeys.cjs.map +0 -1
- package/dist/cjs/getFilteredLocalesContent.cjs +0 -70
- package/dist/cjs/getFilteredLocalesContent.cjs.map +0 -1
- package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs +0 -44
- package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs.map +0 -1
- package/dist/cjs/log.cjs +0 -296
- package/dist/cjs/log.cjs.map +0 -1
- package/dist/esm/checkDictionaryChanges.mjs +0 -37
- package/dist/esm/checkDictionaryChanges.mjs.map +0 -1
- package/dist/esm/fetchDistantDictionaryKeys.mjs +0 -29
- package/dist/esm/fetchDistantDictionaryKeys.mjs.map +0 -1
- package/dist/esm/getFilteredLocalesContent.mjs +0 -49
- package/dist/esm/getFilteredLocalesContent.mjs.map +0 -1
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +0 -20
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs.map +0 -1
- package/dist/esm/log.mjs +0 -262
- package/dist/esm/log.mjs.map +0 -1
- package/dist/types/checkDictionaryChanges.d.ts +0 -3
- package/dist/types/checkDictionaryChanges.d.ts.map +0 -1
- package/dist/types/fetchDistantDictionaryKeys.d.ts +0 -3
- package/dist/types/fetchDistantDictionaryKeys.d.ts.map +0 -1
- package/dist/types/getFilteredLocalesContent.d.ts +0 -4
- package/dist/types/getFilteredLocalesContent.d.ts.map +0 -1
- package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts +0 -8
- package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts.map +0 -1
- package/dist/types/log.d.ts +0 -45
- package/dist/types/log.d.ts.map +0 -1
|
@@ -17,7 +17,7 @@ export type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;
|
|
|
17
17
|
* const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
|
|
18
18
|
* console.log(finalDictionaries);
|
|
19
19
|
*
|
|
20
|
-
* // .intlayer/
|
|
20
|
+
* // .intlayer/dictionary/home.json
|
|
21
21
|
* // { key: 'home', content: { ... } },
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dictionary } from '@intlayer/core';
|
|
2
|
+
/**
|
|
3
|
+
* Write the localized dictionaries to the dictionariesDir
|
|
4
|
+
* @param mergedDictionaries - The merged dictionaries
|
|
5
|
+
* @param configuration - The configuration
|
|
6
|
+
* @returns The final dictionaries
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
|
|
11
|
+
* const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
|
|
12
|
+
* console.log(finalDictionaries);
|
|
13
|
+
*
|
|
14
|
+
* // .intlayer/fetch_dictionaries/home.json
|
|
15
|
+
* // { key: 'home', content: { ... } },
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<Dictionary[]>;
|
|
19
|
+
//# sourceMappingURL=writeRemoteDictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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 +1 @@
|
|
|
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;
|
|
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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This function generates a list of dictionaries in the main directory
|
|
3
3
|
*/
|
|
4
|
-
export declare const createDictionaryEntryPoint: (configuration?: import("@intlayer/config").IntlayerConfig, dictionariesKeys?: string[], formats?: ("cjs" | "esm")[]) => void
|
|
4
|
+
export declare const createDictionaryEntryPoint: (configuration?: import("@intlayer/config").IntlayerConfig, dictionariesKeys?: string[], formats?: ("cjs" | "esm")[]) => Promise<void>;
|
|
5
5
|
//# sourceMappingURL=createDictionaryEntryPoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AAgCA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,EAClC,mBAAmB,MAAM,EAAE,EAC3B,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,kBA6C5C,CAAC"}
|
|
@@ -2,5 +2,5 @@ export declare const getTypeName: (key: string) => string;
|
|
|
2
2
|
/**
|
|
3
3
|
* This function generates a index file merging all the types
|
|
4
4
|
*/
|
|
5
|
-
export declare const createModuleAugmentation: (configuration?: import("@intlayer/config").IntlayerConfig) => void
|
|
5
|
+
export declare const createModuleAugmentation: (configuration?: import("@intlayer/config").IntlayerConfig) => Promise<void>;
|
|
6
6
|
//# sourceMappingURL=createModuleAugmentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MACH,CAAC;AA8FxC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,
|
|
1
|
+
{"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MACH,CAAC;AA8FxC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,kBAiBnC,CAAC"}
|
|
@@ -4,5 +4,5 @@ export declare const generateTypeScriptType: (dictionary: Dictionary) => string;
|
|
|
4
4
|
/**
|
|
5
5
|
* This function generates a TypeScript type definition from a JSON object
|
|
6
6
|
*/
|
|
7
|
-
export declare const createTypes: (dictionariesPaths: string[], configuration?: IntlayerConfig) => string[]
|
|
7
|
+
export declare const createTypes: (dictionariesPaths: string[], configuration?: IntlayerConfig) => Promise<string[]>;
|
|
8
8
|
//# sourceMappingURL=createType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAUjD,eAAO,MAAM,sBAAsB,GAAI,YAAY,UAAU,WAI5D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,mBAAmB,MAAM,EAAE,EAC3B,gBAAe,cAAmC,KACjD,OAAO,CAAC,MAAM,EAAE,CA0BlB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ANSIColors, Locales } from '@intlayer/config';
|
|
2
|
+
export declare const formatPath: (path: string | string[], color?: ANSIColors | false) => string;
|
|
3
|
+
export declare const formatLocale: (locale: Locales | Locales[], color?: ANSIColors | false) => string;
|
|
4
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../src/utils/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK/E,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,GAAG,MAAM,EAAE,EACvB,QAAQ,UAAU,GAAG,KAAK,WAYb,CAAC;AAEhB,eAAO,MAAM,YAAY,GACvB,QAAQ,OAAO,GAAG,OAAO,EAAE,EAC3B,QAAO,UAAU,GAAG,KAAwB,WAM/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelize.d.ts","sourceRoot":"","sources":["../../../src/utils/parallelize.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,CAAC,EACpC,OAAO,CAAC,EAAE,EACV,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACjC,gBAAe,MAAW,KACzB,OAAO,CAAC,CAAC,EAAE,CAGb,CAAC"}
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @throws {Error} When there are unexpected filesystem errors
|
|
22
22
|
*/
|
|
23
|
-
export declare const runOnce: (sentinelFilePath: string, callback: () => void | Promise<void>, cacheTimeoutMs?: number) => Promise<void>;
|
|
23
|
+
export declare const runOnce: (sentinelFilePath: string, callback: () => void | Promise<void>, onIsCached?: () => void | Promise<void>, cacheTimeoutMs?: number) => Promise<void>;
|
|
24
24
|
//# sourceMappingURL=runOnce.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runOnce.d.ts","sourceRoot":"","sources":["../../../src/utils/runOnce.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,GAClB,kBAAkB,MAAM,EACxB,UAAU,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,iBAAgB,MAAkB,
|
|
1
|
+
{"version":3,"file":"runOnce.d.ts","sourceRoot":"","sources":["../../../src/utils/runOnce.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,GAClB,kBAAkB,MAAM,EACxB,UAAU,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,aAAa,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACvC,iBAAgB,MAAkB,kBA0CnC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type DictionaryStatus = 'pending' | 'fetching' | 'up-to-date' | 'replaced' | 'updated' | 'fetched' | 'unknown' | 'error' | 'imported' | 'reimported in JSON' | '
|
|
1
|
+
export type DictionaryStatus = 'pending' | 'fetching' | 'up-to-date' | 'replaced' | 'updated' | 'fetched' | 'unknown' | 'error' | 'imported' | 'reimported in JSON' | 'new content file';
|
|
2
2
|
//# sourceMappingURL=dictionaryStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryStatus.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/dictionaryStatus.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,YAAY,GACZ,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,GACP,UAAU,GACV,oBAAoB,GACpB,
|
|
1
|
+
{"version":3,"file":"dictionaryStatus.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/dictionaryStatus.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,YAAY,GACZ,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,GACP,UAAU,GACV,oBAAoB,GACpB,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/formatCode.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,EAAE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/formatCode.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,EAAE,MAAM,MAAM,iBA+C9D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IntlayerConfig } from '@intlayer/config/client';
|
|
2
2
|
import type { Dictionary } from '@intlayer/core';
|
|
3
3
|
import type { DictionaryStatus } from './dictionaryStatus';
|
|
4
4
|
export declare const writeContentDeclaration: (dictionary: Dictionary, config?: IntlayerConfig, newDictionariesPath?: string) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAsB3D,eAAO,MAAM,uBAAuB,GAClC,YAAY,UAAU,EACtB,SAAQ,cAA8B,EACtC,sBAAsB,MAAM,KAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA0DpD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dictionary } from '@intlayer/core';
|
|
2
2
|
/**
|
|
3
|
-
* Updates a JavaScript
|
|
3
|
+
* Updates a JavaScriptå/TypeScript file based on the provided JSON instructions.
|
|
4
4
|
* It targets a specific dictionary object within the file (identified by its 'key' property)
|
|
5
5
|
* and updates its 'content' entries. Currently, it focuses on modifying arguments
|
|
6
6
|
* of 't' (translation) function calls.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,YAAY,UAAU,KACrB,OAAO,CAAC,IAAI,CAwdd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/chokidar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-canary.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"fast-glob": "^3.3.3",
|
|
69
69
|
"p-limit": "^3.1.0",
|
|
70
70
|
"simple-git": "^3.27.0",
|
|
71
|
-
"@intlayer/
|
|
72
|
-
"@intlayer/
|
|
73
|
-
"@intlayer/
|
|
74
|
-
"@intlayer/dictionaries-entry": "
|
|
75
|
-
"intlayer": "
|
|
76
|
-
"@intlayer/
|
|
71
|
+
"@intlayer/api": "6.0.0-canary.1",
|
|
72
|
+
"@intlayer/config": "6.0.0-canary.1",
|
|
73
|
+
"@intlayer/dictionaries-entry": "6.0.0-canary.1",
|
|
74
|
+
"@intlayer/unmerged-dictionaries-entry": "6.0.0-canary.1",
|
|
75
|
+
"@intlayer/core": "6.0.0-canary.1",
|
|
76
|
+
"@intlayer/remote-dictionaries-entry": "6.0.0-canary.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@changesets/cli": "2.29.5",
|
|
@@ -84,14 +84,13 @@
|
|
|
84
84
|
"@types/node": "^24.2.1",
|
|
85
85
|
"@typescript-eslint/parser": "^8.33.1",
|
|
86
86
|
"concurrently": "^9.1.2",
|
|
87
|
-
"eslint": "^9.
|
|
88
|
-
"prettier": "^3.
|
|
87
|
+
"eslint": "^9.34.0",
|
|
88
|
+
"prettier": "^3.6.2",
|
|
89
89
|
"rimraf": "^6.0.1",
|
|
90
90
|
"tsc-alias": "^1.8.16",
|
|
91
91
|
"tsup": "^8.5.0",
|
|
92
92
|
"typescript": "^5.9.2",
|
|
93
|
-
"vitest": "^3.2.
|
|
94
|
-
"@intlayer/backend": "5.8.1",
|
|
93
|
+
"vitest": "^3.2.4",
|
|
95
94
|
"@utils/eslint-config": "1.0.4",
|
|
96
95
|
"@utils/ts-config": "1.0.4",
|
|
97
96
|
"@utils/tsup-config": "1.0.4",
|
|
@@ -100,10 +99,13 @@
|
|
|
100
99
|
"peerDependencies": {
|
|
101
100
|
"fast-glob": "^3.3.3",
|
|
102
101
|
"react": ">=16.0.0",
|
|
103
|
-
"@intlayer/api": "
|
|
104
|
-
"@intlayer/core": "
|
|
105
|
-
"intlayer": "
|
|
106
|
-
"@intlayer/config": "
|
|
102
|
+
"@intlayer/api": "6.0.0-canary.1",
|
|
103
|
+
"@intlayer/core": "6.0.0-canary.1",
|
|
104
|
+
"intlayer": "6.0.0-canary.1",
|
|
105
|
+
"@intlayer/config": "6.0.0-canary.1",
|
|
106
|
+
"@intlayer/dictionaries-entry": "6.0.0-canary.1",
|
|
107
|
+
"@intlayer/unmerged-dictionaries-entry": "6.0.0-canary.1",
|
|
108
|
+
"@intlayer/remote-dictionaries-entry": "6.0.0-canary.1"
|
|
107
109
|
},
|
|
108
110
|
"engines": {
|
|
109
111
|
"node": ">=14.18"
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var checkDictionaryChanges_exports = {};
|
|
20
|
-
__export(checkDictionaryChanges_exports, {
|
|
21
|
-
checkDictionaryChanges: () => checkDictionaryChanges
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(checkDictionaryChanges_exports);
|
|
24
|
-
var import_api = require("@intlayer/api");
|
|
25
|
-
var import_config = require("@intlayer/config");
|
|
26
|
-
var import_buildIntlayerDictionary = require('./transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs');
|
|
27
|
-
const writeDictionary = async (dictionary, configuration) => {
|
|
28
|
-
const appLogger = (0, import_config.getAppLogger)(configuration);
|
|
29
|
-
appLogger(`Writing dictionary ${dictionary.key}`);
|
|
30
|
-
await (0, import_buildIntlayerDictionary.buildIntlayerDictionary)([dictionary]);
|
|
31
|
-
};
|
|
32
|
-
const checkDictionaryChanges = async () => {
|
|
33
|
-
const configuration = (0, import_config.getConfiguration)();
|
|
34
|
-
const appLogger = (0, import_config.getAppLogger)(configuration);
|
|
35
|
-
const { editor } = configuration;
|
|
36
|
-
if (!editor.hotReload) return;
|
|
37
|
-
if (!editor.clientId) return;
|
|
38
|
-
if (!editor.clientSecret) return;
|
|
39
|
-
const eventSource = new import_api.IntlayerEventListener(configuration);
|
|
40
|
-
try {
|
|
41
|
-
await eventSource.initialize().then(() => {
|
|
42
|
-
appLogger("Connected to Intlayer. Hot reload enabled");
|
|
43
|
-
});
|
|
44
|
-
} catch (error) {
|
|
45
|
-
appLogger("Error initializing IntlayerEventListener:", {
|
|
46
|
-
level: "error"
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
eventSource.onDictionaryAdded = (dictionary) => writeDictionary(dictionary, configuration);
|
|
50
|
-
eventSource.onDictionaryChange = (dictionary) => writeDictionary(dictionary, configuration);
|
|
51
|
-
eventSource.onDictionaryDeleted = (dictionary) => writeDictionary(dictionary, configuration);
|
|
52
|
-
return eventSource;
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
checkDictionaryChanges
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=checkDictionaryChanges.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/checkDictionaryChanges.ts"],"sourcesContent":["import { IntlayerEventListener } from '@intlayer/api';\n// @ts-ignore: @intlayer/backend is not built yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport {\n getAppLogger,\n getConfiguration,\n IntlayerConfig,\n} from '@intlayer/config';\nimport { buildIntlayerDictionary } from './transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary';\n\nconst writeDictionary = async (\n dictionary: DictionaryAPI,\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration);\n appLogger(`Writing dictionary ${dictionary.key}`);\n await buildIntlayerDictionary([dictionary]);\n};\n\nexport const checkDictionaryChanges = async () => {\n const configuration = getConfiguration();\n const appLogger = getAppLogger(configuration);\n\n const { editor } = configuration;\n\n if (!editor.hotReload) return;\n if (!editor.clientId) return;\n if (!editor.clientSecret) return;\n\n const eventSource = new IntlayerEventListener(configuration);\n\n try {\n await eventSource.initialize().then(() => {\n appLogger('Connected to Intlayer. Hot reload enabled');\n });\n } catch (error) {\n appLogger('Error initializing IntlayerEventListener:', {\n level: 'error',\n });\n }\n\n eventSource.onDictionaryAdded = (dictionary) =>\n writeDictionary(dictionary, configuration);\n eventSource.onDictionaryChange = (dictionary) =>\n writeDictionary(dictionary, configuration);\n eventSource.onDictionaryDeleted = (dictionary) =>\n writeDictionary(dictionary, configuration);\n\n return eventSource;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAsC;AAGtC,oBAIO;AACP,qCAAwC;AAExC,MAAM,kBAAkB,OACtB,YACA,kBACG;AACH,QAAM,gBAAY,4BAAa,aAAa;AAC5C,YAAU,sBAAsB,WAAW,GAAG,EAAE;AAChD,YAAM,wDAAwB,CAAC,UAAU,CAAC;AAC5C;AAEO,MAAM,yBAAyB,YAAY;AAChD,QAAM,oBAAgB,gCAAiB;AACvC,QAAM,gBAAY,4BAAa,aAAa;AAE5C,QAAM,EAAE,OAAO,IAAI;AAEnB,MAAI,CAAC,OAAO,UAAW;AACvB,MAAI,CAAC,OAAO,SAAU;AACtB,MAAI,CAAC,OAAO,aAAc;AAE1B,QAAM,cAAc,IAAI,iCAAsB,aAAa;AAE3D,MAAI;AACF,UAAM,YAAY,WAAW,EAAE,KAAK,MAAM;AACxC,gBAAU,2CAA2C;AAAA,IACvD,CAAC;AAAA,EACH,SAAS,OAAO;AACd,cAAU,6CAA6C;AAAA,MACrD,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,cAAY,oBAAoB,CAAC,eAC/B,gBAAgB,YAAY,aAAa;AAC3C,cAAY,qBAAqB,CAAC,eAChC,gBAAgB,YAAY,aAAa;AAC3C,cAAY,sBAAsB,CAAC,eACjC,gBAAgB,YAAY,aAAa;AAE3C,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fetchDistantDictionaryKeys.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config';\n\nexport const fetchDistantDictionaryKeys = async (\n configuration: IntlayerConfig = getConfiguration()\n): Promise<string[]> => {\n const { clientId, clientSecret } = configuration.editor;\n\n if (!clientId || !clientSecret) {\n throw new Error(\n 'Missing OAuth2 client ID or client secret. To get access token go to https://intlayer.org/dashboard/project.'\n );\n }\n\n const intlayerAPI = getIntlayerAPI(undefined, configuration);\n\n const oAuth2TokenResult = await intlayerAPI.oAuth.getOAuth2AccessToken();\n\n const oAuth2AccessToken = oAuth2TokenResult.data?.accessToken;\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesKeys({\n ...(oAuth2AccessToken && {\n headers: {\n Authorization: `Bearer ${oAuth2AccessToken}`,\n },\n }),\n });\n\n if (!getDictionariesKeysResult.data) {\n throw new Error('No distant dictionaries found');\n }\n\n const distantDictionariesKeys: string[] = getDictionariesKeysResult.data;\n\n // Apply any filtering if needed\n return distantDictionariesKeys;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA+B;AAC/B,oBAAsD;AAE/C,MAAM,6BAA6B,OACxC,oBAAgC,gCAAiB,MAC3B;AACtB,QAAM,EAAE,UAAU,aAAa,IAAI,cAAc;AAEjD,MAAI,CAAC,YAAY,CAAC,cAAc;AAC9B,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAc,2BAAe,QAAW,aAAa;AAE3D,QAAM,oBAAoB,MAAM,YAAY,MAAM,qBAAqB;AAEvE,QAAM,oBAAoB,kBAAkB,MAAM;AAGlD,QAAM,4BACJ,MAAM,YAAY,WAAW,oBAAoB;AAAA,IAC/C,GAAI,qBAAqB;AAAA,MACvB,SAAS;AAAA,QACP,eAAe,UAAU,iBAAiB;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AAEH,MAAI,CAAC,0BAA0B,MAAM;AACnC,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AAEA,QAAM,0BAAoC,0BAA0B;AAGpE,SAAO;AACT;","names":[]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var getFilteredLocalesContent_exports = {};
|
|
20
|
-
__export(getFilteredLocalesContent_exports, {
|
|
21
|
-
getFilteredLocalesContent: () => getFilteredLocalesContent
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(getFilteredLocalesContent_exports);
|
|
24
|
-
var import_core = require("@intlayer/core");
|
|
25
|
-
const filterTranlationsPlugin = (locales, fallback = void 0) => ({
|
|
26
|
-
id: "filter-translations-plugin",
|
|
27
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === import_core.NodeType.Translation,
|
|
28
|
-
transform: (node, props, deepTransformNode2) => {
|
|
29
|
-
const translationMap = node.translation;
|
|
30
|
-
const localesArray = Array.isArray(locales) ? locales : [locales];
|
|
31
|
-
const isSingleLocale = localesArray.length === 1;
|
|
32
|
-
if (isSingleLocale) {
|
|
33
|
-
let content = translationMap[localesArray[0]];
|
|
34
|
-
if (typeof content === "undefined" && fallback) {
|
|
35
|
-
content = translationMap[fallback];
|
|
36
|
-
}
|
|
37
|
-
return deepTransformNode2(content, props);
|
|
38
|
-
}
|
|
39
|
-
const filteredTranslationMap = Object.fromEntries(
|
|
40
|
-
Object.entries(translationMap).filter(
|
|
41
|
-
([key]) => locales.includes(key)
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
return {
|
|
45
|
-
...node,
|
|
46
|
-
translation: deepTransformNode2(filteredTranslationMap, {
|
|
47
|
-
...props,
|
|
48
|
-
keyPath: [
|
|
49
|
-
...props.keyPath,
|
|
50
|
-
{ type: import_core.NodeType.Object, key: import_core.NodeType.Translation }
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const getFilteredLocalesContent = (node, locale, nodeProps, fallback) => {
|
|
57
|
-
const plugins = [
|
|
58
|
-
filterTranlationsPlugin(locale, fallback),
|
|
59
|
-
...nodeProps.plugins ?? []
|
|
60
|
-
];
|
|
61
|
-
return (0, import_core.deepTransformNode)(node, {
|
|
62
|
-
...nodeProps,
|
|
63
|
-
plugins
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
getFilteredLocalesContent
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=getFilteredLocalesContent.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getFilteredLocalesContent.ts"],"sourcesContent":["import type { Locales, LocalesValues } from '@intlayer/config/client';\nimport {\n ContentNode,\n deepTransformNode,\n NodeType,\n type NodeProps,\n type Plugins,\n} from '@intlayer/core';\n\nconst filterTranlationsPlugin = (\n locales: LocalesValues[] | LocalesValues,\n fallback: LocalesValues | undefined = undefined // fallback mean that if field is not translated, it will use the default locale,\n): Plugins => ({\n id: 'filter-translations-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node, props, deepTransformNode) => {\n const translationMap = node.translation as Record<Locales, string>;\n\n const localesArray = Array.isArray(locales) ? locales : [locales];\n const isSingleLocale = localesArray.length === 1;\n\n if (isSingleLocale) {\n let content = translationMap[localesArray[0] as Locales];\n\n if (typeof content === 'undefined' && fallback) {\n content = translationMap[fallback as Locales];\n }\n\n return deepTransformNode(content, props);\n }\n\n const filteredTranslationMap = Object.fromEntries(\n Object.entries(translationMap).filter(([key]) =>\n locales.includes(key as Locales)\n )\n );\n\n return {\n ...node,\n translation: deepTransformNode(filteredTranslationMap, {\n ...props,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Object, key: NodeType.Translation },\n ],\n }),\n };\n },\n});\n\nexport const getFilteredLocalesContent = (\n node: ContentNode,\n locale: LocalesValues | LocalesValues[],\n nodeProps: NodeProps,\n fallback?: LocalesValues // fallback mean that if field is not translated, it will use the default locale,\n) => {\n const plugins: Plugins[] = [\n filterTranlationsPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAMO;AAEP,MAAM,0BAA0B,CAC9B,SACA,WAAsC,YACzB;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,qBAAS;AAAA,EAC1D,WAAW,CAAC,MAAM,OAAOA,uBAAsB;AAC7C,UAAM,iBAAiB,KAAK;AAE5B,UAAM,eAAe,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAChE,UAAM,iBAAiB,aAAa,WAAW;AAE/C,QAAI,gBAAgB;AAClB,UAAI,UAAU,eAAe,aAAa,CAAC,CAAY;AAEvD,UAAI,OAAO,YAAY,eAAe,UAAU;AAC9C,kBAAU,eAAe,QAAmB;AAAA,MAC9C;AAEA,aAAOA,mBAAkB,SAAS,KAAK;AAAA,IACzC;AAEA,UAAM,yBAAyB,OAAO;AAAA,MACpC,OAAO,QAAQ,cAAc,EAAE;AAAA,QAAO,CAAC,CAAC,GAAG,MACzC,QAAQ,SAAS,GAAc;AAAA,MACjC;AAAA,IACF;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,aAAaA,mBAAkB,wBAAwB;AAAA,QACrD,GAAG;AAAA,QACH,SAAS;AAAA,UACP,GAAG,MAAM;AAAA,UACT,EAAE,MAAM,qBAAS,QAAQ,KAAK,qBAAS,YAAY;AAAA,QACrD;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,MAAM,4BAA4B,CACvC,MACA,QACA,WACA,aACG;AACH,QAAM,UAAqB;AAAA,IACzB,wBAAwB,QAAQ,QAAQ;AAAA,IACxC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,+BAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var loadDistantDictionaries_exports = {};
|
|
20
|
-
__export(loadDistantDictionaries_exports, {
|
|
21
|
-
loadDistantDictionaries: () => loadDistantDictionaries
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(loadDistantDictionaries_exports);
|
|
24
|
-
var import_fetchDistantDictionaries = require('../fetchDistantDictionaries.cjs');
|
|
25
|
-
const formatDistantDictionaries = (dictionaries) => {
|
|
26
|
-
return dictionaries.map((dict) => ({
|
|
27
|
-
...dict,
|
|
28
|
-
location: "distant"
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
const loadDistantDictionaries = async (options) => {
|
|
32
|
-
try {
|
|
33
|
-
const distantDictionaries = await (0, import_fetchDistantDictionaries.fetchDistantDictionaries)(options);
|
|
34
|
-
return formatDistantDictionaries(distantDictionaries);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error(error);
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
loadDistantDictionaries
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=loadDistantDictionaries.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/loadDictionaries/loadDistantDictionaries.ts"],"sourcesContent":["// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\n\ntype LoadDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n};\n\nconst formatDistantDictionaries = (dictionaries: DictionaryAPI[]) => {\n return dictionaries.map((dict) => ({\n ...dict,\n location: 'distant' as const,\n }));\n};\n\nexport const loadDistantDictionaries = async (\n options: LoadDistantDictionariesOptions\n): Promise<DictionaryAPI[]> => {\n try {\n const distantDictionaries = await fetchDistantDictionaries(options);\n\n return formatDistantDictionaries(distantDictionaries);\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sCAAyC;AAOzC,MAAM,4BAA4B,CAAC,iBAAkC;AACnE,SAAO,aAAa,IAAI,CAAC,UAAU;AAAA,IACjC,GAAG;AAAA,IACH,UAAU;AAAA,EACZ,EAAE;AACJ;AAEO,MAAM,0BAA0B,OACrC,YAC6B;AAC7B,MAAI;AACF,UAAM,sBAAsB,UAAM,0DAAyB,OAAO;AAElE,WAAO,0BAA0B,mBAAmB;AAAA,EACtD,SAAS,OAAO;AACd,YAAQ,MAAM,KAAK;AACnB,WAAO,CAAC;AAAA,EACV;AACF;","names":[]}
|