@bigcommerce/stencil-cli 7.2.1 → 7.2.3

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.
@@ -65,6 +65,7 @@ class ScssValidator {
65
65
  const filePath = item[1].slice(1, -1);
66
66
  const fileName = this.tryToResolveCssFileLocation(filePath);
67
67
  if (
68
+ fileName &&
68
69
  !this.isStyleSheetAComment(content, filePath) &&
69
70
  !cssFiles.includes(fileName)
70
71
  ) {
@@ -107,6 +108,9 @@ class ScssValidator {
107
108
  for (const location of possibleLocations) {
108
109
  const fullFilePath = path.join(this.themePath, location);
109
110
  if (fs.existsSync(fullFilePath)) {
111
+ if (fullFilePath.endsWith('.css')) {
112
+ return null;
113
+ }
110
114
  if (!this.isRootCssFile(location)) {
111
115
  return this.getCssFileWithoutRootFolder(location);
112
116
  }
@@ -109,7 +109,7 @@ class AutoFixer {
109
109
  }
110
110
  if (
111
111
  err.formatted.includes('Invalid CSS after') &&
112
- err.formatted.includes('expected selector, was ', '')
112
+ err.formatted.includes('expected selector, was ",')
113
113
  ) {
114
114
  return POSSIBLE_WRONG_COMMA;
115
115
  }
@@ -13,19 +13,28 @@ class BaseRulesFixer extends BaseFixer {
13
13
  }
14
14
 
15
15
  transform() {
16
+ const self = this;
16
17
  return {
17
18
  postcssPlugin: 'Transform Base Rules Issues into Comments',
18
19
  Rule(rule, { Comment }) {
19
20
  if (
20
21
  rule.parent.type === 'root' &&
21
- (rule.selector.startsWith('&--') || rule.selector.startsWith('&.'))
22
+ (rule.selector.startsWith('&') ||
23
+ rule.selector.startsWith(':not(&)') ||
24
+ rule.selector.startsWith('* &'))
22
25
  ) {
23
- const comment = new Comment({ text: rule.toString() });
26
+ const comment = new Comment({ text: self.replaceInnerComments(rule) });
24
27
  rule.replaceWith(comment);
25
28
  }
26
29
  },
27
30
  };
28
31
  }
32
+
33
+ // when we replace rule with comment, there might be a case when comment is inside another rule
34
+ // which breaks the commenting root rule
35
+ replaceInnerComments(rule) {
36
+ return rule.toString().replace(/\/\*(.*)\*\//g, '//$1');
37
+ }
29
38
  }
30
39
 
31
40
  module.exports = BaseRulesFixer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -48,7 +48,7 @@
48
48
  "package-lock.json"
49
49
  ],
50
50
  "dependencies": {
51
- "@bigcommerce/stencil-paper": "4.2.1",
51
+ "@bigcommerce/stencil-paper": "4.10.4",
52
52
  "@bigcommerce/stencil-styles": "5.1.0",
53
53
  "@hapi/boom": "^10.0.0",
54
54
  "@hapi/glue": "^8.0.0",
@@ -79,6 +79,7 @@
79
79
  "object-to-spawn-args": "^2.0.0",
80
80
  "parse-json": "^5.2.0",
81
81
  "postcss": "^8.4.21",
82
+ "postcss-safe-parser": "^6.0.0",
82
83
  "postcss-scss": "^4.0.6",
83
84
  "progress": "^2.0.3",
84
85
  "recursive-readdir": "^2.2.2",