@sixb/app 0.0.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/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/agents.d.ts +6 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +26 -0
- package/dist/agents.js.map +10 -0
- package/dist/build.d.ts +21 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/codegen.d.ts +43 -0
- package/dist/codegen.d.ts.map +1 -0
- package/dist/createCustomApp.d.ts +43 -0
- package/dist/createCustomApp.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1464 -0
- package/dist/index.js.map +18 -0
- package/dist/manifest.d.ts +3 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/metadata.d.ts +29 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/runtime.d.ts +12 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/scanner.d.ts +19 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/styles.d.ts +33 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/tailwind.d.ts +62 -0
- package/dist/tailwind.d.ts.map +1 -0
- package/dist/tsconfig.json +5 -0
- package/package.json +74 -0
- package/src/agents.ts +23 -0
- package/src/build.ts +105 -0
- package/src/codegen.ts +587 -0
- package/src/createCustomApp.ts +770 -0
- package/src/index.ts +15 -0
- package/src/manifest.ts +29 -0
- package/src/metadata.ts +206 -0
- package/src/runtime.ts +16 -0
- package/src/scanner.ts +81 -0
- package/src/styles.ts +83 -0
- package/src/tailwind.ts +195 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sixb contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @sixb/app
|
|
2
|
+
|
|
3
|
+
Reusable toolkit for project-specific Sixb apps. It owns custom app route scanning, entry generation, Bun dev serving, production builds, and serving built custom apps in production.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @sixb/app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
The build pipeline has three stages: **scan**, **codegen**, and **build**.
|
|
14
|
+
|
|
15
|
+
### 1. Scan
|
|
16
|
+
|
|
17
|
+
`scanPages(appDir)` recursively walks `app/` looking for `page.tsx` (or `page.ts`) files and converts the file tree into React Router paths. Files and folders prefixed with `_` are ignored.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
app/
|
|
21
|
+
page.tsx -> /
|
|
22
|
+
about/page.tsx -> /about
|
|
23
|
+
remote/[id]/page.tsx -> /remote/:id
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Codegen
|
|
27
|
+
|
|
28
|
+
Two functions generate the entry point files into `.sixb/generated/`:
|
|
29
|
+
|
|
30
|
+
- **`generateRouteManifest(routes, generatedDir)`** -- writes `routes.ts` with a static import for each scanned page. Routes are eager on purpose: project apps bundle small, and a single bundle means no loading gap when navigating between pages.
|
|
31
|
+
- **`generateAppEntry(projectRoot, generatedDir, options)`** -- writes `index.html` (HTML shell), `main.tsx` (React entry with BrowserRouter, TanStack Query, and the `@sixb/client` SDK), and `app.webmanifest`.
|
|
32
|
+
|
|
33
|
+
The generated entry also intercepts plain same-origin `<a href="/...">` clicks and routes them client-side, so internal links work like react-router's `<Link>` without authors having to remember it. The interceptor is conservative — modified clicks, `target`/`download`/`rel="external"` anchors, cross-origin URLs, reserved Sixb paths (`/api`, `/auth`, `/ws`, `/docs`), and destinations that don't match an app route all keep native browser navigation. `<Link>` remains the idiomatic choice in app code.
|
|
34
|
+
|
|
35
|
+
If `app/layout.tsx` exists, it is used as a root layout wrapper. It can also export a `metadata` object (`title`, `description`, `favicon`, `themeColor`, and `backgroundColor`). Metadata is loaded during generation and written into the static HTML and manifest, so it is available before auth and client startup. The layout module must therefore be import-safe in Bun: do not access `window` or `document` at module scope. An `app/globals.css` file is imported automatically when present.
|
|
36
|
+
|
|
37
|
+
### Built-in Agent Routes
|
|
38
|
+
|
|
39
|
+
Custom apps automatically receive the shared Sixb agent chat UI at:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/agents
|
|
43
|
+
/agents/new/:agentId
|
|
44
|
+
/agents/:threadId
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
These routes are generated only when the project has at least one `app/` page, so projects without a custom app are not turned into an app server just for agents. Project-authored pages win by exact path: define `app/agents/page.tsx` to replace the gallery, `app/agents/new/[agentId]/page.tsx` to replace the blank chat route, and `app/agents/[threadId]/page.tsx` to replace the thread route.
|
|
48
|
+
|
|
49
|
+
The default agent UI is imported through `@sixb/app/agents`, so app projects do not need to import `@sixb/agent-ui` directly. A framework-owned `agent-ui.css` bundle is generated before the app stylesheet and imports normal `@sixb/ui` styles, which means app-level token overrides in `app/globals.css` still apply in the usual way.
|
|
50
|
+
|
|
51
|
+
### Embedded Agent Panel
|
|
52
|
+
|
|
53
|
+
Embed the same conversation runtime without changing the page route:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import {
|
|
57
|
+
AgentContextProvider,
|
|
58
|
+
AgentPanel,
|
|
59
|
+
agentContext,
|
|
60
|
+
useAgentContext,
|
|
61
|
+
} from "@sixb/app/agents"
|
|
62
|
+
|
|
63
|
+
function InvoicePage({ invoiceId }: { invoiceId: string }) {
|
|
64
|
+
useAgentContext(agentContext.object(Invoice, invoiceId))
|
|
65
|
+
return <InvoiceDetails invoiceId={invoiceId} />
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function Layout() {
|
|
69
|
+
return (
|
|
70
|
+
<AgentContextProvider>
|
|
71
|
+
<main><InvoicePage invoiceId="inv-123" /></main>
|
|
72
|
+
<aside className="h-[42rem]">
|
|
73
|
+
<AgentPanel agentId="invoice-assistant" />
|
|
74
|
+
</aside>
|
|
75
|
+
</AgentContextProvider>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`AgentPanel.context` is controlled: when provided, it replaces provider context. `threadId` and
|
|
81
|
+
`onThreadChange` similarly opt into controlled thread state.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
const view = agentContext.appState("invoice-view", {
|
|
85
|
+
label: "Invoice view",
|
|
86
|
+
description: "Current invoice filters and selected tab",
|
|
87
|
+
value: { activeTab, filters },
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
<AgentPanel agentId="invoice-assistant" context={[view]} />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Context is visible and removable before send, then stored on that user message. `@` adds authorized
|
|
94
|
+
object references explicitly. V1 accepts 12 entries, 16 KB per app-state entry, and 64 KB of app
|
|
95
|
+
state per message. Object references identify live data; they do not grant access.
|
|
96
|
+
|
|
97
|
+
### Styling and Tailwind
|
|
98
|
+
|
|
99
|
+
`app/globals.css` is treated as source:
|
|
100
|
+
|
|
101
|
+
- **Plain CSS** is bundled as-is.
|
|
102
|
+
- **Tailwind v4 source** — a file using Tailwind at-rules (`@source`, `@theme`, `@apply`, ...) or importing package CSS such as `@import "@sixb/ui/globals.css"` — is compiled with the project's `@tailwindcss/cli` to `.sixb/generated/app.css`, and the generated entry imports the compiled output. Compilation runs during both dev and build, so `sixb build` alone always produces fresh production CSS, and `dev()` recompiles on `.css`/`.ts`/`.tsx` changes without any userland watcher.
|
|
103
|
+
|
|
104
|
+
A typical Tailwind + `@sixb/ui` setup is just:
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
/* app/globals.css */
|
|
108
|
+
@import "@sixb/ui/globals.css";
|
|
109
|
+
@source "./**/*.{ts,tsx}";
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Tailwind's source detection is scoped to `app/`, and the CLI is resolved from the project's own dependencies (`bun add tailwindcss @tailwindcss/cli`). If `globals.css` uses Tailwind features but the CLI is missing, dev and build fail with an actionable `[SixbCustomApp]` error.
|
|
113
|
+
|
|
114
|
+
### 3. Build
|
|
115
|
+
|
|
116
|
+
`buildApp(options)` runs `Bun.build()` on the generated HTML entry point to produce a minified, browser-targeted bundle with external source maps in `.sixb/dist/app/`. Pass the generated `manifestPath` to copy the framework manifest to the stable output URL. The output directory is build-owned and cleared before each build so stale hashed chunks don't accumulate.
|
|
117
|
+
|
|
118
|
+
### 4. Start
|
|
119
|
+
|
|
120
|
+
`createCustomApp().start(options)` serves the built app from `.sixb/dist/app/` on a Bun server. When `apiBaseUrl` is provided, it is injected into the served HTML at runtime so the public custom app shell can call the Sixb API origin with credentials.
|
|
121
|
+
|
|
122
|
+
## Usage
|
|
123
|
+
|
|
124
|
+
Preferred high-level API:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { createCustomApp } from "@sixb/app"
|
|
128
|
+
|
|
129
|
+
const app = await createCustomApp({
|
|
130
|
+
rootDir: process.cwd(),
|
|
131
|
+
apiBaseUrl: "http://localhost:3000",
|
|
132
|
+
audience: "app",
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
await app.dev({ port: 3001 })
|
|
136
|
+
await app.build({ outdir: ".sixb/dist/app" })
|
|
137
|
+
await app.start({ port: 3001, outdir: ".sixb/dist/app", apiBaseUrl: "http://localhost:3000" })
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The low-level pipeline (`scanPages`, `generateRouteManifest`, `generateAppEntry`,
|
|
141
|
+
`buildApp`) is internal — `createCustomApp` composes it. Only the surface above is
|
|
142
|
+
exported.
|
|
143
|
+
|
|
144
|
+
## Public Assets
|
|
145
|
+
|
|
146
|
+
Static files in `app/public/` are served at root-relative paths:
|
|
147
|
+
|
|
148
|
+
- `app/public/logo.svg` serves at `/logo.svg`
|
|
149
|
+
- `app/public/models/macbook.glb` serves at `/models/macbook.glb`
|
|
150
|
+
|
|
151
|
+
In dev mode the Bun server serves them directly; in production they are copied into `.sixb/dist/app/`.
|
|
152
|
+
|
|
153
|
+
Custom apps are PWAs by default. Sixb owns `/app.webmanifest`, emits `display: "standalone"`, and recognizes these optional files in `app/public/`:
|
|
154
|
+
|
|
155
|
+
| File | Purpose |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `favicon.svg` | Browser favicon and manifest fallback |
|
|
158
|
+
| `icon-192.png` | 192x192 install icon |
|
|
159
|
+
| `icon-512.png` | 512x512 install icon |
|
|
160
|
+
| `icon-maskable-512.png` | 512x512 adaptive icon with artwork in the 80% safe zone |
|
|
161
|
+
| `apple-touch-icon.png` | 180x180 opaque iOS Home Screen icon |
|
|
162
|
+
|
|
163
|
+
A file at `app/public/app.webmanifest` is ignored because the generated manifest is framework-owned. The manifest is served with `no-cache`; fixed-name public icons are not given immutable caching. In standalone mode Sixb suppresses root overscroll without hiding overflow or preventing normal document scrolling.
|
|
164
|
+
|
|
165
|
+
## Exports
|
|
166
|
+
|
|
167
|
+
| Export | Description |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `createCustomApp(options)` | High-level custom app toolkit for dev/build/start |
|
|
170
|
+
| `AppMetadata` | Metadata shape exported by `app/layout.tsx` |
|
|
171
|
+
| `createTailwindCssCompiler(options)` | Shared Tailwind v4 build pipeline (also used by Atlas) |
|
|
172
|
+
| `@sixb/app/agents` | Full-page agent route plus `AgentPanel`, context provider/hooks, and helpers |
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AgentChatPageProps } from "@sixb/agent-ui/react-router";
|
|
2
|
+
export { AgentContextProvider, AgentPanel, type AgentPanelProps, useAgentContext, } from "@sixb/agent-ui";
|
|
3
|
+
export { agentContext } from "@sixb/core/agents/context";
|
|
4
|
+
export type AgentsPageProps = Omit<AgentChatPageProps, "routeBase">;
|
|
5
|
+
export default function AgentsPage({ className, ...props }: AgentsPageProps): import("react").FunctionComponentElement<AgentChatPageProps>;
|
|
6
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGpF,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AAEnE,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,gEAQ1E"}
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/agents.ts
|
|
3
|
+
import { AgentChatPage } from "@sixb/agent-ui/react-router";
|
|
4
|
+
import { createElement } from "react";
|
|
5
|
+
import {
|
|
6
|
+
AgentContextProvider,
|
|
7
|
+
AgentPanel,
|
|
8
|
+
useAgentContext
|
|
9
|
+
} from "@sixb/agent-ui";
|
|
10
|
+
import { agentContext } from "@sixb/core/agents/context";
|
|
11
|
+
function AgentsPage({ className, ...props }) {
|
|
12
|
+
return createElement(AgentChatPage, {
|
|
13
|
+
...props,
|
|
14
|
+
routeBase: "/agents",
|
|
15
|
+
className: className ? `h-dvh min-h-dvh max-h-dvh overflow-hidden ${className}` : "h-dvh min-h-dvh max-h-dvh overflow-hidden"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
useAgentContext,
|
|
20
|
+
AgentsPage as default,
|
|
21
|
+
agentContext,
|
|
22
|
+
AgentPanel,
|
|
23
|
+
AgentContextProvider
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//# debugId=AE7E5198DF11A9EE64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/agents.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { AgentChatPage, type AgentChatPageProps } from \"@sixb/agent-ui/react-router\"\nimport { createElement } from \"react\"\n\nexport {\n AgentContextProvider,\n AgentPanel,\n type AgentPanelProps,\n useAgentContext,\n} from \"@sixb/agent-ui\"\n\nexport { agentContext } from \"@sixb/core/agents/context\"\n\nexport type AgentsPageProps = Omit<AgentChatPageProps, \"routeBase\">\n\nexport default function AgentsPage({ className, ...props }: AgentsPageProps) {\n return createElement(AgentChatPage, {\n ...props,\n routeBase: \"/agents\",\n className: className\n ? `h-dvh min-h-dvh max-h-dvh overflow-hidden ${className}`\n : \"h-dvh min-h-dvh max-h-dvh overflow-hidden\",\n })\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAOA;AAIA,SAAwB,UAAU,GAAG,cAAc,SAA0B;AAAA,EAC3E,OAAO,cAAc,eAAe;AAAA,OAC/B;AAAA,IACH,WAAW;AAAA,IACX,WAAW,YACP,6CAA6C,cAC7C;AAAA,EACN,CAAC;AAAA;",
|
|
8
|
+
"debugId": "AE7E5198DF11A9EE64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface BuildAppOptions {
|
|
2
|
+
/** Path to the generated index.html entry point */
|
|
3
|
+
entryPath: string;
|
|
4
|
+
/** Generated manifest copied to the stable `/app.webmanifest` output path. */
|
|
5
|
+
manifestPath?: string;
|
|
6
|
+
/** Output directory, defaults to `.sixb/dist/app` */
|
|
7
|
+
outdir?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BuildAppResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
outdir: string;
|
|
12
|
+
logs?: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds the app using `Bun.build()` on the generated HTML entry point.
|
|
16
|
+
* Outputs a production-ready static bundle.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildApp(options: BuildAppOptions): Promise<BuildAppResult>;
|
|
19
|
+
export declare function prepareAppHtmlBundleEntry(entryPath: string): Promise<string>;
|
|
20
|
+
export declare function restoreAppStaticUrls(html: string): string;
|
|
21
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;IACjB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA4ChF;AAKD,wBAAsB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASlF;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AuthSessionAudience } from "@sixb/core";
|
|
2
|
+
import type { PageRoute } from "./scanner";
|
|
3
|
+
export interface BuiltInRouteManifestEntry {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly moduleSpecifier: string;
|
|
6
|
+
readonly exportName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GenerateRouteManifestOptions {
|
|
9
|
+
readonly builtInRoutes?: readonly BuiltInRouteManifestEntry[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates `.sixb/generated/routes.ts` with static route imports. Pages are
|
|
13
|
+
* eager on purpose: project-specific apps bundle small, and a single bundle
|
|
14
|
+
* (one JS file, one render-blocking CSS file) means no Suspense gap or
|
|
15
|
+
* late-arriving styles when navigating — matching how Atlas routes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateRouteManifest(routes: PageRoute[], generatedDir: string, options?: GenerateRouteManifestOptions): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Generates the app entry files:
|
|
20
|
+
* - `.sixb/generated/index.html` — HTML shell
|
|
21
|
+
* - `.sixb/generated/main.tsx` — React entry with BrowserRouter
|
|
22
|
+
* - `.sixb/generated/app.webmanifest` — installable app identity
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateAppEntry(projectRoot: string, generatedDir: string, options?: {
|
|
25
|
+
apiBaseUrl?: string;
|
|
26
|
+
audience?: AuthSessionAudience;
|
|
27
|
+
authEnabled?: boolean;
|
|
28
|
+
appDir?: string;
|
|
29
|
+
publicDir?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Stylesheet to import from the generated entry. `undefined` auto-detects
|
|
32
|
+
* `app/globals.css` and imports it when it exists; `null` skips the import;
|
|
33
|
+
* a path imports that file (e.g. compiled Tailwind output).
|
|
34
|
+
*/
|
|
35
|
+
stylesheetPath?: string | null;
|
|
36
|
+
/** Framework-owned stylesheets imported before the app stylesheet. */
|
|
37
|
+
frameworkStylesheetPaths?: readonly string[];
|
|
38
|
+
}): Promise<{
|
|
39
|
+
htmlPath: string;
|
|
40
|
+
mainPath: string;
|
|
41
|
+
manifestPath: string;
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAIrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAA;CAC9D;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,SAAS,EAAE,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,MAAM,CAAC,CAyCjB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC,GACL,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CA2avE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AuthSessionAudience } from "@sixb/core";
|
|
2
|
+
import { type BuildAppResult } from "./build";
|
|
3
|
+
import { type PageRoute } from "./scanner";
|
|
4
|
+
export interface CreateCustomAppOptions {
|
|
5
|
+
rootDir: string;
|
|
6
|
+
appDir?: string;
|
|
7
|
+
generatedDir?: string;
|
|
8
|
+
publicDir?: string;
|
|
9
|
+
apiBaseUrl?: string;
|
|
10
|
+
audience?: AuthSessionAudience;
|
|
11
|
+
authEnabled?: boolean;
|
|
12
|
+
agentRoutes?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CustomAppDevOptions {
|
|
15
|
+
host?: string;
|
|
16
|
+
port?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface CustomAppBuildOptions {
|
|
19
|
+
outdir?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CustomAppStartOptions {
|
|
22
|
+
host?: string;
|
|
23
|
+
port?: number;
|
|
24
|
+
outdir?: string;
|
|
25
|
+
apiBaseUrl?: string;
|
|
26
|
+
audience?: AuthSessionAudience;
|
|
27
|
+
authEnabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface CustomAppDevServer {
|
|
30
|
+
host: string;
|
|
31
|
+
port: number;
|
|
32
|
+
url: string;
|
|
33
|
+
stop(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export interface CustomAppInstance {
|
|
36
|
+
scanRoutes(): Promise<PageRoute[]>;
|
|
37
|
+
hasRoutes(): Promise<boolean>;
|
|
38
|
+
dev(options?: CustomAppDevOptions): Promise<CustomAppDevServer>;
|
|
39
|
+
build(options?: CustomAppBuildOptions): Promise<BuildAppResult>;
|
|
40
|
+
start(options?: CustomAppStartOptions): Promise<CustomAppDevServer>;
|
|
41
|
+
}
|
|
42
|
+
export declare function createCustomApp(options: CreateCustomAppOptions): Promise<CustomAppInstance>;
|
|
43
|
+
//# sourceMappingURL=createCustomApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCustomApp.d.ts","sourceRoot":"","sources":["../src/createCustomApp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,WAAW,CAAA;AAIrD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;IAClC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7B,GAAG,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC/D,KAAK,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IAC/D,KAAK,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACpE;AAWD,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyWjG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type CreateCustomAppOptions, type CustomAppBuildOptions, type CustomAppDevOptions, type CustomAppDevServer, type CustomAppInstance, type CustomAppStartOptions, createCustomApp, } from "./createCustomApp";
|
|
2
|
+
export type { AppMetadata } from "./metadata";
|
|
3
|
+
export { createTailwindCssCompiler, type TailwindCssCompiler, type TailwindCssCompilerOptions, } from "./tailwind";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EACL,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,GAChC,MAAM,YAAY,CAAA"}
|