@bigcommerce/stencil-cli 8.4.1 → 8.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.
@@ -13,6 +13,7 @@ program
13
13
  '-d, --dest [dest]',
14
14
  'Where to save the zip file. It defaults to the current directory you are in when bundling',
15
15
  )
16
+ .option('-S, --source-maps', 'Include source-maps in the bundle. This is useful for debugging')
16
17
  .option(
17
18
  '-n, --name [filename]',
18
19
  'What do you want to call the zip file. It defaults to stencil-bundle.zip',
@@ -9,6 +9,7 @@ program
9
9
  .version(PACKAGE_INFO.version)
10
10
  .option('-f, --file [filename]', 'specify the filename of the bundle to upload')
11
11
  .option('-s, --save [filename]', 'specify the filename to save the bundle as')
12
+ .option('-S, --source-maps', 'Include source-maps in the bundle. This is useful for debugging')
12
13
  .option('-a, --activate [variationname]', 'specify the variation of the theme to activate')
13
14
  .option('-d, --delete', 'delete oldest private theme if upload limit reached')
14
15
  .option(
@@ -25,6 +26,7 @@ const options = {
25
26
  saveBundleName: cliOptions.save,
26
27
  deleteOldest: cliOptions.delete,
27
28
  allChannels: cliOptions.all_channels,
29
+ sourceMaps: cliOptions.source_maps,
28
30
  };
29
31
  stencilPush(options, (err, result) => {
30
32
  if (err) {
@@ -18,7 +18,7 @@ const MAX_SIZE_BUNDLE = MEGABYTE * 50;
18
18
  const PATHS_TO_ZIP = [
19
19
  {
20
20
  pattern: 'assets/**/*',
21
- ignore: ['assets/cdn/**', 'assets/**/*.js.map'],
21
+ ignore: ['assets/cdn/**'],
22
22
  },
23
23
  { pattern: 'CHANGELOG.md' },
24
24
  { pattern: 'config.json' },
@@ -387,6 +387,9 @@ class Bundle {
387
387
  */
388
388
  _bundleThemeFiles(archive, themePath) {
389
389
  for (const { pattern, ignore } of PATHS_TO_ZIP) {
390
+ if (pattern === 'assets/**/*' && !this.options.sourceMaps) {
391
+ ignore.push('assets/**/*.js.map');
392
+ }
390
393
  archive.glob(pattern, { ignore, cwd: themePath });
391
394
  }
392
395
  }
@@ -4,7 +4,7 @@ import fs from 'graceful-fs';
4
4
  import path from 'path';
5
5
  import upath from 'upath';
6
6
 
7
- const partialRegex = /\{\{>\s*([_|\-|a-zA-Z0-9@'"/]+)[^{]*?}}/g;
7
+ const partialRegex = /\{\{#?>\s*([_|\-|a-zA-Z0-9@'"/]+)[^{]*?}}/g;
8
8
  const partialWithoutBracketsRegex = /[^>{{}}\s*]+/g;
9
9
  const dynamicComponentRegex = /\{\{\s*?dynamicComponent\s*(?:'|")([_|\-|a-zA-Z0-9/]+)(?:'|").*?}}/g;
10
10
  const includeRegex = /{{2}>\s*([_|\-|a-zA-Z0-9/]+)[^{]*?}{2}/g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "8.4.1",
3
+ "version": "8.5.1",
4
4
  "type": "module",
5
5
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
6
6
  "main": "index.js",