@absolutejs/absolute 0.20.0-beta.179 → 0.20.0-beta.180
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/CHANGELOG.md +23 -0
- package/changelog.json +45 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +21 -6
- package/dist/angular/index.js.map +6 -6
- package/dist/angular/server.js +21 -6
- package/dist/angular/server.js.map +6 -6
- package/dist/build.js +5357 -4945
- package/dist/build.js.map +27 -24
- package/dist/cli/build-fntmf42w.js +495 -0
- package/dist/cli/{buildDepVendor-qvsh6dsj.js → buildDepVendor-qnwfct22.js} +5 -3
- package/dist/cli/buildReactServerComponents-fq6mw10d.js +13 -0
- package/dist/cli/{compile-p5yv6ecp.js → compile-54rb8szn.js} +94 -125
- package/dist/cli/config/server.js +10 -5
- package/dist/cli/{dev-2hbcsvkp.js → dev-6s6g5tnk.js} +13 -14
- package/dist/cli/{expoProject-1qtw97js.js → expoProject-acgfaj3f.js} +2 -1
- package/dist/cli/generatedDir-239r7csr.js +9 -0
- package/dist/cli/{index-cksezef8.js → index-0gd30trc.js} +105 -851
- package/dist/cli/index-2wvysvjc.js +40 -0
- package/dist/cli/index-42xjh6gg.js +282 -0
- package/dist/cli/{index-qw98g1p6.js → index-47e8fwha.js} +4 -1
- package/dist/cli/index-65kqn88a.js +8 -0
- package/dist/cli/{index-2bxfhs32.js → index-6f448d7m.js} +0 -26
- package/dist/cli/index-972xxwgj.js +16 -0
- package/dist/cli/index-aqe25w4h.js +39 -0
- package/dist/cli/index-assqancr.js +51 -0
- package/dist/cli/{index-2shf4aya.js → index-c8rcfe5a.js} +4 -6
- package/dist/cli/index-cba1cemz.js +8 -0
- package/dist/cli/{index-3ff5ztt3.js → index-djkrb7pc.js} +1 -7
- package/dist/cli/index-dkfwkpc8.js +138 -0
- package/dist/cli/{index-92g14j47.js → index-dw44xa4x.js} +2 -1
- package/dist/cli/index-evsnq0n2.js +17 -0
- package/dist/cli/index-fxwf3n2v.js +224 -0
- package/dist/cli/{index-zyd80s3h.js → index-js2hksgv.js} +21 -295
- package/dist/cli/{index-bp60baze.js → index-jyap0bhv.js} +1 -1
- package/dist/cli/{index-9dzdbbfc.js → index-kx2d067c.js} +8 -6
- package/dist/cli/index-pb31zan6.js +9 -0
- package/dist/cli/index-sq0478b0.js +281 -0
- package/dist/cli/index-va274tsf.js +7 -0
- package/dist/cli/{index-yd672jyq.js → index-w6xsk8cv.js} +4 -1
- package/dist/cli/index-w79snsxv.js +461 -0
- package/dist/cli/index-x1vvn549.js +835 -0
- package/dist/cli/index-xf9sfr8a.js +243 -0
- package/dist/cli/index-ycqdxy55.js +754 -0
- package/dist/cli/index-z74cqxz0.js +131 -0
- package/dist/cli/index.js +10 -9
- package/dist/cli/{islands-6zgb7501.js → islands-17tfx8jf.js} +6 -17
- package/dist/cli/{ls-0hfx323m.js → ls-0wr74w0b.js} +10 -58
- package/dist/cli/{mobile-93vaawcz.js → mobile-hpqpy61f.js} +11 -8
- package/dist/cli/{prerender-010z771p.js → prerender-w65xp6h8.js} +2 -1
- package/dist/cli/{rewriteImports-z6629aww.js → rewriteImports-np2d2kvc.js} +4 -11
- package/dist/cli/rewriteImportsPlugin-c6hcb3x6.js +12 -0
- package/dist/cli/{start-asxb79rc.js → start-mbn2zgs2.js} +6 -4
- package/dist/cli/staticAnalyzeSpaRoutes-2nev05m1.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-6vgzp0rs.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-f85q9dqk.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-yakmg22g.js +7 -0
- package/dist/cli/{typecheck-m2j4tkdk.js → typecheck-488txsfc.js} +92 -18
- package/dist/cli/vueCompiler-8bzdmf08.js +7 -0
- package/dist/client/chunks/{react-khr6ewhr.js → react-g8r290b8.js} +37 -2
- package/dist/client/chunks/react-g8r290b8.js.map +10 -0
- package/dist/client/chunks/vue-zcpmka32.js +85 -0
- package/dist/client/chunks/vue-zcpmka32.js.map +10 -0
- package/dist/client/index.js +58 -10
- package/dist/client/index.js.map +4 -4
- package/dist/dev/client/handlers/vue.ts +116 -0
- package/dist/index.js +2472 -2058
- package/dist/index.js.map +26 -23
- package/dist/islands/browser.js +2 -2
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +2 -2
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +2 -2
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +42 -11
- package/dist/react/index.js.map +10 -10
- package/dist/react/server.js +42 -11
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/ssrRender.d.ts +2 -2
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/build/generateManifest.d.ts +15 -0
- package/dist/src/build/manifestKeys.d.ts +22 -0
- package/dist/src/cli/add/dependencies.d.ts +1 -1
- package/dist/src/cli/scripts/typecheck.d.ts +11 -0
- package/dist/src/client/hydrators/react.d.ts +10 -0
- package/dist/src/client/hydrators/vue.d.ts +13 -0
- package/dist/src/client/islandRuntime.d.ts +1 -1
- package/dist/src/core/islandManifest.d.ts +4 -0
- package/dist/src/core/islandPageContext.d.ts +8 -2
- package/dist/src/core/lookup.d.ts +16 -1
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/manifestKeysRefresher.d.ts +6 -0
- package/dist/src/dev/spaRouteRefresh.d.ts +13 -0
- package/dist/src/mobile/androidConformance.d.ts +1 -1
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +5 -0
- package/dist/src/utils/spaRouteManifest.d.ts +1 -0
- package/dist/src/vue/components/Image.d.ts +4 -4
- package/dist/src/vue/components/StreamSlot.d.ts +1 -1
- package/dist/src/vue/components/SuspenseSlot.d.ts +2 -2
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +4 -0
- package/dist/svelte/browser.js +2 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +25 -9
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/server.js +25 -9
- package/dist/svelte/server.js.map +8 -8
- package/dist/types/globals.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/island.d.ts +1 -1
- package/dist/types/manifest.d.ts +25 -0
- package/dist/vue/browser.js +2 -2
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +21 -6
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +21 -6
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
- package/dist/client/chunks/react-khr6ewhr.js.map +0 -10
- package/dist/client/chunks/vue-db6ppn1f.js +0 -32
- package/dist/client/chunks/vue-db6ppn1f.js.map +0 -10
|
@@ -10,14 +10,12 @@ import {
|
|
|
10
10
|
resolveProjectName
|
|
11
11
|
} from "./index-71gchbzt.js";
|
|
12
12
|
import {
|
|
13
|
-
createIslandRegistryDefinitionPlugin,
|
|
14
|
-
createBunStringRawUnicodePlugin,
|
|
15
13
|
finalizeAbsoluteMobileCompatibilityBuild,
|
|
16
14
|
createAbsoluteMobileRouteMetadataPlugin,
|
|
17
15
|
createElysiaOpenApiTypeboxPlugin,
|
|
18
16
|
createOptionalPeerPlugin,
|
|
19
17
|
resolveServerBundleExternals
|
|
20
|
-
} from "./index-
|
|
18
|
+
} from "./index-js2hksgv.js";
|
|
21
19
|
import {
|
|
22
20
|
normalizeAbsoluteMobileConfig2
|
|
23
21
|
} from "./index-t7yf3vxs.js";
|
|
@@ -27,9 +25,13 @@ import {
|
|
|
27
25
|
import {
|
|
28
26
|
loadConfig
|
|
29
27
|
} from "./index-wk0pyxrg.js";
|
|
28
|
+
import {
|
|
29
|
+
createIslandRegistryDefinitionPlugin,
|
|
30
|
+
createBunStringRawUnicodePlugin
|
|
31
|
+
} from "./index-42xjh6gg.js";
|
|
30
32
|
import {
|
|
31
33
|
loadIslandRegistryBuildInfo
|
|
32
|
-
} from "./index-
|
|
34
|
+
} from "./index-w6xsk8cv.js";
|
|
33
35
|
import {
|
|
34
36
|
stripStringsAndComments
|
|
35
37
|
} from "./index-prs14ys9.js";
|
|
@@ -184,7 +186,7 @@ var jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
|
184
186
|
var prerenderStaticPages = async (outputPath, prerenderPort, resolvedOutdir, staticConfig, absoluteVersion, configPath) => {
|
|
185
187
|
const prerenderStart = performance.now();
|
|
186
188
|
process.stdout.write(cliTag("\x1B[36m", "Pre-rendering static pages"));
|
|
187
|
-
const { prerenderWithServer } = await import("./prerender-
|
|
189
|
+
const { prerenderWithServer } = await import("./prerender-w65xp6h8.js");
|
|
188
190
|
try {
|
|
189
191
|
killStaleProcesses(prerenderPort);
|
|
190
192
|
const result = await prerenderWithServer(outputPath, prerenderPort, resolvedOutdir, staticConfig, {
|
|
@@ -495,7 +497,7 @@ var start2 = async (serverEntry, outdir, configPath, options = {}) => {
|
|
|
495
497
|
angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
496
498
|
}
|
|
497
499
|
if (Object.keys(angularServerVendorPaths).length > 0) {
|
|
498
|
-
const { rewriteImports } = await import("./rewriteImports-
|
|
500
|
+
const { rewriteImports } = await import("./rewriteImports-np2d2kvc.js");
|
|
499
501
|
await rewriteImports([outputPath], angularServerVendorPaths);
|
|
500
502
|
}
|
|
501
503
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/utils/generatedDir.ts
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
var GENERATED_DIR_NAME = "generated";
|
|
5
|
+
var ABSOLUTE_CACHE_DIR_NAME = ".absolutejs";
|
|
6
|
+
var getFrameworkGeneratedDir2 = (framework, projectRoot = process.cwd()) => join(getGeneratedRoot2(projectRoot), framework);
|
|
7
|
+
var getGeneratedRoot2 = (projectRoot = process.cwd()) => join(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME);
|
|
8
|
+
|
|
9
|
+
export { getFrameworkGeneratedDir2, getGeneratedRoot2 };
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
lazyTypescript
|
|
4
|
+
} from "./index-4j1twret.js";
|
|
5
|
+
|
|
6
|
+
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
7
|
+
import { existsSync, promises as fs } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
var DYNAMIC_SEGMENT_PATTERN = /^[:*]/;
|
|
10
|
+
var pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**");
|
|
11
|
+
var readStringLiteral = (expression) => {
|
|
12
|
+
if (lazyTypescript.isStringLiteral(expression) || lazyTypescript.isNoSubstitutionTemplateLiteral(expression)) {
|
|
13
|
+
return expression.text;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
var readPropertyKey = (property) => {
|
|
18
|
+
if (lazyTypescript.isPropertyAssignment(property)) {
|
|
19
|
+
const { name } = property;
|
|
20
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name))
|
|
21
|
+
return name.text;
|
|
22
|
+
}
|
|
23
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
24
|
+
return property.name.text;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
var importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
29
|
+
for (const statement of sourceFile.statements) {
|
|
30
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
31
|
+
continue;
|
|
32
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
33
|
+
continue;
|
|
34
|
+
if (statement.moduleSpecifier.text !== moduleSpecifier)
|
|
35
|
+
continue;
|
|
36
|
+
const named = statement.importClause?.namedBindings;
|
|
37
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
38
|
+
continue;
|
|
39
|
+
for (const element of named.elements) {
|
|
40
|
+
if (element.name.text === localName)
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
46
|
+
var findVariableArrayDeclaration = (sourceFile, identifierName) => {
|
|
47
|
+
let found = null;
|
|
48
|
+
const visit = (node) => {
|
|
49
|
+
if (found)
|
|
50
|
+
return;
|
|
51
|
+
if (lazyTypescript.isVariableDeclaration(node) && lazyTypescript.isIdentifier(node.name) && node.name.text === identifierName && node.initializer && lazyTypescript.isArrayLiteralExpression(node.initializer)) {
|
|
52
|
+
found = node.initializer;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
lazyTypescript.forEachChild(node, visit);
|
|
56
|
+
};
|
|
57
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
58
|
+
return found;
|
|
59
|
+
};
|
|
60
|
+
var joinSegments = (parent, child) => {
|
|
61
|
+
if (!child)
|
|
62
|
+
return parent;
|
|
63
|
+
if (!parent)
|
|
64
|
+
return child;
|
|
65
|
+
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
66
|
+
};
|
|
67
|
+
var extractRouteEntries = (routeArray, parentPath, routes) => {
|
|
68
|
+
for (const element of routeArray.elements) {
|
|
69
|
+
if (!lazyTypescript.isObjectLiteralExpression(element))
|
|
70
|
+
continue;
|
|
71
|
+
let pathSegment = null;
|
|
72
|
+
let redirected = false;
|
|
73
|
+
let sitemapExcluded = false;
|
|
74
|
+
let alias = null;
|
|
75
|
+
let childrenLiteral = null;
|
|
76
|
+
for (const property of element.properties) {
|
|
77
|
+
const key = readPropertyKey(property);
|
|
78
|
+
if (!key)
|
|
79
|
+
continue;
|
|
80
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
81
|
+
continue;
|
|
82
|
+
if (key === "path") {
|
|
83
|
+
pathSegment = readStringLiteral(property.initializer);
|
|
84
|
+
} else if (key === "alias") {
|
|
85
|
+
alias = readStringLiteral(property.initializer);
|
|
86
|
+
} else if (key === "redirect") {
|
|
87
|
+
redirected = true;
|
|
88
|
+
} else if (key === "children" && lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
89
|
+
childrenLiteral = property.initializer;
|
|
90
|
+
} else if (key === "meta" && lazyTypescript.isObjectLiteralExpression(property.initializer)) {
|
|
91
|
+
for (const metaProp of property.initializer.properties) {
|
|
92
|
+
const metaKey = readPropertyKey(metaProp);
|
|
93
|
+
if (metaKey !== "sitemap")
|
|
94
|
+
continue;
|
|
95
|
+
if (!lazyTypescript.isPropertyAssignment(metaProp))
|
|
96
|
+
continue;
|
|
97
|
+
const value = readStringLiteral(metaProp.initializer);
|
|
98
|
+
if (value === "exclude")
|
|
99
|
+
sitemapExcluded = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (pathSegment === null)
|
|
104
|
+
continue;
|
|
105
|
+
const joined = joinSegments(parentPath, pathSegment);
|
|
106
|
+
if (childrenLiteral) {
|
|
107
|
+
extractRouteEntries(childrenLiteral, joined, routes);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (joined === "")
|
|
111
|
+
continue;
|
|
112
|
+
routes.push({
|
|
113
|
+
dynamic: pathHasDynamic(joined),
|
|
114
|
+
path: joined,
|
|
115
|
+
redirected,
|
|
116
|
+
sitemapExcluded
|
|
117
|
+
});
|
|
118
|
+
if (alias) {
|
|
119
|
+
routes.push({
|
|
120
|
+
dynamic: pathHasDynamic(alias),
|
|
121
|
+
path: alias,
|
|
122
|
+
redirected: false,
|
|
123
|
+
sitemapExcluded: true
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var findDefineRoutesArray = (sourceFile) => {
|
|
129
|
+
let found = null;
|
|
130
|
+
const visit = (node) => {
|
|
131
|
+
if (found)
|
|
132
|
+
return;
|
|
133
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "defineRoutes") {
|
|
134
|
+
const [routesArgument] = node.arguments;
|
|
135
|
+
if (!routesArgument || !lazyTypescript.isArrayLiteralExpression(routesArgument))
|
|
136
|
+
return;
|
|
137
|
+
found = routesArgument;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
lazyTypescript.forEachChild(node, visit);
|
|
141
|
+
};
|
|
142
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
143
|
+
return found;
|
|
144
|
+
};
|
|
145
|
+
var inferBaseHref = (routes) => {
|
|
146
|
+
const firstSegments = routes.map((route) => route.path.split("/").filter(Boolean)[0]).filter((segment) => Boolean(segment));
|
|
147
|
+
const [first] = firstSegments;
|
|
148
|
+
if (!first || firstSegments.some((segment) => segment !== first))
|
|
149
|
+
return "/";
|
|
150
|
+
return `/${first}/`;
|
|
151
|
+
};
|
|
152
|
+
var findCreateRouterCall = (sourceFile) => {
|
|
153
|
+
const result = { found: null };
|
|
154
|
+
const visit = (node) => {
|
|
155
|
+
if (result.found)
|
|
156
|
+
return;
|
|
157
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "createRouter") {
|
|
158
|
+
result.found = node;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
lazyTypescript.forEachChild(node, visit);
|
|
162
|
+
};
|
|
163
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
164
|
+
return result.found;
|
|
165
|
+
};
|
|
166
|
+
var findCreateWebHistoryBase = (sourceFile) => {
|
|
167
|
+
let found = null;
|
|
168
|
+
const visit = (node) => {
|
|
169
|
+
if (found)
|
|
170
|
+
return;
|
|
171
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && (node.expression.text === "createWebHistory" || node.expression.text === "createWebHashHistory")) {
|
|
172
|
+
const [baseArg] = node.arguments;
|
|
173
|
+
if (baseArg) {
|
|
174
|
+
const text = readStringLiteral(baseArg);
|
|
175
|
+
if (text !== null) {
|
|
176
|
+
found = text;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
found = "/";
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
lazyTypescript.forEachChild(node, visit);
|
|
185
|
+
};
|
|
186
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
187
|
+
return found;
|
|
188
|
+
};
|
|
189
|
+
var readRoutesFromCreateRouterOptions = (sourceFile, optionsExpr) => {
|
|
190
|
+
if (!lazyTypescript.isObjectLiteralExpression(optionsExpr))
|
|
191
|
+
return null;
|
|
192
|
+
for (const property of optionsExpr.properties) {
|
|
193
|
+
const key = readPropertyKey(property);
|
|
194
|
+
if (key !== "routes")
|
|
195
|
+
continue;
|
|
196
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
197
|
+
return findVariableArrayDeclaration(sourceFile, property.name.text);
|
|
198
|
+
}
|
|
199
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
200
|
+
continue;
|
|
201
|
+
if (lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
202
|
+
return property.initializer;
|
|
203
|
+
}
|
|
204
|
+
if (lazyTypescript.isIdentifier(property.initializer)) {
|
|
205
|
+
return findVariableArrayDeclaration(sourceFile, property.initializer.text);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return null;
|
|
209
|
+
};
|
|
210
|
+
var extractScriptBlocksFromVueSfc = (source) => [...source.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script>/gi)].map((match) => match[1] ?? "");
|
|
211
|
+
var analyzeVueScriptSource = (filePath, analysisSource) => {
|
|
212
|
+
if (!analysisSource.includes("createRouter") && !analysisSource.includes("defineRoutes"))
|
|
213
|
+
return null;
|
|
214
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, analysisSource, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
215
|
+
const defineRoutesArray = findDefineRoutesArray(sourceFile);
|
|
216
|
+
const call = importsSymbolFrom(sourceFile, "createRouter", "vue-router") ? findCreateRouterCall(sourceFile) : null;
|
|
217
|
+
const [optionsArg] = call?.arguments ?? [];
|
|
218
|
+
const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(sourceFile, optionsArg) : null);
|
|
219
|
+
if (!routesArray)
|
|
220
|
+
return null;
|
|
221
|
+
const routes = [];
|
|
222
|
+
extractRouteEntries(routesArray, "", routes);
|
|
223
|
+
const base = findCreateWebHistoryBase(sourceFile) ?? inferBaseHref(routes);
|
|
224
|
+
const baseHref = base.endsWith("/") ? base : `${base}/`;
|
|
225
|
+
const host = { baseHref, routes, sourceFile: filePath };
|
|
226
|
+
return host;
|
|
227
|
+
};
|
|
228
|
+
var analyzeVueSpaRouteFile = async (filePath) => {
|
|
229
|
+
let source;
|
|
230
|
+
try {
|
|
231
|
+
source = await fs.readFile(filePath, "utf-8");
|
|
232
|
+
} catch {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
const scripts = filePath.endsWith(".vue") ? extractScriptBlocksFromVueSfc(source) : [source];
|
|
236
|
+
for (const script of scripts) {
|
|
237
|
+
const host = analyzeVueScriptSource(filePath, script);
|
|
238
|
+
if (host)
|
|
239
|
+
return host;
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
var walkSourceFiles = async (dir, files) => {
|
|
244
|
+
let items;
|
|
245
|
+
try {
|
|
246
|
+
items = await fs.readdir(dir, { withFileTypes: true });
|
|
247
|
+
} catch {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const directories = [];
|
|
251
|
+
for (const item of items) {
|
|
252
|
+
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
253
|
+
continue;
|
|
254
|
+
const full = join(dir, item.name);
|
|
255
|
+
if (item.isDirectory()) {
|
|
256
|
+
directories.push(full);
|
|
257
|
+
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
258
|
+
files.push(full);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
await Promise.all(directories.map((directory) => walkSourceFiles(directory, files)));
|
|
262
|
+
};
|
|
263
|
+
var analyzeVueSpaRoutes2 = async (vueDirectory) => {
|
|
264
|
+
if (!existsSync(vueDirectory))
|
|
265
|
+
return [];
|
|
266
|
+
const files = [];
|
|
267
|
+
await walkSourceFiles(vueDirectory, files);
|
|
268
|
+
const hosts = [];
|
|
269
|
+
await Promise.all(files.map(async (file) => {
|
|
270
|
+
try {
|
|
271
|
+
const host = await analyzeVueSpaRouteFile(file);
|
|
272
|
+
if (host)
|
|
273
|
+
hosts.push(host);
|
|
274
|
+
} catch (err) {
|
|
275
|
+
console.warn(`[sitemap] Vue SPA analysis failed for ${file}:`, err);
|
|
276
|
+
}
|
|
277
|
+
}));
|
|
278
|
+
return hosts;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export { analyzeVueSpaRoutes2 };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/utils/startupTimings.ts
|
|
3
|
+
var isTruthyFlag = (value) => value === "1" || value === "true";
|
|
4
|
+
var devProfileEnabled = isTruthyFlag(process.env.ABSOLUTE_DEV_PROFILE);
|
|
5
|
+
var startupTimingsEnabled = devProfileEnabled || isTruthyFlag(process.env.ABSOLUTE_STARTUP_TIMINGS);
|
|
6
|
+
|
|
7
|
+
export { devProfileEnabled };
|
|
@@ -4,8 +4,11 @@ import {
|
|
|
4
4
|
} from "./index-4j1twret.js";
|
|
5
5
|
|
|
6
6
|
// src/core/islandManifest.ts
|
|
7
|
+
var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap";
|
|
7
8
|
var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1);
|
|
8
9
|
var getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
10
|
+
var ISLAND_STYLE_PREFIX = "IslandStyle";
|
|
11
|
+
var getIslandStyleManifestKey = (framework, component) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;
|
|
9
12
|
|
|
10
13
|
// src/build/islandEntries.ts
|
|
11
14
|
import { mkdirSync, rmSync, statSync, writeFileSync } from "fs";
|
|
@@ -251,4 +254,4 @@ var loadIslandRegistryBuildInfo = async (registryPath) => {
|
|
|
251
254
|
};
|
|
252
255
|
};
|
|
253
256
|
|
|
254
|
-
export { getIslandManifestKey, resolveIslandSourceFile, loadIslandRegistryBuildInfo };
|
|
257
|
+
export { ISLAND_BOOTSTRAP_MANIFEST_KEY, getIslandManifestKey, getIslandStyleManifestKey, resolveIslandSourceFile, loadIslandRegistryBuildInfo };
|