@absolutejs/absolute 0.19.0-beta.780 → 0.19.0-beta.781
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/dist/build.js +3 -1
- package/dist/build.js.map +3 -3
- package/dist/cli/index.js +59 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -890,6 +890,7 @@ var {env: env3 } = globalThis.Bun;
|
|
|
890
890
|
import {
|
|
891
891
|
cpSync,
|
|
892
892
|
existsSync as existsSync9,
|
|
893
|
+
mkdirSync as mkdirSync5,
|
|
893
894
|
readdirSync as readdirSync2,
|
|
894
895
|
readFileSync as readFileSync9,
|
|
895
896
|
rmSync as rmSync2,
|
|
@@ -917,6 +918,47 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
917
918
|
result.push(fullPath);
|
|
918
919
|
}
|
|
919
920
|
return result;
|
|
921
|
+
}, SERVER_RUNTIME_ASSET_RE, SERVER_RUNTIME_SOURCE_EXTENSIONS, SERVER_RUNTIME_SCAN_SKIP_DIRS, hasSourceExtension = (filePath) => SERVER_RUNTIME_SOURCE_EXTENSIONS.has(filePath.slice(filePath.lastIndexOf("."))), collectProjectSourceFiles = (dir) => {
|
|
922
|
+
const result = [];
|
|
923
|
+
let pending = readdirSync2(dir, { withFileTypes: true });
|
|
924
|
+
while (pending.length > 0) {
|
|
925
|
+
const entry = pending.pop();
|
|
926
|
+
if (!entry)
|
|
927
|
+
continue;
|
|
928
|
+
const fullPath = join6(entry.parentPath, entry.name);
|
|
929
|
+
if (entry.isDirectory()) {
|
|
930
|
+
if (SERVER_RUNTIME_SCAN_SKIP_DIRS.has(entry.name))
|
|
931
|
+
continue;
|
|
932
|
+
pending = pending.concat(readdirSync2(fullPath, { withFileTypes: true }));
|
|
933
|
+
} else if (hasSourceExtension(fullPath)) {
|
|
934
|
+
result.push(fullPath);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
return result;
|
|
938
|
+
}, copyServerRuntimeAssetReferences = (outdir) => {
|
|
939
|
+
const copied = new Set;
|
|
940
|
+
const normalizedOutdir = resolve8(outdir);
|
|
941
|
+
for (const filePath of collectProjectSourceFiles(process.cwd())) {
|
|
942
|
+
const source = readFileSync9(filePath, "utf-8");
|
|
943
|
+
SERVER_RUNTIME_ASSET_RE.lastIndex = 0;
|
|
944
|
+
let match;
|
|
945
|
+
while ((match = SERVER_RUNTIME_ASSET_RE.exec(source)) !== null) {
|
|
946
|
+
const relPath = match[1];
|
|
947
|
+
if (!relPath)
|
|
948
|
+
continue;
|
|
949
|
+
const assetSource = resolve8(dirname2(filePath), relPath);
|
|
950
|
+
if (!existsSync9(assetSource) || !statSync(assetSource).isFile())
|
|
951
|
+
continue;
|
|
952
|
+
const assetTarget = resolve8(normalizedOutdir, relPath.replace(/^\.\//, ""));
|
|
953
|
+
if (assetTarget !== normalizedOutdir && !assetTarget.startsWith(`${normalizedOutdir}/`))
|
|
954
|
+
continue;
|
|
955
|
+
if (copied.has(assetTarget))
|
|
956
|
+
continue;
|
|
957
|
+
copied.add(assetTarget);
|
|
958
|
+
mkdirSync5(dirname2(assetTarget), { recursive: true });
|
|
959
|
+
cpSync(assetSource, assetTarget, { force: true });
|
|
960
|
+
}
|
|
961
|
+
}
|
|
920
962
|
}, readPackageVersion4 = (candidate) => {
|
|
921
963
|
try {
|
|
922
964
|
const pkg = JSON.parse(readFileSync9(candidate, "utf-8"));
|
|
@@ -1584,6 +1626,7 @@ console.log(\`
|
|
|
1584
1626
|
process.exit(1);
|
|
1585
1627
|
}
|
|
1586
1628
|
console.log(` \x1B[2m(${getDurationString(performance.now() - bundleStart)})\x1B[0m`);
|
|
1629
|
+
copyServerRuntimeAssetReferences(resolvedOutdir);
|
|
1587
1630
|
const prerenderStart = performance.now();
|
|
1588
1631
|
process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
|
|
1589
1632
|
rmSync2(join6(resolvedOutdir, "_prerendered"), {
|
|
@@ -1649,6 +1692,22 @@ var init_compile = __esm(() => {
|
|
|
1649
1692
|
init_startupBanner();
|
|
1650
1693
|
init_telemetryEvent();
|
|
1651
1694
|
init_utils();
|
|
1695
|
+
SERVER_RUNTIME_ASSET_RE = /new\s+URL\(\s*["'](\.\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
1696
|
+
SERVER_RUNTIME_SOURCE_EXTENSIONS = new Set([
|
|
1697
|
+
".cjs",
|
|
1698
|
+
".js",
|
|
1699
|
+
".jsx",
|
|
1700
|
+
".mjs",
|
|
1701
|
+
".ts",
|
|
1702
|
+
".tsx"
|
|
1703
|
+
]);
|
|
1704
|
+
SERVER_RUNTIME_SCAN_SKIP_DIRS = new Set([
|
|
1705
|
+
".absolutejs",
|
|
1706
|
+
".git",
|
|
1707
|
+
"build",
|
|
1708
|
+
"dist",
|
|
1709
|
+
"node_modules"
|
|
1710
|
+
]);
|
|
1652
1711
|
jsxDevRuntimeCompatPath2 = resolveJsxDevRuntimeCompatPath2();
|
|
1653
1712
|
RUNTIME_JS_EXTENSIONS = [".js", ".mjs", ".cjs"];
|
|
1654
1713
|
MODULE_SPECIFIER_RE = /(from\s*|import\s*|import\(\s*|require\(\s*)(["'])([^"']+)\2/g;
|
package/dist/index.js
CHANGED
|
@@ -10292,6 +10292,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10292
10292
|
return filePath.replace(/\.vue$/, ".js");
|
|
10293
10293
|
if (filePath.endsWith(".ts"))
|
|
10294
10294
|
return filePath.replace(/\.ts$/, ".js");
|
|
10295
|
+
if (isStylePath(filePath))
|
|
10296
|
+
return filePath;
|
|
10295
10297
|
return `${filePath}.js`;
|
|
10296
10298
|
}, stripExports = (code) => code.replace(/export\s+default/, "const script =").replace(/^export\s+/gm, ""), mergeVueImports = (code) => {
|
|
10297
10299
|
const lines = code.split(`
|
|
@@ -26403,5 +26405,5 @@ export {
|
|
|
26403
26405
|
ANGULAR_INIT_TIMEOUT_MS
|
|
26404
26406
|
};
|
|
26405
26407
|
|
|
26406
|
-
//# debugId=
|
|
26408
|
+
//# debugId=8EDB0B5EB8B1561264756E2164756E21
|
|
26407
26409
|
//# sourceMappingURL=index.js.map
|