From 7a5a5e0e9daf0b2a030ac1c99906ab253e4d40de Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Fri, 30 Sep 2022 13:44:43 +0100 Subject: [PATCH] add latest --- package.json | 3 +- quasar.config.js | 18 ++++++--- src/boot/mermaid.ts | 16 ++++++++ src/components/ProductionChain.vue | 2 +- src/pages/AnnoBase.vue | 2 +- src/pages/AnnoExpansions.vue | 2 +- src/pages/data/production-chains-base.ts | 50 ++++++++++++++++++++---- tsconfig.json | 5 ++- yarn.lock | 11 +++++- 9 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 src/boot/mermaid.ts diff --git a/package.json b/package.json index 836ac8b..37716b5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ }, "dependencies": { "@quasar/extras": "^1.0.0", - "@types/mermaid": "^9.1.0", "endent": "^2.1.0", "mermaid": "^9.1.7", "quasar": "^2.6.0", @@ -22,6 +21,7 @@ }, "devDependencies": { "@quasar/app-vite": "^1.0.0", + "@types/mermaid": "^9.1.0", "@types/node": "^12.20.21", "@typescript-eslint/eslint-plugin": "^5.10.0", "@typescript-eslint/parser": "^5.10.0", @@ -31,6 +31,7 @@ "eslint-plugin-vue": "^9.0.0", "prettier": "^2.5.1", "push-dir": "^0.4.1", + "rollup-plugin-visualizer": "^5.8.2", "typescript": "^4.5.4" }, "engines": { diff --git a/quasar.config.js b/quasar.config.js index c06eda6..1f40125 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -28,7 +28,7 @@ module.exports = configure(function (/* ctx */) { // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli-vite/boot-files - boot: [], + boot: ['mermaid'], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css css: ['app.scss'], @@ -56,6 +56,7 @@ module.exports = configure(function (/* ctx */) { alias: { composables: path.join(__dirname, './src/composables'), + boot: path.join(__dirname, './src/boot'), }, vueRouterMode: 'hash', // available values: 'hash', 'history' @@ -79,15 +80,22 @@ module.exports = configure(function (/* ctx */) { }, // viteVuePluginOptions: {}, - // vitePlugins: [ - // [ 'package-name', { ..options.. } ] - // ] + // vitePlugins: [], + + extendViteConf(viteConf, { isClient, isServer }) { + viteConf.plugins.push( + require('rollup-plugin-visualizer').visualizer({ + emitFile: true, + file: 'stats.html', + }) + ); + }, }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer devServer: { // https: true - open: true, // opens browser window automatically + open: false, // opens browser window automatically }, // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework diff --git a/src/boot/mermaid.ts b/src/boot/mermaid.ts new file mode 100644 index 0000000..124f8b6 --- /dev/null +++ b/src/boot/mermaid.ts @@ -0,0 +1,16 @@ +import { onMounted } from 'vue'; +import mermaid from 'mermaid'; + +function initialiseMermaid() { + onMounted(() => { + mermaid.initialize({ + startOnLoad: false, + logLevel: 'fatal', + securityLevel: 'loose', + theme: 'neutral', + flowchart: { htmlLabels: true } + }); + }); +} + +export { mermaid, initialiseMermaid }; diff --git a/src/components/ProductionChain.vue b/src/components/ProductionChain.vue index 814e033..53d2f10 100644 --- a/src/components/ProductionChain.vue +++ b/src/components/ProductionChain.vue @@ -5,7 +5,7 @@