@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/index.js
CHANGED
|
@@ -13198,9 +13198,260 @@ var isTestSourcePath = (file2) => {
|
|
|
13198
13198
|
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
13199
13199
|
};
|
|
13200
13200
|
|
|
13201
|
+
// node_modules/@absolutejs/sync/dist/client/index.js
|
|
13202
|
+
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")), registry, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
13203
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
13204
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
|
|
13205
|
+
return value;
|
|
13206
|
+
}, isSchemaBundle = (schema) => ("components" in schema), normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
|
|
13207
|
+
const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
|
|
13208
|
+
const ids = new Set;
|
|
13209
|
+
for (const component of components) {
|
|
13210
|
+
if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
|
|
13211
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
|
|
13212
|
+
if (ids.has(component.id))
|
|
13213
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
|
|
13214
|
+
ids.add(component.id);
|
|
13215
|
+
}
|
|
13216
|
+
return components.sort((a, b2) => a.id.localeCompare(b2.id));
|
|
13217
|
+
}, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
|
|
13218
|
+
const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
|
|
13219
|
+
const current = resolveSyncLocalMigrations(component.version, component);
|
|
13220
|
+
return {
|
|
13221
|
+
id: component.id,
|
|
13222
|
+
...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
|
|
13223
|
+
};
|
|
13224
|
+
});
|
|
13225
|
+
const active = new Set(components.map((component) => component.id));
|
|
13226
|
+
const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
|
|
13227
|
+
return { components, orphanedComponents };
|
|
13228
|
+
}, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
|
|
13229
|
+
positiveVersion(storedVersion, "Stored Sync schema version");
|
|
13230
|
+
const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
|
|
13231
|
+
const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
|
|
13232
|
+
const versions = new Set;
|
|
13233
|
+
for (const migration of migrations) {
|
|
13234
|
+
positiveVersion(migration.toVersion, "Sync migration toVersion");
|
|
13235
|
+
if (versions.has(migration.toVersion))
|
|
13236
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
|
|
13237
|
+
versions.add(migration.toVersion);
|
|
13238
|
+
}
|
|
13239
|
+
const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
|
|
13240
|
+
const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
|
|
13241
|
+
if (minimumCompatibleVersion > targetVersion)
|
|
13242
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
|
|
13243
|
+
if (storedVersion > targetVersion)
|
|
13244
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
|
|
13245
|
+
if (storedVersion < minimumCompatibleVersion)
|
|
13246
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
|
|
13247
|
+
const steps = [];
|
|
13248
|
+
for (let version = storedVersion + 1;version <= targetVersion; version++) {
|
|
13249
|
+
const migration = migrations.find((candidate) => candidate.toVersion === version);
|
|
13250
|
+
if (migration === undefined)
|
|
13251
|
+
throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
|
|
13252
|
+
steps.push(migration);
|
|
13253
|
+
}
|
|
13254
|
+
return { minimumCompatibleVersion, steps, targetVersion };
|
|
13255
|
+
};
|
|
13256
|
+
var init_client = __esm(() => {
|
|
13257
|
+
RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
|
|
13258
|
+
host = globalThis;
|
|
13259
|
+
registry = (() => {
|
|
13260
|
+
const existing = host[RUNTIME_TRANSPORT];
|
|
13261
|
+
if (isRegistry(existing))
|
|
13262
|
+
return existing;
|
|
13263
|
+
const created = { installations: [] };
|
|
13264
|
+
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
13265
|
+
configurable: false,
|
|
13266
|
+
enumerable: false,
|
|
13267
|
+
value: created,
|
|
13268
|
+
writable: false
|
|
13269
|
+
});
|
|
13270
|
+
return created;
|
|
13271
|
+
})();
|
|
13272
|
+
SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
|
|
13273
|
+
code;
|
|
13274
|
+
storedVersion;
|
|
13275
|
+
targetVersion;
|
|
13276
|
+
constructor(code, message, versions = {}) {
|
|
13277
|
+
super(message);
|
|
13278
|
+
this.name = "SyncLocalStoreSchemaError";
|
|
13279
|
+
this.code = code;
|
|
13280
|
+
this.storedVersion = versions.storedVersion;
|
|
13281
|
+
this.targetVersion = versions.targetVersion;
|
|
13282
|
+
}
|
|
13283
|
+
};
|
|
13284
|
+
});
|
|
13285
|
+
|
|
13286
|
+
// src/mobile/syncSchema.ts
|
|
13287
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
13288
|
+
import { dirname as dirname16, join as join29, resolve as resolve25 } from "path";
|
|
13289
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
13290
|
+
try {
|
|
13291
|
+
const value = JSON.parse(readFileSync17(path, "utf8"));
|
|
13292
|
+
return object(value) ? value : undefined;
|
|
13293
|
+
} catch {
|
|
13294
|
+
return;
|
|
13295
|
+
}
|
|
13296
|
+
}, localSchemaMetadata = (manifest) => {
|
|
13297
|
+
const absolutejs = Reflect.get(manifest, "absolutejs");
|
|
13298
|
+
if (!object(absolutejs))
|
|
13299
|
+
return;
|
|
13300
|
+
const sync = Reflect.get(absolutejs, "sync");
|
|
13301
|
+
if (!object(sync))
|
|
13302
|
+
return;
|
|
13303
|
+
return Reflect.get(sync, "localSchema");
|
|
13304
|
+
}, packageManifestPath = (projectRoot, packageName) => {
|
|
13305
|
+
let directory = resolve25(projectRoot);
|
|
13306
|
+
while (true) {
|
|
13307
|
+
const candidate = join29(directory, "node_modules", packageName, "package.json");
|
|
13308
|
+
const manifest = manifestAt(candidate);
|
|
13309
|
+
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
13310
|
+
return candidate;
|
|
13311
|
+
const parent = dirname16(directory);
|
|
13312
|
+
if (parent === directory)
|
|
13313
|
+
return;
|
|
13314
|
+
directory = parent;
|
|
13315
|
+
}
|
|
13316
|
+
}, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
|
|
13317
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
13318
|
+
throw metadataError(id, `${field} must be a positive safe integer.`);
|
|
13319
|
+
return value;
|
|
13320
|
+
}, nonEmpty = (value, id, field) => {
|
|
13321
|
+
if (typeof value !== "string" || value.trim() !== value || value.length === 0)
|
|
13322
|
+
throw metadataError(id, `${field} must be a non-empty trimmed string.`);
|
|
13323
|
+
return value;
|
|
13324
|
+
}, requireObject = (value, id, detail) => {
|
|
13325
|
+
if (!object(value))
|
|
13326
|
+
throw metadataError(id, detail);
|
|
13327
|
+
return value;
|
|
13328
|
+
}, normalizeJsonValue2 = (value, id, field) => {
|
|
13329
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
13330
|
+
return value;
|
|
13331
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
13332
|
+
return value;
|
|
13333
|
+
if (Array.isArray(value))
|
|
13334
|
+
return value.map((entry) => normalizeJsonValue2(entry, id, field));
|
|
13335
|
+
if (object(value))
|
|
13336
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
13337
|
+
key,
|
|
13338
|
+
normalizeJsonValue2(entry, id, field)
|
|
13339
|
+
]));
|
|
13340
|
+
throw metadataError(id, `${field} must be JSON-safe.`);
|
|
13341
|
+
}, operation = (value, id, index) => {
|
|
13342
|
+
const record = requireObject(value, id, `migration operation ${index} must be an object.`);
|
|
13343
|
+
const type = Reflect.get(record, "type");
|
|
13344
|
+
const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
|
|
13345
|
+
if (type === "delete-collection")
|
|
13346
|
+
return { collection, type };
|
|
13347
|
+
if (type === "rename-field")
|
|
13348
|
+
return {
|
|
13349
|
+
collection,
|
|
13350
|
+
from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
|
|
13351
|
+
to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
|
|
13352
|
+
type
|
|
13353
|
+
};
|
|
13354
|
+
const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
|
|
13355
|
+
if (type === "remove-field")
|
|
13356
|
+
return { collection, field, type };
|
|
13357
|
+
if (type === "set-default")
|
|
13358
|
+
return {
|
|
13359
|
+
collection,
|
|
13360
|
+
field,
|
|
13361
|
+
type,
|
|
13362
|
+
value: normalizeJsonValue2(Reflect.get(record, "value"), id, `operation ${index}.value`)
|
|
13363
|
+
};
|
|
13364
|
+
throw metadataError(id, `operation ${index}.type is not supported.`);
|
|
13365
|
+
}, migration = (value, id, index) => {
|
|
13366
|
+
const record = requireObject(value, id, `migration ${index} must be an object.`);
|
|
13367
|
+
const allowed = new Set(["operations", "toVersion"]);
|
|
13368
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13369
|
+
if (unsupported)
|
|
13370
|
+
throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
|
|
13371
|
+
const declaredOperations = Reflect.get(record, "operations");
|
|
13372
|
+
if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
|
|
13373
|
+
throw metadataError(id, `migration ${index}.operations must be an array.`);
|
|
13374
|
+
const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
|
|
13375
|
+
return {
|
|
13376
|
+
operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
|
|
13377
|
+
toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
|
|
13378
|
+
};
|
|
13379
|
+
}, component = (id, value) => {
|
|
13380
|
+
const record = requireObject(value, id, "localSchema must be an object.");
|
|
13381
|
+
const allowed = new Set([
|
|
13382
|
+
"migrations",
|
|
13383
|
+
"minimumCompatibleVersion",
|
|
13384
|
+
"version"
|
|
13385
|
+
]);
|
|
13386
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13387
|
+
if (unsupported)
|
|
13388
|
+
throw metadataError(id, `${unsupported} is not supported.`);
|
|
13389
|
+
const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
|
|
13390
|
+
const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
|
|
13391
|
+
const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
|
|
13392
|
+
const declaredMigrations = Reflect.get(record, "migrations");
|
|
13393
|
+
if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
|
|
13394
|
+
throw metadataError(id, "migrations must be an array.");
|
|
13395
|
+
const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
|
|
13396
|
+
return {
|
|
13397
|
+
id,
|
|
13398
|
+
minimumCompatibleVersion,
|
|
13399
|
+
...Array.isArray(migrations) ? {
|
|
13400
|
+
migrations: migrations.map((entry, index) => migration(entry, id, index))
|
|
13401
|
+
} : {},
|
|
13402
|
+
version
|
|
13403
|
+
};
|
|
13404
|
+
}, dependencyNames = (manifest) => [
|
|
13405
|
+
Reflect.get(manifest, "dependencies"),
|
|
13406
|
+
Reflect.get(manifest, "optionalDependencies"),
|
|
13407
|
+
Reflect.get(manifest, "devDependencies"),
|
|
13408
|
+
Reflect.get(manifest, "peerDependencies")
|
|
13409
|
+
].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
13410
|
+
const appManifestPath = join29(resolve25(projectRoot), "package.json");
|
|
13411
|
+
const appManifest = manifestAt(appManifestPath);
|
|
13412
|
+
if (!appManifest)
|
|
13413
|
+
return {
|
|
13414
|
+
components: [
|
|
13415
|
+
{
|
|
13416
|
+
id: "@absolutejs/app",
|
|
13417
|
+
minimumCompatibleVersion: 1,
|
|
13418
|
+
version: 1
|
|
13419
|
+
}
|
|
13420
|
+
],
|
|
13421
|
+
sources: []
|
|
13422
|
+
};
|
|
13423
|
+
const appMetadata = localSchemaMetadata(appManifest);
|
|
13424
|
+
const components = [
|
|
13425
|
+
appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
|
|
13426
|
+
];
|
|
13427
|
+
const sources = [
|
|
13428
|
+
{ id: "@absolutejs/app", manifestPath: appManifestPath }
|
|
13429
|
+
];
|
|
13430
|
+
for (const name of dependencyNames(appManifest)) {
|
|
13431
|
+
const manifestPath = packageManifestPath(projectRoot, name);
|
|
13432
|
+
if (!manifestPath)
|
|
13433
|
+
continue;
|
|
13434
|
+
const manifest = manifestAt(manifestPath);
|
|
13435
|
+
if (!manifest)
|
|
13436
|
+
continue;
|
|
13437
|
+
const metadata2 = localSchemaMetadata(manifest);
|
|
13438
|
+
if (metadata2 === undefined)
|
|
13439
|
+
continue;
|
|
13440
|
+
components.push(component(name, metadata2));
|
|
13441
|
+
sources.push({ id: name, manifestPath });
|
|
13442
|
+
}
|
|
13443
|
+
components.sort((left, right) => left.id.localeCompare(right.id));
|
|
13444
|
+
sources.sort((left, right) => left.id.localeCompare(right.id));
|
|
13445
|
+
resolveSyncLocalSchemaComponents({}, { components });
|
|
13446
|
+
return { components, sources };
|
|
13447
|
+
};
|
|
13448
|
+
var init_syncSchema = __esm(() => {
|
|
13449
|
+
init_client();
|
|
13450
|
+
});
|
|
13451
|
+
|
|
13201
13452
|
// src/build/pwa.ts
|
|
13202
13453
|
import { mkdir as mkdir8, rm as rm7, writeFile as writeFile8 } from "fs/promises";
|
|
13203
|
-
import { dirname as
|
|
13454
|
+
import { dirname as dirname17, join as join30 } from "path";
|
|
13204
13455
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
13205
13456
|
const input = value ?? fallback;
|
|
13206
13457
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -13227,7 +13478,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
13227
13478
|
}
|
|
13228
13479
|
}
|
|
13229
13480
|
return url.pathname;
|
|
13230
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
13481
|
+
}, destinationFor = (buildPath, publicPath) => join30(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
13231
13482
|
clientModule,
|
|
13232
13483
|
manifestPath,
|
|
13233
13484
|
serviceWorkerPath,
|
|
@@ -13239,7 +13490,7 @@ manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
|
13239
13490
|
if (!manifest.isConnected) document.head.append(manifest);
|
|
13240
13491
|
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
13241
13492
|
deferUntilLoad: false${sync ? `,
|
|
13242
|
-
sync: ${JSON.stringify(sync
|
|
13493
|
+
sync: ${JSON.stringify(sync)}` : ""}
|
|
13243
13494
|
});
|
|
13244
13495
|
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
13245
13496
|
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
@@ -13257,6 +13508,7 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13257
13508
|
buildPath,
|
|
13258
13509
|
config,
|
|
13259
13510
|
generatedRoot,
|
|
13511
|
+
projectRoot,
|
|
13260
13512
|
write: write2 = true
|
|
13261
13513
|
}) => {
|
|
13262
13514
|
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
@@ -13272,9 +13524,10 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13272
13524
|
};
|
|
13273
13525
|
if (!write2)
|
|
13274
13526
|
return artifacts;
|
|
13527
|
+
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
13275
13528
|
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
13276
13529
|
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
13277
|
-
await mkdir8(
|
|
13530
|
+
await mkdir8(dirname17(workerDestination), { recursive: true });
|
|
13278
13531
|
await writeFile8(workerDestination, `${pushServiceWorker({
|
|
13279
13532
|
...config.serviceWorker ?? {},
|
|
13280
13533
|
sync: Boolean(config.sync)
|
|
@@ -13283,19 +13536,24 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13283
13536
|
if (config.manifest && manifestPath) {
|
|
13284
13537
|
const { path: _path, ...manifestConfig } = config.manifest;
|
|
13285
13538
|
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
13286
|
-
await mkdir8(
|
|
13539
|
+
await mkdir8(dirname17(manifestDestination), { recursive: true });
|
|
13287
13540
|
await writeFile8(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
13288
13541
|
`);
|
|
13289
13542
|
}
|
|
13290
|
-
const generatedDirectory =
|
|
13291
|
-
const bootstrapEntry =
|
|
13543
|
+
const generatedDirectory = join30(generatedRoot, "pwa");
|
|
13544
|
+
const bootstrapEntry = join30(generatedDirectory, "bootstrap.ts");
|
|
13292
13545
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
13293
13546
|
await mkdir8(generatedDirectory, { recursive: true });
|
|
13294
13547
|
await writeFile8(bootstrapEntry, bootstrapEntrySource({
|
|
13295
13548
|
clientModule,
|
|
13296
13549
|
manifestPath,
|
|
13297
13550
|
serviceWorkerPath,
|
|
13298
|
-
sync: config.sync
|
|
13551
|
+
sync: config.sync ? {
|
|
13552
|
+
...config.sync === true ? {} : config.sync,
|
|
13553
|
+
storageSchema: {
|
|
13554
|
+
components: syncSchema?.components ?? []
|
|
13555
|
+
}
|
|
13556
|
+
} : config.sync
|
|
13299
13557
|
}));
|
|
13300
13558
|
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
13301
13559
|
await rm7(browserDirectory, { force: true, recursive: true });
|
|
@@ -13318,15 +13576,17 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13318
13576
|
}
|
|
13319
13577
|
return artifacts;
|
|
13320
13578
|
};
|
|
13321
|
-
var init_pwa = () => {
|
|
13579
|
+
var init_pwa = __esm(() => {
|
|
13580
|
+
init_syncSchema();
|
|
13581
|
+
});
|
|
13322
13582
|
|
|
13323
13583
|
// src/build/scanVueSsrOnlyPages.ts
|
|
13324
13584
|
var exports_scanVueSsrOnlyPages = {};
|
|
13325
13585
|
__export(exports_scanVueSsrOnlyPages, {
|
|
13326
13586
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
13327
13587
|
});
|
|
13328
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
13329
|
-
import { join as
|
|
13588
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync18 } from "fs";
|
|
13589
|
+
import { join as join31 } from "path";
|
|
13330
13590
|
import ts8 from "typescript";
|
|
13331
13591
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
13332
13592
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13359,9 +13619,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13359
13619
|
continue;
|
|
13360
13620
|
if (entry.name.startsWith("."))
|
|
13361
13621
|
continue;
|
|
13362
|
-
stack.push(
|
|
13622
|
+
stack.push(join31(dir, entry.name));
|
|
13363
13623
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
13364
|
-
out.push(
|
|
13624
|
+
out.push(join31(dir, entry.name));
|
|
13365
13625
|
}
|
|
13366
13626
|
}
|
|
13367
13627
|
}
|
|
@@ -13428,7 +13688,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13428
13688
|
}, extractFromFile = (filePath, out) => {
|
|
13429
13689
|
let source;
|
|
13430
13690
|
try {
|
|
13431
|
-
source =
|
|
13691
|
+
source = readFileSync18(filePath, "utf-8");
|
|
13432
13692
|
} catch {
|
|
13433
13693
|
return;
|
|
13434
13694
|
}
|
|
@@ -13472,8 +13732,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13472
13732
|
});
|
|
13473
13733
|
|
|
13474
13734
|
// src/build/scanAngularHandlerCalls.ts
|
|
13475
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
13476
|
-
import { join as
|
|
13735
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync19 } from "fs";
|
|
13736
|
+
import { join as join32 } from "path";
|
|
13477
13737
|
import ts9 from "typescript";
|
|
13478
13738
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13479
13739
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13506,9 +13766,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13506
13766
|
continue;
|
|
13507
13767
|
if (entry.name.startsWith("."))
|
|
13508
13768
|
continue;
|
|
13509
|
-
stack.push(
|
|
13769
|
+
stack.push(join32(dir, entry.name));
|
|
13510
13770
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13511
|
-
out.push(
|
|
13771
|
+
out.push(join32(dir, entry.name));
|
|
13512
13772
|
}
|
|
13513
13773
|
}
|
|
13514
13774
|
}
|
|
@@ -13543,7 +13803,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13543
13803
|
}, extractCallsFromFile = (filePath, out) => {
|
|
13544
13804
|
let source;
|
|
13545
13805
|
try {
|
|
13546
|
-
source =
|
|
13806
|
+
source = readFileSync19(filePath, "utf-8");
|
|
13547
13807
|
} catch {
|
|
13548
13808
|
return;
|
|
13549
13809
|
}
|
|
@@ -13622,8 +13882,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13622
13882
|
});
|
|
13623
13883
|
|
|
13624
13884
|
// src/build/scanAngularPageRoutes.ts
|
|
13625
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
13626
|
-
import { basename as basename9, join as
|
|
13885
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
13886
|
+
import { basename as basename9, join as join33 } from "path";
|
|
13627
13887
|
import ts10 from "typescript";
|
|
13628
13888
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13629
13889
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13663,9 +13923,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13663
13923
|
continue;
|
|
13664
13924
|
if (entry.name.startsWith("."))
|
|
13665
13925
|
continue;
|
|
13666
|
-
stack.push(
|
|
13926
|
+
stack.push(join33(dir, entry.name));
|
|
13667
13927
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13668
|
-
out.push(
|
|
13928
|
+
out.push(join33(dir, entry.name));
|
|
13669
13929
|
}
|
|
13670
13930
|
}
|
|
13671
13931
|
}
|
|
@@ -13694,7 +13954,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13694
13954
|
for (const file2 of files) {
|
|
13695
13955
|
let source;
|
|
13696
13956
|
try {
|
|
13697
|
-
source =
|
|
13957
|
+
source = readFileSync20(file2, "utf-8");
|
|
13698
13958
|
} catch {
|
|
13699
13959
|
continue;
|
|
13700
13960
|
}
|
|
@@ -13741,8 +14001,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
13741
14001
|
__export(exports_parseAngularConfigImports, {
|
|
13742
14002
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13743
14003
|
});
|
|
13744
|
-
import { existsSync as existsSync23, readFileSync as
|
|
13745
|
-
import { dirname as
|
|
14004
|
+
import { existsSync as existsSync23, readFileSync as readFileSync21 } from "fs";
|
|
14005
|
+
import { dirname as dirname18, isAbsolute as isAbsolute3, join as join34 } from "path";
|
|
13746
14006
|
import ts11 from "typescript";
|
|
13747
14007
|
var findDefineConfigCall = (sf) => {
|
|
13748
14008
|
let result = null;
|
|
@@ -13760,8 +14020,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13760
14020
|
};
|
|
13761
14021
|
ts11.forEachChild(sf, visit);
|
|
13762
14022
|
return result;
|
|
13763
|
-
}, findPropertyInitializer = (
|
|
13764
|
-
for (const prop of
|
|
14023
|
+
}, findPropertyInitializer = (object2, name) => {
|
|
14024
|
+
for (const prop of object2.properties) {
|
|
13765
14025
|
if (!ts11.isPropertyAssignment(prop))
|
|
13766
14026
|
continue;
|
|
13767
14027
|
if (!prop.name)
|
|
@@ -13797,15 +14057,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13797
14057
|
}, resolveConfigPath = (projectRoot) => {
|
|
13798
14058
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13799
14059
|
if (envOverride) {
|
|
13800
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
14060
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join34(projectRoot, envOverride);
|
|
13801
14061
|
if (existsSync23(resolved))
|
|
13802
14062
|
return resolved;
|
|
13803
14063
|
}
|
|
13804
14064
|
const candidates = [
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
14065
|
+
join34(projectRoot, "absolute.config.ts"),
|
|
14066
|
+
join34(projectRoot, "absolute.config.mts"),
|
|
14067
|
+
join34(projectRoot, "absolute.config.js"),
|
|
14068
|
+
join34(projectRoot, "absolute.config.mjs")
|
|
13809
14069
|
];
|
|
13810
14070
|
for (const candidate of candidates) {
|
|
13811
14071
|
if (existsSync23(candidate))
|
|
@@ -13816,7 +14076,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
13816
14076
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
13817
14077
|
if (!configPath2)
|
|
13818
14078
|
return null;
|
|
13819
|
-
const source =
|
|
14079
|
+
const source = readFileSync21(configPath2, "utf-8");
|
|
13820
14080
|
if (!source.includes("angular"))
|
|
13821
14081
|
return null;
|
|
13822
14082
|
if (!source.includes("providers"))
|
|
@@ -13837,8 +14097,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13837
14097
|
const importInfo = findImportForBinding(sf, binding);
|
|
13838
14098
|
if (!importInfo)
|
|
13839
14099
|
return null;
|
|
13840
|
-
const configDir2 =
|
|
13841
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
14100
|
+
const configDir2 = dirname18(configPath2);
|
|
14101
|
+
const absolutePath = importInfo.source.startsWith(".") ? join34(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
13842
14102
|
return {
|
|
13843
14103
|
absolutePath,
|
|
13844
14104
|
bindingName: binding,
|
|
@@ -13853,7 +14113,7 @@ __export(exports_renderToReadableStream, {
|
|
|
13853
14113
|
renderToReadableStream: () => renderToReadableStream,
|
|
13854
14114
|
SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
|
|
13855
14115
|
});
|
|
13856
|
-
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (
|
|
14116
|
+
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
|
|
13857
14117
|
bootstrapScriptContent,
|
|
13858
14118
|
bootstrapScripts = [],
|
|
13859
14119
|
bootstrapModules = [],
|
|
@@ -13867,7 +14127,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
13867
14127
|
try {
|
|
13868
14128
|
const { render } = await import("svelte/server");
|
|
13869
14129
|
const renderComponent = render;
|
|
13870
|
-
const rendered = typeof props === "undefined" ? await renderComponent(
|
|
14130
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
|
|
13871
14131
|
const { head, body } = rendered;
|
|
13872
14132
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
13873
14133
|
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("");
|
|
@@ -13912,11 +14172,11 @@ __export(exports_compileSvelte, {
|
|
|
13912
14172
|
import { existsSync as existsSync24 } from "fs";
|
|
13913
14173
|
import { mkdir as mkdir9, stat as stat2 } from "fs/promises";
|
|
13914
14174
|
import {
|
|
13915
|
-
dirname as
|
|
13916
|
-
join as
|
|
14175
|
+
dirname as dirname19,
|
|
14176
|
+
join as join35,
|
|
13917
14177
|
basename as basename10,
|
|
13918
14178
|
extname as extname7,
|
|
13919
|
-
resolve as
|
|
14179
|
+
resolve as resolve26,
|
|
13920
14180
|
relative as relative11,
|
|
13921
14181
|
sep as sep2
|
|
13922
14182
|
} from "path";
|
|
@@ -13924,14 +14184,14 @@ import { env as env2 } from "process";
|
|
|
13924
14184
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13925
14185
|
var resolveDevClientDir2 = () => {
|
|
13926
14186
|
const projectRoot = process.cwd();
|
|
13927
|
-
const fromSource =
|
|
14187
|
+
const fromSource = resolve26(import.meta.dir, "../dev/client");
|
|
13928
14188
|
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13929
14189
|
return fromSource;
|
|
13930
14190
|
}
|
|
13931
|
-
const fromNodeModules =
|
|
14191
|
+
const fromNodeModules = resolve26(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13932
14192
|
if (existsSync24(fromNodeModules))
|
|
13933
14193
|
return fromNodeModules;
|
|
13934
|
-
return
|
|
14194
|
+
return resolve26(import.meta.dir, "./dev/client");
|
|
13935
14195
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13936
14196
|
persistentCache.clear();
|
|
13937
14197
|
sourceHashCache.clear();
|
|
@@ -13961,7 +14221,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13961
14221
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13962
14222
|
if (!spec.startsWith("."))
|
|
13963
14223
|
return null;
|
|
13964
|
-
const basePath =
|
|
14224
|
+
const basePath = resolve26(dirname19(from), spec);
|
|
13965
14225
|
const candidates = [
|
|
13966
14226
|
basePath,
|
|
13967
14227
|
`${basePath}.ts`,
|
|
@@ -13972,14 +14232,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13972
14232
|
`${basePath}.svelte`,
|
|
13973
14233
|
`${basePath}.svelte.ts`,
|
|
13974
14234
|
`${basePath}.svelte.js`,
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
14235
|
+
join35(basePath, "index.ts"),
|
|
14236
|
+
join35(basePath, "index.js"),
|
|
14237
|
+
join35(basePath, "index.mjs"),
|
|
14238
|
+
join35(basePath, "index.cjs"),
|
|
14239
|
+
join35(basePath, "index.json"),
|
|
14240
|
+
join35(basePath, "index.svelte"),
|
|
14241
|
+
join35(basePath, "index.svelte.ts"),
|
|
14242
|
+
join35(basePath, "index.svelte.js")
|
|
13983
14243
|
];
|
|
13984
14244
|
const checks = await Promise.all(candidates.map(exists2));
|
|
13985
14245
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13988,7 +14248,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13988
14248
|
const resolved = resolvePackageImport(spec);
|
|
13989
14249
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13990
14250
|
}
|
|
13991
|
-
const basePath =
|
|
14251
|
+
const basePath = resolve26(dirname19(from), spec);
|
|
13992
14252
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13993
14253
|
if (!explicit) {
|
|
13994
14254
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -14018,9 +14278,9 @@ var resolveDevClientDir2 = () => {
|
|
|
14018
14278
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
14019
14279
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
14020
14280
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
14021
|
-
const clientDir =
|
|
14022
|
-
const indexDir =
|
|
14023
|
-
const serverDir =
|
|
14281
|
+
const clientDir = join35(generatedDir, "client");
|
|
14282
|
+
const indexDir = join35(generatedDir, "indexes");
|
|
14283
|
+
const serverDir = join35(generatedDir, "server");
|
|
14024
14284
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir9(dir, { recursive: true })));
|
|
14025
14285
|
const dev = env2.NODE_ENV !== "production";
|
|
14026
14286
|
const build2 = async (src) => {
|
|
@@ -14048,8 +14308,8 @@ var resolveDevClientDir2 = () => {
|
|
|
14048
14308
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
14049
14309
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
14050
14310
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
14051
|
-
const rawRel =
|
|
14052
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(),
|
|
14311
|
+
const rawRel = dirname19(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
14312
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname19(src)).replace(/\\/g, "/")}` : rawRel;
|
|
14053
14313
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14054
14314
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
14055
14315
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -14058,8 +14318,8 @@ var resolveDevClientDir2 = () => {
|
|
|
14058
14318
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
14059
14319
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
14060
14320
|
const externalRewrites = new Map;
|
|
14061
|
-
const ssrOutputDir =
|
|
14062
|
-
const clientOutputDir =
|
|
14321
|
+
const ssrOutputDir = dirname19(join35(serverDir, relDir, `${baseName}.js`));
|
|
14322
|
+
const clientOutputDir = dirname19(join35(clientDir, relDir, `${baseName}.js`));
|
|
14063
14323
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
14064
14324
|
const rawSpec = importPaths[idx];
|
|
14065
14325
|
if (!rawSpec)
|
|
@@ -14124,11 +14384,11 @@ var resolveDevClientDir2 = () => {
|
|
|
14124
14384
|
code += islandMetadataExports;
|
|
14125
14385
|
return { code, map: compiledJs.map };
|
|
14126
14386
|
};
|
|
14127
|
-
const ssrPath =
|
|
14128
|
-
const clientPath =
|
|
14387
|
+
const ssrPath = join35(serverDir, relDir, `${baseName}.js`);
|
|
14388
|
+
const clientPath = join35(clientDir, relDir, `${baseName}.js`);
|
|
14129
14389
|
await Promise.all([
|
|
14130
|
-
mkdir9(
|
|
14131
|
-
mkdir9(
|
|
14390
|
+
mkdir9(dirname19(ssrPath), { recursive: true }),
|
|
14391
|
+
mkdir9(dirname19(clientPath), { recursive: true })
|
|
14132
14392
|
]);
|
|
14133
14393
|
const inlineMap = (map) => map ? `
|
|
14134
14394
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -14163,10 +14423,10 @@ var resolveDevClientDir2 = () => {
|
|
|
14163
14423
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
14164
14424
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
14165
14425
|
await Promise.all(componentRoots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
14166
|
-
const relClientDir =
|
|
14426
|
+
const relClientDir = dirname19(relative11(clientDir, client2));
|
|
14167
14427
|
const name = basename10(client2, extname7(client2));
|
|
14168
|
-
const indexPath =
|
|
14169
|
-
const importRaw = relative11(
|
|
14428
|
+
const indexPath = join35(indexDir, relClientDir, `${name}.js`);
|
|
14429
|
+
const importRaw = relative11(dirname19(indexPath), client2).split(sep2).join("/");
|
|
14170
14430
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
14171
14431
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
14172
14432
|
import "${hmrClientPath3}";
|
|
@@ -14255,14 +14515,14 @@ if (typeof window !== "undefined") {
|
|
|
14255
14515
|
setTimeout(releaseStreamingSlots, 0);
|
|
14256
14516
|
}
|
|
14257
14517
|
}`;
|
|
14258
|
-
await mkdir9(
|
|
14518
|
+
await mkdir9(dirname19(indexPath), { recursive: true });
|
|
14259
14519
|
return write2(indexPath, bootstrap);
|
|
14260
14520
|
}));
|
|
14261
14521
|
return {
|
|
14262
14522
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
14263
14523
|
svelteIndexPaths: componentRoots.map(({ client: client2 }) => {
|
|
14264
|
-
const rel =
|
|
14265
|
-
return
|
|
14524
|
+
const rel = dirname19(relative11(clientDir, client2));
|
|
14525
|
+
return join35(indexDir, rel, basename10(client2));
|
|
14266
14526
|
}),
|
|
14267
14527
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
14268
14528
|
};
|
|
@@ -14277,7 +14537,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
14277
14537
|
init_lowerAwaitSlotSyntax();
|
|
14278
14538
|
init_renderToReadableStream();
|
|
14279
14539
|
devClientDir2 = resolveDevClientDir2();
|
|
14280
|
-
hmrClientPath3 =
|
|
14540
|
+
hmrClientPath3 = join35(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
14281
14541
|
persistentCache = new Map;
|
|
14282
14542
|
sourceHashCache = new Map;
|
|
14283
14543
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -14344,7 +14604,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
14344
14604
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
14345
14605
|
buildLineRemap: () => buildLineRemap
|
|
14346
14606
|
});
|
|
14347
|
-
import { readFileSync as
|
|
14607
|
+
import { readFileSync as readFileSync22, writeFileSync as writeFileSync8 } from "fs";
|
|
14348
14608
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
14349
14609
|
let result = 0;
|
|
14350
14610
|
let shift = 0;
|
|
@@ -14635,7 +14895,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14635
14895
|
version: 3
|
|
14636
14896
|
};
|
|
14637
14897
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
14638
|
-
const text =
|
|
14898
|
+
const text = readFileSync22(bundleFilePath, "utf-8");
|
|
14639
14899
|
const outerMap = extractInlineMap(text);
|
|
14640
14900
|
if (!outerMap)
|
|
14641
14901
|
return;
|
|
@@ -14655,7 +14915,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14655
14915
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
14656
14916
|
let outerMap;
|
|
14657
14917
|
try {
|
|
14658
|
-
outerMap = JSON.parse(
|
|
14918
|
+
outerMap = JSON.parse(readFileSync22(mapFilePath, "utf-8"));
|
|
14659
14919
|
} catch {
|
|
14660
14920
|
return;
|
|
14661
14921
|
}
|
|
@@ -14754,27 +15014,27 @@ __export(exports_compileVue, {
|
|
|
14754
15014
|
compileVue: () => compileVue,
|
|
14755
15015
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14756
15016
|
});
|
|
14757
|
-
import { existsSync as existsSync25, readFileSync as
|
|
15017
|
+
import { existsSync as existsSync25, readFileSync as readFileSync23, realpathSync as realpathSync2 } from "fs";
|
|
14758
15018
|
import { mkdir as mkdir10 } from "fs/promises";
|
|
14759
15019
|
import {
|
|
14760
15020
|
basename as basename11,
|
|
14761
|
-
dirname as
|
|
15021
|
+
dirname as dirname20,
|
|
14762
15022
|
isAbsolute as isAbsolute4,
|
|
14763
|
-
join as
|
|
15023
|
+
join as join36,
|
|
14764
15024
|
relative as relative12,
|
|
14765
|
-
resolve as
|
|
15025
|
+
resolve as resolve27
|
|
14766
15026
|
} from "path";
|
|
14767
15027
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14768
15028
|
var resolveDevClientDir3 = () => {
|
|
14769
15029
|
const projectRoot = process.cwd();
|
|
14770
|
-
const fromSource =
|
|
15030
|
+
const fromSource = resolve27(import.meta.dir, "../dev/client");
|
|
14771
15031
|
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14772
15032
|
return fromSource;
|
|
14773
15033
|
}
|
|
14774
|
-
const fromNodeModules =
|
|
15034
|
+
const fromNodeModules = resolve27(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14775
15035
|
if (existsSync25(fromNodeModules))
|
|
14776
15036
|
return fromNodeModules;
|
|
14777
|
-
return
|
|
15037
|
+
return resolve27(import.meta.dir, "./dev/client");
|
|
14778
15038
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14779
15039
|
scriptCache.clear();
|
|
14780
15040
|
scriptSetupCache.clear();
|
|
@@ -14824,19 +15084,19 @@ var resolveDevClientDir3 = () => {
|
|
|
14824
15084
|
visited.add(resolved);
|
|
14825
15085
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14826
15086
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14827
|
-
const importedPath =
|
|
15087
|
+
const importedPath = resolve27(dirname20(cssFilePath), relPath);
|
|
14828
15088
|
if (!existsSync25(importedPath))
|
|
14829
15089
|
return match;
|
|
14830
|
-
const importedContent =
|
|
15090
|
+
const importedContent = readFileSync23(importedPath, "utf-8");
|
|
14831
15091
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
14832
15092
|
});
|
|
14833
15093
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14834
15094
|
if (helper.endsWith(".ts"))
|
|
14835
|
-
return
|
|
14836
|
-
const direct =
|
|
15095
|
+
return resolve27(sourceDir, helper);
|
|
15096
|
+
const direct = resolve27(sourceDir, `${helper}.ts`);
|
|
14837
15097
|
if (existsSync25(direct))
|
|
14838
15098
|
return direct;
|
|
14839
|
-
const indexed =
|
|
15099
|
+
const indexed = resolve27(sourceDir, helper, "index.ts");
|
|
14840
15100
|
if (existsSync25(indexed))
|
|
14841
15101
|
return indexed;
|
|
14842
15102
|
return direct;
|
|
@@ -14847,15 +15107,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14847
15107
|
return filePath.replace(/\.ts$/, ".js");
|
|
14848
15108
|
if (isStylePath(filePath)) {
|
|
14849
15109
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14850
|
-
return
|
|
15110
|
+
return resolve27(sourceDir, filePath);
|
|
14851
15111
|
}
|
|
14852
15112
|
return filePath;
|
|
14853
15113
|
}
|
|
14854
15114
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14855
|
-
const directTs =
|
|
15115
|
+
const directTs = resolve27(sourceDir, `${filePath}.ts`);
|
|
14856
15116
|
if (existsSync25(directTs))
|
|
14857
15117
|
return `${filePath}.js`;
|
|
14858
|
-
const indexedTs =
|
|
15118
|
+
const indexedTs = resolve27(sourceDir, filePath, "index.ts");
|
|
14859
15119
|
if (existsSync25(indexedTs))
|
|
14860
15120
|
return `${filePath}/index.js`;
|
|
14861
15121
|
}
|
|
@@ -14946,19 +15206,19 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14946
15206
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14947
15207
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14948
15208
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14949
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
15209
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve27(dirname20(sourceFilePath), path));
|
|
14950
15210
|
for (const stylePath of stylePathsImported) {
|
|
14951
15211
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14952
15212
|
}
|
|
14953
15213
|
const childBuildResults = await Promise.all([
|
|
14954
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
15214
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve27(dirname20(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14955
15215
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14956
15216
|
]);
|
|
14957
15217
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
14958
15218
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
14959
15219
|
fs: {
|
|
14960
15220
|
fileExists: existsSync25,
|
|
14961
|
-
readFile: (file4) => existsSync25(file4) ?
|
|
15221
|
+
readFile: (file4) => existsSync25(file4) ? readFileSync23(file4, "utf-8") : undefined,
|
|
14962
15222
|
realpath: realpathSync2
|
|
14963
15223
|
},
|
|
14964
15224
|
id: componentId,
|
|
@@ -14966,7 +15226,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14966
15226
|
sourceMap: true
|
|
14967
15227
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14968
15228
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14969
|
-
const sourceDir =
|
|
15229
|
+
const sourceDir = dirname20(sourceFilePath);
|
|
14970
15230
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14971
15231
|
const packageImportRewrites = new Map;
|
|
14972
15232
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -15011,8 +15271,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15011
15271
|
];
|
|
15012
15272
|
let cssOutputPaths = [];
|
|
15013
15273
|
if (isEntryPoint && allCss.length) {
|
|
15014
|
-
const cssOutputFile =
|
|
15015
|
-
await mkdir10(
|
|
15274
|
+
const cssOutputFile = join36(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15275
|
+
await mkdir10(dirname20(cssOutputFile), { recursive: true });
|
|
15016
15276
|
await write3(cssOutputFile, allCss.join(`
|
|
15017
15277
|
`));
|
|
15018
15278
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -15042,21 +15302,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15042
15302
|
};
|
|
15043
15303
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
15044
15304
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
15045
|
-
const clientOutputPath =
|
|
15046
|
-
const serverOutputPath =
|
|
15305
|
+
const clientOutputPath = join36(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15306
|
+
const serverOutputPath = join36(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
15047
15307
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
15048
15308
|
let result2 = code;
|
|
15049
15309
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
15050
15310
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
15051
|
-
let rel = relative12(
|
|
15311
|
+
let rel = relative12(dirname20(outputPath), targetPath).replace(/\\/g, "/");
|
|
15052
15312
|
if (!rel.startsWith("."))
|
|
15053
15313
|
rel = `./${rel}`;
|
|
15054
15314
|
result2 = result2.replaceAll(bareImport, rel);
|
|
15055
15315
|
}
|
|
15056
15316
|
return result2;
|
|
15057
15317
|
};
|
|
15058
|
-
await mkdir10(
|
|
15059
|
-
await mkdir10(
|
|
15318
|
+
await mkdir10(dirname20(clientOutputPath), { recursive: true });
|
|
15319
|
+
await mkdir10(dirname20(serverOutputPath), { recursive: true });
|
|
15060
15320
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
15061
15321
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
15062
15322
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -15079,7 +15339,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15079
15339
|
serverPath: serverOutputPath,
|
|
15080
15340
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
15081
15341
|
tsHelperPaths: [
|
|
15082
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
15342
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname20(sourceFilePath), helper)),
|
|
15083
15343
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
15084
15344
|
]
|
|
15085
15345
|
};
|
|
@@ -15089,10 +15349,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15089
15349
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
15090
15350
|
const compiler = await loadVueCompiler();
|
|
15091
15351
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
15092
|
-
const clientOutputDir =
|
|
15093
|
-
const indexOutputDir =
|
|
15094
|
-
const serverOutputDir =
|
|
15095
|
-
const cssOutputDir =
|
|
15352
|
+
const clientOutputDir = join36(generatedDir, "client");
|
|
15353
|
+
const indexOutputDir = join36(generatedDir, "indexes");
|
|
15354
|
+
const serverOutputDir = join36(generatedDir, "server");
|
|
15355
|
+
const cssOutputDir = join36(generatedDir, "compiled");
|
|
15096
15356
|
await Promise.all([
|
|
15097
15357
|
mkdir10(clientOutputDir, { recursive: true }),
|
|
15098
15358
|
mkdir10(indexOutputDir, { recursive: true }),
|
|
@@ -15102,7 +15362,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15102
15362
|
const buildCache = new Map;
|
|
15103
15363
|
const allTsHelperPaths = new Set;
|
|
15104
15364
|
const expandSpaRouteChildren = async (entries) => {
|
|
15105
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15365
|
+
const expanded = new Set(entries.map((entry) => resolve27(entry)));
|
|
15106
15366
|
const queue2 = [...expanded];
|
|
15107
15367
|
while (queue2.length > 0) {
|
|
15108
15368
|
const entryPath = queue2.pop();
|
|
@@ -15119,7 +15379,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15119
15379
|
});
|
|
15120
15380
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
15121
15381
|
for (const { importPath } of routes) {
|
|
15122
|
-
const childPath =
|
|
15382
|
+
const childPath = resolve27(dirname20(entryPath), importPath);
|
|
15123
15383
|
if (expanded.has(childPath) || !existsSync25(childPath)) {
|
|
15124
15384
|
continue;
|
|
15125
15385
|
}
|
|
@@ -15131,7 +15391,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15131
15391
|
};
|
|
15132
15392
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
15133
15393
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
15134
|
-
const resolvedEntryPath =
|
|
15394
|
+
const resolvedEntryPath = resolve27(entryPath);
|
|
15135
15395
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
15136
15396
|
client: clientOutputDir,
|
|
15137
15397
|
css: cssOutputDir,
|
|
@@ -15149,16 +15409,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15149
15409
|
};
|
|
15150
15410
|
}
|
|
15151
15411
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
15152
|
-
const indexOutputFile =
|
|
15153
|
-
const clientOutputFile =
|
|
15154
|
-
await mkdir10(
|
|
15412
|
+
const indexOutputFile = join36(indexOutputDir, `${entryBaseName}.js`);
|
|
15413
|
+
const clientOutputFile = join36(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15414
|
+
await mkdir10(dirname20(indexOutputFile), { recursive: true });
|
|
15155
15415
|
const vueHmrImports = isDev2 ? [
|
|
15156
15416
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
15157
15417
|
`import "${hmrClientPath4}";`
|
|
15158
15418
|
] : [];
|
|
15159
15419
|
await write3(indexOutputFile, [
|
|
15160
15420
|
...vueHmrImports,
|
|
15161
|
-
`import Comp, * as PageModule from "${relative12(
|
|
15421
|
+
`import Comp, * as PageModule from "${relative12(dirname20(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
15162
15422
|
'import { createSSRApp, createApp } from "vue";',
|
|
15163
15423
|
"",
|
|
15164
15424
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -15320,7 +15580,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15320
15580
|
if (!tsPath)
|
|
15321
15581
|
continue;
|
|
15322
15582
|
const sourceCode = await file3(tsPath).text();
|
|
15323
|
-
const helperDir =
|
|
15583
|
+
const helperDir = dirname20(tsPath);
|
|
15324
15584
|
for (const dep of extractImports(sourceCode)) {
|
|
15325
15585
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
15326
15586
|
continue;
|
|
@@ -15339,10 +15599,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15339
15599
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
15340
15600
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
15341
15601
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15342
|
-
const outClientPath =
|
|
15343
|
-
const outServerPath =
|
|
15344
|
-
await mkdir10(
|
|
15345
|
-
await mkdir10(
|
|
15602
|
+
const outClientPath = join36(clientOutputDir, relativeJsPath);
|
|
15603
|
+
const outServerPath = join36(serverOutputDir, relativeJsPath);
|
|
15604
|
+
await mkdir10(dirname20(outClientPath), { recursive: true });
|
|
15605
|
+
await mkdir10(dirname20(outServerPath), { recursive: true });
|
|
15346
15606
|
await write3(outClientPath, withMap);
|
|
15347
15607
|
await write3(outServerPath, withMap);
|
|
15348
15608
|
}));
|
|
@@ -15372,7 +15632,7 @@ var init_compileVue = __esm(() => {
|
|
|
15372
15632
|
init_vueAutoRouterTransform();
|
|
15373
15633
|
init_stylePreprocessor();
|
|
15374
15634
|
devClientDir3 = resolveDevClientDir3();
|
|
15375
|
-
hmrClientPath4 =
|
|
15635
|
+
hmrClientPath4 = join36(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
15376
15636
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
15377
15637
|
scriptCache = new Map;
|
|
15378
15638
|
scriptSetupCache = new Map;
|
|
@@ -15853,8 +16113,8 @@ __export(exports_compileAngular, {
|
|
|
15853
16113
|
compileAngularFile: () => compileAngularFile,
|
|
15854
16114
|
compileAngular: () => compileAngular
|
|
15855
16115
|
});
|
|
15856
|
-
import { existsSync as existsSync26, readFileSync as
|
|
15857
|
-
import { join as
|
|
16116
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, promises as fs5 } from "fs";
|
|
16117
|
+
import { join as join37, basename as basename12, sep as sep3, dirname as dirname21, resolve as resolve28, relative as relative13 } from "path";
|
|
15858
16118
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15859
16119
|
import ts13 from "typescript";
|
|
15860
16120
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -15862,10 +16122,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15862
16122
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
15863
16123
|
}, readTsconfigPathAliases = () => {
|
|
15864
16124
|
try {
|
|
15865
|
-
const configPath2 =
|
|
16125
|
+
const configPath2 = resolve28(process.cwd(), "tsconfig.json");
|
|
15866
16126
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15867
16127
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15868
|
-
const baseUrl =
|
|
16128
|
+
const baseUrl = resolve28(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15869
16129
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15870
16130
|
return { aliases, baseUrl };
|
|
15871
16131
|
} catch {
|
|
@@ -15885,7 +16145,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15885
16145
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15886
16146
|
for (const replacement of alias.replacements) {
|
|
15887
16147
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15888
|
-
const resolved = resolveSourceFile(
|
|
16148
|
+
const resolved = resolveSourceFile(resolve28(baseUrl, candidate));
|
|
15889
16149
|
if (resolved)
|
|
15890
16150
|
return resolved;
|
|
15891
16151
|
}
|
|
@@ -15897,20 +16157,20 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15897
16157
|
`${candidate}.tsx`,
|
|
15898
16158
|
`${candidate}.js`,
|
|
15899
16159
|
`${candidate}.jsx`,
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
16160
|
+
join37(candidate, "index.ts"),
|
|
16161
|
+
join37(candidate, "index.tsx"),
|
|
16162
|
+
join37(candidate, "index.js"),
|
|
16163
|
+
join37(candidate, "index.jsx")
|
|
15904
16164
|
];
|
|
15905
16165
|
return candidates.find((file4) => existsSync26(file4));
|
|
15906
16166
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15907
|
-
const baseDir =
|
|
16167
|
+
const baseDir = resolve28(rootDir);
|
|
15908
16168
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15909
16169
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15910
16170
|
const scanCache = new Map;
|
|
15911
16171
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15912
16172
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15913
|
-
return resolveSourceFile(
|
|
16173
|
+
return resolveSourceFile(resolve28(fromDir, specifier));
|
|
15914
16174
|
}
|
|
15915
16175
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15916
16176
|
if (aliased)
|
|
@@ -15919,7 +16179,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15919
16179
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15920
16180
|
if (resolved.includes("/node_modules/"))
|
|
15921
16181
|
return;
|
|
15922
|
-
const absolute =
|
|
16182
|
+
const absolute = resolve28(resolved);
|
|
15923
16183
|
if (!absolute.startsWith(baseDir))
|
|
15924
16184
|
return;
|
|
15925
16185
|
return resolveSourceFile(absolute);
|
|
@@ -15935,7 +16195,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15935
16195
|
usesLegacyAnimations: false
|
|
15936
16196
|
});
|
|
15937
16197
|
}
|
|
15938
|
-
const resolved =
|
|
16198
|
+
const resolved = resolve28(actualPath);
|
|
15939
16199
|
const cached = scanCache.get(resolved);
|
|
15940
16200
|
if (cached)
|
|
15941
16201
|
return cached;
|
|
@@ -15964,7 +16224,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15964
16224
|
const actualPath = resolveSourceFile(filePath);
|
|
15965
16225
|
if (!actualPath)
|
|
15966
16226
|
return false;
|
|
15967
|
-
const resolved =
|
|
16227
|
+
const resolved = resolve28(actualPath);
|
|
15968
16228
|
if (visited.has(resolved))
|
|
15969
16229
|
return false;
|
|
15970
16230
|
visited.add(resolved);
|
|
@@ -15972,7 +16232,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15972
16232
|
if (scan.usesLegacyAnimations)
|
|
15973
16233
|
return true;
|
|
15974
16234
|
for (const specifier of scan.imports) {
|
|
15975
|
-
const importedPath = resolveLocalImport(specifier,
|
|
16235
|
+
const importedPath = resolveLocalImport(specifier, dirname21(resolved));
|
|
15976
16236
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15977
16237
|
return true;
|
|
15978
16238
|
}
|
|
@@ -15982,14 +16242,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15982
16242
|
return (entryPath) => visit(entryPath);
|
|
15983
16243
|
}, resolveDevClientDir4 = () => {
|
|
15984
16244
|
const projectRoot = process.cwd();
|
|
15985
|
-
const fromSource =
|
|
16245
|
+
const fromSource = resolve28(import.meta.dir, "../dev/client");
|
|
15986
16246
|
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15987
16247
|
return fromSource;
|
|
15988
16248
|
}
|
|
15989
|
-
const fromNodeModules =
|
|
16249
|
+
const fromNodeModules = resolve28(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15990
16250
|
if (existsSync26(fromNodeModules))
|
|
15991
16251
|
return fromNodeModules;
|
|
15992
|
-
return
|
|
16252
|
+
return resolve28(import.meta.dir, "./dev/client");
|
|
15993
16253
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15994
16254
|
try {
|
|
15995
16255
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -16031,12 +16291,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16031
16291
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
16032
16292
|
if (hasJsLikeExtension(path))
|
|
16033
16293
|
return `${path}${query}`;
|
|
16034
|
-
const importerDir =
|
|
16035
|
-
const fileCandidate =
|
|
16294
|
+
const importerDir = dirname21(importerOutputPath);
|
|
16295
|
+
const fileCandidate = resolve28(importerDir, `${path}.js`);
|
|
16036
16296
|
if (outputFiles?.has(fileCandidate) || existsSync26(fileCandidate)) {
|
|
16037
16297
|
return `${path}.js${query}`;
|
|
16038
16298
|
}
|
|
16039
|
-
const indexCandidate =
|
|
16299
|
+
const indexCandidate = resolve28(importerDir, path, "index.js");
|
|
16040
16300
|
if (outputFiles?.has(indexCandidate) || existsSync26(indexCandidate)) {
|
|
16041
16301
|
return `${path}/index.js${query}`;
|
|
16042
16302
|
}
|
|
@@ -16064,18 +16324,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16064
16324
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
16065
16325
|
if (!isRelativeModuleSpecifier(specifier))
|
|
16066
16326
|
return null;
|
|
16067
|
-
const basePath =
|
|
16327
|
+
const basePath = resolve28(dirname21(fromFile), specifier);
|
|
16068
16328
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
16069
16329
|
`${basePath}.ts`,
|
|
16070
16330
|
`${basePath}.tsx`,
|
|
16071
16331
|
`${basePath}.mts`,
|
|
16072
16332
|
`${basePath}.cts`,
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16333
|
+
join37(basePath, "index.ts"),
|
|
16334
|
+
join37(basePath, "index.tsx"),
|
|
16335
|
+
join37(basePath, "index.mts"),
|
|
16336
|
+
join37(basePath, "index.cts")
|
|
16077
16337
|
];
|
|
16078
|
-
return candidates.map((candidate) =>
|
|
16338
|
+
return candidates.map((candidate) => resolve28(candidate)).find((candidate) => existsSync26(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
16079
16339
|
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
16080
16340
|
const hostSource = readFile9?.(fileName);
|
|
16081
16341
|
if (typeof hostSource === "string")
|
|
@@ -16099,18 +16359,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16099
16359
|
const paths = [];
|
|
16100
16360
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16101
16361
|
if (templateUrlMatch?.[1])
|
|
16102
|
-
paths.push(
|
|
16362
|
+
paths.push(join37(fileDir, templateUrlMatch[1]));
|
|
16103
16363
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16104
16364
|
if (styleUrlMatch?.[1])
|
|
16105
|
-
paths.push(
|
|
16365
|
+
paths.push(join37(fileDir, styleUrlMatch[1]));
|
|
16106
16366
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
16107
16367
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
16108
16368
|
if (urlMatches) {
|
|
16109
16369
|
for (const urlMatch of urlMatches) {
|
|
16110
|
-
paths.push(
|
|
16370
|
+
paths.push(join37(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
16111
16371
|
}
|
|
16112
16372
|
}
|
|
16113
|
-
return paths.map((path) =>
|
|
16373
|
+
return paths.map((path) => resolve28(path));
|
|
16114
16374
|
}, readResourceCacheFile = async (cachePath) => {
|
|
16115
16375
|
try {
|
|
16116
16376
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -16122,13 +16382,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16122
16382
|
return null;
|
|
16123
16383
|
}
|
|
16124
16384
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
16125
|
-
await fs5.mkdir(
|
|
16385
|
+
await fs5.mkdir(dirname21(cachePath), { recursive: true });
|
|
16126
16386
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
16127
16387
|
source,
|
|
16128
16388
|
version: 1
|
|
16129
16389
|
}), "utf-8");
|
|
16130
16390
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
16131
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
16391
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname21(filePath));
|
|
16132
16392
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
16133
16393
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
16134
16394
|
return `${resourcePath}\x00${content}`;
|
|
@@ -16141,7 +16401,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16141
16401
|
safeStableStringify(stylePreprocessors ?? null)
|
|
16142
16402
|
].join("\x00");
|
|
16143
16403
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
16144
|
-
return
|
|
16404
|
+
return join37(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
16145
16405
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile9, stylePreprocessors) => {
|
|
16146
16406
|
const transformedSources = new Map;
|
|
16147
16407
|
const visited = new Set;
|
|
@@ -16152,7 +16412,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16152
16412
|
transformedFiles: 0
|
|
16153
16413
|
};
|
|
16154
16414
|
const transformFile = async (filePath) => {
|
|
16155
|
-
const resolvedPath =
|
|
16415
|
+
const resolvedPath = resolve28(filePath);
|
|
16156
16416
|
if (visited.has(resolvedPath))
|
|
16157
16417
|
return;
|
|
16158
16418
|
visited.add(resolvedPath);
|
|
@@ -16168,7 +16428,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16168
16428
|
transformedSource = cached.source;
|
|
16169
16429
|
} else {
|
|
16170
16430
|
stats.cacheMisses += 1;
|
|
16171
|
-
const transformed = await inlineResources(source,
|
|
16431
|
+
const transformed = await inlineResources(source, dirname21(resolvedPath), stylePreprocessors);
|
|
16172
16432
|
transformedSource = transformed.source;
|
|
16173
16433
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
16174
16434
|
}
|
|
@@ -16187,18 +16447,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16187
16447
|
return { stats, transformedSources };
|
|
16188
16448
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
16189
16449
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
16190
|
-
const outputPath =
|
|
16450
|
+
const outputPath = resolve28(join37(outDir, relative13(process.cwd(), resolve28(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
16191
16451
|
return [
|
|
16192
16452
|
outputPath,
|
|
16193
|
-
buildIslandMetadataExports(
|
|
16453
|
+
buildIslandMetadataExports(readFileSync24(inputPath, "utf-8"))
|
|
16194
16454
|
];
|
|
16195
16455
|
})), { entries: inputPaths.length });
|
|
16196
16456
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
16197
16457
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
16198
16458
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
16199
16459
|
const tsPath = __require.resolve("typescript");
|
|
16200
|
-
const tsRootDir =
|
|
16201
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16460
|
+
const tsRootDir = dirname21(tsPath);
|
|
16461
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve28(tsRootDir, "lib");
|
|
16202
16462
|
});
|
|
16203
16463
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
16204
16464
|
const options = {
|
|
@@ -16223,30 +16483,30 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16223
16483
|
options.incremental = false;
|
|
16224
16484
|
options.tsBuildInfoFile = undefined;
|
|
16225
16485
|
options.rootDir = process.cwd();
|
|
16226
|
-
const
|
|
16227
|
-
const originalGetDefaultLibLocation =
|
|
16228
|
-
|
|
16229
|
-
const originalGetDefaultLibFileName =
|
|
16230
|
-
|
|
16486
|
+
const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
|
|
16487
|
+
const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
|
|
16488
|
+
host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
16489
|
+
const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
|
|
16490
|
+
host2.getDefaultLibFileName = (opts) => {
|
|
16231
16491
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
16232
16492
|
return basename12(fileName);
|
|
16233
16493
|
};
|
|
16234
|
-
const originalGetSourceFile =
|
|
16235
|
-
|
|
16494
|
+
const originalGetSourceFile = host2.getSourceFile;
|
|
16495
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16236
16496
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
16237
|
-
const resolvedPath =
|
|
16238
|
-
return originalGetSourceFile?.call(
|
|
16497
|
+
const resolvedPath = join37(tsLibDir, fileName);
|
|
16498
|
+
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
16239
16499
|
}
|
|
16240
|
-
return originalGetSourceFile?.call(
|
|
16500
|
+
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
16241
16501
|
};
|
|
16242
16502
|
const emitted = {};
|
|
16243
|
-
const resolvedOutDir =
|
|
16244
|
-
|
|
16503
|
+
const resolvedOutDir = resolve28(outDir);
|
|
16504
|
+
host2.writeFile = (fileName, text) => {
|
|
16245
16505
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
16246
16506
|
emitted[relativePath] = text;
|
|
16247
16507
|
};
|
|
16248
|
-
const originalReadFile =
|
|
16249
|
-
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(
|
|
16508
|
+
const originalReadFile = host2.readFile;
|
|
16509
|
+
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
|
|
16250
16510
|
await traceAngularPhase("aot/resource-cache-summary", () => {
|
|
16251
16511
|
return;
|
|
16252
16512
|
}, {
|
|
@@ -16255,43 +16515,43 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16255
16515
|
filesVisited: aotResourceTransformStats.filesVisited,
|
|
16256
16516
|
transformedFiles: aotResourceTransformStats.transformedFiles
|
|
16257
16517
|
});
|
|
16258
|
-
|
|
16259
|
-
const source = originalReadFile ? originalReadFile.call(
|
|
16518
|
+
host2.readFile = (fileName) => {
|
|
16519
|
+
const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
|
|
16260
16520
|
if (typeof source !== "string")
|
|
16261
16521
|
return source;
|
|
16262
16522
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16263
16523
|
return source;
|
|
16264
16524
|
}
|
|
16265
|
-
const resolvedPath =
|
|
16525
|
+
const resolvedPath = resolve28(fileName);
|
|
16266
16526
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16267
16527
|
};
|
|
16268
|
-
const originalGetSourceFileForCompile =
|
|
16269
|
-
|
|
16270
|
-
const source = transformedSources.get(
|
|
16528
|
+
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16529
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16530
|
+
const source = transformedSources.get(resolve28(fileName));
|
|
16271
16531
|
if (source) {
|
|
16272
16532
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
16273
16533
|
}
|
|
16274
|
-
return originalGetSourceFileForCompile?.call(
|
|
16534
|
+
return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
|
|
16275
16535
|
};
|
|
16276
16536
|
let diagnostics;
|
|
16277
16537
|
try {
|
|
16278
16538
|
({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
|
|
16279
16539
|
emitFlags: EmitFlags.Default,
|
|
16280
|
-
host,
|
|
16540
|
+
host: host2,
|
|
16281
16541
|
options,
|
|
16282
16542
|
rootNames: inputPaths
|
|
16283
16543
|
}), { entries: inputPaths.length }));
|
|
16284
16544
|
} finally {
|
|
16285
|
-
|
|
16286
|
-
|
|
16545
|
+
host2.readFile = originalReadFile;
|
|
16546
|
+
host2.getSourceFile = originalGetSourceFileForCompile;
|
|
16287
16547
|
}
|
|
16288
16548
|
await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
|
|
16289
16549
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
16290
16550
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
16291
16551
|
content,
|
|
16292
|
-
target:
|
|
16552
|
+
target: join37(outDir, fileName)
|
|
16293
16553
|
}));
|
|
16294
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16554
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve28(target)));
|
|
16295
16555
|
return rawEntries.map(({ content, target }) => {
|
|
16296
16556
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16297
16557
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16306,17 +16566,17 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16306
16566
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16307
16567
|
});
|
|
16308
16568
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16309
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16569
|
+
processedContent += islandMetadataByOutputPath.get(resolve28(target)) ?? "";
|
|
16310
16570
|
return { content: processedContent, target };
|
|
16311
16571
|
});
|
|
16312
16572
|
});
|
|
16313
16573
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
16314
|
-
await fs5.mkdir(
|
|
16574
|
+
await fs5.mkdir(dirname21(target), { recursive: true });
|
|
16315
16575
|
await fs5.writeFile(target, content, "utf-8");
|
|
16316
16576
|
})), { outputs: entries.length });
|
|
16317
16577
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16318
16578
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16319
|
-
jitContentCache.delete(
|
|
16579
|
+
jitContentCache.delete(resolve28(filePath));
|
|
16320
16580
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16321
16581
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16322
16582
|
let match;
|
|
@@ -16329,7 +16589,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16329
16589
|
}
|
|
16330
16590
|
return null;
|
|
16331
16591
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16332
|
-
const sourceEntry =
|
|
16592
|
+
const sourceEntry = resolve28(import.meta.dir, "../angular/components/index.ts");
|
|
16333
16593
|
if (existsSync26(sourceEntry)) {
|
|
16334
16594
|
return sourceEntry.replace(/\\/g, "/");
|
|
16335
16595
|
}
|
|
@@ -16466,7 +16726,7 @@ ${fields}
|
|
|
16466
16726
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16467
16727
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16468
16728
|
if (templateUrlMatch?.[1]) {
|
|
16469
|
-
const templatePath =
|
|
16729
|
+
const templatePath = join37(fileDir, templateUrlMatch[1]);
|
|
16470
16730
|
if (!existsSync26(templatePath)) {
|
|
16471
16731
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16472
16732
|
}
|
|
@@ -16497,11 +16757,11 @@ ${fields}
|
|
|
16497
16757
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16498
16758
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16499
16759
|
if (templateUrlMatch?.[1]) {
|
|
16500
|
-
const templatePath =
|
|
16760
|
+
const templatePath = join37(fileDir, templateUrlMatch[1]);
|
|
16501
16761
|
if (!existsSync26(templatePath)) {
|
|
16502
16762
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16503
16763
|
}
|
|
16504
|
-
const templateRaw2 =
|
|
16764
|
+
const templateRaw2 = readFileSync24(templatePath, "utf-8");
|
|
16505
16765
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
16506
16766
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
16507
16767
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -16534,7 +16794,7 @@ ${fields}
|
|
|
16534
16794
|
return source;
|
|
16535
16795
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16536
16796
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16537
|
-
return readAndEscapeFile(
|
|
16797
|
+
return readAndEscapeFile(join37(fileDir, styleUrl), stylePreprocessors);
|
|
16538
16798
|
});
|
|
16539
16799
|
const results = await Promise.all(stylePromises);
|
|
16540
16800
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16545,7 +16805,7 @@ ${fields}
|
|
|
16545
16805
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16546
16806
|
if (!styleUrlMatch?.[1])
|
|
16547
16807
|
return source;
|
|
16548
|
-
const escaped = await readAndEscapeFile(
|
|
16808
|
+
const escaped = await readAndEscapeFile(join37(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16549
16809
|
if (!escaped)
|
|
16550
16810
|
return source;
|
|
16551
16811
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16619,10 +16879,10 @@ ${fields}
|
|
|
16619
16879
|
return "";
|
|
16620
16880
|
}
|
|
16621
16881
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16622
|
-
const entryPath =
|
|
16882
|
+
const entryPath = resolve28(inputPath);
|
|
16623
16883
|
const allOutputs = [];
|
|
16624
16884
|
const visited = new Set;
|
|
16625
|
-
const baseDir =
|
|
16885
|
+
const baseDir = resolve28(rootDir ?? process.cwd());
|
|
16626
16886
|
let usesLegacyAnimations = false;
|
|
16627
16887
|
const angularTranspiler = new Bun.Transpiler({
|
|
16628
16888
|
loader: "ts",
|
|
@@ -16641,16 +16901,16 @@ ${fields}
|
|
|
16641
16901
|
`${candidate}.js`,
|
|
16642
16902
|
`${candidate}.jsx`,
|
|
16643
16903
|
`${candidate}.json`,
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
16904
|
+
join37(candidate, "index.ts"),
|
|
16905
|
+
join37(candidate, "index.tsx"),
|
|
16906
|
+
join37(candidate, "index.js"),
|
|
16907
|
+
join37(candidate, "index.jsx")
|
|
16648
16908
|
];
|
|
16649
16909
|
return candidates.find((file4) => existsSync26(file4));
|
|
16650
16910
|
};
|
|
16651
16911
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16652
16912
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16653
|
-
return resolveSourceFile2(
|
|
16913
|
+
return resolveSourceFile2(resolve28(fromDir, specifier));
|
|
16654
16914
|
}
|
|
16655
16915
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16656
16916
|
if (aliased)
|
|
@@ -16659,7 +16919,7 @@ ${fields}
|
|
|
16659
16919
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16660
16920
|
if (resolved.includes("/node_modules/"))
|
|
16661
16921
|
return;
|
|
16662
|
-
const absolute =
|
|
16922
|
+
const absolute = resolve28(resolved);
|
|
16663
16923
|
if (!absolute.startsWith(baseDir))
|
|
16664
16924
|
return;
|
|
16665
16925
|
return resolveSourceFile2(absolute);
|
|
@@ -16668,13 +16928,13 @@ ${fields}
|
|
|
16668
16928
|
}
|
|
16669
16929
|
};
|
|
16670
16930
|
const toOutputPath = (sourcePath) => {
|
|
16671
|
-
const inputDir =
|
|
16931
|
+
const inputDir = dirname21(sourcePath);
|
|
16672
16932
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16673
16933
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16674
|
-
return
|
|
16934
|
+
return join37(inputDir, fileBase);
|
|
16675
16935
|
}
|
|
16676
16936
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16677
|
-
return
|
|
16937
|
+
return join37(outDir, relativeDir, fileBase);
|
|
16678
16938
|
};
|
|
16679
16939
|
const withCacheBuster = (specifier) => {
|
|
16680
16940
|
if (!cacheBuster)
|
|
@@ -16711,21 +16971,21 @@ ${fields}
|
|
|
16711
16971
|
return `${prefix}${dots}`;
|
|
16712
16972
|
return `${prefix}../${dots}`;
|
|
16713
16973
|
});
|
|
16714
|
-
if (
|
|
16974
|
+
if (resolve28(actualPath) === entryPath) {
|
|
16715
16975
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16716
16976
|
}
|
|
16717
16977
|
return processedContent;
|
|
16718
16978
|
};
|
|
16719
16979
|
const transpileFile = async (filePath) => {
|
|
16720
|
-
const resolved =
|
|
16980
|
+
const resolved = resolve28(filePath);
|
|
16721
16981
|
if (visited.has(resolved))
|
|
16722
16982
|
return;
|
|
16723
16983
|
visited.add(resolved);
|
|
16724
16984
|
if (resolved.endsWith(".json") && existsSync26(resolved)) {
|
|
16725
|
-
const inputDir2 =
|
|
16985
|
+
const inputDir2 = dirname21(resolved);
|
|
16726
16986
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16727
|
-
const targetDir2 =
|
|
16728
|
-
const targetPath2 =
|
|
16987
|
+
const targetDir2 = join37(outDir, relativeDir2);
|
|
16988
|
+
const targetPath2 = join37(targetDir2, basename12(resolved));
|
|
16729
16989
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16730
16990
|
await fs5.copyFile(resolved, targetPath2);
|
|
16731
16991
|
allOutputs.push(targetPath2);
|
|
@@ -16737,12 +16997,12 @@ ${fields}
|
|
|
16737
16997
|
if (!existsSync26(actualPath))
|
|
16738
16998
|
return;
|
|
16739
16999
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16740
|
-
const inlined = await inlineResources(sourceCode,
|
|
16741
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16742
|
-
const inputDir =
|
|
17000
|
+
const inlined = await inlineResources(sourceCode, dirname21(actualPath), stylePreprocessors);
|
|
17001
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname21(actualPath)).source;
|
|
17002
|
+
const inputDir = dirname21(actualPath);
|
|
16743
17003
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16744
17004
|
const targetPath = toOutputPath(actualPath);
|
|
16745
|
-
const targetDir =
|
|
17005
|
+
const targetDir = dirname21(targetPath);
|
|
16746
17006
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16747
17007
|
const localImports = [];
|
|
16748
17008
|
const importRewrites = new Map;
|
|
@@ -16769,7 +17029,7 @@ ${fields}
|
|
|
16769
17029
|
importRewrites.set(specifier, relativeRewrite);
|
|
16770
17030
|
return resolved2;
|
|
16771
17031
|
}).filter((path) => Boolean(path));
|
|
16772
|
-
const isEntry =
|
|
17032
|
+
const isEntry = resolve28(actualPath) === resolve28(entryPath);
|
|
16773
17033
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16774
17034
|
const cacheKey2 = actualPath;
|
|
16775
17035
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync26(targetPath);
|
|
@@ -16804,13 +17064,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16804
17064
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16805
17065
|
}
|
|
16806
17066
|
const compiledRoot = compiledParent;
|
|
16807
|
-
const indexesDir =
|
|
17067
|
+
const indexesDir = join37(compiledParent, "indexes");
|
|
16808
17068
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16809
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
17069
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve28(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16810
17070
|
if (!hmr) {
|
|
16811
17071
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16812
17072
|
const cwd = process.cwd();
|
|
16813
|
-
const angularSrcDir =
|
|
17073
|
+
const angularSrcDir = resolve28(outRoot);
|
|
16814
17074
|
if (!existsSync26(angularSrcDir))
|
|
16815
17075
|
return;
|
|
16816
17076
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16818,17 +17078,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16818
17078
|
absolute: false,
|
|
16819
17079
|
cwd: angularSrcDir
|
|
16820
17080
|
})) {
|
|
16821
|
-
const sourcePath =
|
|
17081
|
+
const sourcePath = join37(angularSrcDir, rel);
|
|
16822
17082
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16823
|
-
const targetPath =
|
|
16824
|
-
await fs5.mkdir(
|
|
17083
|
+
const targetPath = join37(compiledRoot, cwdRel);
|
|
17084
|
+
await fs5.mkdir(dirname21(targetPath), { recursive: true });
|
|
16825
17085
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16826
17086
|
}
|
|
16827
17087
|
});
|
|
16828
17088
|
}
|
|
16829
17089
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16830
17090
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16831
|
-
const resolvedEntry =
|
|
17091
|
+
const resolvedEntry = resolve28(entry);
|
|
16832
17092
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16833
17093
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16834
17094
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16837,13 +17097,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16837
17097
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16838
17098
|
const jsName = `${fileBase}.js`;
|
|
16839
17099
|
const compiledFallbackPaths = [
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
].map((file4) =>
|
|
17100
|
+
join37(compiledRoot, relativeEntry),
|
|
17101
|
+
join37(compiledRoot, "pages", jsName),
|
|
17102
|
+
join37(compiledRoot, jsName)
|
|
17103
|
+
].map((file4) => resolve28(file4));
|
|
16844
17104
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16845
17105
|
const normalizedCandidates = [
|
|
16846
|
-
...candidatePaths.map((file4) =>
|
|
17106
|
+
...candidatePaths.map((file4) => resolve28(file4)),
|
|
16847
17107
|
...compiledFallbackPaths
|
|
16848
17108
|
];
|
|
16849
17109
|
let candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16890,7 +17150,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16890
17150
|
let providersSourceContent = "";
|
|
16891
17151
|
if (providersInjection.appProvidersSource) {
|
|
16892
17152
|
try {
|
|
16893
|
-
providersSourceContent =
|
|
17153
|
+
providersSourceContent = readFileSync24(providersInjection.appProvidersSource, "utf-8");
|
|
16894
17154
|
} catch {}
|
|
16895
17155
|
}
|
|
16896
17156
|
return JSON.stringify({
|
|
@@ -16901,7 +17161,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16901
17161
|
})() : "no-providers";
|
|
16902
17162
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16903
17163
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16904
|
-
const clientFile =
|
|
17164
|
+
const clientFile = join37(indexesDir, jsName);
|
|
16905
17165
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync26(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
16906
17166
|
return {
|
|
16907
17167
|
clientPath: clientFile,
|
|
@@ -16933,13 +17193,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16933
17193
|
const fragments = [];
|
|
16934
17194
|
if (providersInjection.appProvidersSource) {
|
|
16935
17195
|
const compiledAppProvidersPath = (() => {
|
|
16936
|
-
const angularDirAbs =
|
|
16937
|
-
const appSourceAbs =
|
|
17196
|
+
const angularDirAbs = resolve28(outRoot);
|
|
17197
|
+
const appSourceAbs = resolve28(providersInjection.appProvidersSource);
|
|
16938
17198
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16939
|
-
return
|
|
17199
|
+
return join37(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16940
17200
|
})();
|
|
16941
17201
|
const appProvidersSpec = (() => {
|
|
16942
|
-
const rel = relative13(
|
|
17202
|
+
const rel = relative13(dirname21(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16943
17203
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16944
17204
|
})();
|
|
16945
17205
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -17191,7 +17451,7 @@ var init_compileAngular = __esm(() => {
|
|
|
17191
17451
|
init_stylePreprocessor();
|
|
17192
17452
|
init_generatedDir();
|
|
17193
17453
|
devClientDir4 = resolveDevClientDir4();
|
|
17194
|
-
hmrClientPath5 =
|
|
17454
|
+
hmrClientPath5 = join37(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
17195
17455
|
jitContentCache = new Map;
|
|
17196
17456
|
wrapperOutputCache = new Map;
|
|
17197
17457
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17915,8 +18175,8 @@ __export(exports_fastHmrCompiler, {
|
|
|
17915
18175
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
17916
18176
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17917
18177
|
});
|
|
17918
|
-
import { existsSync as existsSync27, readFileSync as
|
|
17919
|
-
import { dirname as
|
|
18178
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25, statSync as statSync2 } from "fs";
|
|
18179
|
+
import { dirname as dirname22, extname as extname8, relative as relative14, resolve as resolve29 } from "path";
|
|
17920
18180
|
import ts17 from "typescript";
|
|
17921
18181
|
var fail = (reason, detail, location) => ({
|
|
17922
18182
|
detail,
|
|
@@ -18046,7 +18306,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18046
18306
|
continue;
|
|
18047
18307
|
const decoratorMeta = readDecoratorMeta(args);
|
|
18048
18308
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
18049
|
-
const componentDir =
|
|
18309
|
+
const componentDir = dirname22(componentFilePath);
|
|
18050
18310
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
18051
18311
|
fingerprintCache.set(id, fingerprint);
|
|
18052
18312
|
} else {
|
|
@@ -18231,7 +18491,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18231
18491
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18232
18492
|
return true;
|
|
18233
18493
|
}
|
|
18234
|
-
const base =
|
|
18494
|
+
const base = resolve29(componentDir, spec);
|
|
18235
18495
|
const candidates = [
|
|
18236
18496
|
`${base}.ts`,
|
|
18237
18497
|
`${base}.tsx`,
|
|
@@ -18243,7 +18503,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18243
18503
|
continue;
|
|
18244
18504
|
let content;
|
|
18245
18505
|
try {
|
|
18246
|
-
content =
|
|
18506
|
+
content = readFileSync25(candidate, "utf-8");
|
|
18247
18507
|
} catch {
|
|
18248
18508
|
continue;
|
|
18249
18509
|
}
|
|
@@ -18529,7 +18789,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18529
18789
|
listeners: {},
|
|
18530
18790
|
properties: {},
|
|
18531
18791
|
specialAttributes: {}
|
|
18532
|
-
}), parseHostObjectInto = (
|
|
18792
|
+
}), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
|
|
18533
18793
|
const hostNode = getProperty(args, "host");
|
|
18534
18794
|
if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
|
|
18535
18795
|
if (!hostExprNode)
|
|
@@ -18553,14 +18813,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18553
18813
|
const propMatch = ATTR_BINDING_RE.exec(key);
|
|
18554
18814
|
const evtMatch = EVENT_BINDING_RE.exec(key);
|
|
18555
18815
|
if (propMatch) {
|
|
18556
|
-
|
|
18816
|
+
host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18557
18817
|
} else if (evtMatch) {
|
|
18558
|
-
|
|
18818
|
+
host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18559
18819
|
} else {
|
|
18560
|
-
|
|
18820
|
+
host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
|
|
18561
18821
|
}
|
|
18562
18822
|
}
|
|
18563
|
-
}, mergeMemberHostDecorators = (
|
|
18823
|
+
}, mergeMemberHostDecorators = (host2, cls) => {
|
|
18564
18824
|
for (const member of cls.members) {
|
|
18565
18825
|
if (!ts17.canHaveDecorators(member))
|
|
18566
18826
|
continue;
|
|
@@ -18580,7 +18840,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18580
18840
|
const propertyName2 = member.name.text;
|
|
18581
18841
|
const [target] = expr.arguments;
|
|
18582
18842
|
const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
|
|
18583
|
-
|
|
18843
|
+
host2.properties[key] = propertyName2;
|
|
18584
18844
|
} else if (functionNode.text === "HostListener") {
|
|
18585
18845
|
if (!ts17.isMethodDeclaration(member))
|
|
18586
18846
|
continue;
|
|
@@ -18598,7 +18858,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18598
18858
|
argsList.push(element.text);
|
|
18599
18859
|
}
|
|
18600
18860
|
}
|
|
18601
|
-
|
|
18861
|
+
host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
18602
18862
|
}
|
|
18603
18863
|
}
|
|
18604
18864
|
}
|
|
@@ -18789,9 +19049,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18789
19049
|
}
|
|
18790
19050
|
return out.length > 0 ? out : null;
|
|
18791
19051
|
}, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
|
|
18792
|
-
const
|
|
18793
|
-
parseHostObjectInto(
|
|
18794
|
-
mergeMemberHostDecorators(
|
|
19052
|
+
const host2 = emptyHost();
|
|
19053
|
+
parseHostObjectInto(host2, decoratorArgs, null, compiler);
|
|
19054
|
+
mergeMemberHostDecorators(host2, cls);
|
|
18795
19055
|
const decoratorQueries = extractDecoratorQueries(cls, compiler);
|
|
18796
19056
|
const signalQueries = extractSignalQueries(cls, compiler);
|
|
18797
19057
|
const contentQueries = [
|
|
@@ -18812,7 +19072,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18812
19072
|
animations,
|
|
18813
19073
|
contentQueries,
|
|
18814
19074
|
exportAs: extractExportAs(decoratorArgs),
|
|
18815
|
-
host,
|
|
19075
|
+
host: host2,
|
|
18816
19076
|
hostDirectives: extractHostDirectives(decoratorArgs, compiler),
|
|
18817
19077
|
providers,
|
|
18818
19078
|
viewProviders,
|
|
@@ -18831,7 +19091,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18831
19091
|
return cached.info;
|
|
18832
19092
|
let source;
|
|
18833
19093
|
try {
|
|
18834
|
-
source =
|
|
19094
|
+
source = readFileSync25(filePath, "utf-8");
|
|
18835
19095
|
} catch {
|
|
18836
19096
|
childComponentInfoCache.set(cacheKey2, {
|
|
18837
19097
|
info: null,
|
|
@@ -18885,7 +19145,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18885
19145
|
return cached.info;
|
|
18886
19146
|
let content;
|
|
18887
19147
|
try {
|
|
18888
|
-
content =
|
|
19148
|
+
content = readFileSync25(dtsPath, "utf-8");
|
|
18889
19149
|
} catch {
|
|
18890
19150
|
childComponentInfoCache.set(cacheKey2, {
|
|
18891
19151
|
info: null,
|
|
@@ -19008,7 +19268,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19008
19268
|
return null;
|
|
19009
19269
|
let content;
|
|
19010
19270
|
try {
|
|
19011
|
-
content =
|
|
19271
|
+
content = readFileSync25(startDtsPath, "utf-8");
|
|
19012
19272
|
} catch {
|
|
19013
19273
|
return null;
|
|
19014
19274
|
}
|
|
@@ -19027,7 +19287,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19027
19287
|
});
|
|
19028
19288
|
if (!names.includes(className))
|
|
19029
19289
|
continue;
|
|
19030
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19290
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname22(startDtsPath));
|
|
19031
19291
|
if (!nextDts)
|
|
19032
19292
|
continue;
|
|
19033
19293
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19037,7 +19297,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19037
19297
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
19038
19298
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
19039
19299
|
const fromPath = item[1] || "";
|
|
19040
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19300
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname22(startDtsPath));
|
|
19041
19301
|
if (!nextDts)
|
|
19042
19302
|
continue;
|
|
19043
19303
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19047,7 +19307,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19047
19307
|
return null;
|
|
19048
19308
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19049
19309
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19050
|
-
const base =
|
|
19310
|
+
const base = resolve29(fromDir, stripped);
|
|
19051
19311
|
const candidates = [
|
|
19052
19312
|
`${base}.d.ts`,
|
|
19053
19313
|
`${base}.d.mts`,
|
|
@@ -19071,7 +19331,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19071
19331
|
return null;
|
|
19072
19332
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19073
19333
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19074
|
-
const base =
|
|
19334
|
+
const base = resolve29(componentDir, spec);
|
|
19075
19335
|
const candidates = [
|
|
19076
19336
|
`${base}.ts`,
|
|
19077
19337
|
`${base}.tsx`,
|
|
@@ -19226,7 +19486,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19226
19486
|
return cached.hasProviders;
|
|
19227
19487
|
let source;
|
|
19228
19488
|
try {
|
|
19229
|
-
source =
|
|
19489
|
+
source = readFileSync25(filePath, "utf8");
|
|
19230
19490
|
} catch {
|
|
19231
19491
|
return true;
|
|
19232
19492
|
}
|
|
@@ -19290,13 +19550,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19290
19550
|
}
|
|
19291
19551
|
if (!matches)
|
|
19292
19552
|
continue;
|
|
19293
|
-
const resolved =
|
|
19553
|
+
const resolved = resolve29(componentDir, spec);
|
|
19294
19554
|
for (const ext of TS_EXTENSIONS) {
|
|
19295
19555
|
const candidate = resolved + ext;
|
|
19296
19556
|
if (existsSync27(candidate))
|
|
19297
19557
|
return candidate;
|
|
19298
19558
|
}
|
|
19299
|
-
const indexCandidate =
|
|
19559
|
+
const indexCandidate = resolve29(resolved, "index.ts");
|
|
19300
19560
|
if (existsSync27(indexCandidate))
|
|
19301
19561
|
return indexCandidate;
|
|
19302
19562
|
}
|
|
@@ -19534,12 +19794,12 @@ ${transpiled}
|
|
|
19534
19794
|
}
|
|
19535
19795
|
}${staticPatch}`;
|
|
19536
19796
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19537
|
-
const abs =
|
|
19797
|
+
const abs = resolve29(componentDir, url);
|
|
19538
19798
|
if (!existsSync27(abs))
|
|
19539
19799
|
return null;
|
|
19540
19800
|
const ext = extname8(abs).toLowerCase();
|
|
19541
19801
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19542
|
-
return
|
|
19802
|
+
return readFileSync25(abs, "utf8");
|
|
19543
19803
|
}
|
|
19544
19804
|
try {
|
|
19545
19805
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19573,11 +19833,11 @@ ${block}
|
|
|
19573
19833
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19574
19834
|
if (cached !== undefined)
|
|
19575
19835
|
return cached;
|
|
19576
|
-
const tsconfigPath =
|
|
19836
|
+
const tsconfigPath = resolve29(projectRoot, "tsconfig.json");
|
|
19577
19837
|
const opts = {};
|
|
19578
19838
|
if (existsSync27(tsconfigPath)) {
|
|
19579
19839
|
try {
|
|
19580
|
-
const text =
|
|
19840
|
+
const text = readFileSync25(tsconfigPath, "utf8");
|
|
19581
19841
|
const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19582
19842
|
if (!parsed.error && parsed.config) {
|
|
19583
19843
|
const cfg = parsed.config;
|
|
@@ -19611,7 +19871,7 @@ ${block}
|
|
|
19611
19871
|
} catch (err) {
|
|
19612
19872
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19613
19873
|
}
|
|
19614
|
-
const tsSource =
|
|
19874
|
+
const tsSource = readFileSync25(componentFilePath, "utf8");
|
|
19615
19875
|
const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
19616
19876
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19617
19877
|
if (!classNode) {
|
|
@@ -19638,7 +19898,7 @@ ${block}
|
|
|
19638
19898
|
rebootstrapRequired: false
|
|
19639
19899
|
};
|
|
19640
19900
|
}
|
|
19641
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
19901
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname22(componentFilePath), projectRoot)) {
|
|
19642
19902
|
return fail("inherits-decorated-class");
|
|
19643
19903
|
}
|
|
19644
19904
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19650,18 +19910,18 @@ ${block}
|
|
|
19650
19910
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19651
19911
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19652
19912
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19653
|
-
const componentDir =
|
|
19913
|
+
const componentDir = dirname22(componentFilePath);
|
|
19654
19914
|
let templateText;
|
|
19655
19915
|
let templatePath;
|
|
19656
19916
|
if (decoratorMeta.template !== null) {
|
|
19657
19917
|
templateText = decoratorMeta.template;
|
|
19658
19918
|
templatePath = componentFilePath;
|
|
19659
19919
|
} else if (decoratorMeta.templateUrl) {
|
|
19660
|
-
const tplAbs =
|
|
19920
|
+
const tplAbs = resolve29(componentDir, decoratorMeta.templateUrl);
|
|
19661
19921
|
if (!existsSync27(tplAbs)) {
|
|
19662
19922
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19663
19923
|
}
|
|
19664
|
-
templateText =
|
|
19924
|
+
templateText = readFileSync25(tplAbs, "utf8");
|
|
19665
19925
|
templatePath = tplAbs;
|
|
19666
19926
|
} else {
|
|
19667
19927
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20420,7 +20680,7 @@ __export(exports_compileEmber, {
|
|
|
20420
20680
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
20421
20681
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
20422
20682
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
20423
|
-
dirname: () =>
|
|
20683
|
+
dirname: () => dirname23,
|
|
20424
20684
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
20425
20685
|
compileEmberFile: () => compileEmberFile,
|
|
20426
20686
|
compileEmber: () => compileEmber,
|
|
@@ -20429,7 +20689,7 @@ __export(exports_compileEmber, {
|
|
|
20429
20689
|
});
|
|
20430
20690
|
import { existsSync as existsSync28 } from "fs";
|
|
20431
20691
|
import { mkdir as mkdir11, rm as rm8 } from "fs/promises";
|
|
20432
|
-
import { basename as basename13, dirname as
|
|
20692
|
+
import { basename as basename13, dirname as dirname23, extname as extname9, join as join38, resolve as resolve30 } from "path";
|
|
20433
20693
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
20434
20694
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20435
20695
|
if (cachedPreprocessor)
|
|
@@ -20525,7 +20785,7 @@ export const importSync = (specifier) => {
|
|
|
20525
20785
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20526
20786
|
if (!originalImporter)
|
|
20527
20787
|
return;
|
|
20528
|
-
const candidateBase =
|
|
20788
|
+
const candidateBase = resolve30(dirname23(originalImporter), args.path);
|
|
20529
20789
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20530
20790
|
for (const ext of extensionsToTry) {
|
|
20531
20791
|
const candidate = candidateBase + ext;
|
|
@@ -20548,7 +20808,7 @@ export const importSync = (specifier) => {
|
|
|
20548
20808
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20549
20809
|
if (standalonePackages.has(args.path))
|
|
20550
20810
|
return;
|
|
20551
|
-
const internal =
|
|
20811
|
+
const internal = join38(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20552
20812
|
if (existsSync28(internal))
|
|
20553
20813
|
return { path: internal };
|
|
20554
20814
|
return;
|
|
@@ -20584,7 +20844,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20584
20844
|
export { PageComponent };
|
|
20585
20845
|
export default PageComponent;
|
|
20586
20846
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20587
|
-
const resolvedEntry =
|
|
20847
|
+
const resolvedEntry = resolve30(entry);
|
|
20588
20848
|
const source = await file4(resolvedEntry).text();
|
|
20589
20849
|
let preprocessed = source;
|
|
20590
20850
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20596,16 +20856,16 @@ export default PageComponent;
|
|
|
20596
20856
|
}
|
|
20597
20857
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20598
20858
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20599
|
-
const tmpDir =
|
|
20600
|
-
const serverDir =
|
|
20601
|
-
const clientDir =
|
|
20859
|
+
const tmpDir = join38(compiledRoot, "_tmp");
|
|
20860
|
+
const serverDir = join38(compiledRoot, "server");
|
|
20861
|
+
const clientDir = join38(compiledRoot, "client");
|
|
20602
20862
|
await Promise.all([
|
|
20603
20863
|
mkdir11(tmpDir, { recursive: true }),
|
|
20604
20864
|
mkdir11(serverDir, { recursive: true }),
|
|
20605
20865
|
mkdir11(clientDir, { recursive: true })
|
|
20606
20866
|
]);
|
|
20607
|
-
const tmpPagePath =
|
|
20608
|
-
const tmpHarnessPath =
|
|
20867
|
+
const tmpPagePath = resolve30(join38(tmpDir, `${baseName}.module.js`));
|
|
20868
|
+
const tmpHarnessPath = resolve30(join38(tmpDir, `${baseName}.harness.js`));
|
|
20609
20869
|
await Promise.all([
|
|
20610
20870
|
write4(tmpPagePath, transpiled),
|
|
20611
20871
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20613,7 +20873,7 @@ export default PageComponent;
|
|
|
20613
20873
|
const stagedSourceMap = new Map([
|
|
20614
20874
|
[tmpPagePath, resolvedEntry]
|
|
20615
20875
|
]);
|
|
20616
|
-
const serverPath =
|
|
20876
|
+
const serverPath = join38(serverDir, `${baseName}.js`);
|
|
20617
20877
|
const buildResult = await bunBuild2({
|
|
20618
20878
|
entrypoints: [tmpHarnessPath],
|
|
20619
20879
|
format: "esm",
|
|
@@ -20630,7 +20890,7 @@ export default PageComponent;
|
|
|
20630
20890
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20631
20891
|
}
|
|
20632
20892
|
await rm8(tmpDir, { force: true, recursive: true });
|
|
20633
|
-
const clientPath =
|
|
20893
|
+
const clientPath = join38(clientDir, `${baseName}.js`);
|
|
20634
20894
|
await write4(clientPath, transpiled);
|
|
20635
20895
|
return { clientPath, serverPath };
|
|
20636
20896
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20647,7 +20907,7 @@ export default PageComponent;
|
|
|
20647
20907
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20648
20908
|
};
|
|
20649
20909
|
}, compileEmberFileSource = async (entry) => {
|
|
20650
|
-
const resolvedEntry =
|
|
20910
|
+
const resolvedEntry = resolve30(entry);
|
|
20651
20911
|
const source = await file4(resolvedEntry).text();
|
|
20652
20912
|
let preprocessed = source;
|
|
20653
20913
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20658,7 +20918,7 @@ export default PageComponent;
|
|
|
20658
20918
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20659
20919
|
}
|
|
20660
20920
|
return transpiler5.transformSync(preprocessed);
|
|
20661
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
20921
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join38(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join38(getEmberCompiledRoot(emberDir), "client");
|
|
20662
20922
|
var init_compileEmber = __esm(() => {
|
|
20663
20923
|
init_generatedDir();
|
|
20664
20924
|
transpiler5 = new Transpiler4({
|
|
@@ -20680,24 +20940,24 @@ __export(exports_buildReactVendor, {
|
|
|
20680
20940
|
buildReactVendor: () => buildReactVendor
|
|
20681
20941
|
});
|
|
20682
20942
|
import { existsSync as existsSync29, mkdirSync as mkdirSync8 } from "fs";
|
|
20683
|
-
import { join as
|
|
20943
|
+
import { join as join39, resolve as resolve31 } from "path";
|
|
20684
20944
|
import { rm as rm9 } from "fs/promises";
|
|
20685
20945
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20686
20946
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20687
20947
|
const candidates = [
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20948
|
+
resolve31(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
20949
|
+
resolve31(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20950
|
+
resolve31(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
20951
|
+
resolve31(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20952
|
+
resolve31(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
20953
|
+
resolve31(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20694
20954
|
];
|
|
20695
20955
|
for (const candidate of candidates) {
|
|
20696
20956
|
if (existsSync29(candidate)) {
|
|
20697
20957
|
return candidate.replace(/\\/g, "/");
|
|
20698
20958
|
}
|
|
20699
20959
|
}
|
|
20700
|
-
return (candidates[0] ??
|
|
20960
|
+
return (candidates[0] ?? resolve31(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20701
20961
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20702
20962
|
const paths = {};
|
|
20703
20963
|
for (const specifier of reactSpecifiers) {
|
|
@@ -20730,14 +20990,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20730
20990
|
`)}
|
|
20731
20991
|
`;
|
|
20732
20992
|
}, buildReactVendor = async (buildDir) => {
|
|
20733
|
-
const vendorDir =
|
|
20993
|
+
const vendorDir = join39(buildDir, "react", "vendor");
|
|
20734
20994
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20735
|
-
const tmpDir =
|
|
20995
|
+
const tmpDir = join39(buildDir, "_vendor_tmp");
|
|
20736
20996
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20737
20997
|
const specifiers = reactSpecifiers;
|
|
20738
20998
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20739
20999
|
const safeName = toSafeFileName(specifier);
|
|
20740
|
-
const entryPath =
|
|
21000
|
+
const entryPath = join39(tmpDir, `${safeName}.ts`);
|
|
20741
21001
|
const source = await generateEntrySource(specifier);
|
|
20742
21002
|
await Bun.write(entryPath, source);
|
|
20743
21003
|
return entryPath;
|
|
@@ -20805,7 +21065,7 @@ __export(exports_buildAngularVendor, {
|
|
|
20805
21065
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20806
21066
|
});
|
|
20807
21067
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20808
|
-
import { join as
|
|
21068
|
+
import { join as join40 } from "path";
|
|
20809
21069
|
import { rm as rm10 } from "fs/promises";
|
|
20810
21070
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20811
21071
|
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) => {
|
|
@@ -20842,7 +21102,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20842
21102
|
}
|
|
20843
21103
|
return { angular, transitiveRoots };
|
|
20844
21104
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
20845
|
-
const { readFileSync:
|
|
21105
|
+
const { readFileSync: readFileSync26 } = await import("fs");
|
|
20846
21106
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
20847
21107
|
const visited = new Set;
|
|
20848
21108
|
const frontier = [];
|
|
@@ -20863,7 +21123,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20863
21123
|
}
|
|
20864
21124
|
let content;
|
|
20865
21125
|
try {
|
|
20866
|
-
content =
|
|
21126
|
+
content = readFileSync26(resolved, "utf-8");
|
|
20867
21127
|
} catch {
|
|
20868
21128
|
continue;
|
|
20869
21129
|
}
|
|
@@ -20902,14 +21162,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20902
21162
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20903
21163
|
return Array.from(angular).filter(isResolvable);
|
|
20904
21164
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20905
|
-
const vendorDir =
|
|
21165
|
+
const vendorDir = join40(buildDir, "angular", "vendor");
|
|
20906
21166
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20907
|
-
const tmpDir =
|
|
21167
|
+
const tmpDir = join40(buildDir, "_angular_vendor_tmp");
|
|
20908
21168
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20909
21169
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20910
21170
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20911
21171
|
const safeName = toSafeFileName2(specifier);
|
|
20912
|
-
const entryPath =
|
|
21172
|
+
const entryPath = join40(tmpDir, `${safeName}.ts`);
|
|
20913
21173
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20914
21174
|
return entryPath;
|
|
20915
21175
|
}));
|
|
@@ -20940,9 +21200,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20940
21200
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20941
21201
|
return computeAngularVendorPaths(specifiers);
|
|
20942
21202
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20943
|
-
const vendorDir =
|
|
21203
|
+
const vendorDir = join40(buildDir, "angular", "vendor", "server");
|
|
20944
21204
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20945
|
-
const tmpDir =
|
|
21205
|
+
const tmpDir = join40(buildDir, "_angular_server_vendor_tmp");
|
|
20946
21206
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20947
21207
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20948
21208
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20953,7 +21213,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20953
21213
|
const specifiers = Array.from(allSpecs);
|
|
20954
21214
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20955
21215
|
const safeName = toSafeFileName2(specifier);
|
|
20956
|
-
const entryPath =
|
|
21216
|
+
const entryPath = join40(tmpDir, `${safeName}.ts`);
|
|
20957
21217
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20958
21218
|
return entryPath;
|
|
20959
21219
|
}));
|
|
@@ -20975,9 +21235,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20975
21235
|
return specifiers;
|
|
20976
21236
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20977
21237
|
const paths = {};
|
|
20978
|
-
const vendorDir =
|
|
21238
|
+
const vendorDir = join40(buildDir, "angular", "vendor", "server");
|
|
20979
21239
|
for (const specifier of specifiers) {
|
|
20980
|
-
paths[specifier] =
|
|
21240
|
+
paths[specifier] = join40(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20981
21241
|
}
|
|
20982
21242
|
return paths;
|
|
20983
21243
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -21033,17 +21293,17 @@ __export(exports_buildVueVendor, {
|
|
|
21033
21293
|
buildVueVendor: () => buildVueVendor
|
|
21034
21294
|
});
|
|
21035
21295
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
21036
|
-
import { join as
|
|
21296
|
+
import { join as join41 } from "path";
|
|
21037
21297
|
import { rm as rm11 } from "fs/promises";
|
|
21038
21298
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
21039
21299
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
21040
|
-
const vendorDir =
|
|
21300
|
+
const vendorDir = join41(buildDir, "vue", "vendor");
|
|
21041
21301
|
mkdirSync10(vendorDir, { recursive: true });
|
|
21042
|
-
const tmpDir =
|
|
21302
|
+
const tmpDir = join41(buildDir, "_vue_vendor_tmp");
|
|
21043
21303
|
mkdirSync10(tmpDir, { recursive: true });
|
|
21044
21304
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
21045
21305
|
const safeName = toSafeFileName3(specifier);
|
|
21046
|
-
const entryPath =
|
|
21306
|
+
const entryPath = join41(tmpDir, `${safeName}.ts`);
|
|
21047
21307
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21048
21308
|
`);
|
|
21049
21309
|
return entryPath;
|
|
@@ -21068,11 +21328,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
21068
21328
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
21069
21329
|
return;
|
|
21070
21330
|
}
|
|
21071
|
-
const { readFileSync:
|
|
21331
|
+
const { readFileSync: readFileSync26, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
21072
21332
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
21073
21333
|
for (const file5 of files) {
|
|
21074
|
-
const filePath =
|
|
21075
|
-
const content =
|
|
21334
|
+
const filePath = join41(vendorDir, file5);
|
|
21335
|
+
const content = readFileSync26(filePath, "utf-8");
|
|
21076
21336
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
21077
21337
|
continue;
|
|
21078
21338
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -21098,7 +21358,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
21098
21358
|
buildSvelteVendor: () => buildSvelteVendor
|
|
21099
21359
|
});
|
|
21100
21360
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
21101
|
-
import { join as
|
|
21361
|
+
import { join as join42 } from "path";
|
|
21102
21362
|
import { rm as rm12 } from "fs/promises";
|
|
21103
21363
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
21104
21364
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -21112,13 +21372,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
21112
21372
|
const specifiers = resolveVendorSpecifiers();
|
|
21113
21373
|
if (specifiers.length === 0)
|
|
21114
21374
|
return;
|
|
21115
|
-
const vendorDir =
|
|
21375
|
+
const vendorDir = join42(buildDir, "svelte", "vendor");
|
|
21116
21376
|
mkdirSync11(vendorDir, { recursive: true });
|
|
21117
|
-
const tmpDir =
|
|
21377
|
+
const tmpDir = join42(buildDir, "_svelte_vendor_tmp");
|
|
21118
21378
|
mkdirSync11(tmpDir, { recursive: true });
|
|
21119
21379
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21120
21380
|
const safeName = toSafeFileName4(specifier);
|
|
21121
|
-
const entryPath =
|
|
21381
|
+
const entryPath = join42(tmpDir, `${safeName}.ts`);
|
|
21122
21382
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21123
21383
|
`);
|
|
21124
21384
|
return entryPath;
|
|
@@ -21163,13 +21423,13 @@ import {
|
|
|
21163
21423
|
existsSync as existsSync30,
|
|
21164
21424
|
mkdirSync as mkdirSync12,
|
|
21165
21425
|
readdirSync as readdirSync5,
|
|
21166
|
-
readFileSync as
|
|
21426
|
+
readFileSync as readFileSync26,
|
|
21167
21427
|
renameSync,
|
|
21168
21428
|
rmSync as rmSync2,
|
|
21169
21429
|
statSync as statSync3,
|
|
21170
21430
|
writeFileSync as writeFileSync9
|
|
21171
21431
|
} from "fs";
|
|
21172
|
-
import { basename as basename14, dirname as
|
|
21432
|
+
import { basename as basename14, dirname as dirname24, extname as extname10, join as join43, relative as relative15, resolve as resolve32 } from "path";
|
|
21173
21433
|
import { cwd, env as env3, exit } from "process";
|
|
21174
21434
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
21175
21435
|
var isBuildTraceEnabled = () => {
|
|
@@ -21252,7 +21512,7 @@ var isBuildTraceEnabled = () => {
|
|
|
21252
21512
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
21253
21513
|
let content;
|
|
21254
21514
|
try {
|
|
21255
|
-
content =
|
|
21515
|
+
content = readFileSync26(path, "utf-8");
|
|
21256
21516
|
} catch {
|
|
21257
21517
|
return [];
|
|
21258
21518
|
}
|
|
@@ -21303,8 +21563,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21303
21563
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
21304
21564
|
const glob = new Glob8("htmx*.min.js");
|
|
21305
21565
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
21306
|
-
const src =
|
|
21307
|
-
const dest =
|
|
21566
|
+
const src = join43(htmxDir, relPath);
|
|
21567
|
+
const dest = join43(htmxDestDir, "htmx.min.js");
|
|
21308
21568
|
copyFileSync2(src, dest);
|
|
21309
21569
|
return;
|
|
21310
21570
|
}
|
|
@@ -21316,8 +21576,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21316
21576
|
}
|
|
21317
21577
|
}, resolveAbsoluteVersion = async () => {
|
|
21318
21578
|
const candidates = [
|
|
21319
|
-
|
|
21320
|
-
|
|
21579
|
+
resolve32(import.meta.dir, "..", "..", "package.json"),
|
|
21580
|
+
resolve32(import.meta.dir, "..", "package.json")
|
|
21321
21581
|
];
|
|
21322
21582
|
const resolveCandidate = async (remaining) => {
|
|
21323
21583
|
const [candidate, ...rest] = remaining;
|
|
@@ -21333,7 +21593,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21333
21593
|
};
|
|
21334
21594
|
await resolveCandidate(candidates);
|
|
21335
21595
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
21336
|
-
const absPath =
|
|
21596
|
+
const absPath = resolve32(file5, "..", relPath);
|
|
21337
21597
|
try {
|
|
21338
21598
|
statSync3(absPath);
|
|
21339
21599
|
workerPaths.add(absPath);
|
|
@@ -21348,7 +21608,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21348
21608
|
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
21349
21609
|
}
|
|
21350
21610
|
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
21351
|
-
const content =
|
|
21611
|
+
const content = readFileSync26(file5, "utf-8");
|
|
21352
21612
|
for (const pattern of patterns) {
|
|
21353
21613
|
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
21354
21614
|
}
|
|
@@ -21381,7 +21641,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21381
21641
|
vuePagesPath
|
|
21382
21642
|
}) => {
|
|
21383
21643
|
const { readdirSync: readDir } = await import("fs");
|
|
21384
|
-
const devIndexDir =
|
|
21644
|
+
const devIndexDir = join43(buildPath, "_src_indexes");
|
|
21385
21645
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
21386
21646
|
if (reactIndexesPath && reactPagesPath) {
|
|
21387
21647
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -21397,37 +21657,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21397
21657
|
return;
|
|
21398
21658
|
}
|
|
21399
21659
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
21400
|
-
const pagesRel = relative15(process.cwd(),
|
|
21660
|
+
const pagesRel = relative15(process.cwd(), resolve32(reactPagesPath)).replace(/\\/g, "/");
|
|
21401
21661
|
for (const file5 of indexFiles) {
|
|
21402
|
-
let content =
|
|
21662
|
+
let content = readFileSync26(join43(reactIndexesPath, file5), "utf-8");
|
|
21403
21663
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
21404
|
-
writeFileSync9(
|
|
21664
|
+
writeFileSync9(join43(devIndexDir, file5), content);
|
|
21405
21665
|
}
|
|
21406
21666
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21407
|
-
const svelteIndexDir =
|
|
21408
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
21667
|
+
const svelteIndexDir = join43(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21668
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve32(file5).startsWith(resolve32(sveltePagesPath)));
|
|
21409
21669
|
for (const entry of sveltePageEntries) {
|
|
21410
21670
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21411
|
-
const indexFile =
|
|
21671
|
+
const indexFile = join43(svelteIndexDir, "pages", `${name}.js`);
|
|
21412
21672
|
if (!existsSync30(indexFile))
|
|
21413
21673
|
continue;
|
|
21414
|
-
let content =
|
|
21415
|
-
const srcRel = relative15(process.cwd(),
|
|
21674
|
+
let content = readFileSync26(indexFile, "utf-8");
|
|
21675
|
+
const srcRel = relative15(process.cwd(), resolve32(entry)).replace(/\\/g, "/");
|
|
21416
21676
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21417
|
-
writeFileSync9(
|
|
21677
|
+
writeFileSync9(join43(devIndexDir, `${name}.svelte.js`), content);
|
|
21418
21678
|
}
|
|
21419
21679
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21420
|
-
const vueIndexDir =
|
|
21421
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
21680
|
+
const vueIndexDir = join43(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21681
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve32(file5).startsWith(resolve32(vuePagesPath)));
|
|
21422
21682
|
for (const entry of vuePageEntries) {
|
|
21423
21683
|
const name = basename14(entry, ".vue");
|
|
21424
|
-
const indexFile =
|
|
21684
|
+
const indexFile = join43(vueIndexDir, `${name}.js`);
|
|
21425
21685
|
if (!existsSync30(indexFile))
|
|
21426
21686
|
continue;
|
|
21427
|
-
let content =
|
|
21428
|
-
const srcRel = relative15(process.cwd(),
|
|
21687
|
+
let content = readFileSync26(indexFile, "utf-8");
|
|
21688
|
+
const srcRel = relative15(process.cwd(), resolve32(entry)).replace(/\\/g, "/");
|
|
21429
21689
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
21430
|
-
writeFileSync9(
|
|
21690
|
+
writeFileSync9(join43(devIndexDir, `${name}.vue.js`), content);
|
|
21431
21691
|
}
|
|
21432
21692
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
21433
21693
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21438,7 +21698,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21438
21698
|
const last = allComments[allComments.length - 1];
|
|
21439
21699
|
if (!last?.[1])
|
|
21440
21700
|
return JSON.stringify(outputPath);
|
|
21441
|
-
const srcPath =
|
|
21701
|
+
const srcPath = resolve32(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21442
21702
|
return JSON.stringify(srcPath);
|
|
21443
21703
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21444
21704
|
let depth = 0;
|
|
@@ -21475,7 +21735,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21475
21735
|
}
|
|
21476
21736
|
return result;
|
|
21477
21737
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
21478
|
-
let content =
|
|
21738
|
+
let content = readFileSync26(outputPath, "utf-8");
|
|
21479
21739
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
21480
21740
|
const useNames = [];
|
|
21481
21741
|
let match;
|
|
@@ -21525,7 +21785,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21525
21785
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
21526
21786
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
21527
21787
|
for (const outputPath of outputPaths) {
|
|
21528
|
-
let content =
|
|
21788
|
+
let content = readFileSync26(outputPath, "utf-8");
|
|
21529
21789
|
let changed = false;
|
|
21530
21790
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
21531
21791
|
const targetName = basename14(relPath);
|
|
@@ -21665,10 +21925,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21665
21925
|
restoreTracePhase();
|
|
21666
21926
|
return;
|
|
21667
21927
|
}
|
|
21668
|
-
const traceDir =
|
|
21928
|
+
const traceDir = join43(buildPath2, ".absolute-trace");
|
|
21669
21929
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21670
21930
|
mkdirSync12(traceDir, { recursive: true });
|
|
21671
|
-
writeFileSync9(
|
|
21931
|
+
writeFileSync9(join43(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21672
21932
|
events: traceEvents,
|
|
21673
21933
|
frameworks: traceFrameworkNames,
|
|
21674
21934
|
generatedAt: new Date().toISOString(),
|
|
@@ -21699,16 +21959,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21699
21959
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21700
21960
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21701
21961
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
21702
|
-
const reactIndexesPath = reactDir &&
|
|
21703
|
-
const reactPagesPath = reactDir &&
|
|
21704
|
-
const htmlPagesPath = htmlDir &&
|
|
21705
|
-
const htmlScriptsPath = htmlDir &&
|
|
21706
|
-
const sveltePagesPath = svelteDir &&
|
|
21707
|
-
const vuePagesPath = vueDir &&
|
|
21708
|
-
const htmxPagesPath = htmxDir &&
|
|
21709
|
-
const htmxScriptsPath = htmxDir &&
|
|
21710
|
-
const angularPagesPath = angularDir &&
|
|
21711
|
-
const emberPagesPath = emberDir &&
|
|
21962
|
+
const reactIndexesPath = reactDir && join43(getFrameworkGeneratedDir("react"), "indexes");
|
|
21963
|
+
const reactPagesPath = reactDir && join43(reactDir, "pages");
|
|
21964
|
+
const htmlPagesPath = htmlDir && join43(htmlDir, "pages");
|
|
21965
|
+
const htmlScriptsPath = htmlDir && join43(htmlDir, "scripts");
|
|
21966
|
+
const sveltePagesPath = svelteDir && join43(svelteDir, "pages");
|
|
21967
|
+
const vuePagesPath = vueDir && join43(vueDir, "pages");
|
|
21968
|
+
const htmxPagesPath = htmxDir && join43(htmxDir, "pages");
|
|
21969
|
+
const htmxScriptsPath = htmxDir && join43(htmxDir, "scripts");
|
|
21970
|
+
const angularPagesPath = angularDir && join43(angularDir, "pages");
|
|
21971
|
+
const emberPagesPath = emberDir && join43(emberDir, "pages");
|
|
21712
21972
|
const frontends = [
|
|
21713
21973
|
reactDir,
|
|
21714
21974
|
htmlDir,
|
|
@@ -21741,7 +22001,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21741
22001
|
const sourceClientRoots = [
|
|
21742
22002
|
htmlDir,
|
|
21743
22003
|
htmxDir,
|
|
21744
|
-
islandBootstrapPath &&
|
|
22004
|
+
islandBootstrapPath && dirname24(islandBootstrapPath)
|
|
21745
22005
|
].filter((dir) => Boolean(dir));
|
|
21746
22006
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21747
22007
|
if (usesGenerated)
|
|
@@ -21769,8 +22029,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21769
22029
|
const [firstEntry] = serverDirMap;
|
|
21770
22030
|
if (!firstEntry)
|
|
21771
22031
|
throw new Error("Expected at least one server directory entry");
|
|
21772
|
-
serverRoot =
|
|
21773
|
-
serverOutDir =
|
|
22032
|
+
serverRoot = join43(firstEntry.dir, firstEntry.subdir);
|
|
22033
|
+
serverOutDir = join43(buildPath, basename14(firstEntry.dir));
|
|
21774
22034
|
} else if (serverDirMap.length > 1) {
|
|
21775
22035
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21776
22036
|
serverOutDir = buildPath;
|
|
@@ -21783,18 +22043,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21783
22043
|
buildPath,
|
|
21784
22044
|
config: pwa,
|
|
21785
22045
|
generatedRoot,
|
|
22046
|
+
projectRoot,
|
|
21786
22047
|
write: !isIncremental
|
|
21787
22048
|
})) : undefined;
|
|
21788
22049
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21789
22050
|
if (!isIncremental || !incrementalFiles)
|
|
21790
22051
|
return entryPoints;
|
|
21791
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
22052
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve32(f2)));
|
|
21792
22053
|
const matchingEntries = [];
|
|
21793
22054
|
for (const entry of entryPoints) {
|
|
21794
22055
|
const sourceFile = mapToSource(entry);
|
|
21795
22056
|
if (!sourceFile)
|
|
21796
22057
|
continue;
|
|
21797
|
-
if (!normalizedIncremental.has(
|
|
22058
|
+
if (!normalizedIncremental.has(resolve32(sourceFile)))
|
|
21798
22059
|
continue;
|
|
21799
22060
|
matchingEntries.push(entry);
|
|
21800
22061
|
}
|
|
@@ -21804,7 +22065,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21804
22065
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21805
22066
|
}
|
|
21806
22067
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21807
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
22068
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join43(buildPath, "assets"), {
|
|
21808
22069
|
force: true,
|
|
21809
22070
|
recursive: true
|
|
21810
22071
|
}));
|
|
@@ -21918,11 +22179,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21918
22179
|
}
|
|
21919
22180
|
}
|
|
21920
22181
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21921
|
-
const htmlConventionsOutDir =
|
|
22182
|
+
const htmlConventionsOutDir = join43(buildPath, "conventions", "html");
|
|
21922
22183
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21923
22184
|
const htmlPathRemap = new Map;
|
|
21924
22185
|
for (const sourcePath of htmlConventionSources) {
|
|
21925
|
-
const dest =
|
|
22186
|
+
const dest = join43(htmlConventionsOutDir, basename14(sourcePath));
|
|
21926
22187
|
cpSync(sourcePath, dest, { force: true });
|
|
21927
22188
|
htmlPathRemap.set(sourcePath, dest);
|
|
21928
22189
|
}
|
|
@@ -21963,9 +22224,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21963
22224
|
}
|
|
21964
22225
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21965
22226
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21966
|
-
if (entry.startsWith(
|
|
22227
|
+
if (entry.startsWith(resolve32(reactIndexesPath))) {
|
|
21967
22228
|
const pageName = basename14(entry, ".tsx");
|
|
21968
|
-
return
|
|
22229
|
+
return join43(reactPagesPath, `${pageName}.tsx`);
|
|
21969
22230
|
}
|
|
21970
22231
|
return null;
|
|
21971
22232
|
}) : allReactEntries;
|
|
@@ -21997,7 +22258,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21997
22258
|
for (const entry of vueEntries) {
|
|
21998
22259
|
const name = basename14(entry, ".vue");
|
|
21999
22260
|
if (ssrOnlyPageNames.has(name)) {
|
|
22000
|
-
resolved.add(
|
|
22261
|
+
resolved.add(resolve32(entry));
|
|
22001
22262
|
}
|
|
22002
22263
|
}
|
|
22003
22264
|
return resolved;
|
|
@@ -22134,7 +22395,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22134
22395
|
const clientPath = islandSvelteClientPaths[idx];
|
|
22135
22396
|
if (!sourcePath || !clientPath)
|
|
22136
22397
|
continue;
|
|
22137
|
-
islandSvelteClientPathMap.set(
|
|
22398
|
+
islandSvelteClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22138
22399
|
}
|
|
22139
22400
|
const islandVueClientPathMap = new Map;
|
|
22140
22401
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -22142,7 +22403,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22142
22403
|
const clientPath = islandVueClientPaths[idx];
|
|
22143
22404
|
if (!sourcePath || !clientPath)
|
|
22144
22405
|
continue;
|
|
22145
|
-
islandVueClientPathMap.set(
|
|
22406
|
+
islandVueClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22146
22407
|
}
|
|
22147
22408
|
const islandAngularClientPathMap = new Map;
|
|
22148
22409
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -22150,7 +22411,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22150
22411
|
const clientPath = islandAngularClientPaths[idx];
|
|
22151
22412
|
if (!sourcePath || !clientPath)
|
|
22152
22413
|
continue;
|
|
22153
|
-
islandAngularClientPathMap.set(
|
|
22414
|
+
islandAngularClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22154
22415
|
}
|
|
22155
22416
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
22156
22417
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -22161,7 +22422,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22161
22422
|
const compileReactConventions = async () => {
|
|
22162
22423
|
if (reactConventionSources.length === 0)
|
|
22163
22424
|
return emptyStringArray;
|
|
22164
|
-
const destDir =
|
|
22425
|
+
const destDir = join43(buildPath, "conventions", "react");
|
|
22165
22426
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22166
22427
|
mkdirSync12(destDir, { recursive: true });
|
|
22167
22428
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -22176,7 +22437,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22176
22437
|
stylePreprocessorPlugin2,
|
|
22177
22438
|
createBunStringRawUnicodePlugin()
|
|
22178
22439
|
],
|
|
22179
|
-
root:
|
|
22440
|
+
root: dirname24(source),
|
|
22180
22441
|
target: "bun",
|
|
22181
22442
|
throw: false,
|
|
22182
22443
|
tsconfig: "./tsconfig.json"
|
|
@@ -22204,7 +22465,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22204
22465
|
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 }
|
|
22205
22466
|
]);
|
|
22206
22467
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
22207
|
-
const destDir =
|
|
22468
|
+
const destDir = join43(buildPath, "conventions", framework);
|
|
22208
22469
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22209
22470
|
mkdirSync12(destDir, { recursive: true });
|
|
22210
22471
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -22265,7 +22526,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22265
22526
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
22266
22527
|
];
|
|
22267
22528
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
22268
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22529
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname24(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file5) => dirname24(file5)), projectRoot);
|
|
22269
22530
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
22270
22531
|
buildInfo: islandBuildInfo,
|
|
22271
22532
|
buildPath,
|
|
@@ -22276,7 +22537,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22276
22537
|
}
|
|
22277
22538
|
})) : {
|
|
22278
22539
|
entries: [],
|
|
22279
|
-
generatedRoot:
|
|
22540
|
+
generatedRoot: join43(buildPath, "_island_entries")
|
|
22280
22541
|
};
|
|
22281
22542
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
22282
22543
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -22312,7 +22573,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22312
22573
|
return {};
|
|
22313
22574
|
}
|
|
22314
22575
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
22315
|
-
const refreshEntry =
|
|
22576
|
+
const refreshEntry = join43(reactIndexesPath, "_refresh.tsx");
|
|
22316
22577
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
22317
22578
|
reactClientEntryPoints.push(refreshEntry);
|
|
22318
22579
|
}
|
|
@@ -22423,19 +22684,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22423
22684
|
throw: false
|
|
22424
22685
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
22425
22686
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
22426
|
-
rmSync2(
|
|
22687
|
+
rmSync2(join43(buildPath, "react", "generated", "indexes"), {
|
|
22427
22688
|
force: true,
|
|
22428
22689
|
recursive: true
|
|
22429
22690
|
});
|
|
22430
22691
|
}
|
|
22431
22692
|
if (angularDir && angularClientPaths.length > 0) {
|
|
22432
|
-
rmSync2(
|
|
22693
|
+
rmSync2(join43(buildPath, "angular", "indexes"), {
|
|
22433
22694
|
force: true,
|
|
22434
22695
|
recursive: true
|
|
22435
22696
|
});
|
|
22436
22697
|
}
|
|
22437
22698
|
if (islandClientEntryPoints.length > 0) {
|
|
22438
|
-
rmSync2(
|
|
22699
|
+
rmSync2(join43(buildPath, "islands"), {
|
|
22439
22700
|
force: true,
|
|
22440
22701
|
recursive: true
|
|
22441
22702
|
});
|
|
@@ -22549,7 +22810,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22549
22810
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22550
22811
|
entrypoints: globalCssEntries,
|
|
22551
22812
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22552
|
-
outdir: stylesDir ?
|
|
22813
|
+
outdir: stylesDir ? join43(buildPath, basename14(stylesDir)) : buildPath,
|
|
22553
22814
|
plugins: [stylePreprocessorPlugin2],
|
|
22554
22815
|
root: stylesDir || clientRoot,
|
|
22555
22816
|
target: "browser",
|
|
@@ -22558,7 +22819,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22558
22819
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22559
22820
|
entrypoints: vueCssPaths,
|
|
22560
22821
|
naming: `[name].[hash].[ext]`,
|
|
22561
|
-
outdir:
|
|
22822
|
+
outdir: join43(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22562
22823
|
target: "browser",
|
|
22563
22824
|
throw: false
|
|
22564
22825
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22582,18 +22843,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22582
22843
|
}
|
|
22583
22844
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22584
22845
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22585
|
-
const sourcemapDir =
|
|
22846
|
+
const sourcemapDir = join43(projectRoot, "sourcemaps");
|
|
22586
22847
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22587
22848
|
const mapFiles = readdirSync5(buildPath, {
|
|
22588
22849
|
encoding: "utf8",
|
|
22589
22850
|
recursive: true
|
|
22590
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22851
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join43(buildPath, entry));
|
|
22591
22852
|
for (const mapPath of mapFiles) {
|
|
22592
22853
|
chainExternalSourcemap2(mapPath);
|
|
22593
|
-
renameSync(mapPath,
|
|
22854
|
+
renameSync(mapPath, join43(sourcemapDir, basename14(mapPath)));
|
|
22594
22855
|
const jsPath = mapPath.slice(0, -4);
|
|
22595
22856
|
try {
|
|
22596
|
-
const javascript =
|
|
22857
|
+
const javascript = readFileSync26(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
22597
22858
|
`);
|
|
22598
22859
|
writeFileSync9(jsPath, javascript);
|
|
22599
22860
|
} catch {}
|
|
@@ -22664,7 +22925,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22664
22925
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22665
22926
|
}
|
|
22666
22927
|
if (!hmr) {
|
|
22667
|
-
const reactVendorDir =
|
|
22928
|
+
const reactVendorDir = join43(buildPath, "react", "vendor");
|
|
22668
22929
|
const vendorChunkPaths = existsSync30(reactVendorDir) ? [
|
|
22669
22930
|
...new Glob8("**/*.js").scanSync({
|
|
22670
22931
|
absolute: true,
|
|
@@ -22681,7 +22942,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22681
22942
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22682
22943
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22683
22944
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22684
|
-
const fileDir =
|
|
22945
|
+
const fileDir = dirname24(artifact.path);
|
|
22685
22946
|
const relativePaths = {};
|
|
22686
22947
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22687
22948
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22809,7 +23070,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22809
23070
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
22810
23071
|
if (!hmrClientBundle)
|
|
22811
23072
|
return;
|
|
22812
|
-
let html =
|
|
23073
|
+
let html = readFileSync26(filePath, "utf-8");
|
|
22813
23074
|
if (html.includes("data-hmr-client"))
|
|
22814
23075
|
return;
|
|
22815
23076
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -22820,7 +23081,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22820
23081
|
const processHtmlPages = async () => {
|
|
22821
23082
|
if (!(htmlDir && htmlPagesPath))
|
|
22822
23083
|
return;
|
|
22823
|
-
const outputHtmlPages = isSingle ?
|
|
23084
|
+
const outputHtmlPages = isSingle ? join43(buildPath, "pages") : join43(buildPath, basename14(htmlDir), "pages");
|
|
22824
23085
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22825
23086
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22826
23087
|
force: true,
|
|
@@ -22836,7 +23097,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22836
23097
|
if (hmr)
|
|
22837
23098
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
22838
23099
|
if (pwaArtifacts) {
|
|
22839
|
-
const source =
|
|
23100
|
+
const source = readFileSync26(htmlFile, "utf8");
|
|
22840
23101
|
writeFileSync9(htmlFile, injectPwaBootstrapHtml(source));
|
|
22841
23102
|
}
|
|
22842
23103
|
const fileName = basename14(htmlFile, ".html");
|
|
@@ -22849,14 +23110,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22849
23110
|
const processHtmxPages = async () => {
|
|
22850
23111
|
if (!(htmxDir && htmxPagesPath))
|
|
22851
23112
|
return;
|
|
22852
|
-
const outputHtmxPages = isSingle ?
|
|
23113
|
+
const outputHtmxPages = isSingle ? join43(buildPath, "pages") : join43(buildPath, basename14(htmxDir), "pages");
|
|
22853
23114
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22854
23115
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22855
23116
|
force: true,
|
|
22856
23117
|
recursive: true
|
|
22857
23118
|
});
|
|
22858
23119
|
if (shouldCopyHtmx) {
|
|
22859
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
23120
|
+
const htmxDestDir = isSingle ? buildPath : join43(buildPath, basename14(htmxDir));
|
|
22860
23121
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22861
23122
|
}
|
|
22862
23123
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22869,7 +23130,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22869
23130
|
if (hmr)
|
|
22870
23131
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
22871
23132
|
if (pwaArtifacts) {
|
|
22872
|
-
const source =
|
|
23133
|
+
const source = readFileSync26(htmxFile, "utf8");
|
|
22873
23134
|
writeFileSync9(htmxFile, injectPwaBootstrapHtml(source));
|
|
22874
23135
|
}
|
|
22875
23136
|
const fileName = basename14(htmxFile, ".html");
|
|
@@ -22932,22 +23193,22 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22932
23193
|
angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
|
|
22933
23194
|
]);
|
|
22934
23195
|
const spaRouteHosts = [
|
|
22935
|
-
...reactSpaHosts.map((
|
|
22936
|
-
...
|
|
23196
|
+
...reactSpaHosts.map((host2) => ({
|
|
23197
|
+
...host2,
|
|
22937
23198
|
framework: "react"
|
|
22938
23199
|
})),
|
|
22939
|
-
...svelteSpaHosts.map((
|
|
22940
|
-
...
|
|
23200
|
+
...svelteSpaHosts.map((host2) => ({
|
|
23201
|
+
...host2,
|
|
22941
23202
|
framework: "svelte"
|
|
22942
23203
|
})),
|
|
22943
|
-
...vueSpaHosts.map((
|
|
22944
|
-
...angularSpaHosts.map((
|
|
22945
|
-
...
|
|
23204
|
+
...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
|
|
23205
|
+
...angularSpaHosts.map((host2) => ({
|
|
23206
|
+
...host2,
|
|
22946
23207
|
framework: "angular"
|
|
22947
23208
|
}))
|
|
22948
23209
|
];
|
|
22949
23210
|
setSpaRouteManifest(spaRouteHosts);
|
|
22950
|
-
writeFileSync9(
|
|
23211
|
+
writeFileSync9(join43(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22951
23212
|
if (isIncremental) {
|
|
22952
23213
|
writeBuildTrace(buildPath);
|
|
22953
23214
|
return {
|
|
@@ -22956,9 +23217,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22956
23217
|
manifest
|
|
22957
23218
|
};
|
|
22958
23219
|
}
|
|
22959
|
-
writeFileSync9(
|
|
23220
|
+
writeFileSync9(join43(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22960
23221
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22961
|
-
writeFileSync9(
|
|
23222
|
+
writeFileSync9(join43(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22962
23223
|
}
|
|
22963
23224
|
writeBuildTrace(buildPath);
|
|
22964
23225
|
if (mode === "production") {
|
|
@@ -23092,7 +23353,7 @@ var init_build = __esm(() => {
|
|
|
23092
23353
|
|
|
23093
23354
|
// src/build/buildEmberVendor.ts
|
|
23094
23355
|
import { mkdirSync as mkdirSync13, existsSync as existsSync31 } from "fs";
|
|
23095
|
-
import { join as
|
|
23356
|
+
import { join as join44 } from "path";
|
|
23096
23357
|
import { rm as rm13 } from "fs/promises";
|
|
23097
23358
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
23098
23359
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -23144,7 +23405,7 @@ export const importSync = (specifier) => {
|
|
|
23144
23405
|
if (standaloneSpecifiers.has(specifier)) {
|
|
23145
23406
|
return { resolveTo: specifier, specifier };
|
|
23146
23407
|
}
|
|
23147
|
-
const emberInternalPath =
|
|
23408
|
+
const emberInternalPath = join44(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
23148
23409
|
if (!existsSync31(emberInternalPath)) {
|
|
23149
23410
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
23150
23411
|
}
|
|
@@ -23176,7 +23437,7 @@ export const importSync = (specifier) => {
|
|
|
23176
23437
|
if (standalonePackages.has(args.path)) {
|
|
23177
23438
|
return;
|
|
23178
23439
|
}
|
|
23179
|
-
const internal =
|
|
23440
|
+
const internal = join44(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
23180
23441
|
if (existsSync31(internal)) {
|
|
23181
23442
|
return { path: internal };
|
|
23182
23443
|
}
|
|
@@ -23184,16 +23445,16 @@ export const importSync = (specifier) => {
|
|
|
23184
23445
|
});
|
|
23185
23446
|
}
|
|
23186
23447
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
23187
|
-
const vendorDir =
|
|
23448
|
+
const vendorDir = join44(buildDir, "ember", "vendor");
|
|
23188
23449
|
mkdirSync13(vendorDir, { recursive: true });
|
|
23189
|
-
const tmpDir =
|
|
23450
|
+
const tmpDir = join44(buildDir, "_ember_vendor_tmp");
|
|
23190
23451
|
mkdirSync13(tmpDir, { recursive: true });
|
|
23191
|
-
const macrosShimPath =
|
|
23452
|
+
const macrosShimPath = join44(tmpDir, "embroider_macros_shim.js");
|
|
23192
23453
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
23193
23454
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
23194
23455
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
23195
23456
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
23196
|
-
const entryPath =
|
|
23457
|
+
const entryPath = join44(tmpDir, `${safeName}.js`);
|
|
23197
23458
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
23198
23459
|
` : generateVendorEntrySource2(resolution);
|
|
23199
23460
|
await Bun.write(entryPath, source);
|
|
@@ -23349,9 +23610,9 @@ __export(exports_dependencyGraph, {
|
|
|
23349
23610
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
23350
23611
|
addFileToGraph: () => addFileToGraph
|
|
23351
23612
|
});
|
|
23352
|
-
import { existsSync as existsSync32, readFileSync as
|
|
23613
|
+
import { existsSync as existsSync32, readFileSync as readFileSync27 } from "fs";
|
|
23353
23614
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23354
|
-
import { resolve as
|
|
23615
|
+
import { resolve as resolve33 } from "path";
|
|
23355
23616
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23356
23617
|
const lower = filePath.toLowerCase();
|
|
23357
23618
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23365,8 +23626,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23365
23626
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23366
23627
|
return null;
|
|
23367
23628
|
}
|
|
23368
|
-
const fromDir =
|
|
23369
|
-
const normalized =
|
|
23629
|
+
const fromDir = resolve33(fromFile, "..");
|
|
23630
|
+
const normalized = resolve33(fromDir, importPath);
|
|
23370
23631
|
const extensions = [
|
|
23371
23632
|
".ts",
|
|
23372
23633
|
".tsx",
|
|
@@ -23396,7 +23657,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23396
23657
|
dependents.delete(normalizedPath);
|
|
23397
23658
|
}
|
|
23398
23659
|
}, addFileToGraph = (graph, filePath) => {
|
|
23399
|
-
const normalizedPath =
|
|
23660
|
+
const normalizedPath = resolve33(filePath);
|
|
23400
23661
|
if (!existsSync32(normalizedPath))
|
|
23401
23662
|
return;
|
|
23402
23663
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -23423,10 +23684,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23423
23684
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23424
23685
|
const processedFiles = new Set;
|
|
23425
23686
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23426
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23687
|
+
const resolvedDirs = directories.map((dir) => resolve33(dir)).filter((dir) => existsSync32(dir));
|
|
23427
23688
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23428
23689
|
for (const file5 of allFiles) {
|
|
23429
|
-
const fullPath =
|
|
23690
|
+
const fullPath = resolve33(file5);
|
|
23430
23691
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23431
23692
|
continue;
|
|
23432
23693
|
if (processedFiles.has(fullPath))
|
|
@@ -23520,15 +23781,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23520
23781
|
const lowerPath = filePath.toLowerCase();
|
|
23521
23782
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
23522
23783
|
if (loader === "html") {
|
|
23523
|
-
const content =
|
|
23784
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23524
23785
|
return extractHtmlDependencies(filePath, content);
|
|
23525
23786
|
}
|
|
23526
23787
|
if (loader === "tsx" || loader === "js") {
|
|
23527
|
-
const content =
|
|
23788
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23528
23789
|
return extractJsDependencies(filePath, content, loader);
|
|
23529
23790
|
}
|
|
23530
23791
|
if (isSvelteOrVue) {
|
|
23531
|
-
const content =
|
|
23792
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23532
23793
|
return extractSvelteVueDependencies(filePath, content);
|
|
23533
23794
|
}
|
|
23534
23795
|
return [];
|
|
@@ -23539,7 +23800,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23539
23800
|
return [];
|
|
23540
23801
|
}
|
|
23541
23802
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23542
|
-
const normalizedPath =
|
|
23803
|
+
const normalizedPath = resolve33(changedFile);
|
|
23543
23804
|
const affected = new Set;
|
|
23544
23805
|
const toProcess = [normalizedPath];
|
|
23545
23806
|
const processNode = (current) => {
|
|
@@ -23570,7 +23831,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23570
23831
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23571
23832
|
graph.dependents.delete(normalizedPath);
|
|
23572
23833
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23573
|
-
const normalizedPath =
|
|
23834
|
+
const normalizedPath = resolve33(filePath);
|
|
23574
23835
|
removeDepsForFile(graph, normalizedPath);
|
|
23575
23836
|
removeDependentsForFile(graph, normalizedPath);
|
|
23576
23837
|
};
|
|
@@ -23613,12 +23874,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23613
23874
|
};
|
|
23614
23875
|
|
|
23615
23876
|
// src/dev/configResolver.ts
|
|
23616
|
-
import { resolve as
|
|
23877
|
+
import { resolve as resolve34 } from "path";
|
|
23617
23878
|
var resolveBuildPaths = (config) => {
|
|
23618
23879
|
const cwd2 = process.cwd();
|
|
23619
23880
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23620
|
-
const withDefault = (value, fallback) => normalize(
|
|
23621
|
-
const optional = (value) => value ? normalize(
|
|
23881
|
+
const withDefault = (value, fallback) => normalize(resolve34(cwd2, value ?? fallback));
|
|
23882
|
+
const optional = (value) => value ? normalize(resolve34(cwd2, value)) : undefined;
|
|
23622
23883
|
return {
|
|
23623
23884
|
angularDir: optional(config.angularDirectory),
|
|
23624
23885
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23676,8 +23937,8 @@ var init_clientManager = __esm(() => {
|
|
|
23676
23937
|
});
|
|
23677
23938
|
|
|
23678
23939
|
// src/dev/pathUtils.ts
|
|
23679
|
-
import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as
|
|
23680
|
-
import { dirname as
|
|
23940
|
+
import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as readFileSync28 } from "fs";
|
|
23941
|
+
import { dirname as dirname25, resolve as resolve35 } from "path";
|
|
23681
23942
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23682
23943
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23683
23944
|
return "ignored";
|
|
@@ -23753,7 +24014,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23753
24014
|
return "unknown";
|
|
23754
24015
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23755
24016
|
const out = new Set;
|
|
23756
|
-
const angularRoot =
|
|
24017
|
+
const angularRoot = resolve35(angularDir);
|
|
23757
24018
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
23758
24019
|
const walk = (dir) => {
|
|
23759
24020
|
let entries;
|
|
@@ -23766,7 +24027,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23766
24027
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23767
24028
|
continue;
|
|
23768
24029
|
}
|
|
23769
|
-
const full =
|
|
24030
|
+
const full = resolve35(dir, entry.name);
|
|
23770
24031
|
if (entry.isDirectory()) {
|
|
23771
24032
|
walk(full);
|
|
23772
24033
|
continue;
|
|
@@ -23776,7 +24037,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23776
24037
|
}
|
|
23777
24038
|
let source;
|
|
23778
24039
|
try {
|
|
23779
|
-
source =
|
|
24040
|
+
source = readFileSync28(full, "utf8");
|
|
23780
24041
|
} catch {
|
|
23781
24042
|
continue;
|
|
23782
24043
|
}
|
|
@@ -23805,10 +24066,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23805
24066
|
refs.push(strMatch[1]);
|
|
23806
24067
|
}
|
|
23807
24068
|
}
|
|
23808
|
-
const componentDir =
|
|
24069
|
+
const componentDir = dirname25(full);
|
|
23809
24070
|
for (const ref of refs) {
|
|
23810
|
-
const refAbs = normalizePath2(
|
|
23811
|
-
const refDir = normalizePath2(
|
|
24071
|
+
const refAbs = normalizePath2(resolve35(componentDir, ref));
|
|
24072
|
+
const refDir = normalizePath2(dirname25(refAbs));
|
|
23812
24073
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23813
24074
|
continue;
|
|
23814
24075
|
}
|
|
@@ -23824,7 +24085,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23824
24085
|
const push = (path) => {
|
|
23825
24086
|
if (!path)
|
|
23826
24087
|
return;
|
|
23827
|
-
const abs = normalizePath2(
|
|
24088
|
+
const abs = normalizePath2(resolve35(cwd2, path));
|
|
23828
24089
|
if (!roots.includes(abs))
|
|
23829
24090
|
roots.push(abs);
|
|
23830
24091
|
};
|
|
@@ -23849,7 +24110,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23849
24110
|
push(cfg.assetsDir);
|
|
23850
24111
|
push(cfg.stylesDir);
|
|
23851
24112
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23852
|
-
const abs = normalizePath2(
|
|
24113
|
+
const abs = normalizePath2(resolve35(cwd2, candidate));
|
|
23853
24114
|
if (existsSync33(abs) && !roots.includes(abs))
|
|
23854
24115
|
roots.push(abs);
|
|
23855
24116
|
}
|
|
@@ -23860,7 +24121,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23860
24121
|
continue;
|
|
23861
24122
|
if (entry.name.startsWith("."))
|
|
23862
24123
|
continue;
|
|
23863
|
-
const abs = normalizePath2(
|
|
24124
|
+
const abs = normalizePath2(resolve35(cwd2, entry.name));
|
|
23864
24125
|
if (roots.includes(abs))
|
|
23865
24126
|
continue;
|
|
23866
24127
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23944,7 +24205,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23944
24205
|
// src/dev/fileWatcher.ts
|
|
23945
24206
|
import { watch } from "fs";
|
|
23946
24207
|
import { existsSync as existsSync34, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23947
|
-
import { dirname as
|
|
24208
|
+
import { dirname as dirname26, join as join45, resolve as resolve36 } from "path";
|
|
23948
24209
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23949
24210
|
try {
|
|
23950
24211
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23976,7 +24237,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23976
24237
|
for (const name of entries) {
|
|
23977
24238
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23978
24239
|
continue;
|
|
23979
|
-
const child =
|
|
24240
|
+
const child = join45(eventDir, name).replace(/\\/g, "/");
|
|
23980
24241
|
let st2;
|
|
23981
24242
|
try {
|
|
23982
24243
|
st2 = statSync4(child);
|
|
@@ -23997,7 +24258,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23997
24258
|
return;
|
|
23998
24259
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23999
24260
|
if (event === "rename") {
|
|
24000
|
-
const eventDir =
|
|
24261
|
+
const eventDir = dirname26(join45(absolutePath, filename)).replace(/\\/g, "/");
|
|
24001
24262
|
atomicRecoveryScan(eventDir);
|
|
24002
24263
|
for (const delay of [25, 100]) {
|
|
24003
24264
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -24006,7 +24267,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24006
24267
|
}
|
|
24007
24268
|
return;
|
|
24008
24269
|
}
|
|
24009
|
-
const fullPath =
|
|
24270
|
+
const fullPath = join45(absolutePath, filename).replace(/\\/g, "/");
|
|
24010
24271
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
24011
24272
|
return;
|
|
24012
24273
|
}
|
|
@@ -24024,7 +24285,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24024
24285
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
24025
24286
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24026
24287
|
paths.forEach((path) => {
|
|
24027
|
-
const absolutePath =
|
|
24288
|
+
const absolutePath = resolve36(path).replace(/\\/g, "/");
|
|
24028
24289
|
if (!existsSync34(absolutePath)) {
|
|
24029
24290
|
return;
|
|
24030
24291
|
}
|
|
@@ -24035,7 +24296,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24035
24296
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
24036
24297
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24037
24298
|
watchPaths.forEach((path) => {
|
|
24038
|
-
const absolutePath =
|
|
24299
|
+
const absolutePath = resolve36(path).replace(/\\/g, "/");
|
|
24039
24300
|
if (!existsSync34(absolutePath)) {
|
|
24040
24301
|
return;
|
|
24041
24302
|
}
|
|
@@ -24054,13 +24315,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
24054
24315
|
});
|
|
24055
24316
|
|
|
24056
24317
|
// src/dev/assetStore.ts
|
|
24057
|
-
import { resolve as
|
|
24318
|
+
import { resolve as resolve37 } from "path";
|
|
24058
24319
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
24059
24320
|
var mimeTypes, getMimeType = (filePath) => {
|
|
24060
24321
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
24061
24322
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
24062
24323
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
24063
|
-
const fullPath =
|
|
24324
|
+
const fullPath = resolve37(dir, entry.name);
|
|
24064
24325
|
if (entry.isDirectory()) {
|
|
24065
24326
|
return walkAndClean(fullPath);
|
|
24066
24327
|
}
|
|
@@ -24076,10 +24337,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24076
24337
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
24077
24338
|
const liveByIdentity = new Map;
|
|
24078
24339
|
for (const webPath of store.keys()) {
|
|
24079
|
-
const diskPath =
|
|
24340
|
+
const diskPath = resolve37(buildDir, webPath.slice(1));
|
|
24080
24341
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
24081
24342
|
}
|
|
24082
|
-
const absBuildDir =
|
|
24343
|
+
const absBuildDir = resolve37(buildDir);
|
|
24083
24344
|
Object.values(manifest).forEach((val) => {
|
|
24084
24345
|
if (!HASHED_FILE_RE.test(val))
|
|
24085
24346
|
return;
|
|
@@ -24097,7 +24358,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24097
24358
|
} catch {}
|
|
24098
24359
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
24099
24360
|
if (entry.isDirectory()) {
|
|
24100
|
-
return scanDir(
|
|
24361
|
+
return scanDir(resolve37(dir, entry.name), `${prefix}${entry.name}/`);
|
|
24101
24362
|
}
|
|
24102
24363
|
if (!entry.name.startsWith("chunk-")) {
|
|
24103
24364
|
return null;
|
|
@@ -24106,7 +24367,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24106
24367
|
if (store.has(webPath)) {
|
|
24107
24368
|
return null;
|
|
24108
24369
|
}
|
|
24109
|
-
return Bun.file(
|
|
24370
|
+
return Bun.file(resolve37(dir, entry.name)).bytes().then((bytes) => {
|
|
24110
24371
|
store.set(webPath, bytes);
|
|
24111
24372
|
return;
|
|
24112
24373
|
}).catch(() => {});
|
|
@@ -24128,7 +24389,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24128
24389
|
for (const webPath of newIdentities.values()) {
|
|
24129
24390
|
if (store.has(webPath))
|
|
24130
24391
|
continue;
|
|
24131
|
-
loadPromises.push(Bun.file(
|
|
24392
|
+
loadPromises.push(Bun.file(resolve37(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
24132
24393
|
store.set(webPath, bytes);
|
|
24133
24394
|
return;
|
|
24134
24395
|
}).catch(() => {}));
|
|
@@ -24173,10 +24434,10 @@ var init_assetStore = __esm(() => {
|
|
|
24173
24434
|
});
|
|
24174
24435
|
|
|
24175
24436
|
// src/dev/fileHashTracker.ts
|
|
24176
|
-
import { readFileSync as
|
|
24437
|
+
import { readFileSync as readFileSync29 } from "fs";
|
|
24177
24438
|
var computeFileHash = (filePath) => {
|
|
24178
24439
|
try {
|
|
24179
|
-
const fileContent =
|
|
24440
|
+
const fileContent = readFileSync29(filePath);
|
|
24180
24441
|
return Number(Bun.hash(fileContent));
|
|
24181
24442
|
} catch {
|
|
24182
24443
|
return UNFOUND_INDEX;
|
|
@@ -24212,9 +24473,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
|
|
|
24212
24473
|
set.add(filePath);
|
|
24213
24474
|
}
|
|
24214
24475
|
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
24215
|
-
const
|
|
24216
|
-
if (
|
|
24217
|
-
return
|
|
24476
|
+
const component2 = [...parents].find(isComponentFile);
|
|
24477
|
+
if (component2 !== undefined)
|
|
24478
|
+
return component2;
|
|
24218
24479
|
for (const parent of parents)
|
|
24219
24480
|
queue.push(parent);
|
|
24220
24481
|
return;
|
|
@@ -24269,9 +24530,9 @@ var init_transformCache = __esm(() => {
|
|
|
24269
24530
|
});
|
|
24270
24531
|
|
|
24271
24532
|
// src/dev/reactComponentClassifier.ts
|
|
24272
|
-
import { resolve as
|
|
24533
|
+
import { resolve as resolve38 } from "path";
|
|
24273
24534
|
var classifyComponent = (filePath) => {
|
|
24274
|
-
const normalizedPath =
|
|
24535
|
+
const normalizedPath = resolve38(filePath);
|
|
24275
24536
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24276
24537
|
return "server";
|
|
24277
24538
|
}
|
|
@@ -24283,7 +24544,7 @@ var classifyComponent = (filePath) => {
|
|
|
24283
24544
|
var init_reactComponentClassifier = () => {};
|
|
24284
24545
|
|
|
24285
24546
|
// src/dev/moduleMapper.ts
|
|
24286
|
-
import { basename as basename15, resolve as
|
|
24547
|
+
import { basename as basename15, resolve as resolve39 } from "path";
|
|
24287
24548
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24288
24549
|
const modulePaths = {};
|
|
24289
24550
|
moduleKeys.forEach((key) => {
|
|
@@ -24293,7 +24554,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24293
24554
|
});
|
|
24294
24555
|
return modulePaths;
|
|
24295
24556
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24296
|
-
const normalizedFile =
|
|
24557
|
+
const normalizedFile = resolve39(sourceFile);
|
|
24297
24558
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24298
24559
|
if (processedFiles.has(normalizedFile)) {
|
|
24299
24560
|
return null;
|
|
@@ -24329,7 +24590,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24329
24590
|
});
|
|
24330
24591
|
return grouped;
|
|
24331
24592
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24332
|
-
const normalizedFile =
|
|
24593
|
+
const normalizedFile = resolve39(sourceFile);
|
|
24333
24594
|
const fileName = basename15(normalizedFile);
|
|
24334
24595
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24335
24596
|
const pascalName = toPascal(baseName);
|
|
@@ -24385,7 +24646,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
24385
24646
|
|
|
24386
24647
|
// src/utils/spaRouteCss.ts
|
|
24387
24648
|
import { readFile as readFile9 } from "fs/promises";
|
|
24388
|
-
import { dirname as
|
|
24649
|
+
import { dirname as dirname27, isAbsolute as isAbsolute5, resolve as resolve40 } from "path";
|
|
24389
24650
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
24390
24651
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
24391
24652
|
if (cached !== undefined)
|
|
@@ -24423,7 +24684,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24423
24684
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24424
24685
|
if (!cssPath)
|
|
24425
24686
|
return "";
|
|
24426
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24687
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve40(dirname27(sideManifestPath), cssPath);
|
|
24427
24688
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24428
24689
|
if (cached !== undefined)
|
|
24429
24690
|
return cached;
|
|
@@ -24506,8 +24767,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
24506
24767
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
24507
24768
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24508
24769
|
});
|
|
24509
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
24510
|
-
import { dirname as
|
|
24770
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync30, statSync as statSync5 } from "fs";
|
|
24771
|
+
import { dirname as dirname28, extname as extname11, join as join46, resolve as resolve41 } from "path";
|
|
24511
24772
|
import ts18 from "typescript";
|
|
24512
24773
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24513
24774
|
const out = [];
|
|
@@ -24522,7 +24783,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24522
24783
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24523
24784
|
continue;
|
|
24524
24785
|
}
|
|
24525
|
-
const full =
|
|
24786
|
+
const full = join46(dir, entry.name);
|
|
24526
24787
|
if (entry.isDirectory()) {
|
|
24527
24788
|
visit(full);
|
|
24528
24789
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24566,7 +24827,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24566
24827
|
}, parseDecoratedClasses = (filePath) => {
|
|
24567
24828
|
let source;
|
|
24568
24829
|
try {
|
|
24569
|
-
source =
|
|
24830
|
+
source = readFileSync30(filePath, "utf8");
|
|
24570
24831
|
} catch {
|
|
24571
24832
|
return [];
|
|
24572
24833
|
}
|
|
@@ -24620,7 +24881,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24620
24881
|
};
|
|
24621
24882
|
visit(sourceFile);
|
|
24622
24883
|
return out;
|
|
24623
|
-
}, safeNormalize = (path) =>
|
|
24884
|
+
}, safeNormalize = (path) => resolve41(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24624
24885
|
const { changedFilePath, userAngularRoot } = params;
|
|
24625
24886
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24626
24887
|
const out = [];
|
|
@@ -24656,12 +24917,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24656
24917
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
24657
24918
|
let source;
|
|
24658
24919
|
try {
|
|
24659
|
-
source =
|
|
24920
|
+
source = readFileSync30(childFilePath, "utf8");
|
|
24660
24921
|
} catch {
|
|
24661
24922
|
return null;
|
|
24662
24923
|
}
|
|
24663
24924
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24664
|
-
const childDir =
|
|
24925
|
+
const childDir = dirname28(childFilePath);
|
|
24665
24926
|
for (const stmt of sourceFile.statements) {
|
|
24666
24927
|
if (!ts18.isImportDeclaration(stmt))
|
|
24667
24928
|
continue;
|
|
@@ -24689,7 +24950,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24689
24950
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24690
24951
|
return null;
|
|
24691
24952
|
}
|
|
24692
|
-
const base =
|
|
24953
|
+
const base = resolve41(childDir, spec);
|
|
24693
24954
|
const candidates = [
|
|
24694
24955
|
`${base}.ts`,
|
|
24695
24956
|
`${base}.tsx`,
|
|
@@ -24718,7 +24979,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24718
24979
|
const parentFile = new Map;
|
|
24719
24980
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24720
24981
|
const classes = parseDecoratedClasses(tsPath);
|
|
24721
|
-
const componentDir =
|
|
24982
|
+
const componentDir = dirname28(tsPath);
|
|
24722
24983
|
for (const cls of classes) {
|
|
24723
24984
|
const entity = {
|
|
24724
24985
|
className: cls.className,
|
|
@@ -24727,7 +24988,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24727
24988
|
};
|
|
24728
24989
|
if (cls.kind === "component") {
|
|
24729
24990
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24730
|
-
const abs = safeNormalize(
|
|
24991
|
+
const abs = safeNormalize(resolve41(componentDir, url));
|
|
24731
24992
|
const existing = resource.get(abs);
|
|
24732
24993
|
if (existing)
|
|
24733
24994
|
existing.push(entity);
|
|
@@ -24969,8 +25230,8 @@ __export(exports_moduleServer, {
|
|
|
24969
25230
|
createModuleServer: () => createModuleServer,
|
|
24970
25231
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24971
25232
|
});
|
|
24972
|
-
import { existsSync as existsSync35, readFileSync as
|
|
24973
|
-
import { basename as basename16, dirname as
|
|
25233
|
+
import { existsSync as existsSync35, readFileSync as readFileSync31, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25234
|
+
import { basename as basename16, dirname as dirname29, extname as extname12, join as join47, resolve as resolve42, relative as relative16 } from "path";
|
|
24974
25235
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24975
25236
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24976
25237
|
const allExports = [];
|
|
@@ -24990,10 +25251,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24990
25251
|
${stubs}
|
|
24991
25252
|
`;
|
|
24992
25253
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24993
|
-
const directHit = extensions.find((ext) => existsSync35(
|
|
25254
|
+
const directHit = extensions.find((ext) => existsSync35(resolve42(projectRoot, srcPath + ext)));
|
|
24994
25255
|
if (directHit)
|
|
24995
25256
|
return srcPath + directHit;
|
|
24996
|
-
const indexHit = extensions.find((ext) => existsSync35(
|
|
25257
|
+
const indexHit = extensions.find((ext) => existsSync35(resolve42(projectRoot, srcPath, `index${ext}`)));
|
|
24997
25258
|
if (indexHit)
|
|
24998
25259
|
return `${srcPath}/index${indexHit}`;
|
|
24999
25260
|
return srcPath;
|
|
@@ -25016,7 +25277,7 @@ ${stubs}
|
|
|
25016
25277
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
25017
25278
|
}, srcUrl = (relPath, projectRoot) => {
|
|
25018
25279
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
25019
|
-
const absPath =
|
|
25280
|
+
const absPath = resolve42(projectRoot, relPath);
|
|
25020
25281
|
const cached = mtimeCache.get(absPath);
|
|
25021
25282
|
if (cached !== undefined)
|
|
25022
25283
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -25028,12 +25289,12 @@ ${stubs}
|
|
|
25028
25289
|
return base;
|
|
25029
25290
|
}
|
|
25030
25291
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
25031
|
-
const absPath =
|
|
25292
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25032
25293
|
const rel = relative16(projectRoot, absPath);
|
|
25033
25294
|
const extension = extname12(rel);
|
|
25034
25295
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
25035
25296
|
if (extname12(srcPath) === ".svelte") {
|
|
25036
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
25297
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve42(projectRoot, srcPath)));
|
|
25037
25298
|
}
|
|
25038
25299
|
return srcUrl(srcPath, projectRoot);
|
|
25039
25300
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -25052,13 +25313,13 @@ ${stubs}
|
|
|
25052
25313
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
25053
25314
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
25054
25315
|
if (!subpath) {
|
|
25055
|
-
const pkgDir =
|
|
25056
|
-
const pkgJsonPath =
|
|
25316
|
+
const pkgDir = resolve42(projectRoot, "node_modules", packageName ?? "");
|
|
25317
|
+
const pkgJsonPath = join47(pkgDir, "package.json");
|
|
25057
25318
|
if (existsSync35(pkgJsonPath)) {
|
|
25058
|
-
const pkg = JSON.parse(
|
|
25319
|
+
const pkg = JSON.parse(readFileSync31(pkgJsonPath, "utf-8"));
|
|
25059
25320
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25060
25321
|
if (esmEntry) {
|
|
25061
|
-
const resolved =
|
|
25322
|
+
const resolved = resolve42(pkgDir, esmEntry);
|
|
25062
25323
|
if (existsSync35(resolved))
|
|
25063
25324
|
return relative16(projectRoot, resolved);
|
|
25064
25325
|
}
|
|
@@ -25096,7 +25357,7 @@ ${stubs}
|
|
|
25096
25357
|
};
|
|
25097
25358
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
25098
25359
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
25099
|
-
const fileDir =
|
|
25360
|
+
const fileDir = dirname29(filePath);
|
|
25100
25361
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25101
25362
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25102
25363
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -25111,12 +25372,12 @@ ${stubs}
|
|
|
25111
25372
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
25112
25373
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
25113
25374
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
25114
|
-
const absPath =
|
|
25375
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25115
25376
|
const rel = relative16(projectRoot, absPath);
|
|
25116
25377
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
25117
25378
|
});
|
|
25118
25379
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
25119
|
-
const absPath =
|
|
25380
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25120
25381
|
const rel = relative16(projectRoot, absPath);
|
|
25121
25382
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
25122
25383
|
});
|
|
@@ -25162,7 +25423,7 @@ ${code}`;
|
|
|
25162
25423
|
reactFastRefreshWarningEmitted = true;
|
|
25163
25424
|
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.");
|
|
25164
25425
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
25165
|
-
const raw =
|
|
25426
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25166
25427
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
25167
25428
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
25168
25429
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -25178,7 +25439,7 @@ ${transpiled}`;
|
|
|
25178
25439
|
transpiled += buildIslandMetadataExports(raw);
|
|
25179
25440
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
25180
25441
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
25181
|
-
const raw =
|
|
25442
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25182
25443
|
const ext = extname12(filePath);
|
|
25183
25444
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
25184
25445
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -25344,7 +25605,7 @@ ${code}`;
|
|
|
25344
25605
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
25345
25606
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
25346
25607
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
25347
|
-
const raw =
|
|
25608
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25348
25609
|
if (!svelteCompiler) {
|
|
25349
25610
|
svelteCompiler = await import("svelte/compiler");
|
|
25350
25611
|
}
|
|
@@ -25410,7 +25671,7 @@ export default __script__;`;
|
|
|
25410
25671
|
return `${cssInjection}
|
|
25411
25672
|
${code}`;
|
|
25412
25673
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
25413
|
-
const rawSource =
|
|
25674
|
+
const rawSource = readFileSync31(filePath, "utf-8");
|
|
25414
25675
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
25415
25676
|
if (!vueCompiler) {
|
|
25416
25677
|
vueCompiler = await loadVueCompiler();
|
|
@@ -25423,7 +25684,7 @@ ${code}`;
|
|
|
25423
25684
|
fs: {
|
|
25424
25685
|
fileExists: existsSync35,
|
|
25425
25686
|
realpath: realpathSync3,
|
|
25426
|
-
readFile: (file5) => existsSync35(file5) ?
|
|
25687
|
+
readFile: (file5) => existsSync35(file5) ? readFileSync31(file5, "utf-8") : undefined
|
|
25427
25688
|
},
|
|
25428
25689
|
id: componentId,
|
|
25429
25690
|
inlineTemplate: false
|
|
@@ -25438,7 +25699,7 @@ ${code}`;
|
|
|
25438
25699
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25439
25700
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25440
25701
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25441
|
-
const hmrBase = vueDir ?
|
|
25702
|
+
const hmrBase = vueDir ? resolve42(vueDir) : projectRoot;
|
|
25442
25703
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25443
25704
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25444
25705
|
result += [
|
|
@@ -25470,7 +25731,7 @@ ${code}`;
|
|
|
25470
25731
|
}
|
|
25471
25732
|
});
|
|
25472
25733
|
}, handleCssRequest = (filePath) => {
|
|
25473
|
-
const raw =
|
|
25734
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25474
25735
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25475
25736
|
return [
|
|
25476
25737
|
`const style = document.createElement('style');`,
|
|
@@ -25602,7 +25863,7 @@ export default {};
|
|
|
25602
25863
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25603
25864
|
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);`);
|
|
25604
25865
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25605
|
-
const filePath =
|
|
25866
|
+
const filePath = resolve42(projectRoot, relPath);
|
|
25606
25867
|
const ext = extname12(filePath);
|
|
25607
25868
|
if (ext === ".svelte")
|
|
25608
25869
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25639,14 +25900,14 @@ export default {};
|
|
|
25639
25900
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25640
25901
|
const candidates = [
|
|
25641
25902
|
absoluteCandidate,
|
|
25642
|
-
|
|
25903
|
+
resolve42(projectRoot, tail)
|
|
25643
25904
|
];
|
|
25644
25905
|
try {
|
|
25645
25906
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25646
25907
|
const cfg = await loadConfig2();
|
|
25647
|
-
const angularDir = cfg.angularDirectory &&
|
|
25908
|
+
const angularDir = cfg.angularDirectory && resolve42(projectRoot, cfg.angularDirectory);
|
|
25648
25909
|
if (angularDir)
|
|
25649
|
-
candidates.push(
|
|
25910
|
+
candidates.push(resolve42(angularDir, tail));
|
|
25650
25911
|
} catch {}
|
|
25651
25912
|
for (const candidate of candidates) {
|
|
25652
25913
|
if (await fileExists(candidate)) {
|
|
@@ -25677,7 +25938,7 @@ export default {};
|
|
|
25677
25938
|
if (!TRANSPILABLE.has(ext))
|
|
25678
25939
|
return;
|
|
25679
25940
|
const stat3 = statSync6(filePath);
|
|
25680
|
-
const resolvedVueDir = vueDir ?
|
|
25941
|
+
const resolvedVueDir = vueDir ? resolve42(vueDir) : undefined;
|
|
25681
25942
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25682
25943
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25683
25944
|
if (isAngularGeneratedJs) {
|
|
@@ -25736,7 +25997,7 @@ export default {};
|
|
|
25736
25997
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25737
25998
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25738
25999
|
return handleBunWrapRequest();
|
|
25739
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
26000
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve42(projectRoot, relPath));
|
|
25740
26001
|
if (virtualCssResponse)
|
|
25741
26002
|
return virtualCssResponse;
|
|
25742
26003
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25752,11 +26013,11 @@ export default {};
|
|
|
25752
26013
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25753
26014
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25754
26015
|
if (match[1])
|
|
25755
|
-
files.push(
|
|
26016
|
+
files.push(resolve42(projectRoot, match[1]));
|
|
25756
26017
|
}
|
|
25757
26018
|
return files;
|
|
25758
26019
|
}, invalidateModule = (filePath) => {
|
|
25759
|
-
const resolved =
|
|
26020
|
+
const resolved = resolve42(filePath);
|
|
25760
26021
|
invalidate(filePath);
|
|
25761
26022
|
if (resolved !== filePath)
|
|
25762
26023
|
invalidate(resolved);
|
|
@@ -25919,7 +26180,7 @@ __export(exports_hmrCompiler, {
|
|
|
25919
26180
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25920
26181
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25921
26182
|
});
|
|
25922
|
-
import { dirname as
|
|
26183
|
+
import { dirname as dirname30, relative as relative17, resolve as resolve43 } from "path";
|
|
25923
26184
|
import { performance as performance2 } from "perf_hooks";
|
|
25924
26185
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25925
26186
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25931,7 +26192,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25931
26192
|
return null;
|
|
25932
26193
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25933
26194
|
const className = decoded.slice(separatorIndex + 1);
|
|
25934
|
-
const componentFilePath =
|
|
26195
|
+
const componentFilePath = resolve43(process.cwd(), filePathRel);
|
|
25935
26196
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25936
26197
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25937
26198
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25942,7 +26203,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25942
26203
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25943
26204
|
const owners = resolveOwningComponents2({
|
|
25944
26205
|
changedFilePath: componentFilePath,
|
|
25945
|
-
userAngularRoot:
|
|
26206
|
+
userAngularRoot: dirname30(componentFilePath)
|
|
25946
26207
|
});
|
|
25947
26208
|
const owner = owners.find((o3) => o3.className === className);
|
|
25948
26209
|
const kind = owner?.kind ?? "component";
|
|
@@ -26100,11 +26361,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
26100
26361
|
__export(exports_simpleHTMLHMR, {
|
|
26101
26362
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
26102
26363
|
});
|
|
26103
|
-
import { resolve as
|
|
26364
|
+
import { resolve as resolve44 } from "path";
|
|
26104
26365
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
26105
26366
|
let htmlContent;
|
|
26106
26367
|
try {
|
|
26107
|
-
const resolvedPath =
|
|
26368
|
+
const resolvedPath = resolve44(htmlFilePath);
|
|
26108
26369
|
const file5 = Bun.file(resolvedPath);
|
|
26109
26370
|
if (!await file5.exists()) {
|
|
26110
26371
|
return null;
|
|
@@ -26130,11 +26391,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
26130
26391
|
__export(exports_simpleHTMXHMR, {
|
|
26131
26392
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
26132
26393
|
});
|
|
26133
|
-
import { resolve as
|
|
26394
|
+
import { resolve as resolve45 } from "path";
|
|
26134
26395
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
26135
26396
|
let htmlContent;
|
|
26136
26397
|
try {
|
|
26137
|
-
const resolvedPath =
|
|
26398
|
+
const resolvedPath = resolve45(htmxFilePath);
|
|
26138
26399
|
const file5 = Bun.file(resolvedPath);
|
|
26139
26400
|
if (!await file5.exists()) {
|
|
26140
26401
|
return null;
|
|
@@ -26159,9 +26420,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
26159
26420
|
import { existsSync as existsSync36, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
26160
26421
|
import {
|
|
26161
26422
|
basename as basename17,
|
|
26162
|
-
dirname as
|
|
26423
|
+
dirname as dirname31,
|
|
26163
26424
|
isAbsolute as isAbsolute6,
|
|
26164
|
-
join as
|
|
26425
|
+
join as join48,
|
|
26165
26426
|
relative as relative18,
|
|
26166
26427
|
resolve as resolvePath3,
|
|
26167
26428
|
sep as sep4
|
|
@@ -26288,8 +26549,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26288
26549
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26289
26550
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26290
26551
|
for (const candidate of [
|
|
26291
|
-
|
|
26292
|
-
`${
|
|
26552
|
+
join48(generatedDir, relJs),
|
|
26553
|
+
`${join48(generatedDir, relJs)}.map`
|
|
26293
26554
|
]) {
|
|
26294
26555
|
try {
|
|
26295
26556
|
rmSync3(candidate, { force: true });
|
|
@@ -26524,7 +26785,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26524
26785
|
const { buildDir } = state.resolvedPaths;
|
|
26525
26786
|
const destPath = resolvePath3(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26526
26787
|
const { mkdir: mkdir12, copyFile, readFile: readFile10 } = await import("fs/promises");
|
|
26527
|
-
await mkdir12(
|
|
26788
|
+
await mkdir12(dirname31(destPath), { recursive: true });
|
|
26528
26789
|
await copyFile(absSource, destPath);
|
|
26529
26790
|
const bytes = await readFile10(destPath);
|
|
26530
26791
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26705,7 +26966,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26705
26966
|
const keepStemsByDir = new Map;
|
|
26706
26967
|
const prefixByDir = new Map;
|
|
26707
26968
|
for (const artifact of freshOutputs) {
|
|
26708
|
-
const dir =
|
|
26969
|
+
const dir = dirname31(artifact.path);
|
|
26709
26970
|
const name = basename17(artifact.path);
|
|
26710
26971
|
const [prefix] = name.split(".");
|
|
26711
26972
|
if (!prefix)
|
|
@@ -27068,8 +27329,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27068
27329
|
};
|
|
27069
27330
|
return ({ immediate = false } = {}) => {
|
|
27070
27331
|
if (!ctx.debouncedPromise) {
|
|
27071
|
-
ctx.debouncedPromise = new Promise((
|
|
27072
|
-
ctx.debouncedResolve =
|
|
27332
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
27333
|
+
ctx.debouncedResolve = resolve46;
|
|
27073
27334
|
});
|
|
27074
27335
|
}
|
|
27075
27336
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -27191,7 +27452,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27191
27452
|
const entries = await readdir6(dir, { withFileTypes: true });
|
|
27192
27453
|
const files = [];
|
|
27193
27454
|
for (const entry of entries) {
|
|
27194
|
-
const full =
|
|
27455
|
+
const full = join48(dir, entry.name);
|
|
27195
27456
|
if (entry.isDirectory()) {
|
|
27196
27457
|
files.push(...await walk(full));
|
|
27197
27458
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27601,8 +27862,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27601
27862
|
};
|
|
27602
27863
|
return () => {
|
|
27603
27864
|
if (!ctx.debouncedPromise) {
|
|
27604
|
-
ctx.debouncedPromise = new Promise((
|
|
27605
|
-
ctx.debouncedResolve =
|
|
27865
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
27866
|
+
ctx.debouncedResolve = resolve46;
|
|
27606
27867
|
});
|
|
27607
27868
|
}
|
|
27608
27869
|
if (ctx.debounceTimer)
|
|
@@ -27751,7 +28012,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27751
28012
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27752
28013
|
const serverEntries = [...vueServerPaths];
|
|
27753
28014
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27754
|
-
const cssOutDir =
|
|
28015
|
+
const cssOutDir = join48(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27755
28016
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27756
28017
|
const serverExternals = await getServerBundleExternals();
|
|
27757
28018
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27876,8 +28137,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27876
28137
|
};
|
|
27877
28138
|
return () => {
|
|
27878
28139
|
if (!ctx.debouncedPromise) {
|
|
27879
|
-
ctx.debouncedPromise = new Promise((
|
|
27880
|
-
ctx.debouncedResolve =
|
|
28140
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
28141
|
+
ctx.debouncedResolve = resolve46;
|
|
27881
28142
|
});
|
|
27882
28143
|
}
|
|
27883
28144
|
if (ctx.debounceTimer)
|
|
@@ -28027,7 +28288,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28027
28288
|
if (!buildReference?.source) {
|
|
28028
28289
|
return;
|
|
28029
28290
|
}
|
|
28030
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath3(
|
|
28291
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath3(dirname31(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
28031
28292
|
islandFiles.add(resolvePath3(sourcePath));
|
|
28032
28293
|
}, resolveIslandSourceFiles = async (config) => {
|
|
28033
28294
|
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 join49 } from "path";
|
|
28844
29105
|
import { rm as rm14 } 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: readFileSync32 } = await import("fs");
|
|
29164
|
+
const { dirname: dirname32 } = 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 = readFileSync32(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 = dirname32(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 = join49(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 = join49(buildDir, "vendor");
|
|
29084
29345
|
mkdirSync14(vendorDir, { recursive: true });
|
|
29085
|
-
const tmpDir =
|
|
29346
|
+
const tmpDir = join49(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 readdir6 } from "fs/promises";
|
|
29167
29428
|
import { statSync as statSync7 } from "fs";
|
|
29168
|
-
import { resolve as
|
|
29429
|
+
import { resolve as resolve46 } 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 = resolve46(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(resolve46(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
|
+
resolve46(import.meta.dir, "..", "..", "package.json"),
|
|
29602
|
+
resolve46(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 readdir6(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(resolve46(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 = resolve46(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29768
|
+
const angularVendorDir = resolve46(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29769
|
+
const svelteVendorDir = resolve46(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29770
|
+
const vueVendorDir = resolve46(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29771
|
+
const depVendorDir = resolve46(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(resolve46(Bun.main)).mtimeMs;
|
|
29589
29850
|
return result;
|
|
29590
29851
|
};
|
|
29591
29852
|
var init_devBuild = __esm(() => {
|
|
@@ -29734,8 +29995,8 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
29734
29995
|
return null;
|
|
29735
29996
|
if (!pathname.startsWith("/"))
|
|
29736
29997
|
return null;
|
|
29737
|
-
const { resolve:
|
|
29738
|
-
const candidate =
|
|
29998
|
+
const { resolve: resolve47, normalize } = await import("path");
|
|
29999
|
+
const candidate = resolve47(buildDir, pathname.slice(1));
|
|
29739
30000
|
const normalizedBuild = normalize(buildDir);
|
|
29740
30001
|
if (!candidate.startsWith(normalizedBuild))
|
|
29741
30002
|
return null;
|
|
@@ -29831,17 +30092,17 @@ __export(exports_devtoolsJson, {
|
|
|
29831
30092
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
29832
30093
|
devtoolsJson: () => devtoolsJson
|
|
29833
30094
|
});
|
|
29834
|
-
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as
|
|
29835
|
-
import { dirname as
|
|
30095
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as readFileSync32, writeFileSync as writeFileSync10 } from "fs";
|
|
30096
|
+
import { dirname as dirname32, join as join50, resolve as resolve47 } from "path";
|
|
29836
30097
|
import { Elysia as Elysia6 } from "elysia";
|
|
29837
30098
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
29838
30099
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
29839
30100
|
return uuid;
|
|
29840
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
30101
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve47(uuidCachePath ?? join50(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
29841
30102
|
if (!existsSync37(cachePath))
|
|
29842
30103
|
return null;
|
|
29843
30104
|
try {
|
|
29844
|
-
const value =
|
|
30105
|
+
const value = readFileSync32(cachePath, "utf-8").trim();
|
|
29845
30106
|
return isUuidV4(value) ? value : null;
|
|
29846
30107
|
} catch {
|
|
29847
30108
|
return null;
|
|
@@ -29859,11 +30120,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29859
30120
|
if (cachedUuid)
|
|
29860
30121
|
return setGlobalUuid(cachedUuid);
|
|
29861
30122
|
const uuid = crypto.randomUUID();
|
|
29862
|
-
mkdirSync15(
|
|
30123
|
+
mkdirSync15(dirname32(cachePath), { recursive: true });
|
|
29863
30124
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
29864
30125
|
return setGlobalUuid(uuid);
|
|
29865
30126
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
29866
|
-
const rootPath =
|
|
30127
|
+
const rootPath = resolve47(options.projectRoot ?? process.cwd());
|
|
29867
30128
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
29868
30129
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
29869
30130
|
return new Elysia6({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -29876,11 +30137,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29876
30137
|
if (process.env.WSL_DISTRO_NAME) {
|
|
29877
30138
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
29878
30139
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29879
|
-
return
|
|
30140
|
+
return join50("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
29880
30141
|
}
|
|
29881
30142
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
29882
30143
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29883
|
-
return
|
|
30144
|
+
return join50("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
29884
30145
|
}
|
|
29885
30146
|
return root;
|
|
29886
30147
|
};
|
|
@@ -29892,7 +30153,7 @@ __export(exports_imageOptimizer, {
|
|
|
29892
30153
|
imageOptimizer: () => imageOptimizer
|
|
29893
30154
|
});
|
|
29894
30155
|
import { existsSync as existsSync38 } from "fs";
|
|
29895
|
-
import { resolve as
|
|
30156
|
+
import { resolve as resolve48 } from "path";
|
|
29896
30157
|
import { Elysia as Elysia7 } from "elysia";
|
|
29897
30158
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
29898
30159
|
try {
|
|
@@ -29905,7 +30166,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
29905
30166
|
}
|
|
29906
30167
|
}, resolveLocalImage = (url, buildDir) => {
|
|
29907
30168
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
29908
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
30169
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve48(process.cwd()));
|
|
29909
30170
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
29910
30171
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
29911
30172
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -30182,15 +30443,15 @@ __export(exports_prerender, {
|
|
|
30182
30443
|
prerender: () => prerender,
|
|
30183
30444
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
30184
30445
|
});
|
|
30185
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
30186
|
-
import { join as
|
|
30446
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync33 } from "fs";
|
|
30447
|
+
import { join as join51 } from "path";
|
|
30187
30448
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
30188
30449
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
30189
30450
|
await Bun.write(metaPath, String(Date.now()));
|
|
30190
30451
|
}, readTimestamp = (htmlPath) => {
|
|
30191
30452
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
30192
30453
|
try {
|
|
30193
|
-
const content =
|
|
30454
|
+
const content = readFileSync33(metaPath, "utf-8");
|
|
30194
30455
|
return Number(content) || 0;
|
|
30195
30456
|
} catch {
|
|
30196
30457
|
return 0;
|
|
@@ -30253,7 +30514,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
30253
30514
|
if (!isCompleteHtml(html))
|
|
30254
30515
|
return false;
|
|
30255
30516
|
const fileName = routeToFilename(route);
|
|
30256
|
-
const filePath =
|
|
30517
|
+
const filePath = join51(prerenderDir, fileName);
|
|
30257
30518
|
await Bun.write(filePath, html);
|
|
30258
30519
|
await writeTimestamp(filePath);
|
|
30259
30520
|
return true;
|
|
@@ -30283,13 +30544,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
30283
30544
|
return;
|
|
30284
30545
|
}
|
|
30285
30546
|
const fileName = routeToFilename(route);
|
|
30286
|
-
const filePath =
|
|
30547
|
+
const filePath = join51(prerenderDir, fileName);
|
|
30287
30548
|
await Bun.write(filePath, html);
|
|
30288
30549
|
await writeTimestamp(filePath);
|
|
30289
30550
|
result.routes.set(route, filePath);
|
|
30290
30551
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
30291
30552
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
30292
|
-
const prerenderDir =
|
|
30553
|
+
const prerenderDir = join51(outDir, "_prerendered");
|
|
30293
30554
|
mkdirSync16(prerenderDir, { recursive: true });
|
|
30294
30555
|
const baseUrl = `http://localhost:${port}`;
|
|
30295
30556
|
let routes;
|
|
@@ -30410,15 +30671,15 @@ import {
|
|
|
30410
30671
|
copyFileSync as copyFileSync4,
|
|
30411
30672
|
existsSync as existsSync41,
|
|
30412
30673
|
readdirSync as readdirSync12,
|
|
30413
|
-
readFileSync as
|
|
30674
|
+
readFileSync as readFileSync37,
|
|
30414
30675
|
statSync as statSync8,
|
|
30415
30676
|
watch as watch2
|
|
30416
30677
|
} from "fs";
|
|
30417
30678
|
import { createHash as createHash9 } from "crypto";
|
|
30418
|
-
import { dirname as
|
|
30679
|
+
import { dirname as dirname33, join as join55, resolve as resolve49 } from "path";
|
|
30419
30680
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
30420
30681
|
try {
|
|
30421
|
-
return createHash9("sha256").update(
|
|
30682
|
+
return createHash9("sha256").update(readFileSync37(path)).digest("hex");
|
|
30422
30683
|
} catch {
|
|
30423
30684
|
return null;
|
|
30424
30685
|
}
|
|
@@ -30443,11 +30704,11 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30443
30704
|
return;
|
|
30444
30705
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
30445
30706
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
30446
|
-
const entryPath =
|
|
30447
|
-
const entryDir =
|
|
30707
|
+
const entryPath = resolve49(originalEntry);
|
|
30708
|
+
const entryDir = dirname33(entryPath);
|
|
30448
30709
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
30449
|
-
const configPath2 =
|
|
30450
|
-
const configDir2 =
|
|
30710
|
+
const configPath2 = resolve49(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
30711
|
+
const configDir2 = dirname33(configPath2);
|
|
30451
30712
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
30452
30713
|
const recentlyHandled = new Map;
|
|
30453
30714
|
let entryReloadTimer = null;
|
|
@@ -30457,7 +30718,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30457
30718
|
let pendingEntryCause = null;
|
|
30458
30719
|
let siblingSequence = 0;
|
|
30459
30720
|
const importFreshEntry = async (attempt = 1) => {
|
|
30460
|
-
const siblingPath =
|
|
30721
|
+
const siblingPath = join55(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
30461
30722
|
let failure;
|
|
30462
30723
|
try {
|
|
30463
30724
|
copyFileSync4(entryPath, siblingPath);
|
|
@@ -30570,7 +30831,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30570
30831
|
continue;
|
|
30571
30832
|
let st2;
|
|
30572
30833
|
try {
|
|
30573
|
-
st2 = statSync8(
|
|
30834
|
+
st2 = statSync8(join55(dir, entry.name));
|
|
30574
30835
|
} catch {
|
|
30575
30836
|
continue;
|
|
30576
30837
|
}
|
|
@@ -31438,8 +31699,8 @@ var handleHTMXPageRequest = async (pagePath, options = {}) => {
|
|
|
31438
31699
|
};
|
|
31439
31700
|
// src/core/prepare.ts
|
|
31440
31701
|
import { createHash as createHash8 } from "crypto";
|
|
31441
|
-
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as
|
|
31442
|
-
import { basename as basename18, join as
|
|
31702
|
+
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as readFileSync34 } from "fs";
|
|
31703
|
+
import { basename as basename18, join as join52, relative as relative19, resolve as resolvePath4 } from "path";
|
|
31443
31704
|
import { Elysia as Elysia9, NotFound } from "elysia";
|
|
31444
31705
|
|
|
31445
31706
|
// src/plugins/openApiPlugin.ts
|
|
@@ -32743,8 +33004,8 @@ var MS_PER_SECOND2 = 1000;
|
|
|
32743
33004
|
var DEFAULT_PORT2 = 3000;
|
|
32744
33005
|
var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
|
|
32745
33006
|
var STATIC_PLUGIN_RETRY_DELAY_MS = 50;
|
|
32746
|
-
var waitForStaticPluginRetry = () => new Promise((
|
|
32747
|
-
setTimeout(
|
|
33007
|
+
var waitForStaticPluginRetry = () => new Promise((resolve49) => {
|
|
33008
|
+
setTimeout(resolve49, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
32748
33009
|
});
|
|
32749
33010
|
var retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
32750
33011
|
try {
|
|
@@ -32840,10 +33101,10 @@ var registerIconVersioning = (buildDir) => {
|
|
|
32840
33101
|
if (cached !== undefined)
|
|
32841
33102
|
return cached;
|
|
32842
33103
|
const path = href.split("?")[0] ?? href;
|
|
32843
|
-
const filePath =
|
|
33104
|
+
const filePath = join52(buildDir, path);
|
|
32844
33105
|
let versioned = href;
|
|
32845
33106
|
if (existsSync39(filePath)) {
|
|
32846
|
-
const hash = createHash8("sha256").update(
|
|
33107
|
+
const hash = createHash8("sha256").update(readFileSync34(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
32847
33108
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
32848
33109
|
}
|
|
32849
33110
|
cache2.set(href, versioned);
|
|
@@ -32970,13 +33231,13 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
32970
33231
|
continue;
|
|
32971
33232
|
const name = basename18(entry, ".html");
|
|
32972
33233
|
const route = name === "index" ? "/" : `/${name}`;
|
|
32973
|
-
map.set(route,
|
|
33234
|
+
map.set(route, join52(prerenderDir, entry));
|
|
32974
33235
|
}
|
|
32975
33236
|
return map;
|
|
32976
33237
|
};
|
|
32977
33238
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
32978
|
-
const root =
|
|
32979
|
-
if (!existsSync39(
|
|
33239
|
+
const root = join52(buildDir, ".absolutejs", "mobile-compatibility");
|
|
33240
|
+
if (!existsSync39(join52(root, "current.json"))) {
|
|
32980
33241
|
return new Elysia9({ name: "absolutejs-mobile-compatibility-empty" });
|
|
32981
33242
|
}
|
|
32982
33243
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
@@ -33029,7 +33290,7 @@ var prepare = async (configOrPath) => {
|
|
|
33029
33290
|
return result;
|
|
33030
33291
|
}
|
|
33031
33292
|
stepStartedAt = performance.now();
|
|
33032
|
-
const manifest = JSON.parse(
|
|
33293
|
+
const manifest = JSON.parse(readFileSync34(`${buildDir}/manifest.json`, "utf-8"));
|
|
33033
33294
|
setCurrentIslandManifest(manifest);
|
|
33034
33295
|
if (config.islands?.registry) {
|
|
33035
33296
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -33037,14 +33298,14 @@ var prepare = async (configOrPath) => {
|
|
|
33037
33298
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
33038
33299
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
33039
33300
|
stepStartedAt = performance.now();
|
|
33040
|
-
const conventionsPath =
|
|
33301
|
+
const conventionsPath = join52(buildDir, "conventions.json");
|
|
33041
33302
|
if (existsSync39(conventionsPath)) {
|
|
33042
|
-
const conventions2 = JSON.parse(
|
|
33303
|
+
const conventions2 = JSON.parse(readFileSync34(conventionsPath, "utf-8"));
|
|
33043
33304
|
setConventions(conventions2);
|
|
33044
33305
|
}
|
|
33045
|
-
const spaRoutesPath =
|
|
33306
|
+
const spaRoutesPath = join52(buildDir, "spa-routes.json");
|
|
33046
33307
|
if (existsSync39(spaRoutesPath)) {
|
|
33047
|
-
setSpaRouteManifest(JSON.parse(
|
|
33308
|
+
setSpaRouteManifest(JSON.parse(readFileSync34(spaRoutesPath, "utf-8")));
|
|
33048
33309
|
}
|
|
33049
33310
|
recordStep("load production conventions", stepStartedAt);
|
|
33050
33311
|
stepStartedAt = performance.now();
|
|
@@ -33055,7 +33316,7 @@ var prepare = async (configOrPath) => {
|
|
|
33055
33316
|
prefix: "",
|
|
33056
33317
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
33057
33318
|
});
|
|
33058
|
-
const generatedAssetsRoot =
|
|
33319
|
+
const generatedAssetsRoot = join52(buildDir, ".absolutejs");
|
|
33059
33320
|
const generatedAssetsPlugin = new Elysia9({
|
|
33060
33321
|
name: "absolutejs-generated-assets"
|
|
33061
33322
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -33093,7 +33354,7 @@ var prepare = async (configOrPath) => {
|
|
|
33093
33354
|
responseValue.headers.set("cache-control", isFingerprintedAsset(pathname) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate");
|
|
33094
33355
|
});
|
|
33095
33356
|
stepStartedAt = performance.now();
|
|
33096
|
-
const prerenderDir =
|
|
33357
|
+
const prerenderDir = join52(buildDir, "_prerendered");
|
|
33097
33358
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
33098
33359
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
33099
33360
|
const mobileAssociationPlugin = createAbsoluteMobileAssociationPlugin(config.mobile, process.cwd(), { requireAll: true });
|
|
@@ -33163,20 +33424,20 @@ import {
|
|
|
33163
33424
|
copyFileSync as copyFileSync3,
|
|
33164
33425
|
existsSync as existsSync40,
|
|
33165
33426
|
mkdirSync as mkdirSync17,
|
|
33166
|
-
readFileSync as
|
|
33427
|
+
readFileSync as readFileSync35,
|
|
33167
33428
|
rmSync as rmSync4
|
|
33168
33429
|
} from "fs";
|
|
33169
|
-
import { join as
|
|
33170
|
-
var CERT_DIR =
|
|
33171
|
-
var CERT_PATH =
|
|
33172
|
-
var KEY_PATH =
|
|
33430
|
+
import { join as join53 } from "path";
|
|
33431
|
+
var CERT_DIR = join53(process.cwd(), ".absolutejs");
|
|
33432
|
+
var CERT_PATH = join53(CERT_DIR, "cert.pem");
|
|
33433
|
+
var KEY_PATH = join53(CERT_DIR, "key.pem");
|
|
33173
33434
|
var CERT_VALIDITY_DAYS = 365;
|
|
33174
33435
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
33175
33436
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
33176
33437
|
var certFilesExist = () => existsSync40(CERT_PATH) && existsSync40(KEY_PATH);
|
|
33177
33438
|
var isCertExpired = () => {
|
|
33178
33439
|
try {
|
|
33179
|
-
const certPem =
|
|
33440
|
+
const certPem = readFileSync35(CERT_PATH, "utf-8");
|
|
33180
33441
|
const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
|
|
33181
33442
|
stdin: new TextEncoder().encode(certPem)
|
|
33182
33443
|
});
|
|
@@ -33272,8 +33533,8 @@ var loadDevCert = () => {
|
|
|
33272
33533
|
return null;
|
|
33273
33534
|
try {
|
|
33274
33535
|
return {
|
|
33275
|
-
cert:
|
|
33276
|
-
key:
|
|
33536
|
+
cert: readFileSync35(paths.cert, "utf-8"),
|
|
33537
|
+
key: readFileSync35(paths.key, "utf-8")
|
|
33277
33538
|
};
|
|
33278
33539
|
} catch {
|
|
33279
33540
|
return null;
|
|
@@ -33283,18 +33544,18 @@ var loadDevCert = () => {
|
|
|
33283
33544
|
// src/utils/instanceRegistry.ts
|
|
33284
33545
|
import {
|
|
33285
33546
|
mkdirSync as mkdirSync18,
|
|
33286
|
-
readFileSync as
|
|
33547
|
+
readFileSync as readFileSync36,
|
|
33287
33548
|
readdirSync as readdirSync11,
|
|
33288
33549
|
unlinkSync as unlinkSync2,
|
|
33289
33550
|
writeFileSync as writeFileSync11
|
|
33290
33551
|
} from "fs";
|
|
33291
33552
|
import { homedir as homedir2 } from "os";
|
|
33292
|
-
import { basename as basename19, join as
|
|
33553
|
+
import { basename as basename19, join as join54 } from "path";
|
|
33293
33554
|
var registeredPids = new Set;
|
|
33294
33555
|
var exitHandlerRegistered = false;
|
|
33295
|
-
var instanceFilePath = (pid) =>
|
|
33296
|
-
var instanceLogPath = (pid) =>
|
|
33297
|
-
var instanceRegistryDir = () =>
|
|
33556
|
+
var instanceFilePath = (pid) => join54(instanceRegistryDir(), `${pid}.json`);
|
|
33557
|
+
var instanceLogPath = (pid) => join54(instanceRegistryDir(), `${pid}.log`);
|
|
33558
|
+
var instanceRegistryDir = () => join54(homedir2(), ".absolutejs", "instances");
|
|
33298
33559
|
var removeInstanceFilesSync = (pid) => {
|
|
33299
33560
|
try {
|
|
33300
33561
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -33316,7 +33577,7 @@ var registerExitHandlerOnce = () => {
|
|
|
33316
33577
|
};
|
|
33317
33578
|
var readJsonFile = (path) => {
|
|
33318
33579
|
try {
|
|
33319
|
-
return JSON.parse(
|
|
33580
|
+
return JSON.parse(readFileSync36(path, "utf-8"));
|
|
33320
33581
|
} catch {
|
|
33321
33582
|
return null;
|
|
33322
33583
|
}
|
|
@@ -33329,7 +33590,7 @@ var registerInstance = (record) => {
|
|
|
33329
33590
|
return record;
|
|
33330
33591
|
};
|
|
33331
33592
|
var resolveProjectName = (cwd2) => {
|
|
33332
|
-
const parsed = readJsonFile(
|
|
33593
|
+
const parsed = readJsonFile(join54(cwd2, "package.json"));
|
|
33333
33594
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
33334
33595
|
return parsed.name;
|
|
33335
33596
|
}
|
|
@@ -33356,7 +33617,7 @@ var getLocalIPAddress = () => {
|
|
|
33356
33617
|
|
|
33357
33618
|
// src/plugins/networking.ts
|
|
33358
33619
|
init_startupBanner();
|
|
33359
|
-
var
|
|
33620
|
+
var host2 = env4.ABSOLUTE_HOST ?? env4.HOST ?? "localhost";
|
|
33360
33621
|
var port = env4.ABSOLUTE_PORT ?? env4.PORT ?? DEFAULT_PORT;
|
|
33361
33622
|
var visibility = env4.ABSOLUTE_WORKSPACE_SERVICE_VISIBILITY ?? "public";
|
|
33362
33623
|
var managedByWorkspace = env4.ABSOLUTE_WORKSPACE_MANAGED === "1";
|
|
@@ -33365,7 +33626,7 @@ var args = argv;
|
|
|
33365
33626
|
var hostFlag = args.includes("--host");
|
|
33366
33627
|
if (hostFlag) {
|
|
33367
33628
|
localIP = getLocalIPAddress();
|
|
33368
|
-
|
|
33629
|
+
host2 = "0.0.0.0";
|
|
33369
33630
|
}
|
|
33370
33631
|
var loadTls = () => {
|
|
33371
33632
|
if (env4.NODE_ENV !== "development")
|
|
@@ -33403,7 +33664,7 @@ var selfRegisterInstance = () => {
|
|
|
33403
33664
|
controllerPid: process.pid,
|
|
33404
33665
|
cwd: process.cwd(),
|
|
33405
33666
|
frameworks: [],
|
|
33406
|
-
host,
|
|
33667
|
+
host: host2,
|
|
33407
33668
|
https: protocol === "https",
|
|
33408
33669
|
logFile: null,
|
|
33409
33670
|
name: resolveProjectName(process.cwd()),
|
|
@@ -33445,7 +33706,7 @@ var networking = (app) => {
|
|
|
33445
33706
|
return app;
|
|
33446
33707
|
}
|
|
33447
33708
|
const listened = app.listen({
|
|
33448
|
-
hostname:
|
|
33709
|
+
hostname: host2,
|
|
33449
33710
|
idleTimeout: httpIdleTimeout,
|
|
33450
33711
|
port,
|
|
33451
33712
|
...tls ? {
|
|
@@ -33469,7 +33730,7 @@ var networking = (app) => {
|
|
|
33469
33730
|
const version = globalThis.__absoluteVersion || env4.ABSOLUTE_VERSION || "";
|
|
33470
33731
|
startupBanner({
|
|
33471
33732
|
buildDuration,
|
|
33472
|
-
host,
|
|
33733
|
+
host: host2,
|
|
33473
33734
|
networkUrl: hostFlag ? `${protocol}://${localIP}:${port}/` : undefined,
|
|
33474
33735
|
port,
|
|
33475
33736
|
protocol,
|
|
@@ -33639,8 +33900,8 @@ var generateHeadElement = ({
|
|
|
33639
33900
|
};
|
|
33640
33901
|
// src/utils/defineEnv.ts
|
|
33641
33902
|
var {env: bunEnv } = globalThis.Bun;
|
|
33642
|
-
import { existsSync as existsSync42, readFileSync as
|
|
33643
|
-
import { resolve as
|
|
33903
|
+
import { existsSync as existsSync42, readFileSync as readFileSync38 } from "fs";
|
|
33904
|
+
import { resolve as resolve50 } from "path";
|
|
33644
33905
|
|
|
33645
33906
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
33646
33907
|
var exports_value = {};
|
|
@@ -38107,9 +38368,9 @@ class ValueCastError extends TypeBoxError {
|
|
|
38107
38368
|
}
|
|
38108
38369
|
function ScoreUnion(schema, references, value) {
|
|
38109
38370
|
if (schema[Kind] === "Object" && typeof value === "object" && !IsNull2(value)) {
|
|
38110
|
-
const
|
|
38371
|
+
const object2 = schema;
|
|
38111
38372
|
const keys = Object.getOwnPropertyNames(value);
|
|
38112
|
-
const entries = Object.entries(
|
|
38373
|
+
const entries = Object.entries(object2.properties);
|
|
38113
38374
|
return entries.reduce((acc, [key, schema2]) => {
|
|
38114
38375
|
const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
|
|
38115
38376
|
const checks = Check(schema2, references, value[key]) ? 10 : 0;
|
|
@@ -39228,8 +39489,8 @@ class ValuePointerRootDeleteError extends TypeBoxError {
|
|
|
39228
39489
|
this.path = path;
|
|
39229
39490
|
}
|
|
39230
39491
|
}
|
|
39231
|
-
function Escape2(
|
|
39232
|
-
return
|
|
39492
|
+
function Escape2(component2) {
|
|
39493
|
+
return component2.indexOf("~") === -1 ? component2 : component2.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
39233
39494
|
}
|
|
39234
39495
|
function* Format(pointer) {
|
|
39235
39496
|
if (pointer === "")
|
|
@@ -39255,12 +39516,12 @@ function Set4(value, pointer, update) {
|
|
|
39255
39516
|
if (pointer === "")
|
|
39256
39517
|
throw new ValuePointerRootSetError(value, pointer, update);
|
|
39257
39518
|
let [owner, next, key] = [null, value, ""];
|
|
39258
|
-
for (const
|
|
39259
|
-
if (next[
|
|
39260
|
-
next[
|
|
39519
|
+
for (const component2 of Format(pointer)) {
|
|
39520
|
+
if (next[component2] === undefined)
|
|
39521
|
+
next[component2] = {};
|
|
39261
39522
|
owner = next;
|
|
39262
|
-
next = next[
|
|
39263
|
-
key =
|
|
39523
|
+
next = next[component2];
|
|
39524
|
+
key = component2;
|
|
39264
39525
|
}
|
|
39265
39526
|
owner[key] = update;
|
|
39266
39527
|
}
|
|
@@ -39268,12 +39529,12 @@ function Delete3(value, pointer) {
|
|
|
39268
39529
|
if (pointer === "")
|
|
39269
39530
|
throw new ValuePointerRootDeleteError(value, pointer);
|
|
39270
39531
|
let [owner, next, key] = [null, value, ""];
|
|
39271
|
-
for (const
|
|
39272
|
-
if (next[
|
|
39532
|
+
for (const component2 of Format(pointer)) {
|
|
39533
|
+
if (next[component2] === undefined || next[component2] === null)
|
|
39273
39534
|
return;
|
|
39274
39535
|
owner = next;
|
|
39275
|
-
next = next[
|
|
39276
|
-
key =
|
|
39536
|
+
next = next[component2];
|
|
39537
|
+
key = component2;
|
|
39277
39538
|
}
|
|
39278
39539
|
if (Array.isArray(owner)) {
|
|
39279
39540
|
const index = parseInt(key);
|
|
@@ -39286,12 +39547,12 @@ function Has3(value, pointer) {
|
|
|
39286
39547
|
if (pointer === "")
|
|
39287
39548
|
return true;
|
|
39288
39549
|
let [owner, next, key] = [null, value, ""];
|
|
39289
|
-
for (const
|
|
39290
|
-
if (next[
|
|
39550
|
+
for (const component2 of Format(pointer)) {
|
|
39551
|
+
if (next[component2] === undefined)
|
|
39291
39552
|
return false;
|
|
39292
39553
|
owner = next;
|
|
39293
|
-
next = next[
|
|
39294
|
-
key =
|
|
39554
|
+
next = next[component2];
|
|
39555
|
+
key = component2;
|
|
39295
39556
|
}
|
|
39296
39557
|
return Object.getOwnPropertyNames(owner).includes(key);
|
|
39297
39558
|
}
|
|
@@ -39299,10 +39560,10 @@ function Get3(value, pointer) {
|
|
|
39299
39560
|
if (pointer === "")
|
|
39300
39561
|
return value;
|
|
39301
39562
|
let current = value;
|
|
39302
|
-
for (const
|
|
39303
|
-
if (current[
|
|
39563
|
+
for (const component2 of Format(pointer)) {
|
|
39564
|
+
if (current[component2] === undefined)
|
|
39304
39565
|
return;
|
|
39305
|
-
current = current[
|
|
39566
|
+
current = current[component2];
|
|
39306
39567
|
}
|
|
39307
39568
|
return current;
|
|
39308
39569
|
}
|
|
@@ -39576,7 +39837,7 @@ class ParseError extends TypeBoxError {
|
|
|
39576
39837
|
}
|
|
39577
39838
|
var ParseRegistry;
|
|
39578
39839
|
(function(ParseRegistry2) {
|
|
39579
|
-
const
|
|
39840
|
+
const registry2 = new Map([
|
|
39580
39841
|
["Assert", (type, references, value) => {
|
|
39581
39842
|
Assert(type, references, value);
|
|
39582
39843
|
return value;
|
|
@@ -39590,15 +39851,15 @@ var ParseRegistry;
|
|
|
39590
39851
|
["Encode", (type, references, value) => HasTransform(type, references) ? TransformEncode(type, references, value) : value]
|
|
39591
39852
|
]);
|
|
39592
39853
|
function Delete5(key) {
|
|
39593
|
-
|
|
39854
|
+
registry2.delete(key);
|
|
39594
39855
|
}
|
|
39595
39856
|
ParseRegistry2.Delete = Delete5;
|
|
39596
39857
|
function Set5(key, callback) {
|
|
39597
|
-
|
|
39858
|
+
registry2.set(key, callback);
|
|
39598
39859
|
}
|
|
39599
39860
|
ParseRegistry2.Set = Set5;
|
|
39600
39861
|
function Get4(key) {
|
|
39601
|
-
return
|
|
39862
|
+
return registry2.get(key);
|
|
39602
39863
|
}
|
|
39603
39864
|
ParseRegistry2.Get = Get4;
|
|
39604
39865
|
})(ParseRegistry || (ParseRegistry = {}));
|
|
@@ -39612,10 +39873,10 @@ var ParseDefault = [
|
|
|
39612
39873
|
];
|
|
39613
39874
|
function ParseValue(operations, type, references, value) {
|
|
39614
39875
|
return operations.reduce((value2, operationKey) => {
|
|
39615
|
-
const
|
|
39616
|
-
if (IsUndefined2(
|
|
39876
|
+
const operation2 = ParseRegistry.Get(operationKey);
|
|
39877
|
+
if (IsUndefined2(operation2))
|
|
39617
39878
|
throw new ParseError(`Unable to find Parse operation '${operationKey}'`);
|
|
39618
|
-
return
|
|
39879
|
+
return operation2(type, references, value2);
|
|
39619
39880
|
}, value);
|
|
39620
39881
|
}
|
|
39621
39882
|
function Parse(...args2) {
|
|
@@ -39675,19 +39936,19 @@ ${lines.join(`
|
|
|
39675
39936
|
};
|
|
39676
39937
|
var checkEnvFileSecurity = (properties) => {
|
|
39677
39938
|
const cwd2 = process.cwd();
|
|
39678
|
-
const envPath =
|
|
39939
|
+
const envPath = resolve50(cwd2, ".env");
|
|
39679
39940
|
if (!existsSync42(envPath))
|
|
39680
39941
|
return;
|
|
39681
39942
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
39682
39943
|
if (sensitiveKeys.length === 0)
|
|
39683
39944
|
return;
|
|
39684
|
-
const envContent =
|
|
39945
|
+
const envContent = readFileSync38(envPath, "utf-8");
|
|
39685
39946
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
39686
39947
|
if (presentKeys.length === 0)
|
|
39687
39948
|
return;
|
|
39688
|
-
const gitignorePath =
|
|
39949
|
+
const gitignorePath = resolve50(cwd2, ".gitignore");
|
|
39689
39950
|
if (existsSync42(gitignorePath)) {
|
|
39690
|
-
const gitignore =
|
|
39951
|
+
const gitignore = readFileSync38(gitignorePath, "utf-8");
|
|
39691
39952
|
if (gitignore.split(`
|
|
39692
39953
|
`).some((line) => line.trim() === ".env"))
|
|
39693
39954
|
return;
|
|
@@ -39720,7 +39981,7 @@ var getEnv = (key) => {
|
|
|
39720
39981
|
};
|
|
39721
39982
|
// src/utils/projectRoot.ts
|
|
39722
39983
|
import { existsSync as existsSync43 } from "fs";
|
|
39723
|
-
import { dirname as
|
|
39984
|
+
import { dirname as dirname34, resolve as resolve51 } from "path";
|
|
39724
39985
|
var CONFIG_CANDIDATES = [
|
|
39725
39986
|
"absolute.config.ts",
|
|
39726
39987
|
"absolute.config.js",
|
|
@@ -39729,7 +39990,7 @@ var CONFIG_CANDIDATES = [
|
|
|
39729
39990
|
"absolute.config.mts",
|
|
39730
39991
|
"absolute.config.cts"
|
|
39731
39992
|
];
|
|
39732
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(
|
|
39993
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(resolve51(directory, name)));
|
|
39733
39994
|
var findProjectRoot = () => {
|
|
39734
39995
|
const start = process.cwd();
|
|
39735
39996
|
let packageRoot = null;
|
|
@@ -39738,10 +39999,10 @@ var findProjectRoot = () => {
|
|
|
39738
39999
|
if (hasAbsoluteConfig(directory)) {
|
|
39739
40000
|
return directory;
|
|
39740
40001
|
}
|
|
39741
|
-
if (packageRoot === null && existsSync43(
|
|
40002
|
+
if (packageRoot === null && existsSync43(resolve51(directory, "package.json"))) {
|
|
39742
40003
|
packageRoot = directory;
|
|
39743
40004
|
}
|
|
39744
|
-
const parent =
|
|
40005
|
+
const parent = dirname34(directory);
|
|
39745
40006
|
if (parent === directory) {
|
|
39746
40007
|
return packageRoot ?? start;
|
|
39747
40008
|
}
|
|
@@ -39987,5 +40248,5 @@ export {
|
|
|
39987
40248
|
ANGULAR_INIT_TIMEOUT_MS
|
|
39988
40249
|
};
|
|
39989
40250
|
|
|
39990
|
-
//# debugId=
|
|
40251
|
+
//# debugId=4D6C6E5D8BEF467C64756E2164756E21
|
|
39991
40252
|
//# sourceMappingURL=index.js.map
|