From 91b40b01ee37aec26261f4bfead457a8a588040a Mon Sep 17 00:00:00 2001 From: hta218 Date: Thu, 13 Jun 2024 09:28:37 +0700 Subject: [PATCH 1/2] Update readme & instructions --- LICENSE.md | 2 +- README.md | 31 +++-------------------- guides/customer-account-api.md | 22 ++++++++++++++++ sync-project.md => guides/sync-project.md | 16 ++++++------ 4 files changed, 35 insertions(+), 36 deletions(-) create mode 100644 guides/customer-account-api.md rename sync-project.md => guides/sync-project.md (59%) diff --git a/LICENSE.md b/LICENSE.md index 172351b7..040b078b 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2023-present, Weaverse JSC. +Copyright 2024-present, Weaverse JSC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 03ce894d..41c25654 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,11 @@ _Pilot is an innovative Shopify theme, powered by Hydrogen, Remix, and Weaverse, ## Demo -- [Live store](https://pilot.weaverse.dev) -- Try customizing Pilot on [Weaverse Playground](https://studio.weaverse.io/demo) +- Live store: https://pilot.weaverse.dev +- Try customizing Pilot on Weaverse Playground: https://studio.weaverse.io/demo ![demo](https://cdn.shopify.com/s/files/1/0693/8201/3220/files/Home.png?v=1695816170) ## What's included - - Remix - Hydrogen - Oxygen @@ -27,6 +26,7 @@ _Pilot is an innovative Shopify theme, powered by Hydrogen, Remix, and Weaverse, - GraphQL generator - TypeScript and JavaScript flavors - Tailwind CSS (via PostCSS) +- New Shopify customer account API - Full-featured setup of components and routes - Fully customizable inside [Weaverse](https://weaverse.io) @@ -163,7 +163,7 @@ function App() { export default withWeaverse(App); ``` -### Create a section +### Create a section/component To create a section, you need to create a new file in [`app/sections`](app/sections) directory and register it in [`app/weaverse/components.ts`](app/weaverse/components.ts) file. @@ -272,29 +272,6 @@ Weaverse provides a convenient way to customize your theme inside the **Weaverse ![Weaverse Editor](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/playground.jpg?v=1699244445) -## Setup for using Customer Account API (`/account`) - -1. Run development with `--customer-account-push__unstable` flag to start the server with a tunnel to expose the local server to the public domain. - -```bash -shopify hydrogen dev --codegen --port 3456 --customer-account-push__unstable -``` - -Or quicker way with: - -```bash -npm run dev:ca -``` - -### Include public domain in Customer Account API settings - -After run the server with `--customer-account-push__unstable` flag, you will get a public domain like `https://.tryhydrogen.dev`. And it should be automatically added to the Customer Account API settings. If not, you can manually add it by following these steps: - -1. Go to your Shopify admin => `Hydrogen` or `Headless` app/channel => Customer Account API => Application setup -2. Edit `Callback URI(s)` to include `https://.tryhydrogen.dev/account/authorize` -3. Edit `Javascript origin(s)` to include your public domain `https://.tryhydrogen.dev` or keep it blank -4. Edit `Logout URI` to include your public domain `https://.tryhydrogen.dev` or keep it blank - ### Local development inspects - Hydrogen app: http://localhost:3456 diff --git a/guides/customer-account-api.md b/guides/customer-account-api.md new file mode 100644 index 00000000..72490076 --- /dev/null +++ b/guides/customer-account-api.md @@ -0,0 +1,22 @@ +## Setup for using Customer Account API (`/account`) + +1. Run development with `--customer-account-push__unstable` flag to start the server with a tunnel to expose the local server to the public domain. + +```bash +shopify hydrogen dev --codegen --port 3456 --customer-account-push__unstable +``` + +Or quicker way with: + +```bash +npm run dev:ca +``` + +### Include public domain in Customer Account API settings + +After run the server with `--customer-account-push__unstable` flag, you will get a public domain like `https://.tryhydrogen.dev`. And it should be automatically added to the Customer Account API settings. If not, you can manually add it by following these steps: + +1. Go to your Shopify admin => `Hydrogen` or `Headless` app/channel => Customer Account API => Application setup +2. Edit `Callback URI(s)` to include `https://.tryhydrogen.dev/account/authorize` +3. Edit `Javascript origin(s)` to include your public domain `https://.tryhydrogen.dev` or keep it blank +4. Edit `Logout URI` to include your public domain `https://.tryhydrogen.dev` or keep it blank diff --git a/sync-project.md b/guides/sync-project.md similarity index 59% rename from sync-project.md rename to guides/sync-project.md index 52d1a878..6c849735 100644 --- a/sync-project.md +++ b/guides/sync-project.md @@ -1,11 +1,12 @@ ### How to make your own project in sync with the original pilot project -Once you've cloned the pilot project, and put it into your own github account, you'll want to keep it in sync with the +Once you've cloned the pilot project, and put it into your own Github account, you'll want to keep it in sync with the original pilot project. This is a good idea because the original pilot project will be updated with new features and bug fixes. -Here is the manual way to do it with rsync: -1. Clone the original pilot project into a directory called `pilot`: +Here is the manual way to do it with `rsync`: + +1. Clone the latest `pilot` project into a directory called `pilot`: ```bash git clone git@github.com:Weaverse/pilot.git @@ -13,13 +14,12 @@ Here is the manual way to do it with rsync: 2. Put your own pilot project into a same level directory. -3. Run the following command to sync your project with the original pilot project, Keep in mind to - replace `your-pilot-project` with the name of your own pilot project. +3. Run the following command to sync your project with the original pilot project, Keep in mind to replace `your-pilot-project` with the name of your own pilot project. ```bash - rsync -arv --exclude=node_modules --exclude=.git --exclude=.cache --exclude=.turbo --exclude=dist --exclude=.env ./pilot/ ./your-pilot-project + rsync -arv --exclude=node_modules --exclude=.git --exclude=.cache --exclude=.turbo --exclude=dist --exclude=.env ./pilot/ ./ ``` 4. Commit and push your changes to your own pilot project. -5. It is recommended to run the sync command every time you want to update your project with the latest changes from the - original pilot project. + +5. It is recommended to run the sync command every time you want to update your project with the latest changes from the original pilot project. From f9aea7e017dbf6c2bf156f2f3d60224e9aa77df4 Mon Sep 17 00:00:00 2001 From: hta218 Date: Thu, 13 Jun 2024 10:03:32 +0700 Subject: [PATCH 2/2] Update @weaverse/hydrogen to version 3.1.14 --- package-lock.json | 30 +++++++++++++----------------- package.json | 2 +- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7a3ad2d..dee5a5d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@shopify/cli-hydrogen": "8.0.4", "@shopify/hydrogen": "2024.4.1", "@shopify/remix-oxygen": "2.0.4", - "@weaverse/hydrogen": "3.1.12", + "@weaverse/hydrogen": "^3.1.14", "class-variance-authority": "0.7.0", "clsx": "2.1.1", "cross-env": "7.0.3", @@ -8301,8 +8301,7 @@ "node_modules/@stitches/core": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", - "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==", - "license": "MIT" + "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" }, "node_modules/@swc/helpers": { "version": "0.5.11", @@ -9014,10 +9013,9 @@ "devOptional": true }, "node_modules/@weaverse/core": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/@weaverse/core/-/core-3.1.12.tgz", - "integrity": "sha512-FgWFl3UJWIKbwTvDq9xR+lFtxtNRJvaYPcX0BUqAZgRiO/3x1SJYHKMuPiKyRr8SF/W1NSwbf0Y4LKS42fYQFg==", - "license": "MIT", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@weaverse/core/-/core-3.1.14.tgz", + "integrity": "sha512-G+MnfDouT8Q/6CMPJmZ3KacrpHarF3FS0QKLFkq5X0jKPFw8s2SHLvA6ZDCB6nN4GuNOgMvjST8vJMZfReYf0g==", "dependencies": { "@stitches/core": "^1.2.8" }, @@ -9026,12 +9024,11 @@ } }, "node_modules/@weaverse/hydrogen": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/@weaverse/hydrogen/-/hydrogen-3.1.12.tgz", - "integrity": "sha512-w0n3KGf6nMLAyan7txbmPhLn2muZQdsDGrvTTnOdag3Gr41vPWjcCE1yVx7AXifNHZJJpCnBaMydPO5ckCzHLQ==", - "license": "MIT", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@weaverse/hydrogen/-/hydrogen-3.1.14.tgz", + "integrity": "sha512-bMISL+/D0qkCVCfDNPQG3Vz7ThzkXE9xUd8ChtBLlO7A06fN6rkunAEu1ekrGop1t5mU6tFMycovovhU4yTbhA==", "dependencies": { - "@weaverse/react": "3.1.12", + "@weaverse/react": "3.1.14", "react-error-boundary": "^4.0.13" }, "engines": { @@ -9045,12 +9042,11 @@ } }, "node_modules/@weaverse/react": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/@weaverse/react/-/react-3.1.12.tgz", - "integrity": "sha512-G063vYo7ZBVNiwxPdOgeFHMK7WFW240GxQ3C9Ao26if6vn2+2sxT92I2gHkc13fTIwYCgCxH9Nm4UVN/Q4/WaQ==", - "license": "MIT", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@weaverse/react/-/react-3.1.14.tgz", + "integrity": "sha512-uHiHXx9w4QTDDs+kJxYQjjVyfMrLbJRc0e2/EJoF1ZtrY05xdDVfv6Vr0x2j91ZslCb+teYOxKlcU/b+qXU0sg==", "dependencies": { - "@weaverse/core": "3.1.12", + "@weaverse/core": "3.1.14", "clsx": "^2.1.1" }, "engines": { diff --git a/package.json b/package.json index 4d7aea70..96067f2b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@shopify/cli-hydrogen": "8.0.4", "@shopify/hydrogen": "2024.4.1", "@shopify/remix-oxygen": "2.0.4", - "@weaverse/hydrogen": "3.1.12", + "@weaverse/hydrogen": "^3.1.14", "class-variance-authority": "0.7.0", "clsx": "2.1.1", "cross-env": "7.0.3",