prolog-notebook 0.4.0 → 0.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.2] — 2026-08-30
4
+
5
+ ### Fixed
6
+
7
+ - **The update check asked the registry for a media type it is entitled to refuse**, so on some
8
+ of npm's edges every check answered `Could not reach the npm registry to check for updates.`
9
+ `application/vnd.npm.install-v1+json` is defined for the packument; `/{name}/latest` may
10
+ answer 406 to it, and does. Measured both ways from one machine minutes apart, which is what
11
+ made it look transient. It now asks for plain JSON, which that endpoint has always served.
12
+
13
+ ## [0.4.1] — 2026-08-30
14
+
15
+ ### Changed
16
+
17
+ - **The update notice says what you have**, not just what exists:
18
+
19
+ You have the latest version of Prolog Notebook, 0.4.1.
20
+ You have Prolog Notebook 0.4.0. The latest is 0.4.1.
21
+ Update with: npm i -g prolog-notebook
22
+
23
+ *Prolog Notebook 0.4.1 is the latest* states a fact about the world and leaves the reader to
24
+ work out that it is also a fact about them — which is the whole question they asked.
25
+
3
26
  ## [0.4.0] — 2026-08-30
4
27
 
5
28
  ### Added
@@ -7,7 +30,7 @@
7
30
  - **The CLI notices when it is out of date.** On real work — `run` — it asks npm at most once
8
31
  a day whether there is something newer, and says nothing unless there is:
9
32
 
10
- A newer Prolog Notebook is available: 0.4.0 0.5.0
33
+ You have Prolog Notebook 0.4.0. The latest is 0.5.0.
11
34
  Update with: npm i -g prolog-notebook
12
35
 
13
36
  `--check-update` forces the question and answers it either way, including *you are on the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prolog-notebook",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Jupyter-style notebooks for Prolog. Runs in the browser, installs nothing.",
5
5
  "type": "module",
6
6
  "main": "./src/node.js",
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "0e3e8fa",
3
- "built": "2026-08-30 15:12:30 UTC"
2
+ "commit": "a4ae8f0",
3
+ "built": "2026-08-30 15:34:45 UTC"
4
4
  }
package/src/update.js CHANGED
@@ -69,9 +69,16 @@ export function fileStore(path = cachePath()) {
69
69
  /**
70
70
  * Ask the registry which version is `latest`.
71
71
  *
72
- * The abbreviated document rather than the full packument: the full one carries
73
- * every version ever published and can be megabytes, for a question with a
74
- * one-line answer.
72
+ * `/{name}/latest` rather than the packument: the packument carries every version
73
+ * ever published and can be megabytes, for a question with a one-line answer.
74
+ * This endpoint answers in about 2 kB.
75
+ *
76
+ * PLAIN JSON, AND NOT THE ABBREVIATED TYPE. `application/vnd.npm.install-v1+json`
77
+ * is defined for the packument, and this endpoint is entitled to refuse it — some
78
+ * of npm's edges serve it anyway and others answer 406, which is why the first
79
+ * version of this shipped a notifier that reported "could not reach the registry"
80
+ * to some people and worked for others. Measured both ways, from one machine,
81
+ * minutes apart.
75
82
  *
76
83
  * @returns {Promise<string|null>} null for anything that goes wrong
77
84
  */
@@ -87,7 +94,7 @@ export async function latestFromRegistry({
87
94
  try {
88
95
  const base = String(registry).replace(/\/+$/, '');
89
96
  const response = await fetchImpl(`${base}/${name}/latest`, {
90
- headers: { accept: 'application/vnd.npm.install-v1+json' },
97
+ headers: { accept: 'application/json' },
91
98
  signal: AbortSignal.timeout(timeout),
92
99
  });
93
100
  if (!response.ok) return null;
@@ -150,9 +157,12 @@ export async function updateNotice({
150
157
  if (!newest) {
151
158
  return fresh && !force ? null : 'Could not reach the npm registry to check for updates.';
152
159
  }
160
+ // BOTH LINES START WITH WHAT YOU HAVE, because that is the question being
161
+ // asked. "Prolog Notebook 0.4.0 is the latest" states a fact about the world
162
+ // and leaves the reader to work out that it is also a fact about them.
153
163
  if (isNewer(newest, version)) {
154
- return `A newer Prolog Notebook is available: ${version} ${newest}\n`
164
+ return `You have Prolog Notebook ${version}. The latest is ${newest}.\n`
155
165
  + 'Update with: npm i -g prolog-notebook';
156
166
  }
157
- return force ? `Prolog Notebook ${version} is the latest.` : null;
167
+ return force ? `You have the latest version of Prolog Notebook, ${version}.` : null;
158
168
  }
package/src/version.js CHANGED
@@ -10,7 +10,7 @@
10
10
  export const NAME = 'Prolog Notebook';
11
11
 
12
12
  /** Must equal package.json's `version` — test/run.test.mjs enforces it. */
13
- export const VERSION = '0.4.0';
13
+ export const VERSION = '0.4.2';
14
14
 
15
15
  /** The two facts a licence notice is actually made of. */
16
16
  export const YEAR = '2026';