Skip to content

Commit 36ff0cb

Browse files
committed
Inception of a fork of YUI Compressor.
First step: mavenizing the project into the context of Silverpeas.
1 parent 958491d commit 36ff0cb

File tree

9 files changed

+276
-199
lines changed

9 files changed

+276
-199
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ build/build_tmp
1414
build/yuicompressor*.jar
1515
.project
1616
.classpath
17+
*.iml
18+
.idea
19+
.idea/
20+
silverpeas-ui-compressor-*.jar

README.md

Lines changed: 14 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,31 @@
1-
YUI Compressor - The Yahoo! JavaScript and CSS Compressor
1+
Silverpeas's UI Compressor - The Silverpeas JavaScript and CSS Compressor
22
=========================================================
33

4-
The YUI Compressor is a JavaScript compressor which, in addition to removing
4+
The Silverpeas's UI Compressor is a fork of YUI Compressor which is a JavaScript compressor which, in addition to removing
55
comments and white-spaces, obfuscates local variables using the smallest
66
possible variable name. This obfuscation is safe, even when using constructs
77
such as 'eval' or 'with' (although the compression is not optimal in those
8-
cases) Compared to jsmin, the average savings is around 20%.
8+
cases).
99

10-
The YUI Compressor is also able to safely compress CSS files. The decision
10+
It is also able to safely compress CSS files. The decision
1111
on which compressor is being used is made on the file extension (js or css)
1212

1313
Building
1414
--------
1515

16-
ant
16+
mvn clean install
1717

1818
Testing
1919
-------
2020

2121
./tests/suite.sh
2222

2323

24-
Node.js Package
25-
---------------
26-
27-
You can require compressor in a Node.js package and compress files and strings in async.
28-
_It still uses Java under the hood_
29-
30-
npm i yuicompressor
31-
32-
```javascript
33-
34-
var compressor = require('yuicompressor');
35-
36-
compressor.compress('/path/to/file or String of JS', {
37-
//Compressor Options:
38-
charset: 'utf8',
39-
type: 'js',
40-
nomunge: true,
41-
'line-break': 80
42-
}, function(err, data, extra) {
43-
//err If compressor encounters an error, it's stderr will be here
44-
//data The compressed string, you write it out where you want it
45-
//extra The stderr (warnings are printed here in case you want to echo them
46-
});
47-
48-
```
49-
50-
Options:
51-
* `charset` // defaults to 'utf8'
52-
* `type` // defaults to 'js'
53-
* `line-break`
54-
* `nomunge`
55-
* `preserve-semi`
56-
* `disable-optimizations`
57-
58-
59-
TODO
60-
----
61-
62-
* Better Docs
63-
* Help Pages
64-
65-
Build Status
66-
------------
67-
68-
[![Build Status](https://secure.travis-ci.org/yui/yuicompressor.svg?branch=master)](http://travis-ci.org/yui/yuicompressor)
69-
70-
7124
Global Options
7225
--------------
7326

7427
-h, --help
75-
Prints help on how to use the YUI Compressor
28+
Prints help on how to use the Silverpeas's UI Compressor
7629

7730
--line-break
7831
Some source control tools don't like files containing lines longer than,
@@ -89,18 +42,18 @@ Global Options
8942
required if the input file extension is neither 'js' nor 'css'.
9043

9144
--charset character-set
92-
If a supported character set is specified, the YUI Compressor will use it
45+
If a supported character set is specified, the Silverpeas's UI Compressor will use it
9346
to read the input file. Otherwise, it will assume that the platform's
9447
default character set is being used. The output file is encoded using
9548
the same character set.
9649

9750
-o outfile
9851

99-
Place output in file outfile. If not specified, the YUI Compressor will
52+
Place output in file outfile. If not specified, the Silverpeas's UI Compressor will
10053
default to the standard output, which you can redirect to a file.
10154
Supports a filter syntax for expressing the output pattern when there are
10255
multiple input files. ex:
103-
java -jar yuicompressor.jar -o '.css$:-min.css' *.css
56+
java -jar silverpeas-ui-compressor.jar -o '.css$:-min.css' *.css
10457
... will minify all .css files and save them as -min.css
10558

10659
-v, --verbose
@@ -114,8 +67,7 @@ JavaScript Only Options
11467

11568
--preserve-semi
11669
Preserve unnecessary semicolons (such as right before a '}') This option
117-
is useful when compressed code has to be run through JSLint (which is the
118-
case of YUI for example)
70+
is useful when compressed code has to be run through JSLint
11971

12072
--disable-optimizations
12173
Disable all the built-in micro optimizations.
@@ -127,7 +79,7 @@ Notes
12779

12880
* Supports wildcards for specifying multiple input files.
12981

130-
* The YUI Compressor requires Java version >= 1.5.
82+
* The Silverpeas's UI Compressor requires Java version >= 1.8.
13183

13284
* It is possible to prevent a local variable, nested function or function
13385
argument from being obfuscated by using "hints". A hint is a string that
@@ -152,7 +104,7 @@ The hint itself disappears from the compressed file.
152104

153105
* C-style comments starting with `/*!` are preserved. This is useful with
154106
comments containing copyright/license information. As of 2.4.8, the '!'
155-
is no longer dropped by YUICompressor. For example:
107+
is no longer dropped by Silverpeas's UI Compressor. For example:
156108

157109
```
158110
/*!
@@ -162,12 +114,12 @@ The hint itself disappears from the compressed file.
162114
*/
163115
```
164116

165-
remains in the output, untouched by YUICompressor.
117+
remains in the output, untouched by Silverpeas's UI Compressor.
166118

167119
Modified Rhino Files
168120
--------------------
169121

170-
YUI Compressor uses a modified version of the Rhino library
122+
Silverpeas's UI Compressor uses a modified version of the Rhino library
171123
(http://www.mozilla.org/rhino/) The changes were made to support
172124
JScript conditional comments, preserved comments, unescaped slash
173125
characters in regular expressions, and to allow for the optimization

ant.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.

build.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
<?xml version="1.0" encoding="iso-8859-1"?>
22
<project name="YUI Compressor" default="build.jar" basedir=".">
33

4-
<target name="clean" depends="-load.properties">
4+
<target name="clean">
55
<delete dir="${build.dir}" quiet="true"/>
66
</target>
77

8-
<target name="-load.properties">
9-
<property file="ant.properties"/>
10-
</target>
11-
12-
<target name="-init" depends="-load.properties">
8+
<target name="-init">
139
<delete dir="${build.dir}"/>
1410
<mkdir dir="${build.dir}"/>
1511
</target>
@@ -33,8 +29,8 @@
3329
deprecation="off"
3430
debug="on"
3531
includeantruntime="false"
36-
target="1.5"
37-
source="1.5">
32+
target="1.8"
33+
source="1.8">
3834
<classpath>
3935
<pathelement location="${lib.dir}/jargs-1.0.jar"/>
4036
<pathelement location="${lib.dir}/rhino-1.7R2.jar"/>

maven_central/build.xml

Lines changed: 0 additions & 52 deletions
This file was deleted.

maven_central/template/pom.xml.template

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)