How do I edit and add to components in a PWA Studio React application?
Using the buildpack
tool, I've installed the PWA scaffolding with the following command.
buildpack create-project /tmp/zing \
--template "venia-concept"\
--name "zing"\
--author "me <[email protected]>"\
--backend-url "https://mymagentourl.example.om/"\
--braintree-token "a token" \
--npm-client "npm"\
--no-install
This gives me a Node.js application in the zing
folder. If I start this application in developer/watch mode
$ cd zing
$ npm install
$ npm run watch
I get a server at http://localhost:10000
that serves out a React based application AND acts as PWA Studio's Upward server. Communication between my Upward server and Magento instance appears to be working -- the Venia application is grabbing the Venia sample data in installed in my Magento instance.
What's unclear to me is: Where are my React components? How do I start editing the existing Venia application and/or adding my own components to this application?
In src/index.js
folder I see a bunch of bootstrapping code, including this
#File: src/index.js
// ...
import { Adapter } from '@magento/venia-drivers';
// ...
import App, { AppContextProvider } from '@magento/venia-ui/lib/components/App';
// ...
ReactDOM.render(
<Adapter apiBase={apiBase} apollo={{ link: apolloLink }} store={store}>
<AppContextProvider>
<App />
</AppContextProvider>
</Adapter>,
document.getElementById('root')
);
I presume (but am uncertain that) this is <Adapter/>
is the top level React component?
Regardless of that, it's unclear what starts adding the real UI to the <App/>
component, and what/where I'm meant to be writing code.
Is there a straight forward answer to this?