UNPKG

@intlayer/chokidar

Version:

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

60 lines 2.93 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var prepareIntlayer_exports = {}; __export(prepareIntlayer_exports, { prepareIntlayer: () => prepareIntlayer }); module.exports = __toCommonJS(prepareIntlayer_exports); var import_config = require("@intlayer/config"); var import_cleanOutputDir = require('./cleanOutputDir.cjs'); var import_loadDictionaries = require('./loadDictionaries/loadDictionaries.cjs'); var import_declaration_file_to_dictionary = require('./transpiler/declaration_file_to_dictionary/index.cjs'); var import_createDictionaryEntryPoint = require('./transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs'); var import_dictionary_to_type = require('./transpiler/dictionary_to_type/index.cjs'); var import_writeConfiguration = require('./writeConfiguration/index.cjs'); var import_listDictionariesPath = require('./listDictionariesPath.cjs'); const prepareIntlayer = async (configuration = (0, import_config.getConfiguration)(), projectRequire = import_config.ESMxCJSRequire) => { (0, import_cleanOutputDir.cleanOutputDir)(configuration); (0, import_config.appLogger)("Output directory cleaned", { isVerbose: true }); const files = (0, import_listDictionariesPath.listDictionaries)(configuration); const dictionaries = await (0, import_loadDictionaries.loadDictionaries)( files, configuration, projectRequire ); const dictionariesPaths = await (0, import_declaration_file_to_dictionary.buildDictionary)(dictionaries, configuration); (0, import_dictionary_to_type.createTypes)(dictionariesPaths, configuration); (0, import_createDictionaryEntryPoint.createDictionaryEntryPoint)(configuration); (0, import_config.appLogger)("Dictionaries built"); (0, import_dictionary_to_type.createModuleAugmentation)(configuration); (0, import_config.appLogger)("Module augmentation built", { isVerbose: true }); (0, import_writeConfiguration.writeConfiguration)(configuration); (0, import_config.appLogger)("Configuration written", { isVerbose: true }); }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { prepareIntlayer }); //# sourceMappingURL=prepareIntlayer.cjs.map