@bigcommerce/stencil-cli 8.8.5 → 8.9.0
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/bin/stencil-start.js +3 -1
- package/lib/stencil-push.utils.js +10 -1
- package/lib/stencil-start.js +4 -5
- package/package.json +1 -1
package/bin/stencil-start.js
CHANGED
|
@@ -23,7 +23,8 @@ program
|
|
|
23
23
|
.option(
|
|
24
24
|
'-cu, --channelUrl [channelUrl]',
|
|
25
25
|
'Set a custom domain url to bypass dns/proxy protection',
|
|
26
|
-
)
|
|
26
|
+
)
|
|
27
|
+
.option('-p --port [portnumber]', 'Set port number to listen dev server');
|
|
27
28
|
const cliOptions = prepareCommand(program);
|
|
28
29
|
const options = {
|
|
29
30
|
open: cliOptions.open,
|
|
@@ -33,6 +34,7 @@ const options = {
|
|
|
33
34
|
tunnel: cliOptions.tunnel,
|
|
34
35
|
cache: cliOptions.cache,
|
|
35
36
|
channelUrl: cliOptions.channelUrl,
|
|
37
|
+
port: cliOptions.port,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
async function run() {
|
|
@@ -9,6 +9,7 @@ import Bundle from './stencil-bundle.js';
|
|
|
9
9
|
import themeApiClient from './theme-api-client.js';
|
|
10
10
|
import ThemeConfig from './theme-config.js';
|
|
11
11
|
import StencilConfigManager from './StencilConfigManager.js';
|
|
12
|
+
import BuildConfigManager from './BuildConfigManager.js';
|
|
12
13
|
|
|
13
14
|
const themeConfigManager = ThemeConfig.getInstance(THEME_PATH);
|
|
14
15
|
const stencilConfigManager = new StencilConfigManager();
|
|
@@ -58,8 +59,16 @@ utils.generateBundle = async (options) => {
|
|
|
58
59
|
? { dest: THEME_PATH, name: options.saveBundleName }
|
|
59
60
|
: { dest: os.tmpdir(), name: uuid() };
|
|
60
61
|
const rawConfig = await themeConfigManager.getRawConfig();
|
|
61
|
-
const
|
|
62
|
+
const buildConfigManager = new BuildConfigManager();
|
|
62
63
|
try {
|
|
64
|
+
await buildConfigManager.initConfig();
|
|
65
|
+
const bundle = new Bundle(
|
|
66
|
+
THEME_PATH,
|
|
67
|
+
themeConfigManager,
|
|
68
|
+
rawConfig,
|
|
69
|
+
output,
|
|
70
|
+
buildConfigManager,
|
|
71
|
+
);
|
|
63
72
|
const bundleZipPath = await bundle.initBundle();
|
|
64
73
|
return { ...options, bundleZipPath };
|
|
65
74
|
} catch (err) {
|
package/lib/stencil-start.js
CHANGED
|
@@ -57,7 +57,7 @@ class StencilStart {
|
|
|
57
57
|
}
|
|
58
58
|
const initialStencilConfig = await this._stencilConfigManager.read();
|
|
59
59
|
// Use initial (before updates) port for BrowserSync
|
|
60
|
-
const browserSyncPort = initialStencilConfig.port;
|
|
60
|
+
const browserSyncPort = cliOptions.port || initialStencilConfig.port;
|
|
61
61
|
const channelUrl = await this.getChannelUrl(initialStencilConfig, cliOptions);
|
|
62
62
|
const storeInfoFromAPI = await this._themeApiClient.checkCliVersion({
|
|
63
63
|
storeUrl: channelUrl,
|
|
@@ -72,7 +72,7 @@ class StencilStart {
|
|
|
72
72
|
);
|
|
73
73
|
await this.startLocalServer(cliOptions, updatedStencilConfig);
|
|
74
74
|
this._logger.log(this.getStartUpInfo(updatedStencilConfig));
|
|
75
|
-
await this.startBrowserSync(cliOptions,
|
|
75
|
+
await this.startBrowserSync(cliOptions, browserSyncPort);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
async getStoreSettingsLocale(cliOptions, stencilConfig) {
|
|
@@ -131,7 +131,6 @@ class StencilStart {
|
|
|
131
131
|
...stencilConfig,
|
|
132
132
|
storeUrl: storeInfoFromAPI.sslUrl,
|
|
133
133
|
normalStoreUrl: storeInfoFromAPI.baseUrl,
|
|
134
|
-
port: Number(stencilConfig.port) + 1,
|
|
135
134
|
};
|
|
136
135
|
}
|
|
137
136
|
|
|
@@ -151,7 +150,7 @@ class StencilStart {
|
|
|
151
150
|
});
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
async startBrowserSync(cliOptions,
|
|
153
|
+
async startBrowserSync(cliOptions, browserSyncPort) {
|
|
155
154
|
const DEFAULT_WATCH_FILES = ['/assets', '/templates', '/lang', '/.config'];
|
|
156
155
|
const DEFAULT_WATCH_IGNORED = ['/assets/scss', '/assets/css'];
|
|
157
156
|
const { themePath, configPath } = this._themeConfigManager;
|
|
@@ -218,7 +217,7 @@ class StencilStart {
|
|
|
218
217
|
ignoreInitial: true,
|
|
219
218
|
ignored: watchIgnored.map((val) => path.join(themePath, val)),
|
|
220
219
|
},
|
|
221
|
-
proxy: `localhost:${
|
|
220
|
+
proxy: `localhost:${Number(browserSyncPort) + 1}`,
|
|
222
221
|
tunnel,
|
|
223
222
|
});
|
|
224
223
|
// Handle manual reloading of browsers by typing 'rs';
|