@intlayer/chokidar 7.5.10 → 7.5.12

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 (46) hide show
  1. package/dist/cjs/index.cjs +2 -0
  2. package/dist/cjs/init/index.cjs +101 -2
  3. package/dist/cjs/init/index.cjs.map +1 -1
  4. package/dist/cjs/listDictionariesPath.cjs +16 -1
  5. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  6. package/dist/cjs/listProjects.cjs +47 -0
  7. package/dist/cjs/listProjects.cjs.map +1 -0
  8. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +4 -13
  9. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  10. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  11. package/dist/cjs/utils/getComponentTransformPattern.cjs +4 -2
  12. package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
  13. package/dist/esm/index.mjs +2 -1
  14. package/dist/esm/init/index.mjs +101 -2
  15. package/dist/esm/init/index.mjs.map +1 -1
  16. package/dist/esm/listDictionariesPath.mjs +16 -1
  17. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  18. package/dist/esm/listProjects.mjs +44 -0
  19. package/dist/esm/listProjects.mjs.map +1 -0
  20. package/dist/esm/loadDictionaries/loadDictionaries.mjs +4 -13
  21. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  22. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  23. package/dist/esm/utils/getComponentTransformPattern.mjs +4 -2
  24. package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
  25. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +2 -2
  26. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
  27. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +3 -3
  28. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
  29. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +3 -3
  30. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  31. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -2
  32. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +2 -2
  33. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -2
  34. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +2 -2
  35. package/dist/types/formatDictionary.d.ts +15 -15
  36. package/dist/types/index.d.ts +2 -1
  37. package/dist/types/init/index.d.ts.map +1 -1
  38. package/dist/types/listDictionariesPath.d.ts.map +1 -1
  39. package/dist/types/listProjects.d.ts +26 -0
  40. package/dist/types/listProjects.d.ts.map +1 -0
  41. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
  42. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +2 -2
  43. package/dist/types/utils/buildFilesList.d.ts.map +1 -1
  44. package/dist/types/utils/chunkJSON.d.ts.map +1 -1
  45. package/dist/types/utils/getComponentTransformPattern.d.ts.map +1 -1
  46. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/init/index.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizePath,\n logger,\n v,\n x,\n} from '@intlayer/config';\nimport { initConfig } from '../initConfig';\nimport {\n exists,\n findTsConfigFiles,\n parseJSONWithComments,\n readFileFromRoot,\n writeFileToRoot,\n} from './utils';\n\n/**\n * MAIN LOGIC\n */\n\nexport const initIntlayer = async (rootDir: string) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // Check for package.json to ensure we are in a project root\n if (!(await exists(rootDir, 'package.json'))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n // Check .gitignore\n const gitignorePath = '.gitignore';\n if (await exists(rootDir, gitignorePath)) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // Check TSConfigs\n // Find all tsconfig files (tsconfig.json, tsconfig.*.json)\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = '.intlayer/**/*.ts';\n\n // Check if include array exists - if not, skip (likely a solution-style tsconfig with references)\n let updated = false;\n if (!config.include) {\n // Skip tsconfig files without include array (e.g. solution-style configs with references)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((patten: string) =>\n patten.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n // We write back using standard JSON stringify (comments will be lost, sadly)\n // If preserving comments is critical, a more complex parser/printer is needed.\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // Initialize Intlayer configuration file\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n await initConfig(format, rootDir);\n\n // Check Vite Config\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n let content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('vite-intlayer')) {\n const viteImport =\n \"import { intlayer } from 'vite-intlayer'; // Add the plugin to the Vite plugin list\";\n\n // Prepend the import\n content = `${viteImport}\\n${content}`;\n await writeFileToRoot(rootDir, file, content);\n logger(`${v} Injected import into ${colorizePath(file)}`);\n }\n break; // Stop after finding one vite config\n }\n }\n\n // Check Next Config\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n let content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('next-intlayer')) {\n const nextImport =\n \"import { withIntlayer } from 'next-intlayer'; // Add the plugin to the Next.js configuration\";\n\n // Prepend the import\n content = `${nextImport}\\n${content}`;\n await writeFileToRoot(rootDir, file, content);\n logger(`${v} Injected import into ${colorizePath(file)}`);\n }\n break; // Stop after finding one next config\n }\n }\n\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n};\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,eAAe,OAAO,YAAoB;AACrD,QAAO,SAAS,sCAAsC,WAAW,KAAK,CAAC;AAGvE,KAAI,CAAE,MAAM,OAAO,SAAS,eAAe,EAAG;AAC5C,SACE,GAAG,EAAE,MAAM,aAAa,eAAe,CAAC,wDACxC,EAAE,OAAO,SAAS,CACnB;AACD,UAAQ,KAAK,EAAE;;CAIjB,MAAM,gBAAgB;AACtB,KAAI,MAAM,OAAO,SAAS,cAAc,EAAE;EACxC,MAAM,mBAAmB,MAAM,iBAAiB,SAAS,cAAc;AAEvE,MAAI,CAAC,iBAAiB,SAAS,WAAW,EAAE;AAE1C,SAAM,gBAAgB,SAAS,eADZ,GAAG,iBAAiB,2BACkB;AACzD,UACE,GAAG,EAAE,SAAS,aAAa,YAAY,CAAC,MAAM,aAAa,cAAc,GAC1E;QAED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E,KAAI,MAAM,OAAO,SAAS,KAAK,EAAE;EAC/B,IAAI,UAAU,MAAM,iBAAiB,SAAS,KAAK;AAEnD,MAAI,CAAC,QAAQ,SAAS,gBAAgB,EAAE;AAKtC,aAAU,iGAAkB;AAC5B,SAAM,gBAAgB,SAAS,MAAM,QAAQ;AAC7C,UAAO,GAAG,EAAE,wBAAwB,aAAa,KAAK,GAAG;;AAE3D;;AAIJ,QAAO,GAAG,EAAE,GAAG,SAAS,iCAAiC,WAAW,MAAM,GAAG"}
1
+ {"version":3,"file":"index.mjs","names":["packageJson: Record<string, any>"],"sources":["../../../src/init/index.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizePath,\n logger,\n v,\n x,\n} from '@intlayer/config';\nimport { initConfig } from '../initConfig';\nimport {\n exists,\n findTsConfigFiles,\n parseJSONWithComments,\n readFileFromRoot,\n writeFileToRoot,\n} from './utils';\n\n/**\n * Documentation URL Constants\n */\nconst DocumentationRouter = {\n NextJS: 'https://intlayer.org/doc/environment/nextjs.md',\n NextJS_15: 'https://intlayer.org/doc/environment/nextjs/15.md',\n NextJS_14: 'https://intlayer.org/doc/environment/nextjs/14.md',\n CRA: 'https://intlayer.org/doc/environment/create-react-app.md',\n Astro: 'https://intlayer.org/doc/environment/astro.md',\n ViteAndReact: 'https://intlayer.org/doc/environment/vite-and-react.md',\n ViteAndReact_ReactRouterV7:\n 'https://intlayer.org/doc/environment/vite-and-react/react-router-v7.md',\n ViteAndReact_ReactRouterV7_FSRoutes:\n 'https://intlayer.org/doc/environment/vite-and-react/react-router-v7-fs-routes.md',\n ViteAndVue: 'https://intlayer.org/doc/environment/vite-and-vue.md',\n ViteAndSolid: 'https://intlayer.org/doc/environment/vite-and-solid.md',\n ViteAndSvelte: 'https://intlayer.org/doc/environment/vite-and-svelte.md',\n ViteAndPreact: 'https://intlayer.org/doc/environment/vite-and-preact.md',\n TanStackRouter: 'https://intlayer.org/doc/environment/tanstack.md',\n NuxtAndVue: 'https://intlayer.org/doc/environment/nuxt-and-vue.md',\n Angular: 'https://intlayer.org/doc/environment/angular.md',\n SvelteKit: 'https://intlayer.org/doc/environment/sveltekit.md',\n ReactNativeAndExpo:\n 'https://intlayer.org/doc/environment/react-native-and-expo.md',\n Lynx: 'https://intlayer.org/doc/environment/lynx-and-react.md',\n Express: 'https://intlayer.org/doc/environment/express.md',\n NestJS: 'https://intlayer.org/doc/environment/nestjs.md',\n Fastify: 'https://intlayer.org/doc/environment/fastify.md',\n Default: 'https://intlayer.org/doc/get-started',\n\n // Check for competitors libs\n NextIntl: 'https://intlayer.org/blog/intlayer-with-next-intl.md',\n ReactI18Next: 'https://intlayer.org/blog/intlayer-with-react-i18next.md',\n ReactIntl: 'https://intlayer.org/blog/intlayer-with-react-intl.md',\n NextI18Next: 'https://intlayer.org/blog/intlayer-with-next-i18next.md',\n VueI18n: 'https://intlayer.org/blog/intlayer-with-vue-i18n.md',\n};\n\n/**\n * Helper: Detects the environment and returns the doc URL\n */\nconst getDocumentationUrl = (packageJson: any): string => {\n const deps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n /**\n * Helper to check if a version string matches a specific major version\n * Matches: \"15\", \"^15.0.0\", \"~15.2\", \"15.0.0-beta\"\n */\n const isVersion = (versionString: string, major: number): boolean => {\n if (!versionString || typeof versionString !== 'string') return false;\n const regex = new RegExp(`^[\\\\^~]?${major}(?:\\\\.|$)`);\n return regex.test(versionString);\n };\n\n // Mobile / Cross-platform\n if (deps['@lynx-js/react'] || deps['@lynx-js/core']) {\n return DocumentationRouter.Lynx;\n }\n if (deps['react-native'] || deps['expo']) {\n return DocumentationRouter.ReactNativeAndExpo;\n }\n\n // Meta-frameworks (Next, Nuxt, Astro, SvelteKit)\n if (deps['next']) {\n const version = deps['next'];\n\n if (isVersion(version, 14)) {\n return DocumentationRouter.NextJS_14;\n }\n\n if (isVersion(version, 15)) {\n return DocumentationRouter.NextJS_15;\n }\n\n return DocumentationRouter.NextJS;\n }\n\n if (deps['nuxt']) return DocumentationRouter.NuxtAndVue;\n if (deps['astro']) return DocumentationRouter.Astro;\n if (deps['@sveltejs/kit']) return DocumentationRouter.SvelteKit;\n\n // Routers (TanStack & React Router v7)\n if (deps['@tanstack/react-router']) {\n return DocumentationRouter.TanStackRouter;\n }\n\n // Check for React Router v7\n const reactRouterVersion = deps['react-router'];\n if (reactRouterVersion && typeof reactRouterVersion === 'string') {\n // Distinguish between standard v7 and v7 with FS routes\n if (deps['@react-router/fs-routes']) {\n return DocumentationRouter.ViteAndReact_ReactRouterV7_FSRoutes;\n }\n\n // Use Regex to ensure it is v7\n if (isVersion(reactRouterVersion, 7)) {\n return DocumentationRouter.ViteAndReact_ReactRouterV7;\n }\n }\n\n // Vite Ecosystem (General)\n if (deps['vite']) {\n if (deps['vue']) return DocumentationRouter.ViteAndVue;\n if (deps['solid-js']) return DocumentationRouter.ViteAndSolid;\n if (deps['svelte']) return DocumentationRouter.ViteAndSvelte;\n if (deps['preact']) return DocumentationRouter.ViteAndPreact;\n\n // Default to React if Vite is present but specific other frameworks aren't found\n return DocumentationRouter.ViteAndReact;\n }\n\n // Other Web Frameworks\n if (deps['react-scripts']) return DocumentationRouter.CRA;\n if (deps['@angular/core']) return DocumentationRouter.Angular;\n\n // Backend\n if (deps['@nestjs/core']) return DocumentationRouter.NestJS;\n if (deps['express']) return DocumentationRouter.Express;\n if (deps['fastify']) return DocumentationRouter.Fastify;\n\n // Competitor Libs (Migration Guides)\n // We check these last as specific environment setup is usually higher priority,\n // but if no specific framework logic matched (or as a fallback), we guide to migration.\n if (deps['next-intl']) return DocumentationRouter.NextIntl;\n if (deps['react-i18next'] || deps['i18next'])\n return DocumentationRouter.ReactI18Next;\n if (deps['react-intl']) return DocumentationRouter.ReactIntl;\n if (deps['next-i18next']) return DocumentationRouter.NextI18Next;\n if (deps['vue-i18n']) return DocumentationRouter.VueI18n;\n\n return DocumentationRouter.Default;\n};\n\n/**\n * MAIN LOGIC\n */\nexport const initIntlayer = async (rootDir: string) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // READ PACKAGE.JSON\n const packageJsonPath = 'package.json';\n if (!(await exists(rootDir, packageJsonPath))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);\n let packageJson: Record<string, any>;\n try {\n packageJson = JSON.parse(packageJsonContent);\n } catch {\n logger(`${x} Could not parse ${colorizePath('package.json')}.`, {\n level: 'error',\n });\n process.exit(1);\n }\n\n // Determine the correct documentation URL based on dependencies\n const guideUrl = getDocumentationUrl(packageJson);\n\n // 2. CHECK .GITIGNORE\n const gitignorePath = '.gitignore';\n if (await exists(rootDir, gitignorePath)) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // CHECK TSCONFIGS\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = '.intlayer/**/*.ts';\n\n let updated = false;\n\n if (!config.include) {\n // Skip if no include array (solution-style)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((pattern: string) =>\n pattern.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // INITIALIZE CONFIG FILE\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n await initConfig(format, rootDir);\n\n // CHECK VITE CONFIG\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n let content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('vite-intlayer')) {\n const viteImport =\n \"import { intlayer } from 'vite-intlayer'; // Add the plugin to the Vite plugin list\";\n\n content = `${viteImport}\\n${content}`;\n await writeFileToRoot(rootDir, file, content);\n logger(`${v} Injected import into ${colorizePath(file)}`);\n }\n break;\n }\n }\n\n // CHECK NEXT CONFIG\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n let content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('next-intlayer')) {\n const nextImport =\n \"import { withIntlayer } from 'next-intlayer'; // Add the plugin to the Next.js configuration\";\n\n content = `${nextImport}\\n${content}`;\n await writeFileToRoot(rootDir, file, content);\n logger(`${v} Injected import into ${colorizePath(file)}`);\n }\n break;\n }\n }\n\n // FINAL SUCCESS MESSAGE\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n logger([\n colorize('Next →', ANSIColors.MAGENTA),\n colorize(\n `Follow the instructions in the documentation to complete the setup:`,\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(guideUrl),\n ]);\n};\n"],"mappings":";;;;;;;;;;AAoBA,MAAM,sBAAsB;CAC1B,QAAQ;CACR,WAAW;CACX,WAAW;CACX,KAAK;CACL,OAAO;CACP,cAAc;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;;AAE3D;;AAMJ,MAAK,MAAM,QADS;EAAC;EAAkB;EAAmB;EAAiB,CAEzE,KAAI,MAAM,OAAO,SAAS,KAAK,EAAE;EAC/B,IAAI,UAAU,MAAM,iBAAiB,SAAS,KAAK;AAEnD,MAAI,CAAC,QAAQ,SAAS,gBAAgB,EAAE;AAItC,aAAU,iGAAkB;AAC5B,SAAM,gBAAgB,SAAS,MAAM,QAAQ;AAC7C,UAAO,GAAG,EAAE,wBAAwB,aAAa,KAAK,GAAG;;AAE3D;;AAKJ,QAAO,GAAG,EAAE,GAAG,SAAS,iCAAiC,WAAW,MAAM,GAAG;AAC7E,QAAO;EACL,SAAS,UAAU,WAAW,QAAQ;EACtC,SACE,uEACA,WAAW,WACZ;EACD,aAAa,SAAS;EACvB,CAAC"}
@@ -8,7 +8,22 @@ import fg from "fast-glob";
8
8
  * @returns An array of dictionary paths
9
9
  */
10
10
  const listDictionaries = async (configuration) => {
11
- return await fg(configuration.content.watchedFilesPatternWithPath, { ignore: configuration.content.excludedPath });
11
+ const { watchedFilesPatternWithPath, excludedPath } = configuration.content;
12
+ const filePromises = watchedFilesPatternWithPath.map(async (pattern) => {
13
+ const magicIndex = pattern.search(/[*?{}(]/);
14
+ const basePattern = magicIndex > -1 ? pattern.slice(0, magicIndex) : pattern;
15
+ return fg(pattern, {
16
+ ignore: excludedPath.filter((excludePattern) => {
17
+ const cleanName = excludePattern.replace(/\*\*/g, "").replace(/\//g, "");
18
+ if (cleanName && basePattern.includes(`/${cleanName}/`)) return false;
19
+ return true;
20
+ }),
21
+ absolute: true,
22
+ dot: true
23
+ });
24
+ });
25
+ const filesArrays = await Promise.all(filePromises);
26
+ return Array.from(new Set(filesArrays.flat()));
12
27
  };
13
28
  const listDictionariesWithStats = async (configuration) => {
14
29
  const files = await listDictionaries(configuration);
@@ -1 +1 @@
1
- {"version":3,"file":"listDictionariesPath.mjs","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * List all dictionaries absolute paths in the project\n * @param configuration - The configuration object\n * @returns An array of dictionary paths\n */\nexport const listDictionaries = async (\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const files: string[] = await fg(\n configuration.content.watchedFilesPatternWithPath,\n {\n ignore: configuration.content.excludedPath,\n }\n );\n\n return files;\n};\n\nexport const listDictionariesWithStats = async (\n configuration: IntlayerConfig\n) => {\n const files = await listDictionaries(configuration);\n\n return Promise.all(\n files.map(async (file) => ({ path: file, stats: await stat(file) }))\n );\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,mBAAmB,OAC9B,kBACsB;AAQtB,QAPwB,MAAM,GAC5B,cAAc,QAAQ,6BACtB,EACE,QAAQ,cAAc,QAAQ,cAC/B,CACF;;AAKH,MAAa,4BAA4B,OACvC,kBACG;CACH,MAAM,QAAQ,MAAM,iBAAiB,cAAc;AAEnD,QAAO,QAAQ,IACb,MAAM,IAAI,OAAO,UAAU;EAAE,MAAM;EAAM,OAAO,MAAM,KAAK,KAAK;EAAE,EAAE,CACrE"}
1
+ {"version":3,"file":"listDictionariesPath.mjs","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * List all dictionaries absolute paths in the project\n * @param configuration - The configuration object\n * @returns An array of dictionary paths\n */\nexport const listDictionaries = async (\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { watchedFilesPatternWithPath, excludedPath } = configuration.content;\n\n const filePromises = watchedFilesPatternWithPath.map(async (pattern) => {\n // Identify the static part of the path (before any wildcards like *)\n // e.g. \"/Users/.../design-system/dist/esm/**/*.content.ts\" -> \"/Users/.../design-system/dist/esm/\"\n const magicIndex = pattern.search(/[*?{}(]/);\n const basePattern =\n magicIndex > -1 ? pattern.slice(0, magicIndex) : pattern;\n\n // Filter the global ignored list for this specific pattern\n const applicableIgnore = excludedPath.filter((excludePattern) => {\n // Heuristic: Extract the key directory name from the glob\n // e.g. \"**/dist/**\" -> \"dist\", \"**/node_modules/**\" -> \"node_modules\"\n const cleanName = excludePattern.replace(/\\*\\*/g, '').replace(/\\//g, '');\n\n // If the explicit base path contains the excluded directory (e.g. \".../dist/...\"),\n // we assume you explicitly want it, so we REMOVE it from the ignore list.\n // We check for `/${cleanName}/` to ensure we match whole folder names.\n if (cleanName && basePattern.includes(`/${cleanName}/`)) {\n return false; // Drop this exclude rule\n }\n\n return true; // Keep this exclude rule\n });\n\n // Run fast-glob with the customized ignore list\n return fg(pattern, {\n ignore: applicableIgnore,\n absolute: true,\n dot: true,\n });\n });\n\n const filesArrays = await Promise.all(filePromises);\n\n // Flatten and deduplicate\n const uniqueFiles = Array.from(new Set(filesArrays.flat()));\n\n return uniqueFiles;\n};\n\nexport const listDictionariesWithStats = async (\n configuration: IntlayerConfig\n) => {\n const files = await listDictionaries(configuration);\n\n return Promise.all(\n files.map(async (file) => ({ path: file, stats: await stat(file) }))\n );\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,mBAAmB,OAC9B,kBACsB;CACtB,MAAM,EAAE,6BAA6B,iBAAiB,cAAc;CAEpE,MAAM,eAAe,4BAA4B,IAAI,OAAO,YAAY;EAGtE,MAAM,aAAa,QAAQ,OAAO,UAAU;EAC5C,MAAM,cACJ,aAAa,KAAK,QAAQ,MAAM,GAAG,WAAW,GAAG;AAmBnD,SAAO,GAAG,SAAS;GACjB,QAjBuB,aAAa,QAAQ,mBAAmB;IAG/D,MAAM,YAAY,eAAe,QAAQ,SAAS,GAAG,CAAC,QAAQ,OAAO,GAAG;AAKxE,QAAI,aAAa,YAAY,SAAS,IAAI,UAAU,GAAG,CACrD,QAAO;AAGT,WAAO;KACP;GAKA,UAAU;GACV,KAAK;GACN,CAAC;GACF;CAEF,MAAM,cAAc,MAAM,QAAQ,IAAI,aAAa;AAKnD,QAFoB,MAAM,KAAK,IAAI,IAAI,YAAY,MAAM,CAAC,CAAC;;AAK7D,MAAa,4BAA4B,OACvC,kBACG;CACH,MAAM,QAAQ,MAAM,iBAAiB,cAAc;AAEnD,QAAO,QAAQ,IACb,MAAM,IAAI,OAAO,UAAU;EAAE,MAAM;EAAM,OAAO,MAAM,KAAK,KAAK;EAAE,EAAE,CACrE"}
@@ -0,0 +1,44 @@
1
+ import { dirname } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { configurationFilesCandidates } from "@intlayer/config";
4
+ import simpleGit from "simple-git";
5
+
6
+ //#region src/listProjects.ts
7
+ /**
8
+ * Get the git root directory
9
+ */
10
+ const getGitRootDir = async (cwd) => {
11
+ try {
12
+ return (await (cwd ? simpleGit(cwd) : simpleGit()).revparse(["--show-toplevel"])).trim();
13
+ } catch (_error) {
14
+ return null;
15
+ }
16
+ };
17
+ /**
18
+ * List all Intlayer projects by searching for configuration files
19
+ *
20
+ * @param options - Options for listing projects
21
+ * @returns Array of absolute paths to project directories containing Intlayer config
22
+ */
23
+ const listProjects = async (options) => {
24
+ let searchDir = options?.baseDir ?? process.cwd();
25
+ if (options?.gitRoot) {
26
+ const gitRootDir = await getGitRootDir(searchDir);
27
+ if (gitRootDir) searchDir = gitRootDir;
28
+ }
29
+ const configFiles = await fg(configurationFilesCandidates.map((fileName) => `**/${fileName}`), {
30
+ cwd: searchDir,
31
+ absolute: true,
32
+ ignore: ["**/node_modules/**", "**/.git/**"],
33
+ dot: true
34
+ });
35
+ const projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];
36
+ return {
37
+ searchDir,
38
+ projectsPath: projectDirs.sort()
39
+ };
40
+ };
41
+
42
+ //#endregion
43
+ export { listProjects };
44
+ //# sourceMappingURL=listProjects.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listProjects.mjs","names":[],"sources":["../../src/listProjects.ts"],"sourcesContent":["import { dirname } from 'node:path';\nimport { configurationFilesCandidates } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport simpleGit from 'simple-git';\n\nexport type ListProjectsOptions = {\n /**\n * Base directory to search from\n * @default process.cwd()\n */\n baseDir?: string;\n /**\n * If true, search from the git root directory instead of baseDir\n * @default false\n */\n gitRoot?: boolean;\n};\n\n/**\n * Get the git root directory\n */\nconst getGitRootDir = async (cwd?: string): Promise<string | null> => {\n try {\n const git = cwd ? simpleGit(cwd) : simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (_error) {\n return null;\n }\n};\n\n/**\n * List all Intlayer projects by searching for configuration files\n *\n * @param options - Options for listing projects\n * @returns Array of absolute paths to project directories containing Intlayer config\n */\nexport const listProjects = async (\n options?: ListProjectsOptions\n): Promise<{ searchDir: string; projectsPath: string[] }> => {\n let searchDir = options?.baseDir ?? process.cwd();\n\n // If gitRoot option is enabled, try to get the git root directory\n if (options?.gitRoot) {\n const gitRootDir = await getGitRootDir(searchDir);\n if (gitRootDir) {\n searchDir = gitRootDir;\n }\n }\n\n // Build glob patterns for all config file candidates\n const configPatterns = configurationFilesCandidates.map(\n (fileName) => `**/${fileName}`\n );\n\n // Search for all config files\n const configFiles = await fg(configPatterns, {\n cwd: searchDir,\n absolute: true,\n ignore: ['**/node_modules/**', '**/.git/**'],\n dot: true, // Include dot files like .intlayerrc\n });\n\n // Extract unique directory paths from config files\n const projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];\n\n // Sort alphabetically for consistent output\n return { searchDir, projectsPath: projectDirs.sort() };\n};\n"],"mappings":";;;;;;;;;AAqBA,MAAM,gBAAgB,OAAO,QAAyC;AACpE,KAAI;AAGF,UADgB,OADJ,MAAM,UAAU,IAAI,GAAG,WAAW,EACpB,SAAS,CAAC,kBAAkB,CAAC,EACxC,MAAM;UACd,QAAQ;AACf,SAAO;;;;;;;;;AAUX,MAAa,eAAe,OAC1B,YAC2D;CAC3D,IAAI,YAAY,SAAS,WAAW,QAAQ,KAAK;AAGjD,KAAI,SAAS,SAAS;EACpB,MAAM,aAAa,MAAM,cAAc,UAAU;AACjD,MAAI,WACF,aAAY;;CAUhB,MAAM,cAAc,MAAM,GALH,6BAA6B,KACjD,aAAa,MAAM,WACrB,EAG4C;EAC3C,KAAK;EACL,UAAU;EACV,QAAQ,CAAC,sBAAsB,aAAa;EAC5C,KAAK;EACN,CAAC;CAGF,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,YAAY,KAAK,SAAS,QAAQ,KAAK,CAAC,CAAC,CAAC;AAG1E,QAAO;EAAE;EAAW,cAAc,YAAY,MAAM;EAAE"}
@@ -77,26 +77,17 @@ const loadDictionaries = async (contentDeclarationsPaths, configuration) => {
77
77
  const { plugins } = configuration;
78
78
  const loadDictionariesStartTime = Date.now();
79
79
  getAppLogger(configuration)("Dictionaries:", { isVerbose: true });
80
- const pluginsWithLoadDictionaries = (plugins ?? []).filter((plugin) => plugin.loadDictionaries);
81
- logger$1.setPluginTotal(pluginsWithLoadDictionaries.length);
82
- const completedPluginIndices = /* @__PURE__ */ new Set();
83
- const updatePluginProgress = () => {
84
- logger$1.setPluginDone(completedPluginIndices.size);
85
- };
86
- const loadPluginDictionariesPromise = pluginsWithLoadDictionaries.map(async (plugin, index) => {
80
+ const loadPluginDictionariesPromise = (plugins ?? []).filter((plugin) => plugin.loadDictionaries).map(async (plugin, index) => {
87
81
  try {
88
- const res = await plugin.loadDictionaries?.({ configuration });
89
- completedPluginIndices.add(index);
90
- updatePluginProgress();
91
- return res ?? [];
82
+ return await plugin.loadDictionaries?.({ configuration }) ?? [];
92
83
  } catch (error) {
93
84
  logger$1.setPluginError(error);
94
- completedPluginIndices.add(index);
95
- updatePluginProgress();
96
85
  return [];
97
86
  }
98
87
  });
99
88
  const pluginDictionaries = await Promise.all(loadPluginDictionariesPromise).then((dictionaries) => dictionaries.flat()).then((dictionaries) => filterInvalidDictionaries(dictionaries, configuration)).then((dictionaries) => formatDictionaries(dictionaries));
89
+ logger$1.setPluginTotal(pluginDictionaries.length);
90
+ logger$1.setPluginDone(pluginDictionaries.length);
100
91
  const pluginDictionariesTime = Date.now();
101
92
  const localDictionaries = await loadContentDeclarations(Array.isArray(contentDeclarationsPaths) ? contentDeclarationsPaths : [contentDeclarationsPaths], configuration, setLoadDictionariesStatus).then((dictionaries) => filterInvalidDictionaries(dictionaries, configuration)).then((dictionaries) => formatDictionaries(dictionaries));
102
93
  const localDictionariesTime = Date.now();
@@ -1 +1 @@
1
- {"version":3,"file":"loadDictionaries.mjs","names":["loadDictionariesStatus: DictionariesStatus[]","logger","updated: DictionariesStatus[]","labels: string[]","pluginDictionaries: Dictionary[]","localDictionaries: Dictionary[]","remoteDictionaries: Dictionary[]"],"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colon,\n colorize,\n colorizeKey,\n getAppLogger,\n} from '@intlayer/config/client';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\nimport { filterInvalidDictionaries } from '../filterInvalidDictionaries';\nimport { formatDictionaries } from '../formatDictionary';\nimport { loadContentDeclarations } from './loadContentDeclaration';\nimport { loadRemoteDictionaries } from './loadRemoteDictionaries';\nimport { DictionariesLogger } from './log';\n\nexport type DictionariesStatus = {\n dictionaryKey: string;\n type: 'local' | 'remote';\n status:\n | 'pending' // Key found but not fetched yet\n | 'fetching' // If dictionary fetch is in progress\n | 'fetched' // If dictionary fetch succeeded\n | 'error' // If dictionary fetch failed\n | 'imported' // If dictionary already fetched and still up to date\n | 'found' // If dictionary key is found but promise is not resolved yet (ex: fetching distant content)\n | 'building' // If dictionary is being built\n | 'built'; // If dictionary is built;\n error?: string;\n};\n\nlet loadDictionariesStatus: DictionariesStatus[] = [];\nconst logger = new DictionariesLogger();\n\nconst setLoadDictionariesStatus = (statuses: DictionariesStatus[]) => {\n const updated: DictionariesStatus[] = [...loadDictionariesStatus];\n\n for (const incoming of statuses) {\n const index = updated.findIndex(\n (s) =>\n s.dictionaryKey === incoming.dictionaryKey && s.type === incoming.type\n );\n if (index >= 0) {\n updated[index] = incoming;\n } else {\n updated.push(incoming);\n }\n }\n\n loadDictionariesStatus = updated;\n logger.update(statuses);\n\n return updated;\n};\n\ntype StatusRecord = {\n local?: DictionariesStatus['status'];\n remote?: DictionariesStatus['status'];\n};\n\nconst iconFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'built':\n case 'imported':\n case 'fetched':\n return '✔';\n case 'error':\n return '✖';\n default:\n return '⏲';\n }\n};\n\nconst colorFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'built':\n case 'imported':\n case 'fetched':\n return ANSIColors.GREEN;\n case 'error':\n return ANSIColors.RED;\n default:\n return ANSIColors.BLUE;\n }\n};\n\nconst printSummary = (configuration: IntlayerConfig) => {\n if (configuration.log.mode !== 'verbose') return;\n\n const appLogger = getAppLogger(configuration);\n\n // Aggregate by dictionary key\n const byKey = new Map<string, StatusRecord>();\n for (const status of loadDictionariesStatus) {\n const rec = byKey.get(status.dictionaryKey) ?? {};\n if (status.type === 'local') rec.local = status.status;\n if (status.type === 'remote') rec.remote = status.status;\n byKey.set(status.dictionaryKey, rec);\n }\n\n const keys = Array.from(byKey.keys()).sort((a, b) => a.localeCompare(b));\n\n // Compute the max visible length of the local label to align distant labels\n let maxLocalLabelLen = 0;\n for (const key of keys) {\n const rec = byKey.get(key)!;\n if (rec.local) {\n const visibleLocal = `[local: ${iconFor(rec.local)} ${rec.local}]`;\n if (visibleLocal.length > maxLocalLabelLen) {\n maxLocalLabelLen = visibleLocal.length;\n }\n }\n }\n\n for (const key of keys) {\n const rec = byKey.get(key)!;\n const labels: string[] = [];\n\n if (rec.local) {\n const inner = colorize(\n `${iconFor(rec.local)} ${rec.local}`,\n colorFor(rec.local)\n );\n const coloredLocal =\n `${ANSIColors.GREY}[` +\n colorize('local: ', ANSIColors.GREY) +\n inner +\n `${ANSIColors.GREY}]${ANSIColors.RESET}`;\n\n // Pad to align distant label across rows\n const visibleLocal = `[local: ${iconFor(rec.local)} ${rec.local}]`;\n const pad = Math.max(0, maxLocalLabelLen - visibleLocal.length);\n labels.push(coloredLocal + ' '.repeat(pad));\n } else {\n // If no local label, insert spaces to keep distant aligned\n labels.push(' '.repeat(maxLocalLabelLen));\n }\n\n if (rec.remote) {\n const inner = colorize(\n `${iconFor(rec.remote)} ${rec.remote}`,\n colorFor(rec.remote)\n );\n labels.push(\n `${ANSIColors.GREY}[` +\n colorize('distant: ', ANSIColors.GREY) +\n inner +\n `${ANSIColors.GREY}]${ANSIColors.RESET}`\n );\n }\n\n appLogger(\n ` - ${colon(colorizeKey(key), { colSize: keys })} ${labels.join(' ')}`\n );\n }\n};\n\nexport const loadDictionaries = async (\n contentDeclarationsPaths: string[] | string,\n configuration: IntlayerConfig\n): Promise<{\n localDictionaries: Dictionary[];\n remoteDictionaries: Dictionary[];\n pluginDictionaries: Dictionary[];\n time: {\n localDictionaries: number;\n remoteDictionaries: number;\n pluginDictionaries: number;\n };\n}> => {\n const { plugins } = configuration;\n const loadDictionariesStartTime = Date.now();\n const appLogger = getAppLogger(configuration);\n\n appLogger('Dictionaries:', { isVerbose: true });\n\n // Load additional dictionaries via plugins (e.g., ICU JSON ingestion)\n const pluginsWithLoadDictionaries = (plugins ?? []).filter(\n (plugin) => plugin.loadDictionaries\n );\n\n logger.setPluginTotal(pluginsWithLoadDictionaries.length);\n\n const completedPluginIndices = new Set<number>();\n const updatePluginProgress = () => {\n logger.setPluginDone(completedPluginIndices.size);\n };\n\n const loadPluginDictionariesPromise = pluginsWithLoadDictionaries.map(\n async (plugin, index) => {\n try {\n const res = await plugin.loadDictionaries?.({\n configuration,\n });\n completedPluginIndices.add(index);\n updatePluginProgress();\n return (res as Dictionary[] | undefined) ?? [];\n } catch (error) {\n logger.setPluginError(error as Error);\n completedPluginIndices.add(index);\n updatePluginProgress();\n return [];\n }\n }\n );\n\n const pluginDictionaries: Dictionary[] = await Promise.all(\n loadPluginDictionariesPromise as Promise<Dictionary[]>[]\n )\n .then((dictionaries) => dictionaries.flat())\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n\n const pluginDictionariesTime = Date.now();\n\n const files = Array.isArray(contentDeclarationsPaths)\n ? contentDeclarationsPaths\n : [contentDeclarationsPaths];\n\n const localDictionaries: Dictionary[] = await loadContentDeclarations(\n files,\n configuration,\n setLoadDictionariesStatus\n )\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n\n const localDictionariesTime = Date.now();\n\n const localDictionariesStatus = localDictionaries.map(\n (dictionary) =>\n ({\n dictionaryKey: dictionary.key,\n type: 'local',\n status: 'built',\n }) as const\n );\n\n setLoadDictionariesStatus(localDictionariesStatus);\n\n const hasRemoteDictionaries = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n\n if (hasRemoteDictionaries) {\n // We expect to fetch remote dictionaries soon; suppress a transient local-only render\n logger.setExpectRemote(true);\n }\n\n let remoteDictionaries: Dictionary[] = [];\n\n if (hasRemoteDictionaries) {\n remoteDictionaries = await loadRemoteDictionaries(\n configuration,\n setLoadDictionariesStatus,\n {\n onStartRemoteCheck: () => logger.startRemoteCheck(),\n onStopRemoteCheck: () => logger.stopRemoteCheck(),\n onError: (e) => logger.setRemoteError(e),\n }\n )\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n }\n\n const remoteDictionariesTime = Date.now();\n\n // Stop spinner and show final progress line(s)\n logger.finish();\n\n printSummary(configuration);\n\n return {\n localDictionaries,\n remoteDictionaries,\n pluginDictionaries,\n time: {\n localDictionaries: localDictionariesTime - pluginDictionariesTime,\n remoteDictionaries: remoteDictionariesTime - localDictionariesTime,\n pluginDictionaries: pluginDictionariesTime - loadDictionariesStartTime,\n },\n };\n};\n"],"mappings":";;;;;;;;AA6BA,IAAIA,yBAA+C,EAAE;AACrD,MAAMC,WAAS,IAAI,oBAAoB;AAEvC,MAAM,6BAA6B,aAAmC;CACpE,MAA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AAEf,cAAa,cAAc;AAE3B,QAAO;EACL;EACA;EACA;EACA,MAAM;GACJ,mBAAmB,wBAAwB;GAC3C,oBAAoB,yBAAyB;GAC7C,oBAAoB,yBAAyB;GAC9C;EACF"}
1
+ {"version":3,"file":"loadDictionaries.mjs","names":["loadDictionariesStatus: DictionariesStatus[]","logger","updated: DictionariesStatus[]","labels: string[]","pluginDictionaries: Dictionary[]","localDictionaries: Dictionary[]","remoteDictionaries: Dictionary[]"],"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colon,\n colorize,\n colorizeKey,\n getAppLogger,\n} from '@intlayer/config/client';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\nimport { filterInvalidDictionaries } from '../filterInvalidDictionaries';\nimport { formatDictionaries } from '../formatDictionary';\nimport { loadContentDeclarations } from './loadContentDeclaration';\nimport { loadRemoteDictionaries } from './loadRemoteDictionaries';\nimport { DictionariesLogger } from './log';\n\nexport type DictionariesStatus = {\n dictionaryKey: string;\n type: 'local' | 'remote';\n status:\n | 'pending' // Key found but not fetched yet\n | 'fetching' // If dictionary fetch is in progress\n | 'fetched' // If dictionary fetch succeeded\n | 'error' // If dictionary fetch failed\n | 'imported' // If dictionary already fetched and still up to date\n | 'found' // If dictionary key is found but promise is not resolved yet (ex: fetching distant content)\n | 'building' // If dictionary is being built\n | 'built'; // If dictionary is built;\n error?: string;\n};\n\nlet loadDictionariesStatus: DictionariesStatus[] = [];\nconst logger = new DictionariesLogger();\n\nconst setLoadDictionariesStatus = (statuses: DictionariesStatus[]) => {\n const updated: DictionariesStatus[] = [...loadDictionariesStatus];\n\n for (const incoming of statuses) {\n const index = updated.findIndex(\n (s) =>\n s.dictionaryKey === incoming.dictionaryKey && s.type === incoming.type\n );\n if (index >= 0) {\n updated[index] = incoming;\n } else {\n updated.push(incoming);\n }\n }\n\n loadDictionariesStatus = updated;\n logger.update(statuses);\n\n return updated;\n};\n\ntype StatusRecord = {\n local?: DictionariesStatus['status'];\n remote?: DictionariesStatus['status'];\n};\n\nconst iconFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'built':\n case 'imported':\n case 'fetched':\n return '✔';\n case 'error':\n return '✖';\n default:\n return '⏲';\n }\n};\n\nconst colorFor = (status: DictionariesStatus['status']) => {\n switch (status) {\n case 'built':\n case 'imported':\n case 'fetched':\n return ANSIColors.GREEN;\n case 'error':\n return ANSIColors.RED;\n default:\n return ANSIColors.BLUE;\n }\n};\n\nconst printSummary = (configuration: IntlayerConfig) => {\n if (configuration.log.mode !== 'verbose') return;\n\n const appLogger = getAppLogger(configuration);\n\n // Aggregate by dictionary key\n const byKey = new Map<string, StatusRecord>();\n for (const status of loadDictionariesStatus) {\n const rec = byKey.get(status.dictionaryKey) ?? {};\n if (status.type === 'local') rec.local = status.status;\n if (status.type === 'remote') rec.remote = status.status;\n byKey.set(status.dictionaryKey, rec);\n }\n\n const keys = Array.from(byKey.keys()).sort((a, b) => a.localeCompare(b));\n\n // Compute the max visible length of the local label to align distant labels\n let maxLocalLabelLen = 0;\n for (const key of keys) {\n const rec = byKey.get(key)!;\n if (rec.local) {\n const visibleLocal = `[local: ${iconFor(rec.local)} ${rec.local}]`;\n if (visibleLocal.length > maxLocalLabelLen) {\n maxLocalLabelLen = visibleLocal.length;\n }\n }\n }\n\n for (const key of keys) {\n const rec = byKey.get(key)!;\n const labels: string[] = [];\n\n if (rec.local) {\n const inner = colorize(\n `${iconFor(rec.local)} ${rec.local}`,\n colorFor(rec.local)\n );\n const coloredLocal =\n `${ANSIColors.GREY}[` +\n colorize('local: ', ANSIColors.GREY) +\n inner +\n `${ANSIColors.GREY}]${ANSIColors.RESET}`;\n\n // Pad to align distant label across rows\n const visibleLocal = `[local: ${iconFor(rec.local)} ${rec.local}]`;\n const pad = Math.max(0, maxLocalLabelLen - visibleLocal.length);\n labels.push(coloredLocal + ' '.repeat(pad));\n } else {\n // If no local label, insert spaces to keep distant aligned\n labels.push(' '.repeat(maxLocalLabelLen));\n }\n\n if (rec.remote) {\n const inner = colorize(\n `${iconFor(rec.remote)} ${rec.remote}`,\n colorFor(rec.remote)\n );\n labels.push(\n `${ANSIColors.GREY}[` +\n colorize('distant: ', ANSIColors.GREY) +\n inner +\n `${ANSIColors.GREY}]${ANSIColors.RESET}`\n );\n }\n\n appLogger(\n ` - ${colon(colorizeKey(key), { colSize: keys })} ${labels.join(' ')}`\n );\n }\n};\n\nexport const loadDictionaries = async (\n contentDeclarationsPaths: string[] | string,\n configuration: IntlayerConfig\n): Promise<{\n localDictionaries: Dictionary[];\n remoteDictionaries: Dictionary[];\n pluginDictionaries: Dictionary[];\n time: {\n localDictionaries: number;\n remoteDictionaries: number;\n pluginDictionaries: number;\n };\n}> => {\n const { plugins } = configuration;\n const loadDictionariesStartTime = Date.now();\n const appLogger = getAppLogger(configuration);\n\n appLogger('Dictionaries:', { isVerbose: true });\n\n // Load additional dictionaries via plugins (e.g., ICU JSON ingestion)\n const pluginsWithLoadDictionaries = (plugins ?? []).filter(\n (plugin) => plugin.loadDictionaries\n );\n\n const loadPluginDictionariesPromise = pluginsWithLoadDictionaries.map(\n async (plugin, index) => {\n try {\n const res = await plugin.loadDictionaries?.({\n configuration,\n });\n\n return (res as Dictionary[] | undefined) ?? [];\n } catch (error) {\n logger.setPluginError(error as Error);\n\n return [];\n }\n }\n );\n\n const pluginDictionaries: Dictionary[] = await Promise.all(\n loadPluginDictionariesPromise as Promise<Dictionary[]>[]\n )\n .then((dictionaries) => dictionaries.flat())\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n\n logger.setPluginTotal(pluginDictionaries.length);\n logger.setPluginDone(pluginDictionaries.length);\n\n const pluginDictionariesTime = Date.now();\n\n const files = Array.isArray(contentDeclarationsPaths)\n ? contentDeclarationsPaths\n : [contentDeclarationsPaths];\n\n const localDictionaries: Dictionary[] = await loadContentDeclarations(\n files,\n configuration,\n setLoadDictionariesStatus\n )\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n\n const localDictionariesTime = Date.now();\n\n const localDictionariesStatus = localDictionaries.map(\n (dictionary) =>\n ({\n dictionaryKey: dictionary.key,\n type: 'local',\n status: 'built',\n }) as const\n );\n\n setLoadDictionariesStatus(localDictionariesStatus);\n\n const hasRemoteDictionaries = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n\n if (hasRemoteDictionaries) {\n // We expect to fetch remote dictionaries soon; suppress a transient local-only render\n logger.setExpectRemote(true);\n }\n\n let remoteDictionaries: Dictionary[] = [];\n\n if (hasRemoteDictionaries) {\n remoteDictionaries = await loadRemoteDictionaries(\n configuration,\n setLoadDictionariesStatus,\n {\n onStartRemoteCheck: () => logger.startRemoteCheck(),\n onStopRemoteCheck: () => logger.stopRemoteCheck(),\n onError: (e) => logger.setRemoteError(e),\n }\n )\n .then((dictionaries) =>\n filterInvalidDictionaries(dictionaries, configuration)\n )\n .then((dictionaries) => formatDictionaries(dictionaries));\n }\n\n const remoteDictionariesTime = Date.now();\n\n // Stop spinner and show final progress line(s)\n logger.finish();\n\n printSummary(configuration);\n\n return {\n localDictionaries,\n remoteDictionaries,\n pluginDictionaries,\n time: {\n localDictionaries: localDictionariesTime - pluginDictionariesTime,\n remoteDictionaries: remoteDictionariesTime - localDictionariesTime,\n pluginDictionaries: pluginDictionariesTime - loadDictionariesStartTime,\n },\n };\n};\n"],"mappings":";;;;;;;;AA6BA,IAAIA,yBAA+C,EAAE;AACrD,MAAMC,WAAS,IAAI,oBAAoB;AAEvC,MAAM,6BAA6B,aAAmC;CACpE,MAAMC,UAAgC,CAAC,GAAG,uBAAuB;AAEjE,MAAK,MAAM,YAAY,UAAU;EAC/B,MAAM,QAAQ,QAAQ,WACnB,MACC,EAAE,kBAAkB,SAAS,iBAAiB,EAAE,SAAS,SAAS,KACrE;AACD,MAAI,SAAS,EACX,SAAQ,SAAS;MAEjB,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BAAmB,aAAa,CAAC;AAE3D,UAAO,eAAe,mBAAmB,OAAO;AAChD,UAAO,cAAc,mBAAmB,OAAO;CAE/C,MAAM,yBAAyB,KAAK,KAAK;CAMzC,MAAMC,oBAAkC,MAAM,wBAJhC,MAAM,QAAQ,yBAAyB,GACjD,2BACA,CAAC,yBAAyB,EAI5B,eACA,0BACD,CACE,MAAM,iBACL,0BAA0B,cAAc,cAAc,CACvD,CACA,MAAM,iBAAiB,mBAAmB,aAAa,CAAC;CAE3D,MAAM,wBAAwB,KAAK,KAAK;AAWxC,2BATgC,kBAAkB,KAC/C,gBACE;EACC,eAAe,WAAW;EAC1B,MAAM;EACN,QAAQ;EACT,EACJ,CAEiD;CAElD,MAAM,wBAAwB,QAC5B,cAAc,OAAO,YAAY,cAAc,OAAO,aACvD;AAED,KAAI,sBAEF,UAAO,gBAAgB,KAAK;CAG9B,IAAIC,qBAAmC,EAAE;AAEzC,KAAI,sBACF,sBAAqB,MAAM,uBACzB,eACA,2BACA;EACE,0BAA0BL,SAAO,kBAAkB;EACnD,yBAAyBA,SAAO,iBAAiB;EACjD,UAAU,MAAMA,SAAO,eAAe,EAAE;EACzC,CACF,CACE,MAAM,iBACL,0BAA0B,cAAc,cAAc,CACvD,CACA,MAAM,iBAAiB,mBAAmB,aAAa,CAAC;CAG7D,MAAM,yBAAyB,KAAK,KAAK;AAGzC,UAAO,QAAQ;AAEf,cAAa,cAAc;AAE3B,QAAO;EACL;EACA;EACA;EACA,MAAM;GACJ,mBAAmB,wBAAwB;GAC3C,oBAAoB,yBAAyB;GAC7C,oBAAoB,yBAAyB;GAC9C;EACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildFilesList.mjs","names":[],"sources":["../../../src/utils/buildFilesList.ts"],"sourcesContent":["import { join } from 'node:path';\nimport fg from 'fast-glob';\n\n/**\n * Options for building the files list\n */\nexport type BuildFilesListOptions = {\n /**\n * Glob patterns to match files\n */\n transformPattern: string | string[];\n /**\n * Glob patterns to exclude files\n */\n excludePattern: string | string[];\n /**\n * Base directory for file resolution\n */\n baseDir: string;\n};\n\n/**\n * Adds framework-specific patterns to the existing patterns.\n * If a pattern already includes the framework extension or has a brace expression,\n * it's kept as-is. Otherwise, the extension is added to any existing brace expression.\n *\n * @example\n * addFrameworkPatterns(['src/**\\/*.{ts,tsx}'], 'vue')\n * // Returns: ['src/**\\/*.{ts,tsx,vue}']\n *\n * @example\n * addFrameworkPatterns(['src/**\\/*.vue'], 'vue')\n * // Returns: ['src/**\\/*.vue'] (unchanged, already has .vue)\n */\nconst addFrameworkPatterns = (\n patterns: string[],\n frameworkExtension: string\n): string[] => {\n return patterns.map((pattern) => {\n // If already includes the framework extension, keep as-is\n if (pattern.includes(`.${frameworkExtension}`)) {\n return pattern;\n }\n // If has brace expression, add the extension to it\n if (pattern.includes('{')) {\n return pattern.replace(\n /\\{([^}]+)\\}/,\n (_, exts) => `{${exts},${frameworkExtension}}`\n );\n }\n // No modification needed for patterns without brace expressions\n return pattern;\n });\n};\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] => {\n return Array.isArray(value) ? value : [value];\n};\n\n/**\n * Builds a list of files matching the given patterns.\n *\n * This utility consolidates the file listing logic used across multiple compilers\n * (Vue, Svelte, Vite) to avoid code duplication.\n *\n * @param options - Configuration options for building the file list\n * @returns Array of absolute file paths matching the patterns\n *\n * @example\n * // Basic usage\n * const files = buildFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules;\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // With framework extension (Vue)\n * const files = buildFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n */\nexport const buildFilesList = (options: BuildFilesListOptions): string[] => {\n const { transformPattern, excludePattern, baseDir } = options;\n\n const patterns = normalizeToArray(transformPattern);\n const excludePatterns = normalizeToArray(excludePattern);\n\n const files = fg\n .sync(patterns, {\n cwd: baseDir,\n ignore: excludePatterns,\n })\n .map((file) => join(baseDir, file));\n\n return files;\n};\n"],"mappings":";;;;;;;AA0DA,MAAM,oBAAuB,UAAwB;AACnD,QAAO,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B/C,MAAa,kBAAkB,YAA6C;CAC1E,MAAM,EAAE,kBAAkB,gBAAgB,YAAY;CAEtD,MAAM,WAAW,iBAAiB,iBAAiB;CACnD,MAAM,kBAAkB,iBAAiB,eAAe;AASxD,QAPc,GACX,KAAK,UAAU;EACd,KAAK;EACL,QAAQ;EACT,CAAC,CACD,KAAK,SAAS,KAAK,SAAS,KAAK,CAAC"}
1
+ {"version":3,"file":"buildFilesList.mjs","names":[],"sources":["../../../src/utils/buildFilesList.ts"],"sourcesContent":["import { join } from 'node:path';\nimport fg from 'fast-glob';\n\n/**\n * Options for building the files list\n */\nexport type BuildFilesListOptions = {\n /**\n * Glob patterns to match files\n */\n transformPattern: string | string[];\n /**\n * Glob patterns to exclude files\n */\n excludePattern: string | string[];\n /**\n * Base directory for file resolution\n */\n baseDir: string;\n};\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] => {\n return Array.isArray(value) ? value : [value];\n};\n\n/**\n * Builds a list of files matching the given patterns.\n *\n * This utility consolidates the file listing logic used across multiple compilers\n * (Vue, Svelte, Vite) to avoid code duplication.\n *\n * @param options - Configuration options for building the file list\n * @returns Array of absolute file paths matching the patterns\n *\n * @example\n * // Basic usage\n * const files = buildFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules;\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // With framework extension (Vue)\n * const files = buildFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n */\nexport const buildFilesList = (options: BuildFilesListOptions): string[] => {\n const { transformPattern, excludePattern, baseDir } = options;\n\n const patterns = normalizeToArray(transformPattern);\n const excludePatterns = normalizeToArray(excludePattern);\n\n const files = fg\n .sync(patterns, {\n cwd: baseDir,\n ignore: excludePatterns,\n })\n .map((file) => join(baseDir, file));\n\n return files;\n};\n"],"mappings":";;;;;;;AAwBA,MAAM,oBAAuB,UAAwB;AACnD,QAAO,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B/C,MAAa,kBAAkB,YAA6C;CAC1E,MAAM,EAAE,kBAAkB,gBAAgB,YAAY;CAEtD,MAAM,WAAW,iBAAiB,iBAAiB;CACnD,MAAM,kBAAkB,iBAAiB,eAAe;AASxD,QAPc,GACX,KAAK,UAAU;EACd,KAAK;EACL,QAAQ;EACT,CAAC,CACD,KAAK,SAAS,KAAK,SAAS,KAAK,CAAC"}
@@ -23,7 +23,8 @@ const getComponentTransformPattern = async (intlayerConfig) => {
23
23
  const { traversePattern } = intlayerConfig.build;
24
24
  const filesListPatternPromises = getDistinctRootDirs([baseDir, ...contentDir]).map((cwd) => fg(traversePattern, {
25
25
  cwd,
26
- absolute: true
26
+ absolute: true,
27
+ dot: true
27
28
  }));
28
29
  const filesList = (await Promise.all(filesListPatternPromises)).flat();
29
30
  return Array.from(new Set(filesList));
@@ -33,7 +34,8 @@ const getComponentTransformPatternSync = (intlayerConfig) => {
33
34
  const { traversePattern } = intlayerConfig.build;
34
35
  const filesList = getDistinctRootDirs([baseDir, ...contentDir]).flatMap((cwd) => fg.sync(traversePattern, {
35
36
  cwd,
36
- absolute: true
37
+ absolute: true,
38
+ dot: true
37
39
  }));
38
40
  return Array.from(new Set(filesList));
39
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getComponentTransformPattern.mjs","names":["relative"],"sources":["../../../src/utils/getComponentTransformPattern.ts"],"sourcesContent":["import path from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * Helper to remove directories that are subdirectories of others in the list.\n * Example: ['/root', '/root/src'] -> ['/root']\n * This prevents scanning the same files twice.\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n // 1. Resolve to absolute paths and remove exact duplicates\n const uniqueDirs = Array.from(new Set(dirs.map((d) => path.resolve(d))));\n\n // 2. Sort by length (shortest paths first) so parents appear before children\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n // 3. Filter out any directory that is inside a parent already in the accepted list\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const relative = path.relative(parent, dir);\n return (\n !relative.startsWith('..') && // It is inside the parent\n !path.isAbsolute(relative) && // It is not a different drive/root\n relative !== '' // It is not the parent itself (already handled by Set, but good for safety)\n );\n });\n\n if (!isNested) {\n acc.push(dir);\n }\n return acc;\n }, []);\n};\n\nexport const getComponentTransformPattern = async (\n intlayerConfig: IntlayerConfig\n): Promise<string[]> => {\n const { baseDir, contentDir } = intlayerConfig.content;\n const { traversePattern } = intlayerConfig.build;\n\n // Optimize: Filter out contentDir paths if they are already covered by baseDir\n const distinctRoots = getDistinctRootDirs([baseDir, ...contentDir]);\n\n const filesListPatternPromises = distinctRoots.map((cwd) =>\n fg(traversePattern, {\n cwd,\n absolute: true,\n })\n );\n\n const filesList = (await Promise.all(filesListPatternPromises)).flat();\n\n // Deduplicate files just in case of overlapping patterns or symlinks\n return Array.from(new Set(filesList));\n};\n\nexport const getComponentTransformPatternSync = (\n intlayerConfig: IntlayerConfig\n): string[] => {\n const { baseDir, contentDir } = intlayerConfig.content;\n const { traversePattern } = intlayerConfig.build;\n\n // Optimize: Filter out contentDir paths if they are already covered by baseDir\n const distinctRoots = getDistinctRootDirs([baseDir, ...contentDir]);\n\n const filesList = distinctRoots.flatMap((cwd) =>\n fg.sync(traversePattern, {\n cwd,\n absolute: true,\n })\n );\n\n return Array.from(new Set(filesList));\n};\n"],"mappings":";;;;;;;;;AASA,MAAM,uBAAuB,SAA6B;CAExD,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC;AAGxE,YAAW,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO;AAG9C,QAAO,WAAW,QAAQ,KAAe,QAAQ;AAU/C,MAAI,CATa,IAAI,MAAM,WAAW;GACpC,MAAMA,aAAW,KAAK,SAAS,QAAQ,IAAI;AAC3C,UACE,CAACA,WAAS,WAAW,KAAK,IAC1B,CAAC,KAAK,WAAWA,WAAS,IAC1BA,eAAa;IAEf,CAGA,KAAI,KAAK,IAAI;AAEf,SAAO;IACN,EAAE,CAAC;;AAGR,MAAa,+BAA+B,OAC1C,mBACsB;CACtB,MAAM,EAAE,SAAS,eAAe,eAAe;CAC/C,MAAM,EAAE,oBAAoB,eAAe;CAK3C,MAAM,2BAFgB,oBAAoB,CAAC,SAAS,GAAG,WAAW,CAAC,CAEpB,KAAK,QAClD,GAAG,iBAAiB;EAClB;EACA,UAAU;EACX,CAAC,CACH;CAED,MAAM,aAAa,MAAM,QAAQ,IAAI,yBAAyB,EAAE,MAAM;AAGtE,QAAO,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC;;AAGvC,MAAa,oCACX,mBACa;CACb,MAAM,EAAE,SAAS,eAAe,eAAe;CAC/C,MAAM,EAAE,oBAAoB,eAAe;CAK3C,MAAM,YAFgB,oBAAoB,CAAC,SAAS,GAAG,WAAW,CAAC,CAEnC,SAAS,QACvC,GAAG,KAAK,iBAAiB;EACvB;EACA,UAAU;EACX,CAAC,CACH;AAED,QAAO,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC"}
1
+ {"version":3,"file":"getComponentTransformPattern.mjs","names":["relative"],"sources":["../../../src/utils/getComponentTransformPattern.ts"],"sourcesContent":["import path from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * Helper to remove directories that are subdirectories of others in the list.\n * Example: ['/root', '/root/src'] -> ['/root']\n * This prevents scanning the same files twice.\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n // 1. Resolve to absolute paths and remove exact duplicates\n const uniqueDirs = Array.from(new Set(dirs.map((d) => path.resolve(d))));\n\n // 2. Sort by length (shortest paths first) so parents appear before children\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n // 3. Filter out any directory that is inside a parent already in the accepted list\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const relative = path.relative(parent, dir);\n return (\n !relative.startsWith('..') && // It is inside the parent\n !path.isAbsolute(relative) && // It is not a different drive/root\n relative !== '' // It is not the parent itself (already handled by Set, but good for safety)\n );\n });\n\n if (!isNested) {\n acc.push(dir);\n }\n return acc;\n }, []);\n};\n\nexport const getComponentTransformPattern = async (\n intlayerConfig: IntlayerConfig\n): Promise<string[]> => {\n const { baseDir, contentDir } = intlayerConfig.content;\n const { traversePattern } = intlayerConfig.build;\n\n // Optimize: Filter out contentDir paths if they are already covered by baseDir\n const distinctRoots = getDistinctRootDirs([baseDir, ...contentDir]);\n\n const filesListPatternPromises = distinctRoots.map((cwd) =>\n fg(traversePattern, {\n cwd,\n absolute: true,\n dot: true,\n })\n );\n\n const filesList = (await Promise.all(filesListPatternPromises)).flat();\n\n // Deduplicate files just in case of overlapping patterns or symlinks\n return Array.from(new Set(filesList));\n};\n\nexport const getComponentTransformPatternSync = (\n intlayerConfig: IntlayerConfig\n): string[] => {\n const { baseDir, contentDir } = intlayerConfig.content;\n const { traversePattern } = intlayerConfig.build;\n\n // Optimize: Filter out contentDir paths if they are already covered by baseDir\n const distinctRoots = getDistinctRootDirs([baseDir, ...contentDir]);\n\n const filesList = distinctRoots.flatMap((cwd) =>\n fg.sync(traversePattern, {\n cwd,\n absolute: true,\n dot: true,\n })\n );\n\n return Array.from(new Set(filesList));\n};\n"],"mappings":";;;;;;;;;AASA,MAAM,uBAAuB,SAA6B;CAExD,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC;AAGxE,YAAW,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO;AAG9C,QAAO,WAAW,QAAQ,KAAe,QAAQ;AAU/C,MAAI,CATa,IAAI,MAAM,WAAW;GACpC,MAAMA,aAAW,KAAK,SAAS,QAAQ,IAAI;AAC3C,UACE,CAACA,WAAS,WAAW,KAAK,IAC1B,CAAC,KAAK,WAAWA,WAAS,IAC1BA,eAAa;IAEf,CAGA,KAAI,KAAK,IAAI;AAEf,SAAO;IACN,EAAE,CAAC;;AAGR,MAAa,+BAA+B,OAC1C,mBACsB;CACtB,MAAM,EAAE,SAAS,eAAe,eAAe;CAC/C,MAAM,EAAE,oBAAoB,eAAe;CAK3C,MAAM,2BAFgB,oBAAoB,CAAC,SAAS,GAAG,WAAW,CAAC,CAEpB,KAAK,QAClD,GAAG,iBAAiB;EAClB;EACA,UAAU;EACV,KAAK;EACN,CAAC,CACH;CAED,MAAM,aAAa,MAAM,QAAQ,IAAI,yBAAyB,EAAE,MAAM;AAGtE,QAAO,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC;;AAGvC,MAAa,oCACX,mBACa;CACb,MAAM,EAAE,SAAS,eAAe,eAAe;CAC/C,MAAM,EAAE,oBAAoB,eAAe;CAK3C,MAAM,YAFgB,oBAAoB,CAAC,SAAS,GAAG,WAAW,CAAC,CAEnC,SAAS,QACvC,GAAG,KAAK,iBAAiB;EACvB;EACA,UAAU;EACV,KAAK;EACN,CAAC,CACH;AAED,QAAO,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC"}
@@ -1,14 +1,14 @@
1
1
  import { UnmergedDictionaryOutput } from "./writeUnmergedDictionary.js";
2
2
  import { MergedDictionaryOutput } from "./writeMergedDictionary.js";
3
3
  import { LocalizedDictionaryOutput } from "./writeDynamicDictionary.js";
4
- import * as _intlayer_types1 from "@intlayer/types";
4
+ import * as _intlayer_types20 from "@intlayer/types";
5
5
  import { Dictionary } from "@intlayer/types";
6
6
 
7
7
  //#region src/buildIntlayerDictionary/buildIntlayerDictionary.d.ts
8
8
  /**
9
9
  * This function transpile the bundled code to to make dictionaries as JSON files
10
10
  */
11
- declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?: _intlayer_types1.IntlayerConfig, formats?: ("cjs" | "esm")[], importOtherDictionaries?: boolean) => Promise<{
11
+ declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?: _intlayer_types20.IntlayerConfig, formats?: ("cjs" | "esm")[], importOtherDictionaries?: boolean) => Promise<{
12
12
  unmergedDictionaries: UnmergedDictionaryOutput;
13
13
  mergedDictionaries: MergedDictionaryOutput;
14
14
  dynamicDictionaries: LocalizedDictionaryOutput;
@@ -1 +1 @@
1
- {"version":3,"file":"buildIntlayerDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/buildIntlayerDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAca,4CACe,8BAAU,gBAAA,CACpC,mFAE8B;wBAFI;EAFvB,kBAsEZ,wBAAA;EArE2B,mBAAA,2BAAA;EAAU,iBACpC,2BAAA;CAAkC,CAAA"}
1
+ {"version":3,"file":"buildIntlayerDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/buildIntlayerDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAca,4CACe,8BAAU,iBAAA,CACpC,mFAE8B;wBAFI;EAFvB,kBAsEZ,wBAAA;EArE2B,mBAAA,2BAAA;EAAU,iBACpC,2BAAA;CAAkC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { MergedDictionaryOutput } from "./writeMergedDictionary.js";
2
- import * as _intlayer_types0 from "@intlayer/types";
2
+ import * as _intlayer_types14 from "@intlayer/types";
3
3
  import { Dictionary, Locale } from "@intlayer/types";
4
4
 
5
5
  //#region src/buildIntlayerDictionary/writeDynamicDictionary.d.ts
@@ -12,7 +12,7 @@ type LocalizedDictionaryOutput = Record<string, LocalizedDictionaryResult>;
12
12
  /**
13
13
  * This function generates the content of the dictionary list file
14
14
  */
15
- declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types0.IntlayerConfig) => string;
15
+ declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types14.IntlayerConfig) => string;
16
16
  /**
17
17
  * Write the localized dictionaries to the dictionariesDir
18
18
  * @param mergedDictionaries - The merged dictionaries
@@ -29,7 +29,7 @@ declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: L
29
29
  * // { key: 'home', content: { ... } },
30
30
  * ```
31
31
  */
32
- declare const writeDynamicDictionary: (mergedDictionaries: MergedDictionaryOutput, configuration?: _intlayer_types0.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
32
+ declare const writeDynamicDictionary: (mergedDictionaries: MergedDictionaryOutput, configuration?: _intlayer_types14.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
33
33
  //#endregion
34
34
  export { DictionaryResult, LocalizedDictionaryOutput, LocalizedDictionaryResult, generateDictionaryEntryPoint, writeDynamicDictionary };
35
35
  //# sourceMappingURL=writeDynamicDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeDynamicDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/writeDynamicDictionary.ts"],"sourcesContent":[],"mappings":";;;;;KAcY,gBAAA;;cAEE;AAFd,CAAA;AAKY,KAAA,yBAAA,GAA4B,OAAH,CACnC,MADmC,CAC5B,MAD4B,EACpB,gBADoB,CAAA,CAAA;AAC5B,KAGG,yBAAA,GAA4B,MAH/B,CAAA,MAAA,EAKP,yBALO,CAAA;;;;AADsC,cAYlC,4BAZkC,EAAA,CAAA,gCAAA,EAaX,yBAbW,EAAA,MAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,aAAA,CAAA,EAac,gBAAA,CAE3D,cAf6C,EAAA,GAAA,MAAA;AAI/C;AAQA;AAsDA;;;;;;;;;;;;;;cAAa,6CACS,wCAAsB,gBAAA,CAC1C,gDAEC,QAAQ"}
1
+ {"version":3,"file":"writeDynamicDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/writeDynamicDictionary.ts"],"sourcesContent":[],"mappings":";;;;;KAcY,gBAAA;;cAEE;AAFd,CAAA;AAKY,KAAA,yBAAA,GAA4B,OAAH,CACnC,MADmC,CAC5B,MAD4B,EACpB,gBADoB,CAAA,CAAA;AAC5B,KAGG,yBAAA,GAA4B,MAH/B,CAAA,MAAA,EAKP,yBALO,CAAA;;;;AADsC,cAYlC,4BAZkC,EAAA,CAAA,gCAAA,EAaX,yBAbW,EAAA,MAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,aAAA,CAAA,EAac,iBAAA,CAE3D,cAf6C,EAAA,GAAA,MAAA;AAI/C;AAQA;AAsDA;;;;;;;;;;;;;;cAAa,6CACS,wCAAsB,iBAAA,CAC1C,gDAEC,QAAQ"}
@@ -1,11 +1,11 @@
1
1
  import { LocalizedDictionaryOutput, LocalizedDictionaryResult } from "./writeDynamicDictionary.js";
2
- import * as _intlayer_types2 from "@intlayer/types";
2
+ import * as _intlayer_types18 from "@intlayer/types";
3
3
 
4
4
  //#region src/buildIntlayerDictionary/writeFetchDictionary.d.ts
5
5
  /**
6
6
  * This function generates the content of the dictionary list file
7
7
  */
8
- declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types2.IntlayerConfig) => string;
8
+ declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types18.IntlayerConfig) => string;
9
9
  /**
10
10
  * Write the localized dictionaries to the dictionariesDir
11
11
  * @param mergedDictionaries - The merged dictionaries
@@ -22,7 +22,7 @@ declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: Loc
22
22
  * // { key: 'home', content: { ... } },
23
23
  * ```
24
24
  */
25
- declare const writeFetchDictionary: (dynamicDictionaries: LocalizedDictionaryOutput, configuration?: _intlayer_types2.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
25
+ declare const writeFetchDictionary: (dynamicDictionaries: LocalizedDictionaryOutput, configuration?: _intlayer_types18.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
26
26
  //#endregion
27
27
  export { generateDictionaryEntryPoint, writeFetchDictionary };
28
28
  //# sourceMappingURL=writeFetchDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeFetchDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/writeFetchDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiBa,cAAA,4BACqB,EAAA,CAAA,8BAAyB,EAAzB,yBAEE,EAAA,MAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,aAAA,CAAA,EAFuB,gBAAA,CAEzD,cAAkC,EAAA,GAAA,MAAA;AA+CpC;;;;;;;;;;;;;;;;cAAa,4CACU,2CAAyB,gBAAA,CAC9C,gDAEC,QAAQ"}
1
+ {"version":3,"file":"writeFetchDictionary.d.ts","names":[],"sources":["../../../src/buildIntlayerDictionary/writeFetchDictionary.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiBa,cAAA,4BACqB,EAAA,CAAA,8BAAyB,EAAzB,yBAEE,EAAA,MAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,aAAA,CAAA,EAFuB,iBAAA,CAEzD,cAAkC,EAAA,GAAA,MAAA;AA+CpC;;;;;;;;;;;;;;;;cAAa,4CACU,2CAAyB,iBAAA,CAC9C,gDAEC,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import { UnmergedDictionaryOutput } from "./writeUnmergedDictionary.js";
2
- import * as _intlayer_types22 from "@intlayer/types";
2
+ import * as _intlayer_types13 from "@intlayer/types";
3
3
  import { Dictionary } from "@intlayer/types";
4
4
 
5
5
  //#region src/buildIntlayerDictionary/writeMergedDictionary.d.ts
@@ -24,7 +24,7 @@ type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;
24
24
  * // { key: 'home', content: { ... } },
25
25
  * ```
26
26
  */
27
- declare const writeMergedDictionaries: (groupedDictionaries: UnmergedDictionaryOutput, configuration?: _intlayer_types22.IntlayerConfig) => Promise<MergedDictionaryOutput>;
27
+ declare const writeMergedDictionaries: (groupedDictionaries: UnmergedDictionaryOutput, configuration?: _intlayer_types13.IntlayerConfig) => Promise<MergedDictionaryOutput>;
28
28
  //#endregion
29
29
  export { MergedDictionaryOutput, MergedDictionaryResult, writeMergedDictionaries };
30
30
  //# sourceMappingURL=writeMergedDictionary.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as _intlayer_types18 from "@intlayer/types";
1
+ import * as _intlayer_types16 from "@intlayer/types";
2
2
  import { Dictionary } from "@intlayer/types";
3
3
 
4
4
  //#region src/buildIntlayerDictionary/writeRemoteDictionary.d.ts
@@ -23,7 +23,7 @@ type RemoteDictionaryOutput = Record<string, RemoteDictionaryResult>;
23
23
  * // { key: 'home', content: { ... } },
24
24
  * ```
25
25
  */
26
- declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?: _intlayer_types18.IntlayerConfig) => Promise<RemoteDictionaryOutput>;
26
+ declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?: _intlayer_types16.IntlayerConfig) => Promise<RemoteDictionaryOutput>;
27
27
  //#endregion
28
28
  export { RemoteDictionaryOutput, RemoteDictionaryResult, writeRemoteDictionary };
29
29
  //# sourceMappingURL=writeRemoteDictionary.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as _intlayer_types20 from "@intlayer/types";
1
+ import * as _intlayer_types21 from "@intlayer/types";
2
2
 
3
3
  //#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts
4
4
  type CreateDictionaryEntryPointOptions = {
@@ -8,7 +8,7 @@ type CreateDictionaryEntryPointOptions = {
8
8
  /**
9
9
  * This function generates a list of dictionaries in the main directory
10
10
  */
11
- declare const createDictionaryEntryPoint: (configuration?: _intlayer_types20.IntlayerConfig, options?: CreateDictionaryEntryPointOptions) => Promise<void>;
11
+ declare const createDictionaryEntryPoint: (configuration?: _intlayer_types21.IntlayerConfig, options?: CreateDictionaryEntryPointOptions) => Promise<void>;
12
12
  //#endregion
13
13
  export { CreateDictionaryEntryPointOptions, createDictionaryEntryPoint };
14
14
  //# sourceMappingURL=createDictionaryEntryPoint.d.ts.map
@@ -1,10 +1,10 @@
1
- import * as _intlayer_types21 from "@intlayer/types";
1
+ import * as _intlayer_types22 from "@intlayer/types";
2
2
 
3
3
  //#region src/createDictionaryEntryPoint/generateDictionaryListContent.d.ts
4
4
  /**
5
5
  * This function generates the content of the dictionary list file
6
6
  */
7
- declare const generateDictionaryListContent: (dictionaries: string[], functionName: string, importType: "json" | "javascript", format?: "cjs" | "esm", configuration?: _intlayer_types21.IntlayerConfig) => string;
7
+ declare const generateDictionaryListContent: (dictionaries: string[], functionName: string, importType: "json" | "javascript", format?: "cjs" | "esm", configuration?: _intlayer_types22.IntlayerConfig) => string;
8
8
  //#endregion
9
9
  export { generateDictionaryListContent };
10
10
  //# sourceMappingURL=generateDictionaryListContent.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as _intlayer_types4 from "@intlayer/types";
1
+ import * as _intlayer_types0 from "@intlayer/types";
2
2
  import { Dictionary } from "@intlayer/types";
3
3
  import * as _intlayer_core_messageFormat0 from "@intlayer/core/messageFormat";
4
4
 
@@ -9,45 +9,45 @@ declare const formatDictionaryOutput: (dictionary: Dictionary) => Dictionary | {
9
9
  format: string;
10
10
  content: _intlayer_core_messageFormat0.JsonValue;
11
11
  $schema?: string;
12
- id?: _intlayer_types4.DictionaryId;
12
+ id?: _intlayer_types0.DictionaryId;
13
13
  projectIds?: string[];
14
- localId?: _intlayer_types4.LocalDictionaryId;
15
- localIds?: _intlayer_types4.LocalDictionaryId[];
16
- key: _intlayer_types4.DictionaryKey;
14
+ localId?: _intlayer_types0.LocalDictionaryId;
15
+ localIds?: _intlayer_types0.LocalDictionaryId[];
16
+ key: _intlayer_types0.DictionaryKey;
17
17
  title?: string;
18
18
  description?: string;
19
19
  versions?: string[];
20
20
  version?: string;
21
21
  filePath?: string;
22
22
  tags?: string[];
23
- locale?: _intlayer_types4.LocalesValues;
24
- fill?: _intlayer_types4.Fill;
23
+ locale?: _intlayer_types0.LocalesValues;
24
+ fill?: _intlayer_types0.Fill;
25
25
  filled?: true;
26
26
  priority?: number;
27
27
  live?: boolean;
28
- location?: _intlayer_types4.DictionaryLocation;
28
+ location?: _intlayer_types0.DictionaryLocation;
29
29
  };
30
30
  declare const formatDictionariesOutput: (dictionaries: Dictionary[]) => (Dictionary | {
31
31
  format: string;
32
32
  content: _intlayer_core_messageFormat0.JsonValue;
33
33
  $schema?: string;
34
- id?: _intlayer_types4.DictionaryId;
34
+ id?: _intlayer_types0.DictionaryId;
35
35
  projectIds?: string[];
36
- localId?: _intlayer_types4.LocalDictionaryId;
37
- localIds?: _intlayer_types4.LocalDictionaryId[];
38
- key: _intlayer_types4.DictionaryKey;
36
+ localId?: _intlayer_types0.LocalDictionaryId;
37
+ localIds?: _intlayer_types0.LocalDictionaryId[];
38
+ key: _intlayer_types0.DictionaryKey;
39
39
  title?: string;
40
40
  description?: string;
41
41
  versions?: string[];
42
42
  version?: string;
43
43
  filePath?: string;
44
44
  tags?: string[];
45
- locale?: _intlayer_types4.LocalesValues;
46
- fill?: _intlayer_types4.Fill;
45
+ locale?: _intlayer_types0.LocalesValues;
46
+ fill?: _intlayer_types0.Fill;
47
47
  filled?: true;
48
48
  priority?: number;
49
49
  live?: boolean;
50
- location?: _intlayer_types4.DictionaryLocation;
50
+ location?: _intlayer_types0.DictionaryLocation;
51
51
  })[];
52
52
  //#endregion
53
53
  export { formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput };
@@ -27,6 +27,7 @@ import { handleUnlinkedContentDeclarationFile } from "./handleUnlinkedContentDec
27
27
  import { initIntlayer } from "./init/index.js";
28
28
  import { listDictionaries, listDictionariesWithStats } from "./listDictionariesPath.js";
29
29
  import { DiffMode, ListGitFilesOptions, ListGitLinesOptions, listGitFiles, listGitLines } from "./listGitFiles.js";
30
+ import { ListProjectsOptions, listProjects } from "./listProjects.js";
30
31
  import { prepareIntlayer } from "./prepareIntlayer.js";
31
32
  import { reduceDictionaryContent } from "./reduceDictionaryContent/reduceDictionaryContent.js";
32
33
  import { extractDictionaryKey } from "./transformFiles/extractDictionaryKey.js";
@@ -56,4 +57,4 @@ import { writeContentDeclaration } from "./writeContentDeclaration/writeContentD
56
57
  import { writeJSFile } from "./writeContentDeclaration/writeJSFile.js";
57
58
  import "./writeContentDeclaration/index.js";
58
59
  import { detectFormatCommand } from "./writeContentDeclaration/detectFormatCommand.js";
59
- export { ATTRIBUTES_TO_EXTRACT, type BuildFilesListOptions, type DictionaryStatus, type DiffMode, type Extension, type Format, type JSONObject, type JsonChunk, type ListGitFilesOptions, type ListGitLinesOptions, type PackageName, type ParallelHandle, assembleJSON, buildAndWatchIntlayer, buildDictionary, buildFilesList, chunkJSON, cleanOutputDir, createDictionaryEntryPoint, createModuleAugmentation, createTypes, detectExportedComponentName, detectFormatCommand, extractDictionaryKey, extractIntlayer, fetchDistantDictionaries, formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput, formatLocale, formatPath, generateDictionaryListContent, generateKey, getBuiltDictionariesPath, getBuiltDynamicDictionariesPath, getBuiltFetchDictionariesPath, getBuiltRemoteDictionariesPath, getBuiltUnmergedDictionariesPath, getChunk, getComponentTransformPattern, getComponentTransformPatternSync, getContentDeclarationFileTemplate, getExtensionFromFormat, getFileHash, getFormatFromExtension, getGlobalLimiter, getTaskLimiter, handleAdditionalContentDeclarationFile, handleContentDeclarationFileChange, handleUnlinkedContentDeclarationFile, initIntlayer, isInvalidDictionary, listDictionaries, listDictionariesWithStats, listGitFiles, listGitLines, loadContentDeclarations, loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, pLimit, parallelize, parallelizeGlobal, prepareIntlayer, reconstructFromSingleChunk, reduceDictionaryContent, reduceObjectFormat, resolveObjectPromises, runOnce, runParallel, shouldExtract, sortAlphabetically, splitTextByLines, transformFiles, transformJSFile, verifyIdenticObjectFormat, watch, writeContentDeclaration, writeJSFile };
60
+ export { ATTRIBUTES_TO_EXTRACT, type BuildFilesListOptions, type DictionaryStatus, type DiffMode, type Extension, type Format, type JSONObject, type JsonChunk, type ListGitFilesOptions, type ListGitLinesOptions, type ListProjectsOptions, type PackageName, type ParallelHandle, assembleJSON, buildAndWatchIntlayer, buildDictionary, buildFilesList, chunkJSON, cleanOutputDir, createDictionaryEntryPoint, createModuleAugmentation, createTypes, detectExportedComponentName, detectFormatCommand, extractDictionaryKey, extractIntlayer, fetchDistantDictionaries, formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput, formatLocale, formatPath, generateDictionaryListContent, generateKey, getBuiltDictionariesPath, getBuiltDynamicDictionariesPath, getBuiltFetchDictionariesPath, getBuiltRemoteDictionariesPath, getBuiltUnmergedDictionariesPath, getChunk, getComponentTransformPattern, getComponentTransformPatternSync, getContentDeclarationFileTemplate, getExtensionFromFormat, getFileHash, getFormatFromExtension, getGlobalLimiter, getTaskLimiter, handleAdditionalContentDeclarationFile, handleContentDeclarationFileChange, handleUnlinkedContentDeclarationFile, initIntlayer, isInvalidDictionary, listDictionaries, listDictionariesWithStats, listGitFiles, listGitLines, listProjects, loadContentDeclarations, loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, pLimit, parallelize, parallelizeGlobal, prepareIntlayer, reconstructFromSingleChunk, reduceDictionaryContent, reduceObjectFormat, resolveObjectPromises, runOnce, runParallel, shouldExtract, sortAlphabetically, splitTextByLines, transformFiles, transformJSFile, verifyIdenticObjectFormat, watch, writeContentDeclaration, writeJSFile };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"sourcesContent":[],"mappings":";;AAqBA;;cAAa,mCAAqC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"sourcesContent":[],"mappings":";;AA4JA;;cAAa,mCAAqC"}
@@ -1 +1 @@
1
- {"version":3,"file":"listDictionariesPath.d.ts","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AAaA;AACiB,cAdJ,gBAcI,EAAA,CAAA,aAAA,EAbA,cAaA,EAAA,GAZd,OAYc,CAAA,MAAA,EAAA,CAAA;AAAc,cADlB,yBACkB,EAAA,CAAA,aAAA,EAAd,cAAc,EAAA,GAAA,OAAA,CAAA;EAAA,IAAA,EAAA,MAAA;EAAA,KAAA,EAAA,QAAA,CAAA,KAAA"}
1
+ {"version":3,"file":"listDictionariesPath.d.ts","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AA4CA;AACiB,cA7CJ,gBA6CI,EAAA,CAAA,aAAA,EA5CA,cA4CA,EAAA,GA3Cd,OA2Cc,CAAA,MAAA,EAAA,CAAA;AAAc,cADlB,yBACkB,EAAA,CAAA,aAAA,EAAd,cAAc,EAAA,GAAA,OAAA,CAAA;EAAA,IAAA,EAAA,MAAA;EAAA,KAAA,EAAA,QAAA,CAAA,KAAA"}
@@ -0,0 +1,26 @@
1
+ //#region src/listProjects.d.ts
2
+ type ListProjectsOptions = {
3
+ /**
4
+ * Base directory to search from
5
+ * @default process.cwd()
6
+ */
7
+ baseDir?: string;
8
+ /**
9
+ * If true, search from the git root directory instead of baseDir
10
+ * @default false
11
+ */
12
+ gitRoot?: boolean;
13
+ };
14
+ /**
15
+ * List all Intlayer projects by searching for configuration files
16
+ *
17
+ * @param options - Options for listing projects
18
+ * @returns Array of absolute paths to project directories containing Intlayer config
19
+ */
20
+ declare const listProjects: (options?: ListProjectsOptions) => Promise<{
21
+ searchDir: string;
22
+ projectsPath: string[];
23
+ }>;
24
+ //#endregion
25
+ export { ListProjectsOptions, listProjects };
26
+ //# sourceMappingURL=listProjects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listProjects.d.ts","names":[],"sources":["../../src/listProjects.ts"],"sourcesContent":[],"mappings":";KAKY,mBAAA;EAAA;AAgCZ;;;;;;;;;;;;;;;;cAAa,yBACD,wBACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadDictionaries.d.ts","names":[],"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":[],"mappings":";;;KAcY,kBAAA;;EAAA,IAAA,EAAA,OAAA,GAAA,QAAkB;EA6IjB,MAAA,EAAA,SAAA,GAmIZ,UAAA,GAAA,SAAA,GAAA,OAAA,GAAA,UAAA,GAAA,OAAA,GAAA,UAAA,GAAA,OAAA;EAjIgB,KAAA,CAAA,EAAA,MAAA;CAEI;AACC,cALT,gBAKS,EAAA,CAAA,wBAAA,EAAA,MAAA,EAAA,GAAA,MAAA,EAAA,aAAA,EAHL,cAGK,EAAA,GAFnB,OAEmB,CAAA;EACA,iBAAA,EAFD,UAEC,EAAA;EAHnB,kBAAA,EAEmB,UAFnB,EAAA;EAAO,kBAAA,EAGY,UAHZ,EAAA"}
1
+ {"version":3,"file":"loadDictionaries.d.ts","names":[],"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":[],"mappings":";;;KAcY,kBAAA;;EAAA,IAAA,EAAA,OAAA,GAAA,QAAkB;EA6IjB,MAAA,EAAA,SAAA,GA6HZ,UAAA,GAAA,SAAA,GAAA,OAAA,GAAA,UAAA,GAAA,OAAA,GAAA,UAAA,GAAA,OAAA;EA3HgB,KAAA,CAAA,EAAA,MAAA;CAEI;AACC,cALT,gBAKS,EAAA,CAAA,wBAAA,EAAA,MAAA,EAAA,GAAA,MAAA,EAAA,aAAA,EAHL,cAGK,EAAA,GAFnB,OAEmB,CAAA;EACA,iBAAA,EAFD,UAEC,EAAA;EAHnB,kBAAA,EAEmB,UAFnB,EAAA;EAAO,kBAAA,EAGY,UAHZ,EAAA"}
@@ -1,11 +1,11 @@
1
1
  import { DictionariesStatus } from "./loadDictionaries.js";
2
- import * as _intlayer_types19 from "@intlayer/types";
2
+ import * as _intlayer_types17 from "@intlayer/types";
3
3
  import { Dictionary } from "@intlayer/types";
4
4
  import { DictionaryAPI } from "@intlayer/backend";
5
5
 
6
6
  //#region src/loadDictionaries/loadRemoteDictionaries.d.ts
7
7
  declare const formatDistantDictionaries: (dictionaries: (DictionaryAPI | Dictionary)[]) => Dictionary[];
8
- declare const loadRemoteDictionaries: (configuration?: _intlayer_types19.IntlayerConfig, onStatusUpdate?: (status: DictionariesStatus[]) => void, options?: {
8
+ declare const loadRemoteDictionaries: (configuration?: _intlayer_types17.IntlayerConfig, onStatusUpdate?: (status: DictionariesStatus[]) => void, options?: {
9
9
  onStartRemoteCheck?: () => void;
10
10
  onStopRemoteCheck?: () => void;
11
11
  onError?: (error: Error) => void;