diff --git a/packages/_vue3-migration-test/src/App.vue b/packages/_vue3-migration-test/src/App.vue index dadc1fe5ac..4ad6d095f0 100644 --- a/packages/_vue3-migration-test/src/App.vue +++ b/packages/_vue3-migration-test/src/App.vue @@ -12,7 +12,16 @@ - + diff --git a/packages/_vue3-migration-test/src/main.ts b/packages/_vue3-migration-test/src/main.ts index fe773026db..9bf1d29a16 100644 --- a/packages/_vue3-migration-test/src/main.ts +++ b/packages/_vue3-migration-test/src/main.ts @@ -1,16 +1,16 @@ import { QuerySuggestionsRequest, XComponentsAdapter } from '@empathyco/x-types'; import { Component, configureCompat, createApp } from 'vue'; import { createStore } from 'vuex'; +import { platformAdapter } from '../../x-adapter-platform/src/platform.adapter'; import { getRelatedTagsStub } from '../../x-components/src/__stubs__/related-tags-stubs.factory'; import { getQuerySuggestionsStub } from '../../x-components/src/__stubs__/query-suggestions-stubs.factory'; import { createResultStub, - getBannersStub, getNextQueriesStub, - getPromotedsStub, getResultsStub } from '../../x-components/src/__stubs__/index'; import { XInstaller } from '../../x-components/src/x-installer/x-installer/x-installer'; +import { baseSnippetConfig } from '../../x-components/src/views/base-config'; import App from './App.vue'; import router from './router'; import { @@ -45,6 +45,7 @@ if (VUE_COMPAT_MODE === 2) { } const adapter = { + ...platformAdapter, relatedTags: () => new Promise(resolve => { resolve({ relatedTags: getRelatedTagsStub(10) }); @@ -69,15 +70,6 @@ const adapter = { ] }); }), - search: () => - new Promise(resolve => { - resolve({ - results: getResultsStub(10), - totalResults: 50, - promoteds: getPromotedsStub(), - banners: getBannersStub() - }); - }), identifierResults: () => new Promise(resolve => resolve({ results: ['123A', '123B', '123C', '123D'].map(id => createResultStub(id)) }) @@ -91,10 +83,8 @@ createApp(App as Component) .use(store) .mount('#app'); -window.initX = { - instance: 'empathy', - lang: 'en' -}; +window.initX = baseSnippetConfig; + new XInstaller({ adapter, store, diff --git a/packages/_vue3-migration-test/src/router.ts b/packages/_vue3-migration-test/src/router.ts index e9a253de77..f6f4ad423b 100644 --- a/packages/_vue3-migration-test/src/router.ts +++ b/packages/_vue3-migration-test/src/router.ts @@ -41,10 +41,16 @@ import { TestPopularSearches, TestNextQueries, TestIdentifierResults, - TestExtraParams + TestExtraParams, + TestSearch } from './'; const routes = [ + { + path: '/', + name: 'Home', + component: TestSearch + }, { path: '/animate-width', name: 'AnimateWidth', diff --git a/packages/_vue3-migration-test/vite.config.ts b/packages/_vue3-migration-test/vite.config.ts index bb5c4cb64d..9069da3405 100644 --- a/packages/_vue3-migration-test/vite.config.ts +++ b/packages/_vue3-migration-test/vite.config.ts @@ -33,7 +33,7 @@ export default defineConfig(({ mode }) => { } }, optimizeDeps: { - exclude: ['@empathyco/x-components'] + exclude: ['@empathyco/x-components', '@empathyco/x-adapter-platform'] } }; });