@absolutejs/absolute 0.20.0-beta.13 → 0.20.0-beta.15
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 +40 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +954 -561
- package/dist/build.js.map +7 -5
- package/dist/cli/index.js +972 -515
- package/dist/index.js +1036 -643
- package/dist/index.js.map +7 -5
- package/dist/mobile/index.js +442 -36
- package/dist/mobile/index.js.map +10 -7
- package/dist/mobile/shellSync.js +8 -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,392 @@ 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, SyncLocalDataPolicyError, 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), validatePolicyMatch = (match, label) => {
|
|
13207
|
+
if (match.length === 0 || match.trim() !== match || /^\*+$/.test(match) || match.includes("**"))
|
|
13208
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.match must be an exact name or a non-empty glob without adjacent wildcards.`);
|
|
13209
|
+
}, validateSyncLocalDataPolicy = (policy, label = "localData") => {
|
|
13210
|
+
if (policy.maxBytesPerNamespace !== undefined && (!Number.isSafeInteger(policy.maxBytesPerNamespace) || policy.maxBytesPerNamespace < 1))
|
|
13211
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.maxBytesPerNamespace must be a positive safe integer.`);
|
|
13212
|
+
for (const [index, rule] of (policy.collections ?? []).entries()) {
|
|
13213
|
+
validatePolicyMatch(rule.match, `${label}.collections[${index}]`);
|
|
13214
|
+
if (rule.maxAgeMs !== undefined && (!Number.isSafeInteger(rule.maxAgeMs) || rule.maxAgeMs < 1))
|
|
13215
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}].maxAgeMs must be a positive safe integer.`);
|
|
13216
|
+
if (rule.persistence === "memory-only" && rule.protection === "required")
|
|
13217
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] cannot require at-rest protection when it is memory-only.`);
|
|
13218
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
13219
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] declares ${rule.sensitivity} data without required protection or memory-only persistence.`);
|
|
13220
|
+
}
|
|
13221
|
+
for (const [index, rule] of (policy.mutations ?? []).entries()) {
|
|
13222
|
+
validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
|
|
13223
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
13224
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] declares ${rule.sensitivity} arguments without required protection.`);
|
|
13225
|
+
}
|
|
13226
|
+
return policy;
|
|
13227
|
+
}, normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
|
|
13228
|
+
const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
|
|
13229
|
+
const ids = new Set;
|
|
13230
|
+
for (const component of components) {
|
|
13231
|
+
if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
|
|
13232
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
|
|
13233
|
+
if (ids.has(component.id))
|
|
13234
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
|
|
13235
|
+
ids.add(component.id);
|
|
13236
|
+
if (component.localData)
|
|
13237
|
+
validateSyncLocalDataPolicy(component.localData, `${component.id}.localData`);
|
|
13238
|
+
}
|
|
13239
|
+
return components.sort((a, b2) => a.id.localeCompare(b2.id));
|
|
13240
|
+
}, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
|
|
13241
|
+
const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
|
|
13242
|
+
const current = resolveSyncLocalMigrations(component.version, component);
|
|
13243
|
+
return {
|
|
13244
|
+
id: component.id,
|
|
13245
|
+
...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
|
|
13246
|
+
};
|
|
13247
|
+
});
|
|
13248
|
+
const active = new Set(components.map((component) => component.id));
|
|
13249
|
+
const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
|
|
13250
|
+
return { components, orphanedComponents };
|
|
13251
|
+
}, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
|
|
13252
|
+
positiveVersion(storedVersion, "Stored Sync schema version");
|
|
13253
|
+
const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
|
|
13254
|
+
const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
|
|
13255
|
+
const versions = new Set;
|
|
13256
|
+
for (const migration of migrations) {
|
|
13257
|
+
positiveVersion(migration.toVersion, "Sync migration toVersion");
|
|
13258
|
+
if (versions.has(migration.toVersion))
|
|
13259
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
|
|
13260
|
+
versions.add(migration.toVersion);
|
|
13261
|
+
}
|
|
13262
|
+
const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
|
|
13263
|
+
const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
|
|
13264
|
+
if (minimumCompatibleVersion > targetVersion)
|
|
13265
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
|
|
13266
|
+
if (storedVersion > targetVersion)
|
|
13267
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
|
|
13268
|
+
if (storedVersion < minimumCompatibleVersion)
|
|
13269
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
|
|
13270
|
+
const steps = [];
|
|
13271
|
+
for (let version = storedVersion + 1;version <= targetVersion; version++) {
|
|
13272
|
+
const migration = migrations.find((candidate) => candidate.toVersion === version);
|
|
13273
|
+
if (migration === undefined)
|
|
13274
|
+
throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
|
|
13275
|
+
steps.push(migration);
|
|
13276
|
+
}
|
|
13277
|
+
return { minimumCompatibleVersion, steps, targetVersion };
|
|
13278
|
+
};
|
|
13279
|
+
var init_client = __esm(() => {
|
|
13280
|
+
RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
|
|
13281
|
+
host = globalThis;
|
|
13282
|
+
registry = (() => {
|
|
13283
|
+
const existing = host[RUNTIME_TRANSPORT];
|
|
13284
|
+
if (isRegistry(existing))
|
|
13285
|
+
return existing;
|
|
13286
|
+
const created = { installations: [] };
|
|
13287
|
+
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
13288
|
+
configurable: false,
|
|
13289
|
+
enumerable: false,
|
|
13290
|
+
value: created,
|
|
13291
|
+
writable: false
|
|
13292
|
+
});
|
|
13293
|
+
return created;
|
|
13294
|
+
})();
|
|
13295
|
+
SyncLocalDataPolicyError = class SyncLocalDataPolicyError extends Error {
|
|
13296
|
+
code;
|
|
13297
|
+
constructor(code, message) {
|
|
13298
|
+
super(message);
|
|
13299
|
+
this.name = "SyncLocalDataPolicyError";
|
|
13300
|
+
this.code = code;
|
|
13301
|
+
}
|
|
13302
|
+
};
|
|
13303
|
+
SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
|
|
13304
|
+
code;
|
|
13305
|
+
storedVersion;
|
|
13306
|
+
targetVersion;
|
|
13307
|
+
constructor(code, message, versions = {}) {
|
|
13308
|
+
super(message);
|
|
13309
|
+
this.name = "SyncLocalStoreSchemaError";
|
|
13310
|
+
this.code = code;
|
|
13311
|
+
this.storedVersion = versions.storedVersion;
|
|
13312
|
+
this.targetVersion = versions.targetVersion;
|
|
13313
|
+
}
|
|
13314
|
+
};
|
|
13315
|
+
});
|
|
13316
|
+
|
|
13317
|
+
// src/mobile/syncSchema.ts
|
|
13318
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
13319
|
+
import { dirname as dirname16, join as join29, resolve as resolve25 } from "path";
|
|
13320
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
13321
|
+
try {
|
|
13322
|
+
const value = JSON.parse(readFileSync17(path, "utf8"));
|
|
13323
|
+
return object(value) ? value : undefined;
|
|
13324
|
+
} catch {
|
|
13325
|
+
return;
|
|
13326
|
+
}
|
|
13327
|
+
}, localSchemaMetadata = (manifest) => {
|
|
13328
|
+
const absolutejs = Reflect.get(manifest, "absolutejs");
|
|
13329
|
+
if (!object(absolutejs))
|
|
13330
|
+
return;
|
|
13331
|
+
const sync = Reflect.get(absolutejs, "sync");
|
|
13332
|
+
if (!object(sync))
|
|
13333
|
+
return;
|
|
13334
|
+
return Reflect.get(sync, "localSchema");
|
|
13335
|
+
}, packageManifestPath = (projectRoot, packageName) => {
|
|
13336
|
+
let directory = resolve25(projectRoot);
|
|
13337
|
+
while (true) {
|
|
13338
|
+
const candidate = join29(directory, "node_modules", packageName, "package.json");
|
|
13339
|
+
const manifest = manifestAt(candidate);
|
|
13340
|
+
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
13341
|
+
return candidate;
|
|
13342
|
+
const parent = dirname16(directory);
|
|
13343
|
+
if (parent === directory)
|
|
13344
|
+
return;
|
|
13345
|
+
directory = parent;
|
|
13346
|
+
}
|
|
13347
|
+
}, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
|
|
13348
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
13349
|
+
throw metadataError(id, `${field} must be a positive safe integer.`);
|
|
13350
|
+
return value;
|
|
13351
|
+
}, nonEmpty = (value, id, field) => {
|
|
13352
|
+
if (typeof value !== "string" || value.trim() !== value || value.length === 0)
|
|
13353
|
+
throw metadataError(id, `${field} must be a non-empty trimmed string.`);
|
|
13354
|
+
return value;
|
|
13355
|
+
}, requireObject = (value, id, detail) => {
|
|
13356
|
+
if (!object(value))
|
|
13357
|
+
throw metadataError(id, detail);
|
|
13358
|
+
return value;
|
|
13359
|
+
}, unknownField = (record, key) => record[key], normalizeJsonValue2 = (value, id, field) => {
|
|
13360
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
13361
|
+
return value;
|
|
13362
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
13363
|
+
return value;
|
|
13364
|
+
if (Array.isArray(value))
|
|
13365
|
+
return value.map((entry) => normalizeJsonValue2(entry, id, field));
|
|
13366
|
+
if (object(value))
|
|
13367
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
13368
|
+
key,
|
|
13369
|
+
normalizeJsonValue2(entry, id, field)
|
|
13370
|
+
]));
|
|
13371
|
+
throw metadataError(id, `${field} must be JSON-safe.`);
|
|
13372
|
+
}, operation = (value, id, index) => {
|
|
13373
|
+
const record = requireObject(value, id, `migration operation ${index} must be an object.`);
|
|
13374
|
+
const type = Reflect.get(record, "type");
|
|
13375
|
+
const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
|
|
13376
|
+
if (type === "delete-collection")
|
|
13377
|
+
return { collection, type };
|
|
13378
|
+
if (type === "rename-field")
|
|
13379
|
+
return {
|
|
13380
|
+
collection,
|
|
13381
|
+
from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
|
|
13382
|
+
to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
|
|
13383
|
+
type
|
|
13384
|
+
};
|
|
13385
|
+
const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
|
|
13386
|
+
if (type === "remove-field")
|
|
13387
|
+
return { collection, field, type };
|
|
13388
|
+
if (type === "set-default")
|
|
13389
|
+
return {
|
|
13390
|
+
collection,
|
|
13391
|
+
field,
|
|
13392
|
+
type,
|
|
13393
|
+
value: normalizeJsonValue2(Reflect.get(record, "value"), id, `operation ${index}.value`)
|
|
13394
|
+
};
|
|
13395
|
+
throw metadataError(id, `operation ${index}.type is not supported.`);
|
|
13396
|
+
}, migration = (value, id, index) => {
|
|
13397
|
+
const record = requireObject(value, id, `migration ${index} must be an object.`);
|
|
13398
|
+
const allowed = new Set(["operations", "toVersion"]);
|
|
13399
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13400
|
+
if (unsupported)
|
|
13401
|
+
throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
|
|
13402
|
+
const declaredOperations = Reflect.get(record, "operations");
|
|
13403
|
+
if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
|
|
13404
|
+
throw metadataError(id, `migration ${index}.operations must be an array.`);
|
|
13405
|
+
const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
|
|
13406
|
+
return {
|
|
13407
|
+
operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
|
|
13408
|
+
toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
|
|
13409
|
+
};
|
|
13410
|
+
}, localDataPolicy = (value, id) => {
|
|
13411
|
+
const record = requireObject(value, id, "localData must be an object.");
|
|
13412
|
+
const allowed = new Set([
|
|
13413
|
+
"collections",
|
|
13414
|
+
"maxBytesPerNamespace",
|
|
13415
|
+
"mutations"
|
|
13416
|
+
]);
|
|
13417
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13418
|
+
if (unsupported)
|
|
13419
|
+
throw metadataError(id, `localData.${unsupported} is not supported.`);
|
|
13420
|
+
const collectionRules = Reflect.get(record, "collections");
|
|
13421
|
+
const mutationRules = Reflect.get(record, "mutations");
|
|
13422
|
+
if (collectionRules !== undefined && !Array.isArray(collectionRules))
|
|
13423
|
+
throw metadataError(id, "localData.collections must be an array.");
|
|
13424
|
+
if (mutationRules !== undefined && !Array.isArray(mutationRules))
|
|
13425
|
+
throw metadataError(id, "localData.mutations must be an array.");
|
|
13426
|
+
const collections = Array.isArray(collectionRules) ? collectionRules.map((entry, index) => {
|
|
13427
|
+
const rule = requireObject(entry, id, `localData.collections[${index}] must be an object.`);
|
|
13428
|
+
const allowedRuleKeys = new Set([
|
|
13429
|
+
"evictionPriority",
|
|
13430
|
+
"match",
|
|
13431
|
+
"maxAgeMs",
|
|
13432
|
+
"onProtectionUnavailable",
|
|
13433
|
+
"persistence",
|
|
13434
|
+
"protection",
|
|
13435
|
+
"sensitivity"
|
|
13436
|
+
]);
|
|
13437
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13438
|
+
if (unsupportedRuleKey)
|
|
13439
|
+
throw metadataError(id, `localData.collections[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13440
|
+
const match = nonEmpty(Reflect.get(rule, "match"), id, `localData.collections[${index}].match`);
|
|
13441
|
+
const persistence = unknownField(rule, "persistence");
|
|
13442
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13443
|
+
const protection = unknownField(rule, "protection");
|
|
13444
|
+
const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
|
|
13445
|
+
const evictionPriority = unknownField(rule, "evictionPriority");
|
|
13446
|
+
const maxAge = unknownField(rule, "maxAgeMs");
|
|
13447
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13448
|
+
throw metadataError(id, `localData.collections[${index}].persistence is invalid.`);
|
|
13449
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13450
|
+
throw metadataError(id, `localData.collections[${index}].sensitivity is invalid.`);
|
|
13451
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13452
|
+
throw metadataError(id, `localData.collections[${index}].protection is invalid.`);
|
|
13453
|
+
if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
|
|
13454
|
+
throw metadataError(id, `localData.collections[${index}].onProtectionUnavailable is invalid.`);
|
|
13455
|
+
if (evictionPriority !== undefined && evictionPriority !== "critical" && evictionPriority !== "normal" && evictionPriority !== "disposable")
|
|
13456
|
+
throw metadataError(id, `localData.collections[${index}].evictionPriority is invalid.`);
|
|
13457
|
+
return {
|
|
13458
|
+
match,
|
|
13459
|
+
...sensitivity ? { sensitivity } : {},
|
|
13460
|
+
...persistence ? { persistence } : {},
|
|
13461
|
+
...protection ? { protection } : {},
|
|
13462
|
+
...onProtectionUnavailable ? {
|
|
13463
|
+
onProtectionUnavailable
|
|
13464
|
+
} : {},
|
|
13465
|
+
...evictionPriority ? { evictionPriority } : {},
|
|
13466
|
+
...maxAge === undefined ? {} : {
|
|
13467
|
+
maxAgeMs: positiveVersion2(maxAge, id, `localData.collections[${index}].maxAgeMs`)
|
|
13468
|
+
}
|
|
13469
|
+
};
|
|
13470
|
+
}) : undefined;
|
|
13471
|
+
const mutations = Array.isArray(mutationRules) ? mutationRules.map((entry, index) => {
|
|
13472
|
+
const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
|
|
13473
|
+
const allowedRuleKeys = new Set([
|
|
13474
|
+
"match",
|
|
13475
|
+
"persistence",
|
|
13476
|
+
"protection",
|
|
13477
|
+
"sensitivity"
|
|
13478
|
+
]);
|
|
13479
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13480
|
+
if (unsupportedRuleKey)
|
|
13481
|
+
throw metadataError(id, `localData.mutations[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13482
|
+
const protection = unknownField(rule, "protection");
|
|
13483
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13484
|
+
const persistence = unknownField(rule, "persistence");
|
|
13485
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13486
|
+
throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
|
|
13487
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13488
|
+
throw metadataError(id, `localData.mutations[${index}].sensitivity is invalid.`);
|
|
13489
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13490
|
+
throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
|
|
13491
|
+
return {
|
|
13492
|
+
match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
|
|
13493
|
+
...sensitivity ? { sensitivity } : {},
|
|
13494
|
+
...persistence ? {
|
|
13495
|
+
persistence
|
|
13496
|
+
} : {},
|
|
13497
|
+
...protection ? { protection } : {}
|
|
13498
|
+
};
|
|
13499
|
+
}) : undefined;
|
|
13500
|
+
const quota = Reflect.get(record, "maxBytesPerNamespace");
|
|
13501
|
+
return {
|
|
13502
|
+
...collections ? { collections } : {},
|
|
13503
|
+
...mutations ? { mutations } : {},
|
|
13504
|
+
...quota === undefined ? {} : {
|
|
13505
|
+
maxBytesPerNamespace: positiveVersion2(quota, id, "localData.maxBytesPerNamespace")
|
|
13506
|
+
}
|
|
13507
|
+
};
|
|
13508
|
+
}, component = (id, value) => {
|
|
13509
|
+
const record = requireObject(value, id, "localSchema must be an object.");
|
|
13510
|
+
const allowed = new Set([
|
|
13511
|
+
"localData",
|
|
13512
|
+
"migrations",
|
|
13513
|
+
"minimumCompatibleVersion",
|
|
13514
|
+
"version"
|
|
13515
|
+
]);
|
|
13516
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13517
|
+
if (unsupported)
|
|
13518
|
+
throw metadataError(id, `${unsupported} is not supported.`);
|
|
13519
|
+
const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
|
|
13520
|
+
const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
|
|
13521
|
+
const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
|
|
13522
|
+
const declaredMigrations = Reflect.get(record, "migrations");
|
|
13523
|
+
const declaredLocalData = Reflect.get(record, "localData");
|
|
13524
|
+
if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
|
|
13525
|
+
throw metadataError(id, "migrations must be an array.");
|
|
13526
|
+
const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
|
|
13527
|
+
return {
|
|
13528
|
+
id,
|
|
13529
|
+
...declaredLocalData === undefined ? {} : { localData: localDataPolicy(declaredLocalData, id) },
|
|
13530
|
+
minimumCompatibleVersion,
|
|
13531
|
+
...Array.isArray(migrations) ? {
|
|
13532
|
+
migrations: migrations.map((entry, index) => migration(entry, id, index))
|
|
13533
|
+
} : {},
|
|
13534
|
+
version
|
|
13535
|
+
};
|
|
13536
|
+
}, dependencyNames = (manifest) => [
|
|
13537
|
+
Reflect.get(manifest, "dependencies"),
|
|
13538
|
+
Reflect.get(manifest, "optionalDependencies"),
|
|
13539
|
+
Reflect.get(manifest, "devDependencies"),
|
|
13540
|
+
Reflect.get(manifest, "peerDependencies")
|
|
13541
|
+
].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
13542
|
+
const appManifestPath = join29(resolve25(projectRoot), "package.json");
|
|
13543
|
+
const appManifest = manifestAt(appManifestPath);
|
|
13544
|
+
if (!appManifest)
|
|
13545
|
+
return {
|
|
13546
|
+
components: [
|
|
13547
|
+
{
|
|
13548
|
+
id: "@absolutejs/app",
|
|
13549
|
+
minimumCompatibleVersion: 1,
|
|
13550
|
+
version: 1
|
|
13551
|
+
}
|
|
13552
|
+
],
|
|
13553
|
+
sources: []
|
|
13554
|
+
};
|
|
13555
|
+
const appMetadata = localSchemaMetadata(appManifest);
|
|
13556
|
+
const components = [
|
|
13557
|
+
appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
|
|
13558
|
+
];
|
|
13559
|
+
const sources = [
|
|
13560
|
+
{ id: "@absolutejs/app", manifestPath: appManifestPath }
|
|
13561
|
+
];
|
|
13562
|
+
for (const name of dependencyNames(appManifest)) {
|
|
13563
|
+
const manifestPath = packageManifestPath(projectRoot, name);
|
|
13564
|
+
if (!manifestPath)
|
|
13565
|
+
continue;
|
|
13566
|
+
const manifest = manifestAt(manifestPath);
|
|
13567
|
+
if (!manifest)
|
|
13568
|
+
continue;
|
|
13569
|
+
const metadata2 = localSchemaMetadata(manifest);
|
|
13570
|
+
if (metadata2 === undefined)
|
|
13571
|
+
continue;
|
|
13572
|
+
components.push(component(name, metadata2));
|
|
13573
|
+
sources.push({ id: name, manifestPath });
|
|
13574
|
+
}
|
|
13575
|
+
components.sort((left, right) => left.id.localeCompare(right.id));
|
|
13576
|
+
sources.sort((left, right) => left.id.localeCompare(right.id));
|
|
13577
|
+
resolveSyncLocalSchemaComponents({}, { components });
|
|
13578
|
+
return { components, sources };
|
|
13579
|
+
};
|
|
13580
|
+
var init_syncSchema = __esm(() => {
|
|
13581
|
+
init_client();
|
|
13582
|
+
});
|
|
13583
|
+
|
|
13201
13584
|
// src/build/pwa.ts
|
|
13202
13585
|
import { mkdir as mkdir8, rm as rm7, writeFile as writeFile8 } from "fs/promises";
|
|
13203
|
-
import { dirname as
|
|
13586
|
+
import { dirname as dirname17, join as join30 } from "path";
|
|
13204
13587
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
13205
13588
|
const input = value ?? fallback;
|
|
13206
13589
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -13227,7 +13610,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
13227
13610
|
}
|
|
13228
13611
|
}
|
|
13229
13612
|
return url.pathname;
|
|
13230
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
13613
|
+
}, destinationFor = (buildPath, publicPath) => join30(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
13231
13614
|
clientModule,
|
|
13232
13615
|
manifestPath,
|
|
13233
13616
|
serviceWorkerPath,
|
|
@@ -13239,7 +13622,7 @@ manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
|
13239
13622
|
if (!manifest.isConnected) document.head.append(manifest);
|
|
13240
13623
|
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
13241
13624
|
deferUntilLoad: false${sync ? `,
|
|
13242
|
-
sync: ${JSON.stringify(sync
|
|
13625
|
+
sync: ${JSON.stringify(sync)}` : ""}
|
|
13243
13626
|
});
|
|
13244
13627
|
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
13245
13628
|
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
@@ -13257,6 +13640,7 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13257
13640
|
buildPath,
|
|
13258
13641
|
config,
|
|
13259
13642
|
generatedRoot,
|
|
13643
|
+
projectRoot,
|
|
13260
13644
|
write: write2 = true
|
|
13261
13645
|
}) => {
|
|
13262
13646
|
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
@@ -13272,9 +13656,10 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13272
13656
|
};
|
|
13273
13657
|
if (!write2)
|
|
13274
13658
|
return artifacts;
|
|
13659
|
+
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
13275
13660
|
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
13276
13661
|
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
13277
|
-
await mkdir8(
|
|
13662
|
+
await mkdir8(dirname17(workerDestination), { recursive: true });
|
|
13278
13663
|
await writeFile8(workerDestination, `${pushServiceWorker({
|
|
13279
13664
|
...config.serviceWorker ?? {},
|
|
13280
13665
|
sync: Boolean(config.sync)
|
|
@@ -13283,19 +13668,24 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13283
13668
|
if (config.manifest && manifestPath) {
|
|
13284
13669
|
const { path: _path, ...manifestConfig } = config.manifest;
|
|
13285
13670
|
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
13286
|
-
await mkdir8(
|
|
13671
|
+
await mkdir8(dirname17(manifestDestination), { recursive: true });
|
|
13287
13672
|
await writeFile8(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
13288
13673
|
`);
|
|
13289
13674
|
}
|
|
13290
|
-
const generatedDirectory =
|
|
13291
|
-
const bootstrapEntry =
|
|
13675
|
+
const generatedDirectory = join30(generatedRoot, "pwa");
|
|
13676
|
+
const bootstrapEntry = join30(generatedDirectory, "bootstrap.ts");
|
|
13292
13677
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
13293
13678
|
await mkdir8(generatedDirectory, { recursive: true });
|
|
13294
13679
|
await writeFile8(bootstrapEntry, bootstrapEntrySource({
|
|
13295
13680
|
clientModule,
|
|
13296
13681
|
manifestPath,
|
|
13297
13682
|
serviceWorkerPath,
|
|
13298
|
-
sync: config.sync
|
|
13683
|
+
sync: config.sync ? {
|
|
13684
|
+
...config.sync === true ? {} : config.sync,
|
|
13685
|
+
storageSchema: {
|
|
13686
|
+
components: syncSchema?.components ?? []
|
|
13687
|
+
}
|
|
13688
|
+
} : config.sync
|
|
13299
13689
|
}));
|
|
13300
13690
|
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
13301
13691
|
await rm7(browserDirectory, { force: true, recursive: true });
|
|
@@ -13318,15 +13708,17 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
13318
13708
|
}
|
|
13319
13709
|
return artifacts;
|
|
13320
13710
|
};
|
|
13321
|
-
var init_pwa = () => {
|
|
13711
|
+
var init_pwa = __esm(() => {
|
|
13712
|
+
init_syncSchema();
|
|
13713
|
+
});
|
|
13322
13714
|
|
|
13323
13715
|
// src/build/scanVueSsrOnlyPages.ts
|
|
13324
13716
|
var exports_scanVueSsrOnlyPages = {};
|
|
13325
13717
|
__export(exports_scanVueSsrOnlyPages, {
|
|
13326
13718
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
13327
13719
|
});
|
|
13328
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
13329
|
-
import { join as
|
|
13720
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync18 } from "fs";
|
|
13721
|
+
import { join as join31 } from "path";
|
|
13330
13722
|
import ts8 from "typescript";
|
|
13331
13723
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
13332
13724
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13359,9 +13751,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13359
13751
|
continue;
|
|
13360
13752
|
if (entry.name.startsWith("."))
|
|
13361
13753
|
continue;
|
|
13362
|
-
stack.push(
|
|
13754
|
+
stack.push(join31(dir, entry.name));
|
|
13363
13755
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
13364
|
-
out.push(
|
|
13756
|
+
out.push(join31(dir, entry.name));
|
|
13365
13757
|
}
|
|
13366
13758
|
}
|
|
13367
13759
|
}
|
|
@@ -13428,7 +13820,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13428
13820
|
}, extractFromFile = (filePath, out) => {
|
|
13429
13821
|
let source;
|
|
13430
13822
|
try {
|
|
13431
|
-
source =
|
|
13823
|
+
source = readFileSync18(filePath, "utf-8");
|
|
13432
13824
|
} catch {
|
|
13433
13825
|
return;
|
|
13434
13826
|
}
|
|
@@ -13472,8 +13864,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13472
13864
|
});
|
|
13473
13865
|
|
|
13474
13866
|
// src/build/scanAngularHandlerCalls.ts
|
|
13475
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
13476
|
-
import { join as
|
|
13867
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync19 } from "fs";
|
|
13868
|
+
import { join as join32 } from "path";
|
|
13477
13869
|
import ts9 from "typescript";
|
|
13478
13870
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13479
13871
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13506,9 +13898,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13506
13898
|
continue;
|
|
13507
13899
|
if (entry.name.startsWith("."))
|
|
13508
13900
|
continue;
|
|
13509
|
-
stack.push(
|
|
13901
|
+
stack.push(join32(dir, entry.name));
|
|
13510
13902
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13511
|
-
out.push(
|
|
13903
|
+
out.push(join32(dir, entry.name));
|
|
13512
13904
|
}
|
|
13513
13905
|
}
|
|
13514
13906
|
}
|
|
@@ -13543,7 +13935,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13543
13935
|
}, extractCallsFromFile = (filePath, out) => {
|
|
13544
13936
|
let source;
|
|
13545
13937
|
try {
|
|
13546
|
-
source =
|
|
13938
|
+
source = readFileSync19(filePath, "utf-8");
|
|
13547
13939
|
} catch {
|
|
13548
13940
|
return;
|
|
13549
13941
|
}
|
|
@@ -13622,8 +14014,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13622
14014
|
});
|
|
13623
14015
|
|
|
13624
14016
|
// src/build/scanAngularPageRoutes.ts
|
|
13625
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
13626
|
-
import { basename as basename9, join as
|
|
14017
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
14018
|
+
import { basename as basename9, join as join33 } from "path";
|
|
13627
14019
|
import ts10 from "typescript";
|
|
13628
14020
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13629
14021
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13663,9 +14055,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13663
14055
|
continue;
|
|
13664
14056
|
if (entry.name.startsWith("."))
|
|
13665
14057
|
continue;
|
|
13666
|
-
stack.push(
|
|
14058
|
+
stack.push(join33(dir, entry.name));
|
|
13667
14059
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13668
|
-
out.push(
|
|
14060
|
+
out.push(join33(dir, entry.name));
|
|
13669
14061
|
}
|
|
13670
14062
|
}
|
|
13671
14063
|
}
|
|
@@ -13694,7 +14086,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13694
14086
|
for (const file2 of files) {
|
|
13695
14087
|
let source;
|
|
13696
14088
|
try {
|
|
13697
|
-
source =
|
|
14089
|
+
source = readFileSync20(file2, "utf-8");
|
|
13698
14090
|
} catch {
|
|
13699
14091
|
continue;
|
|
13700
14092
|
}
|
|
@@ -13741,8 +14133,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
13741
14133
|
__export(exports_parseAngularConfigImports, {
|
|
13742
14134
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13743
14135
|
});
|
|
13744
|
-
import { existsSync as existsSync23, readFileSync as
|
|
13745
|
-
import { dirname as
|
|
14136
|
+
import { existsSync as existsSync23, readFileSync as readFileSync21 } from "fs";
|
|
14137
|
+
import { dirname as dirname18, isAbsolute as isAbsolute3, join as join34 } from "path";
|
|
13746
14138
|
import ts11 from "typescript";
|
|
13747
14139
|
var findDefineConfigCall = (sf) => {
|
|
13748
14140
|
let result = null;
|
|
@@ -13760,8 +14152,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13760
14152
|
};
|
|
13761
14153
|
ts11.forEachChild(sf, visit);
|
|
13762
14154
|
return result;
|
|
13763
|
-
}, findPropertyInitializer = (
|
|
13764
|
-
for (const prop of
|
|
14155
|
+
}, findPropertyInitializer = (object2, name) => {
|
|
14156
|
+
for (const prop of object2.properties) {
|
|
13765
14157
|
if (!ts11.isPropertyAssignment(prop))
|
|
13766
14158
|
continue;
|
|
13767
14159
|
if (!prop.name)
|
|
@@ -13797,15 +14189,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13797
14189
|
}, resolveConfigPath = (projectRoot) => {
|
|
13798
14190
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13799
14191
|
if (envOverride) {
|
|
13800
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
14192
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join34(projectRoot, envOverride);
|
|
13801
14193
|
if (existsSync23(resolved))
|
|
13802
14194
|
return resolved;
|
|
13803
14195
|
}
|
|
13804
14196
|
const candidates = [
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
14197
|
+
join34(projectRoot, "absolute.config.ts"),
|
|
14198
|
+
join34(projectRoot, "absolute.config.mts"),
|
|
14199
|
+
join34(projectRoot, "absolute.config.js"),
|
|
14200
|
+
join34(projectRoot, "absolute.config.mjs")
|
|
13809
14201
|
];
|
|
13810
14202
|
for (const candidate of candidates) {
|
|
13811
14203
|
if (existsSync23(candidate))
|
|
@@ -13816,7 +14208,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
13816
14208
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
13817
14209
|
if (!configPath2)
|
|
13818
14210
|
return null;
|
|
13819
|
-
const source =
|
|
14211
|
+
const source = readFileSync21(configPath2, "utf-8");
|
|
13820
14212
|
if (!source.includes("angular"))
|
|
13821
14213
|
return null;
|
|
13822
14214
|
if (!source.includes("providers"))
|
|
@@ -13837,8 +14229,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13837
14229
|
const importInfo = findImportForBinding(sf, binding);
|
|
13838
14230
|
if (!importInfo)
|
|
13839
14231
|
return null;
|
|
13840
|
-
const configDir2 =
|
|
13841
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
14232
|
+
const configDir2 = dirname18(configPath2);
|
|
14233
|
+
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
14234
|
return {
|
|
13843
14235
|
absolutePath,
|
|
13844
14236
|
bindingName: binding,
|
|
@@ -13853,7 +14245,7 @@ __export(exports_renderToReadableStream, {
|
|
|
13853
14245
|
renderToReadableStream: () => renderToReadableStream,
|
|
13854
14246
|
SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
|
|
13855
14247
|
});
|
|
13856
|
-
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (
|
|
14248
|
+
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
|
|
13857
14249
|
bootstrapScriptContent,
|
|
13858
14250
|
bootstrapScripts = [],
|
|
13859
14251
|
bootstrapModules = [],
|
|
@@ -13867,7 +14259,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
13867
14259
|
try {
|
|
13868
14260
|
const { render } = await import("svelte/server");
|
|
13869
14261
|
const renderComponent = render;
|
|
13870
|
-
const rendered = typeof props === "undefined" ? await renderComponent(
|
|
14262
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
|
|
13871
14263
|
const { head, body } = rendered;
|
|
13872
14264
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
13873
14265
|
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 +14304,11 @@ __export(exports_compileSvelte, {
|
|
|
13912
14304
|
import { existsSync as existsSync24 } from "fs";
|
|
13913
14305
|
import { mkdir as mkdir9, stat as stat2 } from "fs/promises";
|
|
13914
14306
|
import {
|
|
13915
|
-
dirname as
|
|
13916
|
-
join as
|
|
14307
|
+
dirname as dirname19,
|
|
14308
|
+
join as join35,
|
|
13917
14309
|
basename as basename10,
|
|
13918
14310
|
extname as extname7,
|
|
13919
|
-
resolve as
|
|
14311
|
+
resolve as resolve26,
|
|
13920
14312
|
relative as relative11,
|
|
13921
14313
|
sep as sep2
|
|
13922
14314
|
} from "path";
|
|
@@ -13924,14 +14316,14 @@ import { env as env2 } from "process";
|
|
|
13924
14316
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13925
14317
|
var resolveDevClientDir2 = () => {
|
|
13926
14318
|
const projectRoot = process.cwd();
|
|
13927
|
-
const fromSource =
|
|
14319
|
+
const fromSource = resolve26(import.meta.dir, "../dev/client");
|
|
13928
14320
|
if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13929
14321
|
return fromSource;
|
|
13930
14322
|
}
|
|
13931
|
-
const fromNodeModules =
|
|
14323
|
+
const fromNodeModules = resolve26(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13932
14324
|
if (existsSync24(fromNodeModules))
|
|
13933
14325
|
return fromNodeModules;
|
|
13934
|
-
return
|
|
14326
|
+
return resolve26(import.meta.dir, "./dev/client");
|
|
13935
14327
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13936
14328
|
persistentCache.clear();
|
|
13937
14329
|
sourceHashCache.clear();
|
|
@@ -13961,7 +14353,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13961
14353
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13962
14354
|
if (!spec.startsWith("."))
|
|
13963
14355
|
return null;
|
|
13964
|
-
const basePath =
|
|
14356
|
+
const basePath = resolve26(dirname19(from), spec);
|
|
13965
14357
|
const candidates = [
|
|
13966
14358
|
basePath,
|
|
13967
14359
|
`${basePath}.ts`,
|
|
@@ -13972,14 +14364,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13972
14364
|
`${basePath}.svelte`,
|
|
13973
14365
|
`${basePath}.svelte.ts`,
|
|
13974
14366
|
`${basePath}.svelte.js`,
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
14367
|
+
join35(basePath, "index.ts"),
|
|
14368
|
+
join35(basePath, "index.js"),
|
|
14369
|
+
join35(basePath, "index.mjs"),
|
|
14370
|
+
join35(basePath, "index.cjs"),
|
|
14371
|
+
join35(basePath, "index.json"),
|
|
14372
|
+
join35(basePath, "index.svelte"),
|
|
14373
|
+
join35(basePath, "index.svelte.ts"),
|
|
14374
|
+
join35(basePath, "index.svelte.js")
|
|
13983
14375
|
];
|
|
13984
14376
|
const checks = await Promise.all(candidates.map(exists2));
|
|
13985
14377
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13988,7 +14380,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13988
14380
|
const resolved = resolvePackageImport(spec);
|
|
13989
14381
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13990
14382
|
}
|
|
13991
|
-
const basePath =
|
|
14383
|
+
const basePath = resolve26(dirname19(from), spec);
|
|
13992
14384
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13993
14385
|
if (!explicit) {
|
|
13994
14386
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -14018,9 +14410,9 @@ var resolveDevClientDir2 = () => {
|
|
|
14018
14410
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
14019
14411
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
14020
14412
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
14021
|
-
const clientDir =
|
|
14022
|
-
const indexDir =
|
|
14023
|
-
const serverDir =
|
|
14413
|
+
const clientDir = join35(generatedDir, "client");
|
|
14414
|
+
const indexDir = join35(generatedDir, "indexes");
|
|
14415
|
+
const serverDir = join35(generatedDir, "server");
|
|
14024
14416
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir9(dir, { recursive: true })));
|
|
14025
14417
|
const dev = env2.NODE_ENV !== "production";
|
|
14026
14418
|
const build2 = async (src) => {
|
|
@@ -14048,8 +14440,8 @@ var resolveDevClientDir2 = () => {
|
|
|
14048
14440
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
14049
14441
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
14050
14442
|
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(),
|
|
14443
|
+
const rawRel = dirname19(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
14444
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname19(src)).replace(/\\/g, "/")}` : rawRel;
|
|
14053
14445
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14054
14446
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
14055
14447
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -14058,8 +14450,8 @@ var resolveDevClientDir2 = () => {
|
|
|
14058
14450
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
14059
14451
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
14060
14452
|
const externalRewrites = new Map;
|
|
14061
|
-
const ssrOutputDir =
|
|
14062
|
-
const clientOutputDir =
|
|
14453
|
+
const ssrOutputDir = dirname19(join35(serverDir, relDir, `${baseName}.js`));
|
|
14454
|
+
const clientOutputDir = dirname19(join35(clientDir, relDir, `${baseName}.js`));
|
|
14063
14455
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
14064
14456
|
const rawSpec = importPaths[idx];
|
|
14065
14457
|
if (!rawSpec)
|
|
@@ -14124,11 +14516,11 @@ var resolveDevClientDir2 = () => {
|
|
|
14124
14516
|
code += islandMetadataExports;
|
|
14125
14517
|
return { code, map: compiledJs.map };
|
|
14126
14518
|
};
|
|
14127
|
-
const ssrPath =
|
|
14128
|
-
const clientPath =
|
|
14519
|
+
const ssrPath = join35(serverDir, relDir, `${baseName}.js`);
|
|
14520
|
+
const clientPath = join35(clientDir, relDir, `${baseName}.js`);
|
|
14129
14521
|
await Promise.all([
|
|
14130
|
-
mkdir9(
|
|
14131
|
-
mkdir9(
|
|
14522
|
+
mkdir9(dirname19(ssrPath), { recursive: true }),
|
|
14523
|
+
mkdir9(dirname19(clientPath), { recursive: true })
|
|
14132
14524
|
]);
|
|
14133
14525
|
const inlineMap = (map) => map ? `
|
|
14134
14526
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -14163,10 +14555,10 @@ var resolveDevClientDir2 = () => {
|
|
|
14163
14555
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
14164
14556
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
14165
14557
|
await Promise.all(componentRoots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
14166
|
-
const relClientDir =
|
|
14558
|
+
const relClientDir = dirname19(relative11(clientDir, client2));
|
|
14167
14559
|
const name = basename10(client2, extname7(client2));
|
|
14168
|
-
const indexPath =
|
|
14169
|
-
const importRaw = relative11(
|
|
14560
|
+
const indexPath = join35(indexDir, relClientDir, `${name}.js`);
|
|
14561
|
+
const importRaw = relative11(dirname19(indexPath), client2).split(sep2).join("/");
|
|
14170
14562
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
14171
14563
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
14172
14564
|
import "${hmrClientPath3}";
|
|
@@ -14255,14 +14647,14 @@ if (typeof window !== "undefined") {
|
|
|
14255
14647
|
setTimeout(releaseStreamingSlots, 0);
|
|
14256
14648
|
}
|
|
14257
14649
|
}`;
|
|
14258
|
-
await mkdir9(
|
|
14650
|
+
await mkdir9(dirname19(indexPath), { recursive: true });
|
|
14259
14651
|
return write2(indexPath, bootstrap);
|
|
14260
14652
|
}));
|
|
14261
14653
|
return {
|
|
14262
14654
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
14263
14655
|
svelteIndexPaths: componentRoots.map(({ client: client2 }) => {
|
|
14264
|
-
const rel =
|
|
14265
|
-
return
|
|
14656
|
+
const rel = dirname19(relative11(clientDir, client2));
|
|
14657
|
+
return join35(indexDir, rel, basename10(client2));
|
|
14266
14658
|
}),
|
|
14267
14659
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
14268
14660
|
};
|
|
@@ -14277,7 +14669,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
14277
14669
|
init_lowerAwaitSlotSyntax();
|
|
14278
14670
|
init_renderToReadableStream();
|
|
14279
14671
|
devClientDir2 = resolveDevClientDir2();
|
|
14280
|
-
hmrClientPath3 =
|
|
14672
|
+
hmrClientPath3 = join35(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
14281
14673
|
persistentCache = new Map;
|
|
14282
14674
|
sourceHashCache = new Map;
|
|
14283
14675
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -14344,7 +14736,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
14344
14736
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
14345
14737
|
buildLineRemap: () => buildLineRemap
|
|
14346
14738
|
});
|
|
14347
|
-
import { readFileSync as
|
|
14739
|
+
import { readFileSync as readFileSync22, writeFileSync as writeFileSync8 } from "fs";
|
|
14348
14740
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
14349
14741
|
let result = 0;
|
|
14350
14742
|
let shift = 0;
|
|
@@ -14635,7 +15027,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14635
15027
|
version: 3
|
|
14636
15028
|
};
|
|
14637
15029
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
14638
|
-
const text =
|
|
15030
|
+
const text = readFileSync22(bundleFilePath, "utf-8");
|
|
14639
15031
|
const outerMap = extractInlineMap(text);
|
|
14640
15032
|
if (!outerMap)
|
|
14641
15033
|
return;
|
|
@@ -14655,7 +15047,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14655
15047
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
14656
15048
|
let outerMap;
|
|
14657
15049
|
try {
|
|
14658
|
-
outerMap = JSON.parse(
|
|
15050
|
+
outerMap = JSON.parse(readFileSync22(mapFilePath, "utf-8"));
|
|
14659
15051
|
} catch {
|
|
14660
15052
|
return;
|
|
14661
15053
|
}
|
|
@@ -14754,27 +15146,27 @@ __export(exports_compileVue, {
|
|
|
14754
15146
|
compileVue: () => compileVue,
|
|
14755
15147
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14756
15148
|
});
|
|
14757
|
-
import { existsSync as existsSync25, readFileSync as
|
|
15149
|
+
import { existsSync as existsSync25, readFileSync as readFileSync23, realpathSync as realpathSync2 } from "fs";
|
|
14758
15150
|
import { mkdir as mkdir10 } from "fs/promises";
|
|
14759
15151
|
import {
|
|
14760
15152
|
basename as basename11,
|
|
14761
|
-
dirname as
|
|
15153
|
+
dirname as dirname20,
|
|
14762
15154
|
isAbsolute as isAbsolute4,
|
|
14763
|
-
join as
|
|
15155
|
+
join as join36,
|
|
14764
15156
|
relative as relative12,
|
|
14765
|
-
resolve as
|
|
15157
|
+
resolve as resolve27
|
|
14766
15158
|
} from "path";
|
|
14767
15159
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14768
15160
|
var resolveDevClientDir3 = () => {
|
|
14769
15161
|
const projectRoot = process.cwd();
|
|
14770
|
-
const fromSource =
|
|
15162
|
+
const fromSource = resolve27(import.meta.dir, "../dev/client");
|
|
14771
15163
|
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14772
15164
|
return fromSource;
|
|
14773
15165
|
}
|
|
14774
|
-
const fromNodeModules =
|
|
15166
|
+
const fromNodeModules = resolve27(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14775
15167
|
if (existsSync25(fromNodeModules))
|
|
14776
15168
|
return fromNodeModules;
|
|
14777
|
-
return
|
|
15169
|
+
return resolve27(import.meta.dir, "./dev/client");
|
|
14778
15170
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14779
15171
|
scriptCache.clear();
|
|
14780
15172
|
scriptSetupCache.clear();
|
|
@@ -14824,19 +15216,19 @@ var resolveDevClientDir3 = () => {
|
|
|
14824
15216
|
visited.add(resolved);
|
|
14825
15217
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14826
15218
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14827
|
-
const importedPath =
|
|
15219
|
+
const importedPath = resolve27(dirname20(cssFilePath), relPath);
|
|
14828
15220
|
if (!existsSync25(importedPath))
|
|
14829
15221
|
return match;
|
|
14830
|
-
const importedContent =
|
|
15222
|
+
const importedContent = readFileSync23(importedPath, "utf-8");
|
|
14831
15223
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
14832
15224
|
});
|
|
14833
15225
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14834
15226
|
if (helper.endsWith(".ts"))
|
|
14835
|
-
return
|
|
14836
|
-
const direct =
|
|
15227
|
+
return resolve27(sourceDir, helper);
|
|
15228
|
+
const direct = resolve27(sourceDir, `${helper}.ts`);
|
|
14837
15229
|
if (existsSync25(direct))
|
|
14838
15230
|
return direct;
|
|
14839
|
-
const indexed =
|
|
15231
|
+
const indexed = resolve27(sourceDir, helper, "index.ts");
|
|
14840
15232
|
if (existsSync25(indexed))
|
|
14841
15233
|
return indexed;
|
|
14842
15234
|
return direct;
|
|
@@ -14847,15 +15239,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14847
15239
|
return filePath.replace(/\.ts$/, ".js");
|
|
14848
15240
|
if (isStylePath(filePath)) {
|
|
14849
15241
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14850
|
-
return
|
|
15242
|
+
return resolve27(sourceDir, filePath);
|
|
14851
15243
|
}
|
|
14852
15244
|
return filePath;
|
|
14853
15245
|
}
|
|
14854
15246
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14855
|
-
const directTs =
|
|
15247
|
+
const directTs = resolve27(sourceDir, `${filePath}.ts`);
|
|
14856
15248
|
if (existsSync25(directTs))
|
|
14857
15249
|
return `${filePath}.js`;
|
|
14858
|
-
const indexedTs =
|
|
15250
|
+
const indexedTs = resolve27(sourceDir, filePath, "index.ts");
|
|
14859
15251
|
if (existsSync25(indexedTs))
|
|
14860
15252
|
return `${filePath}/index.js`;
|
|
14861
15253
|
}
|
|
@@ -14946,19 +15338,19 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14946
15338
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14947
15339
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14948
15340
|
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 :
|
|
15341
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve27(dirname20(sourceFilePath), path));
|
|
14950
15342
|
for (const stylePath of stylePathsImported) {
|
|
14951
15343
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14952
15344
|
}
|
|
14953
15345
|
const childBuildResults = await Promise.all([
|
|
14954
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
15346
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve27(dirname20(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14955
15347
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14956
15348
|
]);
|
|
14957
15349
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
14958
15350
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
14959
15351
|
fs: {
|
|
14960
15352
|
fileExists: existsSync25,
|
|
14961
|
-
readFile: (file4) => existsSync25(file4) ?
|
|
15353
|
+
readFile: (file4) => existsSync25(file4) ? readFileSync23(file4, "utf-8") : undefined,
|
|
14962
15354
|
realpath: realpathSync2
|
|
14963
15355
|
},
|
|
14964
15356
|
id: componentId,
|
|
@@ -14966,7 +15358,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14966
15358
|
sourceMap: true
|
|
14967
15359
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14968
15360
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14969
|
-
const sourceDir =
|
|
15361
|
+
const sourceDir = dirname20(sourceFilePath);
|
|
14970
15362
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14971
15363
|
const packageImportRewrites = new Map;
|
|
14972
15364
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -15011,8 +15403,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15011
15403
|
];
|
|
15012
15404
|
let cssOutputPaths = [];
|
|
15013
15405
|
if (isEntryPoint && allCss.length) {
|
|
15014
|
-
const cssOutputFile =
|
|
15015
|
-
await mkdir10(
|
|
15406
|
+
const cssOutputFile = join36(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15407
|
+
await mkdir10(dirname20(cssOutputFile), { recursive: true });
|
|
15016
15408
|
await write3(cssOutputFile, allCss.join(`
|
|
15017
15409
|
`));
|
|
15018
15410
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -15042,21 +15434,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15042
15434
|
};
|
|
15043
15435
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
15044
15436
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
15045
|
-
const clientOutputPath =
|
|
15046
|
-
const serverOutputPath =
|
|
15437
|
+
const clientOutputPath = join36(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15438
|
+
const serverOutputPath = join36(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
15047
15439
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
15048
15440
|
let result2 = code;
|
|
15049
15441
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
15050
15442
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
15051
|
-
let rel = relative12(
|
|
15443
|
+
let rel = relative12(dirname20(outputPath), targetPath).replace(/\\/g, "/");
|
|
15052
15444
|
if (!rel.startsWith("."))
|
|
15053
15445
|
rel = `./${rel}`;
|
|
15054
15446
|
result2 = result2.replaceAll(bareImport, rel);
|
|
15055
15447
|
}
|
|
15056
15448
|
return result2;
|
|
15057
15449
|
};
|
|
15058
|
-
await mkdir10(
|
|
15059
|
-
await mkdir10(
|
|
15450
|
+
await mkdir10(dirname20(clientOutputPath), { recursive: true });
|
|
15451
|
+
await mkdir10(dirname20(serverOutputPath), { recursive: true });
|
|
15060
15452
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
15061
15453
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
15062
15454
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -15079,7 +15471,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15079
15471
|
serverPath: serverOutputPath,
|
|
15080
15472
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
15081
15473
|
tsHelperPaths: [
|
|
15082
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
15474
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname20(sourceFilePath), helper)),
|
|
15083
15475
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
15084
15476
|
]
|
|
15085
15477
|
};
|
|
@@ -15089,10 +15481,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15089
15481
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
15090
15482
|
const compiler = await loadVueCompiler();
|
|
15091
15483
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
15092
|
-
const clientOutputDir =
|
|
15093
|
-
const indexOutputDir =
|
|
15094
|
-
const serverOutputDir =
|
|
15095
|
-
const cssOutputDir =
|
|
15484
|
+
const clientOutputDir = join36(generatedDir, "client");
|
|
15485
|
+
const indexOutputDir = join36(generatedDir, "indexes");
|
|
15486
|
+
const serverOutputDir = join36(generatedDir, "server");
|
|
15487
|
+
const cssOutputDir = join36(generatedDir, "compiled");
|
|
15096
15488
|
await Promise.all([
|
|
15097
15489
|
mkdir10(clientOutputDir, { recursive: true }),
|
|
15098
15490
|
mkdir10(indexOutputDir, { recursive: true }),
|
|
@@ -15102,7 +15494,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15102
15494
|
const buildCache = new Map;
|
|
15103
15495
|
const allTsHelperPaths = new Set;
|
|
15104
15496
|
const expandSpaRouteChildren = async (entries) => {
|
|
15105
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15497
|
+
const expanded = new Set(entries.map((entry) => resolve27(entry)));
|
|
15106
15498
|
const queue2 = [...expanded];
|
|
15107
15499
|
while (queue2.length > 0) {
|
|
15108
15500
|
const entryPath = queue2.pop();
|
|
@@ -15119,7 +15511,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15119
15511
|
});
|
|
15120
15512
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
15121
15513
|
for (const { importPath } of routes) {
|
|
15122
|
-
const childPath =
|
|
15514
|
+
const childPath = resolve27(dirname20(entryPath), importPath);
|
|
15123
15515
|
if (expanded.has(childPath) || !existsSync25(childPath)) {
|
|
15124
15516
|
continue;
|
|
15125
15517
|
}
|
|
@@ -15131,7 +15523,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15131
15523
|
};
|
|
15132
15524
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
15133
15525
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
15134
|
-
const resolvedEntryPath =
|
|
15526
|
+
const resolvedEntryPath = resolve27(entryPath);
|
|
15135
15527
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
15136
15528
|
client: clientOutputDir,
|
|
15137
15529
|
css: cssOutputDir,
|
|
@@ -15149,16 +15541,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15149
15541
|
};
|
|
15150
15542
|
}
|
|
15151
15543
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
15152
|
-
const indexOutputFile =
|
|
15153
|
-
const clientOutputFile =
|
|
15154
|
-
await mkdir10(
|
|
15544
|
+
const indexOutputFile = join36(indexOutputDir, `${entryBaseName}.js`);
|
|
15545
|
+
const clientOutputFile = join36(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15546
|
+
await mkdir10(dirname20(indexOutputFile), { recursive: true });
|
|
15155
15547
|
const vueHmrImports = isDev2 ? [
|
|
15156
15548
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
15157
15549
|
`import "${hmrClientPath4}";`
|
|
15158
15550
|
] : [];
|
|
15159
15551
|
await write3(indexOutputFile, [
|
|
15160
15552
|
...vueHmrImports,
|
|
15161
|
-
`import Comp, * as PageModule from "${relative12(
|
|
15553
|
+
`import Comp, * as PageModule from "${relative12(dirname20(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
15162
15554
|
'import { createSSRApp, createApp } from "vue";',
|
|
15163
15555
|
"",
|
|
15164
15556
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -15320,7 +15712,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15320
15712
|
if (!tsPath)
|
|
15321
15713
|
continue;
|
|
15322
15714
|
const sourceCode = await file3(tsPath).text();
|
|
15323
|
-
const helperDir =
|
|
15715
|
+
const helperDir = dirname20(tsPath);
|
|
15324
15716
|
for (const dep of extractImports(sourceCode)) {
|
|
15325
15717
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
15326
15718
|
continue;
|
|
@@ -15339,10 +15731,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15339
15731
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
15340
15732
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
15341
15733
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15342
|
-
const outClientPath =
|
|
15343
|
-
const outServerPath =
|
|
15344
|
-
await mkdir10(
|
|
15345
|
-
await mkdir10(
|
|
15734
|
+
const outClientPath = join36(clientOutputDir, relativeJsPath);
|
|
15735
|
+
const outServerPath = join36(serverOutputDir, relativeJsPath);
|
|
15736
|
+
await mkdir10(dirname20(outClientPath), { recursive: true });
|
|
15737
|
+
await mkdir10(dirname20(outServerPath), { recursive: true });
|
|
15346
15738
|
await write3(outClientPath, withMap);
|
|
15347
15739
|
await write3(outServerPath, withMap);
|
|
15348
15740
|
}));
|
|
@@ -15372,7 +15764,7 @@ var init_compileVue = __esm(() => {
|
|
|
15372
15764
|
init_vueAutoRouterTransform();
|
|
15373
15765
|
init_stylePreprocessor();
|
|
15374
15766
|
devClientDir3 = resolveDevClientDir3();
|
|
15375
|
-
hmrClientPath4 =
|
|
15767
|
+
hmrClientPath4 = join36(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
15376
15768
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
15377
15769
|
scriptCache = new Map;
|
|
15378
15770
|
scriptSetupCache = new Map;
|
|
@@ -15853,8 +16245,8 @@ __export(exports_compileAngular, {
|
|
|
15853
16245
|
compileAngularFile: () => compileAngularFile,
|
|
15854
16246
|
compileAngular: () => compileAngular
|
|
15855
16247
|
});
|
|
15856
|
-
import { existsSync as existsSync26, readFileSync as
|
|
15857
|
-
import { join as
|
|
16248
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, promises as fs5 } from "fs";
|
|
16249
|
+
import { join as join37, basename as basename12, sep as sep3, dirname as dirname21, resolve as resolve28, relative as relative13 } from "path";
|
|
15858
16250
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15859
16251
|
import ts13 from "typescript";
|
|
15860
16252
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -15862,10 +16254,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15862
16254
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
15863
16255
|
}, readTsconfigPathAliases = () => {
|
|
15864
16256
|
try {
|
|
15865
|
-
const configPath2 =
|
|
16257
|
+
const configPath2 = resolve28(process.cwd(), "tsconfig.json");
|
|
15866
16258
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15867
16259
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15868
|
-
const baseUrl =
|
|
16260
|
+
const baseUrl = resolve28(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15869
16261
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15870
16262
|
return { aliases, baseUrl };
|
|
15871
16263
|
} catch {
|
|
@@ -15885,7 +16277,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15885
16277
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15886
16278
|
for (const replacement of alias.replacements) {
|
|
15887
16279
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15888
|
-
const resolved = resolveSourceFile(
|
|
16280
|
+
const resolved = resolveSourceFile(resolve28(baseUrl, candidate));
|
|
15889
16281
|
if (resolved)
|
|
15890
16282
|
return resolved;
|
|
15891
16283
|
}
|
|
@@ -15897,20 +16289,20 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15897
16289
|
`${candidate}.tsx`,
|
|
15898
16290
|
`${candidate}.js`,
|
|
15899
16291
|
`${candidate}.jsx`,
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
16292
|
+
join37(candidate, "index.ts"),
|
|
16293
|
+
join37(candidate, "index.tsx"),
|
|
16294
|
+
join37(candidate, "index.js"),
|
|
16295
|
+
join37(candidate, "index.jsx")
|
|
15904
16296
|
];
|
|
15905
16297
|
return candidates.find((file4) => existsSync26(file4));
|
|
15906
16298
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15907
|
-
const baseDir =
|
|
16299
|
+
const baseDir = resolve28(rootDir);
|
|
15908
16300
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15909
16301
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15910
16302
|
const scanCache = new Map;
|
|
15911
16303
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15912
16304
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15913
|
-
return resolveSourceFile(
|
|
16305
|
+
return resolveSourceFile(resolve28(fromDir, specifier));
|
|
15914
16306
|
}
|
|
15915
16307
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15916
16308
|
if (aliased)
|
|
@@ -15919,7 +16311,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15919
16311
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15920
16312
|
if (resolved.includes("/node_modules/"))
|
|
15921
16313
|
return;
|
|
15922
|
-
const absolute =
|
|
16314
|
+
const absolute = resolve28(resolved);
|
|
15923
16315
|
if (!absolute.startsWith(baseDir))
|
|
15924
16316
|
return;
|
|
15925
16317
|
return resolveSourceFile(absolute);
|
|
@@ -15935,7 +16327,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15935
16327
|
usesLegacyAnimations: false
|
|
15936
16328
|
});
|
|
15937
16329
|
}
|
|
15938
|
-
const resolved =
|
|
16330
|
+
const resolved = resolve28(actualPath);
|
|
15939
16331
|
const cached = scanCache.get(resolved);
|
|
15940
16332
|
if (cached)
|
|
15941
16333
|
return cached;
|
|
@@ -15964,7 +16356,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15964
16356
|
const actualPath = resolveSourceFile(filePath);
|
|
15965
16357
|
if (!actualPath)
|
|
15966
16358
|
return false;
|
|
15967
|
-
const resolved =
|
|
16359
|
+
const resolved = resolve28(actualPath);
|
|
15968
16360
|
if (visited.has(resolved))
|
|
15969
16361
|
return false;
|
|
15970
16362
|
visited.add(resolved);
|
|
@@ -15972,7 +16364,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15972
16364
|
if (scan.usesLegacyAnimations)
|
|
15973
16365
|
return true;
|
|
15974
16366
|
for (const specifier of scan.imports) {
|
|
15975
|
-
const importedPath = resolveLocalImport(specifier,
|
|
16367
|
+
const importedPath = resolveLocalImport(specifier, dirname21(resolved));
|
|
15976
16368
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15977
16369
|
return true;
|
|
15978
16370
|
}
|
|
@@ -15982,14 +16374,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
15982
16374
|
return (entryPath) => visit(entryPath);
|
|
15983
16375
|
}, resolveDevClientDir4 = () => {
|
|
15984
16376
|
const projectRoot = process.cwd();
|
|
15985
|
-
const fromSource =
|
|
16377
|
+
const fromSource = resolve28(import.meta.dir, "../dev/client");
|
|
15986
16378
|
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15987
16379
|
return fromSource;
|
|
15988
16380
|
}
|
|
15989
|
-
const fromNodeModules =
|
|
16381
|
+
const fromNodeModules = resolve28(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15990
16382
|
if (existsSync26(fromNodeModules))
|
|
15991
16383
|
return fromNodeModules;
|
|
15992
|
-
return
|
|
16384
|
+
return resolve28(import.meta.dir, "./dev/client");
|
|
15993
16385
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15994
16386
|
try {
|
|
15995
16387
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -16031,12 +16423,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16031
16423
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
16032
16424
|
if (hasJsLikeExtension(path))
|
|
16033
16425
|
return `${path}${query}`;
|
|
16034
|
-
const importerDir =
|
|
16035
|
-
const fileCandidate =
|
|
16426
|
+
const importerDir = dirname21(importerOutputPath);
|
|
16427
|
+
const fileCandidate = resolve28(importerDir, `${path}.js`);
|
|
16036
16428
|
if (outputFiles?.has(fileCandidate) || existsSync26(fileCandidate)) {
|
|
16037
16429
|
return `${path}.js${query}`;
|
|
16038
16430
|
}
|
|
16039
|
-
const indexCandidate =
|
|
16431
|
+
const indexCandidate = resolve28(importerDir, path, "index.js");
|
|
16040
16432
|
if (outputFiles?.has(indexCandidate) || existsSync26(indexCandidate)) {
|
|
16041
16433
|
return `${path}/index.js${query}`;
|
|
16042
16434
|
}
|
|
@@ -16064,18 +16456,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16064
16456
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
16065
16457
|
if (!isRelativeModuleSpecifier(specifier))
|
|
16066
16458
|
return null;
|
|
16067
|
-
const basePath =
|
|
16459
|
+
const basePath = resolve28(dirname21(fromFile), specifier);
|
|
16068
16460
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
16069
16461
|
`${basePath}.ts`,
|
|
16070
16462
|
`${basePath}.tsx`,
|
|
16071
16463
|
`${basePath}.mts`,
|
|
16072
16464
|
`${basePath}.cts`,
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16465
|
+
join37(basePath, "index.ts"),
|
|
16466
|
+
join37(basePath, "index.tsx"),
|
|
16467
|
+
join37(basePath, "index.mts"),
|
|
16468
|
+
join37(basePath, "index.cts")
|
|
16077
16469
|
];
|
|
16078
|
-
return candidates.map((candidate) =>
|
|
16470
|
+
return candidates.map((candidate) => resolve28(candidate)).find((candidate) => existsSync26(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
16079
16471
|
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
16080
16472
|
const hostSource = readFile9?.(fileName);
|
|
16081
16473
|
if (typeof hostSource === "string")
|
|
@@ -16099,18 +16491,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16099
16491
|
const paths = [];
|
|
16100
16492
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16101
16493
|
if (templateUrlMatch?.[1])
|
|
16102
|
-
paths.push(
|
|
16494
|
+
paths.push(join37(fileDir, templateUrlMatch[1]));
|
|
16103
16495
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16104
16496
|
if (styleUrlMatch?.[1])
|
|
16105
|
-
paths.push(
|
|
16497
|
+
paths.push(join37(fileDir, styleUrlMatch[1]));
|
|
16106
16498
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
16107
16499
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
16108
16500
|
if (urlMatches) {
|
|
16109
16501
|
for (const urlMatch of urlMatches) {
|
|
16110
|
-
paths.push(
|
|
16502
|
+
paths.push(join37(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
16111
16503
|
}
|
|
16112
16504
|
}
|
|
16113
|
-
return paths.map((path) =>
|
|
16505
|
+
return paths.map((path) => resolve28(path));
|
|
16114
16506
|
}, readResourceCacheFile = async (cachePath) => {
|
|
16115
16507
|
try {
|
|
16116
16508
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -16122,13 +16514,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16122
16514
|
return null;
|
|
16123
16515
|
}
|
|
16124
16516
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
16125
|
-
await fs5.mkdir(
|
|
16517
|
+
await fs5.mkdir(dirname21(cachePath), { recursive: true });
|
|
16126
16518
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
16127
16519
|
source,
|
|
16128
16520
|
version: 1
|
|
16129
16521
|
}), "utf-8");
|
|
16130
16522
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
16131
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
16523
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname21(filePath));
|
|
16132
16524
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
16133
16525
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
16134
16526
|
return `${resourcePath}\x00${content}`;
|
|
@@ -16141,7 +16533,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16141
16533
|
safeStableStringify(stylePreprocessors ?? null)
|
|
16142
16534
|
].join("\x00");
|
|
16143
16535
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
16144
|
-
return
|
|
16536
|
+
return join37(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
16145
16537
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile9, stylePreprocessors) => {
|
|
16146
16538
|
const transformedSources = new Map;
|
|
16147
16539
|
const visited = new Set;
|
|
@@ -16152,7 +16544,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16152
16544
|
transformedFiles: 0
|
|
16153
16545
|
};
|
|
16154
16546
|
const transformFile = async (filePath) => {
|
|
16155
|
-
const resolvedPath =
|
|
16547
|
+
const resolvedPath = resolve28(filePath);
|
|
16156
16548
|
if (visited.has(resolvedPath))
|
|
16157
16549
|
return;
|
|
16158
16550
|
visited.add(resolvedPath);
|
|
@@ -16168,7 +16560,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16168
16560
|
transformedSource = cached.source;
|
|
16169
16561
|
} else {
|
|
16170
16562
|
stats.cacheMisses += 1;
|
|
16171
|
-
const transformed = await inlineResources(source,
|
|
16563
|
+
const transformed = await inlineResources(source, dirname21(resolvedPath), stylePreprocessors);
|
|
16172
16564
|
transformedSource = transformed.source;
|
|
16173
16565
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
16174
16566
|
}
|
|
@@ -16187,18 +16579,18 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16187
16579
|
return { stats, transformedSources };
|
|
16188
16580
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
16189
16581
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
16190
|
-
const outputPath =
|
|
16582
|
+
const outputPath = resolve28(join37(outDir, relative13(process.cwd(), resolve28(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
16191
16583
|
return [
|
|
16192
16584
|
outputPath,
|
|
16193
|
-
buildIslandMetadataExports(
|
|
16585
|
+
buildIslandMetadataExports(readFileSync24(inputPath, "utf-8"))
|
|
16194
16586
|
];
|
|
16195
16587
|
})), { entries: inputPaths.length });
|
|
16196
16588
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
16197
16589
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
16198
16590
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
16199
16591
|
const tsPath = __require.resolve("typescript");
|
|
16200
|
-
const tsRootDir =
|
|
16201
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16592
|
+
const tsRootDir = dirname21(tsPath);
|
|
16593
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve28(tsRootDir, "lib");
|
|
16202
16594
|
});
|
|
16203
16595
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
16204
16596
|
const options = {
|
|
@@ -16223,30 +16615,30 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16223
16615
|
options.incremental = false;
|
|
16224
16616
|
options.tsBuildInfoFile = undefined;
|
|
16225
16617
|
options.rootDir = process.cwd();
|
|
16226
|
-
const
|
|
16227
|
-
const originalGetDefaultLibLocation =
|
|
16228
|
-
|
|
16229
|
-
const originalGetDefaultLibFileName =
|
|
16230
|
-
|
|
16618
|
+
const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
|
|
16619
|
+
const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
|
|
16620
|
+
host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
16621
|
+
const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
|
|
16622
|
+
host2.getDefaultLibFileName = (opts) => {
|
|
16231
16623
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
16232
16624
|
return basename12(fileName);
|
|
16233
16625
|
};
|
|
16234
|
-
const originalGetSourceFile =
|
|
16235
|
-
|
|
16626
|
+
const originalGetSourceFile = host2.getSourceFile;
|
|
16627
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16236
16628
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
16237
|
-
const resolvedPath =
|
|
16238
|
-
return originalGetSourceFile?.call(
|
|
16629
|
+
const resolvedPath = join37(tsLibDir, fileName);
|
|
16630
|
+
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
16239
16631
|
}
|
|
16240
|
-
return originalGetSourceFile?.call(
|
|
16632
|
+
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
16241
16633
|
};
|
|
16242
16634
|
const emitted = {};
|
|
16243
|
-
const resolvedOutDir =
|
|
16244
|
-
|
|
16635
|
+
const resolvedOutDir = resolve28(outDir);
|
|
16636
|
+
host2.writeFile = (fileName, text) => {
|
|
16245
16637
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
16246
16638
|
emitted[relativePath] = text;
|
|
16247
16639
|
};
|
|
16248
|
-
const originalReadFile =
|
|
16249
|
-
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(
|
|
16640
|
+
const originalReadFile = host2.readFile;
|
|
16641
|
+
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
|
|
16250
16642
|
await traceAngularPhase("aot/resource-cache-summary", () => {
|
|
16251
16643
|
return;
|
|
16252
16644
|
}, {
|
|
@@ -16255,43 +16647,43 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16255
16647
|
filesVisited: aotResourceTransformStats.filesVisited,
|
|
16256
16648
|
transformedFiles: aotResourceTransformStats.transformedFiles
|
|
16257
16649
|
});
|
|
16258
|
-
|
|
16259
|
-
const source = originalReadFile ? originalReadFile.call(
|
|
16650
|
+
host2.readFile = (fileName) => {
|
|
16651
|
+
const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
|
|
16260
16652
|
if (typeof source !== "string")
|
|
16261
16653
|
return source;
|
|
16262
16654
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16263
16655
|
return source;
|
|
16264
16656
|
}
|
|
16265
|
-
const resolvedPath =
|
|
16657
|
+
const resolvedPath = resolve28(fileName);
|
|
16266
16658
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16267
16659
|
};
|
|
16268
|
-
const originalGetSourceFileForCompile =
|
|
16269
|
-
|
|
16270
|
-
const source = transformedSources.get(
|
|
16660
|
+
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16661
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16662
|
+
const source = transformedSources.get(resolve28(fileName));
|
|
16271
16663
|
if (source) {
|
|
16272
16664
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
16273
16665
|
}
|
|
16274
|
-
return originalGetSourceFileForCompile?.call(
|
|
16666
|
+
return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
|
|
16275
16667
|
};
|
|
16276
16668
|
let diagnostics;
|
|
16277
16669
|
try {
|
|
16278
16670
|
({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
|
|
16279
16671
|
emitFlags: EmitFlags.Default,
|
|
16280
|
-
host,
|
|
16672
|
+
host: host2,
|
|
16281
16673
|
options,
|
|
16282
16674
|
rootNames: inputPaths
|
|
16283
16675
|
}), { entries: inputPaths.length }));
|
|
16284
16676
|
} finally {
|
|
16285
|
-
|
|
16286
|
-
|
|
16677
|
+
host2.readFile = originalReadFile;
|
|
16678
|
+
host2.getSourceFile = originalGetSourceFileForCompile;
|
|
16287
16679
|
}
|
|
16288
16680
|
await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
|
|
16289
16681
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
16290
16682
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
16291
16683
|
content,
|
|
16292
|
-
target:
|
|
16684
|
+
target: join37(outDir, fileName)
|
|
16293
16685
|
}));
|
|
16294
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16686
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve28(target)));
|
|
16295
16687
|
return rawEntries.map(({ content, target }) => {
|
|
16296
16688
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16297
16689
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16306,17 +16698,17 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16306
16698
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16307
16699
|
});
|
|
16308
16700
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16309
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16701
|
+
processedContent += islandMetadataByOutputPath.get(resolve28(target)) ?? "";
|
|
16310
16702
|
return { content: processedContent, target };
|
|
16311
16703
|
});
|
|
16312
16704
|
});
|
|
16313
16705
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
16314
|
-
await fs5.mkdir(
|
|
16706
|
+
await fs5.mkdir(dirname21(target), { recursive: true });
|
|
16315
16707
|
await fs5.writeFile(target, content, "utf-8");
|
|
16316
16708
|
})), { outputs: entries.length });
|
|
16317
16709
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16318
16710
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16319
|
-
jitContentCache.delete(
|
|
16711
|
+
jitContentCache.delete(resolve28(filePath));
|
|
16320
16712
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16321
16713
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16322
16714
|
let match;
|
|
@@ -16329,7 +16721,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
16329
16721
|
}
|
|
16330
16722
|
return null;
|
|
16331
16723
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16332
|
-
const sourceEntry =
|
|
16724
|
+
const sourceEntry = resolve28(import.meta.dir, "../angular/components/index.ts");
|
|
16333
16725
|
if (existsSync26(sourceEntry)) {
|
|
16334
16726
|
return sourceEntry.replace(/\\/g, "/");
|
|
16335
16727
|
}
|
|
@@ -16466,7 +16858,7 @@ ${fields}
|
|
|
16466
16858
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16467
16859
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16468
16860
|
if (templateUrlMatch?.[1]) {
|
|
16469
|
-
const templatePath =
|
|
16861
|
+
const templatePath = join37(fileDir, templateUrlMatch[1]);
|
|
16470
16862
|
if (!existsSync26(templatePath)) {
|
|
16471
16863
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16472
16864
|
}
|
|
@@ -16497,11 +16889,11 @@ ${fields}
|
|
|
16497
16889
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16498
16890
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16499
16891
|
if (templateUrlMatch?.[1]) {
|
|
16500
|
-
const templatePath =
|
|
16892
|
+
const templatePath = join37(fileDir, templateUrlMatch[1]);
|
|
16501
16893
|
if (!existsSync26(templatePath)) {
|
|
16502
16894
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16503
16895
|
}
|
|
16504
|
-
const templateRaw2 =
|
|
16896
|
+
const templateRaw2 = readFileSync24(templatePath, "utf-8");
|
|
16505
16897
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
16506
16898
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
16507
16899
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -16534,7 +16926,7 @@ ${fields}
|
|
|
16534
16926
|
return source;
|
|
16535
16927
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16536
16928
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16537
|
-
return readAndEscapeFile(
|
|
16929
|
+
return readAndEscapeFile(join37(fileDir, styleUrl), stylePreprocessors);
|
|
16538
16930
|
});
|
|
16539
16931
|
const results = await Promise.all(stylePromises);
|
|
16540
16932
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16545,7 +16937,7 @@ ${fields}
|
|
|
16545
16937
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16546
16938
|
if (!styleUrlMatch?.[1])
|
|
16547
16939
|
return source;
|
|
16548
|
-
const escaped = await readAndEscapeFile(
|
|
16940
|
+
const escaped = await readAndEscapeFile(join37(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16549
16941
|
if (!escaped)
|
|
16550
16942
|
return source;
|
|
16551
16943
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16619,10 +17011,10 @@ ${fields}
|
|
|
16619
17011
|
return "";
|
|
16620
17012
|
}
|
|
16621
17013
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16622
|
-
const entryPath =
|
|
17014
|
+
const entryPath = resolve28(inputPath);
|
|
16623
17015
|
const allOutputs = [];
|
|
16624
17016
|
const visited = new Set;
|
|
16625
|
-
const baseDir =
|
|
17017
|
+
const baseDir = resolve28(rootDir ?? process.cwd());
|
|
16626
17018
|
let usesLegacyAnimations = false;
|
|
16627
17019
|
const angularTranspiler = new Bun.Transpiler({
|
|
16628
17020
|
loader: "ts",
|
|
@@ -16641,16 +17033,16 @@ ${fields}
|
|
|
16641
17033
|
`${candidate}.js`,
|
|
16642
17034
|
`${candidate}.jsx`,
|
|
16643
17035
|
`${candidate}.json`,
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
17036
|
+
join37(candidate, "index.ts"),
|
|
17037
|
+
join37(candidate, "index.tsx"),
|
|
17038
|
+
join37(candidate, "index.js"),
|
|
17039
|
+
join37(candidate, "index.jsx")
|
|
16648
17040
|
];
|
|
16649
17041
|
return candidates.find((file4) => existsSync26(file4));
|
|
16650
17042
|
};
|
|
16651
17043
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16652
17044
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16653
|
-
return resolveSourceFile2(
|
|
17045
|
+
return resolveSourceFile2(resolve28(fromDir, specifier));
|
|
16654
17046
|
}
|
|
16655
17047
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16656
17048
|
if (aliased)
|
|
@@ -16659,7 +17051,7 @@ ${fields}
|
|
|
16659
17051
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16660
17052
|
if (resolved.includes("/node_modules/"))
|
|
16661
17053
|
return;
|
|
16662
|
-
const absolute =
|
|
17054
|
+
const absolute = resolve28(resolved);
|
|
16663
17055
|
if (!absolute.startsWith(baseDir))
|
|
16664
17056
|
return;
|
|
16665
17057
|
return resolveSourceFile2(absolute);
|
|
@@ -16668,13 +17060,13 @@ ${fields}
|
|
|
16668
17060
|
}
|
|
16669
17061
|
};
|
|
16670
17062
|
const toOutputPath = (sourcePath) => {
|
|
16671
|
-
const inputDir =
|
|
17063
|
+
const inputDir = dirname21(sourcePath);
|
|
16672
17064
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16673
17065
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16674
|
-
return
|
|
17066
|
+
return join37(inputDir, fileBase);
|
|
16675
17067
|
}
|
|
16676
17068
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16677
|
-
return
|
|
17069
|
+
return join37(outDir, relativeDir, fileBase);
|
|
16678
17070
|
};
|
|
16679
17071
|
const withCacheBuster = (specifier) => {
|
|
16680
17072
|
if (!cacheBuster)
|
|
@@ -16711,21 +17103,21 @@ ${fields}
|
|
|
16711
17103
|
return `${prefix}${dots}`;
|
|
16712
17104
|
return `${prefix}../${dots}`;
|
|
16713
17105
|
});
|
|
16714
|
-
if (
|
|
17106
|
+
if (resolve28(actualPath) === entryPath) {
|
|
16715
17107
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16716
17108
|
}
|
|
16717
17109
|
return processedContent;
|
|
16718
17110
|
};
|
|
16719
17111
|
const transpileFile = async (filePath) => {
|
|
16720
|
-
const resolved =
|
|
17112
|
+
const resolved = resolve28(filePath);
|
|
16721
17113
|
if (visited.has(resolved))
|
|
16722
17114
|
return;
|
|
16723
17115
|
visited.add(resolved);
|
|
16724
17116
|
if (resolved.endsWith(".json") && existsSync26(resolved)) {
|
|
16725
|
-
const inputDir2 =
|
|
17117
|
+
const inputDir2 = dirname21(resolved);
|
|
16726
17118
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16727
|
-
const targetDir2 =
|
|
16728
|
-
const targetPath2 =
|
|
17119
|
+
const targetDir2 = join37(outDir, relativeDir2);
|
|
17120
|
+
const targetPath2 = join37(targetDir2, basename12(resolved));
|
|
16729
17121
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16730
17122
|
await fs5.copyFile(resolved, targetPath2);
|
|
16731
17123
|
allOutputs.push(targetPath2);
|
|
@@ -16737,12 +17129,12 @@ ${fields}
|
|
|
16737
17129
|
if (!existsSync26(actualPath))
|
|
16738
17130
|
return;
|
|
16739
17131
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16740
|
-
const inlined = await inlineResources(sourceCode,
|
|
16741
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16742
|
-
const inputDir =
|
|
17132
|
+
const inlined = await inlineResources(sourceCode, dirname21(actualPath), stylePreprocessors);
|
|
17133
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname21(actualPath)).source;
|
|
17134
|
+
const inputDir = dirname21(actualPath);
|
|
16743
17135
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16744
17136
|
const targetPath = toOutputPath(actualPath);
|
|
16745
|
-
const targetDir =
|
|
17137
|
+
const targetDir = dirname21(targetPath);
|
|
16746
17138
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16747
17139
|
const localImports = [];
|
|
16748
17140
|
const importRewrites = new Map;
|
|
@@ -16769,7 +17161,7 @@ ${fields}
|
|
|
16769
17161
|
importRewrites.set(specifier, relativeRewrite);
|
|
16770
17162
|
return resolved2;
|
|
16771
17163
|
}).filter((path) => Boolean(path));
|
|
16772
|
-
const isEntry =
|
|
17164
|
+
const isEntry = resolve28(actualPath) === resolve28(entryPath);
|
|
16773
17165
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16774
17166
|
const cacheKey2 = actualPath;
|
|
16775
17167
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync26(targetPath);
|
|
@@ -16804,13 +17196,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16804
17196
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16805
17197
|
}
|
|
16806
17198
|
const compiledRoot = compiledParent;
|
|
16807
|
-
const indexesDir =
|
|
17199
|
+
const indexesDir = join37(compiledParent, "indexes");
|
|
16808
17200
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16809
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
17201
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve28(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16810
17202
|
if (!hmr) {
|
|
16811
17203
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16812
17204
|
const cwd = process.cwd();
|
|
16813
|
-
const angularSrcDir =
|
|
17205
|
+
const angularSrcDir = resolve28(outRoot);
|
|
16814
17206
|
if (!existsSync26(angularSrcDir))
|
|
16815
17207
|
return;
|
|
16816
17208
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16818,17 +17210,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16818
17210
|
absolute: false,
|
|
16819
17211
|
cwd: angularSrcDir
|
|
16820
17212
|
})) {
|
|
16821
|
-
const sourcePath =
|
|
17213
|
+
const sourcePath = join37(angularSrcDir, rel);
|
|
16822
17214
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16823
|
-
const targetPath =
|
|
16824
|
-
await fs5.mkdir(
|
|
17215
|
+
const targetPath = join37(compiledRoot, cwdRel);
|
|
17216
|
+
await fs5.mkdir(dirname21(targetPath), { recursive: true });
|
|
16825
17217
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16826
17218
|
}
|
|
16827
17219
|
});
|
|
16828
17220
|
}
|
|
16829
17221
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16830
17222
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16831
|
-
const resolvedEntry =
|
|
17223
|
+
const resolvedEntry = resolve28(entry);
|
|
16832
17224
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16833
17225
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16834
17226
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16837,13 +17229,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16837
17229
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16838
17230
|
const jsName = `${fileBase}.js`;
|
|
16839
17231
|
const compiledFallbackPaths = [
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
].map((file4) =>
|
|
17232
|
+
join37(compiledRoot, relativeEntry),
|
|
17233
|
+
join37(compiledRoot, "pages", jsName),
|
|
17234
|
+
join37(compiledRoot, jsName)
|
|
17235
|
+
].map((file4) => resolve28(file4));
|
|
16844
17236
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16845
17237
|
const normalizedCandidates = [
|
|
16846
|
-
...candidatePaths.map((file4) =>
|
|
17238
|
+
...candidatePaths.map((file4) => resolve28(file4)),
|
|
16847
17239
|
...compiledFallbackPaths
|
|
16848
17240
|
];
|
|
16849
17241
|
let candidate = normalizedCandidates.find((file4) => existsSync26(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16890,7 +17282,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16890
17282
|
let providersSourceContent = "";
|
|
16891
17283
|
if (providersInjection.appProvidersSource) {
|
|
16892
17284
|
try {
|
|
16893
|
-
providersSourceContent =
|
|
17285
|
+
providersSourceContent = readFileSync24(providersInjection.appProvidersSource, "utf-8");
|
|
16894
17286
|
} catch {}
|
|
16895
17287
|
}
|
|
16896
17288
|
return JSON.stringify({
|
|
@@ -16901,7 +17293,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16901
17293
|
})() : "no-providers";
|
|
16902
17294
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16903
17295
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16904
|
-
const clientFile =
|
|
17296
|
+
const clientFile = join37(indexesDir, jsName);
|
|
16905
17297
|
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
17298
|
return {
|
|
16907
17299
|
clientPath: clientFile,
|
|
@@ -16933,13 +17325,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16933
17325
|
const fragments = [];
|
|
16934
17326
|
if (providersInjection.appProvidersSource) {
|
|
16935
17327
|
const compiledAppProvidersPath = (() => {
|
|
16936
|
-
const angularDirAbs =
|
|
16937
|
-
const appSourceAbs =
|
|
17328
|
+
const angularDirAbs = resolve28(outRoot);
|
|
17329
|
+
const appSourceAbs = resolve28(providersInjection.appProvidersSource);
|
|
16938
17330
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16939
|
-
return
|
|
17331
|
+
return join37(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16940
17332
|
})();
|
|
16941
17333
|
const appProvidersSpec = (() => {
|
|
16942
|
-
const rel = relative13(
|
|
17334
|
+
const rel = relative13(dirname21(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16943
17335
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16944
17336
|
})();
|
|
16945
17337
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -17191,7 +17583,7 @@ var init_compileAngular = __esm(() => {
|
|
|
17191
17583
|
init_stylePreprocessor();
|
|
17192
17584
|
init_generatedDir();
|
|
17193
17585
|
devClientDir4 = resolveDevClientDir4();
|
|
17194
|
-
hmrClientPath5 =
|
|
17586
|
+
hmrClientPath5 = join37(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
17195
17587
|
jitContentCache = new Map;
|
|
17196
17588
|
wrapperOutputCache = new Map;
|
|
17197
17589
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17915,8 +18307,8 @@ __export(exports_fastHmrCompiler, {
|
|
|
17915
18307
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
17916
18308
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17917
18309
|
});
|
|
17918
|
-
import { existsSync as existsSync27, readFileSync as
|
|
17919
|
-
import { dirname as
|
|
18310
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25, statSync as statSync2 } from "fs";
|
|
18311
|
+
import { dirname as dirname22, extname as extname8, relative as relative14, resolve as resolve29 } from "path";
|
|
17920
18312
|
import ts17 from "typescript";
|
|
17921
18313
|
var fail = (reason, detail, location) => ({
|
|
17922
18314
|
detail,
|
|
@@ -18046,7 +18438,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18046
18438
|
continue;
|
|
18047
18439
|
const decoratorMeta = readDecoratorMeta(args);
|
|
18048
18440
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
18049
|
-
const componentDir =
|
|
18441
|
+
const componentDir = dirname22(componentFilePath);
|
|
18050
18442
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
18051
18443
|
fingerprintCache.set(id, fingerprint);
|
|
18052
18444
|
} else {
|
|
@@ -18231,7 +18623,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18231
18623
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18232
18624
|
return true;
|
|
18233
18625
|
}
|
|
18234
|
-
const base =
|
|
18626
|
+
const base = resolve29(componentDir, spec);
|
|
18235
18627
|
const candidates = [
|
|
18236
18628
|
`${base}.ts`,
|
|
18237
18629
|
`${base}.tsx`,
|
|
@@ -18243,7 +18635,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18243
18635
|
continue;
|
|
18244
18636
|
let content;
|
|
18245
18637
|
try {
|
|
18246
|
-
content =
|
|
18638
|
+
content = readFileSync25(candidate, "utf-8");
|
|
18247
18639
|
} catch {
|
|
18248
18640
|
continue;
|
|
18249
18641
|
}
|
|
@@ -18529,7 +18921,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18529
18921
|
listeners: {},
|
|
18530
18922
|
properties: {},
|
|
18531
18923
|
specialAttributes: {}
|
|
18532
|
-
}), parseHostObjectInto = (
|
|
18924
|
+
}), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
|
|
18533
18925
|
const hostNode = getProperty(args, "host");
|
|
18534
18926
|
if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
|
|
18535
18927
|
if (!hostExprNode)
|
|
@@ -18553,14 +18945,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18553
18945
|
const propMatch = ATTR_BINDING_RE.exec(key);
|
|
18554
18946
|
const evtMatch = EVENT_BINDING_RE.exec(key);
|
|
18555
18947
|
if (propMatch) {
|
|
18556
|
-
|
|
18948
|
+
host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18557
18949
|
} else if (evtMatch) {
|
|
18558
|
-
|
|
18950
|
+
host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18559
18951
|
} else {
|
|
18560
|
-
|
|
18952
|
+
host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
|
|
18561
18953
|
}
|
|
18562
18954
|
}
|
|
18563
|
-
}, mergeMemberHostDecorators = (
|
|
18955
|
+
}, mergeMemberHostDecorators = (host2, cls) => {
|
|
18564
18956
|
for (const member of cls.members) {
|
|
18565
18957
|
if (!ts17.canHaveDecorators(member))
|
|
18566
18958
|
continue;
|
|
@@ -18580,7 +18972,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18580
18972
|
const propertyName2 = member.name.text;
|
|
18581
18973
|
const [target] = expr.arguments;
|
|
18582
18974
|
const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
|
|
18583
|
-
|
|
18975
|
+
host2.properties[key] = propertyName2;
|
|
18584
18976
|
} else if (functionNode.text === "HostListener") {
|
|
18585
18977
|
if (!ts17.isMethodDeclaration(member))
|
|
18586
18978
|
continue;
|
|
@@ -18598,7 +18990,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18598
18990
|
argsList.push(element.text);
|
|
18599
18991
|
}
|
|
18600
18992
|
}
|
|
18601
|
-
|
|
18993
|
+
host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
18602
18994
|
}
|
|
18603
18995
|
}
|
|
18604
18996
|
}
|
|
@@ -18789,9 +19181,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18789
19181
|
}
|
|
18790
19182
|
return out.length > 0 ? out : null;
|
|
18791
19183
|
}, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
|
|
18792
|
-
const
|
|
18793
|
-
parseHostObjectInto(
|
|
18794
|
-
mergeMemberHostDecorators(
|
|
19184
|
+
const host2 = emptyHost();
|
|
19185
|
+
parseHostObjectInto(host2, decoratorArgs, null, compiler);
|
|
19186
|
+
mergeMemberHostDecorators(host2, cls);
|
|
18795
19187
|
const decoratorQueries = extractDecoratorQueries(cls, compiler);
|
|
18796
19188
|
const signalQueries = extractSignalQueries(cls, compiler);
|
|
18797
19189
|
const contentQueries = [
|
|
@@ -18812,7 +19204,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18812
19204
|
animations,
|
|
18813
19205
|
contentQueries,
|
|
18814
19206
|
exportAs: extractExportAs(decoratorArgs),
|
|
18815
|
-
host,
|
|
19207
|
+
host: host2,
|
|
18816
19208
|
hostDirectives: extractHostDirectives(decoratorArgs, compiler),
|
|
18817
19209
|
providers,
|
|
18818
19210
|
viewProviders,
|
|
@@ -18831,7 +19223,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18831
19223
|
return cached.info;
|
|
18832
19224
|
let source;
|
|
18833
19225
|
try {
|
|
18834
|
-
source =
|
|
19226
|
+
source = readFileSync25(filePath, "utf-8");
|
|
18835
19227
|
} catch {
|
|
18836
19228
|
childComponentInfoCache.set(cacheKey2, {
|
|
18837
19229
|
info: null,
|
|
@@ -18885,7 +19277,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18885
19277
|
return cached.info;
|
|
18886
19278
|
let content;
|
|
18887
19279
|
try {
|
|
18888
|
-
content =
|
|
19280
|
+
content = readFileSync25(dtsPath, "utf-8");
|
|
18889
19281
|
} catch {
|
|
18890
19282
|
childComponentInfoCache.set(cacheKey2, {
|
|
18891
19283
|
info: null,
|
|
@@ -19008,7 +19400,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19008
19400
|
return null;
|
|
19009
19401
|
let content;
|
|
19010
19402
|
try {
|
|
19011
|
-
content =
|
|
19403
|
+
content = readFileSync25(startDtsPath, "utf-8");
|
|
19012
19404
|
} catch {
|
|
19013
19405
|
return null;
|
|
19014
19406
|
}
|
|
@@ -19027,7 +19419,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19027
19419
|
});
|
|
19028
19420
|
if (!names.includes(className))
|
|
19029
19421
|
continue;
|
|
19030
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19422
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname22(startDtsPath));
|
|
19031
19423
|
if (!nextDts)
|
|
19032
19424
|
continue;
|
|
19033
19425
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19037,7 +19429,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19037
19429
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
19038
19430
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
19039
19431
|
const fromPath = item[1] || "";
|
|
19040
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19432
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname22(startDtsPath));
|
|
19041
19433
|
if (!nextDts)
|
|
19042
19434
|
continue;
|
|
19043
19435
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -19047,7 +19439,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19047
19439
|
return null;
|
|
19048
19440
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19049
19441
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19050
|
-
const base =
|
|
19442
|
+
const base = resolve29(fromDir, stripped);
|
|
19051
19443
|
const candidates = [
|
|
19052
19444
|
`${base}.d.ts`,
|
|
19053
19445
|
`${base}.d.mts`,
|
|
@@ -19071,7 +19463,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19071
19463
|
return null;
|
|
19072
19464
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19073
19465
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19074
|
-
const base =
|
|
19466
|
+
const base = resolve29(componentDir, spec);
|
|
19075
19467
|
const candidates = [
|
|
19076
19468
|
`${base}.ts`,
|
|
19077
19469
|
`${base}.tsx`,
|
|
@@ -19226,7 +19618,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19226
19618
|
return cached.hasProviders;
|
|
19227
19619
|
let source;
|
|
19228
19620
|
try {
|
|
19229
|
-
source =
|
|
19621
|
+
source = readFileSync25(filePath, "utf8");
|
|
19230
19622
|
} catch {
|
|
19231
19623
|
return true;
|
|
19232
19624
|
}
|
|
@@ -19290,13 +19682,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19290
19682
|
}
|
|
19291
19683
|
if (!matches)
|
|
19292
19684
|
continue;
|
|
19293
|
-
const resolved =
|
|
19685
|
+
const resolved = resolve29(componentDir, spec);
|
|
19294
19686
|
for (const ext of TS_EXTENSIONS) {
|
|
19295
19687
|
const candidate = resolved + ext;
|
|
19296
19688
|
if (existsSync27(candidate))
|
|
19297
19689
|
return candidate;
|
|
19298
19690
|
}
|
|
19299
|
-
const indexCandidate =
|
|
19691
|
+
const indexCandidate = resolve29(resolved, "index.ts");
|
|
19300
19692
|
if (existsSync27(indexCandidate))
|
|
19301
19693
|
return indexCandidate;
|
|
19302
19694
|
}
|
|
@@ -19534,12 +19926,12 @@ ${transpiled}
|
|
|
19534
19926
|
}
|
|
19535
19927
|
}${staticPatch}`;
|
|
19536
19928
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19537
|
-
const abs =
|
|
19929
|
+
const abs = resolve29(componentDir, url);
|
|
19538
19930
|
if (!existsSync27(abs))
|
|
19539
19931
|
return null;
|
|
19540
19932
|
const ext = extname8(abs).toLowerCase();
|
|
19541
19933
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19542
|
-
return
|
|
19934
|
+
return readFileSync25(abs, "utf8");
|
|
19543
19935
|
}
|
|
19544
19936
|
try {
|
|
19545
19937
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19573,11 +19965,11 @@ ${block}
|
|
|
19573
19965
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19574
19966
|
if (cached !== undefined)
|
|
19575
19967
|
return cached;
|
|
19576
|
-
const tsconfigPath =
|
|
19968
|
+
const tsconfigPath = resolve29(projectRoot, "tsconfig.json");
|
|
19577
19969
|
const opts = {};
|
|
19578
19970
|
if (existsSync27(tsconfigPath)) {
|
|
19579
19971
|
try {
|
|
19580
|
-
const text =
|
|
19972
|
+
const text = readFileSync25(tsconfigPath, "utf8");
|
|
19581
19973
|
const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19582
19974
|
if (!parsed.error && parsed.config) {
|
|
19583
19975
|
const cfg = parsed.config;
|
|
@@ -19611,7 +20003,7 @@ ${block}
|
|
|
19611
20003
|
} catch (err) {
|
|
19612
20004
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19613
20005
|
}
|
|
19614
|
-
const tsSource =
|
|
20006
|
+
const tsSource = readFileSync25(componentFilePath, "utf8");
|
|
19615
20007
|
const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
19616
20008
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19617
20009
|
if (!classNode) {
|
|
@@ -19638,7 +20030,7 @@ ${block}
|
|
|
19638
20030
|
rebootstrapRequired: false
|
|
19639
20031
|
};
|
|
19640
20032
|
}
|
|
19641
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
20033
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname22(componentFilePath), projectRoot)) {
|
|
19642
20034
|
return fail("inherits-decorated-class");
|
|
19643
20035
|
}
|
|
19644
20036
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19650,18 +20042,18 @@ ${block}
|
|
|
19650
20042
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19651
20043
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19652
20044
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19653
|
-
const componentDir =
|
|
20045
|
+
const componentDir = dirname22(componentFilePath);
|
|
19654
20046
|
let templateText;
|
|
19655
20047
|
let templatePath;
|
|
19656
20048
|
if (decoratorMeta.template !== null) {
|
|
19657
20049
|
templateText = decoratorMeta.template;
|
|
19658
20050
|
templatePath = componentFilePath;
|
|
19659
20051
|
} else if (decoratorMeta.templateUrl) {
|
|
19660
|
-
const tplAbs =
|
|
20052
|
+
const tplAbs = resolve29(componentDir, decoratorMeta.templateUrl);
|
|
19661
20053
|
if (!existsSync27(tplAbs)) {
|
|
19662
20054
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19663
20055
|
}
|
|
19664
|
-
templateText =
|
|
20056
|
+
templateText = readFileSync25(tplAbs, "utf8");
|
|
19665
20057
|
templatePath = tplAbs;
|
|
19666
20058
|
} else {
|
|
19667
20059
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20420,7 +20812,7 @@ __export(exports_compileEmber, {
|
|
|
20420
20812
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
20421
20813
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
20422
20814
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
20423
|
-
dirname: () =>
|
|
20815
|
+
dirname: () => dirname23,
|
|
20424
20816
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
20425
20817
|
compileEmberFile: () => compileEmberFile,
|
|
20426
20818
|
compileEmber: () => compileEmber,
|
|
@@ -20429,7 +20821,7 @@ __export(exports_compileEmber, {
|
|
|
20429
20821
|
});
|
|
20430
20822
|
import { existsSync as existsSync28 } from "fs";
|
|
20431
20823
|
import { mkdir as mkdir11, rm as rm8 } from "fs/promises";
|
|
20432
|
-
import { basename as basename13, dirname as
|
|
20824
|
+
import { basename as basename13, dirname as dirname23, extname as extname9, join as join38, resolve as resolve30 } from "path";
|
|
20433
20825
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
20434
20826
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20435
20827
|
if (cachedPreprocessor)
|
|
@@ -20525,7 +20917,7 @@ export const importSync = (specifier) => {
|
|
|
20525
20917
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20526
20918
|
if (!originalImporter)
|
|
20527
20919
|
return;
|
|
20528
|
-
const candidateBase =
|
|
20920
|
+
const candidateBase = resolve30(dirname23(originalImporter), args.path);
|
|
20529
20921
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20530
20922
|
for (const ext of extensionsToTry) {
|
|
20531
20923
|
const candidate = candidateBase + ext;
|
|
@@ -20548,7 +20940,7 @@ export const importSync = (specifier) => {
|
|
|
20548
20940
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20549
20941
|
if (standalonePackages.has(args.path))
|
|
20550
20942
|
return;
|
|
20551
|
-
const internal =
|
|
20943
|
+
const internal = join38(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20552
20944
|
if (existsSync28(internal))
|
|
20553
20945
|
return { path: internal };
|
|
20554
20946
|
return;
|
|
@@ -20584,7 +20976,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20584
20976
|
export { PageComponent };
|
|
20585
20977
|
export default PageComponent;
|
|
20586
20978
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20587
|
-
const resolvedEntry =
|
|
20979
|
+
const resolvedEntry = resolve30(entry);
|
|
20588
20980
|
const source = await file4(resolvedEntry).text();
|
|
20589
20981
|
let preprocessed = source;
|
|
20590
20982
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20596,16 +20988,16 @@ export default PageComponent;
|
|
|
20596
20988
|
}
|
|
20597
20989
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20598
20990
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20599
|
-
const tmpDir =
|
|
20600
|
-
const serverDir =
|
|
20601
|
-
const clientDir =
|
|
20991
|
+
const tmpDir = join38(compiledRoot, "_tmp");
|
|
20992
|
+
const serverDir = join38(compiledRoot, "server");
|
|
20993
|
+
const clientDir = join38(compiledRoot, "client");
|
|
20602
20994
|
await Promise.all([
|
|
20603
20995
|
mkdir11(tmpDir, { recursive: true }),
|
|
20604
20996
|
mkdir11(serverDir, { recursive: true }),
|
|
20605
20997
|
mkdir11(clientDir, { recursive: true })
|
|
20606
20998
|
]);
|
|
20607
|
-
const tmpPagePath =
|
|
20608
|
-
const tmpHarnessPath =
|
|
20999
|
+
const tmpPagePath = resolve30(join38(tmpDir, `${baseName}.module.js`));
|
|
21000
|
+
const tmpHarnessPath = resolve30(join38(tmpDir, `${baseName}.harness.js`));
|
|
20609
21001
|
await Promise.all([
|
|
20610
21002
|
write4(tmpPagePath, transpiled),
|
|
20611
21003
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20613,7 +21005,7 @@ export default PageComponent;
|
|
|
20613
21005
|
const stagedSourceMap = new Map([
|
|
20614
21006
|
[tmpPagePath, resolvedEntry]
|
|
20615
21007
|
]);
|
|
20616
|
-
const serverPath =
|
|
21008
|
+
const serverPath = join38(serverDir, `${baseName}.js`);
|
|
20617
21009
|
const buildResult = await bunBuild2({
|
|
20618
21010
|
entrypoints: [tmpHarnessPath],
|
|
20619
21011
|
format: "esm",
|
|
@@ -20630,7 +21022,7 @@ export default PageComponent;
|
|
|
20630
21022
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20631
21023
|
}
|
|
20632
21024
|
await rm8(tmpDir, { force: true, recursive: true });
|
|
20633
|
-
const clientPath =
|
|
21025
|
+
const clientPath = join38(clientDir, `${baseName}.js`);
|
|
20634
21026
|
await write4(clientPath, transpiled);
|
|
20635
21027
|
return { clientPath, serverPath };
|
|
20636
21028
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20647,7 +21039,7 @@ export default PageComponent;
|
|
|
20647
21039
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20648
21040
|
};
|
|
20649
21041
|
}, compileEmberFileSource = async (entry) => {
|
|
20650
|
-
const resolvedEntry =
|
|
21042
|
+
const resolvedEntry = resolve30(entry);
|
|
20651
21043
|
const source = await file4(resolvedEntry).text();
|
|
20652
21044
|
let preprocessed = source;
|
|
20653
21045
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20658,7 +21050,7 @@ export default PageComponent;
|
|
|
20658
21050
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20659
21051
|
}
|
|
20660
21052
|
return transpiler5.transformSync(preprocessed);
|
|
20661
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
21053
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join38(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join38(getEmberCompiledRoot(emberDir), "client");
|
|
20662
21054
|
var init_compileEmber = __esm(() => {
|
|
20663
21055
|
init_generatedDir();
|
|
20664
21056
|
transpiler5 = new Transpiler4({
|
|
@@ -20680,24 +21072,24 @@ __export(exports_buildReactVendor, {
|
|
|
20680
21072
|
buildReactVendor: () => buildReactVendor
|
|
20681
21073
|
});
|
|
20682
21074
|
import { existsSync as existsSync29, mkdirSync as mkdirSync8 } from "fs";
|
|
20683
|
-
import { join as
|
|
21075
|
+
import { join as join39, resolve as resolve31 } from "path";
|
|
20684
21076
|
import { rm as rm9 } from "fs/promises";
|
|
20685
21077
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20686
21078
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20687
21079
|
const candidates = [
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
21080
|
+
resolve31(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
21081
|
+
resolve31(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
21082
|
+
resolve31(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
21083
|
+
resolve31(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
21084
|
+
resolve31(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
21085
|
+
resolve31(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20694
21086
|
];
|
|
20695
21087
|
for (const candidate of candidates) {
|
|
20696
21088
|
if (existsSync29(candidate)) {
|
|
20697
21089
|
return candidate.replace(/\\/g, "/");
|
|
20698
21090
|
}
|
|
20699
21091
|
}
|
|
20700
|
-
return (candidates[0] ??
|
|
21092
|
+
return (candidates[0] ?? resolve31(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20701
21093
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20702
21094
|
const paths = {};
|
|
20703
21095
|
for (const specifier of reactSpecifiers) {
|
|
@@ -20730,14 +21122,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20730
21122
|
`)}
|
|
20731
21123
|
`;
|
|
20732
21124
|
}, buildReactVendor = async (buildDir) => {
|
|
20733
|
-
const vendorDir =
|
|
21125
|
+
const vendorDir = join39(buildDir, "react", "vendor");
|
|
20734
21126
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20735
|
-
const tmpDir =
|
|
21127
|
+
const tmpDir = join39(buildDir, "_vendor_tmp");
|
|
20736
21128
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20737
21129
|
const specifiers = reactSpecifiers;
|
|
20738
21130
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20739
21131
|
const safeName = toSafeFileName(specifier);
|
|
20740
|
-
const entryPath =
|
|
21132
|
+
const entryPath = join39(tmpDir, `${safeName}.ts`);
|
|
20741
21133
|
const source = await generateEntrySource(specifier);
|
|
20742
21134
|
await Bun.write(entryPath, source);
|
|
20743
21135
|
return entryPath;
|
|
@@ -20805,7 +21197,7 @@ __export(exports_buildAngularVendor, {
|
|
|
20805
21197
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20806
21198
|
});
|
|
20807
21199
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20808
|
-
import { join as
|
|
21200
|
+
import { join as join40 } from "path";
|
|
20809
21201
|
import { rm as rm10 } from "fs/promises";
|
|
20810
21202
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20811
21203
|
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 +21234,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20842
21234
|
}
|
|
20843
21235
|
return { angular, transitiveRoots };
|
|
20844
21236
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
20845
|
-
const { readFileSync:
|
|
21237
|
+
const { readFileSync: readFileSync26 } = await import("fs");
|
|
20846
21238
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
20847
21239
|
const visited = new Set;
|
|
20848
21240
|
const frontier = [];
|
|
@@ -20863,7 +21255,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20863
21255
|
}
|
|
20864
21256
|
let content;
|
|
20865
21257
|
try {
|
|
20866
|
-
content =
|
|
21258
|
+
content = readFileSync26(resolved, "utf-8");
|
|
20867
21259
|
} catch {
|
|
20868
21260
|
continue;
|
|
20869
21261
|
}
|
|
@@ -20902,14 +21294,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20902
21294
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20903
21295
|
return Array.from(angular).filter(isResolvable);
|
|
20904
21296
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20905
|
-
const vendorDir =
|
|
21297
|
+
const vendorDir = join40(buildDir, "angular", "vendor");
|
|
20906
21298
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20907
|
-
const tmpDir =
|
|
21299
|
+
const tmpDir = join40(buildDir, "_angular_vendor_tmp");
|
|
20908
21300
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20909
21301
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20910
21302
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20911
21303
|
const safeName = toSafeFileName2(specifier);
|
|
20912
|
-
const entryPath =
|
|
21304
|
+
const entryPath = join40(tmpDir, `${safeName}.ts`);
|
|
20913
21305
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20914
21306
|
return entryPath;
|
|
20915
21307
|
}));
|
|
@@ -20940,9 +21332,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20940
21332
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20941
21333
|
return computeAngularVendorPaths(specifiers);
|
|
20942
21334
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20943
|
-
const vendorDir =
|
|
21335
|
+
const vendorDir = join40(buildDir, "angular", "vendor", "server");
|
|
20944
21336
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20945
|
-
const tmpDir =
|
|
21337
|
+
const tmpDir = join40(buildDir, "_angular_server_vendor_tmp");
|
|
20946
21338
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20947
21339
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20948
21340
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20953,7 +21345,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20953
21345
|
const specifiers = Array.from(allSpecs);
|
|
20954
21346
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20955
21347
|
const safeName = toSafeFileName2(specifier);
|
|
20956
|
-
const entryPath =
|
|
21348
|
+
const entryPath = join40(tmpDir, `${safeName}.ts`);
|
|
20957
21349
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20958
21350
|
return entryPath;
|
|
20959
21351
|
}));
|
|
@@ -20975,9 +21367,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20975
21367
|
return specifiers;
|
|
20976
21368
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20977
21369
|
const paths = {};
|
|
20978
|
-
const vendorDir =
|
|
21370
|
+
const vendorDir = join40(buildDir, "angular", "vendor", "server");
|
|
20979
21371
|
for (const specifier of specifiers) {
|
|
20980
|
-
paths[specifier] =
|
|
21372
|
+
paths[specifier] = join40(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20981
21373
|
}
|
|
20982
21374
|
return paths;
|
|
20983
21375
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -21033,17 +21425,17 @@ __export(exports_buildVueVendor, {
|
|
|
21033
21425
|
buildVueVendor: () => buildVueVendor
|
|
21034
21426
|
});
|
|
21035
21427
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
21036
|
-
import { join as
|
|
21428
|
+
import { join as join41 } from "path";
|
|
21037
21429
|
import { rm as rm11 } from "fs/promises";
|
|
21038
21430
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
21039
21431
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
21040
|
-
const vendorDir =
|
|
21432
|
+
const vendorDir = join41(buildDir, "vue", "vendor");
|
|
21041
21433
|
mkdirSync10(vendorDir, { recursive: true });
|
|
21042
|
-
const tmpDir =
|
|
21434
|
+
const tmpDir = join41(buildDir, "_vue_vendor_tmp");
|
|
21043
21435
|
mkdirSync10(tmpDir, { recursive: true });
|
|
21044
21436
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
21045
21437
|
const safeName = toSafeFileName3(specifier);
|
|
21046
|
-
const entryPath =
|
|
21438
|
+
const entryPath = join41(tmpDir, `${safeName}.ts`);
|
|
21047
21439
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21048
21440
|
`);
|
|
21049
21441
|
return entryPath;
|
|
@@ -21068,11 +21460,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
21068
21460
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
21069
21461
|
return;
|
|
21070
21462
|
}
|
|
21071
|
-
const { readFileSync:
|
|
21463
|
+
const { readFileSync: readFileSync26, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
21072
21464
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
21073
21465
|
for (const file5 of files) {
|
|
21074
|
-
const filePath =
|
|
21075
|
-
const content =
|
|
21466
|
+
const filePath = join41(vendorDir, file5);
|
|
21467
|
+
const content = readFileSync26(filePath, "utf-8");
|
|
21076
21468
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
21077
21469
|
continue;
|
|
21078
21470
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -21098,7 +21490,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
21098
21490
|
buildSvelteVendor: () => buildSvelteVendor
|
|
21099
21491
|
});
|
|
21100
21492
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
21101
|
-
import { join as
|
|
21493
|
+
import { join as join42 } from "path";
|
|
21102
21494
|
import { rm as rm12 } from "fs/promises";
|
|
21103
21495
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
21104
21496
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -21112,13 +21504,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
21112
21504
|
const specifiers = resolveVendorSpecifiers();
|
|
21113
21505
|
if (specifiers.length === 0)
|
|
21114
21506
|
return;
|
|
21115
|
-
const vendorDir =
|
|
21507
|
+
const vendorDir = join42(buildDir, "svelte", "vendor");
|
|
21116
21508
|
mkdirSync11(vendorDir, { recursive: true });
|
|
21117
|
-
const tmpDir =
|
|
21509
|
+
const tmpDir = join42(buildDir, "_svelte_vendor_tmp");
|
|
21118
21510
|
mkdirSync11(tmpDir, { recursive: true });
|
|
21119
21511
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
21120
21512
|
const safeName = toSafeFileName4(specifier);
|
|
21121
|
-
const entryPath =
|
|
21513
|
+
const entryPath = join42(tmpDir, `${safeName}.ts`);
|
|
21122
21514
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
21123
21515
|
`);
|
|
21124
21516
|
return entryPath;
|
|
@@ -21163,13 +21555,13 @@ import {
|
|
|
21163
21555
|
existsSync as existsSync30,
|
|
21164
21556
|
mkdirSync as mkdirSync12,
|
|
21165
21557
|
readdirSync as readdirSync5,
|
|
21166
|
-
readFileSync as
|
|
21558
|
+
readFileSync as readFileSync26,
|
|
21167
21559
|
renameSync,
|
|
21168
21560
|
rmSync as rmSync2,
|
|
21169
21561
|
statSync as statSync3,
|
|
21170
21562
|
writeFileSync as writeFileSync9
|
|
21171
21563
|
} from "fs";
|
|
21172
|
-
import { basename as basename14, dirname as
|
|
21564
|
+
import { basename as basename14, dirname as dirname24, extname as extname10, join as join43, relative as relative15, resolve as resolve32 } from "path";
|
|
21173
21565
|
import { cwd, env as env3, exit } from "process";
|
|
21174
21566
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
21175
21567
|
var isBuildTraceEnabled = () => {
|
|
@@ -21252,7 +21644,7 @@ var isBuildTraceEnabled = () => {
|
|
|
21252
21644
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
21253
21645
|
let content;
|
|
21254
21646
|
try {
|
|
21255
|
-
content =
|
|
21647
|
+
content = readFileSync26(path, "utf-8");
|
|
21256
21648
|
} catch {
|
|
21257
21649
|
return [];
|
|
21258
21650
|
}
|
|
@@ -21303,8 +21695,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21303
21695
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
21304
21696
|
const glob = new Glob8("htmx*.min.js");
|
|
21305
21697
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
21306
|
-
const src =
|
|
21307
|
-
const dest =
|
|
21698
|
+
const src = join43(htmxDir, relPath);
|
|
21699
|
+
const dest = join43(htmxDestDir, "htmx.min.js");
|
|
21308
21700
|
copyFileSync2(src, dest);
|
|
21309
21701
|
return;
|
|
21310
21702
|
}
|
|
@@ -21316,8 +21708,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21316
21708
|
}
|
|
21317
21709
|
}, resolveAbsoluteVersion = async () => {
|
|
21318
21710
|
const candidates = [
|
|
21319
|
-
|
|
21320
|
-
|
|
21711
|
+
resolve32(import.meta.dir, "..", "..", "package.json"),
|
|
21712
|
+
resolve32(import.meta.dir, "..", "package.json")
|
|
21321
21713
|
];
|
|
21322
21714
|
const resolveCandidate = async (remaining) => {
|
|
21323
21715
|
const [candidate, ...rest] = remaining;
|
|
@@ -21333,7 +21725,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21333
21725
|
};
|
|
21334
21726
|
await resolveCandidate(candidates);
|
|
21335
21727
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
21336
|
-
const absPath =
|
|
21728
|
+
const absPath = resolve32(file5, "..", relPath);
|
|
21337
21729
|
try {
|
|
21338
21730
|
statSync3(absPath);
|
|
21339
21731
|
workerPaths.add(absPath);
|
|
@@ -21348,7 +21740,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21348
21740
|
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
21349
21741
|
}
|
|
21350
21742
|
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
21351
|
-
const content =
|
|
21743
|
+
const content = readFileSync26(file5, "utf-8");
|
|
21352
21744
|
for (const pattern of patterns) {
|
|
21353
21745
|
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
21354
21746
|
}
|
|
@@ -21381,7 +21773,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21381
21773
|
vuePagesPath
|
|
21382
21774
|
}) => {
|
|
21383
21775
|
const { readdirSync: readDir } = await import("fs");
|
|
21384
|
-
const devIndexDir =
|
|
21776
|
+
const devIndexDir = join43(buildPath, "_src_indexes");
|
|
21385
21777
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
21386
21778
|
if (reactIndexesPath && reactPagesPath) {
|
|
21387
21779
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -21397,37 +21789,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21397
21789
|
return;
|
|
21398
21790
|
}
|
|
21399
21791
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
21400
|
-
const pagesRel = relative15(process.cwd(),
|
|
21792
|
+
const pagesRel = relative15(process.cwd(), resolve32(reactPagesPath)).replace(/\\/g, "/");
|
|
21401
21793
|
for (const file5 of indexFiles) {
|
|
21402
|
-
let content =
|
|
21794
|
+
let content = readFileSync26(join43(reactIndexesPath, file5), "utf-8");
|
|
21403
21795
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
21404
|
-
writeFileSync9(
|
|
21796
|
+
writeFileSync9(join43(devIndexDir, file5), content);
|
|
21405
21797
|
}
|
|
21406
21798
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21407
|
-
const svelteIndexDir =
|
|
21408
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
21799
|
+
const svelteIndexDir = join43(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21800
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve32(file5).startsWith(resolve32(sveltePagesPath)));
|
|
21409
21801
|
for (const entry of sveltePageEntries) {
|
|
21410
21802
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21411
|
-
const indexFile =
|
|
21803
|
+
const indexFile = join43(svelteIndexDir, "pages", `${name}.js`);
|
|
21412
21804
|
if (!existsSync30(indexFile))
|
|
21413
21805
|
continue;
|
|
21414
|
-
let content =
|
|
21415
|
-
const srcRel = relative15(process.cwd(),
|
|
21806
|
+
let content = readFileSync26(indexFile, "utf-8");
|
|
21807
|
+
const srcRel = relative15(process.cwd(), resolve32(entry)).replace(/\\/g, "/");
|
|
21416
21808
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21417
|
-
writeFileSync9(
|
|
21809
|
+
writeFileSync9(join43(devIndexDir, `${name}.svelte.js`), content);
|
|
21418
21810
|
}
|
|
21419
21811
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21420
|
-
const vueIndexDir =
|
|
21421
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
21812
|
+
const vueIndexDir = join43(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21813
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve32(file5).startsWith(resolve32(vuePagesPath)));
|
|
21422
21814
|
for (const entry of vuePageEntries) {
|
|
21423
21815
|
const name = basename14(entry, ".vue");
|
|
21424
|
-
const indexFile =
|
|
21816
|
+
const indexFile = join43(vueIndexDir, `${name}.js`);
|
|
21425
21817
|
if (!existsSync30(indexFile))
|
|
21426
21818
|
continue;
|
|
21427
|
-
let content =
|
|
21428
|
-
const srcRel = relative15(process.cwd(),
|
|
21819
|
+
let content = readFileSync26(indexFile, "utf-8");
|
|
21820
|
+
const srcRel = relative15(process.cwd(), resolve32(entry)).replace(/\\/g, "/");
|
|
21429
21821
|
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(
|
|
21822
|
+
writeFileSync9(join43(devIndexDir, `${name}.vue.js`), content);
|
|
21431
21823
|
}
|
|
21432
21824
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
21433
21825
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21438,7 +21830,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21438
21830
|
const last = allComments[allComments.length - 1];
|
|
21439
21831
|
if (!last?.[1])
|
|
21440
21832
|
return JSON.stringify(outputPath);
|
|
21441
|
-
const srcPath =
|
|
21833
|
+
const srcPath = resolve32(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21442
21834
|
return JSON.stringify(srcPath);
|
|
21443
21835
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21444
21836
|
let depth = 0;
|
|
@@ -21475,7 +21867,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21475
21867
|
}
|
|
21476
21868
|
return result;
|
|
21477
21869
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
21478
|
-
let content =
|
|
21870
|
+
let content = readFileSync26(outputPath, "utf-8");
|
|
21479
21871
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
21480
21872
|
const useNames = [];
|
|
21481
21873
|
let match;
|
|
@@ -21525,7 +21917,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21525
21917
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
21526
21918
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
21527
21919
|
for (const outputPath of outputPaths) {
|
|
21528
|
-
let content =
|
|
21920
|
+
let content = readFileSync26(outputPath, "utf-8");
|
|
21529
21921
|
let changed = false;
|
|
21530
21922
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
21531
21923
|
const targetName = basename14(relPath);
|
|
@@ -21665,10 +22057,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21665
22057
|
restoreTracePhase();
|
|
21666
22058
|
return;
|
|
21667
22059
|
}
|
|
21668
|
-
const traceDir =
|
|
22060
|
+
const traceDir = join43(buildPath2, ".absolute-trace");
|
|
21669
22061
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21670
22062
|
mkdirSync12(traceDir, { recursive: true });
|
|
21671
|
-
writeFileSync9(
|
|
22063
|
+
writeFileSync9(join43(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21672
22064
|
events: traceEvents,
|
|
21673
22065
|
frameworks: traceFrameworkNames,
|
|
21674
22066
|
generatedAt: new Date().toISOString(),
|
|
@@ -21699,16 +22091,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21699
22091
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21700
22092
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21701
22093
|
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 &&
|
|
22094
|
+
const reactIndexesPath = reactDir && join43(getFrameworkGeneratedDir("react"), "indexes");
|
|
22095
|
+
const reactPagesPath = reactDir && join43(reactDir, "pages");
|
|
22096
|
+
const htmlPagesPath = htmlDir && join43(htmlDir, "pages");
|
|
22097
|
+
const htmlScriptsPath = htmlDir && join43(htmlDir, "scripts");
|
|
22098
|
+
const sveltePagesPath = svelteDir && join43(svelteDir, "pages");
|
|
22099
|
+
const vuePagesPath = vueDir && join43(vueDir, "pages");
|
|
22100
|
+
const htmxPagesPath = htmxDir && join43(htmxDir, "pages");
|
|
22101
|
+
const htmxScriptsPath = htmxDir && join43(htmxDir, "scripts");
|
|
22102
|
+
const angularPagesPath = angularDir && join43(angularDir, "pages");
|
|
22103
|
+
const emberPagesPath = emberDir && join43(emberDir, "pages");
|
|
21712
22104
|
const frontends = [
|
|
21713
22105
|
reactDir,
|
|
21714
22106
|
htmlDir,
|
|
@@ -21741,7 +22133,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21741
22133
|
const sourceClientRoots = [
|
|
21742
22134
|
htmlDir,
|
|
21743
22135
|
htmxDir,
|
|
21744
|
-
islandBootstrapPath &&
|
|
22136
|
+
islandBootstrapPath && dirname24(islandBootstrapPath)
|
|
21745
22137
|
].filter((dir) => Boolean(dir));
|
|
21746
22138
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21747
22139
|
if (usesGenerated)
|
|
@@ -21769,8 +22161,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21769
22161
|
const [firstEntry] = serverDirMap;
|
|
21770
22162
|
if (!firstEntry)
|
|
21771
22163
|
throw new Error("Expected at least one server directory entry");
|
|
21772
|
-
serverRoot =
|
|
21773
|
-
serverOutDir =
|
|
22164
|
+
serverRoot = join43(firstEntry.dir, firstEntry.subdir);
|
|
22165
|
+
serverOutDir = join43(buildPath, basename14(firstEntry.dir));
|
|
21774
22166
|
} else if (serverDirMap.length > 1) {
|
|
21775
22167
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21776
22168
|
serverOutDir = buildPath;
|
|
@@ -21783,18 +22175,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21783
22175
|
buildPath,
|
|
21784
22176
|
config: pwa,
|
|
21785
22177
|
generatedRoot,
|
|
22178
|
+
projectRoot,
|
|
21786
22179
|
write: !isIncremental
|
|
21787
22180
|
})) : undefined;
|
|
21788
22181
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21789
22182
|
if (!isIncremental || !incrementalFiles)
|
|
21790
22183
|
return entryPoints;
|
|
21791
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
22184
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve32(f2)));
|
|
21792
22185
|
const matchingEntries = [];
|
|
21793
22186
|
for (const entry of entryPoints) {
|
|
21794
22187
|
const sourceFile = mapToSource(entry);
|
|
21795
22188
|
if (!sourceFile)
|
|
21796
22189
|
continue;
|
|
21797
|
-
if (!normalizedIncremental.has(
|
|
22190
|
+
if (!normalizedIncremental.has(resolve32(sourceFile)))
|
|
21798
22191
|
continue;
|
|
21799
22192
|
matchingEntries.push(entry);
|
|
21800
22193
|
}
|
|
@@ -21804,7 +22197,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21804
22197
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21805
22198
|
}
|
|
21806
22199
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21807
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
22200
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join43(buildPath, "assets"), {
|
|
21808
22201
|
force: true,
|
|
21809
22202
|
recursive: true
|
|
21810
22203
|
}));
|
|
@@ -21918,11 +22311,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21918
22311
|
}
|
|
21919
22312
|
}
|
|
21920
22313
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21921
|
-
const htmlConventionsOutDir =
|
|
22314
|
+
const htmlConventionsOutDir = join43(buildPath, "conventions", "html");
|
|
21922
22315
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21923
22316
|
const htmlPathRemap = new Map;
|
|
21924
22317
|
for (const sourcePath of htmlConventionSources) {
|
|
21925
|
-
const dest =
|
|
22318
|
+
const dest = join43(htmlConventionsOutDir, basename14(sourcePath));
|
|
21926
22319
|
cpSync(sourcePath, dest, { force: true });
|
|
21927
22320
|
htmlPathRemap.set(sourcePath, dest);
|
|
21928
22321
|
}
|
|
@@ -21963,9 +22356,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21963
22356
|
}
|
|
21964
22357
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21965
22358
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21966
|
-
if (entry.startsWith(
|
|
22359
|
+
if (entry.startsWith(resolve32(reactIndexesPath))) {
|
|
21967
22360
|
const pageName = basename14(entry, ".tsx");
|
|
21968
|
-
return
|
|
22361
|
+
return join43(reactPagesPath, `${pageName}.tsx`);
|
|
21969
22362
|
}
|
|
21970
22363
|
return null;
|
|
21971
22364
|
}) : allReactEntries;
|
|
@@ -21997,7 +22390,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21997
22390
|
for (const entry of vueEntries) {
|
|
21998
22391
|
const name = basename14(entry, ".vue");
|
|
21999
22392
|
if (ssrOnlyPageNames.has(name)) {
|
|
22000
|
-
resolved.add(
|
|
22393
|
+
resolved.add(resolve32(entry));
|
|
22001
22394
|
}
|
|
22002
22395
|
}
|
|
22003
22396
|
return resolved;
|
|
@@ -22134,7 +22527,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22134
22527
|
const clientPath = islandSvelteClientPaths[idx];
|
|
22135
22528
|
if (!sourcePath || !clientPath)
|
|
22136
22529
|
continue;
|
|
22137
|
-
islandSvelteClientPathMap.set(
|
|
22530
|
+
islandSvelteClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22138
22531
|
}
|
|
22139
22532
|
const islandVueClientPathMap = new Map;
|
|
22140
22533
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -22142,7 +22535,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22142
22535
|
const clientPath = islandVueClientPaths[idx];
|
|
22143
22536
|
if (!sourcePath || !clientPath)
|
|
22144
22537
|
continue;
|
|
22145
|
-
islandVueClientPathMap.set(
|
|
22538
|
+
islandVueClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22146
22539
|
}
|
|
22147
22540
|
const islandAngularClientPathMap = new Map;
|
|
22148
22541
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -22150,7 +22543,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22150
22543
|
const clientPath = islandAngularClientPaths[idx];
|
|
22151
22544
|
if (!sourcePath || !clientPath)
|
|
22152
22545
|
continue;
|
|
22153
|
-
islandAngularClientPathMap.set(
|
|
22546
|
+
islandAngularClientPathMap.set(resolve32(sourcePath), clientPath);
|
|
22154
22547
|
}
|
|
22155
22548
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
22156
22549
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -22161,7 +22554,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22161
22554
|
const compileReactConventions = async () => {
|
|
22162
22555
|
if (reactConventionSources.length === 0)
|
|
22163
22556
|
return emptyStringArray;
|
|
22164
|
-
const destDir =
|
|
22557
|
+
const destDir = join43(buildPath, "conventions", "react");
|
|
22165
22558
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22166
22559
|
mkdirSync12(destDir, { recursive: true });
|
|
22167
22560
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -22176,7 +22569,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22176
22569
|
stylePreprocessorPlugin2,
|
|
22177
22570
|
createBunStringRawUnicodePlugin()
|
|
22178
22571
|
],
|
|
22179
|
-
root:
|
|
22572
|
+
root: dirname24(source),
|
|
22180
22573
|
target: "bun",
|
|
22181
22574
|
throw: false,
|
|
22182
22575
|
tsconfig: "./tsconfig.json"
|
|
@@ -22204,7 +22597,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22204
22597
|
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
22598
|
]);
|
|
22206
22599
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
22207
|
-
const destDir =
|
|
22600
|
+
const destDir = join43(buildPath, "conventions", framework);
|
|
22208
22601
|
rmSync2(destDir, { force: true, recursive: true });
|
|
22209
22602
|
mkdirSync12(destDir, { recursive: true });
|
|
22210
22603
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -22265,7 +22658,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22265
22658
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
22266
22659
|
];
|
|
22267
22660
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
22268
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22661
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname24(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file5) => dirname24(file5)), projectRoot);
|
|
22269
22662
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
22270
22663
|
buildInfo: islandBuildInfo,
|
|
22271
22664
|
buildPath,
|
|
@@ -22276,7 +22669,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22276
22669
|
}
|
|
22277
22670
|
})) : {
|
|
22278
22671
|
entries: [],
|
|
22279
|
-
generatedRoot:
|
|
22672
|
+
generatedRoot: join43(buildPath, "_island_entries")
|
|
22280
22673
|
};
|
|
22281
22674
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
22282
22675
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -22312,7 +22705,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22312
22705
|
return {};
|
|
22313
22706
|
}
|
|
22314
22707
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
22315
|
-
const refreshEntry =
|
|
22708
|
+
const refreshEntry = join43(reactIndexesPath, "_refresh.tsx");
|
|
22316
22709
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
22317
22710
|
reactClientEntryPoints.push(refreshEntry);
|
|
22318
22711
|
}
|
|
@@ -22423,19 +22816,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22423
22816
|
throw: false
|
|
22424
22817
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
22425
22818
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
22426
|
-
rmSync2(
|
|
22819
|
+
rmSync2(join43(buildPath, "react", "generated", "indexes"), {
|
|
22427
22820
|
force: true,
|
|
22428
22821
|
recursive: true
|
|
22429
22822
|
});
|
|
22430
22823
|
}
|
|
22431
22824
|
if (angularDir && angularClientPaths.length > 0) {
|
|
22432
|
-
rmSync2(
|
|
22825
|
+
rmSync2(join43(buildPath, "angular", "indexes"), {
|
|
22433
22826
|
force: true,
|
|
22434
22827
|
recursive: true
|
|
22435
22828
|
});
|
|
22436
22829
|
}
|
|
22437
22830
|
if (islandClientEntryPoints.length > 0) {
|
|
22438
|
-
rmSync2(
|
|
22831
|
+
rmSync2(join43(buildPath, "islands"), {
|
|
22439
22832
|
force: true,
|
|
22440
22833
|
recursive: true
|
|
22441
22834
|
});
|
|
@@ -22549,7 +22942,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22549
22942
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22550
22943
|
entrypoints: globalCssEntries,
|
|
22551
22944
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22552
|
-
outdir: stylesDir ?
|
|
22945
|
+
outdir: stylesDir ? join43(buildPath, basename14(stylesDir)) : buildPath,
|
|
22553
22946
|
plugins: [stylePreprocessorPlugin2],
|
|
22554
22947
|
root: stylesDir || clientRoot,
|
|
22555
22948
|
target: "browser",
|
|
@@ -22558,7 +22951,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22558
22951
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22559
22952
|
entrypoints: vueCssPaths,
|
|
22560
22953
|
naming: `[name].[hash].[ext]`,
|
|
22561
|
-
outdir:
|
|
22954
|
+
outdir: join43(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22562
22955
|
target: "browser",
|
|
22563
22956
|
throw: false
|
|
22564
22957
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22582,18 +22975,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22582
22975
|
}
|
|
22583
22976
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22584
22977
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22585
|
-
const sourcemapDir =
|
|
22978
|
+
const sourcemapDir = join43(projectRoot, "sourcemaps");
|
|
22586
22979
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22587
22980
|
const mapFiles = readdirSync5(buildPath, {
|
|
22588
22981
|
encoding: "utf8",
|
|
22589
22982
|
recursive: true
|
|
22590
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22983
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join43(buildPath, entry));
|
|
22591
22984
|
for (const mapPath of mapFiles) {
|
|
22592
22985
|
chainExternalSourcemap2(mapPath);
|
|
22593
|
-
renameSync(mapPath,
|
|
22986
|
+
renameSync(mapPath, join43(sourcemapDir, basename14(mapPath)));
|
|
22594
22987
|
const jsPath = mapPath.slice(0, -4);
|
|
22595
22988
|
try {
|
|
22596
|
-
const javascript =
|
|
22989
|
+
const javascript = readFileSync26(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
22597
22990
|
`);
|
|
22598
22991
|
writeFileSync9(jsPath, javascript);
|
|
22599
22992
|
} catch {}
|
|
@@ -22664,7 +23057,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22664
23057
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22665
23058
|
}
|
|
22666
23059
|
if (!hmr) {
|
|
22667
|
-
const reactVendorDir =
|
|
23060
|
+
const reactVendorDir = join43(buildPath, "react", "vendor");
|
|
22668
23061
|
const vendorChunkPaths = existsSync30(reactVendorDir) ? [
|
|
22669
23062
|
...new Glob8("**/*.js").scanSync({
|
|
22670
23063
|
absolute: true,
|
|
@@ -22681,7 +23074,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22681
23074
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22682
23075
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22683
23076
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22684
|
-
const fileDir =
|
|
23077
|
+
const fileDir = dirname24(artifact.path);
|
|
22685
23078
|
const relativePaths = {};
|
|
22686
23079
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22687
23080
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22809,7 +23202,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22809
23202
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
22810
23203
|
if (!hmrClientBundle)
|
|
22811
23204
|
return;
|
|
22812
|
-
let html =
|
|
23205
|
+
let html = readFileSync26(filePath, "utf-8");
|
|
22813
23206
|
if (html.includes("data-hmr-client"))
|
|
22814
23207
|
return;
|
|
22815
23208
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -22820,7 +23213,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22820
23213
|
const processHtmlPages = async () => {
|
|
22821
23214
|
if (!(htmlDir && htmlPagesPath))
|
|
22822
23215
|
return;
|
|
22823
|
-
const outputHtmlPages = isSingle ?
|
|
23216
|
+
const outputHtmlPages = isSingle ? join43(buildPath, "pages") : join43(buildPath, basename14(htmlDir), "pages");
|
|
22824
23217
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22825
23218
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22826
23219
|
force: true,
|
|
@@ -22836,7 +23229,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22836
23229
|
if (hmr)
|
|
22837
23230
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
22838
23231
|
if (pwaArtifacts) {
|
|
22839
|
-
const source =
|
|
23232
|
+
const source = readFileSync26(htmlFile, "utf8");
|
|
22840
23233
|
writeFileSync9(htmlFile, injectPwaBootstrapHtml(source));
|
|
22841
23234
|
}
|
|
22842
23235
|
const fileName = basename14(htmlFile, ".html");
|
|
@@ -22849,14 +23242,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22849
23242
|
const processHtmxPages = async () => {
|
|
22850
23243
|
if (!(htmxDir && htmxPagesPath))
|
|
22851
23244
|
return;
|
|
22852
|
-
const outputHtmxPages = isSingle ?
|
|
23245
|
+
const outputHtmxPages = isSingle ? join43(buildPath, "pages") : join43(buildPath, basename14(htmxDir), "pages");
|
|
22853
23246
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22854
23247
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22855
23248
|
force: true,
|
|
22856
23249
|
recursive: true
|
|
22857
23250
|
});
|
|
22858
23251
|
if (shouldCopyHtmx) {
|
|
22859
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
23252
|
+
const htmxDestDir = isSingle ? buildPath : join43(buildPath, basename14(htmxDir));
|
|
22860
23253
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22861
23254
|
}
|
|
22862
23255
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22869,7 +23262,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22869
23262
|
if (hmr)
|
|
22870
23263
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
22871
23264
|
if (pwaArtifacts) {
|
|
22872
|
-
const source =
|
|
23265
|
+
const source = readFileSync26(htmxFile, "utf8");
|
|
22873
23266
|
writeFileSync9(htmxFile, injectPwaBootstrapHtml(source));
|
|
22874
23267
|
}
|
|
22875
23268
|
const fileName = basename14(htmxFile, ".html");
|
|
@@ -22932,22 +23325,22 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22932
23325
|
angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
|
|
22933
23326
|
]);
|
|
22934
23327
|
const spaRouteHosts = [
|
|
22935
|
-
...reactSpaHosts.map((
|
|
22936
|
-
...
|
|
23328
|
+
...reactSpaHosts.map((host2) => ({
|
|
23329
|
+
...host2,
|
|
22937
23330
|
framework: "react"
|
|
22938
23331
|
})),
|
|
22939
|
-
...svelteSpaHosts.map((
|
|
22940
|
-
...
|
|
23332
|
+
...svelteSpaHosts.map((host2) => ({
|
|
23333
|
+
...host2,
|
|
22941
23334
|
framework: "svelte"
|
|
22942
23335
|
})),
|
|
22943
|
-
...vueSpaHosts.map((
|
|
22944
|
-
...angularSpaHosts.map((
|
|
22945
|
-
...
|
|
23336
|
+
...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
|
|
23337
|
+
...angularSpaHosts.map((host2) => ({
|
|
23338
|
+
...host2,
|
|
22946
23339
|
framework: "angular"
|
|
22947
23340
|
}))
|
|
22948
23341
|
];
|
|
22949
23342
|
setSpaRouteManifest(spaRouteHosts);
|
|
22950
|
-
writeFileSync9(
|
|
23343
|
+
writeFileSync9(join43(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22951
23344
|
if (isIncremental) {
|
|
22952
23345
|
writeBuildTrace(buildPath);
|
|
22953
23346
|
return {
|
|
@@ -22956,9 +23349,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22956
23349
|
manifest
|
|
22957
23350
|
};
|
|
22958
23351
|
}
|
|
22959
|
-
writeFileSync9(
|
|
23352
|
+
writeFileSync9(join43(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22960
23353
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22961
|
-
writeFileSync9(
|
|
23354
|
+
writeFileSync9(join43(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22962
23355
|
}
|
|
22963
23356
|
writeBuildTrace(buildPath);
|
|
22964
23357
|
if (mode === "production") {
|
|
@@ -23092,7 +23485,7 @@ var init_build = __esm(() => {
|
|
|
23092
23485
|
|
|
23093
23486
|
// src/build/buildEmberVendor.ts
|
|
23094
23487
|
import { mkdirSync as mkdirSync13, existsSync as existsSync31 } from "fs";
|
|
23095
|
-
import { join as
|
|
23488
|
+
import { join as join44 } from "path";
|
|
23096
23489
|
import { rm as rm13 } from "fs/promises";
|
|
23097
23490
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
23098
23491
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -23144,7 +23537,7 @@ export const importSync = (specifier) => {
|
|
|
23144
23537
|
if (standaloneSpecifiers.has(specifier)) {
|
|
23145
23538
|
return { resolveTo: specifier, specifier };
|
|
23146
23539
|
}
|
|
23147
|
-
const emberInternalPath =
|
|
23540
|
+
const emberInternalPath = join44(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
23148
23541
|
if (!existsSync31(emberInternalPath)) {
|
|
23149
23542
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
23150
23543
|
}
|
|
@@ -23176,7 +23569,7 @@ export const importSync = (specifier) => {
|
|
|
23176
23569
|
if (standalonePackages.has(args.path)) {
|
|
23177
23570
|
return;
|
|
23178
23571
|
}
|
|
23179
|
-
const internal =
|
|
23572
|
+
const internal = join44(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
23180
23573
|
if (existsSync31(internal)) {
|
|
23181
23574
|
return { path: internal };
|
|
23182
23575
|
}
|
|
@@ -23184,16 +23577,16 @@ export const importSync = (specifier) => {
|
|
|
23184
23577
|
});
|
|
23185
23578
|
}
|
|
23186
23579
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
23187
|
-
const vendorDir =
|
|
23580
|
+
const vendorDir = join44(buildDir, "ember", "vendor");
|
|
23188
23581
|
mkdirSync13(vendorDir, { recursive: true });
|
|
23189
|
-
const tmpDir =
|
|
23582
|
+
const tmpDir = join44(buildDir, "_ember_vendor_tmp");
|
|
23190
23583
|
mkdirSync13(tmpDir, { recursive: true });
|
|
23191
|
-
const macrosShimPath =
|
|
23584
|
+
const macrosShimPath = join44(tmpDir, "embroider_macros_shim.js");
|
|
23192
23585
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
23193
23586
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
23194
23587
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
23195
23588
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
23196
|
-
const entryPath =
|
|
23589
|
+
const entryPath = join44(tmpDir, `${safeName}.js`);
|
|
23197
23590
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
23198
23591
|
` : generateVendorEntrySource2(resolution);
|
|
23199
23592
|
await Bun.write(entryPath, source);
|
|
@@ -23349,9 +23742,9 @@ __export(exports_dependencyGraph, {
|
|
|
23349
23742
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
23350
23743
|
addFileToGraph: () => addFileToGraph
|
|
23351
23744
|
});
|
|
23352
|
-
import { existsSync as existsSync32, readFileSync as
|
|
23745
|
+
import { existsSync as existsSync32, readFileSync as readFileSync27 } from "fs";
|
|
23353
23746
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23354
|
-
import { resolve as
|
|
23747
|
+
import { resolve as resolve33 } from "path";
|
|
23355
23748
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23356
23749
|
const lower = filePath.toLowerCase();
|
|
23357
23750
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23365,8 +23758,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23365
23758
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23366
23759
|
return null;
|
|
23367
23760
|
}
|
|
23368
|
-
const fromDir =
|
|
23369
|
-
const normalized =
|
|
23761
|
+
const fromDir = resolve33(fromFile, "..");
|
|
23762
|
+
const normalized = resolve33(fromDir, importPath);
|
|
23370
23763
|
const extensions = [
|
|
23371
23764
|
".ts",
|
|
23372
23765
|
".tsx",
|
|
@@ -23396,7 +23789,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23396
23789
|
dependents.delete(normalizedPath);
|
|
23397
23790
|
}
|
|
23398
23791
|
}, addFileToGraph = (graph, filePath) => {
|
|
23399
|
-
const normalizedPath =
|
|
23792
|
+
const normalizedPath = resolve33(filePath);
|
|
23400
23793
|
if (!existsSync32(normalizedPath))
|
|
23401
23794
|
return;
|
|
23402
23795
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -23423,10 +23816,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23423
23816
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23424
23817
|
const processedFiles = new Set;
|
|
23425
23818
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23426
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23819
|
+
const resolvedDirs = directories.map((dir) => resolve33(dir)).filter((dir) => existsSync32(dir));
|
|
23427
23820
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23428
23821
|
for (const file5 of allFiles) {
|
|
23429
|
-
const fullPath =
|
|
23822
|
+
const fullPath = resolve33(file5);
|
|
23430
23823
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23431
23824
|
continue;
|
|
23432
23825
|
if (processedFiles.has(fullPath))
|
|
@@ -23520,15 +23913,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23520
23913
|
const lowerPath = filePath.toLowerCase();
|
|
23521
23914
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
23522
23915
|
if (loader === "html") {
|
|
23523
|
-
const content =
|
|
23916
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23524
23917
|
return extractHtmlDependencies(filePath, content);
|
|
23525
23918
|
}
|
|
23526
23919
|
if (loader === "tsx" || loader === "js") {
|
|
23527
|
-
const content =
|
|
23920
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23528
23921
|
return extractJsDependencies(filePath, content, loader);
|
|
23529
23922
|
}
|
|
23530
23923
|
if (isSvelteOrVue) {
|
|
23531
|
-
const content =
|
|
23924
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
23532
23925
|
return extractSvelteVueDependencies(filePath, content);
|
|
23533
23926
|
}
|
|
23534
23927
|
return [];
|
|
@@ -23539,7 +23932,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23539
23932
|
return [];
|
|
23540
23933
|
}
|
|
23541
23934
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23542
|
-
const normalizedPath =
|
|
23935
|
+
const normalizedPath = resolve33(changedFile);
|
|
23543
23936
|
const affected = new Set;
|
|
23544
23937
|
const toProcess = [normalizedPath];
|
|
23545
23938
|
const processNode = (current) => {
|
|
@@ -23570,7 +23963,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23570
23963
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23571
23964
|
graph.dependents.delete(normalizedPath);
|
|
23572
23965
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23573
|
-
const normalizedPath =
|
|
23966
|
+
const normalizedPath = resolve33(filePath);
|
|
23574
23967
|
removeDepsForFile(graph, normalizedPath);
|
|
23575
23968
|
removeDependentsForFile(graph, normalizedPath);
|
|
23576
23969
|
};
|
|
@@ -23613,12 +24006,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23613
24006
|
};
|
|
23614
24007
|
|
|
23615
24008
|
// src/dev/configResolver.ts
|
|
23616
|
-
import { resolve as
|
|
24009
|
+
import { resolve as resolve34 } from "path";
|
|
23617
24010
|
var resolveBuildPaths = (config) => {
|
|
23618
24011
|
const cwd2 = process.cwd();
|
|
23619
24012
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23620
|
-
const withDefault = (value, fallback) => normalize(
|
|
23621
|
-
const optional = (value) => value ? normalize(
|
|
24013
|
+
const withDefault = (value, fallback) => normalize(resolve34(cwd2, value ?? fallback));
|
|
24014
|
+
const optional = (value) => value ? normalize(resolve34(cwd2, value)) : undefined;
|
|
23622
24015
|
return {
|
|
23623
24016
|
angularDir: optional(config.angularDirectory),
|
|
23624
24017
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23676,8 +24069,8 @@ var init_clientManager = __esm(() => {
|
|
|
23676
24069
|
});
|
|
23677
24070
|
|
|
23678
24071
|
// src/dev/pathUtils.ts
|
|
23679
|
-
import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as
|
|
23680
|
-
import { dirname as
|
|
24072
|
+
import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as readFileSync28 } from "fs";
|
|
24073
|
+
import { dirname as dirname25, resolve as resolve35 } from "path";
|
|
23681
24074
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23682
24075
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23683
24076
|
return "ignored";
|
|
@@ -23753,7 +24146,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23753
24146
|
return "unknown";
|
|
23754
24147
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23755
24148
|
const out = new Set;
|
|
23756
|
-
const angularRoot =
|
|
24149
|
+
const angularRoot = resolve35(angularDir);
|
|
23757
24150
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
23758
24151
|
const walk = (dir) => {
|
|
23759
24152
|
let entries;
|
|
@@ -23766,7 +24159,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23766
24159
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23767
24160
|
continue;
|
|
23768
24161
|
}
|
|
23769
|
-
const full =
|
|
24162
|
+
const full = resolve35(dir, entry.name);
|
|
23770
24163
|
if (entry.isDirectory()) {
|
|
23771
24164
|
walk(full);
|
|
23772
24165
|
continue;
|
|
@@ -23776,7 +24169,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23776
24169
|
}
|
|
23777
24170
|
let source;
|
|
23778
24171
|
try {
|
|
23779
|
-
source =
|
|
24172
|
+
source = readFileSync28(full, "utf8");
|
|
23780
24173
|
} catch {
|
|
23781
24174
|
continue;
|
|
23782
24175
|
}
|
|
@@ -23805,10 +24198,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23805
24198
|
refs.push(strMatch[1]);
|
|
23806
24199
|
}
|
|
23807
24200
|
}
|
|
23808
|
-
const componentDir =
|
|
24201
|
+
const componentDir = dirname25(full);
|
|
23809
24202
|
for (const ref of refs) {
|
|
23810
|
-
const refAbs = normalizePath2(
|
|
23811
|
-
const refDir = normalizePath2(
|
|
24203
|
+
const refAbs = normalizePath2(resolve35(componentDir, ref));
|
|
24204
|
+
const refDir = normalizePath2(dirname25(refAbs));
|
|
23812
24205
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23813
24206
|
continue;
|
|
23814
24207
|
}
|
|
@@ -23824,7 +24217,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23824
24217
|
const push = (path) => {
|
|
23825
24218
|
if (!path)
|
|
23826
24219
|
return;
|
|
23827
|
-
const abs = normalizePath2(
|
|
24220
|
+
const abs = normalizePath2(resolve35(cwd2, path));
|
|
23828
24221
|
if (!roots.includes(abs))
|
|
23829
24222
|
roots.push(abs);
|
|
23830
24223
|
};
|
|
@@ -23849,7 +24242,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23849
24242
|
push(cfg.assetsDir);
|
|
23850
24243
|
push(cfg.stylesDir);
|
|
23851
24244
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23852
|
-
const abs = normalizePath2(
|
|
24245
|
+
const abs = normalizePath2(resolve35(cwd2, candidate));
|
|
23853
24246
|
if (existsSync33(abs) && !roots.includes(abs))
|
|
23854
24247
|
roots.push(abs);
|
|
23855
24248
|
}
|
|
@@ -23860,7 +24253,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23860
24253
|
continue;
|
|
23861
24254
|
if (entry.name.startsWith("."))
|
|
23862
24255
|
continue;
|
|
23863
|
-
const abs = normalizePath2(
|
|
24256
|
+
const abs = normalizePath2(resolve35(cwd2, entry.name));
|
|
23864
24257
|
if (roots.includes(abs))
|
|
23865
24258
|
continue;
|
|
23866
24259
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23944,7 +24337,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23944
24337
|
// src/dev/fileWatcher.ts
|
|
23945
24338
|
import { watch } from "fs";
|
|
23946
24339
|
import { existsSync as existsSync34, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23947
|
-
import { dirname as
|
|
24340
|
+
import { dirname as dirname26, join as join45, resolve as resolve36 } from "path";
|
|
23948
24341
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23949
24342
|
try {
|
|
23950
24343
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23976,7 +24369,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23976
24369
|
for (const name of entries) {
|
|
23977
24370
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23978
24371
|
continue;
|
|
23979
|
-
const child =
|
|
24372
|
+
const child = join45(eventDir, name).replace(/\\/g, "/");
|
|
23980
24373
|
let st2;
|
|
23981
24374
|
try {
|
|
23982
24375
|
st2 = statSync4(child);
|
|
@@ -23997,7 +24390,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23997
24390
|
return;
|
|
23998
24391
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23999
24392
|
if (event === "rename") {
|
|
24000
|
-
const eventDir =
|
|
24393
|
+
const eventDir = dirname26(join45(absolutePath, filename)).replace(/\\/g, "/");
|
|
24001
24394
|
atomicRecoveryScan(eventDir);
|
|
24002
24395
|
for (const delay of [25, 100]) {
|
|
24003
24396
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -24006,7 +24399,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24006
24399
|
}
|
|
24007
24400
|
return;
|
|
24008
24401
|
}
|
|
24009
|
-
const fullPath =
|
|
24402
|
+
const fullPath = join45(absolutePath, filename).replace(/\\/g, "/");
|
|
24010
24403
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
24011
24404
|
return;
|
|
24012
24405
|
}
|
|
@@ -24024,7 +24417,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24024
24417
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
24025
24418
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24026
24419
|
paths.forEach((path) => {
|
|
24027
|
-
const absolutePath =
|
|
24420
|
+
const absolutePath = resolve36(path).replace(/\\/g, "/");
|
|
24028
24421
|
if (!existsSync34(absolutePath)) {
|
|
24029
24422
|
return;
|
|
24030
24423
|
}
|
|
@@ -24035,7 +24428,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24035
24428
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
24036
24429
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24037
24430
|
watchPaths.forEach((path) => {
|
|
24038
|
-
const absolutePath =
|
|
24431
|
+
const absolutePath = resolve36(path).replace(/\\/g, "/");
|
|
24039
24432
|
if (!existsSync34(absolutePath)) {
|
|
24040
24433
|
return;
|
|
24041
24434
|
}
|
|
@@ -24054,13 +24447,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
24054
24447
|
});
|
|
24055
24448
|
|
|
24056
24449
|
// src/dev/assetStore.ts
|
|
24057
|
-
import { resolve as
|
|
24450
|
+
import { resolve as resolve37 } from "path";
|
|
24058
24451
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
24059
24452
|
var mimeTypes, getMimeType = (filePath) => {
|
|
24060
24453
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
24061
24454
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
24062
24455
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
24063
|
-
const fullPath =
|
|
24456
|
+
const fullPath = resolve37(dir, entry.name);
|
|
24064
24457
|
if (entry.isDirectory()) {
|
|
24065
24458
|
return walkAndClean(fullPath);
|
|
24066
24459
|
}
|
|
@@ -24076,10 +24469,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24076
24469
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
24077
24470
|
const liveByIdentity = new Map;
|
|
24078
24471
|
for (const webPath of store.keys()) {
|
|
24079
|
-
const diskPath =
|
|
24472
|
+
const diskPath = resolve37(buildDir, webPath.slice(1));
|
|
24080
24473
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
24081
24474
|
}
|
|
24082
|
-
const absBuildDir =
|
|
24475
|
+
const absBuildDir = resolve37(buildDir);
|
|
24083
24476
|
Object.values(manifest).forEach((val) => {
|
|
24084
24477
|
if (!HASHED_FILE_RE.test(val))
|
|
24085
24478
|
return;
|
|
@@ -24097,7 +24490,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24097
24490
|
} catch {}
|
|
24098
24491
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
24099
24492
|
if (entry.isDirectory()) {
|
|
24100
|
-
return scanDir(
|
|
24493
|
+
return scanDir(resolve37(dir, entry.name), `${prefix}${entry.name}/`);
|
|
24101
24494
|
}
|
|
24102
24495
|
if (!entry.name.startsWith("chunk-")) {
|
|
24103
24496
|
return null;
|
|
@@ -24106,7 +24499,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24106
24499
|
if (store.has(webPath)) {
|
|
24107
24500
|
return null;
|
|
24108
24501
|
}
|
|
24109
|
-
return Bun.file(
|
|
24502
|
+
return Bun.file(resolve37(dir, entry.name)).bytes().then((bytes) => {
|
|
24110
24503
|
store.set(webPath, bytes);
|
|
24111
24504
|
return;
|
|
24112
24505
|
}).catch(() => {});
|
|
@@ -24128,7 +24521,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
24128
24521
|
for (const webPath of newIdentities.values()) {
|
|
24129
24522
|
if (store.has(webPath))
|
|
24130
24523
|
continue;
|
|
24131
|
-
loadPromises.push(Bun.file(
|
|
24524
|
+
loadPromises.push(Bun.file(resolve37(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
24132
24525
|
store.set(webPath, bytes);
|
|
24133
24526
|
return;
|
|
24134
24527
|
}).catch(() => {}));
|
|
@@ -24173,10 +24566,10 @@ var init_assetStore = __esm(() => {
|
|
|
24173
24566
|
});
|
|
24174
24567
|
|
|
24175
24568
|
// src/dev/fileHashTracker.ts
|
|
24176
|
-
import { readFileSync as
|
|
24569
|
+
import { readFileSync as readFileSync29 } from "fs";
|
|
24177
24570
|
var computeFileHash = (filePath) => {
|
|
24178
24571
|
try {
|
|
24179
|
-
const fileContent =
|
|
24572
|
+
const fileContent = readFileSync29(filePath);
|
|
24180
24573
|
return Number(Bun.hash(fileContent));
|
|
24181
24574
|
} catch {
|
|
24182
24575
|
return UNFOUND_INDEX;
|
|
@@ -24212,9 +24605,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
|
|
|
24212
24605
|
set.add(filePath);
|
|
24213
24606
|
}
|
|
24214
24607
|
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
24215
|
-
const
|
|
24216
|
-
if (
|
|
24217
|
-
return
|
|
24608
|
+
const component2 = [...parents].find(isComponentFile);
|
|
24609
|
+
if (component2 !== undefined)
|
|
24610
|
+
return component2;
|
|
24218
24611
|
for (const parent of parents)
|
|
24219
24612
|
queue.push(parent);
|
|
24220
24613
|
return;
|
|
@@ -24269,9 +24662,9 @@ var init_transformCache = __esm(() => {
|
|
|
24269
24662
|
});
|
|
24270
24663
|
|
|
24271
24664
|
// src/dev/reactComponentClassifier.ts
|
|
24272
|
-
import { resolve as
|
|
24665
|
+
import { resolve as resolve38 } from "path";
|
|
24273
24666
|
var classifyComponent = (filePath) => {
|
|
24274
|
-
const normalizedPath =
|
|
24667
|
+
const normalizedPath = resolve38(filePath);
|
|
24275
24668
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24276
24669
|
return "server";
|
|
24277
24670
|
}
|
|
@@ -24283,7 +24676,7 @@ var classifyComponent = (filePath) => {
|
|
|
24283
24676
|
var init_reactComponentClassifier = () => {};
|
|
24284
24677
|
|
|
24285
24678
|
// src/dev/moduleMapper.ts
|
|
24286
|
-
import { basename as basename15, resolve as
|
|
24679
|
+
import { basename as basename15, resolve as resolve39 } from "path";
|
|
24287
24680
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24288
24681
|
const modulePaths = {};
|
|
24289
24682
|
moduleKeys.forEach((key) => {
|
|
@@ -24293,7 +24686,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24293
24686
|
});
|
|
24294
24687
|
return modulePaths;
|
|
24295
24688
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24296
|
-
const normalizedFile =
|
|
24689
|
+
const normalizedFile = resolve39(sourceFile);
|
|
24297
24690
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24298
24691
|
if (processedFiles.has(normalizedFile)) {
|
|
24299
24692
|
return null;
|
|
@@ -24329,7 +24722,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24329
24722
|
});
|
|
24330
24723
|
return grouped;
|
|
24331
24724
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24332
|
-
const normalizedFile =
|
|
24725
|
+
const normalizedFile = resolve39(sourceFile);
|
|
24333
24726
|
const fileName = basename15(normalizedFile);
|
|
24334
24727
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24335
24728
|
const pascalName = toPascal(baseName);
|
|
@@ -24385,7 +24778,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
24385
24778
|
|
|
24386
24779
|
// src/utils/spaRouteCss.ts
|
|
24387
24780
|
import { readFile as readFile9 } from "fs/promises";
|
|
24388
|
-
import { dirname as
|
|
24781
|
+
import { dirname as dirname27, isAbsolute as isAbsolute5, resolve as resolve40 } from "path";
|
|
24389
24782
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
24390
24783
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
24391
24784
|
if (cached !== undefined)
|
|
@@ -24423,7 +24816,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24423
24816
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24424
24817
|
if (!cssPath)
|
|
24425
24818
|
return "";
|
|
24426
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24819
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve40(dirname27(sideManifestPath), cssPath);
|
|
24427
24820
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24428
24821
|
if (cached !== undefined)
|
|
24429
24822
|
return cached;
|
|
@@ -24506,8 +24899,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
24506
24899
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
24507
24900
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24508
24901
|
});
|
|
24509
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
24510
|
-
import { dirname as
|
|
24902
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync30, statSync as statSync5 } from "fs";
|
|
24903
|
+
import { dirname as dirname28, extname as extname11, join as join46, resolve as resolve41 } from "path";
|
|
24511
24904
|
import ts18 from "typescript";
|
|
24512
24905
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24513
24906
|
const out = [];
|
|
@@ -24522,7 +24915,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24522
24915
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24523
24916
|
continue;
|
|
24524
24917
|
}
|
|
24525
|
-
const full =
|
|
24918
|
+
const full = join46(dir, entry.name);
|
|
24526
24919
|
if (entry.isDirectory()) {
|
|
24527
24920
|
visit(full);
|
|
24528
24921
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24566,7 +24959,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24566
24959
|
}, parseDecoratedClasses = (filePath) => {
|
|
24567
24960
|
let source;
|
|
24568
24961
|
try {
|
|
24569
|
-
source =
|
|
24962
|
+
source = readFileSync30(filePath, "utf8");
|
|
24570
24963
|
} catch {
|
|
24571
24964
|
return [];
|
|
24572
24965
|
}
|
|
@@ -24620,7 +25013,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24620
25013
|
};
|
|
24621
25014
|
visit(sourceFile);
|
|
24622
25015
|
return out;
|
|
24623
|
-
}, safeNormalize = (path) =>
|
|
25016
|
+
}, safeNormalize = (path) => resolve41(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24624
25017
|
const { changedFilePath, userAngularRoot } = params;
|
|
24625
25018
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24626
25019
|
const out = [];
|
|
@@ -24656,12 +25049,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24656
25049
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
24657
25050
|
let source;
|
|
24658
25051
|
try {
|
|
24659
|
-
source =
|
|
25052
|
+
source = readFileSync30(childFilePath, "utf8");
|
|
24660
25053
|
} catch {
|
|
24661
25054
|
return null;
|
|
24662
25055
|
}
|
|
24663
25056
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24664
|
-
const childDir =
|
|
25057
|
+
const childDir = dirname28(childFilePath);
|
|
24665
25058
|
for (const stmt of sourceFile.statements) {
|
|
24666
25059
|
if (!ts18.isImportDeclaration(stmt))
|
|
24667
25060
|
continue;
|
|
@@ -24689,7 +25082,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24689
25082
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24690
25083
|
return null;
|
|
24691
25084
|
}
|
|
24692
|
-
const base =
|
|
25085
|
+
const base = resolve41(childDir, spec);
|
|
24693
25086
|
const candidates = [
|
|
24694
25087
|
`${base}.ts`,
|
|
24695
25088
|
`${base}.tsx`,
|
|
@@ -24718,7 +25111,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24718
25111
|
const parentFile = new Map;
|
|
24719
25112
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24720
25113
|
const classes = parseDecoratedClasses(tsPath);
|
|
24721
|
-
const componentDir =
|
|
25114
|
+
const componentDir = dirname28(tsPath);
|
|
24722
25115
|
for (const cls of classes) {
|
|
24723
25116
|
const entity = {
|
|
24724
25117
|
className: cls.className,
|
|
@@ -24727,7 +25120,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
24727
25120
|
};
|
|
24728
25121
|
if (cls.kind === "component") {
|
|
24729
25122
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24730
|
-
const abs = safeNormalize(
|
|
25123
|
+
const abs = safeNormalize(resolve41(componentDir, url));
|
|
24731
25124
|
const existing = resource.get(abs);
|
|
24732
25125
|
if (existing)
|
|
24733
25126
|
existing.push(entity);
|
|
@@ -24969,8 +25362,8 @@ __export(exports_moduleServer, {
|
|
|
24969
25362
|
createModuleServer: () => createModuleServer,
|
|
24970
25363
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24971
25364
|
});
|
|
24972
|
-
import { existsSync as existsSync35, readFileSync as
|
|
24973
|
-
import { basename as basename16, dirname as
|
|
25365
|
+
import { existsSync as existsSync35, readFileSync as readFileSync31, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25366
|
+
import { basename as basename16, dirname as dirname29, extname as extname12, join as join47, resolve as resolve42, relative as relative16 } from "path";
|
|
24974
25367
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24975
25368
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24976
25369
|
const allExports = [];
|
|
@@ -24990,10 +25383,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24990
25383
|
${stubs}
|
|
24991
25384
|
`;
|
|
24992
25385
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24993
|
-
const directHit = extensions.find((ext) => existsSync35(
|
|
25386
|
+
const directHit = extensions.find((ext) => existsSync35(resolve42(projectRoot, srcPath + ext)));
|
|
24994
25387
|
if (directHit)
|
|
24995
25388
|
return srcPath + directHit;
|
|
24996
|
-
const indexHit = extensions.find((ext) => existsSync35(
|
|
25389
|
+
const indexHit = extensions.find((ext) => existsSync35(resolve42(projectRoot, srcPath, `index${ext}`)));
|
|
24997
25390
|
if (indexHit)
|
|
24998
25391
|
return `${srcPath}/index${indexHit}`;
|
|
24999
25392
|
return srcPath;
|
|
@@ -25016,7 +25409,7 @@ ${stubs}
|
|
|
25016
25409
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
25017
25410
|
}, srcUrl = (relPath, projectRoot) => {
|
|
25018
25411
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
25019
|
-
const absPath =
|
|
25412
|
+
const absPath = resolve42(projectRoot, relPath);
|
|
25020
25413
|
const cached = mtimeCache.get(absPath);
|
|
25021
25414
|
if (cached !== undefined)
|
|
25022
25415
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -25028,12 +25421,12 @@ ${stubs}
|
|
|
25028
25421
|
return base;
|
|
25029
25422
|
}
|
|
25030
25423
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
25031
|
-
const absPath =
|
|
25424
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25032
25425
|
const rel = relative16(projectRoot, absPath);
|
|
25033
25426
|
const extension = extname12(rel);
|
|
25034
25427
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
25035
25428
|
if (extname12(srcPath) === ".svelte") {
|
|
25036
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
25429
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve42(projectRoot, srcPath)));
|
|
25037
25430
|
}
|
|
25038
25431
|
return srcUrl(srcPath, projectRoot);
|
|
25039
25432
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -25052,13 +25445,13 @@ ${stubs}
|
|
|
25052
25445
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
25053
25446
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
25054
25447
|
if (!subpath) {
|
|
25055
|
-
const pkgDir =
|
|
25056
|
-
const pkgJsonPath =
|
|
25448
|
+
const pkgDir = resolve42(projectRoot, "node_modules", packageName ?? "");
|
|
25449
|
+
const pkgJsonPath = join47(pkgDir, "package.json");
|
|
25057
25450
|
if (existsSync35(pkgJsonPath)) {
|
|
25058
|
-
const pkg = JSON.parse(
|
|
25451
|
+
const pkg = JSON.parse(readFileSync31(pkgJsonPath, "utf-8"));
|
|
25059
25452
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25060
25453
|
if (esmEntry) {
|
|
25061
|
-
const resolved =
|
|
25454
|
+
const resolved = resolve42(pkgDir, esmEntry);
|
|
25062
25455
|
if (existsSync35(resolved))
|
|
25063
25456
|
return relative16(projectRoot, resolved);
|
|
25064
25457
|
}
|
|
@@ -25096,7 +25489,7 @@ ${stubs}
|
|
|
25096
25489
|
};
|
|
25097
25490
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
25098
25491
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
25099
|
-
const fileDir =
|
|
25492
|
+
const fileDir = dirname29(filePath);
|
|
25100
25493
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25101
25494
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25102
25495
|
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 +25504,12 @@ ${stubs}
|
|
|
25111
25504
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
25112
25505
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
25113
25506
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
25114
|
-
const absPath =
|
|
25507
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25115
25508
|
const rel = relative16(projectRoot, absPath);
|
|
25116
25509
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
25117
25510
|
});
|
|
25118
25511
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
25119
|
-
const absPath =
|
|
25512
|
+
const absPath = resolve42(fileDir, relPath);
|
|
25120
25513
|
const rel = relative16(projectRoot, absPath);
|
|
25121
25514
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
25122
25515
|
});
|
|
@@ -25162,7 +25555,7 @@ ${code}`;
|
|
|
25162
25555
|
reactFastRefreshWarningEmitted = true;
|
|
25163
25556
|
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
25557
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
25165
|
-
const raw =
|
|
25558
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25166
25559
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
25167
25560
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
25168
25561
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -25178,7 +25571,7 @@ ${transpiled}`;
|
|
|
25178
25571
|
transpiled += buildIslandMetadataExports(raw);
|
|
25179
25572
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
25180
25573
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
25181
|
-
const raw =
|
|
25574
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25182
25575
|
const ext = extname12(filePath);
|
|
25183
25576
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
25184
25577
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -25344,7 +25737,7 @@ ${code}`;
|
|
|
25344
25737
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
25345
25738
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
25346
25739
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
25347
|
-
const raw =
|
|
25740
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25348
25741
|
if (!svelteCompiler) {
|
|
25349
25742
|
svelteCompiler = await import("svelte/compiler");
|
|
25350
25743
|
}
|
|
@@ -25410,7 +25803,7 @@ export default __script__;`;
|
|
|
25410
25803
|
return `${cssInjection}
|
|
25411
25804
|
${code}`;
|
|
25412
25805
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
25413
|
-
const rawSource =
|
|
25806
|
+
const rawSource = readFileSync31(filePath, "utf-8");
|
|
25414
25807
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
25415
25808
|
if (!vueCompiler) {
|
|
25416
25809
|
vueCompiler = await loadVueCompiler();
|
|
@@ -25423,7 +25816,7 @@ ${code}`;
|
|
|
25423
25816
|
fs: {
|
|
25424
25817
|
fileExists: existsSync35,
|
|
25425
25818
|
realpath: realpathSync3,
|
|
25426
|
-
readFile: (file5) => existsSync35(file5) ?
|
|
25819
|
+
readFile: (file5) => existsSync35(file5) ? readFileSync31(file5, "utf-8") : undefined
|
|
25427
25820
|
},
|
|
25428
25821
|
id: componentId,
|
|
25429
25822
|
inlineTemplate: false
|
|
@@ -25438,7 +25831,7 @@ ${code}`;
|
|
|
25438
25831
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25439
25832
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25440
25833
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25441
|
-
const hmrBase = vueDir ?
|
|
25834
|
+
const hmrBase = vueDir ? resolve42(vueDir) : projectRoot;
|
|
25442
25835
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25443
25836
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25444
25837
|
result += [
|
|
@@ -25470,7 +25863,7 @@ ${code}`;
|
|
|
25470
25863
|
}
|
|
25471
25864
|
});
|
|
25472
25865
|
}, handleCssRequest = (filePath) => {
|
|
25473
|
-
const raw =
|
|
25866
|
+
const raw = readFileSync31(filePath, "utf-8");
|
|
25474
25867
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25475
25868
|
return [
|
|
25476
25869
|
`const style = document.createElement('style');`,
|
|
@@ -25602,7 +25995,7 @@ export default {};
|
|
|
25602
25995
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25603
25996
|
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
25997
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25605
|
-
const filePath =
|
|
25998
|
+
const filePath = resolve42(projectRoot, relPath);
|
|
25606
25999
|
const ext = extname12(filePath);
|
|
25607
26000
|
if (ext === ".svelte")
|
|
25608
26001
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25639,14 +26032,14 @@ export default {};
|
|
|
25639
26032
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25640
26033
|
const candidates = [
|
|
25641
26034
|
absoluteCandidate,
|
|
25642
|
-
|
|
26035
|
+
resolve42(projectRoot, tail)
|
|
25643
26036
|
];
|
|
25644
26037
|
try {
|
|
25645
26038
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25646
26039
|
const cfg = await loadConfig2();
|
|
25647
|
-
const angularDir = cfg.angularDirectory &&
|
|
26040
|
+
const angularDir = cfg.angularDirectory && resolve42(projectRoot, cfg.angularDirectory);
|
|
25648
26041
|
if (angularDir)
|
|
25649
|
-
candidates.push(
|
|
26042
|
+
candidates.push(resolve42(angularDir, tail));
|
|
25650
26043
|
} catch {}
|
|
25651
26044
|
for (const candidate of candidates) {
|
|
25652
26045
|
if (await fileExists(candidate)) {
|
|
@@ -25677,7 +26070,7 @@ export default {};
|
|
|
25677
26070
|
if (!TRANSPILABLE.has(ext))
|
|
25678
26071
|
return;
|
|
25679
26072
|
const stat3 = statSync6(filePath);
|
|
25680
|
-
const resolvedVueDir = vueDir ?
|
|
26073
|
+
const resolvedVueDir = vueDir ? resolve42(vueDir) : undefined;
|
|
25681
26074
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25682
26075
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25683
26076
|
if (isAngularGeneratedJs) {
|
|
@@ -25736,7 +26129,7 @@ export default {};
|
|
|
25736
26129
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25737
26130
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25738
26131
|
return handleBunWrapRequest();
|
|
25739
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
26132
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve42(projectRoot, relPath));
|
|
25740
26133
|
if (virtualCssResponse)
|
|
25741
26134
|
return virtualCssResponse;
|
|
25742
26135
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25752,11 +26145,11 @@ export default {};
|
|
|
25752
26145
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25753
26146
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25754
26147
|
if (match[1])
|
|
25755
|
-
files.push(
|
|
26148
|
+
files.push(resolve42(projectRoot, match[1]));
|
|
25756
26149
|
}
|
|
25757
26150
|
return files;
|
|
25758
26151
|
}, invalidateModule = (filePath) => {
|
|
25759
|
-
const resolved =
|
|
26152
|
+
const resolved = resolve42(filePath);
|
|
25760
26153
|
invalidate(filePath);
|
|
25761
26154
|
if (resolved !== filePath)
|
|
25762
26155
|
invalidate(resolved);
|
|
@@ -25919,7 +26312,7 @@ __export(exports_hmrCompiler, {
|
|
|
25919
26312
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25920
26313
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25921
26314
|
});
|
|
25922
|
-
import { dirname as
|
|
26315
|
+
import { dirname as dirname30, relative as relative17, resolve as resolve43 } from "path";
|
|
25923
26316
|
import { performance as performance2 } from "perf_hooks";
|
|
25924
26317
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25925
26318
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25931,7 +26324,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25931
26324
|
return null;
|
|
25932
26325
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25933
26326
|
const className = decoded.slice(separatorIndex + 1);
|
|
25934
|
-
const componentFilePath =
|
|
26327
|
+
const componentFilePath = resolve43(process.cwd(), filePathRel);
|
|
25935
26328
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25936
26329
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25937
26330
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25942,7 +26335,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25942
26335
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25943
26336
|
const owners = resolveOwningComponents2({
|
|
25944
26337
|
changedFilePath: componentFilePath,
|
|
25945
|
-
userAngularRoot:
|
|
26338
|
+
userAngularRoot: dirname30(componentFilePath)
|
|
25946
26339
|
});
|
|
25947
26340
|
const owner = owners.find((o3) => o3.className === className);
|
|
25948
26341
|
const kind = owner?.kind ?? "component";
|
|
@@ -26100,11 +26493,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
26100
26493
|
__export(exports_simpleHTMLHMR, {
|
|
26101
26494
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
26102
26495
|
});
|
|
26103
|
-
import { resolve as
|
|
26496
|
+
import { resolve as resolve44 } from "path";
|
|
26104
26497
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
26105
26498
|
let htmlContent;
|
|
26106
26499
|
try {
|
|
26107
|
-
const resolvedPath =
|
|
26500
|
+
const resolvedPath = resolve44(htmlFilePath);
|
|
26108
26501
|
const file5 = Bun.file(resolvedPath);
|
|
26109
26502
|
if (!await file5.exists()) {
|
|
26110
26503
|
return null;
|
|
@@ -26130,11 +26523,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
26130
26523
|
__export(exports_simpleHTMXHMR, {
|
|
26131
26524
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
26132
26525
|
});
|
|
26133
|
-
import { resolve as
|
|
26526
|
+
import { resolve as resolve45 } from "path";
|
|
26134
26527
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
26135
26528
|
let htmlContent;
|
|
26136
26529
|
try {
|
|
26137
|
-
const resolvedPath =
|
|
26530
|
+
const resolvedPath = resolve45(htmxFilePath);
|
|
26138
26531
|
const file5 = Bun.file(resolvedPath);
|
|
26139
26532
|
if (!await file5.exists()) {
|
|
26140
26533
|
return null;
|
|
@@ -26159,9 +26552,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
26159
26552
|
import { existsSync as existsSync36, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
26160
26553
|
import {
|
|
26161
26554
|
basename as basename17,
|
|
26162
|
-
dirname as
|
|
26555
|
+
dirname as dirname31,
|
|
26163
26556
|
isAbsolute as isAbsolute6,
|
|
26164
|
-
join as
|
|
26557
|
+
join as join48,
|
|
26165
26558
|
relative as relative18,
|
|
26166
26559
|
resolve as resolvePath3,
|
|
26167
26560
|
sep as sep4
|
|
@@ -26288,8 +26681,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26288
26681
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26289
26682
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26290
26683
|
for (const candidate of [
|
|
26291
|
-
|
|
26292
|
-
`${
|
|
26684
|
+
join48(generatedDir, relJs),
|
|
26685
|
+
`${join48(generatedDir, relJs)}.map`
|
|
26293
26686
|
]) {
|
|
26294
26687
|
try {
|
|
26295
26688
|
rmSync3(candidate, { force: true });
|
|
@@ -26524,7 +26917,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26524
26917
|
const { buildDir } = state.resolvedPaths;
|
|
26525
26918
|
const destPath = resolvePath3(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26526
26919
|
const { mkdir: mkdir12, copyFile, readFile: readFile10 } = await import("fs/promises");
|
|
26527
|
-
await mkdir12(
|
|
26920
|
+
await mkdir12(dirname31(destPath), { recursive: true });
|
|
26528
26921
|
await copyFile(absSource, destPath);
|
|
26529
26922
|
const bytes = await readFile10(destPath);
|
|
26530
26923
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26705,7 +27098,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26705
27098
|
const keepStemsByDir = new Map;
|
|
26706
27099
|
const prefixByDir = new Map;
|
|
26707
27100
|
for (const artifact of freshOutputs) {
|
|
26708
|
-
const dir =
|
|
27101
|
+
const dir = dirname31(artifact.path);
|
|
26709
27102
|
const name = basename17(artifact.path);
|
|
26710
27103
|
const [prefix] = name.split(".");
|
|
26711
27104
|
if (!prefix)
|
|
@@ -27068,8 +27461,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27068
27461
|
};
|
|
27069
27462
|
return ({ immediate = false } = {}) => {
|
|
27070
27463
|
if (!ctx.debouncedPromise) {
|
|
27071
|
-
ctx.debouncedPromise = new Promise((
|
|
27072
|
-
ctx.debouncedResolve =
|
|
27464
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
27465
|
+
ctx.debouncedResolve = resolve46;
|
|
27073
27466
|
});
|
|
27074
27467
|
}
|
|
27075
27468
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -27191,7 +27584,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27191
27584
|
const entries = await readdir6(dir, { withFileTypes: true });
|
|
27192
27585
|
const files = [];
|
|
27193
27586
|
for (const entry of entries) {
|
|
27194
|
-
const full =
|
|
27587
|
+
const full = join48(dir, entry.name);
|
|
27195
27588
|
if (entry.isDirectory()) {
|
|
27196
27589
|
files.push(...await walk(full));
|
|
27197
27590
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27601,8 +27994,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27601
27994
|
};
|
|
27602
27995
|
return () => {
|
|
27603
27996
|
if (!ctx.debouncedPromise) {
|
|
27604
|
-
ctx.debouncedPromise = new Promise((
|
|
27605
|
-
ctx.debouncedResolve =
|
|
27997
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
27998
|
+
ctx.debouncedResolve = resolve46;
|
|
27606
27999
|
});
|
|
27607
28000
|
}
|
|
27608
28001
|
if (ctx.debounceTimer)
|
|
@@ -27751,7 +28144,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27751
28144
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27752
28145
|
const serverEntries = [...vueServerPaths];
|
|
27753
28146
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27754
|
-
const cssOutDir =
|
|
28147
|
+
const cssOutDir = join48(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27755
28148
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27756
28149
|
const serverExternals = await getServerBundleExternals();
|
|
27757
28150
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27876,8 +28269,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27876
28269
|
};
|
|
27877
28270
|
return () => {
|
|
27878
28271
|
if (!ctx.debouncedPromise) {
|
|
27879
|
-
ctx.debouncedPromise = new Promise((
|
|
27880
|
-
ctx.debouncedResolve =
|
|
28272
|
+
ctx.debouncedPromise = new Promise((resolve46) => {
|
|
28273
|
+
ctx.debouncedResolve = resolve46;
|
|
27881
28274
|
});
|
|
27882
28275
|
}
|
|
27883
28276
|
if (ctx.debounceTimer)
|
|
@@ -28027,7 +28420,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28027
28420
|
if (!buildReference?.source) {
|
|
28028
28421
|
return;
|
|
28029
28422
|
}
|
|
28030
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath3(
|
|
28423
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath3(dirname31(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
28031
28424
|
islandFiles.add(resolvePath3(sourcePath));
|
|
28032
28425
|
}, resolveIslandSourceFiles = async (config) => {
|
|
28033
28426
|
const registryPath = config.islands?.registry;
|
|
@@ -28840,7 +29233,7 @@ __export(exports_buildDepVendor, {
|
|
|
28840
29233
|
});
|
|
28841
29234
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
28842
29235
|
import { isBuiltin } from "module";
|
|
28843
|
-
import { join as
|
|
29236
|
+
import { join as join49 } from "path";
|
|
28844
29237
|
import { rm as rm14 } from "fs/promises";
|
|
28845
29238
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
28846
29239
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -28899,8 +29292,8 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28899
29292
|
framework: Array.from(framework).filter(isResolvable3)
|
|
28900
29293
|
};
|
|
28901
29294
|
}, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
|
|
28902
|
-
const { readFileSync:
|
|
28903
|
-
const { dirname:
|
|
29295
|
+
const { readFileSync: readFileSync32 } = await import("fs");
|
|
29296
|
+
const { dirname: dirname32 } = await import("path");
|
|
28904
29297
|
const seenFiles = new Set;
|
|
28905
29298
|
const bareOut = new Set;
|
|
28906
29299
|
const queue = [
|
|
@@ -28915,7 +29308,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28915
29308
|
continue;
|
|
28916
29309
|
let content;
|
|
28917
29310
|
try {
|
|
28918
|
-
content =
|
|
29311
|
+
content = readFileSync32(path, "utf-8");
|
|
28919
29312
|
} catch {
|
|
28920
29313
|
continue;
|
|
28921
29314
|
}
|
|
@@ -28925,7 +29318,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28925
29318
|
} catch {
|
|
28926
29319
|
continue;
|
|
28927
29320
|
}
|
|
28928
|
-
const fromDir =
|
|
29321
|
+
const fromDir = dirname32(path);
|
|
28929
29322
|
for (const imp of imports) {
|
|
28930
29323
|
const child = imp.path;
|
|
28931
29324
|
if (child.startsWith(".") || child.startsWith("/")) {
|
|
@@ -28989,7 +29382,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28989
29382
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
28990
29383
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
28991
29384
|
const safeName = toSafeFileName6(specifier);
|
|
28992
|
-
const entryPath =
|
|
29385
|
+
const entryPath = join49(tmpDir, `${safeName}.ts`);
|
|
28993
29386
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
28994
29387
|
return { entryPath, specifier };
|
|
28995
29388
|
}));
|
|
@@ -29080,9 +29473,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
29080
29473
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
29081
29474
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
29082
29475
|
return {};
|
|
29083
|
-
const vendorDir =
|
|
29476
|
+
const vendorDir = join49(buildDir, "vendor");
|
|
29084
29477
|
mkdirSync14(vendorDir, { recursive: true });
|
|
29085
|
-
const tmpDir =
|
|
29478
|
+
const tmpDir = join49(buildDir, "_dep_vendor_tmp");
|
|
29086
29479
|
mkdirSync14(tmpDir, { recursive: true });
|
|
29087
29480
|
const allSpecs = new Set(initialSpecs);
|
|
29088
29481
|
const alreadyScanned = new Set;
|
|
@@ -29165,7 +29558,7 @@ __export(exports_devBuild, {
|
|
|
29165
29558
|
});
|
|
29166
29559
|
import { readdir as readdir6 } from "fs/promises";
|
|
29167
29560
|
import { statSync as statSync7 } from "fs";
|
|
29168
|
-
import { resolve as
|
|
29561
|
+
import { resolve as resolve46 } from "path";
|
|
29169
29562
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
29170
29563
|
const configuredDirs = [
|
|
29171
29564
|
config.reactDirectory,
|
|
@@ -29188,7 +29581,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29188
29581
|
return Object.keys(config).length > 0 ? config : null;
|
|
29189
29582
|
}, reloadConfig = async () => {
|
|
29190
29583
|
try {
|
|
29191
|
-
const configPath2 =
|
|
29584
|
+
const configPath2 = resolve46(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
29192
29585
|
const source = await Bun.file(configPath2).text();
|
|
29193
29586
|
return parseDirectoryConfig(source);
|
|
29194
29587
|
} catch {
|
|
@@ -29300,7 +29693,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29300
29693
|
});
|
|
29301
29694
|
}
|
|
29302
29695
|
}, handleCachedReload = async () => {
|
|
29303
|
-
const serverMtime = statSync7(
|
|
29696
|
+
const serverMtime = statSync7(resolve46(Bun.main)).mtimeMs;
|
|
29304
29697
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
29305
29698
|
globalThis.__hmrServerMtime = serverMtime;
|
|
29306
29699
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -29337,8 +29730,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29337
29730
|
return true;
|
|
29338
29731
|
}, resolveAbsoluteVersion2 = async () => {
|
|
29339
29732
|
const candidates = [
|
|
29340
|
-
|
|
29341
|
-
|
|
29733
|
+
resolve46(import.meta.dir, "..", "..", "package.json"),
|
|
29734
|
+
resolve46(import.meta.dir, "..", "package.json")
|
|
29342
29735
|
];
|
|
29343
29736
|
const [candidate, ...remaining] = candidates;
|
|
29344
29737
|
if (!candidate) {
|
|
@@ -29364,7 +29757,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29364
29757
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
29365
29758
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
29366
29759
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
29367
|
-
const bytes = await Bun.file(
|
|
29760
|
+
const bytes = await Bun.file(resolve46(vendorDir, entry)).bytes();
|
|
29368
29761
|
assetStore.set(webPath, bytes);
|
|
29369
29762
|
}));
|
|
29370
29763
|
}, devBuild = async (config) => {
|
|
@@ -29503,11 +29896,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29503
29896
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
29504
29897
|
recordStep("populate asset store", stepStartedAt);
|
|
29505
29898
|
stepStartedAt = performance.now();
|
|
29506
|
-
const reactVendorDir =
|
|
29507
|
-
const angularVendorDir =
|
|
29508
|
-
const svelteVendorDir =
|
|
29509
|
-
const vueVendorDir =
|
|
29510
|
-
const depVendorDir =
|
|
29899
|
+
const reactVendorDir = resolve46(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29900
|
+
const angularVendorDir = resolve46(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29901
|
+
const svelteVendorDir = resolve46(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29902
|
+
const vueVendorDir = resolve46(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29903
|
+
const depVendorDir = resolve46(state.resolvedPaths.buildDir, "vendor");
|
|
29511
29904
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
29512
29905
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
29513
29906
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -29585,7 +29978,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
29585
29978
|
manifest
|
|
29586
29979
|
};
|
|
29587
29980
|
globalThis.__hmrDevResult = result;
|
|
29588
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
29981
|
+
globalThis.__hmrServerMtime = statSync7(resolve46(Bun.main)).mtimeMs;
|
|
29589
29982
|
return result;
|
|
29590
29983
|
};
|
|
29591
29984
|
var init_devBuild = __esm(() => {
|
|
@@ -29734,8 +30127,8 @@ var STORE_KEY = "__elysiaStore", restoredStores, getGlobalValue = (key) => Refle
|
|
|
29734
30127
|
return null;
|
|
29735
30128
|
if (!pathname.startsWith("/"))
|
|
29736
30129
|
return null;
|
|
29737
|
-
const { resolve:
|
|
29738
|
-
const candidate =
|
|
30130
|
+
const { resolve: resolve47, normalize } = await import("path");
|
|
30131
|
+
const candidate = resolve47(buildDir, pathname.slice(1));
|
|
29739
30132
|
const normalizedBuild = normalize(buildDir);
|
|
29740
30133
|
if (!candidate.startsWith(normalizedBuild))
|
|
29741
30134
|
return null;
|
|
@@ -29831,17 +30224,17 @@ __export(exports_devtoolsJson, {
|
|
|
29831
30224
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
29832
30225
|
devtoolsJson: () => devtoolsJson
|
|
29833
30226
|
});
|
|
29834
|
-
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as
|
|
29835
|
-
import { dirname as
|
|
30227
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as readFileSync32, writeFileSync as writeFileSync10 } from "fs";
|
|
30228
|
+
import { dirname as dirname32, join as join50, resolve as resolve47 } from "path";
|
|
29836
30229
|
import { Elysia as Elysia6 } from "elysia";
|
|
29837
30230
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
29838
30231
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
29839
30232
|
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) =>
|
|
30233
|
+
}, 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
30234
|
if (!existsSync37(cachePath))
|
|
29842
30235
|
return null;
|
|
29843
30236
|
try {
|
|
29844
|
-
const value =
|
|
30237
|
+
const value = readFileSync32(cachePath, "utf-8").trim();
|
|
29845
30238
|
return isUuidV4(value) ? value : null;
|
|
29846
30239
|
} catch {
|
|
29847
30240
|
return null;
|
|
@@ -29859,11 +30252,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29859
30252
|
if (cachedUuid)
|
|
29860
30253
|
return setGlobalUuid(cachedUuid);
|
|
29861
30254
|
const uuid = crypto.randomUUID();
|
|
29862
|
-
mkdirSync15(
|
|
30255
|
+
mkdirSync15(dirname32(cachePath), { recursive: true });
|
|
29863
30256
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
29864
30257
|
return setGlobalUuid(uuid);
|
|
29865
30258
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
29866
|
-
const rootPath =
|
|
30259
|
+
const rootPath = resolve47(options.projectRoot ?? process.cwd());
|
|
29867
30260
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
29868
30261
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
29869
30262
|
return new Elysia6({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -29876,11 +30269,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29876
30269
|
if (process.env.WSL_DISTRO_NAME) {
|
|
29877
30270
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
29878
30271
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29879
|
-
return
|
|
30272
|
+
return join50("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
29880
30273
|
}
|
|
29881
30274
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
29882
30275
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29883
|
-
return
|
|
30276
|
+
return join50("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
29884
30277
|
}
|
|
29885
30278
|
return root;
|
|
29886
30279
|
};
|
|
@@ -29892,7 +30285,7 @@ __export(exports_imageOptimizer, {
|
|
|
29892
30285
|
imageOptimizer: () => imageOptimizer
|
|
29893
30286
|
});
|
|
29894
30287
|
import { existsSync as existsSync38 } from "fs";
|
|
29895
|
-
import { resolve as
|
|
30288
|
+
import { resolve as resolve48 } from "path";
|
|
29896
30289
|
import { Elysia as Elysia7 } from "elysia";
|
|
29897
30290
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
29898
30291
|
try {
|
|
@@ -29905,7 +30298,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
29905
30298
|
}
|
|
29906
30299
|
}, resolveLocalImage = (url, buildDir) => {
|
|
29907
30300
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
29908
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
30301
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve48(process.cwd()));
|
|
29909
30302
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
29910
30303
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
29911
30304
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -30182,15 +30575,15 @@ __export(exports_prerender, {
|
|
|
30182
30575
|
prerender: () => prerender,
|
|
30183
30576
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
30184
30577
|
});
|
|
30185
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
30186
|
-
import { join as
|
|
30578
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync33 } from "fs";
|
|
30579
|
+
import { join as join51 } from "path";
|
|
30187
30580
|
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
30581
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
30189
30582
|
await Bun.write(metaPath, String(Date.now()));
|
|
30190
30583
|
}, readTimestamp = (htmlPath) => {
|
|
30191
30584
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
30192
30585
|
try {
|
|
30193
|
-
const content =
|
|
30586
|
+
const content = readFileSync33(metaPath, "utf-8");
|
|
30194
30587
|
return Number(content) || 0;
|
|
30195
30588
|
} catch {
|
|
30196
30589
|
return 0;
|
|
@@ -30253,7 +30646,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
30253
30646
|
if (!isCompleteHtml(html))
|
|
30254
30647
|
return false;
|
|
30255
30648
|
const fileName = routeToFilename(route);
|
|
30256
|
-
const filePath =
|
|
30649
|
+
const filePath = join51(prerenderDir, fileName);
|
|
30257
30650
|
await Bun.write(filePath, html);
|
|
30258
30651
|
await writeTimestamp(filePath);
|
|
30259
30652
|
return true;
|
|
@@ -30283,13 +30676,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
30283
30676
|
return;
|
|
30284
30677
|
}
|
|
30285
30678
|
const fileName = routeToFilename(route);
|
|
30286
|
-
const filePath =
|
|
30679
|
+
const filePath = join51(prerenderDir, fileName);
|
|
30287
30680
|
await Bun.write(filePath, html);
|
|
30288
30681
|
await writeTimestamp(filePath);
|
|
30289
30682
|
result.routes.set(route, filePath);
|
|
30290
30683
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
30291
30684
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
30292
|
-
const prerenderDir =
|
|
30685
|
+
const prerenderDir = join51(outDir, "_prerendered");
|
|
30293
30686
|
mkdirSync16(prerenderDir, { recursive: true });
|
|
30294
30687
|
const baseUrl = `http://localhost:${port}`;
|
|
30295
30688
|
let routes;
|
|
@@ -30410,15 +30803,15 @@ import {
|
|
|
30410
30803
|
copyFileSync as copyFileSync4,
|
|
30411
30804
|
existsSync as existsSync41,
|
|
30412
30805
|
readdirSync as readdirSync12,
|
|
30413
|
-
readFileSync as
|
|
30806
|
+
readFileSync as readFileSync37,
|
|
30414
30807
|
statSync as statSync8,
|
|
30415
30808
|
watch as watch2
|
|
30416
30809
|
} from "fs";
|
|
30417
30810
|
import { createHash as createHash9 } from "crypto";
|
|
30418
|
-
import { dirname as
|
|
30811
|
+
import { dirname as dirname33, join as join55, resolve as resolve49 } from "path";
|
|
30419
30812
|
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
30813
|
try {
|
|
30421
|
-
return createHash9("sha256").update(
|
|
30814
|
+
return createHash9("sha256").update(readFileSync37(path)).digest("hex");
|
|
30422
30815
|
} catch {
|
|
30423
30816
|
return null;
|
|
30424
30817
|
}
|
|
@@ -30443,11 +30836,11 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30443
30836
|
return;
|
|
30444
30837
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
30445
30838
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
30446
|
-
const entryPath =
|
|
30447
|
-
const entryDir =
|
|
30839
|
+
const entryPath = resolve49(originalEntry);
|
|
30840
|
+
const entryDir = dirname33(entryPath);
|
|
30448
30841
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
30449
|
-
const configPath2 =
|
|
30450
|
-
const configDir2 =
|
|
30842
|
+
const configPath2 = resolve49(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
30843
|
+
const configDir2 = dirname33(configPath2);
|
|
30451
30844
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
30452
30845
|
const recentlyHandled = new Map;
|
|
30453
30846
|
let entryReloadTimer = null;
|
|
@@ -30457,7 +30850,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30457
30850
|
let pendingEntryCause = null;
|
|
30458
30851
|
let siblingSequence = 0;
|
|
30459
30852
|
const importFreshEntry = async (attempt = 1) => {
|
|
30460
|
-
const siblingPath =
|
|
30853
|
+
const siblingPath = join55(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
30461
30854
|
let failure;
|
|
30462
30855
|
try {
|
|
30463
30856
|
copyFileSync4(entryPath, siblingPath);
|
|
@@ -30570,7 +30963,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
30570
30963
|
continue;
|
|
30571
30964
|
let st2;
|
|
30572
30965
|
try {
|
|
30573
|
-
st2 = statSync8(
|
|
30966
|
+
st2 = statSync8(join55(dir, entry.name));
|
|
30574
30967
|
} catch {
|
|
30575
30968
|
continue;
|
|
30576
30969
|
}
|
|
@@ -31438,8 +31831,8 @@ var handleHTMXPageRequest = async (pagePath, options = {}) => {
|
|
|
31438
31831
|
};
|
|
31439
31832
|
// src/core/prepare.ts
|
|
31440
31833
|
import { createHash as createHash8 } from "crypto";
|
|
31441
|
-
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as
|
|
31442
|
-
import { basename as basename18, join as
|
|
31834
|
+
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as readFileSync34 } from "fs";
|
|
31835
|
+
import { basename as basename18, join as join52, relative as relative19, resolve as resolvePath4 } from "path";
|
|
31443
31836
|
import { Elysia as Elysia9, NotFound } from "elysia";
|
|
31444
31837
|
|
|
31445
31838
|
// src/plugins/openApiPlugin.ts
|
|
@@ -32743,8 +33136,8 @@ var MS_PER_SECOND2 = 1000;
|
|
|
32743
33136
|
var DEFAULT_PORT2 = 3000;
|
|
32744
33137
|
var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
|
|
32745
33138
|
var STATIC_PLUGIN_RETRY_DELAY_MS = 50;
|
|
32746
|
-
var waitForStaticPluginRetry = () => new Promise((
|
|
32747
|
-
setTimeout(
|
|
33139
|
+
var waitForStaticPluginRetry = () => new Promise((resolve49) => {
|
|
33140
|
+
setTimeout(resolve49, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
32748
33141
|
});
|
|
32749
33142
|
var retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
32750
33143
|
try {
|
|
@@ -32840,10 +33233,10 @@ var registerIconVersioning = (buildDir) => {
|
|
|
32840
33233
|
if (cached !== undefined)
|
|
32841
33234
|
return cached;
|
|
32842
33235
|
const path = href.split("?")[0] ?? href;
|
|
32843
|
-
const filePath =
|
|
33236
|
+
const filePath = join52(buildDir, path);
|
|
32844
33237
|
let versioned = href;
|
|
32845
33238
|
if (existsSync39(filePath)) {
|
|
32846
|
-
const hash = createHash8("sha256").update(
|
|
33239
|
+
const hash = createHash8("sha256").update(readFileSync34(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
32847
33240
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
32848
33241
|
}
|
|
32849
33242
|
cache2.set(href, versioned);
|
|
@@ -32970,13 +33363,13 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
32970
33363
|
continue;
|
|
32971
33364
|
const name = basename18(entry, ".html");
|
|
32972
33365
|
const route = name === "index" ? "/" : `/${name}`;
|
|
32973
|
-
map.set(route,
|
|
33366
|
+
map.set(route, join52(prerenderDir, entry));
|
|
32974
33367
|
}
|
|
32975
33368
|
return map;
|
|
32976
33369
|
};
|
|
32977
33370
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
32978
|
-
const root =
|
|
32979
|
-
if (!existsSync39(
|
|
33371
|
+
const root = join52(buildDir, ".absolutejs", "mobile-compatibility");
|
|
33372
|
+
if (!existsSync39(join52(root, "current.json"))) {
|
|
32980
33373
|
return new Elysia9({ name: "absolutejs-mobile-compatibility-empty" });
|
|
32981
33374
|
}
|
|
32982
33375
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
@@ -33029,7 +33422,7 @@ var prepare = async (configOrPath) => {
|
|
|
33029
33422
|
return result;
|
|
33030
33423
|
}
|
|
33031
33424
|
stepStartedAt = performance.now();
|
|
33032
|
-
const manifest = JSON.parse(
|
|
33425
|
+
const manifest = JSON.parse(readFileSync34(`${buildDir}/manifest.json`, "utf-8"));
|
|
33033
33426
|
setCurrentIslandManifest(manifest);
|
|
33034
33427
|
if (config.islands?.registry) {
|
|
33035
33428
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -33037,14 +33430,14 @@ var prepare = async (configOrPath) => {
|
|
|
33037
33430
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
33038
33431
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
33039
33432
|
stepStartedAt = performance.now();
|
|
33040
|
-
const conventionsPath =
|
|
33433
|
+
const conventionsPath = join52(buildDir, "conventions.json");
|
|
33041
33434
|
if (existsSync39(conventionsPath)) {
|
|
33042
|
-
const conventions2 = JSON.parse(
|
|
33435
|
+
const conventions2 = JSON.parse(readFileSync34(conventionsPath, "utf-8"));
|
|
33043
33436
|
setConventions(conventions2);
|
|
33044
33437
|
}
|
|
33045
|
-
const spaRoutesPath =
|
|
33438
|
+
const spaRoutesPath = join52(buildDir, "spa-routes.json");
|
|
33046
33439
|
if (existsSync39(spaRoutesPath)) {
|
|
33047
|
-
setSpaRouteManifest(JSON.parse(
|
|
33440
|
+
setSpaRouteManifest(JSON.parse(readFileSync34(spaRoutesPath, "utf-8")));
|
|
33048
33441
|
}
|
|
33049
33442
|
recordStep("load production conventions", stepStartedAt);
|
|
33050
33443
|
stepStartedAt = performance.now();
|
|
@@ -33055,7 +33448,7 @@ var prepare = async (configOrPath) => {
|
|
|
33055
33448
|
prefix: "",
|
|
33056
33449
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
33057
33450
|
});
|
|
33058
|
-
const generatedAssetsRoot =
|
|
33451
|
+
const generatedAssetsRoot = join52(buildDir, ".absolutejs");
|
|
33059
33452
|
const generatedAssetsPlugin = new Elysia9({
|
|
33060
33453
|
name: "absolutejs-generated-assets"
|
|
33061
33454
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -33093,7 +33486,7 @@ var prepare = async (configOrPath) => {
|
|
|
33093
33486
|
responseValue.headers.set("cache-control", isFingerprintedAsset(pathname) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate");
|
|
33094
33487
|
});
|
|
33095
33488
|
stepStartedAt = performance.now();
|
|
33096
|
-
const prerenderDir =
|
|
33489
|
+
const prerenderDir = join52(buildDir, "_prerendered");
|
|
33097
33490
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
33098
33491
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
33099
33492
|
const mobileAssociationPlugin = createAbsoluteMobileAssociationPlugin(config.mobile, process.cwd(), { requireAll: true });
|
|
@@ -33163,20 +33556,20 @@ import {
|
|
|
33163
33556
|
copyFileSync as copyFileSync3,
|
|
33164
33557
|
existsSync as existsSync40,
|
|
33165
33558
|
mkdirSync as mkdirSync17,
|
|
33166
|
-
readFileSync as
|
|
33559
|
+
readFileSync as readFileSync35,
|
|
33167
33560
|
rmSync as rmSync4
|
|
33168
33561
|
} from "fs";
|
|
33169
|
-
import { join as
|
|
33170
|
-
var CERT_DIR =
|
|
33171
|
-
var CERT_PATH =
|
|
33172
|
-
var KEY_PATH =
|
|
33562
|
+
import { join as join53 } from "path";
|
|
33563
|
+
var CERT_DIR = join53(process.cwd(), ".absolutejs");
|
|
33564
|
+
var CERT_PATH = join53(CERT_DIR, "cert.pem");
|
|
33565
|
+
var KEY_PATH = join53(CERT_DIR, "key.pem");
|
|
33173
33566
|
var CERT_VALIDITY_DAYS = 365;
|
|
33174
33567
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
33175
33568
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
33176
33569
|
var certFilesExist = () => existsSync40(CERT_PATH) && existsSync40(KEY_PATH);
|
|
33177
33570
|
var isCertExpired = () => {
|
|
33178
33571
|
try {
|
|
33179
|
-
const certPem =
|
|
33572
|
+
const certPem = readFileSync35(CERT_PATH, "utf-8");
|
|
33180
33573
|
const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
|
|
33181
33574
|
stdin: new TextEncoder().encode(certPem)
|
|
33182
33575
|
});
|
|
@@ -33272,8 +33665,8 @@ var loadDevCert = () => {
|
|
|
33272
33665
|
return null;
|
|
33273
33666
|
try {
|
|
33274
33667
|
return {
|
|
33275
|
-
cert:
|
|
33276
|
-
key:
|
|
33668
|
+
cert: readFileSync35(paths.cert, "utf-8"),
|
|
33669
|
+
key: readFileSync35(paths.key, "utf-8")
|
|
33277
33670
|
};
|
|
33278
33671
|
} catch {
|
|
33279
33672
|
return null;
|
|
@@ -33283,18 +33676,18 @@ var loadDevCert = () => {
|
|
|
33283
33676
|
// src/utils/instanceRegistry.ts
|
|
33284
33677
|
import {
|
|
33285
33678
|
mkdirSync as mkdirSync18,
|
|
33286
|
-
readFileSync as
|
|
33679
|
+
readFileSync as readFileSync36,
|
|
33287
33680
|
readdirSync as readdirSync11,
|
|
33288
33681
|
unlinkSync as unlinkSync2,
|
|
33289
33682
|
writeFileSync as writeFileSync11
|
|
33290
33683
|
} from "fs";
|
|
33291
33684
|
import { homedir as homedir2 } from "os";
|
|
33292
|
-
import { basename as basename19, join as
|
|
33685
|
+
import { basename as basename19, join as join54 } from "path";
|
|
33293
33686
|
var registeredPids = new Set;
|
|
33294
33687
|
var exitHandlerRegistered = false;
|
|
33295
|
-
var instanceFilePath = (pid) =>
|
|
33296
|
-
var instanceLogPath = (pid) =>
|
|
33297
|
-
var instanceRegistryDir = () =>
|
|
33688
|
+
var instanceFilePath = (pid) => join54(instanceRegistryDir(), `${pid}.json`);
|
|
33689
|
+
var instanceLogPath = (pid) => join54(instanceRegistryDir(), `${pid}.log`);
|
|
33690
|
+
var instanceRegistryDir = () => join54(homedir2(), ".absolutejs", "instances");
|
|
33298
33691
|
var removeInstanceFilesSync = (pid) => {
|
|
33299
33692
|
try {
|
|
33300
33693
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -33316,7 +33709,7 @@ var registerExitHandlerOnce = () => {
|
|
|
33316
33709
|
};
|
|
33317
33710
|
var readJsonFile = (path) => {
|
|
33318
33711
|
try {
|
|
33319
|
-
return JSON.parse(
|
|
33712
|
+
return JSON.parse(readFileSync36(path, "utf-8"));
|
|
33320
33713
|
} catch {
|
|
33321
33714
|
return null;
|
|
33322
33715
|
}
|
|
@@ -33329,7 +33722,7 @@ var registerInstance = (record) => {
|
|
|
33329
33722
|
return record;
|
|
33330
33723
|
};
|
|
33331
33724
|
var resolveProjectName = (cwd2) => {
|
|
33332
|
-
const parsed = readJsonFile(
|
|
33725
|
+
const parsed = readJsonFile(join54(cwd2, "package.json"));
|
|
33333
33726
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
33334
33727
|
return parsed.name;
|
|
33335
33728
|
}
|
|
@@ -33356,7 +33749,7 @@ var getLocalIPAddress = () => {
|
|
|
33356
33749
|
|
|
33357
33750
|
// src/plugins/networking.ts
|
|
33358
33751
|
init_startupBanner();
|
|
33359
|
-
var
|
|
33752
|
+
var host2 = env4.ABSOLUTE_HOST ?? env4.HOST ?? "localhost";
|
|
33360
33753
|
var port = env4.ABSOLUTE_PORT ?? env4.PORT ?? DEFAULT_PORT;
|
|
33361
33754
|
var visibility = env4.ABSOLUTE_WORKSPACE_SERVICE_VISIBILITY ?? "public";
|
|
33362
33755
|
var managedByWorkspace = env4.ABSOLUTE_WORKSPACE_MANAGED === "1";
|
|
@@ -33365,7 +33758,7 @@ var args = argv;
|
|
|
33365
33758
|
var hostFlag = args.includes("--host");
|
|
33366
33759
|
if (hostFlag) {
|
|
33367
33760
|
localIP = getLocalIPAddress();
|
|
33368
|
-
|
|
33761
|
+
host2 = "0.0.0.0";
|
|
33369
33762
|
}
|
|
33370
33763
|
var loadTls = () => {
|
|
33371
33764
|
if (env4.NODE_ENV !== "development")
|
|
@@ -33403,7 +33796,7 @@ var selfRegisterInstance = () => {
|
|
|
33403
33796
|
controllerPid: process.pid,
|
|
33404
33797
|
cwd: process.cwd(),
|
|
33405
33798
|
frameworks: [],
|
|
33406
|
-
host,
|
|
33799
|
+
host: host2,
|
|
33407
33800
|
https: protocol === "https",
|
|
33408
33801
|
logFile: null,
|
|
33409
33802
|
name: resolveProjectName(process.cwd()),
|
|
@@ -33445,7 +33838,7 @@ var networking = (app) => {
|
|
|
33445
33838
|
return app;
|
|
33446
33839
|
}
|
|
33447
33840
|
const listened = app.listen({
|
|
33448
|
-
hostname:
|
|
33841
|
+
hostname: host2,
|
|
33449
33842
|
idleTimeout: httpIdleTimeout,
|
|
33450
33843
|
port,
|
|
33451
33844
|
...tls ? {
|
|
@@ -33469,7 +33862,7 @@ var networking = (app) => {
|
|
|
33469
33862
|
const version = globalThis.__absoluteVersion || env4.ABSOLUTE_VERSION || "";
|
|
33470
33863
|
startupBanner({
|
|
33471
33864
|
buildDuration,
|
|
33472
|
-
host,
|
|
33865
|
+
host: host2,
|
|
33473
33866
|
networkUrl: hostFlag ? `${protocol}://${localIP}:${port}/` : undefined,
|
|
33474
33867
|
port,
|
|
33475
33868
|
protocol,
|
|
@@ -33639,8 +34032,8 @@ var generateHeadElement = ({
|
|
|
33639
34032
|
};
|
|
33640
34033
|
// src/utils/defineEnv.ts
|
|
33641
34034
|
var {env: bunEnv } = globalThis.Bun;
|
|
33642
|
-
import { existsSync as existsSync42, readFileSync as
|
|
33643
|
-
import { resolve as
|
|
34035
|
+
import { existsSync as existsSync42, readFileSync as readFileSync38 } from "fs";
|
|
34036
|
+
import { resolve as resolve50 } from "path";
|
|
33644
34037
|
|
|
33645
34038
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
33646
34039
|
var exports_value = {};
|
|
@@ -38107,9 +38500,9 @@ class ValueCastError extends TypeBoxError {
|
|
|
38107
38500
|
}
|
|
38108
38501
|
function ScoreUnion(schema, references, value) {
|
|
38109
38502
|
if (schema[Kind] === "Object" && typeof value === "object" && !IsNull2(value)) {
|
|
38110
|
-
const
|
|
38503
|
+
const object2 = schema;
|
|
38111
38504
|
const keys = Object.getOwnPropertyNames(value);
|
|
38112
|
-
const entries = Object.entries(
|
|
38505
|
+
const entries = Object.entries(object2.properties);
|
|
38113
38506
|
return entries.reduce((acc, [key, schema2]) => {
|
|
38114
38507
|
const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
|
|
38115
38508
|
const checks = Check(schema2, references, value[key]) ? 10 : 0;
|
|
@@ -39228,8 +39621,8 @@ class ValuePointerRootDeleteError extends TypeBoxError {
|
|
|
39228
39621
|
this.path = path;
|
|
39229
39622
|
}
|
|
39230
39623
|
}
|
|
39231
|
-
function Escape2(
|
|
39232
|
-
return
|
|
39624
|
+
function Escape2(component2) {
|
|
39625
|
+
return component2.indexOf("~") === -1 ? component2 : component2.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
39233
39626
|
}
|
|
39234
39627
|
function* Format(pointer) {
|
|
39235
39628
|
if (pointer === "")
|
|
@@ -39255,12 +39648,12 @@ function Set4(value, pointer, update) {
|
|
|
39255
39648
|
if (pointer === "")
|
|
39256
39649
|
throw new ValuePointerRootSetError(value, pointer, update);
|
|
39257
39650
|
let [owner, next, key] = [null, value, ""];
|
|
39258
|
-
for (const
|
|
39259
|
-
if (next[
|
|
39260
|
-
next[
|
|
39651
|
+
for (const component2 of Format(pointer)) {
|
|
39652
|
+
if (next[component2] === undefined)
|
|
39653
|
+
next[component2] = {};
|
|
39261
39654
|
owner = next;
|
|
39262
|
-
next = next[
|
|
39263
|
-
key =
|
|
39655
|
+
next = next[component2];
|
|
39656
|
+
key = component2;
|
|
39264
39657
|
}
|
|
39265
39658
|
owner[key] = update;
|
|
39266
39659
|
}
|
|
@@ -39268,12 +39661,12 @@ function Delete3(value, pointer) {
|
|
|
39268
39661
|
if (pointer === "")
|
|
39269
39662
|
throw new ValuePointerRootDeleteError(value, pointer);
|
|
39270
39663
|
let [owner, next, key] = [null, value, ""];
|
|
39271
|
-
for (const
|
|
39272
|
-
if (next[
|
|
39664
|
+
for (const component2 of Format(pointer)) {
|
|
39665
|
+
if (next[component2] === undefined || next[component2] === null)
|
|
39273
39666
|
return;
|
|
39274
39667
|
owner = next;
|
|
39275
|
-
next = next[
|
|
39276
|
-
key =
|
|
39668
|
+
next = next[component2];
|
|
39669
|
+
key = component2;
|
|
39277
39670
|
}
|
|
39278
39671
|
if (Array.isArray(owner)) {
|
|
39279
39672
|
const index = parseInt(key);
|
|
@@ -39286,12 +39679,12 @@ function Has3(value, pointer) {
|
|
|
39286
39679
|
if (pointer === "")
|
|
39287
39680
|
return true;
|
|
39288
39681
|
let [owner, next, key] = [null, value, ""];
|
|
39289
|
-
for (const
|
|
39290
|
-
if (next[
|
|
39682
|
+
for (const component2 of Format(pointer)) {
|
|
39683
|
+
if (next[component2] === undefined)
|
|
39291
39684
|
return false;
|
|
39292
39685
|
owner = next;
|
|
39293
|
-
next = next[
|
|
39294
|
-
key =
|
|
39686
|
+
next = next[component2];
|
|
39687
|
+
key = component2;
|
|
39295
39688
|
}
|
|
39296
39689
|
return Object.getOwnPropertyNames(owner).includes(key);
|
|
39297
39690
|
}
|
|
@@ -39299,10 +39692,10 @@ function Get3(value, pointer) {
|
|
|
39299
39692
|
if (pointer === "")
|
|
39300
39693
|
return value;
|
|
39301
39694
|
let current = value;
|
|
39302
|
-
for (const
|
|
39303
|
-
if (current[
|
|
39695
|
+
for (const component2 of Format(pointer)) {
|
|
39696
|
+
if (current[component2] === undefined)
|
|
39304
39697
|
return;
|
|
39305
|
-
current = current[
|
|
39698
|
+
current = current[component2];
|
|
39306
39699
|
}
|
|
39307
39700
|
return current;
|
|
39308
39701
|
}
|
|
@@ -39576,7 +39969,7 @@ class ParseError extends TypeBoxError {
|
|
|
39576
39969
|
}
|
|
39577
39970
|
var ParseRegistry;
|
|
39578
39971
|
(function(ParseRegistry2) {
|
|
39579
|
-
const
|
|
39972
|
+
const registry2 = new Map([
|
|
39580
39973
|
["Assert", (type, references, value) => {
|
|
39581
39974
|
Assert(type, references, value);
|
|
39582
39975
|
return value;
|
|
@@ -39590,15 +39983,15 @@ var ParseRegistry;
|
|
|
39590
39983
|
["Encode", (type, references, value) => HasTransform(type, references) ? TransformEncode(type, references, value) : value]
|
|
39591
39984
|
]);
|
|
39592
39985
|
function Delete5(key) {
|
|
39593
|
-
|
|
39986
|
+
registry2.delete(key);
|
|
39594
39987
|
}
|
|
39595
39988
|
ParseRegistry2.Delete = Delete5;
|
|
39596
39989
|
function Set5(key, callback) {
|
|
39597
|
-
|
|
39990
|
+
registry2.set(key, callback);
|
|
39598
39991
|
}
|
|
39599
39992
|
ParseRegistry2.Set = Set5;
|
|
39600
39993
|
function Get4(key) {
|
|
39601
|
-
return
|
|
39994
|
+
return registry2.get(key);
|
|
39602
39995
|
}
|
|
39603
39996
|
ParseRegistry2.Get = Get4;
|
|
39604
39997
|
})(ParseRegistry || (ParseRegistry = {}));
|
|
@@ -39612,10 +40005,10 @@ var ParseDefault = [
|
|
|
39612
40005
|
];
|
|
39613
40006
|
function ParseValue(operations, type, references, value) {
|
|
39614
40007
|
return operations.reduce((value2, operationKey) => {
|
|
39615
|
-
const
|
|
39616
|
-
if (IsUndefined2(
|
|
40008
|
+
const operation2 = ParseRegistry.Get(operationKey);
|
|
40009
|
+
if (IsUndefined2(operation2))
|
|
39617
40010
|
throw new ParseError(`Unable to find Parse operation '${operationKey}'`);
|
|
39618
|
-
return
|
|
40011
|
+
return operation2(type, references, value2);
|
|
39619
40012
|
}, value);
|
|
39620
40013
|
}
|
|
39621
40014
|
function Parse(...args2) {
|
|
@@ -39675,19 +40068,19 @@ ${lines.join(`
|
|
|
39675
40068
|
};
|
|
39676
40069
|
var checkEnvFileSecurity = (properties) => {
|
|
39677
40070
|
const cwd2 = process.cwd();
|
|
39678
|
-
const envPath =
|
|
40071
|
+
const envPath = resolve50(cwd2, ".env");
|
|
39679
40072
|
if (!existsSync42(envPath))
|
|
39680
40073
|
return;
|
|
39681
40074
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
39682
40075
|
if (sensitiveKeys.length === 0)
|
|
39683
40076
|
return;
|
|
39684
|
-
const envContent =
|
|
40077
|
+
const envContent = readFileSync38(envPath, "utf-8");
|
|
39685
40078
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
39686
40079
|
if (presentKeys.length === 0)
|
|
39687
40080
|
return;
|
|
39688
|
-
const gitignorePath =
|
|
40081
|
+
const gitignorePath = resolve50(cwd2, ".gitignore");
|
|
39689
40082
|
if (existsSync42(gitignorePath)) {
|
|
39690
|
-
const gitignore =
|
|
40083
|
+
const gitignore = readFileSync38(gitignorePath, "utf-8");
|
|
39691
40084
|
if (gitignore.split(`
|
|
39692
40085
|
`).some((line) => line.trim() === ".env"))
|
|
39693
40086
|
return;
|
|
@@ -39720,7 +40113,7 @@ var getEnv = (key) => {
|
|
|
39720
40113
|
};
|
|
39721
40114
|
// src/utils/projectRoot.ts
|
|
39722
40115
|
import { existsSync as existsSync43 } from "fs";
|
|
39723
|
-
import { dirname as
|
|
40116
|
+
import { dirname as dirname34, resolve as resolve51 } from "path";
|
|
39724
40117
|
var CONFIG_CANDIDATES = [
|
|
39725
40118
|
"absolute.config.ts",
|
|
39726
40119
|
"absolute.config.js",
|
|
@@ -39729,7 +40122,7 @@ var CONFIG_CANDIDATES = [
|
|
|
39729
40122
|
"absolute.config.mts",
|
|
39730
40123
|
"absolute.config.cts"
|
|
39731
40124
|
];
|
|
39732
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(
|
|
40125
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(resolve51(directory, name)));
|
|
39733
40126
|
var findProjectRoot = () => {
|
|
39734
40127
|
const start = process.cwd();
|
|
39735
40128
|
let packageRoot = null;
|
|
@@ -39738,10 +40131,10 @@ var findProjectRoot = () => {
|
|
|
39738
40131
|
if (hasAbsoluteConfig(directory)) {
|
|
39739
40132
|
return directory;
|
|
39740
40133
|
}
|
|
39741
|
-
if (packageRoot === null && existsSync43(
|
|
40134
|
+
if (packageRoot === null && existsSync43(resolve51(directory, "package.json"))) {
|
|
39742
40135
|
packageRoot = directory;
|
|
39743
40136
|
}
|
|
39744
|
-
const parent =
|
|
40137
|
+
const parent = dirname34(directory);
|
|
39745
40138
|
if (parent === directory) {
|
|
39746
40139
|
return packageRoot ?? start;
|
|
39747
40140
|
}
|
|
@@ -39987,5 +40380,5 @@ export {
|
|
|
39987
40380
|
ANGULAR_INIT_TIMEOUT_MS
|
|
39988
40381
|
};
|
|
39989
40382
|
|
|
39990
|
-
//# debugId=
|
|
40383
|
+
//# debugId=6C5F45490109F7A064756E2164756E21
|
|
39991
40384
|
//# sourceMappingURL=index.js.map
|