From 191795d286e5ede05c7cd54461a2ada3c3aee5d4 Mon Sep 17 00:00:00 2001 From: Jiri Tomasek Date: Fri, 28 Jul 2023 12:45:32 +0200 Subject: [PATCH 1/3] Added test extension --- pkg/test/babel.config.js | 1 + pkg/test/index.ts | 14 +++++++++++ pkg/test/package.json | 24 ++++++++++++++++++ pkg/test/tsconfig.json | 53 ++++++++++++++++++++++++++++++++++++++++ pkg/test/vue.config.js | 1 + 5 files changed, 93 insertions(+) create mode 100644 pkg/test/babel.config.js create mode 100644 pkg/test/index.ts create mode 100644 pkg/test/package.json create mode 100644 pkg/test/tsconfig.json create mode 100644 pkg/test/vue.config.js diff --git a/pkg/test/babel.config.js b/pkg/test/babel.config.js new file mode 100644 index 0000000..410af81 --- /dev/null +++ b/pkg/test/babel.config.js @@ -0,0 +1 @@ +module.exports = require('./.shell/pkg/babel.config.js'); diff --git a/pkg/test/index.ts b/pkg/test/index.ts new file mode 100644 index 0000000..a4c043c --- /dev/null +++ b/pkg/test/index.ts @@ -0,0 +1,14 @@ +import { importTypes } from '@rancher/auto-import'; +import { IPlugin } from '@shell/core/types'; + +// Init the package +export default function(plugin: IPlugin): void { + // Auto-import model, detail, edit from the folders + importTypes(plugin); + + // Provide plugin metadata from package.json + plugin.metadata = require('./package.json'); + + // Load a product + // plugin.addProduct(require('./product')); +} diff --git a/pkg/test/package.json b/pkg/test/package.json new file mode 100644 index 0000000..97aa9a1 --- /dev/null +++ b/pkg/test/package.json @@ -0,0 +1,24 @@ +{ + "name": "test", + "description": "test plugin", + "version": "0.1.0", + "private": false, + "rancher": true, + "scripts": { + "dev": "./node_modules/.bin/nuxt dev", + "nuxt": "./node_modules/.bin/nuxt" + }, + "engines": { + "node": ">=12" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.5.18", + "@vue/cli-service": "4.5.18", + "@vue/cli-plugin-typescript": "4.5.18" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead" + ] +} \ No newline at end of file diff --git a/pkg/test/tsconfig.json b/pkg/test/tsconfig.json new file mode 100644 index 0000000..09f3601 --- /dev/null +++ b/pkg/test/tsconfig.json @@ -0,0 +1,53 @@ +{ + "compilerOptions": { + "allowJs": true, + "target": "esnext", + "module": "esnext", + "strict": true, + "jsx": "preserve", + "importHelpers": true, + "moduleResolution": "node", + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "baseUrl": ".", + "preserveSymlinks": true, + "typeRoots": [ + "../../node_modules", + "../../node_modules/@rancher/shell/types" + ], + "types": [ + "node", + "webpack-env", + "@types/node", + "@types/jest", + "@types/lodash", + "rancher", + "shell" + ], + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ], + "paths": { + "@shell/*": [ + "../../node_modules/@rancher/shell/*" + ], + "@components/*": [ + "@rancher/components/*" + ] + } + }, + "include": [ + "**/*.ts", + "**/*.d.ts", + "**/*.tsx", + "**/*.vue" + ], + "exclude": [ + "../../node_modules" + ] +} diff --git a/pkg/test/vue.config.js b/pkg/test/vue.config.js new file mode 100644 index 0000000..d091d0a --- /dev/null +++ b/pkg/test/vue.config.js @@ -0,0 +1 @@ +module.exports = require('./.shell/pkg/vue.config')(__dirname); From 248c05d2259c9494d69cb43eb702ff3b99d34f35 Mon Sep 17 00:00:00 2001 From: Jiri Tomasek Date: Fri, 28 Jul 2023 12:47:29 +0200 Subject: [PATCH 2/3] Add some basic test product --- pkg/test/index.ts | 2 +- pkg/test/product.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 pkg/test/product.ts diff --git a/pkg/test/index.ts b/pkg/test/index.ts index a4c043c..8375917 100644 --- a/pkg/test/index.ts +++ b/pkg/test/index.ts @@ -10,5 +10,5 @@ export default function(plugin: IPlugin): void { plugin.metadata = require('./package.json'); // Load a product - // plugin.addProduct(require('./product')); + plugin.addProduct(require('./product')); } diff --git a/pkg/test/product.ts b/pkg/test/product.ts new file mode 100644 index 0000000..120239d --- /dev/null +++ b/pkg/test/product.ts @@ -0,0 +1,13 @@ +import { IPlugin } from '@shell/core/types'; + +export function init($plugin: IPlugin, store: any) { + const YOUR_PRODUCT_NAME = 'myProductName'; + + const { product } = $plugin.DSL(store, YOUR_PRODUCT_NAME); + + product({ + icon: 'gear', + inStore: 'management', + weight: 100 + }); +} \ No newline at end of file From 7ce4005cb92eef5922c5037ea1031baa17d2806d Mon Sep 17 00:00:00 2001 From: Jiri Tomasek Date: Fri, 28 Jul 2023 12:50:12 +0200 Subject: [PATCH 3/3] Bump the KubeVirt extension version to 0.1.1 --- pkg/kubevirt/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubevirt/package.json b/pkg/kubevirt/package.json index 9b5834a..bdc19ec 100644 --- a/pkg/kubevirt/package.json +++ b/pkg/kubevirt/package.json @@ -1,7 +1,7 @@ { "name": "suse-edge-kubevirt-extension", "description": "KubeVirt Rancher Dashboard extension", - "version": "0.1.0", + "version": "0.1.1", "license": "Apache-2.0", "private": false, "rancher": true,