vue plugin system somehow works
This commit is contained in:
@@ -26,6 +26,7 @@ import editorPlugin from '../editor/plugin';
|
||||
import { ZeroSchema } from 'zero/schemas';
|
||||
import { ZeroSchemaProp } from './zero';
|
||||
import * as zeroOptions from '../options';
|
||||
import plugins from '../plugins.generated';
|
||||
|
||||
export class ZeroRuntime implements Zero
|
||||
{
|
||||
@@ -113,6 +114,11 @@ export class ZeroRuntime implements Zero
|
||||
translationPlugin.install(pluginOptions);
|
||||
integrationPlugin.install(pluginOptions);
|
||||
userPlugin.install(pluginOptions);
|
||||
|
||||
plugins.forEach(plugin =>
|
||||
{
|
||||
plugin.install(pluginOptions);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
strong
|
||||
{
|
||||
display: inline-block;
|
||||
margin-bottom: 5px;
|
||||
margin-bottom: 3px;
|
||||
color: var(--color-text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export default [ ];
|
||||
@@ -0,0 +1,2 @@
|
||||
import zeroPlugin0 from '@zeroplugin0/plugin';
|
||||
export default [ zeroPlugin0 ];
|
||||
@@ -6,6 +6,9 @@
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"workspaces": [
|
||||
"../plugins/zero.Commerce/zero.Commerce.Plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
"dayjs": "^1.10.7",
|
||||
|
||||
@@ -11,5 +11,6 @@
|
||||
"esModuleInterop": true,
|
||||
"lib": [ "esnext", "dom" ]
|
||||
},
|
||||
"include": [ "app/**/*.ts", "app/**/*.d.ts", "app/**/*.tsx", "app/**/*.vue" ]
|
||||
"include": [ "app/**/*.ts", "app/**/*.d.ts", "app/**/*.tsx", "app/**/*.vue" ],
|
||||
"exclude": [ "node_modules" ]
|
||||
}
|
||||
@@ -10,7 +10,8 @@ let loadedPlugins = JSON.parse(process.env.ZERO_PLUGINS || "[]");
|
||||
if (!process.env.ZERO_PLUGINS)
|
||||
{
|
||||
//loadedPlugins = ["../zero.Commerce/Plugin", "../zero.Stories/Plugin", "../zero.Forms/Plugin", "../../Laola/Laola.Backoffice/Plugin"];
|
||||
loadedPlugins = [];
|
||||
loadedPlugins = ["../plugins/zero.Commerce/zero.Commerce.Plugin"]
|
||||
//loadedPlugins = [];
|
||||
}
|
||||
|
||||
let zeroPlugins = [];
|
||||
@@ -40,12 +41,12 @@ loadedPlugins.forEach(pluginPath =>
|
||||
}
|
||||
|
||||
pluginNames.push(name);
|
||||
pluginFileContent += "import " + name + " from '" + alias + "/plugin.js';\n";
|
||||
pluginFileContent += "import " + name + " from '" + alias + "/plugin';\n";
|
||||
});
|
||||
|
||||
pluginFileContent += "export default [ " + pluginNames.join(', ') + " ];";
|
||||
|
||||
fs.writeFile(path.resolve(__dirname, 'app/plugins.generated.js'), pluginFileContent, err =>
|
||||
fs.writeFile(path.resolve(__dirname, 'app/plugins.generated.ts'), pluginFileContent, err =>
|
||||
{
|
||||
if (err)
|
||||
{
|
||||
@@ -76,7 +77,8 @@ let config = defineConfig({
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
vue: '@vue/compat'
|
||||
vue: '@vue/compat',
|
||||
...pluginAliases,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
|
||||
Reference in New Issue
Block a user