veryfront 0.1.840 → 0.1.841
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/release-assets/build-executor.d.ts +2 -2
- package/esm/src/release-assets/build-executor.d.ts.map +1 -1
- package/esm/src/release-assets/build-executor.js +26 -56
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* uploads each asset, then assembles and PUTs the manifest (→ ready).
|
|
9
9
|
*
|
|
10
10
|
* Defensive by construction:
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
11
|
+
* - Browser graph failures that can fall back to JIT are recorded as gaps.
|
|
12
|
+
* - Other build failures (list/hash/upload/PUT) report `failed`.
|
|
13
13
|
* - The temp dir is always cleaned up by the caller.
|
|
14
14
|
*
|
|
15
15
|
* @module release-assets/build-executor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+BH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA0B/C,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,YAAY,CAAC,EAA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C,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,GAAG,OAAO,CAAC;IACV,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC5C,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC,CAqCD;AA4DD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC,CA2ClC"}
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
* uploads each asset, then assembles and PUTs the manifest (→ ready).
|
|
9
9
|
*
|
|
10
10
|
* Defensive by construction:
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
11
|
+
* - Browser graph failures that can fall back to JIT are recorded as gaps.
|
|
12
|
+
* - Other build failures (list/hash/upload/PUT) report `failed`.
|
|
13
13
|
* - The temp dir is always cleaned up by the caller.
|
|
14
14
|
*
|
|
15
15
|
* @module release-assets/build-executor
|
|
16
16
|
*/
|
|
17
17
|
import { serverLogger } from "../utils/index.js";
|
|
18
18
|
import { VERSION } from "../utils/version.js";
|
|
19
|
-
import { resolve } from "../extensions/contracts.js";
|
|
20
19
|
import { createFileSystem } from "../platform/compat/fs.js";
|
|
21
20
|
import { getHostEnv } from "../platform/compat/process.js";
|
|
22
21
|
import { dirname, join, normalize } from "../platform/compat/path/index.js";
|
|
@@ -88,46 +87,6 @@ function isBrowserModule(path) {
|
|
|
88
87
|
return false;
|
|
89
88
|
return BROWSER_MODULE_DIRS.some((dir) => path.startsWith(dir));
|
|
90
89
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Statically resolve runtime imports in a TS/JSX source file to logical paths.
|
|
93
|
-
* Uses the CodeParser AST contract so type-only imports do not enter route
|
|
94
|
-
* preload closure.
|
|
95
|
-
*/
|
|
96
|
-
async function collectStaticProjectModuleImports(source, moduleLogicalPath, knownPaths) {
|
|
97
|
-
return await collectAstStaticProjectModuleImports(source, moduleLogicalPath, knownPaths);
|
|
98
|
-
}
|
|
99
|
-
function readModuleSource(node) {
|
|
100
|
-
return typeof node.source?.value === "string" ? node.source.value : null;
|
|
101
|
-
}
|
|
102
|
-
function isTypeOnlyModuleDeclaration(node) {
|
|
103
|
-
if (node.importKind === "type" || node.exportKind === "type")
|
|
104
|
-
return true;
|
|
105
|
-
if (!node.specifiers?.length)
|
|
106
|
-
return false;
|
|
107
|
-
return node.specifiers.every((specifier) => specifier.importKind === "type" || specifier.exportKind === "type");
|
|
108
|
-
}
|
|
109
|
-
async function collectAstStaticProjectModuleImports(source, moduleLogicalPath, knownPaths) {
|
|
110
|
-
const parser = resolve("CodeParser");
|
|
111
|
-
const ast = await parser.parse({ code: source, filePath: moduleLogicalPath });
|
|
112
|
-
const results = new Set();
|
|
113
|
-
const visit = (path) => {
|
|
114
|
-
const node = path.node;
|
|
115
|
-
if (isTypeOnlyModuleDeclaration(node))
|
|
116
|
-
return;
|
|
117
|
-
const specifier = readModuleSource(node);
|
|
118
|
-
if (!specifier)
|
|
119
|
-
return;
|
|
120
|
-
const importedPath = resolveProjectModuleSpecifier(specifier, moduleLogicalPath, knownPaths);
|
|
121
|
-
if (importedPath)
|
|
122
|
-
results.add(importedPath);
|
|
123
|
-
};
|
|
124
|
-
parser.traverse(ast, {
|
|
125
|
-
ImportDeclaration: visit,
|
|
126
|
-
ExportNamedDeclaration: visit,
|
|
127
|
-
ExportAllDeclaration: visit,
|
|
128
|
-
});
|
|
129
|
-
return [...results];
|
|
130
|
-
}
|
|
131
90
|
function resolveKnownModulePath(path, knownPaths) {
|
|
132
91
|
const normalized = normalizeLogicalPath(path
|
|
133
92
|
.replace(/^\/?_vf_modules\//, "")
|
|
@@ -956,11 +915,11 @@ function addFrameworkDependencyUrlAliases(urls, dependencies) {
|
|
|
956
915
|
}
|
|
957
916
|
}
|
|
958
917
|
/**
|
|
959
|
-
* Walk the
|
|
918
|
+
* Walk the transformed import graph from a set of entry points using BFS.
|
|
960
919
|
* Returns all reachable logical paths (entries included).
|
|
961
|
-
* Modules not in `
|
|
920
|
+
* Modules not in `transformedModules` are recorded as closure gaps.
|
|
962
921
|
*/
|
|
963
|
-
async function
|
|
922
|
+
async function collectRouteClosure(entrypoints, transformedModules, knownPaths) {
|
|
964
923
|
const visited = new Set();
|
|
965
924
|
const queue = [...entrypoints];
|
|
966
925
|
const gaps = [];
|
|
@@ -969,16 +928,27 @@ async function collectClosure(entrypoints, sourceByPath, knownPaths) {
|
|
|
969
928
|
if (visited.has(current))
|
|
970
929
|
continue;
|
|
971
930
|
visited.add(current);
|
|
972
|
-
const
|
|
973
|
-
if (!
|
|
974
|
-
// Module referenced but not
|
|
931
|
+
const transformed = transformedModules.get(current);
|
|
932
|
+
if (!transformed) {
|
|
933
|
+
// Module referenced but not transformable or not successfully transformed.
|
|
975
934
|
gaps.push(`closure-missing:${current}`);
|
|
976
935
|
continue;
|
|
977
936
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
937
|
+
let imports;
|
|
938
|
+
try {
|
|
939
|
+
imports = await collectProjectModuleImports(transformed.code, current, knownPaths);
|
|
940
|
+
}
|
|
941
|
+
catch (error) {
|
|
942
|
+
pushGap(gaps, `closure-import-parse-failed:${current}`);
|
|
943
|
+
logger.warn("Route closure import parse failed during release asset build", {
|
|
944
|
+
path: current,
|
|
945
|
+
error: sanitizeError(error),
|
|
946
|
+
});
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
for (const importedPath of imports.values()) {
|
|
950
|
+
if (!visited.has(importedPath))
|
|
951
|
+
queue.push(importedPath);
|
|
982
952
|
}
|
|
983
953
|
}
|
|
984
954
|
return { modules: [...visited], gaps };
|
|
@@ -1248,15 +1218,15 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
1248
1218
|
// M3: drop bytes immediately after upload.
|
|
1249
1219
|
pendingBytes.delete(asset.contentHash);
|
|
1250
1220
|
});
|
|
1251
|
-
// B2. Routes: walk the
|
|
1252
|
-
// Modules
|
|
1221
|
+
// B2. Routes: walk the transformed browser import closure from each page entrypoint.
|
|
1222
|
+
// Modules missing from transformedModules are recorded as closure gaps.
|
|
1253
1223
|
const routes = {};
|
|
1254
1224
|
const pageModules = Object.keys(modules).filter((p) => p.startsWith("pages/"));
|
|
1255
1225
|
for (const logicalPath of pageModules) {
|
|
1256
1226
|
const route = routeForPage(logicalPath);
|
|
1257
1227
|
if (!route)
|
|
1258
1228
|
continue;
|
|
1259
|
-
const { modules: closureModules, gaps: closureGaps } = await
|
|
1229
|
+
const { modules: closureModules, gaps: closureGaps } = await collectRouteClosure([logicalPath], transformedModules, knownPaths);
|
|
1260
1230
|
// Include only modules we actually have in the manifest (transformed +
|
|
1261
1231
|
// within size limit). Framework lib/* modules are excluded per contract
|
|
1262
1232
|
// (they are embedded by the runtime, not shipped as release assets).
|