denoflare

Develop, test, and deploy Cloudflare Workers with Deno.

MIT License

Downloads
122
Stars
638
Committers
7

Bot releases are hidden (Show)

denoflare - v0.6.0 Latest Release

Published by johnspurlock-skymethod 9 months ago

  • push-deploy: deploy worker to Deno Deploy
  • push-lambda: deploy worker to AWS Lambda + public function url
  • push-supabase: deploy worker to Supabase Edge Functions
  • examples: New multiplat worker example, same code deployed to all four supported platforms
  • supabase: Management API and eszip helpers
  • deno: Update to [email protected]
  • aws: SES-based emailer
  • d1: new denoflare d1 subcommand
  • cfapi: list-ai-models and run-ai-model
  • cfapi: Hyperdrive commands (and bindings)
  • examples: New keyspace example
  • deno: Migrate to non-deprecated asserts
  • deploy: Deno Deploy API + KV runtime bindings
  • cfapi: Get account details
  • config: Look for the new CLOUDFLARE_ACCOUNT_ID/CLOUDFLARE_API_TOKEN as well as the old vars
  • r2: Async iter over list-objects-v2. Handle ContinuationToken in response
  • cli: New denoflare ae-proxy subcommand (a proxy endpoint to Analytics Engine more compatible with Clickhouse Grafana plugins)
  • serve: Basic tcp socket support in local isolation
  • config: Add browser binding to support the new Browser Rendering beta.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.12

Published by johnspurlock-skymethod over 1 year ago

  • serve: Bare ip address https workaround not needed as of 1.33.4.
  • config: Env var substitution in config binding and profile property resolution using ${env:VAR_NAME}
  • cfapi: list-kv-namespaces and list-keys.
  • deno: Update to latest [email protected].
  • deno: Event loop workaround in rpc fetch bodies to fix #56.
  • bundle: Unparsed bundle error output now returned as an error diagnostic.
  • serve: Implement KV put, list, delete when running locally (thanks to @thebergamo!)
  • push: Fix file import on Windows (thanks to @FaeyUmbrea!)
  • serve: KV get type text.
  • serve: Use profile from script config, if present.
  • types: Add queue.sendBatch.
  • types: Add new DO locationHint param.
  • xml: Expose xml validation.
  • tail: Support queue & alarm events properly.
  • serve: Add new --local-isolation option.
  • config: .denoflare config schema: Allow Trailing Commas (thanks to @JustinGrote!)
  • push: Optional compatibilityFlags option and script-level config property.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.11

Published by johnspurlock-skymethod almost 2 years ago

  • deno: Update spawn to use new Deno.Command on 1.28+.
  • config: Add serviceEnvironment to json schema and validation for configuring service bindings in config.
  • push: Add support for secret key (CryptoKey) worker env variables (found here).
  • serve: Add support for crypto key bindings.
  • cfapi: list-worker-deployments and get-worker-service-metadata.
  • xml: Ability to specify additional named entities when parsing xml.
  • serve: Start in-memory R2 bucket implementation. Syntax = local:memory:bucketName.
  • serve: Improve external fetch support for non-Request init with bodies.
  • r2: Support new r2 multipart upload worker bindings.
  • serve: Support these new r2 multipart upload worker bindings in local implementations.
  • cfapi: create/update/delete-logpush-job for configuring Workers Trace Events Logpush.
  • push: New logpush command-line flag and script config option to enable logpush for the given worker.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.10

Published by johnspurlock-skymethod almost 2 years ago

  • presigned-url: Example worker now supports custom domains.
  • cli: r2 presign supports custom domains and keypairs.
  • push/serve: Fix regression when there is no script-level profile configured.
  • cfapi: New list-user-billing-history subcommand.
  • deno: Update to [email protected], corresponds to latest Deno v1.27.1.
  • cleanup: Remove js-based md5, obsolete in Deno std (implemented in wasm crypto lib) and unused in Denoflare.
  • r2: Bucket binding now supports list startAfter.
  • types: Add DurableObjectStorage.sync().
  • types: R2Bucket.delete(multiple keys), put options onlyIf, R2Object.checksums, and new hashes.
  • push: Initial Queues support, bindings, config, and types.
  • cfapi: Queues management apis.
  • types: Migrate to a copy of IncomingRequestCfProperties from workers-types with minimal tweaks.
  • types: D1 bindings and local no-op stub.
  • types: KVNamespace.get should support no opts (defaults to text).

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.9

Published by johnspurlock-skymethod about 2 years ago

  • deno: Fix DedicatedWorkerGlobalScope caches error when running on Deno 1.26+.
  • deno: Update to latest [email protected], corresponding to Deno 1.26.1.
  • push: Actually use script-level profile in config, if present.
  • types: Update AE binding to match production.
  • serve: Update local r2-over-api bucket impl to latest etag requirements.
  • public-read: Workaround for R2 S3 api no longer returning content-length in getObject.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.8

Published by johnspurlock-skymethod about 2 years ago

  • bundle: Workaround removal of Deno.Diagnostic in unstable Deno 1.25.
  • watch: Handle file url entry paths.
  • types: Add DurableObjectStorage.startAfter, recently added to production runtime, implement in local DO versions.
  • serve: DO alarms, in-memory only.
  • serve: Implement DurableObjectStorage.list prefix and other options in local web storage DOs.
  • push: Command-line option for Analytics Engine bindings.
  • push: Script module import rewriter should allow '../ to start relative paths.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.7

Published by johnspurlock-skymethod about 2 years ago

  • public-read: Allow range computation for HEAD requests as well. (See #24)
  • cli: cfapi get-bucket-usage-summary.
  • analytics: Update known r2 class a and b operations.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.6

Published by johnspurlock-skymethod about 2 years ago

  • compat: New spawn helper to paper over breaking result type changes to unstable Deno.spawn in Deno 1.24. denoflare should now support running even with --check on Deno 1.23 and Deno 1.24.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.5

Published by johnspurlock-skymethod about 2 years ago

  • public-read: Bring back etag quote stripping to fix conditional requests.
  • r2: Remove xmlns expectation for Error responses to follow recent R2 production change.
  • serve: Fix permissionless webworker build with latest Deno lib decls, remove dep to localStorage.
  • public-read: New optional allowCorsOrigins and allowCorsTypes environment variable bindings to configure CORS.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.4

Published by johnspurlock-skymethod over 2 years ago

  • r2: Keep up with production r2 s3 api changes.
  • serve: --port option should override any script config.
  • cli: New r2 list-multipart-uploads command now that r2 supports it.
  • mqtt: Workarounds to support non-standard Cloudflare WebSocket client setup.
  • serve: Support Response.clone() for ReadableStream bodies in isolate mode.
  • d1: No-op D1Database binding.
  • serve,push: New --bundle check=all,local,none option to set the level of type-checking performed when bundling.
  • push: Improve importWasm rewrite to handle additional quoting chars.
  • serve,push: --bundle backend=module now supports relative file paths.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.3

Published by johnspurlock-skymethod over 2 years ago

  • cli: New pubsub subcommands for interacting with your Cloudflare Pub/Sub broker (cli docs)
  • denoflare-mqtt: MqttClient is a lightweight MQTT v5 client for Deno, Node, and the browser, specifically targeting the features implemented in Pub/Sub (more info and browser demo)
  • analytics-engine: Worker environment runtime bindings and cfapi operations
  • cli: Auto-lookup account-id if only api-token provided
  • cli: Use parent dirname for default script name for generic script names like worker, index, mod
  • r2: Support new R2Object.range production property
  • d1: Worker environment runtime bindings and new d1 subcommands for interacting with Cloudflare D1 databases and backups (cli docs)
  • push: New --workers-dev option (and corresponding config property) to enable or disable the workers.dev route
  • site: Enable vertical scrolling for the sidebar
  • deps: Update deno std dependencies to 0.144.0, corresponding to Deno v1.23.0
  • cli: denoflare r2 presign to generate presigned get-object calls now that R2 supports native presigning

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.2

Published by johnspurlock-skymethod over 2 years ago

  • deps: Update deno std dependencies to 0.142.0, corresponding to Deno v1.22.2
  • serve: New --watch-include option to trigger module reload on additional non-source files, similar to the same option in push
  • public-read/presigned-url: Handle new R2 error code embedding
  • r2: Conditional put support in put-object and create-multipart-upload
  • alarms: Set compat flag and date when uploading, handle strange tail messages received from alarm handlers
  • cfapi: New list-durable-objects-namespaces and list-durable-objects subcommands
  • cfapi: New commands relating to Pub/Sub
  • cli: New custom flag parser to fix regression on std flags, remove dependency on std flags. Specifying multiple options with the same name for multi-valued options should be fixed

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.1

Published by johnspurlock-skymethod over 2 years ago

  • analytics: Allow --start without --end for both durable-objects and r2
  • analytics: Fix r2 class b operations costs calculation, and add est 30-day and est 30-day minus free summary rows to r2 output
  • public-read/presigned-url: Log incoming request headers.

Installation

Follow the installation instructions on our docs page: https://denoflare.dev/cli

denoflare - v0.5.0

Published by johnspurlock-skymethod over 2 years ago

Summary

  • Initial support for R2! Overview doc
  • Mitigations for the breaking changes in the latest Deno version 1.22.0, which removed Deno.emit
    • denoflare relied on Deno.emit bundling in serve and push!
    • New version relies on deno bundle under the hood (see below for details)
  • Option to specify/override script environment bindings via the command line, no .denoflare config file needed for complicated workers
  • Declarative support for Custom Domains for Workers, bind a worker to your custom domain (even an apex domain) via denoflare push

Installation

New in this release (R2-related):

  • r2: TypeScript types for the R2Bucket runtime API
  • cli: denoflare r2 <subcommand>
    • vhost-style by default, option for explicit path or vhost
  • r2: associated functions in common/r2
    • r2.ts exports 21 lightweight r2 s3-compatible API operation functions, and common utils like v4 signing etc
    • self-contained, no deps on aws or aws4fetch, can be used within workers themselves
    • new namespace-aware parsing functions in common/xml_parser.ts
    • new dep on fast-xml-parser
    • can be remote imported from Deno projects
    • or bundled to a single javascript file for non-Deno environments
      • deno bundle https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/common/r2/r2.ts -> 99k unminified, 48k minified, 13k gzipped (includes fast-xml-parser)
    • put-object supports streaming uploads for large files
  listBuckets
  headBucket
  createBucket
  deleteBucket
  getBucketEncryption
  deleteBucketEncryption
  putBucketEncryption
  getBucketLocation

  listObjects
  listObjectsV2
  getObject
  headObject
  putObject
  deleteObject
  deleteObjects
  copyObject

  createMultipartUpload
  abortMultipartUpload
  completeMultipartUpload
  uploadPart
  uploadPartCopy
  • serve,push: new worker binding to an existing r2 bucket

    • can also be used locally in serve, will proxy local calls to the real bucket over the r2 s3-compatible api
    • works in both localIsolation modes (none, isolate)
  • r2-public-read: New example worker for making a bucket public

    • supports conditional requests, range requests, and objects stored with pre-existing content-encoding
    • optional input flag to enable directory listing as html, configurable page limit
    • optional input flag to enable routing similar to Cloudflare Pages, index.html served for directories, etc
    • optional allow/deny ip lists
    • can be deployed as is to a custom domain in a zone you own with a single push command
denoflare push https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/examples/r2-public-read-worker/worker.ts \
   --name my-bucket-public-read \
   --r2-bucket-binding bucket:my-bucket \
   --text-binding flags:listDirectories \
   --custom-domain my-bucket.my-domain.com \
   --account-id $CF_ACCOUNT_ID \
   --api-token $CF_API_TOKEN
  • r2-presigned-url: New example worker for making a bucket available via presigned GET requests
    • generate private credentials to use only with users to this presigned worker (e.g. $USER_ACCESS_KEY:$USER_SECRET_KEY below) so you don't have to use actual r2 credentials
    • generate them with a new cli command: denoflare r2 generate-credentials
    • generate presigned urls using s3 standard tools like presign
  AWS_ACCESS_KEY_ID=$USER_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$USER_SECRET_ACCESS_KEY \
  aws s3 presign s3://b/video.mp4 --endpoint-url https://my-bucket.my-domain.com
  • r2-presigned-url: (continued)
    • optional allow/deny ip lists
    • configurable maxSkewMinutes, default: 15
    • configurable maxExpiresMinutes, default: 7 days
    • supports conditional requests, range requests, and objects stored with pre-existing content-encoding
    • can be deployed as is to a custom domain in a zone you own with a single push command
 denoflare push https://raw.githubusercontent.com/skymethod/denoflare/v0.5.0/examples/r2-presigned-url-worker/worker.ts \
   --name my-bucket-public-read \
   --r2-bucket-binding bucket:my-bucket \
   --secret-binding credentials:$USER_ACCESS_KEY_ID:$USER_SECRET_ACCESS_KEY \
   --custom-domain my-bucket.my-domain.com \
   --account-id $CF_ACCOUNT_ID \
   --api-token $CF_API_TOKEN
  • analytics: New R2 analytics
    • Daily aggregate class a operations, class b operations, egress, storage, and associated costs
    • Per bucket cost, current storage, current object count, and egress
    • denoflare analytics r2

New in this release (non-R2-related):

  • tail: Handle new response status property coming back for each request message in all formatters including webtail.
  • cfapi: better cli docs for the supported subcommands
    • added list-zones, list/put/delete workers domains, list-memberships, list-accounts, list-scripts, get-user
  • push: New Script-level config property customDomains to define one or more custom domains on which to bind the worker when deploying, including apex domains!
  • uses the new Custom Domains for Workers
  • no additional route/dns setup needed
  • push: Use custom domains specified on the command line, if present.
  • push,serve: Option to override bindings from the command line.
  • push,serve: Ability to set --account-id and --api-token on the command line
    • .denoflare config no longer needed for workers with environment variable bindings!
  • cli: Unified cli command handling, all subcommands, arguments, and options available via --help
    • Abbreviated subcommand names are allowed when unambiguous. e.g. denoflare r2 lb instead of denoflare r2 list-buckets
  • deno: Support the latest Deno version 1.22.0, which removed Deno.emit, breaking us!
    • On 1.22+, bundling (for push and serve) is now done by spawning deno bundle under the hood
    • needs new --allow-run permission or --allow-run=~/.deno/bin/deno
    • Deno.emit is still used when running on Deno pre 1.22
    • The official replacement for Deno.emit is a new userland x/deno_emit module
      • Not a great replacement, they have no plans to ever type check in this module
      • Also quite buggy right now
      • Add --bundle backend=module if you want to try it out within denoflare instead of deno bundle
    • Renamed the emit utility function to bundle, supporting the three different backends: builtin (Deno.emit pre 1.22), process (deno bundle), and module (x/deno_emit)
  • do alarms: Updated types with getAlarm/setAlarm/deleteAlarm to try them out in production, no local emulation yet
  • docs: Tons of new documentation, including the ability to generate regenerate online docs pages for every cli command
  • site: New tweaks to support the new docs, like <Aside> and links inside code blocks
denoflare - v0.4.5

Published by johnspurlock-skymethod over 2 years ago

  • Develop locally using https! See discussion that prompted this new addition.
  • Incremental module compilation breakages on watch changes will no longer terminate serve! ๐Ÿ˜„๐Ÿ˜„๐Ÿ˜„

New in this release:

  • cli: New analytics options to constrain durable object analytics to a specific date range or dump unit totals.
  • push/serve: Allow additional files or folders to be watched during --watch, for example to static content imported with importText.
  • serve: Implement ArrayBuffer response bodies for isolate mode.
  • serve: Implement KV getWithMetadata and get for isolate mode, and api-backed implementation.
  • cli: Put KV key-value with/without metadata.
  • cli: list-buckets, create-bucket, delete-bucket for r2.
  • serve: Return Response.url and redirected properly for outgoing fetches.
  • serve: New --cert-pem and --key-pem options (and associated localCertPem and localKeyPem script config props) to support local https.
  • push: Basic r2 binding via config (only works in prod, no local simulation yet).
  • cli: New list-flags to dump your account-level flags.
  • push: New start time prefix to push id.
  • tail: Show unredacted url using logprops, since Cloudflare loves to redact any url with paths including hex strings.
  • serve: Implement packed request redirect.
  • serve: Recompilation failures on local watches should not fail the process like the first compile.
denoflare - Release 0.4.4

Published by johnspurlock-skymethod over 2 years ago

  • push: Allow pushes with seemingly non-fatal import json assert diagnostics during emit. (May be a deno bug)
  • push, serve: Centralize Deno.emit calls in one place so we can be explicit about which diagnostic warnings we can safely ignore.
denoflare - Release 0.4.3

Published by johnspurlock-skymethod over 2 years ago

  • examples: New image demo worker.
  • serve: Update to latest deno_graph to fix panics on projects with import json assertions.
  • serve: Fix re-entrancy bug with local DOs by removing the too-coarse mutex around the entire fetch call.
denoflare - Release 0.4.2

Published by johnspurlock-skymethod almost 3 years ago

  • serve/push: Implement text/binary imports withimportText/importBinary (similar to the approach for importWasm).
  • push: New usageModel config to use explicit cloudflare usage model (e.g. unbound) on deployment.
denoflare - Release 0.4.1

Published by johnspurlock-skymethod almost 3 years ago

  • push/serve: tweak importWasm to handle modules requiring imports.
  • push/serve: Allow underscores in module spec.
denoflare - Release 0.4.0

Published by johnspurlock-skymethod almost 3 years ago

  • serve: New persistent local durable object storage option that uses Deno's new default localStorage, requiring no additional permissions
  • push,serve: Initial WASM support! Works in module-style workers (via a special importWasm function) and script-based workers (global variable binding)