Skip to content

feat(nuxt): auto-register layers in layers/ directory#27221

Merged
danielroe merged 2 commits intomainfrom
feat/auto-registered-layers
May 15, 2024
Merged

feat(nuxt): auto-register layers in layers/ directory#27221
danielroe merged 2 commits intomainfrom
feat/auto-registered-layers

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented May 14, 2024

🔗 Linked issue

follow up on #26444

📚 Description

This auto-registers layers located in a top-level ~~/layers directory. To avoid collisions with user layer configuration, it adds a new internal _extends key to nuxt options, and then instructs c12 to read from that. This seems like a more straightforward/correct way than attempting to add an auto-registration feature to c12 itself.

Would love your thoughts particularly @pi0 with regard to c12 approach.

@danielroe danielroe requested review from atinux and pi0 May 14, 2024 17:39
@danielroe danielroe self-assigned this May 14, 2024
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@atinux
Copy link
Copy Markdown
Member

atinux commented May 14, 2024

Seems good to me at first sight.

I would maybe named it _layers to be similar to the layers directory for consistency.

@pi0
Copy link
Copy Markdown
Member

pi0 commented May 14, 2024

  • This looks like a good approach in Nuxt to try
  • I like the idea of _layers @atinux mentioned it also marks it better for me as not-namespaced layers and might even eventually become standard for c12 and nitro

@danielroe
Copy link
Copy Markdown
Member Author

danielroe commented May 15, 2024

._layers is already used internally for all resolved layers, so unfortunately I felt we had to avoid it.

It should be fine as we are not exposing this or even allowing users to provide their own config, so it's purely internal within this file.

@Rigo-m
Copy link
Copy Markdown
Contributor

Rigo-m commented May 15, 2024

Will each layer have it's own tsconfig?

@atinux
Copy link
Copy Markdown
Member

atinux commented May 15, 2024

._layers is already used internally for all resolved layers, so unfortunately I felt we had to avoid it.

It should be fine as we are not exposing this or even allowing users to provide their own config, so it's purely internal within this file.

Damn, then it's good for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants