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, 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..8375917 --- /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/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 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);