@chidchanun/bcp 0.1.9 → 0.1.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.
@@ -61,6 +61,11 @@ switch (cliOptions.command) {
61
61
  break;
62
62
  }
63
63
 
64
+ case "update": {
65
+ await runUpdate();
66
+ break;
67
+ }
68
+
64
69
  case "help": {
65
70
  printHelp();
66
71
  break;
@@ -314,11 +319,6 @@ async function runStart() {
314
319
  );
315
320
  }
316
321
 
317
- /*
318
- * Keep build-time configuration frozen in server.mjs/config.json.
319
- * Only explicit runtime environment values and CLI options should
320
- * override the standalone artifact after it has been built.
321
- */
322
322
  if (
323
323
  cliOptions.port !==
324
324
  undefined
@@ -357,6 +357,30 @@ async function runStart() {
357
357
  );
358
358
  }
359
359
 
360
+ async function runUpdate() {
361
+ const rootDirectory =
362
+ resolveProjectRoot(
363
+ cliOptions.rootDirectory
364
+ );
365
+
366
+ const {
367
+ runBcpUpdate,
368
+ } =
369
+ await import(
370
+ "./update.js"
371
+ );
372
+
373
+ await runBcpUpdate({
374
+ rootDirectory,
375
+ target:
376
+ cliOptions.updateTarget,
377
+ check:
378
+ cliOptions.updateCheck,
379
+ dryRun:
380
+ cliOptions.updateDryRun,
381
+ });
382
+ }
383
+
360
384
  function installShutdownHandlers(
361
385
  server: {
362
386
  stop(): Promise<void>;
@@ -505,18 +529,21 @@ Usage:
505
529
  bcp <command> [options]
506
530
 
507
531
  Commands:
508
- dev Start the development server
509
- build Create optimized client assets and standalone server.mjs
510
- start Start the standalone production build
511
- routes Print discovered page and API routes
512
- help Show this help message
513
- version Show framework version
532
+ dev Start the development server
533
+ build Create optimized client assets and standalone server.mjs
534
+ start Start the standalone production build
535
+ routes Print discovered page and API routes
536
+ update [target] Update BCP Framework (default target: latest)
537
+ help Show this help message
538
+ version Show framework version
514
539
 
515
540
  Options:
516
541
  --root <path> Project root directory
517
542
  --port <number> Override configured HTTP port
518
543
  --hostname <host> Override configured HTTP hostname
519
544
  --host <host> Alias for --hostname
545
+ --check Check for a BCP update without changing files
546
+ --dry-run Preview a BCP update without changing files
520
547
  -h, --help Show help
521
548
  -v, --version Show version
522
549
 
@@ -526,10 +553,11 @@ Config precedence:
526
553
 
527
554
  Examples:
528
555
  bcp dev
529
- bcp dev --port 4000
530
556
  bcp build
531
557
  bcp start
532
- bcp start --port 4000
533
558
  bcp routes
559
+ bcp update
560
+ bcp update --check
561
+ bcp update 0.1.10
534
562
  `);
535
563
  }