@absolutejs/absolute 0.19.0-beta.10 → 0.19.0-beta.12
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 +79 -48
- package/dist/build.js.map +4 -4
- package/dist/index.js +79 -48
- package/dist/index.js.map +4 -4
- package/native/packages/darwin-arm64/fast_ops.dylib +0 -0
- package/native/packages/darwin-arm64/package.json +1 -1
- package/native/packages/darwin-x64/fast_ops.dylib +0 -0
- package/native/packages/darwin-x64/package.json +1 -1
- package/native/packages/linux-arm64/package.json +1 -1
- package/native/packages/linux-x64/fast_ops.so +0 -0
- package/native/packages/linux-x64/package.json +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -171312,29 +171312,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171312
171312
|
setAngularVendorPaths(angularVendorPaths2);
|
|
171313
171313
|
}
|
|
171314
171314
|
const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
|
|
171315
|
-
const freshFilePlugin = isIncremental ? {
|
|
171316
|
-
name: "hmr-fresh-files",
|
|
171317
|
-
setup(pluginBuild) {
|
|
171318
|
-
pluginBuild.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
|
|
171319
|
-
try {
|
|
171320
|
-
const contents = readFileSync5(args.path, "utf-8");
|
|
171321
|
-
const ext = args.path.split(".").pop() ?? "tsx";
|
|
171322
|
-
const loaderMap = {
|
|
171323
|
-
js: "js",
|
|
171324
|
-
jsx: "jsx",
|
|
171325
|
-
ts: "ts",
|
|
171326
|
-
tsx: "tsx"
|
|
171327
|
-
};
|
|
171328
|
-
return {
|
|
171329
|
-
contents,
|
|
171330
|
-
loader: loaderMap[ext] ?? "tsx"
|
|
171331
|
-
};
|
|
171332
|
-
} catch {
|
|
171333
|
-
return;
|
|
171334
|
-
}
|
|
171335
|
-
});
|
|
171336
|
-
}
|
|
171337
|
-
} : undefined;
|
|
171338
171315
|
const reactBuildConfig = reactClientEntryPoints.length > 0 ? {
|
|
171339
171316
|
entrypoints: reactClientEntryPoints,
|
|
171340
171317
|
...vendorPaths ? { external: Object.keys(vendorPaths) } : {},
|
|
@@ -171343,7 +171320,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171343
171320
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171344
171321
|
outdir: buildPath,
|
|
171345
171322
|
...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
|
|
171346
|
-
...freshFilePlugin ? { plugins: [freshFilePlugin] } : {},
|
|
171347
171323
|
root: clientRoot,
|
|
171348
171324
|
splitting: true,
|
|
171349
171325
|
target: "browser",
|
|
@@ -202574,38 +202550,17 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
202574
202550
|
vendorPaths = computeVendorPaths2();
|
|
202575
202551
|
setDevVendorPaths2(vendorPaths);
|
|
202576
202552
|
}
|
|
202577
|
-
const { rmSync: rmSync2
|
|
202553
|
+
const { rmSync: rmSync2 } = await import("fs");
|
|
202578
202554
|
rmSync2(resolve19(buildDir, "react", "indexes"), {
|
|
202579
202555
|
force: true,
|
|
202580
202556
|
recursive: true
|
|
202581
202557
|
});
|
|
202582
|
-
const freshFilePlugin = {
|
|
202583
|
-
name: "hmr-fresh-files",
|
|
202584
|
-
setup(build3) {
|
|
202585
|
-
build3.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
|
|
202586
|
-
try {
|
|
202587
|
-
const contents = readFileSync9(args.path, "utf-8");
|
|
202588
|
-
const ext = args.path.split(".").pop() ?? "tsx";
|
|
202589
|
-
const loaderMap = {
|
|
202590
|
-
js: "js",
|
|
202591
|
-
jsx: "jsx",
|
|
202592
|
-
ts: "ts",
|
|
202593
|
-
tsx: "tsx"
|
|
202594
|
-
};
|
|
202595
|
-
return { contents, loader: loaderMap[ext] ?? "tsx" };
|
|
202596
|
-
} catch {
|
|
202597
|
-
return;
|
|
202598
|
-
}
|
|
202599
|
-
});
|
|
202600
|
-
}
|
|
202601
|
-
};
|
|
202602
202558
|
const clientResult = await bunBuild5({
|
|
202603
202559
|
entrypoints: reactEntries,
|
|
202604
202560
|
format: "esm",
|
|
202605
202561
|
jsx: { development: true },
|
|
202606
202562
|
naming: "[dir]/[name].[hash].[ext]",
|
|
202607
202563
|
outdir: buildDir,
|
|
202608
|
-
plugins: [freshFilePlugin],
|
|
202609
202564
|
reactFastRefresh: true,
|
|
202610
202565
|
root: clientRoot,
|
|
202611
202566
|
splitting: true,
|
|
@@ -202622,11 +202577,88 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
202622
202577
|
const clientManifest = generateManifest2(clientResult.outputs, buildDir);
|
|
202623
202578
|
Object.assign(state.manifest, clientManifest);
|
|
202624
202579
|
await populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
202580
|
+
}, buildSingleReactPage = async (state, pageFile, buildDir) => {
|
|
202581
|
+
const { build: bunBuild5 } = await Promise.resolve(globalThis.Bun);
|
|
202582
|
+
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
202583
|
+
const { getDevVendorPaths: getDevVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
202584
|
+
const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
|
|
202585
|
+
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
202586
|
+
const clientRoots = [
|
|
202587
|
+
state.resolvedPaths.reactDir,
|
|
202588
|
+
state.resolvedPaths.svelteDir,
|
|
202589
|
+
state.resolvedPaths.htmlDir,
|
|
202590
|
+
state.resolvedPaths.vueDir,
|
|
202591
|
+
state.resolvedPaths.angularDir
|
|
202592
|
+
].filter((dir) => Boolean(dir));
|
|
202593
|
+
const clientRoot = clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
|
|
202594
|
+
let vendorPaths = getDevVendorPaths2();
|
|
202595
|
+
if (!vendorPaths) {
|
|
202596
|
+
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
202597
|
+
const { setDevVendorPaths: setDevVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
202598
|
+
vendorPaths = computeVendorPaths2();
|
|
202599
|
+
setDevVendorPaths2(vendorPaths);
|
|
202600
|
+
}
|
|
202601
|
+
const result = await bunBuild5({
|
|
202602
|
+
entrypoints: [pageFile],
|
|
202603
|
+
external: vendorPaths ? Object.keys(vendorPaths) : [],
|
|
202604
|
+
format: "esm",
|
|
202605
|
+
jsx: { development: true },
|
|
202606
|
+
naming: "[dir]/[name].[hash].[ext]",
|
|
202607
|
+
outdir: buildDir,
|
|
202608
|
+
reactFastRefresh: true,
|
|
202609
|
+
root: clientRoot,
|
|
202610
|
+
splitting: false,
|
|
202611
|
+
target: "browser",
|
|
202612
|
+
throw: false
|
|
202613
|
+
});
|
|
202614
|
+
if (!result.success)
|
|
202615
|
+
return;
|
|
202616
|
+
const outputPaths = result.outputs.map((a) => a.path);
|
|
202617
|
+
if (vendorPaths) {
|
|
202618
|
+
await rewriteReactImports2(outputPaths, vendorPaths);
|
|
202619
|
+
}
|
|
202620
|
+
const pageManifest = generateManifest2(result.outputs, buildDir);
|
|
202621
|
+
Object.assign(state.manifest, pageManifest);
|
|
202622
|
+
await populateAssetStore(state.assetStore, pageManifest, buildDir);
|
|
202623
|
+
const [firstOutput] = result.outputs;
|
|
202624
|
+
if (!firstOutput)
|
|
202625
|
+
return;
|
|
202626
|
+
return `/${relative6(buildDir, firstOutput.path).replace(/\\/g, "/")}`;
|
|
202625
202627
|
}, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
202626
202628
|
const reactDir = config.reactDirectory ?? "";
|
|
202627
202629
|
const reactPagesPath = resolve19(reactDir, "pages");
|
|
202628
202630
|
const reactIndexesPath = resolve19(reactDir, "indexes");
|
|
202629
202631
|
const { buildDir } = state.resolvedPaths;
|
|
202632
|
+
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
202633
|
+
const pagesPathResolved = resolve19(reactPagesPath);
|
|
202634
|
+
const allArePageFiles = reactFiles.length > 0 && reactFiles.every((file4) => (file4.endsWith(".tsx") || file4.endsWith(".jsx")) && resolve19(file4).startsWith(pagesPathResolved));
|
|
202635
|
+
if (allArePageFiles) {
|
|
202636
|
+
const [pageFile] = reactFiles;
|
|
202637
|
+
if (pageFile) {
|
|
202638
|
+
const pageModuleUrl = await buildSingleReactPage(state, pageFile, buildDir);
|
|
202639
|
+
if (pageModuleUrl) {
|
|
202640
|
+
const duration2 = Date.now() - startTime;
|
|
202641
|
+
logHmrUpdate(pageFile, "react", duration2);
|
|
202642
|
+
broadcastToClients(state, {
|
|
202643
|
+
data: {
|
|
202644
|
+
framework: "react",
|
|
202645
|
+
hasComponentChanges: true,
|
|
202646
|
+
hasCSSChanges: false,
|
|
202647
|
+
manifest: state.manifest,
|
|
202648
|
+
pageModuleUrl,
|
|
202649
|
+
primarySource: pageFile,
|
|
202650
|
+
sourceFiles: reactFiles
|
|
202651
|
+
},
|
|
202652
|
+
type: "react-update"
|
|
202653
|
+
});
|
|
202654
|
+
onRebuildComplete({
|
|
202655
|
+
hmrState: state,
|
|
202656
|
+
manifest: state.manifest
|
|
202657
|
+
});
|
|
202658
|
+
return state.manifest;
|
|
202659
|
+
}
|
|
202660
|
+
}
|
|
202661
|
+
}
|
|
202630
202662
|
const { generateReactIndexFiles: generateReactIndexFiles2 } = await Promise.resolve().then(() => (init_generateReactIndexes(), exports_generateReactIndexes));
|
|
202631
202663
|
await generateReactIndexFiles2(reactPagesPath, reactIndexesPath, true);
|
|
202632
202664
|
const reactEntries = collectReactEntries(state, filesToRebuild, reactPagesPath, reactIndexesPath);
|
|
@@ -202636,7 +202668,6 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
202636
202668
|
await rm6(reactIndexesPath, { force: true, recursive: true });
|
|
202637
202669
|
const { manifest } = state;
|
|
202638
202670
|
const duration = Date.now() - startTime;
|
|
202639
|
-
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
202640
202671
|
const reactPageFiles = reactFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
202641
202672
|
const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
|
|
202642
202673
|
logHmrUpdate(sourceFiles[0] ?? reactFiles[0] ?? "", "react", duration);
|
|
@@ -204032,5 +204063,5 @@ export {
|
|
|
204032
204063
|
ANGULAR_INIT_TIMEOUT_MS
|
|
204033
204064
|
};
|
|
204034
204065
|
|
|
204035
|
-
//# debugId=
|
|
204066
|
+
//# debugId=03584322C063344C64756E2164756E21
|
|
204036
204067
|
//# sourceMappingURL=index.js.map
|