Migrating Custom Modes to V6

Hi, I have few custom modes which I was using in V5 defined using defineMode and I am now planning to migrate to V6 and I see that defineMode is now no longer available , Do we have any guide which I can follow?
PS I am aware of this

CodeMirror 5 modes have been ported to CodeMirror 6’s stream-parser interface and are available in the @codemirror/legacy-modes package.

Just wanted to know if there exists a guide for this migration specifically

No, but if you look at the files in the legacy-mode package you should be able to structure your existing modes in a similar way with minor modifications and use them with StreamLanguage.

Thanks for quick reply , will look into it