@absolutejs/absolute 0.19.0-beta.134 → 0.19.0-beta.136
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +36 -82
- package/dist/build.js.map +3 -3
- package/dist/index.js +36 -82
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -171258,7 +171258,7 @@ import {
|
|
|
171258
171258
|
statSync,
|
|
171259
171259
|
writeFileSync as writeFileSync3
|
|
171260
171260
|
} from "fs";
|
|
171261
|
-
import { basename as basename5,
|
|
171261
|
+
import { basename as basename5, join as join13, relative as relative7, resolve as resolve11 } from "path";
|
|
171262
171262
|
import { cwd, env as env2, exit } from "process";
|
|
171263
171263
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171264
171264
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171538,13 +171538,23 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171538
171538
|
...angularServerPaths
|
|
171539
171539
|
];
|
|
171540
171540
|
const reactClientEntryPoints = [...reactEntries];
|
|
171541
|
+
const allFrameworkDirs = [
|
|
171542
|
+
reactDir,
|
|
171543
|
+
svelteDir,
|
|
171544
|
+
vueDir,
|
|
171545
|
+
angularDir,
|
|
171546
|
+
htmlDir,
|
|
171547
|
+
htmxDir
|
|
171548
|
+
].filter((d) => Boolean(d));
|
|
171549
|
+
const urlReferencedFiles = await scanWorkerReferences(allFrameworkDirs);
|
|
171541
171550
|
const nonReactClientEntryPoints = [
|
|
171542
171551
|
...svelteIndexPaths,
|
|
171543
171552
|
...svelteClientPaths,
|
|
171544
171553
|
...htmlEntries,
|
|
171545
171554
|
...vueIndexPaths,
|
|
171546
171555
|
...vueClientPaths,
|
|
171547
|
-
...angularClientPaths
|
|
171556
|
+
...angularClientPaths,
|
|
171557
|
+
...urlReferencedFiles
|
|
171548
171558
|
];
|
|
171549
171559
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
171550
171560
|
logWarn("No entry points found, manifest will be empty");
|
|
@@ -171719,15 +171729,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171719
171729
|
if (hmr && reactClientOutputPaths.length > 0) {
|
|
171720
171730
|
await patchRefreshGlobals(reactClientOutputPaths);
|
|
171721
171731
|
}
|
|
171722
|
-
const frameworkDirs = [
|
|
171723
|
-
reactDir,
|
|
171724
|
-
svelteDir,
|
|
171725
|
-
vueDir,
|
|
171726
|
-
angularDir,
|
|
171727
|
-
htmlDir,
|
|
171728
|
-
htmxDir
|
|
171729
|
-
].filter((d) => Boolean(d));
|
|
171730
|
-
const workerEntryPoints = await scanWorkerReferences(frameworkDirs);
|
|
171731
171732
|
const nonReactClientLogs = nonReactClientResult?.logs ?? [];
|
|
171732
171733
|
const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
|
|
171733
171734
|
if (nonReactClientResult && !nonReactClientResult.success && nonReactClientLogs.length > 0) {
|
|
@@ -171758,32 +171759,39 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171758
171759
|
if (vueCssResult && !vueCssResult.success && vueCssResult.logs.length > 0) {
|
|
171759
171760
|
extractBuildError(vueCssResult.logs, "vue-css", "Vue CSS", frameworkNames, isIncremental, throwOnError);
|
|
171760
171761
|
}
|
|
171761
|
-
if (
|
|
171762
|
+
if (urlReferencedFiles.length > 0) {
|
|
171762
171763
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
171763
171764
|
const allClientOutputPaths = [
|
|
171764
171765
|
...reactClientOutputPaths,
|
|
171765
171766
|
...nonReactClientOutputs.map((a) => a.path)
|
|
171766
171767
|
];
|
|
171767
|
-
const
|
|
171768
|
-
|
|
171769
|
-
for (const
|
|
171770
|
-
const
|
|
171771
|
-
|
|
171772
|
-
|
|
171773
|
-
|
|
171774
|
-
|
|
171775
|
-
|
|
171768
|
+
const urlFileMap = new Map;
|
|
171769
|
+
if (hmr) {
|
|
171770
|
+
for (const srcPath of urlReferencedFiles) {
|
|
171771
|
+
const rel = relative7(projectRoot, srcPath).replace(/\\/g, "/");
|
|
171772
|
+
const name = basename5(srcPath);
|
|
171773
|
+
const url = `/@src/${rel}`;
|
|
171774
|
+
urlFileMap.set(name, url);
|
|
171775
|
+
urlFileMap.set(name.replace(/\.tsx?$/, ".js"), url);
|
|
171776
|
+
}
|
|
171777
|
+
} else {
|
|
171778
|
+
for (const srcPath of urlReferencedFiles) {
|
|
171779
|
+
const srcBase = basename5(srcPath).replace(/\.[^.]+$/, "");
|
|
171780
|
+
const output = nonReactClientOutputs.find((a) => basename5(a.path).startsWith(srcBase + "."));
|
|
171781
|
+
if (output) {
|
|
171782
|
+
urlFileMap.set(basename5(srcPath), "/" + relative7(buildPath, output.path).replace(/\\/g, "/"));
|
|
171783
|
+
}
|
|
171784
|
+
}
|
|
171785
|
+
}
|
|
171776
171786
|
for (const outputPath of allClientOutputPaths) {
|
|
171777
171787
|
let content = readFileSync5(outputPath, "utf-8");
|
|
171778
171788
|
let changed = false;
|
|
171779
|
-
const frameworkDir = detectFramework(outputPath);
|
|
171780
171789
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
171781
171790
|
const targetName = basename5(relPath);
|
|
171782
|
-
const
|
|
171783
|
-
if (
|
|
171784
|
-
const rel = relative7(projectRoot, workerSrc);
|
|
171791
|
+
const resolvedPath = urlFileMap.get(targetName);
|
|
171792
|
+
if (resolvedPath) {
|
|
171785
171793
|
changed = true;
|
|
171786
|
-
return `new URL('
|
|
171794
|
+
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
171787
171795
|
}
|
|
171788
171796
|
return _match;
|
|
171789
171797
|
});
|
|
@@ -171791,59 +171799,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171791
171799
|
writeFileSync3(outputPath, content);
|
|
171792
171800
|
}
|
|
171793
171801
|
}
|
|
171794
|
-
let workerOutputs = [];
|
|
171795
|
-
if (workerEntryPoints.length > 0) {
|
|
171796
|
-
const workerResult = await bunBuild6({
|
|
171797
|
-
entrypoints: workerEntryPoints,
|
|
171798
|
-
format: "esm",
|
|
171799
|
-
minify: !isDev,
|
|
171800
|
-
naming: "[dir]/[name].[hash].[ext]",
|
|
171801
|
-
outdir: buildPath,
|
|
171802
|
-
root: commonAncestor(workerEntryPoints.map((p) => dirname6(p))),
|
|
171803
|
-
target: "browser",
|
|
171804
|
-
throw: false
|
|
171805
|
-
});
|
|
171806
|
-
if (workerResult.success) {
|
|
171807
|
-
workerOutputs = workerResult.outputs;
|
|
171808
|
-
const workerUrlMap = new Map;
|
|
171809
|
-
for (const artifact of workerOutputs) {
|
|
171810
|
-
for (const ep of workerEntryPoints) {
|
|
171811
|
-
const epBase = basename5(ep).replace(/\.[^.]+$/, "");
|
|
171812
|
-
if (basename5(artifact.path).startsWith(epBase)) {
|
|
171813
|
-
workerUrlMap.set(ep, "/" + relative7(buildPath, artifact.path));
|
|
171814
|
-
}
|
|
171815
|
-
}
|
|
171816
|
-
}
|
|
171817
|
-
const allClientOutputPaths = [
|
|
171818
|
-
...reactClientOutputPaths,
|
|
171819
|
-
...nonReactClientOutputs.map((a) => a.path)
|
|
171820
|
-
];
|
|
171821
|
-
for (const outputPath of allClientOutputPaths) {
|
|
171822
|
-
let content = readFileSync5(outputPath, "utf-8");
|
|
171823
|
-
let changed = false;
|
|
171824
|
-
for (const [srcPath, hashedPath] of workerUrlMap) {
|
|
171825
|
-
const srcRelPatterns = [
|
|
171826
|
-
"./" + relative7(buildPath, srcPath),
|
|
171827
|
-
"../" + relative7(buildPath, srcPath),
|
|
171828
|
-
relative7(buildPath, srcPath)
|
|
171829
|
-
];
|
|
171830
|
-
for (const pattern of srcRelPatterns) {
|
|
171831
|
-
if (content.includes(pattern)) {
|
|
171832
|
-
content = content.replaceAll(pattern, hashedPath);
|
|
171833
|
-
changed = true;
|
|
171834
|
-
}
|
|
171835
|
-
}
|
|
171836
|
-
}
|
|
171837
|
-
if (changed)
|
|
171838
|
-
writeFileSync3(outputPath, content);
|
|
171839
|
-
}
|
|
171840
|
-
} else {
|
|
171841
|
-
const workerLogs = workerResult.logs;
|
|
171842
|
-
if (workerLogs.length > 0) {
|
|
171843
|
-
extractBuildError(workerLogs, "worker", "Worker", frameworkNames, isIncremental, throwOnError);
|
|
171844
|
-
}
|
|
171845
|
-
}
|
|
171846
|
-
}
|
|
171847
171802
|
const allLogs = [
|
|
171848
171803
|
...serverLogs,
|
|
171849
171804
|
...reactClientLogs,
|
|
@@ -171857,8 +171812,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171857
171812
|
...serverOutputs,
|
|
171858
171813
|
...reactClientOutputs,
|
|
171859
171814
|
...nonReactClientOutputs,
|
|
171860
|
-
...cssOutputs
|
|
171861
|
-
...workerOutputs
|
|
171815
|
+
...cssOutputs
|
|
171862
171816
|
], buildPath)
|
|
171863
171817
|
};
|
|
171864
171818
|
for (const artifact of serverOutputs) {
|
|
@@ -205745,5 +205699,5 @@ export {
|
|
|
205745
205699
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205746
205700
|
};
|
|
205747
205701
|
|
|
205748
|
-
//# debugId=
|
|
205702
|
+
//# debugId=7DC4A54EB02475EB64756E2164756E21
|
|
205749
205703
|
//# sourceMappingURL=index.js.map
|