You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 401ebed
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/content/1.guide/23.hub-ui-onboard.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,14 +51,14 @@ Install changes `package.json` and the lockfile, and a dev server can be reachab
51
51
52
52
When stdin is not a TTY (CI, a detached container, a task runner that pipes stdin), nobody can answer. The onboarding then refuses at once with [DF9006](/errors/DF9006). Only one question is open at a time: more clicks while it is open share its answer. A `POST` from another origin is refused with `403` before any question.
53
53
54
-
To ask in another way, pass `confirm`. It gets the `packages`, the exact `command`, and the panel's `request`, and returns `true` to allow the install. For example, a Nuxt module can ask through `consola`:
54
+
To ask in another way, pass `onConfirm`. It gets the `packages`, the exact `command`, and the panel's `request`, and returns `true` to allow the install. For example, a Nuxt module can ask through `consola`:
55
55
56
56
```ts
57
57
import { consola } from'consola'
58
58
59
59
const onboarding =createOnboarding({
60
60
packages: ['@nuxt/devtools'],
61
-
confirm: ({ command }) =>consola.prompt(`Run \`${command.join('')}\` for the browser that asked?`, { type: 'confirm' }),
61
+
onConfirm: ({ command }) =>consola.prompt(`Run \`${command.join('')}\` for the browser that asked?`, { type: 'confirm' }),
Copy file name to clipboardExpand all lines: docs/content/6.errors/DF9005.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ description: 'A browser asked to run `{command}`. Type y and press Enter to allo
9
9
10
10
## Cause
11
11
12
-
Install changes `package.json` and the lockfile, and a dev server can be reachable from other devices. So each install that the panel asks for needs the developer's permission. The panel's `POST <base>__onboard/install` waits until you answer. Without a `confirm` option, `createOnboarding()` asks in the terminal that runs the dev server.
12
+
Install changes `package.json` and the lockfile, and a dev server can be reachable from other devices. So each install that the panel asks for needs the developer's permission. The panel's `POST <base>__onboard/install` waits until you answer. Without an `onConfirm` option, `createOnboarding()` asks in the terminal that runs the dev server.
13
13
14
14
## Fix
15
15
16
16
If you clicked Install, type `y` and press Enter. Any other answer refuses the install, and the panel tells the user. If you did not click Install, press Enter. Another device or page can reach this dev server, so bind it to `localhost`.
17
17
18
-
To ask in another way, for example with your own logger, pass a `confirm` function to `createOnboarding()`.
18
+
To ask in another way, for example with your own logger, pass an `onConfirm` function to `createOnboarding()`.
Copy file name to clipboardExpand all lines: docs/content/6.errors/DF9006.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ description: 'A browser asked to run `{command}`, but no interactive terminal ca
9
9
10
10
## Cause
11
11
12
-
Each install that the panel asks for needs the developer's permission ([DF9005](/errors/DF9005)). Without a `confirm` option, `createOnboarding()` asks in the terminal. Here stdin is not a TTY, so nobody can answer. This happens in CI, in a detached container, or when a task runner pipes stdin. The install is refused at once, and the panel tells the user.
12
+
Each install that the panel asks for needs the developer's permission ([DF9005](/errors/DF9005)). Without an `onConfirm` option, `createOnboarding()` asks in the terminal. Here stdin is not a TTY, so nobody can answer. This happens in CI, in a detached container, or when a task runner pipes stdin. The install is refused at once, and the panel tells the user.
13
13
14
14
## Fix
15
15
16
-
Run the command from the panel in a terminal yourself. Or pass a `confirm` function to `createOnboarding()` that asks in another way.
16
+
Run the command from the panel in a terminal yourself. Or pass an `onConfirm` function to `createOnboarding()` that asks in another way.
Copy file name to clipboardExpand all lines: docs/content/8.references/6.hub-api.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,13 +98,13 @@ What `createOnboarding()` from `@devframes/hub-ui-onboard` accepts and serves: [
98
98
|`branding`|`{}`|`productName` (default `Devframes`), `logo` (URL or `{ light, dark }`), `primaryColor`|
99
99
|`messages`| derived from `productName`| Overrides for `title`, `description`, `install`, `confirming`, `refused`, `hide`, `disable`, `installing`, `restart`, `retry`|
100
100
|`onInstalled`| none | Runs after a verified install, or on the first request when the packages already exist; a returned handler takes over `base`|
101
-
|`confirm`|`y/N` in the terminal | Gets `{ packages, command, request }` before each install the panel asks for; return `true` to allow it. Refuses when stdin is not a TTY |
101
+
|`onConfirm`|`y/N` in the terminal | Gets `{ packages, command, request }` before each install the panel asks for; return `true` to allow it. Refuses when stdin is not a TTY |
102
102
103
103
| Route | Serves |
104
104
| --- | --- |
105
105
|`GET <base>embedded.js`| the floating button, a self-contained ES module |
0 commit comments