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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preserve non-common prefix parts #177

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Apr 1, 2021

related #175

Components module, prefixes component name by path until there is a mismatch. For better explanation I've added some examples:

id path current after
1 form/layouts/FormLayout.vue FormLayout FormLayoutsLayout
2 my/form/MyFancyButton.vue MyFancyButton MyFormFancyButton
3 field/number/integer/FieldNumberOfServings.vue NumberIntegerFieldNumberOfServings FieldNumberIntegerOfServings
4 ui/notification/NotificationWrapper.vue UINotificationWrapper UINotificationWrapper

Cases 1-3 are basically bad usages since prefix used in filename does not matches path. Current behavior is fixing this mismatch by respecting file name and new change is fixing mismatch by respecting full path

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #177 (3a8296a) into main (8a541e2) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   85.88%   85.96%   +0.08%     
==========================================
  Files           7        7              
  Lines         170      171       +1     
  Branches       44       44              
==========================================
+ Hits          146      147       +1     
  Misses         24       24              
Impacted Files Coverage Δ
src/scan.ts 98.07% <100.00%> (+0.03%) ⬆️

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 8a541e2...3a8296a. Read the comment docs.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

I like this change.

My one note of caution is that I'm worried the 'skipping' of intermediate path components might confuse people (because they'll need to have a good understanding of how the algorithm works).

I have a slight preference therefore for only omitting consecutive path components because I think that's an easier explanation to make. (#1-3 would be named according to the full path and #4 would remain as-is.)

Having said that, the generated readme.md does likely address my concern.

@pi0
Copy link
Member Author

pi0 commented Apr 7, 2021

My one note of caution is that I'm worried the 'skipping' of intermediate path components might confuse people (because they'll need to have a good understanding of how the algorithm works).

We may emit a warning when a mismatch happens and asking to correct it. Only a short and helpful message is needed for solution.

@Atinux Atinux removed their request for review September 20, 2022 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants