gecko-dev/toolkit/devtools/jsbeautify/UPGRADING.md
Michael Ratcliffe ea37e9901b Bug 1033387 - Update JSBeautify and move it into toolkit r=fitzgen
--HG--
rename : browser/devtools/shared/Jsbeautify.jsm => toolkit/devtools/jsbeautify/beautify.js
2014-07-14 14:25:22 +01:00

1.0 KiB

UPGRADING

  1. git clone https://github.com/beautify-web/js-beautify.git

  2. Copy js/lib/beautify.js to toolkit/devtools/jsbeautify/src/beautify-js.js

  3. Remove the acorn section from the file and add the following to the top:

const acorn = require("acorn/acorn");
  1. Just above function Beautifier(js_source_text, options) { add:
exports.jsBeautify = js_beautify;
  1. Copy beautify-html.js to toolkit/devtools/jsbeautify/src/beautify-html.js

  2. Replace the require blocks at the bottom of the file with:

var beautify = require('devtools/jsbeautify');

exports.htmlBeautify = function(html_source, options) {
   return style_html(html_source, options, beautify.js, beautify.css);
};
  1. Copy beautify-css.js to toolkit/devtools/jsbeautify/src/beautify-css.js

  2. Replace the global define block at the bottom of the file with:

exports.cssBeautify = css_beautify;
  1. Copy js/test/beautify-tests.js to toolkit/devtools/jsbeautify/src/beautify-tests.js