@intlayer/cli 9.5.7 → 9.5.9-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_utils_asset.cjs +1 -1
- package/dist/cjs/auth/login.cjs +24 -16
- package/dist/cjs/auth/login.cjs.map +1 -1
- package/dist/cjs/build.cjs +1 -1
- package/dist/cjs/ci.cjs +1 -1
- package/dist/cjs/cli.cjs +18 -7
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/config.cjs +1 -1
- package/dist/cjs/editor.cjs +1 -1
- package/dist/cjs/extract.cjs +5 -5
- package/dist/cjs/fill/fill.cjs +2 -2
- package/dist/cjs/fill/formatAutoFilledFilePath.cjs +1 -1
- package/dist/cjs/fill/listTranslationsTasks.cjs +1 -1
- package/dist/cjs/fill/translateDictionary.cjs +1 -1
- package/dist/cjs/fill/writeFill.cjs +1 -1
- package/dist/cjs/getTargetDictionary.cjs +1 -1
- package/dist/cjs/index.cjs +8 -7
- package/dist/cjs/init.cjs +65 -147
- package/dist/cjs/init.cjs.map +1 -1
- package/dist/cjs/initMCP.cjs +1 -25
- package/dist/cjs/initMCP.cjs.map +1 -1
- package/dist/cjs/initSkills.cjs +36 -27
- package/dist/cjs/initSkills.cjs.map +1 -1
- package/dist/cjs/listContentDeclaration.cjs +2 -2
- package/dist/cjs/liveSync.cjs +4 -4
- package/dist/cjs/pull.cjs +4 -4
- package/dist/cjs/push/push.cjs +5 -5
- package/dist/cjs/pushConfig.cjs +1 -1
- package/dist/cjs/reviewDoc/reviewDoc.cjs +3 -3
- package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +3 -3
- package/dist/cjs/reviewDoc/reviewDocLog.cjs +1 -1
- package/dist/cjs/searchDoc.cjs +1 -1
- package/dist/cjs/test/listMissingTranslations.cjs +1 -1
- package/dist/cjs/test/test.cjs +1 -1
- package/dist/cjs/translateDoc/translateDoc.cjs +2 -2
- package/dist/cjs/translateDoc/translateFile.cjs +2 -2
- package/dist/cjs/upgrade.cjs +18 -0
- package/dist/cjs/upgrade.cjs.map +1 -0
- package/dist/cjs/utils/getOutputFilePath.cjs +1 -1
- package/dist/cjs/utils/getParentPackageJSON.cjs +1 -1
- package/dist/cjs/watch.cjs +1 -1
- package/dist/esm/_virtual/_utils_asset.mjs +1 -1
- package/dist/esm/auth/login.mjs +23 -15
- package/dist/esm/auth/login.mjs.map +1 -1
- package/dist/esm/build.mjs +1 -1
- package/dist/esm/ci.mjs +1 -1
- package/dist/esm/cli.mjs +19 -8
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/editor.mjs +1 -1
- package/dist/esm/extract.mjs +6 -6
- package/dist/esm/extract.mjs.map +1 -1
- package/dist/esm/fill/fill.mjs +4 -4
- package/dist/esm/fill/fill.mjs.map +1 -1
- package/dist/esm/fill/formatAutoFilledFilePath.mjs +1 -1
- package/dist/esm/fill/listTranslationsTasks.mjs +1 -1
- package/dist/esm/fill/translateDictionary.mjs +1 -1
- package/dist/esm/fill/writeFill.mjs +1 -1
- package/dist/esm/getTargetDictionary.mjs +1 -1
- package/dist/esm/index.mjs +9 -9
- package/dist/esm/init.mjs +67 -147
- package/dist/esm/init.mjs.map +1 -1
- package/dist/esm/initMCP.mjs +3 -25
- package/dist/esm/initMCP.mjs.map +1 -1
- package/dist/esm/initSkills.mjs +36 -28
- package/dist/esm/initSkills.mjs.map +1 -1
- package/dist/esm/listContentDeclaration.mjs +2 -2
- package/dist/esm/liveSync.mjs +3 -3
- package/dist/esm/pull.mjs +4 -4
- package/dist/esm/push/push.mjs +7 -7
- package/dist/esm/push/push.mjs.map +1 -1
- package/dist/esm/pushConfig.mjs +1 -1
- package/dist/esm/reviewDoc/reviewDoc.mjs +3 -3
- package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +3 -3
- package/dist/esm/reviewDoc/reviewDocLog.mjs +1 -1
- package/dist/esm/searchDoc.mjs +1 -1
- package/dist/esm/test/listMissingTranslations.mjs +1 -1
- package/dist/esm/test/test.mjs +1 -1
- package/dist/esm/translateDoc/translateDoc.mjs +2 -2
- package/dist/esm/translateDoc/translateFile.mjs +2 -2
- package/dist/esm/upgrade.mjs +17 -0
- package/dist/esm/upgrade.mjs.map +1 -0
- package/dist/esm/utils/getOutputFilePath.mjs +1 -1
- package/dist/esm/utils/getParentPackageJSON.mjs +1 -1
- package/dist/esm/watch.mjs +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/init.d.ts.map +1 -1
- package/dist/types/initMCP.d.ts.map +1 -1
- package/dist/types/initSkills.d.ts +11 -1
- package/dist/types/initSkills.d.ts.map +1 -1
- package/dist/types/upgrade.d.ts +9 -0
- package/dist/types/upgrade.d.ts.map +1 -0
- package/package.json +10 -10
- package/dist/cjs/initBuildOptimization.cjs +0 -80
- package/dist/cjs/initBuildOptimization.cjs.map +0 -1
- package/dist/cjs/initCompiler.cjs +0 -77
- package/dist/cjs/initCompiler.cjs.map +0 -1
- package/dist/esm/initBuildOptimization.mjs +0 -79
- package/dist/esm/initBuildOptimization.mjs.map +0 -1
- package/dist/esm/initCompiler.mjs +0 -76
- package/dist/esm/initCompiler.mjs.map +0 -1
- package/dist/types/initBuildOptimization.d.ts +0 -19
- package/dist/types/initBuildOptimization.d.ts.map +0 -1
- package/dist/types/initCompiler.d.ts +0 -20
- package/dist/types/initCompiler.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.mjs","names":["prepareIntlayer"],"sources":["../../../src/push/push.ts"],"sourcesContent":["import * as fsPromises from 'node:fs/promises';\nimport { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { getUnmergedDictionaries } from '@intlayer/dictionaries-entry/unmerged';\nimport {\n prepareIntlayer,\n writeContentDeclaration,\n} from '@intlayer/engine/build';\nimport {\n type ListGitFilesOptions,\n listGitFiles,\n logConfigDetails,\n} from '@intlayer/engine/cli';\nimport { formatPath, parallelize } from '@intlayer/engine/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { loadPrompts } from '../loadPrompts';\nimport { PushLogger, type PushStatus } from '../pushLog';\nimport { checkCMSAuth, getAuthenticatedAPI } from '../utils/checkAccess';\nimport { selectCmsEnvironment } from '../utils/selectCmsEnvironment';\n\ntype PushOptions = {\n deleteLocaleDictionary?: boolean;\n keepLocaleDictionary?: boolean;\n dictionaries?: string[];\n gitOptions?: ListGitFilesOptions;\n configOptions?: GetConfigurationOptions;\n build?: boolean;\n};\n\ntype DictionariesStatus = {\n dictionary: Dictionary;\n status:\n | 'pending'\n | 'pushing'\n | 'modified'\n | 'pushed'\n | 'up-to-date'\n | 'unknown'\n | 'error';\n error?: Error;\n errorMessage?: string;\n};\n\n// Print per-dictionary summary similar to loadDictionaries\nconst statusIconsAndColors = {\n pushed: { icon: '✔', color: ANSIColors.GREEN },\n modified: { icon: '✔', color: ANSIColors.GREEN },\n 'up-to-date': { icon: '=', color: ANSIColors.GREY },\n error: { icon: '✖', color: ANSIColors.RED },\n default: { icon: '⏲', color: ANSIColors.BLUE },\n};\n\nconst getIconAndColor = (status: DictionariesStatus['status']) => {\n return (\n statusIconsAndColors[status as keyof typeof statusIconsAndColors] ??\n statusIconsAndColors.default\n );\n};\n\n/**\n * Get all local dictionaries and push them simultaneously.\n */\nexport const push = async (options?: PushOptions): Promise<void> => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\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 try {\n const hasCMSAuth = await checkCMSAuth(config);\n\n if (!hasCMSAuth) return;\n\n const intlayerAPI = await getAuthenticatedAPI(config);\n\n await selectCmsEnvironment(\n options?.configOptions?.env,\n intlayerAPI,\n config\n );\n\n const unmergedDictionariesRecord = getUnmergedDictionaries(config);\n const allDictionaries = Object.values(unmergedDictionariesRecord).flat();\n\n const customLocations = Array.from(\n new Set(\n allDictionaries\n .map((dictionary) => dictionary.location)\n .filter(\n (location) =>\n location && !['remote', 'local', 'hybrid'].includes(location)\n )\n )\n ) as string[];\n\n // Include all custom locations automatically — no interactive prompt needed.\n const selectedCustomLocations: string[] = customLocations;\n\n let dictionaries: Dictionary[] = allDictionaries.filter((dictionary) => {\n const location =\n dictionary.location ?? config.dictionary?.location ?? 'local';\n\n return (\n location === 'remote' ||\n location === 'hybrid' ||\n selectedCustomLocations.includes(location)\n );\n });\n\n // Check if the dictionaries list is empty after filtering by location\n if (dictionaries.length === 0) {\n appLogger(\n `No dictionaries found to push. Only dictionaries with location ${colorize('remote', ANSIColors.BLUE, ANSIColors.RESET)}, ${colorize('hybrid', ANSIColors.BLUE, ANSIColors.RESET)} or selected custom locations are pushed.`,\n { level: 'warn' }\n );\n appLogger(\n `You can set the location in your dictionary file (e.g. ${colorize(\"{ key: 'my-key', location: 'hybrid', ... }\", ANSIColors.BLUE, ANSIColors.RESET)} or globally in your intlayer.config.ts file (e.g. ${colorize(\"{ dictionary: { location: 'hybrid' } }\", ANSIColors.BLUE, ANSIColors.RESET)}).`,\n { level: 'info' }\n );\n return;\n }\n\n const existingDictionariesKeys: string[] = Object.keys(\n unmergedDictionariesRecord\n );\n\n if (options?.dictionaries) {\n // Check if the provided dictionaries exist\n const noneExistingDictionariesOption = options.dictionaries.filter(\n (dictionaryId) => !existingDictionariesKeys.includes(dictionaryId)\n );\n\n if (noneExistingDictionariesOption.length > 0) {\n appLogger(\n `The following dictionaries do not exist: ${noneExistingDictionariesOption.join(\n ', '\n )} and have been ignored.`,\n {\n level: 'error',\n }\n );\n }\n\n // Filter the dictionaries from the provided list of IDs\n dictionaries = dictionaries.filter((dictionary) =>\n options.dictionaries?.includes(dictionary.key)\n );\n }\n\n if (options?.gitOptions) {\n const gitFiles = await listGitFiles(options.gitOptions);\n\n dictionaries = dictionaries.filter((dictionary) =>\n gitFiles.includes(\n join(config.system.baseDir, dictionary.filePath ?? '')\n )\n );\n }\n\n // Check if the dictionaries list is empty\n if (dictionaries.length === 0) {\n appLogger('No local dictionaries found', {\n level: 'error',\n });\n return;\n }\n\n appLogger('Pushing dictionaries:');\n\n // Prepare dictionaries statuses\n const dictionariesStatuses: DictionariesStatus[] = dictionaries.map(\n (dictionary) => ({\n dictionary,\n status: 'pending',\n })\n );\n\n // Initialize aggregated logger similar to loadDictionaries\n const logger = new PushLogger();\n logger.update(\n dictionariesStatuses.map<PushStatus>((s) => ({\n dictionaryKey: s.dictionary.key,\n status: 'pending',\n }))\n );\n\n const successfullyPushedDictionaries: Dictionary[] = [];\n\n const processDictionary = async (\n statusObj: DictionariesStatus\n ): Promise<void> => {\n statusObj.status = 'pushing';\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'pushing' },\n ]);\n\n try {\n const pushResult = await intlayerAPI.dictionary.pushDictionaries([\n statusObj.dictionary,\n ]);\n\n const updatedDictionaries = pushResult.data?.updatedDictionaries ?? [];\n const newDictionaries = pushResult.data?.newDictionaries ?? [];\n const upToDateDictionaries =\n pushResult.data?.upToDateDictionaries ?? [];\n\n const allDictionaries = [\n ...updatedDictionaries,\n ...newDictionaries,\n ...upToDateDictionaries,\n ];\n\n for (const remoteDictionaryData of allDictionaries) {\n const localDictionary = unmergedDictionariesRecord[\n remoteDictionaryData.key\n ]?.find(\n (dictionary) => dictionary.localId === remoteDictionaryData.localId\n );\n\n if (!localDictionary) continue;\n\n await writeContentDeclaration(\n { ...localDictionary, id: remoteDictionaryData.id },\n config\n );\n }\n\n if (\n updatedDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'modified';\n successfullyPushedDictionaries.push(statusObj.dictionary);\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'modified' },\n ]);\n } else if (\n newDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'pushed';\n successfullyPushedDictionaries.push(statusObj.dictionary);\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'pushed' },\n ]);\n } else if (\n upToDateDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'up-to-date';\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'up-to-date' },\n ]);\n } else {\n statusObj.status = 'unknown';\n }\n } catch (error) {\n statusObj.status = 'error';\n statusObj.error = error as Error;\n statusObj.errorMessage = `Error pushing dictionary ${statusObj.dictionary.key}: ${error}`;\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'error' },\n ]);\n }\n };\n\n // Process dictionaries in parallel with a concurrency limit (reuse parallelize)\n await parallelize(dictionariesStatuses, processDictionary, 5);\n\n // Stop the logger and render final state\n logger.finish();\n\n for (const dictionaryStatus of dictionariesStatuses) {\n const { icon, color } = getIconAndColor(dictionaryStatus.status);\n appLogger(\n ` - ${colorizeKey(dictionaryStatus.dictionary.key)} ${ANSIColors.GREY}[${color}${icon} ${dictionaryStatus.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\n // Handle delete or keep options\n const deleteOption = options?.deleteLocaleDictionary;\n const keepOption = options?.keepLocaleDictionary;\n\n if (deleteOption && keepOption) {\n throw new Error(\n 'Cannot specify both --deleteLocaleDictionary and --keepLocaleDictionary options.'\n );\n }\n\n if (deleteOption) {\n // Delete only the successfully pushed dictionaries\n await deleteLocalDictionaries(successfullyPushedDictionaries, options);\n } else if (keepOption) {\n // Do nothing, keep the local dictionaries\n } else {\n // Ask the user\n const remoteDictionaries = successfullyPushedDictionaries.filter(\n (dictionary) => dictionary.location === 'remote'\n );\n const remoteDictionariesKeys = remoteDictionaries.map(\n (dictionary) => dictionary.key\n );\n\n if (remoteDictionaries.length > 0) {\n const { confirm, isCancel } = await loadPrompts();\n\n const shouldDelete = await confirm({\n message: `Do you want to delete the local dictionaries that were successfully pushed? ${colorize('(Dictionaries:', ANSIColors.GREY, ANSIColors.RESET)} ${colorizeKey(remoteDictionariesKeys)}${colorize(')', ANSIColors.GREY, ANSIColors.RESET)}`,\n initialValue: false,\n });\n\n if (isCancel(shouldDelete)) {\n return;\n }\n\n if (shouldDelete) {\n await deleteLocalDictionaries(remoteDictionaries, options);\n }\n }\n }\n } catch (error) {\n appLogger(error, {\n level: 'error',\n });\n }\n};\n\nconst deleteLocalDictionaries = async (\n dictionariesToDelete: Dictionary[],\n options?: PushOptions\n): Promise<void> => {\n const config = getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(config);\n\n // Use a Set to collect all unique file paths\n const filePathsSet: Set<string> = new Set();\n\n for (const dictionary of dictionariesToDelete) {\n const { filePath } = dictionary;\n\n if (!filePath) {\n appLogger(\n `Dictionary ${colorizeKey(dictionary.key)} does not have a file path`,\n {\n level: 'error',\n }\n );\n continue;\n }\n\n filePathsSet.add(filePath);\n }\n\n for (const filePath of filePathsSet) {\n try {\n const stats = await fsPromises.lstat(filePath);\n\n if (stats.isFile()) {\n await fsPromises.unlink(filePath);\n appLogger(`Deleted file ${formatPath(filePath)}`, {});\n } else if (stats.isDirectory()) {\n appLogger(`Path is a directory ${formatPath(filePath)}, skipping.`, {});\n } else {\n appLogger(\n `Unknown file type for ${formatPath(filePath)}, skipping.`,\n {}\n );\n }\n } catch (err) {\n appLogger(`Error deleting ${formatPath(filePath)}: ${err}`, {\n level: 'error',\n });\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiDA,MAAM,uBAAuB;CAC3B,QAAQ;EAAE,MAAM;EAAK,OAAO,WAAW;CAAM;CAC7C,UAAU;EAAE,MAAM;EAAK,OAAO,WAAW;CAAM;CAC/C,cAAc;EAAE,MAAM;EAAK,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AAY,WAAW,GAAG,EAAE,6BAC1C,EACE,OAAO,QACT,CACF;GACA;EACF;EAEA,aAAa,IAAI,QAAQ;CAC3B;CAEA,KAAK,MAAM,YAAY,cACrB,IAAI;EACF,MAAM,QAAQ,MAAM,WAAW,MAAM,QAAQ;EAE7C,IAAI,MAAM,OAAO,GAAG;GAClB,MAAM,WAAW,OAAO,QAAQ;GAChC,UAAU,gBAAgB,WAAW,QAAQ,KAAK,CAAC,CAAC;EACtD,OAAO,IAAI,MAAM,YAAY,GAC3B,UAAU,uBAAuB,WAAW,QAAQ,EAAE,cAAc,CAAC,CAAC;OAEtE,UACE,yBAAyB,WAAW,QAAQ,EAAE,cAC9C,CAAC,CACH;CAEJ,SAAS,KAAK;EACZ,UAAU,kBAAkB,WAAW,QAAQ,EAAE,IAAI,OAAO,EAC1D,OAAO,QACT,CAAC;CACH;AAEJ"}
|
|
1
|
+
{"version":3,"file":"push.mjs","names":[],"sources":["../../../src/push/push.ts"],"sourcesContent":["import * as fsPromises from 'node:fs/promises';\nimport { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { getUnmergedDictionaries } from '@intlayer/dictionaries-entry/unmerged';\nimport {\n prepareIntlayer,\n writeContentDeclaration,\n} from '@intlayer/engine/build';\nimport {\n type ListGitFilesOptions,\n listGitFiles,\n logConfigDetails,\n} from '@intlayer/engine/cli';\nimport { formatPath, parallelize } from '@intlayer/engine/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { loadPrompts } from '../loadPrompts';\nimport { PushLogger, type PushStatus } from '../pushLog';\nimport { checkCMSAuth, getAuthenticatedAPI } from '../utils/checkAccess';\nimport { selectCmsEnvironment } from '../utils/selectCmsEnvironment';\n\ntype PushOptions = {\n deleteLocaleDictionary?: boolean;\n keepLocaleDictionary?: boolean;\n dictionaries?: string[];\n gitOptions?: ListGitFilesOptions;\n configOptions?: GetConfigurationOptions;\n build?: boolean;\n};\n\ntype DictionariesStatus = {\n dictionary: Dictionary;\n status:\n | 'pending'\n | 'pushing'\n | 'modified'\n | 'pushed'\n | 'up-to-date'\n | 'unknown'\n | 'error';\n error?: Error;\n errorMessage?: string;\n};\n\n// Print per-dictionary summary similar to loadDictionaries\nconst statusIconsAndColors = {\n pushed: { icon: '✔', color: ANSIColors.GREEN },\n modified: { icon: '✔', color: ANSIColors.GREEN },\n 'up-to-date': { icon: '=', color: ANSIColors.GREY },\n error: { icon: '✖', color: ANSIColors.RED },\n default: { icon: '⏲', color: ANSIColors.BLUE },\n};\n\nconst getIconAndColor = (status: DictionariesStatus['status']) => {\n return (\n statusIconsAndColors[status as keyof typeof statusIconsAndColors] ??\n statusIconsAndColors.default\n );\n};\n\n/**\n * Get all local dictionaries and push them simultaneously.\n */\nexport const push = async (options?: PushOptions): Promise<void> => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\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 try {\n const hasCMSAuth = await checkCMSAuth(config);\n\n if (!hasCMSAuth) return;\n\n const intlayerAPI = await getAuthenticatedAPI(config);\n\n await selectCmsEnvironment(\n options?.configOptions?.env,\n intlayerAPI,\n config\n );\n\n const unmergedDictionariesRecord = getUnmergedDictionaries(config);\n const allDictionaries = Object.values(unmergedDictionariesRecord).flat();\n\n const customLocations = Array.from(\n new Set(\n allDictionaries\n .map((dictionary) => dictionary.location)\n .filter(\n (location) =>\n location && !['remote', 'local', 'hybrid'].includes(location)\n )\n )\n ) as string[];\n\n // Include all custom locations automatically — no interactive prompt needed.\n const selectedCustomLocations: string[] = customLocations;\n\n let dictionaries: Dictionary[] = allDictionaries.filter((dictionary) => {\n const location =\n dictionary.location ?? config.dictionary?.location ?? 'local';\n\n return (\n location === 'remote' ||\n location === 'hybrid' ||\n selectedCustomLocations.includes(location)\n );\n });\n\n // Check if the dictionaries list is empty after filtering by location\n if (dictionaries.length === 0) {\n appLogger(\n `No dictionaries found to push. Only dictionaries with location ${colorize('remote', ANSIColors.BLUE, ANSIColors.RESET)}, ${colorize('hybrid', ANSIColors.BLUE, ANSIColors.RESET)} or selected custom locations are pushed.`,\n { level: 'warn' }\n );\n appLogger(\n `You can set the location in your dictionary file (e.g. ${colorize(\"{ key: 'my-key', location: 'hybrid', ... }\", ANSIColors.BLUE, ANSIColors.RESET)} or globally in your intlayer.config.ts file (e.g. ${colorize(\"{ dictionary: { location: 'hybrid' } }\", ANSIColors.BLUE, ANSIColors.RESET)}).`,\n { level: 'info' }\n );\n return;\n }\n\n const existingDictionariesKeys: string[] = Object.keys(\n unmergedDictionariesRecord\n );\n\n if (options?.dictionaries) {\n // Check if the provided dictionaries exist\n const noneExistingDictionariesOption = options.dictionaries.filter(\n (dictionaryId) => !existingDictionariesKeys.includes(dictionaryId)\n );\n\n if (noneExistingDictionariesOption.length > 0) {\n appLogger(\n `The following dictionaries do not exist: ${noneExistingDictionariesOption.join(\n ', '\n )} and have been ignored.`,\n {\n level: 'error',\n }\n );\n }\n\n // Filter the dictionaries from the provided list of IDs\n dictionaries = dictionaries.filter((dictionary) =>\n options.dictionaries?.includes(dictionary.key)\n );\n }\n\n if (options?.gitOptions) {\n const gitFiles = await listGitFiles(options.gitOptions);\n\n dictionaries = dictionaries.filter((dictionary) =>\n gitFiles.includes(\n join(config.system.baseDir, dictionary.filePath ?? '')\n )\n );\n }\n\n // Check if the dictionaries list is empty\n if (dictionaries.length === 0) {\n appLogger('No local dictionaries found', {\n level: 'error',\n });\n return;\n }\n\n appLogger('Pushing dictionaries:');\n\n // Prepare dictionaries statuses\n const dictionariesStatuses: DictionariesStatus[] = dictionaries.map(\n (dictionary) => ({\n dictionary,\n status: 'pending',\n })\n );\n\n // Initialize aggregated logger similar to loadDictionaries\n const logger = new PushLogger();\n logger.update(\n dictionariesStatuses.map<PushStatus>((s) => ({\n dictionaryKey: s.dictionary.key,\n status: 'pending',\n }))\n );\n\n const successfullyPushedDictionaries: Dictionary[] = [];\n\n const processDictionary = async (\n statusObj: DictionariesStatus\n ): Promise<void> => {\n statusObj.status = 'pushing';\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'pushing' },\n ]);\n\n try {\n const pushResult = await intlayerAPI.dictionary.pushDictionaries([\n statusObj.dictionary,\n ]);\n\n const updatedDictionaries = pushResult.data?.updatedDictionaries ?? [];\n const newDictionaries = pushResult.data?.newDictionaries ?? [];\n const upToDateDictionaries =\n pushResult.data?.upToDateDictionaries ?? [];\n\n const allDictionaries = [\n ...updatedDictionaries,\n ...newDictionaries,\n ...upToDateDictionaries,\n ];\n\n for (const remoteDictionaryData of allDictionaries) {\n const localDictionary = unmergedDictionariesRecord[\n remoteDictionaryData.key\n ]?.find(\n (dictionary) => dictionary.localId === remoteDictionaryData.localId\n );\n\n if (!localDictionary) continue;\n\n await writeContentDeclaration(\n { ...localDictionary, id: remoteDictionaryData.id },\n config\n );\n }\n\n if (\n updatedDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'modified';\n successfullyPushedDictionaries.push(statusObj.dictionary);\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'modified' },\n ]);\n } else if (\n newDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'pushed';\n successfullyPushedDictionaries.push(statusObj.dictionary);\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'pushed' },\n ]);\n } else if (\n upToDateDictionaries.some(\n (dictionary) => dictionary.key === statusObj.dictionary.key\n )\n ) {\n statusObj.status = 'up-to-date';\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'up-to-date' },\n ]);\n } else {\n statusObj.status = 'unknown';\n }\n } catch (error) {\n statusObj.status = 'error';\n statusObj.error = error as Error;\n statusObj.errorMessage = `Error pushing dictionary ${statusObj.dictionary.key}: ${error}`;\n logger.update([\n { dictionaryKey: statusObj.dictionary.key, status: 'error' },\n ]);\n }\n };\n\n // Process dictionaries in parallel with a concurrency limit (reuse parallelize)\n await parallelize(dictionariesStatuses, processDictionary, 5);\n\n // Stop the logger and render final state\n logger.finish();\n\n for (const dictionaryStatus of dictionariesStatuses) {\n const { icon, color } = getIconAndColor(dictionaryStatus.status);\n appLogger(\n ` - ${colorizeKey(dictionaryStatus.dictionary.key)} ${ANSIColors.GREY}[${color}${icon} ${dictionaryStatus.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\n // Handle delete or keep options\n const deleteOption = options?.deleteLocaleDictionary;\n const keepOption = options?.keepLocaleDictionary;\n\n if (deleteOption && keepOption) {\n throw new Error(\n 'Cannot specify both --deleteLocaleDictionary and --keepLocaleDictionary options.'\n );\n }\n\n if (deleteOption) {\n // Delete only the successfully pushed dictionaries\n await deleteLocalDictionaries(successfullyPushedDictionaries, options);\n } else if (keepOption) {\n // Do nothing, keep the local dictionaries\n } else {\n // Ask the user\n const remoteDictionaries = successfullyPushedDictionaries.filter(\n (dictionary) => dictionary.location === 'remote'\n );\n const remoteDictionariesKeys = remoteDictionaries.map(\n (dictionary) => dictionary.key\n );\n\n if (remoteDictionaries.length > 0) {\n const { confirm, isCancel } = await loadPrompts();\n\n const shouldDelete = await confirm({\n message: `Do you want to delete the local dictionaries that were successfully pushed? ${colorize('(Dictionaries:', ANSIColors.GREY, ANSIColors.RESET)} ${colorizeKey(remoteDictionariesKeys)}${colorize(')', ANSIColors.GREY, ANSIColors.RESET)}`,\n initialValue: false,\n });\n\n if (isCancel(shouldDelete)) {\n return;\n }\n\n if (shouldDelete) {\n await deleteLocalDictionaries(remoteDictionaries, options);\n }\n }\n }\n } catch (error) {\n appLogger(error, {\n level: 'error',\n });\n }\n};\n\nconst deleteLocalDictionaries = async (\n dictionariesToDelete: Dictionary[],\n options?: PushOptions\n): Promise<void> => {\n const config = getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(config);\n\n // Use a Set to collect all unique file paths\n const filePathsSet: Set<string> = new Set();\n\n for (const dictionary of dictionariesToDelete) {\n const { filePath } = dictionary;\n\n if (!filePath) {\n appLogger(\n `Dictionary ${colorizeKey(dictionary.key)} does not have a file path`,\n {\n level: 'error',\n }\n );\n continue;\n }\n\n filePathsSet.add(filePath);\n }\n\n for (const filePath of filePathsSet) {\n try {\n const stats = await fsPromises.lstat(filePath);\n\n if (stats.isFile()) {\n await fsPromises.unlink(filePath);\n appLogger(`Deleted file ${formatPath(filePath)}`, {});\n } else if (stats.isDirectory()) {\n appLogger(`Path is a directory ${formatPath(filePath)}, skipping.`, {});\n } else {\n appLogger(\n `Unknown file type for ${formatPath(filePath)}, skipping.`,\n {}\n );\n }\n } catch (err) {\n appLogger(`Error deleting ${formatPath(filePath)}: ${err}`, {\n level: 'error',\n });\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiDA,MAAM,uBAAuB;CAC3B,QAAQ;EAAE,MAAM;EAAK,OAAO,WAAW;CAAM;CAC7C,UAAU;EAAE,MAAM;EAAK,OAAO,WAAW;CAAM;CAC/C,cAAc;EAAE,MAAM;EAAK,OAAO,WAAW;CAAK;CAClD,OAAO;EAAE,MAAM;EAAK,OAAO,WAAW;CAAI;CAC1C,SAAS;EAAE,MAAM;EAAK,OAAO,WAAW;CAAK;AAC/C;AAEA,MAAM,mBAAmB,WAAyC;CAChE,OACE,qBAAqB,WACrB,qBAAqB;AAEzB;;;;AAKA,MAAa,OAAO,OAAO,YAAyC;CAClE,MAAM,SAAS,iBAAiB,SAAS,aAAa;CACtD,iBAAiB,SAAS,aAAa;CAEvC,MAAM,YAAY,aAAa,MAAM;CAErC,IAAI,SAAS,UAAU,MACrB,MAAM,gBAAg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AC,CAAC;OAEtE,UACE,yBAAyB,WAAW,QAAQ,EAAE,cAC9C,CAAC,CACH;CAEJ,SAAS,KAAK;EACZ,UAAU,kBAAkB,WAAW,QAAQ,EAAE,IAAI,OAAO,EAC1D,OAAO,QACT,CAAC;CACH;AAEJ"}
|
package/dist/esm/pushConfig.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { checkCMSAuth, getAuthenticatedAPI } from "./utils/checkAccess.mjs";
|
|
2
2
|
import { selectCmsEnvironment } from "./utils/selectCmsEnvironment.mjs";
|
|
3
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
4
3
|
import { CYAN, GREY_DARK } from "@intlayer/config/colors";
|
|
5
4
|
import { colorize, colorizeObject, getAppLogger } from "@intlayer/config/logger";
|
|
6
5
|
import { getConfiguration } from "@intlayer/config/node";
|
|
6
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
7
7
|
|
|
8
8
|
//#region src/pushConfig.ts
|
|
9
9
|
const pushConfig = async (options) => {
|
|
@@ -6,14 +6,14 @@ import { reviewFileBlockAware } from "./reviewDocBlockAware.mjs";
|
|
|
6
6
|
import { buildFileReviewReport, logReviewFileBlocks } from "./reviewDocLog.mjs";
|
|
7
7
|
import { createReviewProgressLogger } from "./reviewDocProgress.mjs";
|
|
8
8
|
import { formatReviewSynthesis } from "./reviewDocSynthesis.mjs";
|
|
9
|
-
import { join, relative } from "node:path";
|
|
10
|
-
import { listGitFiles, listGitLines, logConfigDetails } from "@intlayer/engine/cli";
|
|
11
9
|
import { existsSync } from "node:fs";
|
|
10
|
+
import { join, relative } from "node:path";
|
|
12
11
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
13
12
|
import { colorize, colorizeNumber, getAppLogger, x } from "@intlayer/config/logger";
|
|
14
13
|
import { getConfiguration } from "@intlayer/config/node";
|
|
15
|
-
import {
|
|
14
|
+
import { listGitFiles, listGitLines, logConfigDetails } from "@intlayer/engine/cli";
|
|
16
15
|
import { formatLocale, formatPath, parallelize } from "@intlayer/engine/utils";
|
|
16
|
+
import { readFile } from "node:fs/promises";
|
|
17
17
|
import { buildReviewReport } from "@intlayer/engine/docReview";
|
|
18
18
|
import fg from "fast-glob";
|
|
19
19
|
|
|
@@ -2,14 +2,14 @@ import { readAsset } from "../_virtual/_utils_asset.mjs";
|
|
|
2
2
|
import { sanitizeChunk, validateTranslation } from "../translateDoc/validation.mjs";
|
|
3
3
|
import { chunkInference } from "../utils/chunkInference.mjs";
|
|
4
4
|
import { fixChunkStartEndChars } from "../utils/fixChunkStartEndChars.mjs";
|
|
5
|
-
import { dirname } from "node:path";
|
|
6
5
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { dirname } from "node:path";
|
|
7
7
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
8
8
|
import { colon, colorize, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
9
9
|
import { getConfiguration } from "@intlayer/config/node";
|
|
10
|
-
import { readFile } from "node:fs/promises";
|
|
11
|
-
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
12
10
|
import { retryManager } from "@intlayer/config/utils";
|
|
11
|
+
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
12
|
+
import { readFile } from "node:fs/promises";
|
|
13
13
|
import { buildAlignmentPlan, mergeReviewedSegments } from "@intlayer/engine/docReview";
|
|
14
14
|
import { getLocaleName } from "@intlayer/core/localization";
|
|
15
15
|
import { ENGLISH } from "@intlayer/types/locales";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { getAppLogger } from "@intlayer/config/logger";
|
|
3
3
|
import { getConfiguration } from "@intlayer/config/node";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
5
4
|
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
5
|
+
import { readFile } from "node:fs/promises";
|
|
6
6
|
import { buildReviewReport, formatReviewReport } from "@intlayer/engine/docReview";
|
|
7
7
|
|
|
8
8
|
//#region src/reviewDoc/reviewDocLog.ts
|
package/dist/esm/searchDoc.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
2
1
|
import { colorizeKey, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
3
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
4
4
|
import { getSearchAPI } from "@intlayer/api";
|
|
5
5
|
|
|
6
6
|
//#region src/searchDoc.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
2
1
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
2
|
import { getUnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
|
|
3
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
4
4
|
import { getMissingLocalesContentFromDictionary } from "@intlayer/core/plugins";
|
|
5
5
|
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
6
6
|
|
package/dist/esm/test/test.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { listMissingTranslations } from "./listMissingTranslations.mjs";
|
|
|
2
2
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
3
3
|
import { colon, colorize, colorizeKey, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
4
4
|
import { getConfiguration } from "@intlayer/config/node";
|
|
5
|
-
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
6
5
|
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
6
|
+
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
7
7
|
|
|
8
8
|
//#region src/test/test.ts
|
|
9
9
|
const testMissingTranslations = async (options) => {
|
|
@@ -2,12 +2,12 @@ import { setupAI } from "../utils/setupAI.mjs";
|
|
|
2
2
|
import { getOutputFilePath } from "../utils/getOutputFilePath.mjs";
|
|
3
3
|
import { checkFileModifiedRange } from "../utils/checkFileModifiedRange.mjs";
|
|
4
4
|
import { translateFile } from "./translateFile.mjs";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
import { listGitFiles, logConfigDetails } from "@intlayer/engine/cli";
|
|
7
5
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
8
7
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
9
8
|
import { colorize, colorizeNumber, getAppLogger, x } from "@intlayer/config/logger";
|
|
10
9
|
import { getConfiguration } from "@intlayer/config/node";
|
|
10
|
+
import { listGitFiles, logConfigDetails } from "@intlayer/engine/cli";
|
|
11
11
|
import { pLimit, parallelize } from "@intlayer/engine/utils";
|
|
12
12
|
import fg from "fast-glob";
|
|
13
13
|
import { performance } from "node:perf_hooks";
|
|
@@ -6,9 +6,9 @@ import { chunkText } from "../utils/calculateChunks.mjs";
|
|
|
6
6
|
import { dirname, relative } from "node:path";
|
|
7
7
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
8
8
|
import { colon, colorize, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
9
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
10
|
-
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
11
9
|
import { retryManager } from "@intlayer/config/utils";
|
|
10
|
+
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
11
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
12
12
|
import { performance } from "node:perf_hooks";
|
|
13
13
|
|
|
14
14
|
//#region src/translateDoc/translateFile.ts
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { findProjectRoot } from "./init.mjs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { upgradeIntlayerPackages } from "@intlayer/engine/cli";
|
|
4
|
+
|
|
5
|
+
//#region src/upgrade.ts
|
|
6
|
+
/**
|
|
7
|
+
* Lists the Intlayer packages of every `package.json` of the project and
|
|
8
|
+
* upgrades them to the version of the given dist-tag.
|
|
9
|
+
*/
|
|
10
|
+
const upgrade = async (projectRoot, options) => {
|
|
11
|
+
const root = findProjectRoot(projectRoot ? resolve(projectRoot) : process.cwd());
|
|
12
|
+
await upgradeIntlayerPackages(root, options);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { upgrade };
|
|
17
|
+
//# sourceMappingURL=upgrade.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.mjs","names":[],"sources":["../../src/upgrade.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport {\n type UpgradeIntlayerPackagesOptions,\n upgradeIntlayerPackages,\n} from '@intlayer/engine/cli';\nimport { findProjectRoot } from './init';\n\n/**\n * Lists the Intlayer packages of every `package.json` of the project and\n * upgrades them to the version of the given dist-tag.\n */\nexport const upgrade = async (\n projectRoot?: string,\n options?: UpgradeIntlayerPackagesOptions\n) => {\n const root = findProjectRoot(\n projectRoot ? resolve(projectRoot) : process.cwd()\n );\n\n await upgradeIntlayerPackages(root, options);\n};\n"],"mappings":";;;;;;;;;AAWA,MAAa,UAAU,OACrB,aACA,YACG;CACH,MAAM,OAAO,gBACX,cAAc,QAAQ,WAAW,IAAI,QAAQ,IAAI,CACnD;CAEA,MAAM,wBAAwB,MAAM,OAAO;AAC7C"}
|
package/dist/esm/watch.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
2
1
|
import { getAppLogger } from "@intlayer/config/logger";
|
|
3
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
4
4
|
import { claimCliContentWatcher, reportRedundantContentWatcher, runParallel } from "@intlayer/engine/utils";
|
|
5
5
|
import { watch } from "@intlayer/engine/watcher";
|
|
6
6
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { extract } from "./extract.js";
|
|
|
6
6
|
import { FillOptions, fill } from "./fill/fill.js";
|
|
7
7
|
import { findProjectRoot, init } from "./init.js";
|
|
8
8
|
import { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, InfraMode, InitInfraOptions, initInfra, parseInfraMode } from "./initInfra.js";
|
|
9
|
-
import { PLATFORM_OPTIONS, getDetectedPlatform, initSkills } from "./initSkills.js";
|
|
9
|
+
import { PLATFORM_OPTIONS, getDetectedPlatform, initSkills, promptPlatform } from "./initSkills.js";
|
|
10
10
|
import { listContentDeclaration, listContentDeclarationRows } from "./listContentDeclaration.js";
|
|
11
11
|
import { ListProjectsCommandOptions, listProjectsCommand } from "./listProjects.js";
|
|
12
12
|
import { liveSync } from "./liveSync.js";
|
|
@@ -24,4 +24,4 @@ export type * from "@intlayer/engine/cli";
|
|
|
24
24
|
export type * from "@intlayer/engine/build";
|
|
25
25
|
export type * from "@intlayer/engine/utils";
|
|
26
26
|
export type * from "@intlayer/engine/watcher";
|
|
27
|
-
export { ConfigurationOptions, FillOptions, INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, InfraMode, InitInfraOptions, ListProjectsCommandOptions, PLATFORM_OPTIONS, ReviewDocMode, ScanCommandOptions, build, bundle, dirname, extract, fill, findProjectRoot, getDetectedPlatform, init, initInfra, initSkills, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, parseInfraMode, pull, push, pushConfig, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
|
|
27
|
+
export { ConfigurationOptions, FillOptions, INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, InfraMode, InitInfraOptions, ListProjectsCommandOptions, PLATFORM_OPTIONS, ReviewDocMode, ScanCommandOptions, build, bundle, dirname, extract, fill, findProjectRoot, getDetectedPlatform, init, initInfra, initSkills, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, parseInfraMode, promptPlatform, pull, push, pushConfig, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
|
package/dist/types/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":";;qBAea,kBAAe;qBA8Rf,OAAI,sBACK,UACV,aAAW,0BACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initMCP.d.ts","names":[],"sources":["../../src/initMCP.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"initMCP.d.ts","names":[],"sources":["../../src/initMCP.ts"],"mappings":";;qBAUa,UAAO,sBACE,sBACE,aAAQ"}
|
|
@@ -6,6 +6,16 @@ export declare const PLATFORM_OPTIONS: Array<{
|
|
|
6
6
|
hint: string;
|
|
7
7
|
}>;
|
|
8
8
|
export declare const getDetectedPlatform: () => Platform | undefined;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Asks which AI platform the user is using, preselecting the detected one.
|
|
11
|
+
* Resolves to `undefined` when the prompt is cancelled.
|
|
12
|
+
*/
|
|
13
|
+
export declare const promptPlatform: () => Promise<Platform | undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* Installs the Intlayer documentation skills. The skills are picked first, then
|
|
16
|
+
* the platform (unless preselected). Resolves to the platform used, so a
|
|
17
|
+
* following step (e.g. MCP) can reuse it without asking again.
|
|
18
|
+
*/
|
|
19
|
+
export declare const initSkills: (projectRoot?: string, preselectedPlatform?: Platform) => Promise<Platform | undefined>;
|
|
10
20
|
//#endregion
|
|
11
21
|
//# sourceMappingURL=initSkills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initSkills.d.ts","names":[],"sources":["../../src/initSkills.ts"],"mappings":";;qBAuBa,kBAAkB;EAC7B,OAAO;EACP;EACA;;qBAOW,2BAA0B
|
|
1
|
+
{"version":3,"file":"initSkills.d.ts","names":[],"sources":["../../src/initSkills.ts"],"mappings":";;qBAuBa,kBAAkB;EAC7B,OAAO;EACP;EACA;;qBAOW,2BAA0B;;;;;qBAqB1B,sBAA2B,QAAQ;;;;;;qBA8BnC,aAAU,sBACD,sBACE,aACrB,QAAQ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UpgradeIntlayerPackagesOptions } from "@intlayer/engine/cli";
|
|
2
|
+
//#region src/upgrade.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Lists the Intlayer packages of every `package.json` of the project and
|
|
5
|
+
* upgrades them to the version of the given dist-tag.
|
|
6
|
+
*/
|
|
7
|
+
export declare const upgrade: (projectRoot?: string, options?: UpgradeIntlayerPackagesOptions) => Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","names":[],"sources":["../../src/upgrade.ts"],"mappings":";;;;;;qBAWa,UAAO,sBACE,UACV,mCAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/cli",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.9-canary.0",
|
|
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": [
|
|
@@ -68,20 +68,20 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@clack/prompts": "1.7.0",
|
|
71
|
-
"@intlayer/api": "9.5.
|
|
72
|
-
"@intlayer/babel": "9.5.
|
|
73
|
-
"@intlayer/config": "9.5.
|
|
74
|
-
"@intlayer/core": "9.5.
|
|
75
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
76
|
-
"@intlayer/engine": "9.5.
|
|
77
|
-
"@intlayer/types": "9.5.
|
|
71
|
+
"@intlayer/api": "9.5.8",
|
|
72
|
+
"@intlayer/babel": "9.5.8",
|
|
73
|
+
"@intlayer/config": "9.5.8",
|
|
74
|
+
"@intlayer/core": "9.5.8",
|
|
75
|
+
"@intlayer/dictionaries-entry": "9.5.8",
|
|
76
|
+
"@intlayer/engine": "9.5.8",
|
|
77
|
+
"@intlayer/types": "9.5.8",
|
|
78
78
|
"commander": "15.0.0",
|
|
79
79
|
"enquirer": "2.4.1",
|
|
80
80
|
"eventsource": "5.1.1",
|
|
81
81
|
"fast-glob": "3.3.3"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@intlayer/ai": "9.5.
|
|
84
|
+
"@intlayer/ai": "9.5.8",
|
|
85
85
|
"@types/node": "^22",
|
|
86
86
|
"@utils/ts-config": "1.0.4",
|
|
87
87
|
"@utils/ts-config-types": "1.0.4",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"vitest": "5.0.1"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@intlayer/ai": "9.5.
|
|
95
|
+
"@intlayer/ai": "9.5.8"
|
|
96
96
|
},
|
|
97
97
|
"peerDependenciesMeta": {
|
|
98
98
|
"@intlayer/ai": {
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_loadPrompts = require('./loadPrompts.cjs');
|
|
3
|
-
const require_init = require('./init.cjs');
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
6
|
-
let node_fs = require("node:fs");
|
|
7
|
-
|
|
8
|
-
//#region src/initBuildOptimization.ts
|
|
9
|
-
/** Babel config filenames Next.js picks up, ordered by preference. */
|
|
10
|
-
const BABEL_CONFIG_CANDIDATES = [
|
|
11
|
-
"babel.config.js",
|
|
12
|
-
"babel.config.cjs",
|
|
13
|
-
"babel.config.mjs",
|
|
14
|
-
"babel.config.ts"
|
|
15
|
-
];
|
|
16
|
-
/**
|
|
17
|
-
* Interactive prompt to select a build optimization plugin for Next.js and
|
|
18
|
-
* scaffold the required files. The two options are independent — pick one:
|
|
19
|
-
*
|
|
20
|
-
* - `@intlayer/babel` — runs the full compiler pipeline (extract, purge, minify,
|
|
21
|
-
* optimize) through Babel. Installs `@intlayer/babel` and creates a
|
|
22
|
-
* `babel.config.js`.
|
|
23
|
-
* - `@intlayer/swc` — lightweight SWC plugin that rewrites `useIntlayer` imports.
|
|
24
|
-
* Installs only the dependency; `withIntlayer` wires it in automatically, so
|
|
25
|
-
* no config file is required.
|
|
26
|
-
*
|
|
27
|
-
* @param projectRoot - Optional project root; defaults to the current directory.
|
|
28
|
-
*/
|
|
29
|
-
const initBuildOptimization = async (projectRoot) => {
|
|
30
|
-
const p = await require_loadPrompts.loadPrompts();
|
|
31
|
-
const root = require_init.findProjectRoot(projectRoot ? (0, node_path.resolve)(projectRoot) : process.cwd());
|
|
32
|
-
p.intro("Configuring Next.js build optimization");
|
|
33
|
-
const plugin = await p.select({
|
|
34
|
-
message: "Which build optimization plugin do you want to use?",
|
|
35
|
-
options: [{
|
|
36
|
-
value: "babel",
|
|
37
|
-
label: "@intlayer/babel",
|
|
38
|
-
hint: "Full pipeline — extract, purge, minify and optimize via Babel; creates babel.config.js"
|
|
39
|
-
}, {
|
|
40
|
-
value: "swc",
|
|
41
|
-
label: "@intlayer/swc",
|
|
42
|
-
hint: "Lightweight — SWC plugin that rewrites useIntlayer imports; wired automatically by withIntlayer"
|
|
43
|
-
}]
|
|
44
|
-
});
|
|
45
|
-
if (p.isCancel(plugin) || !plugin) {
|
|
46
|
-
p.cancel("Operation cancelled.");
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const packageManager = (0, _intlayer_engine_cli.detectPackageManager)(root);
|
|
50
|
-
const packageToInstall = plugin === "babel" ? "@intlayer/babel" : "@intlayer/swc";
|
|
51
|
-
const spinner = p.spinner();
|
|
52
|
-
spinner.start("Installing packages...");
|
|
53
|
-
try {
|
|
54
|
-
(0, _intlayer_engine_cli.installPackages)(root, [packageToInstall], packageManager, true);
|
|
55
|
-
spinner.stop(`Installed: ${packageToInstall}`);
|
|
56
|
-
} catch {
|
|
57
|
-
spinner.stop("Package installation failed");
|
|
58
|
-
p.log.warn(`Please install manually: ${packageToInstall} (dev dependency)`);
|
|
59
|
-
}
|
|
60
|
-
if (plugin === "swc") {
|
|
61
|
-
p.outro("Build optimization configuration complete");
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const existingBabelConfig = BABEL_CONFIG_CANDIDATES.find((file) => (0, node_fs.existsSync)((0, node_path.join)(root, file)));
|
|
65
|
-
if (existingBabelConfig) {
|
|
66
|
-
p.log.warn(`${existingBabelConfig} already exists — add the Intlayer plugins manually.`);
|
|
67
|
-
p.note(_intlayer_engine_cli.NEXT_INTLAYER_BABEL_CONFIG_CONTENT, "Plugins to add to your babel config");
|
|
68
|
-
} else try {
|
|
69
|
-
(0, node_fs.writeFileSync)((0, node_path.join)(root, "babel.config.js"), _intlayer_engine_cli.NEXT_INTLAYER_BABEL_CONFIG_CONTENT, { encoding: "utf-8" });
|
|
70
|
-
p.log.success("Created babel.config.js with the Intlayer compiler plugins (extract, purge, minify, optimize)");
|
|
71
|
-
} catch {
|
|
72
|
-
p.log.warn("Could not create babel.config.js — please create it manually.");
|
|
73
|
-
p.note(_intlayer_engine_cli.NEXT_INTLAYER_BABEL_CONFIG_CONTENT, "babel.config.js");
|
|
74
|
-
}
|
|
75
|
-
p.outro("Build optimization configuration complete");
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
exports.initBuildOptimization = initBuildOptimization;
|
|
80
|
-
//# sourceMappingURL=initBuildOptimization.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initBuildOptimization.cjs","names":["loadPrompts","findProjectRoot","resolve","detectPackageManager","existsSync","join","NEXT_INTLAYER_BABEL_CONFIG_CONTENT"],"sources":["../../src/initBuildOptimization.ts"],"sourcesContent":["import { existsSync, writeFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n detectPackageManager,\n installPackages,\n NEXT_INTLAYER_BABEL_CONFIG_CONTENT,\n} from '@intlayer/engine/cli';\nimport { findProjectRoot } from './init';\nimport { loadPrompts } from './loadPrompts';\n\n/** Intlayer build optimization plugin choices for Next.js. */\nexport type BuildOptimizationPlugin = 'babel' | 'swc';\n\n/** Babel config filenames Next.js picks up, ordered by preference. */\nconst BABEL_CONFIG_CANDIDATES = [\n 'babel.config.js',\n 'babel.config.cjs',\n 'babel.config.mjs',\n 'babel.config.ts',\n];\n\n/**\n * Interactive prompt to select a build optimization plugin for Next.js and\n * scaffold the required files. The two options are independent — pick one:\n *\n * - `@intlayer/babel` — runs the full compiler pipeline (extract, purge, minify,\n * optimize) through Babel. Installs `@intlayer/babel` and creates a\n * `babel.config.js`.\n * - `@intlayer/swc` — lightweight SWC plugin that rewrites `useIntlayer` imports.\n * Installs only the dependency; `withIntlayer` wires it in automatically, so\n * no config file is required.\n *\n * @param projectRoot - Optional project root; defaults to the current directory.\n */\nexport const initBuildOptimization = async (\n projectRoot?: string\n): Promise<void> => {\n const p = await loadPrompts();\n\n const root = findProjectRoot(\n projectRoot ? resolve(projectRoot) : process.cwd()\n );\n p.intro('Configuring Next.js build optimization');\n\n const plugin = (await p.select({\n message: 'Which build optimization plugin do you want to use?',\n options: [\n {\n value: 'babel',\n label: '@intlayer/babel',\n hint: 'Full pipeline — extract, purge, minify and optimize via Babel; creates babel.config.js',\n },\n {\n value: 'swc',\n label: '@intlayer/swc',\n hint: 'Lightweight — SWC plugin that rewrites useIntlayer imports; wired automatically by withIntlayer',\n },\n ],\n })) as BuildOptimizationPlugin;\n\n if (p.isCancel(plugin) || !plugin) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const packageManager = detectPackageManager(root);\n const packageToInstall =\n plugin === 'babel' ? '@intlayer/babel' : '@intlayer/swc';\n\n const spinner = p.spinner();\n spinner.start('Installing packages...');\n\n try {\n installPackages(root, [packageToInstall], packageManager, true);\n spinner.stop(`Installed: ${packageToInstall}`);\n } catch {\n spinner.stop('Package installation failed');\n p.log.warn(`Please install manually: ${packageToInstall} (dev dependency)`);\n }\n\n // SWC needs no extra setup — withIntlayer injects the plugin at build time.\n if (plugin === 'swc') {\n p.outro('Build optimization configuration complete');\n return;\n }\n\n // BABEL — scaffold babel.config.js with the full compiler pipeline.\n const existingBabelConfig = BABEL_CONFIG_CANDIDATES.find((file) =>\n existsSync(join(root, file))\n );\n\n if (existingBabelConfig) {\n p.log.warn(\n `${existingBabelConfig} already exists — add the Intlayer plugins manually.`\n );\n p.note(\n NEXT_INTLAYER_BABEL_CONFIG_CONTENT,\n 'Plugins to add to your babel config'\n );\n } else {\n try {\n writeFileSync(\n join(root, 'babel.config.js'),\n NEXT_INTLAYER_BABEL_CONFIG_CONTENT,\n { encoding: 'utf-8' }\n );\n p.log.success(\n 'Created babel.config.js with the Intlayer compiler plugins (extract, purge, minify, optimize)'\n );\n } catch {\n p.log.warn(\n 'Could not create babel.config.js — please create it manually.'\n );\n p.note(NEXT_INTLAYER_BABEL_CONFIG_CONTENT, 'babel.config.js');\n }\n }\n\n p.outro('Build optimization configuration complete');\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;AAeA,MAAa,wBAAwB,OACnC,gBACkB;CAClB,MAAM,IAAI,MAAMA,gCAAY;CAE5B,MAAM,OAAOC,6BACX,kBAAcC,mBAAQ,WAAW,IAAI,QAAQ,IAAI,CACnD;CACA,EAAE,MAAM,wCAAwC;CAEhD,MAAM,SAAU,MAAM,EAAE,OAAO;EAC7B,SAAS;EACT,SAAS,CACP;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR,GACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR,CACF;CACF,CAAC;CAED,IAAI,EAAE,SAAS,MAAM,KAAK,CAAC,QAAQ;EACjC,EAAE,OAAO,sBAAsB;EAC/B;CACF;CAEA,MAAM,qBAAiBC,2CAAqB,IAAI;CAChD,MAAM,mBACJ,WAAW,UAAU,oBAAoB;CAE3C,MAAM,UAAU,EAAE,QAAQ;CAC1B,QAAQ,MAAM,wBAAwB;CAEtC,IAAI;EACF,0CAAgB,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,IAAI;EAC9D,QAAQ,KAAK,cAAc,kBAAkB;CAC/C,QAAQ;EACN,QAAQ,KAAK,6BAA6B;EAC1C,EAAE,IAAI,KAAK,4BAA4B,iBAAiB,kBAAkB;CAC5E;CAGA,IAAI,WAAW,OAAO;EACpB,EAAE,MAAM,2CAA2C;EACnD;CACF;CAGA,MAAM,sBAAsB,wBAAwB,MAAM,aACxDC,wBAAWC,gBAAK,MAAM,IAAI,CAAC,CAC7B;CAEA,IAAI,qBAAqB;EACvB,EAAE,IAAI,KACJ,GAAG,oBAAoB,qDACzB;EACA,EAAE,KACAC,yDACA,qCACF;CACF,OACE,IAAI;EACF,+BACED,gBAAK,MAAM,iBAAiB,GAC5BC,yDACA,EAAE,UAAU,QAAQ,CACtB;EACA,EAAE,IAAI,QACJ,+FACF;CACF,QAAQ;EACN,EAAE,IAAI,KACJ,+DACF;EACA,EAAE,KAAKA,yDAAoC,iBAAiB;CAC9D;CAGF,EAAE,MAAM,2CAA2C;AACrD"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_loadPrompts = require('./loadPrompts.cjs');
|
|
3
|
-
const require_init = require('./init.cjs');
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
6
|
-
let node_fs = require("node:fs");
|
|
7
|
-
|
|
8
|
-
//#region src/initCompiler.ts
|
|
9
|
-
/**
|
|
10
|
-
* Reads the project dependencies and detects which framework the compiler
|
|
11
|
-
* should target. Next.js is checked before Vite because a Next.js project may
|
|
12
|
-
* transitively depend on Vite tooling.
|
|
13
|
-
*/
|
|
14
|
-
const detectCompilerFramework = (root) => {
|
|
15
|
-
try {
|
|
16
|
-
const packageJsonPath = (0, node_path.join)(root, "package.json");
|
|
17
|
-
if (!(0, node_fs.existsSync)(packageJsonPath)) return "unknown";
|
|
18
|
-
const { dependencies = {}, devDependencies = {} } = JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf-8"));
|
|
19
|
-
const allDependencies = {
|
|
20
|
-
...dependencies,
|
|
21
|
-
...devDependencies
|
|
22
|
-
};
|
|
23
|
-
if (allDependencies.next) return "nextjs";
|
|
24
|
-
if (allDependencies.vite) return "vite";
|
|
25
|
-
return "unknown";
|
|
26
|
-
} catch {
|
|
27
|
-
return "unknown";
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Scaffolds the Intlayer compiler for the current project during interactive
|
|
32
|
-
* init.
|
|
33
|
-
*
|
|
34
|
-
* - **Vite** — nothing to do: since v9 the compiler is built into the
|
|
35
|
-
* `intlayer()` plugin in `vite.config.ts`, so this only confirms the setup
|
|
36
|
-
* to the user.
|
|
37
|
-
* - **Next.js** — installs `@intlayer/babel`, which is all that is needed:
|
|
38
|
-
* `withIntlayer` registers `next-intlayer/extractor-loader` on both webpack
|
|
39
|
-
* and Turbopack as soon as the package resolves. No `babel.config.js` is
|
|
40
|
-
* written — Turbopack never reads one, and on webpack its mere presence
|
|
41
|
-
* switches Next.js off SWC, taking the `@intlayer/swc` optimize pass with it.
|
|
42
|
-
*
|
|
43
|
-
* In non-interactive init this function is never called, so the compiler setup
|
|
44
|
-
* is left untouched.
|
|
45
|
-
*/
|
|
46
|
-
const initCompiler = async (projectRoot) => {
|
|
47
|
-
const p = await require_loadPrompts.loadPrompts();
|
|
48
|
-
const root = require_init.findProjectRoot(projectRoot ? (0, node_path.resolve)(projectRoot) : process.cwd());
|
|
49
|
-
const framework = detectCompilerFramework(root);
|
|
50
|
-
if (framework === "vite") {
|
|
51
|
-
p.log.info("Vite detected — the compiler is built into `intlayer()` in your vite.config. Nothing to configure.");
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (framework !== "nextjs") {
|
|
55
|
-
p.log.warn("No supported framework detected for the compiler — skipping. See the compiler docs for manual setup.");
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
p.intro("Configuring the Intlayer compiler for Next.js");
|
|
59
|
-
const packageManager = (0, _intlayer_engine_cli.detectPackageManager)(root);
|
|
60
|
-
const devPackagesToInstall = ["@intlayer/babel"];
|
|
61
|
-
const spinner = p.spinner();
|
|
62
|
-
spinner.start("Installing packages...");
|
|
63
|
-
try {
|
|
64
|
-
(0, _intlayer_engine_cli.installPackages)(root, devPackagesToInstall, packageManager, true);
|
|
65
|
-
spinner.stop(`Installed: ${devPackagesToInstall.join(", ")}`);
|
|
66
|
-
} catch {
|
|
67
|
-
spinner.stop("Package installation failed");
|
|
68
|
-
p.log.warn(`Please install manually: ${devPackagesToInstall.join(" ")} (dev dependency)`);
|
|
69
|
-
}
|
|
70
|
-
p.log.success("The compiler runs through `withIntlayer` in your next.config — nothing else to wire up.");
|
|
71
|
-
p.log.info("Set `compiler.enabled` in intlayer.config.ts to turn the extraction on.");
|
|
72
|
-
p.outro("Compiler configuration complete");
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
//#endregion
|
|
76
|
-
exports.initCompiler = initCompiler;
|
|
77
|
-
//# sourceMappingURL=initCompiler.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initCompiler.cjs","names":["join","existsSync","readFileSync","loadPrompts","findProjectRoot","resolve","detectPackageManager"],"sources":["../../src/initCompiler.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { detectPackageManager, installPackages } from '@intlayer/engine/cli';\nimport { findProjectRoot } from './init';\nimport { loadPrompts } from './loadPrompts';\n\n/** Framework the Intlayer compiler can be wired into during init. */\ntype CompilerFramework = 'vite' | 'nextjs' | 'unknown';\n\n/**\n * Reads the project dependencies and detects which framework the compiler\n * should target. Next.js is checked before Vite because a Next.js project may\n * transitively depend on Vite tooling.\n */\nconst detectCompilerFramework = (root: string): CompilerFramework => {\n try {\n const packageJsonPath = join(root, 'package.json');\n if (!existsSync(packageJsonPath)) return 'unknown';\n\n const { dependencies = {}, devDependencies = {} } = JSON.parse(\n readFileSync(packageJsonPath, 'utf-8')\n );\n const allDependencies = { ...dependencies, ...devDependencies };\n\n if (allDependencies.next) return 'nextjs';\n if (allDependencies.vite) return 'vite';\n\n return 'unknown';\n } catch {\n return 'unknown';\n }\n};\n\n/**\n * Scaffolds the Intlayer compiler for the current project during interactive\n * init.\n *\n * - **Vite** — nothing to do: since v9 the compiler is built into the\n * `intlayer()` plugin in `vite.config.ts`, so this only confirms the setup\n * to the user.\n * - **Next.js** — installs `@intlayer/babel`, which is all that is needed:\n * `withIntlayer` registers `next-intlayer/extractor-loader` on both webpack\n * and Turbopack as soon as the package resolves. No `babel.config.js` is\n * written — Turbopack never reads one, and on webpack its mere presence\n * switches Next.js off SWC, taking the `@intlayer/swc` optimize pass with it.\n *\n * In non-interactive init this function is never called, so the compiler setup\n * is left untouched.\n */\nexport const initCompiler = async (projectRoot?: string): Promise<void> => {\n const p = await loadPrompts();\n\n const root = findProjectRoot(\n projectRoot ? resolve(projectRoot) : process.cwd()\n );\n\n const framework = detectCompilerFramework(root);\n\n if (framework === 'vite') {\n // Since v9 the compiler is bundled inside intlayer() — nothing to scaffold.\n p.log.info(\n 'Vite detected — the compiler is built into `intlayer()` in your vite.config. Nothing to configure.'\n );\n return;\n }\n\n if (framework !== 'nextjs') {\n p.log.warn(\n 'No supported framework detected for the compiler — skipping. See the compiler docs for manual setup.'\n );\n return;\n }\n\n p.intro('Configuring the Intlayer compiler for Next.js');\n\n const packageManager = detectPackageManager(root);\n const devPackagesToInstall = ['@intlayer/babel'];\n\n const spinner = p.spinner();\n spinner.start('Installing packages...');\n\n try {\n installPackages(root, devPackagesToInstall, packageManager, true);\n spinner.stop(`Installed: ${devPackagesToInstall.join(', ')}`);\n } catch {\n spinner.stop('Package installation failed');\n p.log.warn(\n `Please install manually: ${devPackagesToInstall.join(' ')} (dev dependency)`\n );\n }\n\n p.log.success(\n 'The compiler runs through `withIntlayer` in your next.config — nothing else to wire up.'\n );\n p.log.info(\n 'Set `compiler.enabled` in intlayer.config.ts to turn the extraction on.'\n );\n\n p.outro('Compiler configuration complete');\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,2BAA2B,SAAoC;CACnE,IAAI;EACF,MAAM,sBAAkBA,gBAAK,MAAM,cAAc;EACjD,IAAI,KAACC,oBAAW,eAAe,GAAG,OAAO;EAEzC,MAAM,EAAE,eAAe,CAAC,GAAG,kBAAkB,CAAC,MAAM,KAAK,UACvDC,sBAAa,iBAAiB,OAAO,CACvC;EACA,MAAM,kBAAkB;GAAE,GAAG;GAAc,GAAG;EAAgB;EAE9D,IAAI,gBAAgB,MAAM,OAAO;EACjC,IAAI,gBAAgB,MAAM,OAAO;EAEjC,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;AAkBA,MAAa,eAAe,OAAO,gBAAwC;CACzE,MAAM,IAAI,MAAMC,gCAAY;CAE5B,MAAM,OAAOC,6BACX,kBAAcC,mBAAQ,WAAW,IAAI,QAAQ,IAAI,CACnD;CAEA,MAAM,YAAY,wBAAwB,IAAI;CAE9C,IAAI,cAAc,QAAQ;EAExB,EAAE,IAAI,KACJ,oGACF;EACA;CACF;CAEA,IAAI,cAAc,UAAU;EAC1B,EAAE,IAAI,KACJ,sGACF;EACA;CACF;CAEA,EAAE,MAAM,+CAA+C;CAEvD,MAAM,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