Skip to content

Commit

Permalink
chore: release 1.0.0-rc.4.1 (#203)
Browse files Browse the repository at this point in the history
* feat: added support for Virtual and Downloadable products (#199)

* feat(downloadable products): created add query + async call

* feat(downloadable products): updated schema.graphql

* feat(downloadable products): added method and modified productDetail query

* feat(downloadable products): added missing exports, methods and GraphQL types

* feat(downloadable products): updated useCart so downloadable products can be added to the cart

* feat(virtual product): updated graphql

* feat(virtual products): created api method

* feat(virtal product): updated useCart

* feat(virtual products): added missing imports + TS interfaces

* chore: updated README with new VSF brand

* refactor(documentation): refine project setup description (#201)

* fix(composables): remove redundant debugger statement (#202)

* docs: add @bartoszherba as a contributor

* chore: release 1.0.0-rc.4.1

Co-authored-by: Kevin Gorjan <[email protected]>
Co-authored-by: Bartosz Herba <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2021
1 parent 3a279b6 commit 4177abf
Show file tree
Hide file tree
Showing 22 changed files with 567 additions and 192 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@
"contributions": [
"code"
]
},
{
"login": "bartoszherba",
"name": "Bartosz Herba",
"avatar_url": "https://avatars.githubusercontent.com/u/16045377?v=4",
"profile": "http://digibart.com/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 5
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="https://blog.vuestorefront.io/wp-content/uploads/2020/01/1QU9F6hQlFyHsJIbsdmt6FA.png" height="80px"/>  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magento_Logo.svg/2560px-Magento_Logo.svg.png" height="80px"/>
<img src="https://user-images.githubusercontent.com/1626923/137092657-fb398d20-b592-4661-a1f9-4135db0b61d5.png" height="80px"/>  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magento_Logo.svg/2560px-Magento_Logo.svg.png" height="80px"/>
</div>

## Vue Storefront 2 integration with Magento
Expand All @@ -12,7 +12,7 @@ This integration developed by superheroes from [Caravel](https://github.com/cara
<hr />

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

## How to start if you want to try out the integration
Expand All @@ -30,7 +30,7 @@ Want to contribute? Ping us on `magento2-vsf2` channel on [our Discord](http://d

### Requirements:
- NodeJS v14 or later
- Yarn
- Yarn (npm is not supprted yet)
- Magento >= v2.4.3 instance for GraphQL endpoint
- Change Magento GraphQL Query Complexity and Depth values

Expand Down Expand Up @@ -59,29 +59,40 @@ php bin/magento setup:static-content:deploy
Find more information about the module [GraphQl Custom Config](https://github.com/caravelx/module-graphql-config)

### Steps
1. Fork the repo
(<b>Note: Currently only yarn is supported because of workspaces resolving. Do not use npm to install or build the project.</b>)
1. [Fork the repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
2. Clone your fork of the repo
```bash
git clone https://github.com/vuestorefront/magento2.git && cd magento2
```
example:
git clone https://github.com/vuestorefront/magento2.git
cd magento2
3. Checkout `develop` branch
```bash
git checkout develop
```
3. Checkout develop branch `git checkout develop`
4. Run `yarn` to install dependencies
```bash
yarn install
```
5. Define a store running environment by adding a `STORE_ENV` to your running project or execute the code
```bash
$ echo "STORE_ENV=dev" >> .env
echo "STORE_ENV=dev" >> .env
```
6. Copy `config/example.json` to an environment named config and update GraphQL Endpoint
```bash
$ cp packages/theme/config/example.json packages/theme/config/dev.json
cp packages/theme/config/example.json packages/theme/config/dev.json
```
7. Update `magentoGraphQl` with url to Magento >=2.4.2 GraphQL endpoint, and the other variable accordingly to your store configurations.
```
"magentoGraphQl": "https://{YOUR_SITE_FRONT_URL}/graphql",
```
8. Build dependencies `yarn build:api-client && yarn build:composables`
```bash
yarn build:api-client && yarn build:composables
```
9. Run `yarn dev:theme` to run theme. You can find other commands in `package.json`
```bash
yarn dev:theme
```
- If you need HMR on Api Client/Composables run `yarn dev:api-client` or `yarn dev:composables` on a separate terminal window.

## Resources
Expand Down Expand Up @@ -123,6 +134,7 @@ Thanks go to these wonderful people 🙌:
<tr>
<td align="center"><a href="https://github.com/renanoliveira0"><img src="https://avatars.githubusercontent.com/u/1081576?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Renan Oliveira</b></sub></a><br /><a href="#tool-renanoliveira0" title="Tools">🔧</a> <a href="#plugin-renanoliveira0" title="Plugin/utility libraries">🔌</a></td>
<td align="center"><a href="https://www.youtube.com/playlist?list=PLBjvYfV_TvwL7srfoBB0QxP1P-iJ5sQnc"><img src="https://avatars.githubusercontent.com/u/13258255?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Patrick Monteiro</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=patrickmonteiro" title="Code">💻</a></td>
<td align="center"><a href="http://digibart.com/"><img src="https://avatars.githubusercontent.com/u/16045377?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Bartosz Herba</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=bartoszherba" title="Code">💻</a></td>
</tr>
</table>

Expand Down
Binary file modified docs/.vuepress/public/vuelogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/guide/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Thanks go to these wonderful people 🙌:
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/bloodf"><img src="https://avatars.githubusercontent.com/u/1626923?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Heitor Ramon Ribeiro</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=bloodf" title="Code">💻</a> <a href="#maintenance-bloodf" title="Maintenance">🚧</a> <a href="#projectManagement-bloodf" title="Project Management">📆</a></td>
<td align="center"><a href="https://github.com/bloodf"><img src="https://avatars.githubusercontent.com/u/1626923?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Heitor Ramon Ribeiro</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=bloodf" title="Code">💻</a> <a href="#maintenance-bloodf" title="Maintenance">🚧</a> <a href="https://github.com/vuestorefront/magento2/commits?author=bloodf" title="Documentation">📖</a> <a href="#projectManagement-bloodf" title="Project Management">📆</a></td>
<td align="center"><a href="https://github.com/alefbarbeli"><img src="https://avatars.githubusercontent.com/u/7727647?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Alef Barbeli</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=alefbarbeli" title="Code">💻</a> <a href="https://github.com/vuestorefront/magento2/commits?author=alefbarbeli" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/domideimel"><img src="https://avatars.githubusercontent.com/u/32941053?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Dominik Deimel</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=domideimel" title="Code">💻</a> <a href="https://github.com/vuestorefront/magento2/commits?author=domideimel" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/LiorLindvor"><img src="https://avatars.githubusercontent.com/u/6757942?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Lior Lindvor</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=LiorLindvor" title="Code">💻</a></td>
Expand All @@ -39,6 +39,7 @@ Thanks go to these wonderful people 🙌:
<tr>
<td align="center"><a href="https://github.com/renanoliveira0"><img src="https://avatars.githubusercontent.com/u/1081576?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Renan Oliveira</b></sub></a><br /><a href="#tool-renanoliveira0" title="Tools">🔧</a> <a href="#plugin-renanoliveira0" title="Plugin/utility libraries">🔌</a></td>
<td align="center"><a href="https://www.youtube.com/playlist?list=PLBjvYfV_TvwL7srfoBB0QxP1P-iJ5sQnc"><img src="https://avatars.githubusercontent.com/u/13258255?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Patrick Monteiro</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=patrickmonteiro" title="Code">💻</a></td>
<td align="center"><a href="http://digibart.com/"><img src="https://avatars.githubusercontent.com/u/16045377?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Bartosz Herba</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=bartoszherba" title="Code">💻</a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://blog.vuestorefront.io/wp-content/uploads/2020/01/1QU9F6hQlFyHsJIbsdmt6FA.png" height="100px" />
<img src="https://user-images.githubusercontent.com/1626923/137092657-fb398d20-b592-4661-a1f9-4135db0b61d5.png" height="100px" />

# Vue Storefront 2 integration with Magento 2

Expand Down
5 changes: 3 additions & 2 deletions packages/api-client/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="https://blog.vuestorefront.io/wp-content/uploads/2020/01/1QU9F6hQlFyHsJIbsdmt6FA.png" height="80px"/>  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magento_Logo.svg/2560px-Magento_Logo.svg.png" height="80px"/>
<img src="https://user-images.githubusercontent.com/1626923/137092657-fb398d20-b592-4661-a1f9-4135db0b61d5.png" height="80px"/>  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magento_Logo.svg/2560px-Magento_Logo.svg.png" height="80px"/>
</div>

## Vue Storefront 2 integration with Magento
Expand All @@ -16,7 +16,7 @@ This integration developed by superheroes from [Caravel](https://github.com/cara
<hr />

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

## How to start if you want to try out the integration
Expand Down Expand Up @@ -126,6 +126,7 @@ Thanks go to these wonderful people 🙌:
<tr>
<td align="center"><a href="https://github.com/renanoliveira0"><img src="https://avatars.githubusercontent.com/u/1081576?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Renan Oliveira</b></sub></a><br /><a href="#tool-renanoliveira0" title="Tools">🔧</a> <a href="#plugin-renanoliveira0" title="Plugin/utility libraries">🔌</a></td>
<td align="center"><a href="https://www.youtube.com/playlist?list=PLBjvYfV_TvwL7srfoBB0QxP1P-iJ5sQnc"><img src="https://avatars.githubusercontent.com/u/13258255?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Patrick Monteiro</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=patrickmonteiro" title="Code">💻</a></td>
<td align="center"><a href="http://digibart.com/"><img src="https://avatars.githubusercontent.com/u/16045377?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Bartosz Herba</b></sub></a><br /><a href="https://github.com/vuestorefront/magento2/commits?author=bartoszherba" title="Code">💻</a></td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/magento-api",
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.4.1",
"sideEffects": false,
"homepage": "https://github.com/vuestorefront/magento2",
"bugs": {
Expand Down
2 changes: 2 additions & 0 deletions packages/api-client/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6075,3 +6075,5 @@ input createEmptyCartInput {
input createKlarnaPaymentsSessionInput {
cart_id: String!
}

input DownloadableProductCartItemInput
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
import gql from 'graphql-tag';

export default gql`
mutation addDownloadableProductsToCart($input: AddDownloadableProductsToCartInput) {
addDownloadableProductsToCart(input: $input) {
cart {
id
email
is_virtual
applied_coupons {
code
}
prices {
subtotal_excluding_tax {
value
},
subtotal_including_tax {
value
},
applied_taxes {
amount {
value
},
label
}
discounts {
amount {
value
},
label
}
grand_total {
value
}
}
items {
uid
product {
uid
__typename
sku
name
stock_status
only_x_left_in_stock
rating_summary
thumbnail {
url
position
disabled
label
}
url_key
url_rewrites {
url
}
price_range {
maximum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
minimum_price {
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
categories {
uid
name
url_suffix
url_path
breadcrumbs {
category_name,
category_url_path
}
}
review_count
reviews {
items {
average_rating
ratings_breakdown {
name
value
}
}
}
}
prices {
row_total {
value
}
row_total_including_tax {
value
}
total_item_discount {
value
}
}
quantity
... on ConfigurableCartItem {
configurable_options {
configurable_product_option_uid
option_label
configurable_product_option_value_uid
value_label
}
}
... on BundleCartItem {
bundle_options {
uid
label
type
values {
id
label
price
quantity
}
}
}
}
total_quantity
shipping_addresses {
firstname
lastname
street
city
company
region {
code
region_id
label
}
postcode
telephone
country {
code
label
}
selected_shipping_method {
carrier_code
carrier_title
method_code
method_title
amount {
value
currency
}
}
}
billing_address {
firstname
lastname
street
city
company
region {
code
region_id
label
}
postcode
telephone
country {
code
label
}
}
}
}
}`;
17 changes: 17 additions & 0 deletions packages/api-client/src/api/addDownloadableProductsToCart/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { FetchResult } from '@apollo/client';
import addDownloadableProductsToCart from './addDownloadableProductsToCart';
import {
AddDownloadableProductsToCartInput,
AddDownloadableProductsToCartMutation,
AddDownloadableProductsToCartMutationVariables,
} from '../../types/GraphQL';
import { Context } from '../../types/context';

export default async (
{ client }: Context,
input: AddDownloadableProductsToCartInput,
): Promise<FetchResult<AddDownloadableProductsToCartMutation>> => client
.mutate<AddDownloadableProductsToCartMutation, AddDownloadableProductsToCartMutationVariables>({
mutation: addDownloadableProductsToCart,
variables: { input },
});
Loading

0 comments on commit 4177abf

Please sign in to comment.