sdc-build-wp 5.6.9 → 5.6.11

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/README.md CHANGED
@@ -35,4 +35,6 @@ Develop locally with the following command from within the test project director
35
35
 
36
36
  ```
37
37
  node ~/sites/sdc/sdc-build-wp/index.js --watch
38
+ # or
39
+ sdc-build-wp-local --watch
38
40
  ```
@@ -75,8 +75,9 @@ export default class ServerComponent extends BaseComponent {
75
75
  rule: {
76
76
  match: thisProject.config.browsersync?.location == 'end' ? /<\/body>/ : /<body[^>]*>/,
77
77
  fn: function (snippet, match) {
78
+ const exposeProxyScript = `<script>window.localProxyURL = ${JSON.stringify(thisProject.config.browsersync?.localProxyURL || '')};<\/script>`;
78
79
  const customScript = `<script async>${thisProject.pageScript}</script>`;
79
- const allScripts = snippet + customScript;
80
+ const allScripts = snippet + exposeProxyScript + customScript;
80
81
  return thisProject.config.browsersync?.location == 'end' ? allScripts + match : match + allScripts;
81
82
  }
82
83
  }
@@ -13,7 +13,20 @@ function redirectAdminFromPort() {
13
13
  if (!isAdmin || urlParams.has('keepPort')) {
14
14
  return;
15
15
  }
16
- url.port = '';
16
+ if (window.localProxyURL && window.localProxyURL !== '') {
17
+ try {
18
+ const proxyUrl = new URL(window.localProxyURL, window.location.origin);
19
+ if (proxyUrl.port) {
20
+ url.port = proxyUrl.port;
21
+ } else {
22
+ url.port = '';
23
+ }
24
+ } catch (e) {
25
+ url.port = '';
26
+ }
27
+ } else {
28
+ url.port = '';
29
+ }
17
30
  socket.emit('sdc:redirectAdminFromPort', {
18
31
  timestamp: Date.now(),
19
32
  port: window.location.port,
package/lib/tui.js CHANGED
@@ -99,7 +99,7 @@ function TUIRoot({ tui }) {
99
99
  React.createElement(
100
100
  Box,
101
101
  {
102
- borderStyle: 'single',
102
+ borderStyle: 'round',
103
103
  borderColor: 'blue',
104
104
  borderTop: false,
105
105
  paddingX: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "5.6.9",
3
+ "version": "5.6.11",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"