@se-studio/site-check 2.1.2 → 2.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix `smoke-test:audit` hanging after `Running smoke tests...`: replace `spawnSync` with async spawn so piped dev-server logs keep draining during smoke HTTP requests.
8
+
3
9
  ## 2.1.2
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/site-check",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Validate SE marketing sites (sitemap, llms.txt) and download markdown files preserving structure",
5
5
  "repository": {
6
6
  "type": "git",
@@ -151,10 +151,24 @@ function appendTeeLog(buffer, chunk, stream) {
151
151
  }
152
152
 
153
153
  function attachTeeHandlers(child, buffer) {
154
+ child.stdout?.setEncoding('utf8');
155
+ child.stderr?.setEncoding('utf8');
154
156
  child.stdout?.on('data', (chunk) => appendTeeLog(buffer, chunk, process.stdout));
155
157
  child.stderr?.on('data', (chunk) => appendTeeLog(buffer, chunk, process.stderr));
156
158
  }
157
159
 
160
+ function runSmokeTests(appDir, smokeEnv) {
161
+ return new Promise((resolve, reject) => {
162
+ const child = spawn('pnpm', ['smoke-test:run'], {
163
+ cwd: appDir,
164
+ stdio: 'inherit',
165
+ env: smokeEnv,
166
+ });
167
+ child.on('error', reject);
168
+ child.on('exit', (code) => resolve(code ?? 1));
169
+ });
170
+ }
171
+
158
172
  async function loadCacheLogAudit() {
159
173
  const modulePath = path.join(packageDir, 'dist/smoke-test/cache-log-audit.js');
160
174
  return import(modulePath);
@@ -256,12 +270,9 @@ try {
256
270
  }
257
271
 
258
272
  console.log('Running smoke tests...');
259
- const runResult = spawnSync('pnpm', ['smoke-test:run'], {
260
- cwd: appDir,
261
- stdio: 'inherit',
262
- env: smokeEnv,
263
- });
264
- exitCode = runResult.status ?? 1;
273
+ // Must not use spawnSync here when audit pipes server logs — sync blocks the event loop,
274
+ // pipe buffers fill, and the dev server deadlocks mid-compile.
275
+ exitCode = await runSmokeTests(appDir, smokeEnv);
265
276
 
266
277
  if (auditCacheLogsEnabled && spawnedServer) {
267
278
  const { auditCacheLogs, formatCacheLogAuditReport, getCacheLogAuditExitCode } =