Skip to content

Commit ece5b41

Browse files
committed
Migrate files to NUglify name to allow to publish to NuGet
1 parent e815d20 commit ece5b41

File tree

273 files changed

+823
-805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+823
-805
lines changed

doc/readme.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Microsoft Ajax Minifier by default will try to reduce the code as much as possib
4848
Command-Line Usage
4949
==================
5050

51-
Simply running AjaxMin without any parameters, or with the -? or /? switches, will display the command line usage. The bare minimum needed to minify a source file is the input file name:
51+
Simply running NUglify without any parameters, or with the -? or /? switches, will display the command line usage. The bare minimum needed to minify a source file is the input file name:
5252

5353
```
5454
ajaxmin inputfile.js
@@ -104,7 +104,7 @@ The other options are less used. The -SILENT option is useful only when saving t
104104

105105
The –TERM option adds a semicolon to the end of the minified stream. This can be useful if you need to later append multiple minified files together into a single file using a separate process.
106106

107-
The –DEBUG option is for specifying how to handle debug-related statements. By default, AjaxMin will remove debug-related statements: debugger, for instance. Statements constituting calls to the debug namespaces of a couple well-known libraries will also be culled. These namespaces are Web.Debug, Msn.Debug, Debug and $Debug. Calls to the WAssert function will also be stripped. If the calls are part of a constructor, the constructor will be replaced with an Object constructor. For example, this code:
107+
The –DEBUG option is for specifying how to handle debug-related statements. By default, NUglify will remove debug-related statements: debugger, for instance. Statements constituting calls to the debug namespaces of a couple well-known libraries will also be culled. These namespaces are Web.Debug, Msn.Debug, Debug and $Debug. Calls to the WAssert function will also be stripped. If the calls are part of a constructor, the constructor will be replaced with an Object constructor. For example, this code:
108108

109109
```
110110
debugger;
@@ -311,7 +311,7 @@ if(!foo.bar())alert("not foo.bar()");
311311
if(a)alert("a");
312312
```
313313
314-
Although it may seem like a silly bit of code to write, sometimes the author of the source script will actually have statements in the true-block that get removed by AjaxMin; for instance, if the statements are debug-only statements.
314+
Although it may seem like a silly bit of code to write, sometimes the author of the source script will actually have statements in the true-block that get removed by NUglify; for instance, if the statements are debug-only statements.
315315
316316
If there are var statements immediately preceding a for statement, there are several situations where the statements will be combined, depending on the structure of the for statement’s initializer component. If the initializer is empty, the var statement will simply be moved into the for statement’s initializer:
317317
@@ -425,7 +425,7 @@ Local Variable and Function Renaming
425425
426426
Local function and variable names are renamed to shorter names, while global functions are left alone. Function scope chains are respected, so global and outer variable references are carried through without interruption or interference. Within a local scope, variables and functions are renamed starting with lower-case letters, then upper-case letters, then combinations thereof. Those with the most references are named first, thereby attempting to make the biggest gains for those fields that are referenced most frequently.
427427
428-
Another aspect of AjaxMin is reference counting and tracking. This is used to remove some unused code. For example, if a function defines arguments that are never referenced, they are removed from the tail of the argument list:
428+
Another aspect of NUglify is reference counting and tracking. This is used to remove some unused code. For example, if a function defines arguments that are never referenced, they are removed from the tail of the argument list:
429429
430430
```js
431431
function DivideTwoNumbers(numerator, denominator, unsedparameter )
@@ -525,7 +525,7 @@ One aspect of minification can be seen as either good or bad, depending on wheth
525525
Conditional Compilation Comments
526526
================================
527527
528-
AjaxMin supports only a subset of conditional compilation comments. The @cc_on, @if, and @set statements are supported – it’s *where* they are in your code that determines whether or not they will be passed through to the output.
528+
NUglify supports only a subset of conditional compilation comments. The @cc_on, @if, and @set statements are supported – it’s *where* they are in your code that determines whether or not they will be passed through to the output.
529529
530530
In general, statement-level conditional comments are supported. For instance, if you had the following code:
531531
@@ -560,7 +560,7 @@ var ie/\*@cc_on=1@\*/;alert(ie?"Internet Explorer":"NOT Internet Explorer")
560560
561561
The rule here is that both the equals-sign and the initializer – but nothing else – must be included in the conditional-compilation comment. Anything else will be ignored.
562562
563-
Conditional-compilation comments in general are *not* supported by AjaxMin within JavaScript expressions. However, if a conditional-compilation comment is encountered inside an expression, and the comment contains only a single conditional-compilation variable reference, the comment will be retained. Anything else and it will be ignored. So for instance:
563+
Conditional-compilation comments in general are *not* supported by NUglify within JavaScript expressions. However, if a conditional-compilation comment is encountered inside an expression, and the comment contains only a single conditional-compilation variable reference, the comment will be retained. Anything else and it will be ignored. So for instance:
564564
565565
```js
566566
//@set @fourteen = 14
@@ -587,7 +587,7 @@ Will have the comment ignored and simply become:
587587
var isMSIE=0
588588
```
589589
590-
because the comment contains an operator and not a variable reference. Remember the general rule: use conditional-compilation comments at a statement level and AjaxMin should always retain them.
590+
because the comment contains an operator and not a variable reference. Remember the general rule: use conditional-compilation comments at a statement level and NUglify should always retain them.
591591
592592
Variable Renaming With and Eval Statements – Not!
593593
==================================================
@@ -612,7 +612,7 @@ The eval statement marks its containing scope as “unknown.” Scopes that are
612612
613613
In the with statement example above, if we were to change the variable “foo” to “a” and the window object doesn’t contain a “foo” property, we’ve broken the link to the local variable. And if we also change the parameter to the alert function, we could be breaking the link to a foo property on the window object. Every variable and function referenced within a with-scope must remain the same name because we just don’t know.
614614
615-
If you must use eval and with statements, try to isolate them into small scopes under the global level that are tightly coded without long variable or function names. In general, these statements are frowned upon by most JavaScript developers anyway, and the use of them will throw a level 4 warning in AjaxMin.
615+
If you must use eval and with statements, try to isolate them into small scopes under the global level that are tightly coded without long variable or function names. In general, these statements are frowned upon by most JavaScript developers anyway, and the use of them will throw a level 4 warning in NUglify.
616616
617617
Analyzing Your Script
618618
=====================
@@ -774,7 +774,7 @@ var MyScope = new function()
774774
775775
In this code, MyScope is a global field and will therefore not be renamed, but every other variable and function will be renamed since they are all local to the MyScope object. Properties are not local fields and are therefore also not renamed; so the MyScope object will continue have the property “Status” and the methods “Start” and “Stop.” The variables “my” and “requestObject,” the argument “url,” and the helper functions “startRequest” and “cancelRequest” are all local and will be renamed. They can be as long and semantic as readability requires without having any impact on the client download performance. JavaScript code outside this module (or even within) can call the public methods and properties as MyScope.Status, MyScope.Start or MyScope.Stop. The internal local variables and functions are essentially private and not exposed to any other code outside the MyScope object.
776776
777-
The “my” local field is not necessary, but it’s a very valuable shortcut for these types of namespace objects. The “my” variable will be renamed, most-likely to a single character. If the developer instead used the this literal everywhere, it would not get renamed and would remain at four characters everywhere it is used. AjaxMin will take create a local variable, set it to the this pointer, and use that variable wherever the this pointer is used. It will only do this, however, within the scope directly applicable to the this pointer; it won’t propagate the generated local variable into child scopes because the context of the this pointer in child functions may not be the same.
777+
The “my” local field is not necessary, but it’s a very valuable shortcut for these types of namespace objects. The “my” variable will be renamed, most-likely to a single character. If the developer instead used the this literal everywhere, it would not get renamed and would remain at four characters everywhere it is used. NUglify will take create a local variable, set it to the this pointer, and use that variable wherever the this pointer is used. It will only do this, however, within the scope directly applicable to the this pointer; it won’t propagate the generated local variable into child scopes because the context of the this pointer in child functions may not be the same.
778778
779779
Namespaces can be nested. At the Msn Portals team, we typically define our namespaces within a first-tier namespace of “Msn.” Our code files typically start off like this:
780780
@@ -915,7 +915,7 @@ Ideally a CSS minification tool would be able to analyze the rule set and elimin
915915
Default CSS Minification
916916
========================
917917
918-
As mentioned in the introduction, the CSS minification portion of AjaxMin does not perform as sophisticated algorithms as the JavaScript portion. By default it will:
918+
As mentioned in the introduction, the CSS minification portion of NUglify does not perform as sophisticated algorithms as the JavaScript portion. By default it will:
919919
920920
- Remove all insignificant whitespace.
921921
- Remove all comments.

readme.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AjaxMin [![Windows CI](https://ci.appveyor.com/api/projects/status/github/xoofx/ajaxmin?svg=true)](https://ci.appveyor.com/project/xoofx/ajaxmin/branch/master)
1+
# NUglify [![Build status](https://ci.appveyor.com/api/projects/status/vep1cdnie9cls48p?svg=true)](https://ci.appveyor.com/project/xoofx/ajaxmin)
22

3-
AjaxMin enables you to improve the performance of your web applications by reducing the size of your Cascading Style Sheet and JavaScript files.
3+
NUglify enables you to improve the performance of your web applications by reducing the size of your Cascading Style Sheet and JavaScript files.
44

55
This repository is a fork of the [Microsoft Ajax Minifier](http://ajaxmin.codeplex.com/)
66

@@ -15,7 +15,7 @@ The original documentation of the project is available [here](doc/readme.md)
1515
You may wonder why this fork? Here are a few reasons:
1616

1717
- Ron Logan announced that he is no longer able to maintain this project [here](http://ajaxmin.codeplex.com/discussions/587925)
18-
- While ASP.NET 5.0+ is now relying on the **node.js** ecosystem for its client side tooling (e.g: minify), AjaxMin is **still useful** in scenarios where we need to access this tooling from a .NET application (not necessarily an ASP one) without having to install another developer platform. I can't believe that Ajaxmin could be left behind while it is still valuable!
18+
- While ASP.NET 5.0+ is now relying on the **node.js** ecosystem for its client side tooling (e.g: minify), NUglify is **still useful** in scenarios where we need to access this tooling from a .NET application (not necessarily an ASP one) without having to install another developer platform. I can't believe that Ajaxmin could be left behind while it is still valuable!
1919
- The original code was also hosted on codeplex making it a much less appealing code source platform to collaborate compare to github.
2020
- It was not possible to keep the history of the commits, as the Ajaxmin SVN codeplex seems to be completely down
2121
- I wanted the library to be compatible with CoreCLR/dotnet-cli scenarios
@@ -39,6 +39,6 @@ The original Microsoft Ajax Minifier was released under the [Apache 2.0 license]
3939

4040
## Author
4141

42-
AjaxMin was created and is maintained by Ron Logan, with contributions from Eugene Chigirinskiy, Rafael Correa, Kristoffer Henriksson, and Marcin Dobosz.
42+
Microsoft Ajax Minifier was created and maintained by Ron Logan, with contributions from Eugene Chigirinskiy, Rafael Correa, Kristoffer Henriksson, and Marcin Dobosz.
4343

44-
This project has been ported and refactored to github by Alexandre Mutel aka [xoofx](http://xoofx.com)
44+
Nuglify was ported and refactored to github by Alexandre Mutel aka [xoofx](http://xoofx.com)

src/AjaxMin.Tasks/AjaxMin.targets

-38
This file was deleted.

src/AjaxMin.Tasks/AjaxMin.tasks

-4
This file was deleted.

src/AjaxMin.Tasks/AjaxMinTask.targets

-4
This file was deleted.

src/AjaxMin.Tasks/ManifestStrings.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AjaxMin.Tasks/AjaxMin.Tasks.csproj src/AjaxMin.Tasks/NUglify.Tasks.csproj

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ProjectGuid>{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>AjaxMin</RootNamespace>
12-
<AssemblyName>AjaxMin.Tasks</AssemblyName>
11+
<RootNamespace>NUglify</RootNamespace>
12+
<AssemblyName>NUglify.Tasks</AssemblyName>
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<TargetFrameworkProfile />
@@ -43,17 +43,17 @@
4343
<Reference Include="System.Xml" />
4444
</ItemGroup>
4545
<ItemGroup>
46-
<Compile Include="..\AjaxMinApp\ManifestUtilities.cs">
46+
<Compile Include="..\NUglifyApp\ManifestUtilities.cs">
4747
<Link>ManifestUtilities.cs</Link>
4848
</Compile>
49-
<Compile Include="..\AjaxMin\Properties\ProductAssemblyInfo.cs">
49+
<Compile Include="..\NUglify\Properties\ProductAssemblyInfo.cs">
5050
<Link>Properties\ProductAssemblyInfo.cs</Link>
5151
</Compile>
52-
<Compile Include="AjaxMinBundleTask.cs" />
53-
<Compile Include="AjaxMinManifestBaseTask.cs" />
54-
<Compile Include="AjaxMinManifestCleanTask.cs" />
55-
<Compile Include="AjaxMinManifestTask.cs" />
56-
<Compile Include="AjaxMinBuildTask.cs" />
52+
<Compile Include="NUglifyBundleTask.cs" />
53+
<Compile Include="NUglifyManifestBaseTask.cs" />
54+
<Compile Include="NUglifyManifestCleanTask.cs" />
55+
<Compile Include="NUglifyManifestTask.cs" />
56+
<Compile Include="NUglifyBuildTask.cs" />
5757
<Compile Include="GlobalSuppressions.cs" />
5858
<Compile Include="ManifestStrings.Designer.cs">
5959
<AutoGen>True</AutoGen>
@@ -68,14 +68,14 @@
6868
</Compile>
6969
</ItemGroup>
7070
<ItemGroup>
71-
<None Include="AjaxMin.tasks">
71+
<None Include="NUglify.tasks">
7272
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7373
</None>
74-
<None Include="AjaxMin.targets">
74+
<None Include="NUglify.targets">
7575
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7676
<SubType>Designer</SubType>
7777
</None>
78-
<None Include="AjaxMinTask.targets">
78+
<None Include="NUglifyTask.targets">
7979
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
8080
</None>
8181
<None Include="install.ps1" />
@@ -97,7 +97,7 @@
9797
<Link>CustomDictionary.xml</Link>
9898
</CodeAnalysisDictionary>
9999
</ItemGroup>
100-
<Import Project="$(MSBuildThisFileDirectory)..\AjaxMin.shared.targets" />
100+
<Import Project="$(MSBuildThisFileDirectory)..\NUglify.shared.targets" />
101101
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
102102
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
103103
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)