@intlayer/cli 7.0.3 → 7.0.4

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.
Files changed (56) hide show
  1. package/dist/cjs/_virtual/_utils_asset.cjs +1 -1
  2. package/dist/cjs/build.cjs +4 -1
  3. package/dist/cjs/build.cjs.map +1 -1
  4. package/dist/cjs/cli.cjs +4 -2
  5. package/dist/cjs/cli.cjs.map +1 -1
  6. package/dist/cjs/fill/fill.cjs +3 -3
  7. package/dist/cjs/fill/fill.cjs.map +1 -1
  8. package/dist/cjs/fill/listTranslationsTasks.cjs +9 -5
  9. package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -1
  10. package/dist/cjs/getTargetDictionary.cjs +1 -1
  11. package/dist/cjs/getTargetDictionary.cjs.map +1 -1
  12. package/dist/cjs/liveSync.cjs +4 -1
  13. package/dist/cjs/liveSync.cjs.map +1 -1
  14. package/dist/cjs/pull.cjs +2 -1
  15. package/dist/cjs/pull.cjs.map +1 -1
  16. package/dist/cjs/test/index.cjs +3 -3
  17. package/dist/cjs/test/index.cjs.map +1 -1
  18. package/dist/cjs/test/listMissingTranslations.cjs +22 -10
  19. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  20. package/dist/cjs/utils/checkAccess.cjs +1 -6
  21. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  22. package/dist/cjs/watch.cjs +1 -1
  23. package/dist/cjs/watch.cjs.map +1 -1
  24. package/dist/esm/_virtual/_utils_asset.mjs +1 -1
  25. package/dist/esm/build.mjs +4 -1
  26. package/dist/esm/build.mjs.map +1 -1
  27. package/dist/esm/cli.mjs +4 -2
  28. package/dist/esm/cli.mjs.map +1 -1
  29. package/dist/esm/fill/fill.mjs +3 -3
  30. package/dist/esm/fill/fill.mjs.map +1 -1
  31. package/dist/esm/fill/listTranslationsTasks.mjs +10 -6
  32. package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -1
  33. package/dist/esm/getTargetDictionary.mjs +1 -1
  34. package/dist/esm/getTargetDictionary.mjs.map +1 -1
  35. package/dist/esm/liveSync.mjs +4 -1
  36. package/dist/esm/liveSync.mjs.map +1 -1
  37. package/dist/esm/pull.mjs +3 -2
  38. package/dist/esm/pull.mjs.map +1 -1
  39. package/dist/esm/test/index.mjs +3 -3
  40. package/dist/esm/test/index.mjs.map +1 -1
  41. package/dist/esm/test/listMissingTranslations.mjs +22 -11
  42. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  43. package/dist/esm/utils/checkAccess.mjs +1 -6
  44. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  45. package/dist/esm/watch.mjs +1 -1
  46. package/dist/esm/watch.mjs.map +1 -1
  47. package/dist/types/build.d.ts.map +1 -1
  48. package/dist/types/cli.d.ts +1 -0
  49. package/dist/types/cli.d.ts.map +1 -1
  50. package/dist/types/config.d.ts.map +1 -1
  51. package/dist/types/fill/fill.d.ts.map +1 -1
  52. package/dist/types/fill/listTranslationsTasks.d.ts.map +1 -1
  53. package/dist/types/pull.d.ts.map +1 -1
  54. package/dist/types/test/listMissingTranslations.d.ts +3 -2
  55. package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
  56. package/package.json +19 -19
package/dist/esm/pull.mjs CHANGED
@@ -2,7 +2,7 @@ import { checkCMSAuth } from "./utils/checkAccess.mjs";
2
2
  import { PullLogger } from "./push/pullLog.mjs";
3
3
  import { getIntlayerAPIProxy } from "@intlayer/api";
4
4
  import { parallelize, writeContentDeclaration } from "@intlayer/chokidar";
5
- import { ANSIColors, ESMxCJSRequire, getAppLogger, getConfiguration } from "@intlayer/config";
5
+ import { ANSIColors, getAppLogger, getConfiguration, getProjectRequire } from "@intlayer/config";
6
6
  import { join } from "node:path";
7
7
  import { existsSync } from "node:fs";
8
8
 
@@ -22,7 +22,8 @@ const pull = async (options) => {
22
22
  let distantDictionariesUpdateTimeStamp = getDictionariesUpdateTimestampResult.data;
23
23
  if (options?.dictionaries) distantDictionariesUpdateTimeStamp = Object.fromEntries(Object.entries(distantDictionariesUpdateTimeStamp).filter(([key]) => options.dictionaries?.includes(key)));
24
24
  const remoteDictionariesPath = join(config.content.mainDir, "remote_dictionaries.cjs");
25
- const remoteDictionariesRecord = existsSync(remoteDictionariesPath) ? ESMxCJSRequire(remoteDictionariesPath) : {};
25
+ const requireFunction = config.build?.require ?? getProjectRequire();
26
+ const remoteDictionariesRecord = existsSync(remoteDictionariesPath) ? requireFunction(remoteDictionariesPath) : {};
26
27
  const entries = Object.entries(distantDictionariesUpdateTimeStamp);
27
28
  const keysToFetch = entries.filter(([key, remoteUpdatedAt]) => {
28
29
  if (!remoteUpdatedAt) return true;
@@ -1 +1 @@
1
- {"version":3,"file":"pull.mjs","names":["distantDictionariesUpdateTimeStamp: Record<string, number>","remoteDictionariesRecord: Record<string, any>","dictionariesStatuses: DictionariesStatus[]","successfullyFetchedDictionaries: Dictionary[]","sourceDictionary: Dictionary | undefined"],"sources":["../../src/pull.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport {\n type DictionaryStatus,\n parallelize,\n writeContentDeclaration,\n} from '@intlayer/chokidar';\nimport {\n ANSIColors,\n ESMxCJSRequire,\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/types';\nimport { PullLogger, type PullStatus } from './push/pullLog';\nimport { checkCMSAuth } from './utils/checkAccess';\n\ntype PullOptions = {\n dictionaries?: string[];\n newDictionariesPath?: string;\n configOptions?: GetConfigurationOptions;\n};\n\ntype DictionariesStatus = {\n dictionaryKey: string;\n status: DictionaryStatus | 'pending' | 'fetching' | 'error';\n error?: Error;\n errorMessage?: string;\n};\n\n/**\n * Fetch distant dictionaries and write them locally,\n * with progress indicators and concurrency control.\n */\nexport const pull = async (options?: PullOptions): Promise<void> => {\n const appLogger = getAppLogger(options?.configOptions?.override);\n\n try {\n const config = getConfiguration(options?.configOptions);\n\n const hasCMSAuth = await checkCMSAuth(config);\n\n if (!hasCMSAuth) return;\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, config);\n\n // Get remote update timestamps map\n const getDictionariesUpdateTimestampResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n if (!getDictionariesUpdateTimestampResult.data) {\n throw new Error('No distant dictionaries found');\n }\n\n let distantDictionariesUpdateTimeStamp: Record<string, number> =\n getDictionariesUpdateTimestampResult.data;\n\n // Optional filtering by requested dictionaries\n if (options?.dictionaries) {\n distantDictionariesUpdateTimeStamp = Object.fromEntries(\n Object.entries(distantDictionariesUpdateTimeStamp).filter(([key]) =>\n options.dictionaries?.includes(key)\n )\n );\n }\n\n // Load local cached remote dictionaries (if any)\n const remoteDictionariesPath = join(\n config.content.mainDir,\n 'remote_dictionaries.cjs'\n );\n const remoteDictionariesRecord: Record<string, any> = existsSync(\n remoteDictionariesPath\n )\n ? (ESMxCJSRequire(remoteDictionariesPath) as any)\n : {};\n\n // Determine which keys need fetching by comparing updatedAt with local cache\n const entries = Object.entries(distantDictionariesUpdateTimeStamp);\n const keysToFetch = entries\n .filter(([key, remoteUpdatedAt]) => {\n if (!remoteUpdatedAt) return true;\n const local = (remoteDictionariesRecord as any)[key];\n if (!local) return true;\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n if (typeof localUpdatedAt !== 'number') return true;\n return remoteUpdatedAt > localUpdatedAt;\n })\n .map(([key]) => key);\n\n const cachedKeys = entries\n .filter(([key, remoteUpdatedAt]) => {\n const local = (remoteDictionariesRecord as any)[key];\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n })\n .map(([key]) => key);\n\n // Check if dictionaries list is empty\n if (entries.length === 0) {\n appLogger('No dictionaries to fetch', {\n level: 'error',\n });\n return;\n }\n\n appLogger('Fetching dictionaries:');\n\n // Prepare dictionaries statuses\n const dictionariesStatuses: DictionariesStatus[] = [\n ...cachedKeys.map((dictionaryKey) => ({\n dictionaryKey,\n status: 'imported' as DictionaryStatus,\n })),\n ...keysToFetch.map((dictionaryKey) => ({\n dictionaryKey,\n status: 'pending' as const,\n })),\n ];\n\n // Initialize aggregated logger\n const logger = new PullLogger();\n logger.update(\n dictionariesStatuses.map<PullStatus>((s) => ({\n dictionaryKey: s.dictionaryKey,\n status: s.status,\n }))\n );\n\n const successfullyFetchedDictionaries: Dictionary[] = [];\n\n const processDictionary = async (\n statusObj: DictionariesStatus\n ): Promise<void> => {\n const isCached =\n statusObj.status === 'imported' || statusObj.status === 'up-to-date';\n\n if (!isCached) {\n statusObj.status = 'fetching';\n logger.update([\n { dictionaryKey: statusObj.dictionaryKey, status: 'fetching' },\n ]);\n }\n\n try {\n let sourceDictionary: Dictionary | undefined;\n\n if (isCached) {\n sourceDictionary = remoteDictionariesRecord[\n statusObj.dictionaryKey\n ] as Dictionary | undefined;\n }\n\n if (!sourceDictionary) {\n // Fetch the dictionary\n const getDictionaryResult =\n await intlayerAPI.dictionary.getDictionary(statusObj.dictionaryKey);\n\n sourceDictionary = getDictionaryResult.data as Dictionary | undefined;\n }\n\n if (!sourceDictionary) {\n throw new Error(\n `Dictionary ${statusObj.dictionaryKey} not found on remote`\n );\n }\n\n // Now, write the dictionary to local file\n const { status } = await writeContentDeclaration(\n sourceDictionary,\n config,\n options\n );\n\n statusObj.status = status;\n logger.update([{ dictionaryKey: statusObj.dictionaryKey, status }]);\n\n successfullyFetchedDictionaries.push(sourceDictionary);\n } catch (error) {\n statusObj.status = 'error';\n statusObj.error = error as Error;\n statusObj.errorMessage = `Error fetching dictionary ${statusObj.dictionaryKey}: ${error}`;\n logger.update([\n { dictionaryKey: statusObj.dictionaryKey, status: 'error' },\n ]);\n }\n };\n\n // Process dictionaries in parallel with concurrency limit\n await parallelize(dictionariesStatuses, processDictionary, 5);\n\n // Stop the logger and render final state\n logger.finish();\n\n // Per-dictionary summary\n const iconFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'fetched':\n case 'imported':\n case 'updated':\n case 'up-to-date':\n case 'reimported in JSON':\n case 'new content file':\n return '✔';\n case 'error':\n return '✖';\n default:\n return '⏲';\n }\n };\n\n const colorFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'fetched':\n case 'imported':\n case 'updated':\n case 'up-to-date':\n return ANSIColors.GREEN;\n case 'reimported in JSON':\n case 'new content file':\n return ANSIColors.YELLOW;\n case 'error':\n return ANSIColors.RED;\n default:\n return ANSIColors.BLUE;\n }\n };\n\n for (const s of dictionariesStatuses) {\n const icon = iconFor(s.status);\n const color = colorFor(s.status);\n appLogger(\n ` - ${s.dictionaryKey} ${ANSIColors.GREY}[${color}${icon} ${s.status}${ANSIColors.GREY}]${ANSIColors.RESET}`\n );\n }\n\n // Output any error messages\n for (const statusObj of dictionariesStatuses) {\n if (statusObj.errorMessage) {\n appLogger(statusObj.errorMessage, {\n level: 'error',\n });\n }\n }\n } catch (error) {\n appLogger(error, {\n level: 'error',\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAa,OAAO,OAAO,YAAyC;CAClE,MAAM,YAAY,aAAa,SAAS,eAAe,SAAS;AAEhE,KAAI;EACF,MAAM,SAAS,iBAAiB,SAAS,cAAc;AAIvD,MAAI,CAFe,MAAM,aAAa,OAAO,CAE5B;EAEjB,MAAM,cAAc,oBAAoB,QAAW,OAAO;EAG1D,MAAM,uCACJ,MAAM,YAAY,WAAW,gCAAgC;AAE/D,MAAI,CAAC,qCAAq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ACL,KAAK,mBACH,QAAO,WAAW;IACpB,KAAK,QACH,QAAO,WAAW;IACpB,QACE,QAAO,WAAW;;;AAIxB,OAAK,MAAM,KAAK,sBAAsB;GACpC,MAAM,OAAO,QAAQ,EAAE,OAAO;GAC9B,MAAM,QAAQ,SAAS,EAAE,OAAO;AAChC,aACE,MAAM,EAAE,cAAc,GAAG,WAAW,KAAK,GAAG,QAAQ,KAAK,GAAG,EAAE,SAAS,WAAW,KAAK,GAAG,WAAW,QACtG;;AAIH,OAAK,MAAM,aAAa,qBACtB,KAAI,UAAU,aACZ,WAAU,UAAU,cAAc,EAChC,OAAO,SACR,CAAC;UAGC,OAAO;AACd,YAAU,OAAO,EACf,OAAO,SACR,CAAC"}
1
+ {"version":3,"file":"pull.mjs","names":["distantDictionariesUpdateTimeStamp: Record<string, number>","remoteDictionariesRecord: Record<string, any>","dictionariesStatuses: DictionariesStatus[]","successfullyFetchedDictionaries: Dictionary[]","sourceDictionary: Dictionary | undefined"],"sources":["../../src/pull.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport {\n type DictionaryStatus,\n parallelize,\n writeContentDeclaration,\n} from '@intlayer/chokidar';\nimport {\n ANSIColors,\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n getProjectRequire,\n} from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/types';\nimport { PullLogger, type PullStatus } from './push/pullLog';\nimport { checkCMSAuth } from './utils/checkAccess';\n\ntype PullOptions = {\n dictionaries?: string[];\n newDictionariesPath?: string;\n configOptions?: GetConfigurationOptions;\n};\n\ntype DictionariesStatus = {\n dictionaryKey: string;\n status: DictionaryStatus | 'pending' | 'fetching' | 'error';\n error?: Error;\n errorMessage?: string;\n};\n\n/**\n * Fetch distant dictionaries and write them locally,\n * with progress indicators and concurrency control.\n */\nexport const pull = async (options?: PullOptions): Promise<void> => {\n const appLogger = getAppLogger(options?.configOptions?.override);\n\n try {\n const config = getConfiguration(options?.configOptions);\n\n const hasCMSAuth = await checkCMSAuth(config);\n\n if (!hasCMSAuth) return;\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, config);\n\n // Get remote update timestamps map\n const getDictionariesUpdateTimestampResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n if (!getDictionariesUpdateTimestampResult.data) {\n throw new Error('No distant dictionaries found');\n }\n\n let distantDictionariesUpdateTimeStamp: Record<string, number> =\n getDictionariesUpdateTimestampResult.data;\n\n // Optional filtering by requested dictionaries\n if (options?.dictionaries) {\n distantDictionariesUpdateTimeStamp = Object.fromEntries(\n Object.entries(distantDictionariesUpdateTimeStamp).filter(([key]) =>\n options.dictionaries?.includes(key)\n )\n );\n }\n\n // Load local cached remote dictionaries (if any)\n const remoteDictionariesPath = join(\n config.content.mainDir,\n 'remote_dictionaries.cjs'\n );\n const requireFunction = config.build?.require ?? getProjectRequire();\n const remoteDictionariesRecord: Record<string, any> = existsSync(\n remoteDictionariesPath\n )\n ? (requireFunction(remoteDictionariesPath) as any)\n : {};\n\n // Determine which keys need fetching by comparing updatedAt with local cache\n const entries = Object.entries(distantDictionariesUpdateTimeStamp);\n const keysToFetch = entries\n .filter(([key, remoteUpdatedAt]) => {\n if (!remoteUpdatedAt) return true;\n const local = (remoteDictionariesRecord as any)[key];\n if (!local) return true;\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n if (typeof localUpdatedAt !== 'number') return true;\n return remoteUpdatedAt > localUpdatedAt;\n })\n .map(([key]) => key);\n\n const cachedKeys = entries\n .filter(([key, remoteUpdatedAt]) => {\n const local = (remoteDictionariesRecord as any)[key];\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n })\n .map(([key]) => key);\n\n // Check if dictionaries list is empty\n if (entries.length === 0) {\n appLogger('No dictionaries to fetch', {\n level: 'error',\n });\n return;\n }\n\n appLogger('Fetching dictionaries:');\n\n // Prepare dictionaries statuses\n const dictionariesStatuses: DictionariesStatus[] = [\n ...cachedKeys.map((dictionaryKey) => ({\n dictionaryKey,\n status: 'imported' as DictionaryStatus,\n })),\n ...keysToFetch.map((dictionaryKey) => ({\n dictionaryKey,\n status: 'pending' as const,\n })),\n ];\n\n // Initialize aggregated logger\n const logger = new PullLogger();\n logger.update(\n dictionariesStatuses.map<PullStatus>((s) => ({\n dictionaryKey: s.dictionaryKey,\n status: s.status,\n }))\n );\n\n const successfullyFetchedDictionaries: Dictionary[] = [];\n\n const processDictionary = async (\n statusObj: DictionariesStatus\n ): Promise<void> => {\n const isCached =\n statusObj.status === 'imported' || statusObj.status === 'up-to-date';\n\n if (!isCached) {\n statusObj.status = 'fetching';\n logger.update([\n { dictionaryKey: statusObj.dictionaryKey, status: 'fetching' },\n ]);\n }\n\n try {\n let sourceDictionary: Dictionary | undefined;\n\n if (isCached) {\n sourceDictionary = remoteDictionariesRecord[\n statusObj.dictionaryKey\n ] as Dictionary | undefined;\n }\n\n if (!sourceDictionary) {\n // Fetch the dictionary\n const getDictionaryResult =\n await intlayerAPI.dictionary.getDictionary(statusObj.dictionaryKey);\n\n sourceDictionary = getDictionaryResult.data as Dictionary | undefined;\n }\n\n if (!sourceDictionary) {\n throw new Error(\n `Dictionary ${statusObj.dictionaryKey} not found on remote`\n );\n }\n\n // Now, write the dictionary to local file\n const { status } = await writeContentDeclaration(\n sourceDictionary,\n config,\n options\n );\n\n statusObj.status = status;\n logger.update([{ dictionaryKey: statusObj.dictionaryKey, status }]);\n\n successfullyFetchedDictionaries.push(sourceDictionary);\n } catch (error) {\n statusObj.status = 'error';\n statusObj.error = error as Error;\n statusObj.errorMessage = `Error fetching dictionary ${statusObj.dictionaryKey}: ${error}`;\n logger.update([\n { dictionaryKey: statusObj.dictionaryKey, status: 'error' },\n ]);\n }\n };\n\n // Process dictionaries in parallel with concurrency limit\n await parallelize(dictionariesStatuses, processDictionary, 5);\n\n // Stop the logger and render final state\n logger.finish();\n\n // Per-dictionary summary\n const iconFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'fetched':\n case 'imported':\n case 'updated':\n case 'up-to-date':\n case 'reimported in JSON':\n case 'new content file':\n return '✔';\n case 'error':\n return '✖';\n default:\n return '⏲';\n }\n };\n\n const colorFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'fetched':\n case 'imported':\n case 'updated':\n case 'up-to-date':\n return ANSIColors.GREEN;\n case 'reimported in JSON':\n case 'new content file':\n return ANSIColors.YELLOW;\n case 'error':\n return ANSIColors.RED;\n default:\n return ANSIColors.BLUE;\n }\n };\n\n for (const s of dictionariesStatuses) {\n const icon = iconFor(s.status);\n const color = colorFor(s.status);\n appLogger(\n ` - ${s.dictionaryKey} ${ANSIColors.GREY}[${color}${icon} ${s.status}${ANSIColors.GREY}]${ANSIColors.RESET}`\n );\n }\n\n // Output any error messages\n for (const statusObj of dictionariesStatuses) {\n if (statusObj.errorMessage) {\n appLogger(statusObj.errorMessage, {\n level: 'error',\n });\n }\n }\n } catch (error) {\n appLogger(error, {\n level: 'error',\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAa,OAAO,OAAO,YAAyC;CAClE,MAAM,YAAY,aAAa,SAAS,eAAe,SAAS;AAEhE,KAAI;EACF,MAAM,SAAS,iBAAiB,SAAS,cAAc;AAIvD,MAAI,CAFe,MAAM,aAAa,OAAO,CAE5B;EAEjB,MAAM,cAAc,oBAAoB,QAAW,OAAO;EAG1D,MAAM,uCACJ,M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WAAyC;AACzD,WAAQ,QAAR;IACE,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK,aACH,QAAO,WAAW;IACpB,KAAK;IACL,KAAK,mBACH,QAAO,WAAW;IACpB,KAAK,QACH,QAAO,WAAW;IACpB,QACE,QAAO,WAAW;;;AAIxB,OAAK,MAAM,KAAK,sBAAsB;GACpC,MAAM,OAAO,QAAQ,EAAE,OAAO;GAC9B,MAAM,QAAQ,SAAS,EAAE,OAAO;AAChC,aACE,MAAM,EAAE,cAAc,GAAG,WAAW,KAAK,GAAG,QAAQ,KAAK,GAAG,EAAE,SAAS,WAAW,KAAK,GAAG,WAAW,QACtG;;AAIH,OAAK,MAAM,aAAa,qBACtB,KAAI,UAAU,aACZ,WAAU,UAAU,cAAc,EAChC,OAAO,SACR,CAAC;UAGC,OAAO;AACd,YAAU,OAAO,EACf,OAAO,SACR,CAAC"}
@@ -9,7 +9,7 @@ const testMissingTranslations = async (options) => {
9
9
  const appLogger = getAppLogger(config, { config: { prefix: "" } });
10
10
  if (options?.build === true) await prepareIntlayer(config, { forceRun: true });
11
11
  else if (typeof options?.build === "undefined") await prepareIntlayer(config);
12
- const result = listMissingTranslations(void 0, options?.configOptions);
12
+ const result = listMissingTranslations(options?.configOptions);
13
13
  const maxKeyColSize = result.missingTranslations.map((t) => ` - ${t.key}`).reduce((max, t) => Math.max(max, t.length), 0);
14
14
  const maxLocalesColSize = result.missingTranslations.map((t) => formatLocale(t.locales, false)).reduce((max, t) => Math.max(max, t.length), 0);
15
15
  const formattedMissingTranslations = result.missingTranslations.map((translation) => [
@@ -22,8 +22,8 @@ const testMissingTranslations = async (options) => {
22
22
  colSize: maxLocalesColSize,
23
23
  maxSize: 40
24
24
  }),
25
- " - ",
26
- translation.filePath ? formatPath(translation.filePath) : "Remote"
25
+ translation.filePath ? ` - ${formatPath(translation.filePath)}` : "",
26
+ translation.id ? " - remote" : ""
27
27
  ].join(""));
28
28
  appLogger(`Missing translations:`, { level: "info" });
29
29
  formattedMissingTranslations.forEach((t) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/test/index.ts"],"sourcesContent":["import { formatLocale, formatPath, prepareIntlayer } from '@intlayer/chokidar';\nimport {\n ANSIColors,\n colon,\n colorize,\n colorizeKey,\n colorizeNumber,\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport { listMissingTranslations } from './listMissingTranslations';\n\nexport { listMissingTranslations };\n\ntype ListMissingTranslationsOptions = {\n configOptions?: GetConfigurationOptions;\n build?: boolean;\n};\n\nexport const testMissingTranslations = async (\n options?: ListMissingTranslationsOptions\n) => {\n const config = getConfiguration(options?.configOptions);\n const { locales, requiredLocales } = config.internationalization;\n\n const appLogger = getAppLogger(config, {\n config: {\n prefix: '',\n },\n });\n\n if (options?.build === true) {\n await prepareIntlayer(config, { forceRun: true });\n } else if (typeof options?.build === 'undefined') {\n await prepareIntlayer(config);\n }\n\n const result = listMissingTranslations(undefined, options?.configOptions);\n\n const maxKeyColSize = result.missingTranslations\n .map((t) => ` - ${t.key}`)\n .reduce((max, t) => Math.max(max, t.length), 0);\n const maxLocalesColSize = result.missingTranslations\n .map((t) => formatLocale(t.locales, false))\n .reduce((max, t) => Math.max(max, t.length), 0);\n\n const formattedMissingTranslations = result.missingTranslations.map(\n (translation) =>\n [\n colon(` - ${colorizeKey(translation.key)}`, {\n colSize: maxKeyColSize,\n maxSize: 40,\n }),\n ' - ',\n colon(formatLocale(translation.locales, ANSIColors.RED), {\n colSize: maxLocalesColSize,\n maxSize: 40,\n }),\n ' - ',\n translation.filePath ? formatPath(translation.filePath) : 'Remote',\n ].join('')\n );\n\n appLogger(`Missing translations:`, {\n level: 'info',\n });\n\n formattedMissingTranslations.forEach((t) => {\n appLogger(t, {\n level: 'info',\n });\n });\n\n appLogger(`Locales: ${formatLocale(locales)}`);\n appLogger(`Required locales: ${formatLocale(requiredLocales ?? locales)}`);\n appLogger(\n `Missing locales: ${result.missingLocales.length === 0 ? colorize('-', ANSIColors.GREEN) : formatLocale(result.missingLocales, ANSIColors.RED)}`\n );\n\n appLogger(\n `Missing required locales: ${result.missingRequiredLocales.length === 0 ? colorize('-', ANSIColors.GREEN) : formatLocale(result.missingRequiredLocales, ANSIColors.RED)}`\n );\n appLogger(\n `Total missing locales: ${colorizeNumber(result.missingLocales.length, {\n one: ANSIColors.RED,\n other: ANSIColors.RED,\n zero: ANSIColors.GREEN,\n })}`\n );\n appLogger(\n `Total missing required locales: ${colorizeNumber(\n result.missingRequiredLocales.length,\n {\n one: ANSIColors.RED,\n other: ANSIColors.RED,\n zero: ANSIColors.GREEN,\n }\n )}`\n );\n};\n"],"mappings":";;;;;AAoBA,MAAa,0BAA0B,OACrC,YACG;CACH,MAAM,SAAS,iBAAiB,SAAS,cAAc;CACvD,MAAM,EAAE,SAAS,oBAAoB,OAAO;CAE5C,MAAM,YAAY,aAAa,QAAQ,EACrC,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAEF,KAAI,SAAS,UAAU,KACrB,OAAM,gBAAgB,QAAQ,EAAE,UAAU,MAAM,CAAC;UACxC,OAAO,SAAS,UAAU,YACnC,OAAM,gBAAgB,OAAO;CAG/B,MAAM,SAAS,wBAAwB,QAAW,SAAS,cAAc;CAEzE,MAAM,gBAAgB,OAAO,oBAC1B,KAAK,MAAM,MAAM,EAAE,MAAM,CACzB,QAAQ,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,OAAO,EAAE,EAAE;CACjD,MAAM,oBAAoB,OAAO,oBAC9B,KAAK,MAAM,aAAa,EAAE,SAAS,MAAM,CAAC,CAC1C,QAAQ,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,OAAO,EAAE,EAAE;CAEjD,MAAM,+BAA+B,OAAO,oBAAoB,KAC7D,gBACC;EACE,MAAM,MAAM,YAAY,YAAY,IAAI,IAAI;GAC1C,SAAS;GACT,SAAS;GACV,CAAC;EACF;EACA,MAAM,aAAa,YAAY,SAAS,WAAW,IAAI,EAAE;GACvD,SAAS;GACT,SAAS;GACV,CAAC;EACF;EACA,YAAY,WAAW,WAAW,YAAY,SAAS,GAAG;EAC3D,CAAC,KAAK,GAAG,CACb;AAED,WAAU,yBAAyB,EACjC,OAAO,QACR,CAAC;AAEF,8BAA6B,SAAS,MAAM;AAC1C,YAAU,GAAG,EACX,OAAO,QACR,CAAC;GACF;AAEF,WAAU,YAAY,aAAa,QAAQ,GAAG;AAC9C,WAAU,qBAAqB,aAAa,mBAAmB,QAAQ,GAAG;AAC1E,WACE,oBAAoB,OAAO,eAAe,WAAW,IAAI,SAAS,KAAK,WAAW,MAAM,GAAG,aAAa,OAAO,gBAAgB,WAAW,IAAI,GAC/I;AAED,WACE,6BAA6B,OAAO,uBAAuB,WAAW,IAAI,SAAS,KAAK,WAAW,MAAM,GAAG,aAAa,OAAO,wBAAwB,WAAW,IAAI,GACxK;AACD,WACE,0BAA0B,eAAe,OAAO,eAAe,QAAQ;EACrE,KAAK,WAAW;EAChB,OAAO,WAAW;EAClB,MAAM,WAAW;EAClB,CAAC,GACH;AACD,WACE,mCAAmC,eACjC,OAAO,uBAAuB,QAC9B;EACE,KAAK,WAAW;EAChB,OAAO,WAAW;EAClB,MAAM,WAAW;EAClB,CACF,GACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/test/index.ts"],"sourcesContent":["import { formatLocale, formatPath, prepareIntlayer } from '@intlayer/chokidar';\nimport {\n ANSIColors,\n colon,\n colorize,\n colorizeKey,\n colorizeNumber,\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport { listMissingTranslations } from './listMissingTranslations';\n\nexport { listMissingTranslations };\n\ntype ListMissingTranslationsOptions = {\n configOptions?: GetConfigurationOptions;\n build?: boolean;\n};\n\nexport const testMissingTranslations = async (\n options?: ListMissingTranslationsOptions\n) => {\n const config = getConfiguration(options?.configOptions);\n const { locales, requiredLocales } = config.internationalization;\n\n const appLogger = getAppLogger(config, {\n config: {\n prefix: '',\n },\n });\n\n if (options?.build === true) {\n await prepareIntlayer(config, { forceRun: true });\n } else if (typeof options?.build === 'undefined') {\n await prepareIntlayer(config);\n }\n\n const result = listMissingTranslations(options?.configOptions);\n\n const maxKeyColSize = result.missingTranslations\n .map((t) => ` - ${t.key}`)\n .reduce((max, t) => Math.max(max, t.length), 0);\n const maxLocalesColSize = result.missingTranslations\n .map((t) => formatLocale(t.locales, false))\n .reduce((max, t) => Math.max(max, t.length), 0);\n\n const formattedMissingTranslations = result.missingTranslations.map(\n (translation) =>\n [\n colon(` - ${colorizeKey(translation.key)}`, {\n colSize: maxKeyColSize,\n maxSize: 40,\n }),\n ' - ',\n colon(formatLocale(translation.locales, ANSIColors.RED), {\n colSize: maxLocalesColSize,\n maxSize: 40,\n }),\n\n translation.filePath ? ` - ${formatPath(translation.filePath)}` : '',\n translation.id ? ' - remote' : '',\n ].join('')\n );\n\n appLogger(`Missing translations:`, {\n level: 'info',\n });\n\n formattedMissingTranslations.forEach((t) => {\n appLogger(t, {\n level: 'info',\n });\n });\n\n appLogger(`Locales: ${formatLocale(locales)}`);\n appLogger(`Required locales: ${formatLocale(requiredLocales ?? locales)}`);\n appLogger(\n `Missing locales: ${result.missingLocales.length === 0 ? colorize('-', ANSIColors.GREEN) : formatLocale(result.missingLocales, ANSIColors.RED)}`\n );\n\n appLogger(\n `Missing required locales: ${result.missingRequiredLocales.length === 0 ? colorize('-', ANSIColors.GREEN) : formatLocale(result.missingRequiredLocales, ANSIColors.RED)}`\n );\n appLogger(\n `Total missing locales: ${colorizeNumber(result.missingLocales.length, {\n one: ANSIColors.RED,\n other: ANSIColors.RED,\n zero: ANSIColors.GREEN,\n })}`\n );\n appLogger(\n `Total missing required locales: ${colorizeNumber(\n result.missingRequiredLocales.length,\n {\n one: ANSIColors.RED,\n other: ANSIColors.RED,\n zero: ANSIColors.GREEN,\n }\n )}`\n );\n};\n"],"mappings":";;;;;AAoBA,MAAa,0BAA0B,OACrC,YACG;CACH,MAAM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AO,uBAAuB,WAAW,IAAI,SAAS,KAAK,WAAW,MAAM,GAAG,aAAa,OAAO,wBAAwB,WAAW,IAAI,GACxK;AACD,WACE,0BAA0B,eAAe,OAAO,eAAe,QAAQ;EACrE,KAAK,WAAW;EAChB,OAAO,WAAW;EAClB,MAAM,WAAW;EAClB,CAAC,GACH;AACD,WACE,mCAAmC,eACjC,OAAO,uBAAuB,QAC9B;EACE,KAAK,WAAW;EAChB,OAAO,WAAW;EAClB,MAAM,WAAW;EAClB,CACF,GACF"}
@@ -1,22 +1,33 @@
1
1
  import { getConfiguration } from "@intlayer/config";
2
2
  import { getUnmergedDictionaries } from "@intlayer/unmerged-dictionaries-entry";
3
- import { getMissingLocalesContent } from "@intlayer/core";
3
+ import { getMissingLocalesContentFromDictionary } from "@intlayer/core";
4
+ import { getDictionaries } from "@intlayer/dictionaries-entry";
4
5
 
5
6
  //#region src/test/listMissingTranslations.ts
6
- const listMissingTranslations = (dictionariesRecord, configurationOptions) => {
7
+ const listMissingTranslations = (configurationOptions) => {
7
8
  const configuration = getConfiguration(configurationOptions);
8
- const unmergedDictionariesRecord = dictionariesRecord ?? getUnmergedDictionaries(configuration);
9
+ const unmergedDictionariesRecord = getUnmergedDictionaries(configuration);
10
+ const mergedDictionaries = getDictionaries(configuration);
9
11
  const missingTranslations = [];
10
12
  const { locales, requiredLocales } = configuration.internationalization;
11
- for (const dictionaries of Object.values(unmergedDictionariesRecord)) for (const dictionary of dictionaries) {
12
- const missingLocales$1 = getMissingLocalesContent(dictionary, configuration.internationalization.locales, {
13
- dictionaryKey: dictionary.key,
14
- keyPath: [],
15
- plugins: []
16
- });
13
+ const dictionariesKeys = Object.keys(unmergedDictionariesRecord);
14
+ for (const dictionaryKey of dictionariesKeys) {
15
+ const dictionaries = unmergedDictionariesRecord[dictionaryKey];
16
+ const multilingualDictionary = dictionaries.filter((dictionary) => !dictionary.locale);
17
+ for (const dictionary of multilingualDictionary) {
18
+ const missingLocales$2 = getMissingLocalesContentFromDictionary(dictionary, locales);
19
+ if (missingLocales$2.length > 0) missingTranslations.push({
20
+ key: dictionaryKey,
21
+ id: dictionary.id,
22
+ filePath: dictionary.filePath,
23
+ locales: missingLocales$2
24
+ });
25
+ }
26
+ if (dictionaries.filter((dictionary) => dictionary.locale).length === 0) continue;
27
+ const mergedDictionary = mergedDictionaries[dictionaryKey];
28
+ const missingLocales$1 = getMissingLocalesContentFromDictionary(mergedDictionary, locales);
17
29
  if (missingLocales$1.length > 0) missingTranslations.push({
18
- key: dictionary.key,
19
- filePath: dictionary.filePath,
30
+ key: dictionaryKey,
20
31
  locales: missingLocales$1
21
32
  });
22
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"listMissingTranslations.mjs","names":["missingTranslations: {\n key: string;\n filePath?: string;\n locales: Locale[];\n }[]","missingLocales"],"sources":["../../../src/test/listMissingTranslations.ts"],"sourcesContent":["import {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config';\nimport { getMissingLocalesContent } from '@intlayer/core';\nimport type { ContentNode, Dictionary, Locale } from '@intlayer/types';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\n\nexport const listMissingTranslations = (\n dictionariesRecord?: Record<string, Dictionary[]>,\n configurationOptions?: GetConfigurationOptions\n) => {\n const configuration = getConfiguration(configurationOptions);\n const unmergedDictionariesRecord =\n dictionariesRecord ?? getUnmergedDictionaries(configuration);\n\n const missingTranslations: {\n key: string;\n filePath?: string;\n locales: Locale[];\n }[] = [];\n\n const { locales, requiredLocales } = configuration.internationalization;\n\n for (const dictionaries of Object.values(unmergedDictionariesRecord)) {\n for (const dictionary of dictionaries as unknown as Dictionary[]) {\n const missingLocales = getMissingLocalesContent(\n dictionary as unknown as ContentNode,\n configuration.internationalization.locales,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n plugins: [],\n }\n );\n\n if (missingLocales.length > 0) {\n missingTranslations.push({\n key: dictionary.key,\n filePath: dictionary.filePath,\n locales: missingLocales,\n });\n }\n }\n }\n\n const missingLocalesSet = new Set(\n missingTranslations.flatMap((t) => t.locales)\n );\n const missingLocales = Array.from(missingLocalesSet);\n\n const missingRequiredLocales = missingLocales.filter((locale) =>\n (requiredLocales ?? locales).includes(locale)\n );\n\n return { missingTranslations, missingLocales, missingRequiredLocales };\n};\n"],"mappings":";;;;;AAQA,MAAa,2BACX,oBACA,yBACG;CACH,MAAM,gBAAgB,iBAAiB,qBAAqB;CAC5D,MAAM,6BACJ,sBAAsB,wBAAwB,cAAc;CAE9D,MAAMA,sBAIA,EAAE;CAER,MAAM,EAAE,SAAS,oBAAoB,cAAc;AAEnD,MAAK,MAAM,gBAAgB,OAAO,OAAO,2BAA2B,CAClE,MAAK,MAAM,cAAc,cAAyC;EAChE,MAAMC,mBAAiB,yBACrB,YACA,cAAc,qBAAqB,SACnC;GACE,eAAe,WAAW;GAC1B,SAAS,EAAE;GACX,SAAS,EAAE;GACZ,CACF;AAED,MAAIA,iBAAe,SAAS,EAC1B,qBAAoB,KAAK;GACvB,KAAK,WAAW;GAChB,UAAU,WAAW;GACrB,SAASA;GACV,CAAC;;CAKR,MAAM,oBAAoB,IAAI,IAC5B,oBAAoB,SAAS,MAAM,EAAE,QAAQ,CAC9C;CACD,MAAM,iBAAiB,MAAM,KAAK,kBAAkB;AAMpD,QAAO;EAAE;EAAqB;EAAgB,wBAJf,eAAe,QAAQ,YACnD,mBAAmB,SAAS,SAAS,OAAO,CAC9C;EAEqE"}
1
+ {"version":3,"file":"listMissingTranslations.mjs","names":["missingTranslations: {\n key: string;\n filePath?: string;\n id?: string;\n locales: Locale[];\n }[]","dictionaries: Dictionary[]","multilingualDictionary: Dictionary[]","missingLocales"],"sources":["../../../src/test/listMissingTranslations.ts"],"sourcesContent":["import {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config';\nimport { getMissingLocalesContentFromDictionary } from '@intlayer/core';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { Dictionary, Locale } from '@intlayer/types';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\n\nexport const listMissingTranslations = (\n configurationOptions?: GetConfigurationOptions\n) => {\n const configuration = getConfiguration(configurationOptions);\n const unmergedDictionariesRecord = getUnmergedDictionaries(configuration);\n const mergedDictionaries = getDictionaries(configuration);\n\n const missingTranslations: {\n key: string;\n filePath?: string;\n id?: string;\n locales: Locale[];\n }[] = [];\n\n const { locales, requiredLocales } = configuration.internationalization;\n\n const dictionariesKeys = Object.keys(unmergedDictionariesRecord);\n\n for (const dictionaryKey of dictionariesKeys) {\n const dictionaries: Dictionary[] =\n unmergedDictionariesRecord[dictionaryKey];\n\n const multilingualDictionary: Dictionary[] = dictionaries.filter(\n (dictionary) => !dictionary.locale\n );\n\n // 2 - Test all by merging all dictionaries to ensure no per-locale dictionary is missing\n for (const dictionary of multilingualDictionary) {\n const missingLocales = getMissingLocalesContentFromDictionary(\n dictionary,\n locales\n );\n\n if (missingLocales.length > 0) {\n missingTranslations.push({\n key: dictionaryKey,\n id: dictionary.id,\n filePath: dictionary.filePath,\n locales: missingLocales,\n });\n }\n }\n\n const perLocaleDictionary: Dictionary[] = dictionaries.filter(\n (dictionary) => dictionary.locale\n );\n\n if (perLocaleDictionary.length === 0) {\n continue;\n }\n\n const mergedDictionary = mergedDictionaries[dictionaryKey];\n\n const missingLocales = getMissingLocalesContentFromDictionary(\n mergedDictionary,\n locales\n );\n\n if (missingLocales.length > 0) {\n missingTranslations.push({\n key: dictionaryKey,\n locales: missingLocales,\n });\n }\n }\n\n const missingLocalesSet = new Set(\n missingTranslations.flatMap((t) => t.locales)\n );\n const missingLocales = Array.from(missingLocalesSet);\n\n const missingRequiredLocales = missingLocales.filter((locale) =>\n (requiredLocales ?? locales).includes(locale)\n );\n\n return { missingTranslations, missingLocales, missingRequiredLocales };\n};\n"],"mappings":";;;;;;AASA,MAAa,2BACX,yBACG;CACH,MAAM,gBAAgB,iBAAiB,qBAAqB;CAC5D,MAAM,6BAA6B,wBAAwB,cAAc;CACzE,MAAM,qBAAqB,gBAAgB,cAAc;CAEzD,MAAMA,sBAKA,EAAE;CAER,MAAM,EAAE,SAAS,oBAAoB,cAAc;CAEnD,MAAM,mBAAmB,OAAO,KAAK,2BAA2B;AAEhE,MAAK,MAAM,iBAAiB,kBAAkB;EAC5C,MAAMC,eACJ,2BAA2B;EAE7B,MAAMC,yBAAuC,aAAa,QACvD,eAAe,CAAC,WAAW,OAC7B;AAGD,OAAK,MAAM,cAAc,wBAAwB;GAC/C,MAAMC,mBAAiB,uCACrB,YACA,QACD;AAED,OAAIA,iBAAe,SAAS,EAC1B,qBAAoB,KAAK;IACvB,KAAK;IACL,IAAI,WAAW;IACf,UAAU,WAAW;IACrB,SAASA;IACV,CAAC;;AAQN,MAJ0C,aAAa,QACpD,eAAe,WAAW,OAC5B,CAEuB,WAAW,EACjC;EAGF,MAAM,mBAAmB,mBAAmB;EAE5C,MAAMA,mBAAiB,uCACrB,kBACA,QACD;AAED,MAAIA,iBAAe,SAAS,EAC1B,qBAAoB,KAAK;GACvB,KAAK;GACL,SAASA;GACV,CAAC;;CAIN,MAAM,oBAAoB,IAAI,IAC5B,oBAAoB,SAAS,MAAM,EAAE,QAAQ,CAC9C;CACD,MAAM,iBAAiB,MAAM,KAAK,kBAAkB;AAMpD,QAAO;EAAE;EAAqB;EAAgB,wBAJf,eAAe,QAAQ,YACnD,mBAAmB,SAAS,SAAS,OAAO,CAC9C;EAEqE"}
@@ -20,12 +20,7 @@ const checkCMSAuth = async (configuration) => {
20
20
  const checkAIAccess = async (configuration, aiOptions) => {
21
21
  const appLogger = getAppLogger(configuration);
22
22
  const hasCMSAuth = Boolean(configuration.editor.clientId && configuration.editor.clientSecret);
23
- const hasHisOwnAIAPIKey = Boolean(configuration.ai?.apiKey || aiOptions?.apiKey);
24
- console.log({
25
- hasCMSAuth,
26
- hasHisOwnAIAPIKey
27
- });
28
- if (hasHisOwnAIAPIKey) return true;
23
+ if (Boolean(configuration.ai?.apiKey || aiOptions?.apiKey)) return true;
29
24
  if (!hasCMSAuth) {
30
25
  appLogger("AI options or API key not provided.", { level: "error" });
31
26
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n const hasHisOwnAIAPIKey = Boolean(\n configuration.ai?.apiKey || aiOptions?.apiKey\n );\n\n console.log({ hasCMSAuth, hasHisOwnAIAPIKey });\n\n if (hasHisOwnAIAPIKey) {\n return true;\n }\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n return await checkCMSAuth(configuration);\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,YAAY,aAAa,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,cAAc,oBAAoB,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,YAFgB,oBAAoB,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,YAAY,aAAa,cAAc;CAE7C,MAAM,aAAa,QACjB,cAAc,OAAO,YAAY,cAAc,OAAO,aACvD;CACD,MAAM,oBAAoB,QACxB,cAAc,IAAI,UAAU,WAAW,OACxC;AAED,SAAQ,IAAI;EAAE;EAAY;EAAmB,CAAC;AAE9C,KAAI,kBACF,QAAO;AAIT,KAAI,CAAC,YAAY;AACf,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,QAAO,MAAM,aAAa,cAAc"}
1
+ {"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n const hasHisOwnAIAPIKey = Boolean(\n configuration.ai?.apiKey || aiOptions?.apiKey\n );\n\n if (hasHisOwnAIAPIKey) {\n return true;\n }\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n return await checkCMSAuth(configuration);\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,YAAY,aAAa,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,cAAc,oBAAoB,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,YAFgB,oBAAoB,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,YAAY,aAAa,cAAc;CAE7C,MAAM,aAAa,QACjB,cAAc,OAAO,YAAY,cAAc,OAAO,aACvD;AAKD,KAJ0B,QACxB,cAAc,IAAI,UAAU,WAAW,OACxC,CAGC,QAAO;AAIT,KAAI,CAAC,YAAY;AACf,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,QAAO,MAAM,aAAa,cAAc"}
@@ -8,7 +8,7 @@ import { getAppLogger, getConfiguration } from "@intlayer/config";
8
8
  */
9
9
  const watchContentDeclaration = async (options) => {
10
10
  const appLogger = getAppLogger(getConfiguration(options?.configOptions));
11
- if (options?.with) runParallel(options.with);
11
+ if (options?.with) runParallel(options.with).result.catch(() => {});
12
12
  appLogger("Watching Intlayer content declarations");
13
13
  watch({
14
14
  persistent: true,
@@ -1 +1 @@
1
- {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { runParallel, watch } from '@intlayer/chokidar';\nimport {\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(config);\n\n if (options?.with) {\n runParallel(options.with);\n }\n\n appLogger('Watching Intlayer content declarations');\n\n watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n};\n"],"mappings":";;;;;;;;AAiBA,MAAa,0BAA0B,OAAO,YAA2B;CAEvE,MAAM,YAAY,aADH,iBAAiB,SAAS,cAAc,CACjB;AAEtC,KAAI,SAAS,KACX,aAAY,QAAQ,KAAK;AAG3B,WAAU,yCAAyC;AAEnD,OAAM;EACJ,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC"}
1
+ {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { runParallel, watch } from '@intlayer/chokidar';\nimport {\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(config);\n\n if (options?.with) {\n const parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n });\n }\n\n appLogger('Watching Intlayer content declarations');\n\n watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n};\n"],"mappings":";;;;;;;;AAiBA,MAAa,0BAA0B,OAAO,YAA2B;CAEvE,MAAM,YAAY,aADH,iBAAiB,SAAS,cAAc,CACjB;AAEtC,KAAI,SAAS,KAGX,CAFwB,YAAY,QAAQ,KAAK,CAEjC,OAAO,YAAY,GAEjC;AAGJ,WAAU,yCAAyC;AAEnD,OAAM;EACJ,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","names":[],"sources":["../../src/build.ts"],"sourcesContent":[],"mappings":";;;KAUK,YAAA;;EAAA,WAAA,CAAA,EAAA,OAAY;EAWJ,IAAA,CAAA,EAAA,MAiBZ,GAAA,MAjBqC,EAAA;kBAPpB;;;;;;cAOL,kBAAyB,iBAAY"}
1
+ {"version":3,"file":"build.d.ts","names":[],"sources":["../../src/build.ts"],"sourcesContent":[],"mappings":";;;KAUK,YAAA;;EAAA,WAAA,CAAA,EAAA,OAAY;EAWJ,IAAA,CAAA,EAAA,MAqBZ,GAAA,MArBqC,EAAA;kBAPpB;;;;;;cAOL,kBAAyB,iBAAY"}
@@ -10,6 +10,7 @@ type ConfigurationOptions = {
10
10
  baseDir?: string;
11
11
  env?: string;
12
12
  envFile?: string;
13
+ noCache?: boolean;
13
14
  } & LogOptions;
14
15
  /**
15
16
  * Set the API for the CLI
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"sourcesContent":[],"mappings":";;;cAgCa;KAqIR,UAAA;EArIQ,MAAA,CAAA,EAAA,MAEA;EAmIR,OAAA,CAAA,EAAA,OAAU;AAKf,CAAA;AAyDa,KAzDD,oBAAA,GAqkBX;;;;IAjkBG;;;;;;;;;cAqDS,cAAa"}
1
+ {"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"sourcesContent":[],"mappings":";;;cAgCa;KAsIR,UAAA;EAtIQ,MAAA,CAAA,EAAA,MAEA;EAoIR,OAAA,CAAA,EAAA,OAAU;AAKf,CAAA;AA2Da,KA3DD,oBAAA,GAukBX;;;;;IAlkBG;;;;;;;;;cAsDS,cAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","names":[],"sources":["../../src/config.ts"],"sourcesContent":[],"mappings":";;;KAMK,aAAA;kBACa;AAHQ,CAAA;AAMb,cAAA,SAAuB,EAAA,CAAA,OAAa,CAAb,EAAA,aAAa,EAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"config.d.ts","names":[],"sources":["../../src/config.ts"],"sourcesContent":[],"mappings":";;;KAMK,aAAA;kBACa;AAHQ,CAAA;AAMb,cAAA,SAAuB,EAAA,CAAA,OAAa,CAAA,EAAb,aAAa,EAAA,GAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"sourcesContent":[],"mappings":";;;;;;KAoCY,WAAA;iBACK;EADL,aAAA,CAAW,EAEL,MAFK,GAEI,MAFJ,EAAA;EACN,IAAA,CAAA,EAAA,UAAA,GAAA,QAAA;EACC,UAAA,CAAA,EAEH,mBAFG;EAAS,SAAA,CAAA,EAGb,SAHa;EAEZ,OAAA,CAAA,EAAA,OAAA;EACD,wBAAA,CAAA,EAAA,MAAA;EAMV,iBAAA,CAAA,EAAA,MAAA;EAA0B,KAAA,CAAA,EAAA,OAAA;EAKjB,YAmIZ,CAAA,EAAA,OAnIoC;IALjC;;;;cAKS,iBAAwB,gBAAc"}
1
+ {"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"sourcesContent":[],"mappings":";;;;;;KAoCY,WAAA;iBACK;EADL,aAAA,CAAW,EAEL,MAFK,GAEI,MAFJ,EAAA;EACN,IAAA,CAAA,EAAA,UAAA,GAAA,QAAA;EACC,UAAA,CAAA,EAEH,mBAFG;EAAS,SAAA,CAAA,EAGb,SAHa;EAEZ,OAAA,CAAA,EAAA,OAAA;EACD,wBAAA,CAAA,EAAA,MAAA;EAMV,iBAAA,CAAA,EAAA,MAAA;EAA0B,KAAA,CAAA,EAAA,OAAA;EAKjB,YAwIZ,CAAA,EAAA,OAxIoC;IALjC;;;;cAKS,iBAAwB,gBAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"listTranslationsTasks.d.ts","names":[],"sources":["../../../src/fill/listTranslationsTasks.ts"],"sourcesContent":[],"mappings":";;;KAwBY,eAAA;;EAAA,iBAAA,EAES,iBAFM;EAEN,YAAA,EACL,MADK;EACL,aAAA,EACC,MADD,EAAA;EACC,gBAAA,EAAA,MAAA;EAAM,kBAAA,EAAA,MAAA;AAKvB,CAAA;AACY,cADC,qBACD,EAAA,CAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,aAAA,EACK,MADL,EAAA,EAAA,IAAA,EAAA,UAAA,GAAA,QAAA,EAAA,UAAA,EAGE,MAHF,EAAA,aAAA,EAIK,cAJL,EAAA,GAKT,eALS,EAAA"}
1
+ {"version":3,"file":"listTranslationsTasks.d.ts","names":[],"sources":["../../../src/fill/listTranslationsTasks.ts"],"sourcesContent":[],"mappings":";;;KAuBY,eAAA;;EAAA,iBAAA,EAES,iBAFM;EAEN,YAAA,EACL,MADK;EACL,aAAA,EACC,MADD,EAAA;EACC,gBAAA,EAAA,MAAA;EAAM,kBAAA,EAAA,MAAA;AAKvB,CAAA;AACY,cADC,qBACD,EAAA,CAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,aAAA,EACK,MADL,EAAA,EAAA,IAAA,EAAA,UAAA,GAAA,QAAA,EAAA,UAAA,EAGE,MAHF,EAAA,aAAA,EAIK,cAJL,EAAA,GAKT,eALS,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pull.d.ts","names":[],"sources":["../../src/pull.ts"],"sourcesContent":[],"mappings":";;;KAmBK,WAAA;;EAAA,mBAAW,CAAA,EAAA,MAGE;EAcL,aA6OZ,CAAA,EA3PiB,uBAciC;;;;;;cAAtC,iBAAwB,gBAAc"}
1
+ {"version":3,"file":"pull.d.ts","names":[],"sources":["../../src/pull.ts"],"sourcesContent":[],"mappings":";;;KAmBK,WAAA;;EAAA,mBAAW,CAAA,EAAA,MAGE;EAcL,aA8OZ,CAAA,EA5PiB,uBAciC;;;;;;cAAtC,iBAAwB,gBAAc"}
@@ -1,11 +1,12 @@
1
- import { Dictionary, Locale } from "@intlayer/types";
1
+ import { Locale } from "@intlayer/types";
2
2
  import { GetConfigurationOptions } from "@intlayer/config";
3
3
 
4
4
  //#region src/test/listMissingTranslations.d.ts
5
- declare const listMissingTranslations: (dictionariesRecord?: Record<string, Dictionary[]>, configurationOptions?: GetConfigurationOptions) => {
5
+ declare const listMissingTranslations: (configurationOptions?: GetConfigurationOptions) => {
6
6
  missingTranslations: {
7
7
  key: string;
8
8
  filePath?: string;
9
+ id?: string;
9
10
  locales: Locale[];
10
11
  }[];
11
12
  missingLocales: Locale[];
@@ -1 +1 @@
1
- {"version":3,"file":"listMissingTranslations.d.ts","names":[],"sources":["../../../src/test/listMissingTranslations.ts"],"sourcesContent":[],"mappings":";;;;cAQa,+CACU,eAAe,sCACb;;IAFZ,GAAA,EAAA,MAAA;IACyB,QAAA,CAAA,EAAA,MAAA;IAAf,OAAA,EAUV,MAVU,EAAA;EACE,CAAA,EAAA;EASZ,cAAA,QAAA,EAAA"}
1
+ {"version":3,"file":"listMissingTranslations.d.ts","names":[],"sources":["../../../src/test/listMissingTranslations.ts"],"sourcesContent":[],"mappings":";;;;cASa,iDACY;;IADZ,GAAA,EAAA,MAAA;IACY,QAAA,CAAA,EAAA,MAAA;IAUZ,EAAA,CAAA,EAAA,MAAA;aAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "7.0.3",
3
+ "version": "7.0.4",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -63,36 +63,36 @@
63
63
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
64
64
  },
65
65
  "dependencies": {
66
- "@intlayer/api": "7.0.3",
67
- "@intlayer/chokidar": "7.0.3",
68
- "@intlayer/config": "7.0.3",
69
- "@intlayer/dictionaries-entry": "7.0.3",
70
- "@intlayer/remote-dictionaries-entry": "7.0.3",
71
- "@intlayer/types": "7.0.3",
72
- "@intlayer/unmerged-dictionaries-entry": "7.0.3",
66
+ "@intlayer/api": "7.0.4",
67
+ "@intlayer/chokidar": "7.0.4",
68
+ "@intlayer/config": "7.0.4",
69
+ "@intlayer/dictionaries-entry": "7.0.4",
70
+ "@intlayer/remote-dictionaries-entry": "7.0.4",
71
+ "@intlayer/types": "7.0.4",
72
+ "@intlayer/unmerged-dictionaries-entry": "7.0.4",
73
73
  "commander": "14.0.1",
74
74
  "eventsource": "3.0.7",
75
75
  "fast-glob": "3.3.3"
76
76
  },
77
77
  "devDependencies": {
78
- "@intlayer/core": "7.0.3",
78
+ "@intlayer/core": "7.0.4",
79
79
  "@types/node": "24.9.2",
80
- "@utils/ts-config": "7.0.3",
81
- "@utils/ts-config-types": "7.0.3",
82
- "@utils/tsdown-config": "7.0.3",
80
+ "@utils/ts-config": "7.0.4",
81
+ "@utils/ts-config-types": "7.0.4",
82
+ "@utils/tsdown-config": "7.0.4",
83
83
  "rimraf": "6.0.1",
84
84
  "tsdown": "0.15.11",
85
85
  "typescript": "5.9.3",
86
86
  "vitest": "4.0.5"
87
87
  },
88
88
  "peerDependencies": {
89
- "@intlayer/api": "7.0.3",
90
- "@intlayer/chokidar": "7.0.3",
91
- "@intlayer/config": "7.0.3",
92
- "@intlayer/dictionaries-entry": "7.0.3",
93
- "@intlayer/remote-dictionaries-entry": "7.0.3",
94
- "@intlayer/types": "7.0.3",
95
- "@intlayer/unmerged-dictionaries-entry": "7.0.3"
89
+ "@intlayer/api": "7.0.4",
90
+ "@intlayer/chokidar": "7.0.4",
91
+ "@intlayer/config": "7.0.4",
92
+ "@intlayer/dictionaries-entry": "7.0.4",
93
+ "@intlayer/remote-dictionaries-entry": "7.0.4",
94
+ "@intlayer/types": "7.0.4",
95
+ "@intlayer/unmerged-dictionaries-entry": "7.0.4"
96
96
  },
97
97
  "bug": {
98
98
  "url": "https://github.com/aymericzip/intlayer/issues"