@veryfront/ext-observability-opentelemetry 0.1.1080 → 0.1.1082

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 (227) hide show
  1. package/esm/{extensions/ext-observability-opentelemetry/src/index.d.ts → index.d.ts} +0 -16
  2. package/esm/index.d.ts.map +1 -0
  3. package/esm/{extensions/ext-observability-opentelemetry/src/index.js → index.js} +2 -3
  4. package/package.json +6 -6
  5. package/esm/_dnt.polyfills.d.ts +0 -7
  6. package/esm/_dnt.polyfills.d.ts.map +0 -1
  7. package/esm/_dnt.polyfills.js +0 -1
  8. package/esm/deno.d.ts +0 -443
  9. package/esm/deno.d.ts.map +0 -1
  10. package/esm/deno.js +0 -531
  11. package/esm/extensions/ext-observability-opentelemetry/src/index.d.ts.map +0 -1
  12. package/esm/src/config/defaults.d.ts +0 -39
  13. package/esm/src/config/defaults.d.ts.map +0 -1
  14. package/esm/src/config/defaults.js +0 -65
  15. package/esm/src/errors/error-registry/agent.d.ts +0 -18
  16. package/esm/src/errors/error-registry/agent.d.ts.map +0 -1
  17. package/esm/src/errors/error-registry/agent.js +0 -60
  18. package/esm/src/errors/error-registry/boundary.d.ts +0 -16
  19. package/esm/src/errors/error-registry/boundary.d.ts.map +0 -1
  20. package/esm/src/errors/error-registry/boundary.js +0 -52
  21. package/esm/src/errors/error-registry/build.d.ts +0 -20
  22. package/esm/src/errors/error-registry/build.d.ts.map +0 -1
  23. package/esm/src/errors/error-registry/build.js +0 -68
  24. package/esm/src/errors/error-registry/config.d.ts +0 -22
  25. package/esm/src/errors/error-registry/config.d.ts.map +0 -1
  26. package/esm/src/errors/error-registry/config.js +0 -70
  27. package/esm/src/errors/error-registry/deploy.d.ts +0 -12
  28. package/esm/src/errors/error-registry/deploy.d.ts.map +0 -1
  29. package/esm/src/errors/error-registry/deploy.js +0 -36
  30. package/esm/src/errors/error-registry/dev.d.ts +0 -14
  31. package/esm/src/errors/error-registry/dev.d.ts.map +0 -1
  32. package/esm/src/errors/error-registry/dev.js +0 -44
  33. package/esm/src/errors/error-registry/general.d.ts +0 -29
  34. package/esm/src/errors/error-registry/general.d.ts.map +0 -1
  35. package/esm/src/errors/error-registry/general.js +0 -92
  36. package/esm/src/errors/error-registry/module.d.ts +0 -16
  37. package/esm/src/errors/error-registry/module.d.ts.map +0 -1
  38. package/esm/src/errors/error-registry/module.js +0 -52
  39. package/esm/src/errors/error-registry/route.d.ts +0 -16
  40. package/esm/src/errors/error-registry/route.d.ts.map +0 -1
  41. package/esm/src/errors/error-registry/route.js +0 -52
  42. package/esm/src/errors/error-registry/runtime.d.ts +0 -18
  43. package/esm/src/errors/error-registry/runtime.d.ts.map +0 -1
  44. package/esm/src/errors/error-registry/runtime.js +0 -60
  45. package/esm/src/errors/error-registry/server.d.ts +0 -39
  46. package/esm/src/errors/error-registry/server.d.ts.map +0 -1
  47. package/esm/src/errors/error-registry/server.js +0 -129
  48. package/esm/src/errors/error-registry-helpers.d.ts +0 -6
  49. package/esm/src/errors/error-registry-helpers.d.ts.map +0 -1
  50. package/esm/src/errors/error-registry-helpers.js +0 -9
  51. package/esm/src/errors/error-registry.d.ts +0 -114
  52. package/esm/src/errors/error-registry.d.ts.map +0 -1
  53. package/esm/src/errors/error-registry.js +0 -60
  54. package/esm/src/errors/types.d.ts +0 -84
  55. package/esm/src/errors/types.d.ts.map +0 -1
  56. package/esm/src/errors/types.js +0 -69
  57. package/esm/src/errors/veryfront-error.d.ts +0 -149
  58. package/esm/src/errors/veryfront-error.d.ts.map +0 -1
  59. package/esm/src/errors/veryfront-error.js +0 -61
  60. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +0 -13
  61. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +0 -1
  62. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +0 -55
  63. package/esm/src/observability/tracing/api-shim.d.ts +0 -191
  64. package/esm/src/observability/tracing/api-shim.d.ts.map +0 -1
  65. package/esm/src/observability/tracing/api-shim.js +0 -281
  66. package/esm/src/observability/tracing/otlp-setup.d.ts +0 -63
  67. package/esm/src/observability/tracing/otlp-setup.d.ts.map +0 -1
  68. package/esm/src/observability/tracing/otlp-setup.js +0 -219
  69. package/esm/src/observability/tracing/telemetry-env.d.ts +0 -3
  70. package/esm/src/observability/tracing/telemetry-env.d.ts.map +0 -1
  71. package/esm/src/observability/tracing/telemetry-env.js +0 -10
  72. package/esm/src/platform/adapters/base.d.ts +0 -209
  73. package/esm/src/platform/adapters/base.d.ts.map +0 -1
  74. package/esm/src/platform/adapters/base.js +0 -15
  75. package/esm/src/platform/compat/constants.d.ts +0 -13
  76. package/esm/src/platform/compat/constants.d.ts.map +0 -1
  77. package/esm/src/platform/compat/constants.js +0 -12
  78. package/esm/src/platform/compat/dynamic-import.d.ts +0 -11
  79. package/esm/src/platform/compat/dynamic-import.d.ts.map +0 -1
  80. package/esm/src/platform/compat/dynamic-import.js +0 -10
  81. package/esm/src/platform/compat/fs.d.ts +0 -75
  82. package/esm/src/platform/compat/fs.d.ts.map +0 -1
  83. package/esm/src/platform/compat/fs.js +0 -315
  84. package/esm/src/platform/compat/path/resolution.d.ts +0 -6
  85. package/esm/src/platform/compat/path/resolution.d.ts.map +0 -1
  86. package/esm/src/platform/compat/path/resolution.js +0 -121
  87. package/esm/src/platform/compat/path/runtime.d.ts +0 -8
  88. package/esm/src/platform/compat/path/runtime.d.ts.map +0 -1
  89. package/esm/src/platform/compat/path/runtime.js +0 -20
  90. package/esm/src/platform/compat/path/types.d.ts +0 -22
  91. package/esm/src/platform/compat/path/types.d.ts.map +0 -1
  92. package/esm/src/platform/compat/path/types.js +0 -1
  93. package/esm/src/platform/compat/process/command.d.ts +0 -33
  94. package/esm/src/platform/compat/process/command.d.ts.map +0 -1
  95. package/esm/src/platform/compat/process/command.js +0 -206
  96. package/esm/src/platform/compat/process/env.d.ts +0 -35
  97. package/esm/src/platform/compat/process/env.d.ts.map +0 -1
  98. package/esm/src/platform/compat/process/env.js +0 -194
  99. package/esm/src/platform/compat/process/lifecycle.d.ts +0 -99
  100. package/esm/src/platform/compat/process/lifecycle.d.ts.map +0 -1
  101. package/esm/src/platform/compat/process/lifecycle.js +0 -327
  102. package/esm/src/platform/compat/process/runtime-process.d.ts +0 -10
  103. package/esm/src/platform/compat/process/runtime-process.d.ts.map +0 -1
  104. package/esm/src/platform/compat/process/runtime-process.js +0 -25
  105. package/esm/src/platform/compat/process.d.ts +0 -5
  106. package/esm/src/platform/compat/process.d.ts.map +0 -1
  107. package/esm/src/platform/compat/process.js +0 -4
  108. package/esm/src/platform/compat/runtime.d.ts +0 -51
  109. package/esm/src/platform/compat/runtime.d.ts.map +0 -1
  110. package/esm/src/platform/compat/runtime.js +0 -104
  111. package/esm/src/transforms/import-rewriter/url-builder.d.ts +0 -70
  112. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +0 -1
  113. package/esm/src/transforms/import-rewriter/url-builder.js +0 -152
  114. package/esm/src/utils/base64url.d.ts +0 -6
  115. package/esm/src/utils/base64url.d.ts.map +0 -1
  116. package/esm/src/utils/base64url.js +0 -12
  117. package/esm/src/utils/bundle-manifest.d.ts +0 -63
  118. package/esm/src/utils/bundle-manifest.d.ts.map +0 -1
  119. package/esm/src/utils/bundle-manifest.js +0 -96
  120. package/esm/src/utils/constants/buffers.d.ts +0 -24
  121. package/esm/src/utils/constants/buffers.d.ts.map +0 -1
  122. package/esm/src/utils/constants/buffers.js +0 -23
  123. package/esm/src/utils/constants/build.d.ts +0 -8
  124. package/esm/src/utils/constants/build.d.ts.map +0 -1
  125. package/esm/src/utils/constants/build.js +0 -7
  126. package/esm/src/utils/constants/cache.d.ts +0 -74
  127. package/esm/src/utils/constants/cache.d.ts.map +0 -1
  128. package/esm/src/utils/constants/cache.js +0 -133
  129. package/esm/src/utils/constants/cdn.d.ts +0 -29
  130. package/esm/src/utils/constants/cdn.d.ts.map +0 -1
  131. package/esm/src/utils/constants/cdn.js +0 -58
  132. package/esm/src/utils/constants/crypto.d.ts +0 -10
  133. package/esm/src/utils/constants/crypto.d.ts.map +0 -1
  134. package/esm/src/utils/constants/crypto.js +0 -9
  135. package/esm/src/utils/constants/env.d.ts +0 -16
  136. package/esm/src/utils/constants/env.d.ts.map +0 -1
  137. package/esm/src/utils/constants/env.js +0 -20
  138. package/esm/src/utils/constants/hash.d.ts +0 -5
  139. package/esm/src/utils/constants/hash.d.ts.map +0 -1
  140. package/esm/src/utils/constants/hash.js +0 -4
  141. package/esm/src/utils/constants/hmr.d.ts +0 -24
  142. package/esm/src/utils/constants/hmr.d.ts.map +0 -1
  143. package/esm/src/utils/constants/hmr.js +0 -26
  144. package/esm/src/utils/constants/html.d.ts +0 -13
  145. package/esm/src/utils/constants/html.d.ts.map +0 -1
  146. package/esm/src/utils/constants/html.js +0 -12
  147. package/esm/src/utils/constants/http.d.ts +0 -77
  148. package/esm/src/utils/constants/http.d.ts.map +0 -1
  149. package/esm/src/utils/constants/http.js +0 -76
  150. package/esm/src/utils/constants/index.d.ts +0 -23
  151. package/esm/src/utils/constants/index.d.ts.map +0 -1
  152. package/esm/src/utils/constants/index.js +0 -22
  153. package/esm/src/utils/constants/limits.d.ts +0 -27
  154. package/esm/src/utils/constants/limits.d.ts.map +0 -1
  155. package/esm/src/utils/constants/limits.js +0 -26
  156. package/esm/src/utils/constants/metrics.d.ts +0 -10
  157. package/esm/src/utils/constants/metrics.d.ts.map +0 -1
  158. package/esm/src/utils/constants/metrics.js +0 -34
  159. package/esm/src/utils/constants/network.d.ts +0 -23
  160. package/esm/src/utils/constants/network.d.ts.map +0 -1
  161. package/esm/src/utils/constants/network.js +0 -27
  162. package/esm/src/utils/constants/priorities.d.ts +0 -31
  163. package/esm/src/utils/constants/priorities.d.ts.map +0 -1
  164. package/esm/src/utils/constants/priorities.js +0 -30
  165. package/esm/src/utils/constants/retry.d.ts +0 -14
  166. package/esm/src/utils/constants/retry.d.ts.map +0 -1
  167. package/esm/src/utils/constants/retry.js +0 -13
  168. package/esm/src/utils/constants/security.d.ts +0 -16
  169. package/esm/src/utils/constants/security.d.ts.map +0 -1
  170. package/esm/src/utils/constants/security.js +0 -15
  171. package/esm/src/utils/constants/server.d.ts +0 -107
  172. package/esm/src/utils/constants/server.d.ts.map +0 -1
  173. package/esm/src/utils/constants/server.js +0 -120
  174. package/esm/src/utils/feature-flags.d.ts +0 -7
  175. package/esm/src/utils/feature-flags.d.ts.map +0 -1
  176. package/esm/src/utils/feature-flags.js +0 -8
  177. package/esm/src/utils/hash-utils.d.ts +0 -19
  178. package/esm/src/utils/hash-utils.d.ts.map +0 -1
  179. package/esm/src/utils/hash-utils.js +0 -42
  180. package/esm/src/utils/import-lockfile.d.ts +0 -52
  181. package/esm/src/utils/import-lockfile.d.ts.map +0 -1
  182. package/esm/src/utils/import-lockfile.js +0 -187
  183. package/esm/src/utils/index.d.ts +0 -27
  184. package/esm/src/utils/index.d.ts.map +0 -1
  185. package/esm/src/utils/index.js +0 -25
  186. package/esm/src/utils/logger/components.d.ts +0 -73
  187. package/esm/src/utils/logger/components.d.ts.map +0 -1
  188. package/esm/src/utils/logger/components.js +0 -81
  189. package/esm/src/utils/logger/core.d.ts +0 -73
  190. package/esm/src/utils/logger/core.d.ts.map +0 -1
  191. package/esm/src/utils/logger/core.js +0 -143
  192. package/esm/src/utils/logger/index.d.ts +0 -10
  193. package/esm/src/utils/logger/index.d.ts.map +0 -1
  194. package/esm/src/utils/logger/index.js +0 -9
  195. package/esm/src/utils/logger/logger.d.ts +0 -179
  196. package/esm/src/utils/logger/logger.d.ts.map +0 -1
  197. package/esm/src/utils/logger/logger.js +0 -490
  198. package/esm/src/utils/logger/redact.d.ts +0 -74
  199. package/esm/src/utils/logger/redact.d.ts.map +0 -1
  200. package/esm/src/utils/logger/redact.js +0 -294
  201. package/esm/src/utils/logger/request-context.d.ts +0 -27
  202. package/esm/src/utils/logger/request-context.d.ts.map +0 -1
  203. package/esm/src/utils/logger/request-context.js +0 -28
  204. package/esm/src/utils/memoize.d.ts +0 -19
  205. package/esm/src/utils/memoize.d.ts.map +0 -1
  206. package/esm/src/utils/memoize.js +0 -72
  207. package/esm/src/utils/parallel.d.ts +0 -25
  208. package/esm/src/utils/parallel.d.ts.map +0 -1
  209. package/esm/src/utils/parallel.js +0 -91
  210. package/esm/src/utils/path-utils.d.ts +0 -34
  211. package/esm/src/utils/path-utils.d.ts.map +0 -1
  212. package/esm/src/utils/path-utils.js +0 -138
  213. package/esm/src/utils/perf-timer.d.ts +0 -11
  214. package/esm/src/utils/perf-timer.d.ts.map +0 -1
  215. package/esm/src/utils/perf-timer.js +0 -114
  216. package/esm/src/utils/platform.d.ts +0 -9
  217. package/esm/src/utils/platform.d.ts.map +0 -1
  218. package/esm/src/utils/platform.js +0 -11
  219. package/esm/src/utils/runtime-guards.d.ts +0 -29
  220. package/esm/src/utils/runtime-guards.d.ts.map +0 -1
  221. package/esm/src/utils/runtime-guards.js +0 -23
  222. package/esm/src/utils/version-constant.d.ts +0 -3
  223. package/esm/src/utils/version-constant.d.ts.map +0 -1
  224. package/esm/src/utils/version-constant.js +0 -4
  225. package/esm/src/utils/version.d.ts +0 -17
  226. package/esm/src/utils/version.d.ts.map +0 -1
  227. package/esm/src/utils/version.js +0 -36
@@ -1,152 +0,0 @@
1
- /**
2
- * Canonical URL builders for import rewriting.
3
- *
4
- * Single source of truth for all URL generation.
5
- * Ensures consistent URLs across SSR and browser for hydration parity.
6
- */
7
- /**
8
- * Default React version - used when not specified.
9
- *
10
- * MUST match the React version the build bundles (see `react/deno.json`),
11
- * because veryfront's framework React re-export is generated against that
12
- * version and references its named exports. A drift guard in
13
- * `src/utils/constants/cdn.test.ts` enforces this.
14
- */
15
- export const DEFAULT_REACT_VERSION = "19.2.4";
16
- /** Tailwind CSS version */
17
- export const TAILWIND_VERSION = "4.1.8";
18
- /** csstype version - must match deno.json for type consistency */
19
- export const CSSTYPE_VERSION = "3.2.3";
20
- /**
21
- * Build esm.sh URL with proper configuration.
22
- *
23
- * @param pkg - Package name (e.g., "react", "lodash")
24
- * @param version - Package version (optional)
25
- * @param subpath - Subpath (e.g., "/jsx-runtime")
26
- * @param options - URL options
27
- */
28
- export function buildEsmShUrl(pkg, version, subpath, options) {
29
- const params = [];
30
- if (options?.external?.length) {
31
- params.push(`external=${options.external.join(",")}`);
32
- }
33
- params.push(`target=${options?.target ?? "es2022"}`);
34
- if (options?.deps) {
35
- const depsStr = Object.entries(options.deps)
36
- .map(([k, v]) => `${k}@${v}`)
37
- .join(",");
38
- params.push(`deps=${depsStr}`);
39
- }
40
- const versionStr = version ? `@${version}` : "";
41
- const pathStr = subpath ?? "";
42
- const queryStr = params.length ? `?${params.join("&")}` : "";
43
- return `https://esm.sh/${pkg}${versionStr}${pathStr}${queryStr}`;
44
- }
45
- /**
46
- * Build React esm.sh URL.
47
- * Uses deps=csstype for type consistency.
48
- */
49
- export function buildReactUrl(pkg, version, subpath, external = false) {
50
- return buildEsmShUrl(pkg, version, subpath, {
51
- external: external ? ["react"] : undefined,
52
- deps: { csstype: CSSTYPE_VERSION },
53
- });
54
- }
55
- /**
56
- * Get complete React import map for a specific version.
57
- */
58
- export function getReactImportMap(version) {
59
- return {
60
- react: buildReactUrl("react", version),
61
- "react-dom": buildReactUrl("react-dom", version, undefined, true),
62
- "react-dom/client": buildReactUrl("react-dom", version, "/client", true),
63
- "react-dom/server": buildReactUrl("react-dom", version, "/server", true),
64
- "react/jsx-runtime": buildReactUrl("react", version, "/jsx-runtime", true),
65
- "react/jsx-dev-runtime": buildReactUrl("react", version, "/jsx-dev-runtime", true),
66
- // Prefix match for any react/* subpath imports
67
- "react/": buildReactUrl("react", version, "/", true),
68
- };
69
- }
70
- /**
71
- * Build module server URL for a path.
72
- */
73
- export function buildModuleServerUrl(baseUrl, path) {
74
- const normalizedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
75
- const normalizedPath = path.startsWith("/") ? path : `/${path}`;
76
- return `${normalizedBase}${normalizedPath}`;
77
- }
78
- /**
79
- * Build cross-project import URL.
80
- */
81
- export function buildCrossProjectUrl(projectSlug, version, path) {
82
- const modulePath = /\.(js|mjs|jsx|ts|tsx|mdx)$/.test(path) ? path : `${path}.tsx`;
83
- const projectRef = version && version !== "latest" ? `${projectSlug}@${version}` : projectSlug;
84
- return `/_vf_modules/_cross/${projectRef}/@/${modulePath}`;
85
- }
86
- /**
87
- * Build veryfront framework module URL.
88
- */
89
- export function buildVeryfrontModuleUrl(path) {
90
- const normalizedPath = path.replace(/\.(tsx?|jsx)$/, ".js");
91
- return `/_vf_modules/_veryfront/${normalizedPath}`;
92
- }
93
- /**
94
- * Normalize file extension for JavaScript output.
95
- */
96
- export function normalizeExtension(path, options) {
97
- if (options?.removeExtension)
98
- return path.replace(/\.(tsx?|jsx|mdx)$/, "");
99
- return path.replace(/\.(tsx?|jsx|mdx)$/, ".js");
100
- }
101
- /**
102
- * Check if a URL is an esm.sh URL.
103
- */
104
- export function isEsmShUrl(url) {
105
- return url.startsWith("https://esm.sh/") || url.startsWith("http://esm.sh/");
106
- }
107
- /**
108
- * Add deps query param to esm.sh URL if not already present.
109
- */
110
- export function addEsmShDeps(url, reactVersion) {
111
- if (!isEsmShUrl(url))
112
- return url;
113
- if (url.includes(`react@${reactVersion}`))
114
- return url;
115
- try {
116
- const parsed = new URL(url);
117
- const params = new URLSearchParams(parsed.search);
118
- const externals = new Set();
119
- for (const value of params.getAll("external")) {
120
- for (const external of value.split(",")) {
121
- const normalized = external.trim();
122
- if (normalized)
123
- externals.add(normalized);
124
- }
125
- }
126
- for (const external of ["react", "react-dom"]) {
127
- if (params.has(external)) {
128
- externals.add(external);
129
- params.delete(external);
130
- }
131
- externals.add(external);
132
- }
133
- const orderedExternals = [
134
- "react",
135
- "react-dom",
136
- ...Array.from(externals).filter((external) => external !== "react" && external !== "react-dom"),
137
- ];
138
- const target = params.get("target") ?? "es2022";
139
- params.delete("external");
140
- params.delete("target");
141
- const query = [
142
- `external=${orderedExternals.join(",")}`,
143
- `target=${target}`,
144
- ...Array.from(params.entries()).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`),
145
- ].join("&");
146
- return `${parsed.origin}${parsed.pathname}?${query}${parsed.hash}`;
147
- }
148
- catch (_) {
149
- /* expected: malformed URL falls back to the original string */
150
- return url;
151
- }
152
- }
@@ -1,6 +0,0 @@
1
- /***********************
2
- * Base64url encoding utilities
3
- ***********************/
4
- export declare function base64urlEncode(input: string): string;
5
- export declare function base64urlEncodeBytes(bytes: Uint8Array): string;
6
- //# sourceMappingURL=base64url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../../src/src/utils/base64url.ts"],"names":[],"mappings":"AAAA;;yBAEyB;AAMzB,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE9D"}
@@ -1,12 +0,0 @@
1
- /***********************
2
- * Base64url encoding utilities
3
- ***********************/
4
- function toBase64Url(b64) {
5
- return b64.replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
6
- }
7
- export function base64urlEncode(input) {
8
- return toBase64Url(btoa(input));
9
- }
10
- export function base64urlEncodeBytes(bytes) {
11
- return toBase64Url(btoa(String.fromCharCode(...bytes)));
12
- }
@@ -1,63 +0,0 @@
1
- /** Public API contract for bundle metadata. */
2
- export interface BundleMetadata {
3
- hash: string;
4
- codeHash: string;
5
- size: number;
6
- compiledAt: number;
7
- source: string;
8
- mode: "development" | "production";
9
- meta?: {
10
- type?: "mdx" | "component" | "layout" | "provider";
11
- depsHash?: string;
12
- reactVersion?: string;
13
- /** Headings extracted from MDX for sidebar/TOC navigation */
14
- headings?: Array<{
15
- id: string;
16
- text: string;
17
- level: number;
18
- }>;
19
- };
20
- }
21
- /** Public API contract for bundle code. */
22
- export interface BundleCode {
23
- code: string;
24
- sourceMap?: string;
25
- css?: string;
26
- }
27
- export interface BundleManifestStats {
28
- totalBundles: number;
29
- totalSize: number;
30
- oldestBundle?: number;
31
- newestBundle?: number;
32
- }
33
- export interface BundleManifestStore {
34
- getBundleMetadata(key: string): Promise<BundleMetadata | undefined>;
35
- setBundleMetadata(key: string, metadata: BundleMetadata, ttlMs?: number): Promise<void>;
36
- getBundleCode(hash: string): Promise<BundleCode | undefined>;
37
- setBundleCode(hash: string, code: BundleCode, ttlMs?: number): Promise<void>;
38
- deleteBundle(key: string): Promise<void>;
39
- invalidateSource(source: string): Promise<number>;
40
- clear(): Promise<void>;
41
- isAvailable(): Promise<boolean>;
42
- getStats(): Promise<BundleManifestStats>;
43
- }
44
- export declare class InMemoryBundleManifestStore implements BundleManifestStore {
45
- private metadata;
46
- private code;
47
- private sourceIndex;
48
- private getIfNotExpired;
49
- getBundleMetadata(key: string): Promise<BundleMetadata | undefined>;
50
- setBundleMetadata(key: string, metadata: BundleMetadata, ttlMs?: number): Promise<void>;
51
- getBundleCode(hash: string): Promise<BundleCode | undefined>;
52
- setBundleCode(hash: string, code: BundleCode, ttlMs?: number): Promise<void>;
53
- deleteBundle(key: string): Promise<void>;
54
- invalidateSource(source: string): Promise<number>;
55
- clear(): Promise<void>;
56
- isAvailable(): Promise<boolean>;
57
- getStats(): Promise<BundleManifestStats>;
58
- }
59
- export declare function setBundleManifestStore(store: BundleManifestStore): void;
60
- /** Return bundle manifest store. */
61
- export declare function getBundleManifestStore(): BundleManifestStore;
62
- export { computeCodeHash, computeHash } from "./hash-utils.js";
63
- //# sourceMappingURL=bundle-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundle-manifest.d.ts","sourceRoot":"","sources":["../../../src/src/utils/bundle-manifest.ts"],"names":[],"mappings":"AAIA,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MA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O,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,96 +0,0 @@
1
- import { serverLogger } from "./logger/index.js";
2
- const logger = serverLogger.component("bundle-manifest");
3
- export class InMemoryBundleManifestStore {
4
- metadata = new Map();
5
- code = new Map();
6
- sourceIndex = new Map();
7
- getIfNotExpired(map, key) {
8
- const entry = map.get(key);
9
- if (!entry)
10
- return undefined;
11
- if (entry.expiry != null && Date.now() > entry.expiry) {
12
- map.delete(key);
13
- return undefined;
14
- }
15
- return entry.value;
16
- }
17
- async getBundleMetadata(key) {
18
- return this.getIfNotExpired(this.metadata, key);
19
- }
20
- async setBundleMetadata(key, metadata, ttlMs) {
21
- const expiry = ttlMs != null ? Date.now() + ttlMs : undefined;
22
- this.metadata.set(key, { value: metadata, expiry });
23
- const keys = this.sourceIndex.get(metadata.source) ?? new Set();
24
- keys.add(key);
25
- this.sourceIndex.set(metadata.source, keys);
26
- }
27
- async getBundleCode(hash) {
28
- return this.getIfNotExpired(this.code, hash);
29
- }
30
- async setBundleCode(hash, code, ttlMs) {
31
- const expiry = ttlMs != null ? Date.now() + ttlMs : undefined;
32
- this.code.set(hash, { value: code, expiry });
33
- }
34
- async deleteBundle(key) {
35
- const metadata = await this.getBundleMetadata(key);
36
- this.metadata.delete(key);
37
- if (!metadata)
38
- return;
39
- this.code.delete(metadata.codeHash);
40
- const sourceKeys = this.sourceIndex.get(metadata.source);
41
- if (!sourceKeys)
42
- return;
43
- sourceKeys.delete(key);
44
- if (sourceKeys.size === 0)
45
- this.sourceIndex.delete(metadata.source);
46
- }
47
- async invalidateSource(source) {
48
- const keys = this.sourceIndex.get(source);
49
- if (!keys)
50
- return 0;
51
- const keysArray = [...keys];
52
- await Promise.all(keysArray.map((key) => this.deleteBundle(key)));
53
- this.sourceIndex.delete(source);
54
- return keysArray.length;
55
- }
56
- async clear() {
57
- this.metadata.clear();
58
- this.code.clear();
59
- this.sourceIndex.clear();
60
- }
61
- async isAvailable() {
62
- return true;
63
- }
64
- async getStats() {
65
- let totalSize = 0;
66
- let oldestBundle;
67
- let newestBundle;
68
- for (const { value } of this.metadata.values()) {
69
- totalSize += value.size;
70
- oldestBundle = oldestBundle == null
71
- ? value.compiledAt
72
- : Math.min(oldestBundle, value.compiledAt);
73
- newestBundle = newestBundle == null
74
- ? value.compiledAt
75
- : Math.max(newestBundle, value.compiledAt);
76
- }
77
- return {
78
- totalBundles: this.metadata.size,
79
- totalSize,
80
- oldestBundle,
81
- newestBundle,
82
- };
83
- }
84
- }
85
- let manifestStore = new InMemoryBundleManifestStore();
86
- export function setBundleManifestStore(store) {
87
- manifestStore = store;
88
- logger.info("Bundle manifest store configured", {
89
- type: store.constructor.name,
90
- });
91
- }
92
- /** Return bundle manifest store. */
93
- export function getBundleManifestStore() {
94
- return manifestStore;
95
- }
96
- export { computeCodeHash, computeHash } from "./hash-utils.js";
@@ -1,24 +0,0 @@
1
- export declare const BUFFER_SIZE_256_BYTES = 256;
2
- export declare const BUFFER_SIZE_512_BYTES = 512;
3
- export declare const BUFFER_SIZE_1_KB = 1024;
4
- export declare const BUFFER_SIZE_2_KB = 2048;
5
- export declare const BUFFER_SIZE_4_KB = 4096;
6
- export declare const BUFFER_SIZE_8_KB = 8192;
7
- export declare const BUFFER_SIZE_16_KB = 16384;
8
- export declare const BUFFER_SIZE_32_KB = 32768;
9
- export declare const BUFFER_SIZE_64_KB = 65536;
10
- /** RSC file reading buffer for 'use client'/'use server' detection */
11
- export declare const RSC_FILE_READ_BUFFER_SIZE_BYTES = 2048;
12
- /** Default maximum body size (1MB) */
13
- export declare const DEFAULT_MAX_BODY_SIZE_BYTES: number;
14
- /** Default maximum URL length (2KB) */
15
- export declare const DEFAULT_MAX_URL_LENGTH_BYTES = 2048;
16
- /** Default maximum HTTP header size (8KB) */
17
- export declare const DEFAULT_MAX_HEADER_SIZE_BYTES = 8192;
18
- /** Default maximum file upload size (5MB) */
19
- export declare const DEFAULT_MAX_FILE_SIZE_BYTES: number;
20
- /** Prefetch queue maximum size (1MB) */
21
- export declare const PREFETCH_QUEUE_MAX_SIZE_BYTES: number;
22
- /** Maximum chunk size for bundling (4MB) */
23
- export declare const MAX_BUNDLE_CHUNK_SIZE_BYTES: number;
24
- //# sourceMappingURL=buffers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"buffers.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/buffers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,sEAAsE;AACtE,eAAO,MAAM,+BAA+B,OAAmB,CAAC;AAEhE,sCAAsC;AACtC,eAAO,MAAM,2BAA2B,QAAc,CAAC;AAEvD,uCAAuC;AACvC,eAAO,MAAM,4BAA4B,OAAmB,CAAC;AAE7D,6CAA6C;AAC7C,eAAO,MAAM,6BAA6B,OAAmB,CAAC;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,2BAA2B,QAAkB,CAAC;AAE3D,wCAAwC;AACxC,eAAO,MAAM,6BAA6B,QAA8B,CAAC;AAEzE,4CAA4C;AAC5C,eAAO,MAAM,2BAA2B,QAAc,CAAC"}
@@ -1,23 +0,0 @@
1
- export const BUFFER_SIZE_256_BYTES = 256;
2
- export const BUFFER_SIZE_512_BYTES = 512;
3
- export const BUFFER_SIZE_1_KB = 1024;
4
- export const BUFFER_SIZE_2_KB = 2048;
5
- export const BUFFER_SIZE_4_KB = 4096;
6
- export const BUFFER_SIZE_8_KB = 8192;
7
- export const BUFFER_SIZE_16_KB = 16384;
8
- export const BUFFER_SIZE_32_KB = 32768;
9
- export const BUFFER_SIZE_64_KB = 65536;
10
- /** RSC file reading buffer for 'use client'/'use server' detection */
11
- export const RSC_FILE_READ_BUFFER_SIZE_BYTES = BUFFER_SIZE_2_KB;
12
- /** Default maximum body size (1MB) */
13
- export const DEFAULT_MAX_BODY_SIZE_BYTES = 1024 * 1024;
14
- /** Default maximum URL length (2KB) */
15
- export const DEFAULT_MAX_URL_LENGTH_BYTES = BUFFER_SIZE_2_KB;
16
- /** Default maximum HTTP header size (8KB) */
17
- export const DEFAULT_MAX_HEADER_SIZE_BYTES = BUFFER_SIZE_8_KB;
18
- /** Default maximum file upload size (5MB) */
19
- export const DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
20
- /** Prefetch queue maximum size (1MB) */
21
- export const PREFETCH_QUEUE_MAX_SIZE_BYTES = DEFAULT_MAX_BODY_SIZE_BYTES;
22
- /** Maximum chunk size for bundling (4MB) */
23
- export const MAX_BUNDLE_CHUNK_SIZE_BYTES = 4096 * 1024;
@@ -1,8 +0,0 @@
1
- /** Default value for build concurrency. */
2
- export declare const DEFAULT_BUILD_CONCURRENCY = 4;
3
- /** Shared image optimization value. */
4
- export declare const IMAGE_OPTIMIZATION: {
5
- readonly DEFAULT_SIZES: readonly [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
6
- readonly DEFAULT_QUALITY: 80;
7
- };
8
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/build.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,uCAAuC;AACvC,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
@@ -1,7 +0,0 @@
1
- /** Default value for build concurrency. */
2
- export const DEFAULT_BUILD_CONCURRENCY = 4;
3
- /** Shared image optimization value. */
4
- export const IMAGE_OPTIMIZATION = {
5
- DEFAULT_SIZES: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
6
- DEFAULT_QUALITY: 80,
7
- };
@@ -1,74 +0,0 @@
1
- export declare const SECONDS_PER_MINUTE = 60;
2
- export declare const MINUTES_PER_HOUR = 60;
3
- export declare const HOURS_PER_DAY = 24;
4
- /** Shared ms per second value. */
5
- export declare const MS_PER_SECOND = 1000;
6
- export declare const MS_PER_MINUTE: number;
7
- export declare const MS_PER_HOUR: number;
8
- export declare const ONE_DAY_MS: number;
9
- /** Default value for lru max entries. */
10
- export declare const DEFAULT_LRU_MAX_ENTRIES: number;
11
- export declare const COMPONENT_LOADER_MAX_ENTRIES: number;
12
- export declare const COMPONENT_LOADER_TTL_MS: number;
13
- export declare const MDX_RENDERER_MAX_ENTRIES: number;
14
- export declare const MDX_RENDERER_TTL_MS: number;
15
- export declare const RENDERER_CORE_MAX_ENTRIES: number;
16
- export declare const RENDERER_CORE_TTL_MS: number;
17
- /** Shared TSX layout max entries value. */
18
- export declare const TSX_LAYOUT_MAX_ENTRIES: number;
19
- export declare const TSX_LAYOUT_TTL_MS: number;
20
- /**
21
- * Per-project cap for the TSX layout component cache.
22
- * Prevents a single noisy tenant from evicting every other project's
23
- * cached layouts. Defaults to ceil(TSX_LAYOUT_MAX_ENTRIES / 10) so no
24
- * one project consumes more than ~10 % of the global budget.
25
- * Set via TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES env var.
26
- */
27
- export declare const TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES: number;
28
- export declare const DATA_FETCHING_MAX_ENTRIES: number;
29
- export declare const DATA_FETCHING_TTL_MS: number;
30
- export declare const MDX_CACHE_TTL_PRODUCTION_MS: number;
31
- export declare const MDX_CACHE_TTL_DEVELOPMENT_MS: number;
32
- export declare const BUNDLE_CACHE_TTL_PRODUCTION_MS: number;
33
- export declare const BUNDLE_CACHE_TTL_DEVELOPMENT_MS: number;
34
- export declare const BUNDLE_MANIFEST_PROD_TTL_MS: number;
35
- export declare const BUNDLE_MANIFEST_DEV_TTL_MS: number;
36
- /** Shared RSC manifest cache ttl ms value. */
37
- export declare const RSC_MANIFEST_CACHE_TTL_MS = 5000;
38
- export declare const SERVER_ACTION_DEFAULT_TTL_SEC: number;
39
- export declare const DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC: number;
40
- export declare const DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC: number;
41
- export declare const DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC: number;
42
- export declare const DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC: number;
43
- export declare const DISTRIBUTED_FILE_TTL_PRODUCTION_SEC: number;
44
- export declare const DISTRIBUTED_FILE_TTL_PREVIEW_SEC: number;
45
- export declare const DISTRIBUTED_CSS_TTL_PRODUCTION_SEC: number;
46
- export declare const DISTRIBUTED_CSS_TTL_PREVIEW_SEC: number;
47
- /** Get environment-aware distributed cache TTL in seconds */
48
- export declare function getDistributedCacheTTL(cacheType: "ssr-module" | "transform" | "file" | "css", isProduction?: boolean): number;
49
- export declare const DENO_KV_SAFE_SIZE_LIMIT_BYTES = 64000;
50
- export declare const LRU_DEFAULT_MAX_ENTRIES_V2: number;
51
- export declare const LRU_DEFAULT_MAX_SIZE_BYTES: number;
52
- export declare const MEMORY_CACHE_MAX_ENTRIES: number;
53
- export declare const MEMORY_CACHE_MAX_SIZE_BYTES: number;
54
- export declare const FILE_CACHE_MAX_ENTRIES: number;
55
- export declare const FILE_CACHE_MAX_SIZE_MB: number;
56
- export declare const HTTP_CACHE_SHORT_MAX_AGE_SEC = 60;
57
- export declare const HTTP_CACHE_MEDIUM_MAX_AGE_SEC = 3600;
58
- export declare const HTTP_CACHE_LONG_MAX_AGE_SEC = 31536000;
59
- export declare const CACHE_CLEANUP_INTERVAL_MS = 60000;
60
- export declare const CLEANUP_INTERVAL_MULTIPLIER = 2;
61
- export declare const MAX_CONCURRENT_REVALIDATIONS: number;
62
- export declare const MAX_CONCURRENT_HTTP_FETCHES: number;
63
- export declare const REVALIDATION_TIMEOUT_MS: number;
64
- export declare const REVALIDATION_PER_PROJECT_LIMIT: number;
65
- export declare const BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC: number;
66
- export declare const BUNDLE_MANIFEST_LRU_MAX_ENTRIES: number;
67
- export declare const HTTP_MODULE_CACHE_MAX_ENTRIES: number;
68
- export declare const HTTP_MODULE_DISTRIBUTED_TTL_SEC: number;
69
- export declare const TRANSFORM_DISTRIBUTED_TTL_SEC: number;
70
- export declare const MODULE_CACHE_MAX_ENTRIES: number;
71
- export declare const MODULE_CACHE_TTL_MS: number;
72
- export declare const ESM_CACHE_MAX_ENTRIES: number;
73
- export declare const ESM_CACHE_TTL_MS: number;
74
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/cache.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,kCAAkC;AAClC,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,aAAa,QAAqC,CAAC;AAChE,eAAO,MAAM,WAAW,QAAmC,CAAC;AAC5D,eAAO,MAAM,UAAU,QAA8B,CAAC;AAmCtD,yCAAyC;AACzC,eAAO,MAAM,uBAAuB,QAA+C,CAAC;AAEpF,eAAO,MAAM,4BAA4B,QAAoD,CAAC;AAC9F,eAAO,MAAM,uBAAuB,QAAqB,CAAC;AAE1D,eAAO,MAAM,wBAAwB,QAAgD,CAAC;AACtF,eAAO,MAAM,mBAAmB,QAAqB,CAAC;AAEtD,eAAO,MAAM,yBAAyB,QAAiD,CAAC;AACxF,eAAO,MAAM,oBAAoB,QAAoB,CAAC;AAEtD,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,QAA8C,CAAC;AAClF,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,CAAC;AAGlF,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAClD,eAAO,MAAM,2BAA2B,WAAW,CAAC;AAGpD,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAC/C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAG7C,eAAO,MAAM,4BAA4B,QAAmD,CAAC;AAC7F,eAAO,MAAM,2BAA2B,QAAkD,CAAC;AAC3F,eAAO,MAAM,uBAAuB,QAAiD,CAAC;AAGtF,eAAO,MAAM,8BAA8B,QAG1C,CAAC;AAGF,eAAO,MAAM,mCAAmC,QAG/C,CAAC;AACF,eAAO,MAAM,+BAA+B,QAG3C,CAAC;AAIF,eAAO,MAAM,6BAA6B,QAAsD,CAAC;AACjG,eAAO,MAAM,+BAA+B,QAG3C,CAAC;AAMF,eAAO,MAAM,6BAA6B,QAGzC,CAAC;AAIF,eAAO,MAAM,wBAAwB,QAAkD,CAAC;AACxF,eAAO,MAAM,mBAAmB,QAG/B,CAAC;AAGF,eAAO,MAAM,qBAAqB,QAA8C,CAAC;AACjF,eAAO,MAAM,gBAAgB,QAG5B,CAAC"}
@@ -1,133 +0,0 @@
1
- import * as dntShim from "../../../_dnt.shims.js";
2
- export const SECONDS_PER_MINUTE = 60;
3
- export const MINUTES_PER_HOUR = 60;
4
- export const HOURS_PER_DAY = 24;
5
- /** Shared ms per second value. */
6
- export const MS_PER_SECOND = 1000;
7
- export const MS_PER_MINUTE = SECONDS_PER_MINUTE * MS_PER_SECOND;
8
- export const MS_PER_HOUR = MINUTES_PER_HOUR * MS_PER_MINUTE;
9
- export const ONE_DAY_MS = HOURS_PER_DAY * MS_PER_HOUR;
10
- function getEnvString(key) {
11
- const g = dntShim.dntGlobalThis;
12
- try {
13
- return g.Deno?.env?.get?.(key) ?? g.process?.env?.[key];
14
- }
15
- catch (_) {
16
- /* expected: Deno may deny --allow-env permission */
17
- return undefined;
18
- }
19
- }
20
- function getEnvNumber(key, fallback) {
21
- const value = getEnvString(key);
22
- if (value == null)
23
- return fallback;
24
- const parsed = Number.parseInt(value, 10);
25
- if (Number.isNaN(parsed))
26
- return fallback;
27
- return parsed;
28
- }
29
- function isProductionMode() {
30
- return (getEnvString("PROXY_MODE") === "1" ||
31
- getEnvString("NODE_ENV") === "production" ||
32
- getEnvString("PRODUCTION_MODE") === "1");
33
- }
34
- // Cache entry limits (override via env vars)
35
- /** Default value for lru max entries. */
36
- export const DEFAULT_LRU_MAX_ENTRIES = getEnvNumber("LRU_DEFAULT_MAX_ENTRIES", 100);
37
- export const COMPONENT_LOADER_MAX_ENTRIES = getEnvNumber("COMPONENT_LOADER_MAX_ENTRIES", 200);
38
- export const COMPONENT_LOADER_TTL_MS = 10 * MS_PER_MINUTE;
39
- export const MDX_RENDERER_MAX_ENTRIES = getEnvNumber("MDX_RENDERER_MAX_ENTRIES", 500);
40
- export const MDX_RENDERER_TTL_MS = 10 * MS_PER_MINUTE;
41
- export const RENDERER_CORE_MAX_ENTRIES = getEnvNumber("RENDERER_CORE_MAX_ENTRIES", 200);
42
- export const RENDERER_CORE_TTL_MS = 5 * MS_PER_MINUTE;
43
- /** Shared TSX layout max entries value. */
44
- export const TSX_LAYOUT_MAX_ENTRIES = getEnvNumber("TSX_LAYOUT_MAX_ENTRIES", 100);
45
- export const TSX_LAYOUT_TTL_MS = 10 * MS_PER_MINUTE;
46
- /**
47
- * Per-project cap for the TSX layout component cache.
48
- * Prevents a single noisy tenant from evicting every other project's
49
- * cached layouts. Defaults to ceil(TSX_LAYOUT_MAX_ENTRIES / 10) so no
50
- * one project consumes more than ~10 % of the global budget.
51
- * Set via TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES env var.
52
- */
53
- export const TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES = getEnvNumber("TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES", Math.ceil(TSX_LAYOUT_MAX_ENTRIES / 10));
54
- export const DATA_FETCHING_MAX_ENTRIES = getEnvNumber("DATA_FETCHING_MAX_ENTRIES", 500);
55
- export const DATA_FETCHING_TTL_MS = 10 * MS_PER_MINUTE;
56
- export const MDX_CACHE_TTL_PRODUCTION_MS = ONE_DAY_MS;
57
- export const MDX_CACHE_TTL_DEVELOPMENT_MS = 5 * MS_PER_MINUTE;
58
- export const BUNDLE_CACHE_TTL_PRODUCTION_MS = ONE_DAY_MS;
59
- export const BUNDLE_CACHE_TTL_DEVELOPMENT_MS = 5 * MS_PER_MINUTE;
60
- export const BUNDLE_MANIFEST_PROD_TTL_MS = 7 * ONE_DAY_MS;
61
- export const BUNDLE_MANIFEST_DEV_TTL_MS = MS_PER_HOUR;
62
- /** Shared RSC manifest cache ttl ms value. */
63
- export const RSC_MANIFEST_CACHE_TTL_MS = 5000;
64
- export const SERVER_ACTION_DEFAULT_TTL_SEC = MINUTES_PER_HOUR * SECONDS_PER_MINUTE;
65
- // Distributed cache TTL (Redis/API)
66
- // Production: longer TTLs (release content is immutable)
67
- // Preview: shorter TTLs (branch content changes frequently)
68
- export const DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_SSR_MODULE_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
69
- export const DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
70
- export const DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_TRANSFORM_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
71
- export const DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
72
- export const DISTRIBUTED_FILE_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_FILE_TTL_SEC", MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
73
- export const DISTRIBUTED_FILE_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_FILE_TTL_PREVIEW_SEC", 5 * SECONDS_PER_MINUTE);
74
- export const DISTRIBUTED_CSS_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_CSS_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
75
- export const DISTRIBUTED_CSS_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_CSS_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
76
- /** Get environment-aware distributed cache TTL in seconds */
77
- export function getDistributedCacheTTL(cacheType, isProduction = isProductionMode()) {
78
- if (cacheType === "ssr-module") {
79
- return isProduction
80
- ? DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC
81
- : DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC;
82
- }
83
- if (cacheType === "transform") {
84
- return isProduction
85
- ? DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC
86
- : DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC;
87
- }
88
- if (cacheType === "file") {
89
- return isProduction ? DISTRIBUTED_FILE_TTL_PRODUCTION_SEC : DISTRIBUTED_FILE_TTL_PREVIEW_SEC;
90
- }
91
- return isProduction ? DISTRIBUTED_CSS_TTL_PRODUCTION_SEC : DISTRIBUTED_CSS_TTL_PREVIEW_SEC;
92
- }
93
- // Size limits (override via env vars)
94
- export const DENO_KV_SAFE_SIZE_LIMIT_BYTES = 64_000;
95
- export const LRU_DEFAULT_MAX_ENTRIES_V2 = getEnvNumber("LRU_MAX_ENTRIES", 2000);
96
- export const LRU_DEFAULT_MAX_SIZE_BYTES = getEnvNumber("LRU_MAX_SIZE_MB", 200) * 1024 * 1024;
97
- export const MEMORY_CACHE_MAX_ENTRIES = getEnvNumber("MEMORY_CACHE_MAX_ENTRIES", 2000);
98
- export const MEMORY_CACHE_MAX_SIZE_BYTES = getEnvNumber("MEMORY_CACHE_MAX_SIZE_MB", 50) * 1024 *
99
- 1024;
100
- export const FILE_CACHE_MAX_ENTRIES = getEnvNumber("FILE_CACHE_MAX_ENTRIES", 1000);
101
- export const FILE_CACHE_MAX_SIZE_MB = getEnvNumber("FILE_CACHE_MAX_SIZE_MB", 100);
102
- // HTTP cache headers
103
- export const HTTP_CACHE_SHORT_MAX_AGE_SEC = 60;
104
- export const HTTP_CACHE_MEDIUM_MAX_AGE_SEC = 3600;
105
- export const HTTP_CACHE_LONG_MAX_AGE_SEC = 31536000;
106
- // Maintenance
107
- export const CACHE_CLEANUP_INTERVAL_MS = 60000;
108
- export const CLEANUP_INTERVAL_MULTIPLIER = 2;
109
- // Concurrency limits (override via env vars)
110
- export const MAX_CONCURRENT_REVALIDATIONS = getEnvNumber("MAX_CONCURRENT_REVALIDATIONS", 32);
111
- export const MAX_CONCURRENT_HTTP_FETCHES = getEnvNumber("MAX_CONCURRENT_HTTP_FETCHES", 50);
112
- export const REVALIDATION_TIMEOUT_MS = getEnvNumber("REVALIDATION_TIMEOUT_MS", 15000);
113
- // Per-project fairness limit for revalidations (prevents one project from starving others)
114
- export const REVALIDATION_PER_PROJECT_LIMIT = getEnvNumber("REVALIDATION_PER_PROJECT_LIMIT", Math.ceil(MAX_CONCURRENT_REVALIDATIONS / 3));
115
- // Bundle manifest for atomic HTTP bundle group validation
116
- export const BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC = getEnvNumber("BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC", HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
117
- export const BUNDLE_MANIFEST_LRU_MAX_ENTRIES = getEnvNumber("BUNDLE_MANIFEST_LRU_MAX_ENTRIES", 5000);
118
- // HTTP module cache (esm.sh, CDN bundles)
119
- // These bundles are immutable once fetched, so long TTLs are safe
120
- export const HTTP_MODULE_CACHE_MAX_ENTRIES = getEnvNumber("HTTP_MODULE_CACHE_MAX_ENTRIES", 2000);
121
- export const HTTP_MODULE_DISTRIBUTED_TTL_SEC = getEnvNumber("HTTP_MODULE_DISTRIBUTED_TTL_SEC", HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
122
- // Transform cache for module compilation
123
- // MUST be shorter than HTTP_MODULE_DISTRIBUTED_TTL_SEC (24h) so that
124
- // HTTP bundles always outlive the transforms that reference them.
125
- // 6h matches DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC used by the SSR loader.
126
- export const TRANSFORM_DISTRIBUTED_TTL_SEC = getEnvNumber("TRANSFORM_DISTRIBUTED_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
127
- // Pod-level module cache (shared across all RenderPipeline instances)
128
- // These caches map module paths to transformed temp file paths
129
- export const MODULE_CACHE_MAX_ENTRIES = getEnvNumber("MODULE_CACHE_MAX_ENTRIES", 10000);
130
- export const MODULE_CACHE_TTL_MS = getEnvNumber("MODULE_CACHE_TTL_MS", 5 * MS_PER_MINUTE);
131
- // ESM cache for external module mappings
132
- export const ESM_CACHE_MAX_ENTRIES = getEnvNumber("ESM_CACHE_MAX_ENTRIES", 5000);
133
- export const ESM_CACHE_TTL_MS = getEnvNumber("ESM_CACHE_TTL_MS", 10 * MS_PER_MINUTE);