Perform a prepublish check that prevents dirty trees and outdated package