Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: miickel/gulp-angular-templatecache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0a0e4690220188d9047b60a32eb4866431fbe0c7
Choose a base ref
...
head repository: miickel/gulp-angular-templatecache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 76e74d29017bd54949643512f157702672dc4211
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Dec 30, 2017

  1. Drop dependency on deprecated gulp-util

    Closes #148
    demurgos committed Dec 30, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    demurgos Charles Samborski
    Copy the full SHA
    04a5089 View commit details

Commits on Dec 31, 2017

  1. Copy the full SHA
    7a8c55c View commit details
  2. Copy the full SHA
    76e74d2 View commit details
Showing with 827 additions and 27 deletions.
  1. +4 −3 index.js
  2. +797 −0 package-lock.json
  3. +6 −4 package.json
  4. +20 −20 test/test.js
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var es = require('event-stream');
var path = require('path');
var gutil = require('gulp-util');
var through2 = require('through2');
var lodashTemplate = require('lodash.template');
var concat = require('gulp-concat');
var header = require('gulp-header');
var footer = require('gulp-footer');
@@ -84,7 +85,7 @@ function templateCacheFiles(root, base, templateBody, transformUrl) {
* Create buffer
*/

file.contents = new Buffer(gutil.template(template, {
file.contents = new Buffer(lodashTemplate(template)({
url: url,
contents: jsesc(file.contents.toString('utf8')),
file: file
@@ -128,7 +129,7 @@ function wrapInModule(moduleSystem) {
var moduleTemplate = MODULE_TEMPLATES[moduleSystem];

if (!moduleTemplate) {
return gutil.noop();
return through2.obj();
}

return es.pipeline(
797 changes: 797 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-angular-templatecache",
"version": "2.0.0",
"version": "2.1.0",
"description": "Concatenates and registers AngularJS templates in the $templateCache.",
"main": "index.js",
"scripts": {
@@ -33,10 +33,12 @@
"gulp-concat": "2.6.0",
"gulp-footer": "1.0.5",
"gulp-header": "1.8.2",
"gulp-util": "3.0.7",
"jsesc": "2.2.0"
"jsesc": "2.2.0",
"lodash.template": "^4.4.0",
"through2": "^2.0.3"
},
"devDependencies": {
"mocha": "latest"
"mocha": "latest",
"vinyl": "^2.1.0"
}
}
40 changes: 20 additions & 20 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var path = require('path');
var assert = require('assert');
var gutil = require('gulp-util');
var Vinyl = require('vinyl');
var templateCache = require('../index');

describe('gulp-angular-templatecache', function () {
@@ -16,13 +16,13 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-b.html',
contents: new Buffer('<h1 id="template-b">I\'m template B!</h1>')
@@ -44,7 +44,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -68,7 +68,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -89,7 +89,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -110,7 +110,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -131,7 +131,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -159,7 +159,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -183,7 +183,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -209,7 +209,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -232,7 +232,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -255,7 +255,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -283,7 +283,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -308,7 +308,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -335,7 +335,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -356,7 +356,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -377,7 +377,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('<h1 id="template-a">I\'m template A!</h1>')
@@ -403,7 +403,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('yoo')
@@ -428,7 +428,7 @@ describe('gulp-angular-templatecache', function () {
cb();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: __dirname + '/template-a.html',
contents: new Buffer('yoo')