diff --git a/.gitignore b/.gitignore index bd2336ba..5edd79f9 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ OurUmbraco.Site/[Aa]ssets/js/app.min.js OurUmbraco.Site/App_Data/migrations/*.txt OurUmbraco.Site/apidocs/ OurUmbraco.Site/App_Data/Documentation/ +build/tools/node* diff --git a/OurUmbraco.Client/gulpfile.js b/OurUmbraco.Client/gulpfile.js index 07df1325..bae9a371 100644 --- a/OurUmbraco.Client/gulpfile.js +++ b/OurUmbraco.Client/gulpfile.js @@ -10,7 +10,7 @@ var gulp = require('gulp'), imageMin = require('gulp-imagemin'), clean = require('gulp-clean'), svgmin = require('gulp-svgmin'), - cmq = require('gulp-combine-media-queries'); + cmq = require('gulp-group-css-media-queries'); rename = require('gulp-rename'); var settings = { diff --git a/OurUmbraco.Client/package.json b/OurUmbraco.Client/package.json index 3854ea59..2597ebde 100644 --- a/OurUmbraco.Client/package.json +++ b/OurUmbraco.Client/package.json @@ -4,25 +4,25 @@ "description": "Umbraco Our gulpjs config", "main": "gulpfile.js", "private": true, - "dependencies": { - }, + "dependencies": {}, "devDependencies": { - "gulp": "3.8.x", - "gulp-util": "2.2.x", - "gulp-watch": "0.6.x", - "gulp-minify-css": "1.1.x", - "node-sass": "3.2.x", - "gulp-sass": "2.0.x", - "gulp-combine-media-queries": "0.1.x", - "gulp-imagemin": "0.6.x", - "gulp-autoprefixer": "2.3.1", - "gulp-uglify": "0.3.x", - "gulp-jshint": "1.6.x", - "gulp-concat": "2.2.x", - "jshint-stylish": "0.2.x", - "gulp-clean": "0.3.x", - "gulp-svgmin": "0.4.x", - "gulp-rename": "1.2.x" + "gulp": "^3.9.1", + "gulp-autoprefixer": "^3.1.0", + "gulp-clean": "*", + "gulp-concat": "^2.6.0", + "gulp-group-css-media-queries": "^1.1.0", + "gulp-imagemin": "^3.0.2", + "gulp-jshint": "^2.0.1", + "gulp-minify-css": "^1.2.4", + "gulp-rename": "*", + "gulp-sass": "^2.3.2", + "gulp-svgmin": "^1.2.2", + "gulp-uglify": "^2.0.0", + "gulp-util": "^3.0.7", + "gulp-watch": "^4.3.9", + "jshint": "^2.9.2", + "jshint-stylish": "^2.2.0", + "node-sass": "^3.8.0" }, "scripts": { "test": "gulp build --verbose" diff --git a/OurUmbraco.Site/Assets/images/down.svg b/OurUmbraco.Site/Assets/images/down.svg index 0011de86..55a3f2cc 100644 --- a/OurUmbraco.Site/Assets/images/down.svg +++ b/OurUmbraco.Site/Assets/images/down.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/OurUmbraco.Site/Assets/images/selectdown.svg b/OurUmbraco.Site/Assets/images/selectdown.svg index 18499d94..1d00afc3 100644 --- a/OurUmbraco.Site/Assets/images/selectdown.svg +++ b/OurUmbraco.Site/Assets/images/selectdown.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/OurUmbraco.Site/Assets/images/selectdown_our.svg b/OurUmbraco.Site/Assets/images/selectdown_our.svg index 1e39d3c3..8e3bbb8c 100644 --- a/OurUmbraco.Site/Assets/images/selectdown_our.svg +++ b/OurUmbraco.Site/Assets/images/selectdown_our.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/OurUmbraco.Site/Assets/images/selectdown_unfocus.svg b/OurUmbraco.Site/Assets/images/selectdown_unfocus.svg index 348b2e8b..a8657c91 100644 --- a/OurUmbraco.Site/Assets/images/selectdown_unfocus.svg +++ b/OurUmbraco.Site/Assets/images/selectdown_unfocus.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/build/BuildClientFiles.bat b/build/BuildClientFiles.bat index eb282b3a..b1a892f2 100644 --- a/build/BuildClientFiles.bat +++ b/build/BuildClientFiles.bat @@ -3,21 +3,31 @@ SETLOCAL :: SETLOCAL is on, so changes to the path not persist to the actual user's path SET release=%1 -ECHO Installing Npm NuGet Package - -SET nuGetFolder=%CD%\..\packages\ -ECHO Configured packages folder: %nuGetFolder% +SET toolsFolder=%CD%\tools\ ECHO Current folder: %CD% -%CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet +SET nodeFileName=node-v4.5.0-win-x86.7z +SET nodeExtractFolder=%toolsFolder%node.js.450 +IF NOT EXIST %nodeExtractFolder% ( + ECHO Downloading node.js + powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v4.5.0/%nodeFileName%', '%toolsFolder%\%nodeFileName%')" + ECHO Extracting node.js + %toolsFolder%\7za.exe x %toolsFolder%\%nodeFileName% -o%nodeExtractFolder% -aos > nul +) +FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A" -for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\" -for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\" +SET nuGetFolder=%CD%\..\packages\ +FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" +IF %npmPath% == [] ( + ECHO Downloading npm + ECHO Configured packages folder: %nuGetFolder% + ECHO Installing Npm NuGet Package + %CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet + FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" +) REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine -path=%npmPath%;%nodePath% - -ECHO %path% +PATH=%npmPath%;%nodePath% SET buildFolder=%CD% @@ -25,10 +35,11 @@ ECHO Change directory to %CD%\..\OurUmbraco.Client\ CD %CD%\..\OurUmbraco.Client\ ECHO Do npm install and the gulp build -call npm cache clean -call npm install -call npm install -g install gulp -g --quiet -call gulp build +SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %* +%npm% cache clean +%npm% install +%npm% install -g install gulp -g --quiet +gulp build ECHO Move back to the build folder CD %buildFolder% \ No newline at end of file diff --git a/build/RunGulp.bat b/build/RunGulp.bat index 7e364d29..8f47a8ed 100644 --- a/build/RunGulp.bat +++ b/build/RunGulp.bat @@ -1,23 +1,29 @@ @ECHO OFF SETLOCAL :: SETLOCAL is on, so changes to the path not persist to the actual user's path - + SET release=%1 -ECHO Installing Npm NuGet Package +SET toolsFolder=%CD%\tools\ +ECHO Current folder: %CD% + +SET nodeFileName=node-v4.5.0-win-x86.7z +SET nodeExtractFolder=%toolsFolder%node.js.450 +IF NOT EXIST %nodeExtractFolder% ( + ECHO Downloading node.js + powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v4.5.0/%nodeFileName%', '%toolsFolder%\%nodeFileName%')" + ECHO Extracting node.js + %toolsFolder%\7za.exe x %toolsFolder%\%nodeFileName% -o%nodeExtractFolder% -aos > nul +) +FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A" SET nuGetFolder=%CD%\..\packages\ ECHO Configured packages folder: %nuGetFolder% -ECHO Current folder: %CD% - +ECHO Installing Npm NuGet Package %CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet - -for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\" -for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\" +FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine -path=%npmPath%;%nodePath% - -ECHO %path% +PATH=%npmPath%;%nodePath% SET buildFolder=%CD% @@ -25,9 +31,11 @@ ECHO Change directory to %CD%\..\OurUmbraco.Client\ CD %CD%\..\OurUmbraco.Client\ ECHO Do npm install and the gulp build -call npm install -call npm install -g install gulp -g --quiet -call gulp +SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %* +%npm% cache clean +%npm% install +%npm% install -g install gulp -g --quiet +gulp ECHO Move back to the build folder CD %buildFolder% \ No newline at end of file diff --git a/build/tools/7za.exe b/build/tools/7za.exe new file mode 100644 index 00000000..7f6bf86b Binary files /dev/null and b/build/tools/7za.exe differ