@absolutejs/absolute 0.19.0-beta.982 → 0.19.0-beta.984
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/angular/index.js +98 -149
- package/dist/angular/index.js.map +8 -9
- package/dist/angular/server.js +98 -149
- package/dist/angular/server.js.map +8 -9
- package/dist/build.js +518 -697
- package/dist/build.js.map +9 -11
- package/dist/client/index.js +1 -3
- package/dist/client/index.js.map +4 -4
- package/dist/index.js +545 -724
- package/dist/index.js.map +9 -11
- package/dist/islands/index.js +1 -3
- package/dist/islands/index.js.map +4 -4
- package/dist/react/index.js +1 -3
- package/dist/react/index.js.map +4 -4
- package/dist/src/build/runAngularHandlerScan.d.ts +0 -5
- package/dist/svelte/index.js +1 -3
- package/dist/svelte/index.js.map +4 -4
- package/dist/types/angular.d.ts +0 -1
- package/dist/vue/index.js +1 -3
- package/dist/vue/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/src/angular/loadRouteMounts.d.ts +0 -3
- package/dist/src/build/emitAngularProvidersFiles.d.ts +0 -29
- package/dist/src/build/emitAngularRouteMounts.d.ts +0 -3
package/dist/build.js
CHANGED
|
@@ -2037,7 +2037,6 @@ var initDominoAdapter = (platformServer) => {
|
|
|
2037
2037
|
return {
|
|
2038
2038
|
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
2039
2039
|
bootstrapApplication: platformBrowser.bootstrapApplication,
|
|
2040
|
-
clearResolutionOfComponentResourcesQueue: core.\u{275}clearResolutionOfComponentResourcesQueue,
|
|
2041
2040
|
DomSanitizer: platformBrowser.DomSanitizer,
|
|
2042
2041
|
ENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,
|
|
2043
2042
|
inject: core.inject,
|
|
@@ -2208,7 +2207,6 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
2208
2207
|
}
|
|
2209
2208
|
return result;
|
|
2210
2209
|
}, renderAngularApp = async (deps, PageComponent, providers, document2, url = "/") => {
|
|
2211
|
-
deps.clearResolutionOfComponentResourcesQueue();
|
|
2212
2210
|
const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers }, context);
|
|
2213
2211
|
return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
|
|
2214
2212
|
document: document2,
|
|
@@ -11558,300 +11556,14 @@ var validateSafePath = (targetPath, baseDirectory) => {
|
|
|
11558
11556
|
};
|
|
11559
11557
|
var init_validateSafePath = () => {};
|
|
11560
11558
|
|
|
11561
|
-
// src/build/emitAngularProvidersFiles.ts
|
|
11562
|
-
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
11563
|
-
import { dirname as dirname11, join as join22, relative as relative9 } from "path";
|
|
11564
|
-
var relativeImportSpecifier = (fromDir, targetAbsPath) => {
|
|
11565
|
-
const targetWithoutExt = targetAbsPath.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11566
|
-
const rel = relative9(fromDir, targetWithoutExt).replace(/\\/g, "/");
|
|
11567
|
-
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
11568
|
-
}, buildModuleSpecifier = (importSpec, outputPath) => {
|
|
11569
|
-
if (!importSpec.resolvedAbsPath)
|
|
11570
|
-
return importSpec.source;
|
|
11571
|
-
const outputDir = dirname11(outputPath);
|
|
11572
|
-
const rel = relative9(outputDir, importSpec.resolvedAbsPath).replace(/\\/g, "/");
|
|
11573
|
-
const withoutExt = rel.replace(/\.[cm]?[tj]sx?$/, "");
|
|
11574
|
-
return withoutExt.startsWith(".") ? withoutExt : `./${withoutExt}`;
|
|
11575
|
-
}, buildImportLine = (importSpec, outputPath) => {
|
|
11576
|
-
const specifier = buildModuleSpecifier(importSpec, outputPath);
|
|
11577
|
-
if (importSpec.isDefault) {
|
|
11578
|
-
return `import ${importSpec.localName} from "${specifier}";`;
|
|
11579
|
-
}
|
|
11580
|
-
if (importSpec.importedName === "*") {
|
|
11581
|
-
return `import * as ${importSpec.localName} from "${specifier}";`;
|
|
11582
|
-
}
|
|
11583
|
-
if (importSpec.importedName === importSpec.localName) {
|
|
11584
|
-
return `import { ${importSpec.localName} } from "${specifier}";`;
|
|
11585
|
-
}
|
|
11586
|
-
return `import { ${importSpec.importedName} as ${importSpec.localName} } from "${specifier}";`;
|
|
11587
|
-
}, groupImports = (specs) => {
|
|
11588
|
-
const bySource = new Map;
|
|
11589
|
-
for (const spec of specs) {
|
|
11590
|
-
const list = bySource.get(spec.source);
|
|
11591
|
-
if (list) {
|
|
11592
|
-
if (!list.some((existing) => existing.localName === spec.localName)) {
|
|
11593
|
-
list.push(spec);
|
|
11594
|
-
}
|
|
11595
|
-
} else {
|
|
11596
|
-
bySource.set(spec.source, [spec]);
|
|
11597
|
-
}
|
|
11598
|
-
}
|
|
11599
|
-
return [...bySource.values()];
|
|
11600
|
-
}, renderImportGroup = (specs, outputPath) => {
|
|
11601
|
-
const named = [];
|
|
11602
|
-
const standalone = [];
|
|
11603
|
-
for (const spec of specs) {
|
|
11604
|
-
if (spec.isDefault || spec.importedName === "*") {
|
|
11605
|
-
standalone.push(buildImportLine(spec, outputPath));
|
|
11606
|
-
} else {
|
|
11607
|
-
named.push(spec);
|
|
11608
|
-
}
|
|
11609
|
-
}
|
|
11610
|
-
const lines = [...standalone];
|
|
11611
|
-
if (named.length > 0) {
|
|
11612
|
-
const specifier = buildModuleSpecifier(named[0], outputPath);
|
|
11613
|
-
const fragments = named.map((spec) => spec.importedName === spec.localName ? spec.localName : `${spec.importedName} as ${spec.localName}`);
|
|
11614
|
-
lines.push(`import { ${fragments.join(", ")} } from "${specifier}";`);
|
|
11615
|
-
}
|
|
11616
|
-
return lines.join(`
|
|
11617
|
-
`);
|
|
11618
|
-
}, ROUTER_FEATURES_DEFAULT, renderFile = (call, outputPath, basePath, pageRoutes, providersImport) => {
|
|
11619
|
-
const sections = [];
|
|
11620
|
-
sections.push("/* AUTOGENERATED by AbsoluteJS \u2014 see `scanAngularHandlerCalls`. */", "/* eslint-disable */");
|
|
11621
|
-
const groups = groupImports(call.providerImports);
|
|
11622
|
-
if (groups.length > 0) {
|
|
11623
|
-
for (const group of groups) {
|
|
11624
|
-
sections.push(renderImportGroup(group, outputPath));
|
|
11625
|
-
}
|
|
11626
|
-
}
|
|
11627
|
-
if (providersImport) {
|
|
11628
|
-
const outputDir = dirname11(outputPath);
|
|
11629
|
-
const specifier = relativeImportSpecifier(outputDir, providersImport.absolutePath);
|
|
11630
|
-
const importClause = providersImport.importedName === providersImport.bindingName ? `{ ${providersImport.bindingName} as __globalProviders }` : `{ ${providersImport.importedName} as __globalProviders }`;
|
|
11631
|
-
sections.push(`import ${importClause} from "${specifier}";`);
|
|
11632
|
-
}
|
|
11633
|
-
if (basePath !== null) {
|
|
11634
|
-
sections.push(`import { APP_BASE_HREF } from "@angular/common";`, `const __basePathProvider = { provide: APP_BASE_HREF, useValue: ${JSON.stringify(basePath)} };`);
|
|
11635
|
-
}
|
|
11636
|
-
if (pageRoutes?.hasRoutes) {
|
|
11637
|
-
const routesImport = relativeImportSpecifier(dirname11(outputPath), pageRoutes.pageFile);
|
|
11638
|
-
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(", ")});`);
|
|
11639
|
-
}
|
|
11640
|
-
const userProvidersExpr = call.providersExpr ?? "[]";
|
|
11641
|
-
const fragments = [];
|
|
11642
|
-
if (providersImport)
|
|
11643
|
-
fragments.push("...__globalProviders");
|
|
11644
|
-
if (call.providersExpr !== null)
|
|
11645
|
-
fragments.push(`...(${userProvidersExpr})`);
|
|
11646
|
-
if (pageRoutes?.hasRoutes)
|
|
11647
|
-
fragments.push("__routerProvider");
|
|
11648
|
-
if (basePath !== null)
|
|
11649
|
-
fragments.push("__basePathProvider");
|
|
11650
|
-
const exportExpr = fragments.length === 0 ? "[]" : `[${fragments.join(", ")}]`;
|
|
11651
|
-
sections.push(`export const providers = ${exportExpr};`);
|
|
11652
|
-
return sections.join(`
|
|
11653
|
-
|
|
11654
|
-
`) + `
|
|
11655
|
-
`;
|
|
11656
|
-
}, deriveBasePath = (mountPath) => {
|
|
11657
|
-
if (!mountPath)
|
|
11658
|
-
return null;
|
|
11659
|
-
if (!mountPath.endsWith("/*"))
|
|
11660
|
-
return null;
|
|
11661
|
-
const trimmed = mountPath.slice(0, -1);
|
|
11662
|
-
return trimmed === "/" ? null : trimmed;
|
|
11663
|
-
}, emitAngularProvidersFiles = (projectRoot, calls, pageRoutes, options = {}) => {
|
|
11664
|
-
const outputDir = getProvidersOutputDir(projectRoot);
|
|
11665
|
-
mkdirSync8(outputDir, { recursive: true });
|
|
11666
|
-
const pageRoutesByKey = new Map;
|
|
11667
|
-
for (const entry of pageRoutes) {
|
|
11668
|
-
pageRoutesByKey.set(entry.manifestKey, entry);
|
|
11669
|
-
}
|
|
11670
|
-
const emitted = [];
|
|
11671
|
-
for (const call of calls) {
|
|
11672
|
-
const outputPath = join22(outputDir, `${call.manifestKey}.providers.ts`);
|
|
11673
|
-
const basePath = deriveBasePath(call.mountPath);
|
|
11674
|
-
const pageRoute = pageRoutesByKey.get(call.manifestKey);
|
|
11675
|
-
const content = renderFile(call, outputPath, basePath, pageRoute, options.providersImport ?? null);
|
|
11676
|
-
writeFileSync7(outputPath, content, "utf-8");
|
|
11677
|
-
emitted.push({
|
|
11678
|
-
basePath,
|
|
11679
|
-
hasProviders: call.providersExpr !== null,
|
|
11680
|
-
manifestKey: call.manifestKey,
|
|
11681
|
-
outputPath
|
|
11682
|
-
});
|
|
11683
|
-
}
|
|
11684
|
-
return emitted;
|
|
11685
|
-
}, getProvidersOutputDir = (projectRoot) => join22(getFrameworkGeneratedDir("angular", projectRoot), "providers");
|
|
11686
|
-
var init_emitAngularProvidersFiles = __esm(() => {
|
|
11687
|
-
init_generatedDir();
|
|
11688
|
-
ROUTER_FEATURES_DEFAULT = [
|
|
11689
|
-
"withComponentInputBinding",
|
|
11690
|
-
"withViewTransitions"
|
|
11691
|
-
];
|
|
11692
|
-
});
|
|
11693
|
-
|
|
11694
|
-
// src/build/emitAngularRouteMounts.ts
|
|
11695
|
-
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8 } from "fs";
|
|
11696
|
-
import { join as join23 } from "path";
|
|
11697
|
-
var deriveBasePath2 = (mountPath) => {
|
|
11698
|
-
if (!mountPath)
|
|
11699
|
-
return null;
|
|
11700
|
-
if (!mountPath.endsWith("/*"))
|
|
11701
|
-
return null;
|
|
11702
|
-
const trimmed = mountPath.slice(0, -1);
|
|
11703
|
-
return trimmed === "/" ? null : trimmed;
|
|
11704
|
-
}, escapeForRegex = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mountToPatternSource = (basePath) => {
|
|
11705
|
-
const withoutTrailing = basePath.replace(/\/$/, "");
|
|
11706
|
-
return `^${escapeForRegex(withoutTrailing)}(\\/|$)`;
|
|
11707
|
-
}, getRouteMountsOutputPath = (projectRoot) => join23(getFrameworkGeneratedDir("angular", projectRoot), "route-mounts.ts"), emitAngularRouteMounts = (projectRoot, calls) => {
|
|
11708
|
-
const entries = [];
|
|
11709
|
-
const seen = new Set;
|
|
11710
|
-
for (const call of calls) {
|
|
11711
|
-
const basePath = deriveBasePath2(call.mountPath);
|
|
11712
|
-
if (!basePath)
|
|
11713
|
-
continue;
|
|
11714
|
-
if (seen.has(basePath))
|
|
11715
|
-
continue;
|
|
11716
|
-
seen.add(basePath);
|
|
11717
|
-
entries.push({
|
|
11718
|
-
basePath,
|
|
11719
|
-
patternSource: mountToPatternSource(basePath)
|
|
11720
|
-
});
|
|
11721
|
-
}
|
|
11722
|
-
const outputPath = getRouteMountsOutputPath(projectRoot);
|
|
11723
|
-
mkdirSync9(getFrameworkGeneratedDir("angular", projectRoot), {
|
|
11724
|
-
recursive: true
|
|
11725
|
-
});
|
|
11726
|
-
const literal = entries.length === 0 ? "[]" : `[
|
|
11727
|
-
${entries.map((e) => ` { pattern: new RegExp(${JSON.stringify(e.patternSource)}), basePath: ${JSON.stringify(e.basePath)} }`).join(`,
|
|
11728
|
-
`)}
|
|
11729
|
-
]`;
|
|
11730
|
-
const body = `/* AUTOGENERATED by AbsoluteJS \u2014 see \`emitAngularRouteMounts\`. */
|
|
11731
|
-
/* eslint-disable */
|
|
11732
|
-
export type AngularRouteMount = { pattern: RegExp; basePath: string };
|
|
11733
|
-
export const routeMounts: AngularRouteMount[] = ${literal};
|
|
11734
|
-
`;
|
|
11735
|
-
writeFileSync8(outputPath, body, "utf-8");
|
|
11736
|
-
return outputPath;
|
|
11737
|
-
};
|
|
11738
|
-
var init_emitAngularRouteMounts = __esm(() => {
|
|
11739
|
-
init_generatedDir();
|
|
11740
|
-
});
|
|
11741
|
-
|
|
11742
|
-
// src/build/parseAngularConfigImports.ts
|
|
11743
|
-
var exports_parseAngularConfigImports = {};
|
|
11744
|
-
__export(exports_parseAngularConfigImports, {
|
|
11745
|
-
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
11746
|
-
});
|
|
11747
|
-
import { existsSync as existsSync19, readFileSync as readFileSync12 } from "fs";
|
|
11748
|
-
import { dirname as dirname12, isAbsolute as isAbsolute3, join as join24 } from "path";
|
|
11749
|
-
import ts6 from "typescript";
|
|
11750
|
-
var findDefineConfigCall = (sf) => {
|
|
11751
|
-
let result = null;
|
|
11752
|
-
const visit = (node) => {
|
|
11753
|
-
if (result)
|
|
11754
|
-
return;
|
|
11755
|
-
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
11756
|
-
const [arg] = node.arguments;
|
|
11757
|
-
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
11758
|
-
result = arg;
|
|
11759
|
-
return;
|
|
11760
|
-
}
|
|
11761
|
-
}
|
|
11762
|
-
ts6.forEachChild(node, visit);
|
|
11763
|
-
};
|
|
11764
|
-
ts6.forEachChild(sf, visit);
|
|
11765
|
-
return result;
|
|
11766
|
-
}, findPropertyInitializer = (object, name) => {
|
|
11767
|
-
for (const prop of object.properties) {
|
|
11768
|
-
if (!ts6.isPropertyAssignment(prop))
|
|
11769
|
-
continue;
|
|
11770
|
-
if (!prop.name)
|
|
11771
|
-
continue;
|
|
11772
|
-
const key = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11773
|
-
if (key === name)
|
|
11774
|
-
return prop.initializer;
|
|
11775
|
-
}
|
|
11776
|
-
return null;
|
|
11777
|
-
}, findImportForBinding = (sf, binding) => {
|
|
11778
|
-
for (const statement of sf.statements) {
|
|
11779
|
-
if (!ts6.isImportDeclaration(statement))
|
|
11780
|
-
continue;
|
|
11781
|
-
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
11782
|
-
continue;
|
|
11783
|
-
if (statement.importClause?.isTypeOnly)
|
|
11784
|
-
continue;
|
|
11785
|
-
const named = statement.importClause?.namedBindings;
|
|
11786
|
-
if (!named || !ts6.isNamedImports(named))
|
|
11787
|
-
continue;
|
|
11788
|
-
for (const element of named.elements) {
|
|
11789
|
-
if (element.isTypeOnly)
|
|
11790
|
-
continue;
|
|
11791
|
-
if (element.name.text === binding) {
|
|
11792
|
-
return {
|
|
11793
|
-
importedName: element.propertyName?.text ?? element.name.text,
|
|
11794
|
-
source: statement.moduleSpecifier.text
|
|
11795
|
-
};
|
|
11796
|
-
}
|
|
11797
|
-
}
|
|
11798
|
-
}
|
|
11799
|
-
return null;
|
|
11800
|
-
}, resolveConfigPath = (projectRoot) => {
|
|
11801
|
-
const candidates = [
|
|
11802
|
-
join24(projectRoot, "absolute.config.ts"),
|
|
11803
|
-
join24(projectRoot, "absolute.config.mts"),
|
|
11804
|
-
join24(projectRoot, "absolute.config.js"),
|
|
11805
|
-
join24(projectRoot, "absolute.config.mjs")
|
|
11806
|
-
];
|
|
11807
|
-
for (const candidate of candidates) {
|
|
11808
|
-
if (existsSync19(candidate))
|
|
11809
|
-
return candidate;
|
|
11810
|
-
}
|
|
11811
|
-
return null;
|
|
11812
|
-
}, parseAngularProvidersImport = (projectRoot) => {
|
|
11813
|
-
const configPath2 = resolveConfigPath(projectRoot);
|
|
11814
|
-
if (!configPath2)
|
|
11815
|
-
return null;
|
|
11816
|
-
const source = readFileSync12(configPath2, "utf-8");
|
|
11817
|
-
if (!source.includes("angular"))
|
|
11818
|
-
return null;
|
|
11819
|
-
if (!source.includes("providers"))
|
|
11820
|
-
return null;
|
|
11821
|
-
const sf = ts6.createSourceFile(configPath2, source, ts6.ScriptTarget.Latest, true, ts6.ScriptKind.TS);
|
|
11822
|
-
const configObject = findDefineConfigCall(sf);
|
|
11823
|
-
if (!configObject)
|
|
11824
|
-
return null;
|
|
11825
|
-
const angularField = findPropertyInitializer(configObject, "angular");
|
|
11826
|
-
if (!angularField || !ts6.isObjectLiteralExpression(angularField))
|
|
11827
|
-
return null;
|
|
11828
|
-
const providersField = findPropertyInitializer(angularField, "providers");
|
|
11829
|
-
if (!providersField)
|
|
11830
|
-
return null;
|
|
11831
|
-
if (!ts6.isIdentifier(providersField))
|
|
11832
|
-
return null;
|
|
11833
|
-
const binding = providersField.text;
|
|
11834
|
-
const importInfo = findImportForBinding(sf, binding);
|
|
11835
|
-
if (!importInfo)
|
|
11836
|
-
return null;
|
|
11837
|
-
const configDir2 = dirname12(configPath2);
|
|
11838
|
-
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
11839
|
-
return {
|
|
11840
|
-
absolutePath,
|
|
11841
|
-
bindingName: binding,
|
|
11842
|
-
importedName: importInfo.importedName
|
|
11843
|
-
};
|
|
11844
|
-
};
|
|
11845
|
-
var init_parseAngularConfigImports = () => {};
|
|
11846
|
-
|
|
11847
11559
|
// src/build/scanAngularHandlerCalls.ts
|
|
11848
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
11849
|
-
import { dirname as
|
|
11850
|
-
import
|
|
11560
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync12 } from "fs";
|
|
11561
|
+
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join22, resolve as resolve19 } from "path";
|
|
11562
|
+
import ts6 from "typescript";
|
|
11851
11563
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
11852
11564
|
if (filePath.endsWith(".tsx"))
|
|
11853
|
-
return
|
|
11854
|
-
return
|
|
11565
|
+
return ts6.ScriptKind.TSX;
|
|
11566
|
+
return ts6.ScriptKind.TS;
|
|
11855
11567
|
}, hasSourceExtension2 = (filePath) => {
|
|
11856
11568
|
const idx = filePath.lastIndexOf(".");
|
|
11857
11569
|
if (idx === -1)
|
|
@@ -11879,16 +11591,16 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11879
11591
|
continue;
|
|
11880
11592
|
if (entry.name.startsWith("."))
|
|
11881
11593
|
continue;
|
|
11882
|
-
stack.push(
|
|
11594
|
+
stack.push(join22(dir, entry.name));
|
|
11883
11595
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
11884
|
-
out.push(
|
|
11596
|
+
out.push(join22(dir, entry.name));
|
|
11885
11597
|
}
|
|
11886
11598
|
}
|
|
11887
11599
|
}
|
|
11888
11600
|
return out;
|
|
11889
11601
|
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"), collectFileImports = (sf, filePath) => {
|
|
11890
11602
|
const map = new Map;
|
|
11891
|
-
const fileDir =
|
|
11603
|
+
const fileDir = dirname11(filePath);
|
|
11892
11604
|
const recordSpec = (localName, spec) => {
|
|
11893
11605
|
map.set(localName, spec);
|
|
11894
11606
|
};
|
|
@@ -11896,15 +11608,15 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11896
11608
|
if (specifier.startsWith(".")) {
|
|
11897
11609
|
return resolve19(fileDir, specifier);
|
|
11898
11610
|
}
|
|
11899
|
-
if (
|
|
11611
|
+
if (isAbsolute3(specifier)) {
|
|
11900
11612
|
return specifier;
|
|
11901
11613
|
}
|
|
11902
11614
|
return null;
|
|
11903
11615
|
};
|
|
11904
11616
|
for (const statement of sf.statements) {
|
|
11905
|
-
if (!
|
|
11617
|
+
if (!ts6.isImportDeclaration(statement))
|
|
11906
11618
|
continue;
|
|
11907
|
-
if (!
|
|
11619
|
+
if (!ts6.isStringLiteral(statement.moduleSpecifier))
|
|
11908
11620
|
continue;
|
|
11909
11621
|
if (statement.importClause?.isTypeOnly)
|
|
11910
11622
|
continue;
|
|
@@ -11925,7 +11637,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11925
11637
|
const bindings = clause.namedBindings;
|
|
11926
11638
|
if (!bindings)
|
|
11927
11639
|
continue;
|
|
11928
|
-
if (
|
|
11640
|
+
if (ts6.isNamespaceImport(bindings)) {
|
|
11929
11641
|
recordSpec(bindings.name.text, {
|
|
11930
11642
|
importedName: "*",
|
|
11931
11643
|
isDefault: false,
|
|
@@ -11953,38 +11665,38 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11953
11665
|
}, collectExpressionIdentifiers = (expr) => {
|
|
11954
11666
|
const out = new Set;
|
|
11955
11667
|
const visit = (node) => {
|
|
11956
|
-
if (
|
|
11668
|
+
if (ts6.isIdentifier(node)) {
|
|
11957
11669
|
out.add(node.text);
|
|
11958
11670
|
return;
|
|
11959
11671
|
}
|
|
11960
|
-
if (
|
|
11672
|
+
if (ts6.isPropertyAccessExpression(node)) {
|
|
11961
11673
|
visit(node.expression);
|
|
11962
11674
|
return;
|
|
11963
11675
|
}
|
|
11964
|
-
|
|
11676
|
+
ts6.forEachChild(node, visit);
|
|
11965
11677
|
};
|
|
11966
11678
|
visit(expr);
|
|
11967
11679
|
return out;
|
|
11968
11680
|
}, extractManifestKey = (pagePathValue) => {
|
|
11969
|
-
if (!
|
|
11681
|
+
if (!ts6.isCallExpression(pagePathValue))
|
|
11970
11682
|
return null;
|
|
11971
11683
|
const callee = pagePathValue.expression;
|
|
11972
|
-
if (!
|
|
11684
|
+
if (!ts6.isIdentifier(callee) || callee.text !== "asset")
|
|
11973
11685
|
return null;
|
|
11974
11686
|
const [, second] = pagePathValue.arguments;
|
|
11975
11687
|
if (!second)
|
|
11976
11688
|
return null;
|
|
11977
|
-
if (!
|
|
11689
|
+
if (!ts6.isStringLiteral(second))
|
|
11978
11690
|
return null;
|
|
11979
11691
|
return second.text;
|
|
11980
11692
|
}, findEnclosingMountPath = (node) => {
|
|
11981
11693
|
let cursor = node.parent;
|
|
11982
11694
|
while (cursor) {
|
|
11983
|
-
if (
|
|
11695
|
+
if (ts6.isCallExpression(cursor)) {
|
|
11984
11696
|
const callee = cursor.expression;
|
|
11985
|
-
if (
|
|
11697
|
+
if (ts6.isPropertyAccessExpression(callee) && ts6.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
11986
11698
|
const firstArg = cursor.arguments[0];
|
|
11987
|
-
if (firstArg &&
|
|
11699
|
+
if (firstArg && ts6.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
11988
11700
|
return firstArg.text;
|
|
11989
11701
|
}
|
|
11990
11702
|
}
|
|
@@ -11995,37 +11707,37 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
11995
11707
|
}, extractCallsFromFile = (filePath, out) => {
|
|
11996
11708
|
let source;
|
|
11997
11709
|
try {
|
|
11998
|
-
source =
|
|
11710
|
+
source = readFileSync12(filePath, "utf-8");
|
|
11999
11711
|
} catch {
|
|
12000
11712
|
return;
|
|
12001
11713
|
}
|
|
12002
11714
|
if (!fileMayContainAngularHandler(source))
|
|
12003
11715
|
return;
|
|
12004
|
-
const sf =
|
|
11716
|
+
const sf = ts6.createSourceFile(filePath, source, ts6.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
12005
11717
|
const imports = collectFileImports(sf, filePath);
|
|
12006
11718
|
const visit = (node) => {
|
|
12007
|
-
if (
|
|
11719
|
+
if (ts6.isCallExpression(node) && ts6.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
12008
11720
|
const [arg] = node.arguments;
|
|
12009
|
-
if (arg &&
|
|
11721
|
+
if (arg && ts6.isObjectLiteralExpression(arg)) {
|
|
12010
11722
|
let manifestKey = null;
|
|
12011
11723
|
let providersExpr = null;
|
|
12012
11724
|
for (const prop of arg.properties) {
|
|
12013
|
-
if (
|
|
11725
|
+
if (ts6.isPropertyAssignment(prop)) {
|
|
12014
11726
|
if (!prop.name)
|
|
12015
11727
|
continue;
|
|
12016
|
-
const name =
|
|
11728
|
+
const name = ts6.isIdentifier(prop.name) ? prop.name.text : ts6.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
12017
11729
|
if (name === "pagePath") {
|
|
12018
11730
|
manifestKey = extractManifestKey(prop.initializer);
|
|
12019
11731
|
} else if (name === "providers") {
|
|
12020
11732
|
providersExpr = prop.initializer;
|
|
12021
11733
|
}
|
|
12022
|
-
} else if (
|
|
11734
|
+
} else if (ts6.isSpreadAssignment(prop)) {
|
|
12023
11735
|
if (manifestKey)
|
|
12024
11736
|
continue;
|
|
12025
11737
|
const spreadExpr = prop.expression;
|
|
12026
|
-
if (
|
|
11738
|
+
if (ts6.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
12027
11739
|
const [firstArg] = spreadExpr.arguments;
|
|
12028
|
-
if (firstArg &&
|
|
11740
|
+
if (firstArg && ts6.isStringLiteral(firstArg)) {
|
|
12029
11741
|
manifestKey = firstArg.text;
|
|
12030
11742
|
}
|
|
12031
11743
|
}
|
|
@@ -12053,9 +11765,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (fil
|
|
|
12053
11765
|
}
|
|
12054
11766
|
}
|
|
12055
11767
|
}
|
|
12056
|
-
|
|
11768
|
+
ts6.forEachChild(node, visit);
|
|
12057
11769
|
};
|
|
12058
|
-
|
|
11770
|
+
ts6.forEachChild(sf, visit);
|
|
12059
11771
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
12060
11772
|
const files = collectSourceFiles2(projectRoot);
|
|
12061
11773
|
const collected = [];
|
|
@@ -12091,9 +11803,9 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12091
11803
|
});
|
|
12092
11804
|
|
|
12093
11805
|
// src/build/scanAngularPageRoutes.ts
|
|
12094
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
12095
|
-
import { basename as basename5, join as
|
|
12096
|
-
import
|
|
11806
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync13 } from "fs";
|
|
11807
|
+
import { basename as basename5, join as join23 } from "path";
|
|
11808
|
+
import ts7 from "typescript";
|
|
12097
11809
|
var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
12098
11810
|
const idx = filePath.lastIndexOf(".");
|
|
12099
11811
|
if (idx === -1)
|
|
@@ -12132,9 +11844,9 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
12132
11844
|
continue;
|
|
12133
11845
|
if (entry.name.startsWith("."))
|
|
12134
11846
|
continue;
|
|
12135
|
-
stack.push(
|
|
11847
|
+
stack.push(join23(dir, entry.name));
|
|
12136
11848
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
12137
|
-
out.push(
|
|
11849
|
+
out.push(join23(dir, entry.name));
|
|
12138
11850
|
}
|
|
12139
11851
|
}
|
|
12140
11852
|
}
|
|
@@ -12142,15 +11854,15 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
12142
11854
|
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
12143
11855
|
if (!source.includes("routes"))
|
|
12144
11856
|
return false;
|
|
12145
|
-
const sf =
|
|
11857
|
+
const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.Latest, true, ts7.ScriptKind.TS);
|
|
12146
11858
|
for (const statement of sf.statements) {
|
|
12147
|
-
if (!
|
|
11859
|
+
if (!ts7.isVariableStatement(statement))
|
|
12148
11860
|
continue;
|
|
12149
|
-
const isExported = statement.modifiers?.some((modifier) => modifier.kind ===
|
|
11861
|
+
const isExported = statement.modifiers?.some((modifier) => modifier.kind === ts7.SyntaxKind.ExportKeyword);
|
|
12150
11862
|
if (!isExported)
|
|
12151
11863
|
continue;
|
|
12152
11864
|
for (const declaration of statement.declarationList.declarations) {
|
|
12153
|
-
if (!
|
|
11865
|
+
if (!ts7.isIdentifier(declaration.name))
|
|
12154
11866
|
continue;
|
|
12155
11867
|
if (declaration.name.text === "routes")
|
|
12156
11868
|
return true;
|
|
@@ -12163,7 +11875,7 @@ var SOURCE_EXTENSIONS3, SKIP_DIRS3, hasSourceExtension3 = (filePath) => {
|
|
|
12163
11875
|
for (const file of files) {
|
|
12164
11876
|
let source;
|
|
12165
11877
|
try {
|
|
12166
|
-
source =
|
|
11878
|
+
source = readFileSync13(file, "utf-8");
|
|
12167
11879
|
} catch {
|
|
12168
11880
|
continue;
|
|
12169
11881
|
}
|
|
@@ -12196,27 +11908,120 @@ var exports_runAngularHandlerScan = {};
|
|
|
12196
11908
|
__export(exports_runAngularHandlerScan, {
|
|
12197
11909
|
runAngularHandlerScan: () => runAngularHandlerScan
|
|
12198
11910
|
});
|
|
12199
|
-
var runAngularHandlerScan = (projectRoot, angularDirectory) => {
|
|
12200
|
-
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
const providersFiles = emitAngularProvidersFiles(projectRoot, calls, pageRoutes, { providersImport });
|
|
12204
|
-
emitAngularRouteMounts(projectRoot, calls);
|
|
12205
|
-
return {
|
|
12206
|
-
calls,
|
|
12207
|
-
manifestKeysWithProviders: new Set(providersFiles.map((file) => file.manifestKey)),
|
|
12208
|
-
pageRoutes,
|
|
12209
|
-
providersFiles
|
|
12210
|
-
};
|
|
12211
|
-
};
|
|
11911
|
+
var runAngularHandlerScan = (projectRoot, angularDirectory) => ({
|
|
11912
|
+
calls: scanAngularHandlerCalls(projectRoot),
|
|
11913
|
+
pageRoutes: scanAngularPageRoutes(angularDirectory)
|
|
11914
|
+
});
|
|
12212
11915
|
var init_runAngularHandlerScan = __esm(() => {
|
|
12213
|
-
init_emitAngularProvidersFiles();
|
|
12214
|
-
init_emitAngularRouteMounts();
|
|
12215
|
-
init_parseAngularConfigImports();
|
|
12216
11916
|
init_scanAngularHandlerCalls();
|
|
12217
11917
|
init_scanAngularPageRoutes();
|
|
12218
11918
|
});
|
|
12219
11919
|
|
|
11920
|
+
// src/build/parseAngularConfigImports.ts
|
|
11921
|
+
var exports_parseAngularConfigImports = {};
|
|
11922
|
+
__export(exports_parseAngularConfigImports, {
|
|
11923
|
+
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
11924
|
+
});
|
|
11925
|
+
import { existsSync as existsSync19, readFileSync as readFileSync14 } from "fs";
|
|
11926
|
+
import { dirname as dirname12, isAbsolute as isAbsolute4, join as join24 } from "path";
|
|
11927
|
+
import ts8 from "typescript";
|
|
11928
|
+
var findDefineConfigCall = (sf) => {
|
|
11929
|
+
let result = null;
|
|
11930
|
+
const visit = (node) => {
|
|
11931
|
+
if (result)
|
|
11932
|
+
return;
|
|
11933
|
+
if (ts8.isCallExpression(node) && ts8.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
11934
|
+
const [arg] = node.arguments;
|
|
11935
|
+
if (arg && ts8.isObjectLiteralExpression(arg)) {
|
|
11936
|
+
result = arg;
|
|
11937
|
+
return;
|
|
11938
|
+
}
|
|
11939
|
+
}
|
|
11940
|
+
ts8.forEachChild(node, visit);
|
|
11941
|
+
};
|
|
11942
|
+
ts8.forEachChild(sf, visit);
|
|
11943
|
+
return result;
|
|
11944
|
+
}, findPropertyInitializer = (object, name) => {
|
|
11945
|
+
for (const prop of object.properties) {
|
|
11946
|
+
if (!ts8.isPropertyAssignment(prop))
|
|
11947
|
+
continue;
|
|
11948
|
+
if (!prop.name)
|
|
11949
|
+
continue;
|
|
11950
|
+
const key = ts8.isIdentifier(prop.name) ? prop.name.text : ts8.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
11951
|
+
if (key === name)
|
|
11952
|
+
return prop.initializer;
|
|
11953
|
+
}
|
|
11954
|
+
return null;
|
|
11955
|
+
}, findImportForBinding = (sf, binding) => {
|
|
11956
|
+
for (const statement of sf.statements) {
|
|
11957
|
+
if (!ts8.isImportDeclaration(statement))
|
|
11958
|
+
continue;
|
|
11959
|
+
if (!ts8.isStringLiteral(statement.moduleSpecifier))
|
|
11960
|
+
continue;
|
|
11961
|
+
if (statement.importClause?.isTypeOnly)
|
|
11962
|
+
continue;
|
|
11963
|
+
const named = statement.importClause?.namedBindings;
|
|
11964
|
+
if (!named || !ts8.isNamedImports(named))
|
|
11965
|
+
continue;
|
|
11966
|
+
for (const element of named.elements) {
|
|
11967
|
+
if (element.isTypeOnly)
|
|
11968
|
+
continue;
|
|
11969
|
+
if (element.name.text === binding) {
|
|
11970
|
+
return {
|
|
11971
|
+
importedName: element.propertyName?.text ?? element.name.text,
|
|
11972
|
+
source: statement.moduleSpecifier.text
|
|
11973
|
+
};
|
|
11974
|
+
}
|
|
11975
|
+
}
|
|
11976
|
+
}
|
|
11977
|
+
return null;
|
|
11978
|
+
}, resolveConfigPath = (projectRoot) => {
|
|
11979
|
+
const candidates = [
|
|
11980
|
+
join24(projectRoot, "absolute.config.ts"),
|
|
11981
|
+
join24(projectRoot, "absolute.config.mts"),
|
|
11982
|
+
join24(projectRoot, "absolute.config.js"),
|
|
11983
|
+
join24(projectRoot, "absolute.config.mjs")
|
|
11984
|
+
];
|
|
11985
|
+
for (const candidate of candidates) {
|
|
11986
|
+
if (existsSync19(candidate))
|
|
11987
|
+
return candidate;
|
|
11988
|
+
}
|
|
11989
|
+
return null;
|
|
11990
|
+
}, parseAngularProvidersImport = (projectRoot) => {
|
|
11991
|
+
const configPath2 = resolveConfigPath(projectRoot);
|
|
11992
|
+
if (!configPath2)
|
|
11993
|
+
return null;
|
|
11994
|
+
const source = readFileSync14(configPath2, "utf-8");
|
|
11995
|
+
if (!source.includes("angular"))
|
|
11996
|
+
return null;
|
|
11997
|
+
if (!source.includes("providers"))
|
|
11998
|
+
return null;
|
|
11999
|
+
const sf = ts8.createSourceFile(configPath2, source, ts8.ScriptTarget.Latest, true, ts8.ScriptKind.TS);
|
|
12000
|
+
const configObject = findDefineConfigCall(sf);
|
|
12001
|
+
if (!configObject)
|
|
12002
|
+
return null;
|
|
12003
|
+
const angularField = findPropertyInitializer(configObject, "angular");
|
|
12004
|
+
if (!angularField || !ts8.isObjectLiteralExpression(angularField))
|
|
12005
|
+
return null;
|
|
12006
|
+
const providersField = findPropertyInitializer(angularField, "providers");
|
|
12007
|
+
if (!providersField)
|
|
12008
|
+
return null;
|
|
12009
|
+
if (!ts8.isIdentifier(providersField))
|
|
12010
|
+
return null;
|
|
12011
|
+
const binding = providersField.text;
|
|
12012
|
+
const importInfo = findImportForBinding(sf, binding);
|
|
12013
|
+
if (!importInfo)
|
|
12014
|
+
return null;
|
|
12015
|
+
const configDir2 = dirname12(configPath2);
|
|
12016
|
+
const absolutePath = importInfo.source.startsWith(".") ? join24(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute4(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
12017
|
+
return {
|
|
12018
|
+
absolutePath,
|
|
12019
|
+
bindingName: binding,
|
|
12020
|
+
importedName: importInfo.importedName
|
|
12021
|
+
};
|
|
12022
|
+
};
|
|
12023
|
+
var init_parseAngularConfigImports = () => {};
|
|
12024
|
+
|
|
12220
12025
|
// src/islands/sourceMetadata.ts
|
|
12221
12026
|
var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
|
|
12222
12027
|
const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
|
|
@@ -12359,12 +12164,12 @@ __export(exports_compileSvelte, {
|
|
|
12359
12164
|
import { existsSync as existsSync20 } from "fs";
|
|
12360
12165
|
import { mkdir as mkdir4, stat as stat2 } from "fs/promises";
|
|
12361
12166
|
import {
|
|
12362
|
-
dirname as
|
|
12363
|
-
join as
|
|
12167
|
+
dirname as dirname13,
|
|
12168
|
+
join as join25,
|
|
12364
12169
|
basename as basename6,
|
|
12365
12170
|
extname as extname5,
|
|
12366
12171
|
resolve as resolve20,
|
|
12367
|
-
relative as
|
|
12172
|
+
relative as relative9,
|
|
12368
12173
|
sep as sep2
|
|
12369
12174
|
} from "path";
|
|
12370
12175
|
import { env } from "process";
|
|
@@ -12408,7 +12213,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12408
12213
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12409
12214
|
if (!spec.startsWith("."))
|
|
12410
12215
|
return null;
|
|
12411
|
-
const basePath = resolve20(
|
|
12216
|
+
const basePath = resolve20(dirname13(from), spec);
|
|
12412
12217
|
const candidates = [
|
|
12413
12218
|
basePath,
|
|
12414
12219
|
`${basePath}.ts`,
|
|
@@ -12419,14 +12224,14 @@ var resolveDevClientDir2 = () => {
|
|
|
12419
12224
|
`${basePath}.svelte`,
|
|
12420
12225
|
`${basePath}.svelte.ts`,
|
|
12421
12226
|
`${basePath}.svelte.js`,
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12227
|
+
join25(basePath, "index.ts"),
|
|
12228
|
+
join25(basePath, "index.js"),
|
|
12229
|
+
join25(basePath, "index.mjs"),
|
|
12230
|
+
join25(basePath, "index.cjs"),
|
|
12231
|
+
join25(basePath, "index.json"),
|
|
12232
|
+
join25(basePath, "index.svelte"),
|
|
12233
|
+
join25(basePath, "index.svelte.ts"),
|
|
12234
|
+
join25(basePath, "index.svelte.js")
|
|
12430
12235
|
];
|
|
12431
12236
|
const checks = await Promise.all(candidates.map(exists));
|
|
12432
12237
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -12435,7 +12240,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12435
12240
|
const resolved = resolvePackageImport(spec);
|
|
12436
12241
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12437
12242
|
}
|
|
12438
|
-
const basePath = resolve20(
|
|
12243
|
+
const basePath = resolve20(dirname13(from), spec);
|
|
12439
12244
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12440
12245
|
if (!explicit) {
|
|
12441
12246
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12456,8 +12261,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12456
12261
|
return jsPath;
|
|
12457
12262
|
return null;
|
|
12458
12263
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12459
|
-
const toServer =
|
|
12460
|
-
const toClient =
|
|
12264
|
+
const toServer = relative9(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12265
|
+
const toClient = relative9(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12461
12266
|
rewrites.set(rawSpec, {
|
|
12462
12267
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12463
12268
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12465,9 +12270,9 @@ var resolveDevClientDir2 = () => {
|
|
|
12465
12270
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
12466
12271
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
12467
12272
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
12468
|
-
const clientDir =
|
|
12469
|
-
const indexDir =
|
|
12470
|
-
const serverDir =
|
|
12273
|
+
const clientDir = join25(generatedDir, "client");
|
|
12274
|
+
const indexDir = join25(generatedDir, "indexes");
|
|
12275
|
+
const serverDir = join25(generatedDir, "server");
|
|
12471
12276
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
|
|
12472
12277
|
const dev = env.NODE_ENV !== "production";
|
|
12473
12278
|
const build = async (src) => {
|
|
@@ -12495,8 +12300,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12495
12300
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12496
12301
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12497
12302
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12498
|
-
const rawRel =
|
|
12499
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
12303
|
+
const rawRel = dirname13(relative9(svelteRoot, src)).replace(/\\/g, "/");
|
|
12304
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative9(process.cwd(), dirname13(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12500
12305
|
const baseName = basename6(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12501
12306
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12502
12307
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12505,8 +12310,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12505
12310
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
12506
12311
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12507
12312
|
const externalRewrites = new Map;
|
|
12508
|
-
const ssrOutputDir =
|
|
12509
|
-
const clientOutputDir =
|
|
12313
|
+
const ssrOutputDir = dirname13(join25(serverDir, relDir, `${baseName}.js`));
|
|
12314
|
+
const clientOutputDir = dirname13(join25(clientDir, relDir, `${baseName}.js`));
|
|
12510
12315
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12511
12316
|
const rawSpec = importPaths[idx];
|
|
12512
12317
|
if (!rawSpec)
|
|
@@ -12517,15 +12322,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12517
12322
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12518
12323
|
if (!resolved)
|
|
12519
12324
|
continue;
|
|
12520
|
-
const childRel =
|
|
12325
|
+
const childRel = relative9(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12521
12326
|
if (!childRel.startsWith(".."))
|
|
12522
12327
|
continue;
|
|
12523
12328
|
const childBuilt2 = cache.get(resolved);
|
|
12524
12329
|
if (!childBuilt2)
|
|
12525
12330
|
continue;
|
|
12526
12331
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12527
|
-
const toServer =
|
|
12528
|
-
const toClient =
|
|
12332
|
+
const toServer = relative9(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
12333
|
+
const toClient = relative9(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12529
12334
|
externalRewrites.set(origSpec, {
|
|
12530
12335
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12531
12336
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12559,7 +12364,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12559
12364
|
}).js;
|
|
12560
12365
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12561
12366
|
if (mode === "client" && isDev) {
|
|
12562
|
-
const moduleKey = `/@src/${
|
|
12367
|
+
const moduleKey = `/@src/${relative9(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12563
12368
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12564
12369
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12565
12370
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12571,11 +12376,11 @@ var resolveDevClientDir2 = () => {
|
|
|
12571
12376
|
code += islandMetadataExports;
|
|
12572
12377
|
return { code, map: compiledJs.map };
|
|
12573
12378
|
};
|
|
12574
|
-
const ssrPath =
|
|
12575
|
-
const clientPath =
|
|
12379
|
+
const ssrPath = join25(serverDir, relDir, `${baseName}.js`);
|
|
12380
|
+
const clientPath = join25(clientDir, relDir, `${baseName}.js`);
|
|
12576
12381
|
await Promise.all([
|
|
12577
|
-
mkdir4(
|
|
12578
|
-
mkdir4(
|
|
12382
|
+
mkdir4(dirname13(ssrPath), { recursive: true }),
|
|
12383
|
+
mkdir4(dirname13(clientPath), { recursive: true })
|
|
12579
12384
|
]);
|
|
12580
12385
|
const inlineMap = (map) => map ? `
|
|
12581
12386
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -12608,10 +12413,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12608
12413
|
};
|
|
12609
12414
|
const roots = await Promise.all(entryPoints.map(build));
|
|
12610
12415
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
12611
|
-
const relClientDir =
|
|
12416
|
+
const relClientDir = dirname13(relative9(clientDir, client));
|
|
12612
12417
|
const name = basename6(client, extname5(client));
|
|
12613
|
-
const indexPath =
|
|
12614
|
-
const importRaw =
|
|
12418
|
+
const indexPath = join25(indexDir, relClientDir, `${name}.js`);
|
|
12419
|
+
const importRaw = relative9(dirname13(indexPath), client).split(sep2).join("/");
|
|
12615
12420
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12616
12421
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12617
12422
|
import "${hmrClientPath3}";
|
|
@@ -12682,14 +12487,14 @@ if (typeof window !== "undefined") {
|
|
|
12682
12487
|
setTimeout(releaseStreamingSlots, 0);
|
|
12683
12488
|
}
|
|
12684
12489
|
}`;
|
|
12685
|
-
await mkdir4(
|
|
12490
|
+
await mkdir4(dirname13(indexPath), { recursive: true });
|
|
12686
12491
|
return write2(indexPath, bootstrap);
|
|
12687
12492
|
}));
|
|
12688
12493
|
return {
|
|
12689
12494
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
12690
12495
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
12691
|
-
const rel =
|
|
12692
|
-
return
|
|
12496
|
+
const rel = dirname13(relative9(clientDir, client));
|
|
12497
|
+
return join25(indexDir, rel, basename6(client));
|
|
12693
12498
|
}),
|
|
12694
12499
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
12695
12500
|
};
|
|
@@ -12704,7 +12509,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
12704
12509
|
init_lowerAwaitSlotSyntax();
|
|
12705
12510
|
init_renderToReadableStream();
|
|
12706
12511
|
devClientDir2 = resolveDevClientDir2();
|
|
12707
|
-
hmrClientPath3 =
|
|
12512
|
+
hmrClientPath3 = join25(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
12708
12513
|
persistentCache = new Map;
|
|
12709
12514
|
sourceHashCache = new Map;
|
|
12710
12515
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -12719,7 +12524,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
12719
12524
|
chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
|
|
12720
12525
|
buildLineRemap: () => buildLineRemap
|
|
12721
12526
|
});
|
|
12722
|
-
import { readFileSync as readFileSync15, writeFileSync as
|
|
12527
|
+
import { readFileSync as readFileSync15, writeFileSync as writeFileSync7 } from "fs";
|
|
12723
12528
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
12724
12529
|
let result = 0;
|
|
12725
12530
|
let shift = 0;
|
|
@@ -13026,7 +12831,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
13026
12831
|
const stripped = text.replace(SOURCEMAP_INLINE_RE, "");
|
|
13027
12832
|
const inline = `
|
|
13028
12833
|
//# sourceMappingURL=data:application/json;base64,` + Buffer.from(JSON.stringify(chained)).toString("base64");
|
|
13029
|
-
|
|
12834
|
+
writeFileSync7(bundleFilePath, stripped + inline);
|
|
13030
12835
|
};
|
|
13031
12836
|
var init_chainInlineSourcemaps = __esm(() => {
|
|
13032
12837
|
BASE64_TO_INT = new Int8Array(128).fill(-1);
|
|
@@ -13100,10 +12905,10 @@ import { existsSync as existsSync21 } from "fs";
|
|
|
13100
12905
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
13101
12906
|
import {
|
|
13102
12907
|
basename as basename7,
|
|
13103
|
-
dirname as
|
|
12908
|
+
dirname as dirname14,
|
|
13104
12909
|
isAbsolute as isAbsolute5,
|
|
13105
|
-
join as
|
|
13106
|
-
relative as
|
|
12910
|
+
join as join26,
|
|
12911
|
+
relative as relative10,
|
|
13107
12912
|
resolve as resolve21
|
|
13108
12913
|
} from "path";
|
|
13109
12914
|
var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
@@ -13155,7 +12960,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13155
12960
|
return "template-only";
|
|
13156
12961
|
}
|
|
13157
12962
|
return "full";
|
|
13158
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
12963
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative10(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) => {
|
|
13159
12964
|
if (filePath.endsWith(".vue"))
|
|
13160
12965
|
return filePath.replace(/\.vue$/, ".js");
|
|
13161
12966
|
if (filePath.endsWith(".ts"))
|
|
@@ -13188,7 +12993,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13188
12993
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13189
12994
|
if (cachedResult)
|
|
13190
12995
|
return cachedResult;
|
|
13191
|
-
const relativeFilePath =
|
|
12996
|
+
const relativeFilePath = relative10(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13192
12997
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13193
12998
|
const fileBaseName = basename7(sourceFilePath, ".vue");
|
|
13194
12999
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13226,12 +13031,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13226
13031
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13227
13032
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13228
13033
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13229
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute5(path)) && isStylePath(path)).map((path) => isAbsolute5(path) ? path : resolve21(
|
|
13034
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute5(path)) && isStylePath(path)).map((path) => isAbsolute5(path) ? path : resolve21(dirname14(sourceFilePath), path));
|
|
13230
13035
|
for (const stylePath of stylePathsImported) {
|
|
13231
13036
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13232
13037
|
}
|
|
13233
13038
|
const childBuildResults = await Promise.all([
|
|
13234
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(
|
|
13039
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(dirname14(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13235
13040
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13236
13041
|
]);
|
|
13237
13042
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13241,7 +13046,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13241
13046
|
sourceMap: true
|
|
13242
13047
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
13243
13048
|
const strippedScript = stripExports2(compiledScript.content);
|
|
13244
|
-
const sourceDir =
|
|
13049
|
+
const sourceDir = dirname14(sourceFilePath);
|
|
13245
13050
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
13246
13051
|
const packageImportRewrites = new Map;
|
|
13247
13052
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -13280,8 +13085,8 @@ var resolveDevClientDir3 = () => {
|
|
|
13280
13085
|
];
|
|
13281
13086
|
let cssOutputPaths = [];
|
|
13282
13087
|
if (isEntryPoint && allCss.length) {
|
|
13283
|
-
const cssOutputFile =
|
|
13284
|
-
await mkdir5(
|
|
13088
|
+
const cssOutputFile = join26(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13089
|
+
await mkdir5(dirname14(cssOutputFile), { recursive: true });
|
|
13285
13090
|
await write3(cssOutputFile, allCss.join(`
|
|
13286
13091
|
`));
|
|
13287
13092
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -13311,9 +13116,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13311
13116
|
};
|
|
13312
13117
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
13313
13118
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13314
|
-
const clientOutputPath =
|
|
13315
|
-
const serverOutputPath =
|
|
13316
|
-
const relDir =
|
|
13119
|
+
const clientOutputPath = join26(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13120
|
+
const serverOutputPath = join26(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13121
|
+
const relDir = dirname14(relativeFilePath);
|
|
13317
13122
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
13318
13123
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
13319
13124
|
const upCount = dots.split("/").length - 1;
|
|
@@ -13325,15 +13130,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13325
13130
|
let result2 = code;
|
|
13326
13131
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13327
13132
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13328
|
-
let rel =
|
|
13133
|
+
let rel = relative10(dirname14(outputPath), targetPath).replace(/\\/g, "/");
|
|
13329
13134
|
if (!rel.startsWith("."))
|
|
13330
13135
|
rel = `./${rel}`;
|
|
13331
13136
|
result2 = result2.replaceAll(bareImport, rel);
|
|
13332
13137
|
}
|
|
13333
13138
|
return result2;
|
|
13334
13139
|
};
|
|
13335
|
-
await mkdir5(
|
|
13336
|
-
await mkdir5(
|
|
13140
|
+
await mkdir5(dirname14(clientOutputPath), { recursive: true });
|
|
13141
|
+
await mkdir5(dirname14(serverOutputPath), { recursive: true });
|
|
13337
13142
|
const clientFinal = rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client");
|
|
13338
13143
|
const serverFinal = rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server");
|
|
13339
13144
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -13355,7 +13160,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13355
13160
|
hmrId,
|
|
13356
13161
|
serverPath: serverOutputPath,
|
|
13357
13162
|
tsHelperPaths: [
|
|
13358
|
-
...helperModulePaths.map((helper) => resolve21(
|
|
13163
|
+
...helperModulePaths.map((helper) => resolve21(dirname14(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
13359
13164
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13360
13165
|
]
|
|
13361
13166
|
};
|
|
@@ -13365,10 +13170,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13365
13170
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
13366
13171
|
const compiler = await import("@vue/compiler-sfc");
|
|
13367
13172
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
13368
|
-
const clientOutputDir =
|
|
13369
|
-
const indexOutputDir =
|
|
13370
|
-
const serverOutputDir =
|
|
13371
|
-
const cssOutputDir =
|
|
13173
|
+
const clientOutputDir = join26(generatedDir, "client");
|
|
13174
|
+
const indexOutputDir = join26(generatedDir, "indexes");
|
|
13175
|
+
const serverOutputDir = join26(generatedDir, "server");
|
|
13176
|
+
const cssOutputDir = join26(generatedDir, "compiled");
|
|
13372
13177
|
await Promise.all([
|
|
13373
13178
|
mkdir5(clientOutputDir, { recursive: true }),
|
|
13374
13179
|
mkdir5(indexOutputDir, { recursive: true }),
|
|
@@ -13385,16 +13190,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13385
13190
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
13386
13191
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
13387
13192
|
const entryBaseName = basename7(entryPath, ".vue");
|
|
13388
|
-
const indexOutputFile =
|
|
13389
|
-
const clientOutputFile =
|
|
13390
|
-
await mkdir5(
|
|
13193
|
+
const indexOutputFile = join26(indexOutputDir, `${entryBaseName}.js`);
|
|
13194
|
+
const clientOutputFile = join26(clientOutputDir, relative10(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
13195
|
+
await mkdir5(dirname14(indexOutputFile), { recursive: true });
|
|
13391
13196
|
const vueHmrImports = isDev ? [
|
|
13392
13197
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
13393
13198
|
`import "${hmrClientPath4}";`
|
|
13394
13199
|
] : [];
|
|
13395
13200
|
await write3(indexOutputFile, [
|
|
13396
13201
|
...vueHmrImports,
|
|
13397
|
-
`import Comp, * as PageModule from "${
|
|
13202
|
+
`import Comp, * as PageModule from "${relative10(dirname14(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13398
13203
|
'import { createSSRApp, createApp } from "vue";',
|
|
13399
13204
|
"",
|
|
13400
13205
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13538,11 +13343,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13538
13343
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13539
13344
|
const sourceCode = await file2(tsPath).text();
|
|
13540
13345
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13541
|
-
const relativeJsPath =
|
|
13542
|
-
const outClientPath =
|
|
13543
|
-
const outServerPath =
|
|
13544
|
-
await mkdir5(
|
|
13545
|
-
await mkdir5(
|
|
13346
|
+
const relativeJsPath = relative10(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
13347
|
+
const outClientPath = join26(clientOutputDir, relativeJsPath);
|
|
13348
|
+
const outServerPath = join26(serverOutputDir, relativeJsPath);
|
|
13349
|
+
await mkdir5(dirname14(outClientPath), { recursive: true });
|
|
13350
|
+
await mkdir5(dirname14(outServerPath), { recursive: true });
|
|
13546
13351
|
await write3(outClientPath, transpiledCode);
|
|
13547
13352
|
await write3(outServerPath, transpiledCode);
|
|
13548
13353
|
}));
|
|
@@ -13563,7 +13368,7 @@ var init_compileVue = __esm(() => {
|
|
|
13563
13368
|
init_vueAutoRouterTransform();
|
|
13564
13369
|
init_stylePreprocessor();
|
|
13565
13370
|
devClientDir3 = resolveDevClientDir3();
|
|
13566
|
-
hmrClientPath4 =
|
|
13371
|
+
hmrClientPath4 = join26(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
13567
13372
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
13568
13373
|
scriptCache = new Map;
|
|
13569
13374
|
scriptSetupCache = new Map;
|
|
@@ -14045,7 +13850,7 @@ __export(exports_compileAngular, {
|
|
|
14045
13850
|
compileAngular: () => compileAngular
|
|
14046
13851
|
});
|
|
14047
13852
|
import { existsSync as existsSync22, readFileSync as readFileSync16, promises as fs5 } from "fs";
|
|
14048
|
-
import { join as
|
|
13853
|
+
import { join as join27, basename as basename8, sep as sep3, dirname as dirname15, resolve as resolve22, relative as relative11 } from "path";
|
|
14049
13854
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14050
13855
|
import ts9 from "typescript";
|
|
14051
13856
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
@@ -14088,10 +13893,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14088
13893
|
`${candidate}.tsx`,
|
|
14089
13894
|
`${candidate}.js`,
|
|
14090
13895
|
`${candidate}.jsx`,
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
13896
|
+
join27(candidate, "index.ts"),
|
|
13897
|
+
join27(candidate, "index.tsx"),
|
|
13898
|
+
join27(candidate, "index.js"),
|
|
13899
|
+
join27(candidate, "index.jsx")
|
|
14095
13900
|
];
|
|
14096
13901
|
return candidates.find((file3) => existsSync22(file3));
|
|
14097
13902
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -14163,7 +13968,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14163
13968
|
if (scan.usesLegacyAnimations)
|
|
14164
13969
|
return true;
|
|
14165
13970
|
for (const specifier of scan.imports) {
|
|
14166
|
-
const importedPath = resolveLocalImport(specifier,
|
|
13971
|
+
const importedPath = resolveLocalImport(specifier, dirname15(resolved));
|
|
14167
13972
|
if (importedPath && await visit(importedPath, visited)) {
|
|
14168
13973
|
return true;
|
|
14169
13974
|
}
|
|
@@ -14222,7 +14027,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14222
14027
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
14223
14028
|
if (hasJsLikeExtension(path))
|
|
14224
14029
|
return `${path}${query}`;
|
|
14225
|
-
const importerDir =
|
|
14030
|
+
const importerDir = dirname15(importerOutputPath);
|
|
14226
14031
|
const fileCandidate = resolve22(importerDir, `${path}.js`);
|
|
14227
14032
|
if (outputFiles?.has(fileCandidate) || existsSync22(fileCandidate)) {
|
|
14228
14033
|
return `${path}.js${query}`;
|
|
@@ -14255,16 +14060,16 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14255
14060
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14256
14061
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14257
14062
|
return null;
|
|
14258
|
-
const basePath = resolve22(
|
|
14063
|
+
const basePath = resolve22(dirname15(fromFile), specifier);
|
|
14259
14064
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14260
14065
|
`${basePath}.ts`,
|
|
14261
14066
|
`${basePath}.tsx`,
|
|
14262
14067
|
`${basePath}.mts`,
|
|
14263
14068
|
`${basePath}.cts`,
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14069
|
+
join27(basePath, "index.ts"),
|
|
14070
|
+
join27(basePath, "index.tsx"),
|
|
14071
|
+
join27(basePath, "index.mts"),
|
|
14072
|
+
join27(basePath, "index.cts")
|
|
14268
14073
|
];
|
|
14269
14074
|
return candidates.map((candidate) => resolve22(candidate)).find((candidate) => existsSync22(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14270
14075
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
@@ -14290,15 +14095,15 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14290
14095
|
const paths = [];
|
|
14291
14096
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14292
14097
|
if (templateUrlMatch?.[1])
|
|
14293
|
-
paths.push(
|
|
14098
|
+
paths.push(join27(fileDir, templateUrlMatch[1]));
|
|
14294
14099
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14295
14100
|
if (styleUrlMatch?.[1])
|
|
14296
|
-
paths.push(
|
|
14101
|
+
paths.push(join27(fileDir, styleUrlMatch[1]));
|
|
14297
14102
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
14298
14103
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
14299
14104
|
if (urlMatches) {
|
|
14300
14105
|
for (const urlMatch of urlMatches) {
|
|
14301
|
-
paths.push(
|
|
14106
|
+
paths.push(join27(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14302
14107
|
}
|
|
14303
14108
|
}
|
|
14304
14109
|
return paths.map((path) => resolve22(path));
|
|
@@ -14313,13 +14118,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14313
14118
|
return null;
|
|
14314
14119
|
}
|
|
14315
14120
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
14316
|
-
await fs5.mkdir(
|
|
14121
|
+
await fs5.mkdir(dirname15(cachePath), { recursive: true });
|
|
14317
14122
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
14318
14123
|
source,
|
|
14319
14124
|
version: 1
|
|
14320
14125
|
}), "utf-8");
|
|
14321
14126
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
14322
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
14127
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname15(filePath));
|
|
14323
14128
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
14324
14129
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
14325
14130
|
return `${resourcePath}\x00${content}`;
|
|
@@ -14332,7 +14137,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14332
14137
|
safeStableStringify(stylePreprocessors ?? null)
|
|
14333
14138
|
].join("\x00");
|
|
14334
14139
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
14335
|
-
return
|
|
14140
|
+
return join27(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
14336
14141
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
14337
14142
|
const transformedSources = new Map;
|
|
14338
14143
|
const visited = new Set;
|
|
@@ -14359,7 +14164,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14359
14164
|
transformedSource = cached.source;
|
|
14360
14165
|
} else {
|
|
14361
14166
|
stats.cacheMisses += 1;
|
|
14362
|
-
const transformed = await inlineResources(source,
|
|
14167
|
+
const transformed = await inlineResources(source, dirname15(resolvedPath), stylePreprocessors);
|
|
14363
14168
|
transformedSource = transformed.source;
|
|
14364
14169
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
14365
14170
|
}
|
|
@@ -14378,7 +14183,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14378
14183
|
return { stats, transformedSources };
|
|
14379
14184
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14380
14185
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14381
|
-
const outputPath = resolve22(
|
|
14186
|
+
const outputPath = resolve22(join27(outDir, relative11(process.cwd(), resolve22(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14382
14187
|
return [
|
|
14383
14188
|
outputPath,
|
|
14384
14189
|
buildIslandMetadataExports(readFileSync16(inputPath, "utf-8"))
|
|
@@ -14388,7 +14193,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14388
14193
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
14389
14194
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14390
14195
|
const tsPath = __require.resolve("typescript");
|
|
14391
|
-
const tsRootDir =
|
|
14196
|
+
const tsRootDir = dirname15(tsPath);
|
|
14392
14197
|
return tsRootDir.endsWith("lib") ? tsRootDir : resolve22(tsRootDir, "lib");
|
|
14393
14198
|
});
|
|
14394
14199
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
@@ -14425,7 +14230,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14425
14230
|
const originalGetSourceFile = host.getSourceFile;
|
|
14426
14231
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14427
14232
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
14428
|
-
const resolvedPath =
|
|
14233
|
+
const resolvedPath = join27(tsLibDir, fileName);
|
|
14429
14234
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
14430
14235
|
}
|
|
14431
14236
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -14480,7 +14285,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14480
14285
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
14481
14286
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
14482
14287
|
content,
|
|
14483
|
-
target:
|
|
14288
|
+
target: join27(outDir, fileName)
|
|
14484
14289
|
}));
|
|
14485
14290
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve22(target)));
|
|
14486
14291
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -14502,7 +14307,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
14502
14307
|
});
|
|
14503
14308
|
});
|
|
14504
14309
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
14505
|
-
await fs5.mkdir(
|
|
14310
|
+
await fs5.mkdir(dirname15(target), { recursive: true });
|
|
14506
14311
|
await fs5.writeFile(target, content, "utf-8");
|
|
14507
14312
|
})), { outputs: entries.length });
|
|
14508
14313
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -14657,7 +14462,7 @@ ${fields}
|
|
|
14657
14462
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
14658
14463
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14659
14464
|
if (templateUrlMatch?.[1]) {
|
|
14660
|
-
const templatePath =
|
|
14465
|
+
const templatePath = join27(fileDir, templateUrlMatch[1]);
|
|
14661
14466
|
if (!existsSync22(templatePath)) {
|
|
14662
14467
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14663
14468
|
}
|
|
@@ -14688,7 +14493,7 @@ ${fields}
|
|
|
14688
14493
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
14689
14494
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14690
14495
|
if (templateUrlMatch?.[1]) {
|
|
14691
|
-
const templatePath =
|
|
14496
|
+
const templatePath = join27(fileDir, templateUrlMatch[1]);
|
|
14692
14497
|
if (!existsSync22(templatePath)) {
|
|
14693
14498
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
14694
14499
|
}
|
|
@@ -14725,7 +14530,7 @@ ${fields}
|
|
|
14725
14530
|
return source;
|
|
14726
14531
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
14727
14532
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
14728
|
-
return readAndEscapeFile(
|
|
14533
|
+
return readAndEscapeFile(join27(fileDir, styleUrl), stylePreprocessors);
|
|
14729
14534
|
});
|
|
14730
14535
|
const results = await Promise.all(stylePromises);
|
|
14731
14536
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -14736,7 +14541,7 @@ ${fields}
|
|
|
14736
14541
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14737
14542
|
if (!styleUrlMatch?.[1])
|
|
14738
14543
|
return source;
|
|
14739
|
-
const escaped = await readAndEscapeFile(
|
|
14544
|
+
const escaped = await readAndEscapeFile(join27(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
14740
14545
|
if (!escaped)
|
|
14741
14546
|
return source;
|
|
14742
14547
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -14772,10 +14577,10 @@ ${fields}
|
|
|
14772
14577
|
`${candidate}.js`,
|
|
14773
14578
|
`${candidate}.jsx`,
|
|
14774
14579
|
`${candidate}.json`,
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
|
|
14778
|
-
|
|
14580
|
+
join27(candidate, "index.ts"),
|
|
14581
|
+
join27(candidate, "index.tsx"),
|
|
14582
|
+
join27(candidate, "index.js"),
|
|
14583
|
+
join27(candidate, "index.jsx")
|
|
14779
14584
|
];
|
|
14780
14585
|
return candidates.find((file3) => existsSync22(file3));
|
|
14781
14586
|
};
|
|
@@ -14799,13 +14604,13 @@ ${fields}
|
|
|
14799
14604
|
}
|
|
14800
14605
|
};
|
|
14801
14606
|
const toOutputPath = (sourcePath) => {
|
|
14802
|
-
const inputDir =
|
|
14607
|
+
const inputDir = dirname15(sourcePath);
|
|
14803
14608
|
const fileBase = basename8(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14804
14609
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
14805
|
-
return
|
|
14610
|
+
return join27(inputDir, fileBase);
|
|
14806
14611
|
}
|
|
14807
14612
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
14808
|
-
return
|
|
14613
|
+
return join27(outDir, relativeDir, fileBase);
|
|
14809
14614
|
};
|
|
14810
14615
|
const withCacheBuster = (specifier) => {
|
|
14811
14616
|
if (!cacheBuster)
|
|
@@ -14853,10 +14658,10 @@ ${fields}
|
|
|
14853
14658
|
return;
|
|
14854
14659
|
visited.add(resolved);
|
|
14855
14660
|
if (resolved.endsWith(".json") && existsSync22(resolved)) {
|
|
14856
|
-
const inputDir2 =
|
|
14661
|
+
const inputDir2 = dirname15(resolved);
|
|
14857
14662
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
14858
|
-
const targetDir2 =
|
|
14859
|
-
const targetPath2 =
|
|
14663
|
+
const targetDir2 = join27(outDir, relativeDir2);
|
|
14664
|
+
const targetPath2 = join27(targetDir2, basename8(resolved));
|
|
14860
14665
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
14861
14666
|
await fs5.copyFile(resolved, targetPath2);
|
|
14862
14667
|
allOutputs.push(targetPath2);
|
|
@@ -14868,13 +14673,13 @@ ${fields}
|
|
|
14868
14673
|
if (!existsSync22(actualPath))
|
|
14869
14674
|
return;
|
|
14870
14675
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
14871
|
-
const inlined = await inlineResources(sourceCode,
|
|
14872
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
14873
|
-
const inputDir =
|
|
14676
|
+
const inlined = await inlineResources(sourceCode, dirname15(actualPath), stylePreprocessors);
|
|
14677
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname15(actualPath)).source;
|
|
14678
|
+
const inputDir = dirname15(actualPath);
|
|
14874
14679
|
const fileBase = basename8(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
14875
14680
|
const targetPath = toOutputPath(actualPath);
|
|
14876
|
-
const targetDir =
|
|
14877
|
-
const relativeDir =
|
|
14681
|
+
const targetDir = dirname15(targetPath);
|
|
14682
|
+
const relativeDir = relative11(outDir, targetDir).replace(/\\/g, "/");
|
|
14878
14683
|
const localImports = [];
|
|
14879
14684
|
const importRewrites = new Map;
|
|
14880
14685
|
const fromRegex = /(?:from|import)\s+['"]([^'".][^'"]*|\.\.?\/[^'"]+)['"]/g;
|
|
@@ -14895,7 +14700,7 @@ ${fields}
|
|
|
14895
14700
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
14896
14701
|
if (!resolved2)
|
|
14897
14702
|
return null;
|
|
14898
|
-
const relativeImport =
|
|
14703
|
+
const relativeImport = relative11(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
14899
14704
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
14900
14705
|
importRewrites.set(specifier, relativeRewrite);
|
|
14901
14706
|
return resolved2;
|
|
@@ -14934,7 +14739,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14934
14739
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
14935
14740
|
}
|
|
14936
14741
|
const compiledRoot = compiledParent;
|
|
14937
|
-
const indexesDir =
|
|
14742
|
+
const indexesDir = join27(compiledParent, "indexes");
|
|
14938
14743
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
14939
14744
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve22(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
14940
14745
|
if (!hmr) {
|
|
@@ -14948,10 +14753,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14948
14753
|
absolute: false,
|
|
14949
14754
|
cwd: angularSrcDir
|
|
14950
14755
|
})) {
|
|
14951
|
-
const sourcePath =
|
|
14952
|
-
const cwdRel =
|
|
14953
|
-
const targetPath =
|
|
14954
|
-
await fs5.mkdir(
|
|
14756
|
+
const sourcePath = join27(angularSrcDir, rel);
|
|
14757
|
+
const cwdRel = relative11(cwd, sourcePath);
|
|
14758
|
+
const targetPath = join27(compiledRoot, cwdRel);
|
|
14759
|
+
await fs5.mkdir(dirname15(targetPath), { recursive: true });
|
|
14955
14760
|
await fs5.copyFile(sourcePath, targetPath);
|
|
14956
14761
|
}
|
|
14957
14762
|
});
|
|
@@ -14959,7 +14764,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14959
14764
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
14960
14765
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
14961
14766
|
const resolvedEntry = resolve22(entry);
|
|
14962
|
-
const relativeEntry =
|
|
14767
|
+
const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
14963
14768
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
14964
14769
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
14965
14770
|
entry: resolvedEntry
|
|
@@ -14967,9 +14772,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
14967
14772
|
const fileBase = basename8(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
14968
14773
|
const jsName = `${fileBase}.js`;
|
|
14969
14774
|
const compiledFallbackPaths = [
|
|
14970
|
-
|
|
14971
|
-
|
|
14972
|
-
|
|
14775
|
+
join27(compiledRoot, relativeEntry),
|
|
14776
|
+
join27(compiledRoot, "pages", jsName),
|
|
14777
|
+
join27(compiledRoot, jsName)
|
|
14973
14778
|
].map((file3) => resolve22(file3));
|
|
14974
14779
|
const resolveRawServerFile = (candidatePaths) => {
|
|
14975
14780
|
const normalizedCandidates = [
|
|
@@ -15017,7 +14822,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15017
14822
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
15018
14823
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
15019
14824
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
15020
|
-
const clientFile =
|
|
14825
|
+
const clientFile = join27(indexesDir, jsName);
|
|
15021
14826
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync22(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
15022
14827
|
return {
|
|
15023
14828
|
clientPath: clientFile,
|
|
@@ -15047,11 +14852,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15047
14852
|
const compiledAppProvidersPath = (() => {
|
|
15048
14853
|
const angularDirAbs = resolve22(outRoot);
|
|
15049
14854
|
const appSourceAbs = resolve22(providersInjection.appProvidersSource);
|
|
15050
|
-
const rel =
|
|
15051
|
-
return
|
|
14855
|
+
const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
14856
|
+
return join27(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
15052
14857
|
})();
|
|
15053
14858
|
const appProvidersSpec = (() => {
|
|
15054
|
-
const rel =
|
|
14859
|
+
const rel = relative11(dirname15(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
15055
14860
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15056
14861
|
})();
|
|
15057
14862
|
const importLines = [
|
|
@@ -15073,9 +14878,8 @@ export const providers = [${fragments.join(", ")}];
|
|
|
15073
14878
|
`;
|
|
15074
14879
|
}
|
|
15075
14880
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15076
|
-
const relativePath =
|
|
14881
|
+
const relativePath = relative11(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15077
14882
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15078
|
-
const generatedProvidersImport = "var generatedProviders = null;";
|
|
15079
14883
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
15080
14884
|
import "${hmrClientPath5}";
|
|
15081
14885
|
` : "";
|
|
@@ -15086,8 +14890,6 @@ import { provideClientHydration } from '@angular/platform-browser';
|
|
|
15086
14890
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
15087
14891
|
import { provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
15088
14892
|
import * as pageModule from '${normalizedImportPath}';
|
|
15089
|
-
${generatedProvidersImport}
|
|
15090
|
-
|
|
15091
14893
|
var ${componentClassName} = pageModule.default;
|
|
15092
14894
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
15093
14895
|
// \`inject(REQUEST_CONTEXT)\` (or \`usePageContext<T>()\`) returns the same
|
|
@@ -15100,15 +14902,14 @@ var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolea
|
|
|
15100
14902
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
15101
14903
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
15102
14904
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
15103
|
-
// Page-level providers
|
|
15104
|
-
//
|
|
15105
|
-
//
|
|
15106
|
-
//
|
|
15107
|
-
//
|
|
15108
|
-
|
|
15109
|
-
var
|
|
15110
|
-
|
|
15111
|
-
: (Array.isArray(legacyPageProviders) ? legacyPageProviders : []);
|
|
14905
|
+
// Page-level providers are injected directly into the page module's
|
|
14906
|
+
// server output by \`compileAngular\`'s providers-injection step
|
|
14907
|
+
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
14908
|
+
// so the page module always exports its own ready-to-use \`providers\`
|
|
14909
|
+
// array. Same module, same \`@angular/core\` instance on both server
|
|
14910
|
+
// and client bundle.
|
|
14911
|
+
var pageProvidersExport = Reflect.get(pageModule, 'providers');
|
|
14912
|
+
var pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
|
|
15112
14913
|
var absoluteHttpTransferCacheOptions = {
|
|
15113
14914
|
includePostRequests: false,
|
|
15114
14915
|
includeRequestsWithAuthHeaders: false,
|
|
@@ -15185,8 +14986,6 @@ import { provideClientHydration } from '@angular/platform-browser';
|
|
|
15185
14986
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
15186
14987
|
import { enableProdMode, provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
15187
14988
|
import * as pageModule from '${normalizedImportPath}';
|
|
15188
|
-
${generatedProvidersImport}
|
|
15189
|
-
|
|
15190
14989
|
var ${componentClassName} = pageModule.default;
|
|
15191
14990
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
15192
14991
|
// \`inject(REQUEST_CONTEXT)\` (or \`usePageContext<T>()\`) returns the same
|
|
@@ -15199,15 +14998,14 @@ var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolea
|
|
|
15199
14998
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
15200
14999
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
15201
15000
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
15202
|
-
// Page-level providers
|
|
15203
|
-
//
|
|
15204
|
-
//
|
|
15205
|
-
//
|
|
15206
|
-
//
|
|
15207
|
-
|
|
15208
|
-
var
|
|
15209
|
-
|
|
15210
|
-
: (Array.isArray(legacyPageProviders) ? legacyPageProviders : []);
|
|
15001
|
+
// Page-level providers are injected directly into the page module's
|
|
15002
|
+
// server output by \`compileAngular\`'s providers-injection step
|
|
15003
|
+
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
15004
|
+
// so the page module always exports its own ready-to-use \`providers\`
|
|
15005
|
+
// array. Same module, same \`@angular/core\` instance on both server
|
|
15006
|
+
// and client bundle.
|
|
15007
|
+
var pageProvidersExport = Reflect.get(pageModule, 'providers');
|
|
15008
|
+
var pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
|
|
15211
15009
|
var absoluteHttpTransferCacheOptions = {
|
|
15212
15010
|
includePostRequests: false,
|
|
15213
15011
|
includeRequestsWithAuthHeaders: false,
|
|
@@ -15276,7 +15074,7 @@ var init_compileAngular = __esm(() => {
|
|
|
15276
15074
|
init_stylePreprocessor();
|
|
15277
15075
|
init_generatedDir();
|
|
15278
15076
|
devClientDir4 = resolveDevClientDir4();
|
|
15279
|
-
hmrClientPath5 =
|
|
15077
|
+
hmrClientPath5 = join27(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
15280
15078
|
jitContentCache = new Map;
|
|
15281
15079
|
wrapperOutputCache = new Map;
|
|
15282
15080
|
});
|
|
@@ -16000,7 +15798,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16000
15798
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16001
15799
|
});
|
|
16002
15800
|
import { existsSync as existsSync23, readFileSync as readFileSync17, statSync as statSync2 } from "fs";
|
|
16003
|
-
import { dirname as
|
|
15801
|
+
import { dirname as dirname16, extname as extname6, relative as relative12, resolve as resolve23 } from "path";
|
|
16004
15802
|
import ts13 from "typescript";
|
|
16005
15803
|
var fail = (reason, detail, location) => ({
|
|
16006
15804
|
ok: false,
|
|
@@ -16111,7 +15909,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16111
15909
|
})();
|
|
16112
15910
|
if (!decoratorName)
|
|
16113
15911
|
continue;
|
|
16114
|
-
const projectRel =
|
|
15912
|
+
const projectRel = relative12(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16115
15913
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16116
15914
|
if (decoratorName === "Component") {
|
|
16117
15915
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16128,7 +15926,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16128
15926
|
continue;
|
|
16129
15927
|
const decoratorMeta = readDecoratorMeta(args);
|
|
16130
15928
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
16131
|
-
const componentDir =
|
|
15929
|
+
const componentDir = dirname16(componentFilePath);
|
|
16132
15930
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
16133
15931
|
fingerprintCache.set(id, fingerprint);
|
|
16134
15932
|
} else {
|
|
@@ -17088,7 +16886,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17088
16886
|
});
|
|
17089
16887
|
if (!names.includes(className))
|
|
17090
16888
|
continue;
|
|
17091
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16889
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname16(startDtsPath));
|
|
17092
16890
|
if (!nextDts)
|
|
17093
16891
|
continue;
|
|
17094
16892
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -17098,7 +16896,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17098
16896
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
17099
16897
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
17100
16898
|
const fromPath = m[1] || "";
|
|
17101
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
16899
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname16(startDtsPath));
|
|
17102
16900
|
if (!nextDts)
|
|
17103
16901
|
continue;
|
|
17104
16902
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -17676,7 +17474,7 @@ ${block}
|
|
|
17676
17474
|
}
|
|
17677
17475
|
const kind = params.kind ?? "component";
|
|
17678
17476
|
if (kind !== "component") {
|
|
17679
|
-
const entityId = encodeURIComponent(`${
|
|
17477
|
+
const entityId = encodeURIComponent(`${relative12(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
17680
17478
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
17681
17479
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
17682
17480
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -17695,7 +17493,7 @@ ${block}
|
|
|
17695
17493
|
rebootstrapRequired: false
|
|
17696
17494
|
};
|
|
17697
17495
|
}
|
|
17698
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
17496
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname16(componentFilePath), projectRoot)) {
|
|
17699
17497
|
return fail("inherits-decorated-class");
|
|
17700
17498
|
}
|
|
17701
17499
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -17707,7 +17505,7 @@ ${block}
|
|
|
17707
17505
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
17708
17506
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
17709
17507
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
17710
|
-
const componentDir =
|
|
17508
|
+
const componentDir = dirname16(componentFilePath);
|
|
17711
17509
|
let templateText;
|
|
17712
17510
|
let templatePath;
|
|
17713
17511
|
if (decoratorMeta.template !== null) {
|
|
@@ -17760,7 +17558,7 @@ ${block}
|
|
|
17760
17558
|
return fail("class-not-found", "anonymous class");
|
|
17761
17559
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
17762
17560
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
17763
|
-
const projectRelPath =
|
|
17561
|
+
const projectRelPath = relative12(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
17764
17562
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
17765
17563
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
17766
17564
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18468,7 +18266,7 @@ __export(exports_compileEmber, {
|
|
|
18468
18266
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
18469
18267
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
18470
18268
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
18471
|
-
dirname: () =>
|
|
18269
|
+
dirname: () => dirname17,
|
|
18472
18270
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
18473
18271
|
compileEmberFile: () => compileEmberFile,
|
|
18474
18272
|
compileEmber: () => compileEmber,
|
|
@@ -18477,7 +18275,7 @@ __export(exports_compileEmber, {
|
|
|
18477
18275
|
});
|
|
18478
18276
|
import { existsSync as existsSync24 } from "fs";
|
|
18479
18277
|
import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
|
|
18480
|
-
import { basename as basename9, dirname as
|
|
18278
|
+
import { basename as basename9, dirname as dirname17, extname as extname7, join as join28, resolve as resolve24 } from "path";
|
|
18481
18279
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
|
|
18482
18280
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18483
18281
|
if (cachedPreprocessor)
|
|
@@ -18573,7 +18371,7 @@ export const importSync = (specifier) => {
|
|
|
18573
18371
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18574
18372
|
if (!originalImporter)
|
|
18575
18373
|
return;
|
|
18576
|
-
const candidateBase = resolve24(
|
|
18374
|
+
const candidateBase = resolve24(dirname17(originalImporter), args.path);
|
|
18577
18375
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18578
18376
|
for (const ext of extensionsToTry) {
|
|
18579
18377
|
const candidate = candidateBase + ext;
|
|
@@ -18596,7 +18394,7 @@ export const importSync = (specifier) => {
|
|
|
18596
18394
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
18597
18395
|
if (standalonePackages.has(args.path))
|
|
18598
18396
|
return;
|
|
18599
|
-
const internal =
|
|
18397
|
+
const internal = join28(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
18600
18398
|
if (existsSync24(internal))
|
|
18601
18399
|
return { path: internal };
|
|
18602
18400
|
return;
|
|
@@ -18644,16 +18442,16 @@ export default PageComponent;
|
|
|
18644
18442
|
}
|
|
18645
18443
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
18646
18444
|
const baseName = basename9(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
18647
|
-
const tmpDir =
|
|
18648
|
-
const serverDir =
|
|
18649
|
-
const clientDir =
|
|
18445
|
+
const tmpDir = join28(compiledRoot, "_tmp");
|
|
18446
|
+
const serverDir = join28(compiledRoot, "server");
|
|
18447
|
+
const clientDir = join28(compiledRoot, "client");
|
|
18650
18448
|
await Promise.all([
|
|
18651
18449
|
mkdir6(tmpDir, { recursive: true }),
|
|
18652
18450
|
mkdir6(serverDir, { recursive: true }),
|
|
18653
18451
|
mkdir6(clientDir, { recursive: true })
|
|
18654
18452
|
]);
|
|
18655
|
-
const tmpPagePath = resolve24(
|
|
18656
|
-
const tmpHarnessPath = resolve24(
|
|
18453
|
+
const tmpPagePath = resolve24(join28(tmpDir, `${baseName}.module.js`));
|
|
18454
|
+
const tmpHarnessPath = resolve24(join28(tmpDir, `${baseName}.harness.js`));
|
|
18657
18455
|
await Promise.all([
|
|
18658
18456
|
write4(tmpPagePath, transpiled),
|
|
18659
18457
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -18661,7 +18459,7 @@ export default PageComponent;
|
|
|
18661
18459
|
const stagedSourceMap = new Map([
|
|
18662
18460
|
[tmpPagePath, resolvedEntry]
|
|
18663
18461
|
]);
|
|
18664
|
-
const serverPath =
|
|
18462
|
+
const serverPath = join28(serverDir, `${baseName}.js`);
|
|
18665
18463
|
const buildResult = await bunBuild2({
|
|
18666
18464
|
entrypoints: [tmpHarnessPath],
|
|
18667
18465
|
format: "esm",
|
|
@@ -18678,7 +18476,7 @@ export default PageComponent;
|
|
|
18678
18476
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
18679
18477
|
}
|
|
18680
18478
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
18681
|
-
const clientPath =
|
|
18479
|
+
const clientPath = join28(clientDir, `${baseName}.js`);
|
|
18682
18480
|
await write4(clientPath, transpiled);
|
|
18683
18481
|
return { clientPath, serverPath };
|
|
18684
18482
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -18706,7 +18504,7 @@ export default PageComponent;
|
|
|
18706
18504
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
18707
18505
|
}
|
|
18708
18506
|
return transpiler5.transformSync(preprocessed);
|
|
18709
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
18507
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join28(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join28(getEmberCompiledRoot(emberDir), "client");
|
|
18710
18508
|
var init_compileEmber = __esm(() => {
|
|
18711
18509
|
init_generatedDir();
|
|
18712
18510
|
transpiler5 = new Transpiler4({
|
|
@@ -18727,8 +18525,8 @@ __export(exports_buildReactVendor, {
|
|
|
18727
18525
|
computeVendorPaths: () => computeVendorPaths,
|
|
18728
18526
|
buildReactVendor: () => buildReactVendor
|
|
18729
18527
|
});
|
|
18730
|
-
import { existsSync as existsSync25, mkdirSync as
|
|
18731
|
-
import { join as
|
|
18528
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync8 } from "fs";
|
|
18529
|
+
import { join as join29, resolve as resolve25 } from "path";
|
|
18732
18530
|
import { rm as rm5 } from "fs/promises";
|
|
18733
18531
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
18734
18532
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -18782,14 +18580,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
18782
18580
|
`)}
|
|
18783
18581
|
`;
|
|
18784
18582
|
}, buildReactVendor = async (buildDir) => {
|
|
18785
|
-
const vendorDir =
|
|
18786
|
-
|
|
18787
|
-
const tmpDir =
|
|
18788
|
-
|
|
18583
|
+
const vendorDir = join29(buildDir, "react", "vendor");
|
|
18584
|
+
mkdirSync8(vendorDir, { recursive: true });
|
|
18585
|
+
const tmpDir = join29(buildDir, "_vendor_tmp");
|
|
18586
|
+
mkdirSync8(tmpDir, { recursive: true });
|
|
18789
18587
|
const specifiers = resolveVendorSpecifiers();
|
|
18790
18588
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18791
18589
|
const safeName = toSafeFileName(specifier);
|
|
18792
|
-
const entryPath =
|
|
18590
|
+
const entryPath = join29(tmpDir, `${safeName}.ts`);
|
|
18793
18591
|
const source = await generateEntrySource(specifier);
|
|
18794
18592
|
await Bun.write(entryPath, source);
|
|
18795
18593
|
return entryPath;
|
|
@@ -18853,8 +18651,8 @@ __export(exports_buildAngularVendor, {
|
|
|
18853
18651
|
buildAngularVendor: () => buildAngularVendor,
|
|
18854
18652
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
18855
18653
|
});
|
|
18856
|
-
import { mkdirSync as
|
|
18857
|
-
import { join as
|
|
18654
|
+
import { mkdirSync as mkdirSync9 } from "fs";
|
|
18655
|
+
import { join as join30 } from "path";
|
|
18858
18656
|
import { rm as rm6 } from "fs/promises";
|
|
18859
18657
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
18860
18658
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
|
|
@@ -18951,14 +18749,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18951
18749
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
18952
18750
|
return Array.from(angular).filter(isResolvable2);
|
|
18953
18751
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
18954
|
-
const vendorDir =
|
|
18955
|
-
|
|
18956
|
-
const tmpDir =
|
|
18957
|
-
|
|
18752
|
+
const vendorDir = join30(buildDir, "angular", "vendor");
|
|
18753
|
+
mkdirSync9(vendorDir, { recursive: true });
|
|
18754
|
+
const tmpDir = join30(buildDir, "_angular_vendor_tmp");
|
|
18755
|
+
mkdirSync9(tmpDir, { recursive: true });
|
|
18958
18756
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18959
18757
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
18960
18758
|
const safeName = toSafeFileName2(specifier);
|
|
18961
|
-
const entryPath =
|
|
18759
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
18962
18760
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18963
18761
|
return entryPath;
|
|
18964
18762
|
}));
|
|
@@ -18989,10 +18787,10 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
18989
18787
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18990
18788
|
return computeAngularVendorPaths(specifiers);
|
|
18991
18789
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
18992
|
-
const vendorDir =
|
|
18993
|
-
|
|
18994
|
-
const tmpDir =
|
|
18995
|
-
|
|
18790
|
+
const vendorDir = join30(buildDir, "angular", "vendor", "server");
|
|
18791
|
+
mkdirSync9(vendorDir, { recursive: true });
|
|
18792
|
+
const tmpDir = join30(buildDir, "_angular_server_vendor_tmp");
|
|
18793
|
+
mkdirSync9(tmpDir, { recursive: true });
|
|
18996
18794
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
18997
18795
|
const allSpecs = new Set(browserSpecs);
|
|
18998
18796
|
for (const spec of SERVER_ONLY_ANGULAR_SPECIFIERS) {
|
|
@@ -19002,7 +18800,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19002
18800
|
const specifiers = Array.from(allSpecs);
|
|
19003
18801
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19004
18802
|
const safeName = toSafeFileName2(specifier);
|
|
19005
|
-
const entryPath =
|
|
18803
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
19006
18804
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19007
18805
|
return entryPath;
|
|
19008
18806
|
}));
|
|
@@ -19024,9 +18822,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19024
18822
|
return specifiers;
|
|
19025
18823
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
19026
18824
|
const paths = {};
|
|
19027
|
-
const vendorDir =
|
|
18825
|
+
const vendorDir = join30(buildDir, "angular", "vendor", "server");
|
|
19028
18826
|
for (const specifier of specifiers) {
|
|
19029
|
-
paths[specifier] =
|
|
18827
|
+
paths[specifier] = join30(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
19030
18828
|
}
|
|
19031
18829
|
return paths;
|
|
19032
18830
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -19081,18 +18879,18 @@ __export(exports_buildVueVendor, {
|
|
|
19081
18879
|
computeVueVendorPaths: () => computeVueVendorPaths,
|
|
19082
18880
|
buildVueVendor: () => buildVueVendor
|
|
19083
18881
|
});
|
|
19084
|
-
import { mkdirSync as
|
|
19085
|
-
import { join as
|
|
18882
|
+
import { mkdirSync as mkdirSync10 } from "fs";
|
|
18883
|
+
import { join as join31 } from "path";
|
|
19086
18884
|
import { rm as rm7 } from "fs/promises";
|
|
19087
18885
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
19088
18886
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
19089
|
-
const vendorDir =
|
|
19090
|
-
|
|
19091
|
-
const tmpDir =
|
|
19092
|
-
|
|
18887
|
+
const vendorDir = join31(buildDir, "vue", "vendor");
|
|
18888
|
+
mkdirSync10(vendorDir, { recursive: true });
|
|
18889
|
+
const tmpDir = join31(buildDir, "_vue_vendor_tmp");
|
|
18890
|
+
mkdirSync10(tmpDir, { recursive: true });
|
|
19093
18891
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
19094
18892
|
const safeName = toSafeFileName3(specifier);
|
|
19095
|
-
const entryPath =
|
|
18893
|
+
const entryPath = join31(tmpDir, `${safeName}.ts`);
|
|
19096
18894
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
19097
18895
|
`);
|
|
19098
18896
|
return entryPath;
|
|
@@ -19117,17 +18915,17 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
19117
18915
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
19118
18916
|
return;
|
|
19119
18917
|
}
|
|
19120
|
-
const { readFileSync: readFileSync18, writeFileSync:
|
|
18918
|
+
const { readFileSync: readFileSync18, writeFileSync: writeFileSync8, readdirSync: readdirSync4 } = await import("fs");
|
|
19121
18919
|
const files = readdirSync4(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
19122
18920
|
for (const file4 of files) {
|
|
19123
|
-
const filePath =
|
|
18921
|
+
const filePath = join31(vendorDir, file4);
|
|
19124
18922
|
const content = readFileSync18(filePath, "utf-8");
|
|
19125
18923
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
19126
18924
|
continue;
|
|
19127
18925
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
19128
18926
|
if (patched === content)
|
|
19129
18927
|
continue;
|
|
19130
|
-
|
|
18928
|
+
writeFileSync8(filePath, patched);
|
|
19131
18929
|
}
|
|
19132
18930
|
}, computeVueVendorPaths = () => {
|
|
19133
18931
|
const paths = {};
|
|
@@ -19146,8 +18944,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
19146
18944
|
computeSvelteVendorPaths: () => computeSvelteVendorPaths,
|
|
19147
18945
|
buildSvelteVendor: () => buildSvelteVendor
|
|
19148
18946
|
});
|
|
19149
|
-
import { mkdirSync as
|
|
19150
|
-
import { join as
|
|
18947
|
+
import { mkdirSync as mkdirSync11 } from "fs";
|
|
18948
|
+
import { join as join32 } from "path";
|
|
19151
18949
|
import { rm as rm8 } from "fs/promises";
|
|
19152
18950
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
19153
18951
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -19161,13 +18959,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
19161
18959
|
const specifiers = resolveVendorSpecifiers2();
|
|
19162
18960
|
if (specifiers.length === 0)
|
|
19163
18961
|
return;
|
|
19164
|
-
const vendorDir =
|
|
19165
|
-
|
|
19166
|
-
const tmpDir =
|
|
19167
|
-
|
|
18962
|
+
const vendorDir = join32(buildDir, "svelte", "vendor");
|
|
18963
|
+
mkdirSync11(vendorDir, { recursive: true });
|
|
18964
|
+
const tmpDir = join32(buildDir, "_svelte_vendor_tmp");
|
|
18965
|
+
mkdirSync11(tmpDir, { recursive: true });
|
|
19168
18966
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19169
18967
|
const safeName = toSafeFileName4(specifier);
|
|
19170
|
-
const entryPath =
|
|
18968
|
+
const entryPath = join32(tmpDir, `${safeName}.ts`);
|
|
19171
18969
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
19172
18970
|
`);
|
|
19173
18971
|
return entryPath;
|
|
@@ -19217,7 +19015,7 @@ __export(exports_rewriteImportsPlugin, {
|
|
|
19217
19015
|
buildWithImportRewrite: () => buildWithImportRewrite
|
|
19218
19016
|
});
|
|
19219
19017
|
import { readdir as readdir3 } from "fs/promises";
|
|
19220
|
-
import { join as
|
|
19018
|
+
import { join as join33 } from "path";
|
|
19221
19019
|
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
19222
19020
|
let result = content;
|
|
19223
19021
|
for (const [specifier, webPath] of replacements) {
|
|
@@ -19346,7 +19144,7 @@ ${content}`;
|
|
|
19346
19144
|
const entries = await readdir3(dir);
|
|
19347
19145
|
for (const entry of entries) {
|
|
19348
19146
|
if (entry.endsWith(".js"))
|
|
19349
|
-
allFiles.push(
|
|
19147
|
+
allFiles.push(join33(dir, entry));
|
|
19350
19148
|
}
|
|
19351
19149
|
} catch {}
|
|
19352
19150
|
}
|
|
@@ -19389,13 +19187,13 @@ import {
|
|
|
19389
19187
|
copyFileSync as copyFileSync2,
|
|
19390
19188
|
cpSync,
|
|
19391
19189
|
existsSync as existsSync26,
|
|
19392
|
-
mkdirSync as
|
|
19190
|
+
mkdirSync as mkdirSync12,
|
|
19393
19191
|
readFileSync as readFileSync18,
|
|
19394
19192
|
rmSync as rmSync2,
|
|
19395
19193
|
statSync as statSync3,
|
|
19396
|
-
writeFileSync as
|
|
19194
|
+
writeFileSync as writeFileSync8
|
|
19397
19195
|
} from "fs";
|
|
19398
|
-
import { basename as basename10, dirname as
|
|
19196
|
+
import { basename as basename10, dirname as dirname18, extname as extname8, join as join34, relative as relative13, resolve as resolve26 } from "path";
|
|
19399
19197
|
import { cwd, env as env2, exit } from "process";
|
|
19400
19198
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
19401
19199
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -19470,11 +19268,11 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19470
19268
|
throw err;
|
|
19471
19269
|
exit(1);
|
|
19472
19270
|
}, copyHtmxVendor = (htmxDir, htmxDestDir) => {
|
|
19473
|
-
|
|
19271
|
+
mkdirSync12(htmxDestDir, { recursive: true });
|
|
19474
19272
|
const glob = new Glob8("htmx*.min.js");
|
|
19475
19273
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
19476
|
-
const src =
|
|
19477
|
-
const dest =
|
|
19274
|
+
const src = join34(htmxDir, relPath);
|
|
19275
|
+
const dest = join34(htmxDestDir, "htmx.min.js");
|
|
19478
19276
|
copyFileSync2(src, dest);
|
|
19479
19277
|
return;
|
|
19480
19278
|
}
|
|
@@ -19549,8 +19347,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19549
19347
|
vuePagesPath
|
|
19550
19348
|
}) => {
|
|
19551
19349
|
const { readdirSync: readDir } = await import("fs");
|
|
19552
|
-
const devIndexDir =
|
|
19553
|
-
|
|
19350
|
+
const devIndexDir = join34(buildPath, "_src_indexes");
|
|
19351
|
+
mkdirSync12(devIndexDir, { recursive: true });
|
|
19554
19352
|
if (reactIndexesPath && reactPagesPath) {
|
|
19555
19353
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
19556
19354
|
}
|
|
@@ -19565,37 +19363,37 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19565
19363
|
return;
|
|
19566
19364
|
}
|
|
19567
19365
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
19568
|
-
const pagesRel =
|
|
19366
|
+
const pagesRel = relative13(process.cwd(), resolve26(reactPagesPath)).replace(/\\/g, "/");
|
|
19569
19367
|
for (const file4 of indexFiles) {
|
|
19570
|
-
let content = readFileSync18(
|
|
19368
|
+
let content = readFileSync18(join34(reactIndexesPath, file4), "utf-8");
|
|
19571
19369
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
19572
|
-
|
|
19370
|
+
writeFileSync8(join34(devIndexDir, file4), content);
|
|
19573
19371
|
}
|
|
19574
19372
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19575
|
-
const svelteIndexDir =
|
|
19373
|
+
const svelteIndexDir = join34(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19576
19374
|
const sveltePageEntries = svelteEntries.filter((file4) => resolve26(file4).startsWith(resolve26(sveltePagesPath)));
|
|
19577
19375
|
for (const entry of sveltePageEntries) {
|
|
19578
19376
|
const name = basename10(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19579
|
-
const indexFile =
|
|
19377
|
+
const indexFile = join34(svelteIndexDir, "pages", `${name}.js`);
|
|
19580
19378
|
if (!existsSync26(indexFile))
|
|
19581
19379
|
continue;
|
|
19582
19380
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19583
|
-
const srcRel =
|
|
19381
|
+
const srcRel = relative13(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
19584
19382
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19585
|
-
|
|
19383
|
+
writeFileSync8(join34(devIndexDir, `${name}.svelte.js`), content);
|
|
19586
19384
|
}
|
|
19587
19385
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19588
|
-
const vueIndexDir =
|
|
19386
|
+
const vueIndexDir = join34(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19589
19387
|
const vuePageEntries = vueEntries.filter((file4) => resolve26(file4).startsWith(resolve26(vuePagesPath)));
|
|
19590
19388
|
for (const entry of vuePageEntries) {
|
|
19591
19389
|
const name = basename10(entry, ".vue");
|
|
19592
|
-
const indexFile =
|
|
19390
|
+
const indexFile = join34(vueIndexDir, `${name}.js`);
|
|
19593
19391
|
if (!existsSync26(indexFile))
|
|
19594
19392
|
continue;
|
|
19595
19393
|
let content = readFileSync18(indexFile, "utf-8");
|
|
19596
|
-
const srcRel =
|
|
19394
|
+
const srcRel = relative13(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
|
|
19597
19395
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19598
|
-
|
|
19396
|
+
writeFileSync8(join34(devIndexDir, `${name}.vue.js`), content);
|
|
19599
19397
|
}
|
|
19600
19398
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
19601
19399
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -19664,11 +19462,11 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
19664
19462
|
content = `${content.slice(0, firstUseIdx) + runtime}
|
|
19665
19463
|
${content.slice(firstUseIdx)}`;
|
|
19666
19464
|
content = wrapUseFunctions(content, useNames);
|
|
19667
|
-
|
|
19465
|
+
writeFileSync8(outputPath, content);
|
|
19668
19466
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
19669
19467
|
const urlFileMap = new Map;
|
|
19670
19468
|
for (const srcPath of urlReferencedFiles) {
|
|
19671
|
-
const rel =
|
|
19469
|
+
const rel = relative13(projectRoot, srcPath).replace(/\\/g, "/");
|
|
19672
19470
|
const name = basename10(srcPath);
|
|
19673
19471
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
19674
19472
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -19683,7 +19481,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19683
19481
|
const output = nonReactClientOutputs.find((artifact) => basename10(artifact.path).startsWith(`${srcBase}.`));
|
|
19684
19482
|
if (!output)
|
|
19685
19483
|
continue;
|
|
19686
|
-
urlFileMap.set(basename10(srcPath), `/${
|
|
19484
|
+
urlFileMap.set(basename10(srcPath), `/${relative13(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
19687
19485
|
}
|
|
19688
19486
|
return urlFileMap;
|
|
19689
19487
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -19704,7 +19502,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19704
19502
|
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
19705
19503
|
});
|
|
19706
19504
|
if (changed)
|
|
19707
|
-
|
|
19505
|
+
writeFileSync8(outputPath, content);
|
|
19708
19506
|
}
|
|
19709
19507
|
}, vueFeatureFlags, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, passLockedKeys, isObject = (value) => typeof value === "object" && value !== null, isBunBuildPassConfig = (config) => isObject(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override, extraReservedKeys = new Set) => {
|
|
19710
19508
|
if (!override)
|
|
@@ -19818,10 +19616,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19818
19616
|
restoreTracePhase();
|
|
19819
19617
|
return;
|
|
19820
19618
|
}
|
|
19821
|
-
const traceDir =
|
|
19619
|
+
const traceDir = join34(buildPath2, ".absolute-trace");
|
|
19822
19620
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
19823
|
-
|
|
19824
|
-
|
|
19621
|
+
mkdirSync12(traceDir, { recursive: true });
|
|
19622
|
+
writeFileSync8(join34(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
19825
19623
|
events: traceEvents,
|
|
19826
19624
|
frameworks: traceFrameworkNames,
|
|
19827
19625
|
generatedAt: new Date().toISOString(),
|
|
@@ -19852,15 +19650,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19852
19650
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
19853
19651
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
19854
19652
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
19855
|
-
const reactIndexesPath = reactDir &&
|
|
19856
|
-
const reactPagesPath = reactDir &&
|
|
19857
|
-
const htmlPagesPath = htmlDir &&
|
|
19858
|
-
const htmlScriptsPath = htmlDir &&
|
|
19859
|
-
const sveltePagesPath = svelteDir &&
|
|
19860
|
-
const vuePagesPath = vueDir &&
|
|
19861
|
-
const htmxPagesPath = htmxDir &&
|
|
19862
|
-
const angularPagesPath = angularDir &&
|
|
19863
|
-
const emberPagesPath = emberDir &&
|
|
19653
|
+
const reactIndexesPath = reactDir && join34(getFrameworkGeneratedDir("react"), "indexes");
|
|
19654
|
+
const reactPagesPath = reactDir && join34(reactDir, "pages");
|
|
19655
|
+
const htmlPagesPath = htmlDir && join34(htmlDir, "pages");
|
|
19656
|
+
const htmlScriptsPath = htmlDir && join34(htmlDir, "scripts");
|
|
19657
|
+
const sveltePagesPath = svelteDir && join34(svelteDir, "pages");
|
|
19658
|
+
const vuePagesPath = vueDir && join34(vueDir, "pages");
|
|
19659
|
+
const htmxPagesPath = htmxDir && join34(htmxDir, "pages");
|
|
19660
|
+
const angularPagesPath = angularDir && join34(angularDir, "pages");
|
|
19661
|
+
const emberPagesPath = emberDir && join34(emberDir, "pages");
|
|
19864
19662
|
const frontends = [
|
|
19865
19663
|
reactDir,
|
|
19866
19664
|
htmlDir,
|
|
@@ -19891,7 +19689,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19891
19689
|
const sourceClientRoots = [
|
|
19892
19690
|
htmlDir,
|
|
19893
19691
|
htmxDir,
|
|
19894
|
-
islandBootstrapPath &&
|
|
19692
|
+
islandBootstrapPath && dirname18(islandBootstrapPath)
|
|
19895
19693
|
].filter((dir) => Boolean(dir));
|
|
19896
19694
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
19897
19695
|
if (usesGenerated)
|
|
@@ -19919,14 +19717,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19919
19717
|
const [firstEntry] = serverDirMap;
|
|
19920
19718
|
if (!firstEntry)
|
|
19921
19719
|
throw new Error("Expected at least one server directory entry");
|
|
19922
|
-
serverRoot =
|
|
19923
|
-
serverOutDir =
|
|
19720
|
+
serverRoot = join34(firstEntry.dir, firstEntry.subdir);
|
|
19721
|
+
serverOutDir = join34(buildPath, basename10(firstEntry.dir));
|
|
19924
19722
|
} else if (serverDirMap.length > 1) {
|
|
19925
19723
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
19926
19724
|
serverOutDir = buildPath;
|
|
19927
19725
|
}
|
|
19928
19726
|
const publicPath = publicDirectory && validateSafePath(publicDirectory, projectRoot);
|
|
19929
|
-
await tracePhase("build-dir/create", () =>
|
|
19727
|
+
await tracePhase("build-dir/create", () => mkdirSync12(buildPath, { recursive: true }));
|
|
19930
19728
|
if (publicPath)
|
|
19931
19729
|
await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
|
|
19932
19730
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
@@ -19948,7 +19746,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
19948
19746
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
19949
19747
|
}
|
|
19950
19748
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
19951
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
19749
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join34(buildPath, "assets"), {
|
|
19952
19750
|
force: true,
|
|
19953
19751
|
recursive: true
|
|
19954
19752
|
}));
|
|
@@ -20058,11 +19856,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20058
19856
|
}
|
|
20059
19857
|
}
|
|
20060
19858
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
20061
|
-
const htmlConventionsOutDir =
|
|
20062
|
-
|
|
19859
|
+
const htmlConventionsOutDir = join34(buildPath, "conventions", "html");
|
|
19860
|
+
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
20063
19861
|
const htmlPathRemap = new Map;
|
|
20064
19862
|
for (const sourcePath of htmlConventionSources) {
|
|
20065
|
-
const dest =
|
|
19863
|
+
const dest = join34(htmlConventionsOutDir, basename10(sourcePath));
|
|
20066
19864
|
cpSync(sourcePath, dest, { force: true });
|
|
20067
19865
|
htmlPathRemap.set(sourcePath, dest);
|
|
20068
19866
|
}
|
|
@@ -20105,7 +19903,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20105
19903
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20106
19904
|
if (entry.startsWith(resolve26(reactIndexesPath))) {
|
|
20107
19905
|
const pageName = basename10(entry, ".tsx");
|
|
20108
|
-
return
|
|
19906
|
+
return join34(reactPagesPath, `${pageName}.tsx`);
|
|
20109
19907
|
}
|
|
20110
19908
|
return null;
|
|
20111
19909
|
}) : allReactEntries;
|
|
@@ -20208,14 +20006,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20208
20006
|
try {
|
|
20209
20007
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
20210
20008
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
20211
|
-
const { join:
|
|
20009
|
+
const { join: join35 } = await import("path");
|
|
20212
20010
|
const walk = async (dir) => {
|
|
20213
20011
|
const entries = await readdir4(dir, {
|
|
20214
20012
|
withFileTypes: true
|
|
20215
20013
|
});
|
|
20216
20014
|
const out = [];
|
|
20217
20015
|
for (const entry of entries) {
|
|
20218
|
-
const full =
|
|
20016
|
+
const full = join35(dir, entry.name);
|
|
20219
20017
|
if (entry.isDirectory()) {
|
|
20220
20018
|
out.push(...await walk(full));
|
|
20221
20019
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -20280,9 +20078,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20280
20078
|
const compileReactConventions = async () => {
|
|
20281
20079
|
if (reactConventionSources.length === 0)
|
|
20282
20080
|
return emptyStringArray;
|
|
20283
|
-
const destDir =
|
|
20081
|
+
const destDir = join34(buildPath, "conventions", "react");
|
|
20284
20082
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20285
|
-
|
|
20083
|
+
mkdirSync12(destDir, { recursive: true });
|
|
20286
20084
|
const destPaths = [];
|
|
20287
20085
|
for (let idx = 0;idx < reactConventionSources.length; idx++) {
|
|
20288
20086
|
const source = reactConventionSources[idx];
|
|
@@ -20296,7 +20094,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20296
20094
|
naming: `${idx}-[name].[ext]`,
|
|
20297
20095
|
outdir: destDir,
|
|
20298
20096
|
plugins: [stylePreprocessorPlugin2],
|
|
20299
|
-
root:
|
|
20097
|
+
root: dirname18(source),
|
|
20300
20098
|
target: "bun",
|
|
20301
20099
|
throw: false,
|
|
20302
20100
|
tsconfig: "./tsconfig.json"
|
|
@@ -20324,9 +20122,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20324
20122
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
20325
20123
|
]);
|
|
20326
20124
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
20327
|
-
const destDir =
|
|
20125
|
+
const destDir = join34(buildPath, "conventions", framework);
|
|
20328
20126
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20329
|
-
|
|
20127
|
+
mkdirSync12(destDir, { recursive: true });
|
|
20330
20128
|
const destPaths = [];
|
|
20331
20129
|
for (let idx = 0;idx < compiledPaths.length; idx++) {
|
|
20332
20130
|
const compiledPath = compiledPaths[idx];
|
|
@@ -20398,7 +20196,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20398
20196
|
}
|
|
20399
20197
|
})) : {
|
|
20400
20198
|
entries: [],
|
|
20401
|
-
generatedRoot:
|
|
20199
|
+
generatedRoot: join34(buildPath, "_island_entries")
|
|
20402
20200
|
};
|
|
20403
20201
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
20404
20202
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -20434,7 +20232,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20434
20232
|
return {};
|
|
20435
20233
|
}
|
|
20436
20234
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
20437
|
-
const refreshEntry =
|
|
20235
|
+
const refreshEntry = join34(reactIndexesPath, "_refresh.tsx");
|
|
20438
20236
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
20439
20237
|
reactClientEntryPoints.push(refreshEntry);
|
|
20440
20238
|
}
|
|
@@ -20536,19 +20334,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20536
20334
|
throw: false
|
|
20537
20335
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
20538
20336
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
20539
|
-
rmSync2(
|
|
20337
|
+
rmSync2(join34(buildPath, "react", "generated", "indexes"), {
|
|
20540
20338
|
force: true,
|
|
20541
20339
|
recursive: true
|
|
20542
20340
|
});
|
|
20543
20341
|
}
|
|
20544
20342
|
if (angularDir && angularClientPaths.length > 0) {
|
|
20545
|
-
rmSync2(
|
|
20343
|
+
rmSync2(join34(buildPath, "angular", "indexes"), {
|
|
20546
20344
|
force: true,
|
|
20547
20345
|
recursive: true
|
|
20548
20346
|
});
|
|
20549
20347
|
}
|
|
20550
20348
|
if (islandClientEntryPoints.length > 0) {
|
|
20551
|
-
rmSync2(
|
|
20349
|
+
rmSync2(join34(buildPath, "islands"), {
|
|
20552
20350
|
force: true,
|
|
20553
20351
|
recursive: true
|
|
20554
20352
|
});
|
|
@@ -20637,7 +20435,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20637
20435
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20638
20436
|
entrypoints: globalCssEntries,
|
|
20639
20437
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
20640
|
-
outdir: stylesDir ?
|
|
20438
|
+
outdir: stylesDir ? join34(buildPath, basename10(stylesDir)) : buildPath,
|
|
20641
20439
|
plugins: [stylePreprocessorPlugin2],
|
|
20642
20440
|
root: stylesDir || clientRoot,
|
|
20643
20441
|
target: "browser",
|
|
@@ -20646,7 +20444,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20646
20444
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
20647
20445
|
entrypoints: vueCssPaths,
|
|
20648
20446
|
naming: `[name].[hash].[ext]`,
|
|
20649
|
-
outdir:
|
|
20447
|
+
outdir: join34(buildPath, assetsPath ? basename10(assetsPath) : "assets", "css"),
|
|
20650
20448
|
target: "browser",
|
|
20651
20449
|
throw: false
|
|
20652
20450
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -20720,10 +20518,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20720
20518
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
20721
20519
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
20722
20520
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
20723
|
-
const fileDir =
|
|
20521
|
+
const fileDir = dirname18(artifact.path);
|
|
20724
20522
|
const relativePaths = {};
|
|
20725
20523
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
20726
|
-
const rel =
|
|
20524
|
+
const rel = relative13(fileDir, absolute);
|
|
20727
20525
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
20728
20526
|
}
|
|
20729
20527
|
return relativePaths;
|
|
@@ -20792,7 +20590,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20792
20590
|
if (skipAngularClientBundle) {
|
|
20793
20591
|
for (const clientPath of angularClientPaths) {
|
|
20794
20592
|
const fileBase = basename10(clientPath, ".js");
|
|
20795
|
-
const relFromCwd =
|
|
20593
|
+
const relFromCwd = relative13(projectRoot, clientPath).replace(/\\/g, "/");
|
|
20796
20594
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
20797
20595
|
}
|
|
20798
20596
|
}
|
|
@@ -20812,13 +20610,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20812
20610
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
20813
20611
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
20814
20612
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
20815
|
-
|
|
20613
|
+
writeFileSync8(filePath, html);
|
|
20816
20614
|
};
|
|
20817
20615
|
const processHtmlPages = async () => {
|
|
20818
20616
|
if (!(htmlDir && htmlPagesPath))
|
|
20819
20617
|
return;
|
|
20820
|
-
const outputHtmlPages = isSingle ?
|
|
20821
|
-
|
|
20618
|
+
const outputHtmlPages = isSingle ? join34(buildPath, "pages") : join34(buildPath, basename10(htmlDir), "pages");
|
|
20619
|
+
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
20822
20620
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
20823
20621
|
force: true,
|
|
20824
20622
|
recursive: true
|
|
@@ -20842,14 +20640,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20842
20640
|
const processHtmxPages = async () => {
|
|
20843
20641
|
if (!(htmxDir && htmxPagesPath))
|
|
20844
20642
|
return;
|
|
20845
|
-
const outputHtmxPages = isSingle ?
|
|
20846
|
-
|
|
20643
|
+
const outputHtmxPages = isSingle ? join34(buildPath, "pages") : join34(buildPath, basename10(htmxDir), "pages");
|
|
20644
|
+
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
20847
20645
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
20848
20646
|
force: true,
|
|
20849
20647
|
recursive: true
|
|
20850
20648
|
});
|
|
20851
20649
|
if (shouldCopyHtmx) {
|
|
20852
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
20650
|
+
const htmxDestDir = isSingle ? buildPath : join34(buildPath, basename10(htmxDir));
|
|
20853
20651
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
20854
20652
|
}
|
|
20855
20653
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -20914,9 +20712,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20914
20712
|
writeBuildTrace(buildPath);
|
|
20915
20713
|
return { conventions: conventionsMap, manifest };
|
|
20916
20714
|
}
|
|
20917
|
-
|
|
20715
|
+
writeFileSync8(join34(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
20918
20716
|
if (Object.keys(conventionsMap).length > 0) {
|
|
20919
|
-
|
|
20717
|
+
writeFileSync8(join34(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
20920
20718
|
}
|
|
20921
20719
|
writeBuildTrace(buildPath);
|
|
20922
20720
|
if (mode === "production") {
|
|
@@ -21037,8 +20835,8 @@ var init_build = __esm(() => {
|
|
|
21037
20835
|
});
|
|
21038
20836
|
|
|
21039
20837
|
// src/build/buildEmberVendor.ts
|
|
21040
|
-
import { mkdirSync as
|
|
21041
|
-
import { join as
|
|
20838
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync27 } from "fs";
|
|
20839
|
+
import { join as join35 } from "path";
|
|
21042
20840
|
import { rm as rm9 } from "fs/promises";
|
|
21043
20841
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
21044
20842
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -21090,7 +20888,7 @@ export const importSync = (specifier) => {
|
|
|
21090
20888
|
if (standaloneSpecifiers.has(specifier)) {
|
|
21091
20889
|
return { resolveTo: specifier, specifier };
|
|
21092
20890
|
}
|
|
21093
|
-
const emberInternalPath =
|
|
20891
|
+
const emberInternalPath = join35(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
21094
20892
|
if (!existsSync27(emberInternalPath)) {
|
|
21095
20893
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
21096
20894
|
}
|
|
@@ -21122,7 +20920,7 @@ export const importSync = (specifier) => {
|
|
|
21122
20920
|
if (standalonePackages.has(args.path)) {
|
|
21123
20921
|
return;
|
|
21124
20922
|
}
|
|
21125
|
-
const internal =
|
|
20923
|
+
const internal = join35(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21126
20924
|
if (existsSync27(internal)) {
|
|
21127
20925
|
return { path: internal };
|
|
21128
20926
|
}
|
|
@@ -21130,16 +20928,16 @@ export const importSync = (specifier) => {
|
|
|
21130
20928
|
});
|
|
21131
20929
|
}
|
|
21132
20930
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
21133
|
-
const vendorDir =
|
|
21134
|
-
|
|
21135
|
-
const tmpDir =
|
|
21136
|
-
|
|
21137
|
-
const macrosShimPath =
|
|
20931
|
+
const vendorDir = join35(buildDir, "ember", "vendor");
|
|
20932
|
+
mkdirSync13(vendorDir, { recursive: true });
|
|
20933
|
+
const tmpDir = join35(buildDir, "_ember_vendor_tmp");
|
|
20934
|
+
mkdirSync13(tmpDir, { recursive: true });
|
|
20935
|
+
const macrosShimPath = join35(tmpDir, "embroider_macros_shim.js");
|
|
21138
20936
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
21139
20937
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
21140
20938
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
21141
20939
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
21142
|
-
const entryPath =
|
|
20940
|
+
const entryPath = join35(tmpDir, `${safeName}.js`);
|
|
21143
20941
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
21144
20942
|
` : generateVendorEntrySource2(resolution);
|
|
21145
20943
|
await Bun.write(entryPath, source);
|
|
@@ -21515,7 +21313,7 @@ var init_clientManager = __esm(() => {
|
|
|
21515
21313
|
|
|
21516
21314
|
// src/dev/pathUtils.ts
|
|
21517
21315
|
import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync20 } from "fs";
|
|
21518
|
-
import { dirname as
|
|
21316
|
+
import { dirname as dirname19, resolve as resolve29 } from "path";
|
|
21519
21317
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
21520
21318
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
21521
21319
|
return "ignored";
|
|
@@ -21643,10 +21441,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
21643
21441
|
refs.push(strMatch[1]);
|
|
21644
21442
|
}
|
|
21645
21443
|
}
|
|
21646
|
-
const componentDir =
|
|
21444
|
+
const componentDir = dirname19(full);
|
|
21647
21445
|
for (const ref of refs) {
|
|
21648
21446
|
const refAbs = normalizePath(resolve29(componentDir, ref));
|
|
21649
|
-
const refDir = normalizePath(
|
|
21447
|
+
const refDir = normalizePath(dirname19(refAbs));
|
|
21650
21448
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
21651
21449
|
continue;
|
|
21652
21450
|
}
|
|
@@ -21774,7 +21572,7 @@ var init_pathUtils = __esm(() => {
|
|
|
21774
21572
|
// src/dev/fileWatcher.ts
|
|
21775
21573
|
import { watch } from "fs";
|
|
21776
21574
|
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
21777
|
-
import { dirname as
|
|
21575
|
+
import { dirname as dirname20, join as join36, resolve as resolve30 } from "path";
|
|
21778
21576
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
21779
21577
|
try {
|
|
21780
21578
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -21807,7 +21605,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21807
21605
|
for (const name of entries) {
|
|
21808
21606
|
if (shouldSkipFilename(name, isStylesDir))
|
|
21809
21607
|
continue;
|
|
21810
|
-
const child =
|
|
21608
|
+
const child = join36(eventDir, name).replace(/\\/g, "/");
|
|
21811
21609
|
let st2;
|
|
21812
21610
|
try {
|
|
21813
21611
|
st2 = statSync4(child);
|
|
@@ -21832,12 +21630,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
21832
21630
|
return;
|
|
21833
21631
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
21834
21632
|
if (event === "rename") {
|
|
21835
|
-
const eventDir =
|
|
21633
|
+
const eventDir = dirname20(join36(absolutePath, filename)).replace(/\\/g, "/");
|
|
21836
21634
|
atomicRecoveryScan(eventDir);
|
|
21837
21635
|
}
|
|
21838
21636
|
return;
|
|
21839
21637
|
}
|
|
21840
|
-
const fullPath =
|
|
21638
|
+
const fullPath = join36(absolutePath, filename).replace(/\\/g, "/");
|
|
21841
21639
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
21842
21640
|
return;
|
|
21843
21641
|
}
|
|
@@ -21990,7 +21788,7 @@ var init_assetStore = __esm(() => {
|
|
|
21990
21788
|
|
|
21991
21789
|
// src/islands/pageMetadata.ts
|
|
21992
21790
|
import { readFileSync as readFileSync21 } from "fs";
|
|
21993
|
-
import { dirname as
|
|
21791
|
+
import { dirname as dirname21, resolve as resolve32 } from "path";
|
|
21994
21792
|
var pagePatterns, getPageDirs = (config) => [
|
|
21995
21793
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
21996
21794
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -22010,7 +21808,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
22010
21808
|
const source = definition.buildReference?.source;
|
|
22011
21809
|
if (!source)
|
|
22012
21810
|
continue;
|
|
22013
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve32(
|
|
21811
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve32(dirname21(buildInfo.resolvedRegistryPath), source);
|
|
22014
21812
|
lookup.set(`${definition.framework}:${definition.component}`, resolve32(resolvedSource));
|
|
22015
21813
|
}
|
|
22016
21814
|
return lookup;
|
|
@@ -22281,7 +22079,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22281
22079
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22282
22080
|
});
|
|
22283
22081
|
import { readdirSync as readdirSync6, readFileSync as readFileSync23, statSync as statSync5 } from "fs";
|
|
22284
|
-
import { dirname as
|
|
22082
|
+
import { dirname as dirname22, extname as extname9, join as join37, resolve as resolve35 } from "path";
|
|
22285
22083
|
import ts14 from "typescript";
|
|
22286
22084
|
var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22287
22085
|
const out = [];
|
|
@@ -22296,7 +22094,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22296
22094
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
22297
22095
|
continue;
|
|
22298
22096
|
}
|
|
22299
|
-
const full =
|
|
22097
|
+
const full = join37(dir, entry.name);
|
|
22300
22098
|
if (entry.isDirectory()) {
|
|
22301
22099
|
visit(full);
|
|
22302
22100
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -22435,7 +22233,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22435
22233
|
return null;
|
|
22436
22234
|
}
|
|
22437
22235
|
const sf = ts14.createSourceFile(childFilePath, source, ts14.ScriptTarget.ES2022, true, ts14.ScriptKind.TS);
|
|
22438
|
-
const childDir =
|
|
22236
|
+
const childDir = dirname22(childFilePath);
|
|
22439
22237
|
for (const stmt of sf.statements) {
|
|
22440
22238
|
if (!ts14.isImportDeclaration(stmt))
|
|
22441
22239
|
continue;
|
|
@@ -22492,7 +22290,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
22492
22290
|
const parentFile = new Map;
|
|
22493
22291
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
22494
22292
|
const classes = parseDecoratedClasses(tsPath);
|
|
22495
|
-
const componentDir =
|
|
22293
|
+
const componentDir = dirname22(tsPath);
|
|
22496
22294
|
for (const cls of classes) {
|
|
22497
22295
|
const entity = {
|
|
22498
22296
|
className: cls.className,
|
|
@@ -22798,7 +22596,7 @@ __export(exports_moduleServer, {
|
|
|
22798
22596
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
22799
22597
|
});
|
|
22800
22598
|
import { existsSync as existsSync31, readFileSync as readFileSync24, statSync as statSync6 } from "fs";
|
|
22801
|
-
import { basename as basename12, dirname as
|
|
22599
|
+
import { basename as basename12, dirname as dirname23, extname as extname10, join as join38, resolve as resolve37, relative as relative14 } from "path";
|
|
22802
22600
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
22803
22601
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
22804
22602
|
const allExports = [];
|
|
@@ -22846,11 +22644,11 @@ ${stubs}
|
|
|
22846
22644
|
}
|
|
22847
22645
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
22848
22646
|
const absPath = resolve37(fileDir, relPath);
|
|
22849
|
-
const rel =
|
|
22647
|
+
const rel = relative14(projectRoot, absPath);
|
|
22850
22648
|
const extension = extname10(rel);
|
|
22851
22649
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
22852
22650
|
if (extname10(srcPath) === ".svelte") {
|
|
22853
|
-
srcPath =
|
|
22651
|
+
srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve37(projectRoot, srcPath)));
|
|
22854
22652
|
}
|
|
22855
22653
|
return srcUrl(srcPath, projectRoot);
|
|
22856
22654
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -22862,7 +22660,7 @@ ${stubs}
|
|
|
22862
22660
|
"import"
|
|
22863
22661
|
]);
|
|
22864
22662
|
if (fromExports)
|
|
22865
|
-
return
|
|
22663
|
+
return relative14(projectRoot, fromExports);
|
|
22866
22664
|
try {
|
|
22867
22665
|
const isScoped = specifier.startsWith("@");
|
|
22868
22666
|
const parts = specifier.split("/");
|
|
@@ -22870,19 +22668,19 @@ ${stubs}
|
|
|
22870
22668
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
22871
22669
|
if (!subpath) {
|
|
22872
22670
|
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
22873
|
-
const pkgJsonPath =
|
|
22671
|
+
const pkgJsonPath = join38(pkgDir, "package.json");
|
|
22874
22672
|
if (existsSync31(pkgJsonPath)) {
|
|
22875
22673
|
const pkg = JSON.parse(readFileSync24(pkgJsonPath, "utf-8"));
|
|
22876
22674
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
22877
22675
|
if (esmEntry) {
|
|
22878
22676
|
const resolved = resolve37(pkgDir, esmEntry);
|
|
22879
22677
|
if (existsSync31(resolved))
|
|
22880
|
-
return
|
|
22678
|
+
return relative14(projectRoot, resolved);
|
|
22881
22679
|
}
|
|
22882
22680
|
}
|
|
22883
22681
|
}
|
|
22884
22682
|
} catch {}
|
|
22885
|
-
return
|
|
22683
|
+
return relative14(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
22886
22684
|
} catch {
|
|
22887
22685
|
return;
|
|
22888
22686
|
}
|
|
@@ -22907,28 +22705,28 @@ ${stubs}
|
|
|
22907
22705
|
};
|
|
22908
22706
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
22909
22707
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
22910
|
-
const fileDir =
|
|
22708
|
+
const fileDir = dirname23(filePath);
|
|
22911
22709
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22912
22710
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
22913
22711
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
22914
22712
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
22915
22713
|
if (absPath.startsWith(projectRoot)) {
|
|
22916
|
-
const rel2 =
|
|
22714
|
+
const rel2 = relative14(projectRoot, absPath).replace(/\\/g, "/");
|
|
22917
22715
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
22918
22716
|
}
|
|
22919
|
-
const rel =
|
|
22717
|
+
const rel = relative14(projectRoot, absPath).replace(/\\/g, "/");
|
|
22920
22718
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
22921
22719
|
};
|
|
22922
22720
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
22923
22721
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
22924
22722
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
22925
22723
|
const absPath = resolve37(fileDir, relPath);
|
|
22926
|
-
const rel =
|
|
22724
|
+
const rel = relative14(projectRoot, absPath);
|
|
22927
22725
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
22928
22726
|
});
|
|
22929
22727
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
22930
22728
|
const absPath = resolve37(fileDir, relPath);
|
|
22931
|
-
const rel =
|
|
22729
|
+
const rel = relative14(projectRoot, absPath);
|
|
22932
22730
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
22933
22731
|
});
|
|
22934
22732
|
return result;
|
|
@@ -22984,7 +22782,7 @@ ${code}`;
|
|
|
22984
22782
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
22985
22783
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
22986
22784
|
${transpiled}`;
|
|
22987
|
-
const relPath =
|
|
22785
|
+
const relPath = relative14(projectRoot, filePath).replace(/\\/g, "/");
|
|
22988
22786
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
22989
22787
|
transpiled += buildIslandMetadataExports(raw);
|
|
22990
22788
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23145,11 +22943,11 @@ ${code}`;
|
|
|
23145
22943
|
if (compiled.css?.code) {
|
|
23146
22944
|
const cssPath = `${filePath}.css`;
|
|
23147
22945
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23148
|
-
const cssUrl = srcUrl(
|
|
22946
|
+
const cssUrl = srcUrl(relative14(projectRoot, cssPath), projectRoot);
|
|
23149
22947
|
code = `import "${cssUrl}";
|
|
23150
22948
|
${code}`;
|
|
23151
22949
|
}
|
|
23152
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
22950
|
+
const moduleUrl = `${SRC_PREFIX}${relative14(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23153
22951
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23154
22952
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23155
22953
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23241,7 +23039,7 @@ ${code}`;
|
|
|
23241
23039
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23242
23040
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23243
23041
|
const hmrBase = vueDir ? resolve37(vueDir) : projectRoot;
|
|
23244
|
-
const hmrId =
|
|
23042
|
+
const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23245
23043
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23246
23044
|
result += [
|
|
23247
23045
|
"",
|
|
@@ -23703,7 +23501,7 @@ __export(exports_hmrCompiler, {
|
|
|
23703
23501
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
23704
23502
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
23705
23503
|
});
|
|
23706
|
-
import { dirname as
|
|
23504
|
+
import { dirname as dirname24, relative as relative15, resolve as resolve38 } from "path";
|
|
23707
23505
|
import { performance as performance2 } from "perf_hooks";
|
|
23708
23506
|
var getApplyMetadataModule = async (encodedId) => {
|
|
23709
23507
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -23713,7 +23511,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23713
23511
|
const filePathRel = decoded.slice(0, at2);
|
|
23714
23512
|
const className = decoded.slice(at2 + 1);
|
|
23715
23513
|
const componentFilePath = resolve38(process.cwd(), filePathRel);
|
|
23716
|
-
const projectRelPath =
|
|
23514
|
+
const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
23717
23515
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
23718
23516
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
23719
23517
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -23723,7 +23521,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23723
23521
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
23724
23522
|
const owners = resolveOwningComponents2({
|
|
23725
23523
|
changedFilePath: componentFilePath,
|
|
23726
|
-
userAngularRoot:
|
|
23524
|
+
userAngularRoot: dirname24(componentFilePath)
|
|
23727
23525
|
});
|
|
23728
23526
|
const owner = owners.find((o3) => o3.className === className);
|
|
23729
23527
|
const kind = owner?.kind ?? "component";
|
|
@@ -23735,7 +23533,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
23735
23533
|
}
|
|
23736
23534
|
return null;
|
|
23737
23535
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
23738
|
-
const projectRel =
|
|
23536
|
+
const projectRel = relative15(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
23739
23537
|
return `${projectRel}@${className}`;
|
|
23740
23538
|
};
|
|
23741
23539
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -23931,7 +23729,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
23931
23729
|
|
|
23932
23730
|
// src/dev/rebuildTrigger.ts
|
|
23933
23731
|
import { existsSync as existsSync32, rmSync as rmSync3 } from "fs";
|
|
23934
|
-
import { basename as basename13, dirname as
|
|
23732
|
+
import { basename as basename13, dirname as dirname25, join as join39, relative as relative16, resolve as resolve41, sep as sep4 } from "path";
|
|
23935
23733
|
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) => {
|
|
23936
23734
|
if (!config.tailwind)
|
|
23937
23735
|
return;
|
|
@@ -24048,8 +23846,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24048
23846
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
24049
23847
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
24050
23848
|
for (const candidate of [
|
|
24051
|
-
|
|
24052
|
-
`${
|
|
23849
|
+
join39(generatedDir, relJs),
|
|
23850
|
+
`${join39(generatedDir, relJs)}.map`
|
|
24053
23851
|
]) {
|
|
24054
23852
|
try {
|
|
24055
23853
|
rmSync3(candidate, { force: true });
|
|
@@ -24254,14 +24052,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24254
24052
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24255
24053
|
const destPath = resolve41(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24256
24054
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24257
|
-
const { dirname:
|
|
24258
|
-
await mkdir7(
|
|
24055
|
+
const { dirname: dirname26 } = await import("path");
|
|
24056
|
+
await mkdir7(dirname26(destPath), { recursive: true });
|
|
24259
24057
|
await copyFile(absSource, destPath);
|
|
24260
24058
|
const bytes = await readFile6(destPath);
|
|
24261
24059
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24262
24060
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24263
24061
|
state.fileHashes.set(absSource, currentHash);
|
|
24264
|
-
logHmrUpdate(
|
|
24062
|
+
logHmrUpdate(relative16(process.cwd(), filePath));
|
|
24265
24063
|
broadcastToClients(state, {
|
|
24266
24064
|
data: {
|
|
24267
24065
|
framework: urlPrefix || "public",
|
|
@@ -24279,7 +24077,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24279
24077
|
return;
|
|
24280
24078
|
if (framework === "unknown") {
|
|
24281
24079
|
invalidate(resolve41(filePath));
|
|
24282
|
-
const relPath =
|
|
24080
|
+
const relPath = relative16(process.cwd(), filePath);
|
|
24283
24081
|
logHmrUpdate(relPath);
|
|
24284
24082
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24285
24083
|
let hasAngularDependent = false;
|
|
@@ -24457,7 +24255,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24457
24255
|
const keepByDir = new Map;
|
|
24458
24256
|
const prefixByDir = new Map;
|
|
24459
24257
|
for (const artifact of freshOutputs) {
|
|
24460
|
-
const dir =
|
|
24258
|
+
const dir = dirname25(artifact.path);
|
|
24461
24259
|
const name = basename13(artifact.path);
|
|
24462
24260
|
const [prefix] = name.split(".");
|
|
24463
24261
|
if (!prefix)
|
|
@@ -24870,7 +24668,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24870
24668
|
try {
|
|
24871
24669
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24872
24670
|
for (const tsFile of tsFilesToRefresh) {
|
|
24873
|
-
const rel =
|
|
24671
|
+
const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
24874
24672
|
const compiledFile = resolve41(compiledRoot, rel);
|
|
24875
24673
|
invalidateModule2(compiledFile);
|
|
24876
24674
|
}
|
|
@@ -24882,17 +24680,40 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24882
24680
|
await diskRefreshPromise;
|
|
24883
24681
|
}, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
|
|
24884
24682
|
const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
24885
|
-
const {
|
|
24683
|
+
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
24684
|
+
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
24685
|
+
const projectRoot = process.cwd();
|
|
24686
|
+
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
24687
|
+
const providersInjection = providersImport ? (() => {
|
|
24688
|
+
const scan = runAngularHandlerScan2(projectRoot, angularDir);
|
|
24689
|
+
const basePathByKey = new Map;
|
|
24690
|
+
for (const call of scan.calls) {
|
|
24691
|
+
basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
|
|
24692
|
+
}
|
|
24693
|
+
const pagesByFile = new Map;
|
|
24694
|
+
for (const route of scan.pageRoutes) {
|
|
24695
|
+
const basePath = basePathByKey.get(route.manifestKey) ?? null;
|
|
24696
|
+
pagesByFile.set(route.pageFile, {
|
|
24697
|
+
basePath: basePath === "/" ? null : basePath,
|
|
24698
|
+
hasRoutes: route.hasRoutes
|
|
24699
|
+
});
|
|
24700
|
+
}
|
|
24701
|
+
return {
|
|
24702
|
+
appProvidersSource: providersImport.absolutePath,
|
|
24703
|
+
pagesByFile
|
|
24704
|
+
};
|
|
24705
|
+
})() : undefined;
|
|
24706
|
+
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config), providersInjection);
|
|
24886
24707
|
(async () => {
|
|
24887
24708
|
try {
|
|
24888
24709
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
24889
24710
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
24890
|
-
const { join:
|
|
24711
|
+
const { join: join40 } = await import("path");
|
|
24891
24712
|
const walk = async (dir) => {
|
|
24892
24713
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
24893
24714
|
const files = [];
|
|
24894
24715
|
for (const entry of entries) {
|
|
24895
|
-
const full =
|
|
24716
|
+
const full = join40(dir, entry.name);
|
|
24896
24717
|
if (entry.isDirectory()) {
|
|
24897
24718
|
files.push(...await walk(full));
|
|
24898
24719
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -24969,7 +24790,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24969
24790
|
}, getModuleUrl = async (pageFile) => {
|
|
24970
24791
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
24971
24792
|
invalidateModule2(pageFile);
|
|
24972
|
-
const rel =
|
|
24793
|
+
const rel = relative16(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
24973
24794
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
24974
24795
|
warmCache2(url);
|
|
24975
24796
|
return url;
|
|
@@ -25000,7 +24821,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25000
24821
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
25001
24822
|
if (pageModuleUrl) {
|
|
25002
24823
|
const serverDuration = Date.now() - startTime;
|
|
25003
|
-
state.lastHmrPath =
|
|
24824
|
+
state.lastHmrPath = relative16(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
25004
24825
|
state.lastHmrFramework = "react";
|
|
25005
24826
|
broadcastToClients(state, {
|
|
25006
24827
|
data: {
|
|
@@ -25335,7 +25156,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25335
25156
|
const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
25336
25157
|
const serverEntries = [...vueServerPaths];
|
|
25337
25158
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
25338
|
-
const cssOutDir =
|
|
25159
|
+
const cssOutDir = join39(buildDir, state.resolvedPaths.assetsDir ? basename13(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
25339
25160
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
25340
25161
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
25341
25162
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -25491,7 +25312,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25491
25312
|
const duration = Date.now() - startTime;
|
|
25492
25313
|
const [primary] = emberFiles;
|
|
25493
25314
|
if (primary) {
|
|
25494
|
-
state.lastHmrPath =
|
|
25315
|
+
state.lastHmrPath = relative16(process.cwd(), primary).replace(/\\/g, "/");
|
|
25495
25316
|
state.lastHmrFramework = "ember";
|
|
25496
25317
|
logHmrUpdate(primary, "ember", duration);
|
|
25497
25318
|
}
|
|
@@ -25576,7 +25397,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25576
25397
|
if (!buildReference?.source) {
|
|
25577
25398
|
return;
|
|
25578
25399
|
}
|
|
25579
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve41(
|
|
25400
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve41(dirname25(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25580
25401
|
islandFiles.add(resolve41(sourcePath));
|
|
25581
25402
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25582
25403
|
const registryPath = config.islands?.registry;
|
|
@@ -25734,7 +25555,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25734
25555
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
25735
25556
|
const pascalName = toPascal(baseName);
|
|
25736
25557
|
const vueRoot = config.vueDirectory;
|
|
25737
|
-
const hmrId = vueRoot ?
|
|
25558
|
+
const hmrId = vueRoot ? relative16(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
25738
25559
|
const cssKey = `${pascalName}CSS`;
|
|
25739
25560
|
const cssUrl = manifest[cssKey] || null;
|
|
25740
25561
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -26349,8 +26170,8 @@ __export(exports_buildDepVendor, {
|
|
|
26349
26170
|
computeDepVendorPaths: () => computeDepVendorPaths,
|
|
26350
26171
|
buildDepVendor: () => buildDepVendor
|
|
26351
26172
|
});
|
|
26352
|
-
import { mkdirSync as
|
|
26353
|
-
import { join as
|
|
26173
|
+
import { mkdirSync as mkdirSync14 } from "fs";
|
|
26174
|
+
import { join as join40 } from "path";
|
|
26354
26175
|
import { rm as rm10 } from "fs/promises";
|
|
26355
26176
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
26356
26177
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -26461,7 +26282,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26461
26282
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
26462
26283
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
26463
26284
|
const safeName = toSafeFileName6(specifier);
|
|
26464
|
-
const entryPath =
|
|
26285
|
+
const entryPath = join40(tmpDir, `${safeName}.ts`);
|
|
26465
26286
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26466
26287
|
return { entryPath, specifier };
|
|
26467
26288
|
}));
|
|
@@ -26522,10 +26343,10 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26522
26343
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
26523
26344
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
26524
26345
|
return {};
|
|
26525
|
-
const vendorDir =
|
|
26526
|
-
|
|
26527
|
-
const tmpDir =
|
|
26528
|
-
|
|
26346
|
+
const vendorDir = join40(buildDir, "vendor");
|
|
26347
|
+
mkdirSync14(vendorDir, { recursive: true });
|
|
26348
|
+
const tmpDir = join40(buildDir, "_dep_vendor_tmp");
|
|
26349
|
+
mkdirSync14(tmpDir, { recursive: true });
|
|
26529
26350
|
const allSpecs = new Set(initialSpecs);
|
|
26530
26351
|
const alreadyScanned = new Set;
|
|
26531
26352
|
let frontier = [...allSpecs, ...frameworkRoots];
|
|
@@ -27036,5 +26857,5 @@ export {
|
|
|
27036
26857
|
build
|
|
27037
26858
|
};
|
|
27038
26859
|
|
|
27039
|
-
//# debugId=
|
|
26860
|
+
//# debugId=AFDCA0EAFC10E90864756E2164756E21
|
|
27040
26861
|
//# sourceMappingURL=build.js.map
|