DevCycle to OpenFeature Node.js - Update Imports CodeMod
This Codemod helps to convert DevCycle Node.js SDK implementations to the OpenFeature Node.js SDK using the DevCycle Provider. It handles the first step of the conversion by updating the packages imports:
- Only if the file is using
initializeDevCycle
, removes the imports ofinitializeDevCycle
, and replaces those imports withDevCycleProvider
from@devcycle/nodejs-server-sdk
- Only if the file is using
DevCycleClient
, removes the import ofDevCycleClient
, and replaces those imports withDevCycleProvider
from@devcycle/nodejs-server-sdk
- Replaces
DevCycleUser
type withEvaluationContext
from@openfeature/server-sdk
- Add imports for
OpenFeature
from@openfeature/server-sdk
if the file is usinginitializeDevCycle
orDevCycleClient
Before
import {initializeDevCycle,DevCycleClient,} from "@devcycle/nodejs-server-sdk";
After
import { DevCycleProvider } from "@devcycle/nodejs-server-sdk";import { OpenFeature, Client } from "@openfeature/server-sdk";
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community