fix(nuxt): split component name case in each segment (#24318)

This commit is contained in:
Daniel Roe 2023-11-15 21:52:56 +00:00 committed by GitHub
parent 8af10e459f
commit 13a6ab3d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 16 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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) {

View File

@ -184,8 +184,8 @@ importers:
specifier: ^1.0.3
version: 1.0.3
scule:
specifier: ^1.0.0
version: 1.0.0
specifier: ^1.1.0
version: 1.1.0
semver:
specifier: ^7.5.4
version: 7.5.4
@ -353,8 +353,8 @@ importers:
specifier: ^1.1.0
version: 1.1.0
scule:
specifier: ^1.0.0
version: 1.0.0
specifier: ^1.1.0
version: 1.1.0
std-env:
specifier: ^3.5.0
version: 3.5.0
@ -1917,7 +1917,7 @@ packages:
perfect-debounce: 1.0.0
pkg-types: 1.0.3
rc9: 2.1.1
scule: 1.0.0
scule: 1.1.0
semver: 7.5.4
simple-git: 3.20.0
sirv: 2.0.3
@ -2799,7 +2799,7 @@ packages:
vite: 4.5.0
vue: 3.3.8
dependencies:
vite: 4.5.0(@types/node@20.8.10)
vite: 4.5.0(@types/node@20.9.0)
vue: 3.3.8(typescript@5.2.2)
/@vitest/coverage-v8@0.33.0(vitest@0.33.0):
@ -6738,7 +6738,7 @@ packages:
radix3: 1.1.0
rollup: 3.29.4
rollup-plugin-visualizer: 5.9.2(rollup@3.29.4)
scule: 1.0.0
scule: 1.1.0
semver: 7.5.4
serve-placeholder: 2.0.1
serve-static: 1.15.0
@ -8194,9 +8194,6 @@ packages:
ajv-formats: 2.1.1(ajv@8.12.0)
ajv-keywords: 5.1.0(ajv@8.12.0)
/scule@1.0.0:
resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==}
/scule@1.1.0:
resolution: {integrity: sha512-vRUjqhyM/YWYzT+jsMk6tnl3NkY4A4soJ8uyh3O6Um+JXEQL9ozUCe7pqrxn3CSKokw0hw3nFStfskzpgYwR0g==}
@ -8922,7 +8919,7 @@ packages:
pretty-bytes: 6.1.1
rollup: 3.29.4
rollup-plugin-dts: 6.1.0(rollup@3.29.4)(typescript@5.2.2)
scule: 1.0.0
scule: 1.1.0
typescript: 5.2.2
untyped: 1.4.0
transitivePeerDependencies:
@ -9021,7 +9018,7 @@ packages:
local-pkg: 0.4.3
mlly: 1.4.2
pathe: 1.1.1
scule: 1.0.0
scule: 1.1.0
unplugin: 1.5.0
vue-router: 4.2.5(vue@3.3.8)
yaml: 2.3.3
@ -9112,7 +9109,7 @@ packages:
defu: 6.1.3
jiti: 1.21.0
mri: 1.2.0
scule: 1.0.0
scule: 1.1.0
transitivePeerDependencies:
- supports-color