This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Targetables } = require('@magento/pwa-buildpack') | |
module.exports = targets => { | |
const targetables = Targetables.using(targets); | |
const MainComponent = targetables.reactComponent( | |
'@magento/venia-ui/lib/components/Header/header.js' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = targets => { | |
const veniaTargets = targets.of('@magento/venia-ui'); | |
const routes = veniaTargets.routes; | |
routes.tap( | |
routesArray => { | |
routesArray.push({ | |
name: 'New route', | |
pattern: '/new-route', | |
path: '@organization/module' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport { arrayOf, bool, number, shape, string } from 'prop-types'; | |
import { Form } from 'informed'; | |
import { Price } from '@magento/peregrine'; | |
import { useProductFullDetail } from '@magento/peregrine/lib/talons/ProductFullDetail/useProductFullDetail'; | |
import { isProductConfigurable } from '@magento/peregrine/lib/util/isProductConfigurable'; | |
import { mergeClasses } from '@magento/venia-ui/lib/classify'; | |
import Breadcrumbs from '@magento/venia-ui/lib/components/Breadcrumbs'; | |
import Button from '@magento/venia-ui/lib/components/Button'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const componentOverrideMapping = require('./componentOverrideMapping'); | |
const moduleOverridePlugin = require('./moduleOverrideWebpackPlugin'); | |
module.exports = targets => { | |
targets.of('@magento/pwa-buildpack').specialFeatures.tap(flags => { | |
flags[targets.name] = {esModules: true}; | |
}); | |
targets.of('@magento/pwa-buildpack').webpackCompiler.tap(compiler => { | |
new moduleOverridePlugin(componentOverrideMapping).apply(compiler); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const glob = require('glob'); | |
module.exports = class NormalModuleOverridePlugin { | |
constructor(moduleOverrideMap) { | |
this.name = 'NormalModuleOverridePlugin'; | |
this.moduleOverrideMap = moduleOverrideMap; | |
} | |
requireResolveIfCan(id, options = undefined) { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = componentOverride = { | |
[`@magento/venia-ui/lib/components/ProductFullDetail/productFullDetail.js`]: './lib/components/ProductFullDetail/productFullDetail.js', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "@marcinkwiatkowski/venia-ui-overwrites", | |
"version": "1.0.0", | |
"description": "", | |
"author": "Marcin Kwiatkowski <contact@frodigo.com>", | |
"license": "MIT", | |
"pwa-studio": { | |
"targets": { | |
"intercept": "intercept.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mdir -p packages/venia-ui-overwrites | |
touch packages/venia-ui-overwrites/package.json | |
touch packages/venia-ui-overwrites/componentOverrideMapping.js | |
touch packages/venia-ui-overwrites/moduleOveriddeWebpackPlugin.js | |
touch packages/venia-ui-overwrites/intercept.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export { default } from './short-description'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// short-description.js | |
<div className={classes.root}> | |
<div className={classes.section}> | |
<RichText content={shortDescription} /> | |
</div> | |
</div> |