Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: top level content/ directory in Nuxt 4 compatibility version #2649

Merged
merged 7 commits into from
Jun 19, 2024

Conversation

farnabaz
Copy link
Member

πŸ”— Linked issue

resolves #2635

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Nuxt v4 improved directory structure.
This PR changes the base directory for all content sources from srcDir/ into rootDir/. When you set future.compatibilityVersion = 4 in nuxt.config the module will look for content directory in root Dir instead of app/ directory.

These change does not affect current projects.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

cloudflare-pages bot commented May 31, 2024

Deploying nuxt-content with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: c802ae5
Status:Β βœ…Β  Deploy successful!
Preview URL: https://1dacadf1.nuxt-content-1il.pages.dev
Branch Preview URL: https://feat-top-level-content-dir.nuxt-content-1il.pages.dev

View logs

@farnabaz farnabaz merged commit 3162639 into main Jun 19, 2024
3 checks passed
@farnabaz farnabaz deleted the feat/top-level-content-dir branch June 19, 2024 16:28
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
},
"./transformers": "./dist/runtime/transformers/index.js",
"./transformers/*": "./dist/runtime/transformers/*.js",
"./types": "./dist/runtime/types/index.js",
Copy link

@kingyue737 kingyue737 Jun 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These change does not affect current projects.

@farnabaz I think moving the entry of types is a breaking change.

import type { ParsedContent, NavItem, MarkdownNode } from '@nuxt/content/dist/runtime/types'

does not work any more. Users now need to import directly from @nuxt/content

Projects like @nuxt/ui-pro import many types from '@nuxt/content/dist/runtime/types'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support 'top-level' content/ directory
2 participants