@intlayer/config 8.4.0 → 8.4.2
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/_rolldown/runtime.cjs → chunk-D-qHiVGv.cjs} +1 -1
- package/dist/cjs/client.cjs +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/defaultValues/build.cjs +1 -1
- package/dist/cjs/defaultValues/build.cjs.map +1 -1
- package/dist/cjs/defaultValues/compiler.cjs +1 -1
- package/dist/cjs/defaultValues/content.cjs +1 -1
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/defaultValues/dictionary.cjs +1 -1
- package/dist/cjs/defaultValues/dictionary.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +1 -1
- package/dist/cjs/defaultValues/editor.cjs.map +1 -1
- package/dist/cjs/defaultValues/index.cjs +1 -1
- package/dist/cjs/defaultValues/internationalization.cjs +1 -1
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/log.cjs +1 -1
- package/dist/cjs/defaultValues/log.cjs.map +1 -1
- package/dist/cjs/defaultValues/routing.cjs +1 -1
- package/dist/cjs/defaultValues/routing.cjs.map +1 -1
- package/dist/cjs/defaultValues/system.cjs +1 -1
- package/dist/cjs/defaultValues/system.cjs.map +1 -1
- package/dist/cjs/loadEnvFile.cjs +1 -1
- package/dist/cjs/loadEnvFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/parseFileContent.cjs +1 -1
- package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +1 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
- package/dist/cjs/node.cjs +1 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs +1 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
- package/dist/cjs/utils/alias.cjs +1 -1
- package/dist/cjs/utils/alias.cjs.map +1 -1
- package/dist/cjs/utils/cacheDisk.cjs +1 -1
- package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
- package/dist/cjs/utils/cacheMemory.cjs +1 -1
- package/dist/cjs/utils/cacheMemory.cjs.map +1 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs +1 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
- package/dist/esm/{_virtual/_rolldown/runtime.mjs → chunk-DXQkyQJp.mjs} +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/configurationSchema.mjs +1 -1
- package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +1 -1
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/build.mjs +1 -1
- package/dist/esm/defaultValues/build.mjs.map +1 -1
- package/dist/esm/defaultValues/compiler.mjs +1 -1
- package/dist/esm/defaultValues/compiler.mjs.map +1 -1
- package/dist/esm/defaultValues/content.mjs +1 -1
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/defaultValues/dictionary.mjs +1 -1
- package/dist/esm/defaultValues/dictionary.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.mjs +1 -1
- package/dist/esm/defaultValues/editor.mjs.map +1 -1
- package/dist/esm/defaultValues/index.mjs +1 -1
- package/dist/esm/defaultValues/internationalization.mjs +1 -1
- package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
- package/dist/esm/defaultValues/log.mjs +1 -1
- package/dist/esm/defaultValues/log.mjs.map +1 -1
- package/dist/esm/defaultValues/routing.mjs +1 -1
- package/dist/esm/defaultValues/routing.mjs.map +1 -1
- package/dist/esm/defaultValues/system.mjs +1 -1
- package/dist/esm/defaultValues/system.mjs.map +1 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs +1 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +1 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
- package/dist/esm/node.mjs +1 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs +1 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
- package/dist/types/build-BGWWxAP2.d.ts +12 -0
- package/dist/types/build-BGWWxAP2.d.ts.map +1 -0
- package/dist/types/camelCaseToKebabCase-91HKVxf2.d.ts +9 -0
- package/dist/types/camelCaseToKebabCase-91HKVxf2.d.ts.map +1 -0
- package/dist/types/camelCaseToSentence-LKuKkD3M.d.ts +9 -0
- package/dist/types/camelCaseToSentence-LKuKkD3M.d.ts.map +1 -0
- package/dist/types/client.d.ts +5 -5
- package/dist/types/compiler-BKn6YjPf.d.ts +10 -0
- package/dist/types/compiler-BKn6YjPf.d.ts.map +1 -0
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/configurationSchema.d.ts +2 -8
- package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +3 -1
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
- package/dist/types/content-CEqOvNcs.d.ts +13 -0
- package/dist/types/content-CEqOvNcs.d.ts.map +1 -0
- package/dist/types/defaultValues/build.d.ts +2 -12
- package/dist/types/defaultValues/compiler.d.ts +2 -10
- package/dist/types/defaultValues/content.d.ts +2 -13
- package/dist/types/defaultValues/dictionary.d.ts +2 -13
- package/dist/types/defaultValues/editor.d.ts +2 -15
- package/dist/types/defaultValues/index.d.ts +10 -10
- package/dist/types/defaultValues/internationalization.d.ts +2 -14
- package/dist/types/defaultValues/log.d.ts +2 -8
- package/dist/types/defaultValues/routing.d.ts +2 -16
- package/dist/types/defaultValues/system.d.ts +2 -18
- package/dist/types/dictionary-n4jBpRU_.d.ts +13 -0
- package/dist/types/dictionary-n4jBpRU_.d.ts.map +1 -0
- package/dist/types/editor-Bhh3J_sb.d.ts +15 -0
- package/dist/types/editor-Bhh3J_sb.d.ts.map +1 -0
- package/dist/types/internationalization-0cqNGQ-O.d.ts +14 -0
- package/dist/types/internationalization-0cqNGQ-O.d.ts.map +1 -0
- package/dist/types/kebabCaseToCamelCase-BR4yfbUC.d.ts +5 -0
- package/dist/types/kebabCaseToCamelCase-BR4yfbUC.d.ts.map +1 -0
- package/dist/types/loadEnvFile-Dk80Swa9.d.ts +10 -0
- package/dist/types/loadEnvFile-Dk80Swa9.d.ts.map +1 -0
- package/dist/types/loadEnvFile.d.ts +2 -10
- package/dist/types/loadExternalFile/index.d.ts +4 -4
- package/dist/types/loadExternalFile/loadExternalFile.d.ts +2 -25
- package/dist/types/loadExternalFile/parseFileContent.d.ts +2 -29
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +2 -8
- package/dist/types/loadExternalFile-CJIPA_rP.d.ts +25 -0
- package/dist/types/loadExternalFile-CJIPA_rP.d.ts.map +1 -0
- package/dist/types/log-C5gSYuVB.d.ts +8 -0
- package/dist/types/log-C5gSYuVB.d.ts.map +1 -0
- package/dist/types/node.d.ts +1 -1
- package/dist/types/parseFileContent-CriV5Luv.d.ts +29 -0
- package/dist/types/parseFileContent-CriV5Luv.d.ts.map +1 -0
- package/dist/types/routing-DlVdUHPZ.d.ts +16 -0
- package/dist/types/routing-DlVdUHPZ.d.ts.map +1 -0
- package/dist/types/system-BFYob741.d.ts +18 -0
- package/dist/types/system-BFYob741.d.ts.map +1 -0
- package/dist/types/toLowerCamelCase-CfYCuChC.d.ts +10 -0
- package/dist/types/toLowerCamelCase-CfYCuChC.d.ts.map +1 -0
- package/dist/types/transpileTSToCJS-DxeK5fRY.d.ts +19 -0
- package/dist/types/transpileTSToCJS-DxeK5fRY.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -4
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts +2 -9
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts +2 -9
- package/dist/types/utils/stringFormatter/index.d.ts +4 -4
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts +2 -5
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts +2 -10
- package/package.json +2 -2
- package/dist/types/defaultValues/build.d.ts.map +0 -1
- package/dist/types/defaultValues/compiler.d.ts.map +0 -1
- package/dist/types/defaultValues/content.d.ts.map +0 -1
- package/dist/types/defaultValues/dictionary.d.ts.map +0 -1
- package/dist/types/defaultValues/editor.d.ts.map +0 -1
- package/dist/types/defaultValues/internationalization.d.ts.map +0 -1
- package/dist/types/defaultValues/log.d.ts.map +0 -1
- package/dist/types/defaultValues/routing.d.ts.map +0 -1
- package/dist/types/defaultValues/system.d.ts.map +0 -1
- package/dist/types/loadEnvFile.d.ts.map +0 -1
- package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +0 -1
- package/dist/types/loadExternalFile/parseFileContent.d.ts.map +0 -1
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +0 -1
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +0 -1
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +0 -1
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +0 -1
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
package/dist/cjs/client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utils/normalizePath.cjs`),t=require(`./utils/extractErrorMessage.cjs`),n=require(`./utils/logStack.cjs`),r=require(`./utils/stringFormatter/camelCaseToKebabCase.cjs`),i=require(`./utils/stringFormatter/camelCaseToSentence.cjs`),a=require(`./utils/stringFormatter/kebabCaseToCamelCase.cjs`),o=require(`./utils/stringFormatter/toLowerCamelCase.cjs`),s=require(`./defaultValues/index.cjs`);Object.defineProperty(exports,`DefaultValues`,{enumerable:!0,get:function(){return s.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utils/normalizePath.cjs`),t=require(`./utils/extractErrorMessage.cjs`),n=require(`./utils/logStack.cjs`),r=require(`./utils/stringFormatter/camelCaseToKebabCase.cjs`),i=require(`./utils/stringFormatter/camelCaseToSentence.cjs`),a=require(`./utils/stringFormatter/kebabCaseToCamelCase.cjs`),o=require(`./utils/stringFormatter/toLowerCamelCase.cjs`),s=require(`./defaultValues/index.cjs`);Object.defineProperty(exports,`DefaultValues`,{enumerable:!0,get:function(){return s.t}}),exports.camelCaseToKebabCase=r.camelCaseToKebabCase,exports.camelCaseToSentence=i.camelCaseToSentence,exports.extractErrorMessage=t.extractErrorMessage,exports.kebabCaseToCamelCase=a.kebabCaseToCamelCase,exports.logStack=n.logStack,exports.normalizePath=e.normalizePath,exports.toLowerCamelCase=o.toLowerCamelCase;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-D-qHiVGv.cjs`),t=require(`../defaultValues/build.cjs`);require(`../defaultValues/compiler.cjs`);const n=require(`../defaultValues/content.cjs`);require(`../defaultValues/dictionary.cjs`),require(`../defaultValues/editor.cjs`);const r=require(`../defaultValues/internationalization.cjs`),i=require(`../defaultValues/log.cjs`),a=require(`../defaultValues/routing.cjs`);require(`../defaultValues/system.cjs`);const o=require(`../utils/ESMxCJSHelpers.cjs`);let s=require(`node:fs`),c=require(`node:path`),l=require(`@intlayer/types/package.json`);l=e.n(l);let u;const d=e=>({locales:e?.locales??r.LOCALES,requiredLocales:e?.requiredLocales??e?.locales??r.REQUIRED_LOCALES,strictMode:e?.strictMode??`inclusive`,defaultLocale:e?.defaultLocale??r.DEFAULT_LOCALE}),f=e=>({mode:e?.mode??`prefix-no-default`,storage:e?.storage??a.STORAGE,basePath:e?.basePath??``,rewrite:e?.rewrite}),p=(e,t)=>{let n=e??process.cwd(),r=e=>{let t;try{t=o.getProjectRequire(n).resolve(e,{paths:[n]})}catch{t=(0,c.isAbsolute)(e)?e:(0,c.join)(n,e)}try{if((0,s.statSync)(t).isFile())return(0,c.dirname)(t)}catch{if(/\.[a-z0-9]+$/i.test(t))return(0,c.dirname)(t)}return t},i=r(t?.dictionariesDir??`.intlayer/dictionary`);return{baseDir:n,moduleAugmentationDir:r(t?.moduleAugmentationDir??`.intlayer/types`),unmergedDictionariesDir:r(t?.unmergedDictionariesDir??`.intlayer/unmerged_dictionary`),remoteDictionariesDir:r(t?.remoteDictionariesDir??`.intlayer/remote_dictionary`),dictionariesDir:i,dynamicDictionariesDir:r(t?.dynamicDictionariesDir??`.intlayer/dynamic_dictionary`),fetchDictionariesDir:r(t?.fetchDictionariesDir??`.intlayer/fetch_dictionary`),typesDir:r(t?.typesDir??`.intlayer/types`),mainDir:r(t?.mainDir??`.intlayer/main`),configDir:r(t?.configDir??`.intlayer/config`),cacheDir:r(t?.cacheDir??`.intlayer/cache`),tempDir:r(t?.tempDir??`.intlayer/tmp`)}},m=(e,t)=>{let r=t?.fileExtensions??n.FILE_EXTENSIONS,i=t=>{let n;try{n=o.getProjectRequire(e.baseDir).resolve(t,{paths:[e.baseDir]})}catch{try{n=require.resolve(t,{paths:[e.baseDir]})}catch{n=(0,c.isAbsolute)(t)?t:(0,c.join)(e.baseDir,t)}}try{if((0,s.statSync)(n).isFile())return(0,c.dirname)(n)}catch{if(/\.[a-z0-9]+$/i.test(n))return(0,c.dirname)(n)}return n};return{fileExtensions:r,contentDir:(t?.contentDir??n.CONTENT_DIR).map(i),codeDir:(t?.codeDir??n.CODE_DIR).map(i),excludedPath:t?.excludedPath??n.EXCLUDED_PATHS,watch:t?.watch??!0,formatCommand:t?.formatCommand}},h=e=>({applicationURL:e?.applicationURL||void 0,editorURL:e?.editorURL||`http://localhost:8000`,cmsURL:e?.cmsURL||`https://app.intlayer.org`,backendURL:e?.backendURL||`https://back.intlayer.org`,port:e?.port??8e3,enabled:e?.enabled??!1,clientId:e?.clientId??void 0,clientSecret:e?.clientSecret??void 0,dictionaryPriorityStrategy:e?.dictionaryPriorityStrategy??`local_first`,liveSync:e?.liveSync??!0,liveSyncPort:e?.liveSyncPort??4e3,liveSyncURL:e?.liveSyncURL??`http://localhost:${e?.liveSyncPort??4e3}`}),g=(e,t)=>({mode:e?.mode??`default`,prefix:e?.prefix??i.PREFIX,error:t?.error,log:t?.log,info:t?.info,warn:t?.warn}),_=e=>({provider:e?.provider,apiKey:e?.apiKey,model:e?.model,temperature:e?.temperature,applicationContext:e?.applicationContext,baseURL:e?.baseURL,dataSerialization:e?.dataSerialization}),v=e=>({mode:e?.mode??`auto`,optimize:e?.optimize,importMode:e?.importMode,traversePattern:e?.traversePattern??t.TRAVERSE_PATTERN,outputFormat:e?.outputFormat??t.OUTPUT_FORMAT,cache:e?.cache??!0,require:e?.require,checkTypes:e?.checkTypes??!1}),y=e=>({enabled:e?.enabled??!0,dictionaryKeyPrefix:e?.dictionaryKeyPrefix??``,transformPattern:e?.transformPattern,excludePattern:e?.excludePattern,output:e?.output,noMetadata:e?.noMetadata??!1,saveComponents:e?.saveComponents??!1}),b=e=>{let t=e?.contentAutoTransformation??!1;return{fill:e?.fill??!0,contentAutoTransformation:typeof t==`object`?{markdown:t.markdown??!1,html:t.html??!1,insertion:t.insertion??!1}:t,location:e?.location??`local`,locale:e?.locale,title:e?.title,description:e?.description,tags:e?.tags,priority:e?.priority,importMode:e?.importMode??`static`}},x=(e,t,n)=>{let r=d(e?.internationalization),i=f(e?.routing),a=p(t,e?.system);return u={internationalization:r,routing:i,content:m(a,e?.content),system:a,editor:h(e?.editor),log:g(e?.log,n),ai:_(e?.ai),build:v(e?.build),compiler:y(e?.compiler),dictionary:b(e?.dictionary),plugins:e?.plugins,schemas:e?.schemas,metadata:{name:`Intlayer`,version:l.default.version,doc:`https://intlayer.org/docs`}},u};exports.buildConfigurationFields=x;
|
|
2
2
|
//# sourceMappingURL=buildConfigurationFields.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.cjs","names":["LOCALES","REQUIRED_LOCALES","DEFAULT_LOCALE","STORAGE","getProjectRequire","normalizePath","FILE_EXTENSIONS","CONTENT_DIR","CODE_DIR","EXCLUDED_PATHS","PREFIX","TRAVERSE_PATTERN","OUTPUT_FORMAT","packageJson"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { statSync } from 'node:fs';\nimport { dirname, isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BuildConfig,\n CompilerConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n RoutingConfig,\n SystemConfig,\n} from '@intlayer/types/config';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n BUILD_MODE,\n CACHE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n TYPE_CHECKING,\n} from '../defaultValues/build';\nimport {\n COMPILER_DICTIONARY_KEY_PREFIX,\n COMPILER_ENABLED,\n COMPILER_NO_METADATA,\n COMPILER_SAVE_COMPONENTS,\n} from '../defaultValues/compiler';\nimport {\n CODE_DIR,\n CONTENT_DIR,\n EXCLUDED_PATHS,\n FILE_EXTENSIONS,\n WATCH,\n} from '../defaultValues/content';\nimport {\n CONTENT_AUTO_TRANSFORMATION,\n FILL,\n IMPORT_MODE,\n LOCATION,\n} from '../defaultValues/dictionary';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n IS_ENABLED,\n LIVE_SYNC,\n LIVE_SYNC_PORT,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport {\n CACHE_DIR,\n CONFIG_DIR,\n DICTIONARIES_DIR,\n DYNAMIC_DICTIONARIES_DIR,\n FETCH_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REMOTE_DICTIONARIES_DIR,\n TEMP_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n} from '../defaultValues/system';\nimport { getProjectRequire } from '../utils';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_LOCALES,\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - If set to \"strict\", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.\n * - If set to \"inclusive\", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"inclusive\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Custom URL rewriting rules that override the default routing mode for specific paths.\n * Allows you to define locale-specific paths that differ from the standard routing behavior.\n * Supports dynamic route parameters using `[param]` syntax.\n *\n * Default: undefined\n *\n * Example:\n * ```typescript\n * rewrite: {\n * \"/about\": {\n * en: \"/about\",\n * fr: \"/a-propos\",\n * },\n * \"/product/[slug]\": {\n * en: \"/product/[slug]\",\n * fr: \"/produit/[slug]\",\n * },\n * }\n * ```\n *\n * Note:\n * - The rewrite rules take precedence over the default `mode` behavior.\n * - If a path matches a rewrite rule, the localized path from the rewrite configuration will be used.\n * - Dynamic route parameters are supported using bracket notation (e.g., `[slug]`, `[id]`).\n * - Works with both Next.js and Vite applications.\n */\n rewrite: customConfiguration?.rewrite,\n});\n\nconst buildSystemFields = (\n baseDir?: string,\n customConfiguration?: Partial<SystemConfig>\n): SystemConfig => {\n const projectBaseDir = baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n const requireFunction = getProjectRequire(projectBaseDir);\n\n absolutePath = requireFunction.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\n }\n\n try {\n const stats = statSync(absolutePath);\n if (stats.isFile()) {\n return dirname(absolutePath);\n }\n } catch {\n if (/\\.[a-z0-9]+$/i.test(absolutePath)) {\n return dirname(absolutePath);\n }\n }\n\n return absolutePath;\n };\n\n const dictionariesDir = optionalJoinBaseDir(\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n );\n\n return {\n baseDir: projectBaseDir,\n moduleAugmentationDir: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n unmergedDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n remoteDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.remoteDictionariesDir ?? REMOTE_DICTIONARIES_DIR\n ),\n dictionariesDir,\n dynamicDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n fetchDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.fetchDictionariesDir ?? FETCH_DICTIONARIES_DIR\n ),\n typesDir: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\n mainDir: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\n configDir: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\n tempDir: optionalJoinBaseDir(customConfiguration?.tempDir ?? TEMP_DIR),\n outputFilesPatternWithPath: `${normalizePath(dictionariesDir)}/**/*.json`,\n };\n};\n\nconst buildContentFields = (\n systemConfig: SystemConfig,\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first\n const requireFunction = getProjectRequire(systemConfig.baseDir);\n absolutePath = requireFunction.resolve(pathInput, {\n paths: [systemConfig.baseDir],\n });\n } catch {\n try {\n // Fall back to native require.resolve if the custom require fails\n absolutePath = require.resolve(pathInput, {\n paths: [systemConfig.baseDir],\n });\n } catch {\n // If all resolution fails, fall back to standard path joining\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(systemConfig.baseDir, pathInput);\n }\n }\n\n try {\n // Smart Detection: File vs Directory\n const stats = statSync(absolutePath);\n\n // If it resolved to a file (like package.json \"main\" or index.js),\n // we want the FOLDER containing that file.\n if (stats.isFile()) {\n return dirname(absolutePath);\n }\n } catch {\n // Safety Fallback:\n // If statSync fails but it looks like a file (has an extension), strip it.\n if (/\\.[a-z0-9]+$/i.test(absolutePath)) {\n return dirname(absolutePath);\n }\n }\n\n // Return the calculated path (usually a directory)\n return absolutePath;\n };\n\n const contentDir = (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n optionalJoinBaseDir\n );\n\n const codeDirInput = customConfiguration?.codeDir;\n\n const codeDir = (codeDirInput ?? CODE_DIR).map(optionalJoinBaseDir);\n\n return {\n fileExtensions,\n contentDir,\n codeDir,\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n watch: customConfiguration?.watch ?? WATCH,\n formatCommand: customConfiguration?.formatCommand,\n watchedFilesPattern: fileExtensions.map((ext) => `/**/*${ext}`),\n watchedFilesPatternWithPath: fileExtensions.flatMap((ext) =>\n contentDir.map((dir) => `${normalizePath(dir)}/**/*${ext}`)\n ),\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL || APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL || EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL || CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL || BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: false;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://app.intlayer.org/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://app.intlayer.org/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n\n /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n liveSync: customConfiguration?.liveSync ?? LIVE_SYNC,\n\n /**\n * Port of the live sync server\n *\n * Default: 4000\n */\n liveSyncPort: customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT,\n\n /**\n * URL of the live sync server in case of remote live sync server\n *\n * Default: `http://localhost:${LIVE_SYNC_PORT}`\n */\n liveSyncURL:\n customConfiguration?.liveSyncURL ??\n `http://localhost:${customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT}`,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>,\n logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\n});\n\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n *\n * Default: undefined\n *\n * The application context.\n *\n * Example: `'My application context'`\n *\n * Note: Can be used to provide additional context about the application to the AI model. You can add more rules (e.g. \"You should not transform urls\").\n */\n applicationContext: customConfiguration?.applicationContext,\n\n /**\n * Base URL for the AI API\n *\n * Default: undefined\n *\n * The base URL for the AI API.\n *\n * Example: `'http://localhost:5000'`\n *\n * Note: Can be used to point to a local, or custom AI API endpoint.\n */\n baseURL: customConfiguration?.baseURL,\n\n /**\n * Data serialization\n *\n * Options:\n * - \"json\": The industry standard. Highly reliable and structured, but consumes more tokens.\n * - \"toon\": An optimized format designed to reduce token consumption (cost-effective). However, it may slightly increase the risk of output inconsistency compared to standard JSON\n *\n * Default: \"json\"\n */\n dataSerialization: customConfiguration?.dataSerialization,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates the mode of the build\n *\n * Default: 'auto'\n *\n * If 'auto', the build will be enabled automatically when the application is built.\n * If 'manual', the build will be set only when the build command is executed.\n *\n * Can be used to disable dictionaries build, for instance when execution on Node.js environment should be avoided.\n */\n mode: customConfiguration?.mode ?? BUILD_MODE,\n\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"live\": The dictionaries are imported dynamically using the live sync API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * Live mode will use the live sync API to fetch the dictionaries. If the API call fails, the dictionaries will be imported dynamically as \"dynamic\" mode.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If disabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n * - The \"live\" allows to sync the dictionaries to the live sync server.\n *\n * @deprecated Use `dictionary.importMode` instead.\n */\n importMode: customConfiguration?.importMode,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n\n /**\n * Output format of the dictionaries\n *\n * Can be set on large projects to improve build performance.\n *\n * Default: ['cjs', 'esm']\n *\n * The output format of the dictionaries. It can be either 'cjs' or 'esm'.\n * - 'cjs': The dictionaries are outputted as CommonJS modules.\n * - 'esm': The dictionaries are outputted as ES modules.\n */\n outputFormat: customConfiguration?.outputFormat ?? OUTPUT_FORMAT,\n\n /**\n * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n\n /**\n * Indicates if the build should check TypeScript types\n *\n * Default: false\n *\n * If true, the build will check TypeScript types and log errors.\n * Note: This can slow down the build.\n */\n checkTypes: customConfiguration?.checkTypes ?? TYPE_CHECKING,\n});\n\nconst buildCompilerFields = (\n customConfiguration?: Partial<CompilerConfig>\n): CompilerConfig => ({\n /**\n * Indicates if the compiler should be enabled\n */\n enabled: customConfiguration?.enabled ?? COMPILER_ENABLED,\n\n /**\n * Prefix for the extracted dictionary keys\n */\n dictionaryKeyPrefix:\n customConfiguration?.dictionaryKeyPrefix ?? COMPILER_DICTIONARY_KEY_PREFIX,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * @deprecated use build.traversePattern instead\n */\n transformPattern: customConfiguration?.transformPattern,\n\n /**\n * Pattern to exclude from the optimization.\n *\n * @deprecated use build.traversePattern instead\n */\n excludePattern: customConfiguration?.excludePattern,\n\n /**\n * Defines the output files path. Replaces `outputDir`.\n *\n * - `./` paths are resolved relative to the component directory.\n * - `/` paths are resolved relative to the project root (`baseDir`).\n *\n * - Including the `{{locale}}` variable in the path will trigger the generation of separate dictionaries per locale.\n *\n * Example:\n * ```ts\n * {\n * // Create Multilingual .content.ts files close to the component\n * output: ({ fileName, extension }) => `./${fileName}${extension}`,\n *\n * // output: './{{fileName}}{{extension}}', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create centralize per-locale JSON at the root of the project\n * output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,\n *\n * // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using template string\n * }\n * ```\n *\n * Variable list:\n * - `fileName`: The name of the file.\n * - `key`: The key of the content.\n * - `locale`: The locale of the content.\n * - `extension`: The extension of the file.\n * - `componentFileName`: The name of the component file.\n * - `componentExtension`: The extension of the component file.\n * - `format`: The format of the dictionary.\n * - `componentFormat`: The format of the component dictionary.\n * - `componentDirPath`: The directory path of the component.\n */\n output: customConfiguration?.output,\n\n /**\n * Indicates if the metadata should be saved in the file.\n *\n * If true, the compiler will not save the metadata of the dictionaries.\n *\n * If true:\n *\n * ```json\n * {\n * \"key\": \"value\"\n * }\n * ```\n *\n * If false:\n *\n * ```json\n * {\n * \"key\": \"value\",\n * \"content\": {\n * \"key\": \"value\"\n * }\n * }\n * ```\n *\n * Default: false\n *\n * Note: Useful if used with loadJSON plugin\n */\n noMetadata: customConfiguration?.noMetadata ?? COMPILER_NO_METADATA,\n\n /**\n * Indicates if the components should be saved after being transformed.\n */\n saveComponents:\n customConfiguration?.saveComponents ?? COMPILER_SAVE_COMPONENTS,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => {\n const contentAutoTransformation =\n customConfiguration?.contentAutoTransformation ??\n CONTENT_AUTO_TRANSFORMATION;\n\n return {\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: `true`\n *\n * - If `true`, will consider the `compiler.output` field.\n * - If `false`, will skip the fill process.\n *\n * - `./` paths are resolved relative to the component directory.\n * - `/` paths are resolved relative to the project root (`baseDir`).\n *\n * - If includes `{{locale}}` variable in the path, will trigger the generation of separate dictionaries per locale.\n *\n * Example:\n * ```ts\n * {\n * // Create Multilingual .content.ts files close to the component\n * fill: ({ fileName, extension }) => `./${fileName}${extension}`,\n *\n * // fill: './{{fileName}}{{extension}}', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create centralize per-locale JSON at the root of the project\n * fill: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,\n *\n * // fill: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create custom output based on the locale\n * fill: {\n * en: ({ key }) => `/locales/en/${key}.content.json`,\n * fr: '/locales/fr/{{key}}.content.json',\n * es: false,\n * de: true,\n * },\n * }\n * ```\n *\n *\n * Variable list:\n * - `fileName`: The name of the file.\n * - `key`: The key of the content.\n * - `locale`: The locale of the content.\n * - `extension`: The extension of the file.\n * - `componentFileName`: The name of the component file.\n * - `componentExtension`: The extension of the component file.\n * - `format`: The format of the dictionary.\n * - `componentFormat`: The format of the component dictionary.\n * - `componentDirPath`: The directory path of the component.\n */\n fill: customConfiguration?.fill ?? FILL,\n\n /**\n * Indicates if the content of the dictionary should be automatically transformed.\n *\n * Default: false\n */\n contentAutoTransformation:\n typeof contentAutoTransformation === 'object'\n ? {\n markdown: contentAutoTransformation.markdown ?? false,\n html: contentAutoTransformation.html ?? false,\n insertion: contentAutoTransformation.insertion ?? false,\n }\n : contentAutoTransformation,\n\n /**\n * The location of the dictionary.\n *\n * Default: 'local'\n */\n location: customConfiguration?.location ?? LOCATION,\n\n /**\n * Transform the dictionary in a per-locale dictionary.\n * Each field declared in a per-locale dictionary will be transformed in a translation node.\n * If missing, the dictionary will be treated as a multilingual dictionary.\n */\n locale: customConfiguration?.locale,\n\n /**\n * The title of the dictionary.\n */\n title: customConfiguration?.title,\n\n /**\n * The description of the dictionary.\n */\n description: customConfiguration?.description,\n\n /**\n * Tags to categorize the dictionaries.\n */\n tags: customConfiguration?.tags,\n\n /**\n * The priority of the dictionary.\n */\n priority: customConfiguration?.priority,\n\n /**\n * Indicates the mode of import to use for the dictionary.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * - \"live\": The dictionaries are imported dynamically using the live sync API.\n *\n * Default: 'static'\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n };\n};\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string,\n logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\n\n const systemConfig = buildSystemFields(baseDir, customConfiguration?.system);\n\n const contentConfig = buildContentFields(\n systemConfig,\n customConfiguration?.content\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const compilerConfig = buildCompilerFields(customConfiguration?.compiler);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n system: systemConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n compiler: compilerConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n schemas: customConfiguration?.schemas,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;\n};\n"],"mappings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B,OAAQ,GAAqB,OAK7B,MAAO,GAAqB,MAK5B,YAAa,GAAqB,YAKlC,KAAM,GAAqB,KAK3B,SAAU,GAAqB,SAY/B,WAAY,GAAqB,YAAA,SAClC,EAMU,GACX,EACA,EACA,IACmB,CACnB,IAAM,EAA6B,EACjC,GAAqB,qBACtB,CAEK,EAAgB,EAAmB,GAAqB,QAAQ,CAEhE,EAAe,EAAkB,EAAS,GAAqB,OAAO,CAyC5E,MApBA,GAAsB,CACpB,qBAAsB,EACtB,QAAS,EACT,QAtBoB,EACpB,EACA,GAAqB,QACtB,CAoBC,OAAQ,EACR,OAnBmB,EAAkB,GAAqB,OAAO,CAoBjE,IAlBgB,EAAe,GAAqB,IAAK,EAAa,CAmBtE,GAjBe,EAAc,GAAqB,GAAG,CAkBrD,MAhBkB,EAAiB,GAAqB,MAAM,CAiB9D,SAfqB,EAAoB,GAAqB,SAAS,CAgBvE,WAduB,EACvB,GAAqB,WACtB,CAaC,QAAS,GAAqB,QAC9B,QAAS,GAAqB,QAC9B,SAAU,CACR,KAAM,WACN,QAASC,EAAAA,QAAY,QACrB,IAAK,4BACN,CACF,CAEM"}
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.cjs","names":["LOCALES","REQUIRED_LOCALES","DEFAULT_LOCALE","STORAGE","getProjectRequire","FILE_EXTENSIONS","CONTENT_DIR","CODE_DIR","EXCLUDED_PATHS","PREFIX","TRAVERSE_PATTERN","OUTPUT_FORMAT","packageJson"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { statSync } from 'node:fs';\nimport { dirname, isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BuildConfig,\n CompilerConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n RoutingConfig,\n SystemConfig,\n} from '@intlayer/types/config';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n BUILD_MODE,\n CACHE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n TYPE_CHECKING,\n} from '../defaultValues/build';\nimport {\n COMPILER_DICTIONARY_KEY_PREFIX,\n COMPILER_ENABLED,\n COMPILER_NO_METADATA,\n COMPILER_SAVE_COMPONENTS,\n} from '../defaultValues/compiler';\nimport {\n CODE_DIR,\n CONTENT_DIR,\n EXCLUDED_PATHS,\n FILE_EXTENSIONS,\n WATCH,\n} from '../defaultValues/content';\nimport {\n CONTENT_AUTO_TRANSFORMATION,\n FILL,\n IMPORT_MODE,\n LOCATION,\n} from '../defaultValues/dictionary';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n IS_ENABLED,\n LIVE_SYNC,\n LIVE_SYNC_PORT,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport {\n CACHE_DIR,\n CONFIG_DIR,\n DICTIONARIES_DIR,\n DYNAMIC_DICTIONARIES_DIR,\n FETCH_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REMOTE_DICTIONARIES_DIR,\n TEMP_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n} from '../defaultValues/system';\nimport { getProjectRequire } from '../utils';\n\nlet storedConfiguration: IntlayerConfig;\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_LOCALES,\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - If set to \"strict\", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.\n * - If set to \"inclusive\", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"inclusive\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Custom URL rewriting rules that override the default routing mode for specific paths.\n * Allows you to define locale-specific paths that differ from the standard routing behavior.\n * Supports dynamic route parameters using `[param]` syntax.\n *\n * Default: undefined\n *\n * Example:\n * ```typescript\n * rewrite: {\n * \"/about\": {\n * en: \"/about\",\n * fr: \"/a-propos\",\n * },\n * \"/product/[slug]\": {\n * en: \"/product/[slug]\",\n * fr: \"/produit/[slug]\",\n * },\n * }\n * ```\n *\n * Note:\n * - The rewrite rules take precedence over the default `mode` behavior.\n * - If a path matches a rewrite rule, the localized path from the rewrite configuration will be used.\n * - Dynamic route parameters are supported using bracket notation (e.g., `[slug]`, `[id]`).\n * - Works with both Next.js and Vite applications.\n */\n rewrite: customConfiguration?.rewrite,\n});\n\nconst buildSystemFields = (\n baseDir?: string,\n customConfiguration?: Partial<SystemConfig>\n): SystemConfig => {\n const projectBaseDir = baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n const requireFunction = getProjectRequire(projectBaseDir);\n\n absolutePath = requireFunction.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\n }\n\n try {\n const stats = statSync(absolutePath);\n if (stats.isFile()) {\n return dirname(absolutePath);\n }\n } catch {\n if (/\\.[a-z0-9]+$/i.test(absolutePath)) {\n return dirname(absolutePath);\n }\n }\n\n return absolutePath;\n };\n\n const dictionariesDir = optionalJoinBaseDir(\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n );\n\n return {\n baseDir: projectBaseDir,\n moduleAugmentationDir: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n unmergedDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n remoteDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.remoteDictionariesDir ?? REMOTE_DICTIONARIES_DIR\n ),\n dictionariesDir,\n dynamicDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n fetchDictionariesDir: optionalJoinBaseDir(\n customConfiguration?.fetchDictionariesDir ?? FETCH_DICTIONARIES_DIR\n ),\n typesDir: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\n mainDir: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\n configDir: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\n tempDir: optionalJoinBaseDir(customConfiguration?.tempDir ?? TEMP_DIR),\n };\n};\n\nconst buildContentFields = (\n systemConfig: SystemConfig,\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first\n const requireFunction = getProjectRequire(systemConfig.baseDir);\n absolutePath = requireFunction.resolve(pathInput, {\n paths: [systemConfig.baseDir],\n });\n } catch {\n try {\n // Fall back to native require.resolve if the custom require fails\n absolutePath = require.resolve(pathInput, {\n paths: [systemConfig.baseDir],\n });\n } catch {\n // If all resolution fails, fall back to standard path joining\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(systemConfig.baseDir, pathInput);\n }\n }\n\n try {\n // Smart Detection: File vs Directory\n const stats = statSync(absolutePath);\n\n // If it resolved to a file (like package.json \"main\" or index.js),\n // we want the FOLDER containing that file.\n if (stats.isFile()) {\n return dirname(absolutePath);\n }\n } catch {\n // Safety Fallback:\n // If statSync fails but it looks like a file (has an extension), strip it.\n if (/\\.[a-z0-9]+$/i.test(absolutePath)) {\n return dirname(absolutePath);\n }\n }\n\n // Return the calculated path (usually a directory)\n return absolutePath;\n };\n\n const contentDir = (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n optionalJoinBaseDir\n );\n\n const codeDirInput = customConfiguration?.codeDir;\n\n const codeDir = (codeDirInput ?? CODE_DIR).map(optionalJoinBaseDir);\n\n return {\n fileExtensions,\n contentDir,\n codeDir,\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n watch: customConfiguration?.watch ?? WATCH,\n formatCommand: customConfiguration?.formatCommand,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL || APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL || EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL || CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL || BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: false;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://app.intlayer.org/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://app.intlayer.org/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n\n /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n liveSync: customConfiguration?.liveSync ?? LIVE_SYNC,\n\n /**\n * Port of the live sync server\n *\n * Default: 4000\n */\n liveSyncPort: customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT,\n\n /**\n * URL of the live sync server in case of remote live sync server\n *\n * Default: `http://localhost:${LIVE_SYNC_PORT}`\n */\n liveSyncURL:\n customConfiguration?.liveSyncURL ??\n `http://localhost:${customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT}`,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>,\n logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\n});\n\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n *\n * Default: undefined\n *\n * The application context.\n *\n * Example: `'My application context'`\n *\n * Note: Can be used to provide additional context about the application to the AI model. You can add more rules (e.g. \"You should not transform urls\").\n */\n applicationContext: customConfiguration?.applicationContext,\n\n /**\n * Base URL for the AI API\n *\n * Default: undefined\n *\n * The base URL for the AI API.\n *\n * Example: `'http://localhost:5000'`\n *\n * Note: Can be used to point to a local, or custom AI API endpoint.\n */\n baseURL: customConfiguration?.baseURL,\n\n /**\n * Data serialization\n *\n * Options:\n * - \"json\": The industry standard. Highly reliable and structured, but consumes more tokens.\n * - \"toon\": An optimized format designed to reduce token consumption (cost-effective). However, it may slightly increase the risk of output inconsistency compared to standard JSON\n *\n * Default: \"json\"\n */\n dataSerialization: customConfiguration?.dataSerialization,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates the mode of the build\n *\n * Default: 'auto'\n *\n * If 'auto', the build will be enabled automatically when the application is built.\n * If 'manual', the build will be set only when the build command is executed.\n *\n * Can be used to disable dictionaries build, for instance when execution on Node.js environment should be avoided.\n */\n mode: customConfiguration?.mode ?? BUILD_MODE,\n\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"live\": The dictionaries are imported dynamically using the live sync API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * Live mode will use the live sync API to fetch the dictionaries. If the API call fails, the dictionaries will be imported dynamically as \"dynamic\" mode.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If disabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n * - The \"live\" allows to sync the dictionaries to the live sync server.\n *\n * @deprecated Use `dictionary.importMode` instead.\n */\n importMode: customConfiguration?.importMode,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n\n /**\n * Output format of the dictionaries\n *\n * Can be set on large projects to improve build performance.\n *\n * Default: ['cjs', 'esm']\n *\n * The output format of the dictionaries. It can be either 'cjs' or 'esm'.\n * - 'cjs': The dictionaries are outputted as CommonJS modules.\n * - 'esm': The dictionaries are outputted as ES modules.\n */\n outputFormat: customConfiguration?.outputFormat ?? OUTPUT_FORMAT,\n\n /**\n * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n\n /**\n * Indicates if the build should check TypeScript types\n *\n * Default: false\n *\n * If true, the build will check TypeScript types and log errors.\n * Note: This can slow down the build.\n */\n checkTypes: customConfiguration?.checkTypes ?? TYPE_CHECKING,\n});\n\nconst buildCompilerFields = (\n customConfiguration?: Partial<CompilerConfig>\n): CompilerConfig => ({\n /**\n * Indicates if the compiler should be enabled\n */\n enabled: customConfiguration?.enabled ?? COMPILER_ENABLED,\n\n /**\n * Prefix for the extracted dictionary keys\n */\n dictionaryKeyPrefix:\n customConfiguration?.dictionaryKeyPrefix ?? COMPILER_DICTIONARY_KEY_PREFIX,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * @deprecated use build.traversePattern instead\n */\n transformPattern: customConfiguration?.transformPattern,\n\n /**\n * Pattern to exclude from the optimization.\n *\n * @deprecated use build.traversePattern instead\n */\n excludePattern: customConfiguration?.excludePattern,\n\n /**\n * Defines the output files path. Replaces `outputDir`.\n *\n * - `./` paths are resolved relative to the component directory.\n * - `/` paths are resolved relative to the project root (`baseDir`).\n *\n * - Including the `{{locale}}` variable in the path will trigger the generation of separate dictionaries per locale.\n *\n * Example:\n * ```ts\n * {\n * // Create Multilingual .content.ts files close to the component\n * output: ({ fileName, extension }) => `./${fileName}${extension}`,\n *\n * // output: './{{fileName}}{{extension}}', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create centralize per-locale JSON at the root of the project\n * output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,\n *\n * // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using template string\n * }\n * ```\n *\n * Variable list:\n * - `fileName`: The name of the file.\n * - `key`: The key of the content.\n * - `locale`: The locale of the content.\n * - `extension`: The extension of the file.\n * - `componentFileName`: The name of the component file.\n * - `componentExtension`: The extension of the component file.\n * - `format`: The format of the dictionary.\n * - `componentFormat`: The format of the component dictionary.\n * - `componentDirPath`: The directory path of the component.\n */\n output: customConfiguration?.output,\n\n /**\n * Indicates if the metadata should be saved in the file.\n *\n * If true, the compiler will not save the metadata of the dictionaries.\n *\n * If true:\n *\n * ```json\n * {\n * \"key\": \"value\"\n * }\n * ```\n *\n * If false:\n *\n * ```json\n * {\n * \"key\": \"value\",\n * \"content\": {\n * \"key\": \"value\"\n * }\n * }\n * ```\n *\n * Default: false\n *\n * Note: Useful if used with loadJSON plugin\n */\n noMetadata: customConfiguration?.noMetadata ?? COMPILER_NO_METADATA,\n\n /**\n * Indicates if the components should be saved after being transformed.\n */\n saveComponents:\n customConfiguration?.saveComponents ?? COMPILER_SAVE_COMPONENTS,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => {\n const contentAutoTransformation =\n customConfiguration?.contentAutoTransformation ??\n CONTENT_AUTO_TRANSFORMATION;\n\n return {\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: `true`\n *\n * - If `true`, will consider the `compiler.output` field.\n * - If `false`, will skip the fill process.\n *\n * - `./` paths are resolved relative to the component directory.\n * - `/` paths are resolved relative to the project root (`baseDir`).\n *\n * - If includes `{{locale}}` variable in the path, will trigger the generation of separate dictionaries per locale.\n *\n * Example:\n * ```ts\n * {\n * // Create Multilingual .content.ts files close to the component\n * fill: ({ fileName, extension }) => `./${fileName}${extension}`,\n *\n * // fill: './{{fileName}}{{extension}}', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create centralize per-locale JSON at the root of the project\n * fill: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,\n *\n * // fill: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using template string\n * }\n * ```\n *\n * ```ts\n * {\n * // Create custom output based on the locale\n * fill: {\n * en: ({ key }) => `/locales/en/${key}.content.json`,\n * fr: '/locales/fr/{{key}}.content.json',\n * es: false,\n * de: true,\n * },\n * }\n * ```\n *\n *\n * Variable list:\n * - `fileName`: The name of the file.\n * - `key`: The key of the content.\n * - `locale`: The locale of the content.\n * - `extension`: The extension of the file.\n * - `componentFileName`: The name of the component file.\n * - `componentExtension`: The extension of the component file.\n * - `format`: The format of the dictionary.\n * - `componentFormat`: The format of the component dictionary.\n * - `componentDirPath`: The directory path of the component.\n */\n fill: customConfiguration?.fill ?? FILL,\n\n /**\n * Indicates if the content of the dictionary should be automatically transformed.\n *\n * Default: false\n */\n contentAutoTransformation:\n typeof contentAutoTransformation === 'object'\n ? {\n markdown: contentAutoTransformation.markdown ?? false,\n html: contentAutoTransformation.html ?? false,\n insertion: contentAutoTransformation.insertion ?? false,\n }\n : contentAutoTransformation,\n\n /**\n * The location of the dictionary.\n *\n * Default: 'local'\n */\n location: customConfiguration?.location ?? LOCATION,\n\n /**\n * Transform the dictionary in a per-locale dictionary.\n * Each field declared in a per-locale dictionary will be transformed in a translation node.\n * If missing, the dictionary will be treated as a multilingual dictionary.\n */\n locale: customConfiguration?.locale,\n\n /**\n * The title of the dictionary.\n */\n title: customConfiguration?.title,\n\n /**\n * The description of the dictionary.\n */\n description: customConfiguration?.description,\n\n /**\n * Tags to categorize the dictionaries.\n */\n tags: customConfiguration?.tags,\n\n /**\n * The priority of the dictionary.\n */\n priority: customConfiguration?.priority,\n\n /**\n * Indicates the mode of import to use for the dictionary.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * - \"live\": The dictionaries are imported dynamically using the live sync API.\n *\n * Default: 'static'\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n };\n};\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string,\n logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\n\n const systemConfig = buildSystemFields(baseDir, customConfiguration?.system);\n\n const contentConfig = buildContentFields(\n systemConfig,\n customConfiguration?.content\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const compilerConfig = buildCompilerFields(customConfiguration?.compiler);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n system: systemConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n compiler: compilerConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n schemas: customConfiguration?.schemas,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;\n};\n"],"mappings":"qoBA8EA,IAAI,EAEJ,MAAM,EACJ,IACgC,CAOhC,QAAS,GAAqB,SAAWA,EAAAA,QAWzC,gBACE,GAAqB,iBACrB,GAAqB,SACrBC,EAA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oB,EACpB,EACA,GAAqB,QACtB,CAoBC,OAAQ,EACR,OAnBmB,EAAkB,GAAqB,OAAO,CAoBjE,IAlBgB,EAAe,GAAqB,IAAK,EAAa,CAmBtE,GAjBe,EAAc,GAAqB,GAAG,CAkBrD,MAhBkB,EAAiB,GAAqB,MAAM,CAiB9D,SAfqB,EAAoB,GAAqB,SAAS,CAgBvE,WAduB,EACvB,GAAqB,WACtB,CAaC,QAAS,GAAqB,QAC9B,QAAS,GAAqB,QAC9B,SAAU,CACR,KAAM,WACN,QAASC,EAAAA,QAAY,QACrB,IAAK,4BACN,CACF,CAEM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-D-qHiVGv.cjs`);let e=require(`@intlayer/types/config`),t=require(`zod`);const n=t.z.object({locales:t.z.array(t.z.string()).min(1),requiredLocales:t.z.array(t.z.string()).optional(),strictMode:t.z.enum([`strict`,`inclusive`,`loose`]).optional(),defaultLocale:t.z.string().optional()}),r=t.z.object({type:t.z.literal(`cookie`),name:t.z.string().optional(),domain:t.z.string().optional(),path:t.z.string().optional(),secure:t.z.boolean().optional(),httpOnly:t.z.boolean().optional(),sameSite:t.z.enum([`strict`,`lax`,`none`]).optional(),expires:t.z.union([t.z.date(),t.z.number()]).optional()}),i=t.z.object({type:t.z.enum([`localStorage`,`sessionStorage`,`header`]),name:t.z.string().optional()}),a=t.z.union([t.z.literal(!1),t.z.enum([`cookie`,`localStorage`,`sessionStorage`,`header`]),r,i,t.z.array(t.z.union([t.z.enum([`cookie`,`localStorage`,`sessionStorage`,`header`]),r,i]))]),o=t.z.object({canonical:t.z.string(),localized:t.z.record(t.z.string(),t.z.string())}),s=t.z.object({rules:t.z.array(o)}),c=t.z.object({url:s,nextjs:s.optional(),vite:s.optional()}),l=t.z.object({rewrite:t.z.union([t.z.record(t.z.string(),t.z.record(t.z.string(),t.z.string())),c]).optional(),mode:t.z.enum([`prefix-no-default`,`prefix-all`,`no-prefix`,`search-params`]).optional(),storage:a.optional(),basePath:t.z.string().optional()}),u=t.z.object({baseDir:t.z.string().optional(),moduleAugmentationDir:t.z.string().optional(),unmergedDictionariesDir:t.z.string().optional(),remoteDictionariesDir:t.z.string().optional(),dictionariesDir:t.z.string().optional(),dynamicDictionariesDir:t.z.string().optional(),fetchDictionariesDir:t.z.string().optional(),typesDir:t.z.string().optional(),mainDir:t.z.string().optional(),configDir:t.z.string().optional(),cacheDir:t.z.string().optional(),tempDir:t.z.string().optional()}),d=t.z.object({fileExtensions:t.z.array(t.z.string()).optional(),contentDir:t.z.array(t.z.string()).optional(),codeDir:t.z.array(t.z.string()).optional(),excludedPath:t.z.array(t.z.string()).optional(),watch:t.z.boolean().optional(),formatCommand:t.z.string().optional()}),f=t.z.object({applicationURL:t.z.union([t.z.url(),t.z.literal(``)]).optional(),editorURL:t.z.union([t.z.url(),t.z.literal(``)]).optional(),cmsURL:t.z.union([t.z.url(),t.z.literal(``)]).optional(),backendURL:t.z.union([t.z.url(),t.z.literal(``)]).optional(),port:t.z.number().int().positive().max(65535).optional(),enabled:t.z.boolean().optional(),clientId:t.z.string().optional(),clientSecret:t.z.string().optional(),dictionaryPriorityStrategy:t.z.enum([`local_first`,`distant_first`]).optional(),liveSync:t.z.boolean().optional(),liveSyncPort:t.z.number().int().positive().max(65535).optional(),liveSyncURL:t.z.union([t.z.url(),t.z.literal(``)]).optional()}),p=t.z.object({mode:t.z.enum([`default`,`verbose`,`disabled`]).optional(),prefix:t.z.string().optional(),error:t.z.function().optional(),log:t.z.function().optional(),info:t.z.function().optional(),warn:t.z.function().optional()}),m=t.z.object({provider:t.z.enum(e.AiProviders).optional(),apiKey:t.z.string().optional(),model:t.z.string().optional(),temperature:t.z.number().min(0).max(2).optional(),applicationContext:t.z.string().optional(),baseURL:t.z.url().optional(),dataSerialization:t.z.enum([`json`,`toon`]).optional()}),h=t.z.object({mode:t.z.enum([`auto`,`manual`]).optional(),optimize:t.z.boolean().optional(),importMode:t.z.enum([`static`,`dynamic`,`fetch`]).optional(),traversePattern:t.z.array(t.z.string()).optional(),outputFormat:t.z.array(t.z.enum([`cjs`,`esm`])).optional(),cache:t.z.boolean().optional(),require:t.z.unknown().optional(),checkTypes:t.z.boolean().optional()}),g=t.z.object({enabled:t.z.union([t.z.boolean(),t.z.literal(`build-only`)]).optional(),dictionaryKeyPrefix:t.z.string().optional(),transformPattern:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional(),excludePattern:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional(),output:t.z.unknown().optional(),noMetadata:t.z.boolean().optional(),saveComponents:t.z.boolean().optional()}),_=t.z.object({fill:t.z.unknown().optional(),contentAutoTransformation:t.z.union([t.z.boolean(),t.z.object({markdown:t.z.boolean().optional(),html:t.z.boolean().optional(),insertion:t.z.boolean().optional()})]).optional(),location:t.z.string().optional(),locale:t.z.string().optional(),title:t.z.string().optional()}),v=t.z.object({internationalization:n.optional(),routing:l.optional(),content:d.optional(),system:u.optional(),editor:f.optional(),log:p.optional(),ai:m.optional(),build:h.optional(),compiler:g.optional(),dictionary:_.optional(),plugins:t.z.array(t.z.unknown()).optional(),schemas:t.z.record(t.z.string(),t.z.unknown()).optional(),metadata:t.z.object({name:t.z.string().optional(),version:t.z.string().optional(),doc:t.z.string().optional()}).optional()});exports.aiSchema=m,exports.buildSchema=h,exports.compilerSchema=g,exports.contentSchema=d,exports.cookiesAttributesSchema=r,exports.dictionarySchema=_,exports.editorSchema=f,exports.internationalizationSchema=n,exports.intlayerConfigSchema=v,exports.logSchema=p,exports.rewriteObjectSchema=c,exports.rewriteRuleSchema=o,exports.rewriteRulesSchema=s,exports.routingSchema=l,exports.storageAttributesSchema=i,exports.storageSchema=a,exports.systemSchema=u;
|
|
2
2
|
//# sourceMappingURL=configurationSchema.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationSchema.cjs","names":["z","AiProviders"],"sources":["../../../src/configFile/configurationSchema.ts"],"sourcesContent":["import { AiProviders } from '@intlayer/types/config';\nimport { z } from 'zod';\n\nexport const internationalizationSchema = z.object({\n locales: z.array(z.string()).min(1),\n requiredLocales: z.array(z.string()).optional(),\n strictMode: z.enum(['strict', 'inclusive', 'loose']).optional(),\n defaultLocale: z.string().optional(),\n});\n\nexport const cookiesAttributesSchema = z.object({\n type: z.literal('cookie'),\n name: z.string().optional(),\n domain: z.string().optional(),\n path: z.string().optional(),\n secure: z.boolean().optional(),\n httpOnly: z.boolean().optional(),\n sameSite: z.enum(['strict', 'lax', 'none']).optional(),\n expires: z.union([z.date(), z.number()]).optional(),\n});\n\nexport const storageAttributesSchema = z.object({\n type: z.enum(['localStorage', 'sessionStorage', 'header']),\n name: z.string().optional(),\n});\n\nexport const storageSchema = z.union([\n z.literal(false),\n z.enum(['cookie', 'localStorage', 'sessionStorage', 'header']),\n cookiesAttributesSchema,\n storageAttributesSchema,\n z.array(\n z.union([\n z.enum(['cookie', 'localStorage', 'sessionStorage', 'header']),\n cookiesAttributesSchema,\n storageAttributesSchema,\n ])\n ),\n]);\n\nexport const rewriteRuleSchema = z.object({\n canonical: z.string(),\n localized: z.record(z.string(), z.string()),\n});\n\nexport const rewriteRulesSchema = z.object({\n rules: z.array(rewriteRuleSchema),\n});\n\nexport const rewriteObjectSchema = z.object({\n url: rewriteRulesSchema,\n nextjs: rewriteRulesSchema.optional(),\n vite: rewriteRulesSchema.optional(),\n});\n\nexport const routingSchema = z.object({\n rewrite: z\n .union([\n z.record(z.string(), z.record(z.string(), z.string())),\n rewriteObjectSchema,\n ])\n .optional(),\n mode: z\n .enum(['prefix-no-default', 'prefix-all', 'no-prefix', 'search-params'])\n .optional(),\n storage: storageSchema.optional(),\n basePath: z.string().optional(),\n});\n\nexport const systemSchema = z.object({\n baseDir: z.string().optional(),\n moduleAugmentationDir: z.string().optional(),\n unmergedDictionariesDir: z.string().optional(),\n remoteDictionariesDir: z.string().optional(),\n dictionariesDir: z.string().optional(),\n dynamicDictionariesDir: z.string().optional(),\n fetchDictionariesDir: z.string().optional(),\n typesDir: z.string().optional(),\n mainDir: z.string().optional(),\n configDir: z.string().optional(),\n cacheDir: z.string().optional(),\n tempDir: z.string().optional(),\n outputFilesPatternWithPath: z.string().optional(),\n});\n\nexport const contentSchema = z.object({\n fileExtensions: z.array(z.string()).optional(),\n contentDir: z.array(z.string()).optional(),\n codeDir: z.array(z.string()).optional(),\n excludedPath: z.array(z.string()).optional(),\n watch: z.boolean().optional(),\n formatCommand: z.string().optional(),\n watchedFilesPattern: z.array(z.string()).optional(),\n watchedFilesPatternWithPath: z.array(z.string()).optional(),\n});\n\nexport const editorSchema = z.object({\n applicationURL: z.union([z.url(), z.literal('')]).optional(),\n editorURL: z.union([z.url(), z.literal('')]).optional(),\n cmsURL: z.union([z.url(), z.literal('')]).optional(),\n backendURL: z.union([z.url(), z.literal('')]).optional(),\n port: z.number().int().positive().max(65535).optional(),\n enabled: z.boolean().optional(),\n clientId: z.string().optional(),\n clientSecret: z.string().optional(),\n dictionaryPriorityStrategy: z\n .enum(['local_first', 'distant_first'])\n .optional(),\n liveSync: z.boolean().optional(),\n liveSyncPort: z.number().int().positive().max(65535).optional(),\n liveSyncURL: z.union([z.url(), z.literal('')]).optional(),\n});\n\nexport const logSchema = z.object({\n mode: z.enum(['default', 'verbose', 'disabled']).optional(),\n prefix: z.string().optional(),\n error: z.function().optional(),\n log: z.function().optional(),\n info: z.function().optional(),\n warn: z.function().optional(),\n});\n\nexport const aiSchema = z.object({\n provider: z.enum(AiProviders).optional(),\n apiKey: z.string().optional(),\n model: z.string().optional(),\n temperature: z.number().min(0).max(2).optional(),\n applicationContext: z.string().optional(),\n baseURL: z.url().optional(),\n dataSerialization: z.enum(['json', 'toon']).optional(),\n});\n\nexport const buildSchema = z.object({\n mode: z.enum(['auto', 'manual']).optional(),\n optimize: z.boolean().optional(),\n importMode: z.enum(['static', 'dynamic', 'fetch']).optional(),\n traversePattern: z.array(z.string()).optional(),\n outputFormat: z.array(z.enum(['cjs', 'esm'])).optional(),\n cache: z.boolean().optional(),\n require: z.unknown().optional(),\n checkTypes: z.boolean().optional(),\n});\n\nexport const compilerSchema = z.object({\n enabled: z.union([z.boolean(), z.literal('build-only')]).optional(),\n dictionaryKeyPrefix: z.string().optional(),\n transformPattern: z.union([z.string(), z.array(z.string())]).optional(),\n excludePattern: z.union([z.string(), z.array(z.string())]).optional(),\n output: z.unknown().optional(),\n noMetadata: z.boolean().optional(),\n saveComponents: z.boolean().optional(),\n});\n\nexport const dictionarySchema = z.object({\n fill: z.unknown().optional(),\n contentAutoTransformation: z\n .union([\n z.boolean(),\n z.object({\n markdown: z.boolean().optional(),\n html: z.boolean().optional(),\n insertion: z.boolean().optional(),\n }),\n ])\n .optional(),\n location: z.string().optional(),\n locale: z.string().optional(),\n title: z.string().optional(),\n});\n\nexport const intlayerConfigSchema = z.object({\n internationalization: internationalizationSchema.optional(),\n routing: routingSchema.optional(),\n content: contentSchema.optional(),\n system: systemSchema.optional(),\n editor: editorSchema.optional(),\n log: logSchema.optional(),\n ai: aiSchema.optional(),\n build: buildSchema.optional(),\n compiler: compilerSchema.optional(),\n dictionary: dictionarySchema.optional(),\n plugins: z.array(z.unknown()).optional(),\n schemas: z.record(z.string(), z.unknown()).optional(),\n metadata: z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n doc: z.string().optional(),\n })\n .optional(),\n});\n"],"mappings":"yKAGA,MAAa,EAA6BA,EAAAA,EAAE,OAAO,CACjD,QAASA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CACnC,gBAAiBA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,QAAQ,CAAC,CAAC,UAAU,CAC/C,WAAYA,EAAAA,EAAE,KAAK,CAAC,SAAU,YAAa,QAAQ,CAAC,CAAC,UAAU,CAC/D,cAAeA,EAAAA,EAAE,QAAQ,CAA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SAAUA,EAAAA,EAAE,SAAS,CAAC,UAAU,CAChC,KAAMA,EAAAA,EAAE,SAAS,CAAC,UAAU,CAC5B,UAAWA,EAAAA,EAAE,SAAS,CAAC,UAAU,CAClC,CAAC,CACH,CAAC,CACD,UAAU,CACb,SAAUA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC/B,OAAQA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC7B,MAAOA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC7B,CAAC,CAEW,EAAuBA,EAAAA,EAAE,OAAO,CAC3C,qBAAsB,EAA2B,UAAU,CAC3D,QAAS,EAAc,UAAU,CACjC,QAAS,EAAc,UAAU,CACjC,OAAQ,EAAa,UAAU,CAC/B,OAAQ,EAAa,UAAU,CAC/B,IAAK,EAAU,UAAU,CACzB,GAAI,EAAS,UAAU,CACvB,MAAO,EAAY,UAAU,CAC7B,SAAU,EAAe,UAAU,CACnC,WAAY,EAAiB,UAAU,CACvC,QAASA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,SAAS,CAAC,CAAC,UAAU,CACxC,QAASA,EAAAA,EAAE,OAAOA,EAAAA,EAAE,QAAQ,CAAEA,EAAAA,EAAE,SAAS,CAAC,CAAC,UAAU,CACrD,SAAUA,EAAAA,EACP,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,QAASA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC9B,IAAKA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,CAAC,CACD,UAAU,CACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"configurationSchema.cjs","names":["z","AiProviders"],"sources":["../../../src/configFile/configurationSchema.ts"],"sourcesContent":["import { AiProviders } from '@intlayer/types/config';\nimport { z } from 'zod';\n\nexport const internationalizationSchema = z.object({\n locales: z.array(z.string()).min(1),\n requiredLocales: z.array(z.string()).optional(),\n strictMode: z.enum(['strict', 'inclusive', 'loose']).optional(),\n defaultLocale: z.string().optional(),\n});\n\nexport const cookiesAttributesSchema = z.object({\n type: z.literal('cookie'),\n name: z.string().optional(),\n domain: z.string().optional(),\n path: z.string().optional(),\n secure: z.boolean().optional(),\n httpOnly: z.boolean().optional(),\n sameSite: z.enum(['strict', 'lax', 'none']).optional(),\n expires: z.union([z.date(), z.number()]).optional(),\n});\n\nexport const storageAttributesSchema = z.object({\n type: z.enum(['localStorage', 'sessionStorage', 'header']),\n name: z.string().optional(),\n});\n\nexport const storageSchema = z.union([\n z.literal(false),\n z.enum(['cookie', 'localStorage', 'sessionStorage', 'header']),\n cookiesAttributesSchema,\n storageAttributesSchema,\n z.array(\n z.union([\n z.enum(['cookie', 'localStorage', 'sessionStorage', 'header']),\n cookiesAttributesSchema,\n storageAttributesSchema,\n ])\n ),\n]);\n\nexport const rewriteRuleSchema = z.object({\n canonical: z.string(),\n localized: z.record(z.string(), z.string()),\n});\n\nexport const rewriteRulesSchema = z.object({\n rules: z.array(rewriteRuleSchema),\n});\n\nexport const rewriteObjectSchema = z.object({\n url: rewriteRulesSchema,\n nextjs: rewriteRulesSchema.optional(),\n vite: rewriteRulesSchema.optional(),\n});\n\nexport const routingSchema = z.object({\n rewrite: z\n .union([\n z.record(z.string(), z.record(z.string(), z.string())),\n rewriteObjectSchema,\n ])\n .optional(),\n mode: z\n .enum(['prefix-no-default', 'prefix-all', 'no-prefix', 'search-params'])\n .optional(),\n storage: storageSchema.optional(),\n basePath: z.string().optional(),\n});\n\nexport const systemSchema = z.object({\n baseDir: z.string().optional(),\n moduleAugmentationDir: z.string().optional(),\n unmergedDictionariesDir: z.string().optional(),\n remoteDictionariesDir: z.string().optional(),\n dictionariesDir: z.string().optional(),\n dynamicDictionariesDir: z.string().optional(),\n fetchDictionariesDir: z.string().optional(),\n typesDir: z.string().optional(),\n mainDir: z.string().optional(),\n configDir: z.string().optional(),\n cacheDir: z.string().optional(),\n tempDir: z.string().optional(),\n});\n\nexport const contentSchema = z.object({\n fileExtensions: z.array(z.string()).optional(),\n contentDir: z.array(z.string()).optional(),\n codeDir: z.array(z.string()).optional(),\n excludedPath: z.array(z.string()).optional(),\n watch: z.boolean().optional(),\n formatCommand: z.string().optional(),\n});\n\nexport const editorSchema = z.object({\n applicationURL: z.union([z.url(), z.literal('')]).optional(),\n editorURL: z.union([z.url(), z.literal('')]).optional(),\n cmsURL: z.union([z.url(), z.literal('')]).optional(),\n backendURL: z.union([z.url(), z.literal('')]).optional(),\n port: z.number().int().positive().max(65535).optional(),\n enabled: z.boolean().optional(),\n clientId: z.string().optional(),\n clientSecret: z.string().optional(),\n dictionaryPriorityStrategy: z\n .enum(['local_first', 'distant_first'])\n .optional(),\n liveSync: z.boolean().optional(),\n liveSyncPort: z.number().int().positive().max(65535).optional(),\n liveSyncURL: z.union([z.url(), z.literal('')]).optional(),\n});\n\nexport const logSchema = z.object({\n mode: z.enum(['default', 'verbose', 'disabled']).optional(),\n prefix: z.string().optional(),\n error: z.function().optional(),\n log: z.function().optional(),\n info: z.function().optional(),\n warn: z.function().optional(),\n});\n\nexport const aiSchema = z.object({\n provider: z.enum(AiProviders).optional(),\n apiKey: z.string().optional(),\n model: z.string().optional(),\n temperature: z.number().min(0).max(2).optional(),\n applicationContext: z.string().optional(),\n baseURL: z.url().optional(),\n dataSerialization: z.enum(['json', 'toon']).optional(),\n});\n\nexport const buildSchema = z.object({\n mode: z.enum(['auto', 'manual']).optional(),\n optimize: z.boolean().optional(),\n importMode: z.enum(['static', 'dynamic', 'fetch']).optional(),\n traversePattern: z.array(z.string()).optional(),\n outputFormat: z.array(z.enum(['cjs', 'esm'])).optional(),\n cache: z.boolean().optional(),\n require: z.unknown().optional(),\n checkTypes: z.boolean().optional(),\n});\n\nexport const compilerSchema = z.object({\n enabled: z.union([z.boolean(), z.literal('build-only')]).optional(),\n dictionaryKeyPrefix: z.string().optional(),\n transformPattern: z.union([z.string(), z.array(z.string())]).optional(),\n excludePattern: z.union([z.string(), z.array(z.string())]).optional(),\n output: z.unknown().optional(),\n noMetadata: z.boolean().optional(),\n saveComponents: z.boolean().optional(),\n});\n\nexport const dictionarySchema = z.object({\n fill: z.unknown().optional(),\n contentAutoTransformation: z\n .union([\n z.boolean(),\n z.object({\n markdown: z.boolean().optional(),\n html: z.boolean().optional(),\n insertion: z.boolean().optional(),\n }),\n ])\n .optional(),\n location: z.string().optional(),\n locale: z.string().optional(),\n title: z.string().optional(),\n});\n\nexport const intlayerConfigSchema = z.object({\n internationalization: internationalizationSchema.optional(),\n routing: routingSchema.optional(),\n content: contentSchema.optional(),\n system: systemSchema.optional(),\n editor: editorSchema.optional(),\n log: logSchema.optional(),\n ai: aiSchema.optional(),\n build: buildSchema.optional(),\n compiler: compilerSchema.optional(),\n dictionary: dictionarySchema.optional(),\n plugins: z.array(z.unknown()).optional(),\n schemas: z.record(z.string(), z.unknown()).optional(),\n metadata: z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n doc: z.string().optional(),\n })\n .optional(),\n});\n"],"mappings":"6JAGA,MAAa,EAA6BA,EAAAA,EAAE,OAAO,CACjD,QAASA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CACnC,gBAAiBA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,QAAQ,CAAC,CAAC,UAAU,CAC/C,WAAYA,EAAAA,EAAE,KAAK,CAAC,SAAU,YAAa,QAAQ,CAAC,CAAC,UAAU,CAC/D,cAAeA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CACrC,CAAC,CAEW,EAA0BA,EAAAA,EAAE,OAAO,CAC9C,KAAMA,EAAAA,EAAE,QAAQ,SAAS,CACzB,KAAMA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,OAAQA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC7B,KAAMA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,OAAQA,EAAAA,EAAE,SAAS,CAAC,UAAU,CAC9B,SAAUA,EAAAA,EAAE,SAAS,CAAC,UAAU,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U,CACvB,MAAO,EAAY,UAAU,CAC7B,SAAU,EAAe,UAAU,CACnC,WAAY,EAAiB,UAAU,CACvC,QAASA,EAAAA,EAAE,MAAMA,EAAAA,EAAE,SAAS,CAAC,CAAC,UAAU,CACxC,QAASA,EAAAA,EAAE,OAAOA,EAAAA,EAAE,QAAQ,CAAEA,EAAAA,EAAE,SAAS,CAAC,CAAC,UAAU,CACrD,SAAUA,EAAAA,EACP,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,QAASA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC9B,IAAKA,EAAAA,EAAE,QAAQ,CAAC,UAAU,CAC3B,CAAC,CACD,UAAU,CACd,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-D-qHiVGv.cjs`);const e=require(`../utils/cacheMemory.cjs`),t=require(`../utils/getPackageJsonPath.cjs`),n=require(`./buildConfigurationFields.cjs`),r=require(`./loadConfigurationFile.cjs`),i=require(`./searchConfigurationFile.cjs`);let a=require(`defu`);const o=o=>{let s;try{s=o?.baseDir??t.getPackageJsonPath().baseDir}catch{return{configuration:n.buildConfigurationFields({},o?.baseDir,o?.logFunctions),customConfiguration:void 0,numCustomConfiguration:0,configurationFilePath:void 0}}let c=e.cacheMemory.get(o);if(c)return c;let{configurationFilePath:l,numCustomConfiguration:u}=i.searchConfigurationFile(s),d,f;l?(f=r.loadConfigurationFile(l,{projectRequire:o?.require,envVarOptions:{env:o?.env,envFile:o?.envFile},additionalEnvVars:o?.additionalEnvVars,aliases:o?.aliases,buildOptions:o?.buildOptions}),d=n.buildConfigurationFields(f,o?.baseDir,o?.logFunctions)):d=n.buildConfigurationFields({},o?.baseDir,o?.logFunctions);let p=(0,a.defu)(o?.require?{build:{require:o?.require,cache:o?.cache}}:{},d),m=(0,a.defu)(o?.override??{},p);return e.cacheMemory.set(o,{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}),{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}},s=e=>o(e).configuration;exports.getConfiguration=s,exports.getConfigurationAndFilePath=o;
|
|
2
2
|
//# sourceMappingURL=getConfiguration.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.cjs","names":["getPackageJsonPath","buildConfigurationFields","cacheMemory","searchConfigurationFile","loadConfigurationFile"],"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import type {\n CustomIntlayerConfig,\n IntlayerConfig,\n LogFunctions,\n} from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { SandBoxContextOptions } from '../loadExternalFile/parseFileContent';\nimport { cacheMemory } from '../utils/cacheMemory';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n // Dotenv options\n env?: string;\n envFile?: string;\n // Log functions\n logFunctions?: LogFunctions;\n // Require function\n require?: NodeJS.Require;\n // cache\n cache?: boolean;\n} & Omit<SandBoxContextOptions, 'projectRequire'>;\n\nexport type GetConfigurationAndFilePathResult = {\n configuration: IntlayerConfig;\n customConfiguration: CustomIntlayerConfig | undefined;\n numCustomConfiguration: number;\n configurationFilePath: string | undefined;\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfigurationAndFilePath = (\n options?: GetConfigurationOptions\n): GetConfigurationAndFilePathResult => {\n let baseDir: string | undefined;\n\n try {\n // Can fail in some environments (e.g. MCP server, VScode extension)\n baseDir = options?.baseDir ?? getPackageJsonPath().baseDir;\n } catch (_err) {\n // Return default config if the package.json is not found\n return {\n configuration: buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n ),\n customConfiguration: undefined,\n numCustomConfiguration: 0,\n configurationFilePath: undefined,\n };\n }\n\n const cachedConfiguration =\n cacheMemory.get<GetConfigurationAndFilePathResult>(options);\n\n if (cachedConfiguration) return cachedConfiguration;\n\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n let storedConfiguration: IntlayerConfig;\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n // Load the custom configuration\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n projectRequire: options?.require,\n // Dotenv options\n envVarOptions: {\n env: options?.env,\n envFile: options?.envFile,\n },\n // Sandbox context additional variables\n additionalEnvVars: options?.additionalEnvVars,\n aliases: options?.aliases,\n });\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n options?.baseDir,\n options?.logFunctions\n );\n } else {\n // No configuration file found, use default configuration\n storedConfiguration = buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n );\n }\n\n // Log warning if multiple configuration files are found\n const projectRequireConfig: CustomIntlayerConfig = options?.require\n ? {\n build: {\n require: options?.require,\n cache: options?.cache,\n },\n }\n : {};\n\n const configWithProjectRequire = defu(\n projectRequireConfig,\n storedConfiguration\n ) as IntlayerConfig;\n\n const configuration = defu(\n options?.override ?? {},\n configWithProjectRequire\n ) as IntlayerConfig;\n\n cacheMemory.set(options, {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n });\n\n return {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n };\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => getConfigurationAndFilePath(options).configuration;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getConfiguration.cjs","names":["getPackageJsonPath","buildConfigurationFields","cacheMemory","searchConfigurationFile","loadConfigurationFile"],"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import type {\n CustomIntlayerConfig,\n IntlayerConfig,\n LogFunctions,\n} from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { LoadExternalFileOptions } from '../loadExternalFile/loadExternalFile';\nimport type { SandBoxContextOptions } from '../loadExternalFile/parseFileContent';\nimport { cacheMemory } from '../utils/cacheMemory';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n // Dotenv options\n env?: string;\n envFile?: string;\n // Log functions\n logFunctions?: LogFunctions;\n // Require function\n require?: NodeJS.Require;\n // cache\n cache?: boolean;\n // Build options for TypeScript transpilation (e.g. custom esbuild instance)\n buildOptions?: LoadExternalFileOptions['buildOptions'];\n} & Omit<SandBoxContextOptions, 'projectRequire'>;\n\nexport type GetConfigurationAndFilePathResult = {\n configuration: IntlayerConfig;\n customConfiguration: CustomIntlayerConfig | undefined;\n numCustomConfiguration: number;\n configurationFilePath: string | undefined;\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfigurationAndFilePath = (\n options?: GetConfigurationOptions\n): GetConfigurationAndFilePathResult => {\n let baseDir: string | undefined;\n\n try {\n // Can fail in some environments (e.g. MCP server, VScode extension)\n baseDir = options?.baseDir ?? getPackageJsonPath().baseDir;\n } catch (_err) {\n // Return default config if the package.json is not found\n return {\n configuration: buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n ),\n customConfiguration: undefined,\n numCustomConfiguration: 0,\n configurationFilePath: undefined,\n };\n }\n\n const cachedConfiguration =\n cacheMemory.get<GetConfigurationAndFilePathResult>(options);\n\n if (cachedConfiguration) return cachedConfiguration;\n\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n let storedConfiguration: IntlayerConfig;\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n // Load the custom configuration\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n projectRequire: options?.require,\n // Dotenv options\n envVarOptions: {\n env: options?.env,\n envFile: options?.envFile,\n },\n // Sandbox context additional variables\n additionalEnvVars: options?.additionalEnvVars,\n aliases: options?.aliases,\n // Build options for TypeScript transpilation (e.g. custom esbuild instance)\n buildOptions: options?.buildOptions,\n });\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n options?.baseDir,\n options?.logFunctions\n );\n } else {\n // No configuration file found, use default configuration\n storedConfiguration = buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n );\n }\n\n // Log warning if multiple configuration files are found\n const projectRequireConfig: CustomIntlayerConfig = options?.require\n ? {\n build: {\n require: options?.require,\n cache: options?.cache,\n },\n }\n : {};\n\n const configWithProjectRequire = defu(\n projectRequireConfig,\n storedConfiguration\n ) as IntlayerConfig;\n\n const configuration = defu(\n options?.override ?? {},\n configWithProjectRequire\n ) as IntlayerConfig;\n\n cacheMemory.set(options, {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n });\n\n return {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n };\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => getConfigurationAndFilePath(options).configuration;\n"],"mappings":"mVAwCA,MAAa,EACX,GACsC,CACtC,IAAI,EAEJ,GAAI,CAEF,EAAU,GAAS,SAAWA,EAAAA,oBAAoB,CAAC,aACtC,CAEb,MAAO,CACL,cAAeC,EAAAA,yBACb,EAAE,CACF,GAAS,QACT,GAAS,aACV,CACD,oBAAqB,IAAA,GACrB,uBAAwB,EACxB,sBAAuB,IAAA,GACxB,CAGH,IAAM,EACJC,EAAAA,YAAY,IAAuC,EAAQ,CAE7D,GAAI,EAAqB,OAAO,EAGhC,GAAM,CAAE,wBAAuB,0BAC7BC,EAAAA,wBAAwB,EAAQ,CAE9B,EACA,EAEA,GAEF,EAAsBC,EAAAA,sBAAsB,EAAuB,CACjE,eAAgB,GAAS,QAEzB,cAAe,CACb,IAAK,GAAS,IACd,QAAS,GAAS,QACnB,CAED,kBAAmB,GAAS,kBAC5B,QAAS,GAAS,QAElB,aAAc,GAAS,aACxB,CAAC,CAGF,EAAsBH,EAAAA,yBACpB,EACA,GAAS,QACT,GAAS,aACV,EAGD,EAAsBA,EAAAA,yBACpB,EAAE,CACF,GAAS,QACT,GAAS,aACV,CAaH,IAAM,GAAA,EAAA,EAAA,MAT6C,GAAS,QACxD,CACE,MAAO,CACL,QAAS,GAAS,QAClB,MAAO,GAAS,MACjB,CACF,CACD,EAAE,CAIJ,EACD,CAEK,GAAA,EAAA,EAAA,MACJ,GAAS,UAAY,EAAE,CACvB,EACD,CASD,OAPA,EAAA,YAAY,IAAI,EAAS,CACvB,gBACA,sBACA,yBACA,wBACD,CAAC,CAEK,CACL,gBACA,sBACA,yBACA,wBACD,EAMU,EACX,GACmB,EAA4B,EAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-D-qHiVGv.cjs`);const e=require(`../logger.cjs`),t=require(`../utils/getPackageJsonPath.cjs`);let n=require(`node:fs`),r=require(`node:path`);const i=[`intlayer.config.ts`,`intlayer.config.js`,`intlayer.config.json`,`intlayer.config.json5`,`intlayer.config.jsonc`,`intlayer.config.cjs`,`intlayer.config.mjs`,`.intlayerrc`],a=new Map,o=o=>{let s,c=0;if(a.has(o))return a.get(o);let{baseDir:l}=t.getPackageJsonPath(o);for(let t of i)try{let e=(0,r.resolve)(l,t);(0,n.existsSync)(e)&&(c+=1,s||=e)}catch(n){e.logger(`${t}: ${n}`,{level:`error`})}return{configurationFilePath:s,numCustomConfiguration:c}};exports.configurationFilesCandidates=i,exports.searchConfigurationFile=o;
|
|
2
2
|
//# sourceMappingURL=searchConfigurationFile.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchConfigurationFile.cjs","names":["getPackageJsonPath"],"sources":["../../../src/configFile/searchConfigurationFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { logger } from '../logger';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\n\nexport const configurationFilesCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.js',\n 'intlayer.config.json',\n 'intlayer.config.json5',\n 'intlayer.config.jsonc',\n 'intlayer.config.cjs',\n 'intlayer.config.mjs',\n '.intlayerrc',\n] as const;\n\ntype SearchConfigurationFileResult = {\n configurationFilePath?: string;\n numCustomConfiguration: number;\n};\n\n/**\n * Search for the configuration file in the given path\n *\n * List of detected configuration files:\n * - intlayer.config.ts\n * - intlayer.config.js\n * - intlayer.config.json\n * - intlayer.config.cjs\n * - intlayer.config.mjs\n * - .intlayerrc\n */\nexport const searchConfigurationFile = (\n startDir: string\n): SearchConfigurationFileResult => {\n let configurationFilePath: string | undefined;\n let numCustomConfiguration = 0;\n\n const { baseDir } = getPackageJsonPath(startDir);\n\n for (const fileName of configurationFilesCandidates) {\n try {\n const filePath = resolve(baseDir, fileName);\n\n // Check if the file exists\n if (!existsSync(filePath)) {\n } else {\n numCustomConfiguration += 1;\n\n if (!configurationFilePath) {\n configurationFilePath = filePath;\n }\n }\n } catch (error) {\n // Return \"Cannot use import statement outside a module\"\n logger(`${fileName}: ${error as string}`, { level: 'error' });\n }\n }\n\n return { configurationFilePath, numCustomConfiguration };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"searchConfigurationFile.cjs","names":["getPackageJsonPath"],"sources":["../../../src/configFile/searchConfigurationFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { logger } from '../logger';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\n\nexport const configurationFilesCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.js',\n 'intlayer.config.json',\n 'intlayer.config.json5',\n 'intlayer.config.jsonc',\n 'intlayer.config.cjs',\n 'intlayer.config.mjs',\n '.intlayerrc',\n] as const;\n\ntype SearchConfigurationFileResult = {\n configurationFilePath?: string;\n numCustomConfiguration: number;\n};\n\n// CACHE: Store results to avoid re-walking the file system for the same path\nconst rootPathCache = new Map<string, SearchConfigurationFileResult>();\n\n/**\n * Search for the configuration file in the given path\n *\n * List of detected configuration files:\n * - intlayer.config.ts\n * - intlayer.config.js\n * - intlayer.config.json\n * - intlayer.config.cjs\n * - intlayer.config.mjs\n * - .intlayerrc\n */\nexport const searchConfigurationFile = (\n startDir: string\n): SearchConfigurationFileResult => {\n let configurationFilePath: string | undefined;\n let numCustomConfiguration = 0;\n\n // OPTIMIZATION: Return cached result immediately\n if (rootPathCache.has(startDir)) {\n return rootPathCache.get(startDir) as SearchConfigurationFileResult;\n }\n\n const { baseDir } = getPackageJsonPath(startDir);\n\n for (const fileName of configurationFilesCandidates) {\n try {\n const filePath = resolve(baseDir, fileName);\n\n // Check if the file exists\n if (!existsSync(filePath)) {\n } else {\n numCustomConfiguration += 1;\n\n if (!configurationFilePath) {\n configurationFilePath = filePath;\n }\n }\n } catch (error) {\n // Return \"Cannot use import statement outside a module\"\n logger(`${fileName}: ${error as string}`, { level: 'error' });\n }\n }\n\n return { configurationFilePath, numCustomConfiguration };\n};\n"],"mappings":"kOAKA,MAAa,EAA+B,CAC1C,qBACA,qBACA,uBACA,wBACA,wBACA,sBACA,sBACA,cACD,CAQK,EAAgB,IAAI,IAab,EACX,GACkC,CAClC,IAAI,EACA,EAAyB,EAG7B,GAAI,EAAc,IAAI,EAAS,CAC7B,OAAO,EAAc,IAAI,EAAS,CAGpC,GAAM,CAAE,WAAYA,EAAAA,mBAAmB,EAAS,CAEhD,IAAK,IAAM,KAAY,EACrB,GAAI,CACF,IAAM,GAAA,EAAA,EAAA,SAAmB,EAAS,EAAS,EAGvC,EAAA,EAAA,YAAY,EAAS,GAEvB,GAA0B,EAE1B,AACE,IAAwB,SAGrB,EAAO,CAEd,EAAA,OAAO,GAAG,EAAS,IAAI,IAAmB,CAAE,MAAO,QAAS,CAAC,CAIjE,MAAO,CAAE,wBAAuB,yBAAwB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({BUILD_MODE:()=>t,CACHE:()=>!0,OPTIMIZE:()=>void 0,OUTPUT_FORMAT:()=>r,TRAVERSE_PATTERN:()=>n,TYPE_CHECKING:()=>!1});const t=`auto`,n=[`**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}`,`!**/node_modules/**`,`!**/dist/**`,`!**/build/**`,`!**/.intlayer/**`,`!**/.next/**`,`!**/.nuxt/**`,`!**/.expo/**`,`!**/.vercel/**`,`!**/.turbo/**`,`!**/.tanstack/**`,`!**/*.config.*`,`!**/*.test.*`,`!**/*.spec.*`,`!**/*.stories.*`,`!**/*.d.ts`,`!**/*.d.ts.map`],r=[`esm`,`cjs`];exports.BUILD_MODE=t,exports.CACHE=!0,exports.OPTIMIZE=void 0,exports.OUTPUT_FORMAT=r,exports.TRAVERSE_PATTERN=n,exports.TYPE_CHECKING=!1,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=build.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.cjs","names":[],"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const BUILD_MODE = 'auto';\n\nexport const OPTIMIZE = undefined;\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}',\n\n '!**/node_modules/**',\n '!**/dist/**',\n '!**/build/**',\n '!**/.intlayer/**',\n '!**/.next/**',\n '!**/.nuxt/**',\n '!**/.expo/**',\n '!**/.vercel/**',\n '!**/.turbo/**',\n '!**/.tanstack/**',\n\n '!**/*.config.*',\n '!**/*.test.*',\n '!**/*.spec.*',\n '!**/*.stories.*',\n '!**/*.d.ts',\n '!**/*.d.ts.map',\n];\n\nexport const OUTPUT_FORMAT: ('cjs' | 'esm')[] = ['esm', 'cjs'];\n\nexport const CACHE = true;\n\nexport const TYPE_CHECKING = false;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.cjs","names":[],"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const BUILD_MODE = 'auto';\n\nexport const OPTIMIZE = undefined;\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}',\n\n '!**/node_modules/**',\n '!**/dist/**',\n '!**/build/**',\n '!**/.intlayer/**',\n '!**/.next/**',\n '!**/.nuxt/**',\n '!**/.expo/**',\n '!**/.vercel/**',\n '!**/.turbo/**',\n '!**/.tanstack/**',\n\n '!**/*.config.*',\n '!**/*.test.*',\n '!**/*.spec.*',\n '!**/*.stories.*',\n '!**/*.d.ts',\n '!**/*.d.ts.map',\n];\n\nexport const OUTPUT_FORMAT: ('cjs' | 'esm')[] = ['esm', 'cjs'];\n\nexport const CACHE = true;\n\nexport const TYPE_CHECKING = false;\n"],"mappings":"iOAAA,MAAa,EAAa,OAIb,EAAmB,CAC9B,+CAEA,sBACA,cACA,eACA,mBACA,eACA,eACA,eACA,iBACA,gBACA,mBAEA,iBACA,eACA,eACA,kBACA,aACA,iBACD,CAEY,EAAmC,CAAC,MAAO,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({COMPILER_DICTIONARY_KEY_PREFIX:()=>``,COMPILER_ENABLED:()=>!0,COMPILER_NO_METADATA:()=>!1,COMPILER_SAVE_COMPONENTS:()=>!1});exports.COMPILER_DICTIONARY_KEY_PREFIX=``,exports.COMPILER_ENABLED=!0,exports.COMPILER_NO_METADATA=!1,exports.COMPILER_SAVE_COMPONENTS=!1,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=compiler.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({CODE_DIR:()=>i,CONTENT_DIR:()=>r,EXCLUDED_PATHS:()=>n,FILE_EXTENSIONS:()=>t,I18NEXT_DICTIONARIES_DIR:()=>a,REACT_INTL_MESSAGES_DIR:()=>o,WATCH:()=>!0});const t=[`.content.ts`,`.content.js`,`.content.cjs`,`.content.mjs`,`.content.json`,`.content.json5`,`.content.jsonc`,`.content.tsx`,`.content.jsx`],n=[`**/node_modules/**`,`**/dist/**`,`**/build/**`,`**/.intlayer/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`],r=[`.`],i=[`.`],a=`i18next_resources`,o=`intl_messages`;exports.CODE_DIR=i,exports.CONTENT_DIR=r,exports.EXCLUDED_PATHS=n,exports.FILE_EXTENSIONS=t,exports.I18NEXT_DICTIONARIES_DIR=a,exports.REACT_INTL_MESSAGES_DIR=o,exports.WATCH=!0,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=content.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.cjs","names":[],"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["export const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.json5',\n '.content.jsonc',\n '.content.tsx',\n '.content.jsx',\n];\n\nexport const EXCLUDED_PATHS = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.intlayer/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const CODE_DIR = ['.'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const WATCH = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.cjs","names":[],"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["export const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.json5',\n '.content.jsonc',\n '.content.tsx',\n '.content.jsx',\n];\n\nexport const EXCLUDED_PATHS = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.intlayer/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const CODE_DIR = ['.'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const WATCH = true;\n"],"mappings":"qQAAA,MAAa,EAAkB,CAC7B,cACA,cACA,eACA,eACA,gBACA,iBACA,iBACA,eACA,eACD,CAEY,EAAiB,CAC5B,qBACA,aACA,cACA,kBACA,cACA,cACA,cACA,gBACA,eACA,kBACD,CAEY,EAAc,CAAC,IAAI,CAEnB,EAAW,CAAC,IAAI,CAEhB,EAA2B,oBAE3B,EAA0B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({CONTENT_AUTO_TRANSFORMATION:()=>!1,FILL:()=>!0,IMPORT_MODE:()=>n,LOCATION:()=>t});const t=`local`,n=`static`;exports.CONTENT_AUTO_TRANSFORMATION=!1,exports.FILL=!0,exports.IMPORT_MODE=n,exports.LOCATION=t,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=dictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.cjs","names":[],"sources":["../../../src/defaultValues/dictionary.ts"],"sourcesContent":["import type { DictionaryLocation } from '@intlayer/types/dictionary';\n\nexport const FILL = true;\nexport const LOCATION: DictionaryLocation = 'local';\nexport const CONTENT_AUTO_TRANSFORMATION = false;\nexport const IMPORT_MODE = 'static';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.cjs","names":[],"sources":["../../../src/defaultValues/dictionary.ts"],"sourcesContent":["import type { DictionaryLocation } from '@intlayer/types/dictionary';\n\nexport const FILL = true;\nexport const LOCATION: DictionaryLocation = 'local';\nexport const CONTENT_AUTO_TRANSFORMATION = false;\nexport const IMPORT_MODE = 'static';\n"],"mappings":"+LAEA,MACa,EAA+B,QAE/B,EAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({APPLICATION_URL:()=>void 0,BACKEND_URL:()=>r,CMS_URL:()=>n,DICTIONARY_PRIORITY_STRATEGY:()=>a,EDITOR_URL:()=>t,IS_ENABLED:()=>!1,LIVE_SYNC:()=>!0,LIVE_SYNC_PORT:()=>o,PORT:()=>i});const t=`http://localhost:8000`,n=`https://app.intlayer.org`,r=`https://back.intlayer.org`,i=8e3,a=`local_first`,o=4e3;exports.APPLICATION_URL=void 0,exports.BACKEND_URL=r,exports.CMS_URL=n,exports.DICTIONARY_PRIORITY_STRATEGY=a,exports.EDITOR_URL=t,exports.IS_ENABLED=!1,exports.LIVE_SYNC=!0,exports.LIVE_SYNC_PORT=o,exports.PORT=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=editor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.cjs","names":[],"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = undefined;\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://app.intlayer.org';\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const PORT = 8000;\nexport const IS_ENABLED = false;\nexport const LIVE_SYNC = true;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\nexport const LIVE_SYNC_PORT = 4000;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.cjs","names":[],"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = undefined;\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://app.intlayer.org';\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const PORT = 8000;\nexport const IS_ENABLED = false;\nexport const LIVE_SYNC = true;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\nexport const LIVE_SYNC_PORT = 4000;\n"],"mappings":"iSAAA,MACa,EAAa,wBACb,EAAU,2BACV,EAAc,4BACd,EAAO,IAGP,EAA+B,cAC/B,EAAiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-D-qHiVGv.cjs`),t=require(`./build.cjs`),n=require(`./compiler.cjs`),r=require(`./content.cjs`),i=require(`./dictionary.cjs`),a=require(`./editor.cjs`),o=require(`./internationalization.cjs`),s=require(`./log.cjs`),c=require(`./routing.cjs`),l=require(`./system.cjs`);var u=e.t({Build:()=>t.t,Compiler:()=>n.t,Content:()=>r.t,Dictionary:()=>i.t,Editor:()=>a.t,Internationalization:()=>o.t,Log:()=>s.t,Routing:()=>c.t,System:()=>l.t});Object.defineProperty(exports,`Build`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`Compiler`,{enumerable:!0,get:function(){return n.t}}),Object.defineProperty(exports,`Content`,{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,`Dictionary`,{enumerable:!0,get:function(){return i.t}}),Object.defineProperty(exports,`Editor`,{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,`Internationalization`,{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,`Log`,{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,`Routing`,{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,`System`,{enumerable:!0,get:function(){return l.t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-D-qHiVGv.cjs`);let t=require(`@intlayer/types/locales`);var n=e.t({DEFAULT_LOCALE:()=>a,LOCALES:()=>r,REQUIRED_LOCALES:()=>i,STRICT_MODE:()=>o});const r=[t.ENGLISH],i=[],a=t.ENGLISH,o=`inclusive`;exports.DEFAULT_LOCALE=a,exports.LOCALES=r,exports.REQUIRED_LOCALES=i,exports.STRICT_MODE=o,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
2
2
|
//# sourceMappingURL=internationalization.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internationalization.cjs","names":["
|
|
1
|
+
{"version":3,"file":"internationalization.cjs","names":["ENGLISH"],"sources":["../../../src/defaultValues/internationalization.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { StrictMode } from '@intlayer/types/config';\nimport { ENGLISH } from '@intlayer/types/locales';\n\nexport const LOCALES: Locale[] = [ENGLISH];\n\nexport const REQUIRED_LOCALES: Locale[] = [];\n\nexport const DEFAULT_LOCALE: Locale = ENGLISH;\n\nexport const STRICT_MODE: StrictMode = 'inclusive';\n"],"mappings":"8OAIA,MAAa,EAAoB,CAACA,EAAAA,QAAQ,CAE7B,EAA6B,EAAE,CAE/B,EAAyBA,EAAAA,QAEzB,EAA0B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-D-qHiVGv.cjs`),t=require(`../logger.cjs`);var n=e.t({MODE:()=>r,PREFIX:()=>i});const r=`default`,i=`${t.ANSIColors.GREY_DARK}[intlayer] ${t.ANSIColors.RESET}`;exports.MODE=r,exports.PREFIX=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
2
2
|
//# sourceMappingURL=log.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.cjs","names":["ANSIColors"],"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["import { ANSIColors } from '../logger';\n\nexport const MODE = 'default';\n\nexport const PREFIX = `${ANSIColors.GREY_DARK}[intlayer] ${ANSIColors.RESET}`;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.cjs","names":["ANSIColors"],"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["import { ANSIColors } from '../logger';\n\nexport const MODE = 'default';\n\nexport const PREFIX = `${ANSIColors.GREY_DARK}[intlayer] ${ANSIColors.RESET}`;\n"],"mappings":"4KAEA,MAAa,EAAO,UAEP,EAAS,GAAGA,EAAAA,WAAW,UAAU,aAAaA,EAAAA,WAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({BASE_PATH:()=>``,COOKIE_NAME:()=>n,HEADER_NAME:()=>t,LOCALE_STORAGE_NAME:()=>r,ROUTING_MODE:()=>a,SERVER_SET_COOKIE:()=>i,STORAGE:()=>o});const t=`x-intlayer-locale`,n=`INTLAYER_LOCALE`,r=`INTLAYER_LOCALE`,i=`always`,a=`prefix-no-default`,o=[`cookie`,`header`];exports.BASE_PATH=``,exports.COOKIE_NAME=n,exports.HEADER_NAME=t,exports.LOCALE_STORAGE_NAME=r,exports.ROUTING_MODE=a,exports.SERVER_SET_COOKIE=i,exports.STORAGE=o,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=routing.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.cjs","names":[],"sources":["../../../src/defaultValues/routing.ts"],"sourcesContent":["import type { RoutingConfig } from '@intlayer/types/config';\n\nexport const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\nexport const LOCALE_STORAGE_NAME = 'INTLAYER_LOCALE';\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const ROUTING_MODE = 'prefix-no-default';\n\nexport const STORAGE: RoutingConfig['storage'] = ['cookie', 'header'];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"routing.cjs","names":[],"sources":["../../../src/defaultValues/routing.ts"],"sourcesContent":["import type { RoutingConfig } from '@intlayer/types/config';\n\nexport const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\nexport const LOCALE_STORAGE_NAME = 'INTLAYER_LOCALE';\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const ROUTING_MODE = 'prefix-no-default';\n\nexport const STORAGE: RoutingConfig['storage'] = ['cookie', 'header'];\n"],"mappings":"uPAEA,MAAa,EAAc,oBAEd,EAAc,kBACd,EAAsB,kBAItB,EAAoB,SAEpB,EAAe,oBAEf,EAAoC,CAAC,SAAU,SAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require(`../chunk-D-qHiVGv.cjs`).t({CACHE_DIR:()=>d,CONFIG_DIR:()=>u,DICTIONARIES_DIR:()=>n,DYNAMIC_DICTIONARIES_DIR:()=>o,FETCH_DICTIONARIES_DIR:()=>s,MAIN_DIR:()=>t,MASKS_DIR:()=>r,MODULE_AUGMENTATION_DIR:()=>l,REMOTE_DICTIONARIES_DIR:()=>i,TEMP_DIR:()=>f,TYPES_DIR:()=>c,UNMERGED_DICTIONARIES_DIR:()=>a});const t=`.intlayer/main`,n=`.intlayer/dictionary`,r=`.intlayer/mask`,i=`.intlayer/remote_dictionary`,a=`.intlayer/unmerged_dictionary`,o=`.intlayer/dynamic_dictionary`,s=`.intlayer/fetch_dictionary`,c=`.intlayer/types`,l=`.intlayer/types`,u=`.intlayer/config`,d=`.intlayer/cache`,f=`.intlayer/tmp`;exports.CACHE_DIR=d,exports.CONFIG_DIR=u,exports.DICTIONARIES_DIR=n,exports.DYNAMIC_DICTIONARIES_DIR=o,exports.FETCH_DICTIONARIES_DIR=s,exports.MAIN_DIR=t,exports.MASKS_DIR=r,exports.MODULE_AUGMENTATION_DIR=l,exports.REMOTE_DICTIONARIES_DIR=i,exports.TEMP_DIR=f,exports.TYPES_DIR=c,exports.UNMERGED_DICTIONARIES_DIR=a,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
2
2
|
//# sourceMappingURL=system.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.cjs","names":[],"sources":["../../../src/defaultValues/system.ts"],"sourcesContent":["export const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const MASKS_DIR = '.intlayer/mask';\n\nexport const REMOTE_DICTIONARIES_DIR = '.intlayer/remote_dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const FETCH_DICTIONARIES_DIR = '.intlayer/fetch_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const CACHE_DIR = '.intlayer/cache';\n\nexport const TEMP_DIR = '.intlayer/tmp';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"system.cjs","names":[],"sources":["../../../src/defaultValues/system.ts"],"sourcesContent":["export const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const MASKS_DIR = '.intlayer/mask';\n\nexport const REMOTE_DICTIONARIES_DIR = '.intlayer/remote_dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const FETCH_DICTIONARIES_DIR = '.intlayer/fetch_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const CACHE_DIR = '.intlayer/cache';\n\nexport const TEMP_DIR = '.intlayer/tmp';\n"],"mappings":"6XAAA,MAAa,EAAW,iBAEX,EAAmB,uBAEnB,EAAY,iBAEZ,EAA0B,8BAE1B,EAA4B,gCAE5B,EAA2B,+BAE3B,EAAyB,6BAEzB,EAAY,kBAEZ,EAA0B,kBAE1B,EAAa,mBAEb,EAAY,kBAEZ,EAAW"}
|
package/dist/cjs/loadEnvFile.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-D-qHiVGv.cjs`);let t=require(`node:fs`),n=require(`dotenv`);n=e.n(n);const r=process.env.NODE_ENV??`development`,i=(e=process.env.NODE_ENV??`development`,n)=>(n?[n]:[`.env.${e}.local`,`.env.${e}`,`.env.local`,`.env`]).find(t.existsSync),a=e=>{let t=i(e?.env??r,e?.envFile);if(!t)return{};let a={};return n.default.config({path:t,processEnv:a,quiet:!0}),a};exports.getEnvFilePath=i,exports.loadEnvFile=a;
|
|
2
2
|
//# sourceMappingURL=loadEnvFile.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadEnvFile.cjs","names":["existsSync"],"sources":["../../src/loadEnvFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport dotenv from 'dotenv';\n\nconst DEFAULT_ENV = process.env.NODE_ENV ?? 'development';\n\nexport type LoadEnvFileOptions = {\n env?: string;\n envFile?: string;\n};\n\nexport const getEnvFilePath = (\n env: string = process.env.NODE_ENV ?? 'development',\n envFile?: string\n): string | undefined => {\n const envFiles = envFile\n ? [envFile]\n : [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'];\n\n return envFiles.find(existsSync); // Returns the first existing env file\n};\n\nexport const loadEnvFile = (options?: Partial<LoadEnvFileOptions>) => {\n const env = options?.env ?? DEFAULT_ENV;\n\n const envFiles = getEnvFilePath(env, options?.envFile);\n\n if (!envFiles) {\n return {};\n }\n\n const result = {};\n\n dotenv.config({\n path: envFiles,\n processEnv: result,\n quiet: true,\n });\n\n return result; // Return the parsed env object\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadEnvFile.cjs","names":["existsSync"],"sources":["../../src/loadEnvFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport dotenv from 'dotenv';\n\nconst DEFAULT_ENV = process.env.NODE_ENV ?? 'development';\n\nexport type LoadEnvFileOptions = {\n env?: string;\n envFile?: string;\n};\n\nexport const getEnvFilePath = (\n env: string = process.env.NODE_ENV ?? 'development',\n envFile?: string\n): string | undefined => {\n const envFiles = envFile\n ? [envFile]\n : [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'];\n\n return envFiles.find(existsSync); // Returns the first existing env file\n};\n\nexport const loadEnvFile = (options?: Partial<LoadEnvFileOptions>) => {\n const env = options?.env ?? DEFAULT_ENV;\n\n const envFiles = getEnvFilePath(env, options?.envFile);\n\n if (!envFiles) {\n return {};\n }\n\n const result = {};\n\n dotenv.config({\n path: envFiles,\n processEnv: result,\n quiet: true,\n });\n\n return result; // Return the parsed env object\n};\n"],"mappings":"iKAGA,MAAM,EAAc,QAAQ,IAAI,UAAY,cAO/B,GACX,EAAc,QAAQ,IAAI,UAAY,cACtC,KAEiB,EACb,CAAC,EAAQ,CACT,CAAC,QAAQ,EAAI,QAAS,QAAQ,IAAO,aAAc,OAAO,EAE9C,KAAKA,EAAAA,WAAW,CAGrB,EAAe,GAA0C,CAGpE,IAAM,EAAW,EAFL,GAAS,KAAO,EAES,GAAS,QAAQ,CAEtD,GAAI,CAAC,EACH,MAAO,EAAE,CAGX,IAAM,EAAS,EAAE,CAQjB,OANA,EAAA,QAAO,OAAO,CACZ,KAAM,EACN,WAAY,EACZ,MAAO,GACR,CAAC,CAEK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-D-qHiVGv.cjs`);let e=require(`node:path`),t=require(`esbuild`),n=require(`node:url`);const r=e=>{switch(e){case`.js`:return`js`;case`.jsx`:return`jsx`;case`.mjs`:return`js`;case`.ts`:return`ts`;case`.tsx`:return`tsx`;case`.cjs`:return`js`;case`.json`:return`json`;case`.md`:return`text`;case`.mdx`:return`text`;default:return`js`}},i=e=>({loader:{".js":`js`,".jsx":`jsx`,".mjs":`js`,".ts":`ts`,".tsx":`tsx`,".cjs":`js`,".json":`json`,".md":`text`,".mdx":`text`},format:`cjs`,target:`node16`,platform:`neutral`,write:!1,packages:`bundle`,external:[`esbuild`],bundle:!0,define:{"import.meta.url":JSON.stringify((0,n.pathToFileURL)(e).href)}}),a=(n,a,o)=>(0,t.buildSync)({stdin:{contents:n,loader:r((0,e.extname)(a)),resolveDir:(0,e.dirname)(a),sourcefile:a},...i(a),...o}).outputFiles?.[0].text,o=async(n,a,o)=>(await(0,t.build)({stdin:{contents:n,loader:r((0,e.extname)(a)),resolveDir:(0,e.dirname)(a),sourcefile:a},...i(a),...o})).outputFiles?.[0].text;exports.bundleFile=o,exports.bundleFileSync=a,exports.getLoader=r;
|
|
2
2
|
//# sourceMappingURL=bundleFile.cjs.map
|