uniweb 0.2.22 → 0.2.23

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 CHANGED
@@ -29,10 +29,10 @@ my-project/
29
29
  │ │ └── home/
30
30
  │ │ ├── page.yml # Page metadata
31
31
  │ │ └── 1-hero.md # Section content
32
- │ ├── locales/ # i18n (mirrors pages/)
33
- │ │ └── es/
34
- ├── src/
35
- │ └── main.jsx # 1-line entry point
32
+ │ ├── locales/ # i18n (hash-based translations)
33
+ │ │ ├── manifest.json # Auto-extracted strings
34
+ │ └── es.json # Spanish translations
35
+ ├── main.js # 1-line entry point
36
36
  │ ├── vite.config.js # 3-line config
37
37
  │ └── public/ # Static assets
38
38
 
@@ -86,14 +86,19 @@ Components receive validated, localized data. Natural content stays in markdown;
86
86
  export function Hero({ content, params }) {
87
87
  const { title } = content.main.header;
88
88
  const { paragraphs, links } = content.main.body;
89
- const { theme = 'light' } = params;
89
+ const { theme = "light" } = params;
90
90
 
91
91
  return (
92
- <section className={`py-20 text-center ${theme === 'dark' ? 'bg-gray-900 text-white' : ''}`}>
92
+ <section
93
+ className={`py-20 text-center ${theme === "dark" ? "bg-gray-900 text-white" : ""}`}
94
+ >
93
95
  <h1 className="text-4xl font-bold">{title}</h1>
94
96
  <p className="text-xl text-gray-600">{paragraphs[0]}</p>
95
97
  {links[0] && (
96
- <a href={links[0].url} className="mt-8 px-6 py-3 bg-blue-600 text-white rounded inline-block">
98
+ <a
99
+ href={links[0].url}
100
+ className="mt-8 px-6 py-3 bg-blue-600 text-white rounded inline-block"
101
+ >
97
102
  {links[0].text}
98
103
  </a>
99
104
  )}
@@ -102,26 +107,9 @@ export function Hero({ content, params }) {
102
107
  }
103
108
  ```
104
109
 
105
- Standard React. Standard Tailwind. The `{ content, params }` interface is only for *exposed* components—the ones content creators select in markdown frontmatter. Internal components (the majority of your codebase) use regular React props.
110
+ Standard React. Standard Tailwind. The `{ content, params }` interface is only for _exposed_ components—the ones content creators select in markdown frontmatter. Internal components (the majority of your codebase) use regular React props.
106
111
 
107
- No framework to learn. Foundations are purpose-built component systems designed for a specific domain (marketing, documentation, learning, etc.). Sites are Vite apps that load content from markdown files. Configuration is minimal—both site and foundation use 3-line Vite configs:
108
-
109
- ```javascript
110
- // site/vite.config.js
111
- import { defineSiteConfig } from '@uniweb/build/site'
112
- export default defineSiteConfig()
113
-
114
- // foundation/vite.config.js
115
- import { defineFoundationConfig } from '@uniweb/build'
116
- export default defineFoundationConfig()
117
- ```
118
-
119
- The site entry point is equally minimal:
120
-
121
- ```javascript
122
- // site/src/main.jsx
123
- import 'virtual:uniweb-site-entry'
124
- ```
112
+ No framework to learn. Foundations are purpose-built component systems designed for a specific domain (marketing, documentation, learning, etc.). Sites are Vite apps that load content from markdown files.
125
113
 
126
114
  ## The Bigger Picture
127
115
 
@@ -146,6 +134,7 @@ npm install -g uniweb
146
134
  ```
147
135
 
148
136
  **Requirements:**
137
+
149
138
  - Node.js 20.19 or later
150
139
  - pnpm 9+ (recommended) or npm 10+
151
140
 
@@ -163,19 +152,19 @@ uniweb create [project-name] [options]
163
152
 
164
153
  **Options:**
165
154
 
166
- | Option | Description |
167
- | ------------------- | ------------------------------------- |
168
- | `--template <type>` | Project template (see below) |
155
+ | Option | Description |
156
+ | ------------------- | ---------------------------- |
157
+ | `--template <type>` | Project template (see below) |
169
158
 
170
159
  **Template Sources:**
171
160
 
172
- | Source | Example | Description |
173
- | ------ | ------- | ----------- |
174
- | Built-in | `single`, `multi` | Minimal starter templates |
175
- | Official | `marketing` | Feature-rich showcase templates |
176
- | npm | `@org/my-template` | Published npm packages |
177
- | GitHub | `github:user/repo` | GitHub repositories |
178
- | GitHub URL | `https://github.com/user/repo` | Full GitHub URLs |
161
+ | Source | Example | Description |
162
+ | ---------- | ------------------------------ | ------------------------------- |
163
+ | Built-in | `single`, `multi` | Minimal starter templates |
164
+ | Official | `marketing` | Feature-rich showcase templates |
165
+ | npm | `@org/my-template` | Published npm packages |
166
+ | GitHub | `github:user/repo` | GitHub repositories |
167
+ | GitHub URL | `https://github.com/user/repo` | Full GitHub URLs |
179
168
 
180
169
  **Examples:**
181
170
 
@@ -233,11 +222,9 @@ uniweb build --target site
233
222
  uniweb build --platform vercel
234
223
  ```
235
224
 
236
- ## Project Templates
237
-
238
- ### Built-in Templates
225
+ ## Built-in Templates
239
226
 
240
- #### Single (Default)
227
+ ### Single (Default)
241
228
 
242
229
  A minimal workspace with a site and foundation as sibling packages. This is the recommended starting point.
243
230
 
@@ -249,11 +236,10 @@ my-project/
249
236
 
250
237
  ├── site/ # Site package (content + entry)
251
238
  │ ├── package.json
252
- │ ├── vite.config.js # 3-line config using defineSiteConfig()
239
+ │ ├── vite.config.js # 3-line config
253
240
  │ ├── index.html
254
241
  │ ├── site.yml # Site configuration (foundation, title, i18n)
255
- │ ├── src/
256
- │ │ └── main.jsx # 1-line entry: import 'virtual:uniweb-site-entry'
242
+ │ ├── main.js # 1-line entry point
257
243
  │ ├── pages/ # Content pages (file-based routing)
258
244
  │ │ └── home/
259
245
  │ │ ├── page.yml
@@ -262,7 +248,7 @@ my-project/
262
248
 
263
249
  └── foundation/ # Foundation package (components)
264
250
  ├── package.json
265
- ├── vite.config.js # 3-line config using defineFoundationConfig()
251
+ ├── vite.config.js # 3-line config
266
252
  └── src/
267
253
  ├── index.js # Component exports
268
254
  ├── entry-runtime.js # Runtime entry (imports styles + index)
@@ -281,7 +267,7 @@ my-project/
281
267
  - **Zero extraction** — `foundation/` is already a complete, publishable package
282
268
  - **Scales naturally** — Rename to `sites/marketing/` and `foundations/marketing/` when needed
283
269
 
284
- #### Multi
270
+ ### Multi
285
271
 
286
272
  A monorepo for multi-site or multi-foundation development.
287
273
 
@@ -296,7 +282,7 @@ my-workspace/
296
282
  │ │ ├── package.json
297
283
  │ │ ├── vite.config.js # 3-line config
298
284
  │ │ ├── site.yml
299
- │ │ ├── src/main.jsx # 1-line entry
285
+ │ │ ├── main.js # 1-line entry point
300
286
  │ │ └── pages/
301
287
  │ └── docs/ # Documentation site
302
288
 
@@ -314,11 +300,11 @@ Use this when you need:
314
300
  - Multiple foundations for different purposes
315
301
  - A testing site for foundation development
316
302
 
317
- ### Official Templates
303
+ ## Official Templates
318
304
 
319
305
  Feature-rich templates that demonstrate what's possible with Uniweb. These include real components, sample content, and production-ready structure.
320
306
 
321
- #### Marketing
307
+ ### Marketing
322
308
 
323
309
  A complete marketing site with landing page components:
324
310
 
@@ -331,11 +317,12 @@ uniweb create my-site --template marketing
331
317
  Perfect for product launches, SaaS websites, and business landing pages.
332
318
 
333
319
  **Tailwind v3 variant:**
320
+
334
321
  ```bash
335
322
  uniweb create my-site --template marketing --variant tailwind3
336
323
  ```
337
324
 
338
- #### Academic
325
+ ### Academic
339
326
 
340
327
  A professional academic site for researchers, labs, and departments:
341
328
 
@@ -347,7 +334,7 @@ uniweb create my-site --template academic
347
334
 
348
335
  Perfect for researcher portfolios, lab websites, and academic department sites.
349
336
 
350
- #### Docs
337
+ ### Docs
351
338
 
352
339
  A documentation site with navigation levels:
353
340
 
@@ -359,7 +346,7 @@ uniweb create my-site --template docs
359
346
 
360
347
  Perfect for technical documentation, guides, and API references.
361
348
 
362
- ### External Templates
349
+ ## External Templates
363
350
 
364
351
  You can use templates from npm or GitHub:
365
352
 
@@ -406,14 +393,14 @@ cd foundation && pnpm add embla-carousel
406
393
  The `defineSiteConfig()` function handles all Vite configuration for sites:
407
394
 
408
395
  ```javascript
409
- import { defineSiteConfig } from '@uniweb/build/site'
396
+ import { defineSiteConfig } from "@uniweb/build/site";
410
397
 
411
398
  export default defineSiteConfig({
412
399
  // All options are optional
413
- tailwind: true, // Enable Tailwind CSS v4 (default: true)
414
- plugins: [], // Additional Vite plugins
400
+ tailwind: true, // Enable Tailwind CSS v4 (default: true)
401
+ plugins: [], // Additional Vite plugins
415
402
  // ...any other Vite config options
416
- })
403
+ });
417
404
  ```
418
405
 
419
406
  ### Foundation Configuration
@@ -421,28 +408,28 @@ export default defineSiteConfig({
421
408
  The `defineFoundationConfig()` function handles all Vite configuration for foundations:
422
409
 
423
410
  ```javascript
424
- import { defineFoundationConfig } from '@uniweb/build'
411
+ import { defineFoundationConfig } from "@uniweb/build";
425
412
 
426
413
  export default defineFoundationConfig({
427
414
  // All options are optional
428
- entry: 'src/entry-runtime.js', // Entry point path
429
- fileName: 'foundation', // Output file name
430
- externals: [], // Additional packages to externalize
431
- includeDefaultExternals: true, // Include react, @uniweb/core, etc.
432
- tailwind: true, // Enable Tailwind CSS v4 Vite plugin
433
- sourcemap: true, // Generate sourcemaps
434
- plugins: [], // Additional Vite plugins
435
- build: {}, // Additional Vite build options
415
+ entry: "src/entry-runtime.js", // Entry point path
416
+ fileName: "foundation", // Output file name
417
+ externals: [], // Additional packages to externalize
418
+ includeDefaultExternals: true, // Include react, @uniweb/core, etc.
419
+ tailwind: true, // Enable Tailwind CSS v4 Vite plugin
420
+ sourcemap: true, // Generate sourcemaps
421
+ plugins: [], // Additional Vite plugins
422
+ build: {}, // Additional Vite build options
436
423
  // ...any other Vite config options
437
- })
424
+ });
438
425
  ```
439
426
 
440
427
  For Tailwind CSS v3 projects, set `tailwind: false` and use PostCSS:
441
428
 
442
429
  ```javascript
443
430
  export default defineFoundationConfig({
444
- tailwind: false // Uses PostCSS instead of Vite plugin
445
- })
431
+ tailwind: false, // Uses PostCSS instead of Vite plugin
432
+ });
446
433
  ```
447
434
 
448
435
  ## Foundation Build Process
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,9 +36,9 @@
36
36
  "js-yaml": "^4.1.0",
37
37
  "prompts": "^2.4.2",
38
38
  "tar": "^7.0.0",
39
- "@uniweb/core": "0.1.6",
40
39
  "@uniweb/build": "0.1.9",
41
- "@uniweb/runtime": "0.2.3",
42
- "@uniweb/kit": "0.1.4"
40
+ "@uniweb/kit": "0.1.4",
41
+ "@uniweb/core": "0.1.6",
42
+ "@uniweb/runtime": "0.2.3"
43
43
  }
44
44
  }
@@ -34,7 +34,7 @@ cd site && pnpm build
34
34
 
35
35
  **Site:**
36
36
  - `site/vite.config.js` - 3-line config using `defineSiteConfig()` from `@uniweb/build/site`
37
- - `site/src/main.jsx` - 1-line entry: `import 'virtual:uniweb-site-entry'`
37
+ - `site/main.js` - 1-line entry: `import 'virtual:uniweb-site-entry'`
38
38
  - `site/site.yml` - Site configuration (foundation path, title, i18n)
39
39
  - `site/pages/` - Content pages (file-based routing)
40
40
 
@@ -73,7 +73,7 @@ pnpm build:all
73
73
 
74
74
  **Sites:**
75
75
  - `sites/*/vite.config.js` - 3-line config using `defineSiteConfig()` from `@uniweb/build/site`
76
- - `sites/*/src/main.jsx` - 1-line entry: `import 'virtual:uniweb-site-entry'`
76
+ - `sites/*/main.js` - 1-line entry: `import 'virtual:uniweb-site-entry'`
77
77
  - `sites/*/site.yml` - Site configuration (foundation reference, title, i18n)
78
78
  - `sites/*/pages/` - Content pages (file-based routing)
79
79
 
@@ -26,7 +26,7 @@ Visit `http://localhost:5173` to see your site.
26
26
  │ └── main/ # Main site
27
27
  │ ├── pages/
28
28
  │ ├── site.yml
29
- │ ├── src/main.jsx
29
+ │ ├── main.js
30
30
  │ └── vite.config.js
31
31
 
32
32
  ├── CLAUDE.md # AI assistant instructions
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
11
- <script type="module" src="/src/main.jsx"></script>
11
+ <script type="module" src="/main.js"></script>
12
12
  </body>
13
13
  </html>
@@ -14,6 +14,6 @@
14
14
  <div id="root">
15
15
  <div class="loading">Loading...</div>
16
16
  </div>
17
- <script type="module" src="/src/main.jsx"></script>
17
+ <script type="module" src="/main.js"></script>
18
18
  </body>
19
19
  </html>
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
11
- <script type="module" src="/src/main.jsx"></script>
11
+ <script type="module" src="/main.js"></script>
12
12
  </body>
13
13
  </html>
File without changes