@bigcommerce/stencil-cli 7.3.3 → 7.4.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.
@@ -10,6 +10,7 @@ const dynamicComponentRegex = /\{\{\s*?dynamicComponent\s*(?:'|")([_|\-|a-zA-Z0-
10
10
  const includeRegex = /{{2}>\s*([_|\-|a-zA-Z0-9/]+)[^{]*?}{2}/g;
11
11
  const pathStringRegex = /^["'].+["']$/;
12
12
  const packageMarker = 'external/';
13
+ const partialBlock = '@partial-block';
13
14
 
14
15
  /**
15
16
  * indicates if a template source is a node modules dependency
@@ -169,7 +170,9 @@ function getTemplatePaths(templatesFolder, templates, options, callback) {
169
170
  while (match !== null) {
170
171
  [, partialPath] = match;
171
172
  if (!templatePaths.includes(partialPath)) {
172
- matches.push(partialPath);
173
+ if (partialPath !== partialBlock) {
174
+ matches.push(partialPath);
175
+ }
173
176
  }
174
177
  match = partialRegex.exec(content);
175
178
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "7.3.3",
3
+ "version": "7.4.0",
4
4
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
5
5
  "main": "index.js",
6
6
  "engines": {
7
7
  "node": ">=16.0.0 <19.0.0",
8
- "npm": ">=8.0.0 <10.0.0"
8
+ "npm": ">=8.0.0"
9
9
  },
10
10
  "scripts": {
11
11
  "lint": "eslint . && prettier --check . --ignore-unknown",
@@ -20,6 +20,18 @@ const internals = {
20
20
  },
21
21
  };
22
22
 
23
+ function mapUri(req) {
24
+ const host = `https://${internals.options.storeUrl.replace(/http[s]?:\/\//, '')}`;
25
+ const urlParams = req.url.search || '';
26
+ const uri = `${host}${req.path}${urlParams}`;
27
+ const headers = {
28
+ 'stencil-cli': internals.options.stencilCliVersion,
29
+ 'x-auth-token': internals.options.accessToken,
30
+ };
31
+
32
+ return { uri, headers };
33
+ }
34
+
23
35
  function register(server, options) {
24
36
  internals.options = _.defaultsDeep(options, internals.options);
25
37
 
@@ -96,10 +108,8 @@ internals.registerRoutes = (server) => {
96
108
  path: internals.paths.internalApi,
97
109
  handler: {
98
110
  proxy: {
99
- host: internals.options.storeUrl.replace(/http[s]?:\/\//, ''),
111
+ mapUri,
100
112
  rejectUnauthorized: false,
101
- protocol: 'https',
102
- port: 443,
103
113
  passThrough: true,
104
114
  },
105
115
  },
@@ -114,20 +124,8 @@ internals.registerRoutes = (server) => {
114
124
  path: internals.paths.storefrontAPI,
115
125
  handler: {
116
126
  proxy: {
127
+ mapUri,
117
128
  rejectUnauthorized: false,
118
- mapUri: (req) => {
119
- const host = `https://${internals.options.storeUrl.replace(
120
- /http[s]?:\/\//,
121
- '',
122
- )}`;
123
- const urlParams = req.url.search || '';
124
- const uri = `${host}${req.path}${urlParams}`;
125
- const headers = {
126
- 'stencil-cli': internals.options.stencilCliVersion,
127
- 'x-auth-token': internals.options.accessToken,
128
- };
129
- return { uri, headers };
130
- },
131
129
  passThrough: true,
132
130
  },
133
131
  },