acrylblends 0.6.3 → 0.6.4
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 +3 -2
- package/docs/framework/README.md +2 -2
- package/docs/framework/UPSTREAM.md +1 -1
- package/docs/framework/guides/jsx.md +24 -0
- package/docs/framework/helpers/ssg.md +3 -6
- package/docs/framework/middleware/builtin/jsx-renderer.md +0 -3
- package/docs/framework/upstream.json +2 -2
- package/lib/accepts.d.ts +1 -1
- package/lib/acryl-base.d.ts +1 -1
- package/lib/adapter.d.ts +1 -1
- package/lib/{app-wFwpg-bt.d.ts → app-D8riatvv.d.ts} +1 -1
- package/lib/basic-auth.d.ts +1 -1
- package/lib/bearer-auth.d.ts +1 -1
- package/lib/body-limit.d.ts +1 -1
- package/lib/cache.d.ts +1 -1
- package/lib/cache.js +4 -4
- package/lib/{client-BHTr318g.js → client-DDLXwhBo.js} +2 -125
- package/lib/client.d.ts +2 -2
- package/lib/client.js +2 -1
- package/lib/combine.d.ts +1 -1
- package/lib/{components-Ce5FRyHU.js → components-0o0CBYNv.js} +2 -2
- package/lib/{components-DYZdxJIJ.js → components-DdI7-ns7.js} +1 -1
- package/lib/compress.d.ts +1 -1
- package/lib/conninfo.d.ts +2 -2
- package/lib/{context-DVQBjuns.d.ts → context-DS3fYyG-.d.ts} +1 -1
- package/lib/context-storage.d.ts +1 -1
- package/lib/cookie.d.ts +1 -1
- package/lib/cors.d.ts +1 -1
- package/lib/csrf.d.ts +1 -1
- package/lib/dev.d.ts +2 -2
- package/lib/etag.d.ts +1 -1
- package/lib/factory.d.ts +2 -2
- package/lib/{hooks-Bq5q9IMl.js → hooks-BMw6BAyP.js} +5 -5
- package/lib/{index-CUTfU69R.d.ts → index-Bb7YJKCq.d.ts} +2 -2
- package/lib/{index-CsvB-F9j.d.ts → index-BvFh1Gfx.d.ts} +1 -1
- package/lib/{index-Cqcdluyn.d.ts → index-CTy4N7ng.d.ts} +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/ip-restriction.d.ts +2 -2
- package/lib/jsx/dom/client.js +1 -1
- package/lib/jsx/dom/jsx-dev-runtime.js +1 -1
- package/lib/jsx/dom/jsx-runtime.js +1 -1
- package/lib/jsx/dom/server.js +1 -1
- package/lib/jsx/dom.js +3 -3
- package/lib/jsx/streaming.js +1 -1
- package/lib/{jsx-dev-runtime-kAhR_4C7.js → jsx-dev-runtime-D18Y35TI.js} +1 -1
- package/lib/jsx-renderer.d.ts +75 -0
- package/lib/jsx-renderer.js +99 -0
- package/lib/jsx.js +3 -3
- package/lib/jwk.d.ts +1 -1
- package/lib/jwt.d.ts +1 -1
- package/lib/language.d.ts +1 -1
- package/lib/logger.d.ts +1 -1
- package/lib/loopback-only.d.ts +1 -1
- package/lib/method-not-allowed.d.ts +2 -2
- package/lib/method-override.d.ts +2 -2
- package/lib/mount.d.ts +1 -1
- package/lib/node-server/conninfo.d.ts +1 -1
- package/lib/node-server/serve-static.d.ts +1 -1
- package/lib/node-server/serve-static.js +1 -1
- package/lib/node-server.d.ts +1 -1
- package/lib/node-server.js +1 -1
- package/lib/powered-by.d.ts +1 -1
- package/lib/pretty-json.d.ts +1 -1
- package/lib/quick.d.ts +1 -1
- package/lib/request-id.d.ts +1 -1
- package/lib/request.d.ts +1 -1
- package/lib/route.d.ts +1 -1
- package/lib/schema-validator.d.ts +1 -1
- package/lib/secure-headers.d.ts +1 -1
- package/lib/{serve-static-Cw23shXv.js → serve-static-B14MF1Va.js} +1 -0
- package/lib/serve-static.d.ts +1 -1
- package/lib/ssg-BwjcA-Ge.js +389 -0
- package/lib/ssg.d.ts +156 -0
- package/lib/ssg.js +2 -0
- package/lib/streaming.d.ts +1 -1
- package/lib/testing.d.ts +3 -3
- package/lib/testing.js +1 -1
- package/lib/timeout.d.ts +1 -1
- package/lib/timing.d.ts +1 -1
- package/lib/tiny.d.ts +1 -1
- package/lib/trailing-slash.d.ts +1 -1
- package/lib/{types-nEL8VPDC.d.ts → types-Dv_nV2cv.d.ts} +1 -1
- package/lib/{types-CQiGmsWW.d.ts → types-zNxyEpG2.d.ts} +2 -2
- package/lib/types.d.ts +1 -1
- package/lib/utils/body.d.ts +1 -1
- package/lib/utils/ipaddr.d.ts +1 -1
- package/lib/utils-Cx61GFMC.js +125 -0
- package/lib/validator.d.ts +1 -1
- package/lib/ws.d.ts +1 -1
- package/package.json +9 -1
- package/plugins/acryl-inspect/upstream.json +1 -1
- package/plugins/acryl-node-server/upstream.json +1 -1
- package/plugins/acryl-router/src/core/helper/ssg/index.ts +14 -0
- package/plugins/acryl-router/src/core/helper/ssg/middleware.ts +83 -0
- package/plugins/acryl-router/src/core/helper/ssg/plugins.ts +72 -0
- package/plugins/acryl-router/src/core/helper/ssg/ssg.ts +471 -0
- package/plugins/acryl-router/src/core/helper/ssg/utils.ts +118 -0
- package/plugins/acryl-router/src/core/jsx/dom/render.ts +6 -6
- package/plugins/acryl-router/src/core/middleware/cache/index.ts +4 -4
- package/plugins/acryl-router/src/core/middleware/jsx-renderer/index.ts +162 -0
- package/plugins/acryl-router/src/helpers/index.ts +1 -0
- package/plugins/acryl-router/src/middleware/index.ts +1 -0
- package/plugins/acryl-router/upstream.json +2 -2
- package/plugins/acryl-router-http/upstream.json +1 -1
- package/plugins/acryl-state/upstream.json +1 -1
- package/plugins/desktop/upstream.json +1 -1
- package/plugins/desktop-web/upstream.json +1 -1
- package/plugins/extensions/resolve.ts +4 -0
- package/shared/AGENTS.core.md +4 -0
- package/templates/agent/tsconfig.json +7 -1
- package/templates/todo/upstream.json +1 -1
- package/plugins/acryl-inspect/tests/report.spec.ts +0 -69
- package/plugins/acryl-inspect/tests/service.spec.ts +0 -121
- package/plugins/acryl-node-server/tests/adapter/app.ts +0 -76
- package/plugins/acryl-node-server/tests/adapter/assets/.static/plain.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/favicon.ico +0 -0
- package/plugins/acryl-node-server/tests/adapter/assets/secret.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static/acryl.html +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static/admin/secret.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static/data.json +0 -5
- package/plugins/acryl-node-server/tests/adapter/assets/static/extensionless +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static/foo..bar.txt +0 -0
- package/plugins/acryl-node-server/tests/adapter/assets/static/index.html +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static/plain.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-context-path/plain.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.bin +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.bin.br +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt.br +0 -1
- package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt.zst +0 -1
- package/plugins/acryl-node-server/tests/adapter/conninfo.test.ts +0 -34
- package/plugins/acryl-node-server/tests/adapter/content-length.test.ts +0 -248
- package/plugins/acryl-node-server/tests/adapter/early-hints.test.ts +0 -457
- package/plugins/acryl-node-server/tests/adapter/fixtures/keys/agent1-cert.pem +0 -23
- package/plugins/acryl-node-server/tests/adapter/fixtures/keys/agent1-key.pem +0 -27
- package/plugins/acryl-node-server/tests/adapter/headers.test.ts +0 -252
- package/plugins/acryl-node-server/tests/adapter/helpers/request.ts +0 -190
- package/plugins/acryl-node-server/tests/adapter/listener.test.ts +0 -727
- package/plugins/acryl-node-server/tests/adapter/request-client-disconnect.test.ts +0 -189
- package/plugins/acryl-node-server/tests/adapter/request.test.ts +0 -1230
- package/plugins/acryl-node-server/tests/adapter/response.test.ts +0 -285
- package/plugins/acryl-node-server/tests/adapter/serve-static.test.ts +0 -849
- package/plugins/acryl-node-server/tests/adapter/server-socket.test.ts +0 -790
- package/plugins/acryl-node-server/tests/adapter/server.test.ts +0 -1312
- package/plugins/acryl-node-server/tests/adapter/setup.ts +0 -16
- package/plugins/acryl-node-server/tests/adapter/url.test.ts +0 -76
- package/plugins/acryl-node-server/tests/adapter/utils/response.test.ts +0 -23
- package/plugins/acryl-node-server/tests/adapter/utils/stream.test.ts +0 -75
- package/plugins/acryl-node-server/tests/adapter/utils.test.ts +0 -235
- package/plugins/acryl-node-server/tests/adapter/websocket.test.ts +0 -260
- package/plugins/acryl-node-server/tests/server.spec.ts +0 -141
- package/plugins/acryl-router/src/core/app.test.ts +0 -3833
- package/plugins/acryl-router/src/core/client/client.test.ts +0 -2313
- package/plugins/acryl-router/src/core/client/types.test.ts +0 -149
- package/plugins/acryl-router/src/core/client/utils.test.ts +0 -405
- package/plugins/acryl-router/src/core/compose.test.ts +0 -751
- package/plugins/acryl-router/src/core/context.test.ts +0 -629
- package/plugins/acryl-router/src/core/helper/accepts/accepts.test.ts +0 -344
- package/plugins/acryl-router/src/core/helper/adapter/index.test.ts +0 -55
- package/plugins/acryl-router/src/core/helper/cookie/index.test.ts +0 -510
- package/plugins/acryl-router/src/core/helper/css/common.case.test.tsx +0 -506
- package/plugins/acryl-router/src/core/helper/css/index.test.tsx +0 -678
- package/plugins/acryl-router/src/core/helper/dev/index.test.ts +0 -181
- package/plugins/acryl-router/src/core/helper/factory/index.test.ts +0 -434
- package/plugins/acryl-router/src/core/helper/html/index.test.ts +0 -78
- package/plugins/acryl-router/src/core/helper/proxy/index.test.ts +0 -356
- package/plugins/acryl-router/src/core/helper/route/index.test.ts +0 -259
- package/plugins/acryl-router/src/core/helper/streaming/sse.test.tsx +0 -557
- package/plugins/acryl-router/src/core/helper/streaming/stream.test.ts +0 -128
- package/plugins/acryl-router/src/core/helper/streaming/text.test.ts +0 -34
- package/plugins/acryl-router/src/core/helper/testing/index.test.ts +0 -42
- package/plugins/acryl-router/src/core/helper/websocket/index.test.ts +0 -124
- package/plugins/acryl-router/src/core/http-exception.test.ts +0 -45
- package/plugins/acryl-router/src/core/jsx/base.test.tsx +0 -97
- package/plugins/acryl-router/src/core/jsx/children.test.ts +0 -52
- package/plugins/acryl-router/src/core/jsx/components.test.tsx +0 -936
- package/plugins/acryl-router/src/core/jsx/context-isolation.test.ts +0 -655
- package/plugins/acryl-router/src/core/jsx/dom/client.test.tsx +0 -128
- package/plugins/acryl-router/src/core/jsx/dom/components.test.tsx +0 -330
- package/plugins/acryl-router/src/core/jsx/dom/context.test.tsx +0 -184
- package/plugins/acryl-router/src/core/jsx/dom/css.test.tsx +0 -149
- package/plugins/acryl-router/src/core/jsx/dom/hooks/index.test.tsx +0 -172
- package/plugins/acryl-router/src/core/jsx/dom/index.test.tsx +0 -3681
- package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.test.tsx +0 -1344
- package/plugins/acryl-router/src/core/jsx/dom/server.test.tsx +0 -199
- package/plugins/acryl-router/src/core/jsx/hooks/dom.test.tsx +0 -859
- package/plugins/acryl-router/src/core/jsx/hooks/string.test.tsx +0 -40
- package/plugins/acryl-router/src/core/jsx/index.test.tsx +0 -1744
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.test.tsx +0 -666
- package/plugins/acryl-router/src/core/jsx/jsx-runtime.test.tsx +0 -85
- package/plugins/acryl-router/src/core/jsx/streaming.test.tsx +0 -1281
- package/plugins/acryl-router/src/core/jsx/utils.test.ts +0 -366
- package/plugins/acryl-router/src/core/middleware/basic-auth/index.test.ts +0 -434
- package/plugins/acryl-router/src/core/middleware/bearer-auth/index.test.ts +0 -1018
- package/plugins/acryl-router/src/core/middleware/body-limit/index.test.ts +0 -273
- package/plugins/acryl-router/src/core/middleware/cache/index.test.ts +0 -1211
- package/plugins/acryl-router/src/core/middleware/combine/index.test.ts +0 -355
- package/plugins/acryl-router/src/core/middleware/compress/index.test.ts +0 -535
- package/plugins/acryl-router/src/core/middleware/context-storage/index.test.ts +0 -43
- package/plugins/acryl-router/src/core/middleware/cors/index.test.ts +0 -532
- package/plugins/acryl-router/src/core/middleware/csrf/index.test.ts +0 -534
- package/plugins/acryl-router/src/core/middleware/etag/digest.test.ts +0 -21
- package/plugins/acryl-router/src/core/middleware/etag/index.test.ts +0 -503
- package/plugins/acryl-router/src/core/middleware/ip-restriction/index.test.ts +0 -217
- package/plugins/acryl-router/src/core/middleware/jwk/index.test.ts +0 -1135
- package/plugins/acryl-router/src/core/middleware/jwk/keys.test.json +0 -48
- package/plugins/acryl-router/src/core/middleware/jwt/index.test.ts +0 -802
- package/plugins/acryl-router/src/core/middleware/language/index.test.ts +0 -552
- package/plugins/acryl-router/src/core/middleware/logger/index.test.ts +0 -204
- package/plugins/acryl-router/src/core/middleware/method-not-allowed/index.test.ts +0 -292
- package/plugins/acryl-router/src/core/middleware/method-override/index.test.ts +0 -221
- package/plugins/acryl-router/src/core/middleware/mount/index.test.ts +0 -334
- package/plugins/acryl-router/src/core/middleware/powered-by/index.test.ts +0 -37
- package/plugins/acryl-router/src/core/middleware/pretty-json/index.test.ts +0 -218
- package/plugins/acryl-router/src/core/middleware/request-id/index.test.ts +0 -168
- package/plugins/acryl-router/src/core/middleware/secure-headers/index.test.ts +0 -671
- package/plugins/acryl-router/src/core/middleware/serve-static/index.test.ts +0 -450
- package/plugins/acryl-router/src/core/middleware/serve-static/path.test.ts +0 -50
- package/plugins/acryl-router/src/core/middleware/timeout/index.test.ts +0 -70
- package/plugins/acryl-router/src/core/middleware/timing/index.test.ts +0 -310
- package/plugins/acryl-router/src/core/middleware/trailing-slash/index.test.ts +0 -381
- package/plugins/acryl-router/src/core/preset/quick.test.ts +0 -42
- package/plugins/acryl-router/src/core/preset/tiny.test.ts +0 -42
- package/plugins/acryl-router/src/core/request.test.ts +0 -751
- package/plugins/acryl-router/src/core/router/common.case.test.ts +0 -1132
- package/plugins/acryl-router/src/core/router/linear-router/router.test.ts +0 -80
- package/plugins/acryl-router/src/core/router/pattern-router/router.test.ts +0 -46
- package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.test.ts +0 -154
- package/plugins/acryl-router/src/core/router/reg-exp-router/router.test.ts +0 -265
- package/plugins/acryl-router/src/core/router/smart-router/router.test.ts +0 -13
- package/plugins/acryl-router/src/core/router/trie-router/node.test.ts +0 -896
- package/plugins/acryl-router/src/core/router/trie-router/router.test.ts +0 -8
- package/plugins/acryl-router/src/core/types.test.ts +0 -4134
- package/plugins/acryl-router/src/core/utils/accept.test.ts +0 -299
- package/plugins/acryl-router/src/core/utils/basic-auth.test.ts +0 -56
- package/plugins/acryl-router/src/core/utils/body.test.ts +0 -496
- package/plugins/acryl-router/src/core/utils/buffer.test.ts +0 -147
- package/plugins/acryl-router/src/core/utils/color.test.ts +0 -23
- package/plugins/acryl-router/src/core/utils/concurrent.test.ts +0 -69
- package/plugins/acryl-router/src/core/utils/cookie.test.ts +0 -460
- package/plugins/acryl-router/src/core/utils/crypto.test.ts +0 -43
- package/plugins/acryl-router/src/core/utils/encode.test.ts +0 -61
- package/plugins/acryl-router/src/core/utils/filepath.test.ts +0 -78
- package/plugins/acryl-router/src/core/utils/html.test.ts +0 -16
- package/plugins/acryl-router/src/core/utils/ipaddr.test.ts +0 -149
- package/plugins/acryl-router/src/core/utils/jwt/jwa.test.ts +0 -86
- package/plugins/acryl-router/src/core/utils/jwt/jwt.test.ts +0 -1788
- package/plugins/acryl-router/src/core/utils/mime.test.ts +0 -64
- package/plugins/acryl-router/src/core/utils/stream.test.ts +0 -212
- package/plugins/acryl-router/src/core/utils/types.test.ts +0 -295
- package/plugins/acryl-router/src/core/utils/url.test.ts +0 -384
- package/plugins/acryl-router/src/core/validator/utils.test.ts +0 -82
- package/plugins/acryl-router/src/core/validator/validator.test.ts +0 -1488
- package/plugins/acryl-router/tests/docs-examples.spec.ts +0 -152
- package/plugins/acryl-router/tests/jsx.spec.tsx +0 -63
- package/plugins/acryl-router/tests/live-install.spec.ts +0 -64
- package/plugins/acryl-router/tests/loader.spec.ts +0 -72
- package/plugins/acryl-router/tests/loopback-only.spec.ts +0 -80
- package/plugins/acryl-router/tests/no-dom/consumer.ts +0 -11
- package/plugins/acryl-router/tests/no-dom/tsconfig.json +0 -13
- package/plugins/acryl-router/tests/service.spec.ts +0 -426
- package/plugins/acryl-router/tests/shadow-state.spec.ts +0 -79
- package/plugins/acryl-router-http/tests/adapter.spec.ts +0 -174
- package/plugins/acryl-router-http/tests/stream.spec.ts +0 -133
- package/plugins/acryl-router-http/tests/surfaces.spec.ts +0 -101
- package/plugins/acryl-state/src/react.ts +0 -11
- package/plugins/acryl-state/tests/cell.spec.ts +0 -71
- package/plugins/acryl-state/tests/react.spec.ts +0 -39
- package/plugins/acryl-state/tests/service.spec.ts +0 -132
package/README.md
CHANGED
|
@@ -273,13 +273,14 @@ See [Node.js](https://github.com/acryldev/acryl/blob/main/docs/framework/getting
|
|
|
273
273
|
| `acrylblends/utils/*` | the utilities the framework is built from |
|
|
274
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)) |
|
|
275
275
|
| `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/acryldev/acryl/blob/main/docs/framework/helpers/ssg.md)) |
|
|
276
277
|
| `acrylblends/proxy`, `acrylblends/dev` | the proxy helper and the dev helpers (`showRoutes`, `inspectRoutes`, `getRouterName`) |
|
|
277
|
-
| `acrylblends/jsx` | JSX on the server: `jsxImportSource: 'acrylblends/jsx'`, with `jsx/streaming` ([JSX guide](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/jsx.md)) |
|
|
278
|
+
| `acrylblends/jsx` | JSX on the server: `jsxImportSource: 'acrylblends/jsx'`, 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)) |
|
|
278
279
|
| `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)) |
|
|
279
280
|
| `acrylblends/css` | CSS in JSX: `css`, `cx`, `keyframes`, `Style` ([CSS helper](https://github.com/acryldev/acryl/blob/main/docs/framework/helpers/css.md)) |
|
|
280
281
|
| `acrylblends/node-server` | `serve`, `createAdaptorServer`, `getRequestListener`; with `node-server/serve-static` and `node-server/conninfo` |
|
|
281
282
|
|
|
282
|
-
Every subpath is listed in the package's `exports`. The
|
|
283
|
+
Every subpath is listed in the package's `exports`. The adapters of other runtimes are being ported. The docs mark them "not yet available" until they ship
|
|
283
284
|
([FAQ](https://github.com/acryldev/acryl/blob/main/docs/framework/guides/faq.md)).
|
|
284
285
|
|
|
285
286
|
To extend the context's typed variables, augment the root module:
|
package/docs/framework/README.md
CHANGED
|
@@ -39,8 +39,8 @@ Verified: Node.js. Bun is experimental. The other runtimes the framework could t
|
|
|
39
39
|
|
|
40
40
|
## Not yet available
|
|
41
41
|
|
|
42
|
-
Some parts of the documented API surface are not part of the package yet, and their pages say so at the top: the
|
|
43
|
-
|
|
42
|
+
Some parts of the documented API surface are not part of the package yet, and their pages say so at the top: the adapters of the runtimes other than Node.js.
|
|
43
|
+
They are enabled as they are ported.
|
|
44
44
|
|
|
45
45
|
## Where to read next
|
|
46
46
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Generated copy
|
|
2
2
|
|
|
3
|
-
This folder is a copy of `docs/framework` of acryldev/acryl at commit `
|
|
3
|
+
This folder is a copy of `docs/framework` of acryldev/acryl at commit `fd1f7dcaaff8b757c0562294002c0d32d6e0a893`, made by `scripts/sync-framework.mjs`. Do not edit it here: change the text in ACRYL and sync again. `pnpm run verify:framework` fails when a page differs from the recorded digest.
|
|
@@ -4,6 +4,30 @@ You can write HTML with JSX syntax with `acrylblends/jsx`.
|
|
|
4
4
|
|
|
5
5
|
Although `acrylblends/jsx` works on the client, you will probably use it most often when rendering content on the server side. Here are some things related to JSX that are common to both server and client.
|
|
6
6
|
|
|
7
|
+
## Node.js runs `jsx()`, not JSX syntax
|
|
8
|
+
|
|
9
|
+
The apps `npm create acrylblends@latest` makes run their TypeScript on Node.js by stripping the types (no build step). That does **not** compile JSX: a `.tsx` file does not load. Either compile the file first (`tsc`
|
|
10
|
+
or a bundler, with the settings below), or write the call that JSX compiles to. `jsx(tag, props, ...children)` takes the children after the props, and a node renders with `toString()`:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { Acryl } from 'acrylblends'
|
|
14
|
+
import { jsx } from 'acrylblends/jsx'
|
|
15
|
+
import type { PropsWithChildren } from 'acrylblends/jsx'
|
|
16
|
+
|
|
17
|
+
const Layout = (props: PropsWithChildren<{ title: string }>) =>
|
|
18
|
+
jsx('html', { lang: 'en' }, jsx('head', null, jsx('title', null, props.title)), jsx('body', null, props.children))
|
|
19
|
+
|
|
20
|
+
const About = () =>
|
|
21
|
+
jsx(Layout, { title: 'About' }, jsx('h1', null, 'About'), jsx('p', { class: 'lead' }, 'Rendered on the server.'))
|
|
22
|
+
|
|
23
|
+
const app = new Acryl()
|
|
24
|
+
app.get('/about', (c) => c.html(jsx(About, null).toString()))
|
|
25
|
+
|
|
26
|
+
export default app
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Pass the children as arguments after the props. A `children` entry inside the props object is not rendered by this form.
|
|
30
|
+
|
|
7
31
|
## Settings
|
|
8
32
|
|
|
9
33
|
To use JSX, modify the `tsconfig.json`:
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# SSG Helper
|
|
2
2
|
|
|
3
|
-
> **Not yet available.** Static site generation (`acrylblends/ssg`) is documented here so the page structure matches the rest of the framework, and is not part of acrylblends yet. The code on this page is not checked by the docs tests.
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
SSG Helper generates a static site from your Acryl application. It will retrieve the contents of registered routes and save them as static files.
|
|
7
4
|
|
|
8
5
|
## Usage
|
|
@@ -237,7 +234,7 @@ Plugins allow you to extend the functionality of the static site generation proc
|
|
|
237
234
|
|
|
238
235
|
### Default Plugin
|
|
239
236
|
|
|
240
|
-
By default, `toSSG` uses `defaultPlugin
|
|
237
|
+
By default, `toSSG` uses `defaultPlugin()`, which skips non-200 status responses (like redirects, errors, or 404s). This prevents generating files for unsuccessful responses.
|
|
241
238
|
|
|
242
239
|
```ts
|
|
243
240
|
import { toSSG, defaultPlugin } from 'acrylblends/ssg'
|
|
@@ -246,14 +243,14 @@ import { toSSG, defaultPlugin } from 'acrylblends/ssg'
|
|
|
246
243
|
toSSG(app, fs)
|
|
247
244
|
|
|
248
245
|
// Equivalent to:
|
|
249
|
-
toSSG(app, fs, { plugins: [defaultPlugin] })
|
|
246
|
+
toSSG(app, fs, { plugins: [defaultPlugin()] })
|
|
250
247
|
```
|
|
251
248
|
|
|
252
249
|
If you specify custom plugins, `defaultPlugin` is **not** automatically included. To keep the default behavior while adding custom plugins, explicitly include it:
|
|
253
250
|
|
|
254
251
|
```ts
|
|
255
252
|
toSSG(app, fs, {
|
|
256
|
-
plugins: [defaultPlugin, myCustomPlugin],
|
|
253
|
+
plugins: [defaultPlugin(), myCustomPlugin],
|
|
257
254
|
})
|
|
258
255
|
```
|
|
259
256
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# JSX Renderer Middleware
|
|
2
2
|
|
|
3
|
-
> **Not yet available.** The JSX renderer middleware (`acrylblends/jsx-renderer`) is documented here so the page structure matches the rest of the framework, and is not part of acrylblends yet. The code on this page is not checked by the docs tests.
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
JSX Renderer Middleware allows you to set up the layout when rendering JSX with the `c.render()` function, without the need for using `c.setRenderer()`. Additionally, it enables access to instances of Context within components through the use of `useRequestContext()`.
|
|
7
4
|
|
|
8
5
|
## Import
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"source": {
|
|
3
3
|
"repo": "acryldev/acryl",
|
|
4
4
|
"path": "docs/framework",
|
|
5
|
-
"commit": "
|
|
5
|
+
"commit": "fd1f7dcaaff8b757c0562294002c0d32d6e0a893"
|
|
6
6
|
},
|
|
7
7
|
"files": 88,
|
|
8
|
-
"digest": "sha256:
|
|
8
|
+
"digest": "sha256:5e6989c7fe1b3006f8917926d8cc3e84e14c2af03440682c18d22bec0045c3d2"
|
|
9
9
|
}
|
package/lib/accepts.d.ts
CHANGED
package/lib/acryl-base.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { et as Acryl, tt as AcrylOptions } from "./context-DS3fYyG-.js";
|
|
2
2
|
export { Acryl as AcrylBase, AcrylOptions };
|
package/lib/adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Context } from "./context-
|
|
1
|
+
import { t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/helper/adapter/index.d.ts
|
|
4
4
|
type Runtime = 'node' | 'deno' | 'bun' | 'workerd' | 'fastly' | 'edge-light' | 'other';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as Schema, et as Acryl$1, g as BlankSchema, m as BlankEnv, tt as AcrylOptions, v as Env } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/app.d.ts
|
|
4
4
|
/**
|
package/lib/basic-auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/middleware/basic-auth/index.d.ts
|
|
4
4
|
type MessageFunction = (c: Context) => string | object | Promise<string | object>;
|
package/lib/bearer-auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context, v as Env } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/middleware/bearer-auth/index.d.ts
|
|
4
4
|
type MessageFunction = (c: Context) => string | object | Promise<string | object>;
|
package/lib/body-limit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/middleware/body-limit/index.d.ts
|
|
4
4
|
type OnError = (c: Context) => Response | Promise<Response>;
|
package/lib/cache.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
import { c as StatusCode } from "./http-status-DaAwGAFL.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/middleware/cache/index.d.ts
|
package/lib/cache.js
CHANGED
|
@@ -7,10 +7,10 @@ import { cloneRawRequest } from "./request.js";
|
|
|
7
7
|
const defaultCacheableStatusCodes = [200];
|
|
8
8
|
const defaultMaxQueryBodySize = 64 * 1024;
|
|
9
9
|
const cacheKeyPath = "/.acryl-router/cache";
|
|
10
|
-
const cacheKeyParameter = "
|
|
11
|
-
const cacheMethodKeyParameter = "
|
|
12
|
-
const queryDigestKeyParameter = "
|
|
13
|
-
const cacheVaryKeyParameter = "
|
|
10
|
+
const cacheKeyParameter = "__acryl_cache_key";
|
|
11
|
+
const cacheMethodKeyParameter = "__acryl_cache_method";
|
|
12
|
+
const queryDigestKeyParameter = "__acryl_query_digest";
|
|
13
|
+
const cacheVaryKeyParameter = "__acryl_cache_vary";
|
|
14
14
|
const queryRepresentationMetadataHeaders = [
|
|
15
15
|
"content-type",
|
|
16
16
|
"content-encoding",
|
|
@@ -1,128 +1,5 @@
|
|
|
1
1
|
import { serialize } from "./utils/cookie.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Acryl's custom needs.
|
|
5
|
-
*
|
|
6
|
-
* @link https://www.npmjs.com/package/fetch-result-please
|
|
7
|
-
*/
|
|
8
|
-
const nullBodyResponses = /* @__PURE__ */ new Set([
|
|
9
|
-
101,
|
|
10
|
-
204,
|
|
11
|
-
205,
|
|
12
|
-
304
|
|
13
|
-
]);
|
|
14
|
-
/**
|
|
15
|
-
* Smartly parses and return the consumable result from a fetch `Response`.
|
|
16
|
-
*
|
|
17
|
-
* Throwing a structured error if the response is not `ok`. ({@link DetailedError})
|
|
18
|
-
*/
|
|
19
|
-
async function fetchRP(fetchRes) {
|
|
20
|
-
const _fetchRes = await fetchRes;
|
|
21
|
-
if ((_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status)) _fetchRes._data = await _fetchRes[detectResponseType(_fetchRes)]();
|
|
22
|
-
if (!_fetchRes.ok) throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, {
|
|
23
|
-
statusCode: _fetchRes?.status,
|
|
24
|
-
detail: {
|
|
25
|
-
data: _fetchRes?._data,
|
|
26
|
-
statusText: _fetchRes?.statusText
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return _fetchRes._data;
|
|
30
|
-
}
|
|
31
|
-
var DetailedError = class extends Error {
|
|
32
|
-
/**
|
|
33
|
-
* Additional `message` that will be logged AND returned to client
|
|
34
|
-
*/
|
|
35
|
-
detail;
|
|
36
|
-
/**
|
|
37
|
-
* Additional `code` that will be logged AND returned to client
|
|
38
|
-
*/
|
|
39
|
-
code;
|
|
40
|
-
/**
|
|
41
|
-
* Additional value that will be logged AND NOT returned to client
|
|
42
|
-
*/
|
|
43
|
-
log;
|
|
44
|
-
/**
|
|
45
|
-
* Optionally set the status code to return, in a web server context
|
|
46
|
-
*/
|
|
47
|
-
statusCode;
|
|
48
|
-
constructor(message, options = {}) {
|
|
49
|
-
super(message);
|
|
50
|
-
this.name = "DetailedError";
|
|
51
|
-
this.log = options.log;
|
|
52
|
-
this.detail = options.detail;
|
|
53
|
-
this.code = options.code;
|
|
54
|
-
this.statusCode = options.statusCode;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i;
|
|
58
|
-
function detectResponseType(response) {
|
|
59
|
-
const _contentType = response.headers.get("content-type");
|
|
60
|
-
if (!_contentType) return "text";
|
|
61
|
-
const contentType = _contentType.split(";").shift();
|
|
62
|
-
if (jsonRegex.test(contentType)) return "json";
|
|
63
|
-
return "text";
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region ../../plugins/acryl-router/src/core/client/utils.ts
|
|
67
|
-
const mergePath = (base, path) => {
|
|
68
|
-
base = base.replace(/\/+$/, "");
|
|
69
|
-
base = base + "/";
|
|
70
|
-
path = path.replace(/^\/+/, "");
|
|
71
|
-
return base + path;
|
|
72
|
-
};
|
|
73
|
-
const replaceUrlParam = (urlString, params) => {
|
|
74
|
-
for (const [k, v] of Object.entries(params)) {
|
|
75
|
-
const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)");
|
|
76
|
-
urlString = urlString.replace(reg, () => v ? `/${v}` : "");
|
|
77
|
-
}
|
|
78
|
-
return urlString;
|
|
79
|
-
};
|
|
80
|
-
const buildSearchParams = (query) => {
|
|
81
|
-
const searchParams = new URLSearchParams();
|
|
82
|
-
for (const [k, v] of Object.entries(query)) {
|
|
83
|
-
if (v === void 0) continue;
|
|
84
|
-
if (Array.isArray(v)) for (const v2 of v) {
|
|
85
|
-
if (v2 === void 0) continue;
|
|
86
|
-
searchParams.append(k, v2);
|
|
87
|
-
}
|
|
88
|
-
else searchParams.set(k, v);
|
|
89
|
-
}
|
|
90
|
-
return searchParams;
|
|
91
|
-
};
|
|
92
|
-
const replaceUrlProtocol = (urlString, protocol) => {
|
|
93
|
-
switch (protocol) {
|
|
94
|
-
case "ws": return urlString.replace(/^http/, "ws");
|
|
95
|
-
case "http": return urlString.replace(/^ws/, "http");
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const removeIndexString = (urlString) => {
|
|
99
|
-
if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) return urlString.replace(/\/index(?=\?|$)/, "/");
|
|
100
|
-
return urlString.replace(/\/index(?=\?|$)/, "");
|
|
101
|
-
};
|
|
102
|
-
function isObject(item) {
|
|
103
|
-
return typeof item === "object" && item !== null && !Array.isArray(item);
|
|
104
|
-
}
|
|
105
|
-
function deepMerge(target, source) {
|
|
106
|
-
if (!isObject(target) && !isObject(source)) return source;
|
|
107
|
-
const merged = { ...target };
|
|
108
|
-
for (const key in source) {
|
|
109
|
-
const value = source[key];
|
|
110
|
-
if (isObject(merged[key]) && isObject(value)) merged[key] = deepMerge(merged[key], value);
|
|
111
|
-
else merged[key] = value;
|
|
112
|
-
}
|
|
113
|
-
return merged;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference.
|
|
117
|
-
*
|
|
118
|
-
* Smartly parse the response data, throwing a structured error if the response is not `ok`. ({@link DetailedError})
|
|
119
|
-
*
|
|
120
|
-
* @example const result = await parseResponse(client.posts.$get())
|
|
121
|
-
*/
|
|
122
|
-
async function parseResponse(fetchRes) {
|
|
123
|
-
return fetchRP(fetchRes);
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
2
|
+
import { a as removeIndexString, n as deepMerge, o as replaceUrlParam, r as mergePath, s as replaceUrlProtocol, t as buildSearchParams } from "./utils-Cx61GFMC.js";
|
|
126
3
|
//#region ../../plugins/acryl-router/src/core/client/client.ts
|
|
127
4
|
const createProxy = (callback, path) => {
|
|
128
5
|
return new Proxy(() => {}, {
|
|
@@ -263,4 +140,4 @@ const hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
|
|
|
263
140
|
return req;
|
|
264
141
|
}, []);
|
|
265
142
|
//#endregion
|
|
266
|
-
export {
|
|
143
|
+
export { hc as t };
|
package/lib/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as ClientResponse, c as InferRequestType, i as ClientRequestOptions, l as InferResponseType, o as Fetch, r as ClientRequest, t as ApplyGlobalResponse, u as PickResponseByStatusCode } from "./types-
|
|
2
|
-
import { n as DetailedError, r as hc, t as parseResponse } from "./index-
|
|
1
|
+
import { a as ClientResponse, c as InferRequestType, i as ClientRequestOptions, l as InferResponseType, o as Fetch, r as ClientRequest, t as ApplyGlobalResponse, u as PickResponseByStatusCode } from "./types-zNxyEpG2.js";
|
|
2
|
+
import { n as DetailedError, r as hc, t as parseResponse } from "./index-Bb7YJKCq.js";
|
|
3
3
|
export { type ApplyGlobalResponse, type ClientRequest, type ClientRequestOptions, type ClientResponse, DetailedError, type Fetch, type InferRequestType, type InferResponseType, type PickResponseByStatusCode, hc, parseResponse };
|
package/lib/client.js
CHANGED
package/lib/combine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/middleware/combine/index.d.ts
|
|
4
4
|
type Condition = (c: Context) => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as captureRenderContext, E as useContext, d as renderUntrustedObject, i as isUntrustedObject, n as JSXNode, o as jsx, t as Fragment, u as renderChildren, w as createContext } from "./base-ddiVmiE7.js";
|
|
2
2
|
import { HtmlEscapedCallbackPhase, raw, resolveCallback } from "./utils/html.js";
|
|
3
3
|
import { a as DOM_STASH, i as DOM_RENDERER } from "./constants-BR9jM9BC.js";
|
|
4
|
-
import { x as buildDataStack } from "./hooks-
|
|
5
|
-
import { n as Suspense$1, t as ErrorBoundary$1 } from "./components-
|
|
4
|
+
import { x as buildDataStack } from "./hooks-BMw6BAyP.js";
|
|
5
|
+
import { n as Suspense$1, t as ErrorBoundary$1 } from "./components-DdI7-ns7.js";
|
|
6
6
|
//#region ../../plugins/acryl-router/src/core/jsx/streaming.ts
|
|
7
7
|
/**
|
|
8
8
|
* @module
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DOM_ERROR_HANDLER } from "./constants-BR9jM9BC.js";
|
|
2
|
-
import { t as Fragment } from "./jsx-dev-runtime-
|
|
2
|
+
import { t as Fragment } from "./jsx-dev-runtime-D18Y35TI.js";
|
|
3
3
|
import "./jsx/dom/jsx-runtime.js";
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/jsx/dom/components.ts
|
|
5
5
|
const ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => {
|
package/lib/compress.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler } from "./context-DS3fYyG-.js";
|
|
2
2
|
import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "./utils/compress.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/middleware/compress/index.d.ts
|
package/lib/conninfo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Context } from "./context-
|
|
2
|
-
import { i as NetAddrInfo, n as ConnInfo, r as GetConnInfo, t as AddressType } from "./types-
|
|
1
|
+
import { t as Context } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { i as NetAddrInfo, n as ConnInfo, r as GetConnInfo, t as AddressType } from "./types-Dv_nV2cv.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/connection.d.ts
|
|
5
5
|
/** An in-process caller (the terminal UI, a test) passes nothing, so a handler that needs a trusted peer must refuse an empty one. */
|
|
@@ -1231,4 +1231,4 @@ declare class Context<E extends Env = any, P extends string = any, I extends Inp
|
|
|
1231
1231
|
notFound: () => ReturnType<NotFoundHandler>;
|
|
1232
1232
|
}
|
|
1233
1233
|
//#endregion
|
|
1234
|
-
export {
|
|
1234
|
+
export { Variables as $, HandlerResponse as A, NotFoundHandler as B, ExtractSchemaForStatusCode as C, HTTPResponseError as D, H as E, MergePath as F, ParsedFormValue as G, OnHandlerInterface as H, MergeSchemaPath as I, RouterRoute as J, RemoveQuestion as K, MiddlewareHandler as L, InputToDataByTarget as M, IntersectNonAnyTypes as N, Handler as O, KnownResponseFormat as P, ValidationTargets as Q, MiddlewareHandlerInterface as R, ExtractSchema as S, FormValue as T, ParamKeyToRecord as U, NotFoundResponse as V, ParamKeys as W, ToSchema as X, Schema as Y, TypedResponse as Z, Endpoint as _, ExecutionContext as a, ExtractHandlerResponse as b, cloneRawRequest as c, parseBody as d, Acryl as et, AddParam as f, BlankSchema as g, BlankInput as h, Data as i, Input as j, HandlerInterface as k, BodyData as l, BlankEnv as m, ContextRenderer as n, PropsForRenderer as o, Bindings as p, ResponseFormat as q, ContextVariableMap as r, AcrylRequest as s, Context as t, AcrylOptions as tt, ParseBodyOptions as u, Env as v, FetchEventLike as w, ExtractInput as x, ErrorHandler as y, Next as z };
|
package/lib/context-storage.d.ts
CHANGED
package/lib/cookie.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Context } from "./context-
|
|
1
|
+
import { t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
import { n as BufferSource } from "./types-Lqx5BxQF.js";
|
|
3
3
|
import { a as SignedCookie, i as CookiePrefixOptions, r as CookieOptions, t as Cookie } from "./cookie-CCelEqky.js";
|
|
4
4
|
|
package/lib/cors.d.ts
CHANGED
package/lib/csrf.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/middleware/csrf/index.d.ts
|
|
4
4
|
type IsAllowedOriginHandler = (origin: string, context: Context) => boolean | Promise<boolean>;
|
package/lib/dev.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Acryl } from "./app-
|
|
1
|
+
import { v as Env } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { t as Acryl } from "./app-D8riatvv.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/helper/dev/index.d.ts
|
|
5
5
|
interface ShowRoutesOptions {
|
package/lib/etag.d.ts
CHANGED
package/lib/factory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as Acryl } from "./app-
|
|
1
|
+
import { A as HandlerResponse, E as H, L as MiddlewareHandler, N as IntersectNonAnyTypes, j as Input, tt as AcrylOptions, v as Env } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { t as Acryl } from "./app-D8riatvv.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/helper/factory/index.d.ts
|
|
5
5
|
type InitApp<E extends Env = Env> = (app: Acryl<E>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as createContext, E as useContext, T as globalContexts, _ as toArray, h as styleObjectForEach, m as normalizeIntrinsicElementKey } from "./base-ddiVmiE7.js";
|
|
2
2
|
import { a as DOM_STASH, i as DOM_RENDERER, n as DOM_INTERNAL_TAG, r as DOM_MEMO, t as DOM_ERROR_HANDLER } from "./constants-BR9jM9BC.js";
|
|
3
3
|
//#region ../../plugins/acryl-router/src/core/jsx/dom/render.ts
|
|
4
|
-
const
|
|
4
|
+
const ACRYL_PORTAL_ELEMENT = "_hp";
|
|
5
5
|
const eventAliasMap = {
|
|
6
6
|
Change: "Input",
|
|
7
7
|
DoubleClick: "DblClick"
|
|
@@ -146,7 +146,7 @@ const getNextChildren = (node, container, nextChildren, childrenToRemove, callba
|
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
const findInsertBefore = (node) => {
|
|
149
|
-
while (node && (node.tag ===
|
|
149
|
+
while (node && (node.tag === ACRYL_PORTAL_ELEMENT || !node.e)) node = node.tag === ACRYL_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0];
|
|
150
150
|
return node?.e;
|
|
151
151
|
};
|
|
152
152
|
const removeNode = (node) => {
|
|
@@ -192,7 +192,7 @@ const applyNodeObject = (node, container, isNew) => {
|
|
|
192
192
|
if (offsetByNextNode !== void 0) {
|
|
193
193
|
insertBeforeNode = childNodes[offsetByNextNode];
|
|
194
194
|
offset = offsetByNextNode;
|
|
195
|
-
} else offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !==
|
|
195
|
+
} else offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== ACRYL_PORTAL_ELEMENT && n.e)?.e) ?? -1;
|
|
196
196
|
if (offset === -1) isNew = true;
|
|
197
197
|
}
|
|
198
198
|
for (let i = 0, len = next.length; i < len; i++, offset++) {
|
|
@@ -214,7 +214,7 @@ const applyNodeObject = (node, container, isNew) => {
|
|
|
214
214
|
if (child.tag === "select") applySelectValue(el, child.props);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
if (child.tag ===
|
|
217
|
+
if (child.tag === ACRYL_PORTAL_ELEMENT) offset--;
|
|
218
218
|
else if (isNew) {
|
|
219
219
|
if (!el.parentNode) container.appendChild(el);
|
|
220
220
|
} else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) if (childNodes[offset + 1] === el) container.appendChild(childNodes[offset]);
|
|
@@ -497,7 +497,7 @@ const flushSync = (callback) => {
|
|
|
497
497
|
currentUpdateSets.pop();
|
|
498
498
|
};
|
|
499
499
|
const createPortal = (children, container, key) => ({
|
|
500
|
-
tag:
|
|
500
|
+
tag: ACRYL_PORTAL_ELEMENT,
|
|
501
501
|
props: { children },
|
|
502
502
|
key,
|
|
503
503
|
e: container,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ContentfulStatusCode, s as ServerErrorStatusCode, t as ClientErrorStatusCode } from "./http-status-DaAwGAFL.js";
|
|
2
2
|
import { D as UnionToIntersection } from "./types-Lqx5BxQF.js";
|
|
3
|
-
import { t as Acryl } from "./app-
|
|
4
|
-
import { a as ClientResponse, i as ClientRequestOptions, n as Client, s as FilterClientResponseByStatusCode } from "./types-
|
|
3
|
+
import { t as Acryl } from "./app-D8riatvv.js";
|
|
4
|
+
import { a as ClientResponse, i as ClientRequestOptions, n as Client, s as FilterClientResponseByStatusCode } from "./types-zNxyEpG2.js";
|
|
5
5
|
|
|
6
6
|
//#region ../../plugins/acryl-router/src/core/client/client.d.ts
|
|
7
7
|
declare const hc: <T extends Acryl<any, any, any>, Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection<Client<T, Prefix>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as MiddlewareHandler, Z as TypedResponse, t as Context } from "./context-DS3fYyG-.js";
|
|
2
2
|
import { c as StatusCode } from "./http-status-DaAwGAFL.js";
|
|
3
3
|
import { b as MessageEvent, r as CloseEvent, t as BinaryType } from "./types-Lqx5BxQF.js";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Acryl } from "./app-
|
|
1
|
+
import { Y as Schema, g as BlankSchema, j as Input, m as BlankEnv, s as AcrylRequest, v as Env } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { t as Acryl } from "./app-D8riatvv.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/deprecated.d.ts
|
|
5
5
|
/** @deprecated Use `Acryl` (`new Acryl()`); `App` is the 0.4 name and goes away in the next release. */
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Acryl } from "./app-
|
|
3
|
-
import { c as InferRequestType, i as ClientRequestOptions, l as InferResponseType } from "./types-
|
|
4
|
-
import { n as AppRequest, t as App } from "./index-
|
|
1
|
+
import { B as NotFoundHandler, L as MiddlewareHandler, O as Handler, Q as ValidationTargets, V as NotFoundResponse, X as ToSchema, Y as Schema, Z as TypedResponse, a as ExecutionContext, j as Input, n as ContextRenderer, r as ContextVariableMap, s as AcrylRequest, t as Context, v as Env, y as ErrorHandler, z as Next } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { t as Acryl } from "./app-D8riatvv.js";
|
|
3
|
+
import { c as InferRequestType, i as ClientRequestOptions, l as InferResponseType } from "./types-zNxyEpG2.js";
|
|
4
|
+
import { n as AppRequest, t as App } from "./index-CTy4N7ng.js";
|
|
5
5
|
export { Acryl, type AcrylRequest, App, type AppRequest, type ClientRequestOptions, Context, type ContextRenderer, type ContextVariableMap, type Env, type ErrorHandler, type ExecutionContext, type Handler, type InferRequestType, type InferResponseType, type Input, type MiddlewareHandler, type Next, type NotFoundHandler, type NotFoundResponse, type Schema, type ToSchema, type TypedResponse, type ValidationTargets };
|
package/lib/ip-restriction.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as GetConnInfo, t as AddressType } from "./types-
|
|
1
|
+
import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
|
|
2
|
+
import { r as GetConnInfo, t as AddressType } from "./types-Dv_nV2cv.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/middleware/ip-restriction/index.d.ts
|
|
5
5
|
/**
|
package/lib/jsx/dom/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as renderNode, S as buildNode, _ as useState } from "../../hooks-
|
|
1
|
+
import { D as renderNode, S as buildNode, _ as useState } from "../../hooks-BMw6BAyP.js";
|
|
2
2
|
//#region ../../plugins/acryl-router/src/core/jsx/dom/client.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a root object for rendering
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-
|
|
1
|
+
import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-D18Y35TI.js";
|
|
2
2
|
export { Fragment, jsxDEV };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-
|
|
1
|
+
import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-D18Y35TI.js";
|
|
2
2
|
export { Fragment, jsxDEV as jsx, jsxDEV as jsxs };
|
package/lib/jsx/dom/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as renderChildren } from "../../base-ddiVmiE7.js";
|
|
2
|
-
import { i as renderToReadableStream$1 } from "../../components-
|
|
2
|
+
import { i as renderToReadableStream$1 } from "../../components-0o0CBYNv.js";
|
|
3
3
|
import dom_default from "../dom.js";
|
|
4
4
|
//#region ../../plugins/acryl-router/src/core/jsx/dom/server.ts
|
|
5
5
|
const prepareRoot = (element) => typeof element === "string" || Array.isArray(element) ? renderChildren([element]) : element;
|
package/lib/jsx/dom.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as createContext, E as useContext, a as isValidElement, f as shallowEqual, g as Children, l as reactAPICompatVersion } from "../base-ddiVmiE7.js";
|
|
2
2
|
import { r as DOM_MEMO } from "../constants-BR9jM9BC.js";
|
|
3
|
-
import { C as createPortal, E as render, _ as useState, a as use, b as useViewTransition, c as useDeferredValue, d as useImperativeHandle, f as useInsertionEffect, g as useRef, h as useReducer, i as startViewTransition, l as useEffect, m as useMemo, n as forwardRef, o as useCallback, p as useLayoutEffect, r as startTransition, s as useDebugValue, t as createRef, u as useId, v as useSyncExternalStore, w as flushSync, y as useTransition } from "../hooks-
|
|
4
|
-
import { a as useOptimistic, i as useFormStatus, n as jsxDEV, r as useActionState, t as Fragment } from "../jsx-dev-runtime-
|
|
3
|
+
import { C as createPortal, E as render, _ as useState, a as use, b as useViewTransition, c as useDeferredValue, d as useImperativeHandle, f as useInsertionEffect, g as useRef, h as useReducer, i as startViewTransition, l as useEffect, m as useMemo, n as forwardRef, o as useCallback, p as useLayoutEffect, r as startTransition, s as useDebugValue, t as createRef, u as useId, v as useSyncExternalStore, w as flushSync, y as useTransition } from "../hooks-BMw6BAyP.js";
|
|
4
|
+
import { a as useOptimistic, i as useFormStatus, n as jsxDEV, r as useActionState, t as Fragment } from "../jsx-dev-runtime-D18Y35TI.js";
|
|
5
5
|
import "./dom/jsx-runtime.js";
|
|
6
|
-
import { n as Suspense, t as ErrorBoundary } from "../components-
|
|
6
|
+
import { n as Suspense, t as ErrorBoundary } from "../components-DdI7-ns7.js";
|
|
7
7
|
//#region ../../plugins/acryl-router/src/core/jsx/dom/index.ts
|
|
8
8
|
/**
|
|
9
9
|
* @module
|
package/lib/jsx/streaming.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as renderToReadableStream, n as StreamingContext, r as Suspense } from "../components-
|
|
1
|
+
import { i as renderToReadableStream, n as StreamingContext, r as Suspense } from "../components-0o0CBYNv.js";
|
|
2
2
|
export { StreamingContext, Suspense, renderToReadableStream };
|