@absolutejs/absolute 0.19.0-beta.80 → 0.19.0-beta.82
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 +69 -73
- package/dist/build.js.map +5 -6
- package/dist/index.js +71 -75
- 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/build.js
CHANGED
|
@@ -46,38 +46,6 @@ var __export = (target, all) => {
|
|
|
46
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
47
47
|
var __require = import.meta.require;
|
|
48
48
|
|
|
49
|
-
// src/build/freshReadPlugin.ts
|
|
50
|
-
import { readFileSync } from "fs";
|
|
51
|
-
var createFreshReadPlugin = (changedFiles) => {
|
|
52
|
-
const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
|
|
53
|
-
return {
|
|
54
|
-
name: "fresh-read",
|
|
55
|
-
setup(build) {
|
|
56
|
-
build.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
|
|
57
|
-
const normalized = args.path.replace(/\\/g, "/");
|
|
58
|
-
if (changed.has(normalized)) {
|
|
59
|
-
console.log(`[fresh-read] HIT: ${normalized.split("/").slice(-2).join("/")}`);
|
|
60
|
-
}
|
|
61
|
-
if (!changed.has(normalized))
|
|
62
|
-
return;
|
|
63
|
-
const contents = readFileSync(args.path, "utf-8");
|
|
64
|
-
const ext = args.path.split(".").pop();
|
|
65
|
-
const loaderMap = {
|
|
66
|
-
ts: "ts",
|
|
67
|
-
tsx: "tsx",
|
|
68
|
-
js: "js",
|
|
69
|
-
jsx: "jsx"
|
|
70
|
-
};
|
|
71
|
-
return {
|
|
72
|
-
contents,
|
|
73
|
-
loader: loaderMap[ext ?? ""] ?? "ts"
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
var init_freshReadPlugin = () => {};
|
|
80
|
-
|
|
81
49
|
// src/constants.ts
|
|
82
50
|
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DOM_UPDATE_DELAY_MS = 50, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000;
|
|
83
51
|
var init_constants = __esm(() => {
|
|
@@ -574,14 +542,14 @@ var scanCssEntryPoints = async (dir, ignore) => {
|
|
|
574
542
|
var init_scanCssEntryPoints = () => {};
|
|
575
543
|
|
|
576
544
|
// src/cli/scripts/telemetry.ts
|
|
577
|
-
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync
|
|
545
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
578
546
|
import { homedir } from "os";
|
|
579
547
|
import { join as join2 } from "path";
|
|
580
548
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
581
549
|
try {
|
|
582
550
|
if (!existsSync4(configPath))
|
|
583
551
|
return null;
|
|
584
|
-
const raw =
|
|
552
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
585
553
|
const config = JSON.parse(raw);
|
|
586
554
|
return config;
|
|
587
555
|
} catch {
|
|
@@ -594,14 +562,14 @@ var init_telemetry = __esm(() => {
|
|
|
594
562
|
});
|
|
595
563
|
|
|
596
564
|
// src/cli/telemetryEvent.ts
|
|
597
|
-
import { existsSync as existsSync5, readFileSync as
|
|
565
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
598
566
|
import { arch, platform } from "os";
|
|
599
567
|
import { dirname, join as join3, parse } from "path";
|
|
600
568
|
var checkCandidate = (candidate) => {
|
|
601
569
|
if (!existsSync5(candidate)) {
|
|
602
570
|
return null;
|
|
603
571
|
}
|
|
604
|
-
const pkg = JSON.parse(
|
|
572
|
+
const pkg = JSON.parse(readFileSync2(candidate, "utf-8"));
|
|
605
573
|
if (pkg.name === "@absolutejs/absolute") {
|
|
606
574
|
const ver = pkg.version;
|
|
607
575
|
return ver;
|
|
@@ -898,7 +866,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
898
866
|
};
|
|
899
867
|
|
|
900
868
|
// src/build/angularLinkerPlugin.ts
|
|
901
|
-
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as
|
|
869
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
902
870
|
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve4 } from "path";
|
|
903
871
|
import { createHash } from "crypto";
|
|
904
872
|
var CACHE_DIR, angularLinkerPlugin;
|
|
@@ -925,7 +893,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
925
893
|
const cachePath = join4(CACHE_DIR, `${hash}.js`);
|
|
926
894
|
if (existsSync7(cachePath)) {
|
|
927
895
|
return {
|
|
928
|
-
contents:
|
|
896
|
+
contents: readFileSync3(cachePath, "utf-8"),
|
|
929
897
|
loader: "js"
|
|
930
898
|
};
|
|
931
899
|
}
|
|
@@ -941,7 +909,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
941
909
|
fileSystem: {
|
|
942
910
|
dirname: dirname2,
|
|
943
911
|
exists: existsSync7,
|
|
944
|
-
readFile:
|
|
912
|
+
readFile: readFileSync3,
|
|
945
913
|
relative: relative2,
|
|
946
914
|
resolve: resolve4
|
|
947
915
|
},
|
|
@@ -170483,12 +170451,12 @@ __export(exports_compileAngular, {
|
|
|
170483
170451
|
compileAngularFile: () => compileAngularFile,
|
|
170484
170452
|
compileAngular: () => compileAngular
|
|
170485
170453
|
});
|
|
170486
|
-
import { existsSync as existsSync10, readFileSync as
|
|
170454
|
+
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170487
170455
|
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as relative6 } from "path";
|
|
170488
170456
|
import { createHash as createHash2 } from "crypto";
|
|
170489
170457
|
var import_typescript, computeConfigHash = () => {
|
|
170490
170458
|
try {
|
|
170491
|
-
const content =
|
|
170459
|
+
const content = readFileSync4("./tsconfig.json", "utf-8");
|
|
170492
170460
|
return createHash2("md5").update(content).digest("hex");
|
|
170493
170461
|
} catch {
|
|
170494
170462
|
return "";
|
|
@@ -171042,11 +171010,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
171042
171010
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
171043
171011
|
return;
|
|
171044
171012
|
}
|
|
171045
|
-
const { readFileSync:
|
|
171013
|
+
const { readFileSync: readFileSync5, writeFileSync: writeFileSync3, readdirSync } = await import("fs");
|
|
171046
171014
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
171047
171015
|
for (const file3 of files) {
|
|
171048
171016
|
const filePath = join11(vendorDir, file3);
|
|
171049
|
-
const content =
|
|
171017
|
+
const content = readFileSync5(filePath, "utf-8");
|
|
171050
171018
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
171051
171019
|
continue;
|
|
171052
171020
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -171168,7 +171136,7 @@ import {
|
|
|
171168
171136
|
copyFileSync,
|
|
171169
171137
|
cpSync,
|
|
171170
171138
|
mkdirSync as mkdirSync8,
|
|
171171
|
-
readFileSync as
|
|
171139
|
+
readFileSync as readFileSync5,
|
|
171172
171140
|
rmSync,
|
|
171173
171141
|
writeFileSync as writeFileSync3
|
|
171174
171142
|
} from "fs";
|
|
@@ -171243,10 +171211,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171243
171211
|
await resolveAbsoluteVersion();
|
|
171244
171212
|
const isIncremental = incrementalFiles && incrementalFiles.length > 0;
|
|
171245
171213
|
const normalizedIncrementalFiles = incrementalFiles?.map(normalizePath);
|
|
171246
|
-
const freshReadPlugins = isIncremental ? [createFreshReadPlugin(incrementalFiles)] : [];
|
|
171247
|
-
if (isIncremental) {
|
|
171248
|
-
console.log(`[build] incremental with ${incrementalFiles.length} changed files:`, incrementalFiles.map((f) => f.split("/").slice(-2).join("/")));
|
|
171249
|
-
}
|
|
171250
171214
|
const throwOnError = options?.throwOnError === true;
|
|
171251
171215
|
const hmr = options?.injectHMR === true;
|
|
171252
171216
|
const buildPath = validateSafePath(buildDirectory, projectRoot);
|
|
@@ -171504,7 +171468,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171504
171468
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171505
171469
|
outdir: buildPath,
|
|
171506
171470
|
...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
|
|
171507
|
-
plugins: [...freshReadPlugins],
|
|
171508
171471
|
root: clientRoot,
|
|
171509
171472
|
splitting: true,
|
|
171510
171473
|
target: "browser",
|
|
@@ -171550,7 +171513,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171550
171513
|
format: "esm",
|
|
171551
171514
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171552
171515
|
outdir: serverOutDir,
|
|
171553
|
-
plugins: [...freshReadPlugins],
|
|
171554
171516
|
root: serverRoot,
|
|
171555
171517
|
target: "bun",
|
|
171556
171518
|
throw: false
|
|
@@ -171569,7 +171531,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171569
171531
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
171570
171532
|
outdir: buildPath,
|
|
171571
171533
|
plugins: [
|
|
171572
|
-
...freshReadPlugins,
|
|
171573
171534
|
...angularDir && !isDev ? [angularLinkerPlugin] : [],
|
|
171574
171535
|
...htmlScriptPlugin ? [htmlScriptPlugin] : []
|
|
171575
171536
|
],
|
|
@@ -171674,7 +171635,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171674
171635
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
171675
171636
|
if (!hmrClientBundle)
|
|
171676
171637
|
return;
|
|
171677
|
-
let html =
|
|
171638
|
+
let html = readFileSync5(filePath, "utf-8");
|
|
171678
171639
|
if (html.includes("data-hmr-client"))
|
|
171679
171640
|
return;
|
|
171680
171641
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -171746,7 +171707,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171746
171707
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171747
171708
|
const pagesRel = relative7(process.cwd(), resolve10(reactPagesPath)).replace(/\\/g, "/");
|
|
171748
171709
|
for (const file3 of indexFiles) {
|
|
171749
|
-
let content =
|
|
171710
|
+
let content = readFileSync5(join13(reactIndexesPath, file3), "utf-8");
|
|
171750
171711
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
171751
171712
|
writeFileSync3(join13(devIndexDir, file3), content);
|
|
171752
171713
|
}
|
|
@@ -171772,7 +171733,6 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171772
171733
|
return manifest;
|
|
171773
171734
|
};
|
|
171774
171735
|
var init_build = __esm(() => {
|
|
171775
|
-
init_freshReadPlugin();
|
|
171776
171736
|
init_generateManifest();
|
|
171777
171737
|
init_generateReactIndexes();
|
|
171778
171738
|
init_htmlScriptHMRPlugin();
|
|
@@ -171798,7 +171758,7 @@ var init_build = __esm(() => {
|
|
|
171798
171758
|
});
|
|
171799
171759
|
|
|
171800
171760
|
// src/dev/dependencyGraph.ts
|
|
171801
|
-
import { existsSync as existsSync11, readFileSync as
|
|
171761
|
+
import { existsSync as existsSync11, readFileSync as readFileSync6 } from "fs";
|
|
171802
171762
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
171803
171763
|
import { resolve as resolve11 } from "path";
|
|
171804
171764
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -171965,15 +171925,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
171965
171925
|
const lowerPath = filePath.toLowerCase();
|
|
171966
171926
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
171967
171927
|
if (loader === "html") {
|
|
171968
|
-
const content =
|
|
171928
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
171969
171929
|
return extractHtmlDependencies(filePath, content);
|
|
171970
171930
|
}
|
|
171971
171931
|
if (loader === "tsx" || loader === "js") {
|
|
171972
|
-
const content =
|
|
171932
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
171973
171933
|
return extractJsDependencies(filePath, content, loader);
|
|
171974
171934
|
}
|
|
171975
171935
|
if (isSvelteOrVue) {
|
|
171976
|
-
const content =
|
|
171936
|
+
const content = readFileSync6(filePath, "utf-8");
|
|
171977
171937
|
return extractSvelteVueDependencies(filePath, content);
|
|
171978
171938
|
}
|
|
171979
171939
|
return [];
|
|
@@ -172408,10 +172368,10 @@ var init_assetStore = __esm(() => {
|
|
|
172408
172368
|
});
|
|
172409
172369
|
|
|
172410
172370
|
// src/dev/fileHashTracker.ts
|
|
172411
|
-
import { readFileSync as
|
|
172371
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
172412
172372
|
var computeFileHash = (filePath) => {
|
|
172413
172373
|
try {
|
|
172414
|
-
const fileContent =
|
|
172374
|
+
const fileContent = readFileSync7(filePath);
|
|
172415
172375
|
return Number(Bun.hash(fileContent));
|
|
172416
172376
|
} catch {
|
|
172417
172377
|
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 resolve17, 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');`,
|
|
@@ -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,42 @@ 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 tmpConfig = resolve20(process.cwd(), ".absolutejs", "build-config.json");
|
|
204345
|
+
const tmpScript = resolve20(process.cwd(), ".absolutejs", "fresh-build.ts");
|
|
204346
|
+
const { mkdirSync: mkdirSync9, writeFileSync: writeFileSync5 } = await import("fs");
|
|
204347
|
+
mkdirSync9(resolve20(process.cwd(), ".absolutejs"), { recursive: true });
|
|
204348
|
+
writeFileSync5(tmpConfig, JSON.stringify(buildConfig));
|
|
204349
|
+
writeFileSync5(tmpScript, `import { build } from "@absolutejs/absolute";
|
|
204350
|
+
const config = JSON.parse(await Bun.file(${JSON.stringify(tmpConfig)}).text());
|
|
204351
|
+
const manifest = await build(config);
|
|
204352
|
+
console.log("__MANIFEST__" + JSON.stringify(manifest));
|
|
204353
|
+
`);
|
|
204354
|
+
const proc = Bun.spawn(["bun", "run", tmpScript], {
|
|
204355
|
+
cwd: process.cwd(),
|
|
204356
|
+
stderr: "pipe",
|
|
204357
|
+
stdout: "pipe"
|
|
204358
|
+
});
|
|
204359
|
+
const stdout = await new Response(proc.stdout).text();
|
|
204360
|
+
const stderr = await new Response(proc.stderr).text();
|
|
204361
|
+
await proc.exited;
|
|
204362
|
+
if (proc.exitCode !== 0) {
|
|
204363
|
+
logWarn(`Fresh build stderr: ${stderr.slice(0, 500)}`);
|
|
204364
|
+
manifest = await build(buildConfig);
|
|
204365
|
+
} else {
|
|
204366
|
+
const manifestLine = stdout.split(`
|
|
204367
|
+
`).find((l) => l.startsWith("__MANIFEST__"));
|
|
204368
|
+
if (manifestLine) {
|
|
204369
|
+
manifest = JSON.parse(manifestLine.slice("__MANIFEST__".length));
|
|
204370
|
+
} else {
|
|
204371
|
+
manifest = await build(buildConfig);
|
|
204372
|
+
}
|
|
204373
|
+
}
|
|
204374
|
+
} else {
|
|
204375
|
+
manifest = await build(buildConfig);
|
|
204376
|
+
}
|
|
204381
204377
|
if (!manifest) {
|
|
204382
204378
|
throw new Error("Build failed - no manifest generated");
|
|
204383
204379
|
}
|
|
@@ -204562,13 +204558,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
204562
204558
|
});
|
|
204563
204559
|
await rm9(tmpDir, { force: true, recursive: true });
|
|
204564
204560
|
if (result.success) {
|
|
204565
|
-
const { readdirSync, readFileSync:
|
|
204561
|
+
const { readdirSync, readFileSync: readFileSync10, writeFileSync: writeFileSync5 } = await import("fs");
|
|
204566
204562
|
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
204567
204563
|
const reactPaths = computeVendorPaths2();
|
|
204568
204564
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
204569
204565
|
for (const file3 of files) {
|
|
204570
204566
|
const filePath = join16(vendorDir, file3);
|
|
204571
|
-
let content =
|
|
204567
|
+
let content = readFileSync10(filePath, "utf-8");
|
|
204572
204568
|
let changed = false;
|
|
204573
204569
|
for (const [specifier, webPath] of Object.entries(reactPaths)) {
|
|
204574
204570
|
const escaped = specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -204905,5 +204901,5 @@ export {
|
|
|
204905
204901
|
build
|
|
204906
204902
|
};
|
|
204907
204903
|
|
|
204908
|
-
//# debugId=
|
|
204904
|
+
//# debugId=AAC98E4F6883D08F64756E2164756E21
|
|
204909
204905
|
//# sourceMappingURL=build.js.map
|