|
40 | 40 | * |
41 | 41 | * ###### JavaScript File Configuration |
42 | 42 | * |
43 | | - * Configuration variables can be supplied in an optional file named env.config.js. This file must |
44 | | - * export either an Object containing configuration variables or a function. The function must |
45 | | - * return an Object containing configuration variables or, alternately, a promise which resolves to |
46 | | - * an Object. |
| 43 | + * Configuration variables can be supplied in an optional file named env.config.js (it can also be |
| 44 | + * a `.jsx`, `.ts`, or `.tsx` file). This file must export either an Object containing configuration |
| 45 | + * variables or a function. The function must return an Object containing configuration variables or, |
| 46 | + * alternately, a promise which resolves to an Object. |
47 | 47 | * |
48 | 48 | * Using a function or async function allows the configuration to be resolved at runtime (because |
49 | 49 | * the function will be executed at runtime). This is not common, and the capability is included |
|
89 | 89 | * |
90 | 90 | * Configuration variables can also be supplied using the "runtime configuration" method, taking |
91 | 91 | * advantage of the Micro-frontend Config API in edx-platform. More information on this API can be |
92 | | - * found in the ADR which introduced it: |
| 92 | + * found in [the ADR which introduced it](https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst). |
93 | 93 | * |
94 | | - * https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst |
95 | | - * |
96 | | - * The runtime configuration method can be enabled by supplying a MFE_CONFIG_API_URL via one of the other |
| 94 | + * The runtime configuration method can be enabled by supplying a `MFE_CONFIG_API_URL` via one of the other |
97 | 95 | * two configuration methods above. |
98 | 96 | * |
99 | 97 | * Runtime configuration is particularly useful if you need to supply different configurations to |
|
103 | 101 | * |
104 | 102 | * ##### Initialization Config Handler |
105 | 103 | * |
106 | | - * The configuration document can be extended by |
107 | | - * applications at run-time using a `config` initialization handler. Please see the Initialization |
108 | | - * documentation for more information on handlers and initialization phases. |
| 104 | + * The configuration document can be extended by applications at run-time using a `config` |
| 105 | + * initialization handler. Please see the Initialization documentation for more information on |
| 106 | + * handlers and initialization phases. |
109 | 107 | * |
110 | 108 | * ``` |
111 | 109 | * initialize({ |
|
114 | 112 | * mergeConfig({ |
115 | 113 | * CUSTOM_VARIABLE: 'custom value', |
116 | 114 | * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon. |
117 | | - * }, 'App config override handler'); |
| 115 | + * }, 'App config override handler'); |
118 | 116 | * }, |
119 | 117 | * }, |
120 | 118 | * }); |
@@ -163,7 +161,9 @@ function parseParagonThemeUrls(paragonUrlsJson) { |
163 | 161 | } catch (err) { |
164 | 162 | if (err instanceof SyntaxError) { |
165 | 163 | // eslint-disable-next-line no-console |
166 | | - console.error('Unable to parse PARAGON_THEME_URLS JSON.\nPlease check https://github.com/openedx/frontend-platform/tree/master/docs/how_tos/theming.md for the expected formatting.\nAn empty object ({}) will be returned, which will cause the theming configuration to fall back to the installed packages.'); |
| 164 | + console.error( |
| 165 | + 'Unable to parse PARAGON_THEME_URLS JSON.\nPlease check https://github.com/openedx/frontend-platform/tree/master/docs/how_tos/theming.md for the expected formatting.\nAn empty object ({}) will be returned, which will cause the theming configuration to fall back to the installed packages.', |
| 166 | + ); |
167 | 167 | return {}; |
168 | 168 | } |
169 | 169 | // In case of a different type of error, return the error object itself |
@@ -223,7 +223,7 @@ let config = { |
223 | 223 | * ``` |
224 | 224 | * |
225 | 225 | * @returns {ConfigDocument} |
226 | | - */ |
| 226 | + */ |
227 | 227 | export function getConfig() { |
228 | 228 | return config; |
229 | 229 | } |
@@ -301,7 +301,9 @@ export function ensureConfig(keys, requester = 'unspecified application code') { |
301 | 301 | keys.forEach((key) => { |
302 | 302 | if (config[key] === undefined) { |
303 | 303 | // eslint-disable-next-line no-console |
304 | | - console.warn(`App configuration error: ${key} is required by ${requester}.`); |
| 304 | + console.warn( |
| 305 | + `App configuration error: ${key} is required by ${requester}.`, |
| 306 | + ); |
305 | 307 | } |
306 | 308 | }); |
307 | 309 | }); |
@@ -340,7 +342,7 @@ export function getExternalLinkUrl(url) { |
340 | 342 | * In its most basic form, the initialization process loads this document via `process.env` |
341 | 343 | * variables. There are other ways to add configuration variables to the ConfigDocument as |
342 | 344 | * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization |
343 | | - * Config Handler) |
| 345 | + * Config Handler). |
344 | 346 | * |
345 | 347 | * ``` |
346 | 348 | * { |
|
0 commit comments