sdc-build-wp 5.3.2 → 5.3.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sefer Design Company LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/lib/project.js CHANGED
@@ -153,6 +153,24 @@ export async function init() {
153
153
  process.on('uncaughtException', async (error) => {
154
154
  log('error', `Uncaught Exception: ${error.message}`);
155
155
  log('warn', 'Attempting graceful shutdown');
156
+
157
+ // Clean up terminal state
158
+ if (process.stdin.isTTY) {
159
+ try {
160
+ process.stdin.setRawMode(false);
161
+ process.stdin.pause();
162
+ process.stdin.removeAllListeners('data');
163
+ } catch (e) {
164
+ // Ignore errors
165
+ }
166
+ }
167
+
168
+ if (process.stdout.isTTY) {
169
+ process.stdout.write('\x1b[?25h');
170
+ process.stdout.write('\x1b[0m');
171
+ }
172
+
173
+ tui.destroy();
156
174
  await utils.stopActiveComponents();
157
175
  process.exit(1);
158
176
  });
@@ -167,7 +185,19 @@ export async function init() {
167
185
  await project.configWatcher.close();
168
186
  project.configWatcher = null;
169
187
  }
188
+
189
+ if (process.stdin.isTTY) {
190
+ try {
191
+ process.stdin.setRawMode(false);
192
+ } catch (e) {
193
+ // Ignore errors if raw mode is already off
194
+ }
195
+ process.stdin.pause();
196
+ process.stdin.removeAllListeners('data');
197
+ }
198
+
170
199
  tui.destroy();
200
+
171
201
  if (tui.getLogHistory) {
172
202
  const logDump = tui.getLogHistory();
173
203
  if (logDump && logDump.trim()) {
@@ -175,13 +205,29 @@ export async function init() {
175
205
  }
176
206
  }
177
207
  log('info', `Exited sdc-build-wp`);
178
- if (process.stdin.isTTY) {
179
- process.stdin.setRawMode(false);
180
- process.stdin.pause();
208
+
209
+ if (process.stdout.isTTY) {
210
+ process.stdout.write('\x1b[?25h');
211
+ process.stdout.write('\x1b[0m');
181
212
  }
213
+
182
214
  setTimeout(() => process.exit(0), 100);
183
215
  });
184
216
 
217
+ process.on('exit', () => {
218
+ if (process.stdin.isTTY) {
219
+ try {
220
+ process.stdin.setRawMode(false);
221
+ } catch (e) {
222
+ // Ignore errors
223
+ }
224
+ }
225
+ if (process.stdout.isTTY) {
226
+ process.stdout.write('\x1b[?25h');
227
+ process.stdout.write('\x1b[0m');
228
+ }
229
+ });
230
+
185
231
  }
186
232
 
187
233
  export function keypressListen() {
package/lib/tui.js CHANGED
@@ -27,6 +27,11 @@ class TUI {
27
27
  return;
28
28
  }
29
29
 
30
+ if (process.stdout.isTTY) {
31
+ process.stdout.write('\x1b[?25h');
32
+ process.stdout.write('\x1b[0m');
33
+ }
34
+
30
35
  this.screen = blessed.screen({
31
36
  smartCSR: true,
32
37
  fullUnicode: true,
@@ -332,11 +337,24 @@ class TUI {
332
337
 
333
338
  destroy() {
334
339
  if (this.isInitialized && this.screen) {
340
+ if (this.screen.program) {
341
+ this.screen.program.showCursor();
342
+ this.screen.program.normalBuffer();
343
+ this.screen.program.reset();
344
+ }
345
+
335
346
  this.screen.destroy();
336
347
  this.isInitialized = false;
337
348
  this.screen = null;
338
349
  this.headerBox = null;
339
350
  this.logBox = null;
351
+
352
+ if (process.stdout.isTTY) {
353
+ process.stdout.write('\x1b[?25h');
354
+ process.stdout.write('\x1b[0m');
355
+ process.stdout.write('\x1b[2J');
356
+ process.stdout.write('\x1b[H');
357
+ }
340
358
  }
341
359
  }
342
360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "5.3.2",
3
+ "version": "5.3.4",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"