@absolutejs/absolute 0.19.0-beta.80 → 0.19.0-beta.81
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 +53 -74
- package/dist/build.js.map +5 -6
- package/dist/index.js +55 -76
- package/dist/index.js.map +5 -6
- package/dist/src/build/freshBuildWorker.d.ts +1 -0
- package/dist/src/dev/pathUtils.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -133,38 +133,6 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
|
|
|
133
133
|
</html>`;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
// src/build/freshReadPlugin.ts
|
|
137
|
-
import { readFileSync } from "fs";
|
|
138
|
-
var createFreshReadPlugin = (changedFiles) => {
|
|
139
|
-
const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
|
|
140
|
-
return {
|
|
141
|
-
name: "fresh-read",
|
|
142
|
-
setup(build2) {
|
|
143
|
-
build2.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
|
|
144
|
-
const normalized = args.path.replace(/\\/g, "/");
|
|
145
|
-
if (changed.has(normalized)) {
|
|
146
|
-
console.log(`[fresh-read] HIT: ${normalized.split("/").slice(-2).join("/")}`);
|
|
147
|
-
}
|
|
148
|
-
if (!changed.has(normalized))
|
|
149
|
-
return;
|
|
150
|
-
const contents = readFileSync(args.path, "utf-8");
|
|
151
|
-
const ext = args.path.split(".").pop();
|
|
152
|
-
const loaderMap = {
|
|
153
|
-
ts: "ts",
|
|
154
|
-
tsx: "tsx",
|
|
155
|
-
js: "js",
|
|
156
|
-
jsx: "jsx"
|
|
157
|
-
};
|
|
158
|
-
return {
|
|
159
|
-
contents,
|
|
160
|
-
loader: loaderMap[ext ?? ""] ?? "ts"
|
|
161
|
-
};
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
var init_freshReadPlugin = () => {};
|
|
167
|
-
|
|
168
136
|
// src/utils/normalizePath.ts
|
|
169
137
|
var normalizePath = (path) => path.replace(/\\/g, "/");
|
|
170
138
|
|
|
@@ -653,14 +621,14 @@ var scanCssEntryPoints = async (dir, ignore) => {
|
|
|
653
621
|
var init_scanCssEntryPoints = () => {};
|
|
654
622
|
|
|
655
623
|
// src/cli/scripts/telemetry.ts
|
|
656
|
-
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync
|
|
624
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
657
625
|
import { homedir } from "os";
|
|
658
626
|
import { join as join2 } from "path";
|
|
659
627
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
660
628
|
try {
|
|
661
629
|
if (!existsSync4(configPath))
|
|
662
630
|
return null;
|
|
663
|
-
const raw =
|
|
631
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
664
632
|
const config = JSON.parse(raw);
|
|
665
633
|
return config;
|
|
666
634
|
} catch {
|
|
@@ -673,14 +641,14 @@ var init_telemetry = __esm(() => {
|
|
|
673
641
|
});
|
|
674
642
|
|
|
675
643
|
// src/cli/telemetryEvent.ts
|
|
676
|
-
import { existsSync as existsSync5, readFileSync as
|
|
644
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
677
645
|
import { arch, platform } from "os";
|
|
678
646
|
import { dirname, join as join3, parse } from "path";
|
|
679
647
|
var checkCandidate = (candidate) => {
|
|
680
648
|
if (!existsSync5(candidate)) {
|
|
681
649
|
return null;
|
|
682
650
|
}
|
|
683
|
-
const pkg = JSON.parse(
|
|
651
|
+
const pkg = JSON.parse(readFileSync2(candidate, "utf-8"));
|
|
684
652
|
if (pkg.name === "@absolutejs/absolute") {
|
|
685
653
|
const ver = pkg.version;
|
|
686
654
|
return ver;
|
|
@@ -977,7 +945,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
977
945
|
};
|
|
978
946
|
|
|
979
947
|
// src/build/angularLinkerPlugin.ts
|
|
980
|
-
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as
|
|
948
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
981
949
|
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve5 } from "path";
|
|
982
950
|
import { createHash } from "crypto";
|
|
983
951
|
var CACHE_DIR, angularLinkerPlugin;
|
|
@@ -1004,7 +972,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1004
972
|
const cachePath = join4(CACHE_DIR, `${hash}.js`);
|
|
1005
973
|
if (existsSync7(cachePath)) {
|
|
1006
974
|
return {
|
|
1007
|
-
contents:
|
|
975
|
+
contents: readFileSync3(cachePath, "utf-8"),
|
|
1008
976
|
loader: "js"
|
|
1009
977
|
};
|
|
1010
978
|
}
|
|
@@ -1020,7 +988,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1020
988
|
fileSystem: {
|
|
1021
989
|
dirname: dirname2,
|
|
1022
990
|
exists: existsSync7,
|
|
1023
|
-
readFile:
|
|
991
|
+
readFile: readFileSync3,
|
|
1024
992
|
relative: relative2,
|
|
1025
993
|
resolve: resolve5
|
|
1026
994
|
},
|
|
@@ -170562,12 +170530,12 @@ __export(exports_compileAngular, {
|
|
|
170562
170530
|
compileAngularFile: () => compileAngularFile,
|
|
170563
170531
|
compileAngular: () => compileAngular
|
|
170564
170532
|
});
|
|
170565
|
-
import { existsSync as existsSync10, readFileSync as
|
|
170533
|
+
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170566
170534
|
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
|
|
170567
170535
|
import { createHash as createHash2 } from "crypto";
|
|
170568
170536
|
var import_typescript, computeConfigHash = () => {
|
|
170569
170537
|
try {
|
|
170570
|
-
const content =
|
|
170538
|
+
const content = readFileSync4("./tsconfig.json", "utf-8");
|
|
170571
170539
|
return createHash2("md5").update(content).digest("hex");
|
|
170572
170540
|
} catch {
|
|
170573
170541
|
return "";
|
|
@@ -171121,11 +171089,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
171121
171089
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
171122
171090
|
return;
|
|
171123
171091
|
}
|
|
171124
|
-
const { readFileSync:
|
|
171092
|
+
const { readFileSync: readFileSync5, writeFileSync: writeFileSync3, readdirSync } = await import("fs");
|
|
171125
171093
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
171126
171094
|
for (const file4 of files) {
|
|
171127
171095
|
const filePath = join11(vendorDir, file4);
|
|
171128
|
-
const content =
|
|
171096
|
+
const content = readFileSync5(filePath, "utf-8");
|
|
171129
171097
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
171130
171098
|
continue;
|
|
171131
171099
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -171247,7 +171215,7 @@ import {
|
|
|
171247
171215
|
copyFileSync,
|
|
171248
171216
|
cpSync,
|
|
171249
171217
|
mkdirSync as mkdirSync8,
|
|
171250
|
-
readFileSync as
|
|
171218
|
+
readFileSync as readFileSync5,
|
|
171251
171219
|
rmSync,
|
|
171252
171220
|
writeFileSync as writeFileSync3
|
|
171253
171221
|
} from "fs";
|
|
@@ -171322,10 +171290,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171322
171290
|
await resolveAbsoluteVersion();
|
|
171323
171291
|
const isIncremental = incrementalFiles && incrementalFiles.length > 0;
|
|
171324
171292
|
const normalizedIncrementalFiles = incrementalFiles?.map(normalizePath);
|
|
171325
|
-
const freshReadPlugins = isIncremental ? [createFreshReadPlugin(incrementalFiles)] : [];
|
|
171326
|
-
if (isIncremental) {
|
|
171327
|
-
console.log(`[build] incremental with ${incrementalFiles.length} changed files:`, incrementalFiles.map((f) => f.split("/").slice(-2).join("/")));
|
|
171328
|
-
}
|
|
171329
171293
|
const throwOnError = options?.throwOnError === true;
|
|
171330
171294
|
const hmr = options?.injectHMR === true;
|
|
171331
171295
|
const buildPath = validateSafePath(buildDirectory, projectRoot);
|
|
@@ -171583,7 +171547,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171583
171547
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171584
171548
|
outdir: buildPath,
|
|
171585
171549
|
...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
|
|
171586
|
-
plugins: [...freshReadPlugins],
|
|
171587
171550
|
root: clientRoot,
|
|
171588
171551
|
splitting: true,
|
|
171589
171552
|
target: "browser",
|
|
@@ -171629,7 +171592,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171629
171592
|
format: "esm",
|
|
171630
171593
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171631
171594
|
outdir: serverOutDir,
|
|
171632
|
-
plugins: [...freshReadPlugins],
|
|
171633
171595
|
root: serverRoot,
|
|
171634
171596
|
target: "bun",
|
|
171635
171597
|
throw: false
|
|
@@ -171648,7 +171610,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171648
171610
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171649
171611
|
outdir: buildPath,
|
|
171650
171612
|
plugins: [
|
|
171651
|
-
...freshReadPlugins,
|
|
171652
171613
|
...angularDir && !isDev ? [angularLinkerPlugin] : [],
|
|
171653
171614
|
...htmlScriptPlugin ? [htmlScriptPlugin] : []
|
|
171654
171615
|
],
|
|
@@ -171753,7 +171714,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171753
171714
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
171754
171715
|
if (!hmrClientBundle)
|
|
171755
171716
|
return;
|
|
171756
|
-
let html =
|
|
171717
|
+
let html = readFileSync5(filePath, "utf-8");
|
|
171757
171718
|
if (html.includes("data-hmr-client"))
|
|
171758
171719
|
return;
|
|
171759
171720
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -171825,7 +171786,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171825
171786
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171826
171787
|
const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
|
|
171827
171788
|
for (const file4 of indexFiles) {
|
|
171828
|
-
let content =
|
|
171789
|
+
let content = readFileSync5(join13(reactIndexesPath, file4), "utf-8");
|
|
171829
171790
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
171830
171791
|
writeFileSync3(join13(devIndexDir, file4), content);
|
|
171831
171792
|
}
|
|
@@ -171851,7 +171812,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171851
171812
|
return manifest;
|
|
171852
171813
|
};
|
|
171853
171814
|
var init_build = __esm(() => {
|
|
171854
|
-
init_freshReadPlugin();
|
|
171855
171815
|
init_generateManifest();
|
|
171856
171816
|
init_generateReactIndexes();
|
|
171857
171817
|
init_htmlScriptHMRPlugin();
|
|
@@ -171877,7 +171837,7 @@ var init_build = __esm(() => {
|
|
|
171877
171837
|
});
|
|
171878
171838
|
|
|
171879
171839
|
// src/dev/dependencyGraph.ts
|
|
171880
|
-
import { existsSync as existsSync11, readFileSync as
|
|
171840
|
+
import { existsSync as existsSync11, readFileSync as readFileSync6 } from "fs";
|
|
171881
171841
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
171882
171842
|
import { resolve as resolve12 } from "path";
|
|
171883
171843
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -172044,15 +172004,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172044
172004
|
const lowerPath = filePath.toLowerCase();
|
|
172045
172005
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
172046
172006
|
if (loader === "html") {
|
|
172047
|
-
const content =
|
|
172007
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
172048
172008
|
return extractHtmlDependencies(filePath, content);
|
|
172049
172009
|
}
|
|
172050
172010
|
if (loader === "tsx" || loader === "js") {
|
|
172051
|
-
const content =
|
|
172011
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
172052
172012
|
return extractJsDependencies(filePath, content, loader);
|
|
172053
172013
|
}
|
|
172054
172014
|
if (isSvelteOrVue) {
|
|
172055
|
-
const content =
|
|
172015
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
172056
172016
|
return extractSvelteVueDependencies(filePath, content);
|
|
172057
172017
|
}
|
|
172058
172018
|
return [];
|
|
@@ -172487,10 +172447,10 @@ var init_assetStore = __esm(() => {
|
|
|
172487
172447
|
});
|
|
172488
172448
|
|
|
172489
172449
|
// src/dev/fileHashTracker.ts
|
|
172490
|
-
import { readFileSync as
|
|
172450
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
172491
172451
|
var computeFileHash = (filePath) => {
|
|
172492
172452
|
try {
|
|
172493
|
-
const fileContent =
|
|
172453
|
+
const fileContent = readFileSync7(filePath);
|
|
172494
172454
|
return Number(Bun.hash(fileContent));
|
|
172495
172455
|
} catch {
|
|
172496
172456
|
return UNFOUND_INDEX;
|
|
@@ -172802,7 +172762,7 @@ var init_registerClientScript = __esm(() => {
|
|
|
172802
172762
|
});
|
|
172803
172763
|
|
|
172804
172764
|
// src/angular/injectorPatch.ts
|
|
172805
|
-
import { readFileSync as
|
|
172765
|
+
import { readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
|
|
172806
172766
|
import { dirname as dirname6, join as join15 } from "path";
|
|
172807
172767
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
172808
172768
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
@@ -172842,7 +172802,7 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
172842
172802
|
try {
|
|
172843
172803
|
const coreDir = dirname6(__require.resolve("@angular/core/package.json"));
|
|
172844
172804
|
const chunkPath = join15(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
172845
|
-
const content =
|
|
172805
|
+
const content = readFileSync8(chunkPath, "utf-8");
|
|
172846
172806
|
applyInjectorPatch(chunkPath, content);
|
|
172847
172807
|
} catch {}
|
|
172848
172808
|
};
|
|
@@ -202402,7 +202362,7 @@ __export(exports_moduleServer, {
|
|
|
202402
202362
|
createModuleServer: () => createModuleServer,
|
|
202403
202363
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
202404
202364
|
});
|
|
202405
|
-
import { existsSync as existsSync13, readFileSync as
|
|
202365
|
+
import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
|
|
202406
202366
|
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
|
|
202407
202367
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
202408
202368
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -202557,7 +202517,7 @@ ${stubs}
|
|
|
202557
202517
|
`) + `
|
|
202558
202518
|
` + code;
|
|
202559
202519
|
}, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
202560
|
-
const raw =
|
|
202520
|
+
const raw = readFileSync9(filePath, "utf-8");
|
|
202561
202521
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
202562
202522
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
202563
202523
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -202572,7 +202532,7 @@ ${stubs}
|
|
|
202572
202532
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
202573
202533
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
202574
202534
|
}, transformPlainFile = (filePath, projectRoot, rewriter) => {
|
|
202575
|
-
const raw =
|
|
202535
|
+
const raw = readFileSync9(filePath, "utf-8");
|
|
202576
202536
|
const ext = extname3(filePath);
|
|
202577
202537
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
202578
202538
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -202611,7 +202571,7 @@ ${stubs}
|
|
|
202611
202571
|
}
|
|
202612
202572
|
}
|
|
202613
202573
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
|
|
202614
|
-
const raw =
|
|
202574
|
+
const raw = readFileSync9(filePath, "utf-8");
|
|
202615
202575
|
if (!svelteCompiler) {
|
|
202616
202576
|
svelteCompiler = await import("svelte/compiler");
|
|
202617
202577
|
}
|
|
@@ -202647,7 +202607,7 @@ ${code}`;
|
|
|
202647
202607
|
}
|
|
202648
202608
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
202649
202609
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
|
|
202650
|
-
const raw =
|
|
202610
|
+
const raw = readFileSync9(filePath, "utf-8");
|
|
202651
202611
|
if (!vueCompiler) {
|
|
202652
202612
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
202653
202613
|
}
|
|
@@ -202730,7 +202690,7 @@ ${code}`;
|
|
|
202730
202690
|
"Content-Type": "application/javascript"
|
|
202731
202691
|
}
|
|
202732
202692
|
}), handleCssRequest = (filePath) => {
|
|
202733
|
-
const raw =
|
|
202693
|
+
const raw = readFileSync9(filePath, "utf-8");
|
|
202734
202694
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
202735
202695
|
return [
|
|
202736
202696
|
`const style = document.createElement('style');`,
|
|
@@ -203062,7 +203022,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
203062
203022
|
// src/dev/rebuildTrigger.ts
|
|
203063
203023
|
import { existsSync as existsSync14 } from "fs";
|
|
203064
203024
|
import { rm as rm8 } from "fs/promises";
|
|
203065
|
-
import { basename as basename8, relative as relative9, resolve as resolve21 } from "path";
|
|
203025
|
+
import { basename as basename8, dirname as dirname8, relative as relative9, resolve as resolve21 } from "path";
|
|
203066
203026
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
203067
203027
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
203068
203028
|
if (pathLineCol) {
|
|
@@ -204368,7 +204328,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204368
204328
|
});
|
|
204369
204329
|
return state.manifest;
|
|
204370
204330
|
}
|
|
204371
|
-
const
|
|
204331
|
+
const hasNonComponentFiles = (filesToRebuild ?? []).some((f) => f.endsWith(".ts") && !f.endsWith(".d.ts"));
|
|
204332
|
+
const buildConfig = {
|
|
204372
204333
|
...config,
|
|
204373
204334
|
incrementalFiles: filesToRebuild && filesToRebuild.length > 0 ? filesToRebuild : undefined,
|
|
204374
204335
|
options: {
|
|
@@ -204377,7 +204338,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204377
204338
|
injectHMR: true,
|
|
204378
204339
|
throwOnError: true
|
|
204379
204340
|
}
|
|
204380
|
-
}
|
|
204341
|
+
};
|
|
204342
|
+
let manifest;
|
|
204343
|
+
if (hasNonComponentFiles) {
|
|
204344
|
+
const workerPath = resolve21(dirname8(new URL(import.meta.url).pathname), "../build/freshBuildWorker.ts");
|
|
204345
|
+
const proc = Bun.spawn(["bun", "run", workerPath, JSON.stringify(buildConfig)], { stdout: "pipe", stderr: "pipe" });
|
|
204346
|
+
const stdout = await new Response(proc.stdout).text();
|
|
204347
|
+
const stderr = await new Response(proc.stderr).text();
|
|
204348
|
+
await proc.exited;
|
|
204349
|
+
if (proc.exitCode !== 0) {
|
|
204350
|
+
throw new Error(`Fresh build failed: ${stderr}`);
|
|
204351
|
+
}
|
|
204352
|
+
const manifestLine = stdout.split(`
|
|
204353
|
+
`).find((l) => l.startsWith("__MANIFEST__"));
|
|
204354
|
+
if (manifestLine) {
|
|
204355
|
+
manifest = JSON.parse(manifestLine.slice("__MANIFEST__".length));
|
|
204356
|
+
}
|
|
204357
|
+
} else {
|
|
204358
|
+
manifest = await build2(buildConfig);
|
|
204359
|
+
}
|
|
204381
204360
|
if (!manifest) {
|
|
204382
204361
|
throw new Error("Build failed - no manifest generated");
|
|
204383
204362
|
}
|
|
@@ -204562,13 +204541,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
204562
204541
|
});
|
|
204563
204542
|
await rm9(tmpDir, { force: true, recursive: true });
|
|
204564
204543
|
if (result.success) {
|
|
204565
|
-
const { readdirSync, readFileSync:
|
|
204544
|
+
const { readdirSync, readFileSync: readFileSync10, writeFileSync: writeFileSync5 } = await import("fs");
|
|
204566
204545
|
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
204567
204546
|
const reactPaths = computeVendorPaths2();
|
|
204568
204547
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
204569
204548
|
for (const file4 of files) {
|
|
204570
204549
|
const filePath = join16(vendorDir, file4);
|
|
204571
|
-
let content =
|
|
204550
|
+
let content = readFileSync10(filePath, "utf-8");
|
|
204572
204551
|
let changed = false;
|
|
204573
204552
|
for (const [specifier, webPath] of Object.entries(reactPaths)) {
|
|
204574
204553
|
const escaped = specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -205050,7 +205029,7 @@ var handleReactPageRequest = async (PageComponent, index, ...props) => {
|
|
|
205050
205029
|
var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
205051
205030
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
205052
205031
|
// src/core/prepare.ts
|
|
205053
|
-
import { readFileSync as
|
|
205032
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
205054
205033
|
import { relative as relative11, resolve as resolve23 } from "path";
|
|
205055
205034
|
|
|
205056
205035
|
// src/utils/loadConfig.ts
|
|
@@ -205149,7 +205128,7 @@ var prepare = async (configOrPath) => {
|
|
|
205149
205128
|
absolutejs: (app) => hmrPlugin(app.use(staticPlugin2({ assets: buildDir, prefix: "" })))
|
|
205150
205129
|
};
|
|
205151
205130
|
}
|
|
205152
|
-
const manifest = JSON.parse(
|
|
205131
|
+
const manifest = JSON.parse(readFileSync10(`${buildDir}/manifest.json`, "utf-8"));
|
|
205153
205132
|
const { staticPlugin } = await import("@elysiajs/static");
|
|
205154
205133
|
const absolutejs = staticPlugin({ assets: buildDir, prefix: "" });
|
|
205155
205134
|
return { absolutejs, manifest };
|
|
@@ -205310,5 +205289,5 @@ export {
|
|
|
205310
205289
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205311
205290
|
};
|
|
205312
205291
|
|
|
205313
|
-
//# debugId=
|
|
205292
|
+
//# debugId=4582269A50EC544264756E2164756E21
|
|
205314
205293
|
//# sourceMappingURL=index.js.map
|