fix publish.js syntax errors