@intlayer/svelte-compiler 7.3.2-canary.0

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 ADDED
@@ -0,0 +1,275 @@
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
+ </a>
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&cacheSeconds=86400" 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&cacheSeconds=86400" 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&cacheSeconds=86400" alt="last commit"/>
26
+ </a>
27
+ </p>
28
+
29
+ ![Watch the video](https://github.com/aymericzip/intlayer/blob/main/docs/assets/demo_video.gif)
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, building 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";
117
+
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
+ [![How to Internationalize your application using Intlayer](https://i.ytimg.com/vi/e_PPG7PTqGU/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDtyJ4uYotEjl12nZ_gZKZ_kjEgOQ)](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 16</a>
175
+ <ul>
176
+ <li><a href="https://intlayer.org/doc/environment/nextjs/15" rel=''>Next.js 15</a></li>
177
+ <li><a href="https://intlayer.org/doc/environment/nextjs/14" rel=''>Next.js 14 (App Router)</a></li>
178
+ <li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router" rel=''>Next.js Page Router</a></li>
179
+ </ul>
180
+ </li>
181
+ <li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
182
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a>
183
+ <ul>
184
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react/react-router-v7" rel=''>React-router-v7</a></li>
185
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start" rel=''>Tanstack start</a></li>
186
+ </ul>
187
+ </li>
188
+ <li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
189
+ <li><a href="https://intlayer.org/doc/environment/lynx-and-react" rel=''>Lynx + React</a></li>
190
+ <li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
191
+ <li><a href="https://intlayer.org/doc/environment/sveltekit" rel=''>SvelteKit</a></li>
192
+ <li><a href="https://intlayer.org/doc/environment/vite-and-preact" rel=''>Vite + Preact</a></li>
193
+ <li><a href="https://intlayer.org/doc/environment/vite-and-vue" rel=''>Vite + Vue</a></li>
194
+ <li><a href="https://intlayer.org/doc/environment/vite-and-nuxt" rel=''>Vite + Nuxt</a></li>
195
+ <li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
196
+ <li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
197
+ <li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
198
+ <li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
199
+ </ul>
200
+ </details>
201
+
202
+ <details>
203
+ <summary style="font-size:16px; font-weight:bold;">📰 Blog</summary>
204
+ <ul>
205
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/what_is_internationalization.md" rel=''>What is i18n</a></li>
206
+ <li><a href="https://intlayer.org/blog/SEO-and-i18n" rel=''>i18n and SEO</a></li>
207
+ <li><a href="https://intlayer.org/blog/intlayer-with-next-i18next" rel=''>Intlayer and i18next</a></li>
208
+ <li><a href="https://intlayer.org/blog/intlayer-with-react-i18next" rel=''>Intlayer and react-intl</a></li>
209
+ <li><a href="https://intlayer.org/blog/intlayer-with-next-intl" rel=''>Intlayer and next-intl</a></li>
210
+ </ul>
211
+ </details>
212
+
213
+ ## 🌐 Readme in other languages
214
+
215
+ <p align="center">
216
+ <a href="https://github.com/aymericzip/intlayer/blob/main/readme.md">English</a> •
217
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/readme.md">简体中文</a> •
218
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/readme.md">Русский</a> •
219
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/readme.md">日本語</a> •
220
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/readme.md">Français</a> •
221
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/readme.md">한국어</a> •
222
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/readme.md">Español</a> •
223
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/readme.md">Deutsch</a> •
224
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/readme.md">العربية</a> •
225
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/readme.md">Italiano</a> •
226
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/readme.md">English (UK)</a> •
227
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/readme.md">Português</a> •
228
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/readme.md">हिन्दी</a> •
229
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/readme.md">Türkçe</a>
230
+ </p>
231
+
232
+ ## 🤝 Community
233
+
234
+ Intlayer is built with and for the community and we’d love your input!
235
+
236
+ - Have a suggestion? [Open an issue](https://github.com/aymericzip/intlayer/issues)
237
+ - Found a bug or improvement? [Submit a PR](https://github.com/aymericzip/intlayer/pulls)
238
+ - Need help or want to connect? [Join our Discord](https://discord.gg/7uxamYVeCk)
239
+
240
+ You can also follow us on :
241
+
242
+ <div>
243
+ <br/>
244
+ <p align="center">
245
+ <a href="https://discord.gg/528mBV4N" target="blank" rel='noopener noreferrer nofollow'><img align="center"
246
+ src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
247
+ alt="Intlayer Discord" height="30"/></a>
248
+ <a href="https://www.linkedin.com/company/intlayerorg" target="blank" rel='noopener noreferrer nofollow'><img align="center"
249
+ src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
250
+ alt="Intlayer LinkedIn" height="30"/></a>
251
+ <a href="https://www.instagram.com/intlayer/" target="blank" rel='noopener noreferrer nofollow'><img align="center"
252
+ src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
253
+ alt="Intlayer Instagram" height="30"/></a>
254
+ <a href="https://x.com/Intlayer183096" target="blank" rel='noopener noreferrer nofollow'><img align="center"
255
+ src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
256
+ alt="Intlayer X" height="30"/></a>
257
+ <a href="https://www.youtube.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
258
+ src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
259
+ alt="Intlayer YouTube" height="30"/></a>
260
+ <a href="https://www.tiktok.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
261
+ src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
262
+ alt="Intlayer TikTok" height="30"/></a>
263
+ <br>
264
+ </p>
265
+ </div>
266
+
267
+ ### Contribution
268
+
269
+ 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!
270
+
271
+ ### Thank You for the Support
272
+
273
+ 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-).
274
+
275
+ [![Star History Chart](https://api.star-history.com/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.com/#aymericzip/intlayer&Date)
@@ -0,0 +1,244 @@
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ let node_module = require("node:module");
3
+ let node_path = require("node:path");
4
+ let __intlayer_babel = require("@intlayer/babel");
5
+ let __intlayer_chokidar = require("@intlayer/chokidar");
6
+ let __intlayer_config = require("@intlayer/config");
7
+ let fast_glob = require("fast-glob");
8
+ fast_glob = require_rolldown_runtime.__toESM(fast_glob);
9
+
10
+ //#region src/SvelteIntlayerCompiler.ts
11
+ /**
12
+ * Create a SvelteIntlayerCompiler - A Vite-compatible compiler plugin for Svelte with Intlayer
13
+ *
14
+ * Handles Svelte components with special handling for:
15
+ * - Script blocks in .svelte files
16
+ * - TypeScript in Svelte files
17
+ * - Svelte-specific transformations
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * // vite.config.ts
22
+ * import { defineConfig } from 'vite';
23
+ * import { svelte } from '@sveltejs/vite-plugin-svelte';
24
+ * import { svelteIntlayerCompiler } from '@intlayer/svelte-compiler';
25
+ *
26
+ * export default defineConfig({
27
+ * plugins: [svelte(), svelteIntlayerCompiler()],
28
+ * });
29
+ * ```
30
+ */
31
+ const createSvelteIntlayerCompiler = (options) => {
32
+ const pluginName = "svelte-intlayer-compiler";
33
+ let config;
34
+ let logger;
35
+ let projectRoot = "";
36
+ let mode = "dev";
37
+ let hmrVersion = -1;
38
+ const lastSourceTriggeredWrite = 0;
39
+ let filesList = [];
40
+ let babel = null;
41
+ let liveSyncKeys = [];
42
+ const configOptions = options?.configOptions;
43
+ const customCompilerConfig = options?.compilerConfig;
44
+ /**
45
+ * Build the list of files to transform based on configuration patterns
46
+ * Includes Svelte-specific patterns
47
+ */
48
+ const buildFilesList = async () => {
49
+ const { traversePattern } = config.build;
50
+ const { baseDir, mainDir } = config.content;
51
+ const transformPattern = customCompilerConfig?.transformPattern ?? traversePattern;
52
+ const excludePattern = customCompilerConfig?.excludePattern ?? ["**/node_modules/**"];
53
+ const patterns = Array.isArray(transformPattern) ? transformPattern : [transformPattern];
54
+ const sveltePatterns = patterns.map((p) => {
55
+ if (p.includes(".svelte") || p.includes("{")) return p;
56
+ return p.replace(/\{([^}]+)\}/, (_, exts) => `{${exts},svelte}`);
57
+ });
58
+ const excludePatterns = Array.isArray(excludePattern) ? excludePattern : [excludePattern];
59
+ const filesListPattern = fast_glob.default.sync([...new Set([...patterns, ...sveltePatterns])], {
60
+ cwd: baseDir,
61
+ ignore: excludePatterns
62
+ }).map((file) => (0, node_path.join)(baseDir, file));
63
+ const dictionariesEntryPath = (0, node_path.join)(mainDir, "dictionaries.mjs");
64
+ const unmergedDictionariesEntryPath = (0, node_path.join)(mainDir, "unmerged_dictionaries.mjs");
65
+ filesList = [
66
+ ...filesListPattern,
67
+ dictionariesEntryPath,
68
+ unmergedDictionariesEntryPath
69
+ ];
70
+ };
71
+ /**
72
+ * Load dictionary keys that have live sync enabled
73
+ */
74
+ const loadLiveSyncKeys = async () => {
75
+ try {
76
+ const { getDictionaries } = await import("@intlayer/dictionaries-entry");
77
+ const dictionaries = getDictionaries();
78
+ liveSyncKeys = Object.values(dictionaries).filter((dictionary) => dictionary.live).map((dictionary) => dictionary.key);
79
+ } catch {
80
+ liveSyncKeys = [];
81
+ }
82
+ };
83
+ /**
84
+ * Initialize the compiler with the given mode
85
+ */
86
+ const init = async (compilerMode) => {
87
+ mode = compilerMode;
88
+ config = (0, __intlayer_config.getConfiguration)(configOptions);
89
+ logger = (0, __intlayer_config.getAppLogger)(config);
90
+ try {
91
+ babel = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("@babel/core");
92
+ } catch {
93
+ logger("Failed to load @babel/core. Transformation will be disabled.", { level: "warn" });
94
+ }
95
+ await buildFilesList();
96
+ await loadLiveSyncKeys();
97
+ };
98
+ /**
99
+ * Vite hook: configResolved
100
+ */
101
+ const configResolved = async (viteConfig) => {
102
+ const compilerMode = viteConfig.env?.DEV ? "dev" : "build";
103
+ projectRoot = viteConfig.root;
104
+ await init(compilerMode);
105
+ };
106
+ /**
107
+ * Prepare intlayer dictionaries and types
108
+ */
109
+ const buildStart = async () => {
110
+ const isBuild = mode === "build";
111
+ await (0, __intlayer_chokidar.prepareIntlayer)(config, {
112
+ clean: isBuild,
113
+ cacheTimeoutMs: isBuild ? 1e3 * 30 : 1e3 * 60 * 60
114
+ });
115
+ };
116
+ /**
117
+ * Configure the dev server with file watching
118
+ */
119
+ const configureServer = async () => {
120
+ if (config.content.watch) (0, __intlayer_chokidar.watch)({ configuration: config });
121
+ };
122
+ /**
123
+ * Handle HMR for content changes
124
+ */
125
+ const handleHotUpdate = async (ctx) => {
126
+ const { file, server } = ctx;
127
+ if (!config.content.watchedFilesPatternWithPath.some((pattern) => {
128
+ return new RegExp(pattern.replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*")).test(file);
129
+ })) {
130
+ const dictionariesDir = config.content.dictionariesDir;
131
+ if (file.startsWith(dictionariesDir)) return [];
132
+ hmrVersion++;
133
+ return;
134
+ }
135
+ if (!(performance.now() - lastSourceTriggeredWrite < 1e3)) {
136
+ server.ws.send({ type: "full-reload" });
137
+ return [];
138
+ }
139
+ };
140
+ /**
141
+ * Transform handler with Svelte-specific handling
142
+ */
143
+ const transformHandler = async (code, id, _options) => {
144
+ if (!babel) return null;
145
+ const { optimize, importMode } = config.build;
146
+ if (!optimize && mode !== "build") return null;
147
+ const { dictionariesDir, dynamicDictionariesDir, unmergedDictionariesDir, fetchDictionariesDir, mainDir } = config.content;
148
+ /**
149
+ * Handle Svelte compiled modules
150
+ * Svelte plugin transforms .svelte files into JS
151
+ * We need to transform the resulting JS code
152
+ */
153
+ const filename = id.split("?", 1)[0];
154
+ const isSvelteFile = filename.endsWith(".svelte");
155
+ if (!filesList.includes(filename)) {
156
+ if (!isSvelteFile) return null;
157
+ if (!filesList.some((f) => f === filename || f.startsWith(filename))) return null;
158
+ }
159
+ const dictionariesEntryPath = (0, node_path.join)(mainDir, "dictionaries.mjs");
160
+ const unmergedDictionariesEntryPath = (0, node_path.join)(mainDir, "unmerged_dictionaries.mjs");
161
+ const dynamicDictionariesEntryPath = (0, node_path.join)(mainDir, "dynamic_dictionaries.mjs");
162
+ try {
163
+ const result = babel.transformSync(code, {
164
+ filename,
165
+ plugins: [[__intlayer_babel.intlayerOptimizeBabelPlugin, {
166
+ dictionariesDir,
167
+ dictionariesEntryPath,
168
+ unmergedDictionariesEntryPath,
169
+ unmergedDictionariesDir,
170
+ dynamicDictionariesDir,
171
+ dynamicDictionariesEntryPath,
172
+ fetchDictionariesDir,
173
+ importMode,
174
+ filesList,
175
+ replaceDictionaryEntry: true,
176
+ liveSyncKeys
177
+ }]],
178
+ parserOpts: {
179
+ sourceType: "module",
180
+ allowImportExportEverywhere: true,
181
+ plugins: [
182
+ "typescript",
183
+ "jsx",
184
+ "decorators-legacy",
185
+ "classProperties",
186
+ "objectRestSpread",
187
+ "asyncGenerators",
188
+ "functionBind",
189
+ "exportDefaultFrom",
190
+ "exportNamespaceFrom",
191
+ "dynamicImport",
192
+ "nullishCoalescingOperator",
193
+ "optionalChaining"
194
+ ]
195
+ }
196
+ });
197
+ if (result?.code) return {
198
+ code: result.code,
199
+ map: result.map
200
+ };
201
+ } catch (error) {
202
+ logger(`Failed to transform Svelte file ${(0, node_path.relative)(projectRoot, filename)}: ${error}`, { level: "error" });
203
+ }
204
+ return null;
205
+ };
206
+ /**
207
+ * Apply hook for determining when plugin should be active
208
+ */
209
+ const apply = (_config, env) => {
210
+ const { optimize } = config?.build ?? {};
211
+ const isEnabled = customCompilerConfig?.enabled ?? true;
212
+ const isBuild = env.command === "build";
213
+ return isEnabled && (isBuild ? optimize ?? true : optimize ?? false);
214
+ };
215
+ return {
216
+ name: pluginName,
217
+ enforce: "post",
218
+ configResolved,
219
+ buildStart,
220
+ configureServer,
221
+ handleHotUpdate,
222
+ transform: {
223
+ order: "post",
224
+ handler: transformHandler
225
+ },
226
+ apply: (_viteConfig, env) => {
227
+ if (!config) config = (0, __intlayer_config.getConfiguration)(configOptions);
228
+ return apply(_viteConfig, env);
229
+ }
230
+ };
231
+ };
232
+ /**
233
+ * Factory function for creating a Vite plugin
234
+ */
235
+ const svelteIntlayerCompiler = (options) => {
236
+ return createSvelteIntlayerCompiler(options);
237
+ };
238
+ const SvelteIntlayerCompiler = createSvelteIntlayerCompiler;
239
+
240
+ //#endregion
241
+ exports.SvelteIntlayerCompiler = SvelteIntlayerCompiler;
242
+ exports.createSvelteIntlayerCompiler = createSvelteIntlayerCompiler;
243
+ exports.svelteIntlayerCompiler = svelteIntlayerCompiler;
244
+ //# sourceMappingURL=SvelteIntlayerCompiler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvelteIntlayerCompiler.cjs","names":["config: IntlayerConfig","logger: ReturnType<typeof getAppLogger>","mode: CompilerMode","filesList: string[]","babel: typeof import('@babel/core') | null","liveSyncKeys: string[]","fg","compilerMode: CompilerMode","intlayerOptimizeBabelPlugin"],"sources":["../../src/SvelteIntlayerCompiler.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { join, relative } from 'node:path';\nimport { intlayerOptimizeBabelPlugin } from '@intlayer/babel';\nimport { watch as chokidarWatch, prepareIntlayer } from '@intlayer/chokidar';\nimport {\n type GetConfigurationOptions,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport type { CompilerConfig, IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * Mode of the compiler\n */\nexport type CompilerMode = 'dev' | 'build';\n\n/**\n * Context for hot update handling\n */\nexport type HotUpdateContext = {\n file: string;\n server: {\n ws: { send: (message: { type: string }) => void };\n moduleGraph: {\n getModulesByFile: (file: string) => Set<unknown> | null | undefined;\n invalidateModule: (\n module: unknown,\n seen: Set<unknown>,\n timestamp: number,\n isHmr: boolean\n ) => void;\n };\n };\n timestamp: number;\n};\n\n/**\n * Transform result from the compiler\n */\nexport type TransformResult = {\n code?: string;\n map?: unknown;\n} | null;\n\n/**\n * Options for initializing the Svelte compiler\n */\nexport type SvelteIntlayerCompilerOptions = {\n /**\n * Configuration options for getting the intlayer configuration\n */\n configOptions?: GetConfigurationOptions;\n\n /**\n * Custom compiler configuration to override defaults\n */\n compilerConfig?: Partial<CompilerConfig>;\n};\n\n/**\n * Vite plugin object returned by the compiler\n */\nexport type SvelteIntlayerVitePlugin = {\n name: string;\n enforce: 'pre' | 'post';\n configResolved: (config: {\n env?: { DEV?: boolean };\n root: string;\n }) => Promise<void>;\n buildStart: () => Promise<void>;\n configureServer: () => Promise<void>;\n handleHotUpdate: (ctx: HotUpdateContext) => Promise<unknown[] | undefined>;\n transform: {\n order: 'pre' | 'post';\n handler: (\n code: string,\n id: string,\n options?: { ssr?: boolean }\n ) => Promise<TransformResult>;\n };\n apply: (config: unknown, env: { command: string }) => boolean;\n};\n\n/**\n * Create a SvelteIntlayerCompiler - A Vite-compatible compiler plugin for Svelte with Intlayer\n *\n * Handles Svelte components with special handling for:\n * - Script blocks in .svelte files\n * - TypeScript in Svelte files\n * - Svelte-specific transformations\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import { svelte } from '@sveltejs/vite-plugin-svelte';\n * import { svelteIntlayerCompiler } from '@intlayer/svelte-compiler';\n *\n * export default defineConfig({\n * plugins: [svelte(), svelteIntlayerCompiler()],\n * });\n * ```\n */\nexport const createSvelteIntlayerCompiler = (\n options?: SvelteIntlayerCompilerOptions\n): SvelteIntlayerVitePlugin => {\n const pluginName = 'svelte-intlayer-compiler';\n\n // Private state\n let config: IntlayerConfig;\n let logger: ReturnType<typeof getAppLogger>;\n let projectRoot = '';\n let mode: CompilerMode = 'dev';\n let hmrVersion = -1;\n const lastSourceTriggeredWrite = 0;\n let filesList: string[] = [];\n\n // @ts-expect-error - @babel/core is a peer dependency\n let babel: typeof import('@babel/core') | null = null;\n let liveSyncKeys: string[] = [];\n\n const configOptions = options?.configOptions;\n const customCompilerConfig = options?.compilerConfig;\n\n /**\n * Build the list of files to transform based on configuration patterns\n * Includes Svelte-specific patterns\n */\n const buildFilesList = async (): Promise<void> => {\n const { traversePattern } = config.build;\n const { baseDir, mainDir } = config.content;\n\n const transformPattern =\n customCompilerConfig?.transformPattern ?? traversePattern;\n const excludePattern = customCompilerConfig?.excludePattern ?? [\n '**/node_modules/**',\n ];\n\n // Add Svelte file patterns\n const patterns = Array.isArray(transformPattern)\n ? transformPattern\n : [transformPattern];\n const sveltePatterns = patterns.map((p) => {\n // Ensure Svelte files are included\n if (p.includes('.svelte') || p.includes('{')) {\n return p;\n }\n // Add .svelte extension to patterns\n return p.replace(/\\{([^}]+)\\}/, (_, exts) => `{${exts},svelte}`);\n });\n\n const excludePatterns = Array.isArray(excludePattern)\n ? excludePattern\n : [excludePattern];\n\n const filesListPattern = fg\n .sync([...new Set([...patterns, ...sveltePatterns])], {\n cwd: baseDir,\n ignore: excludePatterns,\n })\n .map((file) => join(baseDir, file));\n\n const dictionariesEntryPath = join(mainDir, 'dictionaries.mjs');\n const unmergedDictionariesEntryPath = join(\n mainDir,\n 'unmerged_dictionaries.mjs'\n );\n\n filesList = [\n ...filesListPattern,\n dictionariesEntryPath,\n unmergedDictionariesEntryPath,\n ];\n };\n\n /**\n * Load dictionary keys that have live sync enabled\n */\n const loadLiveSyncKeys = async (): Promise<void> => {\n try {\n const { getDictionaries } = await import('@intlayer/dictionaries-entry');\n const dictionaries = getDictionaries() as Record<\n string,\n { live?: boolean; key: string }\n >;\n liveSyncKeys = Object.values(dictionaries)\n .filter((dictionary) => dictionary.live)\n .map((dictionary) => dictionary.key);\n } catch {\n liveSyncKeys = [];\n }\n };\n\n /**\n * Initialize the compiler with the given mode\n */\n const init = async (compilerMode: CompilerMode): Promise<void> => {\n mode = compilerMode;\n config = getConfiguration(configOptions);\n logger = getAppLogger(config);\n\n // Load Babel dynamically\n try {\n const localRequire = createRequire(import.meta.url);\n babel = localRequire('@babel/core');\n } catch {\n logger('Failed to load @babel/core. Transformation will be disabled.', {\n level: 'warn',\n });\n }\n\n // Build files list for transformation\n await buildFilesList();\n\n // Load live sync keys\n await loadLiveSyncKeys();\n };\n\n /**\n * Vite hook: configResolved\n */\n const configResolved = async (viteConfig: {\n env?: { DEV?: boolean };\n root: string;\n }): Promise<void> => {\n const compilerMode: CompilerMode = viteConfig.env?.DEV ? 'dev' : 'build';\n projectRoot = viteConfig.root;\n await init(compilerMode);\n };\n\n /**\n * Prepare intlayer dictionaries and types\n */\n const buildStart = async (): Promise<void> => {\n const isBuild = mode === 'build';\n\n await prepareIntlayer(config, {\n clean: isBuild,\n cacheTimeoutMs: isBuild ? 1000 * 30 : 1000 * 60 * 60,\n });\n };\n\n /**\n * Configure the dev server with file watching\n */\n const configureServer = async (): Promise<void> => {\n if (config.content.watch) {\n chokidarWatch({ configuration: config });\n }\n };\n\n /**\n * Handle HMR for content changes\n */\n const handleHotUpdate = async (\n ctx: HotUpdateContext\n ): Promise<unknown[] | undefined> => {\n const { file, server } = ctx;\n\n // Check if this is a content declaration file\n const isContentFile = config.content.watchedFilesPatternWithPath.some(\n (pattern: string) => {\n const regex = new RegExp(\n pattern.replace(/\\*\\*/g, '.*').replace(/\\*/g, '[^/]*')\n );\n return regex.test(file);\n }\n );\n\n if (!isContentFile) {\n const dictionariesDir = config.content.dictionariesDir;\n if (file.startsWith(dictionariesDir)) {\n return [];\n }\n hmrVersion++;\n return undefined;\n }\n\n const sourceTriggered = performance.now() - lastSourceTriggeredWrite < 1000;\n\n if (!sourceTriggered) {\n server.ws.send({ type: 'full-reload' });\n return [];\n }\n\n return undefined;\n };\n\n /**\n * Transform handler with Svelte-specific handling\n */\n const transformHandler = async (\n code: string,\n id: string,\n _options?: { ssr?: boolean }\n ): Promise<TransformResult> => {\n if (!babel) {\n return null;\n }\n\n const { optimize, importMode } = config.build;\n\n if (!optimize && mode !== 'build') {\n return null;\n }\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n unmergedDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n } = config.content;\n\n /**\n * Handle Svelte compiled modules\n * Svelte plugin transforms .svelte files into JS\n * We need to transform the resulting JS code\n */\n const filename = id.split('?', 1)[0];\n\n // Check if this file should be transformed\n const isSvelteFile = filename.endsWith('.svelte');\n\n if (!filesList.includes(filename)) {\n // Also check if it's a compiled Svelte file\n if (!isSvelteFile) {\n return null;\n }\n // Check if the base svelte file is in our list\n if (!filesList.some((f) => f === filename || f.startsWith(filename))) {\n return null;\n }\n }\n\n const dictionariesEntryPath = join(mainDir, 'dictionaries.mjs');\n const unmergedDictionariesEntryPath = join(\n mainDir,\n 'unmerged_dictionaries.mjs'\n );\n const dynamicDictionariesEntryPath = join(\n mainDir,\n 'dynamic_dictionaries.mjs'\n );\n\n try {\n const result = babel.transformSync(code, {\n filename,\n plugins: [\n [\n intlayerOptimizeBabelPlugin,\n {\n dictionariesDir,\n dictionariesEntryPath,\n unmergedDictionariesEntryPath,\n unmergedDictionariesDir,\n dynamicDictionariesDir,\n dynamicDictionariesEntryPath,\n fetchDictionariesDir,\n importMode,\n filesList,\n replaceDictionaryEntry: true,\n liveSyncKeys,\n },\n ],\n ],\n parserOpts: {\n sourceType: 'module',\n allowImportExportEverywhere: true,\n plugins: [\n 'typescript',\n 'jsx',\n 'decorators-legacy',\n 'classProperties',\n 'objectRestSpread',\n 'asyncGenerators',\n 'functionBind',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'dynamicImport',\n 'nullishCoalescingOperator',\n 'optionalChaining',\n ],\n },\n });\n\n if (result?.code) {\n return {\n code: result.code,\n map: result.map,\n };\n }\n } catch (error) {\n logger(\n `Failed to transform Svelte file ${relative(projectRoot, filename)}: ${error}`,\n {\n level: 'error',\n }\n );\n }\n\n return null;\n };\n\n /**\n * Apply hook for determining when plugin should be active\n */\n const apply = (_config: unknown, env: { command: string }): boolean => {\n const { optimize } = config?.build ?? {};\n const isEnabled = customCompilerConfig?.enabled ?? true;\n const isBuild = env.command === 'build';\n\n return isEnabled && (isBuild ? (optimize ?? true) : (optimize ?? false));\n };\n\n return {\n name: pluginName,\n enforce: 'post', // Run after Svelte plugin\n configResolved,\n buildStart,\n configureServer,\n handleHotUpdate,\n transform: {\n order: 'post', // Run after Svelte plugin transformation\n handler: transformHandler,\n },\n apply: (_viteConfig: unknown, env: { command: string }) => {\n if (!config) {\n config = getConfiguration(configOptions);\n }\n return apply(_viteConfig, env);\n },\n };\n};\n\n/**\n * Factory function for creating a Vite plugin\n */\nexport const svelteIntlayerCompiler = (\n options?: SvelteIntlayerCompilerOptions\n): SvelteIntlayerVitePlugin => {\n return createSvelteIntlayerCompiler(options);\n};\n\n// Legacy export for backwards compatibility\nexport const SvelteIntlayerCompiler = createSvelteIntlayerCompiler;\n"],"mappings":"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"}
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,12 @@
1
+ const require_SvelteIntlayerCompiler = require('./SvelteIntlayerCompiler.cjs');
2
+ const require_svelte_intlayer_extract = require('./svelte-intlayer-extract.cjs');
3
+
4
+ exports.ATTRIBUTES_TO_EXTRACT = require_svelte_intlayer_extract.ATTRIBUTES_TO_EXTRACT;
5
+ exports.SvelteIntlayerCompiler = require_SvelteIntlayerCompiler.SvelteIntlayerCompiler;
6
+ exports.createSvelteIntlayerCompiler = require_SvelteIntlayerCompiler.createSvelteIntlayerCompiler;
7
+ exports.defaultShouldExtract = require_svelte_intlayer_extract.defaultShouldExtract;
8
+ exports.extractDictionaryKeyFromPath = require_svelte_intlayer_extract.extractDictionaryKeyFromPath;
9
+ exports.generateKey = require_svelte_intlayer_extract.generateKey;
10
+ exports.intlayerSvelteExtract = require_svelte_intlayer_extract.intlayerSvelteExtract;
11
+ exports.shouldProcessFile = require_svelte_intlayer_extract.shouldProcessFile;
12
+ exports.svelteIntlayerCompiler = require_SvelteIntlayerCompiler.svelteIntlayerCompiler;