This is a POC of tRPC that can be deployed and works on Commerce Cloud Managed Runtime.
- It's written entirely in TypeScript
- Uses ESBuild to compile and bundle TypeScript code. So no need to deploy node_modules folder as well. Only code that is used is deployed everything else is dropped using tree shaking (see https://esbuild.github.io/api/#tree-shaking)
- Custom script to deploy the code to Managed Runtime is also provided so no dependency on https://www.npmjs.com/package/pwa-kit-react-sdk
- Can be used standalone as it is to deploy custom BD API using tRPC protocol or since it's just an Express.js middleware it can also be mounted as part of a PWA kit app and used there.
More info about tRPC at https://trpc.io/ and https://colinhacks.com/essays/painless-typesafety
Edit package.json
and set the package name to the MRT proejct name where you want to deploy this to
Run npm run build
Run npm run deploy -- --username='<USERNAME>' --apiKey='<API KEY>' --message '¯\_(ツ)_/¯'