@absolutejs/absolute 0.19.0-beta.1115 → 0.19.0-beta.1117
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 +975 -794
- 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/cli/scripts/lintProof.d.ts +34 -0
- 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 +90 -31
package/dist/build.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) {
|
|
@@ -4746,22 +4728,20 @@ __export(exports_devRouteRegistrationCallsite, {
|
|
|
4746
4728
|
});
|
|
4747
4729
|
import { AsyncLocalStorage } from "async_hooks";
|
|
4748
4730
|
import { Elysia } from "elysia";
|
|
4749
|
-
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
|
|
4731
|
+
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, isPageHandlerFunction = (value) => typeof value === "function", handlerSourceMentionsPageHelper = (handler) => {
|
|
4750
4732
|
const source = handler.toString();
|
|
4751
4733
|
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
4752
4734
|
}, getOriginalPageHandlerSource = (handler) => {
|
|
4753
|
-
if (
|
|
4735
|
+
if (!isPageHandlerFunction(handler))
|
|
4754
4736
|
return;
|
|
4755
|
-
const
|
|
4756
|
-
|
|
4757
|
-
return (info?.originalHandler ?? fn).toString();
|
|
4737
|
+
const info = pageHandlerWrappers.get(handler);
|
|
4738
|
+
return (info?.originalHandler ?? handler).toString();
|
|
4758
4739
|
}, isPageHandler = (handler) => {
|
|
4759
|
-
if (
|
|
4740
|
+
if (!isPageHandlerFunction(handler))
|
|
4760
4741
|
return false;
|
|
4761
|
-
|
|
4762
|
-
if (pageHandlerWrappers.has(fn))
|
|
4742
|
+
if (pageHandlerWrappers.has(handler))
|
|
4763
4743
|
return true;
|
|
4764
|
-
return handlerSourceMentionsPageHelper(
|
|
4744
|
+
return handlerSourceMentionsPageHelper(handler);
|
|
4765
4745
|
}, isObjectRecord = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage = (value) => isObjectRecord(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
|
|
4766
4746
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
4767
4747
|
if (value === null || typeof value === "undefined") {
|
|
@@ -4798,7 +4778,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
4798
4778
|
}, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
|
|
4799
4779
|
const callsite = captureRouteRegistrationCallsite();
|
|
4800
4780
|
const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
|
|
4801
|
-
if (methodName === "get" &&
|
|
4781
|
+
if (methodName === "get" && isPageHandlerFunction(handler) && isPageHandlerFunction(wrapped) && handlerSourceMentionsPageHelper(handler)) {
|
|
4802
4782
|
pageHandlerWrappers.set(wrapped, {
|
|
4803
4783
|
originalHandler: handler
|
|
4804
4784
|
});
|
|
@@ -4850,8 +4830,8 @@ __export(exports_staticAnalyzeSpaRoutes, {
|
|
|
4850
4830
|
import { existsSync as existsSync8, promises as fs } from "fs";
|
|
4851
4831
|
import { join as join11 } from "path";
|
|
4852
4832
|
import ts3 from "typescript";
|
|
4853
|
-
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (
|
|
4854
|
-
for (const statement of
|
|
4833
|
+
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
4834
|
+
for (const statement of sourceFile.statements) {
|
|
4855
4835
|
if (!ts3.isImportDeclaration(statement))
|
|
4856
4836
|
continue;
|
|
4857
4837
|
if (!ts3.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -4882,7 +4862,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
4882
4862
|
return property.name.text;
|
|
4883
4863
|
}
|
|
4884
4864
|
return null;
|
|
4885
|
-
}, findRoutesArrayDeclaration = (
|
|
4865
|
+
}, findRoutesArrayDeclaration = (sourceFile, identifierName) => {
|
|
4886
4866
|
let found = null;
|
|
4887
4867
|
const visit = (node) => {
|
|
4888
4868
|
if (found)
|
|
@@ -4893,7 +4873,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
4893
4873
|
}
|
|
4894
4874
|
ts3.forEachChild(node, visit);
|
|
4895
4875
|
};
|
|
4896
|
-
ts3.forEachChild(
|
|
4876
|
+
ts3.forEachChild(sourceFile, visit);
|
|
4897
4877
|
return found;
|
|
4898
4878
|
}, extractSitemapData = (dataLiteral) => {
|
|
4899
4879
|
for (const prop of dataLiteral.properties) {
|
|
@@ -4913,8 +4893,8 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
4913
4893
|
if (!parent)
|
|
4914
4894
|
return child;
|
|
4915
4895
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
4916
|
-
}, extractRoutePaths = (
|
|
4917
|
-
for (const element of
|
|
4896
|
+
}, extractRoutePaths = (routeArray, parentPath, parentExcluded, routes) => {
|
|
4897
|
+
for (const element of routeArray.elements) {
|
|
4918
4898
|
if (!ts3.isObjectLiteralExpression(element))
|
|
4919
4899
|
continue;
|
|
4920
4900
|
let pathSegment = null;
|
|
@@ -4942,32 +4922,32 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
4942
4922
|
continue;
|
|
4943
4923
|
const joined = joinSegments(parentPath, pathSegment);
|
|
4944
4924
|
if (childrenLiteral) {
|
|
4945
|
-
extractRoutePaths(childrenLiteral, joined, sitemapExcluded,
|
|
4925
|
+
extractRoutePaths(childrenLiteral, joined, sitemapExcluded, routes);
|
|
4946
4926
|
continue;
|
|
4947
4927
|
}
|
|
4948
4928
|
if (joined === "")
|
|
4949
4929
|
continue;
|
|
4950
|
-
|
|
4930
|
+
routes.push({
|
|
4951
4931
|
dynamic: pathHasDynamic(joined),
|
|
4952
4932
|
path: joined,
|
|
4953
4933
|
redirected,
|
|
4954
4934
|
sitemapExcluded
|
|
4955
4935
|
});
|
|
4956
4936
|
}
|
|
4957
|
-
}, findProvideRouterFirstArg = (
|
|
4958
|
-
|
|
4937
|
+
}, findProvideRouterFirstArg = (sourceFile) => {
|
|
4938
|
+
const result = { found: null };
|
|
4959
4939
|
const visit = (node) => {
|
|
4960
|
-
if (found)
|
|
4940
|
+
if (result.found)
|
|
4961
4941
|
return;
|
|
4962
4942
|
if (ts3.isCallExpression(node) && ts3.isIdentifier(node.expression) && node.expression.text === "provideRouter") {
|
|
4963
|
-
found = node.arguments[0] ?? null;
|
|
4943
|
+
result.found = node.arguments[0] ?? null;
|
|
4964
4944
|
return;
|
|
4965
4945
|
}
|
|
4966
4946
|
ts3.forEachChild(node, visit);
|
|
4967
4947
|
};
|
|
4968
|
-
ts3.forEachChild(
|
|
4969
|
-
return found;
|
|
4970
|
-
}, findAppBaseHrefValue = (
|
|
4948
|
+
ts3.forEachChild(sourceFile, visit);
|
|
4949
|
+
return result.found;
|
|
4950
|
+
}, findAppBaseHrefValue = (sourceFile) => {
|
|
4971
4951
|
let found = null;
|
|
4972
4952
|
const visit = (node) => {
|
|
4973
4953
|
if (found)
|
|
@@ -4994,7 +4974,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
4994
4974
|
}
|
|
4995
4975
|
ts3.forEachChild(node, visit);
|
|
4996
4976
|
};
|
|
4997
|
-
ts3.forEachChild(
|
|
4977
|
+
ts3.forEachChild(sourceFile, visit);
|
|
4998
4978
|
return found;
|
|
4999
4979
|
}, analyzeFile = async (filePath) => {
|
|
5000
4980
|
let source;
|
|
@@ -5006,20 +4986,20 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
5006
4986
|
if (!source.includes("APP_BASE_HREF") || !source.includes("provideRouter")) {
|
|
5007
4987
|
return null;
|
|
5008
4988
|
}
|
|
5009
|
-
const
|
|
5010
|
-
if (!importsSymbolFrom(
|
|
4989
|
+
const sourceFile = ts3.createSourceFile(filePath, source, ts3.ScriptTarget.Latest, true, ts3.ScriptKind.TS);
|
|
4990
|
+
if (!importsSymbolFrom(sourceFile, "APP_BASE_HREF", "@angular/common"))
|
|
5011
4991
|
return null;
|
|
5012
|
-
if (!importsSymbolFrom(
|
|
4992
|
+
if (!importsSymbolFrom(sourceFile, "provideRouter", "@angular/router"))
|
|
5013
4993
|
return null;
|
|
5014
|
-
const baseHref = findAppBaseHrefValue(
|
|
4994
|
+
const baseHref = findAppBaseHrefValue(sourceFile);
|
|
5015
4995
|
if (!baseHref)
|
|
5016
4996
|
return null;
|
|
5017
|
-
const firstArg = findProvideRouterFirstArg(
|
|
4997
|
+
const firstArg = findProvideRouterFirstArg(sourceFile);
|
|
5018
4998
|
if (!firstArg)
|
|
5019
4999
|
return null;
|
|
5020
5000
|
let routesArray = null;
|
|
5021
5001
|
if (ts3.isIdentifier(firstArg)) {
|
|
5022
|
-
routesArray = findRoutesArrayDeclaration(
|
|
5002
|
+
routesArray = findRoutesArrayDeclaration(sourceFile, firstArg.text);
|
|
5023
5003
|
} else if (ts3.isArrayLiteralExpression(firstArg)) {
|
|
5024
5004
|
routesArray = firstArg;
|
|
5025
5005
|
}
|
|
@@ -5032,13 +5012,14 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
5032
5012
|
routes,
|
|
5033
5013
|
sourceFile: filePath
|
|
5034
5014
|
};
|
|
5035
|
-
}, walkTsFiles = async (dir,
|
|
5015
|
+
}, walkTsFiles = async (dir, files) => {
|
|
5036
5016
|
let items;
|
|
5037
5017
|
try {
|
|
5038
5018
|
items = await fs.readdir(dir, { withFileTypes: true });
|
|
5039
5019
|
} catch {
|
|
5040
5020
|
return;
|
|
5041
5021
|
}
|
|
5022
|
+
const directories = [];
|
|
5042
5023
|
for (const item of items) {
|
|
5043
5024
|
if (item.name === "node_modules")
|
|
5044
5025
|
continue;
|
|
@@ -5046,11 +5027,12 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
5046
5027
|
continue;
|
|
5047
5028
|
const full = join11(dir, item.name);
|
|
5048
5029
|
if (item.isDirectory()) {
|
|
5049
|
-
|
|
5030
|
+
directories.push(full);
|
|
5050
5031
|
} else if (item.isFile() && item.name.endsWith(".ts") && !item.name.endsWith(".d.ts")) {
|
|
5051
|
-
|
|
5032
|
+
files.push(full);
|
|
5052
5033
|
}
|
|
5053
5034
|
}
|
|
5035
|
+
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
5054
5036
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
5055
5037
|
if (!existsSync8(angularDirectory))
|
|
5056
5038
|
return [];
|
|
@@ -5095,8 +5077,8 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5095
5077
|
return property.name.text;
|
|
5096
5078
|
}
|
|
5097
5079
|
return null;
|
|
5098
|
-
}, importsSymbolFromAny = (
|
|
5099
|
-
for (const statement of
|
|
5080
|
+
}, importsSymbolFromAny = (sourceFile, localName, moduleSpecifiers) => {
|
|
5081
|
+
for (const statement of sourceFile.statements) {
|
|
5100
5082
|
if (!ts4.isImportDeclaration(statement))
|
|
5101
5083
|
continue;
|
|
5102
5084
|
if (!ts4.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -5112,7 +5094,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5112
5094
|
}
|
|
5113
5095
|
}
|
|
5114
5096
|
return false;
|
|
5115
|
-
}, findVariableArrayDeclaration = (
|
|
5097
|
+
}, findVariableArrayDeclaration = (sourceFile, identifierName) => {
|
|
5116
5098
|
let found = null;
|
|
5117
5099
|
const visit = (node) => {
|
|
5118
5100
|
if (found)
|
|
@@ -5123,7 +5105,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5123
5105
|
}
|
|
5124
5106
|
ts4.forEachChild(node, visit);
|
|
5125
5107
|
};
|
|
5126
|
-
ts4.forEachChild(
|
|
5108
|
+
ts4.forEachChild(sourceFile, visit);
|
|
5127
5109
|
return found;
|
|
5128
5110
|
}, joinSegments2 = (parent, child) => {
|
|
5129
5111
|
if (!child)
|
|
@@ -5131,8 +5113,8 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5131
5113
|
if (!parent)
|
|
5132
5114
|
return child;
|
|
5133
5115
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
5134
|
-
}, extractRouteEntries = (
|
|
5135
|
-
for (const element of
|
|
5116
|
+
}, extractRouteEntries = (routeArray, parentPath, routes) => {
|
|
5117
|
+
for (const element of routeArray.elements) {
|
|
5136
5118
|
if (!ts4.isObjectLiteralExpression(element))
|
|
5137
5119
|
continue;
|
|
5138
5120
|
let pathSegment = null;
|
|
@@ -5170,33 +5152,33 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5170
5152
|
const segment = pathSegment ?? "";
|
|
5171
5153
|
const joined = joinSegments2(parentPath, segment);
|
|
5172
5154
|
if (childrenLiteral) {
|
|
5173
|
-
extractRouteEntries(childrenLiteral, joined,
|
|
5155
|
+
extractRouteEntries(childrenLiteral, joined, routes);
|
|
5174
5156
|
continue;
|
|
5175
5157
|
}
|
|
5176
5158
|
if (!isIndex && pathSegment === null)
|
|
5177
5159
|
continue;
|
|
5178
5160
|
if (joined === "")
|
|
5179
5161
|
continue;
|
|
5180
|
-
|
|
5162
|
+
routes.push({
|
|
5181
5163
|
dynamic: pathHasDynamic2(joined),
|
|
5182
5164
|
path: joined,
|
|
5183
5165
|
redirected,
|
|
5184
5166
|
sitemapExcluded
|
|
5185
5167
|
});
|
|
5186
5168
|
}
|
|
5187
|
-
}, findCreateBrowserRouterCall = (
|
|
5188
|
-
|
|
5169
|
+
}, findCreateBrowserRouterCall = (sourceFile) => {
|
|
5170
|
+
const result = { found: null };
|
|
5189
5171
|
const visit = (node) => {
|
|
5190
|
-
if (found)
|
|
5172
|
+
if (result.found)
|
|
5191
5173
|
return;
|
|
5192
5174
|
if (ts4.isCallExpression(node) && ts4.isIdentifier(node.expression) && node.expression.text === "createBrowserRouter") {
|
|
5193
|
-
found = node;
|
|
5175
|
+
result.found = node;
|
|
5194
5176
|
return;
|
|
5195
5177
|
}
|
|
5196
5178
|
ts4.forEachChild(node, visit);
|
|
5197
5179
|
};
|
|
5198
|
-
ts4.forEachChild(
|
|
5199
|
-
return found;
|
|
5180
|
+
ts4.forEachChild(sourceFile, visit);
|
|
5181
|
+
return result.found;
|
|
5200
5182
|
}, readBasenameFromOptions = (expression) => {
|
|
5201
5183
|
if (!expression || !ts4.isObjectLiteralExpression(expression))
|
|
5202
5184
|
return null;
|
|
@@ -5220,24 +5202,24 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5220
5202
|
}
|
|
5221
5203
|
if (!source.includes("createBrowserRouter"))
|
|
5222
5204
|
return null;
|
|
5223
|
-
const
|
|
5224
|
-
if (!importsSymbolFromAny(
|
|
5205
|
+
const sourceFile = ts4.createSourceFile(filePath, source, ts4.ScriptTarget.Latest, true, filePath.endsWith(".tsx") ? ts4.ScriptKind.TSX : ts4.ScriptKind.TS);
|
|
5206
|
+
if (!importsSymbolFromAny(sourceFile, "createBrowserRouter", [
|
|
5225
5207
|
"react-router-dom",
|
|
5226
5208
|
"react-router"
|
|
5227
5209
|
])) {
|
|
5228
5210
|
return null;
|
|
5229
5211
|
}
|
|
5230
|
-
const call = findCreateBrowserRouterCall(
|
|
5212
|
+
const call = findCreateBrowserRouterCall(sourceFile);
|
|
5231
5213
|
if (!call)
|
|
5232
5214
|
return null;
|
|
5233
|
-
const routesArg = call.arguments
|
|
5215
|
+
const [routesArg] = call.arguments;
|
|
5234
5216
|
if (!routesArg)
|
|
5235
5217
|
return null;
|
|
5236
5218
|
let routesArray = null;
|
|
5237
5219
|
if (ts4.isArrayLiteralExpression(routesArg)) {
|
|
5238
5220
|
routesArray = routesArg;
|
|
5239
5221
|
} else if (ts4.isIdentifier(routesArg)) {
|
|
5240
|
-
routesArray = findVariableArrayDeclaration(
|
|
5222
|
+
routesArray = findVariableArrayDeclaration(sourceFile, routesArg.text);
|
|
5241
5223
|
}
|
|
5242
5224
|
if (!routesArray)
|
|
5243
5225
|
return null;
|
|
@@ -5246,23 +5228,25 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
5246
5228
|
const routes = [];
|
|
5247
5229
|
extractRouteEntries(routesArray, "", routes);
|
|
5248
5230
|
return { baseHref, routes, sourceFile: filePath };
|
|
5249
|
-
}, walkSourceFiles = async (dir,
|
|
5231
|
+
}, walkSourceFiles = async (dir, files) => {
|
|
5250
5232
|
let items;
|
|
5251
5233
|
try {
|
|
5252
5234
|
items = await fs2.readdir(dir, { withFileTypes: true });
|
|
5253
5235
|
} catch {
|
|
5254
5236
|
return;
|
|
5255
5237
|
}
|
|
5238
|
+
const directories = [];
|
|
5256
5239
|
for (const item of items) {
|
|
5257
5240
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
5258
5241
|
continue;
|
|
5259
5242
|
const full = join12(dir, item.name);
|
|
5260
5243
|
if (item.isDirectory()) {
|
|
5261
|
-
|
|
5244
|
+
directories.push(full);
|
|
5262
5245
|
} 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")) {
|
|
5263
|
-
|
|
5246
|
+
files.push(full);
|
|
5264
5247
|
}
|
|
5265
5248
|
}
|
|
5249
|
+
await Promise.all(directories.map((directory) => walkSourceFiles(directory, files)));
|
|
5266
5250
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
5267
5251
|
if (!existsSync9(reactDirectory))
|
|
5268
5252
|
return [];
|
|
@@ -5352,23 +5336,25 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
5352
5336
|
path: joinSegments3("", r.path)
|
|
5353
5337
|
}));
|
|
5354
5338
|
return { baseHref, routes: joinedRoutes, sourceFile: filePath };
|
|
5355
|
-
}, walkSvelteFiles = async (dir,
|
|
5339
|
+
}, walkSvelteFiles = async (dir, files) => {
|
|
5356
5340
|
let items;
|
|
5357
5341
|
try {
|
|
5358
5342
|
items = await fs3.readdir(dir, { withFileTypes: true });
|
|
5359
5343
|
} catch {
|
|
5360
5344
|
return;
|
|
5361
5345
|
}
|
|
5346
|
+
const directories = [];
|
|
5362
5347
|
for (const item of items) {
|
|
5363
5348
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
5364
5349
|
continue;
|
|
5365
5350
|
const full = join13(dir, item.name);
|
|
5366
5351
|
if (item.isDirectory()) {
|
|
5367
|
-
|
|
5352
|
+
directories.push(full);
|
|
5368
5353
|
} else if (item.isFile() && item.name.endsWith(".svelte")) {
|
|
5369
|
-
|
|
5354
|
+
files.push(full);
|
|
5370
5355
|
}
|
|
5371
5356
|
}
|
|
5357
|
+
await Promise.all(directories.map((directory) => walkSvelteFiles(directory, files)));
|
|
5372
5358
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
5373
5359
|
if (!existsSync10(svelteDirectory))
|
|
5374
5360
|
return [];
|
|
@@ -5415,8 +5401,8 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5415
5401
|
return property.name.text;
|
|
5416
5402
|
}
|
|
5417
5403
|
return null;
|
|
5418
|
-
}, importsSymbolFrom2 = (
|
|
5419
|
-
for (const statement of
|
|
5404
|
+
}, importsSymbolFrom2 = (sourceFile, localName, moduleSpecifier) => {
|
|
5405
|
+
for (const statement of sourceFile.statements) {
|
|
5420
5406
|
if (!ts5.isImportDeclaration(statement))
|
|
5421
5407
|
continue;
|
|
5422
5408
|
if (!ts5.isStringLiteral(statement.moduleSpecifier))
|
|
@@ -5432,7 +5418,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5432
5418
|
}
|
|
5433
5419
|
}
|
|
5434
5420
|
return false;
|
|
5435
|
-
}, findVariableArrayDeclaration2 = (
|
|
5421
|
+
}, findVariableArrayDeclaration2 = (sourceFile, identifierName) => {
|
|
5436
5422
|
let found = null;
|
|
5437
5423
|
const visit = (node) => {
|
|
5438
5424
|
if (found)
|
|
@@ -5443,7 +5429,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5443
5429
|
}
|
|
5444
5430
|
ts5.forEachChild(node, visit);
|
|
5445
5431
|
};
|
|
5446
|
-
ts5.forEachChild(
|
|
5432
|
+
ts5.forEachChild(sourceFile, visit);
|
|
5447
5433
|
return found;
|
|
5448
5434
|
}, joinSegments4 = (parent, child) => {
|
|
5449
5435
|
if (!child)
|
|
@@ -5451,8 +5437,8 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5451
5437
|
if (!parent)
|
|
5452
5438
|
return child;
|
|
5453
5439
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
5454
|
-
}, extractRouteEntries2 = (
|
|
5455
|
-
for (const element of
|
|
5440
|
+
}, extractRouteEntries2 = (routeArray, parentPath, routes) => {
|
|
5441
|
+
for (const element of routeArray.elements) {
|
|
5456
5442
|
if (!ts5.isObjectLiteralExpression(element))
|
|
5457
5443
|
continue;
|
|
5458
5444
|
let pathSegment = null;
|
|
@@ -5491,19 +5477,19 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5491
5477
|
continue;
|
|
5492
5478
|
const joined = joinSegments4(parentPath, pathSegment);
|
|
5493
5479
|
if (childrenLiteral) {
|
|
5494
|
-
extractRouteEntries2(childrenLiteral, joined,
|
|
5480
|
+
extractRouteEntries2(childrenLiteral, joined, routes);
|
|
5495
5481
|
continue;
|
|
5496
5482
|
}
|
|
5497
5483
|
if (joined === "")
|
|
5498
5484
|
continue;
|
|
5499
|
-
|
|
5485
|
+
routes.push({
|
|
5500
5486
|
dynamic: pathHasDynamic4(joined),
|
|
5501
5487
|
path: joined,
|
|
5502
5488
|
redirected,
|
|
5503
5489
|
sitemapExcluded
|
|
5504
5490
|
});
|
|
5505
5491
|
if (alias) {
|
|
5506
|
-
|
|
5492
|
+
routes.push({
|
|
5507
5493
|
dynamic: pathHasDynamic4(alias),
|
|
5508
5494
|
path: alias,
|
|
5509
5495
|
redirected: false,
|
|
@@ -5511,45 +5497,48 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5511
5497
|
});
|
|
5512
5498
|
}
|
|
5513
5499
|
}
|
|
5514
|
-
}, findDefineRoutesArray = (
|
|
5500
|
+
}, findDefineRoutesArray = (sourceFile) => {
|
|
5515
5501
|
let found = null;
|
|
5516
5502
|
const visit = (node) => {
|
|
5517
5503
|
if (found)
|
|
5518
5504
|
return;
|
|
5519
|
-
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "defineRoutes"
|
|
5520
|
-
|
|
5505
|
+
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "defineRoutes") {
|
|
5506
|
+
const [routesArgument] = node.arguments;
|
|
5507
|
+
if (!routesArgument || !ts5.isArrayLiteralExpression(routesArgument))
|
|
5508
|
+
return;
|
|
5509
|
+
found = routesArgument;
|
|
5521
5510
|
return;
|
|
5522
5511
|
}
|
|
5523
5512
|
ts5.forEachChild(node, visit);
|
|
5524
5513
|
};
|
|
5525
|
-
ts5.forEachChild(
|
|
5514
|
+
ts5.forEachChild(sourceFile, visit);
|
|
5526
5515
|
return found;
|
|
5527
5516
|
}, inferBaseHref = (routes) => {
|
|
5528
5517
|
const firstSegments = routes.map((route) => route.path.split("/").filter(Boolean)[0]).filter((segment) => Boolean(segment));
|
|
5529
|
-
const first = firstSegments
|
|
5518
|
+
const [first] = firstSegments;
|
|
5530
5519
|
if (!first || firstSegments.some((segment) => segment !== first))
|
|
5531
5520
|
return "/";
|
|
5532
5521
|
return `/${first}/`;
|
|
5533
|
-
}, findCreateRouterCall = (
|
|
5534
|
-
|
|
5522
|
+
}, findCreateRouterCall = (sourceFile) => {
|
|
5523
|
+
const result = { found: null };
|
|
5535
5524
|
const visit = (node) => {
|
|
5536
|
-
if (found)
|
|
5525
|
+
if (result.found)
|
|
5537
5526
|
return;
|
|
5538
5527
|
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "createRouter") {
|
|
5539
|
-
found = node;
|
|
5528
|
+
result.found = node;
|
|
5540
5529
|
return;
|
|
5541
5530
|
}
|
|
5542
5531
|
ts5.forEachChild(node, visit);
|
|
5543
5532
|
};
|
|
5544
|
-
ts5.forEachChild(
|
|
5545
|
-
return found;
|
|
5546
|
-
}, findCreateWebHistoryBase = (
|
|
5533
|
+
ts5.forEachChild(sourceFile, visit);
|
|
5534
|
+
return result.found;
|
|
5535
|
+
}, findCreateWebHistoryBase = (sourceFile) => {
|
|
5547
5536
|
let found = null;
|
|
5548
5537
|
const visit = (node) => {
|
|
5549
5538
|
if (found)
|
|
5550
5539
|
return;
|
|
5551
5540
|
if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && (node.expression.text === "createWebHistory" || node.expression.text === "createWebHashHistory")) {
|
|
5552
|
-
const baseArg = node.arguments
|
|
5541
|
+
const [baseArg] = node.arguments;
|
|
5553
5542
|
if (baseArg) {
|
|
5554
5543
|
const text = readStringLiteral3(baseArg);
|
|
5555
5544
|
if (text !== null) {
|
|
@@ -5563,9 +5552,9 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5563
5552
|
}
|
|
5564
5553
|
ts5.forEachChild(node, visit);
|
|
5565
5554
|
};
|
|
5566
|
-
ts5.forEachChild(
|
|
5555
|
+
ts5.forEachChild(sourceFile, visit);
|
|
5567
5556
|
return found;
|
|
5568
|
-
}, readRoutesFromCreateRouterOptions = (
|
|
5557
|
+
}, readRoutesFromCreateRouterOptions = (sourceFile, optionsExpr) => {
|
|
5569
5558
|
if (!ts5.isObjectLiteralExpression(optionsExpr))
|
|
5570
5559
|
return null;
|
|
5571
5560
|
for (const property of optionsExpr.properties) {
|
|
@@ -5573,7 +5562,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5573
5562
|
if (key !== "routes")
|
|
5574
5563
|
continue;
|
|
5575
5564
|
if (ts5.isShorthandPropertyAssignment(property)) {
|
|
5576
|
-
return findVariableArrayDeclaration2(
|
|
5565
|
+
return findVariableArrayDeclaration2(sourceFile, property.name.text);
|
|
5577
5566
|
}
|
|
5578
5567
|
if (!ts5.isPropertyAssignment(property))
|
|
5579
5568
|
continue;
|
|
@@ -5581,7 +5570,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5581
5570
|
return property.initializer;
|
|
5582
5571
|
}
|
|
5583
5572
|
if (ts5.isIdentifier(property.initializer)) {
|
|
5584
|
-
return findVariableArrayDeclaration2(
|
|
5573
|
+
return findVariableArrayDeclaration2(sourceFile, property.initializer.text);
|
|
5585
5574
|
}
|
|
5586
5575
|
}
|
|
5587
5576
|
return null;
|
|
@@ -5605,35 +5594,37 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
5605
5594
|
}
|
|
5606
5595
|
if (!analysisSource.includes("createRouter") && !analysisSource.includes("defineRoutes"))
|
|
5607
5596
|
return null;
|
|
5608
|
-
const
|
|
5609
|
-
const defineRoutesArray = findDefineRoutesArray(
|
|
5610
|
-
const call = importsSymbolFrom2(
|
|
5611
|
-
const optionsArg = call?.arguments[
|
|
5612
|
-
const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(
|
|
5597
|
+
const sourceFile = ts5.createSourceFile(filePath, analysisSource, ts5.ScriptTarget.Latest, true, ts5.ScriptKind.TS);
|
|
5598
|
+
const defineRoutesArray = findDefineRoutesArray(sourceFile);
|
|
5599
|
+
const call = importsSymbolFrom2(sourceFile, "createRouter", "vue-router") ? findCreateRouterCall(sourceFile) : null;
|
|
5600
|
+
const [optionsArg] = call?.arguments ?? [];
|
|
5601
|
+
const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(sourceFile, optionsArg) : null);
|
|
5613
5602
|
if (!routesArray)
|
|
5614
5603
|
return null;
|
|
5615
5604
|
const routes = [];
|
|
5616
5605
|
extractRouteEntries2(routesArray, "", routes);
|
|
5617
|
-
const base = findCreateWebHistoryBase(
|
|
5606
|
+
const base = findCreateWebHistoryBase(sourceFile) ?? inferBaseHref(routes);
|
|
5618
5607
|
const baseHref = base.endsWith("/") ? base : `${base}/`;
|
|
5619
5608
|
return { baseHref, routes, sourceFile: filePath };
|
|
5620
|
-
}, walkSourceFiles2 = async (dir,
|
|
5609
|
+
}, walkSourceFiles2 = async (dir, files) => {
|
|
5621
5610
|
let items;
|
|
5622
5611
|
try {
|
|
5623
5612
|
items = await fs4.readdir(dir, { withFileTypes: true });
|
|
5624
5613
|
} catch {
|
|
5625
5614
|
return;
|
|
5626
5615
|
}
|
|
5616
|
+
const directories = [];
|
|
5627
5617
|
for (const item of items) {
|
|
5628
5618
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
5629
5619
|
continue;
|
|
5630
5620
|
const full = join14(dir, item.name);
|
|
5631
5621
|
if (item.isDirectory()) {
|
|
5632
|
-
|
|
5622
|
+
directories.push(full);
|
|
5633
5623
|
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
5634
|
-
|
|
5624
|
+
files.push(full);
|
|
5635
5625
|
}
|
|
5636
5626
|
}
|
|
5627
|
+
await Promise.all(directories.map((directory) => walkSourceFiles2(directory, files)));
|
|
5637
5628
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
5638
5629
|
if (!existsSync11(vueDirectory))
|
|
5639
5630
|
return [];
|
|
@@ -5665,35 +5656,38 @@ var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").repl
|
|
|
5665
5656
|
return true;
|
|
5666
5657
|
}
|
|
5667
5658
|
return false;
|
|
5668
|
-
}, 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) => {
|
|
5659
|
+
}, 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) => {
|
|
5669
5660
|
const block = SITEMAP_BLOCK_PATTERN.exec(source);
|
|
5670
5661
|
if (!block)
|
|
5671
5662
|
return;
|
|
5672
|
-
const body = block
|
|
5663
|
+
const [, body] = block;
|
|
5673
5664
|
if (typeof body !== "string")
|
|
5674
5665
|
return;
|
|
5675
5666
|
const out = {};
|
|
5676
5667
|
SITEMAP_STRING_FIELD_PATTERN.lastIndex = 0;
|
|
5677
|
-
let
|
|
5678
|
-
while ((
|
|
5679
|
-
const key =
|
|
5680
|
-
|
|
5681
|
-
if (key === "changefreq" && VALID_CHANGEFREQ.has(value)) {
|
|
5668
|
+
let match;
|
|
5669
|
+
while ((match = SITEMAP_STRING_FIELD_PATTERN.exec(body)) !== null) {
|
|
5670
|
+
const [, key, value] = match;
|
|
5671
|
+
if (key === "changefreq" && value && isChangeFrequency(value)) {
|
|
5682
5672
|
out.changefreq = value;
|
|
5683
5673
|
} else if (key === "lastmod") {
|
|
5684
5674
|
out.lastmod = value;
|
|
5685
5675
|
}
|
|
5686
5676
|
}
|
|
5687
5677
|
SITEMAP_NUMBER_FIELD_PATTERN.lastIndex = 0;
|
|
5688
|
-
while ((
|
|
5689
|
-
const
|
|
5678
|
+
while ((match = SITEMAP_NUMBER_FIELD_PATTERN.exec(body)) !== null) {
|
|
5679
|
+
const [, rawPriority] = match;
|
|
5680
|
+
if (!rawPriority)
|
|
5681
|
+
continue;
|
|
5682
|
+
const num = parseFloat(rawPriority);
|
|
5690
5683
|
if (!Number.isNaN(num))
|
|
5691
5684
|
out.priority = num;
|
|
5692
5685
|
}
|
|
5693
5686
|
SITEMAP_BOOLEAN_FIELD_PATTERN.lastIndex = 0;
|
|
5694
|
-
while ((
|
|
5695
|
-
|
|
5696
|
-
|
|
5687
|
+
while ((match = SITEMAP_BOOLEAN_FIELD_PATTERN.exec(body)) !== null) {
|
|
5688
|
+
const [, key, value] = match;
|
|
5689
|
+
if (key === "exclude")
|
|
5690
|
+
out.exclude = value === "true";
|
|
5697
5691
|
}
|
|
5698
5692
|
return Object.keys(out).length > 0 ? out : undefined;
|
|
5699
5693
|
}, PAGE_HANDLER_NAMES2, sourceMentionsPageHandler = (source) => PAGE_HANDLER_NAMES2.some((name) => source.includes(name)), routeHandlerSource = (route) => {
|
|
@@ -5830,17 +5824,18 @@ var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").repl
|
|
|
5830
5824
|
wildcardOverrides.set(page.mountPath, page.sitemap);
|
|
5831
5825
|
}
|
|
5832
5826
|
const analyzerJobs = [];
|
|
5833
|
-
|
|
5834
|
-
|
|
5827
|
+
const { angularDirectory, reactDirectory, svelteDirectory, vueDirectory } = pipelineConfig;
|
|
5828
|
+
if (angularDirectory) {
|
|
5829
|
+
analyzerJobs.push(runAnalyzer("Angular", () => analyzeAngularSpaRoutes(angularDirectory)));
|
|
5835
5830
|
}
|
|
5836
|
-
if (
|
|
5837
|
-
analyzerJobs.push(runAnalyzer("React", () => analyzeReactSpaRoutes(
|
|
5831
|
+
if (reactDirectory) {
|
|
5832
|
+
analyzerJobs.push(runAnalyzer("React", () => analyzeReactSpaRoutes(reactDirectory)));
|
|
5838
5833
|
}
|
|
5839
|
-
if (
|
|
5840
|
-
analyzerJobs.push(runAnalyzer("Svelte", () => analyzeSvelteSpaRoutes(
|
|
5834
|
+
if (svelteDirectory) {
|
|
5835
|
+
analyzerJobs.push(runAnalyzer("Svelte", () => analyzeSvelteSpaRoutes(svelteDirectory)));
|
|
5841
5836
|
}
|
|
5842
|
-
if (
|
|
5843
|
-
analyzerJobs.push(runAnalyzer("Vue", () => analyzeVueSpaRoutes(
|
|
5837
|
+
if (vueDirectory) {
|
|
5838
|
+
analyzerJobs.push(runAnalyzer("Vue", () => analyzeVueSpaRoutes(vueDirectory)));
|
|
5844
5839
|
}
|
|
5845
5840
|
const allHosts = (await Promise.all(analyzerJobs)).flat();
|
|
5846
5841
|
const spaEntries = collectFrameworkSpaEntries(allHosts, wildcardOverrides, exclude, seenPaths);
|
|
@@ -11051,7 +11046,14 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
11051
11046
|
if (Buffer.isBuffer(input))
|
|
11052
11047
|
return input;
|
|
11053
11048
|
return Buffer.from(input);
|
|
11054
|
-
}, isUnsupportedFormatError = (err) => typeof err === "object" && err !== null && ("code" in err) && err
|
|
11049
|
+
}, 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) => {
|
|
11050
|
+
if (format !== "avif" || !isUnsupportedFormatError(error))
|
|
11051
|
+
throw error;
|
|
11052
|
+
const sharp = await tryLoadSharp();
|
|
11053
|
+
if (!sharp || !isSharpFactory(sharp))
|
|
11054
|
+
throw error;
|
|
11055
|
+
return optimizeWithSharp(sharp, input, width, quality, format);
|
|
11056
|
+
}, buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`, formatToMime = (format) => MIME_MAP[format], generateBlurSvg = (base64Thumbnail) => {
|
|
11055
11057
|
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>`;
|
|
11056
11058
|
const encoded = encodeURIComponent(svg);
|
|
11057
11059
|
return `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -11150,13 +11152,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
11150
11152
|
try {
|
|
11151
11153
|
return await optimizeWithBunImage(input, width, quality, format);
|
|
11152
11154
|
} catch (err) {
|
|
11153
|
-
|
|
11154
|
-
const sharp = await tryLoadSharp();
|
|
11155
|
-
if (sharp && isSharpFactory(sharp)) {
|
|
11156
|
-
return optimizeWithSharp(sharp, input, width, quality, format);
|
|
11157
|
-
}
|
|
11158
|
-
}
|
|
11159
|
-
throw err;
|
|
11155
|
+
return optimizeUnsupportedAvif(err, input, width, quality, format);
|
|
11160
11156
|
}
|
|
11161
11157
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
11162
11158
|
const metaPath = join16(cacheDir, `${cacheKey}.meta`);
|
|
@@ -11922,7 +11918,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
11922
11918
|
TOP_LEVEL_DECL_RE.lastIndex = 0;
|
|
11923
11919
|
let declMatch;
|
|
11924
11920
|
while ((declMatch = TOP_LEVEL_DECL_RE.exec(jsSource)) !== null) {
|
|
11925
|
-
const name = declMatch
|
|
11921
|
+
const [, name] = declMatch;
|
|
11926
11922
|
if (name)
|
|
11927
11923
|
names.add(name);
|
|
11928
11924
|
}
|
|
@@ -12067,7 +12063,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
12067
12063
|
let match;
|
|
12068
12064
|
const re2 = new RegExp(ENTITY_DECORATOR_RE.source, ENTITY_DECORATOR_RE.flags);
|
|
12069
12065
|
while ((match = re2.exec(jsSource)) !== null) {
|
|
12070
|
-
const className = match
|
|
12066
|
+
const [, className] = match;
|
|
12071
12067
|
if (className && !seen.has(className)) {
|
|
12072
12068
|
seen.add(className);
|
|
12073
12069
|
classNames.push(className);
|
|
@@ -12149,8 +12145,12 @@ var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), clea
|
|
|
12149
12145
|
if (!skipGenerated) {
|
|
12150
12146
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
12151
12147
|
}
|
|
12152
|
-
if (frameworkDir)
|
|
12153
|
-
|
|
12148
|
+
if (!frameworkDir)
|
|
12149
|
+
return Promise.all(tasks);
|
|
12150
|
+
tasks.push(removeIfExists(join22(frameworkDir, "generated")));
|
|
12151
|
+
if (framework === "angular") {
|
|
12152
|
+
tasks.push(removeIfExists(join22(frameworkDir, "compiled")), removeIfExists(join22(frameworkDir, "indexes")));
|
|
12153
|
+
}
|
|
12154
12154
|
return Promise.all(tasks);
|
|
12155
12155
|
}, cleanup = async ({
|
|
12156
12156
|
angularDir,
|
|
@@ -12215,7 +12215,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
12215
12215
|
releaseAllSync();
|
|
12216
12216
|
throw err;
|
|
12217
12217
|
});
|
|
12218
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error
|
|
12218
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join23(dirname12(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
12219
12219
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
12220
12220
|
if (locks.size === 0) {
|
|
12221
12221
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -12252,7 +12252,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
12252
12252
|
process.kill(pid, 0);
|
|
12253
12253
|
return true;
|
|
12254
12254
|
} catch (err) {
|
|
12255
|
-
const
|
|
12255
|
+
const code = typeof err === "object" && err !== null ? Reflect.get(err, "code") : undefined;
|
|
12256
12256
|
if (code === "ESRCH")
|
|
12257
12257
|
return false;
|
|
12258
12258
|
if (code === "EPERM")
|
|
@@ -12315,7 +12315,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
12315
12315
|
}
|
|
12316
12316
|
const portInfo = existing.port ? ` on port ${existing.port}` : "";
|
|
12317
12317
|
const elapsedNote = wait ? ` Waited ${Math.round((Date.now() - start) / 1000)}s.` : "";
|
|
12318
|
-
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
|
|
12318
|
+
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 });
|
|
12319
12319
|
}
|
|
12320
12320
|
}
|
|
12321
12321
|
const releaseSync = () => {
|
|
@@ -12403,8 +12403,8 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
12403
12403
|
}, isDev = () => true, buildErrorProps = (error) => {
|
|
12404
12404
|
if (error instanceof Error) {
|
|
12405
12405
|
return {
|
|
12406
|
-
name: error.name,
|
|
12407
12406
|
message: error.message,
|
|
12407
|
+
name: error.name,
|
|
12408
12408
|
...isDev() && error.stack ? { stack: error.stack } : {}
|
|
12409
12409
|
};
|
|
12410
12410
|
}
|
|
@@ -12488,7 +12488,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
12488
12488
|
let conventionPath = resolveErrorConventionPath(framework, pageName);
|
|
12489
12489
|
if (!conventionPath && error instanceof Error && error.stack) {
|
|
12490
12490
|
for (const match of error.stack.matchAll(/^\s*at\s+([A-Za-z_$][\w$]*)/gm)) {
|
|
12491
|
-
const candidate = match
|
|
12491
|
+
const [, candidate] = match;
|
|
12492
12492
|
if (!candidate)
|
|
12493
12493
|
continue;
|
|
12494
12494
|
conventionPath = resolveErrorConventionPath(framework, candidate);
|
|
@@ -12636,9 +12636,9 @@ var init_resolveConvention = __esm(() => {
|
|
|
12636
12636
|
import { basename as basename8 } from "path";
|
|
12637
12637
|
var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
12638
12638
|
Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
|
|
12639
|
-
}, getSpaRouteManifest = () => {
|
|
12639
|
+
}, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
|
|
12640
12640
|
const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
|
|
12641
|
-
return Array.isArray(value) ? value : [];
|
|
12641
|
+
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
12642
12642
|
}, normalizePath2 = (path) => {
|
|
12643
12643
|
const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
12644
12644
|
const trimmed = withLeadingSlash.replace(/\/+$/, "");
|
|
@@ -12701,6 +12701,12 @@ var init_spaRouteManifest = __esm(() => {
|
|
|
12701
12701
|
init_resolveConvention();
|
|
12702
12702
|
});
|
|
12703
12703
|
|
|
12704
|
+
// src/utils/isTestSourcePath.ts
|
|
12705
|
+
var isTestSourcePath = (file) => {
|
|
12706
|
+
const normalized = file.replace(/\\/g, "/");
|
|
12707
|
+
return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
|
|
12708
|
+
};
|
|
12709
|
+
|
|
12704
12710
|
// src/build/scanVueSsrOnlyPages.ts
|
|
12705
12711
|
var exports_scanVueSsrOnlyPages = {};
|
|
12706
12712
|
__export(exports_scanVueSsrOnlyPages, {
|
|
@@ -12856,7 +12862,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
12856
12862
|
import { readdirSync as readdirSync3, readFileSync as readFileSync14 } from "fs";
|
|
12857
12863
|
import { join as join25 } from "path";
|
|
12858
12864
|
import ts8 from "typescript";
|
|
12859
|
-
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
12865
|
+
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind3 = (filePath) => {
|
|
12860
12866
|
if (filePath.endsWith(".tsx"))
|
|
12861
12867
|
return ts8.ScriptKind.TSX;
|
|
12862
12868
|
return ts8.ScriptKind.TS;
|
|
@@ -12888,7 +12894,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
12888
12894
|
if (entry.name.startsWith("."))
|
|
12889
12895
|
continue;
|
|
12890
12896
|
stack.push(join25(dir, entry.name));
|
|
12891
|
-
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
12897
|
+
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
12892
12898
|
out.push(join25(dir, entry.name));
|
|
12893
12899
|
}
|
|
12894
12900
|
}
|
|
@@ -16581,11 +16587,11 @@ var init_compileAngular = __esm(() => {
|
|
|
16581
16587
|
import ts13 from "typescript";
|
|
16582
16588
|
var createHmrImportGenerator = (namespaceMap) => ({
|
|
16583
16589
|
addImport(request) {
|
|
16584
|
-
const
|
|
16585
|
-
if (!
|
|
16590
|
+
const namespace = namespaceMap.get(request.exportModuleSpecifier);
|
|
16591
|
+
if (!namespace) {
|
|
16586
16592
|
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
16587
16593
|
}
|
|
16588
|
-
const namespaceId = ts13.factory.createIdentifier(
|
|
16594
|
+
const namespaceId = ts13.factory.createIdentifier(namespace);
|
|
16589
16595
|
if (request.exportSymbolName === null) {
|
|
16590
16596
|
return namespaceId;
|
|
16591
16597
|
}
|
|
@@ -17299,75 +17305,87 @@ import { existsSync as existsSync24, readFileSync as readFileSync20, statSync as
|
|
|
17299
17305
|
import { dirname as dirname17, extname as extname7, relative as relative14, resolve as resolve23 } from "path";
|
|
17300
17306
|
import ts16 from "typescript";
|
|
17301
17307
|
var fail = (reason, detail, location) => ({
|
|
17308
|
+
detail,
|
|
17302
17309
|
ok: false,
|
|
17303
17310
|
reason,
|
|
17304
|
-
detail,
|
|
17305
17311
|
...location ?? {}
|
|
17306
|
-
}), fingerprintCache, pendingModuleCache,
|
|
17312
|
+
}), fingerprintCache, pendingModuleCache, ANGULAR_DECORATOR_NAMES, findAngularDecoratorName = (decorators) => {
|
|
17313
|
+
for (const decorator of decorators) {
|
|
17314
|
+
if (!ts16.isCallExpression(decorator.expression))
|
|
17315
|
+
continue;
|
|
17316
|
+
const { expression } = decorator.expression;
|
|
17317
|
+
if (!ts16.isIdentifier(expression))
|
|
17318
|
+
continue;
|
|
17319
|
+
if (ANGULAR_DECORATOR_NAMES.has(expression.text)) {
|
|
17320
|
+
return expression.text;
|
|
17321
|
+
}
|
|
17322
|
+
}
|
|
17323
|
+
return null;
|
|
17324
|
+
}, takePendingModule = (id) => {
|
|
17307
17325
|
const cached = pendingModuleCache.get(id);
|
|
17308
17326
|
if (cached !== undefined)
|
|
17309
17327
|
pendingModuleCache.delete(id);
|
|
17310
17328
|
return cached;
|
|
17311
17329
|
}, setPendingModule = (id, moduleText) => {
|
|
17312
17330
|
pendingModuleCache.set(id, moduleText);
|
|
17313
|
-
}, arraysEqual = (a,
|
|
17314
|
-
if (a.length !==
|
|
17331
|
+
}, arraysEqual = (a, rightValue) => {
|
|
17332
|
+
if (a.length !== rightValue.length)
|
|
17315
17333
|
return false;
|
|
17316
|
-
for (let
|
|
17317
|
-
if (a[
|
|
17334
|
+
for (let index = 0;index < a.length; index++) {
|
|
17335
|
+
if (a[index] !== rightValue[index])
|
|
17318
17336
|
return false;
|
|
17319
17337
|
}
|
|
17320
17338
|
return true;
|
|
17321
|
-
}, fingerprintsEqual = (
|
|
17322
|
-
if (
|
|
17339
|
+
}, fingerprintsEqual = (leftValue, rightValue) => {
|
|
17340
|
+
if (leftValue.className !== rightValue.className)
|
|
17323
17341
|
return false;
|
|
17324
|
-
if (
|
|
17342
|
+
if (leftValue.selector !== rightValue.selector)
|
|
17325
17343
|
return false;
|
|
17326
|
-
if (
|
|
17344
|
+
if (leftValue.standalone !== rightValue.standalone)
|
|
17327
17345
|
return false;
|
|
17328
|
-
if (
|
|
17346
|
+
if (leftValue.hasProviders !== rightValue.hasProviders)
|
|
17329
17347
|
return false;
|
|
17330
|
-
if (
|
|
17348
|
+
if (leftValue.hasViewProviders !== rightValue.hasViewProviders)
|
|
17331
17349
|
return false;
|
|
17332
|
-
if (!arraysEqual(
|
|
17350
|
+
if (!arraysEqual(leftValue.ctorParamTypes, rightValue.ctorParamTypes))
|
|
17333
17351
|
return false;
|
|
17334
|
-
if (!arraysEqual(
|
|
17352
|
+
if (!arraysEqual(leftValue.inputs, rightValue.inputs))
|
|
17335
17353
|
return false;
|
|
17336
|
-
if (!arraysEqual(
|
|
17354
|
+
if (!arraysEqual(leftValue.outputs, rightValue.outputs))
|
|
17337
17355
|
return false;
|
|
17338
|
-
if (!arraysEqual(
|
|
17356
|
+
if (!arraysEqual(leftValue.providerImportSig, rightValue.providerImportSig))
|
|
17339
17357
|
return false;
|
|
17340
|
-
if (!arraysEqual(
|
|
17358
|
+
if (!arraysEqual(leftValue.arrowFieldSig, rightValue.arrowFieldSig))
|
|
17341
17359
|
return false;
|
|
17342
|
-
if (!arraysEqual(
|
|
17360
|
+
if (!arraysEqual(leftValue.memberDecoratorSig, rightValue.memberDecoratorSig))
|
|
17343
17361
|
return false;
|
|
17344
|
-
if (!arraysEqual(
|
|
17362
|
+
if (!arraysEqual(leftValue.topLevelImports, rightValue.topLevelImports))
|
|
17345
17363
|
return false;
|
|
17346
|
-
if (!arraysEqual(
|
|
17364
|
+
if (!arraysEqual(leftValue.propertyFieldNames, rightValue.propertyFieldNames))
|
|
17347
17365
|
return false;
|
|
17348
|
-
if (
|
|
17366
|
+
if (leftValue.encapsulation !== rightValue.encapsulation)
|
|
17349
17367
|
return false;
|
|
17350
|
-
if (
|
|
17368
|
+
if (leftValue.changeDetection !== rightValue.changeDetection)
|
|
17351
17369
|
return false;
|
|
17352
|
-
if (
|
|
17370
|
+
if (leftValue.importsArraySig !== rightValue.importsArraySig)
|
|
17353
17371
|
return false;
|
|
17354
|
-
if (
|
|
17372
|
+
if (leftValue.hostDirectivesSig !== rightValue.hostDirectivesSig)
|
|
17355
17373
|
return false;
|
|
17356
|
-
if (
|
|
17374
|
+
if (leftValue.animationsArraySig !== rightValue.animationsArraySig)
|
|
17357
17375
|
return false;
|
|
17358
|
-
if (
|
|
17376
|
+
if (leftValue.providersArraySig !== rightValue.providersArraySig)
|
|
17359
17377
|
return false;
|
|
17360
|
-
if (
|
|
17378
|
+
if (leftValue.viewProvidersArraySig !== rightValue.viewProvidersArraySig)
|
|
17361
17379
|
return false;
|
|
17362
|
-
if (
|
|
17380
|
+
if (leftValue.decoratorInputsArraySig !== rightValue.decoratorInputsArraySig)
|
|
17363
17381
|
return false;
|
|
17364
|
-
if (
|
|
17382
|
+
if (leftValue.decoratorOutputsArraySig !== rightValue.decoratorOutputsArraySig)
|
|
17365
17383
|
return false;
|
|
17366
|
-
if (
|
|
17384
|
+
if (leftValue.hostBindingsSig !== rightValue.hostBindingsSig)
|
|
17367
17385
|
return false;
|
|
17368
|
-
if (
|
|
17386
|
+
if (leftValue.pageExportsSig !== rightValue.pageExportsSig)
|
|
17369
17387
|
return false;
|
|
17370
|
-
if (
|
|
17388
|
+
if (leftValue.schemasSig !== rightValue.schemasSig)
|
|
17371
17389
|
return false;
|
|
17372
17390
|
return true;
|
|
17373
17391
|
}, invalidateFingerprintCache = () => {
|
|
@@ -17393,19 +17411,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17393
17411
|
if (!className)
|
|
17394
17412
|
continue;
|
|
17395
17413
|
const decorators = ts16.getDecorators(stmt) ?? [];
|
|
17396
|
-
const decoratorName = (
|
|
17397
|
-
for (const d2 of decorators) {
|
|
17398
|
-
if (!ts16.isCallExpression(d2.expression))
|
|
17399
|
-
continue;
|
|
17400
|
-
const expr = d2.expression.expression;
|
|
17401
|
-
if (!ts16.isIdentifier(expr))
|
|
17402
|
-
continue;
|
|
17403
|
-
if (expr.text === "Component" || expr.text === "Directive" || expr.text === "Pipe" || expr.text === "Injectable") {
|
|
17404
|
-
return expr.text;
|
|
17405
|
-
}
|
|
17406
|
-
}
|
|
17407
|
-
return null;
|
|
17408
|
-
})();
|
|
17414
|
+
const decoratorName = findAngularDecoratorName(decorators);
|
|
17409
17415
|
if (!decoratorName)
|
|
17410
17416
|
continue;
|
|
17411
17417
|
const projectRel = relative14(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
@@ -17419,8 +17425,9 @@ var fail = (reason, detail, location) => ({
|
|
|
17419
17425
|
});
|
|
17420
17426
|
if (!componentDecorator)
|
|
17421
17427
|
continue;
|
|
17422
|
-
|
|
17423
|
-
|
|
17428
|
+
if (!ts16.isCallExpression(componentDecorator.expression))
|
|
17429
|
+
continue;
|
|
17430
|
+
const [args] = componentDecorator.expression.arguments;
|
|
17424
17431
|
if (!args || !ts16.isObjectLiteralExpression(args))
|
|
17425
17432
|
continue;
|
|
17426
17433
|
const decoratorMeta = readDecoratorMeta(args);
|
|
@@ -17435,22 +17442,22 @@ var fail = (reason, detail, location) => ({
|
|
|
17435
17442
|
} catch {}
|
|
17436
17443
|
}
|
|
17437
17444
|
}
|
|
17438
|
-
}, recordFingerprint = (id,
|
|
17439
|
-
fingerprintCache.set(id,
|
|
17440
|
-
}, entityFingerprintCache, entityFingerprintsEqual = (
|
|
17441
|
-
if (
|
|
17445
|
+
}, recordFingerprint = (id, fingerprint) => {
|
|
17446
|
+
fingerprintCache.set(id, fingerprint);
|
|
17447
|
+
}, entityFingerprintCache, entityFingerprintsEqual = (leftValue, rightValue) => {
|
|
17448
|
+
if (leftValue.className !== rightValue.className)
|
|
17442
17449
|
return false;
|
|
17443
|
-
if (
|
|
17450
|
+
if (leftValue.decoratorArgsText !== rightValue.decoratorArgsText)
|
|
17444
17451
|
return false;
|
|
17445
|
-
if (!arraysEqual(
|
|
17452
|
+
if (!arraysEqual(leftValue.ctorParamTypes, rightValue.ctorParamTypes))
|
|
17446
17453
|
return false;
|
|
17447
|
-
if (!arraysEqual(
|
|
17454
|
+
if (!arraysEqual(leftValue.topLevelImports, rightValue.topLevelImports))
|
|
17448
17455
|
return false;
|
|
17449
|
-
if (!arraysEqual(
|
|
17456
|
+
if (!arraysEqual(leftValue.memberDecoratorSig, rightValue.memberDecoratorSig))
|
|
17450
17457
|
return false;
|
|
17451
|
-
if (!arraysEqual(
|
|
17458
|
+
if (!arraysEqual(leftValue.arrowFieldSig, rightValue.arrowFieldSig))
|
|
17452
17459
|
return false;
|
|
17453
|
-
if (!arraysEqual(
|
|
17460
|
+
if (!arraysEqual(leftValue.propertyFieldNames, rightValue.propertyFieldNames))
|
|
17454
17461
|
return false;
|
|
17455
17462
|
return true;
|
|
17456
17463
|
}, ENTITY_DECORATOR_NAMES, findEntityDecorator = (cls) => {
|
|
@@ -17468,8 +17475,18 @@ var fail = (reason, detail, location) => ({
|
|
|
17468
17475
|
const decorator = findEntityDecorator(cls);
|
|
17469
17476
|
let decoratorArgsText = "";
|
|
17470
17477
|
if (decorator !== null) {
|
|
17471
|
-
|
|
17472
|
-
|
|
17478
|
+
if (!ts16.isCallExpression(decorator.expression)) {
|
|
17479
|
+
return {
|
|
17480
|
+
arrowFieldSig: extractArrowFieldSig(cls),
|
|
17481
|
+
className,
|
|
17482
|
+
ctorParamTypes: [],
|
|
17483
|
+
decoratorArgsText,
|
|
17484
|
+
memberDecoratorSig: extractMemberDecoratorSig(cls),
|
|
17485
|
+
propertyFieldNames: extractPropertyFieldNames(cls),
|
|
17486
|
+
topLevelImports: extractTopLevelImports(sourceFile)
|
|
17487
|
+
};
|
|
17488
|
+
}
|
|
17489
|
+
const [arg] = decorator.expression.arguments;
|
|
17473
17490
|
if (arg !== undefined) {
|
|
17474
17491
|
decoratorArgsText = arg.getText().replace(/\s+/g, " ").trim();
|
|
17475
17492
|
}
|
|
@@ -17524,8 +17541,8 @@ var fail = (reason, detail, location) => ({
|
|
|
17524
17541
|
for (const decorator of getClassDecorators(cls)) {
|
|
17525
17542
|
const expr = decorator.expression;
|
|
17526
17543
|
if (ts16.isCallExpression(expr)) {
|
|
17527
|
-
const
|
|
17528
|
-
if (ts16.isIdentifier(
|
|
17544
|
+
const functionNode = expr.expression;
|
|
17545
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "Component") {
|
|
17529
17546
|
return decorator;
|
|
17530
17547
|
}
|
|
17531
17548
|
}
|
|
@@ -17535,7 +17552,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17535
17552
|
const call = decorator.expression;
|
|
17536
17553
|
if (!ts16.isCallExpression(call))
|
|
17537
17554
|
return null;
|
|
17538
|
-
const arg = call.arguments
|
|
17555
|
+
const [arg] = call.arguments;
|
|
17539
17556
|
if (!arg || !ts16.isObjectLiteralExpression(arg))
|
|
17540
17557
|
return null;
|
|
17541
17558
|
return arg;
|
|
@@ -17571,14 +17588,14 @@ var fail = (reason, detail, location) => ({
|
|
|
17571
17588
|
}
|
|
17572
17589
|
}
|
|
17573
17590
|
return false;
|
|
17574
|
-
}, findClassInSourceFile = (
|
|
17575
|
-
for (const stmt of
|
|
17591
|
+
}, findClassInSourceFile = (sourceFile, className) => {
|
|
17592
|
+
for (const stmt of sourceFile.statements) {
|
|
17576
17593
|
if (ts16.isClassDeclaration(stmt) && stmt.name?.text === className) {
|
|
17577
17594
|
return stmt;
|
|
17578
17595
|
}
|
|
17579
17596
|
}
|
|
17580
17597
|
return null;
|
|
17581
|
-
}, parentHasAngularDecoratorAcrossFiles = (parentClassName, sourceFile, componentDir,
|
|
17598
|
+
}, parentHasAngularDecoratorAcrossFiles = (parentClassName, sourceFile, componentDir, _projectRoot) => {
|
|
17582
17599
|
const sameFile = findClassInSourceFile(sourceFile, parentClassName);
|
|
17583
17600
|
if (sameFile)
|
|
17584
17601
|
return classHasAngularDecorator(sameFile);
|
|
@@ -17593,7 +17610,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17593
17610
|
const named = clause.namedBindings;
|
|
17594
17611
|
if (!named || !ts16.isNamedImports(named))
|
|
17595
17612
|
continue;
|
|
17596
|
-
const found = named.elements.find((
|
|
17613
|
+
const found = named.elements.find((element) => element.name.text === parentClassName);
|
|
17597
17614
|
if (!found)
|
|
17598
17615
|
continue;
|
|
17599
17616
|
const spec = stmt.moduleSpecifier.text;
|
|
@@ -17645,7 +17662,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17645
17662
|
for (const member of cls.members) {
|
|
17646
17663
|
if (!ts16.isMethodDeclaration(member))
|
|
17647
17664
|
continue;
|
|
17648
|
-
if (member.modifiers?.some((
|
|
17665
|
+
if (member.modifiers?.some((item) => item.kind === ts16.SyntaxKind.StaticKeyword))
|
|
17649
17666
|
continue;
|
|
17650
17667
|
const { name } = member;
|
|
17651
17668
|
if (name === undefined)
|
|
@@ -17653,7 +17670,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17653
17670
|
const nameText = ts16.isIdentifier(name) ? name.text : name.getText();
|
|
17654
17671
|
if (nameText !== CONTROL_CREATE_METHOD_NAME)
|
|
17655
17672
|
continue;
|
|
17656
|
-
const firstParam = member.parameters
|
|
17673
|
+
const [firstParam] = member.parameters;
|
|
17657
17674
|
if (firstParam === undefined || firstParam.type === undefined || !ts16.isTypeReferenceNode(firstParam.type)) {
|
|
17658
17675
|
return { passThroughInput: null };
|
|
17659
17676
|
}
|
|
@@ -17661,7 +17678,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17661
17678
|
if (typeArgs === undefined || typeArgs.length !== 1) {
|
|
17662
17679
|
return { passThroughInput: null };
|
|
17663
17680
|
}
|
|
17664
|
-
const arg = typeArgs
|
|
17681
|
+
const [arg] = typeArgs;
|
|
17665
17682
|
if (arg === undefined || !ts16.isLiteralTypeNode(arg) || !ts16.isStringLiteral(arg.literal)) {
|
|
17666
17683
|
return { passThroughInput: null };
|
|
17667
17684
|
}
|
|
@@ -17691,17 +17708,17 @@ var fail = (reason, detail, location) => ({
|
|
|
17691
17708
|
const schemasExpr = getProperty(args, "schemas");
|
|
17692
17709
|
const styleUrls = [];
|
|
17693
17710
|
if (styleUrlsExpr && ts16.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
17694
|
-
for (const
|
|
17695
|
-
if (ts16.isStringLiteral(
|
|
17696
|
-
styleUrls.push(
|
|
17711
|
+
for (const element of styleUrlsExpr.elements) {
|
|
17712
|
+
if (ts16.isStringLiteral(element))
|
|
17713
|
+
styleUrls.push(element.text);
|
|
17697
17714
|
}
|
|
17698
17715
|
}
|
|
17699
17716
|
const styles = [];
|
|
17700
17717
|
if (stylesExpr) {
|
|
17701
17718
|
if (ts16.isArrayLiteralExpression(stylesExpr)) {
|
|
17702
|
-
for (const
|
|
17703
|
-
if (ts16.isStringLiteral(
|
|
17704
|
-
styles.push(
|
|
17719
|
+
for (const element of stylesExpr.elements) {
|
|
17720
|
+
if (ts16.isStringLiteral(element) || ts16.isNoSubstitutionTemplateLiteral(element)) {
|
|
17721
|
+
styles.push(element.text);
|
|
17705
17722
|
}
|
|
17706
17723
|
}
|
|
17707
17724
|
} else if (ts16.isStringLiteral(stylesExpr) || ts16.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
@@ -17713,27 +17730,27 @@ var fail = (reason, detail, location) => ({
|
|
|
17713
17730
|
const changeDetectionExpr = getProperty(args, "changeDetection");
|
|
17714
17731
|
const changeDetection = changeDetectionExpr ? resolveEnumPropertyAccess(changeDetectionExpr, "ChangeDetectionStrategy", CHANGE_DETECTION_VALUES) : null;
|
|
17715
17732
|
return {
|
|
17733
|
+
animationsExpr: animationsExpr && ts16.isArrayLiteralExpression(animationsExpr) ? animationsExpr : null,
|
|
17716
17734
|
changeDetection,
|
|
17717
17735
|
encapsulation,
|
|
17718
17736
|
hasProviders: getProperty(args, "providers") !== null,
|
|
17719
17737
|
hasViewProviders: getProperty(args, "viewProviders") !== null,
|
|
17720
|
-
importsExpr: importsExpr && ts16.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
17721
17738
|
hostDirectivesExpr: hostDirectivesExpr && ts16.isArrayLiteralExpression(hostDirectivesExpr) ? hostDirectivesExpr : null,
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
viewProvidersExpr: viewProvidersExpr && ts16.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null,
|
|
17739
|
+
hostExpr: hostExpr && ts16.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
17740
|
+
importsExpr: importsExpr && ts16.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
17725
17741
|
inputsArrayExpr: inputsArrayExpr && ts16.isArrayLiteralExpression(inputsArrayExpr) ? inputsArrayExpr : null,
|
|
17726
17742
|
outputsArrayExpr: outputsArrayExpr && ts16.isArrayLiteralExpression(outputsArrayExpr) ? outputsArrayExpr : null,
|
|
17727
|
-
hostExpr: hostExpr && ts16.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
17728
|
-
schemasExpr: schemasExpr && ts16.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
17729
17743
|
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? projectDefaults.preserveWhitespaces ?? false,
|
|
17744
|
+
providersExpr: providersExpr && ts16.isArrayLiteralExpression(providersExpr) ? providersExpr : null,
|
|
17745
|
+
schemasExpr: schemasExpr && ts16.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
17730
17746
|
selector: getStringProperty(args, "selector"),
|
|
17731
17747
|
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
17748
|
+
styles,
|
|
17732
17749
|
styleUrl: getStringProperty(args, "styleUrl"),
|
|
17733
17750
|
styleUrls,
|
|
17734
|
-
styles,
|
|
17735
17751
|
template: getStringProperty(args, "template"),
|
|
17736
|
-
templateUrl: getStringProperty(args, "templateUrl")
|
|
17752
|
+
templateUrl: getStringProperty(args, "templateUrl"),
|
|
17753
|
+
viewProvidersExpr: viewProvidersExpr && ts16.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null
|
|
17737
17754
|
};
|
|
17738
17755
|
}, extractDecoratorInput = (prop, compiler) => {
|
|
17739
17756
|
const decorators = ts16.getDecorators(prop) ?? [];
|
|
@@ -17741,14 +17758,14 @@ var fail = (reason, detail, location) => ({
|
|
|
17741
17758
|
const expr = decorator.expression;
|
|
17742
17759
|
if (!ts16.isCallExpression(expr))
|
|
17743
17760
|
continue;
|
|
17744
|
-
const
|
|
17745
|
-
if (!ts16.isIdentifier(
|
|
17761
|
+
const functionNode = expr.expression;
|
|
17762
|
+
if (!ts16.isIdentifier(functionNode) || functionNode.text !== "Input")
|
|
17746
17763
|
continue;
|
|
17747
17764
|
const classPropertyName = prop.name.getText();
|
|
17748
17765
|
let bindingPropertyName = classPropertyName;
|
|
17749
17766
|
let required = false;
|
|
17750
17767
|
let transformFunction = null;
|
|
17751
|
-
const arg = expr.arguments
|
|
17768
|
+
const [arg] = expr.arguments;
|
|
17752
17769
|
if (arg) {
|
|
17753
17770
|
if (ts16.isStringLiteral(arg)) {
|
|
17754
17771
|
bindingPropertyName = arg.text;
|
|
@@ -17777,10 +17794,10 @@ var fail = (reason, detail, location) => ({
|
|
|
17777
17794
|
return null;
|
|
17778
17795
|
}, isInputSignalCall = (init) => {
|
|
17779
17796
|
if (ts16.isCallExpression(init)) {
|
|
17780
|
-
const
|
|
17781
|
-
if (ts16.isIdentifier(
|
|
17797
|
+
const functionNode = init.expression;
|
|
17798
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "input")
|
|
17782
17799
|
return true;
|
|
17783
|
-
if (ts16.isPropertyAccessExpression(
|
|
17800
|
+
if (ts16.isPropertyAccessExpression(functionNode) && ts16.isIdentifier(functionNode.expression) && functionNode.expression.text === "input") {
|
|
17784
17801
|
return true;
|
|
17785
17802
|
}
|
|
17786
17803
|
}
|
|
@@ -17788,6 +17805,8 @@ var fail = (reason, detail, location) => ({
|
|
|
17788
17805
|
}, extractSignalInput = (prop, compiler) => {
|
|
17789
17806
|
if (!prop.initializer || !isInputSignalCall(prop.initializer))
|
|
17790
17807
|
return null;
|
|
17808
|
+
if (!ts16.isCallExpression(prop.initializer))
|
|
17809
|
+
return null;
|
|
17791
17810
|
const classPropertyName = prop.name.getText();
|
|
17792
17811
|
const call = prop.initializer;
|
|
17793
17812
|
let required = false;
|
|
@@ -17822,12 +17841,12 @@ var fail = (reason, detail, location) => ({
|
|
|
17822
17841
|
const expr = decorator.expression;
|
|
17823
17842
|
if (!ts16.isCallExpression(expr))
|
|
17824
17843
|
continue;
|
|
17825
|
-
const
|
|
17826
|
-
if (!ts16.isIdentifier(
|
|
17844
|
+
const functionNode = expr.expression;
|
|
17845
|
+
if (!ts16.isIdentifier(functionNode) || functionNode.text !== "Output")
|
|
17827
17846
|
continue;
|
|
17828
17847
|
const classPropertyName = prop.name.getText();
|
|
17829
17848
|
let bindingName = classPropertyName;
|
|
17830
|
-
const arg = expr.arguments
|
|
17849
|
+
const [arg] = expr.arguments;
|
|
17831
17850
|
if (arg && ts16.isStringLiteral(arg))
|
|
17832
17851
|
bindingName = arg.text;
|
|
17833
17852
|
return { bindingName, classPropertyName };
|
|
@@ -17835,10 +17854,10 @@ var fail = (reason, detail, location) => ({
|
|
|
17835
17854
|
return null;
|
|
17836
17855
|
}, isOutputSignalCall = (init) => {
|
|
17837
17856
|
if (ts16.isCallExpression(init)) {
|
|
17838
|
-
const
|
|
17839
|
-
if (ts16.isIdentifier(
|
|
17857
|
+
const functionNode = init.expression;
|
|
17858
|
+
if (ts16.isIdentifier(functionNode) && functionNode.text === "output")
|
|
17840
17859
|
return true;
|
|
17841
|
-
if (ts16.isPropertyAccessExpression(
|
|
17860
|
+
if (ts16.isPropertyAccessExpression(functionNode) && ts16.isIdentifier(functionNode.expression) && functionNode.expression.text === "output") {
|
|
17842
17861
|
return true;
|
|
17843
17862
|
}
|
|
17844
17863
|
}
|
|
@@ -17846,10 +17865,12 @@ var fail = (reason, detail, location) => ({
|
|
|
17846
17865
|
}, extractSignalOutput = (prop) => {
|
|
17847
17866
|
if (!prop.initializer || !isOutputSignalCall(prop.initializer))
|
|
17848
17867
|
return null;
|
|
17868
|
+
if (!ts16.isCallExpression(prop.initializer))
|
|
17869
|
+
return null;
|
|
17849
17870
|
const classPropertyName = prop.name.getText();
|
|
17850
17871
|
const call = prop.initializer;
|
|
17851
17872
|
let bindingName = classPropertyName;
|
|
17852
|
-
const optsArg = call.arguments
|
|
17873
|
+
const [optsArg] = call.arguments;
|
|
17853
17874
|
if (optsArg && ts16.isObjectLiteralExpression(optsArg)) {
|
|
17854
17875
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
17855
17876
|
if (aliasNode !== null)
|
|
@@ -17934,30 +17955,33 @@ var fail = (reason, detail, location) => ({
|
|
|
17934
17955
|
const expr = dec.expression;
|
|
17935
17956
|
if (!ts16.isCallExpression(expr))
|
|
17936
17957
|
continue;
|
|
17937
|
-
const
|
|
17938
|
-
if (!ts16.isIdentifier(
|
|
17958
|
+
const functionNode = expr.expression;
|
|
17959
|
+
if (!ts16.isIdentifier(functionNode))
|
|
17939
17960
|
continue;
|
|
17940
|
-
if (
|
|
17961
|
+
if (functionNode.text === "HostBinding") {
|
|
17941
17962
|
if (!ts16.isPropertyDeclaration(member) && !ts16.isGetAccessor(member))
|
|
17942
17963
|
continue;
|
|
17964
|
+
if (!ts16.isIdentifier(member.name))
|
|
17965
|
+
continue;
|
|
17943
17966
|
const propertyName2 = member.name.text;
|
|
17944
|
-
const target = expr.arguments
|
|
17967
|
+
const [target] = expr.arguments;
|
|
17945
17968
|
const key = target && ts16.isStringLiteral(target) ? target.text : propertyName2;
|
|
17946
17969
|
host.properties[key] = propertyName2;
|
|
17947
|
-
} else if (
|
|
17970
|
+
} else if (functionNode.text === "HostListener") {
|
|
17948
17971
|
if (!ts16.isMethodDeclaration(member))
|
|
17949
17972
|
continue;
|
|
17973
|
+
if (!ts16.isIdentifier(member.name))
|
|
17974
|
+
continue;
|
|
17950
17975
|
const methodName = member.name.text;
|
|
17951
|
-
const eventArg = expr.arguments
|
|
17976
|
+
const [eventArg, argsArg] = expr.arguments;
|
|
17952
17977
|
if (!eventArg || !ts16.isStringLiteral(eventArg))
|
|
17953
17978
|
continue;
|
|
17954
17979
|
const event = eventArg.text;
|
|
17955
|
-
const argsArg = expr.arguments[1];
|
|
17956
17980
|
const argsList = [];
|
|
17957
17981
|
if (argsArg && ts16.isArrayLiteralExpression(argsArg)) {
|
|
17958
|
-
for (const
|
|
17959
|
-
if (ts16.isStringLiteral(
|
|
17960
|
-
argsList.push(
|
|
17982
|
+
for (const element of argsArg.elements) {
|
|
17983
|
+
if (ts16.isStringLiteral(element))
|
|
17984
|
+
argsList.push(element.text);
|
|
17961
17985
|
}
|
|
17962
17986
|
}
|
|
17963
17987
|
host.listeners[event] = `${methodName}(${argsList.join(", ")})`;
|
|
@@ -17968,7 +17992,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17968
17992
|
let static_ = false;
|
|
17969
17993
|
let descendants = true;
|
|
17970
17994
|
let emitDistinctChangesOnly = true;
|
|
17971
|
-
const opts = args
|
|
17995
|
+
const [, opts] = args;
|
|
17972
17996
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
17973
17997
|
static_ = getBooleanProperty(opts, "static") ?? false;
|
|
17974
17998
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
@@ -17977,7 +18001,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17977
18001
|
return { descendants, emitDistinctChangesOnly, static_ };
|
|
17978
18002
|
}, queryPredicateFromArg = (arg, compiler) => {
|
|
17979
18003
|
if (ts16.isStringLiteral(arg)) {
|
|
17980
|
-
return arg.text.split(",").map((
|
|
18004
|
+
return arg.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
17981
18005
|
}
|
|
17982
18006
|
return {
|
|
17983
18007
|
expression: new compiler.WrappedNodeExpr(arg),
|
|
@@ -17994,18 +18018,19 @@ var fail = (reason, detail, location) => ({
|
|
|
17994
18018
|
const expr = dec.expression;
|
|
17995
18019
|
if (!ts16.isCallExpression(expr))
|
|
17996
18020
|
continue;
|
|
17997
|
-
const
|
|
17998
|
-
if (!ts16.isIdentifier(
|
|
18021
|
+
const functionNode = expr.expression;
|
|
18022
|
+
if (!ts16.isIdentifier(functionNode) || !QUERY_DECORATORS.has(functionNode.text))
|
|
18023
|
+
continue;
|
|
18024
|
+
if (!ts16.isIdentifier(member.name))
|
|
17999
18025
|
continue;
|
|
18000
18026
|
const propertyName2 = member.name.text;
|
|
18001
|
-
const tokenArg = expr.arguments
|
|
18027
|
+
const [tokenArg, opts] = expr.arguments;
|
|
18002
18028
|
if (!tokenArg)
|
|
18003
18029
|
continue;
|
|
18004
18030
|
const predicate = queryPredicateFromArg(tokenArg, compiler);
|
|
18005
18031
|
if (!predicate)
|
|
18006
18032
|
continue;
|
|
18007
18033
|
const { static_, descendants, emitDistinctChangesOnly } = parseQueryDecoratorOptions(expr.arguments);
|
|
18008
|
-
const opts = expr.arguments[1];
|
|
18009
18034
|
let read = null;
|
|
18010
18035
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
18011
18036
|
const readNode = getProperty(opts, "read");
|
|
@@ -18016,14 +18041,14 @@ var fail = (reason, detail, location) => ({
|
|
|
18016
18041
|
const meta = {
|
|
18017
18042
|
descendants,
|
|
18018
18043
|
emitDistinctChangesOnly,
|
|
18019
|
-
first:
|
|
18044
|
+
first: functionNode.text === "ViewChild" || functionNode.text === "ContentChild",
|
|
18020
18045
|
isSignal: false,
|
|
18021
18046
|
predicate,
|
|
18022
18047
|
propertyName: propertyName2,
|
|
18023
18048
|
read,
|
|
18024
18049
|
static: static_
|
|
18025
18050
|
};
|
|
18026
|
-
if (
|
|
18051
|
+
if (functionNode.text === "ViewChild" || functionNode.text === "ViewChildren") {
|
|
18027
18052
|
viewQueries.push(meta);
|
|
18028
18053
|
} else {
|
|
18029
18054
|
contentQueries.push(meta);
|
|
@@ -18051,8 +18076,10 @@ var fail = (reason, detail, location) => ({
|
|
|
18051
18076
|
const runtime = SIGNAL_QUERY_TO_RUNTIME[queryName];
|
|
18052
18077
|
if (!runtime)
|
|
18053
18078
|
continue;
|
|
18079
|
+
if (!ts16.isIdentifier(member.name))
|
|
18080
|
+
continue;
|
|
18054
18081
|
const propertyName2 = member.name.text;
|
|
18055
|
-
const tokenArg = init.arguments
|
|
18082
|
+
const [tokenArg, opts] = init.arguments;
|
|
18056
18083
|
if (!tokenArg)
|
|
18057
18084
|
continue;
|
|
18058
18085
|
const predicate = queryPredicateFromArg(tokenArg, compiler);
|
|
@@ -18060,7 +18087,6 @@ var fail = (reason, detail, location) => ({
|
|
|
18060
18087
|
continue;
|
|
18061
18088
|
let descendants = true;
|
|
18062
18089
|
let read = null;
|
|
18063
|
-
const opts = init.arguments[1];
|
|
18064
18090
|
if (opts && ts16.isObjectLiteralExpression(opts)) {
|
|
18065
18091
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
18066
18092
|
const readNode = getProperty(opts, "read");
|
|
@@ -18088,13 +18114,13 @@ var fail = (reason, detail, location) => ({
|
|
|
18088
18114
|
if (!node)
|
|
18089
18115
|
return null;
|
|
18090
18116
|
if (ts16.isStringLiteral(node)) {
|
|
18091
|
-
return node.text.split(",").map((
|
|
18117
|
+
return node.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
18092
18118
|
}
|
|
18093
18119
|
if (ts16.isArrayLiteralExpression(node)) {
|
|
18094
18120
|
const out = [];
|
|
18095
|
-
for (const
|
|
18096
|
-
if (ts16.isStringLiteral(
|
|
18097
|
-
out.push(
|
|
18121
|
+
for (const element of node.elements) {
|
|
18122
|
+
if (ts16.isStringLiteral(element))
|
|
18123
|
+
out.push(element.text);
|
|
18098
18124
|
}
|
|
18099
18125
|
return out.length > 0 ? out : null;
|
|
18100
18126
|
}
|
|
@@ -18104,12 +18130,12 @@ var fail = (reason, detail, location) => ({
|
|
|
18104
18130
|
if (!node || !ts16.isArrayLiteralExpression(node))
|
|
18105
18131
|
return null;
|
|
18106
18132
|
const out = [];
|
|
18107
|
-
for (const
|
|
18108
|
-
if (ts16.isIdentifier(
|
|
18133
|
+
for (const element of node.elements) {
|
|
18134
|
+
if (ts16.isIdentifier(element)) {
|
|
18109
18135
|
out.push({
|
|
18110
18136
|
directive: {
|
|
18111
|
-
type: new compiler.WrappedNodeExpr(
|
|
18112
|
-
value: new compiler.WrappedNodeExpr(
|
|
18137
|
+
type: new compiler.WrappedNodeExpr(element),
|
|
18138
|
+
value: new compiler.WrappedNodeExpr(element)
|
|
18113
18139
|
},
|
|
18114
18140
|
inputs: null,
|
|
18115
18141
|
isForwardReference: false,
|
|
@@ -18117,21 +18143,21 @@ var fail = (reason, detail, location) => ({
|
|
|
18117
18143
|
});
|
|
18118
18144
|
continue;
|
|
18119
18145
|
}
|
|
18120
|
-
if (!ts16.isObjectLiteralExpression(
|
|
18146
|
+
if (!ts16.isObjectLiteralExpression(element))
|
|
18121
18147
|
continue;
|
|
18122
|
-
const directiveNode = getProperty(
|
|
18148
|
+
const directiveNode = getProperty(element, "directive");
|
|
18123
18149
|
if (!directiveNode)
|
|
18124
18150
|
continue;
|
|
18125
|
-
const inputsNode = getProperty(
|
|
18126
|
-
const outputsNode = getProperty(
|
|
18127
|
-
const collectMap = (
|
|
18128
|
-
if (!
|
|
18151
|
+
const inputsNode = getProperty(element, "inputs");
|
|
18152
|
+
const outputsNode = getProperty(element, "outputs");
|
|
18153
|
+
const collectMap = (expression) => {
|
|
18154
|
+
if (!expression || !ts16.isArrayLiteralExpression(expression))
|
|
18129
18155
|
return null;
|
|
18130
18156
|
const map = {};
|
|
18131
|
-
for (const
|
|
18132
|
-
if (!ts16.isStringLiteral(
|
|
18157
|
+
for (const mappingElement of expression.elements) {
|
|
18158
|
+
if (!ts16.isStringLiteral(mappingElement))
|
|
18133
18159
|
continue;
|
|
18134
|
-
const [name, alias] =
|
|
18160
|
+
const [name, alias] = mappingElement.text.split(":").map((segment) => segment.trim());
|
|
18135
18161
|
if (name)
|
|
18136
18162
|
map[name] = alias ?? name;
|
|
18137
18163
|
}
|
|
@@ -18199,9 +18225,9 @@ var fail = (reason, detail, location) => ({
|
|
|
18199
18225
|
});
|
|
18200
18226
|
return null;
|
|
18201
18227
|
}
|
|
18202
|
-
const
|
|
18228
|
+
const sourceFile = ts16.createSourceFile(filePath, source, ts16.ScriptTarget.Latest, true);
|
|
18203
18229
|
let info = null;
|
|
18204
|
-
for (const stmt of
|
|
18230
|
+
for (const stmt of sourceFile.statements) {
|
|
18205
18231
|
if (!ts16.isClassDeclaration(stmt))
|
|
18206
18232
|
continue;
|
|
18207
18233
|
if (!stmt.name || stmt.name.text !== className)
|
|
@@ -18283,14 +18309,17 @@ var fail = (reason, detail, location) => ({
|
|
|
18283
18309
|
}
|
|
18284
18310
|
const sliceBalanced = (start) => {
|
|
18285
18311
|
let depth = 0;
|
|
18286
|
-
for (let
|
|
18287
|
-
const
|
|
18288
|
-
if (
|
|
18312
|
+
for (let index = start;index < content.length; index++) {
|
|
18313
|
+
const item = content[index];
|
|
18314
|
+
if (item === "{")
|
|
18289
18315
|
depth++;
|
|
18290
|
-
else if (
|
|
18316
|
+
else if (item === "}") {
|
|
18291
18317
|
depth--;
|
|
18292
18318
|
if (depth === 0)
|
|
18293
|
-
return {
|
|
18319
|
+
return {
|
|
18320
|
+
end: index,
|
|
18321
|
+
text: content.slice(start, index + 1)
|
|
18322
|
+
};
|
|
18294
18323
|
}
|
|
18295
18324
|
}
|
|
18296
18325
|
return null;
|
|
@@ -18316,11 +18345,11 @@ var fail = (reason, detail, location) => ({
|
|
|
18316
18345
|
}
|
|
18317
18346
|
const aliasNamesFrom = (block) => {
|
|
18318
18347
|
const out = new Set;
|
|
18319
|
-
const
|
|
18320
|
-
let
|
|
18321
|
-
while ((
|
|
18322
|
-
const propName =
|
|
18323
|
-
const alias =
|
|
18348
|
+
const aliasPattern = /"([^"]+)"\s*:\s*\{[^}]*?"alias"\s*:\s*"([^"]*)"/g;
|
|
18349
|
+
let match;
|
|
18350
|
+
while ((match = aliasPattern.exec(block)) !== null) {
|
|
18351
|
+
const propName = match[1] ?? "";
|
|
18352
|
+
const alias = match[2] ?? "";
|
|
18324
18353
|
out.add(alias || propName);
|
|
18325
18354
|
}
|
|
18326
18355
|
return out;
|
|
@@ -18349,10 +18378,10 @@ var fail = (reason, detail, location) => ({
|
|
|
18349
18378
|
result.set(clause.name.text, spec);
|
|
18350
18379
|
const named = clause.namedBindings;
|
|
18351
18380
|
if (named && ts16.isNamedImports(named)) {
|
|
18352
|
-
for (const
|
|
18353
|
-
if (
|
|
18381
|
+
for (const element of named.elements) {
|
|
18382
|
+
if (element.isTypeOnly)
|
|
18354
18383
|
continue;
|
|
18355
|
-
result.set(
|
|
18384
|
+
result.set(element.name.text, spec);
|
|
18356
18385
|
}
|
|
18357
18386
|
}
|
|
18358
18387
|
}
|
|
@@ -18373,10 +18402,10 @@ var fail = (reason, detail, location) => ({
|
|
|
18373
18402
|
if (declRe.test(content))
|
|
18374
18403
|
return startDtsPath;
|
|
18375
18404
|
const namedReExportRe = new RegExp(`export\\s*(?:type)?\\s*\\{([^}]*)\\}\\s*from\\s*["']([^"']+)["']`, "g");
|
|
18376
|
-
let
|
|
18377
|
-
while ((
|
|
18378
|
-
const namedList =
|
|
18379
|
-
const fromPath =
|
|
18405
|
+
let item;
|
|
18406
|
+
while ((item = namedReExportRe.exec(content)) !== null) {
|
|
18407
|
+
const namedList = item[1] || "";
|
|
18408
|
+
const fromPath = item[2] || "";
|
|
18380
18409
|
const names = namedList.split(",").map((n) => {
|
|
18381
18410
|
const trimmed = n.trim();
|
|
18382
18411
|
const asIdx = trimmed.lastIndexOf(" as ");
|
|
@@ -18392,8 +18421,8 @@ var fail = (reason, detail, location) => ({
|
|
|
18392
18421
|
return found;
|
|
18393
18422
|
}
|
|
18394
18423
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
18395
|
-
while ((
|
|
18396
|
-
const fromPath =
|
|
18424
|
+
while ((item = starReExportRe.exec(content)) !== null) {
|
|
18425
|
+
const fromPath = item[1] || "";
|
|
18397
18426
|
const nextDts = resolveDtsFromSpec(fromPath, dirname17(startDtsPath));
|
|
18398
18427
|
if (!nextDts)
|
|
18399
18428
|
continue;
|
|
@@ -18460,25 +18489,25 @@ var fail = (reason, detail, location) => ({
|
|
|
18460
18489
|
if (!importsExpr)
|
|
18461
18490
|
return result;
|
|
18462
18491
|
const classToSpec = buildClassToSpecMap(sourceFile);
|
|
18463
|
-
for (const
|
|
18464
|
-
if (!ts16.isIdentifier(
|
|
18492
|
+
for (const element of importsExpr.elements) {
|
|
18493
|
+
if (!ts16.isIdentifier(element))
|
|
18465
18494
|
continue;
|
|
18466
|
-
const className =
|
|
18495
|
+
const className = element.text;
|
|
18467
18496
|
const spec = classToSpec.get(className);
|
|
18468
18497
|
if (!spec)
|
|
18469
18498
|
continue;
|
|
18470
18499
|
const info = resolveChildComponentInfo(className, spec, componentDir, projectRoot);
|
|
18471
18500
|
if (!info)
|
|
18472
18501
|
continue;
|
|
18473
|
-
result.push({ identifier:
|
|
18502
|
+
result.push({ identifier: element, info });
|
|
18474
18503
|
}
|
|
18475
18504
|
return result;
|
|
18476
|
-
}, djb2Hash = (
|
|
18477
|
-
let
|
|
18478
|
-
for (let
|
|
18479
|
-
|
|
18505
|
+
}, djb2Hash = (source) => {
|
|
18506
|
+
let hash = 5381;
|
|
18507
|
+
for (let index = 0;index < source.length; index++) {
|
|
18508
|
+
hash = hash * 33 ^ source.charCodeAt(index);
|
|
18480
18509
|
}
|
|
18481
|
-
return (
|
|
18510
|
+
return (hash >>> 0).toString(36);
|
|
18482
18511
|
}, initializerShapeIsStructural = (node) => {
|
|
18483
18512
|
if (ts16.isArrowFunction(node) || ts16.isFunctionExpression(node) || ts16.isCallExpression(node) || ts16.isNewExpression(node)) {
|
|
18484
18513
|
return true;
|
|
@@ -18509,8 +18538,8 @@ var fail = (reason, detail, location) => ({
|
|
|
18509
18538
|
return false;
|
|
18510
18539
|
}
|
|
18511
18540
|
if (ts16.isArrayLiteralExpression(node)) {
|
|
18512
|
-
for (const
|
|
18513
|
-
if (initializerShapeIsStructural(
|
|
18541
|
+
for (const element of node.elements) {
|
|
18542
|
+
if (initializerShapeIsStructural(element))
|
|
18514
18543
|
return true;
|
|
18515
18544
|
}
|
|
18516
18545
|
return false;
|
|
@@ -18560,7 +18589,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18560
18589
|
decName = expr.expression.text;
|
|
18561
18590
|
}
|
|
18562
18591
|
if (expr.arguments.length > 0) {
|
|
18563
|
-
argText = expr.arguments.map((
|
|
18592
|
+
argText = expr.arguments.map((leftValue) => leftValue.getText()).join(",");
|
|
18564
18593
|
}
|
|
18565
18594
|
} else if (ts16.isIdentifier(expr)) {
|
|
18566
18595
|
decName = expr.text;
|
|
@@ -18587,7 +18616,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18587
18616
|
} catch {
|
|
18588
18617
|
return true;
|
|
18589
18618
|
}
|
|
18590
|
-
const
|
|
18619
|
+
const sourceFile = ts16.createSourceFile(filePath, source, ts16.ScriptTarget.ES2022, true, ts16.ScriptKind.TS);
|
|
18591
18620
|
let hasProviders = false;
|
|
18592
18621
|
const visit = (node) => {
|
|
18593
18622
|
if (hasProviders)
|
|
@@ -18597,7 +18626,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18597
18626
|
const expr = decorator.expression;
|
|
18598
18627
|
if (!ts16.isCallExpression(expr))
|
|
18599
18628
|
continue;
|
|
18600
|
-
const arg = expr.arguments
|
|
18629
|
+
const [arg] = expr.arguments;
|
|
18601
18630
|
if (!arg || !ts16.isObjectLiteralExpression(arg))
|
|
18602
18631
|
continue;
|
|
18603
18632
|
if (getProperty(arg, "providers") !== null) {
|
|
@@ -18608,7 +18637,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18608
18637
|
}
|
|
18609
18638
|
ts16.forEachChild(node, visit);
|
|
18610
18639
|
};
|
|
18611
|
-
visit(
|
|
18640
|
+
visit(sourceFile);
|
|
18612
18641
|
providerProbeCache.set(filePath, {
|
|
18613
18642
|
hasProviders,
|
|
18614
18643
|
mtimeMs: stat3.mtimeMs
|
|
@@ -18632,12 +18661,12 @@ var fail = (reason, detail, location) => ({
|
|
|
18632
18661
|
matches = true;
|
|
18633
18662
|
}
|
|
18634
18663
|
if (importClause.namedBindings) {
|
|
18635
|
-
const
|
|
18636
|
-
if (ts16.isNamespaceImport(
|
|
18637
|
-
if (
|
|
18664
|
+
const item = importClause.namedBindings;
|
|
18665
|
+
if (ts16.isNamespaceImport(item)) {
|
|
18666
|
+
if (item.name.text === identifierName)
|
|
18638
18667
|
matches = true;
|
|
18639
18668
|
} else {
|
|
18640
|
-
for (const element of
|
|
18669
|
+
for (const element of item.elements) {
|
|
18641
18670
|
if (element.name.text === identifierName) {
|
|
18642
18671
|
matches = true;
|
|
18643
18672
|
break;
|
|
@@ -18679,6 +18708,11 @@ var fail = (reason, detail, location) => ({
|
|
|
18679
18708
|
}
|
|
18680
18709
|
}
|
|
18681
18710
|
return sig.sort();
|
|
18711
|
+
}, getPropertyNameText = (name) => {
|
|
18712
|
+
if (ts16.isIdentifier(name) || ts16.isStringLiteral(name) || ts16.isNoSubstitutionTemplateLiteral(name)) {
|
|
18713
|
+
return name.text;
|
|
18714
|
+
}
|
|
18715
|
+
return name.getText();
|
|
18682
18716
|
}, extractPropertyFieldNames = (cls) => {
|
|
18683
18717
|
const names = [];
|
|
18684
18718
|
for (const member of cls.members) {
|
|
@@ -18688,7 +18722,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18688
18722
|
const { name } = member;
|
|
18689
18723
|
if (name === undefined)
|
|
18690
18724
|
continue;
|
|
18691
|
-
const text =
|
|
18725
|
+
const text = getPropertyNameText(name);
|
|
18692
18726
|
if (text.length > 0)
|
|
18693
18727
|
names.push(text);
|
|
18694
18728
|
}
|
|
@@ -18711,10 +18745,10 @@ var fail = (reason, detail, location) => ({
|
|
|
18711
18745
|
if (ts16.isNamespaceImport(bindings)) {
|
|
18712
18746
|
names.add(bindings.name.text);
|
|
18713
18747
|
} else if (ts16.isNamedImports(bindings)) {
|
|
18714
|
-
for (const
|
|
18715
|
-
if (
|
|
18748
|
+
for (const element of bindings.elements) {
|
|
18749
|
+
if (element.isTypeOnly)
|
|
18716
18750
|
continue;
|
|
18717
|
-
names.add(
|
|
18751
|
+
names.add(element.name.text);
|
|
18718
18752
|
}
|
|
18719
18753
|
}
|
|
18720
18754
|
}
|
|
@@ -18742,8 +18776,8 @@ var fail = (reason, detail, location) => ({
|
|
|
18742
18776
|
}
|
|
18743
18777
|
break;
|
|
18744
18778
|
}
|
|
18745
|
-
const inputNames = Object.entries(inputs).map(([
|
|
18746
|
-
const outputNames = Object.entries(outputs).map(([
|
|
18779
|
+
const inputNames = Object.entries(inputs).map(([item, m]) => `${item}:${m.bindingPropertyName}`).sort();
|
|
18780
|
+
const outputNames = Object.entries(outputs).map(([item, v2]) => `${item}:${v2}`).sort();
|
|
18747
18781
|
const arrowFieldSig = extractArrowFieldSig(cls);
|
|
18748
18782
|
const memberDecoratorSig = extractMemberDecoratorSig(cls);
|
|
18749
18783
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
@@ -18769,7 +18803,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18769
18803
|
for (const stmt of sourceFile.statements) {
|
|
18770
18804
|
if (!ts16.isVariableStatement(stmt))
|
|
18771
18805
|
continue;
|
|
18772
|
-
const isExported = stmt.modifiers?.some((
|
|
18806
|
+
const isExported = stmt.modifiers?.some((item) => item.kind === ts16.SyntaxKind.ExportKeyword);
|
|
18773
18807
|
if (!isExported)
|
|
18774
18808
|
continue;
|
|
18775
18809
|
for (const decl of stmt.declarationList.declarations) {
|
|
@@ -18823,7 +18857,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18823
18857
|
continue;
|
|
18824
18858
|
}
|
|
18825
18859
|
if (ts16.isConstructorDeclaration(member)) {
|
|
18826
|
-
const cleanedParams = member.parameters.map((param) => ts16.factory.updateParameterDeclaration(param, (ts16.getModifiers(param) ?? []).filter((
|
|
18860
|
+
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));
|
|
18827
18861
|
const cleaned = ts16.factory.createConstructorDeclaration([], cleanedParams, member.body);
|
|
18828
18862
|
memberSources.push(printer.printNode(ts16.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
18829
18863
|
continue;
|
|
@@ -18894,8 +18928,7 @@ ${transpiled}
|
|
|
18894
18928
|
return readFileSync20(abs, "utf8");
|
|
18895
18929
|
}
|
|
18896
18930
|
try {
|
|
18897
|
-
|
|
18898
|
-
return compileStyleFileIfNeededSync2(abs);
|
|
18931
|
+
return compileStyleFileIfNeededSync(abs);
|
|
18899
18932
|
} catch {
|
|
18900
18933
|
return null;
|
|
18901
18934
|
}
|
|
@@ -19037,13 +19070,13 @@ ${block}
|
|
|
19037
19070
|
});
|
|
19038
19071
|
}
|
|
19039
19072
|
if (parsed.errors && parsed.errors.length > 0) {
|
|
19040
|
-
const first = parsed.errors
|
|
19073
|
+
const [first] = parsed.errors;
|
|
19041
19074
|
const span = first?.span;
|
|
19042
19075
|
const start = span?.start;
|
|
19043
19076
|
const lineIndex = start?.line;
|
|
19044
19077
|
const colIndex = start?.col;
|
|
19045
19078
|
const lineTextValue = typeof lineIndex === "number" && lineIndex >= 0 ? templateText.split(/\r?\n/)[lineIndex] ?? undefined : undefined;
|
|
19046
|
-
return fail("template-parse-error", parsed.errors.map((
|
|
19079
|
+
return fail("template-parse-error", parsed.errors.map((entry) => entry.toString()).join(`
|
|
19047
19080
|
`), {
|
|
19048
19081
|
column: typeof colIndex === "number" ? colIndex + 1 : undefined,
|
|
19049
19082
|
file: templatePath,
|
|
@@ -19089,7 +19122,7 @@ ${block}
|
|
|
19089
19122
|
hostDirectives: advancedMetadata.hostDirectives,
|
|
19090
19123
|
i18nUseExternalIds: projectDefaults.i18nUseExternalIds ?? false,
|
|
19091
19124
|
inputs,
|
|
19092
|
-
isSignal: (hasSignalIO || advancedMetadata.contentQueries.some((
|
|
19125
|
+
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),
|
|
19093
19126
|
isStandalone: decoratorMeta.standalone,
|
|
19094
19127
|
lifecycle: {
|
|
19095
19128
|
usesOnChanges: classNode.members.some((m) => ts16.isMethodDeclaration(m) && m.name !== undefined && ts16.isIdentifier(m.name) && m.name.text === "ngOnChanges")
|
|
@@ -19141,6 +19174,9 @@ ${block}
|
|
|
19141
19174
|
}
|
|
19142
19175
|
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
19143
19176
|
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
19177
|
+
if (!ts16.isFunctionDeclaration(tsFunctionDecl)) {
|
|
19178
|
+
return fail("unexpected-error", "Angular HMR callback did not translate to a function declaration");
|
|
19179
|
+
}
|
|
19144
19180
|
const exportedDecl = ts16.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
19145
19181
|
ts16.factory.createToken(ts16.SyntaxKind.ExportKeyword),
|
|
19146
19182
|
ts16.factory.createToken(ts16.SyntaxKind.DefaultKeyword)
|
|
@@ -19166,19 +19202,18 @@ ${block}
|
|
|
19166
19202
|
if (clause?.name)
|
|
19167
19203
|
sourceScopeNames.add(clause.name.text);
|
|
19168
19204
|
if (clause?.namedBindings && ts16.isNamedImports(clause.namedBindings)) {
|
|
19169
|
-
for (const
|
|
19170
|
-
if (
|
|
19205
|
+
for (const element of clause.namedBindings.elements) {
|
|
19206
|
+
if (element.isTypeOnly)
|
|
19171
19207
|
continue;
|
|
19172
|
-
sourceScopeNames.add(
|
|
19208
|
+
sourceScopeNames.add(element.name.text);
|
|
19173
19209
|
}
|
|
19174
19210
|
} else if (clause?.namedBindings && ts16.isNamespaceImport(clause.namedBindings)) {
|
|
19175
19211
|
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
19176
19212
|
}
|
|
19177
19213
|
continue;
|
|
19178
19214
|
}
|
|
19179
|
-
if (ts16.isVariableStatement(stmt)
|
|
19180
|
-
const
|
|
19181
|
-
for (const decl of varStmt.declarationList.declarations) {
|
|
19215
|
+
if (ts16.isVariableStatement(stmt)) {
|
|
19216
|
+
for (const decl of stmt.declarationList.declarations) {
|
|
19182
19217
|
if (ts16.isIdentifier(decl.name)) {
|
|
19183
19218
|
sourceScopeNames.add(decl.name.text);
|
|
19184
19219
|
}
|
|
@@ -19209,10 +19244,10 @@ ${block}
|
|
|
19209
19244
|
if (ts16.isNamespaceImport(bindings)) {
|
|
19210
19245
|
allImportedNames.add(bindings.name.text);
|
|
19211
19246
|
} else {
|
|
19212
|
-
for (const
|
|
19213
|
-
if (
|
|
19247
|
+
for (const element of bindings.elements) {
|
|
19248
|
+
if (element.isTypeOnly)
|
|
19214
19249
|
continue;
|
|
19215
|
-
allImportedNames.add(
|
|
19250
|
+
allImportedNames.add(element.name.text);
|
|
19216
19251
|
}
|
|
19217
19252
|
}
|
|
19218
19253
|
}
|
|
@@ -19278,10 +19313,17 @@ ${methodsBlock}
|
|
|
19278
19313
|
}
|
|
19279
19314
|
};
|
|
19280
19315
|
var init_fastHmrCompiler = __esm(() => {
|
|
19316
|
+
init_stylePreprocessor();
|
|
19281
19317
|
init_hmrImportGenerator();
|
|
19282
19318
|
init_typescript_translator();
|
|
19283
19319
|
fingerprintCache = new Map;
|
|
19284
19320
|
pendingModuleCache = new Map;
|
|
19321
|
+
ANGULAR_DECORATOR_NAMES = new Set([
|
|
19322
|
+
"Component",
|
|
19323
|
+
"Directive",
|
|
19324
|
+
"Injectable",
|
|
19325
|
+
"Pipe"
|
|
19326
|
+
]);
|
|
19285
19327
|
entityFingerprintCache = new Map;
|
|
19286
19328
|
ENTITY_DECORATOR_NAMES = new Set(["Pipe", "Directive", "Injectable"]);
|
|
19287
19329
|
VIEW_ENCAPSULATION_VALUES = {
|
|
@@ -20694,6 +20736,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
20694
20736
|
}, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
|
|
20695
20737
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,svelte,vue}");
|
|
20696
20738
|
for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
|
|
20739
|
+
if (isTestSourcePath(file4))
|
|
20740
|
+
continue;
|
|
20697
20741
|
const relToDir = file4.slice(dir.length + 1);
|
|
20698
20742
|
const [firstSegment] = relToDir.split("/");
|
|
20699
20743
|
if (firstSegment && SKIP_DIRS5.has(firstSegment))
|
|
@@ -20880,10 +20924,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20880
20924
|
return {};
|
|
20881
20925
|
const sanitized = { ...override };
|
|
20882
20926
|
for (const key of reservedBunBuildConfigKeys) {
|
|
20883
|
-
|
|
20927
|
+
Reflect.deleteProperty(sanitized, key);
|
|
20884
20928
|
}
|
|
20885
20929
|
for (const key of extraReservedKeys) {
|
|
20886
|
-
|
|
20930
|
+
Reflect.deleteProperty(sanitized, key);
|
|
20887
20931
|
}
|
|
20888
20932
|
return sanitized;
|
|
20889
20933
|
}, resolveBunBuildOverride = (config, pass) => {
|
|
@@ -20897,8 +20941,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20897
20941
|
...config.default ?? {},
|
|
20898
20942
|
...config[pass] ?? {}
|
|
20899
20943
|
}, locked);
|
|
20900
|
-
}, resolveClientSourcemap = (sourcemaps,
|
|
20901
|
-
if (
|
|
20944
|
+
}, resolveClientSourcemap = (sourcemaps, devMode) => {
|
|
20945
|
+
if (devMode)
|
|
20902
20946
|
return sourcemaps === false ? "none" : "inline";
|
|
20903
20947
|
if (sourcemaps === "external" || sourcemaps === true)
|
|
20904
20948
|
return "external";
|
|
@@ -20911,7 +20955,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20911
20955
|
...base,
|
|
20912
20956
|
...sanitized
|
|
20913
20957
|
};
|
|
20914
|
-
|
|
20958
|
+
const result = {
|
|
20915
20959
|
...merged,
|
|
20916
20960
|
define: base.define || sanitized.define ? {
|
|
20917
20961
|
...sanitized.define ?? {},
|
|
@@ -20923,6 +20967,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20923
20967
|
]),
|
|
20924
20968
|
plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
|
|
20925
20969
|
};
|
|
20970
|
+
return result;
|
|
20926
20971
|
}, buildUnlocked = async ({
|
|
20927
20972
|
buildDirectory = "build",
|
|
20928
20973
|
assetsDirectory,
|
|
@@ -20960,12 +21005,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20960
21005
|
delete traceGlobal.__absoluteBuildTracePhase;
|
|
20961
21006
|
}
|
|
20962
21007
|
};
|
|
20963
|
-
const tracePhase = async (name,
|
|
21008
|
+
const tracePhase = async (name, runPhase, metadata) => {
|
|
20964
21009
|
if (!traceEnabled)
|
|
20965
|
-
return
|
|
21010
|
+
return runPhase();
|
|
20966
21011
|
const phaseStart = performance.now();
|
|
20967
21012
|
try {
|
|
20968
|
-
const result = await
|
|
21013
|
+
const result = await runPhase();
|
|
20969
21014
|
traceEvents.push({
|
|
20970
21015
|
durationMs: performance.now() - phaseStart,
|
|
20971
21016
|
metadata,
|
|
@@ -21132,7 +21177,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21132
21177
|
recursive: true
|
|
21133
21178
|
}));
|
|
21134
21179
|
}
|
|
21135
|
-
const
|
|
21180
|
+
const tailwindSourceConfig = {
|
|
21136
21181
|
angularDirectory,
|
|
21137
21182
|
emberDirectory,
|
|
21138
21183
|
htmlDirectory,
|
|
@@ -21140,7 +21185,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21140
21185
|
reactDirectory,
|
|
21141
21186
|
svelteDirectory,
|
|
21142
21187
|
vueDirectory
|
|
21143
|
-
}
|
|
21188
|
+
};
|
|
21189
|
+
const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig, computeFrameworkTailwindSources(tailwindSourceConfig), normalizedIncrementalFiles ?? [])) : undefined;
|
|
21144
21190
|
const emptyConventionResult = {
|
|
21145
21191
|
conventions: undefined,
|
|
21146
21192
|
pageFiles: []
|
|
@@ -21377,7 +21423,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21377
21423
|
vueSpaRoutesBySource
|
|
21378
21424
|
},
|
|
21379
21425
|
{ clientPaths: angularClientPaths, serverPaths: angularServerPaths },
|
|
21380
|
-
{
|
|
21426
|
+
{ serverPaths: emberServerPaths },
|
|
21381
21427
|
{ svelteClientPaths: islandSvelteClientPaths },
|
|
21382
21428
|
{ vueClientPaths: islandVueClientPaths },
|
|
21383
21429
|
{ clientPaths: islandAngularClientPaths }
|
|
@@ -21397,8 +21443,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21397
21443
|
shouldCompileAngular ? tracePhase("compile/angular", async () => {
|
|
21398
21444
|
const mod = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
21399
21445
|
if (angularAppProvidersSource && angularDir) {
|
|
21400
|
-
const {
|
|
21401
|
-
|
|
21446
|
+
const {
|
|
21447
|
+
getFrameworkGeneratedDir: resolveGeneratedDirectory
|
|
21448
|
+
} = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
21449
|
+
const compiledRoot = resolveGeneratedDirectory("angular", projectRoot);
|
|
21402
21450
|
await mod.compileAngularFileJIT(angularAppProvidersSource, compiledRoot, angularDir, styleTransformConfig);
|
|
21403
21451
|
}
|
|
21404
21452
|
const result = await mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig, angularProvidersInjection);
|
|
@@ -21406,20 +21454,23 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21406
21454
|
try {
|
|
21407
21455
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
21408
21456
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
21409
|
-
const { join:
|
|
21457
|
+
const { join: joinPath } = await import("path");
|
|
21410
21458
|
const walk = async (dir) => {
|
|
21411
21459
|
const entries = await readdir4(dir, {
|
|
21412
21460
|
withFileTypes: true
|
|
21413
21461
|
});
|
|
21414
21462
|
const out = [];
|
|
21463
|
+
const directories = [];
|
|
21415
21464
|
for (const entry of entries) {
|
|
21416
|
-
const full =
|
|
21465
|
+
const full = joinPath(dir, entry.name);
|
|
21417
21466
|
if (entry.isDirectory()) {
|
|
21418
|
-
|
|
21467
|
+
directories.push(full);
|
|
21419
21468
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
21420
21469
|
out.push(full);
|
|
21421
21470
|
}
|
|
21422
21471
|
}
|
|
21472
|
+
const nestedFiles = await Promise.all(directories.map(walk));
|
|
21473
|
+
out.push(...nestedFiles.flat());
|
|
21423
21474
|
return out;
|
|
21424
21475
|
};
|
|
21425
21476
|
const tsFiles = await walk(angularDir);
|
|
@@ -21481,11 +21532,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21481
21532
|
const destDir = join36(buildPath, "conventions", "react");
|
|
21482
21533
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21483
21534
|
mkdirSync12(destDir, { recursive: true });
|
|
21484
|
-
const destPaths =
|
|
21485
|
-
for (let idx = 0;idx < reactConventionSources.length; idx++) {
|
|
21486
|
-
const source = reactConventionSources[idx];
|
|
21487
|
-
if (!source)
|
|
21488
|
-
continue;
|
|
21535
|
+
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
21489
21536
|
const result = await bunBuild7({
|
|
21490
21537
|
entrypoints: [source],
|
|
21491
21538
|
format: "esm",
|
|
@@ -21506,8 +21553,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21506
21553
|
const output = result.outputs.find((artifact) => artifact.path.endsWith(".js"));
|
|
21507
21554
|
if (!output)
|
|
21508
21555
|
throw new Error(`React convention did not emit JavaScript: ${source}`);
|
|
21509
|
-
|
|
21510
|
-
}
|
|
21556
|
+
return output.path;
|
|
21557
|
+
}));
|
|
21511
21558
|
return destPaths;
|
|
21512
21559
|
};
|
|
21513
21560
|
const [
|
|
@@ -21525,11 +21572,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21525
21572
|
const destDir = join36(buildPath, "conventions", framework);
|
|
21526
21573
|
rmSync2(destDir, { force: true, recursive: true });
|
|
21527
21574
|
mkdirSync12(destDir, { recursive: true });
|
|
21528
|
-
const destPaths =
|
|
21529
|
-
for (let idx = 0;idx < compiledPaths.length; idx++) {
|
|
21530
|
-
const compiledPath = compiledPaths[idx];
|
|
21531
|
-
if (!compiledPath)
|
|
21532
|
-
continue;
|
|
21575
|
+
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
21533
21576
|
const name = basename14(compiledPath).replace(/\.[^.]+$/, "");
|
|
21534
21577
|
const result = await bunBuild7({
|
|
21535
21578
|
entrypoints: [compiledPath],
|
|
@@ -21548,8 +21591,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21548
21591
|
const output = result.outputs.find((artifact) => artifact.path.endsWith(".js"));
|
|
21549
21592
|
if (!output)
|
|
21550
21593
|
throw new Error(`${framework} convention did not emit JavaScript: ${compiledPath}`);
|
|
21551
|
-
|
|
21552
|
-
}
|
|
21594
|
+
return output.path;
|
|
21595
|
+
}));
|
|
21553
21596
|
return destPaths;
|
|
21554
21597
|
};
|
|
21555
21598
|
const [svelteDests, vueDests, angularDests] = await Promise.all([
|
|
@@ -21883,15 +21926,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21883
21926
|
const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
|
|
21884
21927
|
const sourcemapDir = join36(projectRoot, "sourcemaps");
|
|
21885
21928
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
21886
|
-
const mapFiles = readdirSync5(buildPath, {
|
|
21929
|
+
const mapFiles = readdirSync5(buildPath, {
|
|
21930
|
+
encoding: "utf8",
|
|
21931
|
+
recursive: true
|
|
21932
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join36(buildPath, entry));
|
|
21887
21933
|
for (const mapPath of mapFiles) {
|
|
21888
21934
|
chainExternalSourcemap2(mapPath);
|
|
21889
21935
|
renameSync(mapPath, join36(sourcemapDir, basename14(mapPath)));
|
|
21890
21936
|
const jsPath = mapPath.slice(0, -4);
|
|
21891
21937
|
try {
|
|
21892
|
-
const
|
|
21938
|
+
const javascript = readFileSync21(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
21893
21939
|
`);
|
|
21894
|
-
writeFileSync8(jsPath,
|
|
21940
|
+
writeFileSync8(jsPath, javascript);
|
|
21895
21941
|
} catch {}
|
|
21896
21942
|
}
|
|
21897
21943
|
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative15(projectRoot, sourcemapDir)}/`);
|
|
@@ -23074,7 +23120,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23074
23120
|
refs.push(match[1]);
|
|
23075
23121
|
}
|
|
23076
23122
|
while ((match = stylesArrRe.exec(source)) !== null) {
|
|
23077
|
-
const inner = match
|
|
23123
|
+
const [inner] = match.slice(1);
|
|
23078
23124
|
if (!inner)
|
|
23079
23125
|
continue;
|
|
23080
23126
|
let strMatch;
|
|
@@ -23133,8 +23179,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
23133
23179
|
roots.push(abs);
|
|
23134
23180
|
}
|
|
23135
23181
|
try {
|
|
23136
|
-
const {
|
|
23137
|
-
const entries = readdirSync7(cwd2, { withFileTypes: true });
|
|
23182
|
+
const entries = readdirSync6(cwd2, { withFileTypes: true });
|
|
23138
23183
|
for (const entry of entries) {
|
|
23139
23184
|
if (!entry.isDirectory())
|
|
23140
23185
|
continue;
|
|
@@ -23234,9 +23279,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23234
23279
|
operation: "add"
|
|
23235
23280
|
});
|
|
23236
23281
|
}
|
|
23237
|
-
}, 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((
|
|
23282
|
+
}, 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) => {
|
|
23238
23283
|
const ATOMIC_RECOVERY_WINDOW_MS = 1000;
|
|
23239
|
-
const recentlySynthesized = new Map;
|
|
23240
23284
|
const atomicRecoveryScan = (eventDir) => {
|
|
23241
23285
|
let entries;
|
|
23242
23286
|
try {
|
|
@@ -23260,10 +23304,6 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23260
23304
|
const age = now - st2.ctimeMs;
|
|
23261
23305
|
if (age < 0 || age > ATOMIC_RECOVERY_WINDOW_MS)
|
|
23262
23306
|
continue;
|
|
23263
|
-
const last = recentlySynthesized.get(child) ?? 0;
|
|
23264
|
-
if (now - last < 100)
|
|
23265
|
-
continue;
|
|
23266
|
-
recentlySynthesized.set(child, now);
|
|
23267
23307
|
onFileChange(child);
|
|
23268
23308
|
safeAddToGraph(state.dependencyGraph, child);
|
|
23269
23309
|
}
|
|
@@ -23275,6 +23315,10 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
23275
23315
|
if (event === "rename") {
|
|
23276
23316
|
const eventDir = dirname21(join38(absolutePath, filename)).replace(/\\/g, "/");
|
|
23277
23317
|
atomicRecoveryScan(eventDir);
|
|
23318
|
+
for (const delay of [25, 100]) {
|
|
23319
|
+
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
23320
|
+
timer.unref();
|
|
23321
|
+
}
|
|
23278
23322
|
}
|
|
23279
23323
|
return;
|
|
23280
23324
|
}
|
|
@@ -23792,18 +23836,19 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
23792
23836
|
return "";
|
|
23793
23837
|
let pathname;
|
|
23794
23838
|
try {
|
|
23795
|
-
pathname = new URL(requestUrl)
|
|
23839
|
+
({ pathname } = new URL(requestUrl));
|
|
23796
23840
|
} catch {
|
|
23797
23841
|
pathname = requestUrl.split("?")[0] ?? requestUrl;
|
|
23798
23842
|
}
|
|
23799
23843
|
const matched = findMatchingRoute(routes, pathname);
|
|
23800
23844
|
if (!matched)
|
|
23801
23845
|
return "";
|
|
23846
|
+
const { cssPath: routeCssPath } = matched;
|
|
23802
23847
|
const cssPaths = [
|
|
23803
|
-
|
|
23848
|
+
routeCssPath,
|
|
23804
23849
|
...routes.map((route) => route.cssPath)
|
|
23805
|
-
].filter((
|
|
23806
|
-
const chunks = await Promise.all(cssPaths.map((
|
|
23850
|
+
].filter((childCssPath, index, all) => childCssPath && all.indexOf(childCssPath) === index);
|
|
23851
|
+
const chunks = await Promise.all(cssPaths.map((childCssPath) => readChildCss(childCssPath, sideManifestPath)));
|
|
23807
23852
|
return chunks.filter(Boolean).join(`
|
|
23808
23853
|
`);
|
|
23809
23854
|
};
|
|
@@ -23923,10 +23968,10 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
23923
23968
|
const expr = decorator.expression;
|
|
23924
23969
|
if (!ts17.isCallExpression(expr))
|
|
23925
23970
|
continue;
|
|
23926
|
-
const
|
|
23927
|
-
if (!ts17.isIdentifier(
|
|
23971
|
+
const functionNode = expr.expression;
|
|
23972
|
+
if (!ts17.isIdentifier(functionNode))
|
|
23928
23973
|
continue;
|
|
23929
|
-
const kind = ENTITY_DECORATORS[
|
|
23974
|
+
const kind = ENTITY_DECORATORS[functionNode.text];
|
|
23930
23975
|
if (!kind)
|
|
23931
23976
|
continue;
|
|
23932
23977
|
let extendsName = null;
|
|
@@ -23934,7 +23979,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
23934
23979
|
if (heritage.token !== ts17.SyntaxKind.ExtendsKeyword) {
|
|
23935
23980
|
continue;
|
|
23936
23981
|
}
|
|
23937
|
-
const first = heritage.types
|
|
23982
|
+
const [first] = heritage.types;
|
|
23938
23983
|
if (first && ts17.isIdentifier(first.expression)) {
|
|
23939
23984
|
extendsName = first.expression.text;
|
|
23940
23985
|
}
|
|
@@ -23947,7 +23992,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
23947
23992
|
styleUrls: [],
|
|
23948
23993
|
templateUrls: []
|
|
23949
23994
|
};
|
|
23950
|
-
const arg = expr.arguments
|
|
23995
|
+
const [arg] = expr.arguments;
|
|
23951
23996
|
if (arg && ts17.isObjectLiteralExpression(arg) && kind === "component") {
|
|
23952
23997
|
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
23953
23998
|
if (tplUrl)
|
|
@@ -24005,9 +24050,9 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24005
24050
|
} catch {
|
|
24006
24051
|
return null;
|
|
24007
24052
|
}
|
|
24008
|
-
const
|
|
24053
|
+
const sourceFile = ts17.createSourceFile(childFilePath, source, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
|
|
24009
24054
|
const childDir = dirname24(childFilePath);
|
|
24010
|
-
for (const stmt of
|
|
24055
|
+
for (const stmt of sourceFile.statements) {
|
|
24011
24056
|
if (!ts17.isImportDeclaration(stmt))
|
|
24012
24057
|
continue;
|
|
24013
24058
|
if (!ts17.isStringLiteral(stmt.moduleSpecifier))
|
|
@@ -24019,10 +24064,10 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
|
|
|
24019
24064
|
if (clause.name && clause.name.text === parentName)
|
|
24020
24065
|
matchesName = true;
|
|
24021
24066
|
if (!matchesName && clause.namedBindings && ts17.isNamedImports(clause.namedBindings)) {
|
|
24022
|
-
for (const
|
|
24023
|
-
if (
|
|
24067
|
+
for (const element of clause.namedBindings.elements) {
|
|
24068
|
+
if (element.isTypeOnly)
|
|
24024
24069
|
continue;
|
|
24025
|
-
if (
|
|
24070
|
+
if (element.name.text === parentName) {
|
|
24026
24071
|
matchesName = true;
|
|
24027
24072
|
break;
|
|
24028
24073
|
}
|
|
@@ -25326,11 +25371,11 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
25326
25371
|
return `${projectRel}@${className}`;
|
|
25327
25372
|
}, getApplyMetadataModule = async (encodedId) => {
|
|
25328
25373
|
const decoded = decodeURIComponent(encodedId);
|
|
25329
|
-
const
|
|
25330
|
-
if (
|
|
25374
|
+
const separatorIndex = decoded.lastIndexOf("@");
|
|
25375
|
+
if (separatorIndex === -1)
|
|
25331
25376
|
return null;
|
|
25332
|
-
const filePathRel = decoded.slice(0,
|
|
25333
|
-
const className = decoded.slice(
|
|
25377
|
+
const filePathRel = decoded.slice(0, separatorIndex);
|
|
25378
|
+
const className = decoded.slice(separatorIndex + 1);
|
|
25334
25379
|
const componentFilePath = resolve39(process.cwd(), filePathRel);
|
|
25335
25380
|
const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
25336
25381
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
@@ -25464,14 +25509,13 @@ var resolveRequestPathname = (request) => {
|
|
|
25464
25509
|
return;
|
|
25465
25510
|
}
|
|
25466
25511
|
}, installSimpleDomGlobals = () => {
|
|
25467
|
-
|
|
25468
|
-
|
|
25469
|
-
|
|
25470
|
-
};
|
|
25512
|
+
if (typeof globalThis.Element === "undefined") {
|
|
25513
|
+
Reflect.set(globalThis, "Element", class Element {
|
|
25514
|
+
});
|
|
25471
25515
|
}
|
|
25472
|
-
if (typeof
|
|
25473
|
-
|
|
25474
|
-
};
|
|
25516
|
+
if (typeof globalThis.Node === "undefined") {
|
|
25517
|
+
Reflect.set(globalThis, "Node", class Node {
|
|
25518
|
+
});
|
|
25475
25519
|
}
|
|
25476
25520
|
}, emberCacheBuster = 0, buildRuntimeModuleSpecifier = (modulePath) => {
|
|
25477
25521
|
if (emberCacheBuster === 0)
|
|
@@ -25585,8 +25629,16 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
25585
25629
|
var init_simpleHTMXHMR = () => {};
|
|
25586
25630
|
|
|
25587
25631
|
// src/dev/rebuildTrigger.ts
|
|
25588
|
-
import { existsSync as existsSync33, rmSync as rmSync3 } from "fs";
|
|
25589
|
-
import {
|
|
25632
|
+
import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
25633
|
+
import {
|
|
25634
|
+
basename as basename17,
|
|
25635
|
+
dirname as dirname27,
|
|
25636
|
+
isAbsolute as isAbsolute6,
|
|
25637
|
+
join as join41,
|
|
25638
|
+
relative as relative18,
|
|
25639
|
+
resolve as resolvePath,
|
|
25640
|
+
sep as sep4
|
|
25641
|
+
} from "path";
|
|
25590
25642
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
25591
25643
|
clearSpaRouteCssCaches();
|
|
25592
25644
|
clearSiblingCssCache();
|
|
@@ -25601,7 +25653,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25601
25653
|
if (!cssChanged)
|
|
25602
25654
|
return;
|
|
25603
25655
|
try {
|
|
25604
|
-
const outputPath =
|
|
25656
|
+
const outputPath = resolvePath(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
25605
25657
|
const bytes = await Bun.file(outputPath).bytes();
|
|
25606
25658
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
25607
25659
|
state.assetStore.set(webPath, bytes);
|
|
@@ -25692,12 +25744,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25692
25744
|
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync33(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
25693
25745
|
const { config } = state;
|
|
25694
25746
|
const cwd2 = process.cwd();
|
|
25695
|
-
const absDeleted =
|
|
25747
|
+
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
25696
25748
|
for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
|
|
25697
25749
|
const dir = config[configKey];
|
|
25698
25750
|
if (!dir)
|
|
25699
25751
|
continue;
|
|
25700
|
-
const absDir =
|
|
25752
|
+
const absDir = resolvePath(cwd2, dir).replace(/\\/g, "/");
|
|
25701
25753
|
if (!absDeleted.startsWith(`${absDir}/`))
|
|
25702
25754
|
continue;
|
|
25703
25755
|
const rel = absDeleted.slice(absDir.length + 1);
|
|
@@ -25721,7 +25773,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25721
25773
|
removeStaleGenerated(state, filePathInSet);
|
|
25722
25774
|
try {
|
|
25723
25775
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
25724
|
-
const deletedPathResolved =
|
|
25776
|
+
const deletedPathResolved = resolvePath(filePathInSet);
|
|
25725
25777
|
affectedFiles.forEach((affectedFile) => {
|
|
25726
25778
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
25727
25779
|
validFiles.push(affectedFile);
|
|
@@ -25765,7 +25817,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25765
25817
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
25766
25818
|
return;
|
|
25767
25819
|
}
|
|
25768
|
-
const normalizedFilePath =
|
|
25820
|
+
const normalizedFilePath = resolvePath(filePathInSet);
|
|
25769
25821
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
25770
25822
|
validFiles.push(normalizedFilePath);
|
|
25771
25823
|
processedFiles.add(normalizedFilePath);
|
|
@@ -25896,7 +25948,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25896
25948
|
const userEditedFiles = new Set;
|
|
25897
25949
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
25898
25950
|
for (const filePath of filePaths) {
|
|
25899
|
-
userEditedFiles.add(
|
|
25951
|
+
userEditedFiles.add(resolvePath(filePath));
|
|
25900
25952
|
}
|
|
25901
25953
|
});
|
|
25902
25954
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -25915,6 +25967,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25915
25967
|
});
|
|
25916
25968
|
triggerRebuild(state, config, onRebuildComplete, filesToRebuild);
|
|
25917
25969
|
}, queueFileChange = async (state, filePath, config, onRebuildComplete) => {
|
|
25970
|
+
const serverEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
25971
|
+
if (serverEntry && resolvePath(filePath) === resolvePath(serverEntry))
|
|
25972
|
+
return;
|
|
25918
25973
|
const framework = detectFramework(filePath, state.resolvedPaths);
|
|
25919
25974
|
if (framework === "ignored") {
|
|
25920
25975
|
return;
|
|
@@ -25929,7 +25984,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25929
25984
|
const { publicDir } = state.resolvedPaths;
|
|
25930
25985
|
const { assetsDir } = state.resolvedPaths;
|
|
25931
25986
|
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
25932
|
-
const absSource =
|
|
25987
|
+
const absSource = resolvePath(filePath);
|
|
25933
25988
|
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
25934
25989
|
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
25935
25990
|
if (!normalizedSource.startsWith(`${normalizedDir}/`))
|
|
@@ -25937,10 +25992,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25937
25992
|
try {
|
|
25938
25993
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
25939
25994
|
const { buildDir } = state.resolvedPaths;
|
|
25940
|
-
const destPath =
|
|
25995
|
+
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
25941
25996
|
const { mkdir: mkdir8, copyFile, readFile: readFile7 } = await import("fs/promises");
|
|
25942
|
-
|
|
25943
|
-
await mkdir8(dirname28(destPath), { recursive: true });
|
|
25997
|
+
await mkdir8(dirname27(destPath), { recursive: true });
|
|
25944
25998
|
await copyFile(absSource, destPath);
|
|
25945
25999
|
const bytes = await readFile7(destPath);
|
|
25946
26000
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -25963,7 +26017,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25963
26017
|
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
25964
26018
|
return;
|
|
25965
26019
|
if (framework === "unknown") {
|
|
25966
|
-
invalidate(
|
|
26020
|
+
invalidate(resolvePath(filePath));
|
|
25967
26021
|
const relPath = relative18(process.cwd(), filePath);
|
|
25968
26022
|
logHmrUpdate(relPath);
|
|
25969
26023
|
const { angularDir } = state.resolvedPaths;
|
|
@@ -25971,10 +26025,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25971
26025
|
if (angularDir && state.dependencyGraph) {
|
|
25972
26026
|
try {
|
|
25973
26027
|
const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
|
|
25974
|
-
addFileToGraph2(state.dependencyGraph,
|
|
25975
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
26028
|
+
addFileToGraph2(state.dependencyGraph, resolvePath(filePath));
|
|
26029
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolvePath(filePath));
|
|
25976
26030
|
for (const dependent of affected) {
|
|
25977
|
-
if (dependent ===
|
|
26031
|
+
if (dependent === resolvePath(filePath))
|
|
25978
26032
|
continue;
|
|
25979
26033
|
const dependentFramework = detectFramework(dependent, state.resolvedPaths);
|
|
25980
26034
|
if (dependentFramework !== "angular")
|
|
@@ -25991,14 +26045,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
25991
26045
|
} catch {}
|
|
25992
26046
|
}
|
|
25993
26047
|
if (!hasAngularDependent) {
|
|
25994
|
-
console.log(`[abs:restart] ${
|
|
26048
|
+
console.log(`[abs:restart] ${resolvePath(filePath)}`);
|
|
25995
26049
|
return;
|
|
25996
26050
|
}
|
|
25997
26051
|
try {
|
|
25998
26052
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
25999
26053
|
const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
26000
26054
|
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
26001
|
-
const sourceAbs =
|
|
26055
|
+
const sourceAbs = resolvePath(filePath).replace(/\\/g, "/");
|
|
26002
26056
|
const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
|
|
26003
26057
|
invalidateModuleServer(generatedTwin);
|
|
26004
26058
|
} catch {}
|
|
@@ -26040,7 +26094,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26040
26094
|
}
|
|
26041
26095
|
if (!graph)
|
|
26042
26096
|
return componentFile;
|
|
26043
|
-
const dependents = graph.dependents.get(
|
|
26097
|
+
const dependents = graph.dependents.get(resolvePath(componentFile));
|
|
26044
26098
|
if (!dependents)
|
|
26045
26099
|
return componentFile;
|
|
26046
26100
|
for (const dep of dependents) {
|
|
@@ -26049,7 +26103,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26049
26103
|
}
|
|
26050
26104
|
return componentFile;
|
|
26051
26105
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
26052
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
26106
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolvePath(file4).startsWith(angularPagesPath));
|
|
26053
26107
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
26054
26108
|
return pageEntries;
|
|
26055
26109
|
}
|
|
@@ -26058,7 +26112,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26058
26112
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
26059
26113
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
26060
26114
|
affected.forEach((file4) => {
|
|
26061
|
-
if (file4.endsWith(".ts") &&
|
|
26115
|
+
if (file4.endsWith(".ts") && resolvePath(file4).startsWith(angularPagesPath)) {
|
|
26062
26116
|
resolvedPages.add(file4);
|
|
26063
26117
|
}
|
|
26064
26118
|
});
|
|
@@ -26096,8 +26150,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26096
26150
|
if (serverDirs.length <= 1) {
|
|
26097
26151
|
const dir = getFrameworkGeneratedDir2(framework, projectRoot);
|
|
26098
26152
|
return {
|
|
26099
|
-
serverOutDir:
|
|
26100
|
-
serverRoot:
|
|
26153
|
+
serverOutDir: resolvePath(resolvedPaths.buildDir, basename17(dir)),
|
|
26154
|
+
serverRoot: resolvePath(dir, "server")
|
|
26101
26155
|
};
|
|
26102
26156
|
}
|
|
26103
26157
|
return {
|
|
@@ -26124,15 +26178,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26124
26178
|
const [prefix] = name.split(".");
|
|
26125
26179
|
if (!prefix)
|
|
26126
26180
|
continue;
|
|
26127
|
-
|
|
26128
|
-
|
|
26129
|
-
|
|
26130
|
-
|
|
26131
|
-
|
|
26132
|
-
|
|
26133
|
-
|
|
26134
|
-
|
|
26135
|
-
|
|
26181
|
+
const keep = keepByDir.get(dir) ?? new Set;
|
|
26182
|
+
const keepStems = keepStemsByDir.get(dir) ?? new Set;
|
|
26183
|
+
const prefixes = prefixByDir.get(dir) ?? new Set;
|
|
26184
|
+
keepByDir.set(dir, keep);
|
|
26185
|
+
keepStemsByDir.set(dir, keepStems);
|
|
26186
|
+
prefixByDir.set(dir, prefixes);
|
|
26187
|
+
keep.add(name);
|
|
26188
|
+
keepStems.add(name.replace(/\.[^.]+$/, ""));
|
|
26189
|
+
prefixes.add(prefix);
|
|
26136
26190
|
}
|
|
26137
26191
|
await Promise.all(Array.from(keepByDir.entries()).map(async ([dir, keep]) => {
|
|
26138
26192
|
const prefixes = prefixByDir.get(dir);
|
|
@@ -26270,8 +26324,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26270
26324
|
if (detected !== "unknown")
|
|
26271
26325
|
continue;
|
|
26272
26326
|
try {
|
|
26273
|
-
const affected = getAffectedFiles(state.dependencyGraph,
|
|
26274
|
-
const hasAngularConsumer = affected.some((dep) => dep !==
|
|
26327
|
+
const affected = getAffectedFiles(state.dependencyGraph, resolvePath(editedFile));
|
|
26328
|
+
const hasAngularConsumer = affected.some((dep) => dep !== resolvePath(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
|
|
26275
26329
|
if (hasAngularConsumer) {
|
|
26276
26330
|
return {
|
|
26277
26331
|
kind: "rebootstrap",
|
|
@@ -26318,7 +26372,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26318
26372
|
}
|
|
26319
26373
|
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
26320
26374
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
26321
|
-
const angularDirAbs =
|
|
26375
|
+
const angularDirAbs = resolvePath(angularDir).replace(/\\/g, "/");
|
|
26322
26376
|
if (normalized.startsWith(`${angularDirAbs}/`)) {
|
|
26323
26377
|
return {
|
|
26324
26378
|
kind: "rebootstrap",
|
|
@@ -26434,19 +26488,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26434
26488
|
let ctx = angularBundleState.get(state);
|
|
26435
26489
|
if (!ctx) {
|
|
26436
26490
|
ctx = {
|
|
26491
|
+
angularDir,
|
|
26437
26492
|
debouncedPromise: null,
|
|
26438
26493
|
debouncedResolve: null,
|
|
26439
26494
|
debounceTimer: null,
|
|
26440
26495
|
inFlight: null,
|
|
26496
|
+
pageEntries,
|
|
26441
26497
|
pending: false
|
|
26442
26498
|
};
|
|
26443
26499
|
angularBundleState.set(state, ctx);
|
|
26444
26500
|
}
|
|
26501
|
+
ctx.pageEntries = pageEntries;
|
|
26502
|
+
ctx.angularDir = angularDir;
|
|
26445
26503
|
const doOne = async () => {
|
|
26446
|
-
if (pageEntries.length === 0)
|
|
26504
|
+
if (ctx.pageEntries.length === 0)
|
|
26447
26505
|
return;
|
|
26448
26506
|
try {
|
|
26449
|
-
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
26507
|
+
await compileAndBundleAngular(state, ctx.pageEntries, ctx.angularDir);
|
|
26450
26508
|
} catch (error) {
|
|
26451
26509
|
console.error("[hmr] angular bundle rebuild failed \u2014 will retry on the next change:", error instanceof Error ? error.message : error);
|
|
26452
26510
|
}
|
|
@@ -26465,23 +26523,24 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26465
26523
|
};
|
|
26466
26524
|
const fire = () => {
|
|
26467
26525
|
ctx.debounceTimer = null;
|
|
26468
|
-
const
|
|
26526
|
+
const resolveDebounce = ctx.debouncedResolve;
|
|
26469
26527
|
ctx.debouncedResolve = null;
|
|
26470
26528
|
ctx.debouncedPromise = null;
|
|
26471
26529
|
if (ctx.inFlight) {
|
|
26472
26530
|
ctx.pending = true;
|
|
26473
|
-
ctx.inFlight.
|
|
26531
|
+
ctx.inFlight.then(resolveDebounce, resolveDebounce);
|
|
26474
26532
|
return;
|
|
26475
26533
|
}
|
|
26476
26534
|
ctx.inFlight = drive();
|
|
26477
|
-
ctx.inFlight.
|
|
26535
|
+
ctx.inFlight.then(resolveDebounce, resolveDebounce);
|
|
26478
26536
|
};
|
|
26479
26537
|
return ({ immediate = false } = {}) => {
|
|
26480
26538
|
if (!ctx.debouncedPromise) {
|
|
26481
|
-
ctx.debouncedPromise = new Promise((
|
|
26482
|
-
ctx.debouncedResolve =
|
|
26539
|
+
ctx.debouncedPromise = new Promise((resolve42) => {
|
|
26540
|
+
ctx.debouncedResolve = resolve42;
|
|
26483
26541
|
});
|
|
26484
26542
|
}
|
|
26543
|
+
const scheduled = ctx.debouncedPromise;
|
|
26485
26544
|
if (immediate) {
|
|
26486
26545
|
if (ctx.debounceTimer) {
|
|
26487
26546
|
clearTimeout(ctx.debounceTimer);
|
|
@@ -26494,16 +26553,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26494
26553
|
clearTimeout(ctx.debounceTimer);
|
|
26495
26554
|
ctx.debounceTimer = setTimeout(fire, ANGULAR_BUNDLE_DEBOUNCE_MS);
|
|
26496
26555
|
}
|
|
26497
|
-
return
|
|
26556
|
+
return scheduled;
|
|
26498
26557
|
};
|
|
26499
26558
|
}, runAngularHmrIncremental = async (state, angularDir, _pageEntries) => {
|
|
26500
26559
|
const editedFiles = state.lastUserEditedFiles ?? new Set;
|
|
26501
|
-
const
|
|
26560
|
+
const refreshDisk = async () => {
|
|
26502
26561
|
if (!angularDir || editedFiles.size === 0)
|
|
26503
26562
|
return;
|
|
26504
|
-
const angularDirAbs =
|
|
26563
|
+
const angularDirAbs = resolvePath(angularDir);
|
|
26505
26564
|
const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
|
|
26506
|
-
const abs =
|
|
26565
|
+
const abs = resolvePath(file4);
|
|
26507
26566
|
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
|
|
26508
26567
|
});
|
|
26509
26568
|
if (filesUnderAngular.length === 0)
|
|
@@ -26525,7 +26584,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26525
26584
|
if (!ext)
|
|
26526
26585
|
continue;
|
|
26527
26586
|
if (ext === ".ts" || ext === ".tsx") {
|
|
26528
|
-
tsFilesToRefresh.add(
|
|
26587
|
+
tsFilesToRefresh.add(resolvePath(file4));
|
|
26529
26588
|
continue;
|
|
26530
26589
|
}
|
|
26531
26590
|
const owners = resolveOwningComponents2({
|
|
@@ -26533,7 +26592,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26533
26592
|
userAngularRoot: angularDirAbs
|
|
26534
26593
|
});
|
|
26535
26594
|
for (const owner of owners) {
|
|
26536
|
-
tsFilesToRefresh.add(
|
|
26595
|
+
tsFilesToRefresh.add(resolvePath(owner.componentFilePath));
|
|
26537
26596
|
}
|
|
26538
26597
|
}
|
|
26539
26598
|
if (tsFilesToRefresh.size === 0)
|
|
@@ -26548,23 +26607,25 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26548
26607
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
26549
26608
|
for (const tsFile of tsFilesToRefresh) {
|
|
26550
26609
|
const rel = relative18(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
26551
|
-
const compiledFile =
|
|
26610
|
+
const compiledFile = resolvePath(compiledRoot, rel);
|
|
26552
26611
|
invalidateModule2(compiledFile);
|
|
26553
26612
|
}
|
|
26554
26613
|
} catch {}
|
|
26555
26614
|
} catch (err) {
|
|
26556
26615
|
logWarn(`[hmr] disk-refresh skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
26557
26616
|
}
|
|
26558
|
-
}
|
|
26617
|
+
};
|
|
26618
|
+
const diskRefreshPromise = refreshDisk();
|
|
26559
26619
|
await diskRefreshPromise;
|
|
26560
26620
|
}, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
|
|
26561
|
-
const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
26621
|
+
const { compileAngular: compileAngular2, compileAngularFileJIT: compileAngularFileJIT2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
26622
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
26562
26623
|
const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
|
|
26563
26624
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
26564
26625
|
const projectRoot = process.cwd();
|
|
26565
|
-
const resolvedAngularDir =
|
|
26626
|
+
const resolvedAngularDir = resolvePath(angularDir);
|
|
26566
26627
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
26567
|
-
const
|
|
26628
|
+
const createProvidersInjection = () => {
|
|
26568
26629
|
const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
|
|
26569
26630
|
const basePathByKey = new Map;
|
|
26570
26631
|
for (const call of scan.calls) {
|
|
@@ -26582,18 +26643,23 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26582
26643
|
appProvidersSource: providersImport?.absolutePath ?? null,
|
|
26583
26644
|
pagesByFile
|
|
26584
26645
|
};
|
|
26585
|
-
}
|
|
26586
|
-
const
|
|
26587
|
-
|
|
26646
|
+
};
|
|
26647
|
+
const providersInjection = createProvidersInjection();
|
|
26648
|
+
const styleTransformConfig = getStyleTransformConfig(state.config);
|
|
26649
|
+
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
26650
|
+
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, styleTransformConfig, providersInjection);
|
|
26651
|
+
if (providersInjection.appProvidersSource) {
|
|
26652
|
+
await compileAngularFileJIT2(providersInjection.appProvidersSource, generatedAngularRoot, resolvedAngularDir, styleTransformConfig);
|
|
26653
|
+
}
|
|
26654
|
+
const primeFingerprints = async () => {
|
|
26588
26655
|
try {
|
|
26589
26656
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
26590
26657
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
26591
|
-
const { join: join42 } = await import("path");
|
|
26592
26658
|
const walk = async (dir) => {
|
|
26593
26659
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
26594
26660
|
const files = [];
|
|
26595
26661
|
for (const entry of entries) {
|
|
26596
|
-
const full =
|
|
26662
|
+
const full = join41(dir, entry.name);
|
|
26597
26663
|
if (entry.isDirectory()) {
|
|
26598
26664
|
files.push(...await walk(full));
|
|
26599
26665
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -26605,7 +26671,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26605
26671
|
const tsFiles = await walk(angularDir);
|
|
26606
26672
|
await Promise.all(tsFiles.map(primeComponentFingerprint2));
|
|
26607
26673
|
} catch {}
|
|
26608
|
-
}
|
|
26674
|
+
};
|
|
26675
|
+
primeFingerprints();
|
|
26609
26676
|
const { getAngularServerVendorPaths: getAngularServerVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
26610
26677
|
const angServerVendorPaths = getAngularServerVendorPaths2();
|
|
26611
26678
|
const ssrPaths = angServerVendorPaths ? serverPaths.map((serverPath) => serverPath.replace(/\.js$/, ".ssr.js")) : serverPaths;
|
|
@@ -26623,11 +26690,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26623
26690
|
serverPaths.forEach((serverPath, idx) => {
|
|
26624
26691
|
const fileBase = basename17(serverPath, ".js");
|
|
26625
26692
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
26626
|
-
state.manifest[toPascal(fileBase)] =
|
|
26693
|
+
state.manifest[toPascal(fileBase)] = resolvePath(ssrPath);
|
|
26627
26694
|
});
|
|
26628
26695
|
if (clientPaths.length > 0) {
|
|
26629
26696
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
26630
26697
|
}
|
|
26698
|
+
await Promise.all(pageEntries.map((entry) => compileAngularFileJIT2(entry, generatedAngularRoot, resolvedAngularDir, styleTransformConfig)));
|
|
26631
26699
|
broadcastToClients(state, {
|
|
26632
26700
|
data: { manifest: state.manifest },
|
|
26633
26701
|
type: "angular-tier-zero-ssr-rebuild-complete"
|
|
@@ -26635,23 +26703,19 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26635
26703
|
}, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
26636
26704
|
const angularDir = config.angularDirectory ?? "";
|
|
26637
26705
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
26638
|
-
|
|
26639
|
-
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
26640
|
-
}
|
|
26641
|
-
const angularPagesPath = resolve42(angularDir, "pages");
|
|
26706
|
+
const angularPagesPath = resolvePath(angularDir, "pages");
|
|
26642
26707
|
const initialPageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
26643
26708
|
const projectRoot = process.cwd();
|
|
26644
26709
|
const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
|
|
26645
26710
|
const providersImport = parseAngularProvidersImport2(projectRoot);
|
|
26646
|
-
const editedProvidersChain = providersImport && angularFiles.some((file4) =>
|
|
26647
|
-
const
|
|
26711
|
+
const editedProvidersChain = providersImport && angularFiles.some((file4) => resolvePath(file4) === resolvePath(providersImport.absolutePath) || resolvePath(file4).startsWith(`${resolvePath(angularDir)}/`));
|
|
26712
|
+
const collectAllPages = () => {
|
|
26648
26713
|
const allPages = [];
|
|
26649
|
-
const { readdirSync: readdirSync9 } = __require("fs");
|
|
26650
26714
|
const walk = (dir) => {
|
|
26651
26715
|
for (const entry of readdirSync9(dir, {
|
|
26652
26716
|
withFileTypes: true
|
|
26653
26717
|
})) {
|
|
26654
|
-
const full =
|
|
26718
|
+
const full = resolvePath(dir, entry.name);
|
|
26655
26719
|
if (entry.isDirectory())
|
|
26656
26720
|
walk(full);
|
|
26657
26721
|
else if (entry.isFile() && entry.name.endsWith(".ts"))
|
|
@@ -26662,7 +26726,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26662
26726
|
walk(angularPagesPath);
|
|
26663
26727
|
} catch {}
|
|
26664
26728
|
return allPages;
|
|
26665
|
-
}
|
|
26729
|
+
};
|
|
26730
|
+
const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? collectAllPages() : initialPageEntries;
|
|
26666
26731
|
const tierStart = performance.now();
|
|
26667
26732
|
const verdict = await decideAngularTier(state, angularDir);
|
|
26668
26733
|
const tierMs = (performance.now() - tierStart).toFixed(0);
|
|
@@ -26671,14 +26736,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26671
26736
|
if (verdict.tier === 0) {
|
|
26672
26737
|
await runAngularHmrIncremental(state, angularDir, pageEntries);
|
|
26673
26738
|
broadcastSurgical(state, verdict.queue);
|
|
26674
|
-
const
|
|
26675
|
-
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${
|
|
26739
|
+
const rightValue = verdict.breakdown;
|
|
26740
|
+
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
26676
26741
|
runBundle();
|
|
26677
26742
|
} else if (verdict.tier === 1 && verdict.kind === "remount") {
|
|
26678
26743
|
await runAngularHmrIncremental(state, angularDir, pageEntries);
|
|
26679
26744
|
broadcastRemount(state, verdict.queue);
|
|
26680
|
-
const
|
|
26681
|
-
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${
|
|
26745
|
+
const rightValue = verdict.breakdown;
|
|
26746
|
+
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${rightValue.importsMs}/resolve ${rightValue.resolveMs}/compile ${rightValue.compileMs}; awaiting client apply)`);
|
|
26682
26747
|
runBundle();
|
|
26683
26748
|
} else if (verdict.tier === 1 && verdict.kind === "rebootstrap") {
|
|
26684
26749
|
await runBundle({ immediate: true });
|
|
@@ -26702,12 +26767,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26702
26767
|
if (isComponentFile2)
|
|
26703
26768
|
return primaryFile;
|
|
26704
26769
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
26705
|
-
const nearest = findNearestComponent2(
|
|
26770
|
+
const nearest = findNearestComponent2(resolvePath(primaryFile));
|
|
26706
26771
|
return nearest ?? primaryFile;
|
|
26707
26772
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
26708
|
-
for (const file4 of reactFiles) {
|
|
26709
|
-
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
26710
|
-
}
|
|
26711
26773
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
26712
26774
|
if (!primaryFile) {
|
|
26713
26775
|
onRebuildComplete({
|
|
@@ -26861,12 +26923,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26861
26923
|
type: "svelte-update"
|
|
26862
26924
|
});
|
|
26863
26925
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
|
|
26864
|
-
for (const file4 of svelteFiles) {
|
|
26865
|
-
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
26866
|
-
}
|
|
26867
26926
|
const surgicallyHandled = state.svelteSurgicallyHandled ?? new Set;
|
|
26868
26927
|
for (const file4 of svelteFiles) {
|
|
26869
|
-
surgicallyHandled.add(
|
|
26928
|
+
surgicallyHandled.add(resolvePath(file4));
|
|
26870
26929
|
}
|
|
26871
26930
|
state.svelteSurgicallyHandled = surgicallyHandled;
|
|
26872
26931
|
const serverDuration = Date.now() - startTime;
|
|
@@ -26996,16 +27055,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
26996
27055
|
ctx.debouncedPromise = null;
|
|
26997
27056
|
if (ctx.inFlight) {
|
|
26998
27057
|
ctx.pending = true;
|
|
26999
|
-
ctx.inFlight.
|
|
27058
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
27000
27059
|
return;
|
|
27001
27060
|
}
|
|
27002
27061
|
ctx.inFlight = drive();
|
|
27003
|
-
ctx.inFlight.
|
|
27062
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
27004
27063
|
};
|
|
27005
27064
|
return () => {
|
|
27006
27065
|
if (!ctx.debouncedPromise) {
|
|
27007
|
-
ctx.debouncedPromise = new Promise((
|
|
27008
|
-
ctx.debouncedResolve =
|
|
27066
|
+
ctx.debouncedPromise = new Promise((resolve42) => {
|
|
27067
|
+
ctx.debouncedResolve = resolve42;
|
|
27009
27068
|
});
|
|
27010
27069
|
}
|
|
27011
27070
|
if (ctx.debounceTimer)
|
|
@@ -27125,9 +27184,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27125
27184
|
type: "vue-update"
|
|
27126
27185
|
});
|
|
27127
27186
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
|
|
27128
|
-
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
27129
|
-
state.fileHashes.set(resolve42(file4), computeFileHash(file4));
|
|
27130
|
-
}
|
|
27131
27187
|
await invalidateNonVueModules(nonVueFiles);
|
|
27132
27188
|
const serverDuration = Date.now() - startTime;
|
|
27133
27189
|
const forceReload = nonVueFiles.length > 0;
|
|
@@ -27274,16 +27330,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27274
27330
|
ctx.debouncedPromise = null;
|
|
27275
27331
|
if (ctx.inFlight) {
|
|
27276
27332
|
ctx.pending = true;
|
|
27277
|
-
ctx.inFlight.
|
|
27333
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
27278
27334
|
return;
|
|
27279
27335
|
}
|
|
27280
27336
|
ctx.inFlight = drive();
|
|
27281
|
-
ctx.inFlight.
|
|
27337
|
+
ctx.inFlight.then(resolveFn, resolveFn);
|
|
27282
27338
|
};
|
|
27283
27339
|
return () => {
|
|
27284
27340
|
if (!ctx.debouncedPromise) {
|
|
27285
|
-
ctx.debouncedPromise = new Promise((
|
|
27286
|
-
ctx.debouncedResolve =
|
|
27341
|
+
ctx.debouncedPromise = new Promise((resolve42) => {
|
|
27342
|
+
ctx.debouncedResolve = resolve42;
|
|
27287
27343
|
});
|
|
27288
27344
|
}
|
|
27289
27345
|
if (ctx.debounceTimer)
|
|
@@ -27307,7 +27363,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27307
27363
|
recursive: true,
|
|
27308
27364
|
withFileTypes: true
|
|
27309
27365
|
});
|
|
27310
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
27366
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolvePath(emberPagesPath, entry.name));
|
|
27311
27367
|
} catch {
|
|
27312
27368
|
return [];
|
|
27313
27369
|
}
|
|
@@ -27318,11 +27374,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27318
27374
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
27319
27375
|
return state.manifest;
|
|
27320
27376
|
}
|
|
27321
|
-
|
|
27322
|
-
|
|
27323
|
-
}
|
|
27324
|
-
const emberPagesPath = resolve42(emberDir, "pages");
|
|
27325
|
-
const directPageEntries = emberFiles.filter((file4) => resolve42(file4).startsWith(emberPagesPath));
|
|
27377
|
+
const emberPagesPath = resolvePath(emberDir, "pages");
|
|
27378
|
+
const directPageEntries = emberFiles.filter((file4) => resolvePath(file4).startsWith(emberPagesPath));
|
|
27326
27379
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
27327
27380
|
if (allPageEntries.length === 0) {
|
|
27328
27381
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -27332,7 +27385,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27332
27385
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
27333
27386
|
for (const serverPath of serverPaths) {
|
|
27334
27387
|
const fileBase = basename17(serverPath, ".js");
|
|
27335
|
-
state.manifest[toPascal(fileBase)] =
|
|
27388
|
+
state.manifest[toPascal(fileBase)] = resolvePath(serverPath);
|
|
27336
27389
|
}
|
|
27337
27390
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
27338
27391
|
invalidateEmberSsrCache2();
|
|
@@ -27425,8 +27478,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27425
27478
|
if (!buildReference?.source) {
|
|
27426
27479
|
return;
|
|
27427
27480
|
}
|
|
27428
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
27429
|
-
islandFiles.add(
|
|
27481
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname27(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
27482
|
+
islandFiles.add(resolvePath(sourcePath));
|
|
27430
27483
|
}, resolveIslandSourceFiles = async (config) => {
|
|
27431
27484
|
const registryPath = config.islands?.registry;
|
|
27432
27485
|
if (!registryPath) {
|
|
@@ -27434,7 +27487,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27434
27487
|
}
|
|
27435
27488
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
27436
27489
|
const islandFiles = new Set([
|
|
27437
|
-
|
|
27490
|
+
resolvePath(buildInfo.resolvedRegistryPath)
|
|
27438
27491
|
]);
|
|
27439
27492
|
for (const definition of buildInfo.definitions) {
|
|
27440
27493
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -27445,7 +27498,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27445
27498
|
if (islandFiles.size === 0) {
|
|
27446
27499
|
return false;
|
|
27447
27500
|
}
|
|
27448
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
27501
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolvePath(file4)));
|
|
27449
27502
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
27450
27503
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
27451
27504
|
if (!shouldReload) {
|
|
@@ -27480,10 +27533,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27480
27533
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
27481
27534
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
27482
27535
|
if (isSingle) {
|
|
27483
|
-
return
|
|
27536
|
+
return resolvePath(state.resolvedPaths.buildDir, "pages");
|
|
27484
27537
|
}
|
|
27485
27538
|
const dirName = framework === "html" ? basename17(config.htmlDirectory ?? "html") : basename17(config.htmxDirectory ?? "htmx");
|
|
27486
|
-
return
|
|
27539
|
+
return resolvePath(state.resolvedPaths.buildDir, dirName, "pages");
|
|
27487
27540
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
27488
27541
|
try {
|
|
27489
27542
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -27523,7 +27576,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27523
27576
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
27524
27577
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
27525
27578
|
const htmlPageName = basename17(pageFile);
|
|
27526
|
-
const builtHtmlPagePath =
|
|
27579
|
+
const builtHtmlPagePath = resolvePath(outputHtmlPages, htmlPageName);
|
|
27527
27580
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
27528
27581
|
});
|
|
27529
27582
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -27588,7 +27641,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27588
27641
|
const cssKey = `${pascalName}CSS`;
|
|
27589
27642
|
const cssUrl = manifest[cssKey] || null;
|
|
27590
27643
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
27591
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
27644
|
+
const hmrMeta = vueHmrMetadata2.get(resolvePath(vuePagePath));
|
|
27592
27645
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
27593
27646
|
if (changeType === "style-only") {
|
|
27594
27647
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -27687,7 +27740,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27687
27740
|
handleSvelteCssOnlyUpdate(state, svelteCssFiles, manifest, duration);
|
|
27688
27741
|
}
|
|
27689
27742
|
const surgicallyHandled = state.svelteSurgicallyHandled;
|
|
27690
|
-
pagesToUpdate.filter((sveltePagePath) => !surgicallyHandled?.has(
|
|
27743
|
+
pagesToUpdate.filter((sveltePagePath) => !surgicallyHandled?.has(resolvePath(sveltePagePath))).forEach((sveltePagePath) => {
|
|
27691
27744
|
broadcastSveltePageUpdate(state, sveltePagePath, manifest, duration);
|
|
27692
27745
|
});
|
|
27693
27746
|
}, handleAngularCssOnlyUpdate = (state, angularCssFiles, manifest, duration) => {
|
|
@@ -27777,7 +27830,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27777
27830
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
27778
27831
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
27779
27832
|
const htmxPageName = basename17(htmxPageFile);
|
|
27780
|
-
const builtHtmxPagePath =
|
|
27833
|
+
const builtHtmxPagePath = resolvePath(outputHtmxPages, htmxPageName);
|
|
27781
27834
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
27782
27835
|
});
|
|
27783
27836
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -27886,7 +27939,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27886
27939
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
27887
27940
|
writeFs(destPath, html);
|
|
27888
27941
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
27889
|
-
const destPath =
|
|
27942
|
+
const destPath = resolvePath(outputDir, basename17(sourceFile));
|
|
27890
27943
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
27891
27944
|
const source = await Bun.file(sourceFile).text();
|
|
27892
27945
|
await Bun.write(destPath, source);
|
|
@@ -27972,6 +28025,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27972
28025
|
await fastPath.handler(state, config, files, startTime, onRebuildComplete);
|
|
27973
28026
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
27974
28027
|
});
|
|
28028
|
+
const configPath2 = resolvePath(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
28029
|
+
if (affectedFrameworks.includes("angular") && files.includes(configPath2) && !state.lastUserEditedFiles?.has(configPath2)) {
|
|
28030
|
+
handled.add(configPath2);
|
|
28031
|
+
}
|
|
27975
28032
|
return files.every((f2) => handled.has(f2));
|
|
27976
28033
|
}, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete) => {
|
|
27977
28034
|
state.svelteSurgicallyHandled = undefined;
|
|
@@ -28058,7 +28115,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28058
28115
|
});
|
|
28059
28116
|
if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
|
|
28060
28117
|
try {
|
|
28061
|
-
const outputPath =
|
|
28118
|
+
const outputPath = resolvePath(state.resolvedPaths.buildDir, config.tailwind.output);
|
|
28062
28119
|
const bytes = await Bun.file(outputPath).bytes();
|
|
28063
28120
|
const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
|
|
28064
28121
|
state.assetStore.set(webPath, bytes);
|
|
@@ -28250,7 +28307,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
28250
28307
|
} catch {
|
|
28251
28308
|
return false;
|
|
28252
28309
|
}
|
|
28253
|
-
}, 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 = (file4) => file4.includes("node_modules") || file4.includes("/build/") || file4.includes("/dist/") || file4.includes("/indexes/") ||
|
|
28310
|
+
}, 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 = (file4) => file4.includes("node_modules") || file4.includes("/build/") || file4.includes("/dist/") || file4.includes("/indexes/") || isTestSourcePath(file4), isDepSpecifier = (path) => isBareSpecifier2(path) && !isBuiltin(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file4, transpiler6) => {
|
|
28254
28311
|
const dep = [];
|
|
28255
28312
|
const framework = [];
|
|
28256
28313
|
try {
|
|
@@ -28559,7 +28616,7 @@ __export(exports_devBuild, {
|
|
|
28559
28616
|
});
|
|
28560
28617
|
import { readdir as readdir5 } from "fs/promises";
|
|
28561
28618
|
import { statSync as statSync7 } from "fs";
|
|
28562
|
-
import { resolve as
|
|
28619
|
+
import { resolve as resolve42 } from "path";
|
|
28563
28620
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
28564
28621
|
const configuredDirs = [
|
|
28565
28622
|
config.reactDirectory,
|
|
@@ -28582,7 +28639,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28582
28639
|
return Object.keys(config).length > 0 ? config : null;
|
|
28583
28640
|
}, reloadConfig = async () => {
|
|
28584
28641
|
try {
|
|
28585
|
-
const configPath2 =
|
|
28642
|
+
const configPath2 = resolve42(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
28586
28643
|
const source = await Bun.file(configPath2).text();
|
|
28587
28644
|
return parseDirectoryConfig(source);
|
|
28588
28645
|
} catch {
|
|
@@ -28694,7 +28751,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28694
28751
|
});
|
|
28695
28752
|
}
|
|
28696
28753
|
}, handleCachedReload = async () => {
|
|
28697
|
-
const serverMtime = statSync7(
|
|
28754
|
+
const serverMtime = statSync7(resolve42(Bun.main)).mtimeMs;
|
|
28698
28755
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
28699
28756
|
globalThis.__hmrServerMtime = serverMtime;
|
|
28700
28757
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -28731,8 +28788,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28731
28788
|
return true;
|
|
28732
28789
|
}, resolveAbsoluteVersion2 = async () => {
|
|
28733
28790
|
const candidates = [
|
|
28734
|
-
|
|
28735
|
-
|
|
28791
|
+
resolve42(import.meta.dir, "..", "..", "package.json"),
|
|
28792
|
+
resolve42(import.meta.dir, "..", "package.json")
|
|
28736
28793
|
];
|
|
28737
28794
|
const [candidate, ...remaining] = candidates;
|
|
28738
28795
|
if (!candidate) {
|
|
@@ -28758,7 +28815,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28758
28815
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
28759
28816
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
28760
28817
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
28761
|
-
const bytes = await Bun.file(
|
|
28818
|
+
const bytes = await Bun.file(resolve42(vendorDir, entry)).bytes();
|
|
28762
28819
|
assetStore.set(webPath, bytes);
|
|
28763
28820
|
}));
|
|
28764
28821
|
}, devBuild = async (config) => {
|
|
@@ -28894,11 +28951,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28894
28951
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
28895
28952
|
recordStep("populate asset store", stepStartedAt);
|
|
28896
28953
|
stepStartedAt = performance.now();
|
|
28897
|
-
const reactVendorDir =
|
|
28898
|
-
const angularVendorDir =
|
|
28899
|
-
const svelteVendorDir =
|
|
28900
|
-
const vueVendorDir =
|
|
28901
|
-
const depVendorDir =
|
|
28954
|
+
const reactVendorDir = resolve42(state.resolvedPaths.buildDir, "react", "vendor");
|
|
28955
|
+
const angularVendorDir = resolve42(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
28956
|
+
const svelteVendorDir = resolve42(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
28957
|
+
const vueVendorDir = resolve42(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
28958
|
+
const depVendorDir = resolve42(state.resolvedPaths.buildDir, "vendor");
|
|
28902
28959
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
28903
28960
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
28904
28961
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -28979,7 +29036,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
28979
29036
|
manifest
|
|
28980
29037
|
};
|
|
28981
29038
|
globalThis.__hmrDevResult = result;
|
|
28982
|
-
globalThis.__hmrServerMtime = statSync7(
|
|
29039
|
+
globalThis.__hmrServerMtime = statSync7(resolve42(Bun.main)).mtimeMs;
|
|
28983
29040
|
return result;
|
|
28984
29041
|
};
|
|
28985
29042
|
var init_devBuild = __esm(() => {
|
|
@@ -29008,9 +29065,6 @@ var init_devBuild = __esm(() => {
|
|
|
29008
29065
|
];
|
|
29009
29066
|
});
|
|
29010
29067
|
|
|
29011
|
-
// types/websocket.ts
|
|
29012
|
-
var WS_READY_STATE_OPEN = 1;
|
|
29013
|
-
|
|
29014
29068
|
// src/build.ts
|
|
29015
29069
|
init_build();
|
|
29016
29070
|
init_devBuild();
|
|
@@ -29019,5 +29073,5 @@ export {
|
|
|
29019
29073
|
build
|
|
29020
29074
|
};
|
|
29021
29075
|
|
|
29022
|
-
//# debugId=
|
|
29076
|
+
//# debugId=6FEE7C1D5ACA5E3664756E2164756E21
|
|
29023
29077
|
//# sourceMappingURL=build.js.map
|