@absolutejs/absolute 0.19.0-beta.950 → 0.19.0-beta.952

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.
Files changed (40) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +39 -15
  4. package/dist/angular/index.js.map +5 -5
  5. package/dist/angular/server.js +39 -15
  6. package/dist/angular/server.js.map +5 -5
  7. package/dist/build.js +1235 -717
  8. package/dist/build.js.map +21 -19
  9. package/dist/cli/index.js +159 -92
  10. package/dist/index.js +1359 -815
  11. package/dist/index.js.map +28 -26
  12. package/dist/islands/index.js +5 -5
  13. package/dist/islands/index.js.map +3 -3
  14. package/dist/react/components/browser/index.js +17 -2
  15. package/dist/react/components/index.js +19 -3
  16. package/dist/react/components/index.js.map +5 -4
  17. package/dist/react/index.js +37 -13
  18. package/dist/react/index.js.map +4 -4
  19. package/dist/react/server.js +33 -9
  20. package/dist/react/server.js.map +3 -3
  21. package/dist/src/build/chainInlineSourcemaps.d.ts +13 -0
  22. package/dist/src/build/externalAssetPlugin.d.ts +2 -0
  23. package/dist/src/core/devRouteRegistrationCallsite.d.ts +1 -0
  24. package/dist/src/core/prepare.d.ts +11 -2
  25. package/dist/src/dev/clientManager.d.ts +1 -0
  26. package/dist/src/dev/serverEntryWatcher.d.ts +1 -0
  27. package/dist/src/react/components/Head.d.ts +1 -1
  28. package/dist/src/utils/generateHeadElement.d.ts +1 -1
  29. package/dist/src/utils/jsonLd.d.ts +1 -0
  30. package/dist/svelte/index.js +37 -13
  31. package/dist/svelte/index.js.map +4 -4
  32. package/dist/svelte/server.js +37 -13
  33. package/dist/svelte/server.js.map +4 -4
  34. package/dist/types/globals.d.ts +1 -4
  35. package/dist/types/metadata.d.ts +2 -0
  36. package/dist/vue/index.js +37 -13
  37. package/dist/vue/index.js.map +5 -5
  38. package/dist/vue/server.js +33 -9
  39. package/dist/vue/server.js.map +4 -4
  40. package/package.json +17 -1
@@ -33,10 +33,7 @@ declare global {
33
33
  * framework-owned backend HMR — see ABSOLUTE_CONFIG_TOGGLE_LIMITATION.md)
34
34
  * detect this and call `.reload({ fetch })` on the existing server
35
35
  * instead of re-binding the port. Stays unset outside dev. */
36
- var __absoluteBunServer:
37
- | import('bun').Server
38
- | null
39
- | undefined;
36
+ var __absoluteBunServer: import('bun').Server | null | undefined;
40
37
 
41
38
  /** Snapshot of the previous Elysia instance's `app.store` reference,
42
39
  * captured by the `networking` plugin at first listen and refreshed
@@ -35,6 +35,7 @@ export type MetaTag = {
35
35
  httpEquiv?: 'accept-ch' | 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | 'x-ua-compatible';
36
36
  content: string;
37
37
  };
38
+ import type { JsonLdSchema } from './jsonLd';
38
39
  export type Metadata = {
39
40
  title?: string;
40
41
  description?: string;
@@ -46,4 +47,5 @@ export type Metadata = {
46
47
  twitter?: TwitterCard;
47
48
  robots?: RobotsDirective;
48
49
  meta?: MetaTag[];
50
+ jsonLd?: JsonLdSchema | JsonLdSchema[];
49
51
  };
package/dist/vue/index.js CHANGED
@@ -101,11 +101,22 @@ var init_constants = __esm(() => {
101
101
  var exports_devRouteRegistrationCallsite = {};
102
102
  __export(exports_devRouteRegistrationCallsite, {
103
103
  patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
104
+ isPageHandler: () => isPageHandler,
104
105
  getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
105
106
  });
106
107
  import { AsyncLocalStorage } from "async_hooks";
107
108
  import { Elysia } from "elysia";
108
- var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, isObjectRecord4 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
109
+ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
110
+ const source = handler.toString();
111
+ return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
112
+ }, isPageHandler = (handler) => {
113
+ if (typeof handler !== "function")
114
+ return false;
115
+ const fn = handler;
116
+ if (pageHandlerWrappers.has(fn))
117
+ return true;
118
+ return handlerSourceMentionsPageHelper(fn);
119
+ }, isObjectRecord4 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
109
120
  const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
110
121
  if (value === null || typeof value === "undefined") {
111
122
  return;
@@ -138,13 +149,13 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
138
149
  return function wrappedRouteHandler(...args) {
139
150
  return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
140
151
  };
141
- }, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
152
+ }, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
142
153
  const callsite = captureRouteRegistrationCallsite();
143
- return Reflect.apply(originalMethod, this, [
144
- path,
145
- wrapRouteHandlerWithCallsite(handler, callsite),
146
- ...rest
147
- ]);
154
+ const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
155
+ if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
156
+ pageHandlerWrappers.add(wrapped);
157
+ }
158
+ return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
148
159
  }, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
149
160
  if (false) {}
150
161
  if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
@@ -155,7 +166,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
155
166
  const originalMethod = Reflect.get(prototype, methodName);
156
167
  if (!isRouteMethod(originalMethod))
157
168
  return;
158
- Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
169
+ Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod, methodName));
159
170
  });
160
171
  Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
161
172
  };
@@ -172,6 +183,15 @@ var init_devRouteRegistrationCallsite = __esm(() => {
172
183
  "post",
173
184
  "put"
174
185
  ];
186
+ PAGE_HANDLER_NAMES = [
187
+ "handleReactPageRequest",
188
+ "handleSveltePageRequest",
189
+ "handleVuePageRequest",
190
+ "handleAngularPageRequest",
191
+ "handleHTMLPageRequest",
192
+ "handleHTMXPageRequest"
193
+ ];
194
+ pageHandlerWrappers = new WeakSet;
175
195
  });
176
196
 
177
197
  // src/client/streamSwap.ts
@@ -999,6 +1019,10 @@ var init_logger = __esm(() => {
999
1019
  });
1000
1020
 
1001
1021
  // src/utils/ssrErrorPage.ts
1022
+ var exports_ssrErrorPage = {};
1023
+ __export(exports_ssrErrorPage, {
1024
+ ssrErrorPage: () => ssrErrorPage
1025
+ });
1002
1026
  var ssrErrorPage = (framework, error) => {
1003
1027
  const frameworkColors2 = {
1004
1028
  angular: "#dd0031",
@@ -1954,7 +1978,7 @@ import {
1954
1978
  relative,
1955
1979
  resolve as resolve3
1956
1980
  } from "path";
1957
- import { fileURLToPath } from "url";
1981
+ import { fileURLToPath, pathToFileURL } from "url";
1958
1982
  var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less|styl(?:us)?)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less|styl(?:us)?)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
1959
1983
  const normalized = filePathOrLanguage.toLowerCase();
1960
1984
  if (normalized === "scss" || normalized.endsWith(".scss"))
@@ -2188,7 +2212,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2188
2212
  canonicalize(specifier, options) {
2189
2213
  const fromDirectory = options.containingUrl ? dirname2(fileURLToPath(options.containingUrl)) : dirname2(entryFile);
2190
2214
  const resolved = resolveImportPath(specifier, fromDirectory, loadPaths, language, config);
2191
- return resolved ? new URL(`file://${resolved}`) : null;
2215
+ return resolved ? new URL(pathToFileURL(resolve3(resolved)).href) : null;
2192
2216
  },
2193
2217
  load(canonicalUrl) {
2194
2218
  const filePath = fileURLToPath(canonicalUrl);
@@ -2306,7 +2330,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2306
2330
  loadPaths,
2307
2331
  style: "expanded",
2308
2332
  syntax: language === "sass" ? "indented" : "scss",
2309
- url: new URL(`file://${filePath}`)
2333
+ url: new URL(pathToFileURL(resolve3(filePath)).href)
2310
2334
  });
2311
2335
  const css = await runPostcss(result.css, filePath, config);
2312
2336
  const loadedUrls = result.loadedUrls ?? [];
@@ -2493,7 +2517,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2493
2517
  loadPaths,
2494
2518
  style: "expanded",
2495
2519
  syntax: language === "sass" ? "indented" : "scss",
2496
- url: new URL(`file://${filePath}`)
2520
+ url: new URL(pathToFileURL(resolve3(filePath)).href)
2497
2521
  });
2498
2522
  const loadedUrls = result.loadedUrls ?? [];
2499
2523
  for (const url of loadedUrls) {
@@ -4633,5 +4657,5 @@ export {
4633
4657
  Image
4634
4658
  };
4635
4659
 
4636
- //# debugId=C18231216BCE447864756E2164756E21
4660
+ //# debugId=B3625EDB2664480764756E2164756E21
4637
4661
  //# sourceMappingURL=index.js.map