-
Notifications
You must be signed in to change notification settings - Fork 212
@W-18172401 Integrate getUrlMapping on server-side navigation #2290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/extensibility-v2
Are you sure you want to change the base?
Changes from all commits
02e1334
41b34a7
87567d8
0a42f90
9b1dada
b8505d0
74ea27a
5988996
61839ff
1a8d1be
8380df6
182f7b6
babf5ab
3651f4e
efdc0c5
2d1031f
5e45dac
f178dec
cfd82eb
7b8b80b
4f30443
c78b81b
55c4415
5da9d8e
4d13fe3
8a54875
4604d76
e6542fc
7a1f51f
ddb88d2
138f44b
3bfa646
2054078
a547b24
63a9d1f
d90c79c
c67fefa
af9f3df
b002c86
bd74cf8
b84c8c3
3a9f90d
4a3a6ce
6d92af9
9f6c055
6d5fb39
0115d21
fa85193
040e3f1
86a78ed
0a7e855
9acff92
c5d924b
2206dd5
392387a
0c1bd41
08e72bd
0dbbb34
8324897
5586726
645a91f
d0ffc37
f97aaed
42879f5
b71c0b9
bb692bc
0d2ed3b
35a453e
272639f
2067892
0e44b84
1579626
806fa87
85f9516
11b5af3
6402e62
e8bba80
af93217
579bdf3
18adf16
d9b32e2
4ad2535
965a34a
6baf649
5dbe489
26da1ee
f1eab7c
0a1626c
c622823
92a1c9a
f615878
38e352f
4119cda
6677213
0058e80
fa4540a
4af8642
7fdd261
bcdcea3
7b48662
62e0060
347c486
de121c3
2152142
ab23cd6
5236d90
131f670
6e257cd
edcae1d
04ee8fb
c6be840
c8e8035
88419bf
e9c00dd
4d2587a
1de2122
38425c2
2f1a48a
2bcbbc2
7ba4d99
7c731f2
a2096c3
18a566f
0e0edcb
422bd78
7ed9fbd
e08d7ce
bab7884
c594557
794b0a3
0cd67cc
54ec28a
6d7c6a9
12b071b
fc461cd
5f5de44
ad8933a
f65cf58
876b4c2
ad6d337
f05a70a
16f461b
7aa5a85
c9a58da
b01d659
0751fd9
8017fa6
d3b5651
07d7da0
0fe9e28
90fabe5
ef43d50
03dda35
a0c8a18
5f11e34
b4a23f2
12e4116
ac3cf68
9129a42
3782fb9
6ed3ffa
0de2b6a
8382e9a
a27ce96
0096116
da93df5
b42d623
ceae1c5
78837c1
a2113da
6cfecf0
613813e
be17100
366c74b
c4a432f
cc4714b
ade541e
44dcdc7
3adf867
4b91cbd
6a1caee
93f6789
70dcfb1
1a3fda9
c78d0cd
1bdf645
83332ff
c0b0803
07598e4
75c2a0c
1d524d1
98a5011
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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')] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| coverage | ||
| dist | ||
| generator-assets | ||
| docs | ||
| vendor | ||
| 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' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # 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": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
| } | ||
| }, | ||
| "resourceTypeToComponentMap": { | ||
| "category": "ProductList", | ||
| "product": "ProductDetail" | ||
| } | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Configuration Options | ||
|
|
||
| - `commerceAPI`: Settings for connecting to the Commerce API | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| - `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 | ||
| 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') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "enabled": true, | ||
| "commerceAPI": { | ||
| "proxyPath": "/mobify/proxy/api", | ||
| "parameters": { | ||
| "clientId": "c9c45bfd-0ed3-4aa2-9971-40f88962b836", | ||
| "organizationId": "f_ecom_zzrf_001", | ||
| "shortCode": "8o7m175y", | ||
| "siteId": "RefArchGlobal" | ||
| } | ||
| }, | ||
| "resourceTypeToComponentMap": { | ||
| "category": "ProductList", | ||
| "product": "ProductDetail" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "id": "@salesforce/extension-commerce-seo-bm" | ||
| } |
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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-starterand I see that the other extensions have the same entries. However it does seem like these 3 entries don't exist