void 0.1.6 β 0.7.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/AGENT_PROMPT.md +15 -0
- package/README.md +62 -123
- package/dist/auth-BdsJ0Aff.d.mts +43 -0
- package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
- package/dist/auth-migrations-BAtAck2g.mjs +117 -0
- package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
- package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
- package/dist/cache-W82I8ihI.mjs +47 -0
- package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
- package/dist/cf-access-Dee5cXxL.mjs +22 -0
- package/dist/chunk-DJd-R1mw.mjs +34 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +1807 -0
- package/dist/client-snXOjrp1.mjs +565 -0
- package/dist/collect-CjeZgz5D.mjs +55 -0
- package/dist/config-BIa9HwVX.mjs +573 -0
- package/dist/config-BzM9Dy7T.mjs +37 -0
- package/dist/config-CvHtTM0q.mjs +30 -0
- package/dist/create-project-BIA15W7z.mjs +90 -0
- package/dist/db-DsRoMcfN.mjs +895 -0
- package/dist/defer-DcxEsVH1.mjs +49 -0
- package/dist/delete-DAP6yDc7.mjs +64 -0
- package/dist/deploy-BPKblFx6.mjs +2424 -0
- package/dist/discover-B7FkXBLB.mjs +40 -0
- package/dist/dist-DUyXJLkq.mjs +2667 -0
- package/dist/dist-Dayj3gCK.mjs +1287 -0
- package/dist/domain-BGofcQ6I.mjs +79 -0
- package/dist/dotenv-DwO4ti0Z.mjs +173 -0
- package/dist/drizzle-NnudE_UN.mjs +232 -0
- package/dist/env-CyG3tvU0.mjs +301 -0
- package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
- package/dist/env-raw-BDL4TvdN.mjs +32 -0
- package/dist/env-types-DknSA4SO.mjs +64 -0
- package/dist/env-validation-DJKjR_8q.mjs +163 -0
- package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
- package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
- package/dist/gen-U0Ktr4Zd.mjs +761 -0
- package/dist/handler-B0ds0OHJ.d.mts +269 -0
- package/dist/head-P-egrtFE.d.mts +45 -0
- package/dist/headers-DCXc7mDs.mjs +279 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.mjs +4695 -0
- package/dist/init-C7wS5iGP.mjs +2625 -0
- package/dist/link-p2R6NbgN.mjs +49 -0
- package/dist/list-Bfel-QLc.mjs +113 -0
- package/dist/log-DXdqnmhF.mjs +26 -0
- package/dist/login-CkcXUiIu.mjs +72 -0
- package/dist/logs-DmkrRvx6.mjs +98 -0
- package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
- package/dist/mcp-CaQzfeUi.mjs +373 -0
- package/dist/node-DDfXj10V.mjs +54 -0
- package/dist/output-BwlcIYSR.mjs +139 -0
- package/dist/pages/client.d.mts +198 -0
- package/dist/pages/client.mjs +980 -0
- package/dist/pages/head-client.d.mts +15 -0
- package/dist/pages/head-client.mjs +90 -0
- package/dist/pages/head.d.mts +2 -0
- package/dist/pages/head.mjs +112 -0
- package/dist/pages/index.d.mts +38 -0
- package/dist/pages/index.mjs +76 -0
- package/dist/pages/islands-plugin.d.mts +50 -0
- package/dist/pages/islands-plugin.mjs +195 -0
- package/dist/pages/prefetch.d.mts +31 -0
- package/dist/pages/prefetch.mjs +90 -0
- package/dist/pages/protocol.d.mts +3 -0
- package/dist/pages/protocol.mjs +193 -0
- package/dist/pages/serialize.d.mts +10 -0
- package/dist/pages/serialize.mjs +14 -0
- package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
- package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
- package/dist/prepare-BAtWufvm.mjs +99 -0
- package/dist/preset-D4I73kT4.mjs +221 -0
- package/dist/project-TqORyHn8.mjs +72 -0
- package/dist/project-cmd-B7lQp3F3.mjs +67 -0
- package/dist/project-slug-CKam8lF9.mjs +11 -0
- package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
- package/dist/protocol-BWzXs2A2.d.mts +34 -0
- package/dist/providers-B3aMxWzP.mjs +67 -0
- package/dist/resolve-project-Br5BR03U.mjs +29 -0
- package/dist/rollback-gyC59l7U.mjs +92 -0
- package/dist/route-types-DReF1gUY.mjs +255 -0
- package/dist/routes-stub.d.mts +55 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/runner-6Ep3fNQu.mjs +123 -0
- package/dist/runner-pg-D0wWHYnr.mjs +57 -0
- package/dist/runtime/ai.d.mts +127 -0
- package/dist/runtime/ai.mjs +348 -0
- package/dist/runtime/auth-client-react.d.mts +8 -0
- package/dist/runtime/auth-client-react.mjs +6 -0
- package/dist/runtime/auth-client-solid.d.mts +8 -0
- package/dist/runtime/auth-client-solid.mjs +6 -0
- package/dist/runtime/auth-client-svelte.d.mts +8 -0
- package/dist/runtime/auth-client-svelte.mjs +6 -0
- package/dist/runtime/auth-client-vue.d.mts +8 -0
- package/dist/runtime/auth-client-vue.mjs +6 -0
- package/dist/runtime/auth-client.d.mts +8 -0
- package/dist/runtime/auth-client.mjs +6 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +22 -0
- package/dist/runtime/better-auth-pg.d.mts +11 -0
- package/dist/runtime/better-auth-pg.mjs +51 -0
- package/dist/runtime/better-auth.d.mts +11 -0
- package/dist/runtime/better-auth.mjs +33 -0
- package/dist/runtime/client.d.mts +6 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +30 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/env-helpers.d.mts +2 -0
- package/dist/runtime/env-helpers.mjs +173 -0
- package/dist/runtime/env-public-client.d.mts +22 -0
- package/dist/runtime/env-public-client.mjs +54 -0
- package/dist/runtime/env-public.d.mts +143 -0
- package/dist/runtime/env-public.mjs +366 -0
- package/dist/runtime/env.d.mts +13 -0
- package/dist/runtime/env.mjs +51 -0
- package/dist/runtime/fetch-stream.d.mts +51 -0
- package/dist/runtime/fetch-stream.mjs +81 -0
- package/dist/runtime/fetch.d.mts +59 -0
- package/dist/runtime/fetch.mjs +18 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +85 -0
- package/dist/runtime/isr.d.mts +26 -0
- package/dist/runtime/isr.mjs +43 -0
- package/dist/runtime/kv.d.mts +48 -0
- package/dist/runtime/kv.mjs +106 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +31 -0
- package/dist/runtime/migration-handler-pg.d.mts +6 -0
- package/dist/runtime/migration-handler-pg.mjs +85 -0
- package/dist/runtime/migration-handler.d.mts +19 -0
- package/dist/runtime/migration-handler.mjs +92 -0
- package/dist/runtime/queues.d.mts +7 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +15 -0
- package/dist/runtime/remote/binding-handler.mjs +208 -0
- package/dist/runtime/remote/index.d.mts +8 -0
- package/dist/runtime/remote/index.mjs +461 -0
- package/dist/runtime/response.d.mts +14 -0
- package/dist/runtime/response.mjs +30 -0
- package/dist/runtime/sandbox.d.mts +17 -0
- package/dist/runtime/sandbox.mjs +19 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +30 -0
- package/dist/runtime/seed.mjs +6 -0
- package/dist/runtime/storage.d.mts +7 -0
- package/dist/runtime/storage.mjs +14 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +72 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +296 -0
- package/dist/runtime/ws.d.mts +123 -0
- package/dist/runtime/ws.mjs +103 -0
- package/dist/scan-Ba4hFwlH.mjs +324 -0
- package/dist/scan-C6HMEIdW.mjs +318 -0
- package/dist/secret-CeRSukgM.mjs +109 -0
- package/dist/skills-ipldjlKE.mjs +62 -0
- package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
- package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
- package/dist/sveltekit.d.mts +20 -0
- package/dist/sveltekit.mjs +61 -0
- package/dist/types-mHOEwpW4.d.mts +57 -0
- package/dist/validate-CaMavMxu.mjs +146 -0
- package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
- package/getting-started-prompt.txt +26 -0
- package/package.json +322 -30
- package/schema.json +364 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/SKILL.md +75 -0
- package/skills/void/command/void.md +7 -0
- package/skills/void/docs/guide/ai.md +235 -0
- package/skills/void/docs/guide/app-types.md +103 -0
- package/skills/void/docs/guide/auth.md +257 -0
- package/skills/void/docs/guide/database/d1.md +106 -0
- package/skills/void/docs/guide/database/postgresql.md +106 -0
- package/skills/void/docs/guide/database.md +418 -0
- package/skills/void/docs/guide/deployment.md +98 -0
- package/skills/void/docs/guide/edge/headers.md +79 -0
- package/skills/void/docs/guide/edge/prerendering.md +83 -0
- package/skills/void/docs/guide/edge/redirects.md +116 -0
- package/skills/void/docs/guide/edge/revalidation.md +131 -0
- package/skills/void/docs/guide/edge/rewrites.md +354 -0
- package/skills/void/docs/guide/edge/static-assets.md +72 -0
- package/skills/void/docs/guide/env-vars.md +298 -0
- package/skills/void/docs/guide/index.md +80 -0
- package/skills/void/docs/guide/jobs.md +91 -0
- package/skills/void/docs/guide/kv.md +107 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
- package/skills/void/docs/guide/pages-routing/head.md +130 -0
- package/skills/void/docs/guide/pages-routing/islands.md +405 -0
- package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
- package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
- package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
- package/skills/void/docs/guide/pages-routing/overview.md +236 -0
- package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
- package/skills/void/docs/guide/queues.md +140 -0
- package/skills/void/docs/guide/quickstart.md +233 -0
- package/skills/void/docs/guide/remote-dev.md +67 -0
- package/skills/void/docs/guide/sandboxes.md +82 -0
- package/skills/void/docs/guide/server-routing.md +246 -0
- package/skills/void/docs/guide/ssg.md +74 -0
- package/skills/void/docs/guide/ssr.md +105 -0
- package/skills/void/docs/guide/storage.md +67 -0
- package/skills/void/docs/guide/type-safety.md +179 -0
- package/skills/void/docs/guide/typed-fetch.md +113 -0
- package/skills/void/docs/guide/websockets.md +190 -0
- package/skills/void/docs/index.md +48 -0
- package/skills/void/docs/integrations/agents.md +84 -0
- package/skills/void/docs/integrations/cloudflare.md +284 -0
- package/skills/void/docs/integrations/frameworks/analog.md +182 -0
- package/skills/void/docs/integrations/frameworks/astro.md +197 -0
- package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
- package/skills/void/docs/integrations/frameworks/overview.md +136 -0
- package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
- package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
- package/skills/void/docs/integrations/hono.md +97 -0
- package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
- package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
- package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
- package/skills/void/docs/node_modules/vitepress/README.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
- package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
- package/skills/void/docs/node_modules/void/README.md +89 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/{LICENSE β skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
- package/skills/void/docs/reference/api.md +917 -0
- package/skills/void/docs/reference/cli.md +561 -0
- package/skills/void/docs/reference/config.md +408 -0
- package/skills/void/docs/reference/resource-inference.md +149 -0
- package/skills/void/docs/reference/structure.md +176 -0
- package/.npmignore +0 -29
- package/.travis.yml +0 -9
- package/favicon.ico +0 -0
- package/index.js +0 -14
- package/lib/Job.js +0 -150
- package/lib/Void.js +0 -99
- package/lib/scan.js +0 -19
- package/test/credentials.js +0 -20
- package/test/job.js +0 -64
- package/test/static/dir1/test6.html +0 -0
- package/test/static/dir2/test7.html +0 -0
- package/test/static/dir2/test8.html +0 -0
- package/test/static/dir2/test9.html +0 -0
- package/test/static/test1.html +0 -0
- package/test/static/test2.html +0 -0
- package/test/static/test3.html +0 -0
- package/test/void.js +0 -31
- /package/{test/static/dir1/test4.html β skills/void/docs/integrations/auth-providers.md} +0 -0
- /package/{test/static/dir1/test5.html β skills/void/docs/integrations/payment-processors.md} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./misc/readme/logo-github-sq-dark.svg#gh-dark-mode-only" />
|
|
3
|
+
<img src="./misc/readme/logo-github-sq-light.svg#gh-light-mode-only" />
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<br/>
|
|
7
|
+
<div align="center">
|
|
8
|
+
<h3>Headless ORM for NodeJS, TypeScript and JavaScript π</h3>
|
|
9
|
+
<a href="https://orm.drizzle.team">Website</a> β’
|
|
10
|
+
<a href="https://orm.drizzle.team/docs/overview">Documentation</a> β’
|
|
11
|
+
<a href="https://x.com/drizzleorm">Twitter</a> β’
|
|
12
|
+
<a href="https://driz.link/discord">Discord</a>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<br/>
|
|
16
|
+
<br/>
|
|
17
|
+
|
|
18
|
+
### What's Drizzle?
|
|
19
|
+
Drizzle is a modern TypeScript ORM developers [wanna use in their next project](https://stateofdb.com/tools/drizzle).
|
|
20
|
+
It is [lightweight](https://bundlephobia.com/package/drizzle-orm) at only ~7.4kb minified+gzipped, and it's tree shakeable with exactly 0 dependencies.
|
|
21
|
+
|
|
22
|
+
**Drizzle supports every PostgreSQL, MySQL and SQLite database**, including serverless ones like [Turso](https://orm.drizzle.team/docs/get-started-sqlite#turso), [Neon](https://orm.drizzle.team/docs/get-started-postgresql#neon), [Xata](https://orm.drizzle.team/docs/connect-xata), [PlanetScale](https://orm.drizzle.team/docs/get-started-mysql#planetscale), [Cloudflare D1](https://orm.drizzle.team/docs/get-started-sqlite#cloudflare-d1), [FlyIO LiteFS](https://fly.io/docs/litefs/), [Vercel Postgres](https://orm.drizzle.team/docs/get-started-postgresql#vercel-postgres), [Supabase](https://orm.drizzle.team/docs/get-started-postgresql#supabase) and [AWS Data API](https://orm.drizzle.team/docs/get-started-postgresql#aws-data-api). No bells and whistles, no Rust binaries, no serverless adapters, everything just works out of the box.
|
|
23
|
+
|
|
24
|
+
**Drizzle is serverless-ready by design**. It works in every major JavaScript runtime like NodeJS, Bun, Deno, Cloudflare Workers, Supabase functions, any Edge runtime, and even in browsers.
|
|
25
|
+
With Drizzle you can be [**fast out of the box**](https://orm.drizzle.team/benchmarks) and save time and costs while never introducing any data proxies into your infrastructure.
|
|
26
|
+
|
|
27
|
+
While you can use Drizzle as a JavaScript library, it shines with TypeScript. It lets you [**declare SQL schemas**](https://orm.drizzle.team/docs/sql-schema-declaration) and build both [**relational**](https://orm.drizzle.team/docs/rqb) and [**SQL-like queries**](https://orm.drizzle.team/docs/select), while keeping the balance between type-safety and extensibility for toolmakers to build on top.
|
|
28
|
+
|
|
29
|
+
### Ecosystem
|
|
30
|
+
While Drizzle ORM remains a thin typed layer on top of SQL, we made a set of tools for people to have best possible developer experience.
|
|
31
|
+
|
|
32
|
+
Drizzle comes with a powerful [**Drizzle Kit**](https://orm.drizzle.team/kit-docs/overview) CLI companion for you to have hassle-free migrations. It can generate SQL migration files for you or apply schema changes directly to the database.
|
|
33
|
+
|
|
34
|
+
We also have [**Drizzle Studio**](https://orm.drizzle.team/drizzle-studio/overview) for you to effortlessly browse and manipulate data in your database of choice.
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
Check out the full documentation on [the website](https://orm.drizzle.team/docs/overview).
|
|
38
|
+
|
|
39
|
+
### Our sponsors β€οΈ
|
|
40
|
+
<p align="center">
|
|
41
|
+
<a href="https://drizzle.team" target="_blank">
|
|
42
|
+
<img src='https://api.drizzle.team/v2/sponsors/svg'/>
|
|
43
|
+
</a>
|
|
44
|
+
</p>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
`drizzle-valibot` is a plugin for [Drizzle ORM](https://github.com/drizzle-team/drizzle-orm) that allows you to generate [valibot](https://valibot.dev/) schemas from Drizzle ORM schemas.
|
|
2
|
+
|
|
3
|
+
**Features**
|
|
4
|
+
|
|
5
|
+
- Create a select schema for tables, views and enums.
|
|
6
|
+
- Create insert and update schemas for tables.
|
|
7
|
+
- Supports all dialects: PostgreSQL, MySQL and SQLite.
|
|
8
|
+
|
|
9
|
+
# Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { pgEnum, pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';
|
|
13
|
+
import { createInsertSchema, createSelectSchema } from 'drizzle-valibot';
|
|
14
|
+
import { string, parse, number, pipe } from 'valibot';
|
|
15
|
+
|
|
16
|
+
const users = pgTable('users', {
|
|
17
|
+
id: serial('id').primaryKey(),
|
|
18
|
+
name: text('name').notNull(),
|
|
19
|
+
email: text('email').notNull(),
|
|
20
|
+
role: text('role', { enum: ['admin', 'user'] }).notNull(),
|
|
21
|
+
createdAt: timestamp('created_at').notNull().defaultNow(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Schema for inserting a user - can be used to validate API requests
|
|
25
|
+
const insertUserSchema = createInsertSchema(users);
|
|
26
|
+
|
|
27
|
+
// Schema for updating a user - can be used to validate API requests
|
|
28
|
+
const updateUserSchema = createUpdateSchema(users);
|
|
29
|
+
|
|
30
|
+
// Schema for selecting a user - can be used to validate API responses
|
|
31
|
+
const selectUserSchema = createSelectSchema(users);
|
|
32
|
+
|
|
33
|
+
// Overriding the fields
|
|
34
|
+
const insertUserSchema = createInsertSchema(users, {
|
|
35
|
+
role: string(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Refining the fields - useful if you want to change the fields before they become nullable/optional in the final schema
|
|
39
|
+
const insertUserSchema = createInsertSchema(users, {
|
|
40
|
+
id: (schema) => pipe([schema, minValue(0)]),
|
|
41
|
+
role: string(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Usage
|
|
45
|
+
|
|
46
|
+
const isUserValid = parse(insertUserSchema, {
|
|
47
|
+
name: 'John Doe',
|
|
48
|
+
email: 'johndoe@test.com',
|
|
49
|
+
role: 'admin',
|
|
50
|
+
});
|
|
51
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<div align='center'>
|
|
2
|
+
<h1>drizzle-zod <a href=''><img alt='npm' src='https://img.shields.io/npm/v/drizzle-zod?label='></a></h1>
|
|
3
|
+
<img alt='npm' src='https://img.shields.io/npm/dm/drizzle-zod'>
|
|
4
|
+
<img alt='npm bundle size' src='https://img.shields.io/bundlephobia/min/drizzle-zod'>
|
|
5
|
+
<a href='https://discord.gg/yfjTbVXMW4'><img alt='Discord' src='https://img.shields.io/discord/1043890932593987624'></a>
|
|
6
|
+
<img alt='License' src='https://img.shields.io/npm/l/drizzle-zod'>
|
|
7
|
+
<h6><i>If you know SQL, you know Drizzle ORM</i></h6>
|
|
8
|
+
<hr />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
`drizzle-zod` is a plugin for [Drizzle ORM](https://github.com/drizzle-team/drizzle-orm) that allows you to generate [Zod](https://zod.dev/) schemas from Drizzle ORM schemas.
|
|
12
|
+
|
|
13
|
+
**Features**
|
|
14
|
+
|
|
15
|
+
- Create a select schema for tables, views and enums.
|
|
16
|
+
- Create insert and update schemas for tables.
|
|
17
|
+
- Supports all dialects: PostgreSQL, MySQL and SQLite.
|
|
18
|
+
|
|
19
|
+
# Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { pgEnum, pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';
|
|
23
|
+
import { createInsertSchema, createSelectSchema } from 'drizzle-zod';
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
|
|
26
|
+
const users = pgTable('users', {
|
|
27
|
+
id: serial('id').primaryKey(),
|
|
28
|
+
name: text('name').notNull(),
|
|
29
|
+
email: text('email').notNull(),
|
|
30
|
+
role: text('role', { enum: ['admin', 'user'] }).notNull(),
|
|
31
|
+
createdAt: timestamp('created_at').notNull().defaultNow(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Schema for inserting a user - can be used to validate API requests
|
|
35
|
+
const insertUserSchema = createInsertSchema(users);
|
|
36
|
+
|
|
37
|
+
// Schema for updating a user - can be used to validate API requests
|
|
38
|
+
const updateUserSchema = createUpdateSchema(users);
|
|
39
|
+
|
|
40
|
+
// Schema for selecting a user - can be used to validate API responses
|
|
41
|
+
const selectUserSchema = createSelectSchema(users);
|
|
42
|
+
|
|
43
|
+
// Overriding the fields
|
|
44
|
+
const insertUserSchema = createInsertSchema(users, {
|
|
45
|
+
role: z.string(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Refining the fields - useful if you want to change the fields before they become nullable/optional in the final schema
|
|
49
|
+
const insertUserSchema = createInsertSchema(users, {
|
|
50
|
+
id: (schema) => schema.positive(),
|
|
51
|
+
email: (schema) => schema.email(),
|
|
52
|
+
role: z.string(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Usage
|
|
56
|
+
|
|
57
|
+
const user = insertUserSchema.parse({
|
|
58
|
+
name: 'John Doe',
|
|
59
|
+
email: 'johndoe@test.com',
|
|
60
|
+
role: 'admin',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Zod schema type is also inferred from the table schema, so you have full type safety
|
|
64
|
+
const requestSchema = insertUserSchema.pick({ name: true, email: true });
|
|
65
|
+
```
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
# ES Module Lexer
|
|
2
|
+
|
|
3
|
+
[![Build Status][actions-image]][actions-url]
|
|
4
|
+
|
|
5
|
+
A JS module syntax lexer used in [es-module-shims](https://github.com/guybedford/es-module-shims).
|
|
6
|
+
|
|
7
|
+
Outputs the list of exports and locations of import specifiers, including dynamic import and import meta handling.
|
|
8
|
+
|
|
9
|
+
Supports new syntax features including import attributes and source phase imports.
|
|
10
|
+
|
|
11
|
+
A very small single JS file (4KiB gzipped) that includes inlined Web Assembly for very fast source analysis of ECMAScript module syntax only.
|
|
12
|
+
|
|
13
|
+
For an example of the performance, Angular 1 (720KiB) is fully parsed in 5ms, in comparison to the fastest JS parser, Acorn which takes over 100ms.
|
|
14
|
+
|
|
15
|
+
_Comprehensively handles the JS language grammar while remaining small and fast. - ~10ms per MB of JS cold and ~5ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._
|
|
16
|
+
|
|
17
|
+
> [Built with](https://github.com/guybedford/es-module-lexer/blob/main/chompfile.toml) [Chomp](https://chompbuild.com/)
|
|
18
|
+
|
|
19
|
+
### Usage
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install es-module-lexer
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
See [src/lexer.ts](src/lexer.ts) for the type definitions.
|
|
26
|
+
|
|
27
|
+
For use in CommonJS:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
const { init, parse } = require('es-module-lexer');
|
|
31
|
+
|
|
32
|
+
(async () => {
|
|
33
|
+
// either await init, or call parse asynchronously
|
|
34
|
+
// this is necessary for the Web Assembly boot
|
|
35
|
+
await init;
|
|
36
|
+
|
|
37
|
+
const source = 'export var p = 5';
|
|
38
|
+
const [imports, exports] = parse(source);
|
|
39
|
+
|
|
40
|
+
// Returns "p"
|
|
41
|
+
source.slice(exports[0].s, exports[0].e);
|
|
42
|
+
// Returns "p"
|
|
43
|
+
source.slice(exports[0].ls, exports[0].le);
|
|
44
|
+
})();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
An ES module version is also available:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { init, parse } from 'es-module-lexer';
|
|
51
|
+
|
|
52
|
+
(async () => {
|
|
53
|
+
await init;
|
|
54
|
+
|
|
55
|
+
const source = `
|
|
56
|
+
import { name } from 'mod\\u1011';
|
|
57
|
+
import json from './json.json' with { type: 'json' }
|
|
58
|
+
export var p = 5;
|
|
59
|
+
export function q () {
|
|
60
|
+
|
|
61
|
+
};
|
|
62
|
+
export { x as 'external name' } from 'external';
|
|
63
|
+
|
|
64
|
+
// Comments provided to demonstrate edge cases
|
|
65
|
+
import /*comment!*/ ( 'asdf', { with: { type: 'json' }});
|
|
66
|
+
import /*comment!*/.meta.asdf;
|
|
67
|
+
|
|
68
|
+
// Source phase imports:
|
|
69
|
+
import source mod from './mod.wasm';
|
|
70
|
+
import.source('./mod.wasm');
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
const [imports, exports] = parse(source, 'optional-sourcename');
|
|
74
|
+
|
|
75
|
+
// Returns "modα"
|
|
76
|
+
imports[0].n
|
|
77
|
+
// Returns "mod\u1011"
|
|
78
|
+
source.slice(imports[0].s, imports[0].e);
|
|
79
|
+
// "s" = start
|
|
80
|
+
// "e" = end
|
|
81
|
+
|
|
82
|
+
// Returns "import { name } from 'mod'"
|
|
83
|
+
source.slice(imports[0].ss, imports[0].se);
|
|
84
|
+
// "ss" = statement start
|
|
85
|
+
// "se" = statement end
|
|
86
|
+
|
|
87
|
+
// Returns "{ type: 'json' }"
|
|
88
|
+
source.slice(imports[1].a, imports[1].se);
|
|
89
|
+
// "a" = attribute start, -1 for no import attributes
|
|
90
|
+
|
|
91
|
+
// Parsed import attributes are available in `at`
|
|
92
|
+
// Returns [['type', 'json']]
|
|
93
|
+
imports[1].at;
|
|
94
|
+
// Returns 'json'
|
|
95
|
+
imports[1].at[0][1];
|
|
96
|
+
|
|
97
|
+
// Returns null (no attributes)
|
|
98
|
+
imports[0].at;
|
|
99
|
+
|
|
100
|
+
// Returns "external"
|
|
101
|
+
source.slice(imports[2].s, imports[2].e);
|
|
102
|
+
|
|
103
|
+
// Returns "p"
|
|
104
|
+
source.slice(exports[0].s, exports[0].e);
|
|
105
|
+
// Returns "p"
|
|
106
|
+
source.slice(exports[0].ls, exports[0].le);
|
|
107
|
+
// Returns "q"
|
|
108
|
+
source.slice(exports[1].s, exports[1].e);
|
|
109
|
+
// Returns "q"
|
|
110
|
+
source.slice(exports[1].ls, exports[1].le);
|
|
111
|
+
// Returns "'external name'"
|
|
112
|
+
source.slice(exports[2].s, exports[2].e);
|
|
113
|
+
// Returns -1
|
|
114
|
+
exports[2].ls;
|
|
115
|
+
// Returns -1
|
|
116
|
+
exports[2].le;
|
|
117
|
+
|
|
118
|
+
// Import type is provided by `t` value
|
|
119
|
+
// (1 for static, 2, for dynamic)
|
|
120
|
+
// Returns true
|
|
121
|
+
imports[2].t == 2;
|
|
122
|
+
|
|
123
|
+
// Returns "asdf" (only for string literal dynamic imports)
|
|
124
|
+
imports[2].n
|
|
125
|
+
// Returns "import /*comment!*/ ( 'asdf', { with: { type: 'json' } })"
|
|
126
|
+
source.slice(imports[3].ss, imports[3].se);
|
|
127
|
+
// Returns "'asdf'"
|
|
128
|
+
source.slice(imports[3].s, imports[3].e);
|
|
129
|
+
// Returns "( 'asdf', { with: { type: 'json' } })"
|
|
130
|
+
source.slice(imports[3].d, imports[3].se);
|
|
131
|
+
// Returns "{ with: { type: 'json' } }"
|
|
132
|
+
source.slice(imports[3].a, imports[3].se - 1);
|
|
133
|
+
|
|
134
|
+
// For non-string dynamic import expressions:
|
|
135
|
+
// - n will be undefined
|
|
136
|
+
// - a is currently -1 even if there is an import attribute
|
|
137
|
+
// - e is currently the character before the closing )
|
|
138
|
+
|
|
139
|
+
// For nested dynamic imports, the se value of the outer import is -1 as end tracking does not
|
|
140
|
+
// currently support nested dynamic immports
|
|
141
|
+
|
|
142
|
+
// import.meta is indicated by imports[3].d === -2
|
|
143
|
+
// Returns true
|
|
144
|
+
imports[4].d === -2;
|
|
145
|
+
// Returns "import /*comment!*/.meta"
|
|
146
|
+
source.slice(imports[4].s, imports[4].e);
|
|
147
|
+
// ss and se are the same for import meta
|
|
148
|
+
|
|
149
|
+
// Returns "'./mod.wasm'"
|
|
150
|
+
source.slice(imports[5].s, imports[5].e);
|
|
151
|
+
|
|
152
|
+
// Import type 4 and 5 for static and dynamic source phase
|
|
153
|
+
imports[5].t === 4;
|
|
154
|
+
imports[6].t === 5;
|
|
155
|
+
})();
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### CSP asm.js Build
|
|
159
|
+
|
|
160
|
+
The default version of the library uses Wasm and (safe) eval usage for performance and a minimal footprint.
|
|
161
|
+
|
|
162
|
+
Neither of these represent security escalation possibilities since there are no execution string injection vectors, but that can still violate existing CSP policies for applications.
|
|
163
|
+
|
|
164
|
+
For a version that works with CSP eval disabled, use the `es-module-lexer/js` build:
|
|
165
|
+
|
|
166
|
+
```js
|
|
167
|
+
import { parse } from 'es-module-lexer/js';
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Instead of Web Assembly, this uses an asm.js build which is almost as fast as the Wasm version ([see benchmarks below](#benchmarks)).
|
|
171
|
+
|
|
172
|
+
### Import Attributes
|
|
173
|
+
|
|
174
|
+
The `a` field provides the index of the start of the `{` attributes bracket, or -1 for no attributes.
|
|
175
|
+
|
|
176
|
+
The list of attribute key and value pairs are provided on the `at` field:
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
const [imports] = parse(`
|
|
180
|
+
import json from './foo.json' with { type: 'json' };
|
|
181
|
+
import './foo.css' with { type: 'css' };
|
|
182
|
+
import pkg from 'pkg' with { type: 'json', integrity: 'sha384-...' };
|
|
183
|
+
`);
|
|
184
|
+
|
|
185
|
+
// Returns [['type', 'json']]
|
|
186
|
+
imports[0].at;
|
|
187
|
+
|
|
188
|
+
// Returns [['type', 'css']]
|
|
189
|
+
imports[1].at;
|
|
190
|
+
|
|
191
|
+
// Multiple attributes
|
|
192
|
+
// Returns [['type', 'json'], ['integrity', 'sha384-...']]
|
|
193
|
+
imports[2].at;
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The `at` field is an array of `[key, value]` tuples, or `null` if there are no attributes.
|
|
197
|
+
|
|
198
|
+
Both keys and values support escape sequences:
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
const [imports] = parse(`
|
|
202
|
+
import foo from './foo.js' with { "custom-key": "value" };
|
|
203
|
+
import bar from './bar.js' with { "key\\nwith\\nnewlines": "value\\twith\\ttabs" };
|
|
204
|
+
`);
|
|
205
|
+
|
|
206
|
+
// Quoted keys are unquoted
|
|
207
|
+
// Returns [['custom-key', 'value']]
|
|
208
|
+
imports[0].at;
|
|
209
|
+
|
|
210
|
+
// Escape sequences are processed
|
|
211
|
+
// Returns [['key\nwith\nnewlines', 'value\twith\ttabs']]
|
|
212
|
+
imports[1].at;
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Escape Sequences
|
|
216
|
+
|
|
217
|
+
To handle escape sequences in specifier strings, the `.n` field of imported specifiers will be provided where possible.
|
|
218
|
+
|
|
219
|
+
For dynamic import expressions, this field will be empty if not a valid JS string.
|
|
220
|
+
|
|
221
|
+
### Facade Detection
|
|
222
|
+
|
|
223
|
+
Facade modules that only use import / export syntax can be detected via the third return value:
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
const [,, facade] = parse(`
|
|
227
|
+
export * from 'external';
|
|
228
|
+
import * as ns from 'external2';
|
|
229
|
+
export { a as b } from 'external3';
|
|
230
|
+
export { ns };
|
|
231
|
+
`);
|
|
232
|
+
facade === true;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### ESM Detection
|
|
236
|
+
|
|
237
|
+
Modules that uses ESM syntaxes can be detected via the fourth return value:
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
const [,,, hasModuleSyntax] = parse(`
|
|
241
|
+
export {}
|
|
242
|
+
`);
|
|
243
|
+
hasModuleSyntax === true;
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Dynamic imports are ignored since they can be used in Non-ESM files.
|
|
247
|
+
|
|
248
|
+
```js
|
|
249
|
+
const [,,, hasModuleSyntax] = parse(`
|
|
250
|
+
import('./foo.js')
|
|
251
|
+
`);
|
|
252
|
+
hasModuleSyntax === false;
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Environment Support
|
|
256
|
+
|
|
257
|
+
Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm).
|
|
258
|
+
|
|
259
|
+
### Grammar Support
|
|
260
|
+
|
|
261
|
+
* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators.
|
|
262
|
+
* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking.
|
|
263
|
+
* Always correctly parses valid JS source, but may parse invalid JS source without errors.
|
|
264
|
+
|
|
265
|
+
### Limitations
|
|
266
|
+
|
|
267
|
+
The lexing approach is designed to deal with the full language grammar including RegEx / division operator ambiguity through backtracking and paren / brace tracking.
|
|
268
|
+
|
|
269
|
+
The only limitation to the reduced parser is that the "exports" list may not correctly gather all export identifiers in the following edge cases:
|
|
270
|
+
|
|
271
|
+
```js
|
|
272
|
+
// Only "a" is detected as an export, "q" isn't
|
|
273
|
+
export var a = 'asdf', q = z;
|
|
274
|
+
|
|
275
|
+
// "b" is not detected as an export
|
|
276
|
+
export var { a: b } = asdf;
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The above cases are handled gracefully in that the lexer will keep going fine, it will just not properly detect the export names above.
|
|
280
|
+
|
|
281
|
+
### Benchmarks
|
|
282
|
+
|
|
283
|
+
Benchmarks can be run with `npm run bench`.
|
|
284
|
+
|
|
285
|
+
Current results for a high spec machine:
|
|
286
|
+
|
|
287
|
+
#### Wasm Build
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
Module load time
|
|
291
|
+
> 5ms
|
|
292
|
+
Cold Run, All Samples
|
|
293
|
+
test/samples/*.js (3123 KiB)
|
|
294
|
+
> 18ms
|
|
295
|
+
|
|
296
|
+
Warm Runs (average of 25 runs)
|
|
297
|
+
test/samples/angular.js (739 KiB)
|
|
298
|
+
> 3ms
|
|
299
|
+
test/samples/angular.min.js (188 KiB)
|
|
300
|
+
> 1ms
|
|
301
|
+
test/samples/d3.js (508 KiB)
|
|
302
|
+
> 3ms
|
|
303
|
+
test/samples/d3.min.js (274 KiB)
|
|
304
|
+
> 2ms
|
|
305
|
+
test/samples/magic-string.js (35 KiB)
|
|
306
|
+
> 0ms
|
|
307
|
+
test/samples/magic-string.min.js (20 KiB)
|
|
308
|
+
> 0ms
|
|
309
|
+
test/samples/rollup.js (929 KiB)
|
|
310
|
+
> 4.32ms
|
|
311
|
+
test/samples/rollup.min.js (429 KiB)
|
|
312
|
+
> 2.16ms
|
|
313
|
+
|
|
314
|
+
Warm Runs, All Samples (average of 25 runs)
|
|
315
|
+
test/samples/*.js (3123 KiB)
|
|
316
|
+
> 14.16ms
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
#### JS Build (asm.js)
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
Module load time
|
|
323
|
+
> 2ms
|
|
324
|
+
Cold Run, All Samples
|
|
325
|
+
test/samples/*.js (3123 KiB)
|
|
326
|
+
> 34ms
|
|
327
|
+
|
|
328
|
+
Warm Runs (average of 25 runs)
|
|
329
|
+
test/samples/angular.js (739 KiB)
|
|
330
|
+
> 3ms
|
|
331
|
+
test/samples/angular.min.js (188 KiB)
|
|
332
|
+
> 1ms
|
|
333
|
+
test/samples/d3.js (508 KiB)
|
|
334
|
+
> 3ms
|
|
335
|
+
test/samples/d3.min.js (274 KiB)
|
|
336
|
+
> 2ms
|
|
337
|
+
test/samples/magic-string.js (35 KiB)
|
|
338
|
+
> 0ms
|
|
339
|
+
test/samples/magic-string.min.js (20 KiB)
|
|
340
|
+
> 0ms
|
|
341
|
+
test/samples/rollup.js (929 KiB)
|
|
342
|
+
> 5ms
|
|
343
|
+
test/samples/rollup.min.js (429 KiB)
|
|
344
|
+
> 3.04ms
|
|
345
|
+
|
|
346
|
+
Warm Runs, All Samples (average of 25 runs)
|
|
347
|
+
test/samples/*.js (3123 KiB)
|
|
348
|
+
> 17.12ms
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Building
|
|
352
|
+
|
|
353
|
+
This project uses [Chomp](https://chompbuild.com) for building.
|
|
354
|
+
|
|
355
|
+
With Chomp installed, download the WASI SDK 12.0 from https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-12.
|
|
356
|
+
|
|
357
|
+
- [Linux](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz)
|
|
358
|
+
- [Windows (MinGW)](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-mingw.tar.gz)
|
|
359
|
+
- [macOS](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz)
|
|
360
|
+
|
|
361
|
+
Locate the WASI-SDK as a sibling folder, or customize the path via the `WASI_PATH` environment variable.
|
|
362
|
+
|
|
363
|
+
Emscripten emsdk is also assumed to be a sibling folder or via the `EMSDK_PATH` environment variable.
|
|
364
|
+
|
|
365
|
+
Example setup:
|
|
366
|
+
|
|
367
|
+
```
|
|
368
|
+
git clone https://github.com:guybedford/es-module-lexer
|
|
369
|
+
git clone https://github.com/emscripten-core/emsdk
|
|
370
|
+
cd emsdk
|
|
371
|
+
git checkout 1.40.1-fastcomp
|
|
372
|
+
./emsdk install 1.40.1-fastcomp
|
|
373
|
+
cd ..
|
|
374
|
+
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
|
|
375
|
+
gunzip wasi-sdk-12.0-linux.tar.gz
|
|
376
|
+
tar -xf wasi-sdk-12.0-linux.tar
|
|
377
|
+
mv wasi-sdk-12.0-linux.tar wasi-sdk-12.0
|
|
378
|
+
cargo install chompbuild
|
|
379
|
+
cd es-module-lexer
|
|
380
|
+
chomp test
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
For the `asm.js` build, git clone `emsdk` from is assumed to be a sibling folder as well.
|
|
384
|
+
|
|
385
|
+
### License
|
|
386
|
+
|
|
387
|
+
MIT
|
|
388
|
+
|
|
389
|
+
[actions-image]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml/badge.svg
|
|
390
|
+
[actions-url]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# estree-walker
|
|
2
|
+
|
|
3
|
+
Simple utility for walking an [ESTree](https://github.com/estree/estree)-compliant AST, such as one generated by [acorn](https://github.com/marijnh/acorn).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i estree-walker
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
var walk = require('estree-walker').walk;
|
|
17
|
+
var acorn = require('acorn');
|
|
18
|
+
|
|
19
|
+
ast = acorn.parse(sourceCode, options); // https://github.com/acornjs/acorn
|
|
20
|
+
|
|
21
|
+
walk(ast, {
|
|
22
|
+
enter(node, parent, prop, index) {
|
|
23
|
+
// some code happens
|
|
24
|
+
},
|
|
25
|
+
leave(node, parent, prop, index) {
|
|
26
|
+
// some code happens
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Inside the `enter` function, calling `this.skip()` will prevent the node's children being walked, or the `leave` function (which is optional) being called.
|
|
32
|
+
|
|
33
|
+
Call `this.replace(new_node)` in either `enter` or `leave` to replace the current node with a new one.
|
|
34
|
+
|
|
35
|
+
Call `this.remove()` in either `enter` or `leave` to remove the current node.
|
|
36
|
+
|
|
37
|
+
## Why not use estraverse?
|
|
38
|
+
|
|
39
|
+
The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where [estraverse](https://github.com/estools/estraverse) was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys.
|
|
40
|
+
|
|
41
|
+
estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.)
|
|
42
|
+
|
|
43
|
+
None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://hono.dev">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/honojs/hono/main/docs/images/hono-title.png" width="500" height="auto" alt="Hono"/>
|
|
4
|
+
</a>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<hr />
|
|
8
|
+
|
|
9
|
+
[](https://github.com/honojs/hono/actions)
|
|
10
|
+
[](https://github.com/honojs/hono/blob/main/LICENSE)
|
|
11
|
+
[](https://www.npmjs.com/package/hono)
|
|
12
|
+
[](https://www.npmjs.com/package/hono)
|
|
13
|
+
[](https://jsr.io/@hono/hono)
|
|
14
|
+
[](https://bundlephobia.com/result?p=hono)
|
|
15
|
+
[](https://bundlephobia.com/result?p=hono)
|
|
16
|
+
[](https://github.com/honojs/hono/pulse)
|
|
17
|
+
[](https://github.com/honojs/hono/commits/main)
|
|
18
|
+
[](https://codecov.io/github/honojs/hono)
|
|
19
|
+
[](https://discord.gg/KMh2eNSdxV)
|
|
20
|
+
[](https://deepwiki.com/honojs/hono)
|
|
21
|
+
|
|
22
|
+
Hono - _**means flameπ₯ in Japanese**_ - is a small, simple, and ultrafast web framework built on Web Standards. It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js.
|
|
23
|
+
|
|
24
|
+
Fast, but not only fast.
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { Hono } from 'hono'
|
|
28
|
+
const app = new Hono()
|
|
29
|
+
|
|
30
|
+
app.get('/', (c) => c.text('Hono!'))
|
|
31
|
+
|
|
32
|
+
export default app
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm create hono@latest
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- **Ultrafast** π - The router `RegExpRouter` is really fast. Not using linear loops. Fast.
|
|
44
|
+
- **Lightweight** πͺΆ - The `hono/tiny` preset is under 12kB. Hono has zero dependencies and uses only the Web Standard API.
|
|
45
|
+
- **Multi-runtime** π - Works on Cloudflare Workers, Fastly Compute, Deno, Bun, AWS Lambda, Lambda@Edge, or Node.js. The same code runs on all platforms.
|
|
46
|
+
- **Batteries Included** π - Hono has built-in middleware, custom middleware, and third-party middleware. Batteries included.
|
|
47
|
+
- **Delightful DX** π - Super clean APIs. First-class TypeScript support. Now, we've got "Types".
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
The documentation is available on [hono.dev](https://hono.dev).
|
|
52
|
+
|
|
53
|
+
## Migration
|
|
54
|
+
|
|
55
|
+
The migration guide is available on [docs/MIGRATION.md](docs/MIGRATION.md).
|
|
56
|
+
|
|
57
|
+
## Communication
|
|
58
|
+
|
|
59
|
+
[X](https://x.com/honojs) and [Discord channel](https://discord.gg/KMh2eNSdxV) are available.
|
|
60
|
+
|
|
61
|
+
## Contributing
|
|
62
|
+
|
|
63
|
+
Contributions Welcome! You can contribute in the following ways.
|
|
64
|
+
|
|
65
|
+
- Create an Issue - Propose a new feature. Report a bug.
|
|
66
|
+
- Pull Request - Fix a bug or typo. Refactor the code.
|
|
67
|
+
- Create third-party middleware - See instructions below.
|
|
68
|
+
- Share - Share your thoughts on the Blog, X, and others.
|
|
69
|
+
- Make your application - Please try to use Hono.
|
|
70
|
+
|
|
71
|
+
For more details, see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
|
|
72
|
+
|
|
73
|
+
## Contributors
|
|
74
|
+
|
|
75
|
+
Thanks to [all contributors](https://github.com/honojs/hono/graphs/contributors)!
|
|
76
|
+
|
|
77
|
+
## Authors
|
|
78
|
+
|
|
79
|
+
Yusuke Wada <https://github.com/yusukebe>
|
|
80
|
+
|
|
81
|
+
_RegExpRouter_, _SmartRouter_, _LinearRouter_, and _PatternRouter_ are created by Taku Amano <https://github.com/usualoma>
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
|