@absolutejs/absolute 0.20.0-beta.180 → 0.20.0-beta.182
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 +41 -0
- package/changelog.json +70 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/constants.js +4 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +349 -48
- package/dist/angular/index.js.map +11 -11
- package/dist/angular/server.js +349 -48
- package/dist/angular/server.js.map +11 -11
- package/dist/build.js +605 -114
- package/dist/build.js.map +20 -20
- package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
- package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
- package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
- package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
- package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
- package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
- package/dist/cli/{build-fntmf42w.js → build-p3qra1nj.js} +65 -7
- package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
- package/dist/cli/{buildReactServerComponents-fq6mw10d.js → buildReactServerComponents-vc9hh2rd.js} +5 -5
- package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
- package/dist/cli/config/server.js +18 -17
- package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
- package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
- package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
- package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
- package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
- package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
- package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
- package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
- package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
- package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
- package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
- package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
- package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
- package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
- package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
- package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
- package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
- package/dist/cli/{index-w79snsxv.js → index-7zwzyymv.js} +2 -2
- package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
- package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
- package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
- package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
- package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
- package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
- package/dist/cli/{index-xf9sfr8a.js → index-fgqh48qr.js} +63 -1
- package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
- package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
- package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
- package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
- package/dist/cli/{index-x1vvn549.js → index-mmm6d3k5.js} +3 -3
- package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
- package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
- package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
- package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
- package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
- package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
- package/dist/cli/index.js +32 -32
- package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
- package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
- package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
- package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
- package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
- package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
- package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
- package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
- package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
- package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
- package/dist/cli/prerender-26pzynh4.js +13 -0
- package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
- package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
- package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
- package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
- package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
- package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
- package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
- package/dist/cli/{staticAnalyzeSpaRoutes-2nev05m1.js → staticAnalyzeSpaRoutes-rcc1d3az.js} +3 -1
- package/dist/cli/{typecheck-488txsfc.js → typecheck-yjme4fv1.js} +71 -35
- package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
- package/dist/index.js +620 -126
- package/dist/index.js.map +22 -22
- package/dist/islands/index.js +312 -23
- package/dist/islands/index.js.map +5 -5
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/browser.js +18 -1
- package/dist/react/browser.js.map +6 -4
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/index.js +366 -61
- package/dist/react/index.js.map +14 -13
- package/dist/react/server.js +47 -35
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/components/constants.d.ts +1 -0
- package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +9 -0
- package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
- package/dist/src/cli/scripts/typecheck.d.ts +7 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/core/prerender.d.ts +10 -0
- package/dist/src/dev/spaRouteRefresh.d.ts +12 -5
- package/dist/src/react/browser.d.ts +1 -0
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
- package/dist/src/utils/pageCspNonce.d.ts +14 -0
- package/dist/src/utils/spaRouteManifest.d.ts +2 -0
- package/dist/svelte/components/Image.svelte +1 -1
- package/dist/svelte/components/Island.svelte +1 -1
- package/dist/svelte/index.js +368 -68
- package/dist/svelte/index.js.map +11 -11
- package/dist/svelte/router/Router.svelte.d.ts +31 -1
- package/dist/svelte/server.js +359 -59
- package/dist/svelte/server.js.map +11 -11
- package/dist/types/manifest.d.ts +3 -2
- package/dist/types/svelte.d.ts +3 -0
- package/dist/vue/components/Image.js +2 -2
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +2 -2
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +360 -60
- package/dist/vue/index.js.map +11 -11
- package/dist/vue/server.js +50 -39
- package/dist/vue/server.js.map +9 -9
- package/package.json +4 -1
- package/dist/cli/prerender-w65xp6h8.js +0 -11
- /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
resolveProject,
|
|
7
7
|
selectFramework,
|
|
8
8
|
toModuleSpecifier
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-wpgsermq.js";
|
|
10
|
+
import"./index-fm9x6sjs.js";
|
|
11
11
|
import {
|
|
12
12
|
wirePluginUse
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-c6j2727a.js";
|
|
14
14
|
import {
|
|
15
15
|
colors
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-3pz5sjaz.js";
|
|
17
17
|
import {
|
|
18
18
|
isValidName,
|
|
19
19
|
toCamelCase,
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
toTitleCase,
|
|
23
23
|
emptyOutcome,
|
|
24
24
|
generatePage
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
25
|
+
} from "./index-eh786rj4.js";
|
|
26
|
+
import"./index-hker5fs4.js";
|
|
27
|
+
import"./index-yhkg5by0.js";
|
|
28
|
+
import"./index-akseq9ps.js";
|
|
29
29
|
|
|
30
30
|
// src/cli/scripts/generate.ts
|
|
31
31
|
import { relative } from "path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./index-
|
|
2
|
+
import"./index-fm9x6sjs.js";
|
|
3
3
|
import {
|
|
4
4
|
colors,
|
|
5
5
|
padLine
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3pz5sjaz.js";
|
|
7
7
|
import {
|
|
8
8
|
formatBytes
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-1bszxtdj.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/heapDiff.ts
|
|
12
12
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -3,11 +3,11 @@ import"./index-wk0pyxrg.js";
|
|
|
3
3
|
import"./index-4j1twret.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveProject
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
6
|
+
} from "./index-wpgsermq.js";
|
|
7
|
+
import"./index-fm9x6sjs.js";
|
|
8
8
|
import {
|
|
9
9
|
colors
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-3pz5sjaz.js";
|
|
11
11
|
import {
|
|
12
12
|
VENDORED_HTMX_VERSION,
|
|
13
13
|
detectHtmxVersion,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
installedHtmxVersion,
|
|
16
16
|
writeHtmx
|
|
17
17
|
} from "./index-n6faa3m3.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
18
|
+
import"./index-hker5fs4.js";
|
|
19
|
+
import"./index-yhkg5by0.js";
|
|
20
|
+
import"./index-akseq9ps.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/scripts/htmx.ts
|
|
23
23
|
var write = (text) => process.stdout.write(`${text}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_PORT,
|
|
4
4
|
MAX_ERROR_LENGTH,
|
|
5
5
|
MILLISECONDS_IN_A_SECOND
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-fm9x6sjs.js";
|
|
7
7
|
import {
|
|
8
8
|
deregisterInstance,
|
|
9
9
|
registerInstance,
|
|
@@ -47,13 +47,13 @@ import {
|
|
|
47
47
|
readDbScripts,
|
|
48
48
|
startDatabase,
|
|
49
49
|
stopDatabase
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-hker5fs4.js";
|
|
51
51
|
import {
|
|
52
52
|
formatTimestamp2
|
|
53
|
-
} from "./index-
|
|
53
|
+
} from "./index-yhkg5by0.js";
|
|
54
54
|
import {
|
|
55
55
|
getDurationString
|
|
56
|
-
} from "./index-
|
|
56
|
+
} from "./index-akseq9ps.js";
|
|
57
57
|
|
|
58
58
|
// src/cli/scripts/start.ts
|
|
59
59
|
var {env } = globalThis.Bun;
|
|
@@ -186,7 +186,7 @@ var jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
|
186
186
|
var prerenderStaticPages = async (outputPath, prerenderPort, resolvedOutdir, staticConfig, absoluteVersion, configPath) => {
|
|
187
187
|
const prerenderStart = performance.now();
|
|
188
188
|
process.stdout.write(cliTag("\x1B[36m", "Pre-rendering static pages"));
|
|
189
|
-
const { prerenderWithServer } = await import("./prerender-
|
|
189
|
+
const { formatPrerenderFailure, prerenderWithServer } = await import("./prerender-26pzynh4.js");
|
|
190
190
|
try {
|
|
191
191
|
killStaleProcesses(prerenderPort);
|
|
192
192
|
const result = await prerenderWithServer(outputPath, prerenderPort, resolvedOutdir, staticConfig, {
|
|
@@ -199,6 +199,9 @@ var prerenderStaticPages = async (outputPath, prerenderPort, resolvedOutdir, sta
|
|
|
199
199
|
});
|
|
200
200
|
const prerenderDuration = getDurationString(performance.now() - prerenderStart);
|
|
201
201
|
console.log(` \x1B[2m(${result.routes.size} pages, ${prerenderDuration})\x1B[0m`);
|
|
202
|
+
for (const failure of result.failures) {
|
|
203
|
+
console.warn(cliTag("\x1B[33m", formatPrerenderFailure(failure)));
|
|
204
|
+
}
|
|
202
205
|
} catch (err) {
|
|
203
206
|
console.error(cliTag("\x1B[33m", "Pre-rendering failed, pages will use SSR."));
|
|
204
207
|
console.error(err);
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
colors,
|
|
4
4
|
padLine,
|
|
5
5
|
truncateText
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3pz5sjaz.js";
|
|
7
7
|
import {
|
|
8
8
|
discoverInstances,
|
|
9
9
|
enrichInstances
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-eydgkr7w.js";
|
|
11
11
|
import {
|
|
12
12
|
formatBytes
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-1bszxtdj.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/inspectData.ts
|
|
16
16
|
var SLOW_MS = 100;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LIST_TUI_COLUMN_GAP
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fm9x6sjs.js";
|
|
5
5
|
import {
|
|
6
6
|
colors,
|
|
7
7
|
padLine
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-3pz5sjaz.js";
|
|
9
9
|
|
|
10
10
|
// src/cli/scripts/env.ts
|
|
11
11
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -98,28 +98,32 @@ var crawlRoutes = async (baseUrl) => {
|
|
|
98
98
|
await crawlNextRoute();
|
|
99
99
|
return routes;
|
|
100
100
|
};
|
|
101
|
+
var describeError = (error) => error instanceof Error ? error.message : String(error);
|
|
102
|
+
var formatPrerenderFailure2 = ({ reason, route }) => `Could not pre-render ${route}: ${reason}. It renders on each request instead.`;
|
|
101
103
|
var prerenderRoute = async (baseUrl, route, prerenderDir, result, log) => {
|
|
102
104
|
const res = await fetchWithTimeout(`${baseUrl}${route}`, {
|
|
103
105
|
headers: { [PARTIAL_SHELL_HEADER]: "1" },
|
|
104
106
|
redirect: "manual"
|
|
105
|
-
}).catch(() =>
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
return;
|
|
107
|
+
}).catch((error) => describeError(error));
|
|
108
|
+
if (typeof res === "string") {
|
|
109
|
+
return `the request failed (${res})`;
|
|
109
110
|
}
|
|
110
111
|
if (!res.ok) {
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
await res.body?.cancel().catch(() => {
|
|
113
|
+
return;
|
|
114
|
+
});
|
|
115
|
+
return `the route responded with HTTP ${res.status}`;
|
|
113
116
|
}
|
|
114
117
|
const contentType = res.headers.get("content-type") ?? "";
|
|
115
118
|
if (!contentType.includes("text/html")) {
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
await res.body?.cancel().catch(() => {
|
|
120
|
+
return;
|
|
121
|
+
});
|
|
122
|
+
return `the response is not HTML (content-type: ${contentType || "none"})`;
|
|
118
123
|
}
|
|
119
124
|
const html = await res.text();
|
|
120
125
|
if (!isCompleteHtml(html)) {
|
|
121
|
-
|
|
122
|
-
return;
|
|
126
|
+
return "the rendered HTML document is incomplete (it ends without </html>)";
|
|
123
127
|
}
|
|
124
128
|
const fileName = routeToFilename(route);
|
|
125
129
|
const filePath = join(prerenderDir, fileName);
|
|
@@ -130,6 +134,15 @@ var prerenderRoute = async (baseUrl, route, prerenderDir, result, log) => {
|
|
|
130
134
|
result.routes.set(route, filePath);
|
|
131
135
|
const partial = holes.length > 0 ? `, partial: ${holes.length} dynamic slot${holes.length === 1 ? "" : "s"}` : "";
|
|
132
136
|
log?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes${partial})`);
|
|
137
|
+
return;
|
|
138
|
+
};
|
|
139
|
+
var recordPrerenderRoute = async (baseUrl, route, prerenderDir, result, log) => {
|
|
140
|
+
const reason = await prerenderRoute(baseUrl, route, prerenderDir, result, log).catch((error) => `rendering it threw (${describeError(error)})`);
|
|
141
|
+
if (reason === undefined)
|
|
142
|
+
return;
|
|
143
|
+
const failure = { reason, route };
|
|
144
|
+
result.failures.push(failure);
|
|
145
|
+
log?.(` ${formatPrerenderFailure2(failure)}`);
|
|
133
146
|
};
|
|
134
147
|
var prerender = async (port, outDir, staticConfig, log) => {
|
|
135
148
|
const prerenderDir = join(outDir, "_prerendered");
|
|
@@ -144,9 +157,10 @@ var prerender = async (port, outDir, staticConfig, log) => {
|
|
|
144
157
|
}
|
|
145
158
|
const result = {
|
|
146
159
|
dir: prerenderDir,
|
|
160
|
+
failures: [],
|
|
147
161
|
routes: new Map
|
|
148
162
|
};
|
|
149
|
-
await routes.reduce((chain, route) => chain.then(() =>
|
|
163
|
+
await routes.reduce((chain, route) => chain.then(() => recordPrerenderRoute(baseUrl, route, prerenderDir, result, log)), Promise.resolve());
|
|
150
164
|
return result;
|
|
151
165
|
};
|
|
152
166
|
var getStartupTimeoutMs = () => {
|
|
@@ -252,4 +266,4 @@ var prerenderWithServer2 = async (serverBundlePath, port, outDir, staticConfig,
|
|
|
252
266
|
return result;
|
|
253
267
|
};
|
|
254
268
|
|
|
255
|
-
export { prerenderWithServer2 };
|
|
269
|
+
export { formatPrerenderFailure2, prerenderWithServer2 };
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
absoluteManagedAndroidSdkRoot2,
|
|
5
5
|
detectAbsoluteMobileHost2,
|
|
6
6
|
inspectAbsoluteMobileToolchain2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-ydaxsftq.js";
|
|
8
8
|
import {
|
|
9
9
|
writeAbsoluteCapacitorConfig
|
|
10
10
|
} from "./index-ypcqx24p.js";
|
|
11
11
|
import {
|
|
12
12
|
getDurationString
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-akseq9ps.js";
|
|
14
14
|
|
|
15
15
|
// src/mobile/androidEmulatorController.ts
|
|
16
16
|
import {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
logWarn
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-zeeep92g.js";
|
|
5
5
|
import {
|
|
6
6
|
REACT_SERVER_CLIENT_MANIFEST_KEY,
|
|
7
7
|
REACT_SERVER_PAGE_MANIFEST_SUFFIX,
|
|
8
8
|
REACT_SERVER_PAYLOAD_GLOBAL,
|
|
9
9
|
REACT_SERVER_RENDERER_MANIFEST_KEY,
|
|
10
10
|
REACT_SERVER_RUNTIME_FILE
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-mmm6d3k5.js";
|
|
12
12
|
import {
|
|
13
13
|
toPascal
|
|
14
14
|
} from "./index-dw44xa4x.js";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
frameworks,
|
|
7
7
|
sharedDirFor,
|
|
8
8
|
toModuleSpecifier
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-wpgsermq.js";
|
|
10
10
|
import {
|
|
11
11
|
findRoutingFile,
|
|
12
12
|
wireRoute
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-c6j2727a.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/generate/naming.ts
|
|
16
16
|
var tokenize = (raw) => raw.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[^a-zA-Z0-9]+/).filter((token) => token.length > 0).map((token) => token.toLowerCase());
|
|
@@ -200,6 +200,51 @@ var analyzeAngularSpaRouteFile = async (filePath) => {
|
|
|
200
200
|
sourceFile: filePath
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
|
+
var unwrapExpression = (expression) => {
|
|
204
|
+
if (lazyTypescript.isAsExpression(expression) || lazyTypescript.isSatisfiesExpression(expression) || lazyTypescript.isParenthesizedExpression(expression))
|
|
205
|
+
return unwrapExpression(expression.expression);
|
|
206
|
+
return expression;
|
|
207
|
+
};
|
|
208
|
+
var findColocatedRoutesArray = (sourceFile) => {
|
|
209
|
+
for (const statement of sourceFile.statements) {
|
|
210
|
+
if (!lazyTypescript.isVariableStatement(statement))
|
|
211
|
+
continue;
|
|
212
|
+
const exported = statement.modifiers?.some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword);
|
|
213
|
+
if (!exported)
|
|
214
|
+
continue;
|
|
215
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
216
|
+
if (!lazyTypescript.isIdentifier(declaration.name))
|
|
217
|
+
continue;
|
|
218
|
+
if (declaration.name.text !== "routes")
|
|
219
|
+
continue;
|
|
220
|
+
if (!declaration.initializer)
|
|
221
|
+
continue;
|
|
222
|
+
const initializer = unwrapExpression(declaration.initializer);
|
|
223
|
+
if (lazyTypescript.isArrayLiteralExpression(initializer))
|
|
224
|
+
return initializer;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
};
|
|
229
|
+
var COLOCATED_ROUTES_EXPORT = /\bexport\s+(?:const|let|var)\s+routes\b/;
|
|
230
|
+
var analyzeAngularColocatedRouteFile = async (filePath) => {
|
|
231
|
+
let source;
|
|
232
|
+
try {
|
|
233
|
+
source = await fs.readFile(filePath, "utf-8");
|
|
234
|
+
} catch {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
if (!COLOCATED_ROUTES_EXPORT.test(source))
|
|
238
|
+
return null;
|
|
239
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
240
|
+
const routesArray = findColocatedRoutesArray(sourceFile);
|
|
241
|
+
if (!routesArray)
|
|
242
|
+
return null;
|
|
243
|
+
const routes = [];
|
|
244
|
+
extractRoutePaths(routesArray, "", false, routes);
|
|
245
|
+
const host = { baseHref: "/", routes, sourceFile: filePath };
|
|
246
|
+
return host;
|
|
247
|
+
};
|
|
203
248
|
var walkTsFiles = async (dir, files) => {
|
|
204
249
|
let items;
|
|
205
250
|
try {
|
|
@@ -222,6 +267,23 @@ var walkTsFiles = async (dir, files) => {
|
|
|
222
267
|
}
|
|
223
268
|
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
224
269
|
};
|
|
270
|
+
var analyzeAngularColocatedRoutes2 = async (angularDirectory) => {
|
|
271
|
+
if (!existsSync(angularDirectory))
|
|
272
|
+
return [];
|
|
273
|
+
const tsFiles = [];
|
|
274
|
+
await walkTsFiles(angularDirectory, tsFiles);
|
|
275
|
+
const pages = [];
|
|
276
|
+
await Promise.all(tsFiles.map(async (file) => {
|
|
277
|
+
try {
|
|
278
|
+
if (await analyzeAngularSpaRouteFile(file))
|
|
279
|
+
return;
|
|
280
|
+
const page = await analyzeAngularColocatedRouteFile(file);
|
|
281
|
+
if (page)
|
|
282
|
+
pages.push(page);
|
|
283
|
+
} catch {}
|
|
284
|
+
}));
|
|
285
|
+
return pages;
|
|
286
|
+
};
|
|
225
287
|
var analyzeAngularSpaRoutes2 = async (angularDirectory) => {
|
|
226
288
|
if (!existsSync(angularDirectory))
|
|
227
289
|
return [];
|
|
@@ -240,4 +302,4 @@ var analyzeAngularSpaRoutes2 = async (angularDirectory) => {
|
|
|
240
302
|
return pages;
|
|
241
303
|
};
|
|
242
304
|
|
|
243
|
-
export { analyzeAngularSpaRoutes2 };
|
|
305
|
+
export { analyzeAngularColocatedRoutes2, analyzeAngularSpaRoutes2 };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
detectAbsoluteMobileHost2,
|
|
4
4
|
inspectAbsoluteMobileToolchain2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-ydaxsftq.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveAbsoluteIosXcodeTarget,
|
|
8
8
|
fingerprintAbsoluteIosNativeProject
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-wqpg377f.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeAbsoluteIosDeviceHost,
|
|
12
12
|
normalizeAbsoluteIosDeviceIdentifier,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./index-ypcqx24p.js";
|
|
18
18
|
import {
|
|
19
19
|
getDurationString
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-akseq9ps.js";
|
|
21
21
|
|
|
22
22
|
// src/mobile/iosSimulatorController.ts
|
|
23
23
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
MILLISECONDS_IN_A_SECOND
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fm9x6sjs.js";
|
|
5
5
|
import {
|
|
6
6
|
formatTimestamp2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-yhkg5by0.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/utils.ts
|
|
10
10
|
var {$ } = globalThis.Bun;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
UNFOUND_INDEX
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fm9x6sjs.js";
|
|
5
5
|
import {
|
|
6
6
|
normalizePath,
|
|
7
7
|
scanFileRoutes
|
|
@@ -666,7 +666,7 @@ var deriveManifestKeys = async (config, projectRoot = process.cwd()) => {
|
|
|
666
666
|
}
|
|
667
667
|
const rscDir = at(config.reactServerComponentsDirectory);
|
|
668
668
|
if (rscDir && existsSync3(join2(rscDir, "pages"))) {
|
|
669
|
-
const { reactServerPageManifestKeys } = await import("./buildReactServerComponents-
|
|
669
|
+
const { reactServerPageManifestKeys } = await import("./buildReactServerComponents-vc9hh2rd.js");
|
|
670
670
|
const names = (await scanEntryPoints(join2(rscDir, "pages"), "*.{tsx,jsx,ts,js}")).map((page) => toPascal(stemOf(page)));
|
|
671
671
|
if (names.length > 0) {
|
|
672
672
|
definite.add(REACT_SERVER_CLIENT_MANIFEST_KEY);
|
|
@@ -769,7 +769,7 @@ var deriveManifestKeys = async (config, projectRoot = process.cwd()) => {
|
|
|
769
769
|
htmxDir
|
|
770
770
|
].filter((dir) => dir !== undefined && existsSync3(dir));
|
|
771
771
|
if (frameworkDirs.length > 0) {
|
|
772
|
-
const { scanWorkerReferences } = await import("./build-
|
|
772
|
+
const { scanWorkerReferences } = await import("./build-p3qra1nj.js");
|
|
773
773
|
for (const worker of await scanWorkerReferences(frameworkDirs))
|
|
774
774
|
possible.add(toPascal(stemOf(worker)));
|
|
775
775
|
}
|