uniweb 1.27.0 → 1.27.1
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 +3 -3
- package/src/backend/site-sync.js +22 -6
- package/src/commands/pull.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,10 +41,10 @@
|
|
|
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",
|
|
45
44
|
"@uniweb/core": "~1.6.4",
|
|
45
|
+
"@uniweb/schemas": "~1.6.8",
|
|
46
46
|
"@uniweb/semantic-parser": "~1.13.2",
|
|
47
|
-
"@uniweb/
|
|
47
|
+
"@uniweb/content-writer": "~1.3.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@uniweb/build": "~1.16.0",
|
package/src/backend/site-sync.js
CHANGED
|
@@ -989,8 +989,17 @@ export function writeItemBaseVersions(siteDir, backend, versions) {
|
|
|
989
989
|
export function readHeldUnits(siteDir, backend) {
|
|
990
990
|
return readMap(siteDir, backend, 'heldUnits')
|
|
991
991
|
}
|
|
992
|
-
|
|
993
|
-
|
|
992
|
+
/**
|
|
993
|
+
* Record what a pull held: its units as the files keep them (`heldUnits`), and the `$uuid` of every
|
|
994
|
+
* item it held (`heldItems`), by which a push tells a held page in the backend's document, where the
|
|
995
|
+
* app may keep it under another path, from a change of someone else's.
|
|
996
|
+
*/
|
|
997
|
+
export function writeHeldUnits(siteDir, backend, held, items = []) {
|
|
998
|
+
updateSyncCache(siteDir, backend, { heldUnits: { ...(held || {}) }, heldItems: [...new Set(items)].sort() })
|
|
999
|
+
}
|
|
1000
|
+
export function readHeldItems(siteDir, backend) {
|
|
1001
|
+
const items = readSyncCacheFile(siteDir, backend).heldItems
|
|
1002
|
+
return Array.isArray(items) ? items : []
|
|
994
1003
|
}
|
|
995
1004
|
|
|
996
1005
|
/**
|
|
@@ -3110,11 +3119,18 @@ export async function pushSyncPackages({
|
|
|
3110
3119
|
// (The site-content lane's own state was settled when it landed — `settleSiteContent`.)
|
|
3111
3120
|
// What the backend holds that this copy doesn't. None of it was overwritten, and no
|
|
3112
3121
|
// later push will overwrite it — but the files are behind until a pull.
|
|
3113
|
-
|
|
3122
|
+
// A page a pull held is not one of these: the push left it out and said so (`noteHeldLeftOut`), and a pull
|
|
3123
|
+
// cannot take it, so naming it here asked for a pull that holds it again (measured 2026-11-05).
|
|
3124
|
+
const heldIds = new Set(readHeldItems(siteDir, client.origin))
|
|
3125
|
+
const heldAt = new Set(
|
|
3126
|
+
Object.entries(siteFinalizedDoc ? collectUnitUuids(siteFinalizedDoc) : {})
|
|
3127
|
+
.filter(([, uuid]) => heldIds.has(uuid))
|
|
3128
|
+
.map(([path]) => path)
|
|
3129
|
+
)
|
|
3130
|
+
const othersChanged = [...notHeld.kept, ...notHeld.foreign].filter((p) => !heldAt.has(p))
|
|
3131
|
+
if (othersChanged.length) {
|
|
3114
3132
|
// Named by the file it is in here, not by its id (`unitFilesOf`).
|
|
3115
|
-
const paths = [
|
|
3116
|
-
...new Set([...notHeld.kept, ...notHeld.foreign].map((p) => (p === 'site.yml' ? p : unitFilesOf(siteDir, p)[0] || p)))
|
|
3117
|
-
].sort()
|
|
3133
|
+
const paths = [...new Set(othersChanged.map((p) => (p === 'site.yml' ? p : unitFilesOf(siteDir, p)[0] || p)))].sort()
|
|
3118
3134
|
note(`Changed on the backend by someone else, not in your files yet: ${paths.join(', ')}`)
|
|
3119
3135
|
note('Take them with `uniweb refresh` (or `uniweb pull`). Until then, pushing leaves them as they are.')
|
|
3120
3136
|
}
|
package/src/commands/pull.js
CHANGED
|
@@ -1296,14 +1296,15 @@ export async function pull(args = [], deps = {}) {
|
|
|
1296
1296
|
// say it (`readHeldUnits`). Replaced by each pull that takes the site's content. In the stand-in's
|
|
1297
1297
|
// cache, which comes back to the site with the others.
|
|
1298
1298
|
try {
|
|
1299
|
+
const held = leftOutOfPush(heldPages).flatMap((h) => h.uuids || [])
|
|
1299
1300
|
writeHeldUnits(projDir, client.origin, await heldUnitBaseline(projDir, client.origin, {
|
|
1300
|
-
held
|
|
1301
|
+
held,
|
|
1301
1302
|
// Where this copy kept each item before the pull, over where the backend keeps it — the same
|
|
1302
1303
|
// place for a page the app did not move, and the one a `sync.json` without items still has.
|
|
1303
1304
|
itemUuids: { ...collectUnitUuids(siteDoc), ...priorItems },
|
|
1304
1305
|
...(declarations.size ? { declarations } : {}),
|
|
1305
1306
|
fields
|
|
1306
|
-
}))
|
|
1307
|
+
}), held)
|
|
1307
1308
|
} catch (err) {
|
|
1308
1309
|
// The files did not emit: neither will a push from them, which this pull leaves to say why.
|
|
1309
1310
|
writeHeldUnits(projDir, client.origin, {})
|