@veryfront/ext-content-mdx 0.1.1119 → 0.1.1122
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.
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/deno.js +1 -1
- package/esm/src/config/defaults.d.ts +39 -0
- package/esm/src/config/defaults.d.ts.map +1 -0
- package/esm/src/config/defaults.js +65 -0
- package/esm/src/errors/error-registry/agent.d.ts +18 -0
- package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
- package/esm/src/errors/error-registry/agent.js +60 -0
- package/esm/src/errors/error-registry/boundary.d.ts +16 -0
- package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
- package/esm/src/errors/error-registry/boundary.js +52 -0
- package/esm/src/errors/error-registry/build.d.ts +20 -0
- package/esm/src/errors/error-registry/build.d.ts.map +1 -0
- package/esm/src/errors/error-registry/build.js +68 -0
- package/esm/src/errors/error-registry/config.d.ts +31 -0
- package/esm/src/errors/error-registry/config.d.ts.map +1 -0
- package/esm/src/errors/error-registry/config.js +97 -0
- package/esm/src/errors/error-registry/deploy.d.ts +12 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
- package/esm/src/errors/error-registry/deploy.js +36 -0
- package/esm/src/errors/error-registry/dev.d.ts +14 -0
- package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
- package/esm/src/errors/error-registry/dev.js +44 -0
- package/esm/src/errors/error-registry/general.d.ts +29 -0
- package/esm/src/errors/error-registry/general.d.ts.map +1 -0
- package/esm/src/errors/error-registry/general.js +92 -0
- package/esm/src/errors/error-registry/module.d.ts +16 -0
- package/esm/src/errors/error-registry/module.d.ts.map +1 -0
- package/esm/src/errors/error-registry/module.js +52 -0
- package/esm/src/errors/error-registry/route.d.ts +16 -0
- package/esm/src/errors/error-registry/route.d.ts.map +1 -0
- package/esm/src/errors/error-registry/route.js +52 -0
- package/esm/src/errors/error-registry/runtime.d.ts +27 -0
- package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
- package/esm/src/errors/error-registry/runtime.js +87 -0
- package/esm/src/errors/error-registry/server.d.ts +39 -0
- package/esm/src/errors/error-registry/server.d.ts.map +1 -0
- package/esm/src/errors/error-registry/server.js +129 -0
- package/esm/src/errors/error-registry-helpers.d.ts +6 -0
- package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
- package/esm/src/errors/error-registry-helpers.js +9 -0
- package/esm/src/errors/error-registry.d.ts +120 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -0
- package/esm/src/errors/error-registry.js +60 -0
- package/esm/src/errors/types.d.ts +84 -0
- package/esm/src/errors/types.d.ts.map +1 -0
- package/esm/src/errors/types.js +69 -0
- package/esm/src/errors/veryfront-error.d.ts +149 -0
- package/esm/src/errors/veryfront-error.d.ts.map +1 -0
- package/esm/src/errors/veryfront-error.js +61 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +13 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +55 -0
- package/esm/src/observability/tracing/api-shim.d.ts +191 -0
- package/esm/src/observability/tracing/api-shim.d.ts.map +1 -0
- package/esm/src/observability/tracing/api-shim.js +281 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts +63 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -0
- package/esm/src/observability/tracing/otlp-setup.js +219 -0
- package/esm/src/observability/tracing/telemetry-env.d.ts +3 -0
- package/esm/src/observability/tracing/telemetry-env.d.ts.map +1 -0
- package/esm/src/observability/tracing/telemetry-env.js +10 -0
- package/esm/src/platform/adapters/base.d.ts +209 -0
- package/esm/src/platform/adapters/base.d.ts.map +1 -0
- package/esm/src/platform/adapters/base.js +15 -0
- package/esm/src/platform/compat/constants.d.ts +13 -0
- package/esm/src/platform/compat/constants.d.ts.map +1 -0
- package/esm/src/platform/compat/constants.js +12 -0
- package/esm/src/platform/compat/dynamic-import.d.ts +11 -0
- package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -0
- package/esm/src/platform/compat/dynamic-import.js +10 -0
- package/esm/src/platform/compat/fs.d.ts +76 -0
- package/esm/src/platform/compat/fs.d.ts.map +1 -0
- package/esm/src/platform/compat/fs.js +336 -0
- package/esm/src/platform/compat/process/command.d.ts +33 -0
- package/esm/src/platform/compat/process/command.d.ts.map +1 -0
- package/esm/src/platform/compat/process/command.js +206 -0
- package/esm/src/platform/compat/process.d.ts +5 -0
- package/esm/src/platform/compat/process.d.ts.map +1 -0
- package/esm/src/platform/compat/process.js +4 -0
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +70 -0
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -0
- package/esm/src/transforms/import-rewriter/url-builder.js +152 -0
- package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/import-rewriter.js +2 -1
- package/esm/src/utils/base64url.d.ts +7 -0
- package/esm/src/utils/base64url.d.ts.map +1 -0
- package/esm/src/utils/base64url.js +39 -0
- package/esm/src/utils/bundle-manifest.d.ts +63 -0
- package/esm/src/utils/bundle-manifest.d.ts.map +1 -0
- package/esm/src/utils/bundle-manifest.js +96 -0
- package/esm/src/utils/constants/buffers.d.ts +24 -0
- package/esm/src/utils/constants/buffers.d.ts.map +1 -0
- package/esm/src/utils/constants/buffers.js +23 -0
- package/esm/src/utils/constants/build.d.ts +8 -0
- package/esm/src/utils/constants/build.d.ts.map +1 -0
- package/esm/src/utils/constants/build.js +7 -0
- package/esm/src/utils/constants/cache.d.ts +74 -0
- package/esm/src/utils/constants/cache.d.ts.map +1 -0
- package/esm/src/utils/constants/cache.js +133 -0
- package/esm/src/utils/constants/cdn.d.ts +29 -0
- package/esm/src/utils/constants/cdn.d.ts.map +1 -0
- package/esm/src/utils/constants/cdn.js +58 -0
- package/esm/src/utils/constants/crypto.d.ts +10 -0
- package/esm/src/utils/constants/crypto.d.ts.map +1 -0
- package/esm/src/utils/constants/crypto.js +9 -0
- package/esm/src/utils/constants/env.d.ts +16 -0
- package/esm/src/utils/constants/env.d.ts.map +1 -0
- package/esm/src/utils/constants/env.js +20 -0
- package/esm/src/utils/constants/hash.d.ts +5 -0
- package/esm/src/utils/constants/hash.d.ts.map +1 -0
- package/esm/src/utils/constants/hash.js +4 -0
- package/esm/src/utils/constants/hmr.d.ts +24 -0
- package/esm/src/utils/constants/hmr.d.ts.map +1 -0
- package/esm/src/utils/constants/hmr.js +26 -0
- package/esm/src/utils/constants/html.d.ts +13 -0
- package/esm/src/utils/constants/html.d.ts.map +1 -0
- package/esm/src/utils/constants/html.js +12 -0
- package/esm/src/utils/constants/http.d.ts +77 -0
- package/esm/src/utils/constants/http.d.ts.map +1 -0
- package/esm/src/utils/constants/http.js +76 -0
- package/esm/src/utils/constants/index.d.ts +23 -0
- package/esm/src/utils/constants/index.d.ts.map +1 -0
- package/esm/src/utils/constants/index.js +22 -0
- package/esm/src/utils/constants/limits.d.ts +27 -0
- package/esm/src/utils/constants/limits.d.ts.map +1 -0
- package/esm/src/utils/constants/limits.js +26 -0
- package/esm/src/utils/constants/metrics.d.ts +10 -0
- package/esm/src/utils/constants/metrics.d.ts.map +1 -0
- package/esm/src/utils/constants/metrics.js +34 -0
- package/esm/src/utils/constants/network.d.ts +23 -0
- package/esm/src/utils/constants/network.d.ts.map +1 -0
- package/esm/src/utils/constants/network.js +27 -0
- package/esm/src/utils/constants/priorities.d.ts +31 -0
- package/esm/src/utils/constants/priorities.d.ts.map +1 -0
- package/esm/src/utils/constants/priorities.js +30 -0
- package/esm/src/utils/constants/retry.d.ts +14 -0
- package/esm/src/utils/constants/retry.d.ts.map +1 -0
- package/esm/src/utils/constants/retry.js +13 -0
- package/esm/src/utils/constants/server.d.ts +107 -0
- package/esm/src/utils/constants/server.d.ts.map +1 -0
- package/esm/src/utils/constants/server.js +120 -0
- package/esm/src/utils/feature-flags.d.ts +7 -0
- package/esm/src/utils/feature-flags.d.ts.map +1 -0
- package/esm/src/utils/feature-flags.js +8 -0
- package/esm/src/utils/hash-utils.d.ts +22 -0
- package/esm/src/utils/hash-utils.d.ts.map +1 -0
- package/esm/src/utils/hash-utils.js +48 -0
- package/esm/src/utils/import-lockfile.d.ts +52 -0
- package/esm/src/utils/import-lockfile.d.ts.map +1 -0
- package/esm/src/utils/import-lockfile.js +187 -0
- package/esm/src/utils/index.d.ts +30 -0
- package/esm/src/utils/index.d.ts.map +1 -0
- package/esm/src/utils/index.js +29 -0
- package/esm/src/utils/logger/components.d.ts +73 -0
- package/esm/src/utils/logger/components.d.ts.map +1 -0
- package/esm/src/utils/logger/components.js +81 -0
- package/esm/src/utils/logger/index.d.ts +10 -0
- package/esm/src/utils/logger/index.d.ts.map +1 -0
- package/esm/src/utils/logger/index.js +9 -0
- package/esm/src/utils/logger/request-context.d.ts +27 -0
- package/esm/src/utils/logger/request-context.d.ts.map +1 -0
- package/esm/src/utils/logger/request-context.js +28 -0
- package/esm/src/utils/memoize.d.ts +19 -0
- package/esm/src/utils/memoize.d.ts.map +1 -0
- package/esm/src/utils/memoize.js +72 -0
- package/esm/src/utils/parallel.d.ts +21 -0
- package/esm/src/utils/parallel.d.ts.map +1 -0
- package/esm/src/utils/parallel.js +51 -0
- package/esm/src/utils/path-utils.d.ts +34 -0
- package/esm/src/utils/path-utils.d.ts.map +1 -0
- package/esm/src/utils/path-utils.js +138 -0
- package/esm/src/utils/perf-timer.d.ts +11 -0
- package/esm/src/utils/perf-timer.d.ts.map +1 -0
- package/esm/src/utils/perf-timer.js +114 -0
- package/esm/src/utils/platform.d.ts +9 -0
- package/esm/src/utils/platform.d.ts.map +1 -0
- package/esm/src/utils/platform.js +11 -0
- package/esm/src/utils/runtime-guards.d.ts +29 -0
- package/esm/src/utils/runtime-guards.d.ts.map +1 -0
- package/esm/src/utils/runtime-guards.js +23 -0
- package/esm/src/utils/sleep.d.ts +2 -0
- package/esm/src/utils/sleep.d.ts.map +1 -0
- package/esm/src/utils/sleep.js +19 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,152 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/import-rewriter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/import-rewriter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAuDD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAwBrF;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,MAAM,CA2BjG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dirname, join, resolve as pathResolve } from "../../../platform/compat/path/index.js";
|
|
2
|
+
import { base64urlEncode } from "../../../utils/index.js";
|
|
2
3
|
function toAbsPath(spec, basedir) {
|
|
3
4
|
try {
|
|
4
5
|
if (spec.startsWith("file://"))
|
|
@@ -19,7 +20,7 @@ function toAbsPath(spec, basedir) {
|
|
|
19
20
|
function toBrowserFs(abs, baseUrl) {
|
|
20
21
|
if (abs.startsWith("http://") || abs.startsWith("https://"))
|
|
21
22
|
return abs;
|
|
22
|
-
const b64 =
|
|
23
|
+
const b64 = base64urlEncode(abs);
|
|
23
24
|
const path = `/_veryfront/fs/${b64}.js`;
|
|
24
25
|
return baseUrl ? `${baseUrl}${path}` : path;
|
|
25
26
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Encode a UTF-8 string as standard base64 (handles non-Latin1 input). */
|
|
2
|
+
export declare function encodeBase64(value: string): string;
|
|
3
|
+
/** Encode a string as unpadded base64url. */
|
|
4
|
+
export declare function base64urlEncode(input: string): string;
|
|
5
|
+
/** Encode raw bytes as unpadded base64url. */
|
|
6
|
+
export declare function base64urlEncodeBytes(bytes: Uint8Array): string;
|
|
7
|
+
//# sourceMappingURL=base64url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../../src/src/utils/base64url.ts"],"names":[],"mappings":"AAYA,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkBlD;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,8CAA8C;AAC9C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAI9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/***********************
|
|
2
|
+
* Base64 / base64url encoding utilities
|
|
3
|
+
***********************/
|
|
4
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
5
|
+
function toBase64Url(b64) {
|
|
6
|
+
return b64.replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
7
|
+
}
|
|
8
|
+
/** Encode a UTF-8 string as standard base64 (handles non-Latin1 input). */
|
|
9
|
+
export function encodeBase64(value) {
|
|
10
|
+
if (typeof globalThis.btoa === "function") {
|
|
11
|
+
try {
|
|
12
|
+
return globalThis.btoa(value);
|
|
13
|
+
}
|
|
14
|
+
catch (_) {
|
|
15
|
+
/* expected: non-Latin1 string — fall back to TextEncoder */
|
|
16
|
+
const bytes = new TextEncoder().encode(value);
|
|
17
|
+
let binary = "";
|
|
18
|
+
for (const byte of bytes)
|
|
19
|
+
binary += String.fromCharCode(byte);
|
|
20
|
+
return globalThis.btoa(binary);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const bufferCtor = dntShim.dntGlobalThis.Buffer;
|
|
24
|
+
if (bufferCtor)
|
|
25
|
+
return bufferCtor.from(value, "utf8").toString("base64");
|
|
26
|
+
// This file ships in client bundles — keep it dependency-free (no error registry).
|
|
27
|
+
throw new Error("Base64 encoding is not supported in this runtime");
|
|
28
|
+
}
|
|
29
|
+
/** Encode a string as unpadded base64url. */
|
|
30
|
+
export function base64urlEncode(input) {
|
|
31
|
+
return toBase64Url(encodeBase64(input));
|
|
32
|
+
}
|
|
33
|
+
/** Encode raw bytes as unpadded base64url. */
|
|
34
|
+
export function base64urlEncodeBytes(bytes) {
|
|
35
|
+
let binary = "";
|
|
36
|
+
for (const byte of bytes)
|
|
37
|
+
binary += String.fromCharCode(byte);
|
|
38
|
+
return toBase64Url(btoa(binary));
|
|
39
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAA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
+
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";
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,Q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