@pacaf/wizard-ux 2.0.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.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # WizardUX — Browser-Based Setup
2
+
3
+ A browser-based UX for the PAppsCAFoundations setup wizard. Runs alongside the CLI wizard, sharing the same `.wizard-state.json` so you can switch between them at any time.
4
+
5
+ > Both the CLI wizard at [`../wizard/`](../wizard) and this browser wizard are fully supported entry points. WizardUX now keeps the full nine-step setup flow in the browser, using server-side runners and live logs for long-running commands.
6
+
7
+ ## Quick start
8
+
9
+ From the repo root:
10
+
11
+ ```bash
12
+ npm run wizard:ux
13
+ ```
14
+
15
+ This installs `wizard-ux` dependencies on first run, starts the Fastify server on `http://127.0.0.1:5174`, and opens your browser. Press `Ctrl+C` to stop.
16
+
17
+ ## What it does
18
+
19
+ - Beautiful Fluent UI v9 interface — same stack you'll use to build your Code Apps.
20
+ - Step navigator with progress, jump-to-step, resume detection.
21
+ - Live log panel with SSE streaming for steps that run server-side.
22
+ - Summary page that surfaces every value collected so far.
23
+ - Diagnostics view of system tooling and raw state.
24
+
25
+ ## v0 scope
26
+
27
+ | Step | Browser support |
28
+ |---|---|
29
+ | 1. Prerequisites | Read-only check screen |
30
+ | 2. Project & environment | Full form |
31
+ | 3. App Registration | Full form with optional 1Password read/save |
32
+ | 4. Auth Setup | Full form + live PAC auth output |
33
+ | 5. Publisher | Full form (auto or create new) |
34
+ | 6. Solution | Full form (auto or create new) |
35
+ | 7. Scaffold | Full form + live scaffold output |
36
+ | 8. Connectors | Native defer/notes step |
37
+ | 9. Verify & deploy | Full form + live build/deploy output |
38
+
39
+ All nine steps now stay inside WizardUX. App registration values are collected in browser forms, credentials can be read from or synced to 1Password, PAC auth output streams through the live log, scaffolding runs server-side, and verify/deploy can build and push without opening the old CLI wizard.
40
+
41
+ ## Architecture
42
+
43
+ ```
44
+ wizard-ux/
45
+ ├── server/ Fastify API on :5174
46
+ │ ├── routes/ /api/state, /api/system, /api/steps, /api/steps/:n/stream
47
+ │ └── steps/ Per-step questions() + apply() modules (mirror wizard/steps/*)
48
+ └── src/ React 19 + Fluent UI v9 + TanStack Query
49
+ ├── pages/ Welcome, StepRunner, Summary, Diagnostics
50
+ ├── components/ AppHeader, StepNav, QuestionCard, LiveLog, EmbeddedTerminal, HeroBackground
51
+ └── theme/ Custom Power Platform brand ramp + light/dark/system mode
52
+ ```
53
+
54
+ ## Security
55
+
56
+ - Server binds to `127.0.0.1` only.
57
+ - CSRF token issued on `/api/handshake`, required on every mutating call.
58
+ - Same-origin enforced via CORS.
59
+ - Client secrets are held in memory on the server only — never sent back to the browser, never written to logs.
60
+ - Auto-shutdown after 10 minutes of API inactivity.
61
+
62
+ ## How it differs from the CLI
63
+
64
+ The CLI ([`../wizard/`](../wizard)) is the authoritative pipeline. It calls the same `wizard/lib/*` helpers WizardUX does. You can:
65
+ 1. Start in WizardUX, finish in the CLI.
66
+ 2. Start in the CLI, finish in WizardUX.
67
+ 3. Use WizardUX as a state inspector while the CLI runs in another terminal.
68
+
69
+ `.wizard-state.json` is the single source of truth for both.
70
+
71
+ ## Build for production
72
+
73
+ ```bash
74
+ npm run wizard:ux:build # emits wizard-ux/dist/
75
+ NODE_ENV=production npm run wizard:ux # serves the built app
76
+ ```
77
+
78
+ In production mode, Vite is not loaded — Fastify serves the prebuilt SPA from `dist/`.
79
+
80
+ ## Roadmap
81
+
82
+ - v1: Connector picker UI for step 8 with connection discovery and data-source registration.
83
+ - v1: One-click open `make.powerapps.com` to the right environment.
84
+ - v2: Replace `react-resizable-panels` with a Fluent-native splitter when one ships.
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ // pacaf-wizard-ux — boots the Fastify server which serves the wizard UX.
3
+ import { fileURLToPath } from 'node:url';
4
+ import { dirname, join } from 'node:path';
5
+ import { spawn } from 'node:child_process';
6
+
7
+ const here = dirname(fileURLToPath(import.meta.url));
8
+ const serverEntry = join(here, '..', 'server', 'index.mjs');
9
+
10
+ const child = spawn(process.execPath, [serverEntry, ...process.argv.slice(2)], {
11
+ stdio: 'inherit',
12
+ });
13
+
14
+ child.on('exit', (code, signal) => {
15
+ if (signal) {
16
+ process.kill(process.pid, signal);
17
+ } else {
18
+ process.exit(code ?? 0);
19
+ }
20
+ });