@qumra/cli 2.4.17 → 2.4.20

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.
Files changed (2) hide show
  1. package/dist/cli.js +22 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -304366,7 +304366,7 @@ class SectionBuilder {
304366
304366
  }
304367
304367
  }
304368
304368
 
304369
- var version$2 = "2.4.17";
304369
+ var version$2 = "2.4.20";
304370
304370
  var pkg = {
304371
304371
  version: version$2};
304372
304372
 
@@ -534474,6 +534474,7 @@ AppTunnelService = __decorate$5([
534474
534474
  let AppDevServerService = class AppDevServerService {
534475
534475
  constructor(logger) {
534476
534476
  this.logger = logger;
534477
+ this.childProcess = null;
534477
534478
  }
534478
534479
  async start(options) {
534479
534480
  const { env, cwd = process.cwd() } = options;
@@ -534484,7 +534485,9 @@ let AppDevServerService = class AppDevServerService {
534484
534485
  cwd,
534485
534486
  env: { ...process.env, ...env },
534486
534487
  shell: true,
534488
+ stdio: ['pipe', 'pipe', 'pipe'],
534487
534489
  });
534490
+ this.childProcess = child;
534488
534491
  (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
534489
534492
  const lines = data.toString().trim().split('\n');
534490
534493
  for (const line of lines) {
@@ -534514,6 +534517,7 @@ let AppDevServerService = class AppDevServerService {
534514
534517
  setTimeout(resolve, 2000);
534515
534518
  // Handle exit
534516
534519
  child.on('exit', (code) => {
534520
+ this.childProcess = null;
534517
534521
  if (code !== 0) {
534518
534522
  this.logger.componentLog('React Router', `Server exited with code ${code}`, 'error');
534519
534523
  }
@@ -534532,7 +534536,9 @@ let AppDevServerService = class AppDevServerService {
534532
534536
  cwd,
534533
534537
  env: { ...process.env, ...env },
534534
534538
  shell: true,
534539
+ stdio: ['pipe', 'pipe', 'pipe'],
534535
534540
  });
534541
+ this.childProcess = child;
534536
534542
  (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
534537
534543
  const lines = data.toString().trim().split('\n');
534538
534544
  for (const line of lines) {
@@ -534562,12 +534568,25 @@ let AppDevServerService = class AppDevServerService {
534562
534568
  setTimeout(resolve, 2000);
534563
534569
  // Handle exit
534564
534570
  child.on('exit', (code) => {
534571
+ this.childProcess = null;
534565
534572
  if (code !== 0) {
534566
534573
  devUI.log('React Router', `Server exited with code ${code}`, 'error');
534567
534574
  }
534568
534575
  });
534569
534576
  });
534570
534577
  }
534578
+ stop() {
534579
+ if (this.childProcess && !this.childProcess.killed && this.childProcess.pid) {
534580
+ try {
534581
+ // Kill the whole process tree spawned by shell: true
534582
+ process.kill(this.childProcess.pid, 'SIGTERM');
534583
+ }
534584
+ catch {
534585
+ // Process already exited
534586
+ }
534587
+ this.childProcess = null;
534588
+ }
534589
+ }
534571
534590
  async getAvailablePort(startPort = 4000) {
534572
534591
  let port = startPort;
534573
534592
  while (true) {
@@ -534657,7 +534676,7 @@ let AppService = class AppService {
534657
534676
  const port = await this.devServer.getAvailablePort();
534658
534677
  // Create tunnel (before UI starts)
534659
534678
  this.logger.componentLog('tunnel', 'Creating tunnel...');
534660
- const localUrl = `http://localhost:${port}`;
534679
+ const localUrl = `http://127.0.0.1:${port}`;
534661
534680
  const developmentUrl = await this.tunnel.createTunnel(localUrl);
534662
534681
  // Update dev data
534663
534682
  await this.appApi.updateDevData(developmentUrl, qumraConfig.clientId);
@@ -534682,6 +534701,7 @@ let AppService = class AppService {
534682
534701
  shortcuts: [
534683
534702
  {
534684
534703
  key: 'q', label: 'Quit', handler: () => {
534704
+ this.devServer.stop();
534685
534705
  devUI.stop();
534686
534706
  this.tunnel.stopTunnel();
534687
534707
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qumra/cli",
3
- "version": "2.4.17",
3
+ "version": "2.4.20",
4
4
  "description": "Official CLI for Qumra Cloud e-commerce platform. Build, develop, and deploy themes and apps.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {