acrylblends 0.11.0 → 1.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 +131 -53
- package/dist/index.d.ts +29 -2
- package/dist/index.js +450 -69
- package/dist/index.js.map +1 -1
- package/docs/framework/README.md +5 -3
- package/docs/framework/agents/index.md +1 -1
- package/docs/framework/api/acryl.md +5 -17
- package/docs/framework/api/context.md +12 -61
- package/docs/framework/api/presets.md +1 -1
- package/docs/framework/api/request.md +3 -3
- package/docs/framework/api/summary.md +1 -1
- package/docs/framework/concepts/web-standard.md +6 -16
- package/docs/framework/cordis/acryl-in-a-cordis-app.md +13 -8
- package/docs/framework/cordis/migration-from-0-4.md +1 -1
- package/docs/framework/cordis/migration-to-1-0.md +45 -0
- package/docs/framework/cordis/node-server.md +2 -2
- package/docs/framework/getting-started/basic.md +15 -10
- package/docs/framework/getting-started/desktop.md +1 -1
- package/docs/framework/getting-started/other-runtimes.md +10 -14
- package/docs/framework/guides/create-acrylblends.md +4 -2
- package/docs/framework/guides/data.md +1 -1
- package/docs/framework/guides/faq.md +1 -1
- package/docs/framework/guides/jsx-dom.md +1 -1
- package/docs/framework/guides/production.md +43 -0
- package/docs/framework/guides/rpc.md +3 -11
- package/docs/framework/helpers/adapter.md +13 -43
- package/docs/framework/helpers/conninfo.md +1 -36
- package/docs/framework/helpers/streaming.md +1 -1
- package/docs/framework/helpers/websocket.md +4 -11
- package/docs/framework/middleware/builtin/basic-auth.md +1 -1
- package/docs/framework/middleware/builtin/cache.md +2 -22
- package/docs/framework/middleware/builtin/compress.md +1 -1
- package/docs/framework/middleware/builtin/context-storage.md +10 -14
- package/docs/framework/middleware/builtin/cors.md +1 -2
- package/docs/framework/middleware/builtin/ip-restriction.md +1 -1
- package/docs/framework/middleware/builtin/jsx-renderer.md +1 -1
- package/docs/framework/middleware/builtin/logger.md +1 -1
- package/docs/framework/middleware/builtin/loopback-only.md +1 -1
- package/docs/framework/middleware/builtin/mount.md +1 -1
- package/docs/framework/middleware/builtin/request-id.md +13 -20
- package/docs/framework/middleware/builtin/timing.md +1 -2
- package/lib/cordis/door.d.ts +5 -0
- package/lib/cordis/door.js +8 -4
- package/lib/cordis/inspect.js +1 -1
- package/lib/cordis/router-http.js +1 -1
- package/lib/cordis/router.d.ts +1 -2
- package/lib/cordis/router.js +2 -3
- package/lib/cordis/state.js +1 -1
- package/lib/door/host.js +1 -1
- package/lib/drivers.d.ts +66 -0
- package/lib/drivers.js +16 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/{snapshot-text-yaWlezbd.js → snapshot-text-DmE0YfeZ.js} +2 -2
- package/lib/{src-DNzw0Qsb.js → src-2Z4mJg0x.js} +0 -1
- package/package.json +5 -121
- package/plugins/acryl-door/src/index.ts +8 -0
- package/plugins/acryl-router/src/index.ts +0 -1
- package/plugins/agent-panel/drivers.ts +1 -16
- package/plugins/agent-panel/index.ts +1 -1
- package/plugins/agent-panel/registry.ts +16 -0
- package/plugins/driver-acp/README.md +53 -0
- package/plugins/driver-acp/chat.ts +258 -0
- package/plugins/driver-acp/connection.ts +239 -0
- package/plugins/driver-acp/index.ts +65 -0
- package/plugins/driver-acp/plugin.json +12 -0
- package/plugins/driver-acp/provenance.json +20 -0
- package/plugins/driver-pty/index.ts +1 -0
- package/shared/library-history.json +464 -0
- package/docs/framework/getting-started/aws-lambda.md +0 -115
- package/docs/framework/getting-started/cloudflare-pages.md +0 -53
- package/docs/framework/getting-started/cloudflare-workers.md +0 -67
- package/docs/framework/getting-started/lambda-edge.md +0 -41
- package/docs/framework/getting-started/netlify.md +0 -25
- package/docs/framework/getting-started/service-worker.md +0 -33
- package/docs/framework/getting-started/vercel.md +0 -28
- package/lib/aws-lambda.d.ts +0 -324
- package/lib/aws-lambda.js +0 -357
- package/lib/cloudflare-pages.d.ts +0 -58
- package/lib/cloudflare-pages.js +0 -78
- package/lib/cloudflare-workers.d.ts +0 -21
- package/lib/cloudflare-workers.js +0 -80
- package/lib/deprecated-BP4fPt38.js +0 -10
- package/lib/deprecated-CTy4N7ng.d.ts +0 -12
- package/lib/lambda-edge.d.ts +0 -92
- package/lib/lambda-edge.js +0 -105
- package/lib/netlify.d.ts +0 -29
- package/lib/netlify.js +0 -30
- package/lib/service-worker.d.ts +0 -48
- package/lib/service-worker.js +0 -38
- package/lib/vercel.d.ts +0 -10
- package/lib/vercel.js +0 -9
- package/plugins/acryl-router/src/deprecated.ts +0 -15
package/README.md
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
<h1 align="center">acrylblends</h1>
|
|
6
6
|
|
|
7
|
-
<p align="center"><strong>Acryl
|
|
8
|
-
One <code>Request</code> in, one <code>Response</code> out
|
|
7
|
+
<p align="center"><strong>Acryl: a small web framework on Web Standards, and whole apps built from Cordis plugins.</strong><br>
|
|
8
|
+
One <code>Request</code> in, one <code>Response</code> out - routing, middleware, validation, a typed client and a Node.js server, with no
|
|
9
|
+
dependencies - and a composition of plugins that runs in a browser or a desktop window.</p>
|
|
9
10
|
|
|
10
11
|
<p align="center">
|
|
11
|
-
<a href="https://github.com/
|
|
12
|
-
<a href="https://github.com/
|
|
13
|
-
<a href="https://github.com/
|
|
12
|
+
<a href="https://github.com/acrylblends/acrylblends/blob/main/docs/framework/README.md">Documentation</a> ·
|
|
13
|
+
<a href="https://github.com/acrylblends/acrylblends/blob/main/docs/framework/getting-started/basic.md">Getting started</a> ·
|
|
14
|
+
<a href="https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/index.md">API</a> ·
|
|
14
15
|
<a href="https://acrylblends.github.io">acrylblends.github.io</a> ·
|
|
15
16
|
<a href="https://acryl.dev">acryl.dev</a> ·
|
|
16
17
|
<a href="https://github.com/acrylblends/acrylblends">GitHub</a>
|
|
@@ -30,8 +31,12 @@ export default app
|
|
|
30
31
|
## Contents
|
|
31
32
|
|
|
32
33
|
- [Requirements](#requirements)
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
34
|
+
- [Start an app in five minutes](#start-an-app-in-five-minutes)
|
|
35
|
+
- [Run it in a browser or in a desktop window](#run-it-in-a-browser-or-in-a-desktop-window)
|
|
36
|
+
- [Start from the registry](#start-from-the-registry)
|
|
37
|
+
- [Publish your app, or your own starter](#publish-your-app-or-your-own-starter)
|
|
38
|
+
- [Keep the framework current](#keep-the-framework-current)
|
|
39
|
+
- [Use it as a library](#use-it-as-a-library)
|
|
35
40
|
- [A first API](#a-first-api)
|
|
36
41
|
- [Middleware](#middleware)
|
|
37
42
|
- [Validation](#validation)
|
|
@@ -39,7 +44,7 @@ export default app
|
|
|
39
44
|
- [Testing](#testing)
|
|
40
45
|
- [Serving on Node.js](#serving-on-nodejs)
|
|
41
46
|
- [What is in the package](#what-is-in-the-package)
|
|
42
|
-
- [Upgrading from
|
|
47
|
+
- [Upgrading from an older version](#upgrading-from-an-older-version)
|
|
43
48
|
- [The acrylblends command](#the-acrylblends-command)
|
|
44
49
|
- [Links](#links)
|
|
45
50
|
- [License](#license)
|
|
@@ -50,9 +55,93 @@ export default app
|
|
|
50
55
|
- **Bun** runs the same app (`export default app`) and is experimental.
|
|
51
56
|
- `acrylblends` has no dependencies. Its types need only Node's types (`@types/node`), not the DOM library.
|
|
52
57
|
|
|
53
|
-
##
|
|
58
|
+
## Start an app in five minutes
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
```sh
|
|
61
|
+
npm create acrylblends@latest my-app
|
|
62
|
+
cd my-app
|
|
63
|
+
npm install
|
|
64
|
+
npm run dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The starter asks which template you want; naming one skips the question (`npm create acrylblends@latest my-app notes`).
|
|
68
|
+
|
|
69
|
+
| Template | What you get |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `blank` | the router, the Node server and one route: the smallest app |
|
|
72
|
+
| `nodejs` | a page rendered with JSX and a client component, without a bundler |
|
|
73
|
+
| `notes` | a multi-user notes app on the `db` port: sign-up, sessions, migrations, search, a typed client |
|
|
74
|
+
| `chat` | an answer streamed over server-sent events from an OpenAI-compatible API, history in SQLite |
|
|
75
|
+
| `todo` | a to-do list on the router and live state |
|
|
76
|
+
| `agent` | the blank app with an agent that writes and installs plugins into the running app |
|
|
77
|
+
|
|
78
|
+
Every template is a Cordis app: `blend.yaml` lists its plugins, `plugins/` holds them as code you own, and the starter also writes
|
|
79
|
+
`docs/framework` (the pages this README links to), `AGENTS.md`, `CLAUDE.md`, one skill for a coding agent, and its own tests. `npm run dev`
|
|
80
|
+
serves it and prints the URL, `npm test` runs the tests, `npm run check` type-checks.
|
|
81
|
+
|
|
82
|
+
Adding a capability is one command: `npx acrylblends add <plugin>` copies a library plugin and what it needs into `plugins/`, prints the row to
|
|
83
|
+
add to `blend.yaml`, and records what it copied so `acrylblends upgrade` can move it forward later. `npx acrylblends plugins` lists the library.
|
|
84
|
+
|
|
85
|
+
## Run it in a browser or in a desktop window
|
|
86
|
+
|
|
87
|
+
The same app runs both ways; the routes, the plugins and the data are the ones you already wrote.
|
|
88
|
+
|
|
89
|
+
- **Browser**: what you get. `npm run dev` (or `npm start`) serves it on a loopback port and prints the URL.
|
|
90
|
+
- **Desktop**: add the shell and run it as a window on the app's own server.
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
npx acrylblends init my-app --desktop # create an app with the shell (--template picks the template)
|
|
94
|
+
# or, in an app you already have:
|
|
95
|
+
npx acrylblends add desktop
|
|
96
|
+
npm install # the shell needs electron
|
|
97
|
+
npm run desktop # an Electron window on the app's own server
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Every Electron call lives in `plugins/desktop`, so the app's own code never imports it. See
|
|
101
|
+
[Desktop](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/getting-started/desktop.md).
|
|
102
|
+
|
|
103
|
+
## Start from the registry
|
|
104
|
+
|
|
105
|
+
The registry is a set of starting points people published, browsable at [acrylblends.github.io/blends](https://acrylblends.github.io/blends)
|
|
106
|
+
and readable by any tool as plain JSON at <https://acrylblends.github.io/registry/index.json>. ACRYL's CLI pulls one by id, or from any git
|
|
107
|
+
repository:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npm install -g acryl
|
|
111
|
+
acryl new my-app --from acryl.gtd # a starter from the registry
|
|
112
|
+
acryl new my-app --from github:you/starter # a repository with an acryl.template.json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Without `--from`, `acryl new` writes the blank app; `--blueprint` picks another built-in Blueprint. A team's own registry is the same layout in
|
|
116
|
+
its own repository: `--registry <git URL or folder>` reads starters from there instead of the public one.
|
|
117
|
+
|
|
118
|
+
## Publish your app, or your own starter
|
|
119
|
+
|
|
120
|
+
**Your app** belongs to you and lives in your repository: `npm run save` commits it and pushes to its remote. It refuses a file that looks like
|
|
121
|
+
a secret, and refuses to push a private app to a public remote.
|
|
122
|
+
|
|
123
|
+
Before an app goes on a server: with `NODE_ENV=production` the door, the agent panel and the PTY driver start nothing, but the `agent` template
|
|
124
|
+
still mounts its own agent, builder and extensions rows. Start from one of the other five templates, or remove those rows from its `blend.yaml`
|
|
125
|
+
- see [What runs in production](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/production.md).
|
|
126
|
+
|
|
127
|
+
**A starter** other people can pull is a pull request to the registry repository: add `registry/blends/<id>/` with a `blend.yaml` (`kind: Blueprint`,
|
|
128
|
+
an id you own, the license, `visibility`, a category and a one-line description), the plugins it adds under `plugins/`, and a `README.md`. CI
|
|
129
|
+
validates every entry and fails when `index.json` is stale, so what the site lists is what passed. The layout, and how to keep a starter private
|
|
130
|
+
without a registry at all, is in
|
|
131
|
+
[the registry README](https://github.com/acrylblends/acrylblends.github.io/tree/main/registry).
|
|
132
|
+
|
|
133
|
+
## Keep the framework current
|
|
134
|
+
|
|
135
|
+
An app carries its framework plugins as source, so a new release moves them in place and leaves your own code alone:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
npx acrylblends upgrade --dry-run # the plan: what would be replaced
|
|
139
|
+
npx acrylblends upgrade # an edited file stops it with the diff, unless --force
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Use it as a library
|
|
143
|
+
|
|
144
|
+
An Acryl app is also a plain function from `Request` to `Response`, which needs no scaffold. Create a folder and install the package:
|
|
56
145
|
|
|
57
146
|
```sh
|
|
58
147
|
mkdir my-app && cd my-app
|
|
@@ -90,22 +179,9 @@ Run it and open http://localhost:3000:
|
|
|
90
179
|
node server.ts
|
|
91
180
|
```
|
|
92
181
|
|
|
93
|
-
For Bun, `bun run index.ts` serves the same `export default app`.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
`create-acrylblends` creates a ready project with `dev`, `test` and `start` scripts:
|
|
98
|
-
|
|
99
|
-
```sh
|
|
100
|
-
npm create acrylblends@latest my-app
|
|
101
|
-
cd my-app
|
|
102
|
-
npm install
|
|
103
|
-
npm run dev
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
The `nodejs` template is a minimal Acryl app. `bun` is the same for Bun (experimental). `acryl-app` is a Cordis app built from plugins,
|
|
107
|
-
with an agent that can extend it while it runs. See the
|
|
108
|
-
[create-acrylblends guide](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/create-acrylblends.md).
|
|
182
|
+
For Bun, `bun run index.ts` serves the same `export default app`. The same app mounts inside a Cordis plugin with
|
|
183
|
+
`ctx.router.route(prefix, app)`, which is how a generated app is put together: see
|
|
184
|
+
[Acryl in a Cordis app](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/cordis/acryl-in-a-cordis-app.md).
|
|
109
185
|
|
|
110
186
|
## A first API
|
|
111
187
|
|
|
@@ -139,10 +215,10 @@ app.onError((error, c) => error instanceof HTTPException ? error.getResponse() :
|
|
|
139
215
|
export default app
|
|
140
216
|
```
|
|
141
217
|
|
|
142
|
-
Read more: [Routing](https://github.com/
|
|
143
|
-
[Context](https://github.com/
|
|
144
|
-
[Request](https://github.com/
|
|
145
|
-
[Exceptions](https://github.com/
|
|
218
|
+
Read more: [Routing](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/routing.md),
|
|
219
|
+
[Context](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/context.md),
|
|
220
|
+
[Request](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/request.md),
|
|
221
|
+
[Exceptions](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/exception.md).
|
|
146
222
|
|
|
147
223
|
## Middleware
|
|
148
224
|
|
|
@@ -166,8 +242,8 @@ app.use('/admin/*', bearerAuth({ token: process.env.ADMIN_TOKEN ?? '' }))
|
|
|
166
242
|
Built in: `basic-auth`, `bearer-auth`, `body-limit`, `combine`, `compress`, `context-storage`, `cors`, `csrf`, `etag`, `ip-restriction`,
|
|
167
243
|
`jwk`, `jwt`, `language`, `logger`, `method-not-allowed`, `method-override`, `powered-by`, `pretty-json`, `request-id`, `secure-headers`,
|
|
168
244
|
`serve-static`, `timeout`, `timing`, `trailing-slash`, plus ACRYL's `loopback-only`. Each one is documented under
|
|
169
|
-
[Middleware](https://github.com/
|
|
170
|
-
[middleware guide](https://github.com/
|
|
245
|
+
[Middleware](https://github.com/acrylblends/acrylblends/tree/main/docs/framework/middleware/builtin). To write your own, see the
|
|
246
|
+
[middleware guide](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/middleware.md).
|
|
171
247
|
|
|
172
248
|
## Validation
|
|
173
249
|
|
|
@@ -192,7 +268,7 @@ app.post(
|
|
|
192
268
|
```
|
|
193
269
|
|
|
194
270
|
`acrylblends/schema-validator` drives the same validator with any [Standard Schema](https://standardschema.dev) library (Zod, Valibot,
|
|
195
|
-
ArkType and others). See the [validation guide](https://github.com/
|
|
271
|
+
ArkType and others). See the [validation guide](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/validation.md).
|
|
196
272
|
|
|
197
273
|
## Typed client
|
|
198
274
|
|
|
@@ -217,7 +293,7 @@ const answer = await client.api.hello.$get()
|
|
|
217
293
|
console.log((await answer.json()).message)
|
|
218
294
|
```
|
|
219
295
|
|
|
220
|
-
See [RPC](https://github.com/
|
|
296
|
+
See [RPC](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/rpc.md).
|
|
221
297
|
|
|
222
298
|
## Testing
|
|
223
299
|
|
|
@@ -236,7 +312,7 @@ test('GET / says hello', async () => {
|
|
|
236
312
|
```
|
|
237
313
|
|
|
238
314
|
Run it with `node --test`. `acrylblends/testing` adds `testClient`, the typed client over `app.request()`. See the
|
|
239
|
-
[testing guide](https://github.com/
|
|
315
|
+
[testing guide](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/testing.md).
|
|
240
316
|
|
|
241
317
|
## Serving on Node.js
|
|
242
318
|
|
|
@@ -257,7 +333,7 @@ const server = serve({ fetch: app.fetch, port: 3000, hostname: '127.0.0.1' })
|
|
|
257
333
|
process.on('SIGTERM', () => { server.close() })
|
|
258
334
|
```
|
|
259
335
|
|
|
260
|
-
See [Node.js](https://github.com/
|
|
336
|
+
See [Node.js](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/getting-started/nodejs.md).
|
|
261
337
|
|
|
262
338
|
## What is in the package
|
|
263
339
|
|
|
@@ -267,21 +343,20 @@ See [Node.js](https://github.com/acryldev/acryl/blob/main/docs/framework/getting
|
|
|
267
343
|
| `acrylblends/<middleware>` | each built-in middleware, for example `acrylblends/cors` |
|
|
268
344
|
| `acrylblends/validator`, `acrylblends/schema-validator` | request validation |
|
|
269
345
|
| `acrylblends/client`, `acrylblends/testing` | the typed client and its in-process test version |
|
|
270
|
-
| `acrylblends/accepts`, `adapter`, `cookie`, `factory`, `html`, `route`, `streaming`, `ws`, `conninfo` | helpers ([helpers docs](https://github.com/
|
|
346
|
+
| `acrylblends/accepts`, `adapter`, `cookie`, `factory`, `html`, `route`, `streaming`, `ws`, `conninfo` | helpers ([helpers docs](https://github.com/acrylblends/acrylblends/tree/main/docs/framework/helpers)) |
|
|
271
347
|
| `acrylblends/http-exception` | `HTTPException` |
|
|
272
|
-
| `acrylblends/router/*` | the routers: `reg-exp-router`, `smart-router`, `trie-router`, `pattern-router`, `linear-router` ([routers](https://github.com/
|
|
273
|
-
| `acrylblends/
|
|
274
|
-
| `acrylblends/tiny`, `acrylblends/quick` | the presets: `Acryl` with another router (`PatternRouter`; `LinearRouter` and `TrieRouter`) ([presets](https://github.com/acryldev/acryl/blob/main/docs/framework/api/presets.md)) |
|
|
348
|
+
| `acrylblends/router/*` | the routers: `reg-exp-router`, `smart-router`, `trie-router`, `pattern-router`, `linear-router` ([routers](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/concepts/routers.md)) |
|
|
349
|
+
| `acrylblends/tiny`, `acrylblends/quick` | the presets: `Acryl` with another router (`PatternRouter`; `LinearRouter` and `TrieRouter`) ([presets](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/api/presets.md)) |
|
|
275
350
|
| `acrylblends/cache`, `acrylblends/mount` | the cache middleware and mounting another framework's fetch handler |
|
|
276
|
-
| `acrylblends/ssg` | static site generation: `toSSG` writes every route as a file ([SSG helper](https://github.com/
|
|
351
|
+
| `acrylblends/ssg` | static site generation: `toSSG` writes every route as a file ([SSG helper](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/helpers/ssg.md)) |
|
|
277
352
|
| `acrylblends/proxy`, `acrylblends/dev` | the proxy helper and the dev helpers (`showRoutes`, `inspectRoutes`, `getRouterName`) |
|
|
278
|
-
| `acrylblends/jsx` | JSX on the server: `jsxImportSource: 'acrylblends/jsx'`, `.tsx` files run on Node with `node --import acrylblends/node-server/register`, with `jsx/streaming`, and `acrylblends/jsx-renderer` for a layout behind `c.render` ([JSX guide](https://github.com/
|
|
279
|
-
| `acrylblends/jsx/dom` | JSX in the browser: hooks and `render` (needs the DOM library) ([client components](https://github.com/
|
|
280
|
-
| `acrylblends/
|
|
353
|
+
| `acrylblends/jsx` | JSX on the server: `jsxImportSource: 'acrylblends/jsx'`, `.tsx` files run on Node with `node --import acrylblends/node-server/register`, with `jsx/streaming`, and `acrylblends/jsx-renderer` for a layout behind `c.render` ([JSX guide](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/jsx.md)) |
|
|
354
|
+
| `acrylblends/jsx/dom` | JSX in the browser: hooks and `render` (needs the DOM library) ([client components](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/jsx-dom.md)); on Node, `clientModules` serves them to the browser without a bundler ([guide](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/guides/client-modules.md)) |
|
|
355
|
+
| `acrylblends/drivers` | the driver contract of the agent panel (`ChatDriver`, `TerminalDriver`, `Drivers`), for plugins that add an agent to the panel |
|
|
356
|
+
| `acrylblends/css` | CSS in JSX: `css`, `cx`, `keyframes`, `Style` ([CSS helper](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/helpers/css.md)) |
|
|
281
357
|
| `acrylblends/node-server` | `serve`, `createAdaptorServer`, `getRequestListener`; with `node-server/serve-static`, `node-server/conninfo`, and `node-server/register` (compiles `.tsx` with the app's `typescript`); `clientModules` and `buildClientModules` (client components without a bundler) |
|
|
282
358
|
|
|
283
|
-
Every subpath is listed in the package's `exports
|
|
284
|
-
([FAQ](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/faq.md)).
|
|
359
|
+
Every subpath in the table is listed in the package's `exports` and is covered by semver from 1.0, except the ones marked experimental: `acrylblends/bun` and the door (`door/*`, `cordis/door`), which are development tools. The ported core's utilities (`utils/*`) and the base-class chunk are internal and not exported. Node.js is the runtime the package is verified on; the upstream's adapters for AWS Lambda, Lambda@Edge, Cloudflare, Vercel, Netlify and Service Workers are not part of the package ([Other runtimes](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/getting-started/other-runtimes.md)).
|
|
285
360
|
|
|
286
361
|
To extend the context's typed variables, augment the root module:
|
|
287
362
|
|
|
@@ -293,11 +368,14 @@ declare module 'acrylblends' {
|
|
|
293
368
|
}
|
|
294
369
|
```
|
|
295
370
|
|
|
296
|
-
## Upgrading from
|
|
371
|
+
## Upgrading from an older version
|
|
372
|
+
|
|
373
|
+
An app made with any 0.9.1 or later release moves with `acrylblends upgrade` (above); its edited files are never replaced silently.
|
|
297
374
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
[Migration
|
|
375
|
+
Code that imports the old names moves by hand: `App` and `AppRequest`, the 0.4 aliases of `Acryl` and `AcrylRequest`, are removed in 1.0, and
|
|
376
|
+
the scaffolding API that was the package root in 0.4 is now `acrylblends/cli`. See
|
|
377
|
+
[Migration to 1.0](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/cordis/migration-to-1-0.md) and
|
|
378
|
+
[Migration from 0.4](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/cordis/migration-from-0-4.md).
|
|
301
379
|
|
|
302
380
|
## The acrylblends command
|
|
303
381
|
|
|
@@ -311,18 +389,18 @@ cd my-app && npm install && npm run dev
|
|
|
311
389
|
```
|
|
312
390
|
|
|
313
391
|
See the [ACRYLBLENDS documentation](https://github.com/acrylblends/acrylblends/blob/main/docs/README.md) and
|
|
314
|
-
[Acryl in a Cordis app](https://github.com/
|
|
392
|
+
[Acryl in a Cordis app](https://github.com/acrylblends/acrylblends/blob/main/docs/framework/cordis/acryl-in-a-cordis-app.md).
|
|
315
393
|
|
|
316
394
|
## Links
|
|
317
395
|
|
|
318
396
|
| | |
|
|
319
397
|
| --- | --- |
|
|
320
|
-
| Framework documentation | https://github.com/
|
|
398
|
+
| Framework documentation | https://github.com/acrylblends/acrylblends/blob/main/docs/framework/README.md |
|
|
321
399
|
| ACRYLBLENDS website | https://acrylblends.github.io |
|
|
322
400
|
| ACRYL website | https://acryl.dev |
|
|
323
401
|
| This package's source and issues | https://github.com/acrylblends/acrylblends ([issues](https://github.com/acrylblends/acrylblends/issues)) |
|
|
324
402
|
| The framework's source | https://github.com/acryldev/acryl (`plugins/acryl-router`, `plugins/acryl-node-server`) |
|
|
325
|
-
| For coding agents | https://github.com/
|
|
403
|
+
| For coding agents | https://github.com/acrylblends/acrylblends/blob/main/docs/framework/agents/index.md |
|
|
326
404
|
| npm | https://www.npmjs.com/package/acrylblends |
|
|
327
405
|
|
|
328
406
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -44,9 +44,15 @@ export declare function runCli(argv: readonly string[], io?: Io): Promise<number
|
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/templates.d.ts
|
|
46
46
|
/** The templates, all Cordis apps: a web app with a page and a client component (nodejs), a notes app and a chat app on the db port (notes, chat), a blank app on the router, a todo list on the router and state, and the blank app with the offline agent. */
|
|
47
|
-
export declare const TEMPLATES: readonly ["
|
|
47
|
+
export declare const TEMPLATES: readonly ["blank", "nodejs", "notes", "chat", "todo", "agent"];
|
|
48
48
|
type Template = (typeof TEMPLATES)[number];
|
|
49
|
+
/** One line per template: the single list `acrylblends init` and `create-acrylblends` both show (`create-acrylblends` tests that its own copy equals this one). */
|
|
50
|
+
export declare const TEMPLATE_SUMMARY: Record<(typeof TEMPLATES)[number], string>;
|
|
51
|
+
/** Names that were templates once and still work: `create-acrylblends --template acryl-app` made the agent app. */
|
|
52
|
+
export declare const TEMPLATE_ALIASES: Record<string, Template>;
|
|
49
53
|
export declare function isTemplate(value: string): value is Template;
|
|
54
|
+
/** The template a name means: itself, or what an old name stands for; undefined for anything else. */
|
|
55
|
+
export declare function resolveTemplate(value: string): Template | undefined;
|
|
50
56
|
/**
|
|
51
57
|
* The `templates/` folder of this package. The module sits at different depths in source (`src/`) and in the build
|
|
52
58
|
* (`dist/`), so walk up until a `templates` folder holds the `blank` template.
|
|
@@ -137,5 +143,26 @@ export declare function readTemplatePlugins(templateDir: string): string[];
|
|
|
137
143
|
/** Add run-time dependencies to an app's package.json, keeping what is there and sorting the keys. Returns the names added. */
|
|
138
144
|
export declare function mergeDependencies(appDir: string, dependencies: Readonly<Record<string, string>>): string[];
|
|
139
145
|
//#endregion
|
|
140
|
-
|
|
146
|
+
//#region src/upgrade.d.ts
|
|
147
|
+
interface UpgradeOptions {
|
|
148
|
+
/** Library plugins to upgrade; none means every library plugin the app carries. */
|
|
149
|
+
readonly names: readonly string[];
|
|
150
|
+
readonly directory: string | undefined;
|
|
151
|
+
/** Show what would change and stop. */
|
|
152
|
+
readonly dryRun: boolean;
|
|
153
|
+
/** Replace a file the app edited too (the edited version is saved first). */
|
|
154
|
+
readonly force: boolean;
|
|
155
|
+
/** Print the diff of every changed file, not only of the edited ones. */
|
|
156
|
+
readonly diff: boolean;
|
|
157
|
+
}
|
|
158
|
+
/** Parse `upgrade [plugin...] [--dir <app>] [--dry-run] [--force] [--diff]`. */
|
|
159
|
+
export declare function parseUpgradeOptions(argv: readonly string[]): UpgradeOptions;
|
|
160
|
+
/**
|
|
161
|
+
* `acrylblends upgrade`: bring the library plugins an app carries (the router, the server, the door, `extensions`, ...) up to the version of this package. Each file is compared with what
|
|
162
|
+
* the app was given: an untouched file is replaced, a file the app edited stops the upgrade (it is shown as a diff and nothing changes) unless `--force`, which saves the edited version
|
|
163
|
+
* under `.acrylblends/upgrade-backup/` first. Returns the exit code: 0 done or nothing to do, 1 refused or failed.
|
|
164
|
+
*/
|
|
165
|
+
export declare function upgrade(options: UpgradeOptions, io: Io): Promise<number>;
|
|
166
|
+
//#endregion
|
|
167
|
+
export type { AddOptions, InitOptions, Io, LibraryPlugin, Template, UpgradeOptions };
|
|
141
168
|
//# sourceMappingURL=index.d.ts.map
|