Skip to content

Commit 2011b93

Browse files
committed
chore: reset version to v0.1.35 and implement dynamic versioning in UI
1 parent 1dc7d1d commit 2011b93

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

electrobun.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type { ElectrobunConfig } from "electrobun";
33
const config = {
44
name: "Editary",
55
author: "Catharacta",
6-
version: "0.1.37",
6+
version: "0.1.35",
77
app: {
88
name: "Editary",
99
identifier: "dev.catharacta.editary.v2",
10-
version: "0.1.37",
10+
version: "0.1.35",
1111
},
1212
runtime: {
1313
exitOnLastWindowClosed: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "editary",
3-
"version": "0.1.38",
3+
"version": "0.1.35",
44
"description": "A Typora-inspired Markdown editor with bold Neo-brutalism aesthetics. High performance built on Electrobun and Bun, featuring Tiptap, Mermaid, and KaTeX.",
55
"private": true,
66
"dependencies": {

src/bun/main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ try {
2020
if (existsSync(versionJsonPath)) {
2121
const versionInfo = JSON.parse(readFileSync(versionJsonPath, "utf8"));
2222
version = versionInfo.version;
23+
} else {
24+
// Fallback for development: read package.json directly
25+
const packageJsonPath = join(import.meta.dir, "../../package.json");
26+
if (existsSync(packageJsonPath)) {
27+
const packageInfo = JSON.parse(readFileSync(packageJsonPath, "utf8"));
28+
version = packageInfo.version;
29+
}
2330
}
2431
} catch (e) {
25-
console.warn(`Failed to read version.json at ${versionJsonPath}:`, e);
32+
console.warn(`Failed to read version info:`, e);
2633
}
2734

2835
console.log(`Starting Editary v${version}...`);
@@ -47,6 +54,7 @@ const rpc = BrowserView.defineRPC<EditaryRPCType>({
4754
renameEntry: handleFileOperations.renameEntry,
4855
deleteEntry: handleFileOperations.deleteEntry,
4956
moveEntry: handleFileOperations.moveEntry,
57+
getVersion: () => version,
5058
},
5159
messages: {
5260
closeWindow: () => win.close(),

src/mainview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ <h3 data-i18n="settings.tabs.about">Editary について</h3>
518518
</div>
519519
<div class="about-container">
520520
<div class="about-brand">Editary</div>
521-
<div class="about-meta">Version 0.1.37</div>
521+
<div class="about-meta" id="aboutVersion">Version ---</div>
522522
<div class="about-description" data-i18n="settings.about.desc">
523523
Neobrutalism 風デザインを採用した、モダンな Markdown エディタ。
524524
</div>

src/mainview/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ document.addEventListener("DOMContentLoaded", async () => {
2626
setupKeyboardShortcuts();
2727
setupEditorInstance();
2828

29+
// 3. Dynamic Metadata (Version)
30+
try {
31+
const version = await electroview.rpc?.request.getVersion({});
32+
const versionEl = document.getElementById("aboutVersion");
33+
if (versionEl && version) {
34+
versionEl.textContent = `Version ${version}`;
35+
}
36+
} catch (e) {
37+
console.warn("Failed to fetch version from main process:", e);
38+
}
39+
2940
// Prevent default browser behavior for drag & drop navigation
3041
window.addEventListener("dragover", (e) => {
3142
e.preventDefault();

src/shared/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export type EditaryRPCType = {
9999
params: { oldPath: string; newParentDir: string };
100100
response: { success: boolean; newPath: string; error?: string };
101101
};
102+
/** Get application version from package.json */
103+
getVersion: {
104+
params: {};
105+
response: string;
106+
};
102107
};
103108
messages: {
104109
/** Window control: close */

0 commit comments

Comments
 (0)