uniweb 0.6.20 → 0.6.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,9 +40,9 @@
40
40
  "js-yaml": "^4.1.0",
41
41
  "prompts": "^2.4.2",
42
42
  "tar": "^7.0.0",
43
+ "@uniweb/kit": "0.5.11",
44
+ "@uniweb/build": "0.6.19",
43
45
  "@uniweb/core": "0.4.7",
44
- "@uniweb/kit": "0.5.10",
45
- "@uniweb/build": "0.6.17",
46
- "@uniweb/runtime": "0.5.21"
46
+ "@uniweb/runtime": "0.5.22"
47
47
  }
48
48
  }
@@ -143,11 +143,12 @@ Components that render their own background declare `background: 'self'` in `met
143
143
  ### Page Organization
144
144
 
145
145
  ```
146
+ site/layout/
147
+ ├── header.md # type: Header — rendered on every page
148
+ ├── footer.md # type: Footer — rendered on every page
149
+ └── left.md # type: LeftPanel — optional sidebar
150
+
146
151
  site/pages/
147
- ├── @header/ # Rendered on every page
148
- │ └── header.md # type: Header
149
- ├── @footer/ # Rendered on every page
150
- │ └── footer.md # type: Footer
151
152
  └── home/
152
153
  ├── page.yml # title, description, order
153
154
  ├── hero.md # Single section — no prefix needed
@@ -167,16 +168,19 @@ Decimals insert between: `2.5-testimonials.md` goes between `2-` and `3-`.
167
168
  ```yaml
168
169
  title: About Us
169
170
  description: Learn about our company
170
- order: 2 # Navigation sort order
171
+ order: 2 # Navigation sort position
172
+ pages: [team, history, ...] # Child page order (... = rest). Without ... = strict (hides unlisted)
171
173
  index: getting-started # Which child page is the index
172
174
  ```
173
175
 
174
176
  **site.yml:**
175
177
  ```yaml
176
- index: home # Which page folder is the homepage
178
+ index: home # Just set the homepage
179
+ pages: [home, about, ...] # Order pages (... = rest, first = homepage)
180
+ pages: [home, about] # Strict: only listed pages in nav
177
181
  ```
178
182
 
179
- Use `index:` rather than `pages: [...]` listing pages explicitly hides auto-discovered ones.
183
+ Use `pages:` with `...` for ordering, without `...` for strict visibility control. Use `index:` for simple homepage selection.
180
184
 
181
185
  ## Semantic Theming
182
186
 
@@ -237,24 +237,20 @@ async function runExtract(siteRoot, config, args) {
237
237
  if (!collectionsOnly) {
238
238
  log(`\n${colors.cyan}Extracting translatable content${dryRun ? ' (dry run)' : ''}...${colors.reset}\n`)
239
239
 
240
- // Check if site has been built
241
- const siteContentPath = join(siteRoot, 'dist', 'site-content.json')
242
- if (!existsSync(siteContentPath)) {
243
- error('Site content not found. Run "uniweb build" first.')
244
- process.exit(1)
245
- }
246
-
247
240
  try {
248
- // Dynamic import to avoid loading at CLI startup
241
+ // Collect site content directly from source files (no build required)
242
+ const { collectSiteContent } = await import('@uniweb/build/site')
249
243
  const { extractManifest, formatSyncReport } = await import('@uniweb/build/i18n')
250
244
 
245
+ log(`${colors.dim}Collecting site content...${colors.reset}`)
246
+ const siteContent = await collectSiteContent(siteRoot)
247
+
251
248
  // Check if this is a first-time extract (no previous manifest)
252
249
  const manifestPath = join(siteRoot, config.localesDir, 'manifest.json')
253
250
  const isUpdate = existsSync(manifestPath)
254
251
 
255
- const { manifest, report } = await extractManifest(siteRoot, {
252
+ const { manifest, report } = await extractManifest(siteRoot, siteContent, {
256
253
  localesDir: config.localesDir,
257
- siteContentPath,
258
254
  verbose,
259
255
  dryRun,
260
256
  })
@@ -1466,11 +1462,10 @@ ${colors.bright}Configuration:${colors.reset}
1466
1462
  By default, all *.json files in locales/ are treated as translation targets.
1467
1463
 
1468
1464
  ${colors.bright}Workflow:${colors.reset}
1469
- 1. Build your site: uniweb build
1470
- 2. Extract strings: uniweb i18n extract
1471
- 3. Generate locale files: uniweb i18n generate es fr
1472
- 4. Translate locale files: Edit locales/es.json, locales/fr.json, etc.
1473
- 5. Build with translations: uniweb build (generates locale-specific output)
1465
+ 1. Extract strings: uniweb i18n extract
1466
+ 2. Generate locale files: uniweb i18n generate es fr
1467
+ 3. Translate locale files: Edit locales/es.json, locales/fr.json, etc.
1468
+ 4. Build with translations: uniweb build (generates locale-specific output)
1474
1469
 
1475
1470
  ${colors.bright}File Structure:${colors.reset}
1476
1471
  locales/