Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt3): extends support for pages/ & middleware/ directories #3783

Merged
merged 9 commits into from
Mar 22, 2022

Conversation

kevinmarrec
Copy link
Contributor

@kevinmarrec kevinmarrec commented Mar 18, 2022

❓ 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

Following up nuxt/nuxt#13367 (extends support progress) this PR allows extending pages/ & middleware/ directories for extended config layers.

  • Extends support for pages directory
  • Extends support for middleware directory
  • Handle overrides
  • Tests

ℹ️ Override behavior

export default {
  extends: ['a', 'b']
}

If they match same name , pages and middlewares defined in a can be overriden by b, and finally by the project itself.

@kevinmarrec kevinmarrec requested a review from pi0 March 18, 2022 15:14
@netlify
Copy link

netlify bot commented Mar 18, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

πŸ”¨ Explore the source changes: 9a5f14b

πŸ” Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/623a0f388ad44d0009d9fb94

@danielroe danielroe added enhancement New feature or request nuxt3 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Mar 21, 2022
@danielroe
Copy link
Member

What do you think about adding some tests for this feature?

@kevinmarrec
Copy link
Contributor Author

@danielroe Yes, I'm planning to add tests for the extends features, I'm gonna write tests for the ones that already have been merged first :)

@kevinmarrec
Copy link
Contributor Author

@pi0 @danielroe Tests have been added for this feature :)

@pi0
Copy link
Member

pi0 commented Mar 22, 2022

Shall we add extends to the same basic fixture? i guess it won't harm or add side-effect to the other tests but saves CI build time.

@pi0 pi0 self-assigned this Mar 22, 2022
@pi0 pi0 merged commit 7c0d2e1 into main Mar 22, 2022
@pi0 pi0 deleted the extends-pages branch March 22, 2022 18:12
@wsaca
Copy link

wsaca commented Mar 24, 2022

I'm not sure if this change is related, but routes are not working correctly, now it only resolves the first folder inside "pages".

@kevinmarrec
Copy link
Contributor Author

@wsaca Can you provide a reproduction repository cause I can't reproduce it. Thanks !

@wsaca
Copy link

wsaca commented Mar 25, 2022

Hi @kevinmarrec, I created a simple example, try to navigate to /apis, /apps or /dbs. Only the first folder is resolved.

@kevinmarrec
Copy link
Contributor Author

Thanks @wsaca , @danielroe created an issue with your reproduction and I'm gonna check this asap

@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x enhancement New feature or request nuxt3 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants