nuxt / components

Scan and auto import components for Nuxt.js 2.13+
MIT License
884 stars 48 forks source link

feat: remove numeric prefix from component names #222

Closed pi0 closed 3 years ago

pi0 commented 3 years ago

Context: #218, https://github.com/nuxt/components/pull/218#issuecomment-896249659

This feature allows adding prefixes to the directory or component names for easier sorting in the filesystem (base/a.vue => 1-base/1.a.vue). Until now such prefix was causing an error, it is a non-breaking change.


Point by @AMoreaux (https://github.com/nuxt/components/pull/218#issuecomment-896669394):

risk with this is a use case with two folders named: 01.atoms and 02.atoms. The object keys can't have the same name. We could use a revision number for each component, but I can't evaluate the side effect of this change.

This is not an intended use of structure. In such case, we show a warning about name conflict but users should either do:

Using numbers is also not valid for both Javascript/ESM identifiers and HTML tags

codecov[bot] commented 3 years ago

Codecov Report

Merging #222 (0b0a762) into main (2917fc3) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #222   +/-   ##
=======================================
  Coverage   86.28%   86.28%           
=======================================
  Files           7        7           
  Lines         175      175           
  Branches       48       48           
=======================================
  Hits          151      151           
  Misses         24       24           
Impacted Files Coverage Δ
src/scan.ts 98.18% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2917fc3...0b0a762. Read the comment docs.