react-storefront-edge
v12.1.0-alpha.0
Published
Configures the Moovweb XDN outer edge based on your react-storefront router.
Downloads
6
Readme
react-storefront-edge
Provides a react-storefront webpack build that produces oem.json.
Usage in react-storefront
Starting with react-storefront v6.73.0, developers can no longer use react-storefront's built in webpack edge build config. That has been replaced with a stub that instructs users to install react-storefront-edge. They can install [email protected] to keep the existing functionality.
Versioning
The version number of this library corresponds to the outer edge manager version emitted in oem.json. Only the major part of the number is included. So for example, in react-storefront-edge v4.0.1, version: '4'
will be set in oem.json.
Design
This package is comprised of three main components:
webpack/index.js
Provides the webpack config for building the edge bundle. This is used in react-storefront apps by adding the following file to (app home)/config/webpack/webpack.prod.edge.js
:
// config/webpack/webpack.prod.edge.js
const edge = require('react-storefront-edge/webpack')
const path = require('path')
module.exports = edge(path.join(__dirname, '..', '..'), {
router: 'src/routes.js'
})
webpack/OEMConfigWriterPlugin.js
A webpack plugin that uses EdgeConfigFactory to derive oem.json from the provided router.
EdgeConfigFactory
Does all of the heavy lifting. Takes an instance of react-storefront/router/Router
and emits oem.json.
Development
After cloning the repo run:
nvm use
yarn install && yarn run link
Then, to link to your react-storefront app, run the following in the root of the app:
npm run dev:link
Running Tests
yarn test
Publishing a new version
This package is published to npmjs.org. Each PR should update the version number according to the type of change made (major/minor/patch). Once all PRs are merged, edit and publish the release created by release-drafter in GitHub. A GitHub action will automatically publish the package to NPM.