{"_id":"7tr","_rev":"3-f446ce1b83146612e49fa36ff7ee55ca","name":"7tr","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"7tr","version":"0.0.1","description":"Cloudflare page plugin for tRPC","main":"dist/index.js","types":"index.d.ts","scripts":{"test":"vitest ","build":"npx wrangler pages functions build --plugin --outfile=dist/index.js","prepare":"npm run build"},"devDependencies":{"@cloudflare/workers-types":"^3.16.0","esbuild":"^0.14.54","vitest":"^0.15.2","wrangler":"^2.1.10"},"dependencies":{"@trpc/server":"10.0.0-alpha.22","zod":"^3.19.1"},"_id":"7tr@0.0.1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-pwhnhasN7zjLJXom/Nxl9U3R/PD2i7+l1KZfprrHeR1DedoC0COfxFUG0ENcYguiHv5Upe5oen6DT8fnotcPuw==","shasum":"cc80e277b88f028eb86a721895bd09ed8bff71b0","tarball":"https://registry.npmjs.org/7tr/-/7tr-0.0.1.tgz","fileCount":5,"unpackedSize":28177,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAddGdKTVyaNwGoPIJ3S4484PTTXbAg7pTyfA/SBcztDAiEAwHmmWen8K17gNbGnSoepFurUVL1jcrHvLfPmFqUc+Ac="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPuczACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreXg/9Fqt7Rn5R067CMPdeyRXGgnaNFCDnitnPnFcS85cA5qP28LK4\r\ncFUhAUGloh7HMZKl5r89sDxVB+EVjeNSeqSOUc2bEJaj2A1RcSSScjqneF1c\r\nPoE1Iti2cJ74rvI9d24SHFZ8LSkJ3vaKXUekz3wwNMEJzMra4B+LbmX5u/Kr\r\nSxlcpE2HypSa46Z65TeEzC+X5R0mGxX1UblZwMeuuyYlw1+lgjMtMRvJCqqt\r\n3HPhlAdtA3RrJjqlIyHYXVyLRfXu/V8cIcfBHQ5biUrRCTt4TNwbs3033QKM\r\nnjk/Jnxa72um8V77LthYz7/m4BDzYiMg2ogJZqT0Aiz7Sea8q6Lf+ZHGyOeX\r\n2nS9FXUML2dffpuP7AtapcDvrFjlhkxj3XWgIuwmLv0+0LdV7vwfx6+5uSNu\r\nl2V4+tKsbxmFvBxsQ6Y2XonUdeIWFcuq3wbdfu5TyIw7P5pW5gTt9dcF46ni\r\nC6eGlLakYUV5bbUnpxP8MHsO76mrhXpRxZT3nRQaoQfjAC4RRZFn9YJ1Gduc\r\nK2D9IFNDJIwCpnXWMF2OxYfpC8X1tKwKLsbr+DTjpyNjxzwnmhbc9UlLlFdH\r\nLeU4Cn+J1Qewg3utH53uarmtO9Gc8Q6/rF+CMLIXCwuGTk7UiiEktgjVrfFA\r\nDEN1xBAyl7cpw0IlRkaSN0ePNfFsggm/y58=\r\n=xpVB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vsamaru","email":"vsamaru@gmail.com"},"directories":{},"maintainers":[{"name":"vsamaru","email":"vsamaru@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/7tr_0.0.1_1665066803067_0.550527124379838"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-06T14:33:23.066Z","0.0.1":"2022-10-06T14:33:23.481Z","modified":"2023-02-20T18:36:19.909Z"},"maintainers":[{"email":"dad2vad@gmail.com","name":"dad22"},{"email":"zbndmt@gmail.com","name":"zbndm"},{"email":"vsamaru@gmail.com","name":"o6"}],"description":"Cloudflare page plugin for tRPC","readme":"# tRPC Pages Plugin\n\nThis plugin allows developers to create tRPC server on Cloudflare Page Function rapidly.\n\nYou can see demo site on [https://cloudflare-pages-plugin-trpc.pages.dev](https://cloudflare-pages-plugin-trpc.pages.dev/).\n\n> **Warning**\n> \n> This plugin is on `tRPC@10.x`. It's still in alpha, expect bugs and there're lots of breaking changes.\n\n# How to use\n\nIf you have any tRPC router, just set it into this plugin!\n\nFor example, you have router as like as below:\n\n```ts\n// router.ts\nimport * as trpc from \"@trpc/server\";\n\nexport const router = trpc.router().query(\"hello\", {\n  input: z.string().nullish(),\n  resolve: ({ input }) => {\n    return `hello ${input ?? \"world\"}`;\n  },\n});\nexport type AppRouter = typeof appRouter;\n```\n\nYou can deploy it to Cloudflare Pages Function right now.\n\n```ts\nimport { router } from \"./router.ts\";\nimport tRPCPlugin from 'cloudflare-pages-plugin';\n\n// That's it!\nexport const onRequest: PagesFunction = tRPCPlugin({ router });\n```\n\nMore practical code deployed to the [demo site](https://cloudflare-pages-plugin-trpc.pages.dev) can be found in the [/examples](https://github.com/toyamarinyon/cloudflare-pages-plugin-trpc/tree/main/examples) folder.\n\n\n## What is tRPC ?\n\ntRPC is library that allows End-to-end typesafe APIs made easy. There are many resource to explain tRPC concept, history and what it try to resolve, but I highly recommend that you try to [quick demo](https://sat0shi.dev/posts/trpc-hands-on) first.\n\nOf course, you can see tRPC document on [trpc.io](https://trpc.io/).\n\n# Why this plugin provide as individual package ?\n\nI've sometimes contributed tRPC, so I also created a [pull request](https://github.com/trpc/trpc/pull/1882) that this plugin into tRPC package, and I discussed @KATT who creator of tRPC and @sachinraja who maintainer of tRPC, and result, it's prefer to provide as individual package.\n\nSo, I'll continue to actively follow and maintain tRPC updates.\n\n# Road map\n\n## High\n\n- Write documents\n\n    - deploy guide\n\n- Integrate Cloudflare resources\n\n    - R2\n    - D1\n    - And more...\n\n## Middle\n\n- Testing\n\n  I'm considering how test it.\n","readmeFilename":"README.md"}