js-beautify 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -110
- package/README.md +10 -10
- package/package.json +1 -1
- package/.codeclimate.yml +0 -17
- package/.jshintignore +0 -9
- package/.jshintrc +0 -10
- package/.travis.yml +0 -19
- package/ISSUE_TEMPLATE.md +0 -55
- package/appveyor.yml +0 -35
- package/bower.json +0 -11
- package/build +0 -5
- package/jsbeautifyrc +0 -18
- package/tools/build.sh +0 -161
- package/tools/generate-changelog.sh +0 -50
- package/tools/git-status-clear.sh +0 -18
- package/tools/release-all.sh +0 -87
- package/tools/template/beautify-css.begin.js +0 -66
- package/tools/template/beautify-css.end.js +0 -23
- package/tools/template/beautify-html.begin.js +0 -75
- package/tools/template/beautify-html.end.js +0 -37
- package/tools/template/beautify.begin.js +0 -90
- package/tools/template/beautify.end.js +0 -21
- package/webpack.config.js +0 -52
package/CHANGELOG.md
CHANGED
|
@@ -297,21 +297,6 @@ Version jump due to release script tweaks
|
|
|
297
297
|
|
|
298
298
|
|
|
299
299
|
### Closed Issues
|
|
300
|
-
* Fix tokenizer's bracket pairs' open stack ([#693](https://github.com/beautify-web/js-beautify/pull/693))
|
|
301
|
-
* Indentation is incorrect for HTML5 void tag <source> ([#692](https://github.com/beautify-web/js-beautify/issues/692))
|
|
302
|
-
* Line wrapping breaks at the wrong place when the line is indented. ([#691](https://github.com/beautify-web/js-beautify/issues/691))
|
|
303
|
-
* Publish v1.5.6 ([#687](https://github.com/beautify-web/js-beautify/issues/687))
|
|
304
|
-
* Replace existing file fails using python beautifier ([#686](https://github.com/beautify-web/js-beautify/issues/686))
|
|
305
|
-
* Pseudo-classes formatted incorrectly and inconsistently with @page ([#661](https://github.com/beautify-web/js-beautify/issues/661))
|
|
306
|
-
* doc: add end_with_newline option ([#650](https://github.com/beautify-web/js-beautify/pull/650))
|
|
307
|
-
* Improve support for xml parts of jsx (React) => spaces, spread attributes and nested objects break the process ([#646](https://github.com/beautify-web/js-beautify/issues/646))
|
|
308
|
-
* html-beautify formats handlebars comments but does not format html comments ([#635](https://github.com/beautify-web/js-beautify/issues/635))
|
|
309
|
-
* Support for ES7 async ([#630](https://github.com/beautify-web/js-beautify/issues/630))
|
|
310
|
-
* css beautify adding an extra newline after a comment line in a css block ([#609](https://github.com/beautify-web/js-beautify/issues/609))
|
|
311
|
-
* No option to "Indent with tabs" for HTML files ([#587](https://github.com/beautify-web/js-beautify/issues/587))
|
|
312
|
-
* Function body is indented when followed by a comment ([#583](https://github.com/beautify-web/js-beautify/issues/583))
|
|
313
|
-
* JSX support ([#425](https://github.com/beautify-web/js-beautify/issues/425))
|
|
314
|
-
* Alternative Newline Characters ([#260](https://github.com/beautify-web/js-beautify/issues/260))
|
|
315
300
|
|
|
316
301
|
|
|
317
302
|
## v1.5.5
|
|
@@ -324,21 +309,6 @@ Version jump due to release script tweaks
|
|
|
324
309
|
* General bug fixing
|
|
325
310
|
|
|
326
311
|
### Closed Issues
|
|
327
|
-
* Add GUI support for `--indent-inner-html`. ([#633](https://github.com/beautify-web/js-beautify/pull/633))
|
|
328
|
-
* Publish v1.5.5 ([#629](https://github.com/beautify-web/js-beautify/issues/629))
|
|
329
|
-
* CSS: Updating the documentation for the 'newline_between_rules' ([#615](https://github.com/beautify-web/js-beautify/pull/615))
|
|
330
|
-
* Equal Sign Removed from Filter Properties Alpha Opacity Assignment ([#599](https://github.com/beautify-web/js-beautify/issues/599))
|
|
331
|
-
* Keep trailing spaces on comments ([#598](https://github.com/beautify-web/js-beautify/issues/598))
|
|
332
|
-
* only print the file names of changed files ([#597](https://github.com/beautify-web/js-beautify/issues/597))
|
|
333
|
-
* CSS: support add newline between rules ([#574](https://github.com/beautify-web/js-beautify/pull/574))
|
|
334
|
-
* elem[array]++ changes to elem[array] ++ inserting unnecessary gap ([#570](https://github.com/beautify-web/js-beautify/issues/570))
|
|
335
|
-
* add support to less functions paramters braces ([#568](https://github.com/beautify-web/js-beautify/pull/568))
|
|
336
|
-
* selector_separator_newline: true for Sass doesn't work ([#563](https://github.com/beautify-web/js-beautify/issues/563))
|
|
337
|
-
* yield statements are being beautified to their own newlines since 1.5.2 ([#560](https://github.com/beautify-web/js-beautify/issues/560))
|
|
338
|
-
* HTML beautifier inserts extra newline into `<li>`s ending with `<code>` ([#524](https://github.com/beautify-web/js-beautify/issues/524))
|
|
339
|
-
* Add wrap_attributes option ([#476](https://github.com/beautify-web/js-beautify/issues/476))
|
|
340
|
-
* Add or preserve empty line between CSS rules ([#467](https://github.com/beautify-web/js-beautify/issues/467))
|
|
341
|
-
* Support comma first style of variable declaration ([#245](https://github.com/beautify-web/js-beautify/issues/245))
|
|
342
312
|
|
|
343
313
|
|
|
344
314
|
## v1.5.4
|
|
@@ -350,12 +320,6 @@ Version jump due to release script tweaks
|
|
|
350
320
|
https://github.com/beautify-web/js-beautify/compare/v1.5.3...v1.5.4
|
|
351
321
|
|
|
352
322
|
### Closed Issues
|
|
353
|
-
* TypeScript oddly formatted with 1.5.3 ([#552](https://github.com/beautify-web/js-beautify/issues/552))
|
|
354
|
-
* HTML beautifier inserts double spaces between adjacent tags ([#525](https://github.com/beautify-web/js-beautify/issues/525))
|
|
355
|
-
* Keep space in font rule ([#491](https://github.com/beautify-web/js-beautify/issues/491))
|
|
356
|
-
* [Brackets plug in] Space after </a> disappears ([#454](https://github.com/beautify-web/js-beautify/issues/454))
|
|
357
|
-
* Support nested pseudo-classes and parent reference (LESS) ([#427](https://github.com/beautify-web/js-beautify/pull/427))
|
|
358
|
-
* Alternate approach: preserve single spacing and treat img as inline element ([#415](https://github.com/beautify-web/js-beautify/pull/415))
|
|
359
323
|
|
|
360
324
|
|
|
361
325
|
## v1.5.3
|
|
@@ -368,20 +332,6 @@ https://github.com/beautify-web/js-beautify/compare/v1.5.3...v1.5.4
|
|
|
368
332
|
https://github.com/beautify-web/js-beautify/compare/v1.5.2...v1.5.3
|
|
369
333
|
|
|
370
334
|
### Closed Issues
|
|
371
|
-
* [TypeError: Cannot read property 'type' of undefined] ([#548](https://github.com/beautify-web/js-beautify/issues/548))
|
|
372
|
-
* Bug with RegExp ([#547](https://github.com/beautify-web/js-beautify/issues/547))
|
|
373
|
-
* Odd behaviour on less ([#520](https://github.com/beautify-web/js-beautify/issues/520))
|
|
374
|
-
* css beauitify ([#506](https://github.com/beautify-web/js-beautify/issues/506))
|
|
375
|
-
* Extra space after scss pseudo classes. ([#500](https://github.com/beautify-web/js-beautify/issues/500))
|
|
376
|
-
* Generates invalid scss when formatting ampersand selectors ([#498](https://github.com/beautify-web/js-beautify/issues/498))
|
|
377
|
-
* bad formatting of .less files using @variable or &:hover syntax ([#489](https://github.com/beautify-web/js-beautify/issues/489))
|
|
378
|
-
* Incorrect beautifying of CSS comment including an url. ([#466](https://github.com/beautify-web/js-beautify/issues/466))
|
|
379
|
-
* Handle SASS parent reference &: ([#414](https://github.com/beautify-web/js-beautify/issues/414))
|
|
380
|
-
* Js-beautify breaking selectors in less code. ([#410](https://github.com/beautify-web/js-beautify/issues/410))
|
|
381
|
-
* Problem with "content" ([#364](https://github.com/beautify-web/js-beautify/issues/364))
|
|
382
|
-
* Space gets inserted between function and paren for function in Define ([#313](https://github.com/beautify-web/js-beautify/issues/313))
|
|
383
|
-
* beautify-html returns null on broken html ([#301](https://github.com/beautify-web/js-beautify/issues/301))
|
|
384
|
-
* Indentation of functions inside conditionals not passing jslint ([#298](https://github.com/beautify-web/js-beautify/issues/298))
|
|
385
335
|
|
|
386
336
|
|
|
387
337
|
## v1.5.2
|
|
@@ -405,36 +355,6 @@ https://github.com/beautify-web/js-beautify/compare/v1.5.2...v1.5.3
|
|
|
405
355
|
https://github.com/beautify-web/js-beautify/compare/v1.5.1...v1.5.2
|
|
406
356
|
|
|
407
357
|
### Closed Issues
|
|
408
|
-
* Allow custom elements to be unformatted ([#540](https://github.com/beautify-web/js-beautify/pull/540))
|
|
409
|
-
* Need option to ignore brace style ([#538](https://github.com/beautify-web/js-beautify/issues/538))
|
|
410
|
-
* Refactor to Output and OutputLine classes ([#536](https://github.com/beautify-web/js-beautify/pull/536))
|
|
411
|
-
* Recognize ObjectLiteral on open brace ([#535](https://github.com/beautify-web/js-beautify/pull/535))
|
|
412
|
-
* Refactor to fully tokenize before formatting ([#530](https://github.com/beautify-web/js-beautify/pull/530))
|
|
413
|
-
* Cleanup checked in six.py file ([#527](https://github.com/beautify-web/js-beautify/pull/527))
|
|
414
|
-
* Changelog.md? ([#526](https://github.com/beautify-web/js-beautify/issues/526))
|
|
415
|
-
* New line added between each css declaration ([#523](https://github.com/beautify-web/js-beautify/issues/523))
|
|
416
|
-
* Kendo Template scripts get messed up! ([#516](https://github.com/beautify-web/js-beautify/issues/516))
|
|
417
|
-
* SyntaxError: Unexpected token ++ ([#514](https://github.com/beautify-web/js-beautify/issues/514))
|
|
418
|
-
* space appears before open square bracket when the object name is "set" ([#508](https://github.com/beautify-web/js-beautify/issues/508))
|
|
419
|
-
* Unclosed string problem ([#505](https://github.com/beautify-web/js-beautify/issues/505))
|
|
420
|
-
* "--n" and "++n" are not indented like "n--" and "n++" are... ([#495](https://github.com/beautify-web/js-beautify/issues/495))
|
|
421
|
-
* Allow `<style>` and `<script>` tags to be unformatted ([#494](https://github.com/beautify-web/js-beautify/pull/494))
|
|
422
|
-
* Preserve new line at end of file ([#492](https://github.com/beautify-web/js-beautify/issues/492))
|
|
423
|
-
* Line wraps breaking numbers (causes syntax error) ([#488](https://github.com/beautify-web/js-beautify/issues/488))
|
|
424
|
-
* jsBeautify acts differently when handling different kinds of function expressions ([#485](https://github.com/beautify-web/js-beautify/issues/485))
|
|
425
|
-
* AttributeError: 'NoneType' object has no attribute 'groups' ([#479](https://github.com/beautify-web/js-beautify/issues/479))
|
|
426
|
-
* installation doco for python need update -- pip install six? ([#478](https://github.com/beautify-web/js-beautify/issues/478))
|
|
427
|
-
* Move einars/js-beautify to beautify-web/js-beautify ([#475](https://github.com/beautify-web/js-beautify/issues/475))
|
|
428
|
-
* Bring back space_after_anon_function ([#474](https://github.com/beautify-web/js-beautify/pull/474))
|
|
429
|
-
* fix for #453, Incompatible handlebar syntax ([#468](https://github.com/beautify-web/js-beautify/pull/468))
|
|
430
|
-
* Python: missing explicit dependency on "six" package ([#465](https://github.com/beautify-web/js-beautify/issues/465))
|
|
431
|
-
* function declaration inside array, adds extra line. ([#464](https://github.com/beautify-web/js-beautify/issues/464))
|
|
432
|
-
* [es6] yield a array ([#458](https://github.com/beautify-web/js-beautify/issues/458))
|
|
433
|
-
* Publish v1.5.2 ([#452](https://github.com/beautify-web/js-beautify/issues/452))
|
|
434
|
-
* Port css colon character fix to python ([#446](https://github.com/beautify-web/js-beautify/issues/446))
|
|
435
|
-
* Cannot declare object literal properties with unquoted reserved words ([#440](https://github.com/beautify-web/js-beautify/issues/440))
|
|
436
|
-
* Do not put a space within `function*` generator functions. ([#428](https://github.com/beautify-web/js-beautify/issues/428))
|
|
437
|
-
* beautification of "nth-child" css fails csslint ([#418](https://github.com/beautify-web/js-beautify/issues/418))
|
|
438
358
|
|
|
439
359
|
|
|
440
360
|
## v1.5.1
|
|
@@ -453,35 +373,5 @@ Highlights:
|
|
|
453
373
|
https://github.com/einars/js-beautify/compare/v1.4.2...v1.5.1
|
|
454
374
|
|
|
455
375
|
### Closed Issues
|
|
456
|
-
* Nested if statements not displayed correctly ([#450](https://github.com/beautify-web/js-beautify/issues/450))
|
|
457
|
-
* preserve_newlines always true ([#449](https://github.com/beautify-web/js-beautify/issues/449))
|
|
458
|
-
* line wrapping breaks in weird places ([#438](https://github.com/beautify-web/js-beautify/issues/438))
|
|
459
|
-
* Update dependencies to current versions ([#437](https://github.com/beautify-web/js-beautify/pull/437))
|
|
460
|
-
* Add support for ES6 template strings ([#434](https://github.com/beautify-web/js-beautify/pull/434))
|
|
461
|
-
* Fix #402: support ES6 fat arrow ([#433](https://github.com/beautify-web/js-beautify/pull/433))
|
|
462
|
-
* Ending brace missaligned when part of first definition in var line ([#430](https://github.com/beautify-web/js-beautify/issues/430))
|
|
463
|
-
* fixing disabled line wrapping for HTML ([#429](https://github.com/beautify-web/js-beautify/pull/429))
|
|
464
|
-
* Missing semi colon ([#420](https://github.com/beautify-web/js-beautify/issues/420))
|
|
465
|
-
* Fixed require.js support ([#416](https://github.com/beautify-web/js-beautify/pull/416))
|
|
466
|
-
* should not split the es6 operator '=>' ([#402](https://github.com/beautify-web/js-beautify/issues/402))
|
|
467
|
-
* fixed relative paths for require.js ([#387](https://github.com/beautify-web/js-beautify/pull/387))
|
|
468
|
-
* Support reserved words as property names ([#378](https://github.com/beautify-web/js-beautify/issues/378))
|
|
469
|
-
* Make the AMD API match the rest of the APIs ([#376](https://github.com/beautify-web/js-beautify/pull/376))
|
|
470
|
-
* Preserve newlines in html related to issue #307 ([#375](https://github.com/beautify-web/js-beautify/pull/375))
|
|
471
|
-
* Multi-line statements ([#374](https://github.com/beautify-web/js-beautify/issues/374))
|
|
472
|
-
* Reserved words used as property/function/variable identifiers are formatted incorrectly ([#368](https://github.com/beautify-web/js-beautify/issues/368))
|
|
473
|
-
* fixed problems with colon character ([#363](https://github.com/beautify-web/js-beautify/pull/363))
|
|
474
|
-
* require.JS paths are hardcoded in beautify-html.js ([#359](https://github.com/beautify-web/js-beautify/issues/359))
|
|
475
|
-
* Regression in p.a.c.ked file detection ([#357](https://github.com/beautify-web/js-beautify/issues/357))
|
|
476
|
-
* Fix Issue #339 ([#354](https://github.com/beautify-web/js-beautify/pull/354))
|
|
477
|
-
* Added single line comment support in less/sass for javascript parser ([#353](https://github.com/beautify-web/js-beautify/pull/353))
|
|
478
|
-
* Function named 'in' not formatting correctly ([#351](https://github.com/beautify-web/js-beautify/issues/351))
|
|
479
|
-
* CSS Pseudo element ([#346](https://github.com/beautify-web/js-beautify/issues/346))
|
|
480
|
-
* array closing brace error for return statements with keep_array_indentation ([#340](https://github.com/beautify-web/js-beautify/issues/340))
|
|
481
|
-
* CSS Beautifier: breaks :before and :after (regression) ([#339](https://github.com/beautify-web/js-beautify/issues/339))
|
|
482
|
-
* Publish v1.5.0 ([#335](https://github.com/beautify-web/js-beautify/issues/335))
|
|
483
|
-
* "keep array indentation" not working ([#333](https://github.com/beautify-web/js-beautify/issues/333))
|
|
484
|
-
* CSS Beautifier: support LESS/SASS line comments ([#326](https://github.com/beautify-web/js-beautify/issues/326))
|
|
485
|
-
* Incorrect formating with semicolon-less code ([#323](https://github.com/beautify-web/js-beautify/issues/323))
|
|
486
376
|
|
|
487
377
|
|
package/README.md
CHANGED
|
@@ -21,17 +21,17 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries
|
|
|
21
21
|
|
|
22
22
|
To pull from one of these services include one set of the script tags below in your document:
|
|
23
23
|
```html
|
|
24
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
25
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
26
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
24
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify.js"></script>
|
|
25
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify-css.js"></script>
|
|
26
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify-html.js"></script>
|
|
27
27
|
|
|
28
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
29
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
30
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.
|
|
28
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify.min.js"></script>
|
|
29
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify-css.min.js"></script>
|
|
30
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.3/beautify-html.min.js"></script>
|
|
31
31
|
|
|
32
|
-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.
|
|
33
|
-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.
|
|
34
|
-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.
|
|
32
|
+
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.3/js/lib/beautify.js"></script>
|
|
33
|
+
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.3/js/lib/beautify-css.js"></script>
|
|
34
|
+
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.7.3/js/lib/beautify-html.js"></script>
|
|
35
35
|
```
|
|
36
36
|
Disclaimer: These are free services, so there are [no uptime or support guarantees](https://github.com/rgrove/rawgit/wiki/Frequently-Asked-Questions#i-need-guaranteed-100-uptime-should-i-use-cdnrawgitcom).
|
|
37
37
|
|
|
@@ -318,4 +318,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
|
|
|
318
318
|
Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
|
|
319
319
|
Mathias Bynens, Vittorio Gambaletta and others.
|
|
320
320
|
|
|
321
|
-
(README.md: js-beautify@1.7.
|
|
321
|
+
(README.md: js-beautify@1.7.3)
|
package/package.json
CHANGED
package/.codeclimate.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
engines:
|
|
2
|
-
eslint:
|
|
3
|
-
enabled: true
|
|
4
|
-
pep8:
|
|
5
|
-
enabled: true
|
|
6
|
-
ratings:
|
|
7
|
-
paths:
|
|
8
|
-
- "**.js"
|
|
9
|
-
- "**.py"
|
|
10
|
-
exclude_paths:
|
|
11
|
-
- test/resources/**
|
|
12
|
-
- web/third-party/**
|
|
13
|
-
- js/lib/beautify.js
|
|
14
|
-
- js/lib/beautify-css.js
|
|
15
|
-
- js/lib/beautify-html.js
|
|
16
|
-
- tools/template/*
|
|
17
|
-
- "**/generated/*"
|
package/.jshintignore
DELETED
package/.jshintrc
DELETED
package/.travis.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
language: python
|
|
2
|
-
python:
|
|
3
|
-
- "2.7"
|
|
4
|
-
- "3.3"
|
|
5
|
-
- "3.4"
|
|
6
|
-
- "3.5"
|
|
7
|
-
- "3.6"
|
|
8
|
-
|
|
9
|
-
node_js:
|
|
10
|
-
- 'node'
|
|
11
|
-
|
|
12
|
-
env:
|
|
13
|
-
- TRAVIS_NODE_VERSION="6"
|
|
14
|
-
|
|
15
|
-
install:
|
|
16
|
-
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
|
|
17
|
-
- npm install
|
|
18
|
-
|
|
19
|
-
script: "./build ci"
|
package/ISSUE_TEMPLATE.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Description
|
|
2
|
-
> This is the default template for bug reports, if you have a more general
|
|
3
|
-
> issue, question, or request, you may ignore this template and write freeform.
|
|
4
|
-
>
|
|
5
|
-
> NOTE:
|
|
6
|
-
> * Do not include screenshots! This library is a text processor, we need text inputs and outputs for debugging and fixing issues.
|
|
7
|
-
> * Check the list of open issues before filing a new issue.
|
|
8
|
-
|
|
9
|
-
# Input
|
|
10
|
-
The code looked like this before beautification:
|
|
11
|
-
```
|
|
12
|
-
<INSERT CODE HERE>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
# Expected Output
|
|
16
|
-
The code should have looked like this after beautification:
|
|
17
|
-
```
|
|
18
|
-
<INSERT CODE HERE>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
# Actual Output
|
|
22
|
-
The code actually looked like this after beautification:
|
|
23
|
-
```
|
|
24
|
-
<INSERT CODE HERE>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
# Steps to Reproduce
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Environment
|
|
31
|
-
OS:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Settings
|
|
35
|
-
Example:
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"indent_size": 4,
|
|
39
|
-
"indent_char": " ",
|
|
40
|
-
"indent_level": 0,
|
|
41
|
-
"indent_with_tabs": false,
|
|
42
|
-
"preserve_newlines": true,
|
|
43
|
-
"max_preserve_newlines": 10,
|
|
44
|
-
"jslint_happy": false,
|
|
45
|
-
"space_after_anon_function": false,
|
|
46
|
-
"brace_style": "collapse,preserve-inline",
|
|
47
|
-
"keep_array_indentation": false,
|
|
48
|
-
"keep_function_indentation": false,
|
|
49
|
-
"space_before_conditional": true,
|
|
50
|
-
"break_chained_methods": false,
|
|
51
|
-
"eval_code": false,
|
|
52
|
-
"unescape_strings": false,
|
|
53
|
-
"wrap_line_length": 0
|
|
54
|
-
}
|
|
55
|
-
```
|
package/appveyor.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
version: 1.6+{build}
|
|
2
|
-
|
|
3
|
-
nuget:
|
|
4
|
-
disable_publish_on_pr: true
|
|
5
|
-
|
|
6
|
-
deploy: off
|
|
7
|
-
|
|
8
|
-
# Test against this version of Node.js
|
|
9
|
-
environment:
|
|
10
|
-
global:
|
|
11
|
-
nodejs_version: "6"
|
|
12
|
-
|
|
13
|
-
matrix:
|
|
14
|
-
- PYTHON: "C:\\Python27"
|
|
15
|
-
PYTHON_VERSION: "2.7.x"
|
|
16
|
-
PYTHON_ARCH: "32"
|
|
17
|
-
|
|
18
|
-
# Install scripts. (runs after repo cloning)
|
|
19
|
-
install:
|
|
20
|
-
# Get the latest stable version of Node.js or io.js
|
|
21
|
-
- ps: Install-Product node $env:nodejs_version
|
|
22
|
-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
|
|
23
|
-
- pip --version
|
|
24
|
-
|
|
25
|
-
# Post-install test scripts.
|
|
26
|
-
test_script:
|
|
27
|
-
# Output useful info for debugging.
|
|
28
|
-
- node --version
|
|
29
|
-
- npm --version
|
|
30
|
-
- python --version
|
|
31
|
-
# run tests
|
|
32
|
-
- bash -c "./build ci"
|
|
33
|
-
|
|
34
|
-
# Don't actually build.
|
|
35
|
-
build: off
|
package/bower.json
DELETED
package/build
DELETED
package/jsbeautifyrc
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"indent_size": 4,
|
|
3
|
-
"indent_char": " ",
|
|
4
|
-
"indent_level": 0,
|
|
5
|
-
"indent_with_tabs": false,
|
|
6
|
-
"preserve_newlines": true,
|
|
7
|
-
"max_preserve_newlines": 10,
|
|
8
|
-
"jslint_happy": false,
|
|
9
|
-
"space_after_anon_function": false,
|
|
10
|
-
"brace_style": "collapse,preserve-inline",
|
|
11
|
-
"keep_array_indentation": false,
|
|
12
|
-
"keep_function_indentation": false,
|
|
13
|
-
"space_before_conditional": true,
|
|
14
|
-
"break_chained_methods": false,
|
|
15
|
-
"eval_code": false,
|
|
16
|
-
"unescape_strings": false,
|
|
17
|
-
"wrap_line_length": 0
|
|
18
|
-
}
|
package/tools/build.sh
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
REL_SCRIPT_DIR="`dirname \"$0\"`"
|
|
4
|
-
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
|
|
5
|
-
PROJECT_DIR="`( cd \"$SCRIPT_DIR/..\" && pwd )`"
|
|
6
|
-
|
|
7
|
-
build_help()
|
|
8
|
-
{
|
|
9
|
-
echo "build.sh <action>"
|
|
10
|
-
echo " full - build and test of all implementations"
|
|
11
|
-
echo " all - build of both implementations"
|
|
12
|
-
echo " js - build of javascript"
|
|
13
|
-
echo " py - build of python"
|
|
14
|
-
echo " alltest - test both implementations, js and python"
|
|
15
|
-
echo " pytest - test python implementation"
|
|
16
|
-
echo " jstest - test javascript implementation"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
build_ci()
|
|
20
|
-
{
|
|
21
|
-
build_full
|
|
22
|
-
build_git_status
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
build_full()
|
|
26
|
-
{
|
|
27
|
-
build_all
|
|
28
|
-
build_alltest
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
build_all()
|
|
32
|
-
{
|
|
33
|
-
build_py
|
|
34
|
-
build_js
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
build_py()
|
|
38
|
-
{
|
|
39
|
-
echo Building python module...
|
|
40
|
-
pip install -e ./python || exit 1
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
build_js()
|
|
44
|
-
{
|
|
45
|
-
echo Building javascript...
|
|
46
|
-
npm install || exit 1
|
|
47
|
-
generate_tests
|
|
48
|
-
|
|
49
|
-
# generate lib files
|
|
50
|
-
./node_modules/.bin/webpack
|
|
51
|
-
|
|
52
|
-
# Wrap webkit output into an non-breaking form.
|
|
53
|
-
# In an upcoming verion these will be replaced with standard webpack umd
|
|
54
|
-
cat ./tools/template/beautify.begin.js > ./js/lib/beautify.js
|
|
55
|
-
cat ./dist/legacy_beautify_js.js >> ./js/lib/beautify.js
|
|
56
|
-
cat ./tools/template/beautify.end.js >> ./js/lib/beautify.js
|
|
57
|
-
|
|
58
|
-
cat ./tools/template/beautify-css.begin.js > ./js/lib/beautify-css.js
|
|
59
|
-
cat ./dist/legacy_beautify_css.js >> ./js/lib/beautify-css.js
|
|
60
|
-
cat ./tools/template/beautify-css.end.js >> ./js/lib/beautify-css.js
|
|
61
|
-
|
|
62
|
-
cat ./tools/template/beautify-html.begin.js > ./js/lib/beautify-html.js
|
|
63
|
-
cat ./dist/legacy_beautify_html.js >> ./js/lib/beautify-html.js
|
|
64
|
-
cat ./tools/template/beautify-html.end.js >> ./js/lib/beautify-html.js
|
|
65
|
-
|
|
66
|
-
# jshint
|
|
67
|
-
$PROJECT_DIR/node_modules/.bin/jshint 'js/src' 'test' || exit 1
|
|
68
|
-
|
|
69
|
-
# beautify test and data
|
|
70
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/test/amd-beautify-tests.js || exit 1
|
|
71
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/test/node-beautify-html-perf-tests.js || exit 1
|
|
72
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/test/node-beautify-perf-tests.js || exit 1
|
|
73
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/test/node-beautify-tests.js || exit 1
|
|
74
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/test/sanitytest.js || exit 1
|
|
75
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/test/data/css/tests.js || exit 1
|
|
76
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/test/data/html/tests.js || exit 1
|
|
77
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/test/data/javascript/inputlib.js || exit 1
|
|
78
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/test/data/javascript/tests.js || exit 1
|
|
79
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/test/generate-tests.js || exit 1
|
|
80
|
-
|
|
81
|
-
# beautify product code
|
|
82
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/lib/unpackers/javascriptobfuscator_unpacker.js || exit 1
|
|
83
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/lib/unpackers/myobfuscate_unpacker.js || exit 1
|
|
84
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/lib/unpackers/p_a_c_k_e_r_unpacker.js || exit 1
|
|
85
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/lib/unpackers/urlencode_unpacker.js || exit 1
|
|
86
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/src/css/index.js || exit 1
|
|
87
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/src/html/index.js || exit 1
|
|
88
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/src/javascript/index.js || exit 1
|
|
89
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/src/javascript/beautifier.js || exit 1
|
|
90
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/src/javascript/tokenizer.js || exit 1
|
|
91
|
-
|
|
92
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/lib/cli.js || exit 1
|
|
93
|
-
$PROJECT_DIR/js/bin/js-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r $PROJECT_DIR/js/index.js || exit 1
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# html not ready yet
|
|
97
|
-
# $PROJECT_DIR/js/bin/html-beautify.js --config $PROJECT_DIR/jsbeautifyrc -r index.html
|
|
98
|
-
|
|
99
|
-
# jshint again to make sure things haven't changed
|
|
100
|
-
$PROJECT_DIR/node_modules/.bin/jshint 'js/src' 'test' || exit 1
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
generate_tests()
|
|
104
|
-
{
|
|
105
|
-
node test/generate-tests.js || exit 1
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
build_alltest()
|
|
109
|
-
{
|
|
110
|
-
build_jstest
|
|
111
|
-
build_pytest
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
build_pytest()
|
|
115
|
-
{
|
|
116
|
-
echo Testing python implementation...
|
|
117
|
-
generate_tests
|
|
118
|
-
cd python
|
|
119
|
-
python --version
|
|
120
|
-
./jsbeautifier/tests/shell-smoke-test.sh || exit 1
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
build_jstest()
|
|
124
|
-
{
|
|
125
|
-
echo Testing javascript implementation...
|
|
126
|
-
generate_tests
|
|
127
|
-
node --version
|
|
128
|
-
./js/test/shell-smoke-test.sh || exit 1
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
build_git_status()
|
|
132
|
-
{
|
|
133
|
-
$SCRIPT_DIR/git-status-clear.sh || exit 1
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
build_update-codemirror()
|
|
137
|
-
{
|
|
138
|
-
rm -rf node_modules/codemirror
|
|
139
|
-
npm install codemirror
|
|
140
|
-
rm -rf ./web/third-party/codemirror/*
|
|
141
|
-
cp ./node_modules/codemirror/LICENSE ./web/third-party/codemirror/
|
|
142
|
-
cp ./node_modules/codemirror/README.md ./web/third-party/codemirror/
|
|
143
|
-
cp -r ./node_modules/codemirror/lib ./web/third-party/codemirror/
|
|
144
|
-
mkdir -p ./web/third-party/codemirror/mode
|
|
145
|
-
cp -r ./node_modules/codemirror/mode/javascript ./web/third-party/codemirror/mode/
|
|
146
|
-
git add -Av ./web/third-party/codemirror
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
main() {
|
|
150
|
-
cd $PROJECT_DIR
|
|
151
|
-
local ACTION
|
|
152
|
-
ACTION=build_${1:-full}
|
|
153
|
-
if [ -n "$(type -t $ACTION)" ] && [ "$(type -t $ACTION)" = "function" ]; then
|
|
154
|
-
$ACTION
|
|
155
|
-
else
|
|
156
|
-
build_help
|
|
157
|
-
fi
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
(main $*)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
REL_SCRIPT_DIR="`dirname \"$0\"`"
|
|
4
|
-
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
|
|
5
|
-
|
|
6
|
-
# based on https://gist.github.com/joelittlejohn/5937573
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
main()
|
|
10
|
-
{
|
|
11
|
-
cd $SCRIPT_DIR/..
|
|
12
|
-
|
|
13
|
-
if [ "$#" -ne 1 ]; then
|
|
14
|
-
echo "Usage: ./generate-changelog.sh user/repo"
|
|
15
|
-
exit 1
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
jq --version || {
|
|
19
|
-
echo "Required tool 'jq' missing. Failed."
|
|
20
|
-
exit 1
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
gsort --version || {
|
|
24
|
-
echo "Required tool 'gsort' missing. Failed."
|
|
25
|
-
exit 1
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
IFS=$'\n'
|
|
29
|
-
echo "# Changelog" > CHANGELOG.md
|
|
30
|
-
|
|
31
|
-
for m in $(curl -s "https://api.github.com/repos/$1/milestones?state=closed" | jq -c '.[] | [.title, .number, .description]' | gsort -r -V); do
|
|
32
|
-
mid=$(echo $m | sed 's/\[".*",\(.*\),".*"\]/\1/')
|
|
33
|
-
title=$(echo $m | sed 's/\["\(.*\)",.*,".*"\]/\1/')
|
|
34
|
-
|
|
35
|
-
echo "Processing milestone: $title..."
|
|
36
|
-
echo $m | sed 's/\["\(.*\)",.*\]/## \1/' >> CHANGELOG.md
|
|
37
|
-
echo "" >> CHANGELOG.md
|
|
38
|
-
echo '### Description' >> CHANGELOG.md
|
|
39
|
-
echo $m | sed 's/\[".*",.*,"\(.*\)"\]/\1/' | sed -e 's/\\"/"/g' | sed -e 's/\\r\\n/\\n/g' | sed -e 's/\\n/\'$'\n/g' >> CHANGELOG.md
|
|
40
|
-
echo "" >> CHANGELOG.md
|
|
41
|
-
echo '### Closed Issues' >> CHANGELOG.md
|
|
42
|
-
for i in $(curl -s "https://api.github.com/repos/$1/issues?milestone=$mid&state=closed" | jq -c '.[] | [.html_url, .number, .title]'); do
|
|
43
|
-
echo $i | sed 's/\["\(.*\)",\(.*\),\"\(.*\)\"\]/* \3 ([#\2](\1))/' | sed 's/\\"/"/g' >> CHANGELOG.md
|
|
44
|
-
done
|
|
45
|
-
echo "" >> CHANGELOG.md
|
|
46
|
-
echo "" >> CHANGELOG.md
|
|
47
|
-
done
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
(main $*)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
echo "Post-build git status check..."
|
|
2
|
-
echo "Ensuring no changes visible to git have been made to '$*' ..."
|
|
3
|
-
|
|
4
|
-
git status $* | egrep -q 'nothing to commit.*working (directory|tree) clean' || {
|
|
5
|
-
# we should find nothing to commit. If we don't, build has failed.
|
|
6
|
-
echo "ERROR: Post-build git status check - FAILED."
|
|
7
|
-
echo "Git status reported changes to non-git-ignore'd files."
|
|
8
|
-
echo "TO REPRO: Run 'git status $*'. The use git gui or git diff to see what was changed during the build."
|
|
9
|
-
echo "TO FIX: Amend your commit and rebuild. Repeat until git status reports no changes both before and after the build."
|
|
10
|
-
echo "OUTPUT FOR 'git status $*':"
|
|
11
|
-
git status $*
|
|
12
|
-
echo "."
|
|
13
|
-
echo "OUTPUT FOR 'git diff $*':"
|
|
14
|
-
git diff $* | cat -t -e
|
|
15
|
-
exit 1
|
|
16
|
-
}
|
|
17
|
-
echo "Post-build git status check - Succeeded."
|
|
18
|
-
exit 0
|
package/tools/release-all.sh
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
REL_SCRIPT_DIR="`dirname \"$0\"`"
|
|
4
|
-
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
|
|
5
|
-
|
|
6
|
-
case "$OSTYPE" in
|
|
7
|
-
darwin*) PLATFORM="OSX" ;;
|
|
8
|
-
linux*) PLATFORM="LINUX" ;;
|
|
9
|
-
bsd*) PLATFORM="BSD" ;;
|
|
10
|
-
*) PLATFORM="UNKNOWN" ;;
|
|
11
|
-
esac
|
|
12
|
-
|
|
13
|
-
generate_changelog()
|
|
14
|
-
{
|
|
15
|
-
$SCRIPT_DIR/generate-changelog.sh beautify-web/js-beautify || exit 1
|
|
16
|
-
git commit -am "Update Changelog for $NEW_VERSION"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
release_python()
|
|
20
|
-
{
|
|
21
|
-
git clean -xfd || exit 1
|
|
22
|
-
echo "__version__ = '$NEW_VERSION'" > python/jsbeautifier/__version__.py
|
|
23
|
-
git commit -am "Python $NEW_VERSION"
|
|
24
|
-
cd python
|
|
25
|
-
# python setup.py register -r pypi
|
|
26
|
-
python setup.py sdist
|
|
27
|
-
twine upload dist/*
|
|
28
|
-
git push
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
release_node()
|
|
32
|
-
{
|
|
33
|
-
git clean -xfd || exit 1
|
|
34
|
-
npm version $NEW_VERSION
|
|
35
|
-
npm publish .
|
|
36
|
-
git push
|
|
37
|
-
git push --tags
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
release_web()
|
|
41
|
-
{
|
|
42
|
-
local ORIGINAL_BRANCH
|
|
43
|
-
ORIGINAL_BRANCH=$(git branch | grep '[*] .*' | awk '{print $2}')
|
|
44
|
-
git clean -xfd || exit 1
|
|
45
|
-
git fetch || exit 1
|
|
46
|
-
git checkout -B gh-pages origin/gh-pages || exit 1
|
|
47
|
-
git merge origin/master && git push || exit 1
|
|
48
|
-
git checkout $ORIGINAL_BRANCH
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
sedi() {
|
|
52
|
-
if [[ "$PLATFORM" == "OSX" || "$PLATFORM" == "BSD" ]]; then
|
|
53
|
-
sed -i "" $@
|
|
54
|
-
elif [ "$PLATFORM" == "LINUX" ]; then
|
|
55
|
-
sed -i $@
|
|
56
|
-
else
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
update_readme_versions()
|
|
62
|
-
{
|
|
63
|
-
git clean -xfd || exit 1
|
|
64
|
-
sedi -E 's@(cdn.rawgit.+beautify/v)[^/]+@\1'$NEW_VERSION'@' README.md
|
|
65
|
-
sedi -E 's@(cdnjs.cloudflare.+beautify/)[^/]+@\1'$NEW_VERSION'@' README.md
|
|
66
|
-
sedi -E 's/\((README\.md:.js-beautify@).+\)/(\1'$NEW_VERSION')/' README.md
|
|
67
|
-
git add README.md
|
|
68
|
-
git commit -m "Bump version numbers in README.md"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
main()
|
|
72
|
-
{
|
|
73
|
-
cd $SCRIPT_DIR/..
|
|
74
|
-
|
|
75
|
-
local NEW_VERSION=$1
|
|
76
|
-
NEW_VERSION=$1
|
|
77
|
-
|
|
78
|
-
git checkout master
|
|
79
|
-
|
|
80
|
-
generate_changelog
|
|
81
|
-
update_readme_versions
|
|
82
|
-
(release_python)
|
|
83
|
-
release_node
|
|
84
|
-
release_web
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
(main $*)
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
|
|
2
|
-
/* AUTO-GENERATED. DO NOT MODIFY. */
|
|
3
|
-
/*
|
|
4
|
-
|
|
5
|
-
The MIT License (MIT)
|
|
6
|
-
|
|
7
|
-
Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person
|
|
10
|
-
obtaining a copy of this software and associated documentation files
|
|
11
|
-
(the "Software"), to deal in the Software without restriction,
|
|
12
|
-
including without limitation the rights to use, copy, modify, merge,
|
|
13
|
-
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
14
|
-
and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be
|
|
18
|
-
included in all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
22
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
24
|
-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
25
|
-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
26
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
CSS Beautifier
|
|
31
|
-
---------------
|
|
32
|
-
|
|
33
|
-
Written by Harutyun Amirjanyan, (amirjanyan@gmail.com)
|
|
34
|
-
|
|
35
|
-
Based on code initially developed by: Einar Lielmanis, <einar@jsbeautifier.org>
|
|
36
|
-
http://jsbeautifier.org/
|
|
37
|
-
|
|
38
|
-
Usage:
|
|
39
|
-
css_beautify(source_text);
|
|
40
|
-
css_beautify(source_text, options);
|
|
41
|
-
|
|
42
|
-
The options are (default in brackets):
|
|
43
|
-
indent_size (4) — indentation size,
|
|
44
|
-
indent_char (space) — character to indent with,
|
|
45
|
-
selector_separator_newline (true) - separate selectors with newline or
|
|
46
|
-
not (e.g. "a,\nbr" or "a, br")
|
|
47
|
-
end_with_newline (false) - end with a newline
|
|
48
|
-
newline_between_rules (true) - add a new line after every css rule
|
|
49
|
-
space_around_selector_separator (false) - ensure space around selector separators:
|
|
50
|
-
'>', '+', '~' (e.g. "a>b" -> "a > b")
|
|
51
|
-
e.g
|
|
52
|
-
|
|
53
|
-
css_beautify(css_source_text, {
|
|
54
|
-
'indent_size': 1,
|
|
55
|
-
'indent_char': '\t',
|
|
56
|
-
'selector_separator': ' ',
|
|
57
|
-
'end_with_newline': false,
|
|
58
|
-
'newline_between_rules': true,
|
|
59
|
-
'space_around_selector_separator': true
|
|
60
|
-
});
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
// http://www.w3.org/TR/CSS21/syndata.html#tokenization
|
|
64
|
-
// http://www.w3.org/TR/css3-syntax/
|
|
65
|
-
|
|
66
|
-
(function() {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var css_beautify = legacy_beautify_css;
|
|
3
|
-
/* Footer */
|
|
4
|
-
if (typeof define === "function" && define.amd) {
|
|
5
|
-
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
6
|
-
define([], function() {
|
|
7
|
-
return {
|
|
8
|
-
css_beautify: css_beautify
|
|
9
|
-
};
|
|
10
|
-
});
|
|
11
|
-
} else if (typeof exports !== "undefined") {
|
|
12
|
-
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
13
|
-
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
|
14
|
-
exports.css_beautify = css_beautify;
|
|
15
|
-
} else if (typeof window !== "undefined") {
|
|
16
|
-
// If we're running a web page and don't have either of the above, add our one global
|
|
17
|
-
window.css_beautify = css_beautify;
|
|
18
|
-
} else if (typeof global !== "undefined") {
|
|
19
|
-
// If we don't even have window, try global.
|
|
20
|
-
global.css_beautify = css_beautify;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}());
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
|
|
2
|
-
/* AUTO-GENERATED. DO NOT MODIFY. */
|
|
3
|
-
/*
|
|
4
|
-
|
|
5
|
-
The MIT License (MIT)
|
|
6
|
-
|
|
7
|
-
Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person
|
|
10
|
-
obtaining a copy of this software and associated documentation files
|
|
11
|
-
(the "Software"), to deal in the Software without restriction,
|
|
12
|
-
including without limitation the rights to use, copy, modify, merge,
|
|
13
|
-
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
14
|
-
and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be
|
|
18
|
-
included in all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
22
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
24
|
-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
25
|
-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
26
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Style HTML
|
|
31
|
-
---------------
|
|
32
|
-
|
|
33
|
-
Written by Nochum Sossonko, (nsossonko@hotmail.com)
|
|
34
|
-
|
|
35
|
-
Based on code initially developed by: Einar Lielmanis, <einar@jsbeautifier.org>
|
|
36
|
-
http://jsbeautifier.org/
|
|
37
|
-
|
|
38
|
-
Usage:
|
|
39
|
-
style_html(html_source);
|
|
40
|
-
|
|
41
|
-
style_html(html_source, options);
|
|
42
|
-
|
|
43
|
-
The options are:
|
|
44
|
-
indent_inner_html (default false) — indent <head> and <body> sections,
|
|
45
|
-
indent_size (default 4) — indentation size,
|
|
46
|
-
indent_char (default space) — character to indent with,
|
|
47
|
-
wrap_line_length (default 250) - maximum amount of characters per line (0 = disable)
|
|
48
|
-
brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none"
|
|
49
|
-
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
|
|
50
|
-
unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted
|
|
51
|
-
content_unformatted (defaults to pre tag) - list of tags, that its content shouldn't be reformatted
|
|
52
|
-
indent_scripts (default normal) - "keep"|"separate"|"normal"
|
|
53
|
-
preserve_newlines (default true) - whether existing line breaks before elements should be preserved
|
|
54
|
-
Only works before elements, not inside tags or for text.
|
|
55
|
-
max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk
|
|
56
|
-
indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}}
|
|
57
|
-
end_with_newline (false) - end with a newline
|
|
58
|
-
extra_liners (default [head,body,/html]) -List of tags that should have an extra newline before them.
|
|
59
|
-
|
|
60
|
-
e.g.
|
|
61
|
-
|
|
62
|
-
style_html(html_source, {
|
|
63
|
-
'indent_inner_html': false,
|
|
64
|
-
'indent_size': 2,
|
|
65
|
-
'indent_char': ' ',
|
|
66
|
-
'wrap_line_length': 78,
|
|
67
|
-
'brace_style': 'expand',
|
|
68
|
-
'preserve_newlines': true,
|
|
69
|
-
'max_preserve_newlines': 5,
|
|
70
|
-
'indent_handlebars': false,
|
|
71
|
-
'extra_liners': ['/html']
|
|
72
|
-
});
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
(function() {
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var style_html = legacy_beautify_html;
|
|
3
|
-
/* Footer */
|
|
4
|
-
if (typeof define === "function" && define.amd) {
|
|
5
|
-
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
6
|
-
define(["require", "./beautify", "./beautify-css"], function(requireamd) {
|
|
7
|
-
var js_beautify = requireamd("./beautify");
|
|
8
|
-
var css_beautify = requireamd("./beautify-css");
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
html_beautify: function(html_source, options) {
|
|
12
|
-
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
} else if (typeof exports !== "undefined") {
|
|
17
|
-
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
18
|
-
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
|
19
|
-
var js_beautify = require('./beautify.js');
|
|
20
|
-
var css_beautify = require('./beautify-css.js');
|
|
21
|
-
|
|
22
|
-
exports.html_beautify = function(html_source, options) {
|
|
23
|
-
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
|
24
|
-
};
|
|
25
|
-
} else if (typeof window !== "undefined") {
|
|
26
|
-
// If we're running a web page and don't have either of the above, add our one global
|
|
27
|
-
window.html_beautify = function(html_source, options) {
|
|
28
|
-
return style_html(html_source, options, window.js_beautify, window.css_beautify);
|
|
29
|
-
};
|
|
30
|
-
} else if (typeof global !== "undefined") {
|
|
31
|
-
// If we don't even have window, try global.
|
|
32
|
-
global.html_beautify = function(html_source, options) {
|
|
33
|
-
return style_html(html_source, options, global.js_beautify, global.css_beautify);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}());
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
|
|
2
|
-
/* AUTO-GENERATED. DO NOT MODIFY. */
|
|
3
|
-
/* see js/src/javascript/index.js */
|
|
4
|
-
/*
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person
|
|
11
|
-
obtaining a copy of this software and associated documentation files
|
|
12
|
-
(the "Software"), to deal in the Software without restriction,
|
|
13
|
-
including without limitation the rights to use, copy, modify, merge,
|
|
14
|
-
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
15
|
-
and to permit persons to whom the Software is furnished to do so,
|
|
16
|
-
subject to the following conditions:
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be
|
|
19
|
-
included in all copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
22
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
23
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
24
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
25
|
-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
26
|
-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
SOFTWARE.
|
|
29
|
-
|
|
30
|
-
JS Beautifier
|
|
31
|
-
---------------
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Written by Einar Lielmanis, <einar@jsbeautifier.org>
|
|
35
|
-
http://jsbeautifier.org/
|
|
36
|
-
|
|
37
|
-
Originally converted to javascript by Vital, <vital76@gmail.com>
|
|
38
|
-
"End braces on own line" added by Chris J. Shull, <chrisjshull@gmail.com>
|
|
39
|
-
Parsing improvements for brace-less statements by Liam Newman <bitwiseman@gmail.com>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Usage:
|
|
43
|
-
js_beautify(js_source_text);
|
|
44
|
-
js_beautify(js_source_text, options);
|
|
45
|
-
|
|
46
|
-
The options are:
|
|
47
|
-
indent_size (default 4) - indentation size,
|
|
48
|
-
indent_char (default space) - character to indent with,
|
|
49
|
-
preserve_newlines (default true) - whether existing line breaks should be preserved,
|
|
50
|
-
max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,
|
|
51
|
-
|
|
52
|
-
jslint_happy (default false) - if true, then jslint-stricter mode is enforced.
|
|
53
|
-
|
|
54
|
-
jslint_happy !jslint_happy
|
|
55
|
-
---------------------------------
|
|
56
|
-
function () function()
|
|
57
|
-
|
|
58
|
-
switch () { switch() {
|
|
59
|
-
case 1: case 1:
|
|
60
|
-
break; break;
|
|
61
|
-
} }
|
|
62
|
-
|
|
63
|
-
space_after_anon_function (default false) - should the space before an anonymous function's parens be added, "function()" vs "function ()",
|
|
64
|
-
NOTE: This option is overriden by jslint_happy (i.e. if jslint_happy is true, space_after_anon_function is true by design)
|
|
65
|
-
|
|
66
|
-
brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" | any of the former + ",preserve-inline"
|
|
67
|
-
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
|
|
68
|
-
preserve-inline will try to preserve inline blocks of curly braces
|
|
69
|
-
|
|
70
|
-
space_before_conditional (default true) - should the space before conditional statement be added, "if(true)" vs "if (true)",
|
|
71
|
-
|
|
72
|
-
unescape_strings (default false) - should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
|
|
73
|
-
|
|
74
|
-
wrap_line_length (default unlimited) - lines should wrap at next opportunity after this number of characters.
|
|
75
|
-
NOTE: This is not a hard limit. Lines will continue until a point where a newline would
|
|
76
|
-
be preserved if it were present.
|
|
77
|
-
|
|
78
|
-
end_with_newline (default false) - end output with a newline
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
e.g
|
|
82
|
-
|
|
83
|
-
js_beautify(js_source_text, {
|
|
84
|
-
'indent_size': 1,
|
|
85
|
-
'indent_char': '\t'
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
(function() {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var js_beautify = legacy_beautify_js;
|
|
3
|
-
/* Footer */
|
|
4
|
-
if (typeof define === "function" && define.amd) {
|
|
5
|
-
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
6
|
-
define([], function() {
|
|
7
|
-
return { js_beautify: js_beautify };
|
|
8
|
-
});
|
|
9
|
-
} else if (typeof exports !== "undefined") {
|
|
10
|
-
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
11
|
-
// and you will be able to `var js_beautify = require("beautify").js_beautify`.
|
|
12
|
-
exports.js_beautify = js_beautify;
|
|
13
|
-
} else if (typeof window !== "undefined") {
|
|
14
|
-
// If we're running a web page and don't have either of the above, add our one global
|
|
15
|
-
window.js_beautify = js_beautify;
|
|
16
|
-
} else if (typeof global !== "undefined") {
|
|
17
|
-
// If we don't even have window, try global.
|
|
18
|
-
global.js_beautify = js_beautify;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}());
|
package/webpack.config.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var path = require('path');
|
|
2
|
-
|
|
3
|
-
var legacy_js = {
|
|
4
|
-
entry: './js/src/javascript/index.js',
|
|
5
|
-
resolve: {
|
|
6
|
-
modules: [ path.resolve(__dirname, "js/src") ]
|
|
7
|
-
},
|
|
8
|
-
output: {
|
|
9
|
-
library: 'legacy_beautify_js',
|
|
10
|
-
filename: 'legacy_beautify_js.js',
|
|
11
|
-
path: path.resolve(__dirname, 'dist')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var legacy_css = {
|
|
17
|
-
entry: './js/src/css/index.js',
|
|
18
|
-
resolve: {
|
|
19
|
-
modules: [ path.resolve(__dirname, "js/src") ]
|
|
20
|
-
},
|
|
21
|
-
output: {
|
|
22
|
-
library: 'legacy_beautify_css',
|
|
23
|
-
filename: 'legacy_beautify_css.js',
|
|
24
|
-
path: path.resolve(__dirname, 'dist')
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var legacy_html = {
|
|
29
|
-
entry: './js/src/html/index.js',
|
|
30
|
-
resolve: {
|
|
31
|
-
modules: [ path.resolve(__dirname, "js/src") ]
|
|
32
|
-
},
|
|
33
|
-
output: {
|
|
34
|
-
library: 'legacy_beautify_html',
|
|
35
|
-
filename: 'legacy_beautify_html.js',
|
|
36
|
-
path: path.resolve(__dirname, 'dist')
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var dist_full = {
|
|
42
|
-
entry: './js/src/index.js',
|
|
43
|
-
output: {
|
|
44
|
-
library: 'beautifier',
|
|
45
|
-
libraryTarget: 'umd',
|
|
46
|
-
umdNamedDefine: true,
|
|
47
|
-
filename: 'beautifier.js',
|
|
48
|
-
path: path.resolve(__dirname, 'dist')
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
module.exports = [dist_full, legacy_js, legacy_css, legacy_html];
|