From b067830a33967fdb44729ca02fd90134890746e4 Mon Sep 17 00:00:00 2001 From: benjaminkalk Date: Thu, 30 May 2024 09:11:13 -0500 Subject: [PATCH] update cdn and product view docs (#156) --- .github/PACKAGE_WORKFLOW.md | 8 ++++---- README.md | 4 ++-- examples/events/product-page-view.md | 3 +++ packages/storefront-events-collector/README.md | 6 +++--- packages/storefront-events-sdk/README.md | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/PACKAGE_WORKFLOW.md b/.github/PACKAGE_WORKFLOW.md index 66c245bf..bebba626 100644 --- a/.github/PACKAGE_WORKFLOW.md +++ b/.github/PACKAGE_WORKFLOW.md @@ -29,18 +29,18 @@ We can simply add our new package workflow by adding the below lines to the end When you create a Pull Request and it is merged into the `main` branch, your package is then built and pushed to [npm](npmjs.com). You can see the piplines running [here](https://github.com/adobe/commerce-events/actions). If you search for your package name, you should see the latest build as version `0.0.0-` and should also have a qa tag. -### - UNPKG Access +### - JSDELIVR Access > :memo: The 2.x packages will be located at `/umd/index.js` or `umd.index.js` -[unpkg](https://unpkg.com/) is a fast, global content delivery network for everything on npm. We can access our package by going to the url +[jsdelivr](https://jsdelivr.com/) is a fast, global content delivery network for everything on npm. We can access our package by going to the url -- `https://unpkg.com/@adobe/commerce-events-@qa/dist/index.js` +- `https://cdn.jsdelivr.net/npm/@adobe/commerce-events-@qa/dist/index.js` Using the sdk as an example, you should be able to access your file on the cdn in your html like so: ```html - + ``` ## Github Actions (CI/CD) for "Prod" diff --git a/README.md b/README.md index bb860cb7..9ba279d4 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Under the dev script, our built files are hosted at: ### QA -Merging a change to the `main` branch triggers a github action that builds and deploys the latest code to QA: https://unpkg.com/@adobe/magento-storefront-event-collector@qa/dist/index.js. +Merging a change to the `main` branch triggers a github action that builds and deploys the latest code to QA: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector@qa/dist/index.js. ### Production @@ -36,7 +36,7 @@ Release steps: - once the PR is approved and merged, create a [new release tag for the repo](https://github.com/adobe/commerce-events/tags) -Creating a new release tag triggers a github action that builds and deploys the latest code to Prod: https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js. +Creating a new release tag triggers a github action that builds and deploys the latest code to Prod: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector/dist/index.js. ### NPM Packages diff --git a/examples/events/product-page-view.md b/examples/events/product-page-view.md index f924ce2f..0a45dd17 100644 --- a/examples/events/product-page-view.md +++ b/examples/events/product-page-view.md @@ -19,6 +19,8 @@ [`product`](./example-contexts/mock-product-context.md) +[`shoppingCart`](./example-contexts/mock-shopping-cart-context.md) + ### 🔧 Usage ```javascript @@ -30,6 +32,7 @@ const mse = window.magentoStorefrontEvents; /* set before firing event */ mse.context.setProduct(productCtx); +mse.context.setShoppingCart(shoppingCartCtx); mse.publish.productPageView(); ``` diff --git a/packages/storefront-events-collector/README.md b/packages/storefront-events-collector/README.md index 40579e95..987f4f1f 100644 --- a/packages/storefront-events-collector/README.md +++ b/packages/storefront-events-collector/README.md @@ -13,12 +13,12 @@ This package listens for and handles events published by the [Adobe Commerce Eve ## Installation -The collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm]. +The collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [jsdelivr][jsdelivr], and the bundled version is hosted on [npm][npm]. To load the Collector as a script, use the following snippet. ``` - + ``` To install the script as a dependency, run this command. @@ -314,5 +314,5 @@ If you have any questions or encounter any issues, please reach out at these loc [contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square [sdk]: https://npmjs.com/package/@adobe/magento-storefront-events-sdk [acdl]: https://github.com/adobe/adobe-client-data-layer -[unpkg]: https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js +[jsdelivr]: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector/dist/index.js [issues]: https://github.com/adobe/commerce-events/issues diff --git a/packages/storefront-events-sdk/README.md b/packages/storefront-events-sdk/README.md index 8f03e084..1a96961f 100644 --- a/packages/storefront-events-sdk/README.md +++ b/packages/storefront-events-sdk/README.md @@ -22,12 +22,12 @@ Our context schemas are designed to simplify forwarding to two edges: ## Installation -This SDK can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm]. +This SDK can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [jsdelivr][jsdelivr], and the bundled version is hosted on [npm][npm]. To load the SDK as a script, use the following snippet. ``` - + ``` To install the script as a dependency, run this command. @@ -140,5 +140,5 @@ If you have any questions or encounter any issues, please reach out on [GitHub][ [contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square [commerce]: https://business.adobe.com/products/magento/magento-commerce.html [collectors]: https://github.com/adobe/commerce-events/tree/main/packages/storefront-events-collector -[unpkg]: https://unpkg.com/@adobe/magento-storefront-events-sdk/dist/index.js +[jsdelivr]: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-events-sdk/dist/index.js [issues]: https://github.com/adobe/commerce-events/issues