uniweb 1.31.9 → 1.31.10
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 +5 -5
- package/partials/agents.md +1 -0
- package/src/commands/update.js +7 -5
- package/src/utils/pm.js +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.10",
|
|
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/content-writer": "~1.3.1",
|
|
44
45
|
"@uniweb/core": "~1.6.11",
|
|
45
46
|
"@uniweb/semantic-parser": "~1.13.2",
|
|
46
|
-
"@uniweb/schemas": "~1.7.1"
|
|
47
|
-
"@uniweb/content-writer": "~1.3.1"
|
|
47
|
+
"@uniweb/schemas": "~1.7.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@uniweb/
|
|
50
|
+
"@uniweb/build": "~1.20.8",
|
|
51
51
|
"@uniweb/semantic-parser": "~1.13.2",
|
|
52
|
-
"@uniweb/
|
|
52
|
+
"@uniweb/content-reader": "~1.5.9"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@uniweb/build": {
|
package/partials/agents.md
CHANGED
|
@@ -103,6 +103,7 @@ When a rule in §2 feels like friction, that is the moment you are about to take
|
|
|
103
103
|
| `<a href="/about">` | `<Link to="page:about">` (an `id:` survives moves) or `<Link href="/about">`. A bare `<a>` still routes but resolves no `page:` and adds no base path or locale. | silent |
|
|
104
104
|
| `window.location.href = '/fr'` to switch language | `<Link reload href={website.getLocaleUrl('fr')}>` or `website.switchLocale('fr')`. | base-path bug |
|
|
105
105
|
| `useEffect(() => fetch(…))` for records | Declare the key in `meta.js data:`; it arrives in `content.data`, prerendered. | prerenders as loading |
|
|
106
|
+
| `new Date()`, `Date.now()` or `Math.random()` while rendering: a calendar file's `DTSTAMP`, an id | A section renders in the build and again in the browser, so take it from content: the record's date, its `$name`. Only what follows the visitor's clock (open now, upcoming) reads the clock. | silent: each build writes its own time into the pages |
|
|
106
107
|
| `<Icon icon="lu-send" />` for an icon your section always shows | Import it (`uniweb guide foundation` § Icon). A name is for an icon content supplies at runtime: markdown, a param, a record's field. | silent; blank until the browser fetches it |
|
|
107
108
|
| A `Button` or `Card` in `sections/` | `components/`. Everything at the root of `sections/` becomes author vocabulary. | appears in the section picker |
|
|
108
109
|
| Helpers that take `{ content, params }` | Ordinary props. That signature is for section types only. | — |
|
package/src/commands/update.js
CHANGED
|
@@ -56,6 +56,7 @@ import { isNonInteractive } from '../utils/interactive.js'
|
|
|
56
56
|
import {
|
|
57
57
|
detectWorkspacePm,
|
|
58
58
|
installCmd,
|
|
59
|
+
installAfterEditCmd,
|
|
59
60
|
detectGlobalCliPm,
|
|
60
61
|
globalCliUpdateCmd
|
|
61
62
|
} from '../utils/pm.js'
|
|
@@ -501,7 +502,7 @@ export async function update(args = []) {
|
|
|
501
502
|
)
|
|
502
503
|
if (installPm) {
|
|
503
504
|
log(
|
|
504
|
-
`${colors.dim}Then would run:${colors.reset} ${colors.cyan}${
|
|
505
|
+
`${colors.dim}Then would run:${colors.reset} ${colors.cyan}${installAfterEditCmd(installPm)}${colors.reset}`
|
|
505
506
|
)
|
|
506
507
|
} else {
|
|
507
508
|
log(
|
|
@@ -549,7 +550,8 @@ export async function update(args = []) {
|
|
|
549
550
|
}
|
|
550
551
|
|
|
551
552
|
if (installPm) {
|
|
552
|
-
|
|
553
|
+
// Never frozen: the package.json files were just edited (`installAfterEditCmd`).
|
|
554
|
+
const cmd = installAfterEditCmd(installPm)
|
|
553
555
|
let runInstall
|
|
554
556
|
if (hasYes) {
|
|
555
557
|
runInstall = true
|
|
@@ -727,7 +729,7 @@ async function refreshAgents(ctx) {
|
|
|
727
729
|
// package.json. Refreshing the doc here would document features the
|
|
728
730
|
// installed code doesn't have. No override — run the install first.
|
|
729
731
|
if (depsEdited && !installRan) {
|
|
730
|
-
const cmd =
|
|
732
|
+
const cmd = installAfterEditCmd(installPm || 'pnpm')
|
|
731
733
|
warn(
|
|
732
734
|
'AGENTS.md refresh skipped: package.json was updated but not installed.'
|
|
733
735
|
)
|
|
@@ -841,11 +843,11 @@ export function printSummary({
|
|
|
841
843
|
)
|
|
842
844
|
if (installRan) {
|
|
843
845
|
log(
|
|
844
|
-
` ${colors.green}✓${colors.reset} ${
|
|
846
|
+
` ${colors.green}✓${colors.reset} ${installAfterEditCmd(installPm || 'pnpm')} completed`
|
|
845
847
|
)
|
|
846
848
|
} else {
|
|
847
849
|
log(
|
|
848
|
-
` ${colors.yellow}⚠${colors.reset} install NOT run — run ${colors.cyan}${
|
|
850
|
+
` ${colors.yellow}⚠${colors.reset} install NOT run — run ${colors.cyan}${installAfterEditCmd(installPm || 'pnpm')}${colors.reset} to apply`
|
|
849
851
|
)
|
|
850
852
|
}
|
|
851
853
|
}
|
package/src/utils/pm.js
CHANGED
|
@@ -160,6 +160,24 @@ export function installCmd(pm) {
|
|
|
160
160
|
return 'npm install'
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* The install to run right after a command edited the workspace's package.json files, and the one
|
|
165
|
+
* to tell someone to run then.
|
|
166
|
+
*
|
|
167
|
+
* ⭐ NEVER FROZEN. Wherever `CI` is set (a CI job, and the shell some agents run in) pnpm makes
|
|
168
|
+
* `install` frozen, and a frozen install refuses the package.json files the command just wrote.
|
|
169
|
+
* Measured 2026-11-10: `uniweb update --yes` with `CI=1` failed at its install every time, and the
|
|
170
|
+
* retry it printed failed the same way. npm's `install` is never frozen (`npm ci` is the frozen one).
|
|
171
|
+
* yarn is left as it is: berry's flag for this (`--no-immutable`) is not one classic yarn has.
|
|
172
|
+
*
|
|
173
|
+
* @param {'pnpm' | 'yarn' | 'npm'} pm
|
|
174
|
+
* @returns {string}
|
|
175
|
+
*/
|
|
176
|
+
export function installAfterEditCmd(pm) {
|
|
177
|
+
if (pm === 'pnpm') return 'pnpm install --no-frozen-lockfile'
|
|
178
|
+
return installCmd(pm)
|
|
179
|
+
}
|
|
180
|
+
|
|
163
181
|
/**
|
|
164
182
|
* Generate a run-script command.
|
|
165
183
|
* @param {'pnpm' | 'npm'} pm
|