@intlayer/config 6.1.6 → 7.0.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/cjs/_virtual/rolldown_runtime.cjs +34 -0
  2. package/dist/cjs/alias.cjs +27 -100
  3. package/dist/cjs/alias.cjs.map +1 -1
  4. package/dist/cjs/built.cjs +7 -25
  5. package/dist/cjs/built.cjs.map +1 -1
  6. package/dist/cjs/bundleJSFile.cjs +30 -51
  7. package/dist/cjs/bundleJSFile.cjs.map +1 -1
  8. package/dist/cjs/client.cjs +19 -52
  9. package/dist/cjs/configFile/buildConfigurationFields.cjs +100 -657
  10. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  11. package/dist/cjs/configFile/getConfiguration.cjs +60 -114
  12. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  13. package/dist/cjs/configFile/index.cjs +8 -25
  14. package/dist/cjs/configFile/loadConfigurationFile.cjs +22 -47
  15. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  16. package/dist/cjs/configFile/searchConfigurationFile.cjs +49 -55
  17. package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
  18. package/dist/cjs/defaultValues/build.cjs +23 -35
  19. package/dist/cjs/defaultValues/build.cjs.map +1 -1
  20. package/dist/cjs/defaultValues/content.cjs +68 -70
  21. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  22. package/dist/cjs/defaultValues/editor.cjs +29 -41
  23. package/dist/cjs/defaultValues/editor.cjs.map +1 -1
  24. package/dist/cjs/defaultValues/index.cjs +62 -0
  25. package/dist/cjs/defaultValues/index.cjs.map +1 -0
  26. package/dist/cjs/defaultValues/internationalization.cjs +23 -34
  27. package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
  28. package/dist/cjs/defaultValues/log.cjs +17 -29
  29. package/dist/cjs/defaultValues/log.cjs.map +1 -1
  30. package/dist/cjs/defaultValues/routing.cjs +38 -0
  31. package/dist/cjs/defaultValues/routing.cjs.map +1 -0
  32. package/dist/cjs/extractErrorMessage.cjs +95 -0
  33. package/dist/cjs/extractErrorMessage.cjs.map +1 -0
  34. package/dist/cjs/index.cjs +67 -98
  35. package/dist/cjs/loadEnvFile.cjs +30 -51
  36. package/dist/cjs/loadEnvFile.cjs.map +1 -1
  37. package/dist/cjs/loadExternalFile/bundleFile.cjs +74 -0
  38. package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -0
  39. package/dist/cjs/loadExternalFile/loadExternalFile.cjs +86 -0
  40. package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -0
  41. package/dist/cjs/loadExternalFile/parseFileContent.cjs +67 -0
  42. package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -0
  43. package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs +60 -0
  44. package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs.map +1 -0
  45. package/dist/cjs/logger.cjs +124 -152
  46. package/dist/cjs/logger.cjs.map +1 -1
  47. package/dist/cjs/package.cjs +12 -0
  48. package/dist/cjs/package.cjs.map +1 -0
  49. package/dist/cjs/retryManager.cjs +42 -49
  50. package/dist/cjs/retryManager.cjs.map +1 -1
  51. package/dist/cjs/utils/ESMxCJSHelpers.cjs +24 -33
  52. package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
  53. package/dist/cjs/utils/cache.cjs +426 -0
  54. package/dist/cjs/utils/cache.cjs.map +1 -0
  55. package/dist/cjs/utils/clearModuleCache.cjs +23 -46
  56. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
  57. package/dist/cjs/utils/extractErrorMessage.cjs +95 -0
  58. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -0
  59. package/dist/cjs/utils/getExtension.cjs +12 -35
  60. package/dist/cjs/utils/getExtension.cjs.map +1 -1
  61. package/dist/cjs/utils/getPackageJsonPath.cjs +37 -0
  62. package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -0
  63. package/dist/cjs/utils/logStack.cjs +16 -0
  64. package/dist/cjs/utils/logStack.cjs.map +1 -0
  65. package/dist/cjs/utils/normalizePath.cjs +15 -27
  66. package/dist/cjs/utils/normalizePath.cjs.map +1 -1
  67. package/dist/esm/_virtual/rolldown_runtime.mjs +17 -0
  68. package/dist/esm/alias.mjs +23 -74
  69. package/dist/esm/alias.mjs.map +1 -1
  70. package/dist/esm/built.mjs +5 -3
  71. package/dist/esm/built.mjs.map +1 -1
  72. package/dist/esm/bundleJSFile.mjs +26 -25
  73. package/dist/esm/bundleJSFile.mjs.map +1 -1
  74. package/dist/esm/client.mjs +4 -31
  75. package/dist/esm/configFile/buildConfigurationFields.mjs +97 -674
  76. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  77. package/dist/esm/configFile/getConfiguration.mjs +52 -75
  78. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  79. package/dist/esm/configFile/index.mjs +5 -3
  80. package/dist/esm/configFile/loadConfigurationFile.mjs +22 -23
  81. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  82. package/dist/esm/configFile/searchConfigurationFile.mjs +45 -30
  83. package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
  84. package/dist/esm/defaultValues/build.mjs +16 -11
  85. package/dist/esm/defaultValues/build.mjs.map +1 -1
  86. package/dist/esm/defaultValues/content.mjs +48 -34
  87. package/dist/esm/defaultValues/content.mjs.map +1 -1
  88. package/dist/esm/defaultValues/editor.mjs +17 -11
  89. package/dist/esm/defaultValues/editor.mjs.map +1 -1
  90. package/dist/esm/defaultValues/index.mjs +21 -0
  91. package/dist/esm/defaultValues/index.mjs.map +1 -0
  92. package/dist/esm/defaultValues/internationalization.mjs +13 -7
  93. package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
  94. package/dist/esm/defaultValues/log.mjs +10 -4
  95. package/dist/esm/defaultValues/log.mjs.map +1 -1
  96. package/dist/esm/defaultValues/routing.mjs +25 -0
  97. package/dist/esm/defaultValues/routing.mjs.map +1 -0
  98. package/dist/esm/extractErrorMessage.mjs +94 -0
  99. package/dist/esm/extractErrorMessage.mjs.map +1 -0
  100. package/dist/esm/index.mjs +18 -61
  101. package/dist/esm/loadEnvFile.mjs +27 -17
  102. package/dist/esm/loadEnvFile.mjs.map +1 -1
  103. package/dist/esm/loadExternalFile/bundleFile.mjs +68 -0
  104. package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -0
  105. package/dist/esm/loadExternalFile/loadExternalFile.mjs +81 -0
  106. package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -0
  107. package/dist/esm/loadExternalFile/parseFileContent.mjs +63 -0
  108. package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -0
  109. package/dist/esm/loadExternalFile/transpileTSToMJS.mjs +55 -0
  110. package/dist/esm/loadExternalFile/transpileTSToMJS.mjs.map +1 -0
  111. package/dist/esm/logger.mjs +110 -115
  112. package/dist/esm/logger.mjs.map +1 -1
  113. package/dist/esm/package.mjs +6 -0
  114. package/dist/esm/package.mjs.map +1 -0
  115. package/dist/esm/retryManager.mjs +40 -23
  116. package/dist/esm/retryManager.mjs.map +1 -1
  117. package/dist/esm/utils/ESMxCJSHelpers.mjs +20 -6
  118. package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
  119. package/dist/esm/utils/cache.mjs +414 -0
  120. package/dist/esm/utils/cache.mjs.map +1 -0
  121. package/dist/esm/utils/clearModuleCache.mjs +22 -21
  122. package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
  123. package/dist/esm/utils/extractErrorMessage.mjs +94 -0
  124. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -0
  125. package/dist/esm/utils/getExtension.mjs +11 -11
  126. package/dist/esm/utils/getExtension.mjs.map +1 -1
  127. package/dist/esm/utils/getPackageJsonPath.mjs +33 -0
  128. package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -0
  129. package/dist/esm/utils/logStack.mjs +16 -0
  130. package/dist/esm/utils/logStack.mjs.map +1 -0
  131. package/dist/esm/utils/normalizePath.mjs +14 -3
  132. package/dist/esm/utils/normalizePath.mjs.map +1 -1
  133. package/dist/types/alias.d.ts +20 -12
  134. package/dist/types/alias.d.ts.map +1 -1
  135. package/dist/types/built.d.ts +7 -6
  136. package/dist/types/built.d.ts.map +1 -1
  137. package/dist/types/bundleJSFile.d.ts +97 -93
  138. package/dist/types/bundleJSFile.d.ts.map +1 -1
  139. package/dist/types/client.d.ts +3 -5
  140. package/dist/types/configFile/buildConfigurationFields.d.ts +7 -2
  141. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  142. package/dist/types/configFile/getConfiguration.d.ts +19 -15
  143. package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
  144. package/dist/types/configFile/index.d.ts +4 -3
  145. package/dist/types/configFile/loadConfigurationFile.d.ts +8 -3
  146. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
  147. package/dist/types/configFile/searchConfigurationFile.d.ts +6 -4
  148. package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
  149. package/dist/types/defaultValues/build.d.ts +10 -4
  150. package/dist/types/defaultValues/build.d.ts.map +1 -1
  151. package/dist/types/defaultValues/content.d.ts +23 -16
  152. package/dist/types/defaultValues/content.d.ts.map +1 -1
  153. package/dist/types/defaultValues/editor.d.ts +14 -9
  154. package/dist/types/defaultValues/editor.d.ts.map +1 -1
  155. package/dist/types/defaultValues/index.d.ts +14 -0
  156. package/dist/types/defaultValues/index.d.ts.map +1 -0
  157. package/dist/types/defaultValues/internationalization.d.ts +12 -6
  158. package/dist/types/defaultValues/internationalization.d.ts.map +1 -1
  159. package/dist/types/defaultValues/log.d.ts +7 -2
  160. package/dist/types/defaultValues/log.d.ts.map +1 -1
  161. package/dist/types/defaultValues/routing.d.ts +14 -0
  162. package/dist/types/defaultValues/routing.d.ts.map +1 -0
  163. package/dist/types/extractErrorMessage.d.ts +5 -0
  164. package/dist/types/extractErrorMessage.d.ts.map +1 -0
  165. package/dist/types/index.d.ts +21 -17
  166. package/dist/types/loadEnvFile.d.ts +8 -5
  167. package/dist/types/loadEnvFile.d.ts.map +1 -1
  168. package/dist/types/loadExternalFile/bundleFile.d.ts +10 -0
  169. package/dist/types/loadExternalFile/bundleFile.d.ts.map +1 -0
  170. package/dist/types/loadExternalFile/loadExternalFile.d.ts +25 -0
  171. package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -0
  172. package/dist/types/loadExternalFile/parseFileContent.d.ts +29 -0
  173. package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -0
  174. package/dist/types/loadExternalFile/transpileTSToMJS.d.ts +9 -0
  175. package/dist/types/loadExternalFile/transpileTSToMJS.d.ts.map +1 -0
  176. package/dist/types/logger.d.ts +41 -37
  177. package/dist/types/logger.d.ts.map +1 -1
  178. package/dist/types/retryManager.d.ts +26 -8
  179. package/dist/types/retryManager.d.ts.map +1 -1
  180. package/dist/types/utils/ESMxCJSHelpers.d.ts +16 -2
  181. package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
  182. package/dist/types/utils/cache.d.ts +50 -0
  183. package/dist/types/utils/cache.d.ts.map +1 -0
  184. package/dist/types/utils/clearModuleCache.d.ts +4 -1
  185. package/dist/types/utils/clearModuleCache.d.ts.map +1 -1
  186. package/dist/types/utils/extractErrorMessage.d.ts +5 -0
  187. package/dist/types/utils/extractErrorMessage.d.ts.map +1 -0
  188. package/dist/types/utils/getExtension.d.ts +6 -2
  189. package/dist/types/utils/getExtension.d.ts.map +1 -1
  190. package/dist/types/utils/getPackageJsonPath.d.ts +10 -0
  191. package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -0
  192. package/dist/types/utils/logStack.d.ts +7 -0
  193. package/dist/types/utils/logStack.d.ts.map +1 -0
  194. package/dist/types/utils/normalizePath.d.ts +4 -1
  195. package/dist/types/utils/normalizePath.d.ts.map +1 -1
  196. package/package.json +40 -35
  197. package/LICENSE +0 -202
  198. package/dist/cjs/client.cjs.map +0 -1
  199. package/dist/cjs/configFile/index.cjs.map +0 -1
  200. package/dist/cjs/defaultValues/middleware.cjs +0 -47
  201. package/dist/cjs/defaultValues/middleware.cjs.map +0 -1
  202. package/dist/cjs/getSandboxContext.cjs +0 -64
  203. package/dist/cjs/getSandboxContext.cjs.map +0 -1
  204. package/dist/cjs/index.cjs.map +0 -1
  205. package/dist/cjs/loadExternalFile.cjs +0 -105
  206. package/dist/cjs/loadExternalFile.cjs.map +0 -1
  207. package/dist/cjs/types/config.cjs +0 -17
  208. package/dist/cjs/types/config.cjs.map +0 -1
  209. package/dist/cjs/types/locales.cjs +0 -310
  210. package/dist/cjs/types/locales.cjs.map +0 -1
  211. package/dist/esm/client.mjs.map +0 -1
  212. package/dist/esm/configFile/index.mjs.map +0 -1
  213. package/dist/esm/defaultValues/middleware.mjs +0 -17
  214. package/dist/esm/defaultValues/middleware.mjs.map +0 -1
  215. package/dist/esm/getSandboxContext.mjs +0 -40
  216. package/dist/esm/getSandboxContext.mjs.map +0 -1
  217. package/dist/esm/index.mjs.map +0 -1
  218. package/dist/esm/loadExternalFile.mjs +0 -81
  219. package/dist/esm/loadExternalFile.mjs.map +0 -1
  220. package/dist/esm/types/config.mjs +0 -1
  221. package/dist/esm/types/config.mjs.map +0 -1
  222. package/dist/esm/types/locales.mjs +0 -286
  223. package/dist/esm/types/locales.mjs.map +0 -1
  224. package/dist/types/client.d.ts.map +0 -1
  225. package/dist/types/configFile/index.d.ts.map +0 -1
  226. package/dist/types/defaultValues/middleware.d.ts +0 -8
  227. package/dist/types/defaultValues/middleware.d.ts.map +0 -1
  228. package/dist/types/getSandboxContext.d.ts +0 -4
  229. package/dist/types/getSandboxContext.d.ts.map +0 -1
  230. package/dist/types/index.d.ts.map +0 -1
  231. package/dist/types/loadExternalFile.d.ts +0 -8
  232. package/dist/types/loadExternalFile.d.ts.map +0 -1
  233. package/dist/types/types/config.d.ts +0 -659
  234. package/dist/types/types/config.d.ts.map +0 -1
  235. package/dist/types/types/locales.d.ts +0 -564
  236. package/dist/types/types/locales.d.ts.map +0 -1
@@ -0,0 +1,50 @@
1
+ import { IntlayerConfig } from "@intlayer/types";
2
+
3
+ //#region src/utils/cache.d.ts
4
+ /** Public stringify kept for convenience / debugging (now faster & broader). */
5
+ declare const stableStringify: (value: unknown, _stack?: WeakSet<object>) => string;
6
+ /** ------------------------- In-memory cache ------------------------- **/
7
+ type CacheKey = unknown;
8
+ declare const getCache: <T>(...key: CacheKey[]) => T | undefined;
9
+ type CacheSetArgs<T$1> = [...keys: CacheKey[], value: T$1];
10
+ declare const setCache: <T>(...args: CacheSetArgs<T>) => void;
11
+ declare const clearCache: (idOrKey: string) => void;
12
+ declare const clearAllCache: () => void;
13
+ declare const cache: {
14
+ get: <T>(...key: CacheKey[]) => T | undefined;
15
+ set: <T>(...args: CacheSetArgs<T>) => void;
16
+ clear: (idOrKey: string) => void;
17
+ };
18
+ /** ------------------------- Persistence layer ------------------------- **/
19
+ type LocalCacheOptions = {
20
+ /** Preferred new option name */
21
+ persistent?: boolean;
22
+ /** Time-to-live in ms; if expired, disk entry is ignored. */
23
+ ttlMs?: number;
24
+ /** Max age in ms based on stored creation timestamp; invalidates on exceed. */
25
+ maxTimeMs?: number;
26
+ /** Optional namespace to separate different logical caches. */
27
+ namespace?: string;
28
+ /** Gzip values on disk (on by default for blobs > 1KB). */
29
+ compress?: boolean;
30
+ };
31
+ /** ------------------------- Local cache facade ------------------------- **/
32
+ declare const localCache: (intlayerConfig: IntlayerConfig, keys: CacheKey[], options?: LocalCacheOptions) => {
33
+ /** In-memory first, then disk (if enabled), otherwise undefined. */
34
+ get: <T>() => Promise<T | undefined>;
35
+ /** Sets in-memory (always) and persists to disk if enabled. */
36
+ set: (value: unknown) => Promise<void>;
37
+ /** Clears only this entry from memory and disk. */
38
+ clear: () => Promise<void>;
39
+ /** Clears ALL cached entries (memory Map and entire cacheDir namespace if persistent). */
40
+ clearAll: () => Promise<void>;
41
+ /** Expose the computed id (useful if you want to key other structures). */
42
+ isValid: () => Promise<boolean>;
43
+ /** Expose the computed id (useful if you want to key other structures). */
44
+ id: string;
45
+ /** Expose the absolute file path for debugging. */
46
+ filePath: string;
47
+ };
48
+ //#endregion
49
+ export { cache, clearAllCache, clearCache, getCache, localCache, setCache, stableStringify };
50
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","names":[],"sources":["../../../src/utils/cache.ts"],"sourcesContent":[],"mappings":";;;;cAuSa,2CAEX;AAFF;AAOE,KAgBG,QAAA,GAAQ,OAAA;AAGA,cAAA,QAAuB,EAAA,CAAA,CAAA,CAAA,CAAA,GAAa,GAAC,EAAd,QAAc,EAAA,EAAA,GAAD,CAAC,GAAA,SAAA;AAEhD,KAEG,YAAA,CAAA,GAAY,CAAA,GAAA,CAAA,GAAA,IAAA,EAAgB,QAAA,EAAA,EAAmB,KAAC,EAAD,GAAC,CAAA;AAExC,cAAA,QAAqC,EAAb,CAAA,CAAA,CAAA,CAAA,GAAA,IAAA,EAAA,YAAY,CAAC,CAAD,CAAA,EAAA,GAAA,IAAA;AAMpC,cAAA,UAGZ,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,IAAA;AAEY,cAAA,aAEZ,EAAA,GAAA,GAAA,IAAA;AAEY,cAAA,KAIZ,EAAA;EAzBmC,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,EAAA,QAAA,EAAA,EAAA,GAAa,CAAb,GAAA,SAAA;EAAa,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA,GAAA,IAAA,EAMZ,YANY,CAMC,CAND,CAAA,EAAA,GAAA,IAAA;EAMC,KAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,IAAA;CAAb;;AAmBnC,KAIG,iBAAA,GAAiB;EAoCT;EACK,UAAA,CAAA,EAAA,OAAA;EACV;EACI,KAAA,CAAA,EAAA,MAAA;EAoHkB;EAAR,SAAA,CAAA,EAAA,MAAA;EAWW;EAQZ,SAAA,CAAA,EAAA,MAAA;EAQG;EAgBD,QAAA,CAAA,EAAA,OAAA;CAAO;;cAlKjB,6BACK,sBACV,sBACI;;gBAoHU,QAAQ;;2BAWG;;eAQZ;;kBAQG;;iBAgBD"}
@@ -1,5 +1,8 @@
1
+ //#region src/utils/clearModuleCache.d.ts
1
2
  /**
2
3
  * Recursively clears the require cache for a module and all its dependencies
3
4
  */
4
- export declare const clearModuleCache: (modulePath: string, visited?: Set<string>) => void;
5
+ declare const clearModuleCache: (modulePath: string, visited?: Set<string>) => void;
6
+ //#endregion
7
+ export { clearModuleCache };
5
8
  //# sourceMappingURL=clearModuleCache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clearModuleCache.d.ts","sourceRoot":"","sources":["../../../src/utils/clearModuleCache.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,MAAM,EAClB,qBAA2B,SA6B5B,CAAC"}
1
+ {"version":3,"file":"clearModuleCache.d.ts","names":[],"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":[],"mappings":";;AAKA;;cAAa,iDAEX"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/extractErrorMessage.d.ts
2
+ declare const extractErrorMessage: (error: unknown) => string;
3
+ //#endregion
4
+ export { extractErrorMessage };
5
+ //# sourceMappingURL=extractErrorMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractErrorMessage.d.ts","names":[],"sources":["../../../src/utils/extractErrorMessage.ts"],"sourcesContent":[],"mappings":";cAAa"}
@@ -1,3 +1,7 @@
1
- import { type IntlayerConfig } from '@intlayer/config';
2
- export declare const getExtension: (configuration?: IntlayerConfig, format?: "esm" | "cjs" | undefined) => "cjs" | "mjs";
1
+ import { IntlayerConfig } from "@intlayer/types";
2
+
3
+ //#region src/utils/getExtension.d.ts
4
+ declare const getExtension: (configuration: IntlayerConfig, format?: "esm" | "cjs" | undefined) => "cjs" | "mjs";
5
+ //#endregion
6
+ export { getExtension };
3
7
  //# sourceMappingURL=getExtension.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExtension.d.ts","sourceRoot":"","sources":["../../../src/utils/getExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,kBAAkB,CAAC;AAEzE,eAAO,MAAM,YAAY,GACvB,gBAAe,cAAmC,EAClD,SAAS,KAAK,GAAG,KAAK,GAAG,SAAS,kBAWnC,CAAC"}
1
+ {"version":3,"file":"getExtension.d.ts","names":[],"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":[],"mappings":";;;cAEa,8BACI"}
@@ -0,0 +1,10 @@
1
+ //#region src/utils/getPackageJsonPath.d.ts
2
+ declare const isESModule: boolean;
3
+ type PackageJsonPathCache = {
4
+ packageJsonPath: string;
5
+ baseDir: string;
6
+ };
7
+ declare const getPackageJsonPath: (startDir?: string) => PackageJsonPathCache;
8
+ //#endregion
9
+ export { getPackageJsonPath, isESModule };
10
+ //# sourceMappingURL=getPackageJsonPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPackageJsonPath.d.ts","names":[],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":[],"mappings":";cAIa;AAAb,KAIK,oBAAA,GAJwD;EAIxD,eAAA,EAAA,MAAoB;EAKZ,OAAA,EAAA,MAAA;;cAAA,2CAEV"}
@@ -0,0 +1,7 @@
1
+ //#region src/utils/logStack.d.ts
2
+ declare const logStack: (message: string, options?: {
3
+ limit: number;
4
+ }) => void;
5
+ //#endregion
6
+ export { logStack };
7
+ //# sourceMappingURL=logStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logStack.d.ts","names":[],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":[],"mappings":";cAEa;EAAA,KAAA,EAAA,MAYZ"}
@@ -1,3 +1,4 @@
1
+ //#region src/utils/normalizePath.d.ts
1
2
  /**
2
3
  * Normalize a path for glob by replacing backslashes with forward slashes
3
4
  *
@@ -8,5 +9,7 @@
8
9
  * @param path - The path to normalize
9
10
  * @returns The normalized path
10
11
  */
11
- export declare const normalizePath: (path: string) => string;
12
+ declare const normalizePath: (path: string) => string;
13
+ //#endregion
14
+ export { normalizePath };
12
15
  //# sourceMappingURL=normalizePath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePath.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizePath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,MAAkC,CAAC"}
1
+ {"version":3,"file":"normalizePath.d.ts","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":[],"mappings":";;AAUA;;;;;;;;;cAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/config",
3
- "version": "6.1.6",
3
+ "version": "7.0.0-canary.1",
4
4
  "private": false,
5
5
  "description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
6
6
  "keywords": [
@@ -78,47 +78,52 @@
78
78
  "./dist",
79
79
  "./package.json"
80
80
  ],
81
+ "scripts": {
82
+ "build": "tsdown --config tsdown.config.ts",
83
+ "build:ci": "tsdown --config tsdown.config.ts",
84
+ "clean": "rimraf ./dist .turbo",
85
+ "dev": "tsdown --config tsdown.config.ts --watch",
86
+ "format": "biome format . --check",
87
+ "format:fix": "biome format --write .",
88
+ "lint": "biome lint .",
89
+ "lint:fix": "biome lint --write .",
90
+ "prepublish": "cp -f ../../../README.md ./README.md",
91
+ "test": "vitest run",
92
+ "test:watch": "vitest",
93
+ "typecheck": "tsc --noEmit --project tsconfig.types.json"
94
+ },
81
95
  "dependencies": {
82
- "deepmerge": "^4.3.1",
83
- "dotenv": "^16.6.1",
84
- "esbuild": "^0.25.2"
96
+ "@intlayer/types": "workspace:*",
97
+ "deepmerge": "4.3.1",
98
+ "dotenv": "16.6.1",
99
+ "esbuild": "0.25.2"
85
100
  },
86
101
  "devDependencies": {
87
- "@types/node": "^24.5.2",
88
- "@typescript-eslint/parser": "^8.44.1",
89
- "concurrently": "^9.2.1",
90
- "eslint": "^9.36.0",
91
- "prettier": "^3.6.2",
92
- "rimraf": "^6.0.1",
93
- "tsc-alias": "^1.8.16",
94
- "tsup": "^8.5.0",
95
- "typescript": "^5.9.2",
96
- "vitest": "^3.2.4",
97
- "@utils/eslint-config": "1.0.4",
98
- "@utils/ts-config": "1.0.4",
99
- "@utils/ts-config-types": "1.0.4",
100
- "@utils/tsup-config": "1.0.4"
102
+ "@types/node": "24.9.1",
103
+ "@utils/ts-config": "workspace:*",
104
+ "@utils/ts-config-types": "workspace:*",
105
+ "@utils/tsdown-config": "workspace:*",
106
+ "rimraf": "6.0.1",
107
+ "tsdown": "0.15.9",
108
+ "typescript": "5.9.3",
109
+ "vitest": "4.0.3"
110
+ },
111
+ "peerDependencies": {
112
+ "intlayer": "workspace:*",
113
+ "react": ">=16.0.0"
114
+ },
115
+ "peerDependenciesMeta": {
116
+ "intlayer": {
117
+ "optional": true
118
+ },
119
+ "react": {
120
+ "optional": true
121
+ }
101
122
  },
102
123
  "engines": {
103
124
  "node": ">=14.18"
104
125
  },
105
126
  "bug": {
106
127
  "url": "https://github.com/aymericzip/intlayer/issues"
107
- },
108
- "scripts": {
109
- "build": "pnpm clean & pnpm build:ci",
110
- "build:ci": "pnpm build:package & pnpm build:types",
111
- "build:package": "tsup",
112
- "build:types": "tsc --project ./tsconfig.types.json && tsc-alias --project ./tsconfig.types.json",
113
- "clean": "rimraf ./dist",
114
- "dev": "concurrently --prefix none \"tsup --watch\" \"tsc --project ./tsconfig.types.json --watch\" \"tsc-alias --project ./tsconfig.types.json --watch\"",
115
- "lint": "eslint . --cache",
116
- "lint:fix": "eslint . --cache --fix",
117
- "prettier": "prettier . --check",
118
- "prettier:fix": "prettier --write src/**/*",
119
- "prepublish": "cp -f ../../../README.md ./README.md",
120
- "test": "vitest run",
121
- "test:watch": "vitest",
122
- "typecheck": "tsup --project ./tsconfig.json --noEmit"
123
128
  }
124
- }
129
+ }
package/LICENSE DELETED
@@ -1,202 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright
52
- owner or by an individual or Legal Entity authorized to submit on
53
- behalf of the copyright owner. For the purposes of this definition,
54
- "submitted" means any form of electronic, verbal, or written
55
- communication sent to the Licensor or its representatives, including
56
- but not limited to communication on electronic mailing lists, source
57
- code control systems, and issue tracking systems that are managed by,
58
- or on behalf of, the Licensor for the purpose of discussing and improving
59
- the Work, but excluding communication that is conspicuously marked or
60
- otherwise designated in writing by the copyright owner as "Not a
61
- Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright 2024 Aymeric PINEAU
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/client.ts"],"sourcesContent":["export {\n ANSIColors,\n clock,\n colon,\n colorizeKey,\n colorizeLocales,\n colorizeNumber,\n colorizePath,\n getAppLogger,\n logger,\n spinnerFrames,\n v,\n x,\n} from './logger';\nexport type {\n BaseContentConfig,\n BaseDerivedConfig,\n CustomIntlayerConfig,\n IntlayerConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n} from './types/config';\nexport { Locales } from './types/locales';\nexport type { LocalesValues } from './types/locales';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAaO;AASP,qBAAwB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/configFile/index.ts"],"sourcesContent":["export * from './getConfiguration';\nexport * from './searchConfigurationFile';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,+BAAd;AACA,+BAAc,sCADd;","names":[]}
@@ -1,47 +0,0 @@
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 middleware_exports = {};
20
- __export(middleware_exports, {
21
- BASE_PATH: () => BASE_PATH,
22
- COOKIE_NAME: () => COOKIE_NAME,
23
- DETECT_LOCALE_ON_PREFETCH_NO_PREFIX: () => DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,
24
- HEADER_NAME: () => HEADER_NAME,
25
- NO_PREFIX: () => NO_PREFIX,
26
- PREFIX_DEFAULT: () => PREFIX_DEFAULT,
27
- SERVER_SET_COOKIE: () => SERVER_SET_COOKIE
28
- });
29
- module.exports = __toCommonJS(middleware_exports);
30
- const HEADER_NAME = "x-intlayer-locale";
31
- const COOKIE_NAME = "INTLAYER_LOCALE";
32
- const PREFIX_DEFAULT = false;
33
- const BASE_PATH = "";
34
- const SERVER_SET_COOKIE = "always";
35
- const NO_PREFIX = false;
36
- const DETECT_LOCALE_ON_PREFETCH_NO_PREFIX = false;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- BASE_PATH,
40
- COOKIE_NAME,
41
- DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,
42
- HEADER_NAME,
43
- NO_PREFIX,
44
- PREFIX_DEFAULT,
45
- SERVER_SET_COOKIE
46
- });
47
- //# sourceMappingURL=middleware.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/defaultValues/middleware.ts"],"sourcesContent":["export const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\n\nexport const PREFIX_DEFAULT = false;\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const NO_PREFIX = false;\n\nexport const DETECT_LOCALE_ON_PREFETCH_NO_PREFIX = false;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;AAEpB,MAAM,cAAc;AAEpB,MAAM,iBAAiB;AAEvB,MAAM,YAAY;AAElB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;AAElB,MAAM,sCAAsC;","names":[]}
@@ -1,64 +0,0 @@
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 getSandboxContext_exports = {};
20
- __export(getSandboxContext_exports, {
21
- getSandBoxContext: () => getSandBoxContext
22
- });
23
- module.exports = __toCommonJS(getSandboxContext_exports);
24
- var import_loadEnvFile = require('./loadEnvFile.cjs');
25
- var import_ESMxCJSHelpers = require('./utils/ESMxCJSHelpers.cjs');
26
- const getSandBoxContext = (envVarOptions, projectRequire = import_ESMxCJSHelpers.ESMxCJSRequire, additionalEnvVars) => {
27
- let additionalGlobalVar = {};
28
- try {
29
- additionalGlobalVar = {
30
- React: projectRequire("react")
31
- };
32
- } catch (err) {
33
- }
34
- const sandboxContext = {
35
- exports: {
36
- default: {}
37
- },
38
- module: {
39
- exports: {}
40
- },
41
- process: {
42
- ...process,
43
- env: {
44
- ...process.env,
45
- ...(0, import_loadEnvFile.loadEnvFile)(envVarOptions),
46
- ...additionalEnvVars
47
- }
48
- },
49
- console,
50
- require: projectRequire,
51
- ...additionalGlobalVar
52
- };
53
- Object.getOwnPropertyNames(globalThis).forEach((key) => {
54
- if (!(key in sandboxContext)) {
55
- sandboxContext[key] = globalThis[key];
56
- }
57
- });
58
- return sandboxContext;
59
- };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- getSandBoxContext
63
- });
64
- //# sourceMappingURL=getSandboxContext.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/getSandboxContext.ts"],"sourcesContent":["import type { Context } from 'vm';\nimport { type LoadEnvFileOptions, loadEnvFile } from './loadEnvFile';\nimport { ESMxCJSRequire } from './utils/ESMxCJSHelpers';\n\nexport const getSandBoxContext = (\n envVarOptions?: LoadEnvFileOptions,\n projectRequire = ESMxCJSRequire,\n additionalEnvVars?: Record<string, string>\n): Context => {\n let additionalGlobalVar = {};\n\n try {\n // Dynamically try to require React if it's installed in the project\n additionalGlobalVar = {\n React: projectRequire('react'),\n };\n } catch (err) {\n // React is not installed, so we don't inject it\n }\n\n const sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n process: {\n ...process,\n env: {\n ...process.env,\n ...loadEnvFile(envVarOptions),\n ...additionalEnvVars,\n },\n },\n console,\n require: projectRequire,\n ...additionalGlobalVar,\n };\n\n // Dynamically inject all global variables\n Object.getOwnPropertyNames(globalThis).forEach((key) => {\n if (!(key in sandboxContext)) {\n sandboxContext[key] = globalThis[key as keyof typeof globalThis];\n }\n });\n\n return sandboxContext;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAAqD;AACrD,4BAA+B;AAExB,MAAM,oBAAoB,CAC/B,eACA,iBAAiB,sCACjB,sBACY;AACZ,MAAI,sBAAsB,CAAC;AAE3B,MAAI;AAEF,0BAAsB;AAAA,MACpB,OAAO,eAAe,OAAO;AAAA,IAC/B;AAAA,EACF,SAAS,KAAK;AAAA,EAEd;AAEA,QAAM,iBAA0B;AAAA,IAC9B,SAAS;AAAA,MACP,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,QAAQ;AAAA,MACN,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACP,GAAG;AAAA,MACH,KAAK;AAAA,QACH,GAAG,QAAQ;AAAA,QACX,OAAG,gCAAY,aAAa;AAAA,QAC5B,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AAGA,SAAO,oBAAoB,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACtD,QAAI,EAAE,OAAO,iBAAiB;AAC5B,qBAAe,GAAG,IAAI,WAAW,GAA8B;AAAA,IACjE;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getAlias } from './alias';\nexport { bundleJSFile } from './bundleJSFile';\nexport {\n getConfiguration,\n getConfigurationAndFilePath,\n type GetConfigurationAndFilePathResult,\n type GetConfigurationOptions,\n} from './configFile/getConfiguration';\nexport { searchConfigurationFile } from './configFile/searchConfigurationFile';\nexport { getSandBoxContext } from './getSandboxContext';\nexport { getEnvFilePath, loadEnvFile } from './loadEnvFile';\nexport { loadExternalFile } from './loadExternalFile';\nexport {\n ANSIColors,\n clock,\n colon,\n colorize,\n colorizeKey,\n colorizeLocales,\n colorizeNumber,\n colorizePath,\n getAppLogger,\n logger,\n removeColor,\n spinnerFrames,\n v,\n x,\n type Logger,\n} from './logger';\nexport { retryManager } from './retryManager';\nexport type {\n BaseContentConfig,\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n ServerSetCookieRule,\n StrictMode,\n} from './types/config';\nexport { Locales } from './types/locales';\nexport type { LocalesValues } from './types/locales';\nexport { clearModuleCache } from './utils/clearModuleCache';\nexport { ESMxCJSRequire, isESModule } from './utils/ESMxCJSHelpers';\nexport { getExtension } from './utils/getExtension';\nexport { normalizePath } from './utils/normalizePath';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AACzB,0BAA6B;AAC7B,8BAKO;AACP,qCAAwC;AACxC,+BAAkC;AAClC,yBAA4C;AAC5C,8BAAiC;AACjC,oBAgBO;AACP,0BAA6B;AAgB7B,qBAAwB;AAExB,8BAAiC;AACjC,4BAA2C;AAC3C,0BAA6B;AAC7B,2BAA8B;","names":[]}