[261] Version 1.0.0-beta.1 und Buildnummer nach Datum (JJMMTT.N): scripts/build-number.cjs (Env DOSSIER_BUILD, sonst Datum + Commits des Tages, ohne Git .0), Vite-define, CLI --version, Über-Dialog/Statusleiste, macOS bundleVersion; TODO und Release-Doku
This commit is contained in:
24 files changed
+177
-16
No files matched your search
@@ -10,7 +10,7 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
stehen im Archiv („Bewusst nicht übernommen“).
|
||||
- **Grösse** (eine Person mit Agenten): S ≤ 1 Tag · M ≤ 1 Woche · L ≤ 1 Monat · XL > 1 Monat.
|
||||
Steht keine Grösse im Archiv, ist sie hier geschätzt.
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 260);
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 261);
|
||||
nie eine ID wiederverwenden oder umnummerieren. Präfix-IDs (`[K]`, `[G]`, `[T]`, `[B]`, `[C]`) bleiben.
|
||||
- **Pro Punkt:** was fehlt · wo im Code · Grösse. Höchstens ein bis drei Sätze je Punkt;
|
||||
Messwerte und Befunde gehören in den Commit.
|
||||
@@ -54,6 +54,7 @@ Raumprogramm gegen Modell → Grundrisse/Schnitte/Ansichten 1:200 (Vorprojekt 1:
|
||||
3D-Bilder/Axonometrie/Schatten → Flächen/Volumen SIA 416 und Kennzahlen → Kostenschätzung grob → Abgabe-Layouts (Plakate A0/A1,
|
||||
Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
|
||||
- ◐ **[261]** Version und Buildnummer (15.11., Entscheid Maintainer): Anwender-Version semver **1.0.0-beta.1** (`package.json`, `tauri.conf.json`, App-`Cargo.toml`, `website/hugo.toml`; Kern-Crates bleiben 0.1.0, nichts Sichtbares). Interne Buildnummer **`JJMMTT.N`** aus `scripts/build-number.cjs`: Env `DOSSIER_BUILD` gewinnt, sonst Datum + Anzahl Commits des Tages (`git log --since=midnight`), ohne Git `JJMMTT.0`. Eingebacken über Vite-`define` (`__DOSSIER_BUILD__`, `src/update/buildInfo.ts`; Browser/Electron/Tauri) und `scripts/build-cli.mjs` (`dossier-cli --version`); Anzeige „1.0.0-beta.1 (Build 261115.1)“ in Über-Dialog, Einstellungen, Startbildschirm, macOS-Info-Fenster (shortVersion) und dezent in der Statusleiste; `tauri:build` setzt `bundle.macOS.bundleVersion` (CFBundleVersion). Tests: `src/update/buildNumber.test.ts`. **Offen:** nicht in der Tauri-App/auf dem Mac geprüft (Prüfschritt 13.35); Electron-`buildVersion` nicht gesetzt (nur Vite-Anzeige); Projektdatei trägt (noch) kein Feld für die schreibende App-Version/Build (bräuchte Modellfeld in Rust + `KNOWN_KEYS` + Fassade, S); Zähler zählt Commits, nicht Builds (zwei Builds ohne Commit dazwischen = gleiche Nummer; Abhilfe `DOSSIER_BUILD=261115.3`). Grösse S.
|
||||
- ◐ **[260]** Fenster/Türen im Grundriss: Darstellungsart **symbolisch** oder **geschnitten** wählbar (15.11., Entscheid Maintainer). Symbolisch = Öffnungssymbol nach Norm unabhängig von der Schnitthöhe (heutiges Verhalten für Öffnungen im Schnitt, Brüstungen/Stürze über/unter Schnitt als Symbol); geschnitten = Darstellung nach der tatsächlichen Schnitthöhe (Öffnung über dem Schnitt: Wand geschlossen, Öffnung als Linie über Schnitt). Einstellbar im Objekteinstellungsfenster (Taste T) je Fenster/Tür bzw. Typ, Vorgabe aus Modelldarstellung.
|
||||
**Umgesetzt 15.11.:** Modell `OpeningPlanMode` (`symbolisch` | `geschnitten`) als `Opening.planMode`, `WindowType.planMode`, `DoorType.planMode` und
|
||||
Modelldarstellung `walls.openingPlanMode` (Kern `generated.rs`, `npm run gen:types`); Rangfolge Element > Typ > Modelldarstellung > symbolisch
|
||||
|
||||
@@ -29,6 +29,7 @@ E 2'600'048 / N 1'200'046 und E 2'600'060 / N 1'200'056. Raumprogramm als CSV (`
|
||||
| # | Schritt in Dossier | Erwartet | Status |
|
||||
|---|---|---|---|
|
||||
| 0.1 | App starten, Startbildschirm „Neues Projekt“ (oder Datei → Neu, ⌘N) | leeres Projekt mit Erdgeschoss, Obergeschoss, Schnitt A, Ansicht Süd | ✅ |
|
||||
| 0.0 | „Über dossier“ öffnen (Klick auf die Wortmarke) | zeigt Version und Build, z. B. „1.0.0-beta.1 (Build 261115.1)“; **Build bei jedem Befund angeben** (steht auch dezent in der Statusleiste) | |
|
||||
| 0.2 | Datei → Speichern unter … (⇧⌘S) als `wbw-test.obp` | Datei liegt am gewählten Ort, Titel zeigt den Namen | ✅ (Browser: Download) |
|
||||
|
||||
## 1. Grundstück und Kontext laden
|
||||
@@ -175,6 +176,7 @@ und Befunde in `TODO.md` eintragen.
|
||||
| 13.32 | **Erker in Schnitt und Ansicht ([216]):** Musterhaus komplex, Ansicht Süd/Ost und Schnitt B-B 1:100 am Bildschirm (Metal), dazu das 3D des Erkers | Fenster sitzen im Wandloch der Erkerwand, Facetten laufen senkrecht durch die Geschosse, Deckenrand folgt der Sehne ohne Kappe; die breite Facette über UG–OG ist nach Geschmack zu beurteilen (Entscheid Maintainer offen); Plan, Schnitt, Ansicht und 3D stimmen überein |
|
||||
| 13.33 | **Raumstempel und Baulinie ([256]):** Musterhaus komplex DG 1:100 und Wettbewerb EG 1:200 am Bildschirm (Metal) und als PDF | Stempel «Schlafen» steht in 90 % in der Lücke zwischen Gauben-Umriss und Achse; die gestrichelte Baulinie/Parzellengrenze läuft nicht durch Masszahlen (2.69, 1.20, 20.39) |
|
||||
| 13.34 | **Grafikkarte weg, Plan und 3D ([118], [206]):** Plan und 3D offen, im Begehen (Umschalt+F) die Kamera verstellen, dann Mac in den Ruhezustand/Grafik wechseln; mehrmals wiederholen | Plan bleibt dabei beim SVG und flackert nicht; 3D baut nach Pausen neu auf, Kamera, Standpunkt und Begehen bleiben erhalten, G/WASD wirken weiter; bei dauerndem Ausfall Hinweis «3D-Engine nicht verfügbar», Speichern geht |
|
||||
| 13.35 | **Version und Build ([261]):** `npm run tauri:build`, App im Finder wählen → Informationen; Dossier → Über dossier; Statusleiste rechts unten | Finder: Version 1.0.0-beta.1 (Build 261115.N in der Bundle-Version); Über-Dialog „1.0.0-beta.1 (Build …)“ gleiche Nummer; Statusleiste „Build …“ |
|
||||
|
||||
## 14. Datensicherheit auf dem Mac ([116], Audit 14.11.)
|
||||
|
||||
|
||||
@@ -209,8 +209,7 @@ Ehrlich vorweg: **Der Durchlauf des ganzen Referenz-Ablaufs auf dem Mac ist noch
|
||||
|
||||
## Offene Fragen an den Maintainer
|
||||
|
||||
1. **[Frage M: Versionsnummer]** Der Stand im Repo ist `0.1.0` (`package.json`, `tauri.conf.json`); [30] nennt als Ziel «1.0.0-beta», der Release-Abschnitt «1.0.0».
|
||||
Was steht auf dem Paket? Datum: Ziel 12.12.2026?
|
||||
1. ~~Versionsnummer~~ — erledigt durch [261] (15.11.): 1.0.0-beta.N, Build JJMMTT.N (Über Dossier und Statusleiste zeigen beides).
|
||||
2. **[Frage M: Signierung/Notarisierung/Updater]** Wird die Mac-App signiert und notarisiert, und läuft der Updater (Endpunkt zeigt auf `git.openbureau.ch`)? Sonst gehört ein
|
||||
Hinweis zu Gatekeeper in die Notes.
|
||||
3. **[Frage M: Download-Ort]** Wo liegen die Pakete (Download-Seite, git.openbureau.ch, GitHub)? Die README sagt «Fertige Installer gibt es noch nicht».
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "dossier",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0-beta.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dossier",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0-beta.1",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.11.1",
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "dossier",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0-beta.1",
|
||||
"type": "module",
|
||||
"main": "scripts/electron-main.cjs",
|
||||
"desktopName": "dossier.desktop",
|
||||
@@ -19,7 +19,7 @@
|
||||
"e2e:perf": "E2E_PERF=1 playwright test bigBuilding",
|
||||
"build:render-png": "cargo build --release --features png --bin render_png --manifest-path src-tauri/render3d/Cargo.toml",
|
||||
"gen:types": "DOSSIER_GEN_TYPES=1 cargo test --quiet --lib --manifest-path src-tauri/core/Cargo.toml ts_types_aktuell",
|
||||
"build:cli": "esbuild src/cli/main.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist-cli/dossier-cli.mjs --log-level=warning",
|
||||
"build:cli": "node scripts/build-cli.mjs",
|
||||
"tauri": "tauri",
|
||||
"tauri:dev": "node scripts/tauri-native.mjs dev",
|
||||
"tauri:build": "node scripts/tauri-native.mjs build",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// [261] CLI-Bundle mit eingebackener Version + Buildnummer (`npm run build:cli`); sonst wie vorher: esbuild → dist-cli/dossier-cli.mjs.
|
||||
import { build } from "esbuild";
|
||||
import { createRequire } from "node:module";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const { computeBuildNumber } = createRequire(import.meta.url)("./build-number.cjs");
|
||||
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
||||
await build({
|
||||
entryPoints: ["src/cli/main.ts"],
|
||||
bundle: true,
|
||||
platform: "node",
|
||||
format: "esm",
|
||||
target: "node20",
|
||||
outfile: "dist-cli/dossier-cli.mjs",
|
||||
logLevel: "warning",
|
||||
define: { __DOSSIER_VERSION__: JSON.stringify(pkg.version), __DOSSIER_BUILD__: JSON.stringify(computeBuildNumber()) },
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
// [261] Buildnummer nach Datum: `JJMMTT.N` (z. B. 261115.1). Eine Quelle für Vite (`define`), CLI-Build,
|
||||
// Tauri-Build (`bundle.macOS.bundleVersion`) und Electron.
|
||||
// 1. Umgebungsvariable DOSSIER_BUILD (z. B. CI) gewinnt, wenn sie wie JJMMTT.N aussieht.
|
||||
// 2. Sonst heutiges Datum (lokal) + N = Anzahl Commits seit Mitternacht im Git-Log (`git log --since=midnight`).
|
||||
// Der Zähler wächst damit mit jedem Commit des Tages; zwei Builds ohne Commit dazwischen tragen dieselbe Nummer.
|
||||
// 3. Ohne Git (Tarball) oder bei Fehler: `JJMMTT.0`.
|
||||
const { execFileSync } = require("node:child_process");
|
||||
|
||||
const BUILD_RE = /^\d{6}\.\d+$/;
|
||||
|
||||
/** `JJMMTT` aus einem Datum (lokale Zeit). */
|
||||
function dateStamp(d) {
|
||||
const p = (n) => String(n).padStart(2, "0");
|
||||
return `${p(d.getFullYear() % 100)}${p(d.getMonth() + 1)}${p(d.getDate())}`;
|
||||
}
|
||||
|
||||
/** Anzahl Commits seit Mitternacht, oder 0 ohne Git. */
|
||||
function commitsToday(cwd) {
|
||||
try {
|
||||
const out = execFileSync("git", ["log", "--since=midnight", "--format=%H"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
|
||||
return out.split("\n").filter(Boolean).length;
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ env?: Record<string, string|undefined>, now?: Date, commitCount?: number, cwd?: string }} [opts]
|
||||
* @returns {string} Buildnummer `JJMMTT.N`
|
||||
*/
|
||||
function computeBuildNumber(opts = {}) {
|
||||
const env = opts.env ?? process.env;
|
||||
const override = (env.DOSSIER_BUILD ?? "").trim();
|
||||
if (BUILD_RE.test(override)) return override;
|
||||
const now = opts.now ?? new Date();
|
||||
const n = opts.commitCount ?? commitsToday(opts.cwd);
|
||||
return `${dateStamp(now)}.${Math.max(0, Math.floor(n))}`;
|
||||
}
|
||||
|
||||
module.exports = { computeBuildNumber, dateStamp, BUILD_RE };
|
||||
@@ -4,6 +4,7 @@
|
||||
// unverändert mit WebGL. Opt-out: DOSSIER_NO_NATIVE2D=1.
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
// Veraltete WASM-Pakete zuerst neu bauen (sonst passen Oberfläche und Kern nach einem Pull nicht zusammen).
|
||||
if (!process.env.DOSSIER_NO_WASM_CHECK) {
|
||||
@@ -14,6 +15,12 @@ if (!process.env.DOSSIER_NO_WASM_CHECK) {
|
||||
const args = process.argv.slice(2);
|
||||
const native = process.platform === "darwin" && !process.env.DOSSIER_NO_NATIVE2D;
|
||||
if (native && !args.includes("--features")) args.push("--features", "native2d");
|
||||
// [261] Buildnummer JJMMTT.N: Vite bäckt sie über `define` ein (Env DOSSIER_BUILD), macOS bekommt sie als CFBundleVersion
|
||||
// (`bundle.macOS.bundleVersion`; „Version“ im Finder bleibt die semver aus tauri.conf.json).
|
||||
const build = createRequire(import.meta.url)("./build-number.cjs").computeBuildNumber();
|
||||
process.env.DOSSIER_BUILD = build;
|
||||
if (args[0] === "build" && !args.includes("--config")) args.push("--config", JSON.stringify({ bundle: { macOS: { bundleVersion: build } } }));
|
||||
console.log(`[tauri-native] Build ${build}`);
|
||||
console.log(`[tauri-native] tauri ${args.join(" ")}`);
|
||||
const child = spawn("npx", ["tauri", ...args], { stdio: "inherit" });
|
||||
child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
|
||||
Generated
+1
-1
@@ -391,7 +391,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cad-tauri"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0-beta.1"
|
||||
dependencies = [
|
||||
"fs4",
|
||||
"objc2 0.6.4",
|
||||
|
||||
@@ -11,7 +11,7 @@ exclude = ["render2d", "render3d", "kernel2d", "dwgimport", "trucksolid", "hatch
|
||||
|
||||
[package]
|
||||
name = "cad-tauri"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0-beta.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "dossier",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0-beta.1",
|
||||
"identifier": "ch.dossier.cad",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -186,6 +186,10 @@ function ifcSchemaFlag(args: Args): "IFC4" | "IFC2X3" {
|
||||
return fail(`--schema: "${v}" unbekannt (4 oder 2x3)`);
|
||||
}
|
||||
|
||||
// [261] Version + Buildnummer: von scripts/build-cli.mjs eingebacken (esbuild define).
|
||||
declare const __DOSSIER_VERSION__: string;
|
||||
declare const __DOSSIER_BUILD__: string;
|
||||
|
||||
function parseArgs(argv: string[]): Args {
|
||||
const positional: string[] = [];
|
||||
const flags = new Map<string, string>();
|
||||
@@ -472,6 +476,10 @@ export async function run(argv: string[]): Promise<number> {
|
||||
const convertMode = args.positional[0] === "convert";
|
||||
// `dossier-cli bench --big [--floors 8 --apartments 15]` = `dossier-cli :gross bench` ([20]).
|
||||
if (args.positional[0] === "bench" && args.flags.has("big")) args.positional.unshift(":gross");
|
||||
if (args.flags.has("version") || args.positional[0] === "--version") {
|
||||
process.stdout.write(`dossier-cli ${`${typeof __DOSSIER_VERSION__ !== "undefined" ? __DOSSIER_VERSION__ : "0.0.0-dev"} (Build ${typeof __DOSSIER_BUILD__ !== "undefined" ? __DOSSIER_BUILD__ : "dev"})`}\n`);
|
||||
return 0;
|
||||
}
|
||||
const [file, command, ...rest] = args.positional;
|
||||
if (file === "bcf-info") return runBcfInfo(command);
|
||||
if (file === "pointcloud-info") return pointCloudInfo(args, command);
|
||||
|
||||
@@ -3221,6 +3221,8 @@ export const de = {
|
||||
"clash.failed": "Kollisionsprüfung fehlgeschlagen",
|
||||
"about.title": "Über dossier",
|
||||
"about.version": "Version",
|
||||
"about.build": "Build",
|
||||
"status.build.title": "Interne Buildnummer (JJMMTT.N) — bei jeder Fehlermeldung angeben",
|
||||
"about.desc": "Open Source Computer Aided Architecture Design — 2D-Vektordesign sowie normgerechte Pläne aus einem semantischen Gebäudemodell.",
|
||||
"about.copyright": "© 2026 Karim Gabriele Varano",
|
||||
"about.license": "Lizenz: AGPL-3.0-or-later",
|
||||
|
||||
@@ -3208,6 +3208,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"mesh.export.failed": "Mesh export failed",
|
||||
"about.title": "About dossier",
|
||||
"about.version": "Version",
|
||||
"about.build": "Build",
|
||||
"status.build.title": "Internal build number (YYMMDD.N) — include it with every bug report",
|
||||
"about.desc": "Open Source Computer Aided Architecture Design — 2D vector design plus standards-compliant drawings from a semantic building model.",
|
||||
"about.copyright": "© 2026 Karim Gabriele Varano",
|
||||
"about.license": "License: AGPL-3.0-or-later",
|
||||
|
||||
@@ -19,6 +19,7 @@ import { openRenderDialog } from "../state/renderDialogHook";
|
||||
import { openShortcutOverview } from "../state/shortcutOverviewHook";
|
||||
import { openImageExportDialog } from "../state/imageExportDialogHook";
|
||||
import { APP_VERSION } from "../ui/TopBar";
|
||||
import { BUILD_INFO } from "../update/buildInfo";
|
||||
import type { View3d, ViewType } from "../model/viewTypes";
|
||||
import type { SelectionActionId } from "../state/selectionActions";
|
||||
|
||||
@@ -529,7 +530,7 @@ export function useNativeAppMenu(
|
||||
About: {
|
||||
name: "dossier",
|
||||
version: APP_VERSION,
|
||||
shortVersion: APP_VERSION,
|
||||
shortVersion: `${APP_VERSION} (${BUILD_INFO.build})`,
|
||||
copyright: t("about.copyright"),
|
||||
credits: `${t("about.desc")}\n\n${t("about.license")} · ${t("about.suite")}`,
|
||||
},
|
||||
|
||||
@@ -22,6 +22,7 @@ import type { LineCap, LineEnds, LineJoin } from "../core";
|
||||
import type { ThemeMode } from "../theme/themeMode";
|
||||
import { checkForUpdate, getUpdateSnoozeUntil, setUpdateSnooze } from "../update/checkForUpdate";
|
||||
import { getRunningVersion } from "../update/version";
|
||||
import { BUILD_INFO, formatBuildInfo } from "../update/buildInfo";
|
||||
import { getBlenderPath, setBlenderPath } from "../state/blenderSettings";
|
||||
import {
|
||||
fetchVersionHistory,
|
||||
@@ -330,7 +331,7 @@ export function SettingsDialog({
|
||||
<section className="imp-section">
|
||||
<div className="imp-section-title">{t("settings.section.update")}</div>
|
||||
<div className="imp-note">
|
||||
{t("about.version")} {runningVersion ?? APP_VERSION}
|
||||
{t("about.version")} {formatBuildInfo({ ...BUILD_INFO, version: runningVersion ?? APP_VERSION }, t("about.build"))}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -8,6 +8,7 @@ import { getLanguage, t } from "../i18n";
|
||||
import { isTauriRuntime } from "../native/projectFile";
|
||||
import { APP_VERSION } from "./TopBar";
|
||||
import { getRunningVersion } from "../update/version";
|
||||
import { BUILD_INFO, formatBuildInfo } from "../update/buildInfo";
|
||||
import {
|
||||
getRecentProjects,
|
||||
removeRecentProject,
|
||||
@@ -94,7 +95,7 @@ export function StartScreen({
|
||||
)}
|
||||
</div>
|
||||
<div className="start-footer">
|
||||
{t("about.version")} {version ?? APP_VERSION}
|
||||
{t("about.version")} {formatBuildInfo({ ...BUILD_INFO, version: version ?? APP_VERSION }, t("about.build"))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useEffect, useRef, useState, memo } from "react";
|
||||
import type { SnapSettings } from "../tools/types";
|
||||
import { t } from "../i18n";
|
||||
import { TraceControl } from "./TraceControl";
|
||||
import { BUILD_INFO, formatBuildShort } from "../update/buildInfo";
|
||||
|
||||
export interface StatusBarProps {
|
||||
/** [205] Pausfolie schaltbar (2D-Ansicht: Grundriss, Schnitt, Ansicht, Zeichnung). */
|
||||
@@ -459,6 +460,8 @@ export const StatusBar = memo(function StatusBar({
|
||||
<Field label={t("status.floor")} value={activeFloor} />
|
||||
<Sep />
|
||||
<Field label={t("status.layer")} value={activeLayer} />
|
||||
<Sep />
|
||||
<span className="sb-field" title={t("status.build.title")}><span className="sb-val" style={{ opacity: 0.55 }}>{formatBuildShort(BUILD_INFO, t("about.build"))}</span></span>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
|
||||
+3
-2
@@ -13,6 +13,7 @@ import { t } from "../i18n";
|
||||
import { useModalFocus } from "./modalFocus";
|
||||
import { checkForUpdate } from "../update/checkForUpdate";
|
||||
import { getRunningVersion } from "../update/version";
|
||||
import { BUILD_INFO, formatBuildInfo } from "../update/buildInfo";
|
||||
import { memo, useEffect, useRef, useState } from "react";
|
||||
import { useLiveScale, zoomPercentOf } from "../state/liveScaleStore";
|
||||
import { createPortal } from "react-dom";
|
||||
@@ -884,7 +885,7 @@ function applyLineHeight(doc: RichTextDoc, range: TextRange | null, lineHeight:
|
||||
/** App-Version (spiegelt src-tauri/tauri.conf.json). Exportiert für appMenu.ts
|
||||
* (native macOS-Menüleiste, „Über Dossier"), damit die Versionsnummer nur an
|
||||
* dieser einen Stelle gepflegt wird. */
|
||||
export const APP_VERSION = "0.1.0";
|
||||
export const APP_VERSION = BUILD_INFO.version;
|
||||
|
||||
/**
|
||||
* „Über"-Dialog (In-App, dunkel) — App-Marke, Version, Kurzbeschreibung und die
|
||||
@@ -926,7 +927,7 @@ function AboutDialog({ onClose }: { onClose: () => void }) {
|
||||
dossier<span className="brand-dot">.</span>
|
||||
</div>
|
||||
<div className="about-version">
|
||||
{t("about.version")} {runningVersion ?? APP_VERSION}
|
||||
{t("about.version")} {formatBuildInfo({ ...BUILD_INFO, version: runningVersion ?? APP_VERSION }, t("about.build"))}
|
||||
</div>
|
||||
<p className="about-desc">{t("about.desc")}</p>
|
||||
<div className="about-meta">
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// [261] Version und Buildnummer der laufenden Oberfläche. Werte setzt Vite (`define`, vite.config.ts), der CLI-Build
|
||||
// (scripts/build-cli.mjs) und Vitest (vitest.config.ts) aus package.json + scripts/build-number.cjs; fehlt `define`, steht „dev“.
|
||||
|
||||
declare const __DOSSIER_VERSION__: string;
|
||||
declare const __DOSSIER_BUILD__: string;
|
||||
|
||||
export interface BuildInfo {
|
||||
/** Anwender-Version (semver, z. B. 1.0.0-beta.1). */
|
||||
version: string;
|
||||
/** Interne Buildnummer JJMMTT.N. */
|
||||
build: string;
|
||||
}
|
||||
|
||||
export const BUILD_INFO: BuildInfo = {
|
||||
version: typeof __DOSSIER_VERSION__ !== "undefined" ? __DOSSIER_VERSION__ : "0.0.0-dev",
|
||||
build: typeof __DOSSIER_BUILD__ !== "undefined" ? __DOSSIER_BUILD__ : "dev",
|
||||
};
|
||||
|
||||
/** „1.0.0-beta.1 (Build 261115.1)“; `buildWord` kommt aus t("about.build"). */
|
||||
export function formatBuildInfo(info: BuildInfo, buildWord: string): string {
|
||||
return `${info.version} (${buildWord} ${info.build})`;
|
||||
}
|
||||
|
||||
/** „Build 261115.1“ für die Statusleiste. */
|
||||
export function formatBuildShort(info: BuildInfo, buildWord: string): string {
|
||||
return `${buildWord} ${info.build}`;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { createRequire } from "node:module";
|
||||
import { formatBuildInfo, formatBuildShort } from "./buildInfo";
|
||||
|
||||
const { computeBuildNumber, dateStamp, BUILD_RE } = createRequire(import.meta.url)("../../scripts/build-number.cjs") as {
|
||||
computeBuildNumber: (o?: { env?: Record<string, string | undefined>; now?: Date; commitCount?: number }) => string;
|
||||
dateStamp: (d: Date) => string;
|
||||
BUILD_RE: RegExp;
|
||||
};
|
||||
|
||||
describe("[261] Buildnummer JJMMTT.N", () => {
|
||||
const now = new Date(2026, 10, 15, 14, 30); // 15.11.2026 lokal
|
||||
it("Datum als JJMMTT", () => {
|
||||
expect(dateStamp(now)).toBe("261115");
|
||||
expect(dateStamp(new Date(2027, 0, 5))).toBe("270105");
|
||||
});
|
||||
it("Zähler = Commits des Tages", () => {
|
||||
expect(computeBuildNumber({ env: {}, now, commitCount: 1 })).toBe("261115.1");
|
||||
expect(computeBuildNumber({ env: {}, now, commitCount: 2 })).toBe("261115.2");
|
||||
expect(computeBuildNumber({ env: {}, now, commitCount: 12 })).toBe("261115.12");
|
||||
});
|
||||
it("ohne Git: JJMMTT.0", () => {
|
||||
expect(computeBuildNumber({ env: {}, now, commitCount: 0 })).toBe("261115.0");
|
||||
});
|
||||
it("DOSSIER_BUILD überschreibt (nur gültiges Format)", () => {
|
||||
expect(computeBuildNumber({ env: { DOSSIER_BUILD: "261201.7" }, now, commitCount: 3 })).toBe("261201.7");
|
||||
expect(computeBuildNumber({ env: { DOSSIER_BUILD: "unsinn" }, now, commitCount: 3 })).toBe("261115.3");
|
||||
expect(computeBuildNumber({ env: { DOSSIER_BUILD: "" }, now, commitCount: 3 })).toBe("261115.3");
|
||||
});
|
||||
it("echter Aufruf liefert gültiges Format", () => {
|
||||
expect(computeBuildNumber({ env: {} })).toMatch(BUILD_RE);
|
||||
});
|
||||
});
|
||||
|
||||
describe("[261] Anzeige", () => {
|
||||
it("Version + Build", () => {
|
||||
expect(formatBuildInfo({ version: "1.0.0-beta.1", build: "261115.1" }, "Build")).toBe("1.0.0-beta.1 (Build 261115.1)");
|
||||
expect(formatBuildShort({ version: "1.0.0-beta.1", build: "261115.1" }, "Build")).toBe("Build 261115.1");
|
||||
});
|
||||
});
|
||||
@@ -1,8 +1,12 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { createRequire } from "node:module";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const { buildCsp } = createRequire(import.meta.url)("./scripts/csp.cjs") as { buildCsp: () => string };
|
||||
// [261] Version (package.json) und Buildnummer JJMMTT.N (scripts/build-number.cjs) in die Oberfläche einbacken.
|
||||
const { computeBuildNumber } = createRequire(import.meta.url)("./scripts/build-number.cjs") as { computeBuildNumber: () => string };
|
||||
const pkg = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as { version: string };
|
||||
|
||||
// [117] CSP nur im Build (Meta-Tag): der Dev-Server braucht Inline-Skripte für HMR/React-Refresh.
|
||||
const cspPlugin = {
|
||||
@@ -16,6 +20,7 @@ const cspPlugin = {
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(), cspPlugin],
|
||||
define: { __DOSSIER_VERSION__: JSON.stringify(pkg.version), __DOSSIER_BUILD__: JSON.stringify(computeBuildNumber()) },
|
||||
// Tauri lädt die App über den Vite-Dev-Server; dessen Logs (cargo/tauri)
|
||||
// sollen nicht vom Bildschirm gewischt werden, und Tauri-eigene Env-Vars
|
||||
// müssen im Client sichtbar sein.
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const pkg = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as { version: string };
|
||||
|
||||
export default defineConfig({
|
||||
define: { __DOSSIER_VERSION__: JSON.stringify(pkg.version), __DOSSIER_BUILD__: JSON.stringify("000000.0") },
|
||||
test: {
|
||||
environment: "node",
|
||||
include: ["src/**/*.test.ts"],
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ disableKinds = ["taxonomy", "term", "rss"]
|
||||
|
||||
[params]
|
||||
description = "Dossier ist ein freies CAD für Architektur. Du baust ein Gebäude aus Bauteilen, Grundriss, Schnitt und Ansicht werden daraus berechnet. Open-Source-CAAD unter AGPL-3.0."
|
||||
version = "0.1.0"
|
||||
version = "1.0.0-beta.1"
|
||||
|
||||
repo = "https://github.com/expiredtanin/DOSSIER"
|
||||
releases = "https://github.com/expiredtanin/DOSSIER/releases"
|
||||
|
||||
Reference in new issue
Block a user