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

non common part of path prefix is omitted #175

Open
Decipher opened this issue Mar 31, 2021 · 5 comments
Open

non common part of path prefix is omitted #175

Decipher opened this issue Mar 31, 2021 · 5 comments

Comments

@Decipher
Copy link

Decipher commented Mar 31, 2021

Describe the bug
Some components are being incorrectly named:

- `<DruxtFieldNumberOfServings>` | `<druxt-field-number-of-servings>` (components/druxt/field/number/integer/FieldNumberOfServings.vue)

To Reproduce
Steps to reproduce the behaviour:

  1. Clone repository: git clone https://github.com/druxt/demo.druxtjs.org.git
  2. Move components/druxt/field/NumberIntegerFieldNumberOfServings.vue to components/druxt/field/number/integer/FieldNumberOfServings.vue
  3. Run 'npm run build`
  4. See .nuxt/components/readme.md

Expected behaviour
The file located at components/druxt/field/number/integer/FieldNumberOfServings.vue should be named DruxtFieldNumberIntegerFieldNumberOfServings

Screenshots
N/A

Additional context
A few of my components for comparison.

- `<DruxtViewRecipesPage1>` | `<druxt-view-recipes-page1>` (components/druxt/view/recipes/Page1.vue)
- `<DruxtFieldBooleanCheckboxForm>` | `<druxt-field-boolean-checkbox-form>` (components/druxt/field/boolean/checkbox/Form.vue)
- `<DruxtFieldImageImageForm>` | `<druxt-field-image-image-form>` (components/druxt/field/image/image/Form.vue)
- `<DruxtFieldRecipeCategory>` | `<druxt-field-recipe-category>` (components/druxt/field/entity-reference/label/FieldRecipeCategory.vue)
- `<DruxtFieldTags>` | `<druxt-field-tags>` (components/druxt/field/entity-reference/label/FieldTags.vue)
- `<DruxtFieldCookingTime>` | `<druxt-field-cooking-time>` (components/druxt/field/number/integer/FieldCookingTime.vue)
- `<DruxtFieldNumberOfServings>` | `<druxt-field-number-of-servings>` (components/druxt/field/number/integer/FieldNumberOfServings.vue)
- `<DruxtFieldMediaLibraryWidgetForm>` | `<druxt-field-media-library-widget-form>` (components/druxt/field/media-library/widget/Form.vue)
- `<DruxtFieldOptionsSelectForm>` | `<druxt-field-options-select-form>` (components/druxt/field/options/select/Form.vue)
- `<DruxtEntityFormNodeRecipeDefault>` | `<druxt-entity-form-node-recipe-default>` (components/druxt/entity/form/node/recipe/Default.vue)
- `<DruxtFieldEntityReferenceAutocompleteTagsForm>` | `<druxt-field-entity-reference-autocomplete-tags-form>` (components/druxt/field/entity-reference/autocomplete/tags/Form.vue)

Note that number/integer appears to be a potential lead.

@pi0 pi0 changed the title Incorrectly named components. non common part of path prefix is omitted Mar 31, 2021
@pi0
Copy link
Member

pi0 commented Mar 31, 2021

Just to clarify, your expected behavior for components/druxt/field/number/integer/FieldNumberOfServings.vue is to be named DruxtFieldNumberIntegerOfServings right?

@Decipher
Copy link
Author

Yes, correct. I also fixed the typo.

@pi0
Copy link
Member

pi0 commented Apr 1, 2021

From your edited comment, seems expected is DruxtFieldNumberIntegerFieldNumberOfServings (adding full path as prefix regardless). But it is not how prefixing works. We remove common part as duplicate so components/Foo/Bar/FooBarBaz.vue will be FooBarBaz and not FooBarFooBarBaz). For #175 (comment), I've made proposal PR #177

@juventus18
Copy link

I had a similar problem. The component was located at /components/tile-display/TileViewer.vue and the component was actually named TileDisplayTileViewer, but when the component tag was generated it came out as <tile-viewer. I think the autoload module should either not remove common parts or at least explain how it works in the docs. Took me a while to figure out why my component could not be found.

@Decipher
Copy link
Author

This is still very much on my radar, I will try to test out the PR next week.

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

No branches or pull requests

3 participants