From 4d7926944329a55e153b8d02363355d2e028bd1f Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Mon, 4 Mar 2024 16:11:20 -0500 Subject: [PATCH 01/13] upgrade packages, switch to bun --- frontend/.eslintrc | 35 + frontend/.eslintrc.js | 54 - frontend/README.md | 55 +- frontend/bun.lockb | Bin 0 -> 237622 bytes frontend/e2e/text-annotator.test.ts | 1 + frontend/package.json | 86 +- frontend/public/mockServiceWorker.js | 4 +- frontend/src/api/search.ts | 1 - frontend/src/components/AppSelectMulti.vue | 12 +- frontend/src/components/AppSelectSingle.vue | 12 +- frontend/src/components/TheHeader.vue | 3 +- frontend/src/pages/explore/TabSearch.vue | 2 +- frontend/tsconfig.json | 3 +- frontend/yarn.lock | 4274 ------------------- 14 files changed, 126 insertions(+), 4416 deletions(-) create mode 100644 frontend/.eslintrc delete mode 100644 frontend/.eslintrc.js create mode 100644 frontend/bun.lockb delete mode 100644 frontend/yarn.lock diff --git a/frontend/.eslintrc b/frontend/.eslintrc new file mode 100644 index 00000000..702e771d --- /dev/null +++ b/frontend/.eslintrc @@ -0,0 +1,35 @@ +{ + "root": true, + "extends": [ + "plugin:vue/vue3-recommended", + "plugin:vuejs-accessibility/recommended", + "eslint:recommended", + "@vue/eslint-config-typescript", + "@vue/eslint-config-prettier/skip-formatting", + ], + "parserOptions": { + "ecmaVersion": "latest", + }, + "rules": { + "prettier/prettier": "warn", + "vuejs-accessibility/anchor-has-content": [ + "error", + { + "accessibleDirectives": ["tooltip"], + }, + ], + "vuejs-accessibility/label-has-for": [ + "error", + { + "controlComponents": ["AppInput"], + "required": { + "some": ["nesting", "id"], + }, + "allowChildren": true, + }, + ], + "vue/no-v-html": ["off"], + "vue/no-v-text-v-html-on-component": ["off"], + "vuejs-accessibility/mouse-events-have-key-events": ["off"], + }, +} diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js deleted file mode 100644 index 5494aedb..00000000 --- a/frontend/.eslintrc.js +++ /dev/null @@ -1,54 +0,0 @@ -/* eslint-env node */ -require("@rushstack/eslint-patch/modern-module-resolution"); - -module.exports = { - root: true, - extends: [ - "plugin:vue/vue3-recommended", - "plugin:vuejs-accessibility/recommended", - "eslint:recommended", - "@vue/eslint-config-typescript", - "@vue/eslint-config-prettier/skip-formatting", - ], - parserOptions: { - ecmaVersion: "latest", - }, - - /** rule overrides (KEEP THIS AS MINIMAL AS POSSIBLE) */ - rules: { - "prettier/prettier": "warn", - - /** - * count v-tooltip (which adds an accessible aria-label attribute) as - * accessible - */ - "vuejs-accessibility/anchor-has-content": [ - "error", - { accessibleDirectives: ["tooltip"] }, - ], - /** - * allow nesting a control in a label without a for attribute (perfectly - * fine practice) - */ - "vuejs-accessibility/label-has-for": [ - "error", - { - controlComponents: ["AppInput"], - required: { some: ["nesting", "id"] }, - allowChildren: true, - }, - ], - /** - * allow v-html. we are only using this from very controlled sources, so - * little risk of XSS. - */ - "vue/no-v-html": ["off"], - "vue/no-v-text-v-html-on-component": ["off"], - /** - * important rule. only disregard in cases where mouse event only adds - * non-essentially functionality, e.g. hovering over a table cell to - * highlight its row and column. - */ - "vuejs-accessibility/mouse-events-have-key-events": ["off"], - }, -}; diff --git a/frontend/README.md b/frontend/README.md index 3063caaf..3e91aeeb 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,16 +1,16 @@ # Monarch Frontend -This project was scaffolded using Vite (`yarn create vite` → `Vue` → `create-vue`) with the following options: +This project was scaffolded using Vite (`bun create vite` → `Vue` → `create-vue`). +Stack summary: + +- Bun (for runtime and package manager, see note below) - TypeScript (for type checking) - Vue Router (for SPA navigation) - Vitest (unit testing) - Playwright (e2e testing) - ESLint (code quality) - Prettier (code formatting) - -Techniques/approaches used: - - Vue 3 - Composition API - `