acrylblends 0.6.4 → 0.7.1
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/README.md +2 -2
- package/dist/index.js +34 -3
- package/dist/index.js.map +1 -1
- package/docs/framework/README.md +1 -1
- package/docs/framework/UPSTREAM.md +1 -1
- package/docs/framework/api/summary.md +1 -1
- package/docs/framework/getting-started/desktop.md +1 -1
- package/docs/framework/guides/forms-and-sessions.md +231 -0
- package/docs/framework/guides/jsx-dom.md +6 -6
- package/docs/framework/guides/jsx.md +51 -25
- package/docs/framework/guides/validation.md +1 -1
- package/docs/framework/helpers/cookie.md +1 -1
- package/docs/framework/upstream.json +3 -3
- package/lib/{base-ddiVmiE7.js → base-NSN_SNv-.js} +1 -0
- package/lib/{components-DdI7-ns7.js → components-JXVm45kK.js} +1 -1
- package/lib/{components-0o0CBYNv.js → components-cEW3ovK0.js} +3 -3
- package/lib/{hooks-BMw6BAyP.js → hooks-w72iLeFR.js} +1 -1
- package/lib/jsx/dom/client.js +1 -1
- package/lib/jsx/dom/jsx-dev-runtime.js +1 -1
- package/lib/jsx/dom/jsx-runtime.js +1 -1
- package/lib/jsx/dom/server.js +2 -2
- package/lib/jsx/dom.js +4 -4
- package/lib/jsx/jsx-dev-runtime.js +1 -1
- package/lib/jsx/jsx-runtime.js +1 -1
- package/lib/jsx/streaming.js +1 -1
- package/lib/{jsx-dev-runtime-D18Y35TI.js → jsx-dev-runtime-CWLRA2F3.js} +2 -2
- package/lib/jsx-renderer.js +2 -2
- package/lib/jsx.js +4 -4
- package/lib/node-server/register.d.ts +1 -0
- package/lib/node-server/register.js +73 -0
- package/package.json +5 -1
- package/plugins/acryl-inspect/upstream.json +1 -1
- package/plugins/acryl-node-server/src/register.ts +86 -0
- package/plugins/acryl-node-server/upstream.json +5 -3
- package/plugins/acryl-router/upstream.json +1 -1
- package/plugins/acryl-router-http/upstream.json +1 -1
- package/plugins/acryl-state/upstream.json +1 -1
- package/plugins/desktop/main.ts +4 -1
- package/plugins/desktop/plugin.json +1 -1
- package/plugins/desktop/upstream.json +1 -1
- package/plugins/desktop-web/main.ts +3 -1
- package/plugins/desktop-web/plugin.json +1 -1
- package/plugins/desktop-web/upstream.json +1 -1
- package/shared/AGENTS.core.md +1 -2
- package/templates/agent/package.json +7 -3
- package/templates/agent/tsconfig.json +3 -1
- package/templates/blank/package.json +7 -3
- package/templates/blank/src/about.tsx +14 -0
- package/templates/blank/src/routes.ts +2 -0
- package/templates/blank/test/app.test.ts +15 -0
- package/templates/blank/tsconfig.json +3 -1
- package/templates/todo/package.json +7 -3
- package/templates/todo/tsconfig.json +3 -1
- package/templates/todo/upstream.json +1 -1
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#acryl-jsx/jsx-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-runtime.ts",
|
|
8
|
+
"#acryl-jsx/jsx-dev-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts"
|
|
9
|
+
},
|
|
6
10
|
"engines": {
|
|
7
11
|
"node": ">=22.19.0"
|
|
8
12
|
},
|
|
9
13
|
"scripts": {
|
|
10
|
-
"start": "node src/main.ts",
|
|
11
|
-
"dev": "node --watch src/main.ts",
|
|
12
|
-
"test": "node --test",
|
|
14
|
+
"start": "node --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
15
|
+
"dev": "node --watch --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
16
|
+
"test": "node --import ./src/plugins/acryl-node-server/src/register.ts --test \"test/**/*.test.{ts,tsx}\"",
|
|
13
17
|
"check": "tsc --noEmit",
|
|
14
18
|
"lock": "node src/plugins/manifest/lock.ts",
|
|
15
19
|
"save": "node src/plugins/save/cli.ts",
|
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"./src/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts"
|
|
63
63
|
],
|
|
64
64
|
"acrylblends/jsx/streaming": ["./src/plugins/acryl-router/src/core/jsx/streaming.ts"]
|
|
65
|
-
}
|
|
65
|
+
},
|
|
66
|
+
"jsx": "react-jsx",
|
|
67
|
+
"jsxImportSource": "#acryl-jsx"
|
|
66
68
|
},
|
|
67
69
|
"include": ["src", "test", "extensions"]
|
|
68
70
|
}
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#acryl-jsx/jsx-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-runtime.ts",
|
|
8
|
+
"#acryl-jsx/jsx-dev-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts"
|
|
9
|
+
},
|
|
6
10
|
"engines": {
|
|
7
11
|
"node": ">=22.19.0"
|
|
8
12
|
},
|
|
9
13
|
"scripts": {
|
|
10
|
-
"start": "node src/main.ts",
|
|
11
|
-
"dev": "node --watch src/main.ts",
|
|
12
|
-
"test": "node --test",
|
|
14
|
+
"start": "node --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
15
|
+
"dev": "node --watch --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
16
|
+
"test": "node --import ./src/plugins/acryl-node-server/src/register.ts --test \"test/**/*.test.{ts,tsx}\"",
|
|
13
17
|
"check": "tsc --noEmit",
|
|
14
18
|
"lock": "node src/plugins/manifest/lock.ts",
|
|
15
19
|
"save": "node src/plugins/save/cli.ts",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A page written in JSX: the scripts in package.json run Node.js with the vendored register hook (src/plugins/acryl-node-server/src/register.ts), which compiles .tsx with this app's own typescript. */
|
|
2
|
+
const About = () => (
|
|
3
|
+
<main>
|
|
4
|
+
<h1>About</h1>
|
|
5
|
+
<p>Rendered on the server with the JSX runtime in src/plugins/acryl-router.</p>
|
|
6
|
+
</main>
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
export const aboutPage = (): string => (<About />).toString()
|
|
10
|
+
|
|
11
|
+
/** Throws on purpose: the template's test checks that the stack names this file, so a failure in your own pages points at the .tsx line. */
|
|
12
|
+
export const failingPage = (): string => {
|
|
13
|
+
throw new Error('a page failed')
|
|
14
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis'
|
|
2
|
+
import { aboutPage } from './about.tsx'
|
|
2
3
|
import { Acryl } from './plugins/acryl-router/src/index.ts'
|
|
3
4
|
|
|
4
5
|
export const APP_NAME = '__APP_NAME__'
|
|
@@ -11,6 +12,7 @@ export const routes = {
|
|
|
11
12
|
const app = new Acryl()
|
|
12
13
|
.get('/', (c) => c.json({ app: APP_NAME, ok: true }))
|
|
13
14
|
.get('/health', (c) => c.json({ ok: true }))
|
|
15
|
+
.get('/about', (c) => c.html(aboutPage()))
|
|
14
16
|
ctx.router.route('/', app)
|
|
15
17
|
},
|
|
16
18
|
}
|
|
@@ -29,6 +29,21 @@ test('serves the index route', () =>
|
|
|
29
29
|
assert.deepEqual(await response.json(), { app: APP_NAME, ok: true })
|
|
30
30
|
}))
|
|
31
31
|
|
|
32
|
+
test('renders a .tsx page, and an error in it names the .tsx line', () =>
|
|
33
|
+
withApp(async (app) => {
|
|
34
|
+
const response = await fetch(`${app.url}/about`)
|
|
35
|
+
assert.equal(response.status, 200)
|
|
36
|
+
assert.match(await response.text(), /<main><h1>About<\/h1>/)
|
|
37
|
+
const { failingPage } = await import('../src/about.tsx')
|
|
38
|
+
let stack = ''
|
|
39
|
+
try {
|
|
40
|
+
failingPage()
|
|
41
|
+
} catch (error) {
|
|
42
|
+
stack = String((error as Error).stack)
|
|
43
|
+
}
|
|
44
|
+
assert.match(stack, /about\.tsx:\d+/)
|
|
45
|
+
}))
|
|
46
|
+
|
|
32
47
|
test('answers health checks and 404 for unknown paths', () =>
|
|
33
48
|
withApp(async (app) => {
|
|
34
49
|
assert.equal((await fetch(`${app.url}/health`)).status, 200)
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#acryl-jsx/jsx-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-runtime.ts",
|
|
8
|
+
"#acryl-jsx/jsx-dev-runtime": "./src/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts"
|
|
9
|
+
},
|
|
6
10
|
"engines": {
|
|
7
11
|
"node": ">=22.19.0"
|
|
8
12
|
},
|
|
9
13
|
"scripts": {
|
|
10
|
-
"start": "node src/main.ts",
|
|
11
|
-
"dev": "node --watch src/main.ts",
|
|
12
|
-
"test": "node --test",
|
|
14
|
+
"start": "node --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
15
|
+
"dev": "node --watch --import ./src/plugins/acryl-node-server/src/register.ts src/main.ts",
|
|
16
|
+
"test": "node --import ./src/plugins/acryl-node-server/src/register.ts --test \"test/**/*.test.{ts,tsx}\"",
|
|
13
17
|
"check": "tsc --noEmit",
|
|
14
18
|
"lock": "node src/plugins/manifest/lock.ts",
|
|
15
19
|
"save": "node src/plugins/save/cli.ts",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"examples/acryl-todo/src/index.ts": "src/todo.ts",
|
|
6
6
|
"examples/acryl-todo/src/page.ts": "src/page.ts"
|
|
7
7
|
},
|
|
8
|
-
"commit": "
|
|
8
|
+
"commit": "524406d2033cdc5ca5e01207f9ce29543bbf221b"
|
|
9
9
|
},
|
|
10
10
|
"rewrittenSpecifiers": 4,
|
|
11
11
|
"digest": "sha256:9093704776563001f7f472f94cc5c2fdd79206342c1cb59c11fce62aa74df3ed"
|