uniweb 0.12.39 → 0.12.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/README.md +3 -2
- package/package.json +5 -5
- package/src/commands/add.js +3 -2
- package/src/framework-index.json +8 -8
- package/src/index.js +15 -10
- package/src/utils/pm.js +17 -0
- package/src/versions.js +12 -0
package/README.md
CHANGED
|
@@ -347,10 +347,11 @@ Markdown in a git repo and content in the Uniweb apps can share the same site. D
|
|
|
347
347
|
| Command | What it does |
|
|
348
348
|
| --- | --- |
|
|
349
349
|
| `uniweb add ci --host=<adapter>` | Scaffold a CI workflow in your repo (today: `github-pages`). The host runs `uniweb build` on each push. |
|
|
350
|
-
| `uniweb
|
|
350
|
+
| `uniweb publish` | Go live on Uniweb hosting (paid) — syncs content, brings the site's foundation along, and serves dynamically. The canonical verb for Uniweb hosting. |
|
|
351
|
+
| `uniweb deploy --host=<adapter>` | Ship to a third-party static host in one step — builds `dist/`, uploads, invalidates. |
|
|
351
352
|
| `uniweb export` | Produce a self-contained `dist/` for any static host. You upload it yourself. `--host=<adapter>` adds host-specific helper files. |
|
|
352
353
|
| `uniweb register --scope @org` | Register a foundation to the registry (path 2). |
|
|
353
|
-
| `uniweb build` | Inspect a build locally. For shipping, use `
|
|
354
|
+
| `uniweb build` | Inspect a build locally. For shipping, use `publish` (Uniweb hosting) or `deploy`/`export` (static hosts). |
|
|
354
355
|
| `uniweb update` | Align this project with the CLI you're running: bump `@uniweb/*` deps in every `package.json` to the CLI's matrix (then install), and refresh `AGENTS.md`. Pins to *this* CLI's matrix — run `npx uniweb@latest update` to align to the latest release. Updating the CLI itself is your package manager's job (`npm i -g uniweb@latest`). |
|
|
355
356
|
|
|
356
357
|
`--host=<adapter>` is the same option across `deploy`, `export`, and `add ci`. Built-in adapters: `cloudflare-pages`, `netlify`, `github-pages`, `vercel`, `s3-cloudfront`, `generic-static`. Each adapter implements only the operations it supports — `add ci` is currently `github-pages`-only because it's the only one that needs a workflow file in the repo.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.41",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"js-yaml": "^4.1.0",
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
|
-
"@uniweb/core": "0.7.
|
|
45
|
-
"@uniweb/kit": "0.9.
|
|
46
|
-
"@uniweb/runtime": "0.8.
|
|
44
|
+
"@uniweb/core": "0.7.16",
|
|
45
|
+
"@uniweb/kit": "0.9.20",
|
|
46
|
+
"@uniweb/runtime": "0.8.22"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@uniweb/build": "0.14.
|
|
49
|
+
"@uniweb/build": "0.14.24",
|
|
50
50
|
"@uniweb/content-reader": "1.1.12",
|
|
51
51
|
"@uniweb/semantic-parser": "1.1.17"
|
|
52
52
|
},
|
package/src/commands/add.js
CHANGED
|
@@ -31,7 +31,7 @@ import { detectPackageManager, filterCmd, installCmd } from '../utils/pm.js'
|
|
|
31
31
|
import { isNonInteractive, getCliPrefix, stripNonInteractiveFlag, formatOptions } from '../utils/interactive.js'
|
|
32
32
|
import { resolveTemplate } from '../templates/index.js'
|
|
33
33
|
import { validateTemplate } from '../templates/validator.js'
|
|
34
|
-
import { getVersionsForTemplates } from '../versions.js'
|
|
34
|
+
import { getVersionsForTemplates, PNPM_VERSION } from '../versions.js'
|
|
35
35
|
|
|
36
36
|
// Colors for terminal output
|
|
37
37
|
const colors = {
|
|
@@ -952,7 +952,7 @@ export default function ${name}({ content, params }) {
|
|
|
952
952
|
* Add a CI deploy workflow for a host adapter.
|
|
953
953
|
*
|
|
954
954
|
* Wires through the host-adapter registry: each adapter optionally
|
|
955
|
-
* exports `initCi({ rootDir, site, packageManager, nodeVersion })`
|
|
955
|
+
* exports `initCi({ rootDir, site, packageManager, nodeVersion, pnpmVersion })`
|
|
956
956
|
* returning `{ files, postInstructions }`. The CLI handles file writes,
|
|
957
957
|
* --force overwrite, and consistent output. Today only github-pages
|
|
958
958
|
* implements initCi; the registry's other adapters (cloudflare-pages,
|
|
@@ -1069,6 +1069,7 @@ async function addCi(rootDir, opts, pm = 'pnpm') {
|
|
|
1069
1069
|
site,
|
|
1070
1070
|
packageManager: pm,
|
|
1071
1071
|
nodeVersion,
|
|
1072
|
+
pnpmVersion: PNPM_VERSION,
|
|
1072
1073
|
domain: resolvedDomain,
|
|
1073
1074
|
})
|
|
1074
1075
|
|
package/src/framework-index.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-13T21:48:20.211Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/build": {
|
|
6
|
-
"version": "0.14.
|
|
6
|
+
"version": "0.14.24",
|
|
7
7
|
"path": "framework/build",
|
|
8
8
|
"deps": [
|
|
9
9
|
"@uniweb/content-reader",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"deps": []
|
|
26
26
|
},
|
|
27
27
|
"@uniweb/core": {
|
|
28
|
-
"version": "0.7.
|
|
28
|
+
"version": "0.7.16",
|
|
29
29
|
"path": "framework/core",
|
|
30
30
|
"deps": [
|
|
31
31
|
"@uniweb/semantic-parser",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"deps": []
|
|
44
44
|
},
|
|
45
45
|
"@uniweb/kit": {
|
|
46
|
-
"version": "0.9.
|
|
46
|
+
"version": "0.9.20",
|
|
47
47
|
"path": "framework/kit",
|
|
48
48
|
"deps": [
|
|
49
49
|
"@uniweb/core",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"deps": []
|
|
62
62
|
},
|
|
63
63
|
"@uniweb/runtime": {
|
|
64
|
-
"version": "0.8.
|
|
64
|
+
"version": "0.8.22",
|
|
65
65
|
"path": "framework/runtime",
|
|
66
66
|
"deps": [
|
|
67
67
|
"@uniweb/core",
|
|
@@ -89,17 +89,17 @@
|
|
|
89
89
|
"deps": []
|
|
90
90
|
},
|
|
91
91
|
"@uniweb/templates": {
|
|
92
|
-
"version": "0.7.
|
|
92
|
+
"version": "0.7.42",
|
|
93
93
|
"path": "framework/templates",
|
|
94
94
|
"deps": []
|
|
95
95
|
},
|
|
96
96
|
"@uniweb/theming": {
|
|
97
|
-
"version": "0.1.
|
|
97
|
+
"version": "0.1.5",
|
|
98
98
|
"path": "framework/theming",
|
|
99
99
|
"deps": []
|
|
100
100
|
},
|
|
101
101
|
"@uniweb/unipress": {
|
|
102
|
-
"version": "0.4.
|
|
102
|
+
"version": "0.4.31",
|
|
103
103
|
"path": "framework/unipress",
|
|
104
104
|
"deps": [
|
|
105
105
|
"@uniweb/build",
|
package/src/index.js
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from './templates/index.js'
|
|
45
45
|
import { validateTemplate } from './templates/validator.js'
|
|
46
46
|
import { scaffoldWorkspace, scaffoldFoundation, scaffoldSite, applyContent, applyStarter, mergeTemplateDependencies, getWorkspaceTemplateOutputs } from './utils/scaffold.js'
|
|
47
|
-
import { detectPackageManager, filterCmd, installCmd, runCmd } from './utils/pm.js'
|
|
47
|
+
import { detectPackageManager, filterCmd, installCmd, runCmd, isPnpmAvailable } from './utils/pm.js'
|
|
48
48
|
import { isNonInteractive, getCliPrefix, stripNonInteractiveFlag, formatOptions } from './utils/interactive.js'
|
|
49
49
|
import { findWorkspaceRoot } from './utils/workspace.js'
|
|
50
50
|
|
|
@@ -1054,23 +1054,28 @@ async function main() {
|
|
|
1054
1054
|
// Success message
|
|
1055
1055
|
title('Project created successfully!')
|
|
1056
1056
|
|
|
1057
|
+
// Recommend pnpm (the framework's package manager) when it's installed,
|
|
1058
|
+
// otherwise fall back to however the user invoked the CLI. The scaffold
|
|
1059
|
+
// supports both — the root package.json declares npm `workspaces` and a
|
|
1060
|
+
// pnpm-workspace.yaml ships next to it.
|
|
1061
|
+
const recPm = isPnpmAvailable() ? 'pnpm' : pm
|
|
1062
|
+
|
|
1057
1063
|
if (isBlank) {
|
|
1058
1064
|
log(`Next steps:\n`)
|
|
1059
1065
|
if (!inPlace) log(` ${colors.cyan}cd ${projectName}${colors.reset}`)
|
|
1060
1066
|
log(` ${colors.cyan}${prefix} add project${colors.reset}`)
|
|
1061
|
-
log(` ${colors.cyan}${installCmd(
|
|
1062
|
-
log(` ${colors.cyan}${
|
|
1067
|
+
log(` ${colors.cyan}${installCmd(recPm)}${colors.reset}`)
|
|
1068
|
+
log(` ${colors.cyan}${runCmd(recPm, 'dev')}${colors.reset} ${colors.dim}# start the dev server${colors.reset}`)
|
|
1063
1069
|
} else {
|
|
1064
1070
|
log(`Next steps:\n`)
|
|
1065
1071
|
if (!inPlace) log(` ${colors.cyan}cd ${projectName}${colors.reset}`)
|
|
1066
|
-
log(` ${colors.cyan}${installCmd(
|
|
1067
|
-
log(` ${colors.cyan}${
|
|
1072
|
+
log(` ${colors.cyan}${installCmd(recPm)}${colors.reset}`)
|
|
1073
|
+
log(` ${colors.cyan}${runCmd(recPm, 'dev')}${colors.reset} ${colors.dim}# start the dev server${colors.reset}`)
|
|
1074
|
+
}
|
|
1075
|
+
if (recPm !== 'pnpm') {
|
|
1076
|
+
log('')
|
|
1077
|
+
log(` ${colors.dim}Tip: pnpm is recommended (https://pnpm.io) — npm works too.${colors.reset}`)
|
|
1068
1078
|
}
|
|
1069
|
-
log('')
|
|
1070
|
-
log(`When ready to ship:\n`)
|
|
1071
|
-
log(` ${colors.cyan}${prefix} deploy${colors.reset} ${colors.dim}# Uniweb hosting (default; uniweb login first)${colors.reset}`)
|
|
1072
|
-
log(` ${colors.cyan}${prefix} deploy --host=<adapter>${colors.reset} ${colors.dim}# cloudflare-pages, netlify, vercel, github-pages, s3-cloudfront${colors.reset}`)
|
|
1073
|
-
log(` ${colors.cyan}${prefix} export${colors.reset} ${colors.dim}# Build dist/ for any static host (no Uniweb account)${colors.reset}`)
|
|
1074
1079
|
log('')
|
|
1075
1080
|
log(` ${colors.dim}See ${colors.reset}${colors.cyan}${prefix} <command> --help${colors.reset}${colors.dim} for command-specific options.${colors.reset}`)
|
|
1076
1081
|
log('')
|
package/src/utils/pm.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { existsSync } from 'node:fs'
|
|
9
9
|
import { join } from 'node:path'
|
|
10
|
+
import { execSync } from 'node:child_process'
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Detect which package manager invoked the CLI.
|
|
@@ -84,6 +85,22 @@ export function filterCmd(pm, pkg, cmd) {
|
|
|
84
85
|
: `npm -w ${pkg} run ${cmd}`
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Whether pnpm is available on the current PATH. Used to recommend pnpm
|
|
90
|
+
* (the framework's package manager) in post-scaffold next steps while still
|
|
91
|
+
* falling back gracefully when it isn't installed. Mirrors the `git --version`
|
|
92
|
+
* probe the create flow already uses to feature-detect git.
|
|
93
|
+
* @returns {boolean}
|
|
94
|
+
*/
|
|
95
|
+
export function isPnpmAvailable() {
|
|
96
|
+
try {
|
|
97
|
+
execSync('pnpm --version', { stdio: 'ignore' })
|
|
98
|
+
return true
|
|
99
|
+
} catch {
|
|
100
|
+
return false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
87
104
|
/**
|
|
88
105
|
* Generate an install command.
|
|
89
106
|
* @param {'pnpm' | 'yarn' | 'npm'} pm
|
package/src/versions.js
CHANGED
|
@@ -52,6 +52,18 @@ let resolvedVersions = null
|
|
|
52
52
|
*/
|
|
53
53
|
export const REACT_VERSION = '^19.0.0'
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* The pnpm major the framework's generated CI standardizes on.
|
|
57
|
+
*
|
|
58
|
+
* Scaffolded CI workflows (`uniweb add ci --host=github-pages`) pin pnpm
|
|
59
|
+
* through `pnpm/action-setup`. This is the one place that value lives, so the
|
|
60
|
+
* pin tracks a single supported major instead of drifting as a hardcoded
|
|
61
|
+
* literal inside each host adapter. A bare major installs the latest patch of
|
|
62
|
+
* that major at CI run time. Bump this when the framework moves to a new pnpm
|
|
63
|
+
* major (latest stable is 11.x as of this writing; pnpm 12 is still alpha).
|
|
64
|
+
*/
|
|
65
|
+
export const PNPM_VERSION = '11'
|
|
66
|
+
|
|
55
67
|
/**
|
|
56
68
|
* Get the CLI's own package.json
|
|
57
69
|
*/
|