@bigcommerce/stencil-cli 3.9.1 → 3.10.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
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
### Draft
|
|
2
|
+
|
|
3
|
+
### 3.10.1 (2022-02-24)
|
|
4
|
+
|
|
5
|
+
- fix: when there's no regions on the page ([878](https://github.com/bigcommerce/stencil-cli/pull/878))
|
|
6
|
+
- fix: STRF-9667 Storefront fallback logic works incorrectly on store with Stencil CLI ([877](https://github.com/bigcommerce/stencil-cli/pull/877))
|
|
7
|
+
|
|
8
|
+
### 3.10.0 (2022-02-08)
|
|
9
|
+
|
|
10
|
+
- fix(storefront): bctheme-1000 handle regular css in stencil ([845](https://github.com/bigcommerce/stencil-cli/pull/845))
|
|
11
|
+
- chore: bump paper to 3.0.0 ([868](https://github.com/bigcommerce/stencil-cli/pull/868))
|
|
12
|
+
|
|
13
|
+
### 3.9.2 (2022-01-31)
|
|
14
|
+
|
|
15
|
+
- chore: bump paper to latest ([863](https://github.com/bigcommerce/stencil-cli/pull/863))
|
|
16
|
+
|
|
1
17
|
### 3.9.1 (2022-01-25)
|
|
2
18
|
|
|
3
19
|
- fix: strf-9612 Fix stencil pull when there is 1 channel ([859](https://github.com/bigcommerce/stencil-cli/pull/859))
|
|
@@ -31,6 +31,9 @@ async function getRenderedRegionsByPageType({ accessToken, storeUrl, pageType })
|
|
|
31
31
|
}),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
+
if (!response.data.data) {
|
|
35
|
+
return { renderedRegions: [] };
|
|
36
|
+
}
|
|
34
37
|
const {
|
|
35
38
|
site: {
|
|
36
39
|
content: {
|
|
@@ -75,6 +78,9 @@ async function getRenderedRegionsByPageTypeAndEntityId({
|
|
|
75
78
|
}),
|
|
76
79
|
});
|
|
77
80
|
|
|
81
|
+
if (!response.data.data) {
|
|
82
|
+
return { renderedRegions: [] };
|
|
83
|
+
}
|
|
78
84
|
const {
|
|
79
85
|
site: {
|
|
80
86
|
content: {
|
package/lib/stencil-bundle.js
CHANGED
|
@@ -110,7 +110,12 @@ class Bundle {
|
|
|
110
110
|
bundle: true,
|
|
111
111
|
};
|
|
112
112
|
return (callback) => {
|
|
113
|
-
|
|
113
|
+
let basePath;
|
|
114
|
+
if (compiler === 'css') {
|
|
115
|
+
basePath = path.join(this.themePath, 'assets/dist', compiler);
|
|
116
|
+
} else {
|
|
117
|
+
basePath = path.join(this.themePath, 'assets', compiler);
|
|
118
|
+
}
|
|
114
119
|
|
|
115
120
|
console.log('%s Parsing Started...', compiler.toUpperCase());
|
|
116
121
|
fs.readdir(basePath, (err, files) => {
|
|
@@ -395,7 +400,12 @@ class Bundle {
|
|
|
395
400
|
case 'css':
|
|
396
401
|
// Create the parsed tree files
|
|
397
402
|
for (const [filename, data] of Object.entries(result)) {
|
|
398
|
-
|
|
403
|
+
const ext =
|
|
404
|
+
this.configuration.css_compiler === 'css'
|
|
405
|
+
? this.configuration.css_compiler
|
|
406
|
+
: 'scss';
|
|
407
|
+
|
|
408
|
+
archiveJsonFile(data, `parsed/${ext}/${filename}.json`);
|
|
399
409
|
}
|
|
400
410
|
break;
|
|
401
411
|
|
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigcommerce/stencil-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -537,9 +537,9 @@
|
|
|
537
537
|
}
|
|
538
538
|
},
|
|
539
539
|
"@bigcommerce/stencil-paper": {
|
|
540
|
-
"version": "3.0.0
|
|
541
|
-
"resolved": "https://registry.npmjs.org/@bigcommerce/stencil-paper/-/stencil-paper-3.0.0
|
|
542
|
-
"integrity": "sha512
|
|
540
|
+
"version": "3.0.0",
|
|
541
|
+
"resolved": "https://registry.npmjs.org/@bigcommerce/stencil-paper/-/stencil-paper-3.0.0.tgz",
|
|
542
|
+
"integrity": "sha512-+8Zyln2L7yvoFabDzgXgSE+7it01Q5UZml+pq70qrx9GtsX+leIhdY01RoziDnES1I12qIx+bPUX+vM7oD1NZg==",
|
|
543
543
|
"requires": {
|
|
544
544
|
"@bigcommerce/stencil-paper-handlebars": "4.5.1",
|
|
545
545
|
"accept-language-parser": "~1.4.1",
|
|
@@ -2873,6 +2873,16 @@
|
|
|
2873
2873
|
"is-string": "^1.0.5"
|
|
2874
2874
|
}
|
|
2875
2875
|
},
|
|
2876
|
+
"array-sort": {
|
|
2877
|
+
"version": "0.1.4",
|
|
2878
|
+
"resolved": "https://registry.npmjs.org/array-sort/-/array-sort-0.1.4.tgz",
|
|
2879
|
+
"integrity": "sha512-BNcM+RXxndPxiZ2rd76k6nyQLRZr2/B/sdi8pQ+Joafr5AH279L40dfokSUTp8O+AaqYjXWhblBWa2st2nc4fQ==",
|
|
2880
|
+
"requires": {
|
|
2881
|
+
"default-compare": "^1.0.0",
|
|
2882
|
+
"get-value": "^2.0.6",
|
|
2883
|
+
"kind-of": "^5.0.2"
|
|
2884
|
+
}
|
|
2885
|
+
},
|
|
2876
2886
|
"array-union": {
|
|
2877
2887
|
"version": "2.1.0",
|
|
2878
2888
|
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
|
@@ -7640,23 +7650,6 @@
|
|
|
7640
7650
|
"arr-flatten": "^1.0.1"
|
|
7641
7651
|
}
|
|
7642
7652
|
},
|
|
7643
|
-
"array-sort": {
|
|
7644
|
-
"version": "0.1.4",
|
|
7645
|
-
"resolved": "https://registry.npmjs.org/array-sort/-/array-sort-0.1.4.tgz",
|
|
7646
|
-
"integrity": "sha512-BNcM+RXxndPxiZ2rd76k6nyQLRZr2/B/sdi8pQ+Joafr5AH279L40dfokSUTp8O+AaqYjXWhblBWa2st2nc4fQ==",
|
|
7647
|
-
"requires": {
|
|
7648
|
-
"default-compare": "^1.0.0",
|
|
7649
|
-
"get-value": "^2.0.6",
|
|
7650
|
-
"kind-of": "^5.0.2"
|
|
7651
|
-
},
|
|
7652
|
-
"dependencies": {
|
|
7653
|
-
"kind-of": {
|
|
7654
|
-
"version": "5.1.0",
|
|
7655
|
-
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
|
|
7656
|
-
"integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw=="
|
|
7657
|
-
}
|
|
7658
|
-
}
|
|
7659
|
-
},
|
|
7660
7653
|
"array-unique": {
|
|
7661
7654
|
"version": "0.2.1",
|
|
7662
7655
|
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
|
|
@@ -15443,9 +15436,9 @@
|
|
|
15443
15436
|
"integrity": "sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g=="
|
|
15444
15437
|
},
|
|
15445
15438
|
"uglify-js": {
|
|
15446
|
-
"version": "3.
|
|
15447
|
-
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.
|
|
15448
|
-
"integrity": "sha512-
|
|
15439
|
+
"version": "3.15.1",
|
|
15440
|
+
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.1.tgz",
|
|
15441
|
+
"integrity": "sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==",
|
|
15449
15442
|
"optional": true
|
|
15450
15443
|
},
|
|
15451
15444
|
"uglify-to-browserify": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigcommerce/stencil-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "CLI tool to run BigCommerce Stores locally for theme development.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"package-lock.json"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@bigcommerce/stencil-paper": "
|
|
48
|
+
"@bigcommerce/stencil-paper": "3.0.0",
|
|
49
49
|
"@bigcommerce/stencil-styles": "2.1.1",
|
|
50
50
|
"@hapi/boom": "^8.0.1",
|
|
51
51
|
"@hapi/glue": "^6.2.0",
|
|
@@ -371,7 +371,7 @@ function getAcceptLanguageHeader(request) {
|
|
|
371
371
|
) {
|
|
372
372
|
return internals.options.storeSettingsLocale.default_shopper_language;
|
|
373
373
|
}
|
|
374
|
-
return request.headers['accept-language'];
|
|
374
|
+
return request.headers['accept-language'].toLowerCase();
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
/**
|
|
@@ -60,21 +60,21 @@ internals.cssHandler = async (request, h) => {
|
|
|
60
60
|
request.app.themeConfig.setVariation(variationIndex);
|
|
61
61
|
|
|
62
62
|
// Get the theme configuration
|
|
63
|
+
const configuration = await request.app.themeConfig.getConfig();
|
|
63
64
|
const fileName = internals.getOriginalFileName(request.params.fileName);
|
|
64
65
|
const fileParts = path.parse(fileName);
|
|
65
|
-
const
|
|
66
|
-
const
|
|
66
|
+
const ext = configuration.css_compiler === 'css' ? configuration.css_compiler : 'scss';
|
|
67
|
+
const pathToFile = path.join(fileParts.dir, `${fileParts.name}.${ext}`);
|
|
68
|
+
const basePath = path.join(internals.getThemeAssetsPath(), `${ext}`);
|
|
67
69
|
|
|
68
70
|
let files;
|
|
69
71
|
try {
|
|
70
|
-
files = await promisify(cssAssembler.assemble)(pathToFile, basePath,
|
|
72
|
+
files = await promisify(cssAssembler.assemble)(pathToFile, basePath, `${ext}`, {});
|
|
71
73
|
} catch (err) {
|
|
72
74
|
console.error(err);
|
|
73
75
|
throw Boom.badData(err);
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
const configuration = await request.app.themeConfig.getConfig();
|
|
77
|
-
|
|
78
78
|
const params = {
|
|
79
79
|
data: files[pathToFile],
|
|
80
80
|
files,
|