@intlayer/config 6.0.2 → 6.1.1
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 +237 -139
- package/dist/cjs/alias.cjs +1 -1
- package/dist/cjs/alias.cjs.map +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +11 -4
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +16 -6
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/loadConfigurationFile.cjs +7 -2
- package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
- package/dist/cjs/getSandboxContext.cjs +3 -2
- package/dist/cjs/getSandboxContext.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/loadExternalFile.cjs +6 -2
- package/dist/cjs/loadExternalFile.cjs.map +1 -1
- package/dist/cjs/logger.cjs +22 -17
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/cjs/utils/getExtension.cjs +3 -3
- package/dist/cjs/utils/getExtension.cjs.map +1 -1
- package/dist/esm/alias.mjs +1 -1
- package/dist/esm/alias.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +11 -4
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +16 -6
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs +7 -2
- package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
- package/dist/esm/getSandboxContext.mjs +3 -2
- package/dist/esm/getSandboxContext.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/loadExternalFile.mjs +6 -2
- package/dist/esm/loadExternalFile.mjs.map +1 -1
- package/dist/esm/logger.mjs +21 -17
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/utils/getExtension.mjs +3 -3
- package/dist/esm/utils/getExtension.mjs.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts +2 -2
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +4 -1
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/getSandboxContext.d.ts +1 -1
- package/dist/types/getSandboxContext.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/loadExternalFile.d.ts +1 -1
- package/dist/types/loadExternalFile.d.ts.map +1 -1
- package/dist/types/logger.d.ts +1 -0
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +14 -0
- package/dist/types/types/config.d.ts.map +1 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -1,178 +1,276 @@
|
|
|
1
|
-
<
|
|
2
|
-
<a href="https://intlayer.org">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://intlayer.org" rel="">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/main/docs/assets/cover.png" width="60%" alt="Intlayer Logo" />
|
|
4
4
|
</a>
|
|
5
|
-
</
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<h1 align="center">
|
|
8
|
+
<strong> Intlayer : an Open-source, per-component i18n toolkit with AI-powered translation & CMS.</strong>
|
|
9
|
+
</h1>
|
|
10
|
+
|
|
11
|
+
<br />
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://intlayer.org/doc/concept/content" rel="">Docs</a> •
|
|
15
|
+
<a href="https://intlayer.org/doc/environment/nextjs" rel="">Next.js</a> •
|
|
16
|
+
<a href="https://intlayer.org/doc/environment/vite-and-react" rel="">React + Vite</a> •
|
|
17
|
+
<a href="https://intlayer.org/doc/concept/cms" rel="">CMS</a> •
|
|
18
|
+
<a href="https://discord.gg/7uxamYVeCk" rel="noopener noreferrer nofollow">Discord</a>
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center" style="margin-top:15px;">
|
|
21
|
+
<a href="https://www.npmjs.com/package/intlayer" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/v/intlayer?style=for-the-badge&labelColor=FFFFFF&color=000000&logoColor=FFFFFF" alt="npm version" height="24"/></a>
|
|
22
|
+
<a href="https://github.com/aymericzip/intlayer/stargazers" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/stars/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logo=github&logoColor=FFD700" alt="GitHub Stars" height="24"/></a>
|
|
23
|
+
<a href="https://www.npmjs.org/package/intlayer" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/dm/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="monthly downloads" height="24"/></a>
|
|
24
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/LICENSE" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/license/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="license"/></a>
|
|
25
|
+
<a href="https://github.com/aymericzip/intlayer/commits/main" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/last-commit/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="last commit"/>
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
<a href="https://www.npmjs.com/package/intlayer" target="blank"><img
|
|
9
|
-
align="center"
|
|
10
|
-
alt="npm"
|
|
11
|
-
src="https://img.shields.io/npm/v/intlayer.svg?labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
12
|
-
height="30" /></a>
|
|
13
|
-
<a href="https://npmjs.org/package/intlayer" target="blank"><img
|
|
14
|
-
align="center"
|
|
15
|
-
src="https://img.shields.io/npm/dm/intlayer?labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
16
|
-
alt="monthly downloads"
|
|
17
|
-
height="30"
|
|
18
|
-
/></a>
|
|
19
|
-
<a href="https://npmjs.org/package/intlayer" target="blank"><img
|
|
20
|
-
align="center"
|
|
21
|
-
src="https://img.shields.io/npm/types/intlayer?label=types%20included&labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
22
|
-
alt="types included"
|
|
23
|
-
height="30"
|
|
24
|
-
/></a>
|
|
25
|
-
</div>
|
|
29
|
+

|
|
26
30
|
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<a href="https://discord.gg/528mBV4N" target="blank"><img align="center"
|
|
31
|
-
src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
|
|
32
|
-
alt="Intlayer Discord" height="30"/></a>
|
|
33
|
-
<a href="https://www.linkedin.com/company/intlayerorg" target="blank"><img align="center"
|
|
34
|
-
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
35
|
-
alt="Intlayer LinkedIn" height="30"/></a>
|
|
36
|
-
<a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
|
|
37
|
-
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
38
|
-
alt="Intlayer Facebook" height="30"/></a>
|
|
39
|
-
<a href="https://www.instagram.com/intlayer/" target="blank"><img align="center"
|
|
40
|
-
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
41
|
-
alt="Intlayer Instagram" height="30"/></a>
|
|
42
|
-
<a href="https://x.com/Intlayer183096" target="blank"><img align="center"
|
|
43
|
-
src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
|
|
44
|
-
alt="Intlayer X" height="30"/></a>
|
|
45
|
-
<a href="https://www.youtube.com/@intlayer" target="blank"><img align="center"
|
|
46
|
-
src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
|
|
47
|
-
alt="Intlayer YouTube" height="30"/></a>
|
|
48
|
-
<a href="https://www.tiktok.com/@intlayer" target="blank"><img align="center"
|
|
49
|
-
src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
|
|
50
|
-
alt="Intlayer TikTok" height="30"/></a>
|
|
51
|
-
<br>
|
|
52
|
-
</p>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
# @intlayer/config: Retrieve Intlayer configuration
|
|
31
|
+
<a href="https://intlayer.org/doc/concept/content" rel="">
|
|
32
|
+
<img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
33
|
+
</a>
|
|
56
34
|
|
|
57
|
-
|
|
35
|
+
## What is Intlayer?
|
|
58
36
|
|
|
59
|
-
|
|
37
|
+
Most i18n libraries are either too complex, too rigid, or not built for modern frameworks.
|
|
60
38
|
|
|
61
|
-
|
|
39
|
+
Intlayer is a **modern i18n solution** for web and mobile apps.
|
|
40
|
+
It’s framework-agnostic, **AI-powered**, and includes a free **CMS & visual editor**.
|
|
62
41
|
|
|
63
|
-
|
|
42
|
+
With **per-locale content files**, **TypeScript autocompletion**, **tree-shakable dictionaries**, and **CI/CD integration**, Intlayer makes internationalization **faster, cleaner, and smarter**.
|
|
64
43
|
|
|
65
|
-
|
|
66
|
-
npm install @intlayer/config
|
|
67
|
-
```
|
|
44
|
+
## Keys benefits of Intlayer:
|
|
68
45
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
| Feature | Description |
|
|
47
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| <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. |
|
|
49
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.png?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) |
|
|
50
|
+
| <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) |
|
|
51
|
+
| <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) |
|
|
52
|
+
| <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) |
|
|
53
|
+
| <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) |
|
|
54
|
+
| <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) |
|
|
55
|
+
| <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) |
|
|
56
|
+
| <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) |
|
|
57
|
+
| <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) |
|
|
58
|
+
| <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) |
|
|
59
|
+
| <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) |
|
|
60
|
+
| <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) |
|
|
61
|
+
| <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) |
|
|
62
|
+
| <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) |
|
|
63
|
+
| <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, builting your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
64
|
+
| <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, and react-intl. <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) |
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
yarn add @intlayer/config
|
|
75
|
-
```
|
|
66
|
+
---
|
|
76
67
|
|
|
77
|
-
##
|
|
68
|
+
## 📦 Installation
|
|
78
69
|
|
|
79
|
-
|
|
70
|
+
Start your journey with Intlayer today and experience a smoother, more powerful approach to internationalization.
|
|
80
71
|
|
|
81
|
-
|
|
72
|
+
<a href="https://intlayer.org/doc/concept/content" rel="">
|
|
73
|
+
<img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
74
|
+
</a>
|
|
82
75
|
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const config: IntlayerConfig = getConfiguration();
|
|
87
|
-
|
|
88
|
-
console.log(config);
|
|
89
|
-
// Output:
|
|
90
|
-
// {
|
|
91
|
-
// internationalization: { ... },
|
|
92
|
-
// middleware: { ... },
|
|
93
|
-
// content: { ... },
|
|
94
|
-
// editor: { ... }
|
|
95
|
-
// }
|
|
76
|
+
```bash
|
|
77
|
+
npm install intlayer react-intlayer
|
|
96
78
|
```
|
|
97
79
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Read the configuration of Intlayer using environment variables
|
|
101
|
-
|
|
102
|
-
Example:
|
|
80
|
+
⚡ Quick Start (Next.js)
|
|
103
81
|
|
|
104
82
|
```ts
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const config: IntlayerConfig = getConfiguration({
|
|
108
|
-
env: "production",
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
console.log(config);
|
|
112
|
-
// Output:
|
|
113
|
-
// {
|
|
114
|
-
// internationalization: { ... },
|
|
115
|
-
// middleware: { ... },
|
|
116
|
-
// content: { ... },
|
|
117
|
-
// editor: { ... }
|
|
118
|
-
// }
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
> This function will not return anything if the environment variables are not defined.
|
|
122
|
-
|
|
123
|
-
### Define the environment variables
|
|
124
|
-
|
|
125
|
-
1. Create a configuration file.
|
|
126
|
-
|
|
127
|
-
```ts fileName="intlayer.config.ts"
|
|
128
|
-
import { type IntlayerConfig } from "intlayer";
|
|
83
|
+
// intlayer.config.ts
|
|
84
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
129
85
|
|
|
130
86
|
const config: IntlayerConfig = {
|
|
131
87
|
internationalization: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
middleware: {
|
|
135
|
-
/* ... */
|
|
136
|
-
},
|
|
137
|
-
content: {
|
|
138
|
-
/* ... */
|
|
139
|
-
},
|
|
140
|
-
editor: {
|
|
141
|
-
/* ... */
|
|
88
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
89
|
+
defaultLocale: Locales.ENGLISH,
|
|
142
90
|
},
|
|
143
91
|
};
|
|
144
92
|
|
|
145
93
|
export default config;
|
|
146
94
|
```
|
|
147
95
|
|
|
148
|
-
|
|
96
|
+
```ts
|
|
97
|
+
// app/home.content.ts
|
|
98
|
+
import { t, type Dictionary } from "intlayer";
|
|
149
99
|
|
|
150
|
-
|
|
100
|
+
const content = {
|
|
101
|
+
key: "home",
|
|
102
|
+
content: {
|
|
103
|
+
title: t({
|
|
104
|
+
en: "Home",
|
|
105
|
+
fr: "Accueil",
|
|
106
|
+
es: "Inicio",
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
} satisfies Dictionary;
|
|
151
110
|
|
|
152
|
-
|
|
153
|
-
|
|
111
|
+
export default content;
|
|
112
|
+
```
|
|
154
113
|
|
|
155
|
-
|
|
114
|
+
```tsx
|
|
115
|
+
// app/page.tsx
|
|
116
|
+
import { useIntlayer } from "react-intlayer";
|
|
156
117
|
|
|
157
|
-
|
|
158
|
-
const
|
|
118
|
+
const HomePage = () => {
|
|
119
|
+
const { title } = useIntlayer("home");
|
|
159
120
|
|
|
160
|
-
|
|
161
|
-
|
|
121
|
+
return <h1>{title}</h1>;
|
|
122
|
+
};
|
|
162
123
|
```
|
|
163
124
|
|
|
164
|
-
|
|
125
|
+
<a href="https://intlayer.org/doc/environment/nextjs"> Get the full guide → </a>
|
|
126
|
+
|
|
127
|
+
## 🎥 Live tutorial on YouTube
|
|
128
|
+
|
|
129
|
+
[](https://youtu.be/e_PPG7PTqGU?si=GyU_KpVhr61razRw)
|
|
130
|
+
|
|
131
|
+
<a href="https://intlayer.org/doc/concept/content" rel="">
|
|
132
|
+
<img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
133
|
+
</a>
|
|
134
|
+
|
|
135
|
+
## Table of Contents
|
|
136
|
+
|
|
137
|
+
Explore our comprehensive documentation to get started with Intlayer and learn how to integrate it into your projects.
|
|
138
|
+
|
|
139
|
+
<details open>
|
|
140
|
+
<summary style="font-size:16px; font-weight:bold;">📘 Get Started</summary>
|
|
141
|
+
<ul>
|
|
142
|
+
<li><a href="https://intlayer.org/doc/why" rel=''>Why Intlayer?</a></li>
|
|
143
|
+
<li><a href="https://intlayer.org/doc" rel=''>Introduction</a></li>
|
|
144
|
+
</ul>
|
|
145
|
+
</details>
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary style="font-size:16px; font-weight:bold;">⚙️ Concept</summary>
|
|
149
|
+
<ul>
|
|
150
|
+
<li><a href="https://intlayer.org/doc/concept/how-works-intlayer" rel=''>How Intlayer Works</a></li>
|
|
151
|
+
<li><a href="https://intlayer.org/doc/concept/configuration" rel=''>Configuration</a></li>
|
|
152
|
+
<li><a href="https://intlayer.org/doc/concept/cli" rel=''>Intlayer CLI</a></li>
|
|
153
|
+
<li><a href="https://intlayer.org/doc/concept/editor" rel=''>Intlayer Editor</a></li>
|
|
154
|
+
<li><a href="https://intlayer.org/doc/concept/cms" rel=''>Intlayer CMS</a></li>
|
|
155
|
+
<li><a href="https://intlayer.org/doc/concept/content" rel=''>Dictionary</a>
|
|
156
|
+
<ul>
|
|
157
|
+
<li><a href="https://intlayer.org/doc/concept/content/per-locale-file" rel=''>Per-Locale Content Declaration File</a></li>
|
|
158
|
+
<li><a href="https://intlayer.org/doc/concept/content/translation" rel=''>Translation</a></li>
|
|
159
|
+
<li><a href="https://intlayer.org/doc/concept/content/enumeration" rel=''>Enumeration</a></li>
|
|
160
|
+
<li><a href="https://intlayer.org/doc/concept/content/condition" rel=''>Condition</a></li>
|
|
161
|
+
<li><a href="https://intlayer.org/doc/concept/content/nesting" rel=''>Nesting</a></li>
|
|
162
|
+
<li><a href="https://intlayer.org/doc/concept/content/markdown" rel=''>Markdown</a></li>
|
|
163
|
+
<li><a href="https://intlayer.org/doc/concept/content/function-fetching" rel=''>Function Fetching</a></li>
|
|
164
|
+
<li><a href="https://intlayer.org/doc/concept/content/insertion" rel=''>Insertion</a></li>
|
|
165
|
+
<li><a href="https://intlayer.org/doc/concept/content/file" rel=''>File</a></li>
|
|
166
|
+
</ul>
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</details>
|
|
170
|
+
|
|
171
|
+
<details open>
|
|
172
|
+
<summary style="font-size:16px; font-weight:bold;">🌐 Environment</summary>
|
|
173
|
+
<ul>
|
|
174
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs" rel=''>Intlayer with Next.js 15</a>
|
|
175
|
+
<ul>
|
|
176
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs/14" rel=''>Next.js 14 (App Router)</a></li>
|
|
177
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router" rel=''>Next.js Page Router</a></li>
|
|
178
|
+
</ul>
|
|
179
|
+
</li>
|
|
180
|
+
<li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
|
|
181
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a>
|
|
182
|
+
<ul>
|
|
183
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/react-router-v7" rel=''>React-router-v7</a></li>
|
|
184
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start" rel=''>Tanstack start</a></li>
|
|
185
|
+
</ul>
|
|
186
|
+
</li>
|
|
187
|
+
<li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
|
|
188
|
+
<li><a href="https://intlayer.org/doc/environment/lynx-and-react" rel=''>Lynx + React</a></li>
|
|
189
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
|
|
190
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-preact" rel=''>Vite + Preact</a></li>
|
|
191
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-vue" rel=''>Vite + Vue</a></li>
|
|
192
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-nuxt" rel=''>Vite + Nuxt</a></li>
|
|
193
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
|
|
194
|
+
<li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
|
|
195
|
+
<li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
|
|
196
|
+
<li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
|
|
197
|
+
</ul>
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary style="font-size:16px; font-weight:bold;">📰 Blog</summary>
|
|
202
|
+
<ul>
|
|
203
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/what_is_internationalization.md" rel=''>What is i18n</a></li>
|
|
204
|
+
<li><a href="https://intlayer.org/blog/SEO-and-i18n" rel=''>i18n and SEO</a></li>
|
|
205
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-next-i18next" rel=''>Intlayer and i18next</a></li>
|
|
206
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-react-i18next" rel=''>Intlayer and react-intl</a></li>
|
|
207
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-next-intl" rel=''>Intlayer and next-intl</a></li>
|
|
208
|
+
</ul>
|
|
209
|
+
</details>
|
|
210
|
+
|
|
211
|
+
## 🌐 Readme in other languages
|
|
212
|
+
|
|
213
|
+
<p align="center">
|
|
214
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/readme.md">English</a> •
|
|
215
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/readme.md">简体中文</a> •
|
|
216
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/readme.md">Русский</a> •
|
|
217
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/readme.md">日本語</a> •
|
|
218
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/readme.md">Français</a> •
|
|
219
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/readme.md">한국어</a> •
|
|
220
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/readme.md">Español</a> •
|
|
221
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/readme.md">Deutsch</a> •
|
|
222
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/readme.md">العربية</a> •
|
|
223
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/readme.md">Italiano</a> •
|
|
224
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/readme.md">English (UK)</a> •
|
|
225
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/readme.md">Português</a> •
|
|
226
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/readme.md">हिन्दी</a> •
|
|
227
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/readme.md">Türkçe</a>
|
|
228
|
+
</p>
|
|
229
|
+
|
|
230
|
+
## 🤝 Community
|
|
231
|
+
|
|
232
|
+
Intlayer is built with and for the community and we’d love your input!
|
|
233
|
+
|
|
234
|
+
- Have a suggestion? [Open an issue](https://github.com/aymericzip/intlayer/issues)
|
|
235
|
+
- Found a bug or improvement? [Submit a PR](https://github.com/aymericzip/intlayer/pulls)
|
|
236
|
+
- Need help or want to connect? [Join our Discord](https://discord.gg/7uxamYVeCk)
|
|
237
|
+
|
|
238
|
+
You can also follow us on :
|
|
239
|
+
|
|
240
|
+
<div>
|
|
241
|
+
<br/>
|
|
242
|
+
<p align="center">
|
|
243
|
+
<a href="https://discord.gg/528mBV4N" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
244
|
+
src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
|
|
245
|
+
alt="Intlayer Discord" height="30"/></a>
|
|
246
|
+
<a href="https://www.linkedin.com/company/intlayerorg" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
247
|
+
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
248
|
+
alt="Intlayer LinkedIn" height="30"/></a>
|
|
249
|
+
<a href="https://www.facebook.com/intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
250
|
+
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
251
|
+
alt="Intlayer Facebook" height="30"/></a>
|
|
252
|
+
<a href="https://www.instagram.com/intlayer/" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
253
|
+
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
254
|
+
alt="Intlayer Instagram" height="30"/></a>
|
|
255
|
+
<a href="https://x.com/Intlayer183096" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
256
|
+
src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
|
|
257
|
+
alt="Intlayer X" height="30"/></a>
|
|
258
|
+
<a href="https://www.youtube.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
259
|
+
src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
|
|
260
|
+
alt="Intlayer YouTube" height="30"/></a>
|
|
261
|
+
<a href="https://www.tiktok.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
262
|
+
src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
|
|
263
|
+
alt="Intlayer TikTok" height="30"/></a>
|
|
264
|
+
<br>
|
|
265
|
+
</p>
|
|
266
|
+
</div>
|
|
165
267
|
|
|
166
|
-
|
|
167
|
-
import { getConfiguration } from "@intlayer/config/client";
|
|
268
|
+
### Contribution
|
|
168
269
|
|
|
169
|
-
|
|
170
|
-
```
|
|
270
|
+
For more detailed guidelines on contributing to this project, please refer to the [`CONTRIBUTING.md`](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md) file. It contains essential information on our development process, commit message conventions, and release procedures. Your contributions are valuable to us, and we appreciate your efforts in making this project better!
|
|
171
271
|
|
|
172
|
-
|
|
272
|
+
### Thank You for the Support
|
|
173
273
|
|
|
174
|
-
|
|
175
|
-
- [Intlayer Documentation](https://intlayer.org/doc)
|
|
176
|
-
- [Intlayer GitHub](https://github.com/aymericzip/intlayer)
|
|
274
|
+
If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
|
|
177
275
|
|
|
178
|
-
|
|
276
|
+
[](https://star-history.com/#aymericzip/intlayer&Date)
|
package/dist/cjs/alias.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var import_getExtension = require('./utils/getExtension.cjs');
|
|
|
27
27
|
var import_normalizePath = require('./utils/normalizePath.cjs');
|
|
28
28
|
const getAlias = ({
|
|
29
29
|
configuration = (0, import_getConfiguration.getConfiguration)(),
|
|
30
|
-
format,
|
|
30
|
+
format = "esm",
|
|
31
31
|
formatter = (value) => value
|
|
32
32
|
} = {}) => {
|
|
33
33
|
const extension = (0, import_getExtension.getExtension)(configuration, format);
|
package/dist/cjs/alias.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/alias.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { getConfiguration } from './configFile/getConfiguration';\nimport { IntlayerConfig } from './types/config';\nimport { getExtension } from './utils/getExtension';\nimport { normalizePath } from './utils/normalizePath';\n\nexport type GetAliasOptions = {\n configuration?: IntlayerConfig;\n format?: 'esm' | 'cjs';\n formatter?: (value: string) => string;\n};\n\nexport const getAlias = ({\n configuration = getConfiguration(),\n format,\n formatter = (value: string) => value,\n}: GetAliasOptions = {}) => {\n const extension = getExtension(configuration, format);\n\n const { mainDir, configDir, baseDir } = configuration.content;\n\n /**\n * Dictionaries\n */\n const dictionariesPath = join(mainDir, `dictionaries.${extension}`);\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const normalizedDictionariesPath = formatter(\n normalizePath(relativeDictionariesPath)\n );\n\n /**\n * Unmerged dictionaries\n */\n const unmergedDictionariesPath = join(\n mainDir,\n `unmerged_dictionaries.${extension}`\n );\n const relativeUnmergedDictionariesPath = relative(\n baseDir,\n unmergedDictionariesPath\n );\n const normalizedUnmergedDictionariesPath = formatter(\n normalizePath(relativeUnmergedDictionariesPath)\n );\n\n /**\n * Remote dictionaries\n */\n const remoteDictionariesPath = join(\n mainDir,\n `remote_dictionaries.${extension}`\n );\n const relativeRemoteDictionariesPath = relative(\n baseDir,\n remoteDictionariesPath\n );\n const normalizedRemoteDictionariesPath = formatter(\n normalizePath(relativeRemoteDictionariesPath)\n );\n\n /**\n * Dynamic dictionaries\n */\n const dynamicDictionariesPath = join(\n mainDir,\n `dynamic_dictionaries.${extension}`\n );\n const relativeDynamicDictionariesPath = relative(\n baseDir,\n dynamicDictionariesPath\n );\n const normalizedDynamicDictionariesPath = formatter(\n normalizePath(relativeDynamicDictionariesPath)\n );\n\n /**\n * Fetch dictionaries\n */\n const fetchDictionariesPath = join(\n mainDir,\n `fetch_dictionaries.${extension}`\n );\n const relativeFetchDictionariesPath = relative(\n baseDir,\n fetchDictionariesPath\n );\n const normalizedFetchDictionariesPath = formatter(\n normalizePath(relativeFetchDictionariesPath)\n );\n\n /**\n * Configuration\n */\n const configurationPath = join(configDir, `configuration.json`);\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n const normalizedConfigurationPath = formatter(\n normalizePath(relativeConfigurationPath)\n );\n\n return {\n '@intlayer/dictionaries-entry': normalizedDictionariesPath,\n '@intlayer/unmerged-dictionaries-entry': normalizedUnmergedDictionariesPath,\n '@intlayer/remote-dictionaries-entry': normalizedRemoteDictionariesPath,\n '@intlayer/dynamic-dictionaries-entry': normalizedDynamicDictionariesPath,\n '@intlayer/fetch-dictionaries-entry': normalizedFetchDictionariesPath,\n '@intlayer/config/built': normalizedConfigurationPath,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA+B;AAC/B,8BAAiC;AAEjC,0BAA6B;AAC7B,2BAA8B;AAQvB,MAAM,WAAW,CAAC;AAAA,EACvB,oBAAgB,0CAAiB;AAAA,EACjC;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/alias.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { getConfiguration } from './configFile/getConfiguration';\nimport { IntlayerConfig } from './types/config';\nimport { getExtension } from './utils/getExtension';\nimport { normalizePath } from './utils/normalizePath';\n\nexport type GetAliasOptions = {\n configuration?: IntlayerConfig;\n format?: 'esm' | 'cjs';\n formatter?: (value: string) => string;\n};\n\nexport const getAlias = ({\n configuration = getConfiguration(),\n format = 'esm',\n formatter = (value: string) => value,\n}: GetAliasOptions = {}) => {\n const extension = getExtension(configuration, format);\n\n const { mainDir, configDir, baseDir } = configuration.content;\n\n /**\n * Dictionaries\n */\n const dictionariesPath = join(mainDir, `dictionaries.${extension}`);\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const normalizedDictionariesPath = formatter(\n normalizePath(relativeDictionariesPath)\n );\n\n /**\n * Unmerged dictionaries\n */\n const unmergedDictionariesPath = join(\n mainDir,\n `unmerged_dictionaries.${extension}`\n );\n const relativeUnmergedDictionariesPath = relative(\n baseDir,\n unmergedDictionariesPath\n );\n const normalizedUnmergedDictionariesPath = formatter(\n normalizePath(relativeUnmergedDictionariesPath)\n );\n\n /**\n * Remote dictionaries\n */\n const remoteDictionariesPath = join(\n mainDir,\n `remote_dictionaries.${extension}`\n );\n const relativeRemoteDictionariesPath = relative(\n baseDir,\n remoteDictionariesPath\n );\n const normalizedRemoteDictionariesPath = formatter(\n normalizePath(relativeRemoteDictionariesPath)\n );\n\n /**\n * Dynamic dictionaries\n */\n const dynamicDictionariesPath = join(\n mainDir,\n `dynamic_dictionaries.${extension}`\n );\n const relativeDynamicDictionariesPath = relative(\n baseDir,\n dynamicDictionariesPath\n );\n const normalizedDynamicDictionariesPath = formatter(\n normalizePath(relativeDynamicDictionariesPath)\n );\n\n /**\n * Fetch dictionaries\n */\n const fetchDictionariesPath = join(\n mainDir,\n `fetch_dictionaries.${extension}`\n );\n const relativeFetchDictionariesPath = relative(\n baseDir,\n fetchDictionariesPath\n );\n const normalizedFetchDictionariesPath = formatter(\n normalizePath(relativeFetchDictionariesPath)\n );\n\n /**\n * Configuration\n */\n const configurationPath = join(configDir, `configuration.json`);\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n const normalizedConfigurationPath = formatter(\n normalizePath(relativeConfigurationPath)\n );\n\n return {\n '@intlayer/dictionaries-entry': normalizedDictionariesPath,\n '@intlayer/unmerged-dictionaries-entry': normalizedUnmergedDictionariesPath,\n '@intlayer/remote-dictionaries-entry': normalizedRemoteDictionariesPath,\n '@intlayer/dynamic-dictionaries-entry': normalizedDynamicDictionariesPath,\n '@intlayer/fetch-dictionaries-entry': normalizedFetchDictionariesPath,\n '@intlayer/config/built': normalizedConfigurationPath,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA+B;AAC/B,8BAAiC;AAEjC,0BAA6B;AAC7B,2BAA8B;AAQvB,MAAM,WAAW,CAAC;AAAA,EACvB,oBAAgB,0CAAiB;AAAA,EACjC,SAAS;AAAA,EACT,YAAY,CAAC,UAAkB;AACjC,IAAqB,CAAC,MAAM;AAC1B,QAAM,gBAAY,kCAAa,eAAe,MAAM;AAEpD,QAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,cAAc;AAKtD,QAAM,uBAAmB,kBAAK,SAAS,gBAAgB,SAAS,EAAE;AAClE,QAAM,+BAA2B,sBAAS,SAAS,gBAAgB;AACnE,QAAM,6BAA6B;AAAA,QACjC,oCAAc,wBAAwB;AAAA,EACxC;AAKA,QAAM,+BAA2B;AAAA,IAC/B;AAAA,IACA,yBAAyB,SAAS;AAAA,EACpC;AACA,QAAM,uCAAmC;AAAA,IACvC;AAAA,IACA;AAAA,EACF;AACA,QAAM,qCAAqC;AAAA,QACzC,oCAAc,gCAAgC;AAAA,EAChD;AAKA,QAAM,6BAAyB;AAAA,IAC7B;AAAA,IACA,uBAAuB,SAAS;AAAA,EAClC;AACA,QAAM,qCAAiC;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AACA,QAAM,mCAAmC;AAAA,QACvC,oCAAc,8BAA8B;AAAA,EAC9C;AAKA,QAAM,8BAA0B;AAAA,IAC9B;AAAA,IACA,wBAAwB,SAAS;AAAA,EACnC;AACA,QAAM,sCAAkC;AAAA,IACtC;AAAA,IACA;AAAA,EACF;AACA,QAAM,oCAAoC;AAAA,QACxC,oCAAc,+BAA+B;AAAA,EAC/C;AAKA,QAAM,4BAAwB;AAAA,IAC5B;AAAA,IACA,sBAAsB,SAAS;AAAA,EACjC;AACA,QAAM,oCAAgC;AAAA,IACpC;AAAA,IACA;AAAA,EACF;AACA,QAAM,kCAAkC;AAAA,QACtC,oCAAc,6BAA6B;AAAA,EAC7C;AAKA,QAAM,wBAAoB,kBAAK,WAAW,oBAAoB;AAC9D,QAAM,gCAA4B,sBAAS,SAAS,iBAAiB;AACrE,QAAM,8BAA8B;AAAA,QAClC,oCAAc,yBAAyB;AAAA,EACzC;AAEA,SAAO;AAAA,IACL,gCAAgC;AAAA,IAChC,yCAAyC;AAAA,IACzC,uCAAuC;AAAA,IACvC,wCAAwC;AAAA,IACxC,sCAAsC;AAAA,IACtC,0BAA0B;AAAA,EAC5B;AACF;","names":[]}
|
|
@@ -517,7 +517,7 @@ const buildEditorFields = (customConfiguration) => ({
|
|
|
517
517
|
*/
|
|
518
518
|
liveSyncURL: customConfiguration?.liveSyncURL ?? `http://localhost:${customConfiguration?.liveSyncPort ?? import_editor.LIVE_SYNC_PORT}`
|
|
519
519
|
});
|
|
520
|
-
const buildLogFields = (customConfiguration) => ({
|
|
520
|
+
const buildLogFields = (customConfiguration, logFunctions) => ({
|
|
521
521
|
/**
|
|
522
522
|
* Indicates if the logger is enabled
|
|
523
523
|
*
|
|
@@ -535,7 +535,14 @@ const buildLogFields = (customConfiguration) => ({
|
|
|
535
535
|
*
|
|
536
536
|
* The prefix of the logger.
|
|
537
537
|
*/
|
|
538
|
-
prefix: customConfiguration?.prefix ?? import_log.PREFIX
|
|
538
|
+
prefix: customConfiguration?.prefix ?? import_log.PREFIX,
|
|
539
|
+
/**
|
|
540
|
+
* Functions to log
|
|
541
|
+
*/
|
|
542
|
+
error: logFunctions?.error,
|
|
543
|
+
log: logFunctions?.log,
|
|
544
|
+
info: logFunctions?.info,
|
|
545
|
+
warn: logFunctions?.warn
|
|
539
546
|
});
|
|
540
547
|
const buildAiFields = (customConfiguration) => ({
|
|
541
548
|
/**
|
|
@@ -633,7 +640,7 @@ const buildBuildFields = (customConfiguration) => ({
|
|
|
633
640
|
*/
|
|
634
641
|
outputFormat: customConfiguration?.outputFormat ?? import_build.OUTPUT_FORMAT
|
|
635
642
|
});
|
|
636
|
-
const buildConfigurationFields = (customConfiguration, baseDir) => {
|
|
643
|
+
const buildConfigurationFields = (customConfiguration, baseDir, logFunctions) => {
|
|
637
644
|
const internationalizationConfig = buildInternationalizationFields(
|
|
638
645
|
customConfiguration?.internationalization
|
|
639
646
|
);
|
|
@@ -645,7 +652,7 @@ const buildConfigurationFields = (customConfiguration, baseDir) => {
|
|
|
645
652
|
baseDir
|
|
646
653
|
);
|
|
647
654
|
const editorConfig = buildEditorFields(customConfiguration?.editor);
|
|
648
|
-
const logConfig = buildLogFields(customConfiguration?.log);
|
|
655
|
+
const logConfig = buildLogFields(customConfiguration?.log, logFunctions);
|
|
649
656
|
const aiConfig = buildAiFields(customConfiguration?.ai);
|
|
650
657
|
const buildConfig = buildBuildFields(customConfiguration?.build);
|
|
651
658
|
storedConfiguration = {
|