Skip to content

Commit

Permalink
fix(nuxt): split component name case in each segment (#24318)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 15, 2023
1 parent 8af10e4 commit 13a6ab3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/kit/package.json
Expand Up @@ -38,7 +38,7 @@
"mlly": "^1.4.2",
"pathe": "^1.1.1",
"pkg-types": "^1.0.3",
"scule": "^1.0.0",
"scule": "^1.1.0",
"semver": "^7.5.4",
"ufo": "^1.3.1",
"unctx": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/package.json
Expand Up @@ -97,7 +97,7 @@
"perfect-debounce": "^1.0.0",
"pkg-types": "^1.0.3",
"radix3": "^1.1.0",
"scule": "^1.0.0",
"scule": "^1.1.0",
"std-env": "^3.5.0",
"strip-literal": "^1.3.0",
"ufo": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/utils/names.ts
Expand Up @@ -24,7 +24,7 @@ export function resolveComponentNameSegments (fileName: string, prefixParts: str
*/
const fileNameParts = splitByCase(fileName)
const fileNamePartsContent = fileNameParts.join('/').toLowerCase()
const componentNameParts: string[] = [...prefixParts]
const componentNameParts: string[] = prefixParts.flatMap(p => splitByCase(p))
let index = prefixParts.length - 1
const matchedSuffix: string[] = []
while (index >= 0) {
Expand Down
23 changes: 10 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13a6ab3

Please sign in to comment.