Skip to content

Commit

Permalink
Introduce vue-cli and replace nuxt.config with vue.config
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Sep 20, 2023
1 parent 3d4a4b6 commit 606313e
Show file tree
Hide file tree
Showing 14 changed files with 2,402 additions and 9,143 deletions.
28 changes: 28 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pkg/rancher-desktop/nuxt/
/node_modules/
.DS_Store
.vscode
/resources/darwin/
/resources/linux/*
!/resources/linux/rancher-desktop.desktop
/resources/win32/
/resources/host/
/resources/rancher-dashboard/*
/resources/preload.js*
/resources/rdx-proxy.tgz
/coverage/
/dist/**
/.idea/
.nuxt/
/pkg/rancher-desktop/node_modules/
/src/go/rdctl/pkg/options/generated/*.go
*~
\#*
/e2e/reports/*
*.exe
/screenshots/output/
/bats/bin/
/bats/bats.tar.gz
/bats/logs/
script_logs/
scripts/lib/installer-win32-gen.tsx
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
],
// add your custom rules here
rules: {
'import/namespace': 'off',
'dot-notation': 'off',
'generator-star-spacing': 'off',
'guard-for-in': 'off',
Expand Down
22 changes: 20 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@ const electronVersion = parseInt(/\d+/.exec(packageJson.devDependencies.electron
module.exports = {
presets: [
[
'@babel/preset-env', { targets: { electron: electronVersion } },
'@babel/preset-typescript',
'@vue/cli-plugin-babel/preset',
{ useBuiltIns: false },
],
[
'@babel/preset-env',
{
targets: {
node: 'current',
electron: electronVersion,
},
},
],
],
env: {
test: {
presets: [
['@babel/env',
{ targets: { node: 'current' } },
],
],
},
},
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-nullish-coalescing-operator',
Expand Down
70 changes: 49 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
},
"scripts": {
"dev": "node scripts/ts-wrapper.js scripts/dev.ts",
"dev:ui": "VUE_CLI_SERVICE_CONFIG_PATH=pkg/rancher-desktop/vue.config.js vue-cli-service serve",
"lint": "yarn lint:fix",
"lint:fix": "yarn lint:typescript:fix && yarn lint:go:fix ",
"lint:nofix": "yarn lint:typescript:nofix && yarn lint:go:nofix",
"lint:typescript:fix": "eslint --ignore-path=.gitignore --ext mjs,js,ts,tsx,vue --fix --report-unused-disable-directives .",
"lint:typescript:nofix": "eslint --ignore-path=.gitignore --ext mjs,js,ts,tsx,vue --report-unused-disable-directives .",
"lint:typescript:fix": "eslint --ignore-path=.eslintignore --ext mjs,js,ts,tsx,vue --fix --report-unused-disable-directives .",
"lint:typescript:nofix": "eslint --ignore-path=.eslintignore --ext mjs,js,ts,tsx,vue --report-unused-disable-directives .",
"lint:go:fix": "gofmt -w src/go",
"lint:go:nofix": "node scripts/ts-wrapper.js scripts/lint-go.ts",
"generate:nerdctl-stub": "powershell scripts/windows/generate-nerdctl-stub.ps1",
Expand Down Expand Up @@ -52,13 +53,13 @@
"dependencies": {
"@docker/extension-api-client-types": "0.3.4",
"@kubernetes/client-node": "0.18.1",
"@nuxtjs/eslint-module": "4.1.0",
"@rancher/components": "0.1.3",
"@rancher/shell": "0.1.3",
"agent-base": "6.0.2",
"bufferutil": "4.0.7",
"cookie-universal-nuxt": "2.2.2",
"console": "^0.7.2",
"cookie-universal": "2.2.2",
"core-js": "3.25.3",
"crypto-browserify": "^3.12.0",
"dayjs": "1.11.5",
"dompurify": "3.0.1",
"electron-updater": "^5.3.0",
Expand All @@ -77,32 +78,45 @@
"native-reg": "1.1.1",
"node-fetch": "2.6.7",
"node-forge": "1.3.1",
"os-browserify": "^0.3.0",
"rancher-icons": "rancher/icons#v2.0.19",
"ref-napi": "3.0.3",
"ref-struct-di": "1.1.1",
"semver": "7.5.4",
"socks-proxy-agent": "8.0.2",
"sudo-prompt": "9.2.1",
"tar-stream": "3.0.0",
"ufo": "0.7.11",
"unfetch": "4.2.0",
"utf-8-validate": "6.0.3",
"v-tooltip": "2.1.3",
"vue": "2.6.14",
"vue": "2.7.14",
"vue-class-component": "7.2.6",
"vue-client-only": "2.1.0",
"vue-js-modal": "2.0.1",
"vue-meta": "2.4.0",
"vue-no-ssr": "1.1.1",
"vue-property-decorator": "9.1.2",
"vue-router": "3.6.5",
"vue-select": "3.20.2",
"vue-shortkey": "3.1.7",
"vue-slider-component": "3.2.24",
"vuex": "3.6.2",
"which": "3.0.1",
"xdg-app-paths": "5.5.1",
"yaml": "2.3.1"
},
"devDependencies": {
"@babel/eslint-parser": "7.22.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@electron/asar": "3.2.3",
"@nuxt/types": "2.15.8",
"@nuxt/typescript-build": "2.1.0",
"@nuxtjs/eslint-config": "12.0.0",
"@nuxtjs/eslint-config-typescript": "12.0.0",
"@nuxtjs/eslint-config": "6.0.1",
"@nuxtjs/eslint-config-typescript": "6.0.1",
"@nuxtjs/router-extras": "1.1.1",
"@nuxtjs/style-resources": "1.2.1",
"@octokit/rest": "19.0.5",
Expand All @@ -122,46 +136,60 @@
"@types/ref-struct-di": "1.1.6",
"@types/semver": "7.5.0",
"@types/tar-stream": "2.2.2",
"@types/webpack": "^5.28.1",
"@types/which": "3.0.0",
"@typescript-eslint/eslint-plugin": "5.44.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@vue/cli-plugin-babel": "5.0.8",
"@vue/cli-plugin-eslint": "5.0.8",
"@vue/cli-plugin-router": "5.0.8",
"@vue/cli-plugin-typescript": "5.0.8",
"@vue/cli-plugin-unit-jest": "5.0.8",
"@vue/cli-plugin-vuex": "5.0.8",
"@vue/cli-service": "5.0.8",
"@vue/eslint-config-standard": "6.1.0",
"@vue/eslint-config-typescript": "9.1.0",
"@vue/test-utils": "1.3.6",
"babel-core": "7.0.0-bridge.0",
"@vue/vue2-jest": "27.0.0",
"babel-eslint": "10.1.0",
"babel-jest": "27.5.1",
"css-loader": "4.3.0",
"ejs": "3.1.9",
"electron": "20.3.8",
"electron-builder": "23.6.0",
"electron-notarize": "1.2.2",
"eslint": "8.39.0",
"eslint": "7.32.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-deprecation": "1.3.3",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-nuxt": "4.0.0",
"eslint-plugin-vue": "9.15.1",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.0.0",
"eslint-plugin-vue": "8.7.1",
"extract-zip": "2.0.1",
"jest": "29.5.0",
"jest-environment-jsdom": "29.6.2",
"js-yaml-loader": "1.2.2",
"jsonpath-plus": "6.0.1",
"mustache": "4.2.0",
"nan": "2.17.0",
"nuxt": "2.15.8",
"octokit": "^2.0.22",
"raw-loader": "4.0.2",
"sass": "1.64.1",
"sass-loader": "10.2.0",
"ts-jest": "29.1.0",
"sass-loader": "12.6.0",
"ts-jest": "27.1.5",
"ts-loader": "8.4.0",
"ts-node": "10.9.1",
"tsconfig-paths": "4.1.2",
"typescript": "4.5.4",
"typescript": "4.5.5",
"vue-eslint-parser": "^9.3.0",
"vue-jest": "3.0.7",
"vue-template-compiler": "2.6.14",
"webpack": "4.46.0"
"vue-template-compiler": "2.7.14",
"webpack": "5.88.2"
},
"resolutions": {
"@types/ref-napi": "3.0.5",
"typescript": "4.5.4"
"@types/ref-napi": "3.0.5"
},
"optionalDependencies": {
"dmg-license": "1.0.11"
Expand Down
20 changes: 10 additions & 10 deletions pkg/rancher-desktop/assets/styles/fonts/_fontstack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
font-style: normal;
font-weight: normal;
src: local(''),
url('~assets/fonts/poppins/poppins-v15-latin-300.woff2') format('woff2'), /* Super Modern Browsers */
url('~assets/fonts/poppins/poppins-v15-latin-300.woff') format('woff'), /* Modern Browsers */
url('@pkg/assets/fonts/poppins/poppins-v15-latin-300.woff2') format('woff2'), /* Super Modern Browsers */
url('@pkg/assets/fonts/poppins/poppins-v15-latin-300.woff') format('woff'), /* Modern Browsers */
}

/* poppins-500 - latin */
Expand All @@ -14,8 +14,8 @@
font-style: normal;
font-weight: bold;
src: local(''),
url('~assets/fonts/poppins/poppins-v15-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('~assets/fonts/poppins/poppins-v15-latin-500.woff') format('woff'), /* Modern Browsers */
url('@pkg/assets/fonts/poppins/poppins-v15-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('@pkg/assets/fonts/poppins/poppins-v15-latin-500.woff') format('woff'), /* Modern Browsers */
}

/* lato-regular - latin */
Expand All @@ -24,8 +24,8 @@
font-style: normal;
font-weight: normal;
src: local(''),
url('~assets/fonts/lato/lato-v17-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('~assets/fonts/lato/lato-v17-latin-regular.woff') format('woff'), /* Modern Browsers */
url('@pkg/assets/fonts/lato/lato-v17-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('@pkg/assets/fonts/lato/lato-v17-latin-regular.woff') format('woff'), /* Modern Browsers */
}

/* lato-700 - latin */
Expand All @@ -34,8 +34,8 @@
font-style: normal;
font-weight: bold;
src: local(''),
url('~assets/fonts/lato/lato-v17-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('~assets/fonts/lato/lato-v17-latin-700.woff') format('woff'), /* Modern Browsers */
url('@pkg/assets/fonts/lato/lato-v17-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('@pkg/assets/fonts/lato/lato-v17-latin-700.woff') format('woff'), /* Modern Browsers */
}

/* roboto-mono-regular - latin */
Expand All @@ -44,6 +44,6 @@
font-style: normal;
font-weight: normal;
src: local(''),
url('~assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('~assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff') format('woff'), /* Modern Browsers */
url('@pkg/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('@pkg/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff') format('woff'), /* Modern Browsers */
}
4 changes: 2 additions & 2 deletions pkg/rancher-desktop/assets/styles/global/_columns.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use 'sass:math';

@import "~assets/styles/base/functions";
@import "~assets/styles/base/_variables";
@import "@pkg/assets/styles/base/_functions";
@import "@pkg/assets/styles/base/_variables";


$COLUMNS: 6 10 11 12 23 24;
Expand Down
32 changes: 19 additions & 13 deletions pkg/rancher-desktop/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { importTypes } from '@rancher/auto-import';
import { IPlugin } from '@shell/core/types';
/***
* NOTE: @rancher/shell was removed from this project during the Nuxt removal.
* I'm keeping this file around for it's eventual reintroduction; it was easier
* to limit the potential scope of issues associated with the Nuxt removal by
* removing @rancher/shell
*/
// import { importTypes } from '@rancher/auto-import';
// import { IPlugin } from '@shell/core/types';

import routes from './router';
// import routes from './router';

// Init the package
export default function(plugin: IPlugin) {
// Auto-import model, detail, edit from the folders
importTypes(plugin);
// // Init the package
// export default function(plugin: IPlugin) {
// // Auto-import model, detail, edit from the folders
// importTypes(plugin);

// Provide plugin metadata from package.json
plugin.metadata = require('./package.json');
// // Provide plugin metadata from package.json
// plugin.metadata = require('./package.json');

// Load a product
plugin.addProduct(require('./product'));
// // Load a product
// plugin.addProduct(require('./product'));

plugin.addRoutes(routes);
}
// plugin.addRoutes(routes);
// }
Loading

0 comments on commit 606313e

Please sign in to comment.