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

PWA-3318::Prex compatibility #4349

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
199 changes: 199 additions & 0 deletions packages/extensions/venia-product-recommendations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.7.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.6.0-beta.3...v0.7.0) (2021-04-19)


### ⚠ BREAKING CHANGES

* requires newer version of graphql module

* chore: NON-123 none

cleand up

* checking if product is configurable

* chore: DATA-2595 clean up

Co-authored-by: James Delorey <[email protected]>

* Product child SKU (#81) ([c6753c5](https://github.com/magento-commerce/data-services-pwa-recs/commit/c6753c5aa4d9edb0af6e1d8a035a3ba864c7b36c)), closes [#81](https://github.com/magento-commerce/data-services-pwa-recs/issues/81)

## [0.6.0-beta.3](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.6.0-beta.2...v0.6.0-beta.3) (2021-04-13)

## [0.6.0-beta.2](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.5.1...v0.6.0-beta.2) (2021-04-13)


### ⚠ BREAKING CHANGES

* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>
* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>

* Product child SKU (#79) ([c912977](https://github.com/magento-commerce/data-services-pwa-recs/commit/c912977255e29d3440b131a3b2cb74c8178f8ee5)), closes [#79](https://github.com/magento-commerce/data-services-pwa-recs/issues/79)
* Graphql (#76) ([4cb1e7a](https://github.com/magento-commerce/data-services-pwa-recs/commit/4cb1e7aa65118e16cbb4b97f29217b4822d823a8)), closes [#76](https://github.com/magento-commerce/data-services-pwa-recs/issues/76)

## [0.6.0-beta.1](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.5.1...v0.6.0-beta.1) (2021-04-13)


### ⚠ BREAKING CHANGES

* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>
* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>

* Product child SKU (#79) ([c912977](https://github.com/magento-commerce/data-services-pwa-recs/commit/c912977255e29d3440b131a3b2cb74c8178f8ee5)), closes [#79](https://github.com/magento-commerce/data-services-pwa-recs/issues/79)
* Graphql (#76) ([4cb1e7a](https://github.com/magento-commerce/data-services-pwa-recs/commit/4cb1e7aa65118e16cbb4b97f29217b4822d823a8)), closes [#76](https://github.com/magento-commerce/data-services-pwa-recs/issues/76)

## [0.6.0-beta.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.5.1...v0.6.0-beta.0) (2021-04-13)


### ⚠ BREAKING CHANGES

* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>
* requires newer version of graphql module

* chore: NON-123 none

cleand up

Co-authored-by: James Delorey <[email protected]>

* Product child SKU (#79) ([c912977](https://github.com/magento-commerce/data-services-pwa-recs/commit/c912977255e29d3440b131a3b2cb74c8178f8ee5)), closes [#79](https://github.com/magento-commerce/data-services-pwa-recs/issues/79)
* Graphql (#76) ([4cb1e7a](https://github.com/magento-commerce/data-services-pwa-recs/commit/4cb1e7aa65118e16cbb4b97f29217b4822d823a8)), closes [#76](https://github.com/magento-commerce/data-services-pwa-recs/issues/76)

### [0.5.1](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.5.0...v0.5.1) (2021-03-23)


### Bug Fixes

* NONE-123 naming issue for queries ([#75](https://github.com/magento-commerce/data-services-pwa-recs/issues/75)) ([ded7520](https://github.com/magento-commerce/data-services-pwa-recs/commit/ded7520db28b5d78fc09f5014c0ac31e19c9c6b3))

## [0.5.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.4.0...v0.5.0) (2021-03-23)


### ⚠ BREAKING CHANGES

* it works now :P

* send activity summary only if there is data to send

* fix: NONE-123 changing event types, checking if activity_summary has dat

a

* heyo

* numbers

* fix: NON-123 fixed breakign tests

Co-authored-by: himmer <[email protected]>

* Event type (#73) ([690f8bd](https://github.com/magento-commerce/data-services-pwa-recs/commit/690f8bdb3c734b5da6773996db556408a2adc247)), closes [#73](https://github.com/magento-commerce/data-services-pwa-recs/issues/73)

## [0.4.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.4...v0.4.0) (2021-03-23)


### ⚠ BREAKING CHANGES

* Name of schemas changed

* NONE-123 namespace query names, remove unnecessary set ([c7bab89](https://github.com/magento-commerce/data-services-pwa-recs/commit/c7bab89c95090028fe69a869396bfc95c0b57948))

## [0.3.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.4...v0.3.0) (2021-03-23)


### ⚠ BREAKING CHANGES

* Name of schemas changed

* NONE-123 namespace query names, remove unnecessary set ([c7bab89](https://github.com/magento-commerce/data-services-pwa-recs/commit/c7bab89c95090028fe69a869396bfc95c0b57948))

### [0.2.4](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.3...v0.2.4) (2021-03-23)

### [0.2.3](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.1...v0.2.3) (2021-03-23)

### [0.2.2](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.0...v0.2.2) (2021-03-23)


### Bug Fixes

* NONE-123 Fix naming issue in intercept.js ([0bf1f45](https://github.com/magento-commerce/data-services-pwa-recs/commit/0bf1f456d3a7e717d27502b8e59d911d0463ccc1))
* NONE-123 Include babel config to see if that fixes parsing issues ([c375929](https://github.com/magento-commerce/data-services-pwa-recs/commit/c37592965912ae2cdd487c26e2d1110af4da6072))

### [0.2.2](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.1...v0.2.2) (2021-03-23)

### [0.2.2](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.0...v0.2.2) (2021-03-23)


### Bug Fixes

* NONE-123 Fix naming issue in intercept.js ([0bf1f45](https://github.com/magento-commerce/data-services-pwa-recs/commit/0bf1f456d3a7e717d27502b8e59d911d0463ccc1))
* NONE-123 Include babel config to see if that fixes parsing issues ([c375929](https://github.com/magento-commerce/data-services-pwa-recs/commit/c37592965912ae2cdd487c26e2d1110af4da6072))

### [0.2.1](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.0...v0.2.1) (2021-03-23)

=======
### [0.2.2](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.1...v0.2.2) (2021-03-23)


### Bug Fixes

* NONE-123 Fix naming issue in intercept.js ([0bf1f45](https://github.com/magento-commerce/data-services-pwa-recs/commit/0bf1f456d3a7e717d27502b8e59d911d0463ccc1))

### [0.2.1](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.2.0...v0.2.1) (2021-03-23)


### Bug Fixes

* NONE-123 Include babel config to see if that fixes parsing issues ([c375929](https://github.com/magento-commerce/data-services-pwa-recs/commit/c37592965912ae2cdd487c26e2d1110af4da6072))

>>>>>>> b5547c68b7466a2b659694bd705c7bf3685471d1
## [0.2.0](https://github.com/magento-commerce/data-services-pwa-recs/compare/v0.1.0...v0.2.0) (2021-03-23)


### ⚠ BREAKING CHANGES

* new api gathering recommendations

Co-authored-by: himmer <[email protected]>

### Bug Fixes

* DATA-2906 lock ([29f658c](https://github.com/magento-commerce/data-services-pwa-recs/commit/29f658c46f2825a6fa317ede2b301f1ad196b831))


* Trigger (#70) ([6bcc1e2](https://github.com/magento-commerce/data-services-pwa-recs/commit/6bcc1e22fe9cc60a3bed537230fc084e7b8bc224)), closes [#70](https://github.com/magento-commerce/data-services-pwa-recs/issues/70)

### [0.0.1](https://github.com/magento-commerce/data-services-pwa-recs/compare/v1.0.0-beta.22...v0.0.1) (2021-03-22)
68 changes: 68 additions & 0 deletions packages/extensions/venia-product-recommendations/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@Library(['jenkins-pipeline-libraries', '[email protected]']) _

pipeline {
agent {
docker {
label "worker"
image "docker-data-solution-jenkins-node-aws-dev.dr-uw2.adobeitc.com/node-aws-magento-cli:12-01"
args '-v /etc/passwd:/etc/passwd'
registryUrl "https://docker-data-solution-jenkins-node-aws-dev.dr-uw2.adobeitc.com"
registryCredentialsId "artifactory-datasoln"
}
}
environment {
HOME = "."
TMPDIR = "./temp"
NPM_TOKEN = credentials("delorey-npm-token")
GH_TOKEN = credentials("semantic-release-github-token")
TESSA2_API_KEY = credentials("tessa2-api-key")
MAGENTO_CLOUD_CLI_TOKEN = credentials("delorey-magento-cloud-token")
}
stages {
stage("Install") {
steps {
sh "npm install"
}
}

stage("Lint") {
steps {
sh "npm run lint"
}
}
stage("Test") {
steps {
sh "npm run test"
}
}
stage("redeploy cloud") {
when {
branch 'master'
}
steps {
withGitSsh('magjenkinscloud') {
sh '''
rm -Rf mikita-klimiankou-test
git clone --branch master [email protected]:5k2ulbou6q5ti.git mikita-klimiankou-test
cd mikita-klimiankou-test
git config --global user.email "[email protected]"
git config --global user.name "data-solutions-jenkins"
cd app/code
rm -f ./dummy*
mktemp ./dummyXXXXXX
git add .
git commit -m "building cloud instance"
git push
rm -Rf mikita-klimiankou-test
'''
}
}
}
}
post {
always {
slack(currentBuild.result, "#datasolutions-jenkins")
build job: 'prex_qa_smoke', parameters: [string(name: 'featureTags', value: "\"--tags @pwa\"")], wait: false
}
}
}
16 changes: 16 additions & 0 deletions packages/extensions/venia-product-recommendations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Venia Product Recommendations
Venia Product Recommendations provides fetches, renders, and collects user interaction data on rendered Product Recommendations. See here for more about [Product Recommendations powered by Adobe Sensei](https://magento.com/products/product-recommendations).

## Dependencies
Venia Product Recommendations have a hard dependency on `@magento/venia-data-collector` to be on the storefront as well.

## Installation
Install using npm or yarn into the storefront.

```yarn add @magento/venia-product-recommendations```

## Usage
Usage docs live here: https://magento.github.io/pwa-studio/product-recs/

## Contributions
Feel free to contribute 😊 👍
15 changes: 15 additions & 0 deletions packages/extensions/venia-product-recommendations/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = api => {
const config = {
presets: ['@magento/peregrine', '@babel/preset-react'],
plugins: [
'babel-plugin-transform-es2015-modules-commonjs',
'@babel/plugin-proposal-class-properties',
],
exclude: [/packages\/babel-preset-peregrine\//],
};
if (api.env() === 'development') {
// Ignore everything with underscores except stories in dev mode
config.exclude.push(/\/__(tests?|mocks|fixtures|helpers|dist)__\//);
}
return config;
};
14 changes: 14 additions & 0 deletions packages/extensions/venia-product-recommendations/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
transform: {
'\\.(gql|graphql)$': 'jest-transform-graphql',
'.*': 'babel-jest',
'\\.js$': '<rootDir>/node_modules/babel-jest',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
transformIgnorePatterns: ['node_modules/(?!venia-ui|(?!venia-concept))'],
setupFiles: ['./jest.setup.js'],
clearMocks: true,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@adobe/adobe-client-data-layer/dist/adobe-client-data-layer.min.js';

window.adobeDataLayer = window.adobeDataLayer || [];
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';
import { string, shape, array } from 'prop-types';
import { mergeClasses } from '@magento/venia-ui/lib/classify';
import GalleryItem from '@magento/venia-ui/lib/components/Gallery/item';
// inline loading of the css is janky, but the webpack loader gets blown out in local environment.
import defaultGalleryClasses from '!!style-loader!css-loader?modules!./gallery.css';
import defaultItemClasses from '!!style-loader!css-loader?modules!./item.css';

/**
* Renders a Gallery of items. If items is an array of nulls Gallery will render
* a placeholder item for each.
*
* @params {Array} props.items an array of items to render
*/
export const Gallery = props => {
const galleryClasses = mergeClasses(
defaultGalleryClasses,
props.galleryClasses,
);
const itemClasses = mergeClasses(defaultItemClasses, props.itemClasses);

const { items } = props;

const galleryItems = items.map((item, index) => {
if (item === null) {
return <GalleryItem key={index} />;
}
return <GalleryItem key={item.id} item={item} classes={itemClasses} />;
});

return (
<div className={galleryClasses.root}>
<div className={galleryClasses.items}>{galleryItems}</div>
</div>
);
};

Gallery.propTypes = {
galleryClasses: shape({
filters: string,
items: string,
root: string,
}),
itemClasses: shape({
image: string,
imageContainer: string,
imagePlaceholder: string,
image_pending: string,
images: string,
images_pending: string,
name: string,
name_pending: string,
price: string,
price_pending: string,
root: string,
root_pending: string,
}),
items: array.isRequired,
};
Loading