Why not try the example module explained on this page yourself? Download
For fields, their widgets and their formatters, hook-implementations in D7 are replaced by classes with annotations in D8. For instance, the schema definition that used to live in the .install file has moved to the class that lives in modulename/lib/Drupal/modulename/Plugin/Field/FieldType/ModuleNameItem.php. So often, after upgrading your project won't have a .install file anymore.
Here's in summary what you'll have to add to re-instate the functionality provided by your field hook implementations.
In the /modules/modulename/lib/Drupal/modulename/Plugin/Field folder you need to create the 3 following files, each holding a class and its magic annotations.
Below are examples of the files above, plus .info.yml and .module files that when put together form a working example of a module that programmatically creates a text field, widget and formatter. Through the "Manage fields" UI this field may be attached to any entity type.