{"version":3,"file":"generateConfigurationContent.cjs","names":[],"sources":["../../../src/writeConfiguration/generateConfigurationContent.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const generateConfigurationContent = (\n  configuration: IntlayerConfig,\n  format: 'cjs' | 'esm'\n): string => {\n  const {\n    internationalization,\n    routing,\n    editor,\n    log,\n    system,\n    content,\n    ai,\n    dictionary,\n    build,\n    compiler,\n  } = configuration;\n\n  let fileContent = '';\n\n  fileContent += `const internationalization = ${JSON.stringify(internationalization, null, 2)};\\n`;\n  fileContent += `const routing = ${JSON.stringify(routing, null, 2)};\\n`;\n  fileContent += `const editor = ${JSON.stringify(editor, null, 2)};\\n`;\n  fileContent += `const log = ${JSON.stringify(log, null, 2)};\\n`;\n  fileContent += `const system = ${JSON.stringify(system, null, 2)};\\n`;\n  fileContent += `const content = ${JSON.stringify(content, null, 2)};\\n`;\n  fileContent += `const ai = ${JSON.stringify(ai, null, 2)};\\n`;\n  fileContent += `const dictionary = ${JSON.stringify(dictionary, null, 2)};\\n`;\n  fileContent += `const build = ${JSON.stringify(build, null, 2)};\\n`;\n  fileContent += `const compiler = ${JSON.stringify(compiler, null, 2)};\\n`;\n\n  if (format === 'esm') {\n    fileContent += `\\nexport { internationalization, routing, editor, log, system, content, ai, dictionary, build, compiler };\\n`;\n  } else {\n    fileContent += `\\nmodule.exports.internationalization = internationalization;\\n`;\n    fileContent += `module.exports.routing = routing;\\n`;\n    fileContent += `module.exports.editor = editor;\\n`;\n    fileContent += `module.exports.log = log;\\n`;\n    fileContent += `module.exports.system = system;\\n`;\n    fileContent += `module.exports.content = content;\\n`;\n    fileContent += `module.exports.ai = ai;\\n`;\n    fileContent += `module.exports.dictionary = dictionary;\\n`;\n    fileContent += `module.exports.build = build;\\n`;\n    fileContent += `module.exports.compiler = compiler;\\n`;\n  }\n\n  return fileContent;\n};\n"],"mappings":";;;AAEA,MAAa,gCACX,eACA,WACW;CACX,MAAM,EACJ,sBACA,SACA,QACA,KACA,QACA,SACA,IACA,YACA,OACA,aACE;CAEJ,IAAI,cAAc;AAElB,gBAAe,gCAAgC,KAAK,UAAU,sBAAsB,MAAM,EAAE,CAAC;AAC7F,gBAAe,mBAAmB,KAAK,UAAU,SAAS,MAAM,EAAE,CAAC;AACnE,gBAAe,kBAAkB,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC;AACjE,gBAAe,eAAe,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;AAC3D,gBAAe,kBAAkB,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC;AACjE,gBAAe,mBAAmB,KAAK,UAAU,SAAS,MAAM,EAAE,CAAC;AACnE,gBAAe,cAAc,KAAK,UAAU,IAAI,MAAM,EAAE,CAAC;AACzD,gBAAe,sBAAsB,KAAK,UAAU,YAAY,MAAM,EAAE,CAAC;AACzE,gBAAe,iBAAiB,KAAK,UAAU,OAAO,MAAM,EAAE,CAAC;AAC/D,gBAAe,oBAAoB,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;AAErE,KAAI,WAAW,MACb,gBAAe;MACV;AACL,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,iBAAe;;AAGjB,QAAO"}