@absolutejs/absolute 0.20.0-beta.2 → 0.20.0-beta.21
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/README.md +135 -0
- package/dist/angular/browser.js +15 -1
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +341 -22
- package/dist/angular/index.js.map +8 -5
- package/dist/angular/server.js +341 -22
- package/dist/angular/server.js.map +8 -5
- package/dist/build.js +1268 -598
- package/dist/build.js.map +17 -14
- package/dist/cli/index.js +5005 -1614
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrClient.ts +9 -3
- package/dist/dev/client/hmrTiming.ts +14 -7
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/index.js +1644 -863
- package/dist/index.js.map +26 -23
- package/dist/mobile/browser.js +123 -1
- package/dist/mobile/browser.js.map +6 -4
- package/dist/mobile/index.js +3369 -298
- package/dist/mobile/index.js.map +27 -13
- package/dist/mobile/remoteMacAgentEntry.js +29 -0
- package/dist/mobile/shellAuth.js +35 -0
- package/dist/mobile/shellBootstrap.js +585 -0
- package/dist/mobile/shellSync.js +123 -0
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/build/pwa.d.ts +16 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/core/prepare.d.ts +6 -0
- package/dist/src/dev/clientManager.d.ts +2 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +6 -1
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +22 -1
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +33 -0
- package/dist/src/mobile/index.d.ts +9 -0
- package/dist/src/mobile/iosConformance.d.ts +15 -0
- package/dist/src/mobile/iosNativeWatcher.d.ts +19 -0
- package/dist/src/mobile/iosRelease.d.ts +2 -2
- package/dist/src/mobile/iosSimulatorController.d.ts +89 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/remoteMacAgent.d.ts +2 -0
- package/dist/src/mobile/remoteMacAgentEntry.d.ts +1 -0
- package/dist/src/mobile/remoteMacProtocol.d.ts +114 -0
- package/dist/src/mobile/remoteMacWire.d.ts +2 -0
- package/dist/src/mobile/shellAuth.d.ts +13 -0
- package/dist/src/mobile/shellBootstrap.d.ts +18 -1
- package/dist/src/mobile/shellSync.d.ts +19 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +16 -1
- package/dist/src/plugins/hmr.d.ts +3 -0
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/utils/imageProcessing.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +312 -23
- package/dist/svelte/index.js.map +7 -4
- package/dist/svelte/server.js +307 -18
- package/dist/svelte/server.js.map +7 -4
- package/dist/types/build.d.ts +14 -0
- package/dist/vue/index.js +312 -23
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +307 -18
- package/dist/vue/server.js.map +7 -4
- package/package.json +30 -9
package/dist/build.js
CHANGED
|
@@ -969,9 +969,10 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
969
969
|
`}
|
|
970
970
|
`,
|
|
971
971
|
`// Attempt hydration with error handling`,
|
|
972
|
+
`const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
|
|
972
973
|
`// Use document (not document.body) when the page renders <html><head><body>`,
|
|
973
974
|
`// to avoid "In HTML, <html> cannot be a child of <body>" hydration error`,
|
|
974
|
-
`const container = typeof document !== 'undefined' ? document : null;`,
|
|
975
|
+
`const container = typeof document !== 'undefined' ? (shouldClientRender ? document.getElementById('root') : document) : null;`,
|
|
975
976
|
`if (!container) {`,
|
|
976
977
|
` throw new Error('React root container not found: document is null');`,
|
|
977
978
|
`}
|
|
@@ -997,7 +998,6 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
997
998
|
`if (!window.__REACT_ROOT__) {`,
|
|
998
999
|
` let root;`,
|
|
999
1000
|
` // Mobile data envelopes and dirty HMR pages have no matching SSR markup.`,
|
|
1000
|
-
` const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
|
|
1001
1001
|
` if (window.__SSR_DIRTY__ || shouldClientRender) {`,
|
|
1002
1002
|
` root = createRoot(container);`,
|
|
1003
1003
|
` root.render(${isDev ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
|
|
@@ -1077,6 +1077,15 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
1077
1077
|
` };`,
|
|
1078
1078
|
` }`,
|
|
1079
1079
|
`}`,
|
|
1080
|
+
`if (typeof window !== 'undefined') {`,
|
|
1081
|
+
` window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();`,
|
|
1082
|
+
` window.__ABSOLUTE_PAGE_DISPOSE__ = function() {`,
|
|
1083
|
+
` if (window.__REACT_ROOT__ && typeof window.__REACT_ROOT__.unmount === 'function') {`,
|
|
1084
|
+
` window.__REACT_ROOT__.unmount();`,
|
|
1085
|
+
` }`,
|
|
1086
|
+
` window.__REACT_ROOT__ = null;`,
|
|
1087
|
+
` };`,
|
|
1088
|
+
`}`,
|
|
1080
1089
|
...isDev ? [
|
|
1081
1090
|
`
|
|
1082
1091
|
// Pre-warm: import the page module from the module server`,
|
|
@@ -11149,6 +11158,20 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
11149
11158
|
return "webp";
|
|
11150
11159
|
}
|
|
11151
11160
|
return "jpeg";
|
|
11161
|
+
}, sniffImageMime = (buffer) => {
|
|
11162
|
+
if (buffer.length < 12)
|
|
11163
|
+
return null;
|
|
11164
|
+
if (buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78)
|
|
11165
|
+
return "image/png";
|
|
11166
|
+
if (buffer[0] === 255 && buffer[1] === 216)
|
|
11167
|
+
return "image/jpeg";
|
|
11168
|
+
if (buffer[0] === 71 && buffer[1] === 73 && buffer[2] === 70)
|
|
11169
|
+
return "image/gif";
|
|
11170
|
+
if (buffer.toString("ascii", 0, 4) === "RIFF" && buffer.toString("ascii", 8, 12) === "WEBP")
|
|
11171
|
+
return "image/webp";
|
|
11172
|
+
if (buffer.toString("ascii", 4, 12) === "ftypavif")
|
|
11173
|
+
return "image/avif";
|
|
11174
|
+
return null;
|
|
11152
11175
|
}, AVIF_QUALITY_OFFSET = 20, AVIF_EFFORT = 3, PNG_COMPRESSION_LEVEL = 9, optimizeWithBunImage = async (buffer, width, quality, format) => {
|
|
11153
11176
|
const pipeline = new Bun.Image(buffer).resize(width, undefined, {
|
|
11154
11177
|
withoutEnlargement: true
|
|
@@ -12355,7 +12378,8 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
12355
12378
|
});
|
|
12356
12379
|
process.on("uncaughtException", (err) => {
|
|
12357
12380
|
releaseAllSync();
|
|
12358
|
-
|
|
12381
|
+
console.error(err);
|
|
12382
|
+
process.exit(1);
|
|
12359
12383
|
});
|
|
12360
12384
|
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join23(dirname12(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
12361
12385
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
@@ -12849,13 +12873,566 @@ var isTestSourcePath = (file) => {
|
|
|
12849
12873
|
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
12850
12874
|
};
|
|
12851
12875
|
|
|
12876
|
+
// node_modules/@absolutejs/sync/dist/client/index.js
|
|
12877
|
+
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")) && Array.isArray(Reflect.get(value, "clients")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
12878
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
12879
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
|
|
12880
|
+
return value;
|
|
12881
|
+
}, isSchemaBundle = (schema) => ("components" in schema), validatePolicyMatch = (match, label) => {
|
|
12882
|
+
if (match.length === 0 || match.trim() !== match || /^\*+$/.test(match) || match.includes("**"))
|
|
12883
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.match must be an exact name or a non-empty glob without adjacent wildcards.`);
|
|
12884
|
+
}, validateSyncLocalDataPolicy = (policy, label = "localData") => {
|
|
12885
|
+
if (policy.maxBytesPerNamespace !== undefined && (!Number.isSafeInteger(policy.maxBytesPerNamespace) || policy.maxBytesPerNamespace < 1))
|
|
12886
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.maxBytesPerNamespace must be a positive safe integer.`);
|
|
12887
|
+
for (const [index, rule] of (policy.collections ?? []).entries()) {
|
|
12888
|
+
validatePolicyMatch(rule.match, `${label}.collections[${index}]`);
|
|
12889
|
+
if (rule.maxAgeMs !== undefined && (!Number.isSafeInteger(rule.maxAgeMs) || rule.maxAgeMs < 1))
|
|
12890
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}].maxAgeMs must be a positive safe integer.`);
|
|
12891
|
+
if (rule.persistence === "memory-only" && rule.protection === "required")
|
|
12892
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] cannot require at-rest protection when it is memory-only.`);
|
|
12893
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
12894
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] declares ${rule.sensitivity} data without required protection or memory-only persistence.`);
|
|
12895
|
+
}
|
|
12896
|
+
for (const [index, rule] of (policy.mutations ?? []).entries()) {
|
|
12897
|
+
validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
|
|
12898
|
+
if (rule.conflict !== undefined && rule.conflict.strategy !== "client-wins" && rule.conflict.strategy !== "manual" && rule.conflict.strategy !== "server-wins")
|
|
12899
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.strategy is invalid.`);
|
|
12900
|
+
if (rule.conflict?.maxAttempts !== undefined && (!Number.isSafeInteger(rule.conflict.maxAttempts) || rule.conflict.maxAttempts < 1))
|
|
12901
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts must be a positive safe integer.`);
|
|
12902
|
+
if (rule.conflict?.maxAttempts !== undefined && rule.conflict.strategy !== "client-wins")
|
|
12903
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts is only valid for client-wins.`);
|
|
12904
|
+
if (rule.persistence === "memory-only" && rule.protection === "required")
|
|
12905
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] cannot require at-rest protection when it is memory-only.`);
|
|
12906
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
12907
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] declares ${rule.sensitivity} arguments without required protection.`);
|
|
12908
|
+
}
|
|
12909
|
+
return policy;
|
|
12910
|
+
}, normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
|
|
12911
|
+
const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
|
|
12912
|
+
const ids = new Set;
|
|
12913
|
+
for (const component of components) {
|
|
12914
|
+
if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
|
|
12915
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
|
|
12916
|
+
if (ids.has(component.id))
|
|
12917
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
|
|
12918
|
+
ids.add(component.id);
|
|
12919
|
+
if (component.localData)
|
|
12920
|
+
validateSyncLocalDataPolicy(component.localData, `${component.id}.localData`);
|
|
12921
|
+
}
|
|
12922
|
+
return components.sort((a, b2) => a.id.localeCompare(b2.id));
|
|
12923
|
+
}, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
|
|
12924
|
+
const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
|
|
12925
|
+
const current = resolveSyncLocalMigrations(component.version, component);
|
|
12926
|
+
return {
|
|
12927
|
+
id: component.id,
|
|
12928
|
+
...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
|
|
12929
|
+
};
|
|
12930
|
+
});
|
|
12931
|
+
const active = new Set(components.map((component) => component.id));
|
|
12932
|
+
const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
|
|
12933
|
+
return { components, orphanedComponents };
|
|
12934
|
+
}, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
|
|
12935
|
+
positiveVersion(storedVersion, "Stored Sync schema version");
|
|
12936
|
+
const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
|
|
12937
|
+
const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
|
|
12938
|
+
const versions = new Set;
|
|
12939
|
+
for (const migration of migrations) {
|
|
12940
|
+
positiveVersion(migration.toVersion, "Sync migration toVersion");
|
|
12941
|
+
if (versions.has(migration.toVersion))
|
|
12942
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
|
|
12943
|
+
versions.add(migration.toVersion);
|
|
12944
|
+
}
|
|
12945
|
+
const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
|
|
12946
|
+
const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
|
|
12947
|
+
if (minimumCompatibleVersion > targetVersion)
|
|
12948
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
|
|
12949
|
+
if (storedVersion > targetVersion)
|
|
12950
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
|
|
12951
|
+
if (storedVersion < minimumCompatibleVersion)
|
|
12952
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
|
|
12953
|
+
const steps = [];
|
|
12954
|
+
for (let version = storedVersion + 1;version <= targetVersion; version++) {
|
|
12955
|
+
const migration = migrations.find((candidate) => candidate.toVersion === version);
|
|
12956
|
+
if (migration === undefined)
|
|
12957
|
+
throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
|
|
12958
|
+
steps.push(migration);
|
|
12959
|
+
}
|
|
12960
|
+
return { minimumCompatibleVersion, steps, targetVersion };
|
|
12961
|
+
};
|
|
12962
|
+
var init_client = __esm(() => {
|
|
12963
|
+
RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
|
|
12964
|
+
host = globalThis;
|
|
12965
|
+
registry = (() => {
|
|
12966
|
+
const existing = host[RUNTIME_TRANSPORT];
|
|
12967
|
+
if (isRegistry(existing))
|
|
12968
|
+
return existing;
|
|
12969
|
+
if (typeof existing === "object" && existing !== null && Array.isArray(Reflect.get(existing, "installations"))) {
|
|
12970
|
+
Reflect.set(existing, "clients", []);
|
|
12971
|
+
return existing;
|
|
12972
|
+
}
|
|
12973
|
+
const created = { clients: [], installations: [] };
|
|
12974
|
+
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
12975
|
+
configurable: false,
|
|
12976
|
+
enumerable: false,
|
|
12977
|
+
value: created,
|
|
12978
|
+
writable: false
|
|
12979
|
+
});
|
|
12980
|
+
return created;
|
|
12981
|
+
})();
|
|
12982
|
+
SyncLocalDataPolicyError = class SyncLocalDataPolicyError extends Error {
|
|
12983
|
+
code;
|
|
12984
|
+
constructor(code, message) {
|
|
12985
|
+
super(message);
|
|
12986
|
+
this.name = "SyncLocalDataPolicyError";
|
|
12987
|
+
this.code = code;
|
|
12988
|
+
}
|
|
12989
|
+
};
|
|
12990
|
+
SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
|
|
12991
|
+
code;
|
|
12992
|
+
storedVersion;
|
|
12993
|
+
targetVersion;
|
|
12994
|
+
constructor(code, message, versions = {}) {
|
|
12995
|
+
super(message);
|
|
12996
|
+
this.name = "SyncLocalStoreSchemaError";
|
|
12997
|
+
this.code = code;
|
|
12998
|
+
this.storedVersion = versions.storedVersion;
|
|
12999
|
+
this.targetVersion = versions.targetVersion;
|
|
13000
|
+
}
|
|
13001
|
+
};
|
|
13002
|
+
});
|
|
13003
|
+
|
|
13004
|
+
// src/mobile/syncSchema.ts
|
|
13005
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
13006
|
+
import { dirname as dirname13, join as join24, resolve as resolve20 } from "path";
|
|
13007
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
13008
|
+
try {
|
|
13009
|
+
const value = JSON.parse(readFileSync13(path, "utf8"));
|
|
13010
|
+
return object(value) ? value : undefined;
|
|
13011
|
+
} catch {
|
|
13012
|
+
return;
|
|
13013
|
+
}
|
|
13014
|
+
}, localSchemaMetadata = (manifest) => {
|
|
13015
|
+
const absolutejs = Reflect.get(manifest, "absolutejs");
|
|
13016
|
+
if (!object(absolutejs))
|
|
13017
|
+
return;
|
|
13018
|
+
const sync = Reflect.get(absolutejs, "sync");
|
|
13019
|
+
if (!object(sync))
|
|
13020
|
+
return;
|
|
13021
|
+
return Reflect.get(sync, "localSchema");
|
|
13022
|
+
}, packageManifestPath = (projectRoot, packageName) => {
|
|
13023
|
+
let directory = resolve20(projectRoot);
|
|
13024
|
+
while (true) {
|
|
13025
|
+
const candidate = join24(directory, "node_modules", packageName, "package.json");
|
|
13026
|
+
const manifest = manifestAt(candidate);
|
|
13027
|
+
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
13028
|
+
return candidate;
|
|
13029
|
+
const parent = dirname13(directory);
|
|
13030
|
+
if (parent === directory)
|
|
13031
|
+
return;
|
|
13032
|
+
directory = parent;
|
|
13033
|
+
}
|
|
13034
|
+
}, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
|
|
13035
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
13036
|
+
throw metadataError(id, `${field} must be a positive safe integer.`);
|
|
13037
|
+
return value;
|
|
13038
|
+
}, nonEmpty = (value, id, field) => {
|
|
13039
|
+
if (typeof value !== "string" || value.trim() !== value || value.length === 0)
|
|
13040
|
+
throw metadataError(id, `${field} must be a non-empty trimmed string.`);
|
|
13041
|
+
return value;
|
|
13042
|
+
}, requireObject = (value, id, detail) => {
|
|
13043
|
+
if (!object(value))
|
|
13044
|
+
throw metadataError(id, detail);
|
|
13045
|
+
return value;
|
|
13046
|
+
}, unknownField = (record, key) => record[key], normalizeJsonValue = (value, id, field) => {
|
|
13047
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
13048
|
+
return value;
|
|
13049
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
13050
|
+
return value;
|
|
13051
|
+
if (Array.isArray(value))
|
|
13052
|
+
return value.map((entry) => normalizeJsonValue(entry, id, field));
|
|
13053
|
+
if (object(value))
|
|
13054
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
13055
|
+
key,
|
|
13056
|
+
normalizeJsonValue(entry, id, field)
|
|
13057
|
+
]));
|
|
13058
|
+
throw metadataError(id, `${field} must be JSON-safe.`);
|
|
13059
|
+
}, operation = (value, id, index) => {
|
|
13060
|
+
const record = requireObject(value, id, `migration operation ${index} must be an object.`);
|
|
13061
|
+
const type = Reflect.get(record, "type");
|
|
13062
|
+
const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
|
|
13063
|
+
if (type === "delete-collection")
|
|
13064
|
+
return { collection, type };
|
|
13065
|
+
if (type === "rename-field")
|
|
13066
|
+
return {
|
|
13067
|
+
collection,
|
|
13068
|
+
from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
|
|
13069
|
+
to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
|
|
13070
|
+
type
|
|
13071
|
+
};
|
|
13072
|
+
const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
|
|
13073
|
+
if (type === "remove-field")
|
|
13074
|
+
return { collection, field, type };
|
|
13075
|
+
if (type === "set-default")
|
|
13076
|
+
return {
|
|
13077
|
+
collection,
|
|
13078
|
+
field,
|
|
13079
|
+
type,
|
|
13080
|
+
value: normalizeJsonValue(Reflect.get(record, "value"), id, `operation ${index}.value`)
|
|
13081
|
+
};
|
|
13082
|
+
throw metadataError(id, `operation ${index}.type is not supported.`);
|
|
13083
|
+
}, migration = (value, id, index) => {
|
|
13084
|
+
const record = requireObject(value, id, `migration ${index} must be an object.`);
|
|
13085
|
+
const allowed = new Set(["operations", "toVersion"]);
|
|
13086
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13087
|
+
if (unsupported)
|
|
13088
|
+
throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
|
|
13089
|
+
const declaredOperations = Reflect.get(record, "operations");
|
|
13090
|
+
if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
|
|
13091
|
+
throw metadataError(id, `migration ${index}.operations must be an array.`);
|
|
13092
|
+
const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
|
|
13093
|
+
return {
|
|
13094
|
+
operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
|
|
13095
|
+
toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
|
|
13096
|
+
};
|
|
13097
|
+
}, localDataPolicy = (value, id) => {
|
|
13098
|
+
const record = requireObject(value, id, "localData must be an object.");
|
|
13099
|
+
const allowed = new Set([
|
|
13100
|
+
"collections",
|
|
13101
|
+
"maxBytesPerNamespace",
|
|
13102
|
+
"mutations"
|
|
13103
|
+
]);
|
|
13104
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13105
|
+
if (unsupported)
|
|
13106
|
+
throw metadataError(id, `localData.${unsupported} is not supported.`);
|
|
13107
|
+
const collectionRules = Reflect.get(record, "collections");
|
|
13108
|
+
const mutationRules = Reflect.get(record, "mutations");
|
|
13109
|
+
if (collectionRules !== undefined && !Array.isArray(collectionRules))
|
|
13110
|
+
throw metadataError(id, "localData.collections must be an array.");
|
|
13111
|
+
if (mutationRules !== undefined && !Array.isArray(mutationRules))
|
|
13112
|
+
throw metadataError(id, "localData.mutations must be an array.");
|
|
13113
|
+
const collections = Array.isArray(collectionRules) ? collectionRules.map((entry, index) => {
|
|
13114
|
+
const rule = requireObject(entry, id, `localData.collections[${index}] must be an object.`);
|
|
13115
|
+
const allowedRuleKeys = new Set([
|
|
13116
|
+
"evictionPriority",
|
|
13117
|
+
"match",
|
|
13118
|
+
"maxAgeMs",
|
|
13119
|
+
"onProtectionUnavailable",
|
|
13120
|
+
"persistence",
|
|
13121
|
+
"protection",
|
|
13122
|
+
"sensitivity"
|
|
13123
|
+
]);
|
|
13124
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13125
|
+
if (unsupportedRuleKey)
|
|
13126
|
+
throw metadataError(id, `localData.collections[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13127
|
+
const match = nonEmpty(Reflect.get(rule, "match"), id, `localData.collections[${index}].match`);
|
|
13128
|
+
const persistence = unknownField(rule, "persistence");
|
|
13129
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13130
|
+
const protection = unknownField(rule, "protection");
|
|
13131
|
+
const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
|
|
13132
|
+
const evictionPriority = unknownField(rule, "evictionPriority");
|
|
13133
|
+
const maxAge = unknownField(rule, "maxAgeMs");
|
|
13134
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13135
|
+
throw metadataError(id, `localData.collections[${index}].persistence is invalid.`);
|
|
13136
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13137
|
+
throw metadataError(id, `localData.collections[${index}].sensitivity is invalid.`);
|
|
13138
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13139
|
+
throw metadataError(id, `localData.collections[${index}].protection is invalid.`);
|
|
13140
|
+
if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
|
|
13141
|
+
throw metadataError(id, `localData.collections[${index}].onProtectionUnavailable is invalid.`);
|
|
13142
|
+
if (evictionPriority !== undefined && evictionPriority !== "critical" && evictionPriority !== "normal" && evictionPriority !== "disposable")
|
|
13143
|
+
throw metadataError(id, `localData.collections[${index}].evictionPriority is invalid.`);
|
|
13144
|
+
return {
|
|
13145
|
+
match,
|
|
13146
|
+
...sensitivity ? { sensitivity } : {},
|
|
13147
|
+
...persistence ? { persistence } : {},
|
|
13148
|
+
...protection ? { protection } : {},
|
|
13149
|
+
...onProtectionUnavailable ? {
|
|
13150
|
+
onProtectionUnavailable
|
|
13151
|
+
} : {},
|
|
13152
|
+
...evictionPriority ? { evictionPriority } : {},
|
|
13153
|
+
...maxAge === undefined ? {} : {
|
|
13154
|
+
maxAgeMs: positiveVersion2(maxAge, id, `localData.collections[${index}].maxAgeMs`)
|
|
13155
|
+
}
|
|
13156
|
+
};
|
|
13157
|
+
}) : undefined;
|
|
13158
|
+
const mutations = Array.isArray(mutationRules) ? mutationRules.map((entry, index) => {
|
|
13159
|
+
const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
|
|
13160
|
+
const allowedRuleKeys = new Set([
|
|
13161
|
+
"conflict",
|
|
13162
|
+
"match",
|
|
13163
|
+
"onProtectionUnavailable",
|
|
13164
|
+
"persistence",
|
|
13165
|
+
"protection",
|
|
13166
|
+
"sensitivity"
|
|
13167
|
+
]);
|
|
13168
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13169
|
+
if (unsupportedRuleKey)
|
|
13170
|
+
throw metadataError(id, `localData.mutations[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13171
|
+
const protection = unknownField(rule, "protection");
|
|
13172
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13173
|
+
const persistence = unknownField(rule, "persistence");
|
|
13174
|
+
const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
|
|
13175
|
+
const declaredConflict = unknownField(rule, "conflict");
|
|
13176
|
+
let conflict;
|
|
13177
|
+
if (declaredConflict !== undefined) {
|
|
13178
|
+
const conflictRecord = requireObject(declaredConflict, id, `localData.mutations[${index}].conflict must be an object.`);
|
|
13179
|
+
const unsupportedConflictKey = Object.keys(conflictRecord).find((key) => key !== "maxAttempts" && key !== "strategy");
|
|
13180
|
+
if (unsupportedConflictKey)
|
|
13181
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.${unsupportedConflictKey} is not supported.`);
|
|
13182
|
+
const strategy = unknownField(conflictRecord, "strategy");
|
|
13183
|
+
if (strategy !== "client-wins" && strategy !== "manual" && strategy !== "server-wins")
|
|
13184
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.strategy is invalid.`);
|
|
13185
|
+
const maxAttempts = unknownField(conflictRecord, "maxAttempts");
|
|
13186
|
+
if (maxAttempts !== undefined && strategy !== "client-wins")
|
|
13187
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.maxAttempts requires client-wins.`);
|
|
13188
|
+
conflict = {
|
|
13189
|
+
strategy,
|
|
13190
|
+
...maxAttempts === undefined ? {} : {
|
|
13191
|
+
maxAttempts: positiveVersion2(maxAttempts, id, `localData.mutations[${index}].conflict.maxAttempts`)
|
|
13192
|
+
}
|
|
13193
|
+
};
|
|
13194
|
+
}
|
|
13195
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13196
|
+
throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
|
|
13197
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13198
|
+
throw metadataError(id, `localData.mutations[${index}].sensitivity is invalid.`);
|
|
13199
|
+
if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
|
|
13200
|
+
throw metadataError(id, `localData.mutations[${index}].onProtectionUnavailable is invalid.`);
|
|
13201
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13202
|
+
throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
|
|
13203
|
+
return {
|
|
13204
|
+
match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
|
|
13205
|
+
...conflict ? { conflict } : {},
|
|
13206
|
+
...sensitivity ? { sensitivity } : {},
|
|
13207
|
+
...onProtectionUnavailable ? { onProtectionUnavailable } : {},
|
|
13208
|
+
...persistence ? {
|
|
13209
|
+
persistence
|
|
13210
|
+
} : {},
|
|
13211
|
+
...protection ? { protection } : {}
|
|
13212
|
+
};
|
|
13213
|
+
}) : undefined;
|
|
13214
|
+
const quota = Reflect.get(record, "maxBytesPerNamespace");
|
|
13215
|
+
return {
|
|
13216
|
+
...collections ? { collections } : {},
|
|
13217
|
+
...mutations ? { mutations } : {},
|
|
13218
|
+
...quota === undefined ? {} : {
|
|
13219
|
+
maxBytesPerNamespace: positiveVersion2(quota, id, "localData.maxBytesPerNamespace")
|
|
13220
|
+
}
|
|
13221
|
+
};
|
|
13222
|
+
}, component = (id, value) => {
|
|
13223
|
+
const record = requireObject(value, id, "localSchema must be an object.");
|
|
13224
|
+
const allowed = new Set([
|
|
13225
|
+
"localData",
|
|
13226
|
+
"migrations",
|
|
13227
|
+
"minimumCompatibleVersion",
|
|
13228
|
+
"version"
|
|
13229
|
+
]);
|
|
13230
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13231
|
+
if (unsupported)
|
|
13232
|
+
throw metadataError(id, `${unsupported} is not supported.`);
|
|
13233
|
+
const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
|
|
13234
|
+
const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
|
|
13235
|
+
const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
|
|
13236
|
+
const declaredMigrations = Reflect.get(record, "migrations");
|
|
13237
|
+
const declaredLocalData = Reflect.get(record, "localData");
|
|
13238
|
+
if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
|
|
13239
|
+
throw metadataError(id, "migrations must be an array.");
|
|
13240
|
+
const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
|
|
13241
|
+
return {
|
|
13242
|
+
id,
|
|
13243
|
+
...declaredLocalData === undefined ? {} : { localData: localDataPolicy(declaredLocalData, id) },
|
|
13244
|
+
minimumCompatibleVersion,
|
|
13245
|
+
...Array.isArray(migrations) ? {
|
|
13246
|
+
migrations: migrations.map((entry, index) => migration(entry, id, index))
|
|
13247
|
+
} : {},
|
|
13248
|
+
version
|
|
13249
|
+
};
|
|
13250
|
+
}, dependencyNames = (manifest) => [
|
|
13251
|
+
Reflect.get(manifest, "dependencies"),
|
|
13252
|
+
Reflect.get(manifest, "optionalDependencies"),
|
|
13253
|
+
Reflect.get(manifest, "devDependencies"),
|
|
13254
|
+
Reflect.get(manifest, "peerDependencies")
|
|
13255
|
+
].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
13256
|
+
const appManifestPath = join24(resolve20(projectRoot), "package.json");
|
|
13257
|
+
const appManifest = manifestAt(appManifestPath);
|
|
13258
|
+
if (!appManifest)
|
|
13259
|
+
return {
|
|
13260
|
+
components: [
|
|
13261
|
+
{
|
|
13262
|
+
id: "@absolutejs/app",
|
|
13263
|
+
minimumCompatibleVersion: 1,
|
|
13264
|
+
version: 1
|
|
13265
|
+
}
|
|
13266
|
+
],
|
|
13267
|
+
sources: []
|
|
13268
|
+
};
|
|
13269
|
+
const appMetadata = localSchemaMetadata(appManifest);
|
|
13270
|
+
const components = [
|
|
13271
|
+
appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
|
|
13272
|
+
];
|
|
13273
|
+
const sources = [
|
|
13274
|
+
{ id: "@absolutejs/app", manifestPath: appManifestPath }
|
|
13275
|
+
];
|
|
13276
|
+
for (const name of dependencyNames(appManifest)) {
|
|
13277
|
+
const manifestPath = packageManifestPath(projectRoot, name);
|
|
13278
|
+
if (!manifestPath)
|
|
13279
|
+
continue;
|
|
13280
|
+
const manifest = manifestAt(manifestPath);
|
|
13281
|
+
if (!manifest)
|
|
13282
|
+
continue;
|
|
13283
|
+
const metadata = localSchemaMetadata(manifest);
|
|
13284
|
+
if (metadata === undefined)
|
|
13285
|
+
continue;
|
|
13286
|
+
components.push(component(name, metadata));
|
|
13287
|
+
sources.push({ id: name, manifestPath });
|
|
13288
|
+
}
|
|
13289
|
+
components.sort((left, right) => left.id.localeCompare(right.id));
|
|
13290
|
+
sources.sort((left, right) => left.id.localeCompare(right.id));
|
|
13291
|
+
resolveSyncLocalSchemaComponents({}, { components });
|
|
13292
|
+
return { components, sources };
|
|
13293
|
+
};
|
|
13294
|
+
var init_syncSchema = __esm(() => {
|
|
13295
|
+
init_client();
|
|
13296
|
+
});
|
|
13297
|
+
|
|
13298
|
+
// src/build/pwa.ts
|
|
13299
|
+
import { mkdir as mkdir5, rm as rm4, writeFile as writeFile5 } from "fs/promises";
|
|
13300
|
+
import { dirname as dirname14, join as join25 } from "path";
|
|
13301
|
+
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
13302
|
+
const input = value ?? fallback;
|
|
13303
|
+
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
13304
|
+
throw new TypeError(`${field} must be an absolute same-origin path.`);
|
|
13305
|
+
}
|
|
13306
|
+
let url;
|
|
13307
|
+
try {
|
|
13308
|
+
url = new URL(input, "https://absolute.invalid");
|
|
13309
|
+
} catch {
|
|
13310
|
+
throw new TypeError(`${field} must be an absolute same-origin path.`);
|
|
13311
|
+
}
|
|
13312
|
+
if (url.origin !== "https://absolute.invalid" || url.search || url.hash || url.pathname === "/") {
|
|
13313
|
+
throw new TypeError(`${field} must be a file path without query or hash.`);
|
|
13314
|
+
}
|
|
13315
|
+
for (const part of input.split("/")) {
|
|
13316
|
+
let decoded;
|
|
13317
|
+
try {
|
|
13318
|
+
decoded = decodeURIComponent(part);
|
|
13319
|
+
} catch {
|
|
13320
|
+
throw new TypeError(`${field} contains invalid URL encoding.`);
|
|
13321
|
+
}
|
|
13322
|
+
if (decoded === "." || decoded === ".." || decoded.includes("\\")) {
|
|
13323
|
+
throw new TypeError(`${field} must not contain traversal segments.`);
|
|
13324
|
+
}
|
|
13325
|
+
}
|
|
13326
|
+
return url.pathname;
|
|
13327
|
+
}, destinationFor = (buildPath, publicPath) => join25(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
13328
|
+
clientModule,
|
|
13329
|
+
manifestPath,
|
|
13330
|
+
serviceWorkerPath,
|
|
13331
|
+
sync
|
|
13332
|
+
}) => `import { registerServiceWorker } from ${JSON.stringify(clientModule)};
|
|
13333
|
+
${manifestPath ? `const manifest = document.querySelector('link[rel="manifest"]') ?? document.createElement('link');
|
|
13334
|
+
manifest.setAttribute('rel', 'manifest');
|
|
13335
|
+
manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
13336
|
+
if (!manifest.isConnected) document.head.append(manifest);
|
|
13337
|
+
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
13338
|
+
deferUntilLoad: false${sync ? `,
|
|
13339
|
+
sync: ${JSON.stringify(sync)}` : ""}
|
|
13340
|
+
});
|
|
13341
|
+
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
13342
|
+
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
13343
|
+
}
|
|
13344
|
+
`, injectPwaBootstrapHtml = (html) => {
|
|
13345
|
+
if (html.includes(BOOTSTRAP_MARKER))
|
|
13346
|
+
return html;
|
|
13347
|
+
const script = `<script type="module" src="${BOOTSTRAP_PUBLIC_PATH}" ${BOOTSTRAP_MARKER}></script>`;
|
|
13348
|
+
const closingHead = html.toLowerCase().indexOf("</head>");
|
|
13349
|
+
if (closingHead >= 0) {
|
|
13350
|
+
return `${html.slice(0, closingHead)}${script}${html.slice(closingHead)}`;
|
|
13351
|
+
}
|
|
13352
|
+
return `${script}${html}`;
|
|
13353
|
+
}, materializeAbsolutePwa = async ({
|
|
13354
|
+
buildPath,
|
|
13355
|
+
config,
|
|
13356
|
+
generatedRoot,
|
|
13357
|
+
projectRoot,
|
|
13358
|
+
write: write2 = true
|
|
13359
|
+
}) => {
|
|
13360
|
+
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
13361
|
+
if (serviceWorkerPath.slice(1).includes("/")) {
|
|
13362
|
+
throw new TypeError("pwa.serviceWorkerPath must be a root-level file so its default service-worker scope covers the application.");
|
|
13363
|
+
}
|
|
13364
|
+
const manifestPath = config.manifest ? publicFilePath(config.manifest.path, "/manifest.webmanifest", "pwa.manifest.path") : undefined;
|
|
13365
|
+
const artifacts = {
|
|
13366
|
+
bootstrapBanner: injectionSource(),
|
|
13367
|
+
bootstrapPublicPath: BOOTSTRAP_PUBLIC_PATH,
|
|
13368
|
+
manifestPath,
|
|
13369
|
+
serviceWorkerPath
|
|
13370
|
+
};
|
|
13371
|
+
if (!write2)
|
|
13372
|
+
return artifacts;
|
|
13373
|
+
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
13374
|
+
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
13375
|
+
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
13376
|
+
await mkdir5(dirname14(workerDestination), { recursive: true });
|
|
13377
|
+
await writeFile5(workerDestination, `${pushServiceWorker({
|
|
13378
|
+
...config.serviceWorker ?? {},
|
|
13379
|
+
sync: Boolean(config.sync)
|
|
13380
|
+
})}
|
|
13381
|
+
`);
|
|
13382
|
+
if (config.manifest && manifestPath) {
|
|
13383
|
+
const { path: _path, ...manifestConfig } = config.manifest;
|
|
13384
|
+
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
13385
|
+
await mkdir5(dirname14(manifestDestination), { recursive: true });
|
|
13386
|
+
await writeFile5(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
13387
|
+
`);
|
|
13388
|
+
}
|
|
13389
|
+
const generatedDirectory = join25(generatedRoot, "pwa");
|
|
13390
|
+
const bootstrapEntry = join25(generatedDirectory, "bootstrap.ts");
|
|
13391
|
+
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
13392
|
+
await mkdir5(generatedDirectory, { recursive: true });
|
|
13393
|
+
await writeFile5(bootstrapEntry, bootstrapEntrySource({
|
|
13394
|
+
clientModule,
|
|
13395
|
+
manifestPath,
|
|
13396
|
+
serviceWorkerPath,
|
|
13397
|
+
sync: config.sync ? {
|
|
13398
|
+
...config.sync === true ? {} : config.sync,
|
|
13399
|
+
storageSchema: {
|
|
13400
|
+
components: syncSchema?.components ?? []
|
|
13401
|
+
}
|
|
13402
|
+
} : config.sync
|
|
13403
|
+
}));
|
|
13404
|
+
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
13405
|
+
await rm4(browserDirectory, { force: true, recursive: true });
|
|
13406
|
+
await mkdir5(browserDirectory, { recursive: true });
|
|
13407
|
+
const result = await Bun.build({
|
|
13408
|
+
entrypoints: [bootstrapEntry],
|
|
13409
|
+
format: "esm",
|
|
13410
|
+
minify: true,
|
|
13411
|
+
naming: {
|
|
13412
|
+
asset: "asset-[hash].[ext]",
|
|
13413
|
+
chunk: "chunk-[hash].[ext]",
|
|
13414
|
+
entry: "bootstrap.js"
|
|
13415
|
+
},
|
|
13416
|
+
outdir: browserDirectory,
|
|
13417
|
+
splitting: true,
|
|
13418
|
+
target: "browser"
|
|
13419
|
+
});
|
|
13420
|
+
if (!result.success) {
|
|
13421
|
+
throw new AggregateError(result.logs, "Failed to build the AbsoluteJS PWA bootstrap.");
|
|
13422
|
+
}
|
|
13423
|
+
return artifacts;
|
|
13424
|
+
};
|
|
13425
|
+
var init_pwa = __esm(() => {
|
|
13426
|
+
init_syncSchema();
|
|
13427
|
+
});
|
|
13428
|
+
|
|
12852
13429
|
// src/build/scanVueSsrOnlyPages.ts
|
|
12853
13430
|
var exports_scanVueSsrOnlyPages = {};
|
|
12854
13431
|
__export(exports_scanVueSsrOnlyPages, {
|
|
12855
13432
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
12856
13433
|
});
|
|
12857
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
12858
|
-
import { join as
|
|
13434
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
13435
|
+
import { join as join26 } from "path";
|
|
12859
13436
|
import ts8 from "typescript";
|
|
12860
13437
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
12861
13438
|
if (filePath.endsWith(".tsx"))
|
|
@@ -12888,9 +13465,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
12888
13465
|
continue;
|
|
12889
13466
|
if (entry.name.startsWith("."))
|
|
12890
13467
|
continue;
|
|
12891
|
-
stack.push(
|
|
13468
|
+
stack.push(join26(dir, entry.name));
|
|
12892
13469
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
12893
|
-
out.push(
|
|
13470
|
+
out.push(join26(dir, entry.name));
|
|
12894
13471
|
}
|
|
12895
13472
|
}
|
|
12896
13473
|
}
|
|
@@ -12957,7 +13534,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
12957
13534
|
}, extractFromFile = (filePath, out) => {
|
|
12958
13535
|
let source;
|
|
12959
13536
|
try {
|
|
12960
|
-
source =
|
|
13537
|
+
source = readFileSync14(filePath, "utf-8");
|
|
12961
13538
|
} catch {
|
|
12962
13539
|
return;
|
|
12963
13540
|
}
|
|
@@ -13001,8 +13578,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13001
13578
|
});
|
|
13002
13579
|
|
|
13003
13580
|
// src/build/scanAngularHandlerCalls.ts
|
|
13004
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
13005
|
-
import { join as
|
|
13581
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync15 } from "fs";
|
|
13582
|
+
import { join as join27 } from "path";
|
|
13006
13583
|
import ts9 from "typescript";
|
|
13007
13584
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13008
13585
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13035,9 +13612,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13035
13612
|
continue;
|
|
13036
13613
|
if (entry.name.startsWith("."))
|
|
13037
13614
|
continue;
|
|
13038
|
-
stack.push(
|
|
13615
|
+
stack.push(join27(dir, entry.name));
|
|
13039
13616
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13040
|
-
out.push(
|
|
13617
|
+
out.push(join27(dir, entry.name));
|
|
13041
13618
|
}
|
|
13042
13619
|
}
|
|
13043
13620
|
}
|
|
@@ -13072,7 +13649,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13072
13649
|
}, extractCallsFromFile = (filePath, out) => {
|
|
13073
13650
|
let source;
|
|
13074
13651
|
try {
|
|
13075
|
-
source =
|
|
13652
|
+
source = readFileSync15(filePath, "utf-8");
|
|
13076
13653
|
} catch {
|
|
13077
13654
|
return;
|
|
13078
13655
|
}
|
|
@@ -13151,8 +13728,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13151
13728
|
});
|
|
13152
13729
|
|
|
13153
13730
|
// src/build/scanAngularPageRoutes.ts
|
|
13154
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
13155
|
-
import { basename as basename9, join as
|
|
13731
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync16 } from "fs";
|
|
13732
|
+
import { basename as basename9, join as join28 } from "path";
|
|
13156
13733
|
import ts10 from "typescript";
|
|
13157
13734
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13158
13735
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13192,9 +13769,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13192
13769
|
continue;
|
|
13193
13770
|
if (entry.name.startsWith("."))
|
|
13194
13771
|
continue;
|
|
13195
|
-
stack.push(
|
|
13772
|
+
stack.push(join28(dir, entry.name));
|
|
13196
13773
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13197
|
-
out.push(
|
|
13774
|
+
out.push(join28(dir, entry.name));
|
|
13198
13775
|
}
|
|
13199
13776
|
}
|
|
13200
13777
|
}
|
|
@@ -13223,7 +13800,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13223
13800
|
for (const file of files) {
|
|
13224
13801
|
let source;
|
|
13225
13802
|
try {
|
|
13226
|
-
source =
|
|
13803
|
+
source = readFileSync16(file, "utf-8");
|
|
13227
13804
|
} catch {
|
|
13228
13805
|
continue;
|
|
13229
13806
|
}
|
|
@@ -13270,8 +13847,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
13270
13847
|
__export(exports_parseAngularConfigImports, {
|
|
13271
13848
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13272
13849
|
});
|
|
13273
|
-
import { existsSync as existsSync20, readFileSync as
|
|
13274
|
-
import { dirname as
|
|
13850
|
+
import { existsSync as existsSync20, readFileSync as readFileSync17 } from "fs";
|
|
13851
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join29 } from "path";
|
|
13275
13852
|
import ts11 from "typescript";
|
|
13276
13853
|
var findDefineConfigCall = (sf) => {
|
|
13277
13854
|
let result = null;
|
|
@@ -13289,8 +13866,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13289
13866
|
};
|
|
13290
13867
|
ts11.forEachChild(sf, visit);
|
|
13291
13868
|
return result;
|
|
13292
|
-
}, findPropertyInitializer = (
|
|
13293
|
-
for (const prop of
|
|
13869
|
+
}, findPropertyInitializer = (object2, name) => {
|
|
13870
|
+
for (const prop of object2.properties) {
|
|
13294
13871
|
if (!ts11.isPropertyAssignment(prop))
|
|
13295
13872
|
continue;
|
|
13296
13873
|
if (!prop.name)
|
|
@@ -13326,15 +13903,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13326
13903
|
}, resolveConfigPath = (projectRoot) => {
|
|
13327
13904
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13328
13905
|
if (envOverride) {
|
|
13329
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
13906
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join29(projectRoot, envOverride);
|
|
13330
13907
|
if (existsSync20(resolved))
|
|
13331
13908
|
return resolved;
|
|
13332
13909
|
}
|
|
13333
13910
|
const candidates = [
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13911
|
+
join29(projectRoot, "absolute.config.ts"),
|
|
13912
|
+
join29(projectRoot, "absolute.config.mts"),
|
|
13913
|
+
join29(projectRoot, "absolute.config.js"),
|
|
13914
|
+
join29(projectRoot, "absolute.config.mjs")
|
|
13338
13915
|
];
|
|
13339
13916
|
for (const candidate of candidates) {
|
|
13340
13917
|
if (existsSync20(candidate))
|
|
@@ -13345,7 +13922,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
13345
13922
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
13346
13923
|
if (!configPath2)
|
|
13347
13924
|
return null;
|
|
13348
|
-
const source =
|
|
13925
|
+
const source = readFileSync17(configPath2, "utf-8");
|
|
13349
13926
|
if (!source.includes("angular"))
|
|
13350
13927
|
return null;
|
|
13351
13928
|
if (!source.includes("providers"))
|
|
@@ -13366,8 +13943,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13366
13943
|
const importInfo = findImportForBinding(sf, binding);
|
|
13367
13944
|
if (!importInfo)
|
|
13368
13945
|
return null;
|
|
13369
|
-
const configDir2 =
|
|
13370
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
13946
|
+
const configDir2 = dirname15(configPath2);
|
|
13947
|
+
const absolutePath = importInfo.source.startsWith(".") ? join29(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
13371
13948
|
return {
|
|
13372
13949
|
absolutePath,
|
|
13373
13950
|
bindingName: binding,
|
|
@@ -13382,8 +13959,8 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13382
13959
|
const componentMatch = attributeString.match(/\bcomponent\s*=\s*["']([^"']+)["']/);
|
|
13383
13960
|
const hydrateMatch = attributeString.match(/\bhydrate\s*=\s*["']([^"']+)["']/);
|
|
13384
13961
|
const framework = frameworkMatch?.[1];
|
|
13385
|
-
const
|
|
13386
|
-
if (!framework || !
|
|
13962
|
+
const component2 = componentMatch?.[1];
|
|
13963
|
+
if (!framework || !component2) {
|
|
13387
13964
|
return null;
|
|
13388
13965
|
}
|
|
13389
13966
|
if (!isIslandFramework2(framework)) {
|
|
@@ -13391,7 +13968,7 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13391
13968
|
}
|
|
13392
13969
|
const hydrateCandidate = hydrateMatch?.[1];
|
|
13393
13970
|
return {
|
|
13394
|
-
component,
|
|
13971
|
+
component: component2,
|
|
13395
13972
|
framework,
|
|
13396
13973
|
hydrate: hydrateCandidate && isIslandHydrate(hydrateCandidate) ? hydrateCandidate : undefined
|
|
13397
13974
|
};
|
|
@@ -13400,12 +13977,12 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13400
13977
|
return;
|
|
13401
13978
|
usageMap.set(normalizeUsage(usage), usage);
|
|
13402
13979
|
}, addRenderCallUsage = (usageMap, match) => {
|
|
13403
|
-
const [, framework,
|
|
13404
|
-
if (!framework || !
|
|
13980
|
+
const [, framework, component2, hydrate] = match;
|
|
13981
|
+
if (!framework || !component2 || !isIslandFramework2(framework)) {
|
|
13405
13982
|
return;
|
|
13406
13983
|
}
|
|
13407
13984
|
addUsage(usageMap, {
|
|
13408
|
-
component,
|
|
13985
|
+
component: component2,
|
|
13409
13986
|
framework,
|
|
13410
13987
|
hydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined
|
|
13411
13988
|
});
|
|
@@ -13459,7 +14036,7 @@ __export(exports_renderToReadableStream, {
|
|
|
13459
14036
|
renderToReadableStream: () => renderToReadableStream,
|
|
13460
14037
|
SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
|
|
13461
14038
|
});
|
|
13462
|
-
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (
|
|
14039
|
+
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
|
|
13463
14040
|
bootstrapScriptContent,
|
|
13464
14041
|
bootstrapScripts = [],
|
|
13465
14042
|
bootstrapModules = [],
|
|
@@ -13473,7 +14050,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
13473
14050
|
try {
|
|
13474
14051
|
const { render } = await import("svelte/server");
|
|
13475
14052
|
const renderComponent = render;
|
|
13476
|
-
const rendered = typeof props === "undefined" ? await renderComponent(
|
|
14053
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
|
|
13477
14054
|
const { head, body } = rendered;
|
|
13478
14055
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
13479
14056
|
const scripts = (bootstrapScriptContent ? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>` : "") + bootstrapScripts.map((src) => `<script${nonceAttr} src="${src}"></script>`).join("") + bootstrapModules.map((src) => `<script${nonceAttr} type="module" src="${src}"></script>`).join("");
|
|
@@ -13516,13 +14093,13 @@ __export(exports_compileSvelte, {
|
|
|
13516
14093
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
13517
14094
|
});
|
|
13518
14095
|
import { existsSync as existsSync21 } from "fs";
|
|
13519
|
-
import { mkdir as
|
|
14096
|
+
import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
|
|
13520
14097
|
import {
|
|
13521
|
-
dirname as
|
|
13522
|
-
join as
|
|
14098
|
+
dirname as dirname16,
|
|
14099
|
+
join as join30,
|
|
13523
14100
|
basename as basename10,
|
|
13524
14101
|
extname as extname7,
|
|
13525
|
-
resolve as
|
|
14102
|
+
resolve as resolve21,
|
|
13526
14103
|
relative as relative11,
|
|
13527
14104
|
sep as sep2
|
|
13528
14105
|
} from "path";
|
|
@@ -13530,14 +14107,14 @@ import { env } from "process";
|
|
|
13530
14107
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13531
14108
|
var resolveDevClientDir2 = () => {
|
|
13532
14109
|
const projectRoot = process.cwd();
|
|
13533
|
-
const fromSource =
|
|
14110
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
13534
14111
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13535
14112
|
return fromSource;
|
|
13536
14113
|
}
|
|
13537
|
-
const fromNodeModules =
|
|
14114
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13538
14115
|
if (existsSync21(fromNodeModules))
|
|
13539
14116
|
return fromNodeModules;
|
|
13540
|
-
return
|
|
14117
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
13541
14118
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13542
14119
|
persistentCache.clear();
|
|
13543
14120
|
sourceHashCache.clear();
|
|
@@ -13567,7 +14144,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13567
14144
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13568
14145
|
if (!spec.startsWith("."))
|
|
13569
14146
|
return null;
|
|
13570
|
-
const basePath =
|
|
14147
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13571
14148
|
const candidates = [
|
|
13572
14149
|
basePath,
|
|
13573
14150
|
`${basePath}.ts`,
|
|
@@ -13578,14 +14155,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13578
14155
|
`${basePath}.svelte`,
|
|
13579
14156
|
`${basePath}.svelte.ts`,
|
|
13580
14157
|
`${basePath}.svelte.js`,
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
14158
|
+
join30(basePath, "index.ts"),
|
|
14159
|
+
join30(basePath, "index.js"),
|
|
14160
|
+
join30(basePath, "index.mjs"),
|
|
14161
|
+
join30(basePath, "index.cjs"),
|
|
14162
|
+
join30(basePath, "index.json"),
|
|
14163
|
+
join30(basePath, "index.svelte"),
|
|
14164
|
+
join30(basePath, "index.svelte.ts"),
|
|
14165
|
+
join30(basePath, "index.svelte.js")
|
|
13589
14166
|
];
|
|
13590
14167
|
const checks = await Promise.all(candidates.map(exists));
|
|
13591
14168
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13594,7 +14171,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13594
14171
|
const resolved = resolvePackageImport(spec);
|
|
13595
14172
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13596
14173
|
}
|
|
13597
|
-
const basePath =
|
|
14174
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13598
14175
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13599
14176
|
if (!explicit) {
|
|
13600
14177
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -13624,10 +14201,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13624
14201
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
13625
14202
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
13626
14203
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
13627
|
-
const clientDir =
|
|
13628
|
-
const indexDir =
|
|
13629
|
-
const serverDir =
|
|
13630
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
14204
|
+
const clientDir = join30(generatedDir, "client");
|
|
14205
|
+
const indexDir = join30(generatedDir, "indexes");
|
|
14206
|
+
const serverDir = join30(generatedDir, "server");
|
|
14207
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir6(dir, { recursive: true })));
|
|
13631
14208
|
const dev = env.NODE_ENV !== "production";
|
|
13632
14209
|
const build = async (src) => {
|
|
13633
14210
|
const memoized = cache.get(src);
|
|
@@ -13654,8 +14231,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13654
14231
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
13655
14232
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
13656
14233
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
13657
|
-
const rawRel =
|
|
13658
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(),
|
|
14234
|
+
const rawRel = dirname16(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
14235
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
|
|
13659
14236
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13660
14237
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
13661
14238
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -13664,8 +14241,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13664
14241
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
13665
14242
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
13666
14243
|
const externalRewrites = new Map;
|
|
13667
|
-
const ssrOutputDir =
|
|
13668
|
-
const clientOutputDir =
|
|
14244
|
+
const ssrOutputDir = dirname16(join30(serverDir, relDir, `${baseName}.js`));
|
|
14245
|
+
const clientOutputDir = dirname16(join30(clientDir, relDir, `${baseName}.js`));
|
|
13669
14246
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
13670
14247
|
const rawSpec = importPaths[idx];
|
|
13671
14248
|
if (!rawSpec)
|
|
@@ -13730,11 +14307,11 @@ var resolveDevClientDir2 = () => {
|
|
|
13730
14307
|
code += islandMetadataExports;
|
|
13731
14308
|
return { code, map: compiledJs.map };
|
|
13732
14309
|
};
|
|
13733
|
-
const ssrPath =
|
|
13734
|
-
const clientPath =
|
|
14310
|
+
const ssrPath = join30(serverDir, relDir, `${baseName}.js`);
|
|
14311
|
+
const clientPath = join30(clientDir, relDir, `${baseName}.js`);
|
|
13735
14312
|
await Promise.all([
|
|
13736
|
-
|
|
13737
|
-
|
|
14313
|
+
mkdir6(dirname16(ssrPath), { recursive: true }),
|
|
14314
|
+
mkdir6(dirname16(clientPath), { recursive: true })
|
|
13738
14315
|
]);
|
|
13739
14316
|
const inlineMap = (map) => map ? `
|
|
13740
14317
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -13769,10 +14346,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13769
14346
|
const roots = await Promise.all(entryPoints.map(build));
|
|
13770
14347
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
13771
14348
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
13772
|
-
const relClientDir =
|
|
14349
|
+
const relClientDir = dirname16(relative11(clientDir, client));
|
|
13773
14350
|
const name = basename10(client, extname7(client));
|
|
13774
|
-
const indexPath =
|
|
13775
|
-
const importRaw = relative11(
|
|
14351
|
+
const indexPath = join30(indexDir, relClientDir, `${name}.js`);
|
|
14352
|
+
const importRaw = relative11(dirname16(indexPath), client).split(sep2).join("/");
|
|
13776
14353
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
13777
14354
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
13778
14355
|
import "${hmrClientPath3}";
|
|
@@ -13783,8 +14360,9 @@ import { hydrate, mount, unmount } from "svelte";
|
|
|
13783
14360
|
var initialProps = (typeof window !== "undefined" && window.__INITIAL_PROPS__) ? window.__INITIAL_PROPS__ : {};
|
|
13784
14361
|
var isHMR = typeof window !== "undefined" && window.__SVELTE_COMPONENT__ !== undefined;
|
|
13785
14362
|
var isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;
|
|
14363
|
+
var isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";
|
|
13786
14364
|
var hasIslandHtml = false;
|
|
13787
|
-
var shouldHydrate = typeof window === "undefined" ? false : ${hasAwaitSlot ? "false" : "true"};
|
|
14365
|
+
var shouldHydrate = typeof window === "undefined" || isClientRender ? false : ${hasAwaitSlot ? "false" : "true"};
|
|
13788
14366
|
var component;
|
|
13789
14367
|
var target = document.getElementById(${JSON.stringify(SVELTE_PAGE_ROOT_ID)}) || document.body;
|
|
13790
14368
|
|
|
@@ -13815,6 +14393,8 @@ if (isHMR) {
|
|
|
13815
14393
|
}
|
|
13816
14394
|
component = mount(Component, { target, props: mergedProps });
|
|
13817
14395
|
window.__HMR_PRESERVED_STATE__ = undefined;
|
|
14396
|
+
} else if (isClientRender) {
|
|
14397
|
+
component = mount(Component, { target, props: initialProps });
|
|
13818
14398
|
} else if (!shouldHydrate) {
|
|
13819
14399
|
component = undefined;
|
|
13820
14400
|
} else if (isSsrDirty || hasIslandHtml) {
|
|
@@ -13826,6 +14406,13 @@ if (isHMR) {
|
|
|
13826
14406
|
if (typeof window !== "undefined") {
|
|
13827
14407
|
window.__SVELTE_COMPONENT__ = component;
|
|
13828
14408
|
window.__SVELTE_UNMOUNT__ = function() { if (component) { unmount(component); } };
|
|
14409
|
+
window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();
|
|
14410
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = function() {
|
|
14411
|
+
if (component) { unmount(component); }
|
|
14412
|
+
component = undefined;
|
|
14413
|
+
window.__SVELTE_COMPONENT__ = undefined;
|
|
14414
|
+
window.__SVELTE_UNMOUNT__ = undefined;
|
|
14415
|
+
};
|
|
13829
14416
|
window.__SVELTE_REMOUNT__ = function(props) {
|
|
13830
14417
|
if (typeof window.__SVELTE_UNMOUNT__ === "function") {
|
|
13831
14418
|
try { window.__SVELTE_UNMOUNT__(); } catch (err) { /* ignore */ }
|
|
@@ -13851,14 +14438,14 @@ if (typeof window !== "undefined") {
|
|
|
13851
14438
|
setTimeout(releaseStreamingSlots, 0);
|
|
13852
14439
|
}
|
|
13853
14440
|
}`;
|
|
13854
|
-
await
|
|
14441
|
+
await mkdir6(dirname16(indexPath), { recursive: true });
|
|
13855
14442
|
return write2(indexPath, bootstrap);
|
|
13856
14443
|
}));
|
|
13857
14444
|
return {
|
|
13858
14445
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
13859
14446
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
13860
|
-
const rel =
|
|
13861
|
-
return
|
|
14447
|
+
const rel = dirname16(relative11(clientDir, client));
|
|
14448
|
+
return join30(indexDir, rel, basename10(client));
|
|
13862
14449
|
}),
|
|
13863
14450
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
13864
14451
|
};
|
|
@@ -13873,7 +14460,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
13873
14460
|
init_lowerAwaitSlotSyntax();
|
|
13874
14461
|
init_renderToReadableStream();
|
|
13875
14462
|
devClientDir2 = resolveDevClientDir2();
|
|
13876
|
-
hmrClientPath3 =
|
|
14463
|
+
hmrClientPath3 = join30(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
13877
14464
|
persistentCache = new Map;
|
|
13878
14465
|
sourceHashCache = new Map;
|
|
13879
14466
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -13940,7 +14527,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
13940
14527
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
13941
14528
|
buildLineRemap: () => buildLineRemap
|
|
13942
14529
|
});
|
|
13943
|
-
import { readFileSync as
|
|
14530
|
+
import { readFileSync as readFileSync18, writeFileSync as writeFileSync7 } from "fs";
|
|
13944
14531
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
13945
14532
|
let result = 0;
|
|
13946
14533
|
let shift = 0;
|
|
@@ -14231,7 +14818,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14231
14818
|
version: 3
|
|
14232
14819
|
};
|
|
14233
14820
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
14234
|
-
const text =
|
|
14821
|
+
const text = readFileSync18(bundleFilePath, "utf-8");
|
|
14235
14822
|
const outerMap = extractInlineMap(text);
|
|
14236
14823
|
if (!outerMap)
|
|
14237
14824
|
return;
|
|
@@ -14251,7 +14838,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14251
14838
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
14252
14839
|
let outerMap;
|
|
14253
14840
|
try {
|
|
14254
|
-
outerMap = JSON.parse(
|
|
14841
|
+
outerMap = JSON.parse(readFileSync18(mapFilePath, "utf-8"));
|
|
14255
14842
|
} catch {
|
|
14256
14843
|
return;
|
|
14257
14844
|
}
|
|
@@ -14350,27 +14937,27 @@ __export(exports_compileVue, {
|
|
|
14350
14937
|
compileVue: () => compileVue,
|
|
14351
14938
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14352
14939
|
});
|
|
14353
|
-
import { existsSync as existsSync22, readFileSync as
|
|
14354
|
-
import { mkdir as
|
|
14940
|
+
import { existsSync as existsSync22, readFileSync as readFileSync19, realpathSync as realpathSync2 } from "fs";
|
|
14941
|
+
import { mkdir as mkdir7 } from "fs/promises";
|
|
14355
14942
|
import {
|
|
14356
14943
|
basename as basename11,
|
|
14357
|
-
dirname as
|
|
14944
|
+
dirname as dirname17,
|
|
14358
14945
|
isAbsolute as isAbsolute4,
|
|
14359
|
-
join as
|
|
14946
|
+
join as join31,
|
|
14360
14947
|
relative as relative12,
|
|
14361
|
-
resolve as
|
|
14948
|
+
resolve as resolve22
|
|
14362
14949
|
} from "path";
|
|
14363
14950
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14364
14951
|
var resolveDevClientDir3 = () => {
|
|
14365
14952
|
const projectRoot = process.cwd();
|
|
14366
|
-
const fromSource =
|
|
14953
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
14367
14954
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14368
14955
|
return fromSource;
|
|
14369
14956
|
}
|
|
14370
|
-
const fromNodeModules =
|
|
14957
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14371
14958
|
if (existsSync22(fromNodeModules))
|
|
14372
14959
|
return fromNodeModules;
|
|
14373
|
-
return
|
|
14960
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
14374
14961
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14375
14962
|
scriptCache.clear();
|
|
14376
14963
|
scriptSetupCache.clear();
|
|
@@ -14420,19 +15007,19 @@ var resolveDevClientDir3 = () => {
|
|
|
14420
15007
|
visited.add(resolved);
|
|
14421
15008
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14422
15009
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14423
|
-
const importedPath =
|
|
15010
|
+
const importedPath = resolve22(dirname17(cssFilePath), relPath);
|
|
14424
15011
|
if (!existsSync22(importedPath))
|
|
14425
15012
|
return match;
|
|
14426
|
-
const importedContent =
|
|
15013
|
+
const importedContent = readFileSync19(importedPath, "utf-8");
|
|
14427
15014
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
14428
15015
|
});
|
|
14429
15016
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14430
15017
|
if (helper.endsWith(".ts"))
|
|
14431
|
-
return
|
|
14432
|
-
const direct =
|
|
15018
|
+
return resolve22(sourceDir, helper);
|
|
15019
|
+
const direct = resolve22(sourceDir, `${helper}.ts`);
|
|
14433
15020
|
if (existsSync22(direct))
|
|
14434
15021
|
return direct;
|
|
14435
|
-
const indexed =
|
|
15022
|
+
const indexed = resolve22(sourceDir, helper, "index.ts");
|
|
14436
15023
|
if (existsSync22(indexed))
|
|
14437
15024
|
return indexed;
|
|
14438
15025
|
return direct;
|
|
@@ -14443,15 +15030,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14443
15030
|
return filePath.replace(/\.ts$/, ".js");
|
|
14444
15031
|
if (isStylePath(filePath)) {
|
|
14445
15032
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14446
|
-
return
|
|
15033
|
+
return resolve22(sourceDir, filePath);
|
|
14447
15034
|
}
|
|
14448
15035
|
return filePath;
|
|
14449
15036
|
}
|
|
14450
15037
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14451
|
-
const directTs =
|
|
15038
|
+
const directTs = resolve22(sourceDir, `${filePath}.ts`);
|
|
14452
15039
|
if (existsSync22(directTs))
|
|
14453
15040
|
return `${filePath}.js`;
|
|
14454
|
-
const indexedTs =
|
|
15041
|
+
const indexedTs = resolve22(sourceDir, filePath, "index.ts");
|
|
14455
15042
|
if (existsSync22(indexedTs))
|
|
14456
15043
|
return `${filePath}/index.js`;
|
|
14457
15044
|
}
|
|
@@ -14542,19 +15129,19 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14542
15129
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14543
15130
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14544
15131
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14545
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
15132
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve22(dirname17(sourceFilePath), path));
|
|
14546
15133
|
for (const stylePath of stylePathsImported) {
|
|
14547
15134
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14548
15135
|
}
|
|
14549
15136
|
const childBuildResults = await Promise.all([
|
|
14550
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
15137
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14551
15138
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14552
15139
|
]);
|
|
14553
15140
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
14554
15141
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
14555
15142
|
fs: {
|
|
14556
15143
|
fileExists: existsSync22,
|
|
14557
|
-
readFile: (file3) => existsSync22(file3) ?
|
|
15144
|
+
readFile: (file3) => existsSync22(file3) ? readFileSync19(file3, "utf-8") : undefined,
|
|
14558
15145
|
realpath: realpathSync2
|
|
14559
15146
|
},
|
|
14560
15147
|
id: componentId,
|
|
@@ -14562,7 +15149,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14562
15149
|
sourceMap: true
|
|
14563
15150
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14564
15151
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14565
|
-
const sourceDir =
|
|
15152
|
+
const sourceDir = dirname17(sourceFilePath);
|
|
14566
15153
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14567
15154
|
const packageImportRewrites = new Map;
|
|
14568
15155
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -14607,8 +15194,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14607
15194
|
];
|
|
14608
15195
|
let cssOutputPaths = [];
|
|
14609
15196
|
if (isEntryPoint && allCss.length) {
|
|
14610
|
-
const cssOutputFile =
|
|
14611
|
-
await
|
|
15197
|
+
const cssOutputFile = join31(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15198
|
+
await mkdir7(dirname17(cssOutputFile), { recursive: true });
|
|
14612
15199
|
await write3(cssOutputFile, allCss.join(`
|
|
14613
15200
|
`));
|
|
14614
15201
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -14638,21 +15225,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14638
15225
|
};
|
|
14639
15226
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
14640
15227
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
14641
|
-
const clientOutputPath =
|
|
14642
|
-
const serverOutputPath =
|
|
15228
|
+
const clientOutputPath = join31(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15229
|
+
const serverOutputPath = join31(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
14643
15230
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
14644
15231
|
let result2 = code;
|
|
14645
15232
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
14646
15233
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
14647
|
-
let rel = relative12(
|
|
15234
|
+
let rel = relative12(dirname17(outputPath), targetPath).replace(/\\/g, "/");
|
|
14648
15235
|
if (!rel.startsWith("."))
|
|
14649
15236
|
rel = `./${rel}`;
|
|
14650
15237
|
result2 = result2.replaceAll(bareImport, rel);
|
|
14651
15238
|
}
|
|
14652
15239
|
return result2;
|
|
14653
15240
|
};
|
|
14654
|
-
await
|
|
14655
|
-
await
|
|
15241
|
+
await mkdir7(dirname17(clientOutputPath), { recursive: true });
|
|
15242
|
+
await mkdir7(dirname17(serverOutputPath), { recursive: true });
|
|
14656
15243
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
14657
15244
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
14658
15245
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -14675,7 +15262,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14675
15262
|
serverPath: serverOutputPath,
|
|
14676
15263
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
14677
15264
|
tsHelperPaths: [
|
|
14678
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
15265
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname17(sourceFilePath), helper)),
|
|
14679
15266
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
14680
15267
|
]
|
|
14681
15268
|
};
|
|
@@ -14685,20 +15272,20 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14685
15272
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
14686
15273
|
const compiler = await loadVueCompiler();
|
|
14687
15274
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
14688
|
-
const clientOutputDir =
|
|
14689
|
-
const indexOutputDir =
|
|
14690
|
-
const serverOutputDir =
|
|
14691
|
-
const cssOutputDir =
|
|
15275
|
+
const clientOutputDir = join31(generatedDir, "client");
|
|
15276
|
+
const indexOutputDir = join31(generatedDir, "indexes");
|
|
15277
|
+
const serverOutputDir = join31(generatedDir, "server");
|
|
15278
|
+
const cssOutputDir = join31(generatedDir, "compiled");
|
|
14692
15279
|
await Promise.all([
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
15280
|
+
mkdir7(clientOutputDir, { recursive: true }),
|
|
15281
|
+
mkdir7(indexOutputDir, { recursive: true }),
|
|
15282
|
+
mkdir7(serverOutputDir, { recursive: true }),
|
|
15283
|
+
mkdir7(cssOutputDir, { recursive: true })
|
|
14697
15284
|
]);
|
|
14698
15285
|
const buildCache = new Map;
|
|
14699
15286
|
const allTsHelperPaths = new Set;
|
|
14700
15287
|
const expandSpaRouteChildren = async (entries) => {
|
|
14701
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15288
|
+
const expanded = new Set(entries.map((entry) => resolve22(entry)));
|
|
14702
15289
|
const queue2 = [...expanded];
|
|
14703
15290
|
while (queue2.length > 0) {
|
|
14704
15291
|
const entryPath = queue2.pop();
|
|
@@ -14715,7 +15302,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14715
15302
|
});
|
|
14716
15303
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
14717
15304
|
for (const { importPath } of routes) {
|
|
14718
|
-
const childPath =
|
|
15305
|
+
const childPath = resolve22(dirname17(entryPath), importPath);
|
|
14719
15306
|
if (expanded.has(childPath) || !existsSync22(childPath)) {
|
|
14720
15307
|
continue;
|
|
14721
15308
|
}
|
|
@@ -14727,7 +15314,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14727
15314
|
};
|
|
14728
15315
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
14729
15316
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
14730
|
-
const resolvedEntryPath =
|
|
15317
|
+
const resolvedEntryPath = resolve22(entryPath);
|
|
14731
15318
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
14732
15319
|
client: clientOutputDir,
|
|
14733
15320
|
css: cssOutputDir,
|
|
@@ -14745,16 +15332,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14745
15332
|
};
|
|
14746
15333
|
}
|
|
14747
15334
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
14748
|
-
const indexOutputFile =
|
|
14749
|
-
const clientOutputFile =
|
|
14750
|
-
await
|
|
15335
|
+
const indexOutputFile = join31(indexOutputDir, `${entryBaseName}.js`);
|
|
15336
|
+
const clientOutputFile = join31(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15337
|
+
await mkdir7(dirname17(indexOutputFile), { recursive: true });
|
|
14751
15338
|
const vueHmrImports = isDev2 ? [
|
|
14752
15339
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
14753
15340
|
`import "${hmrClientPath4}";`
|
|
14754
15341
|
] : [];
|
|
14755
15342
|
await write3(indexOutputFile, [
|
|
14756
15343
|
...vueHmrImports,
|
|
14757
|
-
`import Comp, * as PageModule from "${relative12(
|
|
15344
|
+
`import Comp, * as PageModule from "${relative12(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
14758
15345
|
'import { createSSRApp, createApp } from "vue";',
|
|
14759
15346
|
"",
|
|
14760
15347
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -14801,7 +15388,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14801
15388
|
"// client-side navigation after mount.",
|
|
14802
15389
|
'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
|
|
14803
15390
|
'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
|
|
14804
|
-
'const
|
|
15391
|
+
'const isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";',
|
|
15392
|
+
'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty || hasSpaRoutes || isClientRender);',
|
|
14805
15393
|
"const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
|
|
14806
15394
|
"",
|
|
14807
15395
|
"async function bootstrapApp() {",
|
|
@@ -14819,11 +15407,17 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14819
15407
|
" }",
|
|
14820
15408
|
' app.mount("#root");',
|
|
14821
15409
|
"}",
|
|
14822
|
-
"bootstrapApp();",
|
|
15410
|
+
"const absolutePageReady = bootstrapApp();",
|
|
14823
15411
|
"",
|
|
14824
15412
|
"// Store app instance for HMR - used for manual component updates",
|
|
14825
15413
|
'if (typeof window !== "undefined") {',
|
|
14826
15414
|
" window.__VUE_APP__ = app;",
|
|
15415
|
+
" window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;",
|
|
15416
|
+
" window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {",
|
|
15417
|
+
" await absolutePageReady;",
|
|
15418
|
+
" app.unmount();",
|
|
15419
|
+
" window.__VUE_APP__ = undefined;",
|
|
15420
|
+
" };",
|
|
14827
15421
|
"}",
|
|
14828
15422
|
"",
|
|
14829
15423
|
"// Post-mount: Apply preserved state to reactive refs in component tree",
|
|
@@ -14909,7 +15503,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14909
15503
|
if (!tsPath)
|
|
14910
15504
|
continue;
|
|
14911
15505
|
const sourceCode = await file2(tsPath).text();
|
|
14912
|
-
const helperDir =
|
|
15506
|
+
const helperDir = dirname17(tsPath);
|
|
14913
15507
|
for (const dep of extractImports(sourceCode)) {
|
|
14914
15508
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
14915
15509
|
continue;
|
|
@@ -14928,10 +15522,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14928
15522
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
14929
15523
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
14930
15524
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
14931
|
-
const outClientPath =
|
|
14932
|
-
const outServerPath =
|
|
14933
|
-
await
|
|
14934
|
-
await
|
|
15525
|
+
const outClientPath = join31(clientOutputDir, relativeJsPath);
|
|
15526
|
+
const outServerPath = join31(serverOutputDir, relativeJsPath);
|
|
15527
|
+
await mkdir7(dirname17(outClientPath), { recursive: true });
|
|
15528
|
+
await mkdir7(dirname17(outServerPath), { recursive: true });
|
|
14935
15529
|
await write3(outClientPath, withMap);
|
|
14936
15530
|
await write3(outServerPath, withMap);
|
|
14937
15531
|
}));
|
|
@@ -14961,7 +15555,7 @@ var init_compileVue = __esm(() => {
|
|
|
14961
15555
|
init_vueAutoRouterTransform();
|
|
14962
15556
|
init_stylePreprocessor();
|
|
14963
15557
|
devClientDir3 = resolveDevClientDir3();
|
|
14964
|
-
hmrClientPath4 =
|
|
15558
|
+
hmrClientPath4 = join31(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
14965
15559
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
14966
15560
|
scriptCache = new Map;
|
|
14967
15561
|
scriptSetupCache = new Map;
|
|
@@ -15442,8 +16036,8 @@ __export(exports_compileAngular, {
|
|
|
15442
16036
|
compileAngularFile: () => compileAngularFile,
|
|
15443
16037
|
compileAngular: () => compileAngular
|
|
15444
16038
|
});
|
|
15445
|
-
import { existsSync as existsSync23, readFileSync as
|
|
15446
|
-
import { join as
|
|
16039
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20, promises as fs5 } from "fs";
|
|
16040
|
+
import { join as join32, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve23, relative as relative13 } from "path";
|
|
15447
16041
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15448
16042
|
import ts13 from "typescript";
|
|
15449
16043
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -15451,10 +16045,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15451
16045
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
15452
16046
|
}, readTsconfigPathAliases = () => {
|
|
15453
16047
|
try {
|
|
15454
|
-
const configPath2 =
|
|
16048
|
+
const configPath2 = resolve23(process.cwd(), "tsconfig.json");
|
|
15455
16049
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15456
16050
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15457
|
-
const baseUrl =
|
|
16051
|
+
const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15458
16052
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15459
16053
|
return { aliases, baseUrl };
|
|
15460
16054
|
} catch {
|
|
@@ -15474,7 +16068,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15474
16068
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15475
16069
|
for (const replacement of alias.replacements) {
|
|
15476
16070
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15477
|
-
const resolved = resolveSourceFile(
|
|
16071
|
+
const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
|
|
15478
16072
|
if (resolved)
|
|
15479
16073
|
return resolved;
|
|
15480
16074
|
}
|
|
@@ -15486,20 +16080,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15486
16080
|
`${candidate}.tsx`,
|
|
15487
16081
|
`${candidate}.js`,
|
|
15488
16082
|
`${candidate}.jsx`,
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
16083
|
+
join32(candidate, "index.ts"),
|
|
16084
|
+
join32(candidate, "index.tsx"),
|
|
16085
|
+
join32(candidate, "index.js"),
|
|
16086
|
+
join32(candidate, "index.jsx")
|
|
15493
16087
|
];
|
|
15494
16088
|
return candidates.find((file3) => existsSync23(file3));
|
|
15495
16089
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15496
|
-
const baseDir =
|
|
16090
|
+
const baseDir = resolve23(rootDir);
|
|
15497
16091
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15498
16092
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15499
16093
|
const scanCache = new Map;
|
|
15500
16094
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15501
16095
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15502
|
-
return resolveSourceFile(
|
|
16096
|
+
return resolveSourceFile(resolve23(fromDir, specifier));
|
|
15503
16097
|
}
|
|
15504
16098
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15505
16099
|
if (aliased)
|
|
@@ -15508,7 +16102,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15508
16102
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15509
16103
|
if (resolved.includes("/node_modules/"))
|
|
15510
16104
|
return;
|
|
15511
|
-
const absolute =
|
|
16105
|
+
const absolute = resolve23(resolved);
|
|
15512
16106
|
if (!absolute.startsWith(baseDir))
|
|
15513
16107
|
return;
|
|
15514
16108
|
return resolveSourceFile(absolute);
|
|
@@ -15524,7 +16118,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15524
16118
|
usesLegacyAnimations: false
|
|
15525
16119
|
});
|
|
15526
16120
|
}
|
|
15527
|
-
const resolved =
|
|
16121
|
+
const resolved = resolve23(actualPath);
|
|
15528
16122
|
const cached = scanCache.get(resolved);
|
|
15529
16123
|
if (cached)
|
|
15530
16124
|
return cached;
|
|
@@ -15553,7 +16147,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15553
16147
|
const actualPath = resolveSourceFile(filePath);
|
|
15554
16148
|
if (!actualPath)
|
|
15555
16149
|
return false;
|
|
15556
|
-
const resolved =
|
|
16150
|
+
const resolved = resolve23(actualPath);
|
|
15557
16151
|
if (visited.has(resolved))
|
|
15558
16152
|
return false;
|
|
15559
16153
|
visited.add(resolved);
|
|
@@ -15561,7 +16155,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15561
16155
|
if (scan.usesLegacyAnimations)
|
|
15562
16156
|
return true;
|
|
15563
16157
|
for (const specifier of scan.imports) {
|
|
15564
|
-
const importedPath = resolveLocalImport(specifier,
|
|
16158
|
+
const importedPath = resolveLocalImport(specifier, dirname18(resolved));
|
|
15565
16159
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15566
16160
|
return true;
|
|
15567
16161
|
}
|
|
@@ -15571,14 +16165,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15571
16165
|
return (entryPath) => visit(entryPath);
|
|
15572
16166
|
}, resolveDevClientDir4 = () => {
|
|
15573
16167
|
const projectRoot = process.cwd();
|
|
15574
|
-
const fromSource =
|
|
16168
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
15575
16169
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15576
16170
|
return fromSource;
|
|
15577
16171
|
}
|
|
15578
|
-
const fromNodeModules =
|
|
16172
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15579
16173
|
if (existsSync23(fromNodeModules))
|
|
15580
16174
|
return fromNodeModules;
|
|
15581
|
-
return
|
|
16175
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
15582
16176
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15583
16177
|
try {
|
|
15584
16178
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -15620,12 +16214,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15620
16214
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
15621
16215
|
if (hasJsLikeExtension(path))
|
|
15622
16216
|
return `${path}${query}`;
|
|
15623
|
-
const importerDir =
|
|
15624
|
-
const fileCandidate =
|
|
16217
|
+
const importerDir = dirname18(importerOutputPath);
|
|
16218
|
+
const fileCandidate = resolve23(importerDir, `${path}.js`);
|
|
15625
16219
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
15626
16220
|
return `${path}.js${query}`;
|
|
15627
16221
|
}
|
|
15628
|
-
const indexCandidate =
|
|
16222
|
+
const indexCandidate = resolve23(importerDir, path, "index.js");
|
|
15629
16223
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
15630
16224
|
return `${path}/index.js${query}`;
|
|
15631
16225
|
}
|
|
@@ -15653,18 +16247,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15653
16247
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
15654
16248
|
if (!isRelativeModuleSpecifier(specifier))
|
|
15655
16249
|
return null;
|
|
15656
|
-
const basePath =
|
|
16250
|
+
const basePath = resolve23(dirname18(fromFile), specifier);
|
|
15657
16251
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
15658
16252
|
`${basePath}.ts`,
|
|
15659
16253
|
`${basePath}.tsx`,
|
|
15660
16254
|
`${basePath}.mts`,
|
|
15661
16255
|
`${basePath}.cts`,
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
16256
|
+
join32(basePath, "index.ts"),
|
|
16257
|
+
join32(basePath, "index.tsx"),
|
|
16258
|
+
join32(basePath, "index.mts"),
|
|
16259
|
+
join32(basePath, "index.cts")
|
|
15666
16260
|
];
|
|
15667
|
-
return candidates.map((candidate) =>
|
|
16261
|
+
return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
15668
16262
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
15669
16263
|
const hostSource = readFile6?.(fileName);
|
|
15670
16264
|
if (typeof hostSource === "string")
|
|
@@ -15688,18 +16282,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15688
16282
|
const paths = [];
|
|
15689
16283
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15690
16284
|
if (templateUrlMatch?.[1])
|
|
15691
|
-
paths.push(
|
|
16285
|
+
paths.push(join32(fileDir, templateUrlMatch[1]));
|
|
15692
16286
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15693
16287
|
if (styleUrlMatch?.[1])
|
|
15694
|
-
paths.push(
|
|
16288
|
+
paths.push(join32(fileDir, styleUrlMatch[1]));
|
|
15695
16289
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
15696
16290
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
15697
16291
|
if (urlMatches) {
|
|
15698
16292
|
for (const urlMatch of urlMatches) {
|
|
15699
|
-
paths.push(
|
|
16293
|
+
paths.push(join32(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
15700
16294
|
}
|
|
15701
16295
|
}
|
|
15702
|
-
return paths.map((path) =>
|
|
16296
|
+
return paths.map((path) => resolve23(path));
|
|
15703
16297
|
}, readResourceCacheFile = async (cachePath) => {
|
|
15704
16298
|
try {
|
|
15705
16299
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -15711,13 +16305,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15711
16305
|
return null;
|
|
15712
16306
|
}
|
|
15713
16307
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
15714
|
-
await fs5.mkdir(
|
|
16308
|
+
await fs5.mkdir(dirname18(cachePath), { recursive: true });
|
|
15715
16309
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
15716
16310
|
source,
|
|
15717
16311
|
version: 1
|
|
15718
16312
|
}), "utf-8");
|
|
15719
16313
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
15720
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
16314
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname18(filePath));
|
|
15721
16315
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
15722
16316
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
15723
16317
|
return `${resourcePath}\x00${content}`;
|
|
@@ -15730,7 +16324,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15730
16324
|
safeStableStringify(stylePreprocessors ?? null)
|
|
15731
16325
|
].join("\x00");
|
|
15732
16326
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
15733
|
-
return
|
|
16327
|
+
return join32(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
15734
16328
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
15735
16329
|
const transformedSources = new Map;
|
|
15736
16330
|
const visited = new Set;
|
|
@@ -15741,7 +16335,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15741
16335
|
transformedFiles: 0
|
|
15742
16336
|
};
|
|
15743
16337
|
const transformFile = async (filePath) => {
|
|
15744
|
-
const resolvedPath =
|
|
16338
|
+
const resolvedPath = resolve23(filePath);
|
|
15745
16339
|
if (visited.has(resolvedPath))
|
|
15746
16340
|
return;
|
|
15747
16341
|
visited.add(resolvedPath);
|
|
@@ -15757,7 +16351,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15757
16351
|
transformedSource = cached.source;
|
|
15758
16352
|
} else {
|
|
15759
16353
|
stats.cacheMisses += 1;
|
|
15760
|
-
const transformed = await inlineResources(source,
|
|
16354
|
+
const transformed = await inlineResources(source, dirname18(resolvedPath), stylePreprocessors);
|
|
15761
16355
|
transformedSource = transformed.source;
|
|
15762
16356
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
15763
16357
|
}
|
|
@@ -15776,18 +16370,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15776
16370
|
return { stats, transformedSources };
|
|
15777
16371
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
15778
16372
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
15779
|
-
const outputPath =
|
|
16373
|
+
const outputPath = resolve23(join32(outDir, relative13(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
15780
16374
|
return [
|
|
15781
16375
|
outputPath,
|
|
15782
|
-
buildIslandMetadataExports(
|
|
16376
|
+
buildIslandMetadataExports(readFileSync20(inputPath, "utf-8"))
|
|
15783
16377
|
];
|
|
15784
16378
|
})), { entries: inputPaths.length });
|
|
15785
16379
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
15786
16380
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
15787
16381
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
15788
16382
|
const tsPath = __require.resolve("typescript");
|
|
15789
|
-
const tsRootDir =
|
|
15790
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16383
|
+
const tsRootDir = dirname18(tsPath);
|
|
16384
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
|
|
15791
16385
|
});
|
|
15792
16386
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
15793
16387
|
const options = {
|
|
@@ -15812,30 +16406,30 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15812
16406
|
options.incremental = false;
|
|
15813
16407
|
options.tsBuildInfoFile = undefined;
|
|
15814
16408
|
options.rootDir = process.cwd();
|
|
15815
|
-
const
|
|
15816
|
-
const originalGetDefaultLibLocation =
|
|
15817
|
-
|
|
15818
|
-
const originalGetDefaultLibFileName =
|
|
15819
|
-
|
|
16409
|
+
const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
|
|
16410
|
+
const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
|
|
16411
|
+
host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
16412
|
+
const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
|
|
16413
|
+
host2.getDefaultLibFileName = (opts) => {
|
|
15820
16414
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
15821
16415
|
return basename12(fileName);
|
|
15822
16416
|
};
|
|
15823
|
-
const originalGetSourceFile =
|
|
15824
|
-
|
|
16417
|
+
const originalGetSourceFile = host2.getSourceFile;
|
|
16418
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
15825
16419
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
15826
|
-
const resolvedPath =
|
|
15827
|
-
return originalGetSourceFile?.call(
|
|
16420
|
+
const resolvedPath = join32(tsLibDir, fileName);
|
|
16421
|
+
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
15828
16422
|
}
|
|
15829
|
-
return originalGetSourceFile?.call(
|
|
16423
|
+
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
15830
16424
|
};
|
|
15831
16425
|
const emitted = {};
|
|
15832
|
-
const resolvedOutDir =
|
|
15833
|
-
|
|
16426
|
+
const resolvedOutDir = resolve23(outDir);
|
|
16427
|
+
host2.writeFile = (fileName, text) => {
|
|
15834
16428
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
15835
16429
|
emitted[relativePath] = text;
|
|
15836
16430
|
};
|
|
15837
|
-
const originalReadFile =
|
|
15838
|
-
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(
|
|
16431
|
+
const originalReadFile = host2.readFile;
|
|
16432
|
+
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
|
|
15839
16433
|
await traceAngularPhase("aot/resource-cache-summary", () => {
|
|
15840
16434
|
return;
|
|
15841
16435
|
}, {
|
|
@@ -15844,43 +16438,43 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15844
16438
|
filesVisited: aotResourceTransformStats.filesVisited,
|
|
15845
16439
|
transformedFiles: aotResourceTransformStats.transformedFiles
|
|
15846
16440
|
});
|
|
15847
|
-
|
|
15848
|
-
const source = originalReadFile ? originalReadFile.call(
|
|
16441
|
+
host2.readFile = (fileName) => {
|
|
16442
|
+
const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
|
|
15849
16443
|
if (typeof source !== "string")
|
|
15850
16444
|
return source;
|
|
15851
16445
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
15852
16446
|
return source;
|
|
15853
16447
|
}
|
|
15854
|
-
const resolvedPath =
|
|
16448
|
+
const resolvedPath = resolve23(fileName);
|
|
15855
16449
|
return transformedSources.get(resolvedPath) ?? source;
|
|
15856
16450
|
};
|
|
15857
|
-
const originalGetSourceFileForCompile =
|
|
15858
|
-
|
|
15859
|
-
const source = transformedSources.get(
|
|
16451
|
+
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16452
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16453
|
+
const source = transformedSources.get(resolve23(fileName));
|
|
15860
16454
|
if (source) {
|
|
15861
16455
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
15862
16456
|
}
|
|
15863
|
-
return originalGetSourceFileForCompile?.call(
|
|
16457
|
+
return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
|
|
15864
16458
|
};
|
|
15865
16459
|
let diagnostics;
|
|
15866
16460
|
try {
|
|
15867
16461
|
({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
|
|
15868
16462
|
emitFlags: EmitFlags.Default,
|
|
15869
|
-
host,
|
|
16463
|
+
host: host2,
|
|
15870
16464
|
options,
|
|
15871
16465
|
rootNames: inputPaths
|
|
15872
16466
|
}), { entries: inputPaths.length }));
|
|
15873
16467
|
} finally {
|
|
15874
|
-
|
|
15875
|
-
|
|
16468
|
+
host2.readFile = originalReadFile;
|
|
16469
|
+
host2.getSourceFile = originalGetSourceFileForCompile;
|
|
15876
16470
|
}
|
|
15877
16471
|
await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
|
|
15878
16472
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
15879
16473
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
15880
16474
|
content,
|
|
15881
|
-
target:
|
|
16475
|
+
target: join32(outDir, fileName)
|
|
15882
16476
|
}));
|
|
15883
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16477
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
|
|
15884
16478
|
return rawEntries.map(({ content, target }) => {
|
|
15885
16479
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
15886
16480
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -15895,17 +16489,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15895
16489
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
15896
16490
|
});
|
|
15897
16491
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
15898
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16492
|
+
processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
|
|
15899
16493
|
return { content: processedContent, target };
|
|
15900
16494
|
});
|
|
15901
16495
|
});
|
|
15902
16496
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
15903
|
-
await fs5.mkdir(
|
|
16497
|
+
await fs5.mkdir(dirname18(target), { recursive: true });
|
|
15904
16498
|
await fs5.writeFile(target, content, "utf-8");
|
|
15905
16499
|
})), { outputs: entries.length });
|
|
15906
16500
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
15907
16501
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
15908
|
-
jitContentCache.delete(
|
|
16502
|
+
jitContentCache.delete(resolve23(filePath));
|
|
15909
16503
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
15910
16504
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
15911
16505
|
let match;
|
|
@@ -15918,7 +16512,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15918
16512
|
}
|
|
15919
16513
|
return null;
|
|
15920
16514
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
15921
|
-
const sourceEntry =
|
|
16515
|
+
const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
|
|
15922
16516
|
if (existsSync23(sourceEntry)) {
|
|
15923
16517
|
return sourceEntry.replace(/\\/g, "/");
|
|
15924
16518
|
}
|
|
@@ -16055,7 +16649,7 @@ ${fields}
|
|
|
16055
16649
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16056
16650
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16057
16651
|
if (templateUrlMatch?.[1]) {
|
|
16058
|
-
const templatePath =
|
|
16652
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16059
16653
|
if (!existsSync23(templatePath)) {
|
|
16060
16654
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16061
16655
|
}
|
|
@@ -16086,11 +16680,11 @@ ${fields}
|
|
|
16086
16680
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16087
16681
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16088
16682
|
if (templateUrlMatch?.[1]) {
|
|
16089
|
-
const templatePath =
|
|
16683
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16090
16684
|
if (!existsSync23(templatePath)) {
|
|
16091
16685
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16092
16686
|
}
|
|
16093
|
-
const templateRaw2 =
|
|
16687
|
+
const templateRaw2 = readFileSync20(templatePath, "utf-8");
|
|
16094
16688
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
16095
16689
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
16096
16690
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -16123,7 +16717,7 @@ ${fields}
|
|
|
16123
16717
|
return source;
|
|
16124
16718
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16125
16719
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16126
|
-
return readAndEscapeFile(
|
|
16720
|
+
return readAndEscapeFile(join32(fileDir, styleUrl), stylePreprocessors);
|
|
16127
16721
|
});
|
|
16128
16722
|
const results = await Promise.all(stylePromises);
|
|
16129
16723
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16134,7 +16728,7 @@ ${fields}
|
|
|
16134
16728
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16135
16729
|
if (!styleUrlMatch?.[1])
|
|
16136
16730
|
return source;
|
|
16137
|
-
const escaped = await readAndEscapeFile(
|
|
16731
|
+
const escaped = await readAndEscapeFile(join32(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16138
16732
|
if (!escaped)
|
|
16139
16733
|
return source;
|
|
16140
16734
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16208,10 +16802,10 @@ ${fields}
|
|
|
16208
16802
|
return "";
|
|
16209
16803
|
}
|
|
16210
16804
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16211
|
-
const entryPath =
|
|
16805
|
+
const entryPath = resolve23(inputPath);
|
|
16212
16806
|
const allOutputs = [];
|
|
16213
16807
|
const visited = new Set;
|
|
16214
|
-
const baseDir =
|
|
16808
|
+
const baseDir = resolve23(rootDir ?? process.cwd());
|
|
16215
16809
|
let usesLegacyAnimations = false;
|
|
16216
16810
|
const angularTranspiler = new Bun.Transpiler({
|
|
16217
16811
|
loader: "ts",
|
|
@@ -16230,16 +16824,16 @@ ${fields}
|
|
|
16230
16824
|
`${candidate}.js`,
|
|
16231
16825
|
`${candidate}.jsx`,
|
|
16232
16826
|
`${candidate}.json`,
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16827
|
+
join32(candidate, "index.ts"),
|
|
16828
|
+
join32(candidate, "index.tsx"),
|
|
16829
|
+
join32(candidate, "index.js"),
|
|
16830
|
+
join32(candidate, "index.jsx")
|
|
16237
16831
|
];
|
|
16238
16832
|
return candidates.find((file3) => existsSync23(file3));
|
|
16239
16833
|
};
|
|
16240
16834
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16241
16835
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16242
|
-
return resolveSourceFile2(
|
|
16836
|
+
return resolveSourceFile2(resolve23(fromDir, specifier));
|
|
16243
16837
|
}
|
|
16244
16838
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16245
16839
|
if (aliased)
|
|
@@ -16248,7 +16842,7 @@ ${fields}
|
|
|
16248
16842
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16249
16843
|
if (resolved.includes("/node_modules/"))
|
|
16250
16844
|
return;
|
|
16251
|
-
const absolute =
|
|
16845
|
+
const absolute = resolve23(resolved);
|
|
16252
16846
|
if (!absolute.startsWith(baseDir))
|
|
16253
16847
|
return;
|
|
16254
16848
|
return resolveSourceFile2(absolute);
|
|
@@ -16257,13 +16851,13 @@ ${fields}
|
|
|
16257
16851
|
}
|
|
16258
16852
|
};
|
|
16259
16853
|
const toOutputPath = (sourcePath) => {
|
|
16260
|
-
const inputDir =
|
|
16854
|
+
const inputDir = dirname18(sourcePath);
|
|
16261
16855
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16262
16856
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16263
|
-
return
|
|
16857
|
+
return join32(inputDir, fileBase);
|
|
16264
16858
|
}
|
|
16265
16859
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16266
|
-
return
|
|
16860
|
+
return join32(outDir, relativeDir, fileBase);
|
|
16267
16861
|
};
|
|
16268
16862
|
const withCacheBuster = (specifier) => {
|
|
16269
16863
|
if (!cacheBuster)
|
|
@@ -16300,21 +16894,21 @@ ${fields}
|
|
|
16300
16894
|
return `${prefix}${dots}`;
|
|
16301
16895
|
return `${prefix}../${dots}`;
|
|
16302
16896
|
});
|
|
16303
|
-
if (
|
|
16897
|
+
if (resolve23(actualPath) === entryPath) {
|
|
16304
16898
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16305
16899
|
}
|
|
16306
16900
|
return processedContent;
|
|
16307
16901
|
};
|
|
16308
16902
|
const transpileFile = async (filePath) => {
|
|
16309
|
-
const resolved =
|
|
16903
|
+
const resolved = resolve23(filePath);
|
|
16310
16904
|
if (visited.has(resolved))
|
|
16311
16905
|
return;
|
|
16312
16906
|
visited.add(resolved);
|
|
16313
16907
|
if (resolved.endsWith(".json") && existsSync23(resolved)) {
|
|
16314
|
-
const inputDir2 =
|
|
16908
|
+
const inputDir2 = dirname18(resolved);
|
|
16315
16909
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16316
|
-
const targetDir2 =
|
|
16317
|
-
const targetPath2 =
|
|
16910
|
+
const targetDir2 = join32(outDir, relativeDir2);
|
|
16911
|
+
const targetPath2 = join32(targetDir2, basename12(resolved));
|
|
16318
16912
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16319
16913
|
await fs5.copyFile(resolved, targetPath2);
|
|
16320
16914
|
allOutputs.push(targetPath2);
|
|
@@ -16326,12 +16920,12 @@ ${fields}
|
|
|
16326
16920
|
if (!existsSync23(actualPath))
|
|
16327
16921
|
return;
|
|
16328
16922
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16329
|
-
const inlined = await inlineResources(sourceCode,
|
|
16330
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16331
|
-
const inputDir =
|
|
16923
|
+
const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
|
|
16924
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname18(actualPath)).source;
|
|
16925
|
+
const inputDir = dirname18(actualPath);
|
|
16332
16926
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16333
16927
|
const targetPath = toOutputPath(actualPath);
|
|
16334
|
-
const targetDir =
|
|
16928
|
+
const targetDir = dirname18(targetPath);
|
|
16335
16929
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16336
16930
|
const localImports = [];
|
|
16337
16931
|
const importRewrites = new Map;
|
|
@@ -16358,7 +16952,7 @@ ${fields}
|
|
|
16358
16952
|
importRewrites.set(specifier, relativeRewrite);
|
|
16359
16953
|
return resolved2;
|
|
16360
16954
|
}).filter((path) => Boolean(path));
|
|
16361
|
-
const isEntry =
|
|
16955
|
+
const isEntry = resolve23(actualPath) === resolve23(entryPath);
|
|
16362
16956
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16363
16957
|
const cacheKey2 = actualPath;
|
|
16364
16958
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -16393,13 +16987,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16393
16987
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16394
16988
|
}
|
|
16395
16989
|
const compiledRoot = compiledParent;
|
|
16396
|
-
const indexesDir =
|
|
16990
|
+
const indexesDir = join32(compiledParent, "indexes");
|
|
16397
16991
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16398
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
16992
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16399
16993
|
if (!hmr) {
|
|
16400
16994
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16401
16995
|
const cwd = process.cwd();
|
|
16402
|
-
const angularSrcDir =
|
|
16996
|
+
const angularSrcDir = resolve23(outRoot);
|
|
16403
16997
|
if (!existsSync23(angularSrcDir))
|
|
16404
16998
|
return;
|
|
16405
16999
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16407,17 +17001,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16407
17001
|
absolute: false,
|
|
16408
17002
|
cwd: angularSrcDir
|
|
16409
17003
|
})) {
|
|
16410
|
-
const sourcePath =
|
|
17004
|
+
const sourcePath = join32(angularSrcDir, rel);
|
|
16411
17005
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16412
|
-
const targetPath =
|
|
16413
|
-
await fs5.mkdir(
|
|
17006
|
+
const targetPath = join32(compiledRoot, cwdRel);
|
|
17007
|
+
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
16414
17008
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16415
17009
|
}
|
|
16416
17010
|
});
|
|
16417
17011
|
}
|
|
16418
17012
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16419
17013
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16420
|
-
const resolvedEntry =
|
|
17014
|
+
const resolvedEntry = resolve23(entry);
|
|
16421
17015
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16422
17016
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16423
17017
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16426,13 +17020,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16426
17020
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16427
17021
|
const jsName = `${fileBase}.js`;
|
|
16428
17022
|
const compiledFallbackPaths = [
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
].map((file3) =>
|
|
17023
|
+
join32(compiledRoot, relativeEntry),
|
|
17024
|
+
join32(compiledRoot, "pages", jsName),
|
|
17025
|
+
join32(compiledRoot, jsName)
|
|
17026
|
+
].map((file3) => resolve23(file3));
|
|
16433
17027
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16434
17028
|
const normalizedCandidates = [
|
|
16435
|
-
...candidatePaths.map((file3) =>
|
|
17029
|
+
...candidatePaths.map((file3) => resolve23(file3)),
|
|
16436
17030
|
...compiledFallbackPaths
|
|
16437
17031
|
];
|
|
16438
17032
|
let candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16479,7 +17073,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16479
17073
|
let providersSourceContent = "";
|
|
16480
17074
|
if (providersInjection.appProvidersSource) {
|
|
16481
17075
|
try {
|
|
16482
|
-
providersSourceContent =
|
|
17076
|
+
providersSourceContent = readFileSync20(providersInjection.appProvidersSource, "utf-8");
|
|
16483
17077
|
} catch {}
|
|
16484
17078
|
}
|
|
16485
17079
|
return JSON.stringify({
|
|
@@ -16490,7 +17084,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16490
17084
|
})() : "no-providers";
|
|
16491
17085
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16492
17086
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16493
|
-
const clientFile =
|
|
17087
|
+
const clientFile = join32(indexesDir, jsName);
|
|
16494
17088
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
16495
17089
|
return {
|
|
16496
17090
|
clientPath: clientFile,
|
|
@@ -16522,13 +17116,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16522
17116
|
const fragments = [];
|
|
16523
17117
|
if (providersInjection.appProvidersSource) {
|
|
16524
17118
|
const compiledAppProvidersPath = (() => {
|
|
16525
|
-
const angularDirAbs =
|
|
16526
|
-
const appSourceAbs =
|
|
17119
|
+
const angularDirAbs = resolve23(outRoot);
|
|
17120
|
+
const appSourceAbs = resolve23(providersInjection.appProvidersSource);
|
|
16527
17121
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16528
|
-
return
|
|
17122
|
+
return join32(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16529
17123
|
})();
|
|
16530
17124
|
const appProvidersSpec = (() => {
|
|
16531
|
-
const rel = relative13(
|
|
17125
|
+
const rel = relative13(dirname18(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16532
17126
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16533
17127
|
})();
|
|
16534
17128
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -16576,6 +17170,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
16576
17170
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
16577
17171
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
16578
17172
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
17173
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
16579
17174
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
16580
17175
|
// Page-level providers are injected directly into the page module's
|
|
16581
17176
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -16626,13 +17221,14 @@ if (!document.querySelector(_sel)) {
|
|
|
16626
17221
|
}
|
|
16627
17222
|
|
|
16628
17223
|
var providers = [provideZonelessChangeDetection()];
|
|
16629
|
-
if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
17224
|
+
if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
16630
17225
|
providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
16631
17226
|
}
|
|
16632
17227
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
16633
17228
|
providers.push.apply(providers, pageProviders);
|
|
16634
17229
|
providers.push.apply(providers, contextProviders);
|
|
16635
17230
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
17231
|
+
var absolutePageReady = Promise.resolve();
|
|
16636
17232
|
|
|
16637
17233
|
if (pageHasRawStreamingSlots) {
|
|
16638
17234
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -16642,7 +17238,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
16642
17238
|
});
|
|
16643
17239
|
}
|
|
16644
17240
|
} else {
|
|
16645
|
-
bootstrapApplication(${componentClassName}, {
|
|
17241
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
16646
17242
|
providers: providers
|
|
16647
17243
|
}).then(function (appRef) {
|
|
16648
17244
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -16652,8 +17248,17 @@ if (pageHasRawStreamingSlots) {
|
|
|
16652
17248
|
window.__ABS_SLOT_FLUSH__();
|
|
16653
17249
|
});
|
|
16654
17250
|
}
|
|
17251
|
+
return appRef;
|
|
16655
17252
|
});
|
|
16656
17253
|
}
|
|
17254
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
17255
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
17256
|
+
await absolutePageReady;
|
|
17257
|
+
if (window.__ANGULAR_APP__) {
|
|
17258
|
+
window.__ANGULAR_APP__.destroy();
|
|
17259
|
+
window.__ANGULAR_APP__ = null;
|
|
17260
|
+
}
|
|
17261
|
+
};
|
|
16657
17262
|
`.trim() : `
|
|
16658
17263
|
import '@angular/compiler';
|
|
16659
17264
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -16672,6 +17277,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
16672
17277
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
16673
17278
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
16674
17279
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
17280
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
16675
17281
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
16676
17282
|
// Page-level providers are injected directly into the page module's
|
|
16677
17283
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -16691,11 +17297,21 @@ var absoluteHttpTransferCacheOptions = {
|
|
|
16691
17297
|
|
|
16692
17298
|
enableProdMode();
|
|
16693
17299
|
|
|
17300
|
+
// Production mobile/client-only activation starts from AbsoluteJS's empty
|
|
17301
|
+
// #root shell rather than server-rendered Angular markup. Create the page's
|
|
17302
|
+
// actual Angular host from its compiled selector so application authors do
|
|
17303
|
+
// not need framework-specific mobile configuration.
|
|
17304
|
+
var _sel = ${componentClassName}.\u0275cmp?.selectors?.[0]?.[0] || 'ng-app';
|
|
17305
|
+
if (!document.querySelector(_sel)) {
|
|
17306
|
+
(document.getElementById('root') || document.body).appendChild(document.createElement(_sel));
|
|
17307
|
+
}
|
|
17308
|
+
|
|
16694
17309
|
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
16695
|
-
if (!pageHasIslands) {
|
|
17310
|
+
if (!isClientRender && !pageHasIslands) {
|
|
16696
17311
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
16697
17312
|
}
|
|
16698
17313
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
17314
|
+
var absolutePageReady = Promise.resolve();
|
|
16699
17315
|
|
|
16700
17316
|
if (pageHasRawStreamingSlots) {
|
|
16701
17317
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -16705,7 +17321,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
16705
17321
|
});
|
|
16706
17322
|
}
|
|
16707
17323
|
} else {
|
|
16708
|
-
bootstrapApplication(${componentClassName}, {
|
|
17324
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
16709
17325
|
providers: providers
|
|
16710
17326
|
}).then(function (appRef) {
|
|
16711
17327
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -16715,8 +17331,17 @@ if (pageHasRawStreamingSlots) {
|
|
|
16715
17331
|
window.__ABS_SLOT_FLUSH__();
|
|
16716
17332
|
});
|
|
16717
17333
|
}
|
|
17334
|
+
return appRef;
|
|
16718
17335
|
});
|
|
16719
17336
|
}
|
|
17337
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
17338
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
17339
|
+
await absolutePageReady;
|
|
17340
|
+
if (window.__ANGULAR_APP__) {
|
|
17341
|
+
window.__ANGULAR_APP__.destroy();
|
|
17342
|
+
window.__ANGULAR_APP__ = null;
|
|
17343
|
+
}
|
|
17344
|
+
};
|
|
16720
17345
|
`.trim();
|
|
16721
17346
|
const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
|
|
16722
17347
|
const indexUnchanged = cachedWrapper?.indexHash === indexHash;
|
|
@@ -16749,7 +17374,7 @@ var init_compileAngular = __esm(() => {
|
|
|
16749
17374
|
init_stylePreprocessor();
|
|
16750
17375
|
init_generatedDir();
|
|
16751
17376
|
devClientDir4 = resolveDevClientDir4();
|
|
16752
|
-
hmrClientPath5 =
|
|
17377
|
+
hmrClientPath5 = join32(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
16753
17378
|
jitContentCache = new Map;
|
|
16754
17379
|
wrapperOutputCache = new Map;
|
|
16755
17380
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17473,8 +18098,8 @@ __export(exports_fastHmrCompiler, {
|
|
|
17473
18098
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
17474
18099
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17475
18100
|
});
|
|
17476
|
-
import { existsSync as existsSync24, readFileSync as
|
|
17477
|
-
import { dirname as
|
|
18101
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21, statSync as statSync2 } from "fs";
|
|
18102
|
+
import { dirname as dirname19, extname as extname8, relative as relative14, resolve as resolve24 } from "path";
|
|
17478
18103
|
import ts17 from "typescript";
|
|
17479
18104
|
var fail = (reason, detail, location) => ({
|
|
17480
18105
|
detail,
|
|
@@ -17604,7 +18229,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17604
18229
|
continue;
|
|
17605
18230
|
const decoratorMeta = readDecoratorMeta(args);
|
|
17606
18231
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
17607
|
-
const componentDir =
|
|
18232
|
+
const componentDir = dirname19(componentFilePath);
|
|
17608
18233
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17609
18234
|
fingerprintCache.set(id, fingerprint);
|
|
17610
18235
|
} else {
|
|
@@ -17789,7 +18414,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17789
18414
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
17790
18415
|
return true;
|
|
17791
18416
|
}
|
|
17792
|
-
const base =
|
|
18417
|
+
const base = resolve24(componentDir, spec);
|
|
17793
18418
|
const candidates = [
|
|
17794
18419
|
`${base}.ts`,
|
|
17795
18420
|
`${base}.tsx`,
|
|
@@ -17801,7 +18426,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17801
18426
|
continue;
|
|
17802
18427
|
let content;
|
|
17803
18428
|
try {
|
|
17804
|
-
content =
|
|
18429
|
+
content = readFileSync21(candidate, "utf-8");
|
|
17805
18430
|
} catch {
|
|
17806
18431
|
continue;
|
|
17807
18432
|
}
|
|
@@ -18087,7 +18712,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18087
18712
|
listeners: {},
|
|
18088
18713
|
properties: {},
|
|
18089
18714
|
specialAttributes: {}
|
|
18090
|
-
}), parseHostObjectInto = (
|
|
18715
|
+
}), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
|
|
18091
18716
|
const hostNode = getProperty(args, "host");
|
|
18092
18717
|
if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
|
|
18093
18718
|
if (!hostExprNode)
|
|
@@ -18111,14 +18736,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18111
18736
|
const propMatch = ATTR_BINDING_RE.exec(key);
|
|
18112
18737
|
const evtMatch = EVENT_BINDING_RE.exec(key);
|
|
18113
18738
|
if (propMatch) {
|
|
18114
|
-
|
|
18739
|
+
host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18115
18740
|
} else if (evtMatch) {
|
|
18116
|
-
|
|
18741
|
+
host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18117
18742
|
} else {
|
|
18118
|
-
|
|
18743
|
+
host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
|
|
18119
18744
|
}
|
|
18120
18745
|
}
|
|
18121
|
-
}, mergeMemberHostDecorators = (
|
|
18746
|
+
}, mergeMemberHostDecorators = (host2, cls) => {
|
|
18122
18747
|
for (const member of cls.members) {
|
|
18123
18748
|
if (!ts17.canHaveDecorators(member))
|
|
18124
18749
|
continue;
|
|
@@ -18138,7 +18763,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18138
18763
|
const propertyName2 = member.name.text;
|
|
18139
18764
|
const [target] = expr.arguments;
|
|
18140
18765
|
const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
|
|
18141
|
-
|
|
18766
|
+
host2.properties[key] = propertyName2;
|
|
18142
18767
|
} else if (functionNode.text === "HostListener") {
|
|
18143
18768
|
if (!ts17.isMethodDeclaration(member))
|
|
18144
18769
|
continue;
|
|
@@ -18156,7 +18781,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18156
18781
|
argsList.push(element.text);
|
|
18157
18782
|
}
|
|
18158
18783
|
}
|
|
18159
|
-
|
|
18784
|
+
host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
18160
18785
|
}
|
|
18161
18786
|
}
|
|
18162
18787
|
}
|
|
@@ -18347,9 +18972,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18347
18972
|
}
|
|
18348
18973
|
return out.length > 0 ? out : null;
|
|
18349
18974
|
}, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
|
|
18350
|
-
const
|
|
18351
|
-
parseHostObjectInto(
|
|
18352
|
-
mergeMemberHostDecorators(
|
|
18975
|
+
const host2 = emptyHost();
|
|
18976
|
+
parseHostObjectInto(host2, decoratorArgs, null, compiler);
|
|
18977
|
+
mergeMemberHostDecorators(host2, cls);
|
|
18353
18978
|
const decoratorQueries = extractDecoratorQueries(cls, compiler);
|
|
18354
18979
|
const signalQueries = extractSignalQueries(cls, compiler);
|
|
18355
18980
|
const contentQueries = [
|
|
@@ -18370,7 +18995,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18370
18995
|
animations,
|
|
18371
18996
|
contentQueries,
|
|
18372
18997
|
exportAs: extractExportAs(decoratorArgs),
|
|
18373
|
-
host,
|
|
18998
|
+
host: host2,
|
|
18374
18999
|
hostDirectives: extractHostDirectives(decoratorArgs, compiler),
|
|
18375
19000
|
providers,
|
|
18376
19001
|
viewProviders,
|
|
@@ -18389,7 +19014,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18389
19014
|
return cached.info;
|
|
18390
19015
|
let source;
|
|
18391
19016
|
try {
|
|
18392
|
-
source =
|
|
19017
|
+
source = readFileSync21(filePath, "utf-8");
|
|
18393
19018
|
} catch {
|
|
18394
19019
|
childComponentInfoCache.set(cacheKey2, {
|
|
18395
19020
|
info: null,
|
|
@@ -18443,7 +19068,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18443
19068
|
return cached.info;
|
|
18444
19069
|
let content;
|
|
18445
19070
|
try {
|
|
18446
|
-
content =
|
|
19071
|
+
content = readFileSync21(dtsPath, "utf-8");
|
|
18447
19072
|
} catch {
|
|
18448
19073
|
childComponentInfoCache.set(cacheKey2, {
|
|
18449
19074
|
info: null,
|
|
@@ -18566,7 +19191,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18566
19191
|
return null;
|
|
18567
19192
|
let content;
|
|
18568
19193
|
try {
|
|
18569
|
-
content =
|
|
19194
|
+
content = readFileSync21(startDtsPath, "utf-8");
|
|
18570
19195
|
} catch {
|
|
18571
19196
|
return null;
|
|
18572
19197
|
}
|
|
@@ -18585,7 +19210,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18585
19210
|
});
|
|
18586
19211
|
if (!names.includes(className))
|
|
18587
19212
|
continue;
|
|
18588
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19213
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18589
19214
|
if (!nextDts)
|
|
18590
19215
|
continue;
|
|
18591
19216
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18595,7 +19220,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18595
19220
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
18596
19221
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
18597
19222
|
const fromPath = item[1] || "";
|
|
18598
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19223
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18599
19224
|
if (!nextDts)
|
|
18600
19225
|
continue;
|
|
18601
19226
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18605,7 +19230,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18605
19230
|
return null;
|
|
18606
19231
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
18607
19232
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
18608
|
-
const base =
|
|
19233
|
+
const base = resolve24(fromDir, stripped);
|
|
18609
19234
|
const candidates = [
|
|
18610
19235
|
`${base}.d.ts`,
|
|
18611
19236
|
`${base}.d.mts`,
|
|
@@ -18629,7 +19254,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18629
19254
|
return null;
|
|
18630
19255
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
18631
19256
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
18632
|
-
const base =
|
|
19257
|
+
const base = resolve24(componentDir, spec);
|
|
18633
19258
|
const candidates = [
|
|
18634
19259
|
`${base}.ts`,
|
|
18635
19260
|
`${base}.tsx`,
|
|
@@ -18784,7 +19409,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18784
19409
|
return cached.hasProviders;
|
|
18785
19410
|
let source;
|
|
18786
19411
|
try {
|
|
18787
|
-
source =
|
|
19412
|
+
source = readFileSync21(filePath, "utf8");
|
|
18788
19413
|
} catch {
|
|
18789
19414
|
return true;
|
|
18790
19415
|
}
|
|
@@ -18848,13 +19473,13 @@ var fail = (reason, detail, location) => ({
|
|
|
18848
19473
|
}
|
|
18849
19474
|
if (!matches)
|
|
18850
19475
|
continue;
|
|
18851
|
-
const resolved =
|
|
19476
|
+
const resolved = resolve24(componentDir, spec);
|
|
18852
19477
|
for (const ext of TS_EXTENSIONS) {
|
|
18853
19478
|
const candidate = resolved + ext;
|
|
18854
19479
|
if (existsSync24(candidate))
|
|
18855
19480
|
return candidate;
|
|
18856
19481
|
}
|
|
18857
|
-
const indexCandidate =
|
|
19482
|
+
const indexCandidate = resolve24(resolved, "index.ts");
|
|
18858
19483
|
if (existsSync24(indexCandidate))
|
|
18859
19484
|
return indexCandidate;
|
|
18860
19485
|
}
|
|
@@ -19092,12 +19717,12 @@ ${transpiled}
|
|
|
19092
19717
|
}
|
|
19093
19718
|
}${staticPatch}`;
|
|
19094
19719
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19095
|
-
const abs =
|
|
19720
|
+
const abs = resolve24(componentDir, url);
|
|
19096
19721
|
if (!existsSync24(abs))
|
|
19097
19722
|
return null;
|
|
19098
19723
|
const ext = extname8(abs).toLowerCase();
|
|
19099
19724
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19100
|
-
return
|
|
19725
|
+
return readFileSync21(abs, "utf8");
|
|
19101
19726
|
}
|
|
19102
19727
|
try {
|
|
19103
19728
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19131,11 +19756,11 @@ ${block}
|
|
|
19131
19756
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19132
19757
|
if (cached !== undefined)
|
|
19133
19758
|
return cached;
|
|
19134
|
-
const tsconfigPath =
|
|
19759
|
+
const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
|
|
19135
19760
|
const opts = {};
|
|
19136
19761
|
if (existsSync24(tsconfigPath)) {
|
|
19137
19762
|
try {
|
|
19138
|
-
const text =
|
|
19763
|
+
const text = readFileSync21(tsconfigPath, "utf8");
|
|
19139
19764
|
const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19140
19765
|
if (!parsed.error && parsed.config) {
|
|
19141
19766
|
const cfg = parsed.config;
|
|
@@ -19169,7 +19794,7 @@ ${block}
|
|
|
19169
19794
|
} catch (err) {
|
|
19170
19795
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19171
19796
|
}
|
|
19172
|
-
const tsSource =
|
|
19797
|
+
const tsSource = readFileSync21(componentFilePath, "utf8");
|
|
19173
19798
|
const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
19174
19799
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19175
19800
|
if (!classNode) {
|
|
@@ -19196,7 +19821,7 @@ ${block}
|
|
|
19196
19821
|
rebootstrapRequired: false
|
|
19197
19822
|
};
|
|
19198
19823
|
}
|
|
19199
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
19824
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname19(componentFilePath), projectRoot)) {
|
|
19200
19825
|
return fail("inherits-decorated-class");
|
|
19201
19826
|
}
|
|
19202
19827
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19208,18 +19833,18 @@ ${block}
|
|
|
19208
19833
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19209
19834
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19210
19835
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19211
|
-
const componentDir =
|
|
19836
|
+
const componentDir = dirname19(componentFilePath);
|
|
19212
19837
|
let templateText;
|
|
19213
19838
|
let templatePath;
|
|
19214
19839
|
if (decoratorMeta.template !== null) {
|
|
19215
19840
|
templateText = decoratorMeta.template;
|
|
19216
19841
|
templatePath = componentFilePath;
|
|
19217
19842
|
} else if (decoratorMeta.templateUrl) {
|
|
19218
|
-
const tplAbs =
|
|
19843
|
+
const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
|
|
19219
19844
|
if (!existsSync24(tplAbs)) {
|
|
19220
19845
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19221
19846
|
}
|
|
19222
|
-
templateText =
|
|
19847
|
+
templateText = readFileSync21(tplAbs, "utf8");
|
|
19223
19848
|
templatePath = tplAbs;
|
|
19224
19849
|
} else {
|
|
19225
19850
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -19978,7 +20603,7 @@ __export(exports_compileEmber, {
|
|
|
19978
20603
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
19979
20604
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
19980
20605
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
19981
|
-
dirname: () =>
|
|
20606
|
+
dirname: () => dirname20,
|
|
19982
20607
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
19983
20608
|
compileEmberFile: () => compileEmberFile,
|
|
19984
20609
|
compileEmber: () => compileEmber,
|
|
@@ -19986,8 +20611,8 @@ __export(exports_compileEmber, {
|
|
|
19986
20611
|
basename: () => basename13
|
|
19987
20612
|
});
|
|
19988
20613
|
import { existsSync as existsSync25 } from "fs";
|
|
19989
|
-
import { mkdir as
|
|
19990
|
-
import { basename as basename13, dirname as
|
|
20614
|
+
import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
|
|
20615
|
+
import { basename as basename13, dirname as dirname20, extname as extname9, join as join33, resolve as resolve25 } from "path";
|
|
19991
20616
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
19992
20617
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
19993
20618
|
if (cachedPreprocessor)
|
|
@@ -20083,7 +20708,7 @@ export const importSync = (specifier) => {
|
|
|
20083
20708
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20084
20709
|
if (!originalImporter)
|
|
20085
20710
|
return;
|
|
20086
|
-
const candidateBase =
|
|
20711
|
+
const candidateBase = resolve25(dirname20(originalImporter), args.path);
|
|
20087
20712
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20088
20713
|
for (const ext of extensionsToTry) {
|
|
20089
20714
|
const candidate = candidateBase + ext;
|
|
@@ -20106,7 +20731,7 @@ export const importSync = (specifier) => {
|
|
|
20106
20731
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20107
20732
|
if (standalonePackages.has(args.path))
|
|
20108
20733
|
return;
|
|
20109
|
-
const internal =
|
|
20734
|
+
const internal = join33(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20110
20735
|
if (existsSync25(internal))
|
|
20111
20736
|
return { path: internal };
|
|
20112
20737
|
return;
|
|
@@ -20142,7 +20767,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20142
20767
|
export { PageComponent };
|
|
20143
20768
|
export default PageComponent;
|
|
20144
20769
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20145
|
-
const resolvedEntry =
|
|
20770
|
+
const resolvedEntry = resolve25(entry);
|
|
20146
20771
|
const source = await file3(resolvedEntry).text();
|
|
20147
20772
|
let preprocessed = source;
|
|
20148
20773
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20154,16 +20779,16 @@ export default PageComponent;
|
|
|
20154
20779
|
}
|
|
20155
20780
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20156
20781
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20157
|
-
const tmpDir =
|
|
20158
|
-
const serverDir =
|
|
20159
|
-
const clientDir =
|
|
20782
|
+
const tmpDir = join33(compiledRoot, "_tmp");
|
|
20783
|
+
const serverDir = join33(compiledRoot, "server");
|
|
20784
|
+
const clientDir = join33(compiledRoot, "client");
|
|
20160
20785
|
await Promise.all([
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20786
|
+
mkdir8(tmpDir, { recursive: true }),
|
|
20787
|
+
mkdir8(serverDir, { recursive: true }),
|
|
20788
|
+
mkdir8(clientDir, { recursive: true })
|
|
20164
20789
|
]);
|
|
20165
|
-
const tmpPagePath =
|
|
20166
|
-
const tmpHarnessPath =
|
|
20790
|
+
const tmpPagePath = resolve25(join33(tmpDir, `${baseName}.module.js`));
|
|
20791
|
+
const tmpHarnessPath = resolve25(join33(tmpDir, `${baseName}.harness.js`));
|
|
20167
20792
|
await Promise.all([
|
|
20168
20793
|
write4(tmpPagePath, transpiled),
|
|
20169
20794
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20171,7 +20796,7 @@ export default PageComponent;
|
|
|
20171
20796
|
const stagedSourceMap = new Map([
|
|
20172
20797
|
[tmpPagePath, resolvedEntry]
|
|
20173
20798
|
]);
|
|
20174
|
-
const serverPath =
|
|
20799
|
+
const serverPath = join33(serverDir, `${baseName}.js`);
|
|
20175
20800
|
const buildResult = await bunBuild2({
|
|
20176
20801
|
entrypoints: [tmpHarnessPath],
|
|
20177
20802
|
format: "esm",
|
|
@@ -20187,8 +20812,8 @@ export default PageComponent;
|
|
|
20187
20812
|
if (!buildResult.success) {
|
|
20188
20813
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20189
20814
|
}
|
|
20190
|
-
await
|
|
20191
|
-
const clientPath =
|
|
20815
|
+
await rm5(tmpDir, { force: true, recursive: true });
|
|
20816
|
+
const clientPath = join33(clientDir, `${baseName}.js`);
|
|
20192
20817
|
await write4(clientPath, transpiled);
|
|
20193
20818
|
return { clientPath, serverPath };
|
|
20194
20819
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20205,7 +20830,7 @@ export default PageComponent;
|
|
|
20205
20830
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20206
20831
|
};
|
|
20207
20832
|
}, compileEmberFileSource = async (entry) => {
|
|
20208
|
-
const resolvedEntry =
|
|
20833
|
+
const resolvedEntry = resolve25(entry);
|
|
20209
20834
|
const source = await file3(resolvedEntry).text();
|
|
20210
20835
|
let preprocessed = source;
|
|
20211
20836
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20216,7 +20841,7 @@ export default PageComponent;
|
|
|
20216
20841
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20217
20842
|
}
|
|
20218
20843
|
return transpiler5.transformSync(preprocessed);
|
|
20219
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
20844
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "client");
|
|
20220
20845
|
var init_compileEmber = __esm(() => {
|
|
20221
20846
|
init_generatedDir();
|
|
20222
20847
|
transpiler5 = new Transpiler4({
|
|
@@ -20238,24 +20863,24 @@ __export(exports_buildReactVendor, {
|
|
|
20238
20863
|
buildReactVendor: () => buildReactVendor
|
|
20239
20864
|
});
|
|
20240
20865
|
import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
|
|
20241
|
-
import { join as
|
|
20242
|
-
import { rm as
|
|
20866
|
+
import { join as join34, resolve as resolve26 } from "path";
|
|
20867
|
+
import { rm as rm6 } from "fs/promises";
|
|
20243
20868
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20244
20869
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20245
20870
|
const candidates = [
|
|
20246
|
-
|
|
20247
|
-
|
|
20248
|
-
|
|
20249
|
-
|
|
20250
|
-
|
|
20251
|
-
|
|
20871
|
+
resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
20872
|
+
resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20873
|
+
resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
20874
|
+
resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20875
|
+
resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
20876
|
+
resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20252
20877
|
];
|
|
20253
20878
|
for (const candidate of candidates) {
|
|
20254
20879
|
if (existsSync26(candidate)) {
|
|
20255
20880
|
return candidate.replace(/\\/g, "/");
|
|
20256
20881
|
}
|
|
20257
20882
|
}
|
|
20258
|
-
return (candidates[0] ??
|
|
20883
|
+
return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20259
20884
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20260
20885
|
const paths = {};
|
|
20261
20886
|
for (const specifier of reactSpecifiers) {
|
|
@@ -20288,14 +20913,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20288
20913
|
`)}
|
|
20289
20914
|
`;
|
|
20290
20915
|
}, buildReactVendor = async (buildDir) => {
|
|
20291
|
-
const vendorDir =
|
|
20916
|
+
const vendorDir = join34(buildDir, "react", "vendor");
|
|
20292
20917
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20293
|
-
const tmpDir =
|
|
20918
|
+
const tmpDir = join34(buildDir, "_vendor_tmp");
|
|
20294
20919
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20295
20920
|
const specifiers = reactSpecifiers;
|
|
20296
20921
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20297
20922
|
const safeName = toSafeFileName(specifier);
|
|
20298
|
-
const entryPath =
|
|
20923
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
20299
20924
|
const source = await generateEntrySource(specifier);
|
|
20300
20925
|
await Bun.write(entryPath, source);
|
|
20301
20926
|
return entryPath;
|
|
@@ -20310,7 +20935,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20310
20935
|
target: "browser",
|
|
20311
20936
|
throw: false
|
|
20312
20937
|
});
|
|
20313
|
-
await
|
|
20938
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
20314
20939
|
if (!result.success) {
|
|
20315
20940
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
20316
20941
|
}
|
|
@@ -20363,8 +20988,8 @@ __export(exports_buildAngularVendor, {
|
|
|
20363
20988
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20364
20989
|
});
|
|
20365
20990
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20366
|
-
import { join as
|
|
20367
|
-
import { rm as
|
|
20991
|
+
import { join as join35 } from "path";
|
|
20992
|
+
import { rm as rm7 } from "fs/promises";
|
|
20368
20993
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20369
20994
|
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) => {
|
|
20370
20995
|
try {
|
|
@@ -20400,7 +21025,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20400
21025
|
}
|
|
20401
21026
|
return { angular, transitiveRoots };
|
|
20402
21027
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
20403
|
-
const { readFileSync:
|
|
21028
|
+
const { readFileSync: readFileSync22 } = await import("fs");
|
|
20404
21029
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
20405
21030
|
const visited = new Set;
|
|
20406
21031
|
const frontier = [];
|
|
@@ -20421,7 +21046,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20421
21046
|
}
|
|
20422
21047
|
let content;
|
|
20423
21048
|
try {
|
|
20424
|
-
content =
|
|
21049
|
+
content = readFileSync22(resolved, "utf-8");
|
|
20425
21050
|
} catch {
|
|
20426
21051
|
continue;
|
|
20427
21052
|
}
|
|
@@ -20460,14 +21085,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20460
21085
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20461
21086
|
return Array.from(angular).filter(isResolvable);
|
|
20462
21087
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20463
|
-
const vendorDir =
|
|
21088
|
+
const vendorDir = join35(buildDir, "angular", "vendor");
|
|
20464
21089
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20465
|
-
const tmpDir =
|
|
21090
|
+
const tmpDir = join35(buildDir, "_angular_vendor_tmp");
|
|
20466
21091
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20467
21092
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20468
21093
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20469
21094
|
const safeName = toSafeFileName2(specifier);
|
|
20470
|
-
const entryPath =
|
|
21095
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20471
21096
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20472
21097
|
return entryPath;
|
|
20473
21098
|
}));
|
|
@@ -20483,7 +21108,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20483
21108
|
target: "browser",
|
|
20484
21109
|
throw: false
|
|
20485
21110
|
});
|
|
20486
|
-
await
|
|
21111
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
20487
21112
|
if (!result.success) {
|
|
20488
21113
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
20489
21114
|
}
|
|
@@ -20498,9 +21123,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20498
21123
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20499
21124
|
return computeAngularVendorPaths(specifiers);
|
|
20500
21125
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20501
|
-
const vendorDir =
|
|
21126
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20502
21127
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20503
|
-
const tmpDir =
|
|
21128
|
+
const tmpDir = join35(buildDir, "_angular_server_vendor_tmp");
|
|
20504
21129
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20505
21130
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20506
21131
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20511,7 +21136,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20511
21136
|
const specifiers = Array.from(allSpecs);
|
|
20512
21137
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20513
21138
|
const safeName = toSafeFileName2(specifier);
|
|
20514
|
-
const entryPath =
|
|
21139
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20515
21140
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20516
21141
|
return entryPath;
|
|
20517
21142
|
}));
|
|
@@ -20526,16 +21151,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20526
21151
|
target: "bun",
|
|
20527
21152
|
throw: false
|
|
20528
21153
|
});
|
|
20529
|
-
await
|
|
21154
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
20530
21155
|
if (!result.success) {
|
|
20531
21156
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
20532
21157
|
}
|
|
20533
21158
|
return specifiers;
|
|
20534
21159
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20535
21160
|
const paths = {};
|
|
20536
|
-
const vendorDir =
|
|
21161
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20537
21162
|
for (const specifier of specifiers) {
|
|
20538
|
-
paths[specifier] =
|
|
21163
|
+
paths[specifier] = join35(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20539
21164
|
}
|
|
20540
21165
|
return paths;
|
|
20541
21166
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -20591,17 +21216,17 @@ __export(exports_buildVueVendor, {
|
|
|
20591
21216
|
buildVueVendor: () => buildVueVendor
|
|
20592
21217
|
});
|
|
20593
21218
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
20594
|
-
import { join as
|
|
20595
|
-
import { rm as
|
|
21219
|
+
import { join as join36 } from "path";
|
|
21220
|
+
import { rm as rm8 } from "fs/promises";
|
|
20596
21221
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
20597
21222
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
20598
|
-
const vendorDir =
|
|
21223
|
+
const vendorDir = join36(buildDir, "vue", "vendor");
|
|
20599
21224
|
mkdirSync10(vendorDir, { recursive: true });
|
|
20600
|
-
const tmpDir =
|
|
21225
|
+
const tmpDir = join36(buildDir, "_vue_vendor_tmp");
|
|
20601
21226
|
mkdirSync10(tmpDir, { recursive: true });
|
|
20602
21227
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
20603
21228
|
const safeName = toSafeFileName3(specifier);
|
|
20604
|
-
const entryPath =
|
|
21229
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
20605
21230
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20606
21231
|
`);
|
|
20607
21232
|
return entryPath;
|
|
@@ -20621,16 +21246,16 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20621
21246
|
target: "browser",
|
|
20622
21247
|
throw: false
|
|
20623
21248
|
});
|
|
20624
|
-
await
|
|
21249
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
20625
21250
|
if (!result.success) {
|
|
20626
21251
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
20627
21252
|
return;
|
|
20628
21253
|
}
|
|
20629
|
-
const { readFileSync:
|
|
21254
|
+
const { readFileSync: readFileSync22, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
|
|
20630
21255
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
20631
21256
|
for (const file4 of files) {
|
|
20632
|
-
const filePath =
|
|
20633
|
-
const content =
|
|
21257
|
+
const filePath = join36(vendorDir, file4);
|
|
21258
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
20634
21259
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
20635
21260
|
continue;
|
|
20636
21261
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -20656,8 +21281,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
20656
21281
|
buildSvelteVendor: () => buildSvelteVendor
|
|
20657
21282
|
});
|
|
20658
21283
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
20659
|
-
import { join as
|
|
20660
|
-
import { rm as
|
|
21284
|
+
import { join as join37 } from "path";
|
|
21285
|
+
import { rm as rm9 } from "fs/promises";
|
|
20661
21286
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
20662
21287
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
20663
21288
|
try {
|
|
@@ -20670,13 +21295,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20670
21295
|
const specifiers = resolveVendorSpecifiers();
|
|
20671
21296
|
if (specifiers.length === 0)
|
|
20672
21297
|
return;
|
|
20673
|
-
const vendorDir =
|
|
21298
|
+
const vendorDir = join37(buildDir, "svelte", "vendor");
|
|
20674
21299
|
mkdirSync11(vendorDir, { recursive: true });
|
|
20675
|
-
const tmpDir =
|
|
21300
|
+
const tmpDir = join37(buildDir, "_svelte_vendor_tmp");
|
|
20676
21301
|
mkdirSync11(tmpDir, { recursive: true });
|
|
20677
21302
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20678
21303
|
const safeName = toSafeFileName4(specifier);
|
|
20679
|
-
const entryPath =
|
|
21304
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
20680
21305
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20681
21306
|
`);
|
|
20682
21307
|
return entryPath;
|
|
@@ -20691,7 +21316,7 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20691
21316
|
target: "browser",
|
|
20692
21317
|
throw: false
|
|
20693
21318
|
});
|
|
20694
|
-
await
|
|
21319
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
20695
21320
|
if (!result.success) {
|
|
20696
21321
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
20697
21322
|
}
|
|
@@ -20721,13 +21346,13 @@ import {
|
|
|
20721
21346
|
existsSync as existsSync27,
|
|
20722
21347
|
mkdirSync as mkdirSync12,
|
|
20723
21348
|
readdirSync as readdirSync5,
|
|
20724
|
-
readFileSync as
|
|
21349
|
+
readFileSync as readFileSync22,
|
|
20725
21350
|
renameSync,
|
|
20726
21351
|
rmSync as rmSync2,
|
|
20727
21352
|
statSync as statSync3,
|
|
20728
21353
|
writeFileSync as writeFileSync8
|
|
20729
21354
|
} from "fs";
|
|
20730
|
-
import { basename as basename14, dirname as
|
|
21355
|
+
import { basename as basename14, dirname as dirname21, extname as extname10, join as join38, relative as relative15, resolve as resolve27 } from "path";
|
|
20731
21356
|
import { cwd, env as env2, exit } from "process";
|
|
20732
21357
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
20733
21358
|
var isBuildTraceEnabled = () => {
|
|
@@ -20810,7 +21435,7 @@ var isBuildTraceEnabled = () => {
|
|
|
20810
21435
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
20811
21436
|
let content;
|
|
20812
21437
|
try {
|
|
20813
|
-
content =
|
|
21438
|
+
content = readFileSync22(path, "utf-8");
|
|
20814
21439
|
} catch {
|
|
20815
21440
|
return [];
|
|
20816
21441
|
}
|
|
@@ -20861,8 +21486,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20861
21486
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
20862
21487
|
const glob = new Glob8("htmx*.min.js");
|
|
20863
21488
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
20864
|
-
const src =
|
|
20865
|
-
const dest =
|
|
21489
|
+
const src = join38(htmxDir, relPath);
|
|
21490
|
+
const dest = join38(htmxDestDir, "htmx.min.js");
|
|
20866
21491
|
copyFileSync2(src, dest);
|
|
20867
21492
|
return;
|
|
20868
21493
|
}
|
|
@@ -20874,8 +21499,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20874
21499
|
}
|
|
20875
21500
|
}, resolveAbsoluteVersion = async () => {
|
|
20876
21501
|
const candidates = [
|
|
20877
|
-
|
|
20878
|
-
|
|
21502
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
21503
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
20879
21504
|
];
|
|
20880
21505
|
const resolveCandidate = async (remaining) => {
|
|
20881
21506
|
const [candidate, ...rest] = remaining;
|
|
@@ -20891,7 +21516,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20891
21516
|
};
|
|
20892
21517
|
await resolveCandidate(candidates);
|
|
20893
21518
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
20894
|
-
const absPath =
|
|
21519
|
+
const absPath = resolve27(file4, "..", relPath);
|
|
20895
21520
|
try {
|
|
20896
21521
|
statSync3(absPath);
|
|
20897
21522
|
workerPaths.add(absPath);
|
|
@@ -20906,7 +21531,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20906
21531
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
20907
21532
|
}
|
|
20908
21533
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
20909
|
-
const content =
|
|
21534
|
+
const content = readFileSync22(file4, "utf-8");
|
|
20910
21535
|
for (const pattern of patterns) {
|
|
20911
21536
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
20912
21537
|
}
|
|
@@ -20939,7 +21564,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20939
21564
|
vuePagesPath
|
|
20940
21565
|
}) => {
|
|
20941
21566
|
const { readdirSync: readDir } = await import("fs");
|
|
20942
|
-
const devIndexDir =
|
|
21567
|
+
const devIndexDir = join38(buildPath, "_src_indexes");
|
|
20943
21568
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
20944
21569
|
if (reactIndexesPath && reactPagesPath) {
|
|
20945
21570
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -20955,37 +21580,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20955
21580
|
return;
|
|
20956
21581
|
}
|
|
20957
21582
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
20958
|
-
const pagesRel = relative15(process.cwd(),
|
|
21583
|
+
const pagesRel = relative15(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
|
|
20959
21584
|
for (const file4 of indexFiles) {
|
|
20960
|
-
let content =
|
|
21585
|
+
let content = readFileSync22(join38(reactIndexesPath, file4), "utf-8");
|
|
20961
21586
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
20962
|
-
writeFileSync8(
|
|
21587
|
+
writeFileSync8(join38(devIndexDir, file4), content);
|
|
20963
21588
|
}
|
|
20964
21589
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
20965
|
-
const svelteIndexDir =
|
|
20966
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
21590
|
+
const svelteIndexDir = join38(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21591
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
|
|
20967
21592
|
for (const entry of sveltePageEntries) {
|
|
20968
21593
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
20969
|
-
const indexFile =
|
|
21594
|
+
const indexFile = join38(svelteIndexDir, "pages", `${name}.js`);
|
|
20970
21595
|
if (!existsSync27(indexFile))
|
|
20971
21596
|
continue;
|
|
20972
|
-
let content =
|
|
20973
|
-
const srcRel = relative15(process.cwd(),
|
|
21597
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21598
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
20974
21599
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
20975
|
-
writeFileSync8(
|
|
21600
|
+
writeFileSync8(join38(devIndexDir, `${name}.svelte.js`), content);
|
|
20976
21601
|
}
|
|
20977
21602
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
20978
|
-
const vueIndexDir =
|
|
20979
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
21603
|
+
const vueIndexDir = join38(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21604
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
|
|
20980
21605
|
for (const entry of vuePageEntries) {
|
|
20981
21606
|
const name = basename14(entry, ".vue");
|
|
20982
|
-
const indexFile =
|
|
21607
|
+
const indexFile = join38(vueIndexDir, `${name}.js`);
|
|
20983
21608
|
if (!existsSync27(indexFile))
|
|
20984
21609
|
continue;
|
|
20985
|
-
let content =
|
|
20986
|
-
const srcRel = relative15(process.cwd(),
|
|
21610
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21611
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
20987
21612
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
20988
|
-
writeFileSync8(
|
|
21613
|
+
writeFileSync8(join38(devIndexDir, `${name}.vue.js`), content);
|
|
20989
21614
|
}
|
|
20990
21615
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
20991
21616
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -20996,7 +21621,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20996
21621
|
const last = allComments[allComments.length - 1];
|
|
20997
21622
|
if (!last?.[1])
|
|
20998
21623
|
return JSON.stringify(outputPath);
|
|
20999
|
-
const srcPath =
|
|
21624
|
+
const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21000
21625
|
return JSON.stringify(srcPath);
|
|
21001
21626
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21002
21627
|
let depth = 0;
|
|
@@ -21033,7 +21658,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21033
21658
|
}
|
|
21034
21659
|
return result;
|
|
21035
21660
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
21036
|
-
let content =
|
|
21661
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21037
21662
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
21038
21663
|
const useNames = [];
|
|
21039
21664
|
let match;
|
|
@@ -21083,7 +21708,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21083
21708
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
21084
21709
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
21085
21710
|
for (const outputPath of outputPaths) {
|
|
21086
|
-
let content =
|
|
21711
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21087
21712
|
let changed = false;
|
|
21088
21713
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
21089
21714
|
const targetName = basename14(relPath);
|
|
@@ -21134,6 +21759,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21134
21759
|
};
|
|
21135
21760
|
const result = {
|
|
21136
21761
|
...merged,
|
|
21762
|
+
banner: [base.banner, sanitized.banner].filter(Boolean).join(`
|
|
21763
|
+
`) || undefined,
|
|
21137
21764
|
define: base.define || sanitized.define ? {
|
|
21138
21765
|
...sanitized.define ?? {},
|
|
21139
21766
|
...base.define ?? {}
|
|
@@ -21155,6 +21782,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21155
21782
|
htmxDirectory,
|
|
21156
21783
|
angularDirectory,
|
|
21157
21784
|
emberDirectory,
|
|
21785
|
+
pwa,
|
|
21158
21786
|
svelteDirectory,
|
|
21159
21787
|
vueDirectory,
|
|
21160
21788
|
stylesConfig,
|
|
@@ -21220,10 +21848,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21220
21848
|
restoreTracePhase();
|
|
21221
21849
|
return;
|
|
21222
21850
|
}
|
|
21223
|
-
const traceDir =
|
|
21851
|
+
const traceDir = join38(buildPath2, ".absolute-trace");
|
|
21224
21852
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21225
21853
|
mkdirSync12(traceDir, { recursive: true });
|
|
21226
|
-
writeFileSync8(
|
|
21854
|
+
writeFileSync8(join38(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21227
21855
|
events: traceEvents,
|
|
21228
21856
|
frameworks: traceFrameworkNames,
|
|
21229
21857
|
generatedAt: new Date().toISOString(),
|
|
@@ -21254,16 +21882,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21254
21882
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21255
21883
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21256
21884
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
21257
|
-
const reactIndexesPath = reactDir &&
|
|
21258
|
-
const reactPagesPath = reactDir &&
|
|
21259
|
-
const htmlPagesPath = htmlDir &&
|
|
21260
|
-
const htmlScriptsPath = htmlDir &&
|
|
21261
|
-
const sveltePagesPath = svelteDir &&
|
|
21262
|
-
const vuePagesPath = vueDir &&
|
|
21263
|
-
const htmxPagesPath = htmxDir &&
|
|
21264
|
-
const htmxScriptsPath = htmxDir &&
|
|
21265
|
-
const angularPagesPath = angularDir &&
|
|
21266
|
-
const emberPagesPath = emberDir &&
|
|
21885
|
+
const reactIndexesPath = reactDir && join38(getFrameworkGeneratedDir("react"), "indexes");
|
|
21886
|
+
const reactPagesPath = reactDir && join38(reactDir, "pages");
|
|
21887
|
+
const htmlPagesPath = htmlDir && join38(htmlDir, "pages");
|
|
21888
|
+
const htmlScriptsPath = htmlDir && join38(htmlDir, "scripts");
|
|
21889
|
+
const sveltePagesPath = svelteDir && join38(svelteDir, "pages");
|
|
21890
|
+
const vuePagesPath = vueDir && join38(vueDir, "pages");
|
|
21891
|
+
const htmxPagesPath = htmxDir && join38(htmxDir, "pages");
|
|
21892
|
+
const htmxScriptsPath = htmxDir && join38(htmxDir, "scripts");
|
|
21893
|
+
const angularPagesPath = angularDir && join38(angularDir, "pages");
|
|
21894
|
+
const emberPagesPath = emberDir && join38(emberDir, "pages");
|
|
21267
21895
|
const frontends = [
|
|
21268
21896
|
reactDir,
|
|
21269
21897
|
htmlDir,
|
|
@@ -21288,13 +21916,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21288
21916
|
framework: frameworkNames[0],
|
|
21289
21917
|
frameworks: frameworkNames,
|
|
21290
21918
|
mode: mode ?? (isDev2 ? "development" : "production"),
|
|
21919
|
+
pwa: Boolean(pwa),
|
|
21920
|
+
pwaSync: Boolean(pwa?.sync),
|
|
21291
21921
|
tailwind: Boolean(tailwind)
|
|
21292
21922
|
});
|
|
21293
21923
|
const generatedRoot = getGeneratedRoot(projectRoot);
|
|
21294
21924
|
const sourceClientRoots = [
|
|
21295
21925
|
htmlDir,
|
|
21296
21926
|
htmxDir,
|
|
21297
|
-
islandBootstrapPath &&
|
|
21927
|
+
islandBootstrapPath && dirname21(islandBootstrapPath)
|
|
21298
21928
|
].filter((dir) => Boolean(dir));
|
|
21299
21929
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21300
21930
|
if (usesGenerated)
|
|
@@ -21322,8 +21952,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21322
21952
|
const [firstEntry] = serverDirMap;
|
|
21323
21953
|
if (!firstEntry)
|
|
21324
21954
|
throw new Error("Expected at least one server directory entry");
|
|
21325
|
-
serverRoot =
|
|
21326
|
-
serverOutDir =
|
|
21955
|
+
serverRoot = join38(firstEntry.dir, firstEntry.subdir);
|
|
21956
|
+
serverOutDir = join38(buildPath, basename14(firstEntry.dir));
|
|
21327
21957
|
} else if (serverDirMap.length > 1) {
|
|
21328
21958
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21329
21959
|
serverOutDir = buildPath;
|
|
@@ -21332,16 +21962,23 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21332
21962
|
await tracePhase("build-dir/create", () => mkdirSync12(buildPath, { recursive: true }));
|
|
21333
21963
|
if (publicPath)
|
|
21334
21964
|
await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
|
|
21965
|
+
const pwaArtifacts = pwa ? await tracePhase("pwa/materialize", () => materializeAbsolutePwa({
|
|
21966
|
+
buildPath,
|
|
21967
|
+
config: pwa,
|
|
21968
|
+
generatedRoot,
|
|
21969
|
+
projectRoot,
|
|
21970
|
+
write: !isIncremental
|
|
21971
|
+
})) : undefined;
|
|
21335
21972
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21336
21973
|
if (!isIncremental || !incrementalFiles)
|
|
21337
21974
|
return entryPoints;
|
|
21338
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
21975
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
|
|
21339
21976
|
const matchingEntries = [];
|
|
21340
21977
|
for (const entry of entryPoints) {
|
|
21341
21978
|
const sourceFile = mapToSource(entry);
|
|
21342
21979
|
if (!sourceFile)
|
|
21343
21980
|
continue;
|
|
21344
|
-
if (!normalizedIncremental.has(
|
|
21981
|
+
if (!normalizedIncremental.has(resolve27(sourceFile)))
|
|
21345
21982
|
continue;
|
|
21346
21983
|
matchingEntries.push(entry);
|
|
21347
21984
|
}
|
|
@@ -21351,7 +21988,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21351
21988
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21352
21989
|
}
|
|
21353
21990
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21354
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
21991
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join38(buildPath, "assets"), {
|
|
21355
21992
|
force: true,
|
|
21356
21993
|
recursive: true
|
|
21357
21994
|
}));
|
|
@@ -21465,11 +22102,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21465
22102
|
}
|
|
21466
22103
|
}
|
|
21467
22104
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21468
|
-
const htmlConventionsOutDir =
|
|
22105
|
+
const htmlConventionsOutDir = join38(buildPath, "conventions", "html");
|
|
21469
22106
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21470
22107
|
const htmlPathRemap = new Map;
|
|
21471
22108
|
for (const sourcePath of htmlConventionSources) {
|
|
21472
|
-
const dest =
|
|
22109
|
+
const dest = join38(htmlConventionsOutDir, basename14(sourcePath));
|
|
21473
22110
|
cpSync(sourcePath, dest, { force: true });
|
|
21474
22111
|
htmlPathRemap.set(sourcePath, dest);
|
|
21475
22112
|
}
|
|
@@ -21510,9 +22147,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21510
22147
|
}
|
|
21511
22148
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21512
22149
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21513
|
-
if (entry.startsWith(
|
|
22150
|
+
if (entry.startsWith(resolve27(reactIndexesPath))) {
|
|
21514
22151
|
const pageName = basename14(entry, ".tsx");
|
|
21515
|
-
return
|
|
22152
|
+
return join38(reactPagesPath, `${pageName}.tsx`);
|
|
21516
22153
|
}
|
|
21517
22154
|
return null;
|
|
21518
22155
|
}) : allReactEntries;
|
|
@@ -21544,7 +22181,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21544
22181
|
for (const entry of vueEntries) {
|
|
21545
22182
|
const name = basename14(entry, ".vue");
|
|
21546
22183
|
if (ssrOnlyPageNames.has(name)) {
|
|
21547
|
-
resolved.add(
|
|
22184
|
+
resolved.add(resolve27(entry));
|
|
21548
22185
|
}
|
|
21549
22186
|
}
|
|
21550
22187
|
return resolved;
|
|
@@ -21681,7 +22318,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21681
22318
|
const clientPath = islandSvelteClientPaths[idx];
|
|
21682
22319
|
if (!sourcePath || !clientPath)
|
|
21683
22320
|
continue;
|
|
21684
|
-
islandSvelteClientPathMap.set(
|
|
22321
|
+
islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21685
22322
|
}
|
|
21686
22323
|
const islandVueClientPathMap = new Map;
|
|
21687
22324
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -21689,7 +22326,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21689
22326
|
const clientPath = islandVueClientPaths[idx];
|
|
21690
22327
|
if (!sourcePath || !clientPath)
|
|
21691
22328
|
continue;
|
|
21692
|
-
islandVueClientPathMap.set(
|
|
22329
|
+
islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21693
22330
|
}
|
|
21694
22331
|
const islandAngularClientPathMap = new Map;
|
|
21695
22332
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -21697,7 +22334,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21697
22334
|
const clientPath = islandAngularClientPaths[idx];
|
|
21698
22335
|
if (!sourcePath || !clientPath)
|
|
21699
22336
|
continue;
|
|
21700
|
-
islandAngularClientPathMap.set(
|
|
22337
|
+
islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21701
22338
|
}
|
|
21702
22339
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
21703
22340
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -21708,7 +22345,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21708
22345
|
const compileReactConventions = async () => {
|
|
21709
22346
|
if (reactConventionSources.length === 0)
|
|
21710
22347
|
return emptyStringArray;
|
|
21711
|
-
const destDir =
|
|
22348
|
+
const destDir = join38(buildPath, "conventions", "react");
|
|
21712
22349
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21713
22350
|
mkdirSync12(destDir, { recursive: true });
|
|
21714
22351
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -21723,7 +22360,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21723
22360
|
stylePreprocessorPlugin2,
|
|
21724
22361
|
createBunStringRawUnicodePlugin()
|
|
21725
22362
|
],
|
|
21726
|
-
root:
|
|
22363
|
+
root: dirname21(source),
|
|
21727
22364
|
target: "bun",
|
|
21728
22365
|
throw: false,
|
|
21729
22366
|
tsconfig: "./tsconfig.json"
|
|
@@ -21751,7 +22388,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21751
22388
|
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 }
|
|
21752
22389
|
]);
|
|
21753
22390
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
21754
|
-
const destDir =
|
|
22391
|
+
const destDir = join38(buildPath, "conventions", framework);
|
|
21755
22392
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21756
22393
|
mkdirSync12(destDir, { recursive: true });
|
|
21757
22394
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -21812,7 +22449,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21812
22449
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
21813
22450
|
];
|
|
21814
22451
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
21815
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22452
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname21(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname21(file4)), projectRoot);
|
|
21816
22453
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
21817
22454
|
buildInfo: islandBuildInfo,
|
|
21818
22455
|
buildPath,
|
|
@@ -21823,7 +22460,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21823
22460
|
}
|
|
21824
22461
|
})) : {
|
|
21825
22462
|
entries: [],
|
|
21826
|
-
generatedRoot:
|
|
22463
|
+
generatedRoot: join38(buildPath, "_island_entries")
|
|
21827
22464
|
};
|
|
21828
22465
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
21829
22466
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -21859,7 +22496,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21859
22496
|
return {};
|
|
21860
22497
|
}
|
|
21861
22498
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
21862
|
-
const refreshEntry =
|
|
22499
|
+
const refreshEntry = join38(reactIndexesPath, "_refresh.tsx");
|
|
21863
22500
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
21864
22501
|
reactClientEntryPoints.push(refreshEntry);
|
|
21865
22502
|
}
|
|
@@ -21948,6 +22585,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21948
22585
|
const svelteResolveConditions = svelteDir ? ["svelte", "main"] : undefined;
|
|
21949
22586
|
const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
|
|
21950
22587
|
const reactBuildConfig = reactClientEntryPoints.length > 0 ? mergeBunBuildConfig({
|
|
22588
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
21951
22589
|
entrypoints: reactClientEntryPoints,
|
|
21952
22590
|
...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
|
|
21953
22591
|
format: "esm",
|
|
@@ -21969,19 +22607,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21969
22607
|
throw: false
|
|
21970
22608
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
21971
22609
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
21972
|
-
rmSync2(
|
|
22610
|
+
rmSync2(join38(buildPath, "react", "generated", "indexes"), {
|
|
21973
22611
|
force: true,
|
|
21974
22612
|
recursive: true
|
|
21975
22613
|
});
|
|
21976
22614
|
}
|
|
21977
22615
|
if (angularDir && angularClientPaths.length > 0) {
|
|
21978
|
-
rmSync2(
|
|
22616
|
+
rmSync2(join38(buildPath, "angular", "indexes"), {
|
|
21979
22617
|
force: true,
|
|
21980
22618
|
recursive: true
|
|
21981
22619
|
});
|
|
21982
22620
|
}
|
|
21983
22621
|
if (islandClientEntryPoints.length > 0) {
|
|
21984
|
-
rmSync2(
|
|
22622
|
+
rmSync2(join38(buildPath, "islands"), {
|
|
21985
22623
|
force: true,
|
|
21986
22624
|
recursive: true
|
|
21987
22625
|
});
|
|
@@ -22018,6 +22656,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22018
22656
|
}, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
|
|
22019
22657
|
reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
|
|
22020
22658
|
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
|
|
22659
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
22021
22660
|
conditions: svelteResolveConditions,
|
|
22022
22661
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
22023
22662
|
entrypoints: nonReactClientEntryPoints,
|
|
@@ -22063,6 +22702,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22063
22702
|
tsconfig: "./tsconfig.json"
|
|
22064
22703
|
}, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
|
|
22065
22704
|
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
|
|
22705
|
+
banner: pwaArtifacts?.bootstrapBanner,
|
|
22066
22706
|
conditions: svelteResolveConditions,
|
|
22067
22707
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
22068
22708
|
entrypoints: islandClientEntryPoints,
|
|
@@ -22093,7 +22733,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22093
22733
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22094
22734
|
entrypoints: globalCssEntries,
|
|
22095
22735
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22096
|
-
outdir: stylesDir ?
|
|
22736
|
+
outdir: stylesDir ? join38(buildPath, basename14(stylesDir)) : buildPath,
|
|
22097
22737
|
plugins: [stylePreprocessorPlugin2],
|
|
22098
22738
|
root: stylesDir || clientRoot,
|
|
22099
22739
|
target: "browser",
|
|
@@ -22102,7 +22742,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22102
22742
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22103
22743
|
entrypoints: vueCssPaths,
|
|
22104
22744
|
naming: `[name].[hash].[ext]`,
|
|
22105
|
-
outdir:
|
|
22745
|
+
outdir: join38(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22106
22746
|
target: "browser",
|
|
22107
22747
|
throw: false
|
|
22108
22748
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22126,18 +22766,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22126
22766
|
}
|
|
22127
22767
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22128
22768
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22129
|
-
const sourcemapDir =
|
|
22769
|
+
const sourcemapDir = join38(projectRoot, "sourcemaps");
|
|
22130
22770
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22131
22771
|
const mapFiles = readdirSync5(buildPath, {
|
|
22132
22772
|
encoding: "utf8",
|
|
22133
22773
|
recursive: true
|
|
22134
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22774
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join38(buildPath, entry));
|
|
22135
22775
|
for (const mapPath of mapFiles) {
|
|
22136
22776
|
chainExternalSourcemap2(mapPath);
|
|
22137
|
-
renameSync(mapPath,
|
|
22777
|
+
renameSync(mapPath, join38(sourcemapDir, basename14(mapPath)));
|
|
22138
22778
|
const jsPath = mapPath.slice(0, -4);
|
|
22139
22779
|
try {
|
|
22140
|
-
const javascript =
|
|
22780
|
+
const javascript = readFileSync22(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
22141
22781
|
`);
|
|
22142
22782
|
writeFileSync8(jsPath, javascript);
|
|
22143
22783
|
} catch {}
|
|
@@ -22208,7 +22848,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22208
22848
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22209
22849
|
}
|
|
22210
22850
|
if (!hmr) {
|
|
22211
|
-
const reactVendorDir =
|
|
22851
|
+
const reactVendorDir = join38(buildPath, "react", "vendor");
|
|
22212
22852
|
const vendorChunkPaths = existsSync27(reactVendorDir) ? [
|
|
22213
22853
|
...new Glob8("**/*.js").scanSync({
|
|
22214
22854
|
absolute: true,
|
|
@@ -22225,7 +22865,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22225
22865
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22226
22866
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22227
22867
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22228
|
-
const fileDir =
|
|
22868
|
+
const fileDir = dirname21(artifact.path);
|
|
22229
22869
|
const relativePaths = {};
|
|
22230
22870
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22231
22871
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22353,7 +22993,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22353
22993
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
22354
22994
|
if (!hmrClientBundle)
|
|
22355
22995
|
return;
|
|
22356
|
-
let html =
|
|
22996
|
+
let html = readFileSync22(filePath, "utf-8");
|
|
22357
22997
|
if (html.includes("data-hmr-client"))
|
|
22358
22998
|
return;
|
|
22359
22999
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -22364,7 +23004,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22364
23004
|
const processHtmlPages = async () => {
|
|
22365
23005
|
if (!(htmlDir && htmlPagesPath))
|
|
22366
23006
|
return;
|
|
22367
|
-
const outputHtmlPages = isSingle ?
|
|
23007
|
+
const outputHtmlPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmlDir), "pages");
|
|
22368
23008
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22369
23009
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22370
23010
|
force: true,
|
|
@@ -22379,6 +23019,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22379
23019
|
for (const htmlFile of htmlPageFiles) {
|
|
22380
23020
|
if (hmr)
|
|
22381
23021
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
23022
|
+
if (pwaArtifacts) {
|
|
23023
|
+
const source = readFileSync22(htmlFile, "utf8");
|
|
23024
|
+
writeFileSync8(htmlFile, injectPwaBootstrapHtml(source));
|
|
23025
|
+
}
|
|
22382
23026
|
const fileName = basename14(htmlFile, ".html");
|
|
22383
23027
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
22384
23028
|
warnManifestKeyCollision(fileName, manifest[fileName], htmlFile);
|
|
@@ -22389,14 +23033,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22389
23033
|
const processHtmxPages = async () => {
|
|
22390
23034
|
if (!(htmxDir && htmxPagesPath))
|
|
22391
23035
|
return;
|
|
22392
|
-
const outputHtmxPages = isSingle ?
|
|
23036
|
+
const outputHtmxPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmxDir), "pages");
|
|
22393
23037
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22394
23038
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22395
23039
|
force: true,
|
|
22396
23040
|
recursive: true
|
|
22397
23041
|
});
|
|
22398
23042
|
if (shouldCopyHtmx) {
|
|
22399
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
23043
|
+
const htmxDestDir = isSingle ? buildPath : join38(buildPath, basename14(htmxDir));
|
|
22400
23044
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22401
23045
|
}
|
|
22402
23046
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22408,6 +23052,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22408
23052
|
for (const htmxFile of htmxPageFiles) {
|
|
22409
23053
|
if (hmr)
|
|
22410
23054
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
23055
|
+
if (pwaArtifacts) {
|
|
23056
|
+
const source = readFileSync22(htmxFile, "utf8");
|
|
23057
|
+
writeFileSync8(htmxFile, injectPwaBootstrapHtml(source));
|
|
23058
|
+
}
|
|
22411
23059
|
const fileName = basename14(htmxFile, ".html");
|
|
22412
23060
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
22413
23061
|
warnManifestKeyCollision(fileName, manifest[fileName], htmxFile);
|
|
@@ -22457,7 +23105,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22457
23105
|
sendTelemetryEvent("build:complete", {
|
|
22458
23106
|
durationMs: Math.round(performance.now() - buildStart),
|
|
22459
23107
|
frameworks: frameworkNames,
|
|
22460
|
-
mode: mode ?? (isDev2 ? "development" : "production")
|
|
23108
|
+
mode: mode ?? (isDev2 ? "development" : "production"),
|
|
23109
|
+
pwa: Boolean(pwa),
|
|
23110
|
+
pwaSync: Boolean(pwa?.sync)
|
|
22461
23111
|
});
|
|
22462
23112
|
const [reactSpaHosts, svelteSpaHosts, vueSpaHosts, angularSpaHosts] = await Promise.all([
|
|
22463
23113
|
reactDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes2(), exports_staticAnalyzeSpaRoutes2)).then((module) => module.analyzeReactSpaRoutes(reactDir)) : [],
|
|
@@ -22466,22 +23116,22 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22466
23116
|
angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
|
|
22467
23117
|
]);
|
|
22468
23118
|
const spaRouteHosts = [
|
|
22469
|
-
...reactSpaHosts.map((
|
|
22470
|
-
...
|
|
23119
|
+
...reactSpaHosts.map((host2) => ({
|
|
23120
|
+
...host2,
|
|
22471
23121
|
framework: "react"
|
|
22472
23122
|
})),
|
|
22473
|
-
...svelteSpaHosts.map((
|
|
22474
|
-
...
|
|
23123
|
+
...svelteSpaHosts.map((host2) => ({
|
|
23124
|
+
...host2,
|
|
22475
23125
|
framework: "svelte"
|
|
22476
23126
|
})),
|
|
22477
|
-
...vueSpaHosts.map((
|
|
22478
|
-
...angularSpaHosts.map((
|
|
22479
|
-
...
|
|
23127
|
+
...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
|
|
23128
|
+
...angularSpaHosts.map((host2) => ({
|
|
23129
|
+
...host2,
|
|
22480
23130
|
framework: "angular"
|
|
22481
23131
|
}))
|
|
22482
23132
|
];
|
|
22483
23133
|
setSpaRouteManifest(spaRouteHosts);
|
|
22484
|
-
writeFileSync8(
|
|
23134
|
+
writeFileSync8(join38(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22485
23135
|
if (isIncremental) {
|
|
22486
23136
|
writeBuildTrace(buildPath);
|
|
22487
23137
|
return {
|
|
@@ -22490,9 +23140,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22490
23140
|
manifest
|
|
22491
23141
|
};
|
|
22492
23142
|
}
|
|
22493
|
-
writeFileSync8(
|
|
23143
|
+
writeFileSync8(join38(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22494
23144
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22495
|
-
writeFileSync8(
|
|
23145
|
+
writeFileSync8(join38(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22496
23146
|
}
|
|
22497
23147
|
writeBuildTrace(buildPath);
|
|
22498
23148
|
if (mode === "production") {
|
|
@@ -22563,6 +23213,7 @@ var init_build = __esm(() => {
|
|
|
22563
23213
|
init_logger();
|
|
22564
23214
|
init_validateSafePath();
|
|
22565
23215
|
init_spaRouteManifest();
|
|
23216
|
+
init_pwa();
|
|
22566
23217
|
REACT_VENDOR_SPECIFIERS = [
|
|
22567
23218
|
"react-dom/client",
|
|
22568
23219
|
"react-refresh/runtime",
|
|
@@ -22625,8 +23276,8 @@ var init_build = __esm(() => {
|
|
|
22625
23276
|
|
|
22626
23277
|
// src/build/buildEmberVendor.ts
|
|
22627
23278
|
import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
|
|
22628
|
-
import { join as
|
|
22629
|
-
import { rm as
|
|
23279
|
+
import { join as join39 } from "path";
|
|
23280
|
+
import { rm as rm10 } from "fs/promises";
|
|
22630
23281
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
22631
23282
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
22632
23283
|
// implementations for macros that would normally be replaced at
|
|
@@ -22677,7 +23328,7 @@ export const importSync = (specifier) => {
|
|
|
22677
23328
|
if (standaloneSpecifiers.has(specifier)) {
|
|
22678
23329
|
return { resolveTo: specifier, specifier };
|
|
22679
23330
|
}
|
|
22680
|
-
const emberInternalPath =
|
|
23331
|
+
const emberInternalPath = join39(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
22681
23332
|
if (!existsSync28(emberInternalPath)) {
|
|
22682
23333
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
22683
23334
|
}
|
|
@@ -22709,7 +23360,7 @@ export const importSync = (specifier) => {
|
|
|
22709
23360
|
if (standalonePackages.has(args.path)) {
|
|
22710
23361
|
return;
|
|
22711
23362
|
}
|
|
22712
|
-
const internal =
|
|
23363
|
+
const internal = join39(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
22713
23364
|
if (existsSync28(internal)) {
|
|
22714
23365
|
return { path: internal };
|
|
22715
23366
|
}
|
|
@@ -22717,16 +23368,16 @@ export const importSync = (specifier) => {
|
|
|
22717
23368
|
});
|
|
22718
23369
|
}
|
|
22719
23370
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
22720
|
-
const vendorDir =
|
|
23371
|
+
const vendorDir = join39(buildDir, "ember", "vendor");
|
|
22721
23372
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22722
|
-
const tmpDir =
|
|
23373
|
+
const tmpDir = join39(buildDir, "_ember_vendor_tmp");
|
|
22723
23374
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22724
|
-
const macrosShimPath =
|
|
23375
|
+
const macrosShimPath = join39(tmpDir, "embroider_macros_shim.js");
|
|
22725
23376
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
22726
23377
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
22727
23378
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
22728
23379
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
22729
|
-
const entryPath =
|
|
23380
|
+
const entryPath = join39(tmpDir, `${safeName}.js`);
|
|
22730
23381
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
22731
23382
|
` : generateVendorEntrySource2(resolution);
|
|
22732
23383
|
await Bun.write(entryPath, source);
|
|
@@ -22743,7 +23394,7 @@ export const importSync = (specifier) => {
|
|
|
22743
23394
|
target: "browser",
|
|
22744
23395
|
throw: false
|
|
22745
23396
|
});
|
|
22746
|
-
await
|
|
23397
|
+
await rm10(tmpDir, { force: true, recursive: true });
|
|
22747
23398
|
if (!result.success) {
|
|
22748
23399
|
console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
|
|
22749
23400
|
}
|
|
@@ -22882,9 +23533,9 @@ __export(exports_dependencyGraph, {
|
|
|
22882
23533
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
22883
23534
|
addFileToGraph: () => addFileToGraph
|
|
22884
23535
|
});
|
|
22885
|
-
import { existsSync as existsSync29, readFileSync as
|
|
23536
|
+
import { existsSync as existsSync29, readFileSync as readFileSync23 } from "fs";
|
|
22886
23537
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
22887
|
-
import { resolve as
|
|
23538
|
+
import { resolve as resolve28 } from "path";
|
|
22888
23539
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
22889
23540
|
const lower = filePath.toLowerCase();
|
|
22890
23541
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -22898,8 +23549,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
22898
23549
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
22899
23550
|
return null;
|
|
22900
23551
|
}
|
|
22901
|
-
const fromDir =
|
|
22902
|
-
const normalized =
|
|
23552
|
+
const fromDir = resolve28(fromFile, "..");
|
|
23553
|
+
const normalized = resolve28(fromDir, importPath);
|
|
22903
23554
|
const extensions = [
|
|
22904
23555
|
".ts",
|
|
22905
23556
|
".tsx",
|
|
@@ -22929,7 +23580,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
22929
23580
|
dependents.delete(normalizedPath);
|
|
22930
23581
|
}
|
|
22931
23582
|
}, addFileToGraph = (graph, filePath) => {
|
|
22932
|
-
const normalizedPath =
|
|
23583
|
+
const normalizedPath = resolve28(filePath);
|
|
22933
23584
|
if (!existsSync29(normalizedPath))
|
|
22934
23585
|
return;
|
|
22935
23586
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -22956,10 +23607,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
22956
23607
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
22957
23608
|
const processedFiles = new Set;
|
|
22958
23609
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
22959
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23610
|
+
const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync29(dir));
|
|
22960
23611
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
22961
23612
|
for (const file4 of allFiles) {
|
|
22962
|
-
const fullPath =
|
|
23613
|
+
const fullPath = resolve28(file4);
|
|
22963
23614
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
22964
23615
|
continue;
|
|
22965
23616
|
if (processedFiles.has(fullPath))
|
|
@@ -23053,15 +23704,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23053
23704
|
const lowerPath = filePath.toLowerCase();
|
|
23054
23705
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
23055
23706
|
if (loader === "html") {
|
|
23056
|
-
const content =
|
|
23707
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23057
23708
|
return extractHtmlDependencies(filePath, content);
|
|
23058
23709
|
}
|
|
23059
23710
|
if (loader === "tsx" || loader === "js") {
|
|
23060
|
-
const content =
|
|
23711
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23061
23712
|
return extractJsDependencies(filePath, content, loader);
|
|
23062
23713
|
}
|
|
23063
23714
|
if (isSvelteOrVue) {
|
|
23064
|
-
const content =
|
|
23715
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23065
23716
|
return extractSvelteVueDependencies(filePath, content);
|
|
23066
23717
|
}
|
|
23067
23718
|
return [];
|
|
@@ -23072,7 +23723,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23072
23723
|
return [];
|
|
23073
23724
|
}
|
|
23074
23725
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23075
|
-
const normalizedPath =
|
|
23726
|
+
const normalizedPath = resolve28(changedFile);
|
|
23076
23727
|
const affected = new Set;
|
|
23077
23728
|
const toProcess = [normalizedPath];
|
|
23078
23729
|
const processNode = (current) => {
|
|
@@ -23103,7 +23754,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23103
23754
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23104
23755
|
graph.dependents.delete(normalizedPath);
|
|
23105
23756
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23106
|
-
const normalizedPath =
|
|
23757
|
+
const normalizedPath = resolve28(filePath);
|
|
23107
23758
|
removeDepsForFile(graph, normalizedPath);
|
|
23108
23759
|
removeDependentsForFile(graph, normalizedPath);
|
|
23109
23760
|
};
|
|
@@ -23146,12 +23797,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23146
23797
|
};
|
|
23147
23798
|
|
|
23148
23799
|
// src/dev/configResolver.ts
|
|
23149
|
-
import { resolve as
|
|
23800
|
+
import { resolve as resolve29 } from "path";
|
|
23150
23801
|
var resolveBuildPaths = (config) => {
|
|
23151
23802
|
const cwd2 = process.cwd();
|
|
23152
23803
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23153
|
-
const withDefault = (value, fallback) => normalize(
|
|
23154
|
-
const optional = (value) => value ? normalize(
|
|
23804
|
+
const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
|
|
23805
|
+
const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
|
|
23155
23806
|
return {
|
|
23156
23807
|
angularDir: optional(config.angularDirectory),
|
|
23157
23808
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23174,6 +23825,7 @@ var init_configResolver = () => {};
|
|
|
23174
23825
|
var createHMRState = (config) => ({
|
|
23175
23826
|
activeFrameworks: new Set,
|
|
23176
23827
|
assetStore: new Map,
|
|
23828
|
+
clientTargets: new Map,
|
|
23177
23829
|
config,
|
|
23178
23830
|
connectedClients: new Set,
|
|
23179
23831
|
debounceTimeout: null,
|
|
@@ -23208,8 +23860,8 @@ var init_clientManager = __esm(() => {
|
|
|
23208
23860
|
});
|
|
23209
23861
|
|
|
23210
23862
|
// src/dev/pathUtils.ts
|
|
23211
|
-
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as
|
|
23212
|
-
import { dirname as
|
|
23863
|
+
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync24 } from "fs";
|
|
23864
|
+
import { dirname as dirname22, resolve as resolve30 } from "path";
|
|
23213
23865
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23214
23866
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23215
23867
|
return "ignored";
|
|
@@ -23285,7 +23937,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23285
23937
|
return "unknown";
|
|
23286
23938
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23287
23939
|
const out = new Set;
|
|
23288
|
-
const angularRoot =
|
|
23940
|
+
const angularRoot = resolve30(angularDir);
|
|
23289
23941
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
23290
23942
|
const walk = (dir) => {
|
|
23291
23943
|
let entries;
|
|
@@ -23298,7 +23950,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23298
23950
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23299
23951
|
continue;
|
|
23300
23952
|
}
|
|
23301
|
-
const full =
|
|
23953
|
+
const full = resolve30(dir, entry.name);
|
|
23302
23954
|
if (entry.isDirectory()) {
|
|
23303
23955
|
walk(full);
|
|
23304
23956
|
continue;
|
|
@@ -23308,7 +23960,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23308
23960
|
}
|
|
23309
23961
|
let source;
|
|
23310
23962
|
try {
|
|
23311
|
-
source =
|
|
23963
|
+
source = readFileSync24(full, "utf8");
|
|
23312
23964
|
} catch {
|
|
23313
23965
|
continue;
|
|
23314
23966
|
}
|
|
@@ -23337,10 +23989,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23337
23989
|
refs.push(strMatch[1]);
|
|
23338
23990
|
}
|
|
23339
23991
|
}
|
|
23340
|
-
const componentDir =
|
|
23992
|
+
const componentDir = dirname22(full);
|
|
23341
23993
|
for (const ref of refs) {
|
|
23342
|
-
const refAbs = normalizePath(
|
|
23343
|
-
const refDir = normalizePath(
|
|
23994
|
+
const refAbs = normalizePath(resolve30(componentDir, ref));
|
|
23995
|
+
const refDir = normalizePath(dirname22(refAbs));
|
|
23344
23996
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23345
23997
|
continue;
|
|
23346
23998
|
}
|
|
@@ -23356,7 +24008,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23356
24008
|
const push = (path) => {
|
|
23357
24009
|
if (!path)
|
|
23358
24010
|
return;
|
|
23359
|
-
const abs = normalizePath(
|
|
24011
|
+
const abs = normalizePath(resolve30(cwd2, path));
|
|
23360
24012
|
if (!roots.includes(abs))
|
|
23361
24013
|
roots.push(abs);
|
|
23362
24014
|
};
|
|
@@ -23381,7 +24033,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23381
24033
|
push(cfg.assetsDir);
|
|
23382
24034
|
push(cfg.stylesDir);
|
|
23383
24035
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23384
|
-
const abs = normalizePath(
|
|
24036
|
+
const abs = normalizePath(resolve30(cwd2, candidate));
|
|
23385
24037
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
23386
24038
|
roots.push(abs);
|
|
23387
24039
|
}
|
|
@@ -23392,7 +24044,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23392
24044
|
continue;
|
|
23393
24045
|
if (entry.name.startsWith("."))
|
|
23394
24046
|
continue;
|
|
23395
|
-
const abs = normalizePath(
|
|
24047
|
+
const abs = normalizePath(resolve30(cwd2, entry.name));
|
|
23396
24048
|
if (roots.includes(abs))
|
|
23397
24049
|
continue;
|
|
23398
24050
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23476,7 +24128,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23476
24128
|
// src/dev/fileWatcher.ts
|
|
23477
24129
|
import { watch } from "fs";
|
|
23478
24130
|
import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23479
|
-
import { dirname as
|
|
24131
|
+
import { dirname as dirname23, join as join40, resolve as resolve31 } from "path";
|
|
23480
24132
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23481
24133
|
try {
|
|
23482
24134
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23508,7 +24160,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23508
24160
|
for (const name of entries) {
|
|
23509
24161
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23510
24162
|
continue;
|
|
23511
|
-
const child =
|
|
24163
|
+
const child = join40(eventDir, name).replace(/\\/g, "/");
|
|
23512
24164
|
let st2;
|
|
23513
24165
|
try {
|
|
23514
24166
|
st2 = statSync4(child);
|
|
@@ -23529,7 +24181,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23529
24181
|
return;
|
|
23530
24182
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23531
24183
|
if (event === "rename") {
|
|
23532
|
-
const eventDir =
|
|
24184
|
+
const eventDir = dirname23(join40(absolutePath, filename)).replace(/\\/g, "/");
|
|
23533
24185
|
atomicRecoveryScan(eventDir);
|
|
23534
24186
|
for (const delay of [25, 100]) {
|
|
23535
24187
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -23538,7 +24190,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23538
24190
|
}
|
|
23539
24191
|
return;
|
|
23540
24192
|
}
|
|
23541
|
-
const fullPath =
|
|
24193
|
+
const fullPath = join40(absolutePath, filename).replace(/\\/g, "/");
|
|
23542
24194
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
23543
24195
|
return;
|
|
23544
24196
|
}
|
|
@@ -23556,7 +24208,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23556
24208
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
23557
24209
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23558
24210
|
paths.forEach((path) => {
|
|
23559
|
-
const absolutePath =
|
|
24211
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23560
24212
|
if (!existsSync31(absolutePath)) {
|
|
23561
24213
|
return;
|
|
23562
24214
|
}
|
|
@@ -23567,7 +24219,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23567
24219
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
23568
24220
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23569
24221
|
watchPaths.forEach((path) => {
|
|
23570
|
-
const absolutePath =
|
|
24222
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23571
24223
|
if (!existsSync31(absolutePath)) {
|
|
23572
24224
|
return;
|
|
23573
24225
|
}
|
|
@@ -23586,13 +24238,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
23586
24238
|
});
|
|
23587
24239
|
|
|
23588
24240
|
// src/dev/assetStore.ts
|
|
23589
|
-
import { resolve as
|
|
24241
|
+
import { resolve as resolve32 } from "path";
|
|
23590
24242
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
23591
24243
|
var mimeTypes, getMimeType = (filePath) => {
|
|
23592
24244
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
23593
24245
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
23594
24246
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
23595
|
-
const fullPath =
|
|
24247
|
+
const fullPath = resolve32(dir, entry.name);
|
|
23596
24248
|
if (entry.isDirectory()) {
|
|
23597
24249
|
return walkAndClean(fullPath);
|
|
23598
24250
|
}
|
|
@@ -23608,10 +24260,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23608
24260
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
23609
24261
|
const liveByIdentity = new Map;
|
|
23610
24262
|
for (const webPath of store.keys()) {
|
|
23611
|
-
const diskPath =
|
|
24263
|
+
const diskPath = resolve32(buildDir, webPath.slice(1));
|
|
23612
24264
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
23613
24265
|
}
|
|
23614
|
-
const absBuildDir =
|
|
24266
|
+
const absBuildDir = resolve32(buildDir);
|
|
23615
24267
|
Object.values(manifest).forEach((val) => {
|
|
23616
24268
|
if (!HASHED_FILE_RE.test(val))
|
|
23617
24269
|
return;
|
|
@@ -23629,7 +24281,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23629
24281
|
} catch {}
|
|
23630
24282
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
23631
24283
|
if (entry.isDirectory()) {
|
|
23632
|
-
return scanDir(
|
|
24284
|
+
return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
|
|
23633
24285
|
}
|
|
23634
24286
|
if (!entry.name.startsWith("chunk-")) {
|
|
23635
24287
|
return null;
|
|
@@ -23638,7 +24290,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23638
24290
|
if (store.has(webPath)) {
|
|
23639
24291
|
return null;
|
|
23640
24292
|
}
|
|
23641
|
-
return Bun.file(
|
|
24293
|
+
return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
|
|
23642
24294
|
store.set(webPath, bytes);
|
|
23643
24295
|
return;
|
|
23644
24296
|
}).catch(() => {});
|
|
@@ -23660,7 +24312,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23660
24312
|
for (const webPath of newIdentities.values()) {
|
|
23661
24313
|
if (store.has(webPath))
|
|
23662
24314
|
continue;
|
|
23663
|
-
loadPromises.push(Bun.file(
|
|
24315
|
+
loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
23664
24316
|
store.set(webPath, bytes);
|
|
23665
24317
|
return;
|
|
23666
24318
|
}).catch(() => {}));
|
|
@@ -23705,8 +24357,8 @@ var init_assetStore = __esm(() => {
|
|
|
23705
24357
|
});
|
|
23706
24358
|
|
|
23707
24359
|
// src/islands/pageMetadata.ts
|
|
23708
|
-
import { readFileSync as
|
|
23709
|
-
import { dirname as
|
|
24360
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
24361
|
+
import { dirname as dirname24, resolve as resolve33 } from "path";
|
|
23710
24362
|
var pagePatterns, getPageDirs = (config) => [
|
|
23711
24363
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
23712
24364
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -23726,15 +24378,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23726
24378
|
const source = definition.buildReference?.source;
|
|
23727
24379
|
if (!source)
|
|
23728
24380
|
continue;
|
|
23729
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
23730
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
24381
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname24(buildInfo.resolvedRegistryPath), source);
|
|
24382
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
|
|
23731
24383
|
}
|
|
23732
24384
|
return lookup;
|
|
23733
24385
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
23734
24386
|
const candidate = usage.source;
|
|
23735
|
-
return candidate ?
|
|
24387
|
+
return candidate ? resolve33(candidate) === target : false;
|
|
23736
24388
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
23737
|
-
const target =
|
|
24389
|
+
const target = resolve33(sourcePath);
|
|
23738
24390
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
23739
24391
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
23740
24392
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -23746,13 +24398,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23746
24398
|
const pattern = pagePatterns[entry.framework];
|
|
23747
24399
|
if (!pattern)
|
|
23748
24400
|
return;
|
|
23749
|
-
const files = await scanEntryPoints(
|
|
24401
|
+
const files = await scanEntryPoints(resolve33(entry.dir), pattern);
|
|
23750
24402
|
for (const filePath of files) {
|
|
23751
|
-
const source =
|
|
24403
|
+
const source = readFileSync25(filePath, "utf-8");
|
|
23752
24404
|
const islands = extractIslandUsagesFromSource(source);
|
|
23753
|
-
pageMetadata.set(
|
|
24405
|
+
pageMetadata.set(resolve33(filePath), {
|
|
23754
24406
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
23755
|
-
pagePath:
|
|
24407
|
+
pagePath: resolve33(filePath)
|
|
23756
24408
|
});
|
|
23757
24409
|
}
|
|
23758
24410
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -23779,10 +24431,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
23779
24431
|
});
|
|
23780
24432
|
|
|
23781
24433
|
// src/dev/fileHashTracker.ts
|
|
23782
|
-
import { readFileSync as
|
|
24434
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
23783
24435
|
var computeFileHash = (filePath) => {
|
|
23784
24436
|
try {
|
|
23785
|
-
const fileContent =
|
|
24437
|
+
const fileContent = readFileSync26(filePath);
|
|
23786
24438
|
return Number(Bun.hash(fileContent));
|
|
23787
24439
|
} catch {
|
|
23788
24440
|
return UNFOUND_INDEX;
|
|
@@ -23818,9 +24470,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
|
|
|
23818
24470
|
set.add(filePath);
|
|
23819
24471
|
}
|
|
23820
24472
|
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
23821
|
-
const
|
|
23822
|
-
if (
|
|
23823
|
-
return
|
|
24473
|
+
const component2 = [...parents].find(isComponentFile);
|
|
24474
|
+
if (component2 !== undefined)
|
|
24475
|
+
return component2;
|
|
23824
24476
|
for (const parent of parents)
|
|
23825
24477
|
queue.push(parent);
|
|
23826
24478
|
return;
|
|
@@ -23875,9 +24527,9 @@ var init_transformCache = __esm(() => {
|
|
|
23875
24527
|
});
|
|
23876
24528
|
|
|
23877
24529
|
// src/dev/reactComponentClassifier.ts
|
|
23878
|
-
import { resolve as
|
|
24530
|
+
import { resolve as resolve34 } from "path";
|
|
23879
24531
|
var classifyComponent = (filePath) => {
|
|
23880
|
-
const normalizedPath =
|
|
24532
|
+
const normalizedPath = resolve34(filePath);
|
|
23881
24533
|
if (normalizedPath.includes("/react/pages/")) {
|
|
23882
24534
|
return "server";
|
|
23883
24535
|
}
|
|
@@ -23889,7 +24541,7 @@ var classifyComponent = (filePath) => {
|
|
|
23889
24541
|
var init_reactComponentClassifier = () => {};
|
|
23890
24542
|
|
|
23891
24543
|
// src/dev/moduleMapper.ts
|
|
23892
|
-
import { basename as basename15, resolve as
|
|
24544
|
+
import { basename as basename15, resolve as resolve35 } from "path";
|
|
23893
24545
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
23894
24546
|
const modulePaths = {};
|
|
23895
24547
|
moduleKeys.forEach((key) => {
|
|
@@ -23899,7 +24551,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
23899
24551
|
});
|
|
23900
24552
|
return modulePaths;
|
|
23901
24553
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
23902
|
-
const normalizedFile =
|
|
24554
|
+
const normalizedFile = resolve35(sourceFile);
|
|
23903
24555
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
23904
24556
|
if (processedFiles.has(normalizedFile)) {
|
|
23905
24557
|
return null;
|
|
@@ -23935,7 +24587,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
23935
24587
|
});
|
|
23936
24588
|
return grouped;
|
|
23937
24589
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
23938
|
-
const normalizedFile =
|
|
24590
|
+
const normalizedFile = resolve35(sourceFile);
|
|
23939
24591
|
const fileName = basename15(normalizedFile);
|
|
23940
24592
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
23941
24593
|
const pascalName = toPascal(baseName);
|
|
@@ -23991,7 +24643,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
23991
24643
|
|
|
23992
24644
|
// src/utils/spaRouteCss.ts
|
|
23993
24645
|
import { readFile as readFile6 } from "fs/promises";
|
|
23994
|
-
import { dirname as
|
|
24646
|
+
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve36 } from "path";
|
|
23995
24647
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
23996
24648
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
23997
24649
|
if (cached !== undefined)
|
|
@@ -24029,7 +24681,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24029
24681
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24030
24682
|
if (!cssPath)
|
|
24031
24683
|
return "";
|
|
24032
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24684
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve36(dirname25(sideManifestPath), cssPath);
|
|
24033
24685
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24034
24686
|
if (cached !== undefined)
|
|
24035
24687
|
return cached;
|
|
@@ -24112,8 +24764,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
24112
24764
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
24113
24765
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24114
24766
|
});
|
|
24115
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
24116
|
-
import { dirname as
|
|
24767
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
|
|
24768
|
+
import { dirname as dirname26, extname as extname11, join as join41, resolve as resolve37 } from "path";
|
|
24117
24769
|
import ts18 from "typescript";
|
|
24118
24770
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24119
24771
|
const out = [];
|
|
@@ -24128,7 +24780,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24128
24780
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24129
24781
|
continue;
|
|
24130
24782
|
}
|
|
24131
|
-
const full =
|
|
24783
|
+
const full = join41(dir, entry.name);
|
|
24132
24784
|
if (entry.isDirectory()) {
|
|
24133
24785
|
visit(full);
|
|
24134
24786
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24172,7 +24824,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24172
24824
|
}, parseDecoratedClasses = (filePath) => {
|
|
24173
24825
|
let source;
|
|
24174
24826
|
try {
|
|
24175
|
-
source =
|
|
24827
|
+
source = readFileSync27(filePath, "utf8");
|
|
24176
24828
|
} catch {
|
|
24177
24829
|
return [];
|
|
24178
24830
|
}
|
|
@@ -24226,7 +24878,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24226
24878
|
};
|
|
24227
24879
|
visit(sourceFile);
|
|
24228
24880
|
return out;
|
|
24229
|
-
}, safeNormalize = (path) =>
|
|
24881
|
+
}, safeNormalize = (path) => resolve37(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24230
24882
|
const { changedFilePath, userAngularRoot } = params;
|
|
24231
24883
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24232
24884
|
const out = [];
|
|
@@ -24262,12 +24914,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24262
24914
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
24263
24915
|
let source;
|
|
24264
24916
|
try {
|
|
24265
|
-
source =
|
|
24917
|
+
source = readFileSync27(childFilePath, "utf8");
|
|
24266
24918
|
} catch {
|
|
24267
24919
|
return null;
|
|
24268
24920
|
}
|
|
24269
24921
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24270
|
-
const childDir =
|
|
24922
|
+
const childDir = dirname26(childFilePath);
|
|
24271
24923
|
for (const stmt of sourceFile.statements) {
|
|
24272
24924
|
if (!ts18.isImportDeclaration(stmt))
|
|
24273
24925
|
continue;
|
|
@@ -24295,7 +24947,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24295
24947
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24296
24948
|
return null;
|
|
24297
24949
|
}
|
|
24298
|
-
const base =
|
|
24950
|
+
const base = resolve37(childDir, spec);
|
|
24299
24951
|
const candidates = [
|
|
24300
24952
|
`${base}.ts`,
|
|
24301
24953
|
`${base}.tsx`,
|
|
@@ -24324,7 +24976,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24324
24976
|
const parentFile = new Map;
|
|
24325
24977
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24326
24978
|
const classes = parseDecoratedClasses(tsPath);
|
|
24327
|
-
const componentDir =
|
|
24979
|
+
const componentDir = dirname26(tsPath);
|
|
24328
24980
|
for (const cls of classes) {
|
|
24329
24981
|
const entity = {
|
|
24330
24982
|
className: cls.className,
|
|
@@ -24333,7 +24985,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24333
24985
|
};
|
|
24334
24986
|
if (cls.kind === "component") {
|
|
24335
24987
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24336
|
-
const abs = safeNormalize(
|
|
24988
|
+
const abs = safeNormalize(resolve37(componentDir, url));
|
|
24337
24989
|
const existing = resource.get(abs);
|
|
24338
24990
|
if (existing)
|
|
24339
24991
|
existing.push(entity);
|
|
@@ -24460,6 +25112,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24460
25112
|
});
|
|
24461
25113
|
clientsToRemove.forEach((client) => {
|
|
24462
25114
|
state.connectedClients.delete(client);
|
|
25115
|
+
state.clientTargets.delete(client);
|
|
24463
25116
|
});
|
|
24464
25117
|
}, handleClientConnect = (state, client, manifest) => {
|
|
24465
25118
|
state.connectedClients.add(client);
|
|
@@ -24500,6 +25153,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24500
25153
|
}
|
|
24501
25154
|
}, handleClientDisconnect = (state, client) => {
|
|
24502
25155
|
state.connectedClients.delete(client);
|
|
25156
|
+
state.clientTargets.delete(client);
|
|
24503
25157
|
}, parseJsonSafe = (raw) => JSON.parse(raw), parseMessage = (message) => {
|
|
24504
25158
|
if (typeof message === "string") {
|
|
24505
25159
|
return parseJsonSafe(message);
|
|
@@ -24529,11 +25183,13 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
|
|
|
24529
25183
|
case "request-rebuild":
|
|
24530
25184
|
break;
|
|
24531
25185
|
case "ready":
|
|
25186
|
+
state.clientTargets.set(client, normalizedHmrTarget(data.target));
|
|
24532
25187
|
if (data.framework) {
|
|
24533
25188
|
state.activeFrameworks.add(data.framework);
|
|
24534
25189
|
}
|
|
24535
25190
|
break;
|
|
24536
25191
|
case "hmr-timing": {
|
|
25192
|
+
state.clientTargets.set(client, normalizedHmrTarget(data.target));
|
|
24537
25193
|
const update = typeof data.updateId === "number" ? state.hmrUpdates.get(data.updateId) : undefined;
|
|
24538
25194
|
logHmrClientUpdate(update?.path ?? state.lastHmrPath ?? "", update?.framework ?? state.lastHmrFramework, data.duration, normalizedHmrTarget(data.target), data.serverMs, data.clientMs, data.outcome, data.kind);
|
|
24539
25195
|
sendTelemetryEvent("hmr:client-applied", {
|
|
@@ -24589,7 +25245,7 @@ __export(exports_loadConfig, {
|
|
|
24589
25245
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
24590
25246
|
getWorkspaceServices: () => getWorkspaceServices
|
|
24591
25247
|
});
|
|
24592
|
-
import { resolve as
|
|
25248
|
+
import { resolve as resolve38 } from "path";
|
|
24593
25249
|
var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
24594
25250
|
if (!isObject2(config)) {
|
|
24595
25251
|
return false;
|
|
@@ -24640,7 +25296,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
24640
25296
|
}
|
|
24641
25297
|
return config;
|
|
24642
25298
|
}, loadRawConfig = async (configPath2) => {
|
|
24643
|
-
const resolved =
|
|
25299
|
+
const resolved = resolve38(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
24644
25300
|
const mod = await import(resolved);
|
|
24645
25301
|
const config = mod.default ?? mod.config;
|
|
24646
25302
|
if (!config) {
|
|
@@ -24702,8 +25358,8 @@ __export(exports_moduleServer, {
|
|
|
24702
25358
|
createModuleServer: () => createModuleServer,
|
|
24703
25359
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24704
25360
|
});
|
|
24705
|
-
import { existsSync as existsSync32, readFileSync as
|
|
24706
|
-
import { basename as basename16, dirname as
|
|
25361
|
+
import { existsSync as existsSync32, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25362
|
+
import { basename as basename16, dirname as dirname27, extname as extname12, join as join42, resolve as resolve39, relative as relative16 } from "path";
|
|
24707
25363
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24708
25364
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24709
25365
|
const allExports = [];
|
|
@@ -24723,10 +25379,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24723
25379
|
${stubs}
|
|
24724
25380
|
`;
|
|
24725
25381
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24726
|
-
const directHit = extensions.find((ext) => existsSync32(
|
|
25382
|
+
const directHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
|
|
24727
25383
|
if (directHit)
|
|
24728
25384
|
return srcPath + directHit;
|
|
24729
|
-
const indexHit = extensions.find((ext) => existsSync32(
|
|
25385
|
+
const indexHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath, `index${ext}`)));
|
|
24730
25386
|
if (indexHit)
|
|
24731
25387
|
return `${srcPath}/index${indexHit}`;
|
|
24732
25388
|
return srcPath;
|
|
@@ -24749,7 +25405,7 @@ ${stubs}
|
|
|
24749
25405
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
24750
25406
|
}, srcUrl = (relPath, projectRoot) => {
|
|
24751
25407
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
24752
|
-
const absPath =
|
|
25408
|
+
const absPath = resolve39(projectRoot, relPath);
|
|
24753
25409
|
const cached = mtimeCache.get(absPath);
|
|
24754
25410
|
if (cached !== undefined)
|
|
24755
25411
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -24761,12 +25417,12 @@ ${stubs}
|
|
|
24761
25417
|
return base;
|
|
24762
25418
|
}
|
|
24763
25419
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
24764
|
-
const absPath =
|
|
25420
|
+
const absPath = resolve39(fileDir, relPath);
|
|
24765
25421
|
const rel = relative16(projectRoot, absPath);
|
|
24766
25422
|
const extension = extname12(rel);
|
|
24767
25423
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
24768
25424
|
if (extname12(srcPath) === ".svelte") {
|
|
24769
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
25425
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
|
|
24770
25426
|
}
|
|
24771
25427
|
return srcUrl(srcPath, projectRoot);
|
|
24772
25428
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -24785,13 +25441,13 @@ ${stubs}
|
|
|
24785
25441
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
24786
25442
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
24787
25443
|
if (!subpath) {
|
|
24788
|
-
const pkgDir =
|
|
24789
|
-
const pkgJsonPath =
|
|
25444
|
+
const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
|
|
25445
|
+
const pkgJsonPath = join42(pkgDir, "package.json");
|
|
24790
25446
|
if (existsSync32(pkgJsonPath)) {
|
|
24791
|
-
const pkg = JSON.parse(
|
|
25447
|
+
const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
|
|
24792
25448
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
24793
25449
|
if (esmEntry) {
|
|
24794
|
-
const resolved =
|
|
25450
|
+
const resolved = resolve39(pkgDir, esmEntry);
|
|
24795
25451
|
if (existsSync32(resolved))
|
|
24796
25452
|
return relative16(projectRoot, resolved);
|
|
24797
25453
|
}
|
|
@@ -24829,7 +25485,7 @@ ${stubs}
|
|
|
24829
25485
|
};
|
|
24830
25486
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
24831
25487
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
24832
|
-
const fileDir =
|
|
25488
|
+
const fileDir = dirname27(filePath);
|
|
24833
25489
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
24834
25490
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
24835
25491
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -24844,12 +25500,12 @@ ${stubs}
|
|
|
24844
25500
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
24845
25501
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
24846
25502
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
24847
|
-
const absPath =
|
|
25503
|
+
const absPath = resolve39(fileDir, relPath);
|
|
24848
25504
|
const rel = relative16(projectRoot, absPath);
|
|
24849
25505
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
24850
25506
|
});
|
|
24851
25507
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
24852
|
-
const absPath =
|
|
25508
|
+
const absPath = resolve39(fileDir, relPath);
|
|
24853
25509
|
const rel = relative16(projectRoot, absPath);
|
|
24854
25510
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
24855
25511
|
});
|
|
@@ -24895,7 +25551,7 @@ ${code}`;
|
|
|
24895
25551
|
reactFastRefreshWarningEmitted = true;
|
|
24896
25552
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a targeted " + "page remount instead of a state-preserving fast refresh.");
|
|
24897
25553
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
24898
|
-
const raw =
|
|
25554
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
24899
25555
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
24900
25556
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
24901
25557
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -24911,7 +25567,7 @@ ${transpiled}`;
|
|
|
24911
25567
|
transpiled += buildIslandMetadataExports(raw);
|
|
24912
25568
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
24913
25569
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
24914
|
-
const raw =
|
|
25570
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
24915
25571
|
const ext = extname12(filePath);
|
|
24916
25572
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
24917
25573
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -25077,7 +25733,7 @@ ${code}`;
|
|
|
25077
25733
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
25078
25734
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
25079
25735
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
25080
|
-
const raw =
|
|
25736
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25081
25737
|
if (!svelteCompiler) {
|
|
25082
25738
|
svelteCompiler = await import("svelte/compiler");
|
|
25083
25739
|
}
|
|
@@ -25143,7 +25799,7 @@ export default __script__;`;
|
|
|
25143
25799
|
return `${cssInjection}
|
|
25144
25800
|
${code}`;
|
|
25145
25801
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
25146
|
-
const rawSource =
|
|
25802
|
+
const rawSource = readFileSync28(filePath, "utf-8");
|
|
25147
25803
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
25148
25804
|
if (!vueCompiler) {
|
|
25149
25805
|
vueCompiler = await loadVueCompiler();
|
|
@@ -25156,7 +25812,7 @@ ${code}`;
|
|
|
25156
25812
|
fs: {
|
|
25157
25813
|
fileExists: existsSync32,
|
|
25158
25814
|
realpath: realpathSync3,
|
|
25159
|
-
readFile: (file4) => existsSync32(file4) ?
|
|
25815
|
+
readFile: (file4) => existsSync32(file4) ? readFileSync28(file4, "utf-8") : undefined
|
|
25160
25816
|
},
|
|
25161
25817
|
id: componentId,
|
|
25162
25818
|
inlineTemplate: false
|
|
@@ -25171,7 +25827,7 @@ ${code}`;
|
|
|
25171
25827
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25172
25828
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25173
25829
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25174
|
-
const hmrBase = vueDir ?
|
|
25830
|
+
const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
|
|
25175
25831
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25176
25832
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25177
25833
|
result += [
|
|
@@ -25203,7 +25859,7 @@ ${code}`;
|
|
|
25203
25859
|
}
|
|
25204
25860
|
});
|
|
25205
25861
|
}, handleCssRequest = (filePath) => {
|
|
25206
|
-
const raw =
|
|
25862
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25207
25863
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25208
25864
|
return [
|
|
25209
25865
|
`const style = document.createElement('style');`,
|
|
@@ -25335,7 +25991,7 @@ export default {};
|
|
|
25335
25991
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25336
25992
|
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);`);
|
|
25337
25993
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25338
|
-
const filePath =
|
|
25994
|
+
const filePath = resolve39(projectRoot, relPath);
|
|
25339
25995
|
const ext = extname12(filePath);
|
|
25340
25996
|
if (ext === ".svelte")
|
|
25341
25997
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25372,14 +26028,14 @@ export default {};
|
|
|
25372
26028
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25373
26029
|
const candidates = [
|
|
25374
26030
|
absoluteCandidate,
|
|
25375
|
-
|
|
26031
|
+
resolve39(projectRoot, tail)
|
|
25376
26032
|
];
|
|
25377
26033
|
try {
|
|
25378
26034
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25379
26035
|
const cfg = await loadConfig2();
|
|
25380
|
-
const angularDir = cfg.angularDirectory &&
|
|
26036
|
+
const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
|
|
25381
26037
|
if (angularDir)
|
|
25382
|
-
candidates.push(
|
|
26038
|
+
candidates.push(resolve39(angularDir, tail));
|
|
25383
26039
|
} catch {}
|
|
25384
26040
|
for (const candidate of candidates) {
|
|
25385
26041
|
if (await fileExists(candidate)) {
|
|
@@ -25410,7 +26066,7 @@ export default {};
|
|
|
25410
26066
|
if (!TRANSPILABLE.has(ext))
|
|
25411
26067
|
return;
|
|
25412
26068
|
const stat3 = statSync6(filePath);
|
|
25413
|
-
const resolvedVueDir = vueDir ?
|
|
26069
|
+
const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
|
|
25414
26070
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25415
26071
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25416
26072
|
if (isAngularGeneratedJs) {
|
|
@@ -25469,7 +26125,7 @@ export default {};
|
|
|
25469
26125
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25470
26126
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25471
26127
|
return handleBunWrapRequest();
|
|
25472
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
26128
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
|
|
25473
26129
|
if (virtualCssResponse)
|
|
25474
26130
|
return virtualCssResponse;
|
|
25475
26131
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25485,11 +26141,11 @@ export default {};
|
|
|
25485
26141
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25486
26142
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25487
26143
|
if (match[1])
|
|
25488
|
-
files.push(
|
|
26144
|
+
files.push(resolve39(projectRoot, match[1]));
|
|
25489
26145
|
}
|
|
25490
26146
|
return files;
|
|
25491
26147
|
}, invalidateModule = (filePath) => {
|
|
25492
|
-
const resolved =
|
|
26148
|
+
const resolved = resolve39(filePath);
|
|
25493
26149
|
invalidate(filePath);
|
|
25494
26150
|
if (resolved !== filePath)
|
|
25495
26151
|
invalidate(resolved);
|
|
@@ -25652,7 +26308,7 @@ __export(exports_hmrCompiler, {
|
|
|
25652
26308
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25653
26309
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25654
26310
|
});
|
|
25655
|
-
import { dirname as
|
|
26311
|
+
import { dirname as dirname28, relative as relative17, resolve as resolve40 } from "path";
|
|
25656
26312
|
import { performance as performance2 } from "perf_hooks";
|
|
25657
26313
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25658
26314
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25664,7 +26320,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25664
26320
|
return null;
|
|
25665
26321
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25666
26322
|
const className = decoded.slice(separatorIndex + 1);
|
|
25667
|
-
const componentFilePath =
|
|
26323
|
+
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
25668
26324
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25669
26325
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25670
26326
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25675,7 +26331,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25675
26331
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25676
26332
|
const owners = resolveOwningComponents2({
|
|
25677
26333
|
changedFilePath: componentFilePath,
|
|
25678
|
-
userAngularRoot:
|
|
26334
|
+
userAngularRoot: dirname28(componentFilePath)
|
|
25679
26335
|
});
|
|
25680
26336
|
const owner = owners.find((o3) => o3.className === className);
|
|
25681
26337
|
const kind = owner?.kind ?? "component";
|
|
@@ -25870,11 +26526,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
25870
26526
|
__export(exports_simpleHTMLHMR, {
|
|
25871
26527
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
25872
26528
|
});
|
|
25873
|
-
import { resolve as
|
|
26529
|
+
import { resolve as resolve41 } from "path";
|
|
25874
26530
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
25875
26531
|
let htmlContent;
|
|
25876
26532
|
try {
|
|
25877
|
-
const resolvedPath =
|
|
26533
|
+
const resolvedPath = resolve41(htmlFilePath);
|
|
25878
26534
|
const file4 = Bun.file(resolvedPath);
|
|
25879
26535
|
if (!await file4.exists()) {
|
|
25880
26536
|
return null;
|
|
@@ -25900,11 +26556,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
25900
26556
|
__export(exports_simpleHTMXHMR, {
|
|
25901
26557
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
25902
26558
|
});
|
|
25903
|
-
import { resolve as
|
|
26559
|
+
import { resolve as resolve42 } from "path";
|
|
25904
26560
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
25905
26561
|
let htmlContent;
|
|
25906
26562
|
try {
|
|
25907
|
-
const resolvedPath =
|
|
26563
|
+
const resolvedPath = resolve42(htmxFilePath);
|
|
25908
26564
|
const file4 = Bun.file(resolvedPath);
|
|
25909
26565
|
if (!await file4.exists()) {
|
|
25910
26566
|
return null;
|
|
@@ -25929,9 +26585,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
25929
26585
|
import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
25930
26586
|
import {
|
|
25931
26587
|
basename as basename17,
|
|
25932
|
-
dirname as
|
|
26588
|
+
dirname as dirname29,
|
|
25933
26589
|
isAbsolute as isAbsolute6,
|
|
25934
|
-
join as
|
|
26590
|
+
join as join43,
|
|
25935
26591
|
relative as relative18,
|
|
25936
26592
|
resolve as resolvePath,
|
|
25937
26593
|
sep as sep4
|
|
@@ -26058,8 +26714,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26058
26714
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26059
26715
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26060
26716
|
for (const candidate of [
|
|
26061
|
-
|
|
26062
|
-
`${
|
|
26717
|
+
join43(generatedDir, relJs),
|
|
26718
|
+
`${join43(generatedDir, relJs)}.map`
|
|
26063
26719
|
]) {
|
|
26064
26720
|
try {
|
|
26065
26721
|
rmSync3(candidate, { force: true });
|
|
@@ -26293,8 +26949,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26293
26949
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
26294
26950
|
const { buildDir } = state.resolvedPaths;
|
|
26295
26951
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26296
|
-
const { mkdir:
|
|
26297
|
-
await
|
|
26952
|
+
const { mkdir: mkdir9, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
26953
|
+
await mkdir9(dirname29(destPath), { recursive: true });
|
|
26298
26954
|
await copyFile(absSource, destPath);
|
|
26299
26955
|
const bytes = await readFile7(destPath);
|
|
26300
26956
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26475,7 +27131,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26475
27131
|
const keepStemsByDir = new Map;
|
|
26476
27132
|
const prefixByDir = new Map;
|
|
26477
27133
|
for (const artifact of freshOutputs) {
|
|
26478
|
-
const dir =
|
|
27134
|
+
const dir = dirname29(artifact.path);
|
|
26479
27135
|
const name = basename17(artifact.path);
|
|
26480
27136
|
const [prefix] = name.split(".");
|
|
26481
27137
|
if (!prefix)
|
|
@@ -26838,8 +27494,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26838
27494
|
};
|
|
26839
27495
|
return ({ immediate = false } = {}) => {
|
|
26840
27496
|
if (!ctx.debouncedPromise) {
|
|
26841
|
-
ctx.debouncedPromise = new Promise((
|
|
26842
|
-
ctx.debouncedResolve =
|
|
27497
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
27498
|
+
ctx.debouncedResolve = resolve43;
|
|
26843
27499
|
});
|
|
26844
27500
|
}
|
|
26845
27501
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -26961,7 +27617,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26961
27617
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
26962
27618
|
const files = [];
|
|
26963
27619
|
for (const entry of entries) {
|
|
26964
|
-
const full =
|
|
27620
|
+
const full = join43(dir, entry.name);
|
|
26965
27621
|
if (entry.isDirectory()) {
|
|
26966
27622
|
files.push(...await walk(full));
|
|
26967
27623
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27371,8 +28027,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27371
28027
|
};
|
|
27372
28028
|
return () => {
|
|
27373
28029
|
if (!ctx.debouncedPromise) {
|
|
27374
|
-
ctx.debouncedPromise = new Promise((
|
|
27375
|
-
ctx.debouncedResolve =
|
|
28030
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
28031
|
+
ctx.debouncedResolve = resolve43;
|
|
27376
28032
|
});
|
|
27377
28033
|
}
|
|
27378
28034
|
if (ctx.debounceTimer)
|
|
@@ -27521,7 +28177,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27521
28177
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27522
28178
|
const serverEntries = [...vueServerPaths];
|
|
27523
28179
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27524
|
-
const cssOutDir =
|
|
28180
|
+
const cssOutDir = join43(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27525
28181
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27526
28182
|
const serverExternals = await getServerBundleExternals();
|
|
27527
28183
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27646,8 +28302,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27646
28302
|
};
|
|
27647
28303
|
return () => {
|
|
27648
28304
|
if (!ctx.debouncedPromise) {
|
|
27649
|
-
ctx.debouncedPromise = new Promise((
|
|
27650
|
-
ctx.debouncedResolve =
|
|
28305
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
28306
|
+
ctx.debouncedResolve = resolve43;
|
|
27651
28307
|
});
|
|
27652
28308
|
}
|
|
27653
28309
|
if (ctx.debounceTimer)
|
|
@@ -27733,7 +28389,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27733
28389
|
});
|
|
27734
28390
|
});
|
|
27735
28391
|
return allModuleUpdates;
|
|
27736
|
-
}, handleReactHMR = (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
28392
|
+
}, handleReactHMR = async (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
27737
28393
|
if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
|
|
27738
28394
|
return;
|
|
27739
28395
|
}
|
|
@@ -27745,14 +28401,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27745
28401
|
const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
|
|
27746
28402
|
const [primarySource] = sourceFiles;
|
|
27747
28403
|
try {
|
|
27748
|
-
const
|
|
27749
|
-
|
|
28404
|
+
const {
|
|
28405
|
+
isReactFastRefreshSupported: isReactFastRefreshSupported2,
|
|
28406
|
+
warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2
|
|
28407
|
+
} = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
28408
|
+
warnIfReactFastRefreshUnsupported2();
|
|
28409
|
+
await handleReactModuleServerPath(state, reactFiles, Date.now() - duration, isReactFastRefreshSupported2(), () => {
|
|
28410
|
+
return;
|
|
28411
|
+
});
|
|
28412
|
+
} catch (err) {
|
|
27750
28413
|
logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
|
|
27751
28414
|
broadcastToClients(state, {
|
|
27752
28415
|
data: {
|
|
27753
28416
|
framework: "react",
|
|
27754
|
-
hasComponentChanges,
|
|
27755
|
-
hasCSSChanges,
|
|
28417
|
+
hasComponentChanges: true,
|
|
28418
|
+
hasCSSChanges: reactFiles.some(isStylePath),
|
|
27756
28419
|
manifest,
|
|
27757
28420
|
primarySource,
|
|
27758
28421
|
serverDuration: duration,
|
|
@@ -27760,7 +28423,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27760
28423
|
},
|
|
27761
28424
|
type: "react-update"
|
|
27762
28425
|
});
|
|
27763
|
-
} catch (err) {
|
|
27764
28426
|
console.error("[hmr] react live update failed:", err instanceof Error ? err.message : err);
|
|
27765
28427
|
sendTelemetryEvent("hmr:error", {
|
|
27766
28428
|
framework: "react",
|
|
@@ -27791,7 +28453,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27791
28453
|
if (!buildReference?.source) {
|
|
27792
28454
|
return;
|
|
27793
28455
|
}
|
|
27794
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(
|
|
28456
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname29(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
27795
28457
|
islandFiles.add(resolvePath(sourcePath));
|
|
27796
28458
|
}, resolveIslandSourceFiles = async (config) => {
|
|
27797
28459
|
const registryPath = config.islands?.registry;
|
|
@@ -27819,8 +28481,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27819
28481
|
}
|
|
27820
28482
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
27821
28483
|
const affectedPages = filesToRebuild.flatMap((file4) => getPagesUsingIslandSource(file4));
|
|
28484
|
+
if (affectedPages.length === 0)
|
|
28485
|
+
return true;
|
|
28486
|
+
const affectedFrameworks = [
|
|
28487
|
+
...new Set(affectedPages.map((page) => detectFramework(page, state.resolvedPaths)).filter((framework) => framework !== "ignored"))
|
|
28488
|
+
];
|
|
27822
28489
|
broadcastToClients(state, {
|
|
27823
28490
|
data: {
|
|
28491
|
+
affectedFrameworks,
|
|
27824
28492
|
affectedPages,
|
|
27825
28493
|
framework: "islands",
|
|
27826
28494
|
manifest,
|
|
@@ -28212,7 +28880,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28212
28880
|
}
|
|
28213
28881
|
}, handleFullBuildHMR = async (state, config, affectedFrameworks, filesToRebuild, manifest, duration) => {
|
|
28214
28882
|
const allModuleUpdates = collectAllModuleUpdates(affectedFrameworks, filesToRebuild, manifest, state);
|
|
28215
|
-
handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
28883
|
+
await handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
28216
28884
|
handleHTMLScriptHMR(state, filesToRebuild, manifest, duration);
|
|
28217
28885
|
await handleHTMLPageHMR(state, config, filesToRebuild, manifest, duration);
|
|
28218
28886
|
await handleVueHMR(state, config, filesToRebuild, manifest, duration);
|
|
@@ -28439,7 +29107,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28439
29107
|
message: "Rebuild completed successfully",
|
|
28440
29108
|
type: "rebuild-complete"
|
|
28441
29109
|
});
|
|
28442
|
-
|
|
29110
|
+
const hasDedicatedStyleUpdate = affectedFrameworks.some((framework) => framework === "styles" || framework === "assets");
|
|
29111
|
+
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate) && !hasDedicatedStyleUpdate) {
|
|
28443
29112
|
try {
|
|
28444
29113
|
const outputPath = resolvePath(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
28445
29114
|
const bytes = await Bun.file(outputPath).bytes();
|
|
@@ -28460,6 +29129,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28460
29129
|
const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
|
|
28461
29130
|
const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
|
|
28462
29131
|
if (didReloadForIslandChange) {
|
|
29132
|
+
await runFrameworkFastPaths(state, config, affectedFrameworks, filesToRebuild ?? [], startTime, onRebuildComplete);
|
|
28463
29133
|
onRebuildComplete({ hmrState: state, manifest });
|
|
28464
29134
|
return manifest;
|
|
28465
29135
|
}
|
|
@@ -28616,8 +29286,8 @@ __export(exports_buildDepVendor, {
|
|
|
28616
29286
|
});
|
|
28617
29287
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
28618
29288
|
import { isBuiltin } from "module";
|
|
28619
|
-
import { join as
|
|
28620
|
-
import { rm as
|
|
29289
|
+
import { join as join44 } from "path";
|
|
29290
|
+
import { rm as rm11 } from "fs/promises";
|
|
28621
29291
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
28622
29292
|
var toSafeFileName6 = (specifier) => {
|
|
28623
29293
|
const prefix = specifier.startsWith("@") ? "_" : "";
|
|
@@ -28675,8 +29345,8 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28675
29345
|
framework: Array.from(framework).filter(isResolvable3)
|
|
28676
29346
|
};
|
|
28677
29347
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
28678
|
-
const { readFileSync:
|
|
28679
|
-
const { dirname:
|
|
29348
|
+
const { readFileSync: readFileSync29 } = await import("fs");
|
|
29349
|
+
const { dirname: dirname30 } = await import("path");
|
|
28680
29350
|
const seenFiles = new Set;
|
|
28681
29351
|
const bareOut = new Set;
|
|
28682
29352
|
const queue = [
|
|
@@ -28691,7 +29361,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28691
29361
|
continue;
|
|
28692
29362
|
let content;
|
|
28693
29363
|
try {
|
|
28694
|
-
content =
|
|
29364
|
+
content = readFileSync29(path, "utf-8");
|
|
28695
29365
|
} catch {
|
|
28696
29366
|
continue;
|
|
28697
29367
|
}
|
|
@@ -28701,7 +29371,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28701
29371
|
} catch {
|
|
28702
29372
|
continue;
|
|
28703
29373
|
}
|
|
28704
|
-
const fromDir =
|
|
29374
|
+
const fromDir = dirname30(path);
|
|
28705
29375
|
for (const imp of imports) {
|
|
28706
29376
|
const child = imp.path;
|
|
28707
29377
|
if (child.startsWith(".") || child.startsWith("/")) {
|
|
@@ -28765,7 +29435,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28765
29435
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
28766
29436
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
28767
29437
|
const safeName = toSafeFileName6(specifier);
|
|
28768
|
-
const entryPath =
|
|
29438
|
+
const entryPath = join44(tmpDir, `${safeName}.ts`);
|
|
28769
29439
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
28770
29440
|
return { entryPath, specifier };
|
|
28771
29441
|
}));
|
|
@@ -28856,9 +29526,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28856
29526
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
28857
29527
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
28858
29528
|
return {};
|
|
28859
|
-
const vendorDir =
|
|
29529
|
+
const vendorDir = join44(buildDir, "vendor");
|
|
28860
29530
|
mkdirSync14(vendorDir, { recursive: true });
|
|
28861
|
-
const tmpDir =
|
|
29531
|
+
const tmpDir = join44(buildDir, "_dep_vendor_tmp");
|
|
28862
29532
|
mkdirSync14(tmpDir, { recursive: true });
|
|
28863
29533
|
const allSpecs = new Set(initialSpecs);
|
|
28864
29534
|
const alreadyScanned = new Set;
|
|
@@ -28878,7 +29548,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28878
29548
|
if (!success) {
|
|
28879
29549
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
28880
29550
|
}
|
|
28881
|
-
await
|
|
29551
|
+
await rm11(tmpDir, { force: true, recursive: true });
|
|
28882
29552
|
const paths = {};
|
|
28883
29553
|
for (const specifier of allSpecs) {
|
|
28884
29554
|
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
@@ -28941,7 +29611,7 @@ __export(exports_devBuild, {
|
|
|
28941
29611
|
});
|
|
28942
29612
|
import { readdir as readdir5 } from "fs/promises";
|
|
28943
29613
|
import { statSync as statSync7 } from "fs";
|
|
28944
|
-
import { resolve as
|
|
29614
|
+
import { resolve as resolve43 } from "path";
|
|
28945
29615
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
28946
29616
|
const configuredDirs = [
|
|
28947
29617
|
config.reactDirectory,
|
|
@@ -28964,7 +29634,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28964
29634
|
return Object.keys(config).length > 0 ? config : null;
|
|
28965
29635
|
}, reloadConfig = async () => {
|
|
28966
29636
|
try {
|
|
28967
|
-
const configPath2 =
|
|
29637
|
+
const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
28968
29638
|
const source = await Bun.file(configPath2).text();
|
|
28969
29639
|
return parseDirectoryConfig(source);
|
|
28970
29640
|
} catch {
|
|
@@ -29076,7 +29746,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29076
29746
|
});
|
|
29077
29747
|
}
|
|
29078
29748
|
}, handleCachedReload = async () => {
|
|
29079
|
-
const serverMtime = statSync7(
|
|
29749
|
+
const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
29080
29750
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
29081
29751
|
globalThis.__hmrServerMtime = serverMtime;
|
|
29082
29752
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -29113,8 +29783,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29113
29783
|
return true;
|
|
29114
29784
|
}, resolveAbsoluteVersion2 = async () => {
|
|
29115
29785
|
const candidates = [
|
|
29116
|
-
|
|
29117
|
-
|
|
29786
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
29787
|
+
resolve43(import.meta.dir, "..", "package.json")
|
|
29118
29788
|
];
|
|
29119
29789
|
const [candidate, ...remaining] = candidates;
|
|
29120
29790
|
if (!candidate) {
|
|
@@ -29140,7 +29810,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29140
29810
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
29141
29811
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
29142
29812
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
29143
|
-
const bytes = await Bun.file(
|
|
29813
|
+
const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
|
|
29144
29814
|
assetStore.set(webPath, bytes);
|
|
29145
29815
|
}));
|
|
29146
29816
|
}, devBuild = async (config) => {
|
|
@@ -29149,6 +29819,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29149
29819
|
await handleCachedReload();
|
|
29150
29820
|
return cached;
|
|
29151
29821
|
}
|
|
29822
|
+
if (config.reactDirectory && !globalThis.__reactModuleRef) {
|
|
29823
|
+
globalThis.__reactModuleRef = await import("react");
|
|
29824
|
+
}
|
|
29152
29825
|
const startupSteps = [];
|
|
29153
29826
|
const recordStep = (label, startedAt) => {
|
|
29154
29827
|
const durationMs = performance.now() - startedAt;
|
|
@@ -29276,11 +29949,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29276
29949
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
29277
29950
|
recordStep("populate asset store", stepStartedAt);
|
|
29278
29951
|
stepStartedAt = performance.now();
|
|
29279
|
-
const reactVendorDir =
|
|
29280
|
-
const angularVendorDir =
|
|
29281
|
-
const svelteVendorDir =
|
|
29282
|
-
const vueVendorDir =
|
|
29283
|
-
const depVendorDir =
|
|
29952
|
+
const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29953
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29954
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29955
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29956
|
+
const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
|
|
29284
29957
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
29285
29958
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
29286
29959
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -29324,9 +29997,6 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29324
29997
|
config.vueDirectory ? loadVendorFiles(state.assetStore, vueVendorDir, "vue") : Promise.resolve(),
|
|
29325
29998
|
loadVendorFiles(state.assetStore, depVendorDir, "vendor")
|
|
29326
29999
|
]);
|
|
29327
|
-
if (config.reactDirectory && !globalThis.__reactModuleRef) {
|
|
29328
|
-
globalThis.__reactModuleRef = await import("react");
|
|
29329
|
-
}
|
|
29330
30000
|
recordStep("load vendor files", stepStartedAt);
|
|
29331
30001
|
stepStartedAt = performance.now();
|
|
29332
30002
|
const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
@@ -29361,7 +30031,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29361
30031
|
manifest
|
|
29362
30032
|
};
|
|
29363
30033
|
globalThis.__hmrDevResult = result;
|
|
29364
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
30034
|
+
globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
29365
30035
|
return result;
|
|
29366
30036
|
};
|
|
29367
30037
|
var init_devBuild = __esm(() => {
|
|
@@ -29398,5 +30068,5 @@ export {
|
|
|
29398
30068
|
build
|
|
29399
30069
|
};
|
|
29400
30070
|
|
|
29401
|
-
//# debugId=
|
|
30071
|
+
//# debugId=98578A5E06A0230864756E2164756E21
|
|
29402
30072
|
//# sourceMappingURL=build.js.map
|