uniweb 0.6.7 → 0.6.8

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.7",
3
+ "version": "0.6.8",
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/core": "0.4.3",
44
- "@uniweb/runtime": "0.5.15",
45
- "@uniweb/build": "0.6.5",
46
- "@uniweb/kit": "0.5.4"
43
+ "@uniweb/build": "0.6.6",
44
+ "@uniweb/runtime": "0.5.16",
45
+ "@uniweb/kit": "0.5.5",
46
+ "@uniweb/core": "0.4.4"
47
47
  }
48
48
  }
@@ -625,6 +625,9 @@ export async function build(args = []) {
625
625
  }
626
626
  }
627
627
 
628
+ // Check for --shell flag (shell mode: no embedded content, for dynamic backend)
629
+ const shellFlag = args.includes('--shell')
630
+
628
631
  // Check for --prerender / --no-prerender flags
629
632
  const prerenderFlag = args.includes('--prerender')
630
633
  const noPrerenderFlag = args.includes('--no-prerender')
@@ -657,6 +660,12 @@ export async function build(args = []) {
657
660
  process.exit(1)
658
661
  }
659
662
 
663
+ // Validate --shell is only used with site target
664
+ if (shellFlag && targetType !== 'site') {
665
+ error('--shell can only be used with site builds')
666
+ process.exit(1)
667
+ }
668
+
660
669
  // Run appropriate build
661
670
  try {
662
671
  if (targetType === 'workspace') {
@@ -673,7 +682,21 @@ export async function build(args = []) {
673
682
  if (prerenderFlag) prerender = true
674
683
  if (noPrerenderFlag) prerender = false
675
684
 
685
+ // Shell mode: set env var for Vite config, force no prerender
686
+ if (shellFlag) {
687
+ process.env.UNIWEB_SHELL = 'true'
688
+ prerender = false
689
+ info('Building in shell mode (no embedded content)')
690
+ }
691
+
676
692
  await buildSite(projectDir, { prerender, foundationDir, siteConfig })
693
+
694
+ if (shellFlag) {
695
+ log('')
696
+ log(`${colors.green}${colors.bright}Shell build complete!${colors.reset}`)
697
+ log(` The shell contains no embedded content.`)
698
+ log(` Use ${colors.cyan}node scripts/platform/serve.js${colors.reset} to serve with dynamic content.`)
699
+ }
677
700
  }
678
701
  } catch (err) {
679
702
  error(err.message)
package/src/index.js CHANGED
@@ -365,6 +365,7 @@ ${colors.bright}Build Options:${colors.reset}
365
365
  --no-prerender Skip pre-rendering (overrides site.yml)
366
366
  --foundation-dir Path to foundation directory (for prerendering)
367
367
  --platform <name> Deployment platform (e.g., vercel) for platform-specific output
368
+ --shell Build site without embedded content (for dynamic backend serving)
368
369
 
369
370
  At workspace root, builds all foundations first, then all sites.
370
371
  Pre-rendering is enabled by default when build.prerender: true in site.yml
@@ -6,7 +6,7 @@
6
6
  export const BUILTIN_TEMPLATES = ['single', 'multi']
7
7
 
8
8
  // Official templates from @uniweb/templates package (downloaded from GitHub releases)
9
- export const OFFICIAL_TEMPLATES = ['marketing', 'academic', 'docs', 'international', 'dynamic', 'store']
9
+ export const OFFICIAL_TEMPLATES = ['marketing', 'academic', 'docs', 'international', 'dynamic', 'store', 'extensions']
10
10
 
11
11
  /**
12
12
  * Parse a template identifier and determine its source type
@@ -1,19 +1,7 @@
1
- import initRuntime from '@uniweb/runtime'
1
+ import { start } from '@uniweb/runtime'
2
2
 
3
- const useRuntimeLoading = import.meta.env.VITE_FOUNDATION_MODE === 'runtime'
4
-
5
- async function start() {
6
- if (useRuntimeLoading) {
7
- initRuntime({
8
- url: '/foundation/foundation.js',
9
- cssUrl: '/foundation/assets/style.css'
10
- })
11
- } else {
12
- // #foundation alias is resolved by Vite based on site.yml config
13
- const foundation = await import('#foundation')
14
- await import('#foundation/styles')
15
- initRuntime(foundation)
16
- }
17
- }
18
-
19
- start().catch(console.error)
3
+ start({
4
+ config: __FOUNDATION_CONFIG__,
5
+ styles: import('#foundation/styles'),
6
+ foundation: import('#foundation')
7
+ })
@@ -1,6 +1,7 @@
1
1
  import { start } from '@uniweb/runtime'
2
2
 
3
3
  start({
4
- foundation: import('#foundation'),
5
- styles: import('#foundation/styles')
4
+ config: __FOUNDATION_CONFIG__,
5
+ styles: import('#foundation/styles'),
6
+ foundation: import('#foundation')
6
7
  })