veryfront 0.1.95 → 0.1.97
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/deno.js +1 -1
- package/esm/src/html/schemas/html.schema.d.ts +2 -2
- package/esm/src/jobs/runtime-env.d.ts +5 -0
- package/esm/src/jobs/runtime-env.d.ts.map +1 -0
- package/esm/src/jobs/runtime-env.js +101 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +32 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +31 -2
- package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.js +1 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +6 -1
- package/esm/src/rendering/page-rendering.d.ts +8 -0
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +29 -18
- package/esm/src/task/runner.d.ts.map +1 -1
- package/esm/src/task/runner.js +2 -6
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts +5 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +18 -2
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +12 -5
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.d.ts +23 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.d.ts.map +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.js +112 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +33 -4
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts +6 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.js +31 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +15 -6
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/utils/version.d.ts +1 -1
- package/esm/src/utils/version.js +1 -1
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +7 -1
- package/esm/src/workflow/types.d.ts +1 -0
- package/esm/src/workflow/types.d.ts.map +1 -1
- package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/dynamic-job-entrypoint.js +18 -1
- package/esm/src/workflow/worker/job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/job-entrypoint.js +18 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/jobs/runtime-env.ts +132 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +34 -0
- package/src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts +34 -2
- package/src/src/modules/react-loader/ssr-module-loader/vf-module-resolver.ts +1 -0
- package/src/src/rendering/orchestrator/module-loader/index.ts +12 -1
- package/src/src/rendering/page-rendering.ts +64 -39
- package/src/src/task/runner.ts +2 -8
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +18 -1
- package/src/src/transforms/mdx/esm-module-loader/cache-format.ts +33 -1
- package/src/src/transforms/mdx/esm-module-loader/loader-helpers.ts +1 -0
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.ts +173 -0
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.ts +43 -3
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts +37 -0
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +26 -11
- package/src/src/transforms/mdx/esm-module-loader/types.ts +1 -0
- package/src/src/utils/version.ts +1 -1
- package/src/src/workflow/executor/workflow-executor.ts +7 -1
- package/src/src/workflow/types.ts +1 -0
- package/src/src/workflow/worker/dynamic-job-entrypoint.ts +19 -1
- package/src/src/workflow/worker/job-entrypoint.ts +19 -1
package/esm/deno.js
CHANGED
|
@@ -64,6 +64,7 @@ export declare const HTMLGenerationOptionsSchema: z.ZodObject<{
|
|
|
64
64
|
id: string;
|
|
65
65
|
}[] | undefined;
|
|
66
66
|
frontmatter?: Record<string, unknown> | undefined;
|
|
67
|
+
isLocalProject?: boolean | undefined;
|
|
67
68
|
nestedLayouts?: {
|
|
68
69
|
kind: string;
|
|
69
70
|
path?: string | undefined;
|
|
@@ -82,7 +83,6 @@ export declare const HTMLGenerationOptionsSchema: z.ZodObject<{
|
|
|
82
83
|
colorSchemeFromParam?: boolean | undefined;
|
|
83
84
|
colorSchemeFromHeader?: boolean | undefined;
|
|
84
85
|
projectClasses?: Set<string> | undefined;
|
|
85
|
-
isLocalProject?: boolean | undefined;
|
|
86
86
|
noHmr?: boolean | undefined;
|
|
87
87
|
}, {
|
|
88
88
|
mode: "production" | "development";
|
|
@@ -97,6 +97,7 @@ export declare const HTMLGenerationOptionsSchema: z.ZodObject<{
|
|
|
97
97
|
id: string;
|
|
98
98
|
}[] | undefined;
|
|
99
99
|
frontmatter?: Record<string, unknown> | undefined;
|
|
100
|
+
isLocalProject?: boolean | undefined;
|
|
100
101
|
nestedLayouts?: {
|
|
101
102
|
kind: string;
|
|
102
103
|
path?: string | undefined;
|
|
@@ -115,7 +116,6 @@ export declare const HTMLGenerationOptionsSchema: z.ZodObject<{
|
|
|
115
116
|
colorSchemeFromParam?: boolean | undefined;
|
|
116
117
|
colorSchemeFromHeader?: boolean | undefined;
|
|
117
118
|
projectClasses?: Set<string> | undefined;
|
|
118
|
-
isLocalProject?: boolean | undefined;
|
|
119
119
|
noHmr?: boolean | undefined;
|
|
120
120
|
}>;
|
|
121
121
|
export declare const HydrationDataSchema: z.ZodObject<{
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const INJECTED_TASK_ENV_JSON = "VERYFRONT_TASK_ENV_JSON";
|
|
2
|
+
export declare function readInjectedProjectEnv(allEnv: Record<string, string>): Record<string, string>;
|
|
3
|
+
export declare function buildTaskContextEnv(allEnv: Record<string, string>, envAllowlist?: string[]): Record<string, string>;
|
|
4
|
+
export declare function mergeInjectedWorkflowEnv(existingEnv: Record<string, string> | undefined, allEnv: Record<string, string>): Record<string, string> | undefined;
|
|
5
|
+
//# sourceMappingURL=runtime-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../../src/src/jobs/runtime-env.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAyDhE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6BxB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBxB;AAED,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAOpC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { logger as baseLogger } from "../utils/index.js";
|
|
2
|
+
const logger = baseLogger.component("job-runtime-env");
|
|
3
|
+
export const INJECTED_TASK_ENV_JSON = "VERYFRONT_TASK_ENV_JSON";
|
|
4
|
+
const UNSAFE_INJECTED_ENV_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
5
|
+
const HIDDEN_TASK_CONTEXT_ENV_KEYS = new Set([
|
|
6
|
+
"VERYFRONT_API_TOKEN",
|
|
7
|
+
"VERYFRONT_API_URL",
|
|
8
|
+
"VERYFRONT_PROJECT_API_URL",
|
|
9
|
+
"VERYFRONT_API_BASE_URL",
|
|
10
|
+
"VERYFRONT_PROJECT_ID",
|
|
11
|
+
"VERYFRONT_PROJECT_SLUG",
|
|
12
|
+
"VERYFRONT_BRANCH_REF",
|
|
13
|
+
"VERYFRONT_API_USER",
|
|
14
|
+
"VERYFRONT_API_PASS",
|
|
15
|
+
"VERYFRONT_JOB_RESULT_PATH",
|
|
16
|
+
INJECTED_TASK_ENV_JSON,
|
|
17
|
+
]);
|
|
18
|
+
const DISALLOWED_INJECTED_ENV_KEYS = new Set([
|
|
19
|
+
"VERYFRONT_API_TOKEN",
|
|
20
|
+
"VERYFRONT_API_URL",
|
|
21
|
+
"VERYFRONT_PROJECT_API_URL",
|
|
22
|
+
"VERYFRONT_API_BASE_URL",
|
|
23
|
+
"VERYFRONT_PROJECT_ID",
|
|
24
|
+
"VERYFRONT_PROJECT_SLUG",
|
|
25
|
+
"VERYFRONT_BRANCH_REF",
|
|
26
|
+
"VERYFRONT_API_USER",
|
|
27
|
+
"VERYFRONT_API_PASS",
|
|
28
|
+
"VERYFRONT_JOB_RESULT_PATH",
|
|
29
|
+
INJECTED_TASK_ENV_JSON,
|
|
30
|
+
]);
|
|
31
|
+
function isHiddenTaskContextEnvKey(key) {
|
|
32
|
+
return key.startsWith("TENANT_") || HIDDEN_TASK_CONTEXT_ENV_KEYS.has(key);
|
|
33
|
+
}
|
|
34
|
+
function isDisallowedInjectedEnvKey(key) {
|
|
35
|
+
return key.startsWith("TENANT_") || DISALLOWED_INJECTED_ENV_KEYS.has(key);
|
|
36
|
+
}
|
|
37
|
+
function filterExistingProjectEnv(env) {
|
|
38
|
+
const filtered = {};
|
|
39
|
+
for (const [key, value] of Object.entries(env ?? {})) {
|
|
40
|
+
if (UNSAFE_INJECTED_ENV_KEYS.has(key) ||
|
|
41
|
+
isDisallowedInjectedEnvKey(key) ||
|
|
42
|
+
typeof value !== "string") {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
filtered[key] = value;
|
|
46
|
+
}
|
|
47
|
+
return filtered;
|
|
48
|
+
}
|
|
49
|
+
export function readInjectedProjectEnv(allEnv) {
|
|
50
|
+
const raw = allEnv[INJECTED_TASK_ENV_JSON];
|
|
51
|
+
if (!raw) {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const parsed = JSON.parse(raw);
|
|
56
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
const injectedEnv = Object.create(null);
|
|
60
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
61
|
+
if (UNSAFE_INJECTED_ENV_KEYS.has(key) ||
|
|
62
|
+
isDisallowedInjectedEnvKey(key) ||
|
|
63
|
+
typeof value !== "string") {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
injectedEnv[key] = value;
|
|
67
|
+
}
|
|
68
|
+
return injectedEnv;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
logger.warn(`Ignoring invalid ${INJECTED_TASK_ENV_JSON}`);
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function buildTaskContextEnv(allEnv, envAllowlist) {
|
|
76
|
+
const allowlistedEnvKeys = envAllowlist ? new Set(envAllowlist) : null;
|
|
77
|
+
const env = {};
|
|
78
|
+
for (const [key, value] of Object.entries(allEnv)) {
|
|
79
|
+
if (isHiddenTaskContextEnvKey(key)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (allowlistedEnvKeys && !allowlistedEnvKeys.has(key)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
env[key] = value;
|
|
86
|
+
}
|
|
87
|
+
for (const [key, value] of Object.entries(readInjectedProjectEnv(allEnv))) {
|
|
88
|
+
if (allowlistedEnvKeys && !allowlistedEnvKeys.has(key)) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
env[key] = value;
|
|
92
|
+
}
|
|
93
|
+
return env;
|
|
94
|
+
}
|
|
95
|
+
export function mergeInjectedWorkflowEnv(existingEnv, allEnv) {
|
|
96
|
+
const mergedEnv = {
|
|
97
|
+
...filterExistingProjectEnv(existingEnv),
|
|
98
|
+
...readInjectedProjectEnv(allEnv),
|
|
99
|
+
};
|
|
100
|
+
return Object.keys(mergedEnv).length > 0 ? mergedEnv : undefined;
|
|
101
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAiCpC,OAAO,KAAK,EAAoB,sBAAsB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAiCpC,OAAO,KAAK,EAAoB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA2B3E;;;;;GAKG;AACH,qBAAa,eAAe;IAKd,OAAO,CAAC,OAAO;IAJ3B,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAAyB;gBAEzB,OAAO,EAAE,sBAAsB;IAWnD,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,4BAA4B;YAetB,qBAAqB;YAuCrB,0BAA0B;IAwHxC,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YA+C1C,2BAA2B;IAYzC,OAAO,CAAC,yBAAyB;YAiBnB,2BAA2B;CA8V1C"}
|
|
@@ -32,6 +32,7 @@ import { preflightLocalImports } from "./preflight-imports.js";
|
|
|
32
32
|
import { resolveVfModuleImports } from "./vf-module-resolver.js";
|
|
33
33
|
import { registerCSSImport } from "../css-import-collector.js";
|
|
34
34
|
import { injectNodePositions } from "../../../transforms/plugins/babel-node-positions.js";
|
|
35
|
+
import { ensureMdxModuleDependencies } from "../../../transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.js";
|
|
35
36
|
const logger = rendererLogger.component("ssr-module-loader");
|
|
36
37
|
const MISSING_HTTP_BUNDLE_PATTERN = /veryfront-http-bundle\/http-([a-f0-9]+)\.mjs/;
|
|
37
38
|
/**
|
|
@@ -145,6 +146,33 @@ export class SSRModuleLoader {
|
|
|
145
146
|
throw importError;
|
|
146
147
|
}
|
|
147
148
|
if (classifiedError.type === "module-not-found") {
|
|
149
|
+
if (this.options.contentSourceId) {
|
|
150
|
+
try {
|
|
151
|
+
const cachedCode = await this.cache.getFs().readTextFile(cacheEntry.tempPath);
|
|
152
|
+
const recovered = await ensureMdxModuleDependencies(cachedCode, {
|
|
153
|
+
projectId: this.options.projectId,
|
|
154
|
+
contentSourceId: this.options.contentSourceId,
|
|
155
|
+
log: logger,
|
|
156
|
+
});
|
|
157
|
+
if (recovered.missing.length === 0 && recovered.recovered.length > 0) {
|
|
158
|
+
const retryTempPath = cacheEntry.tempPath.replace(/\.mjs$/, "") +
|
|
159
|
+
`-recovered-${cacheEntry.contentHash}.mjs`;
|
|
160
|
+
await this.cache.getFs().writeTextFile(retryTempPath, cachedCode);
|
|
161
|
+
logger.info("Recovered vfmod dependencies for cached SSR module, retrying import", {
|
|
162
|
+
file: filePath.slice(-40),
|
|
163
|
+
recovered: recovered.recovered.slice(0, 5),
|
|
164
|
+
retryTempPath,
|
|
165
|
+
});
|
|
166
|
+
return (await import(`file://${retryTempPath}?v=${cacheEntry.contentHash}&retry=1`));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (recoveryError) {
|
|
170
|
+
logger.debug("Failed to recover vfmod dependencies for cached SSR module", {
|
|
171
|
+
file: filePath.slice(-40),
|
|
172
|
+
error: recoveryError instanceof Error ? recoveryError.message : String(recoveryError),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
148
176
|
logger.error("[SSR-MODULE-LOADER] Cached module has missing dependency, invalidating cache", {
|
|
149
177
|
file: filePath.slice(-40),
|
|
150
178
|
tempPath: cacheEntry.tempPath,
|
|
@@ -267,7 +295,10 @@ export class SSRModuleLoader {
|
|
|
267
295
|
const projectKey = hashCodeHex(this.options.projectId);
|
|
268
296
|
const sourceKey = this.options.contentSourceId;
|
|
269
297
|
const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
|
|
270
|
-
const mdxCacheResult = await lookupMdxEsmCache(filePath, mdxCacheDir, this.options.projectDir, contentHash
|
|
298
|
+
const mdxCacheResult = await lookupMdxEsmCache(filePath, mdxCacheDir, this.options.projectDir, contentHash, {
|
|
299
|
+
projectId: this.options.projectId,
|
|
300
|
+
contentSourceId: this.options.contentSourceId,
|
|
301
|
+
});
|
|
271
302
|
if (mdxCacheResult.status === "hit") {
|
|
272
303
|
const entry = { tempPath: mdxCacheResult.path, contentHash };
|
|
273
304
|
globalModuleCache.set(contentCacheKey, entry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-cache-manager.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAYlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr-cache-manager.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAYlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAW3E;;;;;;;GAOG;AACH,qBAAa,eAAe;IAId,OAAO,CAAC,OAAO;IAH3B,OAAO,CAAC,EAAE,CAAsB;IAChC,OAAO,CAAC,gBAAgB,CAAqB;gBAEzB,OAAO,EAAE,sBAAsB;IAEnD,4DAA4D;IAC5D,aAAa,IAAI,MAAM;IAUvB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAkB/B,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBlD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK1E,yBAAyB,IAAI,OAAO;IAoB9B,kBAAkB,CACtB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,GAAG,aAAa,EACtC,OAAO,EAAE;QAAE,eAAe,EAAE,OAAO,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE,GACpE,OAAO,CAAC,OAAO,CAAC;IAgCb,wBAAwB,CAC5B,WAAW,EAAE,gBAAgB,EAC7B,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;IAuBnB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI;IAOnF,oCAAoC,CAClC,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,EACxB,UAAU,CAAC,EAAE,gBAAgB,GAC5B,IAAI;IAQP,wDAAwD;IACxD,KAAK,IAAI,UAAU,CAAC,OAAO,gBAAgB,CAAC;IAI5C,OAAO,CAAC,4BAA4B;YAItB,qBAAqB;YAsBrB,oBAAoB;YAoDpB,YAAY;CA2B3B"}
|
|
@@ -19,6 +19,7 @@ import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-d
|
|
|
19
19
|
import { globalModuleCache, globalTmpDirs } from "./cache/index.js";
|
|
20
20
|
import { extractAllFilePaths, extractHttpBundlePaths, verifiedHttpBundlePaths, } from "./http-bundle-helpers.js";
|
|
21
21
|
import { buildTempModulePath, buildTmpDirPath, getTmpDirCacheKey } from "./tmp-paths.js";
|
|
22
|
+
import { ensureMdxModuleDependencies } from "../../../transforms/mdx/esm-module-loader/module-fetcher/dependency-recovery.js";
|
|
22
23
|
const logger = rendererLogger.component("ssr-module-loader");
|
|
23
24
|
/** Content length threshold: below this, use fast sync hash; above, use async SHA-256 */
|
|
24
25
|
const SYNC_HASH_THRESHOLD = 10_000;
|
|
@@ -122,7 +123,7 @@ export class SSRCacheManager {
|
|
|
122
123
|
try {
|
|
123
124
|
const cachedCode = await this.fs.readTextFile(cachedEntry.tempPath);
|
|
124
125
|
const isValid = await this.validateCachedCode(cachedCode, filePath, "memory-cache", {
|
|
125
|
-
checkLocalPaths:
|
|
126
|
+
checkLocalPaths: true,
|
|
126
127
|
checkInvalidEsmShPath: false,
|
|
127
128
|
});
|
|
128
129
|
if (!isValid) {
|
|
@@ -177,11 +178,13 @@ export class SSRCacheManager {
|
|
|
177
178
|
}
|
|
178
179
|
async hasMissingLocalPaths(code, filePath) {
|
|
179
180
|
const allPaths = extractAllFilePaths(code);
|
|
181
|
+
let hasMissingPath = false;
|
|
180
182
|
for (const path of allPaths) {
|
|
181
183
|
try {
|
|
182
184
|
const stat = await this.fs.stat(path);
|
|
183
185
|
if (!stat.isFile) {
|
|
184
|
-
|
|
186
|
+
hasMissingPath = true;
|
|
187
|
+
break;
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
catch (error) {
|
|
@@ -190,6 +193,32 @@ export class SSRCacheManager {
|
|
|
190
193
|
missingPath: path.slice(-60),
|
|
191
194
|
error,
|
|
192
195
|
});
|
|
196
|
+
hasMissingPath = true;
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (hasMissingPath &&
|
|
201
|
+
this.options.projectId &&
|
|
202
|
+
this.options.contentSourceId) {
|
|
203
|
+
const recovered = await ensureMdxModuleDependencies(code, {
|
|
204
|
+
projectId: this.options.projectId,
|
|
205
|
+
contentSourceId: this.options.contentSourceId,
|
|
206
|
+
log: logger,
|
|
207
|
+
});
|
|
208
|
+
if (recovered.recovered.length > 0) {
|
|
209
|
+
logger.debug("Recovered missing local vfmod dependencies for SSR cache entry", {
|
|
210
|
+
file: filePath.slice(-40),
|
|
211
|
+
recovered: recovered.recovered.slice(0, 5),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
for (const path of allPaths) {
|
|
216
|
+
try {
|
|
217
|
+
const stat = await this.fs.stat(path);
|
|
218
|
+
if (!stat.isFile)
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
catch (_) {
|
|
193
222
|
return true;
|
|
194
223
|
}
|
|
195
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vf-module-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/vf-module-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWzE,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,6BAA6B;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAelE;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"vf-module-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/vf-module-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWzE,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,6BAA6B;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAelE;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAwDjB"}
|
|
@@ -44,6 +44,7 @@ export async function resolveVfModuleImports(code, options) {
|
|
|
44
44
|
const projectKey = hashCodeHex(options.projectId);
|
|
45
45
|
const esmCacheDir = join(baseCacheDir, projectKey, options.contentSourceId);
|
|
46
46
|
const fetcherContext = createModuleFetcherContext(esmCacheDir, options.adapter, options.projectDir, options.projectId, {
|
|
47
|
+
contentSourceId: options.contentSourceId,
|
|
47
48
|
reactVersion: options.reactVersion,
|
|
48
49
|
projectSlug: options.projectId,
|
|
49
50
|
strictMissingModules: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA2BzE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAkJpE,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,eAAe,UAAQ,GACtB,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA2BzE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAkJpE,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,eAAe,UAAQ,GACtB,OAAO,CAAC,MAAM,CAAC,CAuSjB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAyBD;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqClC"}
|
|
@@ -162,7 +162,12 @@ export async function transformModuleWithDeps(filePath, tmpDir, localAdapter, co
|
|
|
162
162
|
const projectKey = encodeURIComponent(projectId);
|
|
163
163
|
const sourceKey = encodeURIComponent(contentSourceId);
|
|
164
164
|
const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
|
|
165
|
-
const mdxCacheResult = await lookupMdxEsmCache(filePath, mdxCacheDir, projectDir
|
|
165
|
+
const mdxCacheResult = await lookupMdxEsmCache(filePath, mdxCacheDir, projectDir, undefined, contentSourceId
|
|
166
|
+
? {
|
|
167
|
+
projectId,
|
|
168
|
+
contentSourceId,
|
|
169
|
+
}
|
|
170
|
+
: undefined);
|
|
166
171
|
if (mdxCacheResult.status === "hit") {
|
|
167
172
|
moduleCache.set(cacheKey, mdxCacheResult.path);
|
|
168
173
|
return mdxCacheResult.path;
|
|
@@ -6,6 +6,14 @@ interface MDXPageResult {
|
|
|
6
6
|
pageBundle: PageBundle;
|
|
7
7
|
collectedMetadata: Record<string, unknown>;
|
|
8
8
|
}
|
|
9
|
+
interface PreparedMDXPageBundles {
|
|
10
|
+
pageBundle: PageBundle;
|
|
11
|
+
serverModuleCode: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function prepareMDXPageBundles(pageInfo: EntityInfo, projectDir: string, options?: {
|
|
14
|
+
precompiledModule?: string;
|
|
15
|
+
studioEmbed?: boolean;
|
|
16
|
+
}): Promise<PreparedMDXPageBundles>;
|
|
9
17
|
export declare function handleMDXPage(pageInfo: EntityInfo, slug: string, projectDir: string, mergedComponents: MDXComponents, _compileMDX: (content: string, frontmatter?: Record<string, unknown>, filePath?: string) => Promise<MdxBundle>, adapter: RuntimeAdapter, options?: {
|
|
10
18
|
params?: Record<string, string | string[]>;
|
|
11
19
|
precompiledModule?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-rendering.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/page-rendering.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,YAAY,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAOrG,UAAU,aAAa;IACrB,WAAW,EAAE,YAAY,CAAC,YAAY,CAAC;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,aAAa,EAC/B,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC,SAAS,CAAC,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"page-rendering.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/page-rendering.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,YAAY,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAOrG,UAAU,aAAa;IACrB,WAAW,EAAE,YAAY,CAAC,YAAY,CAAC;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,UAAU,sBAAsB;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACA,OAAO,CAAC,sBAAsB,CAAC,CA4CjC;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,aAAa,EAC/B,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC,SAAS,CAAC,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,OAAO,CAAC,aAAa,CAAC,CAgFxB"}
|
|
@@ -5,28 +5,39 @@ import { getProjectReact } from "../react/index.js";
|
|
|
5
5
|
import { compileContent } from "../transforms/mdx/compiler/index.js";
|
|
6
6
|
import { ensureError, getErrorMessage } from "../errors/veryfront-error.js";
|
|
7
7
|
import { withSpan } from "../observability/tracing/otlp-setup.js";
|
|
8
|
+
export async function prepareMDXPageBundles(pageInfo, projectDir, options) {
|
|
9
|
+
const { frontmatter, content, path } = pageInfo.entity;
|
|
10
|
+
const fmArg = frontmatter && Object.keys(frontmatter).length > 0 ? frontmatter : undefined;
|
|
11
|
+
const ssrBundle = await compileContent("development", projectDir, content, fmArg, path, "server", undefined, options?.studioEmbed);
|
|
12
|
+
const pageBundle = ssrBundle;
|
|
13
|
+
if (options?.precompiledModule) {
|
|
14
|
+
pageBundle.clientModuleCode = options.precompiledModule;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
const browserBundle = await compileContent("development", projectDir, content, fmArg, path, "browser", undefined, options?.studioEmbed);
|
|
18
|
+
pageBundle.clientModuleCode = browserBundle.compiledCode;
|
|
19
|
+
}
|
|
20
|
+
const clientModuleCode = pageBundle.clientModuleCode;
|
|
21
|
+
if (!clientModuleCode) {
|
|
22
|
+
throw RENDER_ERROR.create({
|
|
23
|
+
detail: "MDX compilation produced no client module code",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
pageBundle,
|
|
28
|
+
serverModuleCode: ssrBundle.compiledCode,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
8
31
|
export function handleMDXPage(pageInfo, slug, projectDir, mergedComponents, _compileMDX, adapter, options) {
|
|
9
32
|
return withSpan("rendering.handleMDXPage", async () => {
|
|
10
|
-
const { frontmatter,
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
33
|
+
const { frontmatter, path } = pageInfo.entity;
|
|
34
|
+
const { pageBundle, serverModuleCode } = await prepareMDXPageBundles(pageInfo, projectDir, {
|
|
35
|
+
precompiledModule: options?.precompiledModule,
|
|
36
|
+
studioEmbed: options?.studioEmbed,
|
|
37
|
+
});
|
|
14
38
|
let collectedMetadata = {};
|
|
15
39
|
try {
|
|
16
|
-
|
|
17
|
-
pageBundle.clientModuleCode = options.precompiledModule;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const browserBundle = await compileContent("development", projectDir, content, fmArg, path, "browser", undefined, options?.studioEmbed);
|
|
21
|
-
pageBundle.clientModuleCode = browserBundle.compiledCode;
|
|
22
|
-
}
|
|
23
|
-
const clientModuleCode = pageBundle.clientModuleCode;
|
|
24
|
-
if (!clientModuleCode) {
|
|
25
|
-
throw RENDER_ERROR.create({
|
|
26
|
-
detail: "MDX compilation produced no client module code",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const mod = (await mdxRenderer.loadModuleESM(clientModuleCode, adapter, options?.projectId, projectDir, options?.projectSlug, options?.contentSourceId));
|
|
40
|
+
const mod = (await mdxRenderer.loadModuleESM(serverModuleCode, adapter, options?.projectId, projectDir, options?.projectSlug, options?.contentSourceId));
|
|
30
41
|
const MDXComp = mod.MDXContent || mod.default;
|
|
31
42
|
if (!MDXComp) {
|
|
32
43
|
throw RENDER_ERROR.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/src/task/runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/src/task/runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,EAAE,cAAc,CAAC;IAErB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IAEjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAkC7E"}
|
package/esm/src/task/runner.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { logger as baseLogger } from "../utils/index.js";
|
|
8
8
|
import { env as getProcessEnv } from "../platform/compat/process.js";
|
|
9
|
+
import { buildTaskContextEnv } from "../jobs/runtime-env.js";
|
|
9
10
|
const logger = baseLogger.component("task-runner");
|
|
10
11
|
/**
|
|
11
12
|
* Run a task with the given options
|
|
@@ -17,12 +18,7 @@ export async function runTask(options) {
|
|
|
17
18
|
logger.info(`Running task "${task.id}" (${task.name})`);
|
|
18
19
|
}
|
|
19
20
|
const allEnv = getProcessEnv();
|
|
20
|
-
const env = envAllowlist
|
|
21
|
-
? Object.fromEntries(envAllowlist.flatMap((k) => {
|
|
22
|
-
const value = allEnv[k];
|
|
23
|
-
return value === undefined ? [] : [[k, value]];
|
|
24
|
-
}))
|
|
25
|
-
: { ...allEnv };
|
|
21
|
+
const env = buildTaskContextEnv(allEnv, envAllowlist);
|
|
26
22
|
const ctx = {
|
|
27
23
|
env,
|
|
28
24
|
config,
|
|
@@ -32,5 +32,9 @@ export declare function clearHttpBundleCache(): Promise<void>;
|
|
|
32
32
|
* Call this on server startup to prevent stale module issues.
|
|
33
33
|
*/
|
|
34
34
|
export declare function clearAllLocalCaches(): Promise<void>;
|
|
35
|
-
export declare function lookupMdxEsmCache(filePath: string, cacheDir: string, projectDir?: string, _contentHash?: string
|
|
35
|
+
export declare function lookupMdxEsmCache(filePath: string, cacheDir: string, projectDir?: string, _contentHash?: string, // Intentionally unused - kept for API compatibility
|
|
36
|
+
recoveryOptions?: {
|
|
37
|
+
projectId: string;
|
|
38
|
+
contentSourceId: string;
|
|
39
|
+
}): Promise<CacheLookupResult>;
|
|
36
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAI5D,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAI9D,eAAO,MAAM,kBAAkB,wBAE7B,CAAC;AA0GH,wBAAgB,UAAU,IAAI,UAAU,CAGvC;AAKD,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAsBvF;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAQD,2DAA2D;AAC3D,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CA0ElE;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAevD;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAc1D;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIzD;AAeD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EAAE,oDAAoD;AAC3E,eAAe,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,iBAAiB,CAAC,CAwH5B"}
|
|
@@ -12,6 +12,7 @@ import { createFileSystem, isNotFoundError, } from "../../../../platform/compat/
|
|
|
12
12
|
import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
13
13
|
import { LRUCache } from "../../../../utils/lru-wrapper.js";
|
|
14
14
|
import { buildMdxEsmPathCacheKey, MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE } from "../cache-format.js";
|
|
15
|
+
import { ensureMdxModuleDependencies } from "../module-fetcher/dependency-recovery.js";
|
|
15
16
|
const MAX_VERIFIED_MODULE_DEPS = 2_000;
|
|
16
17
|
export const verifiedModuleDeps = new LRUCache({
|
|
17
18
|
maxEntries: MAX_VERIFIED_MODULE_DEPS,
|
|
@@ -285,7 +286,8 @@ function toMdxEsmCacheKey(filePath, projectDir) {
|
|
|
285
286
|
const jsPath = relativePath.replace(/\.(tsx?|jsx|mdx)$/, ".js");
|
|
286
287
|
return buildMdxEsmPathCacheKey(`_vf_modules/${jsPath}`);
|
|
287
288
|
}
|
|
288
|
-
export async function lookupMdxEsmCache(filePath, cacheDir, projectDir, _contentHash
|
|
289
|
+
export async function lookupMdxEsmCache(filePath, cacheDir, projectDir, _contentHash, // Intentionally unused - kept for API compatibility
|
|
290
|
+
recoveryOptions) {
|
|
289
291
|
const cache = await getModulePathCache(cacheDir);
|
|
290
292
|
const cacheKey = toMdxEsmCacheKey(filePath, projectDir);
|
|
291
293
|
const cachedPath = cache.get(cacheKey);
|
|
@@ -339,7 +341,21 @@ export async function lookupMdxEsmCache(filePath, cacheDir, projectDir, _content
|
|
|
339
341
|
// CRITICAL: Check that all file:// dependencies actually exist on disk.
|
|
340
342
|
// The distributed cache may contain code referencing file:// paths from other pods
|
|
341
343
|
// that don't exist locally (e.g., HTTP bundles, MDX-ESM modules).
|
|
342
|
-
|
|
344
|
+
let missingDeps = await findMissingFileDependencies(cachedCode);
|
|
345
|
+
if (missingDeps.length > 0 && recoveryOptions) {
|
|
346
|
+
const recovered = await ensureMdxModuleDependencies(cachedCode, {
|
|
347
|
+
...recoveryOptions,
|
|
348
|
+
log: logger,
|
|
349
|
+
});
|
|
350
|
+
if (recovered.recovered.length > 0) {
|
|
351
|
+
logger.debug(`${LOG_PREFIX_MDX_LOADER} Recovered cached MDX-ESM dependencies`, {
|
|
352
|
+
filePath,
|
|
353
|
+
cachedPath,
|
|
354
|
+
recovered: recovered.recovered.slice(0, 5),
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
missingDeps = await findMissingFileDependencies(cachedCode);
|
|
358
|
+
}
|
|
343
359
|
if (missingDeps.length > 0) {
|
|
344
360
|
logger.warn(`${LOG_PREFIX_MDX_LOADER} Cached module has ${missingDeps.length} missing file dependencies, invalidating`, { filePath, cachedPath, missingDeps: missingDeps.slice(0, 5) });
|
|
345
361
|
cache.delete(cacheKey);
|
|
@@ -2,9 +2,10 @@ export declare const MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE: string;
|
|
|
2
2
|
export declare const MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE: string;
|
|
3
3
|
export declare const MDX_ESM_CACHE_NAMESPACE: string;
|
|
4
4
|
export declare const FRAMEWORK_VF_MODULE_CACHE_NAMESPACE: string;
|
|
5
|
-
export declare function buildMdxEsmTransformCacheKey(projectId: string, normalizedPath: string, contentHash: string): string;
|
|
5
|
+
export declare function buildMdxEsmTransformCacheKey(projectId: string, contentSourceId: string, normalizedPath: string, contentHash: string): string;
|
|
6
6
|
export declare function buildMdxEsmPathCacheKey(normalizedPath: string): string;
|
|
7
7
|
export declare function buildMdxEsmModuleFileName(contentHash: string): string;
|
|
8
|
+
export declare function buildMdxEsmModuleRecoveryCacheKey(projectId: string, contentSourceId: string, fileName: string): string;
|
|
8
9
|
export declare function buildMdxJsxCacheFileName(filePath: string): string;
|
|
9
10
|
export declare function buildFrameworkVfModuleCacheFileName(pathHash: string, envKey: string, contentHash: string): string;
|
|
10
11
|
//# sourceMappingURL=cache-format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-format.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/cache-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cache-format.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/cache-format.ts"],"names":[],"mappings":"AAwFA,eAAO,MAAM,mCAAmC,QAA8B,CAAC;AAC/E,eAAO,MAAM,mCAAmC,QAA8B,CAAC;AAE/E,eAAO,MAAM,uBAAuB,QAGnC,CAAC;AAEF,eAAO,MAAM,mCAAmC,QAG/C,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,MAAM,CAQR;AAED,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,GACf,MAAM,CAOR;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,CAOR"}
|
|
@@ -5,8 +5,8 @@ import { hashString } from "./utils/hash.js";
|
|
|
5
5
|
const ALL_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+)/.source;
|
|
6
6
|
const MJS_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+\.mjs)/.source;
|
|
7
7
|
const CACHE_NAMESPACE_SENTINEL = "__vf_cache_namespace__";
|
|
8
|
-
function formatMdxEsmTransformCacheKey(namespace, projectId, normalizedPath, contentHash) {
|
|
9
|
-
return `${namespace}:${projectId}:${normalizedPath}:${contentHash}:ssr`;
|
|
8
|
+
function formatMdxEsmTransformCacheKey(namespace, projectId, contentSourceId, normalizedPath, contentHash) {
|
|
9
|
+
return `${namespace}:${projectId}:${contentSourceId}:${normalizedPath}:${contentHash}:ssr`;
|
|
10
10
|
}
|
|
11
11
|
function formatMdxEsmPathCacheKey(namespace, normalizedPath) {
|
|
12
12
|
return `${namespace}:${normalizedPath}`;
|
|
@@ -14,6 +14,9 @@ function formatMdxEsmPathCacheKey(namespace, normalizedPath) {
|
|
|
14
14
|
function formatMdxEsmModuleFileName(namespace, contentHash) {
|
|
15
15
|
return `vfmod-${namespace}-${contentHash}.mjs`;
|
|
16
16
|
}
|
|
17
|
+
function formatMdxEsmModuleRecoveryCacheKey(namespace, projectId, contentSourceId, fileName) {
|
|
18
|
+
return `${namespace}:${projectId}:${contentSourceId}:${fileName}:vfmod`;
|
|
19
|
+
}
|
|
17
20
|
function formatMdxJsxCacheFileName(namespace, filePath) {
|
|
18
21
|
return `jsx-${namespace}-${hashString(filePath)}.mjs`;
|
|
19
22
|
}
|
|
@@ -22,9 +25,10 @@ function formatFrameworkVfModuleCacheFileName(namespace, pathHash, envKey, conte
|
|
|
22
25
|
}
|
|
23
26
|
function buildMdxEsmCacheSchemaSample() {
|
|
24
27
|
return {
|
|
25
|
-
transformKey: formatMdxEsmTransformCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "_vf_modules/pages/index.js", "deadbeef"),
|
|
28
|
+
transformKey: formatMdxEsmTransformCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "preview-main", "_vf_modules/pages/index.js", "deadbeef"),
|
|
26
29
|
pathKey: formatMdxEsmPathCacheKey(CACHE_NAMESPACE_SENTINEL, "_vf_modules/pages/index.js"),
|
|
27
30
|
moduleFile: formatMdxEsmModuleFileName(CACHE_NAMESPACE_SENTINEL, "deadbeef"),
|
|
31
|
+
moduleRecoveryKey: formatMdxEsmModuleRecoveryCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "preview-main", formatMdxEsmModuleFileName(CACHE_NAMESPACE_SENTINEL, "deadbeef")),
|
|
28
32
|
jsxFile: formatMdxJsxCacheFileName(CACHE_NAMESPACE_SENTINEL, "/tmp/project/Button.tsx"),
|
|
29
33
|
unresolvedVfModulesPattern: UNRESOLVED_VF_MODULES_PATTERN.source,
|
|
30
34
|
allFileUrlPattern: ALL_FILE_URL_PATTERN_SOURCE,
|
|
@@ -44,8 +48,8 @@ export const MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE = ALL_FILE_URL_PATTERN_SOURCE;
|
|
|
44
48
|
export const MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE = MJS_FILE_URL_PATTERN_SOURCE;
|
|
45
49
|
export const MDX_ESM_CACHE_NAMESPACE = createCacheNamespace("mdx-esm", buildMdxEsmCacheSchemaSample());
|
|
46
50
|
export const FRAMEWORK_VF_MODULE_CACHE_NAMESPACE = createCacheNamespace("vf-framework", buildFrameworkVfModuleCacheSchemaSample());
|
|
47
|
-
export function buildMdxEsmTransformCacheKey(projectId, normalizedPath, contentHash) {
|
|
48
|
-
return formatMdxEsmTransformCacheKey(MDX_ESM_CACHE_NAMESPACE, projectId, normalizedPath, contentHash);
|
|
51
|
+
export function buildMdxEsmTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash) {
|
|
52
|
+
return formatMdxEsmTransformCacheKey(MDX_ESM_CACHE_NAMESPACE, projectId, contentSourceId, normalizedPath, contentHash);
|
|
49
53
|
}
|
|
50
54
|
export function buildMdxEsmPathCacheKey(normalizedPath) {
|
|
51
55
|
return formatMdxEsmPathCacheKey(MDX_ESM_CACHE_NAMESPACE, normalizedPath);
|
|
@@ -53,6 +57,9 @@ export function buildMdxEsmPathCacheKey(normalizedPath) {
|
|
|
53
57
|
export function buildMdxEsmModuleFileName(contentHash) {
|
|
54
58
|
return formatMdxEsmModuleFileName(MDX_ESM_CACHE_NAMESPACE, contentHash);
|
|
55
59
|
}
|
|
60
|
+
export function buildMdxEsmModuleRecoveryCacheKey(projectId, contentSourceId, fileName) {
|
|
61
|
+
return formatMdxEsmModuleRecoveryCacheKey(MDX_ESM_CACHE_NAMESPACE, projectId, contentSourceId, fileName);
|
|
62
|
+
}
|
|
56
63
|
export function buildMdxJsxCacheFileName(filePath) {
|
|
57
64
|
return formatMdxJsxCacheFileName(MDX_ESM_CACHE_NAMESPACE, filePath);
|
|
58
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/loader-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAapF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAWnE;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCnF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAW3F;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE,OAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"loader-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/loader-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAapF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAWnE;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCnF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAW3F;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE,OAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,CAwGjB"}
|
|
@@ -126,6 +126,7 @@ export async function processVfModuleImports(code, imports, context, projectDir,
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
const fetcherContext = createModuleFetcherContext(context.esmCacheDir, adapter, projectDir, context.projectId, {
|
|
129
|
+
contentSourceId: context.contentSourceId,
|
|
129
130
|
reactVersion: context.reactVersion,
|
|
130
131
|
projectSlug: context.projectSlug,
|
|
131
132
|
logger: logger.child({
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* CRITICAL: The :ssr suffix is required to avoid cache collisions with browser-mode transforms
|
|
11
11
|
* that use relative paths (../lib/utils.js) instead of absolute paths (/_vf_modules/lib/utils.js).
|
|
12
12
|
*/
|
|
13
|
-
export declare function getTransformCacheKey(projectId: string, normalizedPath: string, contentHash: string): string;
|
|
13
|
+
export declare function getTransformCacheKey(projectId: string, contentSourceId: string, normalizedPath: string, contentHash: string): string;
|
|
14
14
|
export declare function getVersionedPathCacheKey(normalizedPath: string): string;
|
|
15
15
|
//# sourceMappingURL=cache-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-keys.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
1
|
+
{"version":3,"file":"cache-keys.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
@@ -11,8 +11,8 @@ import { buildMdxEsmPathCacheKey, buildMdxEsmTransformCacheKey } from "../cache-
|
|
|
11
11
|
* CRITICAL: The :ssr suffix is required to avoid cache collisions with browser-mode transforms
|
|
12
12
|
* that use relative paths (../lib/utils.js) instead of absolute paths (/_vf_modules/lib/utils.js).
|
|
13
13
|
*/
|
|
14
|
-
export function getTransformCacheKey(projectId, normalizedPath, contentHash) {
|
|
15
|
-
return buildMdxEsmTransformCacheKey(projectId, normalizedPath, contentHash);
|
|
14
|
+
export function getTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash) {
|
|
15
|
+
return buildMdxEsmTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash);
|
|
16
16
|
}
|
|
17
17
|
export function getVersionedPathCacheKey(normalizedPath) {
|
|
18
18
|
return buildMdxEsmPathCacheKey(normalizedPath);
|