uniweb 0.8.40 → 0.8.41
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.8.
|
|
3
|
+
"version": "0.8.41",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
44
|
"@uniweb/core": "0.5.20",
|
|
45
|
-
"@uniweb/
|
|
46
|
-
"@uniweb/
|
|
45
|
+
"@uniweb/kit": "0.7.23",
|
|
46
|
+
"@uniweb/runtime": "0.6.36"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
+
"@uniweb/build": "0.8.40",
|
|
49
50
|
"@uniweb/content-reader": "1.1.4",
|
|
50
|
-
"@uniweb/semantic-parser": "1.1.9"
|
|
51
|
-
"@uniweb/build": "0.8.39"
|
|
51
|
+
"@uniweb/semantic-parser": "1.1.9"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@uniweb/build": {
|
package/partials/agents.md
CHANGED
|
@@ -1150,26 +1150,26 @@ This is the system-building pattern at its clearest: **section types are the pub
|
|
|
1150
1150
|
|
|
1151
1151
|
### Section components are composites
|
|
1152
1152
|
|
|
1153
|
-
A section component is rarely a single flat render. It imports helper components from `src/components/` to build a complex UI while presenting a single `type:` to the content author.
|
|
1153
|
+
A section component is rarely a single flat render. It imports helper components from `src/components/` and utilities from `src/utils/` to build a complex UI while presenting a single `type:` to the content author. These directories are the developer's workbench — ordinary React and JS, not selectable by authors, not auto-discovered.
|
|
1154
1154
|
|
|
1155
1155
|
```jsx
|
|
1156
|
-
// src/sections/
|
|
1157
|
-
import
|
|
1158
|
-
import
|
|
1159
|
-
import LessonNav from '../../components/LessonNav'
|
|
1156
|
+
// src/sections/Pricing/index.jsx
|
|
1157
|
+
import PricingCard from '#components/PricingCard'
|
|
1158
|
+
import formatPrice from '#utils/formatPrice'
|
|
1160
1159
|
|
|
1161
|
-
export default function
|
|
1160
|
+
export default function Pricing({ content, params }) {
|
|
1161
|
+
const currency = params.currency || 'USD'
|
|
1162
1162
|
return (
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1163
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 max-w-6xl mx-auto">
|
|
1164
|
+
{content.items.map((tier, i) => (
|
|
1165
|
+
<PricingCard key={i} tier={tier} price={formatPrice(tier.data, currency)} />
|
|
1166
|
+
))}
|
|
1167
|
+
</div>
|
|
1168
1168
|
)
|
|
1169
1169
|
}
|
|
1170
1170
|
```
|
|
1171
1171
|
|
|
1172
|
-
The content author writes `type:
|
|
1172
|
+
The content author writes `type: Pricing` and defines tiers as content items. The section component maps items to cards using a helper component from `src/components/` and a formatting utility from `src/utils/`. Neither is selectable by authors — they're implementation details behind the section type boundary.
|
|
1173
1173
|
|
|
1174
1174
|
**When to reach for this pattern:** When a page type has consistent structural elements (header bars, navigation footers, contextual sidebars) that the content author shouldn't need to add as separate sections. If the author would have to add the same boilerplate sections to every page of a certain type, the section component should compose them internally.
|
|
1175
1175
|
|
|
@@ -1188,26 +1188,38 @@ foundation/src/
|
|
|
1188
1188
|
│ └── Diagram/
|
|
1189
1189
|
│ ├── index.jsx
|
|
1190
1190
|
│ └── meta.js
|
|
1191
|
+
├── layouts/ # Custom layouts (optional, auto-discovered)
|
|
1192
|
+
│ └── DocsLayout/
|
|
1193
|
+
│ ├── index.jsx
|
|
1194
|
+
│ └── meta.js
|
|
1191
1195
|
├── components/ # Your React components (no meta.js, not selectable)
|
|
1192
1196
|
│ ├── ui/
|
|
1193
1197
|
│ │ └── button.jsx
|
|
1194
1198
|
│ └── Card.jsx
|
|
1199
|
+
├── utils/ # Helper functions, non-React logic
|
|
1200
|
+
│ └── splitContent.js
|
|
1195
1201
|
└── styles.css
|
|
1196
1202
|
```
|
|
1197
1203
|
|
|
1198
1204
|
**Discovery:** PascalCase files/folders at root of `sections/` are auto-discovered. Nested levels require `meta.js`. Lowercase directories are organizational only. `hidden: true` excludes a component entirely. Everything outside `sections/` is ordinary React.
|
|
1199
1205
|
|
|
1200
|
-
|
|
1206
|
+
**Import aliases:** Foundations include subpath imports in `package.json` that map to `src/` subdirectories. Use them instead of brittle relative paths:
|
|
1207
|
+
|
|
1208
|
+
| Alias | Maps to | Use for |
|
|
1209
|
+
|-------|---------|---------|
|
|
1210
|
+
| `#components/*` | `./src/components/*` | Shared React components |
|
|
1211
|
+
| `#utils/*` | `./src/utils/*` | Helper functions, non-React logic |
|
|
1201
1212
|
|
|
1202
1213
|
```jsx
|
|
1203
|
-
// ✅ Clean — use
|
|
1214
|
+
// ✅ Clean — use aliases
|
|
1204
1215
|
import LessonHeader from '#components/LessonHeader'
|
|
1216
|
+
import splitContent from '#utils/splitContent'
|
|
1205
1217
|
|
|
1206
1218
|
// ❌ Fragile — breaks if you reorganize sections/
|
|
1207
1219
|
import LessonHeader from '../../components/LessonHeader'
|
|
1208
1220
|
```
|
|
1209
1221
|
|
|
1210
|
-
Within
|
|
1222
|
+
Within the same directory (e.g., one component importing a sibling), use normal relative imports (`./AIFeedbackCard`).
|
|
1211
1223
|
|
|
1212
1224
|
### Website and Page APIs
|
|
1213
1225
|
|