Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

chore(deps-dev): bump @types/node from 18.11.8 to 18.14.6 #113

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
28 changes: 0 additions & 28 deletions nuxt/index.js

This file was deleted.

43 changes: 43 additions & 0 deletions nuxt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {
defineNuxtModule,
addPluginTemplate,
createResolver,
resolvePath,
} from '@nuxt/kit';
import fs from 'fs';

export default defineNuxtModule({
meta: {
name: 'zetto',
configKey: 'zetto',
compatibility: {
nuxt: '^3.0.0-rc.6',
},
},
// Default configuration options for the module
defaults: {
configPath: false,
// vueSelectCSS: true,
},
async setup(moduleOptions, nuxt) {
let importStatement = 'const options = {}';

const configPath = await resolvePath('zetto.config', {
extensions: ['.js', '.ts'],
});

if (fs.existsSync(configPath)) {
importStatement = `import options from '${configPath}'`; // Validate js/ts
}

// @ts-ignore
const resolver = createResolver(import.meta.url);
addPluginTemplate({
src: resolver.resolve('plugin.ts'),
options: { importStatement },
});

// if (options.vueSelectCSS)
// nuxt.options.css.push('font-awesome/css/font-awesome.css')
},
});
10 changes: 0 additions & 10 deletions nuxt/plugin.js

This file was deleted.

7 changes: 7 additions & 0 deletions nuxt/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineNuxtPlugin } from '#app'
import Zetto from 'zetto';
<%= options.importStatement %>

export default defineNuxtPlugin(({ vueApp }) => {
vueApp.use(Zetto, options);
});
Loading