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

feat: re-export MtSearch in dist #248

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/clever-swans-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@shopware-ag/meteor-component-library": patch
"nuxt-app": patch
---

Re-export mt-search and reuse it in nuxt-app example
Copy link
Contributor

Choose a reason for hiding this comment

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

Please only include what's relevant for users of the component library. They just care about the mt-search component but not wether the component is used inside the nuxt example app.

3 changes: 3 additions & 0 deletions examples/nuxt-app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
</MtText>

<SwTextField label="A text field" v-model="text" />

<MtSearch />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think just making the mt-search component public is enough. We don't need to use every single component in the nuxt example app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mt-search does depend on the $t which is provided here. Though this isn't correct solution (using correct Vue/Nuxt i18n library would be the right approach), we do have an "example app" where we can show that the component actually depends on the i18n library.

</SwBlockStack>

<MtModalRoot>
Expand Down Expand Up @@ -261,6 +263,7 @@ import {
MtModalClose,
MtModalTrigger,
MtModalAction,
MtSearch,
MtText,
} from "@shopware-ag/meteor-component-library";
import SwBlockStack from "./components/sw-block-stack.vue";
Expand Down
4 changes: 4 additions & 0 deletions examples/nuxt-app/plugins/t.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default defineNuxtPlugin((nuxtApp) => {
// nuxtApp.$i18n
nuxtApp.provide('t', (a) => a)
})
2 changes: 2 additions & 0 deletions packages/component-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import MtExternalLink from "./components/form/mt-external-link/mt-external-link.
import MtLink from "./components/navigation/mt-link/mt-link.vue";
import MtNumberField from "./components/form/mt-number-field/mt-number-field.vue";
import MtPasswordField from "./components/form/mt-password-field/mt-password-field.vue";
import MtSearch from "@/components/navigation/mt-search/mt-search.vue";
import MtSelect from "./components/form/mt-select/mt-select.vue";
import MtSlider from "@/components/form/mt-slider/mt-slider.vue";
import MtSwitch from "./components/form/mt-switch/mt-switch.vue";
Expand Down Expand Up @@ -58,6 +59,7 @@ export {
MtLink,
MtNumberField,
MtPasswordField,
MtSearch,
MtSelect,
MtSlider,
MtSwitch,
Expand Down
Loading