From b6d5277cc795766c180a0d4120b08a99731a4fe9 Mon Sep 17 00:00:00 2001 From: Murat Ozcan Date: Wed, 4 May 2022 10:45:19 -0500 Subject: [PATCH] set path to path: ./packages/**/dist/** --- .env.local | 4 ++++ .github/workflows/main.yml | 4 ++-- .gitignore | 1 - site/comments.md | 9 ++++----- site/components/common/Navbar/Navbar.tsx | 8 ++++++-- 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .env.local diff --git a/.env.local b/.env.local new file mode 100644 index 000000000..80e142db2 --- /dev/null +++ b/.env.local @@ -0,0 +1,4 @@ +COMMERCE_PROVIDER=@vercel/commerce-shopify +NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=e66b1627171548eabbb8aa425d085fc5 +NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=cypress-murat-shop.myshopify.com +NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED=true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b1fac011..6e88b9fa0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,7 +49,7 @@ jobs: with: name: build if-no-files-found: error - path: dist + path: ./packages/**/dist/** ui-chrome-tests: runs-on: ubuntu-latest @@ -67,7 +67,7 @@ jobs: uses: actions/download-artifact@v2 with: name: build - path: dist + path: ./packages/**/dist/** - name: 'Chrome E2E Tests' uses: cypress-io/github-action@v2 diff --git a/.gitignore b/.gitignore index b7301fe56..83b6a9ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ yarn-error.log* # local env files .env -.env.local .env.development.local .env.test.local .env.production.local diff --git a/site/comments.md b/site/comments.md index 1ac2d32ae..5351e43a6 100644 --- a/site/comments.md +++ b/site/comments.md @@ -4,8 +4,7 @@ At Extend, Shopify is one of the merchants we integrate with to sell warranties I will capture any feedback here while going through the content, for the purpose of making the content as frictionless as possible, so that adoption is higher for Extend as well as any Cypress users who want to perform self-learning. -TL, DR; the source repo is vastly different and environment variables are not possible to get to work as described. All the below are a consequence of that. -At the end, these issues can be figured out but it requires a high amount of know-how and willpower. We need to make it so that things work with batteries included, without having to wrestle anything. +TL, DR; the source repo is vastly different and environment variables are not possible to get to work as described. All the below are a consequence of that. I have included the .env.local file so that one can try to reproduce these issues. At the end, these issues can be figured out but it requires a high amount of know-how and willpower. We need to make it so that things work with batteries included, without having to wrestle anything. One should compare the below comments to the final version of the code while going through it. ## [Part 1- Creating a Shopify Partners Store](https://learn.cypress.io/tutorials/creating-a-shopify-partners-store) @@ -407,7 +406,7 @@ it('the search bar returns the correct search results', () => { ## [Part 5 Running Our Tests in Parallel with Cypress Dashboard](https://learn.cypress.io/tutorials/running-our-tests-in-parallel-with-cypress-dashboard) -As of today May 4th, 2022, Cypress Dashboard looks different and those screen shots should be updated. +As of today May 4th, 2022, Cypress Dashboard looks different and the screen shots should be updated. --- @@ -417,7 +416,7 @@ Question about `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`. Cypress Dashboard re Running things in CI and seeing it on the dashboard, I have lost the relevance between a locally served app and what runs in the CI. The two are entirely different! Somehow the app in CI has the Shopify concept. But the local app is the template app. -This is because the environment variables are not working using the `.env.local` file. The users will need help getting these to work in a solid way. For now I am exporting them in the command line. +This is because the environment variables are not working using the `.env.local` file. The users will need help getting these to work in a solid way. For now I am exporting them in the command line. I have included the .env.local file so that one can try to reproduce these issues. ________ @@ -425,7 +424,7 @@ In the parallelization section, the jobs with `yarn build` and `save build folde __________ -Unsure about any of the `build` instructions. The yml at the end of Part 5 does not work as advertised. The build job does not generate a build path and errors out. We should just be able to install and cache to perpetual jobs in an easy way without having to crud the build folder. +Unsure about any of the `build` instructions. The yml at the end of Part 5 does not work as advertised. The build job does not generate a build path and errors out. https://github.com/muratkeremozcan/nextjs-cypress/runs/6292547384?check_suite_focus=true diff --git a/site/components/common/Navbar/Navbar.tsx b/site/components/common/Navbar/Navbar.tsx index 923b2d013..f9cbf8b4f 100644 --- a/site/components/common/Navbar/Navbar.tsx +++ b/site/components/common/Navbar/Navbar.tsx @@ -14,6 +14,10 @@ interface NavbarProps { links?: Link[] } +// These do not really work with built-in vercel things.. +// I had to export them in bash +// export COMMERCE_PROVIDER=@vercel/commerce-shopify NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED=true etc. + console.log('COMMERCE_PROVIDER: ', process.env.COMMERCE_PROVIDER) console.log( 'NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN: ', @@ -56,7 +60,7 @@ const Navbar: FC = ({ links }) => ( ))} - {true && ( + {process.env.NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED && (
@@ -65,7 +69,7 @@ const Navbar: FC = ({ links }) => ( - {true && ( + {process.env.NEXT_PUBLIC_COMMERCE_SEARCH_ENABLED && (