Skip to content

Commit 6f19234

Browse files
committed
feat(autoimport): Add formkit-primevue components
1 parent f4a033f commit 6f19234

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

playground/app.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script setup lang='ts'>
2-
import { FormKitDataEdit } from '@sfxcode/formkit-primevue/components'
3-
42
const { addElement, addList, addListGroup } = useFormKitSchema()
53
const { addListGroupFunctions, addGroupButtons, addInsertButton } = useFormKitRepeater()
64
const { t } = useI18n()

src/module.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
addPlugin,
44
createResolver,
55
installModule,
6-
addImports,
6+
addImports, addComponent,
77
} from '@nuxt/kit'
88
import defu from 'defu'
99

@@ -65,8 +65,24 @@ export default defineNuxtModule<ModuleOptions>({
6565
'useInputEditorSchema',
6666
]
6767

68+
const NPM_PCK_FORMKIT_PRIMEVUE = '@sfxcode/formkit-primevue'
69+
6870
names.forEach(name =>
69-
addImports({ name, as: name, from: '@sfxcode/formkit-primevue' }),
71+
addImports({ name, as: name, from: NPM_PCK_FORMKIT_PRIMEVUE }),
72+
)
73+
74+
const componentNames = [
75+
'FormKitDataEdit',
76+
'FormKitDataView',
77+
'FormKitDataDebug',
78+
]
79+
80+
componentNames.forEach(name =>
81+
addComponent({
82+
name,
83+
export: name,
84+
filePath: NPM_PCK_FORMKIT_PRIMEVUE,
85+
}),
7086
)
7187

7288
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`

0 commit comments

Comments
 (0)