Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxtlabs/nuxt-component-meta
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.0
Choose a base ref
...
head repository: nuxtlabs/nuxt-component-meta
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.10.1
Choose a head ref
  • 3 commits
  • 7 files changed
  • 2 contributors

Commits on Feb 24, 2025

  1. fix(cli): use importModule to generate component-meta output (#77)

    userquin authored Feb 24, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4bf5ed9 View commit details
  2. fix: prevent duplicate hash generation in Nitro OpenApi

    reported in nuxt/content#3134
    farnabaz committed Feb 24, 2025
    Copy the full SHA
    4f5fb93 View commit details

Commits on Mar 25, 2025

  1. chore(release): release v0.10.1

    farnabaz committed Mar 25, 2025
    Copy the full SHA
    5448a71 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: corepack enable
- run: npm i -g --force corepack && corepack enable
- run: pnpm install
- run: pnpm dev:prepare
- run: pnpm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-component-meta",
"version": "0.10.0",
"version": "0.10.1",
"license": "MIT",
"type": "module",
"repository": {
3 changes: 2 additions & 1 deletion src/cli/generate.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import { join, relative, resolve } from 'pathe'
import pkg from '../../package.json' assert { type: 'json' }
import { loadKit } from './utils/kit'
import { clearBuildDir } from './utils/fs'
import { importModule } from './utils/esm'

const privateKeys = new Set([
'fullPath',
@@ -97,7 +98,7 @@ export const generate = defineCommand({
await clearBuildDir(outputDir)
await buildNuxt(nuxt)

const components = await import(inputSource).then((m: any) => m.default || m)
const components = await importModule(inputSource).then((m: any) => m.default || m)

await Promise.all([
copyFile(inputTypes, outputTypes),
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -239,12 +239,12 @@ export default defineNuxtModule<ModuleOptions>({
addServerHandler({
method: 'get',
route: '/api/component-meta.json',
handler: resolver.resolve('./runtime/server/api/component-meta.get')
handler: resolver.resolve('./runtime/server/api/component-meta.json.get')
})
addServerHandler({
method: 'get',
route: '/api/component-meta/:component?',
handler: resolver.resolve('./runtime/server/api/component-meta.get')
handler: resolver.resolve('./runtime/server/api/component-meta-component.get')
})
}
})
1 change: 1 addition & 0 deletions src/runtime/server/api/component-meta-component.get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as default } from './component-meta.get'
2 changes: 1 addition & 1 deletion src/runtime/server/api/component-meta.get.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export default defineEventHandler((event) => {
// TODO: Replace via downstream config
appendHeader(event, 'Access-Control-Allow-Origin', '*')

const componentName = (event.context.params['component?'] || '').replace(/\.json$/, '')
const componentName = (event.context.params?.['component?'] || '').replace(/\.json$/, '')

if (componentName) {
const meta = components[pascalCase(componentName)]
1 change: 1 addition & 0 deletions src/runtime/server/api/component-meta.json.get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as default } from './component-meta.get'