Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git+https://github.com/opencor/webapp.git"
},
"type": "module",
"version": "1.20261025.2",
"version": "1.20261027.0",
"engines": {
"bun": ">=1.2.0"
},
Expand All @@ -41,8 +41,8 @@
"lint": "bunx --bun biome lint --fix --error-on-warnings --max-diagnostics=none && bunx stylelint '**/*.css' --fix",
"postinstall": "bun src/renderer/scripts/ensure.electron.ts",
"prune:web": "bun src/renderer/scripts/prune.web.ts",
"release": "bun src/renderer/scripts/libopencor.ts && electron-builder",
"release:local": "bun src/renderer/scripts/libopencor.ts && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --config.mac.notarize=false --publish=never",
"release": "electron-builder",
"release:local": "CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --config.mac.identity=- --config.mac.hardenedRuntime=false --config.mac.notarize=false --publish=never",
"start": "bun src/renderer/scripts/libopencor.ts && electron-vite preview",
"start:web": "bun --cwd src/renderer start",
"typecheck": "bun --bun src/renderer/scripts/type.check.ts --noEmit -p tsconfig.app.json",
Expand All @@ -67,15 +67,15 @@
"@vue/tsconfig": "^0.9.1",
"@vueuse/core": "^15.0.0",
"@wasm-fmt/clang-format": "^23.1.1",
"autoprefixer": "^10.6.1",
"autoprefixer": "^10.6.2",
"cmake-js": "^8.0.0",
"electron": "^45.0.0",
"electron-builder": "^26.18.0",
"electron-conf": "^1.3.0",
"electron-updater": "^6.8.11",
"electron-vite": "^6.0.0",
"node-addon-api": "^8.9.2",
"postcss": "^8.5.31",
"postcss": "^8.5.32",
"primeicons": "7.0.0",
"primevue": "4.5.5",
"rollup-plugin-visualizer": "^7.1.1",
Expand Down
7 changes: 7 additions & 0 deletions src/main/MainMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ export const enableDisableMainMenu = (enable: boolean): void => {
}
});
helpSubMenu.push({ type: 'separator' });
helpSubMenu.push({
label: 'Changelog',
click: () => {
mainWindow?.send('changelog');
}
});
helpSubMenu.push({ type: 'separator' });
helpSubMenu.push({
label: 'Report Issue',
click: () => {
Expand Down
1 change: 1 addition & 0 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ electron.contextBridge.exposeInMainWorld('electronApi', {
onAction: (callback: (action: string) => void) => onIpc('action', callback),
onCanonicaliseRecentFilePaths: (callback: (filePaths: string[]) => void) =>
onIpc('canonicalise-recent-file-paths', callback),
onChangelog: (callback: () => void) => onIpc('changelog', callback),
onCheckForUpdates: (callback: () => void) => onIpc('check-for-updates', callback),
onEnableDisableUi: (callback: (enable: boolean) => void) => onIpc('enable-disable-ui', callback),
onOpen: (callback: (filePath: string) => void) => onIpc('open', callback),
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ import '@opencor/opencor/style.css';

- **Exposed methods:**

OpenCOR always exposes the following methods, which only have an effect when an `omex` prop is provided:
OpenCOR always exposes the following method:

- `changelog()`: returns the changes for all the versions of OpenCOR up to the current one, as an array of `{ version: string; changes: { type: 'added' | 'removed' | 'improved' | 'fixed'; description: string }[] }` objects (see `IOpenCORChangelogEntry`), from the newest version to the oldest one.

OpenCOR also always exposes the following methods, which only have an effect when an `omex` prop is provided:

- `trackSimulationData(modelParameters: string[])`: adds the given parameter names to the list of tracked simulation data.
- `untrackSimulationData(modelParameters: string[])`: removes the given parameter names from the list of tracked simulation data.
Expand Down
16 changes: 8 additions & 8 deletions src/renderer/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/renderer/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"version": "1.20261027.0",
"changes": [
{ "type": "added", "description": "A Changelog dialog, which lists the changes of all the versions of OpenCOR." },
{ "type": "added", "description": "A `changelog()` method to OpenCOR's component." },
{
"type": "improved",
"description": "The update dialog now lists what has changed in the newer version of OpenCOR."
}
]
}
]
13 changes: 13 additions & 0 deletions src/renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ export interface IOpenCORProps {
theme?: OpenCORTheme;
}

export type OpenCORChangelogChangeType = 'added' | 'removed' | 'improved' | 'fixed';

export interface IOpenCORChangelogChange {
type: OpenCORChangelogChangeType;
description: string;
}

export interface IOpenCORChangelogEntry {
version: string;
changes: IOpenCORChangelogChange[];
}

export interface IOpenCORExpose {
changelog: () => IOpenCORChangelogEntry[];
addExternalData: (csv: string, voiExpression: string | undefined, modelParameters: string[]) => void;
trackSimulationData: (modelParameters: string[]) => void;
untrackSimulationData: (modelParameters: string[]) => void;
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"./style.css": "./dist/opencor.css"
},
"version": "1.20261025.2",
"version": "1.20261027.0",
"libopencorVersion": "1.20261020.0",
"scripts": {
"build": "vite build && bun scripts/generate.version.ts",
Expand Down Expand Up @@ -73,8 +73,8 @@
"@vitejs/plugin-vue": "^6.0.10",
"@vue/tsconfig": "^0.9.1",
"@vueuse/core": "^15.0.0",
"autoprefixer": "^10.6.1",
"postcss": "^8.5.31",
"autoprefixer": "^10.6.2",
"postcss": "^8.5.32",
"primeicons": "7.0.0",
"primevue": "4.5.5",
"rollup-plugin-visualizer": "^7.1.1",
Expand Down
8 changes: 8 additions & 0 deletions src/renderer/scripts/generate.version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ if (!fs.existsSync(distAssetsPath)) {

fs.writeFileSync(path.join(distAssetsPath, 'version.json'), JSON.stringify({ version }, null, 2));

// Copy our changelog file, so that OpenCOR's Web app can tell the user what is new in a newer version (see
// src/common/changelog.ts).
// Note: like version.json, it has a fixed name, so it must never be cached for long (see public/.htaccess). It also
// gets uploaded before version.json when deploying our Web app (see .github/workflows/cd.yml and cddev.yml), so
// it is always available by the time a newer version gets reported.

fs.copyFileSync(path.join(__dirname, '../changelog.json'), path.join(distAssetsPath, 'changelog.json'));

// Log the generated version.

console.log(`Generated version.json with version ${version}.`);
Loading
Loading