diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2dffaa6b..e1d7be46 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -162,12 +162,13 @@ jobs: # the live index.html. So, a browser could get a partially uploaded asset and, since our hashed # assets are cached for good (see public/.htaccess), keep using it. So, we ask lftp to upload each # file to a temporary file (named .in.), which it then renames to its final name. - ftp-mirror-options: --exclude-glob=index.html --exclude-glob=assets/version.json - ftp-post-sync-commands: put -O /home/www/opencor.ws/app ./src/renderer/dist/index.html; put -O /home/www/opencor.ws/app/assets ./src/renderer/dist/assets/version.json + ftp-mirror-options: --exclude-glob=index.html --exclude-glob=sw.js --exclude-glob=assets/version.json + ftp-post-sync-commands: put -O /home/www/opencor.ws/app ./src/renderer/dist/index.html; put -O /home/www/opencor.ws/app ./src/renderer/dist/sw.js; put -O /home/www/opencor.ws/app/assets ./src/renderer/dist/assets/version.json # Note: our assets have a hash in their file names, so we upload index.html (which references them) once they # have all been uploaded, so that it never references assets that are not available yet. Then, we upload - # version.json last so that OpenCOR's Web app only reports a new version once all the other files have - # been uploaded. + # sw.js, which precaches index.html and our assets (see src/renderer/src/sw.ts), so that it never + # precaches files that are not available yet. Finally, we upload version.json last so that OpenCOR's Web + # app only reports a new version once all the other files have been uploaded. - name: Release OpenCOR's Web app if: ${{ !cancelled() && steps.archive.outcome == 'success' }} uses: softprops/action-gh-release@v3 diff --git a/.github/workflows/cddev.yml b/.github/workflows/cddev.yml index 288df022..cb045e5e 100644 --- a/.github/workflows/cddev.yml +++ b/.github/workflows/cddev.yml @@ -50,12 +50,13 @@ jobs: # the live index.html. So, a browser could get a partially uploaded asset and, since our hashed # assets are cached for good (see public/.htaccess), keep using it. So, we ask lftp to upload each # file to a temporary file (named .in.), which it then renames to its final name. - ftp-mirror-options: --exclude-glob=index.html --exclude-glob=assets/version.json - ftp-post-sync-commands: put -O /home/www/opencor.ws/appdev ./src/renderer/dist/index.html; put -O /home/www/opencor.ws/appdev/assets ./src/renderer/dist/assets/version.json + ftp-mirror-options: --exclude-glob=index.html --exclude-glob=sw.js --exclude-glob=assets/version.json + ftp-post-sync-commands: put -O /home/www/opencor.ws/appdev ./src/renderer/dist/index.html; put -O /home/www/opencor.ws/appdev ./src/renderer/dist/sw.js; put -O /home/www/opencor.ws/appdev/assets ./src/renderer/dist/assets/version.json # Note: our assets have a hash in their file names, so we upload index.html (which references them) once they # have all been uploaded, so that it never references assets that are not available yet. Then, we upload - # version.json last so that OpenCOR's Web app only reports a new version once all the other files have - # been uploaded. + # sw.js, which precaches index.html and our assets (see src/renderer/src/sw.ts), so that it never + # precaches files that are not available yet. Finally, we upload version.json last so that OpenCOR's Web + # app only reports a new version once all the other files have been uploaded. - name: Prune old assets from https://opencor.ws/appdev/ env: REMOTE_HOST: ${{ secrets.REMOTE_HOST }} diff --git a/bun.lock b/bun.lock index 5b0cbcbd..9b673b90 100644 --- a/bun.lock +++ b/bun.lock @@ -27,7 +27,7 @@ "@vue/tsconfig": "^0.9.1", "@vueuse/core": "^15.1.0", "@wasm-fmt/clang-format": "^23.1.1", - "autoprefixer": "^10.7.0", + "autoprefixer": "^10.7.1", "cmake-js": "^8.0.0", "electron": "^45.5.0", "electron-builder": "^26.18.0", @@ -37,7 +37,7 @@ "libcellml.js": "^0.7.2", "node-addon-api": "^8.9.2", "oxigraph": "^0.5.13", - "postcss": "^8.5.33", + "postcss": "^8.5.34", "primeicons": "7.0.0", "primevue": "4.5.5", "rollup-plugin-visualizer": "^7.3.0", @@ -45,7 +45,7 @@ "stylelint-config-standard": "^41.1.0", "tailwindcss": "^4.3.5", "tailwindcss-primeui": "^0.6.1", - "tar": "^7.5.24", + "tar": "^8.0.2", "typescript": "^7.0.2", "typescript-6": "npm:typescript@^6.0.3", "unplugin-vue-components": "^32.1.0", @@ -64,9 +64,9 @@ "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="], - "@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "@babel/core": ["@babel/core@7.29.16", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.16", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.16", "@babel/helpers": "^7.29.16", "@babel/parser": "^7.29.15", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.16", "@babel/types": "^7.29.15", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-qK40pOeReBJY7B0JX6CCIfauMLAa0IlvuVYJ+aZBYLVJwmNUTvsQcEu0En9hVMmNjeSUSQYwvpi1JgXn5imIQw=="], - "@babel/generator": ["@babel/generator@7.29.15", "", { "dependencies": { "@babel/parser": "^7.29.15", "@babel/types": "^7.29.15", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gNWJUX0FlevflramOkaInywOMhU1lkln38gAC7TFZv2tsWbLYbN/2WZFGcq8zbX0Z55e4vGa27IB/NaeZoauWQ=="], + "@babel/generator": ["@babel/generator@7.29.16", "", { "dependencies": { "@babel/parser": "^7.29.15", "@babel/types": "^7.29.15", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-yRtddtrcYdLJt0l70aP7usb2YpMHNXAdAvJW2hXdka5boR4vKMS/F5BTR5sULkbht9xPk/EKzbY2mCczMutZqQ=="], "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], @@ -74,7 +74,7 @@ "@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="], - "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.16", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.16" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-jzdW9nRNJXbNAfcbtfZA75vcQK8c/PRniwNL1KIQukiptryb5JlCl+nwi3idOSj611tMgiZxb9PuKg1FI0BvVQ=="], "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], @@ -84,7 +84,7 @@ "@babel/helper-validator-option": ["@babel/helper-validator-option@7.29.7", "", {}, "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw=="], - "@babel/helpers": ["@babel/helpers@7.29.15", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.15" } }, "sha512-l+ezV2czw3t2d2ELq+3CwPL4WLKK5O8IywBXb9/gpmbCOVZFmRYJPmHVqSCv2k+8iKbE30Zf54siOoIZ52XOxA=="], + "@babel/helpers": ["@babel/helpers@7.29.16", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.15" } }, "sha512-JGNbyEyvOAvceLDQoO6b/w/HbW6KX3sdWgrPCFcAyHfhfsqRoRN14vfaG3GZ90g2dVK7UEe65giopuldeimBjg=="], "@babel/parser": ["@babel/parser@7.29.15", "", { "dependencies": { "@babel/types": "^7.29.15" }, "bin": "./bin/babel-parser.js" }, "sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA=="], @@ -92,7 +92,7 @@ "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], - "@babel/traverse": ["@babel/traverse@7.29.15", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.15", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.15", "@babel/template": "^7.29.7", "@babel/types": "^7.29.15", "debug": "^4.3.1" } }, "sha512-ZfawBo2i8vvt+BTt37dWDKBPjUfm/H+bw+ltwsCRhW7gPtyNVwUXuNo54eO2Xo+P4VXpalPFfFISbBTRKC8SOQ=="], + "@babel/traverse": ["@babel/traverse@7.29.16", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.16", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.15", "@babel/template": "^7.29.7", "@babel/types": "^7.29.15", "debug": "^4.3.1" } }, "sha512-a16ah9dTLOLUq5BL7NElJ7keefg/276vgfTfExDf1PizddYboqRnQXDTooVPb0VArIqrKe8KLlghnTxlZFEZtQ=="], "@babel/types": ["@babel/types@7.29.15", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.15", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ=="], @@ -184,7 +184,7 @@ "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - "@lucide/vue": ["@lucide/vue@1.82.0", "", { "peerDependencies": { "vue": ">=3.0.1" } }, "sha512-Wd9UJqVTF1Q0RxEseQfD/46dBXLAgbRXdx1LI0XZTcoIWSAkjQRz7OC7b+fhl8t+tMwlH9U24WYLG6hX/zKO3Q=="], + "@lucide/vue": ["@lucide/vue@1.84.0", "", { "peerDependencies": { "vue": ">=3.0.1" } }, "sha512-vZ3zqp8djXeuphloLxcFuQ2ehHdorPBIHXUy6H70Z62zxUoufQOqqo+pFyQRgMiZSvVtr5oCUeF45WynvBJfbw=="], "@malept/cross-spawn-promise": ["@malept/cross-spawn-promise@2.0.0", "", { "dependencies": { "cross-spawn": "^7.0.1" } }, "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg=="], @@ -470,7 +470,7 @@ "at-least-node": ["at-least-node@1.0.0", "", {}, "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="], - "autoprefixer": ["autoprefixer@10.7.0", "", { "dependencies": { "browserslist": "^4.29.6", "caniuse-lite": "^1.0.30001826", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-M4rWhYFPp8YSAfqLDT/wRN9trfe/Z/aZLPxrLQJUQRTPrChss2T+hmgaV5770J52bLuGOMzt6Hjl8tEb6YWv5Q=="], + "autoprefixer": ["autoprefixer@10.7.1", "", { "dependencies": { "browserslist": "^4.29.6", "caniuse-lite": "^1.0.30001828", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-31gytPEDUG/d6BMWYKP32EyyLmA0fxcR1sRuLsaOXrxq4qNVFcRLx9SUuWRqqoNzpynlxcyDHvCuOMjnWNJ9mQ=="], "aws4": ["aws4@1.13.2", "", {}, "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw=="], @@ -478,7 +478,7 @@ "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], - "baseline-browser-mapping": ["baseline-browser-mapping@2.11.40", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-WJhaQ3kW5+5BpOduI64ewvykhCyK/IHHG5jCIzivmW2nkYPRowUjs0DbBXY4CAr1LLrN7QEzZGL9727aXH9sJA=="], + "baseline-browser-mapping": ["baseline-browser-mapping@2.11.41", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-yjL/sZCpbpL0ocwmrUe1YFUelyMcifcByF4UYCBDyubFXQRs3lUjo9VoPKdjoFFhmzLAAGNJb1GBBCQJ6B4eyg=="], "bluebird": ["bluebird@3.7.2", "", {}, "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="], @@ -510,7 +510,7 @@ "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], - "caniuse-lite": ["caniuse-lite@1.0.30001828", "", {}, "sha512-7MWeT+3DlrpuDybTWHl4Zb1Z80Z1fLLnOXuBjDXebzDVcqnEWUlV8JcbASg8B8BhcW8QT2UiR1KAtzYFIZHZYA=="], + "caniuse-lite": ["caniuse-lite@1.0.30001829", "", {}, "sha512-FeVvlaVr3r+cdHIYXyZhtVkqroSYjYaoNxItxQNjusurUE+IqODawDsbzk02HJgi2RdKiaGGFm+EKbXku+yITg=="], "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], @@ -552,7 +552,7 @@ "cross-dirname": ["cross-dirname@0.1.0", "", {}, "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q=="], - "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + "cross-spawn": ["cross-spawn@7.1.2", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg=="], "css-tree": ["css-tree@3.2.1", "", { "dependencies": { "mdn-data": "2.27.1", "source-map-js": "^1.2.1" } }, "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA=="], @@ -908,7 +908,7 @@ "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], - "path-scurry": ["path-scurry@3.0.0", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg=="], + "path-scurry": ["path-scurry@3.0.3", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-Ie3c3F+7WJOUCr0r8V8uEunY5Sj4PGFDoBZvFw7JmHJs/+H5GZK+GsIM8tHMcZy7c27Zj+U1NOcVzqlC7tBJpg=="], "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], @@ -924,7 +924,7 @@ "plist": ["plist@3.1.0", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ=="], - "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], + "postcss": ["postcss@8.5.34", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.4" } }, "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw=="], "postcss-safe-parser": ["postcss-safe-parser@7.1.0", "", { "peerDependencies": { "postcss": "^8.4.31" } }, "sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg=="], @@ -1022,7 +1022,7 @@ "source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], - "source-map-js": ["source-map-js@1.2.4", "", {}, "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA=="], + "source-map-js": ["source-map-js@1.3.0", "", {}, "sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q=="], "source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="], @@ -1054,7 +1054,7 @@ "svg-path-commander": ["svg-path-commander@2.4.0", "", { "dependencies": { "@thednp/dommatrix": "^3.1.4" } }, "sha512-adcNMyhgdL+7Ruhwapx/c799NtNMk1+A3uyQYvg3H3biwBFaekhqvWx7iMB1RpYKMxlOdgu9OMhcvkWZsqHtbA=="], - "systeminformation": ["systeminformation@5.33.26", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-/AfmkcUh5/Zgul9vJgTzRqdyeeAkkZM857cXkN1CLzdj3gVvdij9EICcNcl3/nMGsr3A2uRvPmpCy2YX1A9uiQ=="], + "systeminformation": ["systeminformation@5.33.30", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-T3gfaqLhyQpPLvFlP1Kfrr68ur0f1K2WiQ80MCsSt7BQfBUiBHxA2ME6k/KcTdN6FDDGSiFT5DWKsKTE2LLR1w=="], "tailwindcss": ["tailwindcss@4.3.5", "", {}, "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ=="], @@ -1062,7 +1062,7 @@ "tapable": ["tapable@2.3.4", "", {}, "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg=="], - "tar": ["tar@7.5.24", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-to/OxuCk5DeVONcjjODT7aeoRq5NIPPlfPc0tNML+wLlnf6u5BcJz97Uukv3pT3jzorkFhUevylkAiBr+ZmV2w=="], + "tar": ["tar@8.0.2", "", {}, "sha512-1keL/dBVXwzliTinVjILeV/qZ2K3NNVFpg4JM1h3REOUJFamSLZmzVbCJXS6mF91//NwSaCbQ0gqmNwzE+ExCA=="], "temp": ["temp@0.9.4", "", { "dependencies": { "mkdirp": "^0.5.1", "rimraf": "~2.6.2" } }, "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA=="], @@ -1222,12 +1222,16 @@ "app-builder-lib/fs-extra": ["fs-extra@10.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ=="], + "app-builder-lib/tar": ["tar@7.5.24", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-to/OxuCk5DeVONcjjODT7aeoRq5NIPPlfPc0tNML+wLlnf6u5BcJz97Uukv3pT3jzorkFhUevylkAiBr+ZmV2w=="], + "app-builder-lib/which": ["which@5.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ=="], "builder-util/fs-extra": ["fs-extra@10.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ=="], "clone-response/mimic-response": ["mimic-response@1.0.1", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="], + "cmake-js/tar": ["tar@7.5.24", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-to/OxuCk5DeVONcjjODT7aeoRq5NIPPlfPc0tNML+wLlnf6u5BcJz97Uukv3pT3jzorkFhUevylkAiBr+ZmV2w=="], + "cosmiconfig/env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], "cosmiconfig/js-yaml": ["js-yaml@5.5.0", "", { "dependencies": { "argparse": "^3.0.3" }, "bin": { "js-yaml": "bin/js-yaml.mjs" } }, "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg=="], @@ -1260,9 +1264,11 @@ "node-gyp/env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], + "node-gyp/tar": ["tar@7.5.24", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-to/OxuCk5DeVONcjjODT7aeoRq5NIPPlfPc0tNML+wLlnf6u5BcJz97Uukv3pT3jzorkFhUevylkAiBr+ZmV2w=="], + "node-gyp/undici": ["undici@6.29.1", "", {}, "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA=="], - "path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], + "path-scurry/lru-cache": ["lru-cache@11.5.4", "", {}, "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw=="], "plist/@xmldom/xmldom": ["@xmldom/xmldom@0.8.15", "", {}, "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA=="], @@ -1270,7 +1276,7 @@ "proper-lockfile/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], - "rimraf/glob": ["glob@14.0.6", "", { "dependencies": { "minimatch": "^11.0.5", "minipass": "^7.1.3", "path-scurry": "^3.0.0" } }, "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw=="], + "rimraf/glob": ["glob@14.0.7", "", { "dependencies": { "minimatch": "^11.0.5", "minipass": "^7.1.3", "path-scurry": "^3.0.0" } }, "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw=="], "rollup-plugin-visualizer/yargs": ["yargs@18.2.0", "", { "dependencies": { "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "string-width": "^8.2.1", "y18n": "^5.0.5", "yargs-parser": "^22.0.0" } }, "sha512-9OpKOLeaoNFecEp7P6iYbzze/5CqWoH7N3SMs/6y1XF4nMvFMspEGZzJ6uFi9MmQwXhyzqYoSEKO3tvA3Z/o2w=="], diff --git a/electron.vite.config.ts b/electron.vite.config.ts index bc1f0220..d6d89a9a 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -54,6 +54,10 @@ export default electronVite.defineConfig({ __CELLDL_RUNTIME_PATH__: JSON.stringify(''), __LIBOPENCOR_VERSION__: JSON.stringify(libopencorVersion), __OPENCOR_PLOT_VERSION__: JSON.stringify(opencorPlotPackageJson.version), + + // Note: OpenCOR doesn't need a service worker, unlike OpenCOR's Web app (see src/renderer/scripts/sw.plugin.ts). + + __OPENCOR_SERVICE_WORKER__: JSON.stringify(false), __OPENCOR_VERSION__: JSON.stringify(opencorVersion), __UPLOT_VERSION__: JSON.stringify(opencorPlotPackageJson.dependencies.uplot) }, diff --git a/package.json b/package.json index 305d9c47..a83a5399 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "git+https://github.com/opencor/webapp.git" }, "type": "module", - "version": "1.20261127.1", + "version": "1.20261130.0", "engines": { "bun": ">=1.2.0" }, @@ -72,7 +72,7 @@ "@vue/tsconfig": "^0.9.1", "@vueuse/core": "^15.1.0", "@wasm-fmt/clang-format": "^23.1.1", - "autoprefixer": "^10.7.0", + "autoprefixer": "^10.7.1", "cmake-js": "^8.0.0", "electron": "^45.5.0", "electron-builder": "^26.18.0", @@ -82,7 +82,7 @@ "libcellml.js": "^0.7.2", "node-addon-api": "^8.9.2", "oxigraph": "^0.5.13", - "postcss": "^8.5.33", + "postcss": "^8.5.34", "primeicons": "7.0.0", "primevue": "4.5.5", "rollup-plugin-visualizer": "^7.3.0", @@ -90,7 +90,7 @@ "stylelint-config-standard": "^41.1.0", "tailwindcss": "^4.3.5", "tailwindcss-primeui": "^0.6.1", - "tar": "^7.5.24", + "tar": "^8.0.2", "typescript": "^7.0.2", "typescript-6": "npm:typescript@^6.0.3", "unplugin-vue-components": "^32.1.0", diff --git a/src/renderer/bun.lock b/src/renderer/bun.lock index d6dcc6e0..5a25cee4 100644 --- a/src/renderer/bun.lock +++ b/src/renderer/bun.lock @@ -20,10 +20,10 @@ "@vitejs/plugin-vue": "^6.0.11", "@vue/tsconfig": "^0.9.1", "@vueuse/core": "^15.1.0", - "autoprefixer": "^10.7.0", + "autoprefixer": "^10.7.1", "libcellml.js": "^0.7.2", "oxigraph": "^0.5.13", - "postcss": "^8.5.33", + "postcss": "^8.5.34", "primeicons": "7.0.0", "primevue": "4.5.5", "rollup-plugin-visualizer": "^7.3.0", @@ -31,7 +31,7 @@ "stylelint-config-standard": "^41.1.0", "tailwindcss": "^4.3.5", "tailwindcss-primeui": "^0.6.1", - "tar": "^7.5.24", + "tar": "^8.0.2", "typescript": "^7.0.2", "typescript-6": "npm:typescript@^6.0.3", "unplugin-vue-components": "^32.1.0", @@ -102,8 +102,6 @@ "@ctrl/tinycolor": ["@ctrl/tinycolor@4.3.2", "", {}, "sha512-2UDbkHfMvSXVPLkj7VEwS9NMtu/miOOwkHGn7loA8zxUROlwpJF1UYqXfaIHIaHD4o5a80ouir6QyXbimLk9fg=="], - "@isaacs/fs-minipass": ["@isaacs/fs-minipass@4.0.1", "", { "dependencies": { "minipass": "^7.0.4" } }, "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w=="], - "@isaacs/nonrecursive-glob-match": ["@isaacs/nonrecursive-glob-match@1.1.0", "", {}, "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw=="], "@jeswr/pretty-turtle": ["@jeswr/pretty-turtle@1.8.2", "", { "dependencies": { "n3": "^1.25.2", "rdf-string-ttl": "^1.3.2" }, "peerDependencies": { "@rdfjs/types": "*" } }, "sha512-Os15rA6dAAxdnEqxwvcNZ8wX6fO+gKVgiXJsVmVQ3WDiu61Srf0H/nb4X475IKnDVGDMqmd0lGTL1Lk2uxtcVA=="], @@ -118,7 +116,7 @@ "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - "@lucide/vue": ["@lucide/vue@1.82.0", "", { "peerDependencies": { "vue": ">=3.0.1" } }, "sha512-Wd9UJqVTF1Q0RxEseQfD/46dBXLAgbRXdx1LI0XZTcoIWSAkjQRz7OC7b+fhl8t+tMwlH9U24WYLG6hX/zKO3Q=="], + "@lucide/vue": ["@lucide/vue@1.84.0", "", { "peerDependencies": { "vue": ">=3.0.1" } }, "sha512-vZ3zqp8djXeuphloLxcFuQ2ehHdorPBIHXUy6H70Z62zxUoufQOqqo+pFyQRgMiZSvVtr5oCUeF45WynvBJfbw=="], "@mathjax/mathjax-newcm-font": ["@mathjax/mathjax-newcm-font@4.1.3", "", {}, "sha512-gzAB3dFHilHX1l5x2xUqRL+1jDQt3Fyza1DkEMVXWC4E8SvsGdlgEza47HYi2WhVcgfkvf4zgUGzuhbq3Pjlew=="], @@ -322,13 +320,13 @@ "argparse": ["argparse@3.0.4", "", {}, "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA=="], - "autoprefixer": ["autoprefixer@10.7.0", "", { "dependencies": { "browserslist": "^4.29.6", "caniuse-lite": "^1.0.30001826", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-M4rWhYFPp8YSAfqLDT/wRN9trfe/Z/aZLPxrLQJUQRTPrChss2T+hmgaV5770J52bLuGOMzt6Hjl8tEb6YWv5Q=="], + "autoprefixer": ["autoprefixer@10.7.1", "", { "dependencies": { "browserslist": "^4.29.6", "caniuse-lite": "^1.0.30001828", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-31gytPEDUG/d6BMWYKP32EyyLmA0fxcR1sRuLsaOXrxq4qNVFcRLx9SUuWRqqoNzpynlxcyDHvCuOMjnWNJ9mQ=="], "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], - "baseline-browser-mapping": ["baseline-browser-mapping@2.11.40", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-WJhaQ3kW5+5BpOduI64ewvykhCyK/IHHG5jCIzivmW2nkYPRowUjs0DbBXY4CAr1LLrN7QEzZGL9727aXH9sJA=="], + "baseline-browser-mapping": ["baseline-browser-mapping@2.11.41", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-yjL/sZCpbpL0ocwmrUe1YFUelyMcifcByF4UYCBDyubFXQRs3lUjo9VoPKdjoFFhmzLAAGNJb1GBBCQJ6B4eyg=="], "brace-expansion": ["brace-expansion@5.1.0", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg=="], @@ -340,12 +338,10 @@ "bundle-name": ["bundle-name@4.1.1", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA=="], - "caniuse-lite": ["caniuse-lite@1.0.30001828", "", {}, "sha512-7MWeT+3DlrpuDybTWHl4Zb1Z80Z1fLLnOXuBjDXebzDVcqnEWUlV8JcbASg8B8BhcW8QT2UiR1KAtzYFIZHZYA=="], + "caniuse-lite": ["caniuse-lite@1.0.30001829", "", {}, "sha512-FeVvlaVr3r+cdHIYXyZhtVkqroSYjYaoNxItxQNjusurUE+IqODawDsbzk02HJgi2RdKiaGGFm+EKbXku+yITg=="], "chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], - "chownr": ["chownr@3.0.0", "", {}, "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g=="], - "cliui": ["cliui@9.0.1", "", { "dependencies": { "string-width": "^7.2.0", "strip-ansi": "^7.1.0", "wrap-ansi": "^9.0.0" } }, "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w=="], "colord": ["colord@2.14.1", "", {}, "sha512-oAnRdUZtIoONz9y5JZEM/Ogg4m/eYIvpCvzFZIFOPfraLqVYTmevf61yeIhcLq/9EXztGOwF4O36pCu143BqGw=="], @@ -402,7 +398,7 @@ "get-east-asian-width": ["get-east-asian-width@1.7.0", "", {}, "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q=="], - "glob": ["glob@14.0.6", "", { "dependencies": { "minimatch": "^11.0.5", "minipass": "^7.1.3", "path-scurry": "^3.0.0" } }, "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw=="], + "glob": ["glob@14.0.7", "", { "dependencies": { "minimatch": "^11.0.5", "minipass": "^7.1.3", "path-scurry": "^3.0.0" } }, "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw=="], "graceful-fs": ["graceful-fs@4.2.12", "", {}, "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw=="], @@ -466,7 +462,7 @@ "local-pkg": ["local-pkg@1.2.1", "", { "dependencies": { "mlly": "^1.7.4", "pkg-types": "^2.3.0", "quansync": "^0.2.11" } }, "sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q=="], - "lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], + "lru-cache": ["lru-cache@11.5.4", "", {}, "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw=="], "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], @@ -480,8 +476,6 @@ "minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], - "minizlib": ["minizlib@3.1.0", "", { "dependencies": { "minipass": "^7.1.2" } }, "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw=="], - "mj-context-menu": ["mj-context-menu@1.0.0", "", { "dependencies": { "rimraf": "^6.0.1" } }, "sha512-OSgBFQRCVhrZwRa9lhqnKcJU92dd/YXgBjup0uyeuj9bOaVsf4myOyrjU4PfhYkdDk6AqVUTov7v5uFMvIbduA=="], "mlly": ["mlly@1.8.2", "", { "dependencies": { "acorn": "^8.16.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", "ufo": "^1.6.3" } }, "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA=="], @@ -508,7 +502,7 @@ "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], - "path-scurry": ["path-scurry@3.0.0", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg=="], + "path-scurry": ["path-scurry@3.0.3", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-Ie3c3F+7WJOUCr0r8V8uEunY5Sj4PGFDoBZvFw7JmHJs/+H5GZK+GsIM8tHMcZy7c27Zj+U1NOcVzqlC7tBJpg=="], "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], @@ -518,7 +512,7 @@ "pkg-types": ["pkg-types@2.4.0", "", { "dependencies": { "confbox": "^0.3.1", "exsolve": "^1.1.3", "pathe": "^2.0.3" } }, "sha512-07Fys7iVx0X6TcviMOgogM1Lk33ZyqOezMnU79S+kffWqwolG/5W9V8EgQSeYCIfFTYVgssRbnH630Oa2+soBA=="], - "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], + "postcss": ["postcss@8.5.34", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.4" } }, "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw=="], "postcss-safe-parser": ["postcss-safe-parser@7.1.0", "", { "peerDependencies": { "postcss": "^8.4.31" } }, "sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg=="], @@ -560,7 +554,7 @@ "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], - "source-map-js": ["source-map-js@1.2.4", "", {}, "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA=="], + "source-map-js": ["source-map-js@1.3.0", "", {}, "sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q=="], "speech-rule-engine": ["speech-rule-engine@5.0.0-rc.4", "", { "dependencies": { "@xmldom/xmldom": "^0.9.10", "commander": "^14.0.3", "wicked-good-xpath": "^1.3.0" }, "bin": { "sre": "bin/sre" } }, "sha512-3dFcH2QtQNhtvUUc09TxoaEK4WG03B9Z57krFG9jocrKykKGu35BhIkWr0vgEAxZZomEWkeluff69y/EbYzP4Q=="], @@ -580,7 +574,7 @@ "svg-path-commander": ["svg-path-commander@2.4.0", "", { "dependencies": { "@thednp/dommatrix": "^3.1.4" } }, "sha512-adcNMyhgdL+7Ruhwapx/c799NtNMk1+A3uyQYvg3H3biwBFaekhqvWx7iMB1RpYKMxlOdgu9OMhcvkWZsqHtbA=="], - "systeminformation": ["systeminformation@5.33.26", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-/AfmkcUh5/Zgul9vJgTzRqdyeeAkkZM857cXkN1CLzdj3gVvdij9EICcNcl3/nMGsr3A2uRvPmpCy2YX1A9uiQ=="], + "systeminformation": ["systeminformation@5.33.30", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-T3gfaqLhyQpPLvFlP1Kfrr68ur0f1K2WiQ80MCsSt7BQfBUiBHxA2ME6k/KcTdN6FDDGSiFT5DWKsKTE2LLR1w=="], "tailwindcss": ["tailwindcss@4.3.5", "", {}, "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ=="], @@ -588,7 +582,7 @@ "tapable": ["tapable@2.3.4", "", {}, "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg=="], - "tar": ["tar@7.5.24", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-to/OxuCk5DeVONcjjODT7aeoRq5NIPPlfPc0tNML+wLlnf6u5BcJz97Uukv3pT3jzorkFhUevylkAiBr+ZmV2w=="], + "tar": ["tar@8.0.2", "", {}, "sha512-1keL/dBVXwzliTinVjILeV/qZ2K3NNVFpg4JM1h3REOUJFamSLZmzVbCJXS6mF91//NwSaCbQ0gqmNwzE+ExCA=="], "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], @@ -662,8 +656,6 @@ "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], - "yallist": ["yallist@5.0.0", "", {}, "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="], - "yargs": ["yargs@18.2.0", "", { "dependencies": { "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "string-width": "^8.2.1", "y18n": "^5.0.5", "yargs-parser": "^22.0.0" } }, "sha512-9OpKOLeaoNFecEp7P6iYbzze/5CqWoH7N3SMs/6y1XF4nMvFMspEGZzJ6uFi9MmQwXhyzqYoSEKO3tvA3Z/o2w=="], "yargs-parser": ["yargs-parser@22.0.0", "", {}, "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw=="], diff --git a/src/renderer/index.html b/src/renderer/index.html index ef0b7bc8..ca77156f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -2,7 +2,7 @@ - + OpenCOR + + + + + + + -
+
diff --git a/src/renderer/package.json b/src/renderer/package.json index a6b3871c..0eb75406 100644 --- a/src/renderer/package.json +++ b/src/renderer/package.json @@ -42,7 +42,7 @@ }, "./style.css": "./dist/opencor.css" }, - "version": "1.20261127.1", + "version": "1.20261130.0", "libopencorVersion": "1.20261125.0", "scripts": { "build": "vite build && bun scripts/generate.version.ts", @@ -78,10 +78,10 @@ "@vitejs/plugin-vue": "^6.0.11", "@vue/tsconfig": "^0.9.1", "@vueuse/core": "^15.1.0", - "autoprefixer": "^10.7.0", + "autoprefixer": "^10.7.1", "libcellml.js": "^0.7.2", "oxigraph": "^0.5.13", - "postcss": "^8.5.33", + "postcss": "^8.5.34", "primeicons": "7.0.0", "primevue": "4.5.5", "rollup-plugin-visualizer": "^7.3.0", @@ -89,7 +89,7 @@ "stylelint-config-standard": "^41.1.0", "tailwindcss": "^4.3.5", "tailwindcss-primeui": "^0.6.1", - "tar": "^7.5.24", + "tar": "^8.0.2", "typescript": "^7.0.2", "typescript-6": "npm:typescript@^6.0.3", "unplugin-vue-components": "^32.1.0", diff --git a/src/renderer/public/.htaccess b/src/renderer/public/.htaccess index 78537d75..a0510f84 100644 --- a/src/renderer/public/.htaccess +++ b/src/renderer/public/.htaccess @@ -9,6 +9,8 @@ # Note #2: our hashed assets are matched in the same way as when pruning them (see scripts/prune.web.ts). # Note #3: we use so that our Web app still works (albeit without our caching headers) if mod_headers isn't # available. +# Note #4: our service worker (sw.js) and our manifest (manifest.webmanifest) have a fixed name, so they must never be +# cached for long either (see src/sw.ts). Header set Cache-Control "no-cache" @@ -17,3 +19,7 @@ Header set Cache-Control "public, max-age=31536000, immutable" + + + AddType application/manifest+json .webmanifest + diff --git a/src/renderer/public/icons/apple-touch-icon.png b/src/renderer/public/icons/apple-touch-icon.png new file mode 100644 index 00000000..a8ead336 Binary files /dev/null and b/src/renderer/public/icons/apple-touch-icon.png differ diff --git a/src/renderer/public/icons/icon-192.png b/src/renderer/public/icons/icon-192.png new file mode 100644 index 00000000..ad202d70 Binary files /dev/null and b/src/renderer/public/icons/icon-192.png differ diff --git a/src/renderer/public/icons/icon-512.png b/src/renderer/public/icons/icon-512.png new file mode 100644 index 00000000..725c047f Binary files /dev/null and b/src/renderer/public/icons/icon-512.png differ diff --git a/src/renderer/public/icons/icon-maskable-512.png b/src/renderer/public/icons/icon-maskable-512.png new file mode 100644 index 00000000..aaccd3d1 Binary files /dev/null and b/src/renderer/public/icons/icon-maskable-512.png differ diff --git a/src/renderer/public/manifest.webmanifest b/src/renderer/public/manifest.webmanifest new file mode 100644 index 00000000..482348a1 --- /dev/null +++ b/src/renderer/public/manifest.webmanifest @@ -0,0 +1,31 @@ +{ + "id": "./", + "name": "OpenCOR", + "short_name": "OpenCOR", + "description": "A Web-based modelling environment for organising, editing, simulating, and analysing CellML files.", + "start_url": "./", + "scope": "./", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#ffffff", + "icons": [ + { + "src": "icons/icon-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "icons/icon-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + }, + { + "src": "icons/icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/src/renderer/scripts/celldl.runtime.ts b/src/renderer/scripts/celldl.runtime.ts index 46311f1a..2940dcf7 100644 --- a/src/renderer/scripts/celldl.runtime.ts +++ b/src/renderer/scripts/celldl.runtime.ts @@ -1,10 +1,11 @@ -import * as crypto from 'node:crypto'; import * as fs from 'node:fs'; import { createRequire } from 'node:module'; import * as os from 'node:os'; import * as path from 'node:path'; import * as vite from 'vite'; +import { sha256, shortSha256 } from './hash.ts'; + // Build our CellDL runtime (see vite.celldl.config.ts) and copy it to celldl// in the given public folder, where // is a hash of what our CellDL runtime is built from. Return the path of our CellDL runtime relative to that // public folder. @@ -28,10 +29,6 @@ const CONFIG_FILES = [ path.join(import.meta.dirname, 'primeicons.plugin.ts') ]; -const sha256 = (data: string | Uint8Array): string => { - return crypto.createHash('sha256').update(data).digest('hex'); -}; - export const buildCellDLRuntime = async (publicDir: string): Promise => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencor-celldl-runtime-')); const nodeEnv = process.env.NODE_ENV; @@ -107,7 +104,7 @@ export const buildCellDLRuntime = async (publicDir: string): Promise => } } - const runtimePath = `celldl/${sha256(digests.sort().join('\n')).slice(0, 16)}`; + const runtimePath = `celldl/${shortSha256(digests.sort().join('\n'))}`; // Remove any other copy of our CellDL runtime, so that it doesn't end up being shipped (our public folder gets // copied as is when building), and copy our CellDL runtime to our public folder, if needed. diff --git a/src/renderer/scripts/hash.ts b/src/renderer/scripts/hash.ts new file mode 100644 index 00000000..4eb44562 --- /dev/null +++ b/src/renderer/scripts/hash.ts @@ -0,0 +1,14 @@ +import * as crypto from 'node:crypto'; + +// Return the SHA-256 hash of the given data, as a hexadecimal string. + +export const sha256 = (data: string | Uint8Array): string => { + return crypto.createHash('sha256').update(data).digest('hex'); +}; + +// Return a short version of the SHA-256 hash of the given data, i.e. its first 16 hexadecimal characters (64 bits), +// which is enough to identify something (e.g., a folder or a cache) without clashes. + +export const shortSha256 = (data: string | Uint8Array): string => { + return sha256(data).slice(0, 16); +}; diff --git a/src/renderer/scripts/sw.plugin.ts b/src/renderer/scripts/sw.plugin.ts new file mode 100644 index 00000000..5745719f --- /dev/null +++ b/src/renderer/scripts/sw.plugin.ts @@ -0,0 +1,77 @@ +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import * as vite from 'vite'; + +import { shortSha256 } from './hash.ts'; + +// A Vite plugin to generate the service worker of OpenCOR's Web app (i.e. sw.js), which makes it installable and usable +// offline (see src/sw.ts). +// Note #1: our service worker is not part of our bundle (it must be served from a fixed URL), so we compile it +// ourselves and write it next to index.html once our bundle has been written, i.e. once we know our hashed +// assets. +// Note #2: our service worker gets registered by OpenCOR's Web app, but only if __OPENCOR_SERVICE_WORKER__ is true (see +// src/common/serviceWorker.ts), which we only do when building OpenCOR's Web app (i.e. not when running it in +// development mode since there is no sw.js then). OpenCOR (see electron.vite.config.ts) never registers it. +// Note #3: the given runtime cache ID must change whenever the versioned external files that our service worker caches +// at runtime change (e.g., a new version of libOpenCOR), so that our old copies get deleted. +// Note #4: sw.js has a fixed name, so it must never be cached for long (see public/.htaccess) and it must be uploaded +// after our hashed assets and index.html when deploying our Web app (see .github/workflows/cd.yml and +// .github/workflows/cddev.yml), so that it never precaches files that are not available yet. + +const SW_SOURCE = path.join(import.meta.dirname, '..', 'src', 'sw.ts'); +const SW_FILE_NAME = 'sw.js'; + +export const serviceWorkerPlugin = (runtimeCacheId: string): vite.Plugin => { + return { + name: 'opencor-service-worker', + config(_config, env) { + return { + define: { + __OPENCOR_SERVICE_WORKER__: JSON.stringify(env.command === 'build') + } + }; + }, + async writeBundle(outputOptions, bundle) { + // Determine our hashed assets and the ID of the cache in which they get precached. + + const indexHtml = bundle['index.html']; + + if (indexHtml?.type !== 'asset') { + throw new Error('index.html could not be found in our bundle.'); + } + + const appFiles = Object.keys(bundle) + .filter((fileName: string) => fileName.startsWith('assets/') && !fileName.endsWith('.map')) + .sort(); + const appCacheId = shortSha256(JSON.stringify(appFiles) + indexHtml.source.toString()); + + // Compile our service worker and replace its placeholders. + + let code = (await vite.transformWithOxc(fs.readFileSync(SW_SOURCE, 'utf8'), SW_SOURCE)).code; + + for (const [placeholder, value] of Object.entries({ + __SW_APP_CACHE_ID__: appCacheId, + __SW_APP_FILES__: appFiles, + __SW_RUNTIME_CACHE_ID__: shortSha256(runtimeCacheId) + })) { + if (!code.includes(placeholder)) { + throw new Error(`${placeholder} could not be found in our service worker.`); + } + + code = code.replaceAll(placeholder, JSON.stringify(value)); + } + + // Our service worker is a module as far as TypeScript is concerned (so that its declarations remain local to it), + // but it must be a classic script for our browser (module service workers are not supported everywhere), so we + // remove its empty export statement. + + code = code.replace(/^export\s*\{\s*\};?\s*$/m, ''); + + if (/^\s*(import|export)\b/m.test(code)) { + throw new Error('Our service worker must not import or export anything.'); + } + + fs.writeFileSync(path.join(outputOptions.dir ?? 'dist', SW_FILE_NAME), code); + } + }; +}; diff --git a/src/renderer/src/common/iosInstalledApp.ts b/src/renderer/src/common/iosInstalledApp.ts new file mode 100644 index 00000000..c7aa1258 --- /dev/null +++ b/src/renderer/src/common/iosInstalledApp.ts @@ -0,0 +1,57 @@ +// Make OpenCOR's Web app fill the screen when it is installed on iOS. +// Note #1: when installed on iOS, OpenCOR's Web app goes under the status bar (see index.html), but iOS may lay it out +// as if it didn't, i.e. as if the screen was shorter by the height of the status bar, leaving an empty band at +// the bottom of the screen. This affects 100dvh (after a change of orientation), as well as position: fixed +// (always, and iOS then doesn't even draw what is past that shorter screen). So, we measure the height of #app +// and, if it is shorter than the screen by no more than the height of a status bar, we give it the height of +// the screen. +// Note #2: navigator.standalone is only defined by iOS, and it is only true when OpenCOR's Web app runs as an installed +// app, so we leave everything else alone (including an iPad window that is legitimately shorter than the +// screen, since its gap would be bigger than that of a status bar). +// Note #3: we also tag our document with the "opencor-ios-installed-app" class, so that our CSS can keep our contents +// out of the band that iOS blurs below the status bar (see index.html and src/components/MainMenu.vue). We +// can't rely on @media (display-mode: standalone) for this since it also matches an installed copy of +// OpenCOR's Web app on other platforms (e.g., using Chrome on Windows) and a host application that is itself +// installed. + +const MAX_STATUS_BAR_HEIGHT = 100; + +export const fitIosInstalledAppToScreen = (): void => { + if ((navigator as Navigator & { standalone?: boolean }).standalone !== true) { + return; + } + + document.documentElement.classList.add('opencor-ios-installed-app'); + + const app = document.getElementById('app'); + + if (!app) { + return; + } + + const update = (): void => { + // Measure the height of #app as laid out by iOS. + + app.style.removeProperty('height'); + + // Note: screen.width and screen.height don't change with the orientation on iOS. + + const screenHeight = window.matchMedia('(orientation: landscape)').matches + ? Math.min(screen.width, screen.height) + : Math.max(screen.width, screen.height); + const gap = screenHeight - app.getBoundingClientRect().height; + + if (gap > 0 && gap <= MAX_STATUS_BAR_HEIGHT) { + app.style.height = `${screenHeight}px`; + } + }; + + update(); + + // Update #app whenever the size of our window changes (e.g., after a change of orientation), once iOS has laid it + // out. + + window.addEventListener('resize', () => { + requestAnimationFrame(update); + }); +}; diff --git a/src/renderer/src/common/serviceWorker.ts b/src/renderer/src/common/serviceWorker.ts new file mode 100644 index 00000000..6b085684 --- /dev/null +++ b/src/renderer/src/common/serviceWorker.ts @@ -0,0 +1,64 @@ +import * as common from './common'; +import { electronApi } from './electronApi'; + +// Register our service worker, which makes OpenCOR's Web app installable and usable offline (see src/sw.ts). +// Note #1: we only do this for OpenCOR's Web app once built (see scripts/sw.plugin.ts), i.e. neither in development +// mode, nor for OpenCOR, nor when OpenCOR is used as a library (in which case it is for the host application +// to decide whether it wants a service worker), hence we are called from main.ts. +// Note #2: we register our service worker once our page has been loaded, so that it doesn't compete with OpenCOR's Web +// app for bandwidth while it is being loaded. +// Note #3: our service worker can only cache the files that it sees being fetched, i.e. those that are fetched once it +// controls our page. Yet, some files are fetched before then (e.g., the first time OpenCOR's Web app gets +// loaded or when our service worker has just been updated). So, we let our service worker know about all the +// files that we fetch, so that it can cache those that it hasn't cached yet (it ignores those that it doesn't +// cache, e.g., version.json or a model). +// Note #4: we keep track of the files that we fetch ourselves rather than rely on performance.getEntriesByType() when a +// (new) service worker takes control of our page, since the browser stops recording resource timing entries +// once it has recorded 250 of them (by default), which OpenCOR's Web app may well exceed. + +const sendUrls = (urls: string[]): void => { + const httpUrls = urls.filter((url: string) => url.startsWith('http')); + + if (httpUrls.length > 0) { + navigator.serviceWorker.controller?.postMessage({ type: 'cache-urls', urls: httpUrls }); + } +}; + +export const registerServiceWorker = (): void => { + if (!__OPENCOR_SERVICE_WORKER__ || electronApi || !('serviceWorker' in navigator)) { + return; + } + + // Let our service worker know about the files that we fetch from now on and, whenever a (new) service worker takes + // control of our page, about all the files that we have fetched so far. + + const fetchedUrls = new Set(); + + new PerformanceObserver((list: PerformanceObserverEntryList) => { + const urls = list.getEntries().map((entry: PerformanceEntry) => entry.name); + + for (const url of urls) { + fetchedUrls.add(url); + } + + sendUrls(urls); + }).observe({ type: 'resource', buffered: true }); + + navigator.serviceWorker.addEventListener('controllerchange', () => { + sendUrls([...fetchedUrls]); + }); + + // Register our service worker. + + const register = (): void => { + navigator.serviceWorker.register('./sw.js').catch((error: unknown) => { + console.warn('OpenCOR: failed to register our service worker:', common.formatError(error)); + }); + }; + + if (document.readyState === 'complete') { + register(); + } else { + window.addEventListener('load', register, { once: true }); + } +}; diff --git a/src/renderer/src/components/BackgroundComponent.vue b/src/renderer/src/components/BackgroundComponent.vue index 8508ffef..bf523a99 100644 --- a/src/renderer/src/components/BackgroundComponent.vue +++ b/src/renderer/src/components/BackgroundComponent.vue @@ -378,9 +378,14 @@ const ACTIONS: { label: string; icon: string; shortcut?: string; command: () => * Footer. */ +/** + * Note: our footer is at the bottom of the screen, so we keep it clear of the home indicator of a mobile device when + * OpenCOR's Web app is installed on it (env() returns 0 everywhere else), see index.html. + */ + .footer { flex-shrink: 0; - padding: 0 0.5rem 0.375rem; + padding: 0 0.5rem max(0.375rem, env(safe-area-inset-bottom)); color: var(--p-text-muted-color); font-size: 0.75rem; font-variant-numeric: tabular-nums; diff --git a/src/renderer/src/components/MainMenu.vue b/src/renderer/src/components/MainMenu.vue index 4f3a315d..b59fdb51 100644 --- a/src/renderer/src/components/MainMenu.vue +++ b/src/renderer/src/components/MainMenu.vue @@ -739,6 +739,27 @@ useOpenCORKeyStroke((event: KeyboardEvent) => { container: main-menu / inline-size; } +/** + * When OpenCOR's Web app is installed on iOS, our menubar extends up under the status bar (index.html lets it), as a + * native navigation bar would, and its items are kept out of the band that iOS blurs below the status bar. + * Note #1: iOS 26+ blurs a band that starts under the status bar and goes some way past the safe area of an installed + * Web app, hence we keep our items 32px below the safe area, the smallest offset that seems to work (see also + * index.html). + * Note #2: this only applies when OpenCOR's Web app runs as an installed app on iOS, i.e. not in a browser tab, not in + * OpenCOR, and not as an installed app on another platform (see the "opencor-ios-installed-app" class in + * src/common/iosInstalledApp.ts). + */ + +:root.opencor-ios-installed-app .p-menubar { + --opencor-ios-top-band: calc(env(safe-area-inset-top) + 32px); + + padding-top: calc(var(--opencor-ios-top-band) + 0.125rem); +} + +:root.opencor-ios-installed-app .update-link { + top: calc(50% + var(--opencor-ios-top-band) / 2); +} + :deep(.p-menubar-end) { display: flex; align-items: center; diff --git a/src/renderer/src/main.ts b/src/renderer/src/main.ts index 1a03419b..8c19e785 100644 --- a/src/renderer/src/main.ts +++ b/src/renderer/src/main.ts @@ -9,15 +9,25 @@ import App from './App.vue'; // import App from './AppWithExternalData.vue'; import { ownDocumentTitle } from './common/common'; +import { fitIosInstalledAppToScreen } from './common/iosInstalledApp'; +import { registerServiceWorker } from './common/serviceWorker'; // We are not used as a library, so the title of our document is ours to change (see ownDocumentTitle()). ownDocumentTitle(); +// Make sure that we fill the screen when we are installed on iOS. + +fitIosInstalledAppToScreen(); + // Create and mount our application. createApp(App).mount('#app'); +// Register our service worker, which makes OpenCOR's Web app installable and usable offline. + +registerServiceWorker(); + // Prevent a file that is dropped outside of the area where we handle drag and drop (e.g., on a dialog's mask or on our // blocking overlay while OpenCOR is initialising) from being opened by the browser, which would replace OpenCOR with // that file. diff --git a/src/renderer/src/sw.ts b/src/renderer/src/sw.ts new file mode 100644 index 00000000..9558a4c2 --- /dev/null +++ b/src/renderer/src/sw.ts @@ -0,0 +1,470 @@ +// OpenCOR's service worker, which makes OpenCOR's Web app installable and usable offline. +// Note #1: this file is not part of our bundle. It gets compiled to sw.js when building OpenCOR's Web app (see +// scripts/sw.plugin.ts), which also replaces our placeholders (i.e. __SW_..._) with their value for that +// build. It is registered by OpenCOR's Web app (see src/common/serviceWorker.ts). +// Note #2: our caching strategy is as follows: +// - index.html: network first, so that we always get the latest version of OpenCOR's Web app when online (and +// so that our own update mechanism keeps working, see src/common/version.ts), falling back on our cached +// copy when offline; +// - our hashed assets: precached when installing our service worker and served from our cache since they +// never change (see vite.config.ts); and +// - our versioned external files (i.e. libOpenCOR's glue and WASM, our CellDL runtime, and our external +// dependencies from jsDelivr): cached the first time they are fetched and then served from our cache since +// a given URL always refers to the same contents. +// Everything else (e.g., version.json, models, GitHub, Firebase) is left alone and goes to the network. +// Note #3: OpenCOR's Web app may be served from different scopes of the same origin (e.g., https://opencor.ws/app/ and +// https://opencor.ws/appdev/), all of which share the same Cache Storage. So, the names of our caches include +// our scope, so that a service worker never touches the caches of another one. +// Note #4: TypeScript's DOM library doesn't include the service worker types, and its WebWorker library cannot be used +// alongside it, hence our minimal declarations below. + +interface ExtendableEvent extends Event { + waitUntil(promise: Promise): void; +} + +interface FetchEvent extends ExtendableEvent { + readonly request: Request; + respondWith(response: Response | Promise): void; +} + +interface ExtendableMessageEvent extends ExtendableEvent { + readonly data: unknown; +} + +interface ServiceWorkerGlobalScope { + readonly clients: { + claim(): Promise; + matchAll(options?: { includeUncontrolled?: boolean; type?: 'all' | 'window' }): Promise<{ readonly id: string }[]>; + }; + readonly registration: ServiceWorkerRegistration; + addEventListener(type: 'activate' | 'install', listener: (event: ExtendableEvent) => void): void; + addEventListener(type: 'fetch', listener: (event: FetchEvent) => void): void; + addEventListener(type: 'message', listener: (event: ExtendableMessageEvent) => void): void; + skipWaiting(): Promise; +} + +// Our placeholders. + +declare const __SW_APP_CACHE_ID__: string; // Changes whenever our assets or index.html change. +declare const __SW_APP_FILES__: string[]; // Our hashed assets, relative to our scope. +declare const __SW_RUNTIME_CACHE_ID__: string; // Changes whenever our versioned external files change. + +const sw = self as unknown as ServiceWorkerGlobalScope; + +// Our scope and caches. + +const scopeUrl = sw.registration.scope; +const scope = new URL(scopeUrl); +const CACHE_PREFIX = `opencor|${scopeUrl}|`; +const APP_CACHE = `${CACHE_PREFIX}app|${__SW_APP_CACHE_ID__}`; +const RUNTIME_CACHE = `${CACHE_PREFIX}runtime|${__SW_RUNTIME_CACHE_ID__}`; +const STATE_CACHE = `${CACHE_PREFIX}state`; +const STALE_CLIENTS_KEY = new URL('__opencor-sw-stale-clients__', scopeUrl).href; + +// Return the names of the caches of our previous versions, if any. + +const oldCacheNames = async (): Promise => { + return (await caches.keys()).filter( + (cacheName: string) => + cacheName.startsWith(CACHE_PREFIX) && + cacheName !== APP_CACHE && + cacheName !== RUNTIME_CACHE && + cacheName !== STATE_CACHE + ); +}; + +// Determine the cache, if any, in which the file at the given URL should be cached. +// Note: our hashed assets are matched in the same way as in public/.htaccess and scripts/prune.web.ts. + +const HASHED_ASSET_REGEX = /^\w[\w.-]*-[\w-]{8}\.\w+$/; +const JSDELIVR_HOSTS = new Set(['cdn.jsdelivr.net', 'fastly.jsdelivr.net', 'gcore.jsdelivr.net']); +const JSDELIVR_VERSIONED_PATH_REGEX = /^\/npm\/(@[^/]+\/)?[^/@]+@\d/; + +const cacheNameFor = (url: URL): string | null => { + if (url.origin === scope.origin && url.pathname.startsWith(scope.pathname)) { + const relativePath = url.pathname.slice(scope.pathname.length); + + if (relativePath.startsWith('assets/') && HASHED_ASSET_REGEX.test(relativePath.slice('assets/'.length))) { + return APP_CACHE; + } + + if (relativePath.startsWith('celldl/')) { + return RUNTIME_CACHE; + } + } + + // Note: OpenCOR's Web app falls back on our CellDL runtime from https://opencor.ws/app/ if it isn't served from our + // scope (see src/common/celldlRuntime.ts), e.g., when our scope is https://opencor.ws/appdev/. + + if (url.origin === 'https://opencor.ws' && url.pathname.startsWith('/app/celldl/')) { + return RUNTIME_CACHE; + } + + if ( + (url.origin === scope.origin || url.origin === 'https://opencor.ws') && + url.pathname.includes('/libopencor/downloads/wasm/') + ) { + return RUNTIME_CACHE; + } + + if (JSDELIVR_HOSTS.has(url.host) && JSDELIVR_VERSIONED_PATH_REGEX.test(url.pathname)) { + return RUNTIME_CACHE; + } + + return null; +}; + +// Return whether the given response can be cached, i.e. whether it is a complete and non-opaque one. + +const isCacheable = (response: Response): boolean => { + return response.status === 200 && (response.type === 'basic' || response.type === 'cors'); +}; + +// Return our cached copy, if any, of the file at the given URL. +// Note #1: we ignore the Vary header since a given URL always refers to the same contents. +// Note #2: we also look in the caches of our previous versions since a page that runs a previous version of OpenCOR's +// Web app may still need their files (see our activate handler below). If we find the file there, then we copy +// it to the given cache, so that we keep it once those caches get deleted. + +const cachedFile = async (url: string, cacheName: string): Promise => { + for (const currentCacheName of [APP_CACHE, RUNTIME_CACHE]) { + const response = await (await caches.open(currentCacheName)).match(url, { ignoreVary: true }); + + if (response) { + return response; + } + } + + for (const oldCacheName of await oldCacheNames()) { + const response = await (await caches.open(oldCacheName)).match(url, { ignoreVary: true }); + + if (response) { + await (await caches.open(cacheName)).put(url, response.clone()); + + return response; + } + } + + return undefined; +}; + +// Return whether the given index.html belongs to the same build as us, i.e. whether all the hashed assets that it +// references are amongst those that we precache. +// Note: this prevents us from caching an index.html that we cannot serve offline, i.e. one that references hashed assets +// that we might not have cached. This may happen if a new version of OpenCOR's Web app has been deployed but its +// service worker has not been installed yet (e.g., it failed to install or sw.js has not been uploaded yet, see +// scripts/sw.plugin.ts). Our previous copy of index.html (if any) then remains in use when offline. + +const APP_FILES = new Set(__SW_APP_FILES__); +const ASSET_REFERENCE_REGEX = /assets\/([\w.-]+)/g; + +const isOwnIndexHtml = async (response: Response): Promise => { + const hashedAssets = [...(await response.text()).matchAll(ASSET_REFERENCE_REGEX)] + .map((match: RegExpMatchArray) => match[1] ?? '') + .filter((fileName: string) => HASHED_ASSET_REGEX.test(fileName)); + + return hashedAssets.length > 0 && hashedAssets.every((fileName: string) => APP_FILES.has(`assets/${fileName}`)); +}; + +// Fetch the given request and make sure that we got a cacheable response. + +const fetchCacheable = async (request: Request | string): Promise => { + const response = await fetch(request); + + if (!isCacheable(response)) { + throw new Error(`Failed to fetch ${typeof request === 'string' ? request : request.url} (${response.status}).`); + } + + return response; +}; + +// Install our service worker by precaching index.html and our hashed assets. +// Note #1: we reuse the hashed assets that a previous version of our service worker cached, if any, since they cannot +// have changed. +// Note #2: if anything cannot be precached, then our installation fails and our browser will try again later (e.g., the +// next time OpenCOR's Web app is loaded), which means that our previous version (if any) remains in charge. +// Note #3: we skip waiting since our previous version (if any) only differs from us by what we precache, so we can take +// over right away. +// Note #4: our installation also fails if index.html doesn't belong to the same build as us (see isOwnIndexHtml()), +// e.g., if we are an old sw.js that is still being served while a new version of OpenCOR's Web app is being +// deployed. + +sw.addEventListener('install', (event: ExtendableEvent) => { + event.waitUntil( + (async () => { + const appCache = await caches.open(APP_CACHE); + const oldAppCacheNames = (await caches.keys()).filter( + (cacheName: string) => cacheName.startsWith(`${CACHE_PREFIX}app|`) && cacheName !== APP_CACHE + ); + + const precacheFile = async (url: string): Promise => { + if (await appCache.match(url)) { + return; + } + + for (const oldAppCacheName of oldAppCacheNames) { + const response = await (await caches.open(oldAppCacheName)).match(url); + + if (response) { + await appCache.put(url, response); + + return; + } + } + + await appCache.put(url, await fetchCacheable(url)); + }; + + await Promise.all([ + (async () => { + const response = await fetchCacheable(new Request(scopeUrl, { cache: 'reload' })); + + if (!(await isOwnIndexHtml(response.clone()))) { + throw new Error('index.html does not belong to the same build as our service worker.'); + } + + await appCache.put(scopeUrl, response); + })(), + ...__SW_APP_FILES__.map((file: string) => precacheFile(new URL(file, scopeUrl).href)) + ]); + + await sw.skipWaiting(); + })() + ); +}); + +// Delete the caches of our previous versions, unless a page that was open when we got activated is still open. +// Note: such a page may run a previous version of OpenCOR's Web app and, if so, it may still need to (lazily) load some +// of the files of that version, possibly while offline. We don't know which version a page runs, so we keep the +// caches of our previous versions until all those pages have been closed or reloaded. The IDs of those pages are +// kept in our state cache since our global variables don't survive our service worker being stopped. + +const deleteOldCachesIfUnused = async (): Promise => { + const stateCache = await caches.open(STATE_CACHE); + const staleClientsResponse = await stateCache.match(STALE_CLIENTS_KEY); + + if (staleClientsResponse) { + const staleClientIds = (await staleClientsResponse.json()) as string[]; + const clientIds = new Set( + (await sw.clients.matchAll({ type: 'window', includeUncontrolled: true })).map( + (client: { readonly id: string }) => client.id + ) + ); + + if (staleClientIds.some((clientId: string) => clientIds.has(clientId))) { + return; + } + } + + await Promise.all((await oldCacheNames()).map((cacheName: string) => caches.delete(cacheName))); + await stateCache.delete(STALE_CLIENTS_KEY); +}; + +// Activate our service worker by taking control of the pages that are not controlled by us yet (e.g., the one that +// registered us for the first time) and by deleting the caches of our previous versions, unless they may still be +// needed (see deleteOldCachesIfUnused()). + +sw.addEventListener('activate', (event: ExtendableEvent) => { + event.waitUntil( + (async () => { + const clientIds = (await sw.clients.matchAll({ type: 'window', includeUncontrolled: true })).map( + (client: { readonly id: string }) => client.id + ); + + await (await caches.open(STATE_CACHE)).put( + STALE_CLIENTS_KEY, + new Response(JSON.stringify(clientIds), { headers: { 'Content-Type': 'application/json' } }) + ); + + await sw.clients.claim(); + await deleteOldCachesIfUnused(); + })() + ); +}); + +// Handle a navigation to OpenCOR's Web app (network first) or a request for one of our cacheable files (cache first). +// Note #1: OpenCOR's Web app checks whether libOpenCOR's glue and our CellDL runtime are served using a HEAD request +// (see src/common/initialisation.ts and src/common/celldlRuntime.ts), so we answer such a request from our +// cache too, or it would fail when offline. +// Note #2: our cached copy of index.html has the cross-origin isolation headers with which it was served, so OpenCOR's +// Web app remains cross-origin isolated when it is loaded from our cache. + +const handleNavigation = async (event: FetchEvent): Promise => { + // A navigation means that a page may have been closed or reloaded, so check whether we can delete the caches of our + // previous versions. + + event.waitUntil(deleteOldCachesIfUnused()); + + try { + const response = await fetch(event.request); + + if (isCacheable(response) && !response.redirected) { + const responseCopy = response.clone(); + + event.waitUntil( + (async () => { + if (await isOwnIndexHtml(responseCopy.clone())) { + await (await caches.open(APP_CACHE)).put(scopeUrl, responseCopy); + } + })() + ); + } + + return response; + } catch (error: unknown) { + const cachedResponse = await (await caches.open(APP_CACHE)).match(scopeUrl); + + if (cachedResponse) { + return cachedResponse; + } + + throw error; + } +}; + +// Keep track of the files that are being written to our caches. +// Note: a file only gets written to our cache once it has been fully downloaded, which may take a while for a large +// file (e.g., libOpenCOR's WASM). Meanwhile, OpenCOR's Web app may ask us to cache that file (see our message +// handler below) or fetch it again, so we wait for its write to have completed rather than download it again. + +const pendingCacheWrites = new Map>(); + +const trackCacheWrite = (url: string, write: Promise): Promise => { + const trackedWrite: Promise = write.finally(() => { + if (pendingCacheWrites.get(url) === trackedWrite) { + pendingCacheWrites.delete(url); + } + }); + + pendingCacheWrites.set(url, trackedWrite); + + return trackedWrite; +}; + +const pendingCacheWrite = async (url: string): Promise => { + try { + await pendingCacheWrites.get(url); + } catch { + // The write failed, in which case the file is not cached and the caller will have to fetch it. + } +}; + +const handleCacheableFile = async (event: FetchEvent, cacheName: string): Promise => { + const request = event.request; + + await pendingCacheWrite(request.url); + + const cachedResponse = await cachedFile(request.url, cacheName); + + if (cachedResponse) { + return request.method === 'HEAD' + ? new Response(null, { + status: cachedResponse.status, + statusText: cachedResponse.statusText, + headers: cachedResponse.headers + }) + : cachedResponse; + } + + const response = await fetch(request); + + if (request.method === 'GET' && isCacheable(response)) { + const responseCopy = response.clone(); + + event.waitUntil( + trackCacheWrite( + request.url, + (async () => { + await (await caches.open(cacheName)).put(request.url, responseCopy); + })() + ) + ); + } + + return response; +}; + +sw.addEventListener('fetch', (event: FetchEvent) => { + const request = event.request; + + if (request.method !== 'GET' && request.method !== 'HEAD') { + return; + } + + const url = new URL(request.url); + + if (request.mode === 'navigate') { + if ( + request.method === 'GET' && + url.origin === scope.origin && + (url.pathname === scope.pathname || url.pathname === `${scope.pathname}index.html`) + ) { + event.respondWith(handleNavigation(event)); + } + + return; + } + + const cacheName = cacheNameFor(url); + + if (cacheName) { + event.respondWith(handleCacheableFile(event, cacheName)); + } +}); + +// Cache the given files, if they are cacheable and not already cached. +// Note: OpenCOR's Web app sends us the URL of the files it has fetched (see src/common/serviceWorker.ts), so that we +// can cache those that we didn't get to see, i.e. those that were fetched before we took control of it (e.g., the +// first time it gets loaded or when we have just been updated). + +sw.addEventListener('message', (event: ExtendableMessageEvent) => { + const data = event.data as { type?: unknown; urls?: unknown } | null; + + if (data?.type !== 'cache-urls' || !Array.isArray(data.urls)) { + return; + } + + // Note: a page has just sent us a message, so it may have replaced a page that was closed or reloaded, hence we also + // check whether we can delete the caches of our previous versions. + + event.waitUntil( + Promise.all([ + deleteOldCachesIfUnused(), + ...data.urls.map(async (rawUrl: unknown) => { + try { + // Note: URL.canParse() would be simpler, but it is not available on older versions of Safari (on iOS in + // particular), hence we let new URL() throw an exception (which we ignore) if the URL is invalid. + + const url = new URL(String(rawUrl)); + const cacheName = cacheNameFor(url); + + if (!cacheName) { + return; + } + + await pendingCacheWrite(url.href); + + if ((await cachedFile(url.href, cacheName)) || pendingCacheWrites.has(url.href)) { + return; + } + + await trackCacheWrite( + url.href, + (async () => { + const response = await fetch(url.href, { mode: url.origin === scope.origin ? 'same-origin' : 'cors' }); + + if (isCacheable(response)) { + await (await caches.open(cacheName)).put(url.href, response); + } + })() + ); + } catch { + // The URL is invalid or we couldn't fetch its file, in which case we will cache it the next time it gets + // fetched. + } + }) + ]) + ); +}); + +export {}; diff --git a/src/renderer/src/types/shims.d.ts b/src/renderer/src/types/shims.d.ts index 58d407fe..1a82fb34 100644 --- a/src/renderer/src/types/shims.d.ts +++ b/src/renderer/src/types/shims.d.ts @@ -5,6 +5,7 @@ declare const __CELLDL_RUNTIME_BUNDLED__: boolean; declare const __CELLDL_RUNTIME_PATH__: string; declare const __LIBOPENCOR_VERSION__: string; declare const __OPENCOR_PLOT_VERSION__: string; +declare const __OPENCOR_SERVICE_WORKER__: boolean; declare const __OPENCOR_VERSION__: string; declare const __UPLOT_VERSION__: string; diff --git a/src/renderer/vite.config.ts b/src/renderer/vite.config.ts index 4fafb794..2160627d 100644 --- a/src/renderer/vite.config.ts +++ b/src/renderer/vite.config.ts @@ -16,11 +16,14 @@ import { buildCellDLRuntime } from './scripts/celldl.runtime.ts'; import { downloadLibopencorJsIfNeeded } from './scripts/download.libopencor.js.ts'; import { libopencorVersion, opencorVersion } from './scripts/libopencor.version.ts'; import { stripPrimeIconsFontFacePlugin } from './scripts/primeicons.plugin.ts'; +import { serviceWorkerPlugin } from './scripts/sw.plugin.ts'; await downloadLibopencorJsIfNeeded( path.join(import.meta.dirname, 'public', 'libopencor', 'downloads', 'wasm', libopencorVersion) ); +const cellDLRuntimePath = await buildCellDLRuntime(path.join(import.meta.dirname, 'public')); + export default vite.defineConfig({ base: './', build: { @@ -44,14 +47,15 @@ export default vite.defineConfig({ }, define: { __CELLDL_RUNTIME_BUNDLED__: JSON.stringify(false), - __CELLDL_RUNTIME_PATH__: JSON.stringify(await buildCellDLRuntime(path.join(import.meta.dirname, 'public'))), + __CELLDL_RUNTIME_PATH__: JSON.stringify(cellDLRuntimePath), __LIBOPENCOR_VERSION__: JSON.stringify(libopencorVersion), __OPENCOR_PLOT_VERSION__: JSON.stringify(opencorPlotPackageJson.version), __OPENCOR_VERSION__: JSON.stringify(opencorVersion), __UPLOT_VERSION__: JSON.stringify(opencorPlotPackageJson.dependencies.uplot) }, plugins: [ - // Note: this must be in sync with electron.vite.config.ts. + // Note: this must be in sync with electron.vite.config.ts, except for our service worker plugin (OpenCOR doesn't + // need a service worker). tailwindcssPlugin(), stripPrimeIconsFontFacePlugin(), @@ -67,6 +71,19 @@ export default vite.defineConfig({ vitePlugin({ resolvers: [primeVueAutoImportResolver.PrimeVueResolver()] }), + // Note: the versioned external files that our service worker caches at runtime are libOpenCOR's glue and WASM, our + // CellDL runtime, and our external dependencies from jsDelivr (see src/common/initialisation.ts). Most of the + // latter are covered by OpenCOR Plot's version, while the others (e.g., JSZip and Math.js) rarely change, in + // which case their old copy only lingers until one of the versions below changes. + + serviceWorkerPlugin( + [ + libopencorVersion, + cellDLRuntimePath, + opencorPlotPackageJson.version, + opencorPlotPackageJson.dependencies.uplot + ].join('|') + ), ...(process.env.STATS === 'true' ? [ visualizerPlugin({