@wyxos/zephyr 0.2.10 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/release-node.mjs +113 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyxos/zephyr",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "A streamlined deployment tool for web applications with intelligent Laravel project detection",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
@@ -308,8 +308,38 @@ async function runBuild(skipBuild, pkg, rootDir = process.cwd()) {
308
308
  }
309
309
 
310
310
  logStep('Building project...')
311
- await runCommand('npm', ['run', 'build'], { cwd: rootDir })
312
- logSuccess('Build completed.')
311
+
312
+ let dotInterval = null
313
+ try {
314
+ // Capture output and show dots as progress
315
+ process.stdout.write(' ')
316
+ dotInterval = setInterval(() => {
317
+ process.stdout.write('.')
318
+ }, 200)
319
+
320
+ await runCommand('npm', ['run', 'build'], { capture: true, cwd: rootDir })
321
+
322
+ if (dotInterval) {
323
+ clearInterval(dotInterval)
324
+ dotInterval = null
325
+ }
326
+ process.stdout.write('\n')
327
+ logSuccess('Build completed.')
328
+ } catch (error) {
329
+ // Clear dots and show error output
330
+ if (dotInterval) {
331
+ clearInterval(dotInterval)
332
+ dotInterval = null
333
+ }
334
+ process.stdout.write('\n')
335
+ if (error.stdout) {
336
+ console.error(error.stdout)
337
+ }
338
+ if (error.stderr) {
339
+ console.error(error.stderr)
340
+ }
341
+ throw error
342
+ }
313
343
  }
314
344
 
315
345
  async function runLibBuild(skipBuild, pkg, rootDir = process.cwd()) {
@@ -324,8 +354,38 @@ async function runLibBuild(skipBuild, pkg, rootDir = process.cwd()) {
324
354
  }
325
355
 
326
356
  logStep('Building library...')
327
- await runCommand('npm', ['run', 'build:lib'], { cwd: rootDir })
328
- logSuccess('Library built.')
357
+
358
+ let dotInterval = null
359
+ try {
360
+ // Capture output and show dots as progress
361
+ process.stdout.write(' ')
362
+ dotInterval = setInterval(() => {
363
+ process.stdout.write('.')
364
+ }, 200)
365
+
366
+ await runCommand('npm', ['run', 'build:lib'], { capture: true, cwd: rootDir })
367
+
368
+ if (dotInterval) {
369
+ clearInterval(dotInterval)
370
+ dotInterval = null
371
+ }
372
+ process.stdout.write('\n')
373
+ logSuccess('Library built.')
374
+ } catch (error) {
375
+ // Clear dots and show error output
376
+ if (dotInterval) {
377
+ clearInterval(dotInterval)
378
+ dotInterval = null
379
+ }
380
+ process.stdout.write('\n')
381
+ if (error.stdout) {
382
+ console.error(error.stdout)
383
+ }
384
+ if (error.stderr) {
385
+ console.error(error.stderr)
386
+ }
387
+ throw error
388
+ }
329
389
 
330
390
  // Check for lib changes and commit them if any
331
391
  const { stdout: statusAfterBuild } = await runCommand('git', ['status', '--porcelain'], { capture: true, cwd: rootDir })
@@ -502,34 +562,62 @@ async function deployGHPages(skipDeploy, pkg, rootDir = process.cwd()) {
502
562
 
503
563
  const worktreeDir = path.resolve(rootDir, '.gh-pages')
504
564
 
565
+ let dotInterval = null
505
566
  try {
506
- await runCommand('git', ['worktree', 'remove', worktreeDir, '-f'], { cwd: rootDir })
507
- } catch { }
567
+ // Capture output and show dots as progress
568
+ process.stdout.write(' ')
569
+ dotInterval = setInterval(() => {
570
+ process.stdout.write('.')
571
+ }, 200)
508
572
 
509
- try {
510
- await runCommand('git', ['worktree', 'add', worktreeDir, 'gh-pages'], { cwd: rootDir })
511
- } catch {
512
- await runCommand('git', ['worktree', 'add', worktreeDir, '-b', 'gh-pages'], { cwd: rootDir })
513
- }
573
+ try {
574
+ await runCommand('git', ['worktree', 'remove', worktreeDir, '-f'], { capture: true, cwd: rootDir })
575
+ } catch { }
514
576
 
515
- await runCommand('git', ['-C', worktreeDir, 'config', 'user.name', 'wyxos'])
516
- await runCommand('git', ['-C', worktreeDir, 'config', 'user.email', 'github@wyxos.com'])
577
+ try {
578
+ await runCommand('git', ['worktree', 'add', worktreeDir, 'gh-pages'], { capture: true, cwd: rootDir })
579
+ } catch {
580
+ await runCommand('git', ['worktree', 'add', worktreeDir, '-b', 'gh-pages'], { capture: true, cwd: rootDir })
581
+ }
517
582
 
518
- // Clear worktree directory
519
- for (const entry of fs.readdirSync(worktreeDir)) {
520
- if (entry === '.git') continue
521
- const target = path.join(worktreeDir, entry)
522
- fs.rmSync(target, { recursive: true, force: true })
523
- }
583
+ await runCommand('git', ['-C', worktreeDir, 'config', 'user.name', 'wyxos'], { capture: true })
584
+ await runCommand('git', ['-C', worktreeDir, 'config', 'user.email', 'github@wyxos.com'], { capture: true })
585
+
586
+ // Clear worktree directory
587
+ for (const entry of fs.readdirSync(worktreeDir)) {
588
+ if (entry === '.git') continue
589
+ const target = path.join(worktreeDir, entry)
590
+ fs.rmSync(target, { recursive: true, force: true })
591
+ }
524
592
 
525
- // Copy dist to worktree
526
- fs.cpSync(distPath, worktreeDir, { recursive: true })
593
+ // Copy dist to worktree
594
+ fs.cpSync(distPath, worktreeDir, { recursive: true })
527
595
 
528
- await runCommand('git', ['-C', worktreeDir, 'add', '-A'])
529
- await runCommand('git', ['-C', worktreeDir, 'commit', '-m', `deploy: demo ${new Date().toISOString()}`, '--allow-empty'])
530
- await runCommand('git', ['-C', worktreeDir, 'push', '-f', 'origin', 'gh-pages'])
596
+ await runCommand('git', ['-C', worktreeDir, 'add', '-A'], { capture: true })
597
+ await runCommand('git', ['-C', worktreeDir, 'commit', '-m', `deploy: demo ${new Date().toISOString()}`, '--allow-empty'], { capture: true })
598
+ await runCommand('git', ['-C', worktreeDir, 'push', '-f', 'origin', 'gh-pages'], { capture: true })
531
599
 
532
- logSuccess('GitHub Pages deployment completed.')
600
+ if (dotInterval) {
601
+ clearInterval(dotInterval)
602
+ dotInterval = null
603
+ }
604
+ process.stdout.write('\n')
605
+ logSuccess('GitHub Pages deployment completed.')
606
+ } catch (error) {
607
+ // Clear dots and show error output
608
+ if (dotInterval) {
609
+ clearInterval(dotInterval)
610
+ dotInterval = null
611
+ }
612
+ process.stdout.write('\n')
613
+ if (error.stdout) {
614
+ console.error(error.stdout)
615
+ }
616
+ if (error.stderr) {
617
+ console.error(error.stderr)
618
+ }
619
+ throw error
620
+ }
533
621
  }
534
622
 
535
623
  export async function releaseNode() {