@intlayer/config 1.2.0 → 1.2.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.
Files changed (108) hide show
  1. package/dist/cjs/client.cjs +2 -10
  2. package/dist/cjs/client.cjs.map +1 -1
  3. package/dist/cjs/client.d.ts +1 -1
  4. package/dist/cjs/configFile/buildConfigurationFields.cjs +45 -4
  5. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  6. package/dist/cjs/defaultValues/server.cjs +15 -1
  7. package/dist/cjs/defaultValues/server.cjs.map +1 -1
  8. package/dist/cjs/defaultValues/server.d.ts +6 -1
  9. package/dist/cjs/envVariables/detectPlatform.cjs +7 -4
  10. package/dist/cjs/envVariables/detectPlatform.cjs.map +1 -1
  11. package/dist/cjs/envVariables/detectPlatform.d.ts +1 -4
  12. package/dist/cjs/envVariables/extractEnvVariable/index.cjs +44 -0
  13. package/dist/cjs/envVariables/extractEnvVariable/index.cjs.map +1 -0
  14. package/dist/cjs/envVariables/extractEnvVariable/index.d.ts +7 -0
  15. package/dist/cjs/envVariables/extractEnvVariable/next.cjs +70 -0
  16. package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -0
  17. package/dist/cjs/envVariables/extractEnvVariable/next.d.ts +7 -0
  18. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +70 -0
  19. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -0
  20. package/dist/cjs/envVariables/extractEnvVariable/react_app.d.ts +7 -0
  21. package/dist/cjs/envVariables/extractEnvVariable/types.cjs +17 -0
  22. package/dist/cjs/envVariables/extractEnvVariable/types.cjs.map +1 -0
  23. package/dist/cjs/envVariables/extractEnvVariable/types.d.ts +11 -0
  24. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +70 -0
  25. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -0
  26. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.d.ts +7 -0
  27. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +78 -0
  28. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -0
  29. package/dist/cjs/envVariables/extractEnvVariable/vite.d.ts +7 -0
  30. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs +2 -0
  31. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs.map +1 -0
  32. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.d.ts +2 -0
  33. package/dist/cjs/envVariables/getConfiguration.cjs +79 -115
  34. package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
  35. package/dist/cjs/envVariables/getConfiguration.d.ts +2 -6
  36. package/dist/cjs/envVariables/index.cjs +2 -10
  37. package/dist/cjs/envVariables/index.cjs.map +1 -1
  38. package/dist/cjs/envVariables/index.d.ts +1 -1
  39. package/dist/cjs/index.cjs +2 -10
  40. package/dist/cjs/index.cjs.map +1 -1
  41. package/dist/cjs/index.d.ts +1 -1
  42. package/dist/cjs/types/config.cjs.map +1 -1
  43. package/dist/cjs/types/config.d.ts +44 -4
  44. package/dist/esm/client.d.mts +1 -1
  45. package/dist/esm/client.mjs +2 -12
  46. package/dist/esm/client.mjs.map +1 -1
  47. package/dist/esm/configFile/buildConfigurationFields.mjs +48 -5
  48. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  49. package/dist/esm/defaultValues/server.d.mts +6 -1
  50. package/dist/esm/defaultValues/server.mjs +13 -1
  51. package/dist/esm/defaultValues/server.mjs.map +1 -1
  52. package/dist/esm/envVariables/detectPlatform.d.mts +1 -4
  53. package/dist/esm/envVariables/detectPlatform.mjs +7 -4
  54. package/dist/esm/envVariables/detectPlatform.mjs.map +1 -1
  55. package/dist/esm/envVariables/extractEnvVariable/index.d.mts +7 -0
  56. package/dist/esm/envVariables/extractEnvVariable/index.mjs +20 -0
  57. package/dist/esm/envVariables/extractEnvVariable/index.mjs.map +1 -0
  58. package/dist/esm/envVariables/extractEnvVariable/next.d.mts +7 -0
  59. package/dist/esm/envVariables/extractEnvVariable/next.mjs +46 -0
  60. package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -0
  61. package/dist/esm/envVariables/extractEnvVariable/react_app.d.mts +7 -0
  62. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +46 -0
  63. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -0
  64. package/dist/esm/envVariables/extractEnvVariable/types.d.mts +11 -0
  65. package/dist/esm/envVariables/extractEnvVariable/types.mjs +1 -0
  66. package/dist/esm/envVariables/extractEnvVariable/types.mjs.map +1 -0
  67. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.d.mts +7 -0
  68. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +46 -0
  69. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -0
  70. package/dist/esm/envVariables/extractEnvVariable/vite.d.mts +7 -0
  71. package/dist/esm/envVariables/extractEnvVariable/vite.mjs +53 -0
  72. package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -0
  73. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.d.mts +2 -0
  74. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs +1 -0
  75. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs.map +1 -0
  76. package/dist/esm/envVariables/getConfiguration.d.mts +2 -6
  77. package/dist/esm/envVariables/getConfiguration.mjs +78 -110
  78. package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
  79. package/dist/esm/envVariables/index.d.mts +1 -1
  80. package/dist/esm/envVariables/index.mjs +2 -12
  81. package/dist/esm/envVariables/index.mjs.map +1 -1
  82. package/dist/esm/index.d.mts +1 -1
  83. package/dist/esm/index.mjs +1 -9
  84. package/dist/esm/index.mjs.map +1 -1
  85. package/dist/esm/types/config.d.mts +44 -4
  86. package/package.json +2 -2
  87. package/src/client.ts +1 -7
  88. package/src/configFile/buildConfigurationFields.ts +52 -3
  89. package/src/defaultValues/server.ts +15 -1
  90. package/src/envVariables/detectPlatform.ts +12 -8
  91. package/src/envVariables/extractEnvVariable/index.ts +20 -0
  92. package/src/envVariables/extractEnvVariable/next.ts +57 -0
  93. package/src/envVariables/extractEnvVariable/react_app.ts +57 -0
  94. package/src/envVariables/extractEnvVariable/types.ts +10 -0
  95. package/src/envVariables/extractEnvVariable/undefined_platform.ts +52 -0
  96. package/src/envVariables/extractEnvVariable/vite.ts +65 -0
  97. package/src/envVariables/extractEnvVariable/vite_env.d.ts +9 -0
  98. package/src/envVariables/getConfiguration.ts +84 -111
  99. package/src/envVariables/index.ts +1 -7
  100. package/src/index.ts +0 -4
  101. package/src/types/config.ts +47 -3
  102. package/dist/cjs/envVariables/extractEnvVariable.cjs +0 -211
  103. package/dist/cjs/envVariables/extractEnvVariable.cjs.map +0 -1
  104. package/dist/cjs/envVariables/extractEnvVariable.d.ts +0 -13
  105. package/dist/esm/envVariables/extractEnvVariable.d.mts +0 -13
  106. package/dist/esm/envVariables/extractEnvVariable.mjs +0 -186
  107. package/dist/esm/envVariables/extractEnvVariable.mjs.map +0 -1
  108. package/src/envVariables/extractEnvVariable.ts +0 -224
@@ -116,7 +116,7 @@ type BaseContentConfig = {
116
116
  /**
117
117
  * File extensions of content to look for
118
118
  *
119
- * Default: ['.content.ts', '.content.js', '.content.json']
119
+ * Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
120
120
  *
121
121
  * List of file extensions to scan for content.
122
122
  */
@@ -167,8 +167,22 @@ type BaseContentConfig = {
167
167
  * Default: 'dictionary'
168
168
  *
169
169
  * The directory for storing localization dictionaries.
170
+ *
171
+ * Note:
172
+ * - Ensure the dictionaries output includes intlayer to build the dictionaries for intlayer
170
173
  */
171
174
  dictionariesDirName: string;
175
+ /**
176
+ * Name of the directory where dictionaries are stored
177
+ *
178
+ * Default: 'i18n_dictionary'
179
+ *
180
+ * The directory for storing localization dictionaries.
181
+ *
182
+ * Note:
183
+ * - Ensure the dictionaries output includes 'i18next' to build the dictionaries for i18next
184
+ */
185
+ i18nDictionariesDirName: string;
172
186
  /**
173
187
  * Name of the directory where dictionary types are stored
174
188
  *
@@ -186,6 +200,7 @@ type BaseContentConfig = {
186
200
  */
187
201
  mainDirName: string;
188
202
  };
203
+ type DictionaryOutput = 'intlayer' | 'i18next';
189
204
  /**
190
205
  * Configuration derived based on the base content configuration
191
206
  */
@@ -214,6 +229,19 @@ type BaseDerivedConfig = {
214
229
  * Defines the derived path for module augmentation.
215
230
  */
216
231
  moduleAugmentationDir: string;
232
+ /**
233
+ * Type of dictionary to use as an output
234
+ *
235
+ * Default: ['intlayer']
236
+ *
237
+ * The type of dictionary to use as an output. It can be either 'intlayer' or 'i18next'.
238
+ *
239
+ * Note:
240
+ * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
241
+ * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
242
+ *
243
+ */
244
+ dictionaryOutput: DictionaryOutput[];
217
245
  };
218
246
  /**
219
247
  * Configuration derived based on the result directory
@@ -227,6 +255,18 @@ type ResultDirDerivedConfig = {
227
255
  * Specifies the derived path for dictionaries relative to the result directory.
228
256
  */
229
257
  dictionariesDir: string;
258
+ /**
259
+ *
260
+ * Directory where dictionaries are stored, relative to the result directory
261
+ *
262
+ * Default: {{resultDir}} / {{i18nDictionariesDirName}}
263
+ *
264
+ * Specifies the derived path for dictionaries relative to the result directory.
265
+ *
266
+ * Note:
267
+ * - Ensure the i18n dictionaries output includes i18next to build the dictionaries for i18next
268
+ */
269
+ i18nDictionariesDir: string;
230
270
  /**
231
271
  * Directory where dictionary types are stored, relative to the result directory
232
272
  *
@@ -251,7 +291,7 @@ type PatternsContentConfig = {
251
291
  /**
252
292
  * Patterns of files to watch for changes
253
293
  *
254
- * Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json']
294
+ * Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
255
295
  *
256
296
  * Defines file patterns for content to watch for changes.
257
297
  */
@@ -259,7 +299,7 @@ type PatternsContentConfig = {
259
299
  /**
260
300
  * Patterns of files to watch for changes including the relative path
261
301
  *
262
- * Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json']
302
+ * Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
263
303
  *
264
304
  * Specifies the file patterns for content to watch, including relative paths.
265
305
  */
@@ -278,4 +318,4 @@ type PatternsContentConfig = {
278
318
  */
279
319
  type ContentConfig = BaseContentConfig & BaseDerivedConfig & ResultDirDerivedConfig & PatternsContentConfig;
280
320
 
281
- export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, InternationalizationConfig, IntlayerConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule };
321
+ export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, DictionaryOutput, InternationalizationConfig, IntlayerConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule };
@@ -1,3 +1,3 @@
1
1
  export { BaseDerivedConfig as BaseDirDerivedConfiguration, CustomIntlayerConfig, PatternsContentConfig as FixedIntlayerConfig, IntlayerConfig, BaseContentConfig as NotDerivedConfiguration, ResultDirDerivedConfig as ResultDirDerivedConfiguration } from './types/config.mjs';
2
2
  export { Locales, LocalesValues } from './types/locales.mjs';
3
- export { getConfiguration, intlayerConfiguration, intlayerContentConfiguration, intlayerIntlConfiguration, intlayerMiddlewareConfiguration } from './envVariables/getConfiguration.mjs';
3
+ export { getConfiguration } from './envVariables/getConfiguration.mjs';
@@ -1,17 +1,7 @@
1
1
  import { Locales } from './types/locales.mjs';
2
- import {
3
- getConfiguration,
4
- intlayerConfiguration,
5
- intlayerContentConfiguration,
6
- intlayerIntlConfiguration,
7
- intlayerMiddlewareConfiguration
8
- } from './envVariables/getConfiguration.mjs';
2
+ import { getConfiguration } from './envVariables/getConfiguration.mjs';
9
3
  export {
10
4
  Locales,
11
- getConfiguration,
12
- intlayerConfiguration,
13
- intlayerContentConfiguration,
14
- intlayerIntlConfiguration,
15
- intlayerMiddlewareConfiguration
5
+ getConfiguration
16
6
  };
17
7
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client.ts"],"sourcesContent":["export type {\n CustomIntlayerConfig,\n PatternsContentConfig as FixedIntlayerConfig,\n IntlayerConfig,\n BaseContentConfig as NotDerivedConfiguration,\n BaseDerivedConfig as BaseDirDerivedConfiguration,\n ResultDirDerivedConfig as ResultDirDerivedConfiguration,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport {\n getConfiguration,\n intlayerConfiguration,\n intlayerContentConfiguration,\n intlayerIntlConfiguration,\n intlayerMiddlewareConfiguration,\n} from './envVariables/getConfiguration';\n"],"mappings":"AASA,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../../src/client.ts"],"sourcesContent":["export type {\n CustomIntlayerConfig,\n PatternsContentConfig as FixedIntlayerConfig,\n IntlayerConfig,\n BaseContentConfig as NotDerivedConfiguration,\n BaseDerivedConfig as BaseDirDerivedConfiguration,\n ResultDirDerivedConfig as ResultDirDerivedConfiguration,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport { getConfiguration } from './envVariables/getConfiguration';\n"],"mappings":"AASA,SAAS,eAAe;AACxB,SAAS,wBAAwB;","names":[]}
@@ -16,7 +16,9 @@ import {
16
16
  EXCLUDED_PATHS,
17
17
  TYPES_DIR_NAME,
18
18
  MAIN_DIR_NAME,
19
- MODULE_AUGMENTATION_DIR_NAME
19
+ MODULE_AUGMENTATION_DIR_NAME,
20
+ I18N_DICTIONARIES_DIR_NAME,
21
+ DICTIONARY_OUTPUT
20
22
  } from '../defaultValues/server.mjs';
21
23
  let storedConfiguration;
22
24
  const buildInternationalizationFields = (customConfiguration) => ({
@@ -24,6 +26,7 @@ const buildInternationalizationFields = (customConfiguration) => ({
24
26
  * Locales available in the application
25
27
  *
26
28
  * Default: ['en']
29
+ *
27
30
  */
28
31
  locales: customConfiguration?.locales ?? LOCALES,
29
32
  /**
@@ -92,7 +95,7 @@ const buildContentFields = (customConfiguration) => {
92
95
  /**
93
96
  * File extensions of content to look for to build the dictionaries
94
97
  *
95
- * - Default: ['.content.ts', '.content.js', '.content.json']
98
+ * - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
96
99
  *
97
100
  * - Example: ['.data.ts', '.data.js', '.data.json']
98
101
  *
@@ -168,6 +171,20 @@ const buildContentFields = (customConfiguration) => {
168
171
  *
169
172
  */
170
173
  dictionariesDirName: customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,
174
+ /**
175
+ * Related to the intlayer result directory
176
+ *
177
+ * Directory name where the dictionaries will be stored
178
+ *
179
+ * Default: 'dictionary'
180
+ *
181
+ * Example: 'translations'
182
+ *
183
+ * Note:
184
+ * - If this directory is not at the result directory level, update the dictionariesDir field instead
185
+ *
186
+ */
187
+ i18nDictionariesDirName: customConfiguration?.i18nDictionariesDirName ?? I18N_DICTIONARIES_DIR_NAME,
171
188
  /**
172
189
  * Related to the intlayer result directory
173
190
  *
@@ -259,7 +276,17 @@ const buildContentFields = (customConfiguration) => {
259
276
  moduleAugmentationDir: join(
260
277
  notDerivedContentConfig.baseDir,
261
278
  notDerivedContentConfig.moduleAugmentationDirName
262
- )
279
+ ),
280
+ /**
281
+ * Output format of the dictionary
282
+ *
283
+ * Default: ['intlayer']
284
+ *
285
+ * Note:
286
+ * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
287
+ * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
288
+ */
289
+ dictionaryOutput: customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT
263
290
  };
264
291
  const resultDirDerivedConfiguration = {
265
292
  /**
@@ -281,6 +308,22 @@ const buildContentFields = (customConfiguration) => {
281
308
  baseDirDerivedConfiguration.resultDir,
282
309
  notDerivedContentConfig.dictionariesDirName
283
310
  ),
311
+ /**
312
+ * Directory where the 18n dictionaries will be stored
313
+ *
314
+ * Relative to the result directory
315
+ *
316
+ * Default: {{resultDir}} / {{i18nDictionariesDirName}}
317
+ *
318
+ * Example: '/path/to/project/.intlayer/dictionary/i18n'
319
+ *
320
+ * Note:
321
+ * - If the types are not at the result directory level, update the i18nDictionariesDirName field instead
322
+ */
323
+ i18nDictionariesDir: join(
324
+ baseDirDerivedConfiguration.resultDir,
325
+ notDerivedContentConfig.i18nDictionariesDirName
326
+ ),
284
327
  /**
285
328
  * Directory where the dictionaries types will be stored
286
329
  *
@@ -319,7 +362,7 @@ const buildContentFields = (customConfiguration) => {
319
362
  /**
320
363
  * Pattern of files to watch
321
364
  *
322
- * Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json']
365
+ * Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
323
366
  */
324
367
  watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(
325
368
  (ext) => `/**/*${ext}`
@@ -327,7 +370,7 @@ const buildContentFields = (customConfiguration) => {
327
370
  /**
328
371
  * Pattern of files to watch including the relative path
329
372
  *
330
- * Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json']
373
+ * Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
331
374
  */
332
375
  watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(
333
376
  (ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport { DEFAULT_LOCALE, LOCALES } from '../defaultValues/internationalization';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport {\n CONTENT_DIR_NAME,\n DICTIONARIES_DIR_NAME,\n FILE_EXTENSIONS,\n RESULT_DIR_NAME,\n EXCLUDED_PATHS,\n TYPES_DIR_NAME,\n MAIN_DIR_NAME,\n MODULE_AUGMENTATION_DIR_NAME,\n} from '../defaultValues/server';\nimport type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport type { GetConfigurationOptions } from './getConfiguration';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix the default locale in the URL\n *\n * Default: true\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.json']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '/path/to/project'\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? process.cwd(),\n\n /**\n * Directory name where the content is stored\n *\n * Default: 'src'\n *\n * Example:\n * - 'data' -> '/path/to/project/data'\n * - 'content' -> '/path/to/project/content'\n * - 'locales' -> '/path/to/project/locales'\n *\n * Note: If this directory is not at the base directory level, update the contentDir field instead\n */\n contentDirName: customConfiguration?.contentDirName ?? CONTENT_DIR_NAME,\n\n /**\n * Directory name where the result will be stored\n *\n * Default: '.intlayer'\n *\n * Example:\n * - '.next'\n * - 'outputOFIntlayer'\n *\n * Note: If this directory is not at the base directory level, update the resultDir field instead\n */\n resultDirName: customConfiguration?.resultDirName ?? RESULT_DIR_NAME,\n\n /**\n *\n * Directory name where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If this directory is not at the base directory level, update the moduleAugmentationDir field instead\n */\n moduleAugmentationDirName:\n customConfiguration?.moduleAugmentationDirName ??\n MODULE_AUGMENTATION_DIR_NAME,\n // @TODO: Make Module Augmentation optional by adding a flag in the configuration\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n dictionariesDirName:\n customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries types will be stored\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this directory is not at the result directory level, update the typesDir field instead\n *\n */\n typeDirName: customConfiguration?.typeDirName ?? TYPES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the main files will be stored\n *\n * Default: 'main'\n *\n * Example: 'intlayer-main'\n *\n * Note:\n * - If this directory is not at the result directory level, update the mainDir field instead\n */\n mainDirName: customConfiguration?.mainDirName ?? MAIN_DIR_NAME,\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Example: '/path/to/project/src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.contentDirName\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Example: '/path/to/project/.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the resultDirName field instead\n */\n resultDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.resultDirName\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Example: '/path/to/project/types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.moduleAugmentationDirName\n ),\n };\n\n const resultDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.dictionariesDirName\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Example: '/path/to/project/.intlayer/types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.typeDirName\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Example: '/path/to/project/.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.mainDirName\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['{{contentDir}}/**\\/*.content.ts', '{{contentDir}}/**\\/*.content.js', '{{contentDir}}/**\\/*.content.json']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(\n (ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n */\n outputFilesPatternWithPath: `${resultDirDerivedConfiguration.dictionariesDir}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...resultDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n options: GetConfigurationOptions,\n customConfiguration?: CustomIntlayerConfig\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(customConfiguration?.content);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport { DEFAULT_LOCALE, LOCALES } from '../defaultValues/internationalization';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport {\n CONTENT_DIR_NAME,\n DICTIONARIES_DIR_NAME,\n FILE_EXTENSIONS,\n RESULT_DIR_NAME,\n EXCLUDED_PATHS,\n TYPES_DIR_NAME,\n MAIN_DIR_NAME,\n MODULE_AUGMENTATION_DIR_NAME,\n I18N_DICTIONARIES_DIR_NAME,\n DICTIONARY_OUTPUT,\n} from '../defaultValues/server';\nimport type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport type { GetConfigurationOptions } from './getConfiguration';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix the default locale in the URL\n *\n * Default: true\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '/path/to/project'\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? process.cwd(),\n\n /**\n * Directory name where the content is stored\n *\n * Default: 'src'\n *\n * Example:\n * - 'data' -> '/path/to/project/data'\n * - 'content' -> '/path/to/project/content'\n * - 'locales' -> '/path/to/project/locales'\n *\n * Note: If this directory is not at the base directory level, update the contentDir field instead\n */\n contentDirName: customConfiguration?.contentDirName ?? CONTENT_DIR_NAME,\n\n /**\n * Directory name where the result will be stored\n *\n * Default: '.intlayer'\n *\n * Example:\n * - '.next'\n * - 'outputOFIntlayer'\n *\n * Note: If this directory is not at the base directory level, update the resultDir field instead\n */\n resultDirName: customConfiguration?.resultDirName ?? RESULT_DIR_NAME,\n\n /**\n *\n * Directory name where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If this directory is not at the base directory level, update the moduleAugmentationDir field instead\n */\n moduleAugmentationDirName:\n customConfiguration?.moduleAugmentationDirName ??\n MODULE_AUGMENTATION_DIR_NAME,\n // @TODO: Make Module Augmentation optional by adding a flag in the configuration\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n dictionariesDirName:\n customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n i18nDictionariesDirName:\n customConfiguration?.i18nDictionariesDirName ??\n I18N_DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries types will be stored\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this directory is not at the result directory level, update the typesDir field instead\n *\n */\n typeDirName: customConfiguration?.typeDirName ?? TYPES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the main files will be stored\n *\n * Default: 'main'\n *\n * Example: 'intlayer-main'\n *\n * Note:\n * - If this directory is not at the result directory level, update the mainDir field instead\n */\n mainDirName: customConfiguration?.mainDirName ?? MAIN_DIR_NAME,\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Example: '/path/to/project/src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.contentDirName\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Example: '/path/to/project/.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the resultDirName field instead\n */\n resultDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.resultDirName\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Example: '/path/to/project/types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.moduleAugmentationDirName\n ),\n\n /**\n * Output format of the dictionary\n *\n * Default: ['intlayer']\n *\n * Note:\n * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.\n * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer\n */\n dictionaryOutput:\n customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT,\n };\n\n const resultDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.dictionariesDirName\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{i18nDictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary/i18n'\n *\n * Note:\n * - If the types are not at the result directory level, update the i18nDictionariesDirName field instead\n */\n i18nDictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.i18nDictionariesDirName\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Example: '/path/to/project/.intlayer/types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.typeDirName\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Example: '/path/to/project/.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.mainDirName\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['{{contentDir}}/**\\/*.content.ts', '{{contentDir}}/**\\/*.content.js', '{{contentDir}}/**\\/*.content.json', '{{contentDir}}/**\\/*.content.cjs', '{{contentDir}}/**\\/*.content.mjs', '{{contentDir}}/**\\/*.content.tsx', '{{contentDir}}/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(\n (ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n */\n outputFilesPatternWithPath: `${resultDirDerivedConfiguration.dictionariesDir}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...resultDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n options: GetConfigurationOptions,\n customConfiguration?: CustomIntlayerConfig\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(customConfiguration?.content);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"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","names":[]}
@@ -1,10 +1,15 @@
1
+ import { DictionaryOutput } from '../types/config.mjs';
2
+ import '../types/locales.mjs';
3
+
1
4
  declare const FILE_EXTENSIONS: string[];
2
5
  declare const EXCLUDED_PATHS: string[];
3
6
  declare const CONTENT_DIR_NAME = "src";
4
7
  declare const RESULT_DIR_NAME = ".intlayer";
5
8
  declare const MODULE_AUGMENTATION_DIR_NAME = "types";
9
+ declare const DICTIONARY_OUTPUT: DictionaryOutput[];
6
10
  declare const DICTIONARIES_DIR_NAME = "dictionary";
11
+ declare const I18N_DICTIONARIES_DIR_NAME = "i18n_dictionary";
7
12
  declare const TYPES_DIR_NAME = "types";
8
13
  declare const MAIN_DIR_NAME = "main";
9
14
 
10
- export { CONTENT_DIR_NAME, DICTIONARIES_DIR_NAME, EXCLUDED_PATHS, FILE_EXTENSIONS, MAIN_DIR_NAME, MODULE_AUGMENTATION_DIR_NAME, RESULT_DIR_NAME, TYPES_DIR_NAME };
15
+ export { CONTENT_DIR_NAME, DICTIONARIES_DIR_NAME, DICTIONARY_OUTPUT, EXCLUDED_PATHS, FILE_EXTENSIONS, I18N_DICTIONARIES_DIR_NAME, MAIN_DIR_NAME, MODULE_AUGMENTATION_DIR_NAME, RESULT_DIR_NAME, TYPES_DIR_NAME };
@@ -1,16 +1,28 @@
1
- const FILE_EXTENSIONS = [".content.ts", ".content.js", ".content.json"];
1
+ const FILE_EXTENSIONS = [
2
+ ".content.ts",
3
+ ".content.js",
4
+ ".content.cjs",
5
+ ".content.mjs",
6
+ ".content.json",
7
+ ".content.tsx",
8
+ ".content.jsx"
9
+ ];
2
10
  const EXCLUDED_PATHS = ["node_modules"];
3
11
  const CONTENT_DIR_NAME = "src";
4
12
  const RESULT_DIR_NAME = ".intlayer";
5
13
  const MODULE_AUGMENTATION_DIR_NAME = "types";
14
+ const DICTIONARY_OUTPUT = ["intlayer"];
6
15
  const DICTIONARIES_DIR_NAME = "dictionary";
16
+ const I18N_DICTIONARIES_DIR_NAME = "i18n_dictionary";
7
17
  const TYPES_DIR_NAME = "types";
8
18
  const MAIN_DIR_NAME = "main";
9
19
  export {
10
20
  CONTENT_DIR_NAME,
11
21
  DICTIONARIES_DIR_NAME,
22
+ DICTIONARY_OUTPUT,
12
23
  EXCLUDED_PATHS,
13
24
  FILE_EXTENSIONS,
25
+ I18N_DICTIONARIES_DIR_NAME,
14
26
  MAIN_DIR_NAME,
15
27
  MODULE_AUGMENTATION_DIR_NAME,
16
28
  RESULT_DIR_NAME,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/server.ts"],"sourcesContent":["export const FILE_EXTENSIONS = ['.content.ts', '.content.js', '.content.json'];\nexport const EXCLUDED_PATHS = ['node_modules'];\n\nexport const CONTENT_DIR_NAME = 'src';\n\nexport const RESULT_DIR_NAME = '.intlayer';\n\nexport const MODULE_AUGMENTATION_DIR_NAME = 'types';\n\nexport const DICTIONARIES_DIR_NAME = 'dictionary';\n\nexport const TYPES_DIR_NAME = 'types';\n\nexport const MAIN_DIR_NAME = 'main';\n"],"mappings":"AAAO,MAAM,kBAAkB,CAAC,eAAe,eAAe,eAAe;AACtE,MAAM,iBAAiB,CAAC,cAAc;AAEtC,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,+BAA+B;AAErC,MAAM,wBAAwB;AAE9B,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;","names":[]}
1
+ {"version":3,"sources":["../../../src/defaultValues/server.ts"],"sourcesContent":["import type { DictionaryOutput } from '../types/config';\n\nexport const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.tsx',\n '.content.jsx',\n];\nexport const EXCLUDED_PATHS = ['node_modules'];\n\nexport const CONTENT_DIR_NAME = 'src';\n\nexport const RESULT_DIR_NAME = '.intlayer';\n\nexport const MODULE_AUGMENTATION_DIR_NAME = 'types';\n\nexport const DICTIONARY_OUTPUT: DictionaryOutput[] = ['intlayer'];\n\nexport const DICTIONARIES_DIR_NAME = 'dictionary';\n\nexport const I18N_DICTIONARIES_DIR_NAME = 'i18n_dictionary';\n\nexport const TYPES_DIR_NAME = 'types';\n\nexport const MAIN_DIR_NAME = 'main';\n"],"mappings":"AAEO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,iBAAiB,CAAC,cAAc;AAEtC,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,+BAA+B;AAErC,MAAM,oBAAwC,CAAC,UAAU;AAEzD,MAAM,wBAAwB;AAE9B,MAAM,6BAA6B;AAEnC,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;","names":[]}
@@ -1,11 +1,8 @@
1
1
  type Platform = 'next' | 'vite' | 'react_app' | 'unknown';
2
- type ViteEnvVar = {
3
- env: Record<string, string>;
4
- };
5
2
  declare const getPlatform: () => Platform;
6
3
  /**
7
4
  * Get the prefix for the environment variables to be used in the platform
8
5
  */
9
6
  declare const getPrefix: (platform: Platform) => string;
10
7
 
11
- export { type Platform, type ViteEnvVar, getPlatform, getPrefix };
8
+ export { type Platform, getPlatform, getPrefix };
@@ -1,10 +1,13 @@
1
1
  const getPlatform = () => {
2
- if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE === "string") {
2
+ if (
3
+ // eslint-disable-next-line
4
+ typeof import.meta !== "undefined" && typeof import.meta.env !== "undefined" && typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined"
5
+ ) {
6
+ return "vite";
7
+ } else if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== "undefined") {
3
8
  return "next";
4
- } else if (typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE === "string") {
9
+ } else if (typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== "undefined") {
5
10
  return "react_app";
6
- } else if (import.meta?.env?.VITE_INTLAYER_DEFAULT_LOCALE) {
7
- return "vite";
8
11
  }
9
12
  return "unknown";
10
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\nexport type ViteEnvVar = { env: Record<string, string> };\n\nexport const getPlatform = (): Platform => {\n if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE === 'string') {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE === 'string'\n ) {\n // Likely Create React App\n return 'react_app';\n } else if (\n (import.meta as unknown as ViteEnvVar)?.env?.VITE_INTLAYER_DEFAULT_LOCALE\n ) {\n // Likely Vite\n return 'vite';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return '';\n }\n};\n"],"mappings":"AAGO,MAAM,cAAc,MAAgB;AACzC,MAAI,OAAO,QAAQ,IAAI,wCAAwC,UAAU;AAEvE,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,UACzD;AAEA,WAAO;AAAA,EACT,WACG,aAAuC,KAAK,8BAC7C;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n // eslint-disable-next-line\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return '';\n }\n};\n"],"mappings":"AAEO,MAAM,cAAc,MAAgB;AACzC;AAAA;AAAA,IAEE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC;AAAA,IACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { IntlayerConfigEnvVariable } from './types.mjs';
2
+ import '../../types/config.mjs';
3
+ import '../../types/locales.mjs';
4
+
5
+ declare const extractEnvVariable: () => IntlayerConfigEnvVariable;
6
+
7
+ export { extractEnvVariable };
@@ -0,0 +1,20 @@
1
+ import { getPlatform } from '../detectPlatform.mjs';
2
+ import { extractNextEnvVariable } from './next.mjs';
3
+ import { extractReactAppEnvVariable } from './react_app.mjs';
4
+ import { extractEmptyEnvVariable } from './undefined_platform.mjs';
5
+ import { extractViteEnvVariable } from './vite.mjs';
6
+ const extractEnvVariable = () => {
7
+ const platform = getPlatform();
8
+ if (platform === "vite") {
9
+ return extractViteEnvVariable();
10
+ } else if (platform === "next") {
11
+ return extractNextEnvVariable();
12
+ } else if (platform === "react_app") {
13
+ return extractReactAppEnvVariable();
14
+ }
15
+ return extractEmptyEnvVariable();
16
+ };
17
+ export {
18
+ extractEnvVariable
19
+ };
20
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/index.ts"],"sourcesContent":["import { type Platform, getPlatform } from '../detectPlatform';\nimport { extractNextEnvVariable } from './next';\nimport { extractReactAppEnvVariable } from './react_app';\nimport type { IntlayerConfigEnvVariable } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\nimport { extractViteEnvVariable } from './vite';\n\nexport const extractEnvVariable = (): IntlayerConfigEnvVariable => {\n const platform: Platform = getPlatform();\n\n if (platform === 'vite') {\n return extractViteEnvVariable();\n } else if (platform === 'next') {\n return extractNextEnvVariable();\n } else if (platform === 'react_app') {\n return extractReactAppEnvVariable();\n }\n\n return extractEmptyEnvVariable();\n};\n"],"mappings":"AAAA,SAAwB,mBAAmB;AAC3C,SAAS,8BAA8B;AACvC,SAAS,kCAAkC;AAE3C,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AAEhC,MAAM,qBAAqB,MAAiC;AACjE,QAAM,WAAqB,YAAY;AAEvC,MAAI,aAAa,QAAQ;AACvB,WAAO,uBAAuB;AAAA,EAChC,WAAW,aAAa,QAAQ;AAC9B,WAAO,uBAAuB;AAAA,EAChC,WAAW,aAAa,aAAa;AACnC,WAAO,2BAA2B;AAAA,EACpC;AAEA,SAAO,wBAAwB;AACjC;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { IntlayerConfigEnvVariable } from './types.mjs';
2
+ import '../../types/config.mjs';
3
+ import '../../types/locales.mjs';
4
+
5
+ declare const extractNextEnvVariable: () => IntlayerConfigEnvVariable;
6
+
7
+ export { extractNextEnvVariable };
@@ -0,0 +1,46 @@
1
+ const extractNextEnvVariable = () => {
2
+ const internationalization = {
3
+ locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,
4
+ defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE
5
+ };
6
+ const middleware = {
7
+ headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,
8
+ cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,
9
+ prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,
10
+ basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,
11
+ serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,
12
+ noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX
13
+ };
14
+ const content = {
15
+ fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,
16
+ baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,
17
+ contentDirName: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR_NAME,
18
+ contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,
19
+ excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,
20
+ resultDirName: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,
21
+ moduleAugmentationDirName: process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
22
+ dictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,
23
+ i18nDictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,
24
+ typeDirName: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,
25
+ mainDirName: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,
26
+ resultDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,
27
+ moduleAugmentationDir: process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,
28
+ dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,
29
+ i18nDictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
30
+ typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,
31
+ mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,
32
+ watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,
33
+ watchedFilesPatternWithPath: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
34
+ outputFilesPatternWithPath: process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
35
+ dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT
36
+ };
37
+ return {
38
+ internationalization,
39
+ middleware,
40
+ content
41
+ };
42
+ };
43
+ export {
44
+ extractNextEnvVariable
45
+ };
46
+ //# sourceMappingURL=next.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractNextEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,\n defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,\n cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,\n contentDirName: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,\n typeDirName: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,\n moduleAugmentationDir:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDirName:\n process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,\n mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT,\n };\n\n return {\n internationalization,\n middleware,\n content,\n };\n};\n"],"mappings":"AAOO,MAAM,yBAAyB,MAAiC;AACrE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,UAAU,QAAQ,IAAI;AAAA,EACxB;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,QAAQ,IAAI;AAAA,IAC5B,SAAS,QAAQ,IAAI;AAAA,IACrB,gBAAgB,QAAQ,IAAI;AAAA,IAC5B,YAAY,QAAQ,IAAI;AAAA,IACxB,cAAc,QAAQ,IAAI;AAAA,IAC1B,eAAe,QAAQ,IAAI;AAAA,IAC3B,2BACE,QAAQ,IAAI;AAAA,IACd,qBAAqB,QAAQ,IAAI;AAAA,IACjC,qBAAqB,QAAQ,IAAI;AAAA,IACjC,aAAa,QAAQ,IAAI;AAAA,IACzB,aAAa,QAAQ,IAAI;AAAA,IACzB,WAAW,QAAQ,IAAI;AAAA,IACvB,uBACE,QAAQ,IAAI;AAAA,IACd,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,yBACE,QAAQ,IAAI;AAAA,IACd,UAAU,QAAQ,IAAI;AAAA,IACtB,SAAS,QAAQ,IAAI;AAAA,IACrB,qBAAqB,QAAQ,IAAI;AAAA,IACjC,6BACE,QAAQ,IAAI;AAAA,IACd,4BACE,QAAQ,IAAI;AAAA,IACd,kBAAkB,QAAQ,IAAI;AAAA,EAChC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { IntlayerConfigEnvVariable } from './types.mjs';
2
+ import '../../types/config.mjs';
3
+ import '../../types/locales.mjs';
4
+
5
+ declare const extractReactAppEnvVariable: () => IntlayerConfigEnvVariable;
6
+
7
+ export { extractReactAppEnvVariable };
@@ -0,0 +1,46 @@
1
+ const extractReactAppEnvVariable = () => {
2
+ const internationalization = {
3
+ locales: process.env.REACT_APP_INTLAYER_LOCALES,
4
+ defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE
5
+ };
6
+ const middleware = {
7
+ headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,
8
+ cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,
9
+ prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,
10
+ basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,
11
+ serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,
12
+ noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX
13
+ };
14
+ const content = {
15
+ fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,
16
+ baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,
17
+ contentDirName: process.env.REACT_APP_INTLAYER_CONTENT_DIR_NAME,
18
+ contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,
19
+ excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,
20
+ resultDirName: process.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,
21
+ moduleAugmentationDirName: process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
22
+ dictionariesDirName: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,
23
+ i18nDictionariesDirName: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
24
+ typeDirName: process.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,
25
+ mainDirName: process.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,
26
+ resultDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,
27
+ moduleAugmentationDir: process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,
28
+ dictionariesDir: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,
29
+ i18nDictionariesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,
30
+ typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,
31
+ mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,
32
+ watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,
33
+ watchedFilesPatternWithPath: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
34
+ outputFilesPatternWithPath: process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
35
+ dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT
36
+ };
37
+ return {
38
+ internationalization,
39
+ middleware,
40
+ content
41
+ };
42
+ };
43
+ export {
44
+ extractReactAppEnvVariable
45
+ };
46
+ //# sourceMappingURL=react_app.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"sourcesContent":["import type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.REACT_APP_INTLAYER_LOCALES,\n defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,\n cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,\n contentDirName: process.env.REACT_APP_INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDirName:\n process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typeDirName: process.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,\n moduleAugmentationDir:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,\n typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,\n mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,\n };\n\n return {\n internationalization,\n middleware,\n content,\n };\n};\n"],"mappings":"AAOO,MAAM,6BAA6B,MAAiC;AACzE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,UAAU,QAAQ,IAAI;AAAA,EACxB;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,QAAQ,IAAI;AAAA,IAC5B,SAAS,QAAQ,IAAI;AAAA,IACrB,gBAAgB,QAAQ,IAAI;AAAA,IAC5B,YAAY,QAAQ,IAAI;AAAA,IACxB,cAAc,QAAQ,IAAI;AAAA,IAC1B,eAAe,QAAQ,IAAI;AAAA,IAC3B,2BACE,QAAQ,IAAI;AAAA,IACd,qBAAqB,QAAQ,IAAI;AAAA,IACjC,yBACE,QAAQ,IAAI;AAAA,IACd,aAAa,QAAQ,IAAI;AAAA,IACzB,aAAa,QAAQ,IAAI;AAAA,IACzB,WAAW,QAAQ,IAAI;AAAA,IACvB,uBACE,QAAQ,IAAI;AAAA,IACd,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,qBAAqB,QAAQ,IAAI;AAAA,IACjC,UAAU,QAAQ,IAAI;AAAA,IACtB,SAAS,QAAQ,IAAI;AAAA,IACrB,qBAAqB,QAAQ,IAAI;AAAA,IACjC,6BACE,QAAQ,IAAI;AAAA,IACd,4BACE,QAAQ,IAAI;AAAA,IACd,kBAAkB,QAAQ,IAAI;AAAA,EAChC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,11 @@
1
+ import { IntlayerConfig } from '../../types/config.mjs';
2
+ import '../../types/locales.mjs';
3
+
4
+ type ReplaceValue<T> = {
5
+ [K in keyof T]: string | undefined;
6
+ };
7
+ type IntlayerConfigEnvVariable = {
8
+ [K in keyof IntlayerConfig]: ReplaceValue<IntlayerConfig[K]>;
9
+ };
10
+
11
+ export type { IntlayerConfigEnvVariable, ReplaceValue };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import { IntlayerConfigEnvVariable } from './types.mjs';
2
+ import '../../types/config.mjs';
3
+ import '../../types/locales.mjs';
4
+
5
+ declare const extractEmptyEnvVariable: () => IntlayerConfigEnvVariable;
6
+
7
+ export { extractEmptyEnvVariable };