@intlayer/cli 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 +249 -56
- package/dist/cjs/build.cjs +8 -0
- package/dist/cjs/build.cjs.map +1 -1
- package/dist/cjs/cli.cjs +32 -5
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/fill/index.cjs +114 -59
- package/dist/cjs/fill/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +4 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/liveSync.cjs +6 -30
- package/dist/cjs/liveSync.cjs.map +1 -1
- package/dist/cjs/pull.cjs +1 -1
- package/dist/cjs/pull.cjs.map +1 -1
- package/dist/cjs/push/pullLog.cjs.map +1 -0
- package/dist/cjs/{push.cjs → push/push.cjs} +2 -2
- package/dist/cjs/push/push.cjs.map +1 -0
- package/dist/cjs/reviewDoc.cjs +148 -96
- package/dist/cjs/reviewDoc.cjs.map +1 -1
- package/dist/cjs/test/index.cjs +2 -0
- package/dist/cjs/test/index.cjs.map +1 -1
- package/dist/cjs/translateDoc.cjs +39 -42
- package/dist/cjs/translateDoc.cjs.map +1 -1
- package/dist/cjs/utils/mapChunksBetweenFiles.cjs +145 -0
- package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -0
- package/dist/cjs/watch.cjs +42 -0
- package/dist/cjs/watch.cjs.map +1 -0
- package/dist/esm/build.mjs +12 -1
- package/dist/esm/build.mjs.map +1 -1
- package/dist/esm/cli.mjs +32 -5
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/fill/index.mjs +114 -59
- package/dist/esm/fill/index.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/liveSync.mjs +10 -31
- package/dist/esm/liveSync.mjs.map +1 -1
- package/dist/esm/pull.mjs +1 -1
- package/dist/esm/pull.mjs.map +1 -1
- package/dist/esm/push/pullLog.mjs.map +1 -0
- package/dist/esm/{push.mjs → push/push.mjs} +2 -2
- package/dist/esm/push/push.mjs.map +1 -0
- package/dist/esm/reviewDoc.mjs +151 -97
- package/dist/esm/reviewDoc.mjs.map +1 -1
- package/dist/esm/test/index.mjs +2 -0
- package/dist/esm/test/index.mjs.map +1 -1
- package/dist/esm/translateDoc.mjs +41 -43
- package/dist/esm/translateDoc.mjs.map +1 -1
- package/dist/esm/utils/mapChunksBetweenFiles.mjs +121 -0
- package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -0
- package/dist/esm/watch.mjs +21 -0
- package/dist/esm/watch.mjs.map +1 -0
- package/dist/types/build.d.ts +2 -0
- package/dist/types/build.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/fill/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/liveSync.d.ts +1 -1
- package/dist/types/liveSync.d.ts.map +1 -1
- package/dist/types/push/pullLog.d.ts.map +1 -0
- package/dist/types/push/push.d.ts.map +1 -0
- package/dist/types/reviewDoc.d.ts +2 -2
- package/dist/types/reviewDoc.d.ts.map +1 -1
- package/dist/types/test/index.d.ts.map +1 -1
- package/dist/types/translateDoc.d.ts.map +1 -1
- package/dist/types/utils/mapChunksBetweenFiles.d.ts +12 -0
- package/dist/types/utils/mapChunksBetweenFiles.d.ts.map +1 -0
- package/dist/types/watch.d.ts +13 -0
- package/dist/types/watch.d.ts.map +1 -0
- package/package.json +21 -21
- package/dist/cjs/pullLog.cjs.map +0 -1
- package/dist/cjs/push.cjs.map +0 -1
- package/dist/esm/pullLog.mjs.map +0 -1
- package/dist/esm/push.mjs.map +0 -1
- package/dist/types/pullLog.d.ts.map +0 -1
- package/dist/types/push.d.ts.map +0 -1
- /package/dist/cjs/{pullLog.cjs → push/pullLog.cjs} +0 -0
- /package/dist/esm/{pullLog.mjs → push/pullLog.mjs} +0 -0
- /package/dist/types/{pullLog.d.ts → push/pullLog.d.ts} +0 -0
- /package/dist/types/{push.d.ts → push/push.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,83 +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
6
|
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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>
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
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>
|
|
34
|
+
|
|
35
|
+
## What is Intlayer?
|
|
36
|
+
|
|
37
|
+
Most i18n libraries are either too complex, too rigid, or not built for modern frameworks.
|
|
38
|
+
|
|
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**.
|
|
41
|
+
|
|
42
|
+
With **per-locale content files**, **TypeScript autocompletion**, **tree-shakable dictionaries**, and **CI/CD integration**, Intlayer makes internationalization **faster, cleaner, and smarter**.
|
|
43
|
+
|
|
44
|
+
## Keys benefits of Intlayer:
|
|
45
|
+
|
|
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) |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 📦 Installation
|
|
69
|
+
|
|
70
|
+
Start your journey with Intlayer today and experience a smoother, more powerful approach to internationalization.
|
|
71
|
+
|
|
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>
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install intlayer react-intlayer
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
⚡ Quick Start (Next.js)
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// intlayer.config.ts
|
|
84
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
85
|
+
|
|
86
|
+
const config: IntlayerConfig = {
|
|
87
|
+
internationalization: {
|
|
88
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
89
|
+
defaultLocale: Locales.ENGLISH,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default config;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// app/home.content.ts
|
|
98
|
+
import { t, type Dictionary } from "intlayer";
|
|
99
|
+
|
|
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;
|
|
110
|
+
|
|
111
|
+
export default content;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// app/page.tsx
|
|
116
|
+
import { useIntlayer } from "react-intlayer";
|
|
26
117
|
|
|
27
|
-
|
|
118
|
+
const HomePage = () => {
|
|
119
|
+
const { title } = useIntlayer("home");
|
|
120
|
+
|
|
121
|
+
return <h1>{title}</h1>;
|
|
122
|
+
};
|
|
123
|
+
```
|
|
124
|
+
|
|
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>
|
|
28
241
|
<br/>
|
|
29
242
|
<p align="center">
|
|
30
|
-
<a href="https://discord.gg/528mBV4N" target="blank"><img align="center"
|
|
243
|
+
<a href="https://discord.gg/528mBV4N" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
31
244
|
src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
|
|
32
245
|
alt="Intlayer Discord" height="30"/></a>
|
|
33
|
-
<a href="https://www.linkedin.com/company/intlayerorg" target="blank"><img align="center"
|
|
246
|
+
<a href="https://www.linkedin.com/company/intlayerorg" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
34
247
|
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
35
248
|
alt="Intlayer LinkedIn" height="30"/></a>
|
|
36
|
-
<a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
|
|
249
|
+
<a href="https://www.facebook.com/intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
37
250
|
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
38
251
|
alt="Intlayer Facebook" height="30"/></a>
|
|
39
|
-
<a href="https://www.instagram.com/intlayer/" target="blank"><img align="center"
|
|
252
|
+
<a href="https://www.instagram.com/intlayer/" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
40
253
|
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
41
254
|
alt="Intlayer Instagram" height="30"/></a>
|
|
42
|
-
<a href="https://x.com/Intlayer183096" target="blank"><img align="center"
|
|
255
|
+
<a href="https://x.com/Intlayer183096" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
43
256
|
src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
|
|
44
257
|
alt="Intlayer X" height="30"/></a>
|
|
45
|
-
<a href="https://www.youtube.com/@intlayer" target="blank"><img align="center"
|
|
258
|
+
<a href="https://www.youtube.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
46
259
|
src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
|
|
47
260
|
alt="Intlayer YouTube" height="30"/></a>
|
|
48
|
-
<a href="https://www.tiktok.com/@intlayer" target="blank"><img align="center"
|
|
261
|
+
<a href="https://www.tiktok.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
49
262
|
src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
|
|
50
263
|
alt="Intlayer TikTok" height="30"/></a>
|
|
51
264
|
<br>
|
|
52
265
|
</p>
|
|
53
266
|
</div>
|
|
54
267
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
**Intlayer** is a suite of packages designed specifically for JavaScript developers. It is compatible with frameworks like React, React, and Express.js.
|
|
58
|
-
|
|
59
|
-
The **`@intlayer/cli`** package is a NPM package that is used to declare the script related to the intlayer commands line interfaces. It ensure the uniformity of all intlayer CLI commands. This package is notably consumed by the [intlayer-cli](https://github.com/aymericzip/intlayer/tree/main/docs/en/packages/intlayer-cli/index.md), and the [intlayer](https://github.com/aymericzip/intlayer/tree/main/docs/en/packages/intlayer/index.md) packages.
|
|
268
|
+
### Contribution
|
|
60
269
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Install the necessary package using your preferred package manager:
|
|
64
|
-
|
|
65
|
-
```bash packageManager="npm"
|
|
66
|
-
npm install @intlayer/cli
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
```bash packageManager="pnpm"
|
|
70
|
-
pnpm add @intlayer/cli
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
```bash packageManager="yarn"
|
|
74
|
-
yarn add @intlayer/cli
|
|
75
|
-
```
|
|
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!
|
|
76
271
|
|
|
77
|
-
|
|
272
|
+
### Thank You for the Support
|
|
78
273
|
|
|
79
|
-
|
|
80
|
-
- [Intlayer Documentation](https://intlayer.org/doc)
|
|
81
|
-
- [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-).
|
|
82
275
|
|
|
83
|
-
|
|
276
|
+
[](https://star-history.com/#aymericzip/intlayer&Date)
|
package/dist/cjs/build.cjs
CHANGED
|
@@ -25,10 +25,18 @@ var import_chokidar = require("@intlayer/chokidar");
|
|
|
25
25
|
var import_config = require("@intlayer/config");
|
|
26
26
|
const build = async (options) => {
|
|
27
27
|
const config = (0, import_config.getConfiguration)(options?.configOptions);
|
|
28
|
+
let parallelProcess = null;
|
|
29
|
+
if (options?.with) {
|
|
30
|
+
parallelProcess = (0, import_chokidar.runParallel)(options.with);
|
|
31
|
+
}
|
|
28
32
|
await (0, import_chokidar.buildAndWatchIntlayer)({
|
|
29
33
|
persistent: options?.watch ?? false,
|
|
34
|
+
skipPrepare: options?.skipPrepare ?? false,
|
|
30
35
|
configuration: config
|
|
31
36
|
});
|
|
37
|
+
if (!options?.watch && parallelProcess) {
|
|
38
|
+
parallelProcess.kill();
|
|
39
|
+
}
|
|
32
40
|
};
|
|
33
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
42
|
0 && (module.exports = {
|
package/dist/cjs/build.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/build.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/build.ts"],"sourcesContent":["import {\n buildAndWatchIntlayer,\n runParallel,\n type ParallelHandle,\n} from '@intlayer/chokidar';\nimport {\n getConfiguration,\n type GetConfigurationOptions,\n} from '@intlayer/config';\n\ntype BuildOptions = {\n watch?: boolean;\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const build = async (options?: BuildOptions) => {\n const config = getConfiguration(options?.configOptions);\n let parallelProcess: ParallelHandle | null = null;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n }\n\n await buildAndWatchIntlayer({\n persistent: options?.watch ?? false,\n skipPrepare: options?.skipPrepare ?? false,\n configuration: config,\n });\n\n if (!options?.watch && parallelProcess) {\n parallelProcess.kill();\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAIO;AACP,oBAGO;AAaA,MAAM,QAAQ,OAAO,YAA2B;AACrD,QAAM,aAAS,gCAAiB,SAAS,aAAa;AACtD,MAAI,kBAAyC;AAE7C,MAAI,SAAS,MAAM;AACjB,0BAAkB,6BAAY,QAAQ,IAAI;AAAA,EAC5C;AAEA,YAAM,uCAAsB;AAAA,IAC1B,YAAY,SAAS,SAAS;AAAA,IAC9B,aAAa,SAAS,eAAe;AAAA,IACrC,eAAe;AAAA,EACjB,CAAC;AAED,MAAI,CAAC,SAAS,SAAS,iBAAiB;AACtC,oBAAgB,KAAK;AAAA,EACvB;AACF;","names":[]}
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -43,18 +43,19 @@ var import_fill = require('./fill/index.cjs');
|
|
|
43
43
|
var import_listContentDeclaration = require('./listContentDeclaration.cjs');
|
|
44
44
|
var import_liveSync = require('./liveSync.cjs');
|
|
45
45
|
var import_pull = require('./pull.cjs');
|
|
46
|
-
var import_push = require('./push.cjs');
|
|
46
|
+
var import_push = require('./push/push.cjs');
|
|
47
47
|
var import_pushConfig = require('./pushConfig.cjs');
|
|
48
48
|
var import_reviewDoc = require('./reviewDoc.cjs');
|
|
49
49
|
var import_test = require('./test/index.cjs');
|
|
50
50
|
var import_translateDoc = require('./translateDoc.cjs');
|
|
51
51
|
var import_getParentPackageJSON = require('./utils/getParentPackageJSON.cjs');
|
|
52
|
+
var import_watch = require('./watch.cjs');
|
|
52
53
|
const import_meta = {};
|
|
53
54
|
const isESModule = typeof import_meta.url === "string";
|
|
54
55
|
const dirname = isESModule ? (0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url)) : __dirname;
|
|
55
56
|
const packageJson = (0, import_getParentPackageJSON.getParentPackageJSON)(dirname);
|
|
56
57
|
const logOptions = [
|
|
57
|
-
["--verbose", "Verbose"],
|
|
58
|
+
["--verbose", "Verbose (default to true using CLI)"],
|
|
58
59
|
["--prefix [prefix]", "Prefix"]
|
|
59
60
|
];
|
|
60
61
|
const configurationOptions = [
|
|
@@ -161,7 +162,7 @@ const extractConfigOptions = (options) => {
|
|
|
161
162
|
const log = {
|
|
162
163
|
prefix: prefix ?? "",
|
|
163
164
|
// Should not consider the prefix set in the intlayer configuration file
|
|
164
|
-
verbose
|
|
165
|
+
verbose: verbose ?? true
|
|
165
166
|
};
|
|
166
167
|
const override = {
|
|
167
168
|
log
|
|
@@ -179,7 +180,11 @@ const setAPI = () => {
|
|
|
179
180
|
const dictionariesProgram = program.command("dictionary").alias("dictionaries").alias("dic").description("Dictionaries operations");
|
|
180
181
|
const buildOptions = {
|
|
181
182
|
description: "Build the dictionaries",
|
|
182
|
-
options: [
|
|
183
|
+
options: [
|
|
184
|
+
["-w, --watch", "Watch for changes"],
|
|
185
|
+
["--skip-prepare", "Skip the prepare step"],
|
|
186
|
+
["--with [with...]", "Start command in parallel with the build"]
|
|
187
|
+
]
|
|
183
188
|
};
|
|
184
189
|
const dictionariesBuildCmd = dictionariesProgram.command("build").description(buildOptions.description);
|
|
185
190
|
applyOptions(dictionariesBuildCmd, buildOptions.options);
|
|
@@ -199,6 +204,28 @@ const setAPI = () => {
|
|
|
199
204
|
configOptions: extractConfigOptions(options)
|
|
200
205
|
});
|
|
201
206
|
});
|
|
207
|
+
const watchOptions = {
|
|
208
|
+
description: "Watch the dictionaries changes",
|
|
209
|
+
options: [["--with [with...]", "Start command in parallel with the build"]]
|
|
210
|
+
};
|
|
211
|
+
const dictionariesWatchCmd = dictionariesProgram.command("watch").description(buildOptions.description);
|
|
212
|
+
applyOptions(dictionariesWatchCmd, watchOptions.options);
|
|
213
|
+
applyConfigOptions(dictionariesWatchCmd);
|
|
214
|
+
dictionariesWatchCmd.action((options) => {
|
|
215
|
+
(0, import_watch.watchContentDeclaration)({
|
|
216
|
+
...options,
|
|
217
|
+
configOptions: extractConfigOptions(options)
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
const rootWatchCmd = program.command("watch").description(buildOptions.description);
|
|
221
|
+
applyOptions(rootWatchCmd, watchOptions.options);
|
|
222
|
+
applyConfigOptions(rootWatchCmd);
|
|
223
|
+
rootWatchCmd.action((options) => {
|
|
224
|
+
(0, import_watch.watchContentDeclaration)({
|
|
225
|
+
...options,
|
|
226
|
+
configOptions: extractConfigOptions(options)
|
|
227
|
+
});
|
|
228
|
+
});
|
|
202
229
|
const pullOptions = {
|
|
203
230
|
description: "Pull dictionaries from the server",
|
|
204
231
|
options: [
|
|
@@ -399,7 +426,7 @@ const setAPI = () => {
|
|
|
399
426
|
})
|
|
400
427
|
);
|
|
401
428
|
const liveOptions = [
|
|
402
|
-
["--
|
|
429
|
+
["--with [with...]", "Start command in parallel with the live sync"]
|
|
403
430
|
];
|
|
404
431
|
const liveCmd = program.command("live").description(
|
|
405
432
|
"Live sync - Watch for changes made on the CMS and update the application content accordingly"
|
package/dist/cjs/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import type { AIOptions as BaseAIOptions } from '@intlayer/api';\nimport type { GetConfigurationOptions } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport { Command } from 'commander';\nimport { dirname as pathDirname } from 'path';\nimport { fileURLToPath } from 'url';\nimport {\n DiffMode,\n ListGitFilesOptions,\n} from '../../chokidar/dist/types/listGitFiles';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { startEditor } from './editor';\nimport { fill, FillOptions } from './fill';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { liveSync } from './liveSync';\nimport { pull } from './pull';\nimport { push } from './push';\nimport { pushConfig } from './pushConfig';\nimport { reviewDoc } from './reviewDoc';\nimport { testMissingTranslations } from './test';\nimport { translateDoc } from './translateDoc';\nimport { getParentPackageJSON } from './utils/getParentPackageJSON';\n\n// Extended AI options to include customPrompt\ntype AIOptions = BaseAIOptions & {\n customPrompt?: string;\n};\n\nconst isESModule = typeof import.meta.url === 'string';\n\nexport const dirname = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson = getParentPackageJSON(dirname);\n\nconst logOptions = [\n ['--verbose', 'Verbose'],\n ['--prefix [prefix]', 'Prefix'],\n];\n\nconst configurationOptions = [\n ['--env-file [envFile]', 'Environment file'],\n ['-e, --env [env]', 'Environment'],\n ['--base-dir [baseDir]', 'Base directory'],\n ...logOptions,\n];\n\nconst aiOptions = [\n ['--provider [provider]', 'Provider'],\n ['--temperature [temperature]', 'Temperature'],\n ['--model [model]', 'Model'],\n ['--api-key [apiKey]', 'Provider API key'],\n ['--custom-prompt [prompt]', 'Custom prompt'],\n ['--application-context [applicationContext]', 'Application context'],\n];\n\nconst gitOptions = [\n ['--git-diff [gitDiff]', 'Git diff mode - Check git diff between two refs'],\n ['--git-diff-base [gitDiffBase]', 'Git diff base ref'],\n ['--git-diff-current [gitDiffCurrent]', 'Git diff current ref'],\n ['--uncommitted [uncommitted]', 'Uncommitted'],\n ['--unpushed [unpushed]', 'Unpushed'],\n ['--untracked [untracked]', 'Untracked'],\n];\n\nconst extractKeysFromOptions = (options: object, keys: string[]) =>\n keys.filter((key) => options[key as keyof typeof options]);\n\n/**\n * Helper functions to apply common options to commands\n */\nconst applyOptions = (command: Command, options: string[][]) => {\n options.forEach(([flag, description]) => command.option(flag, description));\n return command;\n};\n\nconst removeUndefined = <T extends Record<string, any>>(obj: T): T =>\n Object.fromEntries(\n Object.entries(obj).filter(([_, value]) => value !== undefined)\n ) as T;\n\nconst applyConfigOptions = (command: Command) =>\n applyOptions(command, configurationOptions);\nconst applyAIOptions = (command: Command) => applyOptions(command, aiOptions);\nconst applyGitOptions = (command: Command) => applyOptions(command, gitOptions);\n\nconst extractAiOptions = (options: AIOptions): AIOptions | undefined => {\n const {\n apiKey,\n provider,\n model,\n temperature,\n applicationContext,\n customPrompt,\n } = options;\n\n return removeUndefined({\n apiKey: apiKey ?? configuration.ai?.apiKey,\n provider: provider ?? (configuration.ai?.provider as AIOptions['provider']),\n model: model ?? configuration.ai?.model,\n temperature: temperature ?? configuration.ai?.temperature,\n applicationContext:\n applicationContext ?? configuration.ai?.applicationContext,\n customPrompt: customPrompt ?? (configuration.ai as any)?.customPrompt,\n });\n};\n\ntype GitOptions = {\n gitDiff?: boolean;\n gitDiffBase?: string;\n gitDiffCurrent?: string;\n uncommitted?: boolean;\n unpushed?: boolean;\n untracked?: boolean;\n};\n\nconst gitOptionKeys: (keyof GitOptions)[] = [\n 'gitDiff',\n 'gitDiffBase',\n 'gitDiffCurrent',\n 'uncommitted',\n 'unpushed',\n 'untracked',\n];\n\nconst extractGitOptions = (\n options: GitOptions\n): ListGitFilesOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(options, gitOptionKeys);\n\n const isOptionEmpty = !Object.values(filteredOptions).some(Boolean);\n\n if (isOptionEmpty) return undefined;\n\n const {\n gitDiff,\n gitDiffBase,\n gitDiffCurrent,\n uncommitted,\n unpushed,\n untracked,\n } = options;\n\n const mode = [\n gitDiff && 'gitDiff',\n uncommitted && 'uncommitted',\n unpushed && 'unpushed',\n untracked && 'untracked',\n ].filter(Boolean) as DiffMode[];\n\n return removeUndefined({\n mode,\n baseRef: gitDiffBase,\n currentRef: gitDiffCurrent,\n absolute: true,\n });\n};\n\ntype LogOptions = {\n prefix?: string;\n verbose?: boolean;\n};\n\nexport type ConfigurationOptions = {\n baseDir?: string;\n env?: string;\n envFile?: string;\n} & LogOptions;\n\nconst configurationOptionKeys: (keyof ConfigurationOptions)[] = [\n 'baseDir',\n 'env',\n 'envFile',\n 'verbose',\n 'prefix',\n];\n\nconst extractConfigOptions = (\n options: ConfigurationOptions\n): GetConfigurationOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(\n options,\n configurationOptionKeys\n );\n\n const isOptionEmpty = !Object.values(filteredOptions).some(Boolean);\n\n if (isOptionEmpty) {\n return undefined;\n }\n\n const { baseDir, env, envFile, verbose, prefix } = options;\n\n const log = {\n prefix: prefix ?? '', // Should not consider the prefix set in the intlayer configuration file\n verbose,\n };\n\n const override = {\n log,\n };\n\n return removeUndefined({\n baseDir,\n env,\n envFile,\n override,\n });\n};\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version(packageJson.version!).description('Intlayer CLI');\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionary')\n .alias('dictionaries')\n .alias('dic')\n .description('Dictionaries operations');\n\n // Dictionary build command\n const buildOptions = {\n description: 'Build the dictionaries',\n options: [['-w, --watch', 'Watch for changes']],\n };\n\n // Add build command to dictionaries program\n const dictionariesBuildCmd = dictionariesProgram\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(dictionariesBuildCmd, buildOptions.options);\n applyConfigOptions(dictionariesBuildCmd);\n dictionariesBuildCmd.action((options) => {\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootBuildCmd = program\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(rootBuildCmd, buildOptions.options);\n applyConfigOptions(rootBuildCmd);\n rootBuildCmd.action((options) => {\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary pull command\n const pullOptions = {\n description: 'Pull dictionaries from the server',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to pull'],\n ['--new-dictionaries-path [path]', 'Path to save the new dictionaries'],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--newDictionariesPath [path]',\n '[alias] Path to save the new dictionaries',\n ],\n ],\n };\n\n // Add pull command to dictionaries program\n const dictionariesPullCmd = dictionariesProgram\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(dictionariesPullCmd, pullOptions.options);\n applyConfigOptions(dictionariesPullCmd);\n dictionariesPullCmd.action((options) => {\n pull({\n ...options,\n configOptions: {\n ...options.configOptions,\n baseDir: options.baseDir,\n },\n });\n });\n\n // Add pull command to root program as well\n const rootPullCmd = program\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(rootPullCmd, pullOptions.options);\n applyConfigOptions(rootPullCmd);\n rootPullCmd.action((options) => {\n pull({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary push command\n const pushOptions = {\n description:\n 'Push all dictionaries. Create or update the pushed dictionaries',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to push'],\n [\n '-r, --delete-locale-dictionary',\n 'Delete the local dictionaries after pushing',\n ],\n [\n '-k, --keep-locale-dictionary',\n 'Keep the local dictionaries after pushing',\n ],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--deleteLocaleDictionary',\n '[alias] Delete the local dictionaries after pushing',\n ],\n [\n '--keepLocaleDictionary',\n '[alias] Keep the local dictionaries after pushing',\n ],\n ],\n };\n\n // Add push command to dictionaries program\n const dictionariesPushCmd = dictionariesProgram\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(dictionariesPushCmd, pushOptions.options);\n applyConfigOptions(dictionariesPushCmd);\n applyGitOptions(dictionariesPushCmd);\n\n dictionariesPushCmd.action((options) =>\n push({\n ...options,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n // Add push command to root program as well\n const rootPushCmd = program\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(rootPushCmd, pushOptions.options);\n applyConfigOptions(rootPushCmd);\n applyGitOptions(rootPushCmd);\n\n rootPushCmd.action((options) =>\n push({\n ...options,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n /**\n * CONFIGURATION\n */\n\n // Define the parent command\n const configurationProgram = program\n .command('configuration')\n .alias('config')\n .alias('conf')\n .description('Configuration operations');\n\n const configGetCmd = configurationProgram\n .command('get')\n .description('Get the configuration');\n\n applyConfigOptions(configGetCmd);\n configGetCmd.action((options) => {\n getConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Define the `push config` subcommand and add it to the `push` command\n const configPushCmd = configurationProgram\n .command('push')\n .description('Push the configuration');\n\n applyConfigOptions(configPushCmd);\n configPushCmd.action((options) => {\n pushConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * CONTENT DECLARATION\n */\n\n const contentProgram = program\n .command('content')\n .description('Content declaration operations');\n\n contentProgram\n .command('list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n const testProgram = contentProgram\n .command('test')\n .description('Test if there are missing translations');\n\n applyConfigOptions(testProgram);\n testProgram.action((options) => {\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const fillProgram = program\n .command('fill')\n .description('Fill the dictionaries')\n .option('-f, --file [files...]', 'List of Dictionary files to fill')\n .option('--source-locale [sourceLocale]', 'Source locale to translate from')\n .option(\n '--output-locales [outputLocales...]',\n 'Target locales to translate to'\n )\n .option(\n '--mode [mode]',\n 'Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys',\n 'complete'\n )\n .option('-k, --keys [keys...]', 'Filter dictionaries based on keys')\n .option(\n '--excluded-keys [excludedKeys...]',\n 'Filter out dictionaries based on keys'\n )\n .option(\n '--path-filter [pathFilters...]',\n 'Filter dictionaries based on glob pattern'\n )\n .option(\n '--build [build]',\n 'Build the dictionaries before filling to ensure the content is up to date'\n );\n\n applyConfigOptions(fillProgram);\n applyAIOptions(fillProgram);\n applyGitOptions(fillProgram);\n\n fillProgram.action((options) =>\n fill({\n ...options,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n /**\n * DOCS\n */\n\n const docParams = [\n ['--doc-pattern [docPattern...]', 'Documentation pattern'],\n [\n '--excluded-glob-pattern [excludedGlobPattern...]',\n 'Excluded glob pattern',\n ],\n [\n '--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]',\n 'Number of simultaneous file processed',\n ],\n ['--locales [locales...]', 'Locales'],\n ['--base-locale [baseLocale]', 'Base locale'],\n [\n '--custom-instructions [customInstructions]',\n 'Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.',\n ],\n [\n '--skip-if-modified-before [skipIfModifiedBefore]',\n 'Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n [\n '--skip-if-modified-after [skipIfModifiedAfter]',\n 'Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n ];\n\n const docProgram = program\n .command('doc')\n .description('Documentation operations');\n\n const translateProgram = docProgram\n .command('translate')\n .description('Translate the documentation');\n\n applyConfigOptions(translateProgram);\n applyAIOptions(translateProgram);\n applyGitOptions(translateProgram);\n applyOptions(translateProgram, docParams);\n\n translateProgram.action((options) =>\n translateDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n })\n );\n\n const reviewProgram = docProgram\n .command('review')\n .description('Review the documentation');\n\n applyConfigOptions(reviewProgram);\n applyAIOptions(reviewProgram);\n applyGitOptions(reviewProgram);\n applyOptions(reviewProgram, docParams);\n\n reviewProgram.action((options) =>\n reviewDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n })\n );\n\n /**\n * LIVE SYNC\n */\n\n const liveOptions = [\n ['--process [process]', 'Start command in parallel with the live sync'],\n ];\n\n const liveCmd = program\n .command('live')\n .description(\n 'Live sync - Watch for changes made on the CMS and update the application content accordingly'\n );\n\n applyOptions(liveCmd, liveOptions);\n\n liveCmd.action((options) => liveSync(options));\n\n /**\n * EDITOR\n */\n\n const editorProgram = program\n .command('editor')\n .description('Visual editor operations');\n\n const editorStartCmd = editorProgram\n .command('start')\n .description('Start the Intlayer visual editor');\n\n applyConfigOptions(editorStartCmd);\n\n editorStartCmd.action((options) => {\n startEditor({\n env: options.env,\n envFile: options.envFile,\n });\n });\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0B;AAC1B,uBAAwB;AACxB,kBAAuC;AACvC,iBAA8B;AAK9B,mBAAsB;AACtB,oBAA0B;AAC1B,oBAA4B;AAC5B,kBAAkC;AAClC,oCAAuC;AACvC,sBAAyB;AACzB,kBAAqB;AACrB,kBAAqB;AACrB,wBAA2B;AAC3B,uBAA0B;AAC1B,kBAAwC;AACxC,0BAA6B;AAC7B,kCAAqC;AAtBrC;AA6BA,MAAM,aAAa,OAAO,YAAY,QAAQ;AAEvC,MAAM,UAAU,iBACnB,YAAAA,aAAY,0BAAc,YAAY,GAAG,CAAC,IAC1C;AAEJ,MAAM,kBAAc,kDAAqB,OAAO;AAEhD,MAAM,aAAa;AAAA,EACjB,CAAC,aAAa,SAAS;AAAA,EACvB,CAAC,qBAAqB,QAAQ;AAChC;AAEA,MAAM,uBAAuB;AAAA,EAC3B,CAAC,wBAAwB,kBAAkB;AAAA,EAC3C,CAAC,mBAAmB,aAAa;AAAA,EACjC,CAAC,wBAAwB,gBAAgB;AAAA,EACzC,GAAG;AACL;AAEA,MAAM,YAAY;AAAA,EAChB,CAAC,yBAAyB,UAAU;AAAA,EACpC,CAAC,+BAA+B,aAAa;AAAA,EAC7C,CAAC,mBAAmB,OAAO;AAAA,EAC3B,CAAC,sBAAsB,kBAAkB;AAAA,EACzC,CAAC,4BAA4B,eAAe;AAAA,EAC5C,CAAC,8CAA8C,qBAAqB;AACtE;AAEA,MAAM,aAAa;A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AQ;AAAA,MACpB,WAAW,iBAAiB,OAAO;AAAA,MACnC,YAAY,kBAAkB,OAAO;AAAA,MACrC,6BAA6B,QAAQ;AAAA,MACrC,eAAe,qBAAqB,OAAO;AAAA,MAC3C,oBAAoB,QAAQ;AAAA,MAC5B,sBAAsB,QAAQ;AAAA,MAC9B,qBAAqB,QAAQ;AAAA,IAC/B,CAAC;AAAA,EACH;AAMA,QAAM,cAAc;AAAA,IAClB,CAAC,uBAAuB,8CAA8C;AAAA,EACxE;AAEA,QAAM,UAAU,QACb,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF;AAEF,eAAa,SAAS,WAAW;AAEjC,UAAQ,OAAO,CAAC,gBAAY,0BAAS,OAAO,CAAC;AAM7C,QAAM,gBAAgB,QACnB,QAAQ,QAAQ,EAChB,YAAY,0BAA0B;AAEzC,QAAM,iBAAiB,cACpB,QAAQ,OAAO,EACf,YAAY,kCAAkC;AAEjD,qBAAmB,cAAc;AAEjC,iBAAe,OAAO,CAAC,YAAY;AACjC,mCAAY;AAAA,MACV,KAAK,QAAQ;AAAA,MACb,SAAS,QAAQ;AAAA,IACnB,CAAC;AAAA,EACH,CAAC;AAED,UAAQ,MAAM,QAAQ,IAAI;AAE1B,SAAO;AACT;","names":["pathDirname","configuration"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import type { AIOptions as BaseAIOptions } from '@intlayer/api';\nimport type { GetConfigurationOptions } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport { Command } from 'commander';\nimport { dirname as pathDirname } from 'path';\nimport { fileURLToPath } from 'url';\nimport {\n DiffMode,\n ListGitFilesOptions,\n} from '../../chokidar/dist/types/listGitFiles';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { startEditor } from './editor';\nimport { fill, FillOptions } from './fill';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { liveSync } from './liveSync';\nimport { pull } from './pull';\nimport { push } from './push/push';\nimport { pushConfig } from './pushConfig';\nimport { reviewDoc } from './reviewDoc';\nimport { testMissingTranslations } from './test';\nimport { translateDoc } from './translateDoc';\nimport { getParentPackageJSON } from './utils/getParentPackageJSON';\nimport { watchContentDeclaration } from './watch';\n\n// Extended AI options to include customPrompt\ntype AIOptions = BaseAIOptions & {\n customPrompt?: string;\n};\n\nconst isESModule = typeof import.meta.url === 'string';\n\nexport const dirname = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson = getParentPackageJSON(dirname);\n\nconst logOptions = [\n ['--verbose', 'Verbose (default to true using CLI)'],\n ['--prefix [prefix]', 'Prefix'],\n];\n\nconst configurationOptions = [\n ['--env-file [envFile]', 'Environment file'],\n ['-e, --env [env]', 'Environment'],\n ['--base-dir [baseDir]', 'Base directory'],\n ...logOptions,\n];\n\nconst aiOptions = [\n ['--provider [provider]', 'Provider'],\n ['--temperature [temperature]', 'Temperature'],\n ['--model [model]', 'Model'],\n ['--api-key [apiKey]', 'Provider API key'],\n ['--custom-prompt [prompt]', 'Custom prompt'],\n ['--application-context [applicationContext]', 'Application context'],\n];\n\nconst gitOptions = [\n ['--git-diff [gitDiff]', 'Git diff mode - Check git diff between two refs'],\n ['--git-diff-base [gitDiffBase]', 'Git diff base ref'],\n ['--git-diff-current [gitDiffCurrent]', 'Git diff current ref'],\n ['--uncommitted [uncommitted]', 'Uncommitted'],\n ['--unpushed [unpushed]', 'Unpushed'],\n ['--untracked [untracked]', 'Untracked'],\n];\n\nconst extractKeysFromOptions = (options: object, keys: string[]) =>\n keys.filter((key) => options[key as keyof typeof options]);\n\n/**\n * Helper functions to apply common options to commands\n */\nconst applyOptions = (command: Command, options: string[][]) => {\n options.forEach(([flag, description]) => command.option(flag, description));\n return command;\n};\n\nconst removeUndefined = <T extends Record<string, any>>(obj: T): T =>\n Object.fromEntries(\n Object.entries(obj).filter(([_, value]) => value !== undefined)\n ) as T;\n\nconst applyConfigOptions = (command: Command) =>\n applyOptions(command, configurationOptions);\nconst applyAIOptions = (command: Command) => applyOptions(command, aiOptions);\nconst applyGitOptions = (command: Command) => applyOptions(command, gitOptions);\n\nconst extractAiOptions = (options: AIOptions): AIOptions | undefined => {\n const {\n apiKey,\n provider,\n model,\n temperature,\n applicationContext,\n customPrompt,\n } = options;\n\n return removeUndefined({\n apiKey: apiKey ?? configuration.ai?.apiKey,\n provider: provider ?? (configuration.ai?.provider as AIOptions['provider']),\n model: model ?? configuration.ai?.model,\n temperature: temperature ?? configuration.ai?.temperature,\n applicationContext:\n applicationContext ?? configuration.ai?.applicationContext,\n customPrompt: customPrompt ?? (configuration.ai as any)?.customPrompt,\n });\n};\n\ntype GitOptions = {\n gitDiff?: boolean;\n gitDiffBase?: string;\n gitDiffCurrent?: string;\n uncommitted?: boolean;\n unpushed?: boolean;\n untracked?: boolean;\n};\n\nconst gitOptionKeys: (keyof GitOptions)[] = [\n 'gitDiff',\n 'gitDiffBase',\n 'gitDiffCurrent',\n 'uncommitted',\n 'unpushed',\n 'untracked',\n];\n\nconst extractGitOptions = (\n options: GitOptions\n): ListGitFilesOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(options, gitOptionKeys);\n\n const isOptionEmpty = !Object.values(filteredOptions).some(Boolean);\n\n if (isOptionEmpty) return undefined;\n\n const {\n gitDiff,\n gitDiffBase,\n gitDiffCurrent,\n uncommitted,\n unpushed,\n untracked,\n } = options;\n\n const mode = [\n gitDiff && 'gitDiff',\n uncommitted && 'uncommitted',\n unpushed && 'unpushed',\n untracked && 'untracked',\n ].filter(Boolean) as DiffMode[];\n\n return removeUndefined({\n mode,\n baseRef: gitDiffBase,\n currentRef: gitDiffCurrent,\n absolute: true,\n });\n};\n\ntype LogOptions = {\n prefix?: string;\n verbose?: boolean;\n};\n\nexport type ConfigurationOptions = {\n baseDir?: string;\n env?: string;\n envFile?: string;\n} & LogOptions;\n\nconst configurationOptionKeys: (keyof ConfigurationOptions)[] = [\n 'baseDir',\n 'env',\n 'envFile',\n 'verbose',\n 'prefix',\n];\n\nconst extractConfigOptions = (\n options: ConfigurationOptions\n): GetConfigurationOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(\n options,\n configurationOptionKeys\n );\n\n const isOptionEmpty = !Object.values(filteredOptions).some(Boolean);\n\n if (isOptionEmpty) {\n return undefined;\n }\n\n const { baseDir, env, envFile, verbose, prefix } = options;\n\n const log = {\n prefix: prefix ?? '', // Should not consider the prefix set in the intlayer configuration file\n verbose: verbose ?? true,\n };\n\n const override = {\n log,\n };\n\n return removeUndefined({\n baseDir,\n env,\n envFile,\n override,\n });\n};\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version(packageJson.version!).description('Intlayer CLI');\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionary')\n .alias('dictionaries')\n .alias('dic')\n .description('Dictionaries operations');\n\n // Dictionary build command\n const buildOptions = {\n description: 'Build the dictionaries',\n options: [\n ['-w, --watch', 'Watch for changes'],\n ['--skip-prepare', 'Skip the prepare step'],\n ['--with [with...]', 'Start command in parallel with the build'],\n ],\n };\n\n // Add build command to dictionaries program\n const dictionariesBuildCmd = dictionariesProgram\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(dictionariesBuildCmd, buildOptions.options);\n applyConfigOptions(dictionariesBuildCmd);\n dictionariesBuildCmd.action((options) => {\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootBuildCmd = program\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(rootBuildCmd, buildOptions.options);\n applyConfigOptions(rootBuildCmd);\n rootBuildCmd.action((options) => {\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const watchOptions = {\n description: 'Watch the dictionaries changes',\n options: [['--with [with...]', 'Start command in parallel with the build']],\n };\n\n // Add build command to dictionaries program\n const dictionariesWatchCmd = dictionariesProgram\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(dictionariesWatchCmd, watchOptions.options);\n applyConfigOptions(dictionariesWatchCmd);\n dictionariesWatchCmd.action((options) => {\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootWatchCmd = program\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(rootWatchCmd, watchOptions.options);\n applyConfigOptions(rootWatchCmd);\n rootWatchCmd.action((options) => {\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary pull command\n const pullOptions = {\n description: 'Pull dictionaries from the server',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to pull'],\n ['--new-dictionaries-path [path]', 'Path to save the new dictionaries'],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--newDictionariesPath [path]',\n '[alias] Path to save the new dictionaries',\n ],\n ],\n };\n\n // Add pull command to dictionaries program\n const dictionariesPullCmd = dictionariesProgram\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(dictionariesPullCmd, pullOptions.options);\n applyConfigOptions(dictionariesPullCmd);\n dictionariesPullCmd.action((options) => {\n pull({\n ...options,\n configOptions: {\n ...options.configOptions,\n baseDir: options.baseDir,\n },\n });\n });\n\n // Add pull command to root program as well\n const rootPullCmd = program\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(rootPullCmd, pullOptions.options);\n applyConfigOptions(rootPullCmd);\n rootPullCmd.action((options) => {\n pull({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary push command\n const pushOptions = {\n description:\n 'Push all dictionaries. Create or update the pushed dictionaries',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to push'],\n [\n '-r, --delete-locale-dictionary',\n 'Delete the local dictionaries after pushing',\n ],\n [\n '-k, --keep-locale-dictionary',\n 'Keep the local dictionaries after pushing',\n ],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--deleteLocaleDictionary',\n '[alias] Delete the local dictionaries after pushing',\n ],\n [\n '--keepLocaleDictionary',\n '[alias] Keep the local dictionaries after pushing',\n ],\n ],\n };\n\n // Add push command to dictionaries program\n const dictionariesPushCmd = dictionariesProgram\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(dictionariesPushCmd, pushOptions.options);\n applyConfigOptions(dictionariesPushCmd);\n applyGitOptions(dictionariesPushCmd);\n\n dictionariesPushCmd.action((options) =>\n push({\n ...options,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n // Add push command to root program as well\n const rootPushCmd = program\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(rootPushCmd, pushOptions.options);\n applyConfigOptions(rootPushCmd);\n applyGitOptions(rootPushCmd);\n\n rootPushCmd.action((options) =>\n push({\n ...options,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n /**\n * CONFIGURATION\n */\n\n // Define the parent command\n const configurationProgram = program\n .command('configuration')\n .alias('config')\n .alias('conf')\n .description('Configuration operations');\n\n const configGetCmd = configurationProgram\n .command('get')\n .description('Get the configuration');\n\n applyConfigOptions(configGetCmd);\n configGetCmd.action((options) => {\n getConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Define the `push config` subcommand and add it to the `push` command\n const configPushCmd = configurationProgram\n .command('push')\n .description('Push the configuration');\n\n applyConfigOptions(configPushCmd);\n configPushCmd.action((options) => {\n pushConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * CONTENT DECLARATION\n */\n\n const contentProgram = program\n .command('content')\n .description('Content declaration operations');\n\n contentProgram\n .command('list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n const testProgram = contentProgram\n .command('test')\n .description('Test if there are missing translations');\n\n applyConfigOptions(testProgram);\n testProgram.action((options) => {\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const fillProgram = program\n .command('fill')\n .description('Fill the dictionaries')\n .option('-f, --file [files...]', 'List of Dictionary files to fill')\n .option('--source-locale [sourceLocale]', 'Source locale to translate from')\n .option(\n '--output-locales [outputLocales...]',\n 'Target locales to translate to'\n )\n .option(\n '--mode [mode]',\n 'Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys',\n 'complete'\n )\n .option('-k, --keys [keys...]', 'Filter dictionaries based on keys')\n .option(\n '--excluded-keys [excludedKeys...]',\n 'Filter out dictionaries based on keys'\n )\n .option(\n '--path-filter [pathFilters...]',\n 'Filter dictionaries based on glob pattern'\n )\n .option(\n '--build [build]',\n 'Build the dictionaries before filling to ensure the content is up to date'\n );\n\n applyConfigOptions(fillProgram);\n applyAIOptions(fillProgram);\n applyGitOptions(fillProgram);\n\n fillProgram.action((options) =>\n fill({\n ...options,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions)\n );\n\n /**\n * DOCS\n */\n\n const docParams = [\n ['--doc-pattern [docPattern...]', 'Documentation pattern'],\n [\n '--excluded-glob-pattern [excludedGlobPattern...]',\n 'Excluded glob pattern',\n ],\n [\n '--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]',\n 'Number of simultaneous file processed',\n ],\n ['--locales [locales...]', 'Locales'],\n ['--base-locale [baseLocale]', 'Base locale'],\n [\n '--custom-instructions [customInstructions]',\n 'Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.',\n ],\n [\n '--skip-if-modified-before [skipIfModifiedBefore]',\n 'Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n [\n '--skip-if-modified-after [skipIfModifiedAfter]',\n 'Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n ];\n\n const docProgram = program\n .command('doc')\n .description('Documentation operations');\n\n const translateProgram = docProgram\n .command('translate')\n .description('Translate the documentation');\n\n applyConfigOptions(translateProgram);\n applyAIOptions(translateProgram);\n applyGitOptions(translateProgram);\n applyOptions(translateProgram, docParams);\n\n translateProgram.action((options) =>\n translateDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n })\n );\n\n const reviewProgram = docProgram\n .command('review')\n .description('Review the documentation');\n\n applyConfigOptions(reviewProgram);\n applyAIOptions(reviewProgram);\n applyGitOptions(reviewProgram);\n applyOptions(reviewProgram, docParams);\n\n reviewProgram.action((options) =>\n reviewDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n })\n );\n\n /**\n * LIVE SYNC\n */\n\n const liveOptions = [\n ['--with [with...]', 'Start command in parallel with the live sync'],\n ];\n\n const liveCmd = program\n .command('live')\n .description(\n 'Live sync - Watch for changes made on the CMS and update the application content accordingly'\n );\n\n applyOptions(liveCmd, liveOptions);\n\n liveCmd.action((options) => liveSync(options));\n\n /**\n * EDITOR\n */\n\n const editorProgram = program\n .command('editor')\n .description('Visual editor operations');\n\n const editorStartCmd = editorProgram\n .command('start')\n .description('Start the Intlayer visual editor');\n\n applyConfigOptions(editorStartCmd);\n\n editorStartCmd.action((options) => {\n startEditor({\n env: options.env,\n envFile: options.envFile,\n });\n });\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0B;AAC1B,uBAAwB;AACxB,kBAAuC;AACvC,iBAA8B;AAK9B,mBAAsB;AACtB,oBAA0B;AAC1B,oBAA4B;AAC5B,kBAAkC;AAClC,oCAAuC;AACvC,sBAAyB;AACzB,kBAAqB;AACrB,kBAAqB;AACrB,wBAA2B;AAC3B,uBAA0B;AAC1B,kBAAwC;AACxC,0BAA6B;AAC7B,kCAAqC;AACrC,mBAAwC;AAvBxC;AA8BA,MAAM,aAAa,OAAO,YAAY,QAAQ;AAEvC,MAAM,UAAU,iBACnB,YAAAA,aAAY,0BAAc,YAAY,GAAG,CAAC,IAC1C;AAEJ,MAAM,kBAAc,kDAAqB,OAAO;AAEhD,MAAM,aAAa;AAAA,EACjB,CAAC,aAAa,qCAAqC;AAAA,EACnD,CAAC,qBAAqB,QAAQ;AAChC;AAEA,MAAM,uBAAuB;AAAA,EAC3B,CAAC,wBAAwB,kBAAkB;AAAA,EAC3C,CAAC,mBAAmB,aAAa;AAAA,EACjC,CAAC,wBAAwB,gBAAgB;AAAA,EACzC,GAAG;AACL;AAEA,MAAM,YAAY;AAAA,EAChB,CAAC,yBAAyB,UAAU;AAAA,EACpC,CAAC,+BAA+B,aAAa;AAAA,EAC7C,CAAC,mBAAmB,OAAO;AAAA,EAC3B,CAAC,sBAAsB,kBAAkB;AAAA,EACzC,CAAC,4BAA4B,eAAe;AAAA,EAC5C,CAAC,8CAA8C,qBAAqB;AACtE;AAEA,MAAM,aAAa;AAAA,EACjB,CAAC,wBAAwB,iDAAiD;AAAA,EAC1E,CAAC,iCAAiC,mBAAmB;AAAA,EACrD,CAA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