New
Codemod Registry
Explore community-led codemods to migrate, optimize, and transform your codebase.
Ready to contribute?
Build your own codemod and share it with the community.
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Install and configure the supabase-cms plugin for MakerKit
This is one example from the codemod's test cases. The codemod may handle many more cases.
Build your own codemod and share it with the community.
1 import { CmsClient, CmsType } from '@kit/cms-types';
2 import { createRegistry } from '@kit/shared/registry';
3
4 const CMS_CLIENT = process.env.CMS_CLIENT as CmsType;
5
6 const cmsRegistry = createRegistry<CmsClient, CmsType>();
7
8 // Register the WordPress CMS client implementation
9 cmsRegistry.register('wordpress', async () => {
10 const { createWordpressClient } = await import('@kit/wordpress');
11 return createWordpressClient();
12 });
13
14 export async function createCmsClient(type: CmsType = CMS_CLIENT) {
15 return cmsRegistry.get(type);
16 }
17