Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nuxtPublic

fix(kit): normalize layer directory paths with trailing slashes to support dotted folder names#33858

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
danielroe merged 1 commit intonuxt:mainfromrywils:dotted-layer-directories
Dec 12, 2025

Conversation

@rywils
Copy link
Contributor

@rywilsrywils commentedDec 12, 2025
edited by danielroe
Loading

🔗 Linked issue

resolves#33855

🐞 Can't import variables from ordered layers in nuxt config#33855

Nuxt’s auto layer discovery strips the trailing slash from layers/* results.
When a layer folder contains a dot (e.g. 01.base), the resolver interprets it as a file extension instead of a directory and throws:

Cannot find module 'layers/01.base'

The change makes Nuxt always keep a trailing slash on auto-detected layer paths, so dotted folders are consistently handled as directories. Fairly simple, straight forward fix.

Cheers!

danielroe reacted with heart emoji
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz CodeflowRun & review this pull request inStackBlitz Codeflow.

@pkg-pr-new
Copy link

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33858

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@33858

nuxt

npm i https://pkg.pr.new/nuxt@33858

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33858

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33858

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33858

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33858

commit:21a5c0c

@coderabbitai
Copy link

coderabbitaibot commentedDec 12, 2025
edited
Loading

Walkthrough

This pull request modifies the loader configuration inpackages/kit/src/loader/config.ts to adjust trailing slash handling for local layers. The change replaces a single import from ufo with bothwithTrailingSlash andwithoutTrailingSlash utilities. The normalisation oflocalLayers switches from removing trailing slashes to explicitly enforcing them viawithTrailingSlash. Conversely, the construction oflocalRelativePaths now removes trailing slashes fromlocalLayers usingwithoutTrailingSlash, reversing the previous path comparison logic. No public API signatures are affected.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.You can run@coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and concisely summarizes the main change: normalizing layer directory paths with trailing slashes to support dotted folder names, which directly matches the changeset's core objective.
Description check✅ PassedThe pull request description clearly relates to the changeset, explaining the fix for layer directory path normalization with trailing slashes to support dotted folder names.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

✨ Issue Enrichment is now available for GitHub issues!

CodeRabbit can now help you manage issues more effectively:

  • Duplicate Detection — Identify similar or duplicate issues
  • Related Issues & PRs — Find relevant issues and PR's from your repository
  • Suggested Assignees — Find the best person to work on the issue
  • Implementation Planning — Generate detailed coding plans for engineers and agents
Disable automatic issue enrichment

To disable automatic issue enrichment, add the following to your.coderabbit.yaml:

issue_enrichment:auto_enrich:enabled:false

Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment@coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link

CodSpeed Performance Report

Merging#33858 willimprove performances by 12.17%

Comparingrywils:dotted-layer-directories (21a5c0c) withmain (c1b3590)1

Summary

⚡ 1 improvement
✅ 9 untouched

Benchmarks breakdown

BenchmarkBASEHEADChange
writeTypes in the basic-types fixture90.5 ms80.7 ms+12.17%

Footnotes

  1. No successful run was found onmain (672880b) during the generation of this report, soc1b3590 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jd-solanki
Copy link
Contributor

I'm not sure about tests but is it possible to have test case for numbered layers directories?

Copy link
Member

@danielroedanielroe left a comment

Choose a reason for hiding this comment

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

nice! thank you ❤️

jd-solanki reacted with heart emoji
@danielroedanielroe merged commit7d50229 intonuxt:mainDec 12, 2025
57 checks passed
@github-actionsgithub-actionsbot mentioned this pull requestDec 12, 2025
@jd-solanki
Copy link
Contributor

Hey@danielroe

Is it possible to change order of layers viaextends so we don't have to rename directories when we want to add new layer which required to be placed between existing layers.

Benefits:

  • When using template repo it doesn't break pull updates
  • When checking repo history it doesn't confuse

I would love to have this feature, Should I raise a feature request for this?

@danielroe
Copy link
Member

unfortunately that's not possible with local layers.

if you want that, move them out of thelayers directory and register them withextends instead. we can't mix + match.

jd-solanki reacted with thumbs up emojijd-solanki reacted with confused emoji

@rywilsrywils deleted the dotted-layer-directories branchDecember 13, 2025 23:36
This was referencedDec 15, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@danielroedanielroedanielroe approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

🐞 Can't import variables from ordered layers in nuxt config

3 participants

@rywils@jd-solanki@danielroe

[8]ページ先頭

©2009-2025 Movatter.jp