uniweb 1.26.7 → 1.26.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": "1.26.7",
3
+ "version": "1.26.8",
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.6.4",
45
- "@uniweb/semantic-parser": "~1.13.2",
46
44
  "@uniweb/schemas": "~1.6.7",
47
- "@uniweb/content-writer": "~1.3.1"
45
+ "@uniweb/content-writer": "~1.3.1",
46
+ "@uniweb/core": "~1.6.4",
47
+ "@uniweb/semantic-parser": "~1.13.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/build": "~1.15.5",
50
+ "@uniweb/semantic-parser": "~1.13.2",
51
51
  "@uniweb/content-reader": "~1.5.8",
52
- "@uniweb/semantic-parser": "~1.13.2"
52
+ "@uniweb/build": "~1.15.5"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -61,6 +61,15 @@ function ancestor(cwd, a, b) {
61
61
 
62
62
  const holds = (cwd, sha) => text(cwd, ['cat-file', '-e', `${sha}^{commit}`]) !== null
63
63
 
64
+ /**
65
+ * ⛔ A SHALLOW CLONE CANNOT SAY TWO COMMITS ARE UNRELATED. It holds a branch's recent commits cut
66
+ * off from their past (`shallow = true` in `.gitmodules`, or a CI checkout), so a commit it holds
67
+ * can look as if it were on no line with the one checked out. Read as "diverged", that sent a
68
+ * mount that was only behind to be settled by hand. A fetch of the rest settles it
69
+ * (`takeLatest`); until then it is taken as behind (measured 2026-11-04).
70
+ */
71
+ const isShallow = (cwd) => text(cwd, ['rev-parse', '--is-shallow-repository']) === 'true'
72
+
64
73
  /** Does the mounted folder read the same at both commits? null when git cannot say. */
65
74
  function sameFolder(cwd, a, b, prefix) {
66
75
  try {
@@ -187,7 +196,7 @@ export async function mountedRepositories(siteDir) {
187
196
  else if (sameFolder(top, head, sub.recorded, prefix)) pin = 'same'
188
197
  else if (ancestor(top, head, sub.recorded)) pin = 'behind'
189
198
  else if (ancestor(top, sub.recorded, head)) pin = 'ahead'
190
- else pin = 'diverged'
199
+ else pin = isShallow(top) ? 'behind' : 'diverged'
191
200
  }
192
201
  const remote = top ? remoteOf(top) : null
193
202
  const follows = remote
@@ -258,7 +267,7 @@ export function standing(m, tip) {
258
267
  if (ancestor(m.top, tip, m.head)) return 'ahead'
259
268
  if (sameFolder(m.top, m.head, tip, m.prefix)) return 'current'
260
269
  if (ancestor(m.top, m.head, tip)) return 'newer'
261
- return 'diverged'
270
+ return isShallow(m.top) ? 'newer' : 'diverged'
262
271
  }
263
272
 
264
273
  /** Fetch a branch's tip into the mount's repository: objects and a remote-tracking ref, never its checkout. */
@@ -321,7 +330,7 @@ export async function takeLatest(siteDir, m) {
321
330
  let contained = ancestor(cur.top, cur.head, answer.tip)
322
331
  // ⭐ A shallow clone holds the branch's recent commits cut off from their past, so the branch
323
332
  // can look as if it does not contain the checkout. Only that past can say.
324
- if (contained !== true && text(cur.top, ['rev-parse', '--is-shallow-repository']) === 'true') {
333
+ if (contained !== true && isShallow(cur.top)) {
325
334
  try {
326
335
  await remoteCall(cur.top, ['fetch', '--quiet', '--unshallow', cur.follows.remote], 300_000)
327
336
  } catch (err) {