Skip to content

Commit

Permalink
fix(ConfigPlugin): export ConfigPlugin (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Mar 5, 2024
1 parent ed75a71 commit e50cc19
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/oruga/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ import type { OrugaOptions } from "./types";

import * as plugins from "./components/plugins";

import { merge } from "./utils/helpers";
import { setOptions, getOptions, ConfigProgrammatic } from "./utils/config";
import {
setVueInstance,
registerPlugin,
registerComponentProgrammatic,
} from "./utils/plugins";
import { ConfigProgrammatic, ConfigPlugin } from "./utils/config";
import { registerPlugin, registerComponentProgrammatic } from "./utils/plugins";

// export all types
export * from "./types";
Expand All @@ -25,22 +20,23 @@ export { LoadingProgrammatic } from "./components/loading";
export { ModalProgrammatic } from "./components/modal";
export { NotificationProgrammatic } from "./components/notification";
export { ConfigProgrammatic } from "./utils/config";
// export programmatic plugins
export { ConfigPlugin } from "./utils/config";

// export programmatic composable
export { useOruga } from "./utils/programmatic";

// default export main oruga vue plugin
const plugin: Plugin = {
install(app: App, options: OrugaOptions = {}) {
// set global vue instance
setVueInstance(app);
// set options
const defaultOptions = getOptions();
setOptions(merge(defaultOptions, options, true));
// enable programmatic config registering
app.use(ConfigPlugin, options);

// add components
for (const componentKey in plugins) {
registerPlugin(app, plugins[componentKey]);
}

// add programmatic config component
registerComponentProgrammatic(app, "config", ConfigProgrammatic);
},
Expand Down

0 comments on commit e50cc19

Please sign in to comment.