@adea-ai/app-framework 0.24.0 → 0.24.1
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 +43 -1
- package/dist/framework-source.json +1 -1
- package/dist/release/framework-package-publish.js +4 -2
- package/dist/shell/app-shell.js +21 -33
- package/dist/shell/navigation-drawer.d.ts +12 -0
- package/dist/shell/navigation-drawer.js +42 -0
- package/package.json +13 -2
- package/src/shell/app-shell.tsx +29 -20
- package/src/shell/navigation-drawer.tsx +36 -0
- package/src/app/create-application.ts +0 -245
- package/src/app/service-registry.ts +0 -124
- package/src/ci/toolchain-identity.ts +0 -244
- package/src/cli/cef-helper-cli.ts +0 -21
- package/src/cli/cli-runner.ts +0 -29
- package/src/cli/create-application-cli.ts +0 -62
- package/src/cli/electrobun-shortcut-patch-cli.ts +0 -24
- package/src/cli/framework-update-cli.ts +0 -41
- package/src/cli/release-assets-plan-cli.ts +0 -14
- package/src/cli/release-cut-cli.ts +0 -41
- package/src/cli/release-descriptor-staging-cli.ts +0 -57
- package/src/cli/release-finalize-cli.ts +0 -34
- package/src/cli/release-promote-cli.ts +0 -31
- package/src/cli/release-publish-cli.ts +0 -46
- package/src/cli/release-sign-cli.ts +0 -24
- package/src/cli/release-step-cli.ts +0 -71
- package/src/cli/toolchain-identity-cli.ts +0 -12
- package/src/cli/update-helper-cli.ts +0 -12
- package/src/cli/windows-runtime-patch-cli.ts +0 -17
- package/src/desktop/application-command-client.ts +0 -43
- package/src/desktop/channel-handshake.ts +0 -136
- package/src/desktop/channel-proof.ts +0 -122
- package/src/desktop/desktop-client.ts +0 -303
- package/src/desktop/desktop-gateway.ts +0 -189
- package/src/desktop/desktop-host.ts +0 -335
- package/src/desktop/desktop-stream.ts +0 -324
- package/src/desktop/loopback-policy.ts +0 -41
- package/src/desktop/open-url-channel.ts +0 -79
- package/src/desktop/string-policy.ts +0 -9
- package/src/installer/archive-entry.ts +0 -32
- package/src/installer/command-artifact.ts +0 -307
- package/src/installer/command-qualification-command.ts +0 -75
- package/src/installer/hosted-runner.ts +0 -11
- package/src/installer/installed-payload.ts +0 -408
- package/src/installer/installer-ci-bootstrap.ts +0 -199
- package/src/installer/installer-ci-preflight.ts +0 -61
- package/src/installer/installer-ci-worker.ts +0 -105
- package/src/installer/installer-extraction.ts +0 -367
- package/src/installer/installer-fetch-guard.ts +0 -75
- package/src/installer/installer-identity.ts +0 -331
- package/src/installer/installer-layout.ts +0 -167
- package/src/installer/installer-observation.ts +0 -671
- package/src/installer/installer-process-cleanup.ts +0 -167
- package/src/installer/installer-qualification-command.ts +0 -81
- package/src/installer/installer-renderer-evidence.ts +0 -268
- package/src/installer/installer-upgrade-command.ts +0 -226
- package/src/installer/installer-worker-guard.ts +0 -112
- package/src/installer/native-executable.ts +0 -37
- package/src/installer/upgrade-asset-download.ts +0 -72
- package/src/installer/write-all.ts +0 -19
- package/src/native/app-bundle.ts +0 -86
- package/src/native/cef-helper.ts +0 -471
- package/src/native/desktop-build-hook.ts +0 -21
- package/src/native/electrobun-source-patch.ts +0 -107
- package/src/native/linux-cef-links.ts +0 -14
- package/src/native/native-secret-store.ts +0 -99
- package/src/native/native-utilities.ts +0 -166
- package/src/native/partitioned-window.ts +0 -62
- package/src/native/secure-window.ts +0 -115
- package/src/native/sidecar-services.ts +0 -71
- package/src/native/sidecar.ts +0 -387
- package/src/native/window-bootstrap.ts +0 -77
- package/src/native/windows-build-hook-internal.ts +0 -49
- package/src/native/windows-build-hook.ts +0 -12
- package/src/native/windows-runtime-patch-internal.ts +0 -48
- package/src/native/windows-runtime-patch.ts +0 -15
- package/src/release/feed-release-cut.ts +0 -110
- package/src/release/feed-state.ts +0 -135
- package/src/release/framework-package-publish.ts +0 -163
- package/src/release/framework-update.ts +0 -196
- package/src/release/github-cli.ts +0 -27
- package/src/release/github-release-assets.ts +0 -36
- package/src/release/github-release-cut.ts +0 -237
- package/src/release/github-release-lookup.ts +0 -39
- package/src/release/github-release-promotion.ts +0 -112
- package/src/release/github-release-provenance.ts +0 -65
- package/src/release/github-release-publisher.ts +0 -90
- package/src/release/github-release-qualification.ts +0 -144
- package/src/release/local-provenance.ts +0 -92
- package/src/release/local-release.ts +0 -525
- package/src/release/macos-dmg.ts +0 -113
- package/src/release/release-artifact.ts +0 -53
- package/src/release/release-assets-plan.ts +0 -118
- package/src/release/release-config.ts +0 -420
- package/src/release/release-cut-command.ts +0 -80
- package/src/release/release-cut.ts +0 -133
- package/src/release/release-descriptor-staging.ts +0 -242
- package/src/release/release-finalize.ts +0 -191
- package/src/release/release-promotion-command.ts +0 -36
- package/src/release/release-promotion.ts +0 -132
- package/src/release/release-publication.ts +0 -213
- package/src/release/release-publish-command.ts +0 -163
- package/src/release/release-qualification.ts +0 -397
- package/src/release/release-staging.ts +0 -87
- package/src/release/release-steps.ts +0 -173
- package/src/release/retained-release-build.ts +0 -217
- package/src/shell/application-menu-commands.ts +0 -6
- package/src/shell/application-menu.ts +0 -250
- package/src/updates/channel-update-manager.ts +0 -127
- package/src/updates/desktop-updater.ts +0 -440
- package/src/updates/release-feed.ts +0 -187
- package/src/updates/release-location.ts +0 -101
- package/src/updates/signed-release.ts +0 -311
- package/src/updates/stable-file.ts +0 -32
- package/src/updates/update-arm.ts +0 -107
- package/src/updates/update-channel-store.ts +0 -86
- package/src/updates/update-discovery.ts +0 -113
- package/src/updates/update-download.ts +0 -82
- package/src/updates/update-exclusive-rename.ts +0 -58
- package/src/updates/update-extraction.ts +0 -261
- package/src/updates/update-handoff-plan.ts +0 -75
- package/src/updates/update-helper.ts +0 -87
- package/src/updates/update-launch.ts +0 -33
- package/src/updates/update-manager.ts +0 -130
- package/src/updates/update-process-fence.ts +0 -125
- package/src/updates/update-resume.ts +0 -34
- package/src/updates/update-shutdown.ts +0 -37
- package/src/updates/update-swap-stage.ts +0 -75
- package/src/updates/update-swap.ts +0 -30
package/README.md
CHANGED
|
@@ -34,6 +34,45 @@ promotion; inputs must come from the authenticated release provider and the
|
|
|
34
34
|
application's trusted release configuration. These functions do not fetch or
|
|
35
35
|
verify release signatures, create artifacts, publish releases, or promote them.
|
|
36
36
|
|
|
37
|
+
## Package entry points
|
|
38
|
+
|
|
39
|
+
Import a subpath; the package has no root export. Entries marked _solid_ also
|
|
40
|
+
export TypeScript source under the `solid` condition, which a Vite consumer with
|
|
41
|
+
`vite-plugin-solid` compiles itself. Entries marked _source only_ export
|
|
42
|
+
TypeScript source alone, and the rest resolve to `dist`. The package ships only
|
|
43
|
+
the source those entries reach, plus the Electrobun patches in `src/native`; a
|
|
44
|
+
test checks the file list against the exports.
|
|
45
|
+
|
|
46
|
+
| Area | Subpaths (`@adea-ai/app-framework/<subpath>`) |
|
|
47
|
+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| Application and shell | `application`, `app-shell`, `app-utilities`, `app-settings`, `app-help`, `app-about`, `update-surface` (all _solid_), `service-registry`, `application-menu`, `application-command-client` |
|
|
49
|
+
| Appearance | `appearance-host`, `appearance-preferences`, `appearance-surface`, `custom-theme-library`, `window-surface` (all _solid_) |
|
|
50
|
+
| Desktop host | `desktop-host`, `desktop-gateway`, `desktop-client`, `desktop-stream`, `channel-handshake`, `channel-proof`, `loopback-policy`, `open-url-channel`, `client-assets` (source only) |
|
|
51
|
+
| Native windows and OS | `renderer-profile`, `secure-window`, `partitioned-window`, `window-options` (source only), `native-utilities`, `native-secret-store`, `app-bundle`, `sidecar`, `sidecar-services`, `desktop-build-hook`, `windows-runtime-patch` |
|
|
52
|
+
| Updates | `desktop-updater`, `update-manager`, `channel-update-manager`, `update-channel-store`, `update-discovery`, `update-download`, `update-extraction`, `signed-release`, `update-adapter` (_solid_), `update-state` and `release-version` (source only), `update-helper.js` (bundled helper) |
|
|
53
|
+
| Release tooling | `release-config`, `release-cut`, `release-steps`, `release-staging`, `release-artifact`, `release-assets-plan`, `release-descriptor-staging`, `release-publication`, `release-publish-command`, `release-promotion`, `retained-release-build`, `github-release-publisher`, `github-release-qualification`, `github-release-promotion`, `macos-dmg` |
|
|
54
|
+
| Installer qualification | `installer-layout`, `installer-identity`, `installer-extraction`, `installed-payload`, `installer-observation`, `installer-qualification-command`, `installer-renderer-evidence` |
|
|
55
|
+
| CI | `toolchain-identity` |
|
|
56
|
+
|
|
57
|
+
Commands (package `bin` entries):
|
|
58
|
+
|
|
59
|
+
| Command | Purpose |
|
|
60
|
+
| --------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `create-adea-app` | Generate an application from the starter template. |
|
|
62
|
+
| `adea-update-app-framework` | Move an app's framework tarball, lockfile and workflow pins to a published release together. |
|
|
63
|
+
| `adea-cut-release` | Cut a `dev` or `daily` release from trusted `main`. |
|
|
64
|
+
| `adea-plan-release-assets` | Validate a dispatched release-assets run and resolve its source and version. |
|
|
65
|
+
| `adea-release-step` | Run a per-platform step: `select-retained`, `stage-build`, `inspect`, `qualify`, `qualify-upgrade`. |
|
|
66
|
+
| `adea-sign-release` | Sign one staged archive's release identity. |
|
|
67
|
+
| `adea-sign-release-descriptors` | Sign channel descriptors for payloads every receipt qualified. |
|
|
68
|
+
| `adea-publish-release` | Publish the current trusted release-assets attempt. |
|
|
69
|
+
| `adea-finalize-release` | Publish a qualified Release Please draft as a prerelease. |
|
|
70
|
+
| `adea-promote-release` | Promote the newest qualified daily to stable after the soak. |
|
|
71
|
+
| `adea-cef-helper` | Print the CEF helper cache key, or build the helper. |
|
|
72
|
+
| `adea-patch-windows-runtime` | Apply the checksum-guarded Windows runtime correction. |
|
|
73
|
+
| `adea-patch-electrobun-shortcuts` | Apply the shipped Windows shortcut patch to an Electrobun checkout. |
|
|
74
|
+
| `adea-toolchain-identity` | Fail a cached task when the Node/Bun toolchain differs from its key. |
|
|
75
|
+
|
|
37
76
|
## Shared application shell
|
|
38
77
|
|
|
39
78
|
`ApplicationShell` composes the published `@adea-ai/ui` rail, toolbar,
|
|
@@ -43,6 +82,8 @@ navigation callback and view content. Optional slots provide workspace and
|
|
|
43
82
|
history controls, search, toolbar actions, rail footer and status content.
|
|
44
83
|
The host controls sidebar state and persisted width; the shell restores focus
|
|
45
84
|
after the narrow-screen sidebar closes and handles the advertised search chord.
|
|
85
|
+
The narrow-screen drawer loads the first time the window is narrow, so a wide
|
|
86
|
+
window never loads its dialog code.
|
|
46
87
|
|
|
47
88
|
Consumers must import `@adea-ai/ui/globals.css` and configure Tailwind to scan
|
|
48
89
|
the UI and framework package source. `tests/consumer` shows a buildable packed
|
|
@@ -704,7 +745,8 @@ Command artifacts are portable command-line payloads an app publishes beside its
|
|
|
704
745
|
desktop payloads, through the same staging, qualification, signing and immutable
|
|
705
746
|
publication. Each `commandArtifacts` entry names its own update identity, the
|
|
706
747
|
directory the release build leaves, one `.tar.gz` asset per release platform and
|
|
707
|
-
the commands that qualify it
|
|
748
|
+
the commands that qualify it. An app can declare up to four kinds, each with up
|
|
749
|
+
to 16 extra qualification environment variables:
|
|
708
750
|
|
|
709
751
|
```json
|
|
710
752
|
"commandArtifacts": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.24.
|
|
1
|
+
{"version":"0.24.1","commit":"d89bf3a900387a95245169973af6d7f28eb95ba8"}
|
|
@@ -8,6 +8,7 @@ import { tmpdir } from "node:os";
|
|
|
8
8
|
// src/release/framework-package-publish.ts
|
|
9
9
|
var packageName = "@adea-ai/app-framework";
|
|
10
10
|
var registryUrl = "https://registry.npmjs.org/";
|
|
11
|
+
var PUBLISH_VISIBILITY_MS = 9e5;
|
|
11
12
|
/** Runs `npm` with arguments in the current directory and the caller's environment. */
|
|
12
13
|
function npmCli(args) {
|
|
13
14
|
return new Promise((resolveRun) => execFile("npm", args, { maxBuffer: 8388608 }, (error, stdout, stderr) => {
|
|
@@ -108,7 +109,7 @@ async function publishFrameworkPackage(options) {
|
|
|
108
109
|
integrity,
|
|
109
110
|
status: "dry-run"
|
|
110
111
|
};
|
|
111
|
-
for (let
|
|
112
|
+
for (let waited = 0, delay = 5e3;; waited += delay, delay = Math.min(delay * 2, 3e4)) {
|
|
112
113
|
const published = await registry(version);
|
|
113
114
|
if (published !== null) {
|
|
114
115
|
if (publishedIntegrity(published) !== integrity) throw new Error("npm published other bytes than the tested package");
|
|
@@ -118,7 +119,8 @@ async function publishFrameworkPackage(options) {
|
|
|
118
119
|
status: "published"
|
|
119
120
|
};
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
+
if (waited >= PUBLISH_VISIBILITY_MS) break;
|
|
123
|
+
await sleep(delay);
|
|
122
124
|
}
|
|
123
125
|
throw new Error("npm does not list the published version yet");
|
|
124
126
|
}
|
package/dist/shell/app-shell.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { className, createComponent, effect, insert, memo, mergeProps, template } from "solid-js/web";
|
|
2
|
-
import { For, Show, createEffect, createSignal, onCleanup, onMount } from "solid-js";
|
|
2
|
+
import { For, Show, Suspense, createEffect, createSignal, lazy, onCleanup, onMount } from "solid-js";
|
|
3
3
|
import { AppShell, AppShellBody, AppShellContent, AppShellMain, SkipLink } from "@adea-ai/ui/components/layout/app-shell";
|
|
4
4
|
import { ContextualSidebar } from "@adea-ai/ui/components/layout/contextual-sidebar";
|
|
5
5
|
import { PixelPane } from "@adea-ai/ui/components/layout/pixel-pane";
|
|
@@ -7,12 +7,12 @@ import { ShellRail } from "@adea-ai/ui/components/layout/shell-rail";
|
|
|
7
7
|
import { ShellTopBar } from "@adea-ai/ui/components/layout/shell-top-bar";
|
|
8
8
|
import { SideRailItem, SideRailSection } from "@adea-ai/ui/components/layout/side-rail";
|
|
9
9
|
import { ActionButton } from "@adea-ai/ui/components/composites/action-button";
|
|
10
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@adea-ai/ui/components/ui/sheet";
|
|
11
10
|
import { TooltipProvider } from "@adea-ai/ui/components/ui/tooltip";
|
|
12
11
|
import { PanelLeftClose, PanelLeftIcon, PanelLeftOpen } from "lucide-solid";
|
|
13
12
|
// src/shell/app-shell.tsx
|
|
14
13
|
var _tmpl$ = /*#__PURE__*/ template(`<div>`);
|
|
15
14
|
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=app-shell-main class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">`);
|
|
15
|
+
var NavigationDrawer = lazy(() => import("./navigation-drawer.js").then((module) => ({ default: module.NavigationDrawer })));
|
|
16
16
|
function createNarrow(query) {
|
|
17
17
|
const [narrow, setNarrow] = createSignal(false);
|
|
18
18
|
createEffect(() => {
|
|
@@ -31,8 +31,10 @@ function ApplicationShell(props) {
|
|
|
31
31
|
let sidebarToggle;
|
|
32
32
|
const narrow = createNarrow(() => props.drawer ? props.narrowQuery ?? "(max-width: 799px)" : void 0);
|
|
33
33
|
const [drawerOpen, setDrawerOpen] = createSignal(false);
|
|
34
|
+
const [drawerMounted, setDrawerMounted] = createSignal(false);
|
|
34
35
|
createEffect(() => {
|
|
35
|
-
if (
|
|
36
|
+
if (narrow()) setDrawerMounted(true);
|
|
37
|
+
else setDrawerOpen(false);
|
|
36
38
|
});
|
|
37
39
|
const leading = () => props.sidebar ?? props.pane;
|
|
38
40
|
const toggleVisible = () => narrow() || Boolean(leading());
|
|
@@ -278,37 +280,23 @@ function ApplicationShell(props) {
|
|
|
278
280
|
}), null);
|
|
279
281
|
insert(_el$, createComponent(Show, {
|
|
280
282
|
get when() {
|
|
281
|
-
return props.drawer;
|
|
283
|
+
return memo(() => !!drawerMounted())() && props.drawer;
|
|
282
284
|
},
|
|
283
|
-
children: (drawer) => createComponent(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
get children() {
|
|
300
|
-
return [createComponent(SheetHeader, {
|
|
301
|
-
"class": "sr-only",
|
|
302
|
-
get children() {
|
|
303
|
-
return createComponent(SheetTitle, { get children() {
|
|
304
|
-
return `${props.name} navigation`;
|
|
305
|
-
} });
|
|
306
|
-
}
|
|
307
|
-
}), memo(() => drawer()(() => setDrawerOpen(false)))];
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
})
|
|
285
|
+
children: (drawer) => createComponent(Suspense, { get children() {
|
|
286
|
+
return createComponent(NavigationDrawer, {
|
|
287
|
+
get name() {
|
|
288
|
+
return props.name;
|
|
289
|
+
},
|
|
290
|
+
get open() {
|
|
291
|
+
return memo(() => !!narrow())() && drawerOpen();
|
|
292
|
+
},
|
|
293
|
+
onOpenChange: setDrawerOpen,
|
|
294
|
+
restoreFocus: () => sidebarToggle,
|
|
295
|
+
get children() {
|
|
296
|
+
return drawer()(() => setDrawerOpen(false));
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
} })
|
|
312
300
|
}), null);
|
|
313
301
|
effect(() => className(_el$, `flex h-screen w-screen flex-col overflow-hidden ${props.class ?? ""}`));
|
|
314
302
|
return _el$;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js';
|
|
2
|
+
/**
|
|
3
|
+
* The narrow-window navigation drawer. The shell loads it the first time the window is
|
|
4
|
+
* narrow, so wide windows never fetch the dialog primitives behind the sheet.
|
|
5
|
+
*/
|
|
6
|
+
export declare function NavigationDrawer(props: {
|
|
7
|
+
name: string;
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange(open: boolean): void;
|
|
10
|
+
restoreFocus(): HTMLElement | undefined;
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createComponent, memo } from "solid-js/web";
|
|
2
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@adea-ai/ui/components/ui/sheet";
|
|
3
|
+
// src/shell/navigation-drawer.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The narrow-window navigation drawer. The shell loads it the first time the window is
|
|
6
|
+
* narrow, so wide windows never fetch the dialog primitives behind the sheet.
|
|
7
|
+
*/
|
|
8
|
+
function NavigationDrawer(props) {
|
|
9
|
+
return createComponent(Sheet, {
|
|
10
|
+
get open() {
|
|
11
|
+
return props.open;
|
|
12
|
+
},
|
|
13
|
+
get onOpenChange() {
|
|
14
|
+
return props.onOpenChange;
|
|
15
|
+
},
|
|
16
|
+
get children() {
|
|
17
|
+
return createComponent(SheetContent, {
|
|
18
|
+
"data-mobile": "true",
|
|
19
|
+
side: "start",
|
|
20
|
+
closeButton: false,
|
|
21
|
+
"class": "w-72 max-w-full",
|
|
22
|
+
onCloseAutoFocus: (event) => {
|
|
23
|
+
const target = props.restoreFocus();
|
|
24
|
+
if (!target) return;
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
target.focus();
|
|
27
|
+
},
|
|
28
|
+
get children() {
|
|
29
|
+
return [createComponent(SheetHeader, {
|
|
30
|
+
"class": "sr-only",
|
|
31
|
+
get children() {
|
|
32
|
+
return createComponent(SheetTitle, { get children() {
|
|
33
|
+
return `${props.name} navigation`;
|
|
34
|
+
} });
|
|
35
|
+
}
|
|
36
|
+
}), memo(() => props.children)];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export { NavigationDrawer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/app-framework",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
|
-
"src",
|
|
27
|
+
"src/app/application.tsx",
|
|
28
|
+
"src/appearance",
|
|
29
|
+
"src/desktop/client-assets.ts",
|
|
30
|
+
"src/native/*.patch",
|
|
31
|
+
"src/native/renderer-profile.ts",
|
|
32
|
+
"src/native/window-options.ts",
|
|
33
|
+
"src/shell",
|
|
34
|
+
"!src/shell/application-menu*.ts",
|
|
35
|
+
"src/updates/release-version.ts",
|
|
36
|
+
"src/updates/update-adapter.ts",
|
|
37
|
+
"src/updates/update-state.ts",
|
|
38
|
+
"src/views",
|
|
28
39
|
"README.md",
|
|
29
40
|
"LICENSE",
|
|
30
41
|
"NOTICE",
|
package/src/shell/app-shell.tsx
CHANGED
|
@@ -14,10 +14,23 @@ import { ShellRail } from '@adea-ai/ui/components/layout/shell-rail'
|
|
|
14
14
|
import { ShellTopBar } from '@adea-ai/ui/components/layout/shell-top-bar'
|
|
15
15
|
import { SideRailItem, SideRailSection } from '@adea-ai/ui/components/layout/side-rail'
|
|
16
16
|
import { ActionButton } from '@adea-ai/ui/components/composites/action-button'
|
|
17
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@adea-ai/ui/components/ui/sheet'
|
|
18
17
|
import { TooltipProvider } from '@adea-ai/ui/components/ui/tooltip'
|
|
19
18
|
import { PanelLeftClose, PanelLeftIcon, PanelLeftOpen } from 'lucide-solid'
|
|
20
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
For,
|
|
21
|
+
Show,
|
|
22
|
+
Suspense,
|
|
23
|
+
createEffect,
|
|
24
|
+
createSignal,
|
|
25
|
+
lazy,
|
|
26
|
+
onCleanup,
|
|
27
|
+
onMount,
|
|
28
|
+
type JSX,
|
|
29
|
+
} from 'solid-js'
|
|
30
|
+
|
|
31
|
+
const NavigationDrawer = lazy(() =>
|
|
32
|
+
import('./navigation-drawer').then((module) => ({ default: module.NavigationDrawer }))
|
|
33
|
+
)
|
|
21
34
|
|
|
22
35
|
export type ApplicationDestination = Readonly<{ id: string; label: string; icon: JSX.Element }>
|
|
23
36
|
export type ApplicationShellProps = {
|
|
@@ -94,8 +107,12 @@ export function ApplicationShell(props: ApplicationShellProps) {
|
|
|
94
107
|
props.drawer ? (props.narrowQuery ?? '(max-width: 799px)') : undefined
|
|
95
108
|
)
|
|
96
109
|
const [drawerOpen, setDrawerOpen] = createSignal(false)
|
|
110
|
+
// The drawer mounts (and its chunk loads) the first time the window is narrow, and
|
|
111
|
+
// stays mounted after that so its close animation and focus return keep working.
|
|
112
|
+
const [drawerMounted, setDrawerMounted] = createSignal(false)
|
|
97
113
|
createEffect(() => {
|
|
98
|
-
if (
|
|
114
|
+
if (narrow()) setDrawerMounted(true)
|
|
115
|
+
else setDrawerOpen(false)
|
|
99
116
|
})
|
|
100
117
|
const leading = () => props.sidebar ?? props.pane
|
|
101
118
|
const toggleVisible = () => narrow() || Boolean(leading())
|
|
@@ -257,26 +274,18 @@ export function ApplicationShell(props: ApplicationShellProps) {
|
|
|
257
274
|
{props.status}
|
|
258
275
|
</AppShellBody>
|
|
259
276
|
</AppShell>
|
|
260
|
-
<Show when={props.drawer}>
|
|
277
|
+
<Show when={drawerMounted() && props.drawer}>
|
|
261
278
|
{(drawer) => (
|
|
262
|
-
<
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
onCloseAutoFocus={(event: Event) => {
|
|
269
|
-
if (!sidebarToggle) return
|
|
270
|
-
event.preventDefault()
|
|
271
|
-
sidebarToggle.focus()
|
|
272
|
-
}}
|
|
279
|
+
<Suspense>
|
|
280
|
+
<NavigationDrawer
|
|
281
|
+
name={props.name}
|
|
282
|
+
open={narrow() && drawerOpen()}
|
|
283
|
+
onOpenChange={setDrawerOpen}
|
|
284
|
+
restoreFocus={() => sidebarToggle}
|
|
273
285
|
>
|
|
274
|
-
<SheetHeader class="sr-only">
|
|
275
|
-
<SheetTitle>{`${props.name} navigation`}</SheetTitle>
|
|
276
|
-
</SheetHeader>
|
|
277
286
|
{drawer()(() => setDrawerOpen(false))}
|
|
278
|
-
</
|
|
279
|
-
</
|
|
287
|
+
</NavigationDrawer>
|
|
288
|
+
</Suspense>
|
|
280
289
|
)}
|
|
281
290
|
</Show>
|
|
282
291
|
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@adea-ai/ui/components/ui/sheet'
|
|
2
|
+
import type { JSX } from 'solid-js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The narrow-window navigation drawer. The shell loads it the first time the window is
|
|
6
|
+
* narrow, so wide windows never fetch the dialog primitives behind the sheet.
|
|
7
|
+
*/
|
|
8
|
+
export function NavigationDrawer(props: {
|
|
9
|
+
name: string
|
|
10
|
+
open: boolean
|
|
11
|
+
onOpenChange(open: boolean): void
|
|
12
|
+
restoreFocus(): HTMLElement | undefined
|
|
13
|
+
children: JSX.Element
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<Sheet open={props.open} onOpenChange={props.onOpenChange}>
|
|
17
|
+
<SheetContent
|
|
18
|
+
data-mobile="true"
|
|
19
|
+
side="start"
|
|
20
|
+
closeButton={false}
|
|
21
|
+
class="w-72 max-w-full"
|
|
22
|
+
onCloseAutoFocus={(event: Event) => {
|
|
23
|
+
const target = props.restoreFocus()
|
|
24
|
+
if (!target) return
|
|
25
|
+
event.preventDefault()
|
|
26
|
+
target.focus()
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<SheetHeader class="sr-only">
|
|
30
|
+
<SheetTitle>{`${props.name} navigation`}</SheetTitle>
|
|
31
|
+
</SheetHeader>
|
|
32
|
+
{props.children}
|
|
33
|
+
</SheetContent>
|
|
34
|
+
</Sheet>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { cp, mkdir, readFile, readdir, writeFile } from 'node:fs/promises'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
import { createRendererProfile, type DesktopRenderer } from '../native/renderer-profile'
|
|
4
|
-
import { assertPortableAppName } from '../installer/installer-layout'
|
|
5
|
-
import { containsAsciiControl } from '../desktop/string-policy'
|
|
6
|
-
|
|
7
|
-
/** Generate a new app without replacing an existing directory. */
|
|
8
|
-
export async function createApplication(options: {
|
|
9
|
-
directory: string
|
|
10
|
-
slug: string
|
|
11
|
-
name: string
|
|
12
|
-
identifier: string
|
|
13
|
-
sourceUrl: string
|
|
14
|
-
frameworkSpecifier: string
|
|
15
|
-
renderer?: DesktopRenderer
|
|
16
|
-
}) {
|
|
17
|
-
if (
|
|
18
|
-
typeof options.directory !== 'string' ||
|
|
19
|
-
!options.directory.trim() ||
|
|
20
|
-
!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(options.slug) ||
|
|
21
|
-
options.slug.length > 64 ||
|
|
22
|
-
typeof options.name !== 'string' ||
|
|
23
|
-
!options.name.trim() ||
|
|
24
|
-
options.name.length > 80 ||
|
|
25
|
-
containsAsciiControl(options.name) ||
|
|
26
|
-
!/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*){1,}$/.test(options.identifier) ||
|
|
27
|
-
typeof options.frameworkSpecifier !== 'string' ||
|
|
28
|
-
!options.frameworkSpecifier.trim()
|
|
29
|
-
)
|
|
30
|
-
throw new Error('Invalid application identity or framework dependency')
|
|
31
|
-
assertPortableAppName(options.name)
|
|
32
|
-
let source: URL
|
|
33
|
-
try {
|
|
34
|
-
source = new URL(options.sourceUrl)
|
|
35
|
-
} catch {
|
|
36
|
-
throw new Error('Invalid application source URL')
|
|
37
|
-
}
|
|
38
|
-
if (source.protocol !== 'https:' || source.username || source.password)
|
|
39
|
-
throw new Error('Invalid application source URL')
|
|
40
|
-
if (
|
|
41
|
-
containsAsciiControl(options.frameworkSpecifier, true) ||
|
|
42
|
-
options.frameworkSpecifier.length > 512
|
|
43
|
-
)
|
|
44
|
-
throw new Error('Invalid framework dependency')
|
|
45
|
-
if (/^(?:git\+)?https?:/i.test(options.frameworkSpecifier)) {
|
|
46
|
-
let dependency: URL
|
|
47
|
-
try {
|
|
48
|
-
dependency = new URL(options.frameworkSpecifier.replace(/^git\+/, ''))
|
|
49
|
-
} catch {
|
|
50
|
-
throw new Error('Invalid framework dependency')
|
|
51
|
-
}
|
|
52
|
-
if (
|
|
53
|
-
dependency.protocol !== 'https:' ||
|
|
54
|
-
dependency.username ||
|
|
55
|
-
dependency.password ||
|
|
56
|
-
dependency.search
|
|
57
|
-
)
|
|
58
|
-
throw new Error('Invalid framework dependency')
|
|
59
|
-
}
|
|
60
|
-
const renderer = createRendererProfile(options.renderer).renderer
|
|
61
|
-
const frameworkManifest = JSON.parse(
|
|
62
|
-
await readFile(resolve(import.meta.dir, '../../package.json'), 'utf8')
|
|
63
|
-
) as { version?: unknown; devDependencies?: Record<string, unknown> }
|
|
64
|
-
const uiVersion = frameworkManifest.devDependencies?.['@adea-ai/ui']
|
|
65
|
-
if (typeof uiVersion !== 'string' || !/^\d+\.\d+\.\d+$/.test(uiVersion))
|
|
66
|
-
throw new Error('Framework UI version is unavailable')
|
|
67
|
-
const frameworkVersion = frameworkManifest.version
|
|
68
|
-
if (typeof frameworkVersion !== 'string' || !/^\d+\.\d+\.\d+$/.test(frameworkVersion))
|
|
69
|
-
throw new Error('Framework version is unavailable')
|
|
70
|
-
const directory = resolve(options.directory)
|
|
71
|
-
await mkdir(directory)
|
|
72
|
-
const template = resolve(import.meta.dir, '../../templates/application')
|
|
73
|
-
for (const entry of await readdir(template))
|
|
74
|
-
await cp(resolve(template, entry), resolve(directory, entry), {
|
|
75
|
-
recursive: true,
|
|
76
|
-
errorOnExist: true,
|
|
77
|
-
force: false,
|
|
78
|
-
})
|
|
79
|
-
// The release workflows call this framework release's reusable workflows. The tag
|
|
80
|
-
// pin is replaced with its commit by `adea-update-app-framework`.
|
|
81
|
-
for (const name of ['release.yml', 'release-assets.yml', 'release-finalize.yml']) {
|
|
82
|
-
const path = resolve(directory, '.github/workflows', name)
|
|
83
|
-
const workflow = await readFile(path, 'utf8')
|
|
84
|
-
await writeFile(
|
|
85
|
-
path,
|
|
86
|
-
workflow
|
|
87
|
-
.replaceAll('{{FRAMEWORK_REF}}', `v${frameworkVersion}`)
|
|
88
|
-
.replaceAll('{{RENDERER}}', renderer)
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
const config = {
|
|
92
|
-
slug: options.slug,
|
|
93
|
-
name: options.name,
|
|
94
|
-
identifier: options.identifier,
|
|
95
|
-
sourceUrl: source.href,
|
|
96
|
-
version: '0.1.0',
|
|
97
|
-
renderer,
|
|
98
|
-
initialPort: null,
|
|
99
|
-
urlSchemes: [],
|
|
100
|
-
}
|
|
101
|
-
const configEntries = Object.entries(config)
|
|
102
|
-
.map(([key, value]) => {
|
|
103
|
-
const json = JSON.stringify(value)
|
|
104
|
-
const literal =
|
|
105
|
-
typeof value !== 'string' || value.includes("'")
|
|
106
|
-
? json
|
|
107
|
-
: `'${json.slice(1, -1).replace(/\\"/g, '"')}'`
|
|
108
|
-
return ` ${key}: ${literal},`
|
|
109
|
-
})
|
|
110
|
-
.join('\n')
|
|
111
|
-
await writeFile(
|
|
112
|
-
resolve(directory, 'src/app-config.ts'),
|
|
113
|
-
`export const appConfig = {\n${configEntries}\n} as const\n`
|
|
114
|
-
)
|
|
115
|
-
const manifest = {
|
|
116
|
-
name: options.slug,
|
|
117
|
-
version: '0.1.0',
|
|
118
|
-
private: true,
|
|
119
|
-
type: 'module',
|
|
120
|
-
packageManager: 'bun@1.4.4',
|
|
121
|
-
scripts: {
|
|
122
|
-
format: 'oxfmt src scripts tests vite.config.ts electrobun.config.ts',
|
|
123
|
-
'format:check': 'oxfmt --check src scripts tests vite.config.ts electrobun.config.ts',
|
|
124
|
-
'format:write': 'oxfmt --write src scripts tests vite.config.ts electrobun.config.ts',
|
|
125
|
-
lint: 'oxlint src scripts tests vite.config.ts electrobun.config.ts',
|
|
126
|
-
typecheck: 'bun check -p tsconfig.json',
|
|
127
|
-
test: 'bun test tests',
|
|
128
|
-
'dev:web': 'vp dev --host 127.0.0.1',
|
|
129
|
-
'build:web': 'vp build',
|
|
130
|
-
'build:desktop': 'bun run build:web && bun scripts/build-desktop.ts dev',
|
|
131
|
-
'build:release': 'bun run build:web && bun scripts/build-desktop.ts stable',
|
|
132
|
-
'release:cut': 'bun node_modules/@adea-ai/app-framework/dist/cli/release-cut-cli.js',
|
|
133
|
-
'release:promote': 'bun node_modules/@adea-ai/app-framework/dist/cli/release-promote-cli.js',
|
|
134
|
-
'release:finalize':
|
|
135
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-finalize-cli.js',
|
|
136
|
-
'release:publish': 'bun node_modules/@adea-ai/app-framework/dist/cli/release-publish-cli.js',
|
|
137
|
-
'release:stage': 'bun scripts/stage-release.ts',
|
|
138
|
-
'release:stage-build':
|
|
139
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js stage-build',
|
|
140
|
-
'release:inspect':
|
|
141
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js inspect',
|
|
142
|
-
'release:plan': 'bun node_modules/@adea-ai/app-framework/dist/cli/release-assets-plan-cli.js',
|
|
143
|
-
'release:sign-descriptors':
|
|
144
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-descriptor-staging-cli.js',
|
|
145
|
-
'release:qualify':
|
|
146
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js qualify',
|
|
147
|
-
'release:qualify-upgrade':
|
|
148
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js qualify-upgrade',
|
|
149
|
-
'release:select-retained':
|
|
150
|
-
'bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js select-retained',
|
|
151
|
-
},
|
|
152
|
-
dependencies: {
|
|
153
|
-
'@adea-ai/app-framework': options.frameworkSpecifier,
|
|
154
|
-
'@adea-ai/ui': uiVersion,
|
|
155
|
-
'lucide-solid': '^1.51.0',
|
|
156
|
-
'solid-js': '1.9.15',
|
|
157
|
-
},
|
|
158
|
-
devDependencies: {
|
|
159
|
-
'@shadcn/lint': '^0.2.0',
|
|
160
|
-
oxlint: '^1.86.0',
|
|
161
|
-
oxfmt: '^0.71.0',
|
|
162
|
-
'@tailwindcss/vite': '^4.3.3',
|
|
163
|
-
tailwindcss: '^4.3.3',
|
|
164
|
-
vite: 'npm:@voidzero-dev/vite-plus-core@1.4.0',
|
|
165
|
-
'vite-plus': '1.4.0',
|
|
166
|
-
'vite-plugin-solid': '2.11.14',
|
|
167
|
-
electrobun: '2.0.5',
|
|
168
|
-
typescript: '^7.0.2',
|
|
169
|
-
'@types/bun': '^1.4.4',
|
|
170
|
-
},
|
|
171
|
-
overrides: {
|
|
172
|
-
vite: 'npm:@voidzero-dev/vite-plus-core@1.4.0',
|
|
173
|
-
},
|
|
174
|
-
}
|
|
175
|
-
await writeFile(resolve(directory, 'package.json'), JSON.stringify(manifest, null, 2) + '\n')
|
|
176
|
-
const platforms = {
|
|
177
|
-
'macos-arm64': [
|
|
178
|
-
`${options.slug}-{tag}-macos-arm64.dmg`,
|
|
179
|
-
`${options.slug}-{tag}-macos-arm64.tar.zst`,
|
|
180
|
-
],
|
|
181
|
-
'windows-x64': [
|
|
182
|
-
`${options.slug}-{tag}-windows-x64-Setup.zip`,
|
|
183
|
-
`${options.slug}-{tag}-windows-x64.tar.zst`,
|
|
184
|
-
],
|
|
185
|
-
'linux-x64': [
|
|
186
|
-
`${options.slug}-{tag}-linux-x64-Setup.tar.gz`,
|
|
187
|
-
`${options.slug}-{tag}-linux-x64.tar.zst`,
|
|
188
|
-
],
|
|
189
|
-
}
|
|
190
|
-
const devDiscoveryAssets = Object.keys(platforms).map((platform) => `dev-${platform}.json`)
|
|
191
|
-
const dailyDiscoveryAssets = Object.keys(platforms).map((platform) => `daily-${platform}.json`)
|
|
192
|
-
const stableDiscoveryAssets = Object.keys(platforms).map((platform) => `stable-${platform}.json`)
|
|
193
|
-
const releaseAssets = [...dailyDiscoveryAssets, ...stableDiscoveryAssets, ...devDiscoveryAssets]
|
|
194
|
-
const targets = {
|
|
195
|
-
'macos-arm64': ['darwin', 'arm64'],
|
|
196
|
-
'windows-x64': ['win32', 'x64'],
|
|
197
|
-
'linux-x64': ['linux', 'x64'],
|
|
198
|
-
} as const
|
|
199
|
-
const descriptors = Object.fromEntries(
|
|
200
|
-
(['dev', 'daily', 'stable'] as const).flatMap((channel) =>
|
|
201
|
-
Object.entries(targets).map(([platform, [os, arch]]) => [
|
|
202
|
-
`${channel}-${platform}.json`,
|
|
203
|
-
{
|
|
204
|
-
channel,
|
|
205
|
-
platform: os,
|
|
206
|
-
arch,
|
|
207
|
-
allowedPayloads: [platforms[platform as keyof typeof platforms][1]],
|
|
208
|
-
},
|
|
209
|
-
])
|
|
210
|
-
)
|
|
211
|
-
)
|
|
212
|
-
await writeFile(
|
|
213
|
-
resolve(directory, 'release-config.json'),
|
|
214
|
-
JSON.stringify(
|
|
215
|
-
{
|
|
216
|
-
appName: options.name,
|
|
217
|
-
appId: options.identifier,
|
|
218
|
-
soakHours: 96,
|
|
219
|
-
versionSource: { kind: 'source-manifest', path: 'package.json' },
|
|
220
|
-
releaseWorkflows: {
|
|
221
|
-
control: '.github/workflows/release.yml',
|
|
222
|
-
assets: '.github/workflows/release-assets.yml',
|
|
223
|
-
},
|
|
224
|
-
releaseFeed: { base: 'https://adea.dev/releases/', app: options.slug },
|
|
225
|
-
offlinePolicy: { kind: 'standalone', marker: `Welcome to ${options.name}.` },
|
|
226
|
-
offlineExpectedReads: [],
|
|
227
|
-
platforms,
|
|
228
|
-
releaseAssets,
|
|
229
|
-
dailyDiscoveryAssets,
|
|
230
|
-
stableDiscoveryAssets,
|
|
231
|
-
devDiscoveryAssets,
|
|
232
|
-
releaseSigningKeys: {},
|
|
233
|
-
descriptors,
|
|
234
|
-
},
|
|
235
|
-
null,
|
|
236
|
-
2
|
|
237
|
-
) + '\n'
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
await writeFile(
|
|
241
|
-
resolve(directory, '.gitignore'),
|
|
242
|
-
'node_modules/\nbuild/\nartifacts/\n.hutch/\n.cottontail-tmp/\n.env\n.env.*\n!.env.example\n'
|
|
243
|
-
)
|
|
244
|
-
return { directory }
|
|
245
|
-
}
|