@absolutejs/absolute 0.19.0-beta.20 → 0.19.0-beta.22
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 +167 -3
- package/dist/build.js.map +7 -6
- package/dist/index.js +184 -5
- package/dist/index.js.map +8 -7
- package/dist/src/build/buildDepVendor.d.ts +2 -0
- 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/types/globals.d.ts +1 -0
- package/run-patched.sh +0 -5
package/dist/index.js
CHANGED
|
@@ -171546,7 +171546,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171546
171546
|
if (!options?.preserveIntermediateFiles)
|
|
171547
171547
|
await cleanup({
|
|
171548
171548
|
angularDir,
|
|
171549
|
-
reactIndexesPath,
|
|
171549
|
+
reactIndexesPath: hmr ? undefined : reactIndexesPath,
|
|
171550
171550
|
svelteDir,
|
|
171551
171551
|
vueDir
|
|
171552
171552
|
});
|
|
@@ -202213,6 +202213,17 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
|
|
|
202213
202213
|
}
|
|
202214
202214
|
return `${prefix}${SRC_PREFIX}${srcPath.replace(/\\/g, "/")}${suffix}`;
|
|
202215
202215
|
});
|
|
202216
|
+
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
202217
|
+
if (absPath.startsWith(projectRoot)) {
|
|
202218
|
+
const rel2 = relative6(projectRoot, absPath).replace(/\\/g, "/");
|
|
202219
|
+
return `${prefix}${SRC_PREFIX}${rel2}${suffix}`;
|
|
202220
|
+
}
|
|
202221
|
+
const rel = relative6(projectRoot, absPath).replace(/\\/g, "/");
|
|
202222
|
+
if (!rel.startsWith("..")) {
|
|
202223
|
+
return `${prefix}${SRC_PREFIX}${rel}${suffix}`;
|
|
202224
|
+
}
|
|
202225
|
+
return _match;
|
|
202226
|
+
});
|
|
202216
202227
|
return result;
|
|
202217
202228
|
}, HOOK_NAMES, REFRESH_PREAMBLE, JSX_AUTO_RE, JSXS_AUTO_RE, JSX_PROD_RE, FRAGMENT_RE, addJsxImport = (code) => {
|
|
202218
202229
|
const imports = [];
|
|
@@ -203719,6 +203730,140 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
203719
203730
|
init_pageHandler();
|
|
203720
203731
|
});
|
|
203721
203732
|
|
|
203733
|
+
// src/build/buildDepVendor.ts
|
|
203734
|
+
var exports_buildDepVendor = {};
|
|
203735
|
+
__export(exports_buildDepVendor, {
|
|
203736
|
+
computeDepVendorPaths: () => computeDepVendorPaths,
|
|
203737
|
+
buildDepVendor: () => buildDepVendor
|
|
203738
|
+
});
|
|
203739
|
+
import { mkdirSync as mkdirSync7 } from "fs";
|
|
203740
|
+
import { join as join14 } from "path";
|
|
203741
|
+
import { rm as rm7 } from "fs/promises";
|
|
203742
|
+
var {build: bunBuild5, Glob: Glob6 } = globalThis.Bun;
|
|
203743
|
+
var toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable2 = (specifier) => {
|
|
203744
|
+
try {
|
|
203745
|
+
__require.resolve(specifier);
|
|
203746
|
+
return true;
|
|
203747
|
+
} catch {
|
|
203748
|
+
return false;
|
|
203749
|
+
}
|
|
203750
|
+
}, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), FRAMEWORK_SPECIFIERS, scanBareImports = async (directories) => {
|
|
203751
|
+
const specifiers = new Set;
|
|
203752
|
+
const transpiler3 = new Bun.Transpiler({ loader: "tsx" });
|
|
203753
|
+
for (const dir of directories) {
|
|
203754
|
+
const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
|
|
203755
|
+
try {
|
|
203756
|
+
for await (const file4 of glob.scan({
|
|
203757
|
+
absolute: true,
|
|
203758
|
+
cwd: dir
|
|
203759
|
+
})) {
|
|
203760
|
+
if (file4.includes("node_modules"))
|
|
203761
|
+
continue;
|
|
203762
|
+
if (file4.includes("/build/"))
|
|
203763
|
+
continue;
|
|
203764
|
+
if (file4.includes("/dist/"))
|
|
203765
|
+
continue;
|
|
203766
|
+
if (file4.includes("/indexes/"))
|
|
203767
|
+
continue;
|
|
203768
|
+
try {
|
|
203769
|
+
const content = await Bun.file(file4).text();
|
|
203770
|
+
const imports = transpiler3.scanImports(content);
|
|
203771
|
+
for (const imp of imports) {
|
|
203772
|
+
if (isBareSpecifier(imp.path) && !FRAMEWORK_SPECIFIERS.has(imp.path)) {
|
|
203773
|
+
specifiers.add(imp.path);
|
|
203774
|
+
}
|
|
203775
|
+
}
|
|
203776
|
+
} catch {}
|
|
203777
|
+
}
|
|
203778
|
+
} catch {}
|
|
203779
|
+
}
|
|
203780
|
+
return Array.from(specifiers).filter(isResolvable2);
|
|
203781
|
+
}, generateEntrySource2 = async (specifier) => {
|
|
203782
|
+
try {
|
|
203783
|
+
const mod = await import(specifier);
|
|
203784
|
+
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
203785
|
+
const lines = [];
|
|
203786
|
+
if (exportNames.length > 0) {
|
|
203787
|
+
lines.push(`export { ${exportNames.join(", ")} } from '${specifier}';`);
|
|
203788
|
+
}
|
|
203789
|
+
if ("default" in mod) {
|
|
203790
|
+
lines.push(`export { default } from '${specifier}';`);
|
|
203791
|
+
}
|
|
203792
|
+
return lines.join(`
|
|
203793
|
+
`) + `
|
|
203794
|
+
`;
|
|
203795
|
+
} catch {
|
|
203796
|
+
return `export * from '${specifier}';
|
|
203797
|
+
`;
|
|
203798
|
+
}
|
|
203799
|
+
}, computeDepVendorPaths = async (directories) => {
|
|
203800
|
+
const specifiers = await scanBareImports(directories);
|
|
203801
|
+
const paths = {};
|
|
203802
|
+
for (const specifier of specifiers) {
|
|
203803
|
+
paths[specifier] = `/vendor/${toSafeFileName3(specifier)}.js`;
|
|
203804
|
+
}
|
|
203805
|
+
return paths;
|
|
203806
|
+
}, buildDepVendor = async (buildDir, directories) => {
|
|
203807
|
+
const specifiers = await scanBareImports(directories);
|
|
203808
|
+
if (specifiers.length === 0)
|
|
203809
|
+
return {};
|
|
203810
|
+
const vendorDir = join14(buildDir, "vendor");
|
|
203811
|
+
mkdirSync7(vendorDir, { recursive: true });
|
|
203812
|
+
const tmpDir = join14(buildDir, "_dep_vendor_tmp");
|
|
203813
|
+
mkdirSync7(tmpDir, { recursive: true });
|
|
203814
|
+
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
203815
|
+
const safeName = toSafeFileName3(specifier);
|
|
203816
|
+
const entryPath = join14(tmpDir, `${safeName}.ts`);
|
|
203817
|
+
const source = await generateEntrySource2(specifier);
|
|
203818
|
+
await Bun.write(entryPath, source);
|
|
203819
|
+
return entryPath;
|
|
203820
|
+
}));
|
|
203821
|
+
const result = await bunBuild5({
|
|
203822
|
+
entrypoints,
|
|
203823
|
+
format: "esm",
|
|
203824
|
+
minify: false,
|
|
203825
|
+
naming: "[name].[ext]",
|
|
203826
|
+
outdir: vendorDir,
|
|
203827
|
+
splitting: true,
|
|
203828
|
+
target: "browser",
|
|
203829
|
+
throw: false
|
|
203830
|
+
});
|
|
203831
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
203832
|
+
if (!result.success) {
|
|
203833
|
+
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
203834
|
+
}
|
|
203835
|
+
const paths = {};
|
|
203836
|
+
for (const specifier of specifiers) {
|
|
203837
|
+
paths[specifier] = `/vendor/${toSafeFileName3(specifier)}.js`;
|
|
203838
|
+
}
|
|
203839
|
+
return paths;
|
|
203840
|
+
};
|
|
203841
|
+
var init_buildDepVendor = __esm(() => {
|
|
203842
|
+
FRAMEWORK_SPECIFIERS = new Set([
|
|
203843
|
+
"react",
|
|
203844
|
+
"react-dom",
|
|
203845
|
+
"react-dom/client",
|
|
203846
|
+
"react-dom/server",
|
|
203847
|
+
"react/jsx-runtime",
|
|
203848
|
+
"react/jsx-dev-runtime",
|
|
203849
|
+
"react-refresh/runtime",
|
|
203850
|
+
"svelte",
|
|
203851
|
+
"svelte/internal",
|
|
203852
|
+
"svelte/internal/client",
|
|
203853
|
+
"svelte/server",
|
|
203854
|
+
"svelte/compiler",
|
|
203855
|
+
"vue",
|
|
203856
|
+
"vue/server-renderer",
|
|
203857
|
+
"@vue/compiler-sfc",
|
|
203858
|
+
"@angular/core",
|
|
203859
|
+
"@angular/common",
|
|
203860
|
+
"@angular/compiler",
|
|
203861
|
+
"@angular/platform-browser",
|
|
203862
|
+
"@angular/platform-server",
|
|
203863
|
+
"@angular/ssr"
|
|
203864
|
+
]);
|
|
203865
|
+
});
|
|
203866
|
+
|
|
203722
203867
|
// src/core/devBuild.ts
|
|
203723
203868
|
var exports_devBuild = {};
|
|
203724
203869
|
__export(exports_devBuild, {
|
|
@@ -203900,7 +204045,26 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
203900
204045
|
await loadVendorFiles(state.assetStore, vendorDir, "angular");
|
|
203901
204046
|
return true;
|
|
203902
204047
|
}) : undefined;
|
|
203903
|
-
await Promise.
|
|
204048
|
+
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
204049
|
+
const sourceDirs = [
|
|
204050
|
+
config.reactDirectory,
|
|
204051
|
+
config.svelteDirectory,
|
|
204052
|
+
config.vueDirectory,
|
|
204053
|
+
config.angularDirectory,
|
|
204054
|
+
config.htmlDirectory,
|
|
204055
|
+
config.htmxDirectory
|
|
204056
|
+
].filter((dir) => Boolean(dir));
|
|
204057
|
+
const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
|
|
204058
|
+
const vendorDir = resolve21(state.resolvedPaths.buildDir, "vendor");
|
|
204059
|
+
await loadVendorFiles(state.assetStore, vendorDir, "vendor");
|
|
204060
|
+
globalThis.__depVendorPaths = depPaths;
|
|
204061
|
+
return true;
|
|
204062
|
+
});
|
|
204063
|
+
await Promise.all([
|
|
204064
|
+
buildReactVendorTask,
|
|
204065
|
+
buildAngularVendorTask,
|
|
204066
|
+
buildDepVendorTask
|
|
204067
|
+
]);
|
|
203904
204068
|
state.manifest = manifest;
|
|
203905
204069
|
startFileWatching(state, config, (filePath) => {
|
|
203906
204070
|
queueFileChange(state, filePath, config, (newBuildResult) => {
|
|
@@ -204093,7 +204257,7 @@ var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
|
204093
204257
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
204094
204258
|
// src/core/prepare.ts
|
|
204095
204259
|
import { readFileSync as readFileSync10 } from "fs";
|
|
204096
|
-
import { resolve as resolve22 } from "path";
|
|
204260
|
+
import { relative as relative8, resolve as resolve22 } from "path";
|
|
204097
204261
|
|
|
204098
204262
|
// src/utils/loadConfig.ts
|
|
204099
204263
|
import { resolve } from "path";
|
|
@@ -204121,15 +204285,30 @@ var prepare = async (configOrPath) => {
|
|
|
204121
204285
|
const { staticPlugin: staticPlugin2 } = await import("@elysiajs/static");
|
|
204122
204286
|
const { createModuleServer: createModuleServer2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
204123
204287
|
const { getDevVendorPaths: getDevVendorPaths2, getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
204288
|
+
const depVendorPaths = globalThis.__depVendorPaths ?? {};
|
|
204124
204289
|
const allVendorPaths = {
|
|
204125
204290
|
...getDevVendorPaths2() ?? {},
|
|
204126
|
-
...getAngularVendorPaths2() ?? {}
|
|
204291
|
+
...getAngularVendorPaths2() ?? {},
|
|
204292
|
+
...depVendorPaths
|
|
204127
204293
|
};
|
|
204128
204294
|
const moduleHandler = createModuleServer2({
|
|
204129
204295
|
projectRoot: process.cwd(),
|
|
204130
204296
|
vendorPaths: allVendorPaths
|
|
204131
204297
|
});
|
|
204132
204298
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
204299
|
+
const { SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
204300
|
+
const reactDir = config.reactDirectory;
|
|
204301
|
+
if (reactDir) {
|
|
204302
|
+
const indexesDir = resolve22(reactDir, "indexes");
|
|
204303
|
+
for (const key of Object.keys(result.manifest)) {
|
|
204304
|
+
if (key.endsWith("Index") && typeof result.manifest[key] === "string" && result.manifest[key].includes("/indexes/")) {
|
|
204305
|
+
const fileName = key.replace(/Index$/, "") + ".tsx";
|
|
204306
|
+
const srcPath = resolve22(indexesDir, fileName);
|
|
204307
|
+
const rel = relative8(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
204308
|
+
result.manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
204309
|
+
}
|
|
204310
|
+
}
|
|
204311
|
+
}
|
|
204133
204312
|
return {
|
|
204134
204313
|
manifest: result.manifest,
|
|
204135
204314
|
absolutejs: (app) => hmrPlugin(app.use(staticPlugin2({ assets: buildDir, prefix: "" })))
|
|
@@ -204296,5 +204475,5 @@ export {
|
|
|
204296
204475
|
ANGULAR_INIT_TIMEOUT_MS
|
|
204297
204476
|
};
|
|
204298
204477
|
|
|
204299
|
-
//# debugId=
|
|
204478
|
+
//# debugId=20364D147313555D64756E2164756E21
|
|
204300
204479
|
//# sourceMappingURL=index.js.map
|