Files
tajniak81andClaude Opus 5.5 40d515d15b Add toggles, embeds, link cards, block links, archive, version diff, space export and desktop 1.0
Editor:
- Toggles (Tiptap Details). Open state is per reader, not saved.
- Embeds for YouTube, Vimeo, Loom, Figma, CodePen, Spotify, Google Docs
  and Maps, in sandboxed frames. Other addresses become link cards.
- Link cards with title, description and picture read by docwell-server
  (GET /link-preview). The fetcher refuses private, loopback, link-local
  and CGNAT addresses after DNS resolution, redirects included.
- Block links: a margin button gives a block a short id and copies
  /p/<id>#b-<block>. Opening one jumps to the block and flashes it.
- Markdown, HTML and PDF exports handle the new blocks; HTML import reads
  <details> as a toggle.

Pages and spaces:
- History gets a Changes view: block and word diff against the previous
  version or the page as it is now.
- Archive: archived pages leave the tree and become read-only but stay
  readable; a space's Archive lists them with Unarchive. New migration
  (pages.archived_at) and page.archived / page.unarchived webhook events.
- Full space export (GET /spaces/{id}/export): a zip of Markdown or HTML
  files with subpages in folders, an index, and attachments under _files/.
  Links between exported pages and to attachments become relative paths.

Desktop 1.0:
- Several servers, each with its own sign-in; old settings files carry over.
- Session tokens in the system keychain (go-keyring), moved out of
  localStorage on first start.
- Native menu bar (File, Edit, View, Window, Help) with a Server submenu.
- docwell:// links may point at a block.
- Release workflow builds Windows NSIS, macOS DMG and Linux deb, rpm and
  AppImage installers and attaches them to the release;
  build/set-version.mjs stamps the version into their metadata.

Not yet run: the release workflow, the desktop menus by eye, and macOS or
Linux builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:14:14 +01:00

46 lines
1.9 KiB
JavaScript

// SPDX-License-Identifier: AGPL-3.0-or-later
// Stamps a release version into the installers' metadata before packaging:
// node build/set-version.mjs 1.2.3
// (Windows file info and NSIS, the macOS Info.plist, the Linux packages and
// build/config.yml). The binary's own version comes from -ldflags main.version.
import { readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const version = process.argv[2]?.replace(/^v/, "");
if (!version || !/^\d+\.\d+\.\d+([-.+][0-9A-Za-z.-]+)?$/.test(version)) {
console.error("usage: node build/set-version.mjs <version, e.g. 1.2.3>");
process.exit(1);
}
// Windows file versions are four numbers; pre-release suffixes are left out.
const numeric = version.match(/^\d+\.\d+\.\d+/)[0];
const dir = dirname(fileURLToPath(import.meta.url));
const edits = [
["config.yml", /(version: )"[^"]*"( # The application version)/, `$1"${version}"$2`],
["windows/info.json", /("file_version": )"[^"]*"/, `$1"${numeric}"`],
["windows/info.json", /("ProductVersion": )"[^"]*"/, `$1"${version}"`],
["windows/nsis/wails_tools.nsh", /(!define INFO_PRODUCTVERSION )"[^"]*"/, `$1"${numeric}"`],
["linux/nfpm/nfpm.yaml", /^version: "[^"]*"/m, `version: "${version}"`],
[
"darwin/Info.plist",
/(<key>CFBundleShortVersionString<\/key>\s*<string>)[^<]*(<\/string>)/,
`$1${version}$2`,
],
["darwin/Info.plist", /(<key>CFBundleVersion<\/key>\s*<string>)[^<]*(<\/string>)/, `$1${numeric}$2`],
];
for (const [file, pattern, replacement] of edits) {
const path = join(dir, file);
const before = readFileSync(path, "utf8");
const after = before.replace(pattern, replacement);
if (after === before && !before.match(pattern)) {
console.error(`${file}: version field not found`);
process.exit(1);
}
writeFileSync(path, after);
}
console.log(`version ${version} set`);