@emseepea/create-react-ui-server 0.0.1 → 0.0.3
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 +42 -13
- package/{dist → initializer-dist}/template/package.json +9 -8
- package/initializer-dist/template/src/capabilities/tool.preview-bean-report.ts +4 -0
- package/{dist → initializer-dist}/template/src/server.tsx +2 -3
- package/{dist → initializer-dist}/template/tsconfig.json +1 -1
- package/package.json +37 -14
- /package/{dist → initializer-dist}/LICENSE +0 -0
- /package/{dist → initializer-dist}/create.mjs +0 -0
- /package/{dist → initializer-dist}/template/README.md +0 -0
- /package/{dist → initializer-dist}/template/eval/meaning.test.mjs +0 -0
- /package/{dist → initializer-dist}/template/src/client.tsx +0 -0
- /package/{dist → initializer-dist}/template/src/ui-shared.tsx +0 -0
- /package/{dist → initializer-dist}/template/test/accessibility.test.mjs +0 -0
- /package/{dist → initializer-dist}/template/test/ui-shared.test.mjs +0 -0
- /package/{dist → initializer-dist}/template/test-support/browser-contract.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,25 +1,54 @@
|
|
|
1
1
|
# `@emseepea/create-react-ui-server`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
The package builds its starter from the maintained
|
|
5
|
-
[React form example](https://github.com/emseepea/emseepea/tree/main/examples/react-tailwind-ui).
|
|
6
|
-
|
|
7
|
-
## Create the Project
|
|
8
|
-
|
|
9
|
-
This initializer is queued for the next pre-alpha release and will work after
|
|
10
|
-
npm publication.
|
|
3
|
+
This directory is both the maintained example and its public npm initializer.
|
|
11
4
|
|
|
12
5
|
```sh
|
|
13
6
|
npm init @emseepea/react-ui-server@next -- my-server
|
|
14
7
|
```
|
|
15
8
|
|
|
9
|
+
<!-- generated-project-readme -->
|
|
10
|
+
|
|
11
|
+
## React and Tailwind UI Example
|
|
12
|
+
|
|
13
|
+
Choose this example when your application already uses React and you want an
|
|
14
|
+
accessible form without writing Tailwind configuration or component styles.
|
|
15
|
+
|
|
16
|
+
This example makes the server-rendered form interactive with React and imports
|
|
17
|
+
one compiled Em See Pea stylesheet. It needs no Tailwind configuration and uses
|
|
18
|
+
the same sample states as the native example.
|
|
19
|
+
|
|
20
|
+
## Run
|
|
21
|
+
|
|
22
|
+
From this directory:
|
|
23
|
+
|
|
16
24
|
```sh
|
|
17
|
-
cd my-server
|
|
18
25
|
npm install
|
|
19
|
-
npm
|
|
20
|
-
npm run lint
|
|
26
|
+
npm run build
|
|
21
27
|
npm start
|
|
22
28
|
```
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
Open
|
|
31
|
+
`http://127.0.0.1:3001/` for the page or use
|
|
32
|
+
`http://127.0.0.1:3001/mcp` for Model Context Protocol (MCP).
|
|
33
|
+
|
|
34
|
+
The page previews content only. It does not send or store a report.
|
|
35
|
+
|
|
36
|
+
## Check This Example
|
|
37
|
+
|
|
38
|
+
[Ordinary tests](test/) live in `test/`.
|
|
39
|
+
The [AI tool-choice and understanding test](eval/meaning.test.mjs) lives separately in `eval/`.
|
|
40
|
+
The commands below run each suite independently.
|
|
41
|
+
|
|
42
|
+
Run its build, browser, keyboard, React, and accessibility checks:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npm test
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Check that Claude chooses the preview tool and understands that it changes nothing:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm run test:llm
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If Claude is not already signed in, run `claude auth login` first.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emseepea-starter",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"description": "Create an Em See Pea server with an accessible React form.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -13,13 +13,6 @@
|
|
|
13
13
|
"test:llm:built": "emseepea-test eval",
|
|
14
14
|
"lint": "oxlint src test eval test-support"
|
|
15
15
|
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@emseepea/react": "0.0.1",
|
|
18
|
-
"@emseepea/server": "0.0.4",
|
|
19
|
-
"@emseepea/tailwind": "0.0.1",
|
|
20
|
-
"react": "19.2.8",
|
|
21
|
-
"react-dom": "19.2.8"
|
|
22
|
-
},
|
|
23
16
|
"devDependencies": {
|
|
24
17
|
"playwright": "1.62.1",
|
|
25
18
|
"axe-core": "4.13.0",
|
|
@@ -33,5 +26,13 @@
|
|
|
33
26
|
},
|
|
34
27
|
"engines": {
|
|
35
28
|
"node": ">=22"
|
|
29
|
+
},
|
|
30
|
+
"private": true,
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@emseepea/react": "0.0.4",
|
|
33
|
+
"@emseepea/server": "0.2.1",
|
|
34
|
+
"@emseepea/tailwind": "0.0.1",
|
|
35
|
+
"react": "19.2.8",
|
|
36
|
+
"react-dom": "19.2.8"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -2,12 +2,11 @@ import { readFile } from "node:fs/promises";
|
|
|
2
2
|
import { parse } from "node:querystring";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
createPreviewBeanReportTool,
|
|
6
5
|
fixtureForState,
|
|
7
6
|
viewFromSubmission,
|
|
8
7
|
} from "./ui-shared.js";
|
|
9
8
|
import { ElicitationForm } from "@emseepea/react";
|
|
10
|
-
import { createEmseepea, serveEmseepea, type ElicitationView } from "@emseepea/server";
|
|
9
|
+
import { createEmseepea, discoverCapabilities, serveEmseepea, type ElicitationView } from "@emseepea/server";
|
|
11
10
|
import { renderToString } from "react-dom/server";
|
|
12
11
|
|
|
13
12
|
const stylesheet = await readFile(new URL(import.meta.resolve("@emseepea/tailwind/styles.css")), "utf8");
|
|
@@ -16,7 +15,7 @@ const app = createEmseepea({
|
|
|
16
15
|
name: "emseepea-react-tailwind-ui",
|
|
17
16
|
version: "0.0.0",
|
|
18
17
|
instructions: "Use preview-bean-report to preview sample report content. It sends and stores nothing.",
|
|
19
|
-
|
|
18
|
+
...await discoverCapabilities(new URL("./capabilities/", import.meta.url)),
|
|
20
19
|
});
|
|
21
20
|
|
|
22
21
|
app.addContentTypeParser(
|
package/package.json
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-react-ui-server",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "0.0.3",
|
|
5
4
|
"description": "Create an Em See Pea server with an accessible React form.",
|
|
6
5
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
|
+
"starterDependencies": ["@emseepea/react", "@emseepea/server", "@emseepea/tailwind", "react", "react-dom"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "npm run build:example && npm run build:initializer",
|
|
10
|
+
"build:example": "tsc -p tsconfig.json && esbuild src/client.tsx --bundle --minify --format=esm --platform=browser --outfile=dist/client.js",
|
|
11
|
+
"build:initializer": "node ../../scripts/build-initializer.mjs",
|
|
12
|
+
"start": "node dist/server.js",
|
|
13
|
+
"test": "npm run build && npm run test:built",
|
|
14
|
+
"test:built": "node --test test/*.test.mjs",
|
|
15
|
+
"test:llm": "npm run build && npm run test:llm:built",
|
|
16
|
+
"test:llm:built": "emseepea-test eval",
|
|
17
|
+
"lint": "oxlint src test eval",
|
|
18
|
+
"prepack": "npm run build:initializer"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@emseepea/react": "0.0.4",
|
|
22
|
+
"@emseepea/server": "0.2.1",
|
|
23
|
+
"@emseepea/tailwind": "0.0.1",
|
|
24
|
+
"react": "19.2.8",
|
|
25
|
+
"react-dom": "19.2.8",
|
|
26
|
+
"@emseepea/example-ui-shared": "0.0.0",
|
|
27
|
+
"playwright": "1.62.1",
|
|
28
|
+
"axe-core": "4.13.0",
|
|
29
|
+
"@emseepea/testing": "0.2.1",
|
|
30
|
+
"@types/node": "24.13.3",
|
|
31
|
+
"@types/react": "19.2.18",
|
|
32
|
+
"@types/react-dom": "19.2.5",
|
|
33
|
+
"esbuild": "0.28.2",
|
|
34
|
+
"typescript": "6.0.3",
|
|
35
|
+
"oxlint": "1.80.0"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22"
|
|
11
39
|
},
|
|
40
|
+
"repository": { "type": "git", "url": "git+https://github.com/emseepea/emseepea.git", "directory": "examples/react-tailwind-ui" },
|
|
12
41
|
"homepage": "https://emseepea.github.io/emseepea/examples/",
|
|
13
42
|
"bugs": "https://github.com/emseepea/emseepea/issues",
|
|
14
43
|
"publishConfig": { "access": "public", "provenance": true, "tag": "next" },
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"files": ["dist"],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "node ../../scripts/build-initializer.mjs",
|
|
20
|
-
"prepack": "npm run build"
|
|
21
|
-
},
|
|
22
|
-
"engines": { "node": ">=22" }
|
|
44
|
+
"bin": { "create-react-ui-server": "./initializer-dist/create.mjs" },
|
|
45
|
+
"files": ["initializer-dist"]
|
|
23
46
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|