@intlayer/config 2.0.12 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/cjs/configFile/buildConfigurationFields.cjs +43 -5
  2. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  3. package/dist/cjs/configFile/getConfiguration.cjs +3 -1
  4. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  5. package/dist/cjs/configFile/loadConfigurationFile.cjs +26 -5
  6. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  7. package/dist/cjs/defaultValues/editor.cjs +8 -5
  8. package/dist/cjs/defaultValues/editor.cjs.map +1 -1
  9. package/dist/cjs/envVariables/detectPlatform.cjs +1 -1
  10. package/dist/cjs/envVariables/detectPlatform.cjs.map +1 -1
  11. package/dist/cjs/envVariables/extractEnvVariable/next.cjs +5 -2
  12. package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -1
  13. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +5 -2
  14. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -1
  15. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +35 -32
  16. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -1
  17. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +5 -2
  18. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -1
  19. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs +16 -0
  20. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs.map +1 -1
  21. package/dist/cjs/envVariables/getConfiguration.cjs +8 -2
  22. package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
  23. package/dist/cjs/envVariables/index.cjs +8 -2
  24. package/dist/cjs/envVariables/index.cjs.map +1 -1
  25. package/dist/cjs/envVariables/loadEnvFile.cjs +41 -0
  26. package/dist/cjs/envVariables/loadEnvFile.cjs.map +1 -0
  27. package/dist/cjs/index.cjs +9 -2
  28. package/dist/cjs/index.cjs.map +1 -1
  29. package/dist/cjs/types/config.cjs.map +1 -1
  30. package/dist/cjs/types/locales.cjs +3 -2
  31. package/dist/cjs/types/locales.cjs.map +1 -1
  32. package/dist/cjs/utils/ESMxCJSRequire.cjs +32 -0
  33. package/dist/cjs/utils/ESMxCJSRequire.cjs.map +1 -0
  34. package/dist/esm/configFile/buildConfigurationFields.mjs +48 -6
  35. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  36. package/dist/esm/configFile/getConfiguration.mjs +3 -1
  37. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  38. package/dist/esm/configFile/loadConfigurationFile.mjs +16 -4
  39. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  40. package/dist/esm/defaultValues/editor.mjs +5 -3
  41. package/dist/esm/defaultValues/editor.mjs.map +1 -1
  42. package/dist/esm/envVariables/detectPlatform.mjs +1 -1
  43. package/dist/esm/envVariables/detectPlatform.mjs.map +1 -1
  44. package/dist/esm/envVariables/extractEnvVariable/next.mjs +5 -2
  45. package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -1
  46. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +5 -2
  47. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -1
  48. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +35 -32
  49. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -1
  50. package/dist/esm/envVariables/extractEnvVariable/vite.mjs +5 -2
  51. package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -1
  52. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs +1 -0
  53. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs.map +1 -1
  54. package/dist/esm/envVariables/getConfiguration.mjs +8 -2
  55. package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
  56. package/dist/esm/envVariables/index.mjs +5 -1
  57. package/dist/esm/envVariables/index.mjs.map +1 -1
  58. package/dist/esm/envVariables/loadEnvFile.mjs +7 -0
  59. package/dist/esm/envVariables/loadEnvFile.mjs.map +1 -0
  60. package/dist/esm/index.mjs +8 -2
  61. package/dist/esm/index.mjs.map +1 -1
  62. package/dist/esm/types/locales.mjs +3 -2
  63. package/dist/esm/types/locales.mjs.map +1 -1
  64. package/dist/esm/utils/ESMxCJSRequire.mjs +7 -0
  65. package/dist/esm/utils/ESMxCJSRequire.mjs.map +1 -0
  66. package/dist/types/client.d.ts +5 -0
  67. package/dist/types/client.d.ts.map +1 -0
  68. package/dist/types/configFile/buildConfigurationFields.d.ts +7 -0
  69. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -0
  70. package/dist/types/configFile/getConfiguration.d.ts +10 -0
  71. package/dist/types/configFile/getConfiguration.d.ts.map +1 -0
  72. package/dist/types/configFile/index.d.ts +3 -0
  73. package/dist/types/configFile/index.d.ts.map +1 -0
  74. package/dist/types/configFile/loadConfigurationFile.d.ts +9 -0
  75. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -0
  76. package/dist/{cjs → types}/configFile/searchConfigurationFile.d.ts +3 -3
  77. package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -0
  78. package/dist/types/defaultValues/editor.d.ts +4 -0
  79. package/dist/types/defaultValues/editor.d.ts.map +1 -0
  80. package/dist/types/defaultValues/internationalization.d.ts +6 -0
  81. package/dist/types/defaultValues/internationalization.d.ts.map +1 -0
  82. package/dist/types/defaultValues/middleware.d.ts +7 -0
  83. package/dist/types/defaultValues/middleware.d.ts.map +1 -0
  84. package/dist/types/defaultValues/server.d.ts +12 -0
  85. package/dist/types/defaultValues/server.d.ts.map +1 -0
  86. package/dist/types/envVariables/detectPlatform.d.ts +7 -0
  87. package/dist/types/envVariables/detectPlatform.d.ts.map +1 -0
  88. package/dist/types/envVariables/extractEnvVariable/index.d.ts +3 -0
  89. package/dist/types/envVariables/extractEnvVariable/index.d.ts.map +1 -0
  90. package/dist/types/envVariables/extractEnvVariable/next.d.ts +3 -0
  91. package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +1 -0
  92. package/dist/types/envVariables/extractEnvVariable/react_app.d.ts +3 -0
  93. package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +1 -0
  94. package/dist/types/envVariables/extractEnvVariable/types.d.ts +8 -0
  95. package/dist/types/envVariables/extractEnvVariable/types.d.ts.map +1 -0
  96. package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts +3 -0
  97. package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +1 -0
  98. package/dist/types/envVariables/extractEnvVariable/vite.d.ts +3 -0
  99. package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +1 -0
  100. package/dist/types/envVariables/formatEnvVariable.d.ts +6 -0
  101. package/dist/types/envVariables/formatEnvVariable.d.ts.map +1 -0
  102. package/dist/{cjs → types}/envVariables/getConfiguration.d.ts +3 -6
  103. package/dist/types/envVariables/getConfiguration.d.ts.map +1 -0
  104. package/dist/types/envVariables/index.d.ts +5 -0
  105. package/dist/types/envVariables/index.d.ts.map +1 -0
  106. package/dist/types/envVariables/loadEnvFile.d.ts +3 -0
  107. package/dist/types/envVariables/loadEnvFile.d.ts.map +1 -0
  108. package/dist/{cjs → types}/envVariables/utils.d.ts +1 -1
  109. package/dist/types/envVariables/utils.d.ts.map +1 -0
  110. package/dist/types/index.d.ts +7 -0
  111. package/dist/types/index.d.ts.map +1 -0
  112. package/dist/{cjs → types}/types/config.d.ts +58 -24
  113. package/dist/types/types/config.d.ts.map +1 -0
  114. package/dist/{cjs → types}/types/locales.d.ts +9 -7
  115. package/dist/types/types/locales.d.ts.map +1 -0
  116. package/dist/types/utils/ESMxCJSRequire.d.ts +2 -0
  117. package/dist/types/utils/ESMxCJSRequire.d.ts.map +1 -0
  118. package/package.json +32 -17
  119. package/dist/cjs/client.d.ts +0 -3
  120. package/dist/cjs/configFile/buildConfigurationFields.d.ts +0 -10
  121. package/dist/cjs/configFile/getConfiguration.d.ts +0 -13
  122. package/dist/cjs/configFile/index.d.ts +0 -4
  123. package/dist/cjs/configFile/loadConfigurationFile.d.ts +0 -12
  124. package/dist/cjs/defaultValues/editor.d.ts +0 -4
  125. package/dist/cjs/defaultValues/internationalization.d.ts +0 -8
  126. package/dist/cjs/defaultValues/middleware.d.ts +0 -8
  127. package/dist/cjs/defaultValues/server.d.ts +0 -15
  128. package/dist/cjs/envVariables/detectPlatform.d.ts +0 -8
  129. package/dist/cjs/envVariables/extractEnvVariable/index.d.ts +0 -7
  130. package/dist/cjs/envVariables/extractEnvVariable/next.d.ts +0 -7
  131. package/dist/cjs/envVariables/extractEnvVariable/react_app.d.ts +0 -7
  132. package/dist/cjs/envVariables/extractEnvVariable/types.d.ts +0 -11
  133. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.d.ts +0 -7
  134. package/dist/cjs/envVariables/extractEnvVariable/vite.d.ts +0 -7
  135. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.d.ts +0 -2
  136. package/dist/cjs/envVariables/formatEnvVariable.d.ts +0 -8
  137. package/dist/cjs/envVariables/index.d.ts +0 -5
  138. package/dist/cjs/index.d.ts +0 -6
  139. package/dist/esm/client.d.mts +0 -3
  140. package/dist/esm/configFile/buildConfigurationFields.d.mts +0 -10
  141. package/dist/esm/configFile/getConfiguration.d.mts +0 -13
  142. package/dist/esm/configFile/index.d.mts +0 -4
  143. package/dist/esm/configFile/loadConfigurationFile.d.mts +0 -12
  144. package/dist/esm/configFile/searchConfigurationFile.d.mts +0 -18
  145. package/dist/esm/defaultValues/editor.d.mts +0 -4
  146. package/dist/esm/defaultValues/internationalization.d.mts +0 -8
  147. package/dist/esm/defaultValues/middleware.d.mts +0 -8
  148. package/dist/esm/defaultValues/server.d.mts +0 -15
  149. package/dist/esm/envVariables/detectPlatform.d.mts +0 -8
  150. package/dist/esm/envVariables/extractEnvVariable/index.d.mts +0 -7
  151. package/dist/esm/envVariables/extractEnvVariable/next.d.mts +0 -7
  152. package/dist/esm/envVariables/extractEnvVariable/react_app.d.mts +0 -7
  153. package/dist/esm/envVariables/extractEnvVariable/types.d.mts +0 -11
  154. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.d.mts +0 -7
  155. package/dist/esm/envVariables/extractEnvVariable/vite.d.mts +0 -7
  156. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.d.mts +0 -2
  157. package/dist/esm/envVariables/formatEnvVariable.d.mts +0 -8
  158. package/dist/esm/envVariables/getConfiguration.d.mts +0 -11
  159. package/dist/esm/envVariables/index.d.mts +0 -5
  160. package/dist/esm/envVariables/utils.d.mts +0 -7
  161. package/dist/esm/index.d.mts +0 -6
  162. package/dist/esm/types/config.d.mts +0 -372
  163. package/dist/esm/types/locales.d.mts +0 -469
@@ -98,8 +98,14 @@ const getConfiguration = () => {
98
98
  )
99
99
  };
100
100
  const intlayerEditorConfiguration = {
101
- port: (0, import_utils.getEnvValue)(env.editor.port, "number"),
102
- enabled: (0, import_utils.getEnvValue)(env.editor.enabled, "boolean")
101
+ backendURL: (0, import_utils.getEnvValue)(env.editor.backendURL, "string"),
102
+ enabled: (0, import_utils.getEnvValue)(env.editor.enabled, "boolean"),
103
+ clientId: (0, import_utils.getEnvValue)(env.editor.clientId, "string"),
104
+ clientSecret: (0, import_utils.getEnvValue)(env.editor.clientSecret, "string"),
105
+ dictionaryPriorityStrategy: (0, import_utils.getEnvValue)(
106
+ env.editor.dictionaryPriorityStrategy,
107
+ "string"
108
+ )
103
109
  };
104
110
  const intlayerConfiguration = {
105
111
  internationalization: intlayerIntlConfiguration,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport { extractEnvVariable } from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (): IntlayerConfig => {\n const env = extractEnvVariable();\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDirName: getEnvValue(env.content.contentDirName, 'string')!,\n contentDir: getEnvValue(env.content.contentDir, 'string')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n resultDirName: getEnvValue(env.content.resultDirName, 'string')!,\n resultDir: getEnvValue(env.content.resultDir, 'string')!,\n moduleAugmentationDirName: getEnvValue(\n env.content.moduleAugmentationDirName,\n 'string'\n )!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n dictionariesDirName: getEnvValue(\n env.content.dictionariesDirName,\n 'string'\n )!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n i18nDictionariesDirName: getEnvValue(\n env.content.i18nDictionariesDirName,\n 'string'\n )!,\n i18nDictionariesDir: getEnvValue(\n env.content.i18nDictionariesDir,\n 'string'\n )!,\n typeDirName: getEnvValue(env.content.typeDirName, 'string')!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDirName: getEnvValue(env.content.mainDirName, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n };\n\n const intlayerEditorConfiguration = {\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,gCAAmC;AACnC,mBAA4B;AAOrB,MAAM,mBAAmB,MAAsB;AACpD,QAAM,UAAM,8CAAmB;AAE/B,QAAM,4BAAwD;AAAA,IAC5D,aAAS,0BAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,gBAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,mBAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kCAAoD;AAAA,IACxD,gBAAY,0BAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,gBAAY,0BAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,mBAAe,0BAAY,IAAI,WAAW,eAAe,SAAS;AAAA,I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QAAQ;AAAA,IAClD,yBAAqB;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,iCAA6B;AAAA,MAC3B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,gCAA4B;AAAA,MAC1B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,QAAM,8BAA8B;AAAA,IAClC,UAAM,0BAAY,IAAI,OAAO,MAAM,QAAQ;AAAA,IAC3C,aAAS,0BAAY,IAAI,OAAO,SAAS,SAAS;AAAA,EACpD;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport { extractEnvVariable } from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (): IntlayerConfig => {\n const env = extractEnvVariable();\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDirName: getEnvValue(env.content.contentDirName, 'string')!,\n contentDir: getEnvValue(env.content.contentDir, 'string')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n resultDirName: getEnvValue(env.content.resultDirName, 'string')!,\n resultDir: getEnvValue(env.content.resultDir, 'string')!,\n moduleAugmentationDirName: getEnvValue(\n env.content.moduleAugmentationDirName,\n 'string'\n )!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n dictionariesDirName: getEnvValue(\n env.content.dictionariesDirName,\n 'string'\n )!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n i18nDictionariesDirName: getEnvValue(\n env.content.i18nDictionariesDirName,\n 'string'\n )!,\n i18nDictionariesDir: getEnvValue(\n env.content.i18nDictionariesDir,\n 'string'\n )!,\n typeDirName: getEnvValue(env.content.typeDirName, 'string')!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDirName: getEnvValue(env.content.mainDirName, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n };\n\n const intlayerEditorConfiguration = {\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'locale_first' | 'distant_first',\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,gCAAmC;AACnC,mBAA4B;AAOrB,MAAM,mBAAmB,MAAsB;AACpD,QAAM,UAAM,8CAAmB;AAE/B,QAAM,4BAAwD;AAAA,IAC5D,aAAS,0BAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,gBAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,mBAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kCAAoD;AAAA,IACxD,gBAAY,0BAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,gBAAY,0BAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,mBAAe,0BAAY,IAAI,WAAW,eAAe,SAAS;AAAA,IAClE,cAAU,0BAAY,IAAI,WAAW,UAAU,QAAQ;AAAA,IACvD,qBAAiB;AAAA,MACf,IAAI,WAAW;AAAA,MACf;AAAA,IACF;AAAA,IACA,cAAU,0BAAY,IAAI,WAAW,UAAU,SAAS;AAAA,EAC1D;AAEA,QAAM,+BAA8C;AAAA,IAClD,oBAAgB,0BAAoB,IAAI,QAAQ,gBAAgB,OAAO;AAAA,IACvE,aAAS,0BAAY,IAAI,QAAQ,SAAS,QAAQ;AAAA,IAClD,oBAAgB,0BAAY,IAAI,QAAQ,gBAAgB,QAAQ;AAAA,IAChE,gBAAY,0BAA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AO,UAAU,QAAQ;AAAA,IACnD,kBAAc,0BAAY,IAAI,OAAO,cAAc,QAAQ;AAAA,IAC3D,gCAA4B;AAAA,MAC1B,IAAI,OAAO;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
@@ -19,14 +19,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var envVariables_exports = {};
20
20
  __export(envVariables_exports, {
21
21
  formatEnvVariable: () => import_formatEnvVariable.formatEnvVariable,
22
- getConfiguration: () => import_getConfiguration.getConfiguration
22
+ getConfiguration: () => import_getConfiguration.getConfiguration,
23
+ getPlatform: () => import_detectPlatform.getPlatform,
24
+ loadEnvFile: () => import_loadEnvFile.loadEnvFile
23
25
  });
24
26
  module.exports = __toCommonJS(envVariables_exports);
25
27
  var import_getConfiguration = require('./getConfiguration.cjs');
26
28
  var import_formatEnvVariable = require('./formatEnvVariable.cjs');
29
+ var import_loadEnvFile = require('./loadEnvFile.cjs');
30
+ var import_detectPlatform = require('./detectPlatform.cjs');
27
31
  // Annotate the CommonJS export names for ESM import in node:
28
32
  0 && (module.exports = {
29
33
  formatEnvVariable,
30
- getConfiguration
34
+ getConfiguration,
35
+ getPlatform,
36
+ loadEnvFile
31
37
  });
32
38
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/index.ts"],"sourcesContent":["export { getConfiguration } from './getConfiguration';\nexport { formatEnvVariable } from './formatEnvVariable';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,+BAAkC;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/index.ts"],"sourcesContent":["export { getConfiguration } from './getConfiguration';\nexport { formatEnvVariable } from './formatEnvVariable';\nexport { loadEnvFile } from './loadEnvFile';\nexport { getPlatform } from './detectPlatform';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,+BAAkC;AAClC,yBAA4B;AAC5B,4BAA4B;","names":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var loadEnvFile_exports = {};
30
+ __export(loadEnvFile_exports, {
31
+ loadEnvFile: () => loadEnvFile
32
+ });
33
+ module.exports = __toCommonJS(loadEnvFile_exports);
34
+ var import_dotenv = __toESM(require("dotenv"));
35
+ const env = process.env.NODE_ENV ?? "development";
36
+ const loadEnvFile = () => import_dotenv.default.config({ path: [".env", `.env.${env}`, `.env.${env}.local`] });
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ loadEnvFile
40
+ });
41
+ //# sourceMappingURL=loadEnvFile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/envVariables/loadEnvFile.ts"],"sourcesContent":["import dotenv from 'dotenv';\n\nconst env = process.env.NODE_ENV ?? 'development';\n\nexport const loadEnvFile = () =>\n dotenv.config({ path: ['.env', `.env.${env}`, `.env.${env}.local`] });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AAEnB,MAAM,MAAM,QAAQ,IAAI,YAAY;AAE7B,MAAM,cAAc,MACzB,cAAAA,QAAO,OAAO,EAAE,MAAM,CAAC,QAAQ,QAAQ,GAAG,IAAI,QAAQ,GAAG,QAAQ,EAAE,CAAC;","names":["dotenv"]}
@@ -18,20 +18,27 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var src_exports = {};
20
20
  __export(src_exports, {
21
+ ESMxCJSRequire: () => import_ESMxCJSRequire.ESMxCJSRequire,
21
22
  Locales: () => import_locales.Locales,
22
23
  formatEnvVariable: () => import_envVariables.formatEnvVariable,
23
24
  getClientConfiguration: () => import_envVariables.getConfiguration,
24
- getConfiguration: () => import_getConfiguration.getConfiguration
25
+ getConfiguration: () => import_getConfiguration.getConfiguration,
26
+ getPlatform: () => import_envVariables.getPlatform,
27
+ loadEnvFile: () => import_envVariables.loadEnvFile
25
28
  });
26
29
  module.exports = __toCommonJS(src_exports);
27
30
  var import_getConfiguration = require('./configFile/getConfiguration.cjs');
28
31
  var import_locales = require('./types/locales.cjs');
29
32
  var import_envVariables = require('./envVariables/index.cjs');
33
+ var import_ESMxCJSRequire = require('./utils/ESMxCJSRequire.cjs');
30
34
  // Annotate the CommonJS export names for ESM import in node:
31
35
  0 && (module.exports = {
36
+ ESMxCJSRequire,
32
37
  Locales,
33
38
  formatEnvVariable,
34
39
  getClientConfiguration,
35
- getConfiguration
40
+ getConfiguration,
41
+ getPlatform,
42
+ loadEnvFile
36
43
  });
37
44
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getConfiguration } from './configFile/getConfiguration';\n\nexport type {\n InternationalizationConfig,\n ServerSetCookieRule,\n MiddlewareConfig,\n CustomIntlayerConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n ResultDirDerivedConfig,\n PatternsContentConfig,\n ContentConfig,\n StrictMode,\n IntlayerConfig,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport {\n formatEnvVariable,\n getConfiguration as getClientConfiguration,\n} from './envVariables/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AAgBjC,qBAAwB;AACxB,0BAGO;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getConfiguration } from './configFile/getConfiguration';\n\nexport type {\n InternationalizationConfig,\n ServerSetCookieRule,\n MiddlewareConfig,\n CustomIntlayerConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n ResultDirDerivedConfig,\n PatternsContentConfig,\n ContentConfig,\n StrictMode,\n IntlayerConfig,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport {\n formatEnvVariable,\n getConfiguration as getClientConfiguration,\n loadEnvFile,\n getPlatform,\n} from './envVariables/index';\nexport { ESMxCJSRequire } from './utils/ESMxCJSRequire';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AAgBjC,qBAAwB;AACxB,0BAKO;AACP,4BAA+B;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/config.ts"],"sourcesContent":["import type { Locales } from './locales';\n\nexport type StrictMode = 'strict' | 'required_only' | 'loose';\n\n/**\n * Configuration for internationalization settings\n */\nexport type InternationalizationConfig = {\n /**\n * Locales available in the application\n *\n * Default: [Locales.ENGLISH]\n *\n * You can define a list of available locales to support in the application.\n */\n locales: Locales[];\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - 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.\n * - If set to \"required_only\", 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.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"required_only\"\n */\n strictMode: StrictMode;\n /**\n * Default locale of the application for fallback\n *\n * Default: Locales.ENGLISH\n *\n * Used to specify a fallback locale in case no other locale is set.\n */\n defaultLocale: Locales;\n};\n\nexport type ServerSetCookieRule = 'always' | 'never';\n\n/**\n * Configuration for middleware behaviors\n */\nexport type MiddlewareConfig = {\n /**\n * Header name to get the locale from the request\n *\n * Default: 'x-intlayer-locale'\n *\n * The HTTP header key used to determine the current locale.\n */\n headerName: string;\n\n /**\n * Cookie name to store the locale information\n *\n * Default: 'NEXT_LOCALE'\n *\n * The cookie key where the locale information is stored.\n */\n cookieName: string;\n\n /**\n * Whether to prefix the default locale in the URL\n *\n * Default: false\n *\n * When set to true, the default locale is prefixed in the URL for localization purposes.\n */\n prefixDefault: boolean;\n\n /**\n * Base path for application URLs\n *\n * Default: ''\n *\n * Defines the base path where the application is accessible from.\n */\n basePath: string;\n\n /**\n * Strategy for setting the locale cookie on the server\n *\n * Default: 'always'\n *\n * This setting controls when the server sets the locale cookie. It can either set the cookie on every request or never set it.\n */\n serverSetCookie: ServerSetCookieRule;\n\n /**\n * Indicates if no prefix should be used in the URL for locale\n *\n * Default: false\n *\n * If true, no locale-based prefix is used in the URL.\n */\n noPrefix: boolean;\n};\n\n/**\n * Configuration for intlayer editor\n */\nexport type EditorConfig = {\n /**\n * Port number for the editor server\n *\n * Default: 4000\n *\n * The port number where the editor server runs.\n */\n port: number;\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n *\n */\n enabled: boolean;\n};\n\n/**\n * Custom configuration that can be provided to override default settings\n */\nexport type CustomIntlayerConfig = {\n /**\n * Custom internationalization configuration\n */\n internationalization?: Partial<InternationalizationConfig>;\n\n /**\n * Custom middleware configuration\n */\n middleware?: Partial<MiddlewareConfig>;\n\n /**\n * Custom content configuration\n */\n content?: Partial<ContentConfig>;\n\n /**\n * Custom editor configuration\n */\n editor?: Partial<EditorConfig>;\n};\n\n/**\n * Combined configuration for internationalization, middleware, and content\n */\nexport type IntlayerConfig = {\n /**\n * Internationalization configuration\n */\n internationalization: InternationalizationConfig;\n\n /**\n * Middleware configuration\n */\n middleware: MiddlewareConfig;\n\n /**\n * Content configuration\n */\n content: ContentConfig;\n\n /**\n * Intlayer editor configuration\n */\n editor: EditorConfig;\n};\n\n/**\n * Base configuration for content handling\n */\nexport type BaseContentConfig = {\n /**\n * File extensions of content to look for\n *\n * Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * List of file extensions to scan for content.\n */\n fileExtensions: string[];\n\n /**\n * Absolute path of the project's base directory\n *\n * Default: process.cwd()\n *\n * The root directory of the project, typically used for resolving other paths.\n */\n baseDir: string;\n\n /**\n * Name of the directory where the content is stored\n *\n * Default: 'src'\n *\n * Specifies the directory where the primary content is stored.\n */\n contentDirName: string;\n\n /**\n * Directories to be excluded from content processing\n *\n * Default: ['node_modules']\n *\n * A list of directories to exclude from content processing.\n */\n excludedPath: string[];\n\n /**\n * Name of the directory where results are stored\n *\n * Default: '.intlayer'\n *\n * The directory for storing intermediate or output results.\n */\n resultDirName: string;\n\n /**\n * Name of the directory for module augmentation\n *\n * Default: 'types'\n *\n * Defines the directory for additional module types.\n */\n moduleAugmentationDirName: string;\n\n /**\n * Name of the directory where dictionaries are stored\n *\n * Default: 'dictionary'\n *\n * The directory for storing localization dictionaries.\n *\n * Note:\n * - Ensure the dictionaries output includes intlayer to build the dictionaries for intlayer\n */\n dictionariesDirName: string;\n\n /**\n * Name of the directory where dictionaries are stored\n *\n * Default: 'i18n_dictionary'\n *\n * The directory for storing localization dictionaries.\n *\n * Note:\n * - Ensure the dictionaries output includes 'i18next' to build the dictionaries for i18next\n */\n i18nDictionariesDirName: string;\n\n /**\n * Name of the directory where dictionary types are stored\n *\n * Default: 'types'\n *\n * The directory for storing dictionary type definitions.\n */\n typeDirName: string;\n\n /**\n * Name of the directory where the main files are stored\n *\n * Default: 'main'\n *\n * Specifies the directory for storing main application files.\n */\n mainDirName: string;\n};\n\nexport type DictionaryOutput = 'intlayer' | 'i18next';\n\n/**\n * Configuration derived based on the base content configuration\n */\nexport type BaseDerivedConfig = {\n /**\n * Directory where the content is stored, relative to the base directory\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Derived content directory based on the base configuration.\n */\n contentDir: string;\n\n /**\n * Directory where the results are stored, relative to the base directory\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Derived results directory based on the base configuration.\n */\n resultDir: string;\n\n /**\n * Directory for module augmentation, relative to the base directory\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Defines the derived path for module augmentation.\n */\n moduleAugmentationDir: string;\n\n /**\n * Type of dictionary to use as an output\n *\n * Default: ['intlayer']\n *\n * The type of dictionary to use as an output. It can be either 'intlayer' or 'i18next'.\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 */\n dictionaryOutput: DictionaryOutput[];\n};\n\n/**\n * Configuration derived based on the result directory\n */\nexport type ResultDirDerivedConfig = {\n /**\n * Directory where dictionaries are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Specifies the derived path for dictionaries relative to the result directory.\n */\n dictionariesDir: string;\n\n /**\n *\n * Directory where dictionaries are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{i18nDictionariesDirName}}\n *\n * Specifies the derived path for dictionaries relative to the result directory.\n *\n * Note:\n * - Ensure the i18n dictionaries output includes i18next to build the dictionaries for i18next\n */\n i18nDictionariesDir: string;\n\n /**\n * Directory where dictionary types are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Specifies the derived path for dictionary types relative to the result directory.\n */\n typesDir: string;\n\n /**\n * Directory where the main files are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Specifies the derived path for the main files relative to the result directory.\n */\n mainDir: string;\n};\n\n/**\n * Configuration for content patterns\n */\nexport type PatternsContentConfig = {\n /**\n * Patterns of files to watch for changes\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n *\n * Defines file patterns for content to watch for changes.\n */\n watchedFilesPattern: string[];\n\n /**\n * Patterns of files to watch for changes 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 * Specifies the file patterns for content to watch, including relative paths.\n */\n watchedFilesPatternWithPath: string[];\n\n /**\n * Pattern for output files including the relative path\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n *\n * Defines the pattern for output files, including the relative path.\n */\n outputFilesPatternWithPath: string;\n};\n\n// @TODO: Implement exclusion of non configurable fields, to not allow them to be set in the config\n/**\n * General configuration derived from the config file\n */\nexport type ContentConfig = BaseContentConfig &\n BaseDerivedConfig &\n ResultDirDerivedConfig &\n PatternsContentConfig;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/types/config.ts"],"sourcesContent":["import type { Locales } from './locales';\n\nexport type StrictMode = 'strict' | 'required_only' | 'loose';\n\n/**\n * Configuration for internationalization settings\n */\nexport type InternationalizationConfig = {\n /**\n * Locales available in the application\n *\n * Default: [Locales.ENGLISH]\n *\n * You can define a list of available locales to support in the application.\n */\n locales: Locales[];\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - 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.\n * - If set to \"required_only\", 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.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"required_only\"\n */\n strictMode: StrictMode;\n /**\n * Default locale of the application for fallback\n *\n * Default: Locales.ENGLISH\n *\n * Used to specify a fallback locale in case no other locale is set.\n */\n defaultLocale: Locales;\n};\n\nexport type ServerSetCookieRule = 'always' | 'never';\n\n/**\n * Configuration for middleware behaviors\n */\nexport type MiddlewareConfig = {\n /**\n * Header name to get the locale from the request\n *\n * Default: 'x-intlayer-locale'\n *\n * The HTTP header key used to determine the current locale.\n */\n headerName: string;\n\n /**\n * Cookie name to store the locale information\n *\n * Default: 'NEXT_LOCALE'\n *\n * The cookie key where the locale information is stored.\n */\n cookieName: string;\n\n /**\n * Prefix default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\n */\n prefixDefault: boolean;\n\n /**\n * Base path for application URLs\n *\n * Default: ''\n *\n * Defines the base path where the application is accessible from.\n */\n basePath: string;\n\n /**\n * Strategy for setting the locale cookie on the server\n *\n * Default: 'always'\n *\n * This setting controls when the server sets the locale cookie. It can either set the cookie on every request or never set it.\n */\n serverSetCookie: ServerSetCookieRule;\n\n /**\n * Indicates if no prefix should be used in the URL for locale\n *\n * Default: false\n *\n * If true, no locale-based prefix is used in the URL.\n */\n noPrefix: boolean;\n};\n\n/**\n * Configuration for intlayer editor\n */\nexport type EditorConfig = {\n /**\n * URL of the backend\n *\n * Default: 'https://back.intlayer.org'\n *\n * The URL of the backend server.\n */\n backendURL: string;\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n *\n */\n enabled: boolean;\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > 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.\n */\n clientId?: string;\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > 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.\n */\n clientSecret?: string;\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'locale_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'locale_first' or 'distant_first'.\n * - 'locale_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy: 'locale_first' | 'distant_first';\n};\n\n/**\n * Custom configuration that can be provided to override default settings\n */\nexport type CustomIntlayerConfig = {\n /**\n * Custom internationalization configuration\n */\n internationalization?: Partial<InternationalizationConfig>;\n\n /**\n * Custom middleware configuration\n */\n middleware?: Partial<MiddlewareConfig>;\n\n /**\n * Custom content configuration\n */\n content?: Partial<ContentConfig>;\n\n /**\n * Custom editor configuration\n */\n editor?: Partial<EditorConfig>;\n};\n\n/**\n * Combined configuration for internationalization, middleware, and content\n */\nexport type IntlayerConfig = {\n /**\n * Internationalization configuration\n */\n internationalization: InternationalizationConfig;\n\n /**\n * Middleware configuration\n */\n middleware: MiddlewareConfig;\n\n /**\n * Content configuration\n */\n content: ContentConfig;\n\n /**\n * Intlayer editor configuration\n */\n editor: EditorConfig;\n};\n\n/**\n * Base configuration for content handling\n */\nexport type BaseContentConfig = {\n /**\n * File extensions of content to look for\n *\n * Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * List of file extensions to scan for content.\n */\n fileExtensions: string[];\n\n /**\n * Absolute path of the project's base directory\n *\n * Default: process.cwd()\n *\n * The root directory of the project, typically used for resolving other paths.\n */\n baseDir: string;\n\n /**\n * Name of the directory where the content is stored\n *\n * Default: 'src'\n *\n * Specifies the directory where the primary content is stored.\n */\n contentDirName: string;\n\n /**\n * Directories to be excluded from content processing\n *\n * Default: ['node_modules']\n *\n * A list of directories to exclude from content processing.\n */\n excludedPath: string[];\n\n /**\n * Name of the directory where results are stored\n *\n * Default: '.intlayer'\n *\n * The directory for storing intermediate or output results.\n */\n resultDirName: string;\n\n /**\n * Name of the directory for module augmentation\n *\n * Default: 'types'\n *\n * Defines the directory for additional module types.\n */\n moduleAugmentationDirName: string;\n\n /**\n * Name of the directory where dictionaries are stored\n *\n * Default: 'dictionary'\n *\n * The directory for storing localization dictionaries.\n *\n * Note:\n * - Ensure the dictionaries output includes intlayer to build the dictionaries for intlayer\n */\n dictionariesDirName: string;\n\n /**\n * Name of the directory where dictionaries are stored\n *\n * Default: 'i18n_dictionary'\n *\n * The directory for storing localization dictionaries.\n *\n * Note:\n * - Ensure the dictionaries output includes 'i18next' to build the dictionaries for i18next\n */\n i18nDictionariesDirName: string;\n\n /**\n * Name of the directory where dictionary types are stored\n *\n * Default: 'types'\n *\n * The directory for storing dictionary type definitions.\n */\n typeDirName: string;\n\n /**\n * Name of the directory where the main files are stored\n *\n * Default: 'main'\n *\n * Specifies the directory for storing main application files.\n */\n mainDirName: string;\n};\n\nexport type DictionaryOutput = 'intlayer' | 'i18next';\n\n/**\n * Configuration derived based on the base content configuration\n */\nexport type BaseDerivedConfig = {\n /**\n * Directory where the content is stored, relative to the base directory\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Derived content directory based on the base configuration.\n */\n contentDir: string;\n\n /**\n * Directory where the results are stored, relative to the base directory\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Derived results directory based on the base configuration.\n */\n resultDir: string;\n\n /**\n * Directory for module augmentation, relative to the base directory\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Defines the derived path for module augmentation.\n */\n moduleAugmentationDir: string;\n\n /**\n * Type of dictionary to use as an output\n *\n * Default: ['intlayer']\n *\n * The type of dictionary to use as an output. It can be either 'intlayer' or 'i18next'.\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 */\n dictionaryOutput: DictionaryOutput[];\n};\n\n/**\n * Configuration derived based on the result directory\n */\nexport type ResultDirDerivedConfig = {\n /**\n * Directory where dictionaries are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Specifies the derived path for dictionaries relative to the result directory.\n */\n dictionariesDir: string;\n\n /**\n *\n * Directory where dictionaries are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{i18nDictionariesDirName}}\n *\n * Specifies the derived path for dictionaries relative to the result directory.\n *\n * Note:\n * - Ensure the i18n dictionaries output includes i18next to build the dictionaries for i18next\n */\n i18nDictionariesDir: string;\n\n /**\n * Directory where dictionary types are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Specifies the derived path for dictionary types relative to the result directory.\n */\n typesDir: string;\n\n /**\n * Directory where the main files are stored, relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Specifies the derived path for the main files relative to the result directory.\n */\n mainDir: string;\n};\n\n/**\n * Configuration for content patterns\n */\nexport type PatternsContentConfig = {\n /**\n * Patterns of files to watch for changes\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n *\n * Defines file patterns for content to watch for changes.\n */\n watchedFilesPattern: string[];\n\n /**\n * Patterns of files to watch for changes 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 * Specifies the file patterns for content to watch, including relative paths.\n */\n watchedFilesPatternWithPath: string[];\n\n /**\n * Pattern for output files including the relative path\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n *\n * Defines the pattern for output files, including the relative path.\n */\n outputFilesPatternWithPath: string;\n};\n\n// @TODO: Implement exclusion of non configurable fields, to not allow them to be set in the config\n/**\n * General configuration derived from the config file\n */\nexport type ContentConfig = BaseContentConfig &\n BaseDerivedConfig &\n ResultDirDerivedConfig &\n PatternsContentConfig;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -245,11 +245,12 @@ var Locales = /* @__PURE__ */ ((Locales2) => {
245
245
  Locales2["XHOSA"] = "xh";
246
246
  Locales2["XHOSA_SOUTH_AFRICA"] = "xh-ZA";
247
247
  Locales2["CHINESE"] = "zh";
248
- Locales2["CHINESE_SIMPLIFIED"] = "zh-CN";
248
+ Locales2["CHINESE_SIMPLIFIED"] = "zh-Hans";
249
+ Locales2["CHINESE_SIMPLIFIED_CHINA"] = "zh-CN";
249
250
  Locales2["CHINESE_HONG_KONG"] = "zh-HK";
250
251
  Locales2["CHINESE_MACAU"] = "zh-MO";
251
252
  Locales2["CHINESE_SINGAPORE"] = "zh-SG";
252
- Locales2["CHINESE_TRADITIONAL"] = "zh-TW";
253
+ Locales2["CHINESE_TRADITIONAL"] = "zh-Hant";
253
254
  Locales2["ZULU"] = "zu";
254
255
  Locales2["ZULU_SOUTH_AFRICA"] = "zu-ZA";
255
256
  return Locales2;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/locales.ts"],"sourcesContent":["/** Can be imported from a shared config */\nexport enum Locales {\n /** Afrikaans language */\n AFRIKAANS = 'af',\n /** Afrikaans language as used in South Africa */\n AFRIKAANS_SOUTH_AFRICA = 'af-ZA',\n /** Arabic language */\n ARABIC = 'ar',\n /** Arabic language as used in the United Arab Emirates */\n ARABIC_UNITED_ARAB_EMIRATES = 'ar-AE',\n /** Arabic language as used in Bahrain */\n ARABIC_BAHRAIN = 'ar-BH',\n /** Arabic language as used in Algeria */\n ARABIC_ALGERIA = 'ar-DZ',\n /** Arabic language as used in Egypt */\n ARABIC_EGYPT = 'ar-EG',\n /** Arabic language as used in Iraq */\n ARABIC_IRAQ = 'ar-IQ',\n /** Arabic language as used in Jordan */\n ARABIC_JORDAN = 'ar-JO',\n /** Arabic language as used in Kuwait */\n ARABIC_KUWAIT = 'ar-KW',\n /** Arabic language as used in Lebanon */\n ARABIC_LEBANON = 'ar-LB',\n /** Arabic language as used in Libya */\n ARABIC_LIBYA = 'ar-LY',\n /** Arabic language as used in Morocco */\n ARABIC_MOROCCO = 'ar-MA',\n /** Arabic language as used in Oman */\n ARABIC_OMAN = 'ar-OM',\n /** Arabic language as used in Qatar */\n ARABIC_QATAR = 'ar-QA',\n /** Arabic language as used in Saudi Arabia */\n ARABIC_SAUDI_ARABIA = 'ar-SA',\n /** Arabic language as used in Syria */\n ARABIC_SYRIA = 'ar-SY',\n /** Arabic language as used in Tunisia */\n ARABIC_TUNISIA = 'ar-TN',\n /** Arabic language as used in Yemen */\n ARABIC_YEMEN = 'ar-YE',\n /** Azeri language (Latin script) */\n AZERI_LATIN = 'az',\n /** Azeri language (Latin script) as used in Azerbaijan */\n AZERI_LATIN_AZERBAIJAN = 'az-AZ',\n /** Belarusian language */\n BELARUSIAN = 'be',\n /** Belarusian language as used in Belarus */\n BELARUSIAN_BELARUS = 'be-BY',\n /** Bulgarian language */\n BULGARIAN = 'bg',\n /** Bulgarian language as used in Bulgaria */\n BULGARIAN_BULGARIA = 'bg-BG',\n /** Bosnian */\n BOSNIAN = 'bs',\n /** Bosnian language as used in Bosnia and Herzegovina */\n BOSNIAN_BOSNIA_AND_HERZEGOVINA = 'bs-BA',\n /** Catalan language */\n CATALAN = 'ca',\n /** Catalan language as used in Spain */\n CATALAN_SPAIN = 'ca-ES',\n /** Czech language */\n CZECH = 'cs',\n /** Czech language as used in Czech Republic */\n CZECH_CZECH_REPUBLIC = 'cs-CZ',\n /** Welsh language */\n WELSH = 'cy',\n /** Welsh language as used in the United Kingdom */\n WELSH_UNITED_KINGDOM = 'cy-GB',\n /** Danish language */\n DANISH = 'da',\n /** Danish language as used in Denmark */\n DANISH_DENMARK = 'da-DK',\n /** German language */\n GERMAN = 'de',\n /** German language as used in Austria */\n GERMAN_AUSTRIA = 'de-AT',\n /** German language as used in Switzerland */\n GERMAN_SWITZERLAND = 'de-CH',\n /** German language as used in Germany */\n GERMAN_GERMANY = 'de-DE',\n /** German language as used in Liechtenstein */\n GERMAN_LIECHTENSTEIN = 'de-LI',\n /** German language as used in Luxembourg */\n GERMAN_LUXEMBOURG = 'de-LU',\n /** Divehi language */\n DIVEHI = 'dv',\n /** Divehi language as used in Maldives */\n DIVEHI_MALDIVES = 'dv-MV',\n /** Greek language */\n GREEK = 'el',\n /** Greek language as used in Greece */\n GREEK_GREECE = 'el-GR',\n /** English language */\n ENGLISH = 'en',\n /** English language as used in Australia */\n ENGLISH_AUSTRALIA = 'en-AU',\n /** English language as used in Belize */\n ENGLISH_BELIZE = 'en-BZ',\n /** English language as used in Canada */\n ENGLISH_CANADA = 'en-CA',\n /** English language as used in Caribbean */\n ENGLISH_CARIBBEAN = 'en-CB',\n /** English language as used in the United Kingdom */\n ENGLISH_UNITED_KINGDOM = 'en-GB',\n /** English language as used in Ireland */\n ENGLISH_IRELAND = 'en-IE',\n /** English language as used in Jamaica */\n ENGLISH_JAMAICA = 'en-JM',\n /** English language as used in New Zealand */\n ENGLISH_NEW_ZEALAND = 'en-NZ',\n /** English language as used in Philippines */\n ENGLISH_PHILIPPINES = 'en-PH',\n /** English language as used in Trinidad and Tobago */\n ENGLISH_TRINIDAD_AND_TOBAGO = 'en-TT',\n /** English language as used in the United States */\n ENGLISH_UNITED_STATES = 'en-US',\n /** English language as used in South Africa */\n ENGLISH_SOUTH_AFRICA = 'en-ZA',\n /** English language as used in Zimbabwe */\n ENGLISH_ZIMBABWE = 'en-ZW',\n /** Esperanto language */\n ESPERANTO = 'eo',\n /** Spanish language */\n SPANISH = 'es',\n /** Spanish language as used in Argentina */\n SPANISH_ARGENTINA = 'es-AR',\n /** Spanish language as used in Bolivia */\n SPANISH_BOLIVIA = 'es-BO',\n /** Spanish language as used in Chile */\n SPANISH_CHILE = 'es-CL',\n /** Spanish language as used in Colombia */\n SPANISH_COLOMBIA = 'es-CO',\n /** Spanish language as used in Costa Rica */\n SPANISH_COSTA_RICA = 'es-CR',\n /** Spanish language as used in Dominican Republic */\n SPANISH_DOMINICAN_REPUBLIC = 'es-DO',\n /** Spanish language as used in Ecuador */\n SPANISH_ECUADOR = 'es-EC',\n /** Spanish language as used in Spain */\n SPANISH_SPAIN = 'es-ES',\n /** Spanish language as used in Guatemala */\n SPANISH_GUATEMALA = 'es-GT',\n /** Spanish language as used in Honduras */\n SPANISH_HONDURAS = 'es-HN',\n /** Spanish language as used in Mexico */\n SPANISH_MEXICO = 'es-MX',\n /** Spanish language as used in Nicaragua */\n SPANISH_NICARAGUA = 'es-NI',\n /** Spanish language as used in Panama */\n SPANISH_PANAMA = 'es-PA',\n /** Spanish language as used in Peru */\n SPANISH_PERU = 'es-PE',\n /** Spanish language as used in Puerto Rico */\n SPANISH_PUERTO_RICO = 'es-PR',\n /** Spanish language as used in Paraguay */\n SPANISH_PARAGUAY = 'es-PY',\n /** Spanish language as used in El Salvador */\n SPANISH_EL_SALVADOR = 'es-SV',\n /** Spanish language as used in Uruguay */\n SPANISH_URUGUAY = 'es-UY',\n /** Spanish language as used in Venezuela */\n SPANISH_VENEZUELA = 'es-VE',\n /** Estonian language */\n ESTONIAN = 'et',\n /** Estonian language as used in Estonia */\n ESTONIAN_ESTONIA = 'et-EE',\n /** Basque language */\n BASQUE = 'eu',\n /** Basque language as used in Spain */\n BASQUE_SPAIN = 'eu-ES',\n /** Farsi language */\n FARSI = 'fa',\n /** Farsi language as used in Iran */\n FARSI_IRAN = 'fa-IR',\n /** Finnish language */\n FINNISH = 'fi',\n /** Finnish language as used in Finland */\n FINNISH_FINLAND = 'fi-FI',\n /** Faroese language */\n FAROESE = 'fo',\n /** Faroese language as used in Faroe Islands */\n FAROESE_FAROE_ISLANDS = 'fo-FO',\n /** French language */\n FRENCH = 'fr',\n /** French language as used in Belgium */\n FRENCH_BELGIUM = 'fr-BE',\n /** French language as used in Canada */\n FRENCH_CANADA = 'fr-CA',\n /** French language as used in Switzerland */\n FRENCH_SWITZERLAND = 'fr-CH',\n /** French language as used in France */\n FRENCH_FRANCE = 'fr-FR',\n /** French language as used in Luxembourg */\n FRENCH_LUXEMBOURG = 'fr-LU',\n /** French language as used in the Principality of Monaco */\n FRENCH_PRINCIPALITY_OF_MONACO = 'fr-MC',\n /** Galician language */\n GALICIAN = 'gl',\n /** Galician language as used in Spain */\n GALICIAN_SPAIN = 'gl-ES',\n /** Gujarati language */\n GUJARATI = 'gu',\n /** Gujarati language as used in India */\n GUJARATI_INDIA = 'gu-IN',\n /** Hebrew language */\n HEBREW = 'he',\n /** Hebrew language as used in Israel */\n HEBREW_ISRAEL = 'he-IL',\n /** Hindi language */\n HINDI = 'hi',\n /** Hindi language as used in India */\n HINDI_INDIA = 'hi-IN',\n /** Croatian language */\n CROATIAN = 'hr',\n /** Croatian language as used in Bosnia and Herzegovina */\n CROATIAN_BOSNIA_AND_HERZEGOVINA = 'hr-BA',\n /** Croatian language as used in Croatia */\n CROATIAN_CROATIA = 'hr-HR',\n /** Hungarian language */\n HUNGARIAN = 'hu',\n /** Hungarian language as used in Hungary */\n HUNGARIAN_HUNGARY = 'hu-HU',\n /** Armenian language */\n ARMENIAN = 'hy',\n /** Armenian language as used in Armenia */\n ARMENIAN_ARMENIA = 'hy-AM',\n /** Indonesian language */\n INDONESIAN = 'id',\n /** Indonesian language as used in Indonesia */\n INDONESIAN_INDONESIA = 'id-ID',\n /** Icelandic language */\n ICELANDIC = 'is',\n /** Icelandic language as used in Iceland */\n ICELANDIC_ICELAND = 'is-IS',\n /** Italian language */\n ITALIAN = 'it',\n /** Italian language as used in Switzerland */\n ITALIAN_SWITZERLAND = 'it-CH',\n /** Italian language as used in Italy */\n ITALIAN_ITALY = 'it-IT',\n /** Japanese language */\n JAPANESE = 'ja',\n /** Japanese language as used in Japan */\n JAPANESE_JAPAN = 'ja-JP',\n /** Georgian language */\n GEORGIAN = 'ka',\n /** Georgian language as used in Georgia */\n GEORGIAN_GEORGIA = 'ka-GE',\n /** Kazakh language */\n KAZAKH = 'kk',\n /** Kazakh language as used in Kazakhstan */\n KAZAKH_KAZAKHSTAN = 'kk-KZ',\n /** Kannada language */\n KANNADA = 'kn',\n /** Kannada language as used in India */\n KANNADA_INDIA = 'kn-IN',\n /** Korean language */\n KOREAN = 'ko',\n /** Korean language as used in Korea */\n KOREAN_KOREA = 'ko-KR',\n /** Konkani language */\n KONKANI = 'kok',\n /** Konkani language as used in India */\n KONKANI_INDIA = 'kok-IN',\n /** Kyrgyz language */\n KYRGYZ = 'ky',\n /** Kyrgyz language as used in Kyrgyzstan */\n KYRGYZ_KYRGYZSTAN = 'ky-KG',\n /** Lithuanian language */\n LITHUANIAN = 'lt',\n /** Lithuanian language as used in Lithuania */\n LITHUANIAN_LITHUANIA = 'lt-LT',\n /** Latvian language */\n LATVIAN = 'lv',\n /** Latvian language as used in Latvia */\n LATVIAN_LATVIA = 'lv-LV',\n /** Maori language */\n MAORI = 'mi',\n /** Maori language as used in New Zealand */\n MAORI_NEW_ZEALAND = 'mi-NZ',\n /** Macedonian language (Former Yugoslav Republic of Macedonia) */\n FYRO_MACEDONIAN = 'mk',\n /** Macedonian language as used in Macedonia */\n FYRO_MACEDONIAN_MACEDONIA = 'mk-MK',\n /** Mongolian language */\n MONGOLIAN = 'mn',\n /** Mongolian language as used in Mongolia */\n MONGOLIAN_MONGOLIA = 'mn-MN',\n /** Marathi language */\n MARATHI = 'mr',\n /** Marathi language as used in India */\n MARATHI_INDIA = 'mr-IN',\n /** Malay language */\n MALAY = 'ms',\n /** Malay language as used in Brunei Darussalam */\n MALAY_BRUNEI_DARUSSALAM = 'ms-BN',\n /** Malay language as used in Malaysia */\n MALAY_MALAYSIA = 'ms-MY',\n /** Maltese language */\n MALTESE = 'mt',\n /** Maltese language as used in Malta */\n MALTESE_MALTA = 'mt-MT',\n /** Norwegian (Bokmål) language */\n NORWEGIAN_BOKMAL = 'nb',\n /** Norwegian (Bokmål) language as used in Norway */\n NORWEGIAN_BOKMAL_NORWAY = 'nb-NO',\n /** Dutch language */\n DUTCH = 'nl',\n /** Dutch language as used in Belgium */\n DUTCH_BELGIUM = 'nl-BE',\n /** Dutch language as used in the Netherlands */\n DUTCH_NETHERLANDS = 'nl-NL',\n /** Norwegian (Nynorsk) language as used in Norway */\n NORWEGIAN_NYNORSK_NORWAY = 'nn-NO',\n /** Northern Sotho language */\n NORTHERN_SOTHO = 'ns',\n /** Northern Sotho language as used in South Africa */\n NORTHERN_SOTHO_SOUTH_AFRICA = 'ns-ZA',\n /** Punjabi language */\n PUNJABI = 'pa',\n /** Punjabi language as used in India */\n PUNJABI_INDIA = 'pa-IN',\n /** Polish language */\n POLISH = 'pl',\n /** Polish language as used in Poland */\n POLISH_POLAND = 'pl-PL',\n /** Pashto language */\n PASHTO = 'ps',\n /** Pashto language as used in Afghanistan */\n PASHTO_AFGHANISTAN = 'ps-AR',\n /** Portuguese language */\n PORTUGUESE = 'pt',\n /** Portuguese language as used in Brazil */\n PORTUGUESE_BRAZIL = 'pt-BR',\n /** Portuguese language as used in Portugal */\n PORTUGUESE_PORTUGAL = 'pt-PT',\n /** Quechua language */\n QUECHUA = 'qu',\n /** Quechua language as used in Bolivia */\n QUECHUA_BOLIVIA = 'qu-BO',\n /** Quechua language as used in Ecuador */\n QUECHUA_ECUADOR = 'qu-EC',\n /** Quechua language as used in Peru */\n QUECHUA_PERU = 'qu-PE',\n /** Romanian language */\n ROMANIAN = 'ro',\n /** Romanian language as used in Romania */\n ROMANIAN_ROMANIA = 'ro-RO',\n /** Russian language */\n RUSSIAN = 'ru',\n /** Russian language as used in Russia */\n RUSSIAN_RUSSIA = 'ru-RU',\n /** Sanskrit language */\n SANSKRIT = 'sa',\n /** Sanskrit language as used in India */\n SANSKRIT_INDIA = 'sa-IN',\n /** Northern Sami language */\n SAMI_NORTHERN = 'se',\n /** Northern Sami language as used in Finland */\n SAMI_NORTHERN_FINLAND = 'se-FI',\n /** Northern Sami language as used in Norway */\n SAMI_NORTHERN_NORWAY = 'se-NO',\n /** Northern Sami language as used in Sweden */\n SAMI_NORTHERN_SWEDEN = 'se-SE',\n /** Slovak language */\n SLOVAK = 'sk',\n /** Slovak language as used in Slovakia */\n SLOVAK_SLOVAKIA = 'sk-SK',\n /** Slovenian language */\n SLOVENIAN = 'sl',\n /** Slovenian language as used in Slovenia */\n SLOVENIAN_SLOVENIA = 'sl-SI',\n /** Albanian language */\n ALBANIAN = 'sq',\n /** Albanian language as used in Albania */\n ALBANIAN_ALBANIA = 'sq-AL',\n /** Servian language (Latin script) */\n SERBIAN_LATIN = 'sr',\n /** Serbian language (Latin script) as used in Bosnia and Herzegovina */\n SERBIAN_LATIN_BOSNIA_AND_HERZEGOVINA = 'sr-BA',\n /** Serbian language (Latin script) as used in Serbia and Montenegro */\n SERBIAN_LATIN_SERBIA_AND_MONTENEGRO = 'sr-SP',\n /** Swedish language */\n SWEDISH = 'sv',\n /** Swedish language as used in Finland */\n SWEDISH_FINLAND = 'sv-FI',\n /** Swedish language as used in Sweden */\n SWEDISH_SWEDEN = 'sv-SE',\n /** Swahili language */\n SWAHILI = 'sw',\n /** Swahili language as used in Kenya */\n SWAHILI_KENYA = 'sw-KE',\n /** Syriac language */\n SYRIAC = 'syr',\n /** Syriac language as used in Syria */\n SYRIAC_SYRIA = 'syr-SY',\n /** Tamil language */\n TAMIL = 'ta',\n /** Tamil language as used in India */\n TAMIL_INDIA = 'ta-IN',\n /** Telugu language */\n TELUGU = 'te',\n /** Telugu language as used in India */\n TELUGU_INDIA = 'te-IN',\n /** Thai language */\n THAI = 'th',\n /** Thai language as used in Thailand */\n THAI_THAILAND = 'th-TH',\n /** Tagalog language */\n TAGALOG = 'tl',\n /** Tagalog language as used in Philippines */\n TAGALOG_PHILIPPINES = 'tl-PH',\n /** Tswana language */\n TSWANA = 'tn',\n /** Tswana language as used in South Africa */\n TSWANA_SOUTH_AFRICA = 'tn-ZA',\n /** Turkish language */\n TURKISH = 'tr',\n /** Turkish language as used in Turkey */\n TURKISH_TURKEY = 'tr-TR',\n /** Tatar language */\n TATAR = 'tt',\n /** Tatar language as used in Russia */\n TATAR_RUSSIA = 'tt-RU',\n /** Tsonga language */\n TSOGA = 'ts',\n /** Ukrainian language */\n UKRAINIAN = 'uk',\n /** Ukrainian language as used in Ukraine */\n UKRAINIAN_UKRAINE = 'uk-UA',\n /** Urdu language */\n URDU = 'ur',\n /** Urdu language as used in Islamic Republic of Pakistan */\n URDU_ISLAMIC_REPUBLIC_OF_PAKISTAN = 'ur-PK',\n /** Uzbek language (Latin script) */\n UZBEK_LATIN = 'uz',\n /** Uzbek language (Latin script) as used in Uzbekistan */\n UZBEK_LATIN_UZBEKISTAN = 'uz-UZ',\n /** Vietnamese language */\n VIETNAMESE = 'vi',\n /** Vietnamese language as used in Viet Nam */\n VIETNAMESE_VIET_NAM = 'vi-VN',\n /** Xhosa language */\n XHOSA = 'xh',\n /** Xhosa language as used in South Africa */\n XHOSA_SOUTH_AFRICA = 'xh-ZA',\n /** Chinese language */\n CHINESE = 'zh',\n /** Chinese language (Simplified script) */\n CHINESE_SIMPLIFIED = 'zh-CN',\n /** Chinese language as used in Hong Kong */\n CHINESE_HONG_KONG = 'zh-HK',\n /** Chinese language as used in Macau */\n CHINESE_MACAU = 'zh-MO',\n /** Chinese language as used in Singapore */\n CHINESE_SINGAPORE = 'zh-SG',\n /** Chinese language (Traditional script) */\n CHINESE_TRADITIONAL = 'zh-TW',\n /** Zulu language */\n ZULU = 'zu',\n /** Zulu language as used in South Africa */\n ZULU_SOUTH_AFRICA = 'zu-ZA',\n}\n\n/** Utility type to extract the values from an enum */\ntype ValueOf<T> = T[keyof T];\n\n/** Define MyType using the ValueOf utility type on Locales */\nexport type LocalesValues = ValueOf<typeof Locales>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAK,UAAL,kBAAKA,aAAL;AAEL,EAAAA,SAAA,eAAY;AAEZ,EAAAA,SAAA,4BAAyB;AAEzB,EAAAA,SAAA,YAAS;AAET,EAAAA,SAAA,iCAA8B;AAE9B,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,kBA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../../src/types/locales.ts"],"sourcesContent":["/** Can be imported from a shared config */\nexport enum Locales {\n /** Afrikaans language */\n AFRIKAANS = 'af',\n /** Afrikaans language as used in South Africa */\n AFRIKAANS_SOUTH_AFRICA = 'af-ZA',\n /** Arabic language */\n ARABIC = 'ar',\n /** Arabic language as used in the United Arab Emirates */\n ARABIC_UNITED_ARAB_EMIRATES = 'ar-AE',\n /** Arabic language as used in Bahrain */\n ARABIC_BAHRAIN = 'ar-BH',\n /** Arabic language as used in Algeria */\n ARABIC_ALGERIA = 'ar-DZ',\n /** Arabic language as used in Egypt */\n ARABIC_EGYPT = 'ar-EG',\n /** Arabic language as used in Iraq */\n ARABIC_IRAQ = 'ar-IQ',\n /** Arabic language as used in Jordan */\n ARABIC_JORDAN = 'ar-JO',\n /** Arabic language as used in Kuwait */\n ARABIC_KUWAIT = 'ar-KW',\n /** Arabic language as used in Lebanon */\n ARABIC_LEBANON = 'ar-LB',\n /** Arabic language as used in Libya */\n ARABIC_LIBYA = 'ar-LY',\n /** Arabic language as used in Morocco */\n ARABIC_MOROCCO = 'ar-MA',\n /** Arabic language as used in Oman */\n ARABIC_OMAN = 'ar-OM',\n /** Arabic language as used in Qatar */\n ARABIC_QATAR = 'ar-QA',\n /** Arabic language as used in Saudi Arabia */\n ARABIC_SAUDI_ARABIA = 'ar-SA',\n /** Arabic language as used in Syria */\n ARABIC_SYRIA = 'ar-SY',\n /** Arabic language as used in Tunisia */\n ARABIC_TUNISIA = 'ar-TN',\n /** Arabic language as used in Yemen */\n ARABIC_YEMEN = 'ar-YE',\n /** Azeri language (Latin script) */\n AZERI_LATIN = 'az',\n /** Azeri language (Latin script) as used in Azerbaijan */\n AZERI_LATIN_AZERBAIJAN = 'az-AZ',\n /** Belarusian language */\n BELARUSIAN = 'be',\n /** Belarusian language as used in Belarus */\n BELARUSIAN_BELARUS = 'be-BY',\n /** Bulgarian language */\n BULGARIAN = 'bg',\n /** Bulgarian language as used in Bulgaria */\n BULGARIAN_BULGARIA = 'bg-BG',\n /** Bosnian */\n BOSNIAN = 'bs',\n /** Bosnian language as used in Bosnia and Herzegovina */\n BOSNIAN_BOSNIA_AND_HERZEGOVINA = 'bs-BA',\n /** Catalan language */\n CATALAN = 'ca',\n /** Catalan language as used in Spain */\n CATALAN_SPAIN = 'ca-ES',\n /** Czech language */\n CZECH = 'cs',\n /** Czech language as used in Czech Republic */\n CZECH_CZECH_REPUBLIC = 'cs-CZ',\n /** Welsh language */\n WELSH = 'cy',\n /** Welsh language as used in the United Kingdom */\n WELSH_UNITED_KINGDOM = 'cy-GB',\n /** Danish language */\n DANISH = 'da',\n /** Danish language as used in Denmark */\n DANISH_DENMARK = 'da-DK',\n /** German language */\n GERMAN = 'de',\n /** German language as used in Austria */\n GERMAN_AUSTRIA = 'de-AT',\n /** German language as used in Switzerland */\n GERMAN_SWITZERLAND = 'de-CH',\n /** German language as used in Germany */\n GERMAN_GERMANY = 'de-DE',\n /** German language as used in Liechtenstein */\n GERMAN_LIECHTENSTEIN = 'de-LI',\n /** German language as used in Luxembourg */\n GERMAN_LUXEMBOURG = 'de-LU',\n /** Divehi language */\n DIVEHI = 'dv',\n /** Divehi language as used in Maldives */\n DIVEHI_MALDIVES = 'dv-MV',\n /** Greek language */\n GREEK = 'el',\n /** Greek language as used in Greece */\n GREEK_GREECE = 'el-GR',\n /** English language */\n ENGLISH = 'en',\n /** English language as used in Australia */\n ENGLISH_AUSTRALIA = 'en-AU',\n /** English language as used in Belize */\n ENGLISH_BELIZE = 'en-BZ',\n /** English language as used in Canada */\n ENGLISH_CANADA = 'en-CA',\n /** English language as used in Caribbean */\n ENGLISH_CARIBBEAN = 'en-CB',\n /** English language as used in the United Kingdom */\n ENGLISH_UNITED_KINGDOM = 'en-GB',\n /** English language as used in Ireland */\n ENGLISH_IRELAND = 'en-IE',\n /** English language as used in Jamaica */\n ENGLISH_JAMAICA = 'en-JM',\n /** English language as used in New Zealand */\n ENGLISH_NEW_ZEALAND = 'en-NZ',\n /** English language as used in Philippines */\n ENGLISH_PHILIPPINES = 'en-PH',\n /** English language as used in Trinidad and Tobago */\n ENGLISH_TRINIDAD_AND_TOBAGO = 'en-TT',\n /** English language as used in the United States */\n ENGLISH_UNITED_STATES = 'en-US',\n /** English language as used in South Africa */\n ENGLISH_SOUTH_AFRICA = 'en-ZA',\n /** English language as used in Zimbabwe */\n ENGLISH_ZIMBABWE = 'en-ZW',\n /** Esperanto language */\n ESPERANTO = 'eo',\n /** Spanish language */\n SPANISH = 'es',\n /** Spanish language as used in Argentina */\n SPANISH_ARGENTINA = 'es-AR',\n /** Spanish language as used in Bolivia */\n SPANISH_BOLIVIA = 'es-BO',\n /** Spanish language as used in Chile */\n SPANISH_CHILE = 'es-CL',\n /** Spanish language as used in Colombia */\n SPANISH_COLOMBIA = 'es-CO',\n /** Spanish language as used in Costa Rica */\n SPANISH_COSTA_RICA = 'es-CR',\n /** Spanish language as used in Dominican Republic */\n SPANISH_DOMINICAN_REPUBLIC = 'es-DO',\n /** Spanish language as used in Ecuador */\n SPANISH_ECUADOR = 'es-EC',\n /** Spanish language as used in Spain */\n SPANISH_SPAIN = 'es-ES',\n /** Spanish language as used in Guatemala */\n SPANISH_GUATEMALA = 'es-GT',\n /** Spanish language as used in Honduras */\n SPANISH_HONDURAS = 'es-HN',\n /** Spanish language as used in Mexico */\n SPANISH_MEXICO = 'es-MX',\n /** Spanish language as used in Nicaragua */\n SPANISH_NICARAGUA = 'es-NI',\n /** Spanish language as used in Panama */\n SPANISH_PANAMA = 'es-PA',\n /** Spanish language as used in Peru */\n SPANISH_PERU = 'es-PE',\n /** Spanish language as used in Puerto Rico */\n SPANISH_PUERTO_RICO = 'es-PR',\n /** Spanish language as used in Paraguay */\n SPANISH_PARAGUAY = 'es-PY',\n /** Spanish language as used in El Salvador */\n SPANISH_EL_SALVADOR = 'es-SV',\n /** Spanish language as used in Uruguay */\n SPANISH_URUGUAY = 'es-UY',\n /** Spanish language as used in Venezuela */\n SPANISH_VENEZUELA = 'es-VE',\n /** Estonian language */\n ESTONIAN = 'et',\n /** Estonian language as used in Estonia */\n ESTONIAN_ESTONIA = 'et-EE',\n /** Basque language */\n BASQUE = 'eu',\n /** Basque language as used in Spain */\n BASQUE_SPAIN = 'eu-ES',\n /** Farsi language */\n FARSI = 'fa',\n /** Farsi language as used in Iran */\n FARSI_IRAN = 'fa-IR',\n /** Finnish language */\n FINNISH = 'fi',\n /** Finnish language as used in Finland */\n FINNISH_FINLAND = 'fi-FI',\n /** Faroese language */\n FAROESE = 'fo',\n /** Faroese language as used in Faroe Islands */\n FAROESE_FAROE_ISLANDS = 'fo-FO',\n /** French language */\n FRENCH = 'fr',\n /** French language as used in Belgium */\n FRENCH_BELGIUM = 'fr-BE',\n /** French language as used in Canada */\n FRENCH_CANADA = 'fr-CA',\n /** French language as used in Switzerland */\n FRENCH_SWITZERLAND = 'fr-CH',\n /** French language as used in France */\n FRENCH_FRANCE = 'fr-FR',\n /** French language as used in Luxembourg */\n FRENCH_LUXEMBOURG = 'fr-LU',\n /** French language as used in the Principality of Monaco */\n FRENCH_PRINCIPALITY_OF_MONACO = 'fr-MC',\n /** Galician language */\n GALICIAN = 'gl',\n /** Galician language as used in Spain */\n GALICIAN_SPAIN = 'gl-ES',\n /** Gujarati language */\n GUJARATI = 'gu',\n /** Gujarati language as used in India */\n GUJARATI_INDIA = 'gu-IN',\n /** Hebrew language */\n HEBREW = 'he',\n /** Hebrew language as used in Israel */\n HEBREW_ISRAEL = 'he-IL',\n /** Hindi language */\n HINDI = 'hi',\n /** Hindi language as used in India */\n HINDI_INDIA = 'hi-IN',\n /** Croatian language */\n CROATIAN = 'hr',\n /** Croatian language as used in Bosnia and Herzegovina */\n CROATIAN_BOSNIA_AND_HERZEGOVINA = 'hr-BA',\n /** Croatian language as used in Croatia */\n CROATIAN_CROATIA = 'hr-HR',\n /** Hungarian language */\n HUNGARIAN = 'hu',\n /** Hungarian language as used in Hungary */\n HUNGARIAN_HUNGARY = 'hu-HU',\n /** Armenian language */\n ARMENIAN = 'hy',\n /** Armenian language as used in Armenia */\n ARMENIAN_ARMENIA = 'hy-AM',\n /** Indonesian language */\n INDONESIAN = 'id',\n /** Indonesian language as used in Indonesia */\n INDONESIAN_INDONESIA = 'id-ID',\n /** Icelandic language */\n ICELANDIC = 'is',\n /** Icelandic language as used in Iceland */\n ICELANDIC_ICELAND = 'is-IS',\n /** Italian language */\n ITALIAN = 'it',\n /** Italian language as used in Switzerland */\n ITALIAN_SWITZERLAND = 'it-CH',\n /** Italian language as used in Italy */\n ITALIAN_ITALY = 'it-IT',\n /** Japanese language */\n JAPANESE = 'ja',\n /** Japanese language as used in Japan */\n JAPANESE_JAPAN = 'ja-JP',\n /** Georgian language */\n GEORGIAN = 'ka',\n /** Georgian language as used in Georgia */\n GEORGIAN_GEORGIA = 'ka-GE',\n /** Kazakh language */\n KAZAKH = 'kk',\n /** Kazakh language as used in Kazakhstan */\n KAZAKH_KAZAKHSTAN = 'kk-KZ',\n /** Kannada language */\n KANNADA = 'kn',\n /** Kannada language as used in India */\n KANNADA_INDIA = 'kn-IN',\n /** Korean language */\n KOREAN = 'ko',\n /** Korean language as used in Korea */\n KOREAN_KOREA = 'ko-KR',\n /** Konkani language */\n KONKANI = 'kok',\n /** Konkani language as used in India */\n KONKANI_INDIA = 'kok-IN',\n /** Kyrgyz language */\n KYRGYZ = 'ky',\n /** Kyrgyz language as used in Kyrgyzstan */\n KYRGYZ_KYRGYZSTAN = 'ky-KG',\n /** Lithuanian language */\n LITHUANIAN = 'lt',\n /** Lithuanian language as used in Lithuania */\n LITHUANIAN_LITHUANIA = 'lt-LT',\n /** Latvian language */\n LATVIAN = 'lv',\n /** Latvian language as used in Latvia */\n LATVIAN_LATVIA = 'lv-LV',\n /** Maori language */\n MAORI = 'mi',\n /** Maori language as used in New Zealand */\n MAORI_NEW_ZEALAND = 'mi-NZ',\n /** Macedonian language (Former Yugoslav Republic of Macedonia) */\n FYRO_MACEDONIAN = 'mk',\n /** Macedonian language as used in Macedonia */\n FYRO_MACEDONIAN_MACEDONIA = 'mk-MK',\n /** Mongolian language */\n MONGOLIAN = 'mn',\n /** Mongolian language as used in Mongolia */\n MONGOLIAN_MONGOLIA = 'mn-MN',\n /** Marathi language */\n MARATHI = 'mr',\n /** Marathi language as used in India */\n MARATHI_INDIA = 'mr-IN',\n /** Malay language */\n MALAY = 'ms',\n /** Malay language as used in Brunei Darussalam */\n MALAY_BRUNEI_DARUSSALAM = 'ms-BN',\n /** Malay language as used in Malaysia */\n MALAY_MALAYSIA = 'ms-MY',\n /** Maltese language */\n MALTESE = 'mt',\n /** Maltese language as used in Malta */\n MALTESE_MALTA = 'mt-MT',\n /** Norwegian (Bokmål) language */\n NORWEGIAN_BOKMAL = 'nb',\n /** Norwegian (Bokmål) language as used in Norway */\n NORWEGIAN_BOKMAL_NORWAY = 'nb-NO',\n /** Dutch language */\n DUTCH = 'nl',\n /** Dutch language as used in Belgium */\n DUTCH_BELGIUM = 'nl-BE',\n /** Dutch language as used in the Netherlands */\n DUTCH_NETHERLANDS = 'nl-NL',\n /** Norwegian (Nynorsk) language as used in Norway */\n NORWEGIAN_NYNORSK_NORWAY = 'nn-NO',\n /** Northern Sotho language */\n NORTHERN_SOTHO = 'ns',\n /** Northern Sotho language as used in South Africa */\n NORTHERN_SOTHO_SOUTH_AFRICA = 'ns-ZA',\n /** Punjabi language */\n PUNJABI = 'pa',\n /** Punjabi language as used in India */\n PUNJABI_INDIA = 'pa-IN',\n /** Polish language */\n POLISH = 'pl',\n /** Polish language as used in Poland */\n POLISH_POLAND = 'pl-PL',\n /** Pashto language */\n PASHTO = 'ps',\n /** Pashto language as used in Afghanistan */\n PASHTO_AFGHANISTAN = 'ps-AR',\n /** Portuguese language */\n PORTUGUESE = 'pt',\n /** Portuguese language as used in Brazil */\n PORTUGUESE_BRAZIL = 'pt-BR',\n /** Portuguese language as used in Portugal */\n PORTUGUESE_PORTUGAL = 'pt-PT',\n /** Quechua language */\n QUECHUA = 'qu',\n /** Quechua language as used in Bolivia */\n QUECHUA_BOLIVIA = 'qu-BO',\n /** Quechua language as used in Ecuador */\n QUECHUA_ECUADOR = 'qu-EC',\n /** Quechua language as used in Peru */\n QUECHUA_PERU = 'qu-PE',\n /** Romanian language */\n ROMANIAN = 'ro',\n /** Romanian language as used in Romania */\n ROMANIAN_ROMANIA = 'ro-RO',\n /** Russian language */\n RUSSIAN = 'ru',\n /** Russian language as used in Russia */\n RUSSIAN_RUSSIA = 'ru-RU',\n /** Sanskrit language */\n SANSKRIT = 'sa',\n /** Sanskrit language as used in India */\n SANSKRIT_INDIA = 'sa-IN',\n /** Northern Sami language */\n SAMI_NORTHERN = 'se',\n /** Northern Sami language as used in Finland */\n SAMI_NORTHERN_FINLAND = 'se-FI',\n /** Northern Sami language as used in Norway */\n SAMI_NORTHERN_NORWAY = 'se-NO',\n /** Northern Sami language as used in Sweden */\n SAMI_NORTHERN_SWEDEN = 'se-SE',\n /** Slovak language */\n SLOVAK = 'sk',\n /** Slovak language as used in Slovakia */\n SLOVAK_SLOVAKIA = 'sk-SK',\n /** Slovenian language */\n SLOVENIAN = 'sl',\n /** Slovenian language as used in Slovenia */\n SLOVENIAN_SLOVENIA = 'sl-SI',\n /** Albanian language */\n ALBANIAN = 'sq',\n /** Albanian language as used in Albania */\n ALBANIAN_ALBANIA = 'sq-AL',\n /** Servian language (Latin script) */\n SERBIAN_LATIN = 'sr',\n /** Serbian language (Latin script) as used in Bosnia and Herzegovina */\n SERBIAN_LATIN_BOSNIA_AND_HERZEGOVINA = 'sr-BA',\n /** Serbian language (Latin script) as used in Serbia and Montenegro */\n SERBIAN_LATIN_SERBIA_AND_MONTENEGRO = 'sr-SP',\n /** Swedish language */\n SWEDISH = 'sv',\n /** Swedish language as used in Finland */\n SWEDISH_FINLAND = 'sv-FI',\n /** Swedish language as used in Sweden */\n SWEDISH_SWEDEN = 'sv-SE',\n /** Swahili language */\n SWAHILI = 'sw',\n /** Swahili language as used in Kenya */\n SWAHILI_KENYA = 'sw-KE',\n /** Syriac language */\n SYRIAC = 'syr',\n /** Syriac language as used in Syria */\n SYRIAC_SYRIA = 'syr-SY',\n /** Tamil language */\n TAMIL = 'ta',\n /** Tamil language as used in India */\n TAMIL_INDIA = 'ta-IN',\n /** Telugu language */\n TELUGU = 'te',\n /** Telugu language as used in India */\n TELUGU_INDIA = 'te-IN',\n /** Thai language */\n THAI = 'th',\n /** Thai language as used in Thailand */\n THAI_THAILAND = 'th-TH',\n /** Tagalog language */\n TAGALOG = 'tl',\n /** Tagalog language as used in Philippines */\n TAGALOG_PHILIPPINES = 'tl-PH',\n /** Tswana language */\n TSWANA = 'tn',\n /** Tswana language as used in South Africa */\n TSWANA_SOUTH_AFRICA = 'tn-ZA',\n /** Turkish language */\n TURKISH = 'tr',\n /** Turkish language as used in Turkey */\n TURKISH_TURKEY = 'tr-TR',\n /** Tatar language */\n TATAR = 'tt',\n /** Tatar language as used in Russia */\n TATAR_RUSSIA = 'tt-RU',\n /** Tsonga language */\n TSOGA = 'ts',\n /** Ukrainian language */\n UKRAINIAN = 'uk',\n /** Ukrainian language as used in Ukraine */\n UKRAINIAN_UKRAINE = 'uk-UA',\n /** Urdu language */\n URDU = 'ur',\n /** Urdu language as used in Islamic Republic of Pakistan */\n URDU_ISLAMIC_REPUBLIC_OF_PAKISTAN = 'ur-PK',\n /** Uzbek language (Latin script) */\n UZBEK_LATIN = 'uz',\n /** Uzbek language (Latin script) as used in Uzbekistan */\n UZBEK_LATIN_UZBEKISTAN = 'uz-UZ',\n /** Vietnamese language */\n VIETNAMESE = 'vi',\n /** Vietnamese language as used in Viet Nam */\n VIETNAMESE_VIET_NAM = 'vi-VN',\n /** Xhosa language */\n XHOSA = 'xh',\n /** Xhosa language as used in South Africa */\n XHOSA_SOUTH_AFRICA = 'xh-ZA',\n /** Chinese language */\n CHINESE = 'zh',\n /** Chinese language (Simplified) */\n CHINESE_SIMPLIFIED = 'zh-Hans',\n /** Chinese language (Simplified, People's Republic of China) */\n CHINESE_SIMPLIFIED_CHINA = 'zh-CN',\n /** Chinese language as used in Hong Kong */\n CHINESE_HONG_KONG = 'zh-HK',\n /** Chinese language as used in Macau */\n CHINESE_MACAU = 'zh-MO',\n /** Chinese language as used in Singapore */\n CHINESE_SINGAPORE = 'zh-SG',\n /** Chinese language (Traditional script) */\n CHINESE_TRADITIONAL = 'zh-Hant',\n /** Zulu language */\n ZULU = 'zu',\n /** Zulu language as used in South Africa */\n ZULU_SOUTH_AFRICA = 'zu-ZA',\n}\n\n/** Utility type to extract the values from an enum */\ntype ValueOf<T> = T[keyof T];\n\n/** Define MyType using the ValueOf utility type on Locales */\nexport type LocalesValues = ValueOf<typeof Locales>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAK,UAAL,kBAAKA,aAAL;AAEL,EAAAA,SAAA,eAAY;AAEZ,EAAAA,SAAA,4BAAyB;AAEzB,EAAAA,SAAA,YAAS;AAET,EAAAA,SAAA,iCAA8B;AAE9B,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,iBAAc;AAEd,EAAAA,SAAA,mBAAgB;AAEhB,EAAAA,SAAA,mBAAgB;AAEhB,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,iBAAc;AAEd,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,yBAAsB;AAEtB,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,iBAAc;AAEd,EAAAA,SAAA,4BAAyB;AAEzB,EAAAA,SAAA,gBAAa;AAEb,EAAAA,SAAA,wBAAqB;AAErB,EAAAA,SAAA,eAAY;AAEZ,EAAAA,SAAA,wBAAqB;AAErB,EAAAA,SAAA,aAAU;AAEV,EAAAA,SAAA,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B;AAEtB,EAAAA,SAAA,aAAU;AAEV,EAAAA,SAAA,oBAAiB;AAEjB,EAAAA,SAAA,WAAQ;AAER,EAAAA,SAAA,kBAAe;AAEf,EAAAA,SAAA,WAAQ;AAER,EAAAA,SAAA,eAAY;AAEZ,EAAAA,SAAA,uBAAoB;AAEpB,EAAAA,SAAA,UAAO;AAEP,EAAAA,SAAA,uCAAoC;AAEpC,EAAAA,SAAA,iBAAc;AAEd,EAAAA,SAAA,4BAAyB;AAEzB,EAAAA,SAAA,gBAAa;AAEb,EAAAA,SAAA,yBAAsB;AAEtB,EAAAA,SAAA,WAAQ;AAER,EAAAA,SAAA,wBAAqB;AAErB,EAAAA,SAAA,aAAU;AAEV,EAAAA,SAAA,wBAAqB;AAErB,EAAAA,SAAA,8BAA2B;AAE3B,EAAAA,SAAA,uBAAoB;AAEpB,EAAAA,SAAA,mBAAgB;AAEhB,EAAAA,SAAA,uBAAoB;AAEpB,EAAAA,SAAA,yBAAsB;AAEtB,EAAAA,SAAA,UAAO;AAEP,EAAAA,SAAA,uBAAoB;AA9cV,SAAAA;AAAA,GAAA;","names":["Locales"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var ESMxCJSRequire_exports = {};
20
+ __export(ESMxCJSRequire_exports, {
21
+ ESMxCJSRequire: () => ESMxCJSRequire
22
+ });
23
+ module.exports = __toCommonJS(ESMxCJSRequire_exports);
24
+ var import_module = require("module");
25
+ const import_meta = {};
26
+ const isESModule = typeof import_meta.url === "string";
27
+ const ESMxCJSRequire = isESModule ? (0, import_module.createRequire)(import_meta.url) : require;
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ ESMxCJSRequire
31
+ });
32
+ //# sourceMappingURL=ESMxCJSRequire.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/ESMxCJSRequire.ts"],"sourcesContent":["import { createRequire } from 'module';\n\nconst isESModule = typeof import.meta.url === 'string';\nexport const ESMxCJSRequire = isESModule\n ? createRequire(import.meta.url)\n : require;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8B;AAA9B;AAEA,MAAM,aAAa,OAAO,YAAY,QAAQ;AACvC,MAAM,iBAAiB,iBAC1B,6BAAc,YAAY,GAAG,IAC7B;","names":[]}
@@ -1,5 +1,9 @@
1
1
  import { join } from "path";
2
- import { IS_ENABLED } from '../defaultValues/editor.mjs';
2
+ import {
3
+ BACKEND_URL,
4
+ DICTIONARY_PRIORITY_STRATEGY,
5
+ IS_ENABLED
6
+ } from '../defaultValues/editor.mjs';
3
7
  import {
4
8
  DEFAULT_LOCALE,
5
9
  LOCALES,
@@ -64,9 +68,16 @@ const buildMiddlewareFields = (customConfiguration) => ({
64
68
  */
65
69
  cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,
66
70
  /**
67
- * Prefix the default locale in the URL
71
+ * Prefix default prefix the default locale to the path as other locales.
72
+ *
73
+ * Example with prefixDefault = true and defaultLocale = 'en':
74
+ * path = /en/dashboard or /fr/dashboard
75
+ *
76
+ * Example with prefixDefault = false and defaultLocale = 'en':
77
+ * path = /dashboard or /fr/dashboard
68
78
  *
69
- * Default: true
79
+ *
80
+ * Default: false
70
81
  */
71
82
  prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,
72
83
  /**
@@ -407,9 +418,9 @@ const buildEditorFields = (customConfiguration) => ({
407
418
  /**
408
419
  * Port of the editor server
409
420
  *
410
- * Default: 4000
421
+ * Default: 'https://back.intlayer.org'
411
422
  */
412
- port: customConfiguration?.port ?? 4e3,
423
+ backendURL: customConfiguration?.backendURL ?? BACKEND_URL,
413
424
  /**
414
425
  * Indicates if the editor is active
415
426
  *
@@ -428,7 +439,38 @@ const buildEditorFields = (customConfiguration) => ({
428
439
  * };
429
440
  * ```
430
441
  */
431
- enabled: customConfiguration?.enabled ?? IS_ENABLED
442
+ enabled: customConfiguration?.enabled ?? IS_ENABLED,
443
+ /**
444
+ * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
445
+ * An access token is use to authenticate the user related to the project.
446
+ * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.
447
+ *
448
+ * Default: undefined
449
+ *
450
+ * > 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.
451
+ */
452
+ clientId: customConfiguration?.clientId ?? void 0,
453
+ /**
454
+ * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
455
+ * An access token is use to authenticate the user related to the project.
456
+ * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.
457
+ *
458
+ * Default: undefined
459
+ *
460
+ * > 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.
461
+ */
462
+ clientSecret: customConfiguration?.clientSecret ?? void 0,
463
+ /**
464
+ * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.
465
+ * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.
466
+ *
467
+ * Default: 'locale_first'
468
+ *
469
+ * The strategy for prioritizing dictionaries. It can be either 'locale_first' or 'distant_first'.
470
+ * - 'locale_first': The first dictionary found in the locale is used.
471
+ * - 'distant_first': The first dictionary found in the distant locales is used.
472
+ */
473
+ dictionaryPriorityStrategy: customConfiguration?.dictionaryPriorityStrategy ?? DICTIONARY_PRIORITY_STRATEGY
432
474
  });
433
475
  const buildConfigurationFields = (options, customConfiguration) => {
434
476
  const internationalizationConfig = buildInternationalizationFields(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport { IS_ENABLED } from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n STRICT_MODE,\n} 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 EditorConfig,\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 * Ensure strong implementations of internationalized content using typescript.\n * - 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.\n * - If set to \"required_only\", 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.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"required_only\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\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\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * Port of the editor server\n *\n * Default: 4000\n */\n port: customConfiguration?.port ?? 4000,\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\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 const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,qBAAqB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzC,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,i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ACjC,qBAAqB;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB,mBAAmB,qBAAqB,OAAO;AAErE,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n BACKEND_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n IS_ENABLED,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n STRICT_MODE,\n} 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 EditorConfig,\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 * Ensure strong implementations of internationalized content using typescript.\n * - 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.\n * - If set to \"required_only\", 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.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"required_only\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\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 default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\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\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * Port of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > 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.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > 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.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'locale_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'locale_first' or 'distant_first'.\n * - 'locale_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\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 const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"AAAA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,qBAAqB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzC,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,iBAAiB;AACvD;AAEA,MAAM,wBAAwB,CAC5B,yBACsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYnD,4BACE,qBAAqB,8BACrB;AACJ;AAKO,MAAM,2BAA2B,CACtC,SACA,wBACmB;AACnB,QAAM,6BAA6B;AAAA,IACjC,qBAAqB;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB,mBAAmB,qBAAqB,OAAO;AAErE,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
@@ -39,7 +39,9 @@ const logConfigFileResult = (numCustomConfiguration, configurationFilePath) => {
39
39
  } else {
40
40
  const relativeOutputPath = relative(BASE_DIR_PATH, configurationFilePath);
41
41
  if (numCustomConfiguration === 1) {
42
- console.info(`Configuration file found: ${relativeOutputPath}.`);
42
+ console.info(
43
+ `[intlayer] Configuration file found: ${relativeOutputPath}.`
44
+ );
43
45
  } else {
44
46
  console.warn(
45
47
  `Multiple configuration files found, using ${relativeOutputPath}.`