@uniweb/runtime 0.29.4 → 0.29.5

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.jsx +10 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.29.4",
3
+ "version": "0.29.5",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,15 +36,15 @@
36
36
  "node": ">=20.19"
37
37
  },
38
38
  "dependencies": {
39
- "@uniweb/theming": "^0.2.0",
40
- "@uniweb/core": "^0.38.0"
39
+ "@uniweb/core": "^0.38.0",
40
+ "@uniweb/theming": "^0.2.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@vitejs/plugin-react": "^4.5.2",
44
44
  "esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0",
45
45
  "vite": "^7.3.1",
46
46
  "vitest": "^4.1.7",
47
- "@uniweb/build": "0.79.0"
47
+ "@uniweb/build": "0.80.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^19.0.0",
package/src/index.jsx CHANGED
@@ -186,21 +186,26 @@ async function initRuntime(foundationSource, options = {}) {
186
186
  /**
187
187
  * Simplified entry point for sites
188
188
  *
189
- * Template main.js calls this with config + foundation/styles promises:
189
+ * A scaffolded site's entry.js imports the foundation's styles, then calls
190
+ * this with the build-time config and the foundation promise:
191
+ *
192
+ * import '#foundation/styles'
193
+ * import { start } from '@uniweb/runtime'
190
194
  *
191
195
  * start({
192
196
  * config: __FOUNDATION_CONFIG__,
193
- * styles: import('#foundation/styles'),
194
197
  * foundation: import('#foundation')
195
198
  * })
196
199
  *
197
- * In runtime mode, the foundation/styles promises resolve to noop modules
198
- * (configured by the site Vite plugin) and are ignored.
200
+ * In runtime mode, `#foundation` and `#foundation/styles` resolve to noop
201
+ * modules (configured by the site Vite plugin), and the foundation is loaded
202
+ * by URL instead. `styles` is optional: in bundled mode a promise passed there
203
+ * is awaited along with the foundation.
199
204
  *
200
205
  * @param {Object} options
201
206
  * @param {Object} options.config - Build-time config from __FOUNDATION_CONFIG__
202
207
  * @param {Promise} options.foundation - Promise from import('#foundation')
203
- * @param {Promise} options.styles - Promise from import('#foundation/styles')
208
+ * @param {Promise} [options.styles] - Optional promise, e.g. import('#foundation/styles')
204
209
  */
205
210
  async function start({ config, foundation, styles } = {}) {
206
211
  // Try __DATA__ first (dynamic backends inject combined config + content)