@absolutejs/absolute 0.20.0-beta.107 → 0.20.0-beta.109
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 +12 -0
- package/README.md +5 -1
- package/changelog.json +28 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +696 -623
- package/dist/build.js.map +8 -7
- package/dist/cli/{compile-hsbs1xf6.js → compile-1d5arbqj.js} +2 -2
- package/dist/cli/{config-vy04mqce.js → config-vq2qcc4p.js} +1 -1
- package/dist/cli/{dev-f6b6hkke.js → dev-f0safhsr.js} +1 -1
- package/dist/cli/{index-rd2hbttb.js → index-df2mjbdy.js} +53 -0
- package/dist/cli/{index-hrzd7e5x.js → index-dfqzrznk.js} +1 -1
- package/dist/cli/{index-mazxtfh4.js → index-gps0zk0m.js} +2 -2
- package/dist/cli/index.js +5 -5
- package/dist/cli/{mobile-7v8hfmdq.js → mobile-e4ygngfk.js} +230 -24
- package/dist/cli/{start-5grq7nfr.js → start-8v6g2y31.js} +3 -3
- package/dist/index.js +654 -581
- package/dist/index.js.map +8 -7
- package/dist/mobile/index.js +198 -17
- package/dist/mobile/index.js.map +6 -6
- package/dist/mobile/remoteMacAgentEntry.js +182 -182
- package/dist/src/build/injectVueComposableTracking.d.ts +3 -28
- package/dist/src/build/vueModuleOutputPath.d.ts +7 -0
- package/dist/src/mobile/config.d.ts +7 -0
- package/dist/src/mobile/releaseCertification.d.ts +12 -3
- package/dist/src/mobile/releasePublisher.d.ts +13 -0
- package/dist/types/build.d.ts +13 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10644,7 +10644,7 @@ __export(exports_config, {
|
|
|
10644
10644
|
import { readFileSync as readFileSync11 } from "fs";
|
|
10645
10645
|
import { resolve as resolve12 } from "path";
|
|
10646
10646
|
import { createHash as createHash4, createPublicKey, X509Certificate } from "crypto";
|
|
10647
|
-
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, UPDATE_NAME_PATTERN, UPDATE_PUBLIC_KEY_PATTERN, ENVIRONMENT_NAME_PATTERN, DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000, DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2, DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20, DEFAULT_UPDATE_ROLLOUT_FAILURE_RATE = 0.05, DEFAULT_UPDATE_ROLLOUT_OBSERVATION_MINUTES = 60, MINUTE_MS, DEFAULT_UPDATE_ROLLOUT_STAGES, MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000, MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
|
|
10647
|
+
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, UPDATE_NAME_PATTERN, RELEASE_TARGET_PATTERN, UPDATE_PUBLIC_KEY_PATTERN, ENVIRONMENT_NAME_PATTERN, DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000, DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2, DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20, DEFAULT_UPDATE_ROLLOUT_FAILURE_RATE = 0.05, DEFAULT_UPDATE_ROLLOUT_OBSERVATION_MINUTES = 60, MINUTE_MS, DEFAULT_UPDATE_ROLLOUT_STAGES, MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000, MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
|
|
10648
10648
|
const root = resolve12(projectRoot);
|
|
10649
10649
|
const path = resolve12(root, value);
|
|
10650
10650
|
if (path !== root && !path.startsWith(`${root}/`)) {
|
|
@@ -10680,6 +10680,54 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
10680
10680
|
throw new TypeError("mobile.platforms must contain at least one platform.");
|
|
10681
10681
|
}
|
|
10682
10682
|
return normalized;
|
|
10683
|
+
}, normalizeAndroidCertificationPolicy = (value) => {
|
|
10684
|
+
if (value === false || value === undefined)
|
|
10685
|
+
return;
|
|
10686
|
+
if (value !== "installed")
|
|
10687
|
+
throw new TypeError("mobile.release.certification channel Android policy must be installed or false.");
|
|
10688
|
+
return value;
|
|
10689
|
+
}, normalizeIosCertificationPolicy = (value) => {
|
|
10690
|
+
if (value === false || value === undefined)
|
|
10691
|
+
return;
|
|
10692
|
+
if (!["simulator", "device", "store"].includes(value))
|
|
10693
|
+
throw new TypeError("mobile.release.certification channel iOS policy must be simulator, device, store, or false.");
|
|
10694
|
+
return value;
|
|
10695
|
+
}, normalizeReleaseCertification = (config) => {
|
|
10696
|
+
const configured = config.release?.certification;
|
|
10697
|
+
if (configured === false)
|
|
10698
|
+
return { channels: {}, googlePlayTracks: {} };
|
|
10699
|
+
const channels = {
|
|
10700
|
+
production: { android: "installed", ios: "store" }
|
|
10701
|
+
};
|
|
10702
|
+
const googlePlayTracks = {
|
|
10703
|
+
production: "installed"
|
|
10704
|
+
};
|
|
10705
|
+
for (const [name, policy] of Object.entries(configured?.channels ?? {})) {
|
|
10706
|
+
if (!RELEASE_TARGET_PATTERN.test(name))
|
|
10707
|
+
throw new TypeError("mobile.release.certification.channels contains an invalid channel.");
|
|
10708
|
+
const normalized = {};
|
|
10709
|
+
const android = normalizeAndroidCertificationPolicy(policy.android);
|
|
10710
|
+
const ios = normalizeIosCertificationPolicy(policy.ios);
|
|
10711
|
+
if (android)
|
|
10712
|
+
normalized.android = android;
|
|
10713
|
+
if (ios)
|
|
10714
|
+
normalized.ios = ios;
|
|
10715
|
+
channels[name] = normalized;
|
|
10716
|
+
}
|
|
10717
|
+
for (const [name, requirement] of Object.entries(configured?.googlePlayTracks ?? {})) {
|
|
10718
|
+
if (!RELEASE_TARGET_PATTERN.test(name))
|
|
10719
|
+
throw new TypeError("mobile.release.certification.googlePlayTracks contains an invalid track.");
|
|
10720
|
+
if (requirement === false)
|
|
10721
|
+
delete googlePlayTracks[name];
|
|
10722
|
+
else if (requirement === "installed")
|
|
10723
|
+
googlePlayTracks[name] = requirement;
|
|
10724
|
+
else
|
|
10725
|
+
throw new TypeError("mobile.release.certification Google Play policy must be installed or false.");
|
|
10726
|
+
}
|
|
10727
|
+
return {
|
|
10728
|
+
channels: Object.fromEntries(Object.entries(channels).sort(([left], [right]) => left.localeCompare(right))),
|
|
10729
|
+
googlePlayTracks: Object.fromEntries(Object.entries(googlePlayTracks).sort(([left], [right]) => left.localeCompare(right)))
|
|
10730
|
+
};
|
|
10683
10731
|
}, normalizeHosts = (hosts, productionOrigin) => {
|
|
10684
10732
|
const normalizeHostname = (host) => {
|
|
10685
10733
|
const value = requireText(host, "mobile.deepLinks.hosts").toLowerCase();
|
|
@@ -11006,6 +11054,7 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
11006
11054
|
platforms: normalizePlatforms(config.platforms),
|
|
11007
11055
|
productionOrigin,
|
|
11008
11056
|
pushAndroidGoogleServicesFile: resolveProjectPath(projectRoot, config.pushNotifications?.android?.googleServicesFile ?? "google-services.json", "mobile.pushNotifications.android.googleServicesFile"),
|
|
11057
|
+
releaseCertification: normalizeReleaseCertification(config),
|
|
11009
11058
|
...updates ? { updates } : {},
|
|
11010
11059
|
...updateServer ? { updateServer } : {}
|
|
11011
11060
|
};
|
|
@@ -11016,6 +11065,7 @@ var init_config = __esm(() => {
|
|
|
11016
11065
|
APPLE_APP_ID_PREFIX_PATTERN = /^[A-Z0-9]{10}$/;
|
|
11017
11066
|
CERTIFICATE_FINGERPRINT_PATTERN = /^[0-9A-F]{64}$/;
|
|
11018
11067
|
UPDATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u;
|
|
11068
|
+
RELEASE_TARGET_PATTERN = /^[a-z0-9][a-z0-9._-]{0,63}$/u;
|
|
11019
11069
|
UPDATE_PUBLIC_KEY_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/u;
|
|
11020
11070
|
ENVIRONMENT_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
11021
11071
|
MINUTE_MS = 60 * 1000;
|
|
@@ -17403,9 +17453,33 @@ var init_islandRegistryTransform = __esm(() => {
|
|
|
17403
17453
|
];
|
|
17404
17454
|
});
|
|
17405
17455
|
|
|
17456
|
+
// src/build/vueModuleOutputPath.ts
|
|
17457
|
+
import { isAbsolute as isAbsolute5, join as join31, parse as parse2, relative as relative11, resolve as resolve25, sep as sep3 } from "path";
|
|
17458
|
+
var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
17459
|
+
const absolutePath = resolve25(sourcePath);
|
|
17460
|
+
const { root } = parse2(absolutePath);
|
|
17461
|
+
return join31(outputDir, "sources", encodeURIComponent(root), relative11(root, absolutePath).replace(/\.(vue|ts)$/, ".js"));
|
|
17462
|
+
}, vueModuleSourcePath = (outputDir, outputPath) => {
|
|
17463
|
+
const within = relative11(outputDir, outputPath);
|
|
17464
|
+
if (isAbsolute5(within) || within === ".." || within.startsWith(`..${sep3}`))
|
|
17465
|
+
return null;
|
|
17466
|
+
const [namespace, encodedRoot, ...parts] = within.split(sep3);
|
|
17467
|
+
if (namespace !== "sources" || !encodedRoot || !parts.length)
|
|
17468
|
+
return null;
|
|
17469
|
+
try {
|
|
17470
|
+
const root = decodeURIComponent(encodedRoot);
|
|
17471
|
+
if (parse2(root).root !== root || !isAbsolute5(root))
|
|
17472
|
+
return null;
|
|
17473
|
+
return join31(root, ...parts);
|
|
17474
|
+
} catch {
|
|
17475
|
+
return null;
|
|
17476
|
+
}
|
|
17477
|
+
};
|
|
17478
|
+
var init_vueModuleOutputPath = () => {};
|
|
17479
|
+
|
|
17406
17480
|
// src/build/injectVueComposableTracking.ts
|
|
17407
17481
|
import { existsSync as existsSync26, readFileSync as readFileSync21, writeFileSync as writeFileSync7 } from "fs";
|
|
17408
|
-
import { basename as basename11, isAbsolute as
|
|
17482
|
+
import { basename as basename11, isAbsolute as isAbsolute6, relative as relative12, resolve as resolve26 } from "path";
|
|
17409
17483
|
var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT_OPENER, SOURCE_EXTENSIONS2, CHUNK_REFERENCE, isSharedChunkFile = (fileName) => fileName.startsWith("chunk-") && fileName.endsWith(".js"), collectModuleComments = (content) => Array.from(content.matchAll(MODULE_COMMENT), (match) => ({
|
|
17410
17484
|
index: match.index,
|
|
17411
17485
|
path: match[1] ?? ""
|
|
@@ -17507,20 +17581,23 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
17507
17581
|
return restore(`${wrapped.slice(0, insertAt)}${VUE_HMR_RUNTIME}
|
|
17508
17582
|
${wrapped.slice(insertAt)}`);
|
|
17509
17583
|
}, isSharedChunkPath = (path2) => isSharedChunkFile(basename11(path2)), resolveVueComposableModuleId = (commentPath, options) => {
|
|
17510
|
-
const absolutePath =
|
|
17584
|
+
const absolutePath = resolve26(options.projectRoot, commentPath);
|
|
17511
17585
|
const { vueDir, generatedVueDir } = options;
|
|
17512
17586
|
if (!vueDir || !generatedVueDir)
|
|
17513
17587
|
return absolutePath;
|
|
17514
|
-
const withinGenerated =
|
|
17515
|
-
if (withinGenerated === "" || withinGenerated.startsWith("..") ||
|
|
17588
|
+
const withinGenerated = relative12(generatedVueDir, absolutePath);
|
|
17589
|
+
if (withinGenerated === "" || withinGenerated.startsWith("..") || isAbsolute6(withinGenerated)) {
|
|
17516
17590
|
return absolutePath;
|
|
17517
17591
|
}
|
|
17518
|
-
const
|
|
17519
|
-
|
|
17592
|
+
const sourcePath = vueModuleSourcePath(resolve26(generatedVueDir, "client"), absolutePath);
|
|
17593
|
+
if (!sourcePath)
|
|
17594
|
+
return absolutePath;
|
|
17595
|
+
const stem = sourcePath.replace(/\.[cm]?js$/, "");
|
|
17520
17596
|
const existing = SOURCE_EXTENSIONS2.map((extension) => `${stem}${extension}`).find((candidate) => existsSync26(candidate));
|
|
17521
17597
|
return existing ?? `${stem}.ts`;
|
|
17522
17598
|
};
|
|
17523
17599
|
var init_injectVueComposableTracking = __esm(() => {
|
|
17600
|
+
init_vueModuleOutputPath();
|
|
17524
17601
|
init_constants();
|
|
17525
17602
|
init_maskLiterals();
|
|
17526
17603
|
VUE_HMR_RUNTIME = [
|
|
@@ -17558,7 +17635,7 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
17558
17635
|
createAngularHmrInjectionPlugin: () => createAngularHmrInjectionPlugin
|
|
17559
17636
|
});
|
|
17560
17637
|
import { readFile as readFile7 } from "fs/promises";
|
|
17561
|
-
import { relative as
|
|
17638
|
+
import { relative as relative13, resolve as resolve27 } from "path";
|
|
17562
17639
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
17563
17640
|
const names = new Set;
|
|
17564
17641
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -17737,7 +17814,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
17737
17814
|
}
|
|
17738
17815
|
`, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
|
|
17739
17816
|
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
17740
|
-
const normalizedGenRoot =
|
|
17817
|
+
const normalizedGenRoot = resolve27(generatedAngularRoot).replace(/\\/g, "/");
|
|
17741
17818
|
const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
|
|
17742
17819
|
if (!normalizedPath.startsWith(`${normalizedGenRoot}/`))
|
|
17743
17820
|
return;
|
|
@@ -17754,9 +17831,9 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
17754
17831
|
}
|
|
17755
17832
|
if (classNames.length === 0)
|
|
17756
17833
|
return;
|
|
17757
|
-
const relFromGenRoot =
|
|
17758
|
-
const userTsPath =
|
|
17759
|
-
const projectRel =
|
|
17834
|
+
const relFromGenRoot = relative13(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
17835
|
+
const userTsPath = resolve27(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
17836
|
+
const projectRel = relative13(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
17760
17837
|
const tail = classNames.map((className) => {
|
|
17761
17838
|
const id = `${projectRel}@${className}`;
|
|
17762
17839
|
return buildHmrTail(className, JSON.stringify(id));
|
|
@@ -17790,17 +17867,17 @@ var init_hmrInjectionPlugin = __esm(() => {
|
|
|
17790
17867
|
|
|
17791
17868
|
// src/utils/cleanStaleOutputs.ts
|
|
17792
17869
|
import { rm as rm4 } from "fs/promises";
|
|
17793
|
-
import { resolve as
|
|
17870
|
+
import { resolve as resolve28 } from "path";
|
|
17794
17871
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
17795
17872
|
var HASHED_FILE_PATTERN, ROOT_CHUNK_PATTERN, isContentAddressedOutput = (relativePath) => HASHED_FILE_PATTERN.test(relativePath) || ROOT_CHUNK_PATTERN.test(relativePath), cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
17796
|
-
const currentPaths = new Set(currentOutputPaths.map((path2) =>
|
|
17873
|
+
const currentPaths = new Set(currentOutputPaths.map((path2) => resolve28(path2)));
|
|
17797
17874
|
const glob = new Glob5("**/*");
|
|
17798
17875
|
const removals = [];
|
|
17799
|
-
for (const
|
|
17800
|
-
const absolute =
|
|
17876
|
+
for (const relative14 of glob.scanSync({ cwd: buildPath })) {
|
|
17877
|
+
const absolute = resolve28(buildPath, relative14);
|
|
17801
17878
|
if (currentPaths.has(absolute))
|
|
17802
17879
|
continue;
|
|
17803
|
-
if (!isContentAddressedOutput(
|
|
17880
|
+
if (!isContentAddressedOutput(relative14))
|
|
17804
17881
|
continue;
|
|
17805
17882
|
removals.push(rm4(absolute, { force: true }));
|
|
17806
17883
|
}
|
|
@@ -17817,13 +17894,13 @@ __export(exports_generatedDir, {
|
|
|
17817
17894
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir,
|
|
17818
17895
|
getGeneratedRoot: () => getGeneratedRoot
|
|
17819
17896
|
});
|
|
17820
|
-
import { join as
|
|
17821
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) =>
|
|
17897
|
+
import { join as join32 } from "path";
|
|
17898
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join32(getGeneratedRoot(projectRoot), framework), getGeneratedRoot = (projectRoot = process.cwd()) => join32(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME);
|
|
17822
17899
|
var init_generatedDir = () => {};
|
|
17823
17900
|
|
|
17824
17901
|
// src/utils/cleanup.ts
|
|
17825
17902
|
import { lstat, rm as rm5 } from "fs/promises";
|
|
17826
|
-
import { join as
|
|
17903
|
+
import { join as join33 } from "path";
|
|
17827
17904
|
var isNotFoundError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "ENOENT", removeIfExists = async (path2) => {
|
|
17828
17905
|
try {
|
|
17829
17906
|
await lstat(path2);
|
|
@@ -17840,9 +17917,9 @@ var isNotFoundError = (error) => error instanceof Error && ("code" in error) &&
|
|
|
17840
17917
|
}
|
|
17841
17918
|
if (!frameworkDir)
|
|
17842
17919
|
return Promise.all(tasks);
|
|
17843
|
-
tasks.push(removeIfExists(
|
|
17920
|
+
tasks.push(removeIfExists(join33(frameworkDir, "generated")));
|
|
17844
17921
|
if (framework === "angular") {
|
|
17845
|
-
tasks.push(removeIfExists(
|
|
17922
|
+
tasks.push(removeIfExists(join33(frameworkDir, "compiled")), removeIfExists(join33(frameworkDir, "indexes")));
|
|
17846
17923
|
}
|
|
17847
17924
|
return Promise.all(tasks);
|
|
17848
17925
|
}, cleanup = async ({
|
|
@@ -17889,7 +17966,7 @@ var init_commonAncestor = () => {};
|
|
|
17889
17966
|
|
|
17890
17967
|
// src/utils/buildDirectoryLock.ts
|
|
17891
17968
|
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync8, readFileSync as readFileSync22 } from "fs";
|
|
17892
|
-
import { dirname as dirname17, join as
|
|
17969
|
+
import { dirname as dirname17, join as join34 } from "path";
|
|
17893
17970
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
17894
17971
|
if (exitHandlersRegistered)
|
|
17895
17972
|
return;
|
|
@@ -17916,7 +17993,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
17916
17993
|
console.error(err);
|
|
17917
17994
|
process.exit(1);
|
|
17918
17995
|
});
|
|
17919
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
17996
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join34(dirname17(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
17920
17997
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
17921
17998
|
if (locks.size === 0) {
|
|
17922
17999
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -18053,11 +18130,11 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
18053
18130
|
});
|
|
18054
18131
|
|
|
18055
18132
|
// src/utils/validateSafePath.ts
|
|
18056
|
-
import { resolve as
|
|
18133
|
+
import { resolve as resolve29, relative as relative14 } from "path";
|
|
18057
18134
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
18058
|
-
const absoluteBase =
|
|
18059
|
-
const absoluteTarget =
|
|
18060
|
-
const relativePath = normalizePath2(
|
|
18135
|
+
const absoluteBase = resolve29(baseDirectory);
|
|
18136
|
+
const absoluteTarget = resolve29(baseDirectory, targetPath);
|
|
18137
|
+
const relativePath = normalizePath2(relative14(absoluteBase, absoluteTarget));
|
|
18061
18138
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
18062
18139
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
18063
18140
|
}
|
|
@@ -18073,7 +18150,7 @@ var isTestSourcePath = (file2) => {
|
|
|
18073
18150
|
|
|
18074
18151
|
// src/build/pwa.ts
|
|
18075
18152
|
import { mkdir as mkdir7, rm as rm6, writeFile as writeFile7 } from "fs/promises";
|
|
18076
|
-
import { dirname as dirname18, join as
|
|
18153
|
+
import { dirname as dirname18, join as join35 } from "path";
|
|
18077
18154
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
18078
18155
|
const input = value ?? fallback;
|
|
18079
18156
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -18100,7 +18177,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
18100
18177
|
}
|
|
18101
18178
|
}
|
|
18102
18179
|
return url.pathname;
|
|
18103
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
18180
|
+
}, destinationFor = (buildPath, publicPath) => join35(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
18104
18181
|
clientModule,
|
|
18105
18182
|
manifestPath,
|
|
18106
18183
|
push,
|
|
@@ -18177,8 +18254,8 @@ ${push ? `,
|
|
|
18177
18254
|
await writeFile7(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
18178
18255
|
`);
|
|
18179
18256
|
}
|
|
18180
|
-
const generatedDirectory =
|
|
18181
|
-
const bootstrapEntry =
|
|
18257
|
+
const generatedDirectory = join35(generatedRoot, "pwa");
|
|
18258
|
+
const bootstrapEntry = join35(generatedDirectory, "bootstrap.ts");
|
|
18182
18259
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
18183
18260
|
await mkdir7(generatedDirectory, { recursive: true });
|
|
18184
18261
|
await writeFile7(bootstrapEntry, bootstrapEntrySource({
|
|
@@ -18933,7 +19010,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
18933
19010
|
tryFastHmr: () => tryFastHmr
|
|
18934
19011
|
});
|
|
18935
19012
|
import { existsSync as existsSync27, readFileSync as readFileSync23, statSync as statSync3 } from "fs";
|
|
18936
|
-
import { dirname as dirname19, extname as extname10, relative as
|
|
19013
|
+
import { dirname as dirname19, extname as extname10, relative as relative15, resolve as resolve30 } from "path";
|
|
18937
19014
|
import ts12 from "typescript";
|
|
18938
19015
|
var fail = (reason, detail, location) => ({
|
|
18939
19016
|
detail,
|
|
@@ -19045,7 +19122,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19045
19122
|
const decoratorName = findAngularDecoratorName(decorators);
|
|
19046
19123
|
if (!decoratorName)
|
|
19047
19124
|
continue;
|
|
19048
|
-
const projectRel =
|
|
19125
|
+
const projectRel = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
19049
19126
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
19050
19127
|
if (decoratorName === "Component") {
|
|
19051
19128
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -19248,7 +19325,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19248
19325
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
19249
19326
|
return true;
|
|
19250
19327
|
}
|
|
19251
|
-
const base =
|
|
19328
|
+
const base = resolve30(componentDir, spec);
|
|
19252
19329
|
const candidates = [
|
|
19253
19330
|
`${base}.ts`,
|
|
19254
19331
|
`${base}.tsx`,
|
|
@@ -20064,7 +20141,7 @@ var fail = (reason, detail, location) => ({
|
|
|
20064
20141
|
return null;
|
|
20065
20142
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
20066
20143
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
20067
|
-
const base =
|
|
20144
|
+
const base = resolve30(fromDir, stripped);
|
|
20068
20145
|
const candidates = [
|
|
20069
20146
|
`${base}.d.ts`,
|
|
20070
20147
|
`${base}.d.mts`,
|
|
@@ -20088,7 +20165,7 @@ var fail = (reason, detail, location) => ({
|
|
|
20088
20165
|
return null;
|
|
20089
20166
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
20090
20167
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
20091
|
-
const base =
|
|
20168
|
+
const base = resolve30(componentDir, spec);
|
|
20092
20169
|
const candidates = [
|
|
20093
20170
|
`${base}.ts`,
|
|
20094
20171
|
`${base}.tsx`,
|
|
@@ -20307,13 +20384,13 @@ var fail = (reason, detail, location) => ({
|
|
|
20307
20384
|
}
|
|
20308
20385
|
if (!matches)
|
|
20309
20386
|
continue;
|
|
20310
|
-
const resolved =
|
|
20387
|
+
const resolved = resolve30(componentDir, spec);
|
|
20311
20388
|
for (const ext of TS_EXTENSIONS) {
|
|
20312
20389
|
const candidate = resolved + ext;
|
|
20313
20390
|
if (existsSync27(candidate))
|
|
20314
20391
|
return candidate;
|
|
20315
20392
|
}
|
|
20316
|
-
const indexCandidate =
|
|
20393
|
+
const indexCandidate = resolve30(resolved, "index.ts");
|
|
20317
20394
|
if (existsSync27(indexCandidate))
|
|
20318
20395
|
return indexCandidate;
|
|
20319
20396
|
}
|
|
@@ -20551,7 +20628,7 @@ ${transpiled}
|
|
|
20551
20628
|
}
|
|
20552
20629
|
}${staticPatch}`;
|
|
20553
20630
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20554
|
-
const abs =
|
|
20631
|
+
const abs = resolve30(componentDir, url);
|
|
20555
20632
|
if (!existsSync27(abs))
|
|
20556
20633
|
return null;
|
|
20557
20634
|
const ext = extname10(abs).toLowerCase();
|
|
@@ -20590,7 +20667,7 @@ ${block}
|
|
|
20590
20667
|
const cached = projectOptionsCache.get(projectRoot);
|
|
20591
20668
|
if (cached !== undefined)
|
|
20592
20669
|
return cached;
|
|
20593
|
-
const tsconfigPath =
|
|
20670
|
+
const tsconfigPath = resolve30(projectRoot, "tsconfig.json");
|
|
20594
20671
|
const opts = {};
|
|
20595
20672
|
if (existsSync27(tsconfigPath)) {
|
|
20596
20673
|
try {
|
|
@@ -20636,7 +20713,7 @@ ${block}
|
|
|
20636
20713
|
}
|
|
20637
20714
|
const kind = params.kind ?? "component";
|
|
20638
20715
|
if (kind !== "component") {
|
|
20639
|
-
const entityId = encodeURIComponent(`${
|
|
20716
|
+
const entityId = encodeURIComponent(`${relative15(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
20640
20717
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
20641
20718
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
20642
20719
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -20674,7 +20751,7 @@ ${block}
|
|
|
20674
20751
|
templateText = decoratorMeta.template;
|
|
20675
20752
|
templatePath = componentFilePath;
|
|
20676
20753
|
} else if (decoratorMeta.templateUrl) {
|
|
20677
|
-
const tplAbs =
|
|
20754
|
+
const tplAbs = resolve30(componentDir, decoratorMeta.templateUrl);
|
|
20678
20755
|
if (!existsSync27(tplAbs)) {
|
|
20679
20756
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20680
20757
|
}
|
|
@@ -20720,7 +20797,7 @@ ${block}
|
|
|
20720
20797
|
return fail("class-not-found", "anonymous class");
|
|
20721
20798
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
20722
20799
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
20723
|
-
const projectRelPath =
|
|
20800
|
+
const projectRelPath = relative15(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
20724
20801
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
20725
20802
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
20726
20803
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -21003,7 +21080,7 @@ __export(exports_scanVueSsrOnlyPages, {
|
|
|
21003
21080
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
21004
21081
|
});
|
|
21005
21082
|
import { readdirSync as readdirSync3, readFileSync as readFileSync24 } from "fs";
|
|
21006
|
-
import { join as
|
|
21083
|
+
import { join as join36 } from "path";
|
|
21007
21084
|
import ts13 from "typescript";
|
|
21008
21085
|
var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
21009
21086
|
if (filePath.endsWith(".tsx"))
|
|
@@ -21036,9 +21113,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
21036
21113
|
continue;
|
|
21037
21114
|
if (entry.name.startsWith("."))
|
|
21038
21115
|
continue;
|
|
21039
|
-
stack.push(
|
|
21116
|
+
stack.push(join36(dir, entry.name));
|
|
21040
21117
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
21041
|
-
out.push(
|
|
21118
|
+
out.push(join36(dir, entry.name));
|
|
21042
21119
|
}
|
|
21043
21120
|
}
|
|
21044
21121
|
}
|
|
@@ -21158,7 +21235,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
21158
21235
|
|
|
21159
21236
|
// src/build/scanAngularHandlerCalls.ts
|
|
21160
21237
|
import { readdirSync as readdirSync4, readFileSync as readFileSync25 } from "fs";
|
|
21161
|
-
import { join as
|
|
21238
|
+
import { join as join37 } from "path";
|
|
21162
21239
|
import ts14 from "typescript";
|
|
21163
21240
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
21164
21241
|
if (filePath.endsWith(".tsx"))
|
|
@@ -21191,9 +21268,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
21191
21268
|
continue;
|
|
21192
21269
|
if (entry.name.startsWith("."))
|
|
21193
21270
|
continue;
|
|
21194
|
-
stack.push(
|
|
21271
|
+
stack.push(join37(dir, entry.name));
|
|
21195
21272
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
21196
|
-
out.push(
|
|
21273
|
+
out.push(join37(dir, entry.name));
|
|
21197
21274
|
}
|
|
21198
21275
|
}
|
|
21199
21276
|
}
|
|
@@ -21308,7 +21385,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
21308
21385
|
|
|
21309
21386
|
// src/build/scanAngularPageRoutes.ts
|
|
21310
21387
|
import { readdirSync as readdirSync5, readFileSync as readFileSync26 } from "fs";
|
|
21311
|
-
import { basename as basename12, join as
|
|
21388
|
+
import { basename as basename12, join as join38 } from "path";
|
|
21312
21389
|
import ts15 from "typescript";
|
|
21313
21390
|
var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
21314
21391
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -21348,9 +21425,9 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
21348
21425
|
continue;
|
|
21349
21426
|
if (entry.name.startsWith("."))
|
|
21350
21427
|
continue;
|
|
21351
|
-
stack.push(
|
|
21428
|
+
stack.push(join38(dir, entry.name));
|
|
21352
21429
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
21353
|
-
out.push(
|
|
21430
|
+
out.push(join38(dir, entry.name));
|
|
21354
21431
|
}
|
|
21355
21432
|
}
|
|
21356
21433
|
}
|
|
@@ -21427,7 +21504,7 @@ __export(exports_parseAngularConfigImports, {
|
|
|
21427
21504
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
21428
21505
|
});
|
|
21429
21506
|
import { existsSync as existsSync28, readFileSync as readFileSync27 } from "fs";
|
|
21430
|
-
import { dirname as dirname20, isAbsolute as
|
|
21507
|
+
import { dirname as dirname20, isAbsolute as isAbsolute7, join as join39 } from "path";
|
|
21431
21508
|
import ts16 from "typescript";
|
|
21432
21509
|
var findDefineConfigCall = (sf) => {
|
|
21433
21510
|
let result = null;
|
|
@@ -21482,15 +21559,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
21482
21559
|
}, resolveConfigPath = (projectRoot) => {
|
|
21483
21560
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
21484
21561
|
if (envOverride) {
|
|
21485
|
-
const resolved =
|
|
21562
|
+
const resolved = isAbsolute7(envOverride) ? envOverride : join39(projectRoot, envOverride);
|
|
21486
21563
|
if (existsSync28(resolved))
|
|
21487
21564
|
return resolved;
|
|
21488
21565
|
}
|
|
21489
21566
|
const candidates = [
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21567
|
+
join39(projectRoot, "absolute.config.ts"),
|
|
21568
|
+
join39(projectRoot, "absolute.config.mts"),
|
|
21569
|
+
join39(projectRoot, "absolute.config.js"),
|
|
21570
|
+
join39(projectRoot, "absolute.config.mjs")
|
|
21494
21571
|
];
|
|
21495
21572
|
for (const candidate of candidates) {
|
|
21496
21573
|
if (existsSync28(candidate))
|
|
@@ -21523,7 +21600,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
21523
21600
|
if (!importInfo)
|
|
21524
21601
|
return null;
|
|
21525
21602
|
const configDir2 = dirname20(configPath2);
|
|
21526
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
21603
|
+
const absolutePath = importInfo.source.startsWith(".") ? join39(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute7(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
21527
21604
|
return {
|
|
21528
21605
|
absolutePath,
|
|
21529
21606
|
bindingName: binding,
|
|
@@ -21598,25 +21675,25 @@ import { existsSync as existsSync29 } from "fs";
|
|
|
21598
21675
|
import { mkdir as mkdir8, stat as stat3 } from "fs/promises";
|
|
21599
21676
|
import {
|
|
21600
21677
|
dirname as dirname21,
|
|
21601
|
-
join as
|
|
21678
|
+
join as join40,
|
|
21602
21679
|
basename as basename13,
|
|
21603
21680
|
extname as extname11,
|
|
21604
|
-
resolve as
|
|
21605
|
-
relative as
|
|
21606
|
-
sep as
|
|
21681
|
+
resolve as resolve31,
|
|
21682
|
+
relative as relative16,
|
|
21683
|
+
sep as sep4
|
|
21607
21684
|
} from "path";
|
|
21608
21685
|
import { env as env2 } from "process";
|
|
21609
21686
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
21610
21687
|
var resolveDevClientDir2 = () => {
|
|
21611
21688
|
const projectRoot = process.cwd();
|
|
21612
|
-
const fromSource =
|
|
21689
|
+
const fromSource = resolve31(import.meta.dir, "../dev/client");
|
|
21613
21690
|
if (existsSync29(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
21614
21691
|
return fromSource;
|
|
21615
21692
|
}
|
|
21616
|
-
const fromNodeModules =
|
|
21693
|
+
const fromNodeModules = resolve31(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
21617
21694
|
if (existsSync29(fromNodeModules))
|
|
21618
21695
|
return fromNodeModules;
|
|
21619
|
-
return
|
|
21696
|
+
return resolve31(import.meta.dir, "./dev/client");
|
|
21620
21697
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
21621
21698
|
persistentCache.clear();
|
|
21622
21699
|
sourceHashCache.clear();
|
|
@@ -21646,7 +21723,7 @@ var resolveDevClientDir2 = () => {
|
|
|
21646
21723
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
21647
21724
|
if (!spec.startsWith("."))
|
|
21648
21725
|
return null;
|
|
21649
|
-
const basePath =
|
|
21726
|
+
const basePath = resolve31(dirname21(from), spec);
|
|
21650
21727
|
const candidates = [
|
|
21651
21728
|
basePath,
|
|
21652
21729
|
`${basePath}.ts`,
|
|
@@ -21657,14 +21734,14 @@ var resolveDevClientDir2 = () => {
|
|
|
21657
21734
|
`${basePath}.svelte`,
|
|
21658
21735
|
`${basePath}.svelte.ts`,
|
|
21659
21736
|
`${basePath}.svelte.js`,
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
21667
|
-
|
|
21737
|
+
join40(basePath, "index.ts"),
|
|
21738
|
+
join40(basePath, "index.js"),
|
|
21739
|
+
join40(basePath, "index.mjs"),
|
|
21740
|
+
join40(basePath, "index.cjs"),
|
|
21741
|
+
join40(basePath, "index.json"),
|
|
21742
|
+
join40(basePath, "index.svelte"),
|
|
21743
|
+
join40(basePath, "index.svelte.ts"),
|
|
21744
|
+
join40(basePath, "index.svelte.js")
|
|
21668
21745
|
];
|
|
21669
21746
|
const checks = await Promise.all(candidates.map(exists2));
|
|
21670
21747
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -21673,7 +21750,7 @@ var resolveDevClientDir2 = () => {
|
|
|
21673
21750
|
const resolved = resolvePackageImport(spec);
|
|
21674
21751
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
21675
21752
|
}
|
|
21676
|
-
const basePath =
|
|
21753
|
+
const basePath = resolve31(dirname21(from), spec);
|
|
21677
21754
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
21678
21755
|
if (!explicit) {
|
|
21679
21756
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -21694,8 +21771,8 @@ var resolveDevClientDir2 = () => {
|
|
|
21694
21771
|
return jsPath;
|
|
21695
21772
|
return null;
|
|
21696
21773
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
21697
|
-
const toServer =
|
|
21698
|
-
const toClient =
|
|
21774
|
+
const toServer = relative16(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
21775
|
+
const toClient = relative16(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
21699
21776
|
rewrites.set(rawSpec, {
|
|
21700
21777
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
21701
21778
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -21703,9 +21780,9 @@ var resolveDevClientDir2 = () => {
|
|
|
21703
21780
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
21704
21781
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
21705
21782
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
21706
|
-
const clientDir =
|
|
21707
|
-
const indexDir =
|
|
21708
|
-
const serverDir =
|
|
21783
|
+
const clientDir = join40(generatedDir, "client");
|
|
21784
|
+
const indexDir = join40(generatedDir, "indexes");
|
|
21785
|
+
const serverDir = join40(generatedDir, "server");
|
|
21709
21786
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir8(dir, { recursive: true })));
|
|
21710
21787
|
const dev = env2.NODE_ENV !== "production";
|
|
21711
21788
|
const build2 = async (src) => {
|
|
@@ -21733,8 +21810,8 @@ var resolveDevClientDir2 = () => {
|
|
|
21733
21810
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
21734
21811
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
21735
21812
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
21736
|
-
const rawRel = dirname21(
|
|
21737
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
21813
|
+
const rawRel = dirname21(relative16(svelteRoot, src)).replace(/\\/g, "/");
|
|
21814
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative16(process.cwd(), dirname21(src)).replace(/\\/g, "/")}` : rawRel;
|
|
21738
21815
|
const baseName = basename13(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21739
21816
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path2) => path2 !== undefined);
|
|
21740
21817
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -21743,8 +21820,8 @@ var resolveDevClientDir2 = () => {
|
|
|
21743
21820
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
21744
21821
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
21745
21822
|
const externalRewrites = new Map;
|
|
21746
|
-
const ssrOutputDir = dirname21(
|
|
21747
|
-
const clientOutputDir = dirname21(
|
|
21823
|
+
const ssrOutputDir = dirname21(join40(serverDir, relDir, `${baseName}.js`));
|
|
21824
|
+
const clientOutputDir = dirname21(join40(clientDir, relDir, `${baseName}.js`));
|
|
21748
21825
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
21749
21826
|
const rawSpec = importPaths[idx];
|
|
21750
21827
|
if (!rawSpec)
|
|
@@ -21755,15 +21832,15 @@ var resolveDevClientDir2 = () => {
|
|
|
21755
21832
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
21756
21833
|
if (!resolved)
|
|
21757
21834
|
continue;
|
|
21758
|
-
const childRel =
|
|
21835
|
+
const childRel = relative16(svelteRoot, resolved).replace(/\\/g, "/");
|
|
21759
21836
|
if (!childRel.startsWith(".."))
|
|
21760
21837
|
continue;
|
|
21761
21838
|
const childBuilt2 = cache.get(resolved);
|
|
21762
21839
|
if (!childBuilt2)
|
|
21763
21840
|
continue;
|
|
21764
21841
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
21765
|
-
const toServer =
|
|
21766
|
-
const toClient =
|
|
21842
|
+
const toServer = relative16(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
21843
|
+
const toClient = relative16(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
21767
21844
|
externalRewrites.set(origSpec, {
|
|
21768
21845
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
21769
21846
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -21797,7 +21874,7 @@ var resolveDevClientDir2 = () => {
|
|
|
21797
21874
|
}).js;
|
|
21798
21875
|
let code2 = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
21799
21876
|
if (mode === "client" && isDev2) {
|
|
21800
|
-
const moduleKey = `/@src/${
|
|
21877
|
+
const moduleKey = `/@src/${relative16(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
21801
21878
|
code2 = code2.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
21802
21879
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
21803
21880
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -21809,8 +21886,8 @@ var resolveDevClientDir2 = () => {
|
|
|
21809
21886
|
code2 += islandMetadataExports;
|
|
21810
21887
|
return { code: code2, map: compiledJs.map };
|
|
21811
21888
|
};
|
|
21812
|
-
const ssrPath =
|
|
21813
|
-
const clientPath =
|
|
21889
|
+
const ssrPath = join40(serverDir, relDir, `${baseName}.js`);
|
|
21890
|
+
const clientPath = join40(clientDir, relDir, `${baseName}.js`);
|
|
21814
21891
|
await Promise.all([
|
|
21815
21892
|
mkdir8(dirname21(ssrPath), { recursive: true }),
|
|
21816
21893
|
mkdir8(dirname21(clientPath), { recursive: true })
|
|
@@ -21848,10 +21925,10 @@ var resolveDevClientDir2 = () => {
|
|
|
21848
21925
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
21849
21926
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
21850
21927
|
await Promise.all(componentRoots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
21851
|
-
const relClientDir = dirname21(
|
|
21928
|
+
const relClientDir = dirname21(relative16(clientDir, client2));
|
|
21852
21929
|
const name = basename13(client2, extname11(client2));
|
|
21853
|
-
const indexPath =
|
|
21854
|
-
const importRaw =
|
|
21930
|
+
const indexPath = join40(indexDir, relClientDir, `${name}.js`);
|
|
21931
|
+
const importRaw = relative16(dirname21(indexPath), client2).split(sep4).join("/");
|
|
21855
21932
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
21856
21933
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
21857
21934
|
import "${hmrClientPath3}";
|
|
@@ -21952,8 +22029,8 @@ if (typeof window !== "undefined") {
|
|
|
21952
22029
|
return {
|
|
21953
22030
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
21954
22031
|
svelteIndexPaths: componentRoots.map(({ client: client2 }) => {
|
|
21955
|
-
const rel = dirname21(
|
|
21956
|
-
return
|
|
22032
|
+
const rel = dirname21(relative16(clientDir, client2));
|
|
22033
|
+
return join40(indexDir, rel, basename13(client2));
|
|
21957
22034
|
}),
|
|
21958
22035
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
21959
22036
|
};
|
|
@@ -21968,7 +22045,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
21968
22045
|
init_lowerAwaitSlotSyntax();
|
|
21969
22046
|
init_renderToReadableStream();
|
|
21970
22047
|
devClientDir2 = resolveDevClientDir2();
|
|
21971
|
-
hmrClientPath3 =
|
|
22048
|
+
hmrClientPath3 = join40(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
21972
22049
|
persistentCache = new Map;
|
|
21973
22050
|
sourceHashCache = new Map;
|
|
21974
22051
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -22450,8 +22527,8 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
22450
22527
|
import { createHash as createHash7 } from "crypto";
|
|
22451
22528
|
import { existsSync as existsSync30, readFileSync as readFileSync29 } from "fs";
|
|
22452
22529
|
import { mkdir as mkdir9, rename as rename2, writeFile as writeFile8 } from "fs/promises";
|
|
22453
|
-
import { join as
|
|
22454
|
-
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION =
|
|
22530
|
+
import { join as join41, resolve as resolve32 } from "path";
|
|
22531
|
+
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 2, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash7("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
22455
22532
|
const hash = createHash7("sha256");
|
|
22456
22533
|
for (const part of parts) {
|
|
22457
22534
|
hash.update(part);
|
|
@@ -22460,8 +22537,8 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
22460
22537
|
return hash.digest("hex");
|
|
22461
22538
|
}, readOwnPackageVersion = () => {
|
|
22462
22539
|
const candidates = [
|
|
22463
|
-
|
|
22464
|
-
|
|
22540
|
+
resolve32(import.meta.dir, "..", "..", "package.json"),
|
|
22541
|
+
resolve32(import.meta.dir, "..", "package.json")
|
|
22465
22542
|
];
|
|
22466
22543
|
for (const candidate of candidates) {
|
|
22467
22544
|
try {
|
|
@@ -22476,7 +22553,7 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
22476
22553
|
}, cachedFrameworkVersion, frameworkVersionForCache = () => {
|
|
22477
22554
|
cachedFrameworkVersion ??= readOwnPackageVersion();
|
|
22478
22555
|
return cachedFrameworkVersion;
|
|
22479
|
-
}, vueCompileCacheDir = (projectRoot = process.cwd()) =>
|
|
22556
|
+
}, vueCompileCacheDir = (projectRoot = process.cwd()) => join41(projectRoot, ABSOLUTE_CACHE_DIR_NAME2, CACHE_DIR_NAME, "vue"), entryFileFor = (sourceFilePath, projectRoot) => join41(vueCompileCacheDir(projectRoot), `${hashContent(sourceFilePath).slice(0, FILE_NAME_HASH_LENGTH)}.json`), vueCompileCacheFingerprint = (parts) => {
|
|
22480
22557
|
const frameworkVersion = frameworkVersionForCache();
|
|
22481
22558
|
if (!frameworkVersion)
|
|
22482
22559
|
return null;
|
|
@@ -22542,8 +22619,8 @@ __export(exports_emitTsHelpers, {
|
|
|
22542
22619
|
var {file: file3, Transpiler: Transpiler3, write: write3 } = globalThis.Bun;
|
|
22543
22620
|
import { copyFileSync as copyFileSync2, existsSync as existsSync31, readdirSync as readdirSync6 } from "fs";
|
|
22544
22621
|
import { mkdir as mkdir10, rename as rename3, writeFile as writeFile9 } from "fs/promises";
|
|
22545
|
-
import { dirname as dirname22, join as
|
|
22546
|
-
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24, transpiler4, cacheDir = () =>
|
|
22622
|
+
import { dirname as dirname22, join as join42 } from "path";
|
|
22623
|
+
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24, transpiler4, cacheDir = () => join42(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
|
|
22547
22624
|
const frameworkVersion = frameworkVersionForCache();
|
|
22548
22625
|
if (!frameworkVersion || !vueCompileCacheEnabled())
|
|
22549
22626
|
return null;
|
|
@@ -22576,13 +22653,13 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24
|
|
|
22576
22653
|
}, publishCacheEntry = async (directory, fileName, pathHash, content) => {
|
|
22577
22654
|
try {
|
|
22578
22655
|
await mkdir10(directory, { recursive: true });
|
|
22579
|
-
const target =
|
|
22656
|
+
const target = join42(directory, fileName);
|
|
22580
22657
|
const temporary = `${target}.${process.pid}.tmp`;
|
|
22581
22658
|
await writeFile9(temporary, content);
|
|
22582
22659
|
await rename3(temporary, target);
|
|
22583
22660
|
const superseded = entriesForPath(directory, pathHash).filter((name) => name !== fileName);
|
|
22584
22661
|
existingEntries?.set(pathHash, [fileName]);
|
|
22585
|
-
await Promise.all(superseded.map((name) => Bun.file(
|
|
22662
|
+
await Promise.all(superseded.map((name) => Bun.file(join42(directory, name)).delete().catch(() => {
|
|
22586
22663
|
return;
|
|
22587
22664
|
})));
|
|
22588
22665
|
} catch {}
|
|
@@ -22611,7 +22688,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24
|
|
|
22611
22688
|
const key = cacheKey2(sourcePath, sourceCode);
|
|
22612
22689
|
const directory = cacheDir();
|
|
22613
22690
|
const fileName = key ? `${key.path}-${key.content}.js` : null;
|
|
22614
|
-
const cachedPath = fileName ?
|
|
22691
|
+
const cachedPath = fileName ? join42(directory, fileName) : null;
|
|
22615
22692
|
if (cachedPath && existsSync31(cachedPath)) {
|
|
22616
22693
|
await copyBoth(clientOutputPath, serverOutputPath, cachedPath);
|
|
22617
22694
|
return;
|
|
@@ -22640,7 +22717,7 @@ __export(exports_compileVueSfc, {
|
|
|
22640
22717
|
compileVueSfc: () => compileVueSfc
|
|
22641
22718
|
});
|
|
22642
22719
|
import { existsSync as existsSync32, readFileSync as readFileSync30, realpathSync as realpathSync2 } from "fs";
|
|
22643
|
-
import { dirname as dirname23, relative as
|
|
22720
|
+
import { dirname as dirname23, relative as relative17, resolve as resolve33 } from "path";
|
|
22644
22721
|
var {Transpiler: Transpiler4 } = globalThis.Bun;
|
|
22645
22722
|
var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
22646
22723
|
const resolved = realpathSync2(cssFilePath);
|
|
@@ -22649,7 +22726,7 @@ var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set)
|
|
|
22649
22726
|
visited.add(resolved);
|
|
22650
22727
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
22651
22728
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
22652
|
-
const importedPath =
|
|
22729
|
+
const importedPath = resolve33(dirname23(cssFilePath), relPath);
|
|
22653
22730
|
if (!existsSync32(importedPath))
|
|
22654
22731
|
return match;
|
|
22655
22732
|
const importedContent = readFileSync30(importedPath, "utf-8");
|
|
@@ -22662,15 +22739,15 @@ var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set)
|
|
|
22662
22739
|
return filePath.replace(/\.ts$/, ".js");
|
|
22663
22740
|
if (isStylePath(filePath)) {
|
|
22664
22741
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
22665
|
-
return
|
|
22742
|
+
return resolve33(sourceDir, filePath);
|
|
22666
22743
|
}
|
|
22667
22744
|
return filePath;
|
|
22668
22745
|
}
|
|
22669
22746
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
22670
|
-
const directTs =
|
|
22747
|
+
const directTs = resolve33(sourceDir, `${filePath}.ts`);
|
|
22671
22748
|
if (existsSync32(directTs))
|
|
22672
22749
|
return `${filePath}.js`;
|
|
22673
|
-
const indexedTs =
|
|
22750
|
+
const indexedTs = resolve33(sourceDir, filePath, "index.ts");
|
|
22674
22751
|
if (existsSync32(indexedTs))
|
|
22675
22752
|
return `${filePath}/index.js`;
|
|
22676
22753
|
}
|
|
@@ -22813,7 +22890,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
22813
22890
|
let result = code2;
|
|
22814
22891
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
22815
22892
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
22816
|
-
let rel =
|
|
22893
|
+
let rel = relative17(dirname23(outputPath), targetPath).replace(/\\/g, "/");
|
|
22817
22894
|
if (!rel.startsWith("."))
|
|
22818
22895
|
rel = `./${rel}`;
|
|
22819
22896
|
result = result.replaceAll(bareImport, rel);
|
|
@@ -22919,7 +22996,7 @@ __export(exports_workerPool, {
|
|
|
22919
22996
|
});
|
|
22920
22997
|
import { existsSync as existsSync33, readFileSync as readFileSync31 } from "fs";
|
|
22921
22998
|
import { availableParallelism, freemem } from "os";
|
|
22922
|
-
import { dirname as dirname24, join as
|
|
22999
|
+
import { dirname as dirname24, join as join43 } from "path";
|
|
22923
23000
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
22924
23001
|
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, PERCENT = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
|
|
22925
23002
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -22936,7 +23013,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22936
23013
|
const byMemory = Math.floor(freemem() / WORKER_MEMORY_BUDGET_BYTES);
|
|
22937
23014
|
return Math.max(MIN_WORKERS, Math.min(byCpu, byMemory));
|
|
22938
23015
|
}, isOwnPackageRoot = (dir) => {
|
|
22939
|
-
const packageFile =
|
|
23016
|
+
const packageFile = join43(dir, "package.json");
|
|
22940
23017
|
if (!existsSync33(packageFile))
|
|
22941
23018
|
return false;
|
|
22942
23019
|
try {
|
|
@@ -22960,9 +23037,9 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22960
23037
|
const root = findOwnPackageRoot(fromDir);
|
|
22961
23038
|
if (!root)
|
|
22962
23039
|
return null;
|
|
22963
|
-
const distEntry =
|
|
22964
|
-
const sourceEntry =
|
|
22965
|
-
const runningFromDist = fromDir.startsWith(
|
|
23040
|
+
const distEntry = join43(root, "dist", "build", "buildWorker.js");
|
|
23041
|
+
const sourceEntry = join43(root, "src", "build", "buildWorker.ts");
|
|
23042
|
+
const runningFromDist = fromDir.startsWith(join43(root, "dist"));
|
|
22966
23043
|
const ordered = runningFromDist ? [distEntry, sourceEntry] : [sourceEntry, distEntry];
|
|
22967
23044
|
return ordered.find((candidate) => existsSync33(candidate)) ?? null;
|
|
22968
23045
|
}, formatPercent = (ratio) => `${Math.round(ratio * PERCENT)}%`, createBuildWorkerPool = (options = {}) => {
|
|
@@ -23157,7 +23234,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
23157
23234
|
};
|
|
23158
23235
|
const isWarm = () => slots.length > 0;
|
|
23159
23236
|
const shouldUse = (jobCount) => enabled && !broken && !draining && (isWarm() || jobCount >= minBatch);
|
|
23160
|
-
const enqueue = (kind, payload, affinity) => new Promise((
|
|
23237
|
+
const enqueue = (kind, payload, affinity) => new Promise((resolve34, reject) => {
|
|
23161
23238
|
onBurstStart();
|
|
23162
23239
|
inFlight += 1;
|
|
23163
23240
|
queue.push({
|
|
@@ -23166,7 +23243,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
23166
23243
|
payload,
|
|
23167
23244
|
reject,
|
|
23168
23245
|
resolve: (result) => {
|
|
23169
|
-
|
|
23246
|
+
resolve34(result);
|
|
23170
23247
|
}
|
|
23171
23248
|
});
|
|
23172
23249
|
ensureWorkers();
|
|
@@ -23209,10 +23286,10 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
23209
23286
|
const activeJobsSettled = () => {
|
|
23210
23287
|
if (inFlight === 0)
|
|
23211
23288
|
return Promise.resolve();
|
|
23212
|
-
return new Promise((
|
|
23289
|
+
return new Promise((resolve34) => {
|
|
23213
23290
|
const poll = () => {
|
|
23214
23291
|
if (inFlight === 0) {
|
|
23215
|
-
|
|
23292
|
+
resolve34();
|
|
23216
23293
|
return;
|
|
23217
23294
|
}
|
|
23218
23295
|
setTimeout(poll, 10);
|
|
@@ -23260,22 +23337,22 @@ import { mkdir as mkdir11 } from "fs/promises";
|
|
|
23260
23337
|
import {
|
|
23261
23338
|
basename as basename14,
|
|
23262
23339
|
dirname as dirname25,
|
|
23263
|
-
isAbsolute as
|
|
23264
|
-
join as
|
|
23265
|
-
relative as
|
|
23266
|
-
resolve as
|
|
23340
|
+
isAbsolute as isAbsolute8,
|
|
23341
|
+
join as join44,
|
|
23342
|
+
relative as relative18,
|
|
23343
|
+
resolve as resolve34
|
|
23267
23344
|
} from "path";
|
|
23268
23345
|
var {file: file4, write: write4 } = globalThis.Bun;
|
|
23269
23346
|
var resolveDevClientDir3 = () => {
|
|
23270
23347
|
const projectRoot = process.cwd();
|
|
23271
|
-
const fromSource =
|
|
23348
|
+
const fromSource = resolve34(import.meta.dir, "../dev/client");
|
|
23272
23349
|
if (existsSync34(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23273
23350
|
return fromSource;
|
|
23274
23351
|
}
|
|
23275
|
-
const fromNodeModules =
|
|
23352
|
+
const fromNodeModules = resolve34(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23276
23353
|
if (existsSync34(fromNodeModules))
|
|
23277
23354
|
return fromNodeModules;
|
|
23278
|
-
return
|
|
23355
|
+
return resolve34(import.meta.dir, "./dev/client");
|
|
23279
23356
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
23280
23357
|
scriptCache.clear();
|
|
23281
23358
|
scriptSetupCache.clear();
|
|
@@ -23314,17 +23391,17 @@ var resolveDevClientDir3 = () => {
|
|
|
23314
23391
|
return "template-only";
|
|
23315
23392
|
}
|
|
23316
23393
|
return "full";
|
|
23317
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
23394
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative18(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => {
|
|
23318
23395
|
const staticImports = Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g));
|
|
23319
23396
|
const dynamicImports = Array.from(sourceCode.matchAll(/\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g));
|
|
23320
23397
|
return Array.from(new Set([...staticImports, ...dynamicImports].map((match) => match[1]).filter((importPath) => importPath !== undefined)));
|
|
23321
23398
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
23322
23399
|
if (helper.endsWith(".ts"))
|
|
23323
|
-
return
|
|
23324
|
-
const direct =
|
|
23400
|
+
return resolve34(sourceDir, helper);
|
|
23401
|
+
const direct = resolve34(sourceDir, `${helper}.ts`);
|
|
23325
23402
|
if (existsSync34(direct))
|
|
23326
23403
|
return direct;
|
|
23327
|
-
const indexed =
|
|
23404
|
+
const indexed = resolve34(sourceDir, helper, "index.ts");
|
|
23328
23405
|
if (existsSync34(indexed))
|
|
23329
23406
|
return indexed;
|
|
23330
23407
|
return direct;
|
|
@@ -23392,7 +23469,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23392
23469
|
]);
|
|
23393
23470
|
}, materialiseVueCompileCacheEntry = async (entry, cacheKey3, isEntryPoint, outputDirs, fileBaseName) => {
|
|
23394
23471
|
const { result } = entry;
|
|
23395
|
-
const cssOutputFile = isEntryPoint && result.cssCodes.length > 0 ?
|
|
23472
|
+
const cssOutputFile = isEntryPoint && result.cssCodes.length > 0 ? join44(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`) : null;
|
|
23396
23473
|
trackWrite(writeVueOutputs({
|
|
23397
23474
|
clientCode: entry.clientCode,
|
|
23398
23475
|
clientPath: result.clientPath,
|
|
@@ -23447,8 +23524,6 @@ var resolveDevClientDir3 = () => {
|
|
|
23447
23524
|
throw error;
|
|
23448
23525
|
}
|
|
23449
23526
|
}, compileVueFileUncached = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, runSfc, stylePreprocessors) => {
|
|
23450
|
-
const relativeFilePath = relative17(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
23451
|
-
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
23452
23527
|
const fileBaseName = basename14(sourceFilePath, ".vue");
|
|
23453
23528
|
const componentId = toKebab(fileBaseName);
|
|
23454
23529
|
vueCompileProfile.files += 1;
|
|
@@ -23486,12 +23561,12 @@ var resolveDevClientDir3 = () => {
|
|
|
23486
23561
|
const childComponentPaths = importPaths.filter((path2) => path2.startsWith(".") && path2.endsWith(".vue"));
|
|
23487
23562
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
23488
23563
|
const helperModulePaths = importPaths.filter((path2) => path2.startsWith(".") && !path2.endsWith(".vue") && !isStylePath(path2));
|
|
23489
|
-
const stylePathsImported = importPaths.filter((path2) => (path2.startsWith(".") ||
|
|
23564
|
+
const stylePathsImported = importPaths.filter((path2) => (path2.startsWith(".") || isAbsolute8(path2)) && isStylePath(path2)).map((path2) => isAbsolute8(path2) ? path2 : resolve34(dirname25(sourceFilePath), path2));
|
|
23490
23565
|
for (const stylePath of stylePathsImported) {
|
|
23491
23566
|
addStyleImporter(sourceFilePath, stylePath);
|
|
23492
23567
|
}
|
|
23493
23568
|
const childBuildResults = await Promise.all([
|
|
23494
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
23569
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve34(dirname25(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
23495
23570
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
23496
23571
|
]);
|
|
23497
23572
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -23501,7 +23576,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23501
23576
|
descriptor,
|
|
23502
23577
|
fingerprint: currentVueCompileFingerprint(compiler, outputDirs, vueRootDir, stylePreprocessors),
|
|
23503
23578
|
isEntryPoint,
|
|
23504
|
-
relativeWithoutExtension
|
|
23579
|
+
relativeWithoutExtension: vueModuleOutputPath("", sourceFilePath).replace(/\.js$/, "")
|
|
23505
23580
|
});
|
|
23506
23581
|
const restored = cacheKey3 ? readVueCompileCacheEntry(sourceFilePath, cacheKey3) : undefined;
|
|
23507
23582
|
vueCompileProfile.keyMs += performance.now() - cacheKeyStartedAt;
|
|
@@ -23514,8 +23589,8 @@ var resolveDevClientDir3 = () => {
|
|
|
23514
23589
|
return result2;
|
|
23515
23590
|
}
|
|
23516
23591
|
}
|
|
23517
|
-
const clientOutputPath =
|
|
23518
|
-
const serverOutputPath =
|
|
23592
|
+
const clientOutputPath = vueModuleOutputPath(outputDirs.client, sourceFilePath);
|
|
23593
|
+
const serverOutputPath = vueModuleOutputPath(outputDirs.server, sourceFilePath);
|
|
23519
23594
|
const styleSources = await Promise.all(descriptor.styles.map((styleBlock) => styleBlock.lang ? compileStyleSource(sourceFilePath, styleBlock.content, styleBlock.lang, stylePreprocessors) : Promise.resolve(styleBlock.content)));
|
|
23520
23595
|
const packageImportRewrites = [];
|
|
23521
23596
|
packageComponentPaths.forEach(([bareImport], index) => {
|
|
@@ -23542,7 +23617,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23542
23617
|
...localCss,
|
|
23543
23618
|
...childBuildResults.flatMap((result2) => result2.cssCodes)
|
|
23544
23619
|
];
|
|
23545
|
-
const cssOutputFile = isEntryPoint && allCss.length ?
|
|
23620
|
+
const cssOutputFile = isEntryPoint && allCss.length ? join44(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`) : null;
|
|
23546
23621
|
const cssOutputPaths = cssOutputFile ? [cssOutputFile] : [];
|
|
23547
23622
|
trackWrite(writeVueOutputs({
|
|
23548
23623
|
clientCode: clientOutput,
|
|
@@ -23586,10 +23661,10 @@ var resolveDevClientDir3 = () => {
|
|
|
23586
23661
|
const compilerLoadMs = performance.now() - compilerLoadStartedAt;
|
|
23587
23662
|
vueCompileProfile.stageCompilerMs = compilerLoadMs;
|
|
23588
23663
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
23589
|
-
const clientOutputDir =
|
|
23590
|
-
const indexOutputDir =
|
|
23591
|
-
const serverOutputDir =
|
|
23592
|
-
const cssOutputDir =
|
|
23664
|
+
const clientOutputDir = join44(generatedDir, "client");
|
|
23665
|
+
const indexOutputDir = join44(generatedDir, "indexes");
|
|
23666
|
+
const serverOutputDir = join44(generatedDir, "server");
|
|
23667
|
+
const cssOutputDir = join44(generatedDir, "compiled");
|
|
23593
23668
|
await Promise.all([
|
|
23594
23669
|
mkdir11(clientOutputDir, { recursive: true }),
|
|
23595
23670
|
mkdir11(indexOutputDir, { recursive: true }),
|
|
@@ -23599,7 +23674,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23599
23674
|
const buildCache = new Map;
|
|
23600
23675
|
const allTsHelperPaths = new Set;
|
|
23601
23676
|
const expandSpaRouteChildren = async (entries) => {
|
|
23602
|
-
const expanded = new Set(entries.map((entry) =>
|
|
23677
|
+
const expanded = new Set(entries.map((entry) => resolve34(entry)));
|
|
23603
23678
|
const queue = [...expanded];
|
|
23604
23679
|
while (queue.length > 0) {
|
|
23605
23680
|
const entryPath = queue.pop();
|
|
@@ -23616,7 +23691,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23616
23691
|
});
|
|
23617
23692
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
23618
23693
|
for (const { importPath } of routes) {
|
|
23619
|
-
const childPath =
|
|
23694
|
+
const childPath = resolve34(dirname25(entryPath), importPath);
|
|
23620
23695
|
if (expanded.has(childPath) || !existsSync34(childPath)) {
|
|
23621
23696
|
continue;
|
|
23622
23697
|
}
|
|
@@ -23631,7 +23706,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23631
23706
|
vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
|
|
23632
23707
|
stageStartedAt = performance.now();
|
|
23633
23708
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
23634
|
-
const resolvedEntryPath =
|
|
23709
|
+
const resolvedEntryPath = resolve34(entryPath);
|
|
23635
23710
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
23636
23711
|
client: clientOutputDir,
|
|
23637
23712
|
css: cssOutputDir,
|
|
@@ -23649,8 +23724,8 @@ var resolveDevClientDir3 = () => {
|
|
|
23649
23724
|
};
|
|
23650
23725
|
}
|
|
23651
23726
|
const entryBaseName = basename14(entryPath, ".vue");
|
|
23652
|
-
const indexOutputFile =
|
|
23653
|
-
const clientOutputFile =
|
|
23727
|
+
const indexOutputFile = join44(indexOutputDir, `${entryBaseName}.js`);
|
|
23728
|
+
const clientOutputFile = result.clientPath;
|
|
23654
23729
|
await mkdir11(dirname25(indexOutputFile), { recursive: true });
|
|
23655
23730
|
const vueHmrImports = isDev2 ? [
|
|
23656
23731
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -23658,7 +23733,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23658
23733
|
] : [];
|
|
23659
23734
|
await write4(indexOutputFile, [
|
|
23660
23735
|
...vueHmrImports,
|
|
23661
|
-
`import Comp, * as PageModule from "${
|
|
23736
|
+
`import Comp, * as PageModule from "${relative18(dirname25(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
23662
23737
|
'import { createSSRApp, createApp } from "vue";',
|
|
23663
23738
|
'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
|
|
23664
23739
|
"",
|
|
@@ -23844,14 +23919,11 @@ var resolveDevClientDir3 = () => {
|
|
|
23844
23919
|
vueCompileProfile.stageHelperScanMs = performance.now() - stageStartedAt;
|
|
23845
23920
|
vueCompileProfile.helpers = allTsHelperPaths.size;
|
|
23846
23921
|
stageStartedAt = performance.now();
|
|
23847
|
-
const helperFiles = Array.from(allTsHelperPaths).map((tsPath) => {
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
sourcePath: tsPath
|
|
23853
|
-
};
|
|
23854
|
-
});
|
|
23922
|
+
const helperFiles = Array.from(allTsHelperPaths).map((tsPath) => ({
|
|
23923
|
+
clientOutputPath: vueModuleOutputPath(clientOutputDir, tsPath),
|
|
23924
|
+
serverOutputPath: vueModuleOutputPath(serverOutputDir, tsPath),
|
|
23925
|
+
sourcePath: tsPath
|
|
23926
|
+
}));
|
|
23855
23927
|
await runHelperEmit(helperFiles);
|
|
23856
23928
|
vueCompileProfile.stageHelperEmitMs = performance.now() - stageStartedAt;
|
|
23857
23929
|
stageStartedAt = performance.now();
|
|
@@ -23878,6 +23950,7 @@ var resolveDevClientDir3 = () => {
|
|
|
23878
23950
|
};
|
|
23879
23951
|
};
|
|
23880
23952
|
var init_compileVue = __esm(() => {
|
|
23953
|
+
init_vueModuleOutputPath();
|
|
23881
23954
|
init_constants();
|
|
23882
23955
|
init_generatedDir();
|
|
23883
23956
|
init_resolvePackageImport();
|
|
@@ -23888,7 +23961,7 @@ var init_compileVue = __esm(() => {
|
|
|
23888
23961
|
init_stylePreprocessor();
|
|
23889
23962
|
init_vueCompileCache();
|
|
23890
23963
|
devClientDir3 = resolveDevClientDir3();
|
|
23891
|
-
hmrClientPath4 =
|
|
23964
|
+
hmrClientPath4 = join44(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
23892
23965
|
scriptCache = new Map;
|
|
23893
23966
|
scriptSetupCache = new Map;
|
|
23894
23967
|
templateCache = new Map;
|
|
@@ -24393,7 +24466,7 @@ __export(exports_compileAngular, {
|
|
|
24393
24466
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
24394
24467
|
});
|
|
24395
24468
|
import { existsSync as existsSync35, readFileSync as readFileSync32, promises as fs5 } from "fs";
|
|
24396
|
-
import { join as
|
|
24469
|
+
import { join as join45, basename as basename15, sep as sep5, dirname as dirname26, resolve as resolve35, relative as relative19 } from "path";
|
|
24397
24470
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
24398
24471
|
import ts18 from "typescript";
|
|
24399
24472
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) => {
|
|
@@ -24409,10 +24482,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24409
24482
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
24410
24483
|
}, readTsconfigPathAliases = () => {
|
|
24411
24484
|
try {
|
|
24412
|
-
const configPath2 =
|
|
24485
|
+
const configPath2 = resolve35(process.cwd(), "tsconfig.json");
|
|
24413
24486
|
const config = ts18.readConfigFile(configPath2, ts18.sys.readFile).config;
|
|
24414
24487
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
24415
|
-
const baseUrl =
|
|
24488
|
+
const baseUrl = resolve35(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
24416
24489
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
24417
24490
|
return { aliases, baseUrl };
|
|
24418
24491
|
} catch {
|
|
@@ -24432,7 +24505,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24432
24505
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
24433
24506
|
for (const replacement of alias.replacements) {
|
|
24434
24507
|
const candidate = replacement.replace("*", wildcardValue);
|
|
24435
|
-
const resolved = resolveSourceFile(
|
|
24508
|
+
const resolved = resolveSourceFile(resolve35(baseUrl, candidate));
|
|
24436
24509
|
if (resolved)
|
|
24437
24510
|
return resolved;
|
|
24438
24511
|
}
|
|
@@ -24444,20 +24517,20 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24444
24517
|
`${candidate}.tsx`,
|
|
24445
24518
|
`${candidate}.js`,
|
|
24446
24519
|
`${candidate}.jsx`,
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24520
|
+
join45(candidate, "index.ts"),
|
|
24521
|
+
join45(candidate, "index.tsx"),
|
|
24522
|
+
join45(candidate, "index.js"),
|
|
24523
|
+
join45(candidate, "index.jsx")
|
|
24451
24524
|
];
|
|
24452
24525
|
return candidates.find((file5) => existsSync35(file5));
|
|
24453
24526
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
24454
|
-
const baseDir =
|
|
24527
|
+
const baseDir = resolve35(rootDir);
|
|
24455
24528
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
24456
24529
|
const transpiler6 = new Bun.Transpiler({ loader: "tsx" });
|
|
24457
24530
|
const scanCache = new Map;
|
|
24458
24531
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
24459
24532
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
24460
|
-
return resolveSourceFile(
|
|
24533
|
+
return resolveSourceFile(resolve35(fromDir, specifier));
|
|
24461
24534
|
}
|
|
24462
24535
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
24463
24536
|
if (aliased)
|
|
@@ -24466,7 +24539,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24466
24539
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
24467
24540
|
if (resolved.includes("/node_modules/"))
|
|
24468
24541
|
return;
|
|
24469
|
-
const absolute =
|
|
24542
|
+
const absolute = resolve35(resolved);
|
|
24470
24543
|
if (!absolute.startsWith(baseDir))
|
|
24471
24544
|
return;
|
|
24472
24545
|
return resolveSourceFile(absolute);
|
|
@@ -24482,7 +24555,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24482
24555
|
usesLegacyAnimations: false
|
|
24483
24556
|
});
|
|
24484
24557
|
}
|
|
24485
|
-
const resolved =
|
|
24558
|
+
const resolved = resolve35(actualPath);
|
|
24486
24559
|
const cached = scanCache.get(resolved);
|
|
24487
24560
|
if (cached)
|
|
24488
24561
|
return cached;
|
|
@@ -24511,7 +24584,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24511
24584
|
const actualPath = resolveSourceFile(filePath);
|
|
24512
24585
|
if (!actualPath)
|
|
24513
24586
|
return false;
|
|
24514
|
-
const resolved =
|
|
24587
|
+
const resolved = resolve35(actualPath);
|
|
24515
24588
|
if (visited.has(resolved))
|
|
24516
24589
|
return false;
|
|
24517
24590
|
visited.add(resolved);
|
|
@@ -24529,14 +24602,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24529
24602
|
return (entryPath) => visit(entryPath);
|
|
24530
24603
|
}, resolveDevClientDir4 = () => {
|
|
24531
24604
|
const projectRoot = process.cwd();
|
|
24532
|
-
const fromSource =
|
|
24605
|
+
const fromSource = resolve35(import.meta.dir, "../dev/client");
|
|
24533
24606
|
if (existsSync35(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
24534
24607
|
return fromSource;
|
|
24535
24608
|
}
|
|
24536
|
-
const fromNodeModules =
|
|
24609
|
+
const fromNodeModules = resolve35(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
24537
24610
|
if (existsSync35(fromNodeModules))
|
|
24538
24611
|
return fromNodeModules;
|
|
24539
|
-
return
|
|
24612
|
+
return resolve35(import.meta.dir, "./dev/client");
|
|
24540
24613
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
24541
24614
|
try {
|
|
24542
24615
|
return ts18.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -24579,11 +24652,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24579
24652
|
if (hasJsLikeExtension(path2))
|
|
24580
24653
|
return `${path2}${query}`;
|
|
24581
24654
|
const importerDir = dirname26(importerOutputPath);
|
|
24582
|
-
const fileCandidate =
|
|
24655
|
+
const fileCandidate = resolve35(importerDir, `${path2}.js`);
|
|
24583
24656
|
if (outputFiles?.has(fileCandidate) || existsSync35(fileCandidate)) {
|
|
24584
24657
|
return `${path2}.js${query}`;
|
|
24585
24658
|
}
|
|
24586
|
-
const indexCandidate =
|
|
24659
|
+
const indexCandidate = resolve35(importerDir, path2, "index.js");
|
|
24587
24660
|
if (outputFiles?.has(indexCandidate) || existsSync35(indexCandidate)) {
|
|
24588
24661
|
return `${path2}/index.js${query}`;
|
|
24589
24662
|
}
|
|
@@ -24611,18 +24684,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24611
24684
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
24612
24685
|
if (!isRelativeModuleSpecifier(specifier))
|
|
24613
24686
|
return null;
|
|
24614
|
-
const basePath =
|
|
24687
|
+
const basePath = resolve35(dirname26(fromFile), specifier);
|
|
24615
24688
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
24616
24689
|
`${basePath}.ts`,
|
|
24617
24690
|
`${basePath}.tsx`,
|
|
24618
24691
|
`${basePath}.mts`,
|
|
24619
24692
|
`${basePath}.cts`,
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
|
|
24693
|
+
join45(basePath, "index.ts"),
|
|
24694
|
+
join45(basePath, "index.tsx"),
|
|
24695
|
+
join45(basePath, "index.mts"),
|
|
24696
|
+
join45(basePath, "index.cts")
|
|
24624
24697
|
];
|
|
24625
|
-
return candidates.map((candidate) =>
|
|
24698
|
+
return candidates.map((candidate) => resolve35(candidate)).find((candidate) => existsSync35(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
24626
24699
|
}, readFileForAotTransform = async (fileName, readFile8) => {
|
|
24627
24700
|
const hostSource = readFile8?.(fileName);
|
|
24628
24701
|
if (typeof hostSource === "string")
|
|
@@ -24646,18 +24719,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24646
24719
|
const paths = [];
|
|
24647
24720
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24648
24721
|
if (templateUrlMatch?.[1])
|
|
24649
|
-
paths.push(
|
|
24722
|
+
paths.push(join45(fileDir, templateUrlMatch[1]));
|
|
24650
24723
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24651
24724
|
if (styleUrlMatch?.[1])
|
|
24652
|
-
paths.push(
|
|
24725
|
+
paths.push(join45(fileDir, styleUrlMatch[1]));
|
|
24653
24726
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
24654
24727
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
24655
24728
|
if (urlMatches) {
|
|
24656
24729
|
for (const urlMatch of urlMatches) {
|
|
24657
|
-
paths.push(
|
|
24730
|
+
paths.push(join45(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
24658
24731
|
}
|
|
24659
24732
|
}
|
|
24660
|
-
return paths.map((path2) =>
|
|
24733
|
+
return paths.map((path2) => resolve35(path2));
|
|
24661
24734
|
}, readResourceCacheFile = async (cachePath) => {
|
|
24662
24735
|
try {
|
|
24663
24736
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -24688,7 +24761,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24688
24761
|
safeStableStringify(stylePreprocessors ?? null)
|
|
24689
24762
|
].join("\x00");
|
|
24690
24763
|
const cacheKey3 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
24691
|
-
return
|
|
24764
|
+
return join45(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey3}.json`);
|
|
24692
24765
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile8, stylePreprocessors) => {
|
|
24693
24766
|
const transformedSources = new Map;
|
|
24694
24767
|
const visited = new Set;
|
|
@@ -24699,7 +24772,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24699
24772
|
transformedFiles: 0
|
|
24700
24773
|
};
|
|
24701
24774
|
const transformFile = async (filePath) => {
|
|
24702
|
-
const resolvedPath =
|
|
24775
|
+
const resolvedPath = resolve35(filePath);
|
|
24703
24776
|
if (visited.has(resolvedPath))
|
|
24704
24777
|
return;
|
|
24705
24778
|
visited.add(resolvedPath);
|
|
@@ -24734,7 +24807,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24734
24807
|
return { stats, transformedSources };
|
|
24735
24808
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
24736
24809
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
24737
|
-
const outputPath =
|
|
24810
|
+
const outputPath = resolve35(join45(outDir, relative19(process.cwd(), resolve35(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
24738
24811
|
return [
|
|
24739
24812
|
outputPath,
|
|
24740
24813
|
buildIslandMetadataExports(readFileSync32(inputPath, "utf-8"))
|
|
@@ -24745,7 +24818,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24745
24818
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
24746
24819
|
const tsPath = __require.resolve("typescript");
|
|
24747
24820
|
const tsRootDir = dirname26(tsPath);
|
|
24748
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
24821
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve35(tsRootDir, "lib");
|
|
24749
24822
|
});
|
|
24750
24823
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
24751
24824
|
const options = {
|
|
@@ -24781,13 +24854,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24781
24854
|
const originalGetSourceFile = host2.getSourceFile;
|
|
24782
24855
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
24783
24856
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
24784
|
-
const resolvedPath =
|
|
24857
|
+
const resolvedPath = join45(tsLibDir, fileName);
|
|
24785
24858
|
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
24786
24859
|
}
|
|
24787
24860
|
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
24788
24861
|
};
|
|
24789
24862
|
const emitted = {};
|
|
24790
|
-
const resolvedOutDir =
|
|
24863
|
+
const resolvedOutDir = resolve35(outDir);
|
|
24791
24864
|
host2.writeFile = (fileName, text3) => {
|
|
24792
24865
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
24793
24866
|
emitted[relativePath] = text3;
|
|
@@ -24809,12 +24882,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24809
24882
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
24810
24883
|
return source;
|
|
24811
24884
|
}
|
|
24812
|
-
const resolvedPath =
|
|
24885
|
+
const resolvedPath = resolve35(fileName);
|
|
24813
24886
|
return transformedSources.get(resolvedPath) ?? source;
|
|
24814
24887
|
};
|
|
24815
24888
|
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
24816
24889
|
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
24817
|
-
const source = transformedSources.get(
|
|
24890
|
+
const source = transformedSources.get(resolve35(fileName));
|
|
24818
24891
|
if (source) {
|
|
24819
24892
|
return ts18.createSourceFile(fileName, source, languageVersion, true);
|
|
24820
24893
|
}
|
|
@@ -24836,9 +24909,9 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24836
24909
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
24837
24910
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
24838
24911
|
content,
|
|
24839
|
-
target:
|
|
24912
|
+
target: join45(outDir, fileName)
|
|
24840
24913
|
}));
|
|
24841
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
24914
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve35(target)));
|
|
24842
24915
|
return rawEntries.map(({ content, target }) => {
|
|
24843
24916
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
|
|
24844
24917
|
const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
|
|
@@ -24853,7 +24926,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24853
24926
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
24854
24927
|
});
|
|
24855
24928
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
24856
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
24929
|
+
processedContent += islandMetadataByOutputPath.get(resolve35(target)) ?? "";
|
|
24857
24930
|
return { content: processedContent, target };
|
|
24858
24931
|
});
|
|
24859
24932
|
});
|
|
@@ -24863,7 +24936,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24863
24936
|
})), { outputs: entries.length });
|
|
24864
24937
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
24865
24938
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
24866
|
-
jitContentCache.delete(
|
|
24939
|
+
jitContentCache.delete(resolve35(filePath));
|
|
24867
24940
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
24868
24941
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
24869
24942
|
let match;
|
|
@@ -24876,7 +24949,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path2, content) =>
|
|
|
24876
24949
|
}
|
|
24877
24950
|
return null;
|
|
24878
24951
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
24879
|
-
const sourceEntry =
|
|
24952
|
+
const sourceEntry = resolve35(import.meta.dir, "../angular/components/index.ts");
|
|
24880
24953
|
if (existsSync35(sourceEntry)) {
|
|
24881
24954
|
return sourceEntry.replace(/\\/g, "/");
|
|
24882
24955
|
}
|
|
@@ -25013,7 +25086,7 @@ ${fields}
|
|
|
25013
25086
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
25014
25087
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25015
25088
|
if (templateUrlMatch?.[1]) {
|
|
25016
|
-
const templatePath =
|
|
25089
|
+
const templatePath = join45(fileDir, templateUrlMatch[1]);
|
|
25017
25090
|
if (!existsSync35(templatePath)) {
|
|
25018
25091
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
25019
25092
|
}
|
|
@@ -25044,7 +25117,7 @@ ${fields}
|
|
|
25044
25117
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
25045
25118
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25046
25119
|
if (templateUrlMatch?.[1]) {
|
|
25047
|
-
const templatePath =
|
|
25120
|
+
const templatePath = join45(fileDir, templateUrlMatch[1]);
|
|
25048
25121
|
if (!existsSync35(templatePath)) {
|
|
25049
25122
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
25050
25123
|
}
|
|
@@ -25081,7 +25154,7 @@ ${fields}
|
|
|
25081
25154
|
return source;
|
|
25082
25155
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
25083
25156
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
25084
|
-
return readAndEscapeFile(
|
|
25157
|
+
return readAndEscapeFile(join45(fileDir, styleUrl), stylePreprocessors);
|
|
25085
25158
|
});
|
|
25086
25159
|
const results = await Promise.all(stylePromises);
|
|
25087
25160
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -25092,7 +25165,7 @@ ${fields}
|
|
|
25092
25165
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
25093
25166
|
if (!styleUrlMatch?.[1])
|
|
25094
25167
|
return source;
|
|
25095
|
-
const escaped = await readAndEscapeFile(
|
|
25168
|
+
const escaped = await readAndEscapeFile(join45(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
25096
25169
|
if (!escaped)
|
|
25097
25170
|
return source;
|
|
25098
25171
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -25166,10 +25239,10 @@ ${fields}
|
|
|
25166
25239
|
return "";
|
|
25167
25240
|
}
|
|
25168
25241
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
25169
|
-
const entryPath =
|
|
25242
|
+
const entryPath = resolve35(inputPath);
|
|
25170
25243
|
const allOutputs = [];
|
|
25171
25244
|
const visited = new Set;
|
|
25172
|
-
const baseDir =
|
|
25245
|
+
const baseDir = resolve35(rootDir ?? process.cwd());
|
|
25173
25246
|
let usesLegacyAnimations = false;
|
|
25174
25247
|
const angularTranspiler = new Bun.Transpiler({
|
|
25175
25248
|
loader: "ts",
|
|
@@ -25188,16 +25261,16 @@ ${fields}
|
|
|
25188
25261
|
`${candidate}.js`,
|
|
25189
25262
|
`${candidate}.jsx`,
|
|
25190
25263
|
`${candidate}.json`,
|
|
25191
|
-
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25264
|
+
join45(candidate, "index.ts"),
|
|
25265
|
+
join45(candidate, "index.tsx"),
|
|
25266
|
+
join45(candidate, "index.js"),
|
|
25267
|
+
join45(candidate, "index.jsx")
|
|
25195
25268
|
];
|
|
25196
25269
|
return candidates.find((file5) => existsSync35(file5));
|
|
25197
25270
|
};
|
|
25198
25271
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
25199
25272
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
25200
|
-
return resolveSourceFile2(
|
|
25273
|
+
return resolveSourceFile2(resolve35(fromDir, specifier));
|
|
25201
25274
|
}
|
|
25202
25275
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
25203
25276
|
if (aliased)
|
|
@@ -25206,7 +25279,7 @@ ${fields}
|
|
|
25206
25279
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
25207
25280
|
if (resolved.includes("/node_modules/"))
|
|
25208
25281
|
return;
|
|
25209
|
-
const absolute =
|
|
25282
|
+
const absolute = resolve35(resolved);
|
|
25210
25283
|
if (!absolute.startsWith(baseDir))
|
|
25211
25284
|
return;
|
|
25212
25285
|
return resolveSourceFile2(absolute);
|
|
@@ -25217,11 +25290,11 @@ ${fields}
|
|
|
25217
25290
|
const toOutputPath = (sourcePath) => {
|
|
25218
25291
|
const inputDir = dirname26(sourcePath);
|
|
25219
25292
|
const fileBase = basename15(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
25220
|
-
if (inputDir === outDir || inputDir.startsWith(`${outDir}${
|
|
25221
|
-
return
|
|
25293
|
+
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep5}`)) {
|
|
25294
|
+
return join45(inputDir, fileBase);
|
|
25222
25295
|
}
|
|
25223
25296
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
25224
|
-
return
|
|
25297
|
+
return join45(outDir, relativeDir, fileBase);
|
|
25225
25298
|
};
|
|
25226
25299
|
const withCacheBuster = (specifier) => {
|
|
25227
25300
|
if (!cacheBuster)
|
|
@@ -25258,21 +25331,21 @@ ${fields}
|
|
|
25258
25331
|
return `${prefix}${dots}`;
|
|
25259
25332
|
return `${prefix}../${dots}`;
|
|
25260
25333
|
});
|
|
25261
|
-
if (
|
|
25334
|
+
if (resolve35(actualPath) === entryPath) {
|
|
25262
25335
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
25263
25336
|
}
|
|
25264
25337
|
return processedContent;
|
|
25265
25338
|
};
|
|
25266
25339
|
const transpileFile = async (filePath) => {
|
|
25267
|
-
const resolved =
|
|
25340
|
+
const resolved = resolve35(filePath);
|
|
25268
25341
|
if (visited.has(resolved))
|
|
25269
25342
|
return;
|
|
25270
25343
|
visited.add(resolved);
|
|
25271
25344
|
if (resolved.endsWith(".json") && existsSync35(resolved)) {
|
|
25272
25345
|
const inputDir2 = dirname26(resolved);
|
|
25273
25346
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
25274
|
-
const targetDir2 =
|
|
25275
|
-
const targetPath2 =
|
|
25347
|
+
const targetDir2 = join45(outDir, relativeDir2);
|
|
25348
|
+
const targetPath2 = join45(targetDir2, basename15(resolved));
|
|
25276
25349
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
25277
25350
|
await fs5.copyFile(resolved, targetPath2);
|
|
25278
25351
|
allOutputs.push(targetPath2);
|
|
@@ -25290,7 +25363,7 @@ ${fields}
|
|
|
25290
25363
|
const fileBase = basename15(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
25291
25364
|
const targetPath = toOutputPath(actualPath);
|
|
25292
25365
|
const targetDir = dirname26(targetPath);
|
|
25293
|
-
const relativeDir =
|
|
25366
|
+
const relativeDir = relative19(outDir, targetDir).replace(/\\/g, "/");
|
|
25294
25367
|
const localImports = [];
|
|
25295
25368
|
const importRewrites = new Map;
|
|
25296
25369
|
const fromRegex = /(?:from|import)\s+['"]([^'".][^'"]*|\.\.?\/[^'"]+)['"]/g;
|
|
@@ -25311,12 +25384,12 @@ ${fields}
|
|
|
25311
25384
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
25312
25385
|
if (!resolved2)
|
|
25313
25386
|
return null;
|
|
25314
|
-
const relativeImport =
|
|
25387
|
+
const relativeImport = relative19(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
25315
25388
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
25316
25389
|
importRewrites.set(specifier, relativeRewrite);
|
|
25317
25390
|
return resolved2;
|
|
25318
25391
|
}).filter((path2) => Boolean(path2));
|
|
25319
|
-
const isEntry =
|
|
25392
|
+
const isEntry = resolve35(actualPath) === resolve35(entryPath);
|
|
25320
25393
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
25321
25394
|
const cacheKey3 = actualPath;
|
|
25322
25395
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey3) !== contentHash || !existsSync35(targetPath);
|
|
@@ -25351,13 +25424,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25351
25424
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
25352
25425
|
}
|
|
25353
25426
|
const compiledRoot = compiledParent;
|
|
25354
|
-
const indexesDir =
|
|
25427
|
+
const indexesDir = join45(compiledParent, "indexes");
|
|
25355
25428
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
25356
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
25429
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve35(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
25357
25430
|
if (!hmr) {
|
|
25358
25431
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
25359
25432
|
const cwd = process.cwd();
|
|
25360
|
-
const angularSrcDir =
|
|
25433
|
+
const angularSrcDir = resolve35(outRoot);
|
|
25361
25434
|
if (!existsSync35(angularSrcDir))
|
|
25362
25435
|
return;
|
|
25363
25436
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -25365,9 +25438,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25365
25438
|
absolute: false,
|
|
25366
25439
|
cwd: angularSrcDir
|
|
25367
25440
|
})) {
|
|
25368
|
-
const sourcePath =
|
|
25369
|
-
const cwdRel =
|
|
25370
|
-
const targetPath =
|
|
25441
|
+
const sourcePath = join45(angularSrcDir, rel);
|
|
25442
|
+
const cwdRel = relative19(cwd, sourcePath);
|
|
25443
|
+
const targetPath = join45(compiledRoot, cwdRel);
|
|
25371
25444
|
await fs5.mkdir(dirname26(targetPath), { recursive: true });
|
|
25372
25445
|
await fs5.copyFile(sourcePath, targetPath);
|
|
25373
25446
|
}
|
|
@@ -25375,8 +25448,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25375
25448
|
}
|
|
25376
25449
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
25377
25450
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
25378
|
-
const resolvedEntry =
|
|
25379
|
-
const relativeEntry =
|
|
25451
|
+
const resolvedEntry = resolve35(entry);
|
|
25452
|
+
const relativeEntry = relative19(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
25380
25453
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
25381
25454
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
25382
25455
|
entry: resolvedEntry
|
|
@@ -25384,21 +25457,21 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25384
25457
|
const fileBase = basename15(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
25385
25458
|
const jsName = `${fileBase}.js`;
|
|
25386
25459
|
const compiledFallbackPaths = [
|
|
25387
|
-
|
|
25388
|
-
|
|
25389
|
-
|
|
25390
|
-
].map((file5) =>
|
|
25460
|
+
join45(compiledRoot, relativeEntry),
|
|
25461
|
+
join45(compiledRoot, "pages", jsName),
|
|
25462
|
+
join45(compiledRoot, jsName)
|
|
25463
|
+
].map((file5) => resolve35(file5));
|
|
25391
25464
|
const resolveRawServerFile = (candidatePaths) => {
|
|
25392
25465
|
const normalizedCandidates = [
|
|
25393
|
-
...candidatePaths.map((file5) =>
|
|
25466
|
+
...candidatePaths.map((file5) => resolve35(file5)),
|
|
25394
25467
|
...compiledFallbackPaths
|
|
25395
25468
|
];
|
|
25396
|
-
let candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${
|
|
25469
|
+
let candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${sep5}${relativeEntry}`));
|
|
25397
25470
|
if (!candidate) {
|
|
25398
|
-
candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${
|
|
25471
|
+
candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${sep5}pages${sep5}${jsName}`));
|
|
25399
25472
|
}
|
|
25400
25473
|
if (!candidate) {
|
|
25401
|
-
candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${
|
|
25474
|
+
candidate = normalizedCandidates.find((file5) => existsSync35(file5) && file5.endsWith(`${sep5}${jsName}`));
|
|
25402
25475
|
}
|
|
25403
25476
|
if (!candidate) {
|
|
25404
25477
|
candidate = normalizedCandidates.find((file5) => existsSync35(file5));
|
|
@@ -25448,7 +25521,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25448
25521
|
})() : "no-providers";
|
|
25449
25522
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
25450
25523
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
25451
|
-
const clientFile =
|
|
25524
|
+
const clientFile = join45(indexesDir, jsName);
|
|
25452
25525
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync35(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
25453
25526
|
return {
|
|
25454
25527
|
clientPath: clientFile,
|
|
@@ -25480,13 +25553,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
25480
25553
|
const fragments = [];
|
|
25481
25554
|
if (providersInjection.appProvidersSource) {
|
|
25482
25555
|
const compiledAppProvidersPath = (() => {
|
|
25483
|
-
const angularDirAbs =
|
|
25484
|
-
const appSourceAbs =
|
|
25485
|
-
const rel =
|
|
25486
|
-
return
|
|
25556
|
+
const angularDirAbs = resolve35(outRoot);
|
|
25557
|
+
const appSourceAbs = resolve35(providersInjection.appProvidersSource);
|
|
25558
|
+
const rel = relative19(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
25559
|
+
return join45(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
25487
25560
|
})();
|
|
25488
25561
|
const appProvidersSpec = (() => {
|
|
25489
|
-
const rel =
|
|
25562
|
+
const rel = relative19(dirname26(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
25490
25563
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
25491
25564
|
})();
|
|
25492
25565
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -25511,7 +25584,7 @@ export const providers = [${fragments.join(", ")}];
|
|
|
25511
25584
|
}
|
|
25512
25585
|
}
|
|
25513
25586
|
await traceAngularPhase("wrapper/write-server-output", () => writeTextFileAtomically(rawServerFile, rewritten), { entry: resolvedEntry });
|
|
25514
|
-
const relativePath =
|
|
25587
|
+
const relativePath = relative19(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
25515
25588
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
25516
25589
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
25517
25590
|
import "${hmrClientPath5}";
|
|
@@ -25744,7 +25817,7 @@ var init_compileAngular = __esm(() => {
|
|
|
25744
25817
|
init_stylePreprocessor();
|
|
25745
25818
|
init_generatedDir();
|
|
25746
25819
|
devClientDir4 = resolveDevClientDir4();
|
|
25747
|
-
hmrClientPath5 =
|
|
25820
|
+
hmrClientPath5 = join45(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
25748
25821
|
jitContentCache = new Map;
|
|
25749
25822
|
wrapperOutputCache = new Map;
|
|
25750
25823
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -26199,7 +26272,7 @@ __export(exports_compileEmber, {
|
|
|
26199
26272
|
});
|
|
26200
26273
|
import { existsSync as existsSync36 } from "fs";
|
|
26201
26274
|
import { mkdir as mkdir12, rm as rm7 } from "fs/promises";
|
|
26202
|
-
import { basename as basename16, dirname as dirname27, extname as extname12, join as
|
|
26275
|
+
import { basename as basename16, dirname as dirname27, extname as extname12, join as join46, resolve as resolve36 } from "path";
|
|
26203
26276
|
var {build: bunBuild2, Transpiler: Transpiler5, write: write5, file: file5 } = globalThis.Bun;
|
|
26204
26277
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
26205
26278
|
if (cachedPreprocessor)
|
|
@@ -26295,7 +26368,7 @@ export const importSync = (specifier) => {
|
|
|
26295
26368
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
26296
26369
|
if (!originalImporter)
|
|
26297
26370
|
return;
|
|
26298
|
-
const candidateBase =
|
|
26371
|
+
const candidateBase = resolve36(dirname27(originalImporter), args.path);
|
|
26299
26372
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
26300
26373
|
for (const ext of extensionsToTry) {
|
|
26301
26374
|
const candidate = candidateBase + ext;
|
|
@@ -26318,7 +26391,7 @@ export const importSync = (specifier) => {
|
|
|
26318
26391
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
26319
26392
|
if (standalonePackages.has(args.path))
|
|
26320
26393
|
return;
|
|
26321
|
-
const internal =
|
|
26394
|
+
const internal = join46(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
26322
26395
|
if (existsSync36(internal))
|
|
26323
26396
|
return { path: internal };
|
|
26324
26397
|
return;
|
|
@@ -26354,7 +26427,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
26354
26427
|
export { PageComponent };
|
|
26355
26428
|
export default PageComponent;
|
|
26356
26429
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
26357
|
-
const resolvedEntry =
|
|
26430
|
+
const resolvedEntry = resolve36(entry);
|
|
26358
26431
|
const source = await file5(resolvedEntry).text();
|
|
26359
26432
|
let preprocessed = source;
|
|
26360
26433
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -26366,16 +26439,16 @@ export default PageComponent;
|
|
|
26366
26439
|
}
|
|
26367
26440
|
const transpiled = transpiler6.transformSync(preprocessed);
|
|
26368
26441
|
const baseName = basename16(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
26369
|
-
const tmpDir =
|
|
26370
|
-
const serverDir =
|
|
26371
|
-
const clientDir =
|
|
26442
|
+
const tmpDir = join46(compiledRoot, "_tmp");
|
|
26443
|
+
const serverDir = join46(compiledRoot, "server");
|
|
26444
|
+
const clientDir = join46(compiledRoot, "client");
|
|
26372
26445
|
await Promise.all([
|
|
26373
26446
|
mkdir12(tmpDir, { recursive: true }),
|
|
26374
26447
|
mkdir12(serverDir, { recursive: true }),
|
|
26375
26448
|
mkdir12(clientDir, { recursive: true })
|
|
26376
26449
|
]);
|
|
26377
|
-
const tmpPagePath =
|
|
26378
|
-
const tmpHarnessPath =
|
|
26450
|
+
const tmpPagePath = resolve36(join46(tmpDir, `${baseName}.module.js`));
|
|
26451
|
+
const tmpHarnessPath = resolve36(join46(tmpDir, `${baseName}.harness.js`));
|
|
26379
26452
|
await Promise.all([
|
|
26380
26453
|
write5(tmpPagePath, transpiled),
|
|
26381
26454
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -26383,7 +26456,7 @@ export default PageComponent;
|
|
|
26383
26456
|
const stagedSourceMap = new Map([
|
|
26384
26457
|
[tmpPagePath, resolvedEntry]
|
|
26385
26458
|
]);
|
|
26386
|
-
const serverPath =
|
|
26459
|
+
const serverPath = join46(serverDir, `${baseName}.js`);
|
|
26387
26460
|
const buildResult = await bunBuild2({
|
|
26388
26461
|
entrypoints: [tmpHarnessPath],
|
|
26389
26462
|
format: "esm",
|
|
@@ -26400,7 +26473,7 @@ export default PageComponent;
|
|
|
26400
26473
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
26401
26474
|
}
|
|
26402
26475
|
await rm7(tmpDir, { force: true, recursive: true });
|
|
26403
|
-
const clientPath =
|
|
26476
|
+
const clientPath = join46(clientDir, `${baseName}.js`);
|
|
26404
26477
|
await write5(clientPath, transpiled);
|
|
26405
26478
|
return { clientPath, serverPath };
|
|
26406
26479
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -26417,7 +26490,7 @@ export default PageComponent;
|
|
|
26417
26490
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
26418
26491
|
};
|
|
26419
26492
|
}, compileEmberFileSource = async (entry) => {
|
|
26420
|
-
const resolvedEntry =
|
|
26493
|
+
const resolvedEntry = resolve36(entry);
|
|
26421
26494
|
const source = await file5(resolvedEntry).text();
|
|
26422
26495
|
let preprocessed = source;
|
|
26423
26496
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -26428,7 +26501,7 @@ export default PageComponent;
|
|
|
26428
26501
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
26429
26502
|
}
|
|
26430
26503
|
return transpiler6.transformSync(preprocessed);
|
|
26431
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
26504
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join46(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join46(getEmberCompiledRoot(emberDir), "client");
|
|
26432
26505
|
var init_compileEmber = __esm(() => {
|
|
26433
26506
|
init_generatedDir();
|
|
26434
26507
|
transpiler6 = new Transpiler5({
|
|
@@ -26450,24 +26523,24 @@ __export(exports_buildReactVendor, {
|
|
|
26450
26523
|
computeVendorPaths: () => computeVendorPaths
|
|
26451
26524
|
});
|
|
26452
26525
|
import { existsSync as existsSync37, mkdirSync as mkdirSync8 } from "fs";
|
|
26453
|
-
import { join as
|
|
26526
|
+
import { join as join47, resolve as resolve37 } from "path";
|
|
26454
26527
|
import { rm as rm8 } from "fs/promises";
|
|
26455
26528
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
26456
26529
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
26457
26530
|
const candidates = [
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
26462
|
-
|
|
26463
|
-
|
|
26531
|
+
resolve37(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
26532
|
+
resolve37(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
26533
|
+
resolve37(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
26534
|
+
resolve37(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
26535
|
+
resolve37(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
26536
|
+
resolve37(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
26464
26537
|
];
|
|
26465
26538
|
for (const candidate of candidates) {
|
|
26466
26539
|
if (existsSync37(candidate)) {
|
|
26467
26540
|
return candidate.replace(/\\/g, "/");
|
|
26468
26541
|
}
|
|
26469
26542
|
}
|
|
26470
|
-
return (candidates[0] ??
|
|
26543
|
+
return (candidates[0] ?? resolve37(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
26471
26544
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
26472
26545
|
const paths = {};
|
|
26473
26546
|
for (const specifier of reactSpecifiers) {
|
|
@@ -26500,14 +26573,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
26500
26573
|
`)}
|
|
26501
26574
|
`;
|
|
26502
26575
|
}, buildReactVendor = async (buildDir) => {
|
|
26503
|
-
const vendorDir =
|
|
26576
|
+
const vendorDir = join47(buildDir, "react", "vendor");
|
|
26504
26577
|
mkdirSync8(vendorDir, { recursive: true });
|
|
26505
|
-
const tmpDir =
|
|
26578
|
+
const tmpDir = join47(buildDir, "_vendor_tmp");
|
|
26506
26579
|
mkdirSync8(tmpDir, { recursive: true });
|
|
26507
26580
|
const specifiers = reactSpecifiers;
|
|
26508
26581
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
26509
26582
|
const safeName = toSafeFileName(specifier);
|
|
26510
|
-
const entryPath =
|
|
26583
|
+
const entryPath = join47(tmpDir, `${safeName}.ts`);
|
|
26511
26584
|
const source = await generateEntrySource(specifier);
|
|
26512
26585
|
await Bun.write(entryPath, source);
|
|
26513
26586
|
return entryPath;
|
|
@@ -26575,7 +26648,7 @@ __export(exports_buildAngularVendor, {
|
|
|
26575
26648
|
computeAngularVendorPathsAsync: () => computeAngularVendorPathsAsync
|
|
26576
26649
|
});
|
|
26577
26650
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
26578
|
-
import { join as
|
|
26651
|
+
import { join as join48 } from "path";
|
|
26579
26652
|
import { rm as rm9 } from "fs/promises";
|
|
26580
26653
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
26581
26654
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
@@ -26672,14 +26745,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
26672
26745
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
26673
26746
|
return Array.from(angular).filter(isResolvable);
|
|
26674
26747
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
26675
|
-
const vendorDir =
|
|
26748
|
+
const vendorDir = join48(buildDir, "angular", "vendor");
|
|
26676
26749
|
mkdirSync9(vendorDir, { recursive: true });
|
|
26677
|
-
const tmpDir =
|
|
26750
|
+
const tmpDir = join48(buildDir, "_angular_vendor_tmp");
|
|
26678
26751
|
mkdirSync9(tmpDir, { recursive: true });
|
|
26679
26752
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
26680
26753
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
26681
26754
|
const safeName = toSafeFileName2(specifier);
|
|
26682
|
-
const entryPath =
|
|
26755
|
+
const entryPath = join48(tmpDir, `${safeName}.ts`);
|
|
26683
26756
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26684
26757
|
return entryPath;
|
|
26685
26758
|
}));
|
|
@@ -26710,9 +26783,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
26710
26783
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
26711
26784
|
return computeAngularVendorPaths(specifiers);
|
|
26712
26785
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
26713
|
-
const vendorDir =
|
|
26786
|
+
const vendorDir = join48(buildDir, "angular", "vendor", "server");
|
|
26714
26787
|
mkdirSync9(vendorDir, { recursive: true });
|
|
26715
|
-
const tmpDir =
|
|
26788
|
+
const tmpDir = join48(buildDir, "_angular_server_vendor_tmp");
|
|
26716
26789
|
mkdirSync9(tmpDir, { recursive: true });
|
|
26717
26790
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
26718
26791
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -26723,7 +26796,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
26723
26796
|
const specifiers = Array.from(allSpecs);
|
|
26724
26797
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
26725
26798
|
const safeName = toSafeFileName2(specifier);
|
|
26726
|
-
const entryPath =
|
|
26799
|
+
const entryPath = join48(tmpDir, `${safeName}.ts`);
|
|
26727
26800
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26728
26801
|
return entryPath;
|
|
26729
26802
|
}));
|
|
@@ -26745,9 +26818,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
26745
26818
|
return specifiers;
|
|
26746
26819
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
26747
26820
|
const paths = {};
|
|
26748
|
-
const vendorDir =
|
|
26821
|
+
const vendorDir = join48(buildDir, "angular", "vendor", "server");
|
|
26749
26822
|
for (const specifier of specifiers) {
|
|
26750
|
-
paths[specifier] =
|
|
26823
|
+
paths[specifier] = join48(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
26751
26824
|
}
|
|
26752
26825
|
return paths;
|
|
26753
26826
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -26803,17 +26876,17 @@ __export(exports_buildVueVendor, {
|
|
|
26803
26876
|
computeVueVendorPaths: () => computeVueVendorPaths
|
|
26804
26877
|
});
|
|
26805
26878
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
26806
|
-
import { join as
|
|
26879
|
+
import { join as join49 } from "path";
|
|
26807
26880
|
import { rm as rm10 } from "fs/promises";
|
|
26808
26881
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
26809
26882
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
26810
|
-
const vendorDir =
|
|
26883
|
+
const vendorDir = join49(buildDir, "vue", "vendor");
|
|
26811
26884
|
mkdirSync10(vendorDir, { recursive: true });
|
|
26812
|
-
const tmpDir =
|
|
26885
|
+
const tmpDir = join49(buildDir, "_vue_vendor_tmp");
|
|
26813
26886
|
mkdirSync10(tmpDir, { recursive: true });
|
|
26814
26887
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
26815
26888
|
const safeName = toSafeFileName3(specifier);
|
|
26816
|
-
const entryPath =
|
|
26889
|
+
const entryPath = join49(tmpDir, `${safeName}.ts`);
|
|
26817
26890
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
26818
26891
|
`);
|
|
26819
26892
|
return entryPath;
|
|
@@ -26841,7 +26914,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
26841
26914
|
const { readFileSync: readFileSync33, writeFileSync: writeFileSync10, readdirSync: readdirSync7 } = await import("fs");
|
|
26842
26915
|
const files = readdirSync7(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
26843
26916
|
for (const file6 of files) {
|
|
26844
|
-
const filePath =
|
|
26917
|
+
const filePath = join49(vendorDir, file6);
|
|
26845
26918
|
const content = readFileSync33(filePath, "utf-8");
|
|
26846
26919
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
26847
26920
|
continue;
|
|
@@ -26868,7 +26941,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
26868
26941
|
computeSvelteVendorPaths: () => computeSvelteVendorPaths
|
|
26869
26942
|
});
|
|
26870
26943
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
26871
|
-
import { join as
|
|
26944
|
+
import { join as join50 } from "path";
|
|
26872
26945
|
import { rm as rm11 } from "fs/promises";
|
|
26873
26946
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
26874
26947
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -26882,13 +26955,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
26882
26955
|
const specifiers = resolveVendorSpecifiers();
|
|
26883
26956
|
if (specifiers.length === 0)
|
|
26884
26957
|
return;
|
|
26885
|
-
const vendorDir =
|
|
26958
|
+
const vendorDir = join50(buildDir, "svelte", "vendor");
|
|
26886
26959
|
mkdirSync11(vendorDir, { recursive: true });
|
|
26887
|
-
const tmpDir =
|
|
26960
|
+
const tmpDir = join50(buildDir, "_svelte_vendor_tmp");
|
|
26888
26961
|
mkdirSync11(tmpDir, { recursive: true });
|
|
26889
26962
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
26890
26963
|
const safeName = toSafeFileName4(specifier);
|
|
26891
|
-
const entryPath =
|
|
26964
|
+
const entryPath = join50(tmpDir, `${safeName}.ts`);
|
|
26892
26965
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
26893
26966
|
`);
|
|
26894
26967
|
return entryPath;
|
|
@@ -26939,7 +27012,7 @@ import {
|
|
|
26939
27012
|
statSync as statSync4,
|
|
26940
27013
|
writeFileSync as writeFileSync10
|
|
26941
27014
|
} from "fs";
|
|
26942
|
-
import { basename as basename17, dirname as dirname28, extname as extname13, join as
|
|
27015
|
+
import { basename as basename17, dirname as dirname28, extname as extname13, join as join51, relative as relative20, resolve as resolve38 } from "path";
|
|
26943
27016
|
import { cwd, env as env3, exit } from "process";
|
|
26944
27017
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
26945
27018
|
var isBuildTraceEnabled = () => {
|
|
@@ -27073,8 +27146,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27073
27146
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
27074
27147
|
const glob = new Glob8("htmx*.min.js");
|
|
27075
27148
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
27076
|
-
const src =
|
|
27077
|
-
const dest =
|
|
27149
|
+
const src = join51(htmxDir, relPath);
|
|
27150
|
+
const dest = join51(htmxDestDir, "htmx.min.js");
|
|
27078
27151
|
copyFileSync3(src, dest);
|
|
27079
27152
|
return;
|
|
27080
27153
|
}
|
|
@@ -27088,8 +27161,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27088
27161
|
if (globalThis.__absoluteVersion)
|
|
27089
27162
|
return;
|
|
27090
27163
|
const candidates = [
|
|
27091
|
-
|
|
27092
|
-
|
|
27164
|
+
resolve38(import.meta.dir, "..", "..", "package.json"),
|
|
27165
|
+
resolve38(import.meta.dir, "..", "package.json")
|
|
27093
27166
|
];
|
|
27094
27167
|
const resolveCandidate = async (remaining) => {
|
|
27095
27168
|
const [candidate, ...rest] = remaining;
|
|
@@ -27105,7 +27178,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27105
27178
|
};
|
|
27106
27179
|
await resolveCandidate(candidates);
|
|
27107
27180
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file6, relPath, workerPaths) => {
|
|
27108
|
-
const absPath =
|
|
27181
|
+
const absPath = resolve38(file6, "..", relPath);
|
|
27109
27182
|
try {
|
|
27110
27183
|
statSync4(absPath);
|
|
27111
27184
|
workerPaths.add(absPath);
|
|
@@ -27158,7 +27231,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27158
27231
|
const out = [];
|
|
27159
27232
|
const directories = [];
|
|
27160
27233
|
for (const entry of entries) {
|
|
27161
|
-
const full =
|
|
27234
|
+
const full = join51(dir, entry.name);
|
|
27162
27235
|
if (entry.isDirectory()) {
|
|
27163
27236
|
directories.push(full);
|
|
27164
27237
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27184,7 +27257,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27184
27257
|
vuePagesPath
|
|
27185
27258
|
}) => {
|
|
27186
27259
|
const { readdirSync: readDir } = await import("fs");
|
|
27187
|
-
const devIndexDir =
|
|
27260
|
+
const devIndexDir = join51(buildPath, "_src_indexes");
|
|
27188
27261
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
27189
27262
|
if (reactIndexesPath && reactPagesPath) {
|
|
27190
27263
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -27200,42 +27273,42 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27200
27273
|
return;
|
|
27201
27274
|
}
|
|
27202
27275
|
const indexFiles = readDir(reactIndexesPath).filter((file6) => file6.endsWith(".tsx"));
|
|
27203
|
-
const pagesRel =
|
|
27276
|
+
const pagesRel = relative20(process.cwd(), resolve38(reactPagesPath)).replace(/\\/g, "/");
|
|
27204
27277
|
for (const file6 of indexFiles) {
|
|
27205
|
-
let content = readFileSync33(
|
|
27278
|
+
let content = readFileSync33(join51(reactIndexesPath, file6), "utf-8");
|
|
27206
27279
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
27207
|
-
writeFileSync10(
|
|
27280
|
+
writeFileSync10(join51(devIndexDir, file6), content);
|
|
27208
27281
|
}
|
|
27209
27282
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
27210
|
-
const svelteIndexDir =
|
|
27211
|
-
const sveltePageEntries = svelteEntries.filter((file6) =>
|
|
27283
|
+
const svelteIndexDir = join51(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
27284
|
+
const sveltePageEntries = svelteEntries.filter((file6) => resolve38(file6).startsWith(resolve38(sveltePagesPath)));
|
|
27212
27285
|
for (const entry of sveltePageEntries) {
|
|
27213
27286
|
const name = basename17(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
27214
|
-
const indexFile =
|
|
27287
|
+
const indexFile = join51(svelteIndexDir, "pages", `${name}.js`);
|
|
27215
27288
|
if (!existsSync38(indexFile))
|
|
27216
27289
|
continue;
|
|
27217
27290
|
let content = readFileSync33(indexFile, "utf-8");
|
|
27218
|
-
const srcRel =
|
|
27291
|
+
const srcRel = relative20(process.cwd(), resolve38(entry)).replace(/\\/g, "/");
|
|
27219
27292
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
27220
|
-
writeFileSync10(
|
|
27293
|
+
writeFileSync10(join51(devIndexDir, `${name}.svelte.js`), content);
|
|
27221
27294
|
}
|
|
27222
27295
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
27223
|
-
const vueIndexDir =
|
|
27224
|
-
const vuePageEntries = vueEntries.filter((file6) =>
|
|
27296
|
+
const vueIndexDir = join51(getFrameworkGeneratedDir("vue"), "indexes");
|
|
27297
|
+
const vuePageEntries = vueEntries.filter((file6) => resolve38(file6).startsWith(resolve38(vuePagesPath)));
|
|
27225
27298
|
for (const entry of vuePageEntries) {
|
|
27226
27299
|
const name = basename17(entry, ".vue");
|
|
27227
|
-
const indexFile =
|
|
27300
|
+
const indexFile = join51(vueIndexDir, `${name}.js`);
|
|
27228
27301
|
if (!existsSync38(indexFile))
|
|
27229
27302
|
continue;
|
|
27230
27303
|
let content = readFileSync33(indexFile, "utf-8");
|
|
27231
|
-
const srcRel =
|
|
27304
|
+
const srcRel = relative20(process.cwd(), resolve38(entry)).replace(/\\/g, "/");
|
|
27232
27305
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
27233
|
-
writeFileSync10(
|
|
27306
|
+
writeFileSync10(join51(devIndexDir, `${name}.vue.js`), content);
|
|
27234
27307
|
}
|
|
27235
27308
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
27236
27309
|
const urlFileMap = new Map;
|
|
27237
27310
|
for (const srcPath of urlReferencedFiles) {
|
|
27238
|
-
const rel =
|
|
27311
|
+
const rel = relative20(projectRoot, srcPath).replace(/\\/g, "/");
|
|
27239
27312
|
const name = basename17(srcPath);
|
|
27240
27313
|
const mtime = Math.round(statSync4(srcPath).mtimeMs);
|
|
27241
27314
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -27250,7 +27323,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27250
27323
|
const output = nonReactClientOutputs.find((artifact) => basename17(artifact.path).startsWith(`${srcBase}.`));
|
|
27251
27324
|
if (!output)
|
|
27252
27325
|
continue;
|
|
27253
|
-
urlFileMap.set(basename17(srcPath), `/${
|
|
27326
|
+
urlFileMap.set(basename17(srcPath), `/${relative20(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
27254
27327
|
}
|
|
27255
27328
|
return urlFileMap;
|
|
27256
27329
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -27391,10 +27464,10 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27391
27464
|
restoreTracePhase();
|
|
27392
27465
|
return;
|
|
27393
27466
|
}
|
|
27394
|
-
const traceDir =
|
|
27467
|
+
const traceDir = join51(buildPath2, ".absolute-trace");
|
|
27395
27468
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
27396
27469
|
mkdirSync12(traceDir, { recursive: true });
|
|
27397
|
-
writeFileSync10(
|
|
27470
|
+
writeFileSync10(join51(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
27398
27471
|
events: traceEvents,
|
|
27399
27472
|
frameworks: traceFrameworkNames,
|
|
27400
27473
|
generatedAt: new Date().toISOString(),
|
|
@@ -27425,16 +27498,16 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27425
27498
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
27426
27499
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
27427
27500
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
27428
|
-
const reactIndexesPath = reactDir &&
|
|
27429
|
-
const reactPagesPath = reactDir &&
|
|
27430
|
-
const htmlPagesPath = htmlDir &&
|
|
27431
|
-
const htmlScriptsPath = htmlDir &&
|
|
27432
|
-
const sveltePagesPath = svelteDir &&
|
|
27433
|
-
const vuePagesPath = vueDir &&
|
|
27434
|
-
const htmxPagesPath = htmxDir &&
|
|
27435
|
-
const htmxScriptsPath = htmxDir &&
|
|
27436
|
-
const angularPagesPath = angularDir &&
|
|
27437
|
-
const emberPagesPath = emberDir &&
|
|
27501
|
+
const reactIndexesPath = reactDir && join51(getFrameworkGeneratedDir("react"), "indexes");
|
|
27502
|
+
const reactPagesPath = reactDir && join51(reactDir, "pages");
|
|
27503
|
+
const htmlPagesPath = htmlDir && join51(htmlDir, "pages");
|
|
27504
|
+
const htmlScriptsPath = htmlDir && join51(htmlDir, "scripts");
|
|
27505
|
+
const sveltePagesPath = svelteDir && join51(svelteDir, "pages");
|
|
27506
|
+
const vuePagesPath = vueDir && join51(vueDir, "pages");
|
|
27507
|
+
const htmxPagesPath = htmxDir && join51(htmxDir, "pages");
|
|
27508
|
+
const htmxScriptsPath = htmxDir && join51(htmxDir, "scripts");
|
|
27509
|
+
const angularPagesPath = angularDir && join51(angularDir, "pages");
|
|
27510
|
+
const emberPagesPath = emberDir && join51(emberDir, "pages");
|
|
27438
27511
|
const frontends = [
|
|
27439
27512
|
reactDir,
|
|
27440
27513
|
htmlDir,
|
|
@@ -27495,8 +27568,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27495
27568
|
const [firstEntry] = serverDirMap;
|
|
27496
27569
|
if (!firstEntry)
|
|
27497
27570
|
throw new Error("Expected at least one server directory entry");
|
|
27498
|
-
serverRoot =
|
|
27499
|
-
serverOutDir =
|
|
27571
|
+
serverRoot = join51(firstEntry.dir, firstEntry.subdir);
|
|
27572
|
+
serverOutDir = join51(buildPath, basename17(firstEntry.dir));
|
|
27500
27573
|
} else if (serverDirMap.length > 1) {
|
|
27501
27574
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
27502
27575
|
serverOutDir = buildPath;
|
|
@@ -27515,13 +27588,13 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27515
27588
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
27516
27589
|
if (!isIncremental || !incrementalFiles)
|
|
27517
27590
|
return entryPoints;
|
|
27518
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
27591
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve38(f2)));
|
|
27519
27592
|
const matchingEntries = [];
|
|
27520
27593
|
for (const entry of entryPoints) {
|
|
27521
27594
|
const sourceFile = mapToSource(entry);
|
|
27522
27595
|
if (!sourceFile)
|
|
27523
27596
|
continue;
|
|
27524
|
-
if (!normalizedIncremental.has(
|
|
27597
|
+
if (!normalizedIncremental.has(resolve38(sourceFile)))
|
|
27525
27598
|
continue;
|
|
27526
27599
|
matchingEntries.push(entry);
|
|
27527
27600
|
}
|
|
@@ -27531,7 +27604,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27531
27604
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
27532
27605
|
}
|
|
27533
27606
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
27534
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
27607
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join51(buildPath, "assets"), {
|
|
27535
27608
|
force: true,
|
|
27536
27609
|
recursive: true
|
|
27537
27610
|
}));
|
|
@@ -27645,11 +27718,11 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27645
27718
|
}
|
|
27646
27719
|
}
|
|
27647
27720
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
27648
|
-
const htmlConventionsOutDir =
|
|
27721
|
+
const htmlConventionsOutDir = join51(buildPath, "conventions", "html");
|
|
27649
27722
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
27650
27723
|
const htmlPathRemap = new Map;
|
|
27651
27724
|
for (const sourcePath of htmlConventionSources) {
|
|
27652
|
-
const dest =
|
|
27725
|
+
const dest = join51(htmlConventionsOutDir, basename17(sourcePath));
|
|
27653
27726
|
cpSync(sourcePath, dest, { force: true });
|
|
27654
27727
|
htmlPathRemap.set(sourcePath, dest);
|
|
27655
27728
|
}
|
|
@@ -27697,13 +27770,13 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27697
27770
|
return scoped;
|
|
27698
27771
|
return scoped.filter((entry) => {
|
|
27699
27772
|
const source = mapToSource(entry);
|
|
27700
|
-
return source !== null && deferPageEntries.except.has(
|
|
27773
|
+
return source !== null && deferPageEntries.except.has(resolve38(source));
|
|
27701
27774
|
});
|
|
27702
27775
|
};
|
|
27703
27776
|
const mapReactIndexToPage = (entry) => {
|
|
27704
|
-
if (reactIndexesPath && reactPagesPath && entry.startsWith(
|
|
27777
|
+
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve38(reactIndexesPath))) {
|
|
27705
27778
|
const pageName = basename17(entry, ".tsx");
|
|
27706
|
-
return
|
|
27779
|
+
return join51(reactPagesPath, `${pageName}.tsx`);
|
|
27707
27780
|
}
|
|
27708
27781
|
return null;
|
|
27709
27782
|
};
|
|
@@ -27743,7 +27816,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27743
27816
|
for (const entry of vueEntries) {
|
|
27744
27817
|
const name = basename17(entry, ".vue");
|
|
27745
27818
|
if (ssrOnlyPageNames.has(name)) {
|
|
27746
|
-
resolved.add(
|
|
27819
|
+
resolved.add(resolve38(entry));
|
|
27747
27820
|
}
|
|
27748
27821
|
}
|
|
27749
27822
|
return resolved;
|
|
@@ -27858,7 +27931,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27858
27931
|
const clientPath = islandSvelteClientPaths[idx];
|
|
27859
27932
|
if (!sourcePath || !clientPath)
|
|
27860
27933
|
continue;
|
|
27861
|
-
islandSvelteClientPathMap.set(
|
|
27934
|
+
islandSvelteClientPathMap.set(resolve38(sourcePath), clientPath);
|
|
27862
27935
|
}
|
|
27863
27936
|
const islandVueClientPathMap = new Map;
|
|
27864
27937
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -27866,7 +27939,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27866
27939
|
const clientPath = islandVueClientPaths[idx];
|
|
27867
27940
|
if (!sourcePath || !clientPath)
|
|
27868
27941
|
continue;
|
|
27869
|
-
islandVueClientPathMap.set(
|
|
27942
|
+
islandVueClientPathMap.set(resolve38(sourcePath), clientPath);
|
|
27870
27943
|
}
|
|
27871
27944
|
const islandAngularClientPathMap = new Map;
|
|
27872
27945
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -27874,7 +27947,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27874
27947
|
const clientPath = islandAngularClientPaths[idx];
|
|
27875
27948
|
if (!sourcePath || !clientPath)
|
|
27876
27949
|
continue;
|
|
27877
|
-
islandAngularClientPathMap.set(
|
|
27950
|
+
islandAngularClientPathMap.set(resolve38(sourcePath), clientPath);
|
|
27878
27951
|
}
|
|
27879
27952
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
27880
27953
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -27885,7 +27958,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27885
27958
|
const compileReactConventions = async () => {
|
|
27886
27959
|
if (reactConventionSources.length === 0)
|
|
27887
27960
|
return emptyStringArray;
|
|
27888
|
-
const destDir =
|
|
27961
|
+
const destDir = join51(buildPath, "conventions", "react");
|
|
27889
27962
|
rmSync2(destDir, { force: true, recursive: true });
|
|
27890
27963
|
mkdirSync12(destDir, { recursive: true });
|
|
27891
27964
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -27929,7 +28002,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
27929
28002
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
27930
28003
|
]);
|
|
27931
28004
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
27932
|
-
const destDir =
|
|
28005
|
+
const destDir = join51(buildPath, "conventions", framework);
|
|
27933
28006
|
rmSync2(destDir, { force: true, recursive: true });
|
|
27934
28007
|
mkdirSync12(destDir, { recursive: true });
|
|
27935
28008
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -28004,7 +28077,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28004
28077
|
}
|
|
28005
28078
|
})) : {
|
|
28006
28079
|
entries: [],
|
|
28007
|
-
generatedRoot:
|
|
28080
|
+
generatedRoot: join51(buildPath, "_island_entries")
|
|
28008
28081
|
};
|
|
28009
28082
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
28010
28083
|
if (!deferPageEntries && serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -28040,7 +28113,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28040
28113
|
return {};
|
|
28041
28114
|
}
|
|
28042
28115
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
28043
|
-
const refreshEntry =
|
|
28116
|
+
const refreshEntry = join51(reactIndexesPath, "_refresh.tsx");
|
|
28044
28117
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
28045
28118
|
reactClientEntryPoints.push(refreshEntry);
|
|
28046
28119
|
}
|
|
@@ -28157,19 +28230,19 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28157
28230
|
throw: false
|
|
28158
28231
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
28159
28232
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
28160
|
-
rmSync2(
|
|
28233
|
+
rmSync2(join51(buildPath, "react", "generated", "indexes"), {
|
|
28161
28234
|
force: true,
|
|
28162
28235
|
recursive: true
|
|
28163
28236
|
});
|
|
28164
28237
|
}
|
|
28165
28238
|
if (angularDir && angularClientPaths.length > 0) {
|
|
28166
|
-
rmSync2(
|
|
28239
|
+
rmSync2(join51(buildPath, "angular", "indexes"), {
|
|
28167
28240
|
force: true,
|
|
28168
28241
|
recursive: true
|
|
28169
28242
|
});
|
|
28170
28243
|
}
|
|
28171
28244
|
if (islandClientEntryPoints.length > 0) {
|
|
28172
|
-
rmSync2(
|
|
28245
|
+
rmSync2(join51(buildPath, "islands"), {
|
|
28173
28246
|
force: true,
|
|
28174
28247
|
recursive: true
|
|
28175
28248
|
});
|
|
@@ -28284,7 +28357,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28284
28357
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
28285
28358
|
entrypoints: globalCssEntries,
|
|
28286
28359
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
28287
|
-
outdir: stylesDir ?
|
|
28360
|
+
outdir: stylesDir ? join51(buildPath, basename17(stylesDir)) : buildPath,
|
|
28288
28361
|
plugins: [stylePreprocessorPlugin2],
|
|
28289
28362
|
root: stylesDir || clientRoot,
|
|
28290
28363
|
target: "browser",
|
|
@@ -28293,7 +28366,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28293
28366
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
28294
28367
|
entrypoints: vueCssPaths,
|
|
28295
28368
|
naming: `[name].[hash].[ext]`,
|
|
28296
|
-
outdir:
|
|
28369
|
+
outdir: join51(buildPath, assetsPath ? basename17(assetsPath) : "assets", "css"),
|
|
28297
28370
|
target: "browser",
|
|
28298
28371
|
throw: false
|
|
28299
28372
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -28315,15 +28388,15 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28315
28388
|
}
|
|
28316
28389
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
28317
28390
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
28318
|
-
const sourcemapDir =
|
|
28391
|
+
const sourcemapDir = join51(projectRoot, "sourcemaps");
|
|
28319
28392
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
28320
28393
|
const mapFiles = readdirSync7(buildPath, {
|
|
28321
28394
|
encoding: "utf8",
|
|
28322
28395
|
recursive: true
|
|
28323
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
28396
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join51(buildPath, entry));
|
|
28324
28397
|
for (const mapPath of mapFiles) {
|
|
28325
28398
|
chainExternalSourcemap2(mapPath);
|
|
28326
|
-
renameSync(mapPath,
|
|
28399
|
+
renameSync(mapPath, join51(sourcemapDir, basename17(mapPath)));
|
|
28327
28400
|
const jsPath = mapPath.slice(0, -4);
|
|
28328
28401
|
try {
|
|
28329
28402
|
const javascript = readFileSync33(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
@@ -28331,7 +28404,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28331
28404
|
writeFileSync10(jsPath, javascript);
|
|
28332
28405
|
} catch {}
|
|
28333
28406
|
}
|
|
28334
|
-
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${
|
|
28407
|
+
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative20(projectRoot, sourcemapDir)}/`);
|
|
28335
28408
|
}
|
|
28336
28409
|
if (serverResult && !serverResult.success && serverLogs.length > 0) {
|
|
28337
28410
|
handlePassFailure(serverLogs, "server", "Server");
|
|
@@ -28388,7 +28461,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28388
28461
|
};
|
|
28389
28462
|
await tracePhase("postprocess/client-rewrite", rewriteClientGroups, clientRewriteStats);
|
|
28390
28463
|
if (!hmr) {
|
|
28391
|
-
const reactVendorDir =
|
|
28464
|
+
const reactVendorDir = join51(buildPath, "react", "vendor");
|
|
28392
28465
|
const vendorChunkPaths = existsSync38(reactVendorDir) ? [
|
|
28393
28466
|
...new Glob8("**/*.js").scanSync({
|
|
28394
28467
|
absolute: true,
|
|
@@ -28408,7 +28481,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28408
28481
|
const fileDir = dirname28(artifact.path);
|
|
28409
28482
|
const relativePaths = {};
|
|
28410
28483
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
28411
|
-
const rel =
|
|
28484
|
+
const rel = relative20(fileDir, absolute);
|
|
28412
28485
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
28413
28486
|
}
|
|
28414
28487
|
return relativePaths;
|
|
@@ -28521,7 +28594,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28521
28594
|
if (skipAngularClientBundle) {
|
|
28522
28595
|
for (const clientPath of angularClientPaths) {
|
|
28523
28596
|
const fileBase = basename17(clientPath, ".js");
|
|
28524
|
-
const relFromCwd =
|
|
28597
|
+
const relFromCwd = relative20(projectRoot, clientPath).replace(/\\/g, "/");
|
|
28525
28598
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
28526
28599
|
}
|
|
28527
28600
|
}
|
|
@@ -28546,7 +28619,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28546
28619
|
const processHtmlPages = async () => {
|
|
28547
28620
|
if (!(htmlDir && htmlPagesPath))
|
|
28548
28621
|
return;
|
|
28549
|
-
const outputHtmlPages = isSingle ?
|
|
28622
|
+
const outputHtmlPages = isSingle ? join51(buildPath, "pages") : join51(buildPath, basename17(htmlDir), "pages");
|
|
28550
28623
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
28551
28624
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
28552
28625
|
force: true,
|
|
@@ -28575,14 +28648,14 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28575
28648
|
const processHtmxPages = async () => {
|
|
28576
28649
|
if (!(htmxDir && htmxPagesPath))
|
|
28577
28650
|
return;
|
|
28578
|
-
const outputHtmxPages = isSingle ?
|
|
28651
|
+
const outputHtmxPages = isSingle ? join51(buildPath, "pages") : join51(buildPath, basename17(htmxDir), "pages");
|
|
28579
28652
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
28580
28653
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
28581
28654
|
force: true,
|
|
28582
28655
|
recursive: true
|
|
28583
28656
|
});
|
|
28584
28657
|
if (shouldCopyHtmx) {
|
|
28585
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
28658
|
+
const htmxDestDir = isSingle ? buildPath : join51(buildPath, basename17(htmxDir));
|
|
28586
28659
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
28587
28660
|
}
|
|
28588
28661
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -28673,7 +28746,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28673
28746
|
}))
|
|
28674
28747
|
];
|
|
28675
28748
|
setSpaRouteManifest(spaRouteHosts);
|
|
28676
|
-
writeFileSync10(
|
|
28749
|
+
writeFileSync10(join51(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
28677
28750
|
if (isIncremental) {
|
|
28678
28751
|
writeBuildTrace(buildPath);
|
|
28679
28752
|
return {
|
|
@@ -28683,9 +28756,9 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
28683
28756
|
pageEntries
|
|
28684
28757
|
};
|
|
28685
28758
|
}
|
|
28686
|
-
writeFileSync10(
|
|
28759
|
+
writeFileSync10(join51(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
28687
28760
|
if (Object.keys(conventionsMap).length > 0) {
|
|
28688
|
-
writeFileSync10(
|
|
28761
|
+
writeFileSync10(join51(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
28689
28762
|
}
|
|
28690
28763
|
writeBuildTrace(buildPath);
|
|
28691
28764
|
if (mode === "production") {
|
|
@@ -28804,7 +28877,7 @@ var init_build = __esm(() => {
|
|
|
28804
28877
|
|
|
28805
28878
|
// src/build/buildEmberVendor.ts
|
|
28806
28879
|
import { mkdirSync as mkdirSync13, existsSync as existsSync39 } from "fs";
|
|
28807
|
-
import { join as
|
|
28880
|
+
import { join as join52 } from "path";
|
|
28808
28881
|
import { rm as rm12 } from "fs/promises";
|
|
28809
28882
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
28810
28883
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -28856,7 +28929,7 @@ export const importSync = (specifier) => {
|
|
|
28856
28929
|
if (standaloneSpecifiers.has(specifier)) {
|
|
28857
28930
|
return { resolveTo: specifier, specifier };
|
|
28858
28931
|
}
|
|
28859
|
-
const emberInternalPath =
|
|
28932
|
+
const emberInternalPath = join52(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
28860
28933
|
if (!existsSync39(emberInternalPath)) {
|
|
28861
28934
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
28862
28935
|
}
|
|
@@ -28888,7 +28961,7 @@ export const importSync = (specifier) => {
|
|
|
28888
28961
|
if (standalonePackages.has(args.path)) {
|
|
28889
28962
|
return;
|
|
28890
28963
|
}
|
|
28891
|
-
const internal =
|
|
28964
|
+
const internal = join52(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
28892
28965
|
if (existsSync39(internal)) {
|
|
28893
28966
|
return { path: internal };
|
|
28894
28967
|
}
|
|
@@ -28896,16 +28969,16 @@ export const importSync = (specifier) => {
|
|
|
28896
28969
|
});
|
|
28897
28970
|
}
|
|
28898
28971
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
28899
|
-
const vendorDir =
|
|
28972
|
+
const vendorDir = join52(buildDir, "ember", "vendor");
|
|
28900
28973
|
mkdirSync13(vendorDir, { recursive: true });
|
|
28901
|
-
const tmpDir =
|
|
28974
|
+
const tmpDir = join52(buildDir, "_ember_vendor_tmp");
|
|
28902
28975
|
mkdirSync13(tmpDir, { recursive: true });
|
|
28903
|
-
const macrosShimPath =
|
|
28976
|
+
const macrosShimPath = join52(tmpDir, "embroider_macros_shim.js");
|
|
28904
28977
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
28905
28978
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
28906
28979
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
28907
28980
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
28908
|
-
const entryPath =
|
|
28981
|
+
const entryPath = join52(tmpDir, `${safeName}.js`);
|
|
28909
28982
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
28910
28983
|
` : generateVendorEntrySource2(resolution);
|
|
28911
28984
|
await Bun.write(entryPath, source);
|
|
@@ -29063,7 +29136,7 @@ __export(exports_dependencyGraph, {
|
|
|
29063
29136
|
});
|
|
29064
29137
|
import { existsSync as existsSync40, readFileSync as readFileSync34 } from "fs";
|
|
29065
29138
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
29066
|
-
import { resolve as
|
|
29139
|
+
import { resolve as resolve39 } from "path";
|
|
29067
29140
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
29068
29141
|
const lower = filePath.toLowerCase();
|
|
29069
29142
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -29077,8 +29150,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
29077
29150
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
29078
29151
|
return null;
|
|
29079
29152
|
}
|
|
29080
|
-
const fromDir =
|
|
29081
|
-
const normalized =
|
|
29153
|
+
const fromDir = resolve39(fromFile, "..");
|
|
29154
|
+
const normalized = resolve39(fromDir, importPath);
|
|
29082
29155
|
const extensions = [
|
|
29083
29156
|
".ts",
|
|
29084
29157
|
".tsx",
|
|
@@ -29108,7 +29181,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
29108
29181
|
dependents.delete(normalizedPath);
|
|
29109
29182
|
}
|
|
29110
29183
|
}, addFileToGraph = (graph, filePath) => {
|
|
29111
|
-
const normalizedPath =
|
|
29184
|
+
const normalizedPath = resolve39(filePath);
|
|
29112
29185
|
if (!existsSync40(normalizedPath))
|
|
29113
29186
|
return;
|
|
29114
29187
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -29135,10 +29208,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
29135
29208
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
29136
29209
|
const processedFiles = new Set;
|
|
29137
29210
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
29138
|
-
const resolvedDirs = directories.map((dir) =>
|
|
29211
|
+
const resolvedDirs = directories.map((dir) => resolve39(dir)).filter((dir) => existsSync40(dir));
|
|
29139
29212
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
29140
29213
|
for (const file6 of allFiles) {
|
|
29141
|
-
const fullPath =
|
|
29214
|
+
const fullPath = resolve39(file6);
|
|
29142
29215
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
29143
29216
|
continue;
|
|
29144
29217
|
if (processedFiles.has(fullPath))
|
|
@@ -29251,7 +29324,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
29251
29324
|
return [];
|
|
29252
29325
|
}
|
|
29253
29326
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
29254
|
-
const normalizedPath =
|
|
29327
|
+
const normalizedPath = resolve39(changedFile);
|
|
29255
29328
|
const affected = new Set;
|
|
29256
29329
|
const toProcess = [normalizedPath];
|
|
29257
29330
|
const processNode = (current) => {
|
|
@@ -29282,7 +29355,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
29282
29355
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
29283
29356
|
graph.dependents.delete(normalizedPath);
|
|
29284
29357
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
29285
|
-
const normalizedPath =
|
|
29358
|
+
const normalizedPath = resolve39(filePath);
|
|
29286
29359
|
removeDepsForFile(graph, normalizedPath);
|
|
29287
29360
|
removeDependentsForFile(graph, normalizedPath);
|
|
29288
29361
|
};
|
|
@@ -29325,12 +29398,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
29325
29398
|
};
|
|
29326
29399
|
|
|
29327
29400
|
// src/dev/configResolver.ts
|
|
29328
|
-
import { resolve as
|
|
29401
|
+
import { resolve as resolve40 } from "path";
|
|
29329
29402
|
var resolveBuildPaths = (config) => {
|
|
29330
29403
|
const cwd2 = process.cwd();
|
|
29331
29404
|
const normalize = (path2) => path2.replace(/\\/g, "/");
|
|
29332
|
-
const withDefault = (value, fallback) => normalize(
|
|
29333
|
-
const optional = (value) => value ? normalize(
|
|
29405
|
+
const withDefault = (value, fallback) => normalize(resolve40(cwd2, value ?? fallback));
|
|
29406
|
+
const optional = (value) => value ? normalize(resolve40(cwd2, value)) : undefined;
|
|
29334
29407
|
return {
|
|
29335
29408
|
angularDir: optional(config.angularDirectory),
|
|
29336
29409
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -29390,7 +29463,7 @@ var init_clientManager = __esm(() => {
|
|
|
29390
29463
|
|
|
29391
29464
|
// src/dev/pathUtils.ts
|
|
29392
29465
|
import { existsSync as existsSync41, readdirSync as readdirSync8, readFileSync as readFileSync35 } from "fs";
|
|
29393
|
-
import { dirname as dirname29, resolve as
|
|
29466
|
+
import { dirname as dirname29, resolve as resolve41 } from "path";
|
|
29394
29467
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
29395
29468
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
29396
29469
|
return "ignored";
|
|
@@ -29466,7 +29539,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29466
29539
|
return "unknown";
|
|
29467
29540
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
29468
29541
|
const out = new Set;
|
|
29469
|
-
const angularRoot =
|
|
29542
|
+
const angularRoot = resolve41(angularDir);
|
|
29470
29543
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
29471
29544
|
const walk = (dir) => {
|
|
29472
29545
|
let entries;
|
|
@@ -29479,7 +29552,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29479
29552
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
29480
29553
|
continue;
|
|
29481
29554
|
}
|
|
29482
|
-
const full =
|
|
29555
|
+
const full = resolve41(dir, entry.name);
|
|
29483
29556
|
if (entry.isDirectory()) {
|
|
29484
29557
|
walk(full);
|
|
29485
29558
|
continue;
|
|
@@ -29520,7 +29593,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29520
29593
|
}
|
|
29521
29594
|
const componentDir = dirname29(full);
|
|
29522
29595
|
for (const ref of refs) {
|
|
29523
|
-
const refAbs = normalizePath2(
|
|
29596
|
+
const refAbs = normalizePath2(resolve41(componentDir, ref));
|
|
29524
29597
|
const refDir = normalizePath2(dirname29(refAbs));
|
|
29525
29598
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
29526
29599
|
continue;
|
|
@@ -29537,7 +29610,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29537
29610
|
const push = (path2) => {
|
|
29538
29611
|
if (!path2)
|
|
29539
29612
|
return;
|
|
29540
|
-
const abs = normalizePath2(
|
|
29613
|
+
const abs = normalizePath2(resolve41(cwd2, path2));
|
|
29541
29614
|
if (!roots.includes(abs))
|
|
29542
29615
|
roots.push(abs);
|
|
29543
29616
|
};
|
|
@@ -29562,7 +29635,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29562
29635
|
push(cfg.assetsDir);
|
|
29563
29636
|
push(cfg.stylesDir);
|
|
29564
29637
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
29565
|
-
const abs = normalizePath2(
|
|
29638
|
+
const abs = normalizePath2(resolve41(cwd2, candidate));
|
|
29566
29639
|
if (existsSync41(abs) && !roots.includes(abs))
|
|
29567
29640
|
roots.push(abs);
|
|
29568
29641
|
}
|
|
@@ -29573,7 +29646,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
29573
29646
|
continue;
|
|
29574
29647
|
if (entry.name.startsWith("."))
|
|
29575
29648
|
continue;
|
|
29576
|
-
const abs = normalizePath2(
|
|
29649
|
+
const abs = normalizePath2(resolve41(cwd2, entry.name));
|
|
29577
29650
|
if (roots.includes(abs))
|
|
29578
29651
|
continue;
|
|
29579
29652
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -29657,7 +29730,7 @@ var init_pathUtils = __esm(() => {
|
|
|
29657
29730
|
// src/dev/devPrescan.ts
|
|
29658
29731
|
import { existsSync as existsSync42, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
29659
29732
|
import { mkdir as mkdir13, readFile as readFile8, rename as rename4, writeFile as writeFile10 } from "fs/promises";
|
|
29660
|
-
import { join as
|
|
29733
|
+
import { join as join53 } from "path";
|
|
29661
29734
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
29662
29735
|
config.reactDirectory,
|
|
29663
29736
|
config.svelteDirectory,
|
|
@@ -29665,8 +29738,8 @@ var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2
|
|
|
29665
29738
|
config.angularDirectory,
|
|
29666
29739
|
config.htmlDirectory,
|
|
29667
29740
|
config.htmxDirectory
|
|
29668
|
-
].filter((dir) => Boolean(dir)))), devPrescanEnabled = () => process.env.ABSOLUTE_DEV_PRESCAN === "1", sleep = (delayMs) => new Promise((
|
|
29669
|
-
setTimeout(
|
|
29741
|
+
].filter((dir) => Boolean(dir)))), devPrescanEnabled = () => process.env.ABSOLUTE_DEV_PRESCAN === "1", sleep = (delayMs) => new Promise((resolve42) => {
|
|
29742
|
+
setTimeout(resolve42, delayMs);
|
|
29670
29743
|
}), isPayload = (value) => typeof value === "object" && value !== null && ("version" in value) && value.version === PAYLOAD_VERSION, tryReadPrescan = async (path2) => {
|
|
29671
29744
|
if (!existsSync42(path2))
|
|
29672
29745
|
return;
|
|
@@ -29715,13 +29788,13 @@ var init_devPrescan = __esm(() => {
|
|
|
29715
29788
|
init_configResolver();
|
|
29716
29789
|
init_dependencyGraph();
|
|
29717
29790
|
init_pathUtils();
|
|
29718
|
-
PRESCAN_DIR =
|
|
29791
|
+
PRESCAN_DIR = join53(".absolutejs", "dev-prescan");
|
|
29719
29792
|
});
|
|
29720
29793
|
|
|
29721
29794
|
// src/dev/fileWatcher.ts
|
|
29722
29795
|
import { watch } from "fs";
|
|
29723
29796
|
import { existsSync as existsSync43, readdirSync as readdirSync10, statSync as statSync5 } from "fs";
|
|
29724
|
-
import { dirname as dirname30, join as
|
|
29797
|
+
import { dirname as dirname30, join as join54, resolve as resolve42 } from "path";
|
|
29725
29798
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
29726
29799
|
try {
|
|
29727
29800
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -29753,7 +29826,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
29753
29826
|
for (const name of entries) {
|
|
29754
29827
|
if (shouldSkipFilename(name, isStylesDir))
|
|
29755
29828
|
continue;
|
|
29756
|
-
const child =
|
|
29829
|
+
const child = join54(eventDir, name).replace(/\\/g, "/");
|
|
29757
29830
|
let st2;
|
|
29758
29831
|
try {
|
|
29759
29832
|
st2 = statSync5(child);
|
|
@@ -29774,7 +29847,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
29774
29847
|
return;
|
|
29775
29848
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
29776
29849
|
if (event === "rename") {
|
|
29777
|
-
const eventDir = dirname30(
|
|
29850
|
+
const eventDir = dirname30(join54(absolutePath, filename)).replace(/\\/g, "/");
|
|
29778
29851
|
atomicRecoveryScan(eventDir);
|
|
29779
29852
|
for (const delay of [25, 100]) {
|
|
29780
29853
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -29783,7 +29856,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
29783
29856
|
}
|
|
29784
29857
|
return;
|
|
29785
29858
|
}
|
|
29786
|
-
const fullPath =
|
|
29859
|
+
const fullPath = join54(absolutePath, filename).replace(/\\/g, "/");
|
|
29787
29860
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
29788
29861
|
return;
|
|
29789
29862
|
}
|
|
@@ -29801,7 +29874,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
29801
29874
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
29802
29875
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
29803
29876
|
paths.forEach((path2) => {
|
|
29804
|
-
const absolutePath =
|
|
29877
|
+
const absolutePath = resolve42(path2).replace(/\\/g, "/");
|
|
29805
29878
|
if (!existsSync43(absolutePath)) {
|
|
29806
29879
|
return;
|
|
29807
29880
|
}
|
|
@@ -29812,7 +29885,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
29812
29885
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
29813
29886
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
29814
29887
|
watchPaths.forEach((path2) => {
|
|
29815
|
-
const absolutePath =
|
|
29888
|
+
const absolutePath = resolve42(path2).replace(/\\/g, "/");
|
|
29816
29889
|
if (!existsSync43(absolutePath)) {
|
|
29817
29890
|
return;
|
|
29818
29891
|
}
|
|
@@ -29831,13 +29904,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
29831
29904
|
});
|
|
29832
29905
|
|
|
29833
29906
|
// src/dev/assetStore.ts
|
|
29834
|
-
import { resolve as
|
|
29907
|
+
import { resolve as resolve43 } from "path";
|
|
29835
29908
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
29836
29909
|
var mimeTypes, getMimeType = (filePath) => {
|
|
29837
29910
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
29838
29911
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
29839
29912
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
29840
|
-
const fullPath =
|
|
29913
|
+
const fullPath = resolve43(dir, entry.name);
|
|
29841
29914
|
if (entry.isDirectory()) {
|
|
29842
29915
|
return walkAndClean(fullPath);
|
|
29843
29916
|
}
|
|
@@ -29853,10 +29926,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
29853
29926
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
29854
29927
|
const liveByIdentity = new Map;
|
|
29855
29928
|
for (const webPath of store.keys()) {
|
|
29856
|
-
const diskPath =
|
|
29929
|
+
const diskPath = resolve43(buildDir, webPath.slice(1));
|
|
29857
29930
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
29858
29931
|
}
|
|
29859
|
-
const absBuildDir =
|
|
29932
|
+
const absBuildDir = resolve43(buildDir);
|
|
29860
29933
|
Object.values(manifest).forEach((val) => {
|
|
29861
29934
|
if (!HASHED_FILE_RE.test(val))
|
|
29862
29935
|
return;
|
|
@@ -29876,13 +29949,13 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
29876
29949
|
}, evictMissingChunks = async (store, buildDir) => {
|
|
29877
29950
|
const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
|
|
29878
29951
|
await Promise.all(chunkKeys.map(async (webPath) => {
|
|
29879
|
-
const onDisk = await Bun.file(
|
|
29952
|
+
const onDisk = await Bun.file(resolve43(buildDir, webPath.slice(1))).exists().catch(() => false);
|
|
29880
29953
|
if (!onDisk)
|
|
29881
29954
|
store.delete(webPath);
|
|
29882
29955
|
}));
|
|
29883
29956
|
}, lookupAsset = (store, path2) => store.get(path2), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
29884
29957
|
if (entry.isDirectory()) {
|
|
29885
|
-
return scanDir(
|
|
29958
|
+
return scanDir(resolve43(dir, entry.name), `${prefix}${entry.name}/`);
|
|
29886
29959
|
}
|
|
29887
29960
|
if (!entry.name.startsWith("chunk-")) {
|
|
29888
29961
|
return null;
|
|
@@ -29891,7 +29964,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
29891
29964
|
if (store.has(webPath)) {
|
|
29892
29965
|
return null;
|
|
29893
29966
|
}
|
|
29894
|
-
return Bun.file(
|
|
29967
|
+
return Bun.file(resolve43(dir, entry.name)).bytes().then((bytes) => {
|
|
29895
29968
|
store.set(webPath, bytes);
|
|
29896
29969
|
return;
|
|
29897
29970
|
}).catch(() => {});
|
|
@@ -29913,7 +29986,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
29913
29986
|
for (const webPath of newIdentities.values()) {
|
|
29914
29987
|
if (store.has(webPath))
|
|
29915
29988
|
continue;
|
|
29916
|
-
loadPromises.push(Bun.file(
|
|
29989
|
+
loadPromises.push(Bun.file(resolve43(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
29917
29990
|
store.set(webPath, bytes);
|
|
29918
29991
|
return;
|
|
29919
29992
|
}).catch(() => {}));
|
|
@@ -30054,9 +30127,9 @@ var init_transformCache = __esm(() => {
|
|
|
30054
30127
|
});
|
|
30055
30128
|
|
|
30056
30129
|
// src/dev/reactComponentClassifier.ts
|
|
30057
|
-
import { resolve as
|
|
30130
|
+
import { resolve as resolve44 } from "path";
|
|
30058
30131
|
var classifyComponent = (filePath) => {
|
|
30059
|
-
const normalizedPath =
|
|
30132
|
+
const normalizedPath = resolve44(filePath);
|
|
30060
30133
|
if (normalizedPath.includes("/react/pages/")) {
|
|
30061
30134
|
return "server";
|
|
30062
30135
|
}
|
|
@@ -30068,7 +30141,7 @@ var classifyComponent = (filePath) => {
|
|
|
30068
30141
|
var init_reactComponentClassifier = () => {};
|
|
30069
30142
|
|
|
30070
30143
|
// src/dev/moduleMapper.ts
|
|
30071
|
-
import { basename as basename18, resolve as
|
|
30144
|
+
import { basename as basename18, resolve as resolve45 } from "path";
|
|
30072
30145
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
30073
30146
|
const modulePaths = {};
|
|
30074
30147
|
moduleKeys.forEach((key) => {
|
|
@@ -30078,7 +30151,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
30078
30151
|
});
|
|
30079
30152
|
return modulePaths;
|
|
30080
30153
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
30081
|
-
const normalizedFile =
|
|
30154
|
+
const normalizedFile = resolve45(sourceFile);
|
|
30082
30155
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
30083
30156
|
if (processedFiles.has(normalizedFile)) {
|
|
30084
30157
|
return null;
|
|
@@ -30114,7 +30187,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
30114
30187
|
});
|
|
30115
30188
|
return grouped;
|
|
30116
30189
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
30117
|
-
const normalizedFile =
|
|
30190
|
+
const normalizedFile = resolve45(sourceFile);
|
|
30118
30191
|
const fileName = basename18(normalizedFile);
|
|
30119
30192
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
30120
30193
|
const pascalName = toPascal(baseName);
|
|
@@ -30170,7 +30243,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
30170
30243
|
|
|
30171
30244
|
// src/utils/spaRouteCss.ts
|
|
30172
30245
|
import { readFile as readFile9 } from "fs/promises";
|
|
30173
|
-
import { dirname as dirname31, isAbsolute as
|
|
30246
|
+
import { dirname as dirname31, isAbsolute as isAbsolute9, resolve as resolve46 } from "path";
|
|
30174
30247
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
30175
30248
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
30176
30249
|
if (cached !== undefined)
|
|
@@ -30208,7 +30281,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
30208
30281
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
30209
30282
|
if (!cssPath)
|
|
30210
30283
|
return "";
|
|
30211
|
-
const resolvedCssPath =
|
|
30284
|
+
const resolvedCssPath = isAbsolute9(cssPath) ? cssPath : resolve46(dirname31(sideManifestPath), cssPath);
|
|
30212
30285
|
const cached = childCssCache.get(resolvedCssPath);
|
|
30213
30286
|
if (cached !== undefined)
|
|
30214
30287
|
return cached;
|
|
@@ -30292,7 +30365,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
30292
30365
|
resolveOwningComponents: () => resolveOwningComponents
|
|
30293
30366
|
});
|
|
30294
30367
|
import { readdirSync as readdirSync11, readFileSync as readFileSync37, statSync as statSync6 } from "fs";
|
|
30295
|
-
import { dirname as dirname32, extname as extname14, join as
|
|
30368
|
+
import { dirname as dirname32, extname as extname14, join as join55, resolve as resolve47 } from "path";
|
|
30296
30369
|
import ts19 from "typescript";
|
|
30297
30370
|
var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") || file6.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
30298
30371
|
const out = [];
|
|
@@ -30307,7 +30380,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30307
30380
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
30308
30381
|
continue;
|
|
30309
30382
|
}
|
|
30310
|
-
const full =
|
|
30383
|
+
const full = join55(dir, entry.name);
|
|
30311
30384
|
if (entry.isDirectory()) {
|
|
30312
30385
|
visit(full);
|
|
30313
30386
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -30405,7 +30478,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30405
30478
|
};
|
|
30406
30479
|
visit(sourceFile);
|
|
30407
30480
|
return out;
|
|
30408
|
-
}, safeNormalize = (path2) =>
|
|
30481
|
+
}, safeNormalize = (path2) => resolve47(path2).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
30409
30482
|
const { changedFilePath, userAngularRoot } = params;
|
|
30410
30483
|
const changedAbs = safeNormalize(changedFilePath);
|
|
30411
30484
|
const out = [];
|
|
@@ -30474,7 +30547,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30474
30547
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
30475
30548
|
return null;
|
|
30476
30549
|
}
|
|
30477
|
-
const base =
|
|
30550
|
+
const base = resolve47(childDir, spec);
|
|
30478
30551
|
const candidates = [
|
|
30479
30552
|
`${base}.ts`,
|
|
30480
30553
|
`${base}.tsx`,
|
|
@@ -30512,7 +30585,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file6) => file6.endsWith(".ts") ||
|
|
|
30512
30585
|
};
|
|
30513
30586
|
if (cls.kind === "component") {
|
|
30514
30587
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
30515
|
-
const abs = safeNormalize(
|
|
30588
|
+
const abs = safeNormalize(resolve47(componentDir, url));
|
|
30516
30589
|
const existing = resource.get(abs);
|
|
30517
30590
|
if (existing)
|
|
30518
30591
|
existing.push(entity);
|
|
@@ -30765,7 +30838,7 @@ __export(exports_moduleServer, {
|
|
|
30765
30838
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
30766
30839
|
});
|
|
30767
30840
|
import { existsSync as existsSync44, readFileSync as readFileSync38, realpathSync as realpathSync3, statSync as statSync7 } from "fs";
|
|
30768
|
-
import { basename as basename19, dirname as dirname33, extname as extname15, join as
|
|
30841
|
+
import { basename as basename19, dirname as dirname33, extname as extname15, join as join56, resolve as resolve48, relative as relative21 } from "path";
|
|
30769
30842
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
30770
30843
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
30771
30844
|
const allExports = [];
|
|
@@ -30785,10 +30858,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
30785
30858
|
${stubs}
|
|
30786
30859
|
`;
|
|
30787
30860
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
30788
|
-
const directHit = extensions.find((ext) => existsSync44(
|
|
30861
|
+
const directHit = extensions.find((ext) => existsSync44(resolve48(projectRoot, srcPath + ext)));
|
|
30789
30862
|
if (directHit)
|
|
30790
30863
|
return srcPath + directHit;
|
|
30791
|
-
const indexHit = extensions.find((ext) => existsSync44(
|
|
30864
|
+
const indexHit = extensions.find((ext) => existsSync44(resolve48(projectRoot, srcPath, `index${ext}`)));
|
|
30792
30865
|
if (indexHit)
|
|
30793
30866
|
return `${srcPath}/index${indexHit}`;
|
|
30794
30867
|
return srcPath;
|
|
@@ -30817,7 +30890,7 @@ ${stubs}
|
|
|
30817
30890
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
30818
30891
|
}, srcUrl = (relPath, projectRoot) => {
|
|
30819
30892
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
30820
|
-
const absPath =
|
|
30893
|
+
const absPath = resolve48(projectRoot, relPath);
|
|
30821
30894
|
const cached = mtimeCache.get(absPath);
|
|
30822
30895
|
if (cached !== undefined)
|
|
30823
30896
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -30829,12 +30902,12 @@ ${stubs}
|
|
|
30829
30902
|
return base;
|
|
30830
30903
|
}
|
|
30831
30904
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
30832
|
-
const absPath =
|
|
30833
|
-
const rel =
|
|
30905
|
+
const absPath = resolve48(fileDir, relPath);
|
|
30906
|
+
const rel = relative21(projectRoot, absPath);
|
|
30834
30907
|
const extension = extname15(rel);
|
|
30835
30908
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
30836
30909
|
if (extname15(srcPath) === ".svelte") {
|
|
30837
|
-
srcPath =
|
|
30910
|
+
srcPath = relative21(projectRoot, resolveSvelteModulePath(resolve48(projectRoot, srcPath)));
|
|
30838
30911
|
}
|
|
30839
30912
|
return srcUrl(srcPath, projectRoot);
|
|
30840
30913
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -30846,27 +30919,27 @@ ${stubs}
|
|
|
30846
30919
|
"import"
|
|
30847
30920
|
]);
|
|
30848
30921
|
if (fromExports)
|
|
30849
|
-
return
|
|
30922
|
+
return relative21(projectRoot, fromExports);
|
|
30850
30923
|
try {
|
|
30851
30924
|
const isScoped = specifier.startsWith("@");
|
|
30852
30925
|
const parts = specifier.split("/");
|
|
30853
30926
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
30854
30927
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
30855
30928
|
if (!subpath) {
|
|
30856
|
-
const pkgDir =
|
|
30857
|
-
const pkgJsonPath =
|
|
30929
|
+
const pkgDir = resolve48(projectRoot, "node_modules", packageName ?? "");
|
|
30930
|
+
const pkgJsonPath = join56(pkgDir, "package.json");
|
|
30858
30931
|
if (existsSync44(pkgJsonPath)) {
|
|
30859
30932
|
const pkg = JSON.parse(readFileSync38(pkgJsonPath, "utf-8"));
|
|
30860
30933
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
30861
30934
|
if (esmEntry) {
|
|
30862
|
-
const resolved =
|
|
30935
|
+
const resolved = resolve48(pkgDir, esmEntry);
|
|
30863
30936
|
if (existsSync44(resolved))
|
|
30864
|
-
return
|
|
30937
|
+
return relative21(projectRoot, resolved);
|
|
30865
30938
|
}
|
|
30866
30939
|
}
|
|
30867
30940
|
}
|
|
30868
30941
|
} catch {}
|
|
30869
|
-
return
|
|
30942
|
+
return relative21(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
30870
30943
|
} catch {
|
|
30871
30944
|
return;
|
|
30872
30945
|
}
|
|
@@ -30905,22 +30978,22 @@ ${stubs}
|
|
|
30905
30978
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
30906
30979
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
30907
30980
|
if (absPath.startsWith(projectRoot)) {
|
|
30908
|
-
const rel2 =
|
|
30981
|
+
const rel2 = relative21(projectRoot, absPath).replace(/\\/g, "/");
|
|
30909
30982
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
30910
30983
|
}
|
|
30911
|
-
const rel =
|
|
30984
|
+
const rel = relative21(projectRoot, absPath).replace(/\\/g, "/");
|
|
30912
30985
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
30913
30986
|
};
|
|
30914
30987
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
30915
30988
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
30916
30989
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
30917
|
-
const absPath =
|
|
30918
|
-
const rel =
|
|
30990
|
+
const absPath = resolve48(fileDir, relPath);
|
|
30991
|
+
const rel = relative21(projectRoot, absPath);
|
|
30919
30992
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
30920
30993
|
});
|
|
30921
30994
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
30922
|
-
const absPath =
|
|
30923
|
-
const rel =
|
|
30995
|
+
const absPath = resolve48(fileDir, relPath);
|
|
30996
|
+
const rel = relative21(projectRoot, absPath);
|
|
30924
30997
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
30925
30998
|
});
|
|
30926
30999
|
return result;
|
|
@@ -30976,7 +31049,7 @@ ${code2}`;
|
|
|
30976
31049
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
30977
31050
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
30978
31051
|
${transpiled}`;
|
|
30979
|
-
const relPath =
|
|
31052
|
+
const relPath = relative21(projectRoot, filePath).replace(/\\/g, "/");
|
|
30980
31053
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
30981
31054
|
transpiled += buildIslandMetadataExports(raw);
|
|
30982
31055
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -31137,11 +31210,11 @@ ${code2}`;
|
|
|
31137
31210
|
if (compiled.css?.code) {
|
|
31138
31211
|
const cssPath = `${filePath}.css`;
|
|
31139
31212
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
31140
|
-
const cssUrl = srcUrl(
|
|
31213
|
+
const cssUrl = srcUrl(relative21(projectRoot, cssPath), projectRoot);
|
|
31141
31214
|
code2 = `import "${cssUrl}";
|
|
31142
31215
|
${code2}`;
|
|
31143
31216
|
}
|
|
31144
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
31217
|
+
const moduleUrl = `${SRC_PREFIX}${relative21(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
31145
31218
|
code2 = code2.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
31146
31219
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
31147
31220
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -31241,8 +31314,8 @@ ${code2}`;
|
|
|
31241
31314
|
code2 = injectVueHmr(code2, filePath, projectRoot, vueDir);
|
|
31242
31315
|
return rewriteImports(code2, filePath, projectRoot, rewriter);
|
|
31243
31316
|
}, injectVueHmr = (code2, filePath, projectRoot, vueDir) => {
|
|
31244
|
-
const hmrBase = vueDir ?
|
|
31245
|
-
const hmrId =
|
|
31317
|
+
const hmrBase = vueDir ? resolve48(vueDir) : projectRoot;
|
|
31318
|
+
const hmrId = relative21(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
31246
31319
|
let result = code2.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
31247
31320
|
result += [
|
|
31248
31321
|
"",
|
|
@@ -31402,7 +31475,7 @@ export default {};
|
|
|
31402
31475
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
31403
31476
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
31404
31477
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
31405
|
-
const filePath =
|
|
31478
|
+
const filePath = resolve48(projectRoot, relPath);
|
|
31406
31479
|
const ext = extname15(filePath);
|
|
31407
31480
|
if (ext === ".svelte")
|
|
31408
31481
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -31439,14 +31512,14 @@ export default {};
|
|
|
31439
31512
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
31440
31513
|
const candidates = [
|
|
31441
31514
|
absoluteCandidate,
|
|
31442
|
-
|
|
31515
|
+
resolve48(projectRoot, tail)
|
|
31443
31516
|
];
|
|
31444
31517
|
try {
|
|
31445
31518
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
31446
31519
|
const cfg = await loadConfig2();
|
|
31447
|
-
const angularDir = cfg.angularDirectory &&
|
|
31520
|
+
const angularDir = cfg.angularDirectory && resolve48(projectRoot, cfg.angularDirectory);
|
|
31448
31521
|
if (angularDir)
|
|
31449
|
-
candidates.push(
|
|
31522
|
+
candidates.push(resolve48(angularDir, tail));
|
|
31450
31523
|
} catch {}
|
|
31451
31524
|
for (const candidate of candidates) {
|
|
31452
31525
|
if (await fileExists2(candidate)) {
|
|
@@ -31477,7 +31550,7 @@ export default {};
|
|
|
31477
31550
|
if (!TRANSPILABLE.has(ext))
|
|
31478
31551
|
return;
|
|
31479
31552
|
const stat4 = statSync7(filePath);
|
|
31480
|
-
const resolvedVueDir = vueDir ?
|
|
31553
|
+
const resolvedVueDir = vueDir ? resolve48(vueDir) : undefined;
|
|
31481
31554
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
31482
31555
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
31483
31556
|
if (isAngularGeneratedJs) {
|
|
@@ -31536,7 +31609,7 @@ export default {};
|
|
|
31536
31609
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
31537
31610
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
31538
31611
|
return handleBunWrapRequest();
|
|
31539
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
31612
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve48(projectRoot, relPath));
|
|
31540
31613
|
if (virtualCssResponse)
|
|
31541
31614
|
return virtualCssResponse;
|
|
31542
31615
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
@@ -31552,11 +31625,11 @@ export default {};
|
|
|
31552
31625
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
31553
31626
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
31554
31627
|
if (match[1])
|
|
31555
|
-
files.push(
|
|
31628
|
+
files.push(resolve48(projectRoot, match[1]));
|
|
31556
31629
|
}
|
|
31557
31630
|
return files;
|
|
31558
31631
|
}, invalidateModule = (filePath) => {
|
|
31559
|
-
const resolved =
|
|
31632
|
+
const resolved = resolve48(filePath);
|
|
31560
31633
|
invalidate(filePath);
|
|
31561
31634
|
if (resolved !== filePath)
|
|
31562
31635
|
invalidate(resolved);
|
|
@@ -31619,7 +31692,7 @@ export default {};
|
|
|
31619
31692
|
return false;
|
|
31620
31693
|
}
|
|
31621
31694
|
const { patchManifestIndexes } = await Promise.resolve().then(() => (init_prepare(), exports_prepare));
|
|
31622
|
-
patchManifestIndexes(cached.manifest,
|
|
31695
|
+
patchManifestIndexes(cached.manifest, resolve48(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
|
|
31623
31696
|
logPageBuild(entry.source, entry.framework, Math.round(durationMs));
|
|
31624
31697
|
logStartupTimingBlock("AbsoluteJS on-demand page build", [
|
|
31625
31698
|
{ durationMs, label: entry.name }
|
|
@@ -31790,10 +31863,10 @@ __export(exports_hmrCompiler, {
|
|
|
31790
31863
|
encodeHmrComponentId: () => encodeHmrComponentId,
|
|
31791
31864
|
getApplyMetadataModule: () => getApplyMetadataModule
|
|
31792
31865
|
});
|
|
31793
|
-
import { dirname as dirname34, relative as
|
|
31866
|
+
import { dirname as dirname34, relative as relative22, resolve as resolve49 } from "path";
|
|
31794
31867
|
import { performance as performance2 } from "perf_hooks";
|
|
31795
31868
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
31796
|
-
const projectRel =
|
|
31869
|
+
const projectRel = relative22(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
31797
31870
|
return `${projectRel}@${className}`;
|
|
31798
31871
|
}, getApplyMetadataModule = async (encodedId) => {
|
|
31799
31872
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -31802,8 +31875,8 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
31802
31875
|
return null;
|
|
31803
31876
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
31804
31877
|
const className = decoded.slice(separatorIndex + 1);
|
|
31805
|
-
const componentFilePath =
|
|
31806
|
-
const projectRelPath =
|
|
31878
|
+
const componentFilePath = resolve49(process.cwd(), filePathRel);
|
|
31879
|
+
const projectRelPath = relative22(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
31807
31880
|
const cacheKey3 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
31808
31881
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
31809
31882
|
const cached = takePendingModule2(cacheKey3);
|
|
@@ -32047,11 +32120,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
32047
32120
|
__export(exports_simpleHTMLHMR, {
|
|
32048
32121
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
32049
32122
|
});
|
|
32050
|
-
import { resolve as
|
|
32123
|
+
import { resolve as resolve50 } from "path";
|
|
32051
32124
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
32052
32125
|
let htmlContent;
|
|
32053
32126
|
try {
|
|
32054
|
-
const resolvedPath =
|
|
32127
|
+
const resolvedPath = resolve50(htmlFilePath);
|
|
32055
32128
|
const file6 = Bun.file(resolvedPath);
|
|
32056
32129
|
if (!await file6.exists()) {
|
|
32057
32130
|
return null;
|
|
@@ -32077,11 +32150,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
32077
32150
|
__export(exports_simpleHTMXHMR, {
|
|
32078
32151
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
32079
32152
|
});
|
|
32080
|
-
import { resolve as
|
|
32153
|
+
import { resolve as resolve51 } from "path";
|
|
32081
32154
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
32082
32155
|
let htmlContent;
|
|
32083
32156
|
try {
|
|
32084
|
-
const resolvedPath =
|
|
32157
|
+
const resolvedPath = resolve51(htmxFilePath);
|
|
32085
32158
|
const file6 = Bun.file(resolvedPath);
|
|
32086
32159
|
if (!await file6.exists()) {
|
|
32087
32160
|
return null;
|
|
@@ -32113,11 +32186,11 @@ import { existsSync as existsSync45, readdirSync as readdirSync12, rmSync as rmS
|
|
|
32113
32186
|
import {
|
|
32114
32187
|
basename as basename20,
|
|
32115
32188
|
dirname as dirname35,
|
|
32116
|
-
isAbsolute as
|
|
32117
|
-
join as
|
|
32118
|
-
relative as
|
|
32189
|
+
isAbsolute as isAbsolute10,
|
|
32190
|
+
join as join57,
|
|
32191
|
+
relative as relative23,
|
|
32119
32192
|
resolve as resolvePath,
|
|
32120
|
-
sep as
|
|
32193
|
+
sep as sep6
|
|
32121
32194
|
} from "path";
|
|
32122
32195
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
32123
32196
|
clearSpaRouteCssCaches();
|
|
@@ -32241,8 +32314,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32241
32314
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
32242
32315
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
32243
32316
|
for (const candidate of [
|
|
32244
|
-
|
|
32245
|
-
`${
|
|
32317
|
+
join57(generatedDir, relJs),
|
|
32318
|
+
`${join57(generatedDir, relJs)}.map`
|
|
32246
32319
|
]) {
|
|
32247
32320
|
try {
|
|
32248
32321
|
rmSync4(candidate, { force: true });
|
|
@@ -32483,7 +32556,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32483
32556
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
32484
32557
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
32485
32558
|
state.fileHashes.set(absSource, currentHash);
|
|
32486
|
-
logHmrUpdate(
|
|
32559
|
+
logHmrUpdate(relative23(process.cwd(), filePath));
|
|
32487
32560
|
broadcastToClients(state, {
|
|
32488
32561
|
data: {
|
|
32489
32562
|
framework: urlPrefix || "public",
|
|
@@ -32503,7 +32576,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32503
32576
|
return;
|
|
32504
32577
|
if (framework === "unknown") {
|
|
32505
32578
|
invalidate(resolvePath(filePath));
|
|
32506
|
-
const relPath =
|
|
32579
|
+
const relPath = relative23(process.cwd(), filePath);
|
|
32507
32580
|
logHmrUpdate(relPath);
|
|
32508
32581
|
const { angularDir } = state.resolvedPaths;
|
|
32509
32582
|
let hasAngularDependent = false;
|
|
@@ -33025,8 +33098,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33025
33098
|
};
|
|
33026
33099
|
return ({ immediate = false } = {}) => {
|
|
33027
33100
|
if (!ctx.debouncedPromise) {
|
|
33028
|
-
ctx.debouncedPromise = new Promise((
|
|
33029
|
-
ctx.debouncedResolve =
|
|
33101
|
+
ctx.debouncedPromise = new Promise((resolve52) => {
|
|
33102
|
+
ctx.debouncedResolve = resolve52;
|
|
33030
33103
|
});
|
|
33031
33104
|
}
|
|
33032
33105
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -33052,7 +33125,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33052
33125
|
const angularDirAbs = resolvePath(angularDir);
|
|
33053
33126
|
const filesUnderAngular = Array.from(editedFiles).filter((file6) => {
|
|
33054
33127
|
const abs = resolvePath(file6);
|
|
33055
|
-
return abs === angularDirAbs || abs.startsWith(angularDirAbs +
|
|
33128
|
+
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep6);
|
|
33056
33129
|
});
|
|
33057
33130
|
if (filesUnderAngular.length === 0)
|
|
33058
33131
|
return;
|
|
@@ -33095,7 +33168,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33095
33168
|
try {
|
|
33096
33169
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
33097
33170
|
for (const tsFile of tsFilesToRefresh) {
|
|
33098
|
-
const rel =
|
|
33171
|
+
const rel = relative23(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
33099
33172
|
const compiledFile = resolvePath(compiledRoot, rel);
|
|
33100
33173
|
invalidateModule2(compiledFile);
|
|
33101
33174
|
}
|
|
@@ -33148,7 +33221,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33148
33221
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
33149
33222
|
const files = [];
|
|
33150
33223
|
for (const entry of entries) {
|
|
33151
|
-
const full =
|
|
33224
|
+
const full = join57(dir, entry.name);
|
|
33152
33225
|
if (entry.isDirectory()) {
|
|
33153
33226
|
files.push(...await walk(full));
|
|
33154
33227
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -33250,7 +33323,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33250
33323
|
}, getModuleUrl = async (pageFile) => {
|
|
33251
33324
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX3 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
33252
33325
|
invalidateModule2(pageFile);
|
|
33253
|
-
const rel =
|
|
33326
|
+
const rel = relative23(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
33254
33327
|
const url = `${SRC_URL_PREFIX3}${rel}`;
|
|
33255
33328
|
await warmCache2(url);
|
|
33256
33329
|
return url;
|
|
@@ -33278,7 +33351,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33278
33351
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
33279
33352
|
if (pageModuleUrl) {
|
|
33280
33353
|
const serverDuration = Date.now() - startTime;
|
|
33281
|
-
state.lastHmrPath =
|
|
33354
|
+
state.lastHmrPath = relative23(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
33282
33355
|
state.lastHmrFramework = "react";
|
|
33283
33356
|
broadcastToClients(state, {
|
|
33284
33357
|
data: {
|
|
@@ -33571,8 +33644,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33571
33644
|
};
|
|
33572
33645
|
return () => {
|
|
33573
33646
|
if (!ctx.debouncedPromise) {
|
|
33574
|
-
ctx.debouncedPromise = new Promise((
|
|
33575
|
-
ctx.debouncedResolve =
|
|
33647
|
+
ctx.debouncedPromise = new Promise((resolve52) => {
|
|
33648
|
+
ctx.debouncedResolve = resolve52;
|
|
33576
33649
|
});
|
|
33577
33650
|
}
|
|
33578
33651
|
if (ctx.debounceTimer)
|
|
@@ -33723,7 +33796,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33723
33796
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
33724
33797
|
const serverEntries = [...vueServerPaths];
|
|
33725
33798
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
33726
|
-
const cssOutDir =
|
|
33799
|
+
const cssOutDir = join57(buildDir, state.resolvedPaths.assetsDir ? basename20(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
33727
33800
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
33728
33801
|
const serverExternals = await getServerBundleExternals();
|
|
33729
33802
|
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
|
|
@@ -33783,7 +33856,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33783
33856
|
if (vueSpaRoutesBySource.size > 0) {
|
|
33784
33857
|
const spaManifestEntries = await writeSpaSideManifests(vueSpaRoutesBySource, (pascalName) => {
|
|
33785
33858
|
const fromManifest = state.manifest[pascalName];
|
|
33786
|
-
return typeof fromManifest === "string" &&
|
|
33859
|
+
return typeof fromManifest === "string" && isAbsolute10(fromManifest) && fromManifest.endsWith(".js") ? fromManifest : undefined;
|
|
33787
33860
|
});
|
|
33788
33861
|
Object.assign(state.manifest, spaManifestEntries);
|
|
33789
33862
|
}
|
|
@@ -33853,8 +33926,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33853
33926
|
};
|
|
33854
33927
|
return () => {
|
|
33855
33928
|
if (!ctx.debouncedPromise) {
|
|
33856
|
-
ctx.debouncedPromise = new Promise((
|
|
33857
|
-
ctx.debouncedResolve =
|
|
33929
|
+
ctx.debouncedPromise = new Promise((resolve52) => {
|
|
33930
|
+
ctx.debouncedResolve = resolve52;
|
|
33858
33931
|
});
|
|
33859
33932
|
}
|
|
33860
33933
|
if (ctx.debounceTimer)
|
|
@@ -33907,7 +33980,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33907
33980
|
const duration = Date.now() - startTime;
|
|
33908
33981
|
const [primary] = emberFiles;
|
|
33909
33982
|
if (primary) {
|
|
33910
|
-
state.lastHmrPath =
|
|
33983
|
+
state.lastHmrPath = relative23(process.cwd(), primary).replace(/\\/g, "/");
|
|
33911
33984
|
state.lastHmrFramework = "ember";
|
|
33912
33985
|
logHmrUpdate(primary, "ember", duration);
|
|
33913
33986
|
}
|
|
@@ -34176,7 +34249,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34176
34249
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
34177
34250
|
const pascalName = toPascal(baseName);
|
|
34178
34251
|
const vueRoot = config.vueDirectory;
|
|
34179
|
-
const hmrId = vueRoot ?
|
|
34252
|
+
const hmrId = vueRoot ? relative23(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
34180
34253
|
const cssKey = `${pascalName}CSS`;
|
|
34181
34254
|
const cssUrl = manifest[cssKey] || null;
|
|
34182
34255
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -34837,7 +34910,7 @@ __export(exports_buildDepVendor, {
|
|
|
34837
34910
|
});
|
|
34838
34911
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
34839
34912
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
34840
|
-
import { join as
|
|
34913
|
+
import { join as join58 } from "path";
|
|
34841
34914
|
import { rm as rm13 } from "fs/promises";
|
|
34842
34915
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
34843
34916
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -34995,7 +35068,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
34995
35068
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
34996
35069
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
34997
35070
|
const safeName = toSafeFileName6(specifier);
|
|
34998
|
-
const entryPath =
|
|
35071
|
+
const entryPath = join58(tmpDir, `${safeName}.ts`);
|
|
34999
35072
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
35000
35073
|
return { entryPath, specifier };
|
|
35001
35074
|
}));
|
|
@@ -35086,9 +35159,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35086
35159
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories, files);
|
|
35087
35160
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
35088
35161
|
return {};
|
|
35089
|
-
const vendorDir =
|
|
35162
|
+
const vendorDir = join58(buildDir, "vendor");
|
|
35090
35163
|
mkdirSync14(vendorDir, { recursive: true });
|
|
35091
|
-
const tmpDir =
|
|
35164
|
+
const tmpDir = join58(buildDir, "_dep_vendor_tmp");
|
|
35092
35165
|
mkdirSync14(tmpDir, { recursive: true });
|
|
35093
35166
|
const allSpecs = new Set(initialSpecs);
|
|
35094
35167
|
const alreadyScanned = new Set;
|
|
@@ -35188,7 +35261,7 @@ import {
|
|
|
35188
35261
|
readFileSync as readFileSync39
|
|
35189
35262
|
} from "fs";
|
|
35190
35263
|
import { mkdir as mkdir14, readFile as readFile10, rename as rename5, rm as rm14, writeFile as writeFile11 } from "fs/promises";
|
|
35191
|
-
import { basename as basename21, join as
|
|
35264
|
+
import { basename as basename21, join as join59, resolve as resolve52 } from "path";
|
|
35192
35265
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
35193
35266
|
const hash = createHash8("sha256");
|
|
35194
35267
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -35208,14 +35281,14 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35208
35281
|
}
|
|
35209
35282
|
for (const dir of inputs.vendorDirs) {
|
|
35210
35283
|
hash.update("\x00v");
|
|
35211
|
-
hash.update(basename21(
|
|
35284
|
+
hash.update(basename21(resolve52(dir, "..")));
|
|
35212
35285
|
}
|
|
35213
35286
|
return hash.digest("hex").slice(0, KEY_LENGTH);
|
|
35214
35287
|
}, readLockfileHash = (projectRoot = process.cwd()) => {
|
|
35215
35288
|
const hash = createHash8("sha256");
|
|
35216
35289
|
let found = false;
|
|
35217
35290
|
for (const name of LOCKFILES) {
|
|
35218
|
-
const path2 =
|
|
35291
|
+
const path2 = join59(projectRoot, name);
|
|
35219
35292
|
if (!existsSync46(path2))
|
|
35220
35293
|
continue;
|
|
35221
35294
|
found = true;
|
|
@@ -35226,8 +35299,8 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35226
35299
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
35227
35300
|
mkdirSync15(toDir, { recursive: true });
|
|
35228
35301
|
for (const entry of readdirSync13(fromDir, { withFileTypes: true })) {
|
|
35229
|
-
const source =
|
|
35230
|
-
const destination =
|
|
35302
|
+
const source = join59(fromDir, entry.name);
|
|
35303
|
+
const destination = join59(toDir, entry.name);
|
|
35231
35304
|
if (entry.isDirectory())
|
|
35232
35305
|
copyTree(source, destination);
|
|
35233
35306
|
else
|
|
@@ -35235,7 +35308,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35235
35308
|
}
|
|
35236
35309
|
}, copySlotsInto = (cacheDir2, vendorDirs) => {
|
|
35237
35310
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35238
|
-
const source =
|
|
35311
|
+
const source = join59(cacheDir2, slotName(index, dir));
|
|
35239
35312
|
if (!existsSync46(source)) {
|
|
35240
35313
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
35241
35314
|
}
|
|
@@ -35245,11 +35318,11 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35245
35318
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35246
35319
|
if (!existsSync46(dir))
|
|
35247
35320
|
continue;
|
|
35248
|
-
copyTree(dir,
|
|
35321
|
+
copyTree(dir, join59(stagingDir, slotName(index, dir)));
|
|
35249
35322
|
}
|
|
35250
|
-
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) =>
|
|
35323
|
+
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve52(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename21(resolve52(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
35251
35324
|
const cacheDir2 = cacheDirFor(key, projectRoot);
|
|
35252
|
-
const payloadPath =
|
|
35325
|
+
const payloadPath = join59(cacheDir2, "payload.json");
|
|
35253
35326
|
if (!existsSync46(payloadPath))
|
|
35254
35327
|
return null;
|
|
35255
35328
|
try {
|
|
@@ -35263,14 +35336,14 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35263
35336
|
}
|
|
35264
35337
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
35265
35338
|
const cacheDir2 = cacheDirFor(key, projectRoot);
|
|
35266
|
-
if (existsSync46(
|
|
35339
|
+
if (existsSync46(join59(cacheDir2, "payload.json")))
|
|
35267
35340
|
return;
|
|
35268
35341
|
const stagingDir = `${cacheDir2}.${process.pid}.tmp`;
|
|
35269
35342
|
try {
|
|
35270
35343
|
await rm14(stagingDir, { force: true, recursive: true });
|
|
35271
35344
|
await mkdir14(stagingDir, { recursive: true });
|
|
35272
35345
|
copySlotsFrom(stagingDir, vendorDirs);
|
|
35273
|
-
await writeFile11(
|
|
35346
|
+
await writeFile11(join59(stagingDir, "payload.json"), JSON.stringify(payload));
|
|
35274
35347
|
await rm14(cacheDir2, { force: true, recursive: true });
|
|
35275
35348
|
await rename5(stagingDir, cacheDir2);
|
|
35276
35349
|
} catch {
|
|
@@ -35280,7 +35353,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35280
35353
|
}
|
|
35281
35354
|
};
|
|
35282
35355
|
var init_vendorCache = __esm(() => {
|
|
35283
|
-
CACHE_ROOT2 =
|
|
35356
|
+
CACHE_ROOT2 = join59(".absolutejs", "vendor-cache");
|
|
35284
35357
|
LOCKFILES = [
|
|
35285
35358
|
"bun.lock",
|
|
35286
35359
|
"bun.lockb",
|
|
@@ -35299,8 +35372,8 @@ __export(exports_devBuild, {
|
|
|
35299
35372
|
});
|
|
35300
35373
|
import { readdir as readdir5 } from "fs/promises";
|
|
35301
35374
|
import { existsSync as existsSync47, statSync as statSync8 } from "fs";
|
|
35302
|
-
import { resolve as
|
|
35303
|
-
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () =>
|
|
35375
|
+
import { resolve as resolve53 } from "path";
|
|
35376
|
+
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve53(import.meta.dir, "../dev/client"), collectDepVendorSourceDirs = (config) => {
|
|
35304
35377
|
const configuredDirs = [
|
|
35305
35378
|
...collectConfigVendorSourceDirs(config),
|
|
35306
35379
|
devClientVendorSourceDir()
|
|
@@ -35323,7 +35396,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35323
35396
|
return Object.keys(config).length > 0 ? config : null;
|
|
35324
35397
|
}, reloadConfig = async () => {
|
|
35325
35398
|
try {
|
|
35326
|
-
const configPath2 =
|
|
35399
|
+
const configPath2 = resolve53(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
35327
35400
|
const source = await Bun.file(configPath2).text();
|
|
35328
35401
|
return parseDirectoryConfig(source);
|
|
35329
35402
|
} catch {
|
|
@@ -35438,7 +35511,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35438
35511
|
});
|
|
35439
35512
|
}
|
|
35440
35513
|
}, handleCachedReload = async () => {
|
|
35441
|
-
const serverMtime = statSync8(
|
|
35514
|
+
const serverMtime = statSync8(resolve53(Bun.main)).mtimeMs;
|
|
35442
35515
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
35443
35516
|
globalThis.__hmrServerMtime = serverMtime;
|
|
35444
35517
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -35479,8 +35552,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35479
35552
|
return true;
|
|
35480
35553
|
}, resolveAbsoluteVersion2 = async () => {
|
|
35481
35554
|
const candidates = [
|
|
35482
|
-
|
|
35483
|
-
|
|
35555
|
+
resolve53(import.meta.dir, "..", "..", "package.json"),
|
|
35556
|
+
resolve53(import.meta.dir, "..", "package.json")
|
|
35484
35557
|
];
|
|
35485
35558
|
const [candidate, ...remaining] = candidates;
|
|
35486
35559
|
if (!candidate) {
|
|
@@ -35506,7 +35579,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35506
35579
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
35507
35580
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
35508
35581
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
35509
|
-
const bytes = await Bun.file(
|
|
35582
|
+
const bytes = await Bun.file(resolve53(vendorDir, entry)).bytes();
|
|
35510
35583
|
assetStore.set(webPath, bytes);
|
|
35511
35584
|
}));
|
|
35512
35585
|
}, devBuild = async (config) => {
|
|
@@ -35692,11 +35765,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35692
35765
|
}
|
|
35693
35766
|
stepStartedAt = performance.now();
|
|
35694
35767
|
setBootPhase("build vendor bundles");
|
|
35695
|
-
const reactVendorDir =
|
|
35696
|
-
const angularVendorDir =
|
|
35697
|
-
const svelteVendorDir =
|
|
35698
|
-
const vueVendorDir =
|
|
35699
|
-
const depVendorDir =
|
|
35768
|
+
const reactVendorDir = resolve53(state.resolvedPaths.buildDir, "react", "vendor");
|
|
35769
|
+
const angularVendorDir = resolve53(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
35770
|
+
const svelteVendorDir = resolve53(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
35771
|
+
const vueVendorDir = resolve53(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
35772
|
+
const depVendorDir = resolve53(state.resolvedPaths.buildDir, "vendor");
|
|
35700
35773
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
35701
35774
|
const activeVendorDirs = [
|
|
35702
35775
|
config.reactDirectory ? reactVendorDir : null,
|
|
@@ -35819,7 +35892,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve52(import.meta.d
|
|
|
35819
35892
|
manifest
|
|
35820
35893
|
};
|
|
35821
35894
|
globalThis.__hmrDevResult = result;
|
|
35822
|
-
globalThis.__hmrServerMtime = statSync8(
|
|
35895
|
+
globalThis.__hmrServerMtime = statSync8(resolve53(Bun.main)).mtimeMs;
|
|
35823
35896
|
return result;
|
|
35824
35897
|
};
|
|
35825
35898
|
var init_devBuild = __esm(() => {
|
|
@@ -35972,8 +36045,8 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
35972
36045
|
return null;
|
|
35973
36046
|
if (!pathname.startsWith("/"))
|
|
35974
36047
|
return null;
|
|
35975
|
-
const { resolve:
|
|
35976
|
-
const candidate =
|
|
36048
|
+
const { resolve: resolve54, normalize } = await import("path");
|
|
36049
|
+
const candidate = resolve54(buildDir, pathname.slice(1));
|
|
35977
36050
|
const normalizedBuild = normalize(buildDir);
|
|
35978
36051
|
if (!candidate.startsWith(normalizedBuild))
|
|
35979
36052
|
return null;
|
|
@@ -36079,12 +36152,12 @@ __export(exports_devtoolsJson, {
|
|
|
36079
36152
|
resolveDevtoolsUuidCachePath: () => resolveDevtoolsUuidCachePath
|
|
36080
36153
|
});
|
|
36081
36154
|
import { existsSync as existsSync48, mkdirSync as mkdirSync16, readFileSync as readFileSync40, writeFileSync as writeFileSync11 } from "fs";
|
|
36082
|
-
import { dirname as dirname36, join as
|
|
36155
|
+
import { dirname as dirname36, join as join60, resolve as resolve54 } from "path";
|
|
36083
36156
|
import { Elysia as Elysia7 } from "elysia";
|
|
36084
36157
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
36085
36158
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
36086
36159
|
return uuid;
|
|
36087
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
36160
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve54(uuidCachePath ?? join60(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
36088
36161
|
if (!existsSync48(cachePath))
|
|
36089
36162
|
return null;
|
|
36090
36163
|
try {
|
|
@@ -36110,7 +36183,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36110
36183
|
writeFileSync11(cachePath, uuid, "utf-8");
|
|
36111
36184
|
return setGlobalUuid(uuid);
|
|
36112
36185
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
36113
|
-
const rootPath =
|
|
36186
|
+
const rootPath = resolve54(options.projectRoot ?? process.cwd());
|
|
36114
36187
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
36115
36188
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
36116
36189
|
return new Elysia7({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -36123,11 +36196,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36123
36196
|
if (process.env.WSL_DISTRO_NAME) {
|
|
36124
36197
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
36125
36198
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36126
|
-
return
|
|
36199
|
+
return join60("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
36127
36200
|
}
|
|
36128
36201
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
36129
36202
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36130
|
-
return
|
|
36203
|
+
return join60("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
36131
36204
|
}
|
|
36132
36205
|
return root;
|
|
36133
36206
|
};
|
|
@@ -36139,7 +36212,7 @@ __export(exports_imageOptimizer, {
|
|
|
36139
36212
|
imageOptimizer: () => imageOptimizer
|
|
36140
36213
|
});
|
|
36141
36214
|
import { existsSync as existsSync49 } from "fs";
|
|
36142
|
-
import { resolve as
|
|
36215
|
+
import { resolve as resolve55 } from "path";
|
|
36143
36216
|
import { Elysia as Elysia8 } from "elysia";
|
|
36144
36217
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path2, baseDir) => {
|
|
36145
36218
|
try {
|
|
@@ -36152,7 +36225,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
36152
36225
|
}
|
|
36153
36226
|
}, resolveLocalImage = (url, buildDir) => {
|
|
36154
36227
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
36155
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
36228
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve55(process.cwd()));
|
|
36156
36229
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
36157
36230
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
36158
36231
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -36659,7 +36732,7 @@ import {
|
|
|
36659
36732
|
rm as rm15,
|
|
36660
36733
|
writeFile as writeFile12
|
|
36661
36734
|
} from "fs/promises";
|
|
36662
|
-
import { join as
|
|
36735
|
+
import { join as join61, resolve as resolvePath2 } from "path";
|
|
36663
36736
|
var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE = "artifact.json", RELEASE_ID_PATTERN, DEFAULT_BLOB_PREFIX = "absolutejs/mobile-compatibility", hashBlob = async (blob) => {
|
|
36664
36737
|
const bytes = new Uint8Array(await blob.arrayBuffer());
|
|
36665
36738
|
return createHash10(SHA_2562).update(bytes).digest("hex");
|
|
@@ -36673,7 +36746,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36673
36746
|
}
|
|
36674
36747
|
return releaseId;
|
|
36675
36748
|
}, readStoredArtifact = async (releaseDirectory) => {
|
|
36676
|
-
const serialized = await readFile11(
|
|
36749
|
+
const serialized = await readFile11(join61(releaseDirectory, ARTIFACT_FILE), "utf8");
|
|
36677
36750
|
const parsed = JSON.parse(serialized);
|
|
36678
36751
|
return parseAbsoluteMobileCompatibilityArtifact(parsed);
|
|
36679
36752
|
}, validateStoredIdentity = (artifact, appId, releaseId) => {
|
|
@@ -36768,8 +36841,8 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36768
36841
|
}, createAbsoluteMobileFileArtifactStore = (options) => {
|
|
36769
36842
|
const root = resolvePath2(options.root);
|
|
36770
36843
|
const maxProducerBytes = options.maxProducerBytes ?? DEFAULT_MAX_PRODUCER_BYTES;
|
|
36771
|
-
const appDirectory = (appId) =>
|
|
36772
|
-
const releaseDirectory = (appId, releaseId) =>
|
|
36844
|
+
const appDirectory = (appId) => join61(root, appDirectoryName(appId));
|
|
36845
|
+
const releaseDirectory = (appId, releaseId) => join61(appDirectory(appId), requireReleaseId(releaseId));
|
|
36773
36846
|
const acceptExistingRelease = async (error, artifact) => {
|
|
36774
36847
|
if (!errorHasCode(error, "EEXIST") && !errorHasCode(error, "ENOTEMPTY")) {
|
|
36775
36848
|
return false;
|
|
@@ -36810,7 +36883,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36810
36883
|
}
|
|
36811
36884
|
return {
|
|
36812
36885
|
artifact,
|
|
36813
|
-
producer: Bun.file(
|
|
36886
|
+
producer: Bun.file(join61(directory, artifact.producer.module))
|
|
36814
36887
|
};
|
|
36815
36888
|
},
|
|
36816
36889
|
write: async (release) => {
|
|
@@ -36818,14 +36891,14 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36818
36891
|
const validated = await verifyAbsoluteMobileCompatibilityProducer({ artifact: validatedArtifact, producer: release.producer }, maxProducerBytes);
|
|
36819
36892
|
const parent = appDirectory(validated.artifact.appId);
|
|
36820
36893
|
await mkdir15(parent, { recursive: true });
|
|
36821
|
-
const staging = await mkdtemp2(
|
|
36822
|
-
const producerPath =
|
|
36894
|
+
const staging = await mkdtemp2(join61(parent, ".stage-"));
|
|
36895
|
+
const producerPath = join61(staging, validated.artifact.producer.module);
|
|
36823
36896
|
try {
|
|
36824
36897
|
await mkdir15(resolvePath2(producerPath, ".."), {
|
|
36825
36898
|
recursive: true
|
|
36826
36899
|
});
|
|
36827
36900
|
await Promise.all([
|
|
36828
|
-
writeFile12(
|
|
36901
|
+
writeFile12(join61(staging, ARTIFACT_FILE), `${JSON.stringify(validated.artifact, null, "\t")}
|
|
36829
36902
|
`),
|
|
36830
36903
|
writeFile12(producerPath, new Uint8Array(await validated.producer.arrayBuffer()))
|
|
36831
36904
|
]);
|
|
@@ -36871,7 +36944,7 @@ import {
|
|
|
36871
36944
|
rm as rm16,
|
|
36872
36945
|
writeFile as writeFile13
|
|
36873
36946
|
} from "fs/promises";
|
|
36874
|
-
import { dirname as dirname37, join as
|
|
36947
|
+
import { dirname as dirname37, join as join62, resolve as resolvePath3 } from "path";
|
|
36875
36948
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
36876
36949
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code2) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code2, bundleIdFor = (currentReleaseId, releases) => {
|
|
36877
36950
|
const identity = JSON.stringify({
|
|
@@ -36902,16 +36975,16 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36902
36975
|
releases
|
|
36903
36976
|
};
|
|
36904
36977
|
}, writeRelease = async (root, release) => {
|
|
36905
|
-
const directory =
|
|
36906
|
-
const producerPath =
|
|
36978
|
+
const directory = join62(root, release.artifact.releaseId);
|
|
36979
|
+
const producerPath = join62(directory, release.artifact.producer.module);
|
|
36907
36980
|
await mkdir16(dirname37(producerPath), { recursive: true });
|
|
36908
36981
|
await Promise.all([
|
|
36909
|
-
writeFile13(
|
|
36982
|
+
writeFile13(join62(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
36910
36983
|
`),
|
|
36911
36984
|
writeFile13(producerPath, new Uint8Array(await release.producer.arrayBuffer()))
|
|
36912
36985
|
]);
|
|
36913
36986
|
}, installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
36914
|
-
const destination =
|
|
36987
|
+
const destination = join62(bundlesRoot, bundleId);
|
|
36915
36988
|
try {
|
|
36916
36989
|
await access5(destination);
|
|
36917
36990
|
return destination;
|
|
@@ -36919,7 +36992,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36919
36992
|
if (!errorHasCode2(error, "ENOENT"))
|
|
36920
36993
|
throw error;
|
|
36921
36994
|
}
|
|
36922
|
-
const staging = await mkdtemp3(
|
|
36995
|
+
const staging = await mkdtemp3(join62(bundlesRoot, ".stage-"));
|
|
36923
36996
|
try {
|
|
36924
36997
|
await Promise.all(releases.map((release) => writeRelease(staging, release)));
|
|
36925
36998
|
await rename7(staging, destination);
|
|
@@ -36950,15 +37023,15 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36950
37023
|
};
|
|
36951
37024
|
}, loadAbsoluteMobileMaterializedBundle = async (root) => {
|
|
36952
37025
|
const resolvedRoot = resolvePath3(root);
|
|
36953
|
-
const serialized = await readFile12(
|
|
37026
|
+
const serialized = await readFile12(join62(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
36954
37027
|
const parsed = JSON.parse(serialized);
|
|
36955
37028
|
const index = parseBundleIndex(parsed);
|
|
36956
|
-
const bundleRoot =
|
|
37029
|
+
const bundleRoot = join62(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
36957
37030
|
return {
|
|
36958
37031
|
artifacts: index.releases,
|
|
36959
37032
|
currentReleaseId: index.currentReleaseId,
|
|
36960
37033
|
loadProducer: async (artifact) => {
|
|
36961
|
-
const modulePath =
|
|
37034
|
+
const modulePath = join62(bundleRoot, artifact.releaseId, artifact.producer.module);
|
|
36962
37035
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
36963
37036
|
artifact,
|
|
36964
37037
|
producer: Bun.file(modulePath)
|
|
@@ -36984,7 +37057,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36984
37057
|
return release;
|
|
36985
37058
|
});
|
|
36986
37059
|
const root = resolvePath3(input.root);
|
|
36987
|
-
const bundlesRoot =
|
|
37060
|
+
const bundlesRoot = join62(root, BUNDLES_DIRECTORY);
|
|
36988
37061
|
await mkdir16(bundlesRoot, { recursive: true });
|
|
36989
37062
|
const bundleId = bundleIdFor(input.currentReleaseId, artifacts);
|
|
36990
37063
|
await installImmutableBundle(bundlesRoot, bundleId, orderedReleases);
|
|
@@ -36994,8 +37067,8 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36994
37067
|
format: ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT,
|
|
36995
37068
|
releases: artifacts
|
|
36996
37069
|
};
|
|
36997
|
-
const pointerPath =
|
|
36998
|
-
const temporaryPointerPath =
|
|
37070
|
+
const pointerPath = join62(root, CURRENT_BUNDLE_FILE);
|
|
37071
|
+
const temporaryPointerPath = join62(root, `.current-${crypto.randomUUID()}.json`);
|
|
36999
37072
|
await writeFile13(temporaryPointerPath, `${JSON.stringify(index, null, "\t")}
|
|
37000
37073
|
`, { flag: "wx" });
|
|
37001
37074
|
await rename7(temporaryPointerPath, pointerPath);
|
|
@@ -37003,12 +37076,12 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37003
37076
|
}, readAbsoluteMobileMaterializedReleases = async (root) => {
|
|
37004
37077
|
const resolvedRoot = resolvePath3(root);
|
|
37005
37078
|
try {
|
|
37006
|
-
const serialized = await readFile12(
|
|
37079
|
+
const serialized = await readFile12(join62(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
37007
37080
|
const parsed = JSON.parse(serialized);
|
|
37008
37081
|
const index = parseBundleIndex(parsed);
|
|
37009
|
-
const bundleRoot =
|
|
37082
|
+
const bundleRoot = join62(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
37010
37083
|
return Promise.all(index.releases.map(async (artifact) => {
|
|
37011
|
-
const producer = Bun.file(
|
|
37084
|
+
const producer = Bun.file(join62(bundleRoot, artifact.releaseId, artifact.producer.module));
|
|
37012
37085
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
37013
37086
|
artifact,
|
|
37014
37087
|
producer
|
|
@@ -37203,7 +37276,7 @@ __export(exports_prerender, {
|
|
|
37203
37276
|
routeToFilename: () => routeToFilename
|
|
37204
37277
|
});
|
|
37205
37278
|
import { mkdirSync as mkdirSync17, readFileSync as readFileSync41 } from "fs";
|
|
37206
|
-
import { join as
|
|
37279
|
+
import { join as join63 } from "path";
|
|
37207
37280
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
37208
37281
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37209
37282
|
await Bun.write(metaPath, String(Date.now()));
|
|
@@ -37273,7 +37346,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
37273
37346
|
if (!isCompleteHtml(html))
|
|
37274
37347
|
return false;
|
|
37275
37348
|
const fileName = routeToFilename(route);
|
|
37276
|
-
const filePath =
|
|
37349
|
+
const filePath = join63(prerenderDir, fileName);
|
|
37277
37350
|
await Bun.write(filePath, html);
|
|
37278
37351
|
await writeTimestamp(filePath);
|
|
37279
37352
|
return true;
|
|
@@ -37303,13 +37376,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
37303
37376
|
return;
|
|
37304
37377
|
}
|
|
37305
37378
|
const fileName = routeToFilename(route);
|
|
37306
|
-
const filePath =
|
|
37379
|
+
const filePath = join63(prerenderDir, fileName);
|
|
37307
37380
|
await Bun.write(filePath, html);
|
|
37308
37381
|
await writeTimestamp(filePath);
|
|
37309
37382
|
result.routes.set(route, filePath);
|
|
37310
37383
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
37311
37384
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
37312
|
-
const prerenderDir =
|
|
37385
|
+
const prerenderDir = join63(outDir, "_prerendered");
|
|
37313
37386
|
mkdirSync17(prerenderDir, { recursive: true });
|
|
37314
37387
|
const baseUrl = `http://localhost:${port}`;
|
|
37315
37388
|
let routes;
|
|
@@ -37428,10 +37501,10 @@ __export(exports_prepare, {
|
|
|
37428
37501
|
});
|
|
37429
37502
|
import { createHash as createHash12 } from "crypto";
|
|
37430
37503
|
import { existsSync as existsSync50, readdirSync as readdirSync14, readFileSync as readFileSync42 } from "fs";
|
|
37431
|
-
import { basename as basename22, join as
|
|
37504
|
+
import { basename as basename22, join as join64, relative as relative24, resolve as resolvePath4 } from "path";
|
|
37432
37505
|
import { Elysia as Elysia11, NotFound } from "elysia";
|
|
37433
|
-
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((
|
|
37434
|
-
setTimeout(
|
|
37506
|
+
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve56) => {
|
|
37507
|
+
setTimeout(resolve56, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
37435
37508
|
}), retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
37436
37509
|
try {
|
|
37437
37510
|
return await createStaticPlugin(options);
|
|
@@ -37517,7 +37590,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37517
37590
|
return files;
|
|
37518
37591
|
}, PREWARM_MAX_PAUSE_MS = 60000, toWarmTasks = function* (files, warmCache2, srcUrlPrefix) {
|
|
37519
37592
|
for (const file6 of files) {
|
|
37520
|
-
const rel =
|
|
37593
|
+
const rel = relative24(process.cwd(), file6).replace(/\\/g, "/");
|
|
37521
37594
|
yield () => warmCache2(`${srcUrlPrefix}${rel}`);
|
|
37522
37595
|
}
|
|
37523
37596
|
}, builtPageSources = () => {
|
|
@@ -37558,7 +37631,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37558
37631
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
37559
37632
|
if (!existsSync50(srcPath))
|
|
37560
37633
|
continue;
|
|
37561
|
-
const rel =
|
|
37634
|
+
const rel = relative24(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
37562
37635
|
manifest[key] = `${SRC_URL_PREFIX3}${rel}`;
|
|
37563
37636
|
}
|
|
37564
37637
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
@@ -37570,7 +37643,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37570
37643
|
if (cached !== undefined)
|
|
37571
37644
|
return cached;
|
|
37572
37645
|
const path2 = href.split("?")[0] ?? href;
|
|
37573
|
-
const filePath =
|
|
37646
|
+
const filePath = join64(buildDir, path2);
|
|
37574
37647
|
let versioned = href;
|
|
37575
37648
|
if (existsSync50(filePath)) {
|
|
37576
37649
|
const hash = createHash12("sha256").update(readFileSync42(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
@@ -37717,12 +37790,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37717
37790
|
continue;
|
|
37718
37791
|
const name = basename22(entry, ".html");
|
|
37719
37792
|
const route = name === "index" ? "/" : `/${name}`;
|
|
37720
|
-
map.set(route,
|
|
37793
|
+
map.set(route, join64(prerenderDir, entry));
|
|
37721
37794
|
}
|
|
37722
37795
|
return map;
|
|
37723
37796
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
37724
|
-
const root =
|
|
37725
|
-
if (!existsSync50(
|
|
37797
|
+
const root = join64(buildDir, ".absolutejs", "mobile-compatibility");
|
|
37798
|
+
if (!existsSync50(join64(root, "current.json"))) {
|
|
37726
37799
|
return new Elysia11({ name: "absolutejs-mobile-compatibility-empty" });
|
|
37727
37800
|
}
|
|
37728
37801
|
const [
|
|
@@ -37787,12 +37860,12 @@ This usually means a build-time error in a source file. Check the dev-server ter
|
|
|
37787
37860
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
37788
37861
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
37789
37862
|
stepStartedAt = performance.now();
|
|
37790
|
-
const conventionsPath =
|
|
37863
|
+
const conventionsPath = join64(buildDir, "conventions.json");
|
|
37791
37864
|
if (existsSync50(conventionsPath)) {
|
|
37792
37865
|
const conventions2 = JSON.parse(readFileSync42(conventionsPath, "utf-8"));
|
|
37793
37866
|
setConventions(conventions2);
|
|
37794
37867
|
}
|
|
37795
|
-
const spaRoutesPath =
|
|
37868
|
+
const spaRoutesPath = join64(buildDir, "spa-routes.json");
|
|
37796
37869
|
if (existsSync50(spaRoutesPath)) {
|
|
37797
37870
|
setSpaRouteManifest(JSON.parse(readFileSync42(spaRoutesPath, "utf-8")));
|
|
37798
37871
|
}
|
|
@@ -37805,12 +37878,12 @@ This usually means a build-time error in a source file. Check the dev-server ter
|
|
|
37805
37878
|
prefix: "",
|
|
37806
37879
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
37807
37880
|
});
|
|
37808
|
-
const generatedAssetsRoot =
|
|
37881
|
+
const generatedAssetsRoot = join64(buildDir, ".absolutejs");
|
|
37809
37882
|
const generatedAssetsPlugin = new Elysia11({
|
|
37810
37883
|
name: "absolutejs-generated-assets"
|
|
37811
37884
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
37812
37885
|
const requestedPath = resolvePath4(generatedAssetsRoot, params["*"]);
|
|
37813
|
-
if (
|
|
37886
|
+
if (relative24(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
37814
37887
|
set.status = 404;
|
|
37815
37888
|
return "Not Found";
|
|
37816
37889
|
}
|
|
@@ -37843,7 +37916,7 @@ This usually means a build-time error in a source file. Check the dev-server ter
|
|
|
37843
37916
|
responseValue.headers.set("cache-control", isFingerprintedAsset(pathname) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate");
|
|
37844
37917
|
});
|
|
37845
37918
|
stepStartedAt = performance.now();
|
|
37846
|
-
const prerenderDir =
|
|
37919
|
+
const prerenderDir = join64(buildDir, "_prerendered");
|
|
37847
37920
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
37848
37921
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
37849
37922
|
const mobileAssociationPlugin = await loadMobileAssociationPlugin(config.mobile);
|
|
@@ -37966,7 +38039,7 @@ import {
|
|
|
37966
38039
|
watch as watch2
|
|
37967
38040
|
} from "fs";
|
|
37968
38041
|
import { createHash as createHash13 } from "crypto";
|
|
37969
|
-
import { dirname as dirname38, join as
|
|
38042
|
+
import { dirname as dirname38, join as join67, resolve as resolve56 } from "path";
|
|
37970
38043
|
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, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path2) => {
|
|
37971
38044
|
try {
|
|
37972
38045
|
return createHash13("sha256").update(readFileSync45(path2)).digest("hex");
|
|
@@ -37994,10 +38067,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37994
38067
|
return;
|
|
37995
38068
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
37996
38069
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
37997
|
-
const entryPath =
|
|
38070
|
+
const entryPath = resolve56(originalEntry);
|
|
37998
38071
|
const entryDir = dirname38(entryPath);
|
|
37999
38072
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
38000
|
-
const configPath2 =
|
|
38073
|
+
const configPath2 = resolve56(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
38001
38074
|
const configDir2 = dirname38(configPath2);
|
|
38002
38075
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
38003
38076
|
const recentlyHandled = new Map;
|
|
@@ -38008,7 +38081,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
38008
38081
|
let pendingEntryCause = null;
|
|
38009
38082
|
let siblingSequence = 0;
|
|
38010
38083
|
const importFreshEntry = async (attempt = 1) => {
|
|
38011
|
-
const siblingPath =
|
|
38084
|
+
const siblingPath = join67(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
38012
38085
|
let failure;
|
|
38013
38086
|
try {
|
|
38014
38087
|
copyFileSync6(entryPath, siblingPath);
|
|
@@ -38121,7 +38194,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
38121
38194
|
continue;
|
|
38122
38195
|
let st2;
|
|
38123
38196
|
try {
|
|
38124
|
-
st2 = statSync9(
|
|
38197
|
+
st2 = statSync9(join67(dir, entry.name));
|
|
38125
38198
|
} catch {
|
|
38126
38199
|
continue;
|
|
38127
38200
|
}
|
|
@@ -38538,10 +38611,10 @@ import {
|
|
|
38538
38611
|
} from "fs";
|
|
38539
38612
|
import { X509Certificate as X509Certificate4 } from "crypto";
|
|
38540
38613
|
import { isIP } from "net";
|
|
38541
|
-
import { join as
|
|
38542
|
-
var CERT_DIR =
|
|
38543
|
-
var CERT_PATH =
|
|
38544
|
-
var KEY_PATH =
|
|
38614
|
+
import { join as join65 } from "path";
|
|
38615
|
+
var CERT_DIR = join65(process.cwd(), ".absolutejs");
|
|
38616
|
+
var CERT_PATH = join65(CERT_DIR, "cert.pem");
|
|
38617
|
+
var KEY_PATH = join65(CERT_DIR, "key.pem");
|
|
38545
38618
|
var CERT_VALIDITY_DAYS = 365;
|
|
38546
38619
|
var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
38547
38620
|
var CERTIFICATE_HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/u;
|
|
@@ -38701,12 +38774,12 @@ import {
|
|
|
38701
38774
|
writeFileSync as writeFileSync12
|
|
38702
38775
|
} from "fs";
|
|
38703
38776
|
import { homedir as homedir2 } from "os";
|
|
38704
|
-
import { basename as basename23, join as
|
|
38777
|
+
import { basename as basename23, join as join66 } from "path";
|
|
38705
38778
|
var registeredPids = new Set;
|
|
38706
38779
|
var exitHandlerRegistered = false;
|
|
38707
|
-
var instanceFilePath = (pid) =>
|
|
38708
|
-
var instanceLogPath = (pid) =>
|
|
38709
|
-
var instanceRegistryDir = () =>
|
|
38780
|
+
var instanceFilePath = (pid) => join66(instanceRegistryDir(), `${pid}.json`);
|
|
38781
|
+
var instanceLogPath = (pid) => join66(instanceRegistryDir(), `${pid}.log`);
|
|
38782
|
+
var instanceRegistryDir = () => join66(homedir2(), ".absolutejs", "instances");
|
|
38710
38783
|
var removeInstanceFilesSync = (pid) => {
|
|
38711
38784
|
try {
|
|
38712
38785
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -38741,7 +38814,7 @@ var registerInstance = (record) => {
|
|
|
38741
38814
|
return record;
|
|
38742
38815
|
};
|
|
38743
38816
|
var resolveProjectName = (cwd2) => {
|
|
38744
|
-
const parsed = readJsonFile(
|
|
38817
|
+
const parsed = readJsonFile(join66(cwd2, "package.json"));
|
|
38745
38818
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
38746
38819
|
return parsed.name;
|
|
38747
38820
|
}
|
|
@@ -39216,7 +39289,7 @@ var serializeSpeculationRules = (rules) => {
|
|
|
39216
39289
|
// src/utils/defineEnv.ts
|
|
39217
39290
|
var {env: bunEnv } = globalThis.Bun;
|
|
39218
39291
|
import { existsSync as existsSync53, readFileSync as readFileSync46 } from "fs";
|
|
39219
|
-
import { resolve as
|
|
39292
|
+
import { resolve as resolve57 } from "path";
|
|
39220
39293
|
|
|
39221
39294
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
39222
39295
|
var exports_value = {};
|
|
@@ -45251,7 +45324,7 @@ ${lines.join(`
|
|
|
45251
45324
|
};
|
|
45252
45325
|
var checkEnvFileSecurity = (properties) => {
|
|
45253
45326
|
const cwd2 = process.cwd();
|
|
45254
|
-
const envPath =
|
|
45327
|
+
const envPath = resolve57(cwd2, ".env");
|
|
45255
45328
|
if (!existsSync53(envPath))
|
|
45256
45329
|
return;
|
|
45257
45330
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -45261,7 +45334,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
45261
45334
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
45262
45335
|
if (presentKeys.length === 0)
|
|
45263
45336
|
return;
|
|
45264
|
-
const gitignorePath =
|
|
45337
|
+
const gitignorePath = resolve57(cwd2, ".gitignore");
|
|
45265
45338
|
if (existsSync53(gitignorePath)) {
|
|
45266
45339
|
const gitignore = readFileSync46(gitignorePath, "utf-8");
|
|
45267
45340
|
if (gitignore.split(`
|
|
@@ -45296,7 +45369,7 @@ var getEnv = (key) => {
|
|
|
45296
45369
|
};
|
|
45297
45370
|
// src/utils/projectRoot.ts
|
|
45298
45371
|
import { existsSync as existsSync54 } from "fs";
|
|
45299
|
-
import { dirname as dirname39, resolve as
|
|
45372
|
+
import { dirname as dirname39, resolve as resolve58 } from "path";
|
|
45300
45373
|
var CONFIG_CANDIDATES = [
|
|
45301
45374
|
"absolute.config.ts",
|
|
45302
45375
|
"absolute.config.js",
|
|
@@ -45305,7 +45378,7 @@ var CONFIG_CANDIDATES = [
|
|
|
45305
45378
|
"absolute.config.mts",
|
|
45306
45379
|
"absolute.config.cts"
|
|
45307
45380
|
];
|
|
45308
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync54(
|
|
45381
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync54(resolve58(directory, name)));
|
|
45309
45382
|
var findProjectRoot = () => {
|
|
45310
45383
|
const start = process.cwd();
|
|
45311
45384
|
let packageRoot = null;
|
|
@@ -45314,7 +45387,7 @@ var findProjectRoot = () => {
|
|
|
45314
45387
|
if (hasAbsoluteConfig(directory)) {
|
|
45315
45388
|
return directory;
|
|
45316
45389
|
}
|
|
45317
|
-
if (packageRoot === null && existsSync54(
|
|
45390
|
+
if (packageRoot === null && existsSync54(resolve58(directory, "package.json"))) {
|
|
45318
45391
|
packageRoot = directory;
|
|
45319
45392
|
}
|
|
45320
45393
|
const parent = dirname39(directory);
|
|
@@ -45576,5 +45649,5 @@ export {
|
|
|
45576
45649
|
wrapPageHandlerWithStreamingSlots
|
|
45577
45650
|
};
|
|
45578
45651
|
|
|
45579
|
-
//# debugId=
|
|
45652
|
+
//# debugId=35BD5CEBA947237E64756E2164756E21
|
|
45580
45653
|
//# sourceMappingURL=index.js.map
|