@absolutejs/absolute 0.20.0-beta.169 → 0.20.0-beta.170
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 +80 -0
- package/README.md +232 -0
- package/changelog.json +228 -0
- package/dist/angular/browser.js +7 -8
- package/dist/angular/browser.js.map +6 -5
- package/dist/angular/components/core/streamingSlotRegistrar.js +6 -2
- package/dist/angular/components/core/streamingSlotRegistry.js +7 -3
- package/dist/angular/index.js +555 -156
- package/dist/angular/index.js.map +29 -23
- package/dist/angular/server.js +555 -156
- package/dist/angular/server.js.map +29 -23
- package/dist/build/buildWorker.js +14 -8
- package/dist/build.js +4949 -1941
- package/dist/build.js.map +72 -42
- package/dist/cli/{add-7azr0c83.js → add-6a7pjkn9.js} +11 -7
- package/dist/cli/{analyze-3cyek6v3.js → analyze-606fshwa.js} +1 -1
- package/dist/cli/{build-25rz8v25.js → build-g81xqbb9.js} +1 -1
- package/dist/cli/{compile-4jnfxts9.js → compile-9y1w9zpj.js} +3 -3
- package/dist/cli/config/server.js +10699 -1538
- package/dist/cli/{dev-9tk5hn2e.js → dev-hyeb89hp.js} +5 -1
- package/dist/cli/{doctor-4nv2c2j3.js → doctor-h55y9hj1.js} +1 -1
- package/dist/cli/{generate-v75p2fct.js → generate-20x1pkf7.js} +4 -4
- package/dist/cli/{htmx-427swtdz.js → htmx-6mz2h7k1.js} +2 -2
- package/dist/cli/{index-bhbs6d5z.js → index-32ge2w1f.js} +12 -4
- package/dist/cli/{index-a4ws2jwd.js → index-3wz3mktm.js} +1 -1
- package/dist/cli/{index-b7hjgknf.js → index-9sksd8c8.js} +13 -4
- package/dist/cli/{index-eyzwc7gz.js → index-qbrzvmh9.js} +4 -2
- package/dist/cli/index-qw98g1p6.js +269 -0
- package/dist/cli/{index-434b7j4a.js → index-vtp20gwf.js} +69 -1
- package/dist/cli/{index-h7qhz02e.js → index-wk0pyxrg.js} +3 -0
- package/dist/cli/{index-k3y8cb6c.js → index-z6f43b20.js} +1 -1
- package/dist/cli/index.js +16 -16
- package/dist/cli/{islands-8sgky9gh.js → islands-dc54e5y1.js} +1 -1
- package/dist/cli/{ls-4m4yqwww.js → ls-b6zz24nt.js} +1 -1
- package/dist/cli/{mobile-hcxjr2gf.js → mobile-ajnnvqtv.js} +3 -3
- package/dist/cli/prerender-fqpp0m1j.js +10 -0
- package/dist/cli/{remove-1ycjx85k.js → remove-t8x1mrxg.js} +4 -4
- package/dist/cli/{start-mbaejxhm.js → start-d6p831ny.js} +3 -3
- package/dist/cli/{typecheck-dr068pmh.js → typecheck-stbt0qt5.js} +6 -1
- package/dist/cli/{workspace-1sycp9g1.js → workspace-61hh6jq1.js} +1 -1
- package/dist/client/chunks/index-6b66nzyf.js +381 -0
- package/dist/client/chunks/index-6b66nzyf.js.map +11 -0
- package/dist/client/chunks/{islands-rc28k5sx.js → islands-s2ta5ajb.js} +5 -2
- package/dist/client/chunks/{islands-rc28k5sx.js.map → islands-s2ta5ajb.js.map} +7 -6
- package/dist/client/index.js +160 -3
- package/dist/client/index.js.map +6 -4
- package/dist/client/navigation.js +764 -0
- package/dist/client/navigation.js.map +10 -0
- package/dist/client/prefetch.js +33 -375
- package/dist/client/prefetch.js.map +3 -4
- package/dist/core/streamingSlotRegistrar.js +5 -2
- package/dist/core/streamingSlotRegistrar.js.map +5 -4
- package/dist/core/streamingSlotRegistry.js +5 -2
- package/dist/core/streamingSlotRegistry.js.map +5 -4
- package/dist/dev/client/cspNonce.ts +28 -0
- package/dist/dev/client/handlers/html.ts +4 -3
- package/dist/dev/client/handlers/htmx.ts +3 -2
- package/dist/dev/client/handlers/svelte.ts +15 -90
- package/dist/dev/client/syncDevtools.ts +2 -1
- package/dist/dev/serverBootstrap.js +11 -4
- package/dist/i18n/index.js +543 -0
- package/dist/i18n/index.js.map +15 -0
- package/dist/index.js +6339 -2233
- package/dist/index.js.map +89 -54
- package/dist/islands/index.js +282 -40
- package/dist/islands/index.js.map +14 -10
- package/dist/mobile/browser.js +7 -2
- package/dist/mobile/browser.js.map +5 -4
- package/dist/mobile/index.js +7 -2
- package/dist/mobile/index.js.map +5 -4
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/react/components/browser/index.js +94 -4
- package/dist/react/components/index.js +150 -10
- package/dist/react/components/index.js.map +15 -10
- package/dist/react/hooks/index.js +479 -13
- package/dist/react/hooks/index.js.map +12 -4
- package/dist/react/index.js +769 -166
- package/dist/react/index.js.map +32 -21
- package/dist/react/router/browser.js +21 -4
- package/dist/react/router/browser.js.map +5 -4
- package/dist/react/router/index.js +21 -4
- package/dist/react/router/index.js.map +5 -4
- package/dist/react/server.js +597 -203
- package/dist/react/server.js.map +25 -15
- package/dist/src/angular/zoneRuntime.d.ts +5 -0
- package/dist/src/build/buildReactServerComponents.d.ts +22 -0
- package/dist/src/build/downlevelAsyncForZone.d.ts +1 -0
- package/dist/src/build/fileRoutes.d.ts +65 -0
- package/dist/src/build/fonts/buildFonts.d.ts +25 -0
- package/dist/src/build/fonts/fallbackMetrics.d.ts +13 -0
- package/dist/src/build/fonts/googleFonts.d.ts +18 -0
- package/dist/src/build/fonts/injectFontTags.d.ts +7 -0
- package/dist/src/build/fonts/parseFontMetrics.d.ts +4 -0
- package/dist/src/build/generateReactIndexes.d.ts +7 -1
- package/dist/src/build/htmlIncludes.d.ts +16 -0
- package/dist/src/build/inlineSourceMapComment.d.ts +1 -0
- package/dist/src/build/scanConventions.d.ts +3 -0
- package/dist/src/build/vitals.d.ts +21 -0
- package/dist/src/client/formActions.d.ts +29 -0
- package/dist/src/client/index.d.ts +2 -0
- package/dist/src/client/navigation.d.ts +16 -0
- package/dist/src/client/prefetch.d.ts +2 -30
- package/dist/src/core/build.d.ts +2 -2
- package/dist/src/core/cspNonce.d.ts +12 -0
- package/dist/src/core/fileRouteAdapter.d.ts +15 -0
- package/dist/src/core/fileRoutes.d.ts +5 -0
- package/dist/src/core/formActionFlash.d.ts +25 -0
- package/dist/src/core/formActions.d.ts +249 -0
- package/dist/src/core/index.d.ts +5 -0
- package/dist/src/core/partialPrerender.d.ts +28 -0
- package/dist/src/core/partialPrerenderServe.d.ts +24 -0
- package/dist/src/core/precompressed.d.ts +11 -1
- package/dist/src/core/prerenderNonce.d.ts +9 -0
- package/dist/src/core/productionRuntime.d.ts +4 -2
- package/dist/src/core/serverOnlyStaticFiles.d.ts +8 -0
- package/dist/src/core/staticHtmlNonce.d.ts +2 -0
- package/dist/src/core/vitals.d.ts +108 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +1 -1
- package/dist/src/dev/client/cspNonce.d.ts +2 -0
- package/dist/src/dev/fileRouteRefresher.d.ts +5 -0
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/reactServerComponentsRebuild.d.ts +3 -0
- package/dist/src/i18n/defineMessages.d.ts +5 -0
- package/dist/src/i18n/formatMessage.d.ts +26 -0
- package/dist/src/i18n/index.d.ts +6 -0
- package/dist/src/i18n/intlCache.d.ts +5 -0
- package/dist/src/i18n/routing.d.ts +28 -0
- package/dist/src/i18n/translator.d.ts +11 -0
- package/dist/src/mobile/androidRelease.d.ts +2 -2
- package/dist/src/mobile/iosRelease.d.ts +4 -4
- package/dist/src/mobile/materializedBundle.d.ts +1 -1
- package/dist/src/mobile/mobileInspect.d.ts +1 -1
- package/dist/src/mobile/releaseArtifact.d.ts +2 -2
- package/dist/src/mobile/remoteMacProtocol.d.ts +2 -2
- package/dist/src/plugins/i18n.d.ts +30 -0
- package/dist/src/plugins/index.d.ts +2 -1
- package/dist/src/plugins/secureHeaders.d.ts +48 -0
- package/dist/src/react/components/Head.d.ts +1 -1
- package/dist/src/react/components/StreamSlot.browser.d.ts +1 -0
- package/dist/src/react/components/StreamSlot.d.ts +5 -1
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +2 -0
- package/dist/src/react/components/SuspenseSlot.d.ts +12 -0
- package/dist/src/react/fileRoute.d.ts +18 -0
- package/dist/src/react/hooks/index.d.ts +4 -0
- package/dist/src/react/hooks/useFormAction.d.ts +42 -0
- package/dist/src/react/hooks/useI18n.d.ts +15 -0
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/server.d.ts +2 -0
- package/dist/src/react/serverComponents/constants.d.ts +11 -0
- package/dist/src/react/serverComponents/flightPayload.d.ts +2 -0
- package/dist/src/react/serverComponents/pageHandler.d.ts +14 -0
- package/dist/src/svelte/browser.d.ts +1 -0
- package/dist/src/svelte/fileRoute.d.ts +15 -0
- package/dist/src/svelte/i18n.d.ts +8 -0
- package/dist/src/svelte/index.d.ts +2 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +5 -1
- package/dist/src/svelte/renderToReadableStream.d.ts +10 -2
- package/dist/src/svelte/router/browser.d.ts +3 -1
- package/dist/src/svelte/router/goto.d.ts +13 -10
- package/dist/src/svelte/router/guards.d.ts +43 -0
- package/dist/src/svelte/router/index.d.ts +3 -1
- package/dist/src/svelte/router/lazy.d.ts +17 -0
- package/dist/src/svelte/router/lazyModule.d.ts +29 -0
- package/dist/src/svelte/router/navigation.d.ts +55 -0
- package/dist/src/svelte/router/pushState.d.ts +4 -2
- package/dist/src/svelte/router/scroll.d.ts +34 -0
- package/dist/src/svelte/routerSsr.d.ts +9 -0
- package/dist/src/svelte/server.d.ts +1 -0
- package/dist/src/utils/cspNonceRef.d.ts +8 -0
- package/dist/src/utils/fontAssets.d.ts +17 -0
- package/dist/src/utils/formActionProtocol.d.ts +10 -0
- package/dist/src/utils/generateHeadElement.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/inlinePageCss.d.ts +18 -0
- package/dist/src/utils/loadConfig.d.ts +5 -0
- package/dist/src/utils/localeRef.d.ts +10 -0
- package/dist/src/utils/resolveConvention.d.ts +6 -1
- package/dist/src/utils/streamingSlots.d.ts +5 -0
- package/dist/src/vue/browser.d.ts +2 -0
- package/dist/src/vue/components/Image.d.ts +2 -2
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/src/vue/serverDataPayload.d.ts +32 -0
- package/dist/src/vue/serverDataState.d.ts +9 -0
- package/dist/src/vue/useServerData.browser.d.ts +6 -0
- package/dist/src/vue/useServerData.d.ts +24 -0
- package/dist/svelte/browser.js +330 -3
- package/dist/svelte/browser.js.map +8 -4
- package/dist/svelte/components/AwaitSlot.svelte +5 -0
- package/dist/svelte/components/Head.svelte +50 -0
- package/dist/svelte/components/JsonLd.svelte +9 -1
- package/dist/svelte/components/StreamSlot.svelte +5 -0
- package/dist/svelte/index.js +1017 -117
- package/dist/svelte/index.js.map +38 -24
- package/dist/svelte/router/Link.svelte +40 -8
- package/dist/svelte/router/Route.svelte +157 -12
- package/dist/svelte/router/Route.svelte.d.ts +39 -5
- package/dist/svelte/router/Router.svelte +140 -25
- package/dist/svelte/router/Router.svelte.d.ts +5 -1
- package/dist/svelte/router/browser.ts +10 -0
- package/dist/svelte/router/goto.ts +15 -86
- package/dist/svelte/router/guards.ts +112 -0
- package/dist/svelte/router/index.ts +10 -0
- package/dist/svelte/router/lazy.ts +82 -0
- package/dist/svelte/router/lazyModule.ts +74 -0
- package/dist/svelte/router/navigation.ts +412 -0
- package/dist/svelte/router/pushState.ts +7 -4
- package/dist/svelte/router/scroll.ts +286 -0
- package/dist/svelte/server.js +747 -252
- package/dist/svelte/server.js.map +30 -20
- package/dist/types/angular.d.ts +2 -0
- package/dist/types/build.d.ts +37 -0
- package/dist/types/conventions.d.ts +3 -0
- package/dist/types/fileRoutes.d.ts +72 -0
- package/dist/types/fonts.d.ts +86 -0
- package/dist/types/formAction.d.ts +54 -0
- package/dist/types/globals.d.ts +10 -0
- package/dist/types/i18n.d.ts +185 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/metadata.d.ts +11 -0
- package/dist/types/navigation.d.ts +37 -0
- package/dist/types/prefetch.d.ts +10 -0
- package/dist/types/sitemap.d.ts +4 -0
- package/dist/types/svelteRouter.d.ts +89 -2
- package/dist/types/svelteRouter.ts +112 -2
- package/dist/types/vue.d.ts +46 -1
- package/dist/utils/iconVersion.ts +34 -0
- package/dist/vue/browser.js +107 -11
- package/dist/vue/browser.js.map +7 -4
- package/dist/vue/components/index.js +5 -2
- package/dist/vue/components/index.js.map +5 -4
- package/dist/vue/index.js +712 -158
- package/dist/vue/index.js.map +32 -23
- package/dist/vue/server.js +310 -79
- package/dist/vue/server.js.map +20 -15
- package/package.json +9 -1
- package/dist/cli/prerender-mfnwsvyt.js +0 -7
- package/dist/src/plugins/pageRouter.d.ts +0 -1
- /package/dist/cli/{index-j7m8pq48.js → index-rervww4p.js} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AngularChangeDetection } from '../../types/build';
|
|
2
|
+
export declare const isAngularZoneMode: () => boolean;
|
|
3
|
+
export declare const setAngularChangeDetection: (mode: AngularChangeDetection | undefined) => void;
|
|
4
|
+
/** Load zone.js into the server process once, before the app listens. */
|
|
5
|
+
export declare const installAngularZoneRuntime: () => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type BuildLog = BuildMessage | ResolveMessage;
|
|
2
|
+
export type ReactServerBuildResult = {
|
|
3
|
+
logs: BuildLog[];
|
|
4
|
+
manifest: Record<string, string>;
|
|
5
|
+
outputPaths: string[];
|
|
6
|
+
success: boolean;
|
|
7
|
+
};
|
|
8
|
+
type ReactServerBuildOptions = {
|
|
9
|
+
buildPath: string;
|
|
10
|
+
directory: string;
|
|
11
|
+
isDev: boolean;
|
|
12
|
+
projectRoot: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const clientModuleId: (projectRoot: string, path: string) => string;
|
|
15
|
+
export declare const isClientModuleSource: (source: string) => boolean;
|
|
16
|
+
export declare const buildReactServerComponents: ({ buildPath, directory, isDev, projectRoot }: ReactServerBuildOptions) => Promise<ReactServerBuildResult>;
|
|
17
|
+
type ReactServerPassOptions = Omit<ReactServerBuildOptions, 'directory'> & {
|
|
18
|
+
directory: string | undefined;
|
|
19
|
+
incrementalFiles: string[] | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare const buildReactServerComponentsPass: ({ directory, incrementalFiles, ...options }: ReactServerPassOptions) => Promise<ReactServerBuildResult | undefined>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const downlevelAsyncForZone: (code: string, fileName: string) => string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { BuildConfig } from '../../types/build';
|
|
2
|
+
import type { FileRouteFramework } from '../../types/fileRoutes';
|
|
3
|
+
export type FileRouteRoot = {
|
|
4
|
+
dir: string;
|
|
5
|
+
framework: FileRouteFramework;
|
|
6
|
+
};
|
|
7
|
+
export type ScannedFileRoute = {
|
|
8
|
+
framework: FileRouteFramework;
|
|
9
|
+
/** Flat page name: the manifest holds `<name>Index`, `<name>`, … */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Elysia path, e.g. `/blog/:slug`. */
|
|
12
|
+
path: string;
|
|
13
|
+
/** Route file, absolute. */
|
|
14
|
+
source: string;
|
|
15
|
+
/** Co-located `<route>.server.ts`, absolute, when present. */
|
|
16
|
+
server?: string;
|
|
17
|
+
};
|
|
18
|
+
export type FileRouteScan = {
|
|
19
|
+
/** Unsupported or conflicting route files, one message each. */
|
|
20
|
+
problems: string[];
|
|
21
|
+
routes: ScannedFileRoute[];
|
|
22
|
+
};
|
|
23
|
+
type ResolvedFileRoutes = {
|
|
24
|
+
output: string;
|
|
25
|
+
roots: FileRouteRoot[];
|
|
26
|
+
};
|
|
27
|
+
/** The route folders and output module for `config`, or `undefined` when
|
|
28
|
+
* file routing is off. */
|
|
29
|
+
export declare const resolveFileRoutes: (config: BuildConfig, root?: string) => ResolvedFileRoutes | undefined;
|
|
30
|
+
/** The Elysia path for a route file's path inside its route folder:
|
|
31
|
+
* `index` → `/`, `blog/index` → `/blog`, `blog/[slug]` → `/blog/:slug`. */
|
|
32
|
+
export declare const fileRoutePath: (framework: FileRouteFramework, relativePath: string) => {
|
|
33
|
+
path: string;
|
|
34
|
+
error?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
error: string;
|
|
37
|
+
path?: undefined;
|
|
38
|
+
};
|
|
39
|
+
/** A route's page name: `Route` + its path in PascalCase + a short hash of
|
|
40
|
+
* the framework and file path, so two routes never share a manifest key
|
|
41
|
+
* (`blog/[slug]` and `blog-slug` both read `BlogSlug`). Letters and digits
|
|
42
|
+
* only, so every manifest key derivation leaves it unchanged. */
|
|
43
|
+
export declare const fileRoutePageName: (framework: FileRouteFramework, relativePath: string) => string;
|
|
44
|
+
/** Scan every route folder. Records the result so the build and the dev
|
|
45
|
+
* server can map a route file to its page name. */
|
|
46
|
+
export declare const scanFileRoutes: (config: BuildConfig) => FileRouteScan;
|
|
47
|
+
/** The route module's source. */
|
|
48
|
+
export declare const renderFileRouteModule: (routes: ScannedFileRoute[], output: string) => string;
|
|
49
|
+
/** Scan the route folders and (re)write the route module when its contents
|
|
50
|
+
* change. `undefined` when file routing is off. */
|
|
51
|
+
export declare const ensureFileRouteModule: (config: BuildConfig) => void;
|
|
52
|
+
export declare const syncFileRoutes: (config: BuildConfig) => {
|
|
53
|
+
output: string;
|
|
54
|
+
written: boolean;
|
|
55
|
+
/** Unsupported or conflicting route files, one message each. */
|
|
56
|
+
problems: string[];
|
|
57
|
+
routes: ScannedFileRoute[];
|
|
58
|
+
} | undefined;
|
|
59
|
+
/** The route a source file is, when it is one: from the last scan, or from
|
|
60
|
+
* its path when it was created since. */
|
|
61
|
+
export declare const fileRouteFor: (source: string) => ScannedFileRoute | undefined;
|
|
62
|
+
export declare const fileRouteNamed: (name: string) => ScannedFileRoute | undefined;
|
|
63
|
+
export declare const fileRoutesOf: (framework: FileRouteFramework) => ScannedFileRoute[];
|
|
64
|
+
export declare const isInFileRouteRoot: (path: string) => boolean;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FontFamilyConfig, FontFetch, FontsConfig } from '../../../types/fonts';
|
|
2
|
+
export declare const FONTS_OUTPUT_DIRECTORY = "assets/fonts";
|
|
3
|
+
export type BuildFontsInput = {
|
|
4
|
+
buildPath: string;
|
|
5
|
+
config: FontsConfig;
|
|
6
|
+
fetch?: FontFetch;
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
warn?: (message: string) => void;
|
|
9
|
+
};
|
|
10
|
+
/** An 8-character content hash that always mixes letters and digits, the
|
|
11
|
+
* shape the production server recognizes as fingerprinted (and caches
|
|
12
|
+
* immutably) and stale-output cleanup recognizes as hashed. */
|
|
13
|
+
export declare const fingerprint: (content: Uint8Array | string) => string;
|
|
14
|
+
/** File name a download is cached under: a hash of its URL and the
|
|
15
|
+
* User-Agent it was requested with. */
|
|
16
|
+
export declare const fontCacheKey: (url: string) => string;
|
|
17
|
+
export declare const familyClassName: (family: FontFamilyConfig) => string;
|
|
18
|
+
export declare const familyVariable: (family: FontFamilyConfig) => string;
|
|
19
|
+
/** Downloads/copies the configured fonts into the build and writes their
|
|
20
|
+
* stylesheet. Returns the manifest keys to merge and every file written
|
|
21
|
+
* (so stale-output cleanup keeps them). */
|
|
22
|
+
export declare const buildFonts: ({ buildPath, config, fetch: fontFetch, projectRoot, warn }: BuildFontsInput) => Promise<{
|
|
23
|
+
manifest: Record<string, string>;
|
|
24
|
+
outputPaths: string[];
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FontFallbackCategory, FontMetrics } from '../../../types/fonts';
|
|
2
|
+
export declare const inferFallbackCategory: (family: string) => "sans-serif" | "serif" | "monospace";
|
|
3
|
+
/** The overrides that make the system fallback occupy the same space as the
|
|
4
|
+
* web font: `size-adjust` matches average character width, and the
|
|
5
|
+
* ascent/descent/line-gap overrides (which apply after size-adjust) match
|
|
6
|
+
* the web font's vertical metrics. */
|
|
7
|
+
export declare const computeFallbackOverrides: (metrics: FontMetrics, category: FontFallbackCategory) => {
|
|
8
|
+
ascentOverride: string;
|
|
9
|
+
descentOverride: string;
|
|
10
|
+
lineGapOverride: string;
|
|
11
|
+
local: string[];
|
|
12
|
+
sizeAdjust: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FontFamilyConfig, FontStyle } from '../../../types/fonts';
|
|
2
|
+
export declare const GOOGLE_FONTS_CSS_ORIGIN = "https://fonts.googleapis.com";
|
|
3
|
+
export declare const GOOGLE_FONTS_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
|
|
4
|
+
export type GoogleFontFace = {
|
|
5
|
+
family: string;
|
|
6
|
+
style: FontStyle;
|
|
7
|
+
subset: string;
|
|
8
|
+
unicodeRange?: string;
|
|
9
|
+
url: string;
|
|
10
|
+
weight: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const familyStyles: (family: FontFamilyConfig) => FontStyle[];
|
|
13
|
+
export declare const familyWeights: (family: FontFamilyConfig) => string[];
|
|
14
|
+
/** The css2 API URL for one family. Tuples must be sorted, italic last. */
|
|
15
|
+
export declare const googleFontsCssUrl: (family: FontFamilyConfig, display: string) => string;
|
|
16
|
+
/** Every `@font-face` in a css2 response, each tagged with the subset named
|
|
17
|
+
* in the comment Google puts before it. */
|
|
18
|
+
export declare const parseGoogleFontsCss: (css: string) => GoogleFontFace[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FontAssets } from '../../../types/fonts';
|
|
2
|
+
/** Adds the font preloads and stylesheet to a static page's `<head>`,
|
|
3
|
+
* ahead of the page's own stylesheets so they can use the font
|
|
4
|
+
* variables. Pages that already link the stylesheet, or have no head,
|
|
5
|
+
* are left alone. */
|
|
6
|
+
export declare const injectFontHead: (html: string, fonts: FontAssets) => string;
|
|
7
|
+
export declare const injectFontTags: (directory: string, fonts: FontAssets) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FontMetrics } from '../../../types/fonts';
|
|
2
|
+
/** Reads ascent, descent, line gap, units per em and the frequency-weighted
|
|
3
|
+
* average character width from a TTF/OTF/WOFF/WOFF2 file. */
|
|
4
|
+
export declare const parseFontMetrics: (bytes: Uint8Array) => FontMetrics;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare const reactRefreshRuntimePath: string;
|
|
2
|
-
|
|
2
|
+
/** A page that lives outside `pages/` under a name of its own: a file
|
|
3
|
+
* route (src/build/fileRoutes.ts). */
|
|
4
|
+
export type ExtraReactPage = {
|
|
5
|
+
name: string;
|
|
6
|
+
source: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const generateReactIndexFiles: (reactPagesDirectory: string, reactIndexesDirectory: string, isDev?: boolean, extraPages?: readonly ExtraReactPage[]) => Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type HtmlIncludeResult = {
|
|
2
|
+
/** Every file pulled in, directly or through another include. */
|
|
3
|
+
dependencies: string[];
|
|
4
|
+
html: string;
|
|
5
|
+
};
|
|
6
|
+
type ReadFile = (path: string) => string;
|
|
7
|
+
/** The files `filePath` includes, directly or through other includes.
|
|
8
|
+
* Empty when it includes nothing or can't be read/expanded. */
|
|
9
|
+
export declare const collectHtmlIncludeDependencies: (filePath: string) => string[];
|
|
10
|
+
/** Expands every <abs-include> in `html`, which was read from `filePath`.
|
|
11
|
+
* Throws on a missing file or an include cycle, naming the chain. */
|
|
12
|
+
export declare const expandHtmlIncludes: (html: string, filePath: string, options?: {
|
|
13
|
+
readFile?: ReadFile;
|
|
14
|
+
root?: string;
|
|
15
|
+
}) => HtmlIncludeResult;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const inlineSourceMapComment: (map: unknown) => string;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { FrameworkConventionEntry } from '../../types/conventions';
|
|
2
|
+
/** Whether `fileName` is an error/loading/not-found convention file
|
|
3
|
+
* (`error.html`, `Home.error.html`, `not-found.svelte`, …). */
|
|
4
|
+
export declare const isConventionFile: (fileName: string) => boolean;
|
|
2
5
|
export declare const scanConventions: (pagesDir: string, pattern: string) => Promise<{
|
|
3
6
|
conventions: FrameworkConventionEntry | undefined;
|
|
4
7
|
pageFiles: string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VitalsConfig } from '../../types/build';
|
|
2
|
+
export declare const DEFAULT_VITALS_ENDPOINT = "/__absolute/vitals";
|
|
3
|
+
/** Whether vitals are on for this build: production builds with `vitals`
|
|
4
|
+
* set, and dev builds only with `vitals.dev`. */
|
|
5
|
+
export declare const isVitalsEnabled: (config: VitalsConfig | undefined, isDev: boolean) => boolean;
|
|
6
|
+
export declare const resolveVitalsConfig: (config: VitalsConfig) => {
|
|
7
|
+
endpoint: string;
|
|
8
|
+
sampleRate: number;
|
|
9
|
+
};
|
|
10
|
+
/** Adds the reporter to a static HTML/HTMX page. */
|
|
11
|
+
export declare const injectVitalsReporterHtml: (html: string) => string;
|
|
12
|
+
export type VitalsBuildArtifacts = {
|
|
13
|
+
banner: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const materializeVitalsReporter: ({ buildPath, config, generatedRoot, write }: {
|
|
16
|
+
buildPath: string;
|
|
17
|
+
config: VitalsConfig;
|
|
18
|
+
generatedRoot: string;
|
|
19
|
+
/** Incremental builds reuse the reporter from the full build. */
|
|
20
|
+
write?: boolean;
|
|
21
|
+
}) => Promise<VitalsBuildArtifacts>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ActionData, ActionFields, ActionPath, ActionResult, AnyFormAction } from '../../types/formAction';
|
|
2
|
+
export type SubmitFormActionOptions = {
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
};
|
|
5
|
+
/** A reducer for React 19's `useActionState` (JavaScript-only: React
|
|
6
|
+
* renders function form actions as `javascript:` URLs on the server; use
|
|
7
|
+
* `useFormAction` for forms that also work without JavaScript). */
|
|
8
|
+
export declare const formActionReducer: <Action extends AnyFormAction = AnyFormAction>(path: ActionPath<Action>) => (_previous: unknown, body: FormData) => Promise<ActionResult<ActionData<Action>, ActionFields<Action>>>;
|
|
9
|
+
/** Posts `body` to the action at `path` and returns its result. Network
|
|
10
|
+
* and unexpected server failures come back as an error state with a
|
|
11
|
+
* `message`; an aborted request rejects with the abort error. */
|
|
12
|
+
export declare const submitFormAction: <Action extends AnyFormAction = AnyFormAction>(path: ActionPath<Action>, body: FormData, options?: SubmitFormActionOptions) => Promise<ActionResult<ActionData<Action>, ActionFields<Action>>>;
|
|
13
|
+
export type FormActionEventDetail = {
|
|
14
|
+
result: ActionResult;
|
|
15
|
+
};
|
|
16
|
+
/** Fired on the form after every enhanced submission. */
|
|
17
|
+
export declare const FORM_ACTION_EVENT = "absolute:form-action";
|
|
18
|
+
/** Writes `result` into a plain form: field errors into
|
|
19
|
+
* `[data-action-error="field"]`, the message into `[data-action-message]`,
|
|
20
|
+
* `[data-action-success]` shown on success, `aria-invalid` on the fields
|
|
21
|
+
* and `data-action-status` on the form. Focuses the first invalid field. */
|
|
22
|
+
export declare const applyActionResult: (form: HTMLFormElement, result: ActionResult) => void;
|
|
23
|
+
/** Submits `form` with fetch instead of a page load. Returns a function
|
|
24
|
+
* that removes the enhancement. */
|
|
25
|
+
export declare const enhanceForm: (form: HTMLFormElement) => () => void;
|
|
26
|
+
/** Enhances every `<form data-absolute-action>` under `root` (except
|
|
27
|
+
* `hx-post` forms, which HTMX submits). Returns a function that removes
|
|
28
|
+
* the enhancements. */
|
|
29
|
+
export declare const enhanceForms: (root?: ParentNode) => () => void;
|
|
@@ -3,3 +3,5 @@ export { getStreamSwapRuntimeScript } from './streamSwap';
|
|
|
3
3
|
export { createIslandStore, getIslandStoreServerSnapshot, initializeIslandStores, readIslandStore, subscribeIslandStore } from './islandStore';
|
|
4
4
|
export { startIslands } from './islandRuntime';
|
|
5
5
|
export { captureSsrTextBaselines, prepareBrowserTranslationHydration } from './browserTranslation';
|
|
6
|
+
export { applyActionResult, enhanceForm, enhanceForms, FORM_ACTION_EVENT, formActionReducer, submitFormAction } from './formActions';
|
|
7
|
+
export type { FormActionEventDetail, SubmitFormActionOptions } from './formActions';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DocumentNavigationOutcome, EnableNavigationOptions, NavigateDocumentOptions } from '../../types/navigation';
|
|
2
|
+
/** Turn the layer off: listeners removed, history methods restored. */
|
|
3
|
+
export declare const disableNavigation: () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Install cross-framework document navigation for this tab. Idempotent:
|
|
6
|
+
* every page can call it (each framework bundle carries its own copy of
|
|
7
|
+
* this module; the first call wins and its options apply).
|
|
8
|
+
*/
|
|
9
|
+
export declare const enableNavigation: (options?: EnableNavigationOptions) => void;
|
|
10
|
+
/** Whether `enableNavigation()` is active in this tab. */
|
|
11
|
+
export declare const isNavigationEnabled: () => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Navigate to `href` through the layer: a soft swap when it is enabled
|
|
14
|
+
* and the page can be torn down, a normal page load otherwise.
|
|
15
|
+
*/
|
|
16
|
+
export declare const navigateDocument: (href: string, options?: NavigateDocumentOptions) => Promise<DocumentNavigationOutcome>;
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Framework-neutral navigation prefetch primitive.
|
|
3
|
-
*
|
|
4
|
-
* Pure DOM + `fetch` — no framework imports — so the React, Vue and Svelte
|
|
5
|
-
* `<Link>` components (and user code) share one cache, one in-flight
|
|
6
|
-
* budget, one IntersectionObserver and one set of data-saver guards.
|
|
7
|
-
*
|
|
8
|
-
* import { prefetch, speculate } from '@absolutejs/absolute/client/prefetch';
|
|
9
|
-
*
|
|
10
|
-
* What a prefetch buys the click that follows:
|
|
11
|
-
* - `'document'` — the HTML lands in the browser's HTTP cache (pages
|
|
12
|
-
* carry a content-hash `ETag`), so the real navigation revalidates
|
|
13
|
-
* with a 304 instead of re-rendering.
|
|
14
|
-
* - `'module'` — `<link rel="modulepreload">` parses + compiles the
|
|
15
|
-
* client module graph ahead of time.
|
|
16
|
-
* - `'data'` — the route-data payload
|
|
17
|
-
* (`application/vnd.absolute.route+json`): the page's props plus the
|
|
18
|
-
* client entry and stylesheets it needs, which are `modulepreload`ed
|
|
19
|
-
* / prefetched as the payload lands. A 404 / 406 from a server that
|
|
20
|
-
* doesn't speak route data is remembered as "no data".
|
|
21
|
-
* - `'route'` — `'document'` + `'data'`, i.e. everything a click
|
|
22
|
-
* needs. What a `<Link>` warms on hover / pointerdown.
|
|
23
|
-
* - `speculate()` — a prerender speculation rule; the browser renders
|
|
24
|
-
* the whole target page in a hidden tab so the click is instant.
|
|
25
|
-
*
|
|
26
|
-
* Global opt-out: `window.__ABSOLUTE_PREFETCH__ = false` disables every
|
|
27
|
-
* entry point in this module (useful for analytics-sensitive pages).
|
|
28
|
-
*/
|
|
29
|
-
import type { HoverPrefetchHandle, HoverPrefetchOptions, PrefetchKind, PrefetchOptions } from '../../types/prefetch';
|
|
1
|
+
import type { HoverPrefetchHandle, HoverPrefetchOptions, PrefetchKind, PrefetchOptions, ViewportPrefetchOptions } from '../../types/prefetch';
|
|
30
2
|
export declare const ROUTE_DATA_MEDIA_TYPE = "application/vnd.absolute.route+json";
|
|
31
3
|
/** `true` when prefetching is allowed right now: we're in a browser, the
|
|
32
4
|
* page hasn't opted out via `window.__ABSOLUTE_PREFETCH__ = false`, and
|
|
@@ -85,7 +57,7 @@ export declare const scheduleHoverPrefetch: (url: string, options?: HoverPrefetc
|
|
|
85
57
|
* IntersectionObserver is shared by every link on the page. Returns an
|
|
86
58
|
* unobserve function for the caller's unmount hook.
|
|
87
59
|
*/
|
|
88
|
-
export declare const observeViewport: (element: Element, url: string, options?:
|
|
60
|
+
export declare const observeViewport: (element: Element, url: string, options?: ViewportPrefetchOptions) => () => void;
|
|
89
61
|
/** Test / teardown helper — forgets injected modulepreload + speculation
|
|
90
62
|
* rule bookkeeping and cancels any queued fetches. */
|
|
91
63
|
export declare const resetPrefetchState: () => void;
|
package/dist/src/core/build.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ import type { BuildConfig, BuildPassError, BunBuildConfigOverride, BunBuildPassK
|
|
|
9
9
|
* production build scans once, so it opts out and pays no stat pass. */
|
|
10
10
|
export declare const scanWorkerReferences: (dirs: string[], memoise?: boolean) => Promise<string[]>;
|
|
11
11
|
type BunBuildOptions = Parameters<typeof bunBuild>[0];
|
|
12
|
-
export declare const resolveBunBuildOverride: (config: BuildConfig["bunBuild"], pass: BunBuildPassKey) => Partial<Omit<Bun.BuildConfig, "compile" | "target" | "entrypoints" | "outdir" | "root" | "
|
|
12
|
+
export declare const resolveBunBuildOverride: (config: BuildConfig["bunBuild"], pass: BunBuildPassKey) => Partial<Omit<Bun.BuildConfig, "format" | "compile" | "target" | "entrypoints" | "outdir" | "root" | "throw">>;
|
|
13
13
|
/** Resolve the Bun `sourcemap` mode for CLIENT bundles from the `sourcemaps`
|
|
14
14
|
* config. Dev always uses inline maps (HMR / devtools); production emits
|
|
15
15
|
* external maps only when explicitly enabled — they're then chained back to
|
|
16
16
|
* source + moved to a private dir by `privatizeClientSourcemaps`. */
|
|
17
|
-
export declare const resolveClientSourcemap: (sourcemaps: BuildConfig["sourcemaps"], devMode: boolean) => "none" | "
|
|
17
|
+
export declare const resolveClientSourcemap: (sourcemaps: BuildConfig["sourcemaps"], devMode: boolean) => "none" | "inline" | "external";
|
|
18
18
|
export declare const mergeBunBuildConfig: (base: BunBuildOptions, override: BunBuildConfigOverride) => Bun.BuildConfig;
|
|
19
19
|
export declare const build: (config: BuildConfig) => Promise<{
|
|
20
20
|
conventions?: undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const createCspNonce: () => string;
|
|
2
|
+
/** @internal Test hook: turns nonces off again. */
|
|
3
|
+
export declare const disableCspNonces: () => void;
|
|
4
|
+
/** Turns nonces on for this process. Called by `secureHeaders()`; the flag
|
|
5
|
+
* lives on globalThis so every bundle (dist/index.js, the framework
|
|
6
|
+
* entries) sees the same state. */
|
|
7
|
+
export declare const enableCspNonces: () => void;
|
|
8
|
+
/** The nonce for `request` (default: the request being handled), or
|
|
9
|
+
* undefined when `secureHeaders()` isn't in use or there's no request
|
|
10
|
+
* (build-time rendering). */
|
|
11
|
+
export declare const getCspNonce: (request?: Request | undefined) => string | undefined;
|
|
12
|
+
export declare const isCspNonceEnabled: () => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FileRouteDefinition, FileRouteFramework, FileRouteRenderInput, FileRouteServerModule } from '../../types/fileRoutes';
|
|
2
|
+
type ServerHooks<Path extends string> = {
|
|
3
|
+
path: Path;
|
|
4
|
+
server?: () => Promise<FileRouteServerModule<Path, unknown> | undefined>;
|
|
5
|
+
};
|
|
6
|
+
export declare const serverHooksOf: <Path extends string>({ path, server }: ServerHooks<Path>) => Pick<FileRouteDefinition, "load" | "beforeHandle">;
|
|
7
|
+
export type FileRouteAdapterInput<Path extends string> = {
|
|
8
|
+
name: string;
|
|
9
|
+
path: Path;
|
|
10
|
+
source: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const defineFileRouteWith: <Path extends string>(framework: FileRouteFramework, route: FileRouteAdapterInput<Path> & {
|
|
13
|
+
server?: () => Promise<FileRouteServerModule<Path, unknown> | undefined>;
|
|
14
|
+
}, render: (input: FileRouteRenderInput) => Promise<Response>) => FileRouteDefinition;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type AnyElysia } from 'elysia';
|
|
2
|
+
import type { FileRouteDefinition } from '../../types/fileRoutes';
|
|
3
|
+
/** Register every file route on the app. Pass the `routeTree` the build
|
|
4
|
+
* generates and the manifest from `prepare()`. */
|
|
5
|
+
export declare const fileRoutes: (routes: readonly FileRouteDefinition[], manifest: Record<string, string>) => <App extends AnyElysia>(app: App) => App;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { ActionResult } from '../../types/formAction';
|
|
3
|
+
export declare const ACTION_FLASH_COOKIE = "absolute_action";
|
|
4
|
+
export type ActionFlash = {
|
|
5
|
+
action: string;
|
|
6
|
+
result: ActionResult;
|
|
7
|
+
};
|
|
8
|
+
export declare const clearActionFlashCookie: (secure: boolean) => string;
|
|
9
|
+
/** `Set-Cookie` value carrying `flash`, shrunk (values or data first, then
|
|
10
|
+
* details) until it fits a cookie. */
|
|
11
|
+
export declare const encodeActionFlash: (flash: ActionFlash, secure: boolean) => string;
|
|
12
|
+
/** The flash the request carries, when it is well-formed. */
|
|
13
|
+
export declare const readActionFlash: (request: Request) => ActionFlash | undefined;
|
|
14
|
+
/** Writes `flash` into the page's matching `<form data-absolute-action>`:
|
|
15
|
+
* field errors, the form message, the success element, `aria-invalid`
|
|
16
|
+
* and (after an error) the values the user typed. */
|
|
17
|
+
export declare const rewriteActionForms: (response: Response, flash: ActionFlash, pageUrl: string) => Response;
|
|
18
|
+
/** Consumes the flash on the first HTML page served while it is set. */
|
|
19
|
+
export declare const consumeActionFlash: (request: Request, response: unknown) => Response | undefined;
|
|
20
|
+
/** Part of the `absolutejs` plugin from `prepare()`: renders and clears
|
|
21
|
+
* form-action results on HTML pages. */
|
|
22
|
+
export declare const formActionRuntime: () => Elysia<"", "local", import("elysia").DefaultSingleton, {
|
|
23
|
+
typebox: {};
|
|
24
|
+
error: [];
|
|
25
|
+
}, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>;
|