@bigcommerce/stencil-cli 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/StencilConfigManager.js +12 -2
- package/package-lock.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
### 3.5.1 (2021-09-15)
|
|
2
|
+
|
|
3
|
+
- fix: strf-9345: Fallback to API_HOST constant in the absense of a provided one ([d138536c8](https://github.com/bigcommerce/stencil-cli/commit/d138536c8))
|
|
4
|
+
|
|
1
5
|
### 3.5.0 (2021-09-15)
|
|
2
6
|
|
|
3
7
|
- fix: STRF-9351 Stop sending "X-Forwarded-..." headers as it causes remote store to redirect ([36f5663da](https://github.com/bigcommerce/stencil-cli/commit/36f5663da))
|
|
@@ -3,7 +3,7 @@ const fsModule = require('fs');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
|
|
5
5
|
const fsUtilsModule = require('./utils/fsUtils');
|
|
6
|
-
const { THEME_PATH } = require('../constants');
|
|
6
|
+
const { THEME_PATH, API_HOST } = require('../constants');
|
|
7
7
|
|
|
8
8
|
class StencilConfigManager {
|
|
9
9
|
constructor({
|
|
@@ -99,7 +99,9 @@ class StencilConfigManager {
|
|
|
99
99
|
* @param {boolean} ignoreMissingFields
|
|
100
100
|
* @returns {object}
|
|
101
101
|
*/
|
|
102
|
-
_validateStencilConfig(
|
|
102
|
+
_validateStencilConfig(configFile, ignoreMissingFields) {
|
|
103
|
+
const config = configFile;
|
|
104
|
+
|
|
103
105
|
if (!ignoreMissingFields && (!config.normalStoreUrl || !config.customLayouts)) {
|
|
104
106
|
throw new Error(
|
|
105
107
|
'Error: Your stencil config is outdated. Please run'.red +
|
|
@@ -107,6 +109,14 @@ class StencilConfigManager {
|
|
|
107
109
|
' again.'.red,
|
|
108
110
|
);
|
|
109
111
|
}
|
|
112
|
+
|
|
113
|
+
if (!config.apiHost) {
|
|
114
|
+
this._logger.log(
|
|
115
|
+
`No api host found in config file, falling back to ${API_HOST}. You may need to run 'stencil init' again.`,
|
|
116
|
+
);
|
|
117
|
+
config.apiHost = API_HOST;
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
return config;
|
|
111
121
|
}
|
|
112
122
|
|
package/package-lock.json
CHANGED