Skip to content

Migrating to Hamur

Hamur has a guide for each framework below. A guide maps the names of that framework to Hamur's, row by row, with a status for each: same, different or none. Pick your framework, read its guide, and run its codemod when it has one.

A codemod reads your app as text, without running it or installing anything, and writes hamur-migration.md, the guide's table filtered to what your app uses, with the file:line of each use. Add --write to let it rewrite the files it can; see hamur migrate in the CLI.

Coming from Laravel gates and policies or from CASL for authorization, not for a whole app: Migrating from Laravel and CASL.

none in the Codemod column means the move is by hand, with the guide's tables. Every recipe is on the Recipes page.

After the move

The guides map names; these two commands and the error pages keep the app current once it runs on Hamur.

hamur upgrade --fix

hamur upgrade moves the versions of hamur and the @hamur/* packages. hamur upgrade --fix is a separate run that moves no version and makes no request: it rewrites the uses of deprecated APIs that have a fix; none is deprecated today, so it prints No deprecated API in use. Run it after hamur upgrade, and add --dry-run to see a diff first. It refuses a git work tree with uncommitted changes, as hamur migrate --write does. A use it cannot rewrite is printed with its file and line. See hamur upgrade in the CLI.

The /errors pages

Every error and warning Hamur writes starts with a code, such as HAMUR_E0001, and ends with a link to /errors/<code>. The page gives the message, the cause and the fix. When a build or a migrated app fails, search the error codes for the code in the message.