Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 15, 2024

Conversation

danielroe
Copy link
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.

Copy link

stackblitz bot commented May 14, 2024

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

@Atinux
Copy link
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
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
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
Contributor

Rigo-m commented May 15, 2024

Will each layer have it's own tsconfig?

@Atinux
Copy link
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!

@danielroe danielroe merged commit 06be4cc into main May 15, 2024
61 checks passed
@danielroe danielroe deleted the feat/auto-registered-layers branch May 15, 2024 10:51
@github-actions github-actions bot mentioned this pull request May 15, 2024
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.

None yet

4 participants