uniweb 1.24.12 → 1.24.13

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": "1.24.12",
3
+ "version": "1.24.13",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,15 +41,15 @@
41
41
  "js-yaml": "^4.3.2",
42
42
  "prompts": "^2.4.2",
43
43
  "tar": "^7.5.21",
44
- "@uniweb/core": "~1.5.1",
45
- "@uniweb/schemas": "~1.6.7",
46
44
  "@uniweb/content-writer": "~1.3.1",
47
- "@uniweb/semantic-parser": "~1.13.0"
45
+ "@uniweb/schemas": "~1.6.7",
46
+ "@uniweb/semantic-parser": "~1.13.0",
47
+ "@uniweb/core": "~1.5.1"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/build": "~1.13.5",
51
- "@uniweb/semantic-parser": "~1.13.0",
52
- "@uniweb/content-reader": "~1.5.7"
50
+ "@uniweb/build": "~1.13.6",
51
+ "@uniweb/content-reader": "~1.5.7",
52
+ "@uniweb/semantic-parser": "~1.13.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -854,39 +854,47 @@ async function buildWorkspace(workspaceDir, options = {}) {
854
854
  process.exit(1)
855
855
  }
856
856
 
857
- // Build foundations first (sites depend on them)
858
- for (const foundation of foundations) {
859
- log(`${colors.bright}[${foundation.name}]${colors.reset}`)
860
- await buildFoundation(foundation.path)
861
- log('')
862
- }
857
+ // Each package's build is a step of this one, which says what next once, at its end.
858
+ const step = process.env.UNIWEB_BUILD_STEP
859
+ process.env.UNIWEB_BUILD_STEP = 'workspace'
860
+ try {
861
+ // Build foundations first (sites depend on them)
862
+ for (const foundation of foundations) {
863
+ log(`${colors.bright}[${foundation.name}]${colors.reset}`)
864
+ await buildFoundation(foundation.path)
865
+ log('')
866
+ }
863
867
 
864
- // Build extensions (they are foundations, but logged distinctly)
865
- for (const extension of extensions) {
866
- const label = isExtensionDir(extension.path) ? 'extension' : 'foundation'
867
- log(
868
- `${colors.bright}[${extension.name}]${colors.reset} ${colors.dim}(${label})${colors.reset}`
869
- )
870
- await buildFoundation(extension.path)
871
- log('')
872
- }
868
+ // Build extensions (they are foundations, but logged distinctly)
869
+ for (const extension of extensions) {
870
+ const label = isExtensionDir(extension.path) ? 'extension' : 'foundation'
871
+ log(
872
+ `${colors.bright}[${extension.name}]${colors.reset} ${colors.dim}(${label})${colors.reset}`
873
+ )
874
+ await buildFoundation(extension.path)
875
+ log('')
876
+ }
873
877
 
874
- // Build sites
875
- for (const site of sites) {
876
- log(`${colors.bright}[${site.name}]${colors.reset}`)
878
+ // Build sites
879
+ for (const site of sites) {
880
+ log(`${colors.bright}[${site.name}]${colors.reset}`)
877
881
 
878
- const siteConfig = readSiteConfig(site.path)
879
- const configPrerender = siteConfig.build?.prerender === true
882
+ const siteConfig = readSiteConfig(site.path)
883
+ const configPrerender = siteConfig.build?.prerender === true
880
884
 
881
- let prerender = configPrerender
882
- if (prerenderFlag) prerender = true
883
- if (noPrerenderFlag) prerender = false
885
+ let prerender = configPrerender
886
+ if (prerenderFlag) prerender = true
887
+ if (noPrerenderFlag) prerender = false
884
888
 
885
- // Resolve foundation directory for this site
886
- const foundationDir = resolveFoundationDir(site.path, siteConfig)
889
+ // Resolve foundation directory for this site
890
+ const foundationDir = resolveFoundationDir(site.path, siteConfig)
887
891
 
888
- await buildSite(site.path, { prerender, foundationDir, siteConfig, host })
889
- log('')
892
+ await buildSite(site.path, { prerender, foundationDir, siteConfig, host })
893
+ log('')
894
+ }
895
+ } finally {
896
+ if (step === undefined) delete process.env.UNIWEB_BUILD_STEP
897
+ else process.env.UNIWEB_BUILD_STEP = step
890
898
  }
891
899
 
892
900
  // Summary
@@ -904,9 +912,11 @@ async function buildWorkspace(workspaceDir, options = {}) {
904
912
  }
905
913
 
906
914
  /**
907
- * Show next-step hints after workspace build
915
+ * What next, for someone who ran `uniweb build`: not when the build is a step of something else
916
+ * (UNIWEB_BUILD_STEP), which says what comes next itself.
908
917
  */
909
918
  function showNextSteps(hasFoundations, hasSites) {
919
+ if (process.env.UNIWEB_BUILD_STEP) return
910
920
  if (hasFoundations) {
911
921
  log('')
912
922
  log(`${colors.bright}Share with clients:${colors.reset}`)
@@ -81,7 +81,9 @@ export async function exportSite(args = []) {
81
81
  try {
82
82
  execSync(`node ${JSON.stringify(process.argv[1])} ${buildArgs.join(' ')}`, {
83
83
  cwd: siteDir,
84
- stdio: 'inherit'
84
+ stdio: 'inherit',
85
+ // A step of this verb, which says what next itself, below.
86
+ env: { ...process.env, UNIWEB_BUILD_STEP: 'export' }
85
87
  })
86
88
  } catch {
87
89
  say.err('Build failed. See output above.')
@@ -3,14 +3,14 @@
3
3
  *
4
4
  * Usage:
5
5
  * uniweb inspect pages/home/hero.md Single section
6
- * uniweb inspect pages/home/ All sections in a page folder
6
+ * uniweb inspect pages/home/ All sections on a page, in the page's order
7
7
  * uniweb inspect pages/home/hero.md --raw ProseMirror AST instead of flat shape
8
8
  * uniweb inspect pages/home/ --full Include empty fields (matches runtime)
9
9
  * uniweb inspect pages/home/ --sequence Include sequence array
10
10
  */
11
11
 
12
- import { readFileSync, readdirSync, statSync } from 'node:fs'
13
- import { resolve, extname, basename } from 'node:path'
12
+ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
13
+ import { resolve, extname, basename, dirname, join } from 'node:path'
14
14
  import yaml from 'js-yaml'
15
15
 
16
16
  // Colors for terminal output
@@ -302,6 +302,35 @@ function naturalSort(a, b) {
302
302
  return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })
303
303
  }
304
304
 
305
+ /**
306
+ * The site a folder is in: the nearest folder above it, or itself, holding a `site.yml`.
307
+ */
308
+ function findSiteRoot(dir) {
309
+ for (let at = dir; ; at = dirname(at)) {
310
+ if (existsSync(join(at, 'site.yml'))) return at
311
+ if (dirname(at) === at) return null
312
+ }
313
+ }
314
+
315
+ /**
316
+ * A page folder's files as the page has them, by the build's own walk of it (`pageSectionFiles`), and
317
+ * the files it leaves out. A folder outside a site has no page to ask, so it keeps its name order.
318
+ */
319
+ async function inPageOrder(target, files) {
320
+ const siteRoot = findSiteRoot(target)
321
+ if (!siteRoot) return { files, notOnPage: [] }
322
+ try {
323
+ const { pageSectionFiles } = await import('@uniweb/build/content')
324
+ const onPage = await pageSectionFiles(target, siteRoot)
325
+ return { files: onPage, notOnPage: files.filter((file) => !onPage.includes(file)) }
326
+ } catch (err) {
327
+ console.error(
328
+ `${colors.yellow}In name order: could not read this page's order (${err.message})${colors.reset}`
329
+ )
330
+ return { files, notOnPage: [] }
331
+ }
332
+ }
333
+
305
334
  /**
306
335
  * Main inspect entry point.
307
336
  */
@@ -315,7 +344,7 @@ Usage: uniweb inspect <path> [options]
315
344
  Inspect the parsed content shape of a markdown file or page folder.
316
345
 
317
346
  Arguments:
318
- <path> Path to a .md file or a page folder
347
+ <path> Path to a .md file, or a page folder: its sections in the page's order
319
348
 
320
349
  Options:
321
350
  --raw Show ProseMirror AST instead of flat content shape
@@ -350,19 +379,26 @@ Options:
350
379
  const result = processFile(content, basename(target), deps, options)
351
380
  console.log(JSON.stringify(result, null, 2))
352
381
  } else if (stat.isDirectory()) {
353
- const files = readdirSync(target)
382
+ const found = readdirSync(target)
354
383
  .filter(
355
384
  (f) => extname(f) === '.md' && !f.startsWith('_') && f !== 'README.md'
356
385
  )
357
386
  .sort(naturalSort)
358
387
 
359
- if (files.length === 0) {
388
+ if (found.length === 0) {
360
389
  console.error(
361
390
  `${colors.yellow}No .md files found in: ${flags.target}${colors.reset}`
362
391
  )
363
392
  return
364
393
  }
365
394
 
395
+ const { files, notOnPage } = await inPageOrder(target, found)
396
+ if (notOnPage.length > 0) {
397
+ console.error(
398
+ `${colors.dim}Not on this page: ${notOnPage.join(', ')}${colors.reset}`
399
+ )
400
+ }
401
+
366
402
  const results = files.map((file) => {
367
403
  const content = readFileSync(resolve(target, file), 'utf8')
368
404
  const result = processFile(content, file, deps, options)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-10-31T17:33:02.561Z",
3
+ "generatedAt": "2026-10-31T19:33:39.638Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
6
  "version": "1.6.7"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.13.5"
9
+ "version": "1.13.6"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
12
  "version": "1.5.7"
package/src/versions.js CHANGED
@@ -63,23 +63,27 @@ export const REACT_VERSION = '^19.0.0'
63
63
  * Default pnpm major for generated CI, used only when the project does not
64
64
  * say which pnpm it uses (see `resolveCiPnpmVersion`).
65
65
  *
66
- * **Tracks the current stable major.** `pnpm@latest` is 11.x, so a developer
67
- * running `npm i -g pnpm` today gets 11 — and CI should run what they run.
68
- * Both of pnpm 11's install-time policies are handled:
66
+ * **Meant to track the stable major, and one behind it since pnpm 12**
67
+ * (`npm view pnpm dist-tags`, 2026-10-31: latest is 12.16.1). A project installed
68
+ * with 12 gets 12 by step 2 below, so this applies only with no install to read.
69
+ * A scaffold installs and builds on 12 (same day); a generated workflow on it has
70
+ * not been run, which is what moving this waits on. pnpm 11's two install-time
71
+ * policies are handled:
69
72
  *
70
73
  * - Build-script approval. pnpm 11 renamed `onlyBuiltDependencies` (list)
71
74
  * to `allowBuilds` (map) and ignores the old name, so an unprepared
72
75
  * project fails with `ERR_PNPM_IGNORED_BUILDS`. The workspace template
73
76
  * emits both spellings, so scaffolds install on either major.
74
77
  * - Minimum release age. pnpm 11 refuses dependencies published in the
75
- * last 24 hours. Installing locally with pnpm 11 auto-collects the
76
- * needed `minimumReleaseAgeExclude` entries into `pnpm-workspace.yaml`,
78
+ * last 24 hours. The workspace template exempts the framework's own
79
+ * packages. For anything else, installing locally with pnpm 11 auto-collects
80
+ * the needed `minimumReleaseAgeExclude` entries into `pnpm-workspace.yaml`,
77
81
  * and CI then honours them — verified end to end.
78
82
  *
79
83
  * **The one combination that breaks is installing locally with pnpm 10 while
80
- * CI runs 11**: pnpm 10 never writes those exclude entries, so CI rejects any
81
- * dependency in the lockfile published within the last day — including
82
- * unrelated transitive ones. A project still on pnpm 10 should say so with
84
+ * CI runs 11**: pnpm 10 never writes those exclude entries, so CI rejects a
85
+ * dependency outside the framework in the lockfile published within the last
86
+ * day, including a transitive one. A project still on pnpm 10 should say so with
83
87
  * `"packageManager": "pnpm@10.x.y"`, which `resolveCiPnpmVersion` honours and
84
88
  * which pins CI to match. `uniweb add ci` prints the resolved toolchain so
85
89
  * that choice is visible rather than silent.
@@ -24,3 +24,11 @@ onlyBuiltDependencies:
24
24
  allowBuilds:
25
25
  esbuild: true
26
26
  sharp: true
27
+
28
+ # The framework's packages move together, and the CLI names the versions a
29
+ # project takes. pnpm 12 holds a release back for its first day by default and
30
+ # writes each one it needs into this file: a project made that day gets part of
31
+ # a release and a change to commit. Your other dependencies keep pnpm's policy.
32
+ minimumReleaseAgeExclude:
33
+ - "@uniweb/*"
34
+ - uniweb