@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.
- package/CHANGELOG.md +83 -1
- package/README.md +263 -8
- package/docs/form-actions.md +314 -0
- package/docs/releasing.md +34 -19
- package/docs/route-guards.md +240 -0
- package/docs/updating.md +130 -0
- package/package.json +1 -1
- package/packages/bundler/src/server-production-actions.ts +523 -0
- package/packages/bundler/src/server-production-guards.ts +497 -0
- package/packages/bundler/src/server-production-middleware.ts +50 -8
- package/packages/cli/src/args.ts +58 -0
- package/packages/cli/src/index.ts +41 -13
- package/packages/cli/src/update.ts +860 -0
- package/packages/client/src/form.tsx +548 -0
- package/packages/client/src/index.tsx +11 -0
- package/packages/client/src/loader-data.tsx +171 -41
- package/packages/client/src/server.ts +6 -0
- package/packages/server/src/form-action-dev-proxy.ts +601 -0
- package/packages/server/src/form-action-transport.ts +271 -0
- package/packages/server/src/form-action.ts +493 -0
- package/packages/server/src/middleware-dev-server.ts +56 -2
- package/packages/server/src/page-guard.ts +529 -0
- package/packages/server/src/page-loader.ts +317 -20
- package/packages/server/src/standalone-production-runtime-v2-action.ts +765 -0
- package/packages/server/src/standalone-production-runtime-v2-guard.ts +815 -0
- package/packages/server/src/standalone-production-runtime-v3.ts +1 -1
|
@@ -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
|
|
509
|
-
build
|
|
510
|
-
start
|
|
511
|
-
routes
|
|
512
|
-
|
|
513
|
-
|
|
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
|
}
|