analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.48k stars 234 forks source link

Update nitropack version #1084

Open geromegrignon opened 3 months ago

geromegrignon commented 3 months ago

Which scope/s are relevant/related to the feature request?

vite-plugin-nitro

Information

@analog/platformdepends on 2.6.0 nitropack version. Updating to the latest version would allow, among other things, to explore experimental support to websotckets and built-in swagger UI and openapi auto-generated definition.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

nckirik commented 3 months ago

looking forward to this. if needed I can also work on this.

brandonroberts commented 3 months ago

Sounds good. Shouldn't be a breaking change

geromegrignon commented 3 months ago

Hi @nckirik feel free to contribute if you want to :)

nckirik commented 3 months ago

It seems we'll need to wait for nitropack@2.10.0 to be released. Especially for the openAPI "root" configuration. Currently, it is only available in nitro's nightly channel. As @brandonroberts mentioned before, all other config options correctly reflect directly from Nitro's NitroConfig type.

Nitro's config documentation regarding these experimental options appears somewhat misleading, in my opinion.

Initially when we were discussing this with @geromegrignon, I assumed a syntax similar to the following for configuring openAPI within Nitro's config.

        nitro: {
          ...
          experimental: {
            openAPI: {
              meta: {
                title: 'My Awesome Project',
                description: 'This might become the next big thing.',
                version: '1.0'
              }
            }
            ...
          }
          ...
        }

However, it turns out this assumption was incorrect. In reality, openAPI config should be a boolean to enable the experimental feature and a separate root config object to configure it, like so:

        nitro: {
          experimental: {
            openAPI: true,
          },
          openAPI: {
            meta: {
              title: 'My Awesome Project',
              description: 'This might become the next big thing.',
              version: '1.0',
            },
          },
        },

And since this openAPI root configuration is only available in the nightly build, I think there is nothing to do for now.

geromegrignon commented 3 months ago

Thanks for the feedback. I assumed about the same for openapi 😅