@bigcommerce/stencil-cli 8.8.6 → 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.
@@ -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() {
@@ -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, updatedStencilConfig, browserSyncPort);
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, stencilConfig, browserSyncPort) {
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:${stencilConfig.port}`,
220
+ proxy: `localhost:${Number(browserSyncPort) + 1}`,
222
221
  tunnel,
223
222
  });
224
223
  // Handle manual reloading of browsers by typing 'rs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "8.8.6",
3
+ "version": "8.9.0",
4
4
  "type": "module",
5
5
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
6
6
  "main": "index.js",