@absolutejs/absolute 0.20.0-beta.13 → 0.20.0-beta.14
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 +33 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +822 -561
- package/dist/build.js.map +7 -5
- package/dist/cli/index.js +834 -515
- package/dist/index.js +904 -643
- package/dist/index.js.map +7 -5
- package/dist/mobile/index.js +310 -36
- package/dist/mobile/index.js.map +10 -7
- package/dist/mobile/shellSync.js +3 -1
- package/dist/src/build/pwa.d.ts +2 -1
- package/dist/src/mobile/capacitorBundle.d.ts +3 -0
- package/dist/src/mobile/index.d.ts +1 -0
- package/dist/src/mobile/shellSync.d.ts +2 -2
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +2 -0
- package/dist/types/build.d.ts +1 -1
- package/package.json +11 -11
package/dist/build.js
CHANGED
|
@@ -12859,9 +12859,260 @@ var isTestSourcePath = (file) => {
|
|
|
12859
12859
|
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
12860
12860
|
};
|
|
12861
12861
|
|
|
12862
|
+
// node_modules/@absolutejs/sync/dist/client/index.js
|
|
12863
|
+
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")), registry, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
12864
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
12865
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
|
|
12866
|
+
return value;
|
|
12867
|
+
}, isSchemaBundle = (schema) => ("components" in schema), normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
|
|
12868
|
+
const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
|
|
12869
|
+
const ids = new Set;
|
|
12870
|
+
for (const component of components) {
|
|
12871
|
+
if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
|
|
12872
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
|
|
12873
|
+
if (ids.has(component.id))
|
|
12874
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
|
|
12875
|
+
ids.add(component.id);
|
|
12876
|
+
}
|
|
12877
|
+
return components.sort((a, b2) => a.id.localeCompare(b2.id));
|
|
12878
|
+
}, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
|
|
12879
|
+
const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
|
|
12880
|
+
const current = resolveSyncLocalMigrations(component.version, component);
|
|
12881
|
+
return {
|
|
12882
|
+
id: component.id,
|
|
12883
|
+
...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
|
|
12884
|
+
};
|
|
12885
|
+
});
|
|
12886
|
+
const active = new Set(components.map((component) => component.id));
|
|
12887
|
+
const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
|
|
12888
|
+
return { components, orphanedComponents };
|
|
12889
|
+
}, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
|
|
12890
|
+
positiveVersion(storedVersion, "Stored Sync schema version");
|
|
12891
|
+
const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
|
|
12892
|
+
const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
|
|
12893
|
+
const versions = new Set;
|
|
12894
|
+
for (const migration of migrations) {
|
|
12895
|
+
positiveVersion(migration.toVersion, "Sync migration toVersion");
|
|
12896
|
+
if (versions.has(migration.toVersion))
|
|
12897
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
|
|
12898
|
+
versions.add(migration.toVersion);
|
|
12899
|
+
}
|
|
12900
|
+
const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
|
|
12901
|
+
const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
|
|
12902
|
+
if (minimumCompatibleVersion > targetVersion)
|
|
12903
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
|
|
12904
|
+
if (storedVersion > targetVersion)
|
|
12905
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
|
|
12906
|
+
if (storedVersion < minimumCompatibleVersion)
|
|
12907
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
|
|
12908
|
+
const steps = [];
|
|
12909
|
+
for (let version = storedVersion + 1;version <= targetVersion; version++) {
|
|
12910
|
+
const migration = migrations.find((candidate) => candidate.toVersion === version);
|
|
12911
|
+
if (migration === undefined)
|
|
12912
|
+
throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
|
|
12913
|
+
steps.push(migration);
|
|
12914
|
+
}
|
|
12915
|
+
return { minimumCompatibleVersion, steps, targetVersion };
|
|
12916
|
+
};
|
|
12917
|
+
var init_client = __esm(() => {
|
|
12918
|
+
RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
|
|
12919
|
+
host = globalThis;
|
|
12920
|
+
registry = (() => {
|
|
12921
|
+
const existing = host[RUNTIME_TRANSPORT];
|
|
12922
|
+
if (isRegistry(existing))
|
|
12923
|
+
return existing;
|
|
12924
|
+
const created = { installations: [] };
|
|
12925
|
+
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
12926
|
+
configurable: false,
|
|
12927
|
+
enumerable: false,
|
|
12928
|
+
value: created,
|
|
12929
|
+
writable: false
|
|
12930
|
+
});
|
|
12931
|
+
return created;
|
|
12932
|
+
})();
|
|
12933
|
+
SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
|
|
12934
|
+
code;
|
|
12935
|
+
storedVersion;
|
|
12936
|
+
targetVersion;
|
|
12937
|
+
constructor(code, message, versions = {}) {
|
|
12938
|
+
super(message);
|
|
12939
|
+
this.name = "SyncLocalStoreSchemaError";
|
|
12940
|
+
this.code = code;
|
|
12941
|
+
this.storedVersion = versions.storedVersion;
|
|
12942
|
+
this.targetVersion = versions.targetVersion;
|
|
12943
|
+
}
|
|
12944
|
+
};
|
|
12945
|
+
});
|
|
12946
|
+
|
|
12947
|
+
// src/mobile/syncSchema.ts
|
|
12948
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
12949
|
+
import { dirname as dirname13, join as join24, resolve as resolve20 } from "path";
|
|
12950
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
12951
|
+
try {
|
|
12952
|
+
const value = JSON.parse(readFileSync13(path, "utf8"));
|
|
12953
|
+
return object(value) ? value : undefined;
|
|
12954
|
+
} catch {
|
|
12955
|
+
return;
|
|
12956
|
+
}
|
|
12957
|
+
}, localSchemaMetadata = (manifest) => {
|
|
12958
|
+
const absolutejs = Reflect.get(manifest, "absolutejs");
|
|
12959
|
+
if (!object(absolutejs))
|
|
12960
|
+
return;
|
|
12961
|
+
const sync = Reflect.get(absolutejs, "sync");
|
|
12962
|
+
if (!object(sync))
|
|
12963
|
+
return;
|
|
12964
|
+
return Reflect.get(sync, "localSchema");
|
|
12965
|
+
}, packageManifestPath = (projectRoot, packageName) => {
|
|
12966
|
+
let directory = resolve20(projectRoot);
|
|
12967
|
+
while (true) {
|
|
12968
|
+
const candidate = join24(directory, "node_modules", packageName, "package.json");
|
|
12969
|
+
const manifest = manifestAt(candidate);
|
|
12970
|
+
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
12971
|
+
return candidate;
|
|
12972
|
+
const parent = dirname13(directory);
|
|
12973
|
+
if (parent === directory)
|
|
12974
|
+
return;
|
|
12975
|
+
directory = parent;
|
|
12976
|
+
}
|
|
12977
|
+
}, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
|
|
12978
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
12979
|
+
throw metadataError(id, `${field} must be a positive safe integer.`);
|
|
12980
|
+
return value;
|
|
12981
|
+
}, nonEmpty = (value, id, field) => {
|
|
12982
|
+
if (typeof value !== "string" || value.trim() !== value || value.length === 0)
|
|
12983
|
+
throw metadataError(id, `${field} must be a non-empty trimmed string.`);
|
|
12984
|
+
return value;
|
|
12985
|
+
}, requireObject = (value, id, detail) => {
|
|
12986
|
+
if (!object(value))
|
|
12987
|
+
throw metadataError(id, detail);
|
|
12988
|
+
return value;
|
|
12989
|
+
}, normalizeJsonValue = (value, id, field) => {
|
|
12990
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
12991
|
+
return value;
|
|
12992
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
12993
|
+
return value;
|
|
12994
|
+
if (Array.isArray(value))
|
|
12995
|
+
return value.map((entry) => normalizeJsonValue(entry, id, field));
|
|
12996
|
+
if (object(value))
|
|
12997
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
12998
|
+
key,
|
|
12999
|
+
normalizeJsonValue(entry, id, field)
|
|
13000
|
+
]));
|
|
13001
|
+
throw metadataError(id, `${field} must be JSON-safe.`);
|
|
13002
|
+
}, operation = (value, id, index) => {
|
|
13003
|
+
const record = requireObject(value, id, `migration operation ${index} must be an object.`);
|
|
13004
|
+
const type = Reflect.get(record, "type");
|
|
13005
|
+
const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
|
|
13006
|
+
if (type === "delete-collection")
|
|
13007
|
+
return { collection, type };
|
|
13008
|
+
if (type === "rename-field")
|
|
13009
|
+
return {
|
|
13010
|
+
collection,
|
|
13011
|
+
from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
|
|
13012
|
+
to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
|
|
13013
|
+
type
|
|
13014
|
+
};
|
|
13015
|
+
const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
|
|
13016
|
+
if (type === "remove-field")
|
|
13017
|
+
return { collection, field, type };
|
|
13018
|
+
if (type === "set-default")
|
|
13019
|
+
return {
|
|
13020
|
+
collection,
|
|
13021
|
+
field,
|
|
13022
|
+
type,
|
|
13023
|
+
value: normalizeJsonValue(Reflect.get(record, "value"), id, `operation ${index}.value`)
|
|
13024
|
+
};
|
|
13025
|
+
throw metadataError(id, `operation ${index}.type is not supported.`);
|
|
13026
|
+
}, migration = (value, id, index) => {
|
|
13027
|
+
const record = requireObject(value, id, `migration ${index} must be an object.`);
|
|
13028
|
+
const allowed = new Set(["operations", "toVersion"]);
|
|
13029
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13030
|
+
if (unsupported)
|
|
13031
|
+
throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
|
|
13032
|
+
const declaredOperations = Reflect.get(record, "operations");
|
|
13033
|
+
if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
|
|
13034
|
+
throw metadataError(id, `migration ${index}.operations must be an array.`);
|
|
13035
|
+
const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
|
|
13036
|
+
return {
|
|
13037
|
+
operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
|
|
13038
|
+
toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
|
|
13039
|
+
};
|
|
13040
|
+
}, component = (id, value) => {
|
|
13041
|
+
const record = requireObject(value, id, "localSchema must be an object.");
|
|
13042
|
+
const allowed = new Set([
|
|
13043
|
+
"migrations",
|
|
13044
|
+
"minimumCompatibleVersion",
|
|
13045
|
+
"version"
|
|
13046
|
+
]);
|
|
13047
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13048
|
+
if (unsupported)
|
|
13049
|
+
throw metadataError(id, `${unsupported} is not supported.`);
|
|
13050
|
+
const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
|
|
13051
|
+
const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
|
|
13052
|
+
const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
|
|
13053
|
+
const declaredMigrations = Reflect.get(record, "migrations");
|
|
13054
|
+
if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
|
|
13055
|
+
throw metadataError(id, "migrations must be an array.");
|
|
13056
|
+
const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
|
|
13057
|
+
return {
|
|
13058
|
+
id,
|
|
13059
|
+
minimumCompatibleVersion,
|
|
13060
|
+
...Array.isArray(migrations) ? {
|
|
13061
|
+
migrations: migrations.map((entry, index) => migration(entry, id, index))
|
|
13062
|
+
} : {},
|
|
13063
|
+
version
|
|
13064
|
+
};
|
|
13065
|
+
}, dependencyNames = (manifest) => [
|
|
13066
|
+
Reflect.get(manifest, "dependencies"),
|
|
13067
|
+
Reflect.get(manifest, "optionalDependencies"),
|
|
13068
|
+
Reflect.get(manifest, "devDependencies"),
|
|
13069
|
+
Reflect.get(manifest, "peerDependencies")
|
|
13070
|
+
].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
13071
|
+
const appManifestPath = join24(resolve20(projectRoot), "package.json");
|
|
13072
|
+
const appManifest = manifestAt(appManifestPath);
|
|
13073
|
+
if (!appManifest)
|
|
13074
|
+
return {
|
|
13075
|
+
components: [
|
|
13076
|
+
{
|
|
13077
|
+
id: "@absolutejs/app",
|
|
13078
|
+
minimumCompatibleVersion: 1,
|
|
13079
|
+
version: 1
|
|
13080
|
+
}
|
|
13081
|
+
],
|
|
13082
|
+
sources: []
|
|
13083
|
+
};
|
|
13084
|
+
const appMetadata = localSchemaMetadata(appManifest);
|
|
13085
|
+
const components = [
|
|
13086
|
+
appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
|
|
13087
|
+
];
|
|
13088
|
+
const sources = [
|
|
13089
|
+
{ id: "@absolutejs/app", manifestPath: appManifestPath }
|
|
13090
|
+
];
|
|
13091
|
+
for (const name of dependencyNames(appManifest)) {
|
|
13092
|
+
const manifestPath = packageManifestPath(projectRoot, name);
|
|
13093
|
+
if (!manifestPath)
|
|
13094
|
+
continue;
|
|
13095
|
+
const manifest = manifestAt(manifestPath);
|
|
13096
|
+
if (!manifest)
|
|
13097
|
+
continue;
|
|
13098
|
+
const metadata = localSchemaMetadata(manifest);
|
|
13099
|
+
if (metadata === undefined)
|
|
13100
|
+
continue;
|
|
13101
|
+
components.push(component(name, metadata));
|
|
13102
|
+
sources.push({ id: name, manifestPath });
|
|
13103
|
+
}
|
|
13104
|
+
components.sort((left, right) => left.id.localeCompare(right.id));
|
|
13105
|
+
sources.sort((left, right) => left.id.localeCompare(right.id));
|
|
13106
|
+
resolveSyncLocalSchemaComponents({}, { components });
|
|
13107
|
+
return { components, sources };
|
|
13108
|
+
};
|
|
13109
|
+
var init_syncSchema = __esm(() => {
|
|
13110
|
+
init_client();
|
|
13111
|
+
});
|
|
13112
|
+
|
|
12862
13113
|
// src/build/pwa.ts
|
|
12863
13114
|
import { mkdir as mkdir5, rm as rm4, writeFile as writeFile5 } from "fs/promises";
|
|
12864
|
-
import { dirname as
|
|
13115
|
+
import { dirname as dirname14, join as join25 } from "path";
|
|
12865
13116
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
12866
13117
|
const input = value ?? fallback;
|
|
12867
13118
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -12888,7 +13139,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
12888
13139
|
}
|
|
12889
13140
|
}
|
|
12890
13141
|
return url.pathname;
|
|
12891
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
13142
|
+
}, destinationFor = (buildPath, publicPath) => join25(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
12892
13143
|
clientModule,
|
|
12893
13144
|
manifestPath,
|
|
12894
13145
|
serviceWorkerPath,
|
|
@@ -12900,7 +13151,7 @@ manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
|
12900
13151
|
if (!manifest.isConnected) document.head.append(manifest);
|
|
12901
13152
|
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
12902
13153
|
deferUntilLoad: false${sync ? `,
|
|
12903
|
-
sync: ${JSON.stringify(sync
|
|
13154
|
+
sync: ${JSON.stringify(sync)}` : ""}
|
|
12904
13155
|
});
|
|
12905
13156
|
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
12906
13157
|
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
@@ -12918,6 +13169,7 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12918
13169
|
buildPath,
|
|
12919
13170
|
config,
|
|
12920
13171
|
generatedRoot,
|
|
13172
|
+
projectRoot,
|
|
12921
13173
|
write: write2 = true
|
|
12922
13174
|
}) => {
|
|
12923
13175
|
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
@@ -12933,9 +13185,10 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12933
13185
|
};
|
|
12934
13186
|
if (!write2)
|
|
12935
13187
|
return artifacts;
|
|
13188
|
+
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
12936
13189
|
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
12937
13190
|
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
12938
|
-
await mkdir5(
|
|
13191
|
+
await mkdir5(dirname14(workerDestination), { recursive: true });
|
|
12939
13192
|
await writeFile5(workerDestination, `${pushServiceWorker({
|
|
12940
13193
|
...config.serviceWorker ?? {},
|
|
12941
13194
|
sync: Boolean(config.sync)
|
|
@@ -12944,19 +13197,24 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12944
13197
|
if (config.manifest && manifestPath) {
|
|
12945
13198
|
const { path: _path, ...manifestConfig } = config.manifest;
|
|
12946
13199
|
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
12947
|
-
await mkdir5(
|
|
13200
|
+
await mkdir5(dirname14(manifestDestination), { recursive: true });
|
|
12948
13201
|
await writeFile5(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
12949
13202
|
`);
|
|
12950
13203
|
}
|
|
12951
|
-
const generatedDirectory =
|
|
12952
|
-
const bootstrapEntry =
|
|
13204
|
+
const generatedDirectory = join25(generatedRoot, "pwa");
|
|
13205
|
+
const bootstrapEntry = join25(generatedDirectory, "bootstrap.ts");
|
|
12953
13206
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
12954
13207
|
await mkdir5(generatedDirectory, { recursive: true });
|
|
12955
13208
|
await writeFile5(bootstrapEntry, bootstrapEntrySource({
|
|
12956
13209
|
clientModule,
|
|
12957
13210
|
manifestPath,
|
|
12958
13211
|
serviceWorkerPath,
|
|
12959
|
-
sync: config.sync
|
|
13212
|
+
sync: config.sync ? {
|
|
13213
|
+
...config.sync === true ? {} : config.sync,
|
|
13214
|
+
storageSchema: {
|
|
13215
|
+
components: syncSchema?.components ?? []
|
|
13216
|
+
}
|
|
13217
|
+
} : config.sync
|
|
12960
13218
|
}));
|
|
12961
13219
|
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
12962
13220
|
await rm4(browserDirectory, { force: true, recursive: true });
|
|
@@ -12979,15 +13237,17 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12979
13237
|
}
|
|
12980
13238
|
return artifacts;
|
|
12981
13239
|
};
|
|
12982
|
-
var init_pwa = () => {
|
|
13240
|
+
var init_pwa = __esm(() => {
|
|
13241
|
+
init_syncSchema();
|
|
13242
|
+
});
|
|
12983
13243
|
|
|
12984
13244
|
// src/build/scanVueSsrOnlyPages.ts
|
|
12985
13245
|
var exports_scanVueSsrOnlyPages = {};
|
|
12986
13246
|
__export(exports_scanVueSsrOnlyPages, {
|
|
12987
13247
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
12988
13248
|
});
|
|
12989
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
12990
|
-
import { join as
|
|
13249
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
13250
|
+
import { join as join26 } from "path";
|
|
12991
13251
|
import ts8 from "typescript";
|
|
12992
13252
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
12993
13253
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13020,9 +13280,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13020
13280
|
continue;
|
|
13021
13281
|
if (entry.name.startsWith("."))
|
|
13022
13282
|
continue;
|
|
13023
|
-
stack.push(
|
|
13283
|
+
stack.push(join26(dir, entry.name));
|
|
13024
13284
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
13025
|
-
out.push(
|
|
13285
|
+
out.push(join26(dir, entry.name));
|
|
13026
13286
|
}
|
|
13027
13287
|
}
|
|
13028
13288
|
}
|
|
@@ -13089,7 +13349,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13089
13349
|
}, extractFromFile = (filePath, out) => {
|
|
13090
13350
|
let source;
|
|
13091
13351
|
try {
|
|
13092
|
-
source =
|
|
13352
|
+
source = readFileSync14(filePath, "utf-8");
|
|
13093
13353
|
} catch {
|
|
13094
13354
|
return;
|
|
13095
13355
|
}
|
|
@@ -13133,8 +13393,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13133
13393
|
});
|
|
13134
13394
|
|
|
13135
13395
|
// src/build/scanAngularHandlerCalls.ts
|
|
13136
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
13137
|
-
import { join as
|
|
13396
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync15 } from "fs";
|
|
13397
|
+
import { join as join27 } from "path";
|
|
13138
13398
|
import ts9 from "typescript";
|
|
13139
13399
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13140
13400
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13167,9 +13427,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13167
13427
|
continue;
|
|
13168
13428
|
if (entry.name.startsWith("."))
|
|
13169
13429
|
continue;
|
|
13170
|
-
stack.push(
|
|
13430
|
+
stack.push(join27(dir, entry.name));
|
|
13171
13431
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13172
|
-
out.push(
|
|
13432
|
+
out.push(join27(dir, entry.name));
|
|
13173
13433
|
}
|
|
13174
13434
|
}
|
|
13175
13435
|
}
|
|
@@ -13204,7 +13464,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13204
13464
|
}, extractCallsFromFile = (filePath, out) => {
|
|
13205
13465
|
let source;
|
|
13206
13466
|
try {
|
|
13207
|
-
source =
|
|
13467
|
+
source = readFileSync15(filePath, "utf-8");
|
|
13208
13468
|
} catch {
|
|
13209
13469
|
return;
|
|
13210
13470
|
}
|
|
@@ -13283,8 +13543,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13283
13543
|
});
|
|
13284
13544
|
|
|
13285
13545
|
// src/build/scanAngularPageRoutes.ts
|
|
13286
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
13287
|
-
import { basename as basename9, join as
|
|
13546
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync16 } from "fs";
|
|
13547
|
+
import { basename as basename9, join as join28 } from "path";
|
|
13288
13548
|
import ts10 from "typescript";
|
|
13289
13549
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13290
13550
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13324,9 +13584,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13324
13584
|
continue;
|
|
13325
13585
|
if (entry.name.startsWith("."))
|
|
13326
13586
|
continue;
|
|
13327
|
-
stack.push(
|
|
13587
|
+
stack.push(join28(dir, entry.name));
|
|
13328
13588
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13329
|
-
out.push(
|
|
13589
|
+
out.push(join28(dir, entry.name));
|
|
13330
13590
|
}
|
|
13331
13591
|
}
|
|
13332
13592
|
}
|
|
@@ -13355,7 +13615,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13355
13615
|
for (const file of files) {
|
|
13356
13616
|
let source;
|
|
13357
13617
|
try {
|
|
13358
|
-
source =
|
|
13618
|
+
source = readFileSync16(file, "utf-8");
|
|
13359
13619
|
} catch {
|
|
13360
13620
|
continue;
|
|
13361
13621
|
}
|
|
@@ -13402,8 +13662,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
13402
13662
|
__export(exports_parseAngularConfigImports, {
|
|
13403
13663
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13404
13664
|
});
|
|
13405
|
-
import { existsSync as existsSync20, readFileSync as
|
|
13406
|
-
import { dirname as
|
|
13665
|
+
import { existsSync as existsSync20, readFileSync as readFileSync17 } from "fs";
|
|
13666
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join29 } from "path";
|
|
13407
13667
|
import ts11 from "typescript";
|
|
13408
13668
|
var findDefineConfigCall = (sf) => {
|
|
13409
13669
|
let result = null;
|
|
@@ -13421,8 +13681,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13421
13681
|
};
|
|
13422
13682
|
ts11.forEachChild(sf, visit);
|
|
13423
13683
|
return result;
|
|
13424
|
-
}, findPropertyInitializer = (
|
|
13425
|
-
for (const prop of
|
|
13684
|
+
}, findPropertyInitializer = (object2, name) => {
|
|
13685
|
+
for (const prop of object2.properties) {
|
|
13426
13686
|
if (!ts11.isPropertyAssignment(prop))
|
|
13427
13687
|
continue;
|
|
13428
13688
|
if (!prop.name)
|
|
@@ -13458,15 +13718,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13458
13718
|
}, resolveConfigPath = (projectRoot) => {
|
|
13459
13719
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13460
13720
|
if (envOverride) {
|
|
13461
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
13721
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join29(projectRoot, envOverride);
|
|
13462
13722
|
if (existsSync20(resolved))
|
|
13463
13723
|
return resolved;
|
|
13464
13724
|
}
|
|
13465
13725
|
const candidates = [
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13726
|
+
join29(projectRoot, "absolute.config.ts"),
|
|
13727
|
+
join29(projectRoot, "absolute.config.mts"),
|
|
13728
|
+
join29(projectRoot, "absolute.config.js"),
|
|
13729
|
+
join29(projectRoot, "absolute.config.mjs")
|
|
13470
13730
|
];
|
|
13471
13731
|
for (const candidate of candidates) {
|
|
13472
13732
|
if (existsSync20(candidate))
|
|
@@ -13477,7 +13737,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
13477
13737
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
13478
13738
|
if (!configPath2)
|
|
13479
13739
|
return null;
|
|
13480
|
-
const source =
|
|
13740
|
+
const source = readFileSync17(configPath2, "utf-8");
|
|
13481
13741
|
if (!source.includes("angular"))
|
|
13482
13742
|
return null;
|
|
13483
13743
|
if (!source.includes("providers"))
|
|
@@ -13498,8 +13758,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13498
13758
|
const importInfo = findImportForBinding(sf, binding);
|
|
13499
13759
|
if (!importInfo)
|
|
13500
13760
|
return null;
|
|
13501
|
-
const configDir2 =
|
|
13502
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
13761
|
+
const configDir2 = dirname15(configPath2);
|
|
13762
|
+
const absolutePath = importInfo.source.startsWith(".") ? join29(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
13503
13763
|
return {
|
|
13504
13764
|
absolutePath,
|
|
13505
13765
|
bindingName: binding,
|
|
@@ -13514,8 +13774,8 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13514
13774
|
const componentMatch = attributeString.match(/\bcomponent\s*=\s*["']([^"']+)["']/);
|
|
13515
13775
|
const hydrateMatch = attributeString.match(/\bhydrate\s*=\s*["']([^"']+)["']/);
|
|
13516
13776
|
const framework = frameworkMatch?.[1];
|
|
13517
|
-
const
|
|
13518
|
-
if (!framework || !
|
|
13777
|
+
const component2 = componentMatch?.[1];
|
|
13778
|
+
if (!framework || !component2) {
|
|
13519
13779
|
return null;
|
|
13520
13780
|
}
|
|
13521
13781
|
if (!isIslandFramework2(framework)) {
|
|
@@ -13523,7 +13783,7 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13523
13783
|
}
|
|
13524
13784
|
const hydrateCandidate = hydrateMatch?.[1];
|
|
13525
13785
|
return {
|
|
13526
|
-
component,
|
|
13786
|
+
component: component2,
|
|
13527
13787
|
framework,
|
|
13528
13788
|
hydrate: hydrateCandidate && isIslandHydrate(hydrateCandidate) ? hydrateCandidate : undefined
|
|
13529
13789
|
};
|
|
@@ -13532,12 +13792,12 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13532
13792
|
return;
|
|
13533
13793
|
usageMap.set(normalizeUsage(usage), usage);
|
|
13534
13794
|
}, addRenderCallUsage = (usageMap, match) => {
|
|
13535
|
-
const [, framework,
|
|
13536
|
-
if (!framework || !
|
|
13795
|
+
const [, framework, component2, hydrate] = match;
|
|
13796
|
+
if (!framework || !component2 || !isIslandFramework2(framework)) {
|
|
13537
13797
|
return;
|
|
13538
13798
|
}
|
|
13539
13799
|
addUsage(usageMap, {
|
|
13540
|
-
component,
|
|
13800
|
+
component: component2,
|
|
13541
13801
|
framework,
|
|
13542
13802
|
hydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined
|
|
13543
13803
|
});
|
|
@@ -13591,7 +13851,7 @@ __export(exports_renderToReadableStream, {
|
|
|
13591
13851
|
renderToReadableStream: () => renderToReadableStream,
|
|
13592
13852
|
SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
|
|
13593
13853
|
});
|
|
13594
|
-
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (
|
|
13854
|
+
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
|
|
13595
13855
|
bootstrapScriptContent,
|
|
13596
13856
|
bootstrapScripts = [],
|
|
13597
13857
|
bootstrapModules = [],
|
|
@@ -13605,7 +13865,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
13605
13865
|
try {
|
|
13606
13866
|
const { render } = await import("svelte/server");
|
|
13607
13867
|
const renderComponent = render;
|
|
13608
|
-
const rendered = typeof props === "undefined" ? await renderComponent(
|
|
13868
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
|
|
13609
13869
|
const { head, body } = rendered;
|
|
13610
13870
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
13611
13871
|
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("");
|
|
@@ -13650,11 +13910,11 @@ __export(exports_compileSvelte, {
|
|
|
13650
13910
|
import { existsSync as existsSync21 } from "fs";
|
|
13651
13911
|
import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
|
|
13652
13912
|
import {
|
|
13653
|
-
dirname as
|
|
13654
|
-
join as
|
|
13913
|
+
dirname as dirname16,
|
|
13914
|
+
join as join30,
|
|
13655
13915
|
basename as basename10,
|
|
13656
13916
|
extname as extname7,
|
|
13657
|
-
resolve as
|
|
13917
|
+
resolve as resolve21,
|
|
13658
13918
|
relative as relative11,
|
|
13659
13919
|
sep as sep2
|
|
13660
13920
|
} from "path";
|
|
@@ -13662,14 +13922,14 @@ import { env } from "process";
|
|
|
13662
13922
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13663
13923
|
var resolveDevClientDir2 = () => {
|
|
13664
13924
|
const projectRoot = process.cwd();
|
|
13665
|
-
const fromSource =
|
|
13925
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
13666
13926
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13667
13927
|
return fromSource;
|
|
13668
13928
|
}
|
|
13669
|
-
const fromNodeModules =
|
|
13929
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13670
13930
|
if (existsSync21(fromNodeModules))
|
|
13671
13931
|
return fromNodeModules;
|
|
13672
|
-
return
|
|
13932
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
13673
13933
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13674
13934
|
persistentCache.clear();
|
|
13675
13935
|
sourceHashCache.clear();
|
|
@@ -13699,7 +13959,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13699
13959
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13700
13960
|
if (!spec.startsWith("."))
|
|
13701
13961
|
return null;
|
|
13702
|
-
const basePath =
|
|
13962
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13703
13963
|
const candidates = [
|
|
13704
13964
|
basePath,
|
|
13705
13965
|
`${basePath}.ts`,
|
|
@@ -13710,14 +13970,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13710
13970
|
`${basePath}.svelte`,
|
|
13711
13971
|
`${basePath}.svelte.ts`,
|
|
13712
13972
|
`${basePath}.svelte.js`,
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13973
|
+
join30(basePath, "index.ts"),
|
|
13974
|
+
join30(basePath, "index.js"),
|
|
13975
|
+
join30(basePath, "index.mjs"),
|
|
13976
|
+
join30(basePath, "index.cjs"),
|
|
13977
|
+
join30(basePath, "index.json"),
|
|
13978
|
+
join30(basePath, "index.svelte"),
|
|
13979
|
+
join30(basePath, "index.svelte.ts"),
|
|
13980
|
+
join30(basePath, "index.svelte.js")
|
|
13721
13981
|
];
|
|
13722
13982
|
const checks = await Promise.all(candidates.map(exists));
|
|
13723
13983
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13726,7 +13986,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13726
13986
|
const resolved = resolvePackageImport(spec);
|
|
13727
13987
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13728
13988
|
}
|
|
13729
|
-
const basePath =
|
|
13989
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13730
13990
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13731
13991
|
if (!explicit) {
|
|
13732
13992
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -13756,9 +14016,9 @@ var resolveDevClientDir2 = () => {
|
|
|
13756
14016
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
13757
14017
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
13758
14018
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
13759
|
-
const clientDir =
|
|
13760
|
-
const indexDir =
|
|
13761
|
-
const serverDir =
|
|
14019
|
+
const clientDir = join30(generatedDir, "client");
|
|
14020
|
+
const indexDir = join30(generatedDir, "indexes");
|
|
14021
|
+
const serverDir = join30(generatedDir, "server");
|
|
13762
14022
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir6(dir, { recursive: true })));
|
|
13763
14023
|
const dev = env.NODE_ENV !== "production";
|
|
13764
14024
|
const build = async (src) => {
|
|
@@ -13786,8 +14046,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13786
14046
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
13787
14047
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
13788
14048
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
13789
|
-
const rawRel =
|
|
13790
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(),
|
|
14049
|
+
const rawRel = dirname16(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
14050
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
|
|
13791
14051
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13792
14052
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
13793
14053
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -13796,8 +14056,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13796
14056
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
13797
14057
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
13798
14058
|
const externalRewrites = new Map;
|
|
13799
|
-
const ssrOutputDir =
|
|
13800
|
-
const clientOutputDir =
|
|
14059
|
+
const ssrOutputDir = dirname16(join30(serverDir, relDir, `${baseName}.js`));
|
|
14060
|
+
const clientOutputDir = dirname16(join30(clientDir, relDir, `${baseName}.js`));
|
|
13801
14061
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
13802
14062
|
const rawSpec = importPaths[idx];
|
|
13803
14063
|
if (!rawSpec)
|
|
@@ -13862,11 +14122,11 @@ var resolveDevClientDir2 = () => {
|
|
|
13862
14122
|
code += islandMetadataExports;
|
|
13863
14123
|
return { code, map: compiledJs.map };
|
|
13864
14124
|
};
|
|
13865
|
-
const ssrPath =
|
|
13866
|
-
const clientPath =
|
|
14125
|
+
const ssrPath = join30(serverDir, relDir, `${baseName}.js`);
|
|
14126
|
+
const clientPath = join30(clientDir, relDir, `${baseName}.js`);
|
|
13867
14127
|
await Promise.all([
|
|
13868
|
-
mkdir6(
|
|
13869
|
-
mkdir6(
|
|
14128
|
+
mkdir6(dirname16(ssrPath), { recursive: true }),
|
|
14129
|
+
mkdir6(dirname16(clientPath), { recursive: true })
|
|
13870
14130
|
]);
|
|
13871
14131
|
const inlineMap = (map) => map ? `
|
|
13872
14132
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -13901,10 +14161,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13901
14161
|
const roots = await Promise.all(entryPoints.map(build));
|
|
13902
14162
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
13903
14163
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
13904
|
-
const relClientDir =
|
|
14164
|
+
const relClientDir = dirname16(relative11(clientDir, client));
|
|
13905
14165
|
const name = basename10(client, extname7(client));
|
|
13906
|
-
const indexPath =
|
|
13907
|
-
const importRaw = relative11(
|
|
14166
|
+
const indexPath = join30(indexDir, relClientDir, `${name}.js`);
|
|
14167
|
+
const importRaw = relative11(dirname16(indexPath), client).split(sep2).join("/");
|
|
13908
14168
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
13909
14169
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
13910
14170
|
import "${hmrClientPath3}";
|
|
@@ -13993,14 +14253,14 @@ if (typeof window !== "undefined") {
|
|
|
13993
14253
|
setTimeout(releaseStreamingSlots, 0);
|
|
13994
14254
|
}
|
|
13995
14255
|
}`;
|
|
13996
|
-
await mkdir6(
|
|
14256
|
+
await mkdir6(dirname16(indexPath), { recursive: true });
|
|
13997
14257
|
return write2(indexPath, bootstrap);
|
|
13998
14258
|
}));
|
|
13999
14259
|
return {
|
|
14000
14260
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
14001
14261
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
14002
|
-
const rel =
|
|
14003
|
-
return
|
|
14262
|
+
const rel = dirname16(relative11(clientDir, client));
|
|
14263
|
+
return join30(indexDir, rel, basename10(client));
|
|
14004
14264
|
}),
|
|
14005
14265
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
14006
14266
|
};
|
|
@@ -14015,7 +14275,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
14015
14275
|
init_lowerAwaitSlotSyntax();
|
|
14016
14276
|
init_renderToReadableStream();
|
|
14017
14277
|
devClientDir2 = resolveDevClientDir2();
|
|
14018
|
-
hmrClientPath3 =
|
|
14278
|
+
hmrClientPath3 = join30(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
14019
14279
|
persistentCache = new Map;
|
|
14020
14280
|
sourceHashCache = new Map;
|
|
14021
14281
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -14082,7 +14342,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
14082
14342
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
14083
14343
|
buildLineRemap: () => buildLineRemap
|
|
14084
14344
|
});
|
|
14085
|
-
import { readFileSync as
|
|
14345
|
+
import { readFileSync as readFileSync18, writeFileSync as writeFileSync7 } from "fs";
|
|
14086
14346
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
14087
14347
|
let result = 0;
|
|
14088
14348
|
let shift = 0;
|
|
@@ -14373,7 +14633,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14373
14633
|
version: 3
|
|
14374
14634
|
};
|
|
14375
14635
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
14376
|
-
const text =
|
|
14636
|
+
const text = readFileSync18(bundleFilePath, "utf-8");
|
|
14377
14637
|
const outerMap = extractInlineMap(text);
|
|
14378
14638
|
if (!outerMap)
|
|
14379
14639
|
return;
|
|
@@ -14393,7 +14653,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14393
14653
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
14394
14654
|
let outerMap;
|
|
14395
14655
|
try {
|
|
14396
|
-
outerMap = JSON.parse(
|
|
14656
|
+
outerMap = JSON.parse(readFileSync18(mapFilePath, "utf-8"));
|
|
14397
14657
|
} catch {
|
|
14398
14658
|
return;
|
|
14399
14659
|
}
|
|
@@ -14492,27 +14752,27 @@ __export(exports_compileVue, {
|
|
|
14492
14752
|
compileVue: () => compileVue,
|
|
14493
14753
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14494
14754
|
});
|
|
14495
|
-
import { existsSync as existsSync22, readFileSync as
|
|
14755
|
+
import { existsSync as existsSync22, readFileSync as readFileSync19, realpathSync as realpathSync2 } from "fs";
|
|
14496
14756
|
import { mkdir as mkdir7 } from "fs/promises";
|
|
14497
14757
|
import {
|
|
14498
14758
|
basename as basename11,
|
|
14499
|
-
dirname as
|
|
14759
|
+
dirname as dirname17,
|
|
14500
14760
|
isAbsolute as isAbsolute4,
|
|
14501
|
-
join as
|
|
14761
|
+
join as join31,
|
|
14502
14762
|
relative as relative12,
|
|
14503
|
-
resolve as
|
|
14763
|
+
resolve as resolve22
|
|
14504
14764
|
} from "path";
|
|
14505
14765
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14506
14766
|
var resolveDevClientDir3 = () => {
|
|
14507
14767
|
const projectRoot = process.cwd();
|
|
14508
|
-
const fromSource =
|
|
14768
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
14509
14769
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14510
14770
|
return fromSource;
|
|
14511
14771
|
}
|
|
14512
|
-
const fromNodeModules =
|
|
14772
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14513
14773
|
if (existsSync22(fromNodeModules))
|
|
14514
14774
|
return fromNodeModules;
|
|
14515
|
-
return
|
|
14775
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
14516
14776
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14517
14777
|
scriptCache.clear();
|
|
14518
14778
|
scriptSetupCache.clear();
|
|
@@ -14562,19 +14822,19 @@ var resolveDevClientDir3 = () => {
|
|
|
14562
14822
|
visited.add(resolved);
|
|
14563
14823
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14564
14824
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14565
|
-
const importedPath =
|
|
14825
|
+
const importedPath = resolve22(dirname17(cssFilePath), relPath);
|
|
14566
14826
|
if (!existsSync22(importedPath))
|
|
14567
14827
|
return match;
|
|
14568
|
-
const importedContent =
|
|
14828
|
+
const importedContent = readFileSync19(importedPath, "utf-8");
|
|
14569
14829
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
14570
14830
|
});
|
|
14571
14831
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14572
14832
|
if (helper.endsWith(".ts"))
|
|
14573
|
-
return
|
|
14574
|
-
const direct =
|
|
14833
|
+
return resolve22(sourceDir, helper);
|
|
14834
|
+
const direct = resolve22(sourceDir, `${helper}.ts`);
|
|
14575
14835
|
if (existsSync22(direct))
|
|
14576
14836
|
return direct;
|
|
14577
|
-
const indexed =
|
|
14837
|
+
const indexed = resolve22(sourceDir, helper, "index.ts");
|
|
14578
14838
|
if (existsSync22(indexed))
|
|
14579
14839
|
return indexed;
|
|
14580
14840
|
return direct;
|
|
@@ -14585,15 +14845,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14585
14845
|
return filePath.replace(/\.ts$/, ".js");
|
|
14586
14846
|
if (isStylePath(filePath)) {
|
|
14587
14847
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14588
|
-
return
|
|
14848
|
+
return resolve22(sourceDir, filePath);
|
|
14589
14849
|
}
|
|
14590
14850
|
return filePath;
|
|
14591
14851
|
}
|
|
14592
14852
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14593
|
-
const directTs =
|
|
14853
|
+
const directTs = resolve22(sourceDir, `${filePath}.ts`);
|
|
14594
14854
|
if (existsSync22(directTs))
|
|
14595
14855
|
return `${filePath}.js`;
|
|
14596
|
-
const indexedTs =
|
|
14856
|
+
const indexedTs = resolve22(sourceDir, filePath, "index.ts");
|
|
14597
14857
|
if (existsSync22(indexedTs))
|
|
14598
14858
|
return `${filePath}/index.js`;
|
|
14599
14859
|
}
|
|
@@ -14684,19 +14944,19 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14684
14944
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14685
14945
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14686
14946
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14687
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
14947
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve22(dirname17(sourceFilePath), path));
|
|
14688
14948
|
for (const stylePath of stylePathsImported) {
|
|
14689
14949
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14690
14950
|
}
|
|
14691
14951
|
const childBuildResults = await Promise.all([
|
|
14692
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
14952
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14693
14953
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14694
14954
|
]);
|
|
14695
14955
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
14696
14956
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
14697
14957
|
fs: {
|
|
14698
14958
|
fileExists: existsSync22,
|
|
14699
|
-
readFile: (file3) => existsSync22(file3) ?
|
|
14959
|
+
readFile: (file3) => existsSync22(file3) ? readFileSync19(file3, "utf-8") : undefined,
|
|
14700
14960
|
realpath: realpathSync2
|
|
14701
14961
|
},
|
|
14702
14962
|
id: componentId,
|
|
@@ -14704,7 +14964,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14704
14964
|
sourceMap: true
|
|
14705
14965
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14706
14966
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14707
|
-
const sourceDir =
|
|
14967
|
+
const sourceDir = dirname17(sourceFilePath);
|
|
14708
14968
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14709
14969
|
const packageImportRewrites = new Map;
|
|
14710
14970
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -14749,8 +15009,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14749
15009
|
];
|
|
14750
15010
|
let cssOutputPaths = [];
|
|
14751
15011
|
if (isEntryPoint && allCss.length) {
|
|
14752
|
-
const cssOutputFile =
|
|
14753
|
-
await mkdir7(
|
|
15012
|
+
const cssOutputFile = join31(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15013
|
+
await mkdir7(dirname17(cssOutputFile), { recursive: true });
|
|
14754
15014
|
await write3(cssOutputFile, allCss.join(`
|
|
14755
15015
|
`));
|
|
14756
15016
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -14780,21 +15040,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14780
15040
|
};
|
|
14781
15041
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
14782
15042
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
14783
|
-
const clientOutputPath =
|
|
14784
|
-
const serverOutputPath =
|
|
15043
|
+
const clientOutputPath = join31(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15044
|
+
const serverOutputPath = join31(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
14785
15045
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
14786
15046
|
let result2 = code;
|
|
14787
15047
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
14788
15048
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
14789
|
-
let rel = relative12(
|
|
15049
|
+
let rel = relative12(dirname17(outputPath), targetPath).replace(/\\/g, "/");
|
|
14790
15050
|
if (!rel.startsWith("."))
|
|
14791
15051
|
rel = `./${rel}`;
|
|
14792
15052
|
result2 = result2.replaceAll(bareImport, rel);
|
|
14793
15053
|
}
|
|
14794
15054
|
return result2;
|
|
14795
15055
|
};
|
|
14796
|
-
await mkdir7(
|
|
14797
|
-
await mkdir7(
|
|
15056
|
+
await mkdir7(dirname17(clientOutputPath), { recursive: true });
|
|
15057
|
+
await mkdir7(dirname17(serverOutputPath), { recursive: true });
|
|
14798
15058
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
14799
15059
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
14800
15060
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -14817,7 +15077,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14817
15077
|
serverPath: serverOutputPath,
|
|
14818
15078
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
14819
15079
|
tsHelperPaths: [
|
|
14820
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
15080
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname17(sourceFilePath), helper)),
|
|
14821
15081
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
14822
15082
|
]
|
|
14823
15083
|
};
|
|
@@ -14827,10 +15087,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14827
15087
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
14828
15088
|
const compiler = await loadVueCompiler();
|
|
14829
15089
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
14830
|
-
const clientOutputDir =
|
|
14831
|
-
const indexOutputDir =
|
|
14832
|
-
const serverOutputDir =
|
|
14833
|
-
const cssOutputDir =
|
|
15090
|
+
const clientOutputDir = join31(generatedDir, "client");
|
|
15091
|
+
const indexOutputDir = join31(generatedDir, "indexes");
|
|
15092
|
+
const serverOutputDir = join31(generatedDir, "server");
|
|
15093
|
+
const cssOutputDir = join31(generatedDir, "compiled");
|
|
14834
15094
|
await Promise.all([
|
|
14835
15095
|
mkdir7(clientOutputDir, { recursive: true }),
|
|
14836
15096
|
mkdir7(indexOutputDir, { recursive: true }),
|
|
@@ -14840,7 +15100,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14840
15100
|
const buildCache = new Map;
|
|
14841
15101
|
const allTsHelperPaths = new Set;
|
|
14842
15102
|
const expandSpaRouteChildren = async (entries) => {
|
|
14843
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15103
|
+
const expanded = new Set(entries.map((entry) => resolve22(entry)));
|
|
14844
15104
|
const queue2 = [...expanded];
|
|
14845
15105
|
while (queue2.length > 0) {
|
|
14846
15106
|
const entryPath = queue2.pop();
|
|
@@ -14857,7 +15117,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14857
15117
|
});
|
|
14858
15118
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
14859
15119
|
for (const { importPath } of routes) {
|
|
14860
|
-
const childPath =
|
|
15120
|
+
const childPath = resolve22(dirname17(entryPath), importPath);
|
|
14861
15121
|
if (expanded.has(childPath) || !existsSync22(childPath)) {
|
|
14862
15122
|
continue;
|
|
14863
15123
|
}
|
|
@@ -14869,7 +15129,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14869
15129
|
};
|
|
14870
15130
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
14871
15131
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
14872
|
-
const resolvedEntryPath =
|
|
15132
|
+
const resolvedEntryPath = resolve22(entryPath);
|
|
14873
15133
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
14874
15134
|
client: clientOutputDir,
|
|
14875
15135
|
css: cssOutputDir,
|
|
@@ -14887,16 +15147,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14887
15147
|
};
|
|
14888
15148
|
}
|
|
14889
15149
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
14890
|
-
const indexOutputFile =
|
|
14891
|
-
const clientOutputFile =
|
|
14892
|
-
await mkdir7(
|
|
15150
|
+
const indexOutputFile = join31(indexOutputDir, `${entryBaseName}.js`);
|
|
15151
|
+
const clientOutputFile = join31(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15152
|
+
await mkdir7(dirname17(indexOutputFile), { recursive: true });
|
|
14893
15153
|
const vueHmrImports = isDev2 ? [
|
|
14894
15154
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
14895
15155
|
`import "${hmrClientPath4}";`
|
|
14896
15156
|
] : [];
|
|
14897
15157
|
await write3(indexOutputFile, [
|
|
14898
15158
|
...vueHmrImports,
|
|
14899
|
-
`import Comp, * as PageModule from "${relative12(
|
|
15159
|
+
`import Comp, * as PageModule from "${relative12(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
14900
15160
|
'import { createSSRApp, createApp } from "vue";',
|
|
14901
15161
|
"",
|
|
14902
15162
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -15058,7 +15318,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15058
15318
|
if (!tsPath)
|
|
15059
15319
|
continue;
|
|
15060
15320
|
const sourceCode = await file2(tsPath).text();
|
|
15061
|
-
const helperDir =
|
|
15321
|
+
const helperDir = dirname17(tsPath);
|
|
15062
15322
|
for (const dep of extractImports(sourceCode)) {
|
|
15063
15323
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
15064
15324
|
continue;
|
|
@@ -15077,10 +15337,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15077
15337
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
15078
15338
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
15079
15339
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15080
|
-
const outClientPath =
|
|
15081
|
-
const outServerPath =
|
|
15082
|
-
await mkdir7(
|
|
15083
|
-
await mkdir7(
|
|
15340
|
+
const outClientPath = join31(clientOutputDir, relativeJsPath);
|
|
15341
|
+
const outServerPath = join31(serverOutputDir, relativeJsPath);
|
|
15342
|
+
await mkdir7(dirname17(outClientPath), { recursive: true });
|
|
15343
|
+
await mkdir7(dirname17(outServerPath), { recursive: true });
|
|
15084
15344
|
await write3(outClientPath, withMap);
|
|
15085
15345
|
await write3(outServerPath, withMap);
|
|
15086
15346
|
}));
|
|
@@ -15110,7 +15370,7 @@ var init_compileVue = __esm(() => {
|
|
|
15110
15370
|
init_vueAutoRouterTransform();
|
|
15111
15371
|
init_stylePreprocessor();
|
|
15112
15372
|
devClientDir3 = resolveDevClientDir3();
|
|
15113
|
-
hmrClientPath4 =
|
|
15373
|
+
hmrClientPath4 = join31(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
15114
15374
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
15115
15375
|
scriptCache = new Map;
|
|
15116
15376
|
scriptSetupCache = new Map;
|
|
@@ -15591,8 +15851,8 @@ __export(exports_compileAngular, {
|
|
|
15591
15851
|
compileAngularFile: () => compileAngularFile,
|
|
15592
15852
|
compileAngular: () => compileAngular
|
|
15593
15853
|
});
|
|
15594
|
-
import { existsSync as existsSync23, readFileSync as
|
|
15595
|
-
import { join as
|
|
15854
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20, promises as fs5 } from "fs";
|
|
15855
|
+
import { join as join32, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve23, relative as relative13 } from "path";
|
|
15596
15856
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15597
15857
|
import ts13 from "typescript";
|
|
15598
15858
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -15600,10 +15860,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15600
15860
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
15601
15861
|
}, readTsconfigPathAliases = () => {
|
|
15602
15862
|
try {
|
|
15603
|
-
const configPath2 =
|
|
15863
|
+
const configPath2 = resolve23(process.cwd(), "tsconfig.json");
|
|
15604
15864
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15605
15865
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15606
|
-
const baseUrl =
|
|
15866
|
+
const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15607
15867
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15608
15868
|
return { aliases, baseUrl };
|
|
15609
15869
|
} catch {
|
|
@@ -15623,7 +15883,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15623
15883
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15624
15884
|
for (const replacement of alias.replacements) {
|
|
15625
15885
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15626
|
-
const resolved = resolveSourceFile(
|
|
15886
|
+
const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
|
|
15627
15887
|
if (resolved)
|
|
15628
15888
|
return resolved;
|
|
15629
15889
|
}
|
|
@@ -15635,20 +15895,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15635
15895
|
`${candidate}.tsx`,
|
|
15636
15896
|
`${candidate}.js`,
|
|
15637
15897
|
`${candidate}.jsx`,
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15898
|
+
join32(candidate, "index.ts"),
|
|
15899
|
+
join32(candidate, "index.tsx"),
|
|
15900
|
+
join32(candidate, "index.js"),
|
|
15901
|
+
join32(candidate, "index.jsx")
|
|
15642
15902
|
];
|
|
15643
15903
|
return candidates.find((file3) => existsSync23(file3));
|
|
15644
15904
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15645
|
-
const baseDir =
|
|
15905
|
+
const baseDir = resolve23(rootDir);
|
|
15646
15906
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15647
15907
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15648
15908
|
const scanCache = new Map;
|
|
15649
15909
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15650
15910
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15651
|
-
return resolveSourceFile(
|
|
15911
|
+
return resolveSourceFile(resolve23(fromDir, specifier));
|
|
15652
15912
|
}
|
|
15653
15913
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15654
15914
|
if (aliased)
|
|
@@ -15657,7 +15917,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15657
15917
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15658
15918
|
if (resolved.includes("/node_modules/"))
|
|
15659
15919
|
return;
|
|
15660
|
-
const absolute =
|
|
15920
|
+
const absolute = resolve23(resolved);
|
|
15661
15921
|
if (!absolute.startsWith(baseDir))
|
|
15662
15922
|
return;
|
|
15663
15923
|
return resolveSourceFile(absolute);
|
|
@@ -15673,7 +15933,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15673
15933
|
usesLegacyAnimations: false
|
|
15674
15934
|
});
|
|
15675
15935
|
}
|
|
15676
|
-
const resolved =
|
|
15936
|
+
const resolved = resolve23(actualPath);
|
|
15677
15937
|
const cached = scanCache.get(resolved);
|
|
15678
15938
|
if (cached)
|
|
15679
15939
|
return cached;
|
|
@@ -15702,7 +15962,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15702
15962
|
const actualPath = resolveSourceFile(filePath);
|
|
15703
15963
|
if (!actualPath)
|
|
15704
15964
|
return false;
|
|
15705
|
-
const resolved =
|
|
15965
|
+
const resolved = resolve23(actualPath);
|
|
15706
15966
|
if (visited.has(resolved))
|
|
15707
15967
|
return false;
|
|
15708
15968
|
visited.add(resolved);
|
|
@@ -15710,7 +15970,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15710
15970
|
if (scan.usesLegacyAnimations)
|
|
15711
15971
|
return true;
|
|
15712
15972
|
for (const specifier of scan.imports) {
|
|
15713
|
-
const importedPath = resolveLocalImport(specifier,
|
|
15973
|
+
const importedPath = resolveLocalImport(specifier, dirname18(resolved));
|
|
15714
15974
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15715
15975
|
return true;
|
|
15716
15976
|
}
|
|
@@ -15720,14 +15980,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15720
15980
|
return (entryPath) => visit(entryPath);
|
|
15721
15981
|
}, resolveDevClientDir4 = () => {
|
|
15722
15982
|
const projectRoot = process.cwd();
|
|
15723
|
-
const fromSource =
|
|
15983
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
15724
15984
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15725
15985
|
return fromSource;
|
|
15726
15986
|
}
|
|
15727
|
-
const fromNodeModules =
|
|
15987
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15728
15988
|
if (existsSync23(fromNodeModules))
|
|
15729
15989
|
return fromNodeModules;
|
|
15730
|
-
return
|
|
15990
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
15731
15991
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15732
15992
|
try {
|
|
15733
15993
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -15769,12 +16029,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15769
16029
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
15770
16030
|
if (hasJsLikeExtension(path))
|
|
15771
16031
|
return `${path}${query}`;
|
|
15772
|
-
const importerDir =
|
|
15773
|
-
const fileCandidate =
|
|
16032
|
+
const importerDir = dirname18(importerOutputPath);
|
|
16033
|
+
const fileCandidate = resolve23(importerDir, `${path}.js`);
|
|
15774
16034
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
15775
16035
|
return `${path}.js${query}`;
|
|
15776
16036
|
}
|
|
15777
|
-
const indexCandidate =
|
|
16037
|
+
const indexCandidate = resolve23(importerDir, path, "index.js");
|
|
15778
16038
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
15779
16039
|
return `${path}/index.js${query}`;
|
|
15780
16040
|
}
|
|
@@ -15802,18 +16062,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15802
16062
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
15803
16063
|
if (!isRelativeModuleSpecifier(specifier))
|
|
15804
16064
|
return null;
|
|
15805
|
-
const basePath =
|
|
16065
|
+
const basePath = resolve23(dirname18(fromFile), specifier);
|
|
15806
16066
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
15807
16067
|
`${basePath}.ts`,
|
|
15808
16068
|
`${basePath}.tsx`,
|
|
15809
16069
|
`${basePath}.mts`,
|
|
15810
16070
|
`${basePath}.cts`,
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
|
|
15814
|
-
|
|
16071
|
+
join32(basePath, "index.ts"),
|
|
16072
|
+
join32(basePath, "index.tsx"),
|
|
16073
|
+
join32(basePath, "index.mts"),
|
|
16074
|
+
join32(basePath, "index.cts")
|
|
15815
16075
|
];
|
|
15816
|
-
return candidates.map((candidate) =>
|
|
16076
|
+
return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
15817
16077
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
15818
16078
|
const hostSource = readFile6?.(fileName);
|
|
15819
16079
|
if (typeof hostSource === "string")
|
|
@@ -15837,18 +16097,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15837
16097
|
const paths = [];
|
|
15838
16098
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15839
16099
|
if (templateUrlMatch?.[1])
|
|
15840
|
-
paths.push(
|
|
16100
|
+
paths.push(join32(fileDir, templateUrlMatch[1]));
|
|
15841
16101
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15842
16102
|
if (styleUrlMatch?.[1])
|
|
15843
|
-
paths.push(
|
|
16103
|
+
paths.push(join32(fileDir, styleUrlMatch[1]));
|
|
15844
16104
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
15845
16105
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
15846
16106
|
if (urlMatches) {
|
|
15847
16107
|
for (const urlMatch of urlMatches) {
|
|
15848
|
-
paths.push(
|
|
16108
|
+
paths.push(join32(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
15849
16109
|
}
|
|
15850
16110
|
}
|
|
15851
|
-
return paths.map((path) =>
|
|
16111
|
+
return paths.map((path) => resolve23(path));
|
|
15852
16112
|
}, readResourceCacheFile = async (cachePath) => {
|
|
15853
16113
|
try {
|
|
15854
16114
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -15860,13 +16120,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15860
16120
|
return null;
|
|
15861
16121
|
}
|
|
15862
16122
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
15863
|
-
await fs5.mkdir(
|
|
16123
|
+
await fs5.mkdir(dirname18(cachePath), { recursive: true });
|
|
15864
16124
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
15865
16125
|
source,
|
|
15866
16126
|
version: 1
|
|
15867
16127
|
}), "utf-8");
|
|
15868
16128
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
15869
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
16129
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname18(filePath));
|
|
15870
16130
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
15871
16131
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
15872
16132
|
return `${resourcePath}\x00${content}`;
|
|
@@ -15879,7 +16139,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15879
16139
|
safeStableStringify(stylePreprocessors ?? null)
|
|
15880
16140
|
].join("\x00");
|
|
15881
16141
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
15882
|
-
return
|
|
16142
|
+
return join32(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
15883
16143
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
15884
16144
|
const transformedSources = new Map;
|
|
15885
16145
|
const visited = new Set;
|
|
@@ -15890,7 +16150,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15890
16150
|
transformedFiles: 0
|
|
15891
16151
|
};
|
|
15892
16152
|
const transformFile = async (filePath) => {
|
|
15893
|
-
const resolvedPath =
|
|
16153
|
+
const resolvedPath = resolve23(filePath);
|
|
15894
16154
|
if (visited.has(resolvedPath))
|
|
15895
16155
|
return;
|
|
15896
16156
|
visited.add(resolvedPath);
|
|
@@ -15906,7 +16166,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15906
16166
|
transformedSource = cached.source;
|
|
15907
16167
|
} else {
|
|
15908
16168
|
stats.cacheMisses += 1;
|
|
15909
|
-
const transformed = await inlineResources(source,
|
|
16169
|
+
const transformed = await inlineResources(source, dirname18(resolvedPath), stylePreprocessors);
|
|
15910
16170
|
transformedSource = transformed.source;
|
|
15911
16171
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
15912
16172
|
}
|
|
@@ -15925,18 +16185,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15925
16185
|
return { stats, transformedSources };
|
|
15926
16186
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
15927
16187
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
15928
|
-
const outputPath =
|
|
16188
|
+
const outputPath = resolve23(join32(outDir, relative13(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
15929
16189
|
return [
|
|
15930
16190
|
outputPath,
|
|
15931
|
-
buildIslandMetadataExports(
|
|
16191
|
+
buildIslandMetadataExports(readFileSync20(inputPath, "utf-8"))
|
|
15932
16192
|
];
|
|
15933
16193
|
})), { entries: inputPaths.length });
|
|
15934
16194
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
15935
16195
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
15936
16196
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
15937
16197
|
const tsPath = __require.resolve("typescript");
|
|
15938
|
-
const tsRootDir =
|
|
15939
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16198
|
+
const tsRootDir = dirname18(tsPath);
|
|
16199
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
|
|
15940
16200
|
});
|
|
15941
16201
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
15942
16202
|
const options = {
|
|
@@ -15961,30 +16221,30 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15961
16221
|
options.incremental = false;
|
|
15962
16222
|
options.tsBuildInfoFile = undefined;
|
|
15963
16223
|
options.rootDir = process.cwd();
|
|
15964
|
-
const
|
|
15965
|
-
const originalGetDefaultLibLocation =
|
|
15966
|
-
|
|
15967
|
-
const originalGetDefaultLibFileName =
|
|
15968
|
-
|
|
16224
|
+
const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
|
|
16225
|
+
const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
|
|
16226
|
+
host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
16227
|
+
const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
|
|
16228
|
+
host2.getDefaultLibFileName = (opts) => {
|
|
15969
16229
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
15970
16230
|
return basename12(fileName);
|
|
15971
16231
|
};
|
|
15972
|
-
const originalGetSourceFile =
|
|
15973
|
-
|
|
16232
|
+
const originalGetSourceFile = host2.getSourceFile;
|
|
16233
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
15974
16234
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
15975
|
-
const resolvedPath =
|
|
15976
|
-
return originalGetSourceFile?.call(
|
|
16235
|
+
const resolvedPath = join32(tsLibDir, fileName);
|
|
16236
|
+
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
15977
16237
|
}
|
|
15978
|
-
return originalGetSourceFile?.call(
|
|
16238
|
+
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
15979
16239
|
};
|
|
15980
16240
|
const emitted = {};
|
|
15981
|
-
const resolvedOutDir =
|
|
15982
|
-
|
|
16241
|
+
const resolvedOutDir = resolve23(outDir);
|
|
16242
|
+
host2.writeFile = (fileName, text) => {
|
|
15983
16243
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
15984
16244
|
emitted[relativePath] = text;
|
|
15985
16245
|
};
|
|
15986
|
-
const originalReadFile =
|
|
15987
|
-
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(
|
|
16246
|
+
const originalReadFile = host2.readFile;
|
|
16247
|
+
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
|
|
15988
16248
|
await traceAngularPhase("aot/resource-cache-summary", () => {
|
|
15989
16249
|
return;
|
|
15990
16250
|
}, {
|
|
@@ -15993,43 +16253,43 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15993
16253
|
filesVisited: aotResourceTransformStats.filesVisited,
|
|
15994
16254
|
transformedFiles: aotResourceTransformStats.transformedFiles
|
|
15995
16255
|
});
|
|
15996
|
-
|
|
15997
|
-
const source = originalReadFile ? originalReadFile.call(
|
|
16256
|
+
host2.readFile = (fileName) => {
|
|
16257
|
+
const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
|
|
15998
16258
|
if (typeof source !== "string")
|
|
15999
16259
|
return source;
|
|
16000
16260
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16001
16261
|
return source;
|
|
16002
16262
|
}
|
|
16003
|
-
const resolvedPath =
|
|
16263
|
+
const resolvedPath = resolve23(fileName);
|
|
16004
16264
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16005
16265
|
};
|
|
16006
|
-
const originalGetSourceFileForCompile =
|
|
16007
|
-
|
|
16008
|
-
const source = transformedSources.get(
|
|
16266
|
+
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16267
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16268
|
+
const source = transformedSources.get(resolve23(fileName));
|
|
16009
16269
|
if (source) {
|
|
16010
16270
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
16011
16271
|
}
|
|
16012
|
-
return originalGetSourceFileForCompile?.call(
|
|
16272
|
+
return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
|
|
16013
16273
|
};
|
|
16014
16274
|
let diagnostics;
|
|
16015
16275
|
try {
|
|
16016
16276
|
({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
|
|
16017
16277
|
emitFlags: EmitFlags.Default,
|
|
16018
|
-
host,
|
|
16278
|
+
host: host2,
|
|
16019
16279
|
options,
|
|
16020
16280
|
rootNames: inputPaths
|
|
16021
16281
|
}), { entries: inputPaths.length }));
|
|
16022
16282
|
} finally {
|
|
16023
|
-
|
|
16024
|
-
|
|
16283
|
+
host2.readFile = originalReadFile;
|
|
16284
|
+
host2.getSourceFile = originalGetSourceFileForCompile;
|
|
16025
16285
|
}
|
|
16026
16286
|
await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
|
|
16027
16287
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
16028
16288
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
16029
16289
|
content,
|
|
16030
|
-
target:
|
|
16290
|
+
target: join32(outDir, fileName)
|
|
16031
16291
|
}));
|
|
16032
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16292
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
|
|
16033
16293
|
return rawEntries.map(({ content, target }) => {
|
|
16034
16294
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16035
16295
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16044,17 +16304,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
16044
16304
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16045
16305
|
});
|
|
16046
16306
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16047
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16307
|
+
processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
|
|
16048
16308
|
return { content: processedContent, target };
|
|
16049
16309
|
});
|
|
16050
16310
|
});
|
|
16051
16311
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
16052
|
-
await fs5.mkdir(
|
|
16312
|
+
await fs5.mkdir(dirname18(target), { recursive: true });
|
|
16053
16313
|
await fs5.writeFile(target, content, "utf-8");
|
|
16054
16314
|
})), { outputs: entries.length });
|
|
16055
16315
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16056
16316
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16057
|
-
jitContentCache.delete(
|
|
16317
|
+
jitContentCache.delete(resolve23(filePath));
|
|
16058
16318
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16059
16319
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16060
16320
|
let match;
|
|
@@ -16067,7 +16327,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
16067
16327
|
}
|
|
16068
16328
|
return null;
|
|
16069
16329
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16070
|
-
const sourceEntry =
|
|
16330
|
+
const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
|
|
16071
16331
|
if (existsSync23(sourceEntry)) {
|
|
16072
16332
|
return sourceEntry.replace(/\\/g, "/");
|
|
16073
16333
|
}
|
|
@@ -16204,7 +16464,7 @@ ${fields}
|
|
|
16204
16464
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16205
16465
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16206
16466
|
if (templateUrlMatch?.[1]) {
|
|
16207
|
-
const templatePath =
|
|
16467
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16208
16468
|
if (!existsSync23(templatePath)) {
|
|
16209
16469
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16210
16470
|
}
|
|
@@ -16235,11 +16495,11 @@ ${fields}
|
|
|
16235
16495
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16236
16496
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16237
16497
|
if (templateUrlMatch?.[1]) {
|
|
16238
|
-
const templatePath =
|
|
16498
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16239
16499
|
if (!existsSync23(templatePath)) {
|
|
16240
16500
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16241
16501
|
}
|
|
16242
|
-
const templateRaw2 =
|
|
16502
|
+
const templateRaw2 = readFileSync20(templatePath, "utf-8");
|
|
16243
16503
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
16244
16504
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
16245
16505
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -16272,7 +16532,7 @@ ${fields}
|
|
|
16272
16532
|
return source;
|
|
16273
16533
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16274
16534
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16275
|
-
return readAndEscapeFile(
|
|
16535
|
+
return readAndEscapeFile(join32(fileDir, styleUrl), stylePreprocessors);
|
|
16276
16536
|
});
|
|
16277
16537
|
const results = await Promise.all(stylePromises);
|
|
16278
16538
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16283,7 +16543,7 @@ ${fields}
|
|
|
16283
16543
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16284
16544
|
if (!styleUrlMatch?.[1])
|
|
16285
16545
|
return source;
|
|
16286
|
-
const escaped = await readAndEscapeFile(
|
|
16546
|
+
const escaped = await readAndEscapeFile(join32(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16287
16547
|
if (!escaped)
|
|
16288
16548
|
return source;
|
|
16289
16549
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16357,10 +16617,10 @@ ${fields}
|
|
|
16357
16617
|
return "";
|
|
16358
16618
|
}
|
|
16359
16619
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16360
|
-
const entryPath =
|
|
16620
|
+
const entryPath = resolve23(inputPath);
|
|
16361
16621
|
const allOutputs = [];
|
|
16362
16622
|
const visited = new Set;
|
|
16363
|
-
const baseDir =
|
|
16623
|
+
const baseDir = resolve23(rootDir ?? process.cwd());
|
|
16364
16624
|
let usesLegacyAnimations = false;
|
|
16365
16625
|
const angularTranspiler = new Bun.Transpiler({
|
|
16366
16626
|
loader: "ts",
|
|
@@ -16379,16 +16639,16 @@ ${fields}
|
|
|
16379
16639
|
`${candidate}.js`,
|
|
16380
16640
|
`${candidate}.jsx`,
|
|
16381
16641
|
`${candidate}.json`,
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
|
|
16642
|
+
join32(candidate, "index.ts"),
|
|
16643
|
+
join32(candidate, "index.tsx"),
|
|
16644
|
+
join32(candidate, "index.js"),
|
|
16645
|
+
join32(candidate, "index.jsx")
|
|
16386
16646
|
];
|
|
16387
16647
|
return candidates.find((file3) => existsSync23(file3));
|
|
16388
16648
|
};
|
|
16389
16649
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16390
16650
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16391
|
-
return resolveSourceFile2(
|
|
16651
|
+
return resolveSourceFile2(resolve23(fromDir, specifier));
|
|
16392
16652
|
}
|
|
16393
16653
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16394
16654
|
if (aliased)
|
|
@@ -16397,7 +16657,7 @@ ${fields}
|
|
|
16397
16657
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16398
16658
|
if (resolved.includes("/node_modules/"))
|
|
16399
16659
|
return;
|
|
16400
|
-
const absolute =
|
|
16660
|
+
const absolute = resolve23(resolved);
|
|
16401
16661
|
if (!absolute.startsWith(baseDir))
|
|
16402
16662
|
return;
|
|
16403
16663
|
return resolveSourceFile2(absolute);
|
|
@@ -16406,13 +16666,13 @@ ${fields}
|
|
|
16406
16666
|
}
|
|
16407
16667
|
};
|
|
16408
16668
|
const toOutputPath = (sourcePath) => {
|
|
16409
|
-
const inputDir =
|
|
16669
|
+
const inputDir = dirname18(sourcePath);
|
|
16410
16670
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16411
16671
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16412
|
-
return
|
|
16672
|
+
return join32(inputDir, fileBase);
|
|
16413
16673
|
}
|
|
16414
16674
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16415
|
-
return
|
|
16675
|
+
return join32(outDir, relativeDir, fileBase);
|
|
16416
16676
|
};
|
|
16417
16677
|
const withCacheBuster = (specifier) => {
|
|
16418
16678
|
if (!cacheBuster)
|
|
@@ -16449,21 +16709,21 @@ ${fields}
|
|
|
16449
16709
|
return `${prefix}${dots}`;
|
|
16450
16710
|
return `${prefix}../${dots}`;
|
|
16451
16711
|
});
|
|
16452
|
-
if (
|
|
16712
|
+
if (resolve23(actualPath) === entryPath) {
|
|
16453
16713
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16454
16714
|
}
|
|
16455
16715
|
return processedContent;
|
|
16456
16716
|
};
|
|
16457
16717
|
const transpileFile = async (filePath) => {
|
|
16458
|
-
const resolved =
|
|
16718
|
+
const resolved = resolve23(filePath);
|
|
16459
16719
|
if (visited.has(resolved))
|
|
16460
16720
|
return;
|
|
16461
16721
|
visited.add(resolved);
|
|
16462
16722
|
if (resolved.endsWith(".json") && existsSync23(resolved)) {
|
|
16463
|
-
const inputDir2 =
|
|
16723
|
+
const inputDir2 = dirname18(resolved);
|
|
16464
16724
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16465
|
-
const targetDir2 =
|
|
16466
|
-
const targetPath2 =
|
|
16725
|
+
const targetDir2 = join32(outDir, relativeDir2);
|
|
16726
|
+
const targetPath2 = join32(targetDir2, basename12(resolved));
|
|
16467
16727
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16468
16728
|
await fs5.copyFile(resolved, targetPath2);
|
|
16469
16729
|
allOutputs.push(targetPath2);
|
|
@@ -16475,12 +16735,12 @@ ${fields}
|
|
|
16475
16735
|
if (!existsSync23(actualPath))
|
|
16476
16736
|
return;
|
|
16477
16737
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16478
|
-
const inlined = await inlineResources(sourceCode,
|
|
16479
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16480
|
-
const inputDir =
|
|
16738
|
+
const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
|
|
16739
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname18(actualPath)).source;
|
|
16740
|
+
const inputDir = dirname18(actualPath);
|
|
16481
16741
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16482
16742
|
const targetPath = toOutputPath(actualPath);
|
|
16483
|
-
const targetDir =
|
|
16743
|
+
const targetDir = dirname18(targetPath);
|
|
16484
16744
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16485
16745
|
const localImports = [];
|
|
16486
16746
|
const importRewrites = new Map;
|
|
@@ -16507,7 +16767,7 @@ ${fields}
|
|
|
16507
16767
|
importRewrites.set(specifier, relativeRewrite);
|
|
16508
16768
|
return resolved2;
|
|
16509
16769
|
}).filter((path) => Boolean(path));
|
|
16510
|
-
const isEntry =
|
|
16770
|
+
const isEntry = resolve23(actualPath) === resolve23(entryPath);
|
|
16511
16771
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16512
16772
|
const cacheKey2 = actualPath;
|
|
16513
16773
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -16542,13 +16802,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16542
16802
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16543
16803
|
}
|
|
16544
16804
|
const compiledRoot = compiledParent;
|
|
16545
|
-
const indexesDir =
|
|
16805
|
+
const indexesDir = join32(compiledParent, "indexes");
|
|
16546
16806
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16547
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
16807
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16548
16808
|
if (!hmr) {
|
|
16549
16809
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16550
16810
|
const cwd = process.cwd();
|
|
16551
|
-
const angularSrcDir =
|
|
16811
|
+
const angularSrcDir = resolve23(outRoot);
|
|
16552
16812
|
if (!existsSync23(angularSrcDir))
|
|
16553
16813
|
return;
|
|
16554
16814
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16556,17 +16816,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16556
16816
|
absolute: false,
|
|
16557
16817
|
cwd: angularSrcDir
|
|
16558
16818
|
})) {
|
|
16559
|
-
const sourcePath =
|
|
16819
|
+
const sourcePath = join32(angularSrcDir, rel);
|
|
16560
16820
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16561
|
-
const targetPath =
|
|
16562
|
-
await fs5.mkdir(
|
|
16821
|
+
const targetPath = join32(compiledRoot, cwdRel);
|
|
16822
|
+
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
16563
16823
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16564
16824
|
}
|
|
16565
16825
|
});
|
|
16566
16826
|
}
|
|
16567
16827
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16568
16828
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16569
|
-
const resolvedEntry =
|
|
16829
|
+
const resolvedEntry = resolve23(entry);
|
|
16570
16830
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16571
16831
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16572
16832
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16575,13 +16835,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16575
16835
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16576
16836
|
const jsName = `${fileBase}.js`;
|
|
16577
16837
|
const compiledFallbackPaths = [
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
].map((file3) =>
|
|
16838
|
+
join32(compiledRoot, relativeEntry),
|
|
16839
|
+
join32(compiledRoot, "pages", jsName),
|
|
16840
|
+
join32(compiledRoot, jsName)
|
|
16841
|
+
].map((file3) => resolve23(file3));
|
|
16582
16842
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16583
16843
|
const normalizedCandidates = [
|
|
16584
|
-
...candidatePaths.map((file3) =>
|
|
16844
|
+
...candidatePaths.map((file3) => resolve23(file3)),
|
|
16585
16845
|
...compiledFallbackPaths
|
|
16586
16846
|
];
|
|
16587
16847
|
let candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16628,7 +16888,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16628
16888
|
let providersSourceContent = "";
|
|
16629
16889
|
if (providersInjection.appProvidersSource) {
|
|
16630
16890
|
try {
|
|
16631
|
-
providersSourceContent =
|
|
16891
|
+
providersSourceContent = readFileSync20(providersInjection.appProvidersSource, "utf-8");
|
|
16632
16892
|
} catch {}
|
|
16633
16893
|
}
|
|
16634
16894
|
return JSON.stringify({
|
|
@@ -16639,7 +16899,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16639
16899
|
})() : "no-providers";
|
|
16640
16900
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16641
16901
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16642
|
-
const clientFile =
|
|
16902
|
+
const clientFile = join32(indexesDir, jsName);
|
|
16643
16903
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
16644
16904
|
return {
|
|
16645
16905
|
clientPath: clientFile,
|
|
@@ -16671,13 +16931,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16671
16931
|
const fragments = [];
|
|
16672
16932
|
if (providersInjection.appProvidersSource) {
|
|
16673
16933
|
const compiledAppProvidersPath = (() => {
|
|
16674
|
-
const angularDirAbs =
|
|
16675
|
-
const appSourceAbs =
|
|
16934
|
+
const angularDirAbs = resolve23(outRoot);
|
|
16935
|
+
const appSourceAbs = resolve23(providersInjection.appProvidersSource);
|
|
16676
16936
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16677
|
-
return
|
|
16937
|
+
return join32(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16678
16938
|
})();
|
|
16679
16939
|
const appProvidersSpec = (() => {
|
|
16680
|
-
const rel = relative13(
|
|
16940
|
+
const rel = relative13(dirname18(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16681
16941
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16682
16942
|
})();
|
|
16683
16943
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -16929,7 +17189,7 @@ var init_compileAngular = __esm(() => {
|
|
|
16929
17189
|
init_stylePreprocessor();
|
|
16930
17190
|
init_generatedDir();
|
|
16931
17191
|
devClientDir4 = resolveDevClientDir4();
|
|
16932
|
-
hmrClientPath5 =
|
|
17192
|
+
hmrClientPath5 = join32(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
16933
17193
|
jitContentCache = new Map;
|
|
16934
17194
|
wrapperOutputCache = new Map;
|
|
16935
17195
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17653,8 +17913,8 @@ __export(exports_fastHmrCompiler, {
|
|
|
17653
17913
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
17654
17914
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17655
17915
|
});
|
|
17656
|
-
import { existsSync as existsSync24, readFileSync as
|
|
17657
|
-
import { dirname as
|
|
17916
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21, statSync as statSync2 } from "fs";
|
|
17917
|
+
import { dirname as dirname19, extname as extname8, relative as relative14, resolve as resolve24 } from "path";
|
|
17658
17918
|
import ts17 from "typescript";
|
|
17659
17919
|
var fail = (reason, detail, location) => ({
|
|
17660
17920
|
detail,
|
|
@@ -17784,7 +18044,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17784
18044
|
continue;
|
|
17785
18045
|
const decoratorMeta = readDecoratorMeta(args);
|
|
17786
18046
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
17787
|
-
const componentDir =
|
|
18047
|
+
const componentDir = dirname19(componentFilePath);
|
|
17788
18048
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17789
18049
|
fingerprintCache.set(id, fingerprint);
|
|
17790
18050
|
} else {
|
|
@@ -17969,7 +18229,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17969
18229
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
17970
18230
|
return true;
|
|
17971
18231
|
}
|
|
17972
|
-
const base =
|
|
18232
|
+
const base = resolve24(componentDir, spec);
|
|
17973
18233
|
const candidates = [
|
|
17974
18234
|
`${base}.ts`,
|
|
17975
18235
|
`${base}.tsx`,
|
|
@@ -17981,7 +18241,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17981
18241
|
continue;
|
|
17982
18242
|
let content;
|
|
17983
18243
|
try {
|
|
17984
|
-
content =
|
|
18244
|
+
content = readFileSync21(candidate, "utf-8");
|
|
17985
18245
|
} catch {
|
|
17986
18246
|
continue;
|
|
17987
18247
|
}
|
|
@@ -18267,7 +18527,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18267
18527
|
listeners: {},
|
|
18268
18528
|
properties: {},
|
|
18269
18529
|
specialAttributes: {}
|
|
18270
|
-
}), parseHostObjectInto = (
|
|
18530
|
+
}), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
|
|
18271
18531
|
const hostNode = getProperty(args, "host");
|
|
18272
18532
|
if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
|
|
18273
18533
|
if (!hostExprNode)
|
|
@@ -18291,14 +18551,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18291
18551
|
const propMatch = ATTR_BINDING_RE.exec(key);
|
|
18292
18552
|
const evtMatch = EVENT_BINDING_RE.exec(key);
|
|
18293
18553
|
if (propMatch) {
|
|
18294
|
-
|
|
18554
|
+
host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18295
18555
|
} else if (evtMatch) {
|
|
18296
|
-
|
|
18556
|
+
host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18297
18557
|
} else {
|
|
18298
|
-
|
|
18558
|
+
host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
|
|
18299
18559
|
}
|
|
18300
18560
|
}
|
|
18301
|
-
}, mergeMemberHostDecorators = (
|
|
18561
|
+
}, mergeMemberHostDecorators = (host2, cls) => {
|
|
18302
18562
|
for (const member of cls.members) {
|
|
18303
18563
|
if (!ts17.canHaveDecorators(member))
|
|
18304
18564
|
continue;
|
|
@@ -18318,7 +18578,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18318
18578
|
const propertyName2 = member.name.text;
|
|
18319
18579
|
const [target] = expr.arguments;
|
|
18320
18580
|
const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
|
|
18321
|
-
|
|
18581
|
+
host2.properties[key] = propertyName2;
|
|
18322
18582
|
} else if (functionNode.text === "HostListener") {
|
|
18323
18583
|
if (!ts17.isMethodDeclaration(member))
|
|
18324
18584
|
continue;
|
|
@@ -18336,7 +18596,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18336
18596
|
argsList.push(element.text);
|
|
18337
18597
|
}
|
|
18338
18598
|
}
|
|
18339
|
-
|
|
18599
|
+
host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
18340
18600
|
}
|
|
18341
18601
|
}
|
|
18342
18602
|
}
|
|
@@ -18527,9 +18787,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18527
18787
|
}
|
|
18528
18788
|
return out.length > 0 ? out : null;
|
|
18529
18789
|
}, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
|
|
18530
|
-
const
|
|
18531
|
-
parseHostObjectInto(
|
|
18532
|
-
mergeMemberHostDecorators(
|
|
18790
|
+
const host2 = emptyHost();
|
|
18791
|
+
parseHostObjectInto(host2, decoratorArgs, null, compiler);
|
|
18792
|
+
mergeMemberHostDecorators(host2, cls);
|
|
18533
18793
|
const decoratorQueries = extractDecoratorQueries(cls, compiler);
|
|
18534
18794
|
const signalQueries = extractSignalQueries(cls, compiler);
|
|
18535
18795
|
const contentQueries = [
|
|
@@ -18550,7 +18810,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18550
18810
|
animations,
|
|
18551
18811
|
contentQueries,
|
|
18552
18812
|
exportAs: extractExportAs(decoratorArgs),
|
|
18553
|
-
host,
|
|
18813
|
+
host: host2,
|
|
18554
18814
|
hostDirectives: extractHostDirectives(decoratorArgs, compiler),
|
|
18555
18815
|
providers,
|
|
18556
18816
|
viewProviders,
|
|
@@ -18569,7 +18829,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18569
18829
|
return cached.info;
|
|
18570
18830
|
let source;
|
|
18571
18831
|
try {
|
|
18572
|
-
source =
|
|
18832
|
+
source = readFileSync21(filePath, "utf-8");
|
|
18573
18833
|
} catch {
|
|
18574
18834
|
childComponentInfoCache.set(cacheKey2, {
|
|
18575
18835
|
info: null,
|
|
@@ -18623,7 +18883,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18623
18883
|
return cached.info;
|
|
18624
18884
|
let content;
|
|
18625
18885
|
try {
|
|
18626
|
-
content =
|
|
18886
|
+
content = readFileSync21(dtsPath, "utf-8");
|
|
18627
18887
|
} catch {
|
|
18628
18888
|
childComponentInfoCache.set(cacheKey2, {
|
|
18629
18889
|
info: null,
|
|
@@ -18746,7 +19006,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18746
19006
|
return null;
|
|
18747
19007
|
let content;
|
|
18748
19008
|
try {
|
|
18749
|
-
content =
|
|
19009
|
+
content = readFileSync21(startDtsPath, "utf-8");
|
|
18750
19010
|
} catch {
|
|
18751
19011
|
return null;
|
|
18752
19012
|
}
|
|
@@ -18765,7 +19025,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18765
19025
|
});
|
|
18766
19026
|
if (!names.includes(className))
|
|
18767
19027
|
continue;
|
|
18768
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19028
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18769
19029
|
if (!nextDts)
|
|
18770
19030
|
continue;
|
|
18771
19031
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18775,7 +19035,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18775
19035
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
18776
19036
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
18777
19037
|
const fromPath = item[1] || "";
|
|
18778
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19038
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18779
19039
|
if (!nextDts)
|
|
18780
19040
|
continue;
|
|
18781
19041
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18785,7 +19045,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18785
19045
|
return null;
|
|
18786
19046
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
18787
19047
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
18788
|
-
const base =
|
|
19048
|
+
const base = resolve24(fromDir, stripped);
|
|
18789
19049
|
const candidates = [
|
|
18790
19050
|
`${base}.d.ts`,
|
|
18791
19051
|
`${base}.d.mts`,
|
|
@@ -18809,7 +19069,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18809
19069
|
return null;
|
|
18810
19070
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
18811
19071
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
18812
|
-
const base =
|
|
19072
|
+
const base = resolve24(componentDir, spec);
|
|
18813
19073
|
const candidates = [
|
|
18814
19074
|
`${base}.ts`,
|
|
18815
19075
|
`${base}.tsx`,
|
|
@@ -18964,7 +19224,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18964
19224
|
return cached.hasProviders;
|
|
18965
19225
|
let source;
|
|
18966
19226
|
try {
|
|
18967
|
-
source =
|
|
19227
|
+
source = readFileSync21(filePath, "utf8");
|
|
18968
19228
|
} catch {
|
|
18969
19229
|
return true;
|
|
18970
19230
|
}
|
|
@@ -19028,13 +19288,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19028
19288
|
}
|
|
19029
19289
|
if (!matches)
|
|
19030
19290
|
continue;
|
|
19031
|
-
const resolved =
|
|
19291
|
+
const resolved = resolve24(componentDir, spec);
|
|
19032
19292
|
for (const ext of TS_EXTENSIONS) {
|
|
19033
19293
|
const candidate = resolved + ext;
|
|
19034
19294
|
if (existsSync24(candidate))
|
|
19035
19295
|
return candidate;
|
|
19036
19296
|
}
|
|
19037
|
-
const indexCandidate =
|
|
19297
|
+
const indexCandidate = resolve24(resolved, "index.ts");
|
|
19038
19298
|
if (existsSync24(indexCandidate))
|
|
19039
19299
|
return indexCandidate;
|
|
19040
19300
|
}
|
|
@@ -19272,12 +19532,12 @@ ${transpiled}
|
|
|
19272
19532
|
}
|
|
19273
19533
|
}${staticPatch}`;
|
|
19274
19534
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19275
|
-
const abs =
|
|
19535
|
+
const abs = resolve24(componentDir, url);
|
|
19276
19536
|
if (!existsSync24(abs))
|
|
19277
19537
|
return null;
|
|
19278
19538
|
const ext = extname8(abs).toLowerCase();
|
|
19279
19539
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19280
|
-
return
|
|
19540
|
+
return readFileSync21(abs, "utf8");
|
|
19281
19541
|
}
|
|
19282
19542
|
try {
|
|
19283
19543
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19311,11 +19571,11 @@ ${block}
|
|
|
19311
19571
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19312
19572
|
if (cached !== undefined)
|
|
19313
19573
|
return cached;
|
|
19314
|
-
const tsconfigPath =
|
|
19574
|
+
const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
|
|
19315
19575
|
const opts = {};
|
|
19316
19576
|
if (existsSync24(tsconfigPath)) {
|
|
19317
19577
|
try {
|
|
19318
|
-
const text =
|
|
19578
|
+
const text = readFileSync21(tsconfigPath, "utf8");
|
|
19319
19579
|
const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19320
19580
|
if (!parsed.error && parsed.config) {
|
|
19321
19581
|
const cfg = parsed.config;
|
|
@@ -19349,7 +19609,7 @@ ${block}
|
|
|
19349
19609
|
} catch (err) {
|
|
19350
19610
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19351
19611
|
}
|
|
19352
|
-
const tsSource =
|
|
19612
|
+
const tsSource = readFileSync21(componentFilePath, "utf8");
|
|
19353
19613
|
const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
19354
19614
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19355
19615
|
if (!classNode) {
|
|
@@ -19376,7 +19636,7 @@ ${block}
|
|
|
19376
19636
|
rebootstrapRequired: false
|
|
19377
19637
|
};
|
|
19378
19638
|
}
|
|
19379
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
19639
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname19(componentFilePath), projectRoot)) {
|
|
19380
19640
|
return fail("inherits-decorated-class");
|
|
19381
19641
|
}
|
|
19382
19642
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19388,18 +19648,18 @@ ${block}
|
|
|
19388
19648
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19389
19649
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19390
19650
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19391
|
-
const componentDir =
|
|
19651
|
+
const componentDir = dirname19(componentFilePath);
|
|
19392
19652
|
let templateText;
|
|
19393
19653
|
let templatePath;
|
|
19394
19654
|
if (decoratorMeta.template !== null) {
|
|
19395
19655
|
templateText = decoratorMeta.template;
|
|
19396
19656
|
templatePath = componentFilePath;
|
|
19397
19657
|
} else if (decoratorMeta.templateUrl) {
|
|
19398
|
-
const tplAbs =
|
|
19658
|
+
const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
|
|
19399
19659
|
if (!existsSync24(tplAbs)) {
|
|
19400
19660
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19401
19661
|
}
|
|
19402
|
-
templateText =
|
|
19662
|
+
templateText = readFileSync21(tplAbs, "utf8");
|
|
19403
19663
|
templatePath = tplAbs;
|
|
19404
19664
|
} else {
|
|
19405
19665
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20158,7 +20418,7 @@ __export(exports_compileEmber, {
|
|
|
20158
20418
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
20159
20419
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
20160
20420
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
20161
|
-
dirname: () =>
|
|
20421
|
+
dirname: () => dirname20,
|
|
20162
20422
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
20163
20423
|
compileEmberFile: () => compileEmberFile,
|
|
20164
20424
|
compileEmber: () => compileEmber,
|
|
@@ -20167,7 +20427,7 @@ __export(exports_compileEmber, {
|
|
|
20167
20427
|
});
|
|
20168
20428
|
import { existsSync as existsSync25 } from "fs";
|
|
20169
20429
|
import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
|
|
20170
|
-
import { basename as basename13, dirname as
|
|
20430
|
+
import { basename as basename13, dirname as dirname20, extname as extname9, join as join33, resolve as resolve25 } from "path";
|
|
20171
20431
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
20172
20432
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20173
20433
|
if (cachedPreprocessor)
|
|
@@ -20263,7 +20523,7 @@ export const importSync = (specifier) => {
|
|
|
20263
20523
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20264
20524
|
if (!originalImporter)
|
|
20265
20525
|
return;
|
|
20266
|
-
const candidateBase =
|
|
20526
|
+
const candidateBase = resolve25(dirname20(originalImporter), args.path);
|
|
20267
20527
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20268
20528
|
for (const ext of extensionsToTry) {
|
|
20269
20529
|
const candidate = candidateBase + ext;
|
|
@@ -20286,7 +20546,7 @@ export const importSync = (specifier) => {
|
|
|
20286
20546
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20287
20547
|
if (standalonePackages.has(args.path))
|
|
20288
20548
|
return;
|
|
20289
|
-
const internal =
|
|
20549
|
+
const internal = join33(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20290
20550
|
if (existsSync25(internal))
|
|
20291
20551
|
return { path: internal };
|
|
20292
20552
|
return;
|
|
@@ -20322,7 +20582,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20322
20582
|
export { PageComponent };
|
|
20323
20583
|
export default PageComponent;
|
|
20324
20584
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20325
|
-
const resolvedEntry =
|
|
20585
|
+
const resolvedEntry = resolve25(entry);
|
|
20326
20586
|
const source = await file3(resolvedEntry).text();
|
|
20327
20587
|
let preprocessed = source;
|
|
20328
20588
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20334,16 +20594,16 @@ export default PageComponent;
|
|
|
20334
20594
|
}
|
|
20335
20595
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20336
20596
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20337
|
-
const tmpDir =
|
|
20338
|
-
const serverDir =
|
|
20339
|
-
const clientDir =
|
|
20597
|
+
const tmpDir = join33(compiledRoot, "_tmp");
|
|
20598
|
+
const serverDir = join33(compiledRoot, "server");
|
|
20599
|
+
const clientDir = join33(compiledRoot, "client");
|
|
20340
20600
|
await Promise.all([
|
|
20341
20601
|
mkdir8(tmpDir, { recursive: true }),
|
|
20342
20602
|
mkdir8(serverDir, { recursive: true }),
|
|
20343
20603
|
mkdir8(clientDir, { recursive: true })
|
|
20344
20604
|
]);
|
|
20345
|
-
const tmpPagePath =
|
|
20346
|
-
const tmpHarnessPath =
|
|
20605
|
+
const tmpPagePath = resolve25(join33(tmpDir, `${baseName}.module.js`));
|
|
20606
|
+
const tmpHarnessPath = resolve25(join33(tmpDir, `${baseName}.harness.js`));
|
|
20347
20607
|
await Promise.all([
|
|
20348
20608
|
write4(tmpPagePath, transpiled),
|
|
20349
20609
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20351,7 +20611,7 @@ export default PageComponent;
|
|
|
20351
20611
|
const stagedSourceMap = new Map([
|
|
20352
20612
|
[tmpPagePath, resolvedEntry]
|
|
20353
20613
|
]);
|
|
20354
|
-
const serverPath =
|
|
20614
|
+
const serverPath = join33(serverDir, `${baseName}.js`);
|
|
20355
20615
|
const buildResult = await bunBuild2({
|
|
20356
20616
|
entrypoints: [tmpHarnessPath],
|
|
20357
20617
|
format: "esm",
|
|
@@ -20368,7 +20628,7 @@ export default PageComponent;
|
|
|
20368
20628
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20369
20629
|
}
|
|
20370
20630
|
await rm5(tmpDir, { force: true, recursive: true });
|
|
20371
|
-
const clientPath =
|
|
20631
|
+
const clientPath = join33(clientDir, `${baseName}.js`);
|
|
20372
20632
|
await write4(clientPath, transpiled);
|
|
20373
20633
|
return { clientPath, serverPath };
|
|
20374
20634
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20385,7 +20645,7 @@ export default PageComponent;
|
|
|
20385
20645
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20386
20646
|
};
|
|
20387
20647
|
}, compileEmberFileSource = async (entry) => {
|
|
20388
|
-
const resolvedEntry =
|
|
20648
|
+
const resolvedEntry = resolve25(entry);
|
|
20389
20649
|
const source = await file3(resolvedEntry).text();
|
|
20390
20650
|
let preprocessed = source;
|
|
20391
20651
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20396,7 +20656,7 @@ export default PageComponent;
|
|
|
20396
20656
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20397
20657
|
}
|
|
20398
20658
|
return transpiler5.transformSync(preprocessed);
|
|
20399
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
20659
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "client");
|
|
20400
20660
|
var init_compileEmber = __esm(() => {
|
|
20401
20661
|
init_generatedDir();
|
|
20402
20662
|
transpiler5 = new Transpiler4({
|
|
@@ -20418,24 +20678,24 @@ __export(exports_buildReactVendor, {
|
|
|
20418
20678
|
buildReactVendor: () => buildReactVendor
|
|
20419
20679
|
});
|
|
20420
20680
|
import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
|
|
20421
|
-
import { join as
|
|
20681
|
+
import { join as join34, resolve as resolve26 } from "path";
|
|
20422
20682
|
import { rm as rm6 } from "fs/promises";
|
|
20423
20683
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20424
20684
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20425
20685
|
const candidates = [
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20686
|
+
resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
20687
|
+
resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20688
|
+
resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
20689
|
+
resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20690
|
+
resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
20691
|
+
resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20432
20692
|
];
|
|
20433
20693
|
for (const candidate of candidates) {
|
|
20434
20694
|
if (existsSync26(candidate)) {
|
|
20435
20695
|
return candidate.replace(/\\/g, "/");
|
|
20436
20696
|
}
|
|
20437
20697
|
}
|
|
20438
|
-
return (candidates[0] ??
|
|
20698
|
+
return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20439
20699
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20440
20700
|
const paths = {};
|
|
20441
20701
|
for (const specifier of reactSpecifiers) {
|
|
@@ -20468,14 +20728,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20468
20728
|
`)}
|
|
20469
20729
|
`;
|
|
20470
20730
|
}, buildReactVendor = async (buildDir) => {
|
|
20471
|
-
const vendorDir =
|
|
20731
|
+
const vendorDir = join34(buildDir, "react", "vendor");
|
|
20472
20732
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20473
|
-
const tmpDir =
|
|
20733
|
+
const tmpDir = join34(buildDir, "_vendor_tmp");
|
|
20474
20734
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20475
20735
|
const specifiers = reactSpecifiers;
|
|
20476
20736
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20477
20737
|
const safeName = toSafeFileName(specifier);
|
|
20478
|
-
const entryPath =
|
|
20738
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
20479
20739
|
const source = await generateEntrySource(specifier);
|
|
20480
20740
|
await Bun.write(entryPath, source);
|
|
20481
20741
|
return entryPath;
|
|
@@ -20543,7 +20803,7 @@ __export(exports_buildAngularVendor, {
|
|
|
20543
20803
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20544
20804
|
});
|
|
20545
20805
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20546
|
-
import { join as
|
|
20806
|
+
import { join as join35 } from "path";
|
|
20547
20807
|
import { rm as rm7 } from "fs/promises";
|
|
20548
20808
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20549
20809
|
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) => {
|
|
@@ -20580,7 +20840,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20580
20840
|
}
|
|
20581
20841
|
return { angular, transitiveRoots };
|
|
20582
20842
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
20583
|
-
const { readFileSync:
|
|
20843
|
+
const { readFileSync: readFileSync22 } = await import("fs");
|
|
20584
20844
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
20585
20845
|
const visited = new Set;
|
|
20586
20846
|
const frontier = [];
|
|
@@ -20601,7 +20861,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20601
20861
|
}
|
|
20602
20862
|
let content;
|
|
20603
20863
|
try {
|
|
20604
|
-
content =
|
|
20864
|
+
content = readFileSync22(resolved, "utf-8");
|
|
20605
20865
|
} catch {
|
|
20606
20866
|
continue;
|
|
20607
20867
|
}
|
|
@@ -20640,14 +20900,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20640
20900
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20641
20901
|
return Array.from(angular).filter(isResolvable);
|
|
20642
20902
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20643
|
-
const vendorDir =
|
|
20903
|
+
const vendorDir = join35(buildDir, "angular", "vendor");
|
|
20644
20904
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20645
|
-
const tmpDir =
|
|
20905
|
+
const tmpDir = join35(buildDir, "_angular_vendor_tmp");
|
|
20646
20906
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20647
20907
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20648
20908
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20649
20909
|
const safeName = toSafeFileName2(specifier);
|
|
20650
|
-
const entryPath =
|
|
20910
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20651
20911
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20652
20912
|
return entryPath;
|
|
20653
20913
|
}));
|
|
@@ -20678,9 +20938,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20678
20938
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20679
20939
|
return computeAngularVendorPaths(specifiers);
|
|
20680
20940
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20681
|
-
const vendorDir =
|
|
20941
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20682
20942
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20683
|
-
const tmpDir =
|
|
20943
|
+
const tmpDir = join35(buildDir, "_angular_server_vendor_tmp");
|
|
20684
20944
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20685
20945
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20686
20946
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20691,7 +20951,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20691
20951
|
const specifiers = Array.from(allSpecs);
|
|
20692
20952
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20693
20953
|
const safeName = toSafeFileName2(specifier);
|
|
20694
|
-
const entryPath =
|
|
20954
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20695
20955
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20696
20956
|
return entryPath;
|
|
20697
20957
|
}));
|
|
@@ -20713,9 +20973,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20713
20973
|
return specifiers;
|
|
20714
20974
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20715
20975
|
const paths = {};
|
|
20716
|
-
const vendorDir =
|
|
20976
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20717
20977
|
for (const specifier of specifiers) {
|
|
20718
|
-
paths[specifier] =
|
|
20978
|
+
paths[specifier] = join35(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20719
20979
|
}
|
|
20720
20980
|
return paths;
|
|
20721
20981
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -20771,17 +21031,17 @@ __export(exports_buildVueVendor, {
|
|
|
20771
21031
|
buildVueVendor: () => buildVueVendor
|
|
20772
21032
|
});
|
|
20773
21033
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
20774
|
-
import { join as
|
|
21034
|
+
import { join as join36 } from "path";
|
|
20775
21035
|
import { rm as rm8 } from "fs/promises";
|
|
20776
21036
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
20777
21037
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
20778
|
-
const vendorDir =
|
|
21038
|
+
const vendorDir = join36(buildDir, "vue", "vendor");
|
|
20779
21039
|
mkdirSync10(vendorDir, { recursive: true });
|
|
20780
|
-
const tmpDir =
|
|
21040
|
+
const tmpDir = join36(buildDir, "_vue_vendor_tmp");
|
|
20781
21041
|
mkdirSync10(tmpDir, { recursive: true });
|
|
20782
21042
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
20783
21043
|
const safeName = toSafeFileName3(specifier);
|
|
20784
|
-
const entryPath =
|
|
21044
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
20785
21045
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20786
21046
|
`);
|
|
20787
21047
|
return entryPath;
|
|
@@ -20806,11 +21066,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20806
21066
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
20807
21067
|
return;
|
|
20808
21068
|
}
|
|
20809
|
-
const { readFileSync:
|
|
21069
|
+
const { readFileSync: readFileSync22, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
|
|
20810
21070
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
20811
21071
|
for (const file4 of files) {
|
|
20812
|
-
const filePath =
|
|
20813
|
-
const content =
|
|
21072
|
+
const filePath = join36(vendorDir, file4);
|
|
21073
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
20814
21074
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
20815
21075
|
continue;
|
|
20816
21076
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -20836,7 +21096,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
20836
21096
|
buildSvelteVendor: () => buildSvelteVendor
|
|
20837
21097
|
});
|
|
20838
21098
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
20839
|
-
import { join as
|
|
21099
|
+
import { join as join37 } from "path";
|
|
20840
21100
|
import { rm as rm9 } from "fs/promises";
|
|
20841
21101
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
20842
21102
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -20850,13 +21110,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20850
21110
|
const specifiers = resolveVendorSpecifiers();
|
|
20851
21111
|
if (specifiers.length === 0)
|
|
20852
21112
|
return;
|
|
20853
|
-
const vendorDir =
|
|
21113
|
+
const vendorDir = join37(buildDir, "svelte", "vendor");
|
|
20854
21114
|
mkdirSync11(vendorDir, { recursive: true });
|
|
20855
|
-
const tmpDir =
|
|
21115
|
+
const tmpDir = join37(buildDir, "_svelte_vendor_tmp");
|
|
20856
21116
|
mkdirSync11(tmpDir, { recursive: true });
|
|
20857
21117
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20858
21118
|
const safeName = toSafeFileName4(specifier);
|
|
20859
|
-
const entryPath =
|
|
21119
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
20860
21120
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20861
21121
|
`);
|
|
20862
21122
|
return entryPath;
|
|
@@ -20901,13 +21161,13 @@ import {
|
|
|
20901
21161
|
existsSync as existsSync27,
|
|
20902
21162
|
mkdirSync as mkdirSync12,
|
|
20903
21163
|
readdirSync as readdirSync5,
|
|
20904
|
-
readFileSync as
|
|
21164
|
+
readFileSync as readFileSync22,
|
|
20905
21165
|
renameSync,
|
|
20906
21166
|
rmSync as rmSync2,
|
|
20907
21167
|
statSync as statSync3,
|
|
20908
21168
|
writeFileSync as writeFileSync8
|
|
20909
21169
|
} from "fs";
|
|
20910
|
-
import { basename as basename14, dirname as
|
|
21170
|
+
import { basename as basename14, dirname as dirname21, extname as extname10, join as join38, relative as relative15, resolve as resolve27 } from "path";
|
|
20911
21171
|
import { cwd, env as env2, exit } from "process";
|
|
20912
21172
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
20913
21173
|
var isBuildTraceEnabled = () => {
|
|
@@ -20990,7 +21250,7 @@ var isBuildTraceEnabled = () => {
|
|
|
20990
21250
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
20991
21251
|
let content;
|
|
20992
21252
|
try {
|
|
20993
|
-
content =
|
|
21253
|
+
content = readFileSync22(path, "utf-8");
|
|
20994
21254
|
} catch {
|
|
20995
21255
|
return [];
|
|
20996
21256
|
}
|
|
@@ -21041,8 +21301,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21041
21301
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
21042
21302
|
const glob = new Glob8("htmx*.min.js");
|
|
21043
21303
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
21044
|
-
const src =
|
|
21045
|
-
const dest =
|
|
21304
|
+
const src = join38(htmxDir, relPath);
|
|
21305
|
+
const dest = join38(htmxDestDir, "htmx.min.js");
|
|
21046
21306
|
copyFileSync2(src, dest);
|
|
21047
21307
|
return;
|
|
21048
21308
|
}
|
|
@@ -21054,8 +21314,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21054
21314
|
}
|
|
21055
21315
|
}, resolveAbsoluteVersion = async () => {
|
|
21056
21316
|
const candidates = [
|
|
21057
|
-
|
|
21058
|
-
|
|
21317
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
21318
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
21059
21319
|
];
|
|
21060
21320
|
const resolveCandidate = async (remaining) => {
|
|
21061
21321
|
const [candidate, ...rest] = remaining;
|
|
@@ -21071,7 +21331,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21071
21331
|
};
|
|
21072
21332
|
await resolveCandidate(candidates);
|
|
21073
21333
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
21074
|
-
const absPath =
|
|
21334
|
+
const absPath = resolve27(file4, "..", relPath);
|
|
21075
21335
|
try {
|
|
21076
21336
|
statSync3(absPath);
|
|
21077
21337
|
workerPaths.add(absPath);
|
|
@@ -21086,7 +21346,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21086
21346
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
21087
21347
|
}
|
|
21088
21348
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
21089
|
-
const content =
|
|
21349
|
+
const content = readFileSync22(file4, "utf-8");
|
|
21090
21350
|
for (const pattern of patterns) {
|
|
21091
21351
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
21092
21352
|
}
|
|
@@ -21119,7 +21379,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21119
21379
|
vuePagesPath
|
|
21120
21380
|
}) => {
|
|
21121
21381
|
const { readdirSync: readDir } = await import("fs");
|
|
21122
|
-
const devIndexDir =
|
|
21382
|
+
const devIndexDir = join38(buildPath, "_src_indexes");
|
|
21123
21383
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
21124
21384
|
if (reactIndexesPath && reactPagesPath) {
|
|
21125
21385
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -21135,37 +21395,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21135
21395
|
return;
|
|
21136
21396
|
}
|
|
21137
21397
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
21138
|
-
const pagesRel = relative15(process.cwd(),
|
|
21398
|
+
const pagesRel = relative15(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
|
|
21139
21399
|
for (const file4 of indexFiles) {
|
|
21140
|
-
let content =
|
|
21400
|
+
let content = readFileSync22(join38(reactIndexesPath, file4), "utf-8");
|
|
21141
21401
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
21142
|
-
writeFileSync8(
|
|
21402
|
+
writeFileSync8(join38(devIndexDir, file4), content);
|
|
21143
21403
|
}
|
|
21144
21404
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21145
|
-
const svelteIndexDir =
|
|
21146
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
21405
|
+
const svelteIndexDir = join38(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21406
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
|
|
21147
21407
|
for (const entry of sveltePageEntries) {
|
|
21148
21408
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21149
|
-
const indexFile =
|
|
21409
|
+
const indexFile = join38(svelteIndexDir, "pages", `${name}.js`);
|
|
21150
21410
|
if (!existsSync27(indexFile))
|
|
21151
21411
|
continue;
|
|
21152
|
-
let content =
|
|
21153
|
-
const srcRel = relative15(process.cwd(),
|
|
21412
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21413
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
21154
21414
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21155
|
-
writeFileSync8(
|
|
21415
|
+
writeFileSync8(join38(devIndexDir, `${name}.svelte.js`), content);
|
|
21156
21416
|
}
|
|
21157
21417
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21158
|
-
const vueIndexDir =
|
|
21159
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
21418
|
+
const vueIndexDir = join38(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21419
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
|
|
21160
21420
|
for (const entry of vuePageEntries) {
|
|
21161
21421
|
const name = basename14(entry, ".vue");
|
|
21162
|
-
const indexFile =
|
|
21422
|
+
const indexFile = join38(vueIndexDir, `${name}.js`);
|
|
21163
21423
|
if (!existsSync27(indexFile))
|
|
21164
21424
|
continue;
|
|
21165
|
-
let content =
|
|
21166
|
-
const srcRel = relative15(process.cwd(),
|
|
21425
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21426
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
21167
21427
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
21168
|
-
writeFileSync8(
|
|
21428
|
+
writeFileSync8(join38(devIndexDir, `${name}.vue.js`), content);
|
|
21169
21429
|
}
|
|
21170
21430
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
21171
21431
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21176,7 +21436,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21176
21436
|
const last = allComments[allComments.length - 1];
|
|
21177
21437
|
if (!last?.[1])
|
|
21178
21438
|
return JSON.stringify(outputPath);
|
|
21179
|
-
const srcPath =
|
|
21439
|
+
const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21180
21440
|
return JSON.stringify(srcPath);
|
|
21181
21441
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21182
21442
|
let depth = 0;
|
|
@@ -21213,7 +21473,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21213
21473
|
}
|
|
21214
21474
|
return result;
|
|
21215
21475
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
21216
|
-
let content =
|
|
21476
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21217
21477
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
21218
21478
|
const useNames = [];
|
|
21219
21479
|
let match;
|
|
@@ -21263,7 +21523,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21263
21523
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
21264
21524
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
21265
21525
|
for (const outputPath of outputPaths) {
|
|
21266
|
-
let content =
|
|
21526
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21267
21527
|
let changed = false;
|
|
21268
21528
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
21269
21529
|
const targetName = basename14(relPath);
|
|
@@ -21403,10 +21663,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21403
21663
|
restoreTracePhase();
|
|
21404
21664
|
return;
|
|
21405
21665
|
}
|
|
21406
|
-
const traceDir =
|
|
21666
|
+
const traceDir = join38(buildPath2, ".absolute-trace");
|
|
21407
21667
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21408
21668
|
mkdirSync12(traceDir, { recursive: true });
|
|
21409
|
-
writeFileSync8(
|
|
21669
|
+
writeFileSync8(join38(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21410
21670
|
events: traceEvents,
|
|
21411
21671
|
frameworks: traceFrameworkNames,
|
|
21412
21672
|
generatedAt: new Date().toISOString(),
|
|
@@ -21437,16 +21697,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21437
21697
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21438
21698
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21439
21699
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
21440
|
-
const reactIndexesPath = reactDir &&
|
|
21441
|
-
const reactPagesPath = reactDir &&
|
|
21442
|
-
const htmlPagesPath = htmlDir &&
|
|
21443
|
-
const htmlScriptsPath = htmlDir &&
|
|
21444
|
-
const sveltePagesPath = svelteDir &&
|
|
21445
|
-
const vuePagesPath = vueDir &&
|
|
21446
|
-
const htmxPagesPath = htmxDir &&
|
|
21447
|
-
const htmxScriptsPath = htmxDir &&
|
|
21448
|
-
const angularPagesPath = angularDir &&
|
|
21449
|
-
const emberPagesPath = emberDir &&
|
|
21700
|
+
const reactIndexesPath = reactDir && join38(getFrameworkGeneratedDir("react"), "indexes");
|
|
21701
|
+
const reactPagesPath = reactDir && join38(reactDir, "pages");
|
|
21702
|
+
const htmlPagesPath = htmlDir && join38(htmlDir, "pages");
|
|
21703
|
+
const htmlScriptsPath = htmlDir && join38(htmlDir, "scripts");
|
|
21704
|
+
const sveltePagesPath = svelteDir && join38(svelteDir, "pages");
|
|
21705
|
+
const vuePagesPath = vueDir && join38(vueDir, "pages");
|
|
21706
|
+
const htmxPagesPath = htmxDir && join38(htmxDir, "pages");
|
|
21707
|
+
const htmxScriptsPath = htmxDir && join38(htmxDir, "scripts");
|
|
21708
|
+
const angularPagesPath = angularDir && join38(angularDir, "pages");
|
|
21709
|
+
const emberPagesPath = emberDir && join38(emberDir, "pages");
|
|
21450
21710
|
const frontends = [
|
|
21451
21711
|
reactDir,
|
|
21452
21712
|
htmlDir,
|
|
@@ -21479,7 +21739,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21479
21739
|
const sourceClientRoots = [
|
|
21480
21740
|
htmlDir,
|
|
21481
21741
|
htmxDir,
|
|
21482
|
-
islandBootstrapPath &&
|
|
21742
|
+
islandBootstrapPath && dirname21(islandBootstrapPath)
|
|
21483
21743
|
].filter((dir) => Boolean(dir));
|
|
21484
21744
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21485
21745
|
if (usesGenerated)
|
|
@@ -21507,8 +21767,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21507
21767
|
const [firstEntry] = serverDirMap;
|
|
21508
21768
|
if (!firstEntry)
|
|
21509
21769
|
throw new Error("Expected at least one server directory entry");
|
|
21510
|
-
serverRoot =
|
|
21511
|
-
serverOutDir =
|
|
21770
|
+
serverRoot = join38(firstEntry.dir, firstEntry.subdir);
|
|
21771
|
+
serverOutDir = join38(buildPath, basename14(firstEntry.dir));
|
|
21512
21772
|
} else if (serverDirMap.length > 1) {
|
|
21513
21773
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21514
21774
|
serverOutDir = buildPath;
|
|
@@ -21521,18 +21781,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21521
21781
|
buildPath,
|
|
21522
21782
|
config: pwa,
|
|
21523
21783
|
generatedRoot,
|
|
21784
|
+
projectRoot,
|
|
21524
21785
|
write: !isIncremental
|
|
21525
21786
|
})) : undefined;
|
|
21526
21787
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21527
21788
|
if (!isIncremental || !incrementalFiles)
|
|
21528
21789
|
return entryPoints;
|
|
21529
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
21790
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
|
|
21530
21791
|
const matchingEntries = [];
|
|
21531
21792
|
for (const entry of entryPoints) {
|
|
21532
21793
|
const sourceFile = mapToSource(entry);
|
|
21533
21794
|
if (!sourceFile)
|
|
21534
21795
|
continue;
|
|
21535
|
-
if (!normalizedIncremental.has(
|
|
21796
|
+
if (!normalizedIncremental.has(resolve27(sourceFile)))
|
|
21536
21797
|
continue;
|
|
21537
21798
|
matchingEntries.push(entry);
|
|
21538
21799
|
}
|
|
@@ -21542,7 +21803,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21542
21803
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21543
21804
|
}
|
|
21544
21805
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21545
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
21806
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join38(buildPath, "assets"), {
|
|
21546
21807
|
force: true,
|
|
21547
21808
|
recursive: true
|
|
21548
21809
|
}));
|
|
@@ -21656,11 +21917,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21656
21917
|
}
|
|
21657
21918
|
}
|
|
21658
21919
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21659
|
-
const htmlConventionsOutDir =
|
|
21920
|
+
const htmlConventionsOutDir = join38(buildPath, "conventions", "html");
|
|
21660
21921
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21661
21922
|
const htmlPathRemap = new Map;
|
|
21662
21923
|
for (const sourcePath of htmlConventionSources) {
|
|
21663
|
-
const dest =
|
|
21924
|
+
const dest = join38(htmlConventionsOutDir, basename14(sourcePath));
|
|
21664
21925
|
cpSync(sourcePath, dest, { force: true });
|
|
21665
21926
|
htmlPathRemap.set(sourcePath, dest);
|
|
21666
21927
|
}
|
|
@@ -21701,9 +21962,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21701
21962
|
}
|
|
21702
21963
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21703
21964
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21704
|
-
if (entry.startsWith(
|
|
21965
|
+
if (entry.startsWith(resolve27(reactIndexesPath))) {
|
|
21705
21966
|
const pageName = basename14(entry, ".tsx");
|
|
21706
|
-
return
|
|
21967
|
+
return join38(reactPagesPath, `${pageName}.tsx`);
|
|
21707
21968
|
}
|
|
21708
21969
|
return null;
|
|
21709
21970
|
}) : allReactEntries;
|
|
@@ -21735,7 +21996,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21735
21996
|
for (const entry of vueEntries) {
|
|
21736
21997
|
const name = basename14(entry, ".vue");
|
|
21737
21998
|
if (ssrOnlyPageNames.has(name)) {
|
|
21738
|
-
resolved.add(
|
|
21999
|
+
resolved.add(resolve27(entry));
|
|
21739
22000
|
}
|
|
21740
22001
|
}
|
|
21741
22002
|
return resolved;
|
|
@@ -21872,7 +22133,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21872
22133
|
const clientPath = islandSvelteClientPaths[idx];
|
|
21873
22134
|
if (!sourcePath || !clientPath)
|
|
21874
22135
|
continue;
|
|
21875
|
-
islandSvelteClientPathMap.set(
|
|
22136
|
+
islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21876
22137
|
}
|
|
21877
22138
|
const islandVueClientPathMap = new Map;
|
|
21878
22139
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -21880,7 +22141,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21880
22141
|
const clientPath = islandVueClientPaths[idx];
|
|
21881
22142
|
if (!sourcePath || !clientPath)
|
|
21882
22143
|
continue;
|
|
21883
|
-
islandVueClientPathMap.set(
|
|
22144
|
+
islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21884
22145
|
}
|
|
21885
22146
|
const islandAngularClientPathMap = new Map;
|
|
21886
22147
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -21888,7 +22149,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21888
22149
|
const clientPath = islandAngularClientPaths[idx];
|
|
21889
22150
|
if (!sourcePath || !clientPath)
|
|
21890
22151
|
continue;
|
|
21891
|
-
islandAngularClientPathMap.set(
|
|
22152
|
+
islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21892
22153
|
}
|
|
21893
22154
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
21894
22155
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -21899,7 +22160,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21899
22160
|
const compileReactConventions = async () => {
|
|
21900
22161
|
if (reactConventionSources.length === 0)
|
|
21901
22162
|
return emptyStringArray;
|
|
21902
|
-
const destDir =
|
|
22163
|
+
const destDir = join38(buildPath, "conventions", "react");
|
|
21903
22164
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21904
22165
|
mkdirSync12(destDir, { recursive: true });
|
|
21905
22166
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -21914,7 +22175,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21914
22175
|
stylePreprocessorPlugin2,
|
|
21915
22176
|
createBunStringRawUnicodePlugin()
|
|
21916
22177
|
],
|
|
21917
|
-
root:
|
|
22178
|
+
root: dirname21(source),
|
|
21918
22179
|
target: "bun",
|
|
21919
22180
|
throw: false,
|
|
21920
22181
|
tsconfig: "./tsconfig.json"
|
|
@@ -21942,7 +22203,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21942
22203
|
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 }
|
|
21943
22204
|
]);
|
|
21944
22205
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
21945
|
-
const destDir =
|
|
22206
|
+
const destDir = join38(buildPath, "conventions", framework);
|
|
21946
22207
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21947
22208
|
mkdirSync12(destDir, { recursive: true });
|
|
21948
22209
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -22003,7 +22264,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22003
22264
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
22004
22265
|
];
|
|
22005
22266
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
22006
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22267
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname21(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname21(file4)), projectRoot);
|
|
22007
22268
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
22008
22269
|
buildInfo: islandBuildInfo,
|
|
22009
22270
|
buildPath,
|
|
@@ -22014,7 +22275,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22014
22275
|
}
|
|
22015
22276
|
})) : {
|
|
22016
22277
|
entries: [],
|
|
22017
|
-
generatedRoot:
|
|
22278
|
+
generatedRoot: join38(buildPath, "_island_entries")
|
|
22018
22279
|
};
|
|
22019
22280
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
22020
22281
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -22050,7 +22311,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22050
22311
|
return {};
|
|
22051
22312
|
}
|
|
22052
22313
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
22053
|
-
const refreshEntry =
|
|
22314
|
+
const refreshEntry = join38(reactIndexesPath, "_refresh.tsx");
|
|
22054
22315
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
22055
22316
|
reactClientEntryPoints.push(refreshEntry);
|
|
22056
22317
|
}
|
|
@@ -22161,19 +22422,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22161
22422
|
throw: false
|
|
22162
22423
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
22163
22424
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
22164
|
-
rmSync2(
|
|
22425
|
+
rmSync2(join38(buildPath, "react", "generated", "indexes"), {
|
|
22165
22426
|
force: true,
|
|
22166
22427
|
recursive: true
|
|
22167
22428
|
});
|
|
22168
22429
|
}
|
|
22169
22430
|
if (angularDir && angularClientPaths.length > 0) {
|
|
22170
|
-
rmSync2(
|
|
22431
|
+
rmSync2(join38(buildPath, "angular", "indexes"), {
|
|
22171
22432
|
force: true,
|
|
22172
22433
|
recursive: true
|
|
22173
22434
|
});
|
|
22174
22435
|
}
|
|
22175
22436
|
if (islandClientEntryPoints.length > 0) {
|
|
22176
|
-
rmSync2(
|
|
22437
|
+
rmSync2(join38(buildPath, "islands"), {
|
|
22177
22438
|
force: true,
|
|
22178
22439
|
recursive: true
|
|
22179
22440
|
});
|
|
@@ -22287,7 +22548,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22287
22548
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22288
22549
|
entrypoints: globalCssEntries,
|
|
22289
22550
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22290
|
-
outdir: stylesDir ?
|
|
22551
|
+
outdir: stylesDir ? join38(buildPath, basename14(stylesDir)) : buildPath,
|
|
22291
22552
|
plugins: [stylePreprocessorPlugin2],
|
|
22292
22553
|
root: stylesDir || clientRoot,
|
|
22293
22554
|
target: "browser",
|
|
@@ -22296,7 +22557,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22296
22557
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22297
22558
|
entrypoints: vueCssPaths,
|
|
22298
22559
|
naming: `[name].[hash].[ext]`,
|
|
22299
|
-
outdir:
|
|
22560
|
+
outdir: join38(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22300
22561
|
target: "browser",
|
|
22301
22562
|
throw: false
|
|
22302
22563
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22320,18 +22581,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22320
22581
|
}
|
|
22321
22582
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22322
22583
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22323
|
-
const sourcemapDir =
|
|
22584
|
+
const sourcemapDir = join38(projectRoot, "sourcemaps");
|
|
22324
22585
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22325
22586
|
const mapFiles = readdirSync5(buildPath, {
|
|
22326
22587
|
encoding: "utf8",
|
|
22327
22588
|
recursive: true
|
|
22328
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22589
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join38(buildPath, entry));
|
|
22329
22590
|
for (const mapPath of mapFiles) {
|
|
22330
22591
|
chainExternalSourcemap2(mapPath);
|
|
22331
|
-
renameSync(mapPath,
|
|
22592
|
+
renameSync(mapPath, join38(sourcemapDir, basename14(mapPath)));
|
|
22332
22593
|
const jsPath = mapPath.slice(0, -4);
|
|
22333
22594
|
try {
|
|
22334
|
-
const javascript =
|
|
22595
|
+
const javascript = readFileSync22(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
22335
22596
|
`);
|
|
22336
22597
|
writeFileSync8(jsPath, javascript);
|
|
22337
22598
|
} catch {}
|
|
@@ -22402,7 +22663,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22402
22663
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22403
22664
|
}
|
|
22404
22665
|
if (!hmr) {
|
|
22405
|
-
const reactVendorDir =
|
|
22666
|
+
const reactVendorDir = join38(buildPath, "react", "vendor");
|
|
22406
22667
|
const vendorChunkPaths = existsSync27(reactVendorDir) ? [
|
|
22407
22668
|
...new Glob8("**/*.js").scanSync({
|
|
22408
22669
|
absolute: true,
|
|
@@ -22419,7 +22680,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22419
22680
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22420
22681
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22421
22682
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22422
|
-
const fileDir =
|
|
22683
|
+
const fileDir = dirname21(artifact.path);
|
|
22423
22684
|
const relativePaths = {};
|
|
22424
22685
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22425
22686
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22547,7 +22808,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22547
22808
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
22548
22809
|
if (!hmrClientBundle)
|
|
22549
22810
|
return;
|
|
22550
|
-
let html =
|
|
22811
|
+
let html = readFileSync22(filePath, "utf-8");
|
|
22551
22812
|
if (html.includes("data-hmr-client"))
|
|
22552
22813
|
return;
|
|
22553
22814
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -22558,7 +22819,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22558
22819
|
const processHtmlPages = async () => {
|
|
22559
22820
|
if (!(htmlDir && htmlPagesPath))
|
|
22560
22821
|
return;
|
|
22561
|
-
const outputHtmlPages = isSingle ?
|
|
22822
|
+
const outputHtmlPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmlDir), "pages");
|
|
22562
22823
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22563
22824
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22564
22825
|
force: true,
|
|
@@ -22574,7 +22835,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22574
22835
|
if (hmr)
|
|
22575
22836
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
22576
22837
|
if (pwaArtifacts) {
|
|
22577
|
-
const source =
|
|
22838
|
+
const source = readFileSync22(htmlFile, "utf8");
|
|
22578
22839
|
writeFileSync8(htmlFile, injectPwaBootstrapHtml(source));
|
|
22579
22840
|
}
|
|
22580
22841
|
const fileName = basename14(htmlFile, ".html");
|
|
@@ -22587,14 +22848,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22587
22848
|
const processHtmxPages = async () => {
|
|
22588
22849
|
if (!(htmxDir && htmxPagesPath))
|
|
22589
22850
|
return;
|
|
22590
|
-
const outputHtmxPages = isSingle ?
|
|
22851
|
+
const outputHtmxPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmxDir), "pages");
|
|
22591
22852
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22592
22853
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22593
22854
|
force: true,
|
|
22594
22855
|
recursive: true
|
|
22595
22856
|
});
|
|
22596
22857
|
if (shouldCopyHtmx) {
|
|
22597
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
22858
|
+
const htmxDestDir = isSingle ? buildPath : join38(buildPath, basename14(htmxDir));
|
|
22598
22859
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22599
22860
|
}
|
|
22600
22861
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22607,7 +22868,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22607
22868
|
if (hmr)
|
|
22608
22869
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
22609
22870
|
if (pwaArtifacts) {
|
|
22610
|
-
const source =
|
|
22871
|
+
const source = readFileSync22(htmxFile, "utf8");
|
|
22611
22872
|
writeFileSync8(htmxFile, injectPwaBootstrapHtml(source));
|
|
22612
22873
|
}
|
|
22613
22874
|
const fileName = basename14(htmxFile, ".html");
|
|
@@ -22670,22 +22931,22 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22670
22931
|
angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
|
|
22671
22932
|
]);
|
|
22672
22933
|
const spaRouteHosts = [
|
|
22673
|
-
...reactSpaHosts.map((
|
|
22674
|
-
...
|
|
22934
|
+
...reactSpaHosts.map((host2) => ({
|
|
22935
|
+
...host2,
|
|
22675
22936
|
framework: "react"
|
|
22676
22937
|
})),
|
|
22677
|
-
...svelteSpaHosts.map((
|
|
22678
|
-
...
|
|
22938
|
+
...svelteSpaHosts.map((host2) => ({
|
|
22939
|
+
...host2,
|
|
22679
22940
|
framework: "svelte"
|
|
22680
22941
|
})),
|
|
22681
|
-
...vueSpaHosts.map((
|
|
22682
|
-
...angularSpaHosts.map((
|
|
22683
|
-
...
|
|
22942
|
+
...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
|
|
22943
|
+
...angularSpaHosts.map((host2) => ({
|
|
22944
|
+
...host2,
|
|
22684
22945
|
framework: "angular"
|
|
22685
22946
|
}))
|
|
22686
22947
|
];
|
|
22687
22948
|
setSpaRouteManifest(spaRouteHosts);
|
|
22688
|
-
writeFileSync8(
|
|
22949
|
+
writeFileSync8(join38(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22689
22950
|
if (isIncremental) {
|
|
22690
22951
|
writeBuildTrace(buildPath);
|
|
22691
22952
|
return {
|
|
@@ -22694,9 +22955,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22694
22955
|
manifest
|
|
22695
22956
|
};
|
|
22696
22957
|
}
|
|
22697
|
-
writeFileSync8(
|
|
22958
|
+
writeFileSync8(join38(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22698
22959
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22699
|
-
writeFileSync8(
|
|
22960
|
+
writeFileSync8(join38(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22700
22961
|
}
|
|
22701
22962
|
writeBuildTrace(buildPath);
|
|
22702
22963
|
if (mode === "production") {
|
|
@@ -22830,7 +23091,7 @@ var init_build = __esm(() => {
|
|
|
22830
23091
|
|
|
22831
23092
|
// src/build/buildEmberVendor.ts
|
|
22832
23093
|
import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
|
|
22833
|
-
import { join as
|
|
23094
|
+
import { join as join39 } from "path";
|
|
22834
23095
|
import { rm as rm10 } from "fs/promises";
|
|
22835
23096
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
22836
23097
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -22882,7 +23143,7 @@ export const importSync = (specifier) => {
|
|
|
22882
23143
|
if (standaloneSpecifiers.has(specifier)) {
|
|
22883
23144
|
return { resolveTo: specifier, specifier };
|
|
22884
23145
|
}
|
|
22885
|
-
const emberInternalPath =
|
|
23146
|
+
const emberInternalPath = join39(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
22886
23147
|
if (!existsSync28(emberInternalPath)) {
|
|
22887
23148
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
22888
23149
|
}
|
|
@@ -22914,7 +23175,7 @@ export const importSync = (specifier) => {
|
|
|
22914
23175
|
if (standalonePackages.has(args.path)) {
|
|
22915
23176
|
return;
|
|
22916
23177
|
}
|
|
22917
|
-
const internal =
|
|
23178
|
+
const internal = join39(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
22918
23179
|
if (existsSync28(internal)) {
|
|
22919
23180
|
return { path: internal };
|
|
22920
23181
|
}
|
|
@@ -22922,16 +23183,16 @@ export const importSync = (specifier) => {
|
|
|
22922
23183
|
});
|
|
22923
23184
|
}
|
|
22924
23185
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
22925
|
-
const vendorDir =
|
|
23186
|
+
const vendorDir = join39(buildDir, "ember", "vendor");
|
|
22926
23187
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22927
|
-
const tmpDir =
|
|
23188
|
+
const tmpDir = join39(buildDir, "_ember_vendor_tmp");
|
|
22928
23189
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22929
|
-
const macrosShimPath =
|
|
23190
|
+
const macrosShimPath = join39(tmpDir, "embroider_macros_shim.js");
|
|
22930
23191
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
22931
23192
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
22932
23193
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
22933
23194
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
22934
|
-
const entryPath =
|
|
23195
|
+
const entryPath = join39(tmpDir, `${safeName}.js`);
|
|
22935
23196
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
22936
23197
|
` : generateVendorEntrySource2(resolution);
|
|
22937
23198
|
await Bun.write(entryPath, source);
|
|
@@ -23087,9 +23348,9 @@ __export(exports_dependencyGraph, {
|
|
|
23087
23348
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
23088
23349
|
addFileToGraph: () => addFileToGraph
|
|
23089
23350
|
});
|
|
23090
|
-
import { existsSync as existsSync29, readFileSync as
|
|
23351
|
+
import { existsSync as existsSync29, readFileSync as readFileSync23 } from "fs";
|
|
23091
23352
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23092
|
-
import { resolve as
|
|
23353
|
+
import { resolve as resolve28 } from "path";
|
|
23093
23354
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23094
23355
|
const lower = filePath.toLowerCase();
|
|
23095
23356
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23103,8 +23364,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23103
23364
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23104
23365
|
return null;
|
|
23105
23366
|
}
|
|
23106
|
-
const fromDir =
|
|
23107
|
-
const normalized =
|
|
23367
|
+
const fromDir = resolve28(fromFile, "..");
|
|
23368
|
+
const normalized = resolve28(fromDir, importPath);
|
|
23108
23369
|
const extensions = [
|
|
23109
23370
|
".ts",
|
|
23110
23371
|
".tsx",
|
|
@@ -23134,7 +23395,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23134
23395
|
dependents.delete(normalizedPath);
|
|
23135
23396
|
}
|
|
23136
23397
|
}, addFileToGraph = (graph, filePath) => {
|
|
23137
|
-
const normalizedPath =
|
|
23398
|
+
const normalizedPath = resolve28(filePath);
|
|
23138
23399
|
if (!existsSync29(normalizedPath))
|
|
23139
23400
|
return;
|
|
23140
23401
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -23161,10 +23422,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23161
23422
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23162
23423
|
const processedFiles = new Set;
|
|
23163
23424
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23164
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23425
|
+
const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync29(dir));
|
|
23165
23426
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23166
23427
|
for (const file4 of allFiles) {
|
|
23167
|
-
const fullPath =
|
|
23428
|
+
const fullPath = resolve28(file4);
|
|
23168
23429
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23169
23430
|
continue;
|
|
23170
23431
|
if (processedFiles.has(fullPath))
|
|
@@ -23258,15 +23519,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23258
23519
|
const lowerPath = filePath.toLowerCase();
|
|
23259
23520
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
23260
23521
|
if (loader === "html") {
|
|
23261
|
-
const content =
|
|
23522
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23262
23523
|
return extractHtmlDependencies(filePath, content);
|
|
23263
23524
|
}
|
|
23264
23525
|
if (loader === "tsx" || loader === "js") {
|
|
23265
|
-
const content =
|
|
23526
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23266
23527
|
return extractJsDependencies(filePath, content, loader);
|
|
23267
23528
|
}
|
|
23268
23529
|
if (isSvelteOrVue) {
|
|
23269
|
-
const content =
|
|
23530
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23270
23531
|
return extractSvelteVueDependencies(filePath, content);
|
|
23271
23532
|
}
|
|
23272
23533
|
return [];
|
|
@@ -23277,7 +23538,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23277
23538
|
return [];
|
|
23278
23539
|
}
|
|
23279
23540
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23280
|
-
const normalizedPath =
|
|
23541
|
+
const normalizedPath = resolve28(changedFile);
|
|
23281
23542
|
const affected = new Set;
|
|
23282
23543
|
const toProcess = [normalizedPath];
|
|
23283
23544
|
const processNode = (current) => {
|
|
@@ -23308,7 +23569,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23308
23569
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23309
23570
|
graph.dependents.delete(normalizedPath);
|
|
23310
23571
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23311
|
-
const normalizedPath =
|
|
23572
|
+
const normalizedPath = resolve28(filePath);
|
|
23312
23573
|
removeDepsForFile(graph, normalizedPath);
|
|
23313
23574
|
removeDependentsForFile(graph, normalizedPath);
|
|
23314
23575
|
};
|
|
@@ -23351,12 +23612,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23351
23612
|
};
|
|
23352
23613
|
|
|
23353
23614
|
// src/dev/configResolver.ts
|
|
23354
|
-
import { resolve as
|
|
23615
|
+
import { resolve as resolve29 } from "path";
|
|
23355
23616
|
var resolveBuildPaths = (config) => {
|
|
23356
23617
|
const cwd2 = process.cwd();
|
|
23357
23618
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23358
|
-
const withDefault = (value, fallback) => normalize(
|
|
23359
|
-
const optional = (value) => value ? normalize(
|
|
23619
|
+
const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
|
|
23620
|
+
const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
|
|
23360
23621
|
return {
|
|
23361
23622
|
angularDir: optional(config.angularDirectory),
|
|
23362
23623
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23414,8 +23675,8 @@ var init_clientManager = __esm(() => {
|
|
|
23414
23675
|
});
|
|
23415
23676
|
|
|
23416
23677
|
// src/dev/pathUtils.ts
|
|
23417
|
-
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as
|
|
23418
|
-
import { dirname as
|
|
23678
|
+
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync24 } from "fs";
|
|
23679
|
+
import { dirname as dirname22, resolve as resolve30 } from "path";
|
|
23419
23680
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23420
23681
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23421
23682
|
return "ignored";
|
|
@@ -23491,7 +23752,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23491
23752
|
return "unknown";
|
|
23492
23753
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23493
23754
|
const out = new Set;
|
|
23494
|
-
const angularRoot =
|
|
23755
|
+
const angularRoot = resolve30(angularDir);
|
|
23495
23756
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
23496
23757
|
const walk = (dir) => {
|
|
23497
23758
|
let entries;
|
|
@@ -23504,7 +23765,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23504
23765
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23505
23766
|
continue;
|
|
23506
23767
|
}
|
|
23507
|
-
const full =
|
|
23768
|
+
const full = resolve30(dir, entry.name);
|
|
23508
23769
|
if (entry.isDirectory()) {
|
|
23509
23770
|
walk(full);
|
|
23510
23771
|
continue;
|
|
@@ -23514,7 +23775,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23514
23775
|
}
|
|
23515
23776
|
let source;
|
|
23516
23777
|
try {
|
|
23517
|
-
source =
|
|
23778
|
+
source = readFileSync24(full, "utf8");
|
|
23518
23779
|
} catch {
|
|
23519
23780
|
continue;
|
|
23520
23781
|
}
|
|
@@ -23543,10 +23804,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23543
23804
|
refs.push(strMatch[1]);
|
|
23544
23805
|
}
|
|
23545
23806
|
}
|
|
23546
|
-
const componentDir =
|
|
23807
|
+
const componentDir = dirname22(full);
|
|
23547
23808
|
for (const ref of refs) {
|
|
23548
|
-
const refAbs = normalizePath(
|
|
23549
|
-
const refDir = normalizePath(
|
|
23809
|
+
const refAbs = normalizePath(resolve30(componentDir, ref));
|
|
23810
|
+
const refDir = normalizePath(dirname22(refAbs));
|
|
23550
23811
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23551
23812
|
continue;
|
|
23552
23813
|
}
|
|
@@ -23562,7 +23823,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23562
23823
|
const push = (path) => {
|
|
23563
23824
|
if (!path)
|
|
23564
23825
|
return;
|
|
23565
|
-
const abs = normalizePath(
|
|
23826
|
+
const abs = normalizePath(resolve30(cwd2, path));
|
|
23566
23827
|
if (!roots.includes(abs))
|
|
23567
23828
|
roots.push(abs);
|
|
23568
23829
|
};
|
|
@@ -23587,7 +23848,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23587
23848
|
push(cfg.assetsDir);
|
|
23588
23849
|
push(cfg.stylesDir);
|
|
23589
23850
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23590
|
-
const abs = normalizePath(
|
|
23851
|
+
const abs = normalizePath(resolve30(cwd2, candidate));
|
|
23591
23852
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
23592
23853
|
roots.push(abs);
|
|
23593
23854
|
}
|
|
@@ -23598,7 +23859,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23598
23859
|
continue;
|
|
23599
23860
|
if (entry.name.startsWith("."))
|
|
23600
23861
|
continue;
|
|
23601
|
-
const abs = normalizePath(
|
|
23862
|
+
const abs = normalizePath(resolve30(cwd2, entry.name));
|
|
23602
23863
|
if (roots.includes(abs))
|
|
23603
23864
|
continue;
|
|
23604
23865
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23682,7 +23943,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23682
23943
|
// src/dev/fileWatcher.ts
|
|
23683
23944
|
import { watch } from "fs";
|
|
23684
23945
|
import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23685
|
-
import { dirname as
|
|
23946
|
+
import { dirname as dirname23, join as join40, resolve as resolve31 } from "path";
|
|
23686
23947
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23687
23948
|
try {
|
|
23688
23949
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23714,7 +23975,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23714
23975
|
for (const name of entries) {
|
|
23715
23976
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23716
23977
|
continue;
|
|
23717
|
-
const child =
|
|
23978
|
+
const child = join40(eventDir, name).replace(/\\/g, "/");
|
|
23718
23979
|
let st2;
|
|
23719
23980
|
try {
|
|
23720
23981
|
st2 = statSync4(child);
|
|
@@ -23735,7 +23996,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23735
23996
|
return;
|
|
23736
23997
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23737
23998
|
if (event === "rename") {
|
|
23738
|
-
const eventDir =
|
|
23999
|
+
const eventDir = dirname23(join40(absolutePath, filename)).replace(/\\/g, "/");
|
|
23739
24000
|
atomicRecoveryScan(eventDir);
|
|
23740
24001
|
for (const delay of [25, 100]) {
|
|
23741
24002
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -23744,7 +24005,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23744
24005
|
}
|
|
23745
24006
|
return;
|
|
23746
24007
|
}
|
|
23747
|
-
const fullPath =
|
|
24008
|
+
const fullPath = join40(absolutePath, filename).replace(/\\/g, "/");
|
|
23748
24009
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
23749
24010
|
return;
|
|
23750
24011
|
}
|
|
@@ -23762,7 +24023,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23762
24023
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
23763
24024
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23764
24025
|
paths.forEach((path) => {
|
|
23765
|
-
const absolutePath =
|
|
24026
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23766
24027
|
if (!existsSync31(absolutePath)) {
|
|
23767
24028
|
return;
|
|
23768
24029
|
}
|
|
@@ -23773,7 +24034,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23773
24034
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
23774
24035
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23775
24036
|
watchPaths.forEach((path) => {
|
|
23776
|
-
const absolutePath =
|
|
24037
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23777
24038
|
if (!existsSync31(absolutePath)) {
|
|
23778
24039
|
return;
|
|
23779
24040
|
}
|
|
@@ -23792,13 +24053,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
23792
24053
|
});
|
|
23793
24054
|
|
|
23794
24055
|
// src/dev/assetStore.ts
|
|
23795
|
-
import { resolve as
|
|
24056
|
+
import { resolve as resolve32 } from "path";
|
|
23796
24057
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
23797
24058
|
var mimeTypes, getMimeType = (filePath) => {
|
|
23798
24059
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
23799
24060
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
23800
24061
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
23801
|
-
const fullPath =
|
|
24062
|
+
const fullPath = resolve32(dir, entry.name);
|
|
23802
24063
|
if (entry.isDirectory()) {
|
|
23803
24064
|
return walkAndClean(fullPath);
|
|
23804
24065
|
}
|
|
@@ -23814,10 +24075,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23814
24075
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
23815
24076
|
const liveByIdentity = new Map;
|
|
23816
24077
|
for (const webPath of store.keys()) {
|
|
23817
|
-
const diskPath =
|
|
24078
|
+
const diskPath = resolve32(buildDir, webPath.slice(1));
|
|
23818
24079
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
23819
24080
|
}
|
|
23820
|
-
const absBuildDir =
|
|
24081
|
+
const absBuildDir = resolve32(buildDir);
|
|
23821
24082
|
Object.values(manifest).forEach((val) => {
|
|
23822
24083
|
if (!HASHED_FILE_RE.test(val))
|
|
23823
24084
|
return;
|
|
@@ -23835,7 +24096,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23835
24096
|
} catch {}
|
|
23836
24097
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
23837
24098
|
if (entry.isDirectory()) {
|
|
23838
|
-
return scanDir(
|
|
24099
|
+
return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
|
|
23839
24100
|
}
|
|
23840
24101
|
if (!entry.name.startsWith("chunk-")) {
|
|
23841
24102
|
return null;
|
|
@@ -23844,7 +24105,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23844
24105
|
if (store.has(webPath)) {
|
|
23845
24106
|
return null;
|
|
23846
24107
|
}
|
|
23847
|
-
return Bun.file(
|
|
24108
|
+
return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
|
|
23848
24109
|
store.set(webPath, bytes);
|
|
23849
24110
|
return;
|
|
23850
24111
|
}).catch(() => {});
|
|
@@ -23866,7 +24127,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23866
24127
|
for (const webPath of newIdentities.values()) {
|
|
23867
24128
|
if (store.has(webPath))
|
|
23868
24129
|
continue;
|
|
23869
|
-
loadPromises.push(Bun.file(
|
|
24130
|
+
loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
23870
24131
|
store.set(webPath, bytes);
|
|
23871
24132
|
return;
|
|
23872
24133
|
}).catch(() => {}));
|
|
@@ -23911,8 +24172,8 @@ var init_assetStore = __esm(() => {
|
|
|
23911
24172
|
});
|
|
23912
24173
|
|
|
23913
24174
|
// src/islands/pageMetadata.ts
|
|
23914
|
-
import { readFileSync as
|
|
23915
|
-
import { dirname as
|
|
24175
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
24176
|
+
import { dirname as dirname24, resolve as resolve33 } from "path";
|
|
23916
24177
|
var pagePatterns, getPageDirs = (config) => [
|
|
23917
24178
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
23918
24179
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -23932,15 +24193,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23932
24193
|
const source = definition.buildReference?.source;
|
|
23933
24194
|
if (!source)
|
|
23934
24195
|
continue;
|
|
23935
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
23936
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
24196
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname24(buildInfo.resolvedRegistryPath), source);
|
|
24197
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
|
|
23937
24198
|
}
|
|
23938
24199
|
return lookup;
|
|
23939
24200
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
23940
24201
|
const candidate = usage.source;
|
|
23941
|
-
return candidate ?
|
|
24202
|
+
return candidate ? resolve33(candidate) === target : false;
|
|
23942
24203
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
23943
|
-
const target =
|
|
24204
|
+
const target = resolve33(sourcePath);
|
|
23944
24205
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
23945
24206
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
23946
24207
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -23952,13 +24213,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23952
24213
|
const pattern = pagePatterns[entry.framework];
|
|
23953
24214
|
if (!pattern)
|
|
23954
24215
|
return;
|
|
23955
|
-
const files = await scanEntryPoints(
|
|
24216
|
+
const files = await scanEntryPoints(resolve33(entry.dir), pattern);
|
|
23956
24217
|
for (const filePath of files) {
|
|
23957
|
-
const source =
|
|
24218
|
+
const source = readFileSync25(filePath, "utf-8");
|
|
23958
24219
|
const islands = extractIslandUsagesFromSource(source);
|
|
23959
|
-
pageMetadata.set(
|
|
24220
|
+
pageMetadata.set(resolve33(filePath), {
|
|
23960
24221
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
23961
|
-
pagePath:
|
|
24222
|
+
pagePath: resolve33(filePath)
|
|
23962
24223
|
});
|
|
23963
24224
|
}
|
|
23964
24225
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -23985,10 +24246,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
23985
24246
|
});
|
|
23986
24247
|
|
|
23987
24248
|
// src/dev/fileHashTracker.ts
|
|
23988
|
-
import { readFileSync as
|
|
24249
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
23989
24250
|
var computeFileHash = (filePath) => {
|
|
23990
24251
|
try {
|
|
23991
|
-
const fileContent =
|
|
24252
|
+
const fileContent = readFileSync26(filePath);
|
|
23992
24253
|
return Number(Bun.hash(fileContent));
|
|
23993
24254
|
} catch {
|
|
23994
24255
|
return UNFOUND_INDEX;
|
|
@@ -24024,9 +24285,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
|
|
|
24024
24285
|
set.add(filePath);
|
|
24025
24286
|
}
|
|
24026
24287
|
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
24027
|
-
const
|
|
24028
|
-
if (
|
|
24029
|
-
return
|
|
24288
|
+
const component2 = [...parents].find(isComponentFile);
|
|
24289
|
+
if (component2 !== undefined)
|
|
24290
|
+
return component2;
|
|
24030
24291
|
for (const parent of parents)
|
|
24031
24292
|
queue.push(parent);
|
|
24032
24293
|
return;
|
|
@@ -24081,9 +24342,9 @@ var init_transformCache = __esm(() => {
|
|
|
24081
24342
|
});
|
|
24082
24343
|
|
|
24083
24344
|
// src/dev/reactComponentClassifier.ts
|
|
24084
|
-
import { resolve as
|
|
24345
|
+
import { resolve as resolve34 } from "path";
|
|
24085
24346
|
var classifyComponent = (filePath) => {
|
|
24086
|
-
const normalizedPath =
|
|
24347
|
+
const normalizedPath = resolve34(filePath);
|
|
24087
24348
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24088
24349
|
return "server";
|
|
24089
24350
|
}
|
|
@@ -24095,7 +24356,7 @@ var classifyComponent = (filePath) => {
|
|
|
24095
24356
|
var init_reactComponentClassifier = () => {};
|
|
24096
24357
|
|
|
24097
24358
|
// src/dev/moduleMapper.ts
|
|
24098
|
-
import { basename as basename15, resolve as
|
|
24359
|
+
import { basename as basename15, resolve as resolve35 } from "path";
|
|
24099
24360
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24100
24361
|
const modulePaths = {};
|
|
24101
24362
|
moduleKeys.forEach((key) => {
|
|
@@ -24105,7 +24366,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24105
24366
|
});
|
|
24106
24367
|
return modulePaths;
|
|
24107
24368
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24108
|
-
const normalizedFile =
|
|
24369
|
+
const normalizedFile = resolve35(sourceFile);
|
|
24109
24370
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24110
24371
|
if (processedFiles.has(normalizedFile)) {
|
|
24111
24372
|
return null;
|
|
@@ -24141,7 +24402,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24141
24402
|
});
|
|
24142
24403
|
return grouped;
|
|
24143
24404
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24144
|
-
const normalizedFile =
|
|
24405
|
+
const normalizedFile = resolve35(sourceFile);
|
|
24145
24406
|
const fileName = basename15(normalizedFile);
|
|
24146
24407
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24147
24408
|
const pascalName = toPascal(baseName);
|
|
@@ -24197,7 +24458,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
24197
24458
|
|
|
24198
24459
|
// src/utils/spaRouteCss.ts
|
|
24199
24460
|
import { readFile as readFile6 } from "fs/promises";
|
|
24200
|
-
import { dirname as
|
|
24461
|
+
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve36 } from "path";
|
|
24201
24462
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
24202
24463
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
24203
24464
|
if (cached !== undefined)
|
|
@@ -24235,7 +24496,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24235
24496
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24236
24497
|
if (!cssPath)
|
|
24237
24498
|
return "";
|
|
24238
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24499
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve36(dirname25(sideManifestPath), cssPath);
|
|
24239
24500
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24240
24501
|
if (cached !== undefined)
|
|
24241
24502
|
return cached;
|
|
@@ -24318,8 +24579,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
24318
24579
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
24319
24580
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24320
24581
|
});
|
|
24321
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
24322
|
-
import { dirname as
|
|
24582
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
|
|
24583
|
+
import { dirname as dirname26, extname as extname11, join as join41, resolve as resolve37 } from "path";
|
|
24323
24584
|
import ts18 from "typescript";
|
|
24324
24585
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24325
24586
|
const out = [];
|
|
@@ -24334,7 +24595,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24334
24595
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24335
24596
|
continue;
|
|
24336
24597
|
}
|
|
24337
|
-
const full =
|
|
24598
|
+
const full = join41(dir, entry.name);
|
|
24338
24599
|
if (entry.isDirectory()) {
|
|
24339
24600
|
visit(full);
|
|
24340
24601
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24378,7 +24639,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24378
24639
|
}, parseDecoratedClasses = (filePath) => {
|
|
24379
24640
|
let source;
|
|
24380
24641
|
try {
|
|
24381
|
-
source =
|
|
24642
|
+
source = readFileSync27(filePath, "utf8");
|
|
24382
24643
|
} catch {
|
|
24383
24644
|
return [];
|
|
24384
24645
|
}
|
|
@@ -24432,7 +24693,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24432
24693
|
};
|
|
24433
24694
|
visit(sourceFile);
|
|
24434
24695
|
return out;
|
|
24435
|
-
}, safeNormalize = (path) =>
|
|
24696
|
+
}, safeNormalize = (path) => resolve37(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24436
24697
|
const { changedFilePath, userAngularRoot } = params;
|
|
24437
24698
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24438
24699
|
const out = [];
|
|
@@ -24468,12 +24729,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24468
24729
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
24469
24730
|
let source;
|
|
24470
24731
|
try {
|
|
24471
|
-
source =
|
|
24732
|
+
source = readFileSync27(childFilePath, "utf8");
|
|
24472
24733
|
} catch {
|
|
24473
24734
|
return null;
|
|
24474
24735
|
}
|
|
24475
24736
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24476
|
-
const childDir =
|
|
24737
|
+
const childDir = dirname26(childFilePath);
|
|
24477
24738
|
for (const stmt of sourceFile.statements) {
|
|
24478
24739
|
if (!ts18.isImportDeclaration(stmt))
|
|
24479
24740
|
continue;
|
|
@@ -24501,7 +24762,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24501
24762
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24502
24763
|
return null;
|
|
24503
24764
|
}
|
|
24504
|
-
const base =
|
|
24765
|
+
const base = resolve37(childDir, spec);
|
|
24505
24766
|
const candidates = [
|
|
24506
24767
|
`${base}.ts`,
|
|
24507
24768
|
`${base}.tsx`,
|
|
@@ -24530,7 +24791,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24530
24791
|
const parentFile = new Map;
|
|
24531
24792
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24532
24793
|
const classes = parseDecoratedClasses(tsPath);
|
|
24533
|
-
const componentDir =
|
|
24794
|
+
const componentDir = dirname26(tsPath);
|
|
24534
24795
|
for (const cls of classes) {
|
|
24535
24796
|
const entity = {
|
|
24536
24797
|
className: cls.className,
|
|
@@ -24539,7 +24800,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24539
24800
|
};
|
|
24540
24801
|
if (cls.kind === "component") {
|
|
24541
24802
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24542
|
-
const abs = safeNormalize(
|
|
24803
|
+
const abs = safeNormalize(resolve37(componentDir, url));
|
|
24543
24804
|
const existing = resource.get(abs);
|
|
24544
24805
|
if (existing)
|
|
24545
24806
|
existing.push(entity);
|
|
@@ -24799,7 +25060,7 @@ __export(exports_loadConfig, {
|
|
|
24799
25060
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
24800
25061
|
getWorkspaceServices: () => getWorkspaceServices
|
|
24801
25062
|
});
|
|
24802
|
-
import { resolve as
|
|
25063
|
+
import { resolve as resolve38 } from "path";
|
|
24803
25064
|
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) => {
|
|
24804
25065
|
if (!isObject2(config)) {
|
|
24805
25066
|
return false;
|
|
@@ -24850,7 +25111,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
24850
25111
|
}
|
|
24851
25112
|
return config;
|
|
24852
25113
|
}, loadRawConfig = async (configPath2) => {
|
|
24853
|
-
const resolved =
|
|
25114
|
+
const resolved = resolve38(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
24854
25115
|
const mod = await import(resolved);
|
|
24855
25116
|
const config = mod.default ?? mod.config;
|
|
24856
25117
|
if (!config) {
|
|
@@ -24912,8 +25173,8 @@ __export(exports_moduleServer, {
|
|
|
24912
25173
|
createModuleServer: () => createModuleServer,
|
|
24913
25174
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24914
25175
|
});
|
|
24915
|
-
import { existsSync as existsSync32, readFileSync as
|
|
24916
|
-
import { basename as basename16, dirname as
|
|
25176
|
+
import { existsSync as existsSync32, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25177
|
+
import { basename as basename16, dirname as dirname27, extname as extname12, join as join42, resolve as resolve39, relative as relative16 } from "path";
|
|
24917
25178
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24918
25179
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24919
25180
|
const allExports = [];
|
|
@@ -24933,10 +25194,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24933
25194
|
${stubs}
|
|
24934
25195
|
`;
|
|
24935
25196
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24936
|
-
const directHit = extensions.find((ext) => existsSync32(
|
|
25197
|
+
const directHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
|
|
24937
25198
|
if (directHit)
|
|
24938
25199
|
return srcPath + directHit;
|
|
24939
|
-
const indexHit = extensions.find((ext) => existsSync32(
|
|
25200
|
+
const indexHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath, `index${ext}`)));
|
|
24940
25201
|
if (indexHit)
|
|
24941
25202
|
return `${srcPath}/index${indexHit}`;
|
|
24942
25203
|
return srcPath;
|
|
@@ -24959,7 +25220,7 @@ ${stubs}
|
|
|
24959
25220
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
24960
25221
|
}, srcUrl = (relPath, projectRoot) => {
|
|
24961
25222
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
24962
|
-
const absPath =
|
|
25223
|
+
const absPath = resolve39(projectRoot, relPath);
|
|
24963
25224
|
const cached = mtimeCache.get(absPath);
|
|
24964
25225
|
if (cached !== undefined)
|
|
24965
25226
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -24971,12 +25232,12 @@ ${stubs}
|
|
|
24971
25232
|
return base;
|
|
24972
25233
|
}
|
|
24973
25234
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
24974
|
-
const absPath =
|
|
25235
|
+
const absPath = resolve39(fileDir, relPath);
|
|
24975
25236
|
const rel = relative16(projectRoot, absPath);
|
|
24976
25237
|
const extension = extname12(rel);
|
|
24977
25238
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
24978
25239
|
if (extname12(srcPath) === ".svelte") {
|
|
24979
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
25240
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
|
|
24980
25241
|
}
|
|
24981
25242
|
return srcUrl(srcPath, projectRoot);
|
|
24982
25243
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -24995,13 +25256,13 @@ ${stubs}
|
|
|
24995
25256
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
24996
25257
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
24997
25258
|
if (!subpath) {
|
|
24998
|
-
const pkgDir =
|
|
24999
|
-
const pkgJsonPath =
|
|
25259
|
+
const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
|
|
25260
|
+
const pkgJsonPath = join42(pkgDir, "package.json");
|
|
25000
25261
|
if (existsSync32(pkgJsonPath)) {
|
|
25001
|
-
const pkg = JSON.parse(
|
|
25262
|
+
const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
|
|
25002
25263
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25003
25264
|
if (esmEntry) {
|
|
25004
|
-
const resolved =
|
|
25265
|
+
const resolved = resolve39(pkgDir, esmEntry);
|
|
25005
25266
|
if (existsSync32(resolved))
|
|
25006
25267
|
return relative16(projectRoot, resolved);
|
|
25007
25268
|
}
|
|
@@ -25039,7 +25300,7 @@ ${stubs}
|
|
|
25039
25300
|
};
|
|
25040
25301
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
25041
25302
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
25042
|
-
const fileDir =
|
|
25303
|
+
const fileDir = dirname27(filePath);
|
|
25043
25304
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25044
25305
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25045
25306
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -25054,12 +25315,12 @@ ${stubs}
|
|
|
25054
25315
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
25055
25316
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
25056
25317
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
25057
|
-
const absPath =
|
|
25318
|
+
const absPath = resolve39(fileDir, relPath);
|
|
25058
25319
|
const rel = relative16(projectRoot, absPath);
|
|
25059
25320
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
25060
25321
|
});
|
|
25061
25322
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
25062
|
-
const absPath =
|
|
25323
|
+
const absPath = resolve39(fileDir, relPath);
|
|
25063
25324
|
const rel = relative16(projectRoot, absPath);
|
|
25064
25325
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
25065
25326
|
});
|
|
@@ -25105,7 +25366,7 @@ ${code}`;
|
|
|
25105
25366
|
reactFastRefreshWarningEmitted = true;
|
|
25106
25367
|
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.");
|
|
25107
25368
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
25108
|
-
const raw =
|
|
25369
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25109
25370
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
25110
25371
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
25111
25372
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -25121,7 +25382,7 @@ ${transpiled}`;
|
|
|
25121
25382
|
transpiled += buildIslandMetadataExports(raw);
|
|
25122
25383
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
25123
25384
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
25124
|
-
const raw =
|
|
25385
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25125
25386
|
const ext = extname12(filePath);
|
|
25126
25387
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
25127
25388
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -25287,7 +25548,7 @@ ${code}`;
|
|
|
25287
25548
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
25288
25549
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
25289
25550
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
25290
|
-
const raw =
|
|
25551
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25291
25552
|
if (!svelteCompiler) {
|
|
25292
25553
|
svelteCompiler = await import("svelte/compiler");
|
|
25293
25554
|
}
|
|
@@ -25353,7 +25614,7 @@ export default __script__;`;
|
|
|
25353
25614
|
return `${cssInjection}
|
|
25354
25615
|
${code}`;
|
|
25355
25616
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
25356
|
-
const rawSource =
|
|
25617
|
+
const rawSource = readFileSync28(filePath, "utf-8");
|
|
25357
25618
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
25358
25619
|
if (!vueCompiler) {
|
|
25359
25620
|
vueCompiler = await loadVueCompiler();
|
|
@@ -25366,7 +25627,7 @@ ${code}`;
|
|
|
25366
25627
|
fs: {
|
|
25367
25628
|
fileExists: existsSync32,
|
|
25368
25629
|
realpath: realpathSync3,
|
|
25369
|
-
readFile: (file4) => existsSync32(file4) ?
|
|
25630
|
+
readFile: (file4) => existsSync32(file4) ? readFileSync28(file4, "utf-8") : undefined
|
|
25370
25631
|
},
|
|
25371
25632
|
id: componentId,
|
|
25372
25633
|
inlineTemplate: false
|
|
@@ -25381,7 +25642,7 @@ ${code}`;
|
|
|
25381
25642
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25382
25643
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25383
25644
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25384
|
-
const hmrBase = vueDir ?
|
|
25645
|
+
const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
|
|
25385
25646
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25386
25647
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25387
25648
|
result += [
|
|
@@ -25413,7 +25674,7 @@ ${code}`;
|
|
|
25413
25674
|
}
|
|
25414
25675
|
});
|
|
25415
25676
|
}, handleCssRequest = (filePath) => {
|
|
25416
|
-
const raw =
|
|
25677
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25417
25678
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25418
25679
|
return [
|
|
25419
25680
|
`const style = document.createElement('style');`,
|
|
@@ -25545,7 +25806,7 @@ export default {};
|
|
|
25545
25806
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25546
25807
|
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);`);
|
|
25547
25808
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25548
|
-
const filePath =
|
|
25809
|
+
const filePath = resolve39(projectRoot, relPath);
|
|
25549
25810
|
const ext = extname12(filePath);
|
|
25550
25811
|
if (ext === ".svelte")
|
|
25551
25812
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25582,14 +25843,14 @@ export default {};
|
|
|
25582
25843
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25583
25844
|
const candidates = [
|
|
25584
25845
|
absoluteCandidate,
|
|
25585
|
-
|
|
25846
|
+
resolve39(projectRoot, tail)
|
|
25586
25847
|
];
|
|
25587
25848
|
try {
|
|
25588
25849
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25589
25850
|
const cfg = await loadConfig2();
|
|
25590
|
-
const angularDir = cfg.angularDirectory &&
|
|
25851
|
+
const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
|
|
25591
25852
|
if (angularDir)
|
|
25592
|
-
candidates.push(
|
|
25853
|
+
candidates.push(resolve39(angularDir, tail));
|
|
25593
25854
|
} catch {}
|
|
25594
25855
|
for (const candidate of candidates) {
|
|
25595
25856
|
if (await fileExists(candidate)) {
|
|
@@ -25620,7 +25881,7 @@ export default {};
|
|
|
25620
25881
|
if (!TRANSPILABLE.has(ext))
|
|
25621
25882
|
return;
|
|
25622
25883
|
const stat3 = statSync6(filePath);
|
|
25623
|
-
const resolvedVueDir = vueDir ?
|
|
25884
|
+
const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
|
|
25624
25885
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25625
25886
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25626
25887
|
if (isAngularGeneratedJs) {
|
|
@@ -25679,7 +25940,7 @@ export default {};
|
|
|
25679
25940
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25680
25941
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25681
25942
|
return handleBunWrapRequest();
|
|
25682
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
25943
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
|
|
25683
25944
|
if (virtualCssResponse)
|
|
25684
25945
|
return virtualCssResponse;
|
|
25685
25946
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25695,11 +25956,11 @@ export default {};
|
|
|
25695
25956
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25696
25957
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25697
25958
|
if (match[1])
|
|
25698
|
-
files.push(
|
|
25959
|
+
files.push(resolve39(projectRoot, match[1]));
|
|
25699
25960
|
}
|
|
25700
25961
|
return files;
|
|
25701
25962
|
}, invalidateModule = (filePath) => {
|
|
25702
|
-
const resolved =
|
|
25963
|
+
const resolved = resolve39(filePath);
|
|
25703
25964
|
invalidate(filePath);
|
|
25704
25965
|
if (resolved !== filePath)
|
|
25705
25966
|
invalidate(resolved);
|
|
@@ -25862,7 +26123,7 @@ __export(exports_hmrCompiler, {
|
|
|
25862
26123
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25863
26124
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25864
26125
|
});
|
|
25865
|
-
import { dirname as
|
|
26126
|
+
import { dirname as dirname28, relative as relative17, resolve as resolve40 } from "path";
|
|
25866
26127
|
import { performance as performance2 } from "perf_hooks";
|
|
25867
26128
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25868
26129
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25874,7 +26135,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25874
26135
|
return null;
|
|
25875
26136
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25876
26137
|
const className = decoded.slice(separatorIndex + 1);
|
|
25877
|
-
const componentFilePath =
|
|
26138
|
+
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
25878
26139
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25879
26140
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25880
26141
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25885,7 +26146,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25885
26146
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25886
26147
|
const owners = resolveOwningComponents2({
|
|
25887
26148
|
changedFilePath: componentFilePath,
|
|
25888
|
-
userAngularRoot:
|
|
26149
|
+
userAngularRoot: dirname28(componentFilePath)
|
|
25889
26150
|
});
|
|
25890
26151
|
const owner = owners.find((o3) => o3.className === className);
|
|
25891
26152
|
const kind = owner?.kind ?? "component";
|
|
@@ -26080,11 +26341,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
26080
26341
|
__export(exports_simpleHTMLHMR, {
|
|
26081
26342
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
26082
26343
|
});
|
|
26083
|
-
import { resolve as
|
|
26344
|
+
import { resolve as resolve41 } from "path";
|
|
26084
26345
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
26085
26346
|
let htmlContent;
|
|
26086
26347
|
try {
|
|
26087
|
-
const resolvedPath =
|
|
26348
|
+
const resolvedPath = resolve41(htmlFilePath);
|
|
26088
26349
|
const file4 = Bun.file(resolvedPath);
|
|
26089
26350
|
if (!await file4.exists()) {
|
|
26090
26351
|
return null;
|
|
@@ -26110,11 +26371,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
26110
26371
|
__export(exports_simpleHTMXHMR, {
|
|
26111
26372
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
26112
26373
|
});
|
|
26113
|
-
import { resolve as
|
|
26374
|
+
import { resolve as resolve42 } from "path";
|
|
26114
26375
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
26115
26376
|
let htmlContent;
|
|
26116
26377
|
try {
|
|
26117
|
-
const resolvedPath =
|
|
26378
|
+
const resolvedPath = resolve42(htmxFilePath);
|
|
26118
26379
|
const file4 = Bun.file(resolvedPath);
|
|
26119
26380
|
if (!await file4.exists()) {
|
|
26120
26381
|
return null;
|
|
@@ -26139,9 +26400,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
26139
26400
|
import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
26140
26401
|
import {
|
|
26141
26402
|
basename as basename17,
|
|
26142
|
-
dirname as
|
|
26403
|
+
dirname as dirname29,
|
|
26143
26404
|
isAbsolute as isAbsolute6,
|
|
26144
|
-
join as
|
|
26405
|
+
join as join43,
|
|
26145
26406
|
relative as relative18,
|
|
26146
26407
|
resolve as resolvePath,
|
|
26147
26408
|
sep as sep4
|
|
@@ -26268,8 +26529,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26268
26529
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26269
26530
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26270
26531
|
for (const candidate of [
|
|
26271
|
-
|
|
26272
|
-
`${
|
|
26532
|
+
join43(generatedDir, relJs),
|
|
26533
|
+
`${join43(generatedDir, relJs)}.map`
|
|
26273
26534
|
]) {
|
|
26274
26535
|
try {
|
|
26275
26536
|
rmSync3(candidate, { force: true });
|
|
@@ -26504,7 +26765,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26504
26765
|
const { buildDir } = state.resolvedPaths;
|
|
26505
26766
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26506
26767
|
const { mkdir: mkdir9, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
26507
|
-
await mkdir9(
|
|
26768
|
+
await mkdir9(dirname29(destPath), { recursive: true });
|
|
26508
26769
|
await copyFile(absSource, destPath);
|
|
26509
26770
|
const bytes = await readFile7(destPath);
|
|
26510
26771
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26685,7 +26946,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26685
26946
|
const keepStemsByDir = new Map;
|
|
26686
26947
|
const prefixByDir = new Map;
|
|
26687
26948
|
for (const artifact of freshOutputs) {
|
|
26688
|
-
const dir =
|
|
26949
|
+
const dir = dirname29(artifact.path);
|
|
26689
26950
|
const name = basename17(artifact.path);
|
|
26690
26951
|
const [prefix] = name.split(".");
|
|
26691
26952
|
if (!prefix)
|
|
@@ -27048,8 +27309,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27048
27309
|
};
|
|
27049
27310
|
return ({ immediate = false } = {}) => {
|
|
27050
27311
|
if (!ctx.debouncedPromise) {
|
|
27051
|
-
ctx.debouncedPromise = new Promise((
|
|
27052
|
-
ctx.debouncedResolve =
|
|
27312
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
27313
|
+
ctx.debouncedResolve = resolve43;
|
|
27053
27314
|
});
|
|
27054
27315
|
}
|
|
27055
27316
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -27171,7 +27432,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27171
27432
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
27172
27433
|
const files = [];
|
|
27173
27434
|
for (const entry of entries) {
|
|
27174
|
-
const full =
|
|
27435
|
+
const full = join43(dir, entry.name);
|
|
27175
27436
|
if (entry.isDirectory()) {
|
|
27176
27437
|
files.push(...await walk(full));
|
|
27177
27438
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27581,8 +27842,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27581
27842
|
};
|
|
27582
27843
|
return () => {
|
|
27583
27844
|
if (!ctx.debouncedPromise) {
|
|
27584
|
-
ctx.debouncedPromise = new Promise((
|
|
27585
|
-
ctx.debouncedResolve =
|
|
27845
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
27846
|
+
ctx.debouncedResolve = resolve43;
|
|
27586
27847
|
});
|
|
27587
27848
|
}
|
|
27588
27849
|
if (ctx.debounceTimer)
|
|
@@ -27731,7 +27992,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27731
27992
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27732
27993
|
const serverEntries = [...vueServerPaths];
|
|
27733
27994
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27734
|
-
const cssOutDir =
|
|
27995
|
+
const cssOutDir = join43(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27735
27996
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27736
27997
|
const serverExternals = await getServerBundleExternals();
|
|
27737
27998
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27856,8 +28117,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27856
28117
|
};
|
|
27857
28118
|
return () => {
|
|
27858
28119
|
if (!ctx.debouncedPromise) {
|
|
27859
|
-
ctx.debouncedPromise = new Promise((
|
|
27860
|
-
ctx.debouncedResolve =
|
|
28120
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
28121
|
+
ctx.debouncedResolve = resolve43;
|
|
27861
28122
|
});
|
|
27862
28123
|
}
|
|
27863
28124
|
if (ctx.debounceTimer)
|
|
@@ -28007,7 +28268,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28007
28268
|
if (!buildReference?.source) {
|
|
28008
28269
|
return;
|
|
28009
28270
|
}
|
|
28010
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(
|
|
28271
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname29(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
28011
28272
|
islandFiles.add(resolvePath(sourcePath));
|
|
28012
28273
|
}, resolveIslandSourceFiles = async (config) => {
|
|
28013
28274
|
const registryPath = config.islands?.registry;
|
|
@@ -28840,7 +29101,7 @@ __export(exports_buildDepVendor, {
|
|
|
28840
29101
|
});
|
|
28841
29102
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
28842
29103
|
import { isBuiltin } from "module";
|
|
28843
|
-
import { join as
|
|
29104
|
+
import { join as join44 } from "path";
|
|
28844
29105
|
import { rm as rm11 } from "fs/promises";
|
|
28845
29106
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
28846
29107
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -28899,8 +29160,8 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28899
29160
|
framework: Array.from(framework).filter(isResolvable3)
|
|
28900
29161
|
};
|
|
28901
29162
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
28902
|
-
const { readFileSync:
|
|
28903
|
-
const { dirname:
|
|
29163
|
+
const { readFileSync: readFileSync29 } = await import("fs");
|
|
29164
|
+
const { dirname: dirname30 } = await import("path");
|
|
28904
29165
|
const seenFiles = new Set;
|
|
28905
29166
|
const bareOut = new Set;
|
|
28906
29167
|
const queue = [
|
|
@@ -28915,7 +29176,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28915
29176
|
continue;
|
|
28916
29177
|
let content;
|
|
28917
29178
|
try {
|
|
28918
|
-
content =
|
|
29179
|
+
content = readFileSync29(path, "utf-8");
|
|
28919
29180
|
} catch {
|
|
28920
29181
|
continue;
|
|
28921
29182
|
}
|
|
@@ -28925,7 +29186,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28925
29186
|
} catch {
|
|
28926
29187
|
continue;
|
|
28927
29188
|
}
|
|
28928
|
-
const fromDir =
|
|
29189
|
+
const fromDir = dirname30(path);
|
|
28929
29190
|
for (const imp of imports) {
|
|
28930
29191
|
const child = imp.path;
|
|
28931
29192
|
if (child.startsWith(".") || child.startsWith("/")) {
|
|
@@ -28989,7 +29250,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28989
29250
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
28990
29251
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
28991
29252
|
const safeName = toSafeFileName6(specifier);
|
|
28992
|
-
const entryPath =
|
|
29253
|
+
const entryPath = join44(tmpDir, `${safeName}.ts`);
|
|
28993
29254
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
28994
29255
|
return { entryPath, specifier };
|
|
28995
29256
|
}));
|
|
@@ -29080,9 +29341,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29080
29341
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
29081
29342
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
29082
29343
|
return {};
|
|
29083
|
-
const vendorDir =
|
|
29344
|
+
const vendorDir = join44(buildDir, "vendor");
|
|
29084
29345
|
mkdirSync14(vendorDir, { recursive: true });
|
|
29085
|
-
const tmpDir =
|
|
29346
|
+
const tmpDir = join44(buildDir, "_dep_vendor_tmp");
|
|
29086
29347
|
mkdirSync14(tmpDir, { recursive: true });
|
|
29087
29348
|
const allSpecs = new Set(initialSpecs);
|
|
29088
29349
|
const alreadyScanned = new Set;
|
|
@@ -29165,7 +29426,7 @@ __export(exports_devBuild, {
|
|
|
29165
29426
|
});
|
|
29166
29427
|
import { readdir as readdir5 } from "fs/promises";
|
|
29167
29428
|
import { statSync as statSync7 } from "fs";
|
|
29168
|
-
import { resolve as
|
|
29429
|
+
import { resolve as resolve43 } from "path";
|
|
29169
29430
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
29170
29431
|
const configuredDirs = [
|
|
29171
29432
|
config.reactDirectory,
|
|
@@ -29188,7 +29449,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29188
29449
|
return Object.keys(config).length > 0 ? config : null;
|
|
29189
29450
|
}, reloadConfig = async () => {
|
|
29190
29451
|
try {
|
|
29191
|
-
const configPath2 =
|
|
29452
|
+
const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
29192
29453
|
const source = await Bun.file(configPath2).text();
|
|
29193
29454
|
return parseDirectoryConfig(source);
|
|
29194
29455
|
} catch {
|
|
@@ -29300,7 +29561,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29300
29561
|
});
|
|
29301
29562
|
}
|
|
29302
29563
|
}, handleCachedReload = async () => {
|
|
29303
|
-
const serverMtime = statSync7(
|
|
29564
|
+
const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
29304
29565
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
29305
29566
|
globalThis.__hmrServerMtime = serverMtime;
|
|
29306
29567
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -29337,8 +29598,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29337
29598
|
return true;
|
|
29338
29599
|
}, resolveAbsoluteVersion2 = async () => {
|
|
29339
29600
|
const candidates = [
|
|
29340
|
-
|
|
29341
|
-
|
|
29601
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
29602
|
+
resolve43(import.meta.dir, "..", "package.json")
|
|
29342
29603
|
];
|
|
29343
29604
|
const [candidate, ...remaining] = candidates;
|
|
29344
29605
|
if (!candidate) {
|
|
@@ -29364,7 +29625,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29364
29625
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
29365
29626
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
29366
29627
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
29367
|
-
const bytes = await Bun.file(
|
|
29628
|
+
const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
|
|
29368
29629
|
assetStore.set(webPath, bytes);
|
|
29369
29630
|
}));
|
|
29370
29631
|
}, devBuild = async (config) => {
|
|
@@ -29503,11 +29764,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29503
29764
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
29504
29765
|
recordStep("populate asset store", stepStartedAt);
|
|
29505
29766
|
stepStartedAt = performance.now();
|
|
29506
|
-
const reactVendorDir =
|
|
29507
|
-
const angularVendorDir =
|
|
29508
|
-
const svelteVendorDir =
|
|
29509
|
-
const vueVendorDir =
|
|
29510
|
-
const depVendorDir =
|
|
29767
|
+
const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29768
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29769
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29770
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29771
|
+
const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
|
|
29511
29772
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
29512
29773
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
29513
29774
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -29585,7 +29846,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29585
29846
|
manifest
|
|
29586
29847
|
};
|
|
29587
29848
|
globalThis.__hmrDevResult = result;
|
|
29588
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
29849
|
+
globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
29589
29850
|
return result;
|
|
29590
29851
|
};
|
|
29591
29852
|
var init_devBuild = __esm(() => {
|
|
@@ -29622,5 +29883,5 @@ export {
|
|
|
29622
29883
|
build
|
|
29623
29884
|
};
|
|
29624
29885
|
|
|
29625
|
-
//# debugId=
|
|
29886
|
+
//# debugId=452381297EE1F66D64756E2164756E21
|
|
29626
29887
|
//# sourceMappingURL=build.js.map
|