@absolutejs/absolute 0.19.0-beta.1114 → 0.19.0-beta.1116
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/browser.js +53 -47
- package/dist/angular/browser.js.map +5 -5
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/hmrPreserveCore.ts +73 -34
- package/dist/angular/index.js +63 -58
- package/dist/angular/index.js.map +10 -10
- package/dist/angular/server.js +20 -38
- package/dist/angular/server.js.map +8 -8
- package/dist/build.js +601 -547
- package/dist/build.js.map +32 -32
- package/dist/cli/config/client.js +8 -8
- package/dist/cli/config/server.js +87 -75
- package/dist/cli/index.js +146 -127
- package/dist/client/index.js +1 -19
- package/dist/client/index.js.map +3 -3
- package/dist/core/streamingSlotRegistrar.js +1 -19
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +1 -19
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/errorOverlay.ts +11 -10
- package/dist/dev/client/handlers/angularHmrShim.ts +6 -6
- package/dist/dev/client/handlers/angularRemount.ts +64 -44
- package/dist/dev/client/hmrClient.ts +31 -26
- package/dist/dev/client/hmrToast.ts +2 -4
- package/dist/dev/serverBootstrap.js +36 -0
- package/dist/index.js +742 -615
- package/dist/index.js.map +39 -38
- package/dist/islands/browser.js +1 -19
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +1 -19
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +1 -19
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/index.js +1 -19
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/hooks/index.js +1 -19
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +15 -37
- package/dist/react/index.js.map +7 -7
- package/dist/react/jsxDevRuntimeCompat.js +1 -19
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/router/browser.js +1 -19
- package/dist/react/router/browser.js.map +2 -2
- package/dist/react/router/index.js +1 -19
- package/dist/react/router/index.js.map +2 -2
- package/dist/react/server.js +15 -37
- package/dist/react/server.js.map +6 -6
- package/dist/src/angular/hmrPreserveCore.d.ts +2 -2
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +1 -1
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +1 -1
- package/dist/src/cli/config/packageJson/resolvePackageJson.d.ts +1 -2
- package/dist/src/cli/config/schema/fromType.d.ts +1 -2
- package/dist/src/cli/config/server.d.ts +2 -2
- package/dist/src/core/build.d.ts +3 -2
- package/dist/src/core/prepare.d.ts +1 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +4 -2
- package/dist/src/dev/serverBootstrap.d.ts +1 -0
- package/dist/src/dev/serverEntryWatcher.d.ts +3 -3
- package/dist/src/dev/webSocket.d.ts +1 -1
- package/dist/src/plugins/hmr.d.ts +1 -0
- package/dist/src/svelte/router/matchPath.d.ts +2 -2
- package/dist/src/utils/defineConvention.d.ts +2 -2
- package/dist/src/utils/inlinePageCss.d.ts +1 -1
- package/dist/src/utils/isTestSourcePath.d.ts +1 -0
- package/dist/svelte/browser.js +1 -19
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +15 -36
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/router/Link.svelte.d.ts +3 -3
- package/dist/svelte/router/Route.svelte.d.ts +5 -5
- package/dist/svelte/router/Router.svelte.d.ts +3 -3
- package/dist/svelte/router/matchPath.ts +25 -20
- package/dist/svelte/router/prefetchCache.ts +6 -4
- package/dist/svelte/router/viewTransitions.ts +22 -12
- package/dist/svelte/server.js +15 -36
- package/dist/svelte/server.js.map +7 -7
- package/dist/types/angular.d.ts +1 -1
- package/dist/types/globals.d.ts +5 -0
- package/dist/vue/browser.js +1 -19
- package/dist/vue/browser.js.map +2 -2
- package/dist/vue/components/Image.js +1 -19
- package/dist/vue/components/Image.js.map +2 -2
- package/dist/vue/components/index.js +1 -19
- package/dist/vue/components/index.js.map +2 -2
- package/dist/vue/index.js +41 -55
- package/dist/vue/index.js.map +10 -10
- package/dist/vue/server.js +32 -48
- package/dist/vue/server.js.map +8 -8
- package/package.json +285 -19
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ var __create = Object.create;
|
|
|
3
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
7
|
function __accessProp(key) {
|
|
9
8
|
return this[key];
|
|
@@ -30,23 +29,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
29
|
cache.set(mod, to);
|
|
31
30
|
return to;
|
|
32
31
|
};
|
|
33
|
-
var __toCommonJS = (from) => {
|
|
34
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
35
|
-
if (entry)
|
|
36
|
-
return entry;
|
|
37
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
38
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
-
for (var key of __getOwnPropNames(from))
|
|
40
|
-
if (!__hasOwnProp.call(entry, key))
|
|
41
|
-
__defProp(entry, key, {
|
|
42
|
-
get: __accessProp.bind(from, key),
|
|
43
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
__moduleCache.set(from, entry);
|
|
47
|
-
return entry;
|
|
48
|
-
};
|
|
49
|
-
var __moduleCache;
|
|
50
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
51
33
|
var __returnValue = (v) => v;
|
|
52
34
|
function __exportSetter(name, newValue) {
|
|
@@ -140,9 +122,6 @@ var isValidHMRClientMessage = (data) => {
|
|
|
140
122
|
}
|
|
141
123
|
};
|
|
142
124
|
|
|
143
|
-
// types/websocket.ts
|
|
144
|
-
var WS_READY_STATE_OPEN = 1;
|
|
145
|
-
|
|
146
125
|
// src/build/stylePreprocessor.ts
|
|
147
126
|
var exports_stylePreprocessor = {};
|
|
148
127
|
__export(exports_stylePreprocessor, {
|
|
@@ -19091,8 +19070,8 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
19091
19070
|
}, isDev = () => true, buildErrorProps = (error) => {
|
|
19092
19071
|
if (error instanceof Error) {
|
|
19093
19072
|
return {
|
|
19094
|
-
name: error.name,
|
|
19095
19073
|
message: error.message,
|
|
19074
|
+
name: error.name,
|
|
19096
19075
|
...isDev() && error.stack ? { stack: error.stack } : {}
|
|
19097
19076
|
};
|
|
19098
19077
|
}
|
|
@@ -19176,7 +19155,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
19176
19155
|
let conventionPath = resolveErrorConventionPath(framework, pageName);
|
|
19177
19156
|
if (!conventionPath && error instanceof Error && error.stack) {
|
|
19178
19157
|
for (const match of error.stack.matchAll(/^\s*at\s+([A-Za-z_$][\w$]*)/gm)) {
|
|
19179
|
-
const candidate = match
|
|
19158
|
+
const [, candidate] = match;
|
|
19180
19159
|
if (!candidate)
|
|
19181
19160
|
continue;
|
|
19182
19161
|
conventionPath = resolveErrorConventionPath(framework, candidate);
|
|
@@ -19324,9 +19303,9 @@ var init_resolveConvention = __esm(() => {
|
|
|
19324
19303
|
import { basename as basename3 } from "path";
|
|
19325
19304
|
var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
19326
19305
|
Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
|
|
19327
|
-
}, getSpaRouteManifest = () => {
|
|
19306
|
+
}, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
|
|
19328
19307
|
const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
|
|
19329
|
-
return Array.isArray(value) ? value : [];
|
|
19308
|
+
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
19330
19309
|
}, normalizePath = (path) => {
|
|
19331
19310
|
const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
19332
19311
|
const trimmed = withLeadingSlash.replace(/\/+$/, "");
|
|
@@ -19566,22 +19545,20 @@ __export(exports_devRouteRegistrationCallsite, {
|
|
|
19566
19545
|
});
|
|
19567
19546
|
import { AsyncLocalStorage } from "async_hooks";
|
|
19568
19547
|
import { Elysia as Elysia2 } from "elysia";
|
|
19569
|
-
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
|
|
19548
|
+
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, isPageHandlerFunction = (value) => typeof value === "function", handlerSourceMentionsPageHelper = (handler) => {
|
|
19570
19549
|
const source = handler.toString();
|
|
19571
19550
|
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
19572
19551
|
}, getOriginalPageHandlerSource = (handler) => {
|
|
19573
|
-
if (
|
|
19552
|
+
if (!isPageHandlerFunction(handler))
|
|
19574
19553
|
return;
|
|
19575
|
-
const
|
|
19576
|
-
|
|
19577
|
-
return (info?.originalHandler ?? fn2).toString();
|
|
19554
|
+
const info = pageHandlerWrappers.get(handler);
|
|
19555
|
+
return (info?.originalHandler ?? handler).toString();
|
|
19578
19556
|
}, isPageHandler = (handler) => {
|
|
19579
|
-
if (
|
|
19557
|
+
if (!isPageHandlerFunction(handler))
|
|
19580
19558
|
return false;
|
|
19581
|
-
|
|
19582
|
-
if (pageHandlerWrappers.has(fn2))
|
|
19559
|
+
if (pageHandlerWrappers.has(handler))
|
|
19583
19560
|
return true;
|
|
19584
|
-
return handlerSourceMentionsPageHelper(
|
|
19561
|
+
return handlerSourceMentionsPageHelper(handler);
|
|
19585
19562
|
}, isObjectRecord3 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
|
|
19586
19563
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
19587
19564
|
if (value === null || typeof value === "undefined") {
|
|
@@ -19618,7 +19595,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
19618
19595
|
}, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
|
|
19619
19596
|
const callsite = captureRouteRegistrationCallsite();
|
|
19620
19597
|
const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
|
|
19621
|
-
if (methodName === "get" &&
|
|
19598
|
+
if (methodName === "get" && isPageHandlerFunction(handler) && isPageHandlerFunction(wrapped) && handlerSourceMentionsPageHelper(handler)) {
|
|
19622
19599
|
pageHandlerWrappers.set(wrapped, {
|
|
19623
19600
|
originalHandler: handler
|
|
19624
19601
|
});
|
|
@@ -20475,8 +20452,8 @@ __export(exports_staticAnalyzeSpaRoutes, {
|
|
|
20475
20452
|
import { existsSync as existsSync12, promises as fs } from "fs";
|
|
20476
20453
|
import { join as join16 } from "path";
|
|
20477
20454
|
import ts3 from "typescript";
|
|
20478
|
-
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (
|
|
20479
|
-
for (const statement of
|
|
20455
|
+
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
20456
|
+
for (const statement of sourceFile.statements) {
|
|
20480
20457
|
if (!ts3.isImportDeclaration(statement))
|
|
20481
20458
|
continue;
|
|
20482
20459
|
if (!ts3.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -20507,7 +20484,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20507
20484
|
return property.name.text;
|
|
20508
20485
|
}
|
|
20509
20486
|
return null;
|
|
20510
|
-
}, findRoutesArrayDeclaration = (
|
|
20487
|
+
}, findRoutesArrayDeclaration = (sourceFile, identifierName) => {
|
|
20511
20488
|
let found = null;
|
|
20512
20489
|
const visit = (node) => {
|
|
20513
20490
|
if (found)
|
|
@@ -20518,7 +20495,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20518
20495
|
}
|
|
20519
20496
|
ts3.forEachChild(node, visit);
|
|
20520
20497
|
};
|
|
20521
|
-
ts3.forEachChild(
|
|
20498
|
+
ts3.forEachChild(sourceFile, visit);
|
|
20522
20499
|
return found;
|
|
20523
20500
|
}, extractSitemapData = (dataLiteral) => {
|
|
20524
20501
|
for (const prop of dataLiteral.properties) {
|
|
@@ -20538,8 +20515,8 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20538
20515
|
if (!parent)
|
|
20539
20516
|
return child;
|
|
20540
20517
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
20541
|
-
}, extractRoutePaths = (
|
|
20542
|
-
for (const element of
|
|
20518
|
+
}, extractRoutePaths = (routeArray, parentPath, parentExcluded, routes) => {
|
|
20519
|
+
for (const element of routeArray.elements) {
|
|
20543
20520
|
if (!ts3.isObjectLiteralExpression(element))
|
|
20544
20521
|
continue;
|
|
20545
20522
|
let pathSegment = null;
|
|
@@ -20567,32 +20544,32 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20567
20544
|
continue;
|
|
20568
20545
|
const joined = joinSegments(parentPath, pathSegment);
|
|
20569
20546
|
if (childrenLiteral) {
|
|
20570
|
-
extractRoutePaths(childrenLiteral, joined, sitemapExcluded,
|
|
20547
|
+
extractRoutePaths(childrenLiteral, joined, sitemapExcluded, routes);
|
|
20571
20548
|
continue;
|
|
20572
20549
|
}
|
|
20573
20550
|
if (joined === "")
|
|
20574
20551
|
continue;
|
|
20575
|
-
|
|
20552
|
+
routes.push({
|
|
20576
20553
|
dynamic: pathHasDynamic(joined),
|
|
20577
20554
|
path: joined,
|
|
20578
20555
|
redirected,
|
|
20579
20556
|
sitemapExcluded
|
|
20580
20557
|
});
|
|
20581
20558
|
}
|
|
20582
|
-
}, findProvideRouterFirstArg = (
|
|
20583
|
-
|
|
20559
|
+
}, findProvideRouterFirstArg = (sourceFile) => {
|
|
20560
|
+
const result = { found: null };
|
|
20584
20561
|
const visit = (node) => {
|
|
20585
|
-
if (found)
|
|
20562
|
+
if (result.found)
|
|
20586
20563
|
return;
|
|
20587
20564
|
if (ts3.isCallExpression(node) && ts3.isIdentifier(node.expression) && node.expression.text === "provideRouter") {
|
|
20588
|
-
found = node.arguments[0] ?? null;
|
|
20565
|
+
result.found = node.arguments[0] ?? null;
|
|
20589
20566
|
return;
|
|
20590
20567
|
}
|
|
20591
20568
|
ts3.forEachChild(node, visit);
|
|
20592
20569
|
};
|
|
20593
|
-
ts3.forEachChild(
|
|
20594
|
-
return found;
|
|
20595
|
-
}, findAppBaseHrefValue = (
|
|
20570
|
+
ts3.forEachChild(sourceFile, visit);
|
|
20571
|
+
return result.found;
|
|
20572
|
+
}, findAppBaseHrefValue = (sourceFile) => {
|
|
20596
20573
|
let found = null;
|
|
20597
20574
|
const visit = (node) => {
|
|
20598
20575
|
if (found)
|
|
@@ -20619,7 +20596,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20619
20596
|
}
|
|
20620
20597
|
ts3.forEachChild(node, visit);
|
|
20621
20598
|
};
|
|
20622
|
-
ts3.forEachChild(
|
|
20599
|
+
ts3.forEachChild(sourceFile, visit);
|
|
20623
20600
|
return found;
|
|
20624
20601
|
}, analyzeFile = async (filePath) => {
|
|
20625
20602
|
let source;
|
|
@@ -20631,20 +20608,20 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20631
20608
|
if (!source.includes("APP_BASE_HREF") || !source.includes("provideRouter")) {
|
|
20632
20609
|
return null;
|
|
20633
20610
|
}
|
|
20634
|
-
const
|
|
20635
|
-
if (!importsSymbolFrom(
|
|
20611
|
+
const sourceFile = ts3.createSourceFile(filePath, source, ts3.ScriptTarget.Latest, true, ts3.ScriptKind.TS);
|
|
20612
|
+
if (!importsSymbolFrom(sourceFile, "APP_BASE_HREF", "@angular/common"))
|
|
20636
20613
|
return null;
|
|
20637
|
-
if (!importsSymbolFrom(
|
|
20614
|
+
if (!importsSymbolFrom(sourceFile, "provideRouter", "@angular/router"))
|
|
20638
20615
|
return null;
|
|
20639
|
-
const baseHref = findAppBaseHrefValue(
|
|
20616
|
+
const baseHref = findAppBaseHrefValue(sourceFile);
|
|
20640
20617
|
if (!baseHref)
|
|
20641
20618
|
return null;
|
|
20642
|
-
const firstArg = findProvideRouterFirstArg(
|
|
20619
|
+
const firstArg = findProvideRouterFirstArg(sourceFile);
|
|
20643
20620
|
if (!firstArg)
|
|
20644
20621
|
return null;
|
|
20645
20622
|
let routesArray = null;
|
|
20646
20623
|
if (ts3.isIdentifier(firstArg)) {
|
|
20647
|
-
routesArray = findRoutesArrayDeclaration(
|
|
20624
|
+
routesArray = findRoutesArrayDeclaration(sourceFile, firstArg.text);
|
|
20648
20625
|
} else if (ts3.isArrayLiteralExpression(firstArg)) {
|
|
20649
20626
|
routesArray = firstArg;
|
|
20650
20627
|
}
|
|
@@ -20657,13 +20634,14 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20657
20634
|
routes,
|
|
20658
20635
|
sourceFile: filePath
|
|
20659
20636
|
};
|
|
20660
|
-
}, walkTsFiles = async (dir,
|
|
20637
|
+
}, walkTsFiles = async (dir, files) => {
|
|
20661
20638
|
let items;
|
|
20662
20639
|
try {
|
|
20663
20640
|
items = await fs.readdir(dir, { withFileTypes: true });
|
|
20664
20641
|
} catch {
|
|
20665
20642
|
return;
|
|
20666
20643
|
}
|
|
20644
|
+
const directories = [];
|
|
20667
20645
|
for (const item of items) {
|
|
20668
20646
|
if (item.name === "node_modules")
|
|
20669
20647
|
continue;
|
|
@@ -20671,11 +20649,12 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
20671
20649
|
continue;
|
|
20672
20650
|
const full = join16(dir, item.name);
|
|
20673
20651
|
if (item.isDirectory()) {
|
|
20674
|
-
|
|
20652
|
+
directories.push(full);
|
|
20675
20653
|
} else if (item.isFile() && item.name.endsWith(".ts") && !item.name.endsWith(".d.ts")) {
|
|
20676
|
-
|
|
20654
|
+
files.push(full);
|
|
20677
20655
|
}
|
|
20678
20656
|
}
|
|
20657
|
+
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
20679
20658
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
20680
20659
|
if (!existsSync12(angularDirectory))
|
|
20681
20660
|
return [];
|
|
@@ -20720,8 +20699,8 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20720
20699
|
return property.name.text;
|
|
20721
20700
|
}
|
|
20722
20701
|
return null;
|
|
20723
|
-
}, importsSymbolFromAny = (
|
|
20724
|
-
for (const statement of
|
|
20702
|
+
}, importsSymbolFromAny = (sourceFile, localName, moduleSpecifiers) => {
|
|
20703
|
+
for (const statement of sourceFile.statements) {
|
|
20725
20704
|
if (!ts4.isImportDeclaration(statement))
|
|
20726
20705
|
continue;
|
|
20727
20706
|
if (!ts4.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -20737,7 +20716,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20737
20716
|
}
|
|
20738
20717
|
}
|
|
20739
20718
|
return false;
|
|
20740
|
-
}, findVariableArrayDeclaration = (
|
|
20719
|
+
}, findVariableArrayDeclaration = (sourceFile, identifierName) => {
|
|
20741
20720
|
let found = null;
|
|
20742
20721
|
const visit = (node) => {
|
|
20743
20722
|
if (found)
|
|
@@ -20748,7 +20727,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20748
20727
|
}
|
|
20749
20728
|
ts4.forEachChild(node, visit);
|
|
20750
20729
|
};
|
|
20751
|
-
ts4.forEachChild(
|
|
20730
|
+
ts4.forEachChild(sourceFile, visit);
|
|
20752
20731
|
return found;
|
|
20753
20732
|
}, joinSegments2 = (parent, child) => {
|
|
20754
20733
|
if (!child)
|
|
@@ -20756,8 +20735,8 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20756
20735
|
if (!parent)
|
|
20757
20736
|
return child;
|
|
20758
20737
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
20759
|
-
}, extractRouteEntries = (
|
|
20760
|
-
for (const element of
|
|
20738
|
+
}, extractRouteEntries = (routeArray, parentPath, routes) => {
|
|
20739
|
+
for (const element of routeArray.elements) {
|
|
20761
20740
|
if (!ts4.isObjectLiteralExpression(element))
|
|
20762
20741
|
continue;
|
|
20763
20742
|
let pathSegment = null;
|
|
@@ -20795,33 +20774,33 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20795
20774
|
const segment = pathSegment ?? "";
|
|
20796
20775
|
const joined = joinSegments2(parentPath, segment);
|
|
20797
20776
|
if (childrenLiteral) {
|
|
20798
|
-
extractRouteEntries(childrenLiteral, joined,
|
|
20777
|
+
extractRouteEntries(childrenLiteral, joined, routes);
|
|
20799
20778
|
continue;
|
|
20800
20779
|
}
|
|
20801
20780
|
if (!isIndex && pathSegment === null)
|
|
20802
20781
|
continue;
|
|
20803
20782
|
if (joined === "")
|
|
20804
20783
|
continue;
|
|
20805
|
-
|
|
20784
|
+
routes.push({
|
|
20806
20785
|
dynamic: pathHasDynamic2(joined),
|
|
20807
20786
|
path: joined,
|
|
20808
20787
|
redirected,
|
|
20809
20788
|
sitemapExcluded
|
|
20810
20789
|
});
|
|
20811
20790
|
}
|
|
20812
|
-
}, findCreateBrowserRouterCall = (
|
|
20813
|
-
|
|
20791
|
+
}, findCreateBrowserRouterCall = (sourceFile) => {
|
|
20792
|
+
const result = { found: null };
|
|
20814
20793
|
const visit = (node) => {
|
|
20815
|
-
if (found)
|
|
20794
|
+
if (result.found)
|
|
20816
20795
|
return;
|
|
20817
20796
|
if (ts4.isCallExpression(node) && ts4.isIdentifier(node.expression) && node.expression.text === "createBrowserRouter") {
|
|
20818
|
-
found = node;
|
|
20797
|
+
result.found = node;
|
|
20819
20798
|
return;
|
|
20820
20799
|
}
|
|
20821
20800
|
ts4.forEachChild(node, visit);
|
|
20822
20801
|
};
|
|
20823
|
-
ts4.forEachChild(
|
|
20824
|
-
return found;
|
|
20802
|
+
ts4.forEachChild(sourceFile, visit);
|
|
20803
|
+
return result.found;
|
|
20825
20804
|
}, readBasenameFromOptions = (expression) => {
|
|
20826
20805
|
if (!expression || !ts4.isObjectLiteralExpression(expression))
|
|
20827
20806
|
return null;
|
|
@@ -20845,24 +20824,24 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20845
20824
|
}
|
|
20846
20825
|
if (!source.includes("createBrowserRouter"))
|
|
20847
20826
|
return null;
|
|
20848
|
-
const
|
|
20849
|
-
if (!importsSymbolFromAny(
|
|
20827
|
+
const sourceFile = ts4.createSourceFile(filePath, source, ts4.ScriptTarget.Latest, true, filePath.endsWith(".tsx") ? ts4.ScriptKind.TSX : ts4.ScriptKind.TS);
|
|
20828
|
+
if (!importsSymbolFromAny(sourceFile, "createBrowserRouter", [
|
|
20850
20829
|
"react-router-dom",
|
|
20851
20830
|
"react-router"
|
|
20852
20831
|
])) {
|
|
20853
20832
|
return null;
|
|
20854
20833
|
}
|
|
20855
|
-
const call = findCreateBrowserRouterCall(
|
|
20834
|
+
const call = findCreateBrowserRouterCall(sourceFile);
|
|
20856
20835
|
if (!call)
|
|
20857
20836
|
return null;
|
|
20858
|
-
const routesArg = call.arguments
|
|
20837
|
+
const [routesArg] = call.arguments;
|
|
20859
20838
|
if (!routesArg)
|
|
20860
20839
|
return null;
|
|
20861
20840
|
let routesArray = null;
|
|
20862
20841
|
if (ts4.isArrayLiteralExpression(routesArg)) {
|
|
20863
20842
|
routesArray = routesArg;
|
|
20864
20843
|
} else if (ts4.isIdentifier(routesArg)) {
|
|
20865
|
-
routesArray = findVariableArrayDeclaration(
|
|
20844
|
+
routesArray = findVariableArrayDeclaration(sourceFile, routesArg.text);
|
|
20866
20845
|
}
|
|
20867
20846
|
if (!routesArray)
|
|
20868
20847
|
return null;
|
|
@@ -20871,23 +20850,25 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
20871
20850
|
const routes = [];
|
|
20872
20851
|
extractRouteEntries(routesArray, "", routes);
|
|
20873
20852
|
return { baseHref, routes, sourceFile: filePath };
|
|
20874
|
-
}, walkSourceFiles = async (dir,
|
|
20853
|
+
}, walkSourceFiles = async (dir, files) => {
|
|
20875
20854
|
let items;
|
|
20876
20855
|
try {
|
|
20877
20856
|
items = await fs2.readdir(dir, { withFileTypes: true });
|
|
20878
20857
|
} catch {
|
|
20879
20858
|
return;
|
|
20880
20859
|
}
|
|
20860
|
+
const directories = [];
|
|
20881
20861
|
for (const item of items) {
|
|
20882
20862
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
20883
20863
|
continue;
|
|
20884
20864
|
const full = join17(dir, item.name);
|
|
20885
20865
|
if (item.isDirectory()) {
|
|
20886
|
-
|
|
20866
|
+
directories.push(full);
|
|
20887
20867
|
} else if (item.isFile() && (item.name.endsWith(".tsx") || item.name.endsWith(".ts") || item.name.endsWith(".jsx") || item.name.endsWith(".js")) && !item.name.endsWith(".d.ts")) {
|
|
20888
|
-
|
|
20868
|
+
files.push(full);
|
|
20889
20869
|
}
|
|
20890
20870
|
}
|
|
20871
|
+
await Promise.all(directories.map((directory) => walkSourceFiles(directory, files)));
|
|
20891
20872
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
20892
20873
|
if (!existsSync13(reactDirectory))
|
|
20893
20874
|
return [];
|
|
@@ -20977,23 +20958,25 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
20977
20958
|
path: joinSegments3("", r.path)
|
|
20978
20959
|
}));
|
|
20979
20960
|
return { baseHref, routes: joinedRoutes, sourceFile: filePath };
|
|
20980
|
-
}, walkSvelteFiles = async (dir,
|
|
20961
|
+
}, walkSvelteFiles = async (dir, files) => {
|
|
20981
20962
|
let items;
|
|
20982
20963
|
try {
|
|
20983
20964
|
items = await fs3.readdir(dir, { withFileTypes: true });
|
|
20984
20965
|
} catch {
|
|
20985
20966
|
return;
|
|
20986
20967
|
}
|
|
20968
|
+
const directories = [];
|
|
20987
20969
|
for (const item of items) {
|
|
20988
20970
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
20989
20971
|
continue;
|
|
20990
20972
|
const full = join18(dir, item.name);
|
|
20991
20973
|
if (item.isDirectory()) {
|
|
20992
|
-
|
|
20974
|
+
directories.push(full);
|
|
20993
20975
|
} else if (item.isFile() && item.name.endsWith(".svelte")) {
|
|
20994
|
-
|
|
20976
|
+
files.push(full);
|
|
20995
20977
|
}
|
|
20996
20978
|
}
|
|
20979
|
+
await Promise.all(directories.map((directory) => walkSvelteFiles(directory, files)));
|
|
20997
20980
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
20998
20981
|
if (!existsSync14(svelteDirectory))
|
|
20999
20982
|
return [];
|
|
@@ -21040,8 +21023,8 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21040
21023
|
return property.name.text;
|
|
21041
21024
|
}
|
|
21042
21025
|
return null;
|
|
21043
|
-
}, importsSymbolFrom2 = (
|
|
21044
|
-
for (const statement of
|
|
21026
|
+
}, importsSymbolFrom2 = (sourceFile, localName, moduleSpecifier) => {
|
|
21027
|
+
for (const statement of sourceFile.statements) {
|
|
21045
21028
|
if (!ts5.isImportDeclaration(statement))
|
|
21046
21029
|
continue;
|
|
21047
21030
|
if (!ts5.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -21057,7 +21040,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21057
21040
|
}
|
|
21058
21041
|
}
|
|
21059
21042
|
return false;
|
|
21060
|
-
}, findVariableArrayDeclaration2 = (
|
|
21043
|
+
}, findVariableArrayDeclaration2 = (sourceFile, identifierName) => {
|
|
21061
21044
|
let found = null;
|
|
21062
21045
|
const visit = (node) => {
|
|
21063
21046
|
if (found)
|
|
@@ -21068,7 +21051,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21068
21051
|
}
|
|
21069
21052
|
ts5.forEachChild(node, visit);
|
|
21070
21053
|
};
|
|
21071
|
-
ts5.forEachChild(
|
|
21054
|
+
ts5.forEachChild(sourceFile, visit);
|
|
21072
21055
|
return found;
|
|
21073
21056
|
}, joinSegments4 = (parent, child) => {
|
|
21074
21057
|
if (!child)
|
|
@@ -21076,8 +21059,8 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21076
21059
|
if (!parent)
|
|
21077
21060
|
return child;
|
|
21078
21061
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
21079
|
-
}, extractRouteEntries2 = (
|
|
21080
|
-
for (const element of
|
|
21062
|
+
}, extractRouteEntries2 = (routeArray, parentPath, routes) => {
|
|
21063
|
+
for (const element of routeArray.elements) {
|
|
21081
21064
|
if (!ts5.isObjectLiteralExpression(element))
|
|
21082
21065
|
continue;
|
|
21083
21066
|
let pathSegment = null;
|
|
@@ -21116,19 +21099,19 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21116
21099
|
continue;
|
|
21117
21100
|
const joined = joinSegments4(parentPath, pathSegment);
|
|
21118
21101
|
if (childrenLiteral) {
|
|
21119
|
-
extractRouteEntries2(childrenLiteral, joined,
|
|
21102
|
+
extractRouteEntries2(childrenLiteral, joined, routes);
|
|
21120
21103
|
continue;
|
|
21121
21104
|
}
|
|
21122
21105
|
if (joined === "")
|
|
21123
21106
|
continue;
|
|
21124
|
-
|
|
21107
|
+
routes.push({
|
|
21125
21108
|
dynamic: pathHasDynamic4(joined),
|
|
21126
21109
|
path: joined,
|
|
21127
21110
|
redirected,
|
|
21128
21111
|
sitemapExcluded
|
|
21129
21112
|
});
|
|
21130
21113
|
if (alias) {
|
|
21131
|
-
|
|
21114
|
+
routes.push({
|
|
21132
21115
|
dynamic: pathHasDynamic4(alias),
|
|
21133
21116
|
path: alias,
|
|
21134
21117
|
redirected: false,
|
|
@@ -21136,45 +21119,48 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21136
21119
|
});
|
|
21137
21120
|
}
|
|
21138
21121
|
}
|
|
21139
|
-
}, findDefineRoutesArray = (
|
|
21122
|
+
}, findDefineRoutesArray = (sourceFile) => {
|
|
21140
21123
|
let found = null;
|
|
21141
21124
|
const visit = (node) => {
|
|
21142
21125
|
if (found)
|
|
21143
21126
|
return;
|
|
21144
|
-
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "defineRoutes"
|
|
21145
|
-
|
|
21127
|
+
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "defineRoutes") {
|
|
21128
|
+
const [routesArgument] = node.arguments;
|
|
21129
|
+
if (!routesArgument || !ts5.isArrayLiteralExpression(routesArgument))
|
|
21130
|
+
return;
|
|
21131
|
+
found = routesArgument;
|
|
21146
21132
|
return;
|
|
21147
21133
|
}
|
|
21148
21134
|
ts5.forEachChild(node, visit);
|
|
21149
21135
|
};
|
|
21150
|
-
ts5.forEachChild(
|
|
21136
|
+
ts5.forEachChild(sourceFile, visit);
|
|
21151
21137
|
return found;
|
|
21152
21138
|
}, inferBaseHref = (routes) => {
|
|
21153
21139
|
const firstSegments = routes.map((route) => route.path.split("/").filter(Boolean)[0]).filter((segment) => Boolean(segment));
|
|
21154
|
-
const first = firstSegments
|
|
21140
|
+
const [first] = firstSegments;
|
|
21155
21141
|
if (!first || firstSegments.some((segment) => segment !== first))
|
|
21156
21142
|
return "/";
|
|
21157
21143
|
return `/${first}/`;
|
|
21158
|
-
}, findCreateRouterCall = (
|
|
21159
|
-
|
|
21144
|
+
}, findCreateRouterCall = (sourceFile) => {
|
|
21145
|
+
const result = { found: null };
|
|
21160
21146
|
const visit = (node) => {
|
|
21161
|
-
if (found)
|
|
21147
|
+
if (result.found)
|
|
21162
21148
|
return;
|
|
21163
21149
|
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "createRouter") {
|
|
21164
|
-
found = node;
|
|
21150
|
+
result.found = node;
|
|
21165
21151
|
return;
|
|
21166
21152
|
}
|
|
21167
21153
|
ts5.forEachChild(node, visit);
|
|
21168
21154
|
};
|
|
21169
|
-
ts5.forEachChild(
|
|
21170
|
-
return found;
|
|
21171
|
-
}, findCreateWebHistoryBase = (
|
|
21155
|
+
ts5.forEachChild(sourceFile, visit);
|
|
21156
|
+
return result.found;
|
|
21157
|
+
}, findCreateWebHistoryBase = (sourceFile) => {
|
|
21172
21158
|
let found = null;
|
|
21173
21159
|
const visit = (node) => {
|
|
21174
21160
|
if (found)
|
|
21175
21161
|
return;
|
|
21176
21162
|
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && (node.expression.text === "createWebHistory" || node.expression.text === "createWebHashHistory")) {
|
|
21177
|
-
const baseArg = node.arguments
|
|
21163
|
+
const [baseArg] = node.arguments;
|
|
21178
21164
|
if (baseArg) {
|
|
21179
21165
|
const text = readStringLiteral3(baseArg);
|
|
21180
21166
|
if (text !== null) {
|
|
@@ -21188,9 +21174,9 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21188
21174
|
}
|
|
21189
21175
|
ts5.forEachChild(node, visit);
|
|
21190
21176
|
};
|
|
21191
|
-
ts5.forEachChild(
|
|
21177
|
+
ts5.forEachChild(sourceFile, visit);
|
|
21192
21178
|
return found;
|
|
21193
|
-
}, readRoutesFromCreateRouterOptions = (
|
|
21179
|
+
}, readRoutesFromCreateRouterOptions = (sourceFile, optionsExpr) => {
|
|
21194
21180
|
if (!ts5.isObjectLiteralExpression(optionsExpr))
|
|
21195
21181
|
return null;
|
|
21196
21182
|
for (const property of optionsExpr.properties) {
|
|
@@ -21198,7 +21184,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21198
21184
|
if (key !== "routes")
|
|
21199
21185
|
continue;
|
|
21200
21186
|
if (ts5.isShorthandPropertyAssignment(property)) {
|
|
21201
|
-
return findVariableArrayDeclaration2(
|
|
21187
|
+
return findVariableArrayDeclaration2(sourceFile, property.name.text);
|
|
21202
21188
|
}
|
|
21203
21189
|
if (!ts5.isPropertyAssignment(property))
|
|
21204
21190
|
continue;
|
|
@@ -21206,7 +21192,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21206
21192
|
return property.initializer;
|
|
21207
21193
|
}
|
|
21208
21194
|
if (ts5.isIdentifier(property.initializer)) {
|
|
21209
|
-
return findVariableArrayDeclaration2(
|
|
21195
|
+
return findVariableArrayDeclaration2(sourceFile, property.initializer.text);
|
|
21210
21196
|
}
|
|
21211
21197
|
}
|
|
21212
21198
|
return null;
|
|
@@ -21230,35 +21216,37 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
21230
21216
|
}
|
|
21231
21217
|
if (!analysisSource.includes("createRouter") && !analysisSource.includes("defineRoutes"))
|
|
21232
21218
|
return null;
|
|
21233
|
-
const
|
|
21234
|
-
const defineRoutesArray = findDefineRoutesArray(
|
|
21235
|
-
const call = importsSymbolFrom2(
|
|
21236
|
-
const optionsArg = call?.arguments[
|
|
21237
|
-
const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(
|
|
21219
|
+
const sourceFile = ts5.createSourceFile(filePath, analysisSource, ts5.ScriptTarget.Latest, true, ts5.ScriptKind.TS);
|
|
21220
|
+
const defineRoutesArray = findDefineRoutesArray(sourceFile);
|
|
21221
|
+
const call = importsSymbolFrom2(sourceFile, "createRouter", "vue-router") ? findCreateRouterCall(sourceFile) : null;
|
|
21222
|
+
const [optionsArg] = call?.arguments ?? [];
|
|
21223
|
+
const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(sourceFile, optionsArg) : null);
|
|
21238
21224
|
if (!routesArray)
|
|
21239
21225
|
return null;
|
|
21240
21226
|
const routes = [];
|
|
21241
21227
|
extractRouteEntries2(routesArray, "", routes);
|
|
21242
|
-
const base = findCreateWebHistoryBase(
|
|
21228
|
+
const base = findCreateWebHistoryBase(sourceFile) ?? inferBaseHref(routes);
|
|
21243
21229
|
const baseHref = base.endsWith("/") ? base : `${base}/`;
|
|
21244
21230
|
return { baseHref, routes, sourceFile: filePath };
|
|
21245
|
-
}, walkSourceFiles2 = async (dir,
|
|
21231
|
+
}, walkSourceFiles2 = async (dir, files) => {
|
|
21246
21232
|
let items;
|
|
21247
21233
|
try {
|
|
21248
21234
|
items = await fs4.readdir(dir, { withFileTypes: true });
|
|
21249
21235
|
} catch {
|
|
21250
21236
|
return;
|
|
21251
21237
|
}
|
|
21238
|
+
const directories = [];
|
|
21252
21239
|
for (const item of items) {
|
|
21253
21240
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
21254
21241
|
continue;
|
|
21255
21242
|
const full = join19(dir, item.name);
|
|
21256
21243
|
if (item.isDirectory()) {
|
|
21257
|
-
|
|
21244
|
+
directories.push(full);
|
|
21258
21245
|
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
21259
|
-
|
|
21246
|
+
files.push(full);
|
|
21260
21247
|
}
|
|
21261
21248
|
}
|
|
21249
|
+
await Promise.all(directories.map((directory) => walkSourceFiles2(directory, files)));
|
|
21262
21250
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
21263
21251
|
if (!existsSync15(vueDirectory))
|
|
21264
21252
|
return [];
|
|
@@ -21290,35 +21278,38 @@ var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").repl
|
|
|
21290
21278
|
return true;
|
|
21291
21279
|
}
|
|
21292
21280
|
return false;
|
|
21293
|
-
}, stripTrailingWildcard = (path) => path.replace(/\/\*+$/, ""), isWildcardPagePath = (path) => path.endsWith("/*") || path.endsWith("*"), SITEMAP_BLOCK_PATTERN, SITEMAP_STRING_FIELD_PATTERN, SITEMAP_NUMBER_FIELD_PATTERN, SITEMAP_BOOLEAN_FIELD_PATTERN, VALID_CHANGEFREQ, extractSitemapMetadataFromHandlerSource = (source) => {
|
|
21281
|
+
}, stripTrailingWildcard = (path) => path.replace(/\/\*+$/, ""), isWildcardPagePath = (path) => path.endsWith("/*") || path.endsWith("*"), SITEMAP_BLOCK_PATTERN, SITEMAP_STRING_FIELD_PATTERN, SITEMAP_NUMBER_FIELD_PATTERN, SITEMAP_BOOLEAN_FIELD_PATTERN, VALID_CHANGEFREQ, isChangeFrequency = (value) => VALID_CHANGEFREQ.has(value), extractSitemapMetadataFromHandlerSource = (source) => {
|
|
21294
21282
|
const block = SITEMAP_BLOCK_PATTERN.exec(source);
|
|
21295
21283
|
if (!block)
|
|
21296
21284
|
return;
|
|
21297
|
-
const body = block
|
|
21285
|
+
const [, body] = block;
|
|
21298
21286
|
if (typeof body !== "string")
|
|
21299
21287
|
return;
|
|
21300
21288
|
const out = {};
|
|
21301
21289
|
SITEMAP_STRING_FIELD_PATTERN.lastIndex = 0;
|
|
21302
|
-
let
|
|
21303
|
-
while ((
|
|
21304
|
-
const key =
|
|
21305
|
-
|
|
21306
|
-
if (key === "changefreq" && VALID_CHANGEFREQ.has(value)) {
|
|
21290
|
+
let match;
|
|
21291
|
+
while ((match = SITEMAP_STRING_FIELD_PATTERN.exec(body)) !== null) {
|
|
21292
|
+
const [, key, value] = match;
|
|
21293
|
+
if (key === "changefreq" && value && isChangeFrequency(value)) {
|
|
21307
21294
|
out.changefreq = value;
|
|
21308
21295
|
} else if (key === "lastmod") {
|
|
21309
21296
|
out.lastmod = value;
|
|
21310
21297
|
}
|
|
21311
21298
|
}
|
|
21312
21299
|
SITEMAP_NUMBER_FIELD_PATTERN.lastIndex = 0;
|
|
21313
|
-
while ((
|
|
21314
|
-
const
|
|
21300
|
+
while ((match = SITEMAP_NUMBER_FIELD_PATTERN.exec(body)) !== null) {
|
|
21301
|
+
const [, rawPriority] = match;
|
|
21302
|
+
if (!rawPriority)
|
|
21303
|
+
continue;
|
|
21304
|
+
const num = parseFloat(rawPriority);
|
|
21315
21305
|
if (!Number.isNaN(num))
|
|
21316
21306
|
out.priority = num;
|
|
21317
21307
|
}
|
|
21318
21308
|
SITEMAP_BOOLEAN_FIELD_PATTERN.lastIndex = 0;
|
|
21319
|
-
while ((
|
|
21320
|
-
|
|
21321
|
-
|
|
21309
|
+
while ((match = SITEMAP_BOOLEAN_FIELD_PATTERN.exec(body)) !== null) {
|
|
21310
|
+
const [, key, value] = match;
|
|
21311
|
+
if (key === "exclude")
|
|
21312
|
+
out.exclude = value === "true";
|
|
21322
21313
|
}
|
|
21323
21314
|
return Object.keys(out).length > 0 ? out : undefined;
|
|
21324
21315
|
}, PAGE_HANDLER_NAMES2, sourceMentionsPageHandler = (source) => PAGE_HANDLER_NAMES2.some((name) => source.includes(name)), routeHandlerSource = (route) => {
|
|
@@ -21455,17 +21446,18 @@ var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").repl
|
|
|
21455
21446
|
wildcardOverrides.set(page.mountPath, page.sitemap);
|
|
21456
21447
|
}
|
|
21457
21448
|
const analyzerJobs = [];
|
|
21458
|
-
|
|
21459
|
-
|
|
21449
|
+
const { angularDirectory, reactDirectory, svelteDirectory, vueDirectory } = pipelineConfig;
|
|
21450
|
+
if (angularDirectory) {
|
|
21451
|
+
analyzerJobs.push(runAnalyzer("Angular", () => analyzeAngularSpaRoutes(angularDirectory)));
|
|
21460
21452
|
}
|
|
21461
|
-
if (
|
|
21462
|
-
analyzerJobs.push(runAnalyzer("React", () => analyzeReactSpaRoutes(
|
|
21453
|
+
if (reactDirectory) {
|
|
21454
|
+
analyzerJobs.push(runAnalyzer("React", () => analyzeReactSpaRoutes(reactDirectory)));
|
|
21463
21455
|
}
|
|
21464
|
-
if (
|
|
21465
|
-
analyzerJobs.push(runAnalyzer("Svelte", () => analyzeSvelteSpaRoutes(
|
|
21456
|
+
if (svelteDirectory) {
|
|
21457
|
+
analyzerJobs.push(runAnalyzer("Svelte", () => analyzeSvelteSpaRoutes(svelteDirectory)));
|
|
21466
21458
|
}
|
|
21467
|
-
if (
|
|
21468
|
-
analyzerJobs.push(runAnalyzer("Vue", () => analyzeVueSpaRoutes(
|
|
21459
|
+
if (vueDirectory) {
|
|
21460
|
+
analyzerJobs.push(runAnalyzer("Vue", () => analyzeVueSpaRoutes(vueDirectory)));
|
|
21469
21461
|
}
|
|
21470
21462
|
const allHosts = (await Promise.all(analyzerJobs)).flat();
|
|
21471
21463
|
const spaEntries = collectFrameworkSpaEntries(allHosts, wildcardOverrides, exclude, seenPaths);
|
|
@@ -21559,7 +21551,14 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
21559
21551
|
if (Buffer.isBuffer(input))
|
|
21560
21552
|
return input;
|
|
21561
21553
|
return Buffer.from(input);
|
|
21562
|
-
}, isUnsupportedFormatError = (err) => typeof err === "object" && err !== null && ("code" in err) && err
|
|
21554
|
+
}, isUnsupportedFormatError = (err) => typeof err === "object" && err !== null && ("code" in err) && Reflect.get(err, "code") === "ERR_IMAGE_FORMAT_UNSUPPORTED", optimizeUnsupportedAvif = async (error, input, width, quality, format) => {
|
|
21555
|
+
if (format !== "avif" || !isUnsupportedFormatError(error))
|
|
21556
|
+
throw error;
|
|
21557
|
+
const sharp = await tryLoadSharp();
|
|
21558
|
+
if (!sharp || !isSharpFactory(sharp))
|
|
21559
|
+
throw error;
|
|
21560
|
+
return optimizeWithSharp(sharp, input, width, quality, format);
|
|
21561
|
+
}, buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`, formatToMime = (format) => MIME_MAP[format], generateBlurSvg = (base64Thumbnail) => {
|
|
21563
21562
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320"><filter id="b" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="${BLUR_DEVIATION}"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 100 -1"/></filter><image filter="url(#b)" x="0" y="0" width="100%" height="100%" href="${base64Thumbnail}"/></svg>`;
|
|
21564
21563
|
const encoded = encodeURIComponent(svg);
|
|
21565
21564
|
return `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -21658,13 +21657,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
21658
21657
|
try {
|
|
21659
21658
|
return await optimizeWithBunImage(input, width, quality, format);
|
|
21660
21659
|
} catch (err) {
|
|
21661
|
-
|
|
21662
|
-
const sharp = await tryLoadSharp();
|
|
21663
|
-
if (sharp && isSharpFactory(sharp)) {
|
|
21664
|
-
return optimizeWithSharp(sharp, input, width, quality, format);
|
|
21665
|
-
}
|
|
21666
|
-
}
|
|
21667
|
-
throw err;
|
|
21660
|
+
return optimizeUnsupportedAvif(err, input, width, quality, format);
|
|
21668
21661
|
}
|
|
21669
21662
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
21670
21663
|
const metaPath = join20(cacheDir, `${cacheKey}.meta`);
|
|
@@ -22430,7 +22423,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
22430
22423
|
TOP_LEVEL_DECL_RE.lastIndex = 0;
|
|
22431
22424
|
let declMatch;
|
|
22432
22425
|
while ((declMatch = TOP_LEVEL_DECL_RE.exec(jsSource)) !== null) {
|
|
22433
|
-
const name = declMatch
|
|
22426
|
+
const [, name] = declMatch;
|
|
22434
22427
|
if (name)
|
|
22435
22428
|
names.add(name);
|
|
22436
22429
|
}
|
|
@@ -22575,7 +22568,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
22575
22568
|
let match;
|
|
22576
22569
|
const re2 = new RegExp(ENTITY_DECORATOR_RE.source, ENTITY_DECORATOR_RE.flags);
|
|
22577
22570
|
while ((match = re2.exec(jsSource)) !== null) {
|
|
22578
|
-
const className = match
|
|
22571
|
+
const [, className] = match;
|
|
22579
22572
|
if (className && !seen.has(className)) {
|
|
22580
22573
|
seen.add(className);
|
|
22581
22574
|
classNames.push(className);
|
|
@@ -22657,8 +22650,12 @@ var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), clea
|
|
|
22657
22650
|
if (!skipGenerated) {
|
|
22658
22651
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
22659
22652
|
}
|
|
22660
|
-
if (frameworkDir)
|
|
22661
|
-
|
|
22653
|
+
if (!frameworkDir)
|
|
22654
|
+
return Promise.all(tasks);
|
|
22655
|
+
tasks.push(removeIfExists(join26(frameworkDir, "generated")));
|
|
22656
|
+
if (framework === "angular") {
|
|
22657
|
+
tasks.push(removeIfExists(join26(frameworkDir, "compiled")), removeIfExists(join26(frameworkDir, "indexes")));
|
|
22658
|
+
}
|
|
22662
22659
|
return Promise.all(tasks);
|
|
22663
22660
|
}, cleanup = async ({
|
|
22664
22661
|
angularDir,
|
|
@@ -22723,7 +22720,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
22723
22720
|
releaseAllSync();
|
|
22724
22721
|
throw err;
|
|
22725
22722
|
});
|
|
22726
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error
|
|
22723
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join27(dirname14(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
22727
22724
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
22728
22725
|
if (locks.size === 0) {
|
|
22729
22726
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -22760,7 +22757,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
22760
22757
|
process.kill(pid, 0);
|
|
22761
22758
|
return true;
|
|
22762
22759
|
} catch (err) {
|
|
22763
|
-
const
|
|
22760
|
+
const code = typeof err === "object" && err !== null ? Reflect.get(err, "code") : undefined;
|
|
22764
22761
|
if (code === "ESRCH")
|
|
22765
22762
|
return false;
|
|
22766
22763
|
if (code === "EPERM")
|
|
@@ -22823,7 +22820,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
22823
22820
|
}
|
|
22824
22821
|
const portInfo = existing.port ? ` on port ${existing.port}` : "";
|
|
22825
22822
|
const elapsedNote = wait ? ` Waited ${Math.round((Date.now() - start) / 1000)}s.` : "";
|
|
22826
|
-
throw new Error(`AbsoluteJS build lock is held by PID ${existing.pid}${portInfo} (started ${existing.startedAt}).${elapsedNote} ` + `Another process owns ${buildDirectory}. ` + `Run \`kill ${existing.pid}\` (or wait for it to finish) and try again
|
|
22823
|
+
throw new Error(`AbsoluteJS build lock is held by PID ${existing.pid}${portInfo} (started ${existing.startedAt}).${elapsedNote} ` + `Another process owns ${buildDirectory}. ` + `Run \`kill ${existing.pid}\` (or wait for it to finish) and try again.`, { cause: error });
|
|
22827
22824
|
}
|
|
22828
22825
|
}
|
|
22829
22826
|
const releaseSync = () => {
|
|
@@ -22872,6 +22869,12 @@ var validateSafePath = (targetPath, baseDirectory) => {
|
|
|
22872
22869
|
};
|
|
22873
22870
|
var init_validateSafePath = () => {};
|
|
22874
22871
|
|
|
22872
|
+
// src/utils/isTestSourcePath.ts
|
|
22873
|
+
var isTestSourcePath = (file2) => {
|
|
22874
|
+
const normalized = file2.replace(/\\/g, "/");
|
|
22875
|
+
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
22876
|
+
};
|
|
22877
|
+
|
|
22875
22878
|
// src/build/scanVueSsrOnlyPages.ts
|
|
22876
22879
|
var exports_scanVueSsrOnlyPages = {};
|
|
22877
22880
|
__export(exports_scanVueSsrOnlyPages, {
|
|
@@ -23027,7 +23030,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
23027
23030
|
import { readdirSync as readdirSync3, readFileSync as readFileSync18 } from "fs";
|
|
23028
23031
|
import { join as join29 } from "path";
|
|
23029
23032
|
import ts8 from "typescript";
|
|
23030
|
-
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
23033
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind3 = (filePath) => {
|
|
23031
23034
|
if (filePath.endsWith(".tsx"))
|
|
23032
23035
|
return ts8.ScriptKind.TSX;
|
|
23033
23036
|
return ts8.ScriptKind.TS;
|
|
@@ -23059,7 +23062,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
23059
23062
|
if (entry.name.startsWith("."))
|
|
23060
23063
|
continue;
|
|
23061
23064
|
stack.push(join29(dir, entry.name));
|
|
23062
|
-
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
23065
|
+
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
23063
23066
|
out.push(join29(dir, entry.name));
|
|
23064
23067
|
}
|
|
23065
23068
|
}
|
|
@@ -26675,11 +26678,11 @@ var init_compileAngular = __esm(() => {
|
|
|
26675
26678
|
import ts13 from "typescript";
|
|
26676
26679
|
var createHmrImportGenerator = (namespaceMap) => ({
|
|
26677
26680
|
addImport(request) {
|
|
26678
|
-
const
|
|
26679
|
-
if (!
|
|
26681
|
+
const namespace = namespaceMap.get(request.exportModuleSpecifier);
|
|
26682
|
+
if (!namespace) {
|
|
26680
26683
|
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
26681
26684
|
}
|
|
26682
|
-
const namespaceId = ts13.factory.createIdentifier(
|
|
26685
|
+
const namespaceId = ts13.factory.createIdentifier(namespace);
|
|
26683
26686
|
if (request.exportSymbolName === null) {
|
|
26684
26687
|
return namespaceId;
|
|
26685
26688
|
}
|
|
@@ -27393,75 +27396,87 @@ import { existsSync as existsSync27, readFileSync as readFileSync24, statSync as
|
|
|
27393
27396
|
import { dirname as dirname19, extname as extname7, relative as relative14, resolve as resolve26 } from "path";
|
|
27394
27397
|
import ts16 from "typescript";
|
|
27395
27398
|
var fail = (reason, detail, location) => ({
|
|
27399
|
+
detail,
|
|
27396
27400
|
ok: false,
|
|
27397
27401
|
reason,
|
|
27398
|
-
detail,
|
|
27399
27402
|
...location ?? {}
|
|
27400
|
-
}), fingerprintCache, pendingModuleCache,
|
|
27403
|
+
}), fingerprintCache, pendingModuleCache, ANGULAR_DECORATOR_NAMES, findAngularDecoratorName = (decorators) => {
|
|
27404
|
+
for (const decorator of decorators) {
|
|
27405
|
+
if (!ts16.isCallExpression(decorator.expression))
|
|
27406
|
+
continue;
|
|
27407
|
+
const { expression } = decorator.expression;
|
|
27408
|
+
if (!ts16.isIdentifier(expression))
|
|
27409
|
+
continue;
|
|
27410
|
+
if (ANGULAR_DECORATOR_NAMES.has(expression.text)) {
|
|
27411
|
+
return expression.text;
|
|
27412
|
+
}
|
|
27413
|
+
}
|
|
27414
|
+
return null;
|
|
27415
|
+
}, takePendingModule = (id) => {
|
|
27401
27416
|
const cached2 = pendingModuleCache.get(id);
|
|
27402
27417
|
if (cached2 !== undefined)
|
|
27403
27418
|
pendingModuleCache.delete(id);
|
|
27404
27419
|
return cached2;
|
|
27405
27420
|
}, setPendingModule = (id, moduleText) => {
|
|
27406
27421
|
pendingModuleCache.set(id, moduleText);
|
|
27407
|
-
}, arraysEqual = (a,
|
|
27408
|
-
if (a.length !==
|
|
27422
|
+
}, arraysEqual = (a, rightValue) => {
|
|
27423
|
+
if (a.length !== rightValue.length)
|
|
27409
27424
|
return false;
|
|
27410
|
-
for (let
|
|
27411
|
-
if (a[
|
|
27425
|
+
for (let index = 0;index < a.length; index++) {
|
|
27426
|
+
if (a[index] !== rightValue[index])
|
|
27412
27427
|
return false;
|
|
27413
27428
|
}
|
|
27414
27429
|
return true;
|
|
27415
|
-
}, fingerprintsEqual = (
|
|
27416
|
-
if (
|
|
27430
|
+
}, fingerprintsEqual = (leftValue, rightValue) => {
|
|
27431
|
+
if (leftValue.className !== rightValue.className)
|
|
27417
27432
|
return false;
|
|
27418
|
-
if (
|
|
27433
|
+
if (leftValue.selector !== rightValue.selector)
|
|
27419
27434
|
return false;
|
|
27420
|
-
if (
|
|
27435
|
+
if (leftValue.standalone !== rightValue.standalone)
|
|
27421
27436
|
return false;
|
|
27422
|
-
if (
|
|
27437
|
+
if (leftValue.hasProviders !== rightValue.hasProviders)
|
|
27423
27438
|
return false;
|
|
27424
|
-
if (
|
|
27439
|
+
if (leftValue.hasViewProviders !== rightValue.hasViewProviders)
|
|
27425
27440
|
return false;
|
|
27426
|
-
if (!arraysEqual(
|
|
27441
|
+
if (!arraysEqual(leftValue.ctorParamTypes, rightValue.ctorParamTypes))
|
|
27427
27442
|
return false;
|
|
27428
|
-
if (!arraysEqual(
|
|
27443
|
+
if (!arraysEqual(leftValue.inputs, rightValue.inputs))
|
|
27429
27444
|
return false;
|
|
27430
|
-
if (!arraysEqual(
|
|
27445
|
+
if (!arraysEqual(leftValue.outputs, rightValue.outputs))
|
|
27431
27446
|
return false;
|
|
27432
|
-
if (!arraysEqual(
|
|
27447
|
+
if (!arraysEqual(leftValue.providerImportSig, rightValue.providerImportSig))
|
|
27433
27448
|
return false;
|
|
27434
|
-
if (!arraysEqual(
|
|
27449
|
+
if (!arraysEqual(leftValue.arrowFieldSig, rightValue.arrowFieldSig))
|
|
27435
27450
|
return false;
|
|
27436
|
-
if (!arraysEqual(
|
|
27451
|
+
if (!arraysEqual(leftValue.memberDecoratorSig, rightValue.memberDecoratorSig))
|
|
27437
27452
|
return false;
|
|
27438
|
-
if (!arraysEqual(
|
|
27453
|
+
if (!arraysEqual(leftValue.topLevelImports, rightValue.topLevelImports))
|
|
27439
27454
|
return false;
|
|
27440
|
-
if (!arraysEqual(
|
|
27455
|
+
if (!arraysEqual(leftValue.propertyFieldNames, rightValue.propertyFieldNames))
|
|
27441
27456
|
return false;
|
|
27442
|
-
if (
|
|
27457
|
+
if (leftValue.encapsulation !== rightValue.encapsulation)
|
|
27443
27458
|
return false;
|
|
27444
|
-
if (
|
|
27459
|
+
if (leftValue.changeDetection !== rightValue.changeDetection)
|
|
27445
27460
|
return false;
|
|
27446
|
-
if (
|
|
27461
|
+
if (leftValue.importsArraySig !== rightValue.importsArraySig)
|
|
27447
27462
|
return false;
|
|
27448
|
-
if (
|
|
27463
|
+
if (leftValue.hostDirectivesSig !== rightValue.hostDirectivesSig)
|
|
27449
27464
|
return false;
|
|
27450
|
-
if (
|
|
27465
|
+
if (leftValue.animationsArraySig !== rightValue.animationsArraySig)
|
|
27451
27466
|
return false;
|
|
27452
|
-
if (
|
|
27467
|
+
if (leftValue.providersArraySig !== rightValue.providersArraySig)
|
|
27453
27468
|
return false;
|
|
27454
|
-
if (
|
|
27469
|
+
if (leftValue.viewProvidersArraySig !== rightValue.viewProvidersArraySig)
|
|
27455
27470
|
return false;
|
|
27456
|
-
if (
|
|
27471
|
+
if (leftValue.decoratorInputsArraySig !== rightValue.decoratorInputsArraySig)
|
|
27457
27472
|
return false;
|
|
27458
|
-
if (
|
|
27473
|
+
if (leftValue.decoratorOutputsArraySig !== rightValue.decoratorOutputsArraySig)
|
|
27459
27474
|
return false;
|
|
27460
|
-
if (
|
|
27475
|
+
if (leftValue.hostBindingsSig !== rightValue.hostBindingsSig)
|
|
27461
27476
|
return false;
|
|
27462
|
-
if (
|
|
27477
|
+
if (leftValue.pageExportsSig !== rightValue.pageExportsSig)
|
|
27463
27478
|
return false;
|
|
27464
|
-
if (
|
|
27479
|
+
if (leftValue.schemasSig !== rightValue.schemasSig)
|
|
27465
27480
|
return false;
|
|
27466
27481
|
return true;
|
|
27467
27482
|
}, invalidateFingerprintCache = () => {
|
|
@@ -27487,19 +27502,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27487
27502
|
if (!className)
|
|
27488
27503
|
continue;
|
|
27489
27504
|
const decorators = ts16.getDecorators(stmt) ?? [];
|
|
27490
|
-
const decoratorName = (
|
|
27491
|
-
for (const d2 of decorators) {
|
|
27492
|
-
if (!ts16.isCallExpression(d2.expression))
|
|
27493
|
-
continue;
|
|
27494
|
-
const expr = d2.expression.expression;
|
|
27495
|
-
if (!ts16.isIdentifier(expr))
|
|
27496
|
-
continue;
|
|
27497
|
-
if (expr.text === "Component" || expr.text === "Directive" || expr.text === "Pipe" || expr.text === "Injectable") {
|
|
27498
|
-
return expr.text;
|
|
27499
|
-
}
|
|
27500
|
-
}
|
|
27501
|
-
return null;
|
|
27502
|
-
})();
|
|
27505
|
+
const decoratorName = findAngularDecoratorName(decorators);
|
|
27503
27506
|
if (!decoratorName)
|
|
27504
27507
|
continue;
|
|
27505
27508
|
const projectRel = relative14(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
@@ -27513,8 +27516,9 @@ var fail = (reason, detail, location) => ({
|
|
|
27513
27516
|
});
|
|
27514
27517
|
if (!componentDecorator)
|
|
27515
27518
|
continue;
|
|
27516
|
-
|
|
27517
|
-
|
|
27519
|
+
if (!ts16.isCallExpression(componentDecorator.expression))
|
|
27520
|
+
continue;
|
|
27521
|
+
const [args] = componentDecorator.expression.arguments;
|
|
27518
27522
|
if (!args || !ts16.isObjectLiteralExpression(args))
|
|
27519
27523
|
continue;
|
|
27520
27524
|
const decoratorMeta = readDecoratorMeta(args);
|
|
@@ -27529,22 +27533,22 @@ var fail = (reason, detail, location) => ({
|
|
|
27529
27533
|
} catch {}
|
|
27530
27534
|
}
|
|
27531
27535
|
}
|
|
27532
|
-
}, recordFingerprint = (id,
|
|
27533
|
-
fingerprintCache.set(id,
|
|
27534
|
-
}, entityFingerprintCache, entityFingerprintsEqual = (
|
|
27535
|
-
if (
|
|
27536
|
+
}, recordFingerprint = (id, fingerprint) => {
|
|
27537
|
+
fingerprintCache.set(id, fingerprint);
|
|
27538
|
+
}, entityFingerprintCache, entityFingerprintsEqual = (leftValue, rightValue) => {
|
|
27539
|
+
if (leftValue.className !== rightValue.className)
|
|
27536
27540
|
return false;
|
|
27537
|
-
if (
|
|
27541
|
+
if (leftValue.decoratorArgsText !== rightValue.decoratorArgsText)
|
|
27538
27542
|
return false;
|
|
27539
|
-
if (!arraysEqual(
|
|
27543
|
+
if (!arraysEqual(leftValue.ctorParamTypes, rightValue.ctorParamTypes))
|
|
27540
27544
|
return false;
|
|
27541
|
-
if (!arraysEqual(
|
|
27545
|
+
if (!arraysEqual(leftValue.topLevelImports, rightValue.topLevelImports))
|
|
27542
27546
|
return false;
|
|
27543
|
-
if (!arraysEqual(
|
|
27547
|
+
if (!arraysEqual(leftValue.memberDecoratorSig, rightValue.memberDecoratorSig))
|
|
27544
27548
|
return false;
|
|
27545
|
-
if (!arraysEqual(
|
|
27549
|
+
if (!arraysEqual(leftValue.arrowFieldSig, rightValue.arrowFieldSig))
|
|
27546
27550
|
return false;
|
|
27547
|
-
if (!arraysEqual(
|
|
27551
|
+
if (!arraysEqual(leftValue.propertyFieldNames, rightValue.propertyFieldNames))
|
|
27548
27552
|
return false;
|
|
27549
27553
|
return true;
|
|
27550
27554
|
}, ENTITY_DECORATOR_NAMES, findEntityDecorator = (cls) => {
|
|
@@ -27562,8 +27566,18 @@ var fail = (reason, detail, location) => ({
|
|
|
27562
27566
|
const decorator = findEntityDecorator(cls);
|
|
27563
27567
|
let decoratorArgsText = "";
|
|
27564
27568
|
if (decorator !== null) {
|
|
27565
|
-
|
|
27566
|
-
|
|
27569
|
+
if (!ts16.isCallExpression(decorator.expression)) {
|
|
27570
|
+
return {
|
|
27571
|
+
arrowFieldSig: extractArrowFieldSig(cls),
|
|
27572
|
+
className,
|
|
27573
|
+
ctorParamTypes: [],
|
|
27574
|
+
decoratorArgsText,
|
|
27575
|
+
memberDecoratorSig: extractMemberDecoratorSig(cls),
|
|
27576
|
+
propertyFieldNames: extractPropertyFieldNames(cls),
|
|
27577
|
+
topLevelImports: extractTopLevelImports(sourceFile)
|
|
27578
|
+
};
|
|
27579
|
+
}
|
|
27580
|
+
const [arg] = decorator.expression.arguments;
|
|
27567
27581
|
if (arg !== undefined) {
|
|
27568
27582
|
decoratorArgsText = arg.getText().replace(/\s+/g, " ").trim();
|
|
27569
27583
|
}
|
|
@@ -27618,8 +27632,8 @@ var fail = (reason, detail, location) => ({
|
|
|
27618
27632
|
for (const decorator of getClassDecorators(cls)) {
|
|
27619
27633
|
const expr = decorator.expression;
|
|
27620
27634
|
if (ts16.isCallExpression(expr)) {
|
|
27621
|
-
const
|
|
27622
|
-
if (ts16.isIdentifier(
|
|
27635
|
+
const functionNode = expr.expression;
|
|
27636
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "Component") {
|
|
27623
27637
|
return decorator;
|
|
27624
27638
|
}
|
|
27625
27639
|
}
|
|
@@ -27629,7 +27643,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27629
27643
|
const call = decorator.expression;
|
|
27630
27644
|
if (!ts16.isCallExpression(call))
|
|
27631
27645
|
return null;
|
|
27632
|
-
const arg = call.arguments
|
|
27646
|
+
const [arg] = call.arguments;
|
|
27633
27647
|
if (!arg || !ts16.isObjectLiteralExpression(arg))
|
|
27634
27648
|
return null;
|
|
27635
27649
|
return arg;
|
|
@@ -27665,14 +27679,14 @@ var fail = (reason, detail, location) => ({
|
|
|
27665
27679
|
}
|
|
27666
27680
|
}
|
|
27667
27681
|
return false;
|
|
27668
|
-
}, findClassInSourceFile = (
|
|
27669
|
-
for (const stmt of
|
|
27682
|
+
}, findClassInSourceFile = (sourceFile, className) => {
|
|
27683
|
+
for (const stmt of sourceFile.statements) {
|
|
27670
27684
|
if (ts16.isClassDeclaration(stmt) && stmt.name?.text === className) {
|
|
27671
27685
|
return stmt;
|
|
27672
27686
|
}
|
|
27673
27687
|
}
|
|
27674
27688
|
return null;
|
|
27675
|
-
}, parentHasAngularDecoratorAcrossFiles = (parentClassName, sourceFile, componentDir,
|
|
27689
|
+
}, parentHasAngularDecoratorAcrossFiles = (parentClassName, sourceFile, componentDir, _projectRoot) => {
|
|
27676
27690
|
const sameFile = findClassInSourceFile(sourceFile, parentClassName);
|
|
27677
27691
|
if (sameFile)
|
|
27678
27692
|
return classHasAngularDecorator(sameFile);
|
|
@@ -27687,7 +27701,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27687
27701
|
const named = clause.namedBindings;
|
|
27688
27702
|
if (!named || !ts16.isNamedImports(named))
|
|
27689
27703
|
continue;
|
|
27690
|
-
const found = named.elements.find((
|
|
27704
|
+
const found = named.elements.find((element) => element.name.text === parentClassName);
|
|
27691
27705
|
if (!found)
|
|
27692
27706
|
continue;
|
|
27693
27707
|
const spec = stmt.moduleSpecifier.text;
|
|
@@ -27739,7 +27753,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27739
27753
|
for (const member of cls.members) {
|
|
27740
27754
|
if (!ts16.isMethodDeclaration(member))
|
|
27741
27755
|
continue;
|
|
27742
|
-
if (member.modifiers?.some((
|
|
27756
|
+
if (member.modifiers?.some((item) => item.kind === ts16.SyntaxKind.StaticKeyword))
|
|
27743
27757
|
continue;
|
|
27744
27758
|
const { name } = member;
|
|
27745
27759
|
if (name === undefined)
|
|
@@ -27747,7 +27761,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27747
27761
|
const nameText = ts16.isIdentifier(name) ? name.text : name.getText();
|
|
27748
27762
|
if (nameText !== CONTROL_CREATE_METHOD_NAME)
|
|
27749
27763
|
continue;
|
|
27750
|
-
const firstParam = member.parameters
|
|
27764
|
+
const [firstParam] = member.parameters;
|
|
27751
27765
|
if (firstParam === undefined || firstParam.type === undefined || !ts16.isTypeReferenceNode(firstParam.type)) {
|
|
27752
27766
|
return { passThroughInput: null };
|
|
27753
27767
|
}
|
|
@@ -27755,7 +27769,7 @@ var fail = (reason, detail, location) => ({
|
|
|
27755
27769
|
if (typeArgs === undefined || typeArgs.length !== 1) {
|
|
27756
27770
|
return { passThroughInput: null };
|
|
27757
27771
|
}
|
|
27758
|
-
const arg = typeArgs
|
|
27772
|
+
const [arg] = typeArgs;
|
|
27759
27773
|
if (arg === undefined || !ts16.isLiteralTypeNode(arg) || !ts16.isStringLiteral(arg.literal)) {
|
|
27760
27774
|
return { passThroughInput: null };
|
|
27761
27775
|
}
|
|
@@ -27785,17 +27799,17 @@ var fail = (reason, detail, location) => ({
|
|
|
27785
27799
|
const schemasExpr = getProperty(args, "schemas");
|
|
27786
27800
|
const styleUrls = [];
|
|
27787
27801
|
if (styleUrlsExpr && ts16.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
27788
|
-
for (const
|
|
27789
|
-
if (ts16.isStringLiteral(
|
|
27790
|
-
styleUrls.push(
|
|
27802
|
+
for (const element of styleUrlsExpr.elements) {
|
|
27803
|
+
if (ts16.isStringLiteral(element))
|
|
27804
|
+
styleUrls.push(element.text);
|
|
27791
27805
|
}
|
|
27792
27806
|
}
|
|
27793
27807
|
const styles = [];
|
|
27794
27808
|
if (stylesExpr) {
|
|
27795
27809
|
if (ts16.isArrayLiteralExpression(stylesExpr)) {
|
|
27796
|
-
for (const
|
|
27797
|
-
if (ts16.isStringLiteral(
|
|
27798
|
-
styles.push(
|
|
27810
|
+
for (const element of stylesExpr.elements) {
|
|
27811
|
+
if (ts16.isStringLiteral(element) || ts16.isNoSubstitutionTemplateLiteral(element)) {
|
|
27812
|
+
styles.push(element.text);
|
|
27799
27813
|
}
|
|
27800
27814
|
}
|
|
27801
27815
|
} else if (ts16.isStringLiteral(stylesExpr) || ts16.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
@@ -27807,27 +27821,27 @@ var fail = (reason, detail, location) => ({
|
|
|
27807
27821
|
const changeDetectionExpr = getProperty(args, "changeDetection");
|
|
27808
27822
|
const changeDetection = changeDetectionExpr ? resolveEnumPropertyAccess(changeDetectionExpr, "ChangeDetectionStrategy", CHANGE_DETECTION_VALUES) : null;
|
|
27809
27823
|
return {
|
|
27824
|
+
animationsExpr: animationsExpr && ts16.isArrayLiteralExpression(animationsExpr) ? animationsExpr : null,
|
|
27810
27825
|
changeDetection,
|
|
27811
27826
|
encapsulation,
|
|
27812
27827
|
hasProviders: getProperty(args, "providers") !== null,
|
|
27813
27828
|
hasViewProviders: getProperty(args, "viewProviders") !== null,
|
|
27814
|
-
importsExpr: importsExpr && ts16.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
27815
27829
|
hostDirectivesExpr: hostDirectivesExpr && ts16.isArrayLiteralExpression(hostDirectivesExpr) ? hostDirectivesExpr : null,
|
|
27816
|
-
|
|
27817
|
-
|
|
27818
|
-
viewProvidersExpr: viewProvidersExpr && ts16.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null,
|
|
27830
|
+
hostExpr: hostExpr && ts16.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
27831
|
+
importsExpr: importsExpr && ts16.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
27819
27832
|
inputsArrayExpr: inputsArrayExpr && ts16.isArrayLiteralExpression(inputsArrayExpr) ? inputsArrayExpr : null,
|
|
27820
27833
|
outputsArrayExpr: outputsArrayExpr && ts16.isArrayLiteralExpression(outputsArrayExpr) ? outputsArrayExpr : null,
|
|
27821
|
-
hostExpr: hostExpr && ts16.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
27822
|
-
schemasExpr: schemasExpr && ts16.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
27823
27834
|
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? projectDefaults.preserveWhitespaces ?? false,
|
|
27835
|
+
providersExpr: providersExpr && ts16.isArrayLiteralExpression(providersExpr) ? providersExpr : null,
|
|
27836
|
+
schemasExpr: schemasExpr && ts16.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
27824
27837
|
selector: getStringProperty(args, "selector"),
|
|
27825
27838
|
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
27839
|
+
styles,
|
|
27826
27840
|
styleUrl: getStringProperty(args, "styleUrl"),
|
|
27827
27841
|
styleUrls,
|
|
27828
|
-
styles,
|
|
27829
27842
|
template: getStringProperty(args, "template"),
|
|
27830
|
-
templateUrl: getStringProperty(args, "templateUrl")
|
|
27843
|
+
templateUrl: getStringProperty(args, "templateUrl"),
|
|
27844
|
+
viewProvidersExpr: viewProvidersExpr && ts16.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null
|
|
27831
27845
|
};
|
|
27832
27846
|
}, extractDecoratorInput = (prop, compiler) => {
|
|
27833
27847
|
const decorators = ts16.getDecorators(prop) ?? [];
|
|
@@ -27835,14 +27849,14 @@ var fail = (reason, detail, location) => ({
|
|
|
27835
27849
|
const expr = decorator.expression;
|
|
27836
27850
|
if (!ts16.isCallExpression(expr))
|
|
27837
27851
|
continue;
|
|
27838
|
-
const
|
|
27839
|
-
if (!ts16.isIdentifier(
|
|
27852
|
+
const functionNode = expr.expression;
|
|
27853
|
+
if (!ts16.isIdentifier(functionNode) || functionNode.text !== "Input")
|
|
27840
27854
|
continue;
|
|
27841
27855
|
const classPropertyName = prop.name.getText();
|
|
27842
27856
|
let bindingPropertyName = classPropertyName;
|
|
27843
27857
|
let required2 = false;
|
|
27844
27858
|
let transformFunction = null;
|
|
27845
|
-
const arg = expr.arguments
|
|
27859
|
+
const [arg] = expr.arguments;
|
|
27846
27860
|
if (arg) {
|
|
27847
27861
|
if (ts16.isStringLiteral(arg)) {
|
|
27848
27862
|
bindingPropertyName = arg.text;
|
|
@@ -27871,10 +27885,10 @@ var fail = (reason, detail, location) => ({
|
|
|
27871
27885
|
return null;
|
|
27872
27886
|
}, isInputSignalCall = (init) => {
|
|
27873
27887
|
if (ts16.isCallExpression(init)) {
|
|
27874
|
-
const
|
|
27875
|
-
if (ts16.isIdentifier(
|
|
27888
|
+
const functionNode = init.expression;
|
|
27889
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "input")
|
|
27876
27890
|
return true;
|
|
27877
|
-
if (ts16.isPropertyAccessExpression(
|
|
27891
|
+
if (ts16.isPropertyAccessExpression(functionNode) && ts16.isIdentifier(functionNode.expression) && functionNode.expression.text === "input") {
|
|
27878
27892
|
return true;
|
|
27879
27893
|
}
|
|
27880
27894
|
}
|
|
@@ -27882,6 +27896,8 @@ var fail = (reason, detail, location) => ({
|
|
|
27882
27896
|
}, extractSignalInput = (prop, compiler) => {
|
|
27883
27897
|
if (!prop.initializer || !isInputSignalCall(prop.initializer))
|
|
27884
27898
|
return null;
|
|
27899
|
+
if (!ts16.isCallExpression(prop.initializer))
|
|
27900
|
+
return null;
|
|
27885
27901
|
const classPropertyName = prop.name.getText();
|
|
27886
27902
|
const call = prop.initializer;
|
|
27887
27903
|
let required2 = false;
|
|
@@ -27916,12 +27932,12 @@ var fail = (reason, detail, location) => ({
|
|
|
27916
27932
|
const expr = decorator.expression;
|
|
27917
27933
|
if (!ts16.isCallExpression(expr))
|
|
27918
27934
|
continue;
|
|
27919
|
-
const
|
|
27920
|
-
if (!ts16.isIdentifier(
|
|
27935
|
+
const functionNode = expr.expression;
|
|
27936
|
+
if (!ts16.isIdentifier(functionNode) || functionNode.text !== "Output")
|
|
27921
27937
|
continue;
|
|
27922
27938
|
const classPropertyName = prop.name.getText();
|
|
27923
27939
|
let bindingName = classPropertyName;
|
|
27924
|
-
const arg = expr.arguments
|
|
27940
|
+
const [arg] = expr.arguments;
|
|
27925
27941
|
if (arg && ts16.isStringLiteral(arg))
|
|
27926
27942
|
bindingName = arg.text;
|
|
27927
27943
|
return { bindingName, classPropertyName };
|
|
@@ -27929,10 +27945,10 @@ var fail = (reason, detail, location) => ({
|
|
|
27929
27945
|
return null;
|
|
27930
27946
|
}, isOutputSignalCall = (init) => {
|
|
27931
27947
|
if (ts16.isCallExpression(init)) {
|
|
27932
|
-
const
|
|
27933
|
-
if (ts16.isIdentifier(
|
|
27948
|
+
const functionNode = init.expression;
|
|
27949
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "output")
|
|
27934
27950
|
return true;
|
|
27935
|
-
if (ts16.isPropertyAccessExpression(
|
|
27951
|
+
if (ts16.isPropertyAccessExpression(functionNode) && ts16.isIdentifier(functionNode.expression) && functionNode.expression.text === "output") {
|
|
27936
27952
|
return true;
|
|
27937
27953
|
}
|
|
27938
27954
|
}
|
|
@@ -27940,10 +27956,12 @@ var fail = (reason, detail, location) => ({
|
|
|
27940
27956
|
}, extractSignalOutput = (prop) => {
|
|
27941
27957
|
if (!prop.initializer || !isOutputSignalCall(prop.initializer))
|
|
27942
27958
|
return null;
|
|
27959
|
+
if (!ts16.isCallExpression(prop.initializer))
|
|
27960
|
+
return null;
|
|
27943
27961
|
const classPropertyName = prop.name.getText();
|
|
27944
27962
|
const call = prop.initializer;
|
|
27945
27963
|
let bindingName = classPropertyName;
|
|
27946
|
-
const optsArg = call.arguments
|
|
27964
|
+
const [optsArg] = call.arguments;
|
|
27947
27965
|
if (optsArg && ts16.isObjectLiteralExpression(optsArg)) {
|
|
27948
27966
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
27949
27967
|
if (aliasNode !== null)
|
|
@@ -28028,30 +28046,33 @@ var fail = (reason, detail, location) => ({
|
|
|
28028
28046
|
const expr = dec.expression;
|
|
28029
28047
|
if (!ts16.isCallExpression(expr))
|
|
28030
28048
|
continue;
|
|
28031
|
-
const
|
|
28032
|
-
if (!ts16.isIdentifier(
|
|
28049
|
+
const functionNode = expr.expression;
|
|
28050
|
+
if (!ts16.isIdentifier(functionNode))
|
|
28033
28051
|
continue;
|
|
28034
|
-
if (
|
|
28052
|
+
if (functionNode.text === "HostBinding") {
|
|
28035
28053
|
if (!ts16.isPropertyDeclaration(member) && !ts16.isGetAccessor(member))
|
|
28036
28054
|
continue;
|
|
28055
|
+
if (!ts16.isIdentifier(member.name))
|
|
28056
|
+
continue;
|
|
28037
28057
|
const propertyName2 = member.name.text;
|
|
28038
|
-
const target = expr.arguments
|
|
28058
|
+
const [target] = expr.arguments;
|
|
28039
28059
|
const key = target && ts16.isStringLiteral(target) ? target.text : propertyName2;
|
|
28040
28060
|
host.properties[key] = propertyName2;
|
|
28041
|
-
} else if (
|
|
28061
|
+
} else if (functionNode.text === "HostListener") {
|
|
28042
28062
|
if (!ts16.isMethodDeclaration(member))
|
|
28043
28063
|
continue;
|
|
28064
|
+
if (!ts16.isIdentifier(member.name))
|
|
28065
|
+
continue;
|
|
28044
28066
|
const methodName = member.name.text;
|
|
28045
|
-
const eventArg = expr.arguments
|
|
28067
|
+
const [eventArg, argsArg] = expr.arguments;
|
|
28046
28068
|
if (!eventArg || !ts16.isStringLiteral(eventArg))
|
|
28047
28069
|
continue;
|
|
28048
28070
|
const event = eventArg.text;
|
|
28049
|
-
const argsArg = expr.arguments[1];
|
|
28050
28071
|
const argsList = [];
|
|
28051
28072
|
if (argsArg && ts16.isArrayLiteralExpression(argsArg)) {
|
|
28052
|
-
for (const
|
|
28053
|
-
if (ts16.isStringLiteral(
|
|
28054
|
-
argsList.push(
|
|
28073
|
+
for (const element of argsArg.elements) {
|
|
28074
|
+
if (ts16.isStringLiteral(element))
|
|
28075
|
+
argsList.push(element.text);
|
|
28055
28076
|
}
|
|
28056
28077
|
}
|
|
28057
28078
|
host.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
@@ -28062,7 +28083,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28062
28083
|
let static_ = false;
|
|
28063
28084
|
let descendants = true;
|
|
28064
28085
|
let emitDistinctChangesOnly = true;
|
|
28065
|
-
const opts = args
|
|
28086
|
+
const [, opts] = args;
|
|
28066
28087
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
28067
28088
|
static_ = getBooleanProperty(opts, "static") ?? false;
|
|
28068
28089
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
@@ -28071,7 +28092,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28071
28092
|
return { descendants, emitDistinctChangesOnly, static_ };
|
|
28072
28093
|
}, queryPredicateFromArg = (arg, compiler) => {
|
|
28073
28094
|
if (ts16.isStringLiteral(arg)) {
|
|
28074
|
-
return arg.text.split(",").map((
|
|
28095
|
+
return arg.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
28075
28096
|
}
|
|
28076
28097
|
return {
|
|
28077
28098
|
expression: new compiler.WrappedNodeExpr(arg),
|
|
@@ -28088,18 +28109,19 @@ var fail = (reason, detail, location) => ({
|
|
|
28088
28109
|
const expr = dec.expression;
|
|
28089
28110
|
if (!ts16.isCallExpression(expr))
|
|
28090
28111
|
continue;
|
|
28091
|
-
const
|
|
28092
|
-
if (!ts16.isIdentifier(
|
|
28112
|
+
const functionNode = expr.expression;
|
|
28113
|
+
if (!ts16.isIdentifier(functionNode) || !QUERY_DECORATORS.has(functionNode.text))
|
|
28114
|
+
continue;
|
|
28115
|
+
if (!ts16.isIdentifier(member.name))
|
|
28093
28116
|
continue;
|
|
28094
28117
|
const propertyName2 = member.name.text;
|
|
28095
|
-
const tokenArg = expr.arguments
|
|
28118
|
+
const [tokenArg, opts] = expr.arguments;
|
|
28096
28119
|
if (!tokenArg)
|
|
28097
28120
|
continue;
|
|
28098
28121
|
const predicate = queryPredicateFromArg(tokenArg, compiler);
|
|
28099
28122
|
if (!predicate)
|
|
28100
28123
|
continue;
|
|
28101
28124
|
const { static_, descendants, emitDistinctChangesOnly } = parseQueryDecoratorOptions(expr.arguments);
|
|
28102
|
-
const opts = expr.arguments[1];
|
|
28103
28125
|
let read = null;
|
|
28104
28126
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
28105
28127
|
const readNode = getProperty(opts, "read");
|
|
@@ -28110,14 +28132,14 @@ var fail = (reason, detail, location) => ({
|
|
|
28110
28132
|
const meta = {
|
|
28111
28133
|
descendants,
|
|
28112
28134
|
emitDistinctChangesOnly,
|
|
28113
|
-
first:
|
|
28135
|
+
first: functionNode.text === "ViewChild" || functionNode.text === "ContentChild",
|
|
28114
28136
|
isSignal: false,
|
|
28115
28137
|
predicate,
|
|
28116
28138
|
propertyName: propertyName2,
|
|
28117
28139
|
read,
|
|
28118
28140
|
static: static_
|
|
28119
28141
|
};
|
|
28120
|
-
if (
|
|
28142
|
+
if (functionNode.text === "ViewChild" || functionNode.text === "ViewChildren") {
|
|
28121
28143
|
viewQueries.push(meta);
|
|
28122
28144
|
} else {
|
|
28123
28145
|
contentQueries.push(meta);
|
|
@@ -28145,8 +28167,10 @@ var fail = (reason, detail, location) => ({
|
|
|
28145
28167
|
const runtime = SIGNAL_QUERY_TO_RUNTIME[queryName];
|
|
28146
28168
|
if (!runtime)
|
|
28147
28169
|
continue;
|
|
28170
|
+
if (!ts16.isIdentifier(member.name))
|
|
28171
|
+
continue;
|
|
28148
28172
|
const propertyName2 = member.name.text;
|
|
28149
|
-
const tokenArg = init.arguments
|
|
28173
|
+
const [tokenArg, opts] = init.arguments;
|
|
28150
28174
|
if (!tokenArg)
|
|
28151
28175
|
continue;
|
|
28152
28176
|
const predicate = queryPredicateFromArg(tokenArg, compiler);
|
|
@@ -28154,7 +28178,6 @@ var fail = (reason, detail, location) => ({
|
|
|
28154
28178
|
continue;
|
|
28155
28179
|
let descendants = true;
|
|
28156
28180
|
let read = null;
|
|
28157
|
-
const opts = init.arguments[1];
|
|
28158
28181
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
28159
28182
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
28160
28183
|
const readNode = getProperty(opts, "read");
|
|
@@ -28182,13 +28205,13 @@ var fail = (reason, detail, location) => ({
|
|
|
28182
28205
|
if (!node)
|
|
28183
28206
|
return null;
|
|
28184
28207
|
if (ts16.isStringLiteral(node)) {
|
|
28185
|
-
return node.text.split(",").map((
|
|
28208
|
+
return node.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
28186
28209
|
}
|
|
28187
28210
|
if (ts16.isArrayLiteralExpression(node)) {
|
|
28188
28211
|
const out = [];
|
|
28189
|
-
for (const
|
|
28190
|
-
if (ts16.isStringLiteral(
|
|
28191
|
-
out.push(
|
|
28212
|
+
for (const element of node.elements) {
|
|
28213
|
+
if (ts16.isStringLiteral(element))
|
|
28214
|
+
out.push(element.text);
|
|
28192
28215
|
}
|
|
28193
28216
|
return out.length > 0 ? out : null;
|
|
28194
28217
|
}
|
|
@@ -28198,12 +28221,12 @@ var fail = (reason, detail, location) => ({
|
|
|
28198
28221
|
if (!node || !ts16.isArrayLiteralExpression(node))
|
|
28199
28222
|
return null;
|
|
28200
28223
|
const out = [];
|
|
28201
|
-
for (const
|
|
28202
|
-
if (ts16.isIdentifier(
|
|
28224
|
+
for (const element of node.elements) {
|
|
28225
|
+
if (ts16.isIdentifier(element)) {
|
|
28203
28226
|
out.push({
|
|
28204
28227
|
directive: {
|
|
28205
|
-
type: new compiler.WrappedNodeExpr(
|
|
28206
|
-
value: new compiler.WrappedNodeExpr(
|
|
28228
|
+
type: new compiler.WrappedNodeExpr(element),
|
|
28229
|
+
value: new compiler.WrappedNodeExpr(element)
|
|
28207
28230
|
},
|
|
28208
28231
|
inputs: null,
|
|
28209
28232
|
isForwardReference: false,
|
|
@@ -28211,21 +28234,21 @@ var fail = (reason, detail, location) => ({
|
|
|
28211
28234
|
});
|
|
28212
28235
|
continue;
|
|
28213
28236
|
}
|
|
28214
|
-
if (!ts16.isObjectLiteralExpression(
|
|
28237
|
+
if (!ts16.isObjectLiteralExpression(element))
|
|
28215
28238
|
continue;
|
|
28216
|
-
const directiveNode = getProperty(
|
|
28239
|
+
const directiveNode = getProperty(element, "directive");
|
|
28217
28240
|
if (!directiveNode)
|
|
28218
28241
|
continue;
|
|
28219
|
-
const inputsNode = getProperty(
|
|
28220
|
-
const outputsNode = getProperty(
|
|
28221
|
-
const collectMap = (
|
|
28222
|
-
if (!
|
|
28242
|
+
const inputsNode = getProperty(element, "inputs");
|
|
28243
|
+
const outputsNode = getProperty(element, "outputs");
|
|
28244
|
+
const collectMap = (expression) => {
|
|
28245
|
+
if (!expression || !ts16.isArrayLiteralExpression(expression))
|
|
28223
28246
|
return null;
|
|
28224
28247
|
const map3 = {};
|
|
28225
|
-
for (const
|
|
28226
|
-
if (!ts16.isStringLiteral(
|
|
28248
|
+
for (const mappingElement of expression.elements) {
|
|
28249
|
+
if (!ts16.isStringLiteral(mappingElement))
|
|
28227
28250
|
continue;
|
|
28228
|
-
const [name, alias] =
|
|
28251
|
+
const [name, alias] = mappingElement.text.split(":").map((segment) => segment.trim());
|
|
28229
28252
|
if (name)
|
|
28230
28253
|
map3[name] = alias ?? name;
|
|
28231
28254
|
}
|
|
@@ -28293,9 +28316,9 @@ var fail = (reason, detail, location) => ({
|
|
|
28293
28316
|
});
|
|
28294
28317
|
return null;
|
|
28295
28318
|
}
|
|
28296
|
-
const
|
|
28319
|
+
const sourceFile = ts16.createSourceFile(filePath, source, ts16.ScriptTarget.Latest, true);
|
|
28297
28320
|
let info = null;
|
|
28298
|
-
for (const stmt of
|
|
28321
|
+
for (const stmt of sourceFile.statements) {
|
|
28299
28322
|
if (!ts16.isClassDeclaration(stmt))
|
|
28300
28323
|
continue;
|
|
28301
28324
|
if (!stmt.name || stmt.name.text !== className)
|
|
@@ -28377,14 +28400,17 @@ var fail = (reason, detail, location) => ({
|
|
|
28377
28400
|
}
|
|
28378
28401
|
const sliceBalanced = (start) => {
|
|
28379
28402
|
let depth = 0;
|
|
28380
|
-
for (let
|
|
28381
|
-
const
|
|
28382
|
-
if (
|
|
28403
|
+
for (let index = start;index < content.length; index++) {
|
|
28404
|
+
const item = content[index];
|
|
28405
|
+
if (item === "{")
|
|
28383
28406
|
depth++;
|
|
28384
|
-
else if (
|
|
28407
|
+
else if (item === "}") {
|
|
28385
28408
|
depth--;
|
|
28386
28409
|
if (depth === 0)
|
|
28387
|
-
return {
|
|
28410
|
+
return {
|
|
28411
|
+
end: index,
|
|
28412
|
+
text: content.slice(start, index + 1)
|
|
28413
|
+
};
|
|
28388
28414
|
}
|
|
28389
28415
|
}
|
|
28390
28416
|
return null;
|
|
@@ -28410,11 +28436,11 @@ var fail = (reason, detail, location) => ({
|
|
|
28410
28436
|
}
|
|
28411
28437
|
const aliasNamesFrom = (block) => {
|
|
28412
28438
|
const out = new Set;
|
|
28413
|
-
const
|
|
28414
|
-
let
|
|
28415
|
-
while ((
|
|
28416
|
-
const propName =
|
|
28417
|
-
const alias =
|
|
28439
|
+
const aliasPattern = /"([^"]+)"\s*:\s*\{[^}]*?"alias"\s*:\s*"([^"]*)"/g;
|
|
28440
|
+
let match;
|
|
28441
|
+
while ((match = aliasPattern.exec(block)) !== null) {
|
|
28442
|
+
const propName = match[1] ?? "";
|
|
28443
|
+
const alias = match[2] ?? "";
|
|
28418
28444
|
out.add(alias || propName);
|
|
28419
28445
|
}
|
|
28420
28446
|
return out;
|
|
@@ -28443,10 +28469,10 @@ var fail = (reason, detail, location) => ({
|
|
|
28443
28469
|
result.set(clause.name.text, spec);
|
|
28444
28470
|
const named = clause.namedBindings;
|
|
28445
28471
|
if (named && ts16.isNamedImports(named)) {
|
|
28446
|
-
for (const
|
|
28447
|
-
if (
|
|
28472
|
+
for (const element of named.elements) {
|
|
28473
|
+
if (element.isTypeOnly)
|
|
28448
28474
|
continue;
|
|
28449
|
-
result.set(
|
|
28475
|
+
result.set(element.name.text, spec);
|
|
28450
28476
|
}
|
|
28451
28477
|
}
|
|
28452
28478
|
}
|
|
@@ -28467,10 +28493,10 @@ var fail = (reason, detail, location) => ({
|
|
|
28467
28493
|
if (declRe.test(content))
|
|
28468
28494
|
return startDtsPath;
|
|
28469
28495
|
const namedReExportRe = new RegExp(`export\\s*(?:type)?\\s*\\{([^}]*)\\}\\s*from\\s*["']([^"']+)["']`, "g");
|
|
28470
|
-
let
|
|
28471
|
-
while ((
|
|
28472
|
-
const namedList =
|
|
28473
|
-
const fromPath =
|
|
28496
|
+
let item;
|
|
28497
|
+
while ((item = namedReExportRe.exec(content)) !== null) {
|
|
28498
|
+
const namedList = item[1] || "";
|
|
28499
|
+
const fromPath = item[2] || "";
|
|
28474
28500
|
const names = namedList.split(",").map((n) => {
|
|
28475
28501
|
const trimmed = n.trim();
|
|
28476
28502
|
const asIdx = trimmed.lastIndexOf(" as ");
|
|
@@ -28486,8 +28512,8 @@ var fail = (reason, detail, location) => ({
|
|
|
28486
28512
|
return found;
|
|
28487
28513
|
}
|
|
28488
28514
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
28489
|
-
while ((
|
|
28490
|
-
const fromPath =
|
|
28515
|
+
while ((item = starReExportRe.exec(content)) !== null) {
|
|
28516
|
+
const fromPath = item[1] || "";
|
|
28491
28517
|
const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
|
|
28492
28518
|
if (!nextDts)
|
|
28493
28519
|
continue;
|
|
@@ -28554,25 +28580,25 @@ var fail = (reason, detail, location) => ({
|
|
|
28554
28580
|
if (!importsExpr)
|
|
28555
28581
|
return result;
|
|
28556
28582
|
const classToSpec = buildClassToSpecMap(sourceFile);
|
|
28557
|
-
for (const
|
|
28558
|
-
if (!ts16.isIdentifier(
|
|
28583
|
+
for (const element of importsExpr.elements) {
|
|
28584
|
+
if (!ts16.isIdentifier(element))
|
|
28559
28585
|
continue;
|
|
28560
|
-
const className =
|
|
28586
|
+
const className = element.text;
|
|
28561
28587
|
const spec = classToSpec.get(className);
|
|
28562
28588
|
if (!spec)
|
|
28563
28589
|
continue;
|
|
28564
28590
|
const info = resolveChildComponentInfo(className, spec, componentDir, projectRoot);
|
|
28565
28591
|
if (!info)
|
|
28566
28592
|
continue;
|
|
28567
|
-
result.push({ identifier:
|
|
28593
|
+
result.push({ identifier: element, info });
|
|
28568
28594
|
}
|
|
28569
28595
|
return result;
|
|
28570
|
-
}, djb2Hash = (
|
|
28571
|
-
let
|
|
28572
|
-
for (let
|
|
28573
|
-
|
|
28596
|
+
}, djb2Hash = (source) => {
|
|
28597
|
+
let hash = 5381;
|
|
28598
|
+
for (let index = 0;index < source.length; index++) {
|
|
28599
|
+
hash = hash * 33 ^ source.charCodeAt(index);
|
|
28574
28600
|
}
|
|
28575
|
-
return (
|
|
28601
|
+
return (hash >>> 0).toString(36);
|
|
28576
28602
|
}, initializerShapeIsStructural = (node) => {
|
|
28577
28603
|
if (ts16.isArrowFunction(node) || ts16.isFunctionExpression(node) || ts16.isCallExpression(node) || ts16.isNewExpression(node)) {
|
|
28578
28604
|
return true;
|
|
@@ -28603,8 +28629,8 @@ var fail = (reason, detail, location) => ({
|
|
|
28603
28629
|
return false;
|
|
28604
28630
|
}
|
|
28605
28631
|
if (ts16.isArrayLiteralExpression(node)) {
|
|
28606
|
-
for (const
|
|
28607
|
-
if (initializerShapeIsStructural(
|
|
28632
|
+
for (const element of node.elements) {
|
|
28633
|
+
if (initializerShapeIsStructural(element))
|
|
28608
28634
|
return true;
|
|
28609
28635
|
}
|
|
28610
28636
|
return false;
|
|
@@ -28654,7 +28680,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28654
28680
|
decName = expr.expression.text;
|
|
28655
28681
|
}
|
|
28656
28682
|
if (expr.arguments.length > 0) {
|
|
28657
|
-
argText = expr.arguments.map((
|
|
28683
|
+
argText = expr.arguments.map((leftValue) => leftValue.getText()).join(",");
|
|
28658
28684
|
}
|
|
28659
28685
|
} else if (ts16.isIdentifier(expr)) {
|
|
28660
28686
|
decName = expr.text;
|
|
@@ -28681,7 +28707,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28681
28707
|
} catch {
|
|
28682
28708
|
return true;
|
|
28683
28709
|
}
|
|
28684
|
-
const
|
|
28710
|
+
const sourceFile = ts16.createSourceFile(filePath, source, ts16.ScriptTarget.ES2022, true, ts16.ScriptKind.TS);
|
|
28685
28711
|
let hasProviders = false;
|
|
28686
28712
|
const visit = (node) => {
|
|
28687
28713
|
if (hasProviders)
|
|
@@ -28691,7 +28717,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28691
28717
|
const expr = decorator.expression;
|
|
28692
28718
|
if (!ts16.isCallExpression(expr))
|
|
28693
28719
|
continue;
|
|
28694
|
-
const arg = expr.arguments
|
|
28720
|
+
const [arg] = expr.arguments;
|
|
28695
28721
|
if (!arg || !ts16.isObjectLiteralExpression(arg))
|
|
28696
28722
|
continue;
|
|
28697
28723
|
if (getProperty(arg, "providers") !== null) {
|
|
@@ -28702,7 +28728,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28702
28728
|
}
|
|
28703
28729
|
ts16.forEachChild(node, visit);
|
|
28704
28730
|
};
|
|
28705
|
-
visit(
|
|
28731
|
+
visit(sourceFile);
|
|
28706
28732
|
providerProbeCache.set(filePath, {
|
|
28707
28733
|
hasProviders,
|
|
28708
28734
|
mtimeMs: stat3.mtimeMs
|
|
@@ -28726,12 +28752,12 @@ var fail = (reason, detail, location) => ({
|
|
|
28726
28752
|
matches = true;
|
|
28727
28753
|
}
|
|
28728
28754
|
if (importClause.namedBindings) {
|
|
28729
|
-
const
|
|
28730
|
-
if (ts16.isNamespaceImport(
|
|
28731
|
-
if (
|
|
28755
|
+
const item = importClause.namedBindings;
|
|
28756
|
+
if (ts16.isNamespaceImport(item)) {
|
|
28757
|
+
if (item.name.text === identifierName)
|
|
28732
28758
|
matches = true;
|
|
28733
28759
|
} else {
|
|
28734
|
-
for (const element of
|
|
28760
|
+
for (const element of item.elements) {
|
|
28735
28761
|
if (element.name.text === identifierName) {
|
|
28736
28762
|
matches = true;
|
|
28737
28763
|
break;
|
|
@@ -28773,6 +28799,11 @@ var fail = (reason, detail, location) => ({
|
|
|
28773
28799
|
}
|
|
28774
28800
|
}
|
|
28775
28801
|
return sig.sort();
|
|
28802
|
+
}, getPropertyNameText = (name) => {
|
|
28803
|
+
if (ts16.isIdentifier(name) || ts16.isStringLiteral(name) || ts16.isNoSubstitutionTemplateLiteral(name)) {
|
|
28804
|
+
return name.text;
|
|
28805
|
+
}
|
|
28806
|
+
return name.getText();
|
|
28776
28807
|
}, extractPropertyFieldNames = (cls) => {
|
|
28777
28808
|
const names = [];
|
|
28778
28809
|
for (const member of cls.members) {
|
|
@@ -28782,7 +28813,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28782
28813
|
const { name } = member;
|
|
28783
28814
|
if (name === undefined)
|
|
28784
28815
|
continue;
|
|
28785
|
-
const text =
|
|
28816
|
+
const text = getPropertyNameText(name);
|
|
28786
28817
|
if (text.length > 0)
|
|
28787
28818
|
names.push(text);
|
|
28788
28819
|
}
|
|
@@ -28805,10 +28836,10 @@ var fail = (reason, detail, location) => ({
|
|
|
28805
28836
|
if (ts16.isNamespaceImport(bindings)) {
|
|
28806
28837
|
names.add(bindings.name.text);
|
|
28807
28838
|
} else if (ts16.isNamedImports(bindings)) {
|
|
28808
|
-
for (const
|
|
28809
|
-
if (
|
|
28839
|
+
for (const element of bindings.elements) {
|
|
28840
|
+
if (element.isTypeOnly)
|
|
28810
28841
|
continue;
|
|
28811
|
-
names.add(
|
|
28842
|
+
names.add(element.name.text);
|
|
28812
28843
|
}
|
|
28813
28844
|
}
|
|
28814
28845
|
}
|
|
@@ -28836,8 +28867,8 @@ var fail = (reason, detail, location) => ({
|
|
|
28836
28867
|
}
|
|
28837
28868
|
break;
|
|
28838
28869
|
}
|
|
28839
|
-
const inputNames = Object.entries(inputs).map(([
|
|
28840
|
-
const outputNames = Object.entries(outputs).map(([
|
|
28870
|
+
const inputNames = Object.entries(inputs).map(([item, m]) => `${item}:${m.bindingPropertyName}`).sort();
|
|
28871
|
+
const outputNames = Object.entries(outputs).map(([item, v2]) => `${item}:${v2}`).sort();
|
|
28841
28872
|
const arrowFieldSig = extractArrowFieldSig(cls);
|
|
28842
28873
|
const memberDecoratorSig = extractMemberDecoratorSig(cls);
|
|
28843
28874
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
@@ -28863,7 +28894,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28863
28894
|
for (const stmt of sourceFile.statements) {
|
|
28864
28895
|
if (!ts16.isVariableStatement(stmt))
|
|
28865
28896
|
continue;
|
|
28866
|
-
const isExported = stmt.modifiers?.some((
|
|
28897
|
+
const isExported = stmt.modifiers?.some((item) => item.kind === ts16.SyntaxKind.ExportKeyword);
|
|
28867
28898
|
if (!isExported)
|
|
28868
28899
|
continue;
|
|
28869
28900
|
for (const decl of stmt.declarationList.declarations) {
|
|
@@ -28917,7 +28948,7 @@ var fail = (reason, detail, location) => ({
|
|
|
28917
28948
|
continue;
|
|
28918
28949
|
}
|
|
28919
28950
|
if (ts16.isConstructorDeclaration(member)) {
|
|
28920
|
-
const cleanedParams = member.parameters.map((param) => ts16.factory.updateParameterDeclaration(param, (ts16.getModifiers(param) ?? []).filter((
|
|
28951
|
+
const cleanedParams = member.parameters.map((param) => ts16.factory.updateParameterDeclaration(param, (ts16.getModifiers(param) ?? []).filter((item) => item.kind !== ts16.SyntaxKind.PrivateKeyword && item.kind !== ts16.SyntaxKind.PublicKeyword && item.kind !== ts16.SyntaxKind.ProtectedKeyword && item.kind !== ts16.SyntaxKind.ReadonlyKeyword && item.kind !== ts16.SyntaxKind.OverrideKeyword), param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
28921
28952
|
const cleaned = ts16.factory.createConstructorDeclaration([], cleanedParams, member.body);
|
|
28922
28953
|
memberSources.push(printer.printNode(ts16.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
28923
28954
|
continue;
|
|
@@ -28988,8 +29019,7 @@ ${transpiled}
|
|
|
28988
29019
|
return readFileSync24(abs, "utf8");
|
|
28989
29020
|
}
|
|
28990
29021
|
try {
|
|
28991
|
-
|
|
28992
|
-
return compileStyleFileIfNeededSync2(abs);
|
|
29022
|
+
return compileStyleFileIfNeededSync(abs);
|
|
28993
29023
|
} catch {
|
|
28994
29024
|
return null;
|
|
28995
29025
|
}
|
|
@@ -29131,13 +29161,13 @@ ${block}
|
|
|
29131
29161
|
});
|
|
29132
29162
|
}
|
|
29133
29163
|
if (parsed.errors && parsed.errors.length > 0) {
|
|
29134
|
-
const first = parsed.errors
|
|
29164
|
+
const [first] = parsed.errors;
|
|
29135
29165
|
const span = first?.span;
|
|
29136
29166
|
const start = span?.start;
|
|
29137
29167
|
const lineIndex = start?.line;
|
|
29138
29168
|
const colIndex = start?.col;
|
|
29139
29169
|
const lineTextValue = typeof lineIndex === "number" && lineIndex >= 0 ? templateText.split(/\r?\n/)[lineIndex] ?? undefined : undefined;
|
|
29140
|
-
return fail("template-parse-error", parsed.errors.map((
|
|
29170
|
+
return fail("template-parse-error", parsed.errors.map((entry) => entry.toString()).join(`
|
|
29141
29171
|
`), {
|
|
29142
29172
|
column: typeof colIndex === "number" ? colIndex + 1 : undefined,
|
|
29143
29173
|
file: templatePath,
|
|
@@ -29183,7 +29213,7 @@ ${block}
|
|
|
29183
29213
|
hostDirectives: advancedMetadata.hostDirectives,
|
|
29184
29214
|
i18nUseExternalIds: projectDefaults.i18nUseExternalIds ?? false,
|
|
29185
29215
|
inputs,
|
|
29186
|
-
isSignal: (hasSignalIO || advancedMetadata.contentQueries.some((
|
|
29216
|
+
isSignal: (hasSignalIO || advancedMetadata.contentQueries.some((item) => item.isSignal) || advancedMetadata.viewQueries.some((item) => item.isSignal)) && !hasDecoratorIO && !advancedMetadata.contentQueries.some((item) => !item.isSignal) && !advancedMetadata.viewQueries.some((item) => !item.isSignal),
|
|
29187
29217
|
isStandalone: decoratorMeta.standalone,
|
|
29188
29218
|
lifecycle: {
|
|
29189
29219
|
usesOnChanges: classNode.members.some((m) => ts16.isMethodDeclaration(m) && m.name !== undefined && ts16.isIdentifier(m.name) && m.name.text === "ngOnChanges")
|
|
@@ -29235,6 +29265,9 @@ ${block}
|
|
|
29235
29265
|
}
|
|
29236
29266
|
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
29237
29267
|
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
29268
|
+
if (!ts16.isFunctionDeclaration(tsFunctionDecl)) {
|
|
29269
|
+
return fail("unexpected-error", "Angular HMR callback did not translate to a function declaration");
|
|
29270
|
+
}
|
|
29238
29271
|
const exportedDecl = ts16.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
29239
29272
|
ts16.factory.createToken(ts16.SyntaxKind.ExportKeyword),
|
|
29240
29273
|
ts16.factory.createToken(ts16.SyntaxKind.DefaultKeyword)
|
|
@@ -29260,19 +29293,18 @@ ${block}
|
|
|
29260
29293
|
if (clause?.name)
|
|
29261
29294
|
sourceScopeNames.add(clause.name.text);
|
|
29262
29295
|
if (clause?.namedBindings && ts16.isNamedImports(clause.namedBindings)) {
|
|
29263
|
-
for (const
|
|
29264
|
-
if (
|
|
29296
|
+
for (const element of clause.namedBindings.elements) {
|
|
29297
|
+
if (element.isTypeOnly)
|
|
29265
29298
|
continue;
|
|
29266
|
-
sourceScopeNames.add(
|
|
29299
|
+
sourceScopeNames.add(element.name.text);
|
|
29267
29300
|
}
|
|
29268
29301
|
} else if (clause?.namedBindings && ts16.isNamespaceImport(clause.namedBindings)) {
|
|
29269
29302
|
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
29270
29303
|
}
|
|
29271
29304
|
continue;
|
|
29272
29305
|
}
|
|
29273
|
-
if (ts16.isVariableStatement(stmt)
|
|
29274
|
-
const
|
|
29275
|
-
for (const decl of varStmt.declarationList.declarations) {
|
|
29306
|
+
if (ts16.isVariableStatement(stmt)) {
|
|
29307
|
+
for (const decl of stmt.declarationList.declarations) {
|
|
29276
29308
|
if (ts16.isIdentifier(decl.name)) {
|
|
29277
29309
|
sourceScopeNames.add(decl.name.text);
|
|
29278
29310
|
}
|
|
@@ -29303,10 +29335,10 @@ ${block}
|
|
|
29303
29335
|
if (ts16.isNamespaceImport(bindings)) {
|
|
29304
29336
|
allImportedNames.add(bindings.name.text);
|
|
29305
29337
|
} else {
|
|
29306
|
-
for (const
|
|
29307
|
-
if (
|
|
29338
|
+
for (const element of bindings.elements) {
|
|
29339
|
+
if (element.isTypeOnly)
|
|
29308
29340
|
continue;
|
|
29309
|
-
allImportedNames.add(
|
|
29341
|
+
allImportedNames.add(element.name.text);
|
|
29310
29342
|
}
|
|
29311
29343
|
}
|
|
29312
29344
|
}
|
|
@@ -29372,10 +29404,17 @@ ${methodsBlock}
|
|
|
29372
29404
|
}
|
|
29373
29405
|
};
|
|
29374
29406
|
var init_fastHmrCompiler = __esm(() => {
|
|
29407
|
+
init_stylePreprocessor();
|
|
29375
29408
|
init_hmrImportGenerator();
|
|
29376
29409
|
init_typescript_translator();
|
|
29377
29410
|
fingerprintCache = new Map;
|
|
29378
29411
|
pendingModuleCache = new Map;
|
|
29412
|
+
ANGULAR_DECORATOR_NAMES = new Set([
|
|
29413
|
+
"Component",
|
|
29414
|
+
"Directive",
|
|
29415
|
+
"Injectable",
|
|
29416
|
+
"Pipe"
|
|
29417
|
+
]);
|
|
29379
29418
|
entityFingerprintCache = new Map;
|
|
29380
29419
|
ENTITY_DECORATOR_NAMES = new Set(["Pipe", "Directive", "Injectable"]);
|
|
29381
29420
|
VIEW_ENCAPSULATION_VALUES = {
|
|
@@ -30788,6 +30827,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
30788
30827
|
}, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
|
|
30789
30828
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,svelte,vue}");
|
|
30790
30829
|
for await (const file5 of glob.scan({ absolute: true, cwd: dir })) {
|
|
30830
|
+
if (isTestSourcePath(file5))
|
|
30831
|
+
continue;
|
|
30791
30832
|
const relToDir = file5.slice(dir.length + 1);
|
|
30792
30833
|
const [firstSegment] = relToDir.split("/");
|
|
30793
30834
|
if (firstSegment && SKIP_DIRS5.has(firstSegment))
|
|
@@ -30974,10 +31015,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30974
31015
|
return {};
|
|
30975
31016
|
const sanitized = { ...override };
|
|
30976
31017
|
for (const key of reservedBunBuildConfigKeys) {
|
|
30977
|
-
|
|
31018
|
+
Reflect.deleteProperty(sanitized, key);
|
|
30978
31019
|
}
|
|
30979
31020
|
for (const key of extraReservedKeys) {
|
|
30980
|
-
|
|
31021
|
+
Reflect.deleteProperty(sanitized, key);
|
|
30981
31022
|
}
|
|
30982
31023
|
return sanitized;
|
|
30983
31024
|
}, resolveBunBuildOverride = (config2, pass) => {
|
|
@@ -30991,8 +31032,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
30991
31032
|
...config2.default ?? {},
|
|
30992
31033
|
...config2[pass] ?? {}
|
|
30993
31034
|
}, locked);
|
|
30994
|
-
}, resolveClientSourcemap = (sourcemaps,
|
|
30995
|
-
if (
|
|
31035
|
+
}, resolveClientSourcemap = (sourcemaps, devMode) => {
|
|
31036
|
+
if (devMode)
|
|
30996
31037
|
return sourcemaps === false ? "none" : "inline";
|
|
30997
31038
|
if (sourcemaps === "external" || sourcemaps === true)
|
|
30998
31039
|
return "external";
|
|
@@ -31005,7 +31046,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31005
31046
|
...base,
|
|
31006
31047
|
...sanitized
|
|
31007
31048
|
};
|
|
31008
|
-
|
|
31049
|
+
const result = {
|
|
31009
31050
|
...merged,
|
|
31010
31051
|
define: base.define || sanitized.define ? {
|
|
31011
31052
|
...sanitized.define ?? {},
|
|
@@ -31017,6 +31058,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31017
31058
|
]),
|
|
31018
31059
|
plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
|
|
31019
31060
|
};
|
|
31061
|
+
return result;
|
|
31020
31062
|
}, buildUnlocked = async ({
|
|
31021
31063
|
buildDirectory = "build",
|
|
31022
31064
|
assetsDirectory,
|
|
@@ -31054,12 +31096,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31054
31096
|
delete traceGlobal.__absoluteBuildTracePhase;
|
|
31055
31097
|
}
|
|
31056
31098
|
};
|
|
31057
|
-
const tracePhase = async (name,
|
|
31099
|
+
const tracePhase = async (name, runPhase, metadata2) => {
|
|
31058
31100
|
if (!traceEnabled)
|
|
31059
|
-
return
|
|
31101
|
+
return runPhase();
|
|
31060
31102
|
const phaseStart = performance.now();
|
|
31061
31103
|
try {
|
|
31062
|
-
const result = await
|
|
31104
|
+
const result = await runPhase();
|
|
31063
31105
|
traceEvents.push({
|
|
31064
31106
|
durationMs: performance.now() - phaseStart,
|
|
31065
31107
|
metadata: metadata2,
|
|
@@ -31226,7 +31268,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31226
31268
|
recursive: true
|
|
31227
31269
|
}));
|
|
31228
31270
|
}
|
|
31229
|
-
const
|
|
31271
|
+
const tailwindSourceConfig = {
|
|
31230
31272
|
angularDirectory,
|
|
31231
31273
|
emberDirectory,
|
|
31232
31274
|
htmlDirectory,
|
|
@@ -31234,7 +31276,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31234
31276
|
reactDirectory,
|
|
31235
31277
|
svelteDirectory,
|
|
31236
31278
|
vueDirectory
|
|
31237
|
-
}
|
|
31279
|
+
};
|
|
31280
|
+
const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig, computeFrameworkTailwindSources(tailwindSourceConfig), normalizedIncrementalFiles ?? [])) : undefined;
|
|
31238
31281
|
const emptyConventionResult = {
|
|
31239
31282
|
conventions: undefined,
|
|
31240
31283
|
pageFiles: []
|
|
@@ -31471,7 +31514,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31471
31514
|
vueSpaRoutesBySource
|
|
31472
31515
|
},
|
|
31473
31516
|
{ clientPaths: angularClientPaths, serverPaths: angularServerPaths },
|
|
31474
|
-
{
|
|
31517
|
+
{ serverPaths: emberServerPaths },
|
|
31475
31518
|
{ svelteClientPaths: islandSvelteClientPaths },
|
|
31476
31519
|
{ vueClientPaths: islandVueClientPaths },
|
|
31477
31520
|
{ clientPaths: islandAngularClientPaths }
|
|
@@ -31491,8 +31534,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31491
31534
|
shouldCompileAngular ? tracePhase("compile/angular", async () => {
|
|
31492
31535
|
const mod = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
31493
31536
|
if (angularAppProvidersSource && angularDir) {
|
|
31494
|
-
const {
|
|
31495
|
-
|
|
31537
|
+
const {
|
|
31538
|
+
getFrameworkGeneratedDir: resolveGeneratedDirectory
|
|
31539
|
+
} = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
31540
|
+
const compiledRoot = resolveGeneratedDirectory("angular", projectRoot);
|
|
31496
31541
|
await mod.compileAngularFileJIT(angularAppProvidersSource, compiledRoot, angularDir, styleTransformConfig);
|
|
31497
31542
|
}
|
|
31498
31543
|
const result = await mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig, angularProvidersInjection);
|
|
@@ -31500,20 +31545,23 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31500
31545
|
try {
|
|
31501
31546
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
31502
31547
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
31503
|
-
const { join:
|
|
31548
|
+
const { join: joinPath } = await import("path");
|
|
31504
31549
|
const walk = async (dir) => {
|
|
31505
31550
|
const entries = await readdir4(dir, {
|
|
31506
31551
|
withFileTypes: true
|
|
31507
31552
|
});
|
|
31508
31553
|
const out = [];
|
|
31554
|
+
const directories = [];
|
|
31509
31555
|
for (const entry of entries) {
|
|
31510
|
-
const full =
|
|
31556
|
+
const full = joinPath(dir, entry.name);
|
|
31511
31557
|
if (entry.isDirectory()) {
|
|
31512
|
-
|
|
31558
|
+
directories.push(full);
|
|
31513
31559
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
31514
31560
|
out.push(full);
|
|
31515
31561
|
}
|
|
31516
31562
|
}
|
|
31563
|
+
const nestedFiles = await Promise.all(directories.map(walk));
|
|
31564
|
+
out.push(...nestedFiles.flat());
|
|
31517
31565
|
return out;
|
|
31518
31566
|
};
|
|
31519
31567
|
const tsFiles = await walk(angularDir);
|
|
@@ -31575,11 +31623,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31575
31623
|
const destDir = join40(buildPath, "conventions", "react");
|
|
31576
31624
|
rmSync2(destDir, { force: true, recursive: true });
|
|
31577
31625
|
mkdirSync12(destDir, { recursive: true });
|
|
31578
|
-
const destPaths =
|
|
31579
|
-
for (let idx = 0;idx < reactConventionSources.length; idx++) {
|
|
31580
|
-
const source = reactConventionSources[idx];
|
|
31581
|
-
if (!source)
|
|
31582
|
-
continue;
|
|
31626
|
+
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
31583
31627
|
const result = await bunBuild7({
|
|
31584
31628
|
entrypoints: [source],
|
|
31585
31629
|
format: "esm",
|
|
@@ -31600,8 +31644,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31600
31644
|
const output = result.outputs.find((artifact) => artifact.path.endsWith(".js"));
|
|
31601
31645
|
if (!output)
|
|
31602
31646
|
throw new Error(`React convention did not emit JavaScript: ${source}`);
|
|
31603
|
-
|
|
31604
|
-
}
|
|
31647
|
+
return output.path;
|
|
31648
|
+
}));
|
|
31605
31649
|
return destPaths;
|
|
31606
31650
|
};
|
|
31607
31651
|
const [
|
|
@@ -31619,11 +31663,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31619
31663
|
const destDir = join40(buildPath, "conventions", framework);
|
|
31620
31664
|
rmSync2(destDir, { force: true, recursive: true });
|
|
31621
31665
|
mkdirSync12(destDir, { recursive: true });
|
|
31622
|
-
const destPaths =
|
|
31623
|
-
for (let idx = 0;idx < compiledPaths.length; idx++) {
|
|
31624
|
-
const compiledPath = compiledPaths[idx];
|
|
31625
|
-
if (!compiledPath)
|
|
31626
|
-
continue;
|
|
31666
|
+
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
31627
31667
|
const name = basename14(compiledPath).replace(/\.[^.]+$/, "");
|
|
31628
31668
|
const result = await bunBuild7({
|
|
31629
31669
|
entrypoints: [compiledPath],
|
|
@@ -31642,8 +31682,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31642
31682
|
const output = result.outputs.find((artifact) => artifact.path.endsWith(".js"));
|
|
31643
31683
|
if (!output)
|
|
31644
31684
|
throw new Error(`${framework} convention did not emit JavaScript: ${compiledPath}`);
|
|
31645
|
-
|
|
31646
|
-
}
|
|
31685
|
+
return output.path;
|
|
31686
|
+
}));
|
|
31647
31687
|
return destPaths;
|
|
31648
31688
|
};
|
|
31649
31689
|
const [svelteDests, vueDests, angularDests] = await Promise.all([
|
|
@@ -31977,15 +32017,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
31977
32017
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
31978
32018
|
const sourcemapDir = join40(projectRoot, "sourcemaps");
|
|
31979
32019
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
31980
|
-
const mapFiles = readdirSync5(buildPath, {
|
|
32020
|
+
const mapFiles = readdirSync5(buildPath, {
|
|
32021
|
+
encoding: "utf8",
|
|
32022
|
+
recursive: true
|
|
32023
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join40(buildPath, entry));
|
|
31981
32024
|
for (const mapPath of mapFiles) {
|
|
31982
32025
|
chainExternalSourcemap2(mapPath);
|
|
31983
32026
|
renameSync(mapPath, join40(sourcemapDir, basename14(mapPath)));
|
|
31984
32027
|
const jsPath = mapPath.slice(0, -4);
|
|
31985
32028
|
try {
|
|
31986
|
-
const
|
|
32029
|
+
const javascript = readFileSync25(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
31987
32030
|
`);
|
|
31988
|
-
writeFileSync9(jsPath,
|
|
32031
|
+
writeFileSync9(jsPath, javascript);
|
|
31989
32032
|
} catch {}
|
|
31990
32033
|
}
|
|
31991
32034
|
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative15(projectRoot, sourcemapDir)}/`);
|
|
@@ -33168,7 +33211,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
33168
33211
|
refs.push(match[1]);
|
|
33169
33212
|
}
|
|
33170
33213
|
while ((match = stylesArrRe.exec(source)) !== null) {
|
|
33171
|
-
const inner = match
|
|
33214
|
+
const [inner] = match.slice(1);
|
|
33172
33215
|
if (!inner)
|
|
33173
33216
|
continue;
|
|
33174
33217
|
let strMatch;
|
|
@@ -33227,8 +33270,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
33227
33270
|
roots.push(abs);
|
|
33228
33271
|
}
|
|
33229
33272
|
try {
|
|
33230
|
-
const {
|
|
33231
|
-
const entries = readdirSync7(cwd2, { withFileTypes: true });
|
|
33273
|
+
const entries = readdirSync6(cwd2, { withFileTypes: true });
|
|
33232
33274
|
for (const entry of entries) {
|
|
33233
33275
|
if (!entry.isDirectory())
|
|
33234
33276
|
continue;
|
|
@@ -33328,9 +33370,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
33328
33370
|
operation: "add"
|
|
33329
33371
|
});
|
|
33330
33372
|
}
|
|
33331
|
-
}, ATOMIC_WRITE_TEMP_PATTERNS, shouldSkipFilename = (filename, isStylesDir) => !isStylesDir && (filename === "compiled" || filename === "generated" || filename === "build" || filename === "indexes" || filename === "server" || filename === "client" || filename.includes("/compiled/") || filename.includes("/generated/") || filename.includes("/build/") || filename.includes("/indexes/") || filename.includes("/server/") || filename.includes("/client/") || filename.startsWith("compiled/") || filename.startsWith("generated/") || filename.startsWith("build/") || filename.startsWith("indexes/") || filename.startsWith("server/") || filename.startsWith("client/")) || filename.endsWith("/") || filename.includes(".tmp.") || filename.endsWith(".tmp") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS.some((
|
|
33373
|
+
}, ATOMIC_WRITE_TEMP_PATTERNS, shouldSkipFilename = (filename, isStylesDir) => !isStylesDir && (filename === "compiled" || filename === "generated" || filename === "build" || filename === "indexes" || filename === "server" || filename === "client" || filename.includes("/compiled/") || filename.includes("/generated/") || filename.includes("/build/") || filename.includes("/indexes/") || filename.includes("/server/") || filename.includes("/client/") || filename.startsWith("compiled/") || filename.startsWith("generated/") || filename.startsWith("build/") || filename.startsWith("indexes/") || filename.startsWith("server/") || filename.startsWith("client/")) || filename.endsWith("/") || filename.includes(".tmp.") || filename.endsWith(".tmp") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS.some((pattern) => pattern.test(filename)), setupWatcher = (absolutePath, isStylesDir, state, onFileChange) => {
|
|
33332
33374
|
const ATOMIC_RECOVERY_WINDOW_MS = 1000;
|
|
33333
|
-
const recentlySynthesized = new Map;
|
|
33334
33375
|
const atomicRecoveryScan = (eventDir) => {
|
|
33335
33376
|
let entries;
|
|
33336
33377
|
try {
|
|
@@ -33354,10 +33395,6 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
33354
33395
|
const age = now - st2.ctimeMs;
|
|
33355
33396
|
if (age < 0 || age > ATOMIC_RECOVERY_WINDOW_MS)
|
|
33356
33397
|
continue;
|
|
33357
|
-
const last = recentlySynthesized.get(child) ?? 0;
|
|
33358
|
-
if (now - last < 100)
|
|
33359
|
-
continue;
|
|
33360
|
-
recentlySynthesized.set(child, now);
|
|
33361
33398
|
onFileChange(child);
|
|
33362
33399
|
safeAddToGraph(state.dependencyGraph, child);
|
|
33363
33400
|
}
|
|
@@ -33369,6 +33406,10 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
33369
33406
|
if (event === "rename") {
|
|
33370
33407
|
const eventDir = dirname23(join42(absolutePath, filename)).replace(/\\/g, "/");
|
|
33371
33408
|
atomicRecoveryScan(eventDir);
|
|
33409
|
+
for (const delay of [25, 100]) {
|
|
33410
|
+
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
33411
|
+
timer.unref();
|
|
33412
|
+
}
|
|
33372
33413
|
}
|
|
33373
33414
|
return;
|
|
33374
33415
|
}
|
|
@@ -33812,18 +33853,19 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
33812
33853
|
return "";
|
|
33813
33854
|
let pathname;
|
|
33814
33855
|
try {
|
|
33815
|
-
pathname = new URL(requestUrl)
|
|
33856
|
+
({ pathname } = new URL(requestUrl));
|
|
33816
33857
|
} catch {
|
|
33817
33858
|
pathname = requestUrl.split("?")[0] ?? requestUrl;
|
|
33818
33859
|
}
|
|
33819
33860
|
const matched = findMatchingRoute(routes, pathname);
|
|
33820
33861
|
if (!matched)
|
|
33821
33862
|
return "";
|
|
33863
|
+
const { cssPath: routeCssPath } = matched;
|
|
33822
33864
|
const cssPaths = [
|
|
33823
|
-
|
|
33865
|
+
routeCssPath,
|
|
33824
33866
|
...routes.map((route) => route.cssPath)
|
|
33825
|
-
].filter((
|
|
33826
|
-
const chunks = await Promise.all(cssPaths.map((
|
|
33867
|
+
].filter((childCssPath, index, all) => childCssPath && all.indexOf(childCssPath) === index);
|
|
33868
|
+
const chunks = await Promise.all(cssPaths.map((childCssPath) => readChildCss(childCssPath, sideManifestPath)));
|
|
33827
33869
|
return chunks.filter(Boolean).join(`
|
|
33828
33870
|
`);
|
|
33829
33871
|
};
|
|
@@ -33943,10 +33985,10 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
33943
33985
|
const expr = decorator.expression;
|
|
33944
33986
|
if (!ts17.isCallExpression(expr))
|
|
33945
33987
|
continue;
|
|
33946
|
-
const
|
|
33947
|
-
if (!ts17.isIdentifier(
|
|
33988
|
+
const functionNode = expr.expression;
|
|
33989
|
+
if (!ts17.isIdentifier(functionNode))
|
|
33948
33990
|
continue;
|
|
33949
|
-
const kind = ENTITY_DECORATORS[
|
|
33991
|
+
const kind = ENTITY_DECORATORS[functionNode.text];
|
|
33950
33992
|
if (!kind)
|
|
33951
33993
|
continue;
|
|
33952
33994
|
let extendsName = null;
|
|
@@ -33954,7 +33996,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
33954
33996
|
if (heritage.token !== ts17.SyntaxKind.ExtendsKeyword) {
|
|
33955
33997
|
continue;
|
|
33956
33998
|
}
|
|
33957
|
-
const first = heritage.types
|
|
33999
|
+
const [first] = heritage.types;
|
|
33958
34000
|
if (first && ts17.isIdentifier(first.expression)) {
|
|
33959
34001
|
extendsName = first.expression.text;
|
|
33960
34002
|
}
|
|
@@ -33967,7 +34009,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
33967
34009
|
styleUrls: [],
|
|
33968
34010
|
templateUrls: []
|
|
33969
34011
|
};
|
|
33970
|
-
const arg = expr.arguments
|
|
34012
|
+
const [arg] = expr.arguments;
|
|
33971
34013
|
if (arg && ts17.isObjectLiteralExpression(arg) && kind === "component") {
|
|
33972
34014
|
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
33973
34015
|
if (tplUrl)
|
|
@@ -34025,9 +34067,9 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
34025
34067
|
} catch {
|
|
34026
34068
|
return null;
|
|
34027
34069
|
}
|
|
34028
|
-
const
|
|
34070
|
+
const sourceFile = ts17.createSourceFile(childFilePath, source, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
34029
34071
|
const childDir = dirname25(childFilePath);
|
|
34030
|
-
for (const stmt of
|
|
34072
|
+
for (const stmt of sourceFile.statements) {
|
|
34031
34073
|
if (!ts17.isImportDeclaration(stmt))
|
|
34032
34074
|
continue;
|
|
34033
34075
|
if (!ts17.isStringLiteral(stmt.moduleSpecifier))
|
|
@@ -34039,10 +34081,10 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
34039
34081
|
if (clause.name && clause.name.text === parentName)
|
|
34040
34082
|
matchesName = true;
|
|
34041
34083
|
if (!matchesName && clause.namedBindings && ts17.isNamedImports(clause.namedBindings)) {
|
|
34042
|
-
for (const
|
|
34043
|
-
if (
|
|
34084
|
+
for (const element of clause.namedBindings.elements) {
|
|
34085
|
+
if (element.isTypeOnly)
|
|
34044
34086
|
continue;
|
|
34045
|
-
if (
|
|
34087
|
+
if (element.name.text === parentName) {
|
|
34046
34088
|
matchesName = true;
|
|
34047
34089
|
break;
|
|
34048
34090
|
}
|
|
@@ -35217,11 +35259,11 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
35217
35259
|
return `${projectRel}@${className}`;
|
|
35218
35260
|
}, getApplyMetadataModule = async (encodedId) => {
|
|
35219
35261
|
const decoded = decodeURIComponent(encodedId);
|
|
35220
|
-
const
|
|
35221
|
-
if (
|
|
35262
|
+
const separatorIndex = decoded.lastIndexOf("@");
|
|
35263
|
+
if (separatorIndex === -1)
|
|
35222
35264
|
return null;
|
|
35223
|
-
const filePathRel = decoded.slice(0,
|
|
35224
|
-
const className = decoded.slice(
|
|
35265
|
+
const filePathRel = decoded.slice(0, separatorIndex);
|
|
35266
|
+
const className = decoded.slice(separatorIndex + 1);
|
|
35225
35267
|
const componentFilePath = resolve40(process.cwd(), filePathRel);
|
|
35226
35268
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
35227
35269
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
@@ -35318,14 +35360,13 @@ var resolveRequestPathname = (request) => {
|
|
|
35318
35360
|
return;
|
|
35319
35361
|
}
|
|
35320
35362
|
}, installSimpleDomGlobals = () => {
|
|
35321
|
-
|
|
35322
|
-
|
|
35323
|
-
|
|
35324
|
-
};
|
|
35363
|
+
if (typeof globalThis.Element === "undefined") {
|
|
35364
|
+
Reflect.set(globalThis, "Element", class Element {
|
|
35365
|
+
});
|
|
35325
35366
|
}
|
|
35326
|
-
if (typeof
|
|
35327
|
-
|
|
35328
|
-
};
|
|
35367
|
+
if (typeof globalThis.Node === "undefined") {
|
|
35368
|
+
Reflect.set(globalThis, "Node", class Node {
|
|
35369
|
+
});
|
|
35329
35370
|
}
|
|
35330
35371
|
}, emberCacheBuster = 0, buildRuntimeModuleSpecifier = (modulePath) => {
|
|
35331
35372
|
if (emberCacheBuster === 0)
|
|
@@ -35439,8 +35480,16 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
35439
35480
|
var init_simpleHTMXHMR = () => {};
|
|
35440
35481
|
|
|
35441
35482
|
// src/dev/rebuildTrigger.ts
|
|
35442
|
-
import { existsSync as existsSync36, rmSync as rmSync3 } from "fs";
|
|
35443
|
-
import {
|
|
35483
|
+
import { existsSync as existsSync36, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
35484
|
+
import {
|
|
35485
|
+
basename as basename17,
|
|
35486
|
+
dirname as dirname28,
|
|
35487
|
+
isAbsolute as isAbsolute6,
|
|
35488
|
+
join as join45,
|
|
35489
|
+
relative as relative18,
|
|
35490
|
+
resolve as resolvePath,
|
|
35491
|
+
sep as sep4
|
|
35492
|
+
} from "path";
|
|
35444
35493
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
35445
35494
|
clearSpaRouteCssCaches();
|
|
35446
35495
|
clearSiblingCssCache();
|
|
@@ -35455,7 +35504,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35455
35504
|
if (!cssChanged)
|
|
35456
35505
|
return;
|
|
35457
35506
|
try {
|
|
35458
|
-
const outputPath =
|
|
35507
|
+
const outputPath = resolvePath(state.resolvedPaths.buildDir, config2.tailwind.output);
|
|
35459
35508
|
const bytes = await Bun.file(outputPath).bytes();
|
|
35460
35509
|
const webPath = `/${config2.tailwind.output.replace(/^\/+/, "")}`;
|
|
35461
35510
|
state.assetStore.set(webPath, bytes);
|
|
@@ -35546,12 +35595,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35546
35595
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync36(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
35547
35596
|
const { config: config2 } = state;
|
|
35548
35597
|
const cwd2 = process.cwd();
|
|
35549
|
-
const absDeleted =
|
|
35598
|
+
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
35550
35599
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
35551
35600
|
const dir = config2[configKey];
|
|
35552
35601
|
if (!dir)
|
|
35553
35602
|
continue;
|
|
35554
|
-
const absDir =
|
|
35603
|
+
const absDir = resolvePath(cwd2, dir).replace(/\\/g, "/");
|
|
35555
35604
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
35556
35605
|
continue;
|
|
35557
35606
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -35575,7 +35624,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35575
35624
|
removeStaleGenerated(state, filePathInSet);
|
|
35576
35625
|
try {
|
|
35577
35626
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
35578
|
-
const deletedPathResolved =
|
|
35627
|
+
const deletedPathResolved = resolvePath(filePathInSet);
|
|
35579
35628
|
affectedFiles.forEach((affectedFile) => {
|
|
35580
35629
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
35581
35630
|
validFiles.push(affectedFile);
|
|
@@ -35619,7 +35668,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35619
35668
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
35620
35669
|
return;
|
|
35621
35670
|
}
|
|
35622
|
-
const normalizedFilePath =
|
|
35671
|
+
const normalizedFilePath = resolvePath(filePathInSet);
|
|
35623
35672
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
35624
35673
|
validFiles.push(normalizedFilePath);
|
|
35625
35674
|
processedFiles.add(normalizedFilePath);
|
|
@@ -35750,7 +35799,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35750
35799
|
const userEditedFiles = new Set;
|
|
35751
35800
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
35752
35801
|
for (const filePath of filePaths) {
|
|
35753
|
-
userEditedFiles.add(
|
|
35802
|
+
userEditedFiles.add(resolvePath(filePath));
|
|
35754
35803
|
}
|
|
35755
35804
|
});
|
|
35756
35805
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -35769,6 +35818,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35769
35818
|
});
|
|
35770
35819
|
triggerRebuild(state, config2, onRebuildComplete, filesToRebuild);
|
|
35771
35820
|
}, queueFileChange = async (state, filePath, config2, onRebuildComplete) => {
|
|
35821
|
+
const serverEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
35822
|
+
if (serverEntry && resolvePath(filePath) === resolvePath(serverEntry))
|
|
35823
|
+
return;
|
|
35772
35824
|
const framework = detectFramework(filePath, state.resolvedPaths);
|
|
35773
35825
|
if (framework === "ignored") {
|
|
35774
35826
|
return;
|
|
@@ -35783,7 +35835,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35783
35835
|
const { publicDir } = state.resolvedPaths;
|
|
35784
35836
|
const { assetsDir } = state.resolvedPaths;
|
|
35785
35837
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
35786
|
-
const absSource =
|
|
35838
|
+
const absSource = resolvePath(filePath);
|
|
35787
35839
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
35788
35840
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
35789
35841
|
if (!normalizedSource.startsWith(`${normalizedDir}/`))
|
|
@@ -35791,10 +35843,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35791
35843
|
try {
|
|
35792
35844
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
35793
35845
|
const { buildDir } = state.resolvedPaths;
|
|
35794
|
-
const destPath =
|
|
35846
|
+
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
35795
35847
|
const { mkdir: mkdir8, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
35796
|
-
|
|
35797
|
-
await mkdir8(dirname29(destPath), { recursive: true });
|
|
35848
|
+
await mkdir8(dirname28(destPath), { recursive: true });
|
|
35798
35849
|
await copyFile(absSource, destPath);
|
|
35799
35850
|
const bytes = await readFile7(destPath);
|
|
35800
35851
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -35817,7 +35868,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35817
35868
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
35818
35869
|
return;
|
|
35819
35870
|
if (framework === "unknown") {
|
|
35820
|
-
invalidate(
|
|
35871
|
+
invalidate(resolvePath(filePath));
|
|
35821
35872
|
const relPath = relative18(process.cwd(), filePath);
|
|
35822
35873
|
logHmrUpdate(relPath);
|
|
35823
35874
|
const { angularDir } = state.resolvedPaths;
|
|
@@ -35825,10 +35876,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35825
35876
|
if (angularDir && state.dependencyGraph) {
|
|
35826
35877
|
try {
|
|
35827
35878
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
35828
|
-
addFileToGraph2(state.dependencyGraph,
|
|
35829
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
35879
|
+
addFileToGraph2(state.dependencyGraph, resolvePath(filePath));
|
|
35880
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolvePath(filePath));
|
|
35830
35881
|
for (const dependent of affected) {
|
|
35831
|
-
if (dependent ===
|
|
35882
|
+
if (dependent === resolvePath(filePath))
|
|
35832
35883
|
continue;
|
|
35833
35884
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
35834
35885
|
if (dependentFramework !== "angular")
|
|
@@ -35845,14 +35896,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35845
35896
|
} catch {}
|
|
35846
35897
|
}
|
|
35847
35898
|
if (!hasAngularDependent) {
|
|
35848
|
-
console.log(`[abs:restart] ${
|
|
35899
|
+
console.log(`[abs:restart] ${resolvePath(filePath)}`);
|
|
35849
35900
|
return;
|
|
35850
35901
|
}
|
|
35851
35902
|
try {
|
|
35852
35903
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
35853
35904
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
35854
35905
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
35855
|
-
const sourceAbs =
|
|
35906
|
+
const sourceAbs = resolvePath(filePath).replace(/\\/g, "/");
|
|
35856
35907
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
35857
35908
|
invalidateModuleServer(generatedTwin);
|
|
35858
35909
|
} catch {}
|
|
@@ -35894,7 +35945,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35894
35945
|
}
|
|
35895
35946
|
if (!graph)
|
|
35896
35947
|
return componentFile;
|
|
35897
|
-
const dependents = graph.dependents.get(
|
|
35948
|
+
const dependents = graph.dependents.get(resolvePath(componentFile));
|
|
35898
35949
|
if (!dependents)
|
|
35899
35950
|
return componentFile;
|
|
35900
35951
|
for (const dep of dependents) {
|
|
@@ -35903,7 +35954,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35903
35954
|
}
|
|
35904
35955
|
return componentFile;
|
|
35905
35956
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
35906
|
-
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") &&
|
|
35957
|
+
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolvePath(file5).startsWith(angularPagesPath));
|
|
35907
35958
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
35908
35959
|
return pageEntries;
|
|
35909
35960
|
}
|
|
@@ -35912,7 +35963,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35912
35963
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
35913
35964
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
35914
35965
|
affected.forEach((file5) => {
|
|
35915
|
-
if (file5.endsWith(".ts") &&
|
|
35966
|
+
if (file5.endsWith(".ts") && resolvePath(file5).startsWith(angularPagesPath)) {
|
|
35916
35967
|
resolvedPages.add(file5);
|
|
35917
35968
|
}
|
|
35918
35969
|
});
|
|
@@ -35950,8 +36001,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35950
36001
|
if (serverDirs.length <= 1) {
|
|
35951
36002
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
35952
36003
|
return {
|
|
35953
|
-
serverOutDir:
|
|
35954
|
-
serverRoot:
|
|
36004
|
+
serverOutDir: resolvePath(resolvedPaths.buildDir, basename17(dir)),
|
|
36005
|
+
serverRoot: resolvePath(dir, "server")
|
|
35955
36006
|
};
|
|
35956
36007
|
}
|
|
35957
36008
|
return {
|
|
@@ -35978,15 +36029,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35978
36029
|
const [prefix] = name.split(".");
|
|
35979
36030
|
if (!prefix)
|
|
35980
36031
|
continue;
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
|
|
35985
|
-
|
|
35986
|
-
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
36032
|
+
const keep = keepByDir.get(dir) ?? new Set;
|
|
36033
|
+
const keepStems = keepStemsByDir.get(dir) ?? new Set;
|
|
36034
|
+
const prefixes = prefixByDir.get(dir) ?? new Set;
|
|
36035
|
+
keepByDir.set(dir, keep);
|
|
36036
|
+
keepStemsByDir.set(dir, keepStems);
|
|
36037
|
+
prefixByDir.set(dir, prefixes);
|
|
36038
|
+
keep.add(name);
|
|
36039
|
+
keepStems.add(name.replace(/\.[^.]+$/, ""));
|
|
36040
|
+
prefixes.add(prefix);
|
|
35990
36041
|
}
|
|
35991
36042
|
await Promise.all(Array.from(keepByDir.entries()).map(async ([dir, keep]) => {
|
|
35992
36043
|
const prefixes = prefixByDir.get(dir);
|
|
@@ -36124,8 +36175,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36124
36175
|
if (detected !== "unknown")
|
|
36125
36176
|
continue;
|
|
36126
36177
|
try {
|
|
36127
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
36128
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
36178
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolvePath(editedFile));
|
|
36179
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolvePath(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
36129
36180
|
if (hasAngularConsumer) {
|
|
36130
36181
|
return {
|
|
36131
36182
|
kind: "rebootstrap",
|
|
@@ -36172,7 +36223,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36172
36223
|
}
|
|
36173
36224
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
36174
36225
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
36175
|
-
const angularDirAbs =
|
|
36226
|
+
const angularDirAbs = resolvePath(angularDir).replace(/\\/g, "/");
|
|
36176
36227
|
if (normalized.startsWith(`${angularDirAbs}/`)) {
|
|
36177
36228
|
return {
|
|
36178
36229
|
kind: "rebootstrap",
|
|
@@ -36288,19 +36339,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36288
36339
|
let ctx = angularBundleState.get(state);
|
|
36289
36340
|
if (!ctx) {
|
|
36290
36341
|
ctx = {
|
|
36342
|
+
angularDir,
|
|
36291
36343
|
debouncedPromise: null,
|
|
36292
36344
|
debouncedResolve: null,
|
|
36293
36345
|
debounceTimer: null,
|
|
36294
36346
|
inFlight: null,
|
|
36347
|
+
pageEntries,
|
|
36295
36348
|
pending: false
|
|
36296
36349
|
};
|
|
36297
36350
|
angularBundleState.set(state, ctx);
|
|
36298
36351
|
}
|
|
36352
|
+
ctx.pageEntries = pageEntries;
|
|
36353
|
+
ctx.angularDir = angularDir;
|
|
36299
36354
|
const doOne = async () => {
|
|
36300
|
-
if (pageEntries.length === 0)
|
|
36355
|
+
if (ctx.pageEntries.length === 0)
|
|
36301
36356
|
return;
|
|
36302
36357
|
try {
|
|
36303
|
-
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
36358
|
+
await compileAndBundleAngular(state, ctx.pageEntries, ctx.angularDir);
|
|
36304
36359
|
} catch (error) {
|
|
36305
36360
|
console.error("[hmr] angular bundle rebuild failed \u2014 will retry on the next change:", error instanceof Error ? error.message : error);
|
|
36306
36361
|
}
|
|
@@ -36319,23 +36374,24 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36319
36374
|
};
|
|
36320
36375
|
const fire = () => {
|
|
36321
36376
|
ctx.debounceTimer = null;
|
|
36322
|
-
const
|
|
36377
|
+
const resolveDebounce = ctx.debouncedResolve;
|
|
36323
36378
|
ctx.debouncedResolve = null;
|
|
36324
36379
|
ctx.debouncedPromise = null;
|
|
36325
36380
|
if (ctx.inFlight) {
|
|
36326
36381
|
ctx.pending = true;
|
|
36327
|
-
ctx.inFlight.
|
|
36382
|
+
ctx.inFlight.then(resolveDebounce, resolveDebounce);
|
|
36328
36383
|
return;
|
|
36329
36384
|
}
|
|
36330
36385
|
ctx.inFlight = drive();
|
|
36331
|
-
ctx.inFlight.
|
|
36386
|
+
ctx.inFlight.then(resolveDebounce, resolveDebounce);
|
|
36332
36387
|
};
|
|
36333
36388
|
return ({ immediate = false } = {}) => {
|
|
36334
36389
|
if (!ctx.debouncedPromise) {
|
|
36335
|
-
ctx.debouncedPromise = new Promise((
|
|
36336
|
-
ctx.debouncedResolve =
|
|
36390
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
36391
|
+
ctx.debouncedResolve = resolve43;
|
|
36337
36392
|
});
|
|
36338
36393
|
}
|
|
36394
|
+
const scheduled = ctx.debouncedPromise;
|
|
36339
36395
|
if (immediate) {
|
|
36340
36396
|
if (ctx.debounceTimer) {
|
|
36341
36397
|
clearTimeout(ctx.debounceTimer);
|
|
@@ -36348,16 +36404,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36348
36404
|
clearTimeout(ctx.debounceTimer);
|
|
36349
36405
|
ctx.debounceTimer = setTimeout(fire, ANGULAR_BUNDLE_DEBOUNCE_MS);
|
|
36350
36406
|
}
|
|
36351
|
-
return
|
|
36407
|
+
return scheduled;
|
|
36352
36408
|
};
|
|
36353
36409
|
}, runAngularHmrIncremental = async (state, angularDir, _pageEntries) => {
|
|
36354
36410
|
const editedFiles = state.lastUserEditedFiles ?? new Set;
|
|
36355
|
-
const
|
|
36411
|
+
const refreshDisk = async () => {
|
|
36356
36412
|
if (!angularDir || editedFiles.size === 0)
|
|
36357
36413
|
return;
|
|
36358
|
-
const angularDirAbs =
|
|
36414
|
+
const angularDirAbs = resolvePath(angularDir);
|
|
36359
36415
|
const filesUnderAngular = Array.from(editedFiles).filter((file5) => {
|
|
36360
|
-
const abs =
|
|
36416
|
+
const abs = resolvePath(file5);
|
|
36361
36417
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
36362
36418
|
});
|
|
36363
36419
|
if (filesUnderAngular.length === 0)
|
|
@@ -36379,7 +36435,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36379
36435
|
if (!ext)
|
|
36380
36436
|
continue;
|
|
36381
36437
|
if (ext === ".ts" || ext === ".tsx") {
|
|
36382
|
-
tsFilesToRefresh.add(
|
|
36438
|
+
tsFilesToRefresh.add(resolvePath(file5));
|
|
36383
36439
|
continue;
|
|
36384
36440
|
}
|
|
36385
36441
|
const owners = resolveOwningComponents2({
|
|
@@ -36387,7 +36443,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36387
36443
|
userAngularRoot: angularDirAbs
|
|
36388
36444
|
});
|
|
36389
36445
|
for (const owner of owners) {
|
|
36390
|
-
tsFilesToRefresh.add(
|
|
36446
|
+
tsFilesToRefresh.add(resolvePath(owner.componentFilePath));
|
|
36391
36447
|
}
|
|
36392
36448
|
}
|
|
36393
36449
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -36402,23 +36458,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36402
36458
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
36403
36459
|
for (const tsFile of tsFilesToRefresh) {
|
|
36404
36460
|
const rel = relative18(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
36405
|
-
const compiledFile =
|
|
36461
|
+
const compiledFile = resolvePath(compiledRoot, rel);
|
|
36406
36462
|
invalidateModule2(compiledFile);
|
|
36407
36463
|
}
|
|
36408
36464
|
} catch {}
|
|
36409
36465
|
} catch (err) {
|
|
36410
36466
|
logWarn(`[hmr] disk-refresh skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
36411
36467
|
}
|
|
36412
|
-
}
|
|
36468
|
+
};
|
|
36469
|
+
const diskRefreshPromise = refreshDisk();
|
|
36413
36470
|
await diskRefreshPromise;
|
|
36414
36471
|
}, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
|
|
36415
|
-
const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
36472
|
+
const { compileAngular: compileAngular2, compileAngularFileJIT: compileAngularFileJIT2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
36473
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
36416
36474
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
36417
36475
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
36418
36476
|
const projectRoot = process.cwd();
|
|
36419
|
-
const resolvedAngularDir =
|
|
36477
|
+
const resolvedAngularDir = resolvePath(angularDir);
|
|
36420
36478
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
36421
|
-
const
|
|
36479
|
+
const createProvidersInjection = () => {
|
|
36422
36480
|
const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
|
|
36423
36481
|
const basePathByKey = new Map;
|
|
36424
36482
|
for (const call of scan.calls) {
|
|
@@ -36436,18 +36494,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36436
36494
|
appProvidersSource: providersImport?.absolutePath ?? null,
|
|
36437
36495
|
pagesByFile
|
|
36438
36496
|
};
|
|
36439
|
-
}
|
|
36440
|
-
const
|
|
36441
|
-
|
|
36497
|
+
};
|
|
36498
|
+
const providersInjection = createProvidersInjection();
|
|
36499
|
+
const styleTransformConfig = getStyleTransformConfig(state.config);
|
|
36500
|
+
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
36501
|
+
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, styleTransformConfig, providersInjection);
|
|
36502
|
+
if (providersInjection.appProvidersSource) {
|
|
36503
|
+
await compileAngularFileJIT2(providersInjection.appProvidersSource, generatedAngularRoot, resolvedAngularDir, styleTransformConfig);
|
|
36504
|
+
}
|
|
36505
|
+
const primeFingerprints = async () => {
|
|
36442
36506
|
try {
|
|
36443
36507
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
36444
36508
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
36445
|
-
const { join: join46 } = await import("path");
|
|
36446
36509
|
const walk = async (dir) => {
|
|
36447
36510
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
36448
36511
|
const files = [];
|
|
36449
36512
|
for (const entry of entries) {
|
|
36450
|
-
const full =
|
|
36513
|
+
const full = join45(dir, entry.name);
|
|
36451
36514
|
if (entry.isDirectory()) {
|
|
36452
36515
|
files.push(...await walk(full));
|
|
36453
36516
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -36459,7 +36522,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36459
36522
|
const tsFiles = await walk(angularDir);
|
|
36460
36523
|
await Promise.all(tsFiles.map(primeComponentFingerprint2));
|
|
36461
36524
|
} catch {}
|
|
36462
|
-
}
|
|
36525
|
+
};
|
|
36526
|
+
primeFingerprints();
|
|
36463
36527
|
const { getAngularServerVendorPaths: getAngularServerVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
36464
36528
|
const angServerVendorPaths = getAngularServerVendorPaths2();
|
|
36465
36529
|
const ssrPaths = angServerVendorPaths ? serverPaths.map((serverPath) => serverPath.replace(/\.js$/, ".ssr.js")) : serverPaths;
|
|
@@ -36477,11 +36541,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36477
36541
|
serverPaths.forEach((serverPath, idx) => {
|
|
36478
36542
|
const fileBase = basename17(serverPath, ".js");
|
|
36479
36543
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
36480
|
-
state.manifest[toPascal(fileBase)] =
|
|
36544
|
+
state.manifest[toPascal(fileBase)] = resolvePath(ssrPath);
|
|
36481
36545
|
});
|
|
36482
36546
|
if (clientPaths.length > 0) {
|
|
36483
36547
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
36484
36548
|
}
|
|
36549
|
+
await Promise.all(pageEntries.map((entry) => compileAngularFileJIT2(entry, generatedAngularRoot, resolvedAngularDir, styleTransformConfig)));
|
|
36485
36550
|
broadcastToClients(state, {
|
|
36486
36551
|
data: { manifest: state.manifest },
|
|
36487
36552
|
type: "angular-tier-zero-ssr-rebuild-complete"
|
|
@@ -36489,23 +36554,19 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36489
36554
|
}, handleAngularFastPath = async (state, config2, filesToRebuild, startTime, onRebuildComplete) => {
|
|
36490
36555
|
const angularDir = config2.angularDirectory ?? "";
|
|
36491
36556
|
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
36492
|
-
|
|
36493
|
-
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
36494
|
-
}
|
|
36495
|
-
const angularPagesPath = resolve43(angularDir, "pages");
|
|
36557
|
+
const angularPagesPath = resolvePath(angularDir, "pages");
|
|
36496
36558
|
const initialPageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
36497
36559
|
const projectRoot = process.cwd();
|
|
36498
36560
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
36499
36561
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
36500
|
-
const editedProvidersChain = providersImport && angularFiles.some((file5) =>
|
|
36501
|
-
const
|
|
36562
|
+
const editedProvidersChain = providersImport && angularFiles.some((file5) => resolvePath(file5) === resolvePath(providersImport.absolutePath) || resolvePath(file5).startsWith(`${resolvePath(angularDir)}/`));
|
|
36563
|
+
const collectAllPages = () => {
|
|
36502
36564
|
const allPages = [];
|
|
36503
|
-
const { readdirSync: readdirSync9 } = __require("fs");
|
|
36504
36565
|
const walk = (dir) => {
|
|
36505
36566
|
for (const entry of readdirSync9(dir, {
|
|
36506
36567
|
withFileTypes: true
|
|
36507
36568
|
})) {
|
|
36508
|
-
const full =
|
|
36569
|
+
const full = resolvePath(dir, entry.name);
|
|
36509
36570
|
if (entry.isDirectory())
|
|
36510
36571
|
walk(full);
|
|
36511
36572
|
else if (entry.isFile() && entry.name.endsWith(".ts"))
|
|
@@ -36516,7 +36577,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36516
36577
|
walk(angularPagesPath);
|
|
36517
36578
|
} catch {}
|
|
36518
36579
|
return allPages;
|
|
36519
|
-
}
|
|
36580
|
+
};
|
|
36581
|
+
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? collectAllPages() : initialPageEntries;
|
|
36520
36582
|
const tierStart = performance.now();
|
|
36521
36583
|
const verdict = await decideAngularTier(state, angularDir);
|
|
36522
36584
|
const tierMs = (performance.now() - tierStart).toFixed(0);
|
|
@@ -36525,14 +36587,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36525
36587
|
if (verdict.tier === 0) {
|
|
36526
36588
|
await runAngularHmrIncremental(state, angularDir, pageEntries);
|
|
36527
36589
|
broadcastSurgical(state, verdict.queue);
|
|
36528
|
-
const
|
|
36529
|
-
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${
|
|
36590
|
+
const rightValue = verdict.breakdown;
|
|
36591
|
+
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
36530
36592
|
runBundle();
|
|
36531
36593
|
} else if (verdict.tier === 1 && verdict.kind === "remount") {
|
|
36532
36594
|
await runAngularHmrIncremental(state, angularDir, pageEntries);
|
|
36533
36595
|
broadcastRemount(state, verdict.queue);
|
|
36534
|
-
const
|
|
36535
|
-
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${
|
|
36596
|
+
const rightValue = verdict.breakdown;
|
|
36597
|
+
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
36536
36598
|
runBundle();
|
|
36537
36599
|
} else if (verdict.tier === 1 && verdict.kind === "rebootstrap") {
|
|
36538
36600
|
await runBundle({ immediate: true });
|
|
@@ -36556,12 +36618,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36556
36618
|
if (isComponentFile2)
|
|
36557
36619
|
return primaryFile;
|
|
36558
36620
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
36559
|
-
const nearest = findNearestComponent2(
|
|
36621
|
+
const nearest = findNearestComponent2(resolvePath(primaryFile));
|
|
36560
36622
|
return nearest ?? primaryFile;
|
|
36561
36623
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
36562
|
-
for (const file5 of reactFiles) {
|
|
36563
|
-
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
36564
|
-
}
|
|
36565
36624
|
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
36566
36625
|
if (!primaryFile) {
|
|
36567
36626
|
onRebuildComplete({
|
|
@@ -36715,12 +36774,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36715
36774
|
type: "svelte-update"
|
|
36716
36775
|
});
|
|
36717
36776
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config2, startTime, onRebuildComplete) => {
|
|
36718
|
-
for (const file5 of svelteFiles) {
|
|
36719
|
-
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
36720
|
-
}
|
|
36721
36777
|
const surgicallyHandled = state.svelteSurgicallyHandled ?? new Set;
|
|
36722
36778
|
for (const file5 of svelteFiles) {
|
|
36723
|
-
surgicallyHandled.add(
|
|
36779
|
+
surgicallyHandled.add(resolvePath(file5));
|
|
36724
36780
|
}
|
|
36725
36781
|
state.svelteSurgicallyHandled = surgicallyHandled;
|
|
36726
36782
|
const serverDuration = Date.now() - startTime;
|
|
@@ -36850,16 +36906,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36850
36906
|
ctx.debouncedPromise = null;
|
|
36851
36907
|
if (ctx.inFlight) {
|
|
36852
36908
|
ctx.pending = true;
|
|
36853
|
-
ctx.inFlight.
|
|
36909
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
36854
36910
|
return;
|
|
36855
36911
|
}
|
|
36856
36912
|
ctx.inFlight = drive();
|
|
36857
|
-
ctx.inFlight.
|
|
36913
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
36858
36914
|
};
|
|
36859
36915
|
return () => {
|
|
36860
36916
|
if (!ctx.debouncedPromise) {
|
|
36861
|
-
ctx.debouncedPromise = new Promise((
|
|
36862
|
-
ctx.debouncedResolve =
|
|
36917
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
36918
|
+
ctx.debouncedResolve = resolve43;
|
|
36863
36919
|
});
|
|
36864
36920
|
}
|
|
36865
36921
|
if (ctx.debounceTimer)
|
|
@@ -36979,9 +37035,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
36979
37035
|
type: "vue-update"
|
|
36980
37036
|
});
|
|
36981
37037
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config2, startTime, onRebuildComplete) => {
|
|
36982
|
-
for (const file5 of [...vueFiles, ...nonVueFiles]) {
|
|
36983
|
-
state.fileHashes.set(resolve43(file5), computeFileHash(file5));
|
|
36984
|
-
}
|
|
36985
37038
|
await invalidateNonVueModules(nonVueFiles);
|
|
36986
37039
|
const serverDuration = Date.now() - startTime;
|
|
36987
37040
|
const forceReload = nonVueFiles.length > 0;
|
|
@@ -37128,16 +37181,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37128
37181
|
ctx.debouncedPromise = null;
|
|
37129
37182
|
if (ctx.inFlight) {
|
|
37130
37183
|
ctx.pending = true;
|
|
37131
|
-
ctx.inFlight.
|
|
37184
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
37132
37185
|
return;
|
|
37133
37186
|
}
|
|
37134
37187
|
ctx.inFlight = drive();
|
|
37135
|
-
ctx.inFlight.
|
|
37188
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
37136
37189
|
};
|
|
37137
37190
|
return () => {
|
|
37138
37191
|
if (!ctx.debouncedPromise) {
|
|
37139
|
-
ctx.debouncedPromise = new Promise((
|
|
37140
|
-
ctx.debouncedResolve =
|
|
37192
|
+
ctx.debouncedPromise = new Promise((resolve43) => {
|
|
37193
|
+
ctx.debouncedResolve = resolve43;
|
|
37141
37194
|
});
|
|
37142
37195
|
}
|
|
37143
37196
|
if (ctx.debounceTimer)
|
|
@@ -37161,7 +37214,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37161
37214
|
recursive: true,
|
|
37162
37215
|
withFileTypes: true
|
|
37163
37216
|
});
|
|
37164
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
37217
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolvePath(emberPagesPath, entry.name));
|
|
37165
37218
|
} catch {
|
|
37166
37219
|
return [];
|
|
37167
37220
|
}
|
|
@@ -37172,11 +37225,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37172
37225
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
37173
37226
|
return state.manifest;
|
|
37174
37227
|
}
|
|
37175
|
-
|
|
37176
|
-
|
|
37177
|
-
}
|
|
37178
|
-
const emberPagesPath = resolve43(emberDir, "pages");
|
|
37179
|
-
const directPageEntries = emberFiles.filter((file5) => resolve43(file5).startsWith(emberPagesPath));
|
|
37228
|
+
const emberPagesPath = resolvePath(emberDir, "pages");
|
|
37229
|
+
const directPageEntries = emberFiles.filter((file5) => resolvePath(file5).startsWith(emberPagesPath));
|
|
37180
37230
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
37181
37231
|
if (allPageEntries.length === 0) {
|
|
37182
37232
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -37186,7 +37236,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37186
37236
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
37187
37237
|
for (const serverPath of serverPaths) {
|
|
37188
37238
|
const fileBase = basename17(serverPath, ".js");
|
|
37189
|
-
state.manifest[toPascal(fileBase)] =
|
|
37239
|
+
state.manifest[toPascal(fileBase)] = resolvePath(serverPath);
|
|
37190
37240
|
}
|
|
37191
37241
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
37192
37242
|
invalidateEmberSsrCache2();
|
|
@@ -37279,8 +37329,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37279
37329
|
if (!buildReference?.source) {
|
|
37280
37330
|
return;
|
|
37281
37331
|
}
|
|
37282
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
37283
|
-
islandFiles.add(
|
|
37332
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname28(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
37333
|
+
islandFiles.add(resolvePath(sourcePath));
|
|
37284
37334
|
}, resolveIslandSourceFiles = async (config2) => {
|
|
37285
37335
|
const registryPath = config2.islands?.registry;
|
|
37286
37336
|
if (!registryPath) {
|
|
@@ -37288,7 +37338,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37288
37338
|
}
|
|
37289
37339
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
37290
37340
|
const islandFiles = new Set([
|
|
37291
|
-
|
|
37341
|
+
resolvePath(buildInfo.resolvedRegistryPath)
|
|
37292
37342
|
]);
|
|
37293
37343
|
for (const definition of buildInfo.definitions) {
|
|
37294
37344
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -37299,7 +37349,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37299
37349
|
if (islandFiles.size === 0) {
|
|
37300
37350
|
return false;
|
|
37301
37351
|
}
|
|
37302
|
-
return filesToRebuild.some((file5) => islandFiles.has(
|
|
37352
|
+
return filesToRebuild.some((file5) => islandFiles.has(resolvePath(file5)));
|
|
37303
37353
|
}, handleIslandSourceReload = async (state, config2, filesToRebuild, manifest) => {
|
|
37304
37354
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config2, filesToRebuild);
|
|
37305
37355
|
if (!shouldReload) {
|
|
@@ -37334,10 +37384,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37334
37384
|
}, computeOutputPagesDir = (state, config2, framework) => {
|
|
37335
37385
|
const isSingle = !config2.reactDirectory && !config2.svelteDirectory && !config2.vueDirectory && (framework === "html" ? !config2.htmxDirectory : !config2.htmlDirectory);
|
|
37336
37386
|
if (isSingle) {
|
|
37337
|
-
return
|
|
37387
|
+
return resolvePath(state.resolvedPaths.buildDir, "pages");
|
|
37338
37388
|
}
|
|
37339
37389
|
const dirName = framework === "html" ? basename17(config2.htmlDirectory ?? "html") : basename17(config2.htmxDirectory ?? "htmx");
|
|
37340
|
-
return
|
|
37390
|
+
return resolvePath(state.resolvedPaths.buildDir, dirName, "pages");
|
|
37341
37391
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration3) => {
|
|
37342
37392
|
try {
|
|
37343
37393
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -37377,7 +37427,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37377
37427
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
37378
37428
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
37379
37429
|
const htmlPageName = basename17(pageFile);
|
|
37380
|
-
const builtHtmlPagePath =
|
|
37430
|
+
const builtHtmlPagePath = resolvePath(outputHtmlPages, htmlPageName);
|
|
37381
37431
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration3);
|
|
37382
37432
|
});
|
|
37383
37433
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration3) => {
|
|
@@ -37442,7 +37492,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37442
37492
|
const cssKey = `${pascalName}CSS`;
|
|
37443
37493
|
const cssUrl = manifest[cssKey] || null;
|
|
37444
37494
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
37445
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
37495
|
+
const hmrMeta = vueHmrMetadata2.get(resolvePath(vuePagePath));
|
|
37446
37496
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
37447
37497
|
if (changeType === "style-only") {
|
|
37448
37498
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration3);
|
|
@@ -37541,7 +37591,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37541
37591
|
handleSvelteCssOnlyUpdate(state, svelteCssFiles, manifest, duration3);
|
|
37542
37592
|
}
|
|
37543
37593
|
const surgicallyHandled = state.svelteSurgicallyHandled;
|
|
37544
|
-
pagesToUpdate.filter((sveltePagePath) => !surgicallyHandled?.has(
|
|
37594
|
+
pagesToUpdate.filter((sveltePagePath) => !surgicallyHandled?.has(resolvePath(sveltePagePath))).forEach((sveltePagePath) => {
|
|
37545
37595
|
broadcastSveltePageUpdate(state, sveltePagePath, manifest, duration3);
|
|
37546
37596
|
});
|
|
37547
37597
|
}, handleAngularCssOnlyUpdate = (state, angularCssFiles, manifest, duration3) => {
|
|
@@ -37631,7 +37681,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37631
37681
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
37632
37682
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
37633
37683
|
const htmxPageName = basename17(htmxPageFile);
|
|
37634
|
-
const builtHtmxPagePath =
|
|
37684
|
+
const builtHtmxPagePath = resolvePath(outputHtmxPages, htmxPageName);
|
|
37635
37685
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration3);
|
|
37636
37686
|
});
|
|
37637
37687
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -37740,7 +37790,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37740
37790
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
37741
37791
|
writeFs(destPath, html);
|
|
37742
37792
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
37743
|
-
const destPath =
|
|
37793
|
+
const destPath = resolvePath(outputDir, basename17(sourceFile));
|
|
37744
37794
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
37745
37795
|
const source = await Bun.file(sourceFile).text();
|
|
37746
37796
|
await Bun.write(destPath, source);
|
|
@@ -37826,6 +37876,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37826
37876
|
await fastPath.handler(state, config2, files, startTime, onRebuildComplete);
|
|
37827
37877
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
37828
37878
|
});
|
|
37879
|
+
const configPath2 = resolvePath(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
37880
|
+
if (affectedFrameworks.includes("angular") && files.includes(configPath2) && !state.lastUserEditedFiles?.has(configPath2)) {
|
|
37881
|
+
handled.add(configPath2);
|
|
37882
|
+
}
|
|
37829
37883
|
return files.every((f2) => handled.has(f2));
|
|
37830
37884
|
}, performFullRebuild = async (state, config2, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete) => {
|
|
37831
37885
|
state.svelteSurgicallyHandled = undefined;
|
|
@@ -37912,7 +37966,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
37912
37966
|
});
|
|
37913
37967
|
if (config2.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
37914
37968
|
try {
|
|
37915
|
-
const outputPath =
|
|
37969
|
+
const outputPath = resolvePath(state.resolvedPaths.buildDir, config2.tailwind.output);
|
|
37916
37970
|
const bytes = await Bun.file(outputPath).bytes();
|
|
37917
37971
|
const webPath = `/${config2.tailwind.output.replace(/^\/+/, "")}`;
|
|
37918
37972
|
state.assetStore.set(webPath, bytes);
|
|
@@ -38084,7 +38138,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
38084
38138
|
} catch {
|
|
38085
38139
|
return false;
|
|
38086
38140
|
}
|
|
38087
|
-
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file5) => file5.includes("node_modules") || file5.includes("/build/") || file5.includes("/dist/") || file5.includes("/indexes/") ||
|
|
38141
|
+
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file5) => file5.includes("node_modules") || file5.includes("/build/") || file5.includes("/dist/") || file5.includes("/indexes/") || isTestSourcePath(file5), isDepSpecifier = (path) => isBareSpecifier2(path) && !isBuiltin(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file5, transpiler6) => {
|
|
38088
38142
|
const dep = [];
|
|
38089
38143
|
const framework = [];
|
|
38090
38144
|
try {
|
|
@@ -38393,7 +38447,7 @@ __export(exports_devBuild, {
|
|
|
38393
38447
|
});
|
|
38394
38448
|
import { readdir as readdir5 } from "fs/promises";
|
|
38395
38449
|
import { statSync as statSync7 } from "fs";
|
|
38396
|
-
import { resolve as
|
|
38450
|
+
import { resolve as resolve43 } from "path";
|
|
38397
38451
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
38398
38452
|
const configuredDirs = [
|
|
38399
38453
|
config2.reactDirectory,
|
|
@@ -38416,7 +38470,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38416
38470
|
return Object.keys(config2).length > 0 ? config2 : null;
|
|
38417
38471
|
}, reloadConfig = async () => {
|
|
38418
38472
|
try {
|
|
38419
|
-
const configPath2 =
|
|
38473
|
+
const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
38420
38474
|
const source = await Bun.file(configPath2).text();
|
|
38421
38475
|
return parseDirectoryConfig(source);
|
|
38422
38476
|
} catch {
|
|
@@ -38528,7 +38582,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38528
38582
|
});
|
|
38529
38583
|
}
|
|
38530
38584
|
}, handleCachedReload = async () => {
|
|
38531
|
-
const serverMtime = statSync7(
|
|
38585
|
+
const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
38532
38586
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
38533
38587
|
globalThis.__hmrServerMtime = serverMtime;
|
|
38534
38588
|
const cached2 = globalThis.__hmrDevResult;
|
|
@@ -38565,8 +38619,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38565
38619
|
return true;
|
|
38566
38620
|
}, resolveAbsoluteVersion2 = async () => {
|
|
38567
38621
|
const candidates = [
|
|
38568
|
-
|
|
38569
|
-
|
|
38622
|
+
resolve43(import.meta.dir, "..", "..", "package.json"),
|
|
38623
|
+
resolve43(import.meta.dir, "..", "package.json")
|
|
38570
38624
|
];
|
|
38571
38625
|
const [candidate, ...remaining] = candidates;
|
|
38572
38626
|
if (!candidate) {
|
|
@@ -38592,7 +38646,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38592
38646
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
38593
38647
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
38594
38648
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
38595
|
-
const bytes = await Bun.file(
|
|
38649
|
+
const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
|
|
38596
38650
|
assetStore.set(webPath, bytes);
|
|
38597
38651
|
}));
|
|
38598
38652
|
}, devBuild = async (config2) => {
|
|
@@ -38728,11 +38782,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38728
38782
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
38729
38783
|
recordStep("populate asset store", stepStartedAt);
|
|
38730
38784
|
stepStartedAt = performance.now();
|
|
38731
|
-
const reactVendorDir =
|
|
38732
|
-
const angularVendorDir =
|
|
38733
|
-
const svelteVendorDir =
|
|
38734
|
-
const vueVendorDir =
|
|
38735
|
-
const depVendorDir =
|
|
38785
|
+
const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
|
|
38786
|
+
const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
38787
|
+
const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
38788
|
+
const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
38789
|
+
const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
|
|
38736
38790
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
38737
38791
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
38738
38792
|
config2.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -38813,7 +38867,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config2) => {
|
|
|
38813
38867
|
manifest
|
|
38814
38868
|
};
|
|
38815
38869
|
globalThis.__hmrDevResult = result;
|
|
38816
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
38870
|
+
globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
|
|
38817
38871
|
return result;
|
|
38818
38872
|
};
|
|
38819
38873
|
var init_devBuild = __esm(() => {
|
|
@@ -38958,8 +39012,8 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
38958
39012
|
return null;
|
|
38959
39013
|
if (!pathname.startsWith("/"))
|
|
38960
39014
|
return null;
|
|
38961
|
-
const { resolve:
|
|
38962
|
-
const candidate =
|
|
39015
|
+
const { resolve: resolve44, normalize } = await import("path");
|
|
39016
|
+
const candidate = resolve44(buildDir, pathname.slice(1));
|
|
38963
39017
|
const normalizedBuild = normalize(buildDir);
|
|
38964
39018
|
if (!candidate.startsWith(normalizedBuild))
|
|
38965
39019
|
return null;
|
|
@@ -39021,6 +39075,7 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
39021
39075
|
open: (ws) => handleClientConnect(hmrState2, ws, manifest)
|
|
39022
39076
|
}).get("/hmr-status", () => ({
|
|
39023
39077
|
connectedClients: hmrState2.connectedClients.size,
|
|
39078
|
+
entryWatcherReady: globalThis.__absoluteEntryWatcherReady === true,
|
|
39024
39079
|
isRebuilding: hmrState2.isRebuilding,
|
|
39025
39080
|
manifestKeys: Object.keys(manifest),
|
|
39026
39081
|
rebuildCount: hmrState2.rebuildCount,
|
|
@@ -39043,12 +39098,12 @@ __export(exports_devtoolsJson, {
|
|
|
39043
39098
|
devtoolsJson: () => devtoolsJson
|
|
39044
39099
|
});
|
|
39045
39100
|
import { existsSync as existsSync37, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync10 } from "fs";
|
|
39046
|
-
import { dirname as dirname29, join as join47, resolve as
|
|
39101
|
+
import { dirname as dirname29, join as join47, resolve as resolve44 } from "path";
|
|
39047
39102
|
import { Elysia as Elysia4 } from "elysia";
|
|
39048
39103
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid3) => {
|
|
39049
39104
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid3);
|
|
39050
39105
|
return uuid3;
|
|
39051
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
39106
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve44(uuidCachePath ?? join47(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
39052
39107
|
if (!existsSync37(cachePath))
|
|
39053
39108
|
return null;
|
|
39054
39109
|
try {
|
|
@@ -39074,7 +39129,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
39074
39129
|
writeFileSync10(cachePath, uuid3, "utf-8");
|
|
39075
39130
|
return setGlobalUuid(uuid3);
|
|
39076
39131
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
39077
|
-
const rootPath =
|
|
39132
|
+
const rootPath = resolve44(options.projectRoot ?? process.cwd());
|
|
39078
39133
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
39079
39134
|
const uuid3 = getOrCreateUuid(buildDir, options);
|
|
39080
39135
|
return new Elysia4({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -39103,7 +39158,7 @@ __export(exports_imageOptimizer, {
|
|
|
39103
39158
|
imageOptimizer: () => imageOptimizer
|
|
39104
39159
|
});
|
|
39105
39160
|
import { existsSync as existsSync38 } from "fs";
|
|
39106
|
-
import { resolve as
|
|
39161
|
+
import { resolve as resolve45 } from "path";
|
|
39107
39162
|
import { Elysia as Elysia5 } from "elysia";
|
|
39108
39163
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
39109
39164
|
try {
|
|
@@ -39116,7 +39171,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
39116
39171
|
}
|
|
39117
39172
|
}, resolveLocalImage = (url2, buildDir) => {
|
|
39118
39173
|
const cleanPath = url2.startsWith("/") ? url2.slice(1) : url2;
|
|
39119
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
39174
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve45(process.cwd()));
|
|
39120
39175
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
39121
39176
|
const url2 = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
39122
39177
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -39725,38 +39780,92 @@ var init_prerender = () => {};
|
|
|
39725
39780
|
var exports_serverEntryWatcher = {};
|
|
39726
39781
|
__export(exports_serverEntryWatcher, {
|
|
39727
39782
|
startServerEntryWatcher: () => startServerEntryWatcher,
|
|
39783
|
+
startFilePollingFallback: () => startFilePollingFallback,
|
|
39728
39784
|
isAtomicWriteTemp: () => isAtomicWriteTemp
|
|
39729
39785
|
});
|
|
39730
|
-
import {
|
|
39731
|
-
|
|
39732
|
-
|
|
39733
|
-
|
|
39786
|
+
import {
|
|
39787
|
+
copyFileSync as copyFileSync4,
|
|
39788
|
+
existsSync as existsSync41,
|
|
39789
|
+
readdirSync as readdirSync12,
|
|
39790
|
+
readFileSync as readFileSync36,
|
|
39791
|
+
statSync as statSync8,
|
|
39792
|
+
watch as watch2
|
|
39793
|
+
} from "fs";
|
|
39794
|
+
import { createHash as createHash6 } from "crypto";
|
|
39795
|
+
import { dirname as dirname30, join as join52, resolve as resolve46 } from "path";
|
|
39796
|
+
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
39797
|
+
try {
|
|
39798
|
+
return createHash6("sha256").update(readFileSync36(path)).digest("hex");
|
|
39799
|
+
} catch {
|
|
39800
|
+
return null;
|
|
39801
|
+
}
|
|
39802
|
+
}, startFilePollingFallback = (path, onChange, interval = WATCH_FALLBACK_INTERVAL_MS) => {
|
|
39803
|
+
let previousHash = fileHash(path);
|
|
39804
|
+
const timer = setInterval(() => {
|
|
39805
|
+
const nextHash = fileHash(path);
|
|
39806
|
+
if (!nextHash || nextHash === previousHash)
|
|
39807
|
+
return;
|
|
39808
|
+
previousHash = nextHash;
|
|
39809
|
+
onChange();
|
|
39810
|
+
}, interval);
|
|
39811
|
+
timer.unref();
|
|
39812
|
+
return {
|
|
39813
|
+
close: () => clearInterval(timer)
|
|
39814
|
+
};
|
|
39815
|
+
}, startServerEntryWatcher = () => {
|
|
39734
39816
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
39735
39817
|
return;
|
|
39736
|
-
const
|
|
39737
|
-
if (!
|
|
39818
|
+
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
39819
|
+
if (!originalEntry || !existsSync41(originalEntry))
|
|
39738
39820
|
return;
|
|
39739
39821
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
39740
|
-
|
|
39822
|
+
globalThis.__absoluteEntryWatcherReady = false;
|
|
39823
|
+
const entryPath = resolve46(originalEntry);
|
|
39741
39824
|
const entryDir = dirname30(entryPath);
|
|
39742
39825
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
39743
|
-
const configPath2 =
|
|
39826
|
+
const configPath2 = resolve46(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
39744
39827
|
const configDir2 = dirname30(configPath2);
|
|
39745
39828
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
39746
39829
|
const recentlyHandled = new Map;
|
|
39747
39830
|
let entryReloadTimer = null;
|
|
39748
39831
|
let configReloadTimer = null;
|
|
39749
|
-
|
|
39832
|
+
let acceptedEntryHash = fileHash(entryPath);
|
|
39833
|
+
let entryReloadInFlight = false;
|
|
39834
|
+
let pendingEntryCause = null;
|
|
39835
|
+
let siblingSequence = 0;
|
|
39836
|
+
const importFreshEntry = async (attempt = 1) => {
|
|
39837
|
+
const siblingPath = join52(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
39838
|
+
let failure;
|
|
39839
|
+
try {
|
|
39840
|
+
copyFileSync4(entryPath, siblingPath);
|
|
39841
|
+
globalThis.__absoluteEntryCopies?.add(siblingPath);
|
|
39842
|
+
await import(siblingPath);
|
|
39843
|
+
} catch (error) {
|
|
39844
|
+
failure = error;
|
|
39845
|
+
}
|
|
39846
|
+
if (failure === undefined)
|
|
39847
|
+
return;
|
|
39848
|
+
const message = failure instanceof Error ? failure.message : String(failure);
|
|
39849
|
+
if (message.includes("Unexpected end of file") && attempt < MAX_ENTRY_IMPORT_ATTEMPTS) {
|
|
39850
|
+
await Bun.sleep(ENTRY_IMPORT_RETRY_DELAY_MS);
|
|
39851
|
+
await importFreshEntry(attempt + 1);
|
|
39852
|
+
return;
|
|
39853
|
+
}
|
|
39854
|
+
throw failure;
|
|
39855
|
+
};
|
|
39750
39856
|
const triggerEntryReload = async (cause) => {
|
|
39751
|
-
const
|
|
39752
|
-
|
|
39753
|
-
|
|
39857
|
+
const nextHash = fileHash(entryPath);
|
|
39858
|
+
if (!nextHash || nextHash === acceptedEntryHash)
|
|
39859
|
+
return;
|
|
39860
|
+
if (entryReloadInFlight) {
|
|
39861
|
+
pendingEntryCause = cause;
|
|
39754
39862
|
return;
|
|
39755
|
-
|
|
39863
|
+
}
|
|
39864
|
+
entryReloadInFlight = true;
|
|
39865
|
+
acceptedEntryHash = nextHash;
|
|
39756
39866
|
try {
|
|
39757
39867
|
console.log(`[hmr] reloading server entry (${cause})`);
|
|
39758
|
-
|
|
39759
|
-
await import(entryPath);
|
|
39868
|
+
await importFreshEntry();
|
|
39760
39869
|
const hmrState2 = globalThis.__hmrDevResult?.hmrState;
|
|
39761
39870
|
if (hmrState2) {
|
|
39762
39871
|
const { broadcastToClients: broadcastToClients2 } = await Promise.resolve().then(() => (init_webSocket(), exports_webSocket));
|
|
@@ -39768,6 +39877,13 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
39768
39877
|
} catch (err) {
|
|
39769
39878
|
console.error(`[hmr] entry re-evaluation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
39770
39879
|
console.log(`[abs:restart] ${entryPath}`);
|
|
39880
|
+
} finally {
|
|
39881
|
+
entryReloadInFlight = false;
|
|
39882
|
+
if (pendingEntryCause) {
|
|
39883
|
+
const pendingCause = pendingEntryCause;
|
|
39884
|
+
pendingEntryCause = null;
|
|
39885
|
+
triggerEntryReload(pendingCause);
|
|
39886
|
+
}
|
|
39771
39887
|
}
|
|
39772
39888
|
};
|
|
39773
39889
|
const triggerConfigChange = async (cause) => {
|
|
@@ -39817,8 +39933,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
39817
39933
|
const recoveryScan = (dir) => {
|
|
39818
39934
|
let entries;
|
|
39819
39935
|
try {
|
|
39820
|
-
|
|
39821
|
-
entries = readdirSync11(dir, { withFileTypes: true });
|
|
39936
|
+
entries = readdirSync12(dir, { withFileTypes: true });
|
|
39822
39937
|
} catch {
|
|
39823
39938
|
return;
|
|
39824
39939
|
}
|
|
@@ -39864,7 +39979,14 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
39864
39979
|
if (configDir2 !== entryDir) {
|
|
39865
39980
|
configWatcher = watch2(configDir2, { recursive: false }, (event, file5) => handleEvent(configDir2, event, file5));
|
|
39866
39981
|
}
|
|
39982
|
+
const fallbackWatcher = startFilePollingFallback(entryPath, () => scheduleEntryReload(entryBase));
|
|
39983
|
+
const postInstallEntryHash = fileHash(entryPath);
|
|
39984
|
+
if (postInstallEntryHash && postInstallEntryHash !== acceptedEntryHash) {
|
|
39985
|
+
scheduleEntryReload(entryBase);
|
|
39986
|
+
}
|
|
39987
|
+
globalThis.__absoluteEntryWatcherReady = true;
|
|
39867
39988
|
const closeAll = () => {
|
|
39989
|
+
fallbackWatcher.close();
|
|
39868
39990
|
try {
|
|
39869
39991
|
entryWatcher.close();
|
|
39870
39992
|
} catch {}
|
|
@@ -40065,6 +40187,8 @@ var hmrState = {
|
|
|
40065
40187
|
pingInterval: null,
|
|
40066
40188
|
reconnectTimeout: null
|
|
40067
40189
|
};
|
|
40190
|
+
// types/websocket.ts
|
|
40191
|
+
var WS_READY_STATE_OPEN = 1;
|
|
40068
40192
|
// src/build/index.ts
|
|
40069
40193
|
init_compileTailwind();
|
|
40070
40194
|
init_tailwindCompiler();
|
|
@@ -40401,8 +40525,8 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
40401
40525
|
};
|
|
40402
40526
|
// src/core/prepare.ts
|
|
40403
40527
|
import { createHash as createHash5 } from "crypto";
|
|
40404
|
-
import { existsSync as existsSync39, readdirSync as
|
|
40405
|
-
import { basename as basename18, join as join49, relative as relative19, resolve as
|
|
40528
|
+
import { existsSync as existsSync39, readdirSync as readdirSync10, readFileSync as readFileSync33 } from "fs";
|
|
40529
|
+
import { basename as basename18, join as join49, relative as relative19, resolve as resolvePath2 } from "path";
|
|
40406
40530
|
import { Elysia as Elysia8 } from "elysia";
|
|
40407
40531
|
|
|
40408
40532
|
// src/plugins/openApiPlugin.ts
|
|
@@ -40558,19 +40682,23 @@ var MS_PER_SECOND2 = 1000;
|
|
|
40558
40682
|
var DEFAULT_PORT2 = 3000;
|
|
40559
40683
|
var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
|
|
40560
40684
|
var STATIC_PLUGIN_RETRY_DELAY_MS = 50;
|
|
40685
|
+
var waitForStaticPluginRetry = () => new Promise((resolve46) => {
|
|
40686
|
+
setTimeout(resolve46, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
40687
|
+
});
|
|
40688
|
+
var retryStaticPlugin = async (createStaticPlugin, options) => {
|
|
40689
|
+
try {
|
|
40690
|
+
return await createStaticPlugin(options);
|
|
40691
|
+
} catch (error) {
|
|
40692
|
+
logWarn(`Static asset routes were skipped this cycle \u2014 a build file was unavailable mid-rebuild: ${error instanceof Error ? error.message : String(error)}`);
|
|
40693
|
+
return new Elysia8({ name: "absolutejs-static-fallback" });
|
|
40694
|
+
}
|
|
40695
|
+
};
|
|
40561
40696
|
var mountStaticPlugin = async (createStaticPlugin, options) => {
|
|
40562
40697
|
try {
|
|
40563
40698
|
return await createStaticPlugin(options);
|
|
40564
40699
|
} catch {
|
|
40565
|
-
await
|
|
40566
|
-
|
|
40567
|
-
});
|
|
40568
|
-
try {
|
|
40569
|
-
return await createStaticPlugin(options);
|
|
40570
|
-
} catch (error) {
|
|
40571
|
-
logWarn(`Static asset routes were skipped this cycle \u2014 a build file was unavailable mid-rebuild: ${error instanceof Error ? error.message : String(error)}`);
|
|
40572
|
-
return new Elysia8({ name: "absolutejs-static-fallback" });
|
|
40573
|
-
}
|
|
40700
|
+
await waitForStaticPluginRetry();
|
|
40701
|
+
return retryStaticPlugin(createStaticPlugin, options);
|
|
40574
40702
|
}
|
|
40575
40703
|
};
|
|
40576
40704
|
var buildPrewarmDirs = (config2) => {
|
|
@@ -40598,7 +40726,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
40598
40726
|
for (const { dir, pattern } of prewarmDirs) {
|
|
40599
40727
|
const glob = new Glob11(pattern);
|
|
40600
40728
|
const matches = [
|
|
40601
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
40729
|
+
...glob.scanSync({ absolute: true, cwd: resolvePath2(dir) })
|
|
40602
40730
|
];
|
|
40603
40731
|
files.push(...matches);
|
|
40604
40732
|
}
|
|
@@ -40634,7 +40762,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
40634
40762
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
40635
40763
|
if (!fileName)
|
|
40636
40764
|
continue;
|
|
40637
|
-
const srcPath =
|
|
40765
|
+
const srcPath = resolvePath2(devIndexDir, fileName);
|
|
40638
40766
|
if (!existsSync39(srcPath))
|
|
40639
40767
|
continue;
|
|
40640
40768
|
const rel = relative19(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
@@ -40727,7 +40855,7 @@ var prepareDev = async (config2, buildDir) => {
|
|
|
40727
40855
|
stepStartedAt = performance.now();
|
|
40728
40856
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
40729
40857
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
40730
|
-
const devIndexDir =
|
|
40858
|
+
const devIndexDir = resolvePath2(buildDir, "_src_indexes");
|
|
40731
40859
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
40732
40860
|
recordStep("configure dev plugins", stepStartedAt);
|
|
40733
40861
|
stepStartedAt = performance.now();
|
|
@@ -40771,7 +40899,7 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
40771
40899
|
return map3;
|
|
40772
40900
|
let entries;
|
|
40773
40901
|
try {
|
|
40774
|
-
entries =
|
|
40902
|
+
entries = readdirSync10(prerenderDir);
|
|
40775
40903
|
} catch {
|
|
40776
40904
|
return map3;
|
|
40777
40905
|
}
|
|
@@ -40823,7 +40951,7 @@ var prepare = async (configOrPath) => {
|
|
|
40823
40951
|
recordStep("load config", stepStartedAt);
|
|
40824
40952
|
const nodeEnv = process.env["NODE_ENV"];
|
|
40825
40953
|
const isDev3 = nodeEnv === "development";
|
|
40826
|
-
const buildDir =
|
|
40954
|
+
const buildDir = resolvePath2(process.env.ABSOLUTE_BUILD_DIR ?? config2.buildDirectory ?? "build");
|
|
40827
40955
|
registerIconVersioning(buildDir);
|
|
40828
40956
|
if (isDev3) {
|
|
40829
40957
|
stepStartedAt = performance.now();
|
|
@@ -40863,7 +40991,7 @@ var prepare = async (configOrPath) => {
|
|
|
40863
40991
|
const generatedAssetsPlugin = new Elysia8({
|
|
40864
40992
|
name: "absolutejs-generated-assets"
|
|
40865
40993
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
40866
|
-
const requestedPath =
|
|
40994
|
+
const requestedPath = resolvePath2(generatedAssetsRoot, params["*"]);
|
|
40867
40995
|
if (relative19(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
40868
40996
|
set.status = 404;
|
|
40869
40997
|
return "Not Found";
|
|
@@ -41085,7 +41213,7 @@ var loadDevCert = () => {
|
|
|
41085
41213
|
import {
|
|
41086
41214
|
mkdirSync as mkdirSync18,
|
|
41087
41215
|
readFileSync as readFileSync35,
|
|
41088
|
-
readdirSync as
|
|
41216
|
+
readdirSync as readdirSync11,
|
|
41089
41217
|
unlinkSync as unlinkSync2,
|
|
41090
41218
|
writeFileSync as writeFileSync11
|
|
41091
41219
|
} from "fs";
|
|
@@ -41181,6 +41309,7 @@ var loadTls = () => {
|
|
|
41181
41309
|
};
|
|
41182
41310
|
var tls = loadTls();
|
|
41183
41311
|
var protocol = tls ? "https" : "http";
|
|
41312
|
+
var isRecord8 = (value) => typeof value === "object" && value !== null;
|
|
41184
41313
|
var resolveHttpIdleTimeout = () => {
|
|
41185
41314
|
const raw = env4.ABSOLUTE_IDLE_TIMEOUT;
|
|
41186
41315
|
if (raw === undefined || raw.trim() === "") {
|
|
@@ -41235,16 +41364,15 @@ var networking = (app) => {
|
|
|
41235
41364
|
const liveServer = globalThis.__absoluteBunServer;
|
|
41236
41365
|
if (liveServer && typeof liveServer.reload === "function") {
|
|
41237
41366
|
const prevStore = globalThis.__absolutePreviousAppStore;
|
|
41238
|
-
if (prevStore && app.store
|
|
41367
|
+
if (prevStore && isRecord8(app.store)) {
|
|
41239
41368
|
const newStore = app.store;
|
|
41240
|
-
const oldStore = prevStore;
|
|
41241
41369
|
for (const key of Object.keys(newStore)) {
|
|
41242
|
-
if (key in
|
|
41243
|
-
newStore[key] =
|
|
41370
|
+
if (key in prevStore) {
|
|
41371
|
+
newStore[key] = prevStore[key];
|
|
41244
41372
|
}
|
|
41245
41373
|
}
|
|
41246
41374
|
}
|
|
41247
|
-
globalThis.__absolutePreviousAppStore = app.store;
|
|
41375
|
+
globalThis.__absolutePreviousAppStore = isRecord8(app.store) ? app.store : undefined;
|
|
41248
41376
|
try {
|
|
41249
41377
|
app.compile();
|
|
41250
41378
|
} catch {}
|
|
@@ -41294,11 +41422,9 @@ var networking = (app) => {
|
|
|
41294
41422
|
});
|
|
41295
41423
|
if (app.server) {
|
|
41296
41424
|
globalThis.__absoluteBunServer = app.server;
|
|
41297
|
-
globalThis.__absolutePreviousAppStore = app.store;
|
|
41425
|
+
globalThis.__absolutePreviousAppStore = isRecord8(app.store) ? app.store : undefined;
|
|
41298
41426
|
if (env4.NODE_ENV === "development") {
|
|
41299
|
-
Promise.resolve().then(() => (init_serverEntryWatcher(), exports_serverEntryWatcher)).then(({ startServerEntryWatcher: startServerEntryWatcher2 }) => {
|
|
41300
|
-
startServerEntryWatcher2();
|
|
41301
|
-
}).catch((err) => {
|
|
41427
|
+
Promise.resolve().then(() => (init_serverEntryWatcher(), exports_serverEntryWatcher)).then(({ startServerEntryWatcher: startServerEntryWatcher2 }) => startServerEntryWatcher2()).catch((err) => {
|
|
41302
41428
|
console.error(`[hmr] entry watcher setup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
41303
41429
|
});
|
|
41304
41430
|
}
|
|
@@ -41315,8 +41441,8 @@ init_devtoolsJson();
|
|
|
41315
41441
|
// src/utils/defineConfig.ts
|
|
41316
41442
|
var defineConfig = (config2) => config2;
|
|
41317
41443
|
// src/utils/defineConvention.ts
|
|
41318
|
-
var defineRenderErrorPage = (
|
|
41319
|
-
var defineRenderNotFoundPage = (
|
|
41444
|
+
var defineRenderErrorPage = (renderErrorPage) => renderErrorPage;
|
|
41445
|
+
var defineRenderNotFoundPage = (renderNotFoundPage) => renderNotFoundPage;
|
|
41320
41446
|
// src/utils/jsonLd.ts
|
|
41321
41447
|
var jsonLd2 = (schema) => `<script type="application/ld+json">${serializeJsonLd(schema)}</script>`;
|
|
41322
41448
|
var serializeJsonLd = (schema) => {
|
|
@@ -41460,8 +41586,8 @@ var generateHeadElement = ({
|
|
|
41460
41586
|
};
|
|
41461
41587
|
// src/utils/defineEnv.ts
|
|
41462
41588
|
var {env: bunEnv } = globalThis.Bun;
|
|
41463
|
-
import { existsSync as existsSync42, readFileSync as
|
|
41464
|
-
import { resolve as
|
|
41589
|
+
import { existsSync as existsSync42, readFileSync as readFileSync37 } from "fs";
|
|
41590
|
+
import { resolve as resolve47 } from "path";
|
|
41465
41591
|
|
|
41466
41592
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
41467
41593
|
var exports_value = {};
|
|
@@ -47496,19 +47622,19 @@ ${lines.join(`
|
|
|
47496
47622
|
};
|
|
47497
47623
|
var checkEnvFileSecurity = (properties) => {
|
|
47498
47624
|
const cwd2 = process.cwd();
|
|
47499
|
-
const envPath =
|
|
47625
|
+
const envPath = resolve47(cwd2, ".env");
|
|
47500
47626
|
if (!existsSync42(envPath))
|
|
47501
47627
|
return;
|
|
47502
47628
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
47503
47629
|
if (sensitiveKeys.length === 0)
|
|
47504
47630
|
return;
|
|
47505
|
-
const envContent =
|
|
47631
|
+
const envContent = readFileSync37(envPath, "utf-8");
|
|
47506
47632
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
47507
47633
|
if (presentKeys.length === 0)
|
|
47508
47634
|
return;
|
|
47509
|
-
const gitignorePath =
|
|
47635
|
+
const gitignorePath = resolve47(cwd2, ".gitignore");
|
|
47510
47636
|
if (existsSync42(gitignorePath)) {
|
|
47511
|
-
const gitignore =
|
|
47637
|
+
const gitignore = readFileSync37(gitignorePath, "utf-8");
|
|
47512
47638
|
if (gitignore.split(`
|
|
47513
47639
|
`).some((line) => line.trim() === ".env"))
|
|
47514
47640
|
return;
|
|
@@ -47541,7 +47667,7 @@ var getEnv = (key) => {
|
|
|
47541
47667
|
};
|
|
47542
47668
|
// src/utils/projectRoot.ts
|
|
47543
47669
|
import { existsSync as existsSync43 } from "fs";
|
|
47544
|
-
import { dirname as dirname31, resolve as
|
|
47670
|
+
import { dirname as dirname31, resolve as resolve48 } from "path";
|
|
47545
47671
|
var CONFIG_CANDIDATES = [
|
|
47546
47672
|
"absolute.config.ts",
|
|
47547
47673
|
"absolute.config.js",
|
|
@@ -47550,22 +47676,23 @@ var CONFIG_CANDIDATES = [
|
|
|
47550
47676
|
"absolute.config.mts",
|
|
47551
47677
|
"absolute.config.cts"
|
|
47552
47678
|
];
|
|
47679
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync43(resolve48(directory, name)));
|
|
47553
47680
|
var findProjectRoot = () => {
|
|
47554
47681
|
const start = process.cwd();
|
|
47555
47682
|
let packageRoot = null;
|
|
47556
|
-
let
|
|
47683
|
+
let directory = start;
|
|
47557
47684
|
for (;; ) {
|
|
47558
|
-
if (
|
|
47559
|
-
return
|
|
47685
|
+
if (hasAbsoluteConfig(directory)) {
|
|
47686
|
+
return directory;
|
|
47560
47687
|
}
|
|
47561
|
-
if (packageRoot === null && existsSync43(
|
|
47562
|
-
packageRoot =
|
|
47688
|
+
if (packageRoot === null && existsSync43(resolve48(directory, "package.json"))) {
|
|
47689
|
+
packageRoot = directory;
|
|
47563
47690
|
}
|
|
47564
|
-
const parent = dirname31(
|
|
47565
|
-
if (parent ===
|
|
47691
|
+
const parent = dirname31(directory);
|
|
47692
|
+
if (parent === directory) {
|
|
47566
47693
|
return packageRoot ?? start;
|
|
47567
47694
|
}
|
|
47568
|
-
|
|
47695
|
+
directory = parent;
|
|
47569
47696
|
}
|
|
47570
47697
|
};
|
|
47571
47698
|
var projectRoot = findProjectRoot();
|
|
@@ -47804,5 +47931,5 @@ export {
|
|
|
47804
47931
|
ANGULAR_INIT_TIMEOUT_MS
|
|
47805
47932
|
};
|
|
47806
47933
|
|
|
47807
|
-
//# debugId=
|
|
47934
|
+
//# debugId=25F7CF98B8AA63FB64756E2164756E21
|
|
47808
47935
|
//# sourceMappingURL=index.js.map
|