uniweb 0.56.12 → 0.57.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/package.json +8 -8
- package/partials/agents.md +10 -0
- package/src/commands/build.js +9 -1
- package/src/commands/i18n.js +34 -8
- package/src/framework-index.json +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"js-yaml": "^4.1.0",
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
|
-
"@uniweb/content-writer": "^0.3.4",
|
|
45
|
-
"@uniweb/core": "^0.29.4",
|
|
46
|
-
"@uniweb/runtime": "^0.26.4",
|
|
47
44
|
"@uniweb/semantic-parser": "^1.4.1",
|
|
48
|
-
"@uniweb/
|
|
49
|
-
"@uniweb/
|
|
45
|
+
"@uniweb/schemas": "^0.3.3",
|
|
46
|
+
"@uniweb/core": "^0.29.4",
|
|
47
|
+
"@uniweb/content-writer": "^0.3.4",
|
|
48
|
+
"@uniweb/runtime": "^0.26.5",
|
|
49
|
+
"@uniweb/kit": "^0.19.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@uniweb/build": "^0.52.7",
|
|
53
52
|
"@uniweb/content-reader": "^1.2.5",
|
|
54
|
-
"@uniweb/semantic-parser": "^1.4.1"
|
|
53
|
+
"@uniweb/semantic-parser": "^1.4.1",
|
|
54
|
+
"@uniweb/build": "^0.53.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"@uniweb/build": {
|
package/partials/agents.md
CHANGED
|
@@ -1344,6 +1344,16 @@ Components use **semantic CSS tokens** instead of hardcoded colors. The runtime
|
|
|
1344
1344
|
|
|
1345
1345
|
**Palette shades** are also available — `text-primary-600`, `bg-neutral-100`, `border-accent-300` — 11 shades (50–950) per palette color (primary, secondary, accent, neutral). See `theme-tokens.css` for the complete mapping.
|
|
1346
1346
|
|
|
1347
|
+
> **Debugging a token that "does nothing": don't probe it in the browser.** Tailwind v4 is JIT — it emits only the classes it finds in *scanned source*. So a class you assign from JavaScript, to a `<div>` you created in the console, **has never been scanned and can never resolve**, whatever the token. A comparison against a deliberately bogus class agrees with you either way, because both are ungenerated, and classes that happen to appear in source elsewhere look like they "pass" — so the probe confirms whichever answer you started with.
|
|
1348
|
+
>
|
|
1349
|
+
> **Ask the build instead.** The one command that splits the question:
|
|
1350
|
+
>
|
|
1351
|
+
> ```bash
|
|
1352
|
+
> grep -o '\.text-link{[^}]*}' dist/assets/*.css
|
|
1353
|
+
> ```
|
|
1354
|
+
>
|
|
1355
|
+
> A rule prints → the utility exists, and something at runtime is overriding it. Nothing prints → Tailwind never generated it, and there are only two reasons: your `styles.css` doesn't `@import "@uniweb/kit/theme-tokens.css"` (or declares its own `@theme inline` that omits the token), or your `@source` globs don't cover the file the class is written in. Either way, write the class into a real source file first — a token that's only ever composed at runtime is invisible to the scanner by design.
|
|
1356
|
+
|
|
1347
1357
|
**Authors control context** via `theme: dark` in frontmatter, alternating `light` (default), `medium`, and `dark` across sections for visual rhythm. **The three presets aren't the limit** — the object form overrides any token per section:
|
|
1348
1358
|
|
|
1349
1359
|
```yaml
|
package/src/commands/build.js
CHANGED
|
@@ -414,10 +414,18 @@ async function loadI18nConfig(projectDir, siteConfig = null) {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
+
// ⛔ The default locale is the root tree, not `dist/<default>/`. An explicit
|
|
418
|
+
// `languages: [en, fr]` resolves verbatim — default included — so the DECLARED
|
|
419
|
+
// form (the one the contract tells authors to use) minted a duplicate copy of
|
|
420
|
+
// every page, while the wildcard form did not. Dropping it here keeps content,
|
|
421
|
+
// per-locale HTML and translated records agreeing on one set.
|
|
422
|
+
const defaultLocale = resolveDefaultLocale(config)
|
|
423
|
+
locales = locales.filter((l) => l !== defaultLocale)
|
|
424
|
+
|
|
417
425
|
if (locales.length === 0) return null
|
|
418
426
|
|
|
419
427
|
return {
|
|
420
|
-
defaultLocale
|
|
428
|
+
defaultLocale,
|
|
421
429
|
locales,
|
|
422
430
|
localesDir
|
|
423
431
|
}
|
package/src/commands/i18n.js
CHANGED
|
@@ -372,6 +372,26 @@ async function runExtract(siteRoot, config, args) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
/**
|
|
376
|
+
* The starter value a translator is handed for one unit.
|
|
377
|
+
*
|
|
378
|
+
* ⭐ `unit.markup` when the element carries inline markdown, `unit.source` otherwise.
|
|
379
|
+
* `source` is the flattened plain text — it is the KEY, and it is what this function
|
|
380
|
+
* used to seed. That meant a paragraph's links, bold and emphasis were already gone
|
|
381
|
+
* from the file a translator opened, and a translator cannot restore what they were
|
|
382
|
+
* never shown: a 100%-covered locale rendered with zero inline links and no check
|
|
383
|
+
* reported it (coverage counts keys, not fidelity). `merge` has always parsed a
|
|
384
|
+
* translation value as inline markdown, so the value channel was lossless the whole
|
|
385
|
+
* time — only the prompt was lossy. Measured 2026-09-18, @uniweb/build 0.44.4.
|
|
386
|
+
*
|
|
387
|
+
* ⚠️ This fills MISSING keys only. A locale file already seeded from the flat source
|
|
388
|
+
* is not repaired by re-running; use `uniweb i18n generate <locale> --force` against
|
|
389
|
+
* a freshly extracted manifest to get the markup-bearing source back.
|
|
390
|
+
*/
|
|
391
|
+
function starterValue(unit) {
|
|
392
|
+
return unit.markup || unit.source
|
|
393
|
+
}
|
|
394
|
+
|
|
375
395
|
/**
|
|
376
396
|
* Generate command - generate starter translation files from manifest
|
|
377
397
|
*
|
|
@@ -451,7 +471,7 @@ async function runInit(siteRoot, config, args) {
|
|
|
451
471
|
|
|
452
472
|
for (const [hash, unit] of Object.entries(units)) {
|
|
453
473
|
if (!existingKeys.has(hash)) {
|
|
454
|
-
existing[hash] = useEmpty ? '' : unit
|
|
474
|
+
existing[hash] = useEmpty ? '' : starterValue(unit)
|
|
455
475
|
added++
|
|
456
476
|
}
|
|
457
477
|
}
|
|
@@ -470,7 +490,7 @@ async function runInit(siteRoot, config, args) {
|
|
|
470
490
|
const localeData = {}
|
|
471
491
|
|
|
472
492
|
for (const [hash, unit] of Object.entries(units)) {
|
|
473
|
-
localeData[hash] = useEmpty ? '' : unit
|
|
493
|
+
localeData[hash] = useEmpty ? '' : starterValue(unit)
|
|
474
494
|
}
|
|
475
495
|
|
|
476
496
|
await writeFile(localePath, JSON.stringify(localeData, null, 2) + '\n')
|
|
@@ -962,17 +982,23 @@ async function runAudit(siteRoot, config, args) {
|
|
|
962
982
|
}
|
|
963
983
|
}
|
|
964
984
|
|
|
965
|
-
// Report
|
|
966
|
-
|
|
967
|
-
|
|
985
|
+
// ⭐ Report translations that will render as flat prose.
|
|
986
|
+
// Coverage cannot see this class — it counts keys, not fidelity — so a site
|
|
987
|
+
// whose every link has been flattened reports 100%. That is exactly how a
|
|
988
|
+
// fully translated documentation site shipped with zero internal links.
|
|
989
|
+
const losesMarkupTotal = results.reduce(
|
|
990
|
+
(sum, r) => sum + (r.losesMarkup?.length || 0),
|
|
968
991
|
0
|
|
969
992
|
)
|
|
970
|
-
if (
|
|
993
|
+
if (losesMarkupTotal > 0) {
|
|
994
|
+
log(
|
|
995
|
+
`\n${colors.yellow}${losesMarkupTotal} translation(s) drop the inline markup their source carries.`
|
|
996
|
+
)
|
|
971
997
|
log(
|
|
972
|
-
|
|
998
|
+
`Links, bold and emphasis will be missing from these — a translation value is`
|
|
973
999
|
)
|
|
974
1000
|
log(
|
|
975
|
-
`
|
|
1001
|
+
`inline markdown, so copy the [text](href) and ** ** across from the source.${colors.reset}`
|
|
976
1002
|
)
|
|
977
1003
|
if (!verbose) {
|
|
978
1004
|
log(
|
package/src/framework-index.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-09-
|
|
3
|
+
"generatedAt": "2026-09-18T17:09:07.963Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/api": {
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.4.0",
|
|
7
7
|
"path": "framework/api",
|
|
8
8
|
"deps": [
|
|
9
9
|
"@uniweb/core"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
"@uniweb/build": {
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.53.0",
|
|
14
14
|
"path": "framework/build",
|
|
15
15
|
"deps": [
|
|
16
16
|
"@uniweb/content-reader",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
"@uniweb/runtime": {
|
|
86
|
-
"version": "0.26.
|
|
86
|
+
"version": "0.26.5",
|
|
87
87
|
"path": "framework/runtime",
|
|
88
88
|
"deps": [
|
|
89
89
|
"@uniweb/core",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"deps": []
|
|
127
127
|
},
|
|
128
128
|
"@uniweb/unipress": {
|
|
129
|
-
"version": "0.9.
|
|
129
|
+
"version": "0.9.23",
|
|
130
130
|
"path": "framework/unipress",
|
|
131
131
|
"deps": [
|
|
132
132
|
"@uniweb/build",
|