npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

trpc-v10-migrate-codemod

v1.3.2

Published

codemod to migrate your tRPC codebase from v9 to v10

Downloads

13

Readme

trpc-v10-migrate-codemod

codemod to migrate your tRPC codebase from v9 to v10

This codemod will not perform a complete transformation. Rather, it is meant to help you with the most straightforward changes. Additionally, please examine the transformed code to ensure that it is correct.

Usage

npx trpc-v10-migrate-codemod

Warning It is recommended to run this codemod on a clean branch to ensure your changes are not lost.

This command will migrate all files included in your tsconfig.json to v10.

Current transformations:

  • v9 router to v10 router
  • v9 React client to v10 proxy React client
  • createCaller to proxy caller

Options

Run npx trpc-v10-migrate-codemod --help to see all options.

--tsconfig-path - path to your tsconfig.json file (default = 'tsconfig.json')

--react-namespace - namespace of your tRPC React hooks (can be specified multiple times) (default = 'trpc')

  • setting this to an empty string (--react-namespace='') will match hooks without a namespace like useQuery() and useMutation()

--caller-namespace - namespace of your tRPC createCallers (i.e. const caller = appRouter.createCaller()) (can be specified multiple times) (default = 'caller')

--context-namespace - namespace of your tRPC context helpers (i.e. const utils = trpc.useContext()) (can be specified multiple times) (default = 'utils')

--router-factory - the function you use to create your routers (i.e. createRouter, createProtectedRouter) (can be specified multiple times) (default = ['router'])

--base-procedure - the base procedure unit for v10 (i.e. adminProcedure) (default = 't.procedure')

--import - named import to add to the top of every file with a transformed router (can be specified multiple times)

  • structure is [named import]:[module specifier]
  • example: --import t:~/server/trpc --import adminProcedure:~/server/trpc

--remove-import - named import to remove from every file with a transformed router (can be specified multiple times)

  • structure is [named import]:[module specifier]
  • example: --remove-import createRouter:~/server/trpc