Nuxt.Options & Nuxt.Utils – are the docs outdated or am I missing something?

HerrBertling
0
HerrBertling
commented 15 days ago

Hey! I'm new in a project that uses (well, tries to use) Options and Utils from nuxt. The docs say that both would be available as far as I understand: https://nuxtjs.org/api/internals – but that's not really the case, see this as an explanation: https://github.com/sumcumo/nuxt-styleguide/issues/16

My guess is that the nuxt-styleguide tries to use internal APIs that were not stable and thus were changed at some point for [email protected].

What I'm wondering about: Apparently, neither Options.from(…) nor Utils.fatalError are valid APIs (anymore? It must have worked at some point…).

Is there any documentation about what would be possible with Options and Utils and how to use them?
If not: Is there any way I could find out about these APIs and help document them?
And if I wanted to throw that fatalError or merge some options with the ones already present, how would I do that?

Thanks for any help :)

0
HerrBertling
0
HerrBertling
commented 15 days ago

For the fatal error logging, I'd probably use consola, right? Just want to make sure: That's not in some way exposed via a nuxt package? I'd be fine with adding it as a dependency :)

0
HerrBertling
0
HerrBertling
commented 15 days ago

Well, I solved this for "my" project: https://github.com/sumcumo/nuxt-styleguide/pull/19

Still think it would be very useful to have some kind of documentation about Utils and Options (if they are usable at all) that goes beyond what is in the docs right now.

0
Atinux
21.0k
Atinux
commented 15 days ago

Hi @HerrBertling

Thank you, we need to update the documentation on this part. A PR would be more than welcome honestly :)

1
HerrBertling
0
HerrBertling
commented 14 days ago

I would prepare something – if only I knew what to put there 😆 I got undefined for importing both Options and Utils, so my first step would be to remove traces of both in the internal API docs. Would that be something?

0
Informations
QuestionUnresolved
#c150 - Created 15 days ago