-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): migrate product detail page example to nuxt (#1318)
- Loading branch information
Showing
18 changed files
with
123 additions
and
261 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,2 @@ | ||
NUXT_PUBLIC_SHOPWARE_ENDPOINT="https://demo-frontends.shopware.store" | ||
NUXT_PUBLIC_SHOPWARE_ACCESS_TOKEN="SWSCBHFSNTVMAWNZDNFKSHLAYW" |
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,28 +1,8 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
*.log* | ||
.nuxt | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,26 +1,32 @@ | ||
# Blank playground | ||
# Product detail page example | ||
|
||
This example should help get you started developing [Shopware Frontends](https://github.com/shopware/frontends). | ||
![Shopware Frontends](./public/shopware-frontends-logo.png) | ||
|
||
## Customization | ||
This repository shows an example of application built using Shopware Frontends Framework on Nuxt 3. | ||
|
||
- edit [./src/App.vue](./src/App.vue) in order to change the current example | ||
- edit [./src/main.js](./src/main.js) in order to adjust Shopware Frontends plugin | ||
## What's inside | ||
|
||
## Project Setup | ||
- Nuxt 3 application | ||
- Required libraries installed (api-client, composables, nuxt3-module) | ||
- Minimum configuration of Nuxt 3 module | ||
|
||
```sh | ||
npm install | ||
``` | ||
## Requirements | ||
|
||
### Compile and Hot-Reload for Development | ||
Go to [Documentation > Requirements](https://frontends.shopware.com/framework/requirements.html) to see the details. | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
## Set up your Shopware 6 instance | ||
|
||
### Compile and Minify for Production | ||
In order to have a different API connected to the app, rename `.env.dist` file to `.env` and change the API access information. Then rerun the application. | ||
|
||
```sh | ||
npm run build | ||
``` | ||
## Customize | ||
|
||
Now, you are free to use the `@shopware-pwa/composables-next` package in the application. You can start from [app.vue](./app.vue). | ||
|
||
## Install & Run | ||
|
||
1. `pnpm i` to install deps | ||
2. `pnpm dev` to run the project in dev mode | ||
|
||
## Try it online | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/shopware/frontends/tree/main/templates/vue-blank) |
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
6 changes: 0 additions & 6 deletions
6
...etail-page/src/components/ProductCard.vue → ...ct-detail-page/components/ProductCard.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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
// https://v3.nuxtjs.org/api/configuration/nuxt.config | ||
export default defineNuxtConfig({ | ||
extends: ["@shopware-pwa/composables-next/nuxt-layer"], | ||
shopware: { | ||
endpoint: "https://demo-frontends.shopware.store/store-api/", | ||
accessToken: "SWSCBHFSNTVMAWNZDNFKSHLAYW", | ||
}, | ||
modules: ["@shopware-pwa/nuxt3-module"], | ||
/** | ||
* Commented because of the StackBlitz error | ||
* Issue: https://github.com/shopware/frontends/issues/88 | ||
*/ | ||
typescript: { | ||
// typeCheck: true, | ||
strict: true, | ||
}, | ||
telemetry: false, | ||
app: { | ||
head: { | ||
script: [{ src: "https://cdn.tailwindcss.com" }], | ||
}, | ||
}, | ||
}); |
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,25 +1,25 @@ | ||
{ | ||
"name": "example-product-detail-page", | ||
"version": "0.0.0", | ||
"name": "product-detail-page-example", | ||
"version": "0.1.0", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"lint": "vue-tsc --noEmit", | ||
"preview": "vite preview" | ||
"build": "nuxt prepare && nuxt build", | ||
"dev": "nuxt prepare && nuxt dev", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview" | ||
}, | ||
"dependencies": { | ||
"devDependencies": { | ||
"@shopware-pwa/composables-next": "canary", | ||
"@shopware-pwa/helpers-next": "canary", | ||
"@shopware-pwa/nuxt3-module": "canary", | ||
"@shopware/api-client": "canary", | ||
"js-cookie": "3.0.5", | ||
"vue": "3.5.6" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "20.14.10", | ||
"@vitejs/plugin-vue": "5.1.4", | ||
"vite": "5.4.6", | ||
"@vueuse/nuxt": "11.1.0", | ||
"nuxt": "3.13.2", | ||
"typescript": "5.5.4", | ||
"vue": "3.5.6", | ||
"vue-tsc": "2.1.6" | ||
}, | ||
"engines": { | ||
"node": "^18.17.x || ^20.x" | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,34 +1,9 @@ | ||
{ | ||
// https://v3.nuxtjs.org/concepts/typescript | ||
"extends": "./.nuxt/tsconfig.json", | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ESNext", "DOM", "DOM.Iterable"], | ||
"types": ["vite/client", "./env.d.ts"], | ||
"skipLibCheck": false, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
|
||
/* Shopware config */ | ||
"paths": { | ||
"#imports": ["./imports.d.ts"], | ||
"#shopware": ["./shopware.d.ts"], | ||
"@/*": ["./src/*"], | ||
"@components/*": ["./src/components/*"] | ||
}, | ||
"rootDir": "." | ||
}, | ||
"include": ["src/**/*", "./shopware.d.ts", "./imports.d.ts"] | ||
"#shopware": ["./shopware.d.ts"] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.