@absolutejs/absolute 0.19.0-beta.973 → 0.19.0-beta.975
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +486 -465
- package/dist/build.js.map +7 -7
- package/dist/index.js +496 -475
- package/dist/index.js.map +7 -7
- package/dist/src/build/emitAngularProvidersFiles.d.ts +2 -2
- package/dist/src/build/runAngularHandlerScan.d.ts +9 -0
- package/dist/src/build/scanAngularPageRoutes.d.ts +0 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11859,118 +11859,27 @@ var validateSafePath = (targetPath, baseDirectory) => {
|
|
|
11859
11859
|
};
|
|
11860
11860
|
var init_validateSafePath = () => {};
|
|
11861
11861
|
|
|
11862
|
-
// src/build/scanAngularPageRoutes.ts
|
|
11863
|
-
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
11864
|
-
import { basename as basename6, join as join23, relative as relative9 } from "path";
|
|
11865
|
-
import ts6 from "typescript";
|
|
11866
|
-
var SOURCE_EXTENSIONS2, SKIP_DIRS2, hasSourceExtension2 = (filePath) => {
|
|
11867
|
-
const idx = filePath.lastIndexOf(".");
|
|
11868
|
-
if (idx === -1)
|
|
11869
|
-
return false;
|
|
11870
|
-
return SOURCE_EXTENSIONS2.has(filePath.slice(idx));
|
|
11871
|
-
}, isPageFile = (filePath) => {
|
|
11872
|
-
if (!hasSourceExtension2(filePath))
|
|
11873
|
-
return false;
|
|
11874
|
-
const base = basename6(filePath);
|
|
11875
|
-
if (base.endsWith(".d.ts"))
|
|
11876
|
-
return false;
|
|
11877
|
-
if (base.endsWith(".test.ts"))
|
|
11878
|
-
return false;
|
|
11879
|
-
if (base.endsWith(".spec.ts"))
|
|
11880
|
-
return false;
|
|
11881
|
-
return true;
|
|
11882
|
-
}, collectPageFiles = (pagesRoot) => {
|
|
11883
|
-
const out = [];
|
|
11884
|
-
const stack = [pagesRoot];
|
|
11885
|
-
while (stack.length > 0) {
|
|
11886
|
-
const dir = stack.pop();
|
|
11887
|
-
if (!dir)
|
|
11888
|
-
continue;
|
|
11889
|
-
let entries;
|
|
11890
|
-
try {
|
|
11891
|
-
entries = readdirSync2(dir, {
|
|
11892
|
-
encoding: "utf-8",
|
|
11893
|
-
withFileTypes: true
|
|
11894
|
-
});
|
|
11895
|
-
} catch {
|
|
11896
|
-
continue;
|
|
11897
|
-
}
|
|
11898
|
-
for (const entry of entries) {
|
|
11899
|
-
if (entry.isDirectory()) {
|
|
11900
|
-
if (SKIP_DIRS2.has(entry.name))
|
|
11901
|
-
continue;
|
|
11902
|
-
if (entry.name.startsWith("."))
|
|
11903
|
-
continue;
|
|
11904
|
-
stack.push(join23(dir, entry.name));
|
|
11905
|
-
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
11906
|
-
out.push(join23(dir, entry.name));
|
|
11907
|
-
}
|
|
11908
|
-
}
|
|
11909
|
-
}
|
|
11910
|
-
return out;
|
|
11911
|
-
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
11912
|
-
if (!source.includes("routes"))
|
|
11913
|
-
return false;
|
|
11914
|
-
const sf = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, ts6.ScriptKind.TS);
|
|
11915
|
-
for (const statement of sf.statements) {
|
|
11916
|
-
if (!ts6.isVariableStatement(statement))
|
|
11917
|
-
continue;
|
|
11918
|
-
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts6.SyntaxKind.ExportKeyword);
|
|
11919
|
-
if (!isExported)
|
|
11920
|
-
continue;
|
|
11921
|
-
for (const declaration of statement.declarationList.declarations) {
|
|
11922
|
-
if (!ts6.isIdentifier(declaration.name))
|
|
11923
|
-
continue;
|
|
11924
|
-
if (declaration.name.text === "routes")
|
|
11925
|
-
return true;
|
|
11926
|
-
}
|
|
11927
|
-
}
|
|
11928
|
-
return false;
|
|
11929
|
-
}, scanAngularPageRoutes = (pagesRoot) => {
|
|
11930
|
-
const files = collectPageFiles(pagesRoot);
|
|
11931
|
-
const out = [];
|
|
11932
|
-
for (const file2 of files) {
|
|
11933
|
-
let source;
|
|
11934
|
-
try {
|
|
11935
|
-
source = readFileSync14(file2, "utf-8");
|
|
11936
|
-
} catch {
|
|
11937
|
-
continue;
|
|
11938
|
-
}
|
|
11939
|
-
const hasRoutes = hasTopLevelRoutesExport(source, file2);
|
|
11940
|
-
const base = basename6(file2).replace(/\.[cm]?[tj]sx?$/, "");
|
|
11941
|
-
const manifestKey = toPascal(base);
|
|
11942
|
-
out.push({
|
|
11943
|
-
hasRoutes,
|
|
11944
|
-
manifestKey,
|
|
11945
|
-
pageFile: file2
|
|
11946
|
-
});
|
|
11947
|
-
}
|
|
11948
|
-
return out;
|
|
11949
|
-
}, relativeRoutesImport = (emittedFromDir, pageFile) => {
|
|
11950
|
-
const rel = relative9(emittedFromDir, pageFile.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
11951
|
-
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
11952
|
-
};
|
|
11953
|
-
var init_scanAngularPageRoutes = __esm(() => {
|
|
11954
|
-
SOURCE_EXTENSIONS2 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
11955
|
-
SKIP_DIRS2 = new Set([
|
|
11956
|
-
".absolutejs",
|
|
11957
|
-
".generated",
|
|
11958
|
-
".git",
|
|
11959
|
-
"build",
|
|
11960
|
-
"compiled",
|
|
11961
|
-
"dist",
|
|
11962
|
-
"node_modules"
|
|
11963
|
-
]);
|
|
11964
|
-
});
|
|
11965
|
-
|
|
11966
11862
|
// src/build/emitAngularProvidersFiles.ts
|
|
11967
11863
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "fs";
|
|
11968
|
-
import { dirname as dirname13, join as
|
|
11969
|
-
var
|
|
11864
|
+
import { dirname as dirname13, isAbsolute as isAbsolute3, join as join23, relative as relative9, resolve as resolve22 } from "path";
|
|
11865
|
+
var mapToCompiledPath = (sourceAbsPath, angularDir, angularGeneratedDir) => {
|
|
11866
|
+
const normalizedSrc = resolve22(sourceAbsPath);
|
|
11867
|
+
const normalizedAngularDir = resolve22(angularDir);
|
|
11868
|
+
if (!normalizedSrc.startsWith(`${normalizedAngularDir}/`) && normalizedSrc !== normalizedAngularDir) {
|
|
11869
|
+
return normalizedSrc;
|
|
11870
|
+
}
|
|
11871
|
+
const relPath = normalizedSrc.slice(normalizedAngularDir.length + 1);
|
|
11872
|
+
const compiledRelPath = relPath.replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11873
|
+
return join23(angularGeneratedDir, compiledRelPath);
|
|
11874
|
+
}, relativeImportSpecifier = (fromDir, targetAbsPath) => {
|
|
11875
|
+
const targetWithoutExt = targetAbsPath.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11876
|
+
const rel = relative9(fromDir, targetWithoutExt).replace(/\\/g, "/");
|
|
11877
|
+
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
11878
|
+
}, buildModuleSpecifier = (importSpec, outputPath) => {
|
|
11970
11879
|
if (!importSpec.resolvedAbsPath)
|
|
11971
11880
|
return importSpec.source;
|
|
11972
11881
|
const outputDir = dirname13(outputPath);
|
|
11973
|
-
const rel =
|
|
11882
|
+
const rel = relative9(outputDir, importSpec.resolvedAbsPath).replace(/\\/g, "/");
|
|
11974
11883
|
const withoutExt = rel.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11975
11884
|
return withoutExt.startsWith(".") ? withoutExt : `./${withoutExt}`;
|
|
11976
11885
|
}, buildImportLine = (importSpec, outputPath) => {
|
|
@@ -12016,7 +11925,7 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
12016
11925
|
}
|
|
12017
11926
|
return lines.join(`
|
|
12018
11927
|
`);
|
|
12019
|
-
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes, providersImport) => {
|
|
11928
|
+
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes, providersImport, context) => {
|
|
12020
11929
|
const sections = [];
|
|
12021
11930
|
sections.push("/* AUTOGENERATED by AbsoluteJS \u2014 see `scanAngularHandlerCalls`. */", "/* eslint-disable */");
|
|
12022
11931
|
const groups = groupImports(call.providerImports);
|
|
@@ -12027,8 +11936,8 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
12027
11936
|
}
|
|
12028
11937
|
if (providersImport) {
|
|
12029
11938
|
const outputDir = dirname13(outputPath);
|
|
12030
|
-
const
|
|
12031
|
-
const specifier =
|
|
11939
|
+
const compiledTarget = mapToCompiledPath(providersImport.absolutePath, context.angularDir, context.angularGeneratedDir);
|
|
11940
|
+
const specifier = relativeImportSpecifier(outputDir, compiledTarget);
|
|
12032
11941
|
const importClause = providersImport.importedName === providersImport.bindingName ? `{ ${providersImport.bindingName} as __globalProviders }` : `{ ${providersImport.importedName} as __globalProviders }`;
|
|
12033
11942
|
sections.push(`import ${importClause} from "${specifier}";`);
|
|
12034
11943
|
}
|
|
@@ -12036,7 +11945,8 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
12036
11945
|
sections.push(`import { APP_BASE_HREF } from "@angular/common";`, `const __basePathProvider = { provide: APP_BASE_HREF, useValue: ${JSON.stringify(basePath)} };`);
|
|
12037
11946
|
}
|
|
12038
11947
|
if (pageRoutes?.hasRoutes) {
|
|
12039
|
-
const
|
|
11948
|
+
const compiledPageTarget = mapToCompiledPath(pageRoutes.pageFile, context.angularDir, context.angularGeneratedDir);
|
|
11949
|
+
const routesImport = relativeImportSpecifier(dirname13(outputPath), compiledPageTarget);
|
|
12040
11950
|
sections.push(`import { ${["provideRouter", ...ROUTER_FEATURES_DEFAULT].join(", ")} } from "@angular/router";`, `import { routes as __pageRoutes } from "${routesImport}";`, `const __routerProvider = provideRouter(__pageRoutes, ${ROUTER_FEATURES_DEFAULT.map((name) => `${name}()`).join(", ")});`);
|
|
12041
11951
|
}
|
|
12042
11952
|
const userProvidersExpr = call.providersExpr ?? "[]";
|
|
@@ -12062,19 +11972,25 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
12062
11972
|
return null;
|
|
12063
11973
|
const trimmed = mountPath.slice(0, -1);
|
|
12064
11974
|
return trimmed === "/" ? null : trimmed;
|
|
12065
|
-
}, emitAngularProvidersFiles = (projectRoot, calls, pageRoutes, options = {}) => {
|
|
11975
|
+
}, emitAngularProvidersFiles = (projectRoot, angularDir, calls, pageRoutes, options = {}) => {
|
|
12066
11976
|
const outputDir = getProvidersOutputDir(projectRoot);
|
|
12067
11977
|
mkdirSync8(outputDir, { recursive: true });
|
|
11978
|
+
const angularGeneratedDir = getFrameworkGeneratedDir("angular", projectRoot);
|
|
11979
|
+
const resolvedAngularDir = isAbsolute3(angularDir) ? resolve22(angularDir) : resolve22(projectRoot, angularDir);
|
|
11980
|
+
const context = {
|
|
11981
|
+
angularDir: resolvedAngularDir,
|
|
11982
|
+
angularGeneratedDir
|
|
11983
|
+
};
|
|
12068
11984
|
const pageRoutesByKey = new Map;
|
|
12069
11985
|
for (const entry of pageRoutes) {
|
|
12070
11986
|
pageRoutesByKey.set(entry.manifestKey, entry);
|
|
12071
11987
|
}
|
|
12072
11988
|
const emitted = [];
|
|
12073
11989
|
for (const call of calls) {
|
|
12074
|
-
const outputPath =
|
|
11990
|
+
const outputPath = join23(outputDir, `${call.manifestKey}.providers.ts`);
|
|
12075
11991
|
const basePath = deriveBasePath(call.mountPath);
|
|
12076
11992
|
const pageRoute = pageRoutesByKey.get(call.manifestKey);
|
|
12077
|
-
const content = renderFile(call, outputPath, basePath, pageRoute, options.providersImport ?? null);
|
|
11993
|
+
const content = renderFile(call, outputPath, basePath, pageRoute, options.providersImport ?? null, context);
|
|
12078
11994
|
writeFileSync8(outputPath, content, "utf-8");
|
|
12079
11995
|
emitted.push({
|
|
12080
11996
|
basePath,
|
|
@@ -12084,10 +12000,9 @@ var buildModuleSpecifier = (importSpec, outputPath) => {
|
|
|
12084
12000
|
});
|
|
12085
12001
|
}
|
|
12086
12002
|
return emitted;
|
|
12087
|
-
}, getProvidersOutputDir = (projectRoot) =>
|
|
12003
|
+
}, getProvidersOutputDir = (projectRoot) => join23(getFrameworkGeneratedDir("angular", projectRoot), "providers");
|
|
12088
12004
|
var init_emitAngularProvidersFiles = __esm(() => {
|
|
12089
12005
|
init_generatedDir();
|
|
12090
|
-
init_scanAngularPageRoutes();
|
|
12091
12006
|
ROUTER_FEATURES_DEFAULT = [
|
|
12092
12007
|
"withComponentInputBinding",
|
|
12093
12008
|
"withViewTransitions"
|
|
@@ -12096,7 +12011,7 @@ var init_emitAngularProvidersFiles = __esm(() => {
|
|
|
12096
12011
|
|
|
12097
12012
|
// src/build/emitAngularRouteMounts.ts
|
|
12098
12013
|
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync9 } from "fs";
|
|
12099
|
-
import { join as
|
|
12014
|
+
import { join as join24 } from "path";
|
|
12100
12015
|
var deriveBasePath2 = (mountPath) => {
|
|
12101
12016
|
if (!mountPath)
|
|
12102
12017
|
return null;
|
|
@@ -12107,7 +12022,7 @@ var deriveBasePath2 = (mountPath) => {
|
|
|
12107
12022
|
}, escapeForRegex = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mountToPatternSource = (basePath) => {
|
|
12108
12023
|
const withoutTrailing = basePath.replace(/\/$/, "");
|
|
12109
12024
|
return `^${escapeForRegex(withoutTrailing)}(\\/|$)`;
|
|
12110
|
-
}, getRouteMountsOutputPath = (projectRoot) =>
|
|
12025
|
+
}, getRouteMountsOutputPath = (projectRoot) => join24(getFrameworkGeneratedDir("angular", projectRoot), "route-mounts.ts"), emitAngularRouteMounts = (projectRoot, calls) => {
|
|
12111
12026
|
const entries = [];
|
|
12112
12027
|
const seen = new Set;
|
|
12113
12028
|
for (const call of calls) {
|
|
@@ -12143,46 +12058,46 @@ var init_emitAngularRouteMounts = __esm(() => {
|
|
|
12143
12058
|
});
|
|
12144
12059
|
|
|
12145
12060
|
// src/build/parseAngularConfigImports.ts
|
|
12146
|
-
import { existsSync as existsSync20, readFileSync as
|
|
12147
|
-
import { dirname as dirname14, isAbsolute as
|
|
12148
|
-
import
|
|
12061
|
+
import { existsSync as existsSync20, readFileSync as readFileSync14 } from "fs";
|
|
12062
|
+
import { dirname as dirname14, isAbsolute as isAbsolute4, join as join25 } from "path";
|
|
12063
|
+
import ts6 from "typescript";
|
|
12149
12064
|
var findDefineConfigCall = (sf) => {
|
|
12150
12065
|
let result = null;
|
|
12151
12066
|
const visit = (node) => {
|
|
12152
12067
|
if (result)
|
|
12153
12068
|
return;
|
|
12154
|
-
if (
|
|
12069
|
+
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
12155
12070
|
const [arg] = node.arguments;
|
|
12156
|
-
if (arg &&
|
|
12071
|
+
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
12157
12072
|
result = arg;
|
|
12158
12073
|
return;
|
|
12159
12074
|
}
|
|
12160
12075
|
}
|
|
12161
|
-
|
|
12076
|
+
ts6.forEachChild(node, visit);
|
|
12162
12077
|
};
|
|
12163
|
-
|
|
12078
|
+
ts6.forEachChild(sf, visit);
|
|
12164
12079
|
return result;
|
|
12165
12080
|
}, findPropertyInitializer = (object, name) => {
|
|
12166
12081
|
for (const prop of object.properties) {
|
|
12167
|
-
if (!
|
|
12082
|
+
if (!ts6.isPropertyAssignment(prop))
|
|
12168
12083
|
continue;
|
|
12169
12084
|
if (!prop.name)
|
|
12170
12085
|
continue;
|
|
12171
|
-
const key =
|
|
12086
|
+
const key = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
12172
12087
|
if (key === name)
|
|
12173
12088
|
return prop.initializer;
|
|
12174
12089
|
}
|
|
12175
12090
|
return null;
|
|
12176
12091
|
}, findImportForBinding = (sf, binding) => {
|
|
12177
12092
|
for (const statement of sf.statements) {
|
|
12178
|
-
if (!
|
|
12093
|
+
if (!ts6.isImportDeclaration(statement))
|
|
12179
12094
|
continue;
|
|
12180
|
-
if (!
|
|
12095
|
+
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
12181
12096
|
continue;
|
|
12182
12097
|
if (statement.importClause?.isTypeOnly)
|
|
12183
12098
|
continue;
|
|
12184
12099
|
const named = statement.importClause?.namedBindings;
|
|
12185
|
-
if (!named || !
|
|
12100
|
+
if (!named || !ts6.isNamedImports(named))
|
|
12186
12101
|
continue;
|
|
12187
12102
|
for (const element of named.elements) {
|
|
12188
12103
|
if (element.isTypeOnly)
|
|
@@ -12198,10 +12113,10 @@ var findDefineConfigCall = (sf) => {
|
|
|
12198
12113
|
return null;
|
|
12199
12114
|
}, resolveConfigPath = (projectRoot) => {
|
|
12200
12115
|
const candidates = [
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12116
|
+
join25(projectRoot, "absolute.config.ts"),
|
|
12117
|
+
join25(projectRoot, "absolute.config.mts"),
|
|
12118
|
+
join25(projectRoot, "absolute.config.js"),
|
|
12119
|
+
join25(projectRoot, "absolute.config.mjs")
|
|
12205
12120
|
];
|
|
12206
12121
|
for (const candidate of candidates) {
|
|
12207
12122
|
if (existsSync20(candidate))
|
|
@@ -12212,29 +12127,29 @@ var findDefineConfigCall = (sf) => {
|
|
|
12212
12127
|
const configPath2 = resolveConfigPath(projectRoot);
|
|
12213
12128
|
if (!configPath2)
|
|
12214
12129
|
return null;
|
|
12215
|
-
const source =
|
|
12130
|
+
const source = readFileSync14(configPath2, "utf-8");
|
|
12216
12131
|
if (!source.includes("angular"))
|
|
12217
12132
|
return null;
|
|
12218
12133
|
if (!source.includes("providers"))
|
|
12219
12134
|
return null;
|
|
12220
|
-
const sf =
|
|
12135
|
+
const sf = ts6.createSourceFile(configPath2, source, ts6.ScriptTarget.Latest, true, ts6.ScriptKind.TS);
|
|
12221
12136
|
const configObject = findDefineConfigCall(sf);
|
|
12222
12137
|
if (!configObject)
|
|
12223
12138
|
return null;
|
|
12224
12139
|
const angularField = findPropertyInitializer(configObject, "angular");
|
|
12225
|
-
if (!angularField || !
|
|
12140
|
+
if (!angularField || !ts6.isObjectLiteralExpression(angularField))
|
|
12226
12141
|
return null;
|
|
12227
12142
|
const providersField = findPropertyInitializer(angularField, "providers");
|
|
12228
12143
|
if (!providersField)
|
|
12229
12144
|
return null;
|
|
12230
|
-
if (!
|
|
12145
|
+
if (!ts6.isIdentifier(providersField))
|
|
12231
12146
|
return null;
|
|
12232
12147
|
const binding = providersField.text;
|
|
12233
12148
|
const importInfo = findImportForBinding(sf, binding);
|
|
12234
12149
|
if (!importInfo)
|
|
12235
12150
|
return null;
|
|
12236
12151
|
const configDir2 = dirname14(configPath2);
|
|
12237
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
12152
|
+
const absolutePath = importInfo.source.startsWith(".") ? join25(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute4(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
12238
12153
|
return {
|
|
12239
12154
|
absolutePath,
|
|
12240
12155
|
bindingName: binding,
|
|
@@ -12244,18 +12159,18 @@ var findDefineConfigCall = (sf) => {
|
|
|
12244
12159
|
var init_parseAngularConfigImports = () => {};
|
|
12245
12160
|
|
|
12246
12161
|
// src/build/scanAngularHandlerCalls.ts
|
|
12247
|
-
import { readdirSync as
|
|
12248
|
-
import { dirname as dirname15, isAbsolute as
|
|
12249
|
-
import
|
|
12250
|
-
var ELYSIA_ROUTE_METHODS2,
|
|
12162
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync15 } from "fs";
|
|
12163
|
+
import { dirname as dirname15, isAbsolute as isAbsolute5, join as join26, resolve as resolve23 } from "path";
|
|
12164
|
+
import ts7 from "typescript";
|
|
12165
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
12251
12166
|
if (filePath.endsWith(".tsx"))
|
|
12252
|
-
return
|
|
12253
|
-
return
|
|
12254
|
-
},
|
|
12167
|
+
return ts7.ScriptKind.TSX;
|
|
12168
|
+
return ts7.ScriptKind.TS;
|
|
12169
|
+
}, hasSourceExtension2 = (filePath) => {
|
|
12255
12170
|
const idx = filePath.lastIndexOf(".");
|
|
12256
12171
|
if (idx === -1)
|
|
12257
12172
|
return false;
|
|
12258
|
-
return
|
|
12173
|
+
return SOURCE_EXTENSIONS2.has(filePath.slice(idx));
|
|
12259
12174
|
}, collectSourceFiles2 = (root) => {
|
|
12260
12175
|
const out = [];
|
|
12261
12176
|
const stack = [root];
|
|
@@ -12265,7 +12180,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12265
12180
|
continue;
|
|
12266
12181
|
let entries;
|
|
12267
12182
|
try {
|
|
12268
|
-
entries =
|
|
12183
|
+
entries = readdirSync2(dir, {
|
|
12269
12184
|
encoding: "utf-8",
|
|
12270
12185
|
withFileTypes: true
|
|
12271
12186
|
});
|
|
@@ -12274,13 +12189,13 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12274
12189
|
}
|
|
12275
12190
|
for (const entry of entries) {
|
|
12276
12191
|
if (entry.isDirectory()) {
|
|
12277
|
-
if (
|
|
12192
|
+
if (SKIP_DIRS2.has(entry.name))
|
|
12278
12193
|
continue;
|
|
12279
12194
|
if (entry.name.startsWith("."))
|
|
12280
12195
|
continue;
|
|
12281
|
-
stack.push(
|
|
12282
|
-
} else if (entry.isFile() &&
|
|
12283
|
-
out.push(
|
|
12196
|
+
stack.push(join26(dir, entry.name));
|
|
12197
|
+
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
12198
|
+
out.push(join26(dir, entry.name));
|
|
12284
12199
|
}
|
|
12285
12200
|
}
|
|
12286
12201
|
}
|
|
@@ -12293,17 +12208,17 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12293
12208
|
};
|
|
12294
12209
|
const resolveSource = (specifier) => {
|
|
12295
12210
|
if (specifier.startsWith(".")) {
|
|
12296
|
-
return
|
|
12211
|
+
return resolve23(fileDir, specifier);
|
|
12297
12212
|
}
|
|
12298
|
-
if (
|
|
12213
|
+
if (isAbsolute5(specifier)) {
|
|
12299
12214
|
return specifier;
|
|
12300
12215
|
}
|
|
12301
12216
|
return null;
|
|
12302
12217
|
};
|
|
12303
12218
|
for (const statement of sf.statements) {
|
|
12304
|
-
if (!
|
|
12219
|
+
if (!ts7.isImportDeclaration(statement))
|
|
12305
12220
|
continue;
|
|
12306
|
-
if (!
|
|
12221
|
+
if (!ts7.isStringLiteral(statement.moduleSpecifier))
|
|
12307
12222
|
continue;
|
|
12308
12223
|
if (statement.importClause?.isTypeOnly)
|
|
12309
12224
|
continue;
|
|
@@ -12324,7 +12239,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12324
12239
|
const bindings = clause.namedBindings;
|
|
12325
12240
|
if (!bindings)
|
|
12326
12241
|
continue;
|
|
12327
|
-
if (
|
|
12242
|
+
if (ts7.isNamespaceImport(bindings)) {
|
|
12328
12243
|
recordSpec(bindings.name.text, {
|
|
12329
12244
|
importedName: "*",
|
|
12330
12245
|
isDefault: false,
|
|
@@ -12352,38 +12267,38 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12352
12267
|
}, collectExpressionIdentifiers = (expr) => {
|
|
12353
12268
|
const out = new Set;
|
|
12354
12269
|
const visit = (node) => {
|
|
12355
|
-
if (
|
|
12270
|
+
if (ts7.isIdentifier(node)) {
|
|
12356
12271
|
out.add(node.text);
|
|
12357
12272
|
return;
|
|
12358
12273
|
}
|
|
12359
|
-
if (
|
|
12274
|
+
if (ts7.isPropertyAccessExpression(node)) {
|
|
12360
12275
|
visit(node.expression);
|
|
12361
12276
|
return;
|
|
12362
12277
|
}
|
|
12363
|
-
|
|
12278
|
+
ts7.forEachChild(node, visit);
|
|
12364
12279
|
};
|
|
12365
12280
|
visit(expr);
|
|
12366
12281
|
return out;
|
|
12367
12282
|
}, extractManifestKey = (pagePathValue) => {
|
|
12368
|
-
if (!
|
|
12283
|
+
if (!ts7.isCallExpression(pagePathValue))
|
|
12369
12284
|
return null;
|
|
12370
12285
|
const callee = pagePathValue.expression;
|
|
12371
|
-
if (!
|
|
12286
|
+
if (!ts7.isIdentifier(callee) || callee.text !== "asset")
|
|
12372
12287
|
return null;
|
|
12373
12288
|
const [, second] = pagePathValue.arguments;
|
|
12374
12289
|
if (!second)
|
|
12375
12290
|
return null;
|
|
12376
|
-
if (!
|
|
12291
|
+
if (!ts7.isStringLiteral(second))
|
|
12377
12292
|
return null;
|
|
12378
12293
|
return second.text;
|
|
12379
12294
|
}, findEnclosingMountPath = (node) => {
|
|
12380
12295
|
let cursor = node.parent;
|
|
12381
12296
|
while (cursor) {
|
|
12382
|
-
if (
|
|
12297
|
+
if (ts7.isCallExpression(cursor)) {
|
|
12383
12298
|
const callee = cursor.expression;
|
|
12384
|
-
if (
|
|
12299
|
+
if (ts7.isPropertyAccessExpression(callee) && ts7.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
12385
12300
|
const firstArg = cursor.arguments[0];
|
|
12386
|
-
if (firstArg &&
|
|
12301
|
+
if (firstArg && ts7.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
12387
12302
|
return firstArg.text;
|
|
12388
12303
|
}
|
|
12389
12304
|
}
|
|
@@ -12394,37 +12309,37 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12394
12309
|
}, extractCallsFromFile = (filePath, out) => {
|
|
12395
12310
|
let source;
|
|
12396
12311
|
try {
|
|
12397
|
-
source =
|
|
12312
|
+
source = readFileSync15(filePath, "utf-8");
|
|
12398
12313
|
} catch {
|
|
12399
12314
|
return;
|
|
12400
12315
|
}
|
|
12401
12316
|
if (!fileMayContainAngularHandler(source))
|
|
12402
12317
|
return;
|
|
12403
|
-
const sf =
|
|
12318
|
+
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
12404
12319
|
const imports = collectFileImports(sf, filePath);
|
|
12405
12320
|
const visit = (node) => {
|
|
12406
|
-
if (
|
|
12321
|
+
if (ts7.isCallExpression(node) && ts7.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
12407
12322
|
const [arg] = node.arguments;
|
|
12408
|
-
if (arg &&
|
|
12323
|
+
if (arg && ts7.isObjectLiteralExpression(arg)) {
|
|
12409
12324
|
let manifestKey = null;
|
|
12410
12325
|
let providersExpr = null;
|
|
12411
12326
|
for (const prop of arg.properties) {
|
|
12412
|
-
if (
|
|
12327
|
+
if (ts7.isPropertyAssignment(prop)) {
|
|
12413
12328
|
if (!prop.name)
|
|
12414
12329
|
continue;
|
|
12415
|
-
const name =
|
|
12330
|
+
const name = ts7.isIdentifier(prop.name) ? prop.name.text : ts7.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
12416
12331
|
if (name === "pagePath") {
|
|
12417
12332
|
manifestKey = extractManifestKey(prop.initializer);
|
|
12418
12333
|
} else if (name === "providers") {
|
|
12419
12334
|
providersExpr = prop.initializer;
|
|
12420
12335
|
}
|
|
12421
|
-
} else if (
|
|
12336
|
+
} else if (ts7.isSpreadAssignment(prop)) {
|
|
12422
12337
|
if (manifestKey)
|
|
12423
12338
|
continue;
|
|
12424
12339
|
const spreadExpr = prop.expression;
|
|
12425
|
-
if (
|
|
12340
|
+
if (ts7.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
12426
12341
|
const [firstArg] = spreadExpr.arguments;
|
|
12427
|
-
if (firstArg &&
|
|
12342
|
+
if (firstArg && ts7.isStringLiteral(firstArg)) {
|
|
12428
12343
|
manifestKey = firstArg.text;
|
|
12429
12344
|
}
|
|
12430
12345
|
}
|
|
@@ -12452,9 +12367,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind2 = (fil
|
|
|
12452
12367
|
}
|
|
12453
12368
|
}
|
|
12454
12369
|
}
|
|
12455
|
-
|
|
12370
|
+
ts7.forEachChild(node, visit);
|
|
12456
12371
|
};
|
|
12457
|
-
|
|
12372
|
+
ts7.forEachChild(sf, visit);
|
|
12458
12373
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
12459
12374
|
const files = collectSourceFiles2(projectRoot);
|
|
12460
12375
|
const collected = [];
|
|
@@ -12474,7 +12389,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12474
12389
|
"post",
|
|
12475
12390
|
"put"
|
|
12476
12391
|
]);
|
|
12477
|
-
|
|
12392
|
+
SKIP_DIRS2 = new Set([
|
|
12478
12393
|
".absolutejs",
|
|
12479
12394
|
".generated",
|
|
12480
12395
|
".git",
|
|
@@ -12486,7 +12401,108 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12486
12401
|
"dist",
|
|
12487
12402
|
"node_modules"
|
|
12488
12403
|
]);
|
|
12404
|
+
SOURCE_EXTENSIONS2 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
12405
|
+
});
|
|
12406
|
+
|
|
12407
|
+
// src/build/scanAngularPageRoutes.ts
|
|
12408
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync16 } from "fs";
|
|
12409
|
+
import { basename as basename6, join as join27 } from "path";
|
|
12410
|
+
import ts8 from "typescript";
|
|
12411
|
+
var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
12412
|
+
const idx = filePath.lastIndexOf(".");
|
|
12413
|
+
if (idx === -1)
|
|
12414
|
+
return false;
|
|
12415
|
+
return SOURCE_EXTENSIONS3.has(filePath.slice(idx));
|
|
12416
|
+
}, isPageFile = (filePath) => {
|
|
12417
|
+
if (!hasSourceExtension3(filePath))
|
|
12418
|
+
return false;
|
|
12419
|
+
const base = basename6(filePath);
|
|
12420
|
+
if (base.endsWith(".d.ts"))
|
|
12421
|
+
return false;
|
|
12422
|
+
if (base.endsWith(".test.ts"))
|
|
12423
|
+
return false;
|
|
12424
|
+
if (base.endsWith(".spec.ts"))
|
|
12425
|
+
return false;
|
|
12426
|
+
return true;
|
|
12427
|
+
}, collectPageFiles = (pagesRoot) => {
|
|
12428
|
+
const out = [];
|
|
12429
|
+
const stack = [pagesRoot];
|
|
12430
|
+
while (stack.length > 0) {
|
|
12431
|
+
const dir = stack.pop();
|
|
12432
|
+
if (!dir)
|
|
12433
|
+
continue;
|
|
12434
|
+
let entries;
|
|
12435
|
+
try {
|
|
12436
|
+
entries = readdirSync3(dir, {
|
|
12437
|
+
encoding: "utf-8",
|
|
12438
|
+
withFileTypes: true
|
|
12439
|
+
});
|
|
12440
|
+
} catch {
|
|
12441
|
+
continue;
|
|
12442
|
+
}
|
|
12443
|
+
for (const entry of entries) {
|
|
12444
|
+
if (entry.isDirectory()) {
|
|
12445
|
+
if (SKIP_DIRS3.has(entry.name))
|
|
12446
|
+
continue;
|
|
12447
|
+
if (entry.name.startsWith("."))
|
|
12448
|
+
continue;
|
|
12449
|
+
stack.push(join27(dir, entry.name));
|
|
12450
|
+
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
12451
|
+
out.push(join27(dir, entry.name));
|
|
12452
|
+
}
|
|
12453
|
+
}
|
|
12454
|
+
}
|
|
12455
|
+
return out;
|
|
12456
|
+
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
12457
|
+
if (!source.includes("routes"))
|
|
12458
|
+
return false;
|
|
12459
|
+
const sf = ts8.createSourceFile(filePath, source, ts8.ScriptTarget.Latest, true, ts8.ScriptKind.TS);
|
|
12460
|
+
for (const statement of sf.statements) {
|
|
12461
|
+
if (!ts8.isVariableStatement(statement))
|
|
12462
|
+
continue;
|
|
12463
|
+
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts8.SyntaxKind.ExportKeyword);
|
|
12464
|
+
if (!isExported)
|
|
12465
|
+
continue;
|
|
12466
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
12467
|
+
if (!ts8.isIdentifier(declaration.name))
|
|
12468
|
+
continue;
|
|
12469
|
+
if (declaration.name.text === "routes")
|
|
12470
|
+
return true;
|
|
12471
|
+
}
|
|
12472
|
+
}
|
|
12473
|
+
return false;
|
|
12474
|
+
}, scanAngularPageRoutes = (pagesRoot) => {
|
|
12475
|
+
const files = collectPageFiles(pagesRoot);
|
|
12476
|
+
const out = [];
|
|
12477
|
+
for (const file2 of files) {
|
|
12478
|
+
let source;
|
|
12479
|
+
try {
|
|
12480
|
+
source = readFileSync16(file2, "utf-8");
|
|
12481
|
+
} catch {
|
|
12482
|
+
continue;
|
|
12483
|
+
}
|
|
12484
|
+
const hasRoutes = hasTopLevelRoutesExport(source, file2);
|
|
12485
|
+
const base = basename6(file2).replace(/\.[cm]?[tj]sx?$/, "");
|
|
12486
|
+
const manifestKey = toPascal(base);
|
|
12487
|
+
out.push({
|
|
12488
|
+
hasRoutes,
|
|
12489
|
+
manifestKey,
|
|
12490
|
+
pageFile: file2
|
|
12491
|
+
});
|
|
12492
|
+
}
|
|
12493
|
+
return out;
|
|
12494
|
+
};
|
|
12495
|
+
var init_scanAngularPageRoutes = __esm(() => {
|
|
12489
12496
|
SOURCE_EXTENSIONS3 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
12497
|
+
SKIP_DIRS3 = new Set([
|
|
12498
|
+
".absolutejs",
|
|
12499
|
+
".generated",
|
|
12500
|
+
".git",
|
|
12501
|
+
"build",
|
|
12502
|
+
"compiled",
|
|
12503
|
+
"dist",
|
|
12504
|
+
"node_modules"
|
|
12505
|
+
]);
|
|
12490
12506
|
});
|
|
12491
12507
|
|
|
12492
12508
|
// src/build/runAngularHandlerScan.ts
|
|
@@ -12498,9 +12514,11 @@ var runAngularHandlerScan = (projectRoot, angularDirectory) => {
|
|
|
12498
12514
|
const calls = scanAngularHandlerCalls(projectRoot);
|
|
12499
12515
|
const pageRoutes = scanAngularPageRoutes(angularDirectory);
|
|
12500
12516
|
const providersImport = parseAngularProvidersImport(projectRoot);
|
|
12501
|
-
const providersFiles = emitAngularProvidersFiles(projectRoot, calls, pageRoutes, { providersImport });
|
|
12517
|
+
const providersFiles = emitAngularProvidersFiles(projectRoot, angularDirectory, calls, pageRoutes, { providersImport });
|
|
12502
12518
|
emitAngularRouteMounts(projectRoot, calls);
|
|
12519
|
+
const angularEntryAddons = providersImport ? [providersImport.absolutePath] : [];
|
|
12503
12520
|
return {
|
|
12521
|
+
angularEntryAddons,
|
|
12504
12522
|
calls,
|
|
12505
12523
|
manifestKeysWithProviders: new Set(providersFiles.map((file2) => file2.manifestKey)),
|
|
12506
12524
|
pageRoutes,
|
|
@@ -12584,22 +12602,22 @@ import {
|
|
|
12584
12602
|
join as join28,
|
|
12585
12603
|
basename as basename7,
|
|
12586
12604
|
extname as extname5,
|
|
12587
|
-
resolve as
|
|
12588
|
-
relative as
|
|
12605
|
+
resolve as resolve24,
|
|
12606
|
+
relative as relative10,
|
|
12589
12607
|
sep as sep2
|
|
12590
12608
|
} from "path";
|
|
12591
12609
|
import { env as env2 } from "process";
|
|
12592
12610
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12593
12611
|
var resolveDevClientDir2 = () => {
|
|
12594
12612
|
const projectRoot = process.cwd();
|
|
12595
|
-
const fromSource =
|
|
12613
|
+
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
12596
12614
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12597
12615
|
return fromSource;
|
|
12598
12616
|
}
|
|
12599
|
-
const fromNodeModules =
|
|
12617
|
+
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12600
12618
|
if (existsSync21(fromNodeModules))
|
|
12601
12619
|
return fromNodeModules;
|
|
12602
|
-
return
|
|
12620
|
+
return resolve24(import.meta.dir, "./dev/client");
|
|
12603
12621
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12604
12622
|
persistentCache.clear();
|
|
12605
12623
|
sourceHashCache.clear();
|
|
@@ -12629,7 +12647,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12629
12647
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12630
12648
|
if (!spec.startsWith("."))
|
|
12631
12649
|
return null;
|
|
12632
|
-
const basePath =
|
|
12650
|
+
const basePath = resolve24(dirname16(from), spec);
|
|
12633
12651
|
const candidates = [
|
|
12634
12652
|
basePath,
|
|
12635
12653
|
`${basePath}.ts`,
|
|
@@ -12656,7 +12674,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12656
12674
|
const resolved = resolvePackageImport(spec);
|
|
12657
12675
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12658
12676
|
}
|
|
12659
|
-
const basePath =
|
|
12677
|
+
const basePath = resolve24(dirname16(from), spec);
|
|
12660
12678
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12661
12679
|
if (!explicit) {
|
|
12662
12680
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12677,8 +12695,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12677
12695
|
return jsPath;
|
|
12678
12696
|
return null;
|
|
12679
12697
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12680
|
-
const toServer =
|
|
12681
|
-
const toClient =
|
|
12698
|
+
const toServer = relative10(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12699
|
+
const toClient = relative10(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12682
12700
|
rewrites.set(rawSpec, {
|
|
12683
12701
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12684
12702
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12716,8 +12734,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12716
12734
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12717
12735
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12718
12736
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12719
|
-
const rawRel = dirname16(
|
|
12720
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12737
|
+
const rawRel = dirname16(relative10(svelteRoot, src)).replace(/\\/g, "/");
|
|
12738
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12721
12739
|
const baseName = basename7(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12722
12740
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12723
12741
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12738,15 +12756,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12738
12756
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12739
12757
|
if (!resolved)
|
|
12740
12758
|
continue;
|
|
12741
|
-
const childRel =
|
|
12759
|
+
const childRel = relative10(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12742
12760
|
if (!childRel.startsWith(".."))
|
|
12743
12761
|
continue;
|
|
12744
12762
|
const childBuilt2 = cache.get(resolved);
|
|
12745
12763
|
if (!childBuilt2)
|
|
12746
12764
|
continue;
|
|
12747
12765
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12748
|
-
const toServer =
|
|
12749
|
-
const toClient =
|
|
12766
|
+
const toServer = relative10(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12767
|
+
const toClient = relative10(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12750
12768
|
externalRewrites.set(origSpec, {
|
|
12751
12769
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12752
12770
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12780,7 +12798,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12780
12798
|
}).js;
|
|
12781
12799
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12782
12800
|
if (mode === "client" && isDev2) {
|
|
12783
|
-
const moduleKey = `/@src/${
|
|
12801
|
+
const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12784
12802
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12785
12803
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12786
12804
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12829,10 +12847,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12829
12847
|
};
|
|
12830
12848
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
12831
12849
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
12832
|
-
const relClientDir = dirname16(
|
|
12850
|
+
const relClientDir = dirname16(relative10(clientDir, client2));
|
|
12833
12851
|
const name = basename7(client2, extname5(client2));
|
|
12834
12852
|
const indexPath = join28(indexDir, relClientDir, `${name}.js`);
|
|
12835
|
-
const importRaw =
|
|
12853
|
+
const importRaw = relative10(dirname16(indexPath), client2).split(sep2).join("/");
|
|
12836
12854
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12837
12855
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12838
12856
|
import "${hmrClientPath3}";
|
|
@@ -12909,7 +12927,7 @@ if (typeof window !== "undefined") {
|
|
|
12909
12927
|
return {
|
|
12910
12928
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
12911
12929
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
12912
|
-
const rel = dirname16(
|
|
12930
|
+
const rel = dirname16(relative10(clientDir, client2));
|
|
12913
12931
|
return join28(indexDir, rel, basename7(client2));
|
|
12914
12932
|
}),
|
|
12915
12933
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -13322,22 +13340,22 @@ import { mkdir as mkdir5 } from "fs/promises";
|
|
|
13322
13340
|
import {
|
|
13323
13341
|
basename as basename8,
|
|
13324
13342
|
dirname as dirname17,
|
|
13325
|
-
isAbsolute as
|
|
13343
|
+
isAbsolute as isAbsolute6,
|
|
13326
13344
|
join as join29,
|
|
13327
|
-
relative as
|
|
13328
|
-
resolve as
|
|
13345
|
+
relative as relative11,
|
|
13346
|
+
resolve as resolve25
|
|
13329
13347
|
} from "path";
|
|
13330
13348
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
13331
13349
|
var resolveDevClientDir3 = () => {
|
|
13332
13350
|
const projectRoot = process.cwd();
|
|
13333
|
-
const fromSource =
|
|
13351
|
+
const fromSource = resolve25(import.meta.dir, "../dev/client");
|
|
13334
13352
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13335
13353
|
return fromSource;
|
|
13336
13354
|
}
|
|
13337
|
-
const fromNodeModules =
|
|
13355
|
+
const fromNodeModules = resolve25(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13338
13356
|
if (existsSync22(fromNodeModules))
|
|
13339
13357
|
return fromNodeModules;
|
|
13340
|
-
return
|
|
13358
|
+
return resolve25(import.meta.dir, "./dev/client");
|
|
13341
13359
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
13342
13360
|
scriptCache.clear();
|
|
13343
13361
|
scriptSetupCache.clear();
|
|
@@ -13376,14 +13394,14 @@ var resolveDevClientDir3 = () => {
|
|
|
13376
13394
|
return "template-only";
|
|
13377
13395
|
}
|
|
13378
13396
|
return "full";
|
|
13379
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13397
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath, sourceDir) => {
|
|
13380
13398
|
if (filePath.endsWith(".vue"))
|
|
13381
13399
|
return filePath.replace(/\.vue$/, ".js");
|
|
13382
13400
|
if (filePath.endsWith(".ts"))
|
|
13383
13401
|
return filePath.replace(/\.ts$/, ".js");
|
|
13384
13402
|
if (isStylePath(filePath)) {
|
|
13385
13403
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13386
|
-
return
|
|
13404
|
+
return resolve25(sourceDir, filePath);
|
|
13387
13405
|
}
|
|
13388
13406
|
return filePath;
|
|
13389
13407
|
}
|
|
@@ -13409,7 +13427,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13409
13427
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13410
13428
|
if (cachedResult)
|
|
13411
13429
|
return cachedResult;
|
|
13412
|
-
const relativeFilePath =
|
|
13430
|
+
const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13413
13431
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13414
13432
|
const fileBaseName = basename8(sourceFilePath, ".vue");
|
|
13415
13433
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13447,12 +13465,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13447
13465
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13448
13466
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13449
13467
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13450
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
13468
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute6(path)) && isStylePath(path)).map((path) => isAbsolute6(path) ? path : resolve25(dirname17(sourceFilePath), path));
|
|
13451
13469
|
for (const stylePath of stylePathsImported) {
|
|
13452
13470
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13453
13471
|
}
|
|
13454
13472
|
const childBuildResults = await Promise.all([
|
|
13455
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
13473
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve25(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13456
13474
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13457
13475
|
]);
|
|
13458
13476
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13546,7 +13564,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13546
13564
|
let result2 = code;
|
|
13547
13565
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13548
13566
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13549
|
-
let rel =
|
|
13567
|
+
let rel = relative11(dirname17(outputPath), targetPath).replace(/\\/g, "/");
|
|
13550
13568
|
if (!rel.startsWith("."))
|
|
13551
13569
|
rel = `./${rel}`;
|
|
13552
13570
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -13576,7 +13594,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13576
13594
|
hmrId,
|
|
13577
13595
|
serverPath: serverOutputPath,
|
|
13578
13596
|
tsHelperPaths: [
|
|
13579
|
-
...helperModulePaths.map((helper) =>
|
|
13597
|
+
...helperModulePaths.map((helper) => resolve25(dirname17(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13580
13598
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13581
13599
|
]
|
|
13582
13600
|
};
|
|
@@ -13599,7 +13617,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13599
13617
|
const buildCache = new Map;
|
|
13600
13618
|
const allTsHelperPaths = new Set;
|
|
13601
13619
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13602
|
-
const result = await compileVueFile(
|
|
13620
|
+
const result = await compileVueFile(resolve25(entryPath), {
|
|
13603
13621
|
client: clientOutputDir,
|
|
13604
13622
|
css: cssOutputDir,
|
|
13605
13623
|
server: serverOutputDir
|
|
@@ -13607,7 +13625,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13607
13625
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13608
13626
|
const entryBaseName = basename8(entryPath, ".vue");
|
|
13609
13627
|
const indexOutputFile = join29(indexOutputDir, `${entryBaseName}.js`);
|
|
13610
|
-
const clientOutputFile = join29(clientOutputDir,
|
|
13628
|
+
const clientOutputFile = join29(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13611
13629
|
await mkdir5(dirname17(indexOutputFile), { recursive: true });
|
|
13612
13630
|
const vueHmrImports = isDev2 ? [
|
|
13613
13631
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13615,7 +13633,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13615
13633
|
] : [];
|
|
13616
13634
|
await write3(indexOutputFile, [
|
|
13617
13635
|
...vueHmrImports,
|
|
13618
|
-
`import Comp, * as PageModule from "${
|
|
13636
|
+
`import Comp, * as PageModule from "${relative11(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13619
13637
|
'import { createSSRApp, createApp } from "vue";',
|
|
13620
13638
|
"",
|
|
13621
13639
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13759,7 +13777,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13759
13777
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13760
13778
|
const sourceCode = await file3(tsPath).text();
|
|
13761
13779
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13762
|
-
const relativeJsPath =
|
|
13780
|
+
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13763
13781
|
const outClientPath = join29(clientOutputDir, relativeJsPath);
|
|
13764
13782
|
const outServerPath = join29(serverOutputDir, relativeJsPath);
|
|
13765
13783
|
await mkdir5(dirname17(outClientPath), { recursive: true });
|
|
@@ -14266,7 +14284,7 @@ __export(exports_compileAngular, {
|
|
|
14266
14284
|
compileAngular: () => compileAngular
|
|
14267
14285
|
});
|
|
14268
14286
|
import { existsSync as existsSync23, readFileSync as readFileSync18, promises as fs5 } from "fs";
|
|
14269
|
-
import { join as join30, basename as basename9, sep as sep3, dirname as dirname18, resolve as
|
|
14287
|
+
import { join as join30, basename as basename9, sep as sep3, dirname as dirname18, resolve as resolve26, relative as relative12 } from "path";
|
|
14270
14288
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14271
14289
|
import ts9 from "typescript";
|
|
14272
14290
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -14274,10 +14292,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14274
14292
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
14275
14293
|
}, readTsconfigPathAliases = () => {
|
|
14276
14294
|
try {
|
|
14277
|
-
const configPath2 =
|
|
14295
|
+
const configPath2 = resolve26(process.cwd(), "tsconfig.json");
|
|
14278
14296
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
14279
14297
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
14280
|
-
const baseUrl =
|
|
14298
|
+
const baseUrl = resolve26(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
14281
14299
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
14282
14300
|
return { aliases, baseUrl };
|
|
14283
14301
|
} catch {
|
|
@@ -14297,7 +14315,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14297
14315
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
14298
14316
|
for (const replacement of alias.replacements) {
|
|
14299
14317
|
const candidate = replacement.replace("*", wildcardValue);
|
|
14300
|
-
const resolved = resolveSourceFile(
|
|
14318
|
+
const resolved = resolveSourceFile(resolve26(baseUrl, candidate));
|
|
14301
14319
|
if (resolved)
|
|
14302
14320
|
return resolved;
|
|
14303
14321
|
}
|
|
@@ -14316,13 +14334,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14316
14334
|
];
|
|
14317
14335
|
return candidates.find((file4) => existsSync23(file4));
|
|
14318
14336
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14319
|
-
const baseDir =
|
|
14337
|
+
const baseDir = resolve26(rootDir);
|
|
14320
14338
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
14321
14339
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
14322
14340
|
const scanCache = new Map;
|
|
14323
14341
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14324
14342
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14325
|
-
return resolveSourceFile(
|
|
14343
|
+
return resolveSourceFile(resolve26(fromDir, specifier));
|
|
14326
14344
|
}
|
|
14327
14345
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
14328
14346
|
if (aliased)
|
|
@@ -14331,7 +14349,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14331
14349
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14332
14350
|
if (resolved.includes("/node_modules/"))
|
|
14333
14351
|
return;
|
|
14334
|
-
const absolute =
|
|
14352
|
+
const absolute = resolve26(resolved);
|
|
14335
14353
|
if (!absolute.startsWith(baseDir))
|
|
14336
14354
|
return;
|
|
14337
14355
|
return resolveSourceFile(absolute);
|
|
@@ -14347,7 +14365,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14347
14365
|
usesLegacyAnimations: false
|
|
14348
14366
|
});
|
|
14349
14367
|
}
|
|
14350
|
-
const resolved =
|
|
14368
|
+
const resolved = resolve26(actualPath);
|
|
14351
14369
|
const cached = scanCache.get(resolved);
|
|
14352
14370
|
if (cached)
|
|
14353
14371
|
return cached;
|
|
@@ -14376,7 +14394,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14376
14394
|
const actualPath = resolveSourceFile(filePath);
|
|
14377
14395
|
if (!actualPath)
|
|
14378
14396
|
return false;
|
|
14379
|
-
const resolved =
|
|
14397
|
+
const resolved = resolve26(actualPath);
|
|
14380
14398
|
if (visited.has(resolved))
|
|
14381
14399
|
return false;
|
|
14382
14400
|
visited.add(resolved);
|
|
@@ -14394,14 +14412,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14394
14412
|
return (entryPath) => visit(entryPath);
|
|
14395
14413
|
}, resolveDevClientDir4 = () => {
|
|
14396
14414
|
const projectRoot = process.cwd();
|
|
14397
|
-
const fromSource =
|
|
14415
|
+
const fromSource = resolve26(import.meta.dir, "../dev/client");
|
|
14398
14416
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14399
14417
|
return fromSource;
|
|
14400
14418
|
}
|
|
14401
|
-
const fromNodeModules =
|
|
14419
|
+
const fromNodeModules = resolve26(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14402
14420
|
if (existsSync23(fromNodeModules))
|
|
14403
14421
|
return fromNodeModules;
|
|
14404
|
-
return
|
|
14422
|
+
return resolve26(import.meta.dir, "./dev/client");
|
|
14405
14423
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
14406
14424
|
try {
|
|
14407
14425
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14444,11 +14462,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14444
14462
|
if (hasJsLikeExtension(path))
|
|
14445
14463
|
return `${path}${query}`;
|
|
14446
14464
|
const importerDir = dirname18(importerOutputPath);
|
|
14447
|
-
const fileCandidate =
|
|
14465
|
+
const fileCandidate = resolve26(importerDir, `${path}.js`);
|
|
14448
14466
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
14449
14467
|
return `${path}.js${query}`;
|
|
14450
14468
|
}
|
|
14451
|
-
const indexCandidate =
|
|
14469
|
+
const indexCandidate = resolve26(importerDir, path, "index.js");
|
|
14452
14470
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
14453
14471
|
return `${path}/index.js${query}`;
|
|
14454
14472
|
}
|
|
@@ -14476,7 +14494,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14476
14494
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14477
14495
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14478
14496
|
return null;
|
|
14479
|
-
const basePath =
|
|
14497
|
+
const basePath = resolve26(dirname18(fromFile), specifier);
|
|
14480
14498
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14481
14499
|
`${basePath}.ts`,
|
|
14482
14500
|
`${basePath}.tsx`,
|
|
@@ -14487,7 +14505,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14487
14505
|
join30(basePath, "index.mts"),
|
|
14488
14506
|
join30(basePath, "index.cts")
|
|
14489
14507
|
];
|
|
14490
|
-
return candidates.map((candidate) =>
|
|
14508
|
+
return candidates.map((candidate) => resolve26(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14491
14509
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14492
14510
|
const hostSource = readFile6?.(fileName);
|
|
14493
14511
|
if (typeof hostSource === "string")
|
|
@@ -14522,7 +14540,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14522
14540
|
paths.push(join30(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14523
14541
|
}
|
|
14524
14542
|
}
|
|
14525
|
-
return paths.map((path) =>
|
|
14543
|
+
return paths.map((path) => resolve26(path));
|
|
14526
14544
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14527
14545
|
try {
|
|
14528
14546
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14564,7 +14582,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14564
14582
|
transformedFiles: 0
|
|
14565
14583
|
};
|
|
14566
14584
|
const transformFile = async (filePath) => {
|
|
14567
|
-
const resolvedPath =
|
|
14585
|
+
const resolvedPath = resolve26(filePath);
|
|
14568
14586
|
if (visited.has(resolvedPath))
|
|
14569
14587
|
return;
|
|
14570
14588
|
visited.add(resolvedPath);
|
|
@@ -14599,7 +14617,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14599
14617
|
return { stats, transformedSources };
|
|
14600
14618
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14601
14619
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14602
|
-
const outputPath =
|
|
14620
|
+
const outputPath = resolve26(join30(outDir, relative12(process.cwd(), resolve26(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14603
14621
|
return [
|
|
14604
14622
|
outputPath,
|
|
14605
14623
|
buildIslandMetadataExports(readFileSync18(inputPath, "utf-8"))
|
|
@@ -14610,7 +14628,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14610
14628
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14611
14629
|
const tsPath = __require.resolve("typescript");
|
|
14612
14630
|
const tsRootDir = dirname18(tsPath);
|
|
14613
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14631
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve26(tsRootDir, "lib");
|
|
14614
14632
|
});
|
|
14615
14633
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14616
14634
|
const options = {
|
|
@@ -14652,7 +14670,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14652
14670
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14653
14671
|
};
|
|
14654
14672
|
const emitted = {};
|
|
14655
|
-
const resolvedOutDir =
|
|
14673
|
+
const resolvedOutDir = resolve26(outDir);
|
|
14656
14674
|
host.writeFile = (fileName, text) => {
|
|
14657
14675
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14658
14676
|
emitted[relativePath] = text;
|
|
@@ -14674,12 +14692,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14674
14692
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14675
14693
|
return source;
|
|
14676
14694
|
}
|
|
14677
|
-
const resolvedPath =
|
|
14695
|
+
const resolvedPath = resolve26(fileName);
|
|
14678
14696
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14679
14697
|
};
|
|
14680
14698
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14681
14699
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14682
|
-
const source = transformedSources.get(
|
|
14700
|
+
const source = transformedSources.get(resolve26(fileName));
|
|
14683
14701
|
if (source) {
|
|
14684
14702
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14685
14703
|
}
|
|
@@ -14703,7 +14721,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14703
14721
|
content,
|
|
14704
14722
|
target: join30(outDir, fileName)
|
|
14705
14723
|
}));
|
|
14706
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14724
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve26(target)));
|
|
14707
14725
|
return rawEntries.map(({ content, target }) => {
|
|
14708
14726
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14709
14727
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14718,7 +14736,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14718
14736
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14719
14737
|
});
|
|
14720
14738
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14721
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14739
|
+
processedContent += islandMetadataByOutputPath.get(resolve26(target)) ?? "";
|
|
14722
14740
|
return { content: processedContent, target };
|
|
14723
14741
|
});
|
|
14724
14742
|
});
|
|
@@ -14728,7 +14746,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14728
14746
|
})), { outputs: entries.length });
|
|
14729
14747
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14730
14748
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14731
|
-
jitContentCache.delete(
|
|
14749
|
+
jitContentCache.delete(resolve26(filePath));
|
|
14732
14750
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14733
14751
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14734
14752
|
let match;
|
|
@@ -14741,7 +14759,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14741
14759
|
}
|
|
14742
14760
|
return null;
|
|
14743
14761
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14744
|
-
const sourceEntry =
|
|
14762
|
+
const sourceEntry = resolve26(import.meta.dir, "../angular/components/index.ts");
|
|
14745
14763
|
if (existsSync23(sourceEntry)) {
|
|
14746
14764
|
return sourceEntry.replace(/\\/g, "/");
|
|
14747
14765
|
}
|
|
@@ -14971,10 +14989,10 @@ ${fields}
|
|
|
14971
14989
|
source: result
|
|
14972
14990
|
};
|
|
14973
14991
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14974
|
-
const entryPath =
|
|
14992
|
+
const entryPath = resolve26(inputPath);
|
|
14975
14993
|
const allOutputs = [];
|
|
14976
14994
|
const visited = new Set;
|
|
14977
|
-
const baseDir =
|
|
14995
|
+
const baseDir = resolve26(rootDir ?? process.cwd());
|
|
14978
14996
|
let usesLegacyAnimations = false;
|
|
14979
14997
|
const angularTranspiler = new Bun.Transpiler({
|
|
14980
14998
|
loader: "ts",
|
|
@@ -15002,7 +15020,7 @@ ${fields}
|
|
|
15002
15020
|
};
|
|
15003
15021
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15004
15022
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15005
|
-
return resolveSourceFile2(
|
|
15023
|
+
return resolveSourceFile2(resolve26(fromDir, specifier));
|
|
15006
15024
|
}
|
|
15007
15025
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
15008
15026
|
if (aliased)
|
|
@@ -15011,7 +15029,7 @@ ${fields}
|
|
|
15011
15029
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15012
15030
|
if (resolved.includes("/node_modules/"))
|
|
15013
15031
|
return;
|
|
15014
|
-
const absolute =
|
|
15032
|
+
const absolute = resolve26(resolved);
|
|
15015
15033
|
if (!absolute.startsWith(baseDir))
|
|
15016
15034
|
return;
|
|
15017
15035
|
return resolveSourceFile2(absolute);
|
|
@@ -15060,13 +15078,13 @@ ${fields}
|
|
|
15060
15078
|
return `${prefix}${dots}`;
|
|
15061
15079
|
return `${prefix}../${dots}`;
|
|
15062
15080
|
});
|
|
15063
|
-
if (
|
|
15081
|
+
if (resolve26(actualPath) === entryPath) {
|
|
15064
15082
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
15065
15083
|
}
|
|
15066
15084
|
return processedContent;
|
|
15067
15085
|
};
|
|
15068
15086
|
const transpileFile = async (filePath) => {
|
|
15069
|
-
const resolved =
|
|
15087
|
+
const resolved = resolve26(filePath);
|
|
15070
15088
|
if (visited.has(resolved))
|
|
15071
15089
|
return;
|
|
15072
15090
|
visited.add(resolved);
|
|
@@ -15113,12 +15131,12 @@ ${fields}
|
|
|
15113
15131
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
15114
15132
|
if (!resolved2)
|
|
15115
15133
|
return null;
|
|
15116
|
-
const relativeImport =
|
|
15134
|
+
const relativeImport = relative12(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
15117
15135
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
15118
15136
|
importRewrites.set(specifier, relativeRewrite);
|
|
15119
15137
|
return resolved2;
|
|
15120
15138
|
}).filter((path) => Boolean(path));
|
|
15121
|
-
const isEntry =
|
|
15139
|
+
const isEntry = resolve26(actualPath) === resolve26(entryPath);
|
|
15122
15140
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
15123
15141
|
const cacheKey2 = actualPath;
|
|
15124
15142
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -15154,11 +15172,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15154
15172
|
const compiledRoot = compiledParent;
|
|
15155
15173
|
const indexesDir = join30(compiledParent, "indexes");
|
|
15156
15174
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
15157
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
15175
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve26(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
15158
15176
|
if (!hmr) {
|
|
15159
15177
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
15160
15178
|
const cwd = process.cwd();
|
|
15161
|
-
const angularSrcDir =
|
|
15179
|
+
const angularSrcDir = resolve26(outRoot);
|
|
15162
15180
|
if (!existsSync23(angularSrcDir))
|
|
15163
15181
|
return;
|
|
15164
15182
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -15167,7 +15185,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15167
15185
|
cwd: angularSrcDir
|
|
15168
15186
|
})) {
|
|
15169
15187
|
const sourcePath = join30(angularSrcDir, rel);
|
|
15170
|
-
const cwdRel =
|
|
15188
|
+
const cwdRel = relative12(cwd, sourcePath);
|
|
15171
15189
|
const targetPath = join30(compiledRoot, cwdRel);
|
|
15172
15190
|
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
15173
15191
|
await fs5.copyFile(sourcePath, targetPath);
|
|
@@ -15176,8 +15194,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15176
15194
|
}
|
|
15177
15195
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
15178
15196
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
15179
|
-
const resolvedEntry =
|
|
15180
|
-
const relativeEntry =
|
|
15197
|
+
const resolvedEntry = resolve26(entry);
|
|
15198
|
+
const relativeEntry = relative12(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
15181
15199
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
15182
15200
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
15183
15201
|
entry: resolvedEntry
|
|
@@ -15188,10 +15206,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15188
15206
|
join30(compiledRoot, relativeEntry),
|
|
15189
15207
|
join30(compiledRoot, "pages", jsName),
|
|
15190
15208
|
join30(compiledRoot, jsName)
|
|
15191
|
-
].map((file4) =>
|
|
15209
|
+
].map((file4) => resolve26(file4));
|
|
15192
15210
|
const resolveRawServerFile = (candidatePaths) => {
|
|
15193
15211
|
const normalizedCandidates = [
|
|
15194
|
-
...candidatePaths.map((file4) =>
|
|
15212
|
+
...candidatePaths.map((file4) => resolve26(file4)),
|
|
15195
15213
|
...compiledFallbackPaths
|
|
15196
15214
|
];
|
|
15197
15215
|
let candidate = normalizedCandidates.find((file4) => existsSync23(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -15261,13 +15279,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15261
15279
|
`;
|
|
15262
15280
|
}
|
|
15263
15281
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15264
|
-
const relativePath =
|
|
15282
|
+
const relativePath = relative12(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15265
15283
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15266
15284
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
15267
15285
|
const providersFilePath = join30(compiledParent, "providers", `${manifestKeyForProviders}.providers.ts`);
|
|
15268
15286
|
const hasGeneratedProviders = existsSync23(providersFilePath);
|
|
15269
15287
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
15270
|
-
const rel =
|
|
15288
|
+
const rel = relative12(indexesDir, providersFilePath.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
15271
15289
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15272
15290
|
})() : null;
|
|
15273
15291
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -16195,7 +16213,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16195
16213
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16196
16214
|
});
|
|
16197
16215
|
import { existsSync as existsSync24, readFileSync as readFileSync19, statSync as statSync2 } from "fs";
|
|
16198
|
-
import { dirname as dirname19, extname as extname6, relative as
|
|
16216
|
+
import { dirname as dirname19, extname as extname6, relative as relative13, resolve as resolve27 } from "path";
|
|
16199
16217
|
import ts13 from "typescript";
|
|
16200
16218
|
var fail = (reason, detail, location) => ({
|
|
16201
16219
|
ok: false,
|
|
@@ -16306,7 +16324,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16306
16324
|
})();
|
|
16307
16325
|
if (!decoratorName)
|
|
16308
16326
|
continue;
|
|
16309
|
-
const projectRel =
|
|
16327
|
+
const projectRel = relative13(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16310
16328
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16311
16329
|
if (decoratorName === "Component") {
|
|
16312
16330
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16499,7 +16517,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16499
16517
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16500
16518
|
return true;
|
|
16501
16519
|
}
|
|
16502
|
-
const base =
|
|
16520
|
+
const base = resolve27(componentDir, spec);
|
|
16503
16521
|
const candidates = [
|
|
16504
16522
|
`${base}.ts`,
|
|
16505
16523
|
`${base}.tsx`,
|
|
@@ -17303,7 +17321,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17303
17321
|
return null;
|
|
17304
17322
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
17305
17323
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
17306
|
-
const base =
|
|
17324
|
+
const base = resolve27(fromDir, stripped);
|
|
17307
17325
|
const candidates = [
|
|
17308
17326
|
`${base}.d.ts`,
|
|
17309
17327
|
`${base}.d.mts`,
|
|
@@ -17327,7 +17345,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17327
17345
|
return null;
|
|
17328
17346
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
17329
17347
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
17330
|
-
const base =
|
|
17348
|
+
const base = resolve27(componentDir, spec);
|
|
17331
17349
|
const candidates = [
|
|
17332
17350
|
`${base}.ts`,
|
|
17333
17351
|
`${base}.tsx`,
|
|
@@ -17546,13 +17564,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17546
17564
|
}
|
|
17547
17565
|
if (!matches)
|
|
17548
17566
|
continue;
|
|
17549
|
-
const resolved =
|
|
17567
|
+
const resolved = resolve27(componentDir, spec);
|
|
17550
17568
|
for (const ext of TS_EXTENSIONS) {
|
|
17551
17569
|
const candidate = resolved + ext;
|
|
17552
17570
|
if (existsSync24(candidate))
|
|
17553
17571
|
return candidate;
|
|
17554
17572
|
}
|
|
17555
|
-
const indexCandidate =
|
|
17573
|
+
const indexCandidate = resolve27(resolved, "index.ts");
|
|
17556
17574
|
if (existsSync24(indexCandidate))
|
|
17557
17575
|
return indexCandidate;
|
|
17558
17576
|
}
|
|
@@ -17785,7 +17803,7 @@ ${transpiled}
|
|
|
17785
17803
|
}
|
|
17786
17804
|
}${staticPatch}`;
|
|
17787
17805
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17788
|
-
const abs =
|
|
17806
|
+
const abs = resolve27(componentDir, url);
|
|
17789
17807
|
if (!existsSync24(abs))
|
|
17790
17808
|
return null;
|
|
17791
17809
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17825,7 +17843,7 @@ ${block}
|
|
|
17825
17843
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17826
17844
|
if (cached !== undefined)
|
|
17827
17845
|
return cached;
|
|
17828
|
-
const tsconfigPath =
|
|
17846
|
+
const tsconfigPath = resolve27(projectRoot, "tsconfig.json");
|
|
17829
17847
|
const opts = {};
|
|
17830
17848
|
if (existsSync24(tsconfigPath)) {
|
|
17831
17849
|
try {
|
|
@@ -17871,7 +17889,7 @@ ${block}
|
|
|
17871
17889
|
}
|
|
17872
17890
|
const kind = params.kind ?? "component";
|
|
17873
17891
|
if (kind !== "component") {
|
|
17874
|
-
const entityId = encodeURIComponent(`${
|
|
17892
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17875
17893
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17876
17894
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17877
17895
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17909,7 +17927,7 @@ ${block}
|
|
|
17909
17927
|
templateText = decoratorMeta.template;
|
|
17910
17928
|
templatePath = componentFilePath;
|
|
17911
17929
|
} else if (decoratorMeta.templateUrl) {
|
|
17912
|
-
const tplAbs =
|
|
17930
|
+
const tplAbs = resolve27(componentDir, decoratorMeta.templateUrl);
|
|
17913
17931
|
if (!existsSync24(tplAbs)) {
|
|
17914
17932
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17915
17933
|
}
|
|
@@ -17955,7 +17973,7 @@ ${block}
|
|
|
17955
17973
|
return fail("class-not-found", "anonymous class");
|
|
17956
17974
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17957
17975
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17958
|
-
const projectRelPath =
|
|
17976
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17959
17977
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17960
17978
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17961
17979
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18672,7 +18690,7 @@ __export(exports_compileEmber, {
|
|
|
18672
18690
|
});
|
|
18673
18691
|
import { existsSync as existsSync25 } from "fs";
|
|
18674
18692
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18675
|
-
import { basename as basename10, dirname as dirname20, extname as extname7, join as join31, resolve as
|
|
18693
|
+
import { basename as basename10, dirname as dirname20, extname as extname7, join as join31, resolve as resolve28 } from "path";
|
|
18676
18694
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
18677
18695
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18678
18696
|
if (cachedPreprocessor)
|
|
@@ -18768,7 +18786,7 @@ export const importSync = (specifier) => {
|
|
|
18768
18786
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18769
18787
|
if (!originalImporter)
|
|
18770
18788
|
return;
|
|
18771
|
-
const candidateBase =
|
|
18789
|
+
const candidateBase = resolve28(dirname20(originalImporter), args.path);
|
|
18772
18790
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18773
18791
|
for (const ext of extensionsToTry) {
|
|
18774
18792
|
const candidate = candidateBase + ext;
|
|
@@ -18827,7 +18845,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18827
18845
|
export { PageComponent };
|
|
18828
18846
|
export default PageComponent;
|
|
18829
18847
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18830
|
-
const resolvedEntry =
|
|
18848
|
+
const resolvedEntry = resolve28(entry);
|
|
18831
18849
|
const source = await file4(resolvedEntry).text();
|
|
18832
18850
|
let preprocessed = source;
|
|
18833
18851
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18847,8 +18865,8 @@ export default PageComponent;
|
|
|
18847
18865
|
mkdir6(serverDir, { recursive: true }),
|
|
18848
18866
|
mkdir6(clientDir, { recursive: true })
|
|
18849
18867
|
]);
|
|
18850
|
-
const tmpPagePath =
|
|
18851
|
-
const tmpHarnessPath =
|
|
18868
|
+
const tmpPagePath = resolve28(join31(tmpDir, `${baseName}.module.js`));
|
|
18869
|
+
const tmpHarnessPath = resolve28(join31(tmpDir, `${baseName}.harness.js`));
|
|
18852
18870
|
await Promise.all([
|
|
18853
18871
|
write4(tmpPagePath, transpiled),
|
|
18854
18872
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18890,7 +18908,7 @@ export default PageComponent;
|
|
|
18890
18908
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18891
18909
|
};
|
|
18892
18910
|
}, compileEmberFileSource = async (entry) => {
|
|
18893
|
-
const resolvedEntry =
|
|
18911
|
+
const resolvedEntry = resolve28(entry);
|
|
18894
18912
|
const source = await file4(resolvedEntry).text();
|
|
18895
18913
|
let preprocessed = source;
|
|
18896
18914
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18923,24 +18941,24 @@ __export(exports_buildReactVendor, {
|
|
|
18923
18941
|
buildReactVendor: () => buildReactVendor
|
|
18924
18942
|
});
|
|
18925
18943
|
import { existsSync as existsSync26, mkdirSync as mkdirSync10 } from "fs";
|
|
18926
|
-
import { join as join32, resolve as
|
|
18944
|
+
import { join as join32, resolve as resolve29 } from "path";
|
|
18927
18945
|
import { rm as rm5 } from "fs/promises";
|
|
18928
18946
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18929
18947
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18930
18948
|
const candidates = [
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18949
|
+
resolve29(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18950
|
+
resolve29(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18951
|
+
resolve29(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18952
|
+
resolve29(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18953
|
+
resolve29(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18954
|
+
resolve29(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18937
18955
|
];
|
|
18938
18956
|
for (const candidate of candidates) {
|
|
18939
18957
|
if (existsSync26(candidate)) {
|
|
18940
18958
|
return candidate.replace(/\\/g, "/");
|
|
18941
18959
|
}
|
|
18942
18960
|
}
|
|
18943
|
-
return (candidates[0] ??
|
|
18961
|
+
return (candidates[0] ?? resolve29(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18944
18962
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18945
18963
|
try {
|
|
18946
18964
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19590,7 +19608,7 @@ import {
|
|
|
19590
19608
|
statSync as statSync3,
|
|
19591
19609
|
writeFileSync as writeFileSync11
|
|
19592
19610
|
} from "fs";
|
|
19593
|
-
import { basename as basename11, dirname as dirname21, extname as extname8, join as join37, relative as
|
|
19611
|
+
import { basename as basename11, dirname as dirname21, extname as extname8, join as join37, relative as relative14, resolve as resolve30 } from "path";
|
|
19594
19612
|
import { cwd, env as env3, exit } from "process";
|
|
19595
19613
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19596
19614
|
var isDev2, isBuildTraceEnabled = () => {
|
|
@@ -19681,8 +19699,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19681
19699
|
}
|
|
19682
19700
|
}, resolveAbsoluteVersion = async () => {
|
|
19683
19701
|
const candidates = [
|
|
19684
|
-
|
|
19685
|
-
|
|
19702
|
+
resolve30(import.meta.dir, "..", "..", "package.json"),
|
|
19703
|
+
resolve30(import.meta.dir, "..", "package.json")
|
|
19686
19704
|
];
|
|
19687
19705
|
const resolveCandidate = async (remaining) => {
|
|
19688
19706
|
const [candidate, ...rest] = remaining;
|
|
@@ -19698,7 +19716,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19698
19716
|
};
|
|
19699
19717
|
await resolveCandidate(candidates);
|
|
19700
19718
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
19701
|
-
const absPath =
|
|
19719
|
+
const absPath = resolve30(file5, "..", relPath);
|
|
19702
19720
|
try {
|
|
19703
19721
|
statSync3(absPath);
|
|
19704
19722
|
workerPaths.add(absPath);
|
|
@@ -19760,7 +19778,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19760
19778
|
return;
|
|
19761
19779
|
}
|
|
19762
19780
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
19763
|
-
const pagesRel =
|
|
19781
|
+
const pagesRel = relative14(process.cwd(), resolve30(reactPagesPath)).replace(/\\/g, "/");
|
|
19764
19782
|
for (const file5 of indexFiles) {
|
|
19765
19783
|
let content = readFileSync20(join37(reactIndexesPath, file5), "utf-8");
|
|
19766
19784
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19768,27 +19786,27 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19768
19786
|
}
|
|
19769
19787
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19770
19788
|
const svelteIndexDir = join37(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19771
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
19789
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve30(file5).startsWith(resolve30(sveltePagesPath)));
|
|
19772
19790
|
for (const entry of sveltePageEntries) {
|
|
19773
19791
|
const name = basename11(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19774
19792
|
const indexFile = join37(svelteIndexDir, "pages", `${name}.js`);
|
|
19775
19793
|
if (!existsSync27(indexFile))
|
|
19776
19794
|
continue;
|
|
19777
19795
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19778
|
-
const srcRel =
|
|
19796
|
+
const srcRel = relative14(process.cwd(), resolve30(entry)).replace(/\\/g, "/");
|
|
19779
19797
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19780
19798
|
writeFileSync11(join37(devIndexDir, `${name}.svelte.js`), content);
|
|
19781
19799
|
}
|
|
19782
19800
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19783
19801
|
const vueIndexDir = join37(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19784
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
19802
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve30(file5).startsWith(resolve30(vuePagesPath)));
|
|
19785
19803
|
for (const entry of vuePageEntries) {
|
|
19786
19804
|
const name = basename11(entry, ".vue");
|
|
19787
19805
|
const indexFile = join37(vueIndexDir, `${name}.js`);
|
|
19788
19806
|
if (!existsSync27(indexFile))
|
|
19789
19807
|
continue;
|
|
19790
19808
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19791
|
-
const srcRel =
|
|
19809
|
+
const srcRel = relative14(process.cwd(), resolve30(entry)).replace(/\\/g, "/");
|
|
19792
19810
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19793
19811
|
writeFileSync11(join37(devIndexDir, `${name}.vue.js`), content);
|
|
19794
19812
|
}
|
|
@@ -19801,7 +19819,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19801
19819
|
const last = allComments[allComments.length - 1];
|
|
19802
19820
|
if (!last?.[1])
|
|
19803
19821
|
return JSON.stringify(outputPath);
|
|
19804
|
-
const srcPath =
|
|
19822
|
+
const srcPath = resolve30(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19805
19823
|
return JSON.stringify(srcPath);
|
|
19806
19824
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19807
19825
|
let depth = 0;
|
|
@@ -19863,7 +19881,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19863
19881
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19864
19882
|
const urlFileMap = new Map;
|
|
19865
19883
|
for (const srcPath of urlReferencedFiles) {
|
|
19866
|
-
const rel =
|
|
19884
|
+
const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19867
19885
|
const name = basename11(srcPath);
|
|
19868
19886
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19869
19887
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -19878,7 +19896,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19878
19896
|
const output = nonReactClientOutputs.find((artifact) => basename11(artifact.path).startsWith(`${srcBase}.`));
|
|
19879
19897
|
if (!output)
|
|
19880
19898
|
continue;
|
|
19881
|
-
urlFileMap.set(basename11(srcPath), `/${
|
|
19899
|
+
urlFileMap.set(basename11(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19882
19900
|
}
|
|
19883
19901
|
return urlFileMap;
|
|
19884
19902
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -20127,13 +20145,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20127
20145
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
20128
20146
|
if (!isIncremental || !incrementalFiles)
|
|
20129
20147
|
return entryPoints;
|
|
20130
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
20148
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve30(f2)));
|
|
20131
20149
|
const matchingEntries = [];
|
|
20132
20150
|
for (const entry of entryPoints) {
|
|
20133
20151
|
const sourceFile = mapToSource(entry);
|
|
20134
20152
|
if (!sourceFile)
|
|
20135
20153
|
continue;
|
|
20136
|
-
if (!normalizedIncremental.has(
|
|
20154
|
+
if (!normalizedIncremental.has(resolve30(sourceFile)))
|
|
20137
20155
|
continue;
|
|
20138
20156
|
matchingEntries.push(entry);
|
|
20139
20157
|
}
|
|
@@ -20298,7 +20316,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20298
20316
|
}
|
|
20299
20317
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
20300
20318
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20301
|
-
if (entry.startsWith(
|
|
20319
|
+
if (entry.startsWith(resolve30(reactIndexesPath))) {
|
|
20302
20320
|
const pageName = basename11(entry, ".tsx");
|
|
20303
20321
|
return join37(reactPagesPath, `${pageName}.tsx`);
|
|
20304
20322
|
}
|
|
@@ -20333,10 +20351,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20333
20351
|
const shouldCompileIslandSvelte = svelteDir && islandSvelteSources.length > 0;
|
|
20334
20352
|
const shouldCompileIslandVue = vueDir && islandVueSources.length > 0;
|
|
20335
20353
|
const shouldCompileIslandAngular = angularDir && islandAngularSources.length > 0;
|
|
20354
|
+
let angularProvidersEntryAddons = [];
|
|
20336
20355
|
if (shouldCompileAngular && angularDir) {
|
|
20337
20356
|
await tracePhase("scan/angular-handlers", async () => {
|
|
20338
20357
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
20339
|
-
runAngularHandlerScan2(projectRoot, angularDir);
|
|
20358
|
+
const scanResult = runAngularHandlerScan2(projectRoot, angularDir);
|
|
20359
|
+
angularProvidersEntryAddons = scanResult.angularEntryAddons;
|
|
20340
20360
|
});
|
|
20341
20361
|
}
|
|
20342
20362
|
const [
|
|
@@ -20361,7 +20381,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20361
20381
|
},
|
|
20362
20382
|
shouldCompileAngular ? tracePhase("compile/angular", async () => {
|
|
20363
20383
|
const mod = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
20364
|
-
const
|
|
20384
|
+
const combinedAngularEntries = angularProvidersEntryAddons.length > 0 ? [...angularEntries, ...angularProvidersEntryAddons] : angularEntries;
|
|
20385
|
+
const result = await mod.compileAngular(combinedAngularEntries, angularDir, hmr, styleTransformConfig);
|
|
20365
20386
|
if (hmr) {
|
|
20366
20387
|
try {
|
|
20367
20388
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
@@ -20411,7 +20432,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20411
20432
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20412
20433
|
if (!sourcePath || !clientPath)
|
|
20413
20434
|
continue;
|
|
20414
|
-
islandSvelteClientPathMap.set(
|
|
20435
|
+
islandSvelteClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20415
20436
|
}
|
|
20416
20437
|
const islandVueClientPathMap = new Map;
|
|
20417
20438
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20419,7 +20440,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20419
20440
|
const clientPath = islandVueClientPaths[idx];
|
|
20420
20441
|
if (!sourcePath || !clientPath)
|
|
20421
20442
|
continue;
|
|
20422
|
-
islandVueClientPathMap.set(
|
|
20443
|
+
islandVueClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20423
20444
|
}
|
|
20424
20445
|
const islandAngularClientPathMap = new Map;
|
|
20425
20446
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20427,7 +20448,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20427
20448
|
const clientPath = islandAngularClientPaths[idx];
|
|
20428
20449
|
if (!sourcePath || !clientPath)
|
|
20429
20450
|
continue;
|
|
20430
|
-
islandAngularClientPathMap.set(
|
|
20451
|
+
islandAngularClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20431
20452
|
}
|
|
20432
20453
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20433
20454
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20881,7 +20902,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20881
20902
|
const fileDir = dirname21(artifact.path);
|
|
20882
20903
|
const relativePaths = {};
|
|
20883
20904
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20884
|
-
const rel =
|
|
20905
|
+
const rel = relative14(fileDir, absolute);
|
|
20885
20906
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20886
20907
|
}
|
|
20887
20908
|
return relativePaths;
|
|
@@ -20950,7 +20971,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20950
20971
|
if (skipAngularClientBundle) {
|
|
20951
20972
|
for (const clientPath of angularClientPaths) {
|
|
20952
20973
|
const fileBase = basename11(clientPath, ".js");
|
|
20953
|
-
const relFromCwd =
|
|
20974
|
+
const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20954
20975
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20955
20976
|
}
|
|
20956
20977
|
}
|
|
@@ -21352,7 +21373,7 @@ __export(exports_dependencyGraph, {
|
|
|
21352
21373
|
});
|
|
21353
21374
|
import { existsSync as existsSync29, readFileSync as readFileSync21 } from "fs";
|
|
21354
21375
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21355
|
-
import { resolve as
|
|
21376
|
+
import { resolve as resolve31 } from "path";
|
|
21356
21377
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
21357
21378
|
const lower = filePath.toLowerCase();
|
|
21358
21379
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21366,8 +21387,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21366
21387
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21367
21388
|
return null;
|
|
21368
21389
|
}
|
|
21369
|
-
const fromDir =
|
|
21370
|
-
const normalized =
|
|
21390
|
+
const fromDir = resolve31(fromFile, "..");
|
|
21391
|
+
const normalized = resolve31(fromDir, importPath);
|
|
21371
21392
|
const extensions = [
|
|
21372
21393
|
".ts",
|
|
21373
21394
|
".tsx",
|
|
@@ -21397,7 +21418,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21397
21418
|
dependents.delete(normalizedPath);
|
|
21398
21419
|
}
|
|
21399
21420
|
}, addFileToGraph = (graph, filePath) => {
|
|
21400
|
-
const normalizedPath =
|
|
21421
|
+
const normalizedPath = resolve31(filePath);
|
|
21401
21422
|
if (!existsSync29(normalizedPath))
|
|
21402
21423
|
return;
|
|
21403
21424
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21424,10 +21445,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21424
21445
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21425
21446
|
const processedFiles = new Set;
|
|
21426
21447
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21427
|
-
const resolvedDirs = directories.map((dir) =>
|
|
21448
|
+
const resolvedDirs = directories.map((dir) => resolve31(dir)).filter((dir) => existsSync29(dir));
|
|
21428
21449
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21429
21450
|
for (const file5 of allFiles) {
|
|
21430
|
-
const fullPath =
|
|
21451
|
+
const fullPath = resolve31(file5);
|
|
21431
21452
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21432
21453
|
continue;
|
|
21433
21454
|
if (processedFiles.has(fullPath))
|
|
@@ -21540,7 +21561,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21540
21561
|
return [];
|
|
21541
21562
|
}
|
|
21542
21563
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21543
|
-
const normalizedPath =
|
|
21564
|
+
const normalizedPath = resolve31(changedFile);
|
|
21544
21565
|
const affected = new Set;
|
|
21545
21566
|
const toProcess = [normalizedPath];
|
|
21546
21567
|
const processNode = (current) => {
|
|
@@ -21571,7 +21592,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21571
21592
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21572
21593
|
graph.dependents.delete(normalizedPath);
|
|
21573
21594
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21574
|
-
const normalizedPath =
|
|
21595
|
+
const normalizedPath = resolve31(filePath);
|
|
21575
21596
|
removeDepsForFile(graph, normalizedPath);
|
|
21576
21597
|
removeDependentsForFile(graph, normalizedPath);
|
|
21577
21598
|
};
|
|
@@ -21614,12 +21635,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21614
21635
|
};
|
|
21615
21636
|
|
|
21616
21637
|
// src/dev/configResolver.ts
|
|
21617
|
-
import { resolve as
|
|
21638
|
+
import { resolve as resolve32 } from "path";
|
|
21618
21639
|
var resolveBuildPaths = (config) => {
|
|
21619
21640
|
const cwd2 = process.cwd();
|
|
21620
21641
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21621
|
-
const withDefault = (value, fallback) => normalize(
|
|
21622
|
-
const optional = (value) => value ? normalize(
|
|
21642
|
+
const withDefault = (value, fallback) => normalize(resolve32(cwd2, value ?? fallback));
|
|
21643
|
+
const optional = (value) => value ? normalize(resolve32(cwd2, value)) : undefined;
|
|
21623
21644
|
return {
|
|
21624
21645
|
angularDir: optional(config.angularDirectory),
|
|
21625
21646
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21673,7 +21694,7 @@ var init_clientManager = __esm(() => {
|
|
|
21673
21694
|
|
|
21674
21695
|
// src/dev/pathUtils.ts
|
|
21675
21696
|
import { existsSync as existsSync30, readdirSync as readdirSync4, readFileSync as readFileSync22 } from "fs";
|
|
21676
|
-
import { dirname as dirname22, resolve as
|
|
21697
|
+
import { dirname as dirname22, resolve as resolve33 } from "path";
|
|
21677
21698
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21678
21699
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21679
21700
|
return "ignored";
|
|
@@ -21749,7 +21770,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21749
21770
|
return "unknown";
|
|
21750
21771
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21751
21772
|
const out = new Set;
|
|
21752
|
-
const angularRoot =
|
|
21773
|
+
const angularRoot = resolve33(angularDir);
|
|
21753
21774
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21754
21775
|
const walk = (dir) => {
|
|
21755
21776
|
let entries;
|
|
@@ -21762,7 +21783,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21762
21783
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21763
21784
|
continue;
|
|
21764
21785
|
}
|
|
21765
|
-
const full =
|
|
21786
|
+
const full = resolve33(dir, entry.name);
|
|
21766
21787
|
if (entry.isDirectory()) {
|
|
21767
21788
|
walk(full);
|
|
21768
21789
|
continue;
|
|
@@ -21803,7 +21824,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21803
21824
|
}
|
|
21804
21825
|
const componentDir = dirname22(full);
|
|
21805
21826
|
for (const ref of refs) {
|
|
21806
|
-
const refAbs = normalizePath(
|
|
21827
|
+
const refAbs = normalizePath(resolve33(componentDir, ref));
|
|
21807
21828
|
const refDir = normalizePath(dirname22(refAbs));
|
|
21808
21829
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21809
21830
|
continue;
|
|
@@ -21820,7 +21841,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21820
21841
|
const push = (path) => {
|
|
21821
21842
|
if (!path)
|
|
21822
21843
|
return;
|
|
21823
|
-
const abs = normalizePath(
|
|
21844
|
+
const abs = normalizePath(resolve33(cwd2, path));
|
|
21824
21845
|
if (!roots.includes(abs))
|
|
21825
21846
|
roots.push(abs);
|
|
21826
21847
|
};
|
|
@@ -21845,7 +21866,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21845
21866
|
push(cfg.assetsDir);
|
|
21846
21867
|
push(cfg.stylesDir);
|
|
21847
21868
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21848
|
-
const abs = normalizePath(
|
|
21869
|
+
const abs = normalizePath(resolve33(cwd2, candidate));
|
|
21849
21870
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
21850
21871
|
roots.push(abs);
|
|
21851
21872
|
}
|
|
@@ -21857,7 +21878,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21857
21878
|
continue;
|
|
21858
21879
|
if (entry.name.startsWith("."))
|
|
21859
21880
|
continue;
|
|
21860
|
-
const abs = normalizePath(
|
|
21881
|
+
const abs = normalizePath(resolve33(cwd2, entry.name));
|
|
21861
21882
|
if (roots.includes(abs))
|
|
21862
21883
|
continue;
|
|
21863
21884
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21932,7 +21953,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21932
21953
|
// src/dev/fileWatcher.ts
|
|
21933
21954
|
import { watch } from "fs";
|
|
21934
21955
|
import { existsSync as existsSync31, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21935
|
-
import { dirname as dirname23, join as join39, resolve as
|
|
21956
|
+
import { dirname as dirname23, join as join39, resolve as resolve34 } from "path";
|
|
21936
21957
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21937
21958
|
try {
|
|
21938
21959
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -22013,7 +22034,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22013
22034
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
22014
22035
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22015
22036
|
paths.forEach((path) => {
|
|
22016
|
-
const absolutePath =
|
|
22037
|
+
const absolutePath = resolve34(path).replace(/\\/g, "/");
|
|
22017
22038
|
if (!existsSync31(absolutePath)) {
|
|
22018
22039
|
return;
|
|
22019
22040
|
}
|
|
@@ -22024,7 +22045,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22024
22045
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
22025
22046
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22026
22047
|
watchPaths.forEach((path) => {
|
|
22027
|
-
const absolutePath =
|
|
22048
|
+
const absolutePath = resolve34(path).replace(/\\/g, "/");
|
|
22028
22049
|
if (!existsSync31(absolutePath)) {
|
|
22029
22050
|
return;
|
|
22030
22051
|
}
|
|
@@ -22043,13 +22064,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
22043
22064
|
});
|
|
22044
22065
|
|
|
22045
22066
|
// src/dev/assetStore.ts
|
|
22046
|
-
import { resolve as
|
|
22067
|
+
import { resolve as resolve35 } from "path";
|
|
22047
22068
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
22048
22069
|
var mimeTypes, getMimeType = (filePath) => {
|
|
22049
22070
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
22050
22071
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
22051
22072
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
22052
|
-
const fullPath =
|
|
22073
|
+
const fullPath = resolve35(dir, entry.name);
|
|
22053
22074
|
if (entry.isDirectory()) {
|
|
22054
22075
|
return walkAndClean(fullPath);
|
|
22055
22076
|
}
|
|
@@ -22065,10 +22086,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22065
22086
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
22066
22087
|
const liveByIdentity = new Map;
|
|
22067
22088
|
for (const webPath of store.keys()) {
|
|
22068
|
-
const diskPath =
|
|
22089
|
+
const diskPath = resolve35(buildDir, webPath.slice(1));
|
|
22069
22090
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
22070
22091
|
}
|
|
22071
|
-
const absBuildDir =
|
|
22092
|
+
const absBuildDir = resolve35(buildDir);
|
|
22072
22093
|
Object.values(manifest).forEach((val) => {
|
|
22073
22094
|
if (!HASHED_FILE_RE.test(val))
|
|
22074
22095
|
return;
|
|
@@ -22086,7 +22107,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22086
22107
|
} catch {}
|
|
22087
22108
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
22088
22109
|
if (entry.isDirectory()) {
|
|
22089
|
-
return scanDir(
|
|
22110
|
+
return scanDir(resolve35(dir, entry.name), `${prefix}${entry.name}/`);
|
|
22090
22111
|
}
|
|
22091
22112
|
if (!entry.name.startsWith("chunk-")) {
|
|
22092
22113
|
return null;
|
|
@@ -22095,7 +22116,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22095
22116
|
if (store.has(webPath)) {
|
|
22096
22117
|
return null;
|
|
22097
22118
|
}
|
|
22098
|
-
return Bun.file(
|
|
22119
|
+
return Bun.file(resolve35(dir, entry.name)).bytes().then((bytes) => {
|
|
22099
22120
|
store.set(webPath, bytes);
|
|
22100
22121
|
return;
|
|
22101
22122
|
}).catch(() => {});
|
|
@@ -22117,7 +22138,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22117
22138
|
for (const webPath of newIdentities.values()) {
|
|
22118
22139
|
if (store.has(webPath))
|
|
22119
22140
|
continue;
|
|
22120
|
-
loadPromises.push(Bun.file(
|
|
22141
|
+
loadPromises.push(Bun.file(resolve35(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
22121
22142
|
store.set(webPath, bytes);
|
|
22122
22143
|
return;
|
|
22123
22144
|
}).catch(() => {}));
|
|
@@ -22243,9 +22264,9 @@ var init_transformCache = __esm(() => {
|
|
|
22243
22264
|
});
|
|
22244
22265
|
|
|
22245
22266
|
// src/dev/reactComponentClassifier.ts
|
|
22246
|
-
import { resolve as
|
|
22267
|
+
import { resolve as resolve36 } from "path";
|
|
22247
22268
|
var classifyComponent = (filePath) => {
|
|
22248
|
-
const normalizedPath =
|
|
22269
|
+
const normalizedPath = resolve36(filePath);
|
|
22249
22270
|
if (normalizedPath.includes("/react/pages/")) {
|
|
22250
22271
|
return "server";
|
|
22251
22272
|
}
|
|
@@ -22257,7 +22278,7 @@ var classifyComponent = (filePath) => {
|
|
|
22257
22278
|
var init_reactComponentClassifier = () => {};
|
|
22258
22279
|
|
|
22259
22280
|
// src/dev/moduleMapper.ts
|
|
22260
|
-
import { basename as basename12, resolve as
|
|
22281
|
+
import { basename as basename12, resolve as resolve37 } from "path";
|
|
22261
22282
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
22262
22283
|
const modulePaths = {};
|
|
22263
22284
|
moduleKeys.forEach((key) => {
|
|
@@ -22267,7 +22288,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22267
22288
|
});
|
|
22268
22289
|
return modulePaths;
|
|
22269
22290
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
22270
|
-
const normalizedFile =
|
|
22291
|
+
const normalizedFile = resolve37(sourceFile);
|
|
22271
22292
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
22272
22293
|
if (processedFiles.has(normalizedFile)) {
|
|
22273
22294
|
return null;
|
|
@@ -22303,7 +22324,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22303
22324
|
});
|
|
22304
22325
|
return grouped;
|
|
22305
22326
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22306
|
-
const normalizedFile =
|
|
22327
|
+
const normalizedFile = resolve37(sourceFile);
|
|
22307
22328
|
const fileName = basename12(normalizedFile);
|
|
22308
22329
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22309
22330
|
const pascalName = toPascal(baseName);
|
|
@@ -22365,7 +22386,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22365
22386
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22366
22387
|
});
|
|
22367
22388
|
import { readdirSync as readdirSync6, readFileSync as readFileSync24, statSync as statSync5 } from "fs";
|
|
22368
|
-
import { dirname as dirname24, extname as extname9, join as join40, resolve as
|
|
22389
|
+
import { dirname as dirname24, extname as extname9, join as join40, resolve as resolve38 } from "path";
|
|
22369
22390
|
import ts14 from "typescript";
|
|
22370
22391
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22371
22392
|
const out = [];
|
|
@@ -22478,7 +22499,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22478
22499
|
};
|
|
22479
22500
|
visit(sourceFile);
|
|
22480
22501
|
return out;
|
|
22481
|
-
}, safeNormalize = (path) =>
|
|
22502
|
+
}, safeNormalize = (path) => resolve38(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22482
22503
|
const { changedFilePath, userAngularRoot } = params;
|
|
22483
22504
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22484
22505
|
const out = [];
|
|
@@ -22547,7 +22568,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22547
22568
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22548
22569
|
return null;
|
|
22549
22570
|
}
|
|
22550
|
-
const base =
|
|
22571
|
+
const base = resolve38(childDir, spec);
|
|
22551
22572
|
const candidates = [
|
|
22552
22573
|
`${base}.ts`,
|
|
22553
22574
|
`${base}.tsx`,
|
|
@@ -22585,7 +22606,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22585
22606
|
};
|
|
22586
22607
|
if (cls.kind === "component") {
|
|
22587
22608
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22588
|
-
const abs = safeNormalize(
|
|
22609
|
+
const abs = safeNormalize(resolve38(componentDir, url));
|
|
22589
22610
|
const existing = resource.get(abs);
|
|
22590
22611
|
if (existing)
|
|
22591
22612
|
existing.push(entity);
|
|
@@ -22753,7 +22774,7 @@ __export(exports_moduleServer, {
|
|
|
22753
22774
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22754
22775
|
});
|
|
22755
22776
|
import { existsSync as existsSync32, readFileSync as readFileSync25, statSync as statSync6 } from "fs";
|
|
22756
|
-
import { basename as basename13, dirname as dirname25, extname as extname10, join as join41, resolve as
|
|
22777
|
+
import { basename as basename13, dirname as dirname25, extname as extname10, join as join41, resolve as resolve39, relative as relative15 } from "path";
|
|
22757
22778
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22758
22779
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22759
22780
|
const allExports = [];
|
|
@@ -22773,7 +22794,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22773
22794
|
${stubs}
|
|
22774
22795
|
`;
|
|
22775
22796
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22776
|
-
const found = extensions.find((ext) => existsSync32(
|
|
22797
|
+
const found = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
|
|
22777
22798
|
return found ? srcPath + found : srcPath;
|
|
22778
22799
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22779
22800
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22788,7 +22809,7 @@ ${stubs}
|
|
|
22788
22809
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22789
22810
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22790
22811
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22791
|
-
const absPath =
|
|
22812
|
+
const absPath = resolve39(projectRoot, relPath);
|
|
22792
22813
|
const cached = mtimeCache.get(absPath);
|
|
22793
22814
|
if (cached !== undefined)
|
|
22794
22815
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22800,12 +22821,12 @@ ${stubs}
|
|
|
22800
22821
|
return base;
|
|
22801
22822
|
}
|
|
22802
22823
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22803
|
-
const absPath =
|
|
22804
|
-
const rel =
|
|
22824
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22825
|
+
const rel = relative15(projectRoot, absPath);
|
|
22805
22826
|
const extension = extname10(rel);
|
|
22806
22827
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22807
22828
|
if (extname10(srcPath) === ".svelte") {
|
|
22808
|
-
srcPath =
|
|
22829
|
+
srcPath = relative15(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
|
|
22809
22830
|
}
|
|
22810
22831
|
return srcUrl(srcPath, projectRoot);
|
|
22811
22832
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22817,27 +22838,27 @@ ${stubs}
|
|
|
22817
22838
|
"import"
|
|
22818
22839
|
]);
|
|
22819
22840
|
if (fromExports)
|
|
22820
|
-
return
|
|
22841
|
+
return relative15(projectRoot, fromExports);
|
|
22821
22842
|
try {
|
|
22822
22843
|
const isScoped = specifier.startsWith("@");
|
|
22823
22844
|
const parts = specifier.split("/");
|
|
22824
22845
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22825
22846
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22826
22847
|
if (!subpath) {
|
|
22827
|
-
const pkgDir =
|
|
22848
|
+
const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
|
|
22828
22849
|
const pkgJsonPath = join41(pkgDir, "package.json");
|
|
22829
22850
|
if (existsSync32(pkgJsonPath)) {
|
|
22830
22851
|
const pkg = JSON.parse(readFileSync25(pkgJsonPath, "utf-8"));
|
|
22831
22852
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22832
22853
|
if (esmEntry) {
|
|
22833
|
-
const resolved =
|
|
22854
|
+
const resolved = resolve39(pkgDir, esmEntry);
|
|
22834
22855
|
if (existsSync32(resolved))
|
|
22835
|
-
return
|
|
22856
|
+
return relative15(projectRoot, resolved);
|
|
22836
22857
|
}
|
|
22837
22858
|
}
|
|
22838
22859
|
}
|
|
22839
22860
|
} catch {}
|
|
22840
|
-
return
|
|
22861
|
+
return relative15(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22841
22862
|
} catch {
|
|
22842
22863
|
return;
|
|
22843
22864
|
}
|
|
@@ -22868,22 +22889,22 @@ ${stubs}
|
|
|
22868
22889
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22869
22890
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22870
22891
|
if (absPath.startsWith(projectRoot)) {
|
|
22871
|
-
const rel2 =
|
|
22892
|
+
const rel2 = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22872
22893
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22873
22894
|
}
|
|
22874
|
-
const rel =
|
|
22895
|
+
const rel = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22875
22896
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22876
22897
|
};
|
|
22877
22898
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22878
22899
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22879
22900
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22880
|
-
const absPath =
|
|
22881
|
-
const rel =
|
|
22901
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22902
|
+
const rel = relative15(projectRoot, absPath);
|
|
22882
22903
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22883
22904
|
});
|
|
22884
22905
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22885
|
-
const absPath =
|
|
22886
|
-
const rel =
|
|
22906
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22907
|
+
const rel = relative15(projectRoot, absPath);
|
|
22887
22908
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22888
22909
|
});
|
|
22889
22910
|
return result;
|
|
@@ -22939,7 +22960,7 @@ ${code}`;
|
|
|
22939
22960
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22940
22961
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22941
22962
|
${transpiled}`;
|
|
22942
|
-
const relPath =
|
|
22963
|
+
const relPath = relative15(projectRoot, filePath).replace(/\\/g, "/");
|
|
22943
22964
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22944
22965
|
transpiled += buildIslandMetadataExports(raw);
|
|
22945
22966
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23100,11 +23121,11 @@ ${code}`;
|
|
|
23100
23121
|
if (compiled.css?.code) {
|
|
23101
23122
|
const cssPath = `${filePath}.css`;
|
|
23102
23123
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23103
|
-
const cssUrl = srcUrl(
|
|
23124
|
+
const cssUrl = srcUrl(relative15(projectRoot, cssPath), projectRoot);
|
|
23104
23125
|
code = `import "${cssUrl}";
|
|
23105
23126
|
${code}`;
|
|
23106
23127
|
}
|
|
23107
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
23128
|
+
const moduleUrl = `${SRC_PREFIX}${relative15(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23108
23129
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23109
23130
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23110
23131
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23195,8 +23216,8 @@ ${code}`;
|
|
|
23195
23216
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23196
23217
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23197
23218
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23198
|
-
const hmrBase = vueDir ?
|
|
23199
|
-
const hmrId =
|
|
23219
|
+
const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
|
|
23220
|
+
const hmrId = relative15(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23200
23221
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23201
23222
|
result += [
|
|
23202
23223
|
"",
|
|
@@ -23359,7 +23380,7 @@ export default {};
|
|
|
23359
23380
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23360
23381
|
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);`);
|
|
23361
23382
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23362
|
-
const filePath =
|
|
23383
|
+
const filePath = resolve39(projectRoot, relPath);
|
|
23363
23384
|
const ext = extname10(filePath);
|
|
23364
23385
|
if (ext === ".svelte")
|
|
23365
23386
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23396,14 +23417,14 @@ export default {};
|
|
|
23396
23417
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23397
23418
|
const candidates = [
|
|
23398
23419
|
absoluteCandidate,
|
|
23399
|
-
|
|
23420
|
+
resolve39(projectRoot, tail)
|
|
23400
23421
|
];
|
|
23401
23422
|
try {
|
|
23402
23423
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23403
23424
|
const cfg = await loadConfig2();
|
|
23404
|
-
const angularDir = cfg.angularDirectory &&
|
|
23425
|
+
const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
|
|
23405
23426
|
if (angularDir)
|
|
23406
|
-
candidates.push(
|
|
23427
|
+
candidates.push(resolve39(angularDir, tail));
|
|
23407
23428
|
} catch {}
|
|
23408
23429
|
for (const candidate of candidates) {
|
|
23409
23430
|
if (await fileExists(candidate)) {
|
|
@@ -23434,7 +23455,7 @@ export default {};
|
|
|
23434
23455
|
if (!TRANSPILABLE.has(ext))
|
|
23435
23456
|
return;
|
|
23436
23457
|
const stat3 = statSync6(filePath);
|
|
23437
|
-
const resolvedVueDir = vueDir ?
|
|
23458
|
+
const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
|
|
23438
23459
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23439
23460
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23440
23461
|
if (isAngularGeneratedJs) {
|
|
@@ -23493,7 +23514,7 @@ export default {};
|
|
|
23493
23514
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23494
23515
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23495
23516
|
return handleBunWrapRequest();
|
|
23496
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23517
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
|
|
23497
23518
|
if (virtualCssResponse)
|
|
23498
23519
|
return virtualCssResponse;
|
|
23499
23520
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23509,11 +23530,11 @@ export default {};
|
|
|
23509
23530
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23510
23531
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23511
23532
|
if (match[1])
|
|
23512
|
-
files.push(
|
|
23533
|
+
files.push(resolve39(projectRoot, match[1]));
|
|
23513
23534
|
}
|
|
23514
23535
|
return files;
|
|
23515
23536
|
}, invalidateModule = (filePath) => {
|
|
23516
|
-
const resolved =
|
|
23537
|
+
const resolved = resolve39(filePath);
|
|
23517
23538
|
invalidate(filePath);
|
|
23518
23539
|
if (resolved !== filePath)
|
|
23519
23540
|
invalidate(resolved);
|
|
@@ -23658,7 +23679,7 @@ __export(exports_hmrCompiler, {
|
|
|
23658
23679
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23659
23680
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23660
23681
|
});
|
|
23661
|
-
import { dirname as dirname26, relative as
|
|
23682
|
+
import { dirname as dirname26, relative as relative16, resolve as resolve40 } from "path";
|
|
23662
23683
|
import { performance as performance2 } from "perf_hooks";
|
|
23663
23684
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23664
23685
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23667,8 +23688,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23667
23688
|
return null;
|
|
23668
23689
|
const filePathRel = decoded.slice(0, at2);
|
|
23669
23690
|
const className = decoded.slice(at2 + 1);
|
|
23670
|
-
const componentFilePath =
|
|
23671
|
-
const projectRelPath =
|
|
23691
|
+
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
23692
|
+
const projectRelPath = relative16(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23672
23693
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23673
23694
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23674
23695
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23690,7 +23711,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23690
23711
|
}
|
|
23691
23712
|
return null;
|
|
23692
23713
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23693
|
-
const projectRel =
|
|
23714
|
+
const projectRel = relative16(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23694
23715
|
return `${projectRel}@${className}`;
|
|
23695
23716
|
};
|
|
23696
23717
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23829,11 +23850,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23829
23850
|
__export(exports_simpleHTMLHMR, {
|
|
23830
23851
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23831
23852
|
});
|
|
23832
|
-
import { resolve as
|
|
23853
|
+
import { resolve as resolve41 } from "path";
|
|
23833
23854
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23834
23855
|
let htmlContent;
|
|
23835
23856
|
try {
|
|
23836
|
-
const resolvedPath =
|
|
23857
|
+
const resolvedPath = resolve41(htmlFilePath);
|
|
23837
23858
|
const file5 = Bun.file(resolvedPath);
|
|
23838
23859
|
if (!await file5.exists()) {
|
|
23839
23860
|
return null;
|
|
@@ -23859,11 +23880,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23859
23880
|
__export(exports_simpleHTMXHMR, {
|
|
23860
23881
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23861
23882
|
});
|
|
23862
|
-
import { resolve as
|
|
23883
|
+
import { resolve as resolve42 } from "path";
|
|
23863
23884
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23864
23885
|
let htmlContent;
|
|
23865
23886
|
try {
|
|
23866
|
-
const resolvedPath =
|
|
23887
|
+
const resolvedPath = resolve42(htmxFilePath);
|
|
23867
23888
|
const file5 = Bun.file(resolvedPath);
|
|
23868
23889
|
if (!await file5.exists()) {
|
|
23869
23890
|
return null;
|
|
@@ -23886,7 +23907,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23886
23907
|
|
|
23887
23908
|
// src/dev/rebuildTrigger.ts
|
|
23888
23909
|
import { existsSync as existsSync33, rmSync as rmSync3 } from "fs";
|
|
23889
|
-
import { basename as basename14, dirname as dirname27, join as join42, relative as
|
|
23910
|
+
import { basename as basename14, dirname as dirname27, join as join42, relative as relative17, resolve as resolve43, sep as sep4 } from "path";
|
|
23890
23911
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
23891
23912
|
if (!config.tailwind)
|
|
23892
23913
|
return;
|
|
@@ -23898,7 +23919,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23898
23919
|
if (!cssChanged)
|
|
23899
23920
|
return;
|
|
23900
23921
|
try {
|
|
23901
|
-
const outputPath =
|
|
23922
|
+
const outputPath = resolve43(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23902
23923
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23903
23924
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23904
23925
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23988,12 +24009,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23988
24009
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync33(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23989
24010
|
const config = state.config;
|
|
23990
24011
|
const cwd2 = process.cwd();
|
|
23991
|
-
const absDeleted =
|
|
24012
|
+
const absDeleted = resolve43(deletedFile).replace(/\\/g, "/");
|
|
23992
24013
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23993
24014
|
const dir = config[configKey];
|
|
23994
24015
|
if (!dir)
|
|
23995
24016
|
continue;
|
|
23996
|
-
const absDir =
|
|
24017
|
+
const absDir = resolve43(cwd2, dir).replace(/\\/g, "/");
|
|
23997
24018
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23998
24019
|
continue;
|
|
23999
24020
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -24017,7 +24038,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24017
24038
|
removeStaleGenerated(state, filePathInSet);
|
|
24018
24039
|
try {
|
|
24019
24040
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
24020
|
-
const deletedPathResolved =
|
|
24041
|
+
const deletedPathResolved = resolve43(filePathInSet);
|
|
24021
24042
|
affectedFiles.forEach((affectedFile) => {
|
|
24022
24043
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
24023
24044
|
validFiles.push(affectedFile);
|
|
@@ -24061,7 +24082,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24061
24082
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
24062
24083
|
return;
|
|
24063
24084
|
}
|
|
24064
|
-
const normalizedFilePath =
|
|
24085
|
+
const normalizedFilePath = resolve43(filePathInSet);
|
|
24065
24086
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
24066
24087
|
validFiles.push(normalizedFilePath);
|
|
24067
24088
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24199,7 +24220,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24199
24220
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24200
24221
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24201
24222
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24202
|
-
const absSource =
|
|
24223
|
+
const absSource = resolve43(filePath);
|
|
24203
24224
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24204
24225
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24205
24226
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24207,7 +24228,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24207
24228
|
try {
|
|
24208
24229
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24209
24230
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24210
|
-
const destPath =
|
|
24231
|
+
const destPath = resolve43(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24211
24232
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24212
24233
|
const { dirname: dirname28 } = await import("path");
|
|
24213
24234
|
await mkdir7(dirname28(destPath), { recursive: true });
|
|
@@ -24216,7 +24237,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24216
24237
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24217
24238
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24218
24239
|
state.fileHashes.set(absSource, currentHash);
|
|
24219
|
-
logHmrUpdate(
|
|
24240
|
+
logHmrUpdate(relative17(process.cwd(), filePath));
|
|
24220
24241
|
broadcastToClients(state, {
|
|
24221
24242
|
data: {
|
|
24222
24243
|
framework: urlPrefix || "public",
|
|
@@ -24233,18 +24254,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24233
24254
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24234
24255
|
return;
|
|
24235
24256
|
if (framework === "unknown") {
|
|
24236
|
-
invalidate(
|
|
24237
|
-
const relPath =
|
|
24257
|
+
invalidate(resolve43(filePath));
|
|
24258
|
+
const relPath = relative17(process.cwd(), filePath);
|
|
24238
24259
|
logHmrUpdate(relPath);
|
|
24239
24260
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24240
24261
|
let hasAngularDependent = false;
|
|
24241
24262
|
if (angularDir && state.dependencyGraph) {
|
|
24242
24263
|
try {
|
|
24243
24264
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24244
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24245
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24265
|
+
addFileToGraph2(state.dependencyGraph, resolve43(filePath));
|
|
24266
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve43(filePath));
|
|
24246
24267
|
for (const dependent of affected) {
|
|
24247
|
-
if (dependent ===
|
|
24268
|
+
if (dependent === resolve43(filePath))
|
|
24248
24269
|
continue;
|
|
24249
24270
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24250
24271
|
if (dependentFramework !== "angular")
|
|
@@ -24261,14 +24282,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24261
24282
|
} catch {}
|
|
24262
24283
|
}
|
|
24263
24284
|
if (!hasAngularDependent) {
|
|
24264
|
-
console.log(`[abs:restart] ${
|
|
24285
|
+
console.log(`[abs:restart] ${resolve43(filePath)}`);
|
|
24265
24286
|
return;
|
|
24266
24287
|
}
|
|
24267
24288
|
try {
|
|
24268
24289
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24269
24290
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24270
24291
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24271
|
-
const sourceAbs =
|
|
24292
|
+
const sourceAbs = resolve43(filePath).replace(/\\/g, "/");
|
|
24272
24293
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24273
24294
|
invalidateModuleServer(generatedTwin);
|
|
24274
24295
|
} catch {}
|
|
@@ -24302,7 +24323,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24302
24323
|
const userEditedFiles = new Set;
|
|
24303
24324
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24304
24325
|
for (const filePath2 of filePaths) {
|
|
24305
|
-
userEditedFiles.add(
|
|
24326
|
+
userEditedFiles.add(resolve43(filePath2));
|
|
24306
24327
|
}
|
|
24307
24328
|
});
|
|
24308
24329
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24331,7 +24352,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24331
24352
|
}
|
|
24332
24353
|
if (!graph)
|
|
24333
24354
|
return componentFile;
|
|
24334
|
-
const dependents = graph.dependents.get(
|
|
24355
|
+
const dependents = graph.dependents.get(resolve43(componentFile));
|
|
24335
24356
|
if (!dependents)
|
|
24336
24357
|
return componentFile;
|
|
24337
24358
|
for (const dep of dependents) {
|
|
@@ -24340,7 +24361,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24340
24361
|
}
|
|
24341
24362
|
return componentFile;
|
|
24342
24363
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24343
|
-
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") &&
|
|
24364
|
+
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve43(file5).startsWith(angularPagesPath));
|
|
24344
24365
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24345
24366
|
return pageEntries;
|
|
24346
24367
|
}
|
|
@@ -24349,7 +24370,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24349
24370
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24350
24371
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24351
24372
|
affected.forEach((file5) => {
|
|
24352
|
-
if (file5.endsWith(".ts") &&
|
|
24373
|
+
if (file5.endsWith(".ts") && resolve43(file5).startsWith(angularPagesPath)) {
|
|
24353
24374
|
resolvedPages.add(file5);
|
|
24354
24375
|
}
|
|
24355
24376
|
});
|
|
@@ -24390,8 +24411,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24390
24411
|
if (serverDirs.length <= 1) {
|
|
24391
24412
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24392
24413
|
return {
|
|
24393
|
-
serverOutDir:
|
|
24394
|
-
serverRoot:
|
|
24414
|
+
serverOutDir: resolve43(resolvedPaths.buildDir, basename14(dir)),
|
|
24415
|
+
serverRoot: resolve43(dir, "server")
|
|
24395
24416
|
};
|
|
24396
24417
|
}
|
|
24397
24418
|
return {
|
|
@@ -24552,8 +24573,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24552
24573
|
if (detected !== "unknown")
|
|
24553
24574
|
continue;
|
|
24554
24575
|
try {
|
|
24555
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24556
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24576
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve43(editedFile));
|
|
24577
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve43(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24557
24578
|
if (hasAngularConsumer) {
|
|
24558
24579
|
return {
|
|
24559
24580
|
kind: "rebootstrap",
|
|
@@ -24600,7 +24621,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24600
24621
|
}
|
|
24601
24622
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24602
24623
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24603
|
-
const angularDirAbs =
|
|
24624
|
+
const angularDirAbs = resolve43(angularDir).replace(/\\/g, "/");
|
|
24604
24625
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24605
24626
|
return {
|
|
24606
24627
|
kind: "rebootstrap",
|
|
@@ -24743,16 +24764,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24743
24764
|
};
|
|
24744
24765
|
const fire = () => {
|
|
24745
24766
|
ctx.debounceTimer = null;
|
|
24746
|
-
const
|
|
24767
|
+
const resolve44 = ctx.debouncedResolve;
|
|
24747
24768
|
ctx.debouncedResolve = null;
|
|
24748
24769
|
ctx.debouncedPromise = null;
|
|
24749
24770
|
if (ctx.inFlight) {
|
|
24750
24771
|
ctx.pending = true;
|
|
24751
|
-
ctx.inFlight.finally(() =>
|
|
24772
|
+
ctx.inFlight.finally(() => resolve44?.());
|
|
24752
24773
|
return;
|
|
24753
24774
|
}
|
|
24754
24775
|
ctx.inFlight = drive();
|
|
24755
|
-
ctx.inFlight.finally(() =>
|
|
24776
|
+
ctx.inFlight.finally(() => resolve44?.());
|
|
24756
24777
|
};
|
|
24757
24778
|
return ({ immediate = false } = {}) => {
|
|
24758
24779
|
if (!ctx.debouncedPromise) {
|
|
@@ -24779,9 +24800,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24779
24800
|
const diskRefreshPromise = (async () => {
|
|
24780
24801
|
if (!angularDir || editedFiles.size === 0)
|
|
24781
24802
|
return;
|
|
24782
|
-
const angularDirAbs =
|
|
24803
|
+
const angularDirAbs = resolve43(angularDir);
|
|
24783
24804
|
const filesUnderAngular = Array.from(editedFiles).filter((file5) => {
|
|
24784
|
-
const abs =
|
|
24805
|
+
const abs = resolve43(file5);
|
|
24785
24806
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24786
24807
|
});
|
|
24787
24808
|
if (filesUnderAngular.length === 0)
|
|
@@ -24803,7 +24824,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24803
24824
|
if (!ext)
|
|
24804
24825
|
continue;
|
|
24805
24826
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24806
|
-
tsFilesToRefresh.add(
|
|
24827
|
+
tsFilesToRefresh.add(resolve43(file5));
|
|
24807
24828
|
continue;
|
|
24808
24829
|
}
|
|
24809
24830
|
const owners = resolveOwningComponents2({
|
|
@@ -24811,7 +24832,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24811
24832
|
userAngularRoot: angularDirAbs
|
|
24812
24833
|
});
|
|
24813
24834
|
for (const owner of owners) {
|
|
24814
|
-
tsFilesToRefresh.add(
|
|
24835
|
+
tsFilesToRefresh.add(resolve43(owner.componentFilePath));
|
|
24815
24836
|
}
|
|
24816
24837
|
}
|
|
24817
24838
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24825,8 +24846,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24825
24846
|
try {
|
|
24826
24847
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24827
24848
|
for (const tsFile of tsFilesToRefresh) {
|
|
24828
|
-
const rel =
|
|
24829
|
-
const compiledFile =
|
|
24849
|
+
const rel = relative17(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24850
|
+
const compiledFile = resolve43(compiledRoot, rel);
|
|
24830
24851
|
invalidateModule2(compiledFile);
|
|
24831
24852
|
}
|
|
24832
24853
|
} catch {}
|
|
@@ -24877,7 +24898,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24877
24898
|
serverPaths.forEach((serverPath, idx) => {
|
|
24878
24899
|
const fileBase = basename14(serverPath, ".js");
|
|
24879
24900
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24880
|
-
state.manifest[toPascal(fileBase)] =
|
|
24901
|
+
state.manifest[toPascal(fileBase)] = resolve43(ssrPath);
|
|
24881
24902
|
});
|
|
24882
24903
|
if (clientPaths.length > 0) {
|
|
24883
24904
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24890,9 +24911,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24890
24911
|
const angularDir = config.angularDirectory ?? "";
|
|
24891
24912
|
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
24892
24913
|
for (const file5 of angularFiles) {
|
|
24893
|
-
state.fileHashes.set(
|
|
24914
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
24894
24915
|
}
|
|
24895
|
-
const angularPagesPath =
|
|
24916
|
+
const angularPagesPath = resolve43(angularDir, "pages");
|
|
24896
24917
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24897
24918
|
const tierStart = performance.now();
|
|
24898
24919
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -24924,7 +24945,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24924
24945
|
}, getModuleUrl = async (pageFile) => {
|
|
24925
24946
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24926
24947
|
invalidateModule2(pageFile);
|
|
24927
|
-
const rel =
|
|
24948
|
+
const rel = relative17(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24928
24949
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24929
24950
|
warmCache2(url);
|
|
24930
24951
|
return url;
|
|
@@ -24933,11 +24954,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24933
24954
|
if (isComponentFile2)
|
|
24934
24955
|
return primaryFile;
|
|
24935
24956
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24936
|
-
const nearest = findNearestComponent2(
|
|
24957
|
+
const nearest = findNearestComponent2(resolve43(primaryFile));
|
|
24937
24958
|
return nearest ?? primaryFile;
|
|
24938
24959
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24939
24960
|
for (const file5 of reactFiles) {
|
|
24940
|
-
state.fileHashes.set(
|
|
24961
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
24941
24962
|
}
|
|
24942
24963
|
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24943
24964
|
if (!primaryFile) {
|
|
@@ -24955,7 +24976,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24955
24976
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
24956
24977
|
if (pageModuleUrl) {
|
|
24957
24978
|
const serverDuration = Date.now() - startTime;
|
|
24958
|
-
state.lastHmrPath =
|
|
24979
|
+
state.lastHmrPath = relative17(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
24959
24980
|
state.lastHmrFramework = "react";
|
|
24960
24981
|
broadcastToClients(state, {
|
|
24961
24982
|
data: {
|
|
@@ -25018,7 +25039,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25018
25039
|
});
|
|
25019
25040
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
25020
25041
|
for (const file5 of svelteFiles) {
|
|
25021
|
-
state.fileHashes.set(
|
|
25042
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25022
25043
|
}
|
|
25023
25044
|
const serverDuration = Date.now() - startTime;
|
|
25024
25045
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25265,7 +25286,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25265
25286
|
});
|
|
25266
25287
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25267
25288
|
for (const file5 of [...vueFiles, ...nonVueFiles]) {
|
|
25268
|
-
state.fileHashes.set(
|
|
25289
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25269
25290
|
}
|
|
25270
25291
|
await invalidateNonVueModules(nonVueFiles);
|
|
25271
25292
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25414,7 +25435,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25414
25435
|
recursive: true,
|
|
25415
25436
|
withFileTypes: true
|
|
25416
25437
|
});
|
|
25417
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25438
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve43(emberPagesPath, entry.name));
|
|
25418
25439
|
} catch {
|
|
25419
25440
|
return [];
|
|
25420
25441
|
}
|
|
@@ -25426,10 +25447,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25426
25447
|
return state.manifest;
|
|
25427
25448
|
}
|
|
25428
25449
|
for (const file5 of emberFiles) {
|
|
25429
|
-
state.fileHashes.set(
|
|
25450
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25430
25451
|
}
|
|
25431
|
-
const emberPagesPath =
|
|
25432
|
-
const directPageEntries = emberFiles.filter((file5) =>
|
|
25452
|
+
const emberPagesPath = resolve43(emberDir, "pages");
|
|
25453
|
+
const directPageEntries = emberFiles.filter((file5) => resolve43(file5).startsWith(emberPagesPath));
|
|
25433
25454
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25434
25455
|
if (allPageEntries.length === 0) {
|
|
25435
25456
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25439,14 +25460,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25439
25460
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25440
25461
|
for (const serverPath of serverPaths) {
|
|
25441
25462
|
const fileBase = basename14(serverPath, ".js");
|
|
25442
|
-
state.manifest[toPascal(fileBase)] =
|
|
25463
|
+
state.manifest[toPascal(fileBase)] = resolve43(serverPath);
|
|
25443
25464
|
}
|
|
25444
25465
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25445
25466
|
invalidateEmberSsrCache2();
|
|
25446
25467
|
const duration = Date.now() - startTime;
|
|
25447
25468
|
const [primary] = emberFiles;
|
|
25448
25469
|
if (primary) {
|
|
25449
|
-
state.lastHmrPath =
|
|
25470
|
+
state.lastHmrPath = relative17(process.cwd(), primary).replace(/\\/g, "/");
|
|
25450
25471
|
state.lastHmrFramework = "ember";
|
|
25451
25472
|
logHmrUpdate(primary, "ember", duration);
|
|
25452
25473
|
}
|
|
@@ -25531,8 +25552,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25531
25552
|
if (!buildReference?.source) {
|
|
25532
25553
|
return;
|
|
25533
25554
|
}
|
|
25534
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25535
|
-
islandFiles.add(
|
|
25555
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve43(dirname27(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25556
|
+
islandFiles.add(resolve43(sourcePath));
|
|
25536
25557
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25537
25558
|
const registryPath = config.islands?.registry;
|
|
25538
25559
|
if (!registryPath) {
|
|
@@ -25540,7 +25561,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25540
25561
|
}
|
|
25541
25562
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25542
25563
|
const islandFiles = new Set([
|
|
25543
|
-
|
|
25564
|
+
resolve43(buildInfo.resolvedRegistryPath)
|
|
25544
25565
|
]);
|
|
25545
25566
|
for (const definition of buildInfo.definitions) {
|
|
25546
25567
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25551,7 +25572,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25551
25572
|
if (islandFiles.size === 0) {
|
|
25552
25573
|
return false;
|
|
25553
25574
|
}
|
|
25554
|
-
return filesToRebuild.some((file5) => islandFiles.has(
|
|
25575
|
+
return filesToRebuild.some((file5) => islandFiles.has(resolve43(file5)));
|
|
25555
25576
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25556
25577
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25557
25578
|
if (!shouldReload) {
|
|
@@ -25586,10 +25607,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25586
25607
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25587
25608
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25588
25609
|
if (isSingle) {
|
|
25589
|
-
return
|
|
25610
|
+
return resolve43(state.resolvedPaths.buildDir, "pages");
|
|
25590
25611
|
}
|
|
25591
25612
|
const dirName = framework === "html" ? basename14(config.htmlDirectory ?? "html") : basename14(config.htmxDirectory ?? "htmx");
|
|
25592
|
-
return
|
|
25613
|
+
return resolve43(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25593
25614
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25594
25615
|
try {
|
|
25595
25616
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25628,7 +25649,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25628
25649
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25629
25650
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25630
25651
|
const htmlPageName = basename14(pageFile);
|
|
25631
|
-
const builtHtmlPagePath =
|
|
25652
|
+
const builtHtmlPagePath = resolve43(outputHtmlPages, htmlPageName);
|
|
25632
25653
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25633
25654
|
});
|
|
25634
25655
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25689,11 +25710,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25689
25710
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25690
25711
|
const pascalName = toPascal(baseName);
|
|
25691
25712
|
const vueRoot = config.vueDirectory;
|
|
25692
|
-
const hmrId = vueRoot ?
|
|
25713
|
+
const hmrId = vueRoot ? relative17(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25693
25714
|
const cssKey = `${pascalName}CSS`;
|
|
25694
25715
|
const cssUrl = manifest[cssKey] || null;
|
|
25695
25716
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25696
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25717
|
+
const hmrMeta = vueHmrMetadata2.get(resolve43(vuePagePath));
|
|
25697
25718
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25698
25719
|
if (changeType === "style-only") {
|
|
25699
25720
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25878,7 +25899,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25878
25899
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25879
25900
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25880
25901
|
const htmxPageName = basename14(htmxPageFile);
|
|
25881
|
-
const builtHtmxPagePath =
|
|
25902
|
+
const builtHtmxPagePath = resolve43(outputHtmxPages, htmxPageName);
|
|
25882
25903
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25883
25904
|
});
|
|
25884
25905
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25987,7 +26008,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25987
26008
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25988
26009
|
writeFs(destPath, html);
|
|
25989
26010
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25990
|
-
const destPath =
|
|
26011
|
+
const destPath = resolve43(outputDir, basename14(sourceFile));
|
|
25991
26012
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25992
26013
|
const source = await Bun.file(sourceFile).text();
|
|
25993
26014
|
await Bun.write(destPath, source);
|
|
@@ -26129,7 +26150,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26129
26150
|
});
|
|
26130
26151
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
26131
26152
|
try {
|
|
26132
|
-
const outputPath =
|
|
26153
|
+
const outputPath = resolve43(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
26133
26154
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26134
26155
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26135
26156
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26543,7 +26564,7 @@ __export(exports_devBuild, {
|
|
|
26543
26564
|
});
|
|
26544
26565
|
import { readdir as readdir5 } from "fs/promises";
|
|
26545
26566
|
import { statSync as statSync7 } from "fs";
|
|
26546
|
-
import { resolve as
|
|
26567
|
+
import { resolve as resolve44 } from "path";
|
|
26547
26568
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26548
26569
|
const configuredDirs = [
|
|
26549
26570
|
config.reactDirectory,
|
|
@@ -26566,7 +26587,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26566
26587
|
return Object.keys(config).length > 0 ? config : null;
|
|
26567
26588
|
}, reloadConfig = async () => {
|
|
26568
26589
|
try {
|
|
26569
|
-
const configPath2 =
|
|
26590
|
+
const configPath2 = resolve44(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26570
26591
|
const source = await Bun.file(configPath2).text();
|
|
26571
26592
|
return parseDirectoryConfig(source);
|
|
26572
26593
|
} catch {
|
|
@@ -26673,7 +26694,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26673
26694
|
state.fileChangeQueue.clear();
|
|
26674
26695
|
}
|
|
26675
26696
|
}, handleCachedReload = async () => {
|
|
26676
|
-
const serverMtime = statSync7(
|
|
26697
|
+
const serverMtime = statSync7(resolve44(Bun.main)).mtimeMs;
|
|
26677
26698
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26678
26699
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26679
26700
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26710,8 +26731,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26710
26731
|
return true;
|
|
26711
26732
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26712
26733
|
const candidates = [
|
|
26713
|
-
|
|
26714
|
-
|
|
26734
|
+
resolve44(import.meta.dir, "..", "..", "package.json"),
|
|
26735
|
+
resolve44(import.meta.dir, "..", "package.json")
|
|
26715
26736
|
];
|
|
26716
26737
|
const [candidate, ...remaining] = candidates;
|
|
26717
26738
|
if (!candidate) {
|
|
@@ -26737,7 +26758,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26737
26758
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26738
26759
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26739
26760
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26740
|
-
const bytes = await Bun.file(
|
|
26761
|
+
const bytes = await Bun.file(resolve44(vendorDir, entry)).bytes();
|
|
26741
26762
|
assetStore.set(webPath, bytes);
|
|
26742
26763
|
}));
|
|
26743
26764
|
}, devBuild = async (config) => {
|
|
@@ -26816,11 +26837,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26816
26837
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26817
26838
|
recordStep("populate asset store", stepStartedAt);
|
|
26818
26839
|
stepStartedAt = performance.now();
|
|
26819
|
-
const reactVendorDir =
|
|
26820
|
-
const angularVendorDir =
|
|
26821
|
-
const svelteVendorDir =
|
|
26822
|
-
const vueVendorDir =
|
|
26823
|
-
const depVendorDir =
|
|
26840
|
+
const reactVendorDir = resolve44(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26841
|
+
const angularVendorDir = resolve44(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26842
|
+
const svelteVendorDir = resolve44(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26843
|
+
const vueVendorDir = resolve44(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26844
|
+
const depVendorDir = resolve44(state.resolvedPaths.buildDir, "vendor");
|
|
26824
26845
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26825
26846
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26826
26847
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26931,7 +26952,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26931
26952
|
manifest
|
|
26932
26953
|
};
|
|
26933
26954
|
globalThis.__hmrDevResult = result;
|
|
26934
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26955
|
+
globalThis.__hmrServerMtime = statSync7(resolve44(Bun.main)).mtimeMs;
|
|
26935
26956
|
return result;
|
|
26936
26957
|
};
|
|
26937
26958
|
var init_devBuild = __esm(() => {
|
|
@@ -27076,8 +27097,8 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
27076
27097
|
return null;
|
|
27077
27098
|
if (!pathname.startsWith("/"))
|
|
27078
27099
|
return null;
|
|
27079
|
-
const { resolve:
|
|
27080
|
-
const candidate =
|
|
27100
|
+
const { resolve: resolve45, normalize } = await import("path");
|
|
27101
|
+
const candidate = resolve45(buildDir, pathname.slice(1));
|
|
27081
27102
|
const normalizedBuild = normalize(buildDir);
|
|
27082
27103
|
if (!candidate.startsWith(normalizedBuild))
|
|
27083
27104
|
return null;
|
|
@@ -27161,12 +27182,12 @@ __export(exports_devtoolsJson, {
|
|
|
27161
27182
|
devtoolsJson: () => devtoolsJson
|
|
27162
27183
|
});
|
|
27163
27184
|
import { existsSync as existsSync34, mkdirSync as mkdirSync17, readFileSync as readFileSync26, writeFileSync as writeFileSync12 } from "fs";
|
|
27164
|
-
import { dirname as dirname28, join as join44, resolve as
|
|
27185
|
+
import { dirname as dirname28, join as join44, resolve as resolve45 } from "path";
|
|
27165
27186
|
import { Elysia as Elysia3 } from "elysia";
|
|
27166
27187
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
27167
27188
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
27168
27189
|
return uuid;
|
|
27169
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
27190
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve45(uuidCachePath ?? join44(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
27170
27191
|
if (!existsSync34(cachePath))
|
|
27171
27192
|
return null;
|
|
27172
27193
|
try {
|
|
@@ -27192,7 +27213,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
27192
27213
|
writeFileSync12(cachePath, uuid, "utf-8");
|
|
27193
27214
|
return setGlobalUuid(uuid);
|
|
27194
27215
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
27195
|
-
const rootPath =
|
|
27216
|
+
const rootPath = resolve45(options.projectRoot ?? process.cwd());
|
|
27196
27217
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
27197
27218
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
27198
27219
|
return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -27221,7 +27242,7 @@ __export(exports_imageOptimizer, {
|
|
|
27221
27242
|
imageOptimizer: () => imageOptimizer
|
|
27222
27243
|
});
|
|
27223
27244
|
import { existsSync as existsSync35 } from "fs";
|
|
27224
|
-
import { resolve as
|
|
27245
|
+
import { resolve as resolve46 } from "path";
|
|
27225
27246
|
import { Elysia as Elysia4 } from "elysia";
|
|
27226
27247
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
27227
27248
|
try {
|
|
@@ -27234,7 +27255,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
27234
27255
|
}
|
|
27235
27256
|
}, resolveLocalImage = (url, buildDir) => {
|
|
27236
27257
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
27237
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
27258
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve46(process.cwd()));
|
|
27238
27259
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
27239
27260
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
27240
27261
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -27641,7 +27662,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
27641
27662
|
});
|
|
27642
27663
|
import { existsSync as existsSync38, statSync as statSync8, watch as watch2 } from "fs";
|
|
27643
27664
|
import { createRequire as createRequire2 } from "module";
|
|
27644
|
-
import { dirname as dirname29, join as join48, resolve as
|
|
27665
|
+
import { dirname as dirname29, join as join48, resolve as resolve48 } from "path";
|
|
27645
27666
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS2.some((re2) => re2.test(filename)), startServerEntryWatcher = () => {
|
|
27646
27667
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
27647
27668
|
return;
|
|
@@ -27649,10 +27670,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
27649
27670
|
if (!main || !existsSync38(main))
|
|
27650
27671
|
return;
|
|
27651
27672
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
27652
|
-
const entryPath =
|
|
27673
|
+
const entryPath = resolve48(main);
|
|
27653
27674
|
const entryDir = dirname29(entryPath);
|
|
27654
27675
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
27655
|
-
const configPath2 =
|
|
27676
|
+
const configPath2 = resolve48(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
27656
27677
|
const configDir2 = dirname29(configPath2);
|
|
27657
27678
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
27658
27679
|
const recentlyHandled = new Map;
|
|
@@ -28300,7 +28321,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
28300
28321
|
// src/core/prepare.ts
|
|
28301
28322
|
init_loadConfig();
|
|
28302
28323
|
import { existsSync as existsSync36, readdirSync as readdirSync7, readFileSync as readFileSync28 } from "fs";
|
|
28303
|
-
import { basename as basename15, join as join46, relative as
|
|
28324
|
+
import { basename as basename15, join as join46, relative as relative18, resolve as resolve47 } from "path";
|
|
28304
28325
|
import { Elysia as Elysia5 } from "elysia";
|
|
28305
28326
|
|
|
28306
28327
|
// src/core/loadIslandRegistry.ts
|
|
@@ -28662,7 +28683,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
28662
28683
|
for (const { dir, pattern } of prewarmDirs) {
|
|
28663
28684
|
const glob = new Glob11(pattern);
|
|
28664
28685
|
const matches = [
|
|
28665
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
28686
|
+
...glob.scanSync({ absolute: true, cwd: resolve47(dir) })
|
|
28666
28687
|
];
|
|
28667
28688
|
files.push(...matches);
|
|
28668
28689
|
}
|
|
@@ -28673,7 +28694,7 @@ var warmPrewarmDirs = async (prewarmDirs, warmCache2, SRC_URL_PREFIX2) => {
|
|
|
28673
28694
|
for (const file5 of files) {
|
|
28674
28695
|
if (file5.includes("/node_modules/"))
|
|
28675
28696
|
continue;
|
|
28676
|
-
const rel =
|
|
28697
|
+
const rel = relative18(process.cwd(), file5).replace(/\\/g, "/");
|
|
28677
28698
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
28678
28699
|
}
|
|
28679
28700
|
};
|
|
@@ -28698,10 +28719,10 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
28698
28719
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
28699
28720
|
if (!fileName)
|
|
28700
28721
|
continue;
|
|
28701
|
-
const srcPath =
|
|
28722
|
+
const srcPath = resolve47(devIndexDir, fileName);
|
|
28702
28723
|
if (!existsSync36(srcPath))
|
|
28703
28724
|
continue;
|
|
28704
|
-
const rel =
|
|
28725
|
+
const rel = relative18(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
28705
28726
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
28706
28727
|
}
|
|
28707
28728
|
};
|
|
@@ -28771,7 +28792,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
28771
28792
|
stepStartedAt = performance.now();
|
|
28772
28793
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
28773
28794
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
28774
|
-
const devIndexDir =
|
|
28795
|
+
const devIndexDir = resolve47(buildDir, "_src_indexes");
|
|
28775
28796
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
28776
28797
|
recordStep("configure dev plugins", stepStartedAt);
|
|
28777
28798
|
stepStartedAt = performance.now();
|
|
@@ -28863,7 +28884,7 @@ var prepare = async (configOrPath) => {
|
|
|
28863
28884
|
recordStep("load config", stepStartedAt);
|
|
28864
28885
|
const nodeEnv = process.env["NODE_ENV"];
|
|
28865
28886
|
const isDev3 = nodeEnv === "development";
|
|
28866
|
-
const buildDir =
|
|
28887
|
+
const buildDir = resolve47(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
28867
28888
|
if (isDev3) {
|
|
28868
28889
|
stepStartedAt = performance.now();
|
|
28869
28890
|
const result = await prepareDev(config, buildDir);
|
|
@@ -29338,7 +29359,7 @@ var generateHeadElement = ({
|
|
|
29338
29359
|
// src/utils/defineEnv.ts
|
|
29339
29360
|
var {env: bunEnv } = globalThis.Bun;
|
|
29340
29361
|
import { existsSync as existsSync39, readFileSync as readFileSync30 } from "fs";
|
|
29341
|
-
import { resolve as
|
|
29362
|
+
import { resolve as resolve49 } from "path";
|
|
29342
29363
|
|
|
29343
29364
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
29344
29365
|
var exports_value = {};
|
|
@@ -35373,7 +35394,7 @@ ${lines.join(`
|
|
|
35373
35394
|
};
|
|
35374
35395
|
var checkEnvFileSecurity = (properties) => {
|
|
35375
35396
|
const cwd2 = process.cwd();
|
|
35376
|
-
const envPath =
|
|
35397
|
+
const envPath = resolve49(cwd2, ".env");
|
|
35377
35398
|
if (!existsSync39(envPath))
|
|
35378
35399
|
return;
|
|
35379
35400
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -35383,7 +35404,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
35383
35404
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
35384
35405
|
if (presentKeys.length === 0)
|
|
35385
35406
|
return;
|
|
35386
|
-
const gitignorePath =
|
|
35407
|
+
const gitignorePath = resolve49(cwd2, ".gitignore");
|
|
35387
35408
|
if (existsSync39(gitignorePath)) {
|
|
35388
35409
|
const gitignore = readFileSync30(gitignorePath, "utf-8");
|
|
35389
35410
|
if (gitignore.split(`
|
|
@@ -35626,5 +35647,5 @@ export {
|
|
|
35626
35647
|
ANGULAR_INIT_TIMEOUT_MS
|
|
35627
35648
|
};
|
|
35628
35649
|
|
|
35629
|
-
//# debugId=
|
|
35650
|
+
//# debugId=192D823B278E9AC264756E2164756E21
|
|
35630
35651
|
//# sourceMappingURL=index.js.map
|