@hyperspan/framework 2.0.0-alpha.16 → 2.0.0-alpha.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperspan/framework",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.19",
4
4
  "description": "Hyperspan Web Framework",
5
5
  "type": "module",
6
6
  "main": "src/server.ts",
@@ -55,6 +55,10 @@
55
55
  "types": "./src/actions.ts",
56
56
  "default": "./src/actions.ts"
57
57
  },
58
+ "./html": {
59
+ "types": "./src/html.ts",
60
+ "default": "./src/html.ts"
61
+ },
58
62
  "./ssr/install-server-dom-mock": {
59
63
  "types": "./src/ssr/install-server-dom-mock.ts",
60
64
  "default": "./src/ssr/install-server-dom-mock.ts"
@@ -104,7 +108,7 @@
104
108
  "vitest": "^4.1.10"
105
109
  },
106
110
  "dependencies": {
107
- "@hyperspan/html": "^2.0.0-alpha.16",
111
+ "@hyperspan/html": "^2.0.0-alpha.19",
108
112
  "debug": "^4.4.3",
109
113
  "isbot": "^5.1.32",
110
114
  "zod": "^4.4.3"
@@ -1,7 +1,7 @@
1
1
  import { test, expect, describe } from 'vitest';
2
2
  import { createAction } from './actions';
3
3
  import { createRoute } from './server';
4
- import { html, render, placeholder, type HSHtml } from '@hyperspan/html';
4
+ import { html, render, placeholder, type HSHtml } from './html';
5
5
  import { createContext } from './server';
6
6
  import * as z from 'zod';
7
7
 
package/src/actions.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { html } from '@hyperspan/html';
1
+ import { html } from './html';
2
2
  import { createRoute, HTTPResponseException, returnHTMLResponse } from './server';
3
3
  import * as z from 'zod';
4
4
  import type { Hyperspan as HS } from './types';
@@ -3,7 +3,7 @@ import { mkdtempSync, writeFileSync, existsSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { tmpdir } from 'node:os';
5
5
  import { pathToFileURL } from 'node:url';
6
- import { render } from '@hyperspan/html';
6
+ import { render } from '../html';
7
7
  import { assetHash } from '../utils';
8
8
  import { setAssetManifest } from './manifest';
9
9
  import {
package/src/client/js.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { readFileSync, existsSync } from 'node:fs';
2
2
  import { isAbsolute, join, relative } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- import { html } from '@hyperspan/html';
4
+ import { html } from '../html';
5
5
  import { assetHash as assetHashFn } from '../utils';
6
6
  import { getImportMap, registerImport, resolveImport } from './manifest';
7
7
  import type { Hyperspan as HS } from '../types';
@@ -0,0 +1,13 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { html, placeholder, render, type HSHtml } from './html';
3
+
4
+ describe('@hyperspan/framework/html', () => {
5
+ test('re-exports html helpers and types from @hyperspan/html', () => {
6
+ const tmpl: HSHtml = html`<p>
7
+ ${placeholder(html`<span>loading</span>`, Promise.resolve('ok'))}
8
+ </p>`;
9
+
10
+ expect(render(tmpl)).toContain('<p>');
11
+ expect(render(tmpl)).toContain('loading');
12
+ });
13
+ });
package/src/html.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@hyperspan/html';
package/src/island.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { html } from '@hyperspan/html';
1
+ import { html } from './html';
2
2
 
3
3
  type IslandComponent = {
4
4
  __HS_ISLAND?: {
@@ -1,5 +1,5 @@
1
1
  import { test, expect } from 'vitest';
2
- import { render } from '@hyperspan/html';
2
+ import { render } from './html';
3
3
  import { hyperspanScriptTags } from './layout';
4
4
  import { streamingClient } from './client/js';
5
5
 
package/src/layout.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { html } from '@hyperspan/html';
1
+ import { html } from './html';
2
2
  import { CSS_PUBLIC_PATH } from './client/css';
3
3
  import { getImportMap, getRouteCss } from './client/manifest';
4
4
  import { actionsClient, streamingClient } from './client/js';
@@ -1,7 +1,7 @@
1
1
  import { test, expect, describe } from 'vitest';
2
2
  import { createRoute, createServer, createContext, initServerRoutes } from './server';
3
3
  import { createAction } from './actions';
4
- import { html, placeholder } from '@hyperspan/html';
4
+ import { html, placeholder } from './html';
5
5
  import type { Hyperspan as HS } from './types';
6
6
 
7
7
  test('route fetch() returns a Response', async () => {
package/src/server.ts CHANGED
@@ -1,13 +1,5 @@
1
1
  import './ssr/install-server-dom-mock';
2
- import {
3
- HSHtml,
4
- html,
5
- isHSHtml,
6
- renderStream,
7
- renderAsync,
8
- render,
9
- _typeOf,
10
- } from '@hyperspan/html';
2
+ import { HSHtml, html, isHSHtml, renderStream, renderAsync, render, _typeOf } from './html';
11
3
  import { isbot } from 'isbot';
12
4
  import { executeMiddleware } from './middleware';
13
5
  import { buildUrl, parsePath, removeUndefined } from './utils';
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HSHtml } from '@hyperspan/html';
1
+ import { HSHtml } from './html';
2
2
  import * as z from 'zod';
3
3
 
4
4
  /**