Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shaggy-poets-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": patch
---

feat: Update `hono` template to remove binding type snippet.
Comment thread
roottool marked this conversation as resolved.
Outdated
10 changes: 0 additions & 10 deletions packages/create-cloudflare/templates/hono/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ const configure = async (ctx: C3Context) => {
const snippets = loadTemplateSnippets(ctx);

transformFile(indexFile, {
// Insert the env declaration after the last import (but before the rest of the body)
visitProgram: function (n) {
const lastImportIndex = n.node.body.findLastIndex(
(t) => t.type === "ImportDeclaration",
);
const lastImport = n.get("body", lastImportIndex);
lastImport.insertAfter(...snippets.bindingsTypeTs);

return this.traverse(n);
},
visitVariableDeclarator(n) {
if (n.node.id.type === "Identifier" && n.node.id.name === "app") {
n.node.init = snippets
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
new Hono<{ Bindings: Bindings }>()
new Hono<{ Bindings: CloudflareBindings }>()

This file was deleted.