@sprig-and-prose/sprig-ui-csr 0.1.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.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # sprig-ui-csr
2
+
3
+ A Client-Side Rendering (CSR) version of sprig-universe-ui. This is a plain Svelte application served by a simple Node.js HTTP server.
4
+
5
+ ## Overview
6
+
7
+ This application serves a Svelte app via Node's native `http` package. The server handles three route patterns:
8
+
9
+ - `/_ui/*` - Serves UI assets from the Vite build output
10
+ - `/api/manifest` - Serves `manifest.json` from the current directory (or configured path)
11
+ - Everything else - Serves `index.html` for client-side routing
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install
17
+ ```
18
+
19
+ ## Development
20
+
21
+ Build the Svelte app:
22
+
23
+ ```bash
24
+ npm run build
25
+ ```
26
+
27
+ Start the server:
28
+
29
+ ```bash
30
+ npm start
31
+ ```
32
+
33
+ Or use the CLI directly:
34
+
35
+ ```bash
36
+ node src/cli.js
37
+ ```
38
+
39
+ The server will be available at `http://localhost:5173` (or the configured port).
40
+
41
+ ### CLI Options
42
+
43
+ ```bash
44
+ # Use default port (5173) and manifest path (./manifest.json)
45
+ sprig-ui-csr
46
+
47
+ # Specify a custom port
48
+ sprig-ui-csr --port 3000
49
+ # or
50
+ sprig-ui-csr -p 3000
51
+
52
+ # Specify a custom manifest path
53
+ sprig-ui-csr --manifest ./custom-manifest.json
54
+ # or
55
+ sprig-ui-csr -m ./custom-manifest.json
56
+
57
+ # Combine options
58
+ sprig-ui-csr -p 8080 -m ./data/manifest.json
59
+
60
+ # Show help
61
+ sprig-ui-csr --help
62
+ ```
63
+
64
+ ### Other Commands
65
+
66
+ ```bash
67
+ # Format code
68
+ npm run format
69
+
70
+ # Lint code
71
+ npm run lint
72
+
73
+ # Type check (JSDoc types)
74
+ npm run typecheck
75
+
76
+ # Build for production
77
+ npm run build
78
+ ```
79
+
80
+ ## Project Structure
81
+
82
+ ```
83
+ sprig-ui-csr/
84
+ ├── package.json
85
+ ├── biome.json
86
+ ├── tsconfig.json
87
+ ├── vite.config.js
88
+ ├── index.html
89
+ ├── src/
90
+ │ ├── main.js # Svelte app entry point
91
+ │ ├── App.svelte # Root Svelte component
92
+ │ ├── server.js # HTTP server implementation
93
+ │ ├── cli.js # CLI entry point
94
+ │ └── styles/
95
+ │ └── app.css # Global styles
96
+ └── dist/ # Vite build output (served as /_ui/*)
97
+ ```
98
+
99
+ ## Technologies
100
+
101
+ - **Svelte 5**: Component framework
102
+ - **Vite 6**: Build tool
103
+ - **TypeScript 5.7**: Type checking (via JSDoc annotations)
104
+ - **Biome 2.3**: Linting and formatting
105
+ - **Node.js HTTP**: Native HTTP server (no framework dependencies)
106
+
107
+ ## Configuration
108
+
109
+ - **TypeScript**: Configured in `tsconfig.json` for type checking only (no compilation)
110
+ - **Biome**: Configured in `biome.json` (formats JS/TS, ignores Svelte files)
111
+ - **Vite**: Configured in `vite.config.js` (builds Svelte app with base path `/_ui/`)
112
+
113
+ ## Manifest API
114
+
115
+ The `/api/manifest` endpoint serves the `manifest.json` file from the current working directory (or a configured path). If the file doesn't exist, it returns a 404 error.
116
+
117
+ ## License
118
+
119
+ ISC
120
+
package/biome.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3
+ "files": {
4
+ "ignoreUnknown": true
5
+ },
6
+ "overrides": [
7
+ {
8
+ "includes": ["**/*.svelte"],
9
+ "linter": { "enabled": false },
10
+ "formatter": { "enabled": false }
11
+ },
12
+ {
13
+ "includes": ["dist/**"],
14
+ "linter": { "enabled": false },
15
+ "formatter": { "enabled": false }
16
+ }
17
+ ],
18
+ "assist": { "actions": { "source": { "organizeImports": "on" } } },
19
+ "linter": {
20
+ "enabled": true,
21
+ "rules": {
22
+ "recommended": true
23
+ }
24
+ },
25
+ "formatter": {
26
+ "enabled": true,
27
+ "indentStyle": "space",
28
+ "indentWidth": 2
29
+ },
30
+ "javascript": {
31
+ "formatter": {
32
+ "quoteStyle": "single",
33
+ "semicolons": "always"
34
+ }
35
+ }
36
+ }
37
+
package/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>sprig universe</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.js"></script>
11
+ </body>
12
+ </html>