-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: override components and composables (#452)
* feat!: overwrite components and composables * feat: switch api client for cart composables, proper type support and schema overrides * feat(composables): expose `useContext` as public api to help override composables * refactor: new api client in useSalutations Co-authored-by: Maciek Kucmus <[email protected]> * refactor: useListing using new api client types * fix: product card thumbnail * refactor: product listing result * chore: fix linting errors * fix: tests * refactor: useUser using new api client * refactor: useSessionContext * refactor: usenewsletter * refactor: more composables * chore: update tests * refactor: more composables * refactor: more composables - pair programming Co-authored-by: Maciej D <[email protected]> * fix: tests * refactor: fix more types * chore: link to issue * refactor: api errors handling, more types transferred * refactor: remove old api client from dependencies of main template * feat(composables): useNavigationSearch.ts, useWishlist.ts, useLandingSearch.ts (#441) * feat: add useNavigationSearch test * feat: add useWishlist test * feat: add useLandingSearch test * feat: add useLandingSearch test * feat: add defineComponent * feat: add mockImplementation type * feat: add useCmsMeta test * feat(composables): useNavigationSearch.ts, useWishlist.ts, useLandingSearch.ts * refactor: useSetup helper for composables testing and remove old api client dependency from composables package * refactor(nuxt-module): proper setup for new composables structure * feat: proper exporting nuxt layer as separate import * chore: move OPenAPI todos into schema file * chore: move OPenAPI todos into schema file * refactor: use checkout example transformation * chore: error link format * chore: improve build * chore: fix e2e test * chore: add single changeset to fill out later --------- Co-authored-by: Maciek Kucmus <[email protected]> Co-authored-by: mkucmus <[email protected]> Co-authored-by: Maciej D <[email protected]> Co-authored-by: Maciej D <[email protected]>
- Loading branch information
1 parent
0d1cafd
commit e2c225f
Showing
355 changed files
with
7,582 additions
and
4,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@shopware-pwa/nuxt3-module": major | ||
"@shopware-pwa/composables-next": major | ||
"@shopware-pwa/cms-base": major | ||
--- | ||
|
||
Created Nuxt layer for `composables` and `cms-base`. This way overriding any part of that is now possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { fileURLToPath, URL } from 'node:url' | ||
import { fileURLToPath, URL } from "node:url"; | ||
|
||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
import { defineConfig } from "vite"; | ||
import vue from "@vitejs/plugin-vue"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue()], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)) | ||
} | ||
} | ||
}) | ||
"@": fileURLToPath(new URL("./src", import.meta.url)), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "@shopware-pwa/composables-next"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { fileURLToPath, URL } from 'node:url' | ||
import { fileURLToPath, URL } from "node:url"; | ||
|
||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
import { defineConfig } from "vite"; | ||
import vue from "@vitejs/plugin-vue"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue()], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)) | ||
} | ||
} | ||
}) | ||
"@": fileURLToPath(new URL("./src", import.meta.url)), | ||
"#imports": fileURLToPath(new URL("./imports.d.ts", import.meta.url)), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
examples/mollie-credit-card/src/runtime/components/ShopwareFrontendsCreditCard.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "esnext" | ||
"module": "NodeNext", | ||
"moduleResolution": "NodeNext" | ||
}, | ||
"extends": "./playground/.nuxt/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
declare module "#shopware" { | ||
import type { createAPIClient } from "@shopware/api-client"; | ||
import type { | ||
operationPaths as defaultOperationPaths, | ||
operations as defaultOperations, | ||
components as defaultComponents, | ||
} from "@shopware/api-client/api-types"; | ||
import type { | ||
RequestParameters as DefaultRequestParameters, | ||
RequestReturnType as DefaultRequestReturnType, | ||
} from "@shopware/api-client"; | ||
|
||
type changedComponents = defaultComponents; | ||
// example how to extend Cart schema: | ||
// type changedComponents = components & { | ||
// schemas: { | ||
// Cart: defaultComponents["schemas"]["Cart"] & { | ||
// myspecialfield: "hello field"; | ||
// }; | ||
// }; | ||
// }; | ||
|
||
export type operations = defaultOperations<changedComponents>; | ||
export type operationPaths = defaultOperationPaths; | ||
export type Schemas = changedComponents["schemas"]; | ||
|
||
// we're exporting our own Api Client definition as it depends on our own instance | ||
export type ApiClient = ReturnType< | ||
typeof createAPIClient<operations, operationPaths> | ||
>; | ||
export type RequestParameters<T extends keyof operations> = | ||
DefaultRequestParameters<T, operations>; | ||
|
||
export type RequestReturnType<T extends keyof operations> = | ||
DefaultRequestReturnType<T, operations>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
{ | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"include": ["src/**/*"], | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"paths": { | ||
"@/*": [ | ||
"./src/*" // set path `@/*` as alias of `src/*` | ||
] | ||
}, | ||
"esModuleInterop": true, | ||
"lib": [ | ||
"esnext", | ||
"DOM" | ||
], | ||
"types": [ | ||
"vite/client" | ||
] | ||
"lib": ["esnext", "DOM"], | ||
"types": ["vite/client"] | ||
} | ||
} | ||
} |
Oops, something went wrong.
e2c225f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
frontends-demo – ./templates/vue-demo-store
frontends-demo-git-main-shopware-frontends.vercel.app
frontends-demo-shopware-frontends.vercel.app
frontends-demo.vercel.app
e2c225f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
shopware-frontends-docs – ./apps/docs/
shopware-frontends-docs-shopware-frontends.vercel.app
shopware-frontends-docs-git-main-shopware-frontends.vercel.app
shopware-frontends-docs.vercel.app
frontends.shopware.com
e2c225f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change actually broke the build of the vue demo store (due to broken imports).
Local build:
StackBlitz build: