@absolutejs/absolute 0.19.0-beta.74 → 0.19.0-beta.76
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 +37 -37
- package/dist/build.js.map +3 -3
- package/dist/index.js +39 -39
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -134,25 +134,23 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
// src/build/freshReadPlugin.ts
|
|
137
|
+
import { readFileSync } from "fs";
|
|
137
138
|
var createFreshReadPlugin = (changedFiles) => {
|
|
138
139
|
const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
|
|
139
|
-
const escaped = changedFiles.map((f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
140
|
-
const pattern = escaped.length > 0 ? new RegExp(`(${escaped.join("|")})$`) : /(?!)/;
|
|
141
140
|
return {
|
|
142
141
|
name: "fresh-read",
|
|
143
142
|
setup(build2) {
|
|
144
|
-
build2.onLoad({ filter:
|
|
143
|
+
build2.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
|
|
145
144
|
const normalized = args.path.replace(/\\/g, "/");
|
|
146
145
|
if (!changed.has(normalized))
|
|
147
146
|
return;
|
|
148
|
-
const contents =
|
|
147
|
+
const contents = readFileSync(args.path, "utf-8");
|
|
149
148
|
const ext = args.path.split(".").pop();
|
|
150
149
|
const loaderMap = {
|
|
151
150
|
ts: "ts",
|
|
152
151
|
tsx: "tsx",
|
|
153
152
|
js: "js",
|
|
154
|
-
jsx: "jsx"
|
|
155
|
-
css: "css"
|
|
153
|
+
jsx: "jsx"
|
|
156
154
|
};
|
|
157
155
|
return {
|
|
158
156
|
contents,
|
|
@@ -162,6 +160,7 @@ var createFreshReadPlugin = (changedFiles) => {
|
|
|
162
160
|
}
|
|
163
161
|
};
|
|
164
162
|
};
|
|
163
|
+
var init_freshReadPlugin = () => {};
|
|
165
164
|
|
|
166
165
|
// src/utils/normalizePath.ts
|
|
167
166
|
var normalizePath = (path) => path.replace(/\\/g, "/");
|
|
@@ -651,14 +650,14 @@ var scanCssEntryPoints = async (dir, ignore) => {
|
|
|
651
650
|
var init_scanCssEntryPoints = () => {};
|
|
652
651
|
|
|
653
652
|
// src/cli/scripts/telemetry.ts
|
|
654
|
-
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
653
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
655
654
|
import { homedir } from "os";
|
|
656
655
|
import { join as join2 } from "path";
|
|
657
656
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
658
657
|
try {
|
|
659
658
|
if (!existsSync4(configPath))
|
|
660
659
|
return null;
|
|
661
|
-
const raw =
|
|
660
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
662
661
|
const config = JSON.parse(raw);
|
|
663
662
|
return config;
|
|
664
663
|
} catch {
|
|
@@ -671,14 +670,14 @@ var init_telemetry = __esm(() => {
|
|
|
671
670
|
});
|
|
672
671
|
|
|
673
672
|
// src/cli/telemetryEvent.ts
|
|
674
|
-
import { existsSync as existsSync5, readFileSync as
|
|
673
|
+
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
|
|
675
674
|
import { arch, platform } from "os";
|
|
676
675
|
import { dirname, join as join3, parse } from "path";
|
|
677
676
|
var checkCandidate = (candidate) => {
|
|
678
677
|
if (!existsSync5(candidate)) {
|
|
679
678
|
return null;
|
|
680
679
|
}
|
|
681
|
-
const pkg = JSON.parse(
|
|
680
|
+
const pkg = JSON.parse(readFileSync3(candidate, "utf-8"));
|
|
682
681
|
if (pkg.name === "@absolutejs/absolute") {
|
|
683
682
|
const ver = pkg.version;
|
|
684
683
|
return ver;
|
|
@@ -975,7 +974,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
975
974
|
};
|
|
976
975
|
|
|
977
976
|
// src/build/angularLinkerPlugin.ts
|
|
978
|
-
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as
|
|
977
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
979
978
|
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve5 } from "path";
|
|
980
979
|
import { createHash } from "crypto";
|
|
981
980
|
var CACHE_DIR, angularLinkerPlugin;
|
|
@@ -1002,7 +1001,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1002
1001
|
const cachePath = join4(CACHE_DIR, `${hash}.js`);
|
|
1003
1002
|
if (existsSync7(cachePath)) {
|
|
1004
1003
|
return {
|
|
1005
|
-
contents:
|
|
1004
|
+
contents: readFileSync4(cachePath, "utf-8"),
|
|
1006
1005
|
loader: "js"
|
|
1007
1006
|
};
|
|
1008
1007
|
}
|
|
@@ -1018,7 +1017,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1018
1017
|
fileSystem: {
|
|
1019
1018
|
dirname: dirname2,
|
|
1020
1019
|
exists: existsSync7,
|
|
1021
|
-
readFile:
|
|
1020
|
+
readFile: readFileSync4,
|
|
1022
1021
|
relative: relative2,
|
|
1023
1022
|
resolve: resolve5
|
|
1024
1023
|
},
|
|
@@ -170560,12 +170559,12 @@ __export(exports_compileAngular, {
|
|
|
170560
170559
|
compileAngularFile: () => compileAngularFile,
|
|
170561
170560
|
compileAngular: () => compileAngular
|
|
170562
170561
|
});
|
|
170563
|
-
import { existsSync as existsSync10, readFileSync as
|
|
170562
|
+
import { existsSync as existsSync10, readFileSync as readFileSync5, promises as fs } from "fs";
|
|
170564
170563
|
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
|
|
170565
170564
|
import { createHash as createHash2 } from "crypto";
|
|
170566
170565
|
var import_typescript, computeConfigHash = () => {
|
|
170567
170566
|
try {
|
|
170568
|
-
const content =
|
|
170567
|
+
const content = readFileSync5("./tsconfig.json", "utf-8");
|
|
170569
170568
|
return createHash2("md5").update(content).digest("hex");
|
|
170570
170569
|
} catch {
|
|
170571
170570
|
return "";
|
|
@@ -171119,11 +171118,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
171119
171118
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
171120
171119
|
return;
|
|
171121
171120
|
}
|
|
171122
|
-
const { readFileSync:
|
|
171121
|
+
const { readFileSync: readFileSync6, writeFileSync: writeFileSync3, readdirSync } = await import("fs");
|
|
171123
171122
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
171124
171123
|
for (const file4 of files) {
|
|
171125
171124
|
const filePath = join11(vendorDir, file4);
|
|
171126
|
-
const content =
|
|
171125
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
171127
171126
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
171128
171127
|
continue;
|
|
171129
171128
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -171245,7 +171244,7 @@ import {
|
|
|
171245
171244
|
copyFileSync,
|
|
171246
171245
|
cpSync,
|
|
171247
171246
|
mkdirSync as mkdirSync8,
|
|
171248
|
-
readFileSync as
|
|
171247
|
+
readFileSync as readFileSync6,
|
|
171249
171248
|
rmSync,
|
|
171250
171249
|
writeFileSync as writeFileSync3
|
|
171251
171250
|
} from "fs";
|
|
@@ -171748,7 +171747,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171748
171747
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
171749
171748
|
if (!hmrClientBundle)
|
|
171750
171749
|
return;
|
|
171751
|
-
let html =
|
|
171750
|
+
let html = readFileSync6(filePath, "utf-8");
|
|
171752
171751
|
if (html.includes("data-hmr-client"))
|
|
171753
171752
|
return;
|
|
171754
171753
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -171820,7 +171819,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171820
171819
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171821
171820
|
const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
|
|
171822
171821
|
for (const file4 of indexFiles) {
|
|
171823
|
-
let content =
|
|
171822
|
+
let content = readFileSync6(join13(reactIndexesPath, file4), "utf-8");
|
|
171824
171823
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
171825
171824
|
writeFileSync3(join13(devIndexDir, file4), content);
|
|
171826
171825
|
}
|
|
@@ -171846,6 +171845,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171846
171845
|
return manifest;
|
|
171847
171846
|
};
|
|
171848
171847
|
var init_build = __esm(() => {
|
|
171848
|
+
init_freshReadPlugin();
|
|
171849
171849
|
init_generateManifest();
|
|
171850
171850
|
init_generateReactIndexes();
|
|
171851
171851
|
init_htmlScriptHMRPlugin();
|
|
@@ -171871,7 +171871,7 @@ var init_build = __esm(() => {
|
|
|
171871
171871
|
});
|
|
171872
171872
|
|
|
171873
171873
|
// src/dev/dependencyGraph.ts
|
|
171874
|
-
import { existsSync as existsSync11, readFileSync as
|
|
171874
|
+
import { existsSync as existsSync11, readFileSync as readFileSync7 } from "fs";
|
|
171875
171875
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
171876
171876
|
import { resolve as resolve12 } from "path";
|
|
171877
171877
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -172038,15 +172038,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172038
172038
|
const lowerPath = filePath.toLowerCase();
|
|
172039
172039
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
172040
172040
|
if (loader === "html") {
|
|
172041
|
-
const content =
|
|
172041
|
+
const content = readFileSync7(filePath, "utf-8");
|
|
172042
172042
|
return extractHtmlDependencies(filePath, content);
|
|
172043
172043
|
}
|
|
172044
172044
|
if (loader === "tsx" || loader === "js") {
|
|
172045
|
-
const content =
|
|
172045
|
+
const content = readFileSync7(filePath, "utf-8");
|
|
172046
172046
|
return extractJsDependencies(filePath, content, loader);
|
|
172047
172047
|
}
|
|
172048
172048
|
if (isSvelteOrVue) {
|
|
172049
|
-
const content =
|
|
172049
|
+
const content = readFileSync7(filePath, "utf-8");
|
|
172050
172050
|
return extractSvelteVueDependencies(filePath, content);
|
|
172051
172051
|
}
|
|
172052
172052
|
return [];
|
|
@@ -172481,10 +172481,10 @@ var init_assetStore = __esm(() => {
|
|
|
172481
172481
|
});
|
|
172482
172482
|
|
|
172483
172483
|
// src/dev/fileHashTracker.ts
|
|
172484
|
-
import { readFileSync as
|
|
172484
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
172485
172485
|
var computeFileHash = (filePath) => {
|
|
172486
172486
|
try {
|
|
172487
|
-
const fileContent =
|
|
172487
|
+
const fileContent = readFileSync8(filePath);
|
|
172488
172488
|
return Number(Bun.hash(fileContent));
|
|
172489
172489
|
} catch {
|
|
172490
172490
|
return UNFOUND_INDEX;
|
|
@@ -172796,7 +172796,7 @@ var init_registerClientScript = __esm(() => {
|
|
|
172796
172796
|
});
|
|
172797
172797
|
|
|
172798
172798
|
// src/angular/injectorPatch.ts
|
|
172799
|
-
import { readFileSync as
|
|
172799
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
172800
172800
|
import { dirname as dirname6, join as join15 } from "path";
|
|
172801
172801
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
172802
172802
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
@@ -172836,7 +172836,7 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
172836
172836
|
try {
|
|
172837
172837
|
const coreDir = dirname6(__require.resolve("@angular/core/package.json"));
|
|
172838
172838
|
const chunkPath = join15(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
172839
|
-
const content =
|
|
172839
|
+
const content = readFileSync9(chunkPath, "utf-8");
|
|
172840
172840
|
applyInjectorPatch(chunkPath, content);
|
|
172841
172841
|
} catch {}
|
|
172842
172842
|
};
|
|
@@ -202396,7 +202396,7 @@ __export(exports_moduleServer, {
|
|
|
202396
202396
|
createModuleServer: () => createModuleServer,
|
|
202397
202397
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
202398
202398
|
});
|
|
202399
|
-
import { existsSync as existsSync13, readFileSync as
|
|
202399
|
+
import { existsSync as existsSync13, readFileSync as readFileSync10, statSync } from "fs";
|
|
202400
202400
|
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
|
|
202401
202401
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
202402
202402
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -202551,7 +202551,7 @@ ${stubs}
|
|
|
202551
202551
|
`) + `
|
|
202552
202552
|
` + code;
|
|
202553
202553
|
}, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
202554
|
-
const raw =
|
|
202554
|
+
const raw = readFileSync10(filePath, "utf-8");
|
|
202555
202555
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
202556
202556
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
202557
202557
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -202566,7 +202566,7 @@ ${stubs}
|
|
|
202566
202566
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
202567
202567
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
202568
202568
|
}, transformPlainFile = (filePath, projectRoot, rewriter) => {
|
|
202569
|
-
const raw =
|
|
202569
|
+
const raw = readFileSync10(filePath, "utf-8");
|
|
202570
202570
|
const ext = extname3(filePath);
|
|
202571
202571
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
202572
202572
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -202605,7 +202605,7 @@ ${stubs}
|
|
|
202605
202605
|
}
|
|
202606
202606
|
}
|
|
202607
202607
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
|
|
202608
|
-
const raw =
|
|
202608
|
+
const raw = readFileSync10(filePath, "utf-8");
|
|
202609
202609
|
if (!svelteCompiler) {
|
|
202610
202610
|
svelteCompiler = await import("svelte/compiler");
|
|
202611
202611
|
}
|
|
@@ -202641,7 +202641,7 @@ ${code}`;
|
|
|
202641
202641
|
}
|
|
202642
202642
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
202643
202643
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
|
|
202644
|
-
const raw =
|
|
202644
|
+
const raw = readFileSync10(filePath, "utf-8");
|
|
202645
202645
|
if (!vueCompiler) {
|
|
202646
202646
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
202647
202647
|
}
|
|
@@ -202724,7 +202724,7 @@ ${code}`;
|
|
|
202724
202724
|
"Content-Type": "application/javascript"
|
|
202725
202725
|
}
|
|
202726
202726
|
}), handleCssRequest = (filePath) => {
|
|
202727
|
-
const raw =
|
|
202727
|
+
const raw = readFileSync10(filePath, "utf-8");
|
|
202728
202728
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
202729
202729
|
return [
|
|
202730
202730
|
`const style = document.createElement('style');`,
|
|
@@ -204556,13 +204556,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
204556
204556
|
});
|
|
204557
204557
|
await rm9(tmpDir, { force: true, recursive: true });
|
|
204558
204558
|
if (result.success) {
|
|
204559
|
-
const { readdirSync, readFileSync:
|
|
204559
|
+
const { readdirSync, readFileSync: readFileSync11, writeFileSync: writeFileSync5 } = await import("fs");
|
|
204560
204560
|
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
204561
204561
|
const reactPaths = computeVendorPaths2();
|
|
204562
204562
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
204563
204563
|
for (const file4 of files) {
|
|
204564
204564
|
const filePath = join16(vendorDir, file4);
|
|
204565
|
-
let content =
|
|
204565
|
+
let content = readFileSync11(filePath, "utf-8");
|
|
204566
204566
|
let changed = false;
|
|
204567
204567
|
for (const [specifier, webPath] of Object.entries(reactPaths)) {
|
|
204568
204568
|
const escaped = specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -205044,7 +205044,7 @@ var handleReactPageRequest = async (PageComponent, index, ...props) => {
|
|
|
205044
205044
|
var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
205045
205045
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
205046
205046
|
// src/core/prepare.ts
|
|
205047
|
-
import { readFileSync as
|
|
205047
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
205048
205048
|
import { relative as relative11, resolve as resolve23 } from "path";
|
|
205049
205049
|
|
|
205050
205050
|
// src/utils/loadConfig.ts
|
|
@@ -205143,7 +205143,7 @@ var prepare = async (configOrPath) => {
|
|
|
205143
205143
|
absolutejs: (app) => hmrPlugin(app.use(staticPlugin2({ assets: buildDir, prefix: "" })))
|
|
205144
205144
|
};
|
|
205145
205145
|
}
|
|
205146
|
-
const manifest = JSON.parse(
|
|
205146
|
+
const manifest = JSON.parse(readFileSync11(`${buildDir}/manifest.json`, "utf-8"));
|
|
205147
205147
|
const { staticPlugin } = await import("@elysiajs/static");
|
|
205148
205148
|
const absolutejs = staticPlugin({ assets: buildDir, prefix: "" });
|
|
205149
205149
|
return { absolutejs, manifest };
|
|
@@ -205304,5 +205304,5 @@ export {
|
|
|
205304
205304
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205305
205305
|
};
|
|
205306
205306
|
|
|
205307
|
-
//# debugId=
|
|
205307
|
+
//# debugId=156C748734E19FF364756E2164756E21
|
|
205308
205308
|
//# sourceMappingURL=index.js.map
|