capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
335 stars 59 forks source link

capacitor ignores platform @capacitor-community/electron #178

Closed andidevi closed 2 years ago

andidevi commented 2 years ago

Describe the bug After adding @capacitor-community/electron as a platform capacitor commands like copy and sync don't work for that platform.

To Reproduce

 cd to some empty directory
 npm install @ionic/cli
 npx ionic start IonicTest tabs --type=react
 cd IonicTest

add electron according to https://capacitor-community.github.io/electron/docs/gettingstarted and test it. look for the name of the first tab (Tab 1)

npx ionic build
npm i @capacitor-community/electron
npx cap add @capacitor-community/electron
npx cap open @capacitor-community/electron

Now edit src/pages/Tab1.tsx and change the content of the tag IonTitle from "Tab 1" to something else, ie. "Tab 1x". Copy over to the projects and watch, that only "web" get's updated:

npx cap copy

Yes, the new name is there in web, as you can see in the browser window opened by

npx ionic serve

Close browser, return to the terminal, stop the serve with Ctrl-c. Then open @capacitor-community/electron and the title of the tab did not update:

npx cap open @capacitor-community/electron

Expected behavior

Updates to src, should be copied to the electron app, ie. the Tab should now be called "Tab 1x" instead of "Tab 1".

Screenshots N/A

Desktop (please complete the following information):

Smartphone (please complete the following information):

N/A

Additional context

jepiqueau commented 2 years ago

You have to do npx cap copy @capacitor-community/electron each time after a build like you do npx cap copy for iOS, Android and Web

andidevi commented 2 years ago

Maybe there should be some hint, that this will not register to capacitor and will not run at "npx cap anything" like web, ios and android.

I did not find any capacitor command that runs "npm install". That's why "npx cap open @capacitor-community/electron" fails when you don't commit you electron/node_modules.