@devframes/hub-ui-onboard 1.3.0 → 1.3.2
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/dist/client/embedded.js +5 -20
- package/dist/index.d.mts +0 -4
- package/dist/index.mjs +4 -8
- package/package.json +5 -5
package/dist/client/embedded.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/client/.generated/css.ts
|
|
2
2
|
var e = import.meta.url, t = new URL("./", e), n = 1e3, r = "devframes-onboard-hidden", i = (e, n) => fetch(new URL(`__onboard/${e}`, t), n);
|
|
3
3
|
async function a() {
|
|
4
4
|
return (await i("status")).json();
|
|
@@ -112,21 +112,13 @@ function p(e) {
|
|
|
112
112
|
}
|
|
113
113
|
async function W() {
|
|
114
114
|
let e = await a();
|
|
115
|
-
|
|
116
|
-
t.remove(), await o();
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
U(e), e.state === "installing" && setTimeout(() => void W(), n);
|
|
115
|
+
e.state === "ready" ? (t.remove(), await o()) : (U(e), e.state === "installing" && setTimeout(() => void W(), n));
|
|
120
116
|
}
|
|
121
117
|
async function G() {
|
|
122
|
-
|
|
123
|
-
await W(), N.hidden = !1, N.textContent = h.refused;
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
U({
|
|
118
|
+
P.disabled = !0, I.textContent = h.confirming, (await i("install", { method: "POST" })).ok ? (U({
|
|
127
119
|
...e,
|
|
128
120
|
state: "installing"
|
|
129
|
-
}), await W();
|
|
121
|
+
}), await W()) : (await W(), N.hidden = !1, N.textContent = h.refused);
|
|
130
122
|
}
|
|
131
123
|
async function K() {
|
|
132
124
|
(await i("disable", { method: "POST" })).ok && t.remove();
|
|
@@ -136,13 +128,6 @@ function p(e) {
|
|
|
136
128
|
async function m() {
|
|
137
129
|
if (window.parent !== window || sessionStorage.getItem(r)) return;
|
|
138
130
|
let e = await a();
|
|
139
|
-
|
|
140
|
-
if (e.state === "ready") {
|
|
141
|
-
await o();
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
p(e);
|
|
145
|
-
}
|
|
131
|
+
e.state !== "disabled" && e.state !== "installed" && (e.state === "ready" ? await o() : p(e));
|
|
146
132
|
}
|
|
147
133
|
m();
|
|
148
|
-
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
1
|
/** A logo URL, or one per color scheme. Same shape as hub-ui's `BrandingLogo`. */
|
|
3
2
|
type OnboardingLogo = string | {
|
|
4
3
|
light: string;
|
|
@@ -102,8 +101,6 @@ interface Onboarding {
|
|
|
102
101
|
/** `<base>embedded.js`: the `<script type="module">` URL to inject. */
|
|
103
102
|
scriptSrc: string;
|
|
104
103
|
}
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/index.d.ts
|
|
107
104
|
export declare function defaultMessages(productName: string): OnboardingMessages;
|
|
108
105
|
/**
|
|
109
106
|
* Create the stand-in for a hub UI that is not installed yet: a request
|
|
@@ -111,5 +108,4 @@ export declare function defaultMessages(productName: string): OnboardingMessages
|
|
|
111
108
|
* `__onboard/*` routes it talks to.
|
|
112
109
|
*/
|
|
113
110
|
export declare function createOnboarding(options: CreateOnboardingOptions): Onboarding;
|
|
114
|
-
//#endregion
|
|
115
111
|
export type { CreateOnboardingOptions, Onboarding, OnboardingBranding, OnboardingConfirmation, OnboardingHandler, OnboardingLogo, OnboardingMessages, OnboardingState, OnboardingStatus };
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { fileURLToPath } from "node:url";
|
|
|
9
9
|
import { Diagnostic, createConsoleReporter, defineDiagnostics } from "nostics";
|
|
10
10
|
import { detect, resolveCommand } from "package-manager-detector";
|
|
11
11
|
import { exec } from "tinyexec";
|
|
12
|
-
|
|
12
|
+
// src/diagnostics.ts
|
|
13
13
|
/**
|
|
14
14
|
* `DF90xx` is this package's range (see `.agents/08-diagnostics.md`). It
|
|
15
15
|
* uses `nostics` directly: the package must stay free of `devframe` so a
|
|
@@ -57,8 +57,7 @@ const diagnostics = defineDiagnostics({
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
//#region src/install.ts
|
|
60
|
+
// src/install.ts
|
|
62
61
|
/** The `add` command for the project's package manager, `npm` when none is detected. */
|
|
63
62
|
async function resolveInstallCommand(plan) {
|
|
64
63
|
const agent = (await detect({ cwd: plan.cwd }))?.agent ?? "npm";
|
|
@@ -109,8 +108,7 @@ function namedPackages(plan) {
|
|
|
109
108
|
function packageName(spec) {
|
|
110
109
|
return /^((?:@[\w.~-]+\/)?[\w.~-]+)(?:@[^/]*)?$/.exec(spec)?.[1];
|
|
111
110
|
}
|
|
112
|
-
|
|
113
|
-
//#region src/terminal-confirm.ts
|
|
111
|
+
// src/terminal-confirm.ts
|
|
114
112
|
const ANSWER_MINUTES = 5;
|
|
115
113
|
/**
|
|
116
114
|
* The default `onConfirm`: a `y/N` question in the terminal that runs the dev
|
|
@@ -149,8 +147,7 @@ function confirmInTerminal(command, input = process.stdin) {
|
|
|
149
147
|
input.on("data", onData);
|
|
150
148
|
});
|
|
151
149
|
}
|
|
152
|
-
|
|
153
|
-
//#region src/index.ts
|
|
150
|
+
// src/index.ts
|
|
154
151
|
const STATE_FILE = "hub-ui-onboard.json";
|
|
155
152
|
/** `devframes` → `/devframes/`, same rule as `normalizeHubBase` in `@devframes/hub`. */
|
|
156
153
|
function normalizeBase(base) {
|
|
@@ -375,5 +372,4 @@ function createOnboarding(options) {
|
|
|
375
372
|
scriptSrc: `${base}embedded.js`
|
|
376
373
|
};
|
|
377
374
|
}
|
|
378
|
-
//#endregion
|
|
379
375
|
export { createOnboarding, defaultMessages };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/hub-ui-onboard",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "A tiny stand-in for the devframe hub UI: a floating button that installs it on demand.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"tinyexec": "^1.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^26.6.
|
|
37
|
-
"tsdown": "0.23.
|
|
36
|
+
"@types/node": "^26.6.6",
|
|
37
|
+
"tsdown": "^0.23.4",
|
|
38
38
|
"tsx": "^4.23.15",
|
|
39
|
-
"unocss": "^66.
|
|
40
|
-
"vite": "^8.3.
|
|
39
|
+
"unocss": "^66.12.0",
|
|
40
|
+
"vite": "^8.3.5",
|
|
41
41
|
"vitest": "^5.0.5"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|