Conversation
🦋 Changeset detectedLatest commit: 9188267 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-wrangler-5675You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5675/npm-package-wrangler-5675Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-wrangler-5675 dev path/to/script.jsAdditional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-create-cloudflare-5675 --no-auto-updatenpm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-cloudflare-kv-asset-handler-5675npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-miniflare-5675npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-cloudflare-pages-shared-5675npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8787108403/npm-package-cloudflare-vitest-pool-workers-5675Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Looks good to me (with a few minor suggestions) 🙂
Also if you're adding the toml file support, I'm thinking that it might be appropriate to add an e2e for the bindings access as you did for the other frameworks?
workers-sdk/packages/create-cloudflare/e2e-tests/frameworks.test.ts
Lines 76 to 79 in 1f2c1e3
packages/create-cloudflare/templates/hono/snippets/appDeclaration.ts
Outdated
Show resolved
Hide resolved
packages/create-cloudflare/templates/hono/snippets/bindingsType.ts
Outdated
Show resolved
Hide resolved
yusukebe
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks!
|
@jculvey Looking at your generated repo at https://github.com/jculvey/cf-hono-example, everything on c.env.dddin your repo doesn't throw any errors, it just reports as Is this the intent here? I feel like the DX is much worsened when everything on Was this added as a result of using an |
|
@Cherry thanks for catching this! In short, no, the intent here wasn't just to regress the type safety of env 😅 . In short we're trying to simplify the process of consuming the type definition generated by Unfortunately If you try to assign the result of that command directly to As you point out, if the generated What I was trying to accomplish was to augment the existing type with the generated one: Agreed this is worse DX. I'll make a PR to patch this up. Thanks again for the report! |
|
Thanks @jculvey! 🧡 |


What this PR solves / how to test
The
honotemplate has been updated as follows:create-honoto0.7.0wrangler.tomlfile with commented out examples of all available bindings to match other templates.cf-typegenpackage script to automatically regenerate types forBindingsfromwrangler.tomlExample of resulting project with an added kv example: https://github.com/jculvey/cf-hono-example.
Author has addressed the following