@absolutejs/absolute 0.19.0-beta.973 → 0.19.0-beta.974
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 +479 -463
- package/dist/build.js.map +6 -6
- package/dist/index.js +489 -473
- package/dist/index.js.map +6 -6
- package/dist/src/build/emitAngularProvidersFiles.d.ts +2 -2
- 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,7 +12514,7 @@ 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);
|
|
12503
12519
|
return {
|
|
12504
12520
|
calls,
|
|
@@ -12584,22 +12600,22 @@ import {
|
|
|
12584
12600
|
join as join28,
|
|
12585
12601
|
basename as basename7,
|
|
12586
12602
|
extname as extname5,
|
|
12587
|
-
resolve as
|
|
12588
|
-
relative as
|
|
12603
|
+
resolve as resolve24,
|
|
12604
|
+
relative as relative10,
|
|
12589
12605
|
sep as sep2
|
|
12590
12606
|
} from "path";
|
|
12591
12607
|
import { env as env2 } from "process";
|
|
12592
12608
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
12593
12609
|
var resolveDevClientDir2 = () => {
|
|
12594
12610
|
const projectRoot = process.cwd();
|
|
12595
|
-
const fromSource =
|
|
12611
|
+
const fromSource = resolve24(import.meta.dir, "../dev/client");
|
|
12596
12612
|
if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
12597
12613
|
return fromSource;
|
|
12598
12614
|
}
|
|
12599
|
-
const fromNodeModules =
|
|
12615
|
+
const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
12600
12616
|
if (existsSync21(fromNodeModules))
|
|
12601
12617
|
return fromNodeModules;
|
|
12602
|
-
return
|
|
12618
|
+
return resolve24(import.meta.dir, "./dev/client");
|
|
12603
12619
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
12604
12620
|
persistentCache.clear();
|
|
12605
12621
|
sourceHashCache.clear();
|
|
@@ -12629,7 +12645,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12629
12645
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12630
12646
|
if (!spec.startsWith("."))
|
|
12631
12647
|
return null;
|
|
12632
|
-
const basePath =
|
|
12648
|
+
const basePath = resolve24(dirname16(from), spec);
|
|
12633
12649
|
const candidates = [
|
|
12634
12650
|
basePath,
|
|
12635
12651
|
`${basePath}.ts`,
|
|
@@ -12656,7 +12672,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12656
12672
|
const resolved = resolvePackageImport(spec);
|
|
12657
12673
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12658
12674
|
}
|
|
12659
|
-
const basePath =
|
|
12675
|
+
const basePath = resolve24(dirname16(from), spec);
|
|
12660
12676
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12661
12677
|
if (!explicit) {
|
|
12662
12678
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12677,8 +12693,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12677
12693
|
return jsPath;
|
|
12678
12694
|
return null;
|
|
12679
12695
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12680
|
-
const toServer =
|
|
12681
|
-
const toClient =
|
|
12696
|
+
const toServer = relative10(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12697
|
+
const toClient = relative10(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12682
12698
|
rewrites.set(rawSpec, {
|
|
12683
12699
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12684
12700
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12716,8 +12732,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12716
12732
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12717
12733
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12718
12734
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12719
|
-
const rawRel = dirname16(
|
|
12720
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12735
|
+
const rawRel = dirname16(relative10(svelteRoot, src)).replace(/\\/g, "/");
|
|
12736
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12721
12737
|
const baseName = basename7(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12722
12738
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12723
12739
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12738,15 +12754,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12738
12754
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12739
12755
|
if (!resolved)
|
|
12740
12756
|
continue;
|
|
12741
|
-
const childRel =
|
|
12757
|
+
const childRel = relative10(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12742
12758
|
if (!childRel.startsWith(".."))
|
|
12743
12759
|
continue;
|
|
12744
12760
|
const childBuilt2 = cache.get(resolved);
|
|
12745
12761
|
if (!childBuilt2)
|
|
12746
12762
|
continue;
|
|
12747
12763
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12748
|
-
const toServer =
|
|
12749
|
-
const toClient =
|
|
12764
|
+
const toServer = relative10(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12765
|
+
const toClient = relative10(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12750
12766
|
externalRewrites.set(origSpec, {
|
|
12751
12767
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12752
12768
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12780,7 +12796,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12780
12796
|
}).js;
|
|
12781
12797
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12782
12798
|
if (mode === "client" && isDev2) {
|
|
12783
|
-
const moduleKey = `/@src/${
|
|
12799
|
+
const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12784
12800
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12785
12801
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12786
12802
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12829,10 +12845,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12829
12845
|
};
|
|
12830
12846
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
12831
12847
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
12832
|
-
const relClientDir = dirname16(
|
|
12848
|
+
const relClientDir = dirname16(relative10(clientDir, client2));
|
|
12833
12849
|
const name = basename7(client2, extname5(client2));
|
|
12834
12850
|
const indexPath = join28(indexDir, relClientDir, `${name}.js`);
|
|
12835
|
-
const importRaw =
|
|
12851
|
+
const importRaw = relative10(dirname16(indexPath), client2).split(sep2).join("/");
|
|
12836
12852
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12837
12853
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12838
12854
|
import "${hmrClientPath3}";
|
|
@@ -12909,7 +12925,7 @@ if (typeof window !== "undefined") {
|
|
|
12909
12925
|
return {
|
|
12910
12926
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
12911
12927
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
12912
|
-
const rel = dirname16(
|
|
12928
|
+
const rel = dirname16(relative10(clientDir, client2));
|
|
12913
12929
|
return join28(indexDir, rel, basename7(client2));
|
|
12914
12930
|
}),
|
|
12915
12931
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -13322,22 +13338,22 @@ import { mkdir as mkdir5 } from "fs/promises";
|
|
|
13322
13338
|
import {
|
|
13323
13339
|
basename as basename8,
|
|
13324
13340
|
dirname as dirname17,
|
|
13325
|
-
isAbsolute as
|
|
13341
|
+
isAbsolute as isAbsolute6,
|
|
13326
13342
|
join as join29,
|
|
13327
|
-
relative as
|
|
13328
|
-
resolve as
|
|
13343
|
+
relative as relative11,
|
|
13344
|
+
resolve as resolve25
|
|
13329
13345
|
} from "path";
|
|
13330
13346
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
13331
13347
|
var resolveDevClientDir3 = () => {
|
|
13332
13348
|
const projectRoot = process.cwd();
|
|
13333
|
-
const fromSource =
|
|
13349
|
+
const fromSource = resolve25(import.meta.dir, "../dev/client");
|
|
13334
13350
|
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
13335
13351
|
return fromSource;
|
|
13336
13352
|
}
|
|
13337
|
-
const fromNodeModules =
|
|
13353
|
+
const fromNodeModules = resolve25(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13338
13354
|
if (existsSync22(fromNodeModules))
|
|
13339
13355
|
return fromNodeModules;
|
|
13340
|
-
return
|
|
13356
|
+
return resolve25(import.meta.dir, "./dev/client");
|
|
13341
13357
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
13342
13358
|
scriptCache.clear();
|
|
13343
13359
|
scriptSetupCache.clear();
|
|
@@ -13376,14 +13392,14 @@ var resolveDevClientDir3 = () => {
|
|
|
13376
13392
|
return "template-only";
|
|
13377
13393
|
}
|
|
13378
13394
|
return "full";
|
|
13379
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13395
|
+
}, 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
13396
|
if (filePath.endsWith(".vue"))
|
|
13381
13397
|
return filePath.replace(/\.vue$/, ".js");
|
|
13382
13398
|
if (filePath.endsWith(".ts"))
|
|
13383
13399
|
return filePath.replace(/\.ts$/, ".js");
|
|
13384
13400
|
if (isStylePath(filePath)) {
|
|
13385
13401
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
13386
|
-
return
|
|
13402
|
+
return resolve25(sourceDir, filePath);
|
|
13387
13403
|
}
|
|
13388
13404
|
return filePath;
|
|
13389
13405
|
}
|
|
@@ -13409,7 +13425,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13409
13425
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13410
13426
|
if (cachedResult)
|
|
13411
13427
|
return cachedResult;
|
|
13412
|
-
const relativeFilePath =
|
|
13428
|
+
const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13413
13429
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13414
13430
|
const fileBaseName = basename8(sourceFilePath, ".vue");
|
|
13415
13431
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13447,12 +13463,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13447
13463
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13448
13464
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13449
13465
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13450
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") ||
|
|
13466
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute6(path)) && isStylePath(path)).map((path) => isAbsolute6(path) ? path : resolve25(dirname17(sourceFilePath), path));
|
|
13451
13467
|
for (const stylePath of stylePathsImported) {
|
|
13452
13468
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13453
13469
|
}
|
|
13454
13470
|
const childBuildResults = await Promise.all([
|
|
13455
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
13471
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve25(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13456
13472
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13457
13473
|
]);
|
|
13458
13474
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13546,7 +13562,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13546
13562
|
let result2 = code;
|
|
13547
13563
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13548
13564
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13549
|
-
let rel =
|
|
13565
|
+
let rel = relative11(dirname17(outputPath), targetPath).replace(/\\/g, "/");
|
|
13550
13566
|
if (!rel.startsWith("."))
|
|
13551
13567
|
rel = `./${rel}`;
|
|
13552
13568
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -13576,7 +13592,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13576
13592
|
hmrId,
|
|
13577
13593
|
serverPath: serverOutputPath,
|
|
13578
13594
|
tsHelperPaths: [
|
|
13579
|
-
...helperModulePaths.map((helper) =>
|
|
13595
|
+
...helperModulePaths.map((helper) => resolve25(dirname17(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13580
13596
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13581
13597
|
]
|
|
13582
13598
|
};
|
|
@@ -13599,7 +13615,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13599
13615
|
const buildCache = new Map;
|
|
13600
13616
|
const allTsHelperPaths = new Set;
|
|
13601
13617
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
13602
|
-
const result = await compileVueFile(
|
|
13618
|
+
const result = await compileVueFile(resolve25(entryPath), {
|
|
13603
13619
|
client: clientOutputDir,
|
|
13604
13620
|
css: cssOutputDir,
|
|
13605
13621
|
server: serverOutputDir
|
|
@@ -13607,7 +13623,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13607
13623
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13608
13624
|
const entryBaseName = basename8(entryPath, ".vue");
|
|
13609
13625
|
const indexOutputFile = join29(indexOutputDir, `${entryBaseName}.js`);
|
|
13610
|
-
const clientOutputFile = join29(clientOutputDir,
|
|
13626
|
+
const clientOutputFile = join29(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13611
13627
|
await mkdir5(dirname17(indexOutputFile), { recursive: true });
|
|
13612
13628
|
const vueHmrImports = isDev2 ? [
|
|
13613
13629
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -13615,7 +13631,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13615
13631
|
] : [];
|
|
13616
13632
|
await write3(indexOutputFile, [
|
|
13617
13633
|
...vueHmrImports,
|
|
13618
|
-
`import Comp, * as PageModule from "${
|
|
13634
|
+
`import Comp, * as PageModule from "${relative11(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13619
13635
|
'import { createSSRApp, createApp } from "vue";',
|
|
13620
13636
|
"",
|
|
13621
13637
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13759,7 +13775,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13759
13775
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13760
13776
|
const sourceCode = await file3(tsPath).text();
|
|
13761
13777
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13762
|
-
const relativeJsPath =
|
|
13778
|
+
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13763
13779
|
const outClientPath = join29(clientOutputDir, relativeJsPath);
|
|
13764
13780
|
const outServerPath = join29(serverOutputDir, relativeJsPath);
|
|
13765
13781
|
await mkdir5(dirname17(outClientPath), { recursive: true });
|
|
@@ -14266,7 +14282,7 @@ __export(exports_compileAngular, {
|
|
|
14266
14282
|
compileAngular: () => compileAngular
|
|
14267
14283
|
});
|
|
14268
14284
|
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
|
|
14285
|
+
import { join as join30, basename as basename9, sep as sep3, dirname as dirname18, resolve as resolve26, relative as relative12 } from "path";
|
|
14270
14286
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14271
14287
|
import ts9 from "typescript";
|
|
14272
14288
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -14274,10 +14290,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14274
14290
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
|
|
14275
14291
|
}, readTsconfigPathAliases = () => {
|
|
14276
14292
|
try {
|
|
14277
|
-
const configPath2 =
|
|
14293
|
+
const configPath2 = resolve26(process.cwd(), "tsconfig.json");
|
|
14278
14294
|
const config = ts9.readConfigFile(configPath2, ts9.sys.readFile).config;
|
|
14279
14295
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
14280
|
-
const baseUrl =
|
|
14296
|
+
const baseUrl = resolve26(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
14281
14297
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
14282
14298
|
return { aliases, baseUrl };
|
|
14283
14299
|
} catch {
|
|
@@ -14297,7 +14313,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14297
14313
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
14298
14314
|
for (const replacement of alias.replacements) {
|
|
14299
14315
|
const candidate = replacement.replace("*", wildcardValue);
|
|
14300
|
-
const resolved = resolveSourceFile(
|
|
14316
|
+
const resolved = resolveSourceFile(resolve26(baseUrl, candidate));
|
|
14301
14317
|
if (resolved)
|
|
14302
14318
|
return resolved;
|
|
14303
14319
|
}
|
|
@@ -14316,13 +14332,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14316
14332
|
];
|
|
14317
14333
|
return candidates.find((file4) => existsSync23(file4));
|
|
14318
14334
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
14319
|
-
const baseDir =
|
|
14335
|
+
const baseDir = resolve26(rootDir);
|
|
14320
14336
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
14321
14337
|
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
14322
14338
|
const scanCache = new Map;
|
|
14323
14339
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
14324
14340
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
14325
|
-
return resolveSourceFile(
|
|
14341
|
+
return resolveSourceFile(resolve26(fromDir, specifier));
|
|
14326
14342
|
}
|
|
14327
14343
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
14328
14344
|
if (aliased)
|
|
@@ -14331,7 +14347,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14331
14347
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
14332
14348
|
if (resolved.includes("/node_modules/"))
|
|
14333
14349
|
return;
|
|
14334
|
-
const absolute =
|
|
14350
|
+
const absolute = resolve26(resolved);
|
|
14335
14351
|
if (!absolute.startsWith(baseDir))
|
|
14336
14352
|
return;
|
|
14337
14353
|
return resolveSourceFile(absolute);
|
|
@@ -14347,7 +14363,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14347
14363
|
usesLegacyAnimations: false
|
|
14348
14364
|
});
|
|
14349
14365
|
}
|
|
14350
|
-
const resolved =
|
|
14366
|
+
const resolved = resolve26(actualPath);
|
|
14351
14367
|
const cached = scanCache.get(resolved);
|
|
14352
14368
|
if (cached)
|
|
14353
14369
|
return cached;
|
|
@@ -14376,7 +14392,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14376
14392
|
const actualPath = resolveSourceFile(filePath);
|
|
14377
14393
|
if (!actualPath)
|
|
14378
14394
|
return false;
|
|
14379
|
-
const resolved =
|
|
14395
|
+
const resolved = resolve26(actualPath);
|
|
14380
14396
|
if (visited.has(resolved))
|
|
14381
14397
|
return false;
|
|
14382
14398
|
visited.add(resolved);
|
|
@@ -14394,14 +14410,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14394
14410
|
return (entryPath) => visit(entryPath);
|
|
14395
14411
|
}, resolveDevClientDir4 = () => {
|
|
14396
14412
|
const projectRoot = process.cwd();
|
|
14397
|
-
const fromSource =
|
|
14413
|
+
const fromSource = resolve26(import.meta.dir, "../dev/client");
|
|
14398
14414
|
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14399
14415
|
return fromSource;
|
|
14400
14416
|
}
|
|
14401
|
-
const fromNodeModules =
|
|
14417
|
+
const fromNodeModules = resolve26(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14402
14418
|
if (existsSync23(fromNodeModules))
|
|
14403
14419
|
return fromNodeModules;
|
|
14404
|
-
return
|
|
14420
|
+
return resolve26(import.meta.dir, "./dev/client");
|
|
14405
14421
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
14406
14422
|
try {
|
|
14407
14423
|
return ts9.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -14444,11 +14460,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14444
14460
|
if (hasJsLikeExtension(path))
|
|
14445
14461
|
return `${path}${query}`;
|
|
14446
14462
|
const importerDir = dirname18(importerOutputPath);
|
|
14447
|
-
const fileCandidate =
|
|
14463
|
+
const fileCandidate = resolve26(importerDir, `${path}.js`);
|
|
14448
14464
|
if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
|
|
14449
14465
|
return `${path}.js${query}`;
|
|
14450
14466
|
}
|
|
14451
|
-
const indexCandidate =
|
|
14467
|
+
const indexCandidate = resolve26(importerDir, path, "index.js");
|
|
14452
14468
|
if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
|
|
14453
14469
|
return `${path}/index.js${query}`;
|
|
14454
14470
|
}
|
|
@@ -14476,7 +14492,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14476
14492
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14477
14493
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14478
14494
|
return null;
|
|
14479
|
-
const basePath =
|
|
14495
|
+
const basePath = resolve26(dirname18(fromFile), specifier);
|
|
14480
14496
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14481
14497
|
`${basePath}.ts`,
|
|
14482
14498
|
`${basePath}.tsx`,
|
|
@@ -14487,7 +14503,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14487
14503
|
join30(basePath, "index.mts"),
|
|
14488
14504
|
join30(basePath, "index.cts")
|
|
14489
14505
|
];
|
|
14490
|
-
return candidates.map((candidate) =>
|
|
14506
|
+
return candidates.map((candidate) => resolve26(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14491
14507
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
14492
14508
|
const hostSource = readFile6?.(fileName);
|
|
14493
14509
|
if (typeof hostSource === "string")
|
|
@@ -14522,7 +14538,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14522
14538
|
paths.push(join30(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14523
14539
|
}
|
|
14524
14540
|
}
|
|
14525
|
-
return paths.map((path) =>
|
|
14541
|
+
return paths.map((path) => resolve26(path));
|
|
14526
14542
|
}, readResourceCacheFile = async (cachePath) => {
|
|
14527
14543
|
try {
|
|
14528
14544
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -14564,7 +14580,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14564
14580
|
transformedFiles: 0
|
|
14565
14581
|
};
|
|
14566
14582
|
const transformFile = async (filePath) => {
|
|
14567
|
-
const resolvedPath =
|
|
14583
|
+
const resolvedPath = resolve26(filePath);
|
|
14568
14584
|
if (visited.has(resolvedPath))
|
|
14569
14585
|
return;
|
|
14570
14586
|
visited.add(resolvedPath);
|
|
@@ -14599,7 +14615,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14599
14615
|
return { stats, transformedSources };
|
|
14600
14616
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14601
14617
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14602
|
-
const outputPath =
|
|
14618
|
+
const outputPath = resolve26(join30(outDir, relative12(process.cwd(), resolve26(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14603
14619
|
return [
|
|
14604
14620
|
outputPath,
|
|
14605
14621
|
buildIslandMetadataExports(readFileSync18(inputPath, "utf-8"))
|
|
@@ -14610,7 +14626,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14610
14626
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14611
14627
|
const tsPath = __require.resolve("typescript");
|
|
14612
14628
|
const tsRootDir = dirname18(tsPath);
|
|
14613
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
14629
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve26(tsRootDir, "lib");
|
|
14614
14630
|
});
|
|
14615
14631
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
14616
14632
|
const options = {
|
|
@@ -14652,7 +14668,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14652
14668
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
14653
14669
|
};
|
|
14654
14670
|
const emitted = {};
|
|
14655
|
-
const resolvedOutDir =
|
|
14671
|
+
const resolvedOutDir = resolve26(outDir);
|
|
14656
14672
|
host.writeFile = (fileName, text) => {
|
|
14657
14673
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
14658
14674
|
emitted[relativePath] = text;
|
|
@@ -14674,12 +14690,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14674
14690
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
14675
14691
|
return source;
|
|
14676
14692
|
}
|
|
14677
|
-
const resolvedPath =
|
|
14693
|
+
const resolvedPath = resolve26(fileName);
|
|
14678
14694
|
return transformedSources.get(resolvedPath) ?? source;
|
|
14679
14695
|
};
|
|
14680
14696
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
14681
14697
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14682
|
-
const source = transformedSources.get(
|
|
14698
|
+
const source = transformedSources.get(resolve26(fileName));
|
|
14683
14699
|
if (source) {
|
|
14684
14700
|
return ts9.createSourceFile(fileName, source, languageVersion, true);
|
|
14685
14701
|
}
|
|
@@ -14703,7 +14719,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14703
14719
|
content,
|
|
14704
14720
|
target: join30(outDir, fileName)
|
|
14705
14721
|
}));
|
|
14706
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
14722
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve26(target)));
|
|
14707
14723
|
return rawEntries.map(({ content, target }) => {
|
|
14708
14724
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
14709
14725
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -14718,7 +14734,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14718
14734
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
14719
14735
|
});
|
|
14720
14736
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
14721
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
14737
|
+
processedContent += islandMetadataByOutputPath.get(resolve26(target)) ?? "";
|
|
14722
14738
|
return { content: processedContent, target };
|
|
14723
14739
|
});
|
|
14724
14740
|
});
|
|
@@ -14728,7 +14744,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14728
14744
|
})), { outputs: entries.length });
|
|
14729
14745
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
14730
14746
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
14731
|
-
jitContentCache.delete(
|
|
14747
|
+
jitContentCache.delete(resolve26(filePath));
|
|
14732
14748
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
14733
14749
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
14734
14750
|
let match;
|
|
@@ -14741,7 +14757,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14741
14757
|
}
|
|
14742
14758
|
return null;
|
|
14743
14759
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
14744
|
-
const sourceEntry =
|
|
14760
|
+
const sourceEntry = resolve26(import.meta.dir, "../angular/components/index.ts");
|
|
14745
14761
|
if (existsSync23(sourceEntry)) {
|
|
14746
14762
|
return sourceEntry.replace(/\\/g, "/");
|
|
14747
14763
|
}
|
|
@@ -14971,10 +14987,10 @@ ${fields}
|
|
|
14971
14987
|
source: result
|
|
14972
14988
|
};
|
|
14973
14989
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
14974
|
-
const entryPath =
|
|
14990
|
+
const entryPath = resolve26(inputPath);
|
|
14975
14991
|
const allOutputs = [];
|
|
14976
14992
|
const visited = new Set;
|
|
14977
|
-
const baseDir =
|
|
14993
|
+
const baseDir = resolve26(rootDir ?? process.cwd());
|
|
14978
14994
|
let usesLegacyAnimations = false;
|
|
14979
14995
|
const angularTranspiler = new Bun.Transpiler({
|
|
14980
14996
|
loader: "ts",
|
|
@@ -15002,7 +15018,7 @@ ${fields}
|
|
|
15002
15018
|
};
|
|
15003
15019
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
15004
15020
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
15005
|
-
return resolveSourceFile2(
|
|
15021
|
+
return resolveSourceFile2(resolve26(fromDir, specifier));
|
|
15006
15022
|
}
|
|
15007
15023
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
15008
15024
|
if (aliased)
|
|
@@ -15011,7 +15027,7 @@ ${fields}
|
|
|
15011
15027
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
15012
15028
|
if (resolved.includes("/node_modules/"))
|
|
15013
15029
|
return;
|
|
15014
|
-
const absolute =
|
|
15030
|
+
const absolute = resolve26(resolved);
|
|
15015
15031
|
if (!absolute.startsWith(baseDir))
|
|
15016
15032
|
return;
|
|
15017
15033
|
return resolveSourceFile2(absolute);
|
|
@@ -15060,13 +15076,13 @@ ${fields}
|
|
|
15060
15076
|
return `${prefix}${dots}`;
|
|
15061
15077
|
return `${prefix}../${dots}`;
|
|
15062
15078
|
});
|
|
15063
|
-
if (
|
|
15079
|
+
if (resolve26(actualPath) === entryPath) {
|
|
15064
15080
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
15065
15081
|
}
|
|
15066
15082
|
return processedContent;
|
|
15067
15083
|
};
|
|
15068
15084
|
const transpileFile = async (filePath) => {
|
|
15069
|
-
const resolved =
|
|
15085
|
+
const resolved = resolve26(filePath);
|
|
15070
15086
|
if (visited.has(resolved))
|
|
15071
15087
|
return;
|
|
15072
15088
|
visited.add(resolved);
|
|
@@ -15113,12 +15129,12 @@ ${fields}
|
|
|
15113
15129
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
15114
15130
|
if (!resolved2)
|
|
15115
15131
|
return null;
|
|
15116
|
-
const relativeImport =
|
|
15132
|
+
const relativeImport = relative12(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
15117
15133
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
15118
15134
|
importRewrites.set(specifier, relativeRewrite);
|
|
15119
15135
|
return resolved2;
|
|
15120
15136
|
}).filter((path) => Boolean(path));
|
|
15121
|
-
const isEntry =
|
|
15137
|
+
const isEntry = resolve26(actualPath) === resolve26(entryPath);
|
|
15122
15138
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
15123
15139
|
const cacheKey2 = actualPath;
|
|
15124
15140
|
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
|
|
@@ -15154,11 +15170,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15154
15170
|
const compiledRoot = compiledParent;
|
|
15155
15171
|
const indexesDir = join30(compiledParent, "indexes");
|
|
15156
15172
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
15157
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
15173
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve26(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
15158
15174
|
if (!hmr) {
|
|
15159
15175
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
15160
15176
|
const cwd = process.cwd();
|
|
15161
|
-
const angularSrcDir =
|
|
15177
|
+
const angularSrcDir = resolve26(outRoot);
|
|
15162
15178
|
if (!existsSync23(angularSrcDir))
|
|
15163
15179
|
return;
|
|
15164
15180
|
const jsonGlob = new Glob6("**/*.json");
|
|
@@ -15167,7 +15183,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15167
15183
|
cwd: angularSrcDir
|
|
15168
15184
|
})) {
|
|
15169
15185
|
const sourcePath = join30(angularSrcDir, rel);
|
|
15170
|
-
const cwdRel =
|
|
15186
|
+
const cwdRel = relative12(cwd, sourcePath);
|
|
15171
15187
|
const targetPath = join30(compiledRoot, cwdRel);
|
|
15172
15188
|
await fs5.mkdir(dirname18(targetPath), { recursive: true });
|
|
15173
15189
|
await fs5.copyFile(sourcePath, targetPath);
|
|
@@ -15176,8 +15192,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15176
15192
|
}
|
|
15177
15193
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
15178
15194
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
15179
|
-
const resolvedEntry =
|
|
15180
|
-
const relativeEntry =
|
|
15195
|
+
const resolvedEntry = resolve26(entry);
|
|
15196
|
+
const relativeEntry = relative12(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
15181
15197
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
15182
15198
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
15183
15199
|
entry: resolvedEntry
|
|
@@ -15188,10 +15204,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15188
15204
|
join30(compiledRoot, relativeEntry),
|
|
15189
15205
|
join30(compiledRoot, "pages", jsName),
|
|
15190
15206
|
join30(compiledRoot, jsName)
|
|
15191
|
-
].map((file4) =>
|
|
15207
|
+
].map((file4) => resolve26(file4));
|
|
15192
15208
|
const resolveRawServerFile = (candidatePaths) => {
|
|
15193
15209
|
const normalizedCandidates = [
|
|
15194
|
-
...candidatePaths.map((file4) =>
|
|
15210
|
+
...candidatePaths.map((file4) => resolve26(file4)),
|
|
15195
15211
|
...compiledFallbackPaths
|
|
15196
15212
|
];
|
|
15197
15213
|
let candidate = normalizedCandidates.find((file4) => existsSync23(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
@@ -15261,13 +15277,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15261
15277
|
`;
|
|
15262
15278
|
}
|
|
15263
15279
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15264
|
-
const relativePath =
|
|
15280
|
+
const relativePath = relative12(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15265
15281
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15266
15282
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
15267
15283
|
const providersFilePath = join30(compiledParent, "providers", `${manifestKeyForProviders}.providers.ts`);
|
|
15268
15284
|
const hasGeneratedProviders = existsSync23(providersFilePath);
|
|
15269
15285
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
15270
|
-
const rel =
|
|
15286
|
+
const rel = relative12(indexesDir, providersFilePath.replace(/\.ts$/, "")).replace(/\\/g, "/");
|
|
15271
15287
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15272
15288
|
})() : null;
|
|
15273
15289
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -16195,7 +16211,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16195
16211
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16196
16212
|
});
|
|
16197
16213
|
import { existsSync as existsSync24, readFileSync as readFileSync19, statSync as statSync2 } from "fs";
|
|
16198
|
-
import { dirname as dirname19, extname as extname6, relative as
|
|
16214
|
+
import { dirname as dirname19, extname as extname6, relative as relative13, resolve as resolve27 } from "path";
|
|
16199
16215
|
import ts13 from "typescript";
|
|
16200
16216
|
var fail = (reason, detail, location) => ({
|
|
16201
16217
|
ok: false,
|
|
@@ -16306,7 +16322,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16306
16322
|
})();
|
|
16307
16323
|
if (!decoratorName)
|
|
16308
16324
|
continue;
|
|
16309
|
-
const projectRel =
|
|
16325
|
+
const projectRel = relative13(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16310
16326
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16311
16327
|
if (decoratorName === "Component") {
|
|
16312
16328
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16499,7 +16515,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16499
16515
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
16500
16516
|
return true;
|
|
16501
16517
|
}
|
|
16502
|
-
const base =
|
|
16518
|
+
const base = resolve27(componentDir, spec);
|
|
16503
16519
|
const candidates = [
|
|
16504
16520
|
`${base}.ts`,
|
|
16505
16521
|
`${base}.tsx`,
|
|
@@ -17303,7 +17319,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17303
17319
|
return null;
|
|
17304
17320
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
17305
17321
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
17306
|
-
const base =
|
|
17322
|
+
const base = resolve27(fromDir, stripped);
|
|
17307
17323
|
const candidates = [
|
|
17308
17324
|
`${base}.d.ts`,
|
|
17309
17325
|
`${base}.d.mts`,
|
|
@@ -17327,7 +17343,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17327
17343
|
return null;
|
|
17328
17344
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
17329
17345
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
17330
|
-
const base =
|
|
17346
|
+
const base = resolve27(componentDir, spec);
|
|
17331
17347
|
const candidates = [
|
|
17332
17348
|
`${base}.ts`,
|
|
17333
17349
|
`${base}.tsx`,
|
|
@@ -17546,13 +17562,13 @@ var fail = (reason, detail, location) => ({
|
|
|
17546
17562
|
}
|
|
17547
17563
|
if (!matches)
|
|
17548
17564
|
continue;
|
|
17549
|
-
const resolved =
|
|
17565
|
+
const resolved = resolve27(componentDir, spec);
|
|
17550
17566
|
for (const ext of TS_EXTENSIONS) {
|
|
17551
17567
|
const candidate = resolved + ext;
|
|
17552
17568
|
if (existsSync24(candidate))
|
|
17553
17569
|
return candidate;
|
|
17554
17570
|
}
|
|
17555
|
-
const indexCandidate =
|
|
17571
|
+
const indexCandidate = resolve27(resolved, "index.ts");
|
|
17556
17572
|
if (existsSync24(indexCandidate))
|
|
17557
17573
|
return indexCandidate;
|
|
17558
17574
|
}
|
|
@@ -17785,7 +17801,7 @@ ${transpiled}
|
|
|
17785
17801
|
}
|
|
17786
17802
|
}${staticPatch}`;
|
|
17787
17803
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
17788
|
-
const abs =
|
|
17804
|
+
const abs = resolve27(componentDir, url);
|
|
17789
17805
|
if (!existsSync24(abs))
|
|
17790
17806
|
return null;
|
|
17791
17807
|
const ext = extname6(abs).toLowerCase();
|
|
@@ -17825,7 +17841,7 @@ ${block}
|
|
|
17825
17841
|
const cached = projectOptionsCache.get(projectRoot);
|
|
17826
17842
|
if (cached !== undefined)
|
|
17827
17843
|
return cached;
|
|
17828
|
-
const tsconfigPath =
|
|
17844
|
+
const tsconfigPath = resolve27(projectRoot, "tsconfig.json");
|
|
17829
17845
|
const opts = {};
|
|
17830
17846
|
if (existsSync24(tsconfigPath)) {
|
|
17831
17847
|
try {
|
|
@@ -17871,7 +17887,7 @@ ${block}
|
|
|
17871
17887
|
}
|
|
17872
17888
|
const kind = params.kind ?? "component";
|
|
17873
17889
|
if (kind !== "component") {
|
|
17874
|
-
const entityId = encodeURIComponent(`${
|
|
17890
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17875
17891
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17876
17892
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17877
17893
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17909,7 +17925,7 @@ ${block}
|
|
|
17909
17925
|
templateText = decoratorMeta.template;
|
|
17910
17926
|
templatePath = componentFilePath;
|
|
17911
17927
|
} else if (decoratorMeta.templateUrl) {
|
|
17912
|
-
const tplAbs =
|
|
17928
|
+
const tplAbs = resolve27(componentDir, decoratorMeta.templateUrl);
|
|
17913
17929
|
if (!existsSync24(tplAbs)) {
|
|
17914
17930
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
17915
17931
|
}
|
|
@@ -17955,7 +17971,7 @@ ${block}
|
|
|
17955
17971
|
return fail("class-not-found", "anonymous class");
|
|
17956
17972
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17957
17973
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17958
|
-
const projectRelPath =
|
|
17974
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17959
17975
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17960
17976
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17961
17977
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18672,7 +18688,7 @@ __export(exports_compileEmber, {
|
|
|
18672
18688
|
});
|
|
18673
18689
|
import { existsSync as existsSync25 } from "fs";
|
|
18674
18690
|
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
|
|
18691
|
+
import { basename as basename10, dirname as dirname20, extname as extname7, join as join31, resolve as resolve28 } from "path";
|
|
18676
18692
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
18677
18693
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18678
18694
|
if (cachedPreprocessor)
|
|
@@ -18768,7 +18784,7 @@ export const importSync = (specifier) => {
|
|
|
18768
18784
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18769
18785
|
if (!originalImporter)
|
|
18770
18786
|
return;
|
|
18771
|
-
const candidateBase =
|
|
18787
|
+
const candidateBase = resolve28(dirname20(originalImporter), args.path);
|
|
18772
18788
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18773
18789
|
for (const ext of extensionsToTry) {
|
|
18774
18790
|
const candidate = candidateBase + ext;
|
|
@@ -18827,7 +18843,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
18827
18843
|
export { PageComponent };
|
|
18828
18844
|
export default PageComponent;
|
|
18829
18845
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
18830
|
-
const resolvedEntry =
|
|
18846
|
+
const resolvedEntry = resolve28(entry);
|
|
18831
18847
|
const source = await file4(resolvedEntry).text();
|
|
18832
18848
|
let preprocessed = source;
|
|
18833
18849
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18847,8 +18863,8 @@ export default PageComponent;
|
|
|
18847
18863
|
mkdir6(serverDir, { recursive: true }),
|
|
18848
18864
|
mkdir6(clientDir, { recursive: true })
|
|
18849
18865
|
]);
|
|
18850
|
-
const tmpPagePath =
|
|
18851
|
-
const tmpHarnessPath =
|
|
18866
|
+
const tmpPagePath = resolve28(join31(tmpDir, `${baseName}.module.js`));
|
|
18867
|
+
const tmpHarnessPath = resolve28(join31(tmpDir, `${baseName}.harness.js`));
|
|
18852
18868
|
await Promise.all([
|
|
18853
18869
|
write4(tmpPagePath, transpiled),
|
|
18854
18870
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18890,7 +18906,7 @@ export default PageComponent;
|
|
|
18890
18906
|
serverPaths: outputs.map((o3) => o3.serverPath)
|
|
18891
18907
|
};
|
|
18892
18908
|
}, compileEmberFileSource = async (entry) => {
|
|
18893
|
-
const resolvedEntry =
|
|
18909
|
+
const resolvedEntry = resolve28(entry);
|
|
18894
18910
|
const source = await file4(resolvedEntry).text();
|
|
18895
18911
|
let preprocessed = source;
|
|
18896
18912
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -18923,24 +18939,24 @@ __export(exports_buildReactVendor, {
|
|
|
18923
18939
|
buildReactVendor: () => buildReactVendor
|
|
18924
18940
|
});
|
|
18925
18941
|
import { existsSync as existsSync26, mkdirSync as mkdirSync10 } from "fs";
|
|
18926
|
-
import { join as join32, resolve as
|
|
18942
|
+
import { join as join32, resolve as resolve29 } from "path";
|
|
18927
18943
|
import { rm as rm5 } from "fs/promises";
|
|
18928
18944
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18929
18945
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
18930
18946
|
const candidates = [
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18947
|
+
resolve29(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
18948
|
+
resolve29(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18949
|
+
resolve29(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
18950
|
+
resolve29(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
18951
|
+
resolve29(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
18952
|
+
resolve29(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
18937
18953
|
];
|
|
18938
18954
|
for (const candidate of candidates) {
|
|
18939
18955
|
if (existsSync26(candidate)) {
|
|
18940
18956
|
return candidate.replace(/\\/g, "/");
|
|
18941
18957
|
}
|
|
18942
18958
|
}
|
|
18943
|
-
return (candidates[0] ??
|
|
18959
|
+
return (candidates[0] ?? resolve29(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
18944
18960
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
18945
18961
|
try {
|
|
18946
18962
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -19590,7 +19606,7 @@ import {
|
|
|
19590
19606
|
statSync as statSync3,
|
|
19591
19607
|
writeFileSync as writeFileSync11
|
|
19592
19608
|
} from "fs";
|
|
19593
|
-
import { basename as basename11, dirname as dirname21, extname as extname8, join as join37, relative as
|
|
19609
|
+
import { basename as basename11, dirname as dirname21, extname as extname8, join as join37, relative as relative14, resolve as resolve30 } from "path";
|
|
19594
19610
|
import { cwd, env as env3, exit } from "process";
|
|
19595
19611
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19596
19612
|
var isDev2, isBuildTraceEnabled = () => {
|
|
@@ -19681,8 +19697,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19681
19697
|
}
|
|
19682
19698
|
}, resolveAbsoluteVersion = async () => {
|
|
19683
19699
|
const candidates = [
|
|
19684
|
-
|
|
19685
|
-
|
|
19700
|
+
resolve30(import.meta.dir, "..", "..", "package.json"),
|
|
19701
|
+
resolve30(import.meta.dir, "..", "package.json")
|
|
19686
19702
|
];
|
|
19687
19703
|
const resolveCandidate = async (remaining) => {
|
|
19688
19704
|
const [candidate, ...rest] = remaining;
|
|
@@ -19698,7 +19714,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19698
19714
|
};
|
|
19699
19715
|
await resolveCandidate(candidates);
|
|
19700
19716
|
}, SKIP_DIRS4, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
19701
|
-
const absPath =
|
|
19717
|
+
const absPath = resolve30(file5, "..", relPath);
|
|
19702
19718
|
try {
|
|
19703
19719
|
statSync3(absPath);
|
|
19704
19720
|
workerPaths.add(absPath);
|
|
@@ -19760,7 +19776,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19760
19776
|
return;
|
|
19761
19777
|
}
|
|
19762
19778
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
19763
|
-
const pagesRel =
|
|
19779
|
+
const pagesRel = relative14(process.cwd(), resolve30(reactPagesPath)).replace(/\\/g, "/");
|
|
19764
19780
|
for (const file5 of indexFiles) {
|
|
19765
19781
|
let content = readFileSync20(join37(reactIndexesPath, file5), "utf-8");
|
|
19766
19782
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -19768,27 +19784,27 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19768
19784
|
}
|
|
19769
19785
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19770
19786
|
const svelteIndexDir = join37(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19771
|
-
const sveltePageEntries = svelteEntries.filter((file5) =>
|
|
19787
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve30(file5).startsWith(resolve30(sveltePagesPath)));
|
|
19772
19788
|
for (const entry of sveltePageEntries) {
|
|
19773
19789
|
const name = basename11(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19774
19790
|
const indexFile = join37(svelteIndexDir, "pages", `${name}.js`);
|
|
19775
19791
|
if (!existsSync27(indexFile))
|
|
19776
19792
|
continue;
|
|
19777
19793
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19778
|
-
const srcRel =
|
|
19794
|
+
const srcRel = relative14(process.cwd(), resolve30(entry)).replace(/\\/g, "/");
|
|
19779
19795
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19780
19796
|
writeFileSync11(join37(devIndexDir, `${name}.svelte.js`), content);
|
|
19781
19797
|
}
|
|
19782
19798
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19783
19799
|
const vueIndexDir = join37(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19784
|
-
const vuePageEntries = vueEntries.filter((file5) =>
|
|
19800
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve30(file5).startsWith(resolve30(vuePagesPath)));
|
|
19785
19801
|
for (const entry of vuePageEntries) {
|
|
19786
19802
|
const name = basename11(entry, ".vue");
|
|
19787
19803
|
const indexFile = join37(vueIndexDir, `${name}.js`);
|
|
19788
19804
|
if (!existsSync27(indexFile))
|
|
19789
19805
|
continue;
|
|
19790
19806
|
let content = readFileSync20(indexFile, "utf-8");
|
|
19791
|
-
const srcRel =
|
|
19807
|
+
const srcRel = relative14(process.cwd(), resolve30(entry)).replace(/\\/g, "/");
|
|
19792
19808
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19793
19809
|
writeFileSync11(join37(devIndexDir, `${name}.vue.js`), content);
|
|
19794
19810
|
}
|
|
@@ -19801,7 +19817,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19801
19817
|
const last = allComments[allComments.length - 1];
|
|
19802
19818
|
if (!last?.[1])
|
|
19803
19819
|
return JSON.stringify(outputPath);
|
|
19804
|
-
const srcPath =
|
|
19820
|
+
const srcPath = resolve30(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
19805
19821
|
return JSON.stringify(srcPath);
|
|
19806
19822
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
19807
19823
|
let depth = 0;
|
|
@@ -19863,7 +19879,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19863
19879
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19864
19880
|
const urlFileMap = new Map;
|
|
19865
19881
|
for (const srcPath of urlReferencedFiles) {
|
|
19866
|
-
const rel =
|
|
19882
|
+
const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19867
19883
|
const name = basename11(srcPath);
|
|
19868
19884
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19869
19885
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -19878,7 +19894,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19878
19894
|
const output = nonReactClientOutputs.find((artifact) => basename11(artifact.path).startsWith(`${srcBase}.`));
|
|
19879
19895
|
if (!output)
|
|
19880
19896
|
continue;
|
|
19881
|
-
urlFileMap.set(basename11(srcPath), `/${
|
|
19897
|
+
urlFileMap.set(basename11(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19882
19898
|
}
|
|
19883
19899
|
return urlFileMap;
|
|
19884
19900
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -20127,13 +20143,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20127
20143
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
20128
20144
|
if (!isIncremental || !incrementalFiles)
|
|
20129
20145
|
return entryPoints;
|
|
20130
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
20146
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve30(f2)));
|
|
20131
20147
|
const matchingEntries = [];
|
|
20132
20148
|
for (const entry of entryPoints) {
|
|
20133
20149
|
const sourceFile = mapToSource(entry);
|
|
20134
20150
|
if (!sourceFile)
|
|
20135
20151
|
continue;
|
|
20136
|
-
if (!normalizedIncremental.has(
|
|
20152
|
+
if (!normalizedIncremental.has(resolve30(sourceFile)))
|
|
20137
20153
|
continue;
|
|
20138
20154
|
matchingEntries.push(entry);
|
|
20139
20155
|
}
|
|
@@ -20298,7 +20314,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20298
20314
|
}
|
|
20299
20315
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
20300
20316
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20301
|
-
if (entry.startsWith(
|
|
20317
|
+
if (entry.startsWith(resolve30(reactIndexesPath))) {
|
|
20302
20318
|
const pageName = basename11(entry, ".tsx");
|
|
20303
20319
|
return join37(reactPagesPath, `${pageName}.tsx`);
|
|
20304
20320
|
}
|
|
@@ -20411,7 +20427,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20411
20427
|
const clientPath = islandSvelteClientPaths[idx];
|
|
20412
20428
|
if (!sourcePath || !clientPath)
|
|
20413
20429
|
continue;
|
|
20414
|
-
islandSvelteClientPathMap.set(
|
|
20430
|
+
islandSvelteClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20415
20431
|
}
|
|
20416
20432
|
const islandVueClientPathMap = new Map;
|
|
20417
20433
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -20419,7 +20435,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20419
20435
|
const clientPath = islandVueClientPaths[idx];
|
|
20420
20436
|
if (!sourcePath || !clientPath)
|
|
20421
20437
|
continue;
|
|
20422
|
-
islandVueClientPathMap.set(
|
|
20438
|
+
islandVueClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20423
20439
|
}
|
|
20424
20440
|
const islandAngularClientPathMap = new Map;
|
|
20425
20441
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -20427,7 +20443,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20427
20443
|
const clientPath = islandAngularClientPaths[idx];
|
|
20428
20444
|
if (!sourcePath || !clientPath)
|
|
20429
20445
|
continue;
|
|
20430
|
-
islandAngularClientPathMap.set(
|
|
20446
|
+
islandAngularClientPathMap.set(resolve30(sourcePath), clientPath);
|
|
20431
20447
|
}
|
|
20432
20448
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
20433
20449
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -20881,7 +20897,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20881
20897
|
const fileDir = dirname21(artifact.path);
|
|
20882
20898
|
const relativePaths = {};
|
|
20883
20899
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20884
|
-
const rel =
|
|
20900
|
+
const rel = relative14(fileDir, absolute);
|
|
20885
20901
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20886
20902
|
}
|
|
20887
20903
|
return relativePaths;
|
|
@@ -20950,7 +20966,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20950
20966
|
if (skipAngularClientBundle) {
|
|
20951
20967
|
for (const clientPath of angularClientPaths) {
|
|
20952
20968
|
const fileBase = basename11(clientPath, ".js");
|
|
20953
|
-
const relFromCwd =
|
|
20969
|
+
const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20954
20970
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20955
20971
|
}
|
|
20956
20972
|
}
|
|
@@ -21352,7 +21368,7 @@ __export(exports_dependencyGraph, {
|
|
|
21352
21368
|
});
|
|
21353
21369
|
import { existsSync as existsSync29, readFileSync as readFileSync21 } from "fs";
|
|
21354
21370
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
21355
|
-
import { resolve as
|
|
21371
|
+
import { resolve as resolve31 } from "path";
|
|
21356
21372
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
21357
21373
|
const lower = filePath.toLowerCase();
|
|
21358
21374
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -21366,8 +21382,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21366
21382
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
21367
21383
|
return null;
|
|
21368
21384
|
}
|
|
21369
|
-
const fromDir =
|
|
21370
|
-
const normalized =
|
|
21385
|
+
const fromDir = resolve31(fromFile, "..");
|
|
21386
|
+
const normalized = resolve31(fromDir, importPath);
|
|
21371
21387
|
const extensions = [
|
|
21372
21388
|
".ts",
|
|
21373
21389
|
".tsx",
|
|
@@ -21397,7 +21413,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21397
21413
|
dependents.delete(normalizedPath);
|
|
21398
21414
|
}
|
|
21399
21415
|
}, addFileToGraph = (graph, filePath) => {
|
|
21400
|
-
const normalizedPath =
|
|
21416
|
+
const normalizedPath = resolve31(filePath);
|
|
21401
21417
|
if (!existsSync29(normalizedPath))
|
|
21402
21418
|
return;
|
|
21403
21419
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -21424,10 +21440,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21424
21440
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
21425
21441
|
const processedFiles = new Set;
|
|
21426
21442
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
21427
|
-
const resolvedDirs = directories.map((dir) =>
|
|
21443
|
+
const resolvedDirs = directories.map((dir) => resolve31(dir)).filter((dir) => existsSync29(dir));
|
|
21428
21444
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
21429
21445
|
for (const file5 of allFiles) {
|
|
21430
|
-
const fullPath =
|
|
21446
|
+
const fullPath = resolve31(file5);
|
|
21431
21447
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
21432
21448
|
continue;
|
|
21433
21449
|
if (processedFiles.has(fullPath))
|
|
@@ -21540,7 +21556,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21540
21556
|
return [];
|
|
21541
21557
|
}
|
|
21542
21558
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
21543
|
-
const normalizedPath =
|
|
21559
|
+
const normalizedPath = resolve31(changedFile);
|
|
21544
21560
|
const affected = new Set;
|
|
21545
21561
|
const toProcess = [normalizedPath];
|
|
21546
21562
|
const processNode = (current) => {
|
|
@@ -21571,7 +21587,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
21571
21587
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
21572
21588
|
graph.dependents.delete(normalizedPath);
|
|
21573
21589
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
21574
|
-
const normalizedPath =
|
|
21590
|
+
const normalizedPath = resolve31(filePath);
|
|
21575
21591
|
removeDepsForFile(graph, normalizedPath);
|
|
21576
21592
|
removeDependentsForFile(graph, normalizedPath);
|
|
21577
21593
|
};
|
|
@@ -21614,12 +21630,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
21614
21630
|
};
|
|
21615
21631
|
|
|
21616
21632
|
// src/dev/configResolver.ts
|
|
21617
|
-
import { resolve as
|
|
21633
|
+
import { resolve as resolve32 } from "path";
|
|
21618
21634
|
var resolveBuildPaths = (config) => {
|
|
21619
21635
|
const cwd2 = process.cwd();
|
|
21620
21636
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
21621
|
-
const withDefault = (value, fallback) => normalize(
|
|
21622
|
-
const optional = (value) => value ? normalize(
|
|
21637
|
+
const withDefault = (value, fallback) => normalize(resolve32(cwd2, value ?? fallback));
|
|
21638
|
+
const optional = (value) => value ? normalize(resolve32(cwd2, value)) : undefined;
|
|
21623
21639
|
return {
|
|
21624
21640
|
angularDir: optional(config.angularDirectory),
|
|
21625
21641
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -21673,7 +21689,7 @@ var init_clientManager = __esm(() => {
|
|
|
21673
21689
|
|
|
21674
21690
|
// src/dev/pathUtils.ts
|
|
21675
21691
|
import { existsSync as existsSync30, readdirSync as readdirSync4, readFileSync as readFileSync22 } from "fs";
|
|
21676
|
-
import { dirname as dirname22, resolve as
|
|
21692
|
+
import { dirname as dirname22, resolve as resolve33 } from "path";
|
|
21677
21693
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21678
21694
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21679
21695
|
return "ignored";
|
|
@@ -21749,7 +21765,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21749
21765
|
return "unknown";
|
|
21750
21766
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
21751
21767
|
const out = new Set;
|
|
21752
|
-
const angularRoot =
|
|
21768
|
+
const angularRoot = resolve33(angularDir);
|
|
21753
21769
|
const angularRootNormalized = normalizePath(angularRoot);
|
|
21754
21770
|
const walk = (dir) => {
|
|
21755
21771
|
let entries;
|
|
@@ -21762,7 +21778,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21762
21778
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
21763
21779
|
continue;
|
|
21764
21780
|
}
|
|
21765
|
-
const full =
|
|
21781
|
+
const full = resolve33(dir, entry.name);
|
|
21766
21782
|
if (entry.isDirectory()) {
|
|
21767
21783
|
walk(full);
|
|
21768
21784
|
continue;
|
|
@@ -21803,7 +21819,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21803
21819
|
}
|
|
21804
21820
|
const componentDir = dirname22(full);
|
|
21805
21821
|
for (const ref of refs) {
|
|
21806
|
-
const refAbs = normalizePath(
|
|
21822
|
+
const refAbs = normalizePath(resolve33(componentDir, ref));
|
|
21807
21823
|
const refDir = normalizePath(dirname22(refAbs));
|
|
21808
21824
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21809
21825
|
continue;
|
|
@@ -21820,7 +21836,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21820
21836
|
const push = (path) => {
|
|
21821
21837
|
if (!path)
|
|
21822
21838
|
return;
|
|
21823
|
-
const abs = normalizePath(
|
|
21839
|
+
const abs = normalizePath(resolve33(cwd2, path));
|
|
21824
21840
|
if (!roots.includes(abs))
|
|
21825
21841
|
roots.push(abs);
|
|
21826
21842
|
};
|
|
@@ -21845,7 +21861,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21845
21861
|
push(cfg.assetsDir);
|
|
21846
21862
|
push(cfg.stylesDir);
|
|
21847
21863
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
21848
|
-
const abs = normalizePath(
|
|
21864
|
+
const abs = normalizePath(resolve33(cwd2, candidate));
|
|
21849
21865
|
if (existsSync30(abs) && !roots.includes(abs))
|
|
21850
21866
|
roots.push(abs);
|
|
21851
21867
|
}
|
|
@@ -21857,7 +21873,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21857
21873
|
continue;
|
|
21858
21874
|
if (entry.name.startsWith("."))
|
|
21859
21875
|
continue;
|
|
21860
|
-
const abs = normalizePath(
|
|
21876
|
+
const abs = normalizePath(resolve33(cwd2, entry.name));
|
|
21861
21877
|
if (roots.includes(abs))
|
|
21862
21878
|
continue;
|
|
21863
21879
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -21932,7 +21948,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21932
21948
|
// src/dev/fileWatcher.ts
|
|
21933
21949
|
import { watch } from "fs";
|
|
21934
21950
|
import { existsSync as existsSync31, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21935
|
-
import { dirname as dirname23, join as join39, resolve as
|
|
21951
|
+
import { dirname as dirname23, join as join39, resolve as resolve34 } from "path";
|
|
21936
21952
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21937
21953
|
try {
|
|
21938
21954
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -22013,7 +22029,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22013
22029
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
22014
22030
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22015
22031
|
paths.forEach((path) => {
|
|
22016
|
-
const absolutePath =
|
|
22032
|
+
const absolutePath = resolve34(path).replace(/\\/g, "/");
|
|
22017
22033
|
if (!existsSync31(absolutePath)) {
|
|
22018
22034
|
return;
|
|
22019
22035
|
}
|
|
@@ -22024,7 +22040,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22024
22040
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
22025
22041
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
22026
22042
|
watchPaths.forEach((path) => {
|
|
22027
|
-
const absolutePath =
|
|
22043
|
+
const absolutePath = resolve34(path).replace(/\\/g, "/");
|
|
22028
22044
|
if (!existsSync31(absolutePath)) {
|
|
22029
22045
|
return;
|
|
22030
22046
|
}
|
|
@@ -22043,13 +22059,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
22043
22059
|
});
|
|
22044
22060
|
|
|
22045
22061
|
// src/dev/assetStore.ts
|
|
22046
|
-
import { resolve as
|
|
22062
|
+
import { resolve as resolve35 } from "path";
|
|
22047
22063
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
22048
22064
|
var mimeTypes, getMimeType = (filePath) => {
|
|
22049
22065
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
22050
22066
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
22051
22067
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
22052
|
-
const fullPath =
|
|
22068
|
+
const fullPath = resolve35(dir, entry.name);
|
|
22053
22069
|
if (entry.isDirectory()) {
|
|
22054
22070
|
return walkAndClean(fullPath);
|
|
22055
22071
|
}
|
|
@@ -22065,10 +22081,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22065
22081
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
22066
22082
|
const liveByIdentity = new Map;
|
|
22067
22083
|
for (const webPath of store.keys()) {
|
|
22068
|
-
const diskPath =
|
|
22084
|
+
const diskPath = resolve35(buildDir, webPath.slice(1));
|
|
22069
22085
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
22070
22086
|
}
|
|
22071
|
-
const absBuildDir =
|
|
22087
|
+
const absBuildDir = resolve35(buildDir);
|
|
22072
22088
|
Object.values(manifest).forEach((val) => {
|
|
22073
22089
|
if (!HASHED_FILE_RE.test(val))
|
|
22074
22090
|
return;
|
|
@@ -22086,7 +22102,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22086
22102
|
} catch {}
|
|
22087
22103
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
22088
22104
|
if (entry.isDirectory()) {
|
|
22089
|
-
return scanDir(
|
|
22105
|
+
return scanDir(resolve35(dir, entry.name), `${prefix}${entry.name}/`);
|
|
22090
22106
|
}
|
|
22091
22107
|
if (!entry.name.startsWith("chunk-")) {
|
|
22092
22108
|
return null;
|
|
@@ -22095,7 +22111,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22095
22111
|
if (store.has(webPath)) {
|
|
22096
22112
|
return null;
|
|
22097
22113
|
}
|
|
22098
|
-
return Bun.file(
|
|
22114
|
+
return Bun.file(resolve35(dir, entry.name)).bytes().then((bytes) => {
|
|
22099
22115
|
store.set(webPath, bytes);
|
|
22100
22116
|
return;
|
|
22101
22117
|
}).catch(() => {});
|
|
@@ -22117,7 +22133,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
22117
22133
|
for (const webPath of newIdentities.values()) {
|
|
22118
22134
|
if (store.has(webPath))
|
|
22119
22135
|
continue;
|
|
22120
|
-
loadPromises.push(Bun.file(
|
|
22136
|
+
loadPromises.push(Bun.file(resolve35(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
22121
22137
|
store.set(webPath, bytes);
|
|
22122
22138
|
return;
|
|
22123
22139
|
}).catch(() => {}));
|
|
@@ -22243,9 +22259,9 @@ var init_transformCache = __esm(() => {
|
|
|
22243
22259
|
});
|
|
22244
22260
|
|
|
22245
22261
|
// src/dev/reactComponentClassifier.ts
|
|
22246
|
-
import { resolve as
|
|
22262
|
+
import { resolve as resolve36 } from "path";
|
|
22247
22263
|
var classifyComponent = (filePath) => {
|
|
22248
|
-
const normalizedPath =
|
|
22264
|
+
const normalizedPath = resolve36(filePath);
|
|
22249
22265
|
if (normalizedPath.includes("/react/pages/")) {
|
|
22250
22266
|
return "server";
|
|
22251
22267
|
}
|
|
@@ -22257,7 +22273,7 @@ var classifyComponent = (filePath) => {
|
|
|
22257
22273
|
var init_reactComponentClassifier = () => {};
|
|
22258
22274
|
|
|
22259
22275
|
// src/dev/moduleMapper.ts
|
|
22260
|
-
import { basename as basename12, resolve as
|
|
22276
|
+
import { basename as basename12, resolve as resolve37 } from "path";
|
|
22261
22277
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
22262
22278
|
const modulePaths = {};
|
|
22263
22279
|
moduleKeys.forEach((key) => {
|
|
@@ -22267,7 +22283,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22267
22283
|
});
|
|
22268
22284
|
return modulePaths;
|
|
22269
22285
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
22270
|
-
const normalizedFile =
|
|
22286
|
+
const normalizedFile = resolve37(sourceFile);
|
|
22271
22287
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
22272
22288
|
if (processedFiles.has(normalizedFile)) {
|
|
22273
22289
|
return null;
|
|
@@ -22303,7 +22319,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
22303
22319
|
});
|
|
22304
22320
|
return grouped;
|
|
22305
22321
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
22306
|
-
const normalizedFile =
|
|
22322
|
+
const normalizedFile = resolve37(sourceFile);
|
|
22307
22323
|
const fileName = basename12(normalizedFile);
|
|
22308
22324
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
22309
22325
|
const pascalName = toPascal(baseName);
|
|
@@ -22365,7 +22381,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22365
22381
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22366
22382
|
});
|
|
22367
22383
|
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
|
|
22384
|
+
import { dirname as dirname24, extname as extname9, join as join40, resolve as resolve38 } from "path";
|
|
22369
22385
|
import ts14 from "typescript";
|
|
22370
22386
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22371
22387
|
const out = [];
|
|
@@ -22478,7 +22494,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22478
22494
|
};
|
|
22479
22495
|
visit(sourceFile);
|
|
22480
22496
|
return out;
|
|
22481
|
-
}, safeNormalize = (path) =>
|
|
22497
|
+
}, safeNormalize = (path) => resolve38(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
22482
22498
|
const { changedFilePath, userAngularRoot } = params;
|
|
22483
22499
|
const changedAbs = safeNormalize(changedFilePath);
|
|
22484
22500
|
const out = [];
|
|
@@ -22547,7 +22563,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22547
22563
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
22548
22564
|
return null;
|
|
22549
22565
|
}
|
|
22550
|
-
const base =
|
|
22566
|
+
const base = resolve38(childDir, spec);
|
|
22551
22567
|
const candidates = [
|
|
22552
22568
|
`${base}.ts`,
|
|
22553
22569
|
`${base}.tsx`,
|
|
@@ -22585,7 +22601,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22585
22601
|
};
|
|
22586
22602
|
if (cls.kind === "component") {
|
|
22587
22603
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
22588
|
-
const abs = safeNormalize(
|
|
22604
|
+
const abs = safeNormalize(resolve38(componentDir, url));
|
|
22589
22605
|
const existing = resource.get(abs);
|
|
22590
22606
|
if (existing)
|
|
22591
22607
|
existing.push(entity);
|
|
@@ -22753,7 +22769,7 @@ __export(exports_moduleServer, {
|
|
|
22753
22769
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22754
22770
|
});
|
|
22755
22771
|
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
|
|
22772
|
+
import { basename as basename13, dirname as dirname25, extname as extname10, join as join41, resolve as resolve39, relative as relative15 } from "path";
|
|
22757
22773
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22758
22774
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22759
22775
|
const allExports = [];
|
|
@@ -22773,7 +22789,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
22773
22789
|
${stubs}
|
|
22774
22790
|
`;
|
|
22775
22791
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
22776
|
-
const found = extensions.find((ext) => existsSync32(
|
|
22792
|
+
const found = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
|
|
22777
22793
|
return found ? srcPath + found : srcPath;
|
|
22778
22794
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
22779
22795
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -22788,7 +22804,7 @@ ${stubs}
|
|
|
22788
22804
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
22789
22805
|
}, srcUrl = (relPath, projectRoot) => {
|
|
22790
22806
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
22791
|
-
const absPath =
|
|
22807
|
+
const absPath = resolve39(projectRoot, relPath);
|
|
22792
22808
|
const cached = mtimeCache.get(absPath);
|
|
22793
22809
|
if (cached !== undefined)
|
|
22794
22810
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -22800,12 +22816,12 @@ ${stubs}
|
|
|
22800
22816
|
return base;
|
|
22801
22817
|
}
|
|
22802
22818
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22803
|
-
const absPath =
|
|
22804
|
-
const rel =
|
|
22819
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22820
|
+
const rel = relative15(projectRoot, absPath);
|
|
22805
22821
|
const extension = extname10(rel);
|
|
22806
22822
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22807
22823
|
if (extname10(srcPath) === ".svelte") {
|
|
22808
|
-
srcPath =
|
|
22824
|
+
srcPath = relative15(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
|
|
22809
22825
|
}
|
|
22810
22826
|
return srcUrl(srcPath, projectRoot);
|
|
22811
22827
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22817,27 +22833,27 @@ ${stubs}
|
|
|
22817
22833
|
"import"
|
|
22818
22834
|
]);
|
|
22819
22835
|
if (fromExports)
|
|
22820
|
-
return
|
|
22836
|
+
return relative15(projectRoot, fromExports);
|
|
22821
22837
|
try {
|
|
22822
22838
|
const isScoped = specifier.startsWith("@");
|
|
22823
22839
|
const parts = specifier.split("/");
|
|
22824
22840
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
22825
22841
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22826
22842
|
if (!subpath) {
|
|
22827
|
-
const pkgDir =
|
|
22843
|
+
const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
|
|
22828
22844
|
const pkgJsonPath = join41(pkgDir, "package.json");
|
|
22829
22845
|
if (existsSync32(pkgJsonPath)) {
|
|
22830
22846
|
const pkg = JSON.parse(readFileSync25(pkgJsonPath, "utf-8"));
|
|
22831
22847
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22832
22848
|
if (esmEntry) {
|
|
22833
|
-
const resolved =
|
|
22849
|
+
const resolved = resolve39(pkgDir, esmEntry);
|
|
22834
22850
|
if (existsSync32(resolved))
|
|
22835
|
-
return
|
|
22851
|
+
return relative15(projectRoot, resolved);
|
|
22836
22852
|
}
|
|
22837
22853
|
}
|
|
22838
22854
|
}
|
|
22839
22855
|
} catch {}
|
|
22840
|
-
return
|
|
22856
|
+
return relative15(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22841
22857
|
} catch {
|
|
22842
22858
|
return;
|
|
22843
22859
|
}
|
|
@@ -22868,22 +22884,22 @@ ${stubs}
|
|
|
22868
22884
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22869
22885
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22870
22886
|
if (absPath.startsWith(projectRoot)) {
|
|
22871
|
-
const rel2 =
|
|
22887
|
+
const rel2 = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22872
22888
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22873
22889
|
}
|
|
22874
|
-
const rel =
|
|
22890
|
+
const rel = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
22875
22891
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22876
22892
|
};
|
|
22877
22893
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22878
22894
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22879
22895
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22880
|
-
const absPath =
|
|
22881
|
-
const rel =
|
|
22896
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22897
|
+
const rel = relative15(projectRoot, absPath);
|
|
22882
22898
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22883
22899
|
});
|
|
22884
22900
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22885
|
-
const absPath =
|
|
22886
|
-
const rel =
|
|
22901
|
+
const absPath = resolve39(fileDir, relPath);
|
|
22902
|
+
const rel = relative15(projectRoot, absPath);
|
|
22887
22903
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22888
22904
|
});
|
|
22889
22905
|
return result;
|
|
@@ -22939,7 +22955,7 @@ ${code}`;
|
|
|
22939
22955
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22940
22956
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22941
22957
|
${transpiled}`;
|
|
22942
|
-
const relPath =
|
|
22958
|
+
const relPath = relative15(projectRoot, filePath).replace(/\\/g, "/");
|
|
22943
22959
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22944
22960
|
transpiled += buildIslandMetadataExports(raw);
|
|
22945
22961
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23100,11 +23116,11 @@ ${code}`;
|
|
|
23100
23116
|
if (compiled.css?.code) {
|
|
23101
23117
|
const cssPath = `${filePath}.css`;
|
|
23102
23118
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23103
|
-
const cssUrl = srcUrl(
|
|
23119
|
+
const cssUrl = srcUrl(relative15(projectRoot, cssPath), projectRoot);
|
|
23104
23120
|
code = `import "${cssUrl}";
|
|
23105
23121
|
${code}`;
|
|
23106
23122
|
}
|
|
23107
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
23123
|
+
const moduleUrl = `${SRC_PREFIX}${relative15(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23108
23124
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23109
23125
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23110
23126
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23195,8 +23211,8 @@ ${code}`;
|
|
|
23195
23211
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
23196
23212
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23197
23213
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23198
|
-
const hmrBase = vueDir ?
|
|
23199
|
-
const hmrId =
|
|
23214
|
+
const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
|
|
23215
|
+
const hmrId = relative15(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23200
23216
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23201
23217
|
result += [
|
|
23202
23218
|
"",
|
|
@@ -23359,7 +23375,7 @@ export default {};
|
|
|
23359
23375
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
23360
23376
|
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
23377
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
23362
|
-
const filePath =
|
|
23378
|
+
const filePath = resolve39(projectRoot, relPath);
|
|
23363
23379
|
const ext = extname10(filePath);
|
|
23364
23380
|
if (ext === ".svelte")
|
|
23365
23381
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -23396,14 +23412,14 @@ export default {};
|
|
|
23396
23412
|
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
23397
23413
|
const candidates = [
|
|
23398
23414
|
absoluteCandidate,
|
|
23399
|
-
|
|
23415
|
+
resolve39(projectRoot, tail)
|
|
23400
23416
|
];
|
|
23401
23417
|
try {
|
|
23402
23418
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
23403
23419
|
const cfg = await loadConfig2();
|
|
23404
|
-
const angularDir = cfg.angularDirectory &&
|
|
23420
|
+
const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
|
|
23405
23421
|
if (angularDir)
|
|
23406
|
-
candidates.push(
|
|
23422
|
+
candidates.push(resolve39(angularDir, tail));
|
|
23407
23423
|
} catch {}
|
|
23408
23424
|
for (const candidate of candidates) {
|
|
23409
23425
|
if (await fileExists(candidate)) {
|
|
@@ -23434,7 +23450,7 @@ export default {};
|
|
|
23434
23450
|
if (!TRANSPILABLE.has(ext))
|
|
23435
23451
|
return;
|
|
23436
23452
|
const stat3 = statSync6(filePath);
|
|
23437
|
-
const resolvedVueDir = vueDir ?
|
|
23453
|
+
const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
|
|
23438
23454
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
23439
23455
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
23440
23456
|
if (isAngularGeneratedJs) {
|
|
@@ -23493,7 +23509,7 @@ export default {};
|
|
|
23493
23509
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
23494
23510
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
23495
23511
|
return handleBunWrapRequest();
|
|
23496
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
23512
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
|
|
23497
23513
|
if (virtualCssResponse)
|
|
23498
23514
|
return virtualCssResponse;
|
|
23499
23515
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -23509,11 +23525,11 @@ export default {};
|
|
|
23509
23525
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
23510
23526
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
23511
23527
|
if (match[1])
|
|
23512
|
-
files.push(
|
|
23528
|
+
files.push(resolve39(projectRoot, match[1]));
|
|
23513
23529
|
}
|
|
23514
23530
|
return files;
|
|
23515
23531
|
}, invalidateModule = (filePath) => {
|
|
23516
|
-
const resolved =
|
|
23532
|
+
const resolved = resolve39(filePath);
|
|
23517
23533
|
invalidate(filePath);
|
|
23518
23534
|
if (resolved !== filePath)
|
|
23519
23535
|
invalidate(resolved);
|
|
@@ -23658,7 +23674,7 @@ __export(exports_hmrCompiler, {
|
|
|
23658
23674
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23659
23675
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23660
23676
|
});
|
|
23661
|
-
import { dirname as dirname26, relative as
|
|
23677
|
+
import { dirname as dirname26, relative as relative16, resolve as resolve40 } from "path";
|
|
23662
23678
|
import { performance as performance2 } from "perf_hooks";
|
|
23663
23679
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23664
23680
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23667,8 +23683,8 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23667
23683
|
return null;
|
|
23668
23684
|
const filePathRel = decoded.slice(0, at2);
|
|
23669
23685
|
const className = decoded.slice(at2 + 1);
|
|
23670
|
-
const componentFilePath =
|
|
23671
|
-
const projectRelPath =
|
|
23686
|
+
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
23687
|
+
const projectRelPath = relative16(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23672
23688
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23673
23689
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23674
23690
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23690,7 +23706,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23690
23706
|
}
|
|
23691
23707
|
return null;
|
|
23692
23708
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23693
|
-
const projectRel =
|
|
23709
|
+
const projectRel = relative16(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23694
23710
|
return `${projectRel}@${className}`;
|
|
23695
23711
|
};
|
|
23696
23712
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23829,11 +23845,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
23829
23845
|
__export(exports_simpleHTMLHMR, {
|
|
23830
23846
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
23831
23847
|
});
|
|
23832
|
-
import { resolve as
|
|
23848
|
+
import { resolve as resolve41 } from "path";
|
|
23833
23849
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
23834
23850
|
let htmlContent;
|
|
23835
23851
|
try {
|
|
23836
|
-
const resolvedPath =
|
|
23852
|
+
const resolvedPath = resolve41(htmlFilePath);
|
|
23837
23853
|
const file5 = Bun.file(resolvedPath);
|
|
23838
23854
|
if (!await file5.exists()) {
|
|
23839
23855
|
return null;
|
|
@@ -23859,11 +23875,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
23859
23875
|
__export(exports_simpleHTMXHMR, {
|
|
23860
23876
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
23861
23877
|
});
|
|
23862
|
-
import { resolve as
|
|
23878
|
+
import { resolve as resolve42 } from "path";
|
|
23863
23879
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
23864
23880
|
let htmlContent;
|
|
23865
23881
|
try {
|
|
23866
|
-
const resolvedPath =
|
|
23882
|
+
const resolvedPath = resolve42(htmxFilePath);
|
|
23867
23883
|
const file5 = Bun.file(resolvedPath);
|
|
23868
23884
|
if (!await file5.exists()) {
|
|
23869
23885
|
return null;
|
|
@@ -23886,7 +23902,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23886
23902
|
|
|
23887
23903
|
// src/dev/rebuildTrigger.ts
|
|
23888
23904
|
import { existsSync as existsSync33, rmSync as rmSync3 } from "fs";
|
|
23889
|
-
import { basename as basename14, dirname as dirname27, join as join42, relative as
|
|
23905
|
+
import { basename as basename14, dirname as dirname27, join as join42, relative as relative17, resolve as resolve43, sep as sep4 } from "path";
|
|
23890
23906
|
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
23907
|
if (!config.tailwind)
|
|
23892
23908
|
return;
|
|
@@ -23898,7 +23914,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23898
23914
|
if (!cssChanged)
|
|
23899
23915
|
return;
|
|
23900
23916
|
try {
|
|
23901
|
-
const outputPath =
|
|
23917
|
+
const outputPath = resolve43(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
23902
23918
|
const bytes = await Bun.file(outputPath).bytes();
|
|
23903
23919
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
23904
23920
|
state.assetStore.set(webPath, bytes);
|
|
@@ -23988,12 +24004,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
23988
24004
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync33(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
23989
24005
|
const config = state.config;
|
|
23990
24006
|
const cwd2 = process.cwd();
|
|
23991
|
-
const absDeleted =
|
|
24007
|
+
const absDeleted = resolve43(deletedFile).replace(/\\/g, "/");
|
|
23992
24008
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
23993
24009
|
const dir = config[configKey];
|
|
23994
24010
|
if (!dir)
|
|
23995
24011
|
continue;
|
|
23996
|
-
const absDir =
|
|
24012
|
+
const absDir = resolve43(cwd2, dir).replace(/\\/g, "/");
|
|
23997
24013
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
23998
24014
|
continue;
|
|
23999
24015
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -24017,7 +24033,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24017
24033
|
removeStaleGenerated(state, filePathInSet);
|
|
24018
24034
|
try {
|
|
24019
24035
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
24020
|
-
const deletedPathResolved =
|
|
24036
|
+
const deletedPathResolved = resolve43(filePathInSet);
|
|
24021
24037
|
affectedFiles.forEach((affectedFile) => {
|
|
24022
24038
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
24023
24039
|
validFiles.push(affectedFile);
|
|
@@ -24061,7 +24077,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24061
24077
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
24062
24078
|
return;
|
|
24063
24079
|
}
|
|
24064
|
-
const normalizedFilePath =
|
|
24080
|
+
const normalizedFilePath = resolve43(filePathInSet);
|
|
24065
24081
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
24066
24082
|
validFiles.push(normalizedFilePath);
|
|
24067
24083
|
processedFiles.add(normalizedFilePath);
|
|
@@ -24199,7 +24215,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24199
24215
|
const publicDir = state.resolvedPaths.publicDir;
|
|
24200
24216
|
const assetsDir = state.resolvedPaths.assetsDir;
|
|
24201
24217
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
24202
|
-
const absSource =
|
|
24218
|
+
const absSource = resolve43(filePath);
|
|
24203
24219
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
24204
24220
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
24205
24221
|
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
@@ -24207,7 +24223,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24207
24223
|
try {
|
|
24208
24224
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24209
24225
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24210
|
-
const destPath =
|
|
24226
|
+
const destPath = resolve43(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24211
24227
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24212
24228
|
const { dirname: dirname28 } = await import("path");
|
|
24213
24229
|
await mkdir7(dirname28(destPath), { recursive: true });
|
|
@@ -24216,7 +24232,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24216
24232
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24217
24233
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24218
24234
|
state.fileHashes.set(absSource, currentHash);
|
|
24219
|
-
logHmrUpdate(
|
|
24235
|
+
logHmrUpdate(relative17(process.cwd(), filePath));
|
|
24220
24236
|
broadcastToClients(state, {
|
|
24221
24237
|
data: {
|
|
24222
24238
|
framework: urlPrefix || "public",
|
|
@@ -24233,18 +24249,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24233
24249
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
24234
24250
|
return;
|
|
24235
24251
|
if (framework === "unknown") {
|
|
24236
|
-
invalidate(
|
|
24237
|
-
const relPath =
|
|
24252
|
+
invalidate(resolve43(filePath));
|
|
24253
|
+
const relPath = relative17(process.cwd(), filePath);
|
|
24238
24254
|
logHmrUpdate(relPath);
|
|
24239
24255
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24240
24256
|
let hasAngularDependent = false;
|
|
24241
24257
|
if (angularDir && state.dependencyGraph) {
|
|
24242
24258
|
try {
|
|
24243
24259
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
24244
|
-
addFileToGraph2(state.dependencyGraph,
|
|
24245
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24260
|
+
addFileToGraph2(state.dependencyGraph, resolve43(filePath));
|
|
24261
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve43(filePath));
|
|
24246
24262
|
for (const dependent of affected) {
|
|
24247
|
-
if (dependent ===
|
|
24263
|
+
if (dependent === resolve43(filePath))
|
|
24248
24264
|
continue;
|
|
24249
24265
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
24250
24266
|
if (dependentFramework !== "angular")
|
|
@@ -24261,14 +24277,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24261
24277
|
} catch {}
|
|
24262
24278
|
}
|
|
24263
24279
|
if (!hasAngularDependent) {
|
|
24264
|
-
console.log(`[abs:restart] ${
|
|
24280
|
+
console.log(`[abs:restart] ${resolve43(filePath)}`);
|
|
24265
24281
|
return;
|
|
24266
24282
|
}
|
|
24267
24283
|
try {
|
|
24268
24284
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
24269
24285
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24270
24286
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
24271
|
-
const sourceAbs =
|
|
24287
|
+
const sourceAbs = resolve43(filePath).replace(/\\/g, "/");
|
|
24272
24288
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
24273
24289
|
invalidateModuleServer(generatedTwin);
|
|
24274
24290
|
} catch {}
|
|
@@ -24302,7 +24318,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24302
24318
|
const userEditedFiles = new Set;
|
|
24303
24319
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
24304
24320
|
for (const filePath2 of filePaths) {
|
|
24305
|
-
userEditedFiles.add(
|
|
24321
|
+
userEditedFiles.add(resolve43(filePath2));
|
|
24306
24322
|
}
|
|
24307
24323
|
});
|
|
24308
24324
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -24331,7 +24347,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24331
24347
|
}
|
|
24332
24348
|
if (!graph)
|
|
24333
24349
|
return componentFile;
|
|
24334
|
-
const dependents = graph.dependents.get(
|
|
24350
|
+
const dependents = graph.dependents.get(resolve43(componentFile));
|
|
24335
24351
|
if (!dependents)
|
|
24336
24352
|
return componentFile;
|
|
24337
24353
|
for (const dep of dependents) {
|
|
@@ -24340,7 +24356,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24340
24356
|
}
|
|
24341
24357
|
return componentFile;
|
|
24342
24358
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
24343
|
-
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") &&
|
|
24359
|
+
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve43(file5).startsWith(angularPagesPath));
|
|
24344
24360
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
24345
24361
|
return pageEntries;
|
|
24346
24362
|
}
|
|
@@ -24349,7 +24365,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24349
24365
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
24350
24366
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
24351
24367
|
affected.forEach((file5) => {
|
|
24352
|
-
if (file5.endsWith(".ts") &&
|
|
24368
|
+
if (file5.endsWith(".ts") && resolve43(file5).startsWith(angularPagesPath)) {
|
|
24353
24369
|
resolvedPages.add(file5);
|
|
24354
24370
|
}
|
|
24355
24371
|
});
|
|
@@ -24390,8 +24406,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24390
24406
|
if (serverDirs.length <= 1) {
|
|
24391
24407
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
24392
24408
|
return {
|
|
24393
|
-
serverOutDir:
|
|
24394
|
-
serverRoot:
|
|
24409
|
+
serverOutDir: resolve43(resolvedPaths.buildDir, basename14(dir)),
|
|
24410
|
+
serverRoot: resolve43(dir, "server")
|
|
24395
24411
|
};
|
|
24396
24412
|
}
|
|
24397
24413
|
return {
|
|
@@ -24552,8 +24568,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24552
24568
|
if (detected !== "unknown")
|
|
24553
24569
|
continue;
|
|
24554
24570
|
try {
|
|
24555
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
24556
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
24571
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolve43(editedFile));
|
|
24572
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolve43(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
24557
24573
|
if (hasAngularConsumer) {
|
|
24558
24574
|
return {
|
|
24559
24575
|
kind: "rebootstrap",
|
|
@@ -24600,7 +24616,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24600
24616
|
}
|
|
24601
24617
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
24602
24618
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
24603
|
-
const angularDirAbs =
|
|
24619
|
+
const angularDirAbs = resolve43(angularDir).replace(/\\/g, "/");
|
|
24604
24620
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
24605
24621
|
return {
|
|
24606
24622
|
kind: "rebootstrap",
|
|
@@ -24743,16 +24759,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24743
24759
|
};
|
|
24744
24760
|
const fire = () => {
|
|
24745
24761
|
ctx.debounceTimer = null;
|
|
24746
|
-
const
|
|
24762
|
+
const resolve44 = ctx.debouncedResolve;
|
|
24747
24763
|
ctx.debouncedResolve = null;
|
|
24748
24764
|
ctx.debouncedPromise = null;
|
|
24749
24765
|
if (ctx.inFlight) {
|
|
24750
24766
|
ctx.pending = true;
|
|
24751
|
-
ctx.inFlight.finally(() =>
|
|
24767
|
+
ctx.inFlight.finally(() => resolve44?.());
|
|
24752
24768
|
return;
|
|
24753
24769
|
}
|
|
24754
24770
|
ctx.inFlight = drive();
|
|
24755
|
-
ctx.inFlight.finally(() =>
|
|
24771
|
+
ctx.inFlight.finally(() => resolve44?.());
|
|
24756
24772
|
};
|
|
24757
24773
|
return ({ immediate = false } = {}) => {
|
|
24758
24774
|
if (!ctx.debouncedPromise) {
|
|
@@ -24779,9 +24795,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24779
24795
|
const diskRefreshPromise = (async () => {
|
|
24780
24796
|
if (!angularDir || editedFiles.size === 0)
|
|
24781
24797
|
return;
|
|
24782
|
-
const angularDirAbs =
|
|
24798
|
+
const angularDirAbs = resolve43(angularDir);
|
|
24783
24799
|
const filesUnderAngular = Array.from(editedFiles).filter((file5) => {
|
|
24784
|
-
const abs =
|
|
24800
|
+
const abs = resolve43(file5);
|
|
24785
24801
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
24786
24802
|
});
|
|
24787
24803
|
if (filesUnderAngular.length === 0)
|
|
@@ -24803,7 +24819,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24803
24819
|
if (!ext)
|
|
24804
24820
|
continue;
|
|
24805
24821
|
if (ext === ".ts" || ext === ".tsx") {
|
|
24806
|
-
tsFilesToRefresh.add(
|
|
24822
|
+
tsFilesToRefresh.add(resolve43(file5));
|
|
24807
24823
|
continue;
|
|
24808
24824
|
}
|
|
24809
24825
|
const owners = resolveOwningComponents2({
|
|
@@ -24811,7 +24827,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24811
24827
|
userAngularRoot: angularDirAbs
|
|
24812
24828
|
});
|
|
24813
24829
|
for (const owner of owners) {
|
|
24814
|
-
tsFilesToRefresh.add(
|
|
24830
|
+
tsFilesToRefresh.add(resolve43(owner.componentFilePath));
|
|
24815
24831
|
}
|
|
24816
24832
|
}
|
|
24817
24833
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -24825,8 +24841,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24825
24841
|
try {
|
|
24826
24842
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24827
24843
|
for (const tsFile of tsFilesToRefresh) {
|
|
24828
|
-
const rel =
|
|
24829
|
-
const compiledFile =
|
|
24844
|
+
const rel = relative17(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24845
|
+
const compiledFile = resolve43(compiledRoot, rel);
|
|
24830
24846
|
invalidateModule2(compiledFile);
|
|
24831
24847
|
}
|
|
24832
24848
|
} catch {}
|
|
@@ -24877,7 +24893,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24877
24893
|
serverPaths.forEach((serverPath, idx) => {
|
|
24878
24894
|
const fileBase = basename14(serverPath, ".js");
|
|
24879
24895
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
24880
|
-
state.manifest[toPascal(fileBase)] =
|
|
24896
|
+
state.manifest[toPascal(fileBase)] = resolve43(ssrPath);
|
|
24881
24897
|
});
|
|
24882
24898
|
if (clientPaths.length > 0) {
|
|
24883
24899
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
@@ -24890,9 +24906,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24890
24906
|
const angularDir = config.angularDirectory ?? "";
|
|
24891
24907
|
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
24892
24908
|
for (const file5 of angularFiles) {
|
|
24893
|
-
state.fileHashes.set(
|
|
24909
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
24894
24910
|
}
|
|
24895
|
-
const angularPagesPath =
|
|
24911
|
+
const angularPagesPath = resolve43(angularDir, "pages");
|
|
24896
24912
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
24897
24913
|
const tierStart = performance.now();
|
|
24898
24914
|
const verdict = await decideAngularTier(state, angularDir);
|
|
@@ -24924,7 +24940,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24924
24940
|
}, getModuleUrl = async (pageFile) => {
|
|
24925
24941
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24926
24942
|
invalidateModule2(pageFile);
|
|
24927
|
-
const rel =
|
|
24943
|
+
const rel = relative17(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24928
24944
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24929
24945
|
warmCache2(url);
|
|
24930
24946
|
return url;
|
|
@@ -24933,11 +24949,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24933
24949
|
if (isComponentFile2)
|
|
24934
24950
|
return primaryFile;
|
|
24935
24951
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
24936
|
-
const nearest = findNearestComponent2(
|
|
24952
|
+
const nearest = findNearestComponent2(resolve43(primaryFile));
|
|
24937
24953
|
return nearest ?? primaryFile;
|
|
24938
24954
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
24939
24955
|
for (const file5 of reactFiles) {
|
|
24940
|
-
state.fileHashes.set(
|
|
24956
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
24941
24957
|
}
|
|
24942
24958
|
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
24943
24959
|
if (!primaryFile) {
|
|
@@ -24955,7 +24971,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24955
24971
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
24956
24972
|
if (pageModuleUrl) {
|
|
24957
24973
|
const serverDuration = Date.now() - startTime;
|
|
24958
|
-
state.lastHmrPath =
|
|
24974
|
+
state.lastHmrPath = relative17(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
24959
24975
|
state.lastHmrFramework = "react";
|
|
24960
24976
|
broadcastToClients(state, {
|
|
24961
24977
|
data: {
|
|
@@ -25018,7 +25034,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25018
25034
|
});
|
|
25019
25035
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
25020
25036
|
for (const file5 of svelteFiles) {
|
|
25021
|
-
state.fileHashes.set(
|
|
25037
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25022
25038
|
}
|
|
25023
25039
|
const serverDuration = Date.now() - startTime;
|
|
25024
25040
|
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
@@ -25265,7 +25281,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25265
25281
|
});
|
|
25266
25282
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
25267
25283
|
for (const file5 of [...vueFiles, ...nonVueFiles]) {
|
|
25268
|
-
state.fileHashes.set(
|
|
25284
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25269
25285
|
}
|
|
25270
25286
|
await invalidateNonVueModules(nonVueFiles);
|
|
25271
25287
|
const serverDuration = Date.now() - startTime;
|
|
@@ -25414,7 +25430,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25414
25430
|
recursive: true,
|
|
25415
25431
|
withFileTypes: true
|
|
25416
25432
|
});
|
|
25417
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
25433
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve43(emberPagesPath, entry.name));
|
|
25418
25434
|
} catch {
|
|
25419
25435
|
return [];
|
|
25420
25436
|
}
|
|
@@ -25426,10 +25442,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25426
25442
|
return state.manifest;
|
|
25427
25443
|
}
|
|
25428
25444
|
for (const file5 of emberFiles) {
|
|
25429
|
-
state.fileHashes.set(
|
|
25445
|
+
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
25430
25446
|
}
|
|
25431
|
-
const emberPagesPath =
|
|
25432
|
-
const directPageEntries = emberFiles.filter((file5) =>
|
|
25447
|
+
const emberPagesPath = resolve43(emberDir, "pages");
|
|
25448
|
+
const directPageEntries = emberFiles.filter((file5) => resolve43(file5).startsWith(emberPagesPath));
|
|
25433
25449
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
25434
25450
|
if (allPageEntries.length === 0) {
|
|
25435
25451
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -25439,14 +25455,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25439
25455
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
25440
25456
|
for (const serverPath of serverPaths) {
|
|
25441
25457
|
const fileBase = basename14(serverPath, ".js");
|
|
25442
|
-
state.manifest[toPascal(fileBase)] =
|
|
25458
|
+
state.manifest[toPascal(fileBase)] = resolve43(serverPath);
|
|
25443
25459
|
}
|
|
25444
25460
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
25445
25461
|
invalidateEmberSsrCache2();
|
|
25446
25462
|
const duration = Date.now() - startTime;
|
|
25447
25463
|
const [primary] = emberFiles;
|
|
25448
25464
|
if (primary) {
|
|
25449
|
-
state.lastHmrPath =
|
|
25465
|
+
state.lastHmrPath = relative17(process.cwd(), primary).replace(/\\/g, "/");
|
|
25450
25466
|
state.lastHmrFramework = "ember";
|
|
25451
25467
|
logHmrUpdate(primary, "ember", duration);
|
|
25452
25468
|
}
|
|
@@ -25531,8 +25547,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25531
25547
|
if (!buildReference?.source) {
|
|
25532
25548
|
return;
|
|
25533
25549
|
}
|
|
25534
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
25535
|
-
islandFiles.add(
|
|
25550
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve43(dirname27(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25551
|
+
islandFiles.add(resolve43(sourcePath));
|
|
25536
25552
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25537
25553
|
const registryPath = config.islands?.registry;
|
|
25538
25554
|
if (!registryPath) {
|
|
@@ -25540,7 +25556,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25540
25556
|
}
|
|
25541
25557
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
25542
25558
|
const islandFiles = new Set([
|
|
25543
|
-
|
|
25559
|
+
resolve43(buildInfo.resolvedRegistryPath)
|
|
25544
25560
|
]);
|
|
25545
25561
|
for (const definition of buildInfo.definitions) {
|
|
25546
25562
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -25551,7 +25567,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25551
25567
|
if (islandFiles.size === 0) {
|
|
25552
25568
|
return false;
|
|
25553
25569
|
}
|
|
25554
|
-
return filesToRebuild.some((file5) => islandFiles.has(
|
|
25570
|
+
return filesToRebuild.some((file5) => islandFiles.has(resolve43(file5)));
|
|
25555
25571
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
25556
25572
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
25557
25573
|
if (!shouldReload) {
|
|
@@ -25586,10 +25602,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25586
25602
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
25587
25603
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
25588
25604
|
if (isSingle) {
|
|
25589
|
-
return
|
|
25605
|
+
return resolve43(state.resolvedPaths.buildDir, "pages");
|
|
25590
25606
|
}
|
|
25591
25607
|
const dirName = framework === "html" ? basename14(config.htmlDirectory ?? "html") : basename14(config.htmxDirectory ?? "htmx");
|
|
25592
|
-
return
|
|
25608
|
+
return resolve43(state.resolvedPaths.buildDir, dirName, "pages");
|
|
25593
25609
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
25594
25610
|
try {
|
|
25595
25611
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -25628,7 +25644,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25628
25644
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
25629
25645
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
25630
25646
|
const htmlPageName = basename14(pageFile);
|
|
25631
|
-
const builtHtmlPagePath =
|
|
25647
|
+
const builtHtmlPagePath = resolve43(outputHtmlPages, htmlPageName);
|
|
25632
25648
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
25633
25649
|
});
|
|
25634
25650
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -25689,11 +25705,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25689
25705
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25690
25706
|
const pascalName = toPascal(baseName);
|
|
25691
25707
|
const vueRoot = config.vueDirectory;
|
|
25692
|
-
const hmrId = vueRoot ?
|
|
25708
|
+
const hmrId = vueRoot ? relative17(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25693
25709
|
const cssKey = `${pascalName}CSS`;
|
|
25694
25710
|
const cssUrl = manifest[cssKey] || null;
|
|
25695
25711
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
25696
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
25712
|
+
const hmrMeta = vueHmrMetadata2.get(resolve43(vuePagePath));
|
|
25697
25713
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
25698
25714
|
if (changeType === "style-only") {
|
|
25699
25715
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -25878,7 +25894,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25878
25894
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
25879
25895
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
25880
25896
|
const htmxPageName = basename14(htmxPageFile);
|
|
25881
|
-
const builtHtmxPagePath =
|
|
25897
|
+
const builtHtmxPagePath = resolve43(outputHtmxPages, htmxPageName);
|
|
25882
25898
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
25883
25899
|
});
|
|
25884
25900
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -25987,7 +26003,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25987
26003
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
25988
26004
|
writeFs(destPath, html);
|
|
25989
26005
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
25990
|
-
const destPath =
|
|
26006
|
+
const destPath = resolve43(outputDir, basename14(sourceFile));
|
|
25991
26007
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
25992
26008
|
const source = await Bun.file(sourceFile).text();
|
|
25993
26009
|
await Bun.write(destPath, source);
|
|
@@ -26129,7 +26145,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26129
26145
|
});
|
|
26130
26146
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
26131
26147
|
try {
|
|
26132
|
-
const outputPath =
|
|
26148
|
+
const outputPath = resolve43(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
26133
26149
|
const bytes = await Bun.file(outputPath).bytes();
|
|
26134
26150
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
26135
26151
|
state.assetStore.set(webPath, bytes);
|
|
@@ -26543,7 +26559,7 @@ __export(exports_devBuild, {
|
|
|
26543
26559
|
});
|
|
26544
26560
|
import { readdir as readdir5 } from "fs/promises";
|
|
26545
26561
|
import { statSync as statSync7 } from "fs";
|
|
26546
|
-
import { resolve as
|
|
26562
|
+
import { resolve as resolve44 } from "path";
|
|
26547
26563
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
26548
26564
|
const configuredDirs = [
|
|
26549
26565
|
config.reactDirectory,
|
|
@@ -26566,7 +26582,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26566
26582
|
return Object.keys(config).length > 0 ? config : null;
|
|
26567
26583
|
}, reloadConfig = async () => {
|
|
26568
26584
|
try {
|
|
26569
|
-
const configPath2 =
|
|
26585
|
+
const configPath2 = resolve44(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
26570
26586
|
const source = await Bun.file(configPath2).text();
|
|
26571
26587
|
return parseDirectoryConfig(source);
|
|
26572
26588
|
} catch {
|
|
@@ -26673,7 +26689,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26673
26689
|
state.fileChangeQueue.clear();
|
|
26674
26690
|
}
|
|
26675
26691
|
}, handleCachedReload = async () => {
|
|
26676
|
-
const serverMtime = statSync7(
|
|
26692
|
+
const serverMtime = statSync7(resolve44(Bun.main)).mtimeMs;
|
|
26677
26693
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
26678
26694
|
globalThis.__hmrServerMtime = serverMtime;
|
|
26679
26695
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -26710,8 +26726,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26710
26726
|
return true;
|
|
26711
26727
|
}, resolveAbsoluteVersion2 = async () => {
|
|
26712
26728
|
const candidates = [
|
|
26713
|
-
|
|
26714
|
-
|
|
26729
|
+
resolve44(import.meta.dir, "..", "..", "package.json"),
|
|
26730
|
+
resolve44(import.meta.dir, "..", "package.json")
|
|
26715
26731
|
];
|
|
26716
26732
|
const [candidate, ...remaining] = candidates;
|
|
26717
26733
|
if (!candidate) {
|
|
@@ -26737,7 +26753,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26737
26753
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
26738
26754
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
26739
26755
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
26740
|
-
const bytes = await Bun.file(
|
|
26756
|
+
const bytes = await Bun.file(resolve44(vendorDir, entry)).bytes();
|
|
26741
26757
|
assetStore.set(webPath, bytes);
|
|
26742
26758
|
}));
|
|
26743
26759
|
}, devBuild = async (config) => {
|
|
@@ -26816,11 +26832,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26816
26832
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
26817
26833
|
recordStep("populate asset store", stepStartedAt);
|
|
26818
26834
|
stepStartedAt = performance.now();
|
|
26819
|
-
const reactVendorDir =
|
|
26820
|
-
const angularVendorDir =
|
|
26821
|
-
const svelteVendorDir =
|
|
26822
|
-
const vueVendorDir =
|
|
26823
|
-
const depVendorDir =
|
|
26835
|
+
const reactVendorDir = resolve44(state.resolvedPaths.buildDir, "react", "vendor");
|
|
26836
|
+
const angularVendorDir = resolve44(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
26837
|
+
const svelteVendorDir = resolve44(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
26838
|
+
const vueVendorDir = resolve44(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
26839
|
+
const depVendorDir = resolve44(state.resolvedPaths.buildDir, "vendor");
|
|
26824
26840
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
26825
26841
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
26826
26842
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -26931,7 +26947,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
26931
26947
|
manifest
|
|
26932
26948
|
};
|
|
26933
26949
|
globalThis.__hmrDevResult = result;
|
|
26934
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
26950
|
+
globalThis.__hmrServerMtime = statSync7(resolve44(Bun.main)).mtimeMs;
|
|
26935
26951
|
return result;
|
|
26936
26952
|
};
|
|
26937
26953
|
var init_devBuild = __esm(() => {
|
|
@@ -27076,8 +27092,8 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
27076
27092
|
return null;
|
|
27077
27093
|
if (!pathname.startsWith("/"))
|
|
27078
27094
|
return null;
|
|
27079
|
-
const { resolve:
|
|
27080
|
-
const candidate =
|
|
27095
|
+
const { resolve: resolve45, normalize } = await import("path");
|
|
27096
|
+
const candidate = resolve45(buildDir, pathname.slice(1));
|
|
27081
27097
|
const normalizedBuild = normalize(buildDir);
|
|
27082
27098
|
if (!candidate.startsWith(normalizedBuild))
|
|
27083
27099
|
return null;
|
|
@@ -27161,12 +27177,12 @@ __export(exports_devtoolsJson, {
|
|
|
27161
27177
|
devtoolsJson: () => devtoolsJson
|
|
27162
27178
|
});
|
|
27163
27179
|
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
|
|
27180
|
+
import { dirname as dirname28, join as join44, resolve as resolve45 } from "path";
|
|
27165
27181
|
import { Elysia as Elysia3 } from "elysia";
|
|
27166
27182
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
27167
27183
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
27168
27184
|
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) =>
|
|
27185
|
+
}, 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
27186
|
if (!existsSync34(cachePath))
|
|
27171
27187
|
return null;
|
|
27172
27188
|
try {
|
|
@@ -27192,7 +27208,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
27192
27208
|
writeFileSync12(cachePath, uuid, "utf-8");
|
|
27193
27209
|
return setGlobalUuid(uuid);
|
|
27194
27210
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
27195
|
-
const rootPath =
|
|
27211
|
+
const rootPath = resolve45(options.projectRoot ?? process.cwd());
|
|
27196
27212
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
27197
27213
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
27198
27214
|
return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -27221,7 +27237,7 @@ __export(exports_imageOptimizer, {
|
|
|
27221
27237
|
imageOptimizer: () => imageOptimizer
|
|
27222
27238
|
});
|
|
27223
27239
|
import { existsSync as existsSync35 } from "fs";
|
|
27224
|
-
import { resolve as
|
|
27240
|
+
import { resolve as resolve46 } from "path";
|
|
27225
27241
|
import { Elysia as Elysia4 } from "elysia";
|
|
27226
27242
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
27227
27243
|
try {
|
|
@@ -27234,7 +27250,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
27234
27250
|
}
|
|
27235
27251
|
}, resolveLocalImage = (url, buildDir) => {
|
|
27236
27252
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
27237
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
27253
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve46(process.cwd()));
|
|
27238
27254
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
27239
27255
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
27240
27256
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -27641,7 +27657,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
27641
27657
|
});
|
|
27642
27658
|
import { existsSync as existsSync38, statSync as statSync8, watch as watch2 } from "fs";
|
|
27643
27659
|
import { createRequire as createRequire2 } from "module";
|
|
27644
|
-
import { dirname as dirname29, join as join48, resolve as
|
|
27660
|
+
import { dirname as dirname29, join as join48, resolve as resolve48 } from "path";
|
|
27645
27661
|
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
27662
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
27647
27663
|
return;
|
|
@@ -27649,10 +27665,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
27649
27665
|
if (!main || !existsSync38(main))
|
|
27650
27666
|
return;
|
|
27651
27667
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
27652
|
-
const entryPath =
|
|
27668
|
+
const entryPath = resolve48(main);
|
|
27653
27669
|
const entryDir = dirname29(entryPath);
|
|
27654
27670
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
27655
|
-
const configPath2 =
|
|
27671
|
+
const configPath2 = resolve48(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
27656
27672
|
const configDir2 = dirname29(configPath2);
|
|
27657
27673
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
27658
27674
|
const recentlyHandled = new Map;
|
|
@@ -28300,7 +28316,7 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
28300
28316
|
// src/core/prepare.ts
|
|
28301
28317
|
init_loadConfig();
|
|
28302
28318
|
import { existsSync as existsSync36, readdirSync as readdirSync7, readFileSync as readFileSync28 } from "fs";
|
|
28303
|
-
import { basename as basename15, join as join46, relative as
|
|
28319
|
+
import { basename as basename15, join as join46, relative as relative18, resolve as resolve47 } from "path";
|
|
28304
28320
|
import { Elysia as Elysia5 } from "elysia";
|
|
28305
28321
|
|
|
28306
28322
|
// src/core/loadIslandRegistry.ts
|
|
@@ -28662,7 +28678,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
28662
28678
|
for (const { dir, pattern } of prewarmDirs) {
|
|
28663
28679
|
const glob = new Glob11(pattern);
|
|
28664
28680
|
const matches = [
|
|
28665
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
28681
|
+
...glob.scanSync({ absolute: true, cwd: resolve47(dir) })
|
|
28666
28682
|
];
|
|
28667
28683
|
files.push(...matches);
|
|
28668
28684
|
}
|
|
@@ -28673,7 +28689,7 @@ var warmPrewarmDirs = async (prewarmDirs, warmCache2, SRC_URL_PREFIX2) => {
|
|
|
28673
28689
|
for (const file5 of files) {
|
|
28674
28690
|
if (file5.includes("/node_modules/"))
|
|
28675
28691
|
continue;
|
|
28676
|
-
const rel =
|
|
28692
|
+
const rel = relative18(process.cwd(), file5).replace(/\\/g, "/");
|
|
28677
28693
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
28678
28694
|
}
|
|
28679
28695
|
};
|
|
@@ -28698,10 +28714,10 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
28698
28714
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
28699
28715
|
if (!fileName)
|
|
28700
28716
|
continue;
|
|
28701
|
-
const srcPath =
|
|
28717
|
+
const srcPath = resolve47(devIndexDir, fileName);
|
|
28702
28718
|
if (!existsSync36(srcPath))
|
|
28703
28719
|
continue;
|
|
28704
|
-
const rel =
|
|
28720
|
+
const rel = relative18(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
28705
28721
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
28706
28722
|
}
|
|
28707
28723
|
};
|
|
@@ -28771,7 +28787,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
28771
28787
|
stepStartedAt = performance.now();
|
|
28772
28788
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
28773
28789
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
28774
|
-
const devIndexDir =
|
|
28790
|
+
const devIndexDir = resolve47(buildDir, "_src_indexes");
|
|
28775
28791
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
28776
28792
|
recordStep("configure dev plugins", stepStartedAt);
|
|
28777
28793
|
stepStartedAt = performance.now();
|
|
@@ -28863,7 +28879,7 @@ var prepare = async (configOrPath) => {
|
|
|
28863
28879
|
recordStep("load config", stepStartedAt);
|
|
28864
28880
|
const nodeEnv = process.env["NODE_ENV"];
|
|
28865
28881
|
const isDev3 = nodeEnv === "development";
|
|
28866
|
-
const buildDir =
|
|
28882
|
+
const buildDir = resolve47(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
28867
28883
|
if (isDev3) {
|
|
28868
28884
|
stepStartedAt = performance.now();
|
|
28869
28885
|
const result = await prepareDev(config, buildDir);
|
|
@@ -29338,7 +29354,7 @@ var generateHeadElement = ({
|
|
|
29338
29354
|
// src/utils/defineEnv.ts
|
|
29339
29355
|
var {env: bunEnv } = globalThis.Bun;
|
|
29340
29356
|
import { existsSync as existsSync39, readFileSync as readFileSync30 } from "fs";
|
|
29341
|
-
import { resolve as
|
|
29357
|
+
import { resolve as resolve49 } from "path";
|
|
29342
29358
|
|
|
29343
29359
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
29344
29360
|
var exports_value = {};
|
|
@@ -35373,7 +35389,7 @@ ${lines.join(`
|
|
|
35373
35389
|
};
|
|
35374
35390
|
var checkEnvFileSecurity = (properties) => {
|
|
35375
35391
|
const cwd2 = process.cwd();
|
|
35376
|
-
const envPath =
|
|
35392
|
+
const envPath = resolve49(cwd2, ".env");
|
|
35377
35393
|
if (!existsSync39(envPath))
|
|
35378
35394
|
return;
|
|
35379
35395
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
@@ -35383,7 +35399,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
35383
35399
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
35384
35400
|
if (presentKeys.length === 0)
|
|
35385
35401
|
return;
|
|
35386
|
-
const gitignorePath =
|
|
35402
|
+
const gitignorePath = resolve49(cwd2, ".gitignore");
|
|
35387
35403
|
if (existsSync39(gitignorePath)) {
|
|
35388
35404
|
const gitignore = readFileSync30(gitignorePath, "utf-8");
|
|
35389
35405
|
if (gitignore.split(`
|
|
@@ -35626,5 +35642,5 @@ export {
|
|
|
35626
35642
|
ANGULAR_INIT_TIMEOUT_MS
|
|
35627
35643
|
};
|
|
35628
35644
|
|
|
35629
|
-
//# debugId=
|
|
35645
|
+
//# debugId=C885F88E271B2C3C64756E2164756E21
|
|
35630
35646
|
//# sourceMappingURL=index.js.map
|