diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.babelrc b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.babelrc deleted file mode 100644 index f2c9da3ae6..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.babelrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugins": ["@babel/syntax-dynamic-import"], - "presets": [ - [ - "@babel/preset-env", - { - "modules": false - } - ] - ] -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.prettierrc.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.prettierrc.cjs similarity index 100% rename from openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.prettierrc.js rename to openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.prettierrc.cjs diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/babel.config.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/babel.config.json deleted file mode 100644 index 70cf332aec..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/babel.config.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "presets": ["@babel/preset-env"], - "plugins": [ - [ - "@babel/plugin-transform-runtime", - { - "useESModules": true, - "regenerator": false - } - ], - "@babel/plugin-proposal-class-properties", - "babel-plugin-istanbul" - ], - "env": { - "test": { - "presets": [ - [ - "@babel/preset-env", - { - "targets": "current node" - } - ] - ] - } - } -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs index adfd651238..044a8f854a 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs @@ -23,12 +23,8 @@ export default [...compat.extends("plugin:prettier/recommended"), { ...globals.node, }, - ecmaVersion: 5, - sourceType: "commonjs", - - parserOptions: { - parser: "@babel/eslint-parser", - }, + ecmaVersion: 2020, + sourceType: "module", }, rules: { diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json index 5388f34fcf..542f2eb73b 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json @@ -6,10 +6,8 @@ "source": "src/index.js", "main": "dist/ace-diff.min.js", "scripts": { - "build": "webpack --mode=production --node-env=production", - "build:dev": "webpack --mode=development", - "build:prod": "webpack --mode=production --node-env=production", - "watch": "webpack --watch" + "build": "vite build", + "lint": "eslint src" }, "repository": { "type": "git", @@ -18,24 +16,9 @@ "author": "Ben Keen, Jason Thomas", "license": "MIT", "devDependencies": { - "@babel/core": "^7.26.0", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/plugin-syntax-dynamic-import": "7.8.3", - "@babel/plugin-transform-runtime": "7.25.9", - "@babel/preset-env": "^7.26.0", - "@babel/runtime": "7.26.0", - "@webpack-cli/generators": "^3.0.7", - "babel-loader": "^9.2.1", - "babel-plugin-istanbul": "7.0.0", "eslint": "9.16.0", - "file-loader": "^6.2.0", "prettier": "3.3.3", "sass": "1.80.4", - "sass-loader": "16.0.2", - "webpack": "^5.95.0", - "webpack-cli": "^5.1.4", - "webpack-dev-server": "5.1.0", - "webpack-merge": "6.0.1", - "webpack-remove-empty-scripts": "^1.0.4" + "vite": "5.4.11" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/vite.config.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/vite.config.js new file mode 100644 index 0000000000..fdfe15bfe6 --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/vite.config.js @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + build: { + sourcemap: true, + rollupOptions: { + input: ['./src/index.js', './src/styles/ace-diff.scss', './src/styles/ace-diff-dark.scss'], + output: { + entryFileNames: 'ace-diff.min.js', + assetFileNames: '[name].min[extname]', + }, + preserveEntrySignatures: 'strict', + }, + }, +}) diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/webpack.config.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/webpack.config.js deleted file mode 100644 index b699255085..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/webpack.config.js +++ /dev/null @@ -1,57 +0,0 @@ -const path = require('path') -const isProduction = process.env.NODE_ENV == 'production' -// This removes the empty main.js that gets generated by webpack for the css files -const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts') - -const js_config = { - name: 'javascript', - entry: './src/index.js', - output: { - path: path.resolve(__dirname, 'dist'), - filename: 'ace-diff.min.js', - library: { - type: 'commonjs-module', - }, - }, - module: { - rules: [ - { - test: /\.(js|jsx)$/i, - loader: 'babel-loader', - }, - ], - }, -} - -const scss_config = { - name: 'scss', - entry: ['./src/styles/ace-diff.scss', './src/styles/ace-diff-dark.scss'], - module: { - rules: [ - { - test: /\.scss$/, - exclude: /node_modules/, - use: [ - { - loader: 'file-loader', - options: { name: '[name].min.css' }, - }, - // Compiles Sass to CSS - 'sass-loader', - ], - }, - ], - }, - plugins: [new RemoveEmptyScriptsPlugin()], -} - -module.exports = () => { - if (isProduction) { - js_config.mode = 'production' - scss_config.mode = 'production' - } else { - js_config.mode = 'development' - scss_config.mode = 'production' - } - return [js_config, scss_config] -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html index ae480434b8..4e1718ce12 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html @@ -83,15 +83,15 @@ System.import('vue'), ]).then(function (modules) { System.set(System.resolve('vue'), window.Vue) - Promise.all([ + return Promise.all([ System.import('vue-router'), System.import('vuex'), System.import('vuetify') - ]).then(function (modules) { - System.set(System.resolve('vue-router'), window.VueRouter) - System.set(System.resolve('vuex'), window.Vuex) - System.import('@openc3/tool-base') - }) + ]) + }).then(function (modules) { + System.set(System.resolve('vue-router'), window.VueRouter) + System.set(System.resolve('vuex'), window.Vuex) + System.import('@openc3/tool-base') }) })() diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html index 753c574bd3..bc4c0afc30 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html @@ -83,15 +83,15 @@ System.import('vue'), ]).then(function (modules) { System.set(System.resolve('vue'), window.Vue) - Promise.all([ + return Promise.all([ System.import('vue-router'), System.import('vuex'), System.import('vuetify') - ]).then(function (modules) { - System.set(System.resolve('vue-router'), window.VueRouter) - System.set(System.resolve('vuex'), window.Vuex) - System.import('@openc3/tool-base') - }) + ]) + }).then(function (modules) { + System.set(System.resolve('vue-router'), window.VueRouter) + System.set(System.resolve('vuex'), window.Vuex) + System.import('@openc3/tool-base') }) })() diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/tools/admin/PluginDialog.vue b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/tools/admin/PluginDialog.vue index 0e462f5f96..8a71fd64bf 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/tools/admin/PluginDialog.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/tools/admin/PluginDialog.vue @@ -118,8 +118,7 @@ import 'ace-builds/src-min-noconflict/mode-ruby' import 'ace-builds/src-min-noconflict/theme-twilight' import 'ace-builds/src-min-noconflict/ext-language_tools' import 'ace-builds/src-min-noconflict/ext-searchbox' -import * as AceDiff from '@openc3/ace-diff' -import '@openc3/ace-diff/dist/ace-diff.min.css' +import AceDiff from '@openc3/ace-diff' import '@openc3/ace-diff/dist/ace-diff-dark.min.css' import { toRaw } from 'vue'