carstenlebek / shopify-node-app-starter

🚀🚀 A Shopify embedded app starter template, written in TypeScript with session storage, app context and examples for basic functionalities.
https://typescript-next-shopify-app.vercel.app
MIT License
172 stars 29 forks source link

How to integrate in app-extensions with Shopify #13

Open ivanleomk opened 2 years ago

ivanleomk commented 2 years ago

Hi there,

Thanks for making this amazing template, really helps to make shopify app dev much easier. I'm currently hoping to add in some extensions, in particular the checkout button ( Something like this : https://shopify.dev/apps/checkout/delivery-instructions )

How do you suggest doing so? Not too sure how i might go about doing so since the layout of the folder is a bit different as compared to the scaffolded one by shopify-cli

aimproxy commented 2 years ago

That's a good question I also would like to hear @carstenlebek opinion, but I am more interested if we could replace all the CLI garbage with the original CLI package?

alexandrosk commented 2 years ago

That's a good question I also would like to hear @carstenlebek opinion, but I am more interested if we could replace all the CLI garbage with the original CLI package?

I feel like there's no way, I'm actually trying to add an express server over this build but wasn't succesful, so right now just trying to go back to a nodejs app..

alexandrosk commented 2 years ago

I'm trying to think ways to make this work with shopify cli, so it will be plug n play with anything CLI related like theme app extensions etc, I'm trying to move everything to a folder inside like the frontend, but we're missing a "main": "web/index.js", that doesn't exist on this repo. @aimproxy

e9aru commented 1 year ago

I managed to make it work with a theme app extension, here are the steps I did. Maybe it will work for you as well :)

  1. Install latest @shopify/cli and @shopify/app
  2. Add 2 package.json scripts:
    "generate-extension": "shopify app generate extension",
    "deploy": "shopify app deploy",
  3. Create a minimalistic shopify.app.toml file in root directory:
    name = "Your App Name"
    extension_directories = ["extensions/*"]
  4. Run npm run generate-extension - this will fire a extension creator which asks you what ext type you want (I believe a theme type was option 12)
  5. You should now have a extensions directory in your root
  6. Work with your extension and deploy it when ready with npm run deploy