From 48668c27df8146ba3dff6c0f7b2594f16cbd0972 Mon Sep 17 00:00:00 2001 From: ChinmayeeMestry Date: Wed, 24 Apr 2024 13:50:44 +0530 Subject: [PATCH 1/2] removed unwanted files and added env.template file --- .env.template | 28 + .gitignore | 3 +- contentstack-app/.eslintignore | 5 - contentstack-app/.eslintrc.js | 18 - contentstack-app/.gitignore | 1 - contentstack-app/.graphqlrc.yml | 1 - contentstack-app/CHANGELOG.md | 213 -- contentstack-app/README.md | 40 - contentstack-app/app/components/Aside.tsx | 47 - contentstack-app/app/components/Cart.tsx | 340 --- contentstack-app/app/components/Footer.tsx | 112 - contentstack-app/app/components/Header.tsx | 186 -- contentstack-app/app/components/Layout.tsx | 108 - contentstack-app/app/components/Search.tsx | 475 ---- contentstack-app/app/entry.client.tsx | 12 - contentstack-app/app/entry.server.tsx | 41 - contentstack-app/app/root.tsx | 280 --- contentstack-app/app/styles/app.css | 472 ---- contentstack-app/app/styles/reset.css | 129 -- contentstack-app/app/utils.ts | 46 - contentstack-app/package.json | 45 - contentstack-app/public/favicon.svg | 28 - contentstack-app/remix.config.js | 19 - contentstack-app/remix.env.d.ts | 50 - contentstack-app/server.ts | 256 --- contentstack-app/storefrontapi.generated.d.ts | 1930 ----------------- contentstack-app/tsconfig.json | 23 - 27 files changed, 29 insertions(+), 4879 deletions(-) create mode 100644 .env.template delete mode 100644 contentstack-app/.eslintignore delete mode 100644 contentstack-app/.eslintrc.js delete mode 100644 contentstack-app/.gitignore delete mode 100644 contentstack-app/.graphqlrc.yml delete mode 100644 contentstack-app/CHANGELOG.md delete mode 100644 contentstack-app/README.md delete mode 100644 contentstack-app/app/components/Aside.tsx delete mode 100644 contentstack-app/app/components/Cart.tsx delete mode 100644 contentstack-app/app/components/Footer.tsx delete mode 100644 contentstack-app/app/components/Header.tsx delete mode 100644 contentstack-app/app/components/Layout.tsx delete mode 100644 contentstack-app/app/components/Search.tsx delete mode 100644 contentstack-app/app/entry.client.tsx delete mode 100644 contentstack-app/app/entry.server.tsx delete mode 100644 contentstack-app/app/root.tsx delete mode 100644 contentstack-app/app/styles/app.css delete mode 100644 contentstack-app/app/styles/reset.css delete mode 100644 contentstack-app/app/utils.ts delete mode 100644 contentstack-app/package.json delete mode 100644 contentstack-app/public/favicon.svg delete mode 100644 contentstack-app/remix.config.js delete mode 100644 contentstack-app/remix.env.d.ts delete mode 100644 contentstack-app/server.ts delete mode 100644 contentstack-app/storefrontapi.generated.d.ts delete mode 100644 contentstack-app/tsconfig.json diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..60c6650 --- /dev/null +++ b/.env.template @@ -0,0 +1,28 @@ +# These variables are only available locally in MiniOxygen +# https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables + +## Shopify Environment Variables +# A secret used to sign session cookies. +SESSION_SECRET="foobar" +# The public access token for the Storefront API. +PUBLIC_STOREFRONT_API_TOKEN="" +# The private access token for the Storefront API. +PRIVATE_STOREFRONT_API_TOKEN="" +# The id of the store used to communicate with the Storefront API. +PUBLIC_STOREFRONT_ID="" +# The client id of the public customer account used to communicate with the Storefront API. +PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID="" +# The url of the public customer account used to communicate with the Storefront API. +PUBLIC_CUSTOMER_ACCOUNT_API_URL="" +# The domain of the store used to communicate with the Storefront API. +PUBLIC_STORE_DOMAIN="" + +## Contentstack Environment Variables +# Stack API key +CONTENTSTACK_API_KEY="" +# Delivery token for the Stack +CONTENTSTACK_DELIVERY_TOKEN="" +# Environment name +CONTENTSTACK_ENVIRONMENT="" +# Region name +CONTENTSTACK_REGION="" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0081f9e..b38f8d4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ /.mf .env .shopify -/node_modules -/README 2.md \ No newline at end of file +/node_modules \ No newline at end of file diff --git a/contentstack-app/.eslintignore b/contentstack-app/.eslintignore deleted file mode 100644 index a362bca..0000000 --- a/contentstack-app/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -build -node_modules -bin -*.d.ts -dist diff --git a/contentstack-app/.eslintrc.js b/contentstack-app/.eslintrc.js deleted file mode 100644 index 57a969e..0000000 --- a/contentstack-app/.eslintrc.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @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/contentstack-app/.gitignore b/contentstack-app/.gitignore deleted file mode 100644 index ad5f2ca..0000000 --- a/contentstack-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.shopify diff --git a/contentstack-app/.graphqlrc.yml b/contentstack-app/.graphqlrc.yml deleted file mode 100644 index bd38d07..0000000 --- a/contentstack-app/.graphqlrc.yml +++ /dev/null @@ -1 +0,0 @@ -schema: node_modules/@shopify/hydrogen-react/storefront.schema.json diff --git a/contentstack-app/CHANGELOG.md b/contentstack-app/CHANGELOG.md deleted file mode 100644 index 491e666..0000000 --- a/contentstack-app/CHANGELOG.md +++ /dev/null @@ -1,213 +0,0 @@ -# skeleton - -## 1.0.1 - -### Patch Changes - -- Sync up environment variable names across all example & type files. ([#1542](https://github.com/Shopify/hydrogen/pull/1542)) by [@michenly](https://github.com/michenly) - -- Remove error boundary from robots.txt file in the Skeleton template ([#1492](https://github.com/Shopify/hydrogen/pull/1492)) by [@andrewcohen](https://github.com/andrewcohen) - -- Use the worker runtime by default when running the `dev` or `preview` commands. ([#1525](https://github.com/Shopify/hydrogen/pull/1525)) by [@frandiox](https://github.com/frandiox) - - Enable it in your project by adding the `--worker` flag to your package.json scripts: - - ```diff - "scripts": { - "build": "shopify hydrogen build", - - "dev": "shopify hydrogen dev --codegen", - + "dev": "shopify hydrogen dev --worker --codegen", - - "preview": "npm run build && shopify hydrogen preview", - + "preview": "npm run build && shopify hydrogen preview --worker", - ... - } - ``` - -- Update to the latest version of `@shopify/oxygen-workers-types`. ([#1494](https://github.com/Shopify/hydrogen/pull/1494)) by [@frandiox](https://github.com/frandiox) - - In TypeScript projects, when updating to the latest `@shopify/remix-oxygen` adapter release, you should also update to the latest version of `@shopify/oxygen-workers-types`: - - ```diff - "devDependencies": { - "@remix-run/dev": "2.1.0", - "@remix-run/eslint-config": "2.1.0", - - "@shopify/oxygen-workers-types": "^3.17.3", - + "@shopify/oxygen-workers-types": "^4.0.0", - "@shopify/prettier-config": "^1.1.2", - ... - }, - ``` - -- Update internal dependencies for bug resolution. ([#1496](https://github.com/Shopify/hydrogen/pull/1496)) by [@vincentezw](https://github.com/vincentezw) - - Update your `@shopify/cli` dependency to avoid duplicated sub-dependencies: - - ```diff - "dependencies": { - - "@shopify/cli": "3.50.2", - + "@shopify/cli": "3.51.0", - } - ``` - -- Update all Node.js dependencies to version 18. (Not a breaking change, since Node.js 18 is already required by Remix v2.) ([#1543](https://github.com/Shopify/hydrogen/pull/1543)) by [@michenly](https://github.com/michenly) - -- 🐛 fix undefined menu error ([#1533](https://github.com/Shopify/hydrogen/pull/1533)) by [@michenly](https://github.com/michenly) - -- Add `@remix-run/server-runtime` dependency. ([#1489](https://github.com/Shopify/hydrogen/pull/1489)) by [@frandiox](https://github.com/frandiox) - - Since Remix is now a peer dependency of `@shopify/remix-oxygen`, you need to add `@remix-run/server-runtime` to your dependencies, with the same version as the rest of your Remix dependencies. - - ```diff - "dependencies": { - "@remix-run/react": "2.1.0" - + "@remix-run/server-runtime": "2.1.0" - ... - } - ``` - -- Updated dependencies [[`b2a350a7`](https://github.com/Shopify/hydrogen/commit/b2a350a754ea2d29bc267c260dc298a02f8f4470), [`9b4f4534`](https://github.com/Shopify/hydrogen/commit/9b4f453407338874bd8f1a1f619b607670e021d0), [`74ea1dba`](https://github.com/Shopify/hydrogen/commit/74ea1dba9af37a146882df7ed9674be5659862b5), [`2be9ce82`](https://github.com/Shopify/hydrogen/commit/2be9ce82fd4a5121f1772bbb7349e96ed530e84e), [`a9b8bcde`](https://github.com/Shopify/hydrogen/commit/a9b8bcde96c22cedef7d87631d429199810b4a7a), [`bca112ed`](https://github.com/Shopify/hydrogen/commit/bca112ed7db49e533fe49898b663fa0dd318e6ba), [`848c6260`](https://github.com/Shopify/hydrogen/commit/848c6260a2db3a9cb0c86351f0f7128f61e028f0), [`d53b4ed7`](https://github.com/Shopify/hydrogen/commit/d53b4ed752eb0530622a666ea7dcf4b40239cafa), [`961fd8c6`](https://github.com/Shopify/hydrogen/commit/961fd8c630727784f77b9f693d2e8ff8601969fc), [`2bff9fc7`](https://github.com/Shopify/hydrogen/commit/2bff9fc75916fa95f9a9279d069408fb7a33755c), [`c8e8f6fd`](https://github.com/Shopify/hydrogen/commit/c8e8f6fd233e52cf5570b1904af710d6b907aae5), [`8fce70de`](https://github.com/Shopify/hydrogen/commit/8fce70de32bd61ee86a6d895ac43cc1f78f1bf49), [`f90e4d47`](https://github.com/Shopify/hydrogen/commit/f90e4d4713c6c1fc1e921a7ecd08e95fe5da1744), [`e8cc49fe`](https://github.com/Shopify/hydrogen/commit/e8cc49feff18f5ee72d5f6965ff2094addc23466)]: - - @shopify/cli-hydrogen@6.1.0 - - @shopify/remix-oxygen@2.0.2 - - @shopify/hydrogen@2023.10.3 - -## 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) =>