From fa2d22219c24de082f2b5e93af3b622eb3919260 Mon Sep 17 00:00:00 2001 From: Aravind Kumar Date: Fri, 8 Dec 2023 18:24:35 +0530 Subject: [PATCH 1/8] sca-scan.yml --- .github/workflows/sca-scan.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/sca-scan.yml diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml new file mode 100644 index 0000000..bf9c1eb --- /dev/null +++ b/.github/workflows/sca-scan.yml @@ -0,0 +1,15 @@ +name: Source Composition Analysis Scan +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/node@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --all-projects --fail-on=all From 96eecb78103402db053699b2df5a4338d1668766 Mon Sep 17 00:00:00 2001 From: Aravind Kumar Date: Fri, 8 Dec 2023 18:24:47 +0530 Subject: [PATCH 2/8] jira.yml --- .github/workflows/jira.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/jira.yml diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml new file mode 100644 index 0000000..63960ea --- /dev/null +++ b/.github/workflows/jira.yml @@ -0,0 +1,33 @@ +name: Create JIRA ISSUE +on: + pull_request: + types: [opened] +jobs: + security: + if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login into JIRA + uses: atlassian/gajira-login@master + env: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + - name: Create a JIRA Issue + id: create + uses: atlassian/gajira-create@master + with: + project: ${{ secrets.JIRA_PROJECT }} + issuetype: ${{ secrets.JIRA_ISSUE_TYPE }} + summary: | + ${{ github.event.pull_request.title }} + description: | + PR: ${{ github.event.pull_request.html_url }} + + fields: "${{ secrets.JIRA_FIELDS }}" + - name: Transition issue + uses: atlassian/gajira-transition@v3 + with: + issue: ${{ steps.create.outputs.issue }} + transition: ${{ secrets.JIRA_TRANSITION }} From b12b54bf576192132322ab159c2172110b332e4a Mon Sep 17 00:00:00 2001 From: "shopify[bot]" <79544226+shopify[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:42:29 +0000 Subject: [PATCH 3/8] Add Shopify Oxygen deployment workflow file --- .../oxygen-deployment-1000010341.yml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/oxygen-deployment-1000010341.yml diff --git a/.github/workflows/oxygen-deployment-1000010341.yml b/.github/workflows/oxygen-deployment-1000010341.yml new file mode 100644 index 0000000..530548c --- /dev/null +++ b/.github/workflows/oxygen-deployment-1000010341.yml @@ -0,0 +1,57 @@ +# Don't change the line below! +#! oxygen_storefront_id: 1000010341 + +name: Storefront 1000010341 +on: [push] + +permissions: + contents: read + deployments: write + +jobs: + deploy: + name: Deploy to Oxygen + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + check-latest: true + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install dependencies + run: npm ci + + - name: Build and Publish to Oxygen + id: deploy + uses: shopify/oxygenctl-action@v4 + with: + oxygen_deployment_token: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1000010341 }} + build_command: "npm run build" + + # Create GitHub Deployment + - name: Create GitHub Deployment + uses: shopify/github-deployment-action@v1 + if: always() + with: + token: ${{ github.token }} + environment: 'preview' + preview_url: ${{ steps.deploy.outputs.url }} + description: ${{ github.event.head_commit.message }} + \ No newline at end of file From f13fb0c4667bfee798f51e52a8c0cb176c4f63b9 Mon Sep 17 00:00:00 2001 From: ChinmayeeMestry Date: Mon, 18 Dec 2023 12:24:47 +0530 Subject: [PATCH 4/8] Added shopify files --- .eslintignore | 5 + .eslintrc.js | 18 + .gitignore | 9 + .graphqlrc.yml | 1 + CHANGELOG.md | 143 + app/components/Aside.tsx | 47 + app/components/Cart.tsx | 340 + app/components/Footer.tsx | 110 + app/components/Header.tsx | 186 + app/components/Layout.tsx | 105 + app/components/Search.tsx | 478 + app/entry.client.tsx | 12 + app/entry.server.tsx | 41 + app/root.tsx | 280 + app/routes/($locale).$.tsx | 11 + app/routes/($locale).[sitemap.xml].tsx | 177 + app/routes/($locale)._index.tsx | 145 + app/routes/($locale).account.$.tsx | 8 + app/routes/($locale).account.addresses.tsx | 563 + app/routes/($locale).account.orders.$id.tsx | 309 + .../($locale).account.orders._index.tsx | 191 + app/routes/($locale).account.profile.tsx | 294 + app/routes/($locale).account.tsx | 204 + ...account_.activate.$id.$activationToken.tsx | 161 + app/routes/($locale).account_.login.tsx | 142 + app/routes/($locale).account_.logout.tsx | 29 + app/routes/($locale).account_.recover.tsx | 129 + app/routes/($locale).account_.register.tsx | 207 + ...locale).account_.reset.$id.$resetToken.tsx | 136 + .../($locale).api.predictive-search.tsx | 340 + ...cale).blogs.$blogHandle.$articleHandle.tsx | 87 + .../($locale).blogs.$blogHandle._index.tsx | 162 + app/routes/($locale).blogs._index.tsx | 96 + app/routes/($locale).cart.$lines.tsx | 69 + app/routes/($locale).cart.tsx | 106 + app/routes/($locale).collections.$handle.tsx | 183 + app/routes/($locale).collections._index.tsx | 120 + app/routes/($locale).discount.$code.tsx | 47 + app/routes/($locale).pages.$handle.tsx | 56 + app/routes/($locale).policies.$handle.tsx | 93 + app/routes/($locale).policies._index.tsx | 63 + app/routes/($locale).products.$handle.tsx | 428 + app/routes/($locale).search.tsx | 168 + app/routes/[robots.txt].tsx | 145 + app/styles/app.css | 473 + app/styles/reset.css | 129 + app/utils.ts | 46 + package-lock.json | 22551 ++++++++++++++++ package.json | 45 + public/favicon.svg | 28 + remix.config.js | 19 + remix.env.d.ts | 61 + server.ts | 273 + storefrontapi.generated.d.ts | 1930 ++ tsconfig.json | 23 + 55 files changed, 32222 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .graphqlrc.yml create mode 100644 CHANGELOG.md create mode 100644 app/components/Aside.tsx create mode 100644 app/components/Cart.tsx create mode 100644 app/components/Footer.tsx create mode 100644 app/components/Header.tsx create mode 100644 app/components/Layout.tsx create mode 100644 app/components/Search.tsx create mode 100644 app/entry.client.tsx create mode 100644 app/entry.server.tsx create mode 100644 app/root.tsx create mode 100644 app/routes/($locale).$.tsx create mode 100644 app/routes/($locale).[sitemap.xml].tsx create mode 100644 app/routes/($locale)._index.tsx create mode 100644 app/routes/($locale).account.$.tsx create mode 100644 app/routes/($locale).account.addresses.tsx create mode 100644 app/routes/($locale).account.orders.$id.tsx create mode 100644 app/routes/($locale).account.orders._index.tsx create mode 100644 app/routes/($locale).account.profile.tsx create mode 100644 app/routes/($locale).account.tsx create mode 100644 app/routes/($locale).account_.activate.$id.$activationToken.tsx create mode 100644 app/routes/($locale).account_.login.tsx create mode 100644 app/routes/($locale).account_.logout.tsx create mode 100644 app/routes/($locale).account_.recover.tsx create mode 100644 app/routes/($locale).account_.register.tsx create mode 100644 app/routes/($locale).account_.reset.$id.$resetToken.tsx create mode 100644 app/routes/($locale).api.predictive-search.tsx create mode 100644 app/routes/($locale).blogs.$blogHandle.$articleHandle.tsx create mode 100644 app/routes/($locale).blogs.$blogHandle._index.tsx create mode 100644 app/routes/($locale).blogs._index.tsx create mode 100644 app/routes/($locale).cart.$lines.tsx create mode 100644 app/routes/($locale).cart.tsx create mode 100644 app/routes/($locale).collections.$handle.tsx create mode 100644 app/routes/($locale).collections._index.tsx create mode 100644 app/routes/($locale).discount.$code.tsx create mode 100644 app/routes/($locale).pages.$handle.tsx create mode 100644 app/routes/($locale).policies.$handle.tsx create mode 100644 app/routes/($locale).policies._index.tsx create mode 100644 app/routes/($locale).products.$handle.tsx create mode 100644 app/routes/($locale).search.tsx create mode 100644 app/routes/[robots.txt].tsx create mode 100644 app/styles/app.css create mode 100644 app/styles/reset.css create mode 100644 app/utils.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/favicon.svg create mode 100644 remix.config.js create mode 100644 remix.env.d.ts create mode 100644 server.ts create mode 100644 storefrontapi.generated.d.ts create mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..a362bca --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +build +node_modules +bin +*.d.ts +dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..57a969e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,18 @@ +/** + * @type {import("@types/eslint").Linter.BaseConfig} + */ +module.exports = { + extends: [ + '@remix-run/eslint-config', + 'plugin:hydrogen/recommended', + 'plugin:hydrogen/typescript', + ], + rules: { + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/naming-convention': 'off', + 'hydrogen/prefer-image-component': 'off', + 'no-useless-escape': 'off', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', + 'no-case-declarations': 'off', + }, +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0081f9e --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/.cache +/build +/dist +/public/build +/.mf +.env +.shopify +/node_modules +/README 2.md \ No newline at end of file diff --git a/.graphqlrc.yml b/.graphqlrc.yml new file mode 100644 index 0000000..bd38d07 --- /dev/null +++ b/.graphqlrc.yml @@ -0,0 +1 @@ +schema: node_modules/@shopify/hydrogen-react/storefront.schema.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ede2e9b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,143 @@ +# skeleton + +## 1.0.0 + +### Major Changes + +- The Storefront API 2023-10 now returns menu item URLs that include the `primaryDomainUrl`, instead of defaulting to the Shopify store ID URL (example.myshopify.com). The skeleton template requires changes to check for the `primaryDomainUrl`: by [@blittle](https://github.com/blittle) + + 1. Update the `HeaderMenu` component to accept a `primaryDomainUrl` and include + it in the internal url check + + ```diff + // app/components/Header.tsx + + + import type {HeaderQuery} from 'storefrontapi.generated'; + + export function HeaderMenu({ + menu, + + primaryDomainUrl, + viewport, + }: { + menu: HeaderProps['header']['menu']; + + primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url']; + viewport: Viewport; + }) { + + // ...code + + // if the url is internal, we strip the domain + const url = + item.url.includes('myshopify.com') || + item.url.includes(publicStoreDomain) || + + item.url.includes(primaryDomainUrl) + ? new URL(item.url).pathname + : item.url; + + // ...code + + } + ``` + + 2. Update the `FooterMenu` component to accept a `primaryDomainUrl` prop and include + it in the internal url check + + ```diff + // app/components/Footer.tsx + + - import type {FooterQuery} from 'storefrontapi.generated'; + + import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated'; + + function FooterMenu({ + menu, + + primaryDomainUrl, + }: { + menu: FooterQuery['menu']; + + primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url']; + }) { + // code... + + // if the url is internal, we strip the domain + const url = + item.url.includes('myshopify.com') || + item.url.includes(publicStoreDomain) || + + item.url.includes(primaryDomainUrl) + ? new URL(item.url).pathname + : item.url; + + // ...code + + ); + } + ``` + + 3. Update the `Footer` component to accept a `shop` prop + + ```diff + export function Footer({ + menu, + + shop, + }: FooterQuery & {shop: HeaderQuery['shop']}) { + return ( +
+ - + + +
+ ); + } + ``` + + 4. Update `Layout.tsx` to pass the `shop` prop + + ```diff + export function Layout({ + cart, + children = null, + footer, + header, + isLoggedIn, + }: LayoutProps) { + return ( + <> + + + +
+
{children}
+ + + - {(footer) =>