From 9253d6942dfe0c1955506858f24edf60a33d19ee Mon Sep 17 00:00:00 2001 From: Yi Lei Feng Date: Thu, 9 May 2024 10:45:38 -0400 Subject: [PATCH] upgrade build from Vue CLI to Vite --- .eslintrc.js | 7 +- README.md | 4 +- babel.config.js | 3 - public/favicon.ico => favicon.ico | Bin public/favicon.svg => favicon.svg | 0 {public/help => help}/en.md | 0 {public/help => help}/fr.md | 0 .../images/datatable/applyFilters.png | Bin .../images/datatable/clearFilters.png | Bin .../help => help}/images/datatable/close.png | Bin .../images/datatable/collapse.png | Bin .../help => help}/images/datatable/expand.png | Bin .../images/datatable/extentFilter.png | Bin .../images/datatable/minimize.png | Bin .../images/datatable/showFilters.png | Bin .../images/datatable/toggleCols.png | Bin .../help => help}/images/layer/addLayer.png | Bin .../help => help}/images/layer/datatable.png | Bin {public/help => help}/images/layer/legend.png | Bin .../help => help}/images/layer/metadata.png | Bin {public/help => help}/images/layer/reload.png | Bin {public/help => help}/images/layer/remove.png | Bin .../images/layer/reorderLayers.png | Bin .../help => help}/images/layer/settings.png | Bin .../images/layer/toggleGroups.png | Bin .../images/layer/toggleVisibility.png | Bin .../images/layer/zoomBoundary.png | Bin .../images/navigation/basemaps.png | Bin .../images/navigation/fullscreen.png | Bin .../images/navigation/geolocate.png | Bin .../help => help}/images/navigation/help.png | Bin .../help => help}/images/navigation/home.png | Bin .../images/navigation/zoomin.png | Bin .../images/navigation/zoomout.png | Bin .../help => help}/images/overview/toggle.png | Bin public/index-ca-en.html => index-ca-en.html | 0 public/index-ca-fr.html => index-ca-fr.html | 0 public/index.html => index.html | 1 + package.json | 23 +++--- public/ramp-default.json => ramp-default.json | 0 .../highcharts-editor.complete.js | 0 .../highcharts-editor.min.css | 0 src/components/helpers/custom-editor.vue | 7 +- src/components/map-editor.vue | 4 +- src/components/metadata-editor.vue | 16 ++-- src/definitions.ts | 5 -- src/lang/index.ts | 2 +- src/lang/lang.csv | 3 +- src/main.ts | 2 +- src/shims-vue.d.ts | 6 ++ vite.config.mts | 21 ++++++ vue.config.js | 71 ------------------ 52 files changed, 62 insertions(+), 113 deletions(-) delete mode 100644 babel.config.js rename public/favicon.ico => favicon.ico (100%) rename public/favicon.svg => favicon.svg (100%) rename {public/help => help}/en.md (100%) rename {public/help => help}/fr.md (100%) rename {public/help => help}/images/datatable/applyFilters.png (100%) rename {public/help => help}/images/datatable/clearFilters.png (100%) rename {public/help => help}/images/datatable/close.png (100%) rename {public/help => help}/images/datatable/collapse.png (100%) rename {public/help => help}/images/datatable/expand.png (100%) rename {public/help => help}/images/datatable/extentFilter.png (100%) rename {public/help => help}/images/datatable/minimize.png (100%) rename {public/help => help}/images/datatable/showFilters.png (100%) rename {public/help => help}/images/datatable/toggleCols.png (100%) rename {public/help => help}/images/layer/addLayer.png (100%) rename {public/help => help}/images/layer/datatable.png (100%) rename {public/help => help}/images/layer/legend.png (100%) rename {public/help => help}/images/layer/metadata.png (100%) rename {public/help => help}/images/layer/reload.png (100%) rename {public/help => help}/images/layer/remove.png (100%) rename {public/help => help}/images/layer/reorderLayers.png (100%) rename {public/help => help}/images/layer/settings.png (100%) rename {public/help => help}/images/layer/toggleGroups.png (100%) rename {public/help => help}/images/layer/toggleVisibility.png (100%) rename {public/help => help}/images/layer/zoomBoundary.png (100%) rename {public/help => help}/images/navigation/basemaps.png (100%) rename {public/help => help}/images/navigation/fullscreen.png (100%) rename {public/help => help}/images/navigation/geolocate.png (100%) rename {public/help => help}/images/navigation/help.png (100%) rename {public/help => help}/images/navigation/home.png (100%) rename {public/help => help}/images/navigation/zoomin.png (100%) rename {public/help => help}/images/navigation/zoomout.png (100%) rename {public/help => help}/images/overview/toggle.png (100%) rename public/index-ca-en.html => index-ca-en.html (100%) rename public/index-ca-fr.html => index-ca-fr.html (100%) rename public/index.html => index.html (95%) rename public/ramp-default.json => ramp-default.json (100%) rename {public/scripts => scripts}/highcharts-editor/highcharts-editor.complete.js (100%) rename {public/scripts => scripts}/highcharts-editor/highcharts-editor.min.css (100%) create mode 100644 vite.config.mts delete mode 100644 vue.config.js diff --git a/.eslintrc.js b/.eslintrc.js index 3d5ca672..74f2d1f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,8 @@ module.exports = { root: true, env: { - node: true + node: true, + es2022: true }, extends: [ 'plugin:vue/essential', @@ -14,8 +15,8 @@ module.exports = { ecmaVersion: 2020 }, rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-console': import.meta.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': import.meta.env.NODE_ENV === 'production' ? 'warn' : 'off', 'prettier/prettier': ['error', { endOfLine: 'auto' }], 'sort-imports': ['error', {"ignoreCase": true, "ignoreDeclarationSort": true }], '@typescript-eslint/no-var-requires': 'off' diff --git a/README.md b/README.md index c4f1b660..15dd5e05 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RAMP Storylines Editor (formerly StoryRAMP) +# RAMP Storylines Editor RAMP Storylines Editor is an implementation of [RAMP4](https://github.com/ramp4-pcar4/ramp4-pcar4) (the mapping framework), [RAMP4 Config Editor](https://github.com/ramp4-pcar4/config-editor) (used to create map configurations), [Highcharts Editor](https://www.highcharts.com/blog/products/highcharts-editor/) (used to create interactive charts and graphs), and [Storylines](https://github.com/ramp4-pcar4/story-ramp) (used to host and display the created product). @@ -23,7 +23,7 @@ npm install ### Compiles and hot-reloads for development ``` -npm run serve +npm run dev ``` ### Compiles and minifies for production diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 162a3ea9..00000000 --- a/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ["@vue/cli-plugin-babel/preset"], -}; diff --git a/public/favicon.ico b/favicon.ico similarity index 100% rename from public/favicon.ico rename to favicon.ico diff --git a/public/favicon.svg b/favicon.svg similarity index 100% rename from public/favicon.svg rename to favicon.svg diff --git a/public/help/en.md b/help/en.md similarity index 100% rename from public/help/en.md rename to help/en.md diff --git a/public/help/fr.md b/help/fr.md similarity index 100% rename from public/help/fr.md rename to help/fr.md diff --git a/public/help/images/datatable/applyFilters.png b/help/images/datatable/applyFilters.png similarity index 100% rename from public/help/images/datatable/applyFilters.png rename to help/images/datatable/applyFilters.png diff --git a/public/help/images/datatable/clearFilters.png b/help/images/datatable/clearFilters.png similarity index 100% rename from public/help/images/datatable/clearFilters.png rename to help/images/datatable/clearFilters.png diff --git a/public/help/images/datatable/close.png b/help/images/datatable/close.png similarity index 100% rename from public/help/images/datatable/close.png rename to help/images/datatable/close.png diff --git a/public/help/images/datatable/collapse.png b/help/images/datatable/collapse.png similarity index 100% rename from public/help/images/datatable/collapse.png rename to help/images/datatable/collapse.png diff --git a/public/help/images/datatable/expand.png b/help/images/datatable/expand.png similarity index 100% rename from public/help/images/datatable/expand.png rename to help/images/datatable/expand.png diff --git a/public/help/images/datatable/extentFilter.png b/help/images/datatable/extentFilter.png similarity index 100% rename from public/help/images/datatable/extentFilter.png rename to help/images/datatable/extentFilter.png diff --git a/public/help/images/datatable/minimize.png b/help/images/datatable/minimize.png similarity index 100% rename from public/help/images/datatable/minimize.png rename to help/images/datatable/minimize.png diff --git a/public/help/images/datatable/showFilters.png b/help/images/datatable/showFilters.png similarity index 100% rename from public/help/images/datatable/showFilters.png rename to help/images/datatable/showFilters.png diff --git a/public/help/images/datatable/toggleCols.png b/help/images/datatable/toggleCols.png similarity index 100% rename from public/help/images/datatable/toggleCols.png rename to help/images/datatable/toggleCols.png diff --git a/public/help/images/layer/addLayer.png b/help/images/layer/addLayer.png similarity index 100% rename from public/help/images/layer/addLayer.png rename to help/images/layer/addLayer.png diff --git a/public/help/images/layer/datatable.png b/help/images/layer/datatable.png similarity index 100% rename from public/help/images/layer/datatable.png rename to help/images/layer/datatable.png diff --git a/public/help/images/layer/legend.png b/help/images/layer/legend.png similarity index 100% rename from public/help/images/layer/legend.png rename to help/images/layer/legend.png diff --git a/public/help/images/layer/metadata.png b/help/images/layer/metadata.png similarity index 100% rename from public/help/images/layer/metadata.png rename to help/images/layer/metadata.png diff --git a/public/help/images/layer/reload.png b/help/images/layer/reload.png similarity index 100% rename from public/help/images/layer/reload.png rename to help/images/layer/reload.png diff --git a/public/help/images/layer/remove.png b/help/images/layer/remove.png similarity index 100% rename from public/help/images/layer/remove.png rename to help/images/layer/remove.png diff --git a/public/help/images/layer/reorderLayers.png b/help/images/layer/reorderLayers.png similarity index 100% rename from public/help/images/layer/reorderLayers.png rename to help/images/layer/reorderLayers.png diff --git a/public/help/images/layer/settings.png b/help/images/layer/settings.png similarity index 100% rename from public/help/images/layer/settings.png rename to help/images/layer/settings.png diff --git a/public/help/images/layer/toggleGroups.png b/help/images/layer/toggleGroups.png similarity index 100% rename from public/help/images/layer/toggleGroups.png rename to help/images/layer/toggleGroups.png diff --git a/public/help/images/layer/toggleVisibility.png b/help/images/layer/toggleVisibility.png similarity index 100% rename from public/help/images/layer/toggleVisibility.png rename to help/images/layer/toggleVisibility.png diff --git a/public/help/images/layer/zoomBoundary.png b/help/images/layer/zoomBoundary.png similarity index 100% rename from public/help/images/layer/zoomBoundary.png rename to help/images/layer/zoomBoundary.png diff --git a/public/help/images/navigation/basemaps.png b/help/images/navigation/basemaps.png similarity index 100% rename from public/help/images/navigation/basemaps.png rename to help/images/navigation/basemaps.png diff --git a/public/help/images/navigation/fullscreen.png b/help/images/navigation/fullscreen.png similarity index 100% rename from public/help/images/navigation/fullscreen.png rename to help/images/navigation/fullscreen.png diff --git a/public/help/images/navigation/geolocate.png b/help/images/navigation/geolocate.png similarity index 100% rename from public/help/images/navigation/geolocate.png rename to help/images/navigation/geolocate.png diff --git a/public/help/images/navigation/help.png b/help/images/navigation/help.png similarity index 100% rename from public/help/images/navigation/help.png rename to help/images/navigation/help.png diff --git a/public/help/images/navigation/home.png b/help/images/navigation/home.png similarity index 100% rename from public/help/images/navigation/home.png rename to help/images/navigation/home.png diff --git a/public/help/images/navigation/zoomin.png b/help/images/navigation/zoomin.png similarity index 100% rename from public/help/images/navigation/zoomin.png rename to help/images/navigation/zoomin.png diff --git a/public/help/images/navigation/zoomout.png b/help/images/navigation/zoomout.png similarity index 100% rename from public/help/images/navigation/zoomout.png rename to help/images/navigation/zoomout.png diff --git a/public/help/images/overview/toggle.png b/help/images/overview/toggle.png similarity index 100% rename from public/help/images/overview/toggle.png rename to help/images/overview/toggle.png diff --git a/public/index-ca-en.html b/index-ca-en.html similarity index 100% rename from public/index-ca-en.html rename to index-ca-en.html diff --git a/public/index-ca-fr.html b/index-ca-fr.html similarity index 100% rename from public/index-ca-fr.html rename to index-ca-fr.html diff --git a/public/index.html b/index.html similarity index 95% rename from public/index.html rename to index.html index 37f60a7a..0abda623 100644 --- a/public/index.html +++ b/index.html @@ -18,6 +18,7 @@
+ diff --git a/package.json b/package.json index 8724dd95..cc630808 100644 --- a/package.json +++ b/package.json @@ -3,17 +3,18 @@ "version": "1.0.0", "private": true, "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "dev": "vite", + "serve": "vite preview", + "build": "vite build", + "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src" }, "dependencies": { "@kangc/v-md-editor": "^2.3.17", + "@rollup/plugin-dsv": "^3.0.4", "@tailwindcss/typography": "^0.4.0", "@types/highcharts": "^7.0.0", "axios": "^1.2.0", "clone-deep": "^4.0.1", - "core-js": "^3.6.5", "file-saver": "^2.0.5", "highcharts": "^9.3.2", "highcharts-vue": "^1.4.3", @@ -22,9 +23,12 @@ "jszip": "^3.10.1", "markdown-it": "^12.0.6", "nouislider": "^15.5.0", - "ramp-config-editor_editeur-config-pcar": "^1.1.8", "throttle-debounce": "^5.0.0", + "ramp-config-editor_editeur-config-pcar": "^2.0.0", + "ramp-storylines_demo-scenarios-pcar": "^3.1.3", + "url": "^0.11.3", "uuid": "^9.0.0", + "vite": "^5.2.9", "vue": "^3.3.4", "vue-class-component": "^8.0.0-rc.1", "vue-final-modal": "^4.4.5", @@ -42,27 +46,22 @@ "@types/file-saver": "^2.0.5", "@types/markdown-it": "^12.0.1", "@types/throttle-debounce": "^5.0.2", + "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", - "@vue/cli-plugin-babel": "^4.5.19", - "@vue/cli-plugin-eslint": "^4.5.19", - "@vue/cli-plugin-typescript": "^4.5.19", - "@vue/cli-service": "^4.5.19", + "@vitejs/plugin-vue": "^5.0.4", "@vue/compiler-sfc": "^3.3.4", "@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-typescript": "^7.0.0", "autoprefixer": "^9.8.6", - "dsv-loader": "^2.0.0", "eslint": "^6.8.0", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^6.2.2", - "html-loader": "^0.5.5", "pinia": "^2.1.7", "postcss": "^7.0.35", "prettier": "^2.2.1", "ramp-storylines_demo-scenarios-pcar": "^3.1.6", "sass": "^1.32.11", - "sass-loader": "^8.0.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.1.2", "typescript": "^4.4.4", "vue-eslint-parser": "^9.3.1" diff --git a/public/ramp-default.json b/ramp-default.json similarity index 100% rename from public/ramp-default.json rename to ramp-default.json diff --git a/public/scripts/highcharts-editor/highcharts-editor.complete.js b/scripts/highcharts-editor/highcharts-editor.complete.js similarity index 100% rename from public/scripts/highcharts-editor/highcharts-editor.complete.js rename to scripts/highcharts-editor/highcharts-editor.complete.js diff --git a/public/scripts/highcharts-editor/highcharts-editor.min.css b/scripts/highcharts-editor/highcharts-editor.min.css similarity index 100% rename from public/scripts/highcharts-editor/highcharts-editor.min.css rename to scripts/highcharts-editor/highcharts-editor.min.css diff --git a/src/components/helpers/custom-editor.vue b/src/components/helpers/custom-editor.vue index 8c3166a1..36fb5895 100644 --- a/src/components/helpers/custom-editor.vue +++ b/src/components/helpers/custom-editor.vue @@ -22,7 +22,7 @@