@absolutejs/absolute 0.20.0-beta.170 → 0.20.0-beta.171
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 +50 -0
- package/README.md +33 -4
- package/changelog.json +112 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/constants.js +1 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +2 -2
- package/dist/angular/components/core/streamingSlotRegistry.js +3 -3
- package/dist/angular/index.js +184 -29
- package/dist/angular/index.js.map +15 -14
- package/dist/angular/server.js +184 -29
- package/dist/angular/server.js.map +15 -14
- package/dist/build.js +1241 -853
- package/dist/build.js.map +32 -30
- package/dist/cli/{add-6a7pjkn9.js → add-ae6mg79m.js} +10 -10
- package/dist/cli/{analyze-606fshwa.js → analyze-e57zz9x8.js} +3 -3
- package/dist/cli/{androidEmulatorController-68jjdxmx.js → androidEmulatorController-vqc5m2rp.js} +6 -6
- package/dist/cli/{androidNativeWatcher-x032x9yr.js → androidNativeWatcher-s03aczxv.js} +6 -6
- package/dist/cli/{api-mshjr4ah.js → api-8ppxw487.js} +8 -8
- package/dist/cli/{build-g81xqbb9.js → build-fz7qbdn3.js} +3 -3
- package/dist/cli/{buildDepVendor-29d8v9cx.js → buildDepVendor-qvsh6dsj.js} +7 -3
- package/dist/cli/{compile-9y1w9zpj.js → compile-ndc36zna.js} +10 -7
- package/dist/cli/config/server.js +36 -6
- package/dist/cli/{db-5b4s1kvx.js → db-qbzjw3en.js} +2 -2
- package/dist/cli/{dev-hyeb89hp.js → dev-x49583aj.js} +43 -15
- package/dist/cli/{doctor-h55y9hj1.js → doctor-repprx92.js} +42 -12
- package/dist/cli/{emulatorDoctor-p3yt7140.js → emulatorDoctor-s1z5tkp7.js} +5 -5
- package/dist/cli/{emulatorInstaller-4pm2kx9w.js → emulatorInstaller-pgkdswvq.js} +6 -6
- package/dist/cli/{env-snb0597q.js → env-5nz1qm8e.js} +3 -3
- package/dist/cli/{expoDevController-0vj8dvkh.js → expoDevController-018anvbm.js} +6 -6
- package/dist/cli/{generate-20x1pkf7.js → generate-brvjesd6.js} +8 -8
- package/dist/cli/{heapDiff-wqj8vrq8.js → heapDiff-kncvdtn8.js} +3 -3
- package/dist/cli/htmx/htmx.min.js +1 -1
- package/dist/cli/{htmx-6mz2h7k1.js → htmx-5twhjz7p.js} +7 -7
- package/dist/cli/{index-w09fzs9f.js → index-0z5fgb80.js} +1 -1
- package/dist/cli/{index-exfkpjja.js → index-125cfzvn.js} +2 -2
- package/dist/cli/{index-32ge2w1f.js → index-25e7k849.js} +16 -8
- package/dist/cli/{index-ys2rzqhg.js → index-2shf4aya.js} +1 -1
- package/dist/cli/{index-74m7kh8c.js → index-3ewt17wm.js} +1 -1
- package/dist/cli/{index-zd3cna19.js → index-3sfcmb49.js} +1 -1
- package/dist/cli/{index-14fbvz34.js → index-50ag35xg.js} +2 -2
- package/dist/cli/{index-h5qx5jpk.js → index-7854xf0m.js} +1 -1
- package/dist/cli/{index-3y57kd7x.js → index-8khbn8qr.js} +3 -3
- package/dist/cli/{index-xw1byvzp.js → index-9djrap79.js} +1 -1
- package/dist/cli/{index-ppphkyps.js → index-a6xx0p9e.js} +1 -1
- package/dist/cli/{index-g4ehq6ev.js → index-aemhvvwb.js} +1 -1
- package/dist/cli/{index-z6f43b20.js → index-b1wht4q5.js} +1 -1
- package/dist/cli/{index-s3xvccq3.js → index-btp4fyf1.js} +2 -2
- package/dist/cli/{index-066qhc6n.js → index-cgmp9d02.js} +1 -1
- package/dist/cli/{index-3wz3mktm.js → index-gyjxrnnz.js} +1 -1
- package/dist/cli/index-jwfambwe.js +13 -0
- package/dist/cli/{index-3wm8p7rg.js → index-n6faa3m3.js} +1 -1
- package/dist/cli/{index-kye08pjx.js → index-pr1skxen.js} +1 -1
- package/dist/cli/{index-t8cf0zj9.js → index-prza6tkp.js} +3 -3
- package/dist/cli/{index-qbrzvmh9.js → index-q3snnhyd.js} +1 -1
- package/dist/cli/{index-3vmc30gf.js → index-rz56x932.js} +1 -1
- package/dist/cli/{index-9sksd8c8.js → index-vh68jb0e.js} +2 -2
- package/dist/cli/index.js +32 -32
- package/dist/cli/{info-mn125212.js → info-k124sh7g.js} +4 -4
- package/dist/cli/{inspect-c7s117j0.js → inspect-n6pcfvfw.js} +5 -5
- package/dist/cli/{iosNativeWatcher-0nm6qad5.js → iosNativeWatcher-wdq2fvj1.js} +7 -7
- package/dist/cli/{iosSimulatorController-hza2c3rv.js → iosSimulatorController-n97dpa8p.js} +7 -7
- package/dist/cli/{islands-dc54e5y1.js → islands-p4vgx7a2.js} +3 -3
- package/dist/cli/{logs-ej1add2b.js → logs-shg23fbt.js} +3 -3
- package/dist/cli/{ls-b6zz24nt.js → ls-0hfx323m.js} +3 -3
- package/dist/cli/{mem-5q7n3ymb.js → mem-16sy1707.js} +5 -5
- package/dist/cli/{migrate-6nm4kdf6.js → migrate-k91k050s.js} +2 -2
- package/dist/cli/{mobile-ajnnvqtv.js → mobile-nqdkk3gd.js} +13 -13
- package/dist/cli/prerender-010z771p.js +10 -0
- package/dist/cli/{prettier-phdtvqef.js → prettier-dh5fh786.js} +1 -1
- package/dist/cli/{ps-ezmzyscn.js → ps-pk7ncjac.js} +6 -6
- package/dist/cli/{psTui-3x3ykjve.js → psTui-50wf0b72.js} +7 -7
- package/dist/cli/{remoteMacProtocol-g09myqt5.js → remoteMacProtocol-g10s408w.js} +7 -7
- package/dist/cli/{remove-t8x1mrxg.js → remove-abaf0w6k.js} +8 -8
- package/dist/cli/{routes-3xj256gx.js → routes-mc3ymp8t.js} +3 -3
- package/dist/cli/{start-d6p831ny.js → start-t3cq57wn.js} +5 -5
- package/dist/cli/{typecheck-stbt0qt5.js → typecheck-209bemxm.js} +17 -4
- package/dist/cli/{workspace-61hh6jq1.js → workspace-7sbyyc59.js} +5 -5
- package/dist/client/chunks/islands-s2ta5ajb.js.map +1 -1
- package/dist/client/navigation.js +2 -1
- package/dist/client/navigation.js.map +3 -3
- package/dist/dev/client/domTracker.ts +52 -19
- package/dist/dev/client/frameworkDetect.ts +11 -0
- package/dist/dev/client/handlers/html.ts +6 -1
- package/dist/dev/client/handlers/htmx.ts +6 -1
- package/dist/dev/client/hmrClient.ts +10 -0
- package/dist/dev/serverBootstrap.js +112 -6
- package/dist/index.js +1147 -757
- package/dist/index.js.map +32 -30
- package/dist/islands/index.js +16 -5
- package/dist/islands/index.js.map +6 -6
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/index.js +85 -18
- package/dist/react/index.js.map +11 -11
- package/dist/react/server.js +71 -15
- package/dist/react/server.js.map +8 -8
- package/dist/src/angular/baseHref.d.ts +2 -0
- package/dist/src/angular/components/constants.d.ts +1 -0
- package/dist/src/angular/ssrRender.d.ts +1 -1
- package/dist/src/build/compileAngular.d.ts +15 -0
- package/dist/src/build/resolveBuildMode.d.ts +6 -0
- package/dist/src/build/scanAngularHandlerCalls.d.ts +3 -1
- package/dist/src/build/verifyAngularCoreUniqueness.d.ts +3 -1
- package/dist/src/cli/htmx/install.d.ts +1 -1
- package/dist/src/cli/typeGraphCoherence.d.ts +9 -2
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/core/appErrorHooks.d.ts +8 -0
- package/dist/src/core/islandPageContext.d.ts +5 -1
- package/dist/src/core/requestContext.d.ts +5 -0
- package/dist/src/core/serverOnlyStaticFiles.d.ts +7 -0
- package/dist/src/dev/editorTempFiles.d.ts +3 -0
- package/dist/src/dev/hot/analyze.d.ts +1 -1
- package/dist/src/dev/hot/runtime.d.ts +20 -0
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/rebuildTrigger.d.ts +1 -0
- package/dist/src/utils/cleanStaleOutputs.d.ts +4 -1
- package/dist/src/utils/logger.d.ts +3 -2
- package/dist/src/utils/resolveConvention.d.ts +1 -0
- package/dist/src/utils/ssrErrorPage.d.ts +3 -0
- package/dist/svelte/index.js +85 -18
- package/dist/svelte/index.js.map +11 -11
- package/dist/svelte/router/Route.svelte.d.ts +1 -2
- package/dist/svelte/router/Router.svelte +2 -4
- package/dist/svelte/server.js +73 -16
- package/dist/svelte/server.js.map +9 -9
- package/dist/types/globals.d.ts +3 -0
- package/dist/types/svelteRouter.ts +3 -12
- 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 +158 -91
- package/dist/vue/index.js.map +12 -12
- package/dist/vue/server.js +144 -88
- package/dist/vue/server.js.map +9 -9
- package/package.json +1 -1
- package/dist/cli/prerender-fqpp0m1j.js +0 -10
- /package/dist/cli/{index-vtp20gwf.js → index-2bxfhs32.js} +0 -0
- /package/dist/cli/{index-fgz435qn.js → index-t8jmj8w1.js} +0 -0
|
@@ -34,6 +34,7 @@ export declare const HTTP_STATUS_OK = 200;
|
|
|
34
34
|
export declare const HTTP_STATUS_BAD_REQUEST = 400;
|
|
35
35
|
export declare const HTTP_STATUS_NOT_FOUND = 404;
|
|
36
36
|
export declare const HTTP_STATUS_GONE = 410;
|
|
37
|
+
export declare const HTTP_STATUS_INTERNAL_SERVER_ERROR = 500;
|
|
37
38
|
export declare const HOURS_IN_DAY = 24;
|
|
38
39
|
export declare const HOURS_IN_HALF_DAY = 12;
|
|
39
40
|
export declare const IMAGE_DEFAULT_DEVICE_SIZES: number[];
|
|
@@ -8,6 +8,6 @@ export declare const buildProviders: (deps: AngularDeps, sanitizer: InstanceType
|
|
|
8
8
|
} | Provider | EnvironmentProviders)[];
|
|
9
9
|
export declare const clearSelectorCache: () => void;
|
|
10
10
|
export declare const resolveSelector: (deps: AngularDeps, pagePath: string, PageComponent: Type<unknown>) => string;
|
|
11
|
-
export declare const injectSsrScripts: (html: string, requestId: string, indexPath: string, requestContext?: unknown) => string;
|
|
11
|
+
export declare const injectSsrScripts: (html: string, requestId: string, indexPath: string, requestContext?: unknown, baseHref?: string | null) => string;
|
|
12
12
|
export declare const renderAngularApp: (deps: AngularDeps, PageComponent: Type<unknown>, providers: (Provider | EnvironmentProviders)[], document: string | Document, url?: string) => Promise<string>;
|
|
13
13
|
export declare const withSuppressedAngularDevLogs: <T>(render: () => Promise<T>) => Promise<T>;
|
|
@@ -24,6 +24,21 @@ export type AngularProvidersInjection = {
|
|
|
24
24
|
basePath: string | null;
|
|
25
25
|
}>;
|
|
26
26
|
};
|
|
27
|
+
/** Picks the class the generated `export default` (and the client
|
|
28
|
+
* bootstrap wrappers) should point at in a compiled Angular page module.
|
|
29
|
+
*
|
|
30
|
+
* - An explicit `export default Name;` always wins.
|
|
31
|
+
* - Otherwise, among the exported component classes, the last one that
|
|
32
|
+
* hosts `<router-outlet>` is the page root. Pages that declare their routed
|
|
33
|
+
* children in the same file (`export const routes = [...]`) export
|
|
34
|
+
* several components, and the routed children come first because the
|
|
35
|
+
* routes table references them.
|
|
36
|
+
* - Otherwise the last-declared exported component, since components a
|
|
37
|
+
* page uses must be declared before the page that references them.
|
|
38
|
+
*
|
|
39
|
+
* Works on both the AOT output (`static ɵcmp = ɵɵdefineComponent(...)`)
|
|
40
|
+
* and the JIT output (`Name = __decorate([Component({...})], Name)`). */
|
|
41
|
+
export declare const detectAngularPageComponentClass: (source: string) => string | null;
|
|
27
42
|
export declare const compileAngular: (entryPoints: string[], outRoot: string, hmr?: boolean, stylePreprocessors?: StylePreprocessorConfig, providersInjection?: AngularProvidersInjection) => Promise<{
|
|
28
43
|
clientPaths: string[];
|
|
29
44
|
serverPaths: string[];
|
|
@@ -5,4 +5,10 @@ export declare const resolveVueFeatureFlags: (development: boolean) => {
|
|
|
5
5
|
__VUE_PROD_DEVTOOLS__: string;
|
|
6
6
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: string;
|
|
7
7
|
};
|
|
8
|
+
export declare const resolveProductionServerDefine: (buildConfig: Pick<BuildConfig, "vueDirectory">) => {
|
|
9
|
+
__VUE_OPTIONS_API__?: string | undefined;
|
|
10
|
+
__VUE_PROD_DEVTOOLS__?: string | undefined;
|
|
11
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__?: string | undefined;
|
|
12
|
+
'process.env.NODE_ENV': string;
|
|
13
|
+
};
|
|
8
14
|
export declare const resolveClientDefine: (development: boolean, define?: Record<string, string>) => Record<string, string>;
|
|
@@ -5,7 +5,9 @@ export type AngularHandlerCall = {
|
|
|
5
5
|
manifestKey: string;
|
|
6
6
|
/** Mount path from the surrounding `.get("/path", ...)` / `.post(...)`
|
|
7
7
|
* Elysia chain. `null` when the call isn't directly inside such a
|
|
8
|
-
* registration (rare but possible — e.g. inside a helper function).
|
|
8
|
+
* registration (rare but possible — e.g. inside a helper function).
|
|
9
|
+
* The SSR handler then derives `APP_BASE_HREF` from the route Elysia
|
|
10
|
+
* matched at request time instead (see `src/angular/baseHref.ts`). */
|
|
9
11
|
mountPath: string | null;
|
|
10
12
|
};
|
|
11
13
|
/** Walk every TypeScript file under `projectRoot` and return all
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { BuildArtifact } from 'bun';
|
|
2
|
-
|
|
2
|
+
type ScannedArtifact = Pick<BuildArtifact, 'path' | 'text'>;
|
|
3
|
+
export declare const verifyAngularCoreUniqueness: (artifacts: readonly ScannedArtifact[], serverOutDir: string | undefined, throwOnError: boolean) => Promise<void>;
|
|
4
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VENDORED_HTMX_VERSION = "2.0.
|
|
1
|
+
export declare const VENDORED_HTMX_VERSION = "2.0.11";
|
|
2
2
|
export declare const detectHtmxVersion: (content: string) => string | null | undefined;
|
|
3
3
|
export declare const fetchHtmx: (version: string) => Promise<string>;
|
|
4
4
|
export declare const installedHtmxVersion: (htmxDir: string) => string | null | undefined;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** Angular runtime packages that must resolve to one physical copy. A
|
|
2
|
+
* second copy (for example one nested under `@absolutejs/absolute` when
|
|
3
|
+
* its peer range doesn't match the app's version) becomes a second
|
|
4
|
+
* module instance at runtime, and `inject()` then fails with NG0203. */
|
|
5
|
+
export declare const ANGULAR_RUNTIME_PACKAGES: readonly string[];
|
|
1
6
|
export type PackageIdentity = {
|
|
2
7
|
consumer: string;
|
|
3
8
|
packageName: string;
|
|
@@ -7,16 +12,18 @@ export type PackageIdentity = {
|
|
|
7
12
|
export type TypeGraphReport = {
|
|
8
13
|
identities: PackageIdentity[];
|
|
9
14
|
installRoot: string;
|
|
15
|
+
/** The packages this report inspected. */
|
|
16
|
+
packages: readonly string[];
|
|
10
17
|
unresolved: {
|
|
11
18
|
consumer: string;
|
|
12
19
|
packageName: string;
|
|
13
20
|
}[];
|
|
14
21
|
};
|
|
15
22
|
declare const findInstallRoot: (cwd: string) => string;
|
|
16
|
-
declare const inspectTypeGraph: (cwd: string) => TypeGraphReport;
|
|
23
|
+
declare const inspectTypeGraph: (cwd: string, packages?: readonly string[]) => TypeGraphReport;
|
|
17
24
|
declare const duplicateTypeGraphPackages: (report: TypeGraphReport) => {
|
|
18
25
|
identities: PackageIdentity[];
|
|
19
|
-
name:
|
|
26
|
+
name: string;
|
|
20
27
|
paths: string[];
|
|
21
28
|
}[];
|
|
22
29
|
declare const alignTypeGraphOverrides: (report: TypeGraphReport) => string[];
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const HTTP_STATUS_OK = 200;
|
|
|
34
34
|
export declare const HTTP_STATUS_BAD_REQUEST = 400;
|
|
35
35
|
export declare const HTTP_STATUS_NOT_FOUND = 404;
|
|
36
36
|
export declare const HTTP_STATUS_GONE = 410;
|
|
37
|
+
export declare const HTTP_STATUS_INTERNAL_SERVER_ERROR = 500;
|
|
37
38
|
export declare const HOURS_IN_DAY = 24;
|
|
38
39
|
export declare const HOURS_IN_HALF_DAY = 12;
|
|
39
40
|
export declare const IMAGE_DEFAULT_DEVICE_SIZES: number[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Every error hook function reachable from an Elysia instance's hook chain:
|
|
2
|
+
* its own and those of the plugins it uses, at any depth, for global and
|
|
3
|
+
* scoped hooks propagated to it. Local hooks of a plugin used by the app
|
|
4
|
+
* don't propagate, so they aren't listed. */
|
|
5
|
+
export declare const collectErrorHooks: (app: unknown) => Set<unknown>;
|
|
6
|
+
/** True when `app` has an error hook that `own` (the AbsoluteJS plugin) didn't
|
|
7
|
+
* bring with it, so the app handles errors itself. */
|
|
8
|
+
export declare const hasForeignErrorHook: (app: unknown, own: unknown) => boolean;
|
|
@@ -4,6 +4,8 @@ declare global {
|
|
|
4
4
|
}
|
|
5
5
|
/** @internal Test hook: lets each test observe the one-time warning. */
|
|
6
6
|
export declare const resetIslandBootstrapWarning: () => void;
|
|
7
|
+
/** The part of the build manifest a browser may see. */
|
|
8
|
+
export declare const toBrowserManifest: (manifest: Record<string, string>) => Record<string, string>;
|
|
7
9
|
export declare const htmlContainsIslands: (html: string) => boolean;
|
|
8
10
|
export declare const injectIslandPageContext: (html: string, options?: {
|
|
9
11
|
hasIslands?: boolean;
|
|
@@ -11,4 +13,6 @@ export declare const injectIslandPageContext: (html: string, options?: {
|
|
|
11
13
|
export declare const injectIslandPageContextStream: (stream: ReadableStream<string | Uint8Array>, options?: {
|
|
12
14
|
hasIslands?: boolean;
|
|
13
15
|
}) => ReadableStream<string | Uint8Array<ArrayBufferLike>>;
|
|
14
|
-
|
|
16
|
+
/** `buildDir` is the absolute build directory: manifest entries inside it
|
|
17
|
+
* are server-side file paths and stay out of the page. */
|
|
18
|
+
export declare const setCurrentIslandManifest: (manifest: Record<string, string>, buildDir?: string) => void;
|
|
@@ -15,6 +15,11 @@ export declare const absoluteRequestContext: Elysia<"", "local", {
|
|
|
15
15
|
response: {};
|
|
16
16
|
}, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>;
|
|
17
17
|
export declare const getCurrentAbsoluteRequest: () => Request | undefined;
|
|
18
|
+
/** The Elysia route pattern matched for the current request, when the
|
|
19
|
+
* request is the one given (or no request is given). Lets page handlers
|
|
20
|
+
* derive mount-relative values such as Angular's `APP_BASE_HREF` at
|
|
21
|
+
* request time, wherever the handler call is written. */
|
|
22
|
+
export declare const getCurrentAbsoluteRoute: (request?: Request) => string | undefined;
|
|
18
23
|
export declare const runWithAbsoluteRequest: <Result>(request: Request, callback: () => Result) => Result;
|
|
19
24
|
export type DevPageWarmStatus = 'built' | 'failed' | 'ready' | 'unknown';
|
|
20
25
|
export type DevPageWarmer = {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/** Written by the build: every file the server pass produced, relative to
|
|
2
2
|
* the build directory. */
|
|
3
3
|
export declare const SERVER_OUTPUTS_FILE = "server-outputs.json";
|
|
4
|
+
/** Runtime files the build writes at the root of the build directory. The
|
|
5
|
+
* server reads them from disk; none of them is public. `manifest.json`
|
|
6
|
+
* maps every page to its bundle, and for SSR bundles that is an absolute
|
|
7
|
+
* path on the server's disk. A public file with one of these names (from
|
|
8
|
+
* `publicDirectory` or `pwa.manifest.path`) would be overwritten by the
|
|
9
|
+
* build and never served. */
|
|
10
|
+
export declare const RUNTIME_FILE_NAMES: readonly ["absolute-runtime.json", "build-outputs.json", "conventions.json", "manifest.json", "server-outputs.json", "spa-routes.json"];
|
|
4
11
|
/** Static-plugin ignore patterns for a production build directory.
|
|
5
12
|
* `serverBundle` is the running server's entry file (`Bun.main` under
|
|
6
13
|
* `absolute start`); when it lives inside the build directory, it and its
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as TS from 'typescript';
|
|
2
|
-
export declare const ANALYZER_VERSION =
|
|
2
|
+
export declare const ANALYZER_VERSION = 2;
|
|
3
3
|
export type ExportKind = 'class' | 'function' | 'live' | 'value';
|
|
4
4
|
export type ImportUse = {
|
|
5
5
|
/** Resolved module path the binding comes from. */
|
|
@@ -4,6 +4,12 @@ type Slot = {
|
|
|
4
4
|
value: unknown;
|
|
5
5
|
generation: number;
|
|
6
6
|
};
|
|
7
|
+
/** A stateful factory's result kept across versions (analyze.ts,
|
|
8
|
+
* STATEFUL_FACTORIES), and the planned id whose statement made it. */
|
|
9
|
+
type Instance = {
|
|
10
|
+
owner: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
};
|
|
7
13
|
type Pending = {
|
|
8
14
|
generation: number;
|
|
9
15
|
meta: ExportMeta;
|
|
@@ -18,6 +24,8 @@ type Pending = {
|
|
|
18
24
|
changedExports: Set<string>;
|
|
19
25
|
/** How long each re-run statement took, in milliseconds. */
|
|
20
26
|
timings: Map<string, number>;
|
|
27
|
+
/** Stateful factory instances the re-run statements used. */
|
|
28
|
+
instances: Map<string, Instance>;
|
|
21
29
|
};
|
|
22
30
|
export type ModuleRecord = {
|
|
23
31
|
path: string;
|
|
@@ -41,6 +49,10 @@ export type ModuleRecord = {
|
|
|
41
49
|
source?: string;
|
|
42
50
|
/** Import-specifier tag of the version the facade imports. */
|
|
43
51
|
tag: number;
|
|
52
|
+
/** Stateful factory instances by call key, kept across versions. */
|
|
53
|
+
instances: Map<string, Instance>;
|
|
54
|
+
/** Call keys already warned about resetting their state. */
|
|
55
|
+
warned: Set<string>;
|
|
44
56
|
};
|
|
45
57
|
type Facade = {
|
|
46
58
|
path: string;
|
|
@@ -57,9 +69,17 @@ declare const begin: (path: string, meta: ExportMeta, plan: StatementPlan[]) =>
|
|
|
57
69
|
/** A declaration: its previous value, or a fresh one. */
|
|
58
70
|
k: (id: string, factory: () => unknown) => unknown;
|
|
59
71
|
ka: (id: string, factory: () => Promise<unknown>) => Promise<unknown>;
|
|
72
|
+
/** An inline stateful factory call with literal arguments: the
|
|
73
|
+
* instance the same call made in the previous version, so a re-run
|
|
74
|
+
* statement keeps its state. A call that changed gets a new one. */
|
|
75
|
+
p: (owner: string, key: string, label: string, create: () => unknown) => unknown;
|
|
60
76
|
/** A statement run for its effect, only when it re-runs. */
|
|
61
77
|
r: (id: string, effect: () => unknown) => void;
|
|
62
78
|
ra: (id: string, effect: () => Promise<unknown>) => Promise<void>;
|
|
79
|
+
/** An inline stateful factory call whose arguments are not literals:
|
|
80
|
+
* it cannot be matched to the previous instance, so say once that
|
|
81
|
+
* re-running its statement reset the state, and how to keep it. */
|
|
82
|
+
w: (owner: string, key: string, label: string, create: () => unknown) => unknown;
|
|
63
83
|
};
|
|
64
84
|
/** Undo a version that threw: stop what its re-run statements started and
|
|
65
85
|
* keep the previous version current. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ImportCostLoader = 'js' | 'jsx' | 'ts' | 'tsx';
|
|
2
2
|
/** The Bun loader to hand back with the rewritten contents. Bun infers
|
|
3
3
|
* CommonJS versus ESM from the source, so `.cjs`/`.mjs` both take `js`. */
|
|
4
|
-
export declare const importCostLoader: (path: string) => "
|
|
4
|
+
export declare const importCostLoader: (path: string) => "jsx" | "js" | "ts" | "tsx";
|
|
5
5
|
export declare const instrumentModuleSource: (source: string, moduleIndex: number) => string;
|
|
@@ -4,6 +4,7 @@ export declare const queueFileChange: (state: HMRState, filePath: string, config
|
|
|
4
4
|
manifest: Record<string, string>;
|
|
5
5
|
hmrState: HMRState;
|
|
6
6
|
}) => void) => Promise<void>;
|
|
7
|
+
export declare const getAngularClientBundlePlugins: (config: BuildConfig, userAngularRoot: string) => Promise<Bun.BunPlugin[]>;
|
|
7
8
|
export type AngularHmrTier = 0 | 1 | 2;
|
|
8
9
|
export type TriggerRebuildOptions = {
|
|
9
10
|
/** Dev on-demand page build: bundle this page for the first time.
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const OUTPUT_RECORD = "build-outputs.json";
|
|
2
|
+
export declare const cleanStaleOutputs: (buildPath: string, currentOutputPaths: string[], { pruneRecorded }?: {
|
|
3
|
+
pruneRecorded?: boolean;
|
|
4
|
+
}) => Promise<void>;
|
|
@@ -25,7 +25,8 @@ export declare const logReady: (options: {
|
|
|
25
25
|
export declare const logCssUpdate: (path: string, framework?: string, duration?: number) => void;
|
|
26
26
|
/**
|
|
27
27
|
* Build error
|
|
28
|
-
* Format: "10:30:45 AM [hmr] error Build failed: ..."
|
|
28
|
+
* Format: "10:30:45 AM [hmr] error Build failed: ..." (`[absolutejs]`
|
|
29
|
+
* outside dev)
|
|
29
30
|
*/
|
|
30
31
|
export declare const logError: (message: string, error?: Error | string) => void;
|
|
31
32
|
/**
|
|
@@ -59,6 +60,6 @@ export declare const logScriptUpdate: (path: string, framework?: string, duratio
|
|
|
59
60
|
export declare const logServerReload: () => void;
|
|
60
61
|
/**
|
|
61
62
|
* Warning message
|
|
62
|
-
* Format: "10:30:45 AM [hmr] warning ..."
|
|
63
|
+
* Format: "10:30:45 AM [hmr] warning ..." (`[absolutejs]` outside dev)
|
|
63
64
|
*/
|
|
64
65
|
export declare const logWarn: (message: string) => void;
|
|
@@ -6,6 +6,7 @@ export declare const resolveErrorConventionPath: (framework: keyof ConventionsMa
|
|
|
6
6
|
export declare const resolveNotFoundConventionPath: (framework: keyof ConventionsMap) => string | undefined;
|
|
7
7
|
export declare const setConventions: (map: ConventionsMap) => void;
|
|
8
8
|
export declare const renderConventionError: (framework: keyof ConventionsMap, pageName: string, error: unknown) => Promise<Response | null>;
|
|
9
|
+
export declare const renderStaticRouteError: (request: Request, error: unknown) => Promise<Response | null>;
|
|
9
10
|
export declare const renderConventionNotFound: (framework: keyof ConventionsMap) => Promise<Response | null>;
|
|
10
11
|
/** Renders the first available not-found convention. An HTMX request
|
|
11
12
|
* (`HX-Request` header) tries the HTMX pages directory's not-found.html
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** What a production error page says instead of the error's own message,
|
|
2
|
+
* which can name server paths, hosts or queries. */
|
|
3
|
+
export declare const GENERIC_ERROR_MESSAGE = "Something went wrong while rendering this page.";
|
|
1
4
|
/** Dev only: the page a request gets when its page failed to build, with
|
|
2
5
|
* the build's own error and a page that reloads itself once fixed. */
|
|
3
6
|
export declare const buildErrorPage: (framework: string, pageName: string, error: string | undefined) => string;
|
package/dist/svelte/index.js
CHANGED
|
@@ -142,7 +142,7 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
142
142
|
var init_resolvePackageImport = () => {};
|
|
143
143
|
|
|
144
144
|
// src/constants.ts
|
|
145
|
-
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
145
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
146
146
|
var init_constants = __esm(() => {
|
|
147
147
|
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
148
148
|
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
@@ -1138,7 +1138,8 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
1138
1138
|
async: loweredAwaitSource.transformed || loweredSource.transformed
|
|
1139
1139
|
},
|
|
1140
1140
|
filename: resolutionSourcePath,
|
|
1141
|
-
generate: "server"
|
|
1141
|
+
generate: "server",
|
|
1142
|
+
hmr: isDevelopmentRuntime()
|
|
1142
1143
|
}).js.code;
|
|
1143
1144
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
1144
1145
|
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
|
|
@@ -1273,7 +1274,7 @@ var init_startupBanner = __esm(() => {
|
|
|
1273
1274
|
});
|
|
1274
1275
|
|
|
1275
1276
|
// src/utils/logger.ts
|
|
1276
|
-
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
1277
|
+
var colors2, frameworkColors, logTag = () => isDevelopmentRuntime() ? "[hmr]" : "[absolutejs]", formatPath = (filePath) => {
|
|
1277
1278
|
const cwd = process.cwd();
|
|
1278
1279
|
let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
1279
1280
|
relative = relative.replace(/\\/g, "/");
|
|
@@ -1283,7 +1284,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
1283
1284
|
return relative;
|
|
1284
1285
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
1285
1286
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1286
|
-
const tag = `${colors2.cyan}
|
|
1287
|
+
const tag = `${colors2.cyan}${logTag()}${colors2.reset}`;
|
|
1287
1288
|
let message = action;
|
|
1288
1289
|
if (options?.path) {
|
|
1289
1290
|
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
|
|
@@ -1297,7 +1298,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
1297
1298
|
log("css update", { duration, framework: framework ?? "css", path });
|
|
1298
1299
|
}, logError = (message, error) => {
|
|
1299
1300
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1300
|
-
const tag = `${colors2.red}
|
|
1301
|
+
const tag = `${colors2.red}${logTag()}${colors2.reset}`;
|
|
1301
1302
|
const errorMsg = error instanceof Error ? error.message : error;
|
|
1302
1303
|
const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
1303
1304
|
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
@@ -1326,7 +1327,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
1326
1327
|
log(`${colors2.cyan}server module reloaded${colors2.reset}`);
|
|
1327
1328
|
}, logWarn = (message) => {
|
|
1328
1329
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1329
|
-
const tag = `${colors2.yellow}
|
|
1330
|
+
const tag = `${colors2.yellow}${logTag()}${colors2.reset}`;
|
|
1330
1331
|
console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
|
|
1331
1332
|
};
|
|
1332
1333
|
var init_logger = __esm(() => {
|
|
@@ -1389,8 +1390,23 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
1389
1390
|
return;
|
|
1390
1391
|
warnedMissingBootstrap = true;
|
|
1391
1392
|
logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
|
|
1393
|
+
}, manifestBuildDir, WINDOWS_ABSOLUTE_PATH, isServerFilePath = (value) => {
|
|
1394
|
+
if (WINDOWS_ABSOLUTE_PATH.test(value))
|
|
1395
|
+
return true;
|
|
1396
|
+
if (!manifestBuildDir)
|
|
1397
|
+
return false;
|
|
1398
|
+
const root = manifestBuildDir.endsWith("/") ? manifestBuildDir : `${manifestBuildDir}/`;
|
|
1399
|
+
return value.startsWith(root);
|
|
1400
|
+
}, toBrowserManifest = (manifest) => {
|
|
1401
|
+
const browserManifest = {};
|
|
1402
|
+
for (const [key, value] of Object.entries(manifest)) {
|
|
1403
|
+
if (typeof value !== "string" || isServerFilePath(value))
|
|
1404
|
+
continue;
|
|
1405
|
+
browserManifest[key] = value;
|
|
1406
|
+
}
|
|
1407
|
+
return browserManifest;
|
|
1392
1408
|
}, buildIslandsHeadMarkup = (manifest) => {
|
|
1393
|
-
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(manifest))}</script>`;
|
|
1409
|
+
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
|
|
1394
1410
|
const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
|
|
1395
1411
|
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
1396
1412
|
const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
|
|
@@ -1590,13 +1606,15 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
1590
1606
|
return stream;
|
|
1591
1607
|
}
|
|
1592
1608
|
return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
|
|
1593
|
-
}, setCurrentIslandManifest = (manifest) => {
|
|
1609
|
+
}, setCurrentIslandManifest = (manifest, buildDir) => {
|
|
1594
1610
|
globalThis.__absoluteManifest = manifest;
|
|
1611
|
+
manifestBuildDir = buildDir?.replaceAll("\\", "/");
|
|
1595
1612
|
};
|
|
1596
1613
|
var init_islandPageContext = __esm(() => {
|
|
1597
1614
|
init_escapeScriptContent();
|
|
1598
1615
|
init_cspNonceRef();
|
|
1599
1616
|
init_logger();
|
|
1617
|
+
WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
|
|
1600
1618
|
});
|
|
1601
1619
|
|
|
1602
1620
|
// src/core/devRouteRegistrationCallsite.ts
|
|
@@ -1702,7 +1720,7 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
1702
1720
|
});
|
|
1703
1721
|
|
|
1704
1722
|
// src/utils/ssrErrorPage.ts
|
|
1705
|
-
var errorPageHtml = ({
|
|
1723
|
+
var GENERIC_ERROR_MESSAGE = "Something went wrong while rendering this page.", errorPageHtml = ({
|
|
1706
1724
|
framework,
|
|
1707
1725
|
hint,
|
|
1708
1726
|
kind,
|
|
@@ -1765,11 +1783,11 @@ ${script}
|
|
|
1765
1783
|
|
|
1766
1784
|
${error ?? "The dev-server terminal has the build output."}`,
|
|
1767
1785
|
script: reloadOnRebuild()
|
|
1768
|
-
}), ssrErrorPage = (framework, error) => errorPageHtml({
|
|
1786
|
+
}), errorMessage = (error) => error instanceof Error ? error.message : String(error), ssrErrorPage = (framework, error) => errorPageHtml({
|
|
1769
1787
|
framework,
|
|
1770
1788
|
hint: "A component threw during server-side rendering. Check the terminal for the full stack trace.",
|
|
1771
1789
|
kind: "Server Render Error",
|
|
1772
|
-
message:
|
|
1790
|
+
message: isDevelopmentRuntime() ? errorMessage(error) : GENERIC_ERROR_MESSAGE
|
|
1773
1791
|
});
|
|
1774
1792
|
var init_ssrErrorPage = __esm(() => {
|
|
1775
1793
|
init_cspNonceRef();
|
|
@@ -1788,7 +1806,14 @@ var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) =>
|
|
|
1788
1806
|
const storage = new AsyncLocalStorage2;
|
|
1789
1807
|
Reflect.set(globalThis, REQUEST_STORAGE_KEY, storage);
|
|
1790
1808
|
return storage;
|
|
1791
|
-
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request,
|
|
1809
|
+
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request, getCurrentAbsoluteRoute = (request) => {
|
|
1810
|
+
const store = getRequestStorage()?.getStore();
|
|
1811
|
+
if (!store)
|
|
1812
|
+
return;
|
|
1813
|
+
if (request && store.request !== request)
|
|
1814
|
+
return;
|
|
1815
|
+
return store.route;
|
|
1816
|
+
}, runWithAbsoluteRequest = (request, callback) => ensureRequestStorage().run({ request }, callback), CSS_KEY_RE, isDevPageWarmer = (value) => typeof value === "object" && value !== null && ("describe" in value) && typeof value.describe === "function" && ("warm" in value) && typeof value.warm === "function" && ("lookup" in value) && typeof value.lookup === "function", devBuildErrorResponse = (framework, assets) => {
|
|
1792
1817
|
if (!assets?.failed)
|
|
1793
1818
|
return null;
|
|
1794
1819
|
return new Response(buildErrorPage(framework, assets.name, assets.error), {
|
|
@@ -1854,6 +1879,11 @@ var init_requestContext = __esm(() => {
|
|
|
1854
1879
|
name: "absolutejs-request-context"
|
|
1855
1880
|
}).onRequest(({ request }) => {
|
|
1856
1881
|
ensureRequestStorage().enterWith({ request });
|
|
1882
|
+
}).onBeforeHandle(({ request, route }) => {
|
|
1883
|
+
const store = getRequestStorage()?.getStore();
|
|
1884
|
+
if (store && store.request === request && typeof route === "string") {
|
|
1885
|
+
store.route = route;
|
|
1886
|
+
}
|
|
1857
1887
|
}).as("global");
|
|
1858
1888
|
CSS_KEY_RE = /(?:CSS|Css)$/;
|
|
1859
1889
|
});
|
|
@@ -3108,14 +3138,17 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
3108
3138
|
}, resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound, setConventions = (map) => {
|
|
3109
3139
|
Reflect.set(globalThis, CONVENTIONS_KEY, map);
|
|
3110
3140
|
}, isDev = () => isDevelopmentRuntime(), buildErrorProps = (error) => {
|
|
3141
|
+
const name = error instanceof Error ? error.name : "Error";
|
|
3142
|
+
if (!isDev())
|
|
3143
|
+
return { message: GENERIC_ERROR_MESSAGE, name };
|
|
3111
3144
|
if (error instanceof Error) {
|
|
3112
3145
|
return {
|
|
3113
3146
|
message: error.message,
|
|
3114
|
-
name
|
|
3115
|
-
...
|
|
3147
|
+
name,
|
|
3148
|
+
...error.stack ? { stack: error.stack } : {}
|
|
3116
3149
|
};
|
|
3117
3150
|
}
|
|
3118
|
-
return { message: String(error), name
|
|
3151
|
+
return { message: String(error), name };
|
|
3119
3152
|
}, renderReactError = async (conventionPath, errorProps) => {
|
|
3120
3153
|
const { createElement } = await import("react");
|
|
3121
3154
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
@@ -3229,6 +3262,29 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
3229
3262
|
return htmlResponse;
|
|
3230
3263
|
}
|
|
3231
3264
|
return null;
|
|
3265
|
+
}, isPageRequest = (request) => {
|
|
3266
|
+
if (request.headers.get("hx-request") === "true")
|
|
3267
|
+
return true;
|
|
3268
|
+
if (request.headers.get("sec-fetch-dest") === "document")
|
|
3269
|
+
return true;
|
|
3270
|
+
return (request.headers.get("accept") ?? "").includes("text/html");
|
|
3271
|
+
}, renderStaticRouteError = async (request, error) => {
|
|
3272
|
+
if (!isPageRequest(request))
|
|
3273
|
+
return null;
|
|
3274
|
+
const preferHtmx = request.headers.get("hx-request") === "true";
|
|
3275
|
+
const order = preferHtmx ? ["htmx", "html"] : ["html", "htmx"];
|
|
3276
|
+
const frameworks = order.filter((framework) => hasErrorConvention(framework));
|
|
3277
|
+
if (frameworks.length === 0)
|
|
3278
|
+
return null;
|
|
3279
|
+
const errorProps = buildErrorProps(error);
|
|
3280
|
+
const renderNext = async (remaining) => {
|
|
3281
|
+
const [framework, ...rest] = remaining;
|
|
3282
|
+
if (!framework)
|
|
3283
|
+
return null;
|
|
3284
|
+
const response = await tryFrameworkErrorConvention(framework, "", errorProps, error);
|
|
3285
|
+
return response ?? renderNext(rest);
|
|
3286
|
+
};
|
|
3287
|
+
return renderNext(frameworks);
|
|
3232
3288
|
}, renderReactNotFound = async (conventionPath) => {
|
|
3233
3289
|
const { createElement } = await import("react");
|
|
3234
3290
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
@@ -3323,6 +3379,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
3323
3379
|
var init_resolveConvention = __esm(() => {
|
|
3324
3380
|
init_cspNonceRef();
|
|
3325
3381
|
init_staticHtmlNonce();
|
|
3382
|
+
init_ssrErrorPage();
|
|
3326
3383
|
ERROR_RENDERERS = {
|
|
3327
3384
|
angular: renderAngularError,
|
|
3328
3385
|
ember: renderEmberError,
|
|
@@ -3987,7 +4044,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
3987
4044
|
return html.replace("</html>", `${snippet}</html>`);
|
|
3988
4045
|
}
|
|
3989
4046
|
return html + snippet;
|
|
3990
|
-
}, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
|
|
4047
|
+
}, injectSsrScripts = (html, requestId, indexPath, requestContext, baseHref) => {
|
|
3991
4048
|
let result = injectBeforeClose(html, browserTranslationBaselineTag());
|
|
3992
4049
|
const registeredScripts = getAndClearClientScripts(requestId);
|
|
3993
4050
|
if (registeredScripts.length > 0) {
|
|
@@ -3996,6 +4053,9 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
3996
4053
|
if (requestContext !== undefined) {
|
|
3997
4054
|
result = injectBeforeClose(result, `<script${nonceAttr()}>window.__ABS_ANGULAR_REQUEST_CONTEXT__ = ${escapeScriptContent(JSON.stringify(requestContext))};</script>`);
|
|
3998
4055
|
}
|
|
4056
|
+
if (baseHref) {
|
|
4057
|
+
result = injectBeforeClose(result, `<script${nonceAttr()}>window.__ABS_ANGULAR_BASE_HREF__ = ${escapeScriptContent(JSON.stringify(baseHref))};</script>`);
|
|
4058
|
+
}
|
|
3999
4059
|
if (indexPath) {
|
|
4000
4060
|
const escapedIndexPath = JSON.stringify(indexPath);
|
|
4001
4061
|
result = injectBeforeClose(result, `<script${nonceAttr()}>import(${escapeScriptContent(escapedIndexPath)});</script>`);
|
|
@@ -4140,7 +4200,14 @@ var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
|
|
|
4140
4200
|
match = LEADING_HOISTED_RESOURCE_RE.exec(result);
|
|
4141
4201
|
}
|
|
4142
4202
|
return result.trimStart();
|
|
4143
|
-
}, renderReactIslandToHtml =
|
|
4203
|
+
}, renderReactIslandToHtml = async (component, props) => {
|
|
4204
|
+
const { createElement } = await import("react");
|
|
4205
|
+
const { renderToReadableStream } = await import("react-dom/server");
|
|
4206
|
+
const stream = await renderToReadableStream(createElement(component, props));
|
|
4207
|
+
await stream.allReady;
|
|
4208
|
+
const html = await new Response(stream).text();
|
|
4209
|
+
return stripLeadingHoistedResources(html);
|
|
4210
|
+
}, renderSvelteIslandToHtml = (component, props) => import("svelte/server").then(({ render }) => {
|
|
4144
4211
|
const { body } = render(component, { props });
|
|
4145
4212
|
return body;
|
|
4146
4213
|
}), renderVueIslandToHtml = (component, props) => import("vue").then(({ createSSRApp, h: createVueVNode }) => {
|
|
@@ -6007,5 +6074,5 @@ export {
|
|
|
6007
6074
|
useIslandStore
|
|
6008
6075
|
};
|
|
6009
6076
|
|
|
6010
|
-
//# debugId=
|
|
6077
|
+
//# debugId=55A3DA350585CD1864756E2164756E21
|
|
6011
6078
|
//# sourceMappingURL=index.js.map
|