Skip to content

Commit

Permalink
move compilers to node
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Dec 15, 2013
1 parent 1547b4c commit a9b874c
Show file tree
Hide file tree
Showing 1,893 changed files with 10,339,858 additions and 422 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ Generated_Code #added for RIA/Silverlight projects
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.XML
packages/
1 change: 1 addition & 0 deletions Demo/BadSyntax.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ is
bad syntax

color: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAKKSURBVHjaxNdPaFRXFMfxT6xk5aQQCBQCSouQmYULyZBsWoQ4lkqLA7NxmSyEYmbRQldNha46BAVRkLiSMHTT1WRjaWheC8VVQhbZyCAIQuGBIAp9WRSkYbp5L0zGTOa+/MGzvNx7fu+c873nnTvU6XS8DzsN5XI5ZO/HuI4r+BATOIMt7GANq/grxNlQp9MZJDyD25gMDOYVfsQjvO236dQBDj7Cb/gjhyiMYQlPcSmv8AWs44sjlPE8fsdc3xrvI/okreNRbRjLKQsPDop4DI+PSbTb7qVQ9hVextkTuD0f4BeM7pfqGXw5yMPU1JTp6WmlUgmsr69bWVmRJMmgo6P4Ad/1XqfNEHo3NzffWWu32+r1eoj4W3yCOEv1ZOiVabVaqtWqcrlsfn5eHMdKpZJKpRIK21x3ja+FFqvRaIjjGGxsbGi1WqBQKIS6uNYt/OlhqRkfH4fdjwmwSQxncE2EnhoZGVEsFkGlUlGr1URRJIqiPIRPnO4iLsiKxaKlpaU9YDUajbyJGs2o/i/9kqDUZiBlUCVJol6va7fbocKXM+HXeaLutlqtZmFhQRzHqtVq6LHpDK5nh4UrozqDLNCeZ8JbIbuzbtUbcU6qX+BNBtevuBnSLhcXF0VRJEmSPY2j2WyGCq929+q1dHIYO+hEHMcKhYLZ2dk9a81mczflAfZzb6/+Jv19CYkctre385CcRXu1V3g4HVfOn9BguYNyxtOpnj/H1+mGk7C73RD3DgJ/4vsTEF3DrUHD3h18e4yRr6DaO+r2mzLv4yv8c0TRn1DDv3nm6lUU08F85xCpvdib3lBheIkbOJe+DjYO2Ps3HuIzfD6oG4Y8Yfq9o0a7rslWXgf/DwAuW8WRnYgtDgAAAABJRU5ErkJggg==);

3 changes: 2 additions & 1 deletion Demo/BadSyntax.sass
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
this is bad syntax!
this is bad syntax!

1 change: 0 additions & 1 deletion Demo/coffeeScriptTest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ setTimeout(() ->
document.getElementsByClassName('coffeeBox')[0].innerHTML = 'hello from the world of coffeeScript!!!'
, 1500);


87 changes: 42 additions & 45 deletions Demo/coffeeScriptTest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions Demo/lessTest.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@

/* -------------------------------------------------------------------------
* !!! AUTOMATICALLY GENERATED CODE !!!
* -------------------------------------------------------------------------
* This file was automatically generated by the OrangeBits compiler.
* Compiled on: 7/19/2012 11:18:35 AM
* Compiled by: REDMOND\justbe
* Source: C:\Users\justbe\Dropbox\Code\OrangeBits\Demo\lessTest.less
* -------------------------------------------------------------------------*/


.lessBox {
background-color: #e5ffe5;
border-color: lime;
border-color: #00ff00;
color: #00d100;
padding: 8px;
margin: 8px;
Expand All @@ -24,5 +13,5 @@
margin: 8px;
}
.spaceTest {
font-family: MuseoSans- 500, "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-family: MuseoSans-500, "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
4 changes: 2 additions & 2 deletions Demo/lessTest.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
margin: @margin / 2;
}


.spaceTest {
font-family: MuseoSans-500, "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
}

6 changes: 3 additions & 3 deletions Demo/sassTest.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* !!! AUTOMATICALLY GENERATED CODE !!!
* -------------------------------------------------------------------------
* This file was automatically generated by the OrangeBits compiler.
* Compiled on: 6/21/2012 7:30:29 PM
* Compiled by: REDMOND\justbe
* Source: C:\Users\justbe\Dropbox\Code\OrangeBits\Demo\sassTest.sass
* Compiled on: 12/15/2013 12:20:47 PM
* Compiled by: JUSTBE-MBP-8\Justin
* Source: C:\Users\Justin\SkyDrive\Code\OrangeBits\Demo\sassTest.sass
* -------------------------------------------------------------------------*/


Expand Down
2 changes: 1 addition & 1 deletion Demo/sassTest.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ $margin: 16px
padding: $margin / 2
margin: $margin / 2


11 changes: 0 additions & 11 deletions Demo/scssTest.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@

/* -------------------------------------------------------------------------
* !!! AUTOMATICALLY GENERATED CODE !!!
* -------------------------------------------------------------------------
* This file was automatically generated by the OrangeBits compiler.
* Compiled on: 6/21/2012 7:30:30 PM
* Compiled by: REDMOND\justbe
* Source: C:\Users\justbe\Dropbox\Code\OrangeBits\Demo\scssTest.scss
* -------------------------------------------------------------------------*/


.scssBox {
background-color: #ffe5e5;
border-color: red;
Expand Down
3 changes: 2 additions & 1 deletion Demo/scssTest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ $margin: 16px;
color: darken($red, 9%);
padding: $margin / 2;
margin: $margin / 2;
}
}

1 change: 1 addition & 0 deletions Demo/stylusTest.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ form input
padding 5px
border 1px solid


25 changes: 25 additions & 0 deletions OrangeBits/CompilerOutputData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrangeBits
{
internal class OutputReceivedEventArgs : EventArgs
{
public string Output { get; set; }
public DataType OutputType { get; set; }

public OutputReceivedEventArgs(string output, DataType outputType)
{
this.OutputType = outputType;
this.Output = output;
}

public enum DataType
{
ERROR,
STANDARD
}
}
}
24 changes: 24 additions & 0 deletions OrangeBits/Compilers/BaseCompiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace OrangeBits.Compilers
{
internal abstract class BaseCompiler : ICompiler
{
public event EventHandler<OutputReceivedEventArgs> OutputDataReceived;

protected virtual void OnOutputDataReceived(OutputReceivedEventArgs e)
{
EventHandler<OutputReceivedEventArgs> handler = OutputDataReceived;
if (handler != null)
{
handler(this, e);
}
}

public abstract CompileResults Compile(string inPath, string outPath);
}
}
19 changes: 4 additions & 15 deletions OrangeBits/Compilers/CoffeeCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,11 @@

namespace OrangeBits.Compilers
{
public class CoffeeCompiler : ICompiler
{
public CompileResults Compile(string inPath, string outPath)
internal class CoffeeCompiler : NodeCompilerBase
{
public CoffeeCompiler()
: base("/c .\\bin\\coffee.cmd -c \"{0}\"")
{
CoffeeScriptCompiler compiler = new CoffeeScriptCompiler(new SassAndCoffee.Core.InstanceProvider<IJavaScriptRuntime>(() => new IEJavaScriptRuntime()));
using (StreamReader sr = new StreamReader(inPath))
{
string content = sr.ReadToEnd();
string output = compiler.Compile(content);
using (StreamWriter sw = new StreamWriter(outPath))
{
sw.WriteLine(OrangeBits.GetHeader(inPath));
sw.Write(output);
}
}
return null;
}
}
}
4 changes: 2 additions & 2 deletions OrangeBits/Compilers/CssMinifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace OrangeBits.Compilers
{
public class CssMinifier : ICompiler
internal class CssMinifier : BaseCompiler
{
public CompileResults Compile(string inPath, string outPath)
public override CompileResults Compile(string inPath, string outPath)
{
using (StreamReader sr = new StreamReader(inPath))
{
Expand Down
1 change: 1 addition & 0 deletions OrangeBits/Compilers/ICompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ namespace OrangeBits.Compilers
interface ICompiler
{
CompileResults Compile(string inPath, string outPath);
event EventHandler<OutputReceivedEventArgs> OutputDataReceived;
}
}
4 changes: 2 additions & 2 deletions OrangeBits/Compilers/JPGCompressor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace OrangeBits.Compilers
{
public class JPGCompressor : ICompiler
internal class JPGCompressor : BaseCompiler
{
public CompileResults Compile(string inPath, string outPath)
public override CompileResults Compile(string inPath, string outPath)
{
var info = new ProcessStartInfo();
info.FileName = "optipng.exe";
Expand Down
4 changes: 2 additions & 2 deletions OrangeBits/Compilers/JsMinifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace OrangeBits.Compilers
{
public class JsMinifier : ICompiler
internal class JsMinifier : BaseCompiler
{
public CompileResults Compile(string inPath, string outPath)
public override CompileResults Compile(string inPath, string outPath)
{
using (StreamReader sr = new StreamReader(inPath))
{
Expand Down
Loading

0 comments on commit a9b874c

Please sign in to comment.