epicshop 6.69.0 → 6.70.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.
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { getErrorMessage } from '@epic-web/workshop-utils/utils';
4
4
  import chalk from 'chalk';
5
- import { runCommand, } from "../utils/command-runner.js";
5
+ import { runCommand } from "../utils/command-runner.js";
6
6
  function isPackageJson(value) {
7
7
  if (!value || typeof value !== 'object')
8
8
  return false;
@@ -104,6 +104,7 @@ export async function start(options = {}) {
104
104
  let server = null;
105
105
  let child = null;
106
106
  let restarting = false;
107
+ let childWasKilled = false;
107
108
  let childPort = null;
108
109
  let childPortPromiseResolve = null;
109
110
  let childPortPromise;
@@ -171,25 +172,37 @@ export async function start(options = {}) {
171
172
  console.log('\nšŸ‘€ Checking for updates...');
172
173
  try {
173
174
  const { updateLocalRepo } = await import('@epic-web/workshop-utils/git.server');
175
+ // Kill child FIRST to release file handles (prevents EBUSY on Windows)
176
+ console.log('šŸ›‘ Stopping app for update...');
177
+ restarting = true;
178
+ childWasKilled = true;
179
+ await killChild(child);
180
+ // Now run the update (npm install won't hit file locks)
174
181
  const result = await updateLocalRepo();
175
182
  if (result.status === 'success') {
176
183
  console.log(`āœ… ${result.message}`);
177
184
  console.log('\nšŸ”„ Restarting...');
178
- restarting = true;
179
- await killChild(child);
180
- restarting = false;
181
185
  spawnChild();
186
+ restarting = false;
182
187
  const ready = await waitForChildReady();
183
188
  return ready;
184
189
  }
185
190
  else {
186
191
  console.error(`āŒ ${result.message}`);
187
- console.error('Update failed. Please try again or see the repo for manual setup.');
192
+ console.error('Update failed. Restarting app without updates...');
193
+ spawnChild();
194
+ restarting = false;
195
+ await waitForChildReady();
188
196
  return false;
189
197
  }
190
198
  }
191
199
  catch (error) {
192
200
  console.error('āŒ Update functionality not available:', error);
201
+ // Restart app even if update failed
202
+ if (!child || childWasKilled) {
203
+ spawnChild();
204
+ restarting = false;
205
+ }
193
206
  return false;
194
207
  }
195
208
  }
@@ -263,6 +276,8 @@ export async function start(options = {}) {
263
276
  stdio: ['pipe', 'pipe', 'inherit'],
264
277
  env: childEnv,
265
278
  });
279
+ // Reset flag only after spawn succeeds
280
+ childWasKilled = false;
266
281
  if (child.stdout) {
267
282
  child.stdout.on('data', (data) => {
268
283
  process.stdout.write(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epicshop",
3
- "version": "6.69.0",
3
+ "version": "6.70.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -99,7 +99,7 @@
99
99
  "build:watch": "nx watch --projects=epicshop -- nx run \\$NX_PROJECT_NAME:build"
100
100
  },
101
101
  "dependencies": {
102
- "@epic-web/workshop-utils": "6.69.0",
102
+ "@epic-web/workshop-utils": "6.70.0",
103
103
  "@inquirer/prompts": "^8.2.0",
104
104
  "@sentry/node": "^10.35.0",
105
105
  "chalk": "^5.6.2",