@absolutejs/absolute 0.19.0-beta.317 → 0.19.0-beta.319
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/dist/build.js +201 -126
- package/dist/build.js.map +6 -6
- package/dist/cli/index.js +74 -2
- package/dist/index.js +1949 -1872
- package/dist/index.js.map +22 -22
- package/dist/src/build/staticIslandPages.d.ts +3 -0
- package/dist/types/globals.d.ts +20 -0
- package/dist/types/island.d.ts +0 -7
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -505,8 +505,14 @@ var exports_generateIslandBindings = {};
|
|
|
505
505
|
__export(exports_generateIslandBindings, {
|
|
506
506
|
generateIslandBindings: () => generateIslandBindings
|
|
507
507
|
});
|
|
508
|
-
import {
|
|
509
|
-
|
|
508
|
+
import {
|
|
509
|
+
existsSync,
|
|
510
|
+
mkdirSync as mkdirSync2,
|
|
511
|
+
readFileSync,
|
|
512
|
+
rmSync as rmSync2,
|
|
513
|
+
writeFileSync as writeFileSync2
|
|
514
|
+
} from "fs";
|
|
515
|
+
import { dirname as dirname2, relative as relative2, resolve as resolve2 } from "path";
|
|
510
516
|
var ensureDir = (filePath) => {
|
|
511
517
|
mkdirSync2(dirname2(filePath), { recursive: true });
|
|
512
518
|
}, writeIfChanged = (filePath, content) => {
|
|
@@ -516,11 +522,77 @@ var ensureDir = (filePath) => {
|
|
|
516
522
|
if (existsSync(filePath)) {
|
|
517
523
|
rmSync2(filePath, { force: true });
|
|
518
524
|
}
|
|
525
|
+
}, writeHTMLCustomData = (projectRoot) => {
|
|
526
|
+
const customDataPath = resolve2(projectRoot, ".absolutejs", "html-custom-data.json");
|
|
527
|
+
const vscodeSettingsPath = resolve2(projectRoot, ".vscode", "settings.json");
|
|
528
|
+
const customDataRelativePath = relative2(dirname2(vscodeSettingsPath), customDataPath).replace(/\\/g, "/");
|
|
529
|
+
const customData = {
|
|
530
|
+
version: 1.1,
|
|
531
|
+
tags: [
|
|
532
|
+
{
|
|
533
|
+
name: "absolute-island",
|
|
534
|
+
description: "Platform-native AbsoluteJS island element for HTML and HTMX host pages. AbsoluteJS server rendering lowers this element into SSR island markup and the client bootstrap hydrates it according to the `hydrate` mode.",
|
|
535
|
+
attributes: [
|
|
536
|
+
{
|
|
537
|
+
name: "framework",
|
|
538
|
+
description: "Target framework runtime for this island component.",
|
|
539
|
+
values: [
|
|
540
|
+
{ name: "react" },
|
|
541
|
+
{ name: "svelte" },
|
|
542
|
+
{ name: "vue" },
|
|
543
|
+
{ name: "angular" }
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "component",
|
|
548
|
+
description: "Registry component name to render for this island."
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "hydrate",
|
|
552
|
+
description: "Client hydration timing. `load` hydrates immediately, `idle` waits for idle time, `visible` waits for intersection, and `none` renders static HTML only.",
|
|
553
|
+
values: [
|
|
554
|
+
{ name: "load" },
|
|
555
|
+
{ name: "idle" },
|
|
556
|
+
{ name: "visible" },
|
|
557
|
+
{ name: "none" }
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
name: "props",
|
|
562
|
+
description: "JSON-serialized props payload passed to the target island component. In HTML, prefer single quotes around the attribute so the JSON can keep its double quotes."
|
|
563
|
+
}
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
};
|
|
568
|
+
writeIfChanged(customDataPath, `${JSON.stringify(customData, null, 2)}
|
|
569
|
+
`);
|
|
570
|
+
let settings = {};
|
|
571
|
+
if (existsSync(vscodeSettingsPath)) {
|
|
572
|
+
try {
|
|
573
|
+
const parsed = JSON.parse(readFileSync(vscodeSettingsPath, "utf-8"));
|
|
574
|
+
if (parsed && typeof parsed === "object") {
|
|
575
|
+
settings = parsed;
|
|
576
|
+
}
|
|
577
|
+
} catch {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const currentCustomData = Array.isArray(settings["html.customData"]) ? settings["html.customData"].filter((value) => typeof value === "string") : [];
|
|
582
|
+
if (!currentCustomData.includes(customDataRelativePath)) {
|
|
583
|
+
settings["html.customData"] = [
|
|
584
|
+
...currentCustomData,
|
|
585
|
+
customDataRelativePath
|
|
586
|
+
];
|
|
587
|
+
writeIfChanged(vscodeSettingsPath, `${JSON.stringify(settings, null, 2)}
|
|
588
|
+
`);
|
|
589
|
+
}
|
|
519
590
|
}, generateIslandBindings = (projectRoot, config) => {
|
|
520
591
|
const registryPath = config.islands?.registry;
|
|
521
592
|
if (!registryPath) {
|
|
522
593
|
return;
|
|
523
594
|
}
|
|
595
|
+
writeHTMLCustomData(projectRoot);
|
|
524
596
|
const resolvedRegistryPath = resolve2(projectRoot, registryPath);
|
|
525
597
|
removeIfExists(resolve2(dirname2(resolvedRegistryPath), "absolute-islands.d.ts"));
|
|
526
598
|
if (config.reactDirectory) {
|
|
@@ -561,7 +633,7 @@ __export(exports_generateReactIndexes, {
|
|
|
561
633
|
});
|
|
562
634
|
import { existsSync as existsSync2, mkdirSync as mkdirSync3 } from "fs";
|
|
563
635
|
import { readdir, rm, writeFile } from "fs/promises";
|
|
564
|
-
import { basename, join as join2, relative as
|
|
636
|
+
import { basename, join as join2, relative as relative3, resolve as resolve3, sep } from "path";
|
|
565
637
|
var {Glob } = globalThis.Bun;
|
|
566
638
|
var indexContentCache, resolveDevClientDir = () => {
|
|
567
639
|
const projectRoot = process.cwd();
|
|
@@ -600,7 +672,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
600
672
|
});
|
|
601
673
|
}));
|
|
602
674
|
}
|
|
603
|
-
const pagesRelPath =
|
|
675
|
+
const pagesRelPath = relative3(resolve3(reactIndexesDirectory), resolve3(reactPagesDirectory)).split(sep).join("/");
|
|
604
676
|
const promises = files.map(async (file) => {
|
|
605
677
|
const fileName = basename(file);
|
|
606
678
|
const [componentName] = fileName.split(".");
|
|
@@ -871,7 +943,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
871
943
|
`
|
|
872
944
|
// Pre-warm: import the page module from the module server`,
|
|
873
945
|
`// immediately so the browser caches all /@src/ URLs.`,
|
|
874
|
-
`import('/@src/${
|
|
946
|
+
`import('/@src/${relative3(process.cwd(), resolve3(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
|
|
875
947
|
] : []
|
|
876
948
|
].join(`
|
|
877
949
|
`);
|
|
@@ -1012,7 +1084,7 @@ var init_htmlScriptHMRPlugin = __esm(() => {
|
|
|
1012
1084
|
});
|
|
1013
1085
|
|
|
1014
1086
|
// src/angular/injectorPatch.ts
|
|
1015
|
-
import { existsSync as existsSync3, readFileSync, writeFileSync as writeFileSync3 } from "fs";
|
|
1087
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
1016
1088
|
import { dirname as dirname3, join as join3, resolve as resolve5 } from "path";
|
|
1017
1089
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
1018
1090
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
@@ -1058,7 +1130,7 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
1058
1130
|
try {
|
|
1059
1131
|
const coreDir = resolveAngularCoreDir();
|
|
1060
1132
|
const chunkPath = join3(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
1061
|
-
const content =
|
|
1133
|
+
const content = readFileSync2(chunkPath, "utf-8");
|
|
1062
1134
|
applyInjectorPatch(chunkPath, content);
|
|
1063
1135
|
} catch {}
|
|
1064
1136
|
};
|
|
@@ -30831,9 +30903,9 @@ var init_lowerIslandSyntax = __esm(() => {
|
|
|
30831
30903
|
|
|
30832
30904
|
// src/core/svelteServerModule.ts
|
|
30833
30905
|
import { mkdir } from "fs/promises";
|
|
30834
|
-
import { dirname as dirname4, extname as extname3, join as join4, relative as
|
|
30906
|
+
import { dirname as dirname4, extname as extname3, join as join4, relative as relative4, resolve as resolve7 } from "path";
|
|
30835
30907
|
var serverCacheRoot, compiledModuleCache, transpiler, ensureRelativeImportPath = (from, to) => {
|
|
30836
|
-
const importPath =
|
|
30908
|
+
const importPath = relative4(dirname4(from), to).replace(/\\/g, "/");
|
|
30837
30909
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
30838
30910
|
}, resolveRelativeModule = async (spec, from) => {
|
|
30839
30911
|
if (!spec.startsWith(".")) {
|
|
@@ -30860,7 +30932,7 @@ var serverCacheRoot, compiledModuleCache, transpiler, ensureRelativeImportPath =
|
|
|
30860
30932
|
}
|
|
30861
30933
|
return null;
|
|
30862
30934
|
}, getCachedModulePath = (sourcePath) => {
|
|
30863
|
-
const relativeSourcePath =
|
|
30935
|
+
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
30864
30936
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
30865
30937
|
return join4(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
30866
30938
|
}, resolveSvelteImport = async (spec, from) => {
|
|
@@ -31086,9 +31158,20 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
31086
31158
|
resolvedServerBuildComponentCache = new Map;
|
|
31087
31159
|
});
|
|
31088
31160
|
|
|
31161
|
+
// src/core/currentIslandRegistry.ts
|
|
31162
|
+
var setCurrentIslandRegistry = (registry) => {
|
|
31163
|
+
globalThis.__absoluteIslandRegistry = registry;
|
|
31164
|
+
}, requireCurrentIslandRegistry = () => {
|
|
31165
|
+
const registry = globalThis.__absoluteIslandRegistry;
|
|
31166
|
+
if (!registry) {
|
|
31167
|
+
throw new Error("No island registry is active. Configure `islands.registry` in absolute.config.ts before rendering <Island />.");
|
|
31168
|
+
}
|
|
31169
|
+
return registry;
|
|
31170
|
+
};
|
|
31171
|
+
|
|
31089
31172
|
// src/build/staticIslandPages.ts
|
|
31090
|
-
import { readFileSync as
|
|
31091
|
-
var ISLAND_TAG_RE_SOURCE = "<island\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/island>)", ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, islandFrameworks, islandHydrationModes, isRecord4 = (value) => typeof value === "object" && value !== null, isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value), isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value), parseIslandAttributes = (attributeString) => {
|
|
31173
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
31174
|
+
var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/(?:absolute-island|island)>)", ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, islandFrameworks, islandHydrationModes, isRecord4 = (value) => typeof value === "object" && value !== null, isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value), isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value), parseIslandAttributes = (attributeString) => {
|
|
31092
31175
|
const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
|
|
31093
31176
|
const attributes = new Map;
|
|
31094
31177
|
let match = attributeRe.exec(attributeString);
|
|
@@ -31133,11 +31216,10 @@ var ISLAND_TAG_RE_SOURCE = "<island\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/islan
|
|
|
31133
31216
|
hydrate,
|
|
31134
31217
|
props: parsedProps
|
|
31135
31218
|
};
|
|
31136
|
-
},
|
|
31137
|
-
const originalHtml = readFileSync2(pagePath, "utf-8");
|
|
31219
|
+
}, transformStaticPageHtml = async (originalHtml, registry) => {
|
|
31138
31220
|
const islandTagRe = new RegExp(ISLAND_TAG_RE_SOURCE, "gi");
|
|
31139
31221
|
if (!islandTagRe.test(originalHtml)) {
|
|
31140
|
-
return;
|
|
31222
|
+
return originalHtml;
|
|
31141
31223
|
}
|
|
31142
31224
|
islandTagRe.lastIndex = 0;
|
|
31143
31225
|
let transformedHtml = "";
|
|
@@ -31154,6 +31236,10 @@ var ISLAND_TAG_RE_SOURCE = "<island\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/islan
|
|
|
31154
31236
|
match = islandTagRe.exec(originalHtml);
|
|
31155
31237
|
}
|
|
31156
31238
|
transformedHtml += originalHtml.slice(lastIndex);
|
|
31239
|
+
return transformedHtml;
|
|
31240
|
+
}, transformStaticPage = async (pagePath, registry) => {
|
|
31241
|
+
const originalHtml = readFileSync3(pagePath, "utf-8");
|
|
31242
|
+
const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
|
|
31157
31243
|
if (transformedHtml !== originalHtml) {
|
|
31158
31244
|
writeFileSync4(pagePath, transformedHtml);
|
|
31159
31245
|
}
|
|
@@ -31163,7 +31249,7 @@ var ISLAND_TAG_RE_SOURCE = "<island\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/islan
|
|
|
31163
31249
|
}
|
|
31164
31250
|
const { registry } = await loadIslandRegistryBuildInfo(registryPath);
|
|
31165
31251
|
await Promise.all(pagePaths.map((pagePath) => transformStaticPage(pagePath, registry)));
|
|
31166
|
-
};
|
|
31252
|
+
}, transformCurrentStaticPageHtml = async (html) => transformStaticPageHtml(html, requireCurrentIslandRegistry());
|
|
31167
31253
|
var init_staticIslandPages = __esm(() => {
|
|
31168
31254
|
init_renderIslandMarkup();
|
|
31169
31255
|
init_islandEntries();
|
|
@@ -31277,7 +31363,7 @@ var scanCssEntryPoints = async (dir, ignore) => {
|
|
|
31277
31363
|
var init_scanCssEntryPoints = () => {};
|
|
31278
31364
|
|
|
31279
31365
|
// src/utils/imageProcessing.ts
|
|
31280
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as
|
|
31366
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
31281
31367
|
import { join as join5, resolve as resolve8 } from "path";
|
|
31282
31368
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
31283
31369
|
for (const size of sizes) {
|
|
@@ -31393,8 +31479,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
31393
31479
|
if (!existsSync8(metaPath) || !existsSync8(dataPath))
|
|
31394
31480
|
return null;
|
|
31395
31481
|
try {
|
|
31396
|
-
const meta = JSON.parse(
|
|
31397
|
-
const buffer =
|
|
31482
|
+
const meta = JSON.parse(readFileSync4(metaPath, "utf-8"));
|
|
31483
|
+
const buffer = readFileSync4(dataPath);
|
|
31398
31484
|
return { buffer, meta };
|
|
31399
31485
|
} catch {
|
|
31400
31486
|
return null;
|
|
@@ -31509,14 +31595,14 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
31509
31595
|
});
|
|
31510
31596
|
|
|
31511
31597
|
// src/cli/scripts/telemetry.ts
|
|
31512
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as
|
|
31598
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
31513
31599
|
import { homedir } from "os";
|
|
31514
31600
|
import { join as join6 } from "path";
|
|
31515
31601
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
31516
31602
|
try {
|
|
31517
31603
|
if (!existsSync9(configPath))
|
|
31518
31604
|
return null;
|
|
31519
|
-
const raw =
|
|
31605
|
+
const raw = readFileSync5(configPath, "utf-8");
|
|
31520
31606
|
const config = JSON.parse(raw);
|
|
31521
31607
|
return config;
|
|
31522
31608
|
} catch {
|
|
@@ -31529,14 +31615,14 @@ var init_telemetry = __esm(() => {
|
|
|
31529
31615
|
});
|
|
31530
31616
|
|
|
31531
31617
|
// src/cli/telemetryEvent.ts
|
|
31532
|
-
import { existsSync as existsSync10, readFileSync as
|
|
31618
|
+
import { existsSync as existsSync10, readFileSync as readFileSync6 } from "fs";
|
|
31533
31619
|
import { arch, platform } from "os";
|
|
31534
31620
|
import { dirname as dirname5, join as join7, parse as parse2 } from "path";
|
|
31535
31621
|
var checkCandidate = (candidate) => {
|
|
31536
31622
|
if (!existsSync10(candidate)) {
|
|
31537
31623
|
return null;
|
|
31538
31624
|
}
|
|
31539
|
-
const pkg = JSON.parse(
|
|
31625
|
+
const pkg = JSON.parse(readFileSync6(candidate, "utf-8"));
|
|
31540
31626
|
if (pkg.name === "@absolutejs/absolute") {
|
|
31541
31627
|
const ver = pkg.version;
|
|
31542
31628
|
return ver;
|
|
@@ -31840,8 +31926,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
31840
31926
|
};
|
|
31841
31927
|
|
|
31842
31928
|
// src/build/angularLinkerPlugin.ts
|
|
31843
|
-
import { existsSync as existsSync12, mkdirSync as mkdirSync6, readFileSync as
|
|
31844
|
-
import { dirname as dirname6, join as join8, relative as
|
|
31929
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync7 } from "fs";
|
|
31930
|
+
import { dirname as dirname6, join as join8, relative as relative5, resolve as resolve11 } from "path";
|
|
31845
31931
|
import { createHash } from "crypto";
|
|
31846
31932
|
var CACHE_DIR, angularLinkerPlugin;
|
|
31847
31933
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -31867,7 +31953,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
31867
31953
|
const cachePath = join8(CACHE_DIR, `${hash}.js`);
|
|
31868
31954
|
if (existsSync12(cachePath)) {
|
|
31869
31955
|
return {
|
|
31870
|
-
contents:
|
|
31956
|
+
contents: readFileSync7(cachePath, "utf-8"),
|
|
31871
31957
|
loader: "js"
|
|
31872
31958
|
};
|
|
31873
31959
|
}
|
|
@@ -31883,8 +31969,8 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
31883
31969
|
fileSystem: {
|
|
31884
31970
|
dirname: dirname6,
|
|
31885
31971
|
exists: existsSync12,
|
|
31886
|
-
readFile:
|
|
31887
|
-
relative:
|
|
31972
|
+
readFile: readFileSync7,
|
|
31973
|
+
relative: relative5,
|
|
31888
31974
|
resolve: resolve11
|
|
31889
31975
|
},
|
|
31890
31976
|
linkerJitMode: false,
|
|
@@ -31925,11 +32011,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
31925
32011
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve12(path)));
|
|
31926
32012
|
const glob = new Glob5("**/*");
|
|
31927
32013
|
const removals = [];
|
|
31928
|
-
for (const
|
|
31929
|
-
const absolute = resolve12(buildPath,
|
|
32014
|
+
for (const relative6 of glob.scanSync({ cwd: buildPath })) {
|
|
32015
|
+
const absolute = resolve12(buildPath, relative6);
|
|
31930
32016
|
if (currentPaths.has(absolute))
|
|
31931
32017
|
continue;
|
|
31932
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
32018
|
+
if (!HASHED_FILE_PATTERN.test(relative6))
|
|
31933
32019
|
continue;
|
|
31934
32020
|
removals.push(rm2(absolute, { force: true }));
|
|
31935
32021
|
}
|
|
@@ -31987,11 +32073,11 @@ var commonAncestor = (paths, fallback) => {
|
|
|
31987
32073
|
var init_commonAncestor = () => {};
|
|
31988
32074
|
|
|
31989
32075
|
// src/utils/validateSafePath.ts
|
|
31990
|
-
import { resolve as resolve13, relative as
|
|
32076
|
+
import { resolve as resolve13, relative as relative6 } from "path";
|
|
31991
32077
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
31992
32078
|
const absoluteBase = resolve13(baseDirectory);
|
|
31993
32079
|
const absoluteTarget = resolve13(baseDirectory, targetPath);
|
|
31994
|
-
const relativePath = normalizePath(
|
|
32080
|
+
const relativePath = normalizePath(relative6(absoluteBase, absoluteTarget));
|
|
31995
32081
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
31996
32082
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
31997
32083
|
}
|
|
@@ -32001,7 +32087,7 @@ var init_validateSafePath = () => {};
|
|
|
32001
32087
|
|
|
32002
32088
|
// src/build/resolvePackageImport.ts
|
|
32003
32089
|
import { resolve as resolve14, join as join10 } from "path";
|
|
32004
|
-
import { existsSync as existsSync13, readFileSync as
|
|
32090
|
+
import { existsSync as existsSync13, readFileSync as readFileSync8 } from "fs";
|
|
32005
32091
|
var resolveExportPath = (entry, conditions) => {
|
|
32006
32092
|
if (typeof entry === "string")
|
|
32007
32093
|
return entry;
|
|
@@ -32027,7 +32113,7 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
32027
32113
|
if (!existsSync13(packageJsonPath))
|
|
32028
32114
|
return null;
|
|
32029
32115
|
try {
|
|
32030
|
-
const packageJson = JSON.parse(
|
|
32116
|
+
const packageJson = JSON.parse(readFileSync8(packageJsonPath, "utf-8"));
|
|
32031
32117
|
const { exports } = packageJson;
|
|
32032
32118
|
if (!exports)
|
|
32033
32119
|
return null;
|
|
@@ -32131,7 +32217,7 @@ import {
|
|
|
32131
32217
|
basename as basename3,
|
|
32132
32218
|
extname as extname4,
|
|
32133
32219
|
resolve as resolve15,
|
|
32134
|
-
relative as
|
|
32220
|
+
relative as relative7,
|
|
32135
32221
|
sep as sep2
|
|
32136
32222
|
} from "path";
|
|
32137
32223
|
import { env } from "process";
|
|
@@ -32235,8 +32321,8 @@ var resolveDevClientDir2 = () => {
|
|
|
32235
32321
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, {})).code;
|
|
32236
32322
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
|
|
32237
32323
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
|
|
32238
|
-
const rawRel = dirname7(
|
|
32239
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
32324
|
+
const rawRel = dirname7(relative7(svelteRoot, src)).replace(/\\/g, "/");
|
|
32325
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(), dirname7(src)).replace(/\\/g, "/")}` : rawRel;
|
|
32240
32326
|
const baseName = basename3(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
32241
32327
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
32242
32328
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -32253,15 +32339,15 @@ var resolveDevClientDir2 = () => {
|
|
|
32253
32339
|
const resolved = resolvedImports[idx];
|
|
32254
32340
|
const resolvedModule = resolvedModuleImports[idx];
|
|
32255
32341
|
if (resolved) {
|
|
32256
|
-
const childRel =
|
|
32342
|
+
const childRel = relative7(svelteRoot, resolved).replace(/\\/g, "/");
|
|
32257
32343
|
if (!childRel.startsWith(".."))
|
|
32258
32344
|
continue;
|
|
32259
32345
|
const childBuilt = cache.get(resolved);
|
|
32260
32346
|
if (!childBuilt)
|
|
32261
32347
|
continue;
|
|
32262
32348
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
32263
|
-
const toServer2 =
|
|
32264
|
-
const toClient2 =
|
|
32349
|
+
const toServer2 = relative7(ssrOutputDir, childBuilt.ssr).replace(/\\/g, "/");
|
|
32350
|
+
const toClient2 = relative7(clientOutputDir, childBuilt.client).replace(/\\/g, "/");
|
|
32265
32351
|
externalRewrites.set(origSpec, {
|
|
32266
32352
|
client: toClient2.startsWith(".") ? toClient2 : `./${toClient2}`,
|
|
32267
32353
|
server: toServer2.startsWith(".") ? toServer2 : `./${toServer2}`
|
|
@@ -32270,8 +32356,8 @@ var resolveDevClientDir2 = () => {
|
|
|
32270
32356
|
}
|
|
32271
32357
|
if (!resolvedModule)
|
|
32272
32358
|
continue;
|
|
32273
|
-
const toServer =
|
|
32274
|
-
const toClient =
|
|
32359
|
+
const toServer = relative7(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
32360
|
+
const toClient = relative7(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
32275
32361
|
externalRewrites.set(rawSpec, {
|
|
32276
32362
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
32277
32363
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -32306,7 +32392,7 @@ var resolveDevClientDir2 = () => {
|
|
|
32306
32392
|
}).js.code;
|
|
32307
32393
|
let code = compiled.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
32308
32394
|
if (mode === "client" && isDev) {
|
|
32309
|
-
const moduleKey = `/@src/${
|
|
32395
|
+
const moduleKey = `/@src/${relative7(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
32310
32396
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
32311
32397
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
32312
32398
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -32342,10 +32428,10 @@ var resolveDevClientDir2 = () => {
|
|
|
32342
32428
|
};
|
|
32343
32429
|
const roots = await Promise.all(entryPoints.map(build));
|
|
32344
32430
|
await Promise.all(roots.map(async ({ client }) => {
|
|
32345
|
-
const relClientDir = dirname7(
|
|
32431
|
+
const relClientDir = dirname7(relative7(clientDir, client));
|
|
32346
32432
|
const name = basename3(client, extname4(client));
|
|
32347
32433
|
const indexPath = join11(indexDir, relClientDir, `${name}.js`);
|
|
32348
|
-
const importRaw =
|
|
32434
|
+
const importRaw = relative7(dirname7(indexPath), client).split(sep2).join("/");
|
|
32349
32435
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
32350
32436
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
32351
32437
|
import "${hmrClientPath3}";
|
|
@@ -32402,7 +32488,7 @@ if (typeof window !== "undefined") {
|
|
|
32402
32488
|
return {
|
|
32403
32489
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
32404
32490
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
32405
|
-
const rel = dirname7(
|
|
32491
|
+
const rel = dirname7(relative7(clientDir, client));
|
|
32406
32492
|
return join11(indexDir, rel, basename3(client));
|
|
32407
32493
|
}),
|
|
32408
32494
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -32431,7 +32517,7 @@ __export(exports_compileVue, {
|
|
|
32431
32517
|
});
|
|
32432
32518
|
import { existsSync as existsSync15 } from "fs";
|
|
32433
32519
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
32434
|
-
import { basename as basename4, dirname as dirname8, join as join12, relative as
|
|
32520
|
+
import { basename as basename4, dirname as dirname8, join as join12, relative as relative8, resolve as resolve16 } from "path";
|
|
32435
32521
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
32436
32522
|
var resolveDevClientDir3 = () => {
|
|
32437
32523
|
const projectRoot = process.cwd();
|
|
@@ -32481,7 +32567,7 @@ var resolveDevClientDir3 = () => {
|
|
|
32481
32567
|
return "template-only";
|
|
32482
32568
|
}
|
|
32483
32569
|
return "full";
|
|
32484
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
32570
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative8(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath) => {
|
|
32485
32571
|
if (filePath.endsWith(".vue"))
|
|
32486
32572
|
return filePath.replace(/\.vue$/, ".js");
|
|
32487
32573
|
if (filePath.endsWith(".ts"))
|
|
@@ -32508,7 +32594,7 @@ var resolveDevClientDir3 = () => {
|
|
|
32508
32594
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
32509
32595
|
if (cachedResult)
|
|
32510
32596
|
return cachedResult;
|
|
32511
|
-
const relativeFilePath =
|
|
32597
|
+
const relativeFilePath = relative8(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
32512
32598
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
32513
32599
|
const fileBaseName = basename4(sourceFilePath, ".vue");
|
|
32514
32600
|
const componentId = toKebab(fileBaseName);
|
|
@@ -32632,7 +32718,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
32632
32718
|
let result2 = code;
|
|
32633
32719
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
32634
32720
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
32635
|
-
let rel =
|
|
32721
|
+
let rel = relative8(dirname8(outputPath), targetPath).replace(/\\/g, "/");
|
|
32636
32722
|
if (!rel.startsWith("."))
|
|
32637
32723
|
rel = `./${rel}`;
|
|
32638
32724
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -32681,7 +32767,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
32681
32767
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
32682
32768
|
const entryBaseName = basename4(entryPath, ".vue");
|
|
32683
32769
|
const indexOutputFile = join12(indexOutputDir, `${entryBaseName}.js`);
|
|
32684
|
-
const clientOutputFile = join12(clientOutputDir,
|
|
32770
|
+
const clientOutputFile = join12(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
32685
32771
|
await mkdir3(dirname8(indexOutputFile), { recursive: true });
|
|
32686
32772
|
const vueHmrImports = isDev ? [
|
|
32687
32773
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -32689,7 +32775,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
32689
32775
|
] : [];
|
|
32690
32776
|
await write2(indexOutputFile, [
|
|
32691
32777
|
...vueHmrImports,
|
|
32692
|
-
`import Comp from "${
|
|
32778
|
+
`import Comp from "${relative8(dirname8(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
32693
32779
|
'import { createSSRApp, createApp } from "vue";',
|
|
32694
32780
|
"",
|
|
32695
32781
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -32790,7 +32876,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
32790
32876
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
32791
32877
|
const sourceCode = await file2(tsPath).text();
|
|
32792
32878
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
32793
|
-
const relativeJsPath =
|
|
32879
|
+
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
32794
32880
|
const outClientPath = join12(clientOutputDir, relativeJsPath);
|
|
32795
32881
|
const outServerPath = join12(serverOutputDir, relativeJsPath);
|
|
32796
32882
|
await mkdir3(dirname8(outClientPath), { recursive: true });
|
|
@@ -41683,11 +41769,11 @@ ${lanes.join(`
|
|
|
41683
41769
|
return toComponents;
|
|
41684
41770
|
}
|
|
41685
41771
|
const components = toComponents.slice(start);
|
|
41686
|
-
const
|
|
41772
|
+
const relative9 = [];
|
|
41687
41773
|
for (;start < fromComponents.length; start++) {
|
|
41688
|
-
|
|
41774
|
+
relative9.push("..");
|
|
41689
41775
|
}
|
|
41690
|
-
return ["", ...
|
|
41776
|
+
return ["", ...relative9, ...components];
|
|
41691
41777
|
}
|
|
41692
41778
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
41693
41779
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -78983,9 +79069,9 @@ ${lanes.join(`
|
|
|
78983
79069
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
78984
79070
|
return;
|
|
78985
79071
|
}
|
|
78986
|
-
const
|
|
79072
|
+
const relative9 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
78987
79073
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
78988
|
-
const option = resolvePath(symlinkDirectory,
|
|
79074
|
+
const option = resolvePath(symlinkDirectory, relative9);
|
|
78989
79075
|
const result2 = cb(option, target === referenceRedirect);
|
|
78990
79076
|
shouldFilterIgnoredPaths = true;
|
|
78991
79077
|
if (result2)
|
|
@@ -201550,12 +201636,12 @@ __export(exports_compileAngular, {
|
|
|
201550
201636
|
compileAngularFile: () => compileAngularFile,
|
|
201551
201637
|
compileAngular: () => compileAngular
|
|
201552
201638
|
});
|
|
201553
|
-
import { existsSync as existsSync16, readFileSync as
|
|
201554
|
-
import { join as join13, basename as basename5, sep as sep3, dirname as dirname9, resolve as resolve17, relative as
|
|
201639
|
+
import { existsSync as existsSync16, readFileSync as readFileSync9, promises as fs } from "fs";
|
|
201640
|
+
import { join as join13, basename as basename5, sep as sep3, dirname as dirname9, resolve as resolve17, relative as relative9 } from "path";
|
|
201555
201641
|
import { createHash as createHash2 } from "crypto";
|
|
201556
201642
|
var import_typescript, computeConfigHash = () => {
|
|
201557
201643
|
try {
|
|
201558
|
-
const content =
|
|
201644
|
+
const content = readFileSync9("./tsconfig.json", "utf-8");
|
|
201559
201645
|
return createHash2("md5").update(content).digest("hex");
|
|
201560
201646
|
} catch {
|
|
201561
201647
|
return "";
|
|
@@ -201613,7 +201699,7 @@ ${registrations}
|
|
|
201613
201699
|
return fileName.substring(outDir.length + 1);
|
|
201614
201700
|
return fileName;
|
|
201615
201701
|
}, compileAngularFile = async (inputPath, outDir) => {
|
|
201616
|
-
const islandMetadataExports = buildIslandMetadataExports(
|
|
201702
|
+
const islandMetadataExports = buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"));
|
|
201617
201703
|
const {
|
|
201618
201704
|
readConfiguration,
|
|
201619
201705
|
performCompilation,
|
|
@@ -201883,7 +201969,7 @@ export default ${componentClassName};
|
|
|
201883
201969
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
201884
201970
|
}
|
|
201885
201971
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
201886
|
-
const relativePath =
|
|
201972
|
+
const relativePath = relative9(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
201887
201973
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
201888
201974
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
201889
201975
|
import "${hmrRuntimePath}";
|
|
@@ -202164,11 +202250,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
202164
202250
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
202165
202251
|
return;
|
|
202166
202252
|
}
|
|
202167
|
-
const { readFileSync:
|
|
202253
|
+
const { readFileSync: readFileSync10, writeFileSync: writeFileSync8, readdirSync } = await import("fs");
|
|
202168
202254
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
202169
202255
|
for (const file3 of files) {
|
|
202170
202256
|
const filePath = join16(vendorDir, file3);
|
|
202171
|
-
const content =
|
|
202257
|
+
const content = readFileSync10(filePath, "utf-8");
|
|
202172
202258
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
202173
202259
|
continue;
|
|
202174
202260
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -202292,12 +202378,12 @@ import {
|
|
|
202292
202378
|
cpSync,
|
|
202293
202379
|
existsSync as existsSync17,
|
|
202294
202380
|
mkdirSync as mkdirSync11,
|
|
202295
|
-
readFileSync as
|
|
202381
|
+
readFileSync as readFileSync10,
|
|
202296
202382
|
rmSync as rmSync3,
|
|
202297
202383
|
statSync,
|
|
202298
202384
|
writeFileSync as writeFileSync8
|
|
202299
202385
|
} from "fs";
|
|
202300
|
-
import { basename as basename6, dirname as dirname10, join as join18, relative as
|
|
202386
|
+
import { basename as basename6, dirname as dirname10, join as join18, relative as relative10, resolve as resolve18 } from "path";
|
|
202301
202387
|
import { cwd, env as env2, exit } from "process";
|
|
202302
202388
|
var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
|
|
202303
202389
|
var isDev, collectConventionSourceFiles = (entry) => {
|
|
@@ -202413,7 +202499,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
202413
202499
|
addWorkerPathIfExists(file3, relPath, workerPaths);
|
|
202414
202500
|
}
|
|
202415
202501
|
}, collectWorkerPathsFromFile = (file3, patterns, workerPaths) => {
|
|
202416
|
-
const content =
|
|
202502
|
+
const content = readFileSync10(file3, "utf-8");
|
|
202417
202503
|
for (const pattern of patterns) {
|
|
202418
202504
|
collectWorkerPathsFromContent(content, pattern, file3, workerPaths);
|
|
202419
202505
|
}
|
|
@@ -202459,9 +202545,9 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
202459
202545
|
}
|
|
202460
202546
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
202461
202547
|
const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
|
|
202462
|
-
const pagesRel =
|
|
202548
|
+
const pagesRel = relative10(process.cwd(), resolve18(reactPagesPath)).replace(/\\/g, "/");
|
|
202463
202549
|
for (const file3 of indexFiles) {
|
|
202464
|
-
let content =
|
|
202550
|
+
let content = readFileSync10(join18(reactIndexesPath, file3), "utf-8");
|
|
202465
202551
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
202466
202552
|
writeFileSync8(join18(devIndexDir, file3), content);
|
|
202467
202553
|
}
|
|
@@ -202473,8 +202559,8 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
202473
202559
|
const indexFile = join18(svelteIndexDir, "pages", `${name}.js`);
|
|
202474
202560
|
if (!existsSync17(indexFile))
|
|
202475
202561
|
continue;
|
|
202476
|
-
let content =
|
|
202477
|
-
const srcRel =
|
|
202562
|
+
let content = readFileSync10(indexFile, "utf-8");
|
|
202563
|
+
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
202478
202564
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
202479
202565
|
writeFileSync8(join18(devIndexDir, `${name}.svelte.js`), content);
|
|
202480
202566
|
}
|
|
@@ -202486,8 +202572,8 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
202486
202572
|
const indexFile = join18(vueIndexDir, `${name}.js`);
|
|
202487
202573
|
if (!existsSync17(indexFile))
|
|
202488
202574
|
continue;
|
|
202489
|
-
let content =
|
|
202490
|
-
const srcRel =
|
|
202575
|
+
let content = readFileSync10(indexFile, "utf-8");
|
|
202576
|
+
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
202491
202577
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
202492
202578
|
writeFileSync8(join18(devIndexDir, `${name}.vue.js`), content);
|
|
202493
202579
|
}
|
|
@@ -202537,7 +202623,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
202537
202623
|
}
|
|
202538
202624
|
return result;
|
|
202539
202625
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
202540
|
-
let content =
|
|
202626
|
+
let content = readFileSync10(outputPath, "utf-8");
|
|
202541
202627
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
202542
202628
|
const useNames = [];
|
|
202543
202629
|
let match;
|
|
@@ -202562,7 +202648,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
202562
202648
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
202563
202649
|
const urlFileMap = new Map;
|
|
202564
202650
|
for (const srcPath of urlReferencedFiles) {
|
|
202565
|
-
const rel =
|
|
202651
|
+
const rel = relative10(projectRoot, srcPath).replace(/\\/g, "/");
|
|
202566
202652
|
const name = basename6(srcPath);
|
|
202567
202653
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
202568
202654
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -202577,7 +202663,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
202577
202663
|
const output = nonReactClientOutputs.find((artifact) => basename6(artifact.path).startsWith(`${srcBase}.`));
|
|
202578
202664
|
if (!output)
|
|
202579
202665
|
continue;
|
|
202580
|
-
urlFileMap.set(basename6(srcPath), `/${
|
|
202666
|
+
urlFileMap.set(basename6(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
202581
202667
|
}
|
|
202582
202668
|
return urlFileMap;
|
|
202583
202669
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -202587,7 +202673,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
202587
202673
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
202588
202674
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
202589
202675
|
for (const outputPath of outputPaths) {
|
|
202590
|
-
let content =
|
|
202676
|
+
let content = readFileSync10(outputPath, "utf-8");
|
|
202591
202677
|
let changed = false;
|
|
202592
202678
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
202593
202679
|
const targetName = basename6(relPath);
|
|
@@ -203244,7 +203330,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
203244
203330
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
203245
203331
|
if (!hmrClientBundle)
|
|
203246
203332
|
return;
|
|
203247
|
-
let html =
|
|
203333
|
+
let html = readFileSync10(filePath, "utf-8");
|
|
203248
203334
|
if (html.includes("data-hmr-client"))
|
|
203249
203335
|
return;
|
|
203250
203336
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -203406,7 +203492,7 @@ var init_build = __esm(() => {
|
|
|
203406
203492
|
});
|
|
203407
203493
|
|
|
203408
203494
|
// src/dev/dependencyGraph.ts
|
|
203409
|
-
import { existsSync as existsSync18, readFileSync as
|
|
203495
|
+
import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
|
|
203410
203496
|
var {Glob: Glob7 } = globalThis.Bun;
|
|
203411
203497
|
import { resolve as resolve19 } from "path";
|
|
203412
203498
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -203567,15 +203653,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
203567
203653
|
const lowerPath = filePath.toLowerCase();
|
|
203568
203654
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
203569
203655
|
if (loader === "html") {
|
|
203570
|
-
const content =
|
|
203656
|
+
const content = readFileSync11(filePath, "utf-8");
|
|
203571
203657
|
return extractHtmlDependencies(filePath, content);
|
|
203572
203658
|
}
|
|
203573
203659
|
if (loader === "tsx" || loader === "js") {
|
|
203574
|
-
const content =
|
|
203660
|
+
const content = readFileSync11(filePath, "utf-8");
|
|
203575
203661
|
return extractJsDependencies(filePath, content, loader);
|
|
203576
203662
|
}
|
|
203577
203663
|
if (isSvelteOrVue) {
|
|
203578
|
-
const content =
|
|
203664
|
+
const content = readFileSync11(filePath, "utf-8");
|
|
203579
203665
|
return extractSvelteVueDependencies(filePath, content);
|
|
203580
203666
|
}
|
|
203581
203667
|
return [];
|
|
@@ -204041,7 +204127,7 @@ var init_assetStore = __esm(() => {
|
|
|
204041
204127
|
});
|
|
204042
204128
|
|
|
204043
204129
|
// src/islands/pageMetadata.ts
|
|
204044
|
-
import { readFileSync as
|
|
204130
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
204045
204131
|
import { dirname as dirname11, resolve as resolve23 } from "path";
|
|
204046
204132
|
var pagePatterns, getPageDirs = (config) => [
|
|
204047
204133
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -204074,7 +204160,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
204074
204160
|
continue;
|
|
204075
204161
|
const files = await scanEntryPoints(resolve23(entry.dir), pattern);
|
|
204076
204162
|
for (const filePath of files) {
|
|
204077
|
-
const source =
|
|
204163
|
+
const source = readFileSync12(filePath, "utf-8");
|
|
204078
204164
|
const islands = extractIslandUsagesFromSource(source);
|
|
204079
204165
|
pageMetadata.set(resolve23(filePath), {
|
|
204080
204166
|
islands: islands.map((usage) => {
|
|
@@ -204120,10 +204206,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
204120
204206
|
});
|
|
204121
204207
|
|
|
204122
204208
|
// src/dev/fileHashTracker.ts
|
|
204123
|
-
import { readFileSync as
|
|
204209
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
204124
204210
|
var computeFileHash = (filePath) => {
|
|
204125
204211
|
try {
|
|
204126
|
-
const fileContent =
|
|
204212
|
+
const fileContent = readFileSync13(filePath);
|
|
204127
204213
|
return Number(Bun.hash(fileContent));
|
|
204128
204214
|
} catch {
|
|
204129
204215
|
return UNFOUND_INDEX;
|
|
@@ -204696,17 +204782,6 @@ var init_resolveConvention = __esm(() => {
|
|
|
204696
204782
|
];
|
|
204697
204783
|
});
|
|
204698
204784
|
|
|
204699
|
-
// src/core/currentIslandRegistry.ts
|
|
204700
|
-
var setCurrentIslandRegistry = (registry) => {
|
|
204701
|
-
globalThis.__absoluteIslandRegistry = registry;
|
|
204702
|
-
}, requireCurrentIslandRegistry = () => {
|
|
204703
|
-
const registry = globalThis.__absoluteIslandRegistry;
|
|
204704
|
-
if (!registry) {
|
|
204705
|
-
throw new Error("No island registry is active. Configure `islands.registry` in absolute.config.ts before rendering <Island />.");
|
|
204706
|
-
}
|
|
204707
|
-
return registry;
|
|
204708
|
-
};
|
|
204709
|
-
|
|
204710
204785
|
// src/angular/lowerServerIslands.ts
|
|
204711
204786
|
var ANGULAR_ISLAND_TAG_RE, ATTRIBUTE_RE, islandFrameworks3, islandHydrationModes3, decodeHtmlAttribute = (value) => value.replaceAll(""", '"').replaceAll(""", '"').replaceAll("'", "'").replaceAll("'", "'").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"), isRecord5 = (value) => typeof value === "object" && value !== null, isIslandFramework3 = (value) => islandFrameworks3.some((framework) => framework === value), isIslandHydrate2 = (value) => islandHydrationModes3.some((mode) => mode === value), parseAttributes = (attributeString) => {
|
|
204712
204787
|
const attributes = new Map;
|
|
@@ -205287,8 +205362,8 @@ __export(exports_moduleServer, {
|
|
|
205287
205362
|
createModuleServer: () => createModuleServer,
|
|
205288
205363
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
205289
205364
|
});
|
|
205290
|
-
import { existsSync as existsSync20, readFileSync as
|
|
205291
|
-
import { basename as basename10, dirname as dirname13, extname as extname5, resolve as resolve26, relative as
|
|
205365
|
+
import { existsSync as existsSync20, readFileSync as readFileSync14, statSync as statSync2 } from "fs";
|
|
205366
|
+
import { basename as basename10, dirname as dirname13, extname as extname5, resolve as resolve26, relative as relative11 } from "path";
|
|
205292
205367
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
205293
205368
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
205294
205369
|
const allExports = [];
|
|
@@ -205336,23 +205411,23 @@ ${stubs}
|
|
|
205336
205411
|
}
|
|
205337
205412
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
205338
205413
|
const absPath = resolve26(fileDir, relPath);
|
|
205339
|
-
const rel =
|
|
205414
|
+
const rel = relative11(projectRoot, absPath);
|
|
205340
205415
|
const extension = extname5(rel);
|
|
205341
205416
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
205342
205417
|
if (extname5(srcPath) === ".svelte") {
|
|
205343
|
-
srcPath =
|
|
205418
|
+
srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve26(projectRoot, srcPath)));
|
|
205344
205419
|
}
|
|
205345
205420
|
return srcUrl(srcPath, projectRoot);
|
|
205346
205421
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot, importer, frameworkDirs) => {
|
|
205347
205422
|
if (importer && frameworkDirs) {
|
|
205348
205423
|
const compatModule = resolveIslandCompatModule(specifier, importer, frameworkDirs);
|
|
205349
205424
|
if (compatModule) {
|
|
205350
|
-
return
|
|
205425
|
+
return relative11(projectRoot, compatModule);
|
|
205351
205426
|
}
|
|
205352
205427
|
}
|
|
205353
205428
|
try {
|
|
205354
205429
|
const target = resolvePackageImport(specifier, ["browser", "import"]) ?? Bun.resolveSync(specifier, projectRoot);
|
|
205355
|
-
return
|
|
205430
|
+
return relative11(projectRoot, target);
|
|
205356
205431
|
} catch {
|
|
205357
205432
|
return;
|
|
205358
205433
|
}
|
|
@@ -205385,10 +205460,10 @@ ${stubs}
|
|
|
205385
205460
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
205386
205461
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
205387
205462
|
if (absPath.startsWith(projectRoot)) {
|
|
205388
|
-
const rel2 =
|
|
205463
|
+
const rel2 = relative11(projectRoot, absPath).replace(/\\/g, "/");
|
|
205389
205464
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
205390
205465
|
}
|
|
205391
|
-
const rel =
|
|
205466
|
+
const rel = relative11(projectRoot, absPath).replace(/\\/g, "/");
|
|
205392
205467
|
if (!rel.startsWith("..")) {
|
|
205393
205468
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
205394
205469
|
}
|
|
@@ -205396,12 +205471,12 @@ ${stubs}
|
|
|
205396
205471
|
});
|
|
205397
205472
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
205398
205473
|
const absPath = resolve26(fileDir, relPath);
|
|
205399
|
-
const rel =
|
|
205474
|
+
const rel = relative11(projectRoot, absPath);
|
|
205400
205475
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
205401
205476
|
});
|
|
205402
205477
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
205403
205478
|
const absPath = resolve26(fileDir, relPath);
|
|
205404
|
-
const rel =
|
|
205479
|
+
const rel = relative11(projectRoot, absPath);
|
|
205405
205480
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
205406
205481
|
});
|
|
205407
205482
|
return result;
|
|
@@ -205429,7 +205504,7 @@ ${stubs}
|
|
|
205429
205504
|
`)}
|
|
205430
205505
|
${code}`;
|
|
205431
205506
|
}, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter, frameworkDirs) => {
|
|
205432
|
-
const raw =
|
|
205507
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205433
205508
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
205434
205509
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
205435
205510
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -205440,12 +205515,12 @@ ${code}`;
|
|
|
205440
205515
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
205441
205516
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
205442
205517
|
${transpiled}`;
|
|
205443
|
-
const relPath =
|
|
205518
|
+
const relPath = relative11(projectRoot, filePath).replace(/\\/g, "/");
|
|
205444
205519
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
205445
205520
|
transpiled += buildIslandMetadataExports(raw);
|
|
205446
205521
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter, frameworkDirs);
|
|
205447
205522
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir, frameworkDirs) => {
|
|
205448
|
-
const raw =
|
|
205523
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205449
205524
|
const ext = extname5(filePath);
|
|
205450
205525
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
205451
205526
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -205591,17 +205666,17 @@ ${code}`;
|
|
|
205591
205666
|
if (compiled.css?.code) {
|
|
205592
205667
|
const cssPath = `${filePath}.css`;
|
|
205593
205668
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
205594
|
-
const cssUrl = srcUrl(
|
|
205669
|
+
const cssUrl = srcUrl(relative11(projectRoot, cssPath), projectRoot);
|
|
205595
205670
|
code = `import "${cssUrl}";
|
|
205596
205671
|
${code}`;
|
|
205597
205672
|
}
|
|
205598
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
205673
|
+
const moduleUrl = `${SRC_PREFIX}${relative11(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
205599
205674
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
205600
205675
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
205601
205676
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
205602
205677
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
205603
205678
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, frameworkDirs) => {
|
|
205604
|
-
const raw =
|
|
205679
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205605
205680
|
if (!svelteCompiler) {
|
|
205606
205681
|
svelteCompiler = await import("svelte/compiler");
|
|
205607
205682
|
}
|
|
@@ -205657,7 +205732,7 @@ export default __script__;`;
|
|
|
205657
205732
|
return `${cssInjection}
|
|
205658
205733
|
${code}`;
|
|
205659
205734
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, frameworkDirs) => {
|
|
205660
|
-
const raw =
|
|
205735
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205661
205736
|
if (!vueCompiler) {
|
|
205662
205737
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
205663
205738
|
}
|
|
@@ -205675,7 +205750,7 @@ ${code}`;
|
|
|
205675
205750
|
return rewriteImports2(code, filePath, projectRoot, rewriter, frameworkDirs);
|
|
205676
205751
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
205677
205752
|
const hmrBase = vueDir ? resolve26(vueDir) : projectRoot;
|
|
205678
|
-
const hmrId =
|
|
205753
|
+
const hmrId = relative11(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
205679
205754
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
205680
205755
|
result += [
|
|
205681
205756
|
"",
|
|
@@ -205706,7 +205781,7 @@ ${code}`;
|
|
|
205706
205781
|
}
|
|
205707
205782
|
});
|
|
205708
205783
|
}, handleCssRequest = (filePath) => {
|
|
205709
|
-
const raw =
|
|
205784
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205710
205785
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
205711
205786
|
return [
|
|
205712
205787
|
`const style = document.createElement('style');`,
|
|
@@ -206044,7 +206119,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
206044
206119
|
// src/dev/rebuildTrigger.ts
|
|
206045
206120
|
import { existsSync as existsSync21 } from "fs";
|
|
206046
206121
|
import { rm as rm8 } from "fs/promises";
|
|
206047
|
-
import { basename as basename11, dirname as dirname14, relative as
|
|
206122
|
+
import { basename as basename11, dirname as dirname14, relative as relative12, resolve as resolve29 } from "path";
|
|
206048
206123
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
206049
206124
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
206050
206125
|
if (pathLineCol) {
|
|
@@ -206239,7 +206314,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206239
206314
|
if (framework === "unknown") {
|
|
206240
206315
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
206241
206316
|
invalidate2(resolve29(filePath));
|
|
206242
|
-
const relPath =
|
|
206317
|
+
const relPath = relative12(process.cwd(), filePath);
|
|
206243
206318
|
logHmrUpdate(relPath);
|
|
206244
206319
|
return;
|
|
206245
206320
|
}
|
|
@@ -206512,7 +206587,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206512
206587
|
}, getModuleUrl = async (pageFile) => {
|
|
206513
206588
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
206514
206589
|
invalidateModule2(pageFile);
|
|
206515
|
-
const rel =
|
|
206590
|
+
const rel = relative12(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
206516
206591
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
206517
206592
|
warmCache2(url);
|
|
206518
206593
|
return url;
|
|
@@ -206544,7 +206619,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206544
206619
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
206545
206620
|
if (pageModuleUrl) {
|
|
206546
206621
|
const serverDuration = Date.now() - startTime;
|
|
206547
|
-
state.lastHmrPath =
|
|
206622
|
+
state.lastHmrPath = relative12(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
206548
206623
|
state.lastHmrFramework = "react";
|
|
206549
206624
|
broadcastToClients(state, {
|
|
206550
206625
|
data: {
|
|
@@ -206996,7 +207071,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206996
207071
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
206997
207072
|
const pascalName = toPascal(baseName);
|
|
206998
207073
|
const vueRoot = config.vueDirectory;
|
|
206999
|
-
const hmrId = vueRoot ?
|
|
207074
|
+
const hmrId = vueRoot ? relative12(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
207000
207075
|
const cssKey = `${pascalName}CSS`;
|
|
207001
207076
|
const cssUrl = manifest[cssKey] || null;
|
|
207002
207077
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -207622,7 +207697,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
207622
207697
|
return Array.from(specifiers).filter(isResolvable3);
|
|
207623
207698
|
}, generateEntrySource2 = (specifier) => `export * from '${specifier}';
|
|
207624
207699
|
`, rewriteVendorFiles = async (vendorDir) => {
|
|
207625
|
-
const { readdirSync: readdirSync2, readFileSync:
|
|
207700
|
+
const { readdirSync: readdirSync2, readFileSync: readFileSync15, writeFileSync: writeFileSync9 } = await import("fs");
|
|
207626
207701
|
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
207627
207702
|
const reactPaths = Object.entries(computeVendorPaths2());
|
|
207628
207703
|
const rewriteContent = (content) => reactPaths.reduce((acc, [specifier, webPath]) => {
|
|
@@ -207633,7 +207708,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
207633
207708
|
const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
207634
207709
|
for (const file3 of files) {
|
|
207635
207710
|
const filePath = join20(vendorDir, file3);
|
|
207636
|
-
const original =
|
|
207711
|
+
const original = readFileSync15(filePath, "utf-8");
|
|
207637
207712
|
const rewritten = rewriteContent(original);
|
|
207638
207713
|
if (rewritten !== original)
|
|
207639
207714
|
writeFileSync9(filePath, rewritten);
|
|
@@ -208000,5 +208075,5 @@ export {
|
|
|
208000
208075
|
build
|
|
208001
208076
|
};
|
|
208002
208077
|
|
|
208003
|
-
//# debugId=
|
|
208078
|
+
//# debugId=818655A4466EF21D64756E2164756E21
|
|
208004
208079
|
//# sourceMappingURL=build.js.map
|