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

Migrate to top-level /content directory #86

Merged
merged 4 commits into from
Oct 6, 2024
Merged

Migrate to top-level /content directory #86

merged 4 commits into from
Oct 6, 2024

Conversation

JakeIsMeh
Copy link
Contributor

package-lock.json should be regenerated as package.json was modified and playground dependencies might have to be upgraded, which I am leaving to you. (the branch is open for maintainers to edit)

(Side note: I used pnpm as I encountered many issues with npm while trying to set up the dev environment for this repo.)

closes: #85

@arkhaiel
Copy link

arkhaiel commented Sep 6, 2024

Thanks for this PR ❤️
Poke @davestewart, if this PR solve the problem with nuxt 4 could you merge please it ?
Thanks a lot !

@davestewart
Copy link
Owner

Sorry, been slammed with work but looking to take some time to catch up on oss so will take a look over the weekend 👍

@davestewart davestewart self-requested a review September 7, 2024 13:15
@arkhaiel
Copy link

Hi, is everything ready for a merge ?
@davestewart shall we look for deeper changes to help you with this one ?

Thanks !

Copy link
Owner

@davestewart davestewart left a comment

Choose a reason for hiding this comment

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

All good, and thanks for waiting for me to get to this!

@davestewart davestewart merged commit 26c42eb into davestewart:main Oct 6, 2024
davestewart added a commit that referenced this pull request Oct 6, 2024
* Migrate to top-level `/content` directory

* Migrate playground to Nuxt 4 directory structure

* Use `^` instead of `>=` for version range

* Bump version

---------

Co-authored-by: Dave Stewart <[email protected]>
@davestewart
Copy link
Owner

Hey @JakeIsMeh ...

So I merged your code but have since found out that the playground doesn't work at all.

I've renamed app/app.vue to app/index.vue which allows the site to run, but none of the images are getting served.

It's been so long since I looked at the code I'm not 100% sure myself what isn't working.

I'm not going to publish anything to NPM until I can be sure what's going on.

I'm away on holiday right now, but would like to get this over the line seeing as we've started!

@JakeIsMeh
Copy link
Contributor Author

JakeIsMeh commented Oct 6, 2024

Hey @davestewart,

I had a gander at this and want to say that none of the module's code has rotted, but rather, this was a series of unfortunate events.

I'm not sure which issues you ran into specifically but I did encounter some issues when setting up the playground to test again.

  • Missing dependencies (npm being bad as usual)

    • Used pnpm instead (do not migrate the lockfile (i.e. run pnpm i while package-lock.json still exists), instead delete package-lock.json and let pnpm use it's more robust resolution algorithm to generate a fresh lockfile)
  • Nuxt entry could not resolve the ipx package

    • For some reason, the generated nuxt entry file is looking for ipx in the flat directory rather than using the full pnpm path import (file://path/to/proj/node_modules/.pnpm/[email protected]/index.js)
    • You could use --shamefully-hoist when installing the playground, I opted to just add ipx to the playground's devDeps
  • NuxtImage.ts proxy component fails to import nuxt-img.mjs

    • From @nuxt/[email protected] onwards, the runtime components aren't compiled into js anymore, but rather distributed as the raw Vue component
    • Updated the import
    • We should probably update the minimum version specified in package.json too

Afterwards, the playground works just fine.

I've uploaded the repo here for reference:
https://github.com/JakeIsMeh/nuxt-content-assets/tree/debugging

Cheers

@JakeIsMeh
Copy link
Contributor Author

JakeIsMeh commented Oct 7, 2024

Quick update: with further testing, the only issues I could find are:

  • During SSG (nuxi generate), linked JSON data (JSON.json in the playground) will cause the build to fail due to the crawler trying to pre-render it but it 404s (intended behaviour, see Prevent supported content file types being copied to public #79)
  • Sometimes building will fail due to missing files (that were supposed to copied by nuxt-content-assets). Running nuxi cleanup allows projects to build but after a while it happens again. Currently unsure of how to reproduce it.

@davestewart
Copy link
Owner

Do you think this is a Nuxt 4 issue?

@JakeIsMeh
Copy link
Contributor Author

Hi @davestewart, quick update, I've opened an issue for the build failure (#88).

As for the linked json data issue, I'm not sure if it ever worked with SSG as I didn't utilize it, but it seems like either a pre-existing bug, or if it did used to work during SSG, one caused by changes to the internals of @nuxt/content.

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.

File scanner does not work with Content v2.13+ (Nuxt 4 directory structure)
3 participants