@intlayer/config 8.1.6 → 8.1.8
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/README.md +37 -28
- package/dist/cjs/configFile/buildConfigurationFields.cjs +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/defaultValues/compiler.cjs +1 -1
- package/dist/cjs/defaultValues/compiler.cjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/defaultValues/compiler.mjs +1 -1
- package/dist/esm/defaultValues/compiler.mjs.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/defaultValues/compiler.d.ts +2 -1
- package/dist/types/defaultValues/compiler.d.ts.map +1 -1
- package/package.json +3 -8
package/README.md
CHANGED
|
@@ -46,25 +46,26 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
46
46
|
|
|
47
47
|
## Keys benefits of Intlayer:
|
|
48
48
|
|
|
49
|
-
| Feature | Description
|
|
50
|
-
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more.
|
|
52
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content)
|
|
53
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file)
|
|
54
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
55
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
56
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
57
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
58
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
59
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
60
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
61
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
62
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
63
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
64
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
65
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
66
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
67
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/
|
|
49
|
+
| Feature | Description |
|
|
50
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more. |
|
|
52
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content) |
|
|
53
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file) |
|
|
54
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/compiler.jpg?raw=true" alt="Feature" width="700"> | **Compiler**<br><br>The Intlayer Compiler extract automatically the content from the components and generate the dictionary files.<br><br> - [Compiler](https://intlayer.org/doc/compiler) |
|
|
55
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **Type-Safe Environment**<br><br>Leverage TypeScript to ensure your content definitions and code are error-free, while also benefiting from IDE autocompletion.<br><br> - [TypeScript configuration](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
|
|
56
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **Simplified Setup**<br><br>Get up and running quickly with minimal configuration. Adjust settings for internationalization, routing, AI, build, and content handling with ease. <br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
57
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="Feature" width="700"> | **Simplified Content Retrieval**<br><br>No need to call your `t` function for each piece of content. Retrieve all your content directly using a single hook.<br><br> - [React integration](https://intlayer.org/doc/environment/create-react-app) |
|
|
58
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true" alt="Feature" width="700"> | **Consistent Server Component Implementation**<br><br>Perfectly suited for Next.js server components, use the same implementation for both client and server components, no need to pass your `t` function across each server component. <br><br> - [Server Components](https://intlayer.org/doc/environment/nextjs#step-7-utilize-content-in-your-code) |
|
|
59
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **Organized Codebase**<br><br>Keep your codebase more organized: 1 component = 1 dictionary in the same folder. Translations close to their respective components, enhance maintainability and clarity. <br><br> - [How Intlayer works](https://intlayer.org/doc/concept/how-works-intlayer) |
|
|
60
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="Feature" width="700"> | **Enhanced Routing**<br><br>Full support of app routing, adapting seamlessly to complex application structures, for Next.js, React, Vite, Vue.js, etc.<br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
61
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown Support**<br><br>Import and interpret, locale files and remote Markdown for multilingual content like privacy policies, documentation, etc. Interpret and make Markdown metadata accessible in your code.<br><br> - [Content files](https://intlayer.org/doc/concept/content/file) |
|
|
62
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true" alt="Feature" width="700"> | **Free Visual Editor & CMS**<br><br>A free visual editor and CMS are available for content writers, removing the need for a localization platform. Keep your content synchronized using Git, or externalize it totally or partially with the CMS.<br><br> - [Intlayer Editor](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
|
|
63
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true" alt="Feature" width="700"> | **Tree-shakable Content**<br><br>Tree-shakable content, reducing the size of the final bundle. Loads content per component, excluding any unused content from your bundle. Supports lazy loading to enhance app loading efficiency. <br><br> - [App build optimization](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
|
|
64
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true" alt="Feature" width="700"> | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
65
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI-Powered Translation**<br><br>Transform your website into 231 languages with just one click using Intlayer's advanced AI-powered translation tools using your own AI provider / API key. <br><br> - [CI/CD integration](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [Auto fill](https://intlayer.org/doc/concept/auto-fill) |
|
|
66
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
|
|
67
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
68
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
|
|
68
69
|
|
|
69
70
|
---
|
|
70
71
|
|
|
@@ -153,6 +154,8 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
153
154
|
<li><a href="https://intlayer.org/doc/concept/how-works-intlayer" rel=''>How Intlayer Works</a></li>
|
|
154
155
|
<li><a href="https://intlayer.org/doc/concept/configuration" rel=''>Configuration</a></li>
|
|
155
156
|
<li><a href="https://intlayer.org/doc/concept/cli" rel=''>Intlayer CLI</a></li>
|
|
157
|
+
<li><a href="https://intlayer.org/doc/compiler" rel=''>Compiler</a></li>
|
|
158
|
+
|
|
156
159
|
<li><a href="https://intlayer.org/doc/concept/editor" rel=''>Intlayer Editor</a></li>
|
|
157
160
|
<li><a href="https://intlayer.org/doc/concept/cms" rel=''>Intlayer CMS</a></li>
|
|
158
161
|
<li><a href="https://intlayer.org/doc/concept/content" rel=''>Dictionary</a>
|
|
@@ -179,17 +182,15 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
179
182
|
<li><a href="https://intlayer.org/doc/environment/nextjs/15" rel=''>Next.js 15</a></li>
|
|
180
183
|
<li><a href="https://intlayer.org/doc/environment/nextjs/14" rel=''>Next.js 14 (App Router)</a></li>
|
|
181
184
|
<li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router" rel=''>Next.js Page Router</a></li>
|
|
185
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs/compiler" rel=''>Next.js using Compiler</a></li>
|
|
182
186
|
</ul>
|
|
183
187
|
</li>
|
|
184
188
|
<li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
|
|
185
|
-
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
</ul>
|
|
190
|
-
</li>
|
|
189
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a></li>
|
|
190
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React using Compiler</a></li>
|
|
191
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/compiler" rel=''>React-router-v7</a></li>
|
|
192
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start" rel=''>Tanstack start</a></li>
|
|
191
193
|
<li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
|
|
192
|
-
<li><a href="https://intlayer.org/doc/environment/lynx-and-react" rel=''>Lynx + React</a></li>
|
|
193
194
|
<li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
|
|
194
195
|
<li><a href="https://intlayer.org/doc/environment/sveltekit" rel=''>SvelteKit</a></li>
|
|
195
196
|
<li><a href="https://intlayer.org/doc/environment/vite-and-preact" rel=''>Vite + Preact</a></li>
|
|
@@ -197,8 +198,16 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
197
198
|
<li><a href="https://intlayer.org/doc/environment/vite-and-nuxt" rel=''>Vite + Nuxt</a></li>
|
|
198
199
|
<li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
|
|
199
200
|
<li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
|
|
200
|
-
<li
|
|
201
|
-
|
|
201
|
+
<li>
|
|
202
|
+
<a href="https://intlayer.org/doc/environment/express" rel=''>Backend</a>
|
|
203
|
+
<ul>
|
|
204
|
+
<li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
|
|
205
|
+
<li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
|
|
206
|
+
<li><a href="https://intlayer.org/doc/environment/fastify" rel=''>Fastify</a></li>
|
|
207
|
+
<li><a href="https://intlayer.org/doc/environment/adonisjs" rel=''>AdonisJS</a></li>
|
|
208
|
+
<li><a href="https://intlayer.org/doc/environment/hono" rel=''>Hono</a></li>
|
|
209
|
+
</ul>
|
|
210
|
+
</li>
|
|
202
211
|
</ul>
|
|
203
212
|
</details>
|
|
204
213
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../defaultValues/build.cjs`),n=require(`../defaultValues/compiler.cjs`),r=require(`../defaultValues/content.cjs`),i=require(`../defaultValues/dictionary.cjs`),a=require(`../defaultValues/editor.cjs`),o=require(`../defaultValues/internationalization.cjs`),s=require(`../defaultValues/log.cjs`),c=require(`../defaultValues/routing.cjs`),l=require(`../defaultValues/system.cjs`),u=require(`../utils/normalizePath.cjs`);let d=require(`node:path`),f=require(`node:fs`),p=require(`@intlayer/types/package.json`);p=e.__toESM(p);let m;const h=e=>({locales:e?.locales??o.LOCALES,requiredLocales:e?.requiredLocales??e?.locales??o.REQUIRED_LOCALES,strictMode:e?.strictMode??o.STRICT_MODE,defaultLocale:e?.defaultLocale??o.DEFAULT_LOCALE}),g=e=>({mode:e?.mode??c.ROUTING_MODE,storage:e?.storage??c.STORAGE,basePath:e?.basePath??c.BASE_PATH,rewrite:e?.rewrite}),_=(e,t,n)=>{let i=e?.fileExtensions??r.FILE_EXTENSIONS,a=e?.baseDir??t??process.cwd(),o=e=>{let t;try{t=require.resolve(e,{paths:[a]})}catch{t=(0,d.isAbsolute)(e)?e:(0,d.join)(a,e)}try{if((0,f.statSync)(t).isFile())return(0,d.dirname)(t)}catch{if(/\.[a-z0-9]+$/i.test(t))return(0,d.dirname)(t)}return t},s=(e?.contentDir??r.CONTENT_DIR).map(o);return{fileExtensions:i,baseDir:a,contentDir:s,codeDir:(e?.codeDir??r.CODE_DIR).map(o),excludedPath:e?.excludedPath??r.EXCLUDED_PATHS,watch:e?.watch??r.WATCH,formatCommand:e?.formatCommand,watchedFilesPattern:i.map(e=>`/**/*${e}`),watchedFilesPatternWithPath:i.flatMap(e=>s.map(t=>`${u.normalizePath(t)}/**/*${e}`))}},v=(e,t)=>{let n=t?.baseDir??process.cwd(),r=e=>{let t;try{t=require.resolve(e,{paths:[n]})}catch{t=(0,d.isAbsolute)(e)?e:(0,d.join)(n,e)}try{if((0,f.statSync)(t).isFile())return(0,d.dirname)(t)}catch{if(/\.[a-z0-9]+$/i.test(t))return(0,d.dirname)(t)}return t},i=r(e?.dictionariesDir??l.DICTIONARIES_DIR);return{moduleAugmentationDir:r(e?.moduleAugmentationDir??l.MODULE_AUGMENTATION_DIR),unmergedDictionariesDir:r(e?.unmergedDictionariesDir??l.UNMERGED_DICTIONARIES_DIR),remoteDictionariesDir:r(e?.remoteDictionariesDir??l.REMOTE_DICTIONARIES_DIR),dictionariesDir:i,dynamicDictionariesDir:r(e?.dynamicDictionariesDir??l.DYNAMIC_DICTIONARIES_DIR),fetchDictionariesDir:r(e?.fetchDictionariesDir??l.FETCH_DICTIONARIES_DIR),typesDir:r(e?.typesDir??l.TYPES_DIR),mainDir:r(e?.mainDir??l.MAIN_DIR),configDir:r(e?.configDir??l.CONFIG_DIR),cacheDir:r(e?.cacheDir??l.CACHE_DIR),tempDir:r(e?.tempDir??l.TEMP_DIR),outputFilesPatternWithPath:`${u.normalizePath(i)}/**/*.json`}},y=e=>({applicationURL:e?.applicationURL??a.APPLICATION_URL,editorURL:e?.editorURL??a.EDITOR_URL,cmsURL:e?.cmsURL??a.CMS_URL,backendURL:e?.backendURL??a.BACKEND_URL,port:e?.port??a.PORT,enabled:e?.enabled??a.IS_ENABLED,clientId:e?.clientId??void 0,clientSecret:e?.clientSecret??void 0,dictionaryPriorityStrategy:e?.dictionaryPriorityStrategy??a.DICTIONARY_PRIORITY_STRATEGY,liveSync:e?.liveSync??a.LIVE_SYNC,liveSyncPort:e?.liveSyncPort??a.LIVE_SYNC_PORT,liveSyncURL:e?.liveSyncURL??`http://localhost:${e?.liveSyncPort??a.LIVE_SYNC_PORT}`}),b=(e,t)=>({mode:e?.mode??s.MODE,prefix:e?.prefix??s.PREFIX,error:t?.error,log:t?.log,info:t?.info,warn:t?.warn}),x=e=>({provider:e?.provider,apiKey:e?.apiKey,model:e?.model,temperature:e?.temperature,applicationContext:e?.applicationContext,baseURL:e?.baseURL,dataSerialization:e?.dataSerialization}),S=e=>({mode:e?.mode??t.BUILD_MODE,optimize:e?.optimize,importMode:e?.importMode,traversePattern:e?.traversePattern??t.TRAVERSE_PATTERN,outputFormat:e?.outputFormat??t.OUTPUT_FORMAT,cache:e?.cache??t.CACHE,require:e?.require,checkTypes:e?.checkTypes??t.TYPE_CHECKING}),C=e=>({enabled:e?.enabled??n.COMPILER_ENABLED,dictionaryKeyPrefix:e?.dictionaryKeyPrefix??n.COMPILER_DICTIONARY_KEY_PREFIX,transformPattern:e?.transformPattern??n.COMPILER_TRANSFORM_PATTERN,excludePattern:e?.excludePattern??n.COMPILER_EXCLUDE_PATTERN,outputDir:e?.outputDir??n.COMPILER_OUTPUT_DIR}),w=e=>{let t=e?.contentAutoTransformation??i.CONTENT_AUTO_TRANSFORMATION;return{fill:e?.fill??i.FILL,contentAutoTransformation:typeof t==`object`?{markdown:t.markdown??!1,html:t.html??!1,insertion:t.insertion??!1}:t,location:e?.location??i.LOCATION,locale:e?.locale,title:e?.title,description:e?.description,tags:e?.tags,priority:e?.priority,importMode:e?.importMode??i.IMPORT_MODE,version:e?.version}},T=(e,t,n)=>{let r=h(e?.internationalization),i=g(e?.routing),a=_(e?.content,t,n);return m={internationalization:r,routing:i,content:a,system:v(e?.system,a),editor:y(e?.editor),log:b(e?.log,n),ai:x(e?.ai),build:S(e?.build),compiler:C(e?.compiler),dictionary:w(e?.dictionary),plugins:e?.plugins,schemas:e?.schemas,metadata:{name:`Intlayer`,version:p.default.version,doc:`https://intlayer.org/docs`}},m};exports.buildConfigurationFields=T;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../defaultValues/build.cjs`),n=require(`../defaultValues/compiler.cjs`),r=require(`../defaultValues/content.cjs`),i=require(`../defaultValues/dictionary.cjs`),a=require(`../defaultValues/editor.cjs`),o=require(`../defaultValues/internationalization.cjs`),s=require(`../defaultValues/log.cjs`),c=require(`../defaultValues/routing.cjs`),l=require(`../defaultValues/system.cjs`),u=require(`../utils/normalizePath.cjs`);let d=require(`node:path`),f=require(`node:fs`),p=require(`@intlayer/types/package.json`);p=e.__toESM(p);let m;const h=e=>({locales:e?.locales??o.LOCALES,requiredLocales:e?.requiredLocales??e?.locales??o.REQUIRED_LOCALES,strictMode:e?.strictMode??o.STRICT_MODE,defaultLocale:e?.defaultLocale??o.DEFAULT_LOCALE}),g=e=>({mode:e?.mode??c.ROUTING_MODE,storage:e?.storage??c.STORAGE,basePath:e?.basePath??c.BASE_PATH,rewrite:e?.rewrite}),_=(e,t,n)=>{let i=e?.fileExtensions??r.FILE_EXTENSIONS,a=e?.baseDir??t??process.cwd(),o=e=>{let t;try{t=require.resolve(e,{paths:[a]})}catch{t=(0,d.isAbsolute)(e)?e:(0,d.join)(a,e)}try{if((0,f.statSync)(t).isFile())return(0,d.dirname)(t)}catch{if(/\.[a-z0-9]+$/i.test(t))return(0,d.dirname)(t)}return t},s=(e?.contentDir??r.CONTENT_DIR).map(o);return{fileExtensions:i,baseDir:a,contentDir:s,codeDir:(e?.codeDir??r.CODE_DIR).map(o),excludedPath:e?.excludedPath??r.EXCLUDED_PATHS,watch:e?.watch??r.WATCH,formatCommand:e?.formatCommand,watchedFilesPattern:i.map(e=>`/**/*${e}`),watchedFilesPatternWithPath:i.flatMap(e=>s.map(t=>`${u.normalizePath(t)}/**/*${e}`))}},v=(e,t)=>{let n=t?.baseDir??process.cwd(),r=e=>{let t;try{t=require.resolve(e,{paths:[n]})}catch{t=(0,d.isAbsolute)(e)?e:(0,d.join)(n,e)}try{if((0,f.statSync)(t).isFile())return(0,d.dirname)(t)}catch{if(/\.[a-z0-9]+$/i.test(t))return(0,d.dirname)(t)}return t},i=r(e?.dictionariesDir??l.DICTIONARIES_DIR);return{moduleAugmentationDir:r(e?.moduleAugmentationDir??l.MODULE_AUGMENTATION_DIR),unmergedDictionariesDir:r(e?.unmergedDictionariesDir??l.UNMERGED_DICTIONARIES_DIR),remoteDictionariesDir:r(e?.remoteDictionariesDir??l.REMOTE_DICTIONARIES_DIR),dictionariesDir:i,dynamicDictionariesDir:r(e?.dynamicDictionariesDir??l.DYNAMIC_DICTIONARIES_DIR),fetchDictionariesDir:r(e?.fetchDictionariesDir??l.FETCH_DICTIONARIES_DIR),typesDir:r(e?.typesDir??l.TYPES_DIR),mainDir:r(e?.mainDir??l.MAIN_DIR),configDir:r(e?.configDir??l.CONFIG_DIR),cacheDir:r(e?.cacheDir??l.CACHE_DIR),tempDir:r(e?.tempDir??l.TEMP_DIR),outputFilesPatternWithPath:`${u.normalizePath(i)}/**/*.json`}},y=e=>({applicationURL:e?.applicationURL??a.APPLICATION_URL,editorURL:e?.editorURL??a.EDITOR_URL,cmsURL:e?.cmsURL??a.CMS_URL,backendURL:e?.backendURL??a.BACKEND_URL,port:e?.port??a.PORT,enabled:e?.enabled??a.IS_ENABLED,clientId:e?.clientId??void 0,clientSecret:e?.clientSecret??void 0,dictionaryPriorityStrategy:e?.dictionaryPriorityStrategy??a.DICTIONARY_PRIORITY_STRATEGY,liveSync:e?.liveSync??a.LIVE_SYNC,liveSyncPort:e?.liveSyncPort??a.LIVE_SYNC_PORT,liveSyncURL:e?.liveSyncURL??`http://localhost:${e?.liveSyncPort??a.LIVE_SYNC_PORT}`}),b=(e,t)=>({mode:e?.mode??s.MODE,prefix:e?.prefix??s.PREFIX,error:t?.error,log:t?.log,info:t?.info,warn:t?.warn}),x=e=>({provider:e?.provider,apiKey:e?.apiKey,model:e?.model,temperature:e?.temperature,applicationContext:e?.applicationContext,baseURL:e?.baseURL,dataSerialization:e?.dataSerialization}),S=e=>({mode:e?.mode??t.BUILD_MODE,optimize:e?.optimize,importMode:e?.importMode,traversePattern:e?.traversePattern??t.TRAVERSE_PATTERN,outputFormat:e?.outputFormat??t.OUTPUT_FORMAT,cache:e?.cache??t.CACHE,require:e?.require,checkTypes:e?.checkTypes??t.TYPE_CHECKING}),C=e=>({enabled:e?.enabled??n.COMPILER_ENABLED,dictionaryKeyPrefix:e?.dictionaryKeyPrefix??n.COMPILER_DICTIONARY_KEY_PREFIX,transformPattern:e?.transformPattern??n.COMPILER_TRANSFORM_PATTERN,excludePattern:e?.excludePattern??n.COMPILER_EXCLUDE_PATTERN,outputDir:e?.outputDir??n.COMPILER_OUTPUT_DIR,saveComponents:e?.saveComponents??n.COMPILER_SAVE_COMPONENTS}),w=e=>{let t=e?.contentAutoTransformation??i.CONTENT_AUTO_TRANSFORMATION;return{fill:e?.fill??i.FILL,contentAutoTransformation:typeof t==`object`?{markdown:t.markdown??!1,html:t.html??!1,insertion:t.insertion??!1}:t,location:e?.location??i.LOCATION,locale:e?.locale,title:e?.title,description:e?.description,tags:e?.tags,priority:e?.priority,importMode:e?.importMode??i.IMPORT_MODE,version:e?.version}},T=(e,t,n)=>{let r=h(e?.internationalization),i=g(e?.routing),a=_(e?.content,t,n);return m={internationalization:r,routing:i,content:a,system:v(e?.system,a),editor:y(e?.editor),log:b(e?.log,n),ai:x(e?.ai),build:S(e?.build),compiler:C(e?.compiler),dictionary:w(e?.dictionary),plugins:e?.plugins,schemas:e?.schemas,metadata:{name:`Intlayer`,version:p.default.version,doc:`https://intlayer.org/docs`}},m};exports.buildConfigurationFields=T;
|
|
2
2
|
//# sourceMappingURL=buildConfigurationFields.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.cjs","names":["LOCALES","REQUIRED_LOCALES","STRICT_MODE","DEFAULT_LOCALE","ROUTING_MODE","STORAGE","BASE_PATH","FILE_EXTENSIONS","CONTENT_DIR","CODE_DIR","EXCLUDED_PATHS","WATCH","normalizePath","DICTIONARIES_DIR","MODULE_AUGMENTATION_DIR","UNMERGED_DICTIONARIES_DIR","REMOTE_DICTIONARIES_DIR","DYNAMIC_DICTIONARIES_DIR","FETCH_DICTIONARIES_DIR","TYPES_DIR","MAIN_DIR","CONFIG_DIR","CACHE_DIR","TEMP_DIR","APPLICATION_URL","EDITOR_URL","CMS_URL","BACKEND_URL","PORT","IS_ENABLED","DICTIONARY_PRIORITY_STRATEGY","LIVE_SYNC","LIVE_SYNC_PORT","MODE","PREFIX","BUILD_MODE","TRAVERSE_PATTERN","OUTPUT_FORMAT","CACHE","TYPE_CHECKING","COMPILER_ENABLED","COMPILER_DICTIONARY_KEY_PREFIX","COMPILER_TRANSFORM_PATTERN","COMPILER_EXCLUDE_PATTERN","COMPILER_OUTPUT_DIR","CONTENT_AUTO_TRANSFORMATION","FILL","LOCATION","IMPORT_MODE","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';\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_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_TRANSFORM_PATTERN,\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 { 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 buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string,\n logFunctions?: LogFunctions\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n const projectBaseDir =\n customConfiguration?.baseDir ?? baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first (e.g. '@intlayer/design-system')\n // Passing { paths: [...] } ensures we look starting from your project baseDir\n absolutePath = require.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n // If resolution fails (it's not a module or it's a relative path like './src'),\n // fall back to standard path joining.\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\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 baseDir: projectBaseDir,\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 buildSystemFields = (\n customConfiguration?: Partial<SystemConfig>,\n contentConfig?: ContentConfig\n): SystemConfig => {\n const projectBaseDir = contentConfig?.baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n absolutePath = require.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 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 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: true;\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 transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\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 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 * The version of the dictionary.\n */\n version: customConfiguration?.version,\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 contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir,\n logFunctions\n );\n\n const systemConfig = buildSystemFields(\n customConfiguration?.system,\n contentConfig\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":"4oBA+EA,IAAI,EAEJ,MAAM,EACJ,IACgC,CAOhC,QAAS,GAAqB,SAAWA,EAAAA,QAWzC,gBACE,GAAqB,iBACrB,GAAqB,SACrBC,EAAAA,iBAUF,WAAY,GAAqB,YAAcC,EAAAA,YAO/C,cAAe,GAAqB,eAAiBC,EAAAA,eACtD,EAEK,EACJ,IACmB,CAuBnB,KAAM,GAAqB,MAAQC,EAAAA,aAWnC,QAAS,GAAqB,SAAWC,EAAAA,QAazC,SAAU,GAAqB,UAAYC,EAAAA,UA6B3C,QAAS,GAAqB,QAC/B,EAEK,GACJ,EACA,EACA,IACkB,CAClB,IAAM,EAAiB,GAAqB,gBAAkBC,EAAAA,gBACxD,EACJ,GAAqB,SAAW,GAAW,QAAQ,KAAK,CAEpD,EAAuB,GAAsB,CACjD,IAAI,EAEJ,GAAI,CAGF,EAAe,QAAQ,QAAQ,EAAW,CACxC,MAAO,CAAC,EAAe,CACxB,CAAC,MACI,CAGN,GAAA,EAAA,EAAA,YAA0B,EAAU,CAChC,GAAA,EAAA,EAAA,MACK,EAAgB,EAAU,CAGrC,GAAI,CAMF,IAAA,EAAA,EAAA,UAJuB,EAAa,CAI1B,QAAQ,CAChB,OAAA,EAAA,EAAA,SAAe,EAAa,MAExB,CAGN,GAAI,gBAAgB,KAAK,EAAa,CACpC,OAAA,EAAA,EAAA,SAAe,EAAa,CAKhC,OAAO,GAGH,GAAc,GAAqB,YAAcC,EAAAA,aAAa,IAClE,EACD,CAMD,MAAO,CACL,iBACA,QAAS,EACT,aACA,SARmB,GAAqB,SAETC,EAAAA,UAAU,IAAI,EAAoB,CAOjE,aAAc,GAAq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BASE_PATH","FILE_EXTENSIONS","CONTENT_DIR","CODE_DIR","EXCLUDED_PATHS","WATCH","normalizePath","DICTIONARIES_DIR","MODULE_AUGMENTATION_DIR","UNMERGED_DICTIONARIES_DIR","REMOTE_DICTIONARIES_DIR","DYNAMIC_DICTIONARIES_DIR","FETCH_DICTIONARIES_DIR","TYPES_DIR","MAIN_DIR","CONFIG_DIR","CACHE_DIR","TEMP_DIR","APPLICATION_URL","EDITOR_URL","CMS_URL","BACKEND_URL","PORT","IS_ENABLED","DICTIONARY_PRIORITY_STRATEGY","LIVE_SYNC","LIVE_SYNC_PORT","MODE","PREFIX","BUILD_MODE","TRAVERSE_PATTERN","OUTPUT_FORMAT","CACHE","TYPE_CHECKING","COMPILER_ENABLED","COMPILER_DICTIONARY_KEY_PREFIX","COMPILER_TRANSFORM_PATTERN","COMPILER_EXCLUDE_PATTERN","COMPILER_OUTPUT_DIR","COMPILER_SAVE_COMPONENTS","CONTENT_AUTO_TRANSFORMATION","FILL","LOCATION","IMPORT_MODE","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';\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_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_SAVE_COMPONENTS,\n COMPILER_TRANSFORM_PATTERN,\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 { 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 buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string,\n logFunctions?: LogFunctions\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n const projectBaseDir =\n customConfiguration?.baseDir ?? baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first (e.g. '@intlayer/design-system')\n // Passing { paths: [...] } ensures we look starting from your project baseDir\n absolutePath = require.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n // If resolution fails (it's not a module or it's a relative path like './src'),\n // fall back to standard path joining.\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\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 baseDir: projectBaseDir,\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 buildSystemFields = (\n customConfiguration?: Partial<SystemConfig>,\n contentConfig?: ContentConfig\n): SystemConfig => {\n const projectBaseDir = contentConfig?.baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n absolutePath = require.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 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 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: true;\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 transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\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 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 * The version of the dictionary.\n */\n version: customConfiguration?.version,\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 contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir,\n logFunctions\n );\n\n const systemConfig = buildSystemFields(\n customConfiguration?.system,\n contentConfig\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":"4oBAgFA,IAAI,EAEJ,MAAM,EACJ,IACgC,CAOhC,QAAS,GAAqB,SAAWA,EAAAA,QAWzC,gBACE,GAAqB,iBACrB,GAAqB,SACrBC,EAAAA,iBAUF,WAAY,GAAqB,YAAcC,EAAAA,YAO/C,cAAe,GAAqB,eAAiBC,EAAAA,eACtD,EAEK,EACJ,IACmB,CAuBnB,KAAM,GAAqB,MAAQC,EAAAA,aAWnC,QAAS,GAAqB,SAAWC,EAAAA,QAazC,SAAU,GAAqB,UAAYC,EAAAA,UA6B3C,QAAS,GAAqB,QAC/B,EAEK,GACJ,EACA,EACA,IACkB,CAClB,IAAM,EAAiB,GAAqB,gBAAkBC,EAAAA,gBACxD,EACJ,GAAqB,SAAW,GAAW,QAAQ,KAAK,CAEpD,EAAuB,GAAsB,CACjD,IAAI,EAEJ,GAAI,CAGF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CACpB,qBAAsB,EACtB,QAAS,EACT,QAAS,EACT,OAvBmB,EACnB,GAAqB,OACrB,EACD,CAqBC,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`});const e=[`**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}`],t=[`**/node_modules/**`,`**/dist/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`,`**/*.stories.ts`,`**/*.test.ts`];exports.COMPILER_DICTIONARY_KEY_PREFIX=`comp-`,exports.COMPILER_ENABLED=!0,exports.COMPILER_EXCLUDE_PATTERN=t,exports.COMPILER_OUTPUT_DIR=`./compiler`,exports.COMPILER_TRANSFORM_PATTERN=e;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=[`**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}`],t=[`**/node_modules/**`,`**/dist/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`,`**/*.stories.ts`,`**/*.test.ts`];exports.COMPILER_DICTIONARY_KEY_PREFIX=`comp-`,exports.COMPILER_ENABLED=!0,exports.COMPILER_EXCLUDE_PATTERN=t,exports.COMPILER_OUTPUT_DIR=`./compiler`,exports.COMPILER_SAVE_COMPONENTS=!1,exports.COMPILER_TRANSFORM_PATTERN=e;
|
|
2
2
|
//# sourceMappingURL=compiler.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.cjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = 'comp-';\n\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n"],"mappings":"mEAAA,MAIa,EAA6B,CACxC,0CACD,CACY,EAA2B,CACtC,qBACA,aACA,cACA,cACA,cACA,gBACA,eACA,kBACA,kBACA,eACD"}
|
|
1
|
+
{"version":3,"file":"compiler.cjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = 'comp-';\n\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n\nexport const COMPILER_SAVE_COMPONENTS = false;\n"],"mappings":"mEAAA,MAIa,EAA6B,CACxC,0CACD,CACY,EAA2B,CACtC,qBACA,aACA,cACA,cACA,cACA,gBACA,eACA,kBACA,kBACA,eACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__require as e}from"../_virtual/_rolldown/runtime.mjs";import{BUILD_MODE as t,CACHE as n,OUTPUT_FORMAT as r,TRAVERSE_PATTERN as i,TYPE_CHECKING as a}from"../defaultValues/build.mjs";import{COMPILER_DICTIONARY_KEY_PREFIX as o,COMPILER_ENABLED as s,COMPILER_EXCLUDE_PATTERN as c,COMPILER_OUTPUT_DIR as l,COMPILER_TRANSFORM_PATTERN as
|
|
1
|
+
import{__require as e}from"../_virtual/_rolldown/runtime.mjs";import{BUILD_MODE as t,CACHE as n,OUTPUT_FORMAT as r,TRAVERSE_PATTERN as i,TYPE_CHECKING as a}from"../defaultValues/build.mjs";import{COMPILER_DICTIONARY_KEY_PREFIX as o,COMPILER_ENABLED as s,COMPILER_EXCLUDE_PATTERN as c,COMPILER_OUTPUT_DIR as l,COMPILER_SAVE_COMPONENTS as u,COMPILER_TRANSFORM_PATTERN as d}from"../defaultValues/compiler.mjs";import{CODE_DIR as f,CONTENT_DIR as p,EXCLUDED_PATHS as ee,FILE_EXTENSIONS as te,WATCH as m}from"../defaultValues/content.mjs";import{CONTENT_AUTO_TRANSFORMATION as h,FILL as g,IMPORT_MODE as _,LOCATION as v}from"../defaultValues/dictionary.mjs";import{APPLICATION_URL as y,BACKEND_URL as b,CMS_URL as x,DICTIONARY_PRIORITY_STRATEGY as S,EDITOR_URL as C,IS_ENABLED as w,LIVE_SYNC as T,LIVE_SYNC_PORT as E,PORT as D}from"../defaultValues/editor.mjs";import{DEFAULT_LOCALE as O,LOCALES as k,REQUIRED_LOCALES as A,STRICT_MODE as j}from"../defaultValues/internationalization.mjs";import{MODE as M,PREFIX as N}from"../defaultValues/log.mjs";import{BASE_PATH as P,ROUTING_MODE as F,STORAGE as I}from"../defaultValues/routing.mjs";import{CACHE_DIR as L,CONFIG_DIR as ne,DICTIONARIES_DIR as R,DYNAMIC_DICTIONARIES_DIR as z,FETCH_DICTIONARIES_DIR as B,MAIN_DIR as V,MODULE_AUGMENTATION_DIR as H,REMOTE_DICTIONARIES_DIR as U,TEMP_DIR as W,TYPES_DIR as G,UNMERGED_DICTIONARIES_DIR as K}from"../defaultValues/system.mjs";import{normalizePath as q}from"../utils/normalizePath.mjs";import{dirname as J,isAbsolute as Y,join as X}from"node:path";import{statSync as Z}from"node:fs";import re from"@intlayer/types/package.json"with{type:"json"};let Q;const ie=e=>({locales:e?.locales??k,requiredLocales:e?.requiredLocales??e?.locales??A,strictMode:e?.strictMode??j,defaultLocale:e?.defaultLocale??O}),ae=e=>({mode:e?.mode??F,storage:e?.storage??I,basePath:e?.basePath??P,rewrite:e?.rewrite}),oe=(t,n,r)=>{let i=t?.fileExtensions??te,a=t?.baseDir??n??process.cwd(),o=t=>{let n;try{n=e.resolve(t,{paths:[a]})}catch{n=Y(t)?t:X(a,t)}try{if(Z(n).isFile())return J(n)}catch{if(/\.[a-z0-9]+$/i.test(n))return J(n)}return n},s=(t?.contentDir??p).map(o);return{fileExtensions:i,baseDir:a,contentDir:s,codeDir:(t?.codeDir??f).map(o),excludedPath:t?.excludedPath??ee,watch:t?.watch??m,formatCommand:t?.formatCommand,watchedFilesPattern:i.map(e=>`/**/*${e}`),watchedFilesPatternWithPath:i.flatMap(e=>s.map(t=>`${q(t)}/**/*${e}`))}},se=(t,n)=>{let r=n?.baseDir??process.cwd(),i=t=>{let n;try{n=e.resolve(t,{paths:[r]})}catch{n=Y(t)?t:X(r,t)}try{if(Z(n).isFile())return J(n)}catch{if(/\.[a-z0-9]+$/i.test(n))return J(n)}return n},a=i(t?.dictionariesDir??R);return{moduleAugmentationDir:i(t?.moduleAugmentationDir??H),unmergedDictionariesDir:i(t?.unmergedDictionariesDir??K),remoteDictionariesDir:i(t?.remoteDictionariesDir??U),dictionariesDir:a,dynamicDictionariesDir:i(t?.dynamicDictionariesDir??z),fetchDictionariesDir:i(t?.fetchDictionariesDir??B),typesDir:i(t?.typesDir??G),mainDir:i(t?.mainDir??V),configDir:i(t?.configDir??ne),cacheDir:i(t?.cacheDir??L),tempDir:i(t?.tempDir??W),outputFilesPatternWithPath:`${q(a)}/**/*.json`}},ce=e=>({applicationURL:e?.applicationURL??y,editorURL:e?.editorURL??C,cmsURL:e?.cmsURL??x,backendURL:e?.backendURL??b,port:e?.port??D,enabled:e?.enabled??w,clientId:e?.clientId??void 0,clientSecret:e?.clientSecret??void 0,dictionaryPriorityStrategy:e?.dictionaryPriorityStrategy??S,liveSync:e?.liveSync??T,liveSyncPort:e?.liveSyncPort??E,liveSyncURL:e?.liveSyncURL??`http://localhost:${e?.liveSyncPort??E}`}),le=(e,t)=>({mode:e?.mode??M,prefix:e?.prefix??N,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}),ue=e=>({mode:e?.mode??t,optimize:e?.optimize,importMode:e?.importMode,traversePattern:e?.traversePattern??i,outputFormat:e?.outputFormat??r,cache:e?.cache??n,require:e?.require,checkTypes:e?.checkTypes??a}),de=e=>({enabled:e?.enabled??s,dictionaryKeyPrefix:e?.dictionaryKeyPrefix??o,transformPattern:e?.transformPattern??d,excludePattern:e?.excludePattern??c,outputDir:e?.outputDir??l,saveComponents:e?.saveComponents??u}),fe=e=>{let t=e?.contentAutoTransformation??h;return{fill:e?.fill??g,contentAutoTransformation:typeof t==`object`?{markdown:t.markdown??!1,html:t.html??!1,insertion:t.insertion??!1}:t,location:e?.location??v,locale:e?.locale,title:e?.title,description:e?.description,tags:e?.tags,priority:e?.priority,importMode:e?.importMode??_,version:e?.version}},pe=(e,t,n)=>{let r=ie(e?.internationalization),i=ae(e?.routing),a=oe(e?.content,t,n);return Q={internationalization:r,routing:i,content:a,system:se(e?.system,a),editor:ce(e?.editor),log:le(e?.log,n),ai:$(e?.ai),build:ue(e?.build),compiler:de(e?.compiler),dictionary:fe(e?.dictionary),plugins:e?.plugins,schemas:e?.schemas,metadata:{name:`Intlayer`,version:re.version,doc:`https://intlayer.org/docs`}},Q};export{pe as buildConfigurationFields};
|
|
2
2
|
//# sourceMappingURL=buildConfigurationFields.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.mjs","names":[],"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';\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_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_TRANSFORM_PATTERN,\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 { 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 buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string,\n logFunctions?: LogFunctions\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n const projectBaseDir =\n customConfiguration?.baseDir ?? baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first (e.g. '@intlayer/design-system')\n // Passing { paths: [...] } ensures we look starting from your project baseDir\n absolutePath = require.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n // If resolution fails (it's not a module or it's a relative path like './src'),\n // fall back to standard path joining.\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\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 baseDir: projectBaseDir,\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 buildSystemFields = (\n customConfiguration?: Partial<SystemConfig>,\n contentConfig?: ContentConfig\n): SystemConfig => {\n const projectBaseDir = contentConfig?.baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n absolutePath = require.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 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 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: true;\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 transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\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 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 * The version of the dictionary.\n */\n version: customConfiguration?.version,\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 contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir,\n logFunctions\n );\n\n const systemConfig = buildSystemFields(\n customConfiguration?.system,\n contentConfig\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":"mkDA+EA,IAAI,EAEJ,MAAM,GACJ,IACgC,CAOhC,QAAS,GAAqB,SAAW,EAWzC,gBACE,GAAqB,iBACrB,GAAqB,SACrB,EAUF,WAAY,GAAqB,YAAc,EAO/C,cAAe,GAAqB,eAAiB,EACtD,EAEK,GACJ,IACmB,CAuBnB,KAAM,GAAqB,MAAQ,EAWnC,QAAS,GAAqB,SAAW,EAazC,SAAU,GAAqB,UAAY,EA6B3C,QAAS,GAAqB,QAC/B,EAEK,IACJ,EACA,EACA,IACkB,CAClB,IAAM,EAAiB,GAAqB,gBAAkB,GACxD,EACJ,GAAqB,SAAW,GAAW,QAAQ,KAAK,CAEpD,EAAuB,GAAsB,CACjD,IAAI,EAEJ,GAAI,CAGF,EAAA,EAAuB,QAAQ,EAAW,CACxC,MAAO,CAAC,EAAe,CACxB,CAAC,MACI,CAGN,EAAe,EAAW,EAAU,CAChC,EACA,EAAK,EAAgB,EAAU,CAGrC,GAAI,CAMF,GAJc,EAAS,EAAa,CAI1B,QAAQ,CAChB,OAAO,EAAQ,EAAa,MAExB,CAGN,GAAI,gBAAgB,KAAK,EAAa,CACpC,OAAO,EAAQ,EAAa,CAKhC,OAAO,GAGH,GAAc,GAAqB,YAAc,GAAa,IAClE,EACD,CAMD,MAAO,CACL,iBACA,QAAS,EACT,aACA,SARmB,GAAqB,SAET,GAAU,IAAI,EAAoB,CAOjE,aAAc,GAAqB,cAAgB,EACnD,MAAO,GAAqB,OAAS,GACrC,cAAe,GAAqB,cACpC,oBAAqB,EAAe,IAAK,GAAQ,QAAQ,IAAM,CAC/D,4BAA6B,EAAe,QAAS,GACnD,EAAW,IAAK,GAAQ,GAAG,EAAc,EAAI,CAAC,OAAO,IAAM,CAC5D,CACF,EAGG,IACJ,EACA,IACiB,CACjB,IAAM,EAAiB,G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AAqB,QACrB,EACA,EACD,CAyCD,MApBA,GAAsB,CACpB,qBAAsB,EACtB,QAAS,EACT,QAAS,EACT,OAvBmB,GACnB,GAAqB,OACrB,EACD,CAqBC,OAnBmB,EAAkB,GAAqB,OAAO,CAoBjE,IAlBgB,GAAe,GAAqB,IAAK,EAAa,CAmBtE,GAjBe,GAAc,GAAqB,GAAG,CAkBrD,MAhBkB,GAAiB,GAAqB,MAAM,CAiB9D,SAfqB,GAAoB,GAAqB,SAAS,CAgBvE,WAduB,GACvB,GAAqB,WACtB,CAaC,QAAS,GAAqB,QAC9B,QAAS,GAAqB,QAC9B,SAAU,CACR,KAAM,WACN,QAAS,EAAY,QACrB,IAAK,4BACN,CACF,CAEM"}
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.mjs","names":[],"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';\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_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_SAVE_COMPONENTS,\n COMPILER_TRANSFORM_PATTERN,\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 { 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 buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string,\n logFunctions?: LogFunctions\n): ContentConfig => {\n const fileExtensions = customConfiguration?.fileExtensions ?? FILE_EXTENSIONS;\n const projectBaseDir =\n customConfiguration?.baseDir ?? baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n // Try resolving as a Node module first (e.g. '@intlayer/design-system')\n // Passing { paths: [...] } ensures we look starting from your project baseDir\n absolutePath = require.resolve(pathInput, {\n paths: [projectBaseDir],\n });\n } catch {\n // If resolution fails (it's not a module or it's a relative path like './src'),\n // fall back to standard path joining.\n absolutePath = isAbsolute(pathInput)\n ? pathInput\n : join(projectBaseDir, pathInput);\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 baseDir: projectBaseDir,\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 buildSystemFields = (\n customConfiguration?: Partial<SystemConfig>,\n contentConfig?: ContentConfig\n): SystemConfig => {\n const projectBaseDir = contentConfig?.baseDir ?? process.cwd();\n\n const optionalJoinBaseDir = (pathInput: string) => {\n let absolutePath: string;\n\n try {\n absolutePath = require.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 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 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: true;\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 transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\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 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 * The version of the dictionary.\n */\n version: customConfiguration?.version,\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 contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir,\n logFunctions\n );\n\n const systemConfig = buildSystemFields(\n customConfiguration?.system,\n contentConfig\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":"kmDAgFA,IAAI,EAEJ,MAAM,GACJ,IACgC,CAOhC,QAAS,GAAqB,SAAW,EAWzC,gBACE,GAAqB,iBACrB,GAAqB,SACrB,EAUF,WAAY,GAAqB,YAAc,EAO/C,cAAe,GAAqB,eAAiB,EACtD,EAEK,GACJ,IACmB,CAuBnB,KAAM,GAAqB,MAAQ,EAWnC,QAAS,GAAqB,SAAW,EAazC,SAAU,GAAqB,UAAY,EA6B3C,QAAS,GAAqB,QAC/B,EAEK,IACJ,EACA,EACA,IACkB,CAClB,IAAM,EAAiB,GAAqB,gBAAkB,GACxD,EACJ,GAAqB,SAAW,GAAW,QAAQ,KAAK,CAEpD,EAAuB,GAAsB,CACjD,IAAI,EAEJ,GAAI,CAGF,EAAA,EAAuB,QAAQ,EAAW,CACxC,MAAO,CAAC,EAAe,CACxB,CAAC,MACI,CAGN,EAAe,EAAW,EAAU,CAChC,EACA,EAAK,EAAgB,EAAU,CAGrC,GAAI,CAMF,GAJc,EAAS,EAAa,CAI1B,QAAQ,CAChB,OAAO,EAAQ,EAAa,MAExB,CAGN,GAA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B,2BACrB,EAEF,MAAO,CAML,KAAM,GAAqB,MAAQ,EAOnC,0BACE,OAAO,GAA8B,SACjC,CACE,SAAU,EAA0B,UAAY,GAChD,KAAM,EAA0B,MAAQ,GACxC,UAAW,EAA0B,WAAa,GACnD,CACD,EAON,SAAU,GAAqB,UAAY,EAO3C,OAAQ,GAAqB,OAK7B,MAAO,GAAqB,MAK5B,YAAa,GAAqB,YAKlC,KAAM,GAAqB,KAK3B,SAAU,GAAqB,SAY/B,WAAY,GAAqB,YAAc,EAK/C,QAAS,GAAqB,QAC/B,EAMU,IACX,EACA,EACA,IACmB,CACnB,IAAM,EAA6B,GACjC,GAAqB,qBACtB,CAEK,EAAgB,GAAmB,GAAqB,QAAQ,CAEhE,EAAgB,GACpB,GAAqB,QACrB,EACA,EACD,CAyCD,MApBA,GAAsB,CACpB,qBAAsB,EACtB,QAAS,EACT,QAAS,EACT,OAvBmB,GACnB,GAAqB,OACrB,EACD,CAqBC,OAnBmB,GAAkB,GAAqB,OAAO,CAoBjE,IAlBgB,GAAe,GAAqB,IAAK,EAAa,CAmBtE,GAjBe,EAAc,GAAqB,GAAG,CAkBrD,MAhBkB,GAAiB,GAAqB,MAAM,CAiB9D,SAfqB,GAAoB,GAAqB,SAAS,CAgBvE,WAduB,GACvB,GAAqB,WACtB,CAaC,QAAS,GAAqB,QAC9B,QAAS,GAAqB,QAC9B,SAAU,CACR,KAAM,WACN,QAAS,GAAY,QACrB,IAAK,4BACN,CACF,CAEM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=!0,t=`comp-`,n=[`**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}`],r=[`**/node_modules/**`,`**/dist/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`,`**/*.stories.ts`,`**/*.test.ts`],i=`./compiler
|
|
1
|
+
const e=!0,t=`comp-`,n=[`**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}`],r=[`**/node_modules/**`,`**/dist/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`,`**/*.stories.ts`,`**/*.test.ts`],i=`./compiler`,a=!1;export{t as COMPILER_DICTIONARY_KEY_PREFIX,e as COMPILER_ENABLED,r as COMPILER_EXCLUDE_PATTERN,i as COMPILER_OUTPUT_DIR,a as COMPILER_SAVE_COMPONENTS,n as COMPILER_TRANSFORM_PATTERN};
|
|
2
2
|
//# sourceMappingURL=compiler.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.mjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = 'comp-';\n\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n"],"mappings":"AAAA,MAAa,EAAmB,GAEnB,EAAiC,QAEjC,EAA6B,CACxC,0CACD,CACY,EAA2B,CACtC,qBACA,aACA,cACA,cACA,cACA,gBACA,eACA,kBACA,kBACA,eACD,CACY,EAAsB"}
|
|
1
|
+
{"version":3,"file":"compiler.mjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = 'comp-';\n\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n\nexport const COMPILER_SAVE_COMPONENTS = false;\n"],"mappings":"AAAA,MAAa,EAAmB,GAEnB,EAAiC,QAEjC,EAA6B,CACxC,0CACD,CACY,EAA2B,CACtC,qBACA,aACA,cACA,cACA,cACA,gBACA,eACA,kBACA,kBACA,eACD,CACY,EAAsB,aAEtB,EAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;AA0xBA;cAAa,wBAAA,GACX,mBAAA,GAAsB,oBAAA,EACtB,OAAA,WACA,YAAA,GAAe,YAAA,KACd,cAAA"}
|
|
@@ -4,6 +4,7 @@ declare const COMPILER_DICTIONARY_KEY_PREFIX = "comp-";
|
|
|
4
4
|
declare const COMPILER_TRANSFORM_PATTERN: string[];
|
|
5
5
|
declare const COMPILER_EXCLUDE_PATTERN: string[];
|
|
6
6
|
declare const COMPILER_OUTPUT_DIR = "./compiler";
|
|
7
|
+
declare const COMPILER_SAVE_COMPONENTS = false;
|
|
7
8
|
//#endregion
|
|
8
|
-
export { COMPILER_DICTIONARY_KEY_PREFIX, COMPILER_ENABLED, COMPILER_EXCLUDE_PATTERN, COMPILER_OUTPUT_DIR, COMPILER_TRANSFORM_PATTERN };
|
|
9
|
+
export { COMPILER_DICTIONARY_KEY_PREFIX, COMPILER_ENABLED, COMPILER_EXCLUDE_PATTERN, COMPILER_OUTPUT_DIR, COMPILER_SAVE_COMPONENTS, COMPILER_TRANSFORM_PATTERN };
|
|
9
10
|
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"mappings":";cAAa,gBAAA;AAAA,cAEA,8BAAA;AAAA,cAEA,0BAAA;AAAA,cAGA,wBAAA;AAAA,cAYA,mBAAA"}
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"mappings":";cAAa,gBAAA;AAAA,cAEA,8BAAA;AAAA,cAEA,0BAAA;AAAA,cAGA,wBAAA;AAAA,cAYA,mBAAA;AAAA,cAEA,wBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/config",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
|
|
6
6
|
"keywords": [
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"./package.json"
|
|
116
116
|
],
|
|
117
117
|
"scripts": {
|
|
118
|
-
"_prepublish": "cp -f ../../../README.md ./README.md",
|
|
119
118
|
"build": "tsdown --config tsdown.config.ts",
|
|
120
119
|
"build:ci": "tsdown --config tsdown.config.ts",
|
|
121
120
|
"clean": "rimraf ./dist .turbo",
|
|
@@ -124,7 +123,7 @@
|
|
|
124
123
|
"format:fix": "biome format --write .",
|
|
125
124
|
"lint": "biome lint .",
|
|
126
125
|
"lint:fix": "biome lint --write .",
|
|
127
|
-
"prepublish": "
|
|
126
|
+
"prepublish": "cp -f ../../../README.md ./README.md",
|
|
128
127
|
"publish": "bun publish || true",
|
|
129
128
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
130
129
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
@@ -133,7 +132,7 @@
|
|
|
133
132
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
134
133
|
},
|
|
135
134
|
"dependencies": {
|
|
136
|
-
"@intlayer/types": "8.1.
|
|
135
|
+
"@intlayer/types": "8.1.8",
|
|
137
136
|
"defu": "6.1.4",
|
|
138
137
|
"dotenv": "17.3.1",
|
|
139
138
|
"esbuild": "0.27.2",
|
|
@@ -150,13 +149,9 @@
|
|
|
150
149
|
"vitest": "4.0.18"
|
|
151
150
|
},
|
|
152
151
|
"peerDependencies": {
|
|
153
|
-
"intlayer": "8.1.6",
|
|
154
152
|
"react": ">=16.0.0"
|
|
155
153
|
},
|
|
156
154
|
"peerDependenciesMeta": {
|
|
157
|
-
"intlayer": {
|
|
158
|
-
"optional": true
|
|
159
|
-
},
|
|
160
155
|
"react": {
|
|
161
156
|
"optional": true
|
|
162
157
|
}
|