streetui 1.0.0

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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/dist/bin.cjs +894 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.d.cts +1 -0
  6. package/dist/bin.d.ts +1 -0
  7. package/dist/bin.js +892 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/compile-B0q07Hzq.d.cts +656 -0
  10. package/dist/compile-B0q07Hzq.d.ts +656 -0
  11. package/dist/create-bin.cjs +896 -0
  12. package/dist/create-bin.cjs.map +1 -0
  13. package/dist/create-bin.d.cts +1 -0
  14. package/dist/create-bin.d.ts +1 -0
  15. package/dist/create-bin.js +894 -0
  16. package/dist/create-bin.js.map +1 -0
  17. package/dist/hydration-diagnostics-BE6xVWD1.d.cts +89 -0
  18. package/dist/hydration-diagnostics-Bck5dMbz.d.ts +89 -0
  19. package/dist/index.cjs +4284 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.cts +1759 -0
  22. package/dist/index.d.ts +1759 -0
  23. package/dist/index.js +4114 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/server-84Rz4g8W.d.cts +165 -0
  26. package/dist/server-D9GPmB49.d.ts +165 -0
  27. package/dist/server.cjs +972 -0
  28. package/dist/server.cjs.map +1 -0
  29. package/dist/server.d.cts +2 -0
  30. package/dist/server.d.ts +2 -0
  31. package/dist/server.js +940 -0
  32. package/dist/server.js.map +1 -0
  33. package/dist/testing.cjs +1754 -0
  34. package/dist/testing.cjs.map +1 -0
  35. package/dist/testing.d.cts +113 -0
  36. package/dist/testing.d.ts +113 -0
  37. package/dist/testing.js +1719 -0
  38. package/dist/testing.js.map +1 -0
  39. package/package.json +113 -0
  40. package/templates/basic/README.md +39 -0
  41. package/templates/basic/_gitignore +15 -0
  42. package/templates/basic/_package.json +21 -0
  43. package/templates/basic/public/styles.css +40 -0
  44. package/templates/basic/src/app.ts +62 -0
  45. package/templates/basic/src/main.ts +39 -0
  46. package/templates/basic/src/server.ts +40 -0
  47. package/templates/basic/streetui.config.ts +6 -0
  48. package/templates/basic/tsconfig.json +16 -0
  49. package/templates/ssr/README.md +46 -0
  50. package/templates/ssr/_gitignore +15 -0
  51. package/templates/ssr/_package.json +21 -0
  52. package/templates/ssr/public/favicon.svg +4 -0
  53. package/templates/ssr/public/styles.css +61 -0
  54. package/templates/ssr/src/app.ts +135 -0
  55. package/templates/ssr/src/main.ts +53 -0
  56. package/templates/ssr/src/server.ts +47 -0
  57. package/templates/ssr/streetui.config.ts +14 -0
  58. package/templates/ssr/tsconfig.json +16 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StreetUI contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # StreetUI
2
+
3
+ **StreetUI is a complete TypeScript UI framework.** It ships its own reactivity,
4
+ a semantic UI DSL, a compiler, a semantic application graph, a direct DOM
5
+ renderer (no virtual DOM), a router, async resources, forms and validation,
6
+ context, accessibility helpers, internationalization, server-side rendering with
7
+ hydration, testing utilities, devtools, and a CLI — as **one package, one
8
+ import**.
9
+
10
+ You install one thing:
11
+
12
+ ```bash
13
+ npm install streetui
14
+ ```
15
+
16
+ …and you import everything from one place:
17
+
18
+ ```ts
19
+ import {
20
+ signal,
21
+ derived,
22
+ streetui,
23
+ compile,
24
+ createRenderer,
25
+ createRouter,
26
+ resource,
27
+ createForm,
28
+ createContext,
29
+ createI18n,
30
+ renderToString,
31
+ serializeState,
32
+ } from 'streetui';
33
+ ```
34
+
35
+ There is no need to install or reason about a constellation of separate
36
+ `@streetui/*` packages. StreetUI is internally modular for maintainability, but
37
+ externally it is a single framework with a single public surface.
38
+
39
+ ## Create a new app
40
+
41
+ ```bash
42
+ npx streetui create my-app
43
+ cd my-app
44
+ npm install
45
+ npm run dev
46
+ ```
47
+
48
+ The generated project depends on exactly one runtime package — `streetui` — and
49
+ all of its source imports from `"streetui"`.
50
+
51
+ ## CLI
52
+
53
+ The CLI is part of the same package:
54
+
55
+ ```bash
56
+ streetui create <dir> # scaffold a new app (choose --template basic | ssr)
57
+ streetui dev # start the dev server (--port, --host)
58
+ streetui build # production build
59
+ streetui start # run the production server (--port, --host)
60
+ streetui --help
61
+ streetui --version
62
+ ```
63
+
64
+ ## A tiny app
65
+
66
+ StreetUI's UI layer is a **semantic builder DSL** — you describe pages and
67
+ sections with builders rather than free-standing element functions:
68
+
69
+ ```ts
70
+ import { streetui, signal, compile, createRenderer, BrowserDOMAdapter } from 'streetui';
71
+
72
+ const count = signal(0);
73
+
74
+ const app = streetui.app({ name: 'counter' });
75
+ app.page('home', (page) => {
76
+ page.heading('Hello, StreetUI', { level: 1 });
77
+ page.section('main', (s) => {
78
+ s.text(() => `Count: ${count.get()}`, { id: 'count' });
79
+ s.button('Increment', { id: 'inc', onClick: () => count.set(count.peek() + 1) });
80
+ });
81
+ });
82
+
83
+ const compiled = compile(app);
84
+ const renderer = createRenderer({ domAdapter: new BrowserDOMAdapter() });
85
+ renderer.mount(compiled, document.getElementById('app')!);
86
+ ```
87
+
88
+ ## Server-side rendering & hydration
89
+
90
+ Render on the server and hydrate on the client using the same framework:
91
+
92
+ ```ts
93
+ // server
94
+ import { renderToString, serializeState } from 'streetui/server';
95
+
96
+ const html = renderToString(compiled); // → HTML string
97
+ const state = serializeState({ counter: { count: 0 } });
98
+ ```
99
+
100
+ ```ts
101
+ // client
102
+ import { createRenderer, BrowserDOMAdapter } from 'streetui';
103
+
104
+ const renderer = createRenderer({ domAdapter: new BrowserDOMAdapter() });
105
+ renderer.hydrate(compiled, document.getElementById('app')!); // reuses server DOM
106
+ ```
107
+
108
+ ## Subpath entries
109
+
110
+ | Import | What it gives you |
111
+ | --------------------- | ------------------------------------------------------ |
112
+ | `streetui` | The full framework: reactivity, DSL, compiler, graph, runtime, renderer, router, forms, context, i18n, devtools, SSR + hydration. |
113
+ | `streetui/server` | A curated server-rendering subset (`renderToString`, `serializeState`, `readState`, `ServerDOMAdapter`). |
114
+ | `streetui/testing` | Testing utilities (`render`, `findByRole`, `waitFor`, …). |
115
+
116
+ ## What's inside (and why you don't have to think about it)
117
+
118
+ Reactivity (signals, derived, effects, batching, stores, resources), the
119
+ semantic DSL and compiler, the semantic application graph, the runtime, a
120
+ keyed DOM reconciler with no virtual DOM, the router, forms and validators,
121
+ context, i18n, SSR, hydration, devtools, and the CLI are all implemented as
122
+ internal modules and bundled into this one package. You get the whole framework
123
+ from `npm install streetui`.
124
+
125
+ ## License
126
+
127
+ MIT — see [LICENSE](./LICENSE).