@absolutejs/absolute 0.20.0-beta.174 → 0.20.0-beta.176
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 +32 -0
- package/changelog.json +76 -0
- package/dist/angular/browser.js +13 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +67 -8
- package/dist/angular/index.js.map +10 -8
- package/dist/angular/server.js +67 -8
- package/dist/angular/server.js.map +10 -8
- package/dist/build.js +315 -120
- package/dist/build.js.map +21 -19
- package/dist/cli/{compile-n6fs2vmx.js → compile-w2z6c9vt.js} +1 -1
- package/dist/cli/{dev-6h1f0mzq.js → dev-8br5mr7t.js} +16 -2
- package/dist/cli/{index-mqevg32w.js → index-6522t968.js} +21 -2
- package/dist/cli/{index-bhyd3ejc.js → index-7z1hh3fg.js} +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{islands-vk05sj6v.js → islands-bx67g15t.js} +4 -4
- package/dist/cli/{mobile-62b6j3j7.js → mobile-we5q51ey.js} +2 -2
- package/dist/cli/{start-jh6kyp92.js → start-srs11bm8.js} +2 -2
- package/dist/client/chunks/index-4j1snyh2.js +18 -0
- package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
- package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
- package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
- package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
- package/dist/client/chunks/react-sprprqzs.js.map +10 -0
- package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
- package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
- package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
- package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
- package/dist/client/index.js +65 -8
- package/dist/client/index.js.map +4 -4
- package/dist/client/navigation.js +5 -3
- package/dist/client/navigation.js.map +2 -2
- package/dist/client/prefetch.js +1 -1
- package/dist/dev/client/handlers/islands.ts +85 -0
- package/dist/dev/client/hmrClient.ts +6 -0
- package/dist/index.js +460 -244
- package/dist/index.js.map +23 -21
- package/dist/islands/index.js +57 -10
- package/dist/islands/index.js.map +9 -7
- package/dist/react/browser.js +15 -4
- package/dist/react/browser.js.map +5 -5
- package/dist/react/components/client.js +506 -0
- package/dist/react/components/index.js +14 -15
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/components/server/index.js +728 -0
- package/dist/react/hooks/index.js +14 -15
- package/dist/react/hooks/index.js.map +4 -4
- package/dist/react/index.js +66 -6
- package/dist/react/index.js.map +11 -9
- package/dist/react/router/browser.js +7 -8
- package/dist/react/router/browser.js.map +4 -4
- package/dist/react/router/index.js +7 -8
- package/dist/react/router/index.js.map +4 -4
- package/dist/react/server.js +14 -1
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/buildReactServerComponents.d.ts +4 -0
- package/dist/src/build/islandEntries.d.ts +5 -0
- package/dist/src/client/hydrators/react.d.ts +7 -0
- package/dist/src/client/hydrators/svelte.d.ts +3 -0
- package/dist/src/client/hydrators/vue.d.ts +3 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
- package/dist/src/core/islandServerGeneration.d.ts +3 -0
- package/dist/src/react/components/client.d.ts +4 -0
- package/dist/src/react/components/server/index.d.ts +8 -0
- package/dist/src/react/serverComponents/constants.d.ts +2 -1
- package/dist/svelte/index.js +66 -6
- package/dist/svelte/index.js.map +10 -8
- package/dist/svelte/server.js +38 -3
- package/dist/svelte/server.js.map +6 -5
- package/dist/types/build.d.ts +3 -2
- package/dist/types/globals.d.ts +15 -0
- package/dist/vue/browser.js +26 -16
- package/dist/vue/browser.js.map +5 -5
- package/dist/vue/index.js +65 -21
- package/dist/vue/index.js.map +10 -9
- package/package.json +1 -1
- package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
- package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
- package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
- package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
package/dist/index.js
CHANGED
|
@@ -7852,6 +7852,19 @@ var init_ssrRender = __esm(() => {
|
|
|
7852
7852
|
selectorCache = new Map;
|
|
7853
7853
|
});
|
|
7854
7854
|
|
|
7855
|
+
// src/dev/client/cspNonce.ts
|
|
7856
|
+
var applyPageNonce = (element) => {
|
|
7857
|
+
const nonce = readPageNonce();
|
|
7858
|
+
if (nonce)
|
|
7859
|
+
element.nonce = nonce;
|
|
7860
|
+
return element;
|
|
7861
|
+
}, readPageNonce = () => {
|
|
7862
|
+
if (typeof document === "undefined")
|
|
7863
|
+
return;
|
|
7864
|
+
const carrier = document.querySelector("script[nonce], style[nonce]");
|
|
7865
|
+
return carrier?.nonce || undefined;
|
|
7866
|
+
};
|
|
7867
|
+
|
|
7855
7868
|
// src/angular/islands.ts
|
|
7856
7869
|
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
7857
7870
|
const requestId = getSsrContextId();
|
|
@@ -8769,10 +8782,25 @@ var init_lazyModule = __esm(() => {
|
|
|
8769
8782
|
LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
|
|
8770
8783
|
});
|
|
8771
8784
|
|
|
8785
|
+
// src/core/islandServerGeneration.ts
|
|
8786
|
+
var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
|
|
8787
|
+
globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
|
|
8788
|
+
}, createIslandGenerationGuard = (reset) => {
|
|
8789
|
+
let seen = readGeneration();
|
|
8790
|
+
return () => {
|
|
8791
|
+
const current = readGeneration();
|
|
8792
|
+
if (current === seen)
|
|
8793
|
+
return current;
|
|
8794
|
+
seen = current;
|
|
8795
|
+
reset();
|
|
8796
|
+
return current;
|
|
8797
|
+
};
|
|
8798
|
+
};
|
|
8799
|
+
|
|
8772
8800
|
// src/core/svelteServerModule.ts
|
|
8773
8801
|
import { mkdir as mkdir3, readdir as readdir2 } from "fs/promises";
|
|
8774
8802
|
import { basename as basename2, dirname as dirname6, extname as extname3, join as join8, relative as relative3, resolve as resolve6 } from "path";
|
|
8775
|
-
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
8803
|
+
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
8776
8804
|
const importPath = relative3(dirname6(from), target).replace(/\\/g, "/");
|
|
8777
8805
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
8778
8806
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
@@ -8839,7 +8867,9 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
8839
8867
|
}, getCachedModulePath2 = (sourcePath) => {
|
|
8840
8868
|
const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
8841
8869
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
8842
|
-
|
|
8870
|
+
const generation = syncIslandGeneration();
|
|
8871
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
8872
|
+
return join8(serverCacheRoot2, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
8843
8873
|
}, resolveSvelteImport = async (spec, from) => {
|
|
8844
8874
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
8845
8875
|
const resolved = resolvePackageImport(spec);
|
|
@@ -8871,6 +8901,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
8871
8901
|
}
|
|
8872
8902
|
await Bun.write(path, content);
|
|
8873
8903
|
}, compileSvelteServerModule = async (sourcePath) => {
|
|
8904
|
+
syncIslandGeneration();
|
|
8874
8905
|
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
8875
8906
|
if (cachedModulePath) {
|
|
8876
8907
|
return cachedModulePath;
|
|
@@ -8953,6 +8984,10 @@ var init_svelteServerModule = __esm(() => {
|
|
|
8953
8984
|
serverCacheRoot2 = join8(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
8954
8985
|
compiledModuleCache2 = new Map;
|
|
8955
8986
|
originalSourcePathCache = new Map;
|
|
8987
|
+
syncIslandGeneration = createIslandGenerationGuard(() => {
|
|
8988
|
+
compiledModuleCache2.clear();
|
|
8989
|
+
originalSourcePathCache.clear();
|
|
8990
|
+
});
|
|
8956
8991
|
transpiler = new Bun.Transpiler({
|
|
8957
8992
|
loader: "ts",
|
|
8958
8993
|
target: "browser"
|
|
@@ -8986,13 +9021,15 @@ import { readFileSync as readFileSync6, realpathSync } from "fs";
|
|
|
8986
9021
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
8987
9022
|
import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
|
|
8988
9023
|
var {Transpiler } = globalThis.Bun;
|
|
8989
|
-
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
9024
|
+
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
8990
9025
|
const importPath = relative4(dirname7(from), target).replace(/\\/g, "/");
|
|
8991
9026
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
8992
9027
|
}, getCachedModulePath3 = (sourcePath) => {
|
|
8993
9028
|
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
8994
9029
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
8995
|
-
|
|
9030
|
+
const generation = syncIslandGeneration2();
|
|
9031
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
9032
|
+
return join9(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
8996
9033
|
}, writeIfChanged2 = async (path, content) => {
|
|
8997
9034
|
const targetFile = Bun.file(path);
|
|
8998
9035
|
if (await targetFile.exists()) {
|
|
@@ -9019,6 +9056,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
9019
9056
|
`) : nonVueLines.join(`
|
|
9020
9057
|
`);
|
|
9021
9058
|
}, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
|
|
9059
|
+
syncIslandGeneration2();
|
|
9022
9060
|
const cachedModulePath = compiledModuleCache3.get(sourcePath);
|
|
9023
9061
|
if (cachedModulePath)
|
|
9024
9062
|
return cachedModulePath;
|
|
@@ -9079,6 +9117,9 @@ var init_vueServerModule = __esm(() => {
|
|
|
9079
9117
|
init_isFile();
|
|
9080
9118
|
serverCacheRoot3 = join9(process.cwd(), ".absolutejs", "islands", "vue");
|
|
9081
9119
|
compiledModuleCache3 = new Map;
|
|
9120
|
+
syncIslandGeneration2 = createIslandGenerationGuard(() => {
|
|
9121
|
+
compiledModuleCache3.clear();
|
|
9122
|
+
});
|
|
9082
9123
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
9083
9124
|
});
|
|
9084
9125
|
|
|
@@ -9096,7 +9137,7 @@ var init_islandMarkupAttributes = __esm(() => {
|
|
|
9096
9137
|
});
|
|
9097
9138
|
|
|
9098
9139
|
// src/core/renderIslandMarkup.ts
|
|
9099
|
-
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
|
|
9140
|
+
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
|
|
9100
9141
|
islandSequence += 1;
|
|
9101
9142
|
return `island-${islandSequence}`;
|
|
9102
9143
|
}, isRecord7 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord7(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
|
|
@@ -9110,6 +9151,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
9110
9151
|
const loadedModule = await import(compiledModulePath);
|
|
9111
9152
|
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
9112
9153
|
}, loadServerBuildComponent = async (buildReferencePath) => {
|
|
9154
|
+
syncIslandGeneration3();
|
|
9113
9155
|
const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
|
|
9114
9156
|
if (cachedBuildComponent) {
|
|
9115
9157
|
return cachedBuildComponent;
|
|
@@ -9148,6 +9190,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
9148
9190
|
}
|
|
9149
9191
|
return loadServerImportComponent(resolvedComponent);
|
|
9150
9192
|
}, resolveServerIslandComponent = async (component) => {
|
|
9193
|
+
syncIslandGeneration3();
|
|
9151
9194
|
const cachedResolvedComponent = resolvedServerComponentCache.get(component);
|
|
9152
9195
|
if (cachedResolvedComponent) {
|
|
9153
9196
|
return cachedResolvedComponent;
|
|
@@ -9246,6 +9289,10 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
9246
9289
|
init_islands();
|
|
9247
9290
|
resolvedServerComponentCache = new Map;
|
|
9248
9291
|
resolvedServerBuildComponentCache = new Map;
|
|
9292
|
+
syncIslandGeneration3 = createIslandGenerationGuard(() => {
|
|
9293
|
+
resolvedServerComponentCache.clear();
|
|
9294
|
+
resolvedServerBuildComponentCache.clear();
|
|
9295
|
+
});
|
|
9249
9296
|
});
|
|
9250
9297
|
|
|
9251
9298
|
// src/utils/lazyTypescript.ts
|
|
@@ -9269,8 +9316,9 @@ var init_lazyTypescript = __esm(() => {
|
|
|
9269
9316
|
});
|
|
9270
9317
|
|
|
9271
9318
|
// src/build/islandEntries.ts
|
|
9272
|
-
import { mkdirSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
9319
|
+
import { mkdirSync, rmSync, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
9273
9320
|
import { dirname as dirname8, extname as extname4, join as join10, relative as relative5, resolve as resolve8 } from "path";
|
|
9321
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
9274
9322
|
var frameworks, isRecord8 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
|
|
9275
9323
|
if (isRecord8(mod.islandRegistry))
|
|
9276
9324
|
return mod.islandRegistry;
|
|
@@ -9282,9 +9330,24 @@ var frameworks, isRecord8 = (value) => typeof value === "object" && value !== nu
|
|
|
9282
9330
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
9283
9331
|
}, isIdentifier = (value) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value), resolveIslandSourcePath = (registryPath, sourcePath) => {
|
|
9284
9332
|
if (sourcePath.startsWith("file://")) {
|
|
9285
|
-
return
|
|
9333
|
+
return fileURLToPath2(sourcePath);
|
|
9286
9334
|
}
|
|
9287
9335
|
return resolve8(dirname8(registryPath), sourcePath);
|
|
9336
|
+
}, isExistingFile = (path) => {
|
|
9337
|
+
try {
|
|
9338
|
+
return statSync2(path).isFile();
|
|
9339
|
+
} catch {
|
|
9340
|
+
return false;
|
|
9341
|
+
}
|
|
9342
|
+
}, resolveIslandSourceFile = (registryPath, sourcePath) => {
|
|
9343
|
+
const joinedPath = resolveIslandSourcePath(registryPath, sourcePath);
|
|
9344
|
+
if (isExistingFile(joinedPath))
|
|
9345
|
+
return joinedPath;
|
|
9346
|
+
try {
|
|
9347
|
+
return Bun.resolveSync(joinedPath, dirname8(registryPath));
|
|
9348
|
+
} catch {
|
|
9349
|
+
return joinedPath;
|
|
9350
|
+
}
|
|
9288
9351
|
}, getObjectPropertyName = (name) => {
|
|
9289
9352
|
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name)) {
|
|
9290
9353
|
return name.text;
|
|
@@ -11072,7 +11135,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
11072
11135
|
|
|
11073
11136
|
// src/islands/pageMetadata.ts
|
|
11074
11137
|
import { readFileSync as readFileSync12 } from "fs";
|
|
11075
|
-
import {
|
|
11138
|
+
import { resolve as resolve11 } from "path";
|
|
11076
11139
|
var pagePatterns, getPageDirs = (config) => [
|
|
11077
11140
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
11078
11141
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -11092,17 +11155,10 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
11092
11155
|
const source = definition.buildReference?.source;
|
|
11093
11156
|
if (!source)
|
|
11094
11157
|
continue;
|
|
11095
|
-
|
|
11096
|
-
lookup.set(`${definition.framework}:${definition.component}`, resolve11(resolvedSource));
|
|
11158
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve11(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
|
|
11097
11159
|
}
|
|
11098
11160
|
return lookup;
|
|
11099
|
-
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map,
|
|
11100
|
-
const candidate = usage.source;
|
|
11101
|
-
return candidate ? resolve11(candidate) === target : false;
|
|
11102
|
-
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
11103
|
-
const target = resolve11(sourcePath);
|
|
11104
|
-
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
11105
|
-
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
11161
|
+
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
11106
11162
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
11107
11163
|
return sourcePath ? {
|
|
11108
11164
|
...usage,
|
|
@@ -12482,7 +12538,7 @@ var init_telemetry = __esm(() => {
|
|
|
12482
12538
|
// src/cli/telemetryEvent.ts
|
|
12483
12539
|
import { existsSync as existsSync14, readFileSync as readFileSync17 } from "fs";
|
|
12484
12540
|
import { arch, platform } from "os";
|
|
12485
|
-
import { dirname as
|
|
12541
|
+
import { dirname as dirname9, join as join17, parse } from "path";
|
|
12486
12542
|
var checkCandidate = (candidate) => {
|
|
12487
12543
|
if (!existsSync14(candidate)) {
|
|
12488
12544
|
return null;
|
|
@@ -12507,7 +12563,7 @@ var checkCandidate = (candidate) => {
|
|
|
12507
12563
|
if (version) {
|
|
12508
12564
|
return version;
|
|
12509
12565
|
}
|
|
12510
|
-
dir =
|
|
12566
|
+
dir = dirname9(dir);
|
|
12511
12567
|
}
|
|
12512
12568
|
return "unknown";
|
|
12513
12569
|
}, sendTelemetryEvent = (event, payload) => {
|
|
@@ -12618,7 +12674,7 @@ var init_mobilePreview = __esm(() => {
|
|
|
12618
12674
|
// src/mobile/deviceCapabilities.ts
|
|
12619
12675
|
import { existsSync as existsSync15, readFileSync as readFileSync18 } from "fs";
|
|
12620
12676
|
import { extname as extname6, join as join18, relative as relative8, resolve as resolve15 } from "path";
|
|
12621
|
-
import { fileURLToPath as
|
|
12677
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
12622
12678
|
var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
12623
12679
|
const value = JSON.parse(readFileSync18(path, "utf8"));
|
|
12624
12680
|
if (!object(value))
|
|
@@ -12744,7 +12800,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
12744
12800
|
};
|
|
12745
12801
|
}, resolveAdapterManifest = (adapter, provider) => {
|
|
12746
12802
|
try {
|
|
12747
|
-
return
|
|
12803
|
+
return fileURLToPath3(import.meta.resolve(`${adapter}/package.json`));
|
|
12748
12804
|
} catch {
|
|
12749
12805
|
throw new TypeError(`${adapter} is not installed. Run \`absolute mobile init\` to install the ${provider === "expo" ? "Expo" : "Capacitor"} device adapters.`);
|
|
12750
12806
|
}
|
|
@@ -13089,7 +13145,7 @@ var init_client = __esm(() => {
|
|
|
13089
13145
|
|
|
13090
13146
|
// src/mobile/syncSchema.ts
|
|
13091
13147
|
import { readFileSync as readFileSync20 } from "fs";
|
|
13092
|
-
import { dirname as
|
|
13148
|
+
import { dirname as dirname10, join as join20, resolve as resolve16 } from "path";
|
|
13093
13149
|
var object2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
13094
13150
|
try {
|
|
13095
13151
|
const value = JSON.parse(readFileSync20(path, "utf8"));
|
|
@@ -13112,7 +13168,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
|
|
|
13112
13168
|
const manifest = manifestAt(candidate);
|
|
13113
13169
|
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
13114
13170
|
return candidate;
|
|
13115
|
-
const parent =
|
|
13171
|
+
const parent = dirname10(directory);
|
|
13116
13172
|
if (parent === directory)
|
|
13117
13173
|
return;
|
|
13118
13174
|
directory = parent;
|
|
@@ -14007,7 +14063,7 @@ import {
|
|
|
14007
14063
|
X509Certificate as X509Certificate3
|
|
14008
14064
|
} from "crypto";
|
|
14009
14065
|
import { access as access4, mkdir as mkdir6 } from "fs/promises";
|
|
14010
|
-
import { dirname as
|
|
14066
|
+
import { dirname as dirname11, isAbsolute as isAbsolute4, relative as relative9, resolve as resolve17, sep as sep3 } from "path";
|
|
14011
14067
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
14012
14068
|
import { Elysia as Elysia8 } from "elysia";
|
|
14013
14069
|
var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MODULE = "mobile.update.ts", object4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), projectPath = (projectRoot, requested) => {
|
|
@@ -14232,7 +14288,7 @@ ${generated}`);
|
|
|
14232
14288
|
return;
|
|
14233
14289
|
});
|
|
14234
14290
|
}
|
|
14235
|
-
await mkdir6(
|
|
14291
|
+
await mkdir6(dirname11(path), { recursive: true });
|
|
14236
14292
|
await Bun.write(path, renderAbsoluteMobileUpdateRegistry({
|
|
14237
14293
|
...options.health ? { health: options.health } : {},
|
|
14238
14294
|
...options.rollout ? { rollout: options.rollout } : {},
|
|
@@ -15611,7 +15667,7 @@ var init_validateSafePath = () => {};
|
|
|
15611
15667
|
// src/build/buildReactServerComponents.ts
|
|
15612
15668
|
import { createHash as createHash6 } from "crypto";
|
|
15613
15669
|
import { existsSync as existsSync19, mkdirSync as mkdirSync5, readFileSync as readFileSync22, writeFileSync as writeFileSync7 } from "fs";
|
|
15614
|
-
import { basename as basename5, dirname as
|
|
15670
|
+
import { basename as basename5, dirname as dirname12, extname as extname9, join as join25, relative as relative12, resolve as resolve23 } from "path";
|
|
15615
15671
|
var {
|
|
15616
15672
|
build: bunBuild,
|
|
15617
15673
|
Glob: Glob3,
|
|
@@ -15629,9 +15685,9 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
|
|
|
15629
15685
|
}, clientModuleId = (projectRoot, path) => createHash6("sha256").update(relative12(projectRoot, path).replace(/\\/g, "/")).digest("hex").slice(0, MODULE_ID_LENGTH), isClientModuleSource = (source) => USE_CLIENT_PATTERN.test(source), scanExportNames = (path, source) => {
|
|
15630
15686
|
const transpiler = new Transpiler2({ loader: loaderFor(path) });
|
|
15631
15687
|
return transpiler.scan(source).exports;
|
|
15632
|
-
}, clientReferenceSource = (module) => {
|
|
15688
|
+
}, clientReferenceSource = (module, flightServer) => {
|
|
15633
15689
|
const lines = [
|
|
15634
|
-
`import { registerClientReference } from
|
|
15690
|
+
`import { registerClientReference } from ${JSON.stringify(flightServer)};`,
|
|
15635
15691
|
`import { clientManifest } from ${JSON.stringify(MANIFEST_SPECIFIER)};`,
|
|
15636
15692
|
`const id = ${JSON.stringify(module.id)};`,
|
|
15637
15693
|
`clientManifest[id] = { chunks: [id, id], id, name: '' };`,
|
|
@@ -15643,7 +15699,16 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
|
|
|
15643
15699
|
return `${lines.join(`
|
|
15644
15700
|
`)}
|
|
15645
15701
|
`;
|
|
15702
|
+
}, REACT_COMPONENTS_SPECIFIER, resolveReactComponentsServerEntry = (importer) => {
|
|
15703
|
+
try {
|
|
15704
|
+
const regularEntry = Bun.resolveSync("@absolutejs/absolute/react/components", dirname12(importer));
|
|
15705
|
+
const serverEntry = join25(dirname12(regularEntry), "server", "index.js");
|
|
15706
|
+
return existsSync19(serverEntry) ? serverEntry : undefined;
|
|
15707
|
+
} catch {
|
|
15708
|
+
return;
|
|
15709
|
+
}
|
|
15646
15710
|
}, createClientReferencePlugin = (projectRoot, clientModules) => {
|
|
15711
|
+
const flightServer = Bun.resolveSync("react-server-dom-webpack/server.edge", projectRoot);
|
|
15647
15712
|
const plugin = {
|
|
15648
15713
|
name: "absolute-react-server-client-references",
|
|
15649
15714
|
setup(builder) {
|
|
@@ -15656,6 +15721,10 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
|
|
|
15656
15721
|
`,
|
|
15657
15722
|
loader: "js"
|
|
15658
15723
|
}));
|
|
15724
|
+
builder.onResolve({ filter: REACT_COMPONENTS_SPECIFIER }, (args) => {
|
|
15725
|
+
const path = resolveReactComponentsServerEntry(args.importer);
|
|
15726
|
+
return path ? { path } : undefined;
|
|
15727
|
+
});
|
|
15659
15728
|
builder.onLoad({ filter: SOURCE_FILTER }, (args) => {
|
|
15660
15729
|
const source = readFileSync22(args.path, "utf8");
|
|
15661
15730
|
const loader = loaderFor(args.path);
|
|
@@ -15669,7 +15738,7 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
|
|
|
15669
15738
|
};
|
|
15670
15739
|
clientModules.set(module.id, module);
|
|
15671
15740
|
return {
|
|
15672
|
-
contents: clientReferenceSource(module),
|
|
15741
|
+
contents: clientReferenceSource(module, flightServer),
|
|
15673
15742
|
loader: "js"
|
|
15674
15743
|
};
|
|
15675
15744
|
});
|
|
@@ -15790,10 +15859,21 @@ hydrateRoot(document, createElement(Root));
|
|
|
15790
15859
|
outputPaths: [],
|
|
15791
15860
|
success: true
|
|
15792
15861
|
}), writeGeneratedFile = (path, contents) => {
|
|
15793
|
-
mkdirSync5(
|
|
15862
|
+
mkdirSync5(dirname12(path), { recursive: true });
|
|
15794
15863
|
writeFileSync7(path, contents);
|
|
15795
15864
|
return path;
|
|
15796
|
-
}, pageEntryName = (pagePath) => toPascal(basename5(pagePath, extname9(pagePath))),
|
|
15865
|
+
}, pageEntryName = (pagePath) => toPascal(basename5(pagePath, extname9(pagePath))), endsWithPageSuffix = (name) => name.length > REACT_SERVER_PAGE_MANIFEST_SUFFIX.length && name.endsWith(REACT_SERVER_PAGE_MANIFEST_SUFFIX), pageManifestKeys = (name, names) => {
|
|
15866
|
+
const doubled = `${name}${REACT_SERVER_PAGE_MANIFEST_SUFFIX}`;
|
|
15867
|
+
if (!endsWithPageSuffix(name))
|
|
15868
|
+
return { keys: [doubled] };
|
|
15869
|
+
const base = name.slice(0, -REACT_SERVER_PAGE_MANIFEST_SUFFIX.length);
|
|
15870
|
+
if (!names.has(base))
|
|
15871
|
+
return { keys: [name, doubled] };
|
|
15872
|
+
return {
|
|
15873
|
+
collision: `React Server Components pages ${base} and ${name} both map to the manifest key "${name}"; ${base} keeps it and ${name} is only reachable as "${doubled}". Rename one of them.`,
|
|
15874
|
+
keys: [doubled]
|
|
15875
|
+
};
|
|
15876
|
+
}, buildReactServerComponents = async ({
|
|
15797
15877
|
buildPath,
|
|
15798
15878
|
directory,
|
|
15799
15879
|
isDev,
|
|
@@ -15894,10 +15974,15 @@ hydrateRoot(document, createElement(Root));
|
|
|
15894
15974
|
[REACT_SERVER_CLIENT_MANIFEST_KEY]: clientUrl,
|
|
15895
15975
|
[REACT_SERVER_RENDERER_MANIFEST_KEY]: resolve23(ssrOutput.path)
|
|
15896
15976
|
};
|
|
15977
|
+
const pageKeys = reactServerPageManifestKeys(pageEntries.map((page) => page.name));
|
|
15978
|
+
for (const collision of pageKeys.collisions)
|
|
15979
|
+
logWarn(collision);
|
|
15897
15980
|
for (const page of pageEntries) {
|
|
15898
15981
|
const output = findOutput(serverResult.outputs, page.name);
|
|
15899
|
-
if (output)
|
|
15900
|
-
|
|
15982
|
+
if (!output)
|
|
15983
|
+
continue;
|
|
15984
|
+
for (const key of pageKeys.keys.get(page.name) ?? [])
|
|
15985
|
+
manifest[key] = resolve23(output.path);
|
|
15901
15986
|
}
|
|
15902
15987
|
const result = {
|
|
15903
15988
|
logs,
|
|
@@ -15927,11 +16012,24 @@ hydrateRoot(document, createElement(Root));
|
|
|
15927
16012
|
...options,
|
|
15928
16013
|
directory: absoluteDirectory
|
|
15929
16014
|
});
|
|
16015
|
+
}, reactServerPageManifestKeys = (pageNames) => {
|
|
16016
|
+
const names = new Set(pageNames);
|
|
16017
|
+
const keys = new Map;
|
|
16018
|
+
const collisions = [];
|
|
16019
|
+
for (const name of pageNames) {
|
|
16020
|
+
const page = pageManifestKeys(name, names);
|
|
16021
|
+
keys.set(name, page.keys);
|
|
16022
|
+
if (page.collision)
|
|
16023
|
+
collisions.push(page.collision);
|
|
16024
|
+
}
|
|
16025
|
+
return { collisions, keys };
|
|
15930
16026
|
};
|
|
15931
16027
|
var init_buildReactServerComponents = __esm(() => {
|
|
16028
|
+
init_logger();
|
|
15932
16029
|
init_validateSafePath();
|
|
15933
16030
|
SOURCE_FILTER = /\.[cm]?[jt]sx?$/;
|
|
15934
16031
|
USE_CLIENT_PATTERN = /^(?:\s|\/\/[^\n]*\n|\/\*[\s\S]*?\*\/)*(['"])use client\1/;
|
|
16032
|
+
REACT_COMPONENTS_SPECIFIER = /^@absolutejs\/absolute\/react\/components$/;
|
|
15935
16033
|
});
|
|
15936
16034
|
|
|
15937
16035
|
// src/build/wrapHTMLScript.ts
|
|
@@ -15997,14 +16095,14 @@ var init_outputLogs = __esm(() => {
|
|
|
15997
16095
|
});
|
|
15998
16096
|
|
|
15999
16097
|
// src/build/stampedFileCache.ts
|
|
16000
|
-
import { statSync as
|
|
16098
|
+
import { statSync as statSync3 } from "fs";
|
|
16001
16099
|
var STAMP_SETTLE_MS = 2000, createStampedFileCache = () => {
|
|
16002
16100
|
const entries = new Map;
|
|
16003
16101
|
const seen = new Set;
|
|
16004
16102
|
const read = (path, compute) => {
|
|
16005
16103
|
let stamp;
|
|
16006
16104
|
try {
|
|
16007
|
-
const stats =
|
|
16105
|
+
const stats = statSync3(path);
|
|
16008
16106
|
stamp = { mtimeMs: stats.mtimeMs, size: stats.size };
|
|
16009
16107
|
} catch {
|
|
16010
16108
|
return compute();
|
|
@@ -16085,7 +16183,7 @@ var init_scanConventions = __esm(() => {
|
|
|
16085
16183
|
|
|
16086
16184
|
// src/build/htmlIncludes.ts
|
|
16087
16185
|
import { readFileSync as readFileSync23 } from "fs";
|
|
16088
|
-
import { dirname as
|
|
16186
|
+
import { dirname as dirname13, relative as relative13, resolve as resolve24 } from "path";
|
|
16089
16187
|
var describe = (path, root) => relative13(root, path) || path, includeError = (context, message) => new Error(`${message}
|
|
16090
16188
|
include chain: ${context.chain.map((path) => describe(path, context.root)).join(" \u2192 ")}`), findTagClose = (html, start) => {
|
|
16091
16189
|
const match = /^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(html.slice(start));
|
|
@@ -16156,7 +16254,7 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
|
|
|
16156
16254
|
const src = readAttribute(element.attributes, "src");
|
|
16157
16255
|
if (!src)
|
|
16158
16256
|
throw includeError(context, `<abs-include> without a src in ${describe(file, context.root)}`);
|
|
16159
|
-
const target = resolve24(
|
|
16257
|
+
const target = resolve24(dirname13(file), src);
|
|
16160
16258
|
const chain = [...context.chain, target];
|
|
16161
16259
|
if (context.chain.includes(target)) {
|
|
16162
16260
|
throw includeError({ ...context, chain }, `Include cycle: ${describe(target, context.root)} includes itself`);
|
|
@@ -16199,7 +16297,7 @@ var init_htmlIncludes = () => {};
|
|
|
16199
16297
|
|
|
16200
16298
|
// src/build/spaSideManifests.ts
|
|
16201
16299
|
import { writeFile as writeFile6 } from "fs/promises";
|
|
16202
|
-
import { basename as basename7, dirname as
|
|
16300
|
+
import { basename as basename7, dirname as dirname14, relative as relative14, resolve as resolve25 } from "path";
|
|
16203
16301
|
var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
16204
16302
|
const manifestEntries = {};
|
|
16205
16303
|
await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
|
|
@@ -16207,7 +16305,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
|
16207
16305
|
const parentJsPath = resolveServerJsPath(parentName);
|
|
16208
16306
|
if (!parentJsPath)
|
|
16209
16307
|
return;
|
|
16210
|
-
const sourceDir =
|
|
16308
|
+
const sourceDir = dirname14(source);
|
|
16211
16309
|
const entries = routes.flatMap(({ path, importPath }) => {
|
|
16212
16310
|
const childSourcePath = resolve25(sourceDir, importPath);
|
|
16213
16311
|
const childName = basename7(childSourcePath, ".vue");
|
|
@@ -16215,7 +16313,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
|
16215
16313
|
if (!childJsPath)
|
|
16216
16314
|
return [];
|
|
16217
16315
|
const absoluteCssPath = childJsPath.replace(/\.js$/, ".css");
|
|
16218
|
-
const cssPath = relative14(
|
|
16316
|
+
const cssPath = relative14(dirname14(parentJsPath), absoluteCssPath);
|
|
16219
16317
|
return [{ cssPath, path }];
|
|
16220
16318
|
});
|
|
16221
16319
|
if (entries.length === 0)
|
|
@@ -16236,7 +16334,7 @@ __export(exports_serverExternals, {
|
|
|
16236
16334
|
});
|
|
16237
16335
|
import { existsSync as existsSync21, readdirSync, readFileSync as readFileSync24 } from "fs";
|
|
16238
16336
|
import { isBuiltin } from "module";
|
|
16239
|
-
import { dirname as
|
|
16337
|
+
import { dirname as dirname15, extname as extname10, join as join26 } from "path";
|
|
16240
16338
|
var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVendorPaths) => {
|
|
16241
16339
|
const angularPartialDeclSpecs = Object.keys(angularVendorPaths ?? {}).filter((spec) => !spec.startsWith("@angular/")).flatMap((spec) => [spec, `${spec}/*`]);
|
|
16242
16340
|
return [
|
|
@@ -16290,12 +16388,12 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
16290
16388
|
return false;
|
|
16291
16389
|
}
|
|
16292
16390
|
}, findPackageRoot = (filePath) => {
|
|
16293
|
-
let dir =
|
|
16391
|
+
let dir = dirname15(filePath);
|
|
16294
16392
|
while (true) {
|
|
16295
16393
|
const manifestPath = join26(dir, "package.json");
|
|
16296
16394
|
if (existsSync21(manifestPath) && hasPackageName(manifestPath))
|
|
16297
16395
|
return dir;
|
|
16298
|
-
const parent =
|
|
16396
|
+
const parent = dirname15(dir);
|
|
16299
16397
|
if (parent === dir)
|
|
16300
16398
|
return null;
|
|
16301
16399
|
dir = parent;
|
|
@@ -16370,7 +16468,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
16370
16468
|
return verdict;
|
|
16371
16469
|
};
|
|
16372
16470
|
const entryIsRuntimeLoadable = (resolvedPath) => {
|
|
16373
|
-
const entryDir =
|
|
16471
|
+
const entryDir = dirname15(resolvedPath);
|
|
16374
16472
|
const cached = entryDecisions.get(entryDir);
|
|
16375
16473
|
if (cached !== undefined)
|
|
16376
16474
|
return cached;
|
|
@@ -16390,14 +16488,14 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
16390
16488
|
return false;
|
|
16391
16489
|
if (!RUNTIME_LOADABLE_EXTENSIONS.has(extname10(fromRoot)))
|
|
16392
16490
|
return false;
|
|
16393
|
-
const importerDir = importer ?
|
|
16491
|
+
const importerDir = importer ? dirname15(importer) : projectRoot;
|
|
16394
16492
|
if (importerDir !== projectRoot && resolveOrNull(specifier, importerDir) !== fromRoot)
|
|
16395
16493
|
return false;
|
|
16396
16494
|
return packageIsRuntimeResolvable(fromRoot) && entryIsRuntimeLoadable(fromRoot);
|
|
16397
16495
|
};
|
|
16398
16496
|
return {
|
|
16399
16497
|
isExternal: (specifier, importer) => {
|
|
16400
|
-
const key = `${specifier}\x00${importer ?
|
|
16498
|
+
const key = `${specifier}\x00${importer ? dirname15(importer) : ""}`;
|
|
16401
16499
|
const cached = decisions.get(key);
|
|
16402
16500
|
if (cached !== undefined)
|
|
16403
16501
|
return cached;
|
|
@@ -16436,7 +16534,7 @@ var init_serverExternals = __esm(() => {
|
|
|
16436
16534
|
|
|
16437
16535
|
// src/build/islandBootstrap.ts
|
|
16438
16536
|
import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync8 } from "fs";
|
|
16439
|
-
import { basename as basename8, dirname as
|
|
16537
|
+
import { basename as basename8, dirname as dirname16, extname as extname11, join as join27, relative as relative15 } from "path";
|
|
16440
16538
|
var DEFAULT_ISLAND_BOOTSTRAP_NAME = "absoluteIslandBootstrap", DEFAULT_ISLAND_BOOTSTRAP_SOURCE = `import {
|
|
16441
16539
|
createIslandManifestResolver,
|
|
16442
16540
|
startIslands
|
|
@@ -16448,7 +16546,7 @@ startIslands({
|
|
|
16448
16546
|
});
|
|
16449
16547
|
`, writeDefaultIslandBootstrap = (islandEntriesRoot) => {
|
|
16450
16548
|
const entryPath = join27(islandEntriesRoot, "islands", `${DEFAULT_ISLAND_BOOTSTRAP_NAME}.js`);
|
|
16451
|
-
mkdirSync6(
|
|
16549
|
+
mkdirSync6(dirname16(entryPath), { recursive: true });
|
|
16452
16550
|
writeFileSync8(entryPath, DEFAULT_ISLAND_BOOTSTRAP_SOURCE);
|
|
16453
16551
|
return entryPath;
|
|
16454
16552
|
}, artifactStem = (artifact) => {
|
|
@@ -16462,9 +16560,9 @@ startIslands({
|
|
|
16462
16560
|
outputs,
|
|
16463
16561
|
passRoot
|
|
16464
16562
|
}) => {
|
|
16465
|
-
const expectedDir = passRoot === undefined ? undefined : normalizePath2(join27(buildPath, relative15(passRoot,
|
|
16563
|
+
const expectedDir = passRoot === undefined ? undefined : normalizePath2(join27(buildPath, relative15(passRoot, dirname16(bootstrapPath))));
|
|
16466
16564
|
const expectedStem = basename8(bootstrapPath, extname11(bootstrapPath));
|
|
16467
|
-
const artifact = outputs.find((output) => output.kind === "entry-point" && extname11(output.path) === ".js" && (expectedDir === undefined || normalizePath2(
|
|
16565
|
+
const artifact = outputs.find((output) => output.kind === "entry-point" && extname11(output.path) === ".js" && (expectedDir === undefined || normalizePath2(dirname16(output.path)) === expectedDir) && artifactStem(output) === expectedStem);
|
|
16468
16566
|
if (!artifact)
|
|
16469
16567
|
return;
|
|
16470
16568
|
const webPath = normalizePath2(relative15(buildPath, artifact.path));
|
|
@@ -16474,13 +16572,13 @@ var init_islandBootstrap = () => {};
|
|
|
16474
16572
|
|
|
16475
16573
|
// src/build/missingClientFrameworks.ts
|
|
16476
16574
|
import { existsSync as existsSync22 } from "fs";
|
|
16477
|
-
import { dirname as
|
|
16575
|
+
import { dirname as dirname17, join as join28 } from "path";
|
|
16478
16576
|
var CLIENT_FRAMEWORK_PACKAGES, CLIENT_FRAMEWORKS, isPackageInstalled = (packageName, projectRoot) => {
|
|
16479
16577
|
let dir = projectRoot;
|
|
16480
16578
|
while (true) {
|
|
16481
16579
|
if (existsSync22(join28(dir, "node_modules", packageName, "package.json")))
|
|
16482
16580
|
return true;
|
|
16483
|
-
const parent =
|
|
16581
|
+
const parent = dirname17(dir);
|
|
16484
16582
|
if (parent === dir)
|
|
16485
16583
|
return false;
|
|
16486
16584
|
dir = parent;
|
|
@@ -16540,7 +16638,7 @@ var init_missingClientFrameworks = __esm(() => {
|
|
|
16540
16638
|
|
|
16541
16639
|
// src/build/missingReactRouter.ts
|
|
16542
16640
|
import { existsSync as existsSync23, readFileSync as readFileSync25, realpathSync as realpathSync2 } from "fs";
|
|
16543
|
-
import { dirname as
|
|
16641
|
+
import { dirname as dirname18, join as join29 } from "path";
|
|
16544
16642
|
var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageName2 = (manifestPath) => {
|
|
16545
16643
|
try {
|
|
16546
16644
|
const parsed = JSON.parse(readFileSync25(manifestPath, "utf-8"));
|
|
@@ -16552,7 +16650,7 @@ var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageNa
|
|
|
16552
16650
|
return;
|
|
16553
16651
|
}
|
|
16554
16652
|
}, owningPackageName = (filePath) => {
|
|
16555
|
-
let dir =
|
|
16653
|
+
let dir = dirname18(filePath);
|
|
16556
16654
|
while (true) {
|
|
16557
16655
|
const manifestPath = join29(dir, "package.json");
|
|
16558
16656
|
if (existsSync23(manifestPath)) {
|
|
@@ -16560,7 +16658,7 @@ var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageNa
|
|
|
16560
16658
|
if (name !== undefined)
|
|
16561
16659
|
return name;
|
|
16562
16660
|
}
|
|
16563
|
-
const parent =
|
|
16661
|
+
const parent = dirname18(dir);
|
|
16564
16662
|
if (parent === dir)
|
|
16565
16663
|
return;
|
|
16566
16664
|
dir = parent;
|
|
@@ -18439,7 +18537,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
18439
18537
|
// src/build/fileRoutes.ts
|
|
18440
18538
|
import { existsSync as existsSync31, mkdirSync as mkdirSync8, readFileSync as readFileSync28, writeFileSync as writeFileSync10 } from "fs";
|
|
18441
18539
|
import {
|
|
18442
|
-
dirname as
|
|
18540
|
+
dirname as dirname19,
|
|
18443
18541
|
extname as extname12,
|
|
18444
18542
|
isAbsolute as isAbsolute5,
|
|
18445
18543
|
join as join36,
|
|
@@ -18603,7 +18701,7 @@ var DEFAULT_DIRECTORY = "routes", DEFAULT_OUTPUT, HASH_LENGTH2 = 6, HASH_RADIX =
|
|
|
18603
18701
|
return lines.join(`
|
|
18604
18702
|
`);
|
|
18605
18703
|
}, renderFileRouteModule = (routes, output) => {
|
|
18606
|
-
const outputDir =
|
|
18704
|
+
const outputDir = dirname19(output);
|
|
18607
18705
|
const frameworks = [...new Set(routes.map((route) => route.framework))].sort().map((framework) => ADAPTERS2[framework]);
|
|
18608
18706
|
const imports = [
|
|
18609
18707
|
`import type { FileRouteDefinition } from '@absolutejs/absolute';`,
|
|
@@ -18630,7 +18728,7 @@ var DEFAULT_DIRECTORY = "routes", DEFAULT_OUTPUT, HASH_LENGTH2 = 6, HASH_RADIX =
|
|
|
18630
18728
|
const current = existsSync31(path) ? readFileSync28(path, "utf-8") : undefined;
|
|
18631
18729
|
if (current === contents)
|
|
18632
18730
|
return false;
|
|
18633
|
-
mkdirSync8(
|
|
18731
|
+
mkdirSync8(dirname19(path), { recursive: true });
|
|
18634
18732
|
writeFileSync10(path, contents);
|
|
18635
18733
|
return true;
|
|
18636
18734
|
}, syncFileRoutes = (config) => {
|
|
@@ -18803,7 +18901,7 @@ var init_lazyPages = __esm(() => {
|
|
|
18803
18901
|
|
|
18804
18902
|
// src/build/angularLinkerPlugin.ts
|
|
18805
18903
|
import { existsSync as existsSync33, mkdirSync as mkdirSync9, readFileSync as readFileSync29, writeFileSync as writeFileSync11 } from "fs";
|
|
18806
|
-
import { dirname as
|
|
18904
|
+
import { dirname as dirname20, join as join38, relative as relative17, resolve as resolve30 } from "path";
|
|
18807
18905
|
import { createHash as createHash7 } from "crypto";
|
|
18808
18906
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
18809
18907
|
name: "angular-linker",
|
|
@@ -18841,7 +18939,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
18841
18939
|
const mod = await import(linkerSpecifier);
|
|
18842
18940
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
18843
18941
|
fileSystem: {
|
|
18844
|
-
dirname:
|
|
18942
|
+
dirname: dirname20,
|
|
18845
18943
|
exists: existsSync33,
|
|
18846
18944
|
readFile: readFileSync29,
|
|
18847
18945
|
relative: relative17,
|
|
@@ -18957,8 +19055,8 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
|
18957
19055
|
});
|
|
18958
19056
|
|
|
18959
19057
|
// src/build/externalAssetPlugin.ts
|
|
18960
|
-
import { copyFileSync, existsSync as existsSync34, mkdirSync as mkdirSync10, statSync as
|
|
18961
|
-
import { basename as basename11, dirname as
|
|
19058
|
+
import { copyFileSync, existsSync as existsSync34, mkdirSync as mkdirSync10, statSync as statSync4 } from "fs";
|
|
19059
|
+
import { basename as basename11, dirname as dirname21, join as join39, resolve as resolve31 } from "path";
|
|
18962
19060
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
18963
19061
|
name: "absolute-external-asset",
|
|
18964
19062
|
setup(bld) {
|
|
@@ -18973,7 +19071,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
18973
19071
|
return;
|
|
18974
19072
|
urlPattern.lastIndex = 0;
|
|
18975
19073
|
let match;
|
|
18976
|
-
const sourceDir =
|
|
19074
|
+
const sourceDir = dirname21(args.path);
|
|
18977
19075
|
while ((match = urlPattern.exec(source)) !== null) {
|
|
18978
19076
|
const relPath = match[1];
|
|
18979
19077
|
if (!relPath)
|
|
@@ -18981,12 +19079,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
18981
19079
|
const assetPath = resolve31(sourceDir, relPath);
|
|
18982
19080
|
if (!existsSync34(assetPath))
|
|
18983
19081
|
continue;
|
|
18984
|
-
if (!
|
|
19082
|
+
if (!statSync4(assetPath).isFile())
|
|
18985
19083
|
continue;
|
|
18986
19084
|
const targetPath = join39(outDir, basename11(assetPath));
|
|
18987
19085
|
if (existsSync34(targetPath))
|
|
18988
19086
|
continue;
|
|
18989
|
-
mkdirSync10(
|
|
19087
|
+
mkdirSync10(dirname21(targetPath), { recursive: true });
|
|
18990
19088
|
copyFileSync(assetPath, targetPath);
|
|
18991
19089
|
}
|
|
18992
19090
|
return;
|
|
@@ -19189,7 +19287,7 @@ var init_islandRegistryTransform = __esm(() => {
|
|
|
19189
19287
|
|
|
19190
19288
|
// src/build/vueModuleOutputPath.ts
|
|
19191
19289
|
import {
|
|
19192
|
-
dirname as
|
|
19290
|
+
dirname as dirname22,
|
|
19193
19291
|
isAbsolute as isAbsolute7,
|
|
19194
19292
|
join as join40,
|
|
19195
19293
|
parse as parse2,
|
|
@@ -19198,7 +19296,7 @@ import {
|
|
|
19198
19296
|
sep as sep6
|
|
19199
19297
|
} from "path";
|
|
19200
19298
|
var SOURCES_DIR = "sources", EXTERNAL_DIR = "_external", UNRELATED_PREFIX = "h-", HASH_LENGTH3 = 13, toOutputName = (path) => path.replace(/\.(vue|ts)$/, ".js"), unrelatedMirrorPath = (absolutePath) => {
|
|
19201
|
-
const directory =
|
|
19299
|
+
const directory = dirname22(absolutePath);
|
|
19202
19300
|
const directoryHash = Bun.hash(directory).toString(BASE_36_RADIX).padStart(HASH_LENGTH3, "0");
|
|
19203
19301
|
return join40(EXTERNAL_DIR, `${UNRELATED_PREFIX}${directoryHash}`, toOutputName(relative18(directory, absolutePath)));
|
|
19204
19302
|
}, sourceMirrorPath = (sourcePath, projectRoot) => {
|
|
@@ -19216,7 +19314,7 @@ var SOURCES_DIR = "sources", EXTERNAL_DIR = "_external", UNRELATED_PREFIX = "h-"
|
|
|
19216
19314
|
return unrelatedMirrorPath(absolutePath);
|
|
19217
19315
|
return join40(EXTERNAL_DIR, String(levelsUp), toOutputName(segments.slice(levelsUp).join(sep6)));
|
|
19218
19316
|
}, vueModuleOutputPath = (outputDir, sourcePath, projectRoot = process.cwd()) => join40(outputDir, SOURCES_DIR, sourceMirrorPath(sourcePath, projectRoot)), vueRelativeOutputImport = (importerSource, targetSource, projectRoot = process.cwd()) => {
|
|
19219
|
-
const specifier = relative18(
|
|
19317
|
+
const specifier = relative18(dirname22(sourceMirrorPath(importerSource, projectRoot)), sourceMirrorPath(targetSource, projectRoot)).replace(/\\/g, "/");
|
|
19220
19318
|
return specifier.startsWith("../") ? specifier : `./${specifier}`;
|
|
19221
19319
|
}, mirrorRegion = (sourcePath, projectRoot) => {
|
|
19222
19320
|
const [first, second] = sourceMirrorPath(sourcePath, projectRoot).split(sep6);
|
|
@@ -19773,7 +19871,7 @@ var init_commonAncestor = () => {};
|
|
|
19773
19871
|
|
|
19774
19872
|
// src/utils/buildDirectoryLock.ts
|
|
19775
19873
|
import { mkdirSync as mkdirSync12, unlinkSync, writeFileSync as writeFileSync14, readFileSync as readFileSync32 } from "fs";
|
|
19776
|
-
import { dirname as
|
|
19874
|
+
import { dirname as dirname23, join as join44 } from "path";
|
|
19777
19875
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
19778
19876
|
if (exitHandlersRegistered)
|
|
19779
19877
|
return;
|
|
@@ -19800,7 +19898,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19800
19898
|
console.error(err);
|
|
19801
19899
|
process.exit(1);
|
|
19802
19900
|
});
|
|
19803
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join44(
|
|
19901
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join44(dirname23(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
19804
19902
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
19805
19903
|
if (locks.size === 0) {
|
|
19806
19904
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -19817,7 +19915,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
19817
19915
|
locks.delete(buildDirectory);
|
|
19818
19916
|
writeHeldLockEnv(locks);
|
|
19819
19917
|
}, writeLockFileSync = (lockPath, metadata) => {
|
|
19820
|
-
mkdirSync12(
|
|
19918
|
+
mkdirSync12(dirname23(lockPath), { recursive: true });
|
|
19821
19919
|
writeFileSync14(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
|
|
19822
19920
|
}, readLockMetadata = (lockPath) => {
|
|
19823
19921
|
try {
|
|
@@ -19944,7 +20042,7 @@ var isTestSourcePath = (file) => {
|
|
|
19944
20042
|
|
|
19945
20043
|
// src/build/pwa.ts
|
|
19946
20044
|
import { mkdir as mkdir7, rm as rm8, writeFile as writeFile9 } from "fs/promises";
|
|
19947
|
-
import { dirname as
|
|
20045
|
+
import { dirname as dirname24, join as join45 } from "path";
|
|
19948
20046
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
19949
20047
|
const input = value ?? fallback;
|
|
19950
20048
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -20033,7 +20131,7 @@ ${push ? `,
|
|
|
20033
20131
|
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
20034
20132
|
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
20035
20133
|
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
20036
|
-
await mkdir7(
|
|
20134
|
+
await mkdir7(dirname24(workerDestination), { recursive: true });
|
|
20037
20135
|
await writeFile9(workerDestination, `${pushServiceWorker({
|
|
20038
20136
|
...config.serviceWorker ?? {},
|
|
20039
20137
|
...pushRequested && pushApplicationServerKey && pushRoute ? {
|
|
@@ -20048,7 +20146,7 @@ ${push ? `,
|
|
|
20048
20146
|
if (config.manifest && manifestPath) {
|
|
20049
20147
|
const { path: _path, ...manifestConfig } = config.manifest;
|
|
20050
20148
|
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
20051
|
-
await mkdir7(
|
|
20149
|
+
await mkdir7(dirname24(manifestDestination), { recursive: true });
|
|
20052
20150
|
await writeFile9(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
20053
20151
|
`);
|
|
20054
20152
|
}
|
|
@@ -20903,8 +21001,8 @@ var init_typescript_translator = __esm(() => {
|
|
|
20903
21001
|
});
|
|
20904
21002
|
|
|
20905
21003
|
// src/dev/angular/fastHmrCompiler.ts
|
|
20906
|
-
import { existsSync as existsSync37, readFileSync as readFileSync33, statSync as
|
|
20907
|
-
import { dirname as
|
|
21004
|
+
import { existsSync as existsSync37, readFileSync as readFileSync33, statSync as statSync5 } from "fs";
|
|
21005
|
+
import { dirname as dirname25, extname as extname15, relative as relative22, resolve as resolve36 } from "path";
|
|
20908
21006
|
var fail2 = (reason, detail, location) => ({
|
|
20909
21007
|
detail,
|
|
20910
21008
|
ok: false,
|
|
@@ -21033,7 +21131,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
21033
21131
|
continue;
|
|
21034
21132
|
const decoratorMeta = readDecoratorMeta(args);
|
|
21035
21133
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
21036
|
-
const componentDir =
|
|
21134
|
+
const componentDir = dirname25(componentFilePath);
|
|
21037
21135
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
21038
21136
|
fingerprintCache.set(id, fingerprint);
|
|
21039
21137
|
} else {
|
|
@@ -21807,7 +21905,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
21807
21905
|
const cacheKey = `ts:${filePath}:${className}`;
|
|
21808
21906
|
let stat;
|
|
21809
21907
|
try {
|
|
21810
|
-
stat =
|
|
21908
|
+
stat = statSync5(filePath);
|
|
21811
21909
|
} catch {
|
|
21812
21910
|
return null;
|
|
21813
21911
|
}
|
|
@@ -21861,7 +21959,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
21861
21959
|
const cacheKey = `dts:${dtsPath}:${className}`;
|
|
21862
21960
|
let stat;
|
|
21863
21961
|
try {
|
|
21864
|
-
stat =
|
|
21962
|
+
stat = statSync5(dtsPath);
|
|
21865
21963
|
} catch {
|
|
21866
21964
|
return null;
|
|
21867
21965
|
}
|
|
@@ -22012,7 +22110,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22012
22110
|
});
|
|
22013
22111
|
if (!names.includes(className))
|
|
22014
22112
|
continue;
|
|
22015
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
22113
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname25(startDtsPath));
|
|
22016
22114
|
if (!nextDts)
|
|
22017
22115
|
continue;
|
|
22018
22116
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -22022,7 +22120,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22022
22120
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
22023
22121
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
22024
22122
|
const fromPath = item[1] || "";
|
|
22025
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
22123
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname25(startDtsPath));
|
|
22026
22124
|
if (!nextDts)
|
|
22027
22125
|
continue;
|
|
22028
22126
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -22202,7 +22300,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
22202
22300
|
}, providerProbeCache, fileHasModuleProviders = (filePath) => {
|
|
22203
22301
|
let stat;
|
|
22204
22302
|
try {
|
|
22205
|
-
stat =
|
|
22303
|
+
stat = statSync5(filePath);
|
|
22206
22304
|
} catch {
|
|
22207
22305
|
return true;
|
|
22208
22306
|
}
|
|
@@ -22635,7 +22733,7 @@ ${block}
|
|
|
22635
22733
|
rebootstrapRequired: false
|
|
22636
22734
|
};
|
|
22637
22735
|
}
|
|
22638
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
22736
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname25(componentFilePath), projectRoot)) {
|
|
22639
22737
|
return fail2("inherits-decorated-class");
|
|
22640
22738
|
}
|
|
22641
22739
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -22647,7 +22745,7 @@ ${block}
|
|
|
22647
22745
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
22648
22746
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
22649
22747
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
22650
|
-
const componentDir =
|
|
22748
|
+
const componentDir = dirname25(componentFilePath);
|
|
22651
22749
|
let templateText;
|
|
22652
22750
|
let templatePath;
|
|
22653
22751
|
if (decoratorMeta.template !== null) {
|
|
@@ -23427,7 +23525,7 @@ var init_runAngularHandlerScan = __esm(() => {
|
|
|
23427
23525
|
|
|
23428
23526
|
// src/build/parseAngularConfigImports.ts
|
|
23429
23527
|
import { existsSync as existsSync38, readFileSync as readFileSync37 } from "fs";
|
|
23430
|
-
import { dirname as
|
|
23528
|
+
import { dirname as dirname26, isAbsolute as isAbsolute9, join as join50 } from "path";
|
|
23431
23529
|
var findDefineConfigCall = (sf) => {
|
|
23432
23530
|
let result = null;
|
|
23433
23531
|
const visit = (node) => {
|
|
@@ -23521,7 +23619,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
23521
23619
|
const importInfo = findImportForBinding(sf, binding);
|
|
23522
23620
|
if (!importInfo)
|
|
23523
23621
|
return null;
|
|
23524
|
-
const configDir =
|
|
23622
|
+
const configDir = dirname26(configPath);
|
|
23525
23623
|
const absolutePath = importInfo.source.startsWith(".") ? join50(configDir, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute9(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
23526
23624
|
return {
|
|
23527
23625
|
absolutePath,
|
|
@@ -23635,7 +23733,7 @@ var inlineSourceMapComment = (map) => [
|
|
|
23635
23733
|
import { existsSync as existsSync39 } from "fs";
|
|
23636
23734
|
import { mkdir as mkdir9, stat as stat3 } from "fs/promises";
|
|
23637
23735
|
import {
|
|
23638
|
-
dirname as
|
|
23736
|
+
dirname as dirname27,
|
|
23639
23737
|
isAbsolute as isAbsolute10,
|
|
23640
23738
|
join as join51,
|
|
23641
23739
|
basename as basename15,
|
|
@@ -23654,7 +23752,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23654
23752
|
return map;
|
|
23655
23753
|
return {
|
|
23656
23754
|
...map,
|
|
23657
|
-
sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ? resolve37(
|
|
23755
|
+
sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ? resolve37(dirname27(sourceFile), source) : source)
|
|
23658
23756
|
};
|
|
23659
23757
|
}, resolveDevClientDir2 = () => {
|
|
23660
23758
|
const projectRoot = process.cwd();
|
|
@@ -23692,7 +23790,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23692
23790
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
23693
23791
|
if (!spec.startsWith("."))
|
|
23694
23792
|
return null;
|
|
23695
|
-
const basePath = resolve37(
|
|
23793
|
+
const basePath = resolve37(dirname27(from), spec);
|
|
23696
23794
|
const candidates = [
|
|
23697
23795
|
basePath,
|
|
23698
23796
|
`${basePath}.ts`,
|
|
@@ -23719,7 +23817,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23719
23817
|
const resolved = resolvePackageImport(spec);
|
|
23720
23818
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
23721
23819
|
}
|
|
23722
|
-
const basePath = resolve37(
|
|
23820
|
+
const basePath = resolve37(dirname27(from), spec);
|
|
23723
23821
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
23724
23822
|
if (!explicit) {
|
|
23725
23823
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -23780,8 +23878,8 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23780
23878
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
23781
23879
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
23782
23880
|
const fileRoute = fileRouteFor(src);
|
|
23783
|
-
const rawRel = fileRoute ? "pages" :
|
|
23784
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative23(process.cwd(),
|
|
23881
|
+
const rawRel = fileRoute ? "pages" : dirname27(relative23(svelteRoot, src)).replace(/\\/g, "/");
|
|
23882
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative23(process.cwd(), dirname27(src)).replace(/\\/g, "/")}` : rawRel;
|
|
23785
23883
|
const baseName = fileRoute?.name ?? basename15(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
23786
23884
|
const staticImportPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
23787
23885
|
const dynamicImportPaths = Array.from(transpiledServer.matchAll(DYNAMIC_IMPORT_PATTERN)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
@@ -23792,8 +23890,8 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
23792
23890
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
23793
23891
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
23794
23892
|
const externalRewrites = new Map;
|
|
23795
|
-
const ssrOutputDir =
|
|
23796
|
-
const clientOutputDir =
|
|
23893
|
+
const ssrOutputDir = dirname27(join51(serverDir, relDir, `${baseName}.js`));
|
|
23894
|
+
const clientOutputDir = dirname27(join51(clientDir, relDir, `${baseName}.js`));
|
|
23797
23895
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
23798
23896
|
const rawSpec = importPaths[idx];
|
|
23799
23897
|
if (!rawSpec)
|
|
@@ -23877,8 +23975,8 @@ ${componentName}.${LAZY_SOURCE_EXPORT} = ${sourceId};` : "";
|
|
|
23877
23975
|
export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
|
|
23878
23976
|
};
|
|
23879
23977
|
await Promise.all([
|
|
23880
|
-
mkdir9(
|
|
23881
|
-
mkdir9(
|
|
23978
|
+
mkdir9(dirname27(ssrPath), { recursive: true }),
|
|
23979
|
+
mkdir9(dirname27(clientPath), { recursive: true })
|
|
23882
23980
|
]);
|
|
23883
23981
|
const inlineMap = (map) => map ? `${inlineSourceMapComment(withResolvedSources(map, src))}
|
|
23884
23982
|
` : "";
|
|
@@ -23913,10 +24011,10 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
|
|
|
23913
24011
|
const roots = await Promise.all(entryPoints.map(build));
|
|
23914
24012
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
23915
24013
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
23916
|
-
const relClientDir =
|
|
24014
|
+
const relClientDir = dirname27(relative23(clientDir, client));
|
|
23917
24015
|
const name = basename15(client, extname16(client));
|
|
23918
24016
|
const indexPath = join51(indexDir, relClientDir, `${name}.js`);
|
|
23919
|
-
const importRaw = relative23(
|
|
24017
|
+
const importRaw = relative23(dirname27(indexPath), client).split(sep8).join("/");
|
|
23920
24018
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
23921
24019
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
23922
24020
|
import "${hmrClientPath3}";
|
|
@@ -24024,13 +24122,13 @@ if (typeof window !== "undefined") {
|
|
|
24024
24122
|
setTimeout(releaseStreamingSlots, 0);
|
|
24025
24123
|
}
|
|
24026
24124
|
}`;
|
|
24027
|
-
await mkdir9(
|
|
24125
|
+
await mkdir9(dirname27(indexPath), { recursive: true });
|
|
24028
24126
|
return write2(indexPath, bootstrap);
|
|
24029
24127
|
}));
|
|
24030
24128
|
return {
|
|
24031
24129
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
24032
24130
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
24033
|
-
const rel =
|
|
24131
|
+
const rel = dirname27(relative23(clientDir, client));
|
|
24034
24132
|
return join51(indexDir, rel, basename15(client));
|
|
24035
24133
|
}),
|
|
24036
24134
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -24642,9 +24740,9 @@ __export(exports_emitTsHelpers, {
|
|
|
24642
24740
|
emitTsHelpers: () => emitTsHelpers
|
|
24643
24741
|
});
|
|
24644
24742
|
var {file: file3, Transpiler: Transpiler4, write: write3 } = globalThis.Bun;
|
|
24645
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync41, readdirSync as readdirSync6, statSync as
|
|
24743
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync41, readdirSync as readdirSync6, statSync as statSync6 } from "fs";
|
|
24646
24744
|
import { mkdir as mkdir11, rename as rename3, writeFile as writeFile12 } from "fs/promises";
|
|
24647
|
-
import { dirname as
|
|
24745
|
+
import { dirname as dirname28, join as join53, resolve as resolve39, sep as sep9 } from "path";
|
|
24648
24746
|
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 24, transpiler4, cacheDir = () => join53(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
|
|
24649
24747
|
const frameworkVersion = frameworkVersionForCache();
|
|
24650
24748
|
if (!frameworkVersion || !vueCompileCacheEnabled())
|
|
@@ -24690,8 +24788,8 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
|
|
|
24690
24788
|
} catch {}
|
|
24691
24789
|
}, writeBoth = async (clientOutputPath, serverOutputPath, content) => {
|
|
24692
24790
|
await Promise.all([
|
|
24693
|
-
mkdir11(
|
|
24694
|
-
mkdir11(
|
|
24791
|
+
mkdir11(dirname28(clientOutputPath), { recursive: true }),
|
|
24792
|
+
mkdir11(dirname28(serverOutputPath), { recursive: true })
|
|
24695
24793
|
]);
|
|
24696
24794
|
await Promise.all([
|
|
24697
24795
|
write3(clientOutputPath, content),
|
|
@@ -24699,14 +24797,14 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
|
|
|
24699
24797
|
]);
|
|
24700
24798
|
}, copyBoth = async (clientOutputPath, serverOutputPath, cachedPath) => {
|
|
24701
24799
|
await Promise.all([
|
|
24702
|
-
mkdir11(
|
|
24703
|
-
mkdir11(
|
|
24800
|
+
mkdir11(dirname28(clientOutputPath), { recursive: true }),
|
|
24801
|
+
mkdir11(dirname28(serverOutputPath), { recursive: true })
|
|
24704
24802
|
]);
|
|
24705
24803
|
copyFileSync2(cachedPath, clientOutputPath);
|
|
24706
24804
|
copyFileSync2(cachedPath, serverOutputPath);
|
|
24707
24805
|
}, QUOTES2, MIRRORED_MODULE, IMPORT_CANDIDATE_SUFFIXES, isFilePath = (path) => {
|
|
24708
24806
|
try {
|
|
24709
|
-
return
|
|
24807
|
+
return statSync6(path).isFile();
|
|
24710
24808
|
} catch {
|
|
24711
24809
|
return false;
|
|
24712
24810
|
}
|
|
@@ -24714,7 +24812,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
|
|
|
24714
24812
|
const base = resolve39(sourceDir, specifier);
|
|
24715
24813
|
return IMPORT_CANDIDATE_SUFFIXES.map((suffix) => `${base}${suffix}`).find(isFilePath) ?? base;
|
|
24716
24814
|
}, rewriteMirrorImports = (code, sourcePath) => {
|
|
24717
|
-
const sourceDir =
|
|
24815
|
+
const sourceDir = dirname28(sourcePath);
|
|
24718
24816
|
const rewrites = new Map;
|
|
24719
24817
|
for (const { path } of transpiler4.scanImports(code)) {
|
|
24720
24818
|
if (!path.startsWith("./") && !path.startsWith("../"))
|
|
@@ -24776,7 +24874,7 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
24776
24874
|
|
|
24777
24875
|
// src/build/inlineCssImports.ts
|
|
24778
24876
|
import { readFileSync as readFileSync40, realpathSync as realpathSync3 } from "fs";
|
|
24779
|
-
import { dirname as
|
|
24877
|
+
import { dirname as dirname29, resolve as resolve40 } from "path";
|
|
24780
24878
|
var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
24781
24879
|
const resolved = realpathSync3(cssFilePath);
|
|
24782
24880
|
if (visited.has(resolved))
|
|
@@ -24784,7 +24882,7 @@ var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
|
24784
24882
|
visited.add(resolved);
|
|
24785
24883
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
24786
24884
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
24787
|
-
const importedPath = resolve40(
|
|
24885
|
+
const importedPath = resolve40(dirname29(cssFilePath), relPath);
|
|
24788
24886
|
if (!isFile(importedPath))
|
|
24789
24887
|
return match;
|
|
24790
24888
|
const importedContent = readFileSync40(importedPath, "utf-8");
|
|
@@ -24797,7 +24895,7 @@ var init_inlineCssImports = __esm(() => {
|
|
|
24797
24895
|
|
|
24798
24896
|
// src/build/compileVueSfc.ts
|
|
24799
24897
|
import { existsSync as existsSync42, readFileSync as readFileSync41, realpathSync as realpathSync4 } from "fs";
|
|
24800
|
-
import { dirname as
|
|
24898
|
+
import { dirname as dirname30, join as join54, relative as relative24, resolve as resolve41 } from "path";
|
|
24801
24899
|
var {Transpiler: Transpiler5 } = globalThis.Bun;
|
|
24802
24900
|
var transpiler5, toJs = (filePath, sourceDir) => {
|
|
24803
24901
|
if (filePath.endsWith(".vue"))
|
|
@@ -24902,7 +25000,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
24902
25000
|
typeDepHashes[dep] = hashContent(readFileSync41(dep, "utf-8"));
|
|
24903
25001
|
}
|
|
24904
25002
|
const strippedScript = stripExports2(compiledScript.content);
|
|
24905
|
-
const sourceDir =
|
|
25003
|
+
const sourceDir = dirname30(sourceFilePath);
|
|
24906
25004
|
const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(strippedScript), sourceDir);
|
|
24907
25005
|
const generateRenderFunction = (ssr) => {
|
|
24908
25006
|
const rendered = compiler.compileTemplate({
|
|
@@ -24957,7 +25055,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
24957
25055
|
let result = code;
|
|
24958
25056
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
24959
25057
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
24960
|
-
let rel = relative24(
|
|
25058
|
+
let rel = relative24(dirname30(outputPath), targetPath).replace(/\\/g, "/");
|
|
24961
25059
|
if (!rel.startsWith("."))
|
|
24962
25060
|
rel = `./${rel}`;
|
|
24963
25061
|
result = result.replaceAll(bareImport, rel);
|
|
@@ -25057,7 +25155,7 @@ var init_workerJobs = __esm(() => {
|
|
|
25057
25155
|
// src/build/workerPool.ts
|
|
25058
25156
|
import { existsSync as existsSync43, readFileSync as readFileSync42 } from "fs";
|
|
25059
25157
|
import { availableParallelism, freemem } from "os";
|
|
25060
|
-
import { dirname as
|
|
25158
|
+
import { dirname as dirname31, join as join55 } from "path";
|
|
25061
25159
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
25062
25160
|
var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_MEMORY_BUDGET_BYTES, DEFAULT_IDLE_TIMEOUT_MS = 2000, DEFAULT_MIN_BATCH = 4, PACKAGE_WALK_DEPTH = 6, PERCENT2 = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
|
|
25063
25161
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -25088,7 +25186,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
25088
25186
|
for (let depth = 0;depth < PACKAGE_WALK_DEPTH; depth++) {
|
|
25089
25187
|
if (isOwnPackageRoot(dir))
|
|
25090
25188
|
return dir;
|
|
25091
|
-
const parent =
|
|
25189
|
+
const parent = dirname31(dir);
|
|
25092
25190
|
if (parent === dir)
|
|
25093
25191
|
break;
|
|
25094
25192
|
dir = parent;
|
|
@@ -25384,7 +25482,7 @@ import { existsSync as existsSync44 } from "fs";
|
|
|
25384
25482
|
import { mkdir as mkdir12 } from "fs/promises";
|
|
25385
25483
|
import {
|
|
25386
25484
|
basename as basename16,
|
|
25387
|
-
dirname as
|
|
25485
|
+
dirname as dirname32,
|
|
25388
25486
|
isAbsolute as isAbsolute11,
|
|
25389
25487
|
join as join56,
|
|
25390
25488
|
relative as relative25,
|
|
@@ -25472,7 +25570,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25472
25570
|
if (!inline)
|
|
25473
25571
|
pool.warm("vue-sfc");
|
|
25474
25572
|
const runSfc = (input) => pool.run("vue-sfc", input, {
|
|
25475
|
-
affinity:
|
|
25573
|
+
affinity: dirname32(input.sourceFilePath),
|
|
25476
25574
|
inline
|
|
25477
25575
|
});
|
|
25478
25576
|
return runSfc;
|
|
@@ -25534,9 +25632,9 @@ var resolveDevClientDir3 = () => {
|
|
|
25534
25632
|
serverPath
|
|
25535
25633
|
}) => {
|
|
25536
25634
|
await Promise.all([
|
|
25537
|
-
mkdir12(
|
|
25538
|
-
mkdir12(
|
|
25539
|
-
...css ? [mkdir12(
|
|
25635
|
+
mkdir12(dirname32(clientPath), { recursive: true }),
|
|
25636
|
+
mkdir12(dirname32(serverPath), { recursive: true }),
|
|
25637
|
+
...css ? [mkdir12(dirname32(css.path), { recursive: true })] : []
|
|
25540
25638
|
]);
|
|
25541
25639
|
await Promise.all([
|
|
25542
25640
|
write4(clientPath, clientCode),
|
|
@@ -25605,12 +25703,12 @@ var resolveDevClientDir3 = () => {
|
|
|
25605
25703
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
25606
25704
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
25607
25705
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
25608
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path : resolve42(
|
|
25706
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path : resolve42(dirname32(sourceFilePath), path));
|
|
25609
25707
|
for (const stylePath of stylePathsImported) {
|
|
25610
25708
|
addStyleImporter(sourceFilePath, stylePath);
|
|
25611
25709
|
}
|
|
25612
25710
|
const childBuildResults = await Promise.all([
|
|
25613
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve42(
|
|
25711
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve42(dirname32(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
25614
25712
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
25615
25713
|
]);
|
|
25616
25714
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -25679,7 +25777,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25679
25777
|
serverPath: serverOutputPath,
|
|
25680
25778
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
25681
25779
|
tsHelperPaths: [
|
|
25682
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
25780
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname32(sourceFilePath), helper)),
|
|
25683
25781
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
25684
25782
|
]
|
|
25685
25783
|
};
|
|
@@ -25735,7 +25833,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25735
25833
|
});
|
|
25736
25834
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
25737
25835
|
for (const { importPath } of routes) {
|
|
25738
|
-
const childPath = resolve42(
|
|
25836
|
+
const childPath = resolve42(dirname32(entryPath), importPath);
|
|
25739
25837
|
if (expanded.has(childPath) || !existsSync44(childPath)) {
|
|
25740
25838
|
continue;
|
|
25741
25839
|
}
|
|
@@ -25770,14 +25868,14 @@ var resolveDevClientDir3 = () => {
|
|
|
25770
25868
|
const entryBaseName = basename16(entryPath, ".vue");
|
|
25771
25869
|
const indexOutputFile = join56(indexOutputDir, `${entryBaseName}.js`);
|
|
25772
25870
|
const clientOutputFile = result.clientPath;
|
|
25773
|
-
await mkdir12(
|
|
25871
|
+
await mkdir12(dirname32(indexOutputFile), { recursive: true });
|
|
25774
25872
|
const vueHmrImports = isDev ? [
|
|
25775
25873
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
25776
25874
|
`import "${hmrClientPath4}";`
|
|
25777
25875
|
] : [];
|
|
25778
25876
|
await write4(indexOutputFile, [
|
|
25779
25877
|
...vueHmrImports,
|
|
25780
|
-
`import Comp, * as PageModule from "${relative25(
|
|
25878
|
+
`import Comp, * as PageModule from "${relative25(dirname32(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
25781
25879
|
'import { createSSRApp, createApp } from "vue";',
|
|
25782
25880
|
'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
|
|
25783
25881
|
"",
|
|
@@ -25943,7 +26041,7 @@ var resolveDevClientDir3 = () => {
|
|
|
25943
26041
|
}));
|
|
25944
26042
|
vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
|
|
25945
26043
|
stageStartedAt = performance.now();
|
|
25946
|
-
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(
|
|
26044
|
+
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname32(tsPath), dep)).filter((resolved) => existsSync44(resolved) && !allTsHelperPaths.has(resolved));
|
|
25947
26045
|
const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file4(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
|
|
25948
26046
|
const expandHelpers = async (frontier) => {
|
|
25949
26047
|
if (frontier.length === 0)
|
|
@@ -26534,7 +26632,7 @@ __export(exports_compileAngular, {
|
|
|
26534
26632
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
26535
26633
|
});
|
|
26536
26634
|
import { existsSync as existsSync45, readFileSync as readFileSync43, promises as fs5 } from "fs";
|
|
26537
|
-
import { join as join57, basename as basename17, sep as sep10, dirname as
|
|
26635
|
+
import { join as join57, basename as basename17, sep as sep10, dirname as dirname33, resolve as resolve43, relative as relative26 } from "path";
|
|
26538
26636
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
26539
26637
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
26540
26638
|
const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
|
|
@@ -26659,7 +26757,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26659
26757
|
if (scan.usesLegacyAnimations)
|
|
26660
26758
|
return true;
|
|
26661
26759
|
for (const specifier of scan.imports) {
|
|
26662
|
-
const importedPath = resolveLocalImport(specifier,
|
|
26760
|
+
const importedPath = resolveLocalImport(specifier, dirname33(resolved));
|
|
26663
26761
|
if (importedPath && await visit(importedPath, visited)) {
|
|
26664
26762
|
return true;
|
|
26665
26763
|
}
|
|
@@ -26718,7 +26816,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26718
26816
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
26719
26817
|
if (hasJsLikeExtension(path))
|
|
26720
26818
|
return `${path}${query}`;
|
|
26721
|
-
const importerDir =
|
|
26819
|
+
const importerDir = dirname33(importerOutputPath);
|
|
26722
26820
|
const fileCandidate = resolve43(importerDir, `${path}.js`);
|
|
26723
26821
|
if (outputFiles?.has(fileCandidate) || existsSync45(fileCandidate)) {
|
|
26724
26822
|
return `${path}.js${query}`;
|
|
@@ -26751,7 +26849,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26751
26849
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
26752
26850
|
if (!isRelativeModuleSpecifier(specifier))
|
|
26753
26851
|
return null;
|
|
26754
|
-
const basePath = resolve43(
|
|
26852
|
+
const basePath = resolve43(dirname33(fromFile), specifier);
|
|
26755
26853
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
26756
26854
|
`${basePath}.ts`,
|
|
26757
26855
|
`${basePath}.tsx`,
|
|
@@ -26809,13 +26907,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26809
26907
|
return null;
|
|
26810
26908
|
}
|
|
26811
26909
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
26812
|
-
await fs5.mkdir(
|
|
26910
|
+
await fs5.mkdir(dirname33(cachePath), { recursive: true });
|
|
26813
26911
|
await writeTextFileAtomically(cachePath, JSON.stringify({
|
|
26814
26912
|
source,
|
|
26815
26913
|
version: 1
|
|
26816
26914
|
}));
|
|
26817
26915
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
26818
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
26916
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname33(filePath));
|
|
26819
26917
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
26820
26918
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
26821
26919
|
return `${resourcePath}\x00${content}`;
|
|
@@ -26855,7 +26953,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26855
26953
|
transformedSource = cached.source;
|
|
26856
26954
|
} else {
|
|
26857
26955
|
stats.cacheMisses += 1;
|
|
26858
|
-
const transformed = await inlineResources(source,
|
|
26956
|
+
const transformed = await inlineResources(source, dirname33(resolvedPath), stylePreprocessors);
|
|
26859
26957
|
transformedSource = transformed.source;
|
|
26860
26958
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
26861
26959
|
}
|
|
@@ -26884,7 +26982,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26884
26982
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
26885
26983
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
26886
26984
|
const tsPath = __require.resolve("typescript");
|
|
26887
|
-
const tsRootDir =
|
|
26985
|
+
const tsRootDir = dirname33(tsPath);
|
|
26888
26986
|
return tsRootDir.endsWith("lib") ? tsRootDir : resolve43(tsRootDir, "lib");
|
|
26889
26987
|
});
|
|
26890
26988
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
@@ -26999,7 +27097,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
26999
27097
|
});
|
|
27000
27098
|
});
|
|
27001
27099
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
27002
|
-
await fs5.mkdir(
|
|
27100
|
+
await fs5.mkdir(dirname33(target), { recursive: true });
|
|
27003
27101
|
await writeTextFileAtomically(target, content);
|
|
27004
27102
|
})), { outputs: entries.length });
|
|
27005
27103
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -27356,7 +27454,7 @@ ${fields}
|
|
|
27356
27454
|
}
|
|
27357
27455
|
};
|
|
27358
27456
|
const toOutputPath = (sourcePath) => {
|
|
27359
|
-
const inputDir =
|
|
27457
|
+
const inputDir = dirname33(sourcePath);
|
|
27360
27458
|
const fileBase = basename17(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27361
27459
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep10}`)) {
|
|
27362
27460
|
return join57(inputDir, fileBase);
|
|
@@ -27410,7 +27508,7 @@ ${fields}
|
|
|
27410
27508
|
return;
|
|
27411
27509
|
visited.add(resolved);
|
|
27412
27510
|
if (resolved.endsWith(".json") && existsSync45(resolved)) {
|
|
27413
|
-
const inputDir =
|
|
27511
|
+
const inputDir = dirname33(resolved);
|
|
27414
27512
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
27415
27513
|
const targetDir = join57(outDir, relativeDir);
|
|
27416
27514
|
const targetPath = join57(targetDir, basename17(resolved));
|
|
@@ -27425,12 +27523,12 @@ ${fields}
|
|
|
27425
27523
|
if (!existsSync45(actualPath))
|
|
27426
27524
|
return;
|
|
27427
27525
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
27428
|
-
const inlined = await inlineResources(sourceCode,
|
|
27429
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
27430
|
-
const inputDir =
|
|
27526
|
+
const inlined = await inlineResources(sourceCode, dirname33(actualPath), stylePreprocessors);
|
|
27527
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname33(actualPath)).source;
|
|
27528
|
+
const inputDir = dirname33(actualPath);
|
|
27431
27529
|
const fileBase = basename17(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27432
27530
|
const targetPath = toOutputPath(actualPath);
|
|
27433
|
-
const targetDir =
|
|
27531
|
+
const targetDir = dirname33(targetPath);
|
|
27434
27532
|
const relativeDir = relative26(outDir, targetDir).replace(/\\/g, "/");
|
|
27435
27533
|
const localImports = [];
|
|
27436
27534
|
const importRewrites = new Map;
|
|
@@ -27544,7 +27642,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
27544
27642
|
const sourcePath = join57(angularSrcDir, rel);
|
|
27545
27643
|
const cwdRel = relative26(cwd, sourcePath);
|
|
27546
27644
|
const targetPath = join57(compiledRoot, cwdRel);
|
|
27547
|
-
await fs5.mkdir(
|
|
27645
|
+
await fs5.mkdir(dirname33(targetPath), { recursive: true });
|
|
27548
27646
|
await fs5.copyFile(sourcePath, targetPath);
|
|
27549
27647
|
}
|
|
27550
27648
|
});
|
|
@@ -27653,7 +27751,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
27653
27751
|
return join57(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
27654
27752
|
})();
|
|
27655
27753
|
const appProvidersSpec = (() => {
|
|
27656
|
-
const rel = relative26(
|
|
27754
|
+
const rel = relative26(dirname33(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
27657
27755
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
27658
27756
|
})();
|
|
27659
27757
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -27693,7 +27791,7 @@ import '@angular/compiler';
|
|
|
27693
27791
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
27694
27792
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
27695
27793
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
27696
|
-
import { ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
|
|
27794
|
+
import { ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
|
|
27697
27795
|
import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
|
|
27698
27796
|
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
27699
27797
|
import * as pageModule from '${normalizedImportPath}';
|
|
@@ -27710,6 +27808,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
|
|
|
27710
27808
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
27711
27809
|
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
27712
27810
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
27811
|
+
// Under secureHeaders() the policy only allows <style> elements that carry
|
|
27812
|
+
// the page's nonce. Angular adds one for every component it renders or
|
|
27813
|
+
// hot-updates in the browser, so hand it the nonce the server put on the
|
|
27814
|
+
// page (browsers hide the attribute's value; the property keeps it).
|
|
27815
|
+
var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
|
|
27816
|
+
if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
|
|
27713
27817
|
// Page-level providers are injected directly into the page module's
|
|
27714
27818
|
// server output by \`compileAngular\`'s providers-injection step
|
|
27715
27819
|
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
@@ -27813,7 +27917,7 @@ ${zoneImport}import '@angular/compiler';
|
|
|
27813
27917
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
27814
27918
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
27815
27919
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
27816
|
-
import { enableProdMode, ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
|
|
27920
|
+
import { enableProdMode, ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
|
|
27817
27921
|
import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
|
|
27818
27922
|
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
27819
27923
|
import * as pageModule from '${normalizedImportPath}';
|
|
@@ -27830,6 +27934,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
|
|
|
27830
27934
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
27831
27935
|
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
27832
27936
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
27937
|
+
// Under secureHeaders() the policy only allows <style> elements that carry
|
|
27938
|
+
// the page's nonce. Angular adds one for every component it renders or
|
|
27939
|
+
// hot-updates in the browser, so hand it the nonce the server put on the
|
|
27940
|
+
// page (browsers hide the attribute's value; the property keeps it).
|
|
27941
|
+
var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
|
|
27942
|
+
if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
|
|
27833
27943
|
// Page-level providers are injected directly into the page module's
|
|
27834
27944
|
// server output by \`compileAngular\`'s providers-injection step
|
|
27835
27945
|
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
@@ -28383,7 +28493,7 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
28383
28493
|
// src/build/compileEmber.ts
|
|
28384
28494
|
import { existsSync as existsSync46 } from "fs";
|
|
28385
28495
|
import { mkdir as mkdir13, rm as rm10 } from "fs/promises";
|
|
28386
|
-
import { basename as basename18, dirname as
|
|
28496
|
+
import { basename as basename18, dirname as dirname34, extname as extname17, join as join58, resolve as resolve44 } from "path";
|
|
28387
28497
|
var {build: bunBuild3, Transpiler: Transpiler6, write: write5, file: file5 } = globalThis.Bun;
|
|
28388
28498
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
28389
28499
|
if (cachedPreprocessor)
|
|
@@ -28479,7 +28589,7 @@ export const importSync = (specifier) => {
|
|
|
28479
28589
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
28480
28590
|
if (!originalImporter)
|
|
28481
28591
|
return;
|
|
28482
|
-
const candidateBase = resolve44(
|
|
28592
|
+
const candidateBase = resolve44(dirname34(originalImporter), args.path);
|
|
28483
28593
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
28484
28594
|
for (const ext of extensionsToTry) {
|
|
28485
28595
|
const candidate = candidateBase + ext;
|
|
@@ -29092,12 +29202,12 @@ import {
|
|
|
29092
29202
|
readFileSync as readFileSync44,
|
|
29093
29203
|
renameSync,
|
|
29094
29204
|
rmSync as rmSync2,
|
|
29095
|
-
statSync as
|
|
29205
|
+
statSync as statSync7,
|
|
29096
29206
|
writeFileSync as writeFileSync16
|
|
29097
29207
|
} from "fs";
|
|
29098
29208
|
import {
|
|
29099
29209
|
basename as basename19,
|
|
29100
|
-
dirname as
|
|
29210
|
+
dirname as dirname35,
|
|
29101
29211
|
extname as extname18,
|
|
29102
29212
|
join as join63,
|
|
29103
29213
|
relative as relative27,
|
|
@@ -29304,7 +29414,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29304
29414
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
29305
29415
|
const absPath = resolve46(file, "..", relPath);
|
|
29306
29416
|
try {
|
|
29307
|
-
|
|
29417
|
+
statSync7(absPath);
|
|
29308
29418
|
workerPaths.add(absPath);
|
|
29309
29419
|
} catch {}
|
|
29310
29420
|
}, extractWorkerSpecifiers = (file, patterns) => {
|
|
@@ -29449,7 +29559,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29449
29559
|
for (const srcPath of urlReferencedFiles) {
|
|
29450
29560
|
const rel = relative27(projectRoot, srcPath).replace(/\\/g, "/");
|
|
29451
29561
|
const name = basename19(srcPath);
|
|
29452
|
-
const mtime = Math.round(
|
|
29562
|
+
const mtime = Math.round(statSync7(srcPath).mtimeMs);
|
|
29453
29563
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
29454
29564
|
urlFileMap.set(name, url);
|
|
29455
29565
|
urlFileMap.set(name.replace(/\.tsx?$/, ".js"), url);
|
|
@@ -29693,7 +29803,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
29693
29803
|
const sourceClientRoots = [
|
|
29694
29804
|
htmlDir,
|
|
29695
29805
|
htmxDir,
|
|
29696
|
-
islandBootstrapPath &&
|
|
29806
|
+
islandBootstrapPath && dirname35(islandBootstrapPath)
|
|
29697
29807
|
].filter((dir) => Boolean(dir));
|
|
29698
29808
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
29699
29809
|
if (usesGenerated)
|
|
@@ -30149,7 +30259,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30149
30259
|
stylePreprocessorPlugin,
|
|
30150
30260
|
createBunStringRawUnicodePlugin()
|
|
30151
30261
|
],
|
|
30152
|
-
root:
|
|
30262
|
+
root: dirname35(source),
|
|
30153
30263
|
target: "bun",
|
|
30154
30264
|
throw: false,
|
|
30155
30265
|
...projectTsconfig()
|
|
@@ -30242,7 +30352,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30242
30352
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
30243
30353
|
];
|
|
30244
30354
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
30245
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
30355
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname35(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file) => dirname35(file)), projectRoot);
|
|
30246
30356
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
30247
30357
|
buildInfo: islandBuildInfo,
|
|
30248
30358
|
buildPath,
|
|
@@ -30676,7 +30786,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30676
30786
|
if (serverOutputs.length > 0 && angularServerVendorPaths && Object.keys(angularServerVendorPaths).length > 0) {
|
|
30677
30787
|
await Promise.resolve().then(() => init_rewriteImportsPlugin());
|
|
30678
30788
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith(serverOutputs, (artifact) => {
|
|
30679
|
-
const fileDir =
|
|
30789
|
+
const fileDir = dirname35(artifact.path);
|
|
30680
30790
|
const relativePaths = {};
|
|
30681
30791
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths)) {
|
|
30682
30792
|
const rel = relative27(fileDir, absolute);
|
|
@@ -30909,9 +31019,18 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
30909
31019
|
recordManifestKey(basename19(htmxFile, ".html"), htmxFile, join63(htmxPagesPath, relative27(outputHtmxPages, htmxFile)));
|
|
30910
31020
|
}
|
|
30911
31021
|
};
|
|
31022
|
+
const processStaticConventions = async () => {
|
|
31023
|
+
const conventionDirs = ["html", "htmx"].filter((framework) => conventionsMap[framework]).map((framework) => join63(buildPath, "conventions", framework)).filter((dir) => existsSync48(dir));
|
|
31024
|
+
await Promise.all(conventionDirs.map(async (dir) => {
|
|
31025
|
+
await updateAssetPaths(manifest, dir);
|
|
31026
|
+
if (fonts && fonts.injectHtml !== false)
|
|
31027
|
+
await injectFontTags(dir, fontAssets(manifest));
|
|
31028
|
+
}));
|
|
31029
|
+
};
|
|
30912
31030
|
await Promise.all([
|
|
30913
31031
|
tracePhase("postprocess/html-pages", processHtmlPages),
|
|
30914
|
-
tracePhase("postprocess/htmx-pages", processHtmxPages)
|
|
31032
|
+
tracePhase("postprocess/htmx-pages", processHtmxPages),
|
|
31033
|
+
tracePhase("postprocess/static-conventions", processStaticConventions)
|
|
30915
31034
|
]);
|
|
30916
31035
|
if (manifestKeyCollisions.length > 0) {
|
|
30917
31036
|
const message = formatManifestKeyCollisions(manifestKeyCollisions, projectRoot);
|
|
@@ -31781,7 +31900,7 @@ var init_clientManager = __esm(() => {
|
|
|
31781
31900
|
|
|
31782
31901
|
// src/dev/pathUtils.ts
|
|
31783
31902
|
import { existsSync as existsSync51, readdirSync as readdirSync8, readFileSync as readFileSync47 } from "fs";
|
|
31784
|
-
import { dirname as
|
|
31903
|
+
import { dirname as dirname36, resolve as resolve49 } from "path";
|
|
31785
31904
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
31786
31905
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
31787
31906
|
return "ignored";
|
|
@@ -31914,10 +32033,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
31914
32033
|
refs.push(strMatch[1]);
|
|
31915
32034
|
}
|
|
31916
32035
|
}
|
|
31917
|
-
const componentDir =
|
|
32036
|
+
const componentDir = dirname36(full);
|
|
31918
32037
|
for (const ref of refs) {
|
|
31919
32038
|
const refAbs = normalizePath2(resolve49(componentDir, ref));
|
|
31920
|
-
const refDir = normalizePath2(
|
|
32039
|
+
const refDir = normalizePath2(dirname36(refAbs));
|
|
31921
32040
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
31922
32041
|
continue;
|
|
31923
32042
|
}
|
|
@@ -31979,6 +32098,13 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
31979
32098
|
}
|
|
31980
32099
|
} catch {}
|
|
31981
32100
|
}
|
|
32101
|
+
const registryPath = config.islands?.registry;
|
|
32102
|
+
if (registryPath) {
|
|
32103
|
+
const registryDir = normalizePath2(dirname36(resolve49(cwd, registryPath)));
|
|
32104
|
+
const isWatched = roots.some((root) => registryDir === root || registryDir.startsWith(`${root}/`));
|
|
32105
|
+
if (!isWatched && registryDir !== normalizePath2(cwd))
|
|
32106
|
+
push(registryDir);
|
|
32107
|
+
}
|
|
31982
32108
|
const extraDirs = config.dev?.watchDirs ?? [];
|
|
31983
32109
|
for (const dir of extraDirs)
|
|
31984
32110
|
push(dir);
|
|
@@ -32157,8 +32283,8 @@ var init_editorTempFiles = __esm(() => {
|
|
|
32157
32283
|
|
|
32158
32284
|
// src/dev/fileWatcher.ts
|
|
32159
32285
|
import { watch } from "fs";
|
|
32160
|
-
import { existsSync as existsSync53, readdirSync as readdirSync10, statSync as
|
|
32161
|
-
import { dirname as
|
|
32286
|
+
import { existsSync as existsSync53, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
|
|
32287
|
+
import { dirname as dirname37, join as join67, resolve as resolve50 } from "path";
|
|
32162
32288
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
32163
32289
|
try {
|
|
32164
32290
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -32195,7 +32321,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32195
32321
|
continue;
|
|
32196
32322
|
let st;
|
|
32197
32323
|
try {
|
|
32198
|
-
st =
|
|
32324
|
+
st = statSync8(child);
|
|
32199
32325
|
} catch {
|
|
32200
32326
|
continue;
|
|
32201
32327
|
}
|
|
@@ -32213,7 +32339,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32213
32339
|
return;
|
|
32214
32340
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
32215
32341
|
if (event === "rename") {
|
|
32216
|
-
const eventDir =
|
|
32342
|
+
const eventDir = dirname37(join67(absolutePath, filename)).replace(/\\/g, "/");
|
|
32217
32343
|
atomicRecoveryScan(eventDir);
|
|
32218
32344
|
for (const delay of [25, 100]) {
|
|
32219
32345
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -32259,7 +32385,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
32259
32385
|
];
|
|
32260
32386
|
const fingerprint = (name) => {
|
|
32261
32387
|
try {
|
|
32262
|
-
const value =
|
|
32388
|
+
const value = statSync8(join67(root, name));
|
|
32263
32389
|
return value.isFile() ? `${value.ino}:${value.size}:${value.mtimeMs}:${value.ctimeMs}` : null;
|
|
32264
32390
|
} catch {
|
|
32265
32391
|
return null;
|
|
@@ -32326,9 +32452,9 @@ var init_fileWatcher = __esm(() => {
|
|
|
32326
32452
|
});
|
|
32327
32453
|
|
|
32328
32454
|
// src/build/svelteDeclarations.ts
|
|
32329
|
-
import { existsSync as existsSync54, readdirSync as readdirSync11, readFileSync as readFileSync48, statSync as
|
|
32455
|
+
import { existsSync as existsSync54, readdirSync as readdirSync11, readFileSync as readFileSync48, statSync as statSync9 } from "fs";
|
|
32330
32456
|
import { mkdir as mkdir15, rename as rename5, rm as rm16, writeFile as writeFile14 } from "fs/promises";
|
|
32331
|
-
import { dirname as
|
|
32457
|
+
import { dirname as dirname38, join as join68, relative as relative28, resolve as resolve51 } from "path";
|
|
32332
32458
|
var SVELTE_DECLARATIONS_ROOT = ".absolutejs/types/svelte", FINGERPRINT_FILE = ".fingerprint", SKIPPED_DIRECTORIES, EMIT_SCRIPT = `
|
|
32333
32459
|
const { resolve, sep } = require('node:path');
|
|
32334
32460
|
const { shimsPath, stagingDir, svelte2tsxPath, svelteDir, tsconfigPath, typescriptPath } =
|
|
@@ -32384,10 +32510,10 @@ emitDts({
|
|
|
32384
32510
|
return SKIPPED_DIRECTORIES.has(entry.name) ? [] : collectInputs(path);
|
|
32385
32511
|
if (!DECLARATION_INPUT.test(entry.name))
|
|
32386
32512
|
return [];
|
|
32387
|
-
const { mtimeMs, size } =
|
|
32513
|
+
const { mtimeMs, size } = statSync9(path);
|
|
32388
32514
|
return [`${path}\x00${mtimeMs}\x00${size}`];
|
|
32389
32515
|
}), fingerprintOf = (svelteDir, tsconfigPath, svelte2tsxPath) => {
|
|
32390
|
-
const svelte2tsxManifest = join68(
|
|
32516
|
+
const svelte2tsxManifest = join68(dirname38(svelte2tsxPath), "package.json");
|
|
32391
32517
|
const inputs = [
|
|
32392
32518
|
...collectInputs(svelteDir).sort(),
|
|
32393
32519
|
readFileSync48(tsconfigPath, "utf-8"),
|
|
@@ -32414,7 +32540,7 @@ emitDts({
|
|
|
32414
32540
|
const shimsPath = resolveFrom("svelte2tsx/svelte-shims-v4.d.ts", projectRoot);
|
|
32415
32541
|
if (!svelte2tsxPath || !shimsPath)
|
|
32416
32542
|
return { reason: "svelte2tsx is not installed", status: "unavailable" };
|
|
32417
|
-
const typescriptPath = resolveFrom("typescript",
|
|
32543
|
+
const typescriptPath = resolveFrom("typescript", dirname38(svelte2tsxPath));
|
|
32418
32544
|
if (!typescriptPath)
|
|
32419
32545
|
return { reason: "typescript is not installed", status: "unavailable" };
|
|
32420
32546
|
const outDir = join68(projectRoot, SVELTE_DECLARATIONS_ROOT, relative28(projectRoot, svelteDir));
|
|
@@ -32442,7 +32568,7 @@ emitDts({
|
|
|
32442
32568
|
}
|
|
32443
32569
|
await mkdir15(stagingDir, { recursive: true });
|
|
32444
32570
|
await writeFile14(join68(stagingDir, FINGERPRINT_FILE), fingerprint);
|
|
32445
|
-
await mkdir15(
|
|
32571
|
+
await mkdir15(dirname38(outDir), { recursive: true });
|
|
32446
32572
|
await rm16(outDir, { force: true, recursive: true });
|
|
32447
32573
|
await rename5(stagingDir, outDir);
|
|
32448
32574
|
return {
|
|
@@ -32673,19 +32799,25 @@ var init_assetStore = __esm(() => {
|
|
|
32673
32799
|
});
|
|
32674
32800
|
|
|
32675
32801
|
// src/dev/restartScope.ts
|
|
32676
|
-
import { realpathSync as realpathSync7 } from "fs";
|
|
32802
|
+
import { realpathSync as realpathSync7, statSync as statSync10 } from "fs";
|
|
32677
32803
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
32678
32804
|
try {
|
|
32679
32805
|
return realpathSync7(path);
|
|
32680
32806
|
} catch {
|
|
32681
32807
|
return path;
|
|
32682
32808
|
}
|
|
32809
|
+
}, isDirectory = (path) => {
|
|
32810
|
+
try {
|
|
32811
|
+
return statSync10(path).isDirectory();
|
|
32812
|
+
} catch {
|
|
32813
|
+
return false;
|
|
32814
|
+
}
|
|
32683
32815
|
}, isLoadedByThisProcess = (path) => (path in __require.cache) || (realPath(path) in __require.cache), changeNeedsRestart = (path, isLoaded = isLoadedByThisProcess) => {
|
|
32684
32816
|
if (DOCUMENT_FILE.test(path) || isTestSourcePath(path))
|
|
32685
32817
|
return false;
|
|
32686
32818
|
if (MODULE_FILE.test(path))
|
|
32687
32819
|
return isLoaded(path);
|
|
32688
|
-
return
|
|
32820
|
+
return !isDirectory(path);
|
|
32689
32821
|
};
|
|
32690
32822
|
var init_restartScope = __esm(() => {
|
|
32691
32823
|
MODULE_FILE = /\.(?:[cm]?[jt]sx?|mts|cts)$/;
|
|
@@ -32693,7 +32825,7 @@ var init_restartScope = __esm(() => {
|
|
|
32693
32825
|
});
|
|
32694
32826
|
|
|
32695
32827
|
// src/dev/fileHashTracker.ts
|
|
32696
|
-
import { readFileSync as readFileSync49, statSync as
|
|
32828
|
+
import { readFileSync as readFileSync49, statSync as statSync11 } from "fs";
|
|
32697
32829
|
var computeFileHash = (filePath) => {
|
|
32698
32830
|
try {
|
|
32699
32831
|
const fileContent = readFileSync49(filePath);
|
|
@@ -32712,7 +32844,7 @@ var computeFileHash = (filePath) => {
|
|
|
32712
32844
|
if (previousHashes.has(normalizePath2(filePath)))
|
|
32713
32845
|
return false;
|
|
32714
32846
|
try {
|
|
32715
|
-
return
|
|
32847
|
+
return statSync11(filePath).mtimeMs < processStart;
|
|
32716
32848
|
} catch {
|
|
32717
32849
|
return false;
|
|
32718
32850
|
}
|
|
@@ -32942,7 +33074,7 @@ var init_reactServerComponentsRebuild = __esm(() => {
|
|
|
32942
33074
|
|
|
32943
33075
|
// src/utils/spaRouteCss.ts
|
|
32944
33076
|
import { readFile as readFile10 } from "fs/promises";
|
|
32945
|
-
import { dirname as
|
|
33077
|
+
import { dirname as dirname39, isAbsolute as isAbsolute12, resolve as resolve57 } from "path";
|
|
32946
33078
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
32947
33079
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
32948
33080
|
if (cached !== undefined)
|
|
@@ -32980,7 +33112,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
32980
33112
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
32981
33113
|
if (!cssPath)
|
|
32982
33114
|
return "";
|
|
32983
|
-
const resolvedCssPath = isAbsolute12(cssPath) ? cssPath : resolve57(
|
|
33115
|
+
const resolvedCssPath = isAbsolute12(cssPath) ? cssPath : resolve57(dirname39(sideManifestPath), cssPath);
|
|
32984
33116
|
const cached = childCssCache.get(resolvedCssPath);
|
|
32985
33117
|
if (cached !== undefined)
|
|
32986
33118
|
return cached;
|
|
@@ -33064,8 +33196,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
33064
33196
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
33065
33197
|
resolveOwningComponents: () => resolveOwningComponents
|
|
33066
33198
|
});
|
|
33067
|
-
import { readdirSync as readdirSync12, readFileSync as readFileSync50, statSync as
|
|
33068
|
-
import { dirname as
|
|
33199
|
+
import { readdirSync as readdirSync12, readFileSync as readFileSync50, statSync as statSync12 } from "fs";
|
|
33200
|
+
import { dirname as dirname40, extname as extname19, join as join69, resolve as resolve58 } from "path";
|
|
33069
33201
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
33070
33202
|
const out = [];
|
|
33071
33203
|
const visit = (dir) => {
|
|
@@ -33198,7 +33330,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33198
33330
|
}
|
|
33199
33331
|
let rootStat;
|
|
33200
33332
|
try {
|
|
33201
|
-
rootStat =
|
|
33333
|
+
rootStat = statSync12(userAngularRoot);
|
|
33202
33334
|
} catch {
|
|
33203
33335
|
return out;
|
|
33204
33336
|
}
|
|
@@ -33218,7 +33350,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33218
33350
|
return null;
|
|
33219
33351
|
}
|
|
33220
33352
|
const sourceFile = lazyTypescript.createSourceFile(childFilePath, source, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
|
|
33221
|
-
const childDir =
|
|
33353
|
+
const childDir = dirname40(childFilePath);
|
|
33222
33354
|
for (const stmt of sourceFile.statements) {
|
|
33223
33355
|
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
33224
33356
|
continue;
|
|
@@ -33256,7 +33388,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33256
33388
|
const angularRootNorm = safeNormalize(angularRoot);
|
|
33257
33389
|
for (const candidate of candidates) {
|
|
33258
33390
|
try {
|
|
33259
|
-
if (
|
|
33391
|
+
if (statSync12(candidate).isFile()) {
|
|
33260
33392
|
const norm = safeNormalize(candidate);
|
|
33261
33393
|
if (!norm.startsWith(angularRootNorm))
|
|
33262
33394
|
return null;
|
|
@@ -33275,7 +33407,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33275
33407
|
const parentFile = new Map;
|
|
33276
33408
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
33277
33409
|
const classes = parseDecoratedClasses(tsPath);
|
|
33278
|
-
const componentDir =
|
|
33410
|
+
const componentDir = dirname40(tsPath);
|
|
33279
33411
|
for (const cls of classes) {
|
|
33280
33412
|
const entity = {
|
|
33281
33413
|
className: cls.className,
|
|
@@ -33313,7 +33445,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
33313
33445
|
const norm = safeNormalize(params.changedFilePath);
|
|
33314
33446
|
let rootStat;
|
|
33315
33447
|
try {
|
|
33316
|
-
rootStat =
|
|
33448
|
+
rootStat = statSync12(params.userAngularRoot);
|
|
33317
33449
|
} catch {
|
|
33318
33450
|
return [];
|
|
33319
33451
|
}
|
|
@@ -33547,8 +33679,8 @@ __export(exports_moduleServer, {
|
|
|
33547
33679
|
warmPage: () => warmPage,
|
|
33548
33680
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
33549
33681
|
});
|
|
33550
|
-
import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as realpathSync8, statSync as
|
|
33551
|
-
import { basename as basename21, dirname as
|
|
33682
|
+
import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as realpathSync8, statSync as statSync13 } from "fs";
|
|
33683
|
+
import { basename as basename21, dirname as dirname41, extname as extname20, join as join70, resolve as resolve59, relative as relative30 } from "path";
|
|
33552
33684
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
33553
33685
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
33554
33686
|
const allExports = [];
|
|
@@ -33605,7 +33737,7 @@ ${stubs}
|
|
|
33605
33737
|
if (cached !== undefined)
|
|
33606
33738
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
33607
33739
|
try {
|
|
33608
|
-
const mtime = Math.round(
|
|
33740
|
+
const mtime = Math.round(statSync13(absPath).mtimeMs);
|
|
33609
33741
|
mtimeCache.set(absPath, mtime);
|
|
33610
33742
|
return `${base}?v=${buildVersion(mtime, absPath)}`;
|
|
33611
33743
|
} catch {
|
|
@@ -33682,7 +33814,7 @@ ${stubs}
|
|
|
33682
33814
|
};
|
|
33683
33815
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
33684
33816
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
33685
|
-
const fileDir =
|
|
33817
|
+
const fileDir = dirname41(filePath);
|
|
33686
33818
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
33687
33819
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
33688
33820
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -33922,7 +34054,7 @@ ${code}`;
|
|
|
33922
34054
|
if (compiled.css?.code) {
|
|
33923
34055
|
const cssPath = `${filePath}.css`;
|
|
33924
34056
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
33925
|
-
const cssUrl =
|
|
34057
|
+
const cssUrl = `${SRC_PREFIX}${encodeSrcPath(relative30(projectRoot, cssPath))}?v=${Bun.hash(compiled.css.code).toString(BASE_36_RADIX)}`;
|
|
33926
34058
|
code = `import "${cssUrl}";
|
|
33927
34059
|
${code}`;
|
|
33928
34060
|
}
|
|
@@ -33931,7 +34063,7 @@ ${code}`;
|
|
|
33931
34063
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
33932
34064
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
33933
34065
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
33934
|
-
}, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(resolve59(
|
|
34066
|
+
}, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(resolve59(dirname41(filePath), spec))).map((spec) => lazyModuleRegistration(relative30(projectRoot, resolve59(dirname41(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
33935
34067
|
const raw = readFileSync51(filePath, "utf-8");
|
|
33936
34068
|
if (!svelteCompiler) {
|
|
33937
34069
|
svelteCompiler = await import("svelte/compiler");
|
|
@@ -34250,7 +34382,7 @@ export default {};
|
|
|
34250
34382
|
return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
34251
34383
|
if (!TRANSPILABLE.has(ext))
|
|
34252
34384
|
return;
|
|
34253
|
-
const stat =
|
|
34385
|
+
const stat = statSync13(filePath);
|
|
34254
34386
|
const resolvedVueDir = vueDir ? resolve59(vueDir) : undefined;
|
|
34255
34387
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
34256
34388
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
@@ -34278,12 +34410,12 @@ export default {};
|
|
|
34278
34410
|
cachedAngularUserRoot = configuredAngularUserRoot ?? null;
|
|
34279
34411
|
return cachedAngularUserRoot;
|
|
34280
34412
|
}, configuredAngularUserRoot, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
34281
|
-
const stat =
|
|
34413
|
+
const stat = statSync13(filePath);
|
|
34282
34414
|
const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
|
|
34283
34415
|
setTransformed(filePath, content, stat.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
34284
34416
|
return jsResponse(content);
|
|
34285
34417
|
}, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
34286
|
-
const stat =
|
|
34418
|
+
const stat = statSync13(filePath);
|
|
34287
34419
|
const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
34288
34420
|
setTransformed(filePath, content, stat.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
34289
34421
|
return jsResponse(content);
|
|
@@ -34587,7 +34719,7 @@ var init_rewriteImports = __esm(() => {
|
|
|
34587
34719
|
});
|
|
34588
34720
|
|
|
34589
34721
|
// src/dev/angular/hmrCompiler.ts
|
|
34590
|
-
import { dirname as
|
|
34722
|
+
import { dirname as dirname42, relative as relative31, resolve as resolve60 } from "path";
|
|
34591
34723
|
import { performance as performance2 } from "perf_hooks";
|
|
34592
34724
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
34593
34725
|
const projectRel = relative31(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -34610,7 +34742,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
34610
34742
|
await Promise.resolve().then(() => init_resolveOwningComponents());
|
|
34611
34743
|
const owners = resolveOwningComponents({
|
|
34612
34744
|
changedFilePath: componentFilePath,
|
|
34613
|
-
userAngularRoot:
|
|
34745
|
+
userAngularRoot: dirname42(componentFilePath)
|
|
34614
34746
|
});
|
|
34615
34747
|
const owner = owners.find((o) => o.className === className);
|
|
34616
34748
|
const kind = owner?.kind ?? "component";
|
|
@@ -34746,8 +34878,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
34746
34878
|
var init_simpleHTMXHMR = () => {};
|
|
34747
34879
|
|
|
34748
34880
|
// src/dev/backendGraph.ts
|
|
34749
|
-
import { readFileSync as readFileSync52, realpathSync as realpathSync9, statSync as
|
|
34750
|
-
import { dirname as
|
|
34881
|
+
import { readFileSync as readFileSync52, realpathSync as realpathSync9, statSync as statSync14 } from "fs";
|
|
34882
|
+
import { dirname as dirname43, extname as extname21, resolve as resolve63 } from "path";
|
|
34751
34883
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
34752
34884
|
const loader = LOADERS[extname21(path)] ?? "ts";
|
|
34753
34885
|
const existing = transpilers.get(loader);
|
|
@@ -34764,14 +34896,14 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
34764
34896
|
}
|
|
34765
34897
|
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve63(path).startsWith(resolve63(root)), resolveImport = (specifier, fromFile) => {
|
|
34766
34898
|
try {
|
|
34767
|
-
return realPath2(Bun.resolveSync(specifier,
|
|
34899
|
+
return realPath2(Bun.resolveSync(specifier, dirname43(fromFile)));
|
|
34768
34900
|
} catch {
|
|
34769
34901
|
return;
|
|
34770
34902
|
}
|
|
34771
34903
|
}, readImports = (path) => {
|
|
34772
34904
|
let mtimeMs;
|
|
34773
34905
|
try {
|
|
34774
|
-
({ mtimeMs } =
|
|
34906
|
+
({ mtimeMs } = statSync14(path));
|
|
34775
34907
|
} catch {
|
|
34776
34908
|
fileCache.delete(path);
|
|
34777
34909
|
return [];
|
|
@@ -34823,7 +34955,7 @@ var init_backendGraph = __esm(() => {
|
|
|
34823
34955
|
});
|
|
34824
34956
|
|
|
34825
34957
|
// src/dev/hot/analyze.ts
|
|
34826
|
-
import { dirname as
|
|
34958
|
+
import { dirname as dirname44, extname as extname22 } from "path";
|
|
34827
34959
|
var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
|
|
34828
34960
|
switch (extname22(path)) {
|
|
34829
34961
|
case ".tsx":
|
|
@@ -35581,7 +35713,7 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
|
|
|
35581
35713
|
return analysis;
|
|
35582
35714
|
}, resolveFrom2 = (fromFile, isManaged) => (specifier) => {
|
|
35583
35715
|
try {
|
|
35584
|
-
const resolved = Bun.resolveSync(specifier,
|
|
35716
|
+
const resolved = Bun.resolveSync(specifier, dirname44(fromFile));
|
|
35585
35717
|
return isManaged(resolved) ? resolved : undefined;
|
|
35586
35718
|
} catch {
|
|
35587
35719
|
return;
|
|
@@ -35789,7 +35921,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
35789
35921
|
if (typeof namespace !== "object" || namespace === null)
|
|
35790
35922
|
throw new Error(`${path} did not evaluate to a module`);
|
|
35791
35923
|
return Object.fromEntries(Object.entries(namespace));
|
|
35792
|
-
}, display = (path) => relative33(process.cwd(), path) || path, SLOW_UPDATE_MS = 500, SLOWEST_SHOWN = 3, statementLabel = (id) => {
|
|
35924
|
+
}, isMissingFile3 = (error) => error instanceof Error && ("code" in error) && error.code === "ENOENT", display = (path) => relative33(process.cwd(), path) || path, SLOW_UPDATE_MS = 500, SLOWEST_SHOWN = 3, statementLabel = (id) => {
|
|
35793
35925
|
const name = id.slice(id.indexOf(":") + 1);
|
|
35794
35926
|
return /^\d+$/.test(name) ? `statement #${name}` : name;
|
|
35795
35927
|
}, slowestStatements = (modules) => modules.flatMap((module) => [...moduleRecord(module)?.lastTimings ?? []].map(([id, duration]) => ({
|
|
@@ -35832,6 +35964,8 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
35832
35964
|
try {
|
|
35833
35965
|
source = readFileSync54(path, "utf-8");
|
|
35834
35966
|
} catch (error) {
|
|
35967
|
+
if (isMissingFile3(error))
|
|
35968
|
+
return { status: "unchanged" };
|
|
35835
35969
|
reportFailure(path, error);
|
|
35836
35970
|
return { error, status: "failed" };
|
|
35837
35971
|
}
|
|
@@ -35939,10 +36073,10 @@ var init_reload = __esm(() => {
|
|
|
35939
36073
|
});
|
|
35940
36074
|
|
|
35941
36075
|
// src/dev/rebuildTrigger.ts
|
|
35942
|
-
import { existsSync as existsSync56, readdirSync as readdirSync13, rmSync as rmSync4, statSync as
|
|
36076
|
+
import { existsSync as existsSync56, readdirSync as readdirSync13, rmSync as rmSync4, statSync as statSync15 } from "fs";
|
|
35943
36077
|
import {
|
|
35944
36078
|
basename as basename22,
|
|
35945
|
-
dirname as
|
|
36079
|
+
dirname as dirname45,
|
|
35946
36080
|
isAbsolute as isAbsolute13,
|
|
35947
36081
|
join as join72,
|
|
35948
36082
|
relative as relative34,
|
|
@@ -36297,6 +36431,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36297
36431
|
if (!hasFileChanged(filePath, currentHash, state.fileHashes)) {
|
|
36298
36432
|
return;
|
|
36299
36433
|
}
|
|
36434
|
+
if (framework === "unknown")
|
|
36435
|
+
state.fileHashes.set(normalizePath2(filePath), currentHash);
|
|
36300
36436
|
const { publicDir } = state.resolvedPaths;
|
|
36301
36437
|
const { assetsDir } = state.resolvedPaths;
|
|
36302
36438
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
@@ -36311,7 +36447,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36311
36447
|
const { buildDir } = state.resolvedPaths;
|
|
36312
36448
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
36313
36449
|
const { mkdir, copyFile, readFile } = await import("fs/promises");
|
|
36314
|
-
await mkdir(
|
|
36450
|
+
await mkdir(dirname45(destPath), { recursive: true });
|
|
36315
36451
|
await copyFile(absSource, destPath);
|
|
36316
36452
|
const bytes = await readFile(destPath);
|
|
36317
36453
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -36510,7 +36646,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36510
36646
|
const keepStemsByDir = new Map;
|
|
36511
36647
|
const prefixByDir = new Map;
|
|
36512
36648
|
for (const artifact of freshOutputs) {
|
|
36513
|
-
const dir =
|
|
36649
|
+
const dir = dirname45(artifact.path);
|
|
36514
36650
|
const name = basename22(artifact.path);
|
|
36515
36651
|
const [prefix] = name.split(".");
|
|
36516
36652
|
if (!prefix)
|
|
@@ -37108,7 +37244,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37108
37244
|
return url;
|
|
37109
37245
|
}, getReactModuleUrl, isReactComponentPath = (file) => file.endsWith(".tsx") || file.endsWith(".jsx"), isReactPagePath = (file) => file.replace(/\\/g, "/").includes("/pages/"), isImportableModule = (file) => {
|
|
37110
37246
|
try {
|
|
37111
|
-
return
|
|
37247
|
+
return statSync15(file).isFile();
|
|
37112
37248
|
} catch {
|
|
37113
37249
|
return false;
|
|
37114
37250
|
}
|
|
@@ -37927,8 +38063,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37927
38063
|
if (!buildReference?.source) {
|
|
37928
38064
|
return;
|
|
37929
38065
|
}
|
|
37930
|
-
|
|
37931
|
-
islandFiles.add(resolvePath(sourcePath));
|
|
38066
|
+
islandFiles.add(resolvePath(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, buildReference.source)));
|
|
37932
38067
|
}, resolveIslandSourceFiles = async (config) => {
|
|
37933
38068
|
const registryPath = config.islands?.registry;
|
|
37934
38069
|
if (!registryPath) {
|
|
@@ -37948,15 +38083,33 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37948
38083
|
return false;
|
|
37949
38084
|
}
|
|
37950
38085
|
return filesToRebuild.some((file) => islandFiles.has(resolvePath(file)));
|
|
37951
|
-
},
|
|
37952
|
-
const
|
|
37953
|
-
if (!
|
|
38086
|
+
}, collectChangedIslands = async (config, filesToRebuild) => {
|
|
38087
|
+
const registryPath = config.islands?.registry;
|
|
38088
|
+
if (!registryPath)
|
|
38089
|
+
return [];
|
|
38090
|
+
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
38091
|
+
const changedFiles = new Set(filesToRebuild.map((file) => resolvePath(file)));
|
|
38092
|
+
return buildInfo.definitions.filter((definition) => {
|
|
38093
|
+
const source = definition.buildReference?.source;
|
|
38094
|
+
if (!source)
|
|
38095
|
+
return false;
|
|
38096
|
+
return changedFiles.has(resolvePath(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
|
|
38097
|
+
});
|
|
38098
|
+
}, filterFilesReachingPages = async (state, config, files) => {
|
|
38099
|
+
const islandFiles = await resolveIslandSourceFiles(config);
|
|
38100
|
+
return files.filter((file) => {
|
|
38101
|
+
const resolvedFile = resolvePath(file);
|
|
38102
|
+
const dependents = getAffectedFiles(state.dependencyGraph, resolvedFile).filter((dependent) => dependent !== resolvedFile);
|
|
38103
|
+
if (dependents.length === 0)
|
|
38104
|
+
return !islandFiles.has(resolvedFile);
|
|
38105
|
+
return dependents.some((dependent) => !islandFiles.has(dependent));
|
|
38106
|
+
});
|
|
38107
|
+
}, isRegistryEdit = (state, config) => {
|
|
38108
|
+
const registryPath = config.islands?.registry;
|
|
38109
|
+
if (!registryPath)
|
|
37954
38110
|
return false;
|
|
37955
|
-
|
|
37956
|
-
|
|
37957
|
-
const affectedPages = filesToRebuild.flatMap((file) => getPagesUsingIslandSource(file));
|
|
37958
|
-
if (affectedPages.length === 0)
|
|
37959
|
-
return true;
|
|
38111
|
+
return state.lastUserEditedFiles?.has(resolvePath(registryPath)) === true;
|
|
38112
|
+
}, broadcastIslandFullReload = (state, affectedPages, manifest, serverDuration, sourceFile) => {
|
|
37960
38113
|
const affectedFrameworks = [
|
|
37961
38114
|
...new Set(affectedPages.map((page) => detectFramework(page, state.resolvedPaths)).filter((framework) => framework !== "ignored"))
|
|
37962
38115
|
];
|
|
@@ -37967,10 +38120,40 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37967
38120
|
framework: "islands",
|
|
37968
38121
|
manifest,
|
|
37969
38122
|
serverDuration,
|
|
37970
|
-
sourceFile
|
|
38123
|
+
sourceFile
|
|
37971
38124
|
},
|
|
37972
38125
|
type: "full-reload"
|
|
37973
38126
|
});
|
|
38127
|
+
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest, serverDuration) => {
|
|
38128
|
+
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
38129
|
+
if (!shouldReload) {
|
|
38130
|
+
return false;
|
|
38131
|
+
}
|
|
38132
|
+
bumpIslandServerGeneration();
|
|
38133
|
+
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
38134
|
+
const [sourceFile] = filesToRebuild;
|
|
38135
|
+
if (isRegistryEdit(state, config)) {
|
|
38136
|
+
const pagesWithIslands = [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadata.islands.length > 0).map((metadata) => metadata.pagePath);
|
|
38137
|
+
if (pagesWithIslands.length > 0)
|
|
38138
|
+
broadcastIslandFullReload(state, pagesWithIslands, manifest, serverDuration, sourceFile);
|
|
38139
|
+
return true;
|
|
38140
|
+
}
|
|
38141
|
+
const changedIslands = await collectChangedIslands(config, filesToRebuild);
|
|
38142
|
+
const islands = changedIslands.flatMap(({ component, framework }) => {
|
|
38143
|
+
const modulePath = manifest[getIslandManifestKey(framework, component)];
|
|
38144
|
+
return modulePath ? [{ component, framework, modulePath }] : [];
|
|
38145
|
+
});
|
|
38146
|
+
if (islands.length === 0)
|
|
38147
|
+
return true;
|
|
38148
|
+
logHmrUpdate(relative34(process.cwd(), sourceFile ?? ""), "islands", serverDuration);
|
|
38149
|
+
broadcastToClients(state, {
|
|
38150
|
+
data: {
|
|
38151
|
+
islands,
|
|
38152
|
+
serverDuration,
|
|
38153
|
+
sourceFile
|
|
38154
|
+
},
|
|
38155
|
+
type: "island-update"
|
|
38156
|
+
});
|
|
37974
38157
|
return true;
|
|
37975
38158
|
}, handleHTMLScriptHMR = (state, filesToRebuild, manifest, duration) => {
|
|
37976
38159
|
if (!state.resolvedPaths.htmlDir) {
|
|
@@ -37991,8 +38174,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37991
38174
|
}, resolveStaticPageTargets = async (files, sourcePagesDir) => {
|
|
37992
38175
|
const pagesDir = resolvePath(sourcePagesDir);
|
|
37993
38176
|
const htmlFiles = files.filter((file) => file.endsWith(".html")).map((file) => resolvePath(file));
|
|
37994
|
-
const pages = htmlFiles.filter((file) =>
|
|
37995
|
-
const partials = new Set(htmlFiles.filter((file) =>
|
|
38177
|
+
const pages = htmlFiles.filter((file) => dirname45(file) === pagesDir);
|
|
38178
|
+
const partials = new Set(htmlFiles.filter((file) => dirname45(file) !== pagesDir));
|
|
37996
38179
|
if (partials.size === 0)
|
|
37997
38180
|
return pages;
|
|
37998
38181
|
await Promise.resolve().then(() => init_htmlIncludes());
|
|
@@ -38508,14 +38691,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38508
38691
|
handled.add(configPath);
|
|
38509
38692
|
}
|
|
38510
38693
|
return files.every((f) => handled.has(f));
|
|
38694
|
+
}, keepReactIndexesOnModuleServer = async (state, manifest) => {
|
|
38695
|
+
const reactIndexes = Object.fromEntries(Object.entries(manifest).filter(([key, value]) => key.endsWith("Index") && value.includes("/indexes/") && value.includes("/react/")));
|
|
38696
|
+
if (Object.keys(reactIndexes).length === 0)
|
|
38697
|
+
return;
|
|
38698
|
+
await Promise.resolve().then(() => init_prepare());
|
|
38699
|
+
await Promise.resolve().then(() => init_moduleServer());
|
|
38700
|
+
patchManifestIndexes(reactIndexes, resolvePath(state.resolvedPaths.buildDir, "_src_indexes"), SRC_URL_PREFIX2);
|
|
38701
|
+
Object.assign(manifest, reactIndexes);
|
|
38511
38702
|
}, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete, options) => {
|
|
38512
38703
|
state.svelteSurgicallyHandled = undefined;
|
|
38513
38704
|
const hasManifest = Object.keys(state.manifest).length > 0;
|
|
38514
38705
|
const files = filesToRebuild ?? [];
|
|
38515
38706
|
const onDemandPage = options?.onDemandPage;
|
|
38516
|
-
let allHandled = !onDemandPage && files.length > 0 && hasManifest;
|
|
38517
38707
|
const hasIslandSourceChanges = files.length > 0 ? await didStaticPagesNeedIslandRefresh(config, files) : false;
|
|
38518
|
-
|
|
38708
|
+
let allHandled = !onDemandPage && files.length > 0 && hasManifest && !hasIslandSourceChanges;
|
|
38709
|
+
if (allHandled) {
|
|
38519
38710
|
allHandled = await runFrameworkFastPaths(state, config, affectedFrameworks, files, startTime, onRebuildComplete);
|
|
38520
38711
|
}
|
|
38521
38712
|
if (allHandled && config.htmlDirectory && affectedFrameworks.includes("html")) {
|
|
@@ -38547,6 +38738,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38547
38738
|
throw new Error("Build failed - no manifest generated");
|
|
38548
38739
|
}
|
|
38549
38740
|
const { manifest } = buildResult;
|
|
38741
|
+
await keepReactIndexesOnModuleServer(state, manifest);
|
|
38550
38742
|
if (state.lazyPages && buildResult.pageEntries) {
|
|
38551
38743
|
updateLazyPageRegistry(state.lazyPages.registry, buildResult.pageEntries);
|
|
38552
38744
|
}
|
|
@@ -38625,7 +38817,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
38625
38817
|
const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
|
|
38626
38818
|
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
|
|
38627
38819
|
if (didReloadForIslandChange) {
|
|
38628
|
-
await
|
|
38820
|
+
const pageFiles = await filterFilesReachingPages(state, config, filesToRebuild ?? []);
|
|
38821
|
+
if (pageFiles.length > 0)
|
|
38822
|
+
await runFrameworkFastPaths(state, config, affectedFrameworks, pageFiles, startTime, onRebuildComplete);
|
|
38629
38823
|
onRebuildComplete({ hmrState: state, manifest });
|
|
38630
38824
|
return manifest;
|
|
38631
38825
|
}
|
|
@@ -39225,7 +39419,7 @@ var init_vendorCache = __esm(() => {
|
|
|
39225
39419
|
|
|
39226
39420
|
// src/core/devBuild.ts
|
|
39227
39421
|
import { readdir as readdir6 } from "fs/promises";
|
|
39228
|
-
import { existsSync as existsSync58, statSync as
|
|
39422
|
+
import { existsSync as existsSync58, statSync as statSync16 } from "fs";
|
|
39229
39423
|
import { resolve as resolve66 } from "path";
|
|
39230
39424
|
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
39231
39425
|
const configuredDirs = [
|
|
@@ -39365,7 +39559,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39365
39559
|
});
|
|
39366
39560
|
}
|
|
39367
39561
|
}, handleCachedReload = async () => {
|
|
39368
|
-
const serverMtime =
|
|
39562
|
+
const serverMtime = statSync16(resolve66(Bun.main)).mtimeMs;
|
|
39369
39563
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
39370
39564
|
globalThis.__hmrServerMtime = serverMtime;
|
|
39371
39565
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -39746,7 +39940,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
39746
39940
|
manifest
|
|
39747
39941
|
};
|
|
39748
39942
|
globalThis.__hmrDevResult = result;
|
|
39749
|
-
globalThis.__hmrServerMtime =
|
|
39943
|
+
globalThis.__hmrServerMtime = statSync16(resolve66(Bun.main)).mtimeMs;
|
|
39750
39944
|
return result;
|
|
39751
39945
|
};
|
|
39752
39946
|
var init_devBuild = __esm(() => {
|
|
@@ -40001,7 +40195,7 @@ var init_hmr = __esm(() => {
|
|
|
40001
40195
|
|
|
40002
40196
|
// src/plugins/devtoolsJson.ts
|
|
40003
40197
|
import { existsSync as existsSync59, mkdirSync as mkdirSync22, readFileSync as readFileSync56, writeFileSync as writeFileSync18 } from "fs";
|
|
40004
|
-
import { dirname as
|
|
40198
|
+
import { dirname as dirname46, join as join75, resolve as resolve67 } from "path";
|
|
40005
40199
|
import { Elysia as Elysia11 } from "elysia";
|
|
40006
40200
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
40007
40201
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
@@ -40028,7 +40222,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
40028
40222
|
if (cachedUuid)
|
|
40029
40223
|
return setGlobalUuid(cachedUuid);
|
|
40030
40224
|
const uuid = crypto.randomUUID();
|
|
40031
|
-
mkdirSync22(
|
|
40225
|
+
mkdirSync22(dirname46(cachePath), { recursive: true });
|
|
40032
40226
|
writeFileSync18(cachePath, uuid, "utf-8");
|
|
40033
40227
|
return setGlobalUuid(uuid);
|
|
40034
40228
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
@@ -40797,7 +40991,7 @@ import {
|
|
|
40797
40991
|
rm as rm20,
|
|
40798
40992
|
writeFile as writeFile17
|
|
40799
40993
|
} from "fs/promises";
|
|
40800
|
-
import { dirname as
|
|
40994
|
+
import { dirname as dirname47, join as join77, resolve as resolvePath3 } from "path";
|
|
40801
40995
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
40802
40996
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord15 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
|
|
40803
40997
|
const identity = JSON.stringify({
|
|
@@ -40830,7 +41024,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
40830
41024
|
}, writeRelease = async (root, release) => {
|
|
40831
41025
|
const directory = join77(root, release.artifact.releaseId);
|
|
40832
41026
|
const producerPath = join77(directory, release.artifact.producer.module);
|
|
40833
|
-
await mkdir18(
|
|
41027
|
+
await mkdir18(dirname47(producerPath), { recursive: true });
|
|
40834
41028
|
await Promise.all([
|
|
40835
41029
|
writeFile17(join77(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
40836
41030
|
`),
|
|
@@ -41636,6 +41830,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
41636
41830
|
return statusCode === undefined || statusCode === HTTP_STATUS_INTERNAL_SERVER_ERROR;
|
|
41637
41831
|
}, createStaticErrorPlugin = (owner) => {
|
|
41638
41832
|
let startedApp;
|
|
41833
|
+
const loggedErrors = new WeakSet;
|
|
41639
41834
|
return new Elysia16({ name: "absolutejs-static-error" }).onStart((app) => {
|
|
41640
41835
|
startedApp = app;
|
|
41641
41836
|
}).onError("global", async ({ error, request, set }) => {
|
|
@@ -41644,11 +41839,11 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
41644
41839
|
const app = globalThis.__absoluteLiveApp ?? startedApp;
|
|
41645
41840
|
if (hasForeignErrorHook(app, owner()))
|
|
41646
41841
|
return;
|
|
41647
|
-
|
|
41648
|
-
|
|
41649
|
-
|
|
41650
|
-
|
|
41651
|
-
return
|
|
41842
|
+
if (!loggedErrors.has(error)) {
|
|
41843
|
+
loggedErrors.add(error);
|
|
41844
|
+
console.error(`[SSR] ${request.method} ${new URL(request.url).pathname} threw:`, error);
|
|
41845
|
+
}
|
|
41846
|
+
return await renderStaticRouteError(request, error) ?? undefined;
|
|
41652
41847
|
});
|
|
41653
41848
|
}, createBuildErrorRecoveryPlugin = () => new Elysia16({ name: "absolutejs-build-error-recovery" }).onError("global", async ({ error }) => {
|
|
41654
41849
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -41905,11 +42100,11 @@ import {
|
|
|
41905
42100
|
existsSync as existsSync63,
|
|
41906
42101
|
readdirSync as readdirSync17,
|
|
41907
42102
|
readFileSync as readFileSync61,
|
|
41908
|
-
statSync as
|
|
42103
|
+
statSync as statSync17,
|
|
41909
42104
|
watch as watch2
|
|
41910
42105
|
} from "fs";
|
|
41911
42106
|
import { createHash as createHash14 } from "crypto";
|
|
41912
|
-
import { dirname as
|
|
42107
|
+
import { dirname as dirname48, join as join82, resolve as resolve69 } from "path";
|
|
41913
42108
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, isAtomicWriteTemp = (filename) => isEditorTempFile(filename) || isAbsoluteServerEntryCopyPath(filename), fileHash = (path) => {
|
|
41914
42109
|
try {
|
|
41915
42110
|
return createHash14("sha256").update(readFileSync61(path)).digest("hex");
|
|
@@ -41938,10 +42133,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
41938
42133
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
41939
42134
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
41940
42135
|
const entryPath = resolve69(originalEntry);
|
|
41941
|
-
const entryDir =
|
|
42136
|
+
const entryDir = dirname48(entryPath);
|
|
41942
42137
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
41943
42138
|
const configPath = resolve69(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
41944
|
-
const configDir =
|
|
42139
|
+
const configDir = dirname48(configPath);
|
|
41945
42140
|
const configBase = configPath.slice(configDir.length + 1);
|
|
41946
42141
|
const recentlyHandled = new Map;
|
|
41947
42142
|
let entryReloadTimer = null;
|
|
@@ -42088,7 +42283,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
42088
42283
|
continue;
|
|
42089
42284
|
let st;
|
|
42090
42285
|
try {
|
|
42091
|
-
st =
|
|
42286
|
+
st = statSync17(join82(dir, entry.name));
|
|
42092
42287
|
} catch {
|
|
42093
42288
|
continue;
|
|
42094
42289
|
}
|
|
@@ -42235,6 +42430,17 @@ init_constants();
|
|
|
42235
42430
|
|
|
42236
42431
|
// src/core/lookup.ts
|
|
42237
42432
|
init_requestContext();
|
|
42433
|
+
var DOUBLED_RSC_SUFFIX = "RSCRSC";
|
|
42434
|
+
var warnedDoubledRscKeys = new Set;
|
|
42435
|
+
var warnDoubledRscKey = (source, name, assetPath) => {
|
|
42436
|
+
if (!name.endsWith(DOUBLED_RSC_SUFFIX))
|
|
42437
|
+
return;
|
|
42438
|
+
const current = name.slice(0, -"RSC".length);
|
|
42439
|
+
if (source[current] !== assetPath || warnedDoubledRscKeys.has(name))
|
|
42440
|
+
return;
|
|
42441
|
+
warnedDoubledRscKeys.add(name);
|
|
42442
|
+
console.warn(`[asset] key "${name}" is deprecated: React Server Components pages whose file name ends in RSC no longer get the suffix twice. Use asset(manifest, '${current}').`);
|
|
42443
|
+
};
|
|
42238
42444
|
var asset = (source, name) => {
|
|
42239
42445
|
const assetPath = source[name];
|
|
42240
42446
|
if (assetPath === undefined) {
|
|
@@ -42248,6 +42454,8 @@ var asset = (source, name) => {
|
|
|
42248
42454
|
console.warn(`[asset] key "${name}" not found in manifest (dev mode \u2014 skipping)`);
|
|
42249
42455
|
return "";
|
|
42250
42456
|
}
|
|
42457
|
+
if (!isProductionRuntime())
|
|
42458
|
+
warnDoubledRscKey(source, name, assetPath);
|
|
42251
42459
|
return assetPath;
|
|
42252
42460
|
};
|
|
42253
42461
|
// src/core/fileRoutes.ts
|
|
@@ -43078,6 +43286,7 @@ var setUp = async (next) => {
|
|
|
43078
43286
|
}
|
|
43079
43287
|
cleanupsRegisteredDuringSetup.set(next, collected);
|
|
43080
43288
|
};
|
|
43289
|
+
var hookSignature = (app) => ["setup", "cleanup"].map((kind) => hooksOf(app, kind).map((hook) => Function.prototype.toString.call(hook)).sort().join("\x00")).join("\x01");
|
|
43081
43290
|
var tearDown = async (previous) => {
|
|
43082
43291
|
const registered = cleanupsRegisteredDuringSetup.get(previous) ?? [];
|
|
43083
43292
|
cleanupsRegisteredDuringSetup.delete(previous);
|
|
@@ -43089,7 +43298,14 @@ var adoptListeningApp = (app) => {
|
|
|
43089
43298
|
var swapApp = async (next) => {
|
|
43090
43299
|
const previous = globalThis.__absoluteLiveApp;
|
|
43091
43300
|
globalThis.__absoluteLiveApp = next;
|
|
43092
|
-
if (previous
|
|
43301
|
+
if (previous === next)
|
|
43302
|
+
return;
|
|
43303
|
+
if (previous && hookSignature(previous) === hookSignature(next)) {
|
|
43304
|
+
cleanupsRegisteredDuringSetup.set(next, cleanupsRegisteredDuringSetup.get(previous) ?? []);
|
|
43305
|
+
cleanupsRegisteredDuringSetup.delete(previous);
|
|
43306
|
+
return;
|
|
43307
|
+
}
|
|
43308
|
+
if (previous)
|
|
43093
43309
|
await tearDown(previous);
|
|
43094
43310
|
await setUp(next);
|
|
43095
43311
|
};
|
|
@@ -48921,7 +49137,7 @@ var getEnv = (key) => {
|
|
|
48921
49137
|
};
|
|
48922
49138
|
// src/utils/projectRoot.ts
|
|
48923
49139
|
import { existsSync as existsSync65 } from "fs";
|
|
48924
|
-
import { dirname as
|
|
49140
|
+
import { dirname as dirname49, resolve as resolve71 } from "path";
|
|
48925
49141
|
var CONFIG_CANDIDATES = [
|
|
48926
49142
|
"absolute.config.ts",
|
|
48927
49143
|
"absolute.config.js",
|
|
@@ -48942,7 +49158,7 @@ var findProjectRoot = () => {
|
|
|
48942
49158
|
if (packageRoot === null && existsSync65(resolve71(directory, "package.json"))) {
|
|
48943
49159
|
packageRoot = directory;
|
|
48944
49160
|
}
|
|
48945
|
-
const parent =
|
|
49161
|
+
const parent = dirname49(directory);
|
|
48946
49162
|
if (parent === directory) {
|
|
48947
49163
|
return packageRoot ?? start;
|
|
48948
49164
|
}
|
|
@@ -49227,5 +49443,5 @@ export {
|
|
|
49227
49443
|
wrapPageHandlerWithStreamingSlots
|
|
49228
49444
|
};
|
|
49229
49445
|
|
|
49230
|
-
//# debugId=
|
|
49446
|
+
//# debugId=BD6A6E3CCC95441664756E2164756E21
|
|
49231
49447
|
//# sourceMappingURL=index.js.map
|