Skip to content

Conversation

@larbish
Copy link
Contributor

@larbish larbish commented Jul 18, 2022

πŸ”— Linked issue

Partial resolution of nuxt/nuxt.com#673

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme) TODO
  • 🐞 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

Merge all configurations at the root in nuxt.config.ts

{ 
  github: {
      owner: 'nuxt-community',
      repo: 'supabase-module',
      branch: 'main',
      releases: { 
          parse: false 
     },
     contributors: {
         max: 10
     }
 }

Becomes:

{ 
  github: {
      owner: 'nuxt-community',
      repo: 'supabase-module',
      branch: 'main',
      parseReleases: false ,
      maxContributors: 10
 }

And to avoid middleware route creation for collaborators or release:

{ 
  github: {
      owner: 'nuxt-community',
      repo: 'supabase-module',
      branch: 'main',
      release: false ,
      contributors: false
 }

This new configuration syntax allow to override the config for all components using the query props:

<GithubRepository v-slot="{ repository }" :query="{ owner: 'nuxt-community', repo: 'supabase-module' }">
    <pre>{{ repository }}</pre>
</GithubRepository>

A new component GithubReadme has also been added:

<GithubReadme v-slot="{ readme }"  :query="{ owner: 'nuxt-community', repo: 'supabase-module' }">
    <ContentRenderer :value="readme" />
</GithubReadme>

πŸ“ Checklist

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

@larbish larbish requested a review from Tahul July 18, 2022 15:43
@larbish larbish force-pushed the feat/override-repo-by-query branch from 3b11b75 to b717b5d Compare July 18, 2022 18:32
Copy link
Contributor

@Tahul Tahul left a comment

Choose a reason for hiding this comment

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

I think I need put some work on components, the reactivity should work properly, and I think we could profit from >rc.5 and try using useAsyncData without ids.

I think there is conflicts when you have more than one component of the same type in a same page.

Other than that I love the features you added, these are great improvements to the GitHub module, maybe we could consider on making it a @nuxtjs module at some point?

@larbish larbish requested a review from Tahul July 19, 2022 10:05
@larbish larbish marked this pull request as ready for review July 19, 2022 10:05
@larbish
Copy link
Contributor Author

larbish commented Jul 19, 2022

TODO:

  • Handle remark-gfm and remark-github to display parsed content

@Tahul
Copy link
Contributor

Tahul commented Jul 20, 2022

TODO:

  • Handle remark-gfm and remark-github to display parsed content

Done in f78fb92

@Tahul
Copy link
Contributor

Tahul commented Jul 20, 2022

@larbish ; needs your review :)

I added missing tasks and cleaned up some parts of the module.

Also updated the docs, that needs review too!

@Tahul
Copy link
Contributor

Tahul commented Jul 20, 2022

@atinux ; what would you think of moving this under nuxt-community ?

This now has a serious lot of different possible usages now and is used in both Docus and Nuxt.com projects :)

@larbish
Copy link
Contributor Author

larbish commented Jul 21, 2022

@Tahul LGTM

Just updated the configuration table of the doc to match our new options in d64901e

@Tahul Tahul merged commit 2099653 into main Jul 21, 2022
@Tahul Tahul deleted the feat/override-repo-by-query branch July 21, 2022 13:17
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.

3 participants