From 916ea8c67eb9633c01469c224c864f7a7aa93362 Mon Sep 17 00:00:00 2001 From: f-w Date: Sun, 15 Dec 2024 13:00:59 -0800 Subject: [PATCH] replaced bootstrap with spectre --- client/config/bootstrap.config.js | 63 ------------------------- client/config/bootstrap.config.less | 0 client/package-lock.json | 41 +++------------- client/package.json | 3 +- client/src/components/shared/editor.vue | 5 +- client/vite.config.js | 19 -------- 6 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 client/config/bootstrap.config.js delete mode 100644 client/config/bootstrap.config.less diff --git a/client/config/bootstrap.config.js b/client/config/bootstrap.config.js deleted file mode 100644 index a913767a9..000000000 --- a/client/config/bootstrap.config.js +++ /dev/null @@ -1,63 +0,0 @@ -module.exports = { - // Default for the style loading - styleLoader: 'style-loader!css-loader!less-loader', - - scripts: { - transition: true, - alert: true, - button: false, - carousel: false, - collapse: true, - dropdown: true, - modal: true, - tooltip: true, - popover: true, - scrollspy: true, - tab: true, - affix: false, - }, - styles: { - mixins: true, - - normalize: false, - print: false, - - scaffolding: false, - type: false, - code: false, - grid: false, - tables: false, - forms: false, - buttons: false, - - 'component-animations': false, - glyphicons: false, - dropdowns: false, - 'button-groups': false, - 'input-groups': false, - navs: false, - navbar: false, - breadcrumbs: false, - pagination: false, - pager: false, - labels: false, - badges: false, - jumbotron: false, - thumbnails: false, - alerts: false, - 'progress-bars': false, - media: false, - 'list-group': false, - panels: false, - wells: false, - close: false, - - modals: false, - tooltip: false, - popovers: false, - carousel: false, - - utilities: true, - 'responsive-utilities': false, - }, -}; diff --git a/client/config/bootstrap.config.less b/client/config/bootstrap.config.less deleted file mode 100644 index e69de29bb..000000000 diff --git a/client/package-lock.json b/client/package-lock.json index 5c4f10687..8b3ca5945 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -27,11 +27,9 @@ "@vitejs/plugin-vue": "^5.1.4", "@vue/eslint-config-typescript": "^14.1.3", "@vue/tsconfig": "^0.5.1", - "bootstrap": "^4.6.0", "ejs": "^3.1.9", "eslint": "^9.14.0", "eslint-plugin-vue": "^9.30.0", - "fast-glob": "^3.3.0", "jodit": "^4.0.0-beta.61", "jquery": "^3.5.0", "jquery-ui-bundle": "^1.12.1", @@ -42,6 +40,7 @@ "pinia": "^2.1.4", "sass": "1.77.8", "sass-embedded": "^1.77.8", + "spectre.css": "^0.5.9", "typescript": "~5.6.3", "unplugin-fonts": "^1.1.1", "unplugin-vue-components": "^0.27.2", @@ -1639,26 +1638,6 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, - "node_modules/bootstrap": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.2.tgz", - "integrity": "sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ], - "peerDependencies": { - "jquery": "1.9.1 - 3", - "popper.js": "^1.16.1" - } - }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -3182,18 +3161,6 @@ "pathe": "^1.1.2" } }, - "node_modules/popper.js": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", - "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", - "deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1", - "dev": true, - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/postcss": { "version": "8.4.49", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", @@ -3859,6 +3826,12 @@ "node": ">=0.10.0" } }, + "node_modules/spectre.css": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/spectre.css/-/spectre.css-0.5.9.tgz", + "integrity": "sha512-9jUqwZmCnvflrxFGcK+ize43TvjwDjqMwZPVubEtSIHzvinH0TBUESm1LcOJx3Ur7bdPaeOHQIjOqBl1Y5kLFw==", + "dev": true + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", diff --git a/client/package.json b/client/package.json index b801e76b7..e37290375 100644 --- a/client/package.json +++ b/client/package.json @@ -30,11 +30,9 @@ "@vitejs/plugin-vue": "^5.1.4", "@vue/eslint-config-typescript": "^14.1.3", "@vue/tsconfig": "^0.5.1", - "bootstrap": "^4.6.0", "ejs": "^3.1.9", "eslint": "^9.14.0", "eslint-plugin-vue": "^9.30.0", - "fast-glob": "^3.3.0", "jodit": "^4.0.0-beta.61", "jquery": "^3.5.0", "jquery-ui-bundle": "^1.12.1", @@ -45,6 +43,7 @@ "pinia": "^2.1.4", "sass": "1.77.8", "sass-embedded": "^1.77.8", + "spectre.css": "^0.5.9", "typescript": "~5.6.3", "unplugin-fonts": "^1.1.1", "unplugin-vue-components": "^0.27.2", diff --git a/client/src/components/shared/editor.vue b/client/src/components/shared/editor.vue index 34a6918a5..f4dd01011 100644 --- a/client/src/components/shared/editor.vue +++ b/client/src/components/shared/editor.vue @@ -74,7 +74,7 @@ export default defineComponent({ this.jsonEditor.destroy(); } this.jsonEditor = new JSONEditor(element, { - theme: 'bootstrap4', + theme: 'spectre', iconlib: 'fontawesome5', keep_oneof_values: false, required_by_default: false, @@ -103,8 +103,7 @@ export default defineComponent({ } #nb-item-editor { - @import (less) 'bootstrap/dist/css/bootstrap.css'; - inject-css: 'node_modules/@json-editor/json-editor/src/**/*.css'; + @import (less) 'spectre.css/dist/spectre.css'; select { -webkit-appearance: menulist-button; } diff --git a/client/vite.config.js b/client/vite.config.js index b63430b4e..340b27af1 100644 --- a/client/vite.config.js +++ b/client/vite.config.js @@ -8,8 +8,6 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'; import { NestFactory } from '@nestjs/core'; import inject from '@rollup/plugin-inject'; import ejs from 'ejs'; -import { globSync } from 'fast-glob'; -import fs from 'fs'; import { fileURLToPath, URL } from 'node:url'; import VueRouter from 'unplugin-vue-router/vite'; import { defineConfig } from 'vite'; @@ -28,23 +26,6 @@ export default async ({ mode }) => { vue({ template: { transformAssetUrls }, }), - // glob inject css - { - load(id) { - if (id.endsWith('.vue')) { - const source = fs - .readFileSync(id) - .toString() - .replace(/inject-css:\s*'([^']+)';/g, (replace) => { - const pattern = replace.match(/'([^']+)/)[1]; - return globSync(pattern, { absolute: true }) - .map((file) => fs.readFileSync(file)) - .join('\n'); - }); - return source; - } - }, - }, // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin vuetify({ autoImport: true,