@absolutejs/absolute 0.19.0-beta.840 → 0.19.0-beta.841

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 (46) 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 +57 -54
  4. package/dist/angular/index.js.map +5 -5
  5. package/dist/angular/server.js +57 -54
  6. package/dist/angular/server.js.map +5 -5
  7. package/dist/build.js +1614 -427
  8. package/dist/build.js.map +23 -15
  9. package/dist/cli/index.js +1 -0
  10. package/dist/index.js +1667 -475
  11. package/dist/index.js.map +25 -17
  12. package/dist/react/index.js +57 -53
  13. package/dist/react/index.js.map +5 -5
  14. package/dist/react/server.js +57 -53
  15. package/dist/react/server.js.map +5 -5
  16. package/dist/src/build/buildEmberVendor.d.ts +24 -0
  17. package/dist/src/build/compileEmber.d.ts +43 -0
  18. package/dist/src/build/vendorEntrySource.d.ts +1 -26
  19. package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
  20. package/dist/src/core/devVendorPaths.d.ts +2 -0
  21. package/dist/src/dev/configResolver.d.ts +1 -0
  22. package/dist/src/dev/pathUtils.d.ts +1 -1
  23. package/dist/src/ember/browser.d.ts +24 -0
  24. package/dist/src/ember/index.d.ts +2 -0
  25. package/dist/src/ember/pageHandler.d.ts +35 -0
  26. package/dist/src/ember/server.d.ts +2 -0
  27. package/dist/src/utils/loadConfig.d.ts +1 -0
  28. package/dist/src/vue/browser.d.ts +2 -0
  29. package/dist/src/vue/defineVuePage.d.ts +5 -0
  30. package/dist/src/vue/index.d.ts +2 -0
  31. package/dist/svelte/index.js +57 -53
  32. package/dist/svelte/index.js.map +5 -5
  33. package/dist/svelte/server.js +57 -53
  34. package/dist/svelte/server.js.map +5 -5
  35. package/dist/types/build.d.ts +1 -0
  36. package/dist/types/conventions.d.ts +1 -0
  37. package/dist/types/ember.d.ts +41 -0
  38. package/dist/types/island.d.ts +3 -2
  39. package/dist/types/vue.d.ts +28 -1
  40. package/dist/vue/browser.js +4 -1
  41. package/dist/vue/browser.js.map +5 -4
  42. package/dist/vue/index.js +62 -53
  43. package/dist/vue/index.js.map +7 -6
  44. package/dist/vue/server.js +59 -53
  45. package/dist/vue/server.js.map +6 -6
  46. package/package.json +1 -1
@@ -1,26 +1 @@
1
- /** Generate a vendor entry source that re-exports both named AND default
2
- * exports robustly, regardless of whether the source has a default export.
3
- *
4
- * Why this is non-trivial:
5
- * - Per ECMA spec, `export *` re-exports only NAMED exports — never the
6
- * default. So a vendor wrapping `firebase/compat/app` (whose entire
7
- * surface is `export { default } from '@firebase/app-compat'`) ends up
8
- * completely empty, breaking `import firebase from "/vendor/X.js"`.
9
- * - Naively adding `export { default } from 'X'` makes Bun.build fail with
10
- * "No matching export for 'default'" when X has no default export.
11
- * - Heuristic detection from the resolved file (e.g. checking for
12
- * `export default` or `module.exports`) is unreliable because
13
- * `Bun.resolveSync` and `Bun.build` can pick different files for the
14
- * same specifier (CJS `index.js` vs ESM `index.mjs` via the package's
15
- * `exports` map).
16
- *
17
- * Solution: import the package as a namespace and re-export the namespace's
18
- * default. Works for every shape:
19
- * - ESM with default: `__ns.default` is the original default value
20
- * - ESM without default: `__ns.default` is `undefined` (consumer that
21
- * imports default would have failed against the original package too)
22
- * - CJS: Bun's interop synthesizes a default on the namespace
23
- *
24
- * The namespace import has no compile-time check on `default` existence,
25
- * so Bun.build accepts it for all packages. */
26
- export declare const generateVendorEntrySource: (specifier: string) => string;
1
+ export declare const generateVendorEntrySource: (specifier: string) => Promise<string>;
@@ -0,0 +1 @@
1
+ export declare const addAutoRouterSetupApp: (sourceContent: string) => string;
@@ -13,3 +13,5 @@ export declare const getSvelteVendorPaths: () => Record<string, string> | null;
13
13
  export declare const setSvelteVendorPaths: (paths: Record<string, string>) => void;
14
14
  export declare const getVueVendorPaths: () => Record<string, string> | null;
15
15
  export declare const setVueVendorPaths: (paths: Record<string, string>) => void;
16
+ export declare const getEmberVendorPaths: () => Record<string, string> | null;
17
+ export declare const setEmberVendorPaths: (paths: Record<string, string>) => void;
@@ -4,6 +4,7 @@ export declare const resolveBuildPaths: (config: BuildConfig) => {
4
4
  angularDir: string | undefined;
5
5
  assetsDir: string | undefined;
6
6
  buildDir: string;
7
+ emberDir: string | undefined;
7
8
  htmlDir: string | undefined;
8
9
  htmxDir: string | undefined;
9
10
  reactDir: string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { BuildConfig } from '../../types/build';
2
2
  import type { ResolvedBuildPaths } from './configResolver';
3
- export declare const detectFramework: (filePath: string, resolved?: ResolvedBuildPaths) => "react" | "svelte" | "vue" | "angular" | "html" | "unknown" | "ignored" | "styles" | "htmx" | "assets";
3
+ export declare const detectFramework: (filePath: string, resolved?: ResolvedBuildPaths) => "react" | "svelte" | "vue" | "angular" | "ember" | "html" | "unknown" | "ignored" | "styles" | "htmx" | "assets";
4
4
  export declare const getWatchPaths: (config: BuildConfig, resolved?: ResolvedBuildPaths) => string[];
5
5
  export declare const shouldIgnorePath: (path: string, resolved?: ResolvedBuildPaths) => boolean;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Phase 1 Ember client entry.
3
+ *
4
+ * The page index file (emitted by the build) imports this module and
5
+ * the user's compiled page module. We mount the page component into
6
+ * `#ember-root` using the same `renderComponent` API SSR used — Ember
7
+ * Router's hydration story is post-Phase-1 work; for v1 we re-render
8
+ * client-side over the SSR'd HTML.
9
+ *
10
+ * `@ember/renderer` is loaded dynamically rather than via static import
11
+ * because (a) the AbsoluteJS framework typecheck shouldn't require
12
+ * ember-source as a dep, and (b) the resolved URL at runtime is
13
+ * `/ember/vendor/ember_renderer.js` (the vendor build's output) rather
14
+ * than the bare specifier — only the user's bundle pass knows which
15
+ * mapping to apply.
16
+ */
17
+ declare global {
18
+ interface Window {
19
+ __INITIAL_PROPS__?: Record<string, unknown>;
20
+ }
21
+ }
22
+ export declare const mountEmberPage: (component: unknown, rootSelector?: string) => Promise<{
23
+ destroy?: () => void;
24
+ }>;
@@ -0,0 +1,2 @@
1
+ export { handleEmberPageRequest, invalidateEmberSsrCache } from './pageHandler';
2
+ export type { EmberPageRequestInput } from './pageHandler';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Phase 1 Ember page handler.
3
+ *
4
+ * The compiled `pagePath` is a self-contained server bundle produced by
5
+ * `compileEmber`. It exports `renderToHTML(props): string` — a one-call
6
+ * entry that wires up simple-dom + the Glimmer renderer + the page
7
+ * component, then returns serialized HTML. The handler's job is just:
8
+ *
9
+ * 1. Auto-inject `request.url` pathname into props as `url` (mirrors
10
+ * React/Svelte/Vue handlers — the convention all four adapters now
11
+ * share for native router cooperation).
12
+ * 2. Polyfill `globalThis.Element` / `globalThis.Node` if missing. The
13
+ * Ember server bundle also installs the polyfill defensively, but
14
+ * installing here too means the polyfill is in place before the
15
+ * bundle's module body evaluates (any top-level Element refs).
16
+ * 3. Dynamic-import the bundle, call `renderToHTML(props)`, wrap the
17
+ * result in a `<head>` + `<body>` shell with `__INITIAL_PROPS__`
18
+ * and the page index module load.
19
+ *
20
+ * Phase 1 doesn't ship: streaming, slots, islands, HMR cache dirty,
21
+ * convention error rendering. Those layer on in phases 2 and 3.
22
+ */
23
+ export type EmberPageRequestInput = {
24
+ indexPath: string;
25
+ pagePath: string;
26
+ headTag?: `<head>${string}</head>`;
27
+ props?: Record<string, unknown>;
28
+ /** When provided, the request's pathname is auto-injected into props
29
+ * as `url` (only if the caller didn't already pass one). Lets users
30
+ * forward `request` straight from the Elysia handler instead of
31
+ * unwrapping the URL by hand. */
32
+ request?: Request;
33
+ };
34
+ export declare const invalidateEmberSsrCache: () => void;
35
+ export declare const handleEmberPageRequest: (input: EmberPageRequestInput) => Promise<Response>;
@@ -0,0 +1,2 @@
1
+ export { handleEmberPageRequest } from './pageHandler';
2
+ export type { EmberPageRequestInput } from './pageHandler';
@@ -14,6 +14,7 @@ export declare const loadConfig: (configPath?: string) => Promise<{
14
14
  angularDirectory?: string;
15
15
  astroDirectory?: string;
16
16
  svelteDirectory?: string;
17
+ emberDirectory?: string;
17
18
  htmlDirectory?: string;
18
19
  htmxDirectory?: string;
19
20
  stylesConfig?: string | import("..").StylesConfig;
@@ -1,3 +1,5 @@
1
1
  export { Island } from './Island.browser';
2
2
  export { createTypedIsland } from './createIsland.browser';
3
3
  export { useIslandStore } from './useIslandStore';
4
+ export { defineVueSetupApp } from './defineVuePage';
5
+ export type { VueAutoRouter, VueSetupApp, VueSetupAppContext } from '../../types/vue';
@@ -0,0 +1,5 @@
1
+ import type { VueSetupApp } from '../../types/vue';
2
+ /** Identity helper that types a Vue page's `setupApp` export without
3
+ * forcing the user to `import type { VueSetupApp }` every time. Use as
4
+ * `export const setupApp = defineVueSetupApp(async (app, ctx) => { ... });` */
5
+ export declare const defineVueSetupApp: (hook: VueSetupApp) => VueSetupApp;
@@ -1,5 +1,7 @@
1
1
  export { handleVuePageRequest } from './pageHandler';
2
2
  export { applyVueRouterRedirect } from './routerRedirectProviders';
3
+ export { defineVueSetupApp } from './defineVuePage';
4
+ export type { VueAutoRouter, VueSetupApp, VueSetupAppContext } from '../../types/vue';
3
5
  export { Island } from './Island';
4
6
  export { createTypedIsland } from './createIsland';
5
7
  export { useIslandStore } from './useIslandStore';
@@ -1889,6 +1889,58 @@ var init_ssrCache = __esm(() => {
1889
1889
  dirtyFrameworks = new Set;
1890
1890
  });
1891
1891
 
1892
+ // src/utils/ssrErrorPage.ts
1893
+ var ssrErrorPage = (framework, error) => {
1894
+ const frameworkColors2 = {
1895
+ angular: "#dd0031",
1896
+ html: "#e34c26",
1897
+ htmx: "#1a365d",
1898
+ react: "#61dafb",
1899
+ svelte: "#ff3e00",
1900
+ vue: "#42b883"
1901
+ };
1902
+ const accent = frameworkColors2[framework] ?? "#94a3b8";
1903
+ const label = framework.charAt(0).toUpperCase() + framework.slice(1);
1904
+ const message = error instanceof Error ? error.message : String(error);
1905
+ return `<!DOCTYPE html>
1906
+ <html>
1907
+ <head>
1908
+ <meta charset="utf-8">
1909
+ <meta name="viewport" content="width=device-width, initial-scale=1">
1910
+ <title>SSR Error - AbsoluteJS</title>
1911
+ <style>
1912
+ *{margin:0;padding:0;box-sizing:border-box}
1913
+ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}
1914
+ .card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}
1915
+ .header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}
1916
+ .brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
1917
+ .badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
1918
+ .kind{color:#94a3b8;font-size:13px;font-weight:500}
1919
+ .content{padding:24px}
1920
+ .label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
1921
+ .message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}
1922
+ .hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}
1923
+ </style>
1924
+ </head>
1925
+ <body>
1926
+ <div class="card">
1927
+ <div class="header">
1928
+ <div style="display:flex;align-items:center;gap:12px">
1929
+ <span class="brand">AbsoluteJS</span>
1930
+ <span class="badge">${label}</span>
1931
+ </div>
1932
+ <span class="kind">Server Render Error</span>
1933
+ </div>
1934
+ <div class="content">
1935
+ <div class="label">What went wrong</div>
1936
+ <pre class="message">${message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</pre>
1937
+ <div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
1938
+ </div>
1939
+ </div>
1940
+ </body>
1941
+ </html>`;
1942
+ };
1943
+
1892
1944
  // src/utils/stringModifiers.ts
1893
1945
  var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-"), toKebab = (str) => normalizeSlug(str).replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), toPascal = (str) => {
1894
1946
  if (!str.includes("-") && !str.includes("_")) {
@@ -3201,58 +3253,6 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
3201
3253
  // src/svelte/pageHandler.ts
3202
3254
  init_ssrCache();
3203
3255
 
3204
- // src/utils/ssrErrorPage.ts
3205
- var ssrErrorPage = (framework, error) => {
3206
- const frameworkColors2 = {
3207
- angular: "#dd0031",
3208
- html: "#e34c26",
3209
- htmx: "#1a365d",
3210
- react: "#61dafb",
3211
- svelte: "#ff3e00",
3212
- vue: "#42b883"
3213
- };
3214
- const accent = frameworkColors2[framework] ?? "#94a3b8";
3215
- const label = framework.charAt(0).toUpperCase() + framework.slice(1);
3216
- const message = error instanceof Error ? error.message : String(error);
3217
- return `<!DOCTYPE html>
3218
- <html>
3219
- <head>
3220
- <meta charset="utf-8">
3221
- <meta name="viewport" content="width=device-width, initial-scale=1">
3222
- <title>SSR Error - AbsoluteJS</title>
3223
- <style>
3224
- *{margin:0;padding:0;box-sizing:border-box}
3225
- body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}
3226
- .card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}
3227
- .header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}
3228
- .brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
3229
- .badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
3230
- .kind{color:#94a3b8;font-size:13px;font-weight:500}
3231
- .content{padding:24px}
3232
- .label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
3233
- .message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}
3234
- .hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}
3235
- </style>
3236
- </head>
3237
- <body>
3238
- <div class="card">
3239
- <div class="header">
3240
- <div style="display:flex;align-items:center;gap:12px">
3241
- <span class="brand">AbsoluteJS</span>
3242
- <span class="badge">${label}</span>
3243
- </div>
3244
- <span class="kind">Server Render Error</span>
3245
- </div>
3246
- <div class="content">
3247
- <div class="label">What went wrong</div>
3248
- <pre class="message">${message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</pre>
3249
- <div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
3250
- </div>
3251
- </div>
3252
- </body>
3253
- </html>`;
3254
- };
3255
-
3256
3256
  // src/utils/resolveConvention.ts
3257
3257
  import { basename as basename2 } from "path";
3258
3258
  var CONVENTIONS_KEY = "__absoluteConventions";
@@ -3373,8 +3373,11 @@ var logConventionRenderError = (framework, label, renderError) => {
3373
3373
  }
3374
3374
  console.error(`[SSR] Failed to render ${framework} convention ${label} page:`, renderError);
3375
3375
  };
3376
+ var renderEmberError = async () => null;
3377
+ var renderEmberNotFound = async () => null;
3376
3378
  var ERROR_RENDERERS = {
3377
3379
  angular: renderAngularError,
3380
+ ember: renderEmberError,
3378
3381
  react: renderReactError,
3379
3382
  svelte: renderSvelteError,
3380
3383
  vue: renderVueError
@@ -3457,6 +3460,7 @@ var renderAngularNotFound = async (conventionPath) => {
3457
3460
  };
3458
3461
  var NOT_FOUND_RENDERERS = {
3459
3462
  angular: renderAngularNotFound,
3463
+ ember: renderEmberNotFound,
3460
3464
  react: renderReactNotFound,
3461
3465
  svelte: renderSvelteNotFound,
3462
3466
  vue: renderVueNotFound
@@ -3761,5 +3765,5 @@ export {
3761
3765
  createTypedIsland
3762
3766
  };
3763
3767
 
3764
- //# debugId=90487CBA9FD90D6164756E2164756E21
3768
+ //# debugId=B5BA84C66FADA6BA64756E2164756E21
3765
3769
  //# sourceMappingURL=index.js.map