acrylblends 0.11.0 → 1.0.0-rc.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 +5 -7
- 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 +3 -3
- package/docs/framework/api/summary.md +1 -1
- package/docs/framework/concepts/web-standard.md +4 -14
- 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/production.md +43 -0
- package/docs/framework/helpers/conninfo.md +1 -36
- package/docs/framework/helpers/websocket.md +4 -11
- package/docs/framework/middleware/builtin/ip-restriction.md +1 -1
- package/docs/framework/middleware/builtin/loopback-only.md +1 -1
- 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
|
@@ -103,8 +103,7 @@ npm install
|
|
|
103
103
|
npm run dev
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
The `
|
|
107
|
-
with an agent that can extend it while it runs. See the
|
|
106
|
+
The templates are the same through `npm create acrylblends` and `acrylblends init`: `blank`, `nodejs`, `notes`, `chat`, `todo` and `agent` (a Cordis app with an agent that can extend it while it runs; `acryl-app` is its old name). See the
|
|
108
107
|
[create-acrylblends guide](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/create-acrylblends.md).
|
|
109
108
|
|
|
110
109
|
## A first API
|
|
@@ -270,18 +269,17 @@ See [Node.js](https://github.com/acryldev/acryl/blob/main/docs/framework/getting
|
|
|
270
269
|
| `acrylblends/accepts`, `adapter`, `cookie`, `factory`, `html`, `route`, `streaming`, `ws`, `conninfo` | helpers ([helpers docs](https://github.com/acryldev/acryl/tree/main/docs/framework/helpers)) |
|
|
271
270
|
| `acrylblends/http-exception` | `HTTPException` |
|
|
272
271
|
| `acrylblends/router/*` | the routers: `reg-exp-router`, `smart-router`, `trie-router`, `pattern-router`, `linear-router` ([routers](https://github.com/acryldev/acryl/blob/main/docs/framework/concepts/routers.md)) |
|
|
273
|
-
| `acrylblends/utils/*` | the utilities the framework is built from |
|
|
274
272
|
| `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)) |
|
|
275
273
|
| `acrylblends/cache`, `acrylblends/mount` | the cache middleware and mounting another framework's fetch handler |
|
|
276
274
|
| `acrylblends/ssg` | static site generation: `toSSG` writes every route as a file ([SSG helper](https://github.com/acryldev/acryl/blob/main/docs/framework/helpers/ssg.md)) |
|
|
277
275
|
| `acrylblends/proxy`, `acrylblends/dev` | the proxy helper and the dev helpers (`showRoutes`, `inspectRoutes`, `getRouterName`) |
|
|
278
276
|
| `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/acryldev/acryl/blob/main/docs/framework/guides/jsx.md)) |
|
|
279
277
|
| `acrylblends/jsx/dom` | JSX in the browser: hooks and `render` (needs the DOM library) ([client components](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/jsx-dom.md)); on Node, `clientModules` serves them to the browser without a bundler ([guide](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/client-modules.md)) |
|
|
278
|
+
| `acrylblends/drivers` | the driver contract of the agent panel (`ChatDriver`, `TerminalDriver`, `Drivers`), for plugins that add an agent to the panel |
|
|
280
279
|
| `acrylblends/css` | CSS in JSX: `css`, `cx`, `keyframes`, `Style` ([CSS helper](https://github.com/acryldev/acryl/blob/main/docs/framework/helpers/css.md)) |
|
|
281
280
|
| `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
281
|
|
|
283
|
-
Every subpath is listed in the package's `exports
|
|
284
|
-
([FAQ](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/faq.md)).
|
|
282
|
+
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/acryldev/acryl/blob/main/docs/framework/getting-started/other-runtimes.md)).
|
|
285
283
|
|
|
286
284
|
To extend the context's typed variables, augment the root module:
|
|
287
285
|
|
|
@@ -295,8 +293,8 @@ declare module 'acrylblends' {
|
|
|
295
293
|
|
|
296
294
|
## Upgrading from 0.4
|
|
297
295
|
|
|
298
|
-
From 0.5 the package's root is the framework. `App` and `AppRequest`, the 0.4 names,
|
|
299
|
-
`AcrylRequest`
|
|
296
|
+
From 0.5 the package's root is the framework. `App` and `AppRequest`, the 0.4 names, were kept as deprecated aliases of `Acryl` and
|
|
297
|
+
`AcrylRequest` and are removed in 1.0. The scaffolding API that was the root in 0.4 is now `acrylblends/cli`. See
|
|
300
298
|
[Migration from 0.4](https://github.com/acryldev/acryl/blob/main/docs/framework/cordis/migration-from-0-4.md).
|
|
301
299
|
|
|
302
300
|
## The acrylblends command
|
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
|