@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/build.js
CHANGED
|
@@ -12859,9 +12859,392 @@ var isTestSourcePath = (file) => {
|
|
|
12859
12859
|
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
12860
12860
|
};
|
|
12861
12861
|
|
|
12862
|
+
// node_modules/@absolutejs/sync/dist/client/index.js
|
|
12863
|
+
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
12864
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
12865
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
|
|
12866
|
+
return value;
|
|
12867
|
+
}, isSchemaBundle = (schema) => ("components" in schema), validatePolicyMatch = (match, label) => {
|
|
12868
|
+
if (match.length === 0 || match.trim() !== match || /^\*+$/.test(match) || match.includes("**"))
|
|
12869
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.match must be an exact name or a non-empty glob without adjacent wildcards.`);
|
|
12870
|
+
}, validateSyncLocalDataPolicy = (policy, label = "localData") => {
|
|
12871
|
+
if (policy.maxBytesPerNamespace !== undefined && (!Number.isSafeInteger(policy.maxBytesPerNamespace) || policy.maxBytesPerNamespace < 1))
|
|
12872
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.maxBytesPerNamespace must be a positive safe integer.`);
|
|
12873
|
+
for (const [index, rule] of (policy.collections ?? []).entries()) {
|
|
12874
|
+
validatePolicyMatch(rule.match, `${label}.collections[${index}]`);
|
|
12875
|
+
if (rule.maxAgeMs !== undefined && (!Number.isSafeInteger(rule.maxAgeMs) || rule.maxAgeMs < 1))
|
|
12876
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}].maxAgeMs must be a positive safe integer.`);
|
|
12877
|
+
if (rule.persistence === "memory-only" && rule.protection === "required")
|
|
12878
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] cannot require at-rest protection when it is memory-only.`);
|
|
12879
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
12880
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] declares ${rule.sensitivity} data without required protection or memory-only persistence.`);
|
|
12881
|
+
}
|
|
12882
|
+
for (const [index, rule] of (policy.mutations ?? []).entries()) {
|
|
12883
|
+
validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
|
|
12884
|
+
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
12885
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] declares ${rule.sensitivity} arguments without required protection.`);
|
|
12886
|
+
}
|
|
12887
|
+
return policy;
|
|
12888
|
+
}, normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
|
|
12889
|
+
const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
|
|
12890
|
+
const ids = new Set;
|
|
12891
|
+
for (const component of components) {
|
|
12892
|
+
if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
|
|
12893
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
|
|
12894
|
+
if (ids.has(component.id))
|
|
12895
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
|
|
12896
|
+
ids.add(component.id);
|
|
12897
|
+
if (component.localData)
|
|
12898
|
+
validateSyncLocalDataPolicy(component.localData, `${component.id}.localData`);
|
|
12899
|
+
}
|
|
12900
|
+
return components.sort((a, b2) => a.id.localeCompare(b2.id));
|
|
12901
|
+
}, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
|
|
12902
|
+
const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
|
|
12903
|
+
const current = resolveSyncLocalMigrations(component.version, component);
|
|
12904
|
+
return {
|
|
12905
|
+
id: component.id,
|
|
12906
|
+
...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
|
|
12907
|
+
};
|
|
12908
|
+
});
|
|
12909
|
+
const active = new Set(components.map((component) => component.id));
|
|
12910
|
+
const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
|
|
12911
|
+
return { components, orphanedComponents };
|
|
12912
|
+
}, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
|
|
12913
|
+
positiveVersion(storedVersion, "Stored Sync schema version");
|
|
12914
|
+
const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
|
|
12915
|
+
const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
|
|
12916
|
+
const versions = new Set;
|
|
12917
|
+
for (const migration of migrations) {
|
|
12918
|
+
positiveVersion(migration.toVersion, "Sync migration toVersion");
|
|
12919
|
+
if (versions.has(migration.toVersion))
|
|
12920
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
|
|
12921
|
+
versions.add(migration.toVersion);
|
|
12922
|
+
}
|
|
12923
|
+
const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
|
|
12924
|
+
const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
|
|
12925
|
+
if (minimumCompatibleVersion > targetVersion)
|
|
12926
|
+
throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
|
|
12927
|
+
if (storedVersion > targetVersion)
|
|
12928
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
|
|
12929
|
+
if (storedVersion < minimumCompatibleVersion)
|
|
12930
|
+
throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
|
|
12931
|
+
const steps = [];
|
|
12932
|
+
for (let version = storedVersion + 1;version <= targetVersion; version++) {
|
|
12933
|
+
const migration = migrations.find((candidate) => candidate.toVersion === version);
|
|
12934
|
+
if (migration === undefined)
|
|
12935
|
+
throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
|
|
12936
|
+
steps.push(migration);
|
|
12937
|
+
}
|
|
12938
|
+
return { minimumCompatibleVersion, steps, targetVersion };
|
|
12939
|
+
};
|
|
12940
|
+
var init_client = __esm(() => {
|
|
12941
|
+
RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
|
|
12942
|
+
host = globalThis;
|
|
12943
|
+
registry = (() => {
|
|
12944
|
+
const existing = host[RUNTIME_TRANSPORT];
|
|
12945
|
+
if (isRegistry(existing))
|
|
12946
|
+
return existing;
|
|
12947
|
+
const created = { installations: [] };
|
|
12948
|
+
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
12949
|
+
configurable: false,
|
|
12950
|
+
enumerable: false,
|
|
12951
|
+
value: created,
|
|
12952
|
+
writable: false
|
|
12953
|
+
});
|
|
12954
|
+
return created;
|
|
12955
|
+
})();
|
|
12956
|
+
SyncLocalDataPolicyError = class SyncLocalDataPolicyError extends Error {
|
|
12957
|
+
code;
|
|
12958
|
+
constructor(code, message) {
|
|
12959
|
+
super(message);
|
|
12960
|
+
this.name = "SyncLocalDataPolicyError";
|
|
12961
|
+
this.code = code;
|
|
12962
|
+
}
|
|
12963
|
+
};
|
|
12964
|
+
SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
|
|
12965
|
+
code;
|
|
12966
|
+
storedVersion;
|
|
12967
|
+
targetVersion;
|
|
12968
|
+
constructor(code, message, versions = {}) {
|
|
12969
|
+
super(message);
|
|
12970
|
+
this.name = "SyncLocalStoreSchemaError";
|
|
12971
|
+
this.code = code;
|
|
12972
|
+
this.storedVersion = versions.storedVersion;
|
|
12973
|
+
this.targetVersion = versions.targetVersion;
|
|
12974
|
+
}
|
|
12975
|
+
};
|
|
12976
|
+
});
|
|
12977
|
+
|
|
12978
|
+
// src/mobile/syncSchema.ts
|
|
12979
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
12980
|
+
import { dirname as dirname13, join as join24, resolve as resolve20 } from "path";
|
|
12981
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
12982
|
+
try {
|
|
12983
|
+
const value = JSON.parse(readFileSync13(path, "utf8"));
|
|
12984
|
+
return object(value) ? value : undefined;
|
|
12985
|
+
} catch {
|
|
12986
|
+
return;
|
|
12987
|
+
}
|
|
12988
|
+
}, localSchemaMetadata = (manifest) => {
|
|
12989
|
+
const absolutejs = Reflect.get(manifest, "absolutejs");
|
|
12990
|
+
if (!object(absolutejs))
|
|
12991
|
+
return;
|
|
12992
|
+
const sync = Reflect.get(absolutejs, "sync");
|
|
12993
|
+
if (!object(sync))
|
|
12994
|
+
return;
|
|
12995
|
+
return Reflect.get(sync, "localSchema");
|
|
12996
|
+
}, packageManifestPath = (projectRoot, packageName) => {
|
|
12997
|
+
let directory = resolve20(projectRoot);
|
|
12998
|
+
while (true) {
|
|
12999
|
+
const candidate = join24(directory, "node_modules", packageName, "package.json");
|
|
13000
|
+
const manifest = manifestAt(candidate);
|
|
13001
|
+
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
13002
|
+
return candidate;
|
|
13003
|
+
const parent = dirname13(directory);
|
|
13004
|
+
if (parent === directory)
|
|
13005
|
+
return;
|
|
13006
|
+
directory = parent;
|
|
13007
|
+
}
|
|
13008
|
+
}, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
|
|
13009
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
13010
|
+
throw metadataError(id, `${field} must be a positive safe integer.`);
|
|
13011
|
+
return value;
|
|
13012
|
+
}, nonEmpty = (value, id, field) => {
|
|
13013
|
+
if (typeof value !== "string" || value.trim() !== value || value.length === 0)
|
|
13014
|
+
throw metadataError(id, `${field} must be a non-empty trimmed string.`);
|
|
13015
|
+
return value;
|
|
13016
|
+
}, requireObject = (value, id, detail) => {
|
|
13017
|
+
if (!object(value))
|
|
13018
|
+
throw metadataError(id, detail);
|
|
13019
|
+
return value;
|
|
13020
|
+
}, unknownField = (record, key) => record[key], normalizeJsonValue = (value, id, field) => {
|
|
13021
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
13022
|
+
return value;
|
|
13023
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
13024
|
+
return value;
|
|
13025
|
+
if (Array.isArray(value))
|
|
13026
|
+
return value.map((entry) => normalizeJsonValue(entry, id, field));
|
|
13027
|
+
if (object(value))
|
|
13028
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
13029
|
+
key,
|
|
13030
|
+
normalizeJsonValue(entry, id, field)
|
|
13031
|
+
]));
|
|
13032
|
+
throw metadataError(id, `${field} must be JSON-safe.`);
|
|
13033
|
+
}, operation = (value, id, index) => {
|
|
13034
|
+
const record = requireObject(value, id, `migration operation ${index} must be an object.`);
|
|
13035
|
+
const type = Reflect.get(record, "type");
|
|
13036
|
+
const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
|
|
13037
|
+
if (type === "delete-collection")
|
|
13038
|
+
return { collection, type };
|
|
13039
|
+
if (type === "rename-field")
|
|
13040
|
+
return {
|
|
13041
|
+
collection,
|
|
13042
|
+
from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
|
|
13043
|
+
to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
|
|
13044
|
+
type
|
|
13045
|
+
};
|
|
13046
|
+
const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
|
|
13047
|
+
if (type === "remove-field")
|
|
13048
|
+
return { collection, field, type };
|
|
13049
|
+
if (type === "set-default")
|
|
13050
|
+
return {
|
|
13051
|
+
collection,
|
|
13052
|
+
field,
|
|
13053
|
+
type,
|
|
13054
|
+
value: normalizeJsonValue(Reflect.get(record, "value"), id, `operation ${index}.value`)
|
|
13055
|
+
};
|
|
13056
|
+
throw metadataError(id, `operation ${index}.type is not supported.`);
|
|
13057
|
+
}, migration = (value, id, index) => {
|
|
13058
|
+
const record = requireObject(value, id, `migration ${index} must be an object.`);
|
|
13059
|
+
const allowed = new Set(["operations", "toVersion"]);
|
|
13060
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13061
|
+
if (unsupported)
|
|
13062
|
+
throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
|
|
13063
|
+
const declaredOperations = Reflect.get(record, "operations");
|
|
13064
|
+
if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
|
|
13065
|
+
throw metadataError(id, `migration ${index}.operations must be an array.`);
|
|
13066
|
+
const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
|
|
13067
|
+
return {
|
|
13068
|
+
operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
|
|
13069
|
+
toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
|
|
13070
|
+
};
|
|
13071
|
+
}, localDataPolicy = (value, id) => {
|
|
13072
|
+
const record = requireObject(value, id, "localData must be an object.");
|
|
13073
|
+
const allowed = new Set([
|
|
13074
|
+
"collections",
|
|
13075
|
+
"maxBytesPerNamespace",
|
|
13076
|
+
"mutations"
|
|
13077
|
+
]);
|
|
13078
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13079
|
+
if (unsupported)
|
|
13080
|
+
throw metadataError(id, `localData.${unsupported} is not supported.`);
|
|
13081
|
+
const collectionRules = Reflect.get(record, "collections");
|
|
13082
|
+
const mutationRules = Reflect.get(record, "mutations");
|
|
13083
|
+
if (collectionRules !== undefined && !Array.isArray(collectionRules))
|
|
13084
|
+
throw metadataError(id, "localData.collections must be an array.");
|
|
13085
|
+
if (mutationRules !== undefined && !Array.isArray(mutationRules))
|
|
13086
|
+
throw metadataError(id, "localData.mutations must be an array.");
|
|
13087
|
+
const collections = Array.isArray(collectionRules) ? collectionRules.map((entry, index) => {
|
|
13088
|
+
const rule = requireObject(entry, id, `localData.collections[${index}] must be an object.`);
|
|
13089
|
+
const allowedRuleKeys = new Set([
|
|
13090
|
+
"evictionPriority",
|
|
13091
|
+
"match",
|
|
13092
|
+
"maxAgeMs",
|
|
13093
|
+
"onProtectionUnavailable",
|
|
13094
|
+
"persistence",
|
|
13095
|
+
"protection",
|
|
13096
|
+
"sensitivity"
|
|
13097
|
+
]);
|
|
13098
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13099
|
+
if (unsupportedRuleKey)
|
|
13100
|
+
throw metadataError(id, `localData.collections[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13101
|
+
const match = nonEmpty(Reflect.get(rule, "match"), id, `localData.collections[${index}].match`);
|
|
13102
|
+
const persistence = unknownField(rule, "persistence");
|
|
13103
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13104
|
+
const protection = unknownField(rule, "protection");
|
|
13105
|
+
const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
|
|
13106
|
+
const evictionPriority = unknownField(rule, "evictionPriority");
|
|
13107
|
+
const maxAge = unknownField(rule, "maxAgeMs");
|
|
13108
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13109
|
+
throw metadataError(id, `localData.collections[${index}].persistence is invalid.`);
|
|
13110
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13111
|
+
throw metadataError(id, `localData.collections[${index}].sensitivity is invalid.`);
|
|
13112
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13113
|
+
throw metadataError(id, `localData.collections[${index}].protection is invalid.`);
|
|
13114
|
+
if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
|
|
13115
|
+
throw metadataError(id, `localData.collections[${index}].onProtectionUnavailable is invalid.`);
|
|
13116
|
+
if (evictionPriority !== undefined && evictionPriority !== "critical" && evictionPriority !== "normal" && evictionPriority !== "disposable")
|
|
13117
|
+
throw metadataError(id, `localData.collections[${index}].evictionPriority is invalid.`);
|
|
13118
|
+
return {
|
|
13119
|
+
match,
|
|
13120
|
+
...sensitivity ? { sensitivity } : {},
|
|
13121
|
+
...persistence ? { persistence } : {},
|
|
13122
|
+
...protection ? { protection } : {},
|
|
13123
|
+
...onProtectionUnavailable ? {
|
|
13124
|
+
onProtectionUnavailable
|
|
13125
|
+
} : {},
|
|
13126
|
+
...evictionPriority ? { evictionPriority } : {},
|
|
13127
|
+
...maxAge === undefined ? {} : {
|
|
13128
|
+
maxAgeMs: positiveVersion2(maxAge, id, `localData.collections[${index}].maxAgeMs`)
|
|
13129
|
+
}
|
|
13130
|
+
};
|
|
13131
|
+
}) : undefined;
|
|
13132
|
+
const mutations = Array.isArray(mutationRules) ? mutationRules.map((entry, index) => {
|
|
13133
|
+
const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
|
|
13134
|
+
const allowedRuleKeys = new Set([
|
|
13135
|
+
"match",
|
|
13136
|
+
"persistence",
|
|
13137
|
+
"protection",
|
|
13138
|
+
"sensitivity"
|
|
13139
|
+
]);
|
|
13140
|
+
const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
|
|
13141
|
+
if (unsupportedRuleKey)
|
|
13142
|
+
throw metadataError(id, `localData.mutations[${index}].${unsupportedRuleKey} is not supported.`);
|
|
13143
|
+
const protection = unknownField(rule, "protection");
|
|
13144
|
+
const sensitivity = unknownField(rule, "sensitivity");
|
|
13145
|
+
const persistence = unknownField(rule, "persistence");
|
|
13146
|
+
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13147
|
+
throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
|
|
13148
|
+
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
13149
|
+
throw metadataError(id, `localData.mutations[${index}].sensitivity is invalid.`);
|
|
13150
|
+
if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
|
|
13151
|
+
throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
|
|
13152
|
+
return {
|
|
13153
|
+
match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
|
|
13154
|
+
...sensitivity ? { sensitivity } : {},
|
|
13155
|
+
...persistence ? {
|
|
13156
|
+
persistence
|
|
13157
|
+
} : {},
|
|
13158
|
+
...protection ? { protection } : {}
|
|
13159
|
+
};
|
|
13160
|
+
}) : undefined;
|
|
13161
|
+
const quota = Reflect.get(record, "maxBytesPerNamespace");
|
|
13162
|
+
return {
|
|
13163
|
+
...collections ? { collections } : {},
|
|
13164
|
+
...mutations ? { mutations } : {},
|
|
13165
|
+
...quota === undefined ? {} : {
|
|
13166
|
+
maxBytesPerNamespace: positiveVersion2(quota, id, "localData.maxBytesPerNamespace")
|
|
13167
|
+
}
|
|
13168
|
+
};
|
|
13169
|
+
}, component = (id, value) => {
|
|
13170
|
+
const record = requireObject(value, id, "localSchema must be an object.");
|
|
13171
|
+
const allowed = new Set([
|
|
13172
|
+
"localData",
|
|
13173
|
+
"migrations",
|
|
13174
|
+
"minimumCompatibleVersion",
|
|
13175
|
+
"version"
|
|
13176
|
+
]);
|
|
13177
|
+
const unsupported = Object.keys(record).find((key) => !allowed.has(key));
|
|
13178
|
+
if (unsupported)
|
|
13179
|
+
throw metadataError(id, `${unsupported} is not supported.`);
|
|
13180
|
+
const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
|
|
13181
|
+
const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
|
|
13182
|
+
const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
|
|
13183
|
+
const declaredMigrations = Reflect.get(record, "migrations");
|
|
13184
|
+
const declaredLocalData = Reflect.get(record, "localData");
|
|
13185
|
+
if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
|
|
13186
|
+
throw metadataError(id, "migrations must be an array.");
|
|
13187
|
+
const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
|
|
13188
|
+
return {
|
|
13189
|
+
id,
|
|
13190
|
+
...declaredLocalData === undefined ? {} : { localData: localDataPolicy(declaredLocalData, id) },
|
|
13191
|
+
minimumCompatibleVersion,
|
|
13192
|
+
...Array.isArray(migrations) ? {
|
|
13193
|
+
migrations: migrations.map((entry, index) => migration(entry, id, index))
|
|
13194
|
+
} : {},
|
|
13195
|
+
version
|
|
13196
|
+
};
|
|
13197
|
+
}, dependencyNames = (manifest) => [
|
|
13198
|
+
Reflect.get(manifest, "dependencies"),
|
|
13199
|
+
Reflect.get(manifest, "optionalDependencies"),
|
|
13200
|
+
Reflect.get(manifest, "devDependencies"),
|
|
13201
|
+
Reflect.get(manifest, "peerDependencies")
|
|
13202
|
+
].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
13203
|
+
const appManifestPath = join24(resolve20(projectRoot), "package.json");
|
|
13204
|
+
const appManifest = manifestAt(appManifestPath);
|
|
13205
|
+
if (!appManifest)
|
|
13206
|
+
return {
|
|
13207
|
+
components: [
|
|
13208
|
+
{
|
|
13209
|
+
id: "@absolutejs/app",
|
|
13210
|
+
minimumCompatibleVersion: 1,
|
|
13211
|
+
version: 1
|
|
13212
|
+
}
|
|
13213
|
+
],
|
|
13214
|
+
sources: []
|
|
13215
|
+
};
|
|
13216
|
+
const appMetadata = localSchemaMetadata(appManifest);
|
|
13217
|
+
const components = [
|
|
13218
|
+
appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
|
|
13219
|
+
];
|
|
13220
|
+
const sources = [
|
|
13221
|
+
{ id: "@absolutejs/app", manifestPath: appManifestPath }
|
|
13222
|
+
];
|
|
13223
|
+
for (const name of dependencyNames(appManifest)) {
|
|
13224
|
+
const manifestPath = packageManifestPath(projectRoot, name);
|
|
13225
|
+
if (!manifestPath)
|
|
13226
|
+
continue;
|
|
13227
|
+
const manifest = manifestAt(manifestPath);
|
|
13228
|
+
if (!manifest)
|
|
13229
|
+
continue;
|
|
13230
|
+
const metadata = localSchemaMetadata(manifest);
|
|
13231
|
+
if (metadata === undefined)
|
|
13232
|
+
continue;
|
|
13233
|
+
components.push(component(name, metadata));
|
|
13234
|
+
sources.push({ id: name, manifestPath });
|
|
13235
|
+
}
|
|
13236
|
+
components.sort((left, right) => left.id.localeCompare(right.id));
|
|
13237
|
+
sources.sort((left, right) => left.id.localeCompare(right.id));
|
|
13238
|
+
resolveSyncLocalSchemaComponents({}, { components });
|
|
13239
|
+
return { components, sources };
|
|
13240
|
+
};
|
|
13241
|
+
var init_syncSchema = __esm(() => {
|
|
13242
|
+
init_client();
|
|
13243
|
+
});
|
|
13244
|
+
|
|
12862
13245
|
// src/build/pwa.ts
|
|
12863
13246
|
import { mkdir as mkdir5, rm as rm4, writeFile as writeFile5 } from "fs/promises";
|
|
12864
|
-
import { dirname as
|
|
13247
|
+
import { dirname as dirname14, join as join25 } from "path";
|
|
12865
13248
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
12866
13249
|
const input = value ?? fallback;
|
|
12867
13250
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -12888,7 +13271,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
12888
13271
|
}
|
|
12889
13272
|
}
|
|
12890
13273
|
return url.pathname;
|
|
12891
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
13274
|
+
}, destinationFor = (buildPath, publicPath) => join25(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
12892
13275
|
clientModule,
|
|
12893
13276
|
manifestPath,
|
|
12894
13277
|
serviceWorkerPath,
|
|
@@ -12900,7 +13283,7 @@ manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
|
|
|
12900
13283
|
if (!manifest.isConnected) document.head.append(manifest);
|
|
12901
13284
|
` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
|
|
12902
13285
|
deferUntilLoad: false${sync ? `,
|
|
12903
|
-
sync: ${JSON.stringify(sync
|
|
13286
|
+
sync: ${JSON.stringify(sync)}` : ""}
|
|
12904
13287
|
});
|
|
12905
13288
|
`, injectionSource = () => `if (typeof window !== 'undefined') {
|
|
12906
13289
|
await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
|
|
@@ -12918,6 +13301,7 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12918
13301
|
buildPath,
|
|
12919
13302
|
config,
|
|
12920
13303
|
generatedRoot,
|
|
13304
|
+
projectRoot,
|
|
12921
13305
|
write: write2 = true
|
|
12922
13306
|
}) => {
|
|
12923
13307
|
const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
|
|
@@ -12933,9 +13317,10 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12933
13317
|
};
|
|
12934
13318
|
if (!write2)
|
|
12935
13319
|
return artifacts;
|
|
13320
|
+
const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
|
|
12936
13321
|
const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
|
|
12937
13322
|
const workerDestination = destinationFor(buildPath, serviceWorkerPath);
|
|
12938
|
-
await mkdir5(
|
|
13323
|
+
await mkdir5(dirname14(workerDestination), { recursive: true });
|
|
12939
13324
|
await writeFile5(workerDestination, `${pushServiceWorker({
|
|
12940
13325
|
...config.serviceWorker ?? {},
|
|
12941
13326
|
sync: Boolean(config.sync)
|
|
@@ -12944,19 +13329,24 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12944
13329
|
if (config.manifest && manifestPath) {
|
|
12945
13330
|
const { path: _path, ...manifestConfig } = config.manifest;
|
|
12946
13331
|
const manifestDestination = destinationFor(buildPath, manifestPath);
|
|
12947
|
-
await mkdir5(
|
|
13332
|
+
await mkdir5(dirname14(manifestDestination), { recursive: true });
|
|
12948
13333
|
await writeFile5(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
12949
13334
|
`);
|
|
12950
13335
|
}
|
|
12951
|
-
const generatedDirectory =
|
|
12952
|
-
const bootstrapEntry =
|
|
13336
|
+
const generatedDirectory = join25(generatedRoot, "pwa");
|
|
13337
|
+
const bootstrapEntry = join25(generatedDirectory, "bootstrap.ts");
|
|
12953
13338
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
12954
13339
|
await mkdir5(generatedDirectory, { recursive: true });
|
|
12955
13340
|
await writeFile5(bootstrapEntry, bootstrapEntrySource({
|
|
12956
13341
|
clientModule,
|
|
12957
13342
|
manifestPath,
|
|
12958
13343
|
serviceWorkerPath,
|
|
12959
|
-
sync: config.sync
|
|
13344
|
+
sync: config.sync ? {
|
|
13345
|
+
...config.sync === true ? {} : config.sync,
|
|
13346
|
+
storageSchema: {
|
|
13347
|
+
components: syncSchema?.components ?? []
|
|
13348
|
+
}
|
|
13349
|
+
} : config.sync
|
|
12960
13350
|
}));
|
|
12961
13351
|
const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
|
|
12962
13352
|
await rm4(browserDirectory, { force: true, recursive: true });
|
|
@@ -12979,15 +13369,17 @@ if (!manifest.isConnected) document.head.append(manifest);
|
|
|
12979
13369
|
}
|
|
12980
13370
|
return artifacts;
|
|
12981
13371
|
};
|
|
12982
|
-
var init_pwa = () => {
|
|
13372
|
+
var init_pwa = __esm(() => {
|
|
13373
|
+
init_syncSchema();
|
|
13374
|
+
});
|
|
12983
13375
|
|
|
12984
13376
|
// src/build/scanVueSsrOnlyPages.ts
|
|
12985
13377
|
var exports_scanVueSsrOnlyPages = {};
|
|
12986
13378
|
__export(exports_scanVueSsrOnlyPages, {
|
|
12987
13379
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
12988
13380
|
});
|
|
12989
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
12990
|
-
import { join as
|
|
13381
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
13382
|
+
import { join as join26 } from "path";
|
|
12991
13383
|
import ts8 from "typescript";
|
|
12992
13384
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
12993
13385
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13020,9 +13412,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13020
13412
|
continue;
|
|
13021
13413
|
if (entry.name.startsWith("."))
|
|
13022
13414
|
continue;
|
|
13023
|
-
stack.push(
|
|
13415
|
+
stack.push(join26(dir, entry.name));
|
|
13024
13416
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
13025
|
-
out.push(
|
|
13417
|
+
out.push(join26(dir, entry.name));
|
|
13026
13418
|
}
|
|
13027
13419
|
}
|
|
13028
13420
|
}
|
|
@@ -13089,7 +13481,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
|
|
|
13089
13481
|
}, extractFromFile = (filePath, out) => {
|
|
13090
13482
|
let source;
|
|
13091
13483
|
try {
|
|
13092
|
-
source =
|
|
13484
|
+
source = readFileSync14(filePath, "utf-8");
|
|
13093
13485
|
} catch {
|
|
13094
13486
|
return;
|
|
13095
13487
|
}
|
|
@@ -13133,8 +13525,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
13133
13525
|
});
|
|
13134
13526
|
|
|
13135
13527
|
// src/build/scanAngularHandlerCalls.ts
|
|
13136
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
13137
|
-
import { join as
|
|
13528
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync15 } from "fs";
|
|
13529
|
+
import { join as join27 } from "path";
|
|
13138
13530
|
import ts9 from "typescript";
|
|
13139
13531
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
13140
13532
|
if (filePath.endsWith(".tsx"))
|
|
@@ -13167,9 +13559,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13167
13559
|
continue;
|
|
13168
13560
|
if (entry.name.startsWith("."))
|
|
13169
13561
|
continue;
|
|
13170
|
-
stack.push(
|
|
13562
|
+
stack.push(join27(dir, entry.name));
|
|
13171
13563
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
13172
|
-
out.push(
|
|
13564
|
+
out.push(join27(dir, entry.name));
|
|
13173
13565
|
}
|
|
13174
13566
|
}
|
|
13175
13567
|
}
|
|
@@ -13204,7 +13596,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
|
|
|
13204
13596
|
}, extractCallsFromFile = (filePath, out) => {
|
|
13205
13597
|
let source;
|
|
13206
13598
|
try {
|
|
13207
|
-
source =
|
|
13599
|
+
source = readFileSync15(filePath, "utf-8");
|
|
13208
13600
|
} catch {
|
|
13209
13601
|
return;
|
|
13210
13602
|
}
|
|
@@ -13283,8 +13675,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
13283
13675
|
});
|
|
13284
13676
|
|
|
13285
13677
|
// src/build/scanAngularPageRoutes.ts
|
|
13286
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
13287
|
-
import { basename as basename9, join as
|
|
13678
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync16 } from "fs";
|
|
13679
|
+
import { basename as basename9, join as join28 } from "path";
|
|
13288
13680
|
import ts10 from "typescript";
|
|
13289
13681
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
13290
13682
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -13324,9 +13716,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13324
13716
|
continue;
|
|
13325
13717
|
if (entry.name.startsWith("."))
|
|
13326
13718
|
continue;
|
|
13327
|
-
stack.push(
|
|
13719
|
+
stack.push(join28(dir, entry.name));
|
|
13328
13720
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
13329
|
-
out.push(
|
|
13721
|
+
out.push(join28(dir, entry.name));
|
|
13330
13722
|
}
|
|
13331
13723
|
}
|
|
13332
13724
|
}
|
|
@@ -13355,7 +13747,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
13355
13747
|
for (const file of files) {
|
|
13356
13748
|
let source;
|
|
13357
13749
|
try {
|
|
13358
|
-
source =
|
|
13750
|
+
source = readFileSync16(file, "utf-8");
|
|
13359
13751
|
} catch {
|
|
13360
13752
|
continue;
|
|
13361
13753
|
}
|
|
@@ -13402,8 +13794,8 @@ var exports_parseAngularConfigImports = {};
|
|
|
13402
13794
|
__export(exports_parseAngularConfigImports, {
|
|
13403
13795
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
13404
13796
|
});
|
|
13405
|
-
import { existsSync as existsSync20, readFileSync as
|
|
13406
|
-
import { dirname as
|
|
13797
|
+
import { existsSync as existsSync20, readFileSync as readFileSync17 } from "fs";
|
|
13798
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join29 } from "path";
|
|
13407
13799
|
import ts11 from "typescript";
|
|
13408
13800
|
var findDefineConfigCall = (sf) => {
|
|
13409
13801
|
let result = null;
|
|
@@ -13421,8 +13813,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13421
13813
|
};
|
|
13422
13814
|
ts11.forEachChild(sf, visit);
|
|
13423
13815
|
return result;
|
|
13424
|
-
}, findPropertyInitializer = (
|
|
13425
|
-
for (const prop of
|
|
13816
|
+
}, findPropertyInitializer = (object2, name) => {
|
|
13817
|
+
for (const prop of object2.properties) {
|
|
13426
13818
|
if (!ts11.isPropertyAssignment(prop))
|
|
13427
13819
|
continue;
|
|
13428
13820
|
if (!prop.name)
|
|
@@ -13458,15 +13850,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
13458
13850
|
}, resolveConfigPath = (projectRoot) => {
|
|
13459
13851
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
13460
13852
|
if (envOverride) {
|
|
13461
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
13853
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join29(projectRoot, envOverride);
|
|
13462
13854
|
if (existsSync20(resolved))
|
|
13463
13855
|
return resolved;
|
|
13464
13856
|
}
|
|
13465
13857
|
const candidates = [
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13858
|
+
join29(projectRoot, "absolute.config.ts"),
|
|
13859
|
+
join29(projectRoot, "absolute.config.mts"),
|
|
13860
|
+
join29(projectRoot, "absolute.config.js"),
|
|
13861
|
+
join29(projectRoot, "absolute.config.mjs")
|
|
13470
13862
|
];
|
|
13471
13863
|
for (const candidate of candidates) {
|
|
13472
13864
|
if (existsSync20(candidate))
|
|
@@ -13477,7 +13869,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
13477
13869
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
13478
13870
|
if (!configPath2)
|
|
13479
13871
|
return null;
|
|
13480
|
-
const source =
|
|
13872
|
+
const source = readFileSync17(configPath2, "utf-8");
|
|
13481
13873
|
if (!source.includes("angular"))
|
|
13482
13874
|
return null;
|
|
13483
13875
|
if (!source.includes("providers"))
|
|
@@ -13498,8 +13890,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
13498
13890
|
const importInfo = findImportForBinding(sf, binding);
|
|
13499
13891
|
if (!importInfo)
|
|
13500
13892
|
return null;
|
|
13501
|
-
const configDir2 =
|
|
13502
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
13893
|
+
const configDir2 = dirname15(configPath2);
|
|
13894
|
+
const absolutePath = importInfo.source.startsWith(".") ? join29(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
13503
13895
|
return {
|
|
13504
13896
|
absolutePath,
|
|
13505
13897
|
bindingName: binding,
|
|
@@ -13514,8 +13906,8 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13514
13906
|
const componentMatch = attributeString.match(/\bcomponent\s*=\s*["']([^"']+)["']/);
|
|
13515
13907
|
const hydrateMatch = attributeString.match(/\bhydrate\s*=\s*["']([^"']+)["']/);
|
|
13516
13908
|
const framework = frameworkMatch?.[1];
|
|
13517
|
-
const
|
|
13518
|
-
if (!framework || !
|
|
13909
|
+
const component2 = componentMatch?.[1];
|
|
13910
|
+
if (!framework || !component2) {
|
|
13519
13911
|
return null;
|
|
13520
13912
|
}
|
|
13521
13913
|
if (!isIslandFramework2(framework)) {
|
|
@@ -13523,7 +13915,7 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13523
13915
|
}
|
|
13524
13916
|
const hydrateCandidate = hydrateMatch?.[1];
|
|
13525
13917
|
return {
|
|
13526
|
-
component,
|
|
13918
|
+
component: component2,
|
|
13527
13919
|
framework,
|
|
13528
13920
|
hydrate: hydrateCandidate && isIslandHydrate(hydrateCandidate) ? hydrateCandidate : undefined
|
|
13529
13921
|
};
|
|
@@ -13532,12 +13924,12 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
|
|
|
13532
13924
|
return;
|
|
13533
13925
|
usageMap.set(normalizeUsage(usage), usage);
|
|
13534
13926
|
}, addRenderCallUsage = (usageMap, match) => {
|
|
13535
|
-
const [, framework,
|
|
13536
|
-
if (!framework || !
|
|
13927
|
+
const [, framework, component2, hydrate] = match;
|
|
13928
|
+
if (!framework || !component2 || !isIslandFramework2(framework)) {
|
|
13537
13929
|
return;
|
|
13538
13930
|
}
|
|
13539
13931
|
addUsage(usageMap, {
|
|
13540
|
-
component,
|
|
13932
|
+
component: component2,
|
|
13541
13933
|
framework,
|
|
13542
13934
|
hydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined
|
|
13543
13935
|
});
|
|
@@ -13591,7 +13983,7 @@ __export(exports_renderToReadableStream, {
|
|
|
13591
13983
|
renderToReadableStream: () => renderToReadableStream,
|
|
13592
13984
|
SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
|
|
13593
13985
|
});
|
|
13594
|
-
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (
|
|
13986
|
+
var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
|
|
13595
13987
|
bootstrapScriptContent,
|
|
13596
13988
|
bootstrapScripts = [],
|
|
13597
13989
|
bootstrapModules = [],
|
|
@@ -13605,7 +13997,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
13605
13997
|
try {
|
|
13606
13998
|
const { render } = await import("svelte/server");
|
|
13607
13999
|
const renderComponent = render;
|
|
13608
|
-
const rendered = typeof props === "undefined" ? await renderComponent(
|
|
14000
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
|
|
13609
14001
|
const { head, body } = rendered;
|
|
13610
14002
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
13611
14003
|
const scripts = (bootstrapScriptContent ? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>` : "") + bootstrapScripts.map((src) => `<script${nonceAttr} src="${src}"></script>`).join("") + bootstrapModules.map((src) => `<script${nonceAttr} type="module" src="${src}"></script>`).join("");
|
|
@@ -13650,11 +14042,11 @@ __export(exports_compileSvelte, {
|
|
|
13650
14042
|
import { existsSync as existsSync21 } from "fs";
|
|
13651
14043
|
import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
|
|
13652
14044
|
import {
|
|
13653
|
-
dirname as
|
|
13654
|
-
join as
|
|
14045
|
+
dirname as dirname16,
|
|
14046
|
+
join as join30,
|
|
13655
14047
|
basename as basename10,
|
|
13656
14048
|
extname as extname7,
|
|
13657
|
-
resolve as
|
|
14049
|
+
resolve as resolve21,
|
|
13658
14050
|
relative as relative11,
|
|
13659
14051
|
sep as sep2
|
|
13660
14052
|
} from "path";
|
|
@@ -13662,14 +14054,14 @@ import { env } from "process";
|
|
|
13662
14054
|
var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
13663
14055
|
var resolveDevClientDir2 = () => {
|
|
13664
14056
|
const projectRoot = process.cwd();
|
|
13665
|
-
const fromSource =
|
|
14057
|
+
const fromSource = resolve21(import.meta.dir, "../dev/client");
|
|
13666
14058
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13667
14059
|
return fromSource;
|
|
13668
14060
|
}
|
|
13669
|
-
const fromNodeModules =
|
|
14061
|
+
const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13670
14062
|
if (existsSync21(fromNodeModules))
|
|
13671
14063
|
return fromNodeModules;
|
|
13672
|
-
return
|
|
14064
|
+
return resolve21(import.meta.dir, "./dev/client");
|
|
13673
14065
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
13674
14066
|
persistentCache.clear();
|
|
13675
14067
|
sourceHashCache.clear();
|
|
@@ -13699,7 +14091,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13699
14091
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
13700
14092
|
if (!spec.startsWith("."))
|
|
13701
14093
|
return null;
|
|
13702
|
-
const basePath =
|
|
14094
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13703
14095
|
const candidates = [
|
|
13704
14096
|
basePath,
|
|
13705
14097
|
`${basePath}.ts`,
|
|
@@ -13710,14 +14102,14 @@ var resolveDevClientDir2 = () => {
|
|
|
13710
14102
|
`${basePath}.svelte`,
|
|
13711
14103
|
`${basePath}.svelte.ts`,
|
|
13712
14104
|
`${basePath}.svelte.js`,
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
14105
|
+
join30(basePath, "index.ts"),
|
|
14106
|
+
join30(basePath, "index.js"),
|
|
14107
|
+
join30(basePath, "index.mjs"),
|
|
14108
|
+
join30(basePath, "index.cjs"),
|
|
14109
|
+
join30(basePath, "index.json"),
|
|
14110
|
+
join30(basePath, "index.svelte"),
|
|
14111
|
+
join30(basePath, "index.svelte.ts"),
|
|
14112
|
+
join30(basePath, "index.svelte.js")
|
|
13721
14113
|
];
|
|
13722
14114
|
const checks = await Promise.all(candidates.map(exists));
|
|
13723
14115
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -13726,7 +14118,7 @@ var resolveDevClientDir2 = () => {
|
|
|
13726
14118
|
const resolved = resolvePackageImport(spec);
|
|
13727
14119
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
13728
14120
|
}
|
|
13729
|
-
const basePath =
|
|
14121
|
+
const basePath = resolve21(dirname16(from), spec);
|
|
13730
14122
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
13731
14123
|
if (!explicit) {
|
|
13732
14124
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -13756,9 +14148,9 @@ var resolveDevClientDir2 = () => {
|
|
|
13756
14148
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
13757
14149
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
13758
14150
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
13759
|
-
const clientDir =
|
|
13760
|
-
const indexDir =
|
|
13761
|
-
const serverDir =
|
|
14151
|
+
const clientDir = join30(generatedDir, "client");
|
|
14152
|
+
const indexDir = join30(generatedDir, "indexes");
|
|
14153
|
+
const serverDir = join30(generatedDir, "server");
|
|
13762
14154
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir6(dir, { recursive: true })));
|
|
13763
14155
|
const dev = env.NODE_ENV !== "production";
|
|
13764
14156
|
const build = async (src) => {
|
|
@@ -13786,8 +14178,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13786
14178
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
13787
14179
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
13788
14180
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
13789
|
-
const rawRel =
|
|
13790
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(),
|
|
14181
|
+
const rawRel = dirname16(relative11(svelteRoot, src)).replace(/\\/g, "/");
|
|
14182
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
|
|
13791
14183
|
const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13792
14184
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
13793
14185
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -13796,8 +14188,8 @@ var resolveDevClientDir2 = () => {
|
|
|
13796
14188
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
13797
14189
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
13798
14190
|
const externalRewrites = new Map;
|
|
13799
|
-
const ssrOutputDir =
|
|
13800
|
-
const clientOutputDir =
|
|
14191
|
+
const ssrOutputDir = dirname16(join30(serverDir, relDir, `${baseName}.js`));
|
|
14192
|
+
const clientOutputDir = dirname16(join30(clientDir, relDir, `${baseName}.js`));
|
|
13801
14193
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
13802
14194
|
const rawSpec = importPaths[idx];
|
|
13803
14195
|
if (!rawSpec)
|
|
@@ -13862,11 +14254,11 @@ var resolveDevClientDir2 = () => {
|
|
|
13862
14254
|
code += islandMetadataExports;
|
|
13863
14255
|
return { code, map: compiledJs.map };
|
|
13864
14256
|
};
|
|
13865
|
-
const ssrPath =
|
|
13866
|
-
const clientPath =
|
|
14257
|
+
const ssrPath = join30(serverDir, relDir, `${baseName}.js`);
|
|
14258
|
+
const clientPath = join30(clientDir, relDir, `${baseName}.js`);
|
|
13867
14259
|
await Promise.all([
|
|
13868
|
-
mkdir6(
|
|
13869
|
-
mkdir6(
|
|
14260
|
+
mkdir6(dirname16(ssrPath), { recursive: true }),
|
|
14261
|
+
mkdir6(dirname16(clientPath), { recursive: true })
|
|
13870
14262
|
]);
|
|
13871
14263
|
const inlineMap = (map) => map ? `
|
|
13872
14264
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -13901,10 +14293,10 @@ var resolveDevClientDir2 = () => {
|
|
|
13901
14293
|
const roots = await Promise.all(entryPoints.map(build));
|
|
13902
14294
|
const componentRoots = roots.filter((root) => !root.isModule);
|
|
13903
14295
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
13904
|
-
const relClientDir =
|
|
14296
|
+
const relClientDir = dirname16(relative11(clientDir, client));
|
|
13905
14297
|
const name = basename10(client, extname7(client));
|
|
13906
|
-
const indexPath =
|
|
13907
|
-
const importRaw = relative11(
|
|
14298
|
+
const indexPath = join30(indexDir, relClientDir, `${name}.js`);
|
|
14299
|
+
const importRaw = relative11(dirname16(indexPath), client).split(sep2).join("/");
|
|
13908
14300
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
13909
14301
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
13910
14302
|
import "${hmrClientPath3}";
|
|
@@ -13993,14 +14385,14 @@ if (typeof window !== "undefined") {
|
|
|
13993
14385
|
setTimeout(releaseStreamingSlots, 0);
|
|
13994
14386
|
}
|
|
13995
14387
|
}`;
|
|
13996
|
-
await mkdir6(
|
|
14388
|
+
await mkdir6(dirname16(indexPath), { recursive: true });
|
|
13997
14389
|
return write2(indexPath, bootstrap);
|
|
13998
14390
|
}));
|
|
13999
14391
|
return {
|
|
14000
14392
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
14001
14393
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
14002
|
-
const rel =
|
|
14003
|
-
return
|
|
14394
|
+
const rel = dirname16(relative11(clientDir, client));
|
|
14395
|
+
return join30(indexDir, rel, basename10(client));
|
|
14004
14396
|
}),
|
|
14005
14397
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
14006
14398
|
};
|
|
@@ -14015,7 +14407,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
14015
14407
|
init_lowerAwaitSlotSyntax();
|
|
14016
14408
|
init_renderToReadableStream();
|
|
14017
14409
|
devClientDir2 = resolveDevClientDir2();
|
|
14018
|
-
hmrClientPath3 =
|
|
14410
|
+
hmrClientPath3 = join30(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
14019
14411
|
persistentCache = new Map;
|
|
14020
14412
|
sourceHashCache = new Map;
|
|
14021
14413
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -14082,7 +14474,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
14082
14474
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
14083
14475
|
buildLineRemap: () => buildLineRemap
|
|
14084
14476
|
});
|
|
14085
|
-
import { readFileSync as
|
|
14477
|
+
import { readFileSync as readFileSync18, writeFileSync as writeFileSync7 } from "fs";
|
|
14086
14478
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
14087
14479
|
let result = 0;
|
|
14088
14480
|
let shift = 0;
|
|
@@ -14373,7 +14765,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14373
14765
|
version: 3
|
|
14374
14766
|
};
|
|
14375
14767
|
}, chainBundleInlineSourcemap = (bundleFilePath) => {
|
|
14376
|
-
const text =
|
|
14768
|
+
const text = readFileSync18(bundleFilePath, "utf-8");
|
|
14377
14769
|
const outerMap = extractInlineMap(text);
|
|
14378
14770
|
if (!outerMap)
|
|
14379
14771
|
return;
|
|
@@ -14393,7 +14785,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
14393
14785
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
14394
14786
|
let outerMap;
|
|
14395
14787
|
try {
|
|
14396
|
-
outerMap = JSON.parse(
|
|
14788
|
+
outerMap = JSON.parse(readFileSync18(mapFilePath, "utf-8"));
|
|
14397
14789
|
} catch {
|
|
14398
14790
|
return;
|
|
14399
14791
|
}
|
|
@@ -14492,27 +14884,27 @@ __export(exports_compileVue, {
|
|
|
14492
14884
|
compileVue: () => compileVue,
|
|
14493
14885
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
14494
14886
|
});
|
|
14495
|
-
import { existsSync as existsSync22, readFileSync as
|
|
14887
|
+
import { existsSync as existsSync22, readFileSync as readFileSync19, realpathSync as realpathSync2 } from "fs";
|
|
14496
14888
|
import { mkdir as mkdir7 } from "fs/promises";
|
|
14497
14889
|
import {
|
|
14498
14890
|
basename as basename11,
|
|
14499
|
-
dirname as
|
|
14891
|
+
dirname as dirname17,
|
|
14500
14892
|
isAbsolute as isAbsolute4,
|
|
14501
|
-
join as
|
|
14893
|
+
join as join31,
|
|
14502
14894
|
relative as relative12,
|
|
14503
|
-
resolve as
|
|
14895
|
+
resolve as resolve22
|
|
14504
14896
|
} from "path";
|
|
14505
14897
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
14506
14898
|
var resolveDevClientDir3 = () => {
|
|
14507
14899
|
const projectRoot = process.cwd();
|
|
14508
|
-
const fromSource =
|
|
14900
|
+
const fromSource = resolve22(import.meta.dir, "../dev/client");
|
|
14509
14901
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14510
14902
|
return fromSource;
|
|
14511
14903
|
}
|
|
14512
|
-
const fromNodeModules =
|
|
14904
|
+
const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14513
14905
|
if (existsSync22(fromNodeModules))
|
|
14514
14906
|
return fromNodeModules;
|
|
14515
|
-
return
|
|
14907
|
+
return resolve22(import.meta.dir, "./dev/client");
|
|
14516
14908
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
14517
14909
|
scriptCache.clear();
|
|
14518
14910
|
scriptSetupCache.clear();
|
|
@@ -14562,19 +14954,19 @@ var resolveDevClientDir3 = () => {
|
|
|
14562
14954
|
visited.add(resolved);
|
|
14563
14955
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
14564
14956
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
14565
|
-
const importedPath =
|
|
14957
|
+
const importedPath = resolve22(dirname17(cssFilePath), relPath);
|
|
14566
14958
|
if (!existsSync22(importedPath))
|
|
14567
14959
|
return match;
|
|
14568
|
-
const importedContent =
|
|
14960
|
+
const importedContent = readFileSync19(importedPath, "utf-8");
|
|
14569
14961
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
14570
14962
|
});
|
|
14571
14963
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
14572
14964
|
if (helper.endsWith(".ts"))
|
|
14573
|
-
return
|
|
14574
|
-
const direct =
|
|
14965
|
+
return resolve22(sourceDir, helper);
|
|
14966
|
+
const direct = resolve22(sourceDir, `${helper}.ts`);
|
|
14575
14967
|
if (existsSync22(direct))
|
|
14576
14968
|
return direct;
|
|
14577
|
-
const indexed =
|
|
14969
|
+
const indexed = resolve22(sourceDir, helper, "index.ts");
|
|
14578
14970
|
if (existsSync22(indexed))
|
|
14579
14971
|
return indexed;
|
|
14580
14972
|
return direct;
|
|
@@ -14585,15 +14977,15 @@ var resolveDevClientDir3 = () => {
|
|
|
14585
14977
|
return filePath.replace(/\.ts$/, ".js");
|
|
14586
14978
|
if (isStylePath(filePath)) {
|
|
14587
14979
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14588
|
-
return
|
|
14980
|
+
return resolve22(sourceDir, filePath);
|
|
14589
14981
|
}
|
|
14590
14982
|
return filePath;
|
|
14591
14983
|
}
|
|
14592
14984
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
14593
|
-
const directTs =
|
|
14985
|
+
const directTs = resolve22(sourceDir, `${filePath}.ts`);
|
|
14594
14986
|
if (existsSync22(directTs))
|
|
14595
14987
|
return `${filePath}.js`;
|
|
14596
|
-
const indexedTs =
|
|
14988
|
+
const indexedTs = resolve22(sourceDir, filePath, "index.ts");
|
|
14597
14989
|
if (existsSync22(indexedTs))
|
|
14598
14990
|
return `${filePath}/index.js`;
|
|
14599
14991
|
}
|
|
@@ -14684,19 +15076,19 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14684
15076
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
14685
15077
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
14686
15078
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
14687
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path :
|
|
15079
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve22(dirname17(sourceFilePath), path));
|
|
14688
15080
|
for (const stylePath of stylePathsImported) {
|
|
14689
15081
|
addStyleImporter(sourceFilePath, stylePath);
|
|
14690
15082
|
}
|
|
14691
15083
|
const childBuildResults = await Promise.all([
|
|
14692
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
15084
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
14693
15085
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
14694
15086
|
]);
|
|
14695
15087
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
14696
15088
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
14697
15089
|
fs: {
|
|
14698
15090
|
fileExists: existsSync22,
|
|
14699
|
-
readFile: (file3) => existsSync22(file3) ?
|
|
15091
|
+
readFile: (file3) => existsSync22(file3) ? readFileSync19(file3, "utf-8") : undefined,
|
|
14700
15092
|
realpath: realpathSync2
|
|
14701
15093
|
},
|
|
14702
15094
|
id: componentId,
|
|
@@ -14704,7 +15096,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14704
15096
|
sourceMap: true
|
|
14705
15097
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
14706
15098
|
const strippedScript = stripExports2(compiledScript.content);
|
|
14707
|
-
const sourceDir =
|
|
15099
|
+
const sourceDir = dirname17(sourceFilePath);
|
|
14708
15100
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
14709
15101
|
const packageImportRewrites = new Map;
|
|
14710
15102
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -14749,8 +15141,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
14749
15141
|
];
|
|
14750
15142
|
let cssOutputPaths = [];
|
|
14751
15143
|
if (isEntryPoint && allCss.length) {
|
|
14752
|
-
const cssOutputFile =
|
|
14753
|
-
await mkdir7(
|
|
15144
|
+
const cssOutputFile = join31(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
15145
|
+
await mkdir7(dirname17(cssOutputFile), { recursive: true });
|
|
14754
15146
|
await write3(cssOutputFile, allCss.join(`
|
|
14755
15147
|
`));
|
|
14756
15148
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -14780,21 +15172,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14780
15172
|
};
|
|
14781
15173
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
14782
15174
|
const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
|
|
14783
|
-
const clientOutputPath =
|
|
14784
|
-
const serverOutputPath =
|
|
15175
|
+
const clientOutputPath = join31(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
15176
|
+
const serverOutputPath = join31(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
14785
15177
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
14786
15178
|
let result2 = code;
|
|
14787
15179
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
14788
15180
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
14789
|
-
let rel = relative12(
|
|
15181
|
+
let rel = relative12(dirname17(outputPath), targetPath).replace(/\\/g, "/");
|
|
14790
15182
|
if (!rel.startsWith("."))
|
|
14791
15183
|
rel = `./${rel}`;
|
|
14792
15184
|
result2 = result2.replaceAll(bareImport, rel);
|
|
14793
15185
|
}
|
|
14794
15186
|
return result2;
|
|
14795
15187
|
};
|
|
14796
|
-
await mkdir7(
|
|
14797
|
-
await mkdir7(
|
|
15188
|
+
await mkdir7(dirname17(clientOutputPath), { recursive: true });
|
|
15189
|
+
await mkdir7(dirname17(serverOutputPath), { recursive: true });
|
|
14798
15190
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
14799
15191
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
14800
15192
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -14817,7 +15209,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14817
15209
|
serverPath: serverOutputPath,
|
|
14818
15210
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
14819
15211
|
tsHelperPaths: [
|
|
14820
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
15212
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname17(sourceFilePath), helper)),
|
|
14821
15213
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
14822
15214
|
]
|
|
14823
15215
|
};
|
|
@@ -14827,10 +15219,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14827
15219
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
14828
15220
|
const compiler = await loadVueCompiler();
|
|
14829
15221
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
14830
|
-
const clientOutputDir =
|
|
14831
|
-
const indexOutputDir =
|
|
14832
|
-
const serverOutputDir =
|
|
14833
|
-
const cssOutputDir =
|
|
15222
|
+
const clientOutputDir = join31(generatedDir, "client");
|
|
15223
|
+
const indexOutputDir = join31(generatedDir, "indexes");
|
|
15224
|
+
const serverOutputDir = join31(generatedDir, "server");
|
|
15225
|
+
const cssOutputDir = join31(generatedDir, "compiled");
|
|
14834
15226
|
await Promise.all([
|
|
14835
15227
|
mkdir7(clientOutputDir, { recursive: true }),
|
|
14836
15228
|
mkdir7(indexOutputDir, { recursive: true }),
|
|
@@ -14840,7 +15232,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14840
15232
|
const buildCache = new Map;
|
|
14841
15233
|
const allTsHelperPaths = new Set;
|
|
14842
15234
|
const expandSpaRouteChildren = async (entries) => {
|
|
14843
|
-
const expanded = new Set(entries.map((entry) =>
|
|
15235
|
+
const expanded = new Set(entries.map((entry) => resolve22(entry)));
|
|
14844
15236
|
const queue2 = [...expanded];
|
|
14845
15237
|
while (queue2.length > 0) {
|
|
14846
15238
|
const entryPath = queue2.pop();
|
|
@@ -14857,7 +15249,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14857
15249
|
});
|
|
14858
15250
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
14859
15251
|
for (const { importPath } of routes) {
|
|
14860
|
-
const childPath =
|
|
15252
|
+
const childPath = resolve22(dirname17(entryPath), importPath);
|
|
14861
15253
|
if (expanded.has(childPath) || !existsSync22(childPath)) {
|
|
14862
15254
|
continue;
|
|
14863
15255
|
}
|
|
@@ -14869,7 +15261,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14869
15261
|
};
|
|
14870
15262
|
const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
|
|
14871
15263
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
14872
|
-
const resolvedEntryPath =
|
|
15264
|
+
const resolvedEntryPath = resolve22(entryPath);
|
|
14873
15265
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
14874
15266
|
client: clientOutputDir,
|
|
14875
15267
|
css: cssOutputDir,
|
|
@@ -14887,16 +15279,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
14887
15279
|
};
|
|
14888
15280
|
}
|
|
14889
15281
|
const entryBaseName = basename11(entryPath, ".vue");
|
|
14890
|
-
const indexOutputFile =
|
|
14891
|
-
const clientOutputFile =
|
|
14892
|
-
await mkdir7(
|
|
15282
|
+
const indexOutputFile = join31(indexOutputDir, `${entryBaseName}.js`);
|
|
15283
|
+
const clientOutputFile = join31(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
15284
|
+
await mkdir7(dirname17(indexOutputFile), { recursive: true });
|
|
14893
15285
|
const vueHmrImports = isDev2 ? [
|
|
14894
15286
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
14895
15287
|
`import "${hmrClientPath4}";`
|
|
14896
15288
|
] : [];
|
|
14897
15289
|
await write3(indexOutputFile, [
|
|
14898
15290
|
...vueHmrImports,
|
|
14899
|
-
`import Comp, * as PageModule from "${relative12(
|
|
15291
|
+
`import Comp, * as PageModule from "${relative12(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
14900
15292
|
'import { createSSRApp, createApp } from "vue";',
|
|
14901
15293
|
"",
|
|
14902
15294
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -15058,7 +15450,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15058
15450
|
if (!tsPath)
|
|
15059
15451
|
continue;
|
|
15060
15452
|
const sourceCode = await file2(tsPath).text();
|
|
15061
|
-
const helperDir =
|
|
15453
|
+
const helperDir = dirname17(tsPath);
|
|
15062
15454
|
for (const dep of extractImports(sourceCode)) {
|
|
15063
15455
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
15064
15456
|
continue;
|
|
@@ -15077,10 +15469,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15077
15469
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
15078
15470
|
const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
|
|
15079
15471
|
const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
15080
|
-
const outClientPath =
|
|
15081
|
-
const outServerPath =
|
|
15082
|
-
await mkdir7(
|
|
15083
|
-
await mkdir7(
|
|
15472
|
+
const outClientPath = join31(clientOutputDir, relativeJsPath);
|
|
15473
|
+
const outServerPath = join31(serverOutputDir, relativeJsPath);
|
|
15474
|
+
await mkdir7(dirname17(outClientPath), { recursive: true });
|
|
15475
|
+
await mkdir7(dirname17(outServerPath), { recursive: true });
|
|
15084
15476
|
await write3(outClientPath, withMap);
|
|
15085
15477
|
await write3(outServerPath, withMap);
|
|
15086
15478
|
}));
|
|
@@ -15110,7 +15502,7 @@ var init_compileVue = __esm(() => {
|
|
|
15110
15502
|
init_vueAutoRouterTransform();
|
|
15111
15503
|
init_stylePreprocessor();
|
|
15112
15504
|
devClientDir3 = resolveDevClientDir3();
|
|
15113
|
-
hmrClientPath4 =
|
|
15505
|
+
hmrClientPath4 = join31(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
15114
15506
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
15115
15507
|
scriptCache = new Map;
|
|
15116
15508
|
scriptSetupCache = new Map;
|
|
@@ -15591,8 +15983,8 @@ __export(exports_compileAngular, {
|
|
|
15591
15983
|
compileAngularFile: () => compileAngularFile,
|
|
15592
15984
|
compileAngular: () => compileAngular
|
|
15593
15985
|
});
|
|
15594
|
-
import { existsSync as existsSync23, readFileSync as
|
|
15595
|
-
import { join as
|
|
15986
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20, promises as fs5 } from "fs";
|
|
15987
|
+
import { join as join32, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve23, relative as relative13 } from "path";
|
|
15596
15988
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
15597
15989
|
import ts13 from "typescript";
|
|
15598
15990
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -15600,10 +15992,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15600
15992
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
15601
15993
|
}, readTsconfigPathAliases = () => {
|
|
15602
15994
|
try {
|
|
15603
|
-
const configPath2 =
|
|
15995
|
+
const configPath2 = resolve23(process.cwd(), "tsconfig.json");
|
|
15604
15996
|
const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
|
|
15605
15997
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
15606
|
-
const baseUrl =
|
|
15998
|
+
const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
15607
15999
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
15608
16000
|
return { aliases, baseUrl };
|
|
15609
16001
|
} catch {
|
|
@@ -15623,7 +16015,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15623
16015
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
15624
16016
|
for (const replacement of alias.replacements) {
|
|
15625
16017
|
const candidate = replacement.replace("*", wildcardValue);
|
|
15626
|
-
const resolved = resolveSourceFile(
|
|
16018
|
+
const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
|
|
15627
16019
|
if (resolved)
|
|
15628
16020
|
return resolved;
|
|
15629
16021
|
}
|
|
@@ -15635,20 +16027,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15635
16027
|
`${candidate}.tsx`,
|
|
15636
16028
|
`${candidate}.js`,
|
|
15637
16029
|
`${candidate}.jsx`,
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
16030
|
+
join32(candidate, "index.ts"),
|
|
16031
|
+
join32(candidate, "index.tsx"),
|
|
16032
|
+
join32(candidate, "index.js"),
|
|
16033
|
+
join32(candidate, "index.jsx")
|
|
15642
16034
|
];
|
|
15643
16035
|
return candidates.find((file3) => existsSync23(file3));
|
|
15644
16036
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
15645
|
-
const baseDir =
|
|
16037
|
+
const baseDir = resolve23(rootDir);
|
|
15646
16038
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
15647
16039
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
15648
16040
|
const scanCache = new Map;
|
|
15649
16041
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15650
16042
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15651
|
-
return resolveSourceFile(
|
|
16043
|
+
return resolveSourceFile(resolve23(fromDir, specifier));
|
|
15652
16044
|
}
|
|
15653
16045
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
15654
16046
|
if (aliased)
|
|
@@ -15657,7 +16049,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15657
16049
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15658
16050
|
if (resolved.includes("/node_modules/"))
|
|
15659
16051
|
return;
|
|
15660
|
-
const absolute =
|
|
16052
|
+
const absolute = resolve23(resolved);
|
|
15661
16053
|
if (!absolute.startsWith(baseDir))
|
|
15662
16054
|
return;
|
|
15663
16055
|
return resolveSourceFile(absolute);
|
|
@@ -15673,7 +16065,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15673
16065
|
usesLegacyAnimations: false
|
|
15674
16066
|
});
|
|
15675
16067
|
}
|
|
15676
|
-
const resolved =
|
|
16068
|
+
const resolved = resolve23(actualPath);
|
|
15677
16069
|
const cached = scanCache.get(resolved);
|
|
15678
16070
|
if (cached)
|
|
15679
16071
|
return cached;
|
|
@@ -15702,7 +16094,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15702
16094
|
const actualPath = resolveSourceFile(filePath);
|
|
15703
16095
|
if (!actualPath)
|
|
15704
16096
|
return false;
|
|
15705
|
-
const resolved =
|
|
16097
|
+
const resolved = resolve23(actualPath);
|
|
15706
16098
|
if (visited.has(resolved))
|
|
15707
16099
|
return false;
|
|
15708
16100
|
visited.add(resolved);
|
|
@@ -15710,7 +16102,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15710
16102
|
if (scan.usesLegacyAnimations)
|
|
15711
16103
|
return true;
|
|
15712
16104
|
for (const specifier of scan.imports) {
|
|
15713
|
-
const importedPath = resolveLocalImport(specifier,
|
|
16105
|
+
const importedPath = resolveLocalImport(specifier, dirname18(resolved));
|
|
15714
16106
|
if (importedPath && await visit(importedPath, visited)) {
|
|
15715
16107
|
return true;
|
|
15716
16108
|
}
|
|
@@ -15720,14 +16112,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15720
16112
|
return (entryPath) => visit(entryPath);
|
|
15721
16113
|
}, resolveDevClientDir4 = () => {
|
|
15722
16114
|
const projectRoot = process.cwd();
|
|
15723
|
-
const fromSource =
|
|
16115
|
+
const fromSource = resolve23(import.meta.dir, "../dev/client");
|
|
15724
16116
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15725
16117
|
return fromSource;
|
|
15726
16118
|
}
|
|
15727
|
-
const fromNodeModules =
|
|
16119
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15728
16120
|
if (existsSync23(fromNodeModules))
|
|
15729
16121
|
return fromNodeModules;
|
|
15730
|
-
return
|
|
16122
|
+
return resolve23(import.meta.dir, "./dev/client");
|
|
15731
16123
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
15732
16124
|
try {
|
|
15733
16125
|
return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -15769,12 +16161,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15769
16161
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
15770
16162
|
if (hasJsLikeExtension(path))
|
|
15771
16163
|
return `${path}${query}`;
|
|
15772
|
-
const importerDir =
|
|
15773
|
-
const fileCandidate =
|
|
16164
|
+
const importerDir = dirname18(importerOutputPath);
|
|
16165
|
+
const fileCandidate = resolve23(importerDir, `${path}.js`);
|
|
15774
16166
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
15775
16167
|
return `${path}.js${query}`;
|
|
15776
16168
|
}
|
|
15777
|
-
const indexCandidate =
|
|
16169
|
+
const indexCandidate = resolve23(importerDir, path, "index.js");
|
|
15778
16170
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
15779
16171
|
return `${path}/index.js${query}`;
|
|
15780
16172
|
}
|
|
@@ -15802,18 +16194,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15802
16194
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
15803
16195
|
if (!isRelativeModuleSpecifier(specifier))
|
|
15804
16196
|
return null;
|
|
15805
|
-
const basePath =
|
|
16197
|
+
const basePath = resolve23(dirname18(fromFile), specifier);
|
|
15806
16198
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
15807
16199
|
`${basePath}.ts`,
|
|
15808
16200
|
`${basePath}.tsx`,
|
|
15809
16201
|
`${basePath}.mts`,
|
|
15810
16202
|
`${basePath}.cts`,
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
|
|
15814
|
-
|
|
16203
|
+
join32(basePath, "index.ts"),
|
|
16204
|
+
join32(basePath, "index.tsx"),
|
|
16205
|
+
join32(basePath, "index.mts"),
|
|
16206
|
+
join32(basePath, "index.cts")
|
|
15815
16207
|
];
|
|
15816
|
-
return candidates.map((candidate) =>
|
|
16208
|
+
return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
15817
16209
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
15818
16210
|
const hostSource = readFile6?.(fileName);
|
|
15819
16211
|
if (typeof hostSource === "string")
|
|
@@ -15837,18 +16229,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15837
16229
|
const paths = [];
|
|
15838
16230
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15839
16231
|
if (templateUrlMatch?.[1])
|
|
15840
|
-
paths.push(
|
|
16232
|
+
paths.push(join32(fileDir, templateUrlMatch[1]));
|
|
15841
16233
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15842
16234
|
if (styleUrlMatch?.[1])
|
|
15843
|
-
paths.push(
|
|
16235
|
+
paths.push(join32(fileDir, styleUrlMatch[1]));
|
|
15844
16236
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
15845
16237
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
15846
16238
|
if (urlMatches) {
|
|
15847
16239
|
for (const urlMatch of urlMatches) {
|
|
15848
|
-
paths.push(
|
|
16240
|
+
paths.push(join32(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
15849
16241
|
}
|
|
15850
16242
|
}
|
|
15851
|
-
return paths.map((path) =>
|
|
16243
|
+
return paths.map((path) => resolve23(path));
|
|
15852
16244
|
}, readResourceCacheFile = async (cachePath) => {
|
|
15853
16245
|
try {
|
|
15854
16246
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -15860,13 +16252,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15860
16252
|
return null;
|
|
15861
16253
|
}
|
|
15862
16254
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
15863
|
-
await fs5.mkdir(
|
|
16255
|
+
await fs5.mkdir(dirname18(cachePath), { recursive: true });
|
|
15864
16256
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
15865
16257
|
source,
|
|
15866
16258
|
version: 1
|
|
15867
16259
|
}), "utf-8");
|
|
15868
16260
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
15869
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
16261
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname18(filePath));
|
|
15870
16262
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
15871
16263
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
15872
16264
|
return `${resourcePath}\x00${content}`;
|
|
@@ -15879,7 +16271,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15879
16271
|
safeStableStringify(stylePreprocessors ?? null)
|
|
15880
16272
|
].join("\x00");
|
|
15881
16273
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
15882
|
-
return
|
|
16274
|
+
return join32(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
15883
16275
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
15884
16276
|
const transformedSources = new Map;
|
|
15885
16277
|
const visited = new Set;
|
|
@@ -15890,7 +16282,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15890
16282
|
transformedFiles: 0
|
|
15891
16283
|
};
|
|
15892
16284
|
const transformFile = async (filePath) => {
|
|
15893
|
-
const resolvedPath =
|
|
16285
|
+
const resolvedPath = resolve23(filePath);
|
|
15894
16286
|
if (visited.has(resolvedPath))
|
|
15895
16287
|
return;
|
|
15896
16288
|
visited.add(resolvedPath);
|
|
@@ -15906,7 +16298,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15906
16298
|
transformedSource = cached.source;
|
|
15907
16299
|
} else {
|
|
15908
16300
|
stats.cacheMisses += 1;
|
|
15909
|
-
const transformed = await inlineResources(source,
|
|
16301
|
+
const transformed = await inlineResources(source, dirname18(resolvedPath), stylePreprocessors);
|
|
15910
16302
|
transformedSource = transformed.source;
|
|
15911
16303
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
15912
16304
|
}
|
|
@@ -15925,18 +16317,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15925
16317
|
return { stats, transformedSources };
|
|
15926
16318
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
15927
16319
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
15928
|
-
const outputPath =
|
|
16320
|
+
const outputPath = resolve23(join32(outDir, relative13(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
15929
16321
|
return [
|
|
15930
16322
|
outputPath,
|
|
15931
|
-
buildIslandMetadataExports(
|
|
16323
|
+
buildIslandMetadataExports(readFileSync20(inputPath, "utf-8"))
|
|
15932
16324
|
];
|
|
15933
16325
|
})), { entries: inputPaths.length });
|
|
15934
16326
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
15935
16327
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
15936
16328
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
15937
16329
|
const tsPath = __require.resolve("typescript");
|
|
15938
|
-
const tsRootDir =
|
|
15939
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
16330
|
+
const tsRootDir = dirname18(tsPath);
|
|
16331
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
|
|
15940
16332
|
});
|
|
15941
16333
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
15942
16334
|
const options = {
|
|
@@ -15961,30 +16353,30 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15961
16353
|
options.incremental = false;
|
|
15962
16354
|
options.tsBuildInfoFile = undefined;
|
|
15963
16355
|
options.rootDir = process.cwd();
|
|
15964
|
-
const
|
|
15965
|
-
const originalGetDefaultLibLocation =
|
|
15966
|
-
|
|
15967
|
-
const originalGetDefaultLibFileName =
|
|
15968
|
-
|
|
16356
|
+
const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
|
|
16357
|
+
const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
|
|
16358
|
+
host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
16359
|
+
const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
|
|
16360
|
+
host2.getDefaultLibFileName = (opts) => {
|
|
15969
16361
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
15970
16362
|
return basename12(fileName);
|
|
15971
16363
|
};
|
|
15972
|
-
const originalGetSourceFile =
|
|
15973
|
-
|
|
16364
|
+
const originalGetSourceFile = host2.getSourceFile;
|
|
16365
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
15974
16366
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
15975
|
-
const resolvedPath =
|
|
15976
|
-
return originalGetSourceFile?.call(
|
|
16367
|
+
const resolvedPath = join32(tsLibDir, fileName);
|
|
16368
|
+
return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
|
|
15977
16369
|
}
|
|
15978
|
-
return originalGetSourceFile?.call(
|
|
16370
|
+
return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
|
|
15979
16371
|
};
|
|
15980
16372
|
const emitted = {};
|
|
15981
|
-
const resolvedOutDir =
|
|
15982
|
-
|
|
16373
|
+
const resolvedOutDir = resolve23(outDir);
|
|
16374
|
+
host2.writeFile = (fileName, text) => {
|
|
15983
16375
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
15984
16376
|
emitted[relativePath] = text;
|
|
15985
16377
|
};
|
|
15986
|
-
const originalReadFile =
|
|
15987
|
-
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(
|
|
16378
|
+
const originalReadFile = host2.readFile;
|
|
16379
|
+
const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
|
|
15988
16380
|
await traceAngularPhase("aot/resource-cache-summary", () => {
|
|
15989
16381
|
return;
|
|
15990
16382
|
}, {
|
|
@@ -15993,43 +16385,43 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
15993
16385
|
filesVisited: aotResourceTransformStats.filesVisited,
|
|
15994
16386
|
transformedFiles: aotResourceTransformStats.transformedFiles
|
|
15995
16387
|
});
|
|
15996
|
-
|
|
15997
|
-
const source = originalReadFile ? originalReadFile.call(
|
|
16388
|
+
host2.readFile = (fileName) => {
|
|
16389
|
+
const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
|
|
15998
16390
|
if (typeof source !== "string")
|
|
15999
16391
|
return source;
|
|
16000
16392
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
16001
16393
|
return source;
|
|
16002
16394
|
}
|
|
16003
|
-
const resolvedPath =
|
|
16395
|
+
const resolvedPath = resolve23(fileName);
|
|
16004
16396
|
return transformedSources.get(resolvedPath) ?? source;
|
|
16005
16397
|
};
|
|
16006
|
-
const originalGetSourceFileForCompile =
|
|
16007
|
-
|
|
16008
|
-
const source = transformedSources.get(
|
|
16398
|
+
const originalGetSourceFileForCompile = host2.getSourceFile;
|
|
16399
|
+
host2.getSourceFile = (fileName, languageVersion, onError) => {
|
|
16400
|
+
const source = transformedSources.get(resolve23(fileName));
|
|
16009
16401
|
if (source) {
|
|
16010
16402
|
return ts13.createSourceFile(fileName, source, languageVersion, true);
|
|
16011
16403
|
}
|
|
16012
|
-
return originalGetSourceFileForCompile?.call(
|
|
16404
|
+
return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
|
|
16013
16405
|
};
|
|
16014
16406
|
let diagnostics;
|
|
16015
16407
|
try {
|
|
16016
16408
|
({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
|
|
16017
16409
|
emitFlags: EmitFlags.Default,
|
|
16018
|
-
host,
|
|
16410
|
+
host: host2,
|
|
16019
16411
|
options,
|
|
16020
16412
|
rootNames: inputPaths
|
|
16021
16413
|
}), { entries: inputPaths.length }));
|
|
16022
16414
|
} finally {
|
|
16023
|
-
|
|
16024
|
-
|
|
16415
|
+
host2.readFile = originalReadFile;
|
|
16416
|
+
host2.getSourceFile = originalGetSourceFileForCompile;
|
|
16025
16417
|
}
|
|
16026
16418
|
await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
|
|
16027
16419
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
16028
16420
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
16029
16421
|
content,
|
|
16030
|
-
target:
|
|
16422
|
+
target: join32(outDir, fileName)
|
|
16031
16423
|
}));
|
|
16032
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
16424
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
|
|
16033
16425
|
return rawEntries.map(({ content, target }) => {
|
|
16034
16426
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
16035
16427
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -16044,17 +16436,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
16044
16436
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
16045
16437
|
});
|
|
16046
16438
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
16047
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
16439
|
+
processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
|
|
16048
16440
|
return { content: processedContent, target };
|
|
16049
16441
|
});
|
|
16050
16442
|
});
|
|
16051
16443
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
16052
|
-
await fs5.mkdir(
|
|
16444
|
+
await fs5.mkdir(dirname18(target), { recursive: true });
|
|
16053
16445
|
await fs5.writeFile(target, content, "utf-8");
|
|
16054
16446
|
})), { outputs: entries.length });
|
|
16055
16447
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
16056
16448
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
16057
|
-
jitContentCache.delete(
|
|
16449
|
+
jitContentCache.delete(resolve23(filePath));
|
|
16058
16450
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
16059
16451
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
16060
16452
|
let match;
|
|
@@ -16067,7 +16459,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
16067
16459
|
}
|
|
16068
16460
|
return null;
|
|
16069
16461
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
16070
|
-
const sourceEntry =
|
|
16462
|
+
const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
|
|
16071
16463
|
if (existsSync23(sourceEntry)) {
|
|
16072
16464
|
return sourceEntry.replace(/\\/g, "/");
|
|
16073
16465
|
}
|
|
@@ -16204,7 +16596,7 @@ ${fields}
|
|
|
16204
16596
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
16205
16597
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16206
16598
|
if (templateUrlMatch?.[1]) {
|
|
16207
|
-
const templatePath =
|
|
16599
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16208
16600
|
if (!existsSync23(templatePath)) {
|
|
16209
16601
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16210
16602
|
}
|
|
@@ -16235,11 +16627,11 @@ ${fields}
|
|
|
16235
16627
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
16236
16628
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16237
16629
|
if (templateUrlMatch?.[1]) {
|
|
16238
|
-
const templatePath =
|
|
16630
|
+
const templatePath = join32(fileDir, templateUrlMatch[1]);
|
|
16239
16631
|
if (!existsSync23(templatePath)) {
|
|
16240
16632
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
16241
16633
|
}
|
|
16242
|
-
const templateRaw2 =
|
|
16634
|
+
const templateRaw2 = readFileSync20(templatePath, "utf-8");
|
|
16243
16635
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
16244
16636
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
16245
16637
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -16272,7 +16664,7 @@ ${fields}
|
|
|
16272
16664
|
return source;
|
|
16273
16665
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
16274
16666
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
16275
|
-
return readAndEscapeFile(
|
|
16667
|
+
return readAndEscapeFile(join32(fileDir, styleUrl), stylePreprocessors);
|
|
16276
16668
|
});
|
|
16277
16669
|
const results = await Promise.all(stylePromises);
|
|
16278
16670
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -16283,7 +16675,7 @@ ${fields}
|
|
|
16283
16675
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
16284
16676
|
if (!styleUrlMatch?.[1])
|
|
16285
16677
|
return source;
|
|
16286
|
-
const escaped = await readAndEscapeFile(
|
|
16678
|
+
const escaped = await readAndEscapeFile(join32(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
16287
16679
|
if (!escaped)
|
|
16288
16680
|
return source;
|
|
16289
16681
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -16357,10 +16749,10 @@ ${fields}
|
|
|
16357
16749
|
return "";
|
|
16358
16750
|
}
|
|
16359
16751
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
16360
|
-
const entryPath =
|
|
16752
|
+
const entryPath = resolve23(inputPath);
|
|
16361
16753
|
const allOutputs = [];
|
|
16362
16754
|
const visited = new Set;
|
|
16363
|
-
const baseDir =
|
|
16755
|
+
const baseDir = resolve23(rootDir ?? process.cwd());
|
|
16364
16756
|
let usesLegacyAnimations = false;
|
|
16365
16757
|
const angularTranspiler = new Bun.Transpiler({
|
|
16366
16758
|
loader: "ts",
|
|
@@ -16379,16 +16771,16 @@ ${fields}
|
|
|
16379
16771
|
`${candidate}.js`,
|
|
16380
16772
|
`${candidate}.jsx`,
|
|
16381
16773
|
`${candidate}.json`,
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
|
|
16774
|
+
join32(candidate, "index.ts"),
|
|
16775
|
+
join32(candidate, "index.tsx"),
|
|
16776
|
+
join32(candidate, "index.js"),
|
|
16777
|
+
join32(candidate, "index.jsx")
|
|
16386
16778
|
];
|
|
16387
16779
|
return candidates.find((file3) => existsSync23(file3));
|
|
16388
16780
|
};
|
|
16389
16781
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
16390
16782
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
16391
|
-
return resolveSourceFile2(
|
|
16783
|
+
return resolveSourceFile2(resolve23(fromDir, specifier));
|
|
16392
16784
|
}
|
|
16393
16785
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
16394
16786
|
if (aliased)
|
|
@@ -16397,7 +16789,7 @@ ${fields}
|
|
|
16397
16789
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
16398
16790
|
if (resolved.includes("/node_modules/"))
|
|
16399
16791
|
return;
|
|
16400
|
-
const absolute =
|
|
16792
|
+
const absolute = resolve23(resolved);
|
|
16401
16793
|
if (!absolute.startsWith(baseDir))
|
|
16402
16794
|
return;
|
|
16403
16795
|
return resolveSourceFile2(absolute);
|
|
@@ -16406,13 +16798,13 @@ ${fields}
|
|
|
16406
16798
|
}
|
|
16407
16799
|
};
|
|
16408
16800
|
const toOutputPath = (sourcePath) => {
|
|
16409
|
-
const inputDir =
|
|
16801
|
+
const inputDir = dirname18(sourcePath);
|
|
16410
16802
|
const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16411
16803
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
16412
|
-
return
|
|
16804
|
+
return join32(inputDir, fileBase);
|
|
16413
16805
|
}
|
|
16414
16806
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
16415
|
-
return
|
|
16807
|
+
return join32(outDir, relativeDir, fileBase);
|
|
16416
16808
|
};
|
|
16417
16809
|
const withCacheBuster = (specifier) => {
|
|
16418
16810
|
if (!cacheBuster)
|
|
@@ -16449,21 +16841,21 @@ ${fields}
|
|
|
16449
16841
|
return `${prefix}${dots}`;
|
|
16450
16842
|
return `${prefix}../${dots}`;
|
|
16451
16843
|
});
|
|
16452
|
-
if (
|
|
16844
|
+
if (resolve23(actualPath) === entryPath) {
|
|
16453
16845
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
16454
16846
|
}
|
|
16455
16847
|
return processedContent;
|
|
16456
16848
|
};
|
|
16457
16849
|
const transpileFile = async (filePath) => {
|
|
16458
|
-
const resolved =
|
|
16850
|
+
const resolved = resolve23(filePath);
|
|
16459
16851
|
if (visited.has(resolved))
|
|
16460
16852
|
return;
|
|
16461
16853
|
visited.add(resolved);
|
|
16462
16854
|
if (resolved.endsWith(".json") && existsSync23(resolved)) {
|
|
16463
|
-
const inputDir2 =
|
|
16855
|
+
const inputDir2 = dirname18(resolved);
|
|
16464
16856
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
16465
|
-
const targetDir2 =
|
|
16466
|
-
const targetPath2 =
|
|
16857
|
+
const targetDir2 = join32(outDir, relativeDir2);
|
|
16858
|
+
const targetPath2 = join32(targetDir2, basename12(resolved));
|
|
16467
16859
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
16468
16860
|
await fs5.copyFile(resolved, targetPath2);
|
|
16469
16861
|
allOutputs.push(targetPath2);
|
|
@@ -16475,12 +16867,12 @@ ${fields}
|
|
|
16475
16867
|
if (!existsSync23(actualPath))
|
|
16476
16868
|
return;
|
|
16477
16869
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
16478
|
-
const inlined = await inlineResources(sourceCode,
|
|
16479
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
16480
|
-
const inputDir =
|
|
16870
|
+
const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
|
|
16871
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname18(actualPath)).source;
|
|
16872
|
+
const inputDir = dirname18(actualPath);
|
|
16481
16873
|
const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16482
16874
|
const targetPath = toOutputPath(actualPath);
|
|
16483
|
-
const targetDir =
|
|
16875
|
+
const targetDir = dirname18(targetPath);
|
|
16484
16876
|
const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
|
|
16485
16877
|
const localImports = [];
|
|
16486
16878
|
const importRewrites = new Map;
|
|
@@ -16507,7 +16899,7 @@ ${fields}
|
|
|
16507
16899
|
importRewrites.set(specifier, relativeRewrite);
|
|
16508
16900
|
return resolved2;
|
|
16509
16901
|
}).filter((path) => Boolean(path));
|
|
16510
|
-
const isEntry =
|
|
16902
|
+
const isEntry = resolve23(actualPath) === resolve23(entryPath);
|
|
16511
16903
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
16512
16904
|
const cacheKey2 = actualPath;
|
|
16513
16905
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -16542,13 +16934,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16542
16934
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
16543
16935
|
}
|
|
16544
16936
|
const compiledRoot = compiledParent;
|
|
16545
|
-
const indexesDir =
|
|
16937
|
+
const indexesDir = join32(compiledParent, "indexes");
|
|
16546
16938
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
16547
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
16939
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
16548
16940
|
if (!hmr) {
|
|
16549
16941
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
16550
16942
|
const cwd = process.cwd();
|
|
16551
|
-
const angularSrcDir =
|
|
16943
|
+
const angularSrcDir = resolve23(outRoot);
|
|
16552
16944
|
if (!existsSync23(angularSrcDir))
|
|
16553
16945
|
return;
|
|
16554
16946
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -16556,17 +16948,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16556
16948
|
absolute: false,
|
|
16557
16949
|
cwd: angularSrcDir
|
|
16558
16950
|
})) {
|
|
16559
|
-
const sourcePath =
|
|
16951
|
+
const sourcePath = join32(angularSrcDir, rel);
|
|
16560
16952
|
const cwdRel = relative13(cwd, sourcePath);
|
|
16561
|
-
const targetPath =
|
|
16562
|
-
await fs5.mkdir(
|
|
16953
|
+
const targetPath = join32(compiledRoot, cwdRel);
|
|
16954
|
+
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
16563
16955
|
await fs5.copyFile(sourcePath, targetPath);
|
|
16564
16956
|
}
|
|
16565
16957
|
});
|
|
16566
16958
|
}
|
|
16567
16959
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
16568
16960
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
16569
|
-
const resolvedEntry =
|
|
16961
|
+
const resolvedEntry = resolve23(entry);
|
|
16570
16962
|
const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
16571
16963
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
16572
16964
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -16575,13 +16967,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16575
16967
|
const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
16576
16968
|
const jsName = `${fileBase}.js`;
|
|
16577
16969
|
const compiledFallbackPaths = [
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
].map((file3) =>
|
|
16970
|
+
join32(compiledRoot, relativeEntry),
|
|
16971
|
+
join32(compiledRoot, "pages", jsName),
|
|
16972
|
+
join32(compiledRoot, jsName)
|
|
16973
|
+
].map((file3) => resolve23(file3));
|
|
16582
16974
|
const resolveRawServerFile = (candidatePaths) => {
|
|
16583
16975
|
const normalizedCandidates = [
|
|
16584
|
-
...candidatePaths.map((file3) =>
|
|
16976
|
+
...candidatePaths.map((file3) => resolve23(file3)),
|
|
16585
16977
|
...compiledFallbackPaths
|
|
16586
16978
|
];
|
|
16587
16979
|
let candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -16628,7 +17020,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16628
17020
|
let providersSourceContent = "";
|
|
16629
17021
|
if (providersInjection.appProvidersSource) {
|
|
16630
17022
|
try {
|
|
16631
|
-
providersSourceContent =
|
|
17023
|
+
providersSourceContent = readFileSync20(providersInjection.appProvidersSource, "utf-8");
|
|
16632
17024
|
} catch {}
|
|
16633
17025
|
}
|
|
16634
17026
|
return JSON.stringify({
|
|
@@ -16639,7 +17031,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16639
17031
|
})() : "no-providers";
|
|
16640
17032
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
16641
17033
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
16642
|
-
const clientFile =
|
|
17034
|
+
const clientFile = join32(indexesDir, jsName);
|
|
16643
17035
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
16644
17036
|
return {
|
|
16645
17037
|
clientPath: clientFile,
|
|
@@ -16671,13 +17063,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
16671
17063
|
const fragments = [];
|
|
16672
17064
|
if (providersInjection.appProvidersSource) {
|
|
16673
17065
|
const compiledAppProvidersPath = (() => {
|
|
16674
|
-
const angularDirAbs =
|
|
16675
|
-
const appSourceAbs =
|
|
17066
|
+
const angularDirAbs = resolve23(outRoot);
|
|
17067
|
+
const appSourceAbs = resolve23(providersInjection.appProvidersSource);
|
|
16676
17068
|
const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
16677
|
-
return
|
|
17069
|
+
return join32(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
16678
17070
|
})();
|
|
16679
17071
|
const appProvidersSpec = (() => {
|
|
16680
|
-
const rel = relative13(
|
|
17072
|
+
const rel = relative13(dirname18(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
16681
17073
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
16682
17074
|
})();
|
|
16683
17075
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -16929,7 +17321,7 @@ var init_compileAngular = __esm(() => {
|
|
|
16929
17321
|
init_stylePreprocessor();
|
|
16930
17322
|
init_generatedDir();
|
|
16931
17323
|
devClientDir4 = resolveDevClientDir4();
|
|
16932
|
-
hmrClientPath5 =
|
|
17324
|
+
hmrClientPath5 = join32(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
16933
17325
|
jitContentCache = new Map;
|
|
16934
17326
|
wrapperOutputCache = new Map;
|
|
16935
17327
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -17653,8 +18045,8 @@ __export(exports_fastHmrCompiler, {
|
|
|
17653
18045
|
primeComponentFingerprint: () => primeComponentFingerprint,
|
|
17654
18046
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
17655
18047
|
});
|
|
17656
|
-
import { existsSync as existsSync24, readFileSync as
|
|
17657
|
-
import { dirname as
|
|
18048
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21, statSync as statSync2 } from "fs";
|
|
18049
|
+
import { dirname as dirname19, extname as extname8, relative as relative14, resolve as resolve24 } from "path";
|
|
17658
18050
|
import ts17 from "typescript";
|
|
17659
18051
|
var fail = (reason, detail, location) => ({
|
|
17660
18052
|
detail,
|
|
@@ -17784,7 +18176,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17784
18176
|
continue;
|
|
17785
18177
|
const decoratorMeta = readDecoratorMeta(args);
|
|
17786
18178
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
17787
|
-
const componentDir =
|
|
18179
|
+
const componentDir = dirname19(componentFilePath);
|
|
17788
18180
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17789
18181
|
fingerprintCache.set(id, fingerprint);
|
|
17790
18182
|
} else {
|
|
@@ -17969,7 +18361,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17969
18361
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
17970
18362
|
return true;
|
|
17971
18363
|
}
|
|
17972
|
-
const base =
|
|
18364
|
+
const base = resolve24(componentDir, spec);
|
|
17973
18365
|
const candidates = [
|
|
17974
18366
|
`${base}.ts`,
|
|
17975
18367
|
`${base}.tsx`,
|
|
@@ -17981,7 +18373,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17981
18373
|
continue;
|
|
17982
18374
|
let content;
|
|
17983
18375
|
try {
|
|
17984
|
-
content =
|
|
18376
|
+
content = readFileSync21(candidate, "utf-8");
|
|
17985
18377
|
} catch {
|
|
17986
18378
|
continue;
|
|
17987
18379
|
}
|
|
@@ -18267,7 +18659,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18267
18659
|
listeners: {},
|
|
18268
18660
|
properties: {},
|
|
18269
18661
|
specialAttributes: {}
|
|
18270
|
-
}), parseHostObjectInto = (
|
|
18662
|
+
}), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
|
|
18271
18663
|
const hostNode = getProperty(args, "host");
|
|
18272
18664
|
if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
|
|
18273
18665
|
if (!hostExprNode)
|
|
@@ -18291,14 +18683,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18291
18683
|
const propMatch = ATTR_BINDING_RE.exec(key);
|
|
18292
18684
|
const evtMatch = EVENT_BINDING_RE.exec(key);
|
|
18293
18685
|
if (propMatch) {
|
|
18294
|
-
|
|
18686
|
+
host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18295
18687
|
} else if (evtMatch) {
|
|
18296
|
-
|
|
18688
|
+
host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
|
|
18297
18689
|
} else {
|
|
18298
|
-
|
|
18690
|
+
host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
|
|
18299
18691
|
}
|
|
18300
18692
|
}
|
|
18301
|
-
}, mergeMemberHostDecorators = (
|
|
18693
|
+
}, mergeMemberHostDecorators = (host2, cls) => {
|
|
18302
18694
|
for (const member of cls.members) {
|
|
18303
18695
|
if (!ts17.canHaveDecorators(member))
|
|
18304
18696
|
continue;
|
|
@@ -18318,7 +18710,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18318
18710
|
const propertyName2 = member.name.text;
|
|
18319
18711
|
const [target] = expr.arguments;
|
|
18320
18712
|
const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
|
|
18321
|
-
|
|
18713
|
+
host2.properties[key] = propertyName2;
|
|
18322
18714
|
} else if (functionNode.text === "HostListener") {
|
|
18323
18715
|
if (!ts17.isMethodDeclaration(member))
|
|
18324
18716
|
continue;
|
|
@@ -18336,7 +18728,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18336
18728
|
argsList.push(element.text);
|
|
18337
18729
|
}
|
|
18338
18730
|
}
|
|
18339
|
-
|
|
18731
|
+
host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
18340
18732
|
}
|
|
18341
18733
|
}
|
|
18342
18734
|
}
|
|
@@ -18527,9 +18919,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18527
18919
|
}
|
|
18528
18920
|
return out.length > 0 ? out : null;
|
|
18529
18921
|
}, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
|
|
18530
|
-
const
|
|
18531
|
-
parseHostObjectInto(
|
|
18532
|
-
mergeMemberHostDecorators(
|
|
18922
|
+
const host2 = emptyHost();
|
|
18923
|
+
parseHostObjectInto(host2, decoratorArgs, null, compiler);
|
|
18924
|
+
mergeMemberHostDecorators(host2, cls);
|
|
18533
18925
|
const decoratorQueries = extractDecoratorQueries(cls, compiler);
|
|
18534
18926
|
const signalQueries = extractSignalQueries(cls, compiler);
|
|
18535
18927
|
const contentQueries = [
|
|
@@ -18550,7 +18942,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18550
18942
|
animations,
|
|
18551
18943
|
contentQueries,
|
|
18552
18944
|
exportAs: extractExportAs(decoratorArgs),
|
|
18553
|
-
host,
|
|
18945
|
+
host: host2,
|
|
18554
18946
|
hostDirectives: extractHostDirectives(decoratorArgs, compiler),
|
|
18555
18947
|
providers,
|
|
18556
18948
|
viewProviders,
|
|
@@ -18569,7 +18961,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18569
18961
|
return cached.info;
|
|
18570
18962
|
let source;
|
|
18571
18963
|
try {
|
|
18572
|
-
source =
|
|
18964
|
+
source = readFileSync21(filePath, "utf-8");
|
|
18573
18965
|
} catch {
|
|
18574
18966
|
childComponentInfoCache.set(cacheKey2, {
|
|
18575
18967
|
info: null,
|
|
@@ -18623,7 +19015,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18623
19015
|
return cached.info;
|
|
18624
19016
|
let content;
|
|
18625
19017
|
try {
|
|
18626
|
-
content =
|
|
19018
|
+
content = readFileSync21(dtsPath, "utf-8");
|
|
18627
19019
|
} catch {
|
|
18628
19020
|
childComponentInfoCache.set(cacheKey2, {
|
|
18629
19021
|
info: null,
|
|
@@ -18746,7 +19138,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18746
19138
|
return null;
|
|
18747
19139
|
let content;
|
|
18748
19140
|
try {
|
|
18749
|
-
content =
|
|
19141
|
+
content = readFileSync21(startDtsPath, "utf-8");
|
|
18750
19142
|
} catch {
|
|
18751
19143
|
return null;
|
|
18752
19144
|
}
|
|
@@ -18765,7 +19157,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18765
19157
|
});
|
|
18766
19158
|
if (!names.includes(className))
|
|
18767
19159
|
continue;
|
|
18768
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19160
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18769
19161
|
if (!nextDts)
|
|
18770
19162
|
continue;
|
|
18771
19163
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18775,7 +19167,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18775
19167
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
18776
19168
|
while ((item = starReExportRe.exec(content)) !== null) {
|
|
18777
19169
|
const fromPath = item[1] || "";
|
|
18778
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
19170
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
18779
19171
|
if (!nextDts)
|
|
18780
19172
|
continue;
|
|
18781
19173
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18785,7 +19177,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18785
19177
|
return null;
|
|
18786
19178
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
18787
19179
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
18788
|
-
const base =
|
|
19180
|
+
const base = resolve24(fromDir, stripped);
|
|
18789
19181
|
const candidates = [
|
|
18790
19182
|
`${base}.d.ts`,
|
|
18791
19183
|
`${base}.d.mts`,
|
|
@@ -18809,7 +19201,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18809
19201
|
return null;
|
|
18810
19202
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
18811
19203
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
18812
|
-
const base =
|
|
19204
|
+
const base = resolve24(componentDir, spec);
|
|
18813
19205
|
const candidates = [
|
|
18814
19206
|
`${base}.ts`,
|
|
18815
19207
|
`${base}.tsx`,
|
|
@@ -18964,7 +19356,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18964
19356
|
return cached.hasProviders;
|
|
18965
19357
|
let source;
|
|
18966
19358
|
try {
|
|
18967
|
-
source =
|
|
19359
|
+
source = readFileSync21(filePath, "utf8");
|
|
18968
19360
|
} catch {
|
|
18969
19361
|
return true;
|
|
18970
19362
|
}
|
|
@@ -19028,13 +19420,13 @@ var fail = (reason, detail, location) => ({
|
|
|
19028
19420
|
}
|
|
19029
19421
|
if (!matches)
|
|
19030
19422
|
continue;
|
|
19031
|
-
const resolved =
|
|
19423
|
+
const resolved = resolve24(componentDir, spec);
|
|
19032
19424
|
for (const ext of TS_EXTENSIONS) {
|
|
19033
19425
|
const candidate = resolved + ext;
|
|
19034
19426
|
if (existsSync24(candidate))
|
|
19035
19427
|
return candidate;
|
|
19036
19428
|
}
|
|
19037
|
-
const indexCandidate =
|
|
19429
|
+
const indexCandidate = resolve24(resolved, "index.ts");
|
|
19038
19430
|
if (existsSync24(indexCandidate))
|
|
19039
19431
|
return indexCandidate;
|
|
19040
19432
|
}
|
|
@@ -19272,12 +19664,12 @@ ${transpiled}
|
|
|
19272
19664
|
}
|
|
19273
19665
|
}${staticPatch}`;
|
|
19274
19666
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19275
|
-
const abs =
|
|
19667
|
+
const abs = resolve24(componentDir, url);
|
|
19276
19668
|
if (!existsSync24(abs))
|
|
19277
19669
|
return null;
|
|
19278
19670
|
const ext = extname8(abs).toLowerCase();
|
|
19279
19671
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19280
|
-
return
|
|
19672
|
+
return readFileSync21(abs, "utf8");
|
|
19281
19673
|
}
|
|
19282
19674
|
try {
|
|
19283
19675
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19311,11 +19703,11 @@ ${block}
|
|
|
19311
19703
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19312
19704
|
if (cached !== undefined)
|
|
19313
19705
|
return cached;
|
|
19314
|
-
const tsconfigPath =
|
|
19706
|
+
const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
|
|
19315
19707
|
const opts = {};
|
|
19316
19708
|
if (existsSync24(tsconfigPath)) {
|
|
19317
19709
|
try {
|
|
19318
|
-
const text =
|
|
19710
|
+
const text = readFileSync21(tsconfigPath, "utf8");
|
|
19319
19711
|
const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19320
19712
|
if (!parsed.error && parsed.config) {
|
|
19321
19713
|
const cfg = parsed.config;
|
|
@@ -19349,7 +19741,7 @@ ${block}
|
|
|
19349
19741
|
} catch (err) {
|
|
19350
19742
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19351
19743
|
}
|
|
19352
|
-
const tsSource =
|
|
19744
|
+
const tsSource = readFileSync21(componentFilePath, "utf8");
|
|
19353
19745
|
const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
19354
19746
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19355
19747
|
if (!classNode) {
|
|
@@ -19376,7 +19768,7 @@ ${block}
|
|
|
19376
19768
|
rebootstrapRequired: false
|
|
19377
19769
|
};
|
|
19378
19770
|
}
|
|
19379
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
19771
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname19(componentFilePath), projectRoot)) {
|
|
19380
19772
|
return fail("inherits-decorated-class");
|
|
19381
19773
|
}
|
|
19382
19774
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -19388,18 +19780,18 @@ ${block}
|
|
|
19388
19780
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
19389
19781
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
19390
19782
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
19391
|
-
const componentDir =
|
|
19783
|
+
const componentDir = dirname19(componentFilePath);
|
|
19392
19784
|
let templateText;
|
|
19393
19785
|
let templatePath;
|
|
19394
19786
|
if (decoratorMeta.template !== null) {
|
|
19395
19787
|
templateText = decoratorMeta.template;
|
|
19396
19788
|
templatePath = componentFilePath;
|
|
19397
19789
|
} else if (decoratorMeta.templateUrl) {
|
|
19398
|
-
const tplAbs =
|
|
19790
|
+
const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
|
|
19399
19791
|
if (!existsSync24(tplAbs)) {
|
|
19400
19792
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19401
19793
|
}
|
|
19402
|
-
templateText =
|
|
19794
|
+
templateText = readFileSync21(tplAbs, "utf8");
|
|
19403
19795
|
templatePath = tplAbs;
|
|
19404
19796
|
} else {
|
|
19405
19797
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20158,7 +20550,7 @@ __export(exports_compileEmber, {
|
|
|
20158
20550
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
20159
20551
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
20160
20552
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
20161
|
-
dirname: () =>
|
|
20553
|
+
dirname: () => dirname20,
|
|
20162
20554
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
20163
20555
|
compileEmberFile: () => compileEmberFile,
|
|
20164
20556
|
compileEmber: () => compileEmber,
|
|
@@ -20167,7 +20559,7 @@ __export(exports_compileEmber, {
|
|
|
20167
20559
|
});
|
|
20168
20560
|
import { existsSync as existsSync25 } from "fs";
|
|
20169
20561
|
import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
|
|
20170
|
-
import { basename as basename13, dirname as
|
|
20562
|
+
import { basename as basename13, dirname as dirname20, extname as extname9, join as join33, resolve as resolve25 } from "path";
|
|
20171
20563
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
20172
20564
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
20173
20565
|
if (cachedPreprocessor)
|
|
@@ -20263,7 +20655,7 @@ export const importSync = (specifier) => {
|
|
|
20263
20655
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
20264
20656
|
if (!originalImporter)
|
|
20265
20657
|
return;
|
|
20266
|
-
const candidateBase =
|
|
20658
|
+
const candidateBase = resolve25(dirname20(originalImporter), args.path);
|
|
20267
20659
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
20268
20660
|
for (const ext of extensionsToTry) {
|
|
20269
20661
|
const candidate = candidateBase + ext;
|
|
@@ -20286,7 +20678,7 @@ export const importSync = (specifier) => {
|
|
|
20286
20678
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
20287
20679
|
if (standalonePackages.has(args.path))
|
|
20288
20680
|
return;
|
|
20289
|
-
const internal =
|
|
20681
|
+
const internal = join33(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
20290
20682
|
if (existsSync25(internal))
|
|
20291
20683
|
return { path: internal };
|
|
20292
20684
|
return;
|
|
@@ -20322,7 +20714,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
20322
20714
|
export { PageComponent };
|
|
20323
20715
|
export default PageComponent;
|
|
20324
20716
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
20325
|
-
const resolvedEntry =
|
|
20717
|
+
const resolvedEntry = resolve25(entry);
|
|
20326
20718
|
const source = await file3(resolvedEntry).text();
|
|
20327
20719
|
let preprocessed = source;
|
|
20328
20720
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20334,16 +20726,16 @@ export default PageComponent;
|
|
|
20334
20726
|
}
|
|
20335
20727
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
20336
20728
|
const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
20337
|
-
const tmpDir =
|
|
20338
|
-
const serverDir =
|
|
20339
|
-
const clientDir =
|
|
20729
|
+
const tmpDir = join33(compiledRoot, "_tmp");
|
|
20730
|
+
const serverDir = join33(compiledRoot, "server");
|
|
20731
|
+
const clientDir = join33(compiledRoot, "client");
|
|
20340
20732
|
await Promise.all([
|
|
20341
20733
|
mkdir8(tmpDir, { recursive: true }),
|
|
20342
20734
|
mkdir8(serverDir, { recursive: true }),
|
|
20343
20735
|
mkdir8(clientDir, { recursive: true })
|
|
20344
20736
|
]);
|
|
20345
|
-
const tmpPagePath =
|
|
20346
|
-
const tmpHarnessPath =
|
|
20737
|
+
const tmpPagePath = resolve25(join33(tmpDir, `${baseName}.module.js`));
|
|
20738
|
+
const tmpHarnessPath = resolve25(join33(tmpDir, `${baseName}.harness.js`));
|
|
20347
20739
|
await Promise.all([
|
|
20348
20740
|
write4(tmpPagePath, transpiled),
|
|
20349
20741
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -20351,7 +20743,7 @@ export default PageComponent;
|
|
|
20351
20743
|
const stagedSourceMap = new Map([
|
|
20352
20744
|
[tmpPagePath, resolvedEntry]
|
|
20353
20745
|
]);
|
|
20354
|
-
const serverPath =
|
|
20746
|
+
const serverPath = join33(serverDir, `${baseName}.js`);
|
|
20355
20747
|
const buildResult = await bunBuild2({
|
|
20356
20748
|
entrypoints: [tmpHarnessPath],
|
|
20357
20749
|
format: "esm",
|
|
@@ -20368,7 +20760,7 @@ export default PageComponent;
|
|
|
20368
20760
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
20369
20761
|
}
|
|
20370
20762
|
await rm5(tmpDir, { force: true, recursive: true });
|
|
20371
|
-
const clientPath =
|
|
20763
|
+
const clientPath = join33(clientDir, `${baseName}.js`);
|
|
20372
20764
|
await write4(clientPath, transpiled);
|
|
20373
20765
|
return { clientPath, serverPath };
|
|
20374
20766
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -20385,7 +20777,7 @@ export default PageComponent;
|
|
|
20385
20777
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
20386
20778
|
};
|
|
20387
20779
|
}, compileEmberFileSource = async (entry) => {
|
|
20388
|
-
const resolvedEntry =
|
|
20780
|
+
const resolvedEntry = resolve25(entry);
|
|
20389
20781
|
const source = await file3(resolvedEntry).text();
|
|
20390
20782
|
let preprocessed = source;
|
|
20391
20783
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -20396,7 +20788,7 @@ export default PageComponent;
|
|
|
20396
20788
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
20397
20789
|
}
|
|
20398
20790
|
return transpiler5.transformSync(preprocessed);
|
|
20399
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
20791
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "client");
|
|
20400
20792
|
var init_compileEmber = __esm(() => {
|
|
20401
20793
|
init_generatedDir();
|
|
20402
20794
|
transpiler5 = new Transpiler4({
|
|
@@ -20418,24 +20810,24 @@ __export(exports_buildReactVendor, {
|
|
|
20418
20810
|
buildReactVendor: () => buildReactVendor
|
|
20419
20811
|
});
|
|
20420
20812
|
import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
|
|
20421
|
-
import { join as
|
|
20813
|
+
import { join as join34, resolve as resolve26 } from "path";
|
|
20422
20814
|
import { rm as rm6 } from "fs/promises";
|
|
20423
20815
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
20424
20816
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
20425
20817
|
const candidates = [
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20818
|
+
resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
20819
|
+
resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20820
|
+
resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
20821
|
+
resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
20822
|
+
resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
20823
|
+
resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
20432
20824
|
];
|
|
20433
20825
|
for (const candidate of candidates) {
|
|
20434
20826
|
if (existsSync26(candidate)) {
|
|
20435
20827
|
return candidate.replace(/\\/g, "/");
|
|
20436
20828
|
}
|
|
20437
20829
|
}
|
|
20438
|
-
return (candidates[0] ??
|
|
20830
|
+
return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
20439
20831
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
20440
20832
|
const paths = {};
|
|
20441
20833
|
for (const specifier of reactSpecifiers) {
|
|
@@ -20468,14 +20860,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
20468
20860
|
`)}
|
|
20469
20861
|
`;
|
|
20470
20862
|
}, buildReactVendor = async (buildDir) => {
|
|
20471
|
-
const vendorDir =
|
|
20863
|
+
const vendorDir = join34(buildDir, "react", "vendor");
|
|
20472
20864
|
mkdirSync8(vendorDir, { recursive: true });
|
|
20473
|
-
const tmpDir =
|
|
20865
|
+
const tmpDir = join34(buildDir, "_vendor_tmp");
|
|
20474
20866
|
mkdirSync8(tmpDir, { recursive: true });
|
|
20475
20867
|
const specifiers = reactSpecifiers;
|
|
20476
20868
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20477
20869
|
const safeName = toSafeFileName(specifier);
|
|
20478
|
-
const entryPath =
|
|
20870
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
20479
20871
|
const source = await generateEntrySource(specifier);
|
|
20480
20872
|
await Bun.write(entryPath, source);
|
|
20481
20873
|
return entryPath;
|
|
@@ -20543,7 +20935,7 @@ __export(exports_buildAngularVendor, {
|
|
|
20543
20935
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
20544
20936
|
});
|
|
20545
20937
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
20546
|
-
import { join as
|
|
20938
|
+
import { join as join35 } from "path";
|
|
20547
20939
|
import { rm as rm7 } from "fs/promises";
|
|
20548
20940
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
20549
20941
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
@@ -20580,7 +20972,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20580
20972
|
}
|
|
20581
20973
|
return { angular, transitiveRoots };
|
|
20582
20974
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
20583
|
-
const { readFileSync:
|
|
20975
|
+
const { readFileSync: readFileSync22 } = await import("fs");
|
|
20584
20976
|
const transpiler6 = new Bun.Transpiler({ loader: "js" });
|
|
20585
20977
|
const visited = new Set;
|
|
20586
20978
|
const frontier = [];
|
|
@@ -20601,7 +20993,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20601
20993
|
}
|
|
20602
20994
|
let content;
|
|
20603
20995
|
try {
|
|
20604
|
-
content =
|
|
20996
|
+
content = readFileSync22(resolved, "utf-8");
|
|
20605
20997
|
} catch {
|
|
20606
20998
|
continue;
|
|
20607
20999
|
}
|
|
@@ -20640,14 +21032,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20640
21032
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
20641
21033
|
return Array.from(angular).filter(isResolvable);
|
|
20642
21034
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
20643
|
-
const vendorDir =
|
|
21035
|
+
const vendorDir = join35(buildDir, "angular", "vendor");
|
|
20644
21036
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20645
|
-
const tmpDir =
|
|
21037
|
+
const tmpDir = join35(buildDir, "_angular_vendor_tmp");
|
|
20646
21038
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20647
21039
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20648
21040
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20649
21041
|
const safeName = toSafeFileName2(specifier);
|
|
20650
|
-
const entryPath =
|
|
21042
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20651
21043
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20652
21044
|
return entryPath;
|
|
20653
21045
|
}));
|
|
@@ -20678,9 +21070,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20678
21070
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20679
21071
|
return computeAngularVendorPaths(specifiers);
|
|
20680
21072
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
20681
|
-
const vendorDir =
|
|
21073
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20682
21074
|
mkdirSync9(vendorDir, { recursive: true });
|
|
20683
|
-
const tmpDir =
|
|
21075
|
+
const tmpDir = join35(buildDir, "_angular_server_vendor_tmp");
|
|
20684
21076
|
mkdirSync9(tmpDir, { recursive: true });
|
|
20685
21077
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
20686
21078
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -20691,7 +21083,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20691
21083
|
const specifiers = Array.from(allSpecs);
|
|
20692
21084
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20693
21085
|
const safeName = toSafeFileName2(specifier);
|
|
20694
|
-
const entryPath =
|
|
21086
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
20695
21087
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
20696
21088
|
return entryPath;
|
|
20697
21089
|
}));
|
|
@@ -20713,9 +21105,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
20713
21105
|
return specifiers;
|
|
20714
21106
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
20715
21107
|
const paths = {};
|
|
20716
|
-
const vendorDir =
|
|
21108
|
+
const vendorDir = join35(buildDir, "angular", "vendor", "server");
|
|
20717
21109
|
for (const specifier of specifiers) {
|
|
20718
|
-
paths[specifier] =
|
|
21110
|
+
paths[specifier] = join35(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
20719
21111
|
}
|
|
20720
21112
|
return paths;
|
|
20721
21113
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -20771,17 +21163,17 @@ __export(exports_buildVueVendor, {
|
|
|
20771
21163
|
buildVueVendor: () => buildVueVendor
|
|
20772
21164
|
});
|
|
20773
21165
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
20774
|
-
import { join as
|
|
21166
|
+
import { join as join36 } from "path";
|
|
20775
21167
|
import { rm as rm8 } from "fs/promises";
|
|
20776
21168
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
20777
21169
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
20778
|
-
const vendorDir =
|
|
21170
|
+
const vendorDir = join36(buildDir, "vue", "vendor");
|
|
20779
21171
|
mkdirSync10(vendorDir, { recursive: true });
|
|
20780
|
-
const tmpDir =
|
|
21172
|
+
const tmpDir = join36(buildDir, "_vue_vendor_tmp");
|
|
20781
21173
|
mkdirSync10(tmpDir, { recursive: true });
|
|
20782
21174
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
20783
21175
|
const safeName = toSafeFileName3(specifier);
|
|
20784
|
-
const entryPath =
|
|
21176
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
20785
21177
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20786
21178
|
`);
|
|
20787
21179
|
return entryPath;
|
|
@@ -20806,11 +21198,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
20806
21198
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
20807
21199
|
return;
|
|
20808
21200
|
}
|
|
20809
|
-
const { readFileSync:
|
|
21201
|
+
const { readFileSync: readFileSync22, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
|
|
20810
21202
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
20811
21203
|
for (const file4 of files) {
|
|
20812
|
-
const filePath =
|
|
20813
|
-
const content =
|
|
21204
|
+
const filePath = join36(vendorDir, file4);
|
|
21205
|
+
const content = readFileSync22(filePath, "utf-8");
|
|
20814
21206
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
20815
21207
|
continue;
|
|
20816
21208
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -20836,7 +21228,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
20836
21228
|
buildSvelteVendor: () => buildSvelteVendor
|
|
20837
21229
|
});
|
|
20838
21230
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
20839
|
-
import { join as
|
|
21231
|
+
import { join as join37 } from "path";
|
|
20840
21232
|
import { rm as rm9 } from "fs/promises";
|
|
20841
21233
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
20842
21234
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -20850,13 +21242,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
20850
21242
|
const specifiers = resolveVendorSpecifiers();
|
|
20851
21243
|
if (specifiers.length === 0)
|
|
20852
21244
|
return;
|
|
20853
|
-
const vendorDir =
|
|
21245
|
+
const vendorDir = join37(buildDir, "svelte", "vendor");
|
|
20854
21246
|
mkdirSync11(vendorDir, { recursive: true });
|
|
20855
|
-
const tmpDir =
|
|
21247
|
+
const tmpDir = join37(buildDir, "_svelte_vendor_tmp");
|
|
20856
21248
|
mkdirSync11(tmpDir, { recursive: true });
|
|
20857
21249
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
20858
21250
|
const safeName = toSafeFileName4(specifier);
|
|
20859
|
-
const entryPath =
|
|
21251
|
+
const entryPath = join37(tmpDir, `${safeName}.ts`);
|
|
20860
21252
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
20861
21253
|
`);
|
|
20862
21254
|
return entryPath;
|
|
@@ -20901,13 +21293,13 @@ import {
|
|
|
20901
21293
|
existsSync as existsSync27,
|
|
20902
21294
|
mkdirSync as mkdirSync12,
|
|
20903
21295
|
readdirSync as readdirSync5,
|
|
20904
|
-
readFileSync as
|
|
21296
|
+
readFileSync as readFileSync22,
|
|
20905
21297
|
renameSync,
|
|
20906
21298
|
rmSync as rmSync2,
|
|
20907
21299
|
statSync as statSync3,
|
|
20908
21300
|
writeFileSync as writeFileSync8
|
|
20909
21301
|
} from "fs";
|
|
20910
|
-
import { basename as basename14, dirname as
|
|
21302
|
+
import { basename as basename14, dirname as dirname21, extname as extname10, join as join38, relative as relative15, resolve as resolve27 } from "path";
|
|
20911
21303
|
import { cwd, env as env2, exit } from "process";
|
|
20912
21304
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
20913
21305
|
var isBuildTraceEnabled = () => {
|
|
@@ -20990,7 +21382,7 @@ var isBuildTraceEnabled = () => {
|
|
|
20990
21382
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
20991
21383
|
let content;
|
|
20992
21384
|
try {
|
|
20993
|
-
content =
|
|
21385
|
+
content = readFileSync22(path, "utf-8");
|
|
20994
21386
|
} catch {
|
|
20995
21387
|
return [];
|
|
20996
21388
|
}
|
|
@@ -21041,8 +21433,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21041
21433
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
21042
21434
|
const glob = new Glob8("htmx*.min.js");
|
|
21043
21435
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
21044
|
-
const src =
|
|
21045
|
-
const dest =
|
|
21436
|
+
const src = join38(htmxDir, relPath);
|
|
21437
|
+
const dest = join38(htmxDestDir, "htmx.min.js");
|
|
21046
21438
|
copyFileSync2(src, dest);
|
|
21047
21439
|
return;
|
|
21048
21440
|
}
|
|
@@ -21054,8 +21446,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21054
21446
|
}
|
|
21055
21447
|
}, resolveAbsoluteVersion = async () => {
|
|
21056
21448
|
const candidates = [
|
|
21057
|
-
|
|
21058
|
-
|
|
21449
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
21450
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
21059
21451
|
];
|
|
21060
21452
|
const resolveCandidate = async (remaining) => {
|
|
21061
21453
|
const [candidate, ...rest] = remaining;
|
|
@@ -21071,7 +21463,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21071
21463
|
};
|
|
21072
21464
|
await resolveCandidate(candidates);
|
|
21073
21465
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
21074
|
-
const absPath =
|
|
21466
|
+
const absPath = resolve27(file4, "..", relPath);
|
|
21075
21467
|
try {
|
|
21076
21468
|
statSync3(absPath);
|
|
21077
21469
|
workerPaths.add(absPath);
|
|
@@ -21086,7 +21478,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21086
21478
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
21087
21479
|
}
|
|
21088
21480
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
21089
|
-
const content =
|
|
21481
|
+
const content = readFileSync22(file4, "utf-8");
|
|
21090
21482
|
for (const pattern of patterns) {
|
|
21091
21483
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
21092
21484
|
}
|
|
@@ -21119,7 +21511,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21119
21511
|
vuePagesPath
|
|
21120
21512
|
}) => {
|
|
21121
21513
|
const { readdirSync: readDir } = await import("fs");
|
|
21122
|
-
const devIndexDir =
|
|
21514
|
+
const devIndexDir = join38(buildPath, "_src_indexes");
|
|
21123
21515
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
21124
21516
|
if (reactIndexesPath && reactPagesPath) {
|
|
21125
21517
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -21135,37 +21527,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21135
21527
|
return;
|
|
21136
21528
|
}
|
|
21137
21529
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
21138
|
-
const pagesRel = relative15(process.cwd(),
|
|
21530
|
+
const pagesRel = relative15(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
|
|
21139
21531
|
for (const file4 of indexFiles) {
|
|
21140
|
-
let content =
|
|
21532
|
+
let content = readFileSync22(join38(reactIndexesPath, file4), "utf-8");
|
|
21141
21533
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
21142
|
-
writeFileSync8(
|
|
21534
|
+
writeFileSync8(join38(devIndexDir, file4), content);
|
|
21143
21535
|
}
|
|
21144
21536
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
21145
|
-
const svelteIndexDir =
|
|
21146
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
21537
|
+
const svelteIndexDir = join38(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
21538
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
|
|
21147
21539
|
for (const entry of sveltePageEntries) {
|
|
21148
21540
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
21149
|
-
const indexFile =
|
|
21541
|
+
const indexFile = join38(svelteIndexDir, "pages", `${name}.js`);
|
|
21150
21542
|
if (!existsSync27(indexFile))
|
|
21151
21543
|
continue;
|
|
21152
|
-
let content =
|
|
21153
|
-
const srcRel = relative15(process.cwd(),
|
|
21544
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21545
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
21154
21546
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
21155
|
-
writeFileSync8(
|
|
21547
|
+
writeFileSync8(join38(devIndexDir, `${name}.svelte.js`), content);
|
|
21156
21548
|
}
|
|
21157
21549
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
21158
|
-
const vueIndexDir =
|
|
21159
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
21550
|
+
const vueIndexDir = join38(getFrameworkGeneratedDir("vue"), "indexes");
|
|
21551
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
|
|
21160
21552
|
for (const entry of vuePageEntries) {
|
|
21161
21553
|
const name = basename14(entry, ".vue");
|
|
21162
|
-
const indexFile =
|
|
21554
|
+
const indexFile = join38(vueIndexDir, `${name}.js`);
|
|
21163
21555
|
if (!existsSync27(indexFile))
|
|
21164
21556
|
continue;
|
|
21165
|
-
let content =
|
|
21166
|
-
const srcRel = relative15(process.cwd(),
|
|
21557
|
+
let content = readFileSync22(indexFile, "utf-8");
|
|
21558
|
+
const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
|
|
21167
21559
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
21168
|
-
writeFileSync8(
|
|
21560
|
+
writeFileSync8(join38(devIndexDir, `${name}.vue.js`), content);
|
|
21169
21561
|
}
|
|
21170
21562
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
21171
21563
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -21176,7 +21568,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21176
21568
|
const last = allComments[allComments.length - 1];
|
|
21177
21569
|
if (!last?.[1])
|
|
21178
21570
|
return JSON.stringify(outputPath);
|
|
21179
|
-
const srcPath =
|
|
21571
|
+
const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
21180
21572
|
return JSON.stringify(srcPath);
|
|
21181
21573
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
21182
21574
|
let depth = 0;
|
|
@@ -21213,7 +21605,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
21213
21605
|
}
|
|
21214
21606
|
return result;
|
|
21215
21607
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
21216
|
-
let content =
|
|
21608
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21217
21609
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
21218
21610
|
const useNames = [];
|
|
21219
21611
|
let match;
|
|
@@ -21263,7 +21655,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21263
21655
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
21264
21656
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
21265
21657
|
for (const outputPath of outputPaths) {
|
|
21266
|
-
let content =
|
|
21658
|
+
let content = readFileSync22(outputPath, "utf-8");
|
|
21267
21659
|
let changed = false;
|
|
21268
21660
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
21269
21661
|
const targetName = basename14(relPath);
|
|
@@ -21403,10 +21795,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21403
21795
|
restoreTracePhase();
|
|
21404
21796
|
return;
|
|
21405
21797
|
}
|
|
21406
|
-
const traceDir =
|
|
21798
|
+
const traceDir = join38(buildPath2, ".absolute-trace");
|
|
21407
21799
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
21408
21800
|
mkdirSync12(traceDir, { recursive: true });
|
|
21409
|
-
writeFileSync8(
|
|
21801
|
+
writeFileSync8(join38(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
21410
21802
|
events: traceEvents,
|
|
21411
21803
|
frameworks: traceFrameworkNames,
|
|
21412
21804
|
generatedAt: new Date().toISOString(),
|
|
@@ -21437,16 +21829,16 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21437
21829
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
21438
21830
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
21439
21831
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
21440
|
-
const reactIndexesPath = reactDir &&
|
|
21441
|
-
const reactPagesPath = reactDir &&
|
|
21442
|
-
const htmlPagesPath = htmlDir &&
|
|
21443
|
-
const htmlScriptsPath = htmlDir &&
|
|
21444
|
-
const sveltePagesPath = svelteDir &&
|
|
21445
|
-
const vuePagesPath = vueDir &&
|
|
21446
|
-
const htmxPagesPath = htmxDir &&
|
|
21447
|
-
const htmxScriptsPath = htmxDir &&
|
|
21448
|
-
const angularPagesPath = angularDir &&
|
|
21449
|
-
const emberPagesPath = emberDir &&
|
|
21832
|
+
const reactIndexesPath = reactDir && join38(getFrameworkGeneratedDir("react"), "indexes");
|
|
21833
|
+
const reactPagesPath = reactDir && join38(reactDir, "pages");
|
|
21834
|
+
const htmlPagesPath = htmlDir && join38(htmlDir, "pages");
|
|
21835
|
+
const htmlScriptsPath = htmlDir && join38(htmlDir, "scripts");
|
|
21836
|
+
const sveltePagesPath = svelteDir && join38(svelteDir, "pages");
|
|
21837
|
+
const vuePagesPath = vueDir && join38(vueDir, "pages");
|
|
21838
|
+
const htmxPagesPath = htmxDir && join38(htmxDir, "pages");
|
|
21839
|
+
const htmxScriptsPath = htmxDir && join38(htmxDir, "scripts");
|
|
21840
|
+
const angularPagesPath = angularDir && join38(angularDir, "pages");
|
|
21841
|
+
const emberPagesPath = emberDir && join38(emberDir, "pages");
|
|
21450
21842
|
const frontends = [
|
|
21451
21843
|
reactDir,
|
|
21452
21844
|
htmlDir,
|
|
@@ -21479,7 +21871,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21479
21871
|
const sourceClientRoots = [
|
|
21480
21872
|
htmlDir,
|
|
21481
21873
|
htmxDir,
|
|
21482
|
-
islandBootstrapPath &&
|
|
21874
|
+
islandBootstrapPath && dirname21(islandBootstrapPath)
|
|
21483
21875
|
].filter((dir) => Boolean(dir));
|
|
21484
21876
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
21485
21877
|
if (usesGenerated)
|
|
@@ -21507,8 +21899,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21507
21899
|
const [firstEntry] = serverDirMap;
|
|
21508
21900
|
if (!firstEntry)
|
|
21509
21901
|
throw new Error("Expected at least one server directory entry");
|
|
21510
|
-
serverRoot =
|
|
21511
|
-
serverOutDir =
|
|
21902
|
+
serverRoot = join38(firstEntry.dir, firstEntry.subdir);
|
|
21903
|
+
serverOutDir = join38(buildPath, basename14(firstEntry.dir));
|
|
21512
21904
|
} else if (serverDirMap.length > 1) {
|
|
21513
21905
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
21514
21906
|
serverOutDir = buildPath;
|
|
@@ -21521,18 +21913,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21521
21913
|
buildPath,
|
|
21522
21914
|
config: pwa,
|
|
21523
21915
|
generatedRoot,
|
|
21916
|
+
projectRoot,
|
|
21524
21917
|
write: !isIncremental
|
|
21525
21918
|
})) : undefined;
|
|
21526
21919
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
21527
21920
|
if (!isIncremental || !incrementalFiles)
|
|
21528
21921
|
return entryPoints;
|
|
21529
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
21922
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
|
|
21530
21923
|
const matchingEntries = [];
|
|
21531
21924
|
for (const entry of entryPoints) {
|
|
21532
21925
|
const sourceFile = mapToSource(entry);
|
|
21533
21926
|
if (!sourceFile)
|
|
21534
21927
|
continue;
|
|
21535
|
-
if (!normalizedIncremental.has(
|
|
21928
|
+
if (!normalizedIncremental.has(resolve27(sourceFile)))
|
|
21536
21929
|
continue;
|
|
21537
21930
|
matchingEntries.push(entry);
|
|
21538
21931
|
}
|
|
@@ -21542,7 +21935,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21542
21935
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
21543
21936
|
}
|
|
21544
21937
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
21545
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
21938
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join38(buildPath, "assets"), {
|
|
21546
21939
|
force: true,
|
|
21547
21940
|
recursive: true
|
|
21548
21941
|
}));
|
|
@@ -21656,11 +22049,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21656
22049
|
}
|
|
21657
22050
|
}
|
|
21658
22051
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
21659
|
-
const htmlConventionsOutDir =
|
|
22052
|
+
const htmlConventionsOutDir = join38(buildPath, "conventions", "html");
|
|
21660
22053
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
21661
22054
|
const htmlPathRemap = new Map;
|
|
21662
22055
|
for (const sourcePath of htmlConventionSources) {
|
|
21663
|
-
const dest =
|
|
22056
|
+
const dest = join38(htmlConventionsOutDir, basename14(sourcePath));
|
|
21664
22057
|
cpSync(sourcePath, dest, { force: true });
|
|
21665
22058
|
htmlPathRemap.set(sourcePath, dest);
|
|
21666
22059
|
}
|
|
@@ -21701,9 +22094,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21701
22094
|
}
|
|
21702
22095
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
21703
22096
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
21704
|
-
if (entry.startsWith(
|
|
22097
|
+
if (entry.startsWith(resolve27(reactIndexesPath))) {
|
|
21705
22098
|
const pageName = basename14(entry, ".tsx");
|
|
21706
|
-
return
|
|
22099
|
+
return join38(reactPagesPath, `${pageName}.tsx`);
|
|
21707
22100
|
}
|
|
21708
22101
|
return null;
|
|
21709
22102
|
}) : allReactEntries;
|
|
@@ -21735,7 +22128,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21735
22128
|
for (const entry of vueEntries) {
|
|
21736
22129
|
const name = basename14(entry, ".vue");
|
|
21737
22130
|
if (ssrOnlyPageNames.has(name)) {
|
|
21738
|
-
resolved.add(
|
|
22131
|
+
resolved.add(resolve27(entry));
|
|
21739
22132
|
}
|
|
21740
22133
|
}
|
|
21741
22134
|
return resolved;
|
|
@@ -21872,7 +22265,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21872
22265
|
const clientPath = islandSvelteClientPaths[idx];
|
|
21873
22266
|
if (!sourcePath || !clientPath)
|
|
21874
22267
|
continue;
|
|
21875
|
-
islandSvelteClientPathMap.set(
|
|
22268
|
+
islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21876
22269
|
}
|
|
21877
22270
|
const islandVueClientPathMap = new Map;
|
|
21878
22271
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -21880,7 +22273,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21880
22273
|
const clientPath = islandVueClientPaths[idx];
|
|
21881
22274
|
if (!sourcePath || !clientPath)
|
|
21882
22275
|
continue;
|
|
21883
|
-
islandVueClientPathMap.set(
|
|
22276
|
+
islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21884
22277
|
}
|
|
21885
22278
|
const islandAngularClientPathMap = new Map;
|
|
21886
22279
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -21888,7 +22281,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21888
22281
|
const clientPath = islandAngularClientPaths[idx];
|
|
21889
22282
|
if (!sourcePath || !clientPath)
|
|
21890
22283
|
continue;
|
|
21891
|
-
islandAngularClientPathMap.set(
|
|
22284
|
+
islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
|
|
21892
22285
|
}
|
|
21893
22286
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
21894
22287
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -21899,7 +22292,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21899
22292
|
const compileReactConventions = async () => {
|
|
21900
22293
|
if (reactConventionSources.length === 0)
|
|
21901
22294
|
return emptyStringArray;
|
|
21902
|
-
const destDir =
|
|
22295
|
+
const destDir = join38(buildPath, "conventions", "react");
|
|
21903
22296
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21904
22297
|
mkdirSync12(destDir, { recursive: true });
|
|
21905
22298
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -21914,7 +22307,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21914
22307
|
stylePreprocessorPlugin2,
|
|
21915
22308
|
createBunStringRawUnicodePlugin()
|
|
21916
22309
|
],
|
|
21917
|
-
root:
|
|
22310
|
+
root: dirname21(source),
|
|
21918
22311
|
target: "bun",
|
|
21919
22312
|
throw: false,
|
|
21920
22313
|
tsconfig: "./tsconfig.json"
|
|
@@ -21942,7 +22335,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21942
22335
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
21943
22336
|
]);
|
|
21944
22337
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
21945
|
-
const destDir =
|
|
22338
|
+
const destDir = join38(buildPath, "conventions", framework);
|
|
21946
22339
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21947
22340
|
mkdirSync12(destDir, { recursive: true });
|
|
21948
22341
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -22003,7 +22396,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22003
22396
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
22004
22397
|
];
|
|
22005
22398
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
22006
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
22399
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname21(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname21(file4)), projectRoot);
|
|
22007
22400
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
22008
22401
|
buildInfo: islandBuildInfo,
|
|
22009
22402
|
buildPath,
|
|
@@ -22014,7 +22407,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22014
22407
|
}
|
|
22015
22408
|
})) : {
|
|
22016
22409
|
entries: [],
|
|
22017
|
-
generatedRoot:
|
|
22410
|
+
generatedRoot: join38(buildPath, "_island_entries")
|
|
22018
22411
|
};
|
|
22019
22412
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
22020
22413
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -22050,7 +22443,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22050
22443
|
return {};
|
|
22051
22444
|
}
|
|
22052
22445
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
22053
|
-
const refreshEntry =
|
|
22446
|
+
const refreshEntry = join38(reactIndexesPath, "_refresh.tsx");
|
|
22054
22447
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
22055
22448
|
reactClientEntryPoints.push(refreshEntry);
|
|
22056
22449
|
}
|
|
@@ -22161,19 +22554,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22161
22554
|
throw: false
|
|
22162
22555
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
22163
22556
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
22164
|
-
rmSync2(
|
|
22557
|
+
rmSync2(join38(buildPath, "react", "generated", "indexes"), {
|
|
22165
22558
|
force: true,
|
|
22166
22559
|
recursive: true
|
|
22167
22560
|
});
|
|
22168
22561
|
}
|
|
22169
22562
|
if (angularDir && angularClientPaths.length > 0) {
|
|
22170
|
-
rmSync2(
|
|
22563
|
+
rmSync2(join38(buildPath, "angular", "indexes"), {
|
|
22171
22564
|
force: true,
|
|
22172
22565
|
recursive: true
|
|
22173
22566
|
});
|
|
22174
22567
|
}
|
|
22175
22568
|
if (islandClientEntryPoints.length > 0) {
|
|
22176
|
-
rmSync2(
|
|
22569
|
+
rmSync2(join38(buildPath, "islands"), {
|
|
22177
22570
|
force: true,
|
|
22178
22571
|
recursive: true
|
|
22179
22572
|
});
|
|
@@ -22287,7 +22680,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22287
22680
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22288
22681
|
entrypoints: globalCssEntries,
|
|
22289
22682
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
22290
|
-
outdir: stylesDir ?
|
|
22683
|
+
outdir: stylesDir ? join38(buildPath, basename14(stylesDir)) : buildPath,
|
|
22291
22684
|
plugins: [stylePreprocessorPlugin2],
|
|
22292
22685
|
root: stylesDir || clientRoot,
|
|
22293
22686
|
target: "browser",
|
|
@@ -22296,7 +22689,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22296
22689
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
22297
22690
|
entrypoints: vueCssPaths,
|
|
22298
22691
|
naming: `[name].[hash].[ext]`,
|
|
22299
|
-
outdir:
|
|
22692
|
+
outdir: join38(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
|
|
22300
22693
|
target: "browser",
|
|
22301
22694
|
throw: false
|
|
22302
22695
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -22320,18 +22713,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22320
22713
|
}
|
|
22321
22714
|
if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
|
|
22322
22715
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
22323
|
-
const sourcemapDir =
|
|
22716
|
+
const sourcemapDir = join38(projectRoot, "sourcemaps");
|
|
22324
22717
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
22325
22718
|
const mapFiles = readdirSync5(buildPath, {
|
|
22326
22719
|
encoding: "utf8",
|
|
22327
22720
|
recursive: true
|
|
22328
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
22721
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join38(buildPath, entry));
|
|
22329
22722
|
for (const mapPath of mapFiles) {
|
|
22330
22723
|
chainExternalSourcemap2(mapPath);
|
|
22331
|
-
renameSync(mapPath,
|
|
22724
|
+
renameSync(mapPath, join38(sourcemapDir, basename14(mapPath)));
|
|
22332
22725
|
const jsPath = mapPath.slice(0, -4);
|
|
22333
22726
|
try {
|
|
22334
|
-
const javascript =
|
|
22727
|
+
const javascript = readFileSync22(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
22335
22728
|
`);
|
|
22336
22729
|
writeFileSync8(jsPath, javascript);
|
|
22337
22730
|
} catch {}
|
|
@@ -22402,7 +22795,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22402
22795
|
await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
|
|
22403
22796
|
}
|
|
22404
22797
|
if (!hmr) {
|
|
22405
|
-
const reactVendorDir =
|
|
22798
|
+
const reactVendorDir = join38(buildPath, "react", "vendor");
|
|
22406
22799
|
const vendorChunkPaths = existsSync27(reactVendorDir) ? [
|
|
22407
22800
|
...new Glob8("**/*.js").scanSync({
|
|
22408
22801
|
absolute: true,
|
|
@@ -22419,7 +22812,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22419
22812
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
22420
22813
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
22421
22814
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
22422
|
-
const fileDir =
|
|
22815
|
+
const fileDir = dirname21(artifact.path);
|
|
22423
22816
|
const relativePaths = {};
|
|
22424
22817
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
22425
22818
|
const rel = relative15(fileDir, absolute);
|
|
@@ -22547,7 +22940,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22547
22940
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
22548
22941
|
if (!hmrClientBundle)
|
|
22549
22942
|
return;
|
|
22550
|
-
let html =
|
|
22943
|
+
let html = readFileSync22(filePath, "utf-8");
|
|
22551
22944
|
if (html.includes("data-hmr-client"))
|
|
22552
22945
|
return;
|
|
22553
22946
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -22558,7 +22951,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22558
22951
|
const processHtmlPages = async () => {
|
|
22559
22952
|
if (!(htmlDir && htmlPagesPath))
|
|
22560
22953
|
return;
|
|
22561
|
-
const outputHtmlPages = isSingle ?
|
|
22954
|
+
const outputHtmlPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmlDir), "pages");
|
|
22562
22955
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
22563
22956
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
22564
22957
|
force: true,
|
|
@@ -22574,7 +22967,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22574
22967
|
if (hmr)
|
|
22575
22968
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
22576
22969
|
if (pwaArtifacts) {
|
|
22577
|
-
const source =
|
|
22970
|
+
const source = readFileSync22(htmlFile, "utf8");
|
|
22578
22971
|
writeFileSync8(htmlFile, injectPwaBootstrapHtml(source));
|
|
22579
22972
|
}
|
|
22580
22973
|
const fileName = basename14(htmlFile, ".html");
|
|
@@ -22587,14 +22980,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22587
22980
|
const processHtmxPages = async () => {
|
|
22588
22981
|
if (!(htmxDir && htmxPagesPath))
|
|
22589
22982
|
return;
|
|
22590
|
-
const outputHtmxPages = isSingle ?
|
|
22983
|
+
const outputHtmxPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmxDir), "pages");
|
|
22591
22984
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
22592
22985
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
22593
22986
|
force: true,
|
|
22594
22987
|
recursive: true
|
|
22595
22988
|
});
|
|
22596
22989
|
if (shouldCopyHtmx) {
|
|
22597
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
22990
|
+
const htmxDestDir = isSingle ? buildPath : join38(buildPath, basename14(htmxDir));
|
|
22598
22991
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
22599
22992
|
}
|
|
22600
22993
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -22607,7 +23000,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22607
23000
|
if (hmr)
|
|
22608
23001
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
22609
23002
|
if (pwaArtifacts) {
|
|
22610
|
-
const source =
|
|
23003
|
+
const source = readFileSync22(htmxFile, "utf8");
|
|
22611
23004
|
writeFileSync8(htmxFile, injectPwaBootstrapHtml(source));
|
|
22612
23005
|
}
|
|
22613
23006
|
const fileName = basename14(htmxFile, ".html");
|
|
@@ -22670,22 +23063,22 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22670
23063
|
angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
|
|
22671
23064
|
]);
|
|
22672
23065
|
const spaRouteHosts = [
|
|
22673
|
-
...reactSpaHosts.map((
|
|
22674
|
-
...
|
|
23066
|
+
...reactSpaHosts.map((host2) => ({
|
|
23067
|
+
...host2,
|
|
22675
23068
|
framework: "react"
|
|
22676
23069
|
})),
|
|
22677
|
-
...svelteSpaHosts.map((
|
|
22678
|
-
...
|
|
23070
|
+
...svelteSpaHosts.map((host2) => ({
|
|
23071
|
+
...host2,
|
|
22679
23072
|
framework: "svelte"
|
|
22680
23073
|
})),
|
|
22681
|
-
...vueSpaHosts.map((
|
|
22682
|
-
...angularSpaHosts.map((
|
|
22683
|
-
...
|
|
23074
|
+
...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
|
|
23075
|
+
...angularSpaHosts.map((host2) => ({
|
|
23076
|
+
...host2,
|
|
22684
23077
|
framework: "angular"
|
|
22685
23078
|
}))
|
|
22686
23079
|
];
|
|
22687
23080
|
setSpaRouteManifest(spaRouteHosts);
|
|
22688
|
-
writeFileSync8(
|
|
23081
|
+
writeFileSync8(join38(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
22689
23082
|
if (isIncremental) {
|
|
22690
23083
|
writeBuildTrace(buildPath);
|
|
22691
23084
|
return {
|
|
@@ -22694,9 +23087,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
22694
23087
|
manifest
|
|
22695
23088
|
};
|
|
22696
23089
|
}
|
|
22697
|
-
writeFileSync8(
|
|
23090
|
+
writeFileSync8(join38(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
22698
23091
|
if (Object.keys(conventionsMap).length > 0) {
|
|
22699
|
-
writeFileSync8(
|
|
23092
|
+
writeFileSync8(join38(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
22700
23093
|
}
|
|
22701
23094
|
writeBuildTrace(buildPath);
|
|
22702
23095
|
if (mode === "production") {
|
|
@@ -22830,7 +23223,7 @@ var init_build = __esm(() => {
|
|
|
22830
23223
|
|
|
22831
23224
|
// src/build/buildEmberVendor.ts
|
|
22832
23225
|
import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
|
|
22833
|
-
import { join as
|
|
23226
|
+
import { join as join39 } from "path";
|
|
22834
23227
|
import { rm as rm10 } from "fs/promises";
|
|
22835
23228
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
22836
23229
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -22882,7 +23275,7 @@ export const importSync = (specifier) => {
|
|
|
22882
23275
|
if (standaloneSpecifiers.has(specifier)) {
|
|
22883
23276
|
return { resolveTo: specifier, specifier };
|
|
22884
23277
|
}
|
|
22885
|
-
const emberInternalPath =
|
|
23278
|
+
const emberInternalPath = join39(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
22886
23279
|
if (!existsSync28(emberInternalPath)) {
|
|
22887
23280
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
22888
23281
|
}
|
|
@@ -22914,7 +23307,7 @@ export const importSync = (specifier) => {
|
|
|
22914
23307
|
if (standalonePackages.has(args.path)) {
|
|
22915
23308
|
return;
|
|
22916
23309
|
}
|
|
22917
|
-
const internal =
|
|
23310
|
+
const internal = join39(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
22918
23311
|
if (existsSync28(internal)) {
|
|
22919
23312
|
return { path: internal };
|
|
22920
23313
|
}
|
|
@@ -22922,16 +23315,16 @@ export const importSync = (specifier) => {
|
|
|
22922
23315
|
});
|
|
22923
23316
|
}
|
|
22924
23317
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
22925
|
-
const vendorDir =
|
|
23318
|
+
const vendorDir = join39(buildDir, "ember", "vendor");
|
|
22926
23319
|
mkdirSync13(vendorDir, { recursive: true });
|
|
22927
|
-
const tmpDir =
|
|
23320
|
+
const tmpDir = join39(buildDir, "_ember_vendor_tmp");
|
|
22928
23321
|
mkdirSync13(tmpDir, { recursive: true });
|
|
22929
|
-
const macrosShimPath =
|
|
23322
|
+
const macrosShimPath = join39(tmpDir, "embroider_macros_shim.js");
|
|
22930
23323
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
22931
23324
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
22932
23325
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
22933
23326
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
22934
|
-
const entryPath =
|
|
23327
|
+
const entryPath = join39(tmpDir, `${safeName}.js`);
|
|
22935
23328
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
22936
23329
|
` : generateVendorEntrySource2(resolution);
|
|
22937
23330
|
await Bun.write(entryPath, source);
|
|
@@ -23087,9 +23480,9 @@ __export(exports_dependencyGraph, {
|
|
|
23087
23480
|
buildInitialDependencyGraph: () => buildInitialDependencyGraph,
|
|
23088
23481
|
addFileToGraph: () => addFileToGraph
|
|
23089
23482
|
});
|
|
23090
|
-
import { existsSync as existsSync29, readFileSync as
|
|
23483
|
+
import { existsSync as existsSync29, readFileSync as readFileSync23 } from "fs";
|
|
23091
23484
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
23092
|
-
import { resolve as
|
|
23485
|
+
import { resolve as resolve28 } from "path";
|
|
23093
23486
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
23094
23487
|
const lower = filePath.toLowerCase();
|
|
23095
23488
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -23103,8 +23496,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23103
23496
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
23104
23497
|
return null;
|
|
23105
23498
|
}
|
|
23106
|
-
const fromDir =
|
|
23107
|
-
const normalized =
|
|
23499
|
+
const fromDir = resolve28(fromFile, "..");
|
|
23500
|
+
const normalized = resolve28(fromDir, importPath);
|
|
23108
23501
|
const extensions = [
|
|
23109
23502
|
".ts",
|
|
23110
23503
|
".tsx",
|
|
@@ -23134,7 +23527,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23134
23527
|
dependents.delete(normalizedPath);
|
|
23135
23528
|
}
|
|
23136
23529
|
}, addFileToGraph = (graph, filePath) => {
|
|
23137
|
-
const normalizedPath =
|
|
23530
|
+
const normalizedPath = resolve28(filePath);
|
|
23138
23531
|
if (!existsSync29(normalizedPath))
|
|
23139
23532
|
return;
|
|
23140
23533
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -23161,10 +23554,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23161
23554
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
23162
23555
|
const processedFiles = new Set;
|
|
23163
23556
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
23164
|
-
const resolvedDirs = directories.map((dir) =>
|
|
23557
|
+
const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync29(dir));
|
|
23165
23558
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
23166
23559
|
for (const file4 of allFiles) {
|
|
23167
|
-
const fullPath =
|
|
23560
|
+
const fullPath = resolve28(file4);
|
|
23168
23561
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
23169
23562
|
continue;
|
|
23170
23563
|
if (processedFiles.has(fullPath))
|
|
@@ -23258,15 +23651,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23258
23651
|
const lowerPath = filePath.toLowerCase();
|
|
23259
23652
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
23260
23653
|
if (loader === "html") {
|
|
23261
|
-
const content =
|
|
23654
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23262
23655
|
return extractHtmlDependencies(filePath, content);
|
|
23263
23656
|
}
|
|
23264
23657
|
if (loader === "tsx" || loader === "js") {
|
|
23265
|
-
const content =
|
|
23658
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23266
23659
|
return extractJsDependencies(filePath, content, loader);
|
|
23267
23660
|
}
|
|
23268
23661
|
if (isSvelteOrVue) {
|
|
23269
|
-
const content =
|
|
23662
|
+
const content = readFileSync23(filePath, "utf-8");
|
|
23270
23663
|
return extractSvelteVueDependencies(filePath, content);
|
|
23271
23664
|
}
|
|
23272
23665
|
return [];
|
|
@@ -23277,7 +23670,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23277
23670
|
return [];
|
|
23278
23671
|
}
|
|
23279
23672
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
23280
|
-
const normalizedPath =
|
|
23673
|
+
const normalizedPath = resolve28(changedFile);
|
|
23281
23674
|
const affected = new Set;
|
|
23282
23675
|
const toProcess = [normalizedPath];
|
|
23283
23676
|
const processNode = (current) => {
|
|
@@ -23308,7 +23701,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
23308
23701
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
23309
23702
|
graph.dependents.delete(normalizedPath);
|
|
23310
23703
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
23311
|
-
const normalizedPath =
|
|
23704
|
+
const normalizedPath = resolve28(filePath);
|
|
23312
23705
|
removeDepsForFile(graph, normalizedPath);
|
|
23313
23706
|
removeDependentsForFile(graph, normalizedPath);
|
|
23314
23707
|
};
|
|
@@ -23351,12 +23744,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
23351
23744
|
};
|
|
23352
23745
|
|
|
23353
23746
|
// src/dev/configResolver.ts
|
|
23354
|
-
import { resolve as
|
|
23747
|
+
import { resolve as resolve29 } from "path";
|
|
23355
23748
|
var resolveBuildPaths = (config) => {
|
|
23356
23749
|
const cwd2 = process.cwd();
|
|
23357
23750
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
23358
|
-
const withDefault = (value, fallback) => normalize(
|
|
23359
|
-
const optional = (value) => value ? normalize(
|
|
23751
|
+
const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
|
|
23752
|
+
const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
|
|
23360
23753
|
return {
|
|
23361
23754
|
angularDir: optional(config.angularDirectory),
|
|
23362
23755
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -23414,8 +23807,8 @@ var init_clientManager = __esm(() => {
|
|
|
23414
23807
|
});
|
|
23415
23808
|
|
|
23416
23809
|
// src/dev/pathUtils.ts
|
|
23417
|
-
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as
|
|
23418
|
-
import { dirname as
|
|
23810
|
+
import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync24 } from "fs";
|
|
23811
|
+
import { dirname as dirname22, resolve as resolve30 } from "path";
|
|
23419
23812
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
23420
23813
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
23421
23814
|
return "ignored";
|
|
@@ -23491,7 +23884,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23491
23884
|
return "unknown";
|
|
23492
23885
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
23493
23886
|
const out = new Set;
|
|
23494
|
-
const angularRoot =
|
|
23887
|
+
const angularRoot = resolve30(angularDir);
|
|
23495
23888
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
23496
23889
|
const walk = (dir) => {
|
|
23497
23890
|
let entries;
|
|
@@ -23504,7 +23897,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23504
23897
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
23505
23898
|
continue;
|
|
23506
23899
|
}
|
|
23507
|
-
const full =
|
|
23900
|
+
const full = resolve30(dir, entry.name);
|
|
23508
23901
|
if (entry.isDirectory()) {
|
|
23509
23902
|
walk(full);
|
|
23510
23903
|
continue;
|
|
@@ -23514,7 +23907,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23514
23907
|
}
|
|
23515
23908
|
let source;
|
|
23516
23909
|
try {
|
|
23517
|
-
source =
|
|
23910
|
+
source = readFileSync24(full, "utf8");
|
|
23518
23911
|
} catch {
|
|
23519
23912
|
continue;
|
|
23520
23913
|
}
|
|
@@ -23543,10 +23936,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23543
23936
|
refs.push(strMatch[1]);
|
|
23544
23937
|
}
|
|
23545
23938
|
}
|
|
23546
|
-
const componentDir =
|
|
23939
|
+
const componentDir = dirname22(full);
|
|
23547
23940
|
for (const ref of refs) {
|
|
23548
|
-
const refAbs = normalizePath(
|
|
23549
|
-
const refDir = normalizePath(
|
|
23941
|
+
const refAbs = normalizePath(resolve30(componentDir, ref));
|
|
23942
|
+
const refDir = normalizePath(dirname22(refAbs));
|
|
23550
23943
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
23551
23944
|
continue;
|
|
23552
23945
|
}
|
|
@@ -23562,7 +23955,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23562
23955
|
const push = (path) => {
|
|
23563
23956
|
if (!path)
|
|
23564
23957
|
return;
|
|
23565
|
-
const abs = normalizePath(
|
|
23958
|
+
const abs = normalizePath(resolve30(cwd2, path));
|
|
23566
23959
|
if (!roots.includes(abs))
|
|
23567
23960
|
roots.push(abs);
|
|
23568
23961
|
};
|
|
@@ -23587,7 +23980,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23587
23980
|
push(cfg.assetsDir);
|
|
23588
23981
|
push(cfg.stylesDir);
|
|
23589
23982
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
23590
|
-
const abs = normalizePath(
|
|
23983
|
+
const abs = normalizePath(resolve30(cwd2, candidate));
|
|
23591
23984
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
23592
23985
|
roots.push(abs);
|
|
23593
23986
|
}
|
|
@@ -23598,7 +23991,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23598
23991
|
continue;
|
|
23599
23992
|
if (entry.name.startsWith("."))
|
|
23600
23993
|
continue;
|
|
23601
|
-
const abs = normalizePath(
|
|
23994
|
+
const abs = normalizePath(resolve30(cwd2, entry.name));
|
|
23602
23995
|
if (roots.includes(abs))
|
|
23603
23996
|
continue;
|
|
23604
23997
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -23682,7 +24075,7 @@ var init_pathUtils = __esm(() => {
|
|
|
23682
24075
|
// src/dev/fileWatcher.ts
|
|
23683
24076
|
import { watch } from "fs";
|
|
23684
24077
|
import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
23685
|
-
import { dirname as
|
|
24078
|
+
import { dirname as dirname23, join as join40, resolve as resolve31 } from "path";
|
|
23686
24079
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
23687
24080
|
try {
|
|
23688
24081
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -23714,7 +24107,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23714
24107
|
for (const name of entries) {
|
|
23715
24108
|
if (shouldSkipFilename(name, isStylesDir))
|
|
23716
24109
|
continue;
|
|
23717
|
-
const child =
|
|
24110
|
+
const child = join40(eventDir, name).replace(/\\/g, "/");
|
|
23718
24111
|
let st2;
|
|
23719
24112
|
try {
|
|
23720
24113
|
st2 = statSync4(child);
|
|
@@ -23735,7 +24128,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23735
24128
|
return;
|
|
23736
24129
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
23737
24130
|
if (event === "rename") {
|
|
23738
|
-
const eventDir =
|
|
24131
|
+
const eventDir = dirname23(join40(absolutePath, filename)).replace(/\\/g, "/");
|
|
23739
24132
|
atomicRecoveryScan(eventDir);
|
|
23740
24133
|
for (const delay of [25, 100]) {
|
|
23741
24134
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -23744,7 +24137,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23744
24137
|
}
|
|
23745
24138
|
return;
|
|
23746
24139
|
}
|
|
23747
|
-
const fullPath =
|
|
24140
|
+
const fullPath = join40(absolutePath, filename).replace(/\\/g, "/");
|
|
23748
24141
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
23749
24142
|
return;
|
|
23750
24143
|
}
|
|
@@ -23762,7 +24155,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23762
24155
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
23763
24156
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23764
24157
|
paths.forEach((path) => {
|
|
23765
|
-
const absolutePath =
|
|
24158
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23766
24159
|
if (!existsSync31(absolutePath)) {
|
|
23767
24160
|
return;
|
|
23768
24161
|
}
|
|
@@ -23773,7 +24166,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23773
24166
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
23774
24167
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
23775
24168
|
watchPaths.forEach((path) => {
|
|
23776
|
-
const absolutePath =
|
|
24169
|
+
const absolutePath = resolve31(path).replace(/\\/g, "/");
|
|
23777
24170
|
if (!existsSync31(absolutePath)) {
|
|
23778
24171
|
return;
|
|
23779
24172
|
}
|
|
@@ -23792,13 +24185,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
23792
24185
|
});
|
|
23793
24186
|
|
|
23794
24187
|
// src/dev/assetStore.ts
|
|
23795
|
-
import { resolve as
|
|
24188
|
+
import { resolve as resolve32 } from "path";
|
|
23796
24189
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
23797
24190
|
var mimeTypes, getMimeType = (filePath) => {
|
|
23798
24191
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
23799
24192
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
23800
24193
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
23801
|
-
const fullPath =
|
|
24194
|
+
const fullPath = resolve32(dir, entry.name);
|
|
23802
24195
|
if (entry.isDirectory()) {
|
|
23803
24196
|
return walkAndClean(fullPath);
|
|
23804
24197
|
}
|
|
@@ -23814,10 +24207,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23814
24207
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
23815
24208
|
const liveByIdentity = new Map;
|
|
23816
24209
|
for (const webPath of store.keys()) {
|
|
23817
|
-
const diskPath =
|
|
24210
|
+
const diskPath = resolve32(buildDir, webPath.slice(1));
|
|
23818
24211
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
23819
24212
|
}
|
|
23820
|
-
const absBuildDir =
|
|
24213
|
+
const absBuildDir = resolve32(buildDir);
|
|
23821
24214
|
Object.values(manifest).forEach((val) => {
|
|
23822
24215
|
if (!HASHED_FILE_RE.test(val))
|
|
23823
24216
|
return;
|
|
@@ -23835,7 +24228,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23835
24228
|
} catch {}
|
|
23836
24229
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
23837
24230
|
if (entry.isDirectory()) {
|
|
23838
|
-
return scanDir(
|
|
24231
|
+
return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
|
|
23839
24232
|
}
|
|
23840
24233
|
if (!entry.name.startsWith("chunk-")) {
|
|
23841
24234
|
return null;
|
|
@@ -23844,7 +24237,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23844
24237
|
if (store.has(webPath)) {
|
|
23845
24238
|
return null;
|
|
23846
24239
|
}
|
|
23847
|
-
return Bun.file(
|
|
24240
|
+
return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
|
|
23848
24241
|
store.set(webPath, bytes);
|
|
23849
24242
|
return;
|
|
23850
24243
|
}).catch(() => {});
|
|
@@ -23866,7 +24259,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
23866
24259
|
for (const webPath of newIdentities.values()) {
|
|
23867
24260
|
if (store.has(webPath))
|
|
23868
24261
|
continue;
|
|
23869
|
-
loadPromises.push(Bun.file(
|
|
24262
|
+
loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
23870
24263
|
store.set(webPath, bytes);
|
|
23871
24264
|
return;
|
|
23872
24265
|
}).catch(() => {}));
|
|
@@ -23911,8 +24304,8 @@ var init_assetStore = __esm(() => {
|
|
|
23911
24304
|
});
|
|
23912
24305
|
|
|
23913
24306
|
// src/islands/pageMetadata.ts
|
|
23914
|
-
import { readFileSync as
|
|
23915
|
-
import { dirname as
|
|
24307
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
24308
|
+
import { dirname as dirname24, resolve as resolve33 } from "path";
|
|
23916
24309
|
var pagePatterns, getPageDirs = (config) => [
|
|
23917
24310
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
23918
24311
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -23932,15 +24325,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23932
24325
|
const source = definition.buildReference?.source;
|
|
23933
24326
|
if (!source)
|
|
23934
24327
|
continue;
|
|
23935
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
23936
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
24328
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname24(buildInfo.resolvedRegistryPath), source);
|
|
24329
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
|
|
23937
24330
|
}
|
|
23938
24331
|
return lookup;
|
|
23939
24332
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
23940
24333
|
const candidate = usage.source;
|
|
23941
|
-
return candidate ?
|
|
24334
|
+
return candidate ? resolve33(candidate) === target : false;
|
|
23942
24335
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
23943
|
-
const target =
|
|
24336
|
+
const target = resolve33(sourcePath);
|
|
23944
24337
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
23945
24338
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
23946
24339
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -23952,13 +24345,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
23952
24345
|
const pattern = pagePatterns[entry.framework];
|
|
23953
24346
|
if (!pattern)
|
|
23954
24347
|
return;
|
|
23955
|
-
const files = await scanEntryPoints(
|
|
24348
|
+
const files = await scanEntryPoints(resolve33(entry.dir), pattern);
|
|
23956
24349
|
for (const filePath of files) {
|
|
23957
|
-
const source =
|
|
24350
|
+
const source = readFileSync25(filePath, "utf-8");
|
|
23958
24351
|
const islands = extractIslandUsagesFromSource(source);
|
|
23959
|
-
pageMetadata.set(
|
|
24352
|
+
pageMetadata.set(resolve33(filePath), {
|
|
23960
24353
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
23961
|
-
pagePath:
|
|
24354
|
+
pagePath: resolve33(filePath)
|
|
23962
24355
|
});
|
|
23963
24356
|
}
|
|
23964
24357
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -23985,10 +24378,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
23985
24378
|
});
|
|
23986
24379
|
|
|
23987
24380
|
// src/dev/fileHashTracker.ts
|
|
23988
|
-
import { readFileSync as
|
|
24381
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
23989
24382
|
var computeFileHash = (filePath) => {
|
|
23990
24383
|
try {
|
|
23991
|
-
const fileContent =
|
|
24384
|
+
const fileContent = readFileSync26(filePath);
|
|
23992
24385
|
return Number(Bun.hash(fileContent));
|
|
23993
24386
|
} catch {
|
|
23994
24387
|
return UNFOUND_INDEX;
|
|
@@ -24024,9 +24417,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
|
|
|
24024
24417
|
set.add(filePath);
|
|
24025
24418
|
}
|
|
24026
24419
|
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
24027
|
-
const
|
|
24028
|
-
if (
|
|
24029
|
-
return
|
|
24420
|
+
const component2 = [...parents].find(isComponentFile);
|
|
24421
|
+
if (component2 !== undefined)
|
|
24422
|
+
return component2;
|
|
24030
24423
|
for (const parent of parents)
|
|
24031
24424
|
queue.push(parent);
|
|
24032
24425
|
return;
|
|
@@ -24081,9 +24474,9 @@ var init_transformCache = __esm(() => {
|
|
|
24081
24474
|
});
|
|
24082
24475
|
|
|
24083
24476
|
// src/dev/reactComponentClassifier.ts
|
|
24084
|
-
import { resolve as
|
|
24477
|
+
import { resolve as resolve34 } from "path";
|
|
24085
24478
|
var classifyComponent = (filePath) => {
|
|
24086
|
-
const normalizedPath =
|
|
24479
|
+
const normalizedPath = resolve34(filePath);
|
|
24087
24480
|
if (normalizedPath.includes("/react/pages/")) {
|
|
24088
24481
|
return "server";
|
|
24089
24482
|
}
|
|
@@ -24095,7 +24488,7 @@ var classifyComponent = (filePath) => {
|
|
|
24095
24488
|
var init_reactComponentClassifier = () => {};
|
|
24096
24489
|
|
|
24097
24490
|
// src/dev/moduleMapper.ts
|
|
24098
|
-
import { basename as basename15, resolve as
|
|
24491
|
+
import { basename as basename15, resolve as resolve35 } from "path";
|
|
24099
24492
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
24100
24493
|
const modulePaths = {};
|
|
24101
24494
|
moduleKeys.forEach((key) => {
|
|
@@ -24105,7 +24498,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24105
24498
|
});
|
|
24106
24499
|
return modulePaths;
|
|
24107
24500
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
24108
|
-
const normalizedFile =
|
|
24501
|
+
const normalizedFile = resolve35(sourceFile);
|
|
24109
24502
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
24110
24503
|
if (processedFiles.has(normalizedFile)) {
|
|
24111
24504
|
return null;
|
|
@@ -24141,7 +24534,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
24141
24534
|
});
|
|
24142
24535
|
return grouped;
|
|
24143
24536
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
24144
|
-
const normalizedFile =
|
|
24537
|
+
const normalizedFile = resolve35(sourceFile);
|
|
24145
24538
|
const fileName = basename15(normalizedFile);
|
|
24146
24539
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
24147
24540
|
const pascalName = toPascal(baseName);
|
|
@@ -24197,7 +24590,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
24197
24590
|
|
|
24198
24591
|
// src/utils/spaRouteCss.ts
|
|
24199
24592
|
import { readFile as readFile6 } from "fs/promises";
|
|
24200
|
-
import { dirname as
|
|
24593
|
+
import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve36 } from "path";
|
|
24201
24594
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
24202
24595
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
24203
24596
|
if (cached !== undefined)
|
|
@@ -24235,7 +24628,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
24235
24628
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
24236
24629
|
if (!cssPath)
|
|
24237
24630
|
return "";
|
|
24238
|
-
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath :
|
|
24631
|
+
const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve36(dirname25(sideManifestPath), cssPath);
|
|
24239
24632
|
const cached = childCssCache.get(resolvedCssPath);
|
|
24240
24633
|
if (cached !== undefined)
|
|
24241
24634
|
return cached;
|
|
@@ -24318,8 +24711,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
24318
24711
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
24319
24712
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
24320
24713
|
});
|
|
24321
|
-
import { readdirSync as readdirSync8, readFileSync as
|
|
24322
|
-
import { dirname as
|
|
24714
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
|
|
24715
|
+
import { dirname as dirname26, extname as extname11, join as join41, resolve as resolve37 } from "path";
|
|
24323
24716
|
import ts18 from "typescript";
|
|
24324
24717
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
24325
24718
|
const out = [];
|
|
@@ -24334,7 +24727,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24334
24727
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
24335
24728
|
continue;
|
|
24336
24729
|
}
|
|
24337
|
-
const full =
|
|
24730
|
+
const full = join41(dir, entry.name);
|
|
24338
24731
|
if (entry.isDirectory()) {
|
|
24339
24732
|
visit(full);
|
|
24340
24733
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -24378,7 +24771,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24378
24771
|
}, parseDecoratedClasses = (filePath) => {
|
|
24379
24772
|
let source;
|
|
24380
24773
|
try {
|
|
24381
|
-
source =
|
|
24774
|
+
source = readFileSync27(filePath, "utf8");
|
|
24382
24775
|
} catch {
|
|
24383
24776
|
return [];
|
|
24384
24777
|
}
|
|
@@ -24432,7 +24825,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24432
24825
|
};
|
|
24433
24826
|
visit(sourceFile);
|
|
24434
24827
|
return out;
|
|
24435
|
-
}, safeNormalize = (path) =>
|
|
24828
|
+
}, safeNormalize = (path) => resolve37(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
24436
24829
|
const { changedFilePath, userAngularRoot } = params;
|
|
24437
24830
|
const changedAbs = safeNormalize(changedFilePath);
|
|
24438
24831
|
const out = [];
|
|
@@ -24468,12 +24861,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24468
24861
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
24469
24862
|
let source;
|
|
24470
24863
|
try {
|
|
24471
|
-
source =
|
|
24864
|
+
source = readFileSync27(childFilePath, "utf8");
|
|
24472
24865
|
} catch {
|
|
24473
24866
|
return null;
|
|
24474
24867
|
}
|
|
24475
24868
|
const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
|
|
24476
|
-
const childDir =
|
|
24869
|
+
const childDir = dirname26(childFilePath);
|
|
24477
24870
|
for (const stmt of sourceFile.statements) {
|
|
24478
24871
|
if (!ts18.isImportDeclaration(stmt))
|
|
24479
24872
|
continue;
|
|
@@ -24501,7 +24894,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24501
24894
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
24502
24895
|
return null;
|
|
24503
24896
|
}
|
|
24504
|
-
const base =
|
|
24897
|
+
const base = resolve37(childDir, spec);
|
|
24505
24898
|
const candidates = [
|
|
24506
24899
|
`${base}.ts`,
|
|
24507
24900
|
`${base}.tsx`,
|
|
@@ -24530,7 +24923,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24530
24923
|
const parentFile = new Map;
|
|
24531
24924
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
24532
24925
|
const classes = parseDecoratedClasses(tsPath);
|
|
24533
|
-
const componentDir =
|
|
24926
|
+
const componentDir = dirname26(tsPath);
|
|
24534
24927
|
for (const cls of classes) {
|
|
24535
24928
|
const entity = {
|
|
24536
24929
|
className: cls.className,
|
|
@@ -24539,7 +24932,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24539
24932
|
};
|
|
24540
24933
|
if (cls.kind === "component") {
|
|
24541
24934
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
24542
|
-
const abs = safeNormalize(
|
|
24935
|
+
const abs = safeNormalize(resolve37(componentDir, url));
|
|
24543
24936
|
const existing = resource.get(abs);
|
|
24544
24937
|
if (existing)
|
|
24545
24938
|
existing.push(entity);
|
|
@@ -24799,7 +25192,7 @@ __export(exports_loadConfig, {
|
|
|
24799
25192
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
24800
25193
|
getWorkspaceServices: () => getWorkspaceServices
|
|
24801
25194
|
});
|
|
24802
|
-
import { resolve as
|
|
25195
|
+
import { resolve as resolve38 } from "path";
|
|
24803
25196
|
var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
24804
25197
|
if (!isObject2(config)) {
|
|
24805
25198
|
return false;
|
|
@@ -24850,7 +25243,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
|
|
|
24850
25243
|
}
|
|
24851
25244
|
return config;
|
|
24852
25245
|
}, loadRawConfig = async (configPath2) => {
|
|
24853
|
-
const resolved =
|
|
25246
|
+
const resolved = resolve38(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
24854
25247
|
const mod = await import(resolved);
|
|
24855
25248
|
const config = mod.default ?? mod.config;
|
|
24856
25249
|
if (!config) {
|
|
@@ -24912,8 +25305,8 @@ __export(exports_moduleServer, {
|
|
|
24912
25305
|
createModuleServer: () => createModuleServer,
|
|
24913
25306
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
24914
25307
|
});
|
|
24915
|
-
import { existsSync as existsSync32, readFileSync as
|
|
24916
|
-
import { basename as basename16, dirname as
|
|
25308
|
+
import { existsSync as existsSync32, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25309
|
+
import { basename as basename16, dirname as dirname27, extname as extname12, join as join42, resolve as resolve39, relative as relative16 } from "path";
|
|
24917
25310
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
24918
25311
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
24919
25312
|
const allExports = [];
|
|
@@ -24933,10 +25326,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
24933
25326
|
${stubs}
|
|
24934
25327
|
`;
|
|
24935
25328
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
24936
|
-
const directHit = extensions.find((ext) => existsSync32(
|
|
25329
|
+
const directHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
|
|
24937
25330
|
if (directHit)
|
|
24938
25331
|
return srcPath + directHit;
|
|
24939
|
-
const indexHit = extensions.find((ext) => existsSync32(
|
|
25332
|
+
const indexHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath, `index${ext}`)));
|
|
24940
25333
|
if (indexHit)
|
|
24941
25334
|
return `${srcPath}/index${indexHit}`;
|
|
24942
25335
|
return srcPath;
|
|
@@ -24959,7 +25352,7 @@ ${stubs}
|
|
|
24959
25352
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
24960
25353
|
}, srcUrl = (relPath, projectRoot) => {
|
|
24961
25354
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
24962
|
-
const absPath =
|
|
25355
|
+
const absPath = resolve39(projectRoot, relPath);
|
|
24963
25356
|
const cached = mtimeCache.get(absPath);
|
|
24964
25357
|
if (cached !== undefined)
|
|
24965
25358
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -24971,12 +25364,12 @@ ${stubs}
|
|
|
24971
25364
|
return base;
|
|
24972
25365
|
}
|
|
24973
25366
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
24974
|
-
const absPath =
|
|
25367
|
+
const absPath = resolve39(fileDir, relPath);
|
|
24975
25368
|
const rel = relative16(projectRoot, absPath);
|
|
24976
25369
|
const extension = extname12(rel);
|
|
24977
25370
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
24978
25371
|
if (extname12(srcPath) === ".svelte") {
|
|
24979
|
-
srcPath = relative16(projectRoot, resolveSvelteModulePath(
|
|
25372
|
+
srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
|
|
24980
25373
|
}
|
|
24981
25374
|
return srcUrl(srcPath, projectRoot);
|
|
24982
25375
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -24995,13 +25388,13 @@ ${stubs}
|
|
|
24995
25388
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
24996
25389
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
24997
25390
|
if (!subpath) {
|
|
24998
|
-
const pkgDir =
|
|
24999
|
-
const pkgJsonPath =
|
|
25391
|
+
const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
|
|
25392
|
+
const pkgJsonPath = join42(pkgDir, "package.json");
|
|
25000
25393
|
if (existsSync32(pkgJsonPath)) {
|
|
25001
|
-
const pkg = JSON.parse(
|
|
25394
|
+
const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
|
|
25002
25395
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25003
25396
|
if (esmEntry) {
|
|
25004
|
-
const resolved =
|
|
25397
|
+
const resolved = resolve39(pkgDir, esmEntry);
|
|
25005
25398
|
if (existsSync32(resolved))
|
|
25006
25399
|
return relative16(projectRoot, resolved);
|
|
25007
25400
|
}
|
|
@@ -25039,7 +25432,7 @@ ${stubs}
|
|
|
25039
25432
|
};
|
|
25040
25433
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
25041
25434
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
25042
|
-
const fileDir =
|
|
25435
|
+
const fileDir = dirname27(filePath);
|
|
25043
25436
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25044
25437
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
25045
25438
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -25054,12 +25447,12 @@ ${stubs}
|
|
|
25054
25447
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
25055
25448
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
25056
25449
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
25057
|
-
const absPath =
|
|
25450
|
+
const absPath = resolve39(fileDir, relPath);
|
|
25058
25451
|
const rel = relative16(projectRoot, absPath);
|
|
25059
25452
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
25060
25453
|
});
|
|
25061
25454
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
25062
|
-
const absPath =
|
|
25455
|
+
const absPath = resolve39(fileDir, relPath);
|
|
25063
25456
|
const rel = relative16(projectRoot, absPath);
|
|
25064
25457
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
25065
25458
|
});
|
|
@@ -25105,7 +25498,7 @@ ${code}`;
|
|
|
25105
25498
|
reactFastRefreshWarningEmitted = true;
|
|
25106
25499
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a targeted " + "page remount instead of a state-preserving fast refresh.");
|
|
25107
25500
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
25108
|
-
const raw =
|
|
25501
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25109
25502
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
25110
25503
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
25111
25504
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -25121,7 +25514,7 @@ ${transpiled}`;
|
|
|
25121
25514
|
transpiled += buildIslandMetadataExports(raw);
|
|
25122
25515
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
25123
25516
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
25124
|
-
const raw =
|
|
25517
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25125
25518
|
const ext = extname12(filePath);
|
|
25126
25519
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
25127
25520
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -25287,7 +25680,7 @@ ${code}`;
|
|
|
25287
25680
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
25288
25681
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
25289
25682
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
25290
|
-
const raw =
|
|
25683
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25291
25684
|
if (!svelteCompiler) {
|
|
25292
25685
|
svelteCompiler = await import("svelte/compiler");
|
|
25293
25686
|
}
|
|
@@ -25353,7 +25746,7 @@ export default __script__;`;
|
|
|
25353
25746
|
return `${cssInjection}
|
|
25354
25747
|
${code}`;
|
|
25355
25748
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
25356
|
-
const rawSource =
|
|
25749
|
+
const rawSource = readFileSync28(filePath, "utf-8");
|
|
25357
25750
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
25358
25751
|
if (!vueCompiler) {
|
|
25359
25752
|
vueCompiler = await loadVueCompiler();
|
|
@@ -25366,7 +25759,7 @@ ${code}`;
|
|
|
25366
25759
|
fs: {
|
|
25367
25760
|
fileExists: existsSync32,
|
|
25368
25761
|
realpath: realpathSync3,
|
|
25369
|
-
readFile: (file4) => existsSync32(file4) ?
|
|
25762
|
+
readFile: (file4) => existsSync32(file4) ? readFileSync28(file4, "utf-8") : undefined
|
|
25370
25763
|
},
|
|
25371
25764
|
id: componentId,
|
|
25372
25765
|
inlineTemplate: false
|
|
@@ -25381,7 +25774,7 @@ ${code}`;
|
|
|
25381
25774
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
25382
25775
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
25383
25776
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
25384
|
-
const hmrBase = vueDir ?
|
|
25777
|
+
const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
|
|
25385
25778
|
const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
25386
25779
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
25387
25780
|
result += [
|
|
@@ -25413,7 +25806,7 @@ ${code}`;
|
|
|
25413
25806
|
}
|
|
25414
25807
|
});
|
|
25415
25808
|
}, handleCssRequest = (filePath) => {
|
|
25416
|
-
const raw =
|
|
25809
|
+
const raw = readFileSync28(filePath, "utf-8");
|
|
25417
25810
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25418
25811
|
return [
|
|
25419
25812
|
`const style = document.createElement('style');`,
|
|
@@ -25545,7 +25938,7 @@ export default {};
|
|
|
25545
25938
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
25546
25939
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
25547
25940
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
25548
|
-
const filePath =
|
|
25941
|
+
const filePath = resolve39(projectRoot, relPath);
|
|
25549
25942
|
const ext = extname12(filePath);
|
|
25550
25943
|
if (ext === ".svelte")
|
|
25551
25944
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -25582,14 +25975,14 @@ export default {};
|
|
|
25582
25975
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
25583
25976
|
const candidates = [
|
|
25584
25977
|
absoluteCandidate,
|
|
25585
|
-
|
|
25978
|
+
resolve39(projectRoot, tail)
|
|
25586
25979
|
];
|
|
25587
25980
|
try {
|
|
25588
25981
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
25589
25982
|
const cfg = await loadConfig2();
|
|
25590
|
-
const angularDir = cfg.angularDirectory &&
|
|
25983
|
+
const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
|
|
25591
25984
|
if (angularDir)
|
|
25592
|
-
candidates.push(
|
|
25985
|
+
candidates.push(resolve39(angularDir, tail));
|
|
25593
25986
|
} catch {}
|
|
25594
25987
|
for (const candidate of candidates) {
|
|
25595
25988
|
if (await fileExists(candidate)) {
|
|
@@ -25620,7 +26013,7 @@ export default {};
|
|
|
25620
26013
|
if (!TRANSPILABLE.has(ext))
|
|
25621
26014
|
return;
|
|
25622
26015
|
const stat3 = statSync6(filePath);
|
|
25623
|
-
const resolvedVueDir = vueDir ?
|
|
26016
|
+
const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
|
|
25624
26017
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
25625
26018
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
25626
26019
|
if (isAngularGeneratedJs) {
|
|
@@ -25679,7 +26072,7 @@ export default {};
|
|
|
25679
26072
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
25680
26073
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
25681
26074
|
return handleBunWrapRequest();
|
|
25682
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
26075
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
|
|
25683
26076
|
if (virtualCssResponse)
|
|
25684
26077
|
return virtualCssResponse;
|
|
25685
26078
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -25695,11 +26088,11 @@ export default {};
|
|
|
25695
26088
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
25696
26089
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
25697
26090
|
if (match[1])
|
|
25698
|
-
files.push(
|
|
26091
|
+
files.push(resolve39(projectRoot, match[1]));
|
|
25699
26092
|
}
|
|
25700
26093
|
return files;
|
|
25701
26094
|
}, invalidateModule = (filePath) => {
|
|
25702
|
-
const resolved =
|
|
26095
|
+
const resolved = resolve39(filePath);
|
|
25703
26096
|
invalidate(filePath);
|
|
25704
26097
|
if (resolved !== filePath)
|
|
25705
26098
|
invalidate(resolved);
|
|
@@ -25862,7 +26255,7 @@ __export(exports_hmrCompiler, {
|
|
|
25862
26255
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
25863
26256
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
25864
26257
|
});
|
|
25865
|
-
import { dirname as
|
|
26258
|
+
import { dirname as dirname28, relative as relative17, resolve as resolve40 } from "path";
|
|
25866
26259
|
import { performance as performance2 } from "perf_hooks";
|
|
25867
26260
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
25868
26261
|
const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -25874,7 +26267,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25874
26267
|
return null;
|
|
25875
26268
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25876
26269
|
const className = decoded.slice(separatorIndex + 1);
|
|
25877
|
-
const componentFilePath =
|
|
26270
|
+
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
25878
26271
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25879
26272
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
25880
26273
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -25885,7 +26278,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25885
26278
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
25886
26279
|
const owners = resolveOwningComponents2({
|
|
25887
26280
|
changedFilePath: componentFilePath,
|
|
25888
|
-
userAngularRoot:
|
|
26281
|
+
userAngularRoot: dirname28(componentFilePath)
|
|
25889
26282
|
});
|
|
25890
26283
|
const owner = owners.find((o3) => o3.className === className);
|
|
25891
26284
|
const kind = owner?.kind ?? "component";
|
|
@@ -26080,11 +26473,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
26080
26473
|
__export(exports_simpleHTMLHMR, {
|
|
26081
26474
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
26082
26475
|
});
|
|
26083
|
-
import { resolve as
|
|
26476
|
+
import { resolve as resolve41 } from "path";
|
|
26084
26477
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
26085
26478
|
let htmlContent;
|
|
26086
26479
|
try {
|
|
26087
|
-
const resolvedPath =
|
|
26480
|
+
const resolvedPath = resolve41(htmlFilePath);
|
|
26088
26481
|
const file4 = Bun.file(resolvedPath);
|
|
26089
26482
|
if (!await file4.exists()) {
|
|
26090
26483
|
return null;
|
|
@@ -26110,11 +26503,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
26110
26503
|
__export(exports_simpleHTMXHMR, {
|
|
26111
26504
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
26112
26505
|
});
|
|
26113
|
-
import { resolve as
|
|
26506
|
+
import { resolve as resolve42 } from "path";
|
|
26114
26507
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
26115
26508
|
let htmlContent;
|
|
26116
26509
|
try {
|
|
26117
|
-
const resolvedPath =
|
|
26510
|
+
const resolvedPath = resolve42(htmxFilePath);
|
|
26118
26511
|
const file4 = Bun.file(resolvedPath);
|
|
26119
26512
|
if (!await file4.exists()) {
|
|
26120
26513
|
return null;
|
|
@@ -26139,9 +26532,9 @@ var init_simpleHTMXHMR = () => {};
|
|
|
26139
26532
|
import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
26140
26533
|
import {
|
|
26141
26534
|
basename as basename17,
|
|
26142
|
-
dirname as
|
|
26535
|
+
dirname as dirname29,
|
|
26143
26536
|
isAbsolute as isAbsolute6,
|
|
26144
|
-
join as
|
|
26537
|
+
join as join43,
|
|
26145
26538
|
relative as relative18,
|
|
26146
26539
|
resolve as resolvePath,
|
|
26147
26540
|
sep as sep4
|
|
@@ -26268,8 +26661,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26268
26661
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
26269
26662
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
26270
26663
|
for (const candidate of [
|
|
26271
|
-
|
|
26272
|
-
`${
|
|
26664
|
+
join43(generatedDir, relJs),
|
|
26665
|
+
`${join43(generatedDir, relJs)}.map`
|
|
26273
26666
|
]) {
|
|
26274
26667
|
try {
|
|
26275
26668
|
rmSync3(candidate, { force: true });
|
|
@@ -26504,7 +26897,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26504
26897
|
const { buildDir } = state.resolvedPaths;
|
|
26505
26898
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
26506
26899
|
const { mkdir: mkdir9, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
26507
|
-
await mkdir9(
|
|
26900
|
+
await mkdir9(dirname29(destPath), { recursive: true });
|
|
26508
26901
|
await copyFile(absSource, destPath);
|
|
26509
26902
|
const bytes = await readFile7(destPath);
|
|
26510
26903
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -26685,7 +27078,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26685
27078
|
const keepStemsByDir = new Map;
|
|
26686
27079
|
const prefixByDir = new Map;
|
|
26687
27080
|
for (const artifact of freshOutputs) {
|
|
26688
|
-
const dir =
|
|
27081
|
+
const dir = dirname29(artifact.path);
|
|
26689
27082
|
const name = basename17(artifact.path);
|
|
26690
27083
|
const [prefix] = name.split(".");
|
|
26691
27084
|
if (!prefix)
|
|
@@ -27048,8 +27441,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27048
27441
|
};
|
|
27049
27442
|
return ({ immediate = false } = {}) => {
|
|
27050
27443
|
if (!ctx.debouncedPromise) {
|
|
27051
|
-
ctx.debouncedPromise = new Promise((
|
|
27052
|
-
ctx.debouncedResolve =
|
|
27444
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
27445
|
+
ctx.debouncedResolve = resolve43;
|
|
27053
27446
|
});
|
|
27054
27447
|
}
|
|
27055
27448
|
const scheduled = ctx.debouncedPromise;
|
|
@@ -27171,7 +27564,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27171
27564
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
27172
27565
|
const files = [];
|
|
27173
27566
|
for (const entry of entries) {
|
|
27174
|
-
const full =
|
|
27567
|
+
const full = join43(dir, entry.name);
|
|
27175
27568
|
if (entry.isDirectory()) {
|
|
27176
27569
|
files.push(...await walk(full));
|
|
27177
27570
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -27581,8 +27974,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27581
27974
|
};
|
|
27582
27975
|
return () => {
|
|
27583
27976
|
if (!ctx.debouncedPromise) {
|
|
27584
|
-
ctx.debouncedPromise = new Promise((
|
|
27585
|
-
ctx.debouncedResolve =
|
|
27977
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
27978
|
+
ctx.debouncedResolve = resolve43;
|
|
27586
27979
|
});
|
|
27587
27980
|
}
|
|
27588
27981
|
if (ctx.debounceTimer)
|
|
@@ -27731,7 +28124,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27731
28124
|
} = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
27732
28125
|
const serverEntries = [...vueServerPaths];
|
|
27733
28126
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
27734
|
-
const cssOutDir =
|
|
28127
|
+
const cssOutDir = join43(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
27735
28128
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
27736
28129
|
const serverExternals = await getServerBundleExternals();
|
|
27737
28130
|
const clientVendorPaths = await getClientVendorPaths();
|
|
@@ -27856,8 +28249,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27856
28249
|
};
|
|
27857
28250
|
return () => {
|
|
27858
28251
|
if (!ctx.debouncedPromise) {
|
|
27859
|
-
ctx.debouncedPromise = new Promise((
|
|
27860
|
-
ctx.debouncedResolve =
|
|
28252
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
28253
|
+
ctx.debouncedResolve = resolve43;
|
|
27861
28254
|
});
|
|
27862
28255
|
}
|
|
27863
28256
|
if (ctx.debounceTimer)
|
|
@@ -28007,7 +28400,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28007
28400
|
if (!buildReference?.source) {
|
|
28008
28401
|
return;
|
|
28009
28402
|
}
|
|
28010
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(
|
|
28403
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname29(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
28011
28404
|
islandFiles.add(resolvePath(sourcePath));
|
|
28012
28405
|
}, resolveIslandSourceFiles = async (config) => {
|
|
28013
28406
|
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 join44 } from "path";
|
|
28844
29237
|
import { rm as rm11 } 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: readFileSync29 } = await import("fs");
|
|
29296
|
+
const { dirname: dirname30 } = 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 = readFileSync29(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 = dirname30(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 = join44(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 = join44(buildDir, "vendor");
|
|
29084
29477
|
mkdirSync14(vendorDir, { recursive: true });
|
|
29085
|
-
const tmpDir =
|
|
29478
|
+
const tmpDir = join44(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 readdir5 } from "fs/promises";
|
|
29167
29560
|
import { statSync as statSync7 } from "fs";
|
|
29168
|
-
import { resolve as
|
|
29561
|
+
import { resolve as resolve43 } 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 = resolve43(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(resolve43(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
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
29734
|
+
resolve43(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 readdir5(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(resolve43(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 = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
29900
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
29901
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
29902
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
29903
|
+
const depVendorDir = resolve43(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(resolve43(Bun.main)).mtimeMs;
|
|
29589
29982
|
return result;
|
|
29590
29983
|
};
|
|
29591
29984
|
var init_devBuild = __esm(() => {
|
|
@@ -29622,5 +30015,5 @@ export {
|
|
|
29622
30015
|
build
|
|
29623
30016
|
};
|
|
29624
30017
|
|
|
29625
|
-
//# debugId=
|
|
30018
|
+
//# debugId=EC44DCC5E5B34B8F64756E2164756E21
|
|
29626
30019
|
//# sourceMappingURL=build.js.map
|