@intlayer/config 7.0.3-canary.1 → 7.0.3

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.
Files changed (66) hide show
  1. package/dist/cjs/client.cjs +4 -0
  2. package/dist/cjs/configFile/buildConfigurationFields.cjs +1 -2
  3. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  4. package/dist/cjs/configFile/getConfiguration.cjs +5 -6
  5. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  6. package/dist/cjs/index.cjs +9 -9
  7. package/dist/cjs/loadExternalFile/loadExternalFile.cjs +2 -2
  8. package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
  9. package/dist/cjs/loadExternalFile/parseFileContent.cjs +4 -4
  10. package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
  11. package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs +2 -1
  12. package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs.map +1 -1
  13. package/dist/cjs/package.cjs +1 -1
  14. package/dist/cjs/package.cjs.map +1 -1
  15. package/dist/cjs/utils/ESMxCJSHelpers.cjs +5 -2
  16. package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
  17. package/dist/cjs/utils/clearModuleCache.cjs +3 -3
  18. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
  19. package/dist/cjs/utils/getPackageJsonPath.cjs +3 -1
  20. package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
  21. package/dist/esm/client.mjs +3 -2
  22. package/dist/esm/configFile/buildConfigurationFields.mjs +1 -2
  23. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  24. package/dist/esm/configFile/getConfiguration.mjs +5 -6
  25. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  26. package/dist/esm/index.mjs +9 -9
  27. package/dist/esm/loadExternalFile/loadExternalFile.mjs +3 -3
  28. package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
  29. package/dist/esm/loadExternalFile/parseFileContent.mjs +3 -3
  30. package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
  31. package/dist/esm/loadExternalFile/transpileTSToMJS.mjs +2 -1
  32. package/dist/esm/loadExternalFile/transpileTSToMJS.mjs.map +1 -1
  33. package/dist/esm/package.mjs +1 -1
  34. package/dist/esm/package.mjs.map +1 -1
  35. package/dist/esm/utils/ESMxCJSHelpers.mjs +5 -2
  36. package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
  37. package/dist/esm/utils/clearModuleCache.mjs +4 -4
  38. package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
  39. package/dist/esm/utils/getPackageJsonPath.mjs +3 -1
  40. package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -1
  41. package/dist/types/client.d.ts +3 -2
  42. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  43. package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
  44. package/dist/types/index.d.ts +3 -3
  45. package/dist/types/loadExternalFile/transpileTSToMJS.d.ts.map +1 -1
  46. package/dist/types/utils/ESMxCJSHelpers.d.ts +2 -2
  47. package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
  48. package/dist/types/utils/cache.d.ts +1 -1
  49. package/dist/types/utils/cache.d.ts.map +1 -1
  50. package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -1
  51. package/package.json +9 -9
  52. package/dist/types/client.d.ts.map +0 -1
  53. package/dist/types/configFile/index.d.ts.map +0 -1
  54. package/dist/types/defaultValues/middleware.d.ts +0 -8
  55. package/dist/types/defaultValues/middleware.d.ts.map +0 -1
  56. package/dist/types/getSandboxContext.d.ts +0 -4
  57. package/dist/types/getSandboxContext.d.ts.map +0 -1
  58. package/dist/types/index.d.ts.map +0 -1
  59. package/dist/types/loadExternalFile.d.ts +0 -8
  60. package/dist/types/loadExternalFile.d.ts.map +0 -1
  61. package/dist/types/types/config.d.ts +0 -649
  62. package/dist/types/types/config.d.ts.map +0 -1
  63. package/dist/types/types/locales.d.ts +0 -564
  64. package/dist/types/types/locales.d.ts.map +0 -1
  65. package/dist/types/types/plugin.d.ts +0 -68
  66. package/dist/types/types/plugin.d.ts.map +0 -1
@@ -1,649 +0,0 @@
1
- import type { Locales } from './locales';
2
- import type { Plugin } from './plugin';
3
- export type StrictMode = 'strict' | 'inclusive' | 'loose';
4
- /**
5
- * Configuration for internationalization settings
6
- */
7
- export type InternationalizationConfig = {
8
- /**
9
- * Locales available in the application
10
- *
11
- * Default: [Locales.ENGLISH]
12
- *
13
- * You can define a list of available locales to support in the application.
14
- */
15
- locales: Locales[];
16
- /**
17
- * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.
18
- *
19
- * Default: []
20
- *
21
- * If empty, all locales are required in `strict` mode.
22
- *
23
- * Ensure required locales are also defined in the `locales` field.
24
- */
25
- requiredLocales: Locales[];
26
- /**
27
- * Ensure strong implementations of internationalized content using typescript.
28
- * - If set to "strict", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.
29
- * - If set to "inclusive", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.
30
- * - If set to "loose", the translation `t` function will accept any existing locale.
31
- *
32
- * Default: "inclusive"
33
- */
34
- strictMode: StrictMode;
35
- /**
36
- * Default locale of the application for fallback
37
- *
38
- * Default: Locales.ENGLISH
39
- *
40
- * Used to specify a fallback locale in case no other locale is set.
41
- */
42
- defaultLocale: Locales;
43
- };
44
- export type ServerSetCookieRule = 'always' | 'never';
45
- /**
46
- * Configuration for middleware behaviors
47
- */
48
- export type MiddlewareConfig = {
49
- /**
50
- * Header name to get the locale from the request
51
- *
52
- * Default: 'x-intlayer-locale'
53
- *
54
- * The HTTP header key used to determine the current locale.
55
- */
56
- headerName: string;
57
- /**
58
- * Cookie name to store the locale information
59
- *
60
- * Default: 'INTLAYER_LOCALE'
61
- *
62
- * The cookie key where the locale information is stored.
63
- */
64
- cookieName: string;
65
- /**
66
- * Prefix default prefix the default locale to the path as other locales.
67
- *
68
- * Example with prefixDefault = true and defaultLocale = 'en':
69
- * path = /en/dashboard or /fr/dashboard
70
- *
71
- * Example with prefixDefault = false and defaultLocale = 'en':
72
- * path = /dashboard or /fr/dashboard
73
- *
74
- *
75
- * Default: false
76
- */
77
- prefixDefault: boolean;
78
- /**
79
- * Base path for application URLs
80
- *
81
- * Default: ''
82
- *
83
- * Defines the base path where the application is accessible from.
84
- */
85
- basePath: string;
86
- /**
87
- * Strategy for setting the locale cookie on the server
88
- *
89
- * Default: 'always'
90
- *
91
- * This setting controls when the server sets the locale cookie. It can either set the cookie on every request or never set it.
92
- */
93
- serverSetCookie: ServerSetCookieRule;
94
- /**
95
- * Indicates if no prefix should be used in the URL for locale
96
- *
97
- * Default: false
98
- *
99
- * If true, no locale-based prefix is used in the URL.
100
- */
101
- noPrefix: boolean;
102
- /**
103
- * Controls whether locale detection occurs during Next.js prefetch requests
104
- * - true: Detect and apply locale during prefetch
105
- * - false: Use default locale during prefetch (recommended)
106
- *
107
- * This setting affects how Next.js handles locale prefetching:
108
- *
109
- * Example scenario:
110
- * - User's browser language is 'fr'
111
- * - Current page is /fr/about
112
- * - Link prefetches /about
113
- *
114
- * With `detectLocaleOnPrefetchNoPrefix:true`
115
- * - Prefetch detects 'fr' locale from browser
116
- * - Redirects prefetch to /fr/about
117
- *
118
- * With `detectLocaleOnPrefetchNoPrefix:false` (default)
119
- * - Prefetch uses default locale
120
- * - Redirects prefetch to /en/about (assuming 'en' is default)
121
- *
122
- * When to use true:
123
- * - Your app uses non-localized internal links (e.g. <a href="/about">)
124
- * - You want consistent locale detection behavior between regular and prefetch requests
125
- *
126
- * When to use false (default):
127
- * - Your app uses locale-prefixed links (e.g. <a href="/fr/about">)
128
- * - You want to optimize prefetching performance
129
- * - You want to avoid potential redirect loops
130
- *
131
- * Default: false
132
- */
133
- detectLocaleOnPrefetchNoPrefix: boolean;
134
- };
135
- /**
136
- * Configuration for intlayer editor
137
- */
138
- export type EditorConfig = {
139
- /**
140
- * URL of the application. Used to restrict the origin of the editor for security reasons.
141
- *
142
- * > '*' means that the editor is accessible from any origin
143
- *
144
- * Default: '*'
145
- */
146
- applicationURL: string;
147
- /**
148
- * URL of the editor server. Used to restrict the origin of the editor for security reasons.
149
- *
150
- * > '*' means that the editor is accessible from any origin
151
- *
152
- * Default: 'http://localhost:8000'
153
- */
154
- editorURL: string;
155
- /**
156
- * URL of the CMS server. Used to restrict the origin of the editor for security reasons.
157
- *
158
- * Default: 'https://intlayer.org'
159
- */
160
- cmsURL: string;
161
- /**
162
- * URL of the backend
163
- *
164
- * Default: 'https://back.intlayer.org'
165
- *
166
- * The URL of the backend server.
167
- */
168
- backendURL: string;
169
- /**
170
- * Indicates if the application interact with the visual editor
171
- *
172
- * Default: true;
173
- *
174
- * If true, the editor will be able to interact with the application.
175
- * If false, the editor will not be able to interact with the application.
176
- * In any case, the editor can only be enabled by the visual editor.
177
- * Disabling the editor for specific environments is a way to enforce the security.
178
- *
179
- * Usage:
180
- * ```js
181
- * {
182
- * // Other configurations
183
- * editor: {
184
- * enabled: process.env.NODE_ENV !== 'production',
185
- * }
186
- * };
187
- * ```
188
- *
189
- */
190
- enabled: boolean;
191
- /** Port of the editor server
192
- *
193
- * Default: 8000
194
- */
195
- port: number;
196
- /**
197
- * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
198
- * An access token is use to authenticate the user related to the project.
199
- * To get an access token, go to https://intlayer.org/dashboard/project and create an account.
200
- *
201
- * Default: undefined
202
- *
203
- * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.
204
- */
205
- clientId?: string;
206
- /**
207
- * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
208
- * An access token is use to authenticate the user related to the project.
209
- * To get an access token, go to https://intlayer.org/dashboard/project and create an account.
210
- *
211
- * Default: undefined
212
- *
213
- * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.
214
- */
215
- clientSecret?: string;
216
- /**
217
- * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.
218
- * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.
219
- *
220
- * Default: 'local_first'
221
- *
222
- * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.
223
- * - 'local_first': The first dictionary found in the locale is used.
224
- * - 'distant_first': The first dictionary found in the distant locales is used.
225
- */
226
- dictionaryPriorityStrategy: 'local_first' | 'distant_first';
227
- /**
228
- * Indicates if the application should hot reload the locale configurations when a change is detected.
229
- * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.
230
- *
231
- * Default: true
232
- */
233
- liveSync: boolean;
234
- /**
235
- * Port of the live sync server
236
- *
237
- * Default: 4000
238
- */
239
- liveSyncPort: number;
240
- /**
241
- * URL of the live sync server in case of remote live sync server
242
- *
243
- * Default: `http://localhost:${liveSyncPort}`
244
- */
245
- liveSyncURL: string;
246
- };
247
- export type AiConfig = {
248
- /**
249
- * Provider
250
- *
251
- * The provider to use for the AI features of Intlayer.
252
- *
253
- * Available providers:
254
- * - 'openai'
255
- * - 'anthropic'
256
- * - 'mistral'
257
- * - 'deepseek'
258
- * - 'gemini'
259
- *
260
- * Default: 'openai'
261
- */
262
- provider?: string;
263
- /**
264
- * API model
265
- *
266
- * The model to use for the AI features of Intlayer.
267
- *
268
- * Example: 'gpt-4o-2024-11-20'
269
- *
270
- */
271
- model?: string;
272
- /**
273
- * temperature
274
- *
275
- * The temperature to use for the AI features of Intlayer.
276
- * The temperature controls the randomness of the AI's responses.
277
- * A higher temperature will make the AI more creative and less predictable.
278
- *
279
- * Example: 0.1
280
- */
281
- temperature?: number;
282
- /**
283
- * API key
284
- *
285
- * Use your own OpenAI API key to use the AI features of Intlayer.
286
- * If you don't have an OpenAI API key, you can get one for free at https://openai.com/api/.
287
- *
288
- */
289
- apiKey?: string;
290
- /**
291
- * Application context
292
- *
293
- * The context of the application to use for the AI features of Intlayer.
294
- *
295
- * Example: 'This is a website for a company that sells products online.'
296
- */
297
- applicationContext?: string;
298
- };
299
- export type BuildConfig = {
300
- /**
301
- * Indicates if the build should be optimized
302
- *
303
- * Default: process.env.NODE_ENV === 'production'
304
- *
305
- * If true, the build will be optimized.
306
- * If false, the build will not be optimized.
307
- *
308
- * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.
309
- * All imports will stay as static import to avoid async processing when loading the dictionaries.
310
- *
311
- * Note:
312
- * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.
313
- * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.
314
- * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.
315
- * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.
316
- */
317
- optimize: boolean;
318
- /**
319
- * Indicates the mode of import to use for the dictionaries.
320
- *
321
- * Available modes:
322
- * - "static": The dictionaries are imported statically.
323
- * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.
324
- * - "dynamic": The dictionaries are imported dynamically in a synchronous component using the suspense API.
325
- * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.
326
- * - "live": The dictionaries are imported dynamically using the live sync API.
327
- * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.
328
- * Live mode will use the live sync API to fetch the dictionaries. If the API call fails, the dictionaries will be imported dynamically as "dynamic" mode.
329
- *
330
- * Default: "static"
331
- *
332
- * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.
333
- *
334
- * Note:
335
- * - Dynamic imports rely on Suspense and may slightly impact rendering performance.
336
- * - If desabled all locales will be loaded at once, even if they are not used.
337
- * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.
338
- * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.
339
- * - This option will be ignored if `optimize` is disabled.
340
- * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.
341
- * - The "live" allows to sync the dictionaries to the live sync server.
342
- * - Require static key to work. Example of invalid code: `const navbarKey = "my-key"; useIntlayer(navbarKey)`.
343
- */
344
- importMode: 'static' | 'dynamic' | 'live';
345
- /**
346
- * Pattern to traverse the code to optimize.
347
- *
348
- * Allows to avoid to traverse the code that is not relevant to the optimization.
349
- * Improve build performance.
350
- *
351
- * Default: ['**\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\/node_modules/**']
352
- *
353
- * Example: `['src/**\/*.{ts,tsx}', '../ui-library/**\/*.{ts,tsx}', '!**\/node_modules/**']`
354
- *
355
- * Note:
356
- * - This option will be ignored if `optimize` is disabled.
357
- * - Use glob pattern.
358
- */
359
- traversePattern: string[];
360
- /**
361
- * Output format of the dictionaries
362
- *
363
- * Default: ['cjs', 'esm']
364
- *
365
- * The output format of the dictionaries. It can be either 'cjs' or 'esm'. Even if dictionaries are written in JSON, entry point to access the dictionaries are generated.
366
- * This function will use the output format defined using this option.
367
- * The default format is 'cjs' as it allows better interoperability with other libraries, scripts, and applications. But some build tools, such as Vite, require ES modules.
368
- */
369
- outputFormat: ('cjs' | 'esm')[];
370
- };
371
- /**
372
- * Custom configuration that can be provided to override default settings
373
- */
374
- export type CustomIntlayerConfig = {
375
- /**
376
- * Custom internationalization configuration
377
- */
378
- internationalization?: Partial<InternationalizationConfig>;
379
- /**
380
- * Custom middleware configuration
381
- */
382
- middleware?: Partial<MiddlewareConfig>;
383
- /**
384
- * Custom content configuration
385
- */
386
- content?: Partial<ContentConfig>;
387
- /**
388
- * Custom editor configuration
389
- */
390
- editor?: Partial<EditorConfig>;
391
- /**
392
- * Custom middleware configuration
393
- */
394
- log?: Partial<LogConfig>;
395
- /**
396
- * Custom AI configuration
397
- */
398
- ai?: Partial<AiConfig>;
399
- /**
400
- * Custom build configuration
401
- */
402
- build?: Partial<BuildConfig>;
403
- /**
404
- * Custom plugins configuration
405
- */
406
- plugins?: Plugin[];
407
- };
408
- /**
409
- * Combined configuration for internationalization, middleware, and content
410
- */
411
- export type IntlayerConfig = {
412
- /**
413
- * Internationalization configuration
414
- */
415
- internationalization: InternationalizationConfig;
416
- /**
417
- * Middleware configuration
418
- */
419
- middleware: MiddlewareConfig;
420
- /**
421
- * Content configuration
422
- */
423
- content: ContentConfig;
424
- /**
425
- * Intlayer editor configuration
426
- */
427
- editor: EditorConfig;
428
- /**
429
- * Logger configuration
430
- */
431
- log: LogConfig;
432
- /**
433
- * AI configuration
434
- */
435
- ai?: Partial<AiConfig>;
436
- /**
437
- * Build configuration
438
- */
439
- build: BuildConfig;
440
- /**
441
- * Plugins configuration
442
- */
443
- plugins?: Plugin[];
444
- };
445
- /**
446
- * Base configuration for content handling
447
- */
448
- export type BaseContentConfig = {
449
- /**
450
- * File extensions of content to look for
451
- *
452
- * Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
453
- *
454
- * List of file extensions to scan for content.
455
- */
456
- fileExtensions: string[];
457
- /**
458
- * Absolute path of the project's base directory
459
- *
460
- * Default: process.cwd()
461
- *
462
- * The root directory of the project, typically used for resolving other paths.
463
- */
464
- baseDir: string;
465
- /**
466
- * Directories to be excluded from content processing
467
- *
468
- * Default: ['node_modules', '.intlayer']
469
- *
470
- * A list of directories to exclude from content processing.
471
- */
472
- excludedPath: string[];
473
- /**
474
- * Indicates if Intlayer should watch for changes in the content declaration files in the app to rebuild the related dictionaries.
475
- *
476
- * Default: process.env.NODE_ENV === 'development'
477
- */
478
- watch: boolean;
479
- /**
480
- * Indicate how the content should be automatically filled using AI.
481
- *
482
- * Default: undefined
483
- *
484
- */
485
- autoFill?: boolean | string | {
486
- [key in Locales]?: string;
487
- };
488
- };
489
- /**
490
- * Configuration derived based on the base content configuration
491
- */
492
- export type BaseDerivedConfig = {
493
- /**
494
- * Directory where the content is stored, relative to the base directory
495
- *
496
- * Default: ['.']
497
- *
498
- * Derived content directory based on the base configuration.
499
- */
500
- contentDir: string[];
501
- /**
502
- * Directory for module augmentation, relative to the base directory
503
- *
504
- * Default: .intlayer/types
505
- *
506
- * Defines the derived path for module augmentation.
507
- */
508
- moduleAugmentationDir: string;
509
- /**
510
- * Directory where unmerged dictionaries are stored, relative to the result directory
511
- *
512
- * Default: .intlayer/unmerged_dictionary
513
- *
514
- * Specifies the derived path for unmerged dictionaries relative to the result directory.
515
- */
516
- unmergedDictionariesDir: string;
517
- /**
518
- * Directory where remote dictionaries are stored, relative to the result directory
519
- *
520
- * Default: .intlayer/remote_dictionary
521
- *
522
- * Specifies the derived path for remote dictionaries relative to the result directory.
523
- */
524
- remoteDictionariesDir: string;
525
- /**
526
- * Directory where final dictionaries are stored, relative to the result directory
527
- *
528
- * Default: .intlayer/dictionary
529
- *
530
- * Specifies the derived path for dictionaries relative to the result directory.
531
- */
532
- dictionariesDir: string;
533
- /**
534
- * Directory where dynamic dictionaries are stored, relative to the result directory
535
- *
536
- * Default: .intlayer/dynamic_dictionary
537
- *
538
- * Specifies the derived path for dynamic dictionaries relative to the result directory.
539
- */
540
- dynamicDictionariesDir: string;
541
- /**
542
- * Directory where fetch dictionaries are stored, relative to the result directory
543
- *
544
- * Default: .intlayer/fetch_dictionary
545
- *
546
- * Specifies the derived path for fetch dictionaries relative to the result directory.
547
- */
548
- fetchDictionariesDir: string;
549
- /**
550
- * Directory where dictionary types are stored, relative to the result directory
551
- *
552
- * Default: .intlayer/types
553
- *
554
- * Specifies the derived path for dictionary types relative to the result directory.
555
- */
556
- typesDir: string;
557
- /**
558
- * Directory where the main files are stored, relative to the result directory
559
- *
560
- * Default: .intlayer/main
561
- *
562
- * Specifies the derived path for the main files relative to the result directory.
563
- */
564
- mainDir: string;
565
- /**
566
- * Directory where the configuration files are stored, relative to the result directory
567
- *
568
- * Default: .intlayer/config
569
- *
570
- * Specifies the derived path for the configuration files relative to the result directory.
571
- */
572
- configDir: string;
573
- /**
574
- * Directory where the cache files are stored, relative to the result directory
575
- *
576
- * Default: .intlayer/cache
577
- *
578
- * Specifies the derived path for the cache files relative to the result directory.
579
- */
580
- cacheDir: string;
581
- };
582
- /**
583
- * Configuration for content patterns
584
- */
585
- export type PatternsContentConfig = {
586
- /**
587
- * Patterns of files to watch for changes
588
- *
589
- * Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
590
- *
591
- * Defines file patterns for content to watch for changes.
592
- */
593
- watchedFilesPattern: string[];
594
- /**
595
- * Patterns of files to watch for changes including the relative path
596
- *
597
- * Default: ['src/**\/*.content.ts', 'src/**\/*.content.js', 'src/**\/*.content.json', 'src/**\/*.content.cjs', 'src/**\/*.content.mjs', 'src/**\/*.content.tsx', 'src/**\/*.content.jsx']
598
- *
599
- * Specifies the file patterns for content to watch, including relative paths.
600
- */
601
- watchedFilesPatternWithPath: string[];
602
- /**
603
- * Pattern for output files including the relative path
604
- *
605
- * Default: '{{dictionariesDir}}/**\/*.json'
606
- *
607
- * Defines the pattern for output files, including the relative path.
608
- */
609
- outputFilesPatternWithPath: string;
610
- };
611
- /**
612
- * General configuration derived from the config file
613
- */
614
- export type ContentConfig = BaseContentConfig & BaseDerivedConfig & PatternsContentConfig;
615
- export type LogFunctions = {
616
- error?: typeof console.error;
617
- log?: typeof console.log;
618
- info?: typeof console.info;
619
- warn?: typeof console.warn;
620
- };
621
- export type LogConfig = {
622
- /**
623
- * Indicates if the logger is enabled
624
- *
625
- * Default: true
626
- *
627
- * If 'default', the logger is enabled and can be used.
628
- * If 'verbose', the logger will be enabled and can be used, but will log more information.
629
- * If 'disabled', the logger is disabled and cannot be used.
630
- */
631
- mode: 'default' | 'verbose' | 'disabled';
632
- /**
633
- * Prefix of the logger
634
- *
635
- * Default: '[intlayer]'
636
- *
637
- * The prefix of the logger.
638
- */
639
- prefix: string;
640
- /**
641
- * Functions to log
642
- */
643
- error?: typeof console.error;
644
- log?: typeof console.log;
645
- info?: typeof console.info;
646
- warn?: typeof console.warn;
647
- debug?: typeof console.debug;
648
- };
649
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;;;;;;;OAQG;IACH,eAAe,EAAE,OAAO,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,mBAAmB,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,8BAA8B,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;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