Supported projects
The languages, file types, module systems, frameworks and test runners CodeMorph works with, and known limits.
CodeMorph works at the level of modules and imports, so it isn't tied to a particular framework. If your project is JavaScript with a package.json, it's very likely a good fit.
Languages and file types
| Extension | Scanned | Converted |
|---|---|---|
.js | Yes | To .ts |
.jsx | Yes | To .tsx |
.mjs, .cjs | Yes | Module-format aware |
.ts, .tsx | Yes | Already typed |
.css, .json and other assets | As import targets | No |
Mixed JavaScript and TypeScript projects are fully supported. Existing TypeScript counts as already typed.
Module systems
- ES modules:
import,export,export * from,export { x } from, namespace imports and default exports. - CommonJS:
require(), destructured requires,module.exportsandexports.x. - Dynamic imports:
import()calls, recorded as dynamic edges. - Type-only imports:
import type, recorded separately.
See the guide CommonJS to ES modules for converting module systems during a migration.
Resolution
- Relative paths, with extension probing and
indexfiles. compilerOptions.pathsandbaseUrlfromtsconfig.jsonorjsconfig.json.- TypeScript NodeNext-style specifiers, where
./x.jsrefers tox.ts. - Packages declared in
package.json, including scoped packages and subpaths such as@scope/pkg/sub. - Node built-ins, with or without the
node:prefix.
Frameworks and runtimes
| Stack | Notes |
|---|---|
| React | Components in .jsx become .tsx, with props typed from how they're rendered |
| Next.js | Pages, components and API routes migrate like any other module; your build script verifies framework conventions |
| Vite | Works alongside Vite's own TypeScript support; verified with your build |
| Node.js | ESM and CommonJS backends, scripts and CLIs |
| Express | Routes, middleware and models; see Typing an Express API |
Test runners
Run & Verify runs your test script from package.json, so any runner works: Jest, Vitest, Mocha, node:test and others. Test files are recognized by .test. and .spec. in the name or a __tests__/ folder.
Package managers
npm, pnpm and Yarn projects all work. CodeMorph detects which one you use from your lockfile.
Known limits
- Files over 1 MB are skipped. These are almost always generated or bundled code.
- Multi-root workspaces: only the first folder is scanned. In a monorepo, open the package you want to migrate.
- Untrusted workspaces: the CodeMorph engine doesn't run in Restricted Mode.
- Code generated at runtime (for example,
requirewith a computed string) can't be resolved statically and is recorded as unresolved. - Non-JavaScript languages aren't migrated.
Something unclear or out of date? Tell us.