Skip to content
Open
Show file tree
Hide file tree
Changes from 171 commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
02e1334
initial implementation of extension seo url mapping extension
hajinsuha1 Feb 26, 2025
41b34a7
make beforeRouteMatch async
hajinsuha1 Feb 26, 2025
87567d8
generate component map from react-sdk util function
hajinsuha1 Feb 26, 2025
0a42f90
use a component map that maps resource type to component display name
hajinsuha1 Feb 27, 2025
9b1dada
move logic from beforeRouteMatch to extendRoutes
hajinsuha1 Feb 27, 2025
b8505d0
make extendRoutes async
hajinsuha1 Feb 27, 2025
74ea27a
pass request to extendRoutes
hajinsuha1 Mar 3, 2025
5988996
add route serialization
hajinsuha1 Mar 3, 2025
61839ff
make category urlMappings work
hajinsuha1 Mar 3, 2025
1a8d1be
make urlMapping resourceType product work
hajinsuha1 Mar 4, 2025
8380df6
cleanup
hajinsuha1 Mar 4, 2025
182f7b6
move serializing to pwa-kit-react-sdk
hajinsuha1 Mar 4, 2025
babf5ab
move transformUrlMappingToRoute from pwa-kit-react-sdk to extension-s…
hajinsuha1 Mar 5, 2025
3651f4e
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 Mar 5, 2025
efdc0c5
cleanup
hajinsuha1 Mar 5, 2025
2d1031f
update package.json and package-lock.json in template-typescript-minimal
hajinsuha1 Mar 5, 2025
5e45dac
attempt to fix component not loading with props on server side
hajinsuha1 Mar 5, 2025
f178dec
implement route serialization/deserialization
hajinsuha1 Mar 5, 2025
cfd82eb
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 5, 2025
7b8b80b
initial pass at implementing route serialization via a componentMap
hajinsuha1 Mar 7, 2025
4f30443
update error handling message format
hajinsuha1 Mar 7, 2025
c78b81b
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 7, 2025
55c4415
cleanup and fix getRoutes to not duplicate routes
hajinsuha1 Mar 7, 2025
5da9d8e
Convert extendRoutes to an async method
vmarta Mar 8, 2025
4d13fe3
create a helper function generateComponentMapFromModules
hajinsuha1 Mar 10, 2025
8a54875
Add todos
vmarta Mar 10, 2025
4604d76
Temporarily modify the typescript-minimal project
vmarta Mar 10, 2025
e6542fc
initial impl of adding base template components to component map
hajinsuha1 Mar 10, 2025
7a1f51f
Minor refactoring
vmarta Mar 10, 2025
ddb88d2
Call every extension's route function in parallel
vmarta Mar 10, 2025
138f44b
create a prefixDisplayName utils
hajinsuha1 Mar 11, 2025
3bfa646
update error handling
hajinsuha1 Mar 11, 2025
2054078
fix deserialization of components from pwa-kit-react-sdk
hajinsuha1 Mar 11, 2025
a547b24
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 11, 2025
63a9d1f
merge
hajinsuha1 Mar 11, 2025
d90c79c
initial implementation of serialize/deserialize
hajinsuha1 Mar 12, 2025
c67fefa
cleanup
hajinsuha1 Mar 12, 2025
af9f3df
make serialize() and getComponentMap() synchronous
hajinsuha1 Mar 13, 2025
b002c86
Pass in the request path
vmarta Mar 13, 2025
bd74cf8
cache getRoutes using CacheResult decorator
hajinsuha1 Mar 14, 2025
b84c8c3
move deserialization logic to constructor of ApplicationExtension
hajinsuha1 Mar 14, 2025
3a9f90d
call this.getComponentMap within deserialize and fix typing
hajinsuha1 Mar 14, 2025
4a3a6ce
cleanup serialize logic
hajinsuha1 Mar 14, 2025
6d92af9
Explore passing in locals and how to manage access token
vmarta Mar 14, 2025
9f6c055
Remove extendRoutes from the API
vmarta Mar 15, 2025
6d5fb39
Allow configuring of the auth property name in locals
vmarta Mar 15, 2025
0115d21
comments + create DeserializedExtension type
hajinsuha1 Mar 17, 2025
fa85193
make getComponentMap abstract
hajinsuha1 Mar 17, 2025
040e3f1
add ComponentMap type to getComponentMap method in ChakraStorefront a…
hajinsuha1 Mar 17, 2025
86a78ed
add displayName to StoreLocatorPage
hajinsuha1 Mar 17, 2025
0a7e855
Rename the property in locals
vmarta Mar 17, 2025
9acff92
add unit tests for cacheResult
hajinsuha1 Mar 17, 2025
c5d924b
Create a new extension for a better example
vmarta Mar 17, 2025
2206dd5
Add some console logs
vmarta Mar 17, 2025
392387a
refactor Switch component to use RoutesProvider and create RoutesCons…
hajinsuha1 Mar 17, 2025
0c1bd41
update CacheResult decorator to support async methods and modify test…
hajinsuha1 Mar 17, 2025
08e72bd
enhance CacheResult decorator to support both async and sync methods …
hajinsuha1 Mar 18, 2025
0dbbb34
refactor getRoutes method to support both sync and async returns and …
hajinsuha1 Mar 18, 2025
8324897
refactor ApplicationExtension to enforce getComponentMap() for async …
hajinsuha1 Mar 18, 2025
5586726
cleanup ApplicationExtension and apply CacheResult to getRoutes metho…
hajinsuha1 Mar 18, 2025
645a91f
move CacheResult decorator logic to applyCacheForMethod in Applicatio…
hajinsuha1 Mar 18, 2025
d0ffc37
don't make getComponentMap abstract but make it optional
hajinsuha1 Mar 18, 2025
f97aaed
remove unused ComponentMap import from test files
hajinsuha1 Mar 18, 2025
42879f5
Experiment with having partial route
vmarta Mar 18, 2025
b71c0b9
Experiment with correct way to get app origin
vmarta Mar 18, 2025
bb692bc
Add todo
vmarta Mar 18, 2025
0d2ed3b
Some cleanup
vmarta Mar 18, 2025
35a453e
lint
hajinsuha1 Mar 19, 2025
272639f
cleanup
hajinsuha1 Mar 19, 2025
2067892
Fix the partial route with correct path
vmarta Mar 19, 2025
0e44b84
Remove no longer necessary code
vmarta Mar 19, 2025
1579626
Combine params into a single object
vmarta Mar 19, 2025
806fa87
Remove some console logs
vmarta Mar 19, 2025
85f9516
add async route handling and serialization tests for ApplicationExten…
hajinsuha1 Mar 19, 2025
11b5af3
Add comment to clarify
vmarta Mar 19, 2025
6402e62
handle all condiiton in deserialize and move applyCacheForMethod to a…
hajinsuha1 Mar 19, 2025
e8bba80
refactor: rename getRoutes to getRoutesAsync for clarity and update r…
hajinsuha1 Mar 19, 2025
af93217
refactor: remove isGetRoutesAsync method as it's no longer needed
hajinsuha1 Mar 19, 2025
579bdf3
Implement getRoutes and getRoutesAsync
vmarta Mar 20, 2025
18adf16
Add comment
vmarta Mar 20, 2025
d9b32e2
Add comment
vmarta Mar 20, 2025
4ad2535
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 20, 2025
965a34a
update getRoutesAsync to also return SerializedRoute and serialize to…
hajinsuha1 Mar 20, 2025
6baf649
cleanup decorator and chakra-storefront
hajinsuha1 Mar 20, 2025
5dbe489
update URLMapping.getRoutesAsync and BeforeRouteMatchParams to suppor…
hajinsuha1 Mar 20, 2025
26da1ee
address PR feedback
hajinsuha1 Mar 20, 2025
f1eab7c
update error message
hajinsuha1 Mar 20, 2025
0a1626c
fix cacheMethodResult
hajinsuha1 Mar 20, 2025
c622823
Add type to allow for `componentName` property
vmarta Mar 20, 2025
92a1c9a
fix ApplicationExtension.test.tsx
hajinsuha1 Mar 20, 2025
f615878
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 20, 2025
38e352f
Remove params for `getRoutes`
vmarta Mar 20, 2025
4119cda
Remove params for getRoutes
vmarta Mar 20, 2025
6677213
refactor: update route handling to use RouteProps exclusively and imp…
hajinsuha1 Mar 20, 2025
0058e80
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 20, 2025
fa4540a
refactor: rename GetRoutesParams to GetRoutesAsyncParams for to fix e…
hajinsuha1 Mar 20, 2025
4af8642
update unit tests
hajinsuha1 Mar 20, 2025
7fdd261
Revert "Remove params for `getRoutes`"
vmarta Mar 20, 2025
bcdcea3
Revert "Remove params for getRoutes"
vmarta Mar 20, 2025
7b48662
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 21, 2025
62e0060
reorganize imports for RoutesContext and unit tests
hajinsuha1 Mar 21, 2025
347c486
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 21, 2025
de121c3
Add isServerSide utility function and corresponding tests
hajinsuha1 Mar 21, 2025
2152142
lint
hajinsuha1 Mar 21, 2025
ab23cd6
[REVERT] temporary logging for testing
hajinsuha1 Mar 21, 2025
5236d90
Remove unused properties from global Window interface in type definit…
hajinsuha1 Mar 21, 2025
131f670
update changelog
hajinsuha1 Mar 21, 2025
6e257cd
Refactor so that extension is the one in control of serialization
vmarta Mar 21, 2025
edcae1d
Update packages/pwa-kit-extension-sdk/src/react/classes/ApplicationEx…
hajinsuha1 Mar 24, 2025
04ee8fb
update unit tests and add error handling
hajinsuha1 Mar 24, 2025
c6be840
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 24, 2025
c8e8035
lint
hajinsuha1 Mar 24, 2025
88419bf
lint
hajinsuha1 Mar 24, 2025
e9c00dd
lint extension-url-mapping
hajinsuha1 Mar 24, 2025
4d2587a
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 24, 2025
1de2122
Update comments
vmarta Mar 24, 2025
38425c2
Update tests
vmarta Mar 24, 2025
2f1a48a
rename extension-url-mapping to extension-commerce-bm-seo
hajinsuha1 Mar 24, 2025
2bcbbc2
Update tests
vmarta Mar 24, 2025
7ba4d99
Revert changes to typescript-minimal
vmarta Mar 24, 2025
7c731f2
Merge branch 'feature/extensibility-v2' into vm/async-extendRoutes
vmarta Mar 24, 2025
a2096c3
Update package-lock.json
vmarta Mar 24, 2025
18a566f
Update changelog files
vmarta Mar 24, 2025
0e0edcb
Update readme files
vmarta Mar 24, 2025
422bd78
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 25, 2025
7ed9fbd
Refactor ApplicationExtension tests to use correct component types an…
hajinsuha1 Mar 25, 2025
e08d7ce
Remove extension-url-mapping package and associated files
hajinsuha1 Mar 25, 2025
bab7884
fix unit tests
hajinsuha1 Mar 25, 2025
c594557
Revert "Remove extension-url-mapping package and associated files"
hajinsuha1 Mar 25, 2025
794b0a3
lint
hajinsuha1 Mar 25, 2025
0cd67cc
Revert "Revert changes to typescript-minimal"
hajinsuha1 Mar 25, 2025
54ec28a
remove extension-url-mapping, logging, changes to typescript-minimal
hajinsuha1 Mar 25, 2025
6d7c6a9
update maxSize for build/vendor.js to 353 kB in template-retail-react…
hajinsuha1 Mar 25, 2025
12b071b
update CHANGELOG.md for template-retail-react-app
hajinsuha1 Mar 25, 2025
fc461cd
add ResourceTypeToComponentMap and move functions to utils
hajinsuha1 Mar 25, 2025
5f5de44
Add jsdoc to some types
vmarta Mar 25, 2025
ad8933a
Update packages/pwa-kit-extension-sdk/src/react/classes/ApplicationEx…
hajinsuha1 Mar 26, 2025
f65cf58
address PR feedback (remove unnecessary code)
hajinsuha1 Mar 26, 2025
876b4c2
Revert "remove extension-url-mapping, logging, changes to typescript-…
hajinsuha1 Mar 26, 2025
ad6d337
update ApplicationExtension unit test
hajinsuha1 Mar 26, 2025
f05a70a
Revert "Revert "remove extension-url-mapping, logging, changes to typ…
hajinsuha1 Mar 26, 2025
16f461b
Merge branch 'vm/async-extendRoutes' into route-serialization-to-supp…
hajinsuha1 Mar 26, 2025
7aa5a85
Revert "remove extension-url-mapping, logging, changes to typescript-…
hajinsuha1 Mar 26, 2025
c9a58da
Merge branch 'route-serialization-to-support-shopper-seo-integration'…
hajinsuha1 Mar 28, 2025
b01d659
refactor such that extension-commerce-bm-seo handles deserialization …
hajinsuha1 Mar 31, 2025
0751fd9
refactor serialize and deserialize to be serializeRoutes and deserial…
hajinsuha1 Mar 31, 2025
8017fa6
cleanup beforeRouteMatch
hajinsuha1 Mar 31, 2025
d3b5651
cleanup
hajinsuha1 Mar 31, 2025
07d7da0
address PR feedback
hajinsuha1 Apr 1, 2025
0fe9e28
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 Apr 16, 2025
90fabe5
lint
hajinsuha1 Apr 16, 2025
ef43d50
support redirect url mappings
hajinsuha1 Apr 21, 2025
03dda35
attempt passing props to ProductDetail/ProductList component
hajinsuha1 Apr 21, 2025
a0c8a18
fix placeholder component
hajinsuha1 Apr 22, 2025
5f11e34
refactor to make setup-app more readable
hajinsuha1 Apr 22, 2025
b4a23f2
implementation where PLP and PDP on client side doesn't get props
hajinsuha1 Apr 25, 2025
12e4116
implement option 1 add componentProps to RouteProps and serialize it
hajinsuha1 Apr 25, 2025
ac3cf68
make deserialization work for both extension-seo and regular extensions
hajinsuha1 Apr 29, 2025
9129a42
remove logging
hajinsuha1 Apr 29, 2025
3782fb9
allow extension-seo to work regardless of whether it is before/after …
hajinsuha1 Apr 29, 2025
6ed3ffa
add AsyncRouteProps type
hajinsuha1 Apr 29, 2025
0de2b6a
remove getComponentName utility method
hajinsuha1 Apr 29, 2025
8382e9a
cleanup
hajinsuha1 Apr 29, 2025
a27ce96
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 Apr 29, 2025
0096116
reorganize utils
hajinsuha1 Apr 29, 2025
da93df5
support unit tests
hajinsuha1 Apr 29, 2025
b42d623
add jest.config.js (copied from extension-chakra-store-locator)
hajinsuha1 Apr 29, 2025
ceae1c5
add component-utils unit tests
hajinsuha1 Apr 30, 2025
78837c1
remove path from config and add shopper-seo-utils unit tests
hajinsuha1 Apr 30, 2025
a2113da
initial README.md
hajinsuha1 May 1, 2025
6cfecf0
update README
hajinsuha1 May 2, 2025
613813e
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 May 5, 2025
be17100
hardcode __commerceAPIAuth property in locals and use getAppOrigin fr…
hajinsuha1 May 5, 2025
366c74b
cleanup
hajinsuha1 May 5, 2025
c4a432f
Merge branch 'implement-dynamic-update-routes' of https://github.com/…
hajinsuha1 May 5, 2025
cc4714b
fix type errors
hajinsuha1 May 5, 2025
ade541e
Revert to test changes
hajinsuha1 May 5, 2025
44dcdc7
Revert "Revert to test changes"
hajinsuha1 May 5, 2025
3adf867
cleanup
hajinsuha1 May 5, 2025
4b91cbd
REVERT TO TEST CHANGES
hajinsuha1 May 5, 2025
6a1caee
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 May 5, 2025
93f6789
fix failing CI
hajinsuha1 May 5, 2025
70dcfb1
fix unit tests
hajinsuha1 May 5, 2025
1a3fda9
Merge branch 'feature/extensibility-v2' into implement-dynamic-update…
hajinsuha1 May 8, 2025
c78d0cd
[App Extensibility ⚙️] Remove `extension-` prefix requirement (@W-181…
adamraya May 5, 2025
1bdf645
fix failing CI
hajinsuha1 May 5, 2025
83332ff
fix unit tests
hajinsuha1 May 5, 2025
c0b0803
Merge branch 'implement-dynamic-update-routes' of https://github.com/…
hajinsuha1 May 8, 2025
07598e4
add comment for W-18474745 todo
hajinsuha1 May 8, 2025
75c2a0c
Bump version to 0.1.0-extensibility-preview.5 and update dependencies…
hajinsuha1 May 8, 2025
1d524d1
TEST CHANGES
hajinsuha1 May 8, 2025
98a5011
Revert this commit to TEST CHANGES
hajinsuha1 May 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {useHistory, useLocation, useParams} from 'react-router-dom'
import {useToast} from '../../hooks/use-toast'
import {useWishList} from '../../hooks/use-wish-list'

const ProductDetail = () => {
const ProductDetail = (props) => {
const {formatMessage} = useIntl()
const history = useHistory()
const location = useLocation()
Expand All @@ -77,7 +77,11 @@ const ProductDetail = () => {
}

/*************************** Product Detail and Category ********************/
const {productId} = useParams()
let {productId} = useParams()
if (props.productId) {
productId = props.productId
}

const urlParams = new URLSearchParams(location.search)
const {
data: product,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ const ProductList = (props) => {
let searchQuery = urlParams.get('q')
const isSearch = !!searchQuery

if (params.categoryId) {
searchParams._refine.push(`cgid=${params.categoryId}`)
const categoryId = props?.categoryId || params?.categoryId
if (categoryId) {
searchParams._refine.push(`cgid=${categoryId}`)
}

/**************** Mutation Actions ****************/
Expand Down Expand Up @@ -179,11 +180,11 @@ const ProductList = (props) => {
const {error, data: category} = useCategory(
{
parameters: {
id: params.categoryId
id: categoryId
}
},
{
enabled: !isSearch && !!params.categoryId
enabled: !isSearch && !!categoryId
}
)

Expand Down
10 changes: 10 additions & 0 deletions packages/extension-commerce-bm-seo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

module.exports = {
extends: [require.resolve('@salesforce/pwa-kit-dev/configs/eslint')]
}
5 changes: 5 additions & 0 deletions packages/extension-commerce-bm-seo/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
dist
generator-assets
docs
vendor
Comment on lines +1 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these all valid entries?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied from extension-starter and I see that the other extensions have the same entries. However it does seem like these 3 entries don't exist

generator-assets
docs
vendor

7 changes: 7 additions & 0 deletions packages/extension-commerce-bm-seo/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
printWidth: 100
singleQuote: true
semi: false
bracketSpacing: false
tabWidth: 4
arrowParens: 'always'
trailingComma: 'none'
77 changes: 77 additions & 0 deletions packages/extension-commerce-bm-seo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Commerce Business Manager SEO Extension

A [PWA Kit](https://github.com/SalesforceCommerceCloud/pwa-kit) extension that synchronizes Business Manager-managed routes with your PWA Kit application using the [Shopper SEO URL Mapping API](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-seo?meta=getUrlMapping). This extension provides the following capabilities:

- Integrate routes managed in Business Manager with the PWA Kit
- Integration with the SCAPI Shopper SEO URL Mapping API
- Support for multiple resource types including products, categories, and redirects

Note: Using this extension will impact performance as it requires API calls during navigation.

## Installation

```sh
npm install @salesforce/extension-commerce-bm-seo
```

## Configuration

The SEO extension is configured via your config file (e.g. `app/config/default.json`) or the key `mobify.app.extensions` in your `package.json`:

```json
{
"mobify": {
"app": {
"extensions": [
[
"@salesforce/extension-commerce-bm-seo",
{
"enabled": true,
"commerceAPI": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should explain that the commerceAPI is optional and the extension will use the provider used by other extensions if one exists. Like one from an extension configured before it.

"proxyPath": "/mobify/proxy/api",
"parameters": {
"shortCode": "8o7m175y",
"clientId": "c9c45bfd-0ed3-4aa2-9971-40f88962b836",
"organizationId": "f_ecom_zzrf_001",
"siteId": "RefArchGlobal"
}
},
"commerceAPIAuth": {
"propertyNameInLocals": "commerceAPIAuth"
},
"resourceTypeToComponentMap": {
"category": "ProductList",
"product": "ProductDetail"
}
}
]
]
}
}
}
```

### Configuration Options

- `commerceAPI`: Settings for connecting to the Commerce API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment about this being optional

- `proxyPath`: The proxy path for API requests
- `parameters`: Commerce API connection parameters
- `clientId`: Your Commerce API client ID
- `organizationId`: Your organization ID
- `shortCode`: Your short code
- `siteId`: Your site ID
- `commerceAPIAuth`: Authentication configuration
- `propertyNameInLocals`: Property name for storing auth in locals
- `resourceTypeToComponentMap`: Maps resource types to component names
- `category`: Name of component for category pages
- `product`: Name of component for product pages
- `content_asset`: Name of component for content assets

## How It Works

The SEO extension works by:

1. Blocking navigation
2. Querying the Shopper SEO API for URL mappings
3. Routing to the appropriate component based on the resource type
4. Passing relevant props to the component
7 changes: 7 additions & 0 deletions packages/extension-commerce-bm-seo/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = require('@salesforce/pwa-kit-dev/configs/babel/babel-config')
19 changes: 19 additions & 0 deletions packages/extension-commerce-bm-seo/config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"enabled": true,
"commerceAPI": {
"proxyPath": "/mobify/proxy/api",
"parameters": {
"clientId": "c9c45bfd-0ed3-4aa2-9971-40f88962b836",
"organizationId": "f_ecom_zzrf_001",
"shortCode": "8o7m175y",
"siteId": "RefArchGlobal"
}
},
"commerceAPIAuth": {
"propertyNameInLocals": "commerceAPIAuth"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the key used in locals for storing the commerceAPIAuth. @vmarta wondering if this needs to be in the config or we can just hardcode it in code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hajinsuha1 if you want to hardcode it, perhaps we should make the property name more unlikely to collide → something like __commerceAPIAuth.

},
"resourceTypeToComponentMap": {
"category": "ProductList",
"product": "ProductDetail"
}
}
3 changes: 3 additions & 0 deletions packages/extension-commerce-bm-seo/extension-meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "@salesforce/extension-commerce-seo-bm"
}
27 changes: 27 additions & 0 deletions packages/extension-commerce-bm-seo/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

// eslint-disable-next-line @typescript-eslint/no-var-requires
const base = require('@salesforce/pwa-kit-dev/configs/jest/jest.config.js')

module.exports = {
...base,
moduleNameMapper: {
...base.moduleNameMapper,

// handle pwa-kit extensibility special import
'^overridable!(.*)': '$1'
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action required, but we might want to move this somewhere reusable so it doesn't show up in all the extensions. A simple solution would be to have a special config like '@salesforce/pwa-kit-dev/configs/jest/jest.config-extension.js')

},
coverageThreshold: {
global: {
branches: 87,
functions: 100,
lines: 100,
statements: 100
}
}
}
Loading
Loading