Skip to content

Commit f9f18b6

Browse files
authored
feat: use previous meta and prevent duplicate parse (#79)
1 parent 5448a71 commit f9f18b6

File tree

6 files changed

+140
-96
lines changed

6 files changed

+140
-96
lines changed

.github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches:
55
- main
6+
- feat/*
7+
- fix/*
68
pull_request:
79
branches:
810
- main

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@nuxt/kit": "^3.15.1",
4343
"citty": "^0.1.6",
4444
"mlly": "^1.7.4",
45+
"ohash": "^2.0.11",
4546
"scule": "^1.3.0",
4647
"typescript": "^5.7.3",
4748
"ufo": "^1.5.4",

pnpm-lock.yaml

+39-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,20 @@ export default defineNuxtModule<ModuleOptions>({
182182
parser = useComponentMetaParser(parserOptions)
183183

184184
// Stub output in case it does not exist yet
185-
await parser.stubOutput()
185+
await Promise.all([
186+
parser.init(),
187+
parser.stubOutput(),
188+
])
186189
})
187190

188191
// Add useComponentMeta
189192
addImportsDir(resolver.resolve('./runtime/composables'))
190193

191-
addTemplate({
192-
filename: 'component-meta.mjs',
193-
getContents: () => 'export default {}',
194-
write: true
195-
})
194+
// addTemplate({
195+
// filename: 'component-meta.mjs',
196+
// getContents: () => 'export default {}',
197+
// write: true
198+
// })
196199

197200
addTemplate({
198201
filename: 'component-meta.d.ts',

0 commit comments

Comments
 (0)