UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

25 lines (23 loc) 1.64 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('./_virtual/_rolldown/runtime.cjs'); const require_cleanRemovedContentDeclaration = require('./cleanRemovedContentDeclaration.cjs'); const require_utils_formatter = require('./utils/formatter.cjs'); const require_loadDictionaries_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs'); const require_handleContentDeclarationFileChange = require('./handleContentDeclarationFileChange.cjs'); let _intlayer_config_logger = require("@intlayer/config/logger"); //#region src/handleContentDeclarationFileMoved.ts const handleContentDeclarationFileMoved = async (oldFilePath, newFilePath, config) => { const appLogger = (0, _intlayer_config_logger.getAppLogger)(config); appLogger(`File moved from ${require_utils_formatter.formatPath(oldFilePath)} to ${require_utils_formatter.formatPath(newFilePath)}`, { isVerbose: true }); let keysToKeep = []; try { keysToKeep = (await require_loadDictionaries_loadLocalDictionaries.loadLocalDictionaries(newFilePath, config)).map((d) => d.key); } catch { appLogger(`Error parsing new file during move operation: ${require_utils_formatter.formatPath(newFilePath)}`, { isVerbose: true }); } await require_cleanRemovedContentDeclaration.cleanRemovedContentDeclaration(oldFilePath, keysToKeep, config); await require_handleContentDeclarationFileChange.handleContentDeclarationFileChange(newFilePath, config); }; //#endregion exports.handleContentDeclarationFileMoved = handleContentDeclarationFileMoved; //# sourceMappingURL=handleContentDeclarationFileMoved.cjs.map