write stack.json
move writeConfig method to utils