strom-research 1.15.0-beta.4 → 1.15.0-beta.5

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 CHANGED
@@ -48,7 +48,9 @@ Next time: run `strom`, or double-click the "Strom research" shortcut.
48
48
  Updates: strom looks for a new version at most once a day and says so;
49
49
  `strom update` installs it (checked like the installer does), and with it the
50
50
  newest security release of its Node line. Installed with
51
- npm: `npm install -g strom-research@latest`.
51
+ npm: `npm install -g strom-research@latest`. What is new in each version:
52
+ [CHANGELOG.md](CHANGELOG.md) ([čeština](CHANGELOG.cs.md), [Deutsch](CHANGELOG.de.md));
53
+ `strom --version` and `strom update` link to it in the research language.
52
54
 
53
55
  ## Features
54
56
 
@@ -754,6 +754,7 @@
754
754
  "ui.update.downloading": "Stahuji strom {version}…",
755
755
  "ui.update.failed": "Aktualizace se nepovedla: {detail}. strom zůstává, jak byl.",
756
756
  "ui.update.done": "✓ strom je aktualizovaný: {previous} → {version}.",
757
+ "ui.update.whatsnew": "Co je nového: {url}",
757
758
  "ui.update.restart": "strom je aktualizovaný — tahle nabídka ale ještě běží ve staré verzi. Po novém spuštění stromu (nebo zástupce „{shortcut}“) poběží nová verze.",
758
759
  "ui.o.update": "aktualizace",
759
760
  "ui.o.update.new": "vyšla {version} (tato je {current}) – řekni to uživateli; strom update ji s jeho souhlasem nainstaluje",
@@ -754,6 +754,7 @@
754
754
  "ui.update.downloading": "strom {version} wird heruntergeladen…",
755
755
  "ui.update.failed": "Die Aktualisierung hat nicht geklappt: {detail}. strom bleibt, wie er war.",
756
756
  "ui.update.done": "✓ strom ist aktualisiert: {previous} → {version}.",
757
+ "ui.update.whatsnew": "Was ist neu: {url}",
757
758
  "ui.update.restart": "strom ist aktualisiert — dieses Menü läuft aber noch in der alten Version. Nach einem Neustart von strom (oder der Verknüpfung „{shortcut}“) läuft die neue Version.",
758
759
  "ui.o.update": "Update",
759
760
  "ui.o.update.new": "{version} ist da (diese ist {current}) – sag es dem Benutzer; strom update installiert sie mit seiner Zustimmung",
package/dist/cli/main.js CHANGED
@@ -23,7 +23,7 @@ import { prependPath } from "../runners/runner.js";
23
23
  import { shimDir } from "../commands/session.js";
24
24
  import { isAgent } from "../core/which.js";
25
25
  import { appUrlShown, noticeStromApp } from "../core/stromapp.js";
26
- import { lastChannelOf, pendingTransition, updateChannel } from "../core/update.js";
26
+ import { lastChannelOf, pendingTransition, updateChannel, whatsNewUrl } from "../core/update.js";
27
27
  import { backupBefore, backupSaid } from "./backups.js";
28
28
  import { guestOf, installation, ownFolder, refreshTreeShim } from "../core/self.js";
29
29
  import { refreshGlobal } from "../agents/global.js";
@@ -133,6 +133,21 @@ function asOwnCommand(io, name, json, argv) {
133
133
  const text = (s) => asCommand(s, name, words);
134
134
  return { ...io, stdout: (s) => io.stdout(json ? asCommandJson(s, name, words) : text(s)), stderr: (s) => io.stderr(text(s)) };
135
135
  }
136
+ /**
137
+ * strom --version: the version on its first line (what a script reads), then where to read what is new in it — the
138
+ * changelog in the research language, on the branch of the installation's channel. --json gives the version alone.
139
+ */
140
+ function versionSaid(env, cwd, io, values = {}) {
141
+ const first = `strom ${VERSION}\n`;
142
+ try {
143
+ const lang = Context.fromOptions({ env, cwd, io, json: false, values }).uiLang();
144
+ return `${first}${ui(lang, "ui.update.whatsnew", { url: whatsNewUrl(VERSION, updateChannel(env), lang) })}\n`;
145
+ }
146
+ catch {
147
+ // no settings to read: the version alone
148
+ return first;
149
+ }
150
+ }
136
151
  export async function main(argv, io, env, cwd) {
137
152
  const json = argv.includes("--json");
138
153
  const own = ownCommand(env);
@@ -157,7 +172,7 @@ export async function main(argv, io, env, cwd) {
157
172
  if (argv.length === 0 && io.tty && !isAgent(env) && env.STROM_NONINTERACTIVE !== "1")
158
173
  argv = ["menu"];
159
174
  if (argv.length === 1 && (argv[0] === "--version" || argv[0] === "-v")) {
160
- io.stdout(json ? toJson({ version: VERSION }) : `strom ${VERSION}\n`);
175
+ io.stdout(json ? toJson({ version: VERSION }) : versionSaid(env, cwd, io));
161
176
  return EXIT.ok;
162
177
  }
163
178
  let resolved;
@@ -185,7 +200,7 @@ export async function main(argv, io, env, cwd) {
185
200
  return EXIT.ok;
186
201
  }
187
202
  if (v.version) {
188
- io.stdout(json ? toJson({ version: VERSION }) : `strom ${VERSION}\n`);
203
+ io.stdout(json ? toJson({ version: VERSION }) : versionSaid(env, cwd, io, v));
189
204
  return EXIT.ok;
190
205
  }
191
206
  const ctx = Context.fromOptions({ env, cwd, io, json, values: v });
package/dist/cli/ui.js CHANGED
@@ -681,6 +681,7 @@ export const UI = {
681
681
  "ui.update.downloading": "Downloading strom {version}…",
682
682
  "ui.update.failed": "The update did not work: {detail}. strom stays as it was.",
683
683
  "ui.update.done": "✓ strom is updated: {previous} → {version}.",
684
+ "ui.update.whatsnew": "What's new: {url}",
684
685
  "ui.update.restart": "strom is updated — this menu still runs the old version. Start strom again (or the shortcut \"{shortcut}\"), and the new version is at work.",
685
686
  "ui.o.update": "update",
686
687
  "ui.o.update.new": "{version} is out (this is {current}) — tell the user; strom update installs it with their yes",
@@ -23,7 +23,7 @@ import { mb, sharedMedia, tidyPlan, TIDY_SAID } from "../core/tidy.js";
23
23
  /** So many bytes of the shared store no research here names: worth a warning. */
24
24
  const MEDIA_UNNAMED_SAID = 500 * 1024 * 1024;
25
25
  import { Tree, VERSION } from "../core/tree.js";
26
- import { checked, installUpdate, isNewer, knownNewerVersion, lastChannelOf, latestRelease, newerNode, newerVersion, setInstallChannel, updateChannel } from "../core/update.js";
26
+ import { checked, installUpdate, isNewer, knownNewerVersion, lastChannelOf, latestRelease, newerNode, newerVersion, setInstallChannel, updateChannel, whatsNewUrl } from "../core/update.js";
27
27
  import { configDir, defaultHome, desktopDir, isolated, noLinks, ownCommand } from "../core/paths.js";
28
28
  import { backupBefore, backupSaid, lastBackupLine } from "../cli/backups.js";
29
29
  import { BACKUP_SAID_DAYS, lastBackup } from "../core/backup.js";
@@ -664,7 +664,9 @@ register({
664
664
  bridges++;
665
665
  }
666
666
  return {
667
- text: lines(newer ? t("ui.update.done", { version: done.version, previous: VERSION }) : undefined, done.node ? t("ui.update.node.done", done.node) : undefined, bridges ? t("ui.update.bridges", { n: bridges }) : undefined),
667
+ text: lines(newer ? t("ui.update.done", { version: done.version, previous: VERSION }) : undefined,
668
+ // what is new in the version installed: the changelog in the research language, on the branch of its channel
669
+ newer ? t("ui.update.whatsnew", { url: whatsNewUrl(done.version, channel, lang) }) : undefined, done.node ? t("ui.update.node.done", done.node) : undefined, bridges ? t("ui.update.bridges", { n: bridges }) : undefined),
668
670
  data: { previous: VERSION, version: done.version, updated: true, ...(done.node ? { node: done.node } : {}), bridges, ...extra, ...(backup ? { backup: { path: backup.path, bytes: backup.bytes } } : {}) },
669
671
  };
670
672
  },
package/dist/core/tree.js CHANGED
@@ -27,7 +27,7 @@ import { lastBackup } from "./backup.js";
27
27
  export const TREE_FILE = "strom.json";
28
28
  // between releases the candidate being made (a bridge run from the sources says what it is: the Strom app goes by it);
29
29
  // at a release the release's own (package.json)
30
- export const VERSION = "1.15.0-beta.4";
30
+ export const VERSION = "1.15.0-beta.5";
31
31
  const GITIGNORE = `# Strom Research — local state and large files are not versioned
32
32
  .strom/
33
33
  /media/
@@ -91,6 +91,20 @@ export function compareVersions(a, b) {
91
91
  export function isNewer(a, b) {
92
92
  return compareVersions(a, b) > 0;
93
93
  }
94
+ /** The changelog of the project on GitHub: CHANGELOG.md (en), CHANGELOG.cs.md, CHANGELOG.de.md in the repository's root. */
95
+ export const CHANGELOG_BASE = "https://github.com/ACiDekCZ/strom-research/blob";
96
+ const CHANGELOG_LANGS = new Set(["cs", "de"]);
97
+ /**
98
+ * What's new in a version: its section of the changelog in the person's language (another language: English), on the
99
+ * branch of the channel — main has the released versions only, beta the version being prepared. The section's anchor
100
+ * is the version without its prerelease part (`## 1.15.0` → #1150), the same from the first beta to the release.
101
+ */
102
+ export function whatsNewUrl(version, channel, lang) {
103
+ const code = lang.trim().toLowerCase().split(/[-_]/)[0] ?? "";
104
+ const file = CHANGELOG_LANGS.has(code) ? `CHANGELOG.${code}.md` : "CHANGELOG.md";
105
+ const anchor = (version.split(/[-+]/)[0] ?? version).replace(/\D/g, "");
106
+ return `${CHANGELOG_BASE}/${channel === "beta" ? "beta" : "main"}/${file}#${anchor}`;
107
+ }
94
108
  /** Where the official Node comes from (nodejs.org's layout: <base>/v<version>/<archive>, SHASUMS256.txt beside). */
95
109
  export function nodeBase(env) {
96
110
  return (env.STROM_NODE_BASE ?? "").trim() || "https://nodejs.org/dist";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strom-research",
3
- "version": "1.15.0-beta.4",
3
+ "version": "1.15.0-beta.5",
4
4
  "description": "Genealogical research toolkit for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "scripts": {
18
18
  "strom": "node src/cli.ts",
19
- "test": "node --test --import ./test/setup.ts --test-timeout=240000 --test-reporter=dot \"test/**/*.test.ts\"",
20
- "test:quick": "node --test --import ./test/setup.ts --test-timeout=240000 --test-reporter=dot \"test/unit/**/*.test.ts\" \"test/gedcom/**/*.test.ts\"",
19
+ "test": "node --test --import ./test/setup.ts --test-global-setup=./test/global-setup.ts --test-timeout=240000 --test-reporter=dot \"test/**/*.test.ts\"",
20
+ "test:quick": "node --test --import ./test/setup.ts --test-global-setup=./test/global-setup.ts --test-timeout=240000 --test-reporter=dot \"test/unit/**/*.test.ts\" \"test/gedcom/**/*.test.ts\"",
21
21
  "typecheck": "tsc --noEmit -p tsconfig.json",
22
22
  "build": "tsc -p tsconfig.build.json",
23
23
  "prepack": "npm run build",