Skip to content

Commit

Permalink
Reorganize file structure by language/platform
Browse files Browse the repository at this point in the history
Moved all files that are specifically for the website into web (except for index.htm)
Moved all files that are javascript (for node or web) into js
Organized js folder to generally follow node structures

This change also changes .npmignore to include unpackers in the package.
First step on #224.
  • Loading branch information
bitwiseman committed Apr 4, 2013
1 parent 1768f57 commit 9de057f
Show file tree
Hide file tree
Showing 204 changed files with 56 additions and 58 deletions.
6 changes: 1 addition & 5 deletions .npmignore
@@ -1,9 +1,5 @@
Makefile
attic/
favicon.png
index.html
jquery/
php/
python/
third-party/
unpackers/
web/
12 changes: 6 additions & 6 deletions Makefile
Expand Up @@ -34,15 +34,15 @@ testj:

edit:
vim \
beautify.js python/jsbeautifier/__init__.py \
tests/beautify-tests.js python/jsbeautifier/tests/testjsbeautifier.py
js/lib/beautify.js python/jsbeautifier/__init__.py \
js/test/beautify-tests.js python/jsbeautifier/tests/testjsbeautifier.py

gedit:
gvim \
beautify.js \
tests/beautify-tests.js \
python/jsbeautifier/__init__.py \
python/jsbeautifier/tests/testjsbeautifier.py &
js/lib/beautify.js \
js/test/beautify-tests.js \
js/python/jsbeautifier/__init__.py \
js/python/jsbeautifier/tests/testjsbeautifier.py &

tests: testj testp

Expand Down
4 changes: 0 additions & 4 deletions bin/css-beautify.js

This file was deleted.

4 changes: 0 additions & 4 deletions bin/html-beautify.js

This file was deleted.

4 changes: 0 additions & 4 deletions bin/js-beautify.js

This file was deleted.

34 changes: 17 additions & 17 deletions index.html
Expand Up @@ -32,10 +32,10 @@
<head>
<meta charset="utf-8">
<title>Online JavaScript beautifier</title>
<link rel="icon" href="favicon.png" type="image/png">
<script src="third-party/codemirror2/lib/codemirror.js"></script>
<script src="third-party/codemirror2/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="third-party/codemirror2/lib/codemirror.css">
<link rel="icon" href="web/favicon.png" type="image/png">
<script src="web/third-party/codemirror/lib/codemirror.js"></script>
<script src="web/third-party/codemirror/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="web/third-party/codemirror/lib/codemirror.css">

<style>

Expand Down Expand Up @@ -137,19 +137,19 @@
}

</style>
<script src="third-party/jquery/jquery.js"></script>
<script src="third-party/jquery/jquery.cookie.js"></script>


<script src="beautify.js"></script>
<script src="beautify-css.js"></script>
<script src="beautify-html.js"></script>
<script src="tests/sanitytest.js"></script>
<script src="tests/beautify-tests.js"></script>
<script src="unpackers/javascriptobfuscator_unpacker.js"></script>
<script src="unpackers/urlencode_unpacker.js"></script>
<script src="unpackers/p_a_c_k_e_r_unpacker.js"></script>
<script src="unpackers/myobfuscate_unpacker.js"></script>
<script src="web/third-party/jquery/jquery.js"></script>
<script src="web/third-party/jquery/jquery.cookie.js"></script>


<script src="js/lib/beautify.js"></script>
<script src="js/lib/beautify-css.js"></script>
<script src="js/lib/beautify-html.js"></script>
<script src="js/test/sanitytest.js"></script>
<script src="js/test/beautify-tests.js"></script>
<script src="js/lib/unpackers/javascriptobfuscator_unpacker.js"></script>
<script src="js/lib/unpackers/urlencode_unpacker.js"></script>
<script src="js/lib/unpackers/p_a_c_k_e_r_unpacker.js"></script>
<script src="js/lib/unpackers/myobfuscate_unpacker.js"></script>

<script>

Expand Down
4 changes: 4 additions & 0 deletions js/bin/css-beautify.js
@@ -0,0 +1,4 @@
#!/usr/bin/env node
var cli = require('../lib/cli'); cli.interpret();


4 changes: 4 additions & 0 deletions js/bin/html-beautify.js
@@ -0,0 +1,4 @@
#!/usr/bin/env node
var cli = require('../lib/cli'); cli.interpret();


4 changes: 4 additions & 0 deletions js/bin/js-beautify.js
@@ -0,0 +1,4 @@
#!/usr/bin/env node
var cli = require('../lib/cli'); cli.interpret();


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions cli.js → js/lib/cli.js
Expand Up @@ -38,7 +38,7 @@ var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG

var fs = require('fs'),
cc = require('config-chain'),
beautify = require('./index'),
beautify = require('../index'),
nopt = require('nopt'),
path = require('path'),
knownOpts = {
Expand Down Expand Up @@ -113,7 +113,7 @@ var interpret = exports.interpret = function (argv, slice) {
var parsed = nopt(knownOpts, shortHands, argv, slice);

if (parsed.version) {
console.log(require('./package.json').version);
console.log(require(__dirname + '/../../package.json').version);
process.exit(0);
}
else if (parsed.help) {
Expand All @@ -126,7 +126,7 @@ var interpret = exports.interpret = function (argv, slice) {
cleanOptions(cc.env('jsbeautify_'), knownOpts),
parsed.config,
cc.find('.jsbeautifyrc'),
__dirname + '/config/defaults.json'
__dirname + '/../config/defaults.json'
).snapshot;

try {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,12 +9,12 @@
// if (Urlencoded.detect(some_string)) {
// var unpacked = Urlencoded.unpack(some_string);
// }
//
//
//

var isNode = (typeof module !== 'undefined' && module.exports);
if (isNode) {
var SanityTest = require(__dirname + '/../tests/sanitytest');
var SanityTest = require(__dirname + '/../../test/sanitytest');
}

var Urlencoded = {
Expand Down
File renamed without changes.
Expand Up @@ -2,8 +2,8 @@
/*jshint node:true */

var SanityTest = require('./sanitytest'),
Urlencoded = require('../unpackers/urlencode_unpacker'),
js_beautify = require('../beautify').js_beautify,
Urlencoded = require('../lib/unpackers/urlencode_unpacker'),
js_beautify = require('../lib/beautify').js_beautify,
run_beautifier_tests = require('./beautify-tests').run_beautifier_tests;

function node_beautifier_tests() {
Expand Down
10 changes: 5 additions & 5 deletions tests/run-tests → js/test/run-tests
Expand Up @@ -5,13 +5,13 @@
// a little helper for testing from command line
// just run it, it will output the test results

load('beautify.js');
load('tests/sanitytest.js')
load('tests/beautify-tests.js')
load('unpackers/urlencode_unpacker.js')
load('js/lib/beautify.js');
load('js/test/sanitytest.js')
load('js/test/beautify-tests.js')
load('js/lib/unpackers/urlencode_unpacker.js')

print(run_beautifier_tests().results_raw())


// for nodejs use this from the command line from the main directory:
// node tests/beautify-tests.js
// node test/beautify-tests.js
File renamed without changes.
14 changes: 8 additions & 6 deletions package.json
Expand Up @@ -2,18 +2,20 @@
"name": "js-beautify",
"version": "1.2.0",
"description": "jsbeautifier.org for node",
"main": "index.js",
"main": "js/index.js",
"preferGlobal": true,
"bin": {
"css-beautify": "./bin/css-beautify.js",
"html-beautify": "./bin/html-beautify.js",
"js-beautify": "./bin/js-beautify.js"
"css-beautify": "./js/bin/css-beautify.js",
"html-beautify": "./js/bin/html-beautify.js",
"js-beautify": "./js/bin/js-beautify.js"
},
"directories": {
"test": "tests"
"lib": "js/lib",
"test": "js/test"

},
"scripts": {
"test": "node ./tests/node-beautify-tests.js"
"test": "node ./js/test/node-beautify-tests.js"
},
"bugs": "https://github.com/einars/js-beautify/issues",
"homepage": "http://jsbeautifier.org/",
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9de057f

Please sign in to comment.