Skip to content

Commit 45a9d79

Browse files
authored
Edit readme to include forced overrides functionability (#2233)
* Edit readme to include forced overrides functionality
1 parent 64bb4ae commit 45a9d79

File tree

2 files changed

+52
-13
lines changed

2 files changed

+52
-13
lines changed

packages/extension-chakra-storefront/README.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,50 @@ Please refer to the sample configuration below in order to properly configure yo
107107
"isProduction": false
108108
},
109109
"enabled": true, // Toggle this extension on or off, this is useful for debugging and development, defaults to true.
110-
"pages": { // Define the url path of each page. A page can be set to false if you want to disable it.
111-
"Account": "/account",
112-
"Cart": "/cart",
113-
"Checkout": "/checkout",
114-
"CheckoutConfirmation": "/checkout/confirmation/:orderNo",
115-
"Home": "/",
116-
"Login": "/login",
117-
"Registration": "/registration",
118-
"ResetPassword": "/reset-password",
119-
"LoginRedirect": "/callback",
120-
"ProductDetail": "/product/:productId",
121-
"ProductList": ["/search", "/category/:categoryId"]
110+
"pages": { // Define the url path of and the configuration on each page. A page can be set to false if you want to disable it.
111+
"Account": {
112+
"path": "/account",
113+
"orderSearchParam": {"limit": 10, "offset": 0, "sort": "best-matches", "refine": []}
114+
},
115+
"Cart": {
116+
"path": "/cart"
117+
},
118+
"Checkout": {
119+
"path": "/checkout",
120+
"shippingCountryCode": [
121+
{"value": "CA", "label": "Canada"},
122+
{"value": "US", "label": "United States"}
123+
]
124+
},
125+
"CheckoutConfirmation": {
126+
"path": "/checkout/confirmation/:orderNo"
127+
},
128+
"Home": {
129+
"path": "/",
130+
"productLimit": 10,
131+
"mainCategory": "newarrivals"
132+
},
133+
"Login": {
134+
"path": "/login"
135+
},
136+
"Registration": {
137+
"path": "/registration"
138+
},
139+
"ResetPassword": {
140+
"path": "/reset-password"
141+
},
142+
"LoginRedirect": {
143+
"path": "/callback"
144+
},
145+
"ProductDetail": {
146+
"path": "/product/:productId"
147+
},
148+
"ProductList": {
149+
"path": ["/search", "/category/:categoryId"],
150+
"imageViewType": "large",
151+
"selectableAttributeId": "color",
152+
"filterAccordionSate": "filters-expanded-index"
153+
}
122154
},
123155
"siteAliases": {}, // Site alias's for multi-site support.
124156
"sites": [ // Site configs for multi-site support.

packages/pwa-kit-extension-sdk/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ Now when the base application is built the import for the `logo.ts` in `extensio
107107

108108
This mechanism is useful when you want to allow for fine grained customization of your application extension. Its the responsibility of the extension developer to ensure their document what files are overridable and what the expected input and output of those files are. For example, if the overridable file is a React component you should document the props that get passed to that component and the expected exports of the file.
109109

110+
#### Forced Overrides
111+
Users of your extension may sometimes need to override files that are not explicitly designed to be overridden. To accommodate this, they can use a special dotfile named `.forced_overrides`.
112+
113+
This file, located at the root of their project, should contain a list of files they wish to override, prefixed with the extension package name. Any files listed in `.forced_overrides` will be treated as overridable, bypassing standard restrictions.
114+
115+
Note: It is advisable to use this function with caution since it could potentially break intended behavior of installed extensions. This should be used as a temporary solution to urgently patch/update an extension.
116+
110117
#### Setup App and Setup Server
111118

112119
These two files represent the core of your extension implementation and how your extension is able to enhance and integrate into your PWA-Kit Application. In your generated extension you'll find that we have stubbed each file out for you with implementations for each Application Extensibility integration point. You can choose to change the implementation of these methods to suit the needs of your extensions, or you can leave them as is if your extension does not require them.
@@ -280,4 +287,4 @@ export default useStoreLocatorState
280287
```
281288
282289
## Support Policy
283-
Security patches are provided for 24 months after the general availability of each major version of the SDK (1.0, 2.0, and so on).
290+
Security patches are provided for 24 months after the general availability of each major version of the SDK (1.0, 2.0, and so on).

0 commit comments

Comments
 (0)