uniweb 0.48.1 → 0.48.3
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 +5 -5
- package/partials/agents.md +3 -2
- package/src/commands/doctor.js +17 -7
- package/src/commands/publish.js +0 -2
- package/src/framework-index.json +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.3",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"js-yaml": "^4.1.0",
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
|
-
"@uniweb/core": "^0.24.
|
|
45
|
-
"@uniweb/kit": "^0.18.0",
|
|
44
|
+
"@uniweb/core": "^0.24.3",
|
|
46
45
|
"@uniweb/semantic-parser": "^1.4.0",
|
|
47
|
-
"@uniweb/runtime": "^0.19.
|
|
46
|
+
"@uniweb/runtime": "^0.19.4",
|
|
47
|
+
"@uniweb/kit": "^0.18.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@uniweb/build": "^0.44.
|
|
50
|
+
"@uniweb/build": "^0.44.2",
|
|
51
51
|
"@uniweb/content-reader": "^1.2.4",
|
|
52
52
|
"@uniweb/semantic-parser": "^1.4.0"
|
|
53
53
|
},
|
package/partials/agents.md
CHANGED
|
@@ -2317,9 +2317,10 @@ npm install @uniweb/api # in the FOUNDATION, beside @uniweb/kit
|
|
|
2317
2317
|
### Ask before you draw
|
|
2318
2318
|
|
|
2319
2319
|
```jsx
|
|
2320
|
-
import {
|
|
2320
|
+
import { isApiEnabled } from '@uniweb/kit'
|
|
2321
|
+
import { useSession, SignedIn, SignedOut } from '@uniweb/api'
|
|
2321
2322
|
|
|
2322
|
-
if (!
|
|
2323
|
+
if (!isApiEnabled()) return <StaticVersion /> // synchronous — nothing to await
|
|
2323
2324
|
```
|
|
2324
2325
|
|
|
2325
2326
|
⛔ **When there is no backend, draw nothing** — not a disabled control, and not an
|
package/src/commands/doctor.js
CHANGED
|
@@ -506,13 +506,13 @@ export async function checkFoundationSupports({
|
|
|
506
506
|
* box that searches nothing, a form whose answers have nowhere to go.
|
|
507
507
|
*/
|
|
508
508
|
const SERVICE_GATES = [
|
|
509
|
-
{ hook: 'useFormSubmit', gate: 'canSubmit', draws: 'a form' },
|
|
510
|
-
{ hook: 'useSearch', gate: 'isEnabled', draws: 'a search control' },
|
|
511
|
-
{ hook: 'useSearchIndex', gate: 'isEnabled', draws: 'a search control' },
|
|
509
|
+
{ hook: 'useFormSubmit', gate: 'canSubmit', alt: 'isSubmitEnabled', draws: 'a form' },
|
|
510
|
+
{ hook: 'useSearch', gate: 'isEnabled', alt: 'isSearchEnabled', draws: 'a search control' },
|
|
511
|
+
{ hook: 'useSearchIndex', gate: 'isEnabled', alt: 'isSearchEnabled', draws: 'a search control' },
|
|
512
512
|
// Returns everything `useSearch` does, `isEnabled` included, so it gates the
|
|
513
513
|
// same way. It was missing from this list until the hook was renamed out of
|
|
514
514
|
// `useSearchWithIntent` — the kind of gap a list of names grows quietly.
|
|
515
|
-
{ hook: 'useSearchPrefetch', gate: 'isEnabled', draws: 'a search control' },
|
|
515
|
+
{ hook: 'useSearchPrefetch', gate: 'isEnabled', alt: 'isSearchEnabled', draws: 'a search control' },
|
|
516
516
|
]
|
|
517
517
|
|
|
518
518
|
/**
|
|
@@ -535,7 +535,12 @@ const SERVICE_GATES = [
|
|
|
535
535
|
*
|
|
536
536
|
* - it is **local to one file** — the hook call and its gate are in the same
|
|
537
537
|
* component, in the developer's own source, with no indirection to follow;
|
|
538
|
-
* - the gate names are **fixed by kit's API**, not inferred
|
|
538
|
+
* - the gate names are **fixed by kit's API**, not inferred — with one caveat
|
|
539
|
+
* that used to be a live false negative: `isEnabled` is a hook's returned
|
|
540
|
+
* field AND, until 2026-09-10, an `@uniweb/api` export. A component holding
|
|
541
|
+
* both read as gated. `@uniweb/kit`'s `is<Service>Enabled()` predicates are
|
|
542
|
+
* unique per subject, so `alt` below is matched instead and the collision
|
|
543
|
+
* cannot recur;
|
|
539
544
|
* - it only ever **warns**, and changes no artifact. A miss costs a missing
|
|
540
545
|
* warning, which is the safe direction.
|
|
541
546
|
*
|
|
@@ -568,11 +573,15 @@ export function checkUngatedServiceControls({ foundationName, folderName, srcDir
|
|
|
568
573
|
|
|
569
574
|
forEachSourceFile(srcDir, (raw, file) => {
|
|
570
575
|
const text = stripComments(raw)
|
|
571
|
-
for (const { hook, gate, draws } of SERVICE_GATES) {
|
|
576
|
+
for (const { hook, gate, alt, draws } of SERVICE_GATES) {
|
|
572
577
|
// A call, not merely an import: re-exporting a hook is not drawing with it.
|
|
573
578
|
if (!new RegExp(`\\b${hook}\\s*\\(`).test(text)) continue
|
|
579
|
+
// Either the hook's own returned field, or kit's standalone predicate for
|
|
580
|
+
// the same service — both are the gate, and a component that reads one
|
|
581
|
+
// does not need the other.
|
|
574
582
|
if (new RegExp(`\\b${gate}\\b`).test(text)) continue
|
|
575
|
-
|
|
583
|
+
if (alt && new RegExp(`\\b${alt}\\s*\\(`).test(text)) continue
|
|
584
|
+
found.push({ file, hook, gate, alt, draws })
|
|
576
585
|
}
|
|
577
586
|
})
|
|
578
587
|
|
|
@@ -592,6 +601,7 @@ export function checkUngatedServiceControls({ foundationName, folderName, srcDir
|
|
|
592
601
|
log(` control cannot work. Gate on it instead:`)
|
|
593
602
|
log(` ${colors.dim}const { ${f.gate} } = ${f.hook}(…)${colors.reset}`)
|
|
594
603
|
log(` ${colors.dim}if (!${f.gate}) return null${colors.reset}`)
|
|
604
|
+
if (f.alt) log(` ${colors.dim}…or ${f.alt}() from @uniweb/kit, which needs no hook.${colors.reset}`)
|
|
595
605
|
}
|
|
596
606
|
}
|
|
597
607
|
|
package/src/commands/publish.js
CHANGED
|
@@ -831,8 +831,6 @@ export async function publish(args = []) {
|
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
const { isNonInteractive, confirm } = await import('../utils/interactive.js')
|
|
835
|
-
|
|
836
834
|
// ⛔ EVERY STRING BELOW IS FOR A SITE OWNER, NOT FOR US.
|
|
837
835
|
//
|
|
838
836
|
// "request", "declaration", "send", "adopt", "reconcile" are how this file
|
package/src/framework-index.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-09-
|
|
3
|
+
"generatedAt": "2026-09-10T13:34:53.674Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/api": {
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.3.0",
|
|
7
7
|
"path": "framework/api",
|
|
8
8
|
"deps": [
|
|
9
9
|
"@uniweb/core"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
"@uniweb/build": {
|
|
13
|
-
"version": "0.44.
|
|
13
|
+
"version": "0.44.2",
|
|
14
14
|
"path": "framework/build",
|
|
15
15
|
"deps": [
|
|
16
16
|
"@uniweb/content-reader",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"deps": []
|
|
35
35
|
},
|
|
36
36
|
"@uniweb/core": {
|
|
37
|
-
"version": "0.24.
|
|
37
|
+
"version": "0.24.3",
|
|
38
38
|
"path": "framework/core",
|
|
39
39
|
"deps": [
|
|
40
40
|
"@uniweb/semantic-parser",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"@uniweb/kit": {
|
|
57
|
-
"version": "0.18.
|
|
57
|
+
"version": "0.18.1",
|
|
58
58
|
"path": "framework/kit",
|
|
59
59
|
"deps": [
|
|
60
60
|
"@uniweb/core",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"deps": []
|
|
75
75
|
},
|
|
76
76
|
"@uniweb/projections": {
|
|
77
|
-
"version": "0.
|
|
77
|
+
"version": "0.6.0",
|
|
78
78
|
"path": "framework/projections",
|
|
79
79
|
"deps": [
|
|
80
80
|
"@uniweb/content-writer",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"@uniweb/runtime": {
|
|
85
|
-
"version": "0.19.
|
|
85
|
+
"version": "0.19.4",
|
|
86
86
|
"path": "framework/runtime",
|
|
87
87
|
"deps": [
|
|
88
88
|
"@uniweb/core",
|