@absolutejs/absolute 0.17.17-beta.25 → 0.17.17-beta.26
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 +56 -79
- package/dist/build.js.map +6 -6
- package/dist/index.js +56 -79
- package/dist/index.js.map +6 -6
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -240015,19 +240015,6 @@ var angularSpecifiers, toSafeFileName2 = (specifier) => specifier.replace(/^@/,
|
|
|
240015
240015
|
paths[specifier] = `/angular/vendor/${toSafeFileName2(specifier)}.js`;
|
|
240016
240016
|
}
|
|
240017
240017
|
return paths;
|
|
240018
|
-
}, generateEntrySource2 = async (specifier) => {
|
|
240019
|
-
const mod = await import(specifier);
|
|
240020
|
-
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
240021
|
-
const lines = [];
|
|
240022
|
-
if (exportNames.length > 0) {
|
|
240023
|
-
lines.push(`export { ${exportNames.join(", ")} } from '${specifier}';`);
|
|
240024
|
-
}
|
|
240025
|
-
if ("default" in mod) {
|
|
240026
|
-
lines.push(`export { default } from '${specifier}';`);
|
|
240027
|
-
}
|
|
240028
|
-
return lines.join(`
|
|
240029
|
-
`) + `
|
|
240030
|
-
`;
|
|
240031
240018
|
}, buildAngularVendor = async (buildDir) => {
|
|
240032
240019
|
const vendorDir = join11(buildDir, "angular", "vendor");
|
|
240033
240020
|
mkdirSync5(vendorDir, { recursive: true });
|
|
@@ -240037,8 +240024,8 @@ var angularSpecifiers, toSafeFileName2 = (specifier) => specifier.replace(/^@/,
|
|
|
240037
240024
|
for (const specifier of angularSpecifiers) {
|
|
240038
240025
|
const safeName = toSafeFileName2(specifier);
|
|
240039
240026
|
const entryPath = join11(tmpDir, `${safeName}.ts`);
|
|
240040
|
-
|
|
240041
|
-
|
|
240027
|
+
await Bun.write(entryPath, `export * from '${specifier}';
|
|
240028
|
+
`);
|
|
240042
240029
|
entrypoints.push(entryPath);
|
|
240043
240030
|
}
|
|
240044
240031
|
const result = await bunBuild4({
|
|
@@ -240865,6 +240852,37 @@ var handleClientConnect = (state, client, manifest) => {
|
|
|
240865
240852
|
};
|
|
240866
240853
|
var init_webSocket = () => {};
|
|
240867
240854
|
|
|
240855
|
+
// src/dev/simpleHTMLHMR.ts
|
|
240856
|
+
var exports_simpleHTMLHMR = {};
|
|
240857
|
+
__export(exports_simpleHTMLHMR, {
|
|
240858
|
+
handleHTMLUpdate: () => handleHTMLUpdate
|
|
240859
|
+
});
|
|
240860
|
+
import { readFileSync as readFileSync8, existsSync as existsSync11 } from "fs";
|
|
240861
|
+
import { resolve as resolve16 } from "path";
|
|
240862
|
+
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
240863
|
+
try {
|
|
240864
|
+
const resolvedPath = resolve16(htmlFilePath);
|
|
240865
|
+
if (!existsSync11(resolvedPath)) {
|
|
240866
|
+
return null;
|
|
240867
|
+
}
|
|
240868
|
+
const htmlContent = readFileSync8(resolvedPath, "utf-8");
|
|
240869
|
+
const headMatch = htmlContent.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
|
|
240870
|
+
const bodyMatch = htmlContent.match(/<body[^>]*>([\s\S]*)<\/body>/i);
|
|
240871
|
+
if (bodyMatch && bodyMatch[1]) {
|
|
240872
|
+
const bodyContent = bodyMatch[1].trim();
|
|
240873
|
+
const headContent = headMatch && headMatch[1] ? headMatch[1].trim() : null;
|
|
240874
|
+
return {
|
|
240875
|
+
body: bodyContent,
|
|
240876
|
+
head: headContent
|
|
240877
|
+
};
|
|
240878
|
+
}
|
|
240879
|
+
return htmlContent;
|
|
240880
|
+
} catch {
|
|
240881
|
+
return null;
|
|
240882
|
+
}
|
|
240883
|
+
};
|
|
240884
|
+
var init_simpleHTMLHMR = () => {};
|
|
240885
|
+
|
|
240868
240886
|
// src/utils/ssrErrorPage.ts
|
|
240869
240887
|
var ssrErrorPage = (framework, error) => {
|
|
240870
240888
|
const frameworkColors2 = {
|
|
@@ -269948,13 +269966,13 @@ __export(exports_pageHandler, {
|
|
|
269948
269966
|
getCachedRouteData: () => getCachedRouteData
|
|
269949
269967
|
});
|
|
269950
269968
|
import { AsyncLocalStorage } from "async_hooks";
|
|
269951
|
-
import { readFileSync as
|
|
269969
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
269952
269970
|
import { dirname as dirname6, join as join13 } from "path";
|
|
269953
269971
|
var angularSsrContext, patchAngularInjectorSingleton = () => {
|
|
269954
269972
|
try {
|
|
269955
269973
|
const coreDir = dirname6(__require.resolve("@angular/core/package.json"));
|
|
269956
269974
|
const chunkPath = join13(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
269957
|
-
const content =
|
|
269975
|
+
const content = readFileSync9(chunkPath, "utf-8");
|
|
269958
269976
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
269959
269977
|
return;
|
|
269960
269978
|
}
|
|
@@ -270298,10 +270316,10 @@ var exports_simpleAngularHMR = {};
|
|
|
270298
270316
|
__export(exports_simpleAngularHMR, {
|
|
270299
270317
|
handleAngularUpdate: () => handleAngularUpdate
|
|
270300
270318
|
});
|
|
270301
|
-
import { basename as basename7, isAbsolute, resolve as
|
|
270319
|
+
import { basename as basename7, isAbsolute, resolve as resolve17 } from "path";
|
|
270302
270320
|
var handleAngularUpdate = async (angularFilePath, manifest, buildDir) => {
|
|
270303
270321
|
try {
|
|
270304
|
-
const resolvedPath =
|
|
270322
|
+
const resolvedPath = resolve17(angularFilePath);
|
|
270305
270323
|
const fileName = basename7(resolvedPath);
|
|
270306
270324
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
270307
270325
|
const pascalName = toPascal(baseName);
|
|
@@ -270320,7 +270338,7 @@ var handleAngularUpdate = async (angularFilePath, manifest, buildDir) => {
|
|
|
270320
270338
|
return null;
|
|
270321
270339
|
}
|
|
270322
270340
|
const cacheBuster = `?t=${Date.now()}`;
|
|
270323
|
-
const absoluteServerPath = isAbsolute(serverPath) ? serverPath :
|
|
270341
|
+
const absoluteServerPath = isAbsolute(serverPath) ? serverPath : resolve17(buildDir || process.cwd(), serverPath.replace(/^\//, ""));
|
|
270324
270342
|
const serverPathWithCacheBuster = `${absoluteServerPath}${cacheBuster}`;
|
|
270325
270343
|
const { handleAngularPageRequest: handleAngularPageRequest2, getCachedRouteData: getCachedRouteData2 } = await Promise.resolve().then(() => (init_pageHandler(), exports_pageHandler));
|
|
270326
270344
|
const { generateHeadElement: generateHeadElement2 } = await Promise.resolve().then(() => exports_generateHeadElement);
|
|
@@ -270372,37 +270390,6 @@ var handleAngularUpdate = async (angularFilePath, manifest, buildDir) => {
|
|
|
270372
270390
|
};
|
|
270373
270391
|
var init_simpleAngularHMR = () => {};
|
|
270374
270392
|
|
|
270375
|
-
// src/dev/simpleHTMLHMR.ts
|
|
270376
|
-
var exports_simpleHTMLHMR = {};
|
|
270377
|
-
__export(exports_simpleHTMLHMR, {
|
|
270378
|
-
handleHTMLUpdate: () => handleHTMLUpdate
|
|
270379
|
-
});
|
|
270380
|
-
import { readFileSync as readFileSync9, existsSync as existsSync11 } from "fs";
|
|
270381
|
-
import { resolve as resolve17 } from "path";
|
|
270382
|
-
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
270383
|
-
try {
|
|
270384
|
-
const resolvedPath = resolve17(htmlFilePath);
|
|
270385
|
-
if (!existsSync11(resolvedPath)) {
|
|
270386
|
-
return null;
|
|
270387
|
-
}
|
|
270388
|
-
const htmlContent = readFileSync9(resolvedPath, "utf-8");
|
|
270389
|
-
const headMatch = htmlContent.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
|
|
270390
|
-
const bodyMatch = htmlContent.match(/<body[^>]*>([\s\S]*)<\/body>/i);
|
|
270391
|
-
if (bodyMatch && bodyMatch[1]) {
|
|
270392
|
-
const bodyContent = bodyMatch[1].trim();
|
|
270393
|
-
const headContent = headMatch && headMatch[1] ? headMatch[1].trim() : null;
|
|
270394
|
-
return {
|
|
270395
|
-
body: bodyContent,
|
|
270396
|
-
head: headContent
|
|
270397
|
-
};
|
|
270398
|
-
}
|
|
270399
|
-
return htmlContent;
|
|
270400
|
-
} catch {
|
|
270401
|
-
return null;
|
|
270402
|
-
}
|
|
270403
|
-
};
|
|
270404
|
-
var init_simpleHTMLHMR = () => {};
|
|
270405
|
-
|
|
270406
270393
|
// src/dev/simpleHTMXHMR.ts
|
|
270407
270394
|
var exports_simpleHTMXHMR = {};
|
|
270408
270395
|
__export(exports_simpleHTMXHMR, {
|
|
@@ -270687,34 +270674,24 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
270687
270674
|
const angularPageFiles = angularHmrFiles.filter((f) => f.replace(/\\/g, "/").includes("/pages/"));
|
|
270688
270675
|
let pagesToUpdate = angularPageFiles.length > 0 ? angularPageFiles : pageEntries;
|
|
270689
270676
|
for (const angularPagePath of pagesToUpdate) {
|
|
270690
|
-
|
|
270691
|
-
|
|
270692
|
-
|
|
270693
|
-
|
|
270694
|
-
|
|
270695
|
-
|
|
270696
|
-
|
|
270697
|
-
|
|
270698
|
-
|
|
270699
|
-
logger.hmrUpdate(angularPagePath, "angular", duration2);
|
|
270700
|
-
broadcastToClients(state, {
|
|
270701
|
-
data: {
|
|
270702
|
-
framework: "angular",
|
|
270703
|
-
html: newHTML,
|
|
270704
|
-
cssUrl,
|
|
270705
|
-
cssBaseName: baseName,
|
|
270706
|
-
updateType: "logic",
|
|
270707
|
-
manifest: manifest2,
|
|
270708
|
-
sourceFile: angularPagePath
|
|
270709
|
-
},
|
|
270710
|
-
type: "angular-update"
|
|
270711
|
-
});
|
|
270712
|
-
} catch (err) {
|
|
270713
|
-
sendTelemetryEvent("hmr:error", {
|
|
270677
|
+
const fileName = basename8(angularPagePath);
|
|
270678
|
+
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
270679
|
+
const pascalName = toPascal(baseName);
|
|
270680
|
+
const cssKey = `${pascalName}CSS`;
|
|
270681
|
+
const cssUrl = manifest2[cssKey] || null;
|
|
270682
|
+
const duration2 = Date.now() - startTime;
|
|
270683
|
+
logger.hmrUpdate(angularPagePath, "angular", duration2);
|
|
270684
|
+
broadcastToClients(state, {
|
|
270685
|
+
data: {
|
|
270714
270686
|
framework: "angular",
|
|
270715
|
-
|
|
270716
|
-
|
|
270717
|
-
|
|
270687
|
+
cssUrl,
|
|
270688
|
+
cssBaseName: baseName,
|
|
270689
|
+
updateType: "logic",
|
|
270690
|
+
manifest: manifest2,
|
|
270691
|
+
sourceFile: angularPagePath
|
|
270692
|
+
},
|
|
270693
|
+
type: "angular-update"
|
|
270694
|
+
});
|
|
270718
270695
|
}
|
|
270719
270696
|
onRebuildComplete({ manifest: manifest2, hmrState: state });
|
|
270720
270697
|
return manifest2;
|
|
@@ -271383,5 +271360,5 @@ export {
|
|
|
271383
271360
|
build
|
|
271384
271361
|
};
|
|
271385
271362
|
|
|
271386
|
-
//# debugId=
|
|
271363
|
+
//# debugId=BF5399F3B55F855C64756E2164756E21
|
|
271387
271364
|
//# sourceMappingURL=build.js.map
|