mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
update build process and versioning
This commit is contained in:
@@ -4,13 +4,8 @@ const GITHUB_URL = "https://github.com/Nystik-gh/ignis";
|
||||
const GITHUB_API_LATEST =
|
||||
"https://api.github.com/repos/Nystik-gh/ignis/releases/latest";
|
||||
|
||||
function getVersion(app) {
|
||||
try {
|
||||
const manifest = app.plugins.getPlugin("ignis-bridge")?.manifest;
|
||||
return manifest?.version || "unknown";
|
||||
} catch {
|
||||
return "unknown";
|
||||
}
|
||||
function getVersion() {
|
||||
return window.__ignis?.version || "unknown";
|
||||
}
|
||||
|
||||
// SemVer build metadata (`+xyz`) is informational and ignored for precedence.
|
||||
@@ -41,7 +36,7 @@ async function checkForUpdate(currentVersion) {
|
||||
}
|
||||
|
||||
function display(containerEl, app) {
|
||||
const version = getVersion(app);
|
||||
const version = getVersion();
|
||||
|
||||
const header = containerEl.createDiv("ignis-header");
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
const esbuild = require("esbuild");
|
||||
const path = require("path");
|
||||
|
||||
const { version: ignisVersion } = require("../../package.json");
|
||||
const { version: semver } = require("../../package.json");
|
||||
|
||||
// Root build.js sets IGNIS_BUILD_RESOLVED when it runs first; standalone invocation falls back to a dev stamp.
|
||||
const build = process.env.IGNIS_BUILD_RESOLVED || "dev";
|
||||
|
||||
module.exports = esbuild.build({
|
||||
entryPoints: [path.join(__dirname, "src", "loader.js")],
|
||||
@@ -18,7 +21,8 @@ module.exports = esbuild.build({
|
||||
},
|
||||
external: ["obsidian", "fs"],
|
||||
define: {
|
||||
__IGNIS_VERSION__: JSON.stringify(ignisVersion),
|
||||
__IGNIS_VERSION__: JSON.stringify(semver),
|
||||
__IGNIS_BUILD__: JSON.stringify(build),
|
||||
},
|
||||
logLevel: "info",
|
||||
});
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
import { wsClient } from "./ws-client.js";
|
||||
import { installIgnisApi } from "./ignis-api.js";
|
||||
|
||||
// __IGNIS_VERSION__ is replaced at build time from package.json.
|
||||
window.__ignis = { version: __IGNIS_VERSION__ };
|
||||
// __IGNIS_VERSION__ (semver) and __IGNIS_BUILD__ are replaced at build time.
|
||||
window.__ignis = { version: __IGNIS_VERSION__, build: __IGNIS_BUILD__ };
|
||||
window.__ignis_registerUI = registerUI;
|
||||
|
||||
installIgnisApi(wsClient);
|
||||
|
||||
Reference in New Issue
Block a user