Skip to content

Commit

Permalink
1. In BundleTransformer.ConfigurationIntelliSense updated definitions…
Browse files Browse the repository at this point in the history
… for configuration settings of LESS translator;

2. In BundleTransformer.Less:
	2.1. Added support of LESS version 3.8.1;
	2.2. In configuration settings of LESS translator the `StrictMath` property has been replaced by the `Math` property (default `Always`).
  • Loading branch information
Taritsyn committed Nov 11, 2018
1 parent 2916e62 commit f68b82f
Show file tree
Hide file tree
Showing 15 changed files with 2,126 additions and 858 deletions.
18 changes: 18 additions & 0 deletions Licenses/clone-license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright © 2011-2015 Paul Vorbach <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BundleTransformer.ConfigurationIntelliSense adds a IntelliSense support during editing of the `bundleTransformer` configuration section in the `Web.config` file.</description>
<summary>BundleTransformer.ConfigurationIntelliSense adds a IntelliSense support during editing of the `bundleTransformer` configuration section in the `Web.config` file.</summary>
<releaseNotes>1. Added a definitions for configuration settings of NUglify minifiers;
2. Updated a definitions for configuration settings of Microsoft Ajax JS minifier.</releaseNotes>
<releaseNotes>Updated definitions for configuration settings of LESS translator.</releaseNotes>
<copyright>Copyright (c) 2012-2018 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
<language>en-US</language>
<tags>BundleTransformer Web.config IntelliSense</tags>
Expand Down
4 changes: 1 addition & 3 deletions NuGet/BundleTransformer.ConfigurationIntelliSense/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
=============
RELEASE NOTES
=============
1. Added a definitions for configuration settings of NUglify minifiers;
2. Updated a definitions for configuration settings of Microsoft Ajax JS
minifier.
Updated definitions for configuration settings of LESS translator.

=============
DOCUMENTATION
Expand Down
8 changes: 5 additions & 3 deletions NuGet/BundleTransformer.Less/BundleTransformer.Less.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
<projectUrl>https://github.com/Taritsyn/BundleTransformer</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Taritsyn/BundleTransformer/master/images/icons/128/BundleTransformer_Less_Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BundleTransformer.Less contains one translator-adapter - `LessTranslator` (supports the LESS (http://lesscss.org) version 3.0.4). This adapter makes translation of LESS code to CSS code. Also contains the `LessAssetHandler` debugging HTTP handler, which is responsible for text output of translated LESS asset.
<description>BundleTransformer.Less contains one translator-adapter - `LessTranslator` (supports the LESS (http://lesscss.org) version 3.8.1). This adapter makes translation of LESS code to CSS code. Also contains the `LessAssetHandler` debugging HTTP handler, which is responsible for text output of translated LESS asset.

BundleTransformer.Less does not support loading of plugins.

As a JS engine is used the JavaScript Engine Switcher library (https://github.com/Taritsyn/JavaScriptEngineSwitcher). For correct working of this module, you need to install one of the following NuGet packages: JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.ChakraCore.</description>
<summary>BundleTransformer.Less contains one translator-adapter - `LessTranslator` (supports the LESS version 3.0.4). This adapter makes translation of LESS code to CSS code. Also contains the `LessAssetHandler` debugging HTTP handler, which is responsible for text output of translated LESS asset.</summary>
<releaseNotes>Added support of LESS version 3.0.4.</releaseNotes>
<summary>BundleTransformer.Less contains one translator-adapter - `LessTranslator` (supports the LESS version 3.8.1). This adapter makes translation of LESS code to CSS code. Also contains the `LessAssetHandler` debugging HTTP handler, which is responsible for text output of translated LESS asset.</summary>
<releaseNotes>1. Added support of LESS version 3.8.1;
2. In configuration settings of LESS translator the `StrictMath` property has been replaced by the `Math` property (default `Always`).</releaseNotes>
<copyright>Copyright (c) 2012-2018 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
<language>en-US</language>
<tags>BundleTransformer System.Web.Optimization IBundleTransform ASP.NET CSS Bundling LESS Translation Translator Compilation Compiler</tags>
Expand All @@ -35,6 +36,7 @@ As a JS engine is used the JavaScript Engine Switcher library (https://github.co
<file src="content\web.config.transform" target="content" />
<file src="readme.txt" />
<file src="..\..\Licenses\less-license.txt" />
<file src="..\..\Licenses\clone-license.txt" />
<file src="..\..\Licenses\js-engine-switcher-license.txt" />
<file src="..\..\Licenses\newtonsoft-json-license.txt" />
</files>
Expand Down
6 changes: 4 additions & 2 deletions NuGet/BundleTransformer.Less/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
DESCRIPTION
===========
BundleTransformer.Less contains one translator-adapter - `LessTranslator`
(supports the LESS (http://lesscss.org) version 3.0.4). This adapter makes
(supports the LESS (http://lesscss.org) version 3.8.1). This adapter makes
translation of LESS code to CSS code. Also contains the `LessAssetHandler`
debugging HTTP handler, which is responsible for text output of translated LESS
asset.
Expand All @@ -25,7 +25,9 @@
=============
RELEASE NOTES
=============
Added support of LESS version 3.0.4.
1. Added support of LESS version 3.8.1;
2. In configuration settings of LESS translator the `StrictMath` property has
been replaced by the `Math` property (default `Always`).

====================
POST-INSTALL ACTIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,34 @@
<xs:documentation>Flag for whether to enforce IE compatibility (IE8 data-uri)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="strictMath" type="Boolean_SchemaType" use="optional" default="false">
<xs:attribute name="math" use="optional" default="Always">
<xs:annotation>
<xs:documentation>Flag for whether math has to be within parenthesis</xs:documentation>
<xs:documentation>Math mode</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="Always">
<xs:annotation>
<xs:documentation>Eagerly try to solve all operations</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ParensDivision">
<xs:annotation>
<xs:documentation>Require parens for division `/`</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Parens">
<xs:annotation>
<xs:documentation>Require parens for all operations</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="StrictLegacy">
<xs:annotation>
<xs:documentation>Legacy strict behavior (super-strict)</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="strictUnits" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
Expand Down
2 changes: 1 addition & 1 deletion samples/BundleTransformer.Sample.AspNet4.Mvc4/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
disableClientCache="false" />
</core>
<less useNativeMinification="false" ieCompat="true"
strictMath="false" strictUnits="false"
math="Always" strictUnits="false"
dumpLineNumbers="None" javascriptEnabled="true"
globalVariables="" modifyVariables=""
severity="0">
Expand Down
1 change: 1 addition & 0 deletions src/BundleTransformer.Less/BundleTransformer.Less.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Compile Include="Internal\LessEnvironment.cs" />
<Compile Include="Internal\VirtualFileManager.cs" />
<Compile Include="LineNumbersMode.cs" />
<Compile Include="MathMode.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down
10 changes: 5 additions & 5 deletions src/BundleTransformer.Less/Configuration/LessSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public bool IeCompat
}

/// <summary>
/// Gets or sets a flag for whether math has to be within parenthesis
/// Gets or sets a math mode
/// </summary>
[ConfigurationProperty("strictMath", DefaultValue = false)]
public bool StrictMath
[ConfigurationProperty("math", DefaultValue = MathMode.Always)]
public MathMode Math
{
get { return (bool)this["strictMath"]; }
set { this["strictMath"] = value; }
get { return (MathMode)this["math"]; }
set { this["math"] = value; }
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions src/BundleTransformer.Less/Internal/CompilationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public bool IeCompat
}

/// <summary>
/// Gets or sets a flag for whether math has to be within parenthesis
/// Gets or sets a math mode
/// </summary>
public bool StrictMath
public MathMode Math
{
get;
set;
Expand Down Expand Up @@ -110,7 +110,7 @@ public CompilationOptions()
EnableNativeMinification = false;
IncludePaths = new List<string>();
IeCompat = true;
StrictMath = false;
Math = MathMode.Always;
StrictUnits = false;
DumpLineNumbers = LineNumbersMode.None;
JavascriptEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion src/BundleTransformer.Less/Internal/LessCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private JObject ConvertCompilationOptionsToJson(CompilationOptions options)
new JProperty("compress", options.EnableNativeMinification),
new JProperty("paths", new JArray(processedIncludePaths)),
new JProperty("ieCompat", options.IeCompat),
new JProperty("strictMath", options.StrictMath),
new JProperty("math", (int)options.Math),
new JProperty("strictUnits", options.StrictUnits),
new JProperty("dumpLineNumbers", ConvertLineNumbersModeEnumValueToCode(options.DumpLineNumbers)),
new JProperty("javascriptEnabled", options.JavascriptEnabled)
Expand Down
25 changes: 25 additions & 0 deletions src/BundleTransformer.Less/MathMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace BundleTransformer.Less
{
public enum MathMode
{
/// <summary>
/// Eagerly try to solve all operations
/// </summary>
Always = 0,

/// <summary>
/// Require parens for division `/`
/// </summary>
ParensDivision = 1,

/// <summary>
/// Require parens for all operations
/// </summary>
Parens = 2,

/// <summary>
/// Legacy strict behavior (super-strict)
/// </summary>
StrictLegacy = 3
}
}
Loading

0 comments on commit f68b82f

Please sign in to comment.