@absolutejs/absolute 0.20.0-beta.129 → 0.20.0-beta.130
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/CHANGELOG.md +16 -0
- package/changelog.json +26 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +612 -558
- package/dist/build.js.map +7 -7
- package/dist/cli/{buildDepVendor-rz5w5cp0.js → buildDepVendor-8akhr8n8.js} +3 -6
- package/dist/cli/{dev-m9qttkr7.js → dev-qg7fr16s.js} +26 -1
- package/dist/cli/index-4rhxthsy.js +8 -0
- package/dist/cli/index.js +1 -1
- package/dist/dev/serverBootstrap.js +44 -22
- package/dist/index.js +633 -576
- package/dist/index.js.map +10 -10
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/src/dev/fileHashTracker.d.ts +1 -0
- package/dist/src/dev/hot/appLifecycle.d.ts +1 -0
- package/dist/src/dev/hot/plugin.d.ts +11 -1
- package/dist/src/dev/hot/reload.d.ts +3 -0
- package/dist/src/dev/hot/runtime.d.ts +5 -1
- package/dist/types/globals.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26081,7 +26081,7 @@ var init_compileAngular = __esm(() => {
|
|
|
26081
26081
|
|
|
26082
26082
|
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
26083
26083
|
var require_content_tag = __commonJS(function(exports, module) {
|
|
26084
|
-
var __dirname = "/tmp/claude-1000/-home-alexkahn-onspark-absolutejs-dealroom/2bfd88db-2cb9-4088-8977-3c07598f96a5/scratchpad/
|
|
26084
|
+
var __dirname = "/tmp/claude-1000/-home-alexkahn-onspark-absolutejs-dealroom/2bfd88db-2cb9-4088-8977-3c07598f96a5/scratchpad/gate130/node_modules/content-tag/pkg/node";
|
|
26085
26085
|
var imports = {};
|
|
26086
26086
|
imports["__wbindgen_placeholder__"] = exports;
|
|
26087
26087
|
var wasm;
|
|
@@ -30306,7 +30306,7 @@ var init_restartScope = __esm(() => {
|
|
|
30306
30306
|
});
|
|
30307
30307
|
|
|
30308
30308
|
// src/dev/fileHashTracker.ts
|
|
30309
|
-
import { readFileSync as readFileSync36 } from "fs";
|
|
30309
|
+
import { readFileSync as readFileSync36, statSync as statSync7 } from "fs";
|
|
30310
30310
|
var computeFileHash = (filePath) => {
|
|
30311
30311
|
try {
|
|
30312
30312
|
const fileContent = readFileSync36(filePath);
|
|
@@ -30321,6 +30321,14 @@ var computeFileHash = (filePath) => {
|
|
|
30321
30321
|
return true;
|
|
30322
30322
|
}
|
|
30323
30323
|
return previousHash !== currentHash;
|
|
30324
|
+
}, predatesProcess = (filePath, previousHashes, processStart = performance.timeOrigin) => {
|
|
30325
|
+
if (previousHashes.has(normalizePath2(filePath)))
|
|
30326
|
+
return false;
|
|
30327
|
+
try {
|
|
30328
|
+
return statSync7(filePath).mtimeMs < processStart;
|
|
30329
|
+
} catch {
|
|
30330
|
+
return false;
|
|
30331
|
+
}
|
|
30324
30332
|
};
|
|
30325
30333
|
var init_fileHashTracker = __esm(() => {
|
|
30326
30334
|
init_constants();
|
|
@@ -30626,7 +30634,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
30626
30634
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
30627
30635
|
resolveOwningComponents: () => resolveOwningComponents
|
|
30628
30636
|
});
|
|
30629
|
-
import { readdirSync as readdirSync11, readFileSync as readFileSync37, statSync as
|
|
30637
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync37, statSync as statSync8 } from "fs";
|
|
30630
30638
|
import { dirname as dirname32, extname as extname14, join as join55, resolve as resolve47 } from "path";
|
|
30631
30639
|
import ts19 from "typescript";
|
|
30632
30640
|
var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") || file6.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
@@ -30761,7 +30769,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30761
30769
|
}
|
|
30762
30770
|
let rootStat;
|
|
30763
30771
|
try {
|
|
30764
|
-
rootStat =
|
|
30772
|
+
rootStat = statSync8(userAngularRoot);
|
|
30765
30773
|
} catch {
|
|
30766
30774
|
return out;
|
|
30767
30775
|
}
|
|
@@ -30819,7 +30827,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30819
30827
|
const angularRootNorm = safeNormalize(angularRoot);
|
|
30820
30828
|
for (const candidate of candidates) {
|
|
30821
30829
|
try {
|
|
30822
|
-
if (
|
|
30830
|
+
if (statSync8(candidate).isFile()) {
|
|
30823
30831
|
const norm = safeNormalize(candidate);
|
|
30824
30832
|
if (!norm.startsWith(angularRootNorm))
|
|
30825
30833
|
return null;
|
|
@@ -30876,7 +30884,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30876
30884
|
const norm = safeNormalize(params.changedFilePath);
|
|
30877
30885
|
let rootStat;
|
|
30878
30886
|
try {
|
|
30879
|
-
rootStat =
|
|
30887
|
+
rootStat = statSync8(params.userAngularRoot);
|
|
30880
30888
|
} catch {
|
|
30881
30889
|
return [];
|
|
30882
30890
|
}
|
|
@@ -31113,7 +31121,7 @@ __export(exports_moduleServer, {
|
|
|
31113
31121
|
warmPage: () => warmPage,
|
|
31114
31122
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
31115
31123
|
});
|
|
31116
|
-
import { existsSync as existsSync43, readFileSync as readFileSync38, realpathSync as realpathSync4, statSync as
|
|
31124
|
+
import { existsSync as existsSync43, readFileSync as readFileSync38, realpathSync as realpathSync4, statSync as statSync9 } from "fs";
|
|
31117
31125
|
import { basename as basename19, dirname as dirname33, extname as extname15, join as join56, resolve as resolve48, relative as relative21 } from "path";
|
|
31118
31126
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
31119
31127
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -31171,7 +31179,7 @@ ${stubs}
|
|
|
31171
31179
|
if (cached !== undefined)
|
|
31172
31180
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
31173
31181
|
try {
|
|
31174
|
-
const mtime = Math.round(
|
|
31182
|
+
const mtime = Math.round(statSync9(absPath).mtimeMs);
|
|
31175
31183
|
mtimeCache.set(absPath, mtime);
|
|
31176
31184
|
return `${base}?v=${buildVersion(mtime, absPath)}`;
|
|
31177
31185
|
} catch {
|
|
@@ -31825,7 +31833,7 @@ export default {};
|
|
|
31825
31833
|
return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
31826
31834
|
if (!TRANSPILABLE.has(ext))
|
|
31827
31835
|
return;
|
|
31828
|
-
const stat4 =
|
|
31836
|
+
const stat4 = statSync9(filePath);
|
|
31829
31837
|
const resolvedVueDir = vueDir ? resolve48(vueDir) : undefined;
|
|
31830
31838
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
31831
31839
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
@@ -31853,12 +31861,12 @@ export default {};
|
|
|
31853
31861
|
cachedAngularUserRoot = configuredAngularUserRoot ?? null;
|
|
31854
31862
|
return cachedAngularUserRoot;
|
|
31855
31863
|
}, configuredAngularUserRoot, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
31856
|
-
const stat4 =
|
|
31864
|
+
const stat4 = statSync9(filePath);
|
|
31857
31865
|
const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
|
|
31858
31866
|
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
31859
31867
|
return jsResponse(content);
|
|
31860
31868
|
}, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
31861
|
-
const stat4 =
|
|
31869
|
+
const stat4 = statSync9(filePath);
|
|
31862
31870
|
const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
31863
31871
|
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
31864
31872
|
return jsResponse(content);
|
|
@@ -32425,7 +32433,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
32425
32433
|
var init_simpleHTMXHMR = () => {};
|
|
32426
32434
|
|
|
32427
32435
|
// src/dev/backendGraph.ts
|
|
32428
|
-
import { readFileSync as readFileSync39, realpathSync as realpathSync5, statSync as
|
|
32436
|
+
import { readFileSync as readFileSync39, realpathSync as realpathSync5, statSync as statSync10 } from "fs";
|
|
32429
32437
|
import { dirname as dirname35, extname as extname16, resolve as resolve52 } from "path";
|
|
32430
32438
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path2) => {
|
|
32431
32439
|
const loader = LOADERS[extname16(path2)] ?? "ts";
|
|
@@ -32450,7 +32458,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
32450
32458
|
}, readImports = (path2) => {
|
|
32451
32459
|
let mtimeMs;
|
|
32452
32460
|
try {
|
|
32453
|
-
({ mtimeMs } =
|
|
32461
|
+
({ mtimeMs } = statSync10(path2));
|
|
32454
32462
|
} catch {
|
|
32455
32463
|
fileCache.delete(path2);
|
|
32456
32464
|
return [];
|
|
@@ -33206,6 +33214,7 @@ __export(exports_runtime, {
|
|
|
33206
33214
|
setAnalysis: () => setAnalysis,
|
|
33207
33215
|
setCurrent: () => setCurrent
|
|
33208
33216
|
});
|
|
33217
|
+
import { relative as relative23 } from "path";
|
|
33209
33218
|
var records, recordFor = (path2) => {
|
|
33210
33219
|
const existing = records.get(path2);
|
|
33211
33220
|
if (existing)
|
|
@@ -33215,6 +33224,7 @@ var records, recordFor = (path2) => {
|
|
|
33215
33224
|
generation: 0,
|
|
33216
33225
|
keys: new Map,
|
|
33217
33226
|
lastChanged: new Set,
|
|
33227
|
+
lastTimings: new Map,
|
|
33218
33228
|
meta: {},
|
|
33219
33229
|
path: path2,
|
|
33220
33230
|
revisions: new Map,
|
|
@@ -33266,11 +33276,23 @@ var records, recordFor = (path2) => {
|
|
|
33266
33276
|
reran: new Set,
|
|
33267
33277
|
seen: new Set,
|
|
33268
33278
|
slots: new Map,
|
|
33279
|
+
timings: new Map,
|
|
33269
33280
|
...decideReruns(record, plan, meta)
|
|
33270
33281
|
};
|
|
33271
33282
|
record.pending = pending;
|
|
33272
33283
|
const { generation } = pending;
|
|
33273
|
-
const owned = (id, work) =>
|
|
33284
|
+
const owned = (id, work) => {
|
|
33285
|
+
const startedAt = performance.now();
|
|
33286
|
+
const result = runOwned(ownerOf(path2, id), generation, work);
|
|
33287
|
+
pending.timings.set(id, performance.now() - startedAt);
|
|
33288
|
+
return result;
|
|
33289
|
+
};
|
|
33290
|
+
const ownedAsync = async (id, work) => {
|
|
33291
|
+
const startedAt = performance.now();
|
|
33292
|
+
const result = await runOwned(ownerOf(path2, id), generation, work);
|
|
33293
|
+
pending.timings.set(id, performance.now() - startedAt);
|
|
33294
|
+
return result;
|
|
33295
|
+
};
|
|
33274
33296
|
const kept = (id) => {
|
|
33275
33297
|
pending.seen.add(id);
|
|
33276
33298
|
const previous = record.slots.get(id);
|
|
@@ -33296,7 +33318,7 @@ var records, recordFor = (path2) => {
|
|
|
33296
33318
|
ca: async (name, id, init) => {
|
|
33297
33319
|
if (kept(id) && name in record.cells)
|
|
33298
33320
|
return;
|
|
33299
|
-
record.cells[name] = await
|
|
33321
|
+
record.cells[name] = await ownedAsync(id, init);
|
|
33300
33322
|
store(id, undefined);
|
|
33301
33323
|
},
|
|
33302
33324
|
end: () => commit(record, pending),
|
|
@@ -33310,7 +33332,7 @@ var records, recordFor = (path2) => {
|
|
|
33310
33332
|
const previous = kept(id);
|
|
33311
33333
|
if (previous)
|
|
33312
33334
|
return previous.value;
|
|
33313
|
-
return store(id, await
|
|
33335
|
+
return store(id, await ownedAsync(id, factory));
|
|
33314
33336
|
},
|
|
33315
33337
|
r: (id, effect) => {
|
|
33316
33338
|
if (kept(id))
|
|
@@ -33321,7 +33343,7 @@ var records, recordFor = (path2) => {
|
|
|
33321
33343
|
ra: async (id, effect) => {
|
|
33322
33344
|
if (kept(id))
|
|
33323
33345
|
return;
|
|
33324
|
-
await
|
|
33346
|
+
await ownedAsync(id, effect);
|
|
33325
33347
|
store(id, undefined);
|
|
33326
33348
|
}
|
|
33327
33349
|
};
|
|
@@ -33341,7 +33363,7 @@ var records, recordFor = (path2) => {
|
|
|
33341
33363
|
}, statementOwners = (path2, ids) => new Set([...ids].map((id) => ownerOf(path2, id))), logDisposed = (path2, counts) => {
|
|
33342
33364
|
const parts = Object.entries(counts).map(([kind, count]) => `${count} ${kind}${count === 1 ? "" : "s"}`);
|
|
33343
33365
|
if (parts.length > 0)
|
|
33344
|
-
console.log(`[hmr] stopped ${parts.join(", ")} started by replaced code in ${path2}`);
|
|
33366
|
+
console.log(`[hmr] stopped ${parts.join(", ")} started by replaced code in ${relative23(process.cwd(), path2) || path2}`);
|
|
33345
33367
|
}, stopReplaced = async (record, pending, replaced) => {
|
|
33346
33368
|
const owners = statementOwners(record.path, replaced.keys());
|
|
33347
33369
|
const counts = await disposeResources((owner, generation) => owners.has(owner) && generation < pending.generation);
|
|
@@ -33360,6 +33382,7 @@ var records, recordFor = (path2) => {
|
|
|
33360
33382
|
record.meta = pending.meta;
|
|
33361
33383
|
record.keys = pending.keys;
|
|
33362
33384
|
record.lastChanged = pending.changedExports;
|
|
33385
|
+
record.lastTimings = pending.timings;
|
|
33363
33386
|
for (const name of pending.changedExports)
|
|
33364
33387
|
record.revisions.set(name, (record.revisions.get(name) ?? 0) + 1);
|
|
33365
33388
|
if (replaced.size === 0)
|
|
@@ -33420,12 +33443,12 @@ var records, recordFor = (path2) => {
|
|
|
33420
33443
|
};
|
|
33421
33444
|
var init_runtime = __esm(() => {
|
|
33422
33445
|
init_hotResources();
|
|
33423
|
-
records = new Map;
|
|
33446
|
+
records = globalThis.__absoluteHotRecords ??= new Map;
|
|
33424
33447
|
});
|
|
33425
33448
|
|
|
33426
33449
|
// src/dev/hot/plugin.ts
|
|
33427
33450
|
import { mkdirSync as mkdirSync14, readFileSync as readFileSync40, realpathSync as realpathSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
33428
|
-
import { extname as extname18, join as join57, relative as
|
|
33451
|
+
import { extname as extname18, join as join57, relative as relative24, resolve as resolve53, sep as sep6 } from "path";
|
|
33429
33452
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path2) => {
|
|
33430
33453
|
try {
|
|
33431
33454
|
return realpathSync6(path2);
|
|
@@ -33435,7 +33458,8 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path2) => {
|
|
|
33435
33458
|
}, typescript, loadTypescript = async () => {
|
|
33436
33459
|
typescript ??= await import("typescript");
|
|
33437
33460
|
return typescript;
|
|
33438
|
-
},
|
|
33461
|
+
}, shared, analyses, isHotManaged = (path2) => {
|
|
33462
|
+
const state2 = shared.installed;
|
|
33439
33463
|
if (!state2)
|
|
33440
33464
|
return false;
|
|
33441
33465
|
const file6 = realPath3(path2);
|
|
@@ -33464,6 +33488,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path2) => {
|
|
|
33464
33488
|
return typeof Reflect.get(value, "reason") === "string";
|
|
33465
33489
|
return status === true && typeof Reflect.get(value, "code") === "string" && typeof Reflect.get(value, "exports") === "object" && Array.isArray(Reflect.get(value, "reexports")) && Array.isArray(Reflect.get(value, "plan"));
|
|
33466
33490
|
}, cachePath = (cacheDir2, key) => join57(cacheDir2, `${key}.json`), readCached = (key) => {
|
|
33491
|
+
const state2 = shared.installed;
|
|
33467
33492
|
if (!state2)
|
|
33468
33493
|
return;
|
|
33469
33494
|
try {
|
|
@@ -33473,6 +33498,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path2) => {
|
|
|
33473
33498
|
return;
|
|
33474
33499
|
}
|
|
33475
33500
|
}, writeCached = (key, analysis) => {
|
|
33501
|
+
const state2 = shared.installed;
|
|
33476
33502
|
if (!state2)
|
|
33477
33503
|
return;
|
|
33478
33504
|
try {
|
|
@@ -33501,16 +33527,21 @@ var init_plugin = __esm(() => {
|
|
|
33501
33527
|
TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
|
|
33502
33528
|
GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
|
|
33503
33529
|
ABSOLUTE_ROOT = resolve53(import.meta.dir, "..", "..", "..");
|
|
33504
|
-
|
|
33530
|
+
shared = globalThis.__absoluteHotPlugin ??= {
|
|
33531
|
+
analyses: new Map,
|
|
33532
|
+
installed: undefined
|
|
33533
|
+
};
|
|
33534
|
+
({ analyses } = shared);
|
|
33505
33535
|
});
|
|
33506
33536
|
|
|
33507
33537
|
// src/dev/hot/reload.ts
|
|
33508
33538
|
var exports_reload = {};
|
|
33509
33539
|
__export(exports_reload, {
|
|
33510
|
-
applyServerChange: () => applyServerChange
|
|
33540
|
+
applyServerChange: () => applyServerChange,
|
|
33541
|
+
reportEntryUpdate: () => reportEntryUpdate
|
|
33511
33542
|
});
|
|
33512
33543
|
import { readFileSync as readFileSync41, realpathSync as realpathSync7 } from "fs";
|
|
33513
|
-
import { relative as
|
|
33544
|
+
import { relative as relative25 } from "path";
|
|
33514
33545
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path2) => {
|
|
33515
33546
|
try {
|
|
33516
33547
|
return realpathSync7(path2);
|
|
@@ -33548,7 +33579,21 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path2) => {
|
|
|
33548
33579
|
if (typeof namespace !== "object" || namespace === null)
|
|
33549
33580
|
throw new Error(`${path2} did not evaluate to a module`);
|
|
33550
33581
|
return Object.fromEntries(Object.entries(namespace));
|
|
33551
|
-
}, display = (path2) =>
|
|
33582
|
+
}, display = (path2) => relative25(process.cwd(), path2) || path2, SLOW_UPDATE_MS = 500, SLOWEST_SHOWN = 3, statementLabel = (id) => {
|
|
33583
|
+
const name = id.slice(id.indexOf(":") + 1);
|
|
33584
|
+
return /^\d+$/.test(name) ? `statement #${name}` : name;
|
|
33585
|
+
}, slowestStatements = (modules) => modules.flatMap((module) => [...moduleRecord(module)?.lastTimings ?? []].map(([id, duration]) => ({
|
|
33586
|
+
duration,
|
|
33587
|
+
label: `${display(module)} ${statementLabel(id)}`
|
|
33588
|
+
}))).sort((left, right) => right.duration - left.duration).slice(0, SLOWEST_SHOWN).map(({ label, duration }) => `${label} ${Math.round(duration)}ms`), SHOWN_STATEMENTS = 5, reportEntryUpdate = (entryPath, elapsed) => {
|
|
33589
|
+
const entry = realPath4(entryPath);
|
|
33590
|
+
const reran = [...moduleRecord(entry)?.lastTimings.keys() ?? []].map(statementLabel);
|
|
33591
|
+
const shown = reran.slice(0, SHOWN_STATEMENTS).join(", ");
|
|
33592
|
+
const more = reran.length > SHOWN_STATEMENTS ? ` and ${reran.length - SHOWN_STATEMENTS} more` : "";
|
|
33593
|
+
console.log(`[hmr] server: ${display(entry)} updated in ${Math.round(elapsed)}ms${reran.length > 0 ? ` (re-ran: ${shown}${more})` : ""}`);
|
|
33594
|
+
if (elapsed >= SLOW_UPDATE_MS)
|
|
33595
|
+
console.log(`[hmr] server: slowest statements: ${slowestStatements([entry]).join(", ")}`);
|
|
33596
|
+
}, advance = async (path2) => {
|
|
33552
33597
|
const record = moduleRecord(path2);
|
|
33553
33598
|
const before = { ...record?.meta ?? {} };
|
|
33554
33599
|
const shapeBefore = shapeOf(record?.analysis);
|
|
@@ -33605,6 +33650,11 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path2) => {
|
|
|
33605
33650
|
const elapsed = Math.round(performance.now() - startedAt);
|
|
33606
33651
|
const others = modules.slice(1).map(display);
|
|
33607
33652
|
console.log(`[hmr] server: ${display(path2)} updated in ${elapsed}ms${others.length > 0 || entryAffected ? ` (also re-ran: ${[...others, ...entryAffected ? [display(entry)] : []].join(", ")})` : ""}`);
|
|
33653
|
+
if (elapsed >= SLOW_UPDATE_MS)
|
|
33654
|
+
console.log(`[hmr] server: slowest statements: ${slowestStatements([
|
|
33655
|
+
...modules,
|
|
33656
|
+
...entryAffected ? [entry] : []
|
|
33657
|
+
]).join(", ")}`);
|
|
33608
33658
|
return { entry: entryAffected, modules, ms: elapsed, status: "applied" };
|
|
33609
33659
|
}, propagate = async (pending, entry, progress) => {
|
|
33610
33660
|
const [next, ...rest] = pending;
|
|
@@ -33642,9 +33692,10 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path2) => {
|
|
|
33642
33692
|
}, reportFailure = (path2, error) => {
|
|
33643
33693
|
console.error(`[hmr] server: ${display(path2)} failed to update; the previous version keeps serving.`);
|
|
33644
33694
|
console.error(error);
|
|
33645
|
-
},
|
|
33646
|
-
const
|
|
33647
|
-
|
|
33695
|
+
}, applyServerChange = (path2, entryPath) => {
|
|
33696
|
+
const previous = globalThis.__absoluteHotApplyChain ?? Promise.resolve();
|
|
33697
|
+
const result = previous.then(() => apply(path2, entryPath));
|
|
33698
|
+
globalThis.__absoluteHotApplyChain = result.catch(() => {
|
|
33648
33699
|
return;
|
|
33649
33700
|
});
|
|
33650
33701
|
return result;
|
|
@@ -33653,7 +33704,6 @@ var init_reload = __esm(() => {
|
|
|
33653
33704
|
init_backendGraph();
|
|
33654
33705
|
init_plugin();
|
|
33655
33706
|
init_runtime();
|
|
33656
|
-
chain = Promise.resolve();
|
|
33657
33707
|
});
|
|
33658
33708
|
|
|
33659
33709
|
// src/dev/rebuildTrigger.ts
|
|
@@ -33663,20 +33713,20 @@ __export(exports_rebuildTrigger, {
|
|
|
33663
33713
|
queueFileChange: () => queueFileChange,
|
|
33664
33714
|
triggerRebuild: () => triggerRebuild
|
|
33665
33715
|
});
|
|
33666
|
-
import { existsSync as existsSync44, readdirSync as readdirSync12, rmSync as rmSync4, statSync as
|
|
33716
|
+
import { existsSync as existsSync44, readdirSync as readdirSync12, rmSync as rmSync4, statSync as statSync11 } from "fs";
|
|
33667
33717
|
import {
|
|
33668
33718
|
basename as basename20,
|
|
33669
33719
|
dirname as dirname37,
|
|
33670
33720
|
isAbsolute as isAbsolute10,
|
|
33671
33721
|
join as join58,
|
|
33672
|
-
relative as
|
|
33722
|
+
relative as relative26,
|
|
33673
33723
|
resolve as resolvePath,
|
|
33674
33724
|
sep as sep7
|
|
33675
33725
|
} from "path";
|
|
33676
33726
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
33677
33727
|
clearSpaRouteCssCaches();
|
|
33678
33728
|
clearSiblingCssCache();
|
|
33679
|
-
}, runSequentially = (items, action) => items.reduce((
|
|
33729
|
+
}, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state2, config, files) => {
|
|
33680
33730
|
if (!config.tailwind)
|
|
33681
33731
|
return;
|
|
33682
33732
|
if (!files.some(isTailwindCandidate))
|
|
@@ -33684,20 +33734,20 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33684
33734
|
const startedAt = performance.now();
|
|
33685
33735
|
try {
|
|
33686
33736
|
const { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 } = await Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind));
|
|
33687
|
-
const { cssChanged } = await incrementalTailwindBuild(config.tailwind,
|
|
33737
|
+
const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state2.resolvedPaths.buildDir, files, getStyleTransformConfig(config), computeFrameworkTailwindSources2(config));
|
|
33688
33738
|
if (!cssChanged)
|
|
33689
33739
|
return;
|
|
33690
33740
|
try {
|
|
33691
|
-
const outputPath = resolvePath(
|
|
33741
|
+
const outputPath = resolvePath(state2.resolvedPaths.buildDir, config.tailwind.output);
|
|
33692
33742
|
const bytes = await Bun.file(outputPath).bytes();
|
|
33693
33743
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
33694
|
-
|
|
33744
|
+
state2.assetStore.set(webPath, bytes);
|
|
33695
33745
|
} catch {}
|
|
33696
|
-
broadcastToClients(
|
|
33746
|
+
broadcastToClients(state2, {
|
|
33697
33747
|
data: {
|
|
33698
33748
|
cause: files.filter(isTailwindCandidate),
|
|
33699
33749
|
framework: "tailwind",
|
|
33700
|
-
manifest:
|
|
33750
|
+
manifest: state2.manifest,
|
|
33701
33751
|
serverDuration: Math.round(performance.now() - startedAt)
|
|
33702
33752
|
},
|
|
33703
33753
|
message: "Tailwind utilities recompiled",
|
|
@@ -33777,8 +33827,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33777
33827
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
33778
33828
|
}
|
|
33779
33829
|
return { ...parsed, framework: detectedFw };
|
|
33780
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync44(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (
|
|
33781
|
-
const { config } =
|
|
33830
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync44(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state2, deletedFile) => {
|
|
33831
|
+
const { config } = state2;
|
|
33782
33832
|
const cwd2 = process.cwd();
|
|
33783
33833
|
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
33784
33834
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
@@ -33804,11 +33854,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33804
33854
|
}
|
|
33805
33855
|
return;
|
|
33806
33856
|
}
|
|
33807
|
-
}, collectDeletedFileAffected = (
|
|
33808
|
-
|
|
33809
|
-
removeStaleGenerated(
|
|
33857
|
+
}, collectDeletedFileAffected = (state2, filePathInSet, processedFiles, validFiles) => {
|
|
33858
|
+
state2.fileHashes.delete(filePathInSet);
|
|
33859
|
+
removeStaleGenerated(state2, filePathInSet);
|
|
33810
33860
|
try {
|
|
33811
|
-
const affectedFiles = getAffectedFiles(
|
|
33861
|
+
const affectedFiles = getAffectedFiles(state2.dependencyGraph, filePathInSet);
|
|
33812
33862
|
const deletedPathResolved = resolvePath(filePathInSet);
|
|
33813
33863
|
affectedFiles.forEach((affectedFile) => {
|
|
33814
33864
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
@@ -33817,9 +33867,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33817
33867
|
}
|
|
33818
33868
|
});
|
|
33819
33869
|
} catch {}
|
|
33820
|
-
}, incrementDependentVersions = (
|
|
33870
|
+
}, incrementDependentVersions = (state2, normalizedFilePath) => {
|
|
33821
33871
|
try {
|
|
33822
|
-
const dependents =
|
|
33872
|
+
const dependents = state2.dependencyGraph.dependents.get(normalizedFilePath);
|
|
33823
33873
|
if (!dependents || dependents.size === 0) {
|
|
33824
33874
|
return;
|
|
33825
33875
|
}
|
|
@@ -33827,7 +33877,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33827
33877
|
if (dependentFiles.length === 0) {
|
|
33828
33878
|
return;
|
|
33829
33879
|
}
|
|
33830
|
-
incrementSourceFileVersions(
|
|
33880
|
+
incrementSourceFileVersions(state2, dependentFiles);
|
|
33831
33881
|
} catch {}
|
|
33832
33882
|
}, addUnprocessedFile = (normalizedFilePath, processedFiles, validFiles) => {
|
|
33833
33883
|
if (processedFiles.has(normalizedFilePath)) {
|
|
@@ -33835,9 +33885,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33835
33885
|
}
|
|
33836
33886
|
validFiles.push(normalizedFilePath);
|
|
33837
33887
|
processedFiles.add(normalizedFilePath);
|
|
33838
|
-
}, collectChangedFileAffected = (
|
|
33888
|
+
}, collectChangedFileAffected = (state2, normalizedFilePath, processedFiles, validFiles) => {
|
|
33839
33889
|
try {
|
|
33840
|
-
const affectedFiles = getAffectedFiles(
|
|
33890
|
+
const affectedFiles = getAffectedFiles(state2.dependencyGraph, normalizedFilePath);
|
|
33841
33891
|
affectedFiles.forEach((affectedFile) => {
|
|
33842
33892
|
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync44(affectedFile)) {
|
|
33843
33893
|
validFiles.push(affectedFile);
|
|
@@ -33847,9 +33897,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33847
33897
|
} catch {
|
|
33848
33898
|
addUnprocessedFile(normalizedFilePath, processedFiles, validFiles);
|
|
33849
33899
|
}
|
|
33850
|
-
}, processChangedFile2 = (
|
|
33900
|
+
}, processChangedFile2 = (state2, filePathInSet, processedFiles, validFiles) => {
|
|
33851
33901
|
const fileHash = computeFileHash(filePathInSet);
|
|
33852
|
-
const storedHash =
|
|
33902
|
+
const storedHash = state2.fileHashes.get(filePathInSet);
|
|
33853
33903
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
33854
33904
|
return;
|
|
33855
33905
|
}
|
|
@@ -33858,38 +33908,38 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33858
33908
|
validFiles.push(normalizedFilePath);
|
|
33859
33909
|
processedFiles.add(normalizedFilePath);
|
|
33860
33910
|
}
|
|
33861
|
-
|
|
33862
|
-
incrementSourceFileVersions(
|
|
33863
|
-
incrementDependentVersions(
|
|
33864
|
-
collectChangedFileAffected(
|
|
33865
|
-
}, processFilePathSet = (
|
|
33911
|
+
state2.fileHashes.set(normalizedFilePath, fileHash);
|
|
33912
|
+
incrementSourceFileVersions(state2, [normalizedFilePath]);
|
|
33913
|
+
incrementDependentVersions(state2, normalizedFilePath);
|
|
33914
|
+
collectChangedFileAffected(state2, normalizedFilePath, processedFiles, validFiles);
|
|
33915
|
+
}, processFilePathSet = (state2, filePathSet, processedFiles, validFiles) => {
|
|
33866
33916
|
filePathSet.forEach((filePathInSet) => {
|
|
33867
33917
|
if (!existsSync44(filePathInSet)) {
|
|
33868
|
-
collectDeletedFileAffected(
|
|
33918
|
+
collectDeletedFileAffected(state2, filePathInSet, processedFiles, validFiles);
|
|
33869
33919
|
return;
|
|
33870
33920
|
}
|
|
33871
|
-
processChangedFile2(
|
|
33921
|
+
processChangedFile2(state2, filePathInSet, processedFiles, validFiles);
|
|
33872
33922
|
});
|
|
33873
|
-
}, detectFrameworkForValidFiles = (validFiles,
|
|
33923
|
+
}, detectFrameworkForValidFiles = (validFiles, state2) => {
|
|
33874
33924
|
const [firstFile] = validFiles;
|
|
33875
33925
|
if (!firstFile) {
|
|
33876
33926
|
return;
|
|
33877
33927
|
}
|
|
33878
|
-
return detectFramework(firstFile,
|
|
33879
|
-
}, buildFilesToProcess = (
|
|
33928
|
+
return detectFramework(firstFile, state2.resolvedPaths);
|
|
33929
|
+
}, buildFilesToProcess = (state2) => {
|
|
33880
33930
|
const filesToProcess = new Map;
|
|
33881
33931
|
const uniqueFilesByFramework = new Map;
|
|
33882
|
-
|
|
33932
|
+
state2.fileChangeQueue.forEach((filePaths, fwKey) => {
|
|
33883
33933
|
uniqueFilesByFramework.set(fwKey, new Set(filePaths));
|
|
33884
33934
|
});
|
|
33885
33935
|
uniqueFilesByFramework.forEach((filePathSet) => {
|
|
33886
33936
|
const validFiles = [];
|
|
33887
33937
|
const processedFiles = new Set;
|
|
33888
|
-
processFilePathSet(
|
|
33938
|
+
processFilePathSet(state2, filePathSet, processedFiles, validFiles);
|
|
33889
33939
|
if (validFiles.length === 0) {
|
|
33890
33940
|
return;
|
|
33891
33941
|
}
|
|
33892
|
-
const detectedFramework = detectFrameworkForValidFiles(validFiles,
|
|
33942
|
+
const detectedFramework = detectFrameworkForValidFiles(validFiles, state2);
|
|
33893
33943
|
if (detectedFramework) {
|
|
33894
33944
|
filesToProcess.set(detectedFramework, validFiles);
|
|
33895
33945
|
}
|
|
@@ -33920,36 +33970,36 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33920
33970
|
return checkFile(remaining);
|
|
33921
33971
|
};
|
|
33922
33972
|
return checkFile(allFiles);
|
|
33923
|
-
}, waitForStableWrites = async (
|
|
33973
|
+
}, waitForStableWrites = async (state2) => {
|
|
33924
33974
|
const waitRound = async (round) => {
|
|
33925
33975
|
if (round >= STABILITY_CHECK_ROUNDS) {
|
|
33926
33976
|
return;
|
|
33927
33977
|
}
|
|
33928
|
-
const stable = await areAllQueuedFilesStable(
|
|
33978
|
+
const stable = await areAllQueuedFilesStable(state2.fileChangeQueue);
|
|
33929
33979
|
if (stable) {
|
|
33930
33980
|
return;
|
|
33931
33981
|
}
|
|
33932
33982
|
await waitRound(round + 1);
|
|
33933
33983
|
};
|
|
33934
33984
|
await waitRound(0);
|
|
33935
|
-
}, enqueueImporter = (
|
|
33936
|
-
const importerFramework = detectFramework(importer,
|
|
33985
|
+
}, enqueueImporter = (state2, importer) => {
|
|
33986
|
+
const importerFramework = detectFramework(importer, state2.resolvedPaths);
|
|
33937
33987
|
if (importerFramework === "ignored")
|
|
33938
33988
|
return;
|
|
33939
|
-
if (!
|
|
33940
|
-
|
|
33989
|
+
if (!state2.fileChangeQueue.has(importerFramework)) {
|
|
33990
|
+
state2.fileChangeQueue.set(importerFramework, []);
|
|
33941
33991
|
}
|
|
33942
|
-
const importerQueue =
|
|
33992
|
+
const importerQueue = state2.fileChangeQueue.get(importerFramework);
|
|
33943
33993
|
if (importerQueue && !importerQueue.includes(importer)) {
|
|
33944
33994
|
importerQueue.push(importer);
|
|
33945
33995
|
}
|
|
33946
|
-
}, enqueueStyleImporters = (
|
|
33996
|
+
}, enqueueStyleImporters = (state2, changedStylePath) => {
|
|
33947
33997
|
for (const importer of findStyleEntriesImporting(changedStylePath)) {
|
|
33948
|
-
enqueueImporter(
|
|
33998
|
+
enqueueImporter(state2, importer);
|
|
33949
33999
|
}
|
|
33950
|
-
enqueueAngularOwningComponentForStyle(
|
|
33951
|
-
}, enqueueAngularOwningComponentForStyle = (
|
|
33952
|
-
const { angularDir } =
|
|
34000
|
+
enqueueAngularOwningComponentForStyle(state2, changedStylePath);
|
|
34001
|
+
}, enqueueAngularOwningComponentForStyle = (state2, changedStylePath) => {
|
|
34002
|
+
const { angularDir } = state2.resolvedPaths;
|
|
33953
34003
|
if (!angularDir)
|
|
33954
34004
|
return;
|
|
33955
34005
|
const visited = new Set;
|
|
@@ -33972,41 +34022,41 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33972
34022
|
userAngularRoot: angularDir
|
|
33973
34023
|
});
|
|
33974
34024
|
for (const owner of owners) {
|
|
33975
|
-
enqueueImporter(
|
|
34025
|
+
enqueueImporter(state2, owner.componentFilePath);
|
|
33976
34026
|
}
|
|
33977
34027
|
} catch {}
|
|
33978
34028
|
}
|
|
33979
|
-
}, drainQueueAndRebuild = async (
|
|
33980
|
-
await waitForStableWrites(
|
|
33981
|
-
if (
|
|
34029
|
+
}, drainQueueAndRebuild = async (state2, config, onRebuildComplete) => {
|
|
34030
|
+
await waitForStableWrites(state2);
|
|
34031
|
+
if (state2.isRebuilding) {
|
|
33982
34032
|
return;
|
|
33983
34033
|
}
|
|
33984
34034
|
const userEditedFiles = new Set;
|
|
33985
|
-
|
|
34035
|
+
state2.fileChangeQueue.forEach((filePaths) => {
|
|
33986
34036
|
for (const filePath of filePaths) {
|
|
33987
34037
|
userEditedFiles.add(resolvePath(filePath));
|
|
33988
34038
|
}
|
|
33989
34039
|
});
|
|
33990
|
-
|
|
33991
|
-
const filesToProcess = buildFilesToProcess(
|
|
33992
|
-
|
|
34040
|
+
state2.lastUserEditedFiles = userEditedFiles;
|
|
34041
|
+
const filesToProcess = buildFilesToProcess(state2);
|
|
34042
|
+
state2.fileChangeQueue.clear();
|
|
33993
34043
|
if (filesToProcess.size === 0) {
|
|
33994
34044
|
return;
|
|
33995
34045
|
}
|
|
33996
34046
|
const affectedFrameworks = Array.from(filesToProcess.keys());
|
|
33997
34047
|
affectedFrameworks.forEach((frameworkKey) => {
|
|
33998
|
-
|
|
34048
|
+
state2.rebuildQueue.add(frameworkKey);
|
|
33999
34049
|
});
|
|
34000
34050
|
const filesToRebuild = [];
|
|
34001
34051
|
filesToProcess.forEach((filePaths) => {
|
|
34002
34052
|
filesToRebuild.push(...filePaths);
|
|
34003
34053
|
});
|
|
34004
|
-
triggerRebuild(
|
|
34005
|
-
}, queueFileChange = async (
|
|
34054
|
+
triggerRebuild(state2, config, onRebuildComplete, filesToRebuild);
|
|
34055
|
+
}, queueFileChange = async (state2, filePath, config, onRebuildComplete) => {
|
|
34006
34056
|
const serverEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
34007
34057
|
if (serverEntry && resolvePath(filePath) === resolvePath(serverEntry))
|
|
34008
34058
|
return;
|
|
34009
|
-
const framework = detectFramework(filePath,
|
|
34059
|
+
const framework = detectFramework(filePath, state2.resolvedPaths);
|
|
34010
34060
|
if (framework === "ignored") {
|
|
34011
34061
|
return;
|
|
34012
34062
|
}
|
|
@@ -34014,11 +34064,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34014
34064
|
return;
|
|
34015
34065
|
}
|
|
34016
34066
|
const currentHash = computeFileHash(filePath);
|
|
34017
|
-
if (
|
|
34067
|
+
if (predatesProcess(filePath, state2.fileHashes)) {
|
|
34068
|
+
state2.fileHashes.set(normalizePath2(filePath), currentHash);
|
|
34069
|
+
return;
|
|
34070
|
+
}
|
|
34071
|
+
if (!hasFileChanged(filePath, currentHash, state2.fileHashes)) {
|
|
34018
34072
|
return;
|
|
34019
34073
|
}
|
|
34020
|
-
const { publicDir } =
|
|
34021
|
-
const { assetsDir } =
|
|
34074
|
+
const { publicDir } = state2.resolvedPaths;
|
|
34075
|
+
const { assetsDir } = state2.resolvedPaths;
|
|
34022
34076
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
34023
34077
|
const startedAt = performance.now();
|
|
34024
34078
|
const absSource = resolvePath(filePath);
|
|
@@ -34028,20 +34082,20 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34028
34082
|
return false;
|
|
34029
34083
|
try {
|
|
34030
34084
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
34031
|
-
const { buildDir } =
|
|
34085
|
+
const { buildDir } = state2.resolvedPaths;
|
|
34032
34086
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
34033
34087
|
const { mkdir: mkdir14, copyFile, readFile: readFile10 } = await import("fs/promises");
|
|
34034
34088
|
await mkdir14(dirname37(destPath), { recursive: true });
|
|
34035
34089
|
await copyFile(absSource, destPath);
|
|
34036
34090
|
const bytes = await readFile10(destPath);
|
|
34037
34091
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
34038
|
-
|
|
34039
|
-
|
|
34040
|
-
logHmrUpdate(
|
|
34041
|
-
broadcastToClients(
|
|
34092
|
+
state2.assetStore.set(webPath, new Uint8Array(bytes));
|
|
34093
|
+
state2.fileHashes.set(absSource, currentHash);
|
|
34094
|
+
logHmrUpdate(relative26(process.cwd(), filePath));
|
|
34095
|
+
broadcastToClients(state2, {
|
|
34042
34096
|
data: {
|
|
34043
34097
|
framework: urlPrefix || "public",
|
|
34044
|
-
manifest:
|
|
34098
|
+
manifest: state2.manifest,
|
|
34045
34099
|
serverDuration: Math.round(performance.now() - startedAt),
|
|
34046
34100
|
sourceFile: absSource
|
|
34047
34101
|
},
|
|
@@ -34059,28 +34113,28 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34059
34113
|
applyBackendEdit(resolvePath(filePath)).catch((error) => console.error("[hmr] server update for a React file failed:", error));
|
|
34060
34114
|
if (framework === "unknown") {
|
|
34061
34115
|
invalidate(resolvePath(filePath));
|
|
34062
|
-
const relPath =
|
|
34116
|
+
const relPath = relative26(process.cwd(), filePath);
|
|
34063
34117
|
logHmrUpdate(relPath);
|
|
34064
34118
|
let hasFrontendDependent = false;
|
|
34065
34119
|
let hasAngularDependent = false;
|
|
34066
|
-
if (
|
|
34120
|
+
if (state2.dependencyGraph) {
|
|
34067
34121
|
try {
|
|
34068
34122
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
34069
|
-
addFileToGraph2(
|
|
34070
|
-
const affected = getAffectedFiles(
|
|
34123
|
+
addFileToGraph2(state2.dependencyGraph, resolvePath(filePath));
|
|
34124
|
+
const affected = getAffectedFiles(state2.dependencyGraph, resolvePath(filePath));
|
|
34071
34125
|
for (const dependent of affected) {
|
|
34072
34126
|
if (dependent === resolvePath(filePath))
|
|
34073
34127
|
continue;
|
|
34074
|
-
const dependentFramework = detectFramework(dependent,
|
|
34128
|
+
const dependentFramework = detectFramework(dependent, state2.resolvedPaths);
|
|
34075
34129
|
if (dependentFramework === "unknown" || dependentFramework === "ignored")
|
|
34076
34130
|
continue;
|
|
34077
34131
|
hasFrontendDependent = true;
|
|
34078
34132
|
if (dependentFramework === "angular")
|
|
34079
34133
|
hasAngularDependent = true;
|
|
34080
|
-
if (!
|
|
34081
|
-
|
|
34134
|
+
if (!state2.fileChangeQueue.has(dependentFramework)) {
|
|
34135
|
+
state2.fileChangeQueue.set(dependentFramework, []);
|
|
34082
34136
|
}
|
|
34083
|
-
const frameworkQueue =
|
|
34137
|
+
const frameworkQueue = state2.fileChangeQueue.get(dependentFramework);
|
|
34084
34138
|
if (frameworkQueue && !frameworkQueue.includes(dependent)) {
|
|
34085
34139
|
frameworkQueue.push(dependent);
|
|
34086
34140
|
}
|
|
@@ -34088,11 +34142,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34088
34142
|
} catch {}
|
|
34089
34143
|
}
|
|
34090
34144
|
if (isAbsoluteConfig(resolvePath(filePath))) {
|
|
34091
|
-
|
|
34145
|
+
state2.fileHashes.set(resolvePath(filePath), currentHash);
|
|
34092
34146
|
return;
|
|
34093
34147
|
}
|
|
34094
34148
|
const backend = await applyBackendEdit(resolvePath(filePath));
|
|
34095
|
-
|
|
34149
|
+
state2.fileHashes.set(resolvePath(filePath), currentHash);
|
|
34096
34150
|
if (backend === "unmanaged" && changeNeedsRestart(resolvePath(filePath))) {
|
|
34097
34151
|
console.log(`[abs:restart] ${resolvePath(filePath)}`);
|
|
34098
34152
|
return;
|
|
@@ -34108,35 +34162,35 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34108
34162
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
34109
34163
|
invalidateModuleServer(generatedTwin);
|
|
34110
34164
|
} catch {}
|
|
34111
|
-
if (!
|
|
34112
|
-
|
|
34165
|
+
if (!state2.fileChangeQueue.has("unknown")) {
|
|
34166
|
+
state2.fileChangeQueue.set("unknown", []);
|
|
34113
34167
|
}
|
|
34114
|
-
const unknownQueue =
|
|
34168
|
+
const unknownQueue = state2.fileChangeQueue.get("unknown");
|
|
34115
34169
|
if (unknownQueue && !unknownQueue.includes(filePath)) {
|
|
34116
34170
|
unknownQueue.push(filePath);
|
|
34117
34171
|
}
|
|
34118
34172
|
}
|
|
34119
34173
|
}
|
|
34120
|
-
if (!
|
|
34121
|
-
|
|
34174
|
+
if (!state2.fileChangeQueue.has(framework)) {
|
|
34175
|
+
state2.fileChangeQueue.set(framework, []);
|
|
34122
34176
|
}
|
|
34123
|
-
const queue =
|
|
34177
|
+
const queue = state2.fileChangeQueue.get(framework);
|
|
34124
34178
|
if (queue && !queue.includes(filePath)) {
|
|
34125
34179
|
queue.push(filePath);
|
|
34126
34180
|
}
|
|
34127
34181
|
if (isStylePath(filePath)) {
|
|
34128
|
-
enqueueStyleImporters(
|
|
34182
|
+
enqueueStyleImporters(state2, filePath);
|
|
34129
34183
|
}
|
|
34130
|
-
if (
|
|
34184
|
+
if (state2.isRebuilding) {
|
|
34131
34185
|
return;
|
|
34132
34186
|
}
|
|
34133
|
-
if (
|
|
34134
|
-
clearTimeout(
|
|
34187
|
+
if (state2.rebuildTimeout) {
|
|
34188
|
+
clearTimeout(state2.rebuildTimeout);
|
|
34135
34189
|
}
|
|
34136
34190
|
const DEBOUNCE_MS = config.options?.hmr?.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
34137
|
-
|
|
34138
|
-
|
|
34139
|
-
drainQueueAndRebuild(
|
|
34191
|
+
state2.rebuildTimeout = setTimeout(() => {
|
|
34192
|
+
state2.rebuildTimeout = null;
|
|
34193
|
+
drainQueueAndRebuild(state2, config, onRebuildComplete);
|
|
34140
34194
|
}, DEBOUNCE_MS);
|
|
34141
34195
|
}, resolveComponentLookupFile = (componentFile, graph) => {
|
|
34142
34196
|
if (!componentFile.endsWith(".html")) {
|
|
@@ -34156,15 +34210,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34156
34210
|
return dep;
|
|
34157
34211
|
}
|
|
34158
34212
|
return componentFile;
|
|
34159
|
-
}, resolveAngularPageEntries = (
|
|
34213
|
+
}, resolveAngularPageEntries = (state2, angularFiles, angularPagesPath) => {
|
|
34160
34214
|
const pageEntries = angularFiles.filter((file6) => file6.endsWith(".ts") && resolvePath(file6).startsWith(angularPagesPath));
|
|
34161
|
-
if (pageEntries.length > 0 || !
|
|
34215
|
+
if (pageEntries.length > 0 || !state2.dependencyGraph) {
|
|
34162
34216
|
return pageEntries;
|
|
34163
34217
|
}
|
|
34164
34218
|
const resolvedPages = new Set;
|
|
34165
34219
|
angularFiles.forEach((componentFile) => {
|
|
34166
|
-
const lookupFile = resolveComponentLookupFile(componentFile,
|
|
34167
|
-
const affected = getAffectedFiles(
|
|
34220
|
+
const lookupFile = resolveComponentLookupFile(componentFile, state2.dependencyGraph);
|
|
34221
|
+
const affected = getAffectedFiles(state2.dependencyGraph, lookupFile);
|
|
34168
34222
|
affected.forEach((file6) => {
|
|
34169
34223
|
if (file6.endsWith(".ts") && resolvePath(file6).startsWith(angularPagesPath)) {
|
|
34170
34224
|
resolvedPages.add(file6);
|
|
@@ -34212,13 +34266,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34212
34266
|
serverOutDir: resolvedPaths.buildDir,
|
|
34213
34267
|
serverRoot: commonAncestor2(serverDirs.map((entry) => entry.dir), projectRoot)
|
|
34214
34268
|
};
|
|
34215
|
-
}, updateServerManifestEntry = (
|
|
34269
|
+
}, updateServerManifestEntry = (state2, artifact) => {
|
|
34216
34270
|
const fileWithHash = basename20(artifact.path);
|
|
34217
34271
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
34218
34272
|
if (!baseName) {
|
|
34219
34273
|
return;
|
|
34220
34274
|
}
|
|
34221
|
-
|
|
34275
|
+
state2.manifest[toPascal(baseName)] = artifact.path;
|
|
34222
34276
|
}, pruneStaleHashedSiblings = async (freshOutputs) => {
|
|
34223
34277
|
if (!freshOutputs?.length)
|
|
34224
34278
|
return;
|
|
@@ -34268,13 +34322,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34268
34322
|
} catch {}
|
|
34269
34323
|
}));
|
|
34270
34324
|
}));
|
|
34271
|
-
}, bundleAngularClient = async (
|
|
34325
|
+
}, bundleAngularClient = async (state2, clientPaths, buildDir, userAngularRoot) => {
|
|
34272
34326
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
34273
34327
|
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
34274
34328
|
const { getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
34275
34329
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
34276
34330
|
const { createAngularHmrInjectionPlugin: createAngularHmrInjectionPlugin2 } = await Promise.resolve().then(() => (init_hmrInjectionPlugin(), exports_hmrInjectionPlugin));
|
|
34277
|
-
const clientRoot = await computeClientRoot(
|
|
34331
|
+
const clientRoot = await computeClientRoot(state2.resolvedPaths);
|
|
34278
34332
|
const depVendorPaths = globalThis.__depVendorPaths ?? {};
|
|
34279
34333
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
34280
34334
|
let angVendorPaths = getAngularVendorPaths2();
|
|
@@ -34299,7 +34353,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34299
34353
|
naming: "[dir]/[name].[hash].[ext]",
|
|
34300
34354
|
outdir: buildDir,
|
|
34301
34355
|
plugins: [
|
|
34302
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
34356
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config)),
|
|
34303
34357
|
createAngularHmrInjectionPlugin2({
|
|
34304
34358
|
generatedAngularRoot,
|
|
34305
34359
|
projectRoot: process.cwd(),
|
|
@@ -34328,8 +34382,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34328
34382
|
chainBundleInlineSourcemap2(out.path);
|
|
34329
34383
|
}
|
|
34330
34384
|
const clientManifest = generateManifest2(clientResult.outputs, buildDir);
|
|
34331
|
-
Object.assign(
|
|
34332
|
-
await populateAssetStore(
|
|
34385
|
+
Object.assign(state2.manifest, clientManifest);
|
|
34386
|
+
await populateAssetStore(state2.assetStore, clientManifest, buildDir);
|
|
34333
34387
|
await pruneStaleHashedSiblings(clientResult.outputs);
|
|
34334
34388
|
clearDevSsrCssCaches();
|
|
34335
34389
|
}, USER_FIXABLE_FAST_HMR_REASONS, isUserFixableFastHmrReason = (reason) => USER_FIXABLE_FAST_HMR_REASONS.has(reason), angularDispatcherModules = null, loadAngularDispatcherModules = async () => {
|
|
@@ -34347,8 +34401,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34347
34401
|
tryFastHmr: fastMod.tryFastHmr
|
|
34348
34402
|
};
|
|
34349
34403
|
return angularDispatcherModules;
|
|
34350
|
-
}, decideAngularTier = async (
|
|
34351
|
-
const userEdited =
|
|
34404
|
+
}, decideAngularTier = async (state2, angularDir) => {
|
|
34405
|
+
const userEdited = state2.lastUserEditedFiles ?? new Set;
|
|
34352
34406
|
if (userEdited.size === 0)
|
|
34353
34407
|
return {
|
|
34354
34408
|
breakdown: { compileMs: 0, importsMs: 0, resolveMs: 0 },
|
|
@@ -34374,12 +34428,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34374
34428
|
continue;
|
|
34375
34429
|
if (editedFile.endsWith(".d.ts"))
|
|
34376
34430
|
continue;
|
|
34377
|
-
const detected = detectFramework(editedFile,
|
|
34431
|
+
const detected = detectFramework(editedFile, state2.resolvedPaths);
|
|
34378
34432
|
if (detected !== "unknown")
|
|
34379
34433
|
continue;
|
|
34380
34434
|
try {
|
|
34381
|
-
const affected = getAffectedFiles(
|
|
34382
|
-
const hasAngularConsumer = affected.some((dep) => dep !== resolvePath(editedFile) && detectFramework(dep,
|
|
34435
|
+
const affected = getAffectedFiles(state2.dependencyGraph, resolvePath(editedFile));
|
|
34436
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolvePath(editedFile) && detectFramework(dep, state2.resolvedPaths) === "angular");
|
|
34383
34437
|
if (hasAngularConsumer) {
|
|
34384
34438
|
return {
|
|
34385
34439
|
kind: "rebootstrap",
|
|
@@ -34495,25 +34549,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34495
34549
|
return { breakdown, kind: "remount", queue, tier: 1 };
|
|
34496
34550
|
}
|
|
34497
34551
|
return { breakdown, queue, tier: 0 };
|
|
34498
|
-
}, broadcastSurgical = (
|
|
34552
|
+
}, broadcastSurgical = (state2, queue) => {
|
|
34499
34553
|
const timestamp = Date.now();
|
|
34500
34554
|
for (const { id } of queue) {
|
|
34501
|
-
broadcastToClients(
|
|
34555
|
+
broadcastToClients(state2, {
|
|
34502
34556
|
data: { id, timestamp },
|
|
34503
34557
|
type: "angular:component-update"
|
|
34504
34558
|
});
|
|
34505
34559
|
}
|
|
34506
|
-
}, broadcastRemount = (
|
|
34560
|
+
}, broadcastRemount = (state2, queue) => {
|
|
34507
34561
|
const timestamp = Date.now();
|
|
34508
34562
|
for (const { id } of queue) {
|
|
34509
|
-
broadcastToClients(
|
|
34563
|
+
broadcastToClients(state2, {
|
|
34510
34564
|
data: { id, timestamp },
|
|
34511
34565
|
type: "angular:component-remount"
|
|
34512
34566
|
});
|
|
34513
34567
|
}
|
|
34514
|
-
}, broadcastAngularUserError = (
|
|
34568
|
+
}, broadcastAngularUserError = (state2, failure) => {
|
|
34515
34569
|
const message = failure.detail ? `${failure.reason}: ${failure.detail}` : failure.reason;
|
|
34516
|
-
broadcastToClients(
|
|
34570
|
+
broadcastToClients(state2, {
|
|
34517
34571
|
data: {
|
|
34518
34572
|
affectedFrameworks: ["angular"],
|
|
34519
34573
|
column: failure.column,
|
|
@@ -34526,11 +34580,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34526
34580
|
message: "Angular HMR failed",
|
|
34527
34581
|
type: "rebuild-error"
|
|
34528
34582
|
});
|
|
34529
|
-
}, broadcastRebootstrap = async (
|
|
34583
|
+
}, broadcastRebootstrap = async (state2, reason) => {
|
|
34530
34584
|
logInfo(`[ng-hmr tier-1 rebootstrap] ${reason}`);
|
|
34531
|
-
broadcastToClients(
|
|
34585
|
+
broadcastToClients(state2, {
|
|
34532
34586
|
data: {
|
|
34533
|
-
manifest:
|
|
34587
|
+
manifest: state2.manifest,
|
|
34534
34588
|
reason,
|
|
34535
34589
|
timestamp: Date.now()
|
|
34536
34590
|
},
|
|
@@ -34538,9 +34592,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34538
34592
|
});
|
|
34539
34593
|
const { invalidateFingerprintCache: invalidateFingerprintCache2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
34540
34594
|
invalidateFingerprintCache2();
|
|
34541
|
-
}, ANGULAR_BUNDLE_DEBOUNCE_MS = 2000, angularBundleState, scheduleAngularBundleRebuild = (
|
|
34542
|
-
|
|
34543
|
-
let ctx = angularBundleState.get(
|
|
34595
|
+
}, ANGULAR_BUNDLE_DEBOUNCE_MS = 2000, angularBundleState, scheduleAngularBundleRebuild = (state2, pageEntries, angularDir) => {
|
|
34596
|
+
state2.pendingBundleRebuilds.add("angular");
|
|
34597
|
+
let ctx = angularBundleState.get(state2);
|
|
34544
34598
|
if (!ctx) {
|
|
34545
34599
|
ctx = {
|
|
34546
34600
|
angularDir,
|
|
@@ -34551,7 +34605,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34551
34605
|
pageEntries,
|
|
34552
34606
|
pending: false
|
|
34553
34607
|
};
|
|
34554
|
-
angularBundleState.set(
|
|
34608
|
+
angularBundleState.set(state2, ctx);
|
|
34555
34609
|
}
|
|
34556
34610
|
ctx.pageEntries = pageEntries;
|
|
34557
34611
|
ctx.angularDir = angularDir;
|
|
@@ -34559,7 +34613,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34559
34613
|
if (ctx.pageEntries.length === 0)
|
|
34560
34614
|
return;
|
|
34561
34615
|
try {
|
|
34562
|
-
await compileAndBundleAngular(
|
|
34616
|
+
await compileAndBundleAngular(state2, ctx.pageEntries, ctx.angularDir);
|
|
34563
34617
|
} catch (error) {
|
|
34564
34618
|
console.error("[hmr] angular bundle rebuild failed \u2014 will retry on the next change:", error instanceof Error ? error.message : error);
|
|
34565
34619
|
}
|
|
@@ -34575,7 +34629,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34575
34629
|
} finally {
|
|
34576
34630
|
ctx.inFlight = null;
|
|
34577
34631
|
if (!ctx.debounceTimer && !ctx.debouncedPromise && !ctx.pending)
|
|
34578
|
-
|
|
34632
|
+
state2.pendingBundleRebuilds.delete("angular");
|
|
34579
34633
|
}
|
|
34580
34634
|
};
|
|
34581
34635
|
const fire = () => {
|
|
@@ -34612,8 +34666,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34612
34666
|
}
|
|
34613
34667
|
return scheduled;
|
|
34614
34668
|
};
|
|
34615
|
-
}, runAngularHmrIncremental = async (
|
|
34616
|
-
const editedFiles =
|
|
34669
|
+
}, runAngularHmrIncremental = async (state2, angularDir, _pageEntries) => {
|
|
34670
|
+
const editedFiles = state2.lastUserEditedFiles ?? new Set;
|
|
34617
34671
|
const refreshDisk = async () => {
|
|
34618
34672
|
if (!angularDir || editedFiles.size === 0)
|
|
34619
34673
|
return;
|
|
@@ -34656,14 +34710,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34656
34710
|
return;
|
|
34657
34711
|
await Promise.all(Array.from(tsFilesToRefresh).map((file6) => {
|
|
34658
34712
|
invalidateAngularJitCache2(file6);
|
|
34659
|
-
return compileAngularFileJIT2(file6, compiledRoot, angularDirAbs, getStyleTransformConfig(
|
|
34713
|
+
return compileAngularFileJIT2(file6, compiledRoot, angularDirAbs, getStyleTransformConfig(state2.config)).catch((err) => {
|
|
34660
34714
|
logWarn(`[hmr] disk-refresh JIT failed for ${file6}: ${err instanceof Error ? err.message : String(err)}`);
|
|
34661
34715
|
});
|
|
34662
34716
|
}));
|
|
34663
34717
|
try {
|
|
34664
34718
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
34665
34719
|
for (const tsFile of tsFilesToRefresh) {
|
|
34666
|
-
const rel =
|
|
34720
|
+
const rel = relative26(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
34667
34721
|
const compiledFile = resolvePath(compiledRoot, rel);
|
|
34668
34722
|
invalidateModule2(compiledFile);
|
|
34669
34723
|
}
|
|
@@ -34674,7 +34728,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34674
34728
|
};
|
|
34675
34729
|
const diskRefreshPromise = refreshDisk();
|
|
34676
34730
|
await diskRefreshPromise;
|
|
34677
|
-
}, compileAndBundleAngular = async (
|
|
34731
|
+
}, compileAndBundleAngular = async (state2, pageEntries, angularDir) => {
|
|
34678
34732
|
const { compileAngular: compileAngular2, compileAngularFileJIT: compileAngularFileJIT2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
34679
34733
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
34680
34734
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
@@ -34702,7 +34756,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34702
34756
|
};
|
|
34703
34757
|
};
|
|
34704
34758
|
const providersInjection = createProvidersInjection();
|
|
34705
|
-
const styleTransformConfig = getStyleTransformConfig(
|
|
34759
|
+
const styleTransformConfig = getStyleTransformConfig(state2.config);
|
|
34706
34760
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
34707
34761
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, styleTransformConfig, providersInjection);
|
|
34708
34762
|
if (providersInjection.appProvidersSource) {
|
|
@@ -34747,24 +34801,24 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34747
34801
|
serverPaths.forEach((serverPath, idx) => {
|
|
34748
34802
|
const fileBase = basename20(serverPath, ".js");
|
|
34749
34803
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
34750
|
-
|
|
34804
|
+
state2.manifest[toPascal(fileBase)] = resolvePath(ssrPath);
|
|
34751
34805
|
});
|
|
34752
34806
|
if (clientPaths.length > 0) {
|
|
34753
|
-
await bundleAngularClient(
|
|
34807
|
+
await bundleAngularClient(state2, clientPaths, state2.resolvedPaths.buildDir, angularDir);
|
|
34754
34808
|
}
|
|
34755
34809
|
await Promise.all(pageEntries.map((entry) => compileAngularFileJIT2(entry, generatedAngularRoot, resolvedAngularDir, styleTransformConfig)));
|
|
34756
34810
|
if (providersInjection.appProvidersSource) {
|
|
34757
34811
|
await compileAngularFileJIT2(providersInjection.appProvidersSource, generatedAngularRoot, resolvedAngularDir, styleTransformConfig);
|
|
34758
34812
|
}
|
|
34759
|
-
broadcastToClients(
|
|
34760
|
-
data: { manifest:
|
|
34813
|
+
broadcastToClients(state2, {
|
|
34814
|
+
data: { manifest: state2.manifest },
|
|
34761
34815
|
type: "angular-tier-zero-ssr-rebuild-complete"
|
|
34762
34816
|
});
|
|
34763
|
-
}, handleAngularFastPath = async (
|
|
34817
|
+
}, handleAngularFastPath = async (state2, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
34764
34818
|
const angularDir = config.angularDirectory ?? "";
|
|
34765
|
-
const angularFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
34819
|
+
const angularFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "angular");
|
|
34766
34820
|
const angularPagesPath = resolvePath(angularDir, "pages");
|
|
34767
|
-
const initialPageEntries = resolveAngularPageEntries(
|
|
34821
|
+
const initialPageEntries = resolveAngularPageEntries(state2, angularFiles, angularPagesPath);
|
|
34768
34822
|
const projectRoot = process.cwd();
|
|
34769
34823
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
34770
34824
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
@@ -34789,42 +34843,42 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34789
34843
|
};
|
|
34790
34844
|
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? collectAllPages() : initialPageEntries;
|
|
34791
34845
|
const tierStart = performance.now();
|
|
34792
|
-
const verdict = await decideAngularTier(
|
|
34846
|
+
const verdict = await decideAngularTier(state2, angularDir);
|
|
34793
34847
|
const tierMs = (performance.now() - tierStart).toFixed(0);
|
|
34794
|
-
const runBundle = scheduleAngularBundleRebuild(
|
|
34848
|
+
const runBundle = scheduleAngularBundleRebuild(state2, pageEntries, angularDir);
|
|
34795
34849
|
const queueDescription = (queue) => queue.map((e) => e.className).join(", ");
|
|
34796
34850
|
if (verdict.tier === 0) {
|
|
34797
|
-
await runAngularHmrIncremental(
|
|
34798
|
-
broadcastSurgical(
|
|
34851
|
+
await runAngularHmrIncremental(state2, angularDir, pageEntries);
|
|
34852
|
+
broadcastSurgical(state2, verdict.queue);
|
|
34799
34853
|
const rightValue = verdict.breakdown;
|
|
34800
34854
|
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
34801
34855
|
runBundle();
|
|
34802
34856
|
} else if (verdict.tier === 1 && verdict.kind === "remount") {
|
|
34803
|
-
await runAngularHmrIncremental(
|
|
34804
|
-
broadcastRemount(
|
|
34857
|
+
await runAngularHmrIncremental(state2, angularDir, pageEntries);
|
|
34858
|
+
broadcastRemount(state2, verdict.queue);
|
|
34805
34859
|
const rightValue = verdict.breakdown;
|
|
34806
34860
|
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
34807
34861
|
runBundle();
|
|
34808
34862
|
} else if (verdict.tier === 1 && verdict.kind === "rebootstrap") {
|
|
34809
34863
|
await runBundle({ immediate: true });
|
|
34810
|
-
await broadcastRebootstrap(
|
|
34864
|
+
await broadcastRebootstrap(state2, verdict.reason);
|
|
34811
34865
|
} else if (verdict.tier === 1 && verdict.kind === "user-error") {
|
|
34812
|
-
broadcastAngularUserError(
|
|
34866
|
+
broadcastAngularUserError(state2, verdict.failure);
|
|
34813
34867
|
logInfo(`[ng-hmr] user error in ${verdict.failure.className}: ${verdict.failure.reason}${verdict.failure.detail ? ` (${verdict.failure.detail})` : ""}`);
|
|
34814
34868
|
}
|
|
34815
|
-
const { manifest } =
|
|
34816
|
-
onRebuildComplete({ hmrState:
|
|
34869
|
+
const { manifest } = state2;
|
|
34870
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
34817
34871
|
return manifest;
|
|
34818
34872
|
}, getModuleUrl = async (pageFile) => {
|
|
34819
34873
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX3 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
34820
34874
|
invalidateModule2(pageFile);
|
|
34821
|
-
const rel =
|
|
34875
|
+
const rel = relative26(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
34822
34876
|
const url = `${SRC_URL_PREFIX3}${rel}`;
|
|
34823
34877
|
await warmCache2(url);
|
|
34824
34878
|
return url;
|
|
34825
34879
|
}, getReactModuleUrl, isReactComponentPath = (file6) => file6.endsWith(".tsx") || file6.endsWith(".jsx"), isReactPagePath = (file6) => file6.replace(/\\/g, "/").includes("/pages/"), isImportableModule = (file6) => {
|
|
34826
34880
|
try {
|
|
34827
|
-
return
|
|
34881
|
+
return statSync11(file6).isFile();
|
|
34828
34882
|
} catch {
|
|
34829
34883
|
return false;
|
|
34830
34884
|
}
|
|
@@ -34836,9 +34890,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34836
34890
|
return nearest;
|
|
34837
34891
|
const dependents = reactFiles.filter((candidate) => !edited.has(candidate) && isReactComponentPath(candidate) && isImportableModule(candidate));
|
|
34838
34892
|
return dependents.find((candidate) => !isReactPagePath(candidate)) ?? dependents[0] ?? file6;
|
|
34839
|
-
}, resolveReactUpdateTargets = (
|
|
34893
|
+
}, resolveReactUpdateTargets = (state2, reactFiles) => {
|
|
34840
34894
|
const importable = reactFiles.filter(isImportableModule);
|
|
34841
|
-
const userEdited = importable.filter((file6) =>
|
|
34895
|
+
const userEdited = importable.filter((file6) => state2.lastUserEditedFiles?.has(resolvePath(file6)));
|
|
34842
34896
|
const editedFiles = userEdited.length > 0 ? userEdited : importable;
|
|
34843
34897
|
const edited = new Set(editedFiles);
|
|
34844
34898
|
const ordered = [
|
|
@@ -34854,26 +34908,26 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34854
34908
|
await getReactModuleUrl(page)
|
|
34855
34909
|
]));
|
|
34856
34910
|
return Object.fromEntries(entries);
|
|
34857
|
-
}, handleReactModuleServerPath = async (
|
|
34911
|
+
}, handleReactModuleServerPath = async (state2, reactFiles, startTime, fastRefreshSupported, onRebuildComplete) => {
|
|
34858
34912
|
const { invalidateModule: invalidateModule2 } = await getModuleServer();
|
|
34859
34913
|
for (const file6 of reactFiles) {
|
|
34860
34914
|
invalidateModule2(file6);
|
|
34861
34915
|
}
|
|
34862
|
-
const { editedFiles, targets } = resolveReactUpdateTargets(
|
|
34916
|
+
const { editedFiles, targets } = resolveReactUpdateTargets(state2, reactFiles);
|
|
34863
34917
|
const [primaryTarget] = targets;
|
|
34864
34918
|
if (!primaryTarget) {
|
|
34865
34919
|
onRebuildComplete({
|
|
34866
|
-
hmrState:
|
|
34867
|
-
manifest:
|
|
34920
|
+
hmrState: state2,
|
|
34921
|
+
manifest: state2.manifest
|
|
34868
34922
|
});
|
|
34869
|
-
return
|
|
34923
|
+
return state2.manifest;
|
|
34870
34924
|
}
|
|
34871
34925
|
const moduleUrls = await Promise.all(targets.map(getReactModuleUrl));
|
|
34872
34926
|
await Promise.all(editedFiles.filter((file6) => !targets.includes(file6)).map(getReactModuleUrl));
|
|
34873
34927
|
const { getTransformError: getTransformError2 } = await getModuleServer();
|
|
34874
34928
|
const failed = [...new Set([...editedFiles, ...targets])].map((file6) => ({ error: getTransformError2(file6), file: file6 })).find((entry) => entry.error !== undefined);
|
|
34875
34929
|
if (failed?.error) {
|
|
34876
|
-
broadcastToClients(
|
|
34930
|
+
broadcastToClients(state2, {
|
|
34877
34931
|
data: {
|
|
34878
34932
|
affectedFrameworks: ["react"],
|
|
34879
34933
|
column: failed.error.column,
|
|
@@ -34886,23 +34940,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34886
34940
|
message: "React module failed to compile",
|
|
34887
34941
|
type: "rebuild-error"
|
|
34888
34942
|
});
|
|
34889
|
-
onRebuildComplete({ hmrState:
|
|
34890
|
-
return
|
|
34943
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
34944
|
+
return state2.manifest;
|
|
34891
34945
|
}
|
|
34892
34946
|
const pageModuleUrls = fastRefreshSupported ? undefined : await resolveAffectedPageModules(reactFiles);
|
|
34893
34947
|
const [pageModuleUrl] = moduleUrls;
|
|
34894
34948
|
const primaryFile = reactFiles.find((file6) => isImportableModule(file6) && !isReactPagePath(file6)) ?? primaryTarget;
|
|
34895
34949
|
if (pageModuleUrl) {
|
|
34896
34950
|
const serverDuration = Date.now() - startTime;
|
|
34897
|
-
|
|
34898
|
-
|
|
34899
|
-
broadcastToClients(
|
|
34951
|
+
state2.lastHmrPath = relative26(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
34952
|
+
state2.lastHmrFramework = "react";
|
|
34953
|
+
broadcastToClients(state2, {
|
|
34900
34954
|
data: {
|
|
34901
34955
|
fastRefreshSupported,
|
|
34902
34956
|
framework: "react",
|
|
34903
34957
|
hasComponentChanges: true,
|
|
34904
34958
|
hasCSSChanges: false,
|
|
34905
|
-
manifest:
|
|
34959
|
+
manifest: state2.manifest,
|
|
34906
34960
|
moduleUrls,
|
|
34907
34961
|
pageModuleUrl,
|
|
34908
34962
|
pageModuleUrls,
|
|
@@ -34914,20 +34968,20 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34914
34968
|
});
|
|
34915
34969
|
}
|
|
34916
34970
|
onRebuildComplete({
|
|
34917
|
-
hmrState:
|
|
34918
|
-
manifest:
|
|
34971
|
+
hmrState: state2,
|
|
34972
|
+
manifest: state2.manifest
|
|
34919
34973
|
});
|
|
34920
|
-
return
|
|
34921
|
-
}, handleReactFastPath = async (
|
|
34922
|
-
const reactFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
34974
|
+
return state2.manifest;
|
|
34975
|
+
}, handleReactFastPath = async (state2, _config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
34976
|
+
const reactFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "react");
|
|
34923
34977
|
if (reactFiles.length === 0) {
|
|
34924
|
-
onRebuildComplete({ hmrState:
|
|
34925
|
-
return
|
|
34978
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
34979
|
+
return state2.manifest;
|
|
34926
34980
|
}
|
|
34927
34981
|
const { isReactFastRefreshSupported: isReactFastRefreshSupported2, warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
34928
34982
|
warnIfReactFastRefreshUnsupported2();
|
|
34929
34983
|
const fastRefreshSupported = isReactFastRefreshSupported2();
|
|
34930
|
-
return handleReactModuleServerPath(
|
|
34984
|
+
return handleReactModuleServerPath(state2, reactFiles, startTime, fastRefreshSupported, onRebuildComplete);
|
|
34931
34985
|
}, getClientVendorPaths = async () => {
|
|
34932
34986
|
const {
|
|
34933
34987
|
getDevVendorPaths: getDevVendorPaths2,
|
|
@@ -34977,7 +35031,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34977
35031
|
}
|
|
34978
35032
|
const match = fileBase.match(/^(.+)\.[a-z0-9]{8,}\.[^.]+$/i);
|
|
34979
35033
|
return match ? match[1] : null;
|
|
34980
|
-
}, copyVueServerSiblingCss = async (
|
|
35034
|
+
}, copyVueServerSiblingCss = async (state2, serverResult, cssResult) => {
|
|
34981
35035
|
if (!serverResult?.success || !cssResult?.success)
|
|
34982
35036
|
return;
|
|
34983
35037
|
const cssByName = new Map;
|
|
@@ -35002,7 +35056,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35002
35056
|
return;
|
|
35003
35057
|
const siblingCssPath = artifact.path.replace(/\.js$/, ".css");
|
|
35004
35058
|
await copyFile(cssBundlePath, siblingCssPath);
|
|
35005
|
-
|
|
35059
|
+
state2.manifest[`${pascalName}Css`] = siblingCssPath;
|
|
35006
35060
|
}));
|
|
35007
35061
|
}, logBundleFailure = (label, result) => {
|
|
35008
35062
|
if (!result || result.success)
|
|
@@ -35011,29 +35065,29 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35011
35065
|
`);
|
|
35012
35066
|
console.error(`[hmr] ${label} bundle rebuild failed \u2014 served bundles stay on their previous version:
|
|
35013
35067
|
${details}`);
|
|
35014
|
-
}, handleServerManifestUpdate = (
|
|
35068
|
+
}, handleServerManifestUpdate = (state2, serverResult) => {
|
|
35015
35069
|
if (!serverResult?.success) {
|
|
35016
35070
|
return;
|
|
35017
35071
|
}
|
|
35018
35072
|
serverResult.outputs.forEach((artifact) => {
|
|
35019
|
-
updateServerManifestEntry(
|
|
35073
|
+
updateServerManifestEntry(state2, artifact);
|
|
35020
35074
|
});
|
|
35021
|
-
}, handleClientManifestUpdate = async (
|
|
35075
|
+
}, handleClientManifestUpdate = async (state2, clientResult, buildDir) => {
|
|
35022
35076
|
if (!clientResult?.success) {
|
|
35023
35077
|
return;
|
|
35024
35078
|
}
|
|
35025
35079
|
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
35026
35080
|
const clientManifest = generateManifest2(clientResult.outputs, buildDir);
|
|
35027
|
-
Object.assign(
|
|
35028
|
-
await populateAssetStore(
|
|
35029
|
-
}, broadcastSvelteModuleUpdate = async (
|
|
35081
|
+
Object.assign(state2.manifest, clientManifest);
|
|
35082
|
+
await populateAssetStore(state2.assetStore, clientManifest, buildDir);
|
|
35083
|
+
}, broadcastSvelteModuleUpdate = async (state2, changedFile, svelteFiles, serverDuration) => {
|
|
35030
35084
|
const pageModuleUrl = await getModuleUrl(changedFile);
|
|
35031
|
-
|
|
35032
|
-
|
|
35033
|
-
broadcastToClients(
|
|
35085
|
+
state2.lastHmrPath = changedFile;
|
|
35086
|
+
state2.lastHmrFramework = "svelte";
|
|
35087
|
+
broadcastToClients(state2, {
|
|
35034
35088
|
data: {
|
|
35035
35089
|
framework: "svelte",
|
|
35036
|
-
manifest:
|
|
35090
|
+
manifest: state2.manifest,
|
|
35037
35091
|
pageModuleUrl,
|
|
35038
35092
|
serverDuration,
|
|
35039
35093
|
sourceFile: changedFile,
|
|
@@ -35042,22 +35096,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35042
35096
|
},
|
|
35043
35097
|
type: "svelte-update"
|
|
35044
35098
|
});
|
|
35045
|
-
}, handleSvelteModuleServerPath = async (
|
|
35046
|
-
const surgicallyHandled =
|
|
35099
|
+
}, handleSvelteModuleServerPath = async (state2, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
35100
|
+
const surgicallyHandled = state2.svelteSurgicallyHandled ?? new Set;
|
|
35047
35101
|
for (const file6 of svelteFiles) {
|
|
35048
35102
|
surgicallyHandled.add(resolvePath(file6));
|
|
35049
35103
|
}
|
|
35050
|
-
|
|
35104
|
+
state2.svelteSurgicallyHandled = surgicallyHandled;
|
|
35051
35105
|
const serverDuration = Date.now() - startTime;
|
|
35052
|
-
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(
|
|
35053
|
-
scheduleSvelteBundleRebuild(
|
|
35106
|
+
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state2, changedFile, svelteFiles, serverDuration));
|
|
35107
|
+
scheduleSvelteBundleRebuild(state2, svelteFiles, config)();
|
|
35054
35108
|
onRebuildComplete({
|
|
35055
|
-
hmrState:
|
|
35056
|
-
manifest:
|
|
35109
|
+
hmrState: state2,
|
|
35110
|
+
manifest: state2.manifest
|
|
35057
35111
|
});
|
|
35058
|
-
return
|
|
35059
|
-
}, SVELTE_BUNDLE_DEBOUNCE_MS = 2000, svelteBundleState, vueBundleState, getOrCreateBundleCtx = (store,
|
|
35060
|
-
let ctx = store.get(
|
|
35112
|
+
return state2.manifest;
|
|
35113
|
+
}, SVELTE_BUNDLE_DEBOUNCE_MS = 2000, svelteBundleState, vueBundleState, getOrCreateBundleCtx = (store, state2) => {
|
|
35114
|
+
let ctx = store.get(state2);
|
|
35061
35115
|
if (!ctx) {
|
|
35062
35116
|
ctx = {
|
|
35063
35117
|
debouncedPromise: null,
|
|
@@ -35067,26 +35121,26 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35067
35121
|
pending: false,
|
|
35068
35122
|
pendingFiles: new Set
|
|
35069
35123
|
};
|
|
35070
|
-
store.set(
|
|
35124
|
+
store.set(state2, ctx);
|
|
35071
35125
|
}
|
|
35072
35126
|
return ctx;
|
|
35073
|
-
}, runSvelteBundleRebuild = async (
|
|
35127
|
+
}, runSvelteBundleRebuild = async (state2, svelteFiles, config) => {
|
|
35074
35128
|
const existingSvelteFiles = svelteFiles.filter((file6) => existsSync44(file6));
|
|
35075
35129
|
if (existingSvelteFiles.length === 0)
|
|
35076
35130
|
return;
|
|
35077
35131
|
const svelteDir = config.svelteDirectory ?? "";
|
|
35078
35132
|
if (!svelteDir)
|
|
35079
35133
|
return;
|
|
35080
|
-
const { buildDir } =
|
|
35134
|
+
const { buildDir } = state2.resolvedPaths;
|
|
35081
35135
|
const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
|
|
35082
35136
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
35083
|
-
const clientRoot = await computeClientRoot(
|
|
35084
|
-
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(existingSvelteFiles, svelteDir, new Map, true, getStyleTransformConfig(
|
|
35137
|
+
const clientRoot = await computeClientRoot(state2.resolvedPaths);
|
|
35138
|
+
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(existingSvelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state2.config));
|
|
35085
35139
|
const serverEntries = [...svelteServerPaths];
|
|
35086
35140
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
35087
|
-
const { serverRoot, serverOutDir } = await computeServerOutPaths(
|
|
35141
|
+
const { serverRoot, serverOutDir } = await computeServerOutPaths(state2.resolvedPaths, "svelte");
|
|
35088
35142
|
const serverExternals = await getServerBundleExternals();
|
|
35089
|
-
const serverExternalsPlugins = await getServerBundleExternalsPlugins(
|
|
35143
|
+
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state2.config);
|
|
35090
35144
|
const clientVendorPaths = await getClientVendorPaths();
|
|
35091
35145
|
const [serverResult, clientResult] = await Promise.all([
|
|
35092
35146
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -35097,7 +35151,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35097
35151
|
outdir: serverOutDir,
|
|
35098
35152
|
plugins: [
|
|
35099
35153
|
...serverExternalsPlugins,
|
|
35100
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35154
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35101
35155
|
],
|
|
35102
35156
|
root: serverRoot,
|
|
35103
35157
|
sourcemap: "inline",
|
|
@@ -35111,7 +35165,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35111
35165
|
naming: "[dir]/[name].[hash].[ext]",
|
|
35112
35166
|
outdir: buildDir,
|
|
35113
35167
|
plugins: [
|
|
35114
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35168
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35115
35169
|
],
|
|
35116
35170
|
root: clientRoot,
|
|
35117
35171
|
sourcemap: "inline",
|
|
@@ -35122,8 +35176,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35122
35176
|
logBundleFailure("svelte server", serverResult);
|
|
35123
35177
|
logBundleFailure("svelte client", clientResult);
|
|
35124
35178
|
await rewriteClientVendorImports(clientResult, clientVendorPaths);
|
|
35125
|
-
handleServerManifestUpdate(
|
|
35126
|
-
await handleClientManifestUpdate(
|
|
35179
|
+
handleServerManifestUpdate(state2, serverResult);
|
|
35180
|
+
await handleClientManifestUpdate(state2, clientResult, buildDir);
|
|
35127
35181
|
await pruneStaleHashedSiblings(serverResult?.outputs);
|
|
35128
35182
|
await pruneStaleHashedSiblings(clientResult?.outputs);
|
|
35129
35183
|
clearDevSsrCssCaches();
|
|
@@ -35138,18 +35192,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35138
35192
|
chainBundleInlineSourcemap2(out.path);
|
|
35139
35193
|
}
|
|
35140
35194
|
}
|
|
35141
|
-
broadcastToClients(
|
|
35142
|
-
data: { manifest:
|
|
35195
|
+
broadcastToClients(state2, {
|
|
35196
|
+
data: { manifest: state2.manifest },
|
|
35143
35197
|
type: "svelte-tier-zero-ssr-rebuild-complete"
|
|
35144
35198
|
});
|
|
35145
|
-
}, scheduleSvelteBundleRebuild = (
|
|
35146
|
-
|
|
35147
|
-
const ctx = getOrCreateBundleCtx(svelteBundleState,
|
|
35199
|
+
}, scheduleSvelteBundleRebuild = (state2, svelteFiles, config) => {
|
|
35200
|
+
state2.pendingBundleRebuilds.add("svelte");
|
|
35201
|
+
const ctx = getOrCreateBundleCtx(svelteBundleState, state2);
|
|
35148
35202
|
for (const file6 of svelteFiles)
|
|
35149
35203
|
ctx.pendingFiles.add(file6);
|
|
35150
35204
|
const runBatch = async (filesSnapshot) => {
|
|
35151
35205
|
try {
|
|
35152
|
-
await runSvelteBundleRebuild(
|
|
35206
|
+
await runSvelteBundleRebuild(state2, filesSnapshot, config);
|
|
35153
35207
|
return true;
|
|
35154
35208
|
} catch (error) {
|
|
35155
35209
|
requeueFailedBundleBatch(ctx, filesSnapshot, "svelte", error);
|
|
@@ -35171,7 +35225,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35171
35225
|
} finally {
|
|
35172
35226
|
ctx.inFlight = null;
|
|
35173
35227
|
if (!ctx.debounceTimer && !ctx.debouncedPromise && !ctx.pending && ctx.pendingFiles.size === 0)
|
|
35174
|
-
|
|
35228
|
+
state2.pendingBundleRebuilds.delete("svelte");
|
|
35175
35229
|
}
|
|
35176
35230
|
};
|
|
35177
35231
|
const fire = () => {
|
|
@@ -35198,23 +35252,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35198
35252
|
ctx.debounceTimer = setTimeout(fire, SVELTE_BUNDLE_DEBOUNCE_MS);
|
|
35199
35253
|
return ctx.debouncedPromise;
|
|
35200
35254
|
};
|
|
35201
|
-
}, handleSvelteFastPath = async (
|
|
35255
|
+
}, handleSvelteFastPath = async (state2, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
35202
35256
|
const svelteDir = config.svelteDirectory ?? "";
|
|
35203
|
-
const svelteFiles = filesToRebuild.filter((file6) => (file6.endsWith(".svelte") || file6.includes(".svelte.")) && detectFramework(file6,
|
|
35257
|
+
const svelteFiles = filesToRebuild.filter((file6) => (file6.endsWith(".svelte") || file6.includes(".svelte.")) && detectFramework(file6, state2.resolvedPaths) === "svelte");
|
|
35204
35258
|
if (svelteFiles.length > 0) {
|
|
35205
|
-
return handleSvelteModuleServerPath(
|
|
35259
|
+
return handleSvelteModuleServerPath(state2, svelteFiles, config, startTime, onRebuildComplete);
|
|
35206
35260
|
}
|
|
35207
|
-
const { buildDir } =
|
|
35261
|
+
const { buildDir } = state2.resolvedPaths;
|
|
35208
35262
|
if (svelteFiles.length > 0) {
|
|
35209
35263
|
const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
|
|
35210
35264
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
35211
|
-
const clientRoot = await computeClientRoot(
|
|
35212
|
-
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(
|
|
35265
|
+
const clientRoot = await computeClientRoot(state2.resolvedPaths);
|
|
35266
|
+
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state2.config));
|
|
35213
35267
|
const serverEntries = [...svelteServerPaths];
|
|
35214
35268
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
35215
|
-
const { serverRoot, serverOutDir } = await computeServerOutPaths(
|
|
35269
|
+
const { serverRoot, serverOutDir } = await computeServerOutPaths(state2.resolvedPaths, "svelte");
|
|
35216
35270
|
const serverExternals = await getServerBundleExternals();
|
|
35217
|
-
const serverExternalsPlugins = await getServerBundleExternalsPlugins(
|
|
35271
|
+
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state2.config);
|
|
35218
35272
|
const clientVendorPaths = await getClientVendorPaths();
|
|
35219
35273
|
const [serverResult, clientResult] = await Promise.all([
|
|
35220
35274
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -35225,7 +35279,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35225
35279
|
outdir: serverOutDir,
|
|
35226
35280
|
plugins: [
|
|
35227
35281
|
...serverExternalsPlugins,
|
|
35228
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35282
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35229
35283
|
],
|
|
35230
35284
|
root: serverRoot,
|
|
35231
35285
|
target: "bun",
|
|
@@ -35238,7 +35292,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35238
35292
|
naming: "[dir]/[name].[hash].[ext]",
|
|
35239
35293
|
outdir: buildDir,
|
|
35240
35294
|
plugins: [
|
|
35241
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35295
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35242
35296
|
],
|
|
35243
35297
|
root: clientRoot,
|
|
35244
35298
|
target: "browser",
|
|
@@ -35248,13 +35302,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35248
35302
|
logBundleFailure("svelte server", serverResult);
|
|
35249
35303
|
logBundleFailure("svelte client", clientResult);
|
|
35250
35304
|
await rewriteClientVendorImports(clientResult, clientVendorPaths);
|
|
35251
|
-
handleServerManifestUpdate(
|
|
35252
|
-
await handleClientManifestUpdate(
|
|
35305
|
+
handleServerManifestUpdate(state2, serverResult);
|
|
35306
|
+
await handleClientManifestUpdate(state2, clientResult, buildDir);
|
|
35253
35307
|
await pruneStaleHashedSiblings(serverResult?.outputs);
|
|
35254
35308
|
await pruneStaleHashedSiblings(clientResult?.outputs);
|
|
35255
35309
|
clearDevSsrCssCaches();
|
|
35256
35310
|
}
|
|
35257
|
-
const { manifest } =
|
|
35311
|
+
const { manifest } = state2;
|
|
35258
35312
|
const duration = Date.now() - startTime;
|
|
35259
35313
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
35260
35314
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
@@ -35264,7 +35318,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35264
35318
|
const cssKey = `${pascalName}CSS`;
|
|
35265
35319
|
const cssUrl = manifest[cssKey] || null;
|
|
35266
35320
|
logHmrUpdate(sveltePagePath, "svelte", duration);
|
|
35267
|
-
broadcastToClients(
|
|
35321
|
+
broadcastToClients(state2, {
|
|
35268
35322
|
data: {
|
|
35269
35323
|
cssBaseName: baseName,
|
|
35270
35324
|
cssUrl,
|
|
@@ -35277,11 +35331,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35277
35331
|
type: "svelte-update"
|
|
35278
35332
|
});
|
|
35279
35333
|
});
|
|
35280
|
-
onRebuildComplete({ hmrState:
|
|
35334
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
35281
35335
|
return manifest;
|
|
35282
|
-
}, collectAffectedVueFiles = (
|
|
35336
|
+
}, collectAffectedVueFiles = (state2, nonVueFiles, vueFiles) => {
|
|
35283
35337
|
for (const tsFile of nonVueFiles) {
|
|
35284
|
-
const affected = getAffectedFiles(
|
|
35338
|
+
const affected = getAffectedFiles(state2.dependencyGraph, tsFile);
|
|
35285
35339
|
const newVueDeps = affected.filter((dep) => dep.endsWith(".vue") && !vueFiles.includes(dep));
|
|
35286
35340
|
vueFiles.push(...newVueDeps);
|
|
35287
35341
|
}
|
|
@@ -35292,17 +35346,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35292
35346
|
for (const file6 of nonVueFiles) {
|
|
35293
35347
|
invalidateModule2(file6);
|
|
35294
35348
|
}
|
|
35295
|
-
}, broadcastVueModuleUpdate = async (
|
|
35349
|
+
}, broadcastVueModuleUpdate = async (state2, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration) => {
|
|
35296
35350
|
const pageModuleUrl = await getModuleUrl(changedFile);
|
|
35297
35351
|
const [firstNonVue] = nonVueFiles;
|
|
35298
|
-
|
|
35299
|
-
|
|
35300
|
-
broadcastToClients(
|
|
35352
|
+
state2.lastHmrPath = nonVueFiles.length > 0 && firstNonVue ? firstNonVue : changedFile;
|
|
35353
|
+
state2.lastHmrFramework = "vue";
|
|
35354
|
+
broadcastToClients(state2, {
|
|
35301
35355
|
data: {
|
|
35302
35356
|
changeType: "full",
|
|
35303
35357
|
forceReload,
|
|
35304
35358
|
framework: "vue",
|
|
35305
|
-
manifest:
|
|
35359
|
+
manifest: state2.manifest,
|
|
35306
35360
|
pageModuleUrl,
|
|
35307
35361
|
serverDuration,
|
|
35308
35362
|
sourceFile: changedFile,
|
|
@@ -35311,40 +35365,40 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35311
35365
|
},
|
|
35312
35366
|
type: "vue-update"
|
|
35313
35367
|
});
|
|
35314
|
-
}, handleVueModuleServerPath = async (
|
|
35368
|
+
}, handleVueModuleServerPath = async (state2, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
35315
35369
|
await invalidateNonVueModules(nonVueFiles);
|
|
35316
35370
|
const serverDuration = Date.now() - startTime;
|
|
35317
35371
|
const forceReload = nonVueFiles.length > 0;
|
|
35318
|
-
await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(
|
|
35319
|
-
scheduleVueBundleRebuild(
|
|
35372
|
+
await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state2, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
|
|
35373
|
+
scheduleVueBundleRebuild(state2, vueFiles, config)();
|
|
35320
35374
|
onRebuildComplete({
|
|
35321
|
-
hmrState:
|
|
35322
|
-
manifest:
|
|
35375
|
+
hmrState: state2,
|
|
35376
|
+
manifest: state2.manifest
|
|
35323
35377
|
});
|
|
35324
|
-
return
|
|
35325
|
-
}, VUE_BUNDLE_DEBOUNCE_MS = 2000, runVueBundleRebuild = async (
|
|
35378
|
+
return state2.manifest;
|
|
35379
|
+
}, VUE_BUNDLE_DEBOUNCE_MS = 2000, runVueBundleRebuild = async (state2, vueFiles, config) => {
|
|
35326
35380
|
if (vueFiles.length === 0)
|
|
35327
35381
|
return;
|
|
35328
35382
|
const vueDir = config.vueDirectory ?? "";
|
|
35329
35383
|
if (!vueDir)
|
|
35330
35384
|
return;
|
|
35331
|
-
const { buildDir } =
|
|
35385
|
+
const { buildDir } = state2.resolvedPaths;
|
|
35332
35386
|
const { compileVue: compileVue2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
35333
35387
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
35334
|
-
const clientRoot = await computeClientRoot(
|
|
35388
|
+
const clientRoot = await computeClientRoot(state2.resolvedPaths);
|
|
35335
35389
|
const {
|
|
35336
35390
|
vueServerPaths,
|
|
35337
35391
|
vueIndexPaths,
|
|
35338
35392
|
vueClientPaths,
|
|
35339
35393
|
vueCssPaths,
|
|
35340
35394
|
vueSpaRoutesBySource
|
|
35341
|
-
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(
|
|
35395
|
+
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state2.config));
|
|
35342
35396
|
const serverEntries = [...vueServerPaths];
|
|
35343
35397
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
35344
|
-
const cssOutDir = join58(buildDir,
|
|
35345
|
-
const { serverRoot, serverOutDir } = await computeServerOutPaths(
|
|
35398
|
+
const cssOutDir = join58(buildDir, state2.resolvedPaths.assetsDir ? basename20(state2.resolvedPaths.assetsDir) : "assets", "css");
|
|
35399
|
+
const { serverRoot, serverOutDir } = await computeServerOutPaths(state2.resolvedPaths, "vue");
|
|
35346
35400
|
const serverExternals = await getServerBundleExternals();
|
|
35347
|
-
const serverExternalsPlugins = await getServerBundleExternalsPlugins(
|
|
35401
|
+
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state2.config);
|
|
35348
35402
|
const clientVendorPaths = await getClientVendorPaths();
|
|
35349
35403
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
35350
35404
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -35355,7 +35409,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35355
35409
|
outdir: serverOutDir,
|
|
35356
35410
|
plugins: [
|
|
35357
35411
|
...serverExternalsPlugins,
|
|
35358
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35412
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35359
35413
|
],
|
|
35360
35414
|
root: serverRoot,
|
|
35361
35415
|
sourcemap: "inline",
|
|
@@ -35369,7 +35423,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35369
35423
|
naming: "[dir]/[name].[hash].[ext]",
|
|
35370
35424
|
outdir: buildDir,
|
|
35371
35425
|
plugins: [
|
|
35372
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35426
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35373
35427
|
],
|
|
35374
35428
|
root: clientRoot,
|
|
35375
35429
|
sourcemap: "inline",
|
|
@@ -35381,7 +35435,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35381
35435
|
naming: "[name].[hash].[ext]",
|
|
35382
35436
|
outdir: cssOutDir,
|
|
35383
35437
|
plugins: [
|
|
35384
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(
|
|
35438
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state2.config))
|
|
35385
35439
|
],
|
|
35386
35440
|
target: "browser",
|
|
35387
35441
|
throw: false
|
|
@@ -35391,19 +35445,19 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35391
35445
|
logBundleFailure("vue client", clientResult);
|
|
35392
35446
|
logBundleFailure("vue css", cssResult);
|
|
35393
35447
|
await rewriteClientVendorImports(clientResult, clientVendorPaths);
|
|
35394
|
-
handleServerManifestUpdate(
|
|
35395
|
-
await handleClientManifestUpdate(
|
|
35396
|
-
await handleClientManifestUpdate(
|
|
35397
|
-
await copyVueServerSiblingCss(
|
|
35448
|
+
handleServerManifestUpdate(state2, serverResult);
|
|
35449
|
+
await handleClientManifestUpdate(state2, clientResult, buildDir);
|
|
35450
|
+
await handleClientManifestUpdate(state2, cssResult, buildDir);
|
|
35451
|
+
await copyVueServerSiblingCss(state2, serverResult, cssResult);
|
|
35398
35452
|
await pruneStaleHashedSiblings(serverResult?.outputs);
|
|
35399
35453
|
await pruneStaleHashedSiblings(clientResult?.outputs);
|
|
35400
35454
|
await pruneStaleHashedSiblings(cssResult?.outputs);
|
|
35401
35455
|
if (vueSpaRoutesBySource.size > 0) {
|
|
35402
35456
|
const spaManifestEntries = await writeSpaSideManifests(vueSpaRoutesBySource, (pascalName) => {
|
|
35403
|
-
const fromManifest =
|
|
35457
|
+
const fromManifest = state2.manifest[pascalName];
|
|
35404
35458
|
return typeof fromManifest === "string" && isAbsolute10(fromManifest) && fromManifest.endsWith(".js") ? fromManifest : undefined;
|
|
35405
35459
|
});
|
|
35406
|
-
Object.assign(
|
|
35460
|
+
Object.assign(state2.manifest, spaManifestEntries);
|
|
35407
35461
|
}
|
|
35408
35462
|
clearDevSsrCssCaches();
|
|
35409
35463
|
if (serverResult?.success) {
|
|
@@ -35420,18 +35474,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35420
35474
|
chainBundleInlineSourcemap2(out.path);
|
|
35421
35475
|
}
|
|
35422
35476
|
}
|
|
35423
|
-
broadcastToClients(
|
|
35424
|
-
data: { manifest:
|
|
35477
|
+
broadcastToClients(state2, {
|
|
35478
|
+
data: { manifest: state2.manifest },
|
|
35425
35479
|
type: "vue-tier-zero-ssr-rebuild-complete"
|
|
35426
35480
|
});
|
|
35427
|
-
}, scheduleVueBundleRebuild = (
|
|
35428
|
-
|
|
35429
|
-
const ctx = getOrCreateBundleCtx(vueBundleState,
|
|
35481
|
+
}, scheduleVueBundleRebuild = (state2, vueFiles, config) => {
|
|
35482
|
+
state2.pendingBundleRebuilds.add("vue");
|
|
35483
|
+
const ctx = getOrCreateBundleCtx(vueBundleState, state2);
|
|
35430
35484
|
for (const file6 of vueFiles)
|
|
35431
35485
|
ctx.pendingFiles.add(file6);
|
|
35432
35486
|
const runBatch = async (filesSnapshot) => {
|
|
35433
35487
|
try {
|
|
35434
|
-
await runVueBundleRebuild(
|
|
35488
|
+
await runVueBundleRebuild(state2, filesSnapshot, config);
|
|
35435
35489
|
return true;
|
|
35436
35490
|
} catch (error) {
|
|
35437
35491
|
requeueFailedBundleBatch(ctx, filesSnapshot, "vue", error);
|
|
@@ -35453,7 +35507,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35453
35507
|
} finally {
|
|
35454
35508
|
ctx.inFlight = null;
|
|
35455
35509
|
if (!ctx.debounceTimer && !ctx.debouncedPromise && !ctx.pending && ctx.pendingFiles.size === 0)
|
|
35456
|
-
|
|
35510
|
+
state2.pendingBundleRebuilds.delete("vue");
|
|
35457
35511
|
}
|
|
35458
35512
|
};
|
|
35459
35513
|
const fire = () => {
|
|
@@ -35480,15 +35534,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35480
35534
|
ctx.debounceTimer = setTimeout(fire, VUE_BUNDLE_DEBOUNCE_MS);
|
|
35481
35535
|
return ctx.debouncedPromise;
|
|
35482
35536
|
};
|
|
35483
|
-
}, handleVueFastPath = async (
|
|
35484
|
-
const vueFiles = filesToRebuild.filter((file6) => file6.endsWith(".vue") && detectFramework(file6,
|
|
35485
|
-
const nonVueFiles = filesToRebuild.filter((file6) => !file6.endsWith(".vue") && detectFramework(file6,
|
|
35486
|
-
collectAffectedVueFiles(
|
|
35537
|
+
}, handleVueFastPath = async (state2, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
35538
|
+
const vueFiles = filesToRebuild.filter((file6) => file6.endsWith(".vue") && detectFramework(file6, state2.resolvedPaths) === "vue");
|
|
35539
|
+
const nonVueFiles = filesToRebuild.filter((file6) => !file6.endsWith(".vue") && detectFramework(file6, state2.resolvedPaths) === "vue");
|
|
35540
|
+
collectAffectedVueFiles(state2, nonVueFiles, vueFiles);
|
|
35487
35541
|
if (vueFiles.length > 0) {
|
|
35488
|
-
return handleVueModuleServerPath(
|
|
35542
|
+
return handleVueModuleServerPath(state2, vueFiles, nonVueFiles, config, startTime, onRebuildComplete);
|
|
35489
35543
|
}
|
|
35490
|
-
onRebuildComplete({ hmrState:
|
|
35491
|
-
return
|
|
35544
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
35545
|
+
return state2.manifest;
|
|
35492
35546
|
}, EMBER_PAGE_EXTENSIONS, collectAllEmberPages = async (emberPagesPath) => {
|
|
35493
35547
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
35494
35548
|
try {
|
|
@@ -35500,57 +35554,57 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35500
35554
|
} catch {
|
|
35501
35555
|
return [];
|
|
35502
35556
|
}
|
|
35503
|
-
}, handleEmberFastPath = async (
|
|
35557
|
+
}, handleEmberFastPath = async (state2, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
35504
35558
|
const emberDir = config.emberDirectory ?? "";
|
|
35505
|
-
const emberFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35559
|
+
const emberFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "ember");
|
|
35506
35560
|
if (emberFiles.length === 0 || !emberDir) {
|
|
35507
|
-
onRebuildComplete({ hmrState:
|
|
35508
|
-
return
|
|
35561
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
35562
|
+
return state2.manifest;
|
|
35509
35563
|
}
|
|
35510
35564
|
const emberPagesPath = resolvePath(emberDir, "pages");
|
|
35511
35565
|
const directPageEntries = emberFiles.filter((file6) => resolvePath(file6).startsWith(emberPagesPath));
|
|
35512
35566
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
35513
35567
|
if (allPageEntries.length === 0) {
|
|
35514
|
-
onRebuildComplete({ hmrState:
|
|
35515
|
-
return
|
|
35568
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
35569
|
+
return state2.manifest;
|
|
35516
35570
|
}
|
|
35517
35571
|
const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
|
|
35518
35572
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
35519
35573
|
for (const serverPath of serverPaths) {
|
|
35520
35574
|
const fileBase = basename20(serverPath, ".js");
|
|
35521
|
-
|
|
35575
|
+
state2.manifest[toPascal(fileBase)] = resolvePath(serverPath);
|
|
35522
35576
|
}
|
|
35523
35577
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
35524
35578
|
invalidateEmberSsrCache2();
|
|
35525
35579
|
const duration = Date.now() - startTime;
|
|
35526
35580
|
const [primary] = emberFiles;
|
|
35527
35581
|
if (primary) {
|
|
35528
|
-
|
|
35529
|
-
|
|
35582
|
+
state2.lastHmrPath = relative26(process.cwd(), primary).replace(/\\/g, "/");
|
|
35583
|
+
state2.lastHmrFramework = "ember";
|
|
35530
35584
|
logHmrUpdate(primary, "ember", duration);
|
|
35531
35585
|
}
|
|
35532
|
-
broadcastToClients(
|
|
35586
|
+
broadcastToClients(state2, {
|
|
35533
35587
|
data: {
|
|
35534
35588
|
affectedPages: allPageEntries,
|
|
35535
35589
|
framework: "ember",
|
|
35536
|
-
manifest:
|
|
35590
|
+
manifest: state2.manifest,
|
|
35537
35591
|
serverDuration: duration,
|
|
35538
35592
|
sourceFile: primary
|
|
35539
35593
|
},
|
|
35540
35594
|
type: "full-reload"
|
|
35541
35595
|
});
|
|
35542
|
-
onRebuildComplete({ hmrState:
|
|
35543
|
-
return
|
|
35544
|
-
}, collectModuleUpdatesForFramework = (framework, filesToRebuild, manifest,
|
|
35545
|
-
const frameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35596
|
+
onRebuildComplete({ hmrState: state2, manifest: state2.manifest });
|
|
35597
|
+
return state2.manifest;
|
|
35598
|
+
}, collectModuleUpdatesForFramework = (framework, filesToRebuild, manifest, state2) => {
|
|
35599
|
+
const frameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === framework);
|
|
35546
35600
|
if (frameworkFiles.length === 0) {
|
|
35547
35601
|
return [];
|
|
35548
35602
|
}
|
|
35549
|
-
return createModuleUpdates(frameworkFiles, framework, manifest,
|
|
35550
|
-
}, collectAllModuleUpdates = (affectedFrameworks, filesToRebuild, manifest,
|
|
35603
|
+
return createModuleUpdates(frameworkFiles, framework, manifest, state2.resolvedPaths);
|
|
35604
|
+
}, collectAllModuleUpdates = (affectedFrameworks, filesToRebuild, manifest, state2) => {
|
|
35551
35605
|
const allModuleUpdates = [];
|
|
35552
35606
|
affectedFrameworks.forEach((framework) => {
|
|
35553
|
-
const moduleUpdates = collectModuleUpdatesForFramework(framework, filesToRebuild, manifest,
|
|
35607
|
+
const moduleUpdates = collectModuleUpdatesForFramework(framework, filesToRebuild, manifest, state2);
|
|
35554
35608
|
moduleUpdates.forEach((update) => {
|
|
35555
35609
|
if (update) {
|
|
35556
35610
|
allModuleUpdates.push(update);
|
|
@@ -35558,11 +35612,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35558
35612
|
});
|
|
35559
35613
|
});
|
|
35560
35614
|
return allModuleUpdates;
|
|
35561
|
-
}, handleReactHMR = async (
|
|
35562
|
-
if (!affectedFrameworks.includes("react") || !
|
|
35615
|
+
}, handleReactHMR = async (state2, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
35616
|
+
if (!affectedFrameworks.includes("react") || !state2.resolvedPaths.reactDir) {
|
|
35563
35617
|
return;
|
|
35564
35618
|
}
|
|
35565
|
-
const reactFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35619
|
+
const reactFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "react");
|
|
35566
35620
|
if (reactFiles.length === 0) {
|
|
35567
35621
|
return;
|
|
35568
35622
|
}
|
|
@@ -35575,12 +35629,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35575
35629
|
warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2
|
|
35576
35630
|
} = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
35577
35631
|
warnIfReactFastRefreshUnsupported2();
|
|
35578
|
-
await handleReactModuleServerPath(
|
|
35632
|
+
await handleReactModuleServerPath(state2, reactFiles, Date.now() - duration, isReactFastRefreshSupported2(), () => {
|
|
35579
35633
|
return;
|
|
35580
35634
|
});
|
|
35581
35635
|
} catch (err) {
|
|
35582
35636
|
logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
|
|
35583
|
-
broadcastToClients(
|
|
35637
|
+
broadcastToClients(state2, {
|
|
35584
35638
|
data: {
|
|
35585
35639
|
framework: "react",
|
|
35586
35640
|
hasComponentChanges: true,
|
|
@@ -35598,7 +35652,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35598
35652
|
message: err instanceof Error ? err.message : String(err)
|
|
35599
35653
|
});
|
|
35600
35654
|
}
|
|
35601
|
-
}, handleScriptUpdate = (
|
|
35655
|
+
}, handleScriptUpdate = (state2, scriptFile, manifest, framework, duration) => {
|
|
35602
35656
|
const scriptBaseName = basename20(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
35603
35657
|
const pascalName = toPascal(scriptBaseName);
|
|
35604
35658
|
const scriptPath = manifest[pascalName] || null;
|
|
@@ -35607,7 +35661,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35607
35661
|
return;
|
|
35608
35662
|
}
|
|
35609
35663
|
logScriptUpdate(scriptFile, framework, duration);
|
|
35610
|
-
broadcastToClients(
|
|
35664
|
+
broadcastToClients(state2, {
|
|
35611
35665
|
data: {
|
|
35612
35666
|
framework,
|
|
35613
35667
|
manifest,
|
|
@@ -35643,7 +35697,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35643
35697
|
return false;
|
|
35644
35698
|
}
|
|
35645
35699
|
return filesToRebuild.some((file6) => islandFiles.has(resolvePath(file6)));
|
|
35646
|
-
}, handleIslandSourceReload = async (
|
|
35700
|
+
}, handleIslandSourceReload = async (state2, config, filesToRebuild, manifest, serverDuration) => {
|
|
35647
35701
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
35648
35702
|
if (!shouldReload) {
|
|
35649
35703
|
return false;
|
|
@@ -35653,9 +35707,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35653
35707
|
if (affectedPages.length === 0)
|
|
35654
35708
|
return true;
|
|
35655
35709
|
const affectedFrameworks = [
|
|
35656
|
-
...new Set(affectedPages.map((page) => detectFramework(page,
|
|
35710
|
+
...new Set(affectedPages.map((page) => detectFramework(page, state2.resolvedPaths)).filter((framework) => framework !== "ignored"))
|
|
35657
35711
|
];
|
|
35658
|
-
broadcastToClients(
|
|
35712
|
+
broadcastToClients(state2, {
|
|
35659
35713
|
data: {
|
|
35660
35714
|
affectedFrameworks,
|
|
35661
35715
|
affectedPages,
|
|
@@ -35667,11 +35721,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35667
35721
|
type: "full-reload"
|
|
35668
35722
|
});
|
|
35669
35723
|
return true;
|
|
35670
|
-
}, handleHTMLScriptHMR = (
|
|
35671
|
-
if (!
|
|
35724
|
+
}, handleHTMLScriptHMR = (state2, filesToRebuild, manifest, duration) => {
|
|
35725
|
+
if (!state2.resolvedPaths.htmlDir) {
|
|
35672
35726
|
return;
|
|
35673
35727
|
}
|
|
35674
|
-
const htmlFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35728
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "html");
|
|
35675
35729
|
if (htmlFrameworkFiles.length === 0) {
|
|
35676
35730
|
return;
|
|
35677
35731
|
}
|
|
@@ -35681,16 +35735,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35681
35735
|
return;
|
|
35682
35736
|
}
|
|
35683
35737
|
scriptFiles.forEach((scriptFile) => {
|
|
35684
|
-
handleScriptUpdate(
|
|
35738
|
+
handleScriptUpdate(state2, scriptFile, manifest, "html", duration);
|
|
35685
35739
|
});
|
|
35686
|
-
}, computeOutputPagesDir = (
|
|
35740
|
+
}, computeOutputPagesDir = (state2, config, framework) => {
|
|
35687
35741
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
35688
35742
|
if (isSingle) {
|
|
35689
|
-
return resolvePath(
|
|
35743
|
+
return resolvePath(state2.resolvedPaths.buildDir, "pages");
|
|
35690
35744
|
}
|
|
35691
35745
|
const dirName = framework === "html" ? basename20(config.htmlDirectory ?? "html") : basename20(config.htmxDirectory ?? "htmx");
|
|
35692
|
-
return resolvePath(
|
|
35693
|
-
}, processHtmlPageUpdate = async (
|
|
35746
|
+
return resolvePath(state2.resolvedPaths.buildDir, dirName, "pages");
|
|
35747
|
+
}, processHtmlPageUpdate = async (state2, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
35694
35748
|
try {
|
|
35695
35749
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
35696
35750
|
const newHTML = await handleHTMLUpdate2(builtHtmlPagePath);
|
|
@@ -35698,7 +35752,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35698
35752
|
return;
|
|
35699
35753
|
}
|
|
35700
35754
|
logHmrUpdate(pageFile, "html", duration);
|
|
35701
|
-
broadcastToClients(
|
|
35755
|
+
broadcastToClients(state2, {
|
|
35702
35756
|
data: {
|
|
35703
35757
|
framework: "html",
|
|
35704
35758
|
html: newHTML,
|
|
@@ -35715,25 +35769,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35715
35769
|
message: err instanceof Error ? err.message : String(err)
|
|
35716
35770
|
});
|
|
35717
35771
|
}
|
|
35718
|
-
}, handleHTMLPageHMR = async (
|
|
35719
|
-
if (!
|
|
35772
|
+
}, handleHTMLPageHMR = async (state2, config, filesToRebuild, manifest, duration) => {
|
|
35773
|
+
if (!state2.resolvedPaths.htmlDir) {
|
|
35720
35774
|
return;
|
|
35721
35775
|
}
|
|
35722
35776
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
35723
|
-
const htmlFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35777
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "html");
|
|
35724
35778
|
if (htmlFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
35725
35779
|
return;
|
|
35726
35780
|
}
|
|
35727
35781
|
const htmlPageFiles = htmlFrameworkFiles.filter((file6) => file6.endsWith(".html"));
|
|
35728
|
-
const outputHtmlPages = computeOutputPagesDir(
|
|
35782
|
+
const outputHtmlPages = computeOutputPagesDir(state2, config, "html");
|
|
35729
35783
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
35730
35784
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
35731
35785
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
35732
35786
|
const htmlPageName = basename20(pageFile);
|
|
35733
35787
|
const builtHtmlPagePath = resolvePath(outputHtmlPages, htmlPageName);
|
|
35734
|
-
await processHtmlPageUpdate(
|
|
35788
|
+
await processHtmlPageUpdate(state2, pageFile, builtHtmlPagePath, manifest, duration);
|
|
35735
35789
|
});
|
|
35736
|
-
}, handleVueCssOnlyUpdate = (
|
|
35790
|
+
}, handleVueCssOnlyUpdate = (state2, vueCssFiles, manifest, duration) => {
|
|
35737
35791
|
const [cssFile] = vueCssFiles;
|
|
35738
35792
|
if (!cssFile) {
|
|
35739
35793
|
return;
|
|
@@ -35743,7 +35797,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35743
35797
|
const cssKey = `${cssPascalName}CSS`;
|
|
35744
35798
|
const cssUrl = manifest[cssKey] || null;
|
|
35745
35799
|
logCssUpdate(cssFile, "vue", duration);
|
|
35746
|
-
broadcastToClients(
|
|
35800
|
+
broadcastToClients(state2, {
|
|
35747
35801
|
data: {
|
|
35748
35802
|
cssBaseName,
|
|
35749
35803
|
cssUrl,
|
|
@@ -35755,9 +35809,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35755
35809
|
},
|
|
35756
35810
|
type: "vue-update"
|
|
35757
35811
|
});
|
|
35758
|
-
}, broadcastVueStyleOnly = (
|
|
35812
|
+
}, broadcastVueStyleOnly = (state2, vuePagePath, baseName, cssUrl, hmrId, manifest, duration) => {
|
|
35759
35813
|
logCssUpdate(vuePagePath, "vue", duration);
|
|
35760
|
-
broadcastToClients(
|
|
35814
|
+
broadcastToClients(state2, {
|
|
35761
35815
|
data: {
|
|
35762
35816
|
changeType: "style-only",
|
|
35763
35817
|
cssBaseName: baseName,
|
|
@@ -35771,10 +35825,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35771
35825
|
},
|
|
35772
35826
|
type: "vue-update"
|
|
35773
35827
|
});
|
|
35774
|
-
}, broadcastVueFullUpdate = (
|
|
35828
|
+
}, broadcastVueFullUpdate = (state2, vuePagePath, changeType, cssUrl, hmrId, manifest, pascalName, duration) => {
|
|
35775
35829
|
const componentPath = manifest[`${pascalName}Client`] || null;
|
|
35776
35830
|
logHmrUpdate(vuePagePath, "vue", duration);
|
|
35777
|
-
broadcastToClients(
|
|
35831
|
+
broadcastToClients(state2, {
|
|
35778
35832
|
data: {
|
|
35779
35833
|
changeType,
|
|
35780
35834
|
componentPath,
|
|
@@ -35789,25 +35843,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35789
35843
|
},
|
|
35790
35844
|
type: "vue-update"
|
|
35791
35845
|
});
|
|
35792
|
-
}, broadcastVuePageChange = async (
|
|
35846
|
+
}, broadcastVuePageChange = async (state2, config, vuePagePath, manifest, duration) => {
|
|
35793
35847
|
const fileName = basename20(vuePagePath);
|
|
35794
35848
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
35795
35849
|
const pascalName = toPascal(baseName);
|
|
35796
35850
|
const vueRoot = config.vueDirectory;
|
|
35797
|
-
const hmrId = vueRoot ?
|
|
35851
|
+
const hmrId = vueRoot ? relative26(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
35798
35852
|
const cssKey = `${pascalName}CSS`;
|
|
35799
35853
|
const cssUrl = manifest[cssKey] || null;
|
|
35800
35854
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
35801
35855
|
const hmrMeta = vueHmrMetadata2.get(resolvePath(vuePagePath));
|
|
35802
35856
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
35803
35857
|
if (changeType === "style-only") {
|
|
35804
|
-
broadcastVueStyleOnly(
|
|
35858
|
+
broadcastVueStyleOnly(state2, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
35805
35859
|
return;
|
|
35806
35860
|
}
|
|
35807
|
-
broadcastVueFullUpdate(
|
|
35808
|
-
}, processVuePageUpdate = async (
|
|
35861
|
+
broadcastVueFullUpdate(state2, vuePagePath, changeType, cssUrl, hmrId, manifest, pascalName, duration);
|
|
35862
|
+
}, processVuePageUpdate = async (state2, config, vuePagePath, manifest, duration) => {
|
|
35809
35863
|
try {
|
|
35810
|
-
await broadcastVuePageChange(
|
|
35864
|
+
await broadcastVuePageChange(state2, config, vuePagePath, manifest, duration);
|
|
35811
35865
|
} catch (err) {
|
|
35812
35866
|
console.error("[hmr] vue live update failed:", err instanceof Error ? err.message : err);
|
|
35813
35867
|
sendTelemetryEvent("hmr:error", {
|
|
@@ -35815,11 +35869,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35815
35869
|
message: err instanceof Error ? err.message : String(err)
|
|
35816
35870
|
});
|
|
35817
35871
|
}
|
|
35818
|
-
}, handleVueHMR = async (
|
|
35872
|
+
}, handleVueHMR = async (state2, config, filesToRebuild, manifest, duration) => {
|
|
35819
35873
|
if (!config.vueDirectory) {
|
|
35820
35874
|
return;
|
|
35821
35875
|
}
|
|
35822
|
-
const vueFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35876
|
+
const vueFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "vue");
|
|
35823
35877
|
if (vueFiles.length === 0) {
|
|
35824
35878
|
return;
|
|
35825
35879
|
}
|
|
@@ -35829,10 +35883,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35829
35883
|
const vuePageFiles = vueFiles.filter((file6) => file6.replace(/\\/g, "/").includes("/pages/"));
|
|
35830
35884
|
const pagesToUpdate = vuePageFiles.length > 0 ? vuePageFiles : vueComponentFiles;
|
|
35831
35885
|
if (isCssOnlyChange && vueCssFiles.length > 0) {
|
|
35832
|
-
handleVueCssOnlyUpdate(
|
|
35886
|
+
handleVueCssOnlyUpdate(state2, vueCssFiles, manifest, duration);
|
|
35833
35887
|
}
|
|
35834
|
-
await runSequentially(pagesToUpdate, (vuePagePath) => processVuePageUpdate(
|
|
35835
|
-
}, handleSvelteCssOnlyUpdate = (
|
|
35888
|
+
await runSequentially(pagesToUpdate, (vuePagePath) => processVuePageUpdate(state2, config, vuePagePath, manifest, duration));
|
|
35889
|
+
}, handleSvelteCssOnlyUpdate = (state2, svelteCssFiles, manifest, duration) => {
|
|
35836
35890
|
const [cssFile] = svelteCssFiles;
|
|
35837
35891
|
if (!cssFile) {
|
|
35838
35892
|
return;
|
|
@@ -35842,7 +35896,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35842
35896
|
const cssKey = `${cssPascalName}CSS`;
|
|
35843
35897
|
const cssUrl = manifest[cssKey] || null;
|
|
35844
35898
|
logCssUpdate(cssFile, "svelte", duration);
|
|
35845
|
-
broadcastToClients(
|
|
35899
|
+
broadcastToClients(state2, {
|
|
35846
35900
|
data: {
|
|
35847
35901
|
cssBaseName,
|
|
35848
35902
|
cssUrl,
|
|
@@ -35854,7 +35908,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35854
35908
|
},
|
|
35855
35909
|
type: "svelte-update"
|
|
35856
35910
|
});
|
|
35857
|
-
}, broadcastSveltePageUpdate = (
|
|
35911
|
+
}, broadcastSveltePageUpdate = (state2, sveltePagePath, manifest, duration) => {
|
|
35858
35912
|
try {
|
|
35859
35913
|
const fileName = basename20(sveltePagePath);
|
|
35860
35914
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
@@ -35862,7 +35916,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35862
35916
|
const cssKey = `${pascalName}CSS`;
|
|
35863
35917
|
const cssUrl = manifest[cssKey] || null;
|
|
35864
35918
|
logHmrUpdate(sveltePagePath, "svelte", duration);
|
|
35865
|
-
broadcastToClients(
|
|
35919
|
+
broadcastToClients(state2, {
|
|
35866
35920
|
data: {
|
|
35867
35921
|
cssBaseName: baseName,
|
|
35868
35922
|
cssUrl,
|
|
@@ -35882,11 +35936,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35882
35936
|
message: err instanceof Error ? err.message : String(err)
|
|
35883
35937
|
});
|
|
35884
35938
|
}
|
|
35885
|
-
}, handleSvelteHMR = (
|
|
35939
|
+
}, handleSvelteHMR = (state2, config, filesToRebuild, manifest, duration) => {
|
|
35886
35940
|
if (!config.svelteDirectory) {
|
|
35887
35941
|
return;
|
|
35888
35942
|
}
|
|
35889
|
-
const svelteFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35943
|
+
const svelteFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "svelte");
|
|
35890
35944
|
if (svelteFiles.length === 0) {
|
|
35891
35945
|
return;
|
|
35892
35946
|
}
|
|
@@ -35896,13 +35950,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35896
35950
|
const sveltePageFiles = svelteFiles.filter((file6) => file6.replace(/\\/g, "/").includes("/pages/"));
|
|
35897
35951
|
const pagesToUpdate = sveltePageFiles.length > 0 ? sveltePageFiles : svelteComponentFiles;
|
|
35898
35952
|
if (isCssOnlyChange && svelteCssFiles.length > 0) {
|
|
35899
|
-
handleSvelteCssOnlyUpdate(
|
|
35953
|
+
handleSvelteCssOnlyUpdate(state2, svelteCssFiles, manifest, duration);
|
|
35900
35954
|
}
|
|
35901
|
-
const surgicallyHandled =
|
|
35955
|
+
const surgicallyHandled = state2.svelteSurgicallyHandled;
|
|
35902
35956
|
pagesToUpdate.filter((sveltePagePath) => !surgicallyHandled?.has(resolvePath(sveltePagePath))).forEach((sveltePagePath) => {
|
|
35903
|
-
broadcastSveltePageUpdate(
|
|
35957
|
+
broadcastSveltePageUpdate(state2, sveltePagePath, manifest, duration);
|
|
35904
35958
|
});
|
|
35905
|
-
}, handleAngularCssOnlyUpdate = (
|
|
35959
|
+
}, handleAngularCssOnlyUpdate = (state2, angularCssFiles, manifest, duration) => {
|
|
35906
35960
|
const [cssFile] = angularCssFiles;
|
|
35907
35961
|
if (!cssFile) {
|
|
35908
35962
|
return;
|
|
@@ -35912,7 +35966,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35912
35966
|
const cssKey = `${cssPascalName}CSS`;
|
|
35913
35967
|
const cssUrl = manifest[cssKey] || null;
|
|
35914
35968
|
logCssUpdate(cssFile, "angular", duration);
|
|
35915
|
-
broadcastToClients(
|
|
35969
|
+
broadcastToClients(state2, {
|
|
35916
35970
|
data: {
|
|
35917
35971
|
cssBaseName,
|
|
35918
35972
|
cssUrl,
|
|
@@ -35924,22 +35978,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35924
35978
|
},
|
|
35925
35979
|
type: "angular-update"
|
|
35926
35980
|
});
|
|
35927
|
-
}, handleAngularHMR = (
|
|
35981
|
+
}, handleAngularHMR = (state2, config, filesToRebuild, manifest, duration) => {
|
|
35928
35982
|
if (!config.angularDirectory)
|
|
35929
35983
|
return;
|
|
35930
|
-
const angularFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35984
|
+
const angularFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "angular");
|
|
35931
35985
|
if (angularFiles.length === 0)
|
|
35932
35986
|
return;
|
|
35933
35987
|
const angularCssFiles = angularFiles.filter(isStylePath);
|
|
35934
35988
|
const isCssOnlyChange = angularFiles.every(isStylePath) && angularCssFiles.length > 0;
|
|
35935
35989
|
if (isCssOnlyChange) {
|
|
35936
|
-
handleAngularCssOnlyUpdate(
|
|
35990
|
+
handleAngularCssOnlyUpdate(state2, angularCssFiles, manifest, duration);
|
|
35937
35991
|
}
|
|
35938
|
-
}, handleHTMXScriptHMR = (
|
|
35939
|
-
if (!
|
|
35992
|
+
}, handleHTMXScriptHMR = (state2, filesToRebuild, manifest, duration) => {
|
|
35993
|
+
if (!state2.resolvedPaths.htmxDir) {
|
|
35940
35994
|
return;
|
|
35941
35995
|
}
|
|
35942
|
-
const htmxFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
35996
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "htmx");
|
|
35943
35997
|
if (htmxFrameworkFiles.length === 0) {
|
|
35944
35998
|
return;
|
|
35945
35999
|
}
|
|
@@ -35949,9 +36003,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35949
36003
|
return;
|
|
35950
36004
|
}
|
|
35951
36005
|
htmxScriptFiles.forEach((scriptFile) => {
|
|
35952
|
-
handleScriptUpdate(
|
|
36006
|
+
handleScriptUpdate(state2, scriptFile, manifest, "htmx", duration);
|
|
35953
36007
|
});
|
|
35954
|
-
}, processHtmxPageUpdate = async (
|
|
36008
|
+
}, processHtmxPageUpdate = async (state2, htmxPageFile, builtHtmxPagePath, manifest, duration) => {
|
|
35955
36009
|
try {
|
|
35956
36010
|
const { handleHTMXUpdate: handleHTMXUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMXHMR(), exports_simpleHTMXHMR));
|
|
35957
36011
|
const newHTML = await handleHTMXUpdate2(builtHtmxPagePath);
|
|
@@ -35959,7 +36013,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35959
36013
|
return;
|
|
35960
36014
|
}
|
|
35961
36015
|
logHmrUpdate(htmxPageFile, "htmx", duration);
|
|
35962
|
-
broadcastToClients(
|
|
36016
|
+
broadcastToClients(state2, {
|
|
35963
36017
|
data: {
|
|
35964
36018
|
framework: "htmx",
|
|
35965
36019
|
html: newHTML,
|
|
@@ -35976,23 +36030,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35976
36030
|
message: err instanceof Error ? err.message : String(err)
|
|
35977
36031
|
});
|
|
35978
36032
|
}
|
|
35979
|
-
}, handleHTMXPageHMR = async (
|
|
35980
|
-
if (!
|
|
36033
|
+
}, handleHTMXPageHMR = async (state2, config, filesToRebuild, manifest, duration) => {
|
|
36034
|
+
if (!state2.resolvedPaths.htmxDir) {
|
|
35981
36035
|
return;
|
|
35982
36036
|
}
|
|
35983
36037
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
35984
|
-
const htmxFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6,
|
|
36038
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file6) => detectFramework(file6, state2.resolvedPaths) === "htmx");
|
|
35985
36039
|
if (htmxFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
35986
36040
|
return;
|
|
35987
36041
|
}
|
|
35988
36042
|
const htmxPageFiles = htmxFrameworkFiles.filter((file6) => file6.endsWith(".html"));
|
|
35989
|
-
const outputHtmxPages = computeOutputPagesDir(
|
|
36043
|
+
const outputHtmxPages = computeOutputPagesDir(state2, config, "htmx");
|
|
35990
36044
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
35991
36045
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
35992
36046
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
35993
36047
|
const htmxPageName = basename20(htmxPageFile);
|
|
35994
36048
|
const builtHtmxPagePath = resolvePath(outputHtmxPages, htmxPageName);
|
|
35995
|
-
await processHtmxPageUpdate(
|
|
36049
|
+
await processHtmxPageUpdate(state2, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
35996
36050
|
});
|
|
35997
36051
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
35998
36052
|
const paths = [];
|
|
@@ -36014,22 +36068,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36014
36068
|
moduleVersions[path2] = pathVersion;
|
|
36015
36069
|
}
|
|
36016
36070
|
});
|
|
36017
|
-
}, handleModuleUpdates = (
|
|
36071
|
+
}, handleModuleUpdates = (state2, allModuleUpdates, manifest) => {
|
|
36018
36072
|
const updatedModulePaths = collectUpdatedModulePaths(allModuleUpdates);
|
|
36019
36073
|
if (updatedModulePaths.length > 0) {
|
|
36020
|
-
incrementModuleVersions(
|
|
36074
|
+
incrementModuleVersions(state2.moduleVersions, updatedModulePaths);
|
|
36021
36075
|
}
|
|
36022
36076
|
if (allModuleUpdates.length === 0) {
|
|
36023
36077
|
return;
|
|
36024
36078
|
}
|
|
36025
36079
|
const updatesByFramework = groupModuleUpdatesByFramework(allModuleUpdates);
|
|
36026
|
-
const serverVersions = serializeModuleVersions(
|
|
36080
|
+
const serverVersions = serializeModuleVersions(state2.moduleVersions);
|
|
36027
36081
|
for (const [framework, updates] of updatesByFramework) {
|
|
36028
36082
|
const moduleVersions = {};
|
|
36029
36083
|
updates.forEach((update) => {
|
|
36030
|
-
buildModuleVersionsForUpdate(update,
|
|
36084
|
+
buildModuleVersionsForUpdate(update, state2.moduleVersions, moduleVersions);
|
|
36031
36085
|
});
|
|
36032
|
-
broadcastToClients(
|
|
36086
|
+
broadcastToClients(state2, {
|
|
36033
36087
|
data: {
|
|
36034
36088
|
framework,
|
|
36035
36089
|
manifest,
|
|
@@ -36038,7 +36092,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36038
36092
|
moduleKeys: update.moduleKeys,
|
|
36039
36093
|
modulePaths: update.modulePaths,
|
|
36040
36094
|
sourceFile: update.sourceFile,
|
|
36041
|
-
version:
|
|
36095
|
+
version: state2.moduleVersions.get(update.sourceFile)
|
|
36042
36096
|
})),
|
|
36043
36097
|
moduleVersions,
|
|
36044
36098
|
serverVersions
|
|
@@ -36047,42 +36101,42 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36047
36101
|
type: "module-update"
|
|
36048
36102
|
});
|
|
36049
36103
|
}
|
|
36050
|
-
}, handleFullBuildHMR = async (
|
|
36051
|
-
const allModuleUpdates = collectAllModuleUpdates(affectedFrameworks, filesToRebuild, manifest,
|
|
36052
|
-
await handleReactHMR(
|
|
36053
|
-
handleHTMLScriptHMR(
|
|
36054
|
-
await handleHTMLPageHMR(
|
|
36055
|
-
await handleVueHMR(
|
|
36056
|
-
handleSvelteHMR(
|
|
36057
|
-
handleAngularHMR(
|
|
36058
|
-
handleHTMXScriptHMR(
|
|
36059
|
-
await handleHTMXPageHMR(
|
|
36060
|
-
handleModuleUpdates(
|
|
36061
|
-
}, logStyleUpdatesForFramework = (
|
|
36104
|
+
}, handleFullBuildHMR = async (state2, config, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
36105
|
+
const allModuleUpdates = collectAllModuleUpdates(affectedFrameworks, filesToRebuild, manifest, state2);
|
|
36106
|
+
await handleReactHMR(state2, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
36107
|
+
handleHTMLScriptHMR(state2, filesToRebuild, manifest, duration);
|
|
36108
|
+
await handleHTMLPageHMR(state2, config, filesToRebuild, manifest, duration);
|
|
36109
|
+
await handleVueHMR(state2, config, filesToRebuild, manifest, duration);
|
|
36110
|
+
handleSvelteHMR(state2, config, filesToRebuild, manifest, duration);
|
|
36111
|
+
handleAngularHMR(state2, config, filesToRebuild, manifest, duration);
|
|
36112
|
+
handleHTMXScriptHMR(state2, filesToRebuild, manifest, duration);
|
|
36113
|
+
await handleHTMXPageHMR(state2, config, filesToRebuild, manifest, duration);
|
|
36114
|
+
handleModuleUpdates(state2, allModuleUpdates, manifest);
|
|
36115
|
+
}, logStyleUpdatesForFramework = (state2, framework, filesToRebuild, startTime) => {
|
|
36062
36116
|
const dur = Date.now() - startTime;
|
|
36063
36117
|
filesToRebuild.forEach((file6) => {
|
|
36064
|
-
if (detectFramework(file6,
|
|
36118
|
+
if (detectFramework(file6, state2.resolvedPaths) === framework) {
|
|
36065
36119
|
logCssUpdate(file6, framework, dur);
|
|
36066
36120
|
}
|
|
36067
36121
|
});
|
|
36068
|
-
}, broadcastSingleFrameworkUpdate = (
|
|
36122
|
+
}, broadcastSingleFrameworkUpdate = (state2, framework, filesToRebuild, manifest, startTime) => {
|
|
36069
36123
|
const type = framework === "styles" || framework === "assets" ? "style-update" : "framework-update";
|
|
36070
36124
|
if (type === "style-update" && filesToRebuild) {
|
|
36071
|
-
logStyleUpdatesForFramework(
|
|
36125
|
+
logStyleUpdatesForFramework(state2, framework, filesToRebuild, startTime);
|
|
36072
36126
|
}
|
|
36073
|
-
broadcastToClients(
|
|
36127
|
+
broadcastToClients(state2, {
|
|
36074
36128
|
data: {
|
|
36075
36129
|
framework,
|
|
36076
36130
|
manifest,
|
|
36077
36131
|
serverDuration: Date.now() - startTime,
|
|
36078
|
-
sourceFile: filesToRebuild?.find((file6) => detectFramework(file6,
|
|
36132
|
+
sourceFile: filesToRebuild?.find((file6) => detectFramework(file6, state2.resolvedPaths) === framework)
|
|
36079
36133
|
},
|
|
36080
36134
|
message: `${framework} framework updated`,
|
|
36081
36135
|
type
|
|
36082
36136
|
});
|
|
36083
|
-
}, broadcastFrameworkUpdates = (
|
|
36137
|
+
}, broadcastFrameworkUpdates = (state2, affectedFrameworks, filesToRebuild, manifest, startTime) => {
|
|
36084
36138
|
affectedFrameworks.forEach((framework) => {
|
|
36085
|
-
broadcastSingleFrameworkUpdate(
|
|
36139
|
+
broadcastSingleFrameworkUpdate(state2, framework, filesToRebuild, manifest, startTime);
|
|
36086
36140
|
});
|
|
36087
36141
|
}, HMR_SCRIPT_PATTERN, extractHmrScript = (destPath, readFs) => {
|
|
36088
36142
|
try {
|
|
@@ -36101,12 +36155,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36101
36155
|
return;
|
|
36102
36156
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
36103
36157
|
writeFs(destPath, html);
|
|
36104
|
-
}, processMarkupFileFastPath = async (
|
|
36158
|
+
}, processMarkupFileFastPath = async (state2, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
36105
36159
|
const destPath = resolvePath(outputDir, basename20(sourceFile));
|
|
36106
36160
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
36107
36161
|
const source = await Bun.file(sourceFile).text();
|
|
36108
36162
|
await Bun.write(destPath, source);
|
|
36109
|
-
await updateAssetPaths2(
|
|
36163
|
+
await updateAssetPaths2(state2.manifest, outputDir);
|
|
36110
36164
|
const { optimizeHtmlImages: optimizeHtmlImages2 } = await Promise.resolve().then(() => (init_optimizeHtmlImages(), exports_optimizeHtmlImages));
|
|
36111
36165
|
await optimizeHtmlImages2(outputDir);
|
|
36112
36166
|
injectHmrScript(destPath, hmrScript, readFs, writeFs);
|
|
@@ -36115,27 +36169,27 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36115
36169
|
return;
|
|
36116
36170
|
const dur = Date.now() - startTime;
|
|
36117
36171
|
logHmrUpdate(sourceFile, framework, dur);
|
|
36118
|
-
broadcastToClients(
|
|
36172
|
+
broadcastToClients(state2, {
|
|
36119
36173
|
data: {
|
|
36120
36174
|
framework,
|
|
36121
36175
|
html: newHTML,
|
|
36122
|
-
manifest:
|
|
36176
|
+
manifest: state2.manifest,
|
|
36123
36177
|
sourceFile
|
|
36124
36178
|
},
|
|
36125
36179
|
type: `${framework}-update`
|
|
36126
36180
|
});
|
|
36127
|
-
}, tryProcessMarkupFile = async (
|
|
36181
|
+
}, tryProcessMarkupFile = async (state2, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
36128
36182
|
try {
|
|
36129
|
-
await processMarkupFileFastPath(
|
|
36183
|
+
await processMarkupFileFastPath(state2, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs);
|
|
36130
36184
|
return true;
|
|
36131
36185
|
} catch {
|
|
36132
36186
|
return false;
|
|
36133
36187
|
}
|
|
36134
|
-
}, runMarkupFastPath = async (
|
|
36188
|
+
}, runMarkupFastPath = async (state2, config, filesToRebuild, startTime, framework) => {
|
|
36135
36189
|
const markupFiles = (filesToRebuild ?? []).filter((file6) => file6.endsWith(".html"));
|
|
36136
36190
|
if (markupFiles.length === 0)
|
|
36137
36191
|
return;
|
|
36138
|
-
const outputDir = computeOutputPagesDir(
|
|
36192
|
+
const outputDir = computeOutputPagesDir(state2, config, framework);
|
|
36139
36193
|
const { updateAssetPaths: updateAssetPaths2 } = await Promise.resolve().then(() => (init_updateAssetPaths(), exports_updateAssetPaths));
|
|
36140
36194
|
const handleUpdate = framework === "html" ? (await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR))).handleHTMLUpdate : (await Promise.resolve().then(() => (init_simpleHTMXHMR(), exports_simpleHTMXHMR))).handleHTMXUpdate;
|
|
36141
36195
|
const { readFileSync: readFs, writeFileSync: writeFs } = await import("fs");
|
|
@@ -36144,16 +36198,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36144
36198
|
if (!markupFile) {
|
|
36145
36199
|
return;
|
|
36146
36200
|
}
|
|
36147
|
-
const success = await tryProcessMarkupFile(
|
|
36201
|
+
const success = await tryProcessMarkupFile(state2, markupFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs);
|
|
36148
36202
|
if (!success) {
|
|
36149
36203
|
return;
|
|
36150
36204
|
}
|
|
36151
36205
|
await processMarkupFiles(remaining);
|
|
36152
36206
|
};
|
|
36153
36207
|
await processMarkupFiles(markupFiles);
|
|
36154
|
-
}, runHtmlFastPath = async (
|
|
36208
|
+
}, runHtmlFastPath = async (state2, config, filesToRebuild, startTime) => runMarkupFastPath(state2, config, filesToRebuild, startTime, "html"), runHtmxFastPath = async (state2, config, filesToRebuild, startTime) => runMarkupFastPath(state2, config, filesToRebuild, startTime, "htmx"), markHandledFiles = (files, framework, resolvedPaths, handled) => {
|
|
36155
36209
|
files.filter((f2) => detectFramework(f2, resolvedPaths) === framework).forEach((f2) => handled.add(f2));
|
|
36156
|
-
}, runFrameworkFastPaths = async (
|
|
36210
|
+
}, runFrameworkFastPaths = async (state2, config, affectedFrameworks, files, startTime, onRebuildComplete) => {
|
|
36157
36211
|
const handled = new Set;
|
|
36158
36212
|
const fastPaths = [
|
|
36159
36213
|
{
|
|
@@ -36185,44 +36239,44 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36185
36239
|
await runSequentially(fastPaths, async (fastPath) => {
|
|
36186
36240
|
if (!fastPath.directory || !affectedFrameworks.includes(fastPath.framework))
|
|
36187
36241
|
return;
|
|
36188
|
-
await fastPath.handler(
|
|
36189
|
-
markHandledFiles(files, fastPath.framework,
|
|
36242
|
+
await fastPath.handler(state2, config, files, startTime, onRebuildComplete);
|
|
36243
|
+
markHandledFiles(files, fastPath.framework, state2.resolvedPaths, handled);
|
|
36190
36244
|
});
|
|
36191
36245
|
const configPath2 = resolvePath(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
36192
|
-
if (affectedFrameworks.includes("angular") && files.includes(configPath2) && !
|
|
36246
|
+
if (affectedFrameworks.includes("angular") && files.includes(configPath2) && !state2.lastUserEditedFiles?.has(configPath2)) {
|
|
36193
36247
|
handled.add(configPath2);
|
|
36194
36248
|
}
|
|
36195
36249
|
return files.every((f2) => handled.has(f2));
|
|
36196
|
-
}, performFullRebuild = async (
|
|
36197
|
-
|
|
36198
|
-
const hasManifest = Object.keys(
|
|
36250
|
+
}, performFullRebuild = async (state2, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete, options) => {
|
|
36251
|
+
state2.svelteSurgicallyHandled = undefined;
|
|
36252
|
+
const hasManifest = Object.keys(state2.manifest).length > 0;
|
|
36199
36253
|
const files = filesToRebuild ?? [];
|
|
36200
36254
|
const onDemandPage = options?.onDemandPage;
|
|
36201
36255
|
let allHandled = !onDemandPage && files.length > 0 && hasManifest;
|
|
36202
36256
|
const hasIslandSourceChanges = files.length > 0 ? await didStaticPagesNeedIslandRefresh(config, files) : false;
|
|
36203
36257
|
if (allHandled && !hasIslandSourceChanges) {
|
|
36204
|
-
allHandled = await runFrameworkFastPaths(
|
|
36258
|
+
allHandled = await runFrameworkFastPaths(state2, config, affectedFrameworks, files, startTime, onRebuildComplete);
|
|
36205
36259
|
}
|
|
36206
36260
|
if (allHandled && config.htmlDirectory && affectedFrameworks.includes("html")) {
|
|
36207
|
-
await runHtmlFastPath(
|
|
36261
|
+
await runHtmlFastPath(state2, config, filesToRebuild, startTime);
|
|
36208
36262
|
}
|
|
36209
36263
|
if (allHandled && config.htmxDirectory && affectedFrameworks.includes("htmx")) {
|
|
36210
|
-
await runHtmxFastPath(
|
|
36264
|
+
await runHtmxFastPath(state2, config, filesToRebuild, startTime);
|
|
36211
36265
|
}
|
|
36212
36266
|
if (allHandled) {
|
|
36213
|
-
await recompileTailwindForFastPath(
|
|
36267
|
+
await recompileTailwindForFastPath(state2, config, files);
|
|
36214
36268
|
onRebuildComplete({
|
|
36215
|
-
hmrState:
|
|
36216
|
-
manifest:
|
|
36269
|
+
hmrState: state2,
|
|
36270
|
+
manifest: state2.manifest
|
|
36217
36271
|
});
|
|
36218
|
-
return
|
|
36272
|
+
return state2.manifest;
|
|
36219
36273
|
}
|
|
36220
36274
|
const buildConfig = {
|
|
36221
36275
|
...config,
|
|
36222
36276
|
incrementalFiles: filesToRebuild && filesToRebuild.length > 0 ? filesToRebuild : undefined,
|
|
36223
36277
|
options: {
|
|
36224
36278
|
...config.options,
|
|
36225
|
-
baseManifest:
|
|
36279
|
+
baseManifest: state2.manifest,
|
|
36226
36280
|
injectHMR: true,
|
|
36227
36281
|
throwOnError: true
|
|
36228
36282
|
}
|
|
@@ -36232,20 +36286,20 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36232
36286
|
throw new Error("Build failed - no manifest generated");
|
|
36233
36287
|
}
|
|
36234
36288
|
const { manifest } = buildResult;
|
|
36235
|
-
if (
|
|
36236
|
-
updateLazyPageRegistry(
|
|
36289
|
+
if (state2.lazyPages && buildResult.pageEntries) {
|
|
36290
|
+
updateLazyPageRegistry(state2.lazyPages.registry, buildResult.pageEntries);
|
|
36237
36291
|
}
|
|
36238
36292
|
const duration = Date.now() - startTime;
|
|
36239
36293
|
const partialErrors = buildResult.errors ?? [];
|
|
36240
36294
|
if (partialErrors.length > 0) {
|
|
36241
|
-
|
|
36242
|
-
await populateAssetStore(
|
|
36243
|
-
cleanStaleAssets(
|
|
36295
|
+
state2.lastBuildErrors = partialErrors;
|
|
36296
|
+
await populateAssetStore(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
36297
|
+
cleanStaleAssets(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
36244
36298
|
const [first] = partialErrors;
|
|
36245
|
-
if (onDemandPage &&
|
|
36246
|
-
|
|
36299
|
+
if (onDemandPage && state2.lazyPages) {
|
|
36300
|
+
state2.lazyPages.lastError = first?.message ?? "Build failed";
|
|
36247
36301
|
}
|
|
36248
|
-
broadcastToClients(
|
|
36302
|
+
broadcastToClients(state2, {
|
|
36249
36303
|
data: {
|
|
36250
36304
|
affectedFrameworks,
|
|
36251
36305
|
column: first?.column,
|
|
@@ -36264,18 +36318,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36264
36318
|
message: "Rebuild completed with unresolved references",
|
|
36265
36319
|
type: "rebuild-error"
|
|
36266
36320
|
});
|
|
36267
|
-
onRebuildComplete({ hmrState:
|
|
36321
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
36268
36322
|
return manifest;
|
|
36269
36323
|
}
|
|
36270
|
-
|
|
36324
|
+
state2.lastBuildErrors = undefined;
|
|
36271
36325
|
sendTelemetryEvent("hmr:rebuild-complete", {
|
|
36272
36326
|
durationMs: duration,
|
|
36273
36327
|
fileCount: filesToRebuild?.length ?? 0,
|
|
36274
36328
|
framework: affectedFrameworks[0] ?? "unknown"
|
|
36275
36329
|
});
|
|
36276
|
-
await populateAssetStore(
|
|
36277
|
-
cleanStaleAssets(
|
|
36278
|
-
broadcastToClients(
|
|
36330
|
+
await populateAssetStore(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
36331
|
+
cleanStaleAssets(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
36332
|
+
broadcastToClients(state2, {
|
|
36279
36333
|
data: {
|
|
36280
36334
|
affectedFrameworks,
|
|
36281
36335
|
manifest
|
|
@@ -36286,12 +36340,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36286
36340
|
const hasDedicatedStyleUpdate = affectedFrameworks.some((framework) => framework === "styles" || framework === "assets");
|
|
36287
36341
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate) && !hasDedicatedStyleUpdate) {
|
|
36288
36342
|
try {
|
|
36289
|
-
const outputPath = resolvePath(
|
|
36343
|
+
const outputPath = resolvePath(state2.resolvedPaths.buildDir, config.tailwind.output);
|
|
36290
36344
|
const bytes = await Bun.file(outputPath).bytes();
|
|
36291
36345
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
36292
|
-
|
|
36346
|
+
state2.assetStore.set(webPath, bytes);
|
|
36293
36347
|
} catch {}
|
|
36294
|
-
broadcastToClients(
|
|
36348
|
+
broadcastToClients(state2, {
|
|
36295
36349
|
data: {
|
|
36296
36350
|
cause: filesToRebuild?.filter(isTailwindCandidate) ?? [],
|
|
36297
36351
|
framework: "tailwind",
|
|
@@ -36304,35 +36358,35 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36304
36358
|
}
|
|
36305
36359
|
if (onDemandPage) {
|
|
36306
36360
|
clearDevSsrCssCaches();
|
|
36307
|
-
onRebuildComplete({ hmrState:
|
|
36361
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
36308
36362
|
return manifest;
|
|
36309
36363
|
}
|
|
36310
36364
|
const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
|
|
36311
|
-
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(
|
|
36365
|
+
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state2, config, filesToRebuild, manifest, duration) : false;
|
|
36312
36366
|
if (didReloadForIslandChange) {
|
|
36313
|
-
await runFrameworkFastPaths(
|
|
36314
|
-
onRebuildComplete({ hmrState:
|
|
36367
|
+
await runFrameworkFastPaths(state2, config, affectedFrameworks, filesToRebuild ?? [], startTime, onRebuildComplete);
|
|
36368
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
36315
36369
|
return manifest;
|
|
36316
36370
|
}
|
|
36317
36371
|
if (hasFilesToRebuild) {
|
|
36318
|
-
await handleFullBuildHMR(
|
|
36372
|
+
await handleFullBuildHMR(state2, config, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
36319
36373
|
}
|
|
36320
|
-
broadcastFrameworkUpdates(
|
|
36374
|
+
broadcastFrameworkUpdates(state2, affectedFrameworks, filesToRebuild, manifest, startTime);
|
|
36321
36375
|
clearDevSsrCssCaches();
|
|
36322
|
-
onRebuildComplete({ hmrState:
|
|
36376
|
+
onRebuildComplete({ hmrState: state2, manifest });
|
|
36323
36377
|
return manifest;
|
|
36324
|
-
}, drainPendingQueue = (
|
|
36325
|
-
if (
|
|
36378
|
+
}, drainPendingQueue = (state2, config, onRebuildComplete) => {
|
|
36379
|
+
if (state2.fileChangeQueue.size === 0) {
|
|
36326
36380
|
return;
|
|
36327
36381
|
}
|
|
36328
|
-
if (
|
|
36329
|
-
clearTimeout(
|
|
36330
|
-
|
|
36331
|
-
|
|
36332
|
-
drainQueueAndRebuild(
|
|
36382
|
+
if (state2.rebuildTimeout)
|
|
36383
|
+
clearTimeout(state2.rebuildTimeout);
|
|
36384
|
+
state2.rebuildTimeout = setTimeout(() => {
|
|
36385
|
+
state2.rebuildTimeout = null;
|
|
36386
|
+
drainQueueAndRebuild(state2, config, onRebuildComplete);
|
|
36333
36387
|
}, REBUILD_BATCH_DELAY_MS);
|
|
36334
|
-
}, STYLE_FILE_EXT_RE, hasAngularOwnedStyleEdit = async (
|
|
36335
|
-
const edited =
|
|
36388
|
+
}, STYLE_FILE_EXT_RE, hasAngularOwnedStyleEdit = async (state2, angularDir) => {
|
|
36389
|
+
const edited = state2.lastUserEditedFiles;
|
|
36336
36390
|
if (!edited || edited.size === 0)
|
|
36337
36391
|
return false;
|
|
36338
36392
|
const styleEdits = [];
|
|
@@ -36352,29 +36406,29 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36352
36406
|
return true;
|
|
36353
36407
|
}
|
|
36354
36408
|
return false;
|
|
36355
|
-
}, triggerRebuild = async (
|
|
36356
|
-
if (
|
|
36409
|
+
}, triggerRebuild = async (state2, config, onRebuildComplete, filesToRebuild, options) => {
|
|
36410
|
+
if (state2.isRebuilding) {
|
|
36357
36411
|
return null;
|
|
36358
36412
|
}
|
|
36359
|
-
|
|
36413
|
+
state2.isRebuilding = true;
|
|
36360
36414
|
const onDemandPage = options?.onDemandPage;
|
|
36361
|
-
const affectedFrameworks = onDemandPage ? [onDemandPage.framework] : Array.from(
|
|
36415
|
+
const affectedFrameworks = onDemandPage ? [onDemandPage.framework] : Array.from(state2.rebuildQueue);
|
|
36362
36416
|
if (!onDemandPage)
|
|
36363
|
-
|
|
36364
|
-
if (!onDemandPage && config.angularDirectory !== undefined && !affectedFrameworks.includes("angular") && await hasAngularOwnedStyleEdit(
|
|
36417
|
+
state2.rebuildQueue.clear();
|
|
36418
|
+
if (!onDemandPage && config.angularDirectory !== undefined && !affectedFrameworks.includes("angular") && await hasAngularOwnedStyleEdit(state2, config.angularDirectory)) {
|
|
36365
36419
|
affectedFrameworks.push("angular");
|
|
36366
36420
|
}
|
|
36367
36421
|
const startTime = Date.now();
|
|
36368
|
-
broadcastToClients(
|
|
36422
|
+
broadcastToClients(state2, {
|
|
36369
36423
|
data: { affectedFrameworks },
|
|
36370
36424
|
message: "Rebuild started...",
|
|
36371
36425
|
type: "rebuild-start"
|
|
36372
36426
|
});
|
|
36373
36427
|
try {
|
|
36374
|
-
return await performFullRebuild(
|
|
36428
|
+
return await performFullRebuild(state2, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete, options);
|
|
36375
36429
|
} catch (error) {
|
|
36376
|
-
if (onDemandPage &&
|
|
36377
|
-
|
|
36430
|
+
if (onDemandPage && state2.lazyPages) {
|
|
36431
|
+
state2.lazyPages.lastError = error instanceof Error ? error.message : String(error);
|
|
36378
36432
|
}
|
|
36379
36433
|
sendTelemetryEvent("hmr:rebuild-error", {
|
|
36380
36434
|
durationMs: Date.now() - startTime,
|
|
@@ -36383,8 +36437,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36383
36437
|
frameworks: affectedFrameworks,
|
|
36384
36438
|
message: error instanceof Error ? error.message : String(error)
|
|
36385
36439
|
});
|
|
36386
|
-
const errorData = extractBuildErrorDetails(error, affectedFrameworks,
|
|
36387
|
-
broadcastToClients(
|
|
36440
|
+
const errorData = extractBuildErrorDetails(error, affectedFrameworks, state2.resolvedPaths);
|
|
36441
|
+
broadcastToClients(state2, {
|
|
36388
36442
|
data: {
|
|
36389
36443
|
affectedFrameworks,
|
|
36390
36444
|
error: error instanceof Error ? error.message : String(error),
|
|
@@ -36395,8 +36449,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36395
36449
|
});
|
|
36396
36450
|
return null;
|
|
36397
36451
|
} finally {
|
|
36398
|
-
|
|
36399
|
-
drainPendingQueue(
|
|
36452
|
+
state2.isRebuilding = false;
|
|
36453
|
+
drainPendingQueue(state2, config, onRebuildComplete);
|
|
36400
36454
|
}
|
|
36401
36455
|
}, isAbsoluteConfig = (filePath) => filePath === resolvePath(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts"), applyBackendEdit = async (filePath) => {
|
|
36402
36456
|
if (globalThis.__absoluteBackendHmr !== true)
|
|
@@ -36924,7 +36978,7 @@ __export(exports_devBuild, {
|
|
|
36924
36978
|
devBuild: () => devBuild
|
|
36925
36979
|
});
|
|
36926
36980
|
import { readdir as readdir5 } from "fs/promises";
|
|
36927
|
-
import { existsSync as existsSync46, statSync as
|
|
36981
|
+
import { existsSync as existsSync46, statSync as statSync12 } from "fs";
|
|
36928
36982
|
import { resolve as resolve55 } from "path";
|
|
36929
36983
|
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.dir, "../dev/client"), collectDepVendorSourceDirs = (config) => {
|
|
36930
36984
|
const configuredDirs = [
|
|
@@ -36959,8 +37013,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
36959
37013
|
const newConfig = await reloadConfig();
|
|
36960
37014
|
if (!newConfig)
|
|
36961
37015
|
return { added: [], removed: [] };
|
|
36962
|
-
const
|
|
36963
|
-
const oldConfig =
|
|
37016
|
+
const state2 = cached.hmrState;
|
|
37017
|
+
const oldConfig = state2.config;
|
|
36964
37018
|
const added = [];
|
|
36965
37019
|
const removed = [];
|
|
36966
37020
|
for (const key of FRAMEWORK_DIR_KEYS) {
|
|
@@ -36980,11 +37034,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
36980
37034
|
if (added.length === 0 && removed.length === 0) {
|
|
36981
37035
|
return { added: [], removed: [] };
|
|
36982
37036
|
}
|
|
36983
|
-
const oldWatchPaths = new Set(getWatchPaths(oldConfig,
|
|
37037
|
+
const oldWatchPaths = new Set(getWatchPaths(oldConfig, state2.resolvedPaths));
|
|
36984
37038
|
for (const key of FRAMEWORK_DIR_KEYS) {
|
|
36985
|
-
|
|
37039
|
+
state2.config[key] = newConfig[key];
|
|
36986
37040
|
}
|
|
36987
|
-
|
|
37041
|
+
state2.resolvedPaths = resolveBuildPaths(state2.config);
|
|
36988
37042
|
if (!oldConfig.reactDirectory && Boolean(newConfig.reactDirectory)) {
|
|
36989
37043
|
setDevVendorPaths(computeVendorPaths());
|
|
36990
37044
|
}
|
|
@@ -37000,14 +37054,14 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37000
37054
|
if (!oldConfig.emberDirectory && Boolean(newConfig.emberDirectory)) {
|
|
37001
37055
|
setEmberVendorPaths(computeEmberVendorPaths());
|
|
37002
37056
|
}
|
|
37003
|
-
const newWatchPaths = getWatchPaths(
|
|
37057
|
+
const newWatchPaths = getWatchPaths(state2.config, state2.resolvedPaths);
|
|
37004
37058
|
const addedPaths = newWatchPaths.filter((path2) => !oldWatchPaths.has(path2));
|
|
37005
37059
|
if (addedPaths.length > 0) {
|
|
37006
|
-
buildInitialDependencyGraph(
|
|
37007
|
-
addFileWatchers(
|
|
37008
|
-
queueFileChange(
|
|
37060
|
+
buildInitialDependencyGraph(state2.dependencyGraph, addedPaths);
|
|
37061
|
+
addFileWatchers(state2, addedPaths, (filePath) => {
|
|
37062
|
+
queueFileChange(state2, filePath, state2.config, (newBuildResult) => {
|
|
37009
37063
|
Object.assign(cached.manifest, newBuildResult.manifest);
|
|
37010
|
-
|
|
37064
|
+
state2.manifest = cached.manifest;
|
|
37011
37065
|
});
|
|
37012
37066
|
});
|
|
37013
37067
|
}
|
|
@@ -37022,23 +37076,23 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37022
37076
|
if (!(key in source))
|
|
37023
37077
|
delete target[key];
|
|
37024
37078
|
}
|
|
37025
|
-
}, REBUILD_POLL_MS = 10, waitForRebuild = async (
|
|
37026
|
-
if (!
|
|
37079
|
+
}, REBUILD_POLL_MS = 10, waitForRebuild = async (state2) => {
|
|
37080
|
+
if (!state2.isRebuilding) {
|
|
37027
37081
|
return;
|
|
37028
37082
|
}
|
|
37029
37083
|
await Bun.sleep(REBUILD_POLL_MS);
|
|
37030
|
-
await waitForRebuild(
|
|
37084
|
+
await waitForRebuild(state2);
|
|
37031
37085
|
}, rebuildManifest = async (cached) => {
|
|
37032
|
-
const
|
|
37033
|
-
await waitForRebuild(
|
|
37034
|
-
|
|
37035
|
-
|
|
37086
|
+
const state2 = cached.hmrState;
|
|
37087
|
+
await waitForRebuild(state2);
|
|
37088
|
+
state2.isRebuilding = true;
|
|
37089
|
+
state2.fileChangeQueue.clear();
|
|
37036
37090
|
try {
|
|
37037
37091
|
const buildResult = await build2({
|
|
37038
|
-
...
|
|
37092
|
+
...state2.config,
|
|
37039
37093
|
mode: "development",
|
|
37040
37094
|
options: {
|
|
37041
|
-
...
|
|
37095
|
+
...state2.config.options,
|
|
37042
37096
|
injectHMR: true,
|
|
37043
37097
|
throwOnError: true
|
|
37044
37098
|
}
|
|
@@ -37046,25 +37100,25 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37046
37100
|
if (!buildResult?.manifest)
|
|
37047
37101
|
return;
|
|
37048
37102
|
const newManifest = buildResult.manifest;
|
|
37049
|
-
if (
|
|
37050
|
-
updateLazyPageRegistry(
|
|
37103
|
+
if (state2.lazyPages && buildResult.pageEntries) {
|
|
37104
|
+
updateLazyPageRegistry(state2.lazyPages.registry, buildResult.pageEntries);
|
|
37051
37105
|
}
|
|
37052
|
-
|
|
37106
|
+
state2.lastBuildErrors = buildResult.errors && buildResult.errors.length > 0 ? buildResult.errors : undefined;
|
|
37053
37107
|
removeStaleKeys(cached.manifest, newManifest);
|
|
37054
37108
|
Object.assign(cached.manifest, newManifest);
|
|
37055
|
-
|
|
37056
|
-
await populateAssetStore(
|
|
37057
|
-
await cleanStaleAssets(
|
|
37109
|
+
state2.manifest = cached.manifest;
|
|
37110
|
+
await populateAssetStore(state2.assetStore, cached.manifest, state2.resolvedPaths.buildDir);
|
|
37111
|
+
await cleanStaleAssets(state2.assetStore, cached.manifest, state2.resolvedPaths.buildDir);
|
|
37058
37112
|
} catch {} finally {
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
drainPendingQueue(
|
|
37113
|
+
state2.rebuildCount++;
|
|
37114
|
+
state2.isRebuilding = false;
|
|
37115
|
+
drainPendingQueue(state2, state2.config, (newBuildResult) => {
|
|
37062
37116
|
Object.assign(cached.manifest, newBuildResult.manifest);
|
|
37063
|
-
|
|
37117
|
+
state2.manifest = cached.manifest;
|
|
37064
37118
|
});
|
|
37065
37119
|
}
|
|
37066
37120
|
}, handleCachedReload = async () => {
|
|
37067
|
-
const serverMtime =
|
|
37121
|
+
const serverMtime = statSync12(resolve55(Bun.main)).mtimeMs;
|
|
37068
37122
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
37069
37123
|
globalThis.__hmrServerMtime = serverMtime;
|
|
37070
37124
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -37161,8 +37215,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37161
37215
|
};
|
|
37162
37216
|
}
|
|
37163
37217
|
let stepStartedAt = performance.now();
|
|
37164
|
-
const
|
|
37165
|
-
process.env.ABSOLUTE_BUILD_DIR ??=
|
|
37218
|
+
const state2 = createHMRState(config);
|
|
37219
|
+
process.env.ABSOLUTE_BUILD_DIR ??= state2.resolvedPaths.buildDir;
|
|
37166
37220
|
recordStep("create HMR state", stepStartedAt);
|
|
37167
37221
|
setBootPhase("scan source tree");
|
|
37168
37222
|
const prescanPromise = readDevPrescan();
|
|
@@ -37191,11 +37245,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37191
37245
|
const prescan = await prescanPromise;
|
|
37192
37246
|
recordStep("adopt CLI pre-scan", stepStartedAt);
|
|
37193
37247
|
stepStartedAt = performance.now();
|
|
37194
|
-
const watchPaths = getWatchPaths(config,
|
|
37248
|
+
const watchPaths = getWatchPaths(config, state2.resolvedPaths);
|
|
37195
37249
|
if (prescan?.dependencies) {
|
|
37196
|
-
adoptDependencyGraph(
|
|
37250
|
+
adoptDependencyGraph(state2.dependencyGraph, prescan.dependencies);
|
|
37197
37251
|
} else {
|
|
37198
|
-
buildInitialDependencyGraph(
|
|
37252
|
+
buildInitialDependencyGraph(state2.dependencyGraph, watchPaths);
|
|
37199
37253
|
}
|
|
37200
37254
|
recordStep("initialize dependency graph", stepStartedAt);
|
|
37201
37255
|
stepStartedAt = performance.now();
|
|
@@ -37215,19 +37269,19 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37215
37269
|
stepStartedAt = performance.now();
|
|
37216
37270
|
const onWatcherRebuildComplete = (newBuildResult) => {
|
|
37217
37271
|
Object.assign(manifest, newBuildResult.manifest);
|
|
37218
|
-
|
|
37272
|
+
state2.manifest = manifest;
|
|
37219
37273
|
};
|
|
37220
37274
|
const settleRecoveryQueue = () => {
|
|
37221
|
-
if (
|
|
37222
|
-
|
|
37275
|
+
if (state2.initialBuildFailed) {
|
|
37276
|
+
state2.fileChangeQueue.clear();
|
|
37223
37277
|
return;
|
|
37224
37278
|
}
|
|
37225
|
-
drainPendingQueue(
|
|
37279
|
+
drainPendingQueue(state2, config, onWatcherRebuildComplete);
|
|
37226
37280
|
};
|
|
37227
37281
|
const recoverFromColdStartFailure = async () => {
|
|
37228
|
-
await waitForRebuild(
|
|
37229
|
-
|
|
37230
|
-
|
|
37282
|
+
await waitForRebuild(state2);
|
|
37283
|
+
state2.isRebuilding = true;
|
|
37284
|
+
state2.fileChangeQueue.clear();
|
|
37231
37285
|
try {
|
|
37232
37286
|
const recoveryResult = await build2({
|
|
37233
37287
|
...config,
|
|
@@ -37240,27 +37294,27 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37240
37294
|
});
|
|
37241
37295
|
if (recoveryResult?.manifest) {
|
|
37242
37296
|
Object.assign(manifest, recoveryResult.manifest);
|
|
37243
|
-
|
|
37244
|
-
if (
|
|
37245
|
-
updateLazyPageRegistry(
|
|
37297
|
+
state2.manifest = manifest;
|
|
37298
|
+
if (state2.lazyPages && recoveryResult.pageEntries) {
|
|
37299
|
+
updateLazyPageRegistry(state2.lazyPages.registry, recoveryResult.pageEntries);
|
|
37246
37300
|
}
|
|
37247
|
-
await populateAssetStore(
|
|
37248
|
-
|
|
37301
|
+
await populateAssetStore(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
37302
|
+
state2.initialBuildFailed = false;
|
|
37249
37303
|
console.log("[hmr] cold-start recovery rebuild succeeded \u2014 manifest populated.");
|
|
37250
37304
|
}
|
|
37251
37305
|
} catch {} finally {
|
|
37252
|
-
|
|
37253
|
-
|
|
37306
|
+
state2.rebuildCount++;
|
|
37307
|
+
state2.isRebuilding = false;
|
|
37254
37308
|
settleRecoveryQueue();
|
|
37255
37309
|
}
|
|
37256
37310
|
};
|
|
37257
|
-
|
|
37258
|
-
startFileWatching(
|
|
37259
|
-
if (
|
|
37311
|
+
state2.isRebuilding = true;
|
|
37312
|
+
startFileWatching(state2, config, (filePath) => {
|
|
37313
|
+
if (state2.initialBuildFailed) {
|
|
37260
37314
|
recoverFromColdStartFailure();
|
|
37261
37315
|
return;
|
|
37262
37316
|
}
|
|
37263
|
-
queueFileChange(
|
|
37317
|
+
queueFileChange(state2, filePath, config, onWatcherRebuildComplete);
|
|
37264
37318
|
});
|
|
37265
37319
|
console.log("[hmr] watching for file changes \u2014 edits saved during the boot build are queued.");
|
|
37266
37320
|
recordStep("start file watching", stepStartedAt);
|
|
@@ -37283,12 +37337,12 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37283
37337
|
if (err instanceof Error && err.stack) {
|
|
37284
37338
|
console.error(err.stack);
|
|
37285
37339
|
}
|
|
37286
|
-
|
|
37340
|
+
state2.initialBuildFailed = true;
|
|
37287
37341
|
}
|
|
37288
37342
|
Object.assign(manifest, buildResult?.manifest ?? {});
|
|
37289
37343
|
const conventions2 = buildResult?.conventions ?? {};
|
|
37290
37344
|
if (buildResult?.errors && buildResult.errors.length > 0) {
|
|
37291
|
-
|
|
37345
|
+
state2.lastBuildErrors = buildResult.errors;
|
|
37292
37346
|
console.error(`[hmr] initial build completed with ${buildResult.errors.length} unresolved ` + `reference(s) \u2014 affected routes are degraded, the rest are serving. ` + `Fix and save to recover:`);
|
|
37293
37347
|
for (const passError of buildResult.errors) {
|
|
37294
37348
|
console.error(` \u2022 ${passError.label}: ${passError.message}`);
|
|
@@ -37300,13 +37354,13 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37300
37354
|
}
|
|
37301
37355
|
stepStartedAt = performance.now();
|
|
37302
37356
|
setBootPhase("populate asset store");
|
|
37303
|
-
await populateAssetStore(
|
|
37304
|
-
cleanStaleAssets(
|
|
37357
|
+
await populateAssetStore(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
37358
|
+
cleanStaleAssets(state2.assetStore, manifest, state2.resolvedPaths.buildDir);
|
|
37305
37359
|
recordStep("populate asset store", stepStartedAt);
|
|
37306
37360
|
if (lazyPages) {
|
|
37307
37361
|
const pageEntries = buildResult?.pageEntries ?? [];
|
|
37308
37362
|
const { createDevPageWarmer: createDevPageWarmer2, runOnDemandPageBuild: runOnDemandPageBuild2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
37309
|
-
|
|
37363
|
+
state2.lazyPages = {
|
|
37310
37364
|
buildCount: 0,
|
|
37311
37365
|
builder: createOnDemandPageBuilder(runOnDemandPageBuild2),
|
|
37312
37366
|
onRebuildComplete: onWatcherRebuildComplete,
|
|
@@ -37318,11 +37372,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37318
37372
|
}
|
|
37319
37373
|
stepStartedAt = performance.now();
|
|
37320
37374
|
setBootPhase("build vendor bundles");
|
|
37321
|
-
const reactVendorDir = resolve55(
|
|
37322
|
-
const angularVendorDir = resolve55(
|
|
37323
|
-
const svelteVendorDir = resolve55(
|
|
37324
|
-
const vueVendorDir = resolve55(
|
|
37325
|
-
const depVendorDir = resolve55(
|
|
37375
|
+
const reactVendorDir = resolve55(state2.resolvedPaths.buildDir, "react", "vendor");
|
|
37376
|
+
const angularVendorDir = resolve55(state2.resolvedPaths.buildDir, "angular", "vendor");
|
|
37377
|
+
const svelteVendorDir = resolve55(state2.resolvedPaths.buildDir, "svelte", "vendor");
|
|
37378
|
+
const vueVendorDir = resolve55(state2.resolvedPaths.buildDir, "vue", "vendor");
|
|
37379
|
+
const depVendorDir = resolve55(state2.resolvedPaths.buildDir, "vendor");
|
|
37326
37380
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
37327
37381
|
const activeVendorDirs = [
|
|
37328
37382
|
config.reactDirectory ? reactVendorDir : null,
|
|
@@ -37364,13 +37418,13 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37364
37418
|
}
|
|
37365
37419
|
}
|
|
37366
37420
|
const buildAllVendors = () => Promise.all([
|
|
37367
|
-
config.reactDirectory ? buildReactVendor(
|
|
37368
|
-
config.angularDirectory ? buildAngularVendor(
|
|
37421
|
+
config.reactDirectory ? buildReactVendor(state2.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
37422
|
+
config.angularDirectory ? buildAngularVendor(state2.resolvedPaths.buildDir, sourceDirs, true, Object.keys(globalThis.__depVendorPaths ?? {})) : Promise.resolve(undefined),
|
|
37369
37423
|
Promise.resolve(undefined),
|
|
37370
|
-
config.svelteDirectory ? buildSvelteVendor(
|
|
37371
|
-
config.vueDirectory ? buildVueVendor(
|
|
37372
|
-
config.emberDirectory ? buildEmberVendor(
|
|
37373
|
-
buildDepVendor2(
|
|
37424
|
+
config.svelteDirectory ? buildSvelteVendor(state2.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
37425
|
+
config.vueDirectory ? buildVueVendor(state2.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
37426
|
+
config.emberDirectory ? buildEmberVendor(state2.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
37427
|
+
buildDepVendor2(state2.resolvedPaths.buildDir, sourceDirs, sourceFiles)
|
|
37374
37428
|
]);
|
|
37375
37429
|
const builtVendors = restoredVendor ? [] : await buildAllVendors();
|
|
37376
37430
|
const [, angularSpecs, , , , , builtDepPaths] = builtVendors;
|
|
@@ -37404,11 +37458,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37404
37458
|
}
|
|
37405
37459
|
stepStartedAt = performance.now();
|
|
37406
37460
|
await Promise.all([
|
|
37407
|
-
config.reactDirectory ? loadVendorFiles(
|
|
37408
|
-
config.angularDirectory ? loadVendorFiles(
|
|
37409
|
-
config.svelteDirectory ? loadVendorFiles(
|
|
37410
|
-
config.vueDirectory ? loadVendorFiles(
|
|
37411
|
-
loadVendorFiles(
|
|
37461
|
+
config.reactDirectory ? loadVendorFiles(state2.assetStore, reactVendorDir, "react") : Promise.resolve(),
|
|
37462
|
+
config.angularDirectory ? loadVendorFiles(state2.assetStore, angularVendorDir, "angular") : Promise.resolve(),
|
|
37463
|
+
config.svelteDirectory ? loadVendorFiles(state2.assetStore, svelteVendorDir, "svelte") : Promise.resolve(),
|
|
37464
|
+
config.vueDirectory ? loadVendorFiles(state2.assetStore, vueVendorDir, "vue") : Promise.resolve(),
|
|
37465
|
+
loadVendorFiles(state2.assetStore, depVendorDir, "vendor")
|
|
37412
37466
|
]);
|
|
37413
37467
|
recordStep("load vendor files", stepStartedAt);
|
|
37414
37468
|
stepStartedAt = performance.now();
|
|
@@ -37428,24 +37482,24 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve55(import.meta.d
|
|
|
37428
37482
|
await warmTailwindCompiler2(config.tailwind, computeFrameworkTailwindSources2(config));
|
|
37429
37483
|
recordStep("warm tailwind compiler", stepStartedAt);
|
|
37430
37484
|
}
|
|
37431
|
-
|
|
37432
|
-
|
|
37433
|
-
if (
|
|
37434
|
-
|
|
37485
|
+
state2.manifest = manifest;
|
|
37486
|
+
state2.isRebuilding = false;
|
|
37487
|
+
if (state2.fileChangeQueue.size > 0 && state2.initialBuildFailed) {
|
|
37488
|
+
state2.fileChangeQueue.clear();
|
|
37435
37489
|
recoverFromColdStartFailure();
|
|
37436
|
-
} else if (
|
|
37490
|
+
} else if (state2.fileChangeQueue.size > 0) {
|
|
37437
37491
|
console.log("[hmr] edits landed during the boot build \u2014 rebuilding to pick them up.");
|
|
37438
|
-
drainPendingQueue(
|
|
37492
|
+
drainPendingQueue(state2, config, onWatcherRebuildComplete);
|
|
37439
37493
|
}
|
|
37440
37494
|
globalThis.__hmrBuildDuration = performance.now() - buildStart;
|
|
37441
37495
|
logStartupTimingBlock("AbsoluteJS devBuild timing", startupSteps);
|
|
37442
37496
|
const result = {
|
|
37443
37497
|
conventions: conventions2,
|
|
37444
|
-
hmrState:
|
|
37498
|
+
hmrState: state2,
|
|
37445
37499
|
manifest
|
|
37446
37500
|
};
|
|
37447
37501
|
globalThis.__hmrDevResult = result;
|
|
37448
|
-
globalThis.__hmrServerMtime =
|
|
37502
|
+
globalThis.__hmrServerMtime = statSync12(resolve55(Bun.main)).mtimeMs;
|
|
37449
37503
|
return result;
|
|
37450
37504
|
};
|
|
37451
37505
|
var init_devBuild = __esm(() => {
|
|
@@ -38949,7 +39003,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
38949
39003
|
dir: prerenderDir,
|
|
38950
39004
|
routes: new Map
|
|
38951
39005
|
};
|
|
38952
|
-
await routes.reduce((
|
|
39006
|
+
await routes.reduce((chain, route) => chain.then(() => prerenderRoute(baseUrl, route, prerenderDir, result, log2)), Promise.resolve());
|
|
38953
39007
|
return result;
|
|
38954
39008
|
}, getStartupTimeoutMs = () => {
|
|
38955
39009
|
const rawTimeout = Bun.env.ABSOLUTE_PRERENDER_STARTUP_TIMEOUT_MS;
|
|
@@ -39055,7 +39109,7 @@ __export(exports_prepare, {
|
|
|
39055
39109
|
});
|
|
39056
39110
|
import { createHash as createHash12 } from "crypto";
|
|
39057
39111
|
import { existsSync as existsSync49, readdirSync as readdirSync14, readFileSync as readFileSync45 } from "fs";
|
|
39058
|
-
import { basename as basename22, join as join65, relative as
|
|
39112
|
+
import { basename as basename22, join as join65, relative as relative27, resolve as resolvePath4 } from "path";
|
|
39059
39113
|
import { Elysia as Elysia11, NotFound } from "elysia";
|
|
39060
39114
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve58) => {
|
|
39061
39115
|
setTimeout(resolve58, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -39144,7 +39198,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
39144
39198
|
return files;
|
|
39145
39199
|
}, PREWARM_MAX_PAUSE_MS = 60000, toWarmTasks = function* (files, warmCache2, srcUrlPrefix) {
|
|
39146
39200
|
for (const file6 of files) {
|
|
39147
|
-
const rel =
|
|
39201
|
+
const rel = relative27(process.cwd(), file6).replace(/\\/g, "/");
|
|
39148
39202
|
yield () => warmCache2(`${srcUrlPrefix}${rel}`);
|
|
39149
39203
|
}
|
|
39150
39204
|
}, builtPageSources = () => {
|
|
@@ -39185,7 +39239,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
39185
39239
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
39186
39240
|
if (!existsSync49(srcPath))
|
|
39187
39241
|
continue;
|
|
39188
|
-
const rel =
|
|
39242
|
+
const rel = relative27(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
39189
39243
|
manifest[key] = `${SRC_URL_PREFIX3}${rel}`;
|
|
39190
39244
|
}
|
|
39191
39245
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
@@ -39436,7 +39490,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
39436
39490
|
name: "absolutejs-generated-assets"
|
|
39437
39491
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
39438
39492
|
const requestedPath = resolvePath4(generatedAssetsRoot, params["*"]);
|
|
39439
|
-
if (
|
|
39493
|
+
if (relative27(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
39440
39494
|
set.status = 404;
|
|
39441
39495
|
return "Not Found";
|
|
39442
39496
|
}
|
|
@@ -39589,7 +39643,7 @@ import {
|
|
|
39589
39643
|
existsSync as existsSync51,
|
|
39590
39644
|
readdirSync as readdirSync16,
|
|
39591
39645
|
readFileSync as readFileSync48,
|
|
39592
|
-
statSync as
|
|
39646
|
+
statSync as statSync13,
|
|
39593
39647
|
watch as watch2
|
|
39594
39648
|
} from "fs";
|
|
39595
39649
|
import { createHash as createHash13 } from "crypto";
|
|
@@ -39667,9 +39721,15 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
39667
39721
|
acceptedEntryHash = nextHash;
|
|
39668
39722
|
let evaluated = true;
|
|
39669
39723
|
try {
|
|
39670
|
-
|
|
39724
|
+
const reportsUpdate = !force && globalThis.__absoluteBackendHmr === true;
|
|
39725
|
+
const startedAt = performance.now();
|
|
39726
|
+
if (!force && !reportsUpdate)
|
|
39671
39727
|
console.log(`[hmr] reloading server entry (${cause})`);
|
|
39672
39728
|
await importFreshEntry();
|
|
39729
|
+
if (reportsUpdate) {
|
|
39730
|
+
const { reportEntryUpdate: reportEntryUpdate2 } = await Promise.resolve().then(() => (init_reload(), exports_reload));
|
|
39731
|
+
reportEntryUpdate2(entryPath, performance.now() - startedAt);
|
|
39732
|
+
}
|
|
39673
39733
|
const hmrState2 = globalThis.__hmrDevResult?.hmrState;
|
|
39674
39734
|
if (hmrState2) {
|
|
39675
39735
|
const { broadcastToClients: broadcastToClients2 } = await Promise.resolve().then(() => (init_webSocket(), exports_webSocket));
|
|
@@ -39762,7 +39822,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
39762
39822
|
continue;
|
|
39763
39823
|
let st2;
|
|
39764
39824
|
try {
|
|
39765
|
-
st2 =
|
|
39825
|
+
st2 = statSync13(join68(dir, entry.name));
|
|
39766
39826
|
} catch {
|
|
39767
39827
|
continue;
|
|
39768
39828
|
}
|
|
@@ -40174,7 +40234,7 @@ import { websocket as websocket3 } from "elysia/websocket";
|
|
|
40174
40234
|
import { buildGlobalWSHandler } from "elysia/ws";
|
|
40175
40235
|
|
|
40176
40236
|
// src/dev/hot/appLifecycle.ts
|
|
40177
|
-
var cleanupsRegisteredDuringSetup = new WeakMap;
|
|
40237
|
+
var cleanupsRegisteredDuringSetup = globalThis.__absoluteHotSetupCleanups ??= new WeakMap;
|
|
40178
40238
|
var hooksOf = (app, kind) => {
|
|
40179
40239
|
const ext = Reflect.get(app, "~ext");
|
|
40180
40240
|
if (typeof ext !== "object" || ext === null)
|
|
@@ -40546,9 +40606,6 @@ var networking = (app) => {
|
|
|
40546
40606
|
}
|
|
40547
40607
|
const liveServer = globalThis.__absoluteBunServer;
|
|
40548
40608
|
if (liveServer && typeof liveServer.reload === "function") {
|
|
40549
|
-
try {
|
|
40550
|
-
app.compile();
|
|
40551
|
-
} catch {}
|
|
40552
40609
|
app.server = liveServer;
|
|
40553
40610
|
const reloadOptions = {
|
|
40554
40611
|
routes: {},
|
|
@@ -44896,21 +44953,21 @@ function Errors(...args2) {
|
|
|
44896
44953
|
}
|
|
44897
44954
|
|
|
44898
44955
|
// node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs
|
|
44899
|
-
var __classPrivateFieldSet = function(receiver,
|
|
44956
|
+
var __classPrivateFieldSet = function(receiver, state2, value, kind, f2) {
|
|
44900
44957
|
if (kind === "m")
|
|
44901
44958
|
throw new TypeError("Private method is not writable");
|
|
44902
44959
|
if (kind === "a" && !f2)
|
|
44903
44960
|
throw new TypeError("Private accessor was defined without a setter");
|
|
44904
|
-
if (typeof
|
|
44961
|
+
if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver))
|
|
44905
44962
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
44906
|
-
return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value :
|
|
44963
|
+
return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state2.set(receiver, value), value;
|
|
44907
44964
|
};
|
|
44908
|
-
var __classPrivateFieldGet = function(receiver,
|
|
44965
|
+
var __classPrivateFieldGet = function(receiver, state2, kind, f2) {
|
|
44909
44966
|
if (kind === "a" && !f2)
|
|
44910
44967
|
throw new TypeError("Private accessor was defined without a getter");
|
|
44911
|
-
if (typeof
|
|
44968
|
+
if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver))
|
|
44912
44969
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
44913
|
-
return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value :
|
|
44970
|
+
return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state2.get(receiver);
|
|
44914
44971
|
};
|
|
44915
44972
|
var _AssertError_instances;
|
|
44916
44973
|
var _AssertError_iterator;
|
|
@@ -47290,5 +47347,5 @@ export {
|
|
|
47290
47347
|
wrapPageHandlerWithStreamingSlots
|
|
47291
47348
|
};
|
|
47292
47349
|
|
|
47293
|
-
//# debugId=
|
|
47350
|
+
//# debugId=3D4A20C69D33EDC864756E2164756E21
|
|
47294
47351
|
//# sourceMappingURL=index.js.map
|